./PaxHeaders.17941/icedtea-web-1.6.20000644000000000000000000000013212654403212013512 xustar0030 mtime=1454507658.773157437 30 atime=1454507658.776157397 30 ctime=1454507658.773157437 icedtea-web-1.6.2/0000755000175000002070000000000012654403212014155 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/PaxHeaders.17941/metadata.in0000644000000000000000000000013212654402377015555 xustar0030 mtime=1454507263.237432581 30 atime=1454507658.776157397 30 ctime=1454507658.773157437 icedtea-web-1.6.2/metadata.in/0000755000175000002070000000000012654402377016355 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/metadata.in/PaxHeaders.17941/icedtea-web.pom0000644000000000000000000000013112654402377020517 xustar0030 mtime=1454507263.237432581 29 atime=1454507327.11758063 30 ctime=1454507658.773157437 icedtea-web-1.6.2/metadata.in/icedtea-web.pom0000644000175000002070000000061412654402377021244 0ustar00jvanekmock00000000000000 4.0.0 net.sourceforge.jnlp %{name} %{version} icedtea-web-1.6.2/metadata.in/PaxHeaders.17941/icedtea-web.metainfo.xml0000644000000000000000000000013212654402377022326 xustar0030 mtime=1454507263.237432581 30 atime=1454507327.116580643 30 ctime=1454507658.773157437 icedtea-web-1.6.2/metadata.in/icedtea-web.metainfo.xml0000644000175000002070000000100412654402377023044 0ustar00jvanekmock00000000000000 %{name} epiphany.desktop firefox.desktop midori.desktop Java Browser plug-in implementation from OpenJDK. This plugin is running java applets http://icedtea.classpath.org/wiki/IcedTea-Web CC0-1.0 distro-pkg-dev@openjdk.java.net icedtea-web-1.6.2/metadata.in/PaxHeaders.17941/icedtea-web-plugin.pom0000644000000000000000000000013212654402377022014 xustar0030 mtime=1454507263.236432594 30 atime=1454507327.116580643 30 ctime=1454507658.773157437 icedtea-web-1.6.2/metadata.in/icedtea-web-plugin.pom0000644000175000002070000000061112654402377022535 0ustar00jvanekmock00000000000000 4.0.0 sun.applet %{name}-plugin %{version} icedtea-web-1.6.2/metadata.in/PaxHeaders.17941/icedtea-web-javaws.appdata.xml0000644000000000000000000000013212654402377023427 xustar0030 mtime=1454507263.236432594 30 atime=1454507327.116580643 30 ctime=1454507658.773157437 icedtea-web-1.6.2/metadata.in/icedtea-web-javaws.appdata.xml0000644000175000002070000000326212654402377024155 0ustar00jvanekmock00000000000000 javaws.desktop %{name} Java Javaws implementation from OpenJDK

Free java implementation of jnlp launching protocol.

Originally based on NetX,but now bringing many improvements compared to proprietary implementations.

Powerful debug console, internal appletviewer, safe run-in-sandbox option, extendable "remember me" options and custom policy editor.

It have also possibility to turn all security off and just enjoy legacy web (on your own risk). All via simple itweb-settings gui.

http://icedtea.classpath.org/wiki/IcedTea-Web CC0-1.0 distro-pkg-dev@openjdk.java.net text/jnlp http://icedtea.classpath.org/wiki/images/Javaws_splash.png Itw self describing splash screen http://icedtea.classpath.org/wiki/images/Fullysigned.png Run in sandbox dialog http://icedtea.classpath.org/wiki/images/Policyeditor-in-use.png Simplified view of policy editor
icedtea-web-1.6.2/PaxHeaders.17941/NEW_LINE_IFS0000644000000000000000000000013112654402377015330 xustar0030 mtime=1454507263.232432648 29 atime=1454507327.11458067 30 ctime=1454507658.771157464 icedtea-web-1.6.2/NEW_LINE_IFS0000644000175000002070000000017112654402377016053 0ustar00jvanekmock00000000000000#!/bin/sh NEW_LINE_IFS=" " IFS_BACKUP="$IFS"; #echo "1xx""$IFS""xx" ; IFS="$NEW_LINE_IFS" ; #echo "2xx""$IFS""xx" ; icedtea-web-1.6.2/PaxHeaders.17941/html-gen.sh0000644000000000000000000000013212654402377015514 xustar0030 mtime=1454507263.234432621 30 atime=1454507327.115580657 30 ctime=1454507658.770157477 icedtea-web-1.6.2/html-gen.sh0000755000175000002070000001564112654402377016251 0ustar00jvanekmock00000000000000#!/bin/bash # html-gen.sh # Copyright (C) 2013 Red Hat # # This file is part of IcedTea. # # IcedTea is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # IcedTea is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with IcedTea; see the file COPYING. If not, write to the # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA. # # Linking this library statically or dynamically with other modules is # making a combined work based on this library. Thus, the terms and # conditions of the GNU General Public License cover the whole # combination. # # As a special exception, the copyright holders of this library give you # permission to link this library with independent modules to produce an # executable, regardless of the license terms of these independent # modules, and to copy and distribute the resulting executable under # terms of your choice, provided that you also meet, for each linked # independent module, the terms and conditions of the license of that # module. An independent module is a module which is not derived from # or based on this library. If you modify this library, you may extend # this exception to your version of the library, but you are not # obligated to do so. If you do not wish to do so, delete this # exception statement from your version. ################################################################################ # This script is used by the stamps/html-gen target in Makefile.am. Its purpose # is to produce HTML-escaped and formatted documents from a set of plaintext # documents, namely AUTHORS, NEWS, ChangeLog, and COPYING, located in the # same directory as this script. These generated HTML documents are then used # in the netx About Dialog, which can be invoked with "javaws -about". # The only configuration option is the number of Changesets, and the files processed # are hardcoded. To run the script manually, create a directory "html-gen" in the # same directory as this script, containing files named AUTHORS, NEWS, ChangeLog, # and COPYING. Note that these files WILL be modified in-place during the HTML # "conversion" process. Setting the environment variable "HTML_GEN_DEBUG" to "true" # will enable some output from the script, which may be useful if you encounter # issues with this script's processing of an input file. # The number of Changesets to process into the ChangeLog can be set by setting the # environment variable HTML_GEN_CHANGESETS, or by passing an integer argument to # the script. The parameter will take priority over the environment variable. print_debug() { if [ "$HTML_GEN_DEBUG" ]; then echo "$1"; fi } CHANGESETS="$1" if [ -z "$CHANGESETS" ]; then CHANGESETS="$HTML_GEN_CHANGESETS"; fi if [ -z "$CHANGESETS" ] || [ "$CHANGESETS" -lt 0 ]; then CHANGESETS=10; fi NEWS_ITEMS=2 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${REPO_URL:+ for }$REPO_URL. $CHANGESETS changesets, $NEWS_ITEMS news items" print_debug "Starting sed substitutions" for FILE in NEWS AUTHORS COPYING ChangeLog do print_debug "Processing $FILE..." sed -i -r 's/\t/ /g' "./$FILE" # Convert tabs into four spaces sed -i -r 's/\&/\&/g' "./$FILE" # "&" -> "&" sed -i -r 's/ /\ \ /g' "./$FILE" # Double-spaces into HTML whitespace for format preservation sed -i -r 's/ "<" sed -i -r 's/>/\>/g' "./$FILE" # ">" -> ">" sed -i -r 's_(\<)?(https?://[^ ]*)(\>| |$)_\1\2\3_i' "./$FILE" # Create hyperlinks from http(s) URLs sed -i -r 's/\<(.*@.*)\>/\<\1<\/a>\>/i' "./$FILE" # Create mailto links from email addresses formatted as sed -i -r 's/$/
/' "./$FILE" # "\n" -> "
" mv "$FILE" "$FILE.html" print_debug "$FILE.html finished." done print_debug "Done sed subs. Starting in-place additions" # Centre the column of author names in the Authors file sed -i '4i
' AUTHORS.html # Insert jamIcon above author names sed -i '5i
Jam Icon

' AUTHORS.html echo "
" >> AUTHORS.html 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)" for FILE in NEWS.html ChangeLog.html do print_debug "Processing $FILE..." mv "$FILE" "$FILE.old" COUNTER=0 while read LINE do BOLD=1 if [ "$FILE" = "NEWS.html" ] then if [[ "$LINE" =~ New\ in\ release* ]] then BOLD=0 COUNTER="$(( COUNTER + 1 ))" fi if [ "$COUNTER" -gt "$NEWS_ITEMS" ] # Cut to two releases then break fi else email_regex=".*\<.*\@.*\>" if [[ "$LINE" =~ $email_regex ]] # Matches eg , after HTML-escaping then BOLD=0 fi date_regex=[0-9]{4}-[0-9]{2}-[0-9]{2} if [[ "$LINE" =~ $date_regex* ]] # Matches line starting with eg 2013-07-01 then html_space="\ \ " 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 then break fi fi if [ "$BOLD" -eq 0 ] # Highlight "New In Release" in News, and author name lines in ChangeLog then LINE="$LINE" fi echo "$LINE" >> "$FILE" done < "$FILE.old" rm "$FILE.old" print_debug "$FILE finished" done sed -i -r 's|(\*\ .*):|\1:|' ChangeLog.html # Underline changed files in ChangeLog, eg "* Makefile.am:" end_time="$(date +%s.%N)" print_debug "HTML generation complete" print_debug "Total elapsed time: $(echo "$end_time - $start_time" | bc )" icedtea-web-1.6.2/PaxHeaders.17941/tests0000644000000000000000000000013112654402377014531 xustar0030 mtime=1454507263.279432021 30 atime=1454507658.776157397 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/0000755000175000002070000000000012654402377015332 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/PaxHeaders.17941/report-styles0000644000000000000000000000013112654402377017365 xustar0030 mtime=1454507263.232432648 30 atime=1454507658.776157397 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/report-styles/0000755000175000002070000000000012654402377020166 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/report-styles/PaxHeaders.17941/textreport.xsl0000644000000000000000000000013112654402377022412 xustar0030 mtime=1454507263.232432648 30 atime=1454507327.211579377 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/report-styles/textreport.xsl0000644000175000002070000000774412654402377023152 0ustar00jvanekmock00000000000000 Date: Result: (In brackets are KnownToFail values if any) TOTAL: () passed: () failed: () ignored: () Classes: PASSED FAILED Individual results: IGNORED FAILED PASSED - WARNING This test is known to fail, but have passed! - This test is known to fail - This test is running remote content. icedtea-web-1.6.2/tests/report-styles/PaxHeaders.17941/report.css0000644000000000000000000000013012654402377021466 xustar0030 mtime=1454507263.232432648 29 atime=1454507327.21057939 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/report-styles/report.css0000644000175000002070000000165612654402377022223 0ustar00jvanekmock00000000000000div.passed {background-color:green;height:auto } div.failed {background-color:red ;height:auto} div.ignored {background-color:yellow ;height:auto} div.clazz {display:inline } div.method {display:inline } div.result {display:block; border: thin solid black ;height:auto} div.status {display:inline; } div.wtrace {display:inline; border: thin solid black; float: right;height:auto} div.theader {display:block; border: thin solid black} div.trace {display:block; border: thin solid black} div.space-line { clear: both; margin: 0; padding: 0; width: auto;} div.tablee {width:200px; border: thin solid black; } div.row { border: thin solid black; } div.cell1 {display:inline; float: left;height:auto} div.cell2 {display:inline; float: right;height:auto} a.classSumaryName{font-weight:bold} a.logLink:link {color: black} a.logLink:active {color: black; } a.logLink:visited {color: black;} a.logLink:hover {color: black;font-weight: bolder;} icedtea-web-1.6.2/tests/report-styles/PaxHeaders.17941/output.css0000644000000000000000000000013012654402377021513 xustar0030 mtime=1454507263.232432648 29 atime=1454507327.21057939 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/report-styles/output.css0000644000175000002070000000123012654402377022234 0ustar00jvanekmock00000000000000div.space-line { clear: both; margin: 0; padding: 0; width: auto;} div.classa { border: thin solid black; padding: 5px; margin: 5px;} div.method {border: thin solid black; padding: 5px; margin: 5px;} div.output { border: thin solid black; padding: 5px; margin: 5px; float: left; display: inline; width:30%; overflow-x: scroll} div.item {border-bottom: thin solid black; border-top: thin solid black; border-left: thin solid black; padding: 5px; margin: 5px;} div.stamp { border: thin solid black; padding: 5px; margin: 5px;} div.fulltrace {border-bottom: thin solid black; border-top: thin solid black; border-left: thin solid black; padding: 5px; margin: 5px;} icedtea-web-1.6.2/tests/report-styles/PaxHeaders.17941/logs.xsl0000644000000000000000000000013012654402377021135 xustar0030 mtime=1454507263.232432648 29 atime=1454507327.21057939 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/report-styles/logs.xsl0000644000175000002070000001541012654402377021663 0ustar00jvanekmock00000000000000

Date:


Result: (s)

In brackets are KnownToFail values if any

TOTAL:
()
passed:
()
failed:
()
ignored:
()

Classes:

passed failed # (ms): ;
TOTAL:
()
passed:
()
failed:
()
ignored:
()

Individual results:

ignored failed passed
IGNORED (s) PASSED (s) " - WARNING This test is known to fail, but have passed! - This test is known to fail - This test is running remote content, note that failures may be caused by broken target application or connection
FAILED (s) - This test is known to fail - This test is running remote content, note that failures may be caused by broken target application or connection
-
                    
                  
STD-OUT -
                
              
STD-ERR -
                
              
icedtea-web-1.6.2/tests/report-styles/PaxHeaders.17941/index.js0000644000000000000000000000013012654402377021106 xustar0030 mtime=1454507263.231432661 29 atime=1454507327.21057939 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/report-styles/index.js0000644000175000002070000000460612654402377021641 0ustar00jvanekmock00000000000000function showhideMethods(inElement,toValue) { var e = document.getElementById(inElement); methods=e.getElementsByClassName("method"); for ( var i = 0; i < methods.length; i++ ) { methods[i].style.display=toValue } } function openAnchor() { anchor=self.document.location.hash; if (anchor==null || anchor=="") return; stub=anchor.substring(1); var logs=getLogsArray(stub); logs[0].style.display="inline"; logs[1].style.display="inline"; recalcArraysWidth(logs); window.location.hash=stub; } function negateIdDisplay(which) { var e = document.getElementById(which); if (e.style.display=="block") { e.style.display="none" } else { e.style.display="block" } } function negateIdDisplayInline(which) { var e = document.getElementById(which); if (e.style.display=="inline") { e.style.display="none" } else { e.style.display="inline" } } function setClassDisplay(which,what) { var e = document.getElementsByClassName(which); for ( var i = 0; i < e.length; i++ ) { e[i].style.display=what } } function negateClassBlocDisplay(which) { var e = document.getElementsByClassName(which); for ( var i = 0; i < e.length; i++ ) { if (e[i].style.display=="block") { e[i].style.display="none" } else { e[i].style.display="block" } } } function negateClassBlocDisplayIn(where,which) { var parent = document.getElementById(where); var e = parent.getElementsByClassName(which); for ( var i = 0; i < e.length; i++ ) { if (e[i].style.display=="block") { e[i].style.display="none" } else { e[i].style.display="block" } } } function getLogsArray(stub) { return new Array(document.getElementById(stub+".out"),document.getElementById(stub+".err"),document.getElementById(stub+".all")); } function recalcLogsWidth(stub) { var logs=getLogsArray(stub) recalcArraysWidth(logs); } function showAllLogs() { var e = document.getElementsByClassName("method"); for ( var i = 0; i < e.length; i++ ) { stub=e[i].id; var logs=getLogsArray(stub) logs[0].style.display="none"; logs[1].style.display="none" logs[2].style.display="inline" recalcArraysWidth(logs); } } function recalcArraysWidth(logs) { visible=0; for ( var i = 0; i < logs.length; i++ ) { if (logs[i].style.display!="none"){ visible++; } } if (visible==0) return; nwWidth=90/visible; for ( var i = 0; i < logs.length; i++ ) { if (logs[i].style.display!="none"){ logs[i].style.width=nwWidth+"%"; } } } icedtea-web-1.6.2/tests/PaxHeaders.17941/netx0000644000000000000000000000013112654402377015507 xustar0030 mtime=1454507263.281431994 30 atime=1454507658.776157397 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/0000755000175000002070000000000012654402377016310 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/netx/PaxHeaders.17941/unit0000644000000000000000000000013112654402377016466 xustar0030 mtime=1454507263.229432688 30 atime=1454507658.776157397 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/0000755000175000002070000000000012654402377017267 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/netx/unit/PaxHeaders.17941/sun0000644000000000000000000000013112654402377017273 xustar0030 mtime=1454507263.229432688 30 atime=1454507658.776157397 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/sun/0000755000175000002070000000000012654402377020074 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/netx/unit/sun/PaxHeaders.17941/applet0000644000000000000000000000013112654402377020560 xustar0030 mtime=1454507263.231432661 30 atime=1454507658.776157397 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/sun/applet/0000755000175000002070000000000012654402377021361 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/netx/unit/sun/applet/PaxHeaders.17941/PluginProxySelectorTest.java0000644000000000000000000000013012654402377026340 xustar0030 mtime=1454507263.231432661 29 atime=1454507327.21057939 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/sun/applet/PluginProxySelectorTest.java0000644000175000002070000002112312654402377027064 0ustar00jvanekmock00000000000000/* PluginProxySelectorTest Copyright (C) 2013 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package sun.applet; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import java.net.InetSocketAddress; import java.net.Proxy; import java.net.Proxy.Type; import java.net.URI; import java.net.URISyntaxException; import java.util.List; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.JNLPProxySelector; import org.junit.Before; import org.junit.Test; public class PluginProxySelectorTest { private static class TestSelector extends PluginProxySelector { private URI browserResponse = null; private int remoteCallCount = 0; public TestSelector(DeploymentConfiguration config) { super(config); } @Override protected Object getProxyFromRemoteCallToBrowser(String uri) { remoteCallCount++; return browserResponse; } public void setBrowserResponse(URI response) { browserResponse = response; } public int getRemoteCallCount() { return remoteCallCount; } } private String PROXY_HOST = "localhost"; private int PROXY_PORT = 42; private DeploymentConfiguration config; private TestSelector proxySelector; @Before public void setUp() { config = new DeploymentConfiguration(); config.setProperty(DeploymentConfiguration.KEY_PROXY_TYPE, String.valueOf(JNLPProxySelector.PROXY_TYPE_BROWSER)); proxySelector = new TestSelector(config); } @Test public void testNullResponseFromBrowserMeansNoProxy() throws URISyntaxException { List result = proxySelector.select(new URI("http://example.org")); assertNotNull(result); assertEquals(1, result.size()); assertEquals(Proxy.NO_PROXY, result.get(0)); } @Test public void testUnrecognizedURIMeansNoProxy() throws URISyntaxException { TestSelector proxySelector = new TestSelector(config); proxySelector.setBrowserResponse(new URI("http://" + PROXY_HOST + ":" + PROXY_PORT)); List result = proxySelector.select(new URI("foo://example.org")); assertNotNull(result); assertEquals(1, result.size()); assertEquals(Proxy.NO_PROXY, result.get(0)); } @Test public void testHttpResponseFromBrowser() throws URISyntaxException { proxySelector.setBrowserResponse(new URI("http://" + PROXY_HOST + ":" + PROXY_PORT)); List result = proxySelector.select(new URI("http://example.org")); Proxy expectedProxy = new Proxy(Type.HTTP, new InetSocketAddress(PROXY_HOST, PROXY_PORT)); assertNotNull(result); assertEquals(1, result.size()); assertEquals(expectedProxy, result.get(0)); } @Test public void testHttpsResponseFromBrowser() throws URISyntaxException { proxySelector.setBrowserResponse(new URI("https://" + PROXY_HOST + ":" + PROXY_PORT)); List result = proxySelector.select(new URI("https://example.org")); // FIXME if a browser returns a https URI, that does not mean socks Proxy expectedProxy = new Proxy(Type.SOCKS, new InetSocketAddress(PROXY_HOST, PROXY_PORT)); assertNotNull(result); assertEquals(1, result.size()); assertEquals(expectedProxy, result.get(0)); } @Test public void testFtpResponseFromBrowser() throws URISyntaxException { proxySelector.setBrowserResponse(new URI("ftp://" + PROXY_HOST + ":" + PROXY_PORT)); List result = proxySelector.select(new URI("ftp://example.org")); // FIXME if a browser returns a ftp URI, that doesn't mean socks Proxy expectedProxy = new Proxy(Type.SOCKS, new InetSocketAddress(PROXY_HOST, PROXY_PORT)); assertNotNull(result); assertEquals(1, result.size()); assertEquals(expectedProxy, result.get(0)); } @Test public void testSocketResponseFromBrowser() throws URISyntaxException { TestSelector proxySelector = new TestSelector(config); // TODO does firefox actually return a "socks" URI? or a "socket" uri? proxySelector.setBrowserResponse(new URI("socks://" + PROXY_HOST + ":" + PROXY_PORT)); List result = proxySelector.select(new URI("socket://example.org")); Proxy expectedProxy = new Proxy(Type.SOCKS, new InetSocketAddress(PROXY_HOST, PROXY_PORT)); assertNotNull(result); assertEquals(1, result.size()); assertEquals(expectedProxy, result.get(0)); } @Test public void testCacheIsUsedOnRepeatedCalls() throws URISyntaxException { proxySelector.setBrowserResponse(new URI("http://" + PROXY_HOST + ":" + PROXY_PORT)); proxySelector.select(new URI("http://example.org")); proxySelector.select(new URI("http://example.org")); assertEquals(1, proxySelector.getRemoteCallCount()); } @Test public void testCacheIsNotUsedOnDifferentCalls() throws URISyntaxException { proxySelector.setBrowserResponse(new URI("http://" + PROXY_HOST + ":" + PROXY_PORT)); proxySelector.select(new URI("http://foo.example.org")); proxySelector.select(new URI("http://bar.example.org")); assertEquals(2, proxySelector.getRemoteCallCount()); } @Test public void testConvertUriSchemeForProxyQuery() throws Exception { URI[] testUris = { new URI("http", "foo.com", "/bar", null), new URI("https", "foo.com", "/bar", null), new URI("ftp", "foo.com", "/app/res/pub/channel.jar?i=1234", null), new URI("socket", "foo.co.uk", "/bar/pub/ale.jar", null), }; for (URI uri : testUris) { URI result = new URI(PluginProxySelector.convertUriSchemeForProxyQuery(uri)); assertQueryForBrowserProxyUsesHttpFallback(uri, result); String hierarchicalPath = result.getAuthority() + result.getPath(); assertQueryForBrowserProxyContainsNoDoubleSlashes(hierarchicalPath); assertQueryForBrowserProxyDoesNotChangeQuery(uri, result); } } // Test that only HTTP is used as fallback scheme if a protocol other than HTTP(S) or FTP is specified public void assertQueryForBrowserProxyUsesHttpFallback(URI expected, URI result) { if (expected.getScheme().equals("ftp") || expected.getScheme().startsWith("http")) { assertEquals(expected.getScheme(), result.getScheme()); } else { assertEquals(result.getScheme(), "http"); } } // Test that absolute resource paths do not result in double-slashes within the URI public void assertQueryForBrowserProxyContainsNoDoubleSlashes(String uri) { assertFalse(uri.contains("//")); } // Test that the query string of the URI is not changed public void assertQueryForBrowserProxyDoesNotChangeQuery(URI expected, URI result) { assertEquals(expected.getQuery(), result.getQuery()); } } icedtea-web-1.6.2/tests/netx/unit/sun/applet/PaxHeaders.17941/PluginParameterParserTest.java0000644000000000000000000000013012654402377026613 xustar0030 mtime=1454507263.230432674 29 atime=1454507327.21057939 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/sun/applet/PluginParameterParserTest.java0000644000175000002070000001036112654402377027341 0ustar00jvanekmock00000000000000/* Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package sun.applet; import static org.junit.Assert.*; import java.util.Map; import net.sourceforge.jnlp.PluginParameters; import org.junit.Test; public class PluginParameterParserTest { @Test public void testIsInt() { assertFalse(PluginParameterParser.isInt("1.0")); assertFalse(PluginParameterParser.isInt("abc")); assertTrue(PluginParameterParser.isInt("1")); /* Numbers that overflow or underflow can cause problems if we * consider them valid, and pass them to parseInt: */ assertFalse(PluginParameterParser.isInt("4294967295")); } @Test public void testUnescapeString() { assertEquals("", PluginParameterParser.unescapeString("")); assertEquals("\n", PluginParameterParser.unescapeString("\n")); assertEquals("\\", PluginParameterParser.unescapeString("\\\\")); assertEquals(";", PluginParameterParser.unescapeString("\\:")); assertEquals("test\n\\;", PluginParameterParser.unescapeString("test" + "\\n" + "\\\\" + "\\:")); assertEquals("start\n;end\\;", PluginParameterParser.unescapeString("start\\n\\:end\\\\;")); } @Test public void testParseEscapedKeyValuePairs() { Map params; params = PluginParameterParser.parseEscapedKeyValuePairs("key1;value1;KEY2\\:;value2\\\\;"); assertEquals(params.size(), 2); assertEquals(params.get("key1"), "value1"); assertEquals(params.get("key2;"), "value2\\"); // ensure key is lowercased params = PluginParameterParser.parseEscapedKeyValuePairs(""); assertEquals(params.size(), 0); params = PluginParameterParser.parseEscapedKeyValuePairs("key;;"); assertEquals(params.size(), 1); assertEquals(params.get("key"), ""); params = PluginParameterParser.parseEscapedKeyValuePairs(";value;"); assertEquals(params.size(), 1); assertEquals(params.get(""), "value"); } @Test public void testAttributeParseWidthHeightAttributes() { final String width = "1", height = "1"; final String codeKeyVal = "code;codeValue;"; PluginParameterParser parser = new PluginParameterParser(); PluginParameters params; params = parser.parse(width, height, codeKeyVal); assertEquals("1", params.get("width")); assertEquals("1", params.get("height")); //Test that width height are defaulted to in case of not-a-number attributes: params = parser.parse(width, height, codeKeyVal + " width;NAN;height;NAN;"); assertEquals("1", params.get("width")); assertEquals("1", params.get("height")); } } icedtea-web-1.6.2/tests/netx/unit/sun/applet/PaxHeaders.17941/PluginAppletViewerTest.java0000644000000000000000000000013112654402377026126 xustar0030 mtime=1454507263.230432674 30 atime=1454507327.209579403 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/sun/applet/PluginAppletViewerTest.java0000644000175000002070000002167512654402377026665 0ustar00jvanekmock00000000000000/* Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package sun.applet; import static org.junit.Assert.assertEquals; import static sun.applet.PluginPipeMockUtil.getPluginStoreId; import static sun.applet.PluginPipeMockUtil.getPluginStoreObject; import java.util.concurrent.Callable; import net.sourceforge.jnlp.AsyncCall; import net.sourceforge.jnlp.ServerAccess; import org.junit.After; import org.junit.Before; import org.junit.Test; import sun.applet.mock.PluginPipeMock; import sun.applet.PluginPipeMockUtil; public class PluginAppletViewerTest { /************************************************************************** * Test setup * **************************************************************************/ PluginPipeMock pipeMock; // Set up before each test @Before public void setupMockedMessageHandling() throws Exception { pipeMock = PluginPipeMockUtil.setupMockedMessageHandling(); } @After public void cleanUpMessageHandlingThreads() throws Exception { PluginPipeMockUtil.cleanUpMockedMessageHandling(pipeMock); } /************************************************************************** * Test cases * * A PluginStreamHandler is installed for each, see 'installPipeMock'. * **************************************************************************/ @Test public void testJavascriptCall() throws Exception { /* JS call parameters */ final int jsObjectID = 0; final String callName = "testfunction"; final Object[] arguments = { "testargument", 1 }; // Arbitrary objects AsyncCall call = AsyncCall.startWithTimeOut(new Callable() { public Object call() { return PluginAppletViewer.call(jsObjectID, callName, arguments); } }); String message = pipeMock.getNextRequest(); Object expectedReturn = new Object(); pipeMock.sendResponse("context 0 reference " + parseAndCheckJSCall(message, jsObjectID, callName, arguments) + " JavaScriptCall " + getPluginStoreId(expectedReturn)); assertEquals(expectedReturn, call.join()); } @Test public void testJavascriptEval() throws Exception { /* JS eval parameters */ final int jsObjectID = 0; final String callName = "testfunction"; AsyncCall call = AsyncCall.startWithTimeOut(new Callable() { public Object call() { return PluginAppletViewer.eval(jsObjectID, callName); } }); String message = pipeMock.getNextRequest(); Object expectedReturn = new Object(); pipeMock.sendResponse("context 0 reference " + parseAndCheckJSEval(message, jsObjectID, callName) + " JavaScriptEval " + getPluginStoreId(expectedReturn)); assertEquals(expectedReturn, call.join()); } @Test public void testJavascriptFinalize() throws Exception { final int jsObjectID = 0; AsyncCall call = AsyncCall.startWithTimeOut(new Callable() { public Void call() { PluginAppletViewer.JavaScriptFinalize(jsObjectID); return null; } }); String message = pipeMock.getNextRequest(); pipeMock.sendResponse("context 0 reference " + parseAndCheckJSFinalize(message, jsObjectID) + " JavaScriptFinalize "); call.join(); } @Test public void testJavascriptToString() throws Exception { final int jsObjectID = 0; AsyncCall call = AsyncCall.startWithTimeOut(new Callable() { public String call() { return PluginAppletViewer.javascriptToString(jsObjectID); } }); String message = pipeMock.getNextRequest(); String expectedReturn = "testreturn"; pipeMock.sendResponse("context 0 reference " + parseAndCheckJSToString(message, jsObjectID) + " JavaScriptToString " + getPluginStoreId(expectedReturn)); assertEquals(expectedReturn, call.join()); } /************************************************************************** * Test utilities * **************************************************************************/ /* * Asserts that the message is a valid javascript request and returns the * reference number */ private static int parseAndCheckJSMessage(String message, int messageLength, String messageType, int contextObjectID) { ServerAccess.logOutputReprint(message); String[] parts = message.split(" "); assertEquals(messageLength, parts.length); assertEquals("instance", parts[0]); assertEquals("0", parts[1]); // JSCall's are prefixed with a dummy '0' instance assertEquals("reference", parts[2]); int reference = Integer.parseInt(parts[3]); assertEquals(messageType, parts[4]); assertEquals(contextObjectID, Integer.parseInt(parts[5])); return reference; } /* * Asserts that the message is a valid javascript request and returns the * reference number */ private static int parseAndCheckJSMessage(String message, String messageType, int contextObjectID, String stringArg, Object[] arguments) { int expectedLength = 7 + arguments.length; int reference = parseAndCheckJSMessage(message, expectedLength, messageType, contextObjectID); String[] parts = message.split(" "); assertEquals(stringArg, getPluginStoreObject(Integer.parseInt(parts[6]))); for (int i = 0; i < arguments.length; i++) { int objectID = Integer.parseInt(parts[7+i]); assertEquals(arguments[i], getPluginStoreObject(objectID)); } return reference; } /* * Asserts that the message is a valid javascript method call request, and * returns the reference number */ public static int parseAndCheckJSCall(String message, int contextObjectID, String callName, Object[] arguments) { return parseAndCheckJSMessage(message, "Call", contextObjectID, callName, arguments); } /* * Asserts that the message is a valid javascript Eval request, and returns * the reference number */ public static int parseAndCheckJSEval(String message, int contextObjectID, String evalString) { return parseAndCheckJSMessage(message, "Eval", contextObjectID, evalString, new Object[] {}); } /* * Asserts that the message is a valid javascript Finalize request, and returns * the reference number */ public static int parseAndCheckJSFinalize(String message, int contextObjectID) { int expectedLength = 6; return parseAndCheckJSMessage(message, expectedLength, "Finalize", contextObjectID); } /* * Asserts that the message is a valid javascript ToString request, and returns * the reference number */ public static int parseAndCheckJSToString(String message, int contextObjectID) { int expectedLength = 6; return parseAndCheckJSMessage(message, expectedLength, "ToString", contextObjectID); } } icedtea-web-1.6.2/tests/netx/unit/sun/applet/PaxHeaders.17941/PluginAppletSecurityContextTest.java0000644000000000000000000000013112654402377030041 xustar0030 mtime=1454507263.230432674 30 atime=1454507327.209579403 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/sun/applet/PluginAppletSecurityContextTest.java0000644000175000002070000002100212654402377030560 0ustar00jvanekmock00000000000000/* Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package sun.applet; import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertEquals; import netscape.javascript.JSObject; import org.junit.Test; public class PluginAppletSecurityContextTest { private static PluginAppletSecurityContext dummySecurityContext() { return new PluginAppletSecurityContext(0, false); } @Test public void toIDStringNullTest() { PluginAppletSecurityContext pasc = dummySecurityContext(); assertEquals("literalreturn null", pasc.toObjectIDString(null, Object.class, false)); } @Test public void toIDStringVoidTest() { PluginAppletSecurityContext pasc = dummySecurityContext(); assertEquals("literalreturn void", pasc.toObjectIDString(null, Void.TYPE, false)); assertFalse("literalreturn void".equals(pasc.toObjectIDString(null, Void.class, false))); } @Test public void toIDStringIntegralTest() { // NB: the special .TYPE classes here represent primitives PluginAppletSecurityContext pasc = dummySecurityContext(); // Test both unboxing allowed and not allowed to be sure it doesn't // alter result // although it really shouldn't for (boolean unboxPrimitives : new Boolean[] { false, true }) { assertEquals("literalreturn true", pasc.toObjectIDString( new Boolean(true), Boolean.TYPE, unboxPrimitives)); assertEquals("literalreturn 1", pasc.toObjectIDString(new Byte( (byte) 1), Byte.TYPE, unboxPrimitives)); assertEquals("literalreturn 1", pasc.toObjectIDString( new Character((char) 1), Character.TYPE, unboxPrimitives)); assertEquals("literalreturn 1", pasc.toObjectIDString(new Short( (short) 1), Short.TYPE, unboxPrimitives)); assertEquals("literalreturn 1", pasc.toObjectIDString( new Integer(1), Integer.TYPE, unboxPrimitives)); assertEquals("literalreturn 1", pasc.toObjectIDString(new Long(1), Long.TYPE, unboxPrimitives)); } } @Test public void toIDStringBoxedIntegralNoUnboxingTest() { PluginAppletSecurityContext pasc = dummySecurityContext(); assertFalse("literalreturn true".equals(pasc.toObjectIDString( new Boolean(true), Boolean.class, false))); assertFalse("literalreturn 1".equals(pasc.toObjectIDString(new Byte( (byte) 1), Byte.class, false))); assertFalse("literalreturn 1".equals(pasc.toObjectIDString( new Character((char) 1), Character.class, false))); assertFalse("literalreturn 1".equals(pasc.toObjectIDString(new Short( (short) 1), Short.class, false))); assertFalse("literalreturn 1".equals(pasc.toObjectIDString(new Integer( 1), Integer.class, false))); assertFalse("literalreturn 1".equals(pasc.toObjectIDString(new Long(1), Long.class, false))); } @Test public void toIDStringBoxedIntegralWithUnboxingTest() { PluginAppletSecurityContext pasc = dummySecurityContext(); assertEquals("literalreturn true", pasc.toObjectIDString(new Boolean(true), Boolean.class, true)); assertEquals("literalreturn 1", pasc.toObjectIDString(new Byte((byte) 1), Byte.class, true)); assertEquals("literalreturn 1", pasc.toObjectIDString(new Character( (char) 1), Character.class, true)); assertEquals("literalreturn 1", pasc.toObjectIDString(new Short((short) 1), Short.class, true)); assertEquals("literalreturn 1", pasc.toObjectIDString(new Integer(1), Integer.class, true)); assertEquals("literalreturn 1", pasc.toObjectIDString(new Long(1), Long.class, true)); } @Test public void toIDStringFloatingPoint() { final int prefixLength = "literalreturn ".length(); // NB: the special .TYPE classes here represent primitives PluginAppletSecurityContext pasc = dummySecurityContext(); // Test both unboxing allowed and not allowed to be sure it doesn't // alter result // although it really shouldn't for (boolean unboxPrimitives : new Boolean[] { false, true }) { { final float testFloat = 3.141592f; String idString = pasc.toObjectIDString(new Float(testFloat), Float.TYPE, unboxPrimitives); String floatRepr = idString.substring(prefixLength); assertTrue(testFloat == Float.parseFloat(floatRepr)); } { final double testDouble = 3.141592; String idString = pasc.toObjectIDString(new Double(testDouble), Double.TYPE, unboxPrimitives); String doubleRepr = idString.substring(prefixLength); assertTrue(testDouble == Double.parseDouble(doubleRepr)); } } { final float testFloat = 3.141592f; String idString = pasc.toObjectIDString(new Float(testFloat), Float.class, true); String floatRepr = idString.substring(prefixLength); assertTrue(testFloat == Float.parseFloat(floatRepr)); } { final double testDouble = 3.141592; String idString = pasc.toObjectIDString(new Double(testDouble), Double.class, true); String doubleRepr = idString.substring(prefixLength); assertTrue(testDouble == Double.parseDouble(doubleRepr)); } { final float testFloat = 3.141592f; String idString = pasc.toObjectIDString(new Float(testFloat), Float.class, false); assertFalse(idString.startsWith("literalreturn ")); } { final double testDouble = 3.141592; String idString = pasc.toObjectIDString(new Double(testDouble), Double.class, false); assertFalse(idString.startsWith("literalreturn ")); } } // FIXME: How can we get the permissions to do this? // @Test // public void toIDStringJSObject() { // PluginAppletSecurityContext pasc = dummySecurityContext(); // // long testReference = 1; // assertEquals("literalreturn 1", pasc.toObjectIDString(new JSObject( // testReference), JSObject.class, false)); // } @Test public void toIDStringArbitraryObject() { PluginAppletSecurityContext pasc = dummySecurityContext(); final Object testObject = new Object(); String idString = pasc.toObjectIDString(testObject, testObject.getClass(), false); assertFalse(idString.startsWith("literalreturn")); assertFalse(idString.startsWith("jsobject")); } } icedtea-web-1.6.2/tests/netx/unit/sun/applet/PaxHeaders.17941/MethodOverloadResolverTest.java0000644000000000000000000000013112654402377026776 xustar0030 mtime=1454507263.229432688 30 atime=1454507327.209579403 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/sun/applet/MethodOverloadResolverTest.java0000644000175000002070000004420012654402377027522 0ustar00jvanekmock00000000000000/* Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package sun.applet; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertFalse; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.TreeSet; import net.sourceforge.jnlp.ServerAccess; import netscape.javascript.JSObject; import org.junit.Test; import sun.applet.MethodOverloadResolver.ResolvedMethod; import sun.applet.MethodOverloadResolver.WeightedCast; public class MethodOverloadResolverTest { /************************************************************************** * MethodOverloadResolver.getCostAndCastedObject tests * **************************************************************************/ // Helper methods // Helper class for overload order tests static class CandidateCast implements Comparable{ public CandidateCast(int cost, Class candidate) { this.cost = cost; this.candidate = candidate; } public int getCost() { return cost; } public Class getCandidate() { return candidate; } @Override public int compareTo(CandidateCast other) { return cost > other.cost ? +1 : -1; } private int cost; private Class candidate; } // asserts that these overloads have the given order of preference // and that none of the costs are equal static private void assertOverloadOrder(Object arg, Class... orderedCandidates) { String argClassName = arg.getClass().getSimpleName(); TreeSet casts = new TreeSet(); for (Class candidate : orderedCandidates) { WeightedCast wc = MethodOverloadResolver.getCostAndCastedObject(arg, candidate); assertFalse("Expected valid overload from " + argClassName + " to " + candidate.getSimpleName(), wc == null); // Check previous candidates, _should not_ be 'ambiguous', ie this cost == other cost for (CandidateCast cc : casts) { String failureString = "Unexpected ambiguity overloading " + argClassName + " between " + candidate.getSimpleName() + " and " + cc.candidate.getSimpleName() + " with cost " + cc.cost +"!"; assertFalse(failureString, cc.cost == wc.getCost()); } casts.add(new CandidateCast(wc.getCost(), candidate)); } Class[] actualOrder = new Class[casts.size()]; int n = 0; for (CandidateCast cc : casts) { actualOrder[n] = cc.candidate; ServerAccess.logOutputReprint(arg.getClass().getSimpleName() + " to " + cc.candidate.getSimpleName() + " has cost " + cc.cost); n++; } assertArrayEquals(orderedCandidates, actualOrder); } // Asserts that the given overloads are all of same cost static private void assertInvalidOverloads(Object arg, Class... candidates) { for (Class candidate : candidates) { WeightedCast wc = MethodOverloadResolver.getCostAndCastedObject(arg, candidate); int cost = (wc != null ? wc.getCost() : 0); // Avoid NPE on non-failure String argClassName = arg == null ? "null" : arg.getClass().getSimpleName(); assertTrue("Expected to be unable to cast " + argClassName + " to " + candidate.getSimpleName() + " but was able to with cost " + cost + "!", wc == null); } } static private void assertNotPrimitiveCastable(Object arg) { assertInvalidOverloads(arg, Double.TYPE, Float.TYPE, Long.TYPE, Short.TYPE, Byte.TYPE, Character.TYPE); } static private void assertNotNumberCastable(Object arg) { assertNotPrimitiveCastable(arg); assertInvalidOverloads(arg, Double.class, Float.class, Long.class, Short.class, Byte.class, Character.class); } // Asserts that the given overloads are all of same cost static private void assertAmbiguousOverload(Object arg, Class... candidates) { String argClassName = arg == null ? "null" : arg.getClass().getSimpleName(); List casts = new ArrayList(); for (Class candidate : candidates) { WeightedCast wc = MethodOverloadResolver.getCostAndCastedObject(arg, candidate); assertFalse("Expected valid overload from " + argClassName + " to " + candidate.getSimpleName(), wc == null); // Check previous candidates, _should_ all 'ambiguous', ie this cost == other cost for (CandidateCast cc : casts) { String failureString = "Expected ambiguity " + argClassName + " between " + candidate.getSimpleName() + " and " + cc.candidate.getSimpleName() + ", got costs " + wc.getCost() + " and " + cc.cost + "!"; assertTrue(failureString, cc.cost == wc.getCost()); } casts.add(new CandidateCast(wc.getCost(), candidate)); } } // Test methods @Test public void testBooleanOverloading() { // based on http://jdk6.java.net/plugin2/liveconnect/#OVERLOADED_METHODS assertOverloadOrder(new Boolean(false), Boolean.TYPE, Boolean.class, Double.TYPE, Object.class, String.class); } @Test public void testNumberOverloading() { // based on http://jdk6.java.net/plugin2/liveconnect/#OVERLOADED_METHODS assertAmbiguousOverload(new Double(0), Integer.TYPE, Long.TYPE, Short.TYPE, Byte.TYPE, Character.TYPE); assertOverloadOrder(new Double(0), Double.TYPE, Double.class, Float.TYPE, Boolean.TYPE, Object.class, String.class); } @Test public void testStringOverloading() { // based on http://jdk6.java.net/plugin2/liveconnect/#OVERLOADED_METHODS assertAmbiguousOverload("1", Double.TYPE, Float.TYPE, Integer.TYPE, Long.TYPE, Short.TYPE, Byte.TYPE); assertOverloadOrder("1.0", String.class, Double.TYPE, Object.class); } // Turned off until JSObject is unit-testable (privilege problem) // @Test public void testJSObjectOverloading() { // based on http://jdk6.java.net/plugin2/liveconnect/#OVERLOADED_METHODS assertOverloadOrder(new JSObject(0L), JSObject.class, String.class); assertAmbiguousOverload(new JSObject(0L), Object[].class, String.class); } @Test public void testNullOverloading() { // based on http://jdk6.java.net/plugin2/liveconnect/#OVERLOADED_METHODS assertNotPrimitiveCastable(null); assertAmbiguousOverload(null, Object.class, String.class); } @Test public void testInheritanceOverloading() { // based on http://jdk6.java.net/plugin2/liveconnect/#OVERLOADED_METHODS class FooParent {} class FooChild extends FooParent {} class FooChildOfChild extends FooChild {} assertNotNumberCastable(new FooChildOfChild()); // NB: this is ambiguious as far as costs are concerned, however // MethodOverloadResolver.getBestOverloadMatch sorts out this ambiguity assertAmbiguousOverload(new FooChildOfChild(), FooChild.class, FooParent.class, Object.class); assertOverloadOrder(new FooChild(), FooChild.class, FooParent.class, String.class); } /************************************************************************** * MethodOverloadResolver.getMatchingMethod tests * **************************************************************************/ // Helper methods // Convenient representation of resulting method signature static private String simpleSignature(java.lang.reflect.AccessibleObject m) { StringBuilder sb = new StringBuilder(); for (Class c : MethodOverloadResolver.getParameterTypesFor(m)) { sb.append(c.getSimpleName()); sb.append(", "); } sb.setLength(sb.length() - 2); // Trim last ", " return sb.toString(); } static private Object[] args(Class klazz, Object... params) { List objects = new ArrayList(); objects.add(klazz); // assumes our method test name is "testmethod" objects.add("testmethod"); objects.addAll(Arrays.asList(params)); return objects.toArray( new Object[0]); } // Takes {class, method, arguments...} bundled in one array static private ResolvedMethod getResolvedMethod(Object[] methodAndParams) { /* Copy over argument portion (class and method are bundled in same array for convenience) */ Class c = (Class)methodAndParams[0]; String methodName = (String)methodAndParams[1]; /* Copy over argument portion (class and method are bundled in same array for convenience) */ Object[] params = Arrays.copyOfRange(methodAndParams, 2, methodAndParams.length); return MethodOverloadResolver.getBestMatchMethod(c, methodName, params); } /* Assert that the overload completed properly by simply providing a type signature*/ static private void assertExpectedOverload(Object[] methodAndParams, String expectedSignature, int expectedCost) { ResolvedMethod result = getResolvedMethod(methodAndParams); // Check signature array as string for convenience assertEquals(expectedSignature, simpleSignature(result.getAccessibleObject())); assertEquals(expectedCost, result.getCost()); } /* Assert that the overload completed by providing the expected objects */ static private void assertExpectedOverload(Object[] methodAndParams, Object[] expectedCasts, int expectedCost) { ResolvedMethod result = getResolvedMethod(methodAndParams); assertArrayEquals(expectedCasts, result.getCastedParameters()); assertEquals(expectedCost, result.getCost()); } // Test methods @Test public void testMultipleArgResolve() { abstract class MultipleArg { public abstract void testmethod(String s, int i); public abstract void testmethod(String s, Integer i); } // Numeric to java primitive assertExpectedOverload( args( MultipleArg.class, "teststring", 1 ), "String, int", MethodOverloadResolver.CLASS_SAME_COST + MethodOverloadResolver.NUMERIC_SAME_COST); // String to java primitive assertExpectedOverload( args( MultipleArg.class, "teststring", "1.1" ), "String, int", MethodOverloadResolver.CLASS_SAME_COST + MethodOverloadResolver.STRING_NUMERIC_CAST_COST); // Null to non-primitive type assertExpectedOverload( args( MultipleArg.class, "teststring", (Object)null ), "String, Integer", MethodOverloadResolver.CLASS_SAME_COST + MethodOverloadResolver.NULL_TO_OBJECT_COST); } @Test public void testBoxedNumberResolve() { abstract class BoxedNumber { public abstract void testmethod(Number n); public abstract void testmethod(Integer i); } assertExpectedOverload( args( BoxedNumber.class, 1), "Integer", MethodOverloadResolver.CLASS_SAME_COST); assertExpectedOverload( args( BoxedNumber.class, (short)1), "Number", MethodOverloadResolver.CLASS_SUPERCLASS_COST); } @Test public void testPrimitivesResolve() { abstract class Primitives { public abstract void testmethod(int i); public abstract void testmethod(long l); public abstract void testmethod(float f); public abstract void testmethod(double d); } assertExpectedOverload( args( Primitives.class, 1), "int", MethodOverloadResolver.NUMERIC_SAME_COST); assertExpectedOverload( args( Primitives.class, 1L), "long", MethodOverloadResolver.NUMERIC_SAME_COST); assertExpectedOverload( args( Primitives.class, 1.1f), "float", MethodOverloadResolver.NUMERIC_SAME_COST); assertExpectedOverload( args( Primitives.class, 1.1), "double", MethodOverloadResolver.NUMERIC_SAME_COST); } @Test public void testComplexResolve() { abstract class Complex { public abstract void testmethod(float f); public abstract void testmethod(String s); public abstract void testmethod(JSObject j); } assertExpectedOverload( args( Complex.class, 1), "float", MethodOverloadResolver.NUMERIC_CAST_COST); assertExpectedOverload( args( Complex.class, "1"), "String", MethodOverloadResolver.CLASS_SAME_COST); assertExpectedOverload( args( Complex.class, 1.1f), "float", MethodOverloadResolver.NUMERIC_SAME_COST); // This test is commented out until JSObject can be unit tested (privilege problem) // assertExpectedOverload( // args( Complex.class, new JSObject(0L)), // "JSObject", MethodOverloadResolver.CLASS_SAME_COST); } @Test public void testInheritanceResolve() { class FooParent {} class FooChild extends FooParent {} class FooChildOfChild extends FooChild {} abstract class Inheritance { public abstract void testmethod(FooParent fp); public abstract void testmethod(FooChild fc); } assertExpectedOverload( args( Inheritance.class, new FooParent()), "FooParent", MethodOverloadResolver.CLASS_SAME_COST); assertExpectedOverload( args( Inheritance.class, new FooChild()), "FooChild", MethodOverloadResolver.CLASS_SAME_COST); assertExpectedOverload( args( Inheritance.class, new FooChildOfChild()), "FooChild", MethodOverloadResolver.CLASS_SUPERCLASS_COST); } /* * Test that arrays are casted to strings by using Javascript rules. * Notably, commas have no spacing, and null values are printed as empty strings. */ @Test public void testArrayToStringResolve() { abstract class ArrayAsStringResolve { public abstract void testmethod(String stringRepr); } final Object[] asStringExpectedResult = {"foo,,bar"}; assertExpectedOverload( args( ArrayAsStringResolve.class, (Object) new String[] {"foo", null, "bar"}), asStringExpectedResult, MethodOverloadResolver.ARRAY_CAST_COST); } /* * Test that arrays are casted to other arrays by recursively invoking the * casting rules on each element. */ @Test public void testArrayToArrayResolve() { abstract class IntArrayResolve { public abstract void testmethod(int[] intArray); } // Note that currently, the only array actually received from the Javascript side is // a String[] array, but this may change. final Object[] intArrayExpectedResult = {new int[] {0, 1, 2}}; assertExpectedOverload( args(IntArrayResolve.class, (Object) new String[] {null, "1", "2.1"}), intArrayExpectedResult, MethodOverloadResolver.ARRAY_CAST_COST); assertExpectedOverload( args(IntArrayResolve.class, new int[] {0, 1, 2}), intArrayExpectedResult, MethodOverloadResolver.ARRAY_CAST_COST); assertExpectedOverload( args(IntArrayResolve.class, new double[] {0, 1, 2.1}), intArrayExpectedResult, MethodOverloadResolver.ARRAY_CAST_COST); abstract class NestedArrayResolve { public abstract void testmethod(int[][] nestedArray); } final Object[] nestedArrayExpectedResult = { new int[][] { {1,1}, {2,2} } }; assertExpectedOverload( args(NestedArrayResolve.class, (Object) new String[][] { {"1", "1"}, {"2", "2"} }), nestedArrayExpectedResult, MethodOverloadResolver.ARRAY_CAST_COST); } } icedtea-web-1.6.2/tests/netx/unit/PaxHeaders.17941/net0000644000000000000000000000013112654402377017254 xustar0030 mtime=1454507263.207432981 30 atime=1454507658.776157397 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/0000755000175000002070000000000012654402377020055 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/netx/unit/net/PaxHeaders.17941/sourceforge0000644000000000000000000000013112654402377021577 xustar0030 mtime=1454507263.207432981 30 atime=1454507658.776157397 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/0000755000175000002070000000000012654402377022400 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/PaxHeaders.17941/jnlp0000644000000000000000000000013112654402377022542 xustar0030 mtime=1454507263.294431821 30 atime=1454507658.776157397 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/0000755000175000002070000000000012654402377023343 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.17941/util0000644000000000000000000000013112654402377023517 xustar0030 mtime=1454507263.229432688 30 atime=1454507658.776157397 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/util/0000755000175000002070000000000012654402377024320 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/util/PaxHeaders.17941/replacements0000644000000000000000000000013112654402377026201 xustar0030 mtime=1454507263.229432688 30 atime=1454507658.776157397 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/util/replacements/0000755000175000002070000000000012654402377027002 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/util/replacements/PaxHeaders.17941/BASE64Enco0000644000000000000000000000013112654402377027672 xustar0030 mtime=1454507263.229432688 30 atime=1454507327.209579403 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/util/replacements/BASE64EncoderTest.java0000644000175000002070000001372712654402377032703 0ustar00jvanekmock00000000000000/* BASE64EncoderTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util.replacements; import java.io.ByteArrayOutputStream; import java.io.OutputStream; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.Arrays; import net.sourceforge.jnlp.ServerAccess; import org.junit.Assert; import org.junit.Test; /** Test various corner cases of the parser */ public class BASE64EncoderTest { static final String sSrc = "abcdefgHIJKLMNOPQrstuvwxyz1234567890\r\n" + "-=+_))(**&&&^^%%$$##@@!!~{}][\":'/\\.,><\n" + "+ěšěčřžýáíé=ů/úěřťšďňéíáč"; static final byte[] encoded = {89, 87, 74, 106, 90, 71, 86, 109, 90, 48, 104, 74, 83, 107, 116, 77, 84, 85, 53, 80, 85, 70, 70, 121, 99, 51, 82, 49, 100, 110, 100, 52, 101, 88, 111, 120, 77, 106, 77, 48, 78, 84, 89, 51, 79, 68, 107, 119, 68, 81, 111, 116, 80, 83, 116, 102, 75, 83, 107, 111, 75, 105, 111, 109, 74, 105, 90, 101, 88, 105, 85, 108, 74, 67, 81, 106, 10, 73, 48, 66, 65, 73, 83, 70, 43, 101, 51, 49, 100, 87, 121, 73, 54, 74, 121, 57, 99, 76, 105, 119, 43, 80, 65, 111, 114, 120, 74, 118, 70, 111, 99, 83, 98, 120, 73, 51, 70, 109, 99, 87, 43, 119, 55, 51, 68, 111, 99, 79, 116, 119, 54, 107, 57, 120, 97, 56, 118, 119, 55, 114, 69, 109, 56, 87, 90, 120, 97, 88, 70, 111, 99, 83, 80, 10, 120, 89, 106, 68, 113, 99, 79, 116, 119, 54, 72, 69, 106, 81, 61, 61, 10}; private static final String sunClassD = "sun.misc.BASE64Decoder"; @Test public void testEmbededBase64Encoder() throws Exception { final byte[] data = sSrc.getBytes("utf-8"); // ByteArrayOutputStream out1 = new ByteArrayOutputStream(); // sun.misc.BASE64Encoder e1 = new sun.misc.BASE64Encoder(); // e1.encode(data, out1); // byte[] encoded1 = out1.toByteArray(); // ServerAccess.logErrorReprint(Arrays.toString(encoded1)); ByteArrayOutputStream out2 = new ByteArrayOutputStream(); BASE64Encoder e2 = new BASE64Encoder(); e2.encodeBuffer(data, out2); byte[] encoded2 = out2.toByteArray(); Assert.assertArrayEquals(encoded, encoded2); // ServerAccess.logErrorReprint(Arrays.toString(encoded2)); } @Test /* * This test will fail, in case taht sun.misc.BASE64Decoder will be removed from builders java */ public void testEmbededBase64EncoderAgainstSunOne() throws Exception { final byte[] data = sSrc.getBytes("utf-8"); ByteArrayOutputStream out2 = new ByteArrayOutputStream(); BASE64Encoder e2 = new BASE64Encoder(); e2.encodeBuffer(data, out2); byte[] encoded2 = out2.toByteArray(); Object decoder = createInsatnce(sunClassD); byte[] decoded = (byte[]) (getAndInvokeMethod(decoder, "decodeBuffer", new String(encoded2, "utf-8"))); Assert.assertArrayEquals(data, decoded); Assert.assertEquals(sSrc, new String(decoded, "utf-8")); } @Test public void testEmbededBase64EncoderAgainstEbededDecoder() throws Exception { final byte[] data = sSrc.getBytes("utf-8"); ByteArrayOutputStream out2 = new ByteArrayOutputStream(); BASE64Encoder e2 = new BASE64Encoder(); e2.encodeBuffer(data, out2); byte[] encoded2 = out2.toByteArray(); BASE64Decoder decoder = new BASE64Decoder(); byte[] decoded = decoder.decodeBuffer(new String(encoded2, "utf-8")); Assert.assertArrayEquals(data, decoded); Assert.assertEquals(sSrc, new String(decoded, "utf-8")); } static Object createInsatnce(String ofCalss) throws ClassNotFoundException, InstantiationException, IllegalAccessException { Class classDefinition = Class.forName(ofCalss); return classDefinition.newInstance(); } static Object getAndInvokeMethod(Object instance, String methodName, Object... params) throws NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { Class[] cs = new Class[params.length]; for (int i = 0; i < params.length; i++) { Object object = params[i]; cs[i] = object.getClass(); if (object instanceof OutputStream) { cs[i] = OutputStream.class; } } Method m = instance.getClass().getMethod(methodName, cs); return m.invoke(instance, params); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/util/replacements/PaxHeaders.17941/BASE64Deco0000644000000000000000000000013112654402377027660 xustar0030 mtime=1454507263.229432688 30 atime=1454507327.209579403 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/util/replacements/BASE64DecoderTest.java0000644000175000002070000000774512654402377032674 0ustar00jvanekmock00000000000000/* BASE64EncoderTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util.replacements; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.OutputStream; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import org.junit.Assert; import org.junit.Test; /** Test various corner cases of the parser */ public class BASE64DecoderTest { private static final String sunClassE = "sun.misc.BASE64Encoder"; @Test public void testEmbededBase64Decoder() throws Exception { final byte[] data = BASE64EncoderTest.encoded; ByteArrayOutputStream out2 = new ByteArrayOutputStream(); BASE64Decoder e2 = new BASE64Decoder(); e2.decodeBuffer(new ByteArrayInputStream(data), out2); byte[] decoded = out2.toByteArray(); Assert.assertEquals(BASE64EncoderTest.sSrc, new String(decoded, "utf-8")); } @Test /* * This test will fail, in case taht sun.misc.BASE64Encoder will be removed from builders java */ public void testEmbededBase64DecoderAgainstSunOne() throws Exception { final byte[] data = BASE64EncoderTest.encoded; ByteArrayOutputStream out2 = new ByteArrayOutputStream(); BASE64Decoder e2 = new BASE64Decoder(); e2.decodeBuffer(new ByteArrayInputStream(data), out2); byte[] encoded2 = out2.toByteArray(); Object encoder = BASE64EncoderTest.createInsatnce(sunClassE); ByteArrayOutputStream out = new ByteArrayOutputStream(); BASE64EncoderTest.getAndInvokeMethod(encoder, "encodeBuffer", encoded2, out); Assert.assertArrayEquals(data, out.toByteArray()); Assert.assertArrayEquals(BASE64EncoderTest.encoded, out.toByteArray()); } @Test public void testEmbededBase64DecoderAgainstEmbededEncoder() throws Exception { final byte[] data = BASE64EncoderTest.encoded; ByteArrayOutputStream out2 = new ByteArrayOutputStream(); BASE64Decoder e2 = new BASE64Decoder(); e2.decodeBuffer(new ByteArrayInputStream(data), out2); byte[] encoded2 = out2.toByteArray(); BASE64Encoder encoder = new BASE64Encoder(); ByteArrayOutputStream out = new ByteArrayOutputStream(); encoder.encodeBuffer(encoded2, out); Assert.assertArrayEquals(data, out.toByteArray()); Assert.assertArrayEquals(BASE64EncoderTest.encoded, out.toByteArray()); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/util/PaxHeaders.17941/optionparser0000644000000000000000000000013112654402377026244 xustar0030 mtime=1454507263.228432701 30 atime=1454507658.776157397 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/util/optionparser/0000755000175000002070000000000012654402377027045 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/util/optionparser/PaxHeaders.17941/OptionPars0000644000000000000000000000013112654402377030342 xustar0030 mtime=1454507263.228432701 30 atime=1454507327.209579403 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/util/optionparser/OptionParserTest.java0000644000175000002070000004653412654402377033211 0ustar00jvanekmock00000000000000/*Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util.optionparser; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertTrue; import net.sourceforge.jnlp.OptionsDefinitions; import org.junit.Test; import java.util.List; public class OptionParserTest { @Test public void testGetSingleOptionValue() { String[] args = {"-update", "blob"}; OptionParser parser = new OptionParser(args, OptionsDefinitions.getJavaWsOptions()); String value = parser.getParam(OptionsDefinitions.OPTIONS.UPDATE); assertEquals("blob", value); } @Test public void testGetSingleOptionMultipleValues() { String[] args = {"-arg", "blob", "meow"}; OptionParser parser = new OptionParser(args, OptionsDefinitions.getJavaWsOptions()); List values = parser.getParams(OptionsDefinitions.OPTIONS.ARG); assertEquals(0, values.indexOf("blob")); assertEquals(1, values.indexOf("meow")); assertEquals(2, values.size()); } @Test public void testGetDifferentOptionValues() { String[] args = {"-param", "blob", "-arg", "yelp"}; OptionParser parser = new OptionParser(args, OptionsDefinitions.getJavaWsOptions()); List values = parser.getParams(OptionsDefinitions.OPTIONS.PARAM); assertEquals(0, values.indexOf("blob")); assertEquals(1, values.size()); values = parser.getParams(OptionsDefinitions.OPTIONS.ARG); assertEquals(0, values.indexOf("yelp")); assertEquals(1, values.size()); } @Test public void testSupportedOptionValueNotBeingUsed() { String[] args = {}; OptionParser parser = new OptionParser(args, OptionsDefinitions.getJavaWsOptions()); List values = parser.getParams(OptionsDefinitions.OPTIONS.ARG); assertEquals(0, values.size()); } @Test public void testOptionValueWithNoArgument() { String[] args = {"-arg"}; OptionParser parser = new OptionParser(args, OptionsDefinitions.getJavaWsOptions()); List values = parser.getParams(OptionsDefinitions.OPTIONS.ARG); assertEquals(0, values.size()); } @Test public void testOneOptionMultipleTimesMultipleValues() { String[] args = {"-arg", "poke", "blob", "-arg", "meep"}; OptionParser parser = new OptionParser(args, OptionsDefinitions.getJavaWsOptions()); List values = parser.getParams(OptionsDefinitions.OPTIONS.ARG); assertEquals(3, values.size()); assertEquals(0, values.indexOf("poke")); assertEquals(1, values.indexOf("blob")); assertEquals(2, values.indexOf("meep")); } @Test public void testMultipleOptionsMultipleValues() { String[] args = {"-param", "poke", "blob", "-arg", "meep", "feep", "blurp"}; OptionParser parser = new OptionParser(args, OptionsDefinitions.getJavaWsOptions()); List values = parser.getParams(OptionsDefinitions.OPTIONS.PARAM); assertEquals(2, values.size()); assertEquals(0, values.indexOf("poke")); assertEquals(1, values.indexOf("blob")); values = parser.getParams(OptionsDefinitions.OPTIONS.ARG); assertEquals(3, values.size()); assertEquals(0, values.indexOf("meep")); assertEquals(1, values.indexOf("feep")); assertEquals(2, values.indexOf("blurp")); } @Test public void testCheckOptionExists() { String[] args = {"-headless", "-fish", "-busybee", "boat"}; OptionParser parser = new OptionParser(args, OptionsDefinitions.getJavaWsOptions()); boolean value = parser.hasOption(OptionsDefinitions.OPTIONS.HEADLESS); assertTrue(value); } @Test public void testCheckOptionExistsAsNotFirstArg() { String[] args = {"-run", "fish", "-castle", "-headless"}; OptionParser parser = new OptionParser(args, OptionsDefinitions.getJavaWsOptions()); boolean value = parser.hasOption(OptionsDefinitions.OPTIONS.HEADLESS); assertTrue(value); } @Test public void testCheckOptionNotExists() { String[] args = {"-run", "fish", "-castle", "cat"}; OptionParser parser = new OptionParser(args, OptionsDefinitions.getJavaWsOptions()); boolean value = parser.hasOption(OptionsDefinitions.OPTIONS.HEADLESS); assertFalse(value); } @Test public void testMultipleOptionsWithMainArgAtTheEnd() { String[] args = {"-arg", "-update=green", "-version", "-headless", "-arg", "-about", "-arg", "blah1", "blah2", "blah3", "-noupdate", "-arg", "blah4", "blah5", "blah6", "-headless", "File.jnlp"}; OptionParser parser = new OptionParser(args, OptionsDefinitions.getJavaWsOptions()); List values = parser.getParams(OptionsDefinitions.OPTIONS.ARG); assertEquals(6, values.size()); assertTrue(parser.mainArgExists()); assertEquals("File.jnlp",parser.getMainArg()); assertEquals(0, values.indexOf("blah1")); assertEquals(1, values.indexOf("blah2")); assertEquals(2, values.indexOf("blah3")); assertEquals(3, values.indexOf("blah4")); assertEquals(4, values.indexOf("blah5")); assertEquals(5, values.indexOf("blah6")); } @Test public void testMultipleOptionsWithNoArgsCombinedWithMultipleOptions() { String[] args = {"-arg", "-update=green", "-version", "-arg", "-about", "-arg", "blah1", "blah2", "blah3","-about", "-arg", "blah4", "blah5", "blah6", "File.jnlp", "-headless", "-noupdate"}; OptionParser parser = new OptionParser(args, OptionsDefinitions.getJavaWsOptions()); assertTrue(parser.hasOption(OptionsDefinitions.OPTIONS.ABOUT)); } @Test public void testMainArgExists() { String[] args = {"File.jnlp"}; OptionParser parser = new OptionParser(args, OptionsDefinitions.getJavaWsOptions()); assertTrue(parser.mainArgExists()); assertEquals("File.jnlp", parser.getMainArg()); } @Test public void testMultipleMainArgsReturnsFirstMainArg() { String[] args = {"File.jnlp", "FileTwo,jnlp", "FileThree.jnlp"}; OptionParser parser = new OptionParser(args, OptionsDefinitions.getJavaWsOptions()); assertTrue(parser.mainArgExists()); assertEquals("File.jnlp", parser.getMainArg()); } @Test public void testSameTagMultipleTimesWithMainArg() { String[] args = {"-headless", "-headless","File.jnlp", "-headless", "-headless", "-headless"}; OptionParser parser = new OptionParser(args, OptionsDefinitions.getJavaWsOptions()); assertTrue(parser.mainArgExists()); assertEquals("File.jnlp", parser.getMainArg()); assertTrue(parser.hasOption(OptionsDefinitions.OPTIONS.HEADLESS)); } @Test public void testSameTagMultipleTimesWithoutMainArg() { String[] args = {"-headless", "-headless", "-headless", "-headless", "-headless"}; OptionParser parser = new OptionParser(args, OptionsDefinitions.getJavaWsOptions()); assertFalse(parser.mainArgExists()); assertEquals("",parser.getMainArg()); assertTrue(parser.hasOption(OptionsDefinitions.OPTIONS.HEADLESS)); } @Test public void testMultipleArgTagSurroundingMainArgAfterNoArgOption() { String[] args = {"-arg", "blue", "green", "red", "-headless", "File.jnlp", "-arg", "yellow", "purple"}; OptionParser parser = new OptionParser(args, OptionsDefinitions.getJavaWsOptions()); List values = parser.getParams(OptionsDefinitions.OPTIONS.ARG); assertEquals(0, values.indexOf("blue")); assertEquals(1, values.indexOf("green")); assertEquals(2, values.indexOf("red")); assertEquals(3, values.indexOf("yellow")); assertEquals(4, values.indexOf("purple")); assertTrue(parser.mainArgExists()); assertEquals("File.jnlp", parser.getMainArg()); assertTrue(parser.hasOption(OptionsDefinitions.OPTIONS.HEADLESS)); } @Test public void testOptionWithDashInMiddleWontBeAltered() { String[] args = {"ar-g", "blue", "green", "red"}; OptionParser parser = new OptionParser(args, OptionsDefinitions.getJavaWsOptions()); List values = parser.getParams(OptionsDefinitions.OPTIONS.ARG); assertEquals(values.size(), 0); } @Test public void testGetParamsWithNoValueHasNoValues() { String[] args = {"-arg"}; OptionParser parser = new OptionParser(args, OptionsDefinitions.getJavaWsOptions()); List values = parser.getParams(OptionsDefinitions.OPTIONS.ARG); assertEquals(0, values.size()); } @Test public void testOnlyFirstDashIsAcceptable() { String[] args = {"-arg", "blue", "a-rg", "-headless", "-arg", "green", "-ar-g"}; OptionParser parser = new OptionParser(args, OptionsDefinitions.getJavaWsOptions()); List values = parser.getParams(OptionsDefinitions.OPTIONS.ARG); assertEquals(4, values.size()); assertEquals(0, values.indexOf("blue")); assertEquals(1, values.indexOf("a-rg")); assertEquals(2, values.indexOf("green")); assertEquals(3, values.indexOf("-ar-g")); } @Test public void testOptionsSyntaxPositive() { assertTrue(OptionParser.stringEqualsOption("-headless", OptionsDefinitions.OPTIONS.HEADLESS)); assertTrue(OptionParser.stringEqualsOption("headless", OptionsDefinitions.OPTIONS.HEADLESS)); assertTrue(OptionParser.stringEqualsOption("--headless", OptionsDefinitions.OPTIONS.HEADLESS)); assertTrue(OptionParser.stringEqualsOption("---headless", OptionsDefinitions.OPTIONS.HEADLESS)); } @Test public void testOptionsSyntaxNegative() { assertFalse(OptionParser.stringEqualsOption(" -headless", OptionsDefinitions.OPTIONS.HEADLESS)); assertFalse(OptionParser.stringEqualsOption("h-eadless", OptionsDefinitions.OPTIONS.HEADLESS)); assertFalse(OptionParser.stringEqualsOption("headless-", OptionsDefinitions.OPTIONS.HEADLESS)); assertFalse(OptionParser.stringEqualsOption("- -headless", OptionsDefinitions.OPTIONS.HEADLESS)); assertFalse(OptionParser.stringEqualsOption("--- ---headless", OptionsDefinitions.OPTIONS.HEADLESS)); assertFalse(OptionParser.stringEqualsOption("- ---headless", OptionsDefinitions.OPTIONS.HEADLESS)); assertFalse(OptionParser.stringEqualsOption("--- -headless", OptionsDefinitions.OPTIONS.HEADLESS)); } @Test public void testOptionWithEqualsParamIsValid() { String[] args = {"-arg=blue"}; OptionParser parser = new OptionParser(args, OptionsDefinitions.getJavaWsOptions()); List values = parser.getParams(OptionsDefinitions.OPTIONS.ARG); assertEquals(1, values.size()); assertEquals(0, values.indexOf("blue")); } @Test public void testMultipleOptionWithEqualsParamIsValid() { String[] args = {"-arg=blue", "-property=red", "-param=green"}; OptionParser parser = new OptionParser(args, OptionsDefinitions.getJavaWsOptions()); List values = parser.getParams(OptionsDefinitions.OPTIONS.ARG); assertEquals(1, values.size()); assertEquals(0, values.indexOf("blue")); values = parser.getParams(OptionsDefinitions.OPTIONS.PROPERTY); assertEquals(1, values.size()); assertEquals(0, values.indexOf("red")); values = parser.getParams(OptionsDefinitions.OPTIONS.PARAM); assertEquals(1, values.size()); assertEquals(0, values.indexOf("green")); } @Test public void testSameOptionWithEqualsParamMultipleTimesIsValid() { String[] args = {"-arg=blue", "-arg=red", "-arg=green"}; OptionParser parser = new OptionParser(args, OptionsDefinitions.getJavaWsOptions()); List values = parser.getParams(OptionsDefinitions.OPTIONS.ARG); assertEquals(3, values.size()); assertEquals(0, values.indexOf("blue")); assertEquals(1, values.indexOf("red")); assertEquals(2, values.indexOf("green")); } @Test public void testParamsCanHaveEqualsSigns() { String[] args = {"-arg", "colour=red", "height=50", "width=222", "circular=true"}; OptionParser parser = new OptionParser(args, OptionsDefinitions.getJavaWsOptions()); List values = parser.getParams(OptionsDefinitions.OPTIONS.ARG); assertEquals(4, values.size()); assertEquals(0, values.indexOf("colour=red")); assertEquals(1, values.indexOf("height=50")); assertEquals(2, values.indexOf("width=222")); assertEquals(3, values.indexOf("circular=true")); } @Test public void testParamsCanHaveDashes() { String[] args = {"-arg", "-red", "-koala", "-panda", "-grizzly"}; OptionParser parser = new OptionParser(args, OptionsDefinitions.getJavaWsOptions()); List values = parser.getParams(OptionsDefinitions.OPTIONS.ARG); assertEquals(4, values.size()); assertEquals(0, values.indexOf("-red")); assertEquals(1, values.indexOf("-koala")); assertEquals(2, values.indexOf("-panda")); assertEquals(3, values.indexOf("-grizzly")); } @Test public void testParamsCanHaveDashesAndEqualsSigns() { String[] args = {"-arg", "-red=colour", "-koala=animal", "-panda=bear", "-grizzly=bear"}; OptionParser parser = new OptionParser(args, OptionsDefinitions.getJavaWsOptions()); List values = parser.getParams(OptionsDefinitions.OPTIONS.ARG); assertEquals(4, values.size()); assertEquals(0, values.indexOf("-red=colour")); assertEquals(1, values.indexOf("-koala=animal")); assertEquals(2, values.indexOf("-panda=bear")); assertEquals(3, values.indexOf("-grizzly=bear")); } @Test public void testMainArgAfterNoArgOption() { String[] args = {"-arg", "-red=colour", "-headless", "File.jnlp", "-arg", "-grizzly=bear"}; OptionParser parser = new OptionParser(args, OptionsDefinitions.getJavaWsOptions()); assertEquals("File.jnlp", parser.getMainArg()); } @Test public void testMainArgAfterOneArgOption() { String[] args = {"-arg", "-red=colour", "-update", "200", "File.jnlp", "-arg", "-grizzly=bear"}; OptionParser parser = new OptionParser(args, OptionsDefinitions.getJavaWsOptions()); assertEquals("File.jnlp", parser.getMainArg()); } @Test public void testMainArgAfterManyArgsOptionIsNotAccepted() { String[] args = {"-arg", "-red=colour", "-arg", "200", "File.jnlp", "-arg", "-grizzly=bear"}; OptionParser parser = new OptionParser(args, OptionsDefinitions.getJavaWsOptions()); assertFalse(parser.mainArgExists()); assertNotEquals("File.jnlp", parser.getMainArg()); } @Test public void testOptionWithMultipleEqualSignsOnlyParsesFirstEquals() { String[] args = {"-arg=grizzly=panda=goldfish=mouse"}; OptionParser parser = new OptionParser(args, OptionsDefinitions.getJavaWsOptions()); List values = parser.getParams(OptionsDefinitions.OPTIONS.ARG); assertEquals(1, values.size()); assertEquals(0, values.indexOf("grizzly=panda=goldfish=mouse")); } @Test public void testGetParam() { String[] args = {"-arg", "blue"}; OptionParser parser = new OptionParser(args, OptionsDefinitions.getJavaWsOptions()); String value = parser.getParam(OptionsDefinitions.OPTIONS.ARG); assertEquals("blue", value); } @Test public void testGetParamWithManyParams() { String[] args = {"-arg", "blue", "red", "green"}; OptionParser parser = new OptionParser(args, OptionsDefinitions.getJavaWsOptions()); String value = parser.getParam(OptionsDefinitions.OPTIONS.ARG); assertEquals("blue", value); } @Test public void testGetParamWithNoParams() { String[] args = {"-arg"}; OptionParser parser = new OptionParser(args, OptionsDefinitions.getJavaWsOptions()); String value = parser.getParam(OptionsDefinitions.OPTIONS.ARG); assertEquals("", value); } @Test public void testGetNumberOfOptions() { String[] args = {"-arg", "-version", "-param", "-property", "-update"}; OptionParser parser = new OptionParser(args, OptionsDefinitions.getJavaWsOptions()); assertEquals(5, parser.getNumberOfOptions()); } @Test public void testGetNumberOfOptionsWithOtherOptions() { String[] args = {"-arg", "-version", "-param", "-property", "-update", "-set", "-reset"}; OptionParser parser = new OptionParser(args, OptionsDefinitions.getJavaWsOptions()); assertEquals(5, parser.getNumberOfOptions()); } @Test public void testEvenNumberSupportsEqualsChar() { String[] args = {"-set", "yes", "no", "blue=red", "green", "orange", "yellow=purple=roseyred"}; OptionParser parser = new OptionParser(args, OptionsDefinitions.getItwsettingsCommands()); List values = parser.getParams(OptionsDefinitions.OPTIONS.SET); assertEquals("yes", values.get(0)); assertEquals("no", values.get(1)); assertEquals("blue", values.get(2)); assertEquals("red", values.get(3)); assertEquals("green", values.get(4)); assertEquals("orange", values.get(5)); assertEquals("yellow", values.get(6)); assertEquals("purple=roseyred", values.get(7)); } @Test(expected = UnevenParameterException.class) public void testEvenNumberSupportsEqualsCharThrowsExceptionWhenParametersIsUneven() { String[] args = {"-set", "yes", "no", "blue=red", "green"}; OptionParser parser = new OptionParser(args, OptionsDefinitions.getItwsettingsCommands()); } }icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/util/PaxHeaders.17941/logging0000644000000000000000000000013112654402377025145 xustar0030 mtime=1454507263.228432701 30 atime=1454507658.776157397 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/util/logging/0000755000175000002070000000000012654402377025746 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/util/logging/PaxHeaders.17941/WriterBasedFile0000644000000000000000000000013112654402377030160 xustar0030 mtime=1454507263.228432701 30 atime=1454507327.209579403 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/util/logging/WriterBasedFileLogTest.java0000644000175000002070000001713212654402377033132 0ustar00jvanekmock00000000000000/*Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util.logging; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import net.sourceforge.jnlp.closinglisteners.RulesFolowingClosingListener; import net.sourceforge.jnlp.util.StreamUtils; import net.sourceforge.jnlp.util.logging.filelogs.WriterBasedFileLog; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; public class WriterBasedFileLogTest { private static final File[] loggingTargets = new File[12]; private static final String line1 = "I'm logged line one"; private static final String line2 = "I'm logged line two"; private static final String line3 = "I'm logged line three"; private static final RulesFolowingClosingListener.ContainsRule r1 = new RulesFolowingClosingListener.ContainsRule(line1); private static final RulesFolowingClosingListener.ContainsRule r2 = new RulesFolowingClosingListener.ContainsRule(line2); private static final RulesFolowingClosingListener.ContainsRule r3 = new RulesFolowingClosingListener.ContainsRule(line3); @BeforeClass public static void prepareTmpFiles() throws IOException { for (int i = 0; i < loggingTargets.length; i++) { loggingTargets[i] = File.createTempFile("WriterBasedFileLogger", "iteTest"); loggingTargets[i].deleteOnExit(); } //delete first half of the files, logger should handle both casses for (int i = 0; i < loggingTargets.length / 2; i++) { loggingTargets[i].delete(); } } @AfterClass public static void cleanTmpFiles() throws IOException { for (int i = 0; i < loggingTargets.length; i++) { loggingTargets[i].delete(); } } @Test public void isAppendingLoggerLoggingOnNotExisitngFile() throws Exception { int i = 0; WriterBasedFileLog l = new WriterBasedFileLog(loggingTargets[i].getAbsolutePath(), true); l.log(line1); String s = StreamUtils.readStreamAsString(new FileInputStream(loggingTargets[i]), true); Assert.assertTrue(r1.evaluate(s)); } @Test public void isRewritingLoggerLoggingOnNotExisitngFile() throws Exception { int i = 1; WriterBasedFileLog l = new WriterBasedFileLog(loggingTargets[i].getAbsolutePath(), false); l.log(line1); String s = StreamUtils.readStreamAsString(new FileInputStream(loggingTargets[i]), true); Assert.assertTrue(r1.evaluate(s)); } @Test public void isRewritingLoggerRewritingOnNotExisitngFile() throws Exception { int i = 2; WriterBasedFileLog l1 = new WriterBasedFileLog(loggingTargets[i].getAbsolutePath(), false); l1.log(line2); String s1 = StreamUtils.readStreamAsString(new FileInputStream(loggingTargets[i]), true); Assert.assertTrue(r2.evaluate(s1)); l1.close(); WriterBasedFileLog l2 = new WriterBasedFileLog(loggingTargets[i].getAbsolutePath(), false); l2.log(line3); String s2 = StreamUtils.readStreamAsString(new FileInputStream(loggingTargets[i]), true); Assert.assertFalse(r2.evaluate(s2)); Assert.assertTrue(r3.evaluate(s2)); } @Test public void isAppendingLoggerAppendingOnNotExisitngFile() throws Exception { int i = 4; WriterBasedFileLog l1 = new WriterBasedFileLog(loggingTargets[i].getAbsolutePath(), true); l1.log(line2); String s1 = StreamUtils.readStreamAsString(new FileInputStream(loggingTargets[i]), true); Assert.assertTrue(r2.evaluate(s1)); l1.close(); WriterBasedFileLog l2 = new WriterBasedFileLog(loggingTargets[i].getAbsolutePath(), true); l2.log(line3); String s2 = StreamUtils.readStreamAsString(new FileInputStream(loggingTargets[i]), true); Assert.assertTrue(r2.evaluate(s2)); Assert.assertTrue(r3.evaluate(s2)); } //************ @Test public void isAppendingLoggerLoggingOnExisitngFile() throws Exception { int i = 6; WriterBasedFileLog l = new WriterBasedFileLog(loggingTargets[i].getAbsolutePath(), true); l.log(line1); String s = StreamUtils.readStreamAsString(new FileInputStream(loggingTargets[i]), true); Assert.assertTrue(r1.evaluate(s)); } @Test public void isRewritingLoggerLoggingOnExisitngFile() throws Exception { int i = 7; WriterBasedFileLog l = new WriterBasedFileLog(loggingTargets[i].getAbsolutePath(), false); l.log(line1); String s = StreamUtils.readStreamAsString(new FileInputStream(loggingTargets[i]), true); Assert.assertTrue(r1.evaluate(s)); } @Test public void isRewritingLoggerRewritingOnExisitngFile() throws Exception { int i = 8; WriterBasedFileLog l1 = new WriterBasedFileLog(loggingTargets[i].getAbsolutePath(), false); l1.log(line2); String s1 = StreamUtils.readStreamAsString(new FileInputStream(loggingTargets[i]), true); Assert.assertTrue(r2.evaluate(s1)); l1.close(); WriterBasedFileLog l2 = new WriterBasedFileLog(loggingTargets[i].getAbsolutePath(), false); l2.log(line3); String s2 = StreamUtils.readStreamAsString(new FileInputStream(loggingTargets[i]), true); Assert.assertFalse(r2.evaluate(s2)); Assert.assertTrue(r3.evaluate(s2)); } @Test public void isAppendingLoggerAppendingOnExisitngFile() throws Exception { int i = 10; WriterBasedFileLog l1 = new WriterBasedFileLog(loggingTargets[i].getAbsolutePath(), true); l1.log(line2); String s1 = StreamUtils.readStreamAsString(new FileInputStream(loggingTargets[i]), true); Assert.assertTrue(r2.evaluate(s1)); l1.close(); WriterBasedFileLog l2 = new WriterBasedFileLog(loggingTargets[i].getAbsolutePath(), true); l2.log(line3); String s2 = StreamUtils.readStreamAsString(new FileInputStream(loggingTargets[i]), true); Assert.assertTrue(r2.evaluate(s2)); Assert.assertTrue(r3.evaluate(s2)); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/util/logging/PaxHeaders.17941/TeeOutputStream0000644000000000000000000000013112654402377030257 xustar0030 mtime=1454507263.228432701 30 atime=1454507327.208579417 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/util/logging/TeeOutputStreamTest.java0000644000175000002070000000357612654402377032576 0ustar00jvanekmock00000000000000package net.sourceforge.jnlp.util.logging; import org.junit.Before; import org.junit.Test; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.PrintStream; import static org.junit.Assert.assertTrue; public class TeeOutputStreamTest { private PrintStream teePrintStream; private TeeOutputStream tos; @Before public void setup() { teePrintStream = new PrintStream(new ByteArrayOutputStream(), true); tos = new TeeOutputStream(teePrintStream, false); } @Test public void testPrintLn() throws IOException { String s = "Hel你好lo \n World!"; tos.println(s); //println should be immediately flushed assertTrue(tos.getByteArrayOutputStream().toString().isEmpty()); } @Test public void testPrint() throws IOException { String s = "नमस्तHello!\r"; tos.print(s); assertTrue(tos.getByteArrayOutputStream().toString().equals(s)); } @Test public void testWriteByteArrayString() throws IOException { String s = "He\n\n\\llo chào"; tos.write(s.getBytes(), 0, s.getBytes().length); assertTrue(tos.getByteArrayOutputStream().toString().equals(s.toString())); } @Test public void testWriteByte() throws IOException { byte b = 5; tos.write(b); assertTrue(byteArrayEquals(b, tos.getByteArrayOutputStream().toByteArray())); } @Test public void testFlush() throws IOException { String s = "Hello"; tos.print(s); assertTrue(!tos.getByteArrayOutputStream().toString().isEmpty()); tos.flush(); assertTrue(tos.getByteArrayOutputStream().toString().isEmpty()); } private boolean byteArrayEquals(byte b, byte[] arr) { for (byte i : arr) { if (b != i) { return false; } } return true; } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/util/logging/PaxHeaders.17941/PrintStreamLogg0000644000000000000000000000013112654402377030226 xustar0030 mtime=1454507263.227432714 30 atime=1454507327.208579417 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/util/logging/PrintStreamLoggerTest.java0000644000175000002070000001141012654402377033056 0ustar00jvanekmock00000000000000/*Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util.logging; import java.io.ByteArrayOutputStream; import java.io.PrintStream; import net.sourceforge.jnlp.closinglisteners.RulesFolowingClosingListener; import org.junit.Assert; import org.junit.Test; public class PrintStreamLoggerTest { private static String line1 = "I'm logged line one"; private static String line2 = "I'm logged line two"; private static RulesFolowingClosingListener.ContainsRule r1 = new RulesFolowingClosingListener.ContainsRule(line1); private static RulesFolowingClosingListener.ContainsRule r2 = new RulesFolowingClosingListener.ContainsRule(line2); private static class AccessiblePrintStream extends PrintStream{ public AccessiblePrintStream(ByteArrayOutputStream out) { super(out); } public ByteArrayOutputStream getOut() { return (ByteArrayOutputStream) out; } } @Test public void isLoggingAtAll() throws Exception { int i = 0; ByteArrayOutputStream output = new ByteArrayOutputStream(); PrintStreamLogger l = new PrintStreamLogger(new PrintStream(output)); l.log(line1); Assert.assertTrue(r1.evaluate(output.toString("utf-8"))); l.log(line2); Assert.assertTrue(r1.evaluate(output.toString("utf-8"))); Assert.assertTrue(r2.evaluate(output.toString("utf-8"))); } @Test public void isReturningStream() throws Exception { int i = 0; ByteArrayOutputStream output = new ByteArrayOutputStream(); AccessiblePrintStream ps = new AccessiblePrintStream(output); PrintStreamLogger l = new PrintStreamLogger(ps); l.log(line1); Assert.assertTrue(r1.evaluate(output.toString("utf-8"))); AccessiblePrintStream got = (AccessiblePrintStream) l.getStream(); Assert.assertTrue(r1.evaluate(got.getOut().toString("utf-8"))); l.log(line2); Assert.assertTrue(r1.evaluate(output.toString("utf-8"))); Assert.assertTrue(r2.evaluate(output.toString("utf-8"))); Assert.assertTrue(r1.evaluate(got.getOut().toString("utf-8"))); Assert.assertTrue(r2.evaluate(got.getOut().toString("utf-8"))); Assert.assertTrue(got == ps); } @Test public void isSettingStream() throws Exception { int i = 0; ByteArrayOutputStream output1 = new ByteArrayOutputStream(); ByteArrayOutputStream output2 = new ByteArrayOutputStream(); AccessiblePrintStream ps = new AccessiblePrintStream(output1); PrintStreamLogger l = new PrintStreamLogger(ps); l.log(line1); Assert.assertTrue(r1.evaluate(output1.toString("utf-8"))); AccessiblePrintStream set = new AccessiblePrintStream(output2); l.setStream(set); l.log(line2); Assert.assertFalse(r1.evaluate(output2.toString("utf-8"))); Assert.assertTrue(r2.evaluate(output2.toString("utf-8"))); Assert.assertFalse(r1.evaluate(set.getOut().toString("utf-8"))); Assert.assertTrue(r2.evaluate(set.getOut().toString("utf-8"))); Assert.assertTrue(set != ps); Assert.assertTrue(set == l.getStream()); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/util/logging/PaxHeaders.17941/OutputControlle0000644000000000000000000000013112654402377030327 xustar0030 mtime=1454507263.227432714 30 atime=1454507327.208579417 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/util/logging/OutputControllerTest.java0000644000175000002070000004012212654402377033014 0ustar00jvanekmock00000000000000/*Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util.logging; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.PrintStream; import java.util.Random; import net.sourceforge.jnlp.closinglisteners.RulesFolowingClosingListener; import net.sourceforge.jnlp.util.StreamUtils; import net.sourceforge.jnlp.util.logging.filelogs.WriterBasedFileLog; import org.junit.Assert; import org.junit.After; import org.junit.Before; import org.junit.Test; public class OutputControllerTest { private static final String line1 = "I'm logged line one"; private static final String line2 = "I'm logged line two"; private static final String line3 = "I'm logged line three"; private static final String line4 = "I'm logged line four"; private static final String line5 = "I'm logged line five"; private static final String line6 = "I'm logged line six"; private static final RulesFolowingClosingListener.ContainsRule r1 = new RulesFolowingClosingListener.ContainsRule(line1); private static final RulesFolowingClosingListener.ContainsRule r2 = new RulesFolowingClosingListener.ContainsRule(line2); private static final RulesFolowingClosingListener.ContainsRule r3 = new RulesFolowingClosingListener.ContainsRule(line3); private static final RulesFolowingClosingListener.ContainsRule r4 = new RulesFolowingClosingListener.ContainsRule(line4); private static final RulesFolowingClosingListener.ContainsRule r5 = new RulesFolowingClosingListener.ContainsRule(line5); private static final RulesFolowingClosingListener.ContainsRule r6 = new RulesFolowingClosingListener.ContainsRule(line6); private static class AccessiblePrintStream extends PrintStream { public AccessiblePrintStream(ByteArrayOutputStream out) { super(out); } public ByteArrayOutputStream getOut() { return (ByteArrayOutputStream) out; } } @Before public void setUp() { LogConfig.resetLogConfig(); } @After public void tearDown() { LogConfig.resetLogConfig(); } @Test public void isLoggingStdStreams() throws Exception { ByteArrayOutputStream os1 = new ByteArrayOutputStream(); ByteArrayOutputStream os2 = new ByteArrayOutputStream(); OutputController oc = new OutputController(new PrintStream(os1), new PrintStream(os2)); LogConfig.getLogConfig().setEnableLogging(false); LogConfig.getLogConfig().setLogToFile(false); LogConfig.getLogConfig().setLogToStreams(true); LogConfig.getLogConfig().setLogToSysLog(false); oc.log(OutputController.Level.MESSAGE_DEBUG, line1); oc.log(OutputController.Level.ERROR_DEBUG, line1); oc.flush(); Assert.assertFalse(r1.evaluate(os1.toString("utf-8"))); Assert.assertFalse(r1.evaluate(os2.toString("utf-8"))); oc.log(OutputController.Level.MESSAGE_ALL, line1); oc.log(OutputController.Level.ERROR_DEBUG, line1); oc.flush(); Assert.assertTrue(r1.evaluate(os1.toString("utf-8"))); Assert.assertFalse(r1.evaluate(os2.toString("utf-8"))); oc.log(OutputController.Level.ERROR_ALL, line1); oc.flush(); Assert.assertTrue(r1.evaluate(os2.toString("utf-8"))); LogConfig.getLogConfig().setEnableLogging(true); oc.log(OutputController.Level.MESSAGE_DEBUG, line2); oc.flush(); Assert.assertTrue(r2.evaluate(os1.toString("utf-8"))); Assert.assertFalse(r2.evaluate(os2.toString("utf-8"))); oc.log(OutputController.Level.ERROR_DEBUG, line2); oc.flush(); Assert.assertTrue(r2.evaluate(os1.toString("utf-8"))); Assert.assertTrue(r2.evaluate(os2.toString("utf-8"))); oc.log(OutputController.Level.ERROR_DEBUG, line3); oc.flush(); Assert.assertFalse(r3.evaluate(os1.toString("utf-8"))); Assert.assertTrue(r3.evaluate(os2.toString("utf-8"))); oc.log(OutputController.Level.MESSAGE_DEBUG, line3); oc.flush(); Assert.assertTrue(r3.evaluate(os1.toString("utf-8"))); Assert.assertTrue(r3.evaluate(os2.toString("utf-8"))); LogConfig.getLogConfig().setEnableLogging(false); oc.log(OutputController.Level.WARNING_DEBUG, line4); oc.flush(); Assert.assertFalse(r4.evaluate(os1.toString("utf-8"))); Assert.assertFalse(r4.evaluate(os2.toString("utf-8"))); oc.log(OutputController.Level.WARNING_ALL, line5); oc.flush(); Assert.assertTrue(r5.evaluate(os1.toString("utf-8"))); Assert.assertTrue(r5.evaluate(os2.toString("utf-8"))); LogConfig.getLogConfig().setEnableLogging(true); oc.log(OutputController.Level.WARNING_DEBUG, line4); oc.flush(); Assert.assertTrue(r4.evaluate(os1.toString("utf-8"))); Assert.assertTrue(r4.evaluate(os2.toString("utf-8"))); } private static final Random random = new Random(); private int delayable = 0; private class IdedRunnable implements Runnable { private final int id; private final OutputController oc; private boolean done = false; private final int iterations; public IdedRunnable(int id, OutputController oc, int iterations) { this.id = id; this.oc = oc; this.iterations = iterations; } @Override public void run() { for (int i = 0; i < iterations; i++) { try { //be sure this pattern is kept in assers oc.log(OutputController.Level.WARNING_ALL, "thread " + id + " line " + i); Thread.sleep(random.nextInt(delayable)); } catch (Exception ex) { throw new RuntimeException(ex); } } done = true; } public boolean isDone() { return done; } } /** * todo - include syslog once implemented */ @Test public void isParalelLogingWorking() throws Exception { LogConfig.getLogConfig().setEnableLogging(true); LogConfig.getLogConfig().setLogToStreams(true); LogConfig.getLogConfig().setLogToSysLog(false); String s = ""; //this was tested with 1-100 iterations and 100 threads. But can couse OutOfMemoryError int maxi = 90; int minits = 70; int maxt = 10; //tested with delayable 1-10, but took minutes then for (delayable = 1; delayable < 1; delayable++) { for (int iterations = minits; iterations < maxi; iterations++) { for (int threads = 1; threads < maxt; threads++) { LogConfig.getLogConfig().setLogToFile(false); System.gc(); ByteArrayOutputStream os1 = new ByteArrayOutputStream(); ByteArrayOutputStream os2 = new ByteArrayOutputStream(); OutputController oc = new OutputController(new PrintStream(os1), new PrintStream(os2)); File f = File.createTempFile("replacedFilelogger", "itwTest"); f.deleteOnExit(); oc.setFileLog(new WriterBasedFileLog(f.getAbsolutePath(), false)); LogConfig.getLogConfig().setLogToFile(true); ThreadGroup tg = new ThreadGroup("TerribleGroup"); IdedRunnable[] idedRunnables = new IdedRunnable[threads]; Thread[] xt = new Thread[threads]; for (int i = 0; i < threads; i++) { Thread.sleep(random.nextInt(delayable)); idedRunnables[i] = new IdedRunnable(i, oc, iterations); xt[i] = new Thread(tg, idedRunnables[i], "iterations = " + iterations + "; threads = " + threads + "; delayable = " + delayable); xt[i].start(); } while (true) { boolean ok = true; for (IdedRunnable idedRunnable : idedRunnables) { if (!idedRunnable.isDone()) { ok = false; break; } } if (ok) { break; } } oc.flush(); String s1 = os1.toString("utf-8"); String s2 = os2.toString("utf-8"); String s3 = StreamUtils.readStreamAsString(new FileInputStream(f), true); for (int i = minits; i < maxi; i++) { for (int t = 0; t < maxt; t++) { //be sure this pattern is kept in IdedRunnable String expected = "thread " + t + " line " + i; if (i >= iterations || t >= threads) { Assert.assertFalse(s1.contains(expected)); Assert.assertFalse(s2.contains(expected)); Assert.assertFalse(s3.contains(expected)); } else { Assert.assertTrue(s1.contains(expected)); Assert.assertTrue(s2.contains(expected)); Assert.assertTrue(s3.contains(expected)); } } } tg.destroy(); } } } } @Test public void isChangingOfStreasmWorking() throws Exception { LogConfig.getLogConfig().setEnableLogging(true); LogConfig.getLogConfig().setLogToFile(false); LogConfig.getLogConfig().setLogToStreams(true); LogConfig.getLogConfig().setLogToSysLog(false); ByteArrayOutputStream os1 = new ByteArrayOutputStream(); ByteArrayOutputStream os2 = new ByteArrayOutputStream(); OutputController oc = new OutputController(new PrintStream(os1), new PrintStream(os2)); oc.log(OutputController.Level.MESSAGE_ALL, line1); oc.log(OutputController.Level.ERROR_ALL, line1); oc.flush(); ByteArrayOutputStream os3 = new ByteArrayOutputStream(); ByteArrayOutputStream os4 = new ByteArrayOutputStream(); oc.setOut(new PrintStream(os3)); oc.log(OutputController.Level.MESSAGE_ALL, line2); oc.log(OutputController.Level.ERROR_ALL, line2); oc.flush(); oc.setErr(new PrintStream(os4)); oc.log(OutputController.Level.MESSAGE_ALL, line3); oc.log(OutputController.Level.ERROR_ALL, line3); oc.flush(); Assert.assertTrue(r1.evaluate(os1.toString("utf-8"))); Assert.assertTrue(r1.evaluate(os2.toString("utf-8"))); Assert.assertFalse(r1.evaluate(os3.toString("utf-8"))); Assert.assertFalse(r1.evaluate(os4.toString("utf-8"))); Assert.assertFalse(r2.evaluate(os1.toString("utf-8"))); Assert.assertTrue(r2.evaluate(os2.toString("utf-8"))); Assert.assertTrue(r2.evaluate(os3.toString("utf-8"))); Assert.assertFalse(r2.evaluate(os4.toString("utf-8"))); Assert.assertFalse(r3.evaluate(os1.toString("utf-8"))); Assert.assertFalse(r3.evaluate(os2.toString("utf-8"))); Assert.assertTrue(r3.evaluate(os3.toString("utf-8"))); Assert.assertTrue(r3.evaluate(os4.toString("utf-8"))); LogConfig.getLogConfig().setLogToStreams(false); oc.log(OutputController.Level.MESSAGE_ALL, line4); oc.log(OutputController.Level.ERROR_ALL, line4); Assert.assertFalse(r4.evaluate(os1.toString("utf-8"))); Assert.assertFalse(r4.evaluate(os2.toString("utf-8"))); Assert.assertFalse(r4.evaluate(os3.toString("utf-8"))); Assert.assertFalse(r4.evaluate(os4.toString("utf-8"))); } @Test public void isFileLoggerWorking() throws Exception { String s1 = ""; String s2 = ""; LogConfig.getLogConfig().setEnableLogging(true); LogConfig.getLogConfig().setLogToFile(false); LogConfig.getLogConfig().setLogToStreams(false); LogConfig.getLogConfig().setLogToSysLog(false); ByteArrayOutputStream os1 = new ByteArrayOutputStream(); ByteArrayOutputStream os2 = new ByteArrayOutputStream(); OutputController oc = new OutputController(new PrintStream(os1), new PrintStream(os2)); File f1 = File.createTempFile("replacedFilelogger", "itwTest"); File f2 = File.createTempFile("replacedFilelogger", "itwTest"); f1.deleteOnExit(); f2.deleteOnExit(); oc.setFileLog(new WriterBasedFileLog(f1.getAbsolutePath(), false)); LogConfig.getLogConfig().setLogToFile(true); oc.log(OutputController.Level.MESSAGE_ALL, line1); oc.log(OutputController.Level.ERROR_ALL, line2); oc.log(OutputController.Level.MESSAGE_ALL, line3); oc.flush(); s1 = StreamUtils.readStreamAsString(new FileInputStream(f1), true); s2 = StreamUtils.readStreamAsString(new FileInputStream(f2), true); Assert.assertTrue(r1.evaluate(s1)); Assert.assertFalse(r1.evaluate(s2)); Assert.assertTrue(r2.evaluate(s1)); Assert.assertFalse(r2.evaluate(s2)); Assert.assertTrue(r3.evaluate(s1)); Assert.assertFalse(r3.evaluate(s2)); oc.setFileLog(new WriterBasedFileLog(f2.getAbsolutePath(), false)); oc.log(OutputController.Level.ERROR_ALL, line5); oc.log(OutputController.Level.MESSAGE_ALL, line5); oc.flush(); s1 = StreamUtils.readStreamAsString(new FileInputStream(f1), true); s2 = StreamUtils.readStreamAsString(new FileInputStream(f2), true); Assert.assertTrue(r1.evaluate(s1)); Assert.assertFalse(r1.evaluate(s2)); Assert.assertTrue(r2.evaluate(s1)); Assert.assertFalse(r2.evaluate(s2)); Assert.assertTrue(r3.evaluate(s1)); Assert.assertFalse(r3.evaluate(s2)); Assert.assertFalse(r5.evaluate(s1)); Assert.assertTrue(r5.evaluate(s2)); LogConfig.getLogConfig().setLogToFile(false); oc.log(OutputController.Level.ERROR_ALL, line6); oc.log(OutputController.Level.MESSAGE_ALL, line6); oc.flush(); s1 = StreamUtils.readStreamAsString(new FileInputStream(f1), true); s2 = StreamUtils.readStreamAsString(new FileInputStream(f2), true); Assert.assertFalse(r6.evaluate(s1)); Assert.assertFalse(r6.evaluate(s2)); } /** * add syslog once implemented */ @Test public void isSysLoggerWorking() throws Exception { } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/util/logging/PaxHeaders.17941/JavaConsoleTest0000644000000000000000000000013112654402377030211 xustar0030 mtime=1454507263.227432714 30 atime=1454507327.208579417 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/util/logging/JavaConsoleTest.java0000644000175000002070000001170712654402377031663 0ustar00jvanekmock00000000000000/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package net.sourceforge.jnlp.util.logging; import java.util.Date; import java.util.TimeZone; import net.sourceforge.jnlp.util.logging.headers.PluginMessage; import org.junit.Assert; import org.junit.Test; public class JavaConsoleTest { //note this time is in EST timezone, and so is expecting the string output below private static final String TEST_TIME = "Tue Nov 19 09:43:50 "+TimeZone.getTimeZone("EST").getDisplayName(false, TimeZone.SHORT)+" 2013"; private static final String S1 = "plugindebug 1384850630162925 [jvanek][ITW-C-PLUGIN][MESSAGE_DEBUG]["+TEST_TIME+"][/home/jvanek/Desktop/icedtea-web/plugin/icedteanp/IcedTeaNPPlugin.cc:1204] ITNPP Thread# 140513434003264, gthread 0x7fcbd531f8c0: PIPE: plugin read: plugin PluginProxyInfo reference 1 http://www.walter-fendt.de:80"; private static final String S2 = "plugindebugX 1384850630162954 [jvanek][ITW-Cplugindebug 1384850630163008 [jvanek][ITW-C-PLUGIN][MESSAGE_DEBUG]["+TEST_TIME+"][/home/jvanek/Desktop/icedtea-web/plugin/icedteanp/IcedTeaNPPlugin.cc:1124] ITNPP Thread# 140513434003264, gthread 0x7fcbd531f8c0: parts[0]=plugin, parts[1]=PluginProxyInfo, reference, parts[3]=1, parts[4]=http://www.walter-fendt.de:80 -- decoded_url=http://www.walter-fendt.de:80"; private static final String S3 = "preinit_pluginerror 1384850630163298 [jvanek][ITW-C-PLUGIN][MESSAGE_DEBUG]["+TEST_TIME+"][/home/jvanek/Desktop/icedtea-web/plugin/icedteanp/IcedTeaNPPlugin.cc:1134] ITNPP Thread# 140513434003264, gthread 0x7fcbd531f8c0: Proxy info: plugin PluginProxyInfo reference 1 DIRECT"; private static final String S4 = "plugindebugX blob [jvanek][ITW-Cplugindebug 1384850630163008 [jvanek][ITW-C-PLUGIN][MESSAGE_DEBUG]["+TEST_TIME+"][/home/jvanek/Desktop/icedtea-web/plugin/icedteanp/IcedTeaNPPlugin.cc:1124] ITNPP Thread# 140513434003264, gthread 0x7fcbd531f8c0: parts[0]=plugin, parts[1]=PluginProxyInfo, reference, parts[3]=1, parts[4]=http://www.walter-fendt.de:80 -- decoded_url=http://www.walter-fendt.de:80"; @Test public void CreatePluginHeaderTestOK() throws Exception{ PluginMessage p1 = new PluginMessage(S1); PluginMessage p2 = new PluginMessage(S2); PluginMessage p3 = new PluginMessage(S3); Assert.assertFalse(p1.wasError); Assert.assertFalse(p2.wasError); Assert.assertFalse(p3.wasError); Assert.assertTrue(p1.header.isC); Assert.assertTrue(p2.header.isC); Assert.assertTrue(p3.header.isC); Assert.assertEquals(OutputController.Level.MESSAGE_DEBUG, p1.header.level); Assert.assertEquals(OutputController.Level.WARNING_ALL, p2.header.level); Assert.assertEquals(OutputController.Level.ERROR_ALL, p3.header.level); Assert.assertTrue(p1.header.date.toString().contains(TEST_TIME) && p1.header.date.toString().contains("2013")); Assert.assertTrue(p2.header.date.toString().contains("ITW-C-PLUGIN")); Assert.assertTrue(p3.header.date.toString().contains(TEST_TIME) && p3.header.date.toString().contains("2013")); Assert.assertTrue(p1.header.caller.contains("/home/jvanek")); Assert.assertTrue(p3.header.caller.contains("/home/jvanek")); Assert.assertTrue(p1.header.user.equals("jvanek")); Assert.assertTrue(p2.header.user.equals("jvanek")); Assert.assertTrue(p3.header.user.equals("jvanek")); Assert.assertTrue(p1.header.thread1.equals("140513434003264")); Assert.assertTrue(p1.header.thread2.equals("0x7fcbd531f8c0")); Assert.assertTrue(p2.header.thread1.equals("19")); Assert.assertTrue(p2.header.thread2.equals("43")); Assert.assertTrue(p3.header.thread1.equals("140513434003264")); Assert.assertTrue(p3.header.thread2.equals("0x7fcbd531f8c0")); Assert.assertTrue(p1.restOfMessage.equals(" PIPE: plugin read: plugin PluginProxyInfo reference 1 http://www.walter-fendt.de:80")); Assert.assertEquals("0 EST 2013][/home/jvanek/Desktop/icedtea-web/plugin/icedteanp/IcedTeaNPPlugin.cc:1124] " + "ITNPP Thread# 140513434003264, gthread 0x7fcbd531f8c0: parts[0]=plugin, parts[1]=PluginProxyInfo, reference, parts[3]=1, " + "parts[4]=http://www.walter-fendt.de:80 -- decoded_url=http://www.walter-fendt.de:80", p2.restOfMessage); Assert.assertTrue(p3.restOfMessage.equals("Proxy info: plugin PluginProxyInfo reference 1 DIRECT")); } @Test public void CreatePluginHeaderTestNotOK()throws Exception{ PluginMessage p4 = new PluginMessage(S4); Assert.assertTrue(p4.wasError); Assert.assertTrue(p4.header.isC); Assert.assertEquals(OutputController.Level.WARNING_ALL, p4.header.level); Assert.assertTrue(p4.header.date.toString().contains(new Date().toString().substring(0, 16))); //means no Tue Nov 19 09:43:50 :) Assert.assertTrue(p4.header.thread1.equals("unknown")); Assert.assertTrue(p4.header.thread2.equals("unknown")); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/util/logging/PaxHeaders.17941/FileLogTest.jav0000644000000000000000000000013112654402377030105 xustar0030 mtime=1454507263.226432728 30 atime=1454507327.208579417 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/util/logging/FileLogTest.java0000644000175000002070000001677112654402377031006 0ustar00jvanekmock00000000000000/*Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util.logging; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import net.sourceforge.jnlp.closinglisteners.RulesFolowingClosingListener; import net.sourceforge.jnlp.util.StreamUtils; import net.sourceforge.jnlp.util.logging.filelogs.LogBasedFileLog; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; public class FileLogTest { private static final File[] loggingTargets = new File[12]; private static final String line1 = "I'm logged line one"; private static final String line2 = "I'm logged line two"; private static final String line3 = "I'm logged line three"; private static final RulesFolowingClosingListener.ContainsRule r1 = new RulesFolowingClosingListener.ContainsRule(line1); private static final RulesFolowingClosingListener.ContainsRule r2 = new RulesFolowingClosingListener.ContainsRule(line2); private static final RulesFolowingClosingListener.ContainsRule r3 = new RulesFolowingClosingListener.ContainsRule(line3); @BeforeClass public static void prepareTmpFiles() throws IOException { for (int i = 0; i < loggingTargets.length; i++) { loggingTargets[i] = File.createTempFile("fileLogger", "iteTest"); loggingTargets[i].deleteOnExit(); } //delete first half of the files, logger should handle both casses for (int i = 0; i < loggingTargets.length / 2; i++) { loggingTargets[i].delete(); } } @AfterClass public static void cleanTmpFiles() throws IOException { for (int i = 0; i < loggingTargets.length; i++) { loggingTargets[i].delete(); } } @Test public void isAppendingLoggerLoggingOnNotExisitngFile() throws Exception { int i = 0; LogBasedFileLog l = new LogBasedFileLog(loggingTargets[i].getAbsolutePath(), true); l.log(line1); String s = StreamUtils.readStreamAsString(new FileInputStream(loggingTargets[i]), true); Assert.assertTrue(r1.evaluate(s)); } @Test public void isRewritingLoggerLoggingOnNotExisitngFile() throws Exception { int i = 1; LogBasedFileLog l = new LogBasedFileLog(loggingTargets[i].getAbsolutePath(), false); l.log(line1); String s = StreamUtils.readStreamAsString(new FileInputStream(loggingTargets[i]), true); Assert.assertTrue(r1.evaluate(s)); } @Test public void isRewritingLoggerRewritingOnNotExisitngFile() throws Exception { int i = 2; LogBasedFileLog l1 = new LogBasedFileLog(loggingTargets[i].getAbsolutePath(), false); l1.log(line2); String s1 = StreamUtils.readStreamAsString(new FileInputStream(loggingTargets[i]), true); Assert.assertTrue(r2.evaluate(s1)); l1.close(); LogBasedFileLog l2 = new LogBasedFileLog(loggingTargets[i].getAbsolutePath(), false); l2.log(line3); String s2 = StreamUtils.readStreamAsString(new FileInputStream(loggingTargets[i]), true); Assert.assertFalse(r2.evaluate(s2)); Assert.assertTrue(r3.evaluate(s2)); } @Test public void isAppendingLoggerAppendingOnNotExisitngFile() throws Exception { int i = 4; LogBasedFileLog l1 = new LogBasedFileLog(loggingTargets[i].getAbsolutePath(), true); l1.log(line2); String s1 = StreamUtils.readStreamAsString(new FileInputStream(loggingTargets[i]), true); Assert.assertTrue(r2.evaluate(s1)); l1.close(); LogBasedFileLog l2 = new LogBasedFileLog(loggingTargets[i].getAbsolutePath(), true); l2.log(line3); String s2 = StreamUtils.readStreamAsString(new FileInputStream(loggingTargets[i]), true); Assert.assertTrue(r2.evaluate(s2)); Assert.assertTrue(r3.evaluate(s2)); } //************ @Test public void isAppendingLoggerLoggingOnExisitngFile() throws Exception { int i = 6; LogBasedFileLog l = new LogBasedFileLog(loggingTargets[i].getAbsolutePath(), true); l.log(line1); String s = StreamUtils.readStreamAsString(new FileInputStream(loggingTargets[i]), true); Assert.assertTrue(r1.evaluate(s)); } @Test public void isRewritingLoggerLoggingOnExisitngFile() throws Exception { int i = 7; LogBasedFileLog l = new LogBasedFileLog(loggingTargets[i].getAbsolutePath(), false); l.log(line1); String s = StreamUtils.readStreamAsString(new FileInputStream(loggingTargets[i]), true); Assert.assertTrue(r1.evaluate(s)); } @Test public void isRewritingLoggerRewritingOnExisitngFile() throws Exception { int i = 8; LogBasedFileLog l1 = new LogBasedFileLog(loggingTargets[i].getAbsolutePath(), false); l1.log(line2); String s1 = StreamUtils.readStreamAsString(new FileInputStream(loggingTargets[i]), true); Assert.assertTrue(r2.evaluate(s1)); l1.close(); LogBasedFileLog l2 = new LogBasedFileLog(loggingTargets[i].getAbsolutePath(), false); l2.log(line3); String s2 = StreamUtils.readStreamAsString(new FileInputStream(loggingTargets[i]), true); Assert.assertFalse(r2.evaluate(s2)); Assert.assertTrue(r3.evaluate(s2)); } @Test public void isAppendingLoggerAppendingOnExisitngFile() throws Exception { int i = 10; LogBasedFileLog l1 = new LogBasedFileLog(loggingTargets[i].getAbsolutePath(), true); l1.log(line2); String s1 = StreamUtils.readStreamAsString(new FileInputStream(loggingTargets[i]), true); Assert.assertTrue(r2.evaluate(s1)); l1.close(); LogBasedFileLog l2 = new LogBasedFileLog(loggingTargets[i].getAbsolutePath(), true); l2.log(line3); String s2 = StreamUtils.readStreamAsString(new FileInputStream(loggingTargets[i]), true); Assert.assertTrue(r2.evaluate(s2)); Assert.assertTrue(r3.evaluate(s2)); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/util/PaxHeaders.17941/lockingfile0000644000000000000000000000013112654402377026005 xustar0030 mtime=1454507263.226432728 30 atime=1454507658.776157397 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/util/lockingfile/0000755000175000002070000000000012654402377026606 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/util/lockingfile/PaxHeaders.17941/LockingRead0000644000000000000000000000013112654402377030167 xustar0030 mtime=1454507263.226432728 30 atime=1454507327.208579417 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/util/lockingfile/LockingReaderWriterTest.java0000644000175000002070000001634612654402377034231 0ustar00jvanekmock00000000000000/* Copyright (C) 2013 Red Hat This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be 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 this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package net.sourceforge.jnlp.util.lockingfile; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import org.junit.Before; import java.io.BufferedWriter; import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.List; import org.junit.Assert; import org.junit.Test; public class LockingReaderWriterTest { private static File storagefile; private static TestStringReaderWriter newInstance() { return new TestStringReaderWriter(storagefile); } @Before public void setUp() throws IOException { storagefile = File.createTempFile("foo", "bar"); } @Test public void testSimpleActions() throws IOException { TestStringReaderWriter storage = newInstance(); storage.add("teststring"); assertTrue(storage.contains("teststring")); storage.remove("teststring"); assertFalse(storage.contains("teststring")); } @Test public void testInterleavedActions() throws IOException { TestStringReaderWriter storage1 = newInstance(); TestStringReaderWriter storage2 = newInstance(); storage1.add("teststring"); assertTrue(storage2.contains("teststring")); storage2.remove("teststring"); assertFalse(storage1.contains("teststring")); } static class TestThread extends Thread { String testString; int iterations; Throwable error = null; TestThread(String testString, int iterations) { this.testString = testString; this.iterations = iterations; } @Override public void run() { try { TestStringReaderWriter storage = newInstance(); for (int i = 0; i < iterations; i++) { assertTrue(storage.contains(this.testString)); storage.add(this.testString); storage.remove(this.testString); assertTrue(storage.contains(this.testString)); } } catch (Throwable error) { error.printStackTrace(); this.error = error; } } } private void concurrentReadWrites(int threadAmount, int iterations, String testString) throws InterruptedException { TestStringReaderWriter storage = newInstance(); storage.add(testString); List testThreads = new ArrayList(); for (int i = 0; i < threadAmount; i++) { TestThread thread = new TestThread(testString, iterations); testThreads.add(thread); thread.start(); } for (int i = 0; i < threadAmount; i++) { testThreads.get(i).join(); } assertTrue(storage.contains(testString)); storage.remove(testString); // So long as number adds == number writes, we should be left with // nothing at end. assertFalse(storage.contains(testString)); } // Long testing string, the contents are not important private String makeLongTestString() { StringBuilder sb = new StringBuilder(); for (int i = 0; i < 1000; i++) { sb.append(Integer.toString(i)); } return sb.toString(); } @Test public void testManyReadWrite() throws Exception { int oneThread = 1; String shortString = "teststring"; // This was causing 'too many open files' because FileUtils#getFileLock // leaks file descriptors. No longer used. concurrentReadWrites(oneThread, 500 /* iterations */, shortString); } @Test public void testManyThreads() throws Exception { int threadAmount = 25; String shortString = "teststring"; String longString = makeLongTestString(); concurrentReadWrites(threadAmount, 10 /* per-thread iterations */, shortString); concurrentReadWrites(threadAmount, 2 /* per-thread iterations */, longString); } /** * Concrete implementation to aid in testing LockingReaderWriter */ public static class TestStringReaderWriter extends LockingReaderWriter { private List cachedContents = new ArrayList(); public TestStringReaderWriter(File file) { super(file); } @Override public void writeContent(BufferedWriter writer) throws IOException { for (String string : cachedContents) { writer.write(string); writer.newLine(); } } @Override protected void readLine(String line) { this.cachedContents.add(line); } @Override protected void readContents() throws IOException { cachedContents.clear(); super.readContents(); } /* * Atomic container abstraction methods. */ synchronized public void add(final String line) { doLocked(new Runnable() { public void run() { try { readContents(); cachedContents.add(line); writeContents(); } catch (IOException ex) { throw new StorageIoException(ex); } } }); } synchronized public boolean contains(final String line) { final boolean[] doesContain = { false }; doLocked(new Runnable() { public void run() { try { readContents(); doesContain[0] = cachedContents.contains(line); } catch (IOException e) { throw new StorageIoException(e); } } }); return doesContain[0]; } synchronized public boolean remove(final String line) { final boolean[] didRemove = { false }; doLocked(new Runnable() { public void run() { try { readContents(); didRemove[0] = cachedContents.remove(line); writeContents(); } catch (IOException e) { throw new StorageIoException(e); } } }); return didRemove[0]; } } }icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/util/PaxHeaders.17941/docprovider0000644000000000000000000000013112654402377026037 xustar0030 mtime=1454507263.225432741 30 atime=1454507658.776157397 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/util/docprovider/0000755000175000002070000000000012654402377026640 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/util/docprovider/PaxHeaders.17941/formatters0000644000000000000000000000013112654402377030225 xustar0030 mtime=1454507263.225432741 30 atime=1454507658.776157397 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/util/docprovider/formatters/0000755000175000002070000000000012654402377031026 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/util/docprovider/formatters/PaxHeaders.17941/0000644000000000000000000000013112654402377030304 xustar0030 mtime=1454507263.226432728 30 atime=1454507658.776157397 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/util/docprovider/formatters/formatters/0000755000175000002070000000000012654402377033214 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/util/docprovider/formatters/formatters/PaxHea0000644000000000000000000000033712654402377031061 xustar00135 path=icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/util/docprovider/formatters/formatters/ReplacingTextFormatterTest.java 30 mtime=1454507263.226432728 29 atime=1454507327.20757943 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/util/docprovider/formatters/formatters/Replac0000644000175000002070000001272212654402377034351 0ustar00jvanekmock00000000000000/* Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util.docprovider.formatters.formatters; import org.junit.Assert; import org.junit.Test; public class ReplacingTextFormatterTest { Formatter tr = new ReplacingTextFormatter() { @Override public String wrapParagraph(String s) { throw new UnsupportedOperationException("Not supported yet."); } @Override public String getHeaders(String id, String encoding) { throw new UnsupportedOperationException("Not supported yet."); } @Override public String getNewLine() { throw new UnsupportedOperationException("Not supported yet."); } @Override public String getBoldOpening() { return "OPEN"; } @Override public String getBoldClosing() { return "CLOSE"; } @Override public String getBreakAndBold() { throw new UnsupportedOperationException("Not supported yet."); } @Override public String getCloseBoldAndBreak() { throw new UnsupportedOperationException("Not supported yet."); } @Override public String getBoldCloseNwlineBoldOpen() { throw new UnsupportedOperationException("Not supported yet."); } @Override public String getTitle(String name) { throw new UnsupportedOperationException("Not supported yet."); } @Override public String getUrl(String url, String appearence) { throw new UnsupportedOperationException("Not supported yet."); } @Override public String getOption(String key, String value) { throw new UnsupportedOperationException("Not supported yet."); } @Override public String getSeeAlso(String s) { throw new UnsupportedOperationException("Not supported yet."); } @Override public String getTail() { throw new UnsupportedOperationException("Not supported yet."); } @Override public String getFileSuffix() { throw new UnsupportedOperationException("Not supported yet."); } }; @Test public void upperCaseNoSpaces() { String s = tr.process("aaa bbb ccc"); Assert.assertEquals("aaa OPEN bbb CLOSE ccc", s); } @Test public void lowercaseNoSpaces() { String s = tr.process("aaa bbb ccc"); Assert.assertEquals("aaa OPEN bbb CLOSE ccc", s); } @Test public void lowercaseSpaces() { String s = tr.process("aaa < b > bbb < / b > ccc"); Assert.assertEquals("aaa OPEN bbb CLOSE ccc", s); } @Test public void uppercaseSpaces() { String s = tr.process("aaa < B > bbb < / B > ccc"); Assert.assertEquals("aaa OPEN bbb CLOSE ccc", s); } @Test public void mixedCases1() { String s = tr.process("aaa bbb ccc"); Assert.assertEquals("aaa OPEN bbb CLOSE ccc", s); } @Test public void mixedSpace2() { String s = tr.process("aaa bbb ccc"); Assert.assertEquals("aaa OPEN bbb CLOSE ccc", s); } @Test public void illegal1() { String s = tr.process("aaa bbb ccc"); Assert.assertFalse(s.contains("OPEN")); Assert.assertTrue(s.contains("CLOSE")); } @Test public void illegal2() { String s = tr.process(" ccc "); Assert.assertFalse(s.contains("CLOSE")); Assert.assertTrue(s.contains("OPEN")); } }icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/util/docprovider/formatters/formatters/PaxHea0000644000000000000000000000032212654402377031053 xustar00122 path=icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/util/docprovider/formatters/formatters/FormatterTest.java 30 mtime=1454507263.225432741 29 atime=1454507327.20757943 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/util/docprovider/formatters/formatters/Format0000644000175000002070000000731312654402377034373 0ustar00jvanekmock00000000000000/* Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util.docprovider.formatters.formatters; import org.junit.Assert; import org.junit.Test; public class FormatterTest { @Test public void testNoNewLinesPlain() { PlainTextFormatter f = new PlainTextFormatter(); String s = f.getNewLine(0); Assert.assertEquals("", s); } @Test public void testOneNewLinesPlain() { PlainTextFormatter f = new PlainTextFormatter(); String s = f.getNewLine(1); Assert.assertEquals(f.getNewLine(), s); } @Test public void testXNewLinesPlain() { PlainTextFormatter f = new PlainTextFormatter(); final int x = 10; String s = f.getNewLine(x); String[] a = s.replace(f.getNewLine(), "X" + f.getNewLine()).split("[" + f.getNewLine() + "]{1}"); Assert.assertEquals(x, a.length); } @Test public void testNoNewLinesHtml() { HtmlFormatter f = new HtmlFormatter(); String s = f.getNewLine(0); Assert.assertEquals("", s); } @Test public void testOneNewLinesHtml() { HtmlFormatter f = new HtmlFormatter(); String s = f.getNewLine(1); Assert.assertEquals(f.getNewLine(), s); } @Test public void testXNewLinesHtml() { HtmlFormatter f = new HtmlFormatter(); final int x = 10; String s = f.getNewLine(x); String[] a = s.split("(?mi)br"); Assert.assertEquals(x + 1, a.length);//br is in middleof element } @Test public void testNoNewLinesMan() { ManFormatter f = new ManFormatter(); String s = f.getNewLine(0); Assert.assertEquals("", s); } @Test public void testOneNewLinesMan() { ManFormatter f = new ManFormatter(); String s = f.getNewLine(1); Assert.assertEquals(f.getNewLine(), s); } @Test public void testXNewLinesMan() { ManFormatter f = new ManFormatter(); final int x = 10; String s = f.getNewLine(x); String[] a = s.split("(?m)\\.br"); Assert.assertEquals(x + 1, a.length);//br is in middleof element } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/util/PaxHeaders.17941/XDesktopEntryTest.java0000644000000000000000000000013012654402377030061 xustar0030 mtime=1454507263.225432741 29 atime=1454507327.20757943 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/util/XDesktopEntryTest.java0000644000175000002070000003051612654402377030613 0ustar00jvanekmock00000000000000/* Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util; import java.io.BufferedReader; import java.io.File; import java.io.IOException; import java.io.Reader; import java.io.StringReader; import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.net.MalformedURLException; import java.util.HashMap; import java.util.Map; import java.util.Set; import net.sourceforge.jnlp.InformationDesc; import net.sourceforge.jnlp.JNLPFile; import net.sourceforge.jnlp.PluginBridgeTest; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.annotations.KnownToFail; import net.sourceforge.jnlp.mock.DummyJNLPFileWithJar; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.security.dialogs.AccessWarningPaneComplexReturn; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; public class XDesktopEntryTest { private static final String des1 = "/my/little/Desktop"; private static final String des2name = "Plocha"; private static final String des2Res = System.getProperty("user.home") + "/" + des2name; private static final String HOME = "HOME"; private static final String des2 = "$" + HOME + "/" + des2name; private static final String des7 = "\"$" + HOME + "/" + des2name + "\""; private static final String des7res = System.getProperty("user.home") + "/" + des2name; private static final String des8 = "\\\"$" + HOME + "/" + des2name + "\\\""; private static final String des8res = "\"" + System.getProperty("user.home") + "/" + des2name + "\""; private static final String des9 = "\"$" + HOME + "/\\\"" + des2name + "\\\"\""; private static final String des9res = System.getProperty("user.home") + "/\"" + des2name + "\""; private static final String src1 = XDesktopEntry.XDG_DESKTOP_DIR + "=" + des1; private static final String src2 = " " + XDesktopEntry.XDG_DESKTOP_DIR + " = " + des1; private static final String src3 = "#" + XDesktopEntry.XDG_DESKTOP_DIR + " = " + des1; private static final String src4 = XDesktopEntry.XDG_DESKTOP_DIR + "=" + des2; private static final String src5 = " " + XDesktopEntry.XDG_DESKTOP_DIR + " = " + des2; private static final String src6 = "#" + XDesktopEntry.XDG_DESKTOP_DIR + " = " + des2; private static final String src7 = XDesktopEntry.XDG_DESKTOP_DIR + " = " + des7; private static final String src8 = XDesktopEntry.XDG_DESKTOP_DIR + " = " + des8; private static final String src9 = XDesktopEntry.XDG_DESKTOP_DIR + " = " + des9; private static Map backupedEnv; private static boolean wasHtml; private static boolean wasJavaws; @BeforeClass public static void saveJnlpRuntimeHtml() { wasHtml = JNLPRuntime.isHtml(); wasJavaws = JNLPRuntime.isWebstartApplication(); } private static void setIsWebstart(boolean value) throws NoSuchFieldException, IllegalArgumentException, IllegalAccessException { Field field = JNLPRuntime.class.getDeclaredField("isWebstartApplication"); field.setAccessible(true); field.set(null, value); } @After public void restoreJnlpRuntimeHtml() throws Exception { JNLPRuntime.setHtml(wasHtml); setIsWebstart(wasJavaws); } @AfterClass public static void restoreJnlpRuntimeHtmlFinally() throws Exception { JNLPRuntime.setHtml(wasHtml); setIsWebstart(wasJavaws); } @BeforeClass public static void ensureHomeVaribale() throws NoSuchFieldException, IllegalAccessException, IllegalArgumentException, ClassNotFoundException { ServerAccess.logOutputReprint("Environment"); envToString(); Map env = System.getenv(); if (env.containsKey(HOME)) { backupedEnv = null; } else { backupedEnv = env; Map m = new HashMap(env); m.put(HOME, System.getProperty("user.home")); fakeEnvironment(m); ServerAccess.logOutputReprint("Hacked environment"); envToString(); } } @AfterClass public static void restoreHomeVaribale() throws NoSuchFieldException, IllegalAccessException, IllegalArgumentException, ClassNotFoundException { Map env = System.getenv(); if (backupedEnv != null) { fakeEnvironment(backupedEnv); ServerAccess.logOutputReprint("Restored environment"); envToString(); } } private static void fakeEnvironment(Map m) throws NoSuchFieldException, IllegalArgumentException, IllegalAccessException, ClassNotFoundException { Class processEnvironmentClass = Class.forName("java.lang.ProcessEnvironment"); Field env = processEnvironmentClass.getDeclaredField("theUnmodifiableEnvironment"); env.setAccessible(true); // remove final modifier from field Field modifiersField = Field.class.getDeclaredField("modifiers"); modifiersField.setAccessible(true); modifiersField.setInt(env, env.getModifiers() & ~Modifier.FINAL); env.set(null, m); } @Test @KnownToFail public void testHomeVariable() { Assert.assertTrue("Variable home must be in environment of this run, is not", System.getenv().containsKey(HOME)); Assert.assertNull("Variable home should be declared before test run, but was not and so is faked. This should be ok and is thrown just for record. See output of ensureHomeVaribale and restoreHomeVaribale", backupedEnv); } @Test public void getFreedesktopOrgDesktopPathFromtestSimple() throws IOException { String s = XDesktopEntry.getFreedesktopOrgDesktopPathFrom(new BufferedReader(new StringReader(src1))); Assert.assertEquals(des1, s); } @Test public void getFreedesktopOrgDesktopPathFromtestSpaced() throws IOException { String s = XDesktopEntry.getFreedesktopOrgDesktopPathFrom(new BufferedReader(new StringReader(src2))); Assert.assertEquals(des1, s); } @Test(expected = IOException.class) public void getFreedesktopOrgDesktopPathFromtestCommented() throws IOException { String s = XDesktopEntry.getFreedesktopOrgDesktopPathFrom(new BufferedReader(new StringReader(src3))); } @Test public void getFreedesktopOrgDesktopPathFromtestSimpleWithHome() throws IOException { String s = XDesktopEntry.getFreedesktopOrgDesktopPathFrom(new BufferedReader(new StringReader(src4))); Assert.assertEquals(s, des2Res); } @Test public void getFreedesktopOrgDesktopPathFromtestSpacedWithHome() throws IOException { String s = XDesktopEntry.getFreedesktopOrgDesktopPathFrom(new BufferedReader(new StringReader(src5))); Assert.assertEquals(s, des2Res); } @Test public void getFreedesktopOrgDesktopPathFromtestSpacedWithHomeAndQuotes() throws IOException { String s = XDesktopEntry.getFreedesktopOrgDesktopPathFrom(new BufferedReader(new StringReader(src7))); Assert.assertEquals(s, des7res); } @Test public void getFreedesktopOrgDesktopPathFromtestSpacedWithHomeAndEscapedQuotes() throws IOException { String s = XDesktopEntry.getFreedesktopOrgDesktopPathFrom(new BufferedReader(new StringReader(src8))); Assert.assertEquals(s, des8res); } @Test public void getFreedesktopOrgDesktopPathFromtestSpacedWithHomeAndMixedQuotes() throws IOException { String s = XDesktopEntry.getFreedesktopOrgDesktopPathFrom(new BufferedReader(new StringReader(src9))); Assert.assertEquals(s, des9res); } @Test(expected = IOException.class) public void getFreedesktopOrgDesktopPathFromtestCommentedWithHome() throws IOException { String s = XDesktopEntry.getFreedesktopOrgDesktopPathFrom(new BufferedReader(new StringReader(src6))); } private static void envToString() { mapToString(System.getenv()); } private static void mapToString(Map variables) { Set> env = variables.entrySet(); for (Map.Entry entry : env) { ServerAccess.logOutputReprint(entry.getKey() + " = " + entry.getValue()); } } @Test public void allFilesHaveSameName() throws IOException { JNLPFile jnlpf = new DummyJnlpWithTitle(); XDesktopEntry xde = new XDesktopEntry(jnlpf); File f1 = xde.getShortcutTmpFile(); File f2 = xde.getLinuxDesktopIconFile(); File f3 = xde.getLinuxMenuIconFile(); Assert.assertEquals(f1.getName(), f2.getName()); Assert.assertEquals(f2.getName(), f3.getName()); } private void testHtmlOccurences(boolean html, boolean javaws, boolean menu, AccessWarningPaneComplexReturn.ShortcutResult.Shortcut type, int occurences) throws Exception { JNLPRuntime.setHtml(html); setIsWebstart(javaws); JNLPFile jnlpf = new DummyJnlpWithTitle(); XDesktopEntry xde = new XDesktopEntry(jnlpf); AccessWarningPaneComplexReturn.ShortcutResult a = new AccessWarningPaneComplexReturn.ShortcutResult(true); a.setBrowser("blah"); a.setFixHref(false); a.setShortcutType(type); Reader r = xde.getContentsAsReader(menu, a, true); String s = FileUtils.getContentOfReader(r); Assert.assertEquals(occurences, PluginBridgeTest.countOccurences(s, "-html")); } @Test public void htmlSwitchCorrectAccordingToJnlpRuntimeAndShortcutType() throws Exception { AccessWarningPaneComplexReturn.ShortcutResult.Shortcut[] v = AccessWarningPaneComplexReturn.ShortcutResult.Shortcut.values(); for (AccessWarningPaneComplexReturn.ShortcutResult.Shortcut w : v) { int var1 = 0; if (w == AccessWarningPaneComplexReturn.ShortcutResult.Shortcut.JAVAWS_HTML) { var1 = 1; } testHtmlOccurences(true, true, true, w, 1); testHtmlOccurences(true, false, false, w, var1); testHtmlOccurences(true, false, true, w, var1); testHtmlOccurences(true, true, false, w, 1); testHtmlOccurences(false, true, true, w, 0); testHtmlOccurences(false, false, false, w, var1); testHtmlOccurences(false, true, false, w, 0); testHtmlOccurences(false, false, true, w, var1); } } private static class DummyJnlpWithTitle extends DummyJNLPFileWithJar { public DummyJnlpWithTitle() throws MalformedURLException { super(new File("/some/path/blah.jar")); } @Override public InformationDesc getInformation() { return new InformationDesc(null, false) { @Override public String getTitle() { return "Demo App"; } }; } }; } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/util/PaxHeaders.17941/UrlUtilsTest.java0000644000000000000000000000013012654402377027061 xustar0030 mtime=1454507263.225432741 29 atime=1454507327.20757943 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/util/UrlUtilsTest.java0000644000175000002070000004772512654402377027625 0ustar00jvanekmock00000000000000/* Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import java.io.File; import java.net.MalformedURLException; import java.net.URL; import net.sourceforge.jnlp.annotations.KnownToFail; import org.junit.Assert; import org.junit.Test; public class UrlUtilsTest { @Test public void testNormalizeUrlAndStripParams() throws Exception { /* Test that URL is normalized (encoded if not already encoded, leading whitespace trimmed, etc) */ assertEquals("http://example.com/%20test%20test", UrlUtils.normalizeUrlAndStripParams(new URL("http://example.com/ test%20test ")).toString()); /* Test that a URL without '?' is left unchanged */ assertEquals("http://example.com/test", UrlUtils.normalizeUrlAndStripParams(new URL("http://example.com/test")).toString()); /* Test that parts of a URL that come after '?' are stripped */ assertEquals("http://example.com/test", UrlUtils.normalizeUrlAndStripParams(new URL("http://example.com/test?test=test")).toString()); /* Test that everything after the first '?' is stripped */ assertEquals("http://example.com/test", UrlUtils.normalizeUrlAndStripParams(new URL("http://example.com/test?http://example.com/?test")).toString()); /* Test normalization + stripping */ assertEquals("http://example.com/%20test%20test", UrlUtils.normalizeUrlAndStripParams(new URL("http://example.com/ test%20test ?test=test")).toString()); } @Test public void testDecodeUrlQuietly() throws Exception { // This is a wrapper over URLDecoder.decode, simple test suffices assertEquals("http://example.com/ test test", UrlUtils.decodeUrlQuietly(new URL("http://example.com/%20test%20test")).toString()); } @Test public void testNormalizeUrl() throws Exception { boolean[] encodeFileUrlPossiblities = {false, true}; // encodeFileUrl flag should have no effect on non-file URLs, but let's be sure. for (boolean encodeFileUrl : encodeFileUrlPossiblities ) { // Test URL with no previous encoding assertEquals("http://example.com/%20test", UrlUtils.normalizeUrl(new URL("http://example.com/ test"), encodeFileUrl).toString()); // Test partially encoded URL with trailing spaces assertEquals("http://example.com/%20test%20test", UrlUtils.normalizeUrl(new URL("http://example.com/ test%20test "), encodeFileUrl).toString()); } // Test file URL with file URL encoding turned off assertFalse("file://example/%20test".equals( UrlUtils.normalizeUrl(new URL("file://example/ test"), false).toString())); // Test file URL with file URL encoding turned on assertEquals("file://example/%20test", UrlUtils.normalizeUrl(new URL("file://example/ test"), true).toString()); // PR1465: Test that RFC2396-compliant URLs are not touched // Example taken from bug report: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1465 String rfc2396Valid = "https://example.com/,DSID=64c19c5b657df383835706571a7c7216,DanaInfo=example.com,CT=java+JICAComponents/JICA-sicaN.jar"; assertEquals(rfc2396Valid, UrlUtils.normalizeUrl(new URL(rfc2396Valid)).toString()); } @Test public void testIsValidRFC2396Url() throws Exception { String rfc2396Valid = "https://example.com/,foo=bar+baz/JICA-sicaN.jar"; assertTrue(UrlUtils.isValidRFC2396Url(new URL(rfc2396Valid))); // These should invalidate the URL // See http://www.ietf.org/rfc/rfc2396.txt (2.4.3. Excluded US-ASCII Characters) char[] invalidCharacters = {'<', '>', '%', '"', }; for (char chr : invalidCharacters) { assertFalse("validation failed with '" + chr + "'",UrlUtils.isValidRFC2396Url(new URL(rfc2396Valid + chr))); } //special test for space inisde. Space at the end can be trimmed assertFalse("validation failed with '" + ' ' + "'",UrlUtils.isValidRFC2396Url(new URL("https://example.com/,foo=bar+ba z/JICA-sicaN.jar"))); } @Test public void testNormalizeUrlQuietly() throws Exception { // This is a wrapper over UrlUtils.normalizeUrl(), simple test suffices assertEquals("http://example.com/%20test%20test", UrlUtils.normalizeUrl(new URL("http://example.com/ test%20test ")).toString()); } @Test public void testDecodeUrlAsFile() throws Exception { String[] testPaths = {"/simple", "/ with spaces", "/with /multiple=/ odd characters?"}; for (String testPath : testPaths) { File testFile = new File(testPath); URL notEncodedUrl = testFile.toURI().toURL(); URL encodedUrl = testFile.toURI().toURL(); assertEquals(testFile, UrlUtils.decodeUrlAsFile(notEncodedUrl)); assertEquals(testFile, UrlUtils.decodeUrlAsFile(encodedUrl)); } } @Test public void testNormalizeUrlSlashStrings() throws Exception { String u11 = UrlUtils.sanitizeLastSlash("http://aa.bb/aaa/bbb////"); String u22 = UrlUtils.sanitizeLastSlash("http://aa.bb/aaa/bbb"); assertEquals(u11, u22); assertEquals(u11, "http://aa.bb/aaa/bbb"); String u1 = UrlUtils.sanitizeLastSlash(("http://aa.bb/aaa\\bbb\\")); String u2 = UrlUtils.sanitizeLastSlash(("http://aa.bb/aaa\\bbb")); assertEquals(u1, u2); assertEquals(u1, ("http://aa.bb/aaa\\bbb")); } @Test public void testNormalizeUrlSlashUrls() throws Exception { URL u11 = UrlUtils.sanitizeLastSlash(new URL("http://aa.bb/aaa/bbb////")); URL u22 = UrlUtils.sanitizeLastSlash(new URL("http://aa.bb/aaa/bbb")); assertEquals(u11, u22); assertEquals(u11, new URL("http://aa.bb/aaa/bbb")); URL u1 = UrlUtils.sanitizeLastSlash(new URL("http://aa.bb/aaa\\bbb\\")); URL u2 = UrlUtils.sanitizeLastSlash(new URL("http://aa.bb/aaa\\bbb")); assertEquals(u1, u2); assertEquals(u1, new URL("http://aa.bb/aaa\\bbb")); } @Test public void testEqualsIgnoreLastSlash() throws Exception { URL u11 = (new URL("http://aa.bb/aaa/bbb////")); URL u22 = (new URL("http://aa.bb/aaa/bbb")); assertTrue(UrlUtils.equalsIgnoreLastSlash(u11, u22)); assertTrue(UrlUtils.equalsIgnoreLastSlash(u11, new URL("http://aa.bb/aaa/bbb"))); URL u1 = (new URL("http://aa.bb/aaa\\bbb\\")); URL u2 = (new URL("http://aa.bb/aaa\\bbb")); assertTrue(UrlUtils.equalsIgnoreLastSlash(u1, u2)); assertTrue(UrlUtils.equalsIgnoreLastSlash(u1, new URL("http://aa.bb/aaa\\bbb"))); assertTrue(UrlUtils.equalsIgnoreLastSlash(new URL("http://aa.bb/aaa\\bbb\\"), new URL("http://aa.bb/aaa\\bbb/"))); assertFalse(UrlUtils.equalsIgnoreLastSlash(new URL("http://aa.bb/aaa\\bbb\\"), new URL("http://aa.bb/aaa/bbb/"))); } @Test public void removeFileName1() throws Exception { URL l1 = UrlUtils.removeFileName(new URL("http://aaa.bb/xyz/hchkr/jar.jar")); assertEquals(l1, new URL("http://aaa.bb/xyz/hchkr")); URL l2 = UrlUtils.removeFileName(new URL("http://aaa.bb/xyz/hchkr/")); assertEquals(l2, new URL("http://aaa.bb/xyz/hchkr")); URL l3 = UrlUtils.removeFileName(new URL("http://aaa.bb/xyz/hchkr")); assertEquals(l3, new URL("http://aaa.bb/xyz")); URL l4 = UrlUtils.removeFileName(new URL("http://aaa.bb/xyz/jar.jar")); assertEquals(l4, new URL("http://aaa.bb/xyz")); URL l5 = UrlUtils.removeFileName(new URL("http://aaa.bb/xyz/")); assertEquals(l5, new URL("http://aaa.bb/xyz")); URL l6 = UrlUtils.removeFileName(new URL("http://aaa.bb/xyz")); assertEquals(l6, new URL("http://aaa.bb")); URL l7 = UrlUtils.removeFileName(new URL("http://aaa.bb/jar.jar")); assertEquals(l7, new URL("http://aaa.bb")); URL l8 = UrlUtils.removeFileName(new URL("http://aaa.bb/")); assertEquals(l8, new URL("http://aaa.bb")); URL l9 = UrlUtils.removeFileName(new URL("http://aaa.bb")); assertEquals(l9, new URL("http://aaa.bb")); } public void removeFileName2() throws Exception { URL l1 = UrlUtils.removeFileName(new URL("http://aaa.bb/xyz\\hchkr\\jar.jar")); assertEquals(l1, new URL("http://aaa.bb/xyz\\hchkr")); URL l2 = UrlUtils.removeFileName(new URL("http://aaa.bb/xyz\\hchkr\\")); assertEquals(l2, new URL("http://aaa.bb/xyz\\hchkr")); URL l3 = UrlUtils.removeFileName(new URL("http://aaa.bb/xyz\\hchkr")); assertEquals(l3, new URL("http://aaa.bb/xyz")); URL l4 = UrlUtils.removeFileName(new URL("http://aaa.bb/xyz\\jar.jar")); assertEquals(l4, new URL("http://aaa.bb/xyz")); URL l5 = UrlUtils.removeFileName(new URL("http://aaa.bb/xyz\\")); assertEquals(l5, new URL("http://aaa.bb/xyz")); URL l6 = UrlUtils.removeFileName(new URL("http://aaa.bb/xyz")); assertEquals(l6, new URL("http://aaa.bb")); URL l7 = UrlUtils.removeFileName(new URL("http://aaa.bb/jar.jar")); assertEquals(l7, new URL("http://aaa.bb")); URL l8 = UrlUtils.removeFileName(new URL("http://aaa.bb/")); assertEquals(l8, new URL("http://aaa.bb")); URL l9 = UrlUtils.removeFileName(new URL("http://aaa.bb")); assertEquals(l9, new URL("http://aaa.bb")); } @Test public void removeFileName3() throws Exception { URL l1 = UrlUtils.removeFileName(new URL("http://aaa.bb/xyz/hchkr/jar.jar?someParam=some¶m=very\\evil\\")); assertEquals(l1, new URL("http://aaa.bb/xyz/hchkr")); URL l2 = UrlUtils.removeFileName(new URL("http://aaa.bb/xyz/hchkr/?another=Param¶m=very/evil/")); assertEquals(l2, new URL("http://aaa.bb/xyz/hchkr")); URL l3 = UrlUtils.removeFileName(new URL("http://aaa.bb/xyz/hchkr?stillSomePArams=aa")); assertEquals(l3, new URL("http://aaa.bb/xyz")); URL l4 = UrlUtils.removeFileName(new URL("http://aaa.bb/xyz/jar.jar?again=param/bad\\bad/params")); assertEquals(l4, new URL("http://aaa.bb/xyz")); URL l5 = UrlUtils.removeFileName(new URL("http://aaa.bb/xyz/?goingOnWith=params/bad/params")); assertEquals(l5, new URL("http://aaa.bb/xyz")); URL l6 = UrlUtils.removeFileName(new URL("http://aaa.bb/xyz?someParam=some")); assertEquals(l6, new URL("http://aaa.bb")); URL l7 = UrlUtils.removeFileName(new URL("http://aaa.bb/jar.jar?someParam=some")); assertEquals(l7, new URL("http://aaa.bb")); URL l8 = UrlUtils.removeFileName(new URL("http://aaa.bb/?someParam=some")); assertEquals(l8, new URL("http://aaa.bb")); } @Test public void testUrlEquals() throws Exception { final URL n1 = null, n2 = null, u1 = new URL("http://example.com"), u2 = u1, u3 = new URL("http://example.com"); Assert.assertTrue("Two nulls should be equal", UrlUtils.urlEquals(n1, n2)); Assert.assertFalse("Null URL should not equal a non-null", UrlUtils.urlEquals(n1, u1)); Assert.assertTrue("URL should equal itself (same reference)", UrlUtils.urlEquals(u1, u2)); Assert.assertTrue("URLs should be equal when different reference but the same URL", UrlUtils.urlEquals(u1, u3)); } @Test(expected = NullPointerException.class) public void verifyNotNullUrlEqualsThrowsExceptionWhenBothArgumentsAreNull() throws Exception { UrlUtils.notNullUrlEquals(null, null); } @Test(expected = NullPointerException.class) public void nverifyNotNullUrlEqualsThrowsExceptionWhenFirstArgumentIsNull() throws Exception { UrlUtils.notNullUrlEquals(null, new URL("ftp://aa.bb")); } @Test(expected = NullPointerException.class) public void verifyNotNullUrlEqualsThrowsExceptionWhenSecondArgumentIsNull() throws Exception { UrlUtils.notNullUrlEquals(new URL("ftp://aa.bb"), null); } @Test public void notNullUrlValuesEqualsCaseSensitiveIssuesTest() throws Exception { final URL u1 = new URL("http://example.com"), u2 = u1, u3 = new URL("HTTP://example.com"); final URL u11 = new URL("http://example.com/path"), u12 = new URL("http://EXAMPLE.com/path"), u13 = new URL("http://example.com/PATH"), u14 = new URL("http://example.com/path2"); final URL u21 = new URL("http://example2.com"); final URL u22 = new URL("ftp://example.com"); Assert.assertTrue(UrlUtils.notNullUrlEquals(u1, u2)); Assert.assertTrue(UrlUtils.notNullUrlEquals(u1, u3)); Assert.assertTrue(UrlUtils.notNullUrlEquals(u11, u12)); Assert.assertFalse(UrlUtils.notNullUrlEquals(u11, u13)); Assert.assertFalse(UrlUtils.notNullUrlEquals(u12, u13)); Assert.assertFalse(UrlUtils.notNullUrlEquals(u11, u14)); Assert.assertFalse(UrlUtils.notNullUrlEquals(u12, u14)); Assert.assertFalse(UrlUtils.notNullUrlEquals(u13, u14)); Assert.assertFalse(UrlUtils.notNullUrlEquals(u1, u21)); Assert.assertFalse(UrlUtils.notNullUrlEquals(u1, u22)); Assert.assertFalse(UrlUtils.notNullUrlEquals(u21, u22)); } @Test //the ports are for some unknown reason ignored from comparsion @KnownToFail public void notNullUrlComapreWithPorts() throws Exception { final URL u1 = new URL("http://example.com:1"), u2 = new URL("http://example.com:1"), u3 = new URL("http://example.com:3"); Assert.assertTrue(UrlUtils.notNullUrlEquals(u1, u2)); Assert.assertFalse(UrlUtils.notNullUrlEquals(u1, u3)); Assert.assertFalse(UrlUtils.notNullUrlEquals(u2, u3)); } @Test public void testCompareNullableStrings_nulls() throws Exception { Assert.assertTrue(UrlUtils.compareNullableStrings(null, null, true)); Assert.assertTrue(UrlUtils.compareNullableStrings(null, null, false)); Assert.assertFalse(UrlUtils.compareNullableStrings(null, "blah", true)); Assert.assertFalse(UrlUtils.compareNullableStrings("blah", null, false)); } @Test public void testCompareNullableStrings_values() throws Exception { Assert.assertTrue(UrlUtils.compareNullableStrings("aaa", "aaa", true)); Assert.assertTrue(UrlUtils.compareNullableStrings("aaa", "aaa", false)); Assert.assertFalse(UrlUtils.compareNullableStrings("aaa", "AAA", false)); Assert.assertTrue(UrlUtils.compareNullableStrings("aaa", "AAA", true)); Assert.assertFalse(UrlUtils.compareNullableStrings("AAA", "aaa", false)); Assert.assertTrue(UrlUtils.compareNullableStrings("AAA", "aaa", true)); Assert.assertFalse(UrlUtils.compareNullableStrings("aaa", "bbb", true)); Assert.assertFalse(UrlUtils.compareNullableStrings("aaa", "BBB", false)); Assert.assertFalse(UrlUtils.compareNullableStrings("BBB", "aaa", false)); } @Test public void sanitizePortTest() throws MalformedURLException { Assert.assertEquals(0, UrlUtils.getSanitizedPort(new URL("http://aaa.cz:0"))); Assert.assertEquals(1, UrlUtils.getSanitizedPort(new URL("https://aaa.cz:1"))); Assert.assertEquals(100, UrlUtils.getSanitizedPort(new URL("ftp://aaa.cz:100"))); //Assert.assertEquals(1001, UrlUtils.getSanitizedPort(new URL("ssh://aaa.cz:1001"))); unknown protocol :( //Assert.assertEquals(22, UrlUtils.getSanitizedPort(new URL("ssh://aaa.cz"))); Assert.assertEquals(80, UrlUtils.getSanitizedPort(new URL("http://aaa.cz"))); Assert.assertEquals(443, UrlUtils.getSanitizedPort(new URL("https://aaa.cz"))); Assert.assertEquals(21, UrlUtils.getSanitizedPort(new URL("ftp://aaa.cz"))); } @Test public void getPortTest() throws MalformedURLException { Assert.assertEquals(1, UrlUtils.getPort(new URL("http://aa.bb:1"))); Assert.assertEquals(10, UrlUtils.getPort(new URL("http://aa.bb:10/aa"))); Assert.assertEquals(1000, UrlUtils.getPort(new URL("http://aa.bb:1000/aa.fs"))); Assert.assertEquals(443, UrlUtils.getPort(new URL("https://aa.bb/aa.fs"))); Assert.assertEquals(80, UrlUtils.getPort(new URL("http://aa.bb"))); Assert.assertEquals(80, UrlUtils.getPort(new URL("http://aa.bb:80/a/b/c"))); } @Test public void getHostAndPortTest() throws MalformedURLException { Assert.assertEquals("aa.bb:2", UrlUtils.getHostAndPort(new URL("http://aa.bb:2"))); Assert.assertEquals("aa.bb:12", UrlUtils.getHostAndPort(new URL("http://aa.bb:12/aa"))); Assert.assertEquals("aa.bb:1002", UrlUtils.getHostAndPort(new URL("http://aa.bb:1002/aa.fs"))); Assert.assertEquals("aa.bb:443", UrlUtils.getHostAndPort(new URL("https://aa.bb/aa.fs"))); Assert.assertEquals("aa.bb:80", UrlUtils.getHostAndPort(new URL("http://aa.bb"))); Assert.assertEquals("aa.bb:80", UrlUtils.getHostAndPort(new URL("http://aa.bb:80/a/b/c"))); } @Test public void ensureSlashTailTest() { Assert.assertEquals("a/", UrlUtils.ensureSlashTail("a")); Assert.assertEquals("aa/a/", UrlUtils.ensureSlashTail("aa/a")); Assert.assertEquals("aa/a/", UrlUtils.ensureSlashTail("aa/a/")); Assert.assertEquals("/aa/a/", UrlUtils.ensureSlashTail("/aa/a/")); Assert.assertEquals("/aa/a/", UrlUtils.ensureSlashTail("/aa/a")); Assert.assertEquals("aa\\a\\", UrlUtils.ensureSlashTail("aa\\a")); Assert.assertEquals("aa\\a\\", UrlUtils.ensureSlashTail("aa\\a\\")); Assert.assertEquals("\\aa\\a\\", UrlUtils.ensureSlashTail("\\aa\\a\\")); Assert.assertEquals("\\aa\\a\\", UrlUtils.ensureSlashTail("\\aa\\a")); Assert.assertEquals("\\aa/a/", UrlUtils.ensureSlashTail("\\aa/a")); Assert.assertEquals("//aa\\a/", UrlUtils.ensureSlashTail("//aa\\a")); Assert.assertEquals("\\aa/a/", UrlUtils.ensureSlashTail("\\aa/a/")); Assert.assertEquals("\\aa/a\\", UrlUtils.ensureSlashTail("\\aa/a\\")); } @Test public void ensureSlashTailTest3() throws MalformedURLException { Assert.assertEquals("http://aa.bb:2/aa/", UrlUtils.ensureSlashTail(new URL("http://aa.bb:2/aa")).toExternalForm()); Assert.assertEquals("http://aa.bb/aa/", UrlUtils.ensureSlashTail(new URL("http://aa.bb/aa/")).toExternalForm()); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/util/PaxHeaders.17941/TimedHashMapTest.java0000644000000000000000000000013012654402377027602 xustar0030 mtime=1454507263.224432754 29 atime=1454507327.20757943 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/util/TimedHashMapTest.java0000644000175000002070000001605612654402377030337 0ustar00jvanekmock00000000000000/* TimedHashMapTest.java Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import java.util.Collection; import java.util.HashMap; import java.util.Map; import java.util.Set; import java.util.concurrent.TimeUnit; import org.junit.Before; import org.junit.Test; public class TimedHashMapTest { private TimedHashMap testMap; private Object o1, o2, o3, o4; @Before public void resetTestMap() { testMap = new TimedHashMap<>(); o1 = new Object(); o2 = new Object(); o3 = new Object(); o4 = new Object(); } @Test public void testPutAndGet() { testMap.put(o1, o2); testMap.put(o2, o4); testMap.put(o3, o4); assertEquals("map[o1] != o2", o2, testMap.get(o1)); assertEquals("map[o2] != o4", o4, testMap.get(o2)); assertEquals("map[o3] != o4", o4, testMap.get(o3)); testMap.put(o1, o3); assertEquals("map[o1] != o3", o3, testMap.get(o1)); } @Test public void testEntryExpiry() throws Exception { testMap.setTimeout(0, TimeUnit.NANOSECONDS); // immediate expiry testMap.put(o1, o2); Thread.sleep(5); // so we don't manage to put and get in the same nanosecond assertNull("map[o1] should have expired", testMap.get(o1)); } @Test(expected = NullPointerException.class) public void testPutNullKey() { testMap.put(null, o1); } @Test public void testPutNullValue() { testMap.put(o1, null); assertNull("map[o1] != null", testMap.get(o1)); assertTrue("testMap should contain the key o1", testMap.containsKey(o1)); } @Test public void testContainsKey() { testMap.put(o1, o2); assertTrue("testMap should contain the key o1", testMap.containsKey(o1)); } @Test public void testSize() { assertEquals(0, testMap.size()); testMap.put(o1, o2); assertEquals(1, testMap.size()); } @Test public void testIsEmpty() { assertTrue("map should be empty", testMap.isEmpty()); testMap.put(o1, o2); assertFalse("map should not be empty", testMap.isEmpty()); } @Test public void testContainsValue() { assertFalse("map should not contain o2", testMap.containsValue(o2)); testMap.put(o1, o2); assertTrue("map does not contain o2", testMap.containsValue(o2)); } @Test public void testContainsValueNull() { assertFalse("map should not contain null value", testMap.containsValue(null)); testMap.put(o1, null); assertTrue("map does not contain null value", testMap.containsValue(null)); } @Test public void testRemove() { testMap.put(o1, o2); o3 = testMap.remove(o1); assertEquals("o2 != o3", o2, o3); assertFalse("map should not contain o1", testMap.containsKey(o1)); } @Test public void testRemoveFromEmpty() { o2 = testMap.remove(o1); assertNull("o2 should be null", o2); } @Test public void testPutAll() { final Map newMap = new HashMap<>(); newMap.put(o1, o2); newMap.put(o3, o4); testMap.putAll(newMap); assertTrue("map should contain key o1", testMap.containsKey(o1)); assertTrue("map should contain value o2", testMap.containsValue(o2)); assertTrue("map should contain key o3", testMap.containsKey(o3)); assertTrue("map should contain value o4", testMap.containsValue(o4)); assertEquals("map[o1] != o2", o2, testMap.get(o1)); assertEquals("map[o3] != o4", o4, testMap.get(o3)); assertEquals(2, testMap.size()); } @Test public void testClear() { testMap.put(o1, o2); testMap.clear(); assertEquals(0, testMap.size()); assertFalse("map should not contain key o1", testMap.containsKey(o1)); assertFalse("map should not contain value o2", testMap.containsValue(o2)); } @Test public void testKeySet() { testMap.put(o1, o2); Set keys = testMap.keySet(); assertNotNull("keyset should not be null", keys); assertTrue("keyset should contain o1", keys.contains(o1)); assertEquals(1, keys.size()); } @Test public void testValues() { testMap.put(o1, o2); Collection values = testMap.values(); assertNotNull("values collection should not be null", values); assertTrue("values collection should contain o2", values.contains(o2)); assertEquals(1, values.size()); } @Test public void testEntrySet() { testMap.put(o1, o2); testMap.put(o3, o4); Set> entrySet = testMap.entrySet(); assertNotNull("entryset should not be null", entrySet); assertEquals(2, entrySet.size()); for (final Map.Entry entry : entrySet) { final Object key = entry.getKey(); final Object value = entry.getValue(); if (key.equals(o1)) { assertEquals("entry with key o1 should have value o2", o2, value); } if (key.equals(o3)) { assertEquals("entry with key o3 should have value o4", o4, value); } } } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/util/PaxHeaders.17941/PropertiesFileTest.java0000644000000000000000000000013012654402377030232 xustar0030 mtime=1454507263.224432754 29 atime=1454507327.20757943 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/util/PropertiesFileTest.java0000644000175000002070000001322212654402377030757 0ustar00jvanekmock00000000000000/* PropertiesFileTest.java Copyright (C) 2012 Thomas Meyer This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import java.io.File; import java.io.IOException; import java.nio.file.Files; import org.junit.Before; import org.junit.Test; public class PropertiesFileTest { private PropertiesFile propertiesFile; @Before public void setup() throws IOException { File lru = Files.createTempFile("properties_file", ".tmp").toFile(); lru.createNewFile(); lru.deleteOnExit(); propertiesFile = new PropertiesFile(lru); } @Test public void testSetProperty() { propertiesFile.setProperty("key", "value"); assertTrue(propertiesFile.containsKey("key") && propertiesFile.containsValue("value")); } @Test public void testGetProperty() { propertiesFile.setProperty("key", "value"); String v = propertiesFile.getProperty("key"); assertEquals("value", v); } @Test public void testGetDefaultProperty() { String v = propertiesFile.getProperty("key", "default"); assertEquals("default", v); } @Test public void testStore() throws IOException { String key = "key"; String value = "value"; propertiesFile.setProperty(key, value); try { propertiesFile.lock(); propertiesFile.store(); } finally { propertiesFile.unlock(); } File f = propertiesFile.getStoreFile(); String output = new String(Files.readAllBytes(f.toPath())); assertTrue(output.contains(key + "=" + value)); } @Test public void testReloadAfterStore() { try { boolean reloaded; propertiesFile.lock(); // 1. clear entries + store clearPropertiesFile(); // 2. load from file reloaded = propertiesFile.load(); assertTrue("File was not reloaded!", reloaded); // 3. add some entries and store fillProperties(10); propertiesFile.store(); reloaded = propertiesFile.load(); assertTrue("File was not reloaded!", reloaded); } finally { propertiesFile.unlock(); } } private void fillProperties(int noEntries) { for(int i = 0; i < noEntries; i++) { propertiesFile.setProperty(String.valueOf(i), String.valueOf(i)); } } private void clearPropertiesFile() { try { propertiesFile.lock(); // clear cache + store file propertiesFile.clear(); propertiesFile.store(); } finally { propertiesFile.unlock(); } } @Test public void testLoad() throws InterruptedException { try { propertiesFile.lock(); propertiesFile.setProperty("key", "value"); propertiesFile.store(); propertiesFile.setProperty("shouldNotRemainAfterLoad", "def"); propertiesFile.load(); assertFalse(propertiesFile.contains("shouldNotRemainAfterLoad")); } finally { propertiesFile.unlock(); } } @Test public void testLoadWithNoChanges() throws InterruptedException { try { propertiesFile.lock(); propertiesFile.setProperty("key", "value"); propertiesFile.store(); Thread.sleep(1000l); assertFalse(propertiesFile.load()); } finally { propertiesFile.unlock(); } } @Test public void testLock() throws IOException { try { propertiesFile.lock(); assertTrue(propertiesFile.isHeldByCurrentThread()); } finally { propertiesFile.unlock(); } } @Test public void testUnlock() throws IOException { try { propertiesFile.lock(); } finally { propertiesFile.unlock(); } assertTrue(!propertiesFile.isHeldByCurrentThread()); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/util/PaxHeaders.17941/MD5SumWatcherTest.java0000644000000000000000000000013012654402377027666 xustar0030 mtime=1454507263.224432754 29 atime=1454507327.20757943 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/util/MD5SumWatcherTest.java0000644000175000002070000000754212654402377030423 0ustar00jvanekmock00000000000000/*Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import java.io.File; import java.io.FileNotFoundException; import java.util.Arrays; import org.junit.After; import org.junit.Before; import org.junit.Test; public class MD5SumWatcherTest { private File file; private MD5SumWatcher watcher; @Before public void createNewFile() throws Exception { file = File.createTempFile("md5sumwatchertest", "tmp"); file.deleteOnExit(); watcher = new MD5SumWatcher(file); } @After public void deleteTempFile() throws Exception { if (file.exists()) { file.delete(); } } @Test public void testNonExistentFile() { file.delete(); file.mkdirs(); watcher = new MD5SumWatcher(file); boolean gotException = false; try { watcher.update(); } catch (final Exception e) { gotException = true; assertTrue("Should have received FileNotFoundException", e instanceof FileNotFoundException); } assertTrue("Should have received FileNotFoundException", gotException); } @Test public void testNoFileChangeGivesSameMd5() throws Exception { byte[] sum = watcher.getSum(); byte[] sum2 = watcher.getSum(); assertTrue("MD5 sums should be the same. first: " + Arrays.toString(sum) + ", second: " + Arrays.toString(sum2), Arrays.equals(sum, sum2)); } @Test public void testSavingToFileChangesMd5() throws Exception { byte[] original = watcher.getSum(); FileUtils.saveFile("some test content\n", file); byte[] changed = watcher.getSum(); assertFalse("MD5 sum should have changed, but was constant as " + Arrays.toString(original), Arrays.equals(original, changed)); } @Test public void testUnchangedContentUpdate() throws Exception { assertFalse("update() should return false", watcher.update()); } @Test public void testChangedContentUpdate() throws Exception { FileUtils.saveFile("some test content\n", file); final boolean changed = watcher.update(); assertTrue("update() should return true", changed); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/util/PaxHeaders.17941/ImageResourcesTest.java0000644000000000000000000000013112654402377030214 xustar0030 mtime=1454507263.223432768 30 atime=1454507327.206579443 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/util/ImageResourcesTest.java0000644000175000002070000000462112654402377030743 0ustar00jvanekmock00000000000000/* ImageResourcesTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import java.awt.Image; import java.util.List; import org.junit.After; import org.junit.Before; import org.junit.Test; public class ImageResourcesTest { @Before public void setUp() { ImageResources.INSTANCE.clearCache(); } @After public void tearDown() { ImageResources.INSTANCE.clearCache(); } @Test public void testApplicationImages() { List images = ImageResources.INSTANCE.getApplicationImages(); assertNotNull(images); assertTrue(images.size() > 0); for (Image image : images) { assertNotNull(image); } } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/util/PaxHeaders.17941/HttpUtilsTest.java0000644000000000000000000000013112654402377027237 xustar0030 mtime=1454507263.223432768 30 atime=1454507327.206579443 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/util/HttpUtilsTest.java0000644000175000002070000002316312654402377027770 0ustar00jvanekmock00000000000000/* Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.PrintStream; import java.io.UnsupportedEncodingException; import java.net.HttpURLConnection; import java.net.URL; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.ServerLauncher; import net.sourceforge.jnlp.util.logging.OutputController; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; public class HttpUtilsTest { private static PrintStream[] backedUpStream = new PrintStream[4]; private static ByteArrayOutputStream currentErrorStream; @BeforeClass //keeping silent outputs from launched jvm public static void redirectErr() throws IOException { for (int i = 0; i < backedUpStream.length; i++) { if (backedUpStream[i] == null) { switch (i) { case 0: backedUpStream[i] = System.out; break; case 1: backedUpStream[i] = System.err; break; case 2: backedUpStream[i] = OutputController.getLogger().getOut(); break; case 3: backedUpStream[i] = OutputController.getLogger().getErr(); break; } } } currentErrorStream = new ByteArrayOutputStream(); System.setOut(new PrintStream(currentErrorStream)); System.setErr(new PrintStream(currentErrorStream)); OutputController.getLogger().setOut(new PrintStream(currentErrorStream)); OutputController.getLogger().setErr(new PrintStream(currentErrorStream)); } @AfterClass public static void redirectErrBack() throws IOException { ServerAccess.logErrorReprint(currentErrorStream.toString("utf-8")); System.setOut(backedUpStream[0]); System.setErr(backedUpStream[1]); OutputController.getLogger().setOut(backedUpStream[2]); OutputController.getLogger().setErr(backedUpStream[3]); } @Test public void consumeAndCloseConnectionSilentlyTest() throws IOException { redirectErr(); try{ Exception exception = null; try { HttpUtils.consumeAndCloseConnectionSilently(new HttpURLConnection(null) { @Override public void disconnect() { throw new UnsupportedOperationException("Not supported yet."); } @Override public boolean usingProxy() { throw new UnsupportedOperationException("Not supported yet."); } @Override public void connect() throws IOException { throw new UnsupportedOperationException("Not supported yet."); } }); } catch (Exception ex) { ServerAccess.logException(ex); exception = ex; } Assert.assertNull("no exception expected - was" + exception, exception); try { HttpUtils.consumeAndCloseConnectionSilently(new HttpURLConnection(new URL("http://localhost/blahblah")) { @Override public void disconnect() { throw new UnsupportedOperationException("Not supported yet."); } @Override public boolean usingProxy() { throw new UnsupportedOperationException("Not supported yet."); } @Override public void connect() throws IOException { throw new UnsupportedOperationException("Not supported yet."); } }); } catch (Exception ex) { ServerAccess.logException(ex); exception = ex; } Assert.assertNull("no exception expected - was" + exception, exception); ServerLauncher serverLauncher =ServerAccess.getIndependentInstance(System.getProperty("user.dir"), ServerAccess.findFreePort()); try{ try { HttpUtils.consumeAndCloseConnectionSilently(new HttpURLConnection(serverLauncher.getUrl("definitelyNotExisitnfFileInHappyMemoryOfAdam")) { //:) @Override public void disconnect() { } @Override public boolean usingProxy() { return false; } @Override public void connect() throws IOException { } }); } catch (Exception ex) { ServerAccess.logException(ex); exception = ex; } Assert.assertNull("no exception expected - was" + exception, exception); }finally{ try{ serverLauncher.stop(); }catch(Exception ex){ ServerAccess.logException(ex); } } }finally{ redirectErrBack(); } } @Test public void consumeAndCloseConnectionTest() throws IOException { redirectErr(); try{ Exception exception = null; try { HttpUtils.consumeAndCloseConnection(new HttpURLConnection(null) { @Override public void disconnect() { throw new UnsupportedOperationException("Not supported yet."); } @Override public boolean usingProxy() { throw new UnsupportedOperationException("Not supported yet."); } @Override public void connect() throws IOException { throw new UnsupportedOperationException("Not supported yet."); } }); } catch (Exception ex) { ServerAccess.logException(ex); exception = ex; } Assert.assertNotNull("exception expected - wasnt" + exception, exception); try { HttpUtils.consumeAndCloseConnection(new HttpURLConnection(new URL("http://localhost/blahblah")) { @Override public void disconnect() { throw new UnsupportedOperationException("Not supported yet."); } @Override public boolean usingProxy() { throw new UnsupportedOperationException("Not supported yet."); } @Override public void connect() throws IOException { throw new UnsupportedOperationException("Not supported yet."); } }); } catch (Exception ex) { ServerAccess.logException(ex); exception = ex; } Assert.assertNotNull("exception expected - wasnt" + exception, exception); ServerLauncher s =ServerAccess.getIndependentInstance(System.getProperty("user.dir"), ServerAccess.findFreePort()); try{ try { HttpUtils.consumeAndCloseConnection(new HttpURLConnection(s.getUrl("blahblahblah")) { @Override public void disconnect() { } @Override public boolean usingProxy() { return false; } @Override public void connect() throws IOException { } }); } catch (Exception ex) { ServerAccess.logException(ex); exception = ex; } Assert.assertNotNull(" exception expected - wasnt" + exception, exception); }finally{ try{ s.stop(); }catch(Exception ex){ ServerAccess.logException(ex); } } }finally{ redirectErrBack(); } } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/util/PaxHeaders.17941/FileUtilsTest.java0000644000000000000000000000013112654402377027177 xustar0030 mtime=1454507263.223432768 30 atime=1454507327.206579443 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/util/FileUtilsTest.java0000644000175000002070000000661012654402377027726 0ustar00jvanekmock00000000000000/* FileUtilsTest.java Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util; import java.io.File; import org.junit.Test; import static org.junit.Assert.*; public class FileUtilsTest { private static final char[] INVALID = { '\\', '/', ':', '*', '?', '"', '<', '>', '|', }; private static final char SANITIZED = '_'; @Test public void testSanitizePath() throws Exception { for (char ch : INVALID) { String str = File.separator + "tmp" + File.separator + "test" + ch + "path"; String sanitized = FileUtils.sanitizePath(str); assertFalse(ch + " should be sanitized from " + sanitized, ch != File.separatorChar && sanitized.contains(Character.toString(ch))); assertEquals(str.replace(ch, ch == File.separatorChar ? ch : SANITIZED), sanitized); } } @Test public void testSanitizeFilename() throws Exception { for (char ch : INVALID) { String str = "file" + ch + "name"; String sanitized = FileUtils.sanitizeFileName(str); assertFalse(ch + " should be sanitized from " + sanitized, sanitized.contains(Character.toString(ch))); assertEquals(str.replace(ch, SANITIZED), sanitized); } } @Test public void testCreateParentDir() throws Exception { final File tmpdir = new File(System.getProperty("java.io.tmpdir")), testParent = new File(tmpdir, "itw_test_create_parent_dir"), testChild = new File(testParent, "test_child_dir"); testChild.deleteOnExit(); testParent.deleteOnExit(); FileUtils.createParentDir(testChild); assertTrue(tmpdir.isDirectory()); assertTrue(testParent.isDirectory()); assertFalse(testChild.exists()); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/util/PaxHeaders.17941/ClasspathMatcherTest.ja0000644000000000000000000000013112654402377030176 xustar0030 mtime=1454507263.223432768 30 atime=1454507327.206579443 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/util/ClasspathMatcherTest.java0000644000175000002070000010014612654402377031253 0ustar00jvanekmock00000000000000/* Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util; import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; import net.sourceforge.jnlp.util.ClasspathMatcher.ClasspathMatchers; import org.junit.Assert; import org.junit.Test; public class ClasspathMatcherTest { @Test public void splitOnFirstTest() { String[] r; r = ClasspathMatcher.splitOnFirst("aa:bb:cc", ":"); Assert.assertEquals("aa", r[0]); Assert.assertEquals("bb:cc", r[1]); r = ClasspathMatcher.splitOnFirst("bb:cc", "b"); Assert.assertEquals("", r[0]); Assert.assertEquals("b:cc", r[1]); r = ClasspathMatcher.splitOnFirst("bb:cc", "c"); Assert.assertEquals("bb:", r[0]); Assert.assertEquals("c", r[1]); r = ClasspathMatcher.splitOnFirst("cc:d", "d"); Assert.assertEquals("cc:", r[0]); Assert.assertEquals("", r[1]); } @Test public void haveProtocolTest() { Assert.assertTrue(ClasspathMatcher.hasProtocol("http://some.correct.url:5050/full/path")); Assert.assertTrue(ClasspathMatcher.hasProtocol("http://some.correct.url:5050")); Assert.assertTrue(ClasspathMatcher.hasProtocol("http://some.correct.url/full/path")); Assert.assertTrue(ClasspathMatcher.hasProtocol("http://some.url/full/path")); Assert.assertTrue(ClasspathMatcher.hasProtocol("http://some:5050/full/path")); Assert.assertTrue(ClasspathMatcher.hasProtocol("http://some")); Assert.assertTrue(ClasspathMatcher.hasProtocol("http://aa.cz")); Assert.assertFalse(ClasspathMatcher.hasProtocol("some.correct.url:5050/full/path")); Assert.assertFalse(ClasspathMatcher.hasProtocol("some.correct.url/full/path")); Assert.assertFalse(ClasspathMatcher.hasProtocol("some.correct.url")); //traps Assert.assertFalse(ClasspathMatcher.hasProtocol("httpsome.correct.url:5050://full/path")); Assert.assertFalse(ClasspathMatcher.hasProtocol("httpsome.corr://ect.url:5050/full/path")); Assert.assertFalse(ClasspathMatcher.hasProtocol("httpsome.corr://ect.url")); Assert.assertFalse(ClasspathMatcher.hasProtocol("httpsome/ful://l/path")); } @Test public void extractProtocolTest() { Assert.assertEquals("http", ClasspathMatcher.extractProtocol("http://some.correct.url:5050/full/path")); Assert.assertEquals("http", ClasspathMatcher.extractProtocol("http://some.correct.url:5050")); Assert.assertEquals("http", ClasspathMatcher.extractProtocol("http://some.correct.url/full/path")); Assert.assertEquals("http", ClasspathMatcher.extractProtocol("http://some.url/full/path")); Assert.assertEquals("http", ClasspathMatcher.extractProtocol("http://some:5050/full/path")); Assert.assertEquals("http", ClasspathMatcher.extractProtocol("http://some")); //no :// at all Exception ex = null; try { ClasspathMatcher.extractProtocol("some.correct.url:5050/full/path"); } catch (Exception e) { ex = e; } Assert.assertNotNull(ex); ex = null; try { ClasspathMatcher.extractProtocol("some.correct.url/full/path"); } catch (Exception e) { ex = e; } Assert.assertNotNull(ex); ex = null; try { ClasspathMatcher.extractProtocol("some.correct.url"); } catch (Exception e) { ex = e; } Assert.assertNotNull(ex); //wrongly palced :// - is catched by hasProtocol Assert.assertFalse("http".equals(ClasspathMatcher.extractProtocol("httpsome.correct.url:5050://full/path"))); Assert.assertFalse("http".equals(ClasspathMatcher.extractProtocol("httpsome.corr://ect.url:5050/full/path"))); Assert.assertFalse("http".equals(ClasspathMatcher.extractProtocol("httpsome.corr://ect.url"))); Assert.assertFalse("http".equals(ClasspathMatcher.extractProtocol("httpsome/ful://l/path"))); } @Test public void removeProtocolTest() { Assert.assertEquals("some.correct.url:5050/full/path", ClasspathMatcher.removeProtocol("http://some.correct.url:5050/full/path")); Assert.assertEquals("some.correct.url/full/path", ClasspathMatcher.removeProtocol("http://some.correct.url/full/path")); Assert.assertEquals("some.url/full/path", ClasspathMatcher.removeProtocol("http://some.url/full/path")); Assert.assertEquals("some:5050/full/path", ClasspathMatcher.removeProtocol("http://some:5050/full/path")); Assert.assertEquals("some", ClasspathMatcher.removeProtocol("http://some")); //no :// at all Exception ex = null; try { ClasspathMatcher.removeProtocol("some.correct.url:5050/full/path"); } catch (Exception e) { ex = e; } Assert.assertNotNull(ex); ex = null; try { ClasspathMatcher.removeProtocol("some.correct.url/full/path"); } catch (Exception e) { ex = e; } Assert.assertNotNull(ex); ex = null; try { ClasspathMatcher.removeProtocol("some.correct.url"); } catch (Exception e) { ex = e; } Assert.assertNotNull(ex); //wrongly palced :// - is catched by hasProtocol Assert.assertFalse("some.correct.url:5050://full/path".equals(ClasspathMatcher.removeProtocol("httpsome.correct.url:5050://full/path"))); Assert.assertFalse("some.corr://ect.url:5050/full/path".equals(ClasspathMatcher.removeProtocol("httpsome.corr://ect.url:5050/full/path"))); Assert.assertFalse("some.corr://ect.url".equals(ClasspathMatcher.removeProtocol("httpsome.corr://ect.url"))); Assert.assertFalse("some/ful://l/path".equals(ClasspathMatcher.removeProtocol("httpsome/ful://l/path"))); } @Test public void havePathTest() { Assert.assertTrue(ClasspathMatcher.hasPath("some.correct.url:5050/full/path")); Assert.assertFalse(ClasspathMatcher.hasPath("some.correct.url:5050")); Assert.assertTrue(ClasspathMatcher.hasPath("some.correct.url/full/path")); Assert.assertTrue(ClasspathMatcher.hasPath("some.url/full/path")); Assert.assertTrue(ClasspathMatcher.hasPath("some:5050/full/path")); Assert.assertFalse(ClasspathMatcher.hasPath("some")); //incorrect, but hard to solve Assert.assertTrue(ClasspathMatcher.hasPath("some.correct.url:5050://full/path")); Assert.assertTrue(ClasspathMatcher.hasPath("some.corr://ect.url:5050/full/path")); Assert.assertTrue(ClasspathMatcher.hasPath("some.corr://ect.url")); Assert.assertTrue(ClasspathMatcher.hasPath("some/ful://l/path")); //traps Assert.assertTrue(ClasspathMatcher.hasPath("some.url/full/path/")); Assert.assertTrue(ClasspathMatcher.hasPath("some:5050/full/path/")); Assert.assertTrue(ClasspathMatcher.hasPath("some.url/")); Assert.assertTrue(ClasspathMatcher.hasPath("some:5050/")); Assert.assertFalse(ClasspathMatcher.hasPath("some.url")); Assert.assertFalse(ClasspathMatcher.hasPath("some:5050")); } @Test public void extractPathTest() { Assert.assertEquals("full/path", ClasspathMatcher.extractPath("some.correct.url:5050/full/path")); Exception ex = null; try { ClasspathMatcher.extractPath("some.correct.url:5050"); } catch (Exception e) { ex = e; } Assert.assertNotNull(ex); ex = null; Assert.assertEquals("full/path", ClasspathMatcher.extractPath("some.correct.url/full/path")); Assert.assertEquals("full/path", ClasspathMatcher.extractPath("some.url/full/path")); Assert.assertEquals("full/path", ClasspathMatcher.extractPath("some:5050/full/path")); try { ClasspathMatcher.extractPath("some"); } catch (Exception e) { ex = e; } Assert.assertNotNull(ex); ex = null; //correct! Assert.assertEquals("//", ClasspathMatcher.extractPath("some.correct.url:5050///")); //incorrect, but hard to solve Assert.assertEquals("/full/path", ClasspathMatcher.extractPath("some.correct.url:5050://full/path")); Assert.assertEquals("/ect.url:5050/full/path", ClasspathMatcher.extractPath("some.corr://ect.url:5050/full/path")); Assert.assertEquals("/ect.url", ClasspathMatcher.extractPath("some.corr://ect.url")); Assert.assertEquals("ful://l/path", ClasspathMatcher.extractPath("some/ful://l/path")); //traps Assert.assertEquals("full/path/", ClasspathMatcher.extractPath("some.url/full/path/")); Assert.assertEquals("full/path/", ClasspathMatcher.extractPath("some:5050/full/path/")); Assert.assertEquals("", ClasspathMatcher.extractPath("some.url/")); Assert.assertEquals("", ClasspathMatcher.extractPath("some:5050/")); try { ClasspathMatcher.extractPath("some.url"); } catch (Exception e) { ex = e; } Assert.assertNotNull(ex); ex = null; try { ClasspathMatcher.extractPath("some:5050"); } catch (Exception e) { ex = e; } Assert.assertNotNull(ex); } @Test public void splitToPartsTest1() { ClasspathMatcher.Parts p = ClasspathMatcher.splitToParts("*"); Assert.assertEquals("*", p.protocol); Assert.assertEquals("*", p.domain); Assert.assertEquals("*", p.port); Assert.assertEquals("*", p.path); p.compilePartsToPatterns(); } @Test public void splitToPartsTest2() { ClasspathMatcher.Parts p = ClasspathMatcher.splitToParts("https://*.example.com"); Assert.assertEquals("https", p.protocol); Assert.assertEquals("*.example.com", p.domain); Assert.assertEquals("*", p.port); Assert.assertEquals("*", p.path); p.compilePartsToPatterns(); } @Test public void splitToPartsTest3() { ClasspathMatcher.Parts p = ClasspathMatcher.splitToParts("www.example.com"); Assert.assertEquals("*", p.protocol); Assert.assertEquals("www.example.com", p.domain); Assert.assertEquals("*", p.port); Assert.assertEquals("*", p.path); p.compilePartsToPatterns(); } @Test public void splitToPartsTest4() { ClasspathMatcher.Parts p = ClasspathMatcher.splitToParts("www.example.com:8085"); Assert.assertEquals("*", p.protocol); Assert.assertEquals("www.example.com", p.domain); Assert.assertEquals("8085", p.port); Assert.assertEquals("*", p.path); p.compilePartsToPatterns(); } @Test public void splitToPartsTest5() { ClasspathMatcher.Parts p = ClasspathMatcher.splitToParts("*.example.com"); Assert.assertEquals("*", p.protocol); Assert.assertEquals("*.example.com", p.domain); Assert.assertEquals("*", p.port); Assert.assertEquals("*", p.path); p.compilePartsToPatterns(); } @Test public void splitToPartsTest6() { ClasspathMatcher.Parts p = ClasspathMatcher.splitToParts("127.0.0.1"); Assert.assertEquals("*", p.protocol); Assert.assertEquals("127.0.0.1", p.domain); Assert.assertEquals("*", p.port); Assert.assertEquals("*", p.path); p.compilePartsToPatterns(); } @Test public void splitToPartsTest7() { ClasspathMatcher.Parts p = ClasspathMatcher.splitToParts("127.0.0.1:8080"); Assert.assertEquals("*", p.protocol); Assert.assertEquals("127.0.0.1", p.domain); Assert.assertEquals("8080", p.port); Assert.assertEquals("*", p.path); p.compilePartsToPatterns(); } @Test public void splitToPartsTestCorners() { ClasspathMatcher.Parts p1 = ClasspathMatcher.splitToParts("aa://bb.cz:1234/path/x.jnlp"); Assert.assertEquals("aa", p1.protocol); Assert.assertEquals("bb.cz", p1.domain); Assert.assertEquals("1234", p1.port); Assert.assertEquals("path/x.jnlp", p1.path); p1.compilePartsToPatterns(); ClasspathMatcher.Parts p2 = ClasspathMatcher.splitToParts("://*:/"); Assert.assertEquals("", p2.protocol);//yah, protocol, if :// is presented, should be defined Assert.assertEquals("*", p2.domain); Assert.assertEquals("*", p2.port); Assert.assertEquals("*", p2.path); p2.compilePartsToPatterns(); ClasspathMatcher.Parts p3 = ClasspathMatcher.splitToParts("*://*:/:aa//"); Assert.assertEquals("*", p3.protocol); Assert.assertEquals("*", p3.domain); Assert.assertEquals("*", p3.port); Assert.assertEquals(":aa//", p3.path); p3.compilePartsToPatterns(); } @Test public void sourceToRegExStringTest() { Assert.assertEquals(".*", ClasspathMatcher.sourceToRegExString("*")); Assert.assertEquals("^.*\\Q\\E.*$", ClasspathMatcher.sourceToRegExString("**")); Assert.assertEquals("^\\Qabcd\\E$", ClasspathMatcher.sourceToRegExString("abcd")); Assert.assertEquals("^.*\\Qabcd\\E$", ClasspathMatcher.sourceToRegExString("*abcd")); Assert.assertEquals("^\\Qabcd\\E.*$", ClasspathMatcher.sourceToRegExString("abcd*")); } //http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/manifest.html#codebase //examples private static final URL[] urls = { silentUrl("https://a.example.com"), /*0*/ silentUrl("https://a.b.example.com"), silentUrl("http://a.example.com"), silentUrl("http://a.b.example.com"),/*3*/ silentUrl("https://www.example.com"), silentUrl("http://www.example.com "), silentUrl("http://example.com"),/*6*/ silentUrl("http://example.net"), silentUrl("https://www.example.com:8085"), silentUrl("http://www.example.com:8085"),/*9*/ silentUrl("http://www.example.com"), silentUrl("https://a.example.com"), silentUrl("http://a.example.com"),/*12*/ silentUrl("https://a.b.example.com"), silentUrl("http://a.b.example.com"), silentUrl("https://example.com"),/*15*/ silentUrl("http://example.com"), silentUrl("http://example.net"), silentUrl("http://127.0.0.1"),/*18*/ silentUrl("http://127.0.0.1:8080"), silentUrl("http://127.0.0.1:80"), silentUrl("http://localhost"),/*21*/ silentUrl("http://127.0.0.1:8080"), silentUrl("http://127.0.0.1"), silentUrl("http://127.0.0.1:80 ")/*24*/}; private static URL silentUrl(String s) { try { return new URL(s); } catch (MalformedURLException e) { throw new RuntimeException(e); } } @Test public void matchTest1() throws MalformedURLException { ClasspathMatcher p = ClasspathMatcher.compile("*"); Assert.assertTrue(p.match(new URL("http://any.strange/url/path"))); for (URL url : urls) { Assert.assertTrue(p.match(url)); } } @Test public void matchTest2() throws MalformedURLException { ClasspathMatcher p = ClasspathMatcher.compile("https://*.example.com"); Assert.assertTrue(p.match(urls[0])); Assert.assertTrue(p.match(urls[1])); Assert.assertFalse(p.match(urls[2])); Assert.assertFalse(p.match(urls[3])); } @Test public void matchTest3() throws MalformedURLException { ClasspathMatcher p = ClasspathMatcher.compile("www.example.com"); Assert.assertTrue(p.match(urls[4])); Assert.assertTrue(p.match(urls[5])); Assert.assertFalse(p.match(urls[6])); Assert.assertFalse(p.match(urls[7])); } @Test public void matchTest4() throws MalformedURLException { ClasspathMatcher p = ClasspathMatcher.compile("www.example.com:8085"); Assert.assertTrue(p.match(urls[8])); Assert.assertTrue(p.match(urls[9])); Assert.assertFalse(p.match(urls[10])); } @Test public void matchTest5() throws MalformedURLException { ClasspathMatcher p = ClasspathMatcher.compile("*.example.com"); Assert.assertTrue(p.match(urls[11])); Assert.assertTrue(p.match(urls[12])); Assert.assertTrue(p.match(urls[13])); Assert.assertTrue(p.match(urls[14])); //those represent the "dot" issue Assert.assertTrue(p.match(urls[15])); Assert.assertTrue(p.match(urls[16])); Assert.assertFalse(p.match(urls[17])); //reasons for alowing "dot" issue Assert.assertTrue(p.match(new URL("http://www.example.com"))); Assert.assertTrue(p.match(new URL("http://example.com"))); //reason for restricting dost issue Assert.assertFalse(p.match(new URL("http://aaaexample.com"))); } @Test public void wildCardSubdomainDoesNotMatchParentDomainPaths() throws MalformedURLException { ClasspathMatchers p1 = ClasspathMatchers.compile("*.example.com*/*.abc.cde*", true); Assert.assertFalse(p1.matches(new URL("http://aaaexample.com/xyz.abc.cde"))); Assert.assertTrue(p1.matches(new URL("http://www.example.com/.abc.cde"))); Assert.assertTrue(p1.matches(new URL("http://www.example.com/xyz.abc.cde"))); Assert.assertFalse(p1.matches(new URL("http://www.example.com/abc.cde"))); Assert.assertTrue(p1.matches(new URL("http://example.com/xyz.abc.cdeefg"))); Assert.assertTrue(p1.matches(new URL("http://example.com/xyz.abc.cde.efg"))); Assert.assertFalse(p1.matches(new URL("http://example.com/abc.cde.efg"))); Assert.assertFalse(p1.matches(new URL("http://example.com"))); ClasspathMatchers p = ClasspathMatchers.compile("*.example.com*/*.abc.cde*", false); Assert.assertFalse(p.matches(new URL("http://aaaexample.com/xyz.abc.cde"))); Assert.assertTrue(p.matches(new URL("http://www.example.com/.abc.cde"))); Assert.assertTrue(p.matches(new URL("http://www.example.com/xyz.abc.cde"))); Assert.assertTrue(p.matches(new URL("http://www.example.com/abc.cde"))); Assert.assertTrue(p.matches(new URL("http://example.com/xyz.abc.cdeefg"))); Assert.assertTrue(p.matches(new URL("http://example.com/xyz.abc.cde.efg"))); Assert.assertTrue(p.matches(new URL("http://example.com/abc.cde.efg"))); Assert.assertTrue(p.matches(new URL("http://example.com"))); } @Test public void matchTest6() throws MalformedURLException { ClasspathMatcher p = ClasspathMatcher.compile("127.0.0.1"); Assert.assertTrue(p.match(urls[18])); Assert.assertTrue(p.match(urls[19])); Assert.assertTrue(p.match(urls[20])); Assert.assertFalse(p.match(urls[21])); } @Test public void matchTest7() throws MalformedURLException { ClasspathMatcher p = ClasspathMatcher.compile("127.0.0.1:8080"); Assert.assertTrue(p.match(urls[22])); Assert.assertFalse(p.match(urls[23])); Assert.assertFalse(p.match(urls[24])); } //nasty url tests @Test public void googleQueryTest() throws MalformedURLException { String googleQuery = "https://www.google.cz/search?q=icdtea+web&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a#q=icedtea+web&rls=org.mozilla:en-US:official&safe=off"; ClasspathMatcher.Parts p = ClasspathMatcher.splitToParts(googleQuery); Assert.assertEquals("https", p.protocol); Assert.assertEquals("www.google.cz", p.domain); Assert.assertEquals("*", p.port); Assert.assertEquals("search?q=icdtea+web&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a#q=icedtea+web&rls=org.mozilla:en-US:official&safe=off", p.path); ClasspathMatcher cm = ClasspathMatcher.compile(googleQuery); Assert.assertTrue(cm.match(new URL("https://www.google.cz:5050"))); Assert.assertFalse(cm.match(new URL("https://google.cz:5050"))); Assert.assertFalse(cm.match(new URL("http://www.google.cz:5050"))); Assert.assertTrue(cm.match(new URL("https://www.google.cz"))); } @Test public void gitHubQueryTest() throws MalformedURLException { String gitHubQuery = "https://github.com/user-user/what-1.2.3-an-hell/commit/b8ee66ad265002c51f86152e06fbe2e6124b62a3#diff-36dcc9a4b486abb6bffe062260d6d82dR626"; ClasspathMatcher.Parts p = ClasspathMatcher.splitToParts(gitHubQuery); Assert.assertEquals("https", p.protocol); Assert.assertEquals("github.com", p.domain); Assert.assertEquals("*", p.port); Assert.assertEquals("user-user/what-1.2.3-an-hell/commit/b8ee66ad265002c51f86152e06fbe2e6124b62a3#diff-36dcc9a4b486abb6bffe062260d6d82dR626", p.path); ClasspathMatcher cm = ClasspathMatcher.compile(gitHubQuery); Assert.assertTrue(cm.match(new URL("https://github.com:0123"))); Assert.assertFalse(cm.match(new URL("https://www.github.com"))); Assert.assertFalse(cm.match(new URL("http://github.com"))); Assert.assertTrue(cm.match(new URL("https://github.com"))); } @Test public void doubleSlashesTests() throws MalformedURLException { String s1 = "http://some.url//weird/path"; ClasspathMatcher.Parts p1 = ClasspathMatcher.splitToParts(s1); Assert.assertEquals("http", p1.protocol); Assert.assertEquals("some.url", p1.domain); Assert.assertEquals("*", p1.port); Assert.assertEquals("/weird/path", p1.path); ClasspathMatcher cm1 = ClasspathMatcher.compile(s1); Assert.assertTrue(cm1.match(new URL("http://some.url//weird/path"))); Assert.assertTrue(cm1.matchWithPath(new URL("http://some.url//weird/path"))); //path is not ocunted Assert.assertTrue(cm1.match(new URL("http://some.url/weird/path"))); Assert.assertFalse(cm1.matchWithPath(new URL("http://some.url/weird/path"))); String s2 = "https://some.url/weird//path/"; ClasspathMatcher.Parts p2 = ClasspathMatcher.splitToParts(s2); Assert.assertEquals("https", p2.protocol); Assert.assertEquals("some.url", p2.domain); Assert.assertEquals("*", p2.port); Assert.assertEquals("weird//path/", p2.path); } //total trap url @Test public void madUrls() throws MalformedURLException { String trapUrl1 = "*://:&:://%%20"; ClasspathMatcher.Parts p1 = ClasspathMatcher.splitToParts(trapUrl1); Assert.assertEquals("*", p1.protocol); Assert.assertEquals("", p1.domain); Assert.assertEquals("&::", p1.port); Assert.assertEquals("/%%20", p1.path); ClasspathMatcher cm1 = ClasspathMatcher.compile(trapUrl1); //no valid url can match this Assert.assertFalse(cm1.match(new URL("ftp://:0//whatever"))); Assert.assertFalse(cm1.matchWithPath(new URL("ftp://:0//%%20"))); String trapUrl2 = "*://:0//%%20"; ClasspathMatcher.Parts p2 = ClasspathMatcher.splitToParts(trapUrl2); Assert.assertEquals("*", p2.protocol); Assert.assertEquals("", p2.domain); Assert.assertEquals("0", p2.port); Assert.assertEquals("/%%20", p2.path); ClasspathMatcher cm2 = ClasspathMatcher.compile(trapUrl2); Assert.assertTrue(cm2.match(new URL("ftp://:0//whatever"))); Assert.assertFalse(cm2.matchWithPath(new URL("ftp://:0//whatever"))); Assert.assertTrue(cm2.matchWithPath(new URL("ftp://:0//%%20"))); String trapUrl3 = ":0//%%20"; ClasspathMatcher.Parts p3 = ClasspathMatcher.splitToParts(trapUrl3); Assert.assertEquals("*", p3.protocol); Assert.assertEquals("", p3.domain); Assert.assertEquals("0", p3.port); Assert.assertEquals("/%%20", p3.path); ClasspathMatcher cm3 = ClasspathMatcher.compile(trapUrl3); Assert.assertTrue(cm3.match(new URL("ftp://:0//whatever"))); Assert.assertFalse(cm3.matchWithPath(new URL("ftp://:0//whatever"))); Assert.assertTrue(cm3.match(new URL("ftp://:0//%%20"))); } @Test public void matchersTest() throws MalformedURLException { ClasspathMatchers cps1 = ClasspathMatcher.ClasspathMatchers.compile(" aa bb cc "); ArrayList q = cps1.getMatchers(); Assert.assertEquals(3, q.size()); Assert.assertEquals("aa", q.get(0).getParts().domain); Assert.assertEquals("bb", q.get(1).getParts().domain); Assert.assertEquals("cc", q.get(2).getParts().domain); ClasspathMatchers cps2 = ClasspathMatcher.ClasspathMatchers.compile("http://aa.cz ftp://*bb.cz/"); Assert.assertTrue(cps2.matches(new URL("ftp://123.bb.cz/aa"))); Assert.assertFalse(cps2.matches(new URL("http://bb.cz"))); Assert.assertTrue(cps2.matches(new URL("http://aa.cz"))); Assert.assertFalse(cps2.matches(new URL("http://bb.cz"))); } @Test public void testStar() throws MalformedURLException { ClasspathMatchers cps1 = ClasspathMatcher.ClasspathMatchers.compile("*"); Assert.assertTrue(cps1.matches(new URL("http://whatever.anywher/something/at.some"))); Assert.assertTrue(cps1.matches(new URL("http://whatever.anywher/something/at"))); Assert.assertTrue(cps1.matches(new URL("http://whatever.anywher/"))); Assert.assertTrue(cps1.matches(new URL("http://whatever.anywher"))); } @Test public void matchersTestWithPathsNix() throws MalformedURLException { ClasspathMatchers cps1 = ClasspathMatcher.ClasspathMatchers.compile(" aa bb cc ", true); ArrayList q = cps1.getMatchers(); Assert.assertEquals(3, q.size()); Assert.assertEquals("aa", q.get(0).getParts().domain); Assert.assertEquals("bb", q.get(1).getParts().domain); Assert.assertEquals("cc", q.get(2).getParts().domain); ClasspathMatchers cps2 = ClasspathMatcher.ClasspathMatchers.compile("http://aa.cz/xyz ftp://*bb.cz/bcq/dfg/aa*", true); Assert.assertFalse(cps2.matches(new URL("ftp://123.bb.cz/aa"))); Assert.assertFalse(cps2.matches(new URL("http://bb.cz"))); Assert.assertFalse(cps2.matches(new URL("http://aa.cz"))); Assert.assertFalse(cps2.matches(new URL("http://bb.cz"))); //star Assert.assertFalse(cps2.matches(new URL("ftp://123.bb.cz/bcq/aa-test.html"))); Assert.assertFalse(cps2.matches(new URL("ftp://123.bb.cz/bcq/dfg-aa-test.html"))); Assert.assertTrue(cps2.matches(new URL("ftp://123.bb.cz/bcq/dfg/aa-test.html"))); Assert.assertTrue(cps2.matches(new URL("ftp://123.bb.cz/bcq/dfg/aa"))); Assert.assertTrue(cps2.matches(new URL("ftp://123.bb.cz/bcq/dfg/aa/"))); Assert.assertTrue(cps2.matches(new URL("ftp://123.bb.cz/bcq/dfg/aa-files/aaa.jar"))); Assert.assertFalse(cps2.matches(new URL("ftp://123.bb.cz/bcq\\dfg\\aa-files\\aaa.jar"))); //double quotes may harm Assert.assertFalse(cps2.matches(new URL("ftp://123.bb.cz//bcq/dfg/aa-files/aaa.jar"))); Assert.assertFalse(cps2.matches(new URL("ftp://123.bb.cz//bcq/dfg/aa-files//aaa.jar"))); //no star Assert.assertFalse(cps2.matches(new URL("http://bb.cz"))); Assert.assertFalse(cps2.matches(new URL("http://aa.cz"))); Assert.assertTrue(cps2.matches(new URL("http://aa.cz/xyz"))); //double quotes may harm again Assert.assertTrue(cps2.matches(new URL("http://aa.cz/xyz/"))); Assert.assertFalse(cps2.matches(new URL("http://aa.cz//xyz"))); } @Test public void matchersTestWithPathsWin() throws MalformedURLException { ClasspathMatchers cps1 = ClasspathMatcher.ClasspathMatchers.compile(" aa bb cc ", true); ArrayList q = cps1.getMatchers(); Assert.assertEquals(3, q.size()); Assert.assertEquals("aa", q.get(0).getParts().domain); Assert.assertEquals("bb", q.get(1).getParts().domain); Assert.assertEquals("cc", q.get(2).getParts().domain); ClasspathMatchers cps2 = ClasspathMatcher.ClasspathMatchers.compile("http://aa.cz/xyz ftp://*bb.cz/bcq\\dfg\\aa*", true); Assert.assertFalse(cps2.matches(new URL("ftp://123.bb.cz/aa"))); Assert.assertFalse(cps2.matches(new URL("http://bb.cz"))); Assert.assertFalse(cps2.matches(new URL("http://aa.cz"))); Assert.assertFalse(cps2.matches(new URL("http://bb.cz"))); //star Assert.assertFalse(cps2.matches(new URL("ftp://123.bb.cz/bcq\\aa-test.html"))); Assert.assertFalse(cps2.matches(new URL("ftp://123.bb.cz/bcq\\dfg-aa-test.html"))); Assert.assertTrue(cps2.matches(new URL("ftp://123.bb.cz/bcq\\dfg\\aa-test.html"))); Assert.assertTrue(cps2.matches(new URL("ftp://123.bb.cz/bcq\\dfg\\aa"))); Assert.assertTrue(cps2.matches(new URL("ftp://123.bb.cz/bcq\\dfg\\aa\\"))); Assert.assertTrue(cps2.matches(new URL("ftp://123.bb.cz/bcq\\dfg\\aa-files\\aaa.jar"))); Assert.assertFalse(cps2.matches(new URL("ftp://123.bb.cz/bcq/dfg/aa-files/aaa.jar"))); //double quotes may harm Assert.assertFalse(cps2.matches(new URL("ftp://123.bb.cz//bcq\\dfg\\aa-files\\aaa.jar"))); Assert.assertFalse(cps2.matches(new URL("ftp://123.bb.cz//bcq\\dfg\\aa-files\\aaa.jar"))); //no star Assert.assertFalse(cps2.matches(new URL("http://bb.cz"))); Assert.assertFalse(cps2.matches(new URL("http://aa.cz"))); Assert.assertTrue(cps2.matches(new URL("http://aa.cz/xyz"))); //double quotes may harm again Assert.assertTrue(cps2.matches(new URL("http://aa.cz/xyz\\"))); Assert.assertFalse(cps2.matches(new URL("http://aa.cz//xyz"))); } @Test public void trickyPathsMatchTes() throws MalformedURLException { ClasspathMatchers cps1 = ClasspathMatcher.ClasspathMatchers.compile("http://aaa.com/some/path", true); ClasspathMatchers cps11 = ClasspathMatcher.ClasspathMatchers.compile("http://aaa.com/some/path", false); ClasspathMatchers cps2 = ClasspathMatcher.ClasspathMatchers.compile("http://aaa.com/some/path/", true); ClasspathMatchers cps22 = ClasspathMatcher.ClasspathMatchers.compile("http://aaa.com/some/path/", false); Assert.assertTrue(cps1.matches(new URL("http://aaa.com/some/path"))); Assert.assertTrue(cps1.matches(new URL("http://aaa.com/some/path/"))); Assert.assertFalse(cps2.matches(new URL("http://aaa.com/some/path"))); Assert.assertTrue(cps2.matches(new URL("http://aaa.com/some/path/"))); Assert.assertTrue(cps11.matches(new URL("http://aaa.com/some/path"))); Assert.assertTrue(cps11.matches(new URL("http://aaa.com/some/path/"))); Assert.assertTrue(cps22.matches(new URL("http://aaa.com/some/path"))); Assert.assertTrue(cps22.matches(new URL("http://aaa.com/some/path/"))); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.17941/tools0000644000000000000000000000013112654402377023702 xustar0030 mtime=1454507263.222432781 30 atime=1454507658.776157397 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/tools/0000755000175000002070000000000012654402377024503 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/tools/PaxHeaders.17941/JarCertVerifierTest.ja0000644000000000000000000000013112654402377030161 xustar0030 mtime=1454507263.222432781 30 atime=1454507327.206579443 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/tools/JarCertVerifierTest.java0000644000175000002070000007134312654402377031244 0ustar00jvanekmock00000000000000/* JarCertVerifierTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.tools; import static net.sourceforge.jnlp.runtime.Translator.R; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import java.security.CodeSigner; import java.util.Date; import java.util.List; import java.util.Vector; import java.util.jar.JarEntry; import net.sourceforge.jnlp.JARDesc; import net.sourceforge.jnlp.tools.JarCertVerifier.VerifyResult; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; public class JarCertVerifierTest { @Test public void testIsMetaInfFile() { final String METAINF = "META-INF"; assertFalse(JarCertVerifier.isMetaInfFile("some_dir/" + METAINF + "/filename")); assertFalse(JarCertVerifier.isMetaInfFile(METAINF + "filename")); assertTrue(JarCertVerifier.isMetaInfFile(METAINF + "/filename")); } class JarCertVerifierEntry extends JarEntry { CodeSigner[] signers; public JarCertVerifierEntry(String name, CodeSigner[] codesigners) { super(name); signers = codesigners; } public JarCertVerifierEntry(String name) { this(name, null); } public CodeSigner[] getCodeSigners() { return signers == null ? null : signers.clone(); } } // Empty list to be used with JarCertVerifier constructor. private static final List emptyJARDescList = new Vector(); private static final String DNPARTIAL = ", OU=JarCertVerifier Unit Test, O=IcedTea, L=Toronto, ST=Ontario, C=CA"; private static CodeSigner alphaSigner, betaSigner, charlieSigner, expiredSigner, expiringSigner, notYetValidSigner, expiringAndNotYetValidSigner; @BeforeClass public static void setUp() throws Exception { Date currentDate = new Date(); Date pastDate = new Date(currentDate.getTime() - (1000L * 24L * 60L * 60L) - 1000L); // 1 day and 1 second in the past Date futureDate = new Date(currentDate.getTime() + (1000L * 24L * 60L * 60L)); // 1 day in the future alphaSigner = CodeSignerCreator.getOneCodeSigner("CN=Alpha Signer" + DNPARTIAL, currentDate, 365); betaSigner = CodeSignerCreator.getOneCodeSigner("CN=Beta Signer" + DNPARTIAL, currentDate, 365); charlieSigner = CodeSignerCreator.getOneCodeSigner("CN=Charlie Signer" + DNPARTIAL, currentDate, 365); expiredSigner = CodeSignerCreator.getOneCodeSigner("CN=Expired Signer" + DNPARTIAL, pastDate, 1); expiringSigner = CodeSignerCreator.getOneCodeSigner("CN=Expiring Signer" + DNPARTIAL, currentDate, 1); notYetValidSigner = CodeSignerCreator.getOneCodeSigner("CN=Not Yet Valid Signer" + DNPARTIAL, futureDate, 365); expiringAndNotYetValidSigner = CodeSignerCreator.getOneCodeSigner("CN=Expiring and Not Yet Valid Signer" + DNPARTIAL, futureDate, 3); } @Test public void testNoManifest() throws Exception { JarCertVerifier jcv = new JarCertVerifier(null); VerifyResult result = jcv.verifyJarEntryCerts("", false, null); Assert.assertEquals("No manifest should be considered unsigned.", VerifyResult.UNSIGNED, result); Assert.assertEquals("No manifest means no signers in the verifier.", 0, jcv.getCertsList().size()); } @Test public void testNoSignableEntries() throws Exception { JarCertVerifier jcv = new JarCertVerifier(null); Vector entries = new Vector(); entries.add(new JarCertVerifierEntry("OneDirEntry/")); entries.add(new JarCertVerifierEntry("META-INF/MANIFEST.MF")); VerifyResult result = jcv.verifyJarEntryCerts("", true, entries); Assert.assertEquals("No signable entry (only dirs/manifests) should be considered trivially signed.", VerifyResult.SIGNED_OK, result); Assert.assertEquals("No signable entry (only dirs/manifests) means no signers in the verifier.", 0, jcv.getCertsList().size()); } @Test public void testSingleEntryNoSigners() throws Exception { JarCertVerifier jcv = new JarCertVerifier(null); Vector entries = new Vector(); entries.add(new JarCertVerifierEntry("firstEntryWithoutSigner")); VerifyResult result = jcv.verifyJarEntryCerts("", true, entries); Assert.assertEquals("One unsigned entry should be considered unsigned.", VerifyResult.UNSIGNED, result); Assert.assertEquals("One unsigned entry means no signers in the verifier.", 0, jcv.getCertsList().size()); } @Test public void testManyEntriesNoSigners() throws Exception { JarCertVerifier jcv = new JarCertVerifier(null); Vector entries = new Vector(); entries.add(new JarCertVerifierEntry("firstEntryWithoutSigner")); entries.add(new JarCertVerifierEntry("secondEntryWithoutSigner")); entries.add(new JarCertVerifierEntry("thirdEntryWithoutSigner")); VerifyResult result = jcv.verifyJarEntryCerts("", true, entries); Assert.assertEquals("Many unsigned entries should be considered unsigned.", VerifyResult.UNSIGNED, result); Assert.assertEquals("Many unsigned entries means no signers in the verifier.", 0, jcv.getCertsList().size()); } @Test public void testSingleEntrySingleValidSigner() throws Exception { JarCertVerifier jcv = new JarCertVerifier(null); CodeSigner[] signers = { alphaSigner }; Vector entries = new Vector(); entries.add(new JarCertVerifierEntry("firstSignedByOne", signers)); VerifyResult result = jcv.verifyJarEntryCerts("", true, entries); Assert.assertEquals("One signed entry should be considered signed and okay.", VerifyResult.SIGNED_OK, result); Assert.assertEquals("One signed entry means one signer in the verifier.", 1, jcv.getCertsList().size()); Assert.assertTrue("One signed entry means one signer in the verifier.", jcv.getCertsList().contains(alphaSigner.getSignerCertPath())); } @Test public void testManyEntriesSingleValidSigner() throws Exception { JarCertVerifier jcv = new JarCertVerifier(null); CodeSigner[] signers = { alphaSigner }; Vector entries = new Vector(); entries.add(new JarCertVerifierEntry("firstSignedByOne", signers)); entries.add(new JarCertVerifierEntry("secondSignedByOne", signers)); entries.add(new JarCertVerifierEntry("thirdSignedByOne", signers)); VerifyResult result = jcv.verifyJarEntryCerts("", true, entries); Assert.assertEquals("Three entries signed by one signer should be considered signed and okay.", VerifyResult.SIGNED_OK, result); Assert.assertEquals("Three entries signed by one signer means one signer in the verifier.", 1, jcv.getCertsList().size()); Assert.assertTrue("Three entries signed by one signer means one signer in the verifier.", jcv.getCertsList().contains(alphaSigner.getSignerCertPath())); } @Test public void testSingleEntryMultipleValidSigners() throws Exception { JarCertVerifier jcv = new JarCertVerifier(null); CodeSigner[] signers = { alphaSigner, betaSigner, charlieSigner }; Vector entries = new Vector(); entries.add(new JarCertVerifierEntry("firstSignedByThree", signers)); VerifyResult result = jcv.verifyJarEntryCerts("", true, entries); Assert.assertEquals("One entry signed by three signers should be considered signed and okay.", VerifyResult.SIGNED_OK, result); Assert.assertEquals("One entry signed by three means three signers in the verifier.", 3, jcv.getCertsList().size()); Assert.assertTrue("One entry signed by three means three signers in the verifier.", jcv.getCertsList().contains(alphaSigner.getSignerCertPath()) && jcv.getCertsList().contains(betaSigner.getSignerCertPath()) && jcv.getCertsList().contains(charlieSigner.getSignerCertPath())); } @Test public void testManyEntriesMultipleValidSigners() throws Exception { JarCertVerifier jcv = new JarCertVerifier(null); CodeSigner[] signers = { alphaSigner, betaSigner, charlieSigner }; Vector entries = new Vector(); entries.add(new JarCertVerifierEntry("firstSignedByThree", signers)); entries.add(new JarCertVerifierEntry("secondSignedByThree", signers)); entries.add(new JarCertVerifierEntry("thirdSignedByThree", signers)); VerifyResult result = jcv.verifyJarEntryCerts("", true, entries); Assert.assertEquals("Three entries signed by three signers should be considered signed and okay.", VerifyResult.SIGNED_OK, result); Assert.assertEquals("Three entries signed by three means three signers in the verifier.", 3, jcv.getCertsList().size()); Assert.assertTrue("Three entries signed by three means three signers in the verifier.", jcv.getCertsList().contains(alphaSigner.getSignerCertPath()) && jcv.getCertsList().contains(betaSigner.getSignerCertPath()) && jcv.getCertsList().contains(charlieSigner.getSignerCertPath())); } @Test public void testOneCommonSigner() throws Exception { JarCertVerifier jcv = new JarCertVerifier(null); CodeSigner[] alphaSigners = { alphaSigner }; CodeSigner[] betaSigners = { alphaSigner, betaSigner }; CodeSigner[] charlieSigners = { alphaSigner, charlieSigner }; Vector entries = new Vector(); entries.add(new JarCertVerifierEntry("firstSignedByOne", alphaSigners)); entries.add(new JarCertVerifierEntry("secondSignedByTwo", betaSigners)); entries.add(new JarCertVerifierEntry("thirdSignedByTwo", charlieSigners)); VerifyResult result = jcv.verifyJarEntryCerts("", true, entries); Assert.assertEquals("Three entries signed by at least one common signer should be considered signed and okay.", VerifyResult.SIGNED_OK, result); Assert.assertEquals("Three entries signed completely by only one signer means one signer in the verifier.", 1, jcv.getCertsList().size()); Assert.assertTrue("Three entries signed completely by only one signer means one signer in the verifier.", jcv.getCertsList().contains(alphaSigner.getSignerCertPath())); } @Test public void testNoCommonSigner() throws Exception { JarCertVerifier jcv = new JarCertVerifier(null); CodeSigner[] alphaSigners = { alphaSigner }; CodeSigner[] betaSigners = { betaSigner }; CodeSigner[] charlieSigners = { charlieSigner }; Vector entries = new Vector(); entries.add(new JarCertVerifierEntry("firstSignedByAlpha", alphaSigners)); entries.add(new JarCertVerifierEntry("secondSignedByBeta", betaSigners)); entries.add(new JarCertVerifierEntry("thirdSignedByCharlie", charlieSigners)); VerifyResult result = jcv.verifyJarEntryCerts("", true, entries); Assert.assertEquals("Three entries signed by no common signers should be considered unsigned.", VerifyResult.UNSIGNED, result); Assert.assertEquals("Three entries signed by no common signers means no signers in the verifier.", 0, jcv.getCertsList().size()); } @Test public void testFewButNotAllCommonSigners() throws Exception { JarCertVerifier jcv = new JarCertVerifier(null); CodeSigner[] alphaSigners = { alphaSigner }; CodeSigner[] betaSigners = { betaSigner }; Vector entries = new Vector(); entries.add(new JarCertVerifierEntry("firstSignedByAlpha", alphaSigners)); entries.add(new JarCertVerifierEntry("secondSignedByAlpha", alphaSigners)); entries.add(new JarCertVerifierEntry("thirdSignedByBeta", betaSigners)); VerifyResult result = jcv.verifyJarEntryCerts("", true, entries); Assert.assertEquals("First two entries signed by alpha signer, third entry signed by beta signer should be considered unisgned.", VerifyResult.UNSIGNED, result); Assert.assertEquals("Three entries signed by some common signers but not all means no signers in the verifier.", 0, jcv.getCertsList().size()); } @Test public void testNotAllEntriesSigned() throws Exception { JarCertVerifier jcv = new JarCertVerifier(null); CodeSigner[] alphaSigners = { alphaSigner }; Vector entries = new Vector(); entries.add(new JarCertVerifierEntry("firstSignedByAlpha", alphaSigners)); entries.add(new JarCertVerifierEntry("secondSignedByAlpha", alphaSigners)); entries.add(new JarCertVerifierEntry("thirdUnsigned")); VerifyResult result = jcv.verifyJarEntryCerts("", true, entries); Assert.assertEquals("First two entries signed by alpha signer, third entry not signed, should be considered unisgned.", VerifyResult.UNSIGNED, result); Assert.assertEquals("First two entries signed by alpha signer, third entry not signed, means no signers in the verifier.", 0, jcv.getCertsList().size()); } @Test public void testSingleEntryExpiredSigner() throws Exception { JarCertVerifier jcv = new JarCertVerifier(null); CodeSigner[] expiredSigners = { expiredSigner }; Vector entries = new Vector(); entries.add(new JarCertVerifierEntry("firstSignedByExpired", expiredSigners)); VerifyResult result = jcv.verifyJarEntryCerts("", true, entries); Assert.assertEquals("One entry signed by expired cert, should be considered signed but not okay.", VerifyResult.SIGNED_NOT_OK, result); Assert.assertEquals("One entry signed by expired cert means one signer in the verifier.", 1, jcv.getCertsList().size()); Assert.assertTrue("One entry signed by expired cert means one signer in the verifier.", jcv.getCertsList().contains(expiredSigner.getSignerCertPath())); } @Test public void testManyEntriesExpiredSigner() throws Exception { JarCertVerifier jcv = new JarCertVerifier(null); CodeSigner[] expiredSigners = { expiredSigner }; Vector entries = new Vector(); entries.add(new JarCertVerifierEntry("firstSignedByExpired", expiredSigners)); entries.add(new JarCertVerifierEntry("secondSignedBExpired", expiredSigners)); entries.add(new JarCertVerifierEntry("thirdSignedByExpired", expiredSigners)); VerifyResult result = jcv.verifyJarEntryCerts("", true, entries); Assert.assertEquals("Three entries signed by expired cert, should be considered signed but not okay.", VerifyResult.SIGNED_NOT_OK, result); Assert.assertEquals("Three entries signed by expired cert means one signer in the verifier.", 1, jcv.getCertsList().size()); Assert.assertTrue("Three entries signed by expired cert means one signer in the verifier.", jcv.getCertsList().contains(expiredSigner.getSignerCertPath())); } @Test public void testSingleEntryExpiringSigner() throws Exception { JarCertVerifier jcv = new JarCertVerifier(null); CodeSigner[] expiringSigners = { expiringSigner }; Vector entries = new Vector(); entries.add(new JarCertVerifierEntry("firstSignedByExpiring", expiringSigners)); VerifyResult result = jcv.verifyJarEntryCerts("", true, entries); Assert.assertEquals("One entry signed by expiring cert, should be considered signed and okay.", VerifyResult.SIGNED_OK, result); Assert.assertEquals("One entry signed by expiring cert means one signer in the verifier.", 1, jcv.getCertsList().size()); Assert.assertTrue("One entry signed by expiring cert means one signer in the verifier.", jcv.getCertsList().contains(expiringSigner.getSignerCertPath())); } @Test public void testManyEntriesExpiringSigner() throws Exception { JarCertVerifier jcv = new JarCertVerifier(null); CodeSigner[] expiringSigners = { expiringSigner }; Vector entries = new Vector(); entries.add(new JarCertVerifierEntry("firstSignedByExpiring", expiringSigners)); entries.add(new JarCertVerifierEntry("secondSignedBExpiring", expiringSigners)); entries.add(new JarCertVerifierEntry("thirdSignedByExpiring", expiringSigners)); VerifyResult result = jcv.verifyJarEntryCerts("", true, entries); Assert.assertEquals("Three entries signed by expiring cert, should be considered signed and okay.", VerifyResult.SIGNED_OK, result); Assert.assertEquals("Three entries signed by expiring cert means one signer in the verifier.", 1, jcv.getCertsList().size()); Assert.assertTrue("Three entries signed by expiring cert means one signer in the verifier.", jcv.getCertsList().contains(expiringSigner.getSignerCertPath())); } @Test public void testSingleEntryNotYetValidSigner() throws Exception { JarCertVerifier jcv = new JarCertVerifier(null); CodeSigner[] notYetValidSigners = { notYetValidSigner }; Vector entries = new Vector(); entries.add(new JarCertVerifierEntry("firstSignedByNotYetValid", notYetValidSigners)); VerifyResult result = jcv.verifyJarEntryCerts("", true, entries); Assert.assertEquals("One entry signed by cert that is not yet valid, should be considered signed but not okay.", VerifyResult.SIGNED_NOT_OK, result); Assert.assertEquals("One entry signed by cert that is not yet valid means one signer in the verifier.", 1, jcv.getCertsList().size()); Assert.assertTrue("One entry signed by cert that is not yet valid means one signer in the verifier.", jcv.getCertsList().contains(notYetValidSigner.getSignerCertPath())); } @Test public void testManyEntriesNotYetValidSigner() throws Exception { JarCertVerifier jcv = new JarCertVerifier(null); CodeSigner[] notYetValidSigners = { notYetValidSigner }; Vector entries = new Vector(); entries.add(new JarCertVerifierEntry("firstSignedByNotYetValid", notYetValidSigners)); entries.add(new JarCertVerifierEntry("secondSignedByNotYetValid", notYetValidSigners)); entries.add(new JarCertVerifierEntry("thirdSignedByNotYetValid", notYetValidSigners)); VerifyResult result = jcv.verifyJarEntryCerts("", true, entries); Assert.assertEquals("Three entries signed by cert that is not yet valid, should be considered signed but not okay.", VerifyResult.SIGNED_NOT_OK, result); Assert.assertEquals("Three entries signed by cert that is not yet valid means one signer in the verifier.", 1, jcv.getCertsList().size()); Assert.assertTrue("Three entries signed by cert that is not yet valid means one signer in the verifier.", jcv.getCertsList().contains(notYetValidSigner.getSignerCertPath())); } @Test public void testSingleEntryExpiringAndNotYetValidSigner() throws Exception { JarCertVerifier jcv = new JarCertVerifier(null); CodeSigner[] expiringAndNotYetValidSigners = { expiringAndNotYetValidSigner }; Vector entries = new Vector(); entries.add(new JarCertVerifierEntry("firstSignedByExpiringNotYetValid", expiringAndNotYetValidSigners)); VerifyResult result = jcv.verifyJarEntryCerts("", true, entries); Assert.assertEquals("One entry signed by cert that is not yet valid but also expiring, should be considered signed but not okay.", VerifyResult.SIGNED_NOT_OK, result); Assert.assertEquals("One entry signed by cert that is not yet valid but also expiring means one signer in the verifier.", 1, jcv.getCertsList().size()); Assert.assertTrue("One entry signed by cert that is not yet valid but also expiring means one signer in the verifier.", jcv.getCertsList().contains(expiringAndNotYetValidSigner.getSignerCertPath())); } @Test public void testManyEntryExpiringAndNotYetValidSigner() throws Exception { JarCertVerifier jcv = new JarCertVerifier(null); CodeSigner[] expiringAndNotYetValidSigners = { expiringAndNotYetValidSigner }; Vector entries = new Vector(); entries.add(new JarCertVerifierEntry("firstSignedByExpiringNotYetValid", expiringAndNotYetValidSigners)); entries.add(new JarCertVerifierEntry("secondSignedByExpiringNotYetValid", expiringAndNotYetValidSigners)); entries.add(new JarCertVerifierEntry("thirdSignedByExpiringNotYetValid", expiringAndNotYetValidSigners)); VerifyResult result = jcv.verifyJarEntryCerts("", true, entries); Assert.assertEquals("Three entries signed by cert that is not yet valid but also expiring, should be considered signed but not okay.", VerifyResult.SIGNED_NOT_OK, result); Assert.assertEquals("Three entries signed by cert that is not yet valid but also expiring means one signer in the verifier.", 1, jcv.getCertsList().size()); Assert.assertTrue("Three entries signed by cert that is not yet valid but also expiring means one signer in the verifier.", jcv.getCertsList().contains(expiringAndNotYetValidSigner.getSignerCertPath())); Assert.assertTrue("Three entries signed by cert that is not yet valid but also expiring means expiring issue should be in details list.", jcv.getDetails(expiringAndNotYetValidSigner.getSignerCertPath()).contains(R("SHasExpiringCert"))); } @Test public void testSingleEntryOneExpiredOneValidSigner() throws Exception { JarCertVerifier jcv = new JarCertVerifier(null); CodeSigner[] oneExpiredOneValidSigner = { expiredSigner, alphaSigner }; Vector entries = new Vector(); entries.add(new JarCertVerifierEntry("firstSignedByTwo", oneExpiredOneValidSigner)); VerifyResult result = jcv.verifyJarEntryCerts("", true, entries); Assert.assertEquals("One entry signed by one expired cert and another valid cert, should be considered signed and okay.", VerifyResult.SIGNED_OK, result); Assert.assertEquals("One entry signed by one expired cert and another valid cert means two signers in the verifier.", 2, jcv.getCertsList().size()); Assert.assertTrue("One entry signed by one expired cert and another valid cert means two signers in the verifier.", jcv.getCertsList().contains(expiredSigner.getSignerCertPath()) && jcv.getCertsList().contains(alphaSigner.getSignerCertPath())); } @Test public void testManyEntriesOneExpiredOneValidSigner() throws Exception { JarCertVerifier jcv = new JarCertVerifier(null); CodeSigner[] oneExpiredOneValidSigner = { expiredSigner, alphaSigner }; Vector entries = new Vector(); entries.add(new JarCertVerifierEntry("firstSignedByTwo", oneExpiredOneValidSigner)); entries.add(new JarCertVerifierEntry("secondSignedByTwo", oneExpiredOneValidSigner)); entries.add(new JarCertVerifierEntry("thirdSignedByTwo", oneExpiredOneValidSigner)); VerifyResult result = jcv.verifyJarEntryCerts("", true, entries); Assert.assertEquals("Three entries signed by one expired cert and another valid cert, should be considered signed and okay.", VerifyResult.SIGNED_OK, result); Assert.assertEquals("Three entries signed by one expired cert and another valid cert means two signers in the verifier.", 2, jcv.getCertsList().size()); Assert.assertTrue("Three entries signed by one expired cert and another valid cert means two signers in the verifier.", jcv.getCertsList().contains(expiredSigner.getSignerCertPath()) && jcv.getCertsList().contains(alphaSigner.getSignerCertPath())); } @Test public void testSomeExpiredEntries() throws Exception { JarCertVerifier jcv = new JarCertVerifier(null); CodeSigner[] oneExpiredOneValidSigners = { expiredSigner, alphaSigner }; CodeSigner[] expiredSigners = { expiredSigner }; Vector entries = new Vector(); entries.add(new JarCertVerifierEntry("firstSignedByTwo", oneExpiredOneValidSigners)); entries.add(new JarCertVerifierEntry("secondSignedByTwo", oneExpiredOneValidSigners)); entries.add(new JarCertVerifierEntry("thirdSignedByExpired", expiredSigners)); VerifyResult result = jcv.verifyJarEntryCerts("", true, entries); Assert.assertEquals("Two entries signed by one expired and one valid cert, third signed by just expired cert, should be considered signed but not okay.", VerifyResult.SIGNED_NOT_OK, result); Assert.assertEquals("Two entries signed by one expired and one valid cert, third signed by just expired cert means one signer in the verifier.", 1, jcv.getCertsList().size()); Assert.assertTrue("Two entries signed by one expired and one valid cert, third signed by just expired cert means one signer in the verifier.", jcv.getCertsList().contains(expiredSigner.getSignerCertPath())); } @Test public void testManyInvalidOneValidStillSignedOkay() throws Exception { JarCertVerifier jcv = new JarCertVerifier(null); CodeSigner[] oneExpiredOneValidSigners = { alphaSigner, expiredSigner }; CodeSigner[] oneNotYetValidOneValidSigners = { alphaSigner, notYetValidSigner }; CodeSigner[] oneExpiringSigners = { alphaSigner, expiringSigner }; Vector entries = new Vector(); entries.add(new JarCertVerifierEntry("META-INF/MANIFEST.MF")); entries.add(new JarCertVerifierEntry("firstSigned", oneExpiredOneValidSigners)); entries.add(new JarCertVerifierEntry("secondSigned", oneNotYetValidOneValidSigners)); entries.add(new JarCertVerifierEntry("thirdSigned", oneExpiringSigners)); entries.add(new JarCertVerifierEntry("oneDir/")); entries.add(new JarCertVerifierEntry("oneDir/fourthSigned", oneExpiredOneValidSigners)); VerifyResult result = jcv.verifyJarEntryCerts("", true, entries); Assert.assertEquals("Three entries sharing valid cert and others with issues, should be considered signed and okay.", VerifyResult.SIGNED_OK, result); Assert.assertEquals("Three entries sharing valid cert and others with issues means one signer in the verifier.", 1, jcv.getCertsList().size()); Assert.assertTrue("Three entries sharing valid cert and others with issues means one signer in the verifier.", jcv.getCertsList().contains(alphaSigner.getSignerCertPath())); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.17941/templates0000644000000000000000000000013112654402377024540 xustar0030 mtime=1454507263.221432794 30 atime=1454507658.776157397 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/templates/0000755000175000002070000000000012654402377025341 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/templates/PaxHeaders.17941/template9.jnlp0000644000000000000000000000013112654402377027406 xustar0030 mtime=1454507263.221432794 30 atime=1454507327.206579443 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/templates/template9.jnlp0000644000175000002070000000071612654402377030136 0ustar00jvanekmock00000000000000 Sample RedHat This is a sample to test a bug icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/templates/PaxHeaders.17941/template8.jnlp0000644000000000000000000000013112654402377027405 xustar0030 mtime=1454507263.221432794 30 atime=1454507327.205579457 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/templates/template8.jnlp0000644000175000002070000000050312654402377030127 0ustar00jvanekmock00000000000000 Sample Test RedHat icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/templates/PaxHeaders.17941/template7.jnlp0000644000000000000000000000013112654402377027404 xustar0030 mtime=1454507263.221432794 30 atime=1454507327.205579457 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/templates/template7.jnlp0000644000175000002070000000057712654402377030141 0ustar00jvanekmock00000000000000 Sample Test RedHat icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/templates/PaxHeaders.17941/template6.jnlp0000644000000000000000000000013112654402377027403 xustar0030 mtime=1454507263.221432794 30 atime=1454507327.205579457 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/templates/template6.jnlp0000644000175000002070000000053012654402377030125 0ustar00jvanekmock00000000000000 Test Sample RedHat icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/templates/PaxHeaders.17941/template5.jnlp0000644000000000000000000000013112654402377027402 xustar0030 mtime=1454507263.221432794 30 atime=1454507327.205579457 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/templates/template5.jnlp0000644000175000002070000000061612654402377030131 0ustar00jvanekmock00000000000000 * * main-class='*' /> icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/templates/PaxHeaders.17941/template4.jnlp0000644000000000000000000000013112654402377027401 xustar0030 mtime=1454507263.220432808 30 atime=1454507327.205579457 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/templates/template4.jnlp0000644000175000002070000000044112654402377030124 0ustar00jvanekmock00000000000000 * * icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/templates/PaxHeaders.17941/template3.jnlp0000644000000000000000000000013112654402377027400 xustar0030 mtime=1454507263.220432808 30 atime=1454507327.205579457 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/templates/template3.jnlp0000644000175000002070000000051612654402377030126 0ustar00jvanekmock00000000000000 RedHat Sample Test icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/templates/PaxHeaders.17941/template2.jnlp0000644000000000000000000000013112654402377027377 xustar0030 mtime=1454507263.220432808 30 atime=1454507327.205579457 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/templates/template2.jnlp0000644000175000002070000000051112654402377030120 0ustar00jvanekmock00000000000000 Sample Test * icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/templates/PaxHeaders.17941/template1.jnlp0000644000000000000000000000013112654402377027376 xustar0030 mtime=1454507263.220432808 30 atime=1454507327.205579457 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/templates/template1.jnlp0000644000175000002070000000051612654402377030124 0ustar00jvanekmock00000000000000 Sample Test RedHat icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/templates/PaxHeaders.17941/template0.jnlp0000644000000000000000000000013012654402377027374 xustar0030 mtime=1454507263.220432808 29 atime=1454507327.20457947 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/templates/template0.jnlp0000644000175000002070000000072012654402377030120 0ustar00jvanekmock00000000000000 Sample Test RedHat random tag test ]]> icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/templates/PaxHeaders.17941/EFBBBF.jnlp0000644000000000000000000000013012654402377026407 xustar0030 mtime=1454507263.219432821 29 atime=1454507327.20457947 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/templates/EFBBBF.jnlp0000644000175000002070000000455512654402377027145 0ustar00jvanekmock00000000000000 EFBBBF bytes starting with file IcedTea File starting with xml BOM EFBBBF bytes icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.17941/splashscreen0000644000000000000000000000013112654402377025234 xustar0030 mtime=1454507263.217432848 30 atime=1454507658.776157397 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/0000755000175000002070000000000012654402377026035 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/PaxHeaders.17941/parts0000644000000000000000000000013112654402377026365 xustar0030 mtime=1454507263.219432821 30 atime=1454507658.776157397 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/0000755000175000002070000000000012654402377027166 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/PaxHeaders.17941/JEditorPa0000644000000000000000000000032412654402377030212 xustar00124 path=icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/JEditorPaneBasedExceptionDialogTest.java 30 mtime=1454507263.219432821 29 atime=1454507327.20457947 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/JEditorPaneBasedExceptionD0000644000175000002070000002044312654402377034202 0ustar00jvanekmock00000000000000/* JeditorPaneBasedExceptionDialog.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.splashscreen.parts; import java.io.PrintWriter; import java.io.StringWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.Date; import java.util.List; import net.sourceforge.jnlp.runtime.Translator; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; public class JEditorPaneBasedExceptionDialogTest { private static RuntimeException eex = new RuntimeException("ex2"); private static Exception ex = new Exception("ex1", eex); private static String ai = "Another info"; private static InformationElement ec = new InformationElement(); private static List l = new ArrayList(3); @BeforeClass public static void fillLists() { ec.setHomepage("item 1"); ec.setTitle("item 2"); ec.setvendor("item 3"); ec.addDescription("item 4"); l = JEditorPaneBasedExceptionDialog.infoElementToList(ec); } static void assertHtml(String s) { Assert.assertTrue("result of getText must be marked html", s.contains("html")); Assert.assertTrue("result of getText must be marked html", s.contains("body")); assertMarkup(s); } static void assertMarkup(String s) { Assert.assertTrue("result of getText must be marked in by html markup", s.contains("<") && s.contains(">")); Assert.assertTrue("result of getText must be marked in by html markup", s.contains("")); } private void assertAI(String s, boolean b) { if (b) { Assert.assertTrue("result of getText must contains annother info", s.contains(ai)); } else { Assert.assertFalse("result of getText must NOT contains annother info", s.contains(ai)); } } private void assertLL(String s, boolean b) { for (String i : l) { if (b) { Assert.assertTrue("result of getText must contains info list", s.contains(i)); } else { Assert.assertFalse("result of getText must NOT contains info list", s.contains(i)); } } } private void assertFullException(String s, boolean b) { if (b) { Assert.assertTrue("result of getText must contains complete exception", s.contains(ex.getMessage())); Assert.assertTrue("result of getText must contains complete exception", s.contains(eex.getMessage())); } else { Assert.assertFalse("result of getText must contains not complete exception", s.contains(ex.getMessage())); Assert.assertFalse("result of getText must contains not complete exception", s.contains(eex.getMessage())); } } @Test public void getTextTest() { String s1 = JEditorPaneBasedExceptionDialog.getText(ex, l, ai, new Date()); String s2 = JEditorPaneBasedExceptionDialog.getText(ex, l, null, new Date()); String s3 = JEditorPaneBasedExceptionDialog.getText(ex, null, ai, new Date()); String s4 = JEditorPaneBasedExceptionDialog.getText(null, l, ai, new Date()); assertHtml(s1); assertHtml(s2); assertHtml(s3); assertHtml(s4); assertAI(s1, true); assertAI(s2, false); assertAI(s3, true); assertAI(s4, true); assertLL(s1, true); assertLL(s2, true); assertLL(s3, false); assertLL(s4, true); assertFullException(s1, true); assertFullException(s2, true); assertFullException(s3, true); assertFullException(s4, false); JEditorPaneBasedExceptionDialog d1 = new JEditorPaneBasedExceptionDialog(null, false, ex, ec, ai); JEditorPaneBasedExceptionDialog d2 = new JEditorPaneBasedExceptionDialog(null, false, ex, ec, null); JEditorPaneBasedExceptionDialog d3 = new JEditorPaneBasedExceptionDialog(null, false, ex, null, ai); JEditorPaneBasedExceptionDialog d4 = new JEditorPaneBasedExceptionDialog(null, false, null, ec, ai); Assert.assertTrue("message from dialog must be same as pattern", d1.getMessage().equals(s1)); Assert.assertTrue("message from dialog must be same as pattern", d2.getMessage().equals(s2)); Assert.assertTrue("message from dialog must be same as pattern", d3.getMessage().equals(s3)); Assert.assertTrue("message from dialog must be same as pattern", d4.getMessage().equals(s4)); } @Test public void getExceptionStackTraceAsString() { String t1 = JEditorPaneBasedExceptionDialog.getExceptionStackTraceAsString(ex); assertFullException(t1, true); String t2 = JEditorPaneBasedExceptionDialog.getExceptionStackTraceAsString(null); Assert.assertNotNull("For null empty result must not be null", t2); Assert.assertEquals("null input must result to empty string", "", t2); } @Test public void getExceptionStackTraceAsStrings() { String[] t1 = JEditorPaneBasedExceptionDialog.getExceptionStackTraceAsStrings(ex); assertFullException(Arrays.toString(t1), true); String[] t2 = JEditorPaneBasedExceptionDialog.getExceptionStackTraceAsStrings(null); Assert.assertNotNull("For null empty result must not be null", t2); Assert.assertArrayEquals("null input must result to empty array", new String[0], t2); } @Test public void formatListInfoList() { String t1 = JEditorPaneBasedExceptionDialog.formatListInfoList(l); assertMarkup(t1); assertLL(t1, true); String t2 = JEditorPaneBasedExceptionDialog.formatInfo(null); Assert.assertNotNull("For null empty result must not be null", t2); Assert.assertEquals("null input must result to empty string", "", t2); } @Test public void formatInfo() { String s = "SOME STRING"; String t1 = JEditorPaneBasedExceptionDialog.formatInfo(s); assertMarkup(t1); Assert.assertTrue("Marked text must contains source", t1.contains(s)); String t2 = JEditorPaneBasedExceptionDialog.formatInfo(null); Assert.assertNotNull("For null empty result must not be null", t2); Assert.assertEquals("null input must result to empty string", "", t2); } @Test public void infoElementToListTets() { List tl = JEditorPaneBasedExceptionDialog.infoElementToList(ec); Assert.assertTrue("Transformed elemetn must contains all items ", tl.contains(l.get(0))); Assert.assertTrue("Transformed elemetn must contains all items ", tl.contains(l.get(1))); Assert.assertTrue("Transformed elemetn must contains all items ", tl.contains(l.get(2))); Assert.assertTrue("Transformed elemetn must contains all items ", tl.contains(l.get(3))); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/PaxHeaders.17941/Informati0000644000000000000000000000030712654402377030322 xustar00111 path=icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/InformationElementTest.java 30 mtime=1454507263.219432821 29 atime=1454507327.20457947 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/InformationElementTest.jav0000644000175000002070000003331612654402377034335 0ustar00jvanekmock00000000000000/* InformationElementTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ /** http://docs.oracle.com/javase/6/docs/technotes/guides/javaws/developersguide/syntax.html */ package net.sourceforge.jnlp.splashscreen.parts; import java.io.ByteArrayInputStream; import java.io.UnsupportedEncodingException; import net.sourceforge.jnlp.JNLPFile; import net.sourceforge.jnlp.ParseException; import net.sourceforge.jnlp.ParserSettings; import org.junit.Assert; import org.junit.Test; /** * */ public class InformationElementTest { private static class TestDescriptionInfoItem extends DescriptionInfoItem { public TestDescriptionInfoItem(String value, String kind) { super(value, kind); } public String toXml() { if (kind == null) { return new TestInfoItem(type, value).toXml(); } return "<" + type + " kind=\"" + kind + "\">" + value + ""; } } private static class TestInfoItem extends InfoItem { public TestInfoItem(String type, String value) { super(type, value); } public String toXml() { if (type.equals(homepage)) { return "<" + type + " " + homepageHref + "=\"" + value + "\"/>"; } return "<" + type + ">" + value + ""; } } private final static TestInfoItem title = new TestInfoItem(InfoItem.title, "title exp"); private final static TestInfoItem vendor = new TestInfoItem(InfoItem.vendor, "vendor exp"); private final static TestInfoItem homepage = new TestInfoItem(InfoItem.homepage, "http://homepage.exp"); private final static TestDescriptionInfoItem oneLineD = new TestDescriptionInfoItem("One Line", DescriptionInfoItem.descriptionKindOneLine); private final static TestDescriptionInfoItem toolTipD = new TestDescriptionInfoItem("Tooltip", DescriptionInfoItem.descriptionKindToolTip); private final static TestDescriptionInfoItem short1D = new TestDescriptionInfoItem("short1", DescriptionInfoItem.descriptionKindShort); private final static TestDescriptionInfoItem short2D = new TestDescriptionInfoItem("short2", DescriptionInfoItem.descriptionKindShort); private final static TestDescriptionInfoItem noKindD = new TestDescriptionInfoItem("noKind", null); private static final String testJnlpheader = "\n" + "\n" + " \n"; private static final String testJnlpFooter = " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + ""; @Test public void testSetGetTitle() { InformationElement ie = new InformationElement(); Assert.assertNull("After creation value must be null", ie.getTitle()); ie.setTitle(title.getValue()); Assert.assertNotNull("After assigmentvalue must NOT be null", ie.getTitle()); Assert.assertTrue("After assigment value must be included in output", ie.getTitle().contains(title.getValue())); } @Test public void testSetGetvendor() { InformationElement ie = new InformationElement(); Assert.assertNull("After creation value must be null", ie.getVendor()); ie.setvendor(vendor.getValue()); Assert.assertNotNull("After assigmentvalue must NOT be null", ie.getVendor()); Assert.assertTrue("After assigment value must be included in output", ie.getVendor().contains(vendor.getValue())); } @Test public void testSetGetHomepage() { InformationElement ie = new InformationElement(); Assert.assertNull("After creation value must be null", ie.getHomepage()); ie.setHomepage(homepage.getValue()); Assert.assertNotNull("After assigmentvalue must NOT be null", ie.getHomepage()); Assert.assertTrue("After assigment value must be included in output", ie.getHomepage().contains(homepage.getValue())); } @Test public void addDescriptionTest() { InformationElement ie = new InformationElement(); Assert.assertNotNull("Descriptions should never be null", ie.getDescriptions()); Assert.assertEquals("Descriptions should be empty", 0, ie.getDescriptions().size()); ie.addDescription(toolTipD.getValue(), toolTipD.getKind()); Assert.assertNotNull("Descriptions should never be null", ie.getDescriptions()); Assert.assertEquals("Descriptions should be empty", 1, ie.getDescriptions().size()); ie.addDescription(short1D.getValue(), short1D.getKind()); Assert.assertNotNull("Descriptions should never be null", ie.getDescriptions()); Assert.assertEquals("Descriptions should be empty", 2, ie.getDescriptions().size()); ie.addDescription(short2D.getValue(), short2D.getKind()); Assert.assertNotNull("Descriptions should never be null", ie.getDescriptions()); Assert.assertEquals("Descriptions should reamin same", 2, ie.getDescriptions().size()); ie.addDescription(oneLineD.getValue(), oneLineD.getKind()); Assert.assertNotNull("Descriptions should never be null", ie.getDescriptions()); Assert.assertEquals("Descriptions should be ", 3, ie.getDescriptions().size()); ie.addDescription(noKindD.getValue(), noKindD.getKind()); Assert.assertNotNull("Descriptions should never be null", ie.getDescriptions()); Assert.assertEquals("Descriptions should be ", 4, ie.getDescriptions().size()); } public void getBestMatchingDescriptionForSplashTest() { InformationElement ie = new InformationElement(); Assert.assertNull(ie.getBestMatchingDescriptionForSplash()); ie.addDescription(toolTipD.getValue(), toolTipD.getKind()); Assert.assertNull(ie.getBestMatchingDescriptionForSplash()); ie.addDescription(short1D.getValue(), short1D.getKind()); Assert.assertNull(ie.getBestMatchingDescriptionForSplash()); ie.addDescription(noKindD.getValue(), noKindD.getKind()); Assert.assertNotNull(ie.getBestMatchingDescriptionForSplash()); Assert.assertEquals(ie.getBestMatchingDescriptionForSplash().getValue(), (noKindD.getValue())); ie.addDescription(oneLineD.getValue(), oneLineD.getKind()); Assert.assertNotNull(ie.getBestMatchingDescriptionForSplash()); Assert.assertEquals(ie.getBestMatchingDescriptionForSplash().getValue(), (oneLineD.getValue())); ie.addDescription(short2D.getValue(), short2D.getKind()); Assert.assertNotNull(ie.getBestMatchingDescriptionForSplash()); Assert.assertEquals(ie.getBestMatchingDescriptionForSplash().getValue(), (oneLineD.getValue())); } public void getLongestDescriptionForSplashTest() { InformationElement ie = new InformationElement(); Assert.assertNull(ie.getLongestDescriptionForSplash()); ie.addDescription(toolTipD.getValue(), toolTipD.getKind()); Assert.assertNotNull(ie.getLongestDescriptionForSplash()); Assert.assertEquals(ie.getLongestDescriptionForSplash().getValue(), (toolTipD.getValue())); ie.addDescription(oneLineD.getValue(), oneLineD.getKind()); Assert.assertNotNull(ie.getLongestDescriptionForSplash()); Assert.assertEquals(ie.getLongestDescriptionForSplash().getValue(), (oneLineD.getValue())); ie.addDescription(noKindD.getValue(), noKindD.getKind()); ie.addDescription(oneLineD.getValue(), oneLineD.getKind());//disturb Assert.assertNotNull(ie.getLongestDescriptionForSplash()); Assert.assertEquals(ie.getLongestDescriptionForSplash().getValue(), (noKindD.getValue())); ie.addDescription(short1D.getValue(), short1D.getKind()); ie.addDescription(toolTipD.getValue(), toolTipD.getKind());//disturb Assert.assertNotNull(ie.getLongestDescriptionForSplash()); Assert.assertEquals(ie.getLongestDescriptionForSplash().getValue(), (short1D.getValue())); } @Test public void getDescriptionTest() { getBestMatchingDescriptionForSplashTest(); } @Test public void getHeaderTest() { InformationElement ie = new InformationElement(); Assert.assertNotNull("Header should never be null", ie.getHeader()); Assert.assertEquals(0, ie.getHeader().size()); ie.setvendor(vendor.getValue()); Assert.assertEquals(1, ie.getHeader().size()); ie.setTitle(title.getValue()); Assert.assertEquals(2, ie.getHeader().size()); ie.setHomepage(homepage.getValue()); Assert.assertEquals(3, ie.getHeader().size()); ie.setTitle(homepage.getValue()); Assert.assertEquals(3, ie.getHeader().size()); ie.addDescription(toolTipD.getValue()); Assert.assertEquals(3, ie.getHeader().size()); ie.addDescription(oneLineD.getValue()); Assert.assertEquals(3, ie.getHeader().size()); } @Test public void createFromJNLP() throws UnsupportedEncodingException, ParseException { ParserSettings parser = new ParserSettings(); JNLPFile jnlpFile0 = null; InformationElement ie0 = InformationElement.createFromJNLP(jnlpFile0); Assert.assertNotNull(ie0); String exJnlp1 = "this is invalid jnlp"; Exception ex = null; JNLPFile jnlpFile1 = null; try { jnlpFile1 = new JNLPFile(new ByteArrayInputStream(exJnlp1.getBytes("utf-8")), parser); } catch (Exception eex) { ex = eex; } Assert.assertNotNull(ex); InformationElement ie1 = InformationElement.createFromJNLP(jnlpFile1); Assert.assertNotNull(ie1); //title, vendor and homepage are obligatory.. not so much to test String exJnlp2 = testJnlpheader + title.toXml() + "\n" + homepage.toXml() + "\n" + vendor.toXml() + "\n" + testJnlpFooter; JNLPFile jnlpFile2 = new JNLPFile(new ByteArrayInputStream(exJnlp2.getBytes("utf-8")), parser); InformationElement ie2 = InformationElement.createFromJNLP(jnlpFile2); Assert.assertNotNull(ie2); Assert.assertEquals(3, ie2.getHeader().size()); Assert.assertEquals(0, ie2.getDescriptions().size()); String exJnlp3 = testJnlpheader + title.toXml() + "\n" + homepage.toXml() + "\n" + vendor.toXml() + "\n" + toolTipD.toXml() + "\n" + testJnlpFooter; JNLPFile jnlpFile3 = new JNLPFile(new ByteArrayInputStream(exJnlp3.getBytes("utf-8")), parser); InformationElement ie3 = InformationElement.createFromJNLP(jnlpFile3); Assert.assertNotNull(ie3); Assert.assertEquals(3, ie3.getHeader().size()); Assert.assertEquals(1, ie3.getDescriptions().size()); String exJnlp4 = testJnlpheader + title.toXml() + "\n" + homepage.toXml() + "\n" + vendor.toXml() + "\n" + noKindD.toXml() + "\n" + testJnlpFooter; JNLPFile jnlpFile4 = new JNLPFile(new ByteArrayInputStream(exJnlp4.getBytes("utf-8")), parser); InformationElement ie4 = InformationElement.createFromJNLP(jnlpFile4); Assert.assertNotNull(ie4); Assert.assertEquals(3, ie4.getHeader().size()); Assert.assertEquals(1, ie4.getDescriptions().size()); String exJnlp5 = testJnlpheader + title.toXml() + "\n" + homepage.toXml() + "\n" + vendor.toXml() + "\n" + noKindD.toXml() + "\n" + toolTipD.toXml() + "\n" + testJnlpFooter; JNLPFile jnlpFile5 = new JNLPFile(new ByteArrayInputStream(exJnlp5.getBytes("utf-8")), parser); InformationElement ie5 = InformationElement.createFromJNLP(jnlpFile5); Assert.assertNotNull(ie5); Assert.assertEquals(3, ie5.getHeader().size()); Assert.assertEquals(2, ie5.getDescriptions().size()); } @Test public void toXml() { TestInfoItem i1 = new TestInfoItem("aa", "bb"); Assert.assertTrue(i1.toXml().contains("aa")); Assert.assertTrue(i1.toXml().contains("bb")); Assert.assertTrue(i1.toXml().length() > 4); JEditorPaneBasedExceptionDialogTest.assertMarkup(i1.toXml()); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/PaxHeaders.17941/InfoItemT0000644000000000000000000000013012654402377030222 xustar0030 mtime=1454507263.218432834 29 atime=1454507327.20457947 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/InfoItemTest.java0000644000175000002070000001060012654402377032400 0ustar00jvanekmock00000000000000/* InfoItemTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.splashscreen.parts; import org.junit.Assert; import org.junit.Test; /** *The optional kind="splash" attribute may be used in an icon element to indicate that the image is to be used as a "splash" screen during the launch of an application. If the JNLP file does not contain an icon element with kind="splash" attribute, Java Web Start will construct a splash screen using other items from the information Element. *If the JNLP file does not contain any icon images, the splash image will consist of the application's title and vendor, as taken from the JNLP file. * * items not used inside */ public class InfoItemTest { @Test public void testGettersSetters() { InfoItem ii = new InfoItem("a", "b"); Assert.assertEquals("a", ii.getType()); Assert.assertEquals("b", ii.getValue()); ii.setType("c"); Assert.assertEquals("c", ii.getType()); ii.setValue("d"); Assert.assertEquals("d", ii.getValue()); } @Test public void TestIsOfSameType() { InfoItem i1 = new InfoItem("a", "b"); InfoItem i2 = new InfoItem("a", "c"); InfoItem i3 = new InfoItem("b", "a"); Assert.assertTrue(i1.isofSameType(i2)); Assert.assertFalse(i1.isofSameType(i3)); Assert.assertFalse(i2.isofSameType(i3)); DescriptionInfoItem d1 = new DescriptionInfoItem("a", InfoItem.descriptionKindToolTip); InfoItem id1 = new InfoItem(InfoItem.description, "a"); Assert.assertTrue(id1.isofSameType(d1)); } @Test public void testEquals() { InfoItem i1 = new InfoItem("a", "b"); InfoItem i11 = new InfoItem("a", "b"); InfoItem i2 = new InfoItem("a", "c"); InfoItem i3 = new InfoItem("b", "a"); Assert.assertFalse(i1.equals(i2)); Assert.assertFalse(i1.equals(i3)); Assert.assertFalse(i2.equals(i3)); Assert.assertTrue(i1.equals(i11)); DescriptionInfoItem d1 = new DescriptionInfoItem("a", InfoItem.descriptionKindToolTip); InfoItem id1 = new InfoItem(InfoItem.description, "a"); Assert.assertTrue(id1.equals(d1)); } @Test public void toStringTest() { InfoItem i1 = new InfoItem("aa", "bb"); Assert.assertTrue(i1.toString().contains("aa")); Assert.assertTrue(i1.toString().contains("bb")); Assert.assertTrue(i1.toString().length() > 4); } @Test public void toNiceString() { InfoItem i1 = new InfoItem("aaa", "bbb"); Assert.assertTrue(i1.toNiceString().contains(InfoItem.SPLASH + "aaa") || !i1.toNiceString().contains(InfoItem.SPLASH)); Assert.assertTrue(i1.toNiceString().contains("bbb")); Assert.assertFalse(i1.toNiceString().equals(i1.toString())); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/PaxHeaders.17941/Descripti0000644000000000000000000000031012654402377030312 xustar00112 path=icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/DescriptionInfoItemTest.java 30 mtime=1454507263.218432834 29 atime=1454507327.20457947 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/DescriptionInfoItemTest.ja0000644000175000002070000001344412654402377034266 0ustar00jvanekmock00000000000000/* DescriptionInfoItemTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.splashscreen.parts; import net.sourceforge.jnlp.ServerAccess; import org.junit.Assert; import org.junit.Test; public class DescriptionInfoItemTest { private static final DescriptionInfoItem[] d = {new DescriptionInfoItem("Firm 1", null), new DescriptionInfoItem("Firm 2", null), new DescriptionInfoItem("Firm 3", "k1"), new DescriptionInfoItem("Firm 4", "k2"), new DescriptionInfoItem("Firm 6", "k1")}; @Test public void setGetTest() { DescriptionInfoItem di = new DescriptionInfoItem("a", "b"); Assert.assertEquals("a", di.getValue()); Assert.assertEquals("b", di.getKind()); Assert.assertEquals(InfoItem.description, di.getType()); di.setKind("q"); Assert.assertEquals("q", di.getKind()); } @Test public void isOfSameKindTests() { boolean[] results = new boolean[]{true, true, false, false, false, true, true, false, false, false, false, false, true, false, true, false, false, false, true, false, false, false, true, false, true}; int x = -1; for (int i = 0; i < d.length; i++) { DescriptionInfoItem d1 = d[i]; for (int j = 0; j < d.length; j++) { x++; DescriptionInfoItem d2 = d[j]; ServerAccess.logOutputReprint(x + ": " + i + "x" + j + " " + d1.toString() + "x" + d2.toString() + "- same kind - " + d1.isOfSameKind(d2)); Assert.assertEquals(results[x], d1.isOfSameKind(d2)); } } } @Test public void isSameTest() { boolean[] results = new boolean[]{true, true, false, false, false, true, true, false, false, false, false, false, true, false, true, false, false, false, true, false, false, false, true, false, true }; int x = -1; for (int i = 0; i < d.length; i++) { DescriptionInfoItem d1 = d[i]; for (int j = 0; j < d.length; j++) { x++; DescriptionInfoItem d2 = d[j]; ServerAccess.logOutputReprint(x + ": " + i + "x" + j + " " + d1.toString() + "x" + d2.toString() + "- same - " + d1.isSame(d2)); Assert.assertEquals(results[x], d1.isSame(d2)); } } } @Test public void equalsTest() { boolean[] results = new boolean[]{true, false, false, false, false, false, true, false, false, false, false, false, true, false, false, false, false, false, true, false, false, false, false, false, true }; int x = -1; for (int i = 0; i < d.length; i++) { DescriptionInfoItem d1 = d[i]; for (int j = 0; j < d.length; j++) { x++; DescriptionInfoItem d2 = d[j]; ServerAccess.logOutputReprint(x + ": " + i + "x" + j + ", " + d1.toString() + " x " + d2.toString() + "- equals - " + d1.equals(d2)); Assert.assertEquals(results[x], d1.equals(d2)); } } } @Test public void toStringTest() { DescriptionInfoItem d1 = new DescriptionInfoItem("Firm 3", null); Assert.assertTrue(d1.toString().contains(d1.getValue())); Assert.assertTrue(d1.toString().contains(d1.getType())); Assert.assertTrue(d1.toString().contains("null")); DescriptionInfoItem dd = new DescriptionInfoItem("Firm 3", "k1"); Assert.assertTrue(dd.toString().contains(dd.getValue())); Assert.assertTrue(dd.toString().contains(dd.getType())); Assert.assertTrue(dd.toString().contains(dd.getKind())); } @Test public void toNiceStringTest() { DescriptionInfoItem d1 = new DescriptionInfoItem("Firm 3", null); Assert.assertTrue(d1.toNiceString().contains(d1.getValue())); Assert.assertTrue(d1.toNiceString().contains(InfoItem.SPLASH + d1.getType()) || !d1.toNiceString().contains(InfoItem.SPLASH)); DescriptionInfoItem dd = new DescriptionInfoItem("Firm 3", "k1"); Assert.assertTrue(dd.toNiceString().contains(dd.getValue())); Assert.assertTrue(dd.toNiceString().contains(InfoItem.SPLASH + dd.getType()) || !d1.toNiceString().contains(InfoItem.SPLASH)); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/PaxHeaders.17941/BasicComp0000644000000000000000000000031712654402377030233 xustar00119 path=icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/BasicComponentSplashScreenTest.java 30 mtime=1454507263.218432834 29 atime=1454507327.20457947 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/BasicComponentSplashScreen0000644000175000002070000001052212654402377034330 0ustar00jvanekmock00000000000000/* BasicComponentSplashScreenTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.splashscreen.parts; import java.awt.Graphics; import net.sourceforge.jnlp.splashscreen.SplashUtils.SplashReason; import org.junit.Assert; import org.junit.Test; public class BasicComponentSplashScreenTest { @Test public void createAditionalInfoTest() { BasicComponentSplashScreenImpl tested = new BasicComponentSplashScreenImpl(); String v = "2.118x08"; tested.setVersion(v); tested.setSplashReason(SplashReason.APPLET); String s1 = tested.createAditionalInfoTest(); Assert.assertNotNull("Not null input must result to something", s1); Assert.assertTrue("Not null input must have version value", s1.contains(v)); Assert.assertTrue("Not null input must have version string", s1.contains("version")); Assert.assertTrue("Not null input must have version string", s1.contains(SplashReason.APPLET.toString())); tested.setVersion(null); tested.setSplashReason(null); String s2 = tested.createAditionalInfoTest(); Assert.assertNull("Not null input must result to something", s2); tested.setSplashReason(null); tested.setVersion(v); Exception ex = null; try { String s3 = tested.createAditionalInfoTest(); } catch (Exception exx) { ex = exx; } Assert.assertNotNull("Null reason vith set version must causes exception", ex); } private class BasicComponentSplashScreenImpl extends BasicComponentSplashScreen { public BasicComponentSplashScreenImpl() { } @Override public void paintComponent(Graphics g) { throw new UnsupportedOperationException("Not supported yet."); } @Override public void paintTo(Graphics g) { throw new UnsupportedOperationException("Not supported yet."); } @Override public void adjustForSize() { throw new UnsupportedOperationException("Not supported yet."); } @Override public void startAnimation() { throw new UnsupportedOperationException("Not supported yet."); } @Override public void stopAnimation() { throw new UnsupportedOperationException("Not supported yet."); } public String createAditionalInfoTest() { return super.createAditionalInfo(); } @Override public void setPercentage(int done) { throw new UnsupportedOperationException("Not supported yet."); } @Override public int getPercentage() { throw new UnsupportedOperationException("Not supported yet."); } } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/PaxHeaders.17941/BasicComp0000644000000000000000000000032512654402377030232 xustar00124 path=icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/BasicComponentErrorSplashScreenTest.java 30 mtime=1454507263.217432848 30 atime=1454507327.203579483 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/BasicComponentErrorSplashS0000644000175000002070000001117112654402377034326 0ustar00jvanekmock00000000000000/* BasicComponentSplashScreenTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.splashscreen.parts; import java.awt.Graphics; import net.sourceforge.jnlp.splashscreen.SplashUtils.SplashReason; import org.junit.Assert; import org.junit.Test; public class BasicComponentErrorSplashScreenTest { @Test public void createAditionalInfoTest() { BasicComponentSplashScreenImpl tested = new BasicComponentSplashScreenImpl(); String v = "2.118x08"; tested.setVersion(v); tested.setSplashReason(SplashReason.APPLET); String s1 = tested.createAditionalInfoTest(); Assert.assertNotNull("Not null input must result to something", s1); Assert.assertTrue("Not null input must have version value", s1.contains(v)); Assert.assertTrue("Not null input must have version string", s1.contains("version")); Assert.assertTrue("Not null input must have version string", s1.contains(SplashReason.APPLET.toString())); tested.setVersion(null); tested.setSplashReason(null); String s2 = tested.createAditionalInfoTest(); Assert.assertNull("Not null input must result to something", s2); tested.setSplashReason(null); tested.setVersion(v); Exception ex = null; try { String s3 = tested.createAditionalInfoTest(); } catch (Exception exx) { ex = exx; } Assert.assertNotNull("Null reason vith set version must causes exception", ex); } @Test public void setGetError() { BasicComponentSplashScreenImpl tested = new BasicComponentSplashScreenImpl(); Exception ex = new Exception("ujuj"); tested.setLoadingException(ex); Assert.assertEquals(ex, tested.getLoadingException()); } private class BasicComponentSplashScreenImpl extends BasicComponentErrorSplashScreen { public BasicComponentSplashScreenImpl() { } @Override public void paintComponent(Graphics g) { throw new UnsupportedOperationException("Not supported yet."); } @Override public void paintTo(Graphics g) { throw new UnsupportedOperationException("Not supported yet."); } @Override public void adjustForSize() { throw new UnsupportedOperationException("Not supported yet."); } @Override public void startAnimation() { throw new UnsupportedOperationException("Not supported yet."); } @Override public void stopAnimation() { throw new UnsupportedOperationException("Not supported yet."); } public String createAditionalInfoTest() { return super.createAditionalInfo(); } @Override public void setPercentage(int done) { throw new UnsupportedOperationException("Not supported yet."); } @Override public int getPercentage() { throw new UnsupportedOperationException("Not supported yet."); } } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/PaxHeaders.17941/impls0000644000000000000000000000013112654402377026360 xustar0030 mtime=1454507263.215432874 30 atime=1454507658.776157397 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/0000755000175000002070000000000012654402377027161 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/PaxHeaders.17941/defaultsp0000644000000000000000000000013112654402377030347 xustar0030 mtime=1454507263.217432848 30 atime=1454507658.776157397 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/0000755000175000002070000000000012654402377033525 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/Pa0000644000000000000000000000034012654402377030556 xustar00135 path=icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/TextWithWaterLevelTest.java 30 mtime=1454507263.217432848 30 atime=1454507327.203579483 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/Te0000644000175000002070000001257312654402377034030 0ustar00jvanekmock00000000000000/* TextWithWaterLevelTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012; import net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012.TextWithWaterLevel; import java.awt.Color; import java.awt.Font; import java.awt.Graphics2D; import java.awt.image.BufferedImage; import org.junit.Assert; import org.junit.Test; public class TextWithWaterLevelTest { @Test public void setGetTest() { BufferedImage bi = new BufferedImage(100, 100, BufferedImage.TYPE_INT_ARGB); Graphics2D g2d = bi.createGraphics(); Font f1 = g2d.getFont().deriveFont(Font.ITALIC); Font f2 = g2d.getFont().deriveFont(Font.BOLD); String s = "Watter"; TextWithWaterLevel tw = new TextWithWaterLevel(s, f1); Assert.assertEquals(-1, tw.getHeight()); Assert.assertEquals(-1, tw.getWidth()); Assert.assertEquals(f1, tw.getFont()); Assert.assertNull(tw.getImg()); Assert.assertEquals(s, tw.getText()); Assert.assertEquals(Color.BLACK, tw.getTextOutline()); Assert.assertEquals(Color.blue, tw.getWaterColor()); Assert.assertEquals(Color.white, tw.getBgColor()); Assert.assertEquals(0, tw.getPercentageOfWater()); tw.setBgColor(Color.yellow); tw.setWaterColor(Color.orange); tw.setPercentageOfWater(20); Assert.assertEquals(Color.orange, tw.getWaterColor()); Assert.assertEquals(Color.yellow, tw.getBgColor()); Assert.assertEquals(20, tw.getPercentageOfWater()); } @Test public void getBackground() { TextWithWaterLevel ifc = getInstance(); ifc.setCachedPolygon(null); ifc.setPercentageOfWater(50); BufferedImage bic = ifc.getBackground(); int w = bic.getWidth(); int h = bic.getHeight(); Assert.assertEquals(Color.blue, new Color(bic.getRGB(w / 2, 2 * h / 3))); Assert.assertEquals(Color.white, new Color(bic.getRGB(w / 2, h / 3))); ifc.setCachedPolygon(null); ifc.setPercentageOfWater(5); bic = ifc.getBackground(); Assert.assertEquals(Color.white, new Color(bic.getRGB(w / 2, 2 * h / 3))); Assert.assertEquals(Color.white, new Color(bic.getRGB(w / 2, h / 3))); ifc.setCachedPolygon(null); ifc.setPercentageOfWater(95); bic = ifc.getBackground(); Assert.assertEquals(Color.blue, new Color(bic.getRGB(w / 2, 2 * h / 3))); Assert.assertEquals(Color.blue, new Color(bic.getRGB(w / 2, h / 3))); } private TextWithWaterLevel getInstance() { BufferedImage bi1 = new BufferedImage(10, 10, BufferedImage.TYPE_INT_ARGB); Font f = bi1.createGraphics().getFont().deriveFont(Font.BOLD, 130); TextWithWaterLevel ifc = new TextWithWaterLevel("O O", f); return ifc; } @Test public void cutToTest() { TextWithWaterLevel ifc = getInstance(); ifc.setPercentageOfWater(50); BufferedImage bic = ifc.getBackground(); int w = bic.getWidth(); int h = bic.getHeight(); bic = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB); ifc.cutTo(bic.createGraphics(), 0, h); Assert.assertEquals(Color.blue, new Color(bic.getRGB(52, 142))); Assert.assertEquals(Color.blue, new Color(bic.getRGB(170, 110))); Assert.assertEquals(Color.white, new Color(bic.getRGB(52, 62))); Assert.assertEquals(Color.white, new Color(bic.getRGB(245, 85))); //well this should be acctually rgba 0,0,0,0 but somehow this was no passig //you can confirm with: //ImageFontCutterTest.save(bic, "halfFiledOus") Assert.assertEquals(new Color(0, 0, 0), new Color(bic.getRGB(137, 127))); Assert.assertEquals(new Color(0, 0, 0), new Color(bic.getRGB(137, 2))); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/Pa0000644000000000000000000000034112654402377030557 xustar00136 path=icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/TextOutlineRendererTest.java 30 mtime=1454507263.217432848 30 atime=1454507327.203579483 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/Te0000644000175000002070000001201412654402377034016 0ustar00jvanekmock00000000000000/* TextOutlineRendererTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012; import java.awt.Color; import java.awt.Font; import java.awt.Graphics2D; import java.awt.image.BufferedImage; import java.io.File; import javax.imageio.ImageIO; import org.junit.Assert; import org.junit.Test; public class TextOutlineRendererTest { @Test public void getSetTest() { BufferedImage bi = new BufferedImage(100, 100, BufferedImage.TYPE_INT_ARGB); Graphics2D g2d = bi.createGraphics(); Font f1 = g2d.getFont().deriveFont(Font.ITALIC); Font f2 = g2d.getFont().deriveFont(Font.BOLD); String s = "Hello"; TextOutlineRenderer ifc = new TextOutlineRenderer(f1, s); Assert.assertEquals(-1, ifc.getHeight()); Assert.assertEquals(-1, ifc.getWidth()); Assert.assertEquals(f1, ifc.getFont()); Assert.assertNull(ifc.getImg()); Assert.assertEquals(s, ifc.getText()); Assert.assertEquals(Color.BLACK, ifc.getTextOutline()); ifc.setImg(bi); Assert.assertEquals(100, ifc.getHeight()); Assert.assertEquals(100, ifc.getWidth()); Assert.assertEquals(f1, ifc.getFont()); Assert.assertEquals(bi, ifc.getImg()); Assert.assertEquals(s, ifc.getText()); Assert.assertEquals(Color.BLACK, ifc.getTextOutline()); TextOutlineRenderer xfc = new TextOutlineRenderer(f1, s, Color.red); xfc.setImg(bi); xfc.setFont(f2); String ss = "HelloHello"; Assert.assertEquals(100, xfc.getHeight()); Assert.assertEquals(100, xfc.getWidth()); Assert.assertEquals(f2, xfc.getFont()); Assert.assertEquals(bi, xfc.getImg()); Assert.assertEquals(s, xfc.getText()); Assert.assertEquals(Color.red, xfc.getTextOutline()); xfc.setTextOutline(Color.white); Assert.assertEquals(Color.white, xfc.getTextOutline()); } @Test public void cutToTest() { BufferedImage bi1 = new BufferedImage(100, 100, BufferedImage.TYPE_INT_ARGB); Graphics2D g2d1 = bi1.createGraphics(); g2d1.setColor(Color.red); g2d1.fillRect(0, 0, 100, 100); BufferedImage bi2 = new BufferedImage(100, 100, BufferedImage.TYPE_INT_ARGB); Graphics2D g2d2 = bi2.createGraphics(); g2d2.setColor(Color.blue); g2d2.fillRect(0, 0, 100, 100); TextOutlineRenderer ifc = new TextOutlineRenderer(g2d1.getFont().deriveFont(Font.BOLD, 130), "O"); ifc.setImg(bi1); ifc.cutTo(g2d2, -5, 100); Color c1 = new Color(bi2.getRGB(1, 1)); Assert.assertEquals(Color.blue, c1); Color c2 = new Color(bi2.getRGB(50, 50)); Assert.assertEquals(Color.blue, c2); Color c3 = new Color(bi2.getRGB(30, 30)); Assert.assertEquals(Color.red, c3); Color c4 = new Color(bi2.getRGB(70, 70)); Assert.assertEquals(Color.red, c4); Color c5 = new Color(bi2.getRGB(26, 52)); Assert.assertEquals(Color.black, c5); } public static void save(BufferedImage bi1, String string) { try { String name = string; if (name == null || name.trim().length() <= 0) { name = "testImage"; } ImageIO.write(bi1, "png", new File(System.getProperty("user.home") + "/Desktop/" + name + ".png")); } catch (Exception ex) { ex.printStackTrace(); } } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/Pa0000644000000000000000000000033112654402377030556 xustar00128 path=icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/SplinesDefsTest.java 30 mtime=1454507263.217432848 30 atime=1454507327.203579483 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/Sp0000644000175000002070000000662112654402377034037 0ustar00jvanekmock00000000000000/* SplinesDefsTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012; import net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012.SplinesDefs; import java.awt.Point; import java.awt.Polygon; import org.junit.Assert; import org.junit.Test; public class SplinesDefsTest { private static Point[] testArray = { new Point(0, 0), new Point(100, 0), new Point(100, 100), new Point(0, 100) }; @Test public void polygonizeControlPointsTest() { Polygon p = SplinesDefs.polygonizeControlPoints(testArray, 1d, 1d); Assert.assertTrue(p.contains(50, 50)); Assert.assertFalse(p.contains(150, 150)); Assert.assertFalse(p.contains(-50, -50)); p = SplinesDefs.polygonizeControlPoints(testArray, 0.5d, 0.5d); Assert.assertTrue(p.contains(20, 20)); Assert.assertFalse(p.contains(75, 75)); Assert.assertFalse(p.contains(-25, -25)); p = SplinesDefs.polygonizeControlPoints(testArray, 2d, 2d); Assert.assertTrue(p.contains(150, 150)); Assert.assertFalse(p.contains(250, 250)); Assert.assertFalse(p.contains(-50, -50)); } @Test public void testApi() { double x = 1d; Polygon[] p = {SplinesDefs.getMainLeaf(x, x), SplinesDefs.getMainLeafCurve(x, x), SplinesDefs.getMainLeafStalk(x, x), SplinesDefs.getMainLeafStalkCurve(x, x), SplinesDefs.getSecondLeaf(x, x), SplinesDefs.getSecondLeafCurve(x, x), SplinesDefs.getSecondLeafStalk(x, x), SplinesDefs.getSecondLeafStalkCurve(x, x)}; for (Polygon polygon : p) { Assert.assertNotNull(polygon); Assert.assertTrue(polygon.npoints > 5); } } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/Pa0000644000000000000000000000032612654402377030562 xustar00125 path=icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/NatCubicTest.java 30 mtime=1454507263.216432861 30 atime=1454507327.203579483 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/Na0000644000175000002070000002401512654402377034010 0ustar00jvanekmock00000000000000/* NatCubicTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012; import net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012.NatCubic; import java.awt.Polygon; import org.junit.Assert; import org.junit.Test; public class NatCubicTest { @Test public void setGetTests() { Polygon p1 = new Polygon(); p1.addPoint(10, 23); p1.addPoint(12, -31); NatCubic cc = new NatCubic(); Assert.assertNotNull(cc.getSourcePolygon()); Assert.assertNull(cc.getResult()); Exception ex = null; try { cc.calcualteAndSaveResult(); } catch (Exception eex) { ex = eex; } Assert.assertNotNull(ex); Assert.assertNull(cc.getResult()); Assert.assertTrue(cc.isWithPoints()); cc.setSourcePolygon(p1); Assert.assertNotNull(cc.getSourcePolygon()); Assert.assertEquals(p1, cc.getSourcePolygon()); Assert.assertNull(cc.getResult()); cc.calcualteAndSaveResult(); Assert.assertNotNull(cc.getResult()); Assert.assertTrue(cc.isWithPoints()); cc.setWithPoints(false); Assert.assertFalse(cc.isWithPoints()); cc.resetResult(); Assert.assertNull(cc.getResult()); } static int[] xs = {0, 100, 100, 0}; static int[] ys = {0, 0, 100, 1000}; static NatCubic getTestInstance() { NatCubic cc = new NatCubic(); cc.addPoint(xs[0], ys[0]); cc.addPoint(xs[1], ys[1]); cc.addPoint(xs[2], ys[2]); cc.addPoint(xs[3], ys[3]); return cc; } @Test public void basicComputation() { NatCubic b = new NatCubic(); b.addPoint(10, 10); b.addPoint(50, 20); b.addPoint(-10, -10); b.calcualteAndSaveResult(); Assert.assertTrue(b.pts.npoints < b.result.npoints / 5); Assert.assertFalse(b.result.xpoints[0] == b.result.xpoints[b.result.npoints - 1]); Assert.assertFalse(b.result.ypoints[0] == b.result.ypoints[b.result.npoints - 1]); } @Test public void addPoint() { NatCubic cc = new NatCubic(); Assert.assertEquals(0, cc.getSourcePolygon().npoints); Assert.assertNull(cc.getResult()); Exception ex = null; try { cc.calcualteAndSaveResult(); } catch (Exception eex) { ex = eex; } Assert.assertNotNull(ex); Assert.assertNull(cc.getResult()); cc.addPoint(10, 10); Assert.assertEquals(1, cc.getSourcePolygon().npoints); Assert.assertNull(cc.getResult()); ex = null; try { cc.calcualteAndSaveResult(); } catch (Exception eex) { ex = eex; } Assert.assertNotNull(ex); Assert.assertNull(cc.getResult()); cc.addPoint(10, 10); Assert.assertEquals(2, cc.getSourcePolygon().npoints); Assert.assertNull(cc.getResult()); cc.calcualteAndSaveResult(); Assert.assertNotNull(cc.getResult()); cc.addPoint(100, 100); Assert.assertEquals(3, cc.getSourcePolygon().npoints); Assert.assertNull(cc.getResult()); cc.calcualteAndSaveResult(); Assert.assertNotNull(cc.getResult()); } @Test public void setPointTest1() { NatCubic cc = getTestInstance(); Assert.assertEquals(4, cc.getSourcePolygon().npoints); for (int i = 0; i < 4; i++) { Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]); Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]); } Assert.assertNull(cc.getResult()); cc.calcualteAndSaveResult(); Assert.assertNotNull(cc.getResult()); cc.setSelection(-1); cc.setPoint(10, 10); Assert.assertEquals(4, cc.getSourcePolygon().npoints); for (int i = 0; i < 4; i++) { Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]); Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]); } Assert.assertNotNull(cc.getResult()); cc.setSelection(4); cc.setPoint(10, 10); Assert.assertEquals(4, cc.getSourcePolygon().npoints); for (int i = 0; i < 4; i++) { Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]); Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]); } Assert.assertNotNull(cc.getResult()); cc.setSelection(3); cc.setPoint(10, 20); Assert.assertEquals(4, cc.getSourcePolygon().npoints); for (int i = 0; i < 3; i++) { Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]); Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]); } Assert.assertNull(cc.getResult()); cc.calcualteAndSaveResult(); Assert.assertNotNull(cc.getResult()); Assert.assertEquals(20, cc.getSourcePolygon().ypoints[3]); Assert.assertEquals(10, cc.getSourcePolygon().xpoints[3]); } @Test public void removePoint2() { NatCubic cc = getTestInstance(); Assert.assertEquals(4, cc.getSourcePolygon().npoints); for (int i = 0; i < 4; i++) { Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]); Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]); } Assert.assertNull(cc.getResult()); cc.calcualteAndSaveResult(); Assert.assertNotNull(cc.getResult()); cc.removePoint(-1); Assert.assertEquals(4, cc.getSourcePolygon().npoints); for (int i = 0; i < 4; i++) { Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]); Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]); } Assert.assertNotNull(cc.getResult()); cc.calcualteAndSaveResult(); Assert.assertNotNull(cc.getResult()); cc.removePoint(4); Assert.assertEquals(4, cc.getSourcePolygon().npoints); for (int i = 0; i < 4; i++) { Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]); Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]); } Assert.assertNotNull(cc.getResult()); cc.calcualteAndSaveResult(); Assert.assertNotNull(cc.getResult()); cc.removePoint(3); Assert.assertEquals(3, cc.getSourcePolygon().npoints); for (int i = 0; i < 3; i++) { Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]); Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]); } Assert.assertNull(cc.getResult()); cc.calcualteAndSaveResult(); Assert.assertNotNull(cc.getResult()); } public void removePoint1() { NatCubic cc = getTestInstance(); Assert.assertEquals(4, cc.getSourcePolygon().npoints); for (int i = 0; i < 4; i++) { Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]); Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]); } Assert.assertNull(cc.getResult()); cc.calcualteAndSaveResult(); Assert.assertNotNull(cc.getResult()); cc.setSelection(-1); cc.removePoint(); Assert.assertEquals(4, cc.getSourcePolygon().npoints); for (int i = 0; i < 4; i++) { Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]); Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]); } Assert.assertNotNull(cc.getResult()); cc.calcualteAndSaveResult(); Assert.assertNotNull(cc.getResult()); cc.setSelection(4); cc.removePoint(); Assert.assertEquals(4, cc.getSourcePolygon().npoints); for (int i = 0; i < 4; i++) { Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]); Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]); } Assert.assertNotNull(cc.getResult()); cc.calcualteAndSaveResult(); Assert.assertNotNull(cc.getResult()); cc.setSelection(0); cc.removePoint(); Assert.assertEquals(3, cc.getSourcePolygon().npoints); for (int i = 0; i < 3; i++) { Assert.assertEquals(ys[i + 1], cc.getSourcePolygon().ypoints[i]); Assert.assertEquals(xs[i + 1], cc.getSourcePolygon().xpoints[i]); } Assert.assertNull(cc.getResult()); cc.calcualteAndSaveResult(); Assert.assertNotNull(cc.getResult()); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/Pa0000644000000000000000000000033412654402377030561 xustar00131 path=icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/NatCubicClosedTest.java 30 mtime=1454507263.216432861 30 atime=1454507327.202579497 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/Na0000644000175000002070000002414512654402377034014 0ustar00jvanekmock00000000000000/* NatCubicClosedTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012; import net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012.NatCubicClosed; import java.awt.Polygon; import org.junit.Assert; import org.junit.Test; public class NatCubicClosedTest { @Test public void setGetTests() { Polygon p1 = new Polygon(); p1.addPoint(10, 23); p1.addPoint(12, -31); NatCubicClosed cc = new NatCubicClosed(); Assert.assertNotNull(cc.getSourcePolygon()); Assert.assertNull(cc.getResult()); Exception ex = null; try { cc.calcualteAndSaveResult(); } catch (Exception eex) { ex = eex; } Assert.assertNotNull(ex); Assert.assertNull(cc.getResult()); Assert.assertTrue(cc.isWithPoints()); cc.setSourcePolygon(p1); Assert.assertNotNull(cc.getSourcePolygon()); Assert.assertEquals(p1, cc.getSourcePolygon()); Assert.assertNull(cc.getResult()); cc.calcualteAndSaveResult(); Assert.assertNotNull(cc.getResult()); Assert.assertTrue(cc.isWithPoints()); cc.setWithPoints(false); Assert.assertFalse(cc.isWithPoints()); cc.resetResult(); Assert.assertNull(cc.getResult()); } static int[] xs = {0, 100, 100, 0}; static int[] ys = {0, 0, 100, 1000}; static NatCubicClosed getTestInstance() { NatCubicClosed cc = new NatCubicClosed(); cc.addPoint(xs[0], ys[0]); cc.addPoint(xs[1], ys[1]); cc.addPoint(xs[2], ys[2]); cc.addPoint(xs[3], ys[3]); return cc; } @Test public void basicComputation() { NatCubicClosed b = new NatCubicClosed(); b.addPoint(10, 10); b.addPoint(50, 20); b.addPoint(-10, -10); b.calcualteAndSaveResult(); Assert.assertTrue(b.pts.npoints < b.result.npoints / 5); Assert.assertEquals(b.result.xpoints[0], b.result.xpoints[b.result.npoints - 1]); Assert.assertEquals(b.result.ypoints[0], b.result.ypoints[b.result.npoints - 1]); } @Test public void addPoint() { NatCubicClosed cc = new NatCubicClosed(); Assert.assertEquals(0, cc.getSourcePolygon().npoints); Assert.assertNull(cc.getResult()); Exception ex = null; try { cc.calcualteAndSaveResult(); } catch (Exception eex) { ex = eex; } Assert.assertNotNull(ex); Assert.assertNull(cc.getResult()); cc.addPoint(10, 10); Assert.assertEquals(1, cc.getSourcePolygon().npoints); Assert.assertNull(cc.getResult()); ex = null; try { cc.calcualteAndSaveResult(); } catch (Exception eex) { ex = eex; } Assert.assertNotNull(ex); Assert.assertNull(cc.getResult()); cc.addPoint(10, 10); Assert.assertEquals(2, cc.getSourcePolygon().npoints); Assert.assertNull(cc.getResult()); cc.calcualteAndSaveResult(); Assert.assertNotNull(cc.getResult()); cc.addPoint(100, 100); Assert.assertEquals(3, cc.getSourcePolygon().npoints); Assert.assertNull(cc.getResult()); cc.calcualteAndSaveResult(); Assert.assertNotNull(cc.getResult()); } @Test public void setPointTest1() { NatCubicClosed cc = getTestInstance(); Assert.assertEquals(4, cc.getSourcePolygon().npoints); for (int i = 0; i < 4; i++) { Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]); Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]); } Assert.assertNull(cc.getResult()); cc.calcualteAndSaveResult(); Assert.assertNotNull(cc.getResult()); cc.setSelection(-1); cc.setPoint(10, 10); Assert.assertEquals(4, cc.getSourcePolygon().npoints); for (int i = 0; i < 4; i++) { Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]); Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]); } Assert.assertNotNull(cc.getResult()); cc.setSelection(4); cc.setPoint(10, 10); Assert.assertEquals(4, cc.getSourcePolygon().npoints); for (int i = 0; i < 4; i++) { Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]); Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]); } Assert.assertNotNull(cc.getResult()); cc.setSelection(3); cc.setPoint(10, 20); Assert.assertEquals(4, cc.getSourcePolygon().npoints); for (int i = 0; i < 3; i++) { Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]); Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]); } Assert.assertNull(cc.getResult()); cc.calcualteAndSaveResult(); Assert.assertNotNull(cc.getResult()); Assert.assertEquals(20, cc.getSourcePolygon().ypoints[3]); Assert.assertEquals(10, cc.getSourcePolygon().xpoints[3]); } @Test public void removePoint2() { NatCubicClosed cc = getTestInstance(); Assert.assertEquals(4, cc.getSourcePolygon().npoints); for (int i = 0; i < 4; i++) { Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]); Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]); } Assert.assertNull(cc.getResult()); cc.calcualteAndSaveResult(); Assert.assertNotNull(cc.getResult()); cc.removePoint(-1); Assert.assertEquals(4, cc.getSourcePolygon().npoints); for (int i = 0; i < 4; i++) { Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]); Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]); } Assert.assertNotNull(cc.getResult()); cc.calcualteAndSaveResult(); Assert.assertNotNull(cc.getResult()); cc.removePoint(4); Assert.assertEquals(4, cc.getSourcePolygon().npoints); for (int i = 0; i < 4; i++) { Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]); Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]); } Assert.assertNotNull(cc.getResult()); cc.calcualteAndSaveResult(); Assert.assertNotNull(cc.getResult()); cc.removePoint(3); Assert.assertEquals(3, cc.getSourcePolygon().npoints); for (int i = 0; i < 3; i++) { Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]); Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]); } Assert.assertNull(cc.getResult()); cc.calcualteAndSaveResult(); Assert.assertNotNull(cc.getResult()); } public void removePoint1() { NatCubicClosed cc = getTestInstance(); Assert.assertEquals(4, cc.getSourcePolygon().npoints); for (int i = 0; i < 4; i++) { Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]); Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]); } Assert.assertNull(cc.getResult()); cc.calcualteAndSaveResult(); Assert.assertNotNull(cc.getResult()); cc.setSelection(-1); cc.removePoint(); Assert.assertEquals(4, cc.getSourcePolygon().npoints); for (int i = 0; i < 4; i++) { Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]); Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]); } Assert.assertNotNull(cc.getResult()); cc.calcualteAndSaveResult(); Assert.assertNotNull(cc.getResult()); cc.setSelection(4); cc.removePoint(); Assert.assertEquals(4, cc.getSourcePolygon().npoints); for (int i = 0; i < 4; i++) { Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]); Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]); } Assert.assertNotNull(cc.getResult()); cc.calcualteAndSaveResult(); Assert.assertNotNull(cc.getResult()); cc.setSelection(0); cc.removePoint(); Assert.assertEquals(3, cc.getSourcePolygon().npoints); for (int i = 0; i < 3; i++) { Assert.assertEquals(ys[i + 1], cc.getSourcePolygon().ypoints[i]); Assert.assertEquals(xs[i + 1], cc.getSourcePolygon().xpoints[i]); } Assert.assertNull(cc.getResult()); cc.calcualteAndSaveResult(); Assert.assertNotNull(cc.getResult()); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/Pa0000644000000000000000000000033012654402377030555 xustar00127 path=icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/MovingTextTest.java 30 mtime=1454507263.216432861 30 atime=1454507327.202579497 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/Mo0000644000175000002070000001412512654402377034026 0ustar00jvanekmock00000000000000/* MovingTextTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012; import net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012.MovingText; import java.awt.Color; import java.awt.Font; import java.awt.Graphics2D; import java.awt.image.BufferedImage; import org.junit.Assert; import org.junit.Test; public class MovingTextTest { @Test public void setGetTest() { BufferedImage bi = new BufferedImage(100, 100, BufferedImage.TYPE_INT_ARGB); Graphics2D g2d = bi.createGraphics(); Font f1 = g2d.getFont().deriveFont(Font.ITALIC); Font f2 = g2d.getFont().deriveFont(Font.BOLD); String s = "Watter"; MovingText tw = new MovingText(s, f1); Assert.assertEquals(-1, tw.getHeight()); Assert.assertEquals(-1, tw.getWidth()); Assert.assertEquals(f1, tw.getFont()); Assert.assertNull(tw.getImg()); Assert.assertEquals(s, tw.getText()); Assert.assertEquals(Color.BLACK, tw.getTextOutline()); Assert.assertEquals(Color.blue, tw.getWaterColor()); Assert.assertEquals(Color.white, tw.getBgColor()); Assert.assertEquals(0, tw.getPercentageOfWater()); tw.setBgColor(Color.yellow); tw.setWaterColor(Color.orange); tw.setPercentageOfWater(20); Assert.assertEquals(Color.orange, tw.getWaterColor()); Assert.assertEquals(Color.yellow, tw.getBgColor()); Assert.assertEquals(20, tw.getPercentageOfWater()); } private static int getAvgColor(Color c) { Assert.assertEquals(c.getRed(), c.getBlue()); Assert.assertEquals(c.getRed(), c.getGreen()); return c.getRed(); } private static int getAvgColor(int i) { return getAvgColor(new Color(i)); } private static int getAvgColor(BufferedImage m, int x, int y) { return getAvgColor(m.getRGB(x, y)); } @Test public void getBackground() { MovingText ifc = getInstance(); BufferedImage bic = ifc.getBackground(); int w = bic.getWidth(); int h = bic.getHeight(); ifc.setPercentageOfWater(0); bic = ifc.getBackground(); Assert.assertTrue(getAvgColor(bic, 3 * w / 4, h / 2) > getAvgColor(bic, 2 * w / 4, h / 2)); Assert.assertTrue(getAvgColor(bic, w / 4, h / 2) < getAvgColor(bic, 2 * w / 4, h / 2)); Assert.assertEquals(new Color(bic.getRGB(w - w / 4, 2 * h / 3)), new Color(bic.getRGB(w - w / 4, h / 3))); ifc.setPercentageOfWater(w / 2); bic = ifc.getBackground(); Assert.assertTrue(getAvgColor(bic, 3 * w / 4, h / 2) > getAvgColor(bic, 2 * w / 4, h / 2)); Assert.assertTrue(getAvgColor(bic, w / 4, h / 2) > getAvgColor(bic, 2 * w / 4, h / 2)); Assert.assertEquals(new Color(bic.getRGB(w - w / 3, 2 * h / 3)), new Color(bic.getRGB(w - w / 3, h / 3))); ifc.setPercentageOfWater(w); bic = ifc.getBackground(); Assert.assertTrue(getAvgColor(bic, 3 * w / 4, h / 2) < getAvgColor(bic, 2 * w / 4, h / 2)); Assert.assertTrue(getAvgColor(bic, w / 4, h / 2) > getAvgColor(bic, 2 * w / 4, h / 2)); Assert.assertEquals(new Color(bic.getRGB(w - w / 4, h / 3)), new Color(bic.getRGB(w - w / 4, h / 2))); } private MovingText getInstance() { BufferedImage bi1 = new BufferedImage(10, 10, BufferedImage.TYPE_INT_ARGB); Font f = bi1.createGraphics().getFont().deriveFont(Font.BOLD, 130); MovingText ifc = new MovingText("O O", f); return ifc; } private static void assertNotEquals(Object o1, Object o2) { Assert.assertFalse(o1.equals(o2)); } @Test public void cutToTest() { MovingText ifc = getInstance(); BufferedImage bic = ifc.getBackground(); int w = bic.getWidth(); int h = bic.getHeight(); bic = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB); ifc.cutTo(bic.createGraphics(), 0, h); Color cc = new Color(0, 0, 0); assertNotEquals(cc, new Color(bic.getRGB(52, 142))); assertNotEquals(cc, new Color(bic.getRGB(170, 110))); assertNotEquals(cc, new Color(bic.getRGB(52, 62))); assertNotEquals(cc, new Color(bic.getRGB(245, 85))); //well this should be acctually rgba 0,0,0,0 but somehow this was no passig //you can confirm with: //ImageFontCutterTest.save(bic, "halfFiledOus") Assert.assertEquals(cc, new Color(bic.getRGB(137, 127))); Assert.assertEquals(cc, new Color(bic.getRGB(137, 2))); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/Pa0000644000000000000000000000033212654402377030557 xustar00129 path=icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/ErrorPainterTest.java 30 mtime=1454507263.215432874 30 atime=1454507327.202579497 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/Er0000644000175000002070000001116412654402377034021 0ustar00jvanekmock00000000000000/* ErrorPainterTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012; import net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012.ErrorPainter; import java.awt.Color; import java.awt.image.BufferedImage; import net.sourceforge.jnlp.splashscreen.SplashUtils.SplashReason; import net.sourceforge.jnlp.splashscreen.impls.DefaultSplashScreen2012; import org.junit.Assert; import org.junit.Test; public final class ErrorPainterTest { @Test public void interpolTest() { Assert.assertEquals(15, ErrorPainter.interpol(4, 2, 10, 20), 0.1d); Assert.assertEquals(-15, ErrorPainter.interpol(4, 2, -20, -10), 0.1d); Assert.assertEquals(30, ErrorPainter.interpol(2, 4, 10, 20), 0.1d); } @Test public void interpolColorTest() { Color c1 = new Color(0, 0, 0); Color c2 = new Color(200, 200, 200); Color c3 = new Color(100, 100, 100); Color c4 = ErrorPainter.interpolateColor(4, 2, c1, c2); Assert.assertEquals(c3, c4); } // public static void main(String[] a) { // Color c1 = new Color(250, 50, 0, 50); // Color c2 = new Color(0, 0, 250, 100); // for (int i = 0; i < 21; i++) { // Color q = ErrorPainter.interpolateColor(20, i, c1, c2); // System.out.println(q.toString()); // System.out.println(q.getAlpha()); // } // } @Test public void adjustForSizeTest() { ErrorPainter bp = new ErrorPainter(new DefaultSplashScreen2012(100, 100, SplashReason.APPLET)); bp.master.setSplashHeight(100); bp.master.setSplashWidth(100); bp.adjustForSize(100, 100); Assert.assertNotNull(bp.prerenderedStuff); BufferedImage i1 = bp.prerenderStill(); Assert.assertEquals(100, i1.getWidth()); Assert.assertEquals(100, i1.getHeight()); bp.adjustForSize(20, 20); Assert.assertNotNull(bp.prerenderedStuff); Assert.assertEquals(20, bp.prerenderedStuff.getWidth()); Assert.assertEquals(20, bp.prerenderedStuff.getHeight()); Assert.assertFalse(i1.getWidth() == bp.prerenderedStuff.getWidth()); Assert.assertFalse(i1.getHeight() == bp.prerenderedStuff.getHeight()); } @Test public void adjustForSizeTest2() { ErrorPainter bp = new ErrorPainter(new DefaultSplashScreen2012(0, 0, SplashReason.APPLET), false); Assert.assertNull(bp.prerenderedStuff); bp.master.setSplashHeight(10); bp.master.setSplashWidth(10); BufferedImage i1 = bp.prerenderStill(); Assert.assertEquals(10, i1.getWidth()); Assert.assertEquals(10, i1.getHeight()); bp.adjustForSize(20, 20); Assert.assertNotNull(bp.prerenderedStuff); Assert.assertEquals(20, bp.prerenderedStuff.getWidth()); Assert.assertEquals(20, bp.prerenderedStuff.getHeight()); Assert.assertFalse(i1.getWidth() == bp.prerenderedStuff.getWidth()); Assert.assertFalse(i1.getHeight() == bp.prerenderedStuff.getHeight()); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/Pa0000644000000000000000000000032312654402377030557 xustar00122 path=icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/CubicTest.java 30 mtime=1454507263.215432874 30 atime=1454507327.202579497 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/Cu0000644000175000002070000000455612654402377034031 0ustar00jvanekmock00000000000000/* CubicTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012; import net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012.Cubic; import org.junit.Assert; import org.junit.Test; /** this class represents a cubic polynomial */ /* Part of NatCubic implementation, inspire by http://www.cse.unsw.edu.au/~lambert/*/ public class CubicTest { @Test public void cubicTest() { Cubic c1 = new Cubic(1, 2, 3, 4); Assert.assertTrue(new Float(1).equals(c1.a)); Assert.assertTrue(new Float(2).equals(c1.b)); Assert.assertTrue(new Float(3).equals(c1.c)); Assert.assertTrue(new Float(4).equals(c1.d)); Assert.assertTrue(new Float(586).equals(c1.eval(5))); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/Pa0000644000000000000000000000033212654402377030557 xustar00129 path=icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/ControlCurveTest.java 30 mtime=1454507263.215432874 30 atime=1454507327.202579497 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/Co0000644000175000002070000003017412654402377034016 0ustar00jvanekmock00000000000000/* ControlCurveTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012; /** This class represents a curve defined by a sequence of control points */ /* Part of NatCubic implementation, inspire by http://www.cse.unsw.edu.au/~lambert/*/ import net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012.ControlCurve; import java.awt.*; import org.junit.Assert; import org.junit.Test; public class ControlCurveTest { @Test public void setGetTests() { Polygon p1 = new Polygon(); Polygon p2 = new Polygon(); Polygon p3 = new Polygon(); ControlCurve cc = new ControlCurve(); Assert.assertNotNull(cc.getSourcePolygon()); Assert.assertNull(cc.getResult()); cc.calcualteAndSaveResult(); Assert.assertNull(cc.getResult()); Assert.assertTrue(cc.isWithPoints()); cc.setSourcePolygon(p1); Assert.assertNotNull(cc.getSourcePolygon()); Assert.assertEquals(p1, cc.getSourcePolygon()); Assert.assertNull(cc.getResult()); cc.calcualteAndSaveResult(); Assert.assertNull(cc.getResult()); Assert.assertTrue(cc.isWithPoints()); cc.setWithPoints(false); Assert.assertFalse(cc.isWithPoints()); cc = new ControlCurve(p2); Assert.assertNotNull(cc.getSourcePolygon()); Assert.assertEquals(p2, cc.getSourcePolygon()); Assert.assertNull(cc.getResult()); cc.calcualteAndSaveResult(); Assert.assertNull(cc.getResult()); cc.setWithPoints(false); Assert.assertFalse(cc.isWithPoints()); cc.setSourcePolygon(p3); Assert.assertNotNull(cc.getSourcePolygon()); Assert.assertEquals(p3, cc.getSourcePolygon()); Assert.assertNull(cc.getResult()); cc.calcualteAndSaveResult(); Assert.assertNull(cc.getResult()); cc.setWithPoints(false); Assert.assertFalse(cc.isWithPoints()); cc.setWithPoints(true); Assert.assertTrue(cc.isWithPoints()); } @Test public void sqrTest() { Assert.assertEquals(25, ControlCurve.sqr(5)); } static int[] xs = {0, 100, 100, 0}; static int[] ys = {0, 0, 100, 1000}; static ControlCurve getTestInstance() { ControlCurve cc = new ControlCurve(); cc.addPoint(xs[0], ys[0]); cc.addPoint(xs[1], ys[1]); cc.addPoint(xs[2], ys[2]); cc.addPoint(xs[3], ys[3]); return cc; } @Test public void selectPointTest() { ControlCurve cc = getTestInstance(); int i = cc.selectPoint(-50, -50); Assert.assertEquals(-1, i); i = cc.selectPoint(-3, 3); Assert.assertEquals(0, i); i = cc.selectPoint(97, 97); Assert.assertEquals(2, i); i = cc.selectPoint(100, 50); Assert.assertEquals(-1, i); } @Test public void addPoint() { ControlCurve cc = new ControlCurve(); Assert.assertEquals(0, cc.getSourcePolygon().npoints); Assert.assertNull(cc.getResult()); cc.calcualteAndSaveResult(); Assert.assertNull(cc.getResult()); cc.addPoint(10, 10); Assert.assertEquals(1, cc.getSourcePolygon().npoints); Assert.assertNull(cc.getResult()); cc.calcualteAndSaveResult(); Assert.assertNull(cc.getResult()); cc.addPoint(10, 10); Assert.assertEquals(2, cc.getSourcePolygon().npoints); Assert.assertNull(cc.getResult()); cc.calcualteAndSaveResult(); Assert.assertNull(cc.getResult()); cc.addPoint(100, 100); Assert.assertEquals(3, cc.getSourcePolygon().npoints); Assert.assertNull(cc.getResult()); cc.calcualteAndSaveResult(); Assert.assertNull(cc.getResult()); } @Test public void setPointTest1() { ControlCurve cc = getTestInstance(); Assert.assertEquals(4, cc.getSourcePolygon().npoints); for (int i = 0; i < 4; i++) { Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]); Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]); } Assert.assertNull(cc.getResult()); cc.calcualteAndSaveResult(); Assert.assertNull(cc.getResult()); cc.setSelection(-1); cc.setPoint(10, 10); Assert.assertEquals(4, cc.getSourcePolygon().npoints); for (int i = 0; i < 4; i++) { Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]); Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]); } Assert.assertNull(cc.getResult()); cc.setSelection(4); cc.setPoint(10, 10); Assert.assertEquals(4, cc.getSourcePolygon().npoints); for (int i = 0; i < 4; i++) { Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]); Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]); } Assert.assertNull(cc.getResult()); cc.setSelection(3); cc.setPoint(10, 20); Assert.assertEquals(4, cc.getSourcePolygon().npoints); for (int i = 0; i < 3; i++) { Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]); Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]); } Assert.assertNull(cc.getResult()); cc.calcualteAndSaveResult(); Assert.assertNull(cc.getResult()); Assert.assertEquals(20, cc.getSourcePolygon().ypoints[3]); Assert.assertEquals(10, cc.getSourcePolygon().xpoints[3]); } @Test public void setPointTest2() { ControlCurve cc = getTestInstance(); Assert.assertEquals(4, cc.getSourcePolygon().npoints); for (int i = 0; i < 4; i++) { Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]); Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]); } Assert.assertNull(cc.getResult()); cc.calcualteAndSaveResult(); Assert.assertNull(cc.getResult()); cc.setPoint(-1, 10, 10); Assert.assertEquals(4, cc.getSourcePolygon().npoints); for (int i = 0; i < 4; i++) { Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]); Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]); } Assert.assertNull(cc.getResult()); cc.setPoint(4, 10, 10); Assert.assertEquals(4, cc.getSourcePolygon().npoints); for (int i = 0; i < 4; i++) { Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]); Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]); } Assert.assertNull(cc.getResult()); cc.setPoint(3, 10, 20); Assert.assertEquals(4, cc.getSourcePolygon().npoints); for (int i = 0; i < 3; i++) { Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]); Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]); } Assert.assertNull(cc.getResult()); cc.calcualteAndSaveResult(); Assert.assertNull(cc.getResult()); Assert.assertEquals(20, cc.getSourcePolygon().ypoints[3]); Assert.assertEquals(10, cc.getSourcePolygon().xpoints[3]); } @Test public void removePoint2() { ControlCurve cc = getTestInstance(); Assert.assertEquals(4, cc.getSourcePolygon().npoints); for (int i = 0; i < 4; i++) { Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]); Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]); } Assert.assertNull(cc.getResult()); cc.calcualteAndSaveResult(); Assert.assertNull(cc.getResult()); cc.removePoint(-1); Assert.assertEquals(4, cc.getSourcePolygon().npoints); for (int i = 0; i < 4; i++) { Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]); Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]); } Assert.assertNull(cc.getResult()); cc.calcualteAndSaveResult(); Assert.assertNull(cc.getResult()); cc.removePoint(4); Assert.assertEquals(4, cc.getSourcePolygon().npoints); for (int i = 0; i < 4; i++) { Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]); Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]); } Assert.assertNull(cc.getResult()); cc.calcualteAndSaveResult(); Assert.assertNull(cc.getResult()); cc.removePoint(3); Assert.assertEquals(3, cc.getSourcePolygon().npoints); for (int i = 0; i < 3; i++) { Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]); Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]); } Assert.assertNull(cc.getResult()); cc.calcualteAndSaveResult(); Assert.assertNull(cc.getResult()); } public void removePoint1() { ControlCurve cc = getTestInstance(); Assert.assertEquals(4, cc.getSourcePolygon().npoints); for (int i = 0; i < 4; i++) { Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]); Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]); } Assert.assertNull(cc.getResult()); cc.calcualteAndSaveResult(); Assert.assertNull(cc.getResult()); cc.setSelection(-1); cc.removePoint(); Assert.assertEquals(4, cc.getSourcePolygon().npoints); for (int i = 0; i < 4; i++) { Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]); Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]); } Assert.assertNull(cc.getResult()); cc.calcualteAndSaveResult(); Assert.assertNull(cc.getResult()); cc.setSelection(4); cc.removePoint(); Assert.assertEquals(4, cc.getSourcePolygon().npoints); for (int i = 0; i < 4; i++) { Assert.assertEquals(ys[i], cc.getSourcePolygon().ypoints[i]); Assert.assertEquals(xs[i], cc.getSourcePolygon().xpoints[i]); } Assert.assertNull(cc.getResult()); cc.calcualteAndSaveResult(); Assert.assertNull(cc.getResult()); cc.setSelection(0); cc.removePoint(); Assert.assertEquals(3, cc.getSourcePolygon().npoints); for (int i = 0; i < 3; i++) { Assert.assertEquals(ys[i + 1], cc.getSourcePolygon().ypoints[i]); Assert.assertEquals(xs[i + 1], cc.getSourcePolygon().xpoints[i]); } Assert.assertNull(cc.getResult()); cc.calcualteAndSaveResult(); Assert.assertNull(cc.getResult()); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/Pa0000644000000000000000000000033112654402377030556 xustar00128 path=icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/BasePainterTest.java 30 mtime=1454507263.215432874 30 atime=1454507327.202579497 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/Ba0000644000175000002070000001271412654402377033777 0ustar00jvanekmock00000000000000/* BasePainterTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012; import net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012.BasePainter; import java.awt.image.BufferedImage; import net.sourceforge.jnlp.splashscreen.SplashUtils.SplashReason; import net.sourceforge.jnlp.splashscreen.impls.DefaultSplashScreen2012; import org.junit.Assert; import org.junit.Test; public class BasePainterTest { @Test public void scaleTest() { Assert.assertEquals(10, BasePainter.scale(2, 4, 5), 0.1d); Assert.assertEquals(4, BasePainter.scale(4, 2, 8), 0.1d); } @Test public void getRatioTest() { Assert.assertEquals(2, BasePainter.getRatio(2, 4), 0.1d); Assert.assertEquals(0.5, BasePainter.getRatio(4, 2), 0.1d); } @Test public void incLevel2Test() { BasePainter bp = new BasePainter(new DefaultSplashScreen2012(100, 100, SplashReason.APPLET)); int l1 = bp.getWaterLevel(); int l2 = bp.getAnimationsPosition(); bp.increaseAnimationPosition(); Assert.assertFalse(l2 == bp.getAnimationsPosition()); Assert.assertTrue(l1 == bp.getWaterLevel()); } @Test public void adjustForSizeTest() { BasePainter bp = new BasePainter(new DefaultSplashScreen2012(100, 100, SplashReason.APPLET)); bp.adjustForSize(100, 100); Assert.assertNotNull(bp.prerenderedStuff); BufferedImage i1 = bp.prerenderStill(); Assert.assertEquals(100, i1.getWidth()); Assert.assertEquals(100, i1.getHeight()); bp.adjustForSize(20, 20); Assert.assertNotNull(bp.prerenderedStuff); Assert.assertEquals(20, bp.prerenderedStuff.getWidth()); Assert.assertEquals(20, bp.prerenderedStuff.getHeight()); Assert.assertFalse(i1.getWidth() == bp.prerenderedStuff.getWidth()); Assert.assertFalse(i1.getHeight() == bp.prerenderedStuff.getHeight()); } @Test public void adjustForSizeTest2() { BasePainter bp = new BasePainter(new DefaultSplashScreen2012(0, 0, SplashReason.APPLET), false); Assert.assertNull(bp.prerenderedStuff); bp.master.setSplashHeight(10); bp.master.setSplashWidth(10); BufferedImage i1 = bp.prerenderStill(); Assert.assertEquals(10, i1.getWidth()); Assert.assertEquals(10, i1.getHeight()); bp.adjustForSize(20, 20); Assert.assertNotNull(bp.prerenderedStuff); Assert.assertEquals(20, bp.prerenderedStuff.getWidth()); Assert.assertEquals(20, bp.prerenderedStuff.getHeight()); Assert.assertFalse(i1.getWidth() == bp.prerenderedStuff.getWidth()); Assert.assertFalse(i1.getHeight() == bp.prerenderedStuff.getHeight()); } @Test public void stripCommitFromVersion() { Assert.assertEquals("1.4", BasePainter.stripCommitFromVersion("1.4")); Assert.assertEquals("1.4.2", BasePainter.stripCommitFromVersion("1.4.2")); Assert.assertEquals("1.4pre", BasePainter.stripCommitFromVersion("1.4pre")); Assert.assertEquals("1.4", BasePainter.stripCommitFromVersion("1.4+657tgkhyu4iy5")); Assert.assertEquals("1.4.2", BasePainter.stripCommitFromVersion("1.4.2+887tgjh07tftvhjj")); Assert.assertEquals("1.4pre+0977tyugg", BasePainter.stripCommitFromVersion("1.4pre+0977tyugg")); Assert.assertEquals("1.4pre+", BasePainter.stripCommitFromVersion("1.4pre+")); Assert.assertEquals("1.4pre+foo+", BasePainter.stripCommitFromVersion("1.4pre+foo+")); Assert.assertEquals("1.4pre+foo+bar", BasePainter.stripCommitFromVersion("1.4pre+foo+bar")); Assert.assertEquals("1.4", BasePainter.stripCommitFromVersion("1.4+")); Assert.assertEquals("1.4", BasePainter.stripCommitFromVersion("1.4+foo+")); Assert.assertEquals("1.4", BasePainter.stripCommitFromVersion("1.4+foo+bar")); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/PaxHeaders.17941/SplashUtilsTest0000644000000000000000000000013012654402377030346 xustar0030 mtime=1454507263.214432888 29 atime=1454507327.20157951 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/SplashUtilsTest.java0000644000175000002070000002530612654402377032021 0ustar00jvanekmock00000000000000/* SplashUtils.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.splashscreen; import java.lang.reflect.Field; import java.util.Collections; import java.util.HashMap; import java.util.Map; import net.sourceforge.jnlp.runtime.AppletEnvironment; import net.sourceforge.jnlp.runtime.AppletInstance; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.splashscreen.impls.*; import org.junit.Assert; import org.junit.Test; public class SplashUtilsTest { @Test public void determineCallerTest() { modifyRuntime(false); SplashPanel p1 = SplashUtils.getSplashScreen(100, 100); Assert.assertEquals(SplashUtils.SplashReason.APPLET, p1.getSplashReason()); modifyRuntime(true); SplashPanel p2 = SplashUtils.getSplashScreen(100, 100); Assert.assertEquals(SplashUtils.SplashReason.JAVAWS, p2.getSplashReason()); } @SuppressWarnings("unchecked") public static Map getEnvironment() throws Exception { Class[] classes = Collections.class.getDeclaredClasses(); Map env = System.getenv(); for (Class cl : classes) { if ("java.util.Collections$UnmodifiableMap".equals(cl.getName())) { Field field = cl.getDeclaredField("m"); field.setAccessible(true); Object obj = field.get(env); Map map = (Map) obj; return map; } } return null; } @SuppressWarnings("unchecked") public static void fakeEnvironment(Map newenv) throws Exception { Class[] classes = Collections.class.getDeclaredClasses(); Map env = System.getenv(); for (Class cl : classes) { if ("java.util.Collections$UnmodifiableMap".equals(cl.getName())) { Field field = cl.getDeclaredField("m"); field.setAccessible(true); Object obj = field.get(env); Map map = (Map) obj; map.clear(); map.putAll(newenv); } } } @Test public void testGetSplashScreen1() throws Exception { Map fake1 = new HashMap(); Map original = getEnvironment(); Assert.assertNotNull(original); try { fakeEnvironment(fake1); SplashPanel sa = SplashUtils.getSplashScreen(100, 100, SplashUtils.SplashReason.APPLET); Assert.assertTrue(sa instanceof DefaultSplashScreen2012); Assert.assertTrue(sa.getSplashReason() == SplashUtils.SplashReason.APPLET); SplashPanel sw = SplashUtils.getSplashScreen(100, 100, SplashUtils.SplashReason.JAVAWS); Assert.assertTrue(sw instanceof DefaultSplashScreen2012); Assert.assertTrue(sw.getSplashReason() == SplashUtils.SplashReason.JAVAWS); } finally { fakeEnvironment(original); } } @Test public void testGetSplashScreen2() throws Exception { Map fake1 = new HashMap(); fake1.put(SplashUtils.ICEDTEA_WEB_SPLASH, SplashUtils.DEFAULT); fake1.put(SplashUtils.ICEDTEA_WEB_PLUGIN_SPLASH, SplashUtils.DEFAULT); Map original = getEnvironment(); Assert.assertNotNull(original); try { fakeEnvironment(fake1); SplashPanel sa = SplashUtils.getSplashScreen(100, 100, SplashUtils.SplashReason.APPLET); Assert.assertTrue(sa instanceof DefaultSplashScreen2012); Assert.assertTrue(sa.getSplashReason() == SplashUtils.SplashReason.APPLET); SplashPanel sw = SplashUtils.getSplashScreen(100, 100, SplashUtils.SplashReason.JAVAWS); Assert.assertTrue(sw instanceof DefaultSplashScreen2012); Assert.assertTrue(sw.getSplashReason() == SplashUtils.SplashReason.JAVAWS); } finally { fakeEnvironment(original); } } @Test public void testGetSplashScreen3() throws Exception { Map fake1 = new HashMap(); fake1.put(SplashUtils.ICEDTEA_WEB_SPLASH, SplashUtils.NONE); fake1.put(SplashUtils.ICEDTEA_WEB_PLUGIN_SPLASH, SplashUtils.DEFAULT); Map original = getEnvironment(); Assert.assertNotNull(original); try { fakeEnvironment(fake1); SplashPanel sa = SplashUtils.getSplashScreen(100, 100, SplashUtils.SplashReason.APPLET); Assert.assertTrue(sa instanceof DefaultSplashScreen2012); Assert.assertTrue(sa.getSplashReason() == SplashUtils.SplashReason.APPLET); SplashPanel sw = SplashUtils.getSplashScreen(100, 100, SplashUtils.SplashReason.JAVAWS); Assert.assertTrue(sw == null); } finally { fakeEnvironment(original); } } @Test public void testGetSplashScreen4() throws Exception { Map fake1 = new HashMap(); fake1.put(SplashUtils.ICEDTEA_WEB_SPLASH, SplashUtils.DEFAULT); fake1.put(SplashUtils.ICEDTEA_WEB_PLUGIN_SPLASH, SplashUtils.NONE); Map original = getEnvironment(); Assert.assertNotNull(original); try { fakeEnvironment(fake1); SplashPanel sa = SplashUtils.getSplashScreen(100, 100, SplashUtils.SplashReason.APPLET); Assert.assertTrue(sa == null); SplashPanel sw = SplashUtils.getSplashScreen(100, 100, SplashUtils.SplashReason.JAVAWS); Assert.assertTrue(sw instanceof DefaultSplashScreen2012); Assert.assertTrue(sw.getSplashReason() == SplashUtils.SplashReason.JAVAWS); } finally { fakeEnvironment(original); } } @Test public void testGetSplashScreen5() throws Exception { Map fake1 = new HashMap(); fake1.put(SplashUtils.ICEDTEA_WEB_SPLASH, SplashUtils.NONE); fake1.put(SplashUtils.ICEDTEA_WEB_PLUGIN_SPLASH, SplashUtils.NONE); Map original = getEnvironment(); Assert.assertNotNull(original); try { fakeEnvironment(fake1); SplashPanel sa = SplashUtils.getSplashScreen(100, 100, SplashUtils.SplashReason.APPLET); Assert.assertTrue(sa == null); SplashPanel sw = SplashUtils.getSplashScreen(100, 100, SplashUtils.SplashReason.JAVAWS); Assert.assertTrue(sw == null); } finally { fakeEnvironment(original); } } @Test public void testGetSplashScreen6() throws Exception { Map fake1 = new HashMap(); fake1.put(SplashUtils.ICEDTEA_WEB_SPLASH, SplashUtils.DEFAULT); fake1.put(SplashUtils.ICEDTEA_WEB_PLUGIN_SPLASH, "fgdthyfjtuk"); Map original = getEnvironment(); Assert.assertNotNull(original); try { fakeEnvironment(fake1); SplashPanel sa = SplashUtils.getSplashScreen(100, 100, SplashUtils.SplashReason.APPLET); Assert.assertTrue(sa instanceof DefaultSplashScreen2012); Assert.assertTrue(sa.getSplashReason() == SplashUtils.SplashReason.APPLET); SplashPanel sw = SplashUtils.getSplashScreen(100, 100, SplashUtils.SplashReason.JAVAWS); Assert.assertTrue(sw instanceof DefaultSplashScreen2012); Assert.assertTrue(sw.getSplashReason() == SplashUtils.SplashReason.JAVAWS); } finally { fakeEnvironment(original); } } @Test public void testGetSplashScreen7() throws Exception { Map fake1 = new HashMap(); fake1.put(SplashUtils.ICEDTEA_WEB_SPLASH, "egtrutkyukl"); Map original = getEnvironment(); Assert.assertNotNull(original); try { fakeEnvironment(fake1); SplashPanel sa = SplashUtils.getSplashScreen(100, 100, SplashUtils.SplashReason.APPLET); Assert.assertTrue(sa instanceof DefaultSplashScreen2012); Assert.assertTrue(sa.getSplashReason() == SplashUtils.SplashReason.APPLET); SplashPanel sw = SplashUtils.getSplashScreen(100, 100, SplashUtils.SplashReason.JAVAWS); Assert.assertTrue(sw instanceof DefaultSplashScreen2012); Assert.assertTrue(sw.getSplashReason() == SplashUtils.SplashReason.JAVAWS); } finally { fakeEnvironment(original); } } static void modifyRuntime(boolean b) { try{ setStatic(JNLPRuntime.class.getDeclaredField("isWebstartApplication"), b); }catch(Exception ex){ throw new RuntimeException(ex); } } static void setStatic(Field field, Object newValue) throws Exception { field.setAccessible(true); field.set(null, newValue); } @Test public void assertNulsAreOkInShow() { SplashUtils.showError(null, (AppletEnvironment)null); SplashUtils.showError(null, (AppletInstance)null); SplashUtils.showError(null, (SplashController)null); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/PaxHeaders.17941/SplashScreenTes0000644000000000000000000000013012654402377030301 xustar0030 mtime=1454507263.214432888 29 atime=1454507327.20157951 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/SplashScreenTest.java0000644000175000002070000001610112654402377032131 0ustar00jvanekmock00000000000000/* SplashScreenTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.splashscreen; import java.awt.BorderLayout; import java.awt.event.ComponentEvent; import java.awt.event.ComponentListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.awt.image.BufferedImage; import javax.swing.JDialog; import net.sourceforge.jnlp.JNLPSplashScreen; import net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012.TextOutlineRendererTest; import net.sourceforge.jnlp.splashscreen.parts.InfoItem; import net.sourceforge.jnlp.splashscreen.parts.InformationElement; import org.junit.Assert; import org.junit.Test; public class SplashScreenTest extends JDialog { static int width = JNLPSplashScreen.DEF_WIDTH; static int height = JNLPSplashScreen.DEF_HEIGHT; static SplashPanel panel; private static boolean swap = true; private static InformationElement ie = new InformationElement(); public SplashScreenTest() { setSize(width - getInsets().left - getInsets().right, height - getInsets().bottom - getInsets().top); // Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize(); // int x = (int) ((dimension.getWidth() - getWidth()) / 2); // int y = (int) ((dimension.getHeight() - getHeight()) / 2); //setLocation(x, y); setLocationRelativeTo(null); this.pack(); panel = SplashUtils.getSplashScreen(width, height, SplashUtils.SplashReason.APPLET); ie.setHomepage("http://someones.org/amazing?page"); ie.setTitle("Testing information title"); ie.setvendor("IcedTea-Web team"); ie.addDescription("Testing null description"); ie.addDescription("tsting twoline des ...break\ncription of kind short", InfoItem.descriptionKindShort); panel.setInformationElement(ie); panel.setVersion("1.2-re45fdg"); setLayout(new BorderLayout()); getContentPane().add(panel.getSplashComponent(), BorderLayout.CENTER); addComponentListener(new ComponentListener() { @Override public void componentShown(ComponentEvent e) { } @Override public void componentResized(ComponentEvent e) { //panel.getSplashComponent().setSize(getWidth(), getHeight()); //panel.adjustForSize(getWidth(), getHeight()); } @Override public void componentMoved(ComponentEvent e) { } @Override public void componentHidden(ComponentEvent e) { } }); } @Test public void splashScreenTestsExists() { //to silence junit,and test is that thsi class was instantiated ;) Assert.assertTrue(true); } @Test public void splashScreenTestsPaint0() { //to silence junit,and test is that thsi class was instantiated ;) panel.setSplashWidth(width); panel.setSplashHeight(height); panel.adjustForSize(); BufferedImage buf = new BufferedImage(panel.getSplashWidth(), panel.getSplashHeight(), BufferedImage.TYPE_INT_ARGB); panel.setPercentage(0); panel.paintTo(buf.createGraphics()); // TextOutlineRendererTest.save(buf,"s0"); } @Test public void splashScreenTestsPaint50() { //to silence junit,and test is that thsi class was instantiated ;) panel.setSplashWidth(width); panel.setSplashHeight(height); panel.adjustForSize(); BufferedImage buf = new BufferedImage(panel.getSplashWidth(), panel.getSplashHeight(), BufferedImage.TYPE_INT_ARGB); panel.setPercentage(50); panel.paintTo(buf.createGraphics()); // TextOutlineRendererTest.save(buf,"s50"); } @Test public void splashScreenTestsPaint100() { //to silence junit,and test is that thsi class was instantiated ;) panel.setSplashWidth(width); panel.setSplashHeight(height); panel.adjustForSize(); BufferedImage buf = new BufferedImage(panel.getSplashWidth(), panel.getSplashHeight(), BufferedImage.TYPE_INT_ARGB); panel.setPercentage(100); panel.paintTo(buf.createGraphics()); // TextOutlineRendererTest.save(buf,"s100"); } public static void main(String args[]) { SplashScreenTest app = new SplashScreenTest(); app.setSize(800, 600); app.setVisible(true); app.addWindowListener( new WindowAdapter() { @Override public void windowClosing(WindowEvent e) { System.exit(0); } }); panel.startAnimation(); try { Thread.sleep(10000); } catch (Exception e) { } //not needed //panel.stopAnimation(); if (swap) { SplashErrorPanel r = SplashUtils.getErrorSplashScreen(panel.getSplashWidth(), panel.getSplashHeight(), SplashUtils.SplashReason.APPLET, null); r.setInformationElement(ie); app.remove(panel.getSplashComponent()); r.setPercentage(panel.getPercentage()); r.adjustForSize(); r.setLoadingException(new RuntimeException(":)")); panel = r; panel.setVersion("1.2-re45fdg"); app.add(panel.getSplashComponent()); app.validate(); app.pack(); app.setVisible(true); try { Thread.sleep(10000); } catch (Exception e) { } } } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/PaxHeaders.17941/ErrorSplashUtil0000644000000000000000000000013012654402377030335 xustar0030 mtime=1454507263.214432888 29 atime=1454507327.20157951 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/ErrorSplashUtilsTest.java0000644000175000002070000002235612654402377033035 0ustar00jvanekmock00000000000000/* SplashUtils.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.splashscreen; import java.util.HashMap; import java.util.Map; import net.sourceforge.jnlp.splashscreen.impls.*; import org.junit.Assert; import org.junit.Test; public class ErrorSplashUtilsTest { private void fakeEnvironment(Map original) throws Exception { SplashUtilsTest.fakeEnvironment(original); } private Map getEnvironment() throws Exception { return SplashUtilsTest.getEnvironment(); } @Test public void determineCallerTest() { SplashUtilsTest.modifyRuntime(false); SplashPanel p1 = SplashUtils.getErrorSplashScreen(100, 100,null); Assert.assertEquals(SplashUtils.SplashReason.APPLET, p1.getSplashReason()); SplashUtilsTest.modifyRuntime(true); SplashPanel p2 = SplashUtils.getErrorSplashScreen(100, 100,null); Assert.assertEquals(SplashUtils.SplashReason.JAVAWS, p2.getSplashReason()); } @Test public void testgetErrorSplashScreen1() throws Exception { Map fake1 = new HashMap(); Map original = getEnvironment(); Assert.assertNotNull(original); try { fakeEnvironment(fake1); SplashPanel sa = SplashUtils.getErrorSplashScreen(100, 100, SplashUtils.SplashReason.APPLET, null); Assert.assertTrue(sa instanceof DefaultErrorSplashScreen2012); Assert.assertTrue(sa.getSplashReason() == SplashUtils.SplashReason.APPLET); SplashPanel sw = SplashUtils.getErrorSplashScreen(100, 100, SplashUtils.SplashReason.JAVAWS, new Exception("oj")); Assert.assertTrue(sw instanceof DefaultErrorSplashScreen2012); Assert.assertTrue(sw.getSplashReason() == SplashUtils.SplashReason.JAVAWS); } finally { fakeEnvironment(original); } } @Test public void testgetErrorSplashScreen2() throws Exception { Map fake1 = new HashMap(); fake1.put(SplashUtils.ICEDTEA_WEB_SPLASH, SplashUtils.DEFAULT); fake1.put(SplashUtils.ICEDTEA_WEB_PLUGIN_SPLASH, SplashUtils.DEFAULT); Map original = getEnvironment(); Assert.assertNotNull(original); try { fakeEnvironment(fake1); SplashPanel sa = SplashUtils.getErrorSplashScreen(100, 100, SplashUtils.SplashReason.APPLET, new Exception("oj")); Assert.assertTrue(sa instanceof DefaultErrorSplashScreen2012); Assert.assertTrue(sa.getSplashReason() == SplashUtils.SplashReason.APPLET); SplashPanel sw = SplashUtils.getErrorSplashScreen(100, 100, SplashUtils.SplashReason.JAVAWS, null); Assert.assertTrue(sw instanceof DefaultErrorSplashScreen2012); Assert.assertTrue(sw.getSplashReason() == SplashUtils.SplashReason.JAVAWS); } finally { fakeEnvironment(original); } } @Test public void testgetErrorSplashScreen3() throws Exception { Map fake1 = new HashMap(); fake1.put(SplashUtils.ICEDTEA_WEB_SPLASH, SplashUtils.NONE); fake1.put(SplashUtils.ICEDTEA_WEB_PLUGIN_SPLASH, SplashUtils.DEFAULT); Map original = getEnvironment(); Assert.assertNotNull(original); try { fakeEnvironment(fake1); SplashPanel sa = SplashUtils.getErrorSplashScreen(100, 100, SplashUtils.SplashReason.APPLET, null); Assert.assertTrue(sa instanceof DefaultErrorSplashScreen2012); Assert.assertTrue(sa.getSplashReason() == SplashUtils.SplashReason.APPLET); SplashPanel sw = SplashUtils.getErrorSplashScreen(100, 100, SplashUtils.SplashReason.JAVAWS, new Exception("oj")); Assert.assertTrue(sw == null); } finally { fakeEnvironment(original); } } @Test public void testgetErrorSplashScreen4() throws Exception { Map fake1 = new HashMap(); fake1.put(SplashUtils.ICEDTEA_WEB_SPLASH, SplashUtils.DEFAULT); fake1.put(SplashUtils.ICEDTEA_WEB_PLUGIN_SPLASH, SplashUtils.NONE); Map original = getEnvironment(); Assert.assertNotNull(original); try { fakeEnvironment(fake1); SplashPanel sa = SplashUtils.getErrorSplashScreen(100, 100, SplashUtils.SplashReason.APPLET, new Exception("oj")); Assert.assertTrue(sa == null); SplashPanel sw = SplashUtils.getErrorSplashScreen(100, 100, SplashUtils.SplashReason.JAVAWS, new Exception("oj")); Assert.assertTrue(sw instanceof DefaultErrorSplashScreen2012); Assert.assertTrue(sw.getSplashReason() == SplashUtils.SplashReason.JAVAWS); } finally { fakeEnvironment(original); } } @Test public void testgetErrorSplashScreen5() throws Exception { Map fake1 = new HashMap(); fake1.put(SplashUtils.ICEDTEA_WEB_SPLASH, SplashUtils.NONE); fake1.put(SplashUtils.ICEDTEA_WEB_PLUGIN_SPLASH, SplashUtils.NONE); Map original = getEnvironment(); Assert.assertNotNull(original); try { fakeEnvironment(fake1); SplashPanel sa = SplashUtils.getErrorSplashScreen(100, 100, SplashUtils.SplashReason.APPLET, null); Assert.assertTrue(sa == null); SplashPanel sw = SplashUtils.getErrorSplashScreen(100, 100, SplashUtils.SplashReason.JAVAWS, null); Assert.assertTrue(sw == null); } finally { fakeEnvironment(original); } } @Test public void testgetErrorSplashScreen6() throws Exception { Map fake1 = new HashMap(); fake1.put(SplashUtils.ICEDTEA_WEB_SPLASH, SplashUtils.DEFAULT); fake1.put(SplashUtils.ICEDTEA_WEB_PLUGIN_SPLASH, "fgdthyfjtuk"); Map original = getEnvironment(); Assert.assertNotNull(original); try { fakeEnvironment(fake1); SplashPanel sa = SplashUtils.getErrorSplashScreen(100, 100, SplashUtils.SplashReason.APPLET, new Exception("oj")); Assert.assertTrue(sa instanceof DefaultErrorSplashScreen2012); Assert.assertTrue(sa.getSplashReason() == SplashUtils.SplashReason.APPLET); SplashPanel sw = SplashUtils.getErrorSplashScreen(100, 100, SplashUtils.SplashReason.JAVAWS, new Exception("oj")); Assert.assertTrue(sw instanceof DefaultErrorSplashScreen2012); Assert.assertTrue(sw.getSplashReason() == SplashUtils.SplashReason.JAVAWS); } finally { fakeEnvironment(original); } } @Test public void testgetErrorSplashScreen7() throws Exception { Map fake1 = new HashMap(); fake1.put(SplashUtils.ICEDTEA_WEB_SPLASH, "egtrutkyukl"); Map original = getEnvironment(); Assert.assertNotNull(original); try { fakeEnvironment(fake1); SplashPanel sa = SplashUtils.getErrorSplashScreen(100, 100, SplashUtils.SplashReason.APPLET, null); Assert.assertTrue(sa instanceof DefaultErrorSplashScreen2012); Assert.assertTrue(sa.getSplashReason() == SplashUtils.SplashReason.APPLET); SplashPanel sw = SplashUtils.getErrorSplashScreen(100, 100, SplashUtils.SplashReason.JAVAWS, null); Assert.assertTrue(sw instanceof DefaultErrorSplashScreen2012); Assert.assertTrue(sw.getSplashReason() == SplashUtils.SplashReason.JAVAWS); } finally { fakeEnvironment(original); } } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/PaxHeaders.17941/ErrorSplashScre0000644000000000000000000000013012654402377030314 xustar0030 mtime=1454507263.213432901 29 atime=1454507327.20157951 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/splashscreen/ErrorSplashScreenTest.java0000644000175000002070000001444012654402377033147 0ustar00jvanekmock00000000000000/* SplashScreenTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.splashscreen; import java.awt.BorderLayout; import java.awt.event.ComponentEvent; import java.awt.event.ComponentListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.awt.image.BufferedImage; import javax.swing.JDialog; import net.sourceforge.jnlp.JNLPSplashScreen; import net.sourceforge.jnlp.splashscreen.parts.InfoItem; import net.sourceforge.jnlp.splashscreen.parts.InformationElement; import org.junit.Assert; import org.junit.Test; public class ErrorSplashScreenTest extends JDialog { static int width = JNLPSplashScreen.DEF_WIDTH; static int height = JNLPSplashScreen.DEF_HEIGHT; static SplashErrorPanel panel; public ErrorSplashScreenTest() { setSize(width - getInsets().left - getInsets().right, height - getInsets().bottom - getInsets().top); // Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize(); // int x = (int) ((dimension.getWidth() - getWidth()) / 2); // int y = (int) ((dimension.getHeight() - getHeight()) / 2); //setLocation(x, y); setLocationRelativeTo(null); this.pack(); Exception ex = new Exception("Hi there"); panel = SplashUtils.getErrorSplashScreen(width, height, SplashUtils.SplashReason.JAVAWS, ex); InformationElement ie = new InformationElement(); ie.setHomepage("http://someones.org/amazing?page"); ie.setTitle("Testing information title"); ie.setvendor("IcedTea-Web team"); ie.addDescription("Testing null description"); ie.addDescription("tsting twoline des ...break\ncription of kind short", InfoItem.descriptionKindShort); panel.setInformationElement(ie); panel.setVersion("1.2-re45fdg"); setLayout(new BorderLayout()); getContentPane().add(panel.getSplashComponent(), BorderLayout.CENTER); addComponentListener(new ComponentListener() { @Override public void componentShown(ComponentEvent e) { } @Override public void componentResized(ComponentEvent e) { //panel.getSplashComponent().setSize(getWidth(), getHeight()); //panel.adjustForSize(getWidth(), getHeight()); } @Override public void componentMoved(ComponentEvent e) { } @Override public void componentHidden(ComponentEvent e) { } }); } @Test public void splashScreenTestsExists() { //to silence junit,and test is that thsi class was instantiated ;) Assert.assertTrue(true); } @Test public void splashScreenTestsPaint0() { //to silence junit,and test is that thsi class was instantiated ;) panel.setSplashWidth(width); panel.setSplashHeight(height); panel.adjustForSize(); BufferedImage buf = new BufferedImage(panel.getSplashWidth(), panel.getSplashHeight(), BufferedImage.TYPE_INT_ARGB); panel.setPercentage(0); panel.paintTo(buf.createGraphics()); //ImageFontCutterTest.save(buf,"e0"); } @Test public void splashScreenTestsPaint50() { //to silence junit,and test is that thsi class was instantiated ;) panel.setSplashWidth(width); panel.setSplashHeight(height); panel.adjustForSize(); BufferedImage buf = new BufferedImage(panel.getSplashWidth(), panel.getSplashHeight(), BufferedImage.TYPE_INT_ARGB); panel.setPercentage(50); panel.paintTo(buf.createGraphics()); // ImageFontCutterTest.save(buf,"e50"); } @Test public void splashScreenTestsPaint100() { //to silence junit,and test is that thsi class was instantiated ;) panel.setSplashWidth(width); panel.setSplashHeight(height); panel.adjustForSize(); BufferedImage buf = new BufferedImage(panel.getSplashWidth(), panel.getSplashHeight(), BufferedImage.TYPE_INT_ARGB); panel.setPercentage(100); panel.paintTo(buf.createGraphics()); // ImageFontCutterTest.save(buf,"e100"); } public static void main(String args[]) { ErrorSplashScreenTest app = new ErrorSplashScreenTest(); app.setSize(800, 600); app.setVisible(true); app.addWindowListener( new WindowAdapter() { @Override public void windowClosing(WindowEvent e) { System.exit(0); } }); panel.setPercentage(30); //panel.startAnimation(); try { Thread.sleep(10000); } catch (Exception e) { } panel.stopAnimation(); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.17941/security0000644000000000000000000000013112654402377024411 xustar0030 mtime=1454507263.210432941 30 atime=1454507658.776157397 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/0000755000175000002070000000000012654402377025212 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/PaxHeaders.17941/policyeditor0000644000000000000000000000013112654402377027117 xustar0030 mtime=1454507263.213432901 30 atime=1454507658.776157397 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/0000755000175000002070000000000012654402377027720 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PaxHeaders.17941/Policy0000644000000000000000000000030712654402377030363 xustar00111 path=icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PolicyFileModelTest.java 30 mtime=1454507263.213432901 29 atime=1454507327.20157951 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PolicyFileModelTest.jav0000644000175000002070000003211612654402377034305 0ustar00jvanekmock00000000000000/*Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.policyeditor; import net.sourceforge.jnlp.util.FileUtils; import org.junit.Before; import org.junit.Test; import java.io.File; import java.util.Collection; import java.util.Collections; import java.util.HashSet; import java.util.Map; import java.util.Set; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertTrue; /** * See PolicyEditorParsingTest, which covers PolicyFileModel#openAndParsePolicyFile(), * PolicyFileModel.parsePolicyString(), PolicyFileModel#savePolicyFile() */ public class PolicyFileModelTest { private String tempFilePath; private PolicyFileModel model; @Before public void setNewTempfile() throws Exception { tempFilePath = File.createTempFile("policyeditor", null).getCanonicalPath(); model = new PolicyFileModel(); model.setFile(new File(tempFilePath)); } @Test public void testSetGetFile() throws Exception { assertEquals(new File(tempFilePath), model.getFile()); } @Test public void testSetFileNull() throws Exception { model.setFile(null); assertEquals(null, model.getFile()); } @Test(expected = NullPointerException.class) public void testOpenAndParsePolicyFileWithFileNull() throws Exception { model.setFile(null); assertEquals(null, model.getFile()); model.openAndParsePolicyFile(); } @Test(expected = NullPointerException.class) public void testSavePolicyFileWithFileNull() throws Exception { model.setFile(null); assertEquals(null, model.getFile()); model.savePolicyFile(); } @Test public void testHasChangedIsFalseInitially() throws Exception { assertFalse("Model should not report changes made initially", model.hasChanged()); } @Test public void testFileHasChangedWithChange() throws Exception { assertFalse("Model should not report changes made initially", model.hasChanged()); final String codebase = "http://example.com"; final PolicyEditorPermissions editorPermissions = PolicyEditorPermissions.CLIPBOARD; final Collection permissions = Collections.singleton(editorPermissions); final CustomPermission customPermission = new CustomPermission(PermissionType.FILE_PERMISSION, PermissionTarget.USER_HOME, PermissionActions.FILE_ALL); final Collection customPermissions = Collections.singleton(customPermission); final PolicyEntry policyEntry = new PolicyEntry(codebase, permissions, customPermissions); FileUtils.saveFile(policyEntry.toString(), new File(tempFilePath)); model.openAndParsePolicyFile(); final Collection editorPermissions2 = Collections.singleton(PolicyEditorPermissions.ALL_AWT); final PolicyEntry policyEntry2 = new PolicyEntry(codebase, editorPermissions2, customPermissions); FileUtils.saveFile(policyEntry2.toString(), new File(tempFilePath)); assertTrue("File should be marked changed after being externally modified", model.hasChanged()); } @Test public void testAddCodebase() throws Exception { assertEquals("Should not have any codebases initially", Collections.emptySet(), model.getCodebases()); final String codebase = "http://example.com"; model.addCodebase(codebase); assertEquals("Should have the codebase", Collections.singleton(codebase), model.getCodebases()); } @Test public void testRemoveCodebase() throws Exception { assertEquals("Should not have any codebases initially", Collections.emptySet(), model.getCodebases()); final String codebase = "http://example.com"; model.addCodebase(codebase); assertEquals("Should have the codebase " + codebase, Collections.singleton(codebase), model.getCodebases()); model.removeCodebase(codebase); assertEquals("Should not have any codebases after removed", Collections.emptySet(), model.getCodebases()); } @Test public void testClearPermissions() throws Exception { assertEquals("Should not have any codebases initially", Collections.emptySet(), model.getCodebases()); final String codebase = "http://example.com"; model.addCodebase(codebase); final PolicyEditorPermissions permission = PolicyEditorPermissions.CLIPBOARD; model.setPermission(codebase, permission, true); assertTrue("Expected permission " + permission, model.getPermission(codebase, permission)); model.clearPermissions(); assertFalse("Expected no permission " + permission, model.getPermission(codebase, permission)); assertEquals("Expected no permissions ", Collections.emptyMap(), model.getCopyOfPermissions()); } @Test public void testSettersAndGettersForPermission() throws Exception { assertEquals("Should not have any codebases initially", Collections.emptySet(), model.getCodebases()); final String codebase = "http://example.com"; model.addCodebase(codebase); final PolicyEditorPermissions permission = PolicyEditorPermissions.CLIPBOARD; model.setPermission(codebase, permission, true); assertTrue("Expected permission " + permission, model.getPermission(codebase, permission)); } @Test public void testClearCustomCodebase() throws Exception { assertEquals("Should not have any codebases initially", Collections.emptySet(), model.getCodebases()); final String codebase = "http://example.com"; model.addCodebase(codebase); final CustomPermission customPermission = new CustomPermission(PermissionType.FILE_PERMISSION, PermissionTarget.USER_HOME, PermissionActions.FILE_ALL); final Collection customPermissions = Collections.singleton(customPermission); model.addCustomPermissions(codebase, customPermissions); assertEquals("Expected custom permission", customPermissions, model.getCopyOfCustomPermissions().get(codebase)); model.clearCustomCodebase(codebase); assertEquals("Custom permissions were expected to be empty", Collections.emptySet(), model.getCopyOfCustomPermissions().get(codebase)); } @Test public void testClearCustomPermission() throws Exception { assertEquals("Should not have any codebases initially", Collections.emptySet(), model.getCodebases()); final String codebase = "http://example.com"; model.addCodebase(codebase); final CustomPermission customPermission = new CustomPermission(PermissionType.FILE_PERMISSION, PermissionTarget.USER_HOME, PermissionActions.FILE_ALL); final Collection customPermissions = Collections.singleton(customPermission); model.addCustomPermissions(codebase, customPermissions); assertEquals("Expected custom permission", customPermissions, model.getCopyOfCustomPermissions().get(codebase)); model.clearCustomPermissions(); assertEquals("Custom permissions were expected to be empty", null, model.getCopyOfCustomPermissions().get(codebase)); assertEquals("All codebase custom permissions were expected to be empty", Collections.emptyMap(), model.getCopyOfCustomPermissions()); } @Test public void testAddCustomPermissions() throws Exception { assertEquals("Should not have any codebases initially", Collections.emptySet(), model.getCodebases()); final String codebase = "http://example.com"; model.addCodebase(codebase); final CustomPermission customPermission = new CustomPermission(PermissionType.FILE_PERMISSION, PermissionTarget.USER_HOME, PermissionActions.FILE_ALL); final Collection customPermissions = Collections.singleton(customPermission); model.addCustomPermissions(codebase, customPermissions); assertEquals("Expected file/user home/all-actions permission ", customPermissions, model.getCopyOfCustomPermissions().get(codebase)); final CustomPermission customPermission2 = new CustomPermission(PermissionType.AUDIO_PERMISSION, PermissionTarget.PLAY); final Collection customPermissions2 = Collections.singleton(customPermission2); model.addCustomPermissions(codebase, customPermissions2); assertTrue("Expected audio play permission ", model.getCopyOfCustomPermissions().get(codebase).contains(customPermission2)); final HashSet customPermissionHashSet = new HashSet<>(); customPermissionHashSet.add(customPermission); customPermissionHashSet.add(customPermission2); assertEquals("Expected custom permission ", customPermissionHashSet, model.getCopyOfCustomPermissions().get(codebase)); } @Test public void testAllPermissionsAreFalseInitially() throws Exception { assertEquals("Should not have any codebases initially", Collections.emptySet(), model.getCodebases()); final String codebase = "http://example.com"; model.addCodebase(codebase); final Map policyEditorPermissions = model.getCopyOfPermissions().get(codebase); for (final Map.Entry entry : policyEditorPermissions.entrySet()) { assertFalse("Expected " + entry.getKey() + " to be false", entry.getValue()); } } @Test public void testAllPermissionsAreInitialized() throws Exception { assertEquals("Should not have any codebases initially", Collections.emptySet(), model.getCodebases()); final String codebase = "http://example.com"; model.addCodebase(codebase); final Map policyEditorPermissions = model.getCopyOfPermissions().get(codebase); for (final PolicyEditorPermissions perm : PolicyEditorPermissions.values()) { assertTrue(perm + " should have been present as a key", policyEditorPermissions.containsKey(perm)); } } @Test public void testGetCopyOfPermissionsIsCopy() throws Exception { final Map> codebasePermissionsMap = model.getCopyOfPermissions(); assertEquals("Map should be initially empty", Collections.emptyMap(), codebasePermissionsMap); codebasePermissionsMap.put("invalid codebase", Collections.singletonMap(PolicyEditorPermissions.CLIPBOARD, true)); final Map> codebasePermissionsMap2 = model.getCopyOfPermissions(); assertEquals("New copy should be initially empty", Collections.emptyMap(), codebasePermissionsMap2); assertNotEquals("Modified map should not equal newly copied map", codebasePermissionsMap, codebasePermissionsMap2); } @Test public void testGetCopyOfCustomPermissionsIsCopy() throws Exception { final Map> codebasePermissionsMap = model.getCopyOfCustomPermissions(); assertEquals("Map should be initially empty", Collections.emptyMap(), codebasePermissionsMap); codebasePermissionsMap.put("invalid codebase", Collections.singleton(new CustomPermission(PermissionType.AUDIO_PERMISSION, PermissionTarget.PLAY))); final Map> codebasePermissionsMap2 = model.getCopyOfCustomPermissions(); assertEquals("New copy should be initially empty", Collections.emptyMap(), codebasePermissionsMap2); assertNotEquals("Modified set should not equal newly copied set", codebasePermissionsMap, codebasePermissionsMap2); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PaxHeaders.17941/Policy0000644000000000000000000000013012654402377030355 xustar0030 mtime=1454507263.213432901 29 atime=1454507327.20157951 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PolicyEntryTest.java0000644000175000002070000002367012654402377033714 0ustar00jvanekmock00000000000000/*Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.policyeditor; import org.junit.Test; import java.util.Arrays; import java.util.Collections; import java.util.HashSet; import java.util.Set; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; /** * PolicyEntryTest does not test the various parsing scenarios as those are tested in PolicyEditorParsingTest */ public class PolicyEntryTest { public static final String POLICY_ENTRY_STRING = "\ngrant codeBase \"http://example.com\" {\n" + "\tpermission java.awt.AWTPermission \"accessClipboard\";\n" + "};\n"; public static final String INVALID_POLICY_STRING = "\ngrant codeBase http://example.com {\n" + "\tpermission java.awt.AWTPermission \"accessClipboard\";" + "}"; @Test public void testGetCodebase() throws Exception { final String codebase = "http://example.com"; final Set permissions = Collections.singleton(PolicyEditorPermissions.CLIPBOARD); final Set customPermissions = Collections.singleton(new CustomPermission(PermissionType.AUDIO_PERMISSION, PermissionTarget.PLAY)); final PolicyEntry policyEntry = new PolicyEntry(codebase, permissions, customPermissions); assertEquals("Codebase should equal input", codebase, policyEntry.getCodebase()); } @Test public void testNullCodebaseConvertsToEmpty() throws Exception { final String codebase = null; final Set permissions = Collections.singleton(PolicyEditorPermissions.CLIPBOARD); final Set customPermissions = Collections.singleton(new CustomPermission(PermissionType.AUDIO_PERMISSION, PermissionTarget.PLAY)); final PolicyEntry policyEntry = new PolicyEntry(codebase, permissions, customPermissions); assertEquals("Null codebase should produce empty string", "", policyEntry.getCodebase()); } @Test public void testGetPermissions() throws Exception { final String codebase = "http://example.com"; final Set permissions = Collections.singleton(PolicyEditorPermissions.CLIPBOARD); final Set customPermissions = Collections.singleton(new CustomPermission(PermissionType.AUDIO_PERMISSION, PermissionTarget.PLAY)); final PolicyEntry policyEntry = new PolicyEntry(codebase, permissions, customPermissions); assertEquals("Permissions set should equal input", permissions, policyEntry.getPermissions()); } @Test public void testGetPermissions2() throws Exception { final String codebase = "http://example.com"; final Set permissions = new HashSet() {{ add(PolicyEditorPermissions.CLIPBOARD); add(PolicyEditorPermissions.NETWORK); }}; final Set customPermissions = Collections.singleton(new CustomPermission(PermissionType.AUDIO_PERMISSION, PermissionTarget.PLAY)); final PolicyEntry policyEntry = new PolicyEntry(codebase, permissions, customPermissions); assertEquals("Permissions set should equal input", permissions, policyEntry.getPermissions()); } @Test public void testGetCustomPermissions() throws Exception { final String codebase = "http://example.com"; final Set permissions = Collections.singleton(PolicyEditorPermissions.CLIPBOARD); final Set customPermissions = Collections.singleton(new CustomPermission(PermissionType.AUDIO_PERMISSION, PermissionTarget.PLAY)); final PolicyEntry policyEntry = new PolicyEntry(codebase, permissions, customPermissions); assertEquals("Custom permissions set should equal input", customPermissions, policyEntry.getCustomPermissions()); } @Test public void testGetCustomPermissions2() throws Exception { final String codebase = "http://example.com"; final Set permissions = Collections.singleton(PolicyEditorPermissions.CLIPBOARD); final Set customPermissions = new HashSet(){{ add(new CustomPermission(PermissionType.AUDIO_PERMISSION, PermissionTarget.PLAY)); add(new CustomPermission(PermissionType.RUNTIME_PERMISSION, PermissionTarget.CLASSLOADER)); }}; final PolicyEntry policyEntry = new PolicyEntry(codebase, permissions, customPermissions); assertEquals("Custom permissions set should equal input", customPermissions, policyEntry.getCustomPermissions()); } @Test(expected = NullPointerException.class) public void testEntryWithNullPermissions() throws Exception { final String codebase = "http://example.com"; final Set customPermissions = Collections.singleton(new CustomPermission(PermissionType.AUDIO_PERMISSION, PermissionTarget.PLAY)); new PolicyEntry(codebase, null, customPermissions); } @Test(expected = NullPointerException.class) public void testEntryWithNullCustomPermissions() throws Exception { final String codebase = "http://example.com"; final Set permissions = Collections.singleton(PolicyEditorPermissions.CLIPBOARD); new PolicyEntry(codebase, permissions, null); } @Test public void testNullPermissionsNotAllowed() throws Exception { final String codebase = "http://example.com"; final Set permissions = Collections.singleton(null); final Set customPermissions = Collections.singleton(new CustomPermission(PermissionType.AUDIO_PERMISSION, PermissionTarget.PLAY)); final PolicyEntry policyEntry = new PolicyEntry(codebase, permissions, customPermissions); assertFalse("Permissions set should not contain null element", policyEntry.getPermissions().contains(null)); } @Test public void testNullCustomPermissionsNotAllowed() throws Exception { final String codebase = "http://example.com"; final Set permissions = Collections.singleton(PolicyEditorPermissions.CLIPBOARD); final Set customPermissions = Collections.singleton(null); final PolicyEntry policyEntry = new PolicyEntry(codebase, permissions, customPermissions); assertFalse("Custom permissions set should not contain null element", policyEntry.getCustomPermissions().contains(null)); } @Test public void testFromString() throws Exception { final PolicyEntry entry = PolicyEntry.fromString(POLICY_ENTRY_STRING); assertEquals("Codebase should equal http://example.com", "http://example.com", entry.getCodebase()); assertEquals("Permissions should be CLIPBOARD singleton", Collections.singleton(PolicyEditorPermissions.CLIPBOARD), entry.getPermissions()); assertEquals("Custom permissions should be empty set", Collections.emptySet(), entry.getCustomPermissions()); } @Test(expected = InvalidPolicyException.class) public void testFromStringInvalid() throws Exception { PolicyEntry.fromString(INVALID_POLICY_STRING); } @Test public void testValidatePolicy1() throws Exception { assertTrue("Valid policy should pass validation", PolicyEntry.validatePolicy(Arrays.asList(POLICY_ENTRY_STRING.split("\\r?\\n")))); } @Test public void testValidatePolicy2() throws Exception { assertTrue("Valid policy should pass validation", PolicyEntry.validatePolicy(POLICY_ENTRY_STRING)); } @Test public void testValidatePolicyInvalid1() throws Exception { assertFalse("Invalid policy should not pass validation", PolicyEntry.validatePolicy(INVALID_POLICY_STRING)); } @Test public void testToString() { final String codebase = "http://example.com"; final Set permissions = Collections.singleton(PolicyEditorPermissions.CLIPBOARD); final PolicyEntry entry = new PolicyEntry(codebase, permissions, Collections.emptySet()); assertEquals("Entry toString did not match expected output", POLICY_ENTRY_STRING, entry.toString()); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PaxHeaders.17941/Policy0000644000000000000000000000013112654402377030356 xustar0030 mtime=1454507263.212432914 30 atime=1454507327.200579523 29 ctime=1454507658.76915749 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PolicyEditorTest.java0000644000175000002070000003320212654402377034031 0ustar00jvanekmock00000000000000/*Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.policyeditor; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import java.io.File; import java.util.Collection; import java.util.HashSet; import java.util.Map; import java.util.Set; import org.junit.Before; import org.junit.Test; public class PolicyEditorTest { private String tempFilePath; private PolicyEditor editor; @Before public void setNewTempfile() throws Exception { tempFilePath = File.createTempFile("policyeditor", null).getCanonicalPath(); editor = new PolicyEditor(tempFilePath); } @Test public void testInitialCodebase() throws Exception { final Collection initialCodebases = editor.getCodebases(); assertTrue("Editor should have one codebase to begin with", initialCodebases.size() == 1); assertTrue("Editor's initial codebase should be \"\" (empty string)", initialCodebases.toArray(new String[0])[0].equals("")); } @Test public void testAddCodebase() throws Exception { final String urlString = "http://example.com"; editor.addNewCodebase(urlString); final Collection codebases = editor.getCodebases(); assertTrue("Editor should have default codebase", codebases.contains("")); assertTrue("Editor should have http://example.com", codebases.contains(urlString)); assertTrue("Editor should only have two codebases", codebases.size() == 2); } @Test public void addMultipleCodebases() throws Exception { final Set toAdd = new HashSet(); toAdd.add("http://example.com"); toAdd.add("http://icedtea.classpath.org"); for (final String cb : toAdd) { editor.addNewCodebase(cb); } final Collection codebases = editor.getCodebases(); assertTrue("Editor should have default codebase", codebases.contains("")); for (final String codebase : toAdd) { assertTrue("Editor should have " + codebase, codebases.contains(codebase)); } } @Test public void testAddInvalidUrlCodebase() throws Exception { final String invalidUrl = "url.com"; // missing protocol -> invalid editor.addNewCodebase(invalidUrl); final Collection codebases = editor.getCodebases(); assertTrue("Editor should have default codebase", codebases.contains("")); assertTrue("Editor should only have default codebase", codebases.size() == 1); } @Test public void testRemoveCodebase() throws Exception { final String urlString = "http://example.com"; editor.addNewCodebase(urlString); final Collection codebases = editor.getCodebases(); assertTrue("Editor should have default codebase", codebases.contains("")); assertTrue("Editor should have http://example.com", codebases.contains(urlString)); assertEquals("Editor should only have two codebases", codebases.size(), 2); editor.removeCodebase(urlString); final Collection afterRemove = editor.getCodebases(); assertTrue("Editor should have default codebase", afterRemove.contains("")); assertFalse("Editor should not have http://example.com. Contained: " + afterRemove, afterRemove.contains(urlString)); assertEquals("Editor should only have one codebase", afterRemove.size(), 1); } @Test public void testRenameCodebase() throws Exception { final String originalUrl = "http://example.com"; final String renamedUrl = "http://example.com/example"; final PolicyEditorPermissions clipBoard = PolicyEditorPermissions.CLIPBOARD; editor.addNewCodebase(originalUrl); editor.setPermission(originalUrl, clipBoard, Boolean.TRUE); final Collection beforeRenameCodebases = editor.getCodebases(); assertTrue("Editor should contain " + originalUrl, beforeRenameCodebases.contains(originalUrl)); assertTrue(originalUrl + " should have " + clipBoard, editor.getPermissions(originalUrl).get(clipBoard)); editor.renameCodebase(originalUrl, renamedUrl); final Collection afterRenamedCodebases = editor.getCodebases(); assertFalse("Editor should not contain old codebase: " + originalUrl, afterRenamedCodebases.contains(originalUrl)); assertTrue("Editor should contain new codebase name: " + renamedUrl, afterRenamedCodebases.contains(renamedUrl)); assertTrue("Renamed " + renamedUrl + " should have " + clipBoard, editor.getPermissions(renamedUrl).get(clipBoard)); } @Test public void testCopyPasteCodebase() throws Exception { final String copyUrl = "http://example.com"; final String pasteUrl = "http://example.com/example"; final PolicyEditorPermissions clipBoard = PolicyEditorPermissions.CLIPBOARD; editor.addNewCodebase(copyUrl); editor.setPermission(copyUrl, clipBoard, Boolean.TRUE); final Collection beforePasteCodebases = editor.getCodebases(); assertTrue("Editor should contain original codebase: " + copyUrl, beforePasteCodebases.contains(copyUrl)); assertTrue(copyUrl + " should have " + clipBoard, editor.getPermissions(copyUrl).get(clipBoard)); editor.copyCodebase(copyUrl); editor.pasteCodebase(pasteUrl); final Collection afterPasteCodebases = editor.getCodebases(); assertTrue("Editor should still contain original codebase: " + copyUrl, afterPasteCodebases.contains(copyUrl)); assertTrue("Editor should also contain pasted codebase:" + pasteUrl, afterPasteCodebases.contains(pasteUrl)); assertTrue(copyUrl + " should have " + clipBoard, editor.getPermissions(copyUrl).get(clipBoard)); assertTrue(pasteUrl + " should have " + clipBoard, editor.getPermissions(pasteUrl).get(clipBoard)); } @Test public void testAddCustomPermissionNoActions() throws Exception { final String codebase = "http://example.com"; final CustomPermission customPermission = new CustomPermission("java.lang.RuntimePermission", "createClassLoader"); editor.addCustomPermission(codebase, customPermission); assertTrue("Editor custom permissions should include " + customPermission + " but did not", editor.getCustomPermissions(codebase).contains(customPermission)); } @Test public void testAddCustomPermissionEmptyActions() throws Exception { final String codebase = "http://example.com"; final CustomPermission customPermission = new CustomPermission("java.lang.RuntimePermission", "createClassLoader", ""); editor.addCustomPermission(codebase, customPermission); assertTrue("Editor custom permissions should include " + customPermission + " but did not", editor.getCustomPermissions(codebase).contains(customPermission)); } @Test public void testClearCustomPermissionsNoActions() throws Exception { final String codebase = "http://example.com"; final CustomPermission customPermission = new CustomPermission("java.lang.RuntimePermission", "createClassLoader"); editor.addCustomPermission(codebase, customPermission); assertTrue("Editor custom permissions should include " + customPermission + " but did not", editor.getCustomPermissions(codebase).contains(customPermission)); editor.clearCustomPermissions(codebase); assertEquals(0, editor.getCustomPermissions(codebase).size()); } @Test public void testClearCustomPermissionsEmptyActions() throws Exception { final String codebase = "http://example.com"; final CustomPermission customPermission = new CustomPermission("java.lang.RuntimePermission", "createClassLoader", ""); editor.addCustomPermission(codebase, customPermission); assertTrue("Editor custom permissions should include " + customPermission + " but did not", editor.getCustomPermissions(codebase).contains(customPermission)); editor.clearCustomPermissions(codebase); assertEquals(0, editor.getCustomPermissions(codebase).size()); } @Test public void testReturnedCodebasesIsCopy() throws Exception { final Collection original = editor.getCodebases(); original.add("some invalid value"); original.remove(""); final Collection second = editor.getCodebases(); assertTrue("Editor should have default codebase", second.contains("")); assertEquals("Editor should only have default codebase", 1, second.size()); } @Test public void testReturnedPermissionsMapIsCopy() throws Exception { final Map original = editor.getPermissions(""); for (final PolicyEditorPermissions perm : PolicyEditorPermissions.values()) { original.put(perm, true); } final Map second = editor.getPermissions(""); for (final Map.Entry entry : second.entrySet()) { assertFalse("Permission " + entry.getKey() + " should be false", entry.getValue()); } } @Test public void testReturnedCustomPermissionsSetIsCopy() throws Exception { final Collection original = editor.getCustomPermissions(""); assertTrue("There should not be any custom permissions to start", original.isEmpty()); original.add(new CustomPermission("java.io.FilePermission", "*", "write")); final Collection second = editor.getCustomPermissions(""); assertTrue("The custom permission should not have been present", second.isEmpty()); } @Test public void testDefaultPermissionsAllFalse() throws Exception { final Map defaultMap = editor.getPermissions(""); editor.addNewCodebase("http://example.com"); final Map addedMap = editor.getPermissions("http://example.com"); for (final Map.Entry entry : defaultMap.entrySet()) { assertFalse("Permission " + entry.getKey() + " should be false", entry.getValue()); } for (final Map.Entry entry : addedMap.entrySet()) { assertFalse("Permission " + entry.getKey() + " should be false", entry.getValue()); } } @Test public void testAllPermissionsRepresented() throws Exception { final Map defaultMap = editor.getPermissions(""); editor.addNewCodebase("http://example.com"); final Map addedMap = editor.getPermissions("http://example.com"); assertTrue("Default codebase permissions keyset should be the same size as enum values set", defaultMap.keySet().size() == PolicyEditorPermissions.values().length); assertTrue("Added codebase permissions keyset should be the same size as enum values set", addedMap.keySet().size() == PolicyEditorPermissions.values().length); for (final PolicyEditorPermissions perm : PolicyEditorPermissions.values()) { assertTrue("Permission " + perm + " should be in the editor's codebase keyset", defaultMap.keySet().contains(perm)); } for (final PolicyEditorPermissions perm : PolicyEditorPermissions.values()) { assertTrue("Permission " + perm + " should be in the editor's codebase keyset", addedMap.keySet().contains(perm)); } } @Test public void testCodebaseTrailingSlashesDoNotMatch() throws Exception { final Set toAdd = new HashSet(); toAdd.add("http://redhat.com"); toAdd.add("http://redhat.com/"); for (final String cb : toAdd) { editor.addNewCodebase(cb); } final Collection codebases = editor.getCodebases(); assertTrue("Editor should have default codebase", codebases.contains("")); for (final String codebase : toAdd) { assertTrue("Editor should have " + codebase, codebases.contains(codebase)); } } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PaxHeaders.17941/Policy0000644000000000000000000000032112654402377030357 xustar00119 path=icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PolicyEditorPermissionsTest.java 30 mtime=1454507263.212432914 30 atime=1454507327.200579523 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PolicyEditorPermissions0000644000175000002070000001134712654402377034513 0ustar00jvanekmock00000000000000/*Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.policyeditor; import java.util.regex.Pattern; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import org.junit.Test; public class PolicyEditorPermissionsTest { @Test public void assertAllPermissionsHaveNames() throws Exception { for (PolicyEditorPermissions perm : PolicyEditorPermissions.values()) { assertFalse("Permission " + perm + " should have a defined name", perm.getName().contains("UNDEFINED")); } } @Test public void assertAllPermissionsHaveDescriptions() throws Exception { for (PolicyEditorPermissions perm : PolicyEditorPermissions.values()) { assertFalse("Permission " + perm + " should have a defined description", perm.getDescription().contains("UNDEFINED")); } } @Test public void assertAllPermissionsHavePermissionStrings() throws Exception { for (PolicyEditorPermissions perm : PolicyEditorPermissions.values()) { assertFalse("Permission " + perm + " should have a defined permission string", perm.toPermissionString().trim().isEmpty()); } } @Test public void testActionsRegex() throws Exception { final Pattern pattern = CustomPermission.ACTIONS_PERMISSION; final String actionsPermission = "permission java.io.FilePermission \"${user.home}\", \"read\";"; final String targetPermission = "permission java.io.RuntimePermission \"queuePrintJob\";"; final String badPermission = "permission java.io.FilePermission user.home read;"; assertTrue(actionsPermission + " should match", pattern.matcher(actionsPermission).matches()); assertFalse(targetPermission + " should not match", pattern.matcher(targetPermission).matches()); assertFalse(badPermission + " should not match", pattern.matcher(badPermission).matches()); } @Test public void testTargetRegex() throws Exception { final Pattern pattern = CustomPermission.TARGET_PERMISSION; final String actionsPermission = "permission java.io.FilePermission \"${user.home}\", \"read\";"; final String targetPermission = "permission java.io.RuntimePermission \"queuePrintJob\";"; final String badPermission = "permission java.io.FilePermission user.home read;"; assertFalse(actionsPermission + " should not match", pattern.matcher(actionsPermission).matches()); assertTrue(targetPermission + " should match", pattern.matcher(targetPermission).matches()); assertFalse(badPermission + " should not match", pattern.matcher(badPermission).matches()); } @Test public void testRegexesAgainstBadPermissionNames() throws Exception { final Pattern targetPattern = CustomPermission.TARGET_PERMISSION; final Pattern actionsPattern = CustomPermission.ACTIONS_PERMISSION; final String badPermission = "permission abc123^$% \"target\", \"actions\""; assertFalse(badPermission + " should not match", targetPattern.matcher(badPermission).matches()); assertFalse(badPermission + " should not match", actionsPattern.matcher(badPermission).matches()); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PaxHeaders.17941/Policy0000644000000000000000000000031512654402377030362 xustar00115 path=icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PolicyEditorParsingTest.java 30 mtime=1454507263.212432914 30 atime=1454507327.200579523 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PolicyEditorParsingTest0000644000175000002070000003111312654402377034434 0ustar00jvanekmock00000000000000/*Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.policyeditor; import java.io.File; import java.util.Map; import net.sourceforge.jnlp.annotations.KnownToFail; import net.sourceforge.jnlp.util.FileUtils; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import org.junit.Before; import org.junit.Test; public class PolicyEditorParsingTest { private File file; private PolicyFileModel policyFileModel = new PolicyFileModel(); private Map permissions; private static final String LINEBREAK = System.getProperty("line.separator"); private static final String READ_PERMISSION = "permission java.io.FilePermission \"${user.home}\", \"read\";"; private static final String WRITE_PERMISSION = "permission java.io.FilePermission \"${user.home}\", \"write\";"; private static final String COMMENT_HEADER = "/* TEST COMMENT */" + LINEBREAK; private static final String NORMAL_POLICY = "grant {" + LINEBREAK + "\t" + READ_PERMISSION + LINEBREAK + "};" + LINEBREAK; private static final String NORMAL_POLICY_CRLF = "grant {" + "\r\n" + "\t" + READ_PERMISSION + "\r\n" + "};" + "\r\n"; private static final String NORMAL_POLICY_LF = "grant {" + "\n" + "\t" + READ_PERMISSION + "\n" + "};" + "\n"; private static final String NORMAL_POLICY_MIXED_ENDINGS = "grant {" + "\n\n" + "\t" + READ_PERMISSION + "\r\n" + "};" + "\n"; private static final String NORMAL_POLICY_WITH_HEADER = COMMENT_HEADER + NORMAL_POLICY; private static final String CODEBASE_POLICY = "grant codeBase \"http://example.com\" {" + LINEBREAK + "\t" + READ_PERMISSION + LINEBREAK + "};" + LINEBREAK; private static final String MULTIPLE_PERMISSION_POLICY = "grant {" + LINEBREAK + "\t" + READ_PERMISSION + LINEBREAK + "\t" + WRITE_PERMISSION + LINEBREAK + "};" + LINEBREAK; private static final String COMMENT_BLOCKED_PERMISSION = "grant {" + LINEBREAK + "\t/*" + READ_PERMISSION + "*/" + LINEBREAK + "};" + LINEBREAK; private static final String COMMENT_BLOCKED_POLICY = "/*" + NORMAL_POLICY + "*/" + LINEBREAK; private static final String COMMENTED_PERMISSION = "grant {" + LINEBREAK + "\t//" + READ_PERMISSION + LINEBREAK + "};" + LINEBREAK; private static final String COMMENT_AFTER_PERMISSION = "grant {" + LINEBREAK + "\t" + READ_PERMISSION + " // comment" + LINEBREAK + "};" + LINEBREAK; private static final String MISSING_WHITESPACE_POLICY = "grant { " + READ_PERMISSION + " };"; private static final String MULTIPLE_PERMISSIONS_PER_LINE = "grant {" + LINEBREAK + "\t" + READ_PERMISSION + " " + WRITE_PERMISSION + LINEBREAK + "};" + LINEBREAK; @Before public void createTempFile() throws Exception { file = File.createTempFile("PolicyEditor", ".policy"); file.deleteOnExit(); } private void setupTest(final String policyContents, final String codebase) throws Exception { FileUtils.saveFile(policyContents, file); policyFileModel = new PolicyFileModel(file.getCanonicalFile()); policyFileModel.openAndParsePolicyFile(); policyFileModel.addCodebase(""); policyFileModel.addCodebase(codebase); permissions = policyFileModel.getCopyOfPermissions().get(codebase); } @Test public void testNormalPolicy() throws Exception { setupTest(NORMAL_POLICY, ""); assertTrue("Permissions should include READ_LOCAL_FILES", permissions.get(PolicyEditorPermissions.READ_LOCAL_FILES)); for (final PolicyEditorPermissions perm : permissions.keySet()) { if (!perm.equals(PolicyEditorPermissions.READ_LOCAL_FILES)) { assertFalse("Permission " + perm + " should not be granted", permissions.get(perm)); } } } @Test public void testNormalPolicyWithCRLFEndings() throws Exception { // This is the same test as testNormalPolicy on systems where the line separator is \r\n setupTest(NORMAL_POLICY_CRLF, ""); assertTrue("Permissions should include READ_LOCAL_FILES", permissions.get(PolicyEditorPermissions.READ_LOCAL_FILES)); for (final PolicyEditorPermissions perm : permissions.keySet()) { if (!perm.equals(PolicyEditorPermissions.READ_LOCAL_FILES)) { assertFalse("Permission " + perm + " should not be granted", permissions.get(perm)); } } } @Test public void testNormalPolicyWithLFEndings() throws Exception { // This is the same test as testNormalPolicy on systems where the line separator is \n setupTest(NORMAL_POLICY_LF, ""); assertTrue("Permissions should include READ_LOCAL_FILES", permissions.get(PolicyEditorPermissions.READ_LOCAL_FILES)); for (final PolicyEditorPermissions perm : permissions.keySet()) { if (!perm.equals(PolicyEditorPermissions.READ_LOCAL_FILES)) { assertFalse("Permission " + perm + " should not be granted", permissions.get(perm)); } } } @Test public void testNormalPolicyWithMixedEndings() throws Exception { // This is the same test as testNormalPolicy on systems where the line separator is \n setupTest(NORMAL_POLICY_MIXED_ENDINGS, ""); assertTrue("Permissions should include READ_LOCAL_FILES", permissions.get(PolicyEditorPermissions.READ_LOCAL_FILES)); for (final PolicyEditorPermissions perm : permissions.keySet()) { if (!perm.equals(PolicyEditorPermissions.READ_LOCAL_FILES)) { assertFalse("Permission " + perm + " should not be granted", permissions.get(perm)); } } } @Test public void testCommentHeaders() throws Exception { setupTest(COMMENT_HEADER, ""); for (final PolicyEditorPermissions perm : permissions.keySet()) { assertFalse("Permission " + perm + " should not be granted", permissions.get(perm)); } } @Test public void testCommentBlockedPermission() throws Exception { setupTest(COMMENT_BLOCKED_PERMISSION, ""); for (final PolicyEditorPermissions perm : permissions.keySet()) { assertFalse("Permission " + perm + " should not be granted", permissions.get(perm)); } } @Test public void testCommentBlockedPolicy() throws Exception { setupTest(COMMENT_BLOCKED_POLICY, ""); for (final PolicyEditorPermissions perm : permissions.keySet()) { assertFalse("Permission " + perm + " should not be granted", permissions.get(perm)); } } @Test public void testCommentedLine() throws Exception { setupTest(COMMENTED_PERMISSION, ""); for (final PolicyEditorPermissions perm : permissions.keySet()) { assertFalse("Permission " + perm + " should not be granted", permissions.get(perm)); } } @Test public void testMultiplePermissions() throws Exception { setupTest(MULTIPLE_PERMISSION_POLICY, ""); assertTrue("Permissions should include READ_LOCAL_FILES", permissions.get(PolicyEditorPermissions.READ_LOCAL_FILES)); assertTrue("Permissions should include WRITE_LOCAL_FILES", permissions.get(PolicyEditorPermissions.WRITE_LOCAL_FILES)); for (final PolicyEditorPermissions perm : permissions.keySet()) { if (!perm.equals(PolicyEditorPermissions.READ_LOCAL_FILES) && !perm.equals(PolicyEditorPermissions.WRITE_LOCAL_FILES)) { assertFalse("Permission " + perm + " should not be granted", permissions.get(perm)); } } } @KnownToFail @Test public void testMultiplePermissionsPerLine() throws Exception { setupTest(MULTIPLE_PERMISSIONS_PER_LINE, ""); assertTrue("Permissions should include READ_LOCAL_FILES", permissions.get(PolicyEditorPermissions.READ_LOCAL_FILES)); assertTrue("Permissions should include WRITE_LOCAL_FILES", permissions.get(PolicyEditorPermissions.WRITE_LOCAL_FILES)); for (final PolicyEditorPermissions perm : permissions.keySet()) { if (!perm.equals(PolicyEditorPermissions.READ_LOCAL_FILES) && !perm.equals(PolicyEditorPermissions.WRITE_LOCAL_FILES)) { assertFalse("Permission " + perm + " should not be granted", permissions.get(perm)); } } } @KnownToFail @Test public void testMissingWhitespace() throws Exception { setupTest(MISSING_WHITESPACE_POLICY, ""); assertTrue("Permissions should include READ_LOCAL_FILES", permissions.get(PolicyEditorPermissions.READ_LOCAL_FILES)); for (final PolicyEditorPermissions perm : permissions.keySet()) { if (!perm.equals(PolicyEditorPermissions.READ_LOCAL_FILES)) { assertFalse("Permission " + perm + " should not be granted", permissions.get(perm)); } } } @Test public void testPolicyWithCodebase() throws Exception { setupTest(CODEBASE_POLICY, "http://example.com"); assertTrue("Permissions should include READ_LOCAL_FILES", permissions.get(PolicyEditorPermissions.READ_LOCAL_FILES)); for (final PolicyEditorPermissions perm : permissions.keySet()) { if (!perm.equals(PolicyEditorPermissions.READ_LOCAL_FILES)) { assertFalse("Permission " + perm + " should not be granted", permissions.get(perm)); } } } @Test public void testCodebaseTrailingSlashesDoNotMatch() throws Exception { // note the trailing '/' - looks like the same URL but is not. JDK PolicyTool considers these as // different codeBases, so so does PolicyEditor setupTest(CODEBASE_POLICY, "http://example.com/"); for (final PolicyEditorPermissions perm : permissions.keySet()) { if (!perm.equals(PolicyEditorPermissions.READ_LOCAL_FILES)) { assertFalse("Permission " + perm + " should not be granted", permissions.get(perm)); } } } @Test public void testCommentAfterPermission() throws Exception { setupTest(COMMENT_AFTER_PERMISSION, ""); assertTrue("Permissions should include READ_LOCAL_FILES", permissions.get(PolicyEditorPermissions.READ_LOCAL_FILES)); for (final PolicyEditorPermissions perm : permissions.keySet()) { if (!perm.equals(PolicyEditorPermissions.READ_LOCAL_FILES)) { assertFalse("Permission " + perm + " should not be granted", permissions.get(perm)); } } } @Test public void testNormalPolicyWithHeader() throws Exception { setupTest(NORMAL_POLICY_WITH_HEADER, ""); assertTrue("Permissions should include READ_LOCAL_FILES", permissions.get(PolicyEditorPermissions.READ_LOCAL_FILES)); for (final PolicyEditorPermissions perm : permissions.keySet()) { if (!perm.equals(PolicyEditorPermissions.READ_LOCAL_FILES)) { assertFalse("Permission " + perm + " should not be granted", permissions.get(perm)); } } } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PaxHeaders.17941/Policy0000644000000000000000000000032012654402377030356 xustar00118 path=icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PolicyEditorControllerTest.java 30 mtime=1454507263.211432928 30 atime=1454507327.200579523 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PolicyEditorControllerT0000644000175000002070000004546512654402377034457 0ustar00jvanekmock00000000000000/*Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.policyeditor; import net.sourceforge.jnlp.util.FileUtils; import org.junit.Before; import org.junit.Test; import java.io.File; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.HashSet; import java.util.Map; import java.util.Set; import static org.junit.Assert.*; import static org.junit.Assert.assertEquals; public class PolicyEditorControllerTest { private String tempFilePath; private PolicyEditorController controller; @Before public void setNewTempfile() throws Exception { tempFilePath = File.createTempFile("policyeditor", null).getCanonicalPath(); controller = new PolicyEditorController(); controller.setFile(new File(tempFilePath)); } @Test public void testChangesMadeInitiallyFalse() throws Exception { // #setFile() counts as a change made assertTrue("Controller should report changes made initially", controller.changesMade()); } @Test public void testChangesMade() throws Exception { controller.setChangesMade(false); assertFalse("Controller should have changes made marked false after being explicitly set", controller.changesMade()); } @Test public void testFileHasChanged() throws Exception { assertFalse("File should not have been changed initially", controller.fileHasChanged()); } @Test public void testFileHasChangedWithChange() throws Exception { assertFalse("Controller should report file has changed initially", controller.fileHasChanged()); final String codebase = "http://example.com"; final PolicyEditorPermissions editorPermissions = PolicyEditorPermissions.CLIPBOARD; final Collection permissions = Collections.singleton(editorPermissions); final CustomPermission customPermission = new CustomPermission(PermissionType.FILE_PERMISSION, PermissionTarget.USER_HOME, PermissionActions.FILE_ALL); final Collection customPermissions = Collections.singleton(customPermission); final PolicyEntry policyEntry = new PolicyEntry(codebase, permissions, customPermissions); FileUtils.saveFile(policyEntry.toString(), new File(tempFilePath)); controller.openAndParsePolicyFile(); final Collection editorPermissions2 = Collections.singleton(PolicyEditorPermissions.ALL_AWT); final PolicyEntry policyEntry2 = new PolicyEntry(codebase, editorPermissions2, customPermissions); FileUtils.saveFile(policyEntry2.toString(), new File(tempFilePath)); assertTrue("File should be marked changed after being externally modified", controller.fileHasChanged()); } @Test public void testInitialCodebase() throws Exception { final Collection initialCodebases = controller.getCodebases(); assertEquals("Controller should have no codebases to begin with", 0, initialCodebases.size()); } @Test public void testAddCodebase() throws Exception { final String urlString = "http://example.com"; controller.addCodebase(urlString); final Collection codebases = controller.getCodebases(); assertTrue("Controller should have http://example.com", codebases.contains(urlString)); assertEquals("Controller should only have two codebases", 1, codebases.size()); } @Test public void testAddMultipleCodebases() throws Exception { final Set toAdd = new HashSet(); toAdd.add("http://example.com"); toAdd.add("http://icedtea.classpath.org"); for (final String cb : toAdd) { controller.addCodebase(cb); } final Collection codebases = controller.getCodebases(); for (final String codebase : toAdd) { assertTrue("Controller should have " + codebase, codebases.contains(codebase)); } } @Test public void testRemoveCodebase() throws Exception { final String urlString = "http://example.com"; controller.addCodebase(urlString); final Collection codebases = controller.getCodebases(); assertTrue("Controller should have http://example.com", codebases.contains(urlString)); assertEquals("Controller should only have one codebase", 1, codebases.size()); controller.removeCodebase(urlString); final Collection afterRemove = controller.getCodebases(); assertFalse("Controller should not have http://example.com. Contained: " + afterRemove, afterRemove.contains(urlString)); assertEquals("Controller should have no codebases", 0, afterRemove.size()); } @Test public void testCopyPasteCodebase() throws Exception { final String copyUrl = "http://example.com"; final String pasteUrl = "http://example.com/example"; final PolicyEditorPermissions clipBoard = PolicyEditorPermissions.CLIPBOARD; controller.addCodebase(copyUrl); controller.setPermission(copyUrl, clipBoard, Boolean.TRUE); final Collection beforePasteCodebases = controller.getCodebases(); assertTrue("Controller should contain original codebase: " + copyUrl, beforePasteCodebases.contains(copyUrl)); assertTrue(copyUrl + " should have " + clipBoard, controller.getPermissions(copyUrl).get(clipBoard)); controller.copyCodebaseToClipboard(copyUrl); final PolicyEntry clipboardEntry = PolicyEditorController.getPolicyEntryFromClipboard(); controller.addPolicyEntry(new PolicyEntry(pasteUrl, clipboardEntry.getPermissions(), clipboardEntry.getCustomPermissions())); final Collection afterPasteCodebases = controller.getCodebases(); assertTrue("Controller should still contain original codebase: " + copyUrl, afterPasteCodebases.contains(copyUrl)); assertTrue("Controller should also contain pasted codebase:" + pasteUrl, afterPasteCodebases.contains(pasteUrl)); assertTrue(copyUrl + " should have " + clipBoard, controller.getPermissions(copyUrl).get(clipBoard)); assertTrue(pasteUrl + " should have " + clipBoard, controller.getPermissions(pasteUrl).get(clipBoard)); } @Test public void testAddPolicyEntry() throws Exception { final String codebase = "http://example.com"; final PolicyEditorPermissions editorPermissions = PolicyEditorPermissions.CLIPBOARD; final Collection permissions = Collections.singleton(editorPermissions); final CustomPermission customPermission = new CustomPermission(PermissionType.FILE_PERMISSION, PermissionTarget.USER_HOME, PermissionActions.FILE_ALL); final Collection customPermissions = Collections.singleton(customPermission); final PolicyEntry policyEntry = new PolicyEntry(codebase, permissions, customPermissions); controller.addPolicyEntry(policyEntry); final Collection codebases = controller.getCodebases(); assertTrue("Controller should have " + codebase, codebases.contains(codebase)); assertEquals("Controller should only have one codebase", 1, codebases.size()); assertTrue("Controller should have granted " + editorPermissions, controller.getPermission(codebase, editorPermissions)); assertTrue("Controller should have granted " + customPermission, controller.getCustomPermissions(codebase).contains(customPermission)); } @Test public void testAddCustomPermissionNoActions() throws Exception { final String codebase = "http://example.com"; final CustomPermission customPermission = new CustomPermission("java.lang.RuntimePermission", "createClassLoader"); controller.addCustomPermission(codebase, customPermission); assertTrue("Controller custom permissions should include " + customPermission + " but did not", controller.getCustomPermissions(codebase).contains(customPermission)); } @Test public void testAddCustomPermissionEmptyActions() throws Exception { final String codebase = "http://example.com"; final CustomPermission customPermission = new CustomPermission("java.lang.RuntimePermission", "createClassLoader", ""); controller.addCustomPermission(codebase, customPermission); assertTrue("Controller custom permissions should include " + customPermission + " but did not", controller.getCustomPermissions(codebase).contains(customPermission)); } @Test public void testClearCustomPermissionsNoActions() throws Exception { final String codebase = "http://example.com"; final CustomPermission customPermission = new CustomPermission("java.lang.RuntimePermission", "createClassLoader"); controller.addCustomPermission(codebase, customPermission); assertTrue("Controller custom permissions should include " + customPermission + " but did not", controller.getCustomPermissions(codebase).contains(customPermission)); controller.clearCustomCodebase(codebase); assertEquals(0, controller.getCustomPermissions(codebase).size()); } @Test public void testClearCustomPermissionsEmptyActions() throws Exception { final String codebase = "http://example.com"; final CustomPermission customPermission = new CustomPermission("java.lang.RuntimePermission", "createClassLoader", ""); controller.addCustomPermission(codebase, customPermission); assertTrue("Controller custom permissions should include " + customPermission + " but did not", controller.getCustomPermissions(codebase).contains(customPermission)); controller.clearCustomCodebase(codebase); assertEquals(0, controller.getCustomPermissions(codebase).size()); } @Test public void testReturnedCodebasesIsCopy() throws Exception { final Collection original = controller.getCodebases(); original.add("some invalid value"); original.remove(""); final Collection second = controller.getCodebases(); assertEquals("Controller should have no codebases", 0, second.size()); } @Test public void testReturnedPermissionsMapIsCopy() throws Exception { final Map original = controller.getPermissions(""); for (final PolicyEditorPermissions perm : PolicyEditorPermissions.values()) { original.put(perm, true); } final Map second = controller.getPermissions(""); for (final Map.Entry entry : second.entrySet()) { assertFalse("Permission " + entry.getKey() + " should be false", entry.getValue()); } } @Test public void testReturnedCustomPermissionsSetIsCopy() throws Exception { final Collection original = controller.getCustomPermissions(""); assertTrue("There should not be any custom permissions to start", original.isEmpty()); original.add(new CustomPermission("java.io.FilePermission", "*", "write")); final Collection second = controller.getCustomPermissions(""); assertTrue("The custom permission should not have been present", second.isEmpty()); } @Test public void testDefaultPermissionsAllFalse() throws Exception { final Map defaultMap = controller.getPermissions(""); controller.addCodebase("http://example.com"); final Map addedMap = controller.getPermissions("http://example.com"); for (final Map.Entry entry : defaultMap.entrySet()) { assertFalse("Permission " + entry.getKey() + " should be false", entry.getValue()); } for (final Map.Entry entry : addedMap.entrySet()) { assertFalse("Permission " + entry.getKey() + " should be false", entry.getValue()); } } @Test public void testAllPermissionsRepresented() throws Exception { final Map defaultMap = controller.getPermissions(""); controller.addCodebase("http://example.com"); final Map addedMap = controller.getPermissions("http://example.com"); assertTrue("Default codebase permissions keyset should be the same size as enum values set", defaultMap.keySet().size() == PolicyEditorPermissions.values().length); assertTrue("Added codebase permissions keyset should be the same size as enum values set", addedMap.keySet().size() == PolicyEditorPermissions.values().length); for (final PolicyEditorPermissions perm : PolicyEditorPermissions.values()) { assertTrue("Permission " + perm + " should be in the editor's codebase keyset", defaultMap.keySet().contains(perm)); } for (final PolicyEditorPermissions perm : PolicyEditorPermissions.values()) { assertTrue("Permission " + perm + " should be in the editor's codebase keyset", addedMap.keySet().contains(perm)); } } @Test public void testSetGetPermission() throws Exception { final String codebase = "http://example.com"; controller.addCodebase(codebase); final PolicyEditorPermissions permission = PolicyEditorPermissions.CLIPBOARD; assertFalse("Clipboard permission should not be initially granted", controller.getPermission(codebase, permission)); controller.setPermission(codebase, permission, true); assertTrue("Clipboard permission should be granted after being set", controller.getPermission(codebase, permission)); } @Test public void testClearPermission() throws Exception { final String codebase = "http://example.com"; controller.addCodebase(codebase); final PolicyEditorPermissions permission = PolicyEditorPermissions.CLIPBOARD; assertFalse("Clipboard permission should not be initially granted", controller.getPermission(codebase, permission)); controller.setPermission(codebase, permission, true); assertTrue("Clipboard permission should be granted after being set", controller.getPermission(codebase, permission)); controller.clearPermissions(); for (final String cb : controller.getCodebases()) { for (final Map.Entry entry : controller.getPermissions(cb).entrySet()) { assertFalse("Permission " + entry.getKey() + " should be false for codebase " + cb, entry.getValue()); } } assertEquals(0, controller.getCodebases().size()); } @Test public void testCodebaseTrailingSlashesDoNotMatch() throws Exception { final Collection toAdd = Arrays.asList("http://redhat.com", "http://redhat.com/"); for (final String cb : toAdd) { controller.addCodebase(cb); } final Collection codebases = controller.getCodebases(); for (final String codebase : toAdd) { assertTrue("Controller should have " + codebase, codebases.contains(codebase)); } } @Test public void testOpenAndParsePolicyFile() throws Exception { final String codebase = "http://example.com"; final PolicyEditorPermissions editorPermissions = PolicyEditorPermissions.CLIPBOARD; final Collection permissions = Collections.singleton(editorPermissions); final CustomPermission customPermission = new CustomPermission("com.example.CustomPermission", PermissionTarget.USER_HOME.target, PermissionActions.FILE_ALL.rawString()); final Collection customPermissions = new HashSet<>(Collections.singleton(customPermission)); final PolicyEntry policyEntry = new PolicyEntry(codebase, permissions, customPermissions); FileUtils.saveFile(policyEntry.toString(), new File(tempFilePath)); controller.openAndParsePolicyFile(); assertEquals("Controller should have one codebase", 1, controller.getCodebases().size()); assertTrue("Controller should have codebase " + codebase, controller.getCodebases().contains(codebase)); assertTrue("Controller should grant " + editorPermissions, controller.getPermission(codebase, editorPermissions)); assertEquals("Custom permission sets were not equal", customPermissions, controller.getCustomPermissions(codebase)); } @Test public void testSavePolicyFile() throws Exception { final String codebase = "http://example.com"; final PolicyEditorPermissions editorPermissions = PolicyEditorPermissions.CLIPBOARD; final Collection permissions = Collections.singleton(editorPermissions); final CustomPermission customPermission = new CustomPermission(PermissionType.FILE_PERMISSION, PermissionTarget.USER_HOME, PermissionActions.FILE_ALL); final Collection customPermissions = Collections.singleton(customPermission); final PolicyEntry policyEntry = new PolicyEntry(codebase, permissions, customPermissions); controller.addPolicyEntry(policyEntry); controller.savePolicyFile(); final String fileContent = FileUtils.loadFileAsString(new File(tempFilePath)); assertTrue("Saved file should contain policy entry as string", fileContent.contains(policyEntry.toString())); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PaxHeaders.17941/Permis0000644000000000000000000000013212654402377030357 xustar0030 mtime=1454507263.211432928 30 atime=1454507327.200579523 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PermissionTypeTest.java0000644000175000002070000000453012654402377034417 0ustar00jvanekmock00000000000000/*Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.policyeditor; import static org.junit.Assert.assertTrue; import org.junit.Test; public class PermissionTypeTest { @Test public void testFromString() throws Exception { final PermissionType file = PermissionType.fromString("java.io.FilePermission"); final PermissionType none = PermissionType.fromString(""); final PermissionType garbage = PermissionType.fromString("garbagedata"); assertTrue("java.io.FilePermission should match FILE_PERMISSION", file.equals(PermissionType.FILE_PERMISSION)); assertTrue("empty string should match NONE", none.equals(PermissionType.NONE)); assertTrue("nonexistent target should match NONE", garbage.equals(PermissionType.NONE)); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PaxHeaders.17941/Permis0000644000000000000000000000031212654402377030357 xustar00112 path=icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PermissionTargetTest.java 30 mtime=1454507263.211432928 30 atime=1454507327.200579523 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PermissionTargetTest.ja0000644000175000002070000000477112654402377034404 0ustar00jvanekmock00000000000000/*Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.policyeditor; import static org.junit.Assert.assertTrue; import org.junit.Test; public class PermissionTargetTest { @Test public void testFromString() throws Exception { final PermissionTarget wildcard = PermissionTarget.fromString("*"); final PermissionTarget clipboard = PermissionTarget.fromString("accessClipboard"); final PermissionTarget none = PermissionTarget.fromString(""); final PermissionTarget garbage = PermissionTarget.fromString("garbagedata"); assertTrue("* should match ALL", wildcard.equals(PermissionTarget.ALL)); assertTrue("accessClipboard should match CLIPBOARD", clipboard.equals(PermissionTarget.CLIPBOARD)); assertTrue("empty string should match NONE", none.equals(PermissionTarget.NONE)); assertTrue("nonexistent target should match NONE", garbage.equals(PermissionTarget.NONE)); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PaxHeaders.17941/Permis0000644000000000000000000000031312654402377030360 xustar00113 path=icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PermissionActionsTest.java 30 mtime=1454507263.210432941 30 atime=1454507327.200579523 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PermissionActionsTest.j0000644000175000002070000000556012654402377034412 0ustar00jvanekmock00000000000000/*Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.policyeditor; import java.util.HashSet; import java.util.Set; import static org.junit.Assert.assertTrue; import org.junit.Test; public class PermissionActionsTest { @Test public void testFromString() throws Exception { final String accept = "accept"; final String rw = "read,write"; final PermissionActions p1 = PermissionActions.fromString(accept); final PermissionActions p2 = PermissionActions.fromString(rw); assertTrue("accept should match ACCEPT", p1.equals(PermissionActions.ACCEPT)); assertTrue("read,write should match NONE", p2.equals(PermissionActions.NONE)); } @Test public void testGetActions() throws Exception { final Set actions = new HashSet(); actions.add("accept"); actions.add("connect"); actions.add("resolve"); actions.add("listen"); final String actionsStr = "resolve,listen,connect,accept"; final PermissionActions perm = PermissionActions.fromString(actionsStr); assertTrue("resolve,listen,connect,accept should match NETALL", perm.equals(PermissionActions.NETALL)); assertTrue("NETALL should contain accept, connect, resolve, listen", perm.getActions().equals(actions)); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PaxHeaders.17941/Custom0000644000000000000000000000031412654402377030374 xustar00114 path=icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/CustomPolicyViewerTest.java 30 mtime=1454507263.210432941 30 atime=1454507327.200579523 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/CustomPolicyViewerTest.0000644000175000002070000001346412654402377034405 0ustar00jvanekmock00000000000000/*Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.policyeditor; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import java.util.Collection; import net.sourceforge.jnlp.security.policyeditor.CustomPermission; import net.sourceforge.jnlp.security.policyeditor.CustomPolicyViewer; import net.sourceforge.jnlp.security.policyeditor.PolicyEditor; import org.junit.Before; import org.junit.Test; public class CustomPolicyViewerTest { private CustomPolicyViewer viewer; private static final String CODEBASE = "http://example.com"; private static final CustomPermission PERMISSION = new CustomPermission("java.lang.RuntimePermission", "createClassLoader"); @Before public void setupViewer() { viewer = new CustomPolicyViewer(new PolicyEditor(null), CODEBASE); } @Test(expected = NullPointerException.class) public void testConstructorWithNullPolicyEditor() throws Exception { new CustomPolicyViewer(null, CODEBASE); } @Test(expected = NullPointerException.class) public void testConstructorWithNullCodebase() throws Exception { new CustomPolicyViewer(new PolicyEditor(null), null); } @Test public void testPermissionsSetInitiallyEmpty() throws Exception { assertEquals("Permissions set should be empty", 0, viewer.getCopyOfCustomPermissions().size()); } @Test public void testAddCustomPermission() throws Exception { viewer.addCustomPermission(PERMISSION); assertEquals("Permissions set size mismatch", 1, viewer.getCopyOfCustomPermissions().size()); assertTrue("Permissions set should contain " + PERMISSION, viewer.getCopyOfCustomPermissions().contains(PERMISSION)); } @Test public void testAddCustomPermissionDuplicates() throws Exception { viewer.addCustomPermission(PERMISSION); assertEquals("Permissions set size mismatch", 1, viewer.getCopyOfCustomPermissions().size()); assertTrue("Permissions set should contain " + PERMISSION, viewer.getCopyOfCustomPermissions().contains(PERMISSION)); viewer.addCustomPermission(PERMISSION); assertEquals("Permissions set size should not have changed", 1, viewer.getCopyOfCustomPermissions().size()); assertTrue("Permissions set should still contain " + PERMISSION, viewer.getCopyOfCustomPermissions().contains(PERMISSION)); } @Test(expected = NullPointerException.class) public void testAddCustomPermissionNull() throws Exception { viewer.addCustomPermission(null); } @Test public void testRemoveCustomPermission() throws Exception { viewer.addCustomPermission(PERMISSION); assertEquals("Permissions set size mismatch", 1, viewer.getCopyOfCustomPermissions().size()); assertTrue("Permissions set should contain " + PERMISSION, viewer.getCopyOfCustomPermissions().contains(PERMISSION)); viewer.removeCustomPermission(PERMISSION); assertEquals("Permissions set should be empty", 0, viewer.getCopyOfCustomPermissions().size()); assertFalse("Permissions set should not contain " + PERMISSION, viewer.getCopyOfCustomPermissions().contains(PERMISSION)); } @Test(expected = NullPointerException.class) public void testRemoveCustomPermissionNull() throws Exception { viewer.removeCustomPermission(null); } @Test public void testGetCopyOfCustomPermissionsNotNull() throws Exception { assertNotNull(viewer.getCopyOfCustomPermissions()); } @Test public void testGetCopyOfCustomPermissionsReturnsCopy() throws Exception { final Collection permissions = viewer.getCopyOfCustomPermissions(); permissions.add(PERMISSION); assertNotEquals("Sets should be distinct", viewer.getCopyOfCustomPermissions(), permissions); assertNotEquals("Sizes should not match", viewer.getCopyOfCustomPermissions().size(), permissions.size()); assertTrue("Copy should contain " + PERMISSION, permissions.contains(PERMISSION)); assertFalse("Viewer should not contain " + PERMISSION, viewer.getCopyOfCustomPermissions().contains(PERMISSION)); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PaxHeaders.17941/Custom0000644000000000000000000000031212654402377030372 xustar00112 path=icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/CustomPermissionTest.java 30 mtime=1454507263.210432941 30 atime=1454507327.199579536 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/CustomPermissionTest.ja0000644000175000002070000002172512654402377034426 0ustar00jvanekmock00000000000000/*Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.policyeditor; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertTrue; import org.junit.Test; public class CustomPermissionTest { @Test public void assertFieldsPopulateCorrectly() throws Exception { final CustomPermission cp = new CustomPermission("type", "target", "some,actions"); assertTrue("Permission type should be \"type\"", cp.type.equals("type")); assertTrue("Permission target should be \"target\"", cp.target.equals("target")); assertTrue("Permission actions should be \"some,actions\"", cp.actions.equals("some,actions")); } @Test public void testFromStringWithoutActions() throws Exception { final CustomPermission cp = CustomPermission.fromString("permission java.lang.RuntimePermission \"queuePrintJob\";"); assertTrue("Permission type should be \"java.lang.RuntimePermission\"", cp.type.equals("java.lang.RuntimePermission")); assertTrue("Permission target should be \"queuePrintJob\"", cp.target.equals("queuePrintJob")); assertTrue("Permission actions should be empty", cp.actions.isEmpty()); } @Test public void testFromStringWithActions() throws Exception { final CustomPermission cp = CustomPermission.fromString("permission java.io.FilePermission \"*\", \"read,write\";"); assertTrue("Permission type should be \"java.io.FilePermission\"", cp.type.equals("java.io.FilePermission")); assertTrue("Permission target should be \"*\"", cp.target.equals("*")); assertTrue("Permission actions should be \"read,write\"", cp.actions.equals("read,write")); } @Test public void testMissingQuotationMarks() throws Exception { final CustomPermission cp = CustomPermission.fromString("permission java.io.FilePermission *, read,write;"); assertTrue("Custom permission should be null", cp == null); } @Test public void testActionsMissingComma() throws Exception { final String missingComma = "permission java.io.FilePermission \"*\" \"read,write\";"; final CustomPermission cp1 = CustomPermission.fromString(missingComma); assertTrue("Custom permission for " + missingComma + " should be null", cp1 == null); } @Test public void testActionsMissingFirstQuote() throws Exception { final String missingFirstQuote = "permission java.io.FilePermission \"*\", read,write\";"; final CustomPermission cp2 = CustomPermission.fromString(missingFirstQuote); assertTrue("Custom permission for " + missingFirstQuote + " should be null", cp2 == null); } @Test public void testActionsMissingSecondQuote() throws Exception { final String missingSecondQuote = "permission java.io.FilePermission \"*\", \"read,write;"; final CustomPermission cp3 = CustomPermission.fromString(missingSecondQuote); assertTrue("Custom permission for " + missingSecondQuote + " should be null", cp3 == null); } @Test public void testActionsMissingBothQuotes() throws Exception { final String missingBothQuotes = "permission java.io.FilePermission \"*\", read,write;"; final CustomPermission cp4 = CustomPermission.fromString(missingBothQuotes); assertTrue("Custom permission for " + missingBothQuotes + " should be null", cp4 == null); } @Test public void testActionsMissingAllPunctuation() throws Exception { final String missingAll = "permission java.io.FilePermission \"*\" read,write;"; final CustomPermission cp5 = CustomPermission.fromString(missingAll); assertTrue("Custom permission for " + missingAll + " should be null", cp5 == null); } @Test public void testToString() throws Exception { final CustomPermission cp = new CustomPermission("java.io.FilePermission", "*", "read"); final String expected = "permission java.io.FilePermission \"*\", \"read\";"; assertTrue("Permissions string should have equalled " + expected, cp.toString().equals(expected)); } @Test public void testToStringWithNoActions() throws Exception { final CustomPermission cp = new CustomPermission("java.lang.RuntimePermission", "createClassLoader"); final String expected = "permission java.lang.RuntimePermission \"createClassLoader\";"; assertEquals(expected, cp.toString()); } @Test public void testToStringWithEmptyActions() throws Exception { final CustomPermission cp = new CustomPermission("java.lang.RuntimePermission", "createClassLoader", ""); final String expected = "permission java.lang.RuntimePermission \"createClassLoader\";"; assertEquals(expected, cp.toString()); } @Test public void testCompareToWithNoActions() throws Exception { final CustomPermission cp1 = new CustomPermission("java.io.FilePermission", "*", "read"); final CustomPermission cp2 = new CustomPermission("java.io.FilePermission", "${user.home}${/}*", "read"); final CustomPermission cp3 = new CustomPermission("java.lang.RuntimePermission", "queuePrintJob"); assertTrue("cp1.compareTo(cp2) should be > 0", cp1.compareTo(cp2) > 0); assertTrue("cp1.compareTo(cp1) should be 0", cp1.compareTo(cp1) == 0); assertTrue("cp2.compareTo(cp3) should be < 0", cp2.compareTo(cp3) < 0); } @Test public void testCompareToWithEmptyActions() throws Exception { final CustomPermission cp1 = new CustomPermission("java.io.FilePermission", "*", "read"); final CustomPermission cp2 = new CustomPermission("java.io.FilePermission", "${user.home}${/}*", "read"); final CustomPermission cp3 = new CustomPermission("java.lang.RuntimePermission", "queuePrintJob", ""); assertTrue("cp1.compareTo(cp2) should be > 0", cp1.compareTo(cp2) > 0); assertTrue("cp1.compareTo(cp1) should be 0", cp1.compareTo(cp1) == 0); assertTrue("cp2.compareTo(cp3) should be < 0", cp2.compareTo(cp3) < 0); } @Test public void testConstructFromEnumsToString() throws Exception { final CustomPermission cp = new CustomPermission(PermissionType.FILE_PERMISSION, PermissionTarget.USER_HOME, PermissionActions.READ); final String permissionString = "permission java.io.FilePermission \"${user.home}\", \"read\";"; assertEquals(permissionString, cp.toString()); } @Test public void testEquals() throws Exception { final CustomPermission cp1 = new CustomPermission(PermissionType.RUNTIME_PERMISSION, PermissionTarget.CLASSLOADER); final CustomPermission cp2 = new CustomPermission(PermissionType.RUNTIME_PERMISSION, PermissionTarget.CLASSLOADER); final CustomPermission cp3 = new CustomPermission(PermissionType.RUNTIME_PERMISSION, PermissionTarget.ACCESS_THREADS); assertEquals(cp1, cp2); assertNotEquals(cp1, cp3); } @Test public void testHashcode() throws Exception { final CustomPermission cp1 = new CustomPermission(PermissionType.RUNTIME_PERMISSION, PermissionTarget.CLASSLOADER); final CustomPermission cp2 = new CustomPermission(PermissionType.RUNTIME_PERMISSION, PermissionTarget.CLASSLOADER); final CustomPermission cp3 = new CustomPermission(PermissionType.RUNTIME_PERMISSION, PermissionTarget.ACCESS_THREADS); assertEquals(cp1.hashCode(), cp2.hashCode()); assertNotEquals(cp1.hashCode(), cp3.hashCode()); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/PaxHeaders.17941/dialogs0000644000000000000000000000013212654402377026034 xustar0030 mtime=1454507263.209432954 30 atime=1454507658.776157397 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/dialogs/0000755000175000002070000000000012654402377026634 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/dialogs/PaxHeaders.17941/apptrustwar0000644000000000000000000000013212654402377030430 xustar0030 mtime=1454507263.209432954 30 atime=1454507658.776157397 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/0000755000175000002070000000000012654402377033124 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/PaxHead0000644000000000000000000000033612654402377031134 xustar00132 path=icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/AppTrustWarningPanelTest.java 30 mtime=1454507263.209432954 30 atime=1454507327.199579536 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/AppTrus0000644000175000002070000001520112654402377034444 0ustar00jvanekmock00000000000000package net.sourceforge.jnlp.security.dialogs.apptrustwarningpanel; import java.io.File; import java.io.IOException; import net.sourceforge.jnlp.security.dialogs.apptrustwarningpanel.UnsignedAppletTrustWarningPanel; import net.sourceforge.jnlp.security.dialogs.apptrustwarningpanel.AppTrustWarningPanel; import java.net.URL; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.swing.JButton; import net.sourceforge.jnlp.PluginBridge; import net.sourceforge.jnlp.PluginParameters; import net.sourceforge.jnlp.browsertesting.browsers.firefox.FirefoxProfilesOperator; import net.sourceforge.jnlp.config.PathsAndFiles; import net.sourceforge.jnlp.security.dialogs.SecurityDialogPanel; import org.junit.AfterClass; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import org.junit.BeforeClass; import org.junit.Test; public class AppTrustWarningPanelTest { private static URL mockCodebase; private static URL mockDocumentBase; private static String mockJar; private static String mockMainClass; private static int mockWidth; private static int mockHeight; private static PluginParameters mockParameters; private static PluginBridge mockPluginBridge; /* Should contain an instance of each AppTrustWarningPanel subclass */ private static List panelList = new ArrayList(); private static File appletSecurityBackup; public static void backupAppletSecurity() throws IOException { appletSecurityBackup = File.createTempFile("appletSecurity", "itwTestBAckup"); FirefoxProfilesOperator.copyFile(PathsAndFiles.APPLET_TRUST_SETTINGS_USER.getFile(), appletSecurityBackup); } public static void removeAppletSecurityImpl() throws IOException { if (appletSecurityBackup.exists()) { PathsAndFiles.APPLET_TRUST_SETTINGS_USER.getFile().delete(); } } @AfterClass public static void restoreAppletSecurity() throws IOException { if (appletSecurityBackup.exists()) { removeAppletSecurityImpl(); FirefoxProfilesOperator.copyFile(appletSecurityBackup, PathsAndFiles.APPLET_TRUST_SETTINGS_USER.getFile()); appletSecurityBackup.delete(); } } @BeforeClass public static void setup() throws Exception { backupAppletSecurity(); //emptying .appletTrustSettings to not affect run of this test removeAppletSecurityImpl(); mockCodebase = new URL("http://www.example.com"); mockDocumentBase = new URL("http://www.example.com"); mockJar = "ApplicationName.jar"; mockMainClass = "ApplicationMainClass"; mockWidth = 100; mockHeight = 100; Map fakeMap = new HashMap(); fakeMap.put("code", mockMainClass); mockParameters = new PluginParameters(fakeMap); mockPluginBridge = new PluginBridge(mockCodebase, mockDocumentBase, mockJar, mockMainClass, mockWidth, mockHeight, mockParameters); panelList.add(new UnsignedAppletTrustWarningPanel(null, mockPluginBridge, null)); } @Test public void testJNLPFile() throws Exception { for (AppTrustWarningPanel panel : panelList) { assertNotNull("JNLPFile for " + panel.getClass() + " should not be null", panel.file); } } @Test public void testDimensions() throws Exception { for (AppTrustWarningPanel panel : panelList) { assertTrue("Pane width for " + panel.getClass() + " should be positive", panel.PANE_WIDTH > 0); assertTrue("Top panel height for " + panel.getClass() + " should be positive", panel.TOP_PANEL_HEIGHT > 0); assertTrue("Info panel height for " + panel.getClass() + " should be positive", panel.INFO_PANEL_HEIGHT > 0); assertTrue("Info panel hint height for " + panel.getClass() + " should be positive", panel.INFO_PANEL_HINT_HEIGHT > 0); assertTrue("Question panel height for " + panel.getClass() + " should be positive", panel.QUESTION_PANEL_HEIGHT > 0); } } @Test public void testButtons() throws Exception { for (AppTrustWarningPanel panel : panelList) { assertTrue("Allow Button for " + panel.getClass() + " should be a JButton", panel.getAllowButton() instanceof JButton); assertTrue("Reject Button for " + panel.getClass() + " should be a JButton", panel.getRejectButton() instanceof JButton); } } @Test public void testInfoImage() throws Exception { for (AppTrustWarningPanel panel : panelList) { assertNotNull("infoImage should not be null for " + panel.getClass(), panel.getInfoImage()); } } @Test public void testGetTopLabelTextKey() throws Exception { for (AppTrustWarningPanel panel : panelList) { assertResultTextValid("top panel", panel.getClass(), panel.getTopPanelText()); } } @Test public void testGetInfoLabelTextKey() throws Exception { for (AppTrustWarningPanel panel : panelList) { assertResultTextValid("info panel", panel.getClass(), panel.getInfoPanelText()); } } @Test public void testGetQuestionPanelKey() throws Exception { for (AppTrustWarningPanel panel : panelList) { assertResultTextValid("question panel", panel.getClass(), panel.getQuestionPanelText()); } } @Test public void testHtmlWrap() throws Exception { final String testText = "This is some text"; final String expectedResult = "This is some text"; final String actualResult = SecurityDialogPanel.htmlWrap(testText); assertEquals("htmlWrap should properly wrap text with HTML tags", expectedResult, actualResult); } private static void assertResultTextValid(String propertyName, Class panelType, String result) { assertNotNull(propertyName + " text should not be null for " + panelType, result); assertFalse(propertyName + " text should not be No Resource for " + panelType, result.contains("RNoResource")); assertFalse(propertyName + " label text resource should not be missing for " + panelType, result.contains("Missing Resource:")); assertTrue(propertyName + " text should be html-wrapped for " + panelType, result.startsWith("") && result.endsWith("")); assertFalse(propertyName + " should not have empty fields for " + panelType, result.matches(".*\\{\\d+\\}.*")); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/dialogs/PaxHeaders.17941/TemporaryPe0000644000000000000000000000031112654402377030302 xustar00111 path=icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/dialogs/TemporaryPermissionsTest.java 30 mtime=1454507263.209432954 30 atime=1454507327.199579536 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/dialogs/TemporaryPermissionsTest.jav0000644000175000002070000001204212654402377034413 0ustar00jvanekmock00000000000000/*Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.dialogs; import static org.junit.Assert.assertEquals; import java.awt.AWTPermission; import java.io.FilePermission; import java.security.Permission; import java.util.Arrays; import java.util.Collection; import java.util.HashSet; import java.util.Set; import javax.sound.sampled.AudioPermission; import net.sourceforge.jnlp.security.policyeditor.PolicyEditorPermissions; import org.junit.Test; public class TemporaryPermissionsTest { @Test public void testGetPermission() throws Exception { final Permission expected = new FilePermission(System.getProperty("java.io.tmpdir"), "read"); final Permission generated = TemporaryPermissions.getPermission(PolicyEditorPermissions.READ_TMP_FILES); assertEquals(expected, generated); } @Test public void testGetPermissionsVarargs() throws Exception { final Permission readTmpPermission = new FilePermission(System.getProperty("java.io.tmpdir"), "read"); final Permission writeTmpPermission = new FilePermission(System.getProperty("java.io.tmpdir"), "write"); final Set expected = new HashSet<>(Arrays.asList(readTmpPermission, writeTmpPermission)); final Set generated = new HashSet<>(TemporaryPermissions.getPermissions(PolicyEditorPermissions.READ_TMP_FILES, PolicyEditorPermissions.WRITE_TMP_FILES)); assertEquals(expected, generated); } @Test public void testGetPermissionsVarargsArray() throws Exception { final Permission readTmpPermission = new FilePermission(System.getProperty("java.io.tmpdir"), "read"); final Permission writeTmpPermission = new FilePermission(System.getProperty("java.io.tmpdir"), "write"); final Set expected = new HashSet<>(Arrays.asList(readTmpPermission, writeTmpPermission)); final PolicyEditorPermissions[] arr = new PolicyEditorPermissions[] { PolicyEditorPermissions.READ_TMP_FILES, PolicyEditorPermissions.WRITE_TMP_FILES }; final Set generated = new HashSet<>(TemporaryPermissions.getPermissions(arr)); assertEquals(expected, generated); } @Test public void testGetPermissionsCollection() throws Exception { final Permission readTmpPermission = new FilePermission(System.getProperty("java.io.tmpdir"), "read"); final Permission writeTmpPermission = new FilePermission(System.getProperty("java.io.tmpdir"), "write"); final Set expected = new HashSet<>(Arrays.asList(readTmpPermission, writeTmpPermission)); final Collection coll = Arrays.asList(PolicyEditorPermissions.READ_TMP_FILES, PolicyEditorPermissions.WRITE_TMP_FILES); final Set generated = new HashSet<>(TemporaryPermissions.getPermissions(coll)); assertEquals(expected, generated); } @Test public void testGetPermissionsGroup() throws Exception { final Permission playAudio = new AudioPermission("play"); final Permission recordAudio = new AudioPermission("record"); final Permission print = new RuntimePermission("queuePrintJob"); final Permission clipboard = new AWTPermission("accessClipboard"); final Set expected = new HashSet<>(Arrays.asList(playAudio, recordAudio, print, clipboard)); final Set generated = new HashSet<>(TemporaryPermissions.getPermissions(PolicyEditorPermissions.Group.MediaAccess)); assertEquals(expected, generated); } }icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/PaxHeaders.17941/appletextendedsecur0000644000000000000000000000013212654402377030462 xustar0030 mtime=1454507263.209432954 30 atime=1454507658.776157397 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/0000755000175000002070000000000012654402377032010 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/PaxHeaders.170000644000000000000000000000013212654402377030752 xustar0030 mtime=1454507263.209432954 30 atime=1454507658.776157397 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/impl/0000755000175000002070000000000012654402377032751 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/impl/PaxHeade0000644000000000000000000000033312654402377031123 xustar00129 path=icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/impl/VersionRestrictionTest.java 30 mtime=1454507263.209432954 30 atime=1454507327.199579536 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/impl/VersionR0000644000175000002070000003217512654402377034453 0ustar00jvanekmock00000000000000/* Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.appletextendedsecurity.impl; import java.io.File; import java.io.FilenameFilter; import java.io.IOException; import java.util.Arrays; import java.util.Date; import java.util.List; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.security.appletextendedsecurity.AppletSecurityActions; import net.sourceforge.jnlp.security.appletextendedsecurity.ExecuteAppletAction; import net.sourceforge.jnlp.security.appletextendedsecurity.UnsignedAppletActionEntry; import net.sourceforge.jnlp.security.appletextendedsecurity.UrlRegEx; import net.sourceforge.jnlp.util.FileUtils; import net.sourceforge.jnlp.util.logging.NoStdOutErrTest; import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.Test; public class VersionRestrictionTest extends NoStdOutErrTest { private static File testFile; private static final AppletSecurityActions asa = AppletSecurityActions.fromAction(0, ExecuteAppletAction.ALWAYS); private static final UrlRegEx urx = UrlRegEx.quote("http://aa.bb/"); private static final List archs = Arrays.asList("res.jar"); private static final UnsignedAppletActionEntry aq = new UnsignedAppletActionEntry(asa, new Date(1l), urx, urx, archs); @Before public void preapreNewTestFile() throws IOException { testFile = File.createTempFile("itwAES", "testFile"); testFile.deleteOnExit(); } @After public void removeAllPossibleBackupFiles() throws IOException { File[] f = getBackupFiles(); for (File file : f) { file.deleteOnExit(); } for (File file : f) { file.delete(); } checkBackupFile(false); } private File[] getBackupFiles() { File[] f = testFile.getParentFile().listFiles(new FilenameFilter() { @Override public boolean accept(File dir, String name) { return name.matches(testFile.getName() + "\\.[0123456789]+" + UnsignedAppletActionStorageImpl.BACKUP_SUFFIX); } }); return f; } private void checkBackupFile(boolean created) throws IOException { checkBackupFile(created, 0); } private void checkBackupFile(boolean created, int expectedVersion) throws IOException { File[] f = getBackupFiles(); if (!created) { Assert.assertEquals("no backup should exists", 0, f.length); } else { Assert.assertEquals("there should be exactly one backup", 1, f.length); Assert.assertTrue(f[0].getName().endsWith("." + expectedVersion + UnsignedAppletActionStorageImpl.BACKUP_SUFFIX)); String s = FileUtils.loadFileAsString(f[0]); String l[] = s.split("\\n"); int hc = 0; for (String string : l) { string = string.trim(); if (string.startsWith(UnsignedAppletActionStorageImpl.versionPreffix)) { hc++; if (hc == 1) { Assert.assertTrue("first header must contains warning", string.contains("!WARNING!")); } else { Assert.assertFalse("only first header can contains warning", string.contains("!WARNING!")); } } } Assert.assertTrue("at least one header must be in backup", hc > 0); } } @Test public void numberFormatExceptionInOnInLoad1() throws IOException { ServerAccess.saveFile("#VERSION X\n" + "N 1 \\Qhttp://some.url/\\E \\Qhttp://some.url/\\E jar.jar", testFile); UnsignedAppletActionStorageImpl i1 = new UnsignedAppletActionStorageImpl(testFile); i1.readContents(); Assert.assertEquals(0, i1.items.size()); i1.add(aq); i1.readContents(); Assert.assertEquals(1, i1.items.size()); checkBackupFile(true, 0); } @Test public void numberFormatExceptionInOnInLoad2() throws IOException { ServerAccess.saveFile("#VERSION\n" + "cN:N{YES}; 1 \\Qhttp://some.url/\\E \\Qhttp://some.url/\\E jar.jar", testFile); UnsignedAppletActionStorageImpl i1 = new UnsignedAppletActionStorageImpl(testFile); i1.readContents(); Assert.assertEquals(0, i1.items.size()); i1.add(aq); i1.readContents(); Assert.assertEquals(1, i1.items.size()); checkBackupFile(true, 0); } @Test public void numberFormatExceptionInOnInLoad3() throws IOException { ServerAccess.saveFile("#VERSION \n" + "cN:N{YES}; 1 \\Qhttp://some.url/\\E \\Qhttp://some.url/\\E jar.jar", testFile); UnsignedAppletActionStorageImpl i1 = new UnsignedAppletActionStorageImpl(testFile); i1.readContents(); Assert.assertEquals(0, i1.items.size()); i1.add(aq); i1.readContents(); Assert.assertEquals(1, i1.items.size()); checkBackupFile(true, 0); } @Test public void numberFormatExceptionInOnInLoad4() throws IOException { ServerAccess.saveFile("#VERSION \n" + "cN:N{YES}; 1 \\Qhttp://some.url/\\E \\Qhttp://some.url/\\E jar.jar", testFile); UnsignedAppletActionStorageImpl i1 = new UnsignedAppletActionStorageImpl(testFile); i1.readContents(); Assert.assertEquals(0, i1.items.size()); i1.add(aq); i1.readContents(); Assert.assertEquals(1, i1.items.size()); checkBackupFile(true, 0); } @Test public void correctLoad() throws IOException { ServerAccess.saveFile("#VERSION 2\n" + "N 1 \\Qhttp://some.url/\\E \\Qhttp://some.url/\\E jar.jar", testFile); UnsignedAppletActionStorageImpl i1 = new UnsignedAppletActionStorageImpl(testFile); i1.readContents(); Assert.assertEquals(1, i1.items.size()); i1.add(aq); i1.readContents(); Assert.assertEquals(2, i1.items.size()); checkBackupFile(false); } @Test public void correctLoad2() throws IOException { ServerAccess.saveFile("#VERSION 2" + "\n" + "N 1 \\Qhttp://some.url/\\E \\Qhttp://some.url/\\E jar.jar" + "\n" + "N 1 \\Qhttp://some2.url/\\E \\Qhttp://some2.url/\\E jar.jar", testFile); UnsignedAppletActionStorageImpl i1 = new UnsignedAppletActionStorageImpl(testFile); i1.readContents(); Assert.assertEquals(2, i1.items.size()); i1.add(aq); i1.readContents(); Assert.assertEquals(3, i1.items.size()); checkBackupFile(false); } @Test public void correctLoad3() throws IOException { ServerAccess.saveFile("\n" + "\n" + "#VERSION 2" + "\n" + "\n" + "N 1 \\Qhttp://some.url/\\E \\Qhttp://some.url/\\E jar.jar" + "\n" + "N 1 \\Qhttp://some2.url/\\E \\Qhttp://some2.url/\\E jar.jar", testFile); UnsignedAppletActionStorageImpl i1 = new UnsignedAppletActionStorageImpl(testFile); i1.readContents(); Assert.assertEquals(2, i1.items.size()); i1.add(aq); i1.readContents(); Assert.assertEquals(3, i1.items.size()); checkBackupFile(false); } @Test public void firstVersionValidOnlyOK() throws IOException { ServerAccess.saveFile("\n" + "\n" + "#VERSION 2" + "\n" + "#VERSION 1" + "\n" + "\n" + "N 1 \\Qhttp://some.url/\\E \\Qhttp://some.url/\\E jar.jar" + "\n" + "N 1 \\Qhttp://some2.url/\\E \\Qhttp://some2.url/\\E jar.jar", testFile); UnsignedAppletActionStorageImpl i1 = new UnsignedAppletActionStorageImpl(testFile); i1.readContents(); Assert.assertEquals(2, i1.items.size()); i1.add(aq); i1.readContents(); Assert.assertEquals(3, i1.items.size()); checkBackupFile(false); } @Test public void firstVersionValidOnlyBad() throws IOException { ServerAccess.saveFile("\n" + "\n" + "#VERSION 1" + "\n" + "#VERSION 2" + "\n" + "\n" + "N 1 \\Qhttp://some.url/\\E \\Qhttp://some.url/\\E jar.jar" + "\n" + "N 1 \\Qhttp://some2.url/\\E \\Qhttp://some2.url/\\E jar.jar", testFile); UnsignedAppletActionStorageImpl i1 = new UnsignedAppletActionStorageImpl(testFile); i1.readContents(); Assert.assertEquals(0, i1.items.size()); i1.add(aq); i1.readContents(); Assert.assertEquals(1, i1.items.size()); checkBackupFile(true, 1); } @Test public void laterVersionIgnored() throws IOException { ServerAccess.saveFile("\n" + "\n" + "\n" + "N 1 \\Qhttp://some.url/\\E \\Qhttp://some.url/\\E jar.jar" + "#VERSION 2\n" + "N 1 \\Qhttp://some2.url/\\E \\Qhttp://some2.url/\\E jar.jar", testFile); UnsignedAppletActionStorageImpl i1 = new UnsignedAppletActionStorageImpl(testFile); i1.readContents(); Assert.assertEquals(0, i1.items.size()); i1.add(aq); i1.readContents(); Assert.assertEquals(1, i1.items.size()); checkBackupFile(true); } @Test public void incorrectLoad() throws IOException { ServerAccess.saveFile("#VERSION 1\n" + "N 1 \\Qhttp://some.url/\\E \\Qhttp://some.url/\\E jar.jar", testFile); UnsignedAppletActionStorageImpl i1 = new UnsignedAppletActionStorageImpl(testFile); i1.readContents(); Assert.assertEquals(0, i1.items.size()); i1.add(aq); i1.readContents(); Assert.assertEquals(1, i1.items.size()); checkBackupFile(true, 1); } @Test public void incorrectLoad1() throws IOException { ServerAccess.saveFile("#VERSION2\n" + "N 1 \\Qhttp://some.url/\\E \\Qhttp://some.url/\\E jar.jar", testFile); UnsignedAppletActionStorageImpl i1 = new UnsignedAppletActionStorageImpl(testFile); i1.readContents(); Assert.assertEquals(0, i1.items.size()); i1.add(aq); i1.readContents(); Assert.assertEquals(1, i1.items.size()); checkBackupFile(true, 0); } @Test public void incorrectLoad2() throws IOException { ServerAccess.saveFile("#VERSION 1" + "\n" + "N 1 \\Qhttp://some.url/\\E \\Qhttp://some.url/\\E jar.jar" + "\n" + "N 1 \\Qhttp://some2.url/\\E \\Qhttp://some2.url/\\E jar.jar", testFile); UnsignedAppletActionStorageImpl i1 = new UnsignedAppletActionStorageImpl(testFile); i1.readContents(); Assert.assertEquals(0, i1.items.size()); i1.add(aq); i1.readContents(); Assert.assertEquals(1, i1.items.size()); checkBackupFile(true, 1); } @Test public void noVersionNoLoad() throws IOException { ServerAccess.saveFile("\n" + "N 1 \\Qhttp://some.url/\\E \\Qhttp://some.url/\\E jar.jar" + "\n" + "N 1 \\Qhttp://some2.url/\\E \\Qhttp://some2.url/\\E jar.jar", testFile); UnsignedAppletActionStorageImpl i1 = new UnsignedAppletActionStorageImpl(testFile); i1.readContents(); Assert.assertEquals(0, i1.items.size()); i1.add(aq); i1.readContents(); Assert.assertEquals(1, i1.items.size()); checkBackupFile(true); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/impl/PaxHeade0000644000000000000000000000035012654402377031122 xustar00142 path=icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/impl/UnsignedAppletActionStorageImplTest.java 30 mtime=1454507263.209432954 30 atime=1454507327.199579536 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/impl/Unsigned0000644000175000002070000002711712654402377034460 0ustar00jvanekmock00000000000000/* Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.appletextendedsecurity.impl; import net.sourceforge.jnlp.security.appletextendedsecurity.UnsignedAppletActionEntry; import java.io.File; import java.io.IOException; import java.util.Arrays; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.security.appletextendedsecurity.AppletSecurityActions; import net.sourceforge.jnlp.security.appletextendedsecurity.ExecuteAppletAction; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; public class UnsignedAppletActionStorageImplTest { private static final String versionLine=UnsignedAppletActionStorageImpl.versionPreffix+UnsignedAppletActionStorageImpl.currentVersion+"\n"; private static File f1; private static File f2; private static File f3; private static File ff1; private static File ff2; private static File ff3; private static File ff4; public static final int ZERO = AppletSecurityActions.UNSIGNED_APPLET_ACTION; public static final int ONE = AppletSecurityActions.MATCHING_ALACA_ACTION; @BeforeClass public static void preapreTestFiles() throws IOException { f1 = File.createTempFile("itwMatching", "testFile1"); f2 = File.createTempFile("itwMatching", "testFile2"); f3 = File.createTempFile("itwMatching", "testFile3"); ServerAccess.saveFile(versionLine + "A 123456 .* .* jar1,jar2", f1); ServerAccess.saveFile(versionLine + "N 123456 .* \\Qbla\\E jar1,jar2", f2); ServerAccess.saveFile(versionLine + "A 1 \\Qhttp://jmol.sourceforge.net/demo/atoms/\\E \\Qhttp://jmol.sourceforge.net/jmol/\\E JmolApplet0.jar\n" + "N 1363278653454 \\Qhttp://www.walter-fendt.de/ph14e\\E.* \\Qhttp://www.walter-fendt.de\\E.*\n" + "n 1363281783104 \\Qhttp://www.walter-fendt.de/ph14e/inclplane.htm\\E \\Qhttp://www.walter-fendt.de/ph14_jar/\\E Ph14English.jar,SchiefeEbene.jar" + "yA 1 \\Qhttp://jmol.sourceforge.net/demo/atoms/\\E \\Qhttp://jmol.sourceforge.net/jmol/\\E JmolApplet0.jar\n" + "Ay 1363278653454 \\Qhttp://www.walter-fendt.de/ph14e\\E.* \\Qhttp://www.walter-fendt.de\\E.*\n" + "nn 1363281783104 \\Qhttp://www.walter-fendt.de/ph14e/inclplane.htm\\E \\Qhttp://www.walter-fendt.de/ph14_jar/\\E Ph14English.jar,SchiefeEbene.jar" + "", f3); ff1 = File.createTempFile("itwMatching", "testFile1"); ff2 = File.createTempFile("itwMatching", "testFile2"); ff3 = File.createTempFile("itwMatching", "testFile3"); ff4 = File.createTempFile("itwMatching", "testFile3"); ServerAccess.saveFile(versionLine + "AXn 123456 .* .* jar1,jar2", ff1); ServerAccess.saveFile(versionLine + "XXXXXy 123456 .* \\Qbla\\E jar1,jar2", ff2); ServerAccess.saveFile(versionLine + "XXXXXY 123456 .* \\Qbla\\E jar1,jar2", ff4);//errornous ServerAccess.saveFile(versionLine + "XA 1 \\Qa\\E \\Qb\\E jar1\n" + "NNA 2 \\Qc\\E \\Qd\\E\n" + "nyXyn 3 \\Qe\\E \\Qf\\E j1,j2" + "", ff3); } @AfterClass public static void removeTestFiles() throws IOException { f1.delete(); f2.delete(); f3.delete(); ff1.delete(); ff2.delete(); ff3.delete(); ff4.delete(); } @Test public void multipleActionsf4JustLoad() { UnsignedAppletActionStorageImpl i1 = new UnsignedAppletActionStorageImpl(ff4); //pass } @Test(expected = RuntimeException.class) public void multipleActionsf4() { UnsignedAppletActionStorageImpl i1 = new UnsignedAppletActionStorageImpl(ff4); //reed whatever UnsignedAppletActionEntry r1 = i1.getMatchingItem("a", "b", Arrays.asList(new String[]{"jar1"}), ZERO); //fail } @Test public void multipleActionsf3() { UnsignedAppletActionStorageImpl i1 = new UnsignedAppletActionStorageImpl(ff3); UnsignedAppletActionEntry r1 = i1.getMatchingItem("a", "b", Arrays.asList(new String[]{"jar1"}), ONE); UnsignedAppletActionEntry r2 = i1.getMatchingItem("c", "d", Arrays.asList(new String[]{}), ONE); UnsignedAppletActionEntry r3 = i1.getMatchingItem("e", "f", Arrays.asList(new String[]{"j1", "j2"}), ONE); Assert.assertNotNull("r1 should be found", r1); checkValues(r1, ExecuteAppletAction.UNSET, ExecuteAppletAction.ALWAYS); Assert.assertNotNull("r2 should be found", r2); checkValues(r2, ExecuteAppletAction.NEVER, ExecuteAppletAction.NEVER, ExecuteAppletAction.ALWAYS); Assert.assertNotNull("r3 should be found", r3); checkValues(r3, ExecuteAppletAction.NO, ExecuteAppletAction.YES, ExecuteAppletAction.UNSET, ExecuteAppletAction.YES, ExecuteAppletAction.NO); } @Test public void multipleActionsf2() { UnsignedAppletActionStorageImpl i1 = new UnsignedAppletActionStorageImpl(ff2); UnsignedAppletActionEntry r1 = i1.getMatchingItem("whatever", "bla", Arrays.asList(new String[]{"jar1", "jar2"}), ONE); Assert.assertNotNull("r1 should be found", r1); checkValues(r1, ExecuteAppletAction.UNSET, ExecuteAppletAction.UNSET, ExecuteAppletAction.UNSET, ExecuteAppletAction.UNSET, ExecuteAppletAction.UNSET, ExecuteAppletAction.YES); } @Test public void multipleActionsf1() { UnsignedAppletActionStorageImpl i1 = new UnsignedAppletActionStorageImpl(ff1); UnsignedAppletActionEntry r1 = i1.getMatchingItem("bla", "blaBla", Arrays.asList(new String[]{"jar1", "jar2"}), ONE); Assert.assertNotNull("r1 should be found", r1); checkValues(r1, ExecuteAppletAction.ALWAYS, ExecuteAppletAction.UNSET, ExecuteAppletAction.NO); } @Test public void wildcards1() { UnsignedAppletActionStorageImpl i1 = new UnsignedAppletActionStorageImpl(f3); UnsignedAppletActionEntry r1 = i1.getMatchingItem("http://www.walter-fendt.de/ph14e/inclplane.htm", "http://www.walter-fendt.de/ph14_jar/", Arrays.asList(new String[]{"Ph14English.jar", "SchiefeEbene.jar"}), ZERO); Assert.assertNotNull("r1 should be found", r1); ServerAccess.logOutputReprint(r1.toString()); checkValues(r1, ExecuteAppletAction.NEVER); } @Test public void allMatchingDocAndCode() { UnsignedAppletActionStorageImpl i1 = new UnsignedAppletActionStorageImpl(f1); UnsignedAppletActionEntry r1 = i1.getMatchingItem("bla", "blaBla", Arrays.asList(new String[]{"jar1", "jar2"}), ZERO); Assert.assertNotNull("r1 should be found", r1); checkValues(r1, ExecuteAppletAction.ALWAYS); UnsignedAppletActionEntry r3 = i1.getMatchingItem("blah", "blaBla", Arrays.asList(new String[]{"jar2", "jar1"}), ZERO); checkValues(r3, ExecuteAppletAction.ALWAYS); Assert.assertNotNull("r3 should be found", r3); UnsignedAppletActionEntry r4 = i1.getMatchingItem("blha", "blaBlam", Arrays.asList(new String[]{"jar2", "wrong_jar"}), ZERO); Assert.assertNull("r4 should NOT be found", r4); UnsignedAppletActionEntry r5 = i1.getMatchingItem("blaBla", "blaBlaBla", Arrays.asList(new String[]{"jar2"}), ZERO); Assert.assertNull("r5 should NOT be found", r5); } @Test public void allMatchingDocAndStrictCode() { UnsignedAppletActionStorageImpl i1 = new UnsignedAppletActionStorageImpl(f2); UnsignedAppletActionEntry r1 = i1.getMatchingItem("whatever", "bla", Arrays.asList(new String[]{"jar1", "jar2"}), ZERO); Assert.assertNotNull("r1 should be found", r1); checkValues(r1, ExecuteAppletAction.NEVER); UnsignedAppletActionEntry r3 = i1.getMatchingItem("whatever", null, Arrays.asList(new String[]{"jar2", "jar1"}), ZERO); Assert.assertNotNull("r3 should be found", r3); checkValues(r3, ExecuteAppletAction.NEVER); UnsignedAppletActionEntry r2 = i1.getMatchingItem("bla", "blaBlam", Arrays.asList(new String[]{"jar1", "jar2"}), ZERO); Assert.assertNull("r2 should NOT be found", r2); UnsignedAppletActionEntry r4 = i1.getMatchingItem(null, "blaBlam", null, ZERO); Assert.assertNull("r4 should NOT be found", r4); } @Test public void allMatchingDocAndCodeWithNulls() { UnsignedAppletActionStorageImpl i1 = new UnsignedAppletActionStorageImpl(f1); UnsignedAppletActionEntry r1 = i1.getMatchingItem("bla", "blaBla", null, ZERO); Assert.assertNotNull("r1 should be found", r1); checkValues(r1, ExecuteAppletAction.ALWAYS); UnsignedAppletActionEntry r3 = i1.getMatchingItem("bla", "whatever", null, ZERO); Assert.assertNotNull("r3 should be found", r3); checkValues(r3, ExecuteAppletAction.ALWAYS); UnsignedAppletActionEntry r2 = i1.getMatchingItem("bla", "blaBla", Arrays.asList(new String[]{"jar2", "jar1"}), ZERO); Assert.assertNotNull("r2 should be found", r2); checkValues(r2, ExecuteAppletAction.ALWAYS); UnsignedAppletActionEntry r4 = i1.getMatchingItem("bla", "blaBla", null, ZERO); Assert.assertNotNull("r4 should be found", r4); checkValues(r2, ExecuteAppletAction.ALWAYS); UnsignedAppletActionEntry r5 = i1.getMatchingItem("", "blaBla", Arrays.asList(new String[]{"jar2", "jar1"}), ZERO); Assert.assertNotNull("r5 should be found", r5); UnsignedAppletActionEntry r6 = i1.getMatchingItem(null, null, Arrays.asList(new String[]{"jar2", "jar1"}), ZERO); Assert.assertNotNull("r6 should be found", r6); UnsignedAppletActionEntry r7 = i1.getMatchingItem(null, null, Arrays.asList(new String[]{"jar2", "jar11"}), ZERO); Assert.assertNull("r7 should NOT be found", r7); } private void checkValues(UnsignedAppletActionEntry item, ExecuteAppletAction... items) { AppletSecurityActions as = item.getAppletSecurityActions(); for (int i = 0; i < items.length; i++) { Assert.assertEquals(items[i], as.getAction(i)); } for (int i = items.length; i < 1000; i++) { Assert.assertEquals(ExecuteAppletAction.UNSET, as.getAction(i)); } } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/PaxHeaders.170000644000000000000000000000031312654402377030753 xustar00114 path=icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/UrlRegExTest.java 30 mtime=1454507263.208432968 29 atime=1454507327.19857955 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/UrlRegExTest.0000644000175000002070000002174312654402377034355 0ustar00jvanekmock00000000000000/* Copyright (C) 2015 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.appletextendedsecurity; import org.junit.Assert; import org.junit.Test; public class UrlRegExTest { @Test public void testSimpleUnquote2() throws Exception { Assert.assertEquals("aabbccddee", UrlRegEx.simpleUnquote("aa\\Qbb\\Ecc\\Qdd\\Eee")); Assert.assertEquals("aabbccddee", UrlRegEx.simpleUnquote("aa\\Qbb\\Ecc\\Qdd\\Eee")); Assert.assertEquals("a\\Ea\\Ee\\Ee", UrlRegEx.simpleUnquote("a\\Ea\\Q\\E\\E\\Q\\Ee\\Ee")); Assert.assertEquals("http://url.cz/", UrlRegEx.simpleUnquote("\\Qhttp://url.cz/\\E")); Assert.assertEquals("http://url.cz/.*", UrlRegEx.simpleUnquote("\\Qhttp://url.cz/\\E.*")); Assert.assertEquals("http://ur\\El.cz/.*", UrlRegEx.simpleUnquote("\\Qhttp://ur\\E\\E\\Ql.cz/\\E.*")); } @Test public void testSimpleUnquote1() throws Exception { Assert.assertEquals("\\Q", UrlRegEx.simpleUnquote("\\Q\\Q\\E")); Assert.assertEquals("a\\Q", UrlRegEx.simpleUnquote("a\\Q\\Q\\E")); Assert.assertEquals("\\Qb", UrlRegEx.simpleUnquote("\\Q\\Q\\Eb")); Assert.assertEquals("a\\Qb", UrlRegEx.simpleUnquote("a\\Q\\Q\\Eb")); Assert.assertEquals("abc", UrlRegEx.simpleUnquote("a\\Qb\\Ec")); Assert.assertEquals("aabbcc", UrlRegEx.simpleUnquote("aa\\Qbb\\Ecc")); Assert.assertEquals("aabb", UrlRegEx.simpleUnquote("aa\\Qbb\\E")); Assert.assertEquals("bbcc", UrlRegEx.simpleUnquote("\\Qbb\\Ecc")); Assert.assertEquals("aacc", UrlRegEx.simpleUnquote("aa\\Q\\Ecc")); Assert.assertEquals("a", UrlRegEx.simpleUnquote("\\Qa\\E")); Assert.assertEquals("ab", UrlRegEx.simpleUnquote("\\Qab\\E")); Assert.assertEquals("", UrlRegEx.simpleUnquote("\\Q\\E")); Assert.assertEquals("", UrlRegEx.simpleUnquote("")); Assert.assertEquals("a", UrlRegEx.simpleUnquote("a")); Assert.assertEquals("ab", UrlRegEx.simpleUnquote("ab")); Assert.assertEquals("abc", UrlRegEx.simpleUnquote("abc")); Assert.assertEquals("Q", UrlRegEx.simpleUnquote("Q")); Assert.assertEquals("QE", UrlRegEx.simpleUnquote("QE")); Assert.assertEquals("Q\\E", UrlRegEx.simpleUnquote("Q\\E")); Assert.assertEquals("\\E", UrlRegEx.simpleUnquote("\\E")); Assert.assertEquals("\\E\\E\\E", UrlRegEx.simpleUnquote("\\E\\E\\E")); } @Test public void testReplaceAll1() throws Exception { Assert.assertEquals("abcd", UrlRegEx.replaceLast("abcd", "X", "Y")); Assert.assertEquals("abcD", UrlRegEx.replaceLast("abcd", "d", "D")); Assert.assertEquals("abcDef", UrlRegEx.replaceLast("abcdef", "d", "D")); Assert.assertEquals("abcdD", UrlRegEx.replaceLast("abcdd", "d", "D")); Assert.assertEquals("Abcd", UrlRegEx.replaceLast("abcd", "a", "A")); Assert.assertEquals("aAbcd", UrlRegEx.replaceLast("aabcd", "a", "A")); } @Test public void testReplaceAll2() throws Exception { Assert.assertEquals("abcd", UrlRegEx.replaceLast("abcd", "abcde", "")); Assert.assertEquals("abc", UrlRegEx.replaceLast("abcd", "d", "")); Assert.assertEquals("abcef", UrlRegEx.replaceLast("abcdef", "d", "")); Assert.assertEquals("bcdef", UrlRegEx.replaceLast("abcdef", "a", "")); Assert.assertEquals("abcdef", UrlRegEx.replaceLast("aabcdef", "a", "")); Assert.assertEquals("ab", UrlRegEx.replaceLast("abcd", "cd", "")); Assert.assertEquals("abf", UrlRegEx.replaceLast("abcdef", "cde", "")); Assert.assertEquals("cdef", UrlRegEx.replaceLast("abcdef", "ab", "")); Assert.assertEquals("acdef", UrlRegEx.replaceLast("aabcdef", "ab", "")); Assert.assertEquals("", UrlRegEx.replaceLast("abc", "abc", "")); } @Test public void testReplaceAll3() throws Exception { Assert.assertEquals("abcd", UrlRegEx.replaceLast("abcd", "xyz", "ABCDE")); Assert.assertEquals("abcDD", UrlRegEx.replaceLast("abcd", "d", "DD")); Assert.assertEquals("abcDDDef", UrlRegEx.replaceLast("abcdef", "d", "DDD")); Assert.assertEquals("AAbcdef", UrlRegEx.replaceLast("abcdef", "a", "AA")); Assert.assertEquals("aAAAbcdef", UrlRegEx.replaceLast("aabcdef", "a", "AAA")); Assert.assertEquals("abXCDY", UrlRegEx.replaceLast("abcd", "cd", "XCDY")); Assert.assertEquals("abXCDEYZf", UrlRegEx.replaceLast("abcdef", "cde", "XCDEYZ")); Assert.assertEquals("XABYcdef", UrlRegEx.replaceLast("abcdef", "ab", "XABY")); Assert.assertEquals("aABCDcdef", UrlRegEx.replaceLast("aabcdef", "ab", "ABCD")); Assert.assertEquals("ABC", UrlRegEx.replaceLast("abc", "abc", "ABC")); Assert.assertEquals("ABCE", UrlRegEx.replaceLast("abc", "abc", "ABCE")); } @Test public void testExact() throws Exception { String s1 = "string"; String s2 = "reg.*ex"; String s3 = "reg\\Eex"; String s4 = "reg\\.\\*ex"; UrlRegEx a1 = UrlRegEx.exact(s1); UrlRegEx a2 = UrlRegEx.exact(s2); UrlRegEx a3 = UrlRegEx.exact(s3); UrlRegEx a4 = UrlRegEx.exact(s4); Assert.assertEquals(s1, a1.getRegEx()); Assert.assertEquals(s2, a2.getRegEx()); Assert.assertEquals(s3, a3.getRegEx()); Assert.assertEquals(s4, a4.getRegEx()); Assert.assertTrue("regXXXex".matches(a2.getRegEx())); Assert.assertFalse("regXXXex".matches(a4.getRegEx())); Assert.assertEquals(s1, a1.getFilteredRegEx()); Assert.assertEquals(s2, a2.getFilteredRegEx()); Assert.assertEquals(s3, a3.getFilteredRegEx()); Assert.assertEquals(s4, a4.getFilteredRegEx()); } @Test public void testQuote1() throws Exception { String s1 = "string"; String s2 = "reg.*ex"; String s3 = "reg\\.\\*ex"; UrlRegEx a1 = UrlRegEx.quote(s1); UrlRegEx a2 = UrlRegEx.quote(s2); UrlRegEx a3 = UrlRegEx.quote(s3); Assert.assertEquals("\\Q" + s1 + "\\E", a1.getRegEx()); Assert.assertEquals("\\Q" + s2 + "\\E", a2.getRegEx()); Assert.assertEquals("\\Q" + s3 + "\\E", a3.getRegEx()); Assert.assertTrue("string".matches(a1.getRegEx())); Assert.assertFalse("regXXXex".matches(a2.getRegEx())); Assert.assertTrue("reg.*ex".matches(a2.getRegEx())); Assert.assertFalse("regXXXex".matches(a3.getRegEx())); Assert.assertFalse("reg.*ex".matches(a3.getRegEx())); Assert.assertTrue("reg\\.\\*ex".matches(a3.getRegEx())); Assert.assertEquals(s1, a1.getFilteredRegEx()); Assert.assertEquals(s2, a2.getFilteredRegEx()); Assert.assertEquals(s3, a3.getFilteredRegEx()); } @Test public void testQuote2() throws Exception { String s1 = "stri\\Eng"; String s2 = "reg.*ex"; String s3 = "reg\\.\\*ex"; UrlRegEx a1 = UrlRegEx.quote(s1); UrlRegEx a2 = UrlRegEx.quote(s2); UrlRegEx a3 = UrlRegEx.quote(s3); Assert.assertNotEquals("\\Qstri\\Eng\\E", a1.getRegEx()); Assert.assertEquals("\\Q" + s2 + "\\E", a2.getRegEx()); Assert.assertEquals("\\Q" + s3 + "\\E", a3.getRegEx()); Assert.assertFalse("regXXXex".matches(a2.getRegEx())); Assert.assertTrue("reg.*ex".matches(a2.getRegEx())); Assert.assertTrue("stri\\Eng".matches(a1.getRegEx())); Assert.assertEquals(s1, a1.getFilteredRegEx()); Assert.assertEquals(s2, a2.getFilteredRegEx()); Assert.assertEquals(s3, a3.getFilteredRegEx()); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/PaxHeaders.170000644000000000000000000000034212654402377030755 xustar00137 path=icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletTrustConfirmationTest.java 30 mtime=1454507263.208432968 29 atime=1454507327.19857955 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedApple0000644000175000002070000003507412654402377034502 0ustar00jvanekmock00000000000000/* Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.appletextendedsecurity; import java.io.File; import java.io.IOException; import java.io.StringReader; import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.net.MalformedURLException; import java.net.URL; import static org.junit.Assert.assertEquals; import java.util.Arrays; import java.util.List; import java.util.Properties; import net.sourceforge.jnlp.InformationDesc; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.browsertesting.browsers.firefox.FirefoxProfilesOperator; import net.sourceforge.jnlp.config.PathsAndFiles; import net.sourceforge.jnlp.mock.DummyJNLPFileWithJar; import net.sourceforge.jnlp.security.appletextendedsecurity.impl.UnsignedAppletActionStorageImpl; import net.sourceforge.jnlp.security.dialogs.apptrustwarningpanel.UnsignedAppletTrustWarningPanel; import net.sourceforge.jnlp.util.FileUtils; import net.sourceforge.jnlp.util.UrlUtils; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; public class UnsignedAppletTrustConfirmationTest { private static final String surl1 = "http://codeba.se/app"; private static final String url41 = "http://my.url/app/"; private static final String url42 = "resource.jar"; private static URL url; private static URL url4; private static class DummyJnlpWithTitleAndUrls extends DummyJNLPFileWithJar { public DummyJnlpWithTitleAndUrls(URL u) throws MalformedURLException { super(url, u); } @Override public InformationDesc getInformation() { return new InformationDesc(null, false) { @Override public String getTitle() { return "Demo App"; } }; } @Override public URL getCodeBase() { return url; } @Override public URL getSourceLocation() { return url; } }; @BeforeClass public static void initUrl() throws MalformedURLException { url=new URL(surl1); url4=new URL(url41+url42); } private static File backup; @BeforeClass public static void backupAppTrust() throws IOException{ backup = File.createTempFile("appletExtendedSecurity", "itwUnittest"); backup.deleteOnExit(); FirefoxProfilesOperator.copyFile(PathsAndFiles.APPLET_TRUST_SETTINGS_USER.getFile(), backup); } @AfterClass public static void restoreAppTrust() throws IOException{ FirefoxProfilesOperator.copyFile(backup, PathsAndFiles.APPLET_TRUST_SETTINGS_USER.getFile()); } @Test public void updateAppletActionTest1() throws Exception { PathsAndFiles.APPLET_TRUST_SETTINGS_USER.getFile().delete(); //clean file to examine later UnsignedAppletTrustConfirmation.updateAppletAction( new DummyJnlpWithTitleAndUrls(url4), ExecuteAppletAction.ALWAYS, Boolean.FALSE, 0); String s = FileUtils.loadFileAsString(PathsAndFiles.APPLET_TRUST_SETTINGS_USER.getFile()); s = s.replaceAll("#.*\n", ""); Assert.assertTrue(s.startsWith("A")); Assert.assertTrue(s.contains(url41+url42)); Assert.assertTrue(s.contains(surl1)); UnsignedAppletTrustConfirmation.updateAppletAction( new DummyJnlpWithTitleAndUrls(url4), ExecuteAppletAction.NEVER, Boolean.TRUE, 0); s = FileUtils.loadFileAsString(PathsAndFiles.APPLET_TRUST_SETTINGS_USER.getFile()); s = s.replaceAll("#.*\n", ""); Assert.assertTrue(s.startsWith("N")); Assert.assertFalse(s.contains(url41+url42)); Assert.assertTrue(s.contains(surl1)); } @Test public void testToRelativePaths() throws Exception { /* Absolute -> Relative */ assertEquals(Arrays.asList("test.jar"), UnsignedAppletTrustConfirmation.toRelativePaths(Arrays.asList("http://example.com/test.jar"), "http://example.com/")); /* Relative is unchanged */ assertEquals(Arrays.asList("test.jar"), UnsignedAppletTrustConfirmation.toRelativePaths(Arrays.asList("test.jar"), "http://example.com/")); /* Different root URL is unchanged */ assertEquals(Arrays.asList("http://example2.com/test.jar"), UnsignedAppletTrustConfirmation.toRelativePaths(Arrays.asList("http://example2.com/test.jar"), "http://example.com/")); /* Path with invalid URL characters is handled */ assertEquals(Arrays.asList("test .jar"), UnsignedAppletTrustConfirmation.toRelativePaths(Arrays.asList("http://example.com/test .jar"), "http://example.com/")); } @Test public void testSripFile() throws Exception { String sample = "http://aa.bb/"; String result = UrlUtils.stripFile(new URL(sample)); assertEquals(sample, result); sample = "http://aa.bb"; result = UrlUtils.stripFile(new URL(sample)); assertEquals(sample + "/", result); sample = "http://aa.bb/"; result = UrlUtils.stripFile(new URL(sample + "cc")); assertEquals(sample, result); sample = "http://aa.bb/cc/"; result = UrlUtils.stripFile(new URL(sample)); assertEquals(sample, result); sample = "http://aa.bb/some/complicated/"; result = UrlUtils.stripFile(new URL(sample + "some")); assertEquals(sample, result); sample = "http://aa.bb/some/complicated/some/"; result = UrlUtils.stripFile(new URL(sample)); assertEquals(sample, result); sample = "http://aa.bb/some/"; result = UrlUtils.stripFile(new URL(sample + "strange?a=b")); assertEquals(sample, result); sample = "http://aa.bb/some/strange/"; result = UrlUtils.stripFile(new URL(sample + "?a=b")); assertEquals(sample, result); } private static URL urlX1; private static URL urlX2; private static URL urlX3; private static URL urlY1; private static URL urlY2; private static URL urlY3; private static URL urlY4; private static URL urlY5; private static URL urlY6; private static URL urlY7; private static URL urlY8; @BeforeClass public static void initUrlsX123() throws MalformedURLException, IOException { urlX1 = new URL("http:// does not metter is ok"); urlX2 = new URL("http://\ndoes not metter is harmfull"); Properties p = new Properties(); p.load(new StringReader("key=http:\\u002F\\u002F\\u000Adoes\\u0020not\\u0020metter\\u0020is\\u0020harmfull")); urlX3=new URL(p.getProperty("key")); } @BeforeClass public static void initUrlsY12345678() throws MalformedURLException, IOException { urlY1 = new URL("http://som\\EeUrl.cz/aa"); urlY2 = new URL("http://some\\QUrl.cz/aa"); urlY3 = new URL("http://so\\QmeU\\Erl.cz/aa"); urlY4 = new URL("http://so\\EmeU\\Qrl.cz/aa"); urlY5 = new URL("http://someUrl.cz/aa\\Ebb/cc"); urlY6 = new URL("http://someUrl.cz/aa\\Qbb/cc"); urlY7 = new URL("http://someUrl.cz/aa\\Qbb/cc/dd\\Eee"); urlY8 = new URL("http://someUrl.cz/aa\\Ebb/cc/dd\\Qee"); } @Test public void updateAppletActionTestYQN1234saveAndLoadFine() throws Exception { PathsAndFiles.APPLET_TRUST_SETTINGS_USER.getFile().delete(); //clean file to examine later UnsignedAppletTrustConfirmation.updateAppletAction( new DummyJnlpWithTitleAndUrlsWithOverwrite(urlY1), ExecuteAppletAction.ALWAYS, Boolean.FALSE, 0); UnsignedAppletTrustConfirmation.updateAppletAction( new DummyJnlpWithTitleAndUrlsWithOverwrite(urlY2), ExecuteAppletAction.ALWAYS, Boolean.FALSE, 0); UnsignedAppletTrustConfirmation.updateAppletAction( new DummyJnlpWithTitleAndUrlsWithOverwrite(urlY3), ExecuteAppletAction.ALWAYS, Boolean.FALSE, 0); UnsignedAppletTrustConfirmation.updateAppletAction( new DummyJnlpWithTitleAndUrlsWithOverwrite(urlY4), ExecuteAppletAction.ALWAYS, Boolean.FALSE, 0); AppletStartupSecuritySettings securitySettings = AppletStartupSecuritySettings.getInstance(); UnsignedAppletActionStorageImpl userActionStorage = (UnsignedAppletActionStorageImpl) securitySettings.getUnsignedAppletActionCustomStorage(); List ll = userActionStorage.getMatchingItems(null, null, null); Assert.assertEquals(4, ll.size()); } @Test public void updateAppletActionTestYQN5678saveAndLoadFine() throws Exception { PathsAndFiles.APPLET_TRUST_SETTINGS_USER.getFile().delete(); //clean file to examine later UnsignedAppletTrustConfirmation.updateAppletAction( new DummyJnlpWithTitleAndUrlsWithOverwrite(urlY5), ExecuteAppletAction.ALWAYS, Boolean.FALSE, 0); UnsignedAppletTrustConfirmation.updateAppletAction( new DummyJnlpWithTitleAndUrlsWithOverwrite(urlY6), ExecuteAppletAction.ALWAYS, Boolean.FALSE, 0); UnsignedAppletTrustConfirmation.updateAppletAction( new DummyJnlpWithTitleAndUrlsWithOverwrite(urlY7), ExecuteAppletAction.ALWAYS, Boolean.FALSE, 0); UnsignedAppletTrustConfirmation.updateAppletAction( new DummyJnlpWithTitleAndUrlsWithOverwrite(urlY8), ExecuteAppletAction.ALWAYS, Boolean.FALSE, 0); AppletStartupSecuritySettings securitySettings = AppletStartupSecuritySettings.getInstance(); UnsignedAppletActionStorageImpl userActionStorage = (UnsignedAppletActionStorageImpl) securitySettings.getUnsignedAppletActionCustomStorage(); List ll = userActionStorage.getMatchingItems(null, null, null); Assert.assertEquals(4, ll.size()); } @Test public void updateAppletActionTestX3() throws Exception { PathsAndFiles.APPLET_TRUST_SETTINGS_USER.getFile().delete(); //clean file to examine later try{ UnsignedAppletTrustConfirmation.updateAppletAction( new DummyJnlpWithTitleAndUrls(urlX3), ExecuteAppletAction.ALWAYS, Boolean.FALSE, 0); //may throw RuntimeExeption which is correct, however, wee need to check result } catch (Exception ex){ ServerAccess.logException(ex); } String s = FileUtils.loadFileAsString(PathsAndFiles.APPLET_TRUST_SETTINGS_USER.getFile()); Assert.assertFalse(s.contains("harmfull")); } @Test public void updateAppletActionTestX2() throws Exception { PathsAndFiles.APPLET_TRUST_SETTINGS_USER.getFile().delete(); //clean file to examine later try{ UnsignedAppletTrustConfirmation.updateAppletAction( new DummyJnlpWithTitleAndUrls(urlX2), ExecuteAppletAction.ALWAYS, Boolean.FALSE, 0); //may throw RuntimeExeption which is correct, however, wee need to check result } catch (Exception ex){ ServerAccess.logException(ex); } String s = FileUtils.loadFileAsString(PathsAndFiles.APPLET_TRUST_SETTINGS_USER.getFile()); Assert.assertFalse(s.contains("harmfull")); } @Test public void updateAppletActionTestX1() throws Exception { //this case is correct, if html ecnoded url is passed as URL from javaws, it is kept intact PathsAndFiles.APPLET_TRUST_SETTINGS_USER.getFile().delete(); //clean file to examine later Exception eex = null; try{ UnsignedAppletTrustConfirmation.updateAppletAction( new DummyJnlpWithTitleAndUrls(urlX1), ExecuteAppletAction.ALWAYS, Boolean.FALSE, 0); //may throw RuntimeExeption which is correct, however, wee need to check result } catch (Exception ex){ eex = ex; ServerAccess.logException(ex); } String s = FileUtils.loadFileAsString(PathsAndFiles.APPLET_TRUST_SETTINGS_USER.getFile()); Assert.assertNull(eex); Assert.assertTrue(s.contains("http:// does not metter is ok")); } private static class DummyJnlpWithTitleAndUrlsWithOverwrite extends DummyJnlpWithTitleAndUrls { private final URL u; public DummyJnlpWithTitleAndUrlsWithOverwrite(URL u) throws MalformedURLException { super(u); this.u = u; } @Override public URL getCodeBase() { return u; } @Override public URL getSourceLocation() { return u; } } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/PaxHeaders.170000644000000000000000000000033012654402377030752 xustar00127 path=icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/AppletSecurityActionsTest.java 30 mtime=1454507263.208432968 29 atime=1454507327.19857955 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/AppletSecurit0000644000175000002070000001566312654402377034532 0ustar00jvanekmock00000000000000/* Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.appletextendedsecurity; import static org.junit.Assert.assertEquals; import org.junit.Test; public class AppletSecurityActionsTest { @Test public void parseMultipleItemsCorrect() throws Exception { AppletSecurityActions a1 = AppletSecurityActions.fromString("ANynsXsnyNA"); assertEquals(ExecuteAppletAction.ALWAYS, a1.getAction(0)); assertEquals(ExecuteAppletAction.NEVER, a1.getAction(1)); assertEquals(ExecuteAppletAction.YES, a1.getAction(2)); assertEquals(ExecuteAppletAction.NO, a1.getAction(3)); assertEquals(ExecuteAppletAction.SANDBOX, a1.getAction(4)); assertEquals(ExecuteAppletAction.UNSET, a1.getAction(5)); assertEquals(ExecuteAppletAction.SANDBOX, a1.getAction(6)); assertEquals(ExecuteAppletAction.NO, a1.getAction(7)); assertEquals(ExecuteAppletAction.YES, a1.getAction(8)); assertEquals(ExecuteAppletAction.NEVER, a1.getAction(9)); assertEquals(ExecuteAppletAction.ALWAYS, a1.getAction(10)); assertEquals(11, a1.getActions().size()); } @Test public void parseEmpty() throws Exception { AppletSecurityActions a1 = AppletSecurityActions.fromString(""); assertEquals(ExecuteAppletAction.UNSET, a1.getAction(0)); assertEquals(ExecuteAppletAction.UNSET, a1.getAction(10)); assertEquals(0, a1.getActions().size()); } @Test public void parseOkSetAndGetZero() throws Exception { AppletSecurityActions a1 = AppletSecurityActions.fromString(""); assertEquals(ExecuteAppletAction.UNSET, a1.getAction(0)); assertEquals(0, a1.getActions().size()); a1.setAction(0, ExecuteAppletAction.YES); assertEquals(ExecuteAppletAction.YES, a1.getAction(0)); assertEquals(1, a1.getActions().size()); } @Test public void parseOkSetAndGet() throws Exception { AppletSecurityActions a1 = AppletSecurityActions.fromString("s"); assertEquals(ExecuteAppletAction.SANDBOX, a1.getAction(0)); assertEquals(1, a1.getActions().size()); a1.setAction(0, ExecuteAppletAction.NO); assertEquals(ExecuteAppletAction.NO, a1.getAction(0)); assertEquals(1, a1.getActions().size()); a1.setAction(1, ExecuteAppletAction.YES); assertEquals(ExecuteAppletAction.NO, a1.getAction(0)); assertEquals(ExecuteAppletAction.YES, a1.getAction(1)); assertEquals(2, a1.getActions().size()); a1.setAction(0, ExecuteAppletAction.NO); assertEquals(ExecuteAppletAction.NO, a1.getAction(0)); assertEquals(2, a1.getActions().size()); a1.setAction(4, ExecuteAppletAction.NEVER); assertEquals(ExecuteAppletAction.NO, a1.getAction(0)); assertEquals(ExecuteAppletAction.YES, a1.getAction(1)); assertEquals(ExecuteAppletAction.UNSET, a1.getAction(2)); assertEquals(ExecuteAppletAction.UNSET, a1.getAction(3)); assertEquals(ExecuteAppletAction.UNSET, a1.getAction(3)); assertEquals(ExecuteAppletAction.NEVER, a1.getAction(4)); assertEquals(ExecuteAppletAction.UNSET, a1.getAction(5));//default again assertEquals(5, a1.getActions().size()); } @Test(expected = IndexOutOfBoundsException.class) public void parseNotOkGet() throws Exception { AppletSecurityActions a1 = AppletSecurityActions.fromString("ANynsXsnyNA"); a1.getAction(-1); } @Test(expected = IndexOutOfBoundsException.class) public void parseNotOkSet() throws Exception { AppletSecurityActions a1 = AppletSecurityActions.fromString("ANynsXsnyNA"); a1.setAction(-1, ExecuteAppletAction.NO); } @Test(expected = RuntimeException.class) public void parseMultipleItemsToSomeWrong() throws Exception { AppletSecurityActions a1 = AppletSecurityActions.fromString("AQA"); } @Test public void parseMultipleItemsFillMissing() throws Exception { AppletSecurityActions a1 = AppletSecurityActions.fromString("AN"); assertEquals(ExecuteAppletAction.ALWAYS, a1.getAction(0)); assertEquals(ExecuteAppletAction.NEVER, a1.getAction(1)); assertEquals(ExecuteAppletAction.UNSET, a1.getAction(2)); assertEquals(ExecuteAppletAction.UNSET, a1.getAction(3)); //note, getters do not increase length assertEquals(2, a1.getActions().size()); } @Test public void parseMultipleItemsSpaceEnd() throws Exception { AppletSecurityActions a1 = AppletSecurityActions.fromString("ANXs AAA"); assertEquals(ExecuteAppletAction.ALWAYS, a1.getAction(0)); assertEquals(ExecuteAppletAction.NEVER, a1.getAction(1)); assertEquals(ExecuteAppletAction.UNSET, a1.getAction(2)); assertEquals(ExecuteAppletAction.SANDBOX, a1.getAction(3)); assertEquals(ExecuteAppletAction.UNSET, a1.getAction(4)); assertEquals(ExecuteAppletAction.UNSET, a1.getAction(5)); assertEquals(ExecuteAppletAction.UNSET, a1.getAction(10)); assertEquals(4, a1.getActions().size()); } @Test public void testIterator() throws Exception { AppletSecurityActions a1 = AppletSecurityActions.fromString("ANXs AAA"); int i = 0; for (ExecuteAppletAction eaa : a1) { assertEquals(a1.getAction(i), eaa); i++; } assertEquals(a1.getRealCount(), i); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/PaxHeaders.17941/SecurityDialogsTest0000644000000000000000000000013112654402377030363 xustar0030 mtime=1454507263.208432968 29 atime=1454507327.19857955 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/SecurityDialogsTest.java0000644000175000002070000005723512654402377032043 0ustar00jvanekmock00000000000000/*Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security; import java.io.File; import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; import java.util.HashSet; import net.sourceforge.jnlp.InformationDesc; import net.sourceforge.jnlp.LaunchException; import net.sourceforge.jnlp.browsertesting.browsers.firefox.FirefoxProfilesOperator; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.config.PathsAndFiles; import net.sourceforge.jnlp.mock.DummyJNLPFileWithJar; import net.sourceforge.jnlp.runtime.JNLPRuntime; import static net.sourceforge.jnlp.security.SecurityDialogs.AppletAction.*; import static net.sourceforge.jnlp.security.SecurityDialogs.getIntegerResponseAsAppletAction; import static net.sourceforge.jnlp.security.SecurityDialogs.getIntegerResponseAsBoolean; import net.sourceforge.jnlp.security.appletextendedsecurity.AppletSecurityLevel; import net.sourceforge.jnlp.security.appletextendedsecurity.ExecuteAppletAction; import net.sourceforge.jnlp.security.appletextendedsecurity.UnsignedAppletTrustConfirmation; import net.sourceforge.jnlp.security.appletextendedsecurity.impl.UnsignedAppletActionStorageImpl; import net.sourceforge.jnlp.security.dialogs.apptrustwarningpanel.AppTrustWarningPanel.AppSigningWarningAction; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; public class SecurityDialogsTest { @Test public void testGetIntegerResponseAsBoolean() throws Exception { Object nullRef = null; Object objRef = new Object(); Float floatRef = 0.0f; Double doubleRef = 0.0d; Long longRef = (long) 0; Byte byteRef = (byte)0; Short shortRef = (short)0; String strRef = "0"; Integer intRef1 = 5; Integer intRef2 = 0; assertFalse("null reference should have resulted in false", getIntegerResponseAsBoolean(nullRef)); assertFalse("Object reference should have resulted in false", getIntegerResponseAsBoolean(objRef)); assertFalse("Float reference should have resulted in false", getIntegerResponseAsBoolean(floatRef)); assertFalse("Double reference should have resulted in false", getIntegerResponseAsBoolean(doubleRef)); assertFalse("Long reference should have resulted in false", getIntegerResponseAsBoolean(longRef)); assertFalse("Byte reference should have resulted in false", getIntegerResponseAsBoolean(byteRef)); assertFalse("Short reference should have resulted in false", getIntegerResponseAsBoolean(shortRef)); assertFalse("String reference should have resulted in false", getIntegerResponseAsBoolean(strRef)); assertFalse("Non-0 Integer reference should have resulted in false", getIntegerResponseAsBoolean(intRef1)); assertTrue("0 Integer reference should have resulted in true", getIntegerResponseAsBoolean(intRef2)); } @Test public void testGetIntegerResponseAsAppletAction() throws Exception { Object nullRef = null; Object objRef = new Object(); Float floatRef = 0.0f; Double doubleRef = 0.0d; Long longRef = (long) 0; Byte byteRef = (byte) 0; Short shortRef = (short) 0; String strRef = "0"; Integer intRef1 = 0; Integer intRef2 = 1; Integer intRef3 = 2; Integer intRef4 = 3; assertEquals("null reference should have resulted in CANCEL", getIntegerResponseAsAppletAction(nullRef), CANCEL); assertEquals("Object reference should have resulted in CANCEL", getIntegerResponseAsAppletAction(objRef), CANCEL); assertEquals("Float reference should have resulted in CANCEL", getIntegerResponseAsAppletAction(floatRef), CANCEL); assertEquals("Double reference should have resulted in CANCEL", getIntegerResponseAsAppletAction(doubleRef), CANCEL); assertEquals("Long reference should have resulted in CANCEL", getIntegerResponseAsAppletAction(longRef), CANCEL); assertEquals("Byte reference should have resulted in CANCEL", getIntegerResponseAsAppletAction(byteRef), CANCEL); assertEquals("Short reference should have resulted in CANCEL", getIntegerResponseAsAppletAction(shortRef), CANCEL); assertEquals("String reference should have resulted in CANCEL", getIntegerResponseAsAppletAction(strRef), CANCEL); assertEquals("Integer reference 0 should have resulted in RUN", getIntegerResponseAsAppletAction(intRef1), RUN); assertEquals("Integer reference 1 should have resulted in SANDBOX", getIntegerResponseAsAppletAction(intRef2), SANDBOX); assertEquals("Integer reference 2 should have resulted in CANCEL", getIntegerResponseAsAppletAction(intRef3), CANCEL); assertEquals("Integer reference 3 should have resulted in CANCEL", getIntegerResponseAsAppletAction(intRef4), CANCEL); } private static boolean wasHeadless; private static boolean wasTrustAll; private static boolean wasTrustNone; private static String prompt; private static URL url; private static File appletSecurityBackup; private static String seclevel; private static class DummyJnlpWithTitleAndUrls extends DummyJNLPFileWithJar { public DummyJnlpWithTitleAndUrls() throws MalformedURLException { super(new File("/some/path/blah.jar")); } @Override public InformationDesc getInformation() { return new InformationDesc(null, false) { @Override public String getTitle() { return "Demo App"; } }; } @Override public URL getCodeBase() { return url; } @Override public URL getSourceLocation() { return url; } }; private static class ExpectedResults { public static ExpectedResults PositiveResults = new ExpectedResults(true, RUN, ExecuteAppletAction.YES, null, true); public static ExpectedResults NegativeResults = new ExpectedResults(false, CANCEL, ExecuteAppletAction.NO, null, false); public final boolean p1; public final SecurityDialogs.AppletAction p2; public final ExecuteAppletAction ea; public final Object[] np; public final boolean b; public ExpectedResults(boolean p1, SecurityDialogs.AppletAction p2, ExecuteAppletAction ea, Object[] np, boolean b) { this.p1 = p1; this.p2 = p2; this.ea = ea; this.np = np; this.b = b; } } @BeforeClass public static void initUrl() throws MalformedURLException { url = new URL("http://must.not.be.in/.appletSecurity"); } @BeforeClass public static void backupAppletSecurity() throws IOException { appletSecurityBackup = File.createTempFile("appletSecurity", "itwTestBAckup"); FirefoxProfilesOperator.copyFile(PathsAndFiles.APPLET_TRUST_SETTINGS_USER.getFile(), appletSecurityBackup); } @Before public void removeAppletSecurity() throws IOException { removeAppletSecurityImpl(); } public static void removeAppletSecurityImpl() throws IOException { if (appletSecurityBackup.exists()) { PathsAndFiles.APPLET_TRUST_SETTINGS_USER.getFile().delete(); } } @AfterClass public static void restoreAppletSecurity() throws IOException { if (appletSecurityBackup.exists()) { removeAppletSecurityImpl(); FirefoxProfilesOperator.copyFile(appletSecurityBackup, PathsAndFiles.APPLET_TRUST_SETTINGS_USER.getFile()); appletSecurityBackup.delete(); } } @BeforeClass public static void saveJnlpRuntime() { wasHeadless = JNLPRuntime.isHeadless(); wasTrustAll = JNLPRuntime.isTrustAll(); //trutNone is not used in dialogues, its considered as default //but is ussed in Unsigned... dialogs family wasTrustNone = JNLPRuntime.isTrustNone(); prompt = JNLPRuntime.getConfiguration().getProperty(DeploymentConfiguration.KEY_SECURITY_PROMPT_USER); seclevel = JNLPRuntime.getConfiguration().getProperty(DeploymentConfiguration.KEY_SECURITY_LEVEL); } @After public void restoreJnlpRuntime() throws Exception { restoreJnlpRuntimeFinally(); } private static void setPrompt(String p) { JNLPRuntime.getConfiguration().setProperty(DeploymentConfiguration.KEY_SECURITY_PROMPT_USER, p); } private static void setPrompt(boolean p) { JNLPRuntime.getConfiguration().setProperty(DeploymentConfiguration.KEY_SECURITY_PROMPT_USER, String.valueOf(p)); } private static void setAS(AppletSecurityLevel as) { JNLPRuntime.getConfiguration().setProperty(DeploymentConfiguration.KEY_SECURITY_LEVEL, String.valueOf(as.toChars())); } @AfterClass public static void restoreJnlpRuntimeFinally() throws Exception { JNLPRuntime.setHeadless(wasHeadless); JNLPRuntime.setTrustAll(wasTrustAll); JNLPRuntime.setTrustNone(wasTrustNone); setPrompt(prompt); JNLPRuntime.getConfiguration().setProperty(DeploymentConfiguration.KEY_SECURITY_LEVEL, seclevel); } @Test(timeout = 1000)//if gui pops up public void testDialogsHeadlessTrustAllPrompt() throws Exception { JNLPRuntime.setHeadless(true); JNLPRuntime.setTrustAll(true); JNLPRuntime.setTrustNone(false); //ignored setPrompt(true); //should not metter becasue is headless setAS(AppletSecurityLevel.ALLOW_UNSIGNED); testAllDialogs(ExpectedResults.PositiveResults); checkUnsignedActing(true); setAS(AppletSecurityLevel.ASK_UNSIGNED); checkUnsignedActing(true); setAS(AppletSecurityLevel.DENY_ALL); checkUnsignedActing(false, true); setAS(AppletSecurityLevel.DENY_UNSIGNED); checkUnsignedActing(false, true); } @Test(timeout = 1000)//if gui pops up public void testDialogsHeadlessTrustNonePrompt() throws Exception { JNLPRuntime.setHeadless(true); JNLPRuntime.setTrustAll(false); JNLPRuntime.setTrustNone(false); //used by Unsigne setPrompt(true); //should not metter becasue is headless setAS(AppletSecurityLevel.ALLOW_UNSIGNED); testAllDialogs(ExpectedResults.NegativeResults); checkUnsignedActing(true); setAS(AppletSecurityLevel.ASK_UNSIGNED); checkUnsignedActing(false); setAS(AppletSecurityLevel.DENY_ALL); checkUnsignedActing(false); setAS(AppletSecurityLevel.DENY_UNSIGNED); checkUnsignedActing(false); } @Test(timeout = 1000)//if gui pops up public void testDialogsNotHeadlessTrustAllDontPrompt() throws Exception { JNLPRuntime.setHeadless(false); //should not metter as is nto asking JNLPRuntime.setTrustAll(true); JNLPRuntime.setTrustNone(false); //ignored setPrompt(false); setAS(AppletSecurityLevel.ALLOW_UNSIGNED); testAllDialogs(ExpectedResults.PositiveResults); checkUnsignedActing(true); setAS(AppletSecurityLevel.ASK_UNSIGNED); checkUnsignedActing(true); setAS(AppletSecurityLevel.DENY_ALL); checkUnsignedActing(false, true); setAS(AppletSecurityLevel.DENY_UNSIGNED); checkUnsignedActing(false, true); } @Test(timeout = 1000)//if gui pops up public void testDialogsNotHeadlessTrustNoneDontPrompt() throws Exception { JNLPRuntime.setHeadless(false); //should not metter as is nto asking JNLPRuntime.setTrustAll(false); JNLPRuntime.setTrustNone(false); //ignored setPrompt(false); setAS(AppletSecurityLevel.ALLOW_UNSIGNED); testAllDialogs(ExpectedResults.NegativeResults); checkUnsignedActing(true); setAS(AppletSecurityLevel.ASK_UNSIGNED); checkUnsignedActing(false); setAS(AppletSecurityLevel.DENY_ALL); checkUnsignedActing(false); setAS(AppletSecurityLevel.DENY_UNSIGNED); checkUnsignedActing(false); } private void testAllDialogs(ExpectedResults r) throws MalformedURLException { //anything but shoertcut boolean r1 = SecurityDialogs.showAccessWarningDialogB(SecurityDialogs.AccessType.PRINTER, null, null); Assert.assertEquals(r.p1, r1); //shortcut boolean r2 = SecurityDialogs.showAccessWarningDialogB(SecurityDialogs.AccessType.CREATE_DESTKOP_SHORTCUT, null, null); Assert.assertEquals(r.p1, r2); AppSigningWarningAction r3 = SecurityDialogs.showUnsignedWarningDialog(null); Assert.assertEquals(r.ea, r3.getAction()); SecurityDialogs.AppletAction r4 = SecurityDialogs.showCertWarningDialog(SecurityDialogs.AccessType.UNVERIFIED, null, null, null); Assert.assertEquals(r.p2, r4); AppSigningWarningAction r5 = SecurityDialogs.showPartiallySignedWarningDialog(null, null, null); Assert.assertEquals(r.ea, r5.getAction()); Object[] r6 = SecurityDialogs.showAuthenicationPrompt(null, 123456, null, null); Assert.assertEquals(r.np, r6); //the np is null in both positive and negative boolean r7 = SecurityDialogs.showMissingALACAttributePanel(null, null, null); Assert.assertEquals(r.b, r7); boolean r8 = SecurityDialogs.showMatchingALACAttributePanel(new DummyJnlpWithTitleAndUrls(), url, new HashSet()); Assert.assertEquals(r.b, r8); boolean r9 = SecurityDialogs.showMissingPermissionsAttributeDialogue(null, null); Assert.assertEquals(r.b, r9); } private void checkUnsignedActing(boolean b) throws MalformedURLException { checkUnsignedActing(b, b); } /* * testPartiallySignedBehaviour(); needs security delegate to set sandbox, so somtetimes results are strange */ private void checkUnsignedActing(boolean b1, boolean b2) throws MalformedURLException { boolean r10 = testUnsignedBehaviour(); Assert.assertEquals(b1, r10); boolean r11 = testPartiallySignedBehaviour(); Assert.assertEquals(b2, r11); } private boolean testUnsignedBehaviour() throws MalformedURLException { try { UnsignedAppletTrustConfirmation.checkUnsignedWithUserIfRequired(new DummyJnlpWithTitleAndUrls()); return true; } catch (LaunchException ex) { return false; } } private boolean testPartiallySignedBehaviour() throws MalformedURLException { try { UnsignedAppletTrustConfirmation.checkPartiallySignedWithUserIfRequired(null, new DummyJnlpWithTitleAndUrls(), null); return true; } catch (LaunchException ex) { return false; } } //SPOILER ALERT //all test below, are executing gui mode //however, they should never popup becasue jnlpruntime should never be initialized in this test //so posting to non existing queue leads to NPE //if this logic will ever be changed, the testswill need fixing //msot terrible thing which may happen is, that gui will be really shown //then each test must check if it have X, if odnt, pass with message "nothing tested| //if it have X, it have to show gui, terminate itself, and then verify that gui was really running private void countNPES() throws MalformedURLException { int npecounter = 0; int metcounter = 0; try { metcounter++; //anything but shoertcut SecurityDialogs.showAccessWarningDialog(SecurityDialogs.AccessType.PRINTER, null, null); } catch (NullPointerException ex) { npecounter++; } try { metcounter++; //shortcut SecurityDialogs.showAccessWarningDialog(SecurityDialogs.AccessType.CREATE_DESTKOP_SHORTCUT, null, null); } catch (NullPointerException ex) { npecounter++; } try { metcounter++; SecurityDialogs.showUnsignedWarningDialog(null); } catch (NullPointerException ex) { npecounter++; } try { metcounter++; SecurityDialogs.showCertWarningDialog(SecurityDialogs.AccessType.UNVERIFIED, null, null, null); } catch (NullPointerException ex) { npecounter++; } try { metcounter++; AppSigningWarningAction r5 = SecurityDialogs.showPartiallySignedWarningDialog(null, null, null); } catch (NullPointerException ex) { npecounter++; } try { metcounter++; SecurityDialogs.showAuthenicationPrompt(null, 123456, null, null); } catch (NullPointerException ex) { npecounter++; } try { metcounter++; SecurityDialogs.showMissingALACAttributePanel(null, null, null); } catch (NullPointerException ex) { npecounter++; } try { metcounter++; SecurityDialogs.showMatchingALACAttributePanel(new DummyJnlpWithTitleAndUrls(), url, new HashSet()); } catch (NullPointerException ex) { npecounter++; } try { metcounter++; SecurityDialogs.showMissingPermissionsAttributeDialogue(null, null); } catch (NullPointerException ex) { npecounter++; } Assert.assertEquals(metcounter, npecounter); } private void checkUnsignedNPE(boolean b) throws MalformedURLException { checkUnsignedNPE(b, b); } /* testPartiallySignedBehaviour(); needs security delegate to set sandbox, so somtetimes results are strange */ private void checkUnsignedNPE(boolean b1, boolean b2) throws MalformedURLException { int metcounter = 0; boolean ex1 = false; boolean ex2 = false; try { metcounter++; testPartiallySignedBehaviour(); } catch (NullPointerException ex) { ex1 = true; } try { metcounter++; testUnsignedBehaviour(); } catch (NullPointerException ex) { ex2 = true; } Assert.assertEquals(2, metcounter); Assert.assertEquals(b1, ex1); Assert.assertEquals(b2, ex2); } @Test public void testDialogsNotHeadlessTrustNonePrompt() throws Exception { JNLPRuntime.setHeadless(false); JNLPRuntime.setTrustAll(false);//should notmetter JNLPRuntime.setTrustNone(false); //ignored setPrompt(true); setAS(AppletSecurityLevel.ALLOW_UNSIGNED); countNPES(); checkUnsignedNPE(false); } @Test public void testNormaDialogsNotHeadlessTrustAllPrompt() throws Exception { JNLPRuntime.setHeadless(false); JNLPRuntime.setTrustAll(true); JNLPRuntime.setTrustNone(false); setPrompt(true); setAS(AppletSecurityLevel.ALLOW_UNSIGNED); countNPES(); } @Test public void testUnsignedDialogsNotHeadlessTrustAllPrompt() throws Exception { JNLPRuntime.setHeadless(false); JNLPRuntime.setTrustAll(true); JNLPRuntime.setTrustNone(false); setPrompt(true); //ignored setAS(AppletSecurityLevel.ALLOW_UNSIGNED); checkUnsignedActing(true); setAS(AppletSecurityLevel.ASK_UNSIGNED); checkUnsignedActing(true); setAS(AppletSecurityLevel.DENY_ALL); checkUnsignedActing(false, true); setAS(AppletSecurityLevel.DENY_UNSIGNED); checkUnsignedActing(false, true); } @Test public void testUnsignedDialogsNotHeadlessTrustNonePrompt() throws Exception { JNLPRuntime.setHeadless(false); JNLPRuntime.setTrustAll(false); JNLPRuntime.setTrustNone(true); setPrompt(true); //ignored setAS(AppletSecurityLevel.ALLOW_UNSIGNED); boolean r10 = testUnsignedBehaviour(); Assert.assertEquals(false, r10); checkUnsignedNPE(true, false); setAS(AppletSecurityLevel.ASK_UNSIGNED); boolean r11 = testUnsignedBehaviour(); Assert.assertEquals(false, r11); checkUnsignedNPE(true, false); setAS(AppletSecurityLevel.DENY_ALL); boolean r12 = testUnsignedBehaviour(); Assert.assertEquals(false, r12); checkUnsignedNPE(true, false); setAS(AppletSecurityLevel.DENY_UNSIGNED); boolean r13 = testUnsignedBehaviour(); Assert.assertEquals(false, r13); checkUnsignedNPE(true, false); } @Test public void testUnsignedDialogsNotHeadlessTrustNoneTrustAllPrompt() throws Exception { JNLPRuntime.setHeadless(false); JNLPRuntime.setTrustAll(true); JNLPRuntime.setTrustNone(true); setPrompt(true); //ignored setAS(AppletSecurityLevel.ALLOW_UNSIGNED); boolean a = testUnsignedBehaviour(); Assert.assertFalse(a); checkUnsignedNPE(true, false); setAS(AppletSecurityLevel.ASK_UNSIGNED); boolean r10 = testUnsignedBehaviour(); Assert.assertEquals(false, r10); checkUnsignedNPE(true, false); setAS(AppletSecurityLevel.DENY_ALL); boolean r11 = testUnsignedBehaviour(); Assert.assertEquals(false, r11); checkUnsignedNPE(true, false); setAS(AppletSecurityLevel.DENY_UNSIGNED); boolean r12 = testUnsignedBehaviour(); Assert.assertEquals(false, r12); checkUnsignedNPE(true, false); } @Test public void testUnsignedDialogsNotHeadlessPrompt() throws Exception { JNLPRuntime.setHeadless(false); JNLPRuntime.setTrustAll(false); JNLPRuntime.setTrustNone(false); setPrompt(true); //ignored setAS(AppletSecurityLevel.ALLOW_UNSIGNED); checkUnsignedActing(true); setAS(AppletSecurityLevel.ASK_UNSIGNED); checkUnsignedNPE(true, true); setAS(AppletSecurityLevel.DENY_ALL); boolean r11 = testUnsignedBehaviour(); Assert.assertEquals(false, r11); checkUnsignedNPE(true, false); setAS(AppletSecurityLevel.DENY_UNSIGNED); boolean r12 = testUnsignedBehaviour(); Assert.assertEquals(false, r12); checkUnsignedNPE(true, false); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/PaxHeaders.17941/KeyStoresTest.java0000644000000000000000000000013112654402377030121 xustar0030 mtime=1454507263.207432981 29 atime=1454507327.19857955 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/security/KeyStoresTest.java0000644000175000002070000001447712654402377030662 0ustar00jvanekmock00000000000000/* Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security; import java.security.Permission; import net.sourceforge.jnlp.config.InfrastructureFileDescriptor; import net.sourceforge.jnlp.config.PathsAndFiles; import org.junit.AfterClass; import org.junit.Assert; import org.junit.Test; public class KeyStoresTest { private class DummySM extends SecurityManager { boolean called = false; @Override public void checkPermission(Permission perm) { called=true; } } @AfterClass public static void removeClassLaoder() { System.setSecurityManager(null); } @Test public void getKeyStoreUserLocationTest() { InfrastructureFileDescriptor s; System.setSecurityManager(null); s = KeyStores.getKeyStoreLocation(KeyStores.Level.USER, KeyStores.Type.CA_CERTS); Assert.assertEquals(s.getFile(), PathsAndFiles.USER_CACERTS.getFile()); s = KeyStores.getKeyStoreLocation(KeyStores.Level.USER, KeyStores.Type.CERTS); Assert.assertEquals(s.getFile(), PathsAndFiles.USER_CERTS.getFile()); s = KeyStores.getKeyStoreLocation(KeyStores.Level.USER, KeyStores.Type.CLIENT_CERTS); Assert.assertEquals(s.getFile(), PathsAndFiles.USER_CLIENTCERT.getFile()); s = KeyStores.getKeyStoreLocation(KeyStores.Level.USER, KeyStores.Type.JSSE_CA_CERTS); Assert.assertEquals(s.getFile(), PathsAndFiles.USER_JSSECAC.getFile()); s = KeyStores.getKeyStoreLocation(KeyStores.Level.USER, KeyStores.Type.JSSE_CERTS); Assert.assertEquals(s.getFile(), PathsAndFiles.USER_JSSECER.getFile()); } @Test public void getKeyStoreSystemLocationTest() { InfrastructureFileDescriptor s; System.setSecurityManager(null); s = KeyStores.getKeyStoreLocation(KeyStores.Level.SYSTEM, KeyStores.Type.CA_CERTS); Assert.assertEquals(s.getFile(), PathsAndFiles.SYS_CACERT.getFile()); s = KeyStores.getKeyStoreLocation(KeyStores.Level.SYSTEM, KeyStores.Type.CERTS); Assert.assertEquals(s.getFile(), PathsAndFiles.SYS_CERT.getFile()); s = KeyStores.getKeyStoreLocation(KeyStores.Level.SYSTEM, KeyStores.Type.CLIENT_CERTS); Assert.assertEquals(s.getFile(), PathsAndFiles.SYS_CLIENTCERT.getFile()); s = KeyStores.getKeyStoreLocation(KeyStores.Level.SYSTEM, KeyStores.Type.JSSE_CA_CERTS); Assert.assertEquals(s.getFile(), PathsAndFiles.SYS_JSSECAC.getFile()); s = KeyStores.getKeyStoreLocation(KeyStores.Level.SYSTEM, KeyStores.Type.JSSE_CERTS); Assert.assertEquals(s.getFile(), PathsAndFiles.SYS_JSSECERT.getFile()); } @Test public void getKeyStoreUserLocationTestSM() { DummySM dm = new DummySM(); System.setSecurityManager(dm); InfrastructureFileDescriptor s; s = KeyStores.getKeyStoreLocation(KeyStores.Level.USER, KeyStores.Type.CA_CERTS); Assert.assertEquals(s.getFile(), PathsAndFiles.USER_CACERTS.getFile()); s = KeyStores.getKeyStoreLocation(KeyStores.Level.USER, KeyStores.Type.CERTS); Assert.assertEquals(s.getFile(), PathsAndFiles.USER_CERTS.getFile()); s = KeyStores.getKeyStoreLocation(KeyStores.Level.USER, KeyStores.Type.CLIENT_CERTS); Assert.assertEquals(s.getFile(), PathsAndFiles.USER_CLIENTCERT.getFile()); s = KeyStores.getKeyStoreLocation(KeyStores.Level.USER, KeyStores.Type.JSSE_CA_CERTS); Assert.assertEquals(s.getFile(), PathsAndFiles.USER_JSSECAC.getFile()); s = KeyStores.getKeyStoreLocation(KeyStores.Level.USER, KeyStores.Type.JSSE_CERTS); Assert.assertEquals(s.getFile(), PathsAndFiles.USER_JSSECER.getFile()); Assert.assertEquals(true, dm.called); } @Test public void getKeyStoreSystemLocationTestSM() { DummySM dm = new DummySM(); System.setSecurityManager(dm); InfrastructureFileDescriptor s; s = KeyStores.getKeyStoreLocation(KeyStores.Level.SYSTEM, KeyStores.Type.CA_CERTS); Assert.assertEquals(s.getFile(), PathsAndFiles.SYS_CACERT.getFile()); s = KeyStores.getKeyStoreLocation(KeyStores.Level.SYSTEM, KeyStores.Type.CERTS); Assert.assertEquals(s.getFile(), PathsAndFiles.SYS_CERT.getFile()); s = KeyStores.getKeyStoreLocation(KeyStores.Level.SYSTEM, KeyStores.Type.CLIENT_CERTS); Assert.assertEquals(s.getFile(), PathsAndFiles.SYS_CLIENTCERT.getFile()); s = KeyStores.getKeyStoreLocation(KeyStores.Level.SYSTEM, KeyStores.Type.JSSE_CA_CERTS); Assert.assertEquals(s.getFile(), PathsAndFiles.SYS_JSSECAC.getFile()); s = KeyStores.getKeyStoreLocation(KeyStores.Level.SYSTEM, KeyStores.Type.JSSE_CERTS); Assert.assertEquals(s.getFile(), PathsAndFiles.SYS_JSSECERT.getFile()); Assert.assertEquals(true, dm.called); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.17941/runtime0000644000000000000000000000013212654402377024226 xustar0030 mtime=1454507263.296431794 30 atime=1454507658.776157397 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/runtime/0000755000175000002070000000000012654402377025026 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/runtime/PaxHeaders.17941/html0000644000000000000000000000013212654402377025172 xustar0030 mtime=1454507263.207432981 30 atime=1454507658.776157397 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/runtime/html/0000755000175000002070000000000012654402377025772 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/runtime/html/PaxHeaders.17941/AppletParserTes0000644000000000000000000000013112654402377030247 xustar0030 mtime=1454507263.207432981 29 atime=1454507327.19857955 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/runtime/html/AppletParserTest.java0000644000175000002070000000435312654402377032104 0ustar00jvanekmock00000000000000/* Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.runtime.html; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import org.junit.Test; public class AppletParserTest { @Test public void sanitizeSizeTest() { assertFalse(AppletParser.sanitizeSize(null) == null); assertEquals("1", AppletParser.sanitizeSize(null)); assertEquals("800", AppletParser.sanitizeSize("800")); assertEquals("10", AppletParser.sanitizeSize("10px")); assertEquals("1000", AppletParser.sanitizeSize(" 1000 ")); assertEquals("1000", AppletParser.sanitizeSize(" $1000 ")); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/runtime/PaxHeaders.17941/TranslatorTest.java0000644000000000000000000000013212654402377030137 xustar0030 mtime=1454507263.207432981 30 atime=1454507327.197579563 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/runtime/TranslatorTest.java0000644000175000002070000000531412654402377030665 0ustar00jvanekmock00000000000000package net.sourceforge.jnlp.runtime; import static org.junit.Assert.assertEquals; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.net.URL; import java.net.URLClassLoader; import java.util.Locale; import java.util.ResourceBundle; import org.junit.Assert; import org.junit.Before; import org.junit.Test; public class TranslatorTest { private static class TestableTranslator extends Translator { public TestableTranslator(ResourceBundle bundle) { super(bundle); } public String translate(String message, Object... params) { return super.getMessage(message, params); } } TestableTranslator translator; @Before public void setup() throws IOException { File f = new File(System.getProperty("java.io.tmpdir"), "test.properties"); f.createNewFile(); f.deleteOnExit(); FileOutputStream fos = new FileOutputStream(f); String message = "key=value\n" + "argkey=value {0}\n" + "apostrophekey=keywith''\n" + "RNoResource=no-resource\n"; fos.write(message.getBytes()); URL u = f.getParentFile().toURI().toURL(); ClassLoader loader = new URLClassLoader(new URL[] {u}); ResourceBundle bundle = ResourceBundle.getBundle("test", Locale.getDefault(), loader); translator = new TestableTranslator(bundle); } @Test public void testTranslateNonExistingMessage() { String message = translator.translate("doesn't-exist"); assertEquals("no-resource", message); } @Test public void testTranslateNullMessage() { String message = translator.translate(null); assertEquals("no-resource", message); } @Test public void testTranslateMessage() { String message = translator.translate("key"); assertEquals("value", message); } @Test public void testTranslateMessageWithArgs() { String message = translator.translate("argkey", new Object[] {"Hello"}); assertEquals("value Hello", message); } @Test public void testTranslateMessageWithApostrophe() { //Message format requires apostrophes to be escaped by using two '' //The properties files follow this requirement String message = translator.translate("apostrophekey"); assertEquals("keywith'", message); } @Test public void singletonTest1() { String message = Translator.R("key"); Assert.assertNotEquals("value", message); } @Test public void singletonTest2() { String message = Translator.R("unknown-key"); Assert.assertTrue(message.contains("unknown-key")); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/runtime/PaxHeaders.17941/ResourcesDescTest.ja0000644000000000000000000000013212654402377030230 xustar0030 mtime=1454507263.207432981 30 atime=1454507327.197579563 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/runtime/ResourcesDescTest.java0000644000175000002070000001112412654402377031301 0ustar00jvanekmock00000000000000/* Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.runtime; import java.io.File; import java.util.jar.Manifest; import net.sourceforge.jnlp.JARDesc; import net.sourceforge.jnlp.mock.DummyJNLPFileWithJar; import net.sourceforge.jnlp.util.FileTestUtils; import org.junit.Assert; import org.junit.Test; public class ResourcesDescTest { @Test public void checkGetMainJar_noMainSet() throws Exception { File tempDirectory = FileTestUtils.createTempDirectory(); tempDirectory.deleteOnExit(); File jarLocation1 = new File(tempDirectory, "test1.jar"); File jarLocation2 = new File(tempDirectory, "test2.jar"); File jarLocation3 = new File(tempDirectory, "test3.jar"); Manifest manifest1 = new Manifest(); Manifest manifest2 = new Manifest(); Manifest manifest3 = new Manifest(); Manifest manifest4 = new Manifest(); Manifest manifest5 = new Manifest(); FileTestUtils.createJarWithContents(jarLocation1, manifest1); FileTestUtils.createJarWithContents(jarLocation2, manifest2); FileTestUtils.createJarWithContents(jarLocation3, manifest3); final DummyJNLPFileWithJar jnlpFile = new DummyJNLPFileWithJar(jarLocation1, jarLocation2, jarLocation3); JARDesc result = jnlpFile.getResources().getMainJAR(); Assert.assertTrue("first jar must be returned", result.getLocation().getFile().endsWith("test1.jar")); } @Test public void checkGetMainJar_mainSet() throws Exception { File tempDirectory = FileTestUtils.createTempDirectory(); tempDirectory.deleteOnExit(); File jarLocation1 = new File(tempDirectory, "test1.jar"); File jarLocation2 = new File(tempDirectory, "test2.jar"); File jarLocation3 = new File(tempDirectory, "test3.jar"); Manifest manifest1 = new Manifest(); Manifest manifest2 = new Manifest(); Manifest manifest3 = new Manifest(); Manifest manifest4 = new Manifest(); Manifest manifest5 = new Manifest(); FileTestUtils.createJarWithContents(jarLocation1, manifest1); FileTestUtils.createJarWithContents(jarLocation2, manifest2); FileTestUtils.createJarWithContents(jarLocation3, manifest3); DummyJNLPFileWithJar jnlpFile = new DummyJNLPFileWithJar(0, jarLocation1, jarLocation2, jarLocation3); JARDesc result = jnlpFile.getResources().getMainJAR(); Assert.assertTrue("main jar must be returned", result.getLocation().getFile().endsWith("test1.jar")); jnlpFile = new DummyJNLPFileWithJar(1, jarLocation1, jarLocation2, jarLocation3); result = jnlpFile.getResources().getMainJAR(); Assert.assertTrue("main jar must be returned", result.getLocation().getFile().endsWith("test2.jar")); jnlpFile = new DummyJNLPFileWithJar(2, jarLocation1, jarLocation2, jarLocation3); result = jnlpFile.getResources().getMainJAR(); Assert.assertTrue("main jar must be returned", result.getLocation().getFile().endsWith("test3.jar")); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/runtime/PaxHeaders.17941/ManifestAttributesCh0000644000000000000000000000013212654402377030316 xustar0030 mtime=1454507263.296431794 30 atime=1454507327.197579563 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/runtime/ManifestAttributesCheckerTest.java0000644000175000002070000000524612654402377033642 0ustar00jvanekmock00000000000000/* Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.runtime; import java.net.MalformedURLException; import java.net.URL; import org.junit.Assert; import org.junit.Test; public class ManifestAttributesCheckerTest { @Test public void stripDocbaseTest() throws Exception { tryTest("http://aaa.bb/ccc/file.html", "http://aaa.bb/ccc/"); tryTest("http://aaa.bb/ccc/file.html/", "http://aaa.bb/ccc/file.html/"); tryTest("http://aaa.bb/ccc/dir/", "http://aaa.bb/ccc/dir/"); tryTest("http://aaa.bb/ccc/dir", "http://aaa.bb/ccc/"); tryTest("http://aaa.bb/ccc/", "http://aaa.bb/ccc/"); tryTest("http://aaa.bb/ccc", "http://aaa.bb/"); tryTest("http://aaa.bb/", "http://aaa.bb/"); tryTest("http://aaa.bb", "http://aaa.bb"); } private static void tryTest(String src, String expected) throws MalformedURLException { URL s = new URL(src); URL q = ManifestAttributesChecker.stripDocbase(s); //junit is failing for me on url.equls(url)... Assert.assertEquals(expected, q.toExternalForm()); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/runtime/PaxHeaders.17941/JNLPProxySelectorTes0000644000000000000000000000013212654402377030210 xustar0030 mtime=1454507263.296431794 30 atime=1454507327.197579563 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/runtime/JNLPProxySelectorTest.java0000644000175000002070000003344412654402377032047 0ustar00jvanekmock00000000000000/* JNLPProxySelectorTest.java Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.runtime; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertSame; import static org.junit.Assert.fail; import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.Proxy; import java.net.Proxy.Type; import java.net.URI; import java.net.URISyntaxException; import java.net.UnknownHostException; import java.util.Arrays; import java.util.List; import net.sourceforge.jnlp.config.DeploymentConfiguration; import org.junit.Ignore; import org.junit.Test; public class JNLPProxySelectorTest { private static final Proxy BROWSER_PROXY = new Proxy(Type.SOCKS, InetSocketAddress.createUnresolved("foo", 0xF00)); class TestProxySelector extends JNLPProxySelector { public TestProxySelector(DeploymentConfiguration config) { super(config); } @Override protected List getFromBrowser(URI uri) { return Arrays.asList(BROWSER_PROXY); } } @Test public void testNoProxy() throws URISyntaxException { DeploymentConfiguration config = new DeploymentConfiguration(); config.setProperty(DeploymentConfiguration.KEY_PROXY_TYPE, String.valueOf(JNLPProxySelector.PROXY_TYPE_NONE)); JNLPProxySelector selector = new TestProxySelector(config); List result = selector.select(new URI("http://example.org/")); assertEquals(1, result.size()); assertEquals(Proxy.NO_PROXY, result.get(0)); } @Test public void testProxyBypassLocal() throws URISyntaxException, UnknownHostException { final String LOCALHOST = InetAddress.getLocalHost().getHostName(); DeploymentConfiguration config = new DeploymentConfiguration(); config.setProperty(DeploymentConfiguration.KEY_PROXY_TYPE, String.valueOf(JNLPProxySelector.PROXY_TYPE_MANUAL)); config.setProperty(DeploymentConfiguration.KEY_PROXY_BYPASS_LOCAL, String.valueOf(true)); List result; JNLPProxySelector selector = new TestProxySelector(config); result = selector.select(new URI("http://127.0.0.1/")); assertEquals(1, result.size()); assertEquals(Proxy.NO_PROXY, result.get(0)); result = selector.select(new URI("http://" + LOCALHOST + "/")); assertEquals(1, result.size()); assertEquals(Proxy.NO_PROXY, result.get(0)); result = selector.select(new URI("socket://127.0.0.1/")); assertEquals(1, result.size()); assertEquals(Proxy.NO_PROXY, result.get(0)); result = selector.select(new URI("socket://" + LOCALHOST + "/")); assertEquals(1, result.size()); assertEquals(Proxy.NO_PROXY, result.get(0)); } // TODO implement this @Ignore("Implement this") @Test public void testLocalProxyBypassListIsIgnoredForNonLocal() { fail(); } @Test public void testProxyBypassList() throws URISyntaxException { DeploymentConfiguration config = new DeploymentConfiguration(); config.setProperty(DeploymentConfiguration.KEY_PROXY_TYPE, String.valueOf(JNLPProxySelector.PROXY_TYPE_MANUAL)); config.setProperty(DeploymentConfiguration.KEY_PROXY_BYPASS_LIST, "example.org"); JNLPProxySelector selector = new TestProxySelector(config); List result; result = selector.select(new URI("http://example.org/")); assertEquals(1, result.size()); assertEquals(Proxy.NO_PROXY, result.get(0)); result = selector.select(new URI("socket://example.org/")); assertEquals(1, result.size()); assertEquals(Proxy.NO_PROXY, result.get(0)); } @Test public void testManualHttpProxy() throws URISyntaxException { String HTTP_HOST = "example.org"; int HTTP_PORT = 42; DeploymentConfiguration config = new DeploymentConfiguration(); config.setProperty(DeploymentConfiguration.KEY_PROXY_TYPE, String.valueOf(JNLPProxySelector.PROXY_TYPE_MANUAL)); config.setProperty(DeploymentConfiguration.KEY_PROXY_HTTP_HOST, HTTP_HOST); config.setProperty(DeploymentConfiguration.KEY_PROXY_HTTP_PORT, String.valueOf(HTTP_PORT)); JNLPProxySelector selector = new TestProxySelector(config); List result = selector.select(new URI("http://example.org/")); assertEquals(1, result.size()); assertEquals(new Proxy(Type.HTTP, new InetSocketAddress(HTTP_HOST, HTTP_PORT)), result.get(0)); } @Test public void testManualHttpsProxy() throws URISyntaxException { String HTTPS_HOST = "example.org"; int HTTPS_PORT = 42; DeploymentConfiguration config = new DeploymentConfiguration(); config.setProperty(DeploymentConfiguration.KEY_PROXY_TYPE, String.valueOf(JNLPProxySelector.PROXY_TYPE_MANUAL)); config.setProperty(DeploymentConfiguration.KEY_PROXY_HTTPS_HOST, HTTPS_HOST); config.setProperty(DeploymentConfiguration.KEY_PROXY_HTTPS_PORT, String.valueOf(HTTPS_PORT)); JNLPProxySelector selector = new TestProxySelector(config); List result = selector.select(new URI("https://example.org/")); assertEquals(1, result.size()); assertEquals(new Proxy(Type.HTTP, new InetSocketAddress(HTTPS_HOST, HTTPS_PORT)), result.get(0)); } @Test public void testManualFtpProxy() throws URISyntaxException { String FTP_HOST = "example.org"; int FTP_PORT = 42; DeploymentConfiguration config = new DeploymentConfiguration(); config.setProperty(DeploymentConfiguration.KEY_PROXY_TYPE, String.valueOf(JNLPProxySelector.PROXY_TYPE_MANUAL)); config.setProperty(DeploymentConfiguration.KEY_PROXY_FTP_HOST, FTP_HOST); config.setProperty(DeploymentConfiguration.KEY_PROXY_FTP_PORT, String.valueOf(FTP_PORT)); JNLPProxySelector selector = new TestProxySelector(config); List result = selector.select(new URI("ftp://example.org/")); assertEquals(1, result.size()); assertEquals(new Proxy(Type.HTTP, new InetSocketAddress(FTP_HOST, FTP_PORT)), result.get(0)); } @Test public void testManualSocksProxy() throws URISyntaxException { String SOCKS_HOST = "example.org"; int SOCKS_PORT = 42; DeploymentConfiguration config = new DeploymentConfiguration(); config.setProperty(DeploymentConfiguration.KEY_PROXY_TYPE, String.valueOf(JNLPProxySelector.PROXY_TYPE_MANUAL)); config.setProperty(DeploymentConfiguration.KEY_PROXY_SOCKS4_HOST, SOCKS_HOST); config.setProperty(DeploymentConfiguration.KEY_PROXY_SOCKS4_PORT, String.valueOf(SOCKS_PORT)); JNLPProxySelector selector = new TestProxySelector(config); List result = selector.select(new URI("socket://example.org/")); assertEquals(1, result.size()); assertEquals(new Proxy(Type.SOCKS, new InetSocketAddress(SOCKS_HOST, SOCKS_PORT)), result.get(0)); } @Test public void testHttpFallsBackToManualSocksProxy() throws URISyntaxException { String SOCKS_HOST = "example.org"; int SOCKS_PORT = 42; DeploymentConfiguration config = new DeploymentConfiguration(); config.setProperty(DeploymentConfiguration.KEY_PROXY_TYPE, String.valueOf(JNLPProxySelector.PROXY_TYPE_MANUAL)); config.setProperty(DeploymentConfiguration.KEY_PROXY_SOCKS4_HOST, SOCKS_HOST); config.setProperty(DeploymentConfiguration.KEY_PROXY_SOCKS4_PORT, String.valueOf(SOCKS_PORT)); JNLPProxySelector selector = new TestProxySelector(config); List result = selector.select(new URI("http://example.org/")); assertEquals(1, result.size()); assertEquals(new Proxy(Type.SOCKS, new InetSocketAddress(SOCKS_HOST, SOCKS_PORT)), result.get(0)); } @Test public void testManualUnknownProtocolProxy() throws URISyntaxException { DeploymentConfiguration config = new DeploymentConfiguration(); config.setProperty(DeploymentConfiguration.KEY_PROXY_TYPE, String.valueOf(JNLPProxySelector.PROXY_TYPE_MANUAL)); JNLPProxySelector selector = new TestProxySelector(config); List result = selector.select(new URI("gopher://example.org/")); assertEquals(1, result.size()); assertEquals(Proxy.NO_PROXY, result.get(0)); } @Test public void testManualSameProxy() throws URISyntaxException { final String HTTP_HOST = "example.org"; final int HTTP_PORT = 42; DeploymentConfiguration config = new DeploymentConfiguration(); config.setProperty(DeploymentConfiguration.KEY_PROXY_TYPE, String.valueOf(JNLPProxySelector.PROXY_TYPE_MANUAL)); config.setProperty(DeploymentConfiguration.KEY_PROXY_HTTP_HOST, HTTP_HOST); config.setProperty(DeploymentConfiguration.KEY_PROXY_HTTP_PORT, String.valueOf(HTTP_PORT)); config.setProperty(DeploymentConfiguration.KEY_PROXY_SAME, String.valueOf(true)); JNLPProxySelector selector = new TestProxySelector(config); List result; result = selector.select(new URI("http://example.org/")); assertEquals(1, result.size()); assertEquals(new Proxy(Type.HTTP, new InetSocketAddress(HTTP_HOST, HTTP_PORT)), result.get(0)); } @Test public void testBrowserProxy() throws URISyntaxException { DeploymentConfiguration config = new DeploymentConfiguration(); config.setProperty(DeploymentConfiguration.KEY_PROXY_TYPE, String.valueOf(JNLPProxySelector.PROXY_TYPE_BROWSER)); JNLPProxySelector selector = new TestProxySelector(config); List result = selector.select(new URI("http://example.org/")); assertEquals(1, result.size()); assertSame(BROWSER_PROXY, result.get(0)); } @Test public void testMissingProxyAutoConfigUrl() throws URISyntaxException { DeploymentConfiguration config = new DeploymentConfiguration(); config.setProperty(DeploymentConfiguration.KEY_PROXY_TYPE, String.valueOf(JNLPProxySelector.PROXY_TYPE_AUTO)); JNLPProxySelector selector = new TestProxySelector(config); List result = selector.select(new URI("http://example.org/")); assertEquals(1, result.size()); assertEquals(Proxy.NO_PROXY, result.get(0)); } // TODO @Ignore("Need to find a way to inject a custom proxy autoconfig file first") @Test public void testProxyAutoConfig() throws URISyntaxException { DeploymentConfiguration config = new DeploymentConfiguration(); config.setProperty(DeploymentConfiguration.KEY_PROXY_TYPE, String.valueOf(JNLPProxySelector.PROXY_TYPE_AUTO)); config.setProperty(DeploymentConfiguration.KEY_PROXY_AUTO_CONFIG_URL, "foobar"); JNLPProxySelector selector = new TestProxySelector(config); List result = selector.select(new URI("http://example.org/")); assertEquals(1, result.size()); } // TODO this JNLPProxySelect#getProxiesFromPacResult should be moved into a different class // TODO this test should be split into different methods @Test public void testConvertingProxyAutoConfigResultToProxyObject() { List result; result = JNLPProxySelector.getProxiesFromPacResult("foo bar baz; what is this; dunno"); assertEquals(0, result.size()); result = JNLPProxySelector.getProxiesFromPacResult("DIRECT"); assertEquals(1, result.size()); assertEquals(Proxy.NO_PROXY, result.get(0)); result = JNLPProxySelector.getProxiesFromPacResult("PROXY foo:42"); assertEquals(1, result.size()); assertEquals(new Proxy(Type.HTTP, InetSocketAddress.createUnresolved("foo", 42)), result.get(0)); result = JNLPProxySelector.getProxiesFromPacResult("PROXY foo:bar"); assertEquals(0, result.size()); result = JNLPProxySelector.getProxiesFromPacResult("PROXY foo"); assertEquals(0, result.size()); result = JNLPProxySelector.getProxiesFromPacResult("SOCKS foo:42"); assertEquals(1, result.size()); assertEquals(new Proxy(Type.SOCKS, InetSocketAddress.createUnresolved("foo", 42)), result.get(0)); result = JNLPProxySelector.getProxiesFromPacResult("SOCKS foo:bar"); assertEquals(0, result.size()); result = JNLPProxySelector.getProxiesFromPacResult("SOCKS foo"); assertEquals(0, result.size()); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/runtime/PaxHeaders.17941/JNLPFileTest.java0000644000000000000000000000013212654402377027351 xustar0030 mtime=1454507263.295431808 30 atime=1454507327.197579563 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/runtime/JNLPFileTest.java0000644000175000002070000006414012654402377030101 0ustar00jvanekmock00000000000000/* Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.runtime; import java.io.File; import java.net.URL; import java.util.Arrays; import java.util.List; import java.util.Locale; import java.util.jar.Attributes; import java.util.jar.Manifest; import net.sourceforge.jnlp.InformationDesc; import net.sourceforge.jnlp.JNLPFile; import net.sourceforge.jnlp.SecurityDesc; import net.sourceforge.jnlp.cache.UpdatePolicy; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.mock.DummyJNLPFileWithJar; import net.sourceforge.jnlp.security.appletextendedsecurity.AppletSecurityLevel; import net.sourceforge.jnlp.security.appletextendedsecurity.AppletStartupSecuritySettings; import net.sourceforge.jnlp.util.FileTestUtils; import net.sourceforge.jnlp.util.logging.NoStdOutErrTest; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; public class JNLPFileTest extends NoStdOutErrTest { private static AppletSecurityLevel level; private static List attCheckValue; @BeforeClass public static void setPermissions() { level = AppletStartupSecuritySettings.getInstance().getSecurityLevel(); attCheckValue = ManifestAttributesChecker.getAttributesCheck(); JNLPRuntime.getConfiguration().setProperty(DeploymentConfiguration.KEY_SECURITY_LEVEL, AppletSecurityLevel.ALLOW_UNSIGNED.toChars()); JNLPRuntime.getConfiguration().setProperty(DeploymentConfiguration.KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK, String.valueOf(ManifestAttributesChecker.MANIFEST_ATTRIBUTES_CHECK.ALL)); } @AfterClass public static void resetPermissions() { JNLPRuntime.getConfiguration().setProperty(DeploymentConfiguration.KEY_SECURITY_LEVEL, level.toChars()); JNLPRuntime.getConfiguration().setProperty(DeploymentConfiguration.KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK, String.valueOf(attCheckValue)); } @Test public void newSecurityAttributesTestNotSet() throws Exception { //oreder is tested in removeTitle //here we go with pure loading and parsing of them File tempDirectory = FileTestUtils.createTempDirectory(); tempDirectory.deleteOnExit(); File jarLocation66 = new File(tempDirectory, "test66.jar"); File jarLocation77 = new File(tempDirectory, "test77.jar"); Manifest manifest77 = new Manifest(); FileTestUtils.createJarWithContents(jarLocation66); //no manifest FileTestUtils.createJarWithContents(jarLocation77, manifest77); final DummyJNLPFileWithJar jnlpFile = new DummyJNLPFileWithJar(0, jarLocation66, jarLocation77); //jar 6 should be main final JNLPClassLoader classLoader = new JNLPClassLoader(jnlpFile, UpdatePolicy.ALWAYS);//jnlp file got its instance in classloaders constructor //jnlpFile.getManifestsAttributes().setLoader(classLoader); //classloader set, but no att specified Assert.assertNull("classloader attached, but should be null", jnlpFile.getManifestsAttributes().getAttribute(new Attributes.Name(JNLPFile.ManifestsAttributes.APP_NAME))); Assert.assertNull("classloader attached, but should be null", jnlpFile.getManifestsAttributes().getAttribute(new Attributes.Name(JNLPFile.ManifestsAttributes.APP_LIBRARY_ALLOWABLE))); Assert.assertNull("classloader attached, but should be null", jnlpFile.getManifestsAttributes().getAttribute(new Attributes.Name(JNLPFile.ManifestsAttributes.CALLER_ALLOWABLE))); Assert.assertNull("classloader attached, but should be null", jnlpFile.getManifestsAttributes().getAttribute(new Attributes.Name(JNLPFile.ManifestsAttributes.CODEBASE))); Assert.assertNull("classloader attached, but should be null", jnlpFile.getManifestsAttributes().getAttribute(new Attributes.Name(JNLPFile.ManifestsAttributes.PERMISSIONS))); Assert.assertNull("classloader attached, but should be null", jnlpFile.getManifestsAttributes().getAttribute(new Attributes.Name(JNLPFile.ManifestsAttributes.TRUSTED_LIBRARY))); Assert.assertNull("classloader attached, but should be null", jnlpFile.getManifestsAttributes().getAttribute(new Attributes.Name(JNLPFile.ManifestsAttributes.TRUSTED_ONLY))); Assert.assertNull("classloader attached, but should be null", jnlpFile.getManifestsAttributes().getAttribute(new Attributes.Name(JNLPFile.ManifestsAttributes.ENTRY_POINT))); Assert.assertNull("classloader attached, but should be null", jnlpFile.getManifestsAttributes().getMainClass()); Assert.assertNull("classloader attached, but should be null", jnlpFile.getManifestsAttributes().getApplicationName()); Assert.assertNull("classloader attached, but should be null", jnlpFile.getManifestsAttributes().getApplicationLibraryAllowableCodebase()); Assert.assertNull("classloader attached, but should be null", jnlpFile.getManifestsAttributes().getCallerAllowableCodebase()); Assert.assertNull("classloader attached, but should be null", jnlpFile.getManifestsAttributes().getCodebase()); Assert.assertEquals("no classloader attached, should be null", JNLPFile.ManifestBoolean.UNDEFINED, jnlpFile.getManifestsAttributes().isSandboxForced()); Assert.assertEquals("no classloader attached, should be null", JNLPFile.ManifestBoolean.UNDEFINED, jnlpFile.getManifestsAttributes().isTrustedLibrary()); Assert.assertEquals("no classloader attached, should be null", JNLPFile.ManifestBoolean.UNDEFINED, jnlpFile.getManifestsAttributes().isTrustedOnly()); } @Test public void newSecurityAttributesTest() throws Exception { //oreder is tested in removeTitle //here we go with pure loading and aprsing of them File tempDirectory = FileTestUtils.createTempDirectory(); tempDirectory.deleteOnExit(); File jarLocation6 = new File(tempDirectory, "test6.jar"); File jarLocation7 = new File(tempDirectory, "test7.jar"); Manifest manifest6 = new Manifest(); manifest6.getMainAttributes().put(Attributes.Name.MAIN_CLASS, "DummyClass1"); //see DummyJNLPFileWithJar constructor with int manifest6.getMainAttributes().put(new Attributes.Name(JNLPFile.ManifestsAttributes.APP_NAME), "DummyClass1 title"); manifest6.getMainAttributes().put(new Attributes.Name(JNLPFile.ManifestsAttributes.ENTRY_POINT), "main1 main2"); manifest6.getMainAttributes().put(new Attributes.Name(JNLPFile.ManifestsAttributes.APP_LIBRARY_ALLOWABLE), "*.com https://*.cz"); manifest6.getMainAttributes().put(new Attributes.Name(JNLPFile.ManifestsAttributes.CALLER_ALLOWABLE), "*.net ftp://*uu.co.uk"); manifest6.getMainAttributes().put(new Attributes.Name(JNLPFile.ManifestsAttributes.CODEBASE), "*.com *.net *.cz *.co.uk"); /* * "sandbox" or "all-permissions" */ /* TODO: Commented lines with "sandbox" permissions specified are causing failures after * PR1769 ("Permissions: sandbox" manifest attribute) patch is applied. The problem * appears to be that the JarCertVerifier thinks that DummyJNLPFileWithJars are * signed (jcv.isFullySigned() falls into the isTriviallySigned() case) even though * they are completely unsigned. This *may* be only be an issue with DummyJNLPFiles. */ // manifest6.getMainAttributes().put(new Attributes.Name(JNLPFile.ManifestsAttributes.PERMISSIONS), "sandbox"); /* commented due to DummyJNLP being "signed" */ manifest6.getMainAttributes().put(new Attributes.Name(JNLPFile.ManifestsAttributes.PERMISSIONS), "all-permissions"); manifest6.getMainAttributes().put(new Attributes.Name(JNLPFile.ManifestsAttributes.TRUSTED_LIBRARY), "false"); manifest6.getMainAttributes().put(new Attributes.Name(JNLPFile.ManifestsAttributes.TRUSTED_ONLY), "false"); Manifest manifest7 = new Manifest(); //6 must e main manifest7.getMainAttributes().put(Attributes.Name.MAIN_CLASS, "DummyClass2"); /* * "sandbox" or "all-permissions" */ manifest7.getMainAttributes().put(new Attributes.Name(JNLPFile.ManifestsAttributes.PERMISSIONS), "erroronous one"); manifest7.getMainAttributes().put(new Attributes.Name(JNLPFile.ManifestsAttributes.TRUSTED_LIBRARY), "erroronous one"); manifest7.getMainAttributes().put(new Attributes.Name(JNLPFile.ManifestsAttributes.TRUSTED_ONLY), "erroronous one"); FileTestUtils.createJarWithContents(jarLocation6, manifest6); FileTestUtils.createJarWithContents(jarLocation7, manifest7); final DummyJNLPFileWithJar jnlpFile = new DummyJNLPFileWithJar(1, jarLocation7, jarLocation6); //jar 6 should be main. Jar 7 have wrong items, but they are never laoded as in main jar are the correct one final DummyJNLPFileWithJar errorJnlpFile = new DummyJNLPFileWithJar(0, jarLocation7); //jar 7 should be main Assert.assertNull("no classloader attached, should be null", jnlpFile.getManifestsAttributes().getAttribute(new Attributes.Name(JNLPFile.ManifestsAttributes.APP_NAME))); Assert.assertNull("no classloader attached, should be null", jnlpFile.getManifestsAttributes().getAttribute(new Attributes.Name(JNLPFile.ManifestsAttributes.ENTRY_POINT))); Assert.assertNull("no classloader attached, should be null", jnlpFile.getManifestsAttributes().getAttribute(new Attributes.Name(JNLPFile.ManifestsAttributes.APP_LIBRARY_ALLOWABLE))); Assert.assertNull("no classloader attached, should be null", jnlpFile.getManifestsAttributes().getAttribute(new Attributes.Name(JNLPFile.ManifestsAttributes.CALLER_ALLOWABLE))); Assert.assertNull("no classloader attached, should be null", jnlpFile.getManifestsAttributes().getAttribute(new Attributes.Name(JNLPFile.ManifestsAttributes.CODEBASE))); Assert.assertNull("no classloader attached, should be null", jnlpFile.getManifestsAttributes().getAttribute(new Attributes.Name(JNLPFile.ManifestsAttributes.PERMISSIONS))); Assert.assertNull("no classloader attached, should be null", jnlpFile.getManifestsAttributes().getAttribute(new Attributes.Name(JNLPFile.ManifestsAttributes.TRUSTED_LIBRARY))); Assert.assertNull("no classloader attached, should be null", jnlpFile.getManifestsAttributes().getAttribute(new Attributes.Name(JNLPFile.ManifestsAttributes.TRUSTED_ONLY))); Assert.assertNull("no classloader attached, should be null", jnlpFile.getManifestsAttributes().getApplicationName()); Assert.assertNull("no classloader attached, should be null", jnlpFile.getManifestsAttributes().getApplicationLibraryAllowableCodebase()); Assert.assertNull("no classloader attached, should be null", jnlpFile.getManifestsAttributes().getCallerAllowableCodebase()); Assert.assertNull("no classloader attached, should be null", jnlpFile.getManifestsAttributes().getCodebase()); Assert.assertEquals("no classloader attached, should be null", JNLPFile.ManifestBoolean.UNDEFINED, jnlpFile.getManifestsAttributes().isSandboxForced()); Assert.assertEquals("no classloader attached, should be null", JNLPFile.ManifestBoolean.UNDEFINED, jnlpFile.getManifestsAttributes().isTrustedLibrary()); Assert.assertEquals("no classloader attached, should be null", JNLPFile.ManifestBoolean.UNDEFINED, jnlpFile.getManifestsAttributes().isTrustedOnly()); final JNLPClassLoader classLoader = new JNLPClassLoader(jnlpFile, UpdatePolicy.ALWAYS); //jnlp file got its instance in classloaders constructor //jnlpFile.getManifestsAttributes().setLoader(classLoader); Exception ex = null; try { final JNLPClassLoader errorClassLoader = new JNLPClassLoader(errorJnlpFile, UpdatePolicy.ALWAYS);//jnlp file got its instance in classloaders constructor //errorJnlpFile.getManifestsAttributes().setLoader(errorClassLoader); } catch (Exception e){ //correct exception ex = e; } Assert.assertNotNull(ex); Assert.assertEquals("DummyClass1 title", jnlpFile.getManifestsAttributes().getAttribute(new Attributes.Name(JNLPFile.ManifestsAttributes.APP_NAME))); Assert.assertEquals("main1 main2", jnlpFile.getManifestsAttributes().getAttribute(new Attributes.Name(JNLPFile.ManifestsAttributes.ENTRY_POINT))); Assert.assertEquals("*.com https://*.cz", jnlpFile.getManifestsAttributes().getAttribute(new Attributes.Name(JNLPFile.ManifestsAttributes.APP_LIBRARY_ALLOWABLE))); Assert.assertEquals("*.net ftp://*uu.co.uk", jnlpFile.getManifestsAttributes().getAttribute(new Attributes.Name(JNLPFile.ManifestsAttributes.CALLER_ALLOWABLE))); Assert.assertEquals("*.com *.net *.cz *.co.uk", jnlpFile.getManifestsAttributes().getAttribute(new Attributes.Name(JNLPFile.ManifestsAttributes.CODEBASE))); // Assert.assertEquals(SecurityDesc.RequestedPermissionLevel.SANDBOX.toHtmlString(), jnlpFile.getManifestsAttributes().getAttribute(new Attributes.Name(JNLPFile.ManifestsAttributes.PERMISSIONS))); /* commented due to DummyJNLP being "signed" */ Assert.assertEquals(SecurityDesc.RequestedPermissionLevel.ALL.toHtmlString(), jnlpFile.getManifestsAttributes().getAttribute(new Attributes.Name(JNLPFile.ManifestsAttributes.PERMISSIONS))); Assert.assertEquals("false", jnlpFile.getManifestsAttributes().getAttribute(new Attributes.Name(JNLPFile.ManifestsAttributes.TRUSTED_LIBRARY))); Assert.assertEquals("false", jnlpFile.getManifestsAttributes().getAttribute(new Attributes.Name(JNLPFile.ManifestsAttributes.TRUSTED_ONLY))); Assert.assertNull(errorJnlpFile.getManifestsAttributes().getAttribute(new Attributes.Name(JNLPFile.ManifestsAttributes.APP_NAME))); Assert.assertNull(errorJnlpFile.getManifestsAttributes().getAttribute(new Attributes.Name(JNLPFile.ManifestsAttributes.ENTRY_POINT))); Assert.assertNull(errorJnlpFile.getManifestsAttributes().getAttribute(new Attributes.Name(JNLPFile.ManifestsAttributes.APP_LIBRARY_ALLOWABLE))); Assert.assertNull(errorJnlpFile.getManifestsAttributes().getAttribute(new Attributes.Name(JNLPFile.ManifestsAttributes.CALLER_ALLOWABLE))); Assert.assertNull(errorJnlpFile.getManifestsAttributes().getAttribute(new Attributes.Name(JNLPFile.ManifestsAttributes.CODEBASE))); Assert.assertEquals("erroronous one", errorJnlpFile.getManifestsAttributes().getAttribute(new Attributes.Name(JNLPFile.ManifestsAttributes.PERMISSIONS))); Assert.assertEquals("erroronous one", errorJnlpFile.getManifestsAttributes().getAttribute(new Attributes.Name(JNLPFile.ManifestsAttributes.TRUSTED_LIBRARY))); Assert.assertEquals("erroronous one", errorJnlpFile.getManifestsAttributes().getAttribute(new Attributes.Name(JNLPFile.ManifestsAttributes.TRUSTED_ONLY))); Assert.assertEquals("DummyClass1 title", jnlpFile.getManifestsAttributes().getApplicationName()); Assert.assertEquals(true, jnlpFile.getManifestsAttributes().getApplicationLibraryAllowableCodebase().matches(new URL("http://aa.com"))); Assert.assertEquals(true, jnlpFile.getManifestsAttributes().getApplicationLibraryAllowableCodebase().matches(new URL("https://aa.cz"))); Assert.assertEquals(true, jnlpFile.getManifestsAttributes().getApplicationLibraryAllowableCodebase().matches(new URL("https://aa.com"))); Assert.assertEquals(false, jnlpFile.getManifestsAttributes().getApplicationLibraryAllowableCodebase().matches(new URL("http://aa.cz"))); Assert.assertEquals(true, jnlpFile.getManifestsAttributes().getCallerAllowableCodebase().matches(new URL("http://aa.net"))); Assert.assertEquals(true, jnlpFile.getManifestsAttributes().getCallerAllowableCodebase().matches(new URL("ftp://aa.uu.co.uk"))); Assert.assertEquals(false, jnlpFile.getManifestsAttributes().getCallerAllowableCodebase().matches(new URL("http://aa.uu.co.uk"))); Assert.assertEquals("*.com *.net *.cz *.co.uk", jnlpFile.getManifestsAttributes().getAttribute(new Attributes.Name(JNLPFile.ManifestsAttributes.CODEBASE))); Assert.assertEquals(true, jnlpFile.getManifestsAttributes().getCodebase().matches(new URL("http://aa.com"))); Assert.assertEquals(true, jnlpFile.getManifestsAttributes().getCodebase().matches(new URL("ftp://aa.bb.net"))); Assert.assertEquals(true, jnlpFile.getManifestsAttributes().getCodebase().matches(new URL("https://x.net"))); Assert.assertEquals(false, jnlpFile.getManifestsAttributes().getCodebase().matches(new URL("http://aa.bb/com"))); // Assert.assertEquals(JNLPFile.ManifestBoolean.TRUE, jnlpFile.getManifestsAttributes().isSandboxForced()); /* commented due to DummyJNLP being "signed" */ Assert.assertEquals(JNLPFile.ManifestBoolean.FALSE, jnlpFile.getManifestsAttributes().isSandboxForced()); Assert.assertEquals(JNLPFile.ManifestBoolean.FALSE, jnlpFile.getManifestsAttributes().isTrustedLibrary()); Assert.assertEquals(JNLPFile.ManifestBoolean.FALSE, jnlpFile.getManifestsAttributes().isTrustedOnly()); ex = null; try { errorJnlpFile.getManifestsAttributes().isSandboxForced(); } catch (Exception e) { ex = e; } Assert.assertNotNull(ex); ex = null; try { Assert.assertEquals("erroronous one", errorJnlpFile.getManifestsAttributes().isTrustedLibrary()); } catch (Exception e) { ex = e; } Assert.assertNotNull(ex); ex = null; try { Assert.assertEquals("erroronous one", errorJnlpFile.getManifestsAttributes().isTrustedOnly()); } catch (Exception e) { ex = e; } Assert.assertNotNull(ex); } @Test public void removeTitle() throws Exception { File tempDirectory = FileTestUtils.createTempDirectory(); tempDirectory.deleteOnExit(); File jarLocation1 = new File(tempDirectory, "test1.jar"); File jarLocation2 = new File(tempDirectory, "test2.jar"); File jarLocation3 = new File(tempDirectory, "test3.jar"); File jarLocation4 = new File(tempDirectory, "test4.jar"); File jarLocation5 = new File(tempDirectory, "test5.jar"); /* Test with various attributes in manifest!s! */ Manifest manifest1 = new Manifest(); manifest1.getMainAttributes().put(Attributes.Name.MAIN_CLASS, "DummyClass1"); //two times, but one in main jar, see DummyJNLPFileWithJar constructor with int Manifest manifest2 = new Manifest(); manifest2.getMainAttributes().put(Attributes.Name.IMPLEMENTATION_VENDOR, "rh1"); //two times, both in not main jar, see DummyJNLPFileWithJar constructor with int Manifest manifest3 = new Manifest(); manifest3.getMainAttributes().put(Attributes.Name.IMPLEMENTATION_TITLE, "it"); //jsut once in not main jar, see DummyJNLPFileWithJar constructor with int manifest3.getMainAttributes().put(Attributes.Name.IMPLEMENTATION_VENDOR, "rh2"); Manifest manifest4 = new Manifest(); manifest4.getMainAttributes().put(Attributes.Name.MAIN_CLASS, "DummyClass2"); //see jnlpFile.setMainJar(3); manifest4.getMainAttributes().put(Attributes.Name.IMPLEMENTATION_URL, "some url2"); //see DummyJNLPFileWithJar constructor with int //first jar Manifest manifest5 = new Manifest(); manifest5.getMainAttributes().put(Attributes.Name.IMPLEMENTATION_URL, "some url1"); //see DummyJNLPFileWithJar constructor with int manifest5.getMainAttributes().put(new Attributes.Name(JNLPFile.ManifestsAttributes.APP_NAME), "Manifested Name"); FileTestUtils.createJarWithContents(jarLocation1, manifest1); FileTestUtils.createJarWithContents(jarLocation2, manifest2); FileTestUtils.createJarWithContents(jarLocation3, manifest3); FileTestUtils.createJarWithContents(jarLocation4, manifest4); FileTestUtils.createJarWithContents(jarLocation5, manifest5); final DummyJNLPFileWithJar jnlpFile = new DummyJNLPFileWithJar(3, jarLocation5, jarLocation3, jarLocation4, jarLocation1, jarLocation2); //jar 1 should be main Assert.assertNull("no classloader attached, should be null", jnlpFile.getManifestsAttributes().getMainClass()); Assert.assertNull("no classloader attached, should be null", jnlpFile.getManifestsAttributes().getAttribute(Attributes.Name.IMPLEMENTATION_VENDOR)); Assert.assertNull("no classloader attached, should be null", jnlpFile.getManifestsAttributes().getAttribute(Attributes.Name.IMPLEMENTATION_TITLE)); Assert.assertNull("no classloader attached, should be null", jnlpFile.getManifestsAttributes().getAttribute(Attributes.Name.MAIN_CLASS)); Assert.assertNull("no classloader attached, should be null", jnlpFile.getManifestsAttributes().getAttribute(Attributes.Name.IMPLEMENTATION_VENDOR_ID)); Assert.assertNull("no classloader attached, should be null", jnlpFile.getManifestsAttributes().getAttribute(Attributes.Name.IMPLEMENTATION_URL)); Assert.assertNull("no classloader attached, should be null", jnlpFile.getManifestsAttributes().getAttribute(new Attributes.Name(JNLPFile.ManifestsAttributes.APP_NAME))); Assert.assertNull(jnlpFile.getTitleFromJnlp()); Assert.assertNull(jnlpFile.getTitleFromManifest()); Assert.assertNull(jnlpFile.getTitle()); setTitle(jnlpFile); Assert.assertEquals("jnlp title", jnlpFile.getTitleFromJnlp()); Assert.assertNull(jnlpFile.getTitleFromManifest()); Assert.assertEquals("jnlp title", jnlpFile.getTitle()); removeTitle(jnlpFile); Assert.assertNull(jnlpFile.getTitleFromJnlp()); Assert.assertNull(jnlpFile.getTitleFromManifest()); Assert.assertNull(jnlpFile.getTitle()); final JNLPClassLoader classLoader = new JNLPClassLoader(jnlpFile, UpdatePolicy.ALWAYS);//jnlp file got its instance in classloaders constructor //jnlpFile.getManifestsAttributes().setLoader(classLoader); Assert.assertNotNull("classloader attached, should be not null", jnlpFile.getManifestsAttributes().getMainClass()); Assert.assertNull("defined twice, shoud be null", jnlpFile.getManifestsAttributes().getAttribute(Attributes.Name.IMPLEMENTATION_VENDOR)); Assert.assertNotNull("classloader attached, should be not null", jnlpFile.getManifestsAttributes().getAttribute(Attributes.Name.IMPLEMENTATION_TITLE)); Assert.assertNotNull("classloader attached, should be not null", jnlpFile.getManifestsAttributes().getAttribute(Attributes.Name.MAIN_CLASS)); Assert.assertNull("not deffined, should benull", jnlpFile.getManifestsAttributes().getAttribute(Attributes.Name.IMPLEMENTATION_VENDOR_ID)); Assert.assertNotNull("classloader attached, should be not null", jnlpFile.getManifestsAttributes().getAttribute(Attributes.Name.IMPLEMENTATION_URL)); Assert.assertNotNull("classloader attached, should be not null", jnlpFile.getManifestsAttributes().getAttribute(new Attributes.Name(JNLPFile.ManifestsAttributes.APP_NAME))); //correct values are also tested in JnlpClassloaderTest Assert.assertEquals("classloader attached, should be not null", "it", jnlpFile.getManifestsAttributes().getAttribute(Attributes.Name.IMPLEMENTATION_TITLE)); Assert.assertEquals("classloader attached, should be not null", "DummyClass1", jnlpFile.getManifestsAttributes().getAttribute(Attributes.Name.MAIN_CLASS)); Assert.assertEquals("classloader attached, should be not null", "some url1", jnlpFile.getManifestsAttributes().getAttribute(Attributes.Name.IMPLEMENTATION_URL)); Assert.assertEquals("classloader attached, should be not null", "Manifested Name", jnlpFile.getManifestsAttributes().getAttribute(new Attributes.Name(JNLPFile.ManifestsAttributes.APP_NAME))); Assert.assertNull(jnlpFile.getTitleFromJnlp()); Assert.assertEquals("Manifested Name", jnlpFile.getTitleFromManifest()); Assert.assertEquals("Manifested Name", jnlpFile.getTitle()); setTitle(jnlpFile); Assert.assertEquals("jnlp title", jnlpFile.getTitleFromJnlp()); Assert.assertEquals("Manifested Name", jnlpFile.getTitleFromManifest()); Assert.assertEquals("jnlp title (Manifested Name)", jnlpFile.getTitle()); } private void setTitle(final DummyJNLPFileWithJar jnlpFile) { setTitle(jnlpFile, "jnlp title"); } private void setTitle(final DummyJNLPFileWithJar jnlpFile, final String title) { jnlpFile.setInfo(Arrays.asList(new InformationDesc[]{ new InformationDesc(new Locale[]{}, false) { @Override public String getTitle() { return title; } } })); } private void removeTitle(final DummyJNLPFileWithJar jnlpFile) { jnlpFile.setInfo(Arrays.asList(new InformationDesc[]{})); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/runtime/PaxHeaders.17941/JNLPClassLoaderTest.0000644000000000000000000000013212654402377030024 xustar0030 mtime=1454507263.295431808 30 atime=1454507327.197579563 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/runtime/JNLPClassLoaderTest.java0000644000175000002070000003550412654402377031420 0ustar00jvanekmock00000000000000/*Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.runtime; import static net.sourceforge.jnlp.util.FileTestUtils.assertNoFileLeak; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.fail; import java.io.File; import java.util.Arrays; import java.util.jar.Attributes; import java.util.jar.Manifest; import net.sourceforge.jnlp.LaunchException; import net.sourceforge.jnlp.cache.UpdatePolicy; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.mock.DummyJNLPFileWithJar; import net.sourceforge.jnlp.security.appletextendedsecurity.AppletSecurityLevel; import net.sourceforge.jnlp.security.appletextendedsecurity.AppletStartupSecuritySettings; import net.sourceforge.jnlp.util.FileTestUtils; import net.sourceforge.jnlp.util.logging.NoStdOutErrTest; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; public class JNLPClassLoaderTest extends NoStdOutErrTest{ private static AppletSecurityLevel level; public static String askUser; @BeforeClass public static void setPermissions() { level = AppletStartupSecuritySettings.getInstance().getSecurityLevel(); JNLPRuntime.getConfiguration().setProperty(DeploymentConfiguration.KEY_SECURITY_LEVEL, AppletSecurityLevel.ALLOW_UNSIGNED.toChars()); } @AfterClass public static void resetPermissions() { JNLPRuntime.getConfiguration().setProperty(DeploymentConfiguration.KEY_SECURITY_LEVEL, level.toChars()); } @BeforeClass public static void noDialogs(){ askUser = JNLPRuntime.getConfiguration().getProperty(DeploymentConfiguration.KEY_SECURITY_PROMPT_USER); JNLPRuntime.getConfiguration().setProperty(DeploymentConfiguration.KEY_SECURITY_PROMPT_USER, Boolean.toString(false)); } @AfterClass public static void restoreDialogs(){ JNLPRuntime.getConfiguration().setProperty(DeploymentConfiguration.KEY_SECURITY_PROMPT_USER, askUser); } /* Note: Only does file leak testing for now. */ @Test public void constructorFileLeakTest() throws Exception { File tempDirectory = FileTestUtils.createTempDirectory(); File jarLocation = new File(tempDirectory, "test.jar"); FileTestUtils.createJarWithContents(jarLocation /* no contents*/); final DummyJNLPFileWithJar jnlpFile = new DummyJNLPFileWithJar(jarLocation); assertNoFileLeak( new Runnable () { @Override public void run() { try { new JNLPClassLoader(jnlpFile, UpdatePolicy.ALWAYS); } catch (LaunchException e) { fail(e.toString()); } } }); } /* Note: We should create a JNLPClassLoader with an invalid jar to test isInvalidJar with. * However, it is tricky without it erroring-out. */ @Test public void isInvalidJarTest() throws Exception { File tempDirectory = FileTestUtils.createTempDirectory(); File jarLocation = new File(tempDirectory, "test.jar"); FileTestUtils.createJarWithContents(jarLocation /* no contents*/); final DummyJNLPFileWithJar jnlpFile = new DummyJNLPFileWithJar(jarLocation); final JNLPClassLoader classLoader = new JNLPClassLoader(jnlpFile, UpdatePolicy.ALWAYS); assertNoFileLeak( new Runnable () { @Override public void run() { assertFalse(classLoader.isInvalidJar(jnlpFile.getJarDesc())); } }); } @Test public void getMainClassNameTest() throws Exception { File tempDirectory = FileTestUtils.createTempDirectory(); File jarLocation = new File(tempDirectory, "test.jar"); /* Test with main-class in manifest */ { Manifest manifest = new Manifest(); manifest.getMainAttributes().put(Attributes.Name.MAIN_CLASS, "DummyClass"); FileTestUtils.createJarWithContents(jarLocation, manifest); final DummyJNLPFileWithJar jnlpFile = new DummyJNLPFileWithJar(jarLocation); final JNLPClassLoader classLoader = new JNLPClassLoader(jnlpFile, UpdatePolicy.ALWAYS); assertNoFileLeak(new Runnable() { @Override public void run() { assertEquals("DummyClass", classLoader.getMainClassName(jnlpFile.getJarLocation())); } }); } } @Test public void getMainClassNameTestEmpty() throws Exception { /* Test with-out any main-class specified */ { File tempDirectory = FileTestUtils.createTempDirectory(); File jarLocation = new File(tempDirectory, "test.jar"); FileTestUtils.createJarWithContents(jarLocation /* No contents */); final DummyJNLPFileWithJar jnlpFile = new DummyJNLPFileWithJar(jarLocation); final JNLPClassLoader classLoader = new JNLPClassLoader(jnlpFile, UpdatePolicy.ALWAYS); assertNoFileLeak(new Runnable() { @Override public void run() { assertEquals(null, classLoader.getMainClassName(jnlpFile.getJarLocation())); } }); } } /* Note: Although it does a basic check, this mainly checks for file-descriptor leak */ @Test public void checkForMainFileLeakTest() throws Exception { File tempDirectory = FileTestUtils.createTempDirectory(); File jarLocation = new File(tempDirectory, "test.jar"); FileTestUtils.createJarWithContents(jarLocation /* No contents */); final DummyJNLPFileWithJar jnlpFile = new DummyJNLPFileWithJar(jarLocation); final JNLPClassLoader classLoader = new JNLPClassLoader(jnlpFile, UpdatePolicy.ALWAYS); assertNoFileLeak(new Runnable() { @Override public void run() { try { classLoader.checkForMain(Arrays.asList(jnlpFile.getJarDesc())); } catch (LaunchException e) { fail(e.toString()); } } }); assertFalse(classLoader.hasMainJar()); } @Test public void getCustomAtributes() throws Exception { File tempDirectory = FileTestUtils.createTempDirectory(); File jarLocation = new File(tempDirectory, "testX.jar"); /* Test with attributes in manifest */ Manifest manifest = new Manifest(); manifest.getMainAttributes().put(Attributes.Name.MAIN_CLASS, "DummyClass"); manifest.getMainAttributes().put(Attributes.Name.IMPLEMENTATION_TITLE, "it"); manifest.getMainAttributes().put(Attributes.Name.IMPLEMENTATION_VENDOR, "rh"); FileTestUtils.createJarWithContents(jarLocation, manifest); final DummyJNLPFileWithJar jnlpFile = new DummyJNLPFileWithJar(jarLocation); final JNLPClassLoader classLoader = new JNLPClassLoader(jnlpFile, UpdatePolicy.ALWAYS); assertNoFileLeak(new Runnable() { @Override public void run() { assertEquals("rh", classLoader.getManifestAttribute(jnlpFile.getJarLocation(), Attributes.Name.IMPLEMENTATION_VENDOR)); assertEquals("DummyClass", classLoader.getManifestAttribute(jnlpFile.getJarLocation(), Attributes.Name.MAIN_CLASS)); assertEquals("it", classLoader.getManifestAttribute(jnlpFile.getJarLocation(), Attributes.Name.IMPLEMENTATION_TITLE)); } }); } @Test public void getCustomAtributesEmpty() throws Exception { File tempDirectory = FileTestUtils.createTempDirectory(); File jarLocation = new File(tempDirectory, "testX.jar"); /* Test with-out any attribute specified specified */ FileTestUtils.createJarWithContents(jarLocation /* No contents */); final DummyJNLPFileWithJar jnlpFile = new DummyJNLPFileWithJar(jarLocation); final JNLPClassLoader classLoader = new JNLPClassLoader(jnlpFile, UpdatePolicy.ALWAYS); assertNoFileLeak(new Runnable() { @Override public void run() { assertEquals(null, classLoader.getManifestAttribute(jnlpFile.getJarLocation(), Attributes.Name.IMPLEMENTATION_VENDOR)); assertEquals(null, classLoader.getManifestAttribute(jnlpFile.getJarLocation(), Attributes.Name.MAIN_CLASS)); assertEquals(null, classLoader.getManifestAttribute(jnlpFile.getJarLocation(), Attributes.Name.IMPLEMENTATION_TITLE)); } }); } @Test public void checkOrderWhenReadingAttributes() throws Exception { File tempDirectory = FileTestUtils.createTempDirectory(); File jarLocation1 = new File(tempDirectory, "test1.jar"); File jarLocation2 = new File(tempDirectory, "test2.jar"); File jarLocation3 = new File(tempDirectory, "test3.jar"); File jarLocation4 = new File(tempDirectory, "test4.jar"); File jarLocation5 = new File(tempDirectory, "test5.jar"); /* Test with various attributes in manifest!s! */ Manifest manifest1 = new Manifest(); manifest1.getMainAttributes().put(Attributes.Name.MAIN_CLASS, "DummyClass1"); //two times, but one in main jar, see DummyJNLPFileWithJar constructor with int Manifest manifest2 = new Manifest(); manifest2.getMainAttributes().put(Attributes.Name.IMPLEMENTATION_VENDOR, "rh1"); //two times, both in not main jar, see DummyJNLPFileWithJar constructor with int Manifest manifest3 = new Manifest(); manifest3.getMainAttributes().put(Attributes.Name.IMPLEMENTATION_TITLE, "it"); //jsut once in not main jar, see DummyJNLPFileWithJar constructor with int manifest3.getMainAttributes().put(Attributes.Name.IMPLEMENTATION_VENDOR, "rh2"); Manifest manifest4 = new Manifest(); manifest4.getMainAttributes().put(Attributes.Name.MAIN_CLASS, "DummyClass2"); //see jnlpFile.setMainJar(3); manifest4.getMainAttributes().put(Attributes.Name.IMPLEMENTATION_URL, "some url2"); //see DummyJNLPFileWithJar constructor with int //first jar Manifest manifest5 = new Manifest(); manifest5.getMainAttributes().put(Attributes.Name.IMPLEMENTATION_URL, "some url1"); //see DummyJNLPFileWithJar constructor with int FileTestUtils.createJarWithContents(jarLocation1, manifest1); FileTestUtils.createJarWithContents(jarLocation2, manifest2); FileTestUtils.createJarWithContents(jarLocation3, manifest3); FileTestUtils.createJarWithContents(jarLocation4, manifest4); FileTestUtils.createJarWithContents(jarLocation5, manifest5); final DummyJNLPFileWithJar jnlpFile = new DummyJNLPFileWithJar(3, jarLocation5, jarLocation3, jarLocation4, jarLocation1, jarLocation2); //jar 1 should be main final JNLPClassLoader classLoader = new JNLPClassLoader(jnlpFile, UpdatePolicy.ALWAYS); assertNoFileLeak(new Runnable() { @Override public void run() { //defined twice assertEquals(null, classLoader.checkForAttributeInJars(Arrays.asList(jnlpFile.getJarDescs()), Attributes.Name.IMPLEMENTATION_VENDOR)); //defined twice, but one in main jar assertEquals("DummyClass1", classLoader.checkForAttributeInJars(Arrays.asList(jnlpFile.getJarDescs()), Attributes.Name.MAIN_CLASS)); //defined not in main jar assertEquals("it", classLoader.checkForAttributeInJars(Arrays.asList(jnlpFile.getJarDescs()), Attributes.Name.IMPLEMENTATION_TITLE)); //not deffined assertEquals(null, classLoader.checkForAttributeInJars(Arrays.asList(jnlpFile.getJarDescs()), Attributes.Name.IMPLEMENTATION_VENDOR_ID)); //deffined in first jar assertEquals("some url1", classLoader.checkForAttributeInJars(Arrays.asList(jnlpFile.getJarDescs()), Attributes.Name.IMPLEMENTATION_URL)); } }); } @Test public void tryNullManifest() throws Exception { File tempDirectory = FileTestUtils.createTempDirectory(); File jarLocation = new File(tempDirectory, "test-npe.jar"); File dummyContent = File.createTempFile("dummy", "context", tempDirectory); jarLocation.deleteOnExit(); /* Test with-out any attribute specified specified */ FileTestUtils.createJarWithoutManifestContents(jarLocation, dummyContent); final Exception[] exs = new Exception[2]; final DummyJNLPFileWithJar jnlpFile = new DummyJNLPFileWithJar(jarLocation); try { final JNLPClassLoader classLoader = new JNLPClassLoader(jnlpFile, UpdatePolicy.ALWAYS); assertNoFileLeak(new Runnable() { @Override public void run() { try { assertEquals(null, classLoader.getManifestAttribute(jnlpFile.getJarLocation(), Attributes.Name.MAIN_CLASS)); assertEquals(null, classLoader.getManifestAttribute(jnlpFile.getJarLocation(), Attributes.Name.IMPLEMENTATION_TITLE)); } catch (Exception e) { exs[0] = e; } } }); } catch (Exception e) { exs[1] = e; } Assert.assertNotNull(exs); Assert.assertNull(exs[0]); Assert.assertNull(exs[1]); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/runtime/PaxHeaders.17941/CodeBaseClassLoaderT0000644000000000000000000000013212654402377030134 xustar0030 mtime=1454507263.294431821 30 atime=1454507327.197579563 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/runtime/CodeBaseClassLoaderTest.java0000644000175000002070000002371512654402377032323 0ustar00jvanekmock00000000000000/* CodeBaseClassLoaderTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.runtime; import net.sourceforge.jnlp.mock.DummyJNLPFile; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import java.lang.reflect.Field; import java.net.URL; import net.sourceforge.jnlp.JNLPFile; import net.sourceforge.jnlp.NullJnlpFileException; import net.sourceforge.jnlp.SecurityDesc; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.runtime.JNLPClassLoader.CodeBaseClassLoader; import net.sourceforge.jnlp.annotations.Bug; import net.sourceforge.jnlp.annotations.Remote; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.security.appletextendedsecurity.AppletSecurityLevel; import net.sourceforge.jnlp.security.appletextendedsecurity.AppletStartupSecuritySettings; import net.sourceforge.jnlp.util.logging.NoStdOutErrTest; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; public class CodeBaseClassLoaderTest extends NoStdOutErrTest { private static AppletSecurityLevel level; private static String macStatus; @BeforeClass public static void setPermissions() { level = AppletStartupSecuritySettings.getInstance().getSecurityLevel(); macStatus = JNLPRuntime.getConfiguration().getProperty(DeploymentConfiguration.KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK); JNLPRuntime.getConfiguration().setProperty(DeploymentConfiguration.KEY_SECURITY_LEVEL, AppletSecurityLevel.ALLOW_UNSIGNED.toChars()); JNLPRuntime.getConfiguration().setProperty(DeploymentConfiguration.KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK, ManifestAttributesChecker.MANIFEST_ATTRIBUTES_CHECK.NONE.toString()); } @AfterClass public static void resetPermissions() { JNLPRuntime.getConfiguration().setProperty(DeploymentConfiguration.KEY_SECURITY_LEVEL, level.toChars()); JNLPRuntime.getConfiguration().setProperty(DeploymentConfiguration.KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK, macStatus); } private static final String isWSA = "isWebstartApplication"; static void setStaticField(Field field, Object newValue) throws Exception { field.setAccessible(true); field.set(null, newValue); } private void setWSA() throws Exception { setStaticField(JNLPRuntime.class.getDeclaredField(isWSA), true); } private void setApplet() throws Exception { setStaticField(JNLPRuntime.class.getDeclaredField(isWSA), false); } @AfterClass public static void tearDown() throws Exception { setStaticField(JNLPRuntime.class.getDeclaredField(isWSA), false); } @Bug(id = {"PR895", "http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2012-March/017626.html", "http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2012-March/017667.html"}) @Test @Remote public void testClassResourceLoadSuccessCachingApplication() throws Exception { setWSA(); //we are testing new resource not in cache testResourceCaching("net/sourceforge/jnlp/about/Main.class"); } @Test @Remote public void testClassResourceLoadSuccessCachingApplet() throws Exception { setApplet(); //so new resource again not in cache testResourceCaching("net/sourceforge/jnlp/about/Main.class"); } @Test @Remote public void testResourceLoadSuccessCachingApplication() throws Exception { setWSA(); //we are testing new resource not in cache testResourceCaching("net/sourceforge/jnlp/about/resources/about.html"); } @Test @Remote public void testResourceLoadSuccessCachingApplet() throws Exception { setApplet(); //so new resource again not in cache testResourceCaching("net/sourceforge/jnlp/about/resources/about.html"); } public void testResourceCaching(String r) throws Exception { testResourceCaching(r, true); } public void testResourceCaching(String r, boolean shouldExists) throws Exception { JNLPFile dummyJnlpFile = new DummyJNLPFile(); JNLPClassLoader parent = new JNLPClassLoader(dummyJnlpFile, null); CodeBaseClassLoader classLoader = new CodeBaseClassLoader(new URL[]{DummyJNLPFile.JAR_URL, DummyJNLPFile.CODEBASE_URL}, parent); int level = 10; if (shouldExists) { //for found the "caching" is by internal logic.Always faster, but who knows how... //to keep the test stabile keep the difference minimal level = 1; } long startTime, stopTime; startTime = System.nanoTime(); URL u1 = classLoader.findResource(r); if (shouldExists) { Assert.assertNotNull(u1); } else { Assert.assertNull(u1); } stopTime = System.nanoTime(); long timeOnFirstTry = stopTime - startTime; ServerAccess.logErrorReprint("" + timeOnFirstTry); startTime = System.nanoTime(); URL u2 = classLoader.findResource(r); if (shouldExists) { Assert.assertNotNull(u1); } else { Assert.assertNull(u2); } stopTime = System.nanoTime(); long timeOnSecondTry = stopTime - startTime; ServerAccess.logErrorReprint("" + timeOnSecondTry); assertTrue(timeOnSecondTry < (timeOnFirstTry / level)); } @Bug(id = {"PR895", "http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2012-March/017626.html", "http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2012-March/017667.html"}) @Test @Remote public void testResourceLoadFailureCachingApplication() throws Exception { setWSA(); testResourceCaching("net/sourceforge/jnlp/about/Main_FOO_.class", false); } @Test public void testResourceLoadFailureCachingApplet() throws Exception { setApplet(); testResourceCaching("net/sourceforge/jnlp/about/Main_FOO_.class", false); } @Test @Remote public void testParentClassLoaderIsAskedForClassesApplication() throws Exception { setWSA(); testParentClassLoaderIsAskedForClasses(); } @Test @Remote public void testParentClassLoaderIsAskedForClassesApplet() throws Exception { setApplet(); testParentClassLoaderIsAskedForClasses(); } public void testParentClassLoaderIsAskedForClasses() throws Exception { JNLPFile dummyJnlpFile = new DummyJNLPFile(); final boolean[] parentWasInvoked = new boolean[1]; JNLPClassLoader parent = new JNLPClassLoader(dummyJnlpFile, null) { @Override protected Class findClass(String name) throws ClassNotFoundException { parentWasInvoked[0] = true; throw new ClassNotFoundException(name); } }; CodeBaseClassLoader classLoader = new CodeBaseClassLoader(new URL[]{DummyJNLPFile.JAR_URL, DummyJNLPFile.CODEBASE_URL}, parent); try { classLoader.findClass("foo"); assertFalse("should not happen", true); } catch (ClassNotFoundException cnfe) { /* ignore */ } assertTrue(parentWasInvoked[0]); } @Test public void testNullFileSecurityDescApplication() throws Exception { setWSA(); Exception ex = null; try { testNullFileSecurityDesc(); } catch (Exception exx) { ex = exx; } Assert.assertTrue("was expected exception", ex != null); Assert.assertTrue("was expected " + NullJnlpFileException.class.getName(), ex instanceof NullJnlpFileException); } @Test @Remote public void testNullFileSecurityDescApplet() throws Exception { setApplet(); Exception ex = null; try { testNullFileSecurityDesc(); } catch (Exception exx) { ex = exx; } Assert.assertTrue("was expected exception", ex != null); Assert.assertTrue("was expected " + NullJnlpFileException.class.getName(), ex instanceof NullJnlpFileException); } public void testNullFileSecurityDesc() throws Exception { JNLPFile dummyJnlpFile = new DummyJNLPFile() { @Override public SecurityDesc getSecurity() { return new SecurityDesc(null, SecurityDesc.SANDBOX_PERMISSIONS, null); } }; JNLPClassLoader parent = new JNLPClassLoader(dummyJnlpFile, null); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.17941/resources0000644000000000000000000000013212654402377024555 xustar0030 mtime=1454507263.294431821 30 atime=1454507658.776157397 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/resources/0000755000175000002070000000000012654402377025355 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/resources/PaxHeaders.17941/MessagesProperties0000644000000000000000000000013212654402377030401 xustar0030 mtime=1454507263.294431821 30 atime=1454507327.196579577 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/resources/MessagesPropertiesTest.java0000644000175000002070000003214112654402377032705 0ustar00jvanekmock00000000000000/* Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.resources; import java.util.ArrayList; import java.util.Arrays; import java.util.Enumeration; import java.util.List; import java.util.Locale; import java.util.MissingResourceException; import java.util.ResourceBundle; import net.sourceforge.jnlp.ServerAccess; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import org.junit.BeforeClass; import org.junit.Test; public class MessagesPropertiesTest { private final static class LocalesIdentifier { public static final LocalesIdentifier DEFAULT = new LocalesIdentifier("",""); public static final LocalesIdentifier CZ = new LocalesIdentifier("cs"); //public static final LocalesIdentifier CZ_CS = new LocalesIdentifier("CZ","cs"); public static final LocalesIdentifier DE = new LocalesIdentifier("de"); public static final LocalesIdentifier PL = new LocalesIdentifier("pl"); //public static final LocalesIdentifier DE_DE = new LocalesIdentifier("DE","de"); public static final String mainFileName = "Messages"; public static final String pckg = "net.sourceforge.jnlp.resources"; private final String country; private final String language; private final Locale locale; private final ResourceBundle bundle; public LocalesIdentifier(String country, String language) { this.country = country; this.language = language; if (getCountry().equals("") && getLanguage().equals("")){ locale = new Locale("unknown_so_default", "unknown_so_default"); } else { //get default by non existing language and country locale = new Locale(language, country); } bundle = ResourceBundle.getBundle(pckg+"." + mainFileName, locale); } public LocalesIdentifier(String language) { this.country = null; this.language = language; locale = new Locale(language); bundle = ResourceBundle.getBundle(pckg+"." + mainFileName, locale); } public String getCountry() { if (country == null) { return ""; } return country.trim(); } public String getLanguage() { if (language == null) { return ""; } return language.trim(); } public ResourceBundle getBundle() { return bundle; } public Locale getLocale() { return locale; } public String getId() { if (getLanguage().equals("")) { return getCountry(); } if (getCountry().equals("")) { return getLanguage(); } return getLanguage() + "_" + getCountry(); } public String getIdentifier() { if (getId().equals("")) { return "default"; } return getId(); } @Override public String toString() { return pckg+"."+mainFileName+"_"+getId(); } } private static LocalesIdentifier main; private static LocalesIdentifier[] secondary; @BeforeClass public static void loadResourceBoundels() { //get default by non existing language and country main = LocalesIdentifier.DEFAULT; assertNotNull(main); secondary= new LocalesIdentifier[] {LocalesIdentifier.CZ, LocalesIdentifier.DE, LocalesIdentifier.PL}; assertNotNull(secondary); for (LocalesIdentifier secondary1 : secondary) { assertNotNull(secondary1); } } @Test public void allResourcesAreReallyDifferent() { List bundles = new ArrayList<>(secondary.length + 1); String detailResults=""; int errors = 0; bundles.addAll(Arrays.asList(secondary)); for (LocalesIdentifier resourceBundle1 : bundles) { Enumeration keys1 = resourceBundle1.getBundle().getKeys(); LocalesIdentifier resourceBundle2 = main; allLog("Checking for same items between " + resourceBundle1.getLocale() + " x " + resourceBundle2.getLocale() + " (should be " + resourceBundle1.getIdentifier() + " x " + resourceBundle2.getIdentifier() + ")"); int localErrors=0; while (keys1.hasMoreElements()) { String key = keys1.nextElement(); String val1 = getMissingResourceAsEmpty(resourceBundle1.getBundle(), key); if (val1.length() > 1000) { errLog("Skipping check of: " + key + " too long. (" + val1.length() + ")"); continue; } String val2 = getMissingResourceAsEmpty(resourceBundle2.getBundle(), key); outLog("\""+val1+"\" x \""+val2); if (val1.trim().equalsIgnoreCase(val2.trim())) { if (val1.trim().length() <= 5 /* short words like"ok", "", ...*/ || val1.toLowerCase().contains("://") /*urls...*/ || !val1.trim().contains(" ") /*one word*/ || val1.replaceAll("\\{\\d\\}", "").trim().length()<5 /*only vars and short words*/ //white list || (val1.trim().equals("std. err")) || (val1.trim().equals("std. out")) || (val1.trim().equals("Policy Editor")) || (val1.trim().equals("Java Reflection")) || (val1.trim().equals("javaws html")) || (val1.trim().matches("Minimum: .* Maximum: .*")) || (val1.trim().equals("jnlp href")) || (val1.trim().equals("GNU Lesser General Public License.")) ) { errLog("Warning! Items equals for: " + key + " = " + val1 + " but are in allowed subset"); } else { errors++; localErrors++; errLog("Error! Items equals for: " + key + " = " + val1); } } } if (localErrors > 0){ detailResults+=resourceBundle1.getIdentifier()+" x "+resourceBundle2.getIdentifier()+": "+localErrors+";"; } errLog(localErrors+" errors allResourcesAreReallyDifferent fo "+resourceBundle1.getIdentifier()+" x "+resourceBundle2.getIdentifier()); } assertTrue("Several - " + errors + " - items are same in bundles. See error logs for details: "+detailResults, errors == 0); } private String getMissingResourceAsEmpty(ResourceBundle res, String key) { try { return res.getString(key); } catch (MissingResourceException ex) { return ""; } } @Test //it is not critical that some localisations are missing, however good to know //and actually this test sis covered by allResourcesAreReallyDifferent, because fallback is geting default value for unknnow localisation public void warnForNotLocalisedStrings() { int errors = 0; Enumeration keys = main.getBundle().getKeys(); for (LocalesIdentifier secondary1 : secondary) { int localErrors = 0; ResourceBundle sec = secondary1.getBundle(); String id = secondary1.getIdentifier(); allLog("Checking for missing strings in " + sec.getLocale() + " (should be " + id + ") compared with default"); while (keys.hasMoreElements()) { String key = keys.nextElement(); String val1 = getMissingResourceAsEmpty(main.getBundle(), key); String val2 = getMissingResourceAsEmpty(sec, key); outLog("\""+val1+"\" x \""+val2); if (val1.trim().isEmpty()) { } else { if (val2.trim().isEmpty()){ errors++; localErrors++; errLog("Error! There is value for default: " + key + ", but for " + id+" is missing"); } } } errLog(localErrors+" warnForNotLocalisedStrings errors for "+id); } assertTrue("Several - " + errors + " - items have missing localization. See error logs for details", errors == 0); } @Test public void noEmptyResources() { List bundles = new ArrayList<>(secondary.length + 1); bundles.add(main); int errors = 0; bundles.addAll(Arrays.asList(secondary)); for (LocalesIdentifier bundle : bundles) { ResourceBundle resourceBundle = bundle.getBundle(); String id = bundle.getIdentifier(); Enumeration keys = resourceBundle.getKeys(); allLog("Checking for empty items in " + resourceBundle.getLocale() + " (should be " + id + ")"); int localErrors=0; while (keys.hasMoreElements()) { String key = keys.nextElement(); String val = getMissingResourceAsEmpty(resourceBundle, key); outLog("\""+key+"\" = \""+val); if (val.trim().isEmpty()) { errors++; localErrors++; errLog("Error! Key: " + key + " have no vlue"); } } errLog(localErrors+" noEmptyResources errors for "+id); } assertTrue("Several - " + errors + " - items have no values", errors == 0); } @Test public void findKeysWhichAreInLocalisedButNotInDefault() { int errors = 0; for (LocalesIdentifier secondary1 : secondary) { int localErrors = 0; ResourceBundle sec = secondary1.getBundle(); Enumeration keys = sec.getKeys(); String id = secondary1.getId(); outLog("Checking for redundant keys in " + sec.getLocale() + " (should be " + id + ") compared with default"); errLog("Checking for redundant keys in " + sec.getLocale() + " (should be " + id + ") compared with default"); while (keys.hasMoreElements()) { String key = keys.nextElement(); String val2 = getMissingResourceAsEmpty(main.getBundle(), key); String val1 = getMissingResourceAsEmpty(sec, key); outLog("\""+val1+"\" x \""+val2); if (val2.trim().isEmpty() && !val1.trim().isEmpty()){ errors++; localErrors++; errLog("Error! There is value for "+id+", key " + key + ", but for default is missing"); } } errLog(localErrors+" findKeysWhichAreInLocalisedButNotInDefault errors for "+id); } assertTrue("Several - " + errors + " - items have value in localized version but not in default one", errors == 0); } private void allLog(String string) { outLog(string); errLog(string); } private void errLog(String string) { //used quite often :) //System.out.println(string); ServerAccess.logErrorReprint(string); } private void outLog(String string) { ServerAccess.logOutputReprint(string); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.17941/launchApp.jnlp0000644000000000000000000000013212654402377025420 xustar0030 mtime=1454507263.293431834 30 atime=1454507327.196579577 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/launchApp.jnlp0000644000175000002070000000057212654402377026147 0ustar00jvanekmock00000000000000 Sample Test RedHat icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.17941/controlpanel0000644000000000000000000000013212654402377025243 xustar0030 mtime=1454507263.293431834 30 atime=1454507658.776157397 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/controlpanel/0000755000175000002070000000000012654402377026043 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/controlpanel/PaxHeaders.17941/CommandLineTest0000644000000000000000000000013212654402377030271 xustar0030 mtime=1454507263.293431834 30 atime=1454507327.196579577 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/controlpanel/CommandLineTest.java0000644000175000002070000002013512654402377031735 0ustar00jvanekmock00000000000000/* CommandLine.java -- command line interface to icedtea-web's deployment settings. Copyright (C) 2010 Red Hat This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be 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 this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package net.sourceforge.jnlp.controlpanel; import static net.sourceforge.jnlp.runtime.Translator.R; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.IOException; import java.io.PrintStream; import java.nio.file.Files; import net.sourceforge.jnlp.OptionsDefinitions; import net.sourceforge.jnlp.config.PathsAndFiles; import net.sourceforge.jnlp.util.logging.NoStdOutErrTest; import net.sourceforge.jnlp.util.logging.OutputController; import net.sourceforge.jnlp.util.optionparser.OptionParser; import net.sourceforge.jnlp.util.optionparser.UnevenParameterException; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; public class CommandLineTest extends NoStdOutErrTest{ public static final int ERROR = 1; public static final int SUCCESS = 0; private static File userDeployFile; private static String userDeployContents; @BeforeClass public static void setup() throws IOException { userDeployFile = PathsAndFiles.USER_DEPLOYMENT_FILE.getFile(); userDeployContents = new String(Files.readAllBytes(userDeployFile.toPath())); clearDeployFile(); } @AfterClass public static void afterClass() throws IOException { Files.write(userDeployFile.toPath(), userDeployContents.getBytes()); } private static void clearDeployFile() throws IOException { String clear = ""; Files.write(userDeployFile.toPath(), clear.getBytes()); } private ByteArrayOutputStream getOutputControllerStream() { ByteArrayOutputStream outStream = new ByteArrayOutputStream(); PrintStream outPrintStream = new PrintStream(outStream); OutputController.getLogger().setOut(outPrintStream); return outStream; } @Test public void testHandleSetCommand() throws IOException { ByteArrayOutputStream outStream = getOutputControllerStream(); String[] args = { "set", "deployment.security.level", "ALLOW_UNSIGNED" }; OptionParser optionParser = new OptionParser(args, OptionsDefinitions.getItwsettingsCommands()); CommandLine commandLine = new CommandLine(optionParser); int status = commandLine.handleSetCommand(); assertTrue(outStream.toString().isEmpty()); assertEquals(SUCCESS, status); clearDeployFile(); } @Test public void testHandleSetCommandDisplaysWarningOnUknownProperty() throws IOException { ByteArrayOutputStream outStream = getOutputControllerStream(); String[] args = { "set", "unknown", "does_not_matter" }; OptionParser optionParser = new OptionParser(args, OptionsDefinitions.getItwsettingsCommands()); CommandLine commandLine = new CommandLine(optionParser); int status = commandLine.handleSetCommand(); String output = outStream.toString(); assertEquals(output, R("CLWarningUnknownProperty", "unknown") + "\n"); assertEquals(SUCCESS, status); clearDeployFile(); } @Test public void testSetWithDuplicateKeyValuePair() throws IOException { ByteArrayOutputStream outStream = getOutputControllerStream(); String[] args = { "set", "blah", "blah" }; OptionParser optionParser = new OptionParser(args, OptionsDefinitions.getItwsettingsCommands()); CommandLine commandLine = new CommandLine(optionParser); int status = commandLine.handleSetCommand(); String contents = new String(Files.readAllBytes(userDeployFile.toPath())); String output = outStream.toString(); assertEquals(output, R("CLWarningUnknownProperty", "blah") + "\n"); assertEquals(SUCCESS, status); assertTrue(contents.contains("blah=blah")); clearDeployFile(); } @Test public void testSetWithDuplicateKeyValue() throws IOException { ByteArrayOutputStream outStream = getOutputControllerStream(); String[] args = { "set", "blue", "blah", "blah", "green" }; OptionParser optionParser = new OptionParser(args, OptionsDefinitions.getItwsettingsCommands()); CommandLine commandLine = new CommandLine(optionParser); int status = commandLine.handleSetCommand(); String contents = new String(Files.readAllBytes(userDeployFile.toPath())); String output = outStream.toString(); assertTrue(output.contains(R("CLWarningUnknownProperty", "blue") + "\n")); assertTrue(output.contains(R("CLWarningUnknownProperty", "blah") + "\n")); assertTrue(contents.contains("blue=blah")); assertTrue(contents.contains("blah=green")); assertEquals(SUCCESS, status); clearDeployFile(); } @Test public void testSetPropertyWithIncorrectValue() throws IOException { String[] args = { "set", "deployment.security.level", "INTENTIONALLY_INCORRECT" }; OptionParser optionParser = new OptionParser(args, OptionsDefinitions.getItwsettingsCommands()); CommandLine commandLine = new CommandLine(optionParser); int status = commandLine.handleSetCommand(); assertEquals(ERROR, status); clearDeployFile(); } @Test(expected = UnevenParameterException.class) public void testSetOddNumberOfParams() throws IOException { ByteArrayOutputStream outStream = getOutputControllerStream(); String[] args = { "set", "blue", "blah", "purple" }; OptionParser optionParser = new OptionParser(args, OptionsDefinitions.getItwsettingsCommands()); CommandLine commandLine = new CommandLine(optionParser); int status = commandLine.handleSetCommand(); clearDeployFile(); } @Test public void testSetWithValueHavingSpace() throws IOException { ByteArrayOutputStream outStream = getOutputControllerStream(); String[] args = { "set", "blue", "blah red" }; OptionParser optionParser = new OptionParser(args, OptionsDefinitions.getItwsettingsCommands()); CommandLine commandLine = new CommandLine(optionParser); int status = commandLine.handleSetCommand(); String contents = new String(Files.readAllBytes(userDeployFile.toPath())); String output = outStream.toString(); assertTrue(output.contains(R("CLWarningUnknownProperty", "blue") + "\n")); assertTrue(contents.contains("blue=blah red")); assertEquals(SUCCESS, status); clearDeployFile(); } @Test public void testSetWithKeyHavingSpace() throws IOException { ByteArrayOutputStream outStream = getOutputControllerStream(); String[] args = { "set", "blue green", "blah" }; OptionParser optionParser = new OptionParser(args, OptionsDefinitions.getItwsettingsCommands()); CommandLine commandLine = new CommandLine(optionParser); int status = commandLine.handleSetCommand(); String contents = new String(Files.readAllBytes(userDeployFile.toPath())); String output = outStream.toString(); assertTrue(output.contains(R("CLWarningUnknownProperty", "blue green") + "\n")); assertTrue(contents.contains("blue\\ green=blah")); assertEquals(SUCCESS, status); clearDeployFile(); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.17941/config0000644000000000000000000000013212654402377024010 xustar0030 mtime=1454507263.293431834 30 atime=1454507658.776157397 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/config/0000755000175000002070000000000012654402377024610 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/config/PaxHeaders.17941/DirectoryValidatorTes0000644000000000000000000000013212654402377030276 xustar0030 mtime=1454507263.293431834 30 atime=1454507327.196579577 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/config/DirectoryValidatorTest.java0000644000175000002070000002526412654402377032136 0ustar00jvanekmock00000000000000/* Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.config; import static org.junit.Assert.assertTrue; import java.io.File; import java.io.IOException; import java.util.Arrays; import net.sourceforge.jnlp.util.logging.NoStdOutErrTest; import org.junit.Test; public class DirectoryValidatorTest extends NoStdOutErrTest{ @Test public void testMainDirTestNotExists() { DirectoryValidator.DirectoryCheckResult result = DirectoryValidator.testDir(new File("/definitely/not/existing/file/efgrhisaes"), false, false); String s = result.getMessage(); assertTrue(s.endsWith("\n")); assertTrue(s.split("\n").length == 3); } @Test public void testMainDirTestExistsAsFile() throws IOException { File f = File.createTempFile("test", "testMainDirs"); f.deleteOnExit(); DirectoryValidator.DirectoryCheckResult result = DirectoryValidator.testDir(f, false, false); String s = result.getMessage(); assertTrue(s.endsWith("\n")); assertTrue(s.split("\n").length == 2); } @Test public void testMainDirTestExistsAsDir() throws IOException { File f = File.createTempFile("test", "testMainDirs"); assertTrue(f.delete()); assertTrue(f.mkdir()); f.deleteOnExit(); DirectoryValidator.DirectoryCheckResult result = DirectoryValidator.testDir(f, false, false); String s = result.getMessage(); assertTrue(s.isEmpty()); } @Test public void testMainDirTestExistsAsDirButNotWritable() throws IOException { File f = File.createTempFile("test", "testMainDirs"); assertTrue(f.delete()); assertTrue(f.mkdir()); assertTrue(f.setWritable(false)); f.deleteOnExit(); DirectoryValidator.DirectoryCheckResult result = DirectoryValidator.testDir(f, false, false); String s = result.getMessage(); assertTrue(s.endsWith("\n")); assertTrue(s.split("\n").length == 1); assertTrue(f.setWritable(true)); } @Test public void testMainDirTestExistsAsDirButNotReadable() throws IOException { File f = File.createTempFile("test", "testMainDirs"); assertTrue(f.delete()); assertTrue(f.mkdir()); f.deleteOnExit(); assertTrue(f.setReadable(false)); DirectoryValidator.DirectoryCheckResult result = DirectoryValidator.testDir(f, false, false); String s = result.getMessage(); assertTrue(s.endsWith("\n")); assertTrue(s.split("\n").length == 1); assertTrue(f.setReadable(true)); } @Test public void testMainDirTestNotExistsWithSubdir() { DirectoryValidator.DirectoryCheckResult result = DirectoryValidator.testDir(new File("/definitely/not/existing/file/efgrhisaes"), false, true); String s = result.getMessage(); assertTrue(s.endsWith("\n")); assertTrue(s.split("\n").length == 3); } @Test public void testMainDirTestExistsAsFileWithSubdir() throws IOException { File f = File.createTempFile("test", "testMainDirs"); f.deleteOnExit(); DirectoryValidator.DirectoryCheckResult result = DirectoryValidator.testDir(f, false, true); String s = result.getMessage(); assertTrue(s.endsWith("\n")); assertTrue(s.split("\n").length == 2); } @Test public void testMainDirTestExistsAsDirWithSubdir() throws IOException { File f = File.createTempFile("test", "testMainDirs"); assertTrue(f.delete()); assertTrue(f.mkdir()); f.deleteOnExit(); DirectoryValidator.DirectoryCheckResult result = DirectoryValidator.testDir(f, false, true); String s = result.getMessage(); assertTrue(s.isEmpty()); } @Test public void testMainDirTestExistsAsDirButNotWritableWithSubdir() throws IOException { File f = File.createTempFile("test", "testMainDirs"); assertTrue(f.delete()); assertTrue(f.mkdir()); assertTrue(f.setWritable(false)); f.deleteOnExit(); DirectoryValidator.DirectoryCheckResult result = DirectoryValidator.testDir(f, false, true); String s = result.getMessage(); assertTrue(s.endsWith("\n")); assertTrue(s.split("\n").length == 1); assertTrue(f.setWritable(true)); } @Test public void testMainDirTestExistsAsDirButNotReadableWithSubdir() throws IOException { File f = File.createTempFile("test", "testMainDirs"); assertTrue(f.delete()); assertTrue(f.mkdir()); f.deleteOnExit(); f.setReadable(false); DirectoryValidator.DirectoryCheckResult result = DirectoryValidator.testDir(f, false, true); String s = result.getMessage(); assertTrue(s.endsWith("\n")); assertTrue(s.split("\n").length == 1); } @Test public void testDirectoryCheckResult() { DirectoryValidator.DirectoryCheckResult r1 = new DirectoryValidator.DirectoryCheckResult(new File("a")); DirectoryValidator.DirectoryCheckResult r2 = new DirectoryValidator.DirectoryCheckResult(new File("b")); r1.subDir = r2; assertTrue(r1.getMessage().isEmpty()); assertTrue(r2.getMessage().isEmpty()); assertTrue(r1.getFailures() == 0); assertTrue(r2.getFailures() == 0); assertTrue(r1.getPasses() == 6); assertTrue(r2.getPasses() == 3); r1.correctPermissions = false; r2.isDir = false; assertTrue(r1.getMessage().split("\n").length == 2); assertTrue(r2.getMessage().split("\n").length == 1); assertTrue(r1.getFailures() == 2); assertTrue(r2.getFailures() == 1); assertTrue(r1.getPasses() == 4); assertTrue(r2.getPasses() == 2); r1.exists = false; r2.exists = false; assertTrue(r1.getMessage().split("\n").length == 4); assertTrue(r2.getMessage().split("\n").length == 2); assertTrue(r1.getFailures() == 4); assertTrue(r2.getFailures() == 2); assertTrue(r1.getPasses() == 2); assertTrue(r2.getPasses() == 1); r1.isDir = false; r2.correctPermissions = false; assertTrue(r1.getMessage().split("\n").length == 6); assertTrue(r2.getMessage().split("\n").length == 3); assertTrue(r1.getFailures() == 6); assertTrue(r2.getFailures() == 3); assertTrue(r1.getPasses() == 0); assertTrue(r2.getPasses() == 0); } @Test public void testDirectoryValidator() throws IOException { File f1 = File.createTempFile("test", "testMainDirs"); File f2 = File.createTempFile("test", "testMainDirs"); DirectoryValidator dv = new DirectoryValidator(Arrays.asList(f1, f2)); assertTrue(f1.delete()); assertTrue(f1.mkdir()); assertTrue(f1.setWritable(false)); f1.deleteOnExit(); assertTrue(f2.delete()); assertTrue(f2.mkdir()); assertTrue(f2.setWritable(false)); f2.deleteOnExit(); DirectoryValidator.DirectoryCheckResults results1 = dv.ensureDirs(); assertTrue(results1.results.size() == 2); assertTrue(results1.getFailures() == 2); assertTrue(results1.getPasses() == 4); String s1 = results1.getMessage(); assertTrue(s1.endsWith("\n")); assertTrue(s1.split("\n").length == 2); assertTrue(f1.setWritable(true)); DirectoryValidator.DirectoryCheckResults results2 = dv.ensureDirs(); assertTrue(results2.results.size() == 2); assertTrue(results2.getFailures() == 1); assertTrue(results2.getPasses() == 5); String s2 = results2.getMessage(); assertTrue(s2.endsWith("\n")); assertTrue(s2.split("\n").length == 1); assertTrue(f2.setWritable(true)); DirectoryValidator.DirectoryCheckResults results3 = dv.ensureDirs(); assertTrue(results3.results.size() == 2); assertTrue(results3.getFailures() == 0); assertTrue(results3.getPasses() == 6); String s3 = results3.getMessage(); assertTrue(s3.isEmpty()); assertTrue(f2.delete()); //will be created in dv.ensureDirs(); DirectoryValidator.DirectoryCheckResults results4 = dv.ensureDirs(); assertTrue(results4.results.size() == 2); assertTrue(results4.getFailures() == 0); assertTrue(results4.getPasses() == 6); String s4 = results4.getMessage(); assertTrue(s4.isEmpty()); File f3 = File.createTempFile("test", "testMainDirs", f2); File f4 = File.createTempFile("test", "testMainDirs", f2); assertTrue(f4.delete()); assertTrue(f3.delete()); assertTrue(f4.mkdir()); assertTrue(f2.setWritable(false)); //now f2 will not be recreated dv= new DirectoryValidator(Arrays.asList(f3, f4)); DirectoryValidator.DirectoryCheckResults results5 = dv.ensureDirs(); assertTrue(results5.results.size() == 2); assertTrue(results5.getFailures() == 3); assertTrue(results5.getPasses() == 3); String s5 = results5.getMessage(); assertTrue(s5.endsWith("\n")); assertTrue(s5.split("\n").length == 3); assertTrue(f2.setWritable(true)); assertTrue(f4.delete()); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/config/PaxHeaders.17941/DeploymentConfigurati0000644000000000000000000000013212654402377030323 xustar0030 mtime=1454507263.293431834 30 atime=1454507327.196579577 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/config/DeploymentConfigurationTest.java0000644000175000002070000001510512654402377033165 0ustar00jvanekmock00000000000000/* DeploymentConfigurationTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.config; import java.io.File; import java.io.IOException; import java.util.Date; import static org.junit.Assert.assertTrue; import java.util.Properties; import javax.naming.ConfigurationException; import net.sourceforge.jnlp.PluginBridgeTest; import net.sourceforge.jnlp.util.FileUtils; import net.sourceforge.jnlp.util.logging.NoStdOutErrTest; import org.junit.Assert; import org.junit.Test; public class DeploymentConfigurationTest extends NoStdOutErrTest{ @Test public void testLoad() throws ConfigurationException { DeploymentConfiguration config = new DeploymentConfiguration(); // FIXME test this more exhaustively config.load(); assertTrue(config.getAllPropertyNames().size() > 0); } @Test public void testInstallProperties() throws ConfigurationException { DeploymentConfiguration config = new DeploymentConfiguration(); config.load(); Properties target = new Properties(); config.copyTo(target); assertTrue(target.size() != 0); } @Test public void testPersistedComments() throws ConfigurationException, IOException { final File f = File.createTempFile("proeprties", "withComments"); f.deleteOnExit(); FileUtils.saveFile("#commented1=val1\nproeprty2=val2\n#commented3=val3\nproeprty4=val4", f); DeploymentConfiguration dc = new DeploymentConfiguration(new InfrastructureFileDescriptor(){ @Override public String getFullPath() { return f.getAbsolutePath(); } }); dc.load(); Assert.assertEquals("val2", dc.getProperty("proeprty2")); Assert.assertEquals("val4", dc.getProperty("proeprty4")); Assert.assertEquals(null, dc.getProperty("commented1")); Assert.assertEquals(null, dc.getProperty("commented3")); dc.save(); String s = FileUtils.loadFileAsString(f); Assert.assertTrue(s.contains("#"+DeploymentConfiguration.DEPLOYMENT_COMMENT)); String date = new Date().toString().substring(0, 10); //every propertiews file have header and date by default Assert.assertTrue(s.contains("#"+date)); //check day part of date... Assert.assertTrue(s.contains("#commented1")); Assert.assertTrue(s.contains("proeprty2")); Assert.assertTrue(s.contains("#commented3")); Assert.assertTrue(s.contains("proeprty4")); Assert.assertTrue(s.contains("val1")); Assert.assertTrue(s.contains("val2")); Assert.assertTrue(s.contains("val3")); Assert.assertTrue(s.contains("val4")); } @Test public void testEnsurePersistedCommentsDoNotMultiplyHeaderAndDate() throws ConfigurationException, IOException { final File f = File.createTempFile("proeprties", "withComments"); f.deleteOnExit(); FileUtils.saveFile("#commented1=val1\nproeprty2=val2\n#commented3=val3\nproeprty4=val4", f); DeploymentConfiguration dc = new DeploymentConfiguration(new InfrastructureFileDescriptor() { @Override public String getFullPath() { return f.getAbsolutePath(); } }); String s = null; for (int x = 0; x < 10; x++) { dc.load(); Assert.assertEquals("val2", dc.getProperty("proeprty2")); Assert.assertEquals("val4", dc.getProperty("proeprty4")); Assert.assertEquals(null, dc.getProperty("commented1")); Assert.assertEquals(null, dc.getProperty("commented3")); dc.save(); s = FileUtils.loadFileAsString(f); for (int y = 0; x < x; x++) { //ensure salt Assert.assertTrue(s.contains("#id" + y + "id")); } Assert.assertEquals(1, PluginBridgeTest.countOccurences(s, DeploymentConfiguration.DEPLOYMENT_COMMENT)); String date = new Date().toString().substring(0, 10); //every propertiews file have header and date by default Assert.assertEquals(1, PluginBridgeTest.countOccurences(s, date)); //check day part of date... Assert.assertEquals(1, PluginBridgeTest.countOccurences(s, "#commented1")); Assert.assertEquals(1, PluginBridgeTest.countOccurences(s, "proeprty2")); Assert.assertEquals(1, PluginBridgeTest.countOccurences(s, "#commented3")); Assert.assertEquals(1, PluginBridgeTest.countOccurences(s, "proeprty4")); Assert.assertEquals(1, PluginBridgeTest.countOccurences(s, "val1")); Assert.assertEquals(1, PluginBridgeTest.countOccurences(s, "val2")); Assert.assertEquals(1, PluginBridgeTest.countOccurences(s, "val3")); Assert.assertEquals(1, PluginBridgeTest.countOccurences(s, "val4")); //insert some salt to check if it really iterates FileUtils.saveFile(s + "\n#id" + x + "id", f); } //System.out.println(s); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/config/PaxHeaders.17941/BasicValueValidatorsT0000644000000000000000000000013212654402377030203 xustar0030 mtime=1454507263.292431847 30 atime=1454507327.196579577 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/config/BasicValueValidatorsTests.java0000644000175000002070000001462312654402377032553 0ustar00jvanekmock00000000000000/* Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.config; import org.junit.Assert; import org.junit.Test; public class BasicValueValidatorsTests { //decomposed for testing public static boolean canBeWindows(String s) { return s.toLowerCase().contains("windows"); } /** * guess the OS of user, if legal, or windows * @return */ public static boolean isOsWindows() { return canBeWindows(System.getProperty("os.name")); } private static final BasicValueValidators.FilePathValidator pv = new BasicValueValidators.FilePathValidator(); private final String neverLegal = "aaa/bb/cc"; private final String winLegal = "C:\\aaa\\bb\\cc"; private final String linuxLegal = "/aaa/bb/cc"; @Test public void testWindowsDetction() { Assert.assertTrue(canBeWindows("blah windows blah")); Assert.assertTrue(canBeWindows("blah Windows blah")); Assert.assertTrue(canBeWindows(" WINDOWS 7")); Assert.assertFalse(canBeWindows("blah windy miracle blah")); Assert.assertFalse(canBeWindows("blah wind blah")); Assert.assertTrue(canBeWindows("windows")); Assert.assertFalse(canBeWindows("linux")); Assert.assertFalse(canBeWindows("blah mac blah")); Assert.assertFalse(canBeWindows("blah solaris blah")); } @Test public void testLinuxAbsoluteFilePathValidator() { if (!isOsWindows()) { Exception ex = null; try { pv.validate(linuxLegal); } catch (Exception eex) { ex = eex; } Assert.assertTrue(ex == null); ex = null; try { pv.validate(neverLegal); } catch (Exception eex) { ex = eex; } Assert.assertTrue(ex instanceof IllegalArgumentException); ex = null; try { pv.validate(winLegal); } catch (Exception eex) { ex = eex; } Assert.assertTrue(ex instanceof IllegalArgumentException); } } @Test public void testWindowsAbsoluteFilePathValidator() { if (isOsWindows()) { Exception ex = null; try { pv.validate(winLegal); } catch (Exception eex) { ex = eex; } Assert.assertTrue(ex == null); ex = null; try { pv.validate(neverLegal); } catch (Exception eex) { ex = eex; } Assert.assertTrue(ex instanceof IllegalArgumentException); ex = null; try { pv.validate(linuxLegal); } catch (Exception eex) { ex = eex; } Assert.assertTrue(ex instanceof IllegalArgumentException); } } @Test public void testMultipleStringValueValidator() { String[] singleValues = { "SINGLE", "ONLY", "NONE" }; String[] multipleValues = { "MULTIPLE", "COMBO", "ONE", "TWO", "THREE" }; ValueValidator multipleValidator = BasicValueValidators.getMultipleStringValidator(singleValues, multipleValues); multipleValidator.validate("SINGLE"); multipleValidator.validate("ONLY"); multipleValidator.validate("NONE"); multipleValidator.validate("MULTIPLE"); multipleValidator.validate("MULTIPLE,COMBO,TWO"); multipleValidator.validate("THREE,ONE,COMBO,MULTIPLE"); } @Test(expected = IllegalArgumentException.class) public void testMultipleStringValueValidatorCantMixSingleAndComboValues() { String[] singleValues = { "SINGLE", "ONLY", "NONE" }; String[] multipleValues = { "MULTIPLE", "COMBO", "ONE", "TWO", "THREE" }; ValueValidator multipleValidator = BasicValueValidators.getMultipleStringValidator(singleValues, multipleValues); multipleValidator.validate("SINGLE,COMBO"); } @Test public void testManifestAttributeCheckValidator() { ValueValidator multipleValidator = BasicValueValidators.getManifestAttributeCheckValidator(); multipleValidator.validate("ALL"); multipleValidator.validate("PERMISSIONS"); multipleValidator.validate("NONE"); multipleValidator.validate("ALAC"); multipleValidator.validate("CODEBASE"); multipleValidator.validate("CODEBASE,ALAC,PERMISSIONS"); multipleValidator.validate("TRUSTED,ALAC,CODEBASE"); } @Test(expected = IllegalArgumentException.class) public void testManifestAttributeCheckValidatorCantMixSingleAndComboValues() { ValueValidator multipleValidator = BasicValueValidators.getManifestAttributeCheckValidator(); multipleValidator.validate("ALL,CODEBASE,NONE"); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.17941/cache0000644000000000000000000000013212654402377023606 xustar0030 mtime=1454507263.292431847 30 atime=1454507658.776157397 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/cache/0000755000175000002070000000000012654402377024406 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/cache/PaxHeaders.17941/ResourceUrlCreatorTest0000644000000000000000000000013212654402377030240 xustar0030 mtime=1454507263.292431847 30 atime=1454507327.196579577 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/cache/ResourceUrlCreatorTest.java0000644000175000002070000001654312654402377031714 0ustar00jvanekmock00000000000000package net.sourceforge.jnlp.cache; import static org.junit.Assert.assertEquals; import java.net.MalformedURLException; import java.net.URL; import net.sourceforge.jnlp.DownloadOptions; import net.sourceforge.jnlp.Version; import net.sourceforge.jnlp.util.logging.NoStdOutErrTest; import org.junit.Test; public class ResourceUrlCreatorTest extends NoStdOutErrTest{ private static final Version VERSION_11 = new Version("1.1"); private static final Version VERSION_20 = new Version("2.0"); private static final Version VERSION_TWO = new Version("version two"); private static final DownloadOptions DLOPTS_NOPACK_USEVERSION = new DownloadOptions(false, true); private static final DownloadOptions DLOPTS_NOPACK_NOVERSION = new DownloadOptions(false, false); private URL getResultUrl(String url, Version version, boolean usePack /*use pack.gz suffix*/, boolean useVersion /*use version suffix*/) throws MalformedURLException { Resource resource = Resource.getResource(new URL(url), version, null); return ResourceUrlCreator.getUrl(resource, usePack, useVersion); } private URL getResultUrl(String url, Version version, DownloadOptions downloadOptions) throws MalformedURLException { Resource resource = Resource.getResource(new URL(url), version, null); ResourceUrlCreator ruc = new ResourceUrlCreator(resource, downloadOptions); return ruc.getVersionedUrl(); } @Test public void testVersionEncode() throws MalformedURLException { URL result = getResultUrl("http://example.com/versionEncode.jar", VERSION_11, false, true); assertEquals("http://example.com/versionEncode__V1.1.jar", result.toString()); } @Test public void testVersionWithPeriods() throws MalformedURLException { URL result = getResultUrl("http://example.com/test.version.with.periods.jar", VERSION_11, false, true); // A previous bug had this as "test__V1.1.with.periods.jar" assertEquals("http://example.com/test.version.with.periods__V1.1.jar", result.toString()); } @Test public void testPackEncode() throws MalformedURLException { URL result = getResultUrl("http://example.com/packEncode.jar", VERSION_11, true, false); assertEquals("http://example.com/packEncode.jar.pack.gz", result.toString()); } @Test public void testVersionAndPackEncode() throws MalformedURLException { URL result = getResultUrl("http://example.com/versionAndPackEncode.jar", VERSION_11, true, true); assertEquals("http://example.com/versionAndPackEncode__V1.1.jar.pack.gz", result.toString()); } @Test public void testGetVersionedUrl() throws MalformedURLException { URL result = getResultUrl("http://example.com/versionedUrl.jar", VERSION_11, DLOPTS_NOPACK_USEVERSION); assertEquals("http://example.com/versionedUrl.jar?version-id=1.1", result.toString()); } @Test public void testGetNonVersionIdUrl() throws MalformedURLException { URL result = getResultUrl("http://example.com/nonVersionIdUrl.jar", VERSION_TWO, DLOPTS_NOPACK_USEVERSION); assertEquals("http://example.com/nonVersionIdUrl.jar", result.toString()); } @Test public void testGetVersionedUrlWithQuery() throws MalformedURLException { URL result = getResultUrl("http://example.com/versionedUrlWithQuery.jar?i=1234abcd", VERSION_11, DLOPTS_NOPACK_USEVERSION); assertEquals("http://example.com/versionedUrlWithQuery.jar?i=1234abcd&version-id=1.1", result.toString()); } @Test public void testGetVersionedUrlWithoutVersion() throws MalformedURLException { URL result = getResultUrl("http://example.com/versionedUrlWithoutVersion.jar", null, DLOPTS_NOPACK_NOVERSION); assertEquals("http://example.com/versionedUrlWithoutVersion.jar", result.toString()); } @Test public void testGetVersionedUrlWithoutVersionWithQuery() throws MalformedURLException { URL result = getResultUrl("http://example.com/versionedUrlWithoutVersionWithQuery.jar?i=1234abcd", null, DLOPTS_NOPACK_NOVERSION); assertEquals("http://example.com/versionedUrlWithoutVersionWithQuery.jar?i=1234abcd", result.toString()); } @Test public void testGetVersionedUrlWithLongQuery() throws MalformedURLException { URL result = getResultUrl("http://example.com/versionedUrlWithLongQuery.jar?i=1234&j=abcd", VERSION_20, DLOPTS_NOPACK_USEVERSION); assertEquals("http://example.com/versionedUrlWithLongQuery.jar?i=1234&j=abcd&version-id=2.0", result.toString()); } @Test public void testPercentEncoded() throws MalformedURLException { URL result = getResultUrl("http://example.com/percent encoded.jar", null, DLOPTS_NOPACK_USEVERSION); assertEquals("http://example.com/percent encoded.jar", result.toString()); } @Test public void testPercentEncodedOnlyOnce() throws MalformedURLException { URL result = getResultUrl("http://example.com/percent%20encoded%20once.jar", null, DLOPTS_NOPACK_USEVERSION); assertEquals("http://example.com/percent%20encoded%20once.jar", result.toString()); } @Test public void testPartiallyEncodedUrl() throws MalformedURLException { URL result = getResultUrl("http://example.com/partially encoded%20url.jar", null, DLOPTS_NOPACK_USEVERSION); assertEquals("http://example.com/partially encoded%20url.jar", result.toString()); } @Test public void testVersionedEncodedUrl() throws MalformedURLException { URL result = getResultUrl("http://example.com/versioned%20encoded.jar", VERSION_11, DLOPTS_NOPACK_USEVERSION); assertEquals("http://example.com/versioned%20encoded.jar?version-id=1.1", result.toString()); } @Test public void testInvalidVersionedUrl() throws MalformedURLException { URL result = getResultUrl("http://example.com/invalid versioned url.jar", VERSION_11, DLOPTS_NOPACK_USEVERSION); assertEquals("http://example.com/invalid versioned url.jar?version-id=1.1", result.toString()); } @Test public void testLongComplexUrl() throws MalformedURLException { String URL = "https://example.com/,DSID=64c19c5b657df383835706571a7c7216,DanaInfo=example.com,CT=java+JICAComponents/complexOne.jar"; URL result = getResultUrl(URL, null, DLOPTS_NOPACK_USEVERSION); assertEquals(URL, result.toString()); } @Test public void testLongComplexVersionedUrl() throws MalformedURLException { String URL = "https://example.com/,DSID=64c19c5b657df383835706571a7c7216,DanaInfo=example.com,CT=java+JICAComponents/complexTwo.jar"; URL result = getResultUrl(URL, VERSION_11, DLOPTS_NOPACK_USEVERSION); assertEquals(URL + "?version-id=" + VERSION_11, result.toString()); } @Test public void testUserInfoAndVersioning() throws MalformedURLException { URL result = getResultUrl("http://foo:bar@example.com/userInfoAndVersion.jar", VERSION_11, DLOPTS_NOPACK_USEVERSION); assertEquals("http://foo:bar@example.com/userInfoAndVersion.jar?version-id=1.1", result.toString()); } @Test public void testPortAndVersioning() throws MalformedURLException { URL result = getResultUrl("http://example.com:1234/portAndVersioning.jar", VERSION_11, DLOPTS_NOPACK_USEVERSION); assertEquals("http://example.com:1234/portAndVersioning.jar?version-id=1.1", result.toString()); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/cache/PaxHeaders.17941/ResourceTrackerTest.ja0000644000000000000000000000013112654402377030141 xustar0030 mtime=1454507263.292431847 29 atime=1454507327.19557959 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/cache/ResourceTrackerTest.java0000644000175000002070000002600712654402377031221 0ustar00jvanekmock00000000000000/* ResourceTrackerTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.cache; import static net.sourceforge.jnlp.cache.Resource.Status.CONNECTED; import static net.sourceforge.jnlp.cache.Resource.Status.DOWNLOADING; import static net.sourceforge.jnlp.cache.Resource.Status.ERROR; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.IOException; import java.io.PrintStream; import java.io.UnsupportedEncodingException; import java.net.MalformedURLException; import java.net.URISyntaxException; import java.net.URL; import java.nio.file.Files; import java.util.Arrays; import java.util.EnumSet; import java.util.List; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.ServerLauncher; import net.sourceforge.jnlp.Version; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.config.PathsAndFiles; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.util.UrlUtils; import net.sourceforge.jnlp.util.logging.NoStdOutErrTest; import net.sourceforge.jnlp.util.logging.OutputController; public class ResourceTrackerTest extends NoStdOutErrTest{ public static ServerLauncher downloadServer; private static final PrintStream[] backedUpStream = new PrintStream[4]; private static ByteArrayOutputStream currentErrorStream; private static Resource createResource(final String name) throws MalformedURLException { return Resource.getResource(new URL("http://example.com/" + name + ".jar"), new Version("1.0"), UpdatePolicy.ALWAYS); } @Test public void testSelectByStatusOneMatchingResource() throws Exception { Resource resource = createResource("oneMatchingResource"); Assert.assertNotNull(resource); resource.setStatusFlag(DOWNLOADING); List resources = Arrays.asList(resource); Resource result = ResourceTracker.selectByStatus(resources, DOWNLOADING, ERROR); Assert.assertEquals(resource, result); } @Test public void testSelectByStatusNoMatchingResource() throws Exception { Resource resource = createResource("noMatchingResource"); Assert.assertNotNull(resource); List resources = Arrays.asList(resource); Resource result = ResourceTracker.selectByStatus(resources, DOWNLOADING, ERROR); Assert.assertNull(result); } @Test public void testSelectByStatusExcludedResources() throws Exception { Resource resource = createResource("excludedResources"); Assert.assertNotNull(resource); resource.setStatusFlag(ERROR); List resources = Arrays.asList(resource); Resource result = ResourceTracker.selectByStatus(resources, DOWNLOADING, ERROR); Assert.assertNull(result); } @Test public void testSelectByStatusMixedResources() throws Exception { Resource r1 = createResource("mixedResources1"); Assert.assertNotNull(r1); r1.setStatusFlag(CONNECTED); r1.setStatusFlag(DOWNLOADING); Resource r2 = createResource("mixedResources2"); Assert.assertNotNull(r2); r2.setStatusFlag(CONNECTED); r2.setStatusFlag(DOWNLOADING); r2.setStatusFlag(ERROR); List resources = Arrays.asList(r1, r2); Resource result = ResourceTracker.selectByStatus(resources, EnumSet.of(CONNECTED, DOWNLOADING), EnumSet.of(ERROR)); Assert.assertEquals(r1, result); } @Test public void testSelectByFilterUninitialized() throws Exception { Resource resource = createResource("filterUninitialized"); Assert.assertNotNull(resource); List resources = Arrays.asList(resource); Resource result = ResourceTracker.selectByFilter(resources, new ResourceTracker.Filter() { @Override public boolean test(Resource t) { return !t.isInitialized(); } }); Assert.assertEquals(resource, result); } @Test public void testNormalizeUrl() throws Exception { URL[] u = getUrls(); URL[] n = getNormalizedUrls(); Assert.assertNull("first url should be null", u[0]); Assert.assertNull("first normalized url should be null", n[0]); for (int i = 1; i < CHANGE_BORDER; i++) { Assert.assertTrue("url " + i + " must be equals too normalized url " + i, u[i].equals(n[i])); } for (int i = CHANGE_BORDER; i < n.length; i++) { Assert.assertFalse("url " + i + " must be normalized (and so not equals) too normalized url " + i, u[i].equals(n[i])); } } public static final int CHANGE_BORDER = 8; public static URL[] getUrls() throws MalformedURLException { URL[] u = { /*constant*/ null, new URL("file:///home/jvanek/Desktop/icedtea-web/tests.build/jnlp_test_server/Spaces%20can%20be%20everywhere2.jnlp"), new URL("http://localhost:44321/SpacesCanBeEverywhere1.jnlp"), new URL("http:///SpacesCanBeEverywhere1.jnlp"), new URL("file://localhost/home/jvanek/Desktop/icedtea-web/tests.build/jnlp_test_server/Spaces can be everywhere2.jnlp"), new URL("http://localhost:44321/testpage.jnlp?applicationID=25"), new URL("http://localhost:44321/Spaces%20Can%20Be%20Everyw%2Fhere1.jnlp"), new URL("http://localhost/Spaces+Can+Be+Everywhere1.jnlp"), /*changing*/ new URL("http://localhost/SpacesC anBeEverywhere1.jnlp?a=5&b=10#df"), new URL("http:///oook.jnlp?a=5&b=ahoj šš dd#df"), new URL("http://localhost/Spacesěčšžšřýžčřú can !@^*(){}[].jnlp?a=5&ahoj šš dd#df"), new URL("http://localhost:44321/SpaŠcesCan Be Everywhere1.jnlp"), new URL("http:/SpacesCanB eEverywhere1.jnlp")}; return u; } public static URL[] getNormalizedUrls() throws MalformedURLException, UnsupportedEncodingException, URISyntaxException { URL[] u = getUrls(); URL[] n = new URL[u.length]; for (int i = 0; i < n.length; i++) { n[i] = UrlUtils.normalizeUrl(u[i]); } return n; } @BeforeClass //keeping silent outputs from launched jvm public static void redirectErr() throws IOException { for (int i = 0; i < backedUpStream.length; i++) { if (backedUpStream[i] == null) { switch (i) { case 0: backedUpStream[i] = System.out; break; case 1: backedUpStream[i] = System.err; break; case 2: backedUpStream[i] = OutputController.getLogger().getOut(); break; case 3: backedUpStream[i] = OutputController.getLogger().getErr(); break; } } } currentErrorStream = new ByteArrayOutputStream(); System.setOut(new PrintStream(currentErrorStream)); System.setErr(new PrintStream(currentErrorStream)); OutputController.getLogger().setOut(new PrintStream(currentErrorStream)); OutputController.getLogger().setErr(new PrintStream(currentErrorStream)); } @AfterClass public static void redirectErrBack() throws IOException { ServerAccess.logErrorReprint(currentErrorStream.toString("utf-8")); System.setOut(backedUpStream[0]); System.setErr(backedUpStream[1]); OutputController.getLogger().setOut(backedUpStream[2]); OutputController.getLogger().setErr(backedUpStream[3]); } @BeforeClass public static void onDebug() { JNLPRuntime.setDebug(true); } @AfterClass public static void offDebug() { JNLPRuntime.setDebug(false); } private static String cacheDir; @BeforeClass public static void setupDownloadServer() throws IOException { File dir = new File(System.getProperty("java.io.tmpdir"), "itw-down"); dir.mkdirs(); dir.deleteOnExit(); redirectErr(); downloadServer = ServerAccess.getIndependentInstance(dir.getAbsolutePath(), ServerAccess.findFreePort()); redirectErrBack(); cacheDir = PathsAndFiles.CACHE_DIR.getFullPath(); PathsAndFiles.CACHE_DIR.setValue(System.getProperty("java.io.tmpdir") + File.separator + "tempcache"); } @AfterClass public static void teardownDownloadServer() { downloadServer.stop(); CacheUtil.clearCache(); PathsAndFiles.CACHE_DIR.setValue(cacheDir); } @Test public void testDownloadResource() throws IOException { String s = "hello"; File f = downloadServer.getDir(); File temp = new File(f, "resource"); temp.createNewFile(); Files.write(temp.toPath(), s.getBytes()); temp.deleteOnExit(); URL url = downloadServer.getUrl("resource"); ResourceTracker rt = new ResourceTracker(); rt.addResource(url, null, null, UpdatePolicy.FORCE); File downloadFile = rt.getCacheFile(url); assertTrue(downloadFile.exists() && downloadFile.isFile()); String output = new String(Files.readAllBytes(downloadFile.toPath())); assertEquals(s, output); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/cache/PaxHeaders.17941/ResourceTest.java0000644000000000000000000000013112654402377027154 xustar0030 mtime=1454507263.291431861 29 atime=1454507327.19557959 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/cache/ResourceTest.java0000644000175000002070000002142712654402377027706 0ustar00jvanekmock00000000000000/* ResourceTest.java Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.cache; import static net.sourceforge.jnlp.cache.Resource.Status.PRECONNECT; import static net.sourceforge.jnlp.cache.Resource.Status.CONNECTED; import static net.sourceforge.jnlp.cache.Resource.Status.CONNECTING; import static net.sourceforge.jnlp.cache.Resource.Status.PREDOWNLOAD; import static net.sourceforge.jnlp.cache.Resource.Status.DOWNLOADED; import static net.sourceforge.jnlp.cache.Resource.Status.DOWNLOADING; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import java.net.MalformedURLException; import java.net.URL; import java.util.Collection; import java.util.EnumSet; import java.util.Set; import net.sourceforge.jnlp.Version; import org.junit.Test; public class ResourceTest { public static final long INCREMENT_TRANSFERRED_CONSTANT = 10; @Test public void testGetLocation() throws Exception { String testName = "GetLocation"; Resource res = createResource(testName); URL location = res.getLocation(); URL sameUrl = new URL("http://example.com/applet" + testName + ".jar"); assertEquals("Locations should match each other", sameUrl, location); } @Test public void testGetRequestVersion() throws Exception { String testName = "GetRequestVersion"; Resource res = createResource(testName); Version dummyVersion = new Version("1.0"); Version getVersion = res.getRequestVersion(); assertTrue("Versions should match each other.", dummyVersion.matches(getVersion)); } @Test public void testGetDownloadVersion() throws Exception { String testName = "GetDownloadVersion"; Resource res = createResource(testName); Version dummyVersion = new Version("1.0"); res.setDownloadVersion(dummyVersion); Version getVersion = res.getDownloadVersion(); assertTrue("Set version should match other.", getVersion.matches(dummyVersion)); } @Test public void testTransferredIsZero() throws Exception { String testName = "TransferredIsZero"; Resource res = createResource(testName); assertEquals(0, res.getTransferred()); } @Test public void testIncrementTransferred() throws Exception { String testName = "IncrementTransferred"; Resource res = createResource(testName); long original = res.getTransferred(); res.incrementTransferred(INCREMENT_TRANSFERRED_CONSTANT); assertEquals(original + INCREMENT_TRANSFERRED_CONSTANT, res.getTransferred()); } @Test public void testSizeIsNegativeOne() throws Exception { String testName = "SizeIsNegativeOne"; Resource res = createResource(testName); assertEquals(-1, res.getSize()); } @Test public void testSetSize() throws Exception { String testName = "SetSize"; Resource res = createResource(testName); long original = res.getSize(); res.setSize(original + 10); assertEquals(original + 10,res.getSize()); } @Test public void testStatusIsCopied() throws Exception { String testName = "testStatus"; Resource res = createResource(testName); Set original = res.getCopyOfStatus(); assertTrue("Original should be emtpy", original.isEmpty()); original.add(DOWNLOADING); Set dummy = res.getCopyOfStatus(); assertFalse(dummy.equals(original)); assertFalse(dummy.contains(DOWNLOADING)); } @Test public void testNewResourceIsUninitialized() throws Exception { Resource res = createResource("NewResource"); assertTrue("Resource should not have had any status flags set", isUninitialized(res)); } @Test public void testSetFlag() throws Exception { Resource res = createResource("SetFlag"); setStatus(res, EnumSet.of(PRECONNECT)); assertFalse("Resource should have been initialized", isUninitialized(res)); assertTrue("Resource should have had PRECONNECT set", hasFlag(res, PRECONNECT)); assertTrue("Resource should have only had PRECONNECT set", hasOnly(res, EnumSet.of(PRECONNECT))); } @Test public void testSetMultipleFlags() throws Exception { Resource res = createResource("SetFlags"); setStatus(res, EnumSet.of(PRECONNECT, PREDOWNLOAD)); assertFalse("Resource should have been initialized", isUninitialized(res)); assertTrue("Resource should have had PRECONNECT set", hasFlag(res, PRECONNECT)); assertTrue("Resource should have had PREDOWNLOAD set", hasFlag(res, PREDOWNLOAD)); assertTrue("Resource should have only had PRECONNECT and PREDOWNLOAD set", hasOnly(res, EnumSet.of(PRECONNECT, PREDOWNLOAD))); } @Test public void testChangeStatus() throws Exception { Resource res = createResource("ChangeStatus"); setStatus(res, EnumSet.of(PRECONNECT)); assertTrue("Resource should have had PRECONNECT set", hasFlag(res, PRECONNECT)); assertTrue("Resource should have only had PRECONNECT set", hasOnly(res, EnumSet.of(PRECONNECT))); Collection downloadFlags = EnumSet.of(PREDOWNLOAD, DOWNLOADING, DOWNLOADED); Collection connectFlags = EnumSet.of(PRECONNECT, CONNECTING, CONNECTED); changeStatus(res, connectFlags, downloadFlags); assertTrue("Resource should have had PREDOWNLOAD set", hasFlag(res, PREDOWNLOAD)); assertTrue("Resource should have had DOWNLOADING set", hasFlag(res, DOWNLOADING)); assertTrue("Resource should have had DOWNLOADED set", hasFlag(res, DOWNLOADED)); assertTrue("Resource should have only had PREDOWNLOAD{,ING,ED} flags set", hasOnly(res, downloadFlags)); assertFalse("Resource should not have had PRECONNECT set", hasFlag(res, PRECONNECT)); } private static Resource createResource(String testName) throws MalformedURLException { URL dummyUrl = new URL("http://example.com/applet" + testName + ".jar"); return Resource.getResource(dummyUrl, new Version("1.0"), UpdatePolicy.ALWAYS); } private static void setStatus(Resource resource, Collection flags) { resource.setStatusFlags(flags); } private static void changeStatus(Resource resource, Collection clear, Collection add) { resource.changeStatus(clear, add); } private static boolean hasOnly(Resource resource, Collection flags) { for (final Resource.Status flag : flags) { // ensure all the specified flags are set if (!resource.isSet(flag)) { return false; } } for (final Resource.Status flag : Resource.Status.values()) { // ensure all other flags are unset if (resource.isSet(flag) && !flags.contains(flag)) { return false; } } return true; } private static boolean hasFlag(Resource resource, Resource.Status flag) { return resource.isSet(flag); } private static boolean isUninitialized(Resource resource) { return !resource.isInitialized(); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/cache/PaxHeaders.17941/ResourceDownloaderTest0000644000000000000000000000013112654402377030253 xustar0030 mtime=1454507263.291431861 29 atime=1454507327.19557959 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/cache/ResourceDownloaderTest.java0000644000175000002070000004643212654402377031730 0ustar00jvanekmock00000000000000package net.sourceforge.jnlp.cache; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.PrintStream; import java.net.HttpURLConnection; import java.net.URL; import java.nio.file.Files; import java.util.EnumSet; import java.util.HashMap; import java.util.jar.Attributes; import java.util.jar.JarOutputStream; import java.util.jar.Manifest; import java.util.jar.Pack200; import java.util.zip.GZIPOutputStream; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; import net.sourceforge.jnlp.DownloadOptions; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.ServerLauncher; import net.sourceforge.jnlp.Version; import net.sourceforge.jnlp.config.PathsAndFiles; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.util.JarFile; import net.sourceforge.jnlp.util.logging.NoStdOutErrTest; import net.sourceforge.jnlp.util.logging.OutputController; public class ResourceDownloaderTest extends NoStdOutErrTest { public static ServerLauncher testServer; public static ServerLauncher testServerWithBrokenHead; public static ServerLauncher downloadServer; private static final PrintStream[] backedUpStream = new PrintStream[4]; private static ByteArrayOutputStream currentErrorStream; private static final String nameStub1 = "itw-server"; private static final String nameStub2 = "test-file"; private static String cacheDir; @BeforeClass //keeping silent outputs from launched jvm public static void redirectErr() throws IOException { for (int i = 0; i < backedUpStream.length; i++) { if (backedUpStream[i] == null) { switch (i) { case 0: backedUpStream[i] = System.out; break; case 1: backedUpStream[i] = System.err; break; case 2: backedUpStream[i] = OutputController.getLogger().getOut(); break; case 3: backedUpStream[i] = OutputController.getLogger().getErr(); break; } } } currentErrorStream = new ByteArrayOutputStream(); System.setOut(new PrintStream(currentErrorStream)); System.setErr(new PrintStream(currentErrorStream)); OutputController.getLogger().setOut(new PrintStream(currentErrorStream)); OutputController.getLogger().setErr(new PrintStream(currentErrorStream)); } @AfterClass public static void redirectErrBack() throws IOException { ServerAccess.logErrorReprint(currentErrorStream.toString("utf-8")); System.setOut(backedUpStream[0]); System.setErr(backedUpStream[1]); OutputController.getLogger().setOut(backedUpStream[2]); OutputController.getLogger().setErr(backedUpStream[3]); } @BeforeClass public static void onDebug() { JNLPRuntime.setDebug(true); } @AfterClass public static void offDebug() { JNLPRuntime.setDebug(false); } @BeforeClass public static void startServer() throws Exception { redirectErr(); testServer = ServerAccess.getIndependentInstance(System.getProperty("java.io.tmpdir"), ServerAccess.findFreePort()); redirectErrBack(); } @BeforeClass public static void startServer2() throws Exception { redirectErr(); testServerWithBrokenHead = ServerAccess.getIndependentInstance(System.getProperty("java.io.tmpdir"), ServerAccess.findFreePort()); testServerWithBrokenHead.setSupportingHeadRequest(false); redirectErrBack(); } @AfterClass public static void stopServer() { testServer.stop(); } @AfterClass public static void stopServer2() { testServerWithBrokenHead.stop(); } @Test public void getUrlResponseCodeTestWorkingHeadRequest() throws Exception { 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); f.delete(); i = ResourceDownloader.getUrlResponseCode(testServer.getUrl(f.getName()), new HashMap(), ResourceTracker.RequestMethods.HEAD); Assert.assertEquals(HttpURLConnection.HTTP_NOT_FOUND, i); } finally { redirectErrBack(); } } @Test public void getUrlResponseCodeTestNotWorkingHeadRequest() throws Exception { redirectErr(); try { File f = File.createTempFile(nameStub1, nameStub2); int i = ResourceDownloader.getUrlResponseCode(testServerWithBrokenHead.getUrl(f.getName()), new HashMap(), ResourceTracker.RequestMethods.HEAD); Assert.assertEquals(HttpURLConnection.HTTP_NOT_IMPLEMENTED, i); f.delete(); i = ResourceDownloader.getUrlResponseCode(testServerWithBrokenHead.getUrl(f.getName()), new HashMap(), ResourceTracker.RequestMethods.HEAD); Assert.assertEquals(HttpURLConnection.HTTP_NOT_IMPLEMENTED, i); } finally { redirectErrBack(); } } @Test public void getUrlResponseCodeTestGetRequestOnNotWorkingHeadRequest() throws Exception { redirectErr(); try { File f = File.createTempFile(nameStub1, nameStub2); int i = ResourceDownloader.getUrlResponseCode(testServerWithBrokenHead.getUrl(f.getName()), new HashMap(), ResourceTracker.RequestMethods.GET); Assert.assertEquals(HttpURLConnection.HTTP_OK, i); f.delete(); i = ResourceDownloader.getUrlResponseCode(testServerWithBrokenHead.getUrl(f.getName()), new HashMap(), ResourceTracker.RequestMethods.GET); Assert.assertEquals(HttpURLConnection.HTTP_NOT_FOUND, i); } finally { redirectErrBack(); } } @Test public void getUrlResponseCodeTestGetRequest() throws Exception { redirectErr(); try { File f = File.createTempFile(nameStub1, nameStub2); int i = ResourceDownloader.getUrlResponseCode(testServer.getUrl(f.getName()), new HashMap(), ResourceTracker.RequestMethods.GET); Assert.assertEquals(HttpURLConnection.HTTP_OK, i); f.delete(); i = ResourceDownloader.getUrlResponseCode(testServer.getUrl(f.getName()), new HashMap(), ResourceTracker.RequestMethods.GET); Assert.assertEquals(HttpURLConnection.HTTP_NOT_FOUND, i); } finally { redirectErrBack(); } } @Test public void getUrlResponseCodeTestWrongRequest() throws Exception { redirectErr(); try { File f = File.createTempFile(nameStub1, nameStub2); Exception exception = null; try { ResourceDownloader.getUrlResponseCode(testServer.getUrl(f.getName()), new HashMap(), ResourceTracker.RequestMethods.TESTING_UNDEF); } catch (Exception ex) { exception = ex; } Assert.assertNotNull(exception); exception = null; f.delete(); try { ResourceDownloader.getUrlResponseCode(testServer.getUrl(f.getName()), new HashMap(), ResourceTracker.RequestMethods.TESTING_UNDEF); } catch (Exception ex) { exception = ex; } Assert.assertNotNull(exception);; } finally { redirectErrBack(); } } @Test public void findBestUrltest() throws Exception { redirectErr(); try { File fileForServerWithHeader = File.createTempFile(nameStub1, nameStub2); File versionedFileForServerWithHeader = new File(fileForServerWithHeader.getParentFile(), fileForServerWithHeader.getName() + "-2.0"); versionedFileForServerWithHeader.createNewFile(); File fileForServerWithoutHeader = File.createTempFile(nameStub1, nameStub2); File versionedFileForServerWithoutHeader = new File(fileForServerWithoutHeader.getParentFile(), fileForServerWithoutHeader.getName() + "-2.0"); versionedFileForServerWithoutHeader.createNewFile(); ResourceDownloader resourceDownloader = new ResourceDownloader(null, null); Resource r1 = Resource.getResource(testServer.getUrl(fileForServerWithHeader.getName()), null, UpdatePolicy.NEVER); 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).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).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).URL); assertVersionedOneOnServerWithoutHeader(resourceDownloader.findBestUrl(r4).URL); versionedFileForServerWithoutHeader.delete(); Assert.assertNull(resourceDownloader.findBestUrl(r1)); Assert.assertNull(resourceDownloader.findBestUrl(r3)); assertOnServerWithoutHeader(resourceDownloader.findBestUrl(r2).URL); Assert.assertNull(resourceDownloader.findBestUrl(r4)); fileForServerWithoutHeader.delete(); Assert.assertNull(resourceDownloader.findBestUrl(r1)); Assert.assertNull(resourceDownloader.findBestUrl(r3)); Assert.assertNull(resourceDownloader.findBestUrl(r2)); Assert.assertNull(resourceDownloader.findBestUrl(r4)); } finally { redirectErrBack(); } } private void assertOnServerWithoutHeader(URL u) { assertCommonComponentsOfUrl(u); assertPort(u, testServerWithBrokenHead.getPort()); } private void assertVersionedOneOnServerWithoutHeader(URL u) { assertCommonComponentsOfUrl(u); assertPort(u, testServerWithBrokenHead.getPort()); assertVersion(u); } private void assertOnServerWithHeader(URL u) { assertCommonComponentsOfUrl(u); assertPort(u, testServer.getPort()); } private void assertVersionedOneOnServerWithHeader(URL u) { assertCommonComponentsOfUrl(u); assertPort(u, testServer.getPort()); assertVersion(u); } private void assertCommonComponentsOfUrl(URL u) { Assert.assertTrue(u.getProtocol().equals("http")); Assert.assertTrue(u.getHost().equals("localhost")); Assert.assertTrue(u.getPath().contains(nameStub1)); Assert.assertTrue(u.getPath().contains(nameStub2)); ServerAccess.logOutputReprint(u.toExternalForm()); } private void assertPort(URL u, int port) { Assert.assertTrue(u.getPort() == port); } private void assertVersion(URL u) { Assert.assertTrue(u.getPath().contains("-2.0")); Assert.assertTrue(u.getQuery().contains("version-id=1.0")); } @BeforeClass public static void setupCache() throws IOException { File dir = new File(System.getProperty("java.io.tmpdir"), "itw-down"); dir.mkdirs(); dir.deleteOnExit(); redirectErr(); downloadServer = ServerAccess.getIndependentInstance(dir.getAbsolutePath(), ServerAccess.findFreePort()); redirectErrBack(); cacheDir = PathsAndFiles.CACHE_DIR.getFullPath(); PathsAndFiles.CACHE_DIR.setValue(System.getProperty("java.io.tmpdir") + File.separator + "tempcache"); } @AfterClass public static void teardownCache() { downloadServer.stop(); CacheUtil.clearCache(); PathsAndFiles.CACHE_DIR.setValue(cacheDir); } private File setupFile(String fileName, String text) throws IOException { File downloadDir = downloadServer.getDir(); File file = new File(downloadDir, fileName); file.createNewFile(); Files.write(file.toPath(), text.getBytes()); file.deleteOnExit(); return file; } private Resource setupResource(String fileName, String text) throws IOException { File f = setupFile(fileName, text); URL url = downloadServer.getUrl(fileName); Resource resource = Resource.getResource(url, null, UpdatePolicy.NEVER); return resource; } @Test public void testDownloadResource() throws IOException { String expected = "testDownloadResource"; Resource resource = setupResource("download-resource", expected); ResourceDownloader resourceDownloader = new ResourceDownloader(resource, new Object()); resource.setStatusFlag(Resource.Status.PRECONNECT); resourceDownloader.run(); File downloadedFile = resource.getLocalFile(); assertTrue(downloadedFile.exists() && downloadedFile.isFile()); String output = new String(Files.readAllBytes(downloadedFile.toPath())); assertEquals(expected, output); } @Test public void testDownloadPackGzResource() throws IOException { String expected = "1.2"; setupPackGzFile("download-packgz", expected); Resource resource = Resource.getResource(downloadServer.getUrl("download-packgz.jar"), null, UpdatePolicy.NEVER); ResourceDownloader resourceDownloader = new ResourceDownloader(resource, new Object()); resource.setStatusFlag(Resource.Status.PRECONNECT); resource.setDownloadOptions(new DownloadOptions(true, false)); resourceDownloader.run(); File downloadedFile = resource.getLocalFile(); assertTrue(downloadedFile.exists() && downloadedFile.isFile()); JarFile jf = new JarFile(downloadedFile); Manifest m = jf.getManifest(); String actual = (String) m.getMainAttributes().get(Attributes.Name.MANIFEST_VERSION); assertEquals(expected, actual); } @Test public void testDownloadVersionedResource() throws IOException { String expected = "testVersionedResource"; setupFile("download-version__V1.0.jar", expected); URL url = downloadServer.getUrl("download-version.jar"); Resource resource = Resource.getResource(url, new Version("1.0"), UpdatePolicy.NEVER); ResourceDownloader resourceDownloader = new ResourceDownloader(resource, new Object()); resource.setStatusFlag(Resource.Status.PRECONNECT); resource.setDownloadOptions(new DownloadOptions(false, true)); resourceDownloader.run(); File downloadedFile = resource.getLocalFile(); assertTrue(downloadedFile.exists() && downloadedFile.isFile()); String output = new String(Files.readAllBytes(downloadedFile.toPath())); assertEquals(expected, output); } @Test public void testDownloadVersionedPackGzResource() throws IOException { String expected = "1.2"; setupPackGzFile("download-packgz__V1.0", expected); Resource resource = Resource.getResource(downloadServer.getUrl("download-packgz.jar"), new Version("1.0"), UpdatePolicy.NEVER); ResourceDownloader resourceDownloader = new ResourceDownloader(resource, new Object()); resource.setStatusFlag(Resource.Status.PRECONNECT); resource.setDownloadOptions(new DownloadOptions(true, true)); resourceDownloader.run(); File downloadedFile = resource.getLocalFile(); assertTrue(downloadedFile.exists() && downloadedFile.isFile()); JarFile jf = new JarFile(downloadedFile); Manifest m = jf.getManifest(); String actual = (String) m.getMainAttributes().get(Attributes.Name.MANIFEST_VERSION); assertEquals(expected, actual); } @Test public void testDownloadLocalResourceFails() throws IOException { String expected = "local-resource"; File localFile = Files.createTempFile("download-local", ".temp").toFile(); localFile.createNewFile(); Files.write(localFile.toPath(), expected.getBytes()); localFile.deleteOnExit(); String stringURL = "file://" + localFile.getAbsolutePath(); URL url = new URL(stringURL); Resource resource = Resource.getResource(url, null, UpdatePolicy.NEVER); ResourceDownloader resourceDownloader = new ResourceDownloader(resource, new Object()); resource.setStatusFlag(Resource.Status.PRECONNECT); resourceDownloader.run(); assertTrue(resource.hasFlags(EnumSet.of(Resource.Status.ERROR))); } @Test public void testDownloadNotExistingResourceFails() throws IOException { Resource resource = Resource.getResource(new URL(downloadServer.getUrl() + "/notexistingfile"), null, UpdatePolicy.NEVER); ResourceDownloader resourceDownloader = new ResourceDownloader(resource, new Object()); resource.setStatusFlag(Resource.Status.PRECONNECT); resourceDownloader.run(); assertTrue(resource.hasFlags(EnumSet.of(Resource.Status.ERROR))); } private void setupPackGzFile(String fileName, String version) throws IOException { File downloadDir = downloadServer.getDir(); File orig = new File(downloadDir, fileName + ".jar"); orig.deleteOnExit(); Manifest manifest = new Manifest(); manifest.getMainAttributes().put(Attributes.Name.MANIFEST_VERSION, version); JarOutputStream target = new JarOutputStream(new FileOutputStream(orig), manifest); target.close(); File pack = new File(downloadDir, fileName + ".jar.pack"); pack.deleteOnExit(); JarFile jarFile = new JarFile(orig.getAbsolutePath()); FileOutputStream fos = new FileOutputStream(pack); Pack200.Packer p = Pack200.newPacker(); p.pack(jarFile, fos); fos.close(); File packgz = new File(downloadDir, fileName + ".jar.pack.gz"); packgz.deleteOnExit(); FileOutputStream gzfos = new FileOutputStream(packgz); GZIPOutputStream gos = new GZIPOutputStream(gzfos); gos.write(Files.readAllBytes(pack.toPath())); gos.finish(); gos.close(); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/cache/PaxHeaders.17941/NativeLibraryStorageTe0000644000000000000000000000013112654402377030176 xustar0030 mtime=1454507263.291431861 29 atime=1454507327.19557959 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/cache/NativeLibraryStorageTest.java0000644000175000002070000001577712654402377032232 0ustar00jvanekmock00000000000000/* Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.cache; import static net.sourceforge.jnlp.util.FileTestUtils.assertNoFileLeak; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import java.io.File; import java.net.URL; import java.util.ArrayList; import java.util.List; import net.sourceforge.jnlp.Version; import net.sourceforge.jnlp.util.FileTestUtils; import org.junit.Test; public class NativeLibraryStorageTest { /************************************************************************** * Test helpers * **************************************************************************/ /* Associates an extension with whether it represents a native library */ static class FileExtension { public FileExtension(String extension, boolean isNative) { this.extension = extension; this.isNative = isNative; } final String extension; final boolean isNative; } static private List makeExtensionsToTest() { List exts = new ArrayList(); exts.add(new FileExtension(".foobar", false)); /* Dummy non-native test extension */ for (String ext : NativeLibraryStorage.NATIVE_LIBRARY_EXTENSIONS) { exts.add(new FileExtension(ext, true)); } return exts; } /* All the native library types we support, as well as one negative test */ static final List extensionsToTest = makeExtensionsToTest(); /* Creates a NativeLibraryStorage object, caching the given URLs */ static NativeLibraryStorage nativeLibraryStorageWithCache(URL... urlsToCache) { ResourceTracker tracker = new ResourceTracker(); for (URL urlToCache : urlsToCache) { tracker.addResource(urlToCache, new Version("1.0"), null, UpdatePolicy.ALWAYS); } return new NativeLibraryStorage(tracker); } /************************************************************************** * Test cases * **************************************************************************/ /* Tests searching for native libraries in jars */ @Test public void testJarFileSearch() throws Exception { /* Create a temporary directory to create jars in */ File tempDirectory = FileTestUtils.createTempDirectory(); for (FileExtension ext : extensionsToTest) { /* Create empty file to search for */ String testFileName = "foobar" + ext.extension; File testFile = new File(tempDirectory, testFileName); FileTestUtils.createFileWithContents(testFile, ""); /* Create jar to search in */ File jarLocation = new File(tempDirectory, "test.jar"); FileTestUtils.createJarWithContents(jarLocation, testFile); final URL tempJarUrl = jarLocation.toURI().toURL(); final NativeLibraryStorage storage = nativeLibraryStorageWithCache(tempJarUrl); assertNoFileLeak( new Runnable () { @Override public void run() { storage.addSearchJar(tempJarUrl); } }); /* This check isn't critical, but ensures we do not accidentally add jars as search directories */ assertFalse(storage.getSearchDirectories().contains(tempJarUrl)); /* If the file we added is native, it should be found * Due to an implementation detail, non-native files will not be found */ boolean testFileWasFound = storage.findLibrary(testFileName) != null; assertEquals(ext.isNative, testFileWasFound); } } /* Tests searching for native libraries in directories */ @Test public void testDirectorySearch() throws Exception { /* Create a temporary directory to search in */ File tempDirectory = FileTestUtils.createTempDirectory(); for (FileExtension ext : extensionsToTest) { /* Create empty file in the directory */ String testFileName = "foobar" + ext.extension; FileTestUtils.createFileWithContents(new File(tempDirectory, testFileName), ""); /* Add the directory to the search list */ NativeLibraryStorage storage = nativeLibraryStorageWithCache(/* None needed */); storage.addSearchDirectory(tempDirectory); /* Ensure directory is in our search list */ assertTrue(storage.getSearchDirectories().contains(tempDirectory)); /* The file should be found, regardless if it was native */ boolean testFileWasFound = storage.findLibrary(testFileName) != null; assertTrue(testFileWasFound); } } @Test public void testCleanupTemporaryFolder() throws Exception { NativeLibraryStorage storage = nativeLibraryStorageWithCache(/* None needed */); storage.ensureNativeStoreDirectory(); /* The temporary native store directory should be our only search folder */ assertTrue(storage.getSearchDirectories().size() == 1); File searchDirectory = storage.getSearchDirectories().get(0); assertTrue(searchDirectory.exists()); /* Test that it has been deleted */ storage.cleanupTemporaryFolder(); assertFalse(searchDirectory.exists()); } }icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/cache/PaxHeaders.17941/CacheUtilTest.java0000644000000000000000000000013112654402377027226 xustar0030 mtime=1454507263.290431874 29 atime=1454507327.19557959 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/cache/CacheUtilTest.java0000644000175000002070000000660412654402377027760 0ustar00jvanekmock00000000000000/* CacheUtilTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.cache; import java.io.File; import java.net.URL; import net.sourceforge.jnlp.util.UrlUtils; import org.junit.Assert; import org.junit.Test; public class CacheUtilTest { @Test public void testNormalizeUrlComparsions() throws Exception { URL[] u = ResourceTrackerTest.getUrls(); URL[] n = ResourceTrackerTest.getNormalizedUrls(); for (int i = 0; i < u.length; i++) { Assert.assertTrue("url " + i + " must CacheUtil.urlEquals to its normalized form " + i, UrlUtils.urlEquals(u[i], n[i])); Assert.assertTrue("normalized form " + i + " must CacheUtil.urlEquals to its original " + i, UrlUtils.urlEquals(n[i], u[i])); } } @Test public void testUrlToPath() throws Exception { final URL u = new URL("https://example.com/applet/some:weird*applet?.jar"); //stuf behind querry is kept final File expected = new File("/tmp/https/example.com/applet/some_weird_applet..jar"); Assert.assertEquals(expected, CacheUtil.urlToPath(u, "/tmp")); } @Test public void testUrlToPathWithQuery() throws Exception { final URL u = new URL("https://example.com/applet/applet.php?id=applet5"); //querry is kept and sanitized final File expected = new File("/tmp/https/example.com/applet/applet.php.id_applet5"); Assert.assertEquals(expected, CacheUtil.urlToPath(u, "/tmp")); } @Test public void testUrlToPathWithoutQuery() throws Exception { final URL u = new URL("https://example.com/applet/applet.php"); //no doubledot is caused by patch adding query to file final File expected = new File("/tmp/https/example.com/applet/applet.php"); Assert.assertEquals(expected, CacheUtil.urlToPath(u, "/tmp")); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/cache/PaxHeaders.17941/CacheLRUWrapperTest.ja0000644000000000000000000000013112654402377027765 xustar0030 mtime=1454507263.290431874 29 atime=1454507327.19557959 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/cache/CacheLRUWrapperTest.java0000644000175000002070000002422212654402377031042 0ustar00jvanekmock00000000000000/* CacheLRUWrapperTest.java Copyright (C) 2012 Thomas Meyer This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.cache; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.IOException; import java.io.PrintStream; import java.util.concurrent.CountDownLatch; import org.junit.Before; import org.junit.Test; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.config.InfrastructureFileDescriptor; import net.sourceforge.jnlp.config.PathsAndFiles; import net.sourceforge.jnlp.util.CacheTestUtils; public class CacheLRUWrapperTest { // does no DeploymentConfiguration exist for this file name? private static final String cacheIndexFileName = PathsAndFiles.CACHE_INDEX_FILE_NAME + "_testing"; private static final File javaTmp = new File(System.getProperty("java.io.tmpdir")); private static final File tmpCache; private static final File tmpIndexFile; static { try { tmpCache = File.createTempFile("itw", "CacheLRUWrapperTest", javaTmp); tmpCache.delete(); tmpCache.mkdir(); tmpCache.deleteOnExit(); if (!tmpCache.isDirectory()) { throw new IOException("Unsuccess to create tmpfile, remove it and createsame directory"); } tmpIndexFile = new File(tmpCache, cacheIndexFileName); } catch (IOException ex) { throw new RuntimeException(ex); } } private static class DummyInfrastructureFileDescriptor extends InfrastructureFileDescriptor{ private final File backend; private DummyInfrastructureFileDescriptor(File backend) { super(); this.backend=backend; } @Override public File getFile() { return backend; } @Override public String getFullPath() { return backend.getAbsolutePath(); } } private static final CacheLRUWrapper clw = new CacheLRUWrapper( new DummyInfrastructureFileDescriptor(tmpIndexFile), new DummyInfrastructureFileDescriptor(tmpCache)); private final int noEntriesCacheFile = 1000; private ByteArrayOutputStream baos; private PrintStream out; @Before public void setup() { baos = new ByteArrayOutputStream(); out = new PrintStream(baos); } @Test public void testLoadStoreTiming() throws InterruptedException { final File cacheIndexFile = clw.getRecentlyUsedFile().getFile(); cacheIndexFile.delete(); try { int noLoops = 1000; long time[] = new long[noLoops]; clw.lock(); clearCacheIndexFile(); fillCacheIndexFile(noEntriesCacheFile); clw.store(); // FIXME: wait a second, because of file modification timestamp only provides accuracy on seconds. Thread.sleep(1000); long sum = 0; for(int i=0; i < noLoops - 1; i++) { time[i]= System.nanoTime(); clw.load(); time[i+1]= System.nanoTime(); if(i==0) continue; sum = sum + time[i] - time[i-1]; } double avg = sum / time.length; ServerAccess.logErrorReprint("Average = " + avg + "ns"); // wait more than 100 microseconds for noLoops = 1000 and noEntries=1000 is bad assertTrue("load() must not take longer than 100 µs, but took in avg " + avg/1000 + "µs", avg < 100 * 1000); } finally { clw.unlock(); cacheIndexFile.delete(); } } private void fillCacheIndexFile(int noEntries) { // fill cache index file for(int i = 0; i < noEntries; i++) { String path = clw.getRecentlyUsedFile().getFullPath() + File.separatorChar + i + File.separatorChar + "test" + i + ".jar"; String key = clw.generateKey(path); clw.addEntry(key, path); } } @Test public void testModTimestampAfterStore() throws InterruptedException { final File cacheIndexFile = clw.getRecentlyUsedFile().getFile(); cacheIndexFile.delete(); try{ clw.lock(); // 1. clear cache entries + store clw.addEntry("aa", "bb"); clw.store(); long lmBefore = cacheIndexFile.lastModified(); Thread.sleep(1010); clearCacheIndexFile(); long lmAfter = cacheIndexFile.lastModified(); assertTrue("modification timestamp hasn't changed! Before = " + lmBefore + " After = " + lmAfter, lmBefore < lmAfter); // FIXME: wait a second, because of file modification timestamp only provides accuracy on seconds. Thread.sleep(1010); // 2. load cache file lmBefore = cacheIndexFile.lastModified(); clw.load(); lmAfter = cacheIndexFile.lastModified(); assertTrue("modification timestamp has changed!", lmBefore == lmAfter); // 3. add some cache entries and store lmBefore = cacheIndexFile.lastModified(); fillCacheIndexFile(noEntriesCacheFile); clw.store(); lmAfter = cacheIndexFile.lastModified(); assertTrue("modification timestamp hasn't changed! Before = " + lmBefore + " After = " + lmAfter, lmBefore < lmAfter); } finally { cacheIndexFile.delete(); clw.unlock(); } } private void clearCacheIndexFile() { clw.lock(); try { // clear cache + store file clw.clearLRUSortedEntries(); clw.store(); } finally { clw.unlock(); } } @Test public void testAddEntry() { String key = "key"; String value = "value"; clw.addEntry(key, value); assertTrue(clw.containsKey(key) && clw.containsValue(value)); } @Test public void testRemoveEntry() { String key = "key"; String value = "value"; clw.addEntry(key, value); clw.removeEntry(key); assertFalse(clw.containsKey(key) && clw.containsValue(value)); } @Test(timeout = 2000l) public void testLock() throws IOException { try { clw.lock(); assertTrue(clw.getRecentlyUsedPropertiesFile().isHeldByCurrentThread()); } finally { clw.unlock(); } } @Test(timeout = 2000l) public void testUnlock() throws IOException { try { clw.lock(); } finally { clw.unlock(); } assertTrue(!clw.getRecentlyUsedPropertiesFile().isHeldByCurrentThread()); } @Test(timeout = 2000l) public void testStoreFailsWithoutLock() throws IOException { assertTrue(!clw.store()); } @Test(timeout = 2000l) public void testStoreWorksWithLocK() throws IOException { try { clw.lock(); assertTrue(clw.store()); } finally { clw.unlock(); } } @Test(timeout = 2000l) public void testMultithreadLockPreventsStore() throws IOException, InterruptedException { int numThreads = 100; CountDownLatch doneSignal = new CountDownLatch(numThreads); Thread[] list = new Thread[numThreads]; for (int i = 0; i < numThreads; i++) { list[i] = new Thread(new StoreWorker(doneSignal)); } for (int i = 0; i < numThreads; i++) { list[i].start(); } //Wait for all children to finish for (int i = 0; i < numThreads; i++) { list[i].join(); } String out = baos.toString(); assertTrue(CacheTestUtils.stringContainsOnlySingleInstance(out, "true") && out.contains("false")); } private class StoreWorker implements Runnable { private final CountDownLatch doneSignal; public StoreWorker(CountDownLatch doneSignal) { this.doneSignal = doneSignal; } @Override public void run() { try { clw.getRecentlyUsedPropertiesFile().tryLock(); boolean result = clw.store(); synchronized (out) { out.println(String.valueOf(result)); out.flush(); } //Let parent know outputting is done doneSignal.countDown(); //Wait until able to continue to clw.unlock() doneSignal.await(); } catch (Exception e) { e.printStackTrace(); } finally { clw.unlock(); } } } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/cache/PaxHeaders.17941/CacheEntryTest.java0000644000000000000000000000013112654402377027412 xustar0030 mtime=1454507263.290431874 29 atime=1454507327.19557959 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/cache/CacheEntryTest.java0000644000175000002070000003045112654402377030141 0ustar00jvanekmock00000000000000/* CacheEntryTest -- unit test for CacheEntry Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.cache; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.IOException; import java.io.PrintStream; import java.net.MalformedURLException; import java.net.URL; import java.nio.file.Files; import java.util.concurrent.CountDownLatch; import org.junit.Before; import org.junit.Test; import net.sourceforge.jnlp.Version; import net.sourceforge.jnlp.util.CacheTestUtils; import net.sourceforge.jnlp.util.PropertiesFile; public class CacheEntryTest { /** A custom subclass that allows supplying num predefined cache file */ static class TestCacheEntry extends CacheEntry { private File cacheFile; public TestCacheEntry(URL location, Version version, File cacheFile) { super(location, version); this.cacheFile = cacheFile; } @Override protected File getCacheFile() { return cacheFile; } @Override protected PropertiesFile readCacheEntryInfo() { try { return new PropertiesFile(createFile("")); } catch (IOException e) { throw new AssertionError(e); } } } private URL url; private Version version; private ByteArrayOutputStream baos; private PrintStream out; @Before public void setUp() throws MalformedURLException { url = new URL("http://example.com/example.jar"); version = new Version("1.0"); baos = new ByteArrayOutputStream(); out = new PrintStream(baos); } @Test public void verifyLocationIsSame() { CacheEntry entry = new TestCacheEntry(url, version, null); assertEquals(url, entry.getLocation()); } @Test public void verifyLastModifiedIsSetCorrectly() { long LAST_MODIFIED = 1000; CacheEntry entry = new TestCacheEntry(url, version, null); entry.setLastModified(LAST_MODIFIED); assertEquals(LAST_MODIFIED, entry.getLastModified()); } @Test public void verifyLastUpdatedIsSetCorrectly() { long LAST_UPDATED = 1000; CacheEntry entry = new TestCacheEntry(url, version, null); entry.setLastUpdated(LAST_UPDATED); assertEquals(LAST_UPDATED, entry.getLastUpdated()); } @Test public void verifyContentLengthIsSetCorrectly() { long CONTENT_LENGTH = 1000; CacheEntry entry = new TestCacheEntry(url, version, null); entry.setRemoteContentLength(CONTENT_LENGTH); assertEquals(CONTENT_LENGTH, entry.getRemoteContentLength()); } @Test public void verifyOriginalContentLengthIsSetCorrectly() { long ORIGINAL_CONTENT_LENGTH = 1000; CacheEntry entry = new TestCacheEntry(url, version, null); entry.setOriginalContentLength(ORIGINAL_CONTENT_LENGTH); assertEquals(ORIGINAL_CONTENT_LENGTH, entry.getOriginalContentLength()); } @Test public void verifyNotCachedIfFileIsAbsent() { File doesNotExist = new File("/foo/bar/baz/spam/eggs"); CacheEntry entry = new TestCacheEntry(url, version, doesNotExist); assertFalse(entry.isCached()); } @Test public void verifyNotCachedIfContentLengthsDiffer() throws IOException { File cachedFile = createFile("Foo"); CacheEntry entry = new TestCacheEntry(url, version, cachedFile); entry.setRemoteContentLength(10000); assertFalse(entry.isCached()); } @Test public void verifyCachedIfContentLengthsAreSame() throws IOException { String contents = "Foo"; File cachedFile = createFile(contents); CacheEntry entry = new TestCacheEntry(url, version, cachedFile); entry.setRemoteContentLength(contents.length()); assertTrue(entry.isCached()); } @Test public void verifyCachedIfOriginalContentLengthsAreSame() throws IOException { String contents = "FooDECOMPRESSED"; long compressedLength = 5; File cachedFile = createFile(contents); CacheEntry entry = new TestCacheEntry(url, version, cachedFile); entry.setRemoteContentLength(compressedLength); entry.setOriginalContentLength(compressedLength); assertTrue(entry.isCached()); } @Test public void verifyCurrentWhenCacheEntryHasSameTimeStamp() throws IOException { long lastModified = 10; String contents = "Foo"; File cachedFile = createFile(contents); CacheEntry entry = new TestCacheEntry(url, version, cachedFile); entry.setRemoteContentLength(contents.length()); entry.setLastModified(lastModified); assertTrue(entry.isCurrent(lastModified)); } @Test public void verifyNotCurrentWhenRemoteContentIsNewer() throws IOException { long oldTimeStamp = 10; long newTimeStamp = 100; String contents = "Foo"; File cachedFile = createFile(contents); CacheEntry entry = new TestCacheEntry(url, version, cachedFile); entry.setRemoteContentLength(contents.length()); entry.setLastModified(oldTimeStamp); assertFalse(entry.isCurrent(newTimeStamp)); } private static File createFile(String contents) throws IOException { File cachedFile = File.createTempFile("CacheEntryTest", null); Files.write(cachedFile.toPath(), contents.getBytes()); cachedFile.deleteOnExit(); return cachedFile; } @Test(timeout = 2000l) public void testLock() throws IOException { TestCacheEntry entry = new TestCacheEntry(url, version, null); try { entry.lock(); assertTrue(entry.isHeldByCurrentThread()); } finally { entry.unlock(); } } @Test(timeout = 2000l) public void testUnlock() throws IOException { TestCacheEntry entry = new TestCacheEntry(url, version, null); try { entry.lock(); } finally { entry.unlock(); } assertTrue(!entry.isHeldByCurrentThread()); } @Test(timeout = 2000l) public void testStoreFailsWithoutLock() throws IOException { TestCacheEntry entry = new TestCacheEntry(url, version, null); long num = 10; entry.setLastModified(num); assertTrue(!entry.store()); } @Test(timeout = 2000l) public void testStoreWorksWithLocK() throws IOException { TestCacheEntry entry = new TestCacheEntry(url, version, null); long num = 10; entry.setLastModified(num); try { entry.lock(); assertTrue(entry.store()); } finally { entry.unlock(); } } @Test(timeout = 2000l) public void testMultithreadLockPreventsWrite() throws IOException, InterruptedException { int numThreads = 100; CountDownLatch doneSignal = new CountDownLatch(numThreads); CountDownLatch writersDoneSignal = new CountDownLatch(numThreads); TestCacheEntry entry = new TestCacheEntry(url, version, null); Thread[] list = new Thread[numThreads]; for (int i=0; i browserPrefs; public TestBrowserAwareProxySelector(DeploymentConfiguration config, Map browserPrefs) { super(config); this.browserPrefs = browserPrefs; } @Override protected Map parseBrowserPreferences() throws IOException { return browserPrefs; } } private static final String PROXY_HOST = "foo"; private static final int PROXY_PORT = 42; private static final InetSocketAddress PROXY_ADDRESS = new InetSocketAddress(PROXY_HOST, PROXY_PORT); private DeploymentConfiguration config; private Map browserPrefs; @Before public void setUp() { config = new DeploymentConfiguration(); config.setProperty(DeploymentConfiguration.KEY_PROXY_TYPE, String.valueOf(JNLPProxySelector.PROXY_TYPE_BROWSER)); browserPrefs = new HashMap(); } @Test public void testNoBrowserProxy() throws URISyntaxException { browserPrefs.put("network.proxy.type", "0" /* none */); List result = getProxy(config, browserPrefs, new URI("https://example.org")); assertEquals(1, result.size()); assertEquals(Proxy.NO_PROXY, result.get(0)); } @Test public void testBrowserManualSameProxy() throws URISyntaxException { browserPrefs.put("network.proxy.type", "1" /* = manual */); browserPrefs.put("network.proxy.share_proxy_settings", "true"); browserPrefs.put("network.proxy.http", PROXY_HOST); browserPrefs.put("network.proxy.http_port", String.valueOf(PROXY_PORT)); List result; result = getProxy(config, browserPrefs, new URI("https://example.org")); assertEquals(1, result.size()); assertEquals(new Proxy(Type.HTTP, PROXY_ADDRESS), result.get(0)); result = getProxy(config, browserPrefs, new URI("socket://example.org")); assertEquals(1, result.size()); assertEquals(new Proxy(Type.SOCKS, PROXY_ADDRESS), result.get(0)); } @Test public void testBrowserManualHttpsProxy() throws URISyntaxException { browserPrefs.put("network.proxy.type", "1" /* = manual */); browserPrefs.put("network.proxy.ssl", PROXY_HOST); browserPrefs.put("network.proxy.ssl_port", String.valueOf(PROXY_PORT)); List result = getProxy(config, browserPrefs, new URI("https://example.org")); assertEquals(1, result.size()); assertEquals(new Proxy(Type.HTTP, PROXY_ADDRESS), result.get(0)); } @Test public void testBrowserManualHttpProxy() throws URISyntaxException { browserPrefs.put("network.proxy.type", "1" /* = manual */); browserPrefs.put("network.proxy.http", PROXY_HOST); browserPrefs.put("network.proxy.http_port", String.valueOf(PROXY_PORT)); List result = getProxy(config, browserPrefs, new URI("http://example.org")); assertEquals(1, result.size()); assertEquals(new Proxy(Type.HTTP, PROXY_ADDRESS), result.get(0)); } @Test public void testBrowserManualFtpProxy() throws URISyntaxException { browserPrefs.put("network.proxy.type", "1" /* = manual */); browserPrefs.put("network.proxy.ftp", PROXY_HOST); browserPrefs.put("network.proxy.ftp_port", String.valueOf(PROXY_PORT)); List result = getProxy(config, browserPrefs, new URI("ftp://example.org")); assertEquals(1, result.size()); assertEquals(new Proxy(Type.HTTP, PROXY_ADDRESS), result.get(0)); } @Test public void testBrowserManualSocksProxy() throws URISyntaxException { browserPrefs.put("network.proxy.type", "1" /* = manual */); browserPrefs.put("network.proxy.socks", PROXY_HOST); browserPrefs.put("network.proxy.socks_port", String.valueOf(PROXY_PORT)); List result = getProxy(config, browserPrefs, new URI("socket://example.org")); assertEquals(1, result.size()); assertEquals(new Proxy(Type.SOCKS, PROXY_ADDRESS), result.get(0)); } @Test public void testBrowserManualHttpProxyFallsBackToSocksProxy() throws URISyntaxException { browserPrefs.put("network.proxy.type", "1" /* = manual */); browserPrefs.put("network.proxy.socks", PROXY_HOST); browserPrefs.put("network.proxy.socks_port", String.valueOf(PROXY_PORT)); List result = getProxy(config, browserPrefs, new URI("http://example.org")); assertEquals(1, result.size()); assertEquals(new Proxy(Type.SOCKS, PROXY_ADDRESS), result.get(0)); } @Test public void testBrowserManualProxyUnknownProtocol() throws URISyntaxException { browserPrefs.put("network.proxy.type", "1" /* = manual */); List result = getProxy(config, browserPrefs, new URI("gopher://example.org")); assertEquals(1, result.size()); assertEquals(Proxy.NO_PROXY, result.get(0)); } @Test public void testBrowserAutoProxyUnimplemented() throws URISyntaxException { browserPrefs.put("network.proxy.type", "4" /* = auto */); List result = getProxy(config, browserPrefs, new URI("http://example.org")); assertEquals(1, result.size()); assertEquals(Proxy.NO_PROXY, result.get(0)); } @Test public void testBrowserSystemProxyUnimplemented() throws URISyntaxException { browserPrefs.put("network.proxy.type", "5" /* = system */); List result = getProxy(config, browserPrefs, new URI("http://example.org")); assertEquals(1, result.size()); assertEquals(Proxy.NO_PROXY, result.get(0)); } @Test public void testBrowserPacProxyUnimplemented() throws URISyntaxException { browserPrefs.put("network.proxy.type", "2" /* = pac */); List result = getProxy(config, browserPrefs, new URI("http://example.org")); assertEquals(1, result.size()); assertEquals(Proxy.NO_PROXY, result.get(0)); } private static List getProxy(DeploymentConfiguration config, Map browserPrefs, URI uri) { BrowserAwareProxySelector selector = new TestBrowserAwareProxySelector(config, browserPrefs); selector.initialize(); return selector.getFromBrowser(uri); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.17941/basic.jnlp0000644000000000000000000000013212654402377024566 xustar0030 mtime=1454507263.289431888 30 atime=1454507327.194579603 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/basic.jnlp0000644000175000002070000000312612654402377025313 0ustar00jvanekmock00000000000000 Large JNLP The IcedTea Project one-line short tooltip related-content <!-- or something -->title decription of related-content arg1 arg2 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.17941/awt0000644000000000000000000000013212654402377023336 xustar0030 mtime=1454507263.289431888 30 atime=1454507658.776157397 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/awt/0000755000175000002070000000000012654402377024136 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/awt/PaxHeaders.17941/imagesearch0000644000000000000000000000013212654402377025606 xustar0030 mtime=1454507263.289431888 30 atime=1454507658.776157397 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/awt/imagesearch/0000755000175000002070000000000012654402377026406 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/awt/imagesearch/PaxHeaders.17941/ComponentFin0000644000000000000000000000013212654402377030205 xustar0030 mtime=1454507263.289431888 30 atime=1454507327.194579603 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/awt/imagesearch/ComponentFinderTest.java0000644000175000002070000000412412654402377033204 0ustar00jvanekmock00000000000000/* ComponentFinderTest.java Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.awt.imagesearch; import java.awt.image.BufferedImage; import org.junit.Assert; import org.junit.Test; /** * * This class is a part of AWTFramework, contains component finding * by searching for icons. * */ public class ComponentFinderTest { @Test public void initialiseDefaultIcon() { BufferedImage icon = ComponentFinder.defaultIcon; Assert.assertNotNull("The default icon marker.png was not initialized.", icon); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.17941/application0000644000000000000000000000013212654402377025046 xustar0030 mtime=1454507263.288431901 30 atime=1454507658.776157397 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/application/0000755000175000002070000000000012654402377025646 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/application/PaxHeaders.17941/application8.jnl0000644000000000000000000000013212654402377030223 xustar0030 mtime=1454507263.288431901 30 atime=1454507327.194579603 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/application/application8.jnlp0000644000175000002070000000071612654402377031132 0ustar00jvanekmock00000000000000 Sample RedHat This is a sample to test a bug icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/application/PaxHeaders.17941/application7.jnl0000644000000000000000000000013212654402377030222 xustar0030 mtime=1454507263.288431901 30 atime=1454507327.194579603 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/application/application7.jnlp0000644000175000002070000000042512654402377031126 0ustar00jvanekmock00000000000000 Sample Test RedHat icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/application/PaxHeaders.17941/application6.jnl0000644000000000000000000000013212654402377030221 xustar0030 mtime=1454507263.288431901 30 atime=1454507327.194579603 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/application/application6.jnlp0000644000175000002070000000061412654402377031125 0ustar00jvanekmock00000000000000 Sample Test RedHat icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/application/PaxHeaders.17941/application5.jnl0000644000000000000000000000013212654402377030220 xustar0030 mtime=1454507263.288431901 30 atime=1454507327.193579617 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/application/application5.jnlp0000644000175000002070000000053712654402377031130 0ustar00jvanekmock00000000000000 Sample Test RedHat icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/application/PaxHeaders.17941/application4.jnl0000644000000000000000000000013212654402377030217 xustar0030 mtime=1454507263.287431914 30 atime=1454507327.193579617 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/application/application4.jnlp0000644000175000002070000000051112654402377031117 0ustar00jvanekmock00000000000000 Sample Test * icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/application/PaxHeaders.17941/application3.jnl0000644000000000000000000000013212654402377030216 xustar0030 mtime=1454507263.287431914 30 atime=1454507327.193579617 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/application/application3.jnlp0000644000175000002070000000075612654402377031131 0ustar00jvanekmock00000000000000 Sample Test RedHat icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/application/PaxHeaders.17941/application2.jnl0000644000000000000000000000013212654402377030215 xustar0030 mtime=1454507263.287431914 30 atime=1454507327.193579617 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/application/application2.jnlp0000644000175000002070000000053312654402377031121 0ustar00jvanekmock00000000000000 RedHat Sample Test icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/application/PaxHeaders.17941/application1.jnl0000644000000000000000000000013212654402377030214 xustar0030 mtime=1454507263.287431914 30 atime=1454507327.193579617 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/application/application1.jnlp0000644000175000002070000000053312654402377031120 0ustar00jvanekmock00000000000000 Sample Test RedHat icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/application/PaxHeaders.17941/application0.jnl0000644000000000000000000000013212654402377030213 xustar0030 mtime=1454507263.287431914 30 atime=1454507327.193579617 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/application/application0.jnlp0000644000175000002070000000073312654402377031121 0ustar00jvanekmock00000000000000 random tag test ]]> Sample Test RedHat icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.17941/VersionTest.java0000644000000000000000000000013212654402377025750 xustar0030 mtime=1454507263.286431928 30 atime=1454507327.193579617 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/VersionTest.java0000644000175000002070000001150612654402377026476 0ustar00jvanekmock00000000000000/* Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp; import org.junit.Assert; import org.junit.Test; public class VersionTest { private static boolean[] results = {true, true, false, true, false, true, false, true, false, false, false, false, true, true, true, true, true, true, false, true}; private static Version jvms[] = { new Version("1.1* 1.3*"), new Version("1.2+"),}; private static Version versions[] = { new Version("1.1"), new Version("1.1.8"), new Version("1.2"), new Version("1.3"), new Version("2.0"), new Version("1.3.1"), new Version("1.2.1"), new Version("1.3.1-beta"), new Version("1.1 1.2"), new Version("1.2 1.3"),}; @Test public void testMatches() { int i = 0; for (int j = 0; j < jvms.length; j++) { for (int v = 0; v < versions.length; v++) { i++; String debugOutput = i + " " + jvms[j].toString() + " "; if (!jvms[j].matches(versions[v])) { debugOutput += "!"; } debugOutput += "matches " + versions[v].toString(); ServerAccess.logOutputReprint(debugOutput); Assert.assertEquals(results[i - 1], jvms[j].matches(versions[v])); } } } @Test public void cornerCases() { Assert.assertTrue(new Version("1.5").matches("1.5")); Assert.assertTrue(new Version("1.5+").matches("1.5")); Assert.assertTrue(new Version("1.5+").matches("1.6")); Assert.assertFalse(new Version("1.5+").matches("1.4")); Assert.assertFalse(new Version("1.5").matches("1.4")); Assert.assertFalse(new Version("1.5").matches("1.6")); } @Test public void testMatchesMinus() { Assert.assertTrue(new Version("1.5-").matches("1.5")); //this fails, do we need to patch it? //Assert.assertTrue(new Version("1.5-").matches("1.4")); //not until somebody complains Assert.assertFalse(new Version("1.5-").matches("1.6")); } @Test public void multiplePossibilities() { Assert.assertTrue(new Version("1.4 1.5").matches("1.5")); Assert.assertFalse(new Version("1.3 1.4").matches("1.5")); } @Test public void jreVersionTestOk() { //no exception occures //head support jdk 7+, so this statements should be always true Version.JreVersion jreVersion = new Version.JreVersion("1.4 1.5+", true, true); Version.JreVersion jreVersion1 = new Version.JreVersion("1.6+", true, true); } @Test(expected = RuntimeException.class) public void jreVersionTestFails1() { //head support jdk 7+, so this statements should be always false Version.JreVersion jreVersion = new Version.JreVersion("2", true, true); } @Test(expected = RuntimeException.class) public void jreVersionTestFails2() { //head support jdk 7+, so this statements should be always false Version.JreVersion jreVersion = new Version.JreVersion("1.4", true, true); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.17941/SecurityDescTest.java0000644000000000000000000000013212654402377026731 xustar0030 mtime=1454507263.286431928 30 atime=1454507327.193579617 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/SecurityDescTest.java0000644000175000002070000002074712654402377027466 0ustar00jvanekmock00000000000000/* Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp; import java.net.URI; import net.sourceforge.jnlp.mock.DummyJNLPFile; import org.junit.Test; import static org.junit.Assert.*; public class SecurityDescTest { @Test public void testNotNullJnlpFile() throws Exception { Throwable t = null; try { new SecurityDesc(new DummyJNLPFile(), SecurityDesc.SANDBOX_PERMISSIONS, null); } catch (Exception ex) { t = ex; } assertNull("securityDesc should not throw exception", t); } @Test(expected = NullPointerException.class) public void testNullJnlpFile() throws Exception { new SecurityDesc(null, SecurityDesc.SANDBOX_PERMISSIONS, null); } @Test public void testAppendRecursiveSubdirToCodebaseHostString() throws Exception { final String urlStr = "http://example.com"; final String result = SecurityDesc.appendRecursiveSubdirToCodebaseHostString(urlStr); final String expected = "http://example.com/-"; assertEquals(expected, result); } @Test public void testAppendRecursiveSubdirToCodebaseHostString2() throws Exception { final String urlStr = "http://example.com/"; final String result = SecurityDesc.appendRecursiveSubdirToCodebaseHostString(urlStr); final String expected = "http://example.com/-"; assertEquals(expected, result); } @Test public void testAppendRecursiveSubdirToCodebaseHostString3() throws Exception { final String urlStr = "http://example.com///"; final String result = SecurityDesc.appendRecursiveSubdirToCodebaseHostString(urlStr); final String expected = "http://example.com/-"; assertEquals(expected, result); } @Test public void testAppendRecursiveSubdirToCodebaseHostStringWithPort() throws Exception { final String urlStr = "http://example.com:8080"; final String result = SecurityDesc.appendRecursiveSubdirToCodebaseHostString(urlStr); final String expected = "http://example.com:8080/-"; assertEquals(expected, result); } @Test(expected = NullPointerException.class) public void testAppendRecursiveSubdirToCodebaseHostStringWithNull() throws Exception { SecurityDesc.appendRecursiveSubdirToCodebaseHostString(null); } @Test public void testGetHostWithSpecifiedPort() throws Exception { final URI codebase = new URI("http://example.com"); final URI expected = new URI("http://example.com:80"); assertEquals(expected, SecurityDesc.getHostWithSpecifiedPort(codebase, 80)); } @Test public void testGetHostWithSpecifiedPortWithFtpScheme() throws Exception { final URI codebase = new URI("ftp://example.com"); final URI expected = new URI("ftp://example.com:80"); assertEquals(expected, SecurityDesc.getHostWithSpecifiedPort(codebase, 80)); } @Test public void testGetHostWithSpecifiedPortWithUserInfo() throws Exception { final URI codebase = new URI("http://user:password@example.com"); final URI expected = new URI("http://user:password@example.com:80"); assertEquals(expected, SecurityDesc.getHostWithSpecifiedPort(codebase, 80)); } @Test public void testGetHostWithSpecifiedPortWithPort() throws Exception { final URI codebase = new URI("http://example.com:8080"); final URI expected = new URI("http://example.com:80"); assertEquals(expected, SecurityDesc.getHostWithSpecifiedPort(codebase, 80)); } @Test public void testGetHostWithSpecifiedPortWithPath() throws Exception { final URI codebase = new URI("http://example.com/applet/codebase/"); final URI expected = new URI("http://example.com:80"); assertEquals(expected, SecurityDesc.getHostWithSpecifiedPort(codebase, 80)); } @Test public void testGetHostWithSpecifiedPortWithAll() throws Exception { final URI codebase = new URI("ftp://user:password@example.com:8080/applet/codebase/"); final URI expected = new URI("ftp://user:password@example.com:80"); assertEquals(expected, SecurityDesc.getHostWithSpecifiedPort(codebase, 80)); } @Test(expected = NullPointerException.class) public void testGetHostWithSpecifiedPortWithNull() throws Exception { SecurityDesc.getHostWithSpecifiedPort(null, 80); } @Test public void testGetHost() throws Exception { final URI codebase = new URI("http://example.com"); final URI expected = new URI("http://example.com"); assertEquals(expected, SecurityDesc.getHost(codebase)); } @Test public void testGetHostWithFtpScheme() throws Exception { final URI codebase = new URI("ftp://example.com"); final URI expected = new URI("ftp://example.com"); assertEquals(expected, SecurityDesc.getHost(codebase)); } @Test public void testGetHostWithUserInfo() throws Exception { final URI codebase = new URI("http://user:password@example.com"); final URI expected = new URI("http://user:password@example.com"); assertEquals(expected, SecurityDesc.getHost(codebase)); } @Test public void testGetHostWithPort() throws Exception { final URI codebase = new URI("http://example.com:8080"); final URI expected = new URI("http://example.com:8080"); assertEquals(expected, SecurityDesc.getHost(codebase)); } @Test public void testGetHostWithPath() throws Exception { final URI codebase = new URI("http://example.com/applet/codebase/"); final URI expected = new URI("http://example.com"); assertEquals(expected, SecurityDesc.getHost(codebase)); } @Test public void testGetHostWithAll() throws Exception { final URI codebase = new URI("ftp://user:password@example.com:8080/applet/codebase/"); final URI expected = new URI("ftp://user:password@example.com:8080"); assertEquals(expected, SecurityDesc.getHost(codebase)); } @Test(expected = NullPointerException.class) public void testGetHostNull() throws Exception { SecurityDesc.getHost(null); } @Test public void testGetHostWithAppendRecursiveSubdirToCodebaseHostString() throws Exception { final URI codebase = new URI("ftp://user:password@example.com:8080/applet/codebase/"); final String expected = "ftp://user:password@example.com:8080/-"; assertEquals(expected, SecurityDesc.appendRecursiveSubdirToCodebaseHostString(SecurityDesc.getHost(codebase).toString())); } @Test public void testGetHostWithSpecifiedPortWithAppendRecursiveSubdirToCodebaseHostString() throws Exception { final URI codebase = new URI("ftp://user:password@example.com:8080/applet/codebase/"); final String expected = "ftp://user:password@example.com:80/-"; assertEquals(expected, SecurityDesc.appendRecursiveSubdirToCodebaseHostString(SecurityDesc.getHostWithSpecifiedPort(codebase, 80).toString())); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.17941/PropertyDescTest.java0000644000000000000000000000013112654402377026745 xustar0030 mtime=1454507263.286431928 29 atime=1454507327.19257963 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/PropertyDescTest.java0000644000175000002070000000745312654402377027502 0ustar00jvanekmock00000000000000/* Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp; import org.junit.Assert; import org.junit.Test; public class PropertyDescTest { @Test public void regularValue() throws LaunchException{ PropertyDesc p = PropertyDesc.fromString("key=value"); Assert.assertEquals("key", p.getKey()); Assert.assertEquals("value", p.getValue()); } @Test public void correctEmptyValue() throws LaunchException{ PropertyDesc p = PropertyDesc.fromString("key="); Assert.assertEquals("key", p.getKey()); Assert.assertEquals("", p.getValue()); } @Test public void strangeEmptyValue() throws LaunchException{ PropertyDesc p = PropertyDesc.fromString("key= "); Assert.assertEquals("key", p.getKey()); Assert.assertEquals(" ", p.getValue()); } @Test public void emptyKey() throws LaunchException{ PropertyDesc p = PropertyDesc.fromString("=value"); Assert.assertEquals("", p.getKey()); Assert.assertEquals("value", p.getValue()); } @Test public void strangeEmptyKey() throws LaunchException{ PropertyDesc p = PropertyDesc.fromString(" =value"); Assert.assertEquals(" ", p.getKey()); Assert.assertEquals("value", p.getValue()); } @Test public void allEmpty() throws LaunchException{ PropertyDesc p = PropertyDesc.fromString("="); Assert.assertEquals("", p.getKey()); Assert.assertEquals("", p.getValue()); } @Test public void allStarngeEmpty() throws LaunchException{ PropertyDesc p = PropertyDesc.fromString(" = "); Assert.assertEquals(" ", p.getKey()); Assert.assertEquals(" ", p.getValue()); } @Test(expected = LaunchException.class) public void irregularValue() throws LaunchException{ PropertyDesc p = PropertyDesc.fromString("key"); } @Test(expected = LaunchException.class) public void empty() throws LaunchException{ PropertyDesc p = PropertyDesc.fromString(""); } @Test(expected = NullPointerException.class) public void nullValue() throws LaunchException{ PropertyDesc p = PropertyDesc.fromString(null); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.17941/PluginParametersTest.java0000644000000000000000000000013112654402377027604 xustar0030 mtime=1454507263.286431928 29 atime=1454507327.19257963 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/PluginParametersTest.java0000644000175000002070000001174612654402377030341 0ustar00jvanekmock00000000000000package net.sourceforge.jnlp; import static org.junit.Assert.*; import java.util.HashMap; import java.util.Map; import org.junit.Test; public class PluginParametersTest { @Test public void testAttributeParseJavaPrefix() { // java_* aliases override older names: // http://java.sun.com/j2se/1.4.2/docs/guide/plugin/developer_guide/using_tags.html#in-nav Map rawParams; Map params; rawParams = new HashMap(); rawParams.put("code", "codeValue"); rawParams.put("java_code", "java_codeValue"); params = PluginParameters.createParameterTable(rawParams); assertEquals("java_codeValue", params.get("code")); rawParams = new HashMap(); rawParams.put("codebase", "codebaseValue"); rawParams.put("java_codebase", "java_codebaseValue"); params = PluginParameters.createParameterTable(rawParams); assertEquals("java_codebaseValue", params.get("codebase")); rawParams = new HashMap(); rawParams.put("archive", "archiveValue"); rawParams.put("java_archive", "java_archiveValue"); params = PluginParameters.createParameterTable(rawParams); assertEquals("java_archiveValue", params.get("archive")); rawParams = new HashMap(); rawParams.put("object", "objectValue"); rawParams.put("java_object", "java_objectValue"); params = PluginParameters.createParameterTable(rawParams); assertEquals("java_objectValue", params.get("object")); rawParams = new HashMap(); rawParams.put("type", "typeValue"); rawParams.put("java_type", "java_typeValue"); params = PluginParameters.createParameterTable(rawParams); assertEquals("java_typeValue", params.get("type")); } @Test public void testEnsureJavaPrefixTakesPrecedence() { Map params; params = new HashMap(); params.put("test", "testValue"); params.put("java_test", "java_testValue"); PluginParameters.ensureJavaPrefixTakesPrecedence(params, "test"); assertEquals("java_testValue", params.get("test")); params = new HashMap(); params.put("test", "testValue"); PluginParameters.ensureJavaPrefixTakesPrecedence(params, "test"); assertEquals("testValue", params.get("test")); params = new HashMap(); params.put("java_test", "java_testValue"); PluginParameters.ensureJavaPrefixTakesPrecedence(params, "test"); assertEquals("java_testValue", params.get("test")); } @Test public void testAttributeParseCodeAttribute() { Map rawParams; Map params; // Simple test of object tag being set rawParams = new HashMap(); rawParams.put("object", "objectValue"); params = PluginParameters.createParameterTable(rawParams); assertEquals("objectValue", params.get("object")); // Classid tag gets used as code tag rawParams = new HashMap(); rawParams.put("classid", "classidValue"); params = PluginParameters.createParameterTable(rawParams); assertEquals("classidValue", params.get("code")); // Java: gets stripped from code tag rawParams = new HashMap(); rawParams.put("code", "java:codeValue"); params = PluginParameters.createParameterTable(rawParams); assertEquals("codeValue", params.get("code")); // Classid tag gets used as code tag, and java: is stripped rawParams = new HashMap(); rawParams.put("classid", "java:classidValue"); params = PluginParameters.createParameterTable(rawParams); assertEquals("classidValue", params.get("code")); // Classid tag gets used as code tag, and clsid: is stripped rawParams = new HashMap(); rawParams.put("classid", "clsid:classidValue"); params = PluginParameters.createParameterTable(rawParams); assertEquals(null, params.get("code")); } /** * Initialize PluginParameters without code/object parameters */ @Test(expected = PluginParameterException.class) public void testConstructorWithNoCodeAndObjectParam() { Map rawParams = new HashMap(); rawParams.put("classid", "clsid:classidValue"); new PluginParameters(rawParams); } /** * Initialize PluginParameters with jnlp_href but no code/object parameters */ @Test public void testConstructorWithOnlyJnlpHrefParam() { Map rawParams = new HashMap(); rawParams.put("jnlp_href", "applet.jnlp"); PluginParameters pluginParam = new PluginParameters(rawParams); assertEquals("applet.jnlp", pluginParam.getJNLPHref()); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.17941/PluginBridgeTest.java0000644000000000000000000000013112654402377026675 xustar0030 mtime=1454507263.285431941 29 atime=1454507327.19257963 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/PluginBridgeTest.java0000644000175000002070000005765312654402377027441 0ustar00jvanekmock00000000000000/* * Copyright 2012 Red Hat, Inc. * This file is part of IcedTea, http://icedtea.classpath.org * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Sun designates this * particular file as subject to the "Classpath" exception as provided * by Sun in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */ package net.sourceforge.jnlp; import static org.junit.Assert.assertEquals; import java.io.File; import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; import java.util.HashMap; import java.util.Map; import java.util.List; import net.sourceforge.jnlp.cache.CacheUtil; import net.sourceforge.jnlp.cache.UpdatePolicy; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.config.PathsAndFiles; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.util.logging.NoStdOutErrTest; import net.sourceforge.jnlp.util.replacements.BASE64Encoder; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; public class PluginBridgeTest extends NoStdOutErrTest{ private class MockJNLPCreator extends JNLPCreator { private URL JNLPHref; public URL getJNLPHref() { return JNLPHref; } @Override public JNLPFile create(URL location, Version version, ParserSettings settings, UpdatePolicy policy, URL forceCodebase) throws IOException, ParseException { JNLPHref = location; return new MockJNLPFile(); } } private class MockJNLPFile extends JNLPFile { @Override public AppletDesc getApplet() { return new AppletDesc(null, null, null, 0, 0, new HashMap()); } @Override public ResourcesDesc getResources() { return new ResourcesDesc(null, null, null, null); } } static private PluginParameters createValidParamObject() { Map params = new HashMap<>(); params.put("code", ""); // Avoids an exception being thrown return new PluginParameters(params); } private static String originalCacheDir; @BeforeClass public static void setup() { originalCacheDir = PathsAndFiles.CACHE_DIR.getFullPath(); PathsAndFiles.CACHE_DIR.setValue(System.getProperty("java.io.tmpdir") + File.separator + "tempcache"); } @AfterClass public static void teardown() { CacheUtil.clearCache(); PathsAndFiles.CACHE_DIR.setValue(originalCacheDir); } @Test public void testAbsoluteJNLPHref() throws MalformedURLException, Exception { URL codeBase = new URL("http://undesired.absolute.codebase.com"); String absoluteLocation = "http://absolute.href.com/test.jnlp"; PluginParameters params = createValidParamObject(); params.put("jnlp_href", absoluteLocation); MockJNLPCreator mockCreator = new MockJNLPCreator(); PluginBridge pb = new PluginBridge(codeBase, null, "", "", 0, 0, params, mockCreator); assertEquals(absoluteLocation, mockCreator.getJNLPHref().toExternalForm()); } @Test public void testRelativeJNLPHref() throws MalformedURLException, Exception { URL codeBase = new URL("http://desired.absolute.codebase.com/"); String relativeLocation = "sub/dir/test.jnlp"; PluginParameters params = createValidParamObject(); params.put("jnlp_href", relativeLocation); MockJNLPCreator mockCreator = new MockJNLPCreator(); PluginBridge pb = new PluginBridge(codeBase, null, "", "", 0, 0, params, mockCreator); assertEquals(codeBase.toExternalForm() + relativeLocation, mockCreator.getJNLPHref().toExternalForm()); } @Test public void testNoSubDirInCodeBase() throws MalformedURLException, Exception { String desiredDomain = "http://desired.absolute.codebase.com"; URL codeBase = new URL(desiredDomain + "/undesired/sub/dir"); String relativeLocation = "/app/test/test.jnlp"; PluginParameters params = createValidParamObject(); params.put("jnlp_href", relativeLocation); MockJNLPCreator mockCreator = new MockJNLPCreator(); PluginBridge pb = new PluginBridge(codeBase, null, "", "", 0, 0, params, mockCreator); assertEquals(desiredDomain + relativeLocation, mockCreator.getJNLPHref().toExternalForm()); } @Test public void testGetRequestedPermissionLevel() throws MalformedURLException, Exception { String desiredDomain = "http://desired.absolute.codebase.com"; URL codeBase = new URL(desiredDomain + "/undesired/sub/dir"); String relativeLocation = "/app/test/test.jnlp"; PluginParameters params = createValidParamObject(); params.put("jnlp_href", relativeLocation); MockJNLPCreator mockCreator = new MockJNLPCreator(); PluginBridge pb = new PluginBridge(codeBase, null, "", "", 0, 0, params, mockCreator); assertEquals(pb.getRequestedPermissionLevel(), SecurityDesc.RequestedPermissionLevel.NONE); params.put(SecurityDesc.RequestedPermissionLevel.PERMISSIONS_NAME,SecurityDesc.RequestedPermissionLevel.ALL.toHtmlString()); pb = new PluginBridge(codeBase, null, "", "", 0, 0, params, mockCreator); assertEquals(pb.getRequestedPermissionLevel(), SecurityDesc.RequestedPermissionLevel.ALL); //unknown for applets! params.put(SecurityDesc.RequestedPermissionLevel.PERMISSIONS_NAME, SecurityDesc.RequestedPermissionLevel.J2EE.toJnlpString()); pb = new PluginBridge(codeBase, null, "", "", 0, 0, params, mockCreator); assertEquals(pb.getRequestedPermissionLevel(), SecurityDesc.RequestedPermissionLevel.NONE); params.put(SecurityDesc.RequestedPermissionLevel.PERMISSIONS_NAME, SecurityDesc.RequestedPermissionLevel.SANDBOX.toHtmlString()); pb = new PluginBridge(codeBase, null, "", "", 0, 0, params, mockCreator); assertEquals(pb.getRequestedPermissionLevel(), SecurityDesc.RequestedPermissionLevel.SANDBOX); params.put(SecurityDesc.RequestedPermissionLevel.PERMISSIONS_NAME, SecurityDesc.RequestedPermissionLevel.DEFAULT.toHtmlString()); pb = new PluginBridge(codeBase, null, "", "", 0, 0, params, mockCreator); assertEquals(pb.getRequestedPermissionLevel(), SecurityDesc.RequestedPermissionLevel.NONE); } @Test public void testBase64StringDecoding() throws Exception { String actualFile = "This is a sample string that will be encoded to" + "a Base64 string and then decoded using PluginBridge's" + "decoding method and compared."; BASE64Encoder encoder = new BASE64Encoder(); String encodedFile = encoder.encodeBuffer(actualFile.getBytes()); byte[] decodedBytes = PluginBridge.decodeBase64String(encodedFile); String decodedString = new String(decodedBytes); Assert.assertEquals(actualFile, decodedString); } @Test public void testEmbeddedJnlpWithValidCodebase() throws Exception { URL codeBase = new URL("http://icedtea.classpath.org"); String relativeLocation = "/EmbeddedJnlpFile.jnlp"; //Codebase within jnlp file is VALID /** Sample Test RedHat **/ String jnlpFileEncoded = "ICAgICAgICA8P3htbCB2ZXJzaW9uPSIxLjAiPz4NCiAgICAgICAgICAgIDxqbmxwIHNwZWM9IjEu" + "NSsiIA0KICAgICAgICAgICAgICBocmVmPSJFbWJlZGRlZEpubHBGaWxlLmpubHAiIA0KICAgICAg" + "ICAgICAgICBjb2RlYmFzZT0iaHR0cDovL3d3dy5yZWRoYXQuY29tIiAgICANCiAgICAgICAgICAg" + "ID4NCg0KICAgICAgICAgICAgPGluZm9ybWF0aW9uPg0KICAgICAgICAgICAgICAgIDx0aXRsZT5T" + "YW1wbGUgVGVzdDwvdGl0bGU+DQogICAgICAgICAgICAgICAgPHZlbmRvcj5SZWRIYXQ8L3ZlbmRv" + "cj4NCiAgICAgICAgICAgICAgICA8b2ZmbGluZS1hbGxvd2VkLz4NCiAgICAgICAgICAgIDwvaW5m" + "b3JtYXRpb24+DQoNCiAgICAgICAgICAgIDxyZXNvdXJjZXM+DQogICAgICAgICAgICAgICAgPGoy" + "c2UgdmVyc2lvbj0nMS42KycgLz4NCiAgICAgICAgICAgICAgICA8amFyIGhyZWY9J0VtYmVkZGVk" + "Sm5scEphck9uZS5qYXInIG1haW49J3RydWUnIC8+DQogICAgICAgICAgICAgICAgPGphciBocmVm" + "PSdFbWJlZGRlZEpubHBKYXJUd28uamFyJyBtYWluPSd0cnVlJyAvPg0KICAgICAgICAgICAgPC9y" + "ZXNvdXJjZXM+DQoNCiAgICAgICAgICAgIDxhcHBsZXQtZGVzYw0KICAgICAgICAgICAgICAgIGRv" + "Y3VtZW50QmFzZT0iLiINCiAgICAgICAgICAgICAgICBuYW1lPSJyZWRoYXQuZW1iZWRkZWRqbmxw" + "Ig0KICAgICAgICAgICAgICAgIG1haW4tY2xhc3M9InJlZGhhdC5lbWJlZGRlZGpubHAiDQogICAg" + "ICAgICAgICAgICAgd2lkdGg9IjAiDQogICAgICAgICAgICAgICAgaGVpZ2h0PSIwIg0KICAgICAg" + "ICAgICAgLz4NCiAgICAgICAgICAgIDwvam5scD4="; MockJNLPCreator mockCreator = new MockJNLPCreator(); PluginParameters params = createValidParamObject(); params.put("jnlp_href", relativeLocation); params.put("jnlp_embedded", jnlpFileEncoded); String jnlpCodebase = "http://www.redhat.com"; PluginBridge pb = new PluginBridge(codeBase, null, "", "", 0, 0, params, mockCreator); JARDesc[] jars = pb.getResources().getJARs(); //Check if there are two jars cached Assert.assertTrue(jars.length == 2); //Resource can be in any order List resourceLocations = new ArrayList<>(); resourceLocations.add(jars[0].getLocation().toExternalForm()); resourceLocations.add(jars[1].getLocation().toExternalForm()); //Check URLs of jars Assert.assertTrue(resourceLocations.contains(jnlpCodebase + "/EmbeddedJnlpJarOne.jar")); Assert.assertTrue((resourceLocations.contains(jnlpCodebase + "/EmbeddedJnlpJarTwo.jar"))); } @Test //http://docs.oracle.com/javase/6/docs/technotes/guides/jweb/applet/codebase_determination.html //example 3 public void testEmbeddedJnlpWithInvalidCodebase() throws Exception { URL overwrittenCodebase = new URL("http://icedtea.classpath.org"); String relativeLocation = "/EmbeddedJnlpFile.jnlp"; //Codebase within jnlp file is INVALID /** Sample Test RedHat **/ String jnlpFileEncoded = "ICAgICAgICA8P3htbCB2ZXJzaW9uPSIxLjAiPz4NCiAgICAgICAgICAgIDxqbmxwIHNwZWM9IjEu" + "NSsiIA0KICAgICAgICAgICAgICBocmVmPSJFbWJlZGRlZEpubHBGaWxlLmpubHAiIA0KICAgICAg" + "ICAgICAgICBjb2RlYmFzZT0iaW52YWxpZFBhdGgiICAgIA0KICAgICAgICAgICAgPg0KDQogICAg" + "ICAgICAgICA8aW5mb3JtYXRpb24+DQogICAgICAgICAgICAgICAgPHRpdGxlPlNhbXBsZSBUZXN0" + "PC90aXRsZT4NCiAgICAgICAgICAgICAgICA8dmVuZG9yPlJlZEhhdDwvdmVuZG9yPg0KICAgICAg" + "ICAgICAgICAgIDxvZmZsaW5lLWFsbG93ZWQvPg0KICAgICAgICAgICAgPC9pbmZvcm1hdGlvbj4N" + "Cg0KICAgICAgICAgICAgPHJlc291cmNlcz4NCiAgICAgICAgICAgICAgICA8ajJzZSB2ZXJzaW9u" + "PScxLjYrJyAvPg0KICAgICAgICAgICAgICAgIDxqYXIgaHJlZj0nRW1iZWRkZWRKbmxwSmFyT25l" + "LmphcicgbWFpbj0ndHJ1ZScgLz4NCiAgICAgICAgICAgICAgICA8amFyIGhyZWY9J0VtYmVkZGVk" + "Sm5scEphclR3by5qYXInIG1haW49J3RydWUnIC8+DQogICAgICAgICAgICA8L3Jlc291cmNlcz4N" + "Cg0KICAgICAgICAgICAgPGFwcGxldC1kZXNjDQogICAgICAgICAgICAgICAgZG9jdW1lbnRCYXNl" + "PSIuIg0KICAgICAgICAgICAgICAgIG5hbWU9InJlZGhhdC5lbWJlZGRlZGpubHAiDQogICAgICAg" + "ICAgICAgICAgbWFpbi1jbGFzcz0icmVkaGF0LmVtYmVkZGVkam5scCINCiAgICAgICAgICAgICAg" + "ICB3aWR0aD0iMCINCiAgICAgICAgICAgICAgICBoZWlnaHQ9IjAiDQogICAgICAgICAgICAvPg0K" + "ICAgICAgICAgICAgPC9qbmxwPg=="; MockJNLPCreator mockCreator = new MockJNLPCreator(); PluginParameters params = createValidParamObject(); params.put("jnlp_href", relativeLocation); params.put("jnlp_embedded", jnlpFileEncoded); PluginBridge pb = new PluginBridge(overwrittenCodebase, null, "", "", 0, 0, params, mockCreator); JARDesc[] jars = pb.getResources().getJARs(); //Check if there are two jars cached Assert.assertTrue(jars.length == 2); //Resource can be in any order List resourceLocations = new ArrayList<>(); resourceLocations.add(jars[0].getLocation().toExternalForm()); resourceLocations.add(jars[1].getLocation().toExternalForm()); //Check URLs of jars Assert.assertTrue(resourceLocations.contains(overwrittenCodebase + "/EmbeddedJnlpJarOne.jar")); Assert.assertTrue((resourceLocations.contains(overwrittenCodebase + "/EmbeddedJnlpJarTwo.jar"))); } @Test public void testInvalidEmbeddedJnlp() throws Exception { URL overwrittenCodebase = new URL("http://icedtea.classpath.org"); String relativeLocation = "/EmbeddedJnlpFile.jnlp"; //Embedded jnlp is invalid String jnlpFileEncoded = "thisContextIsInvalid"; MockJNLPCreator mockCreator = new MockJNLPCreator(); PluginParameters params = createValidParamObject(); params.put("jnlp_href", relativeLocation); params.put("jnlp_embedded", jnlpFileEncoded); try { new PluginBridge(overwrittenCodebase, null, "", "", 0, 0, params, mockCreator); } catch (Exception e) { return; } Assert.fail("PluginBridge was successfully created with an invalid embedded jnlp value"); } @Test public void stripClassNoClass() throws Exception { Assert.assertEquals("blah.class.someclass", PluginBridge.strippClass("blah.class.someclass")); } @Test public void stripClassClass() throws Exception { Assert.assertEquals("blah.class.someclass", PluginBridge.strippClass("blah.class.someclass.class")); } private static final String CV="cbVal"; private static String fixCommonIssues(String input, boolean needsSecurity) { return PluginBridge.fixCommonIsuses(needsSecurity, input, CV, "titTets", "ventest"); } ; public static int countOccurences(String str, String findStr) { int lastIndex = 0; int count = 0; while (lastIndex != -1) { lastIndex = str.indexOf(findStr, lastIndex); if (lastIndex != -1) { count++; lastIndex += findStr.length(); } } return count; } private void checkIssuesFixed(String input, boolean security, boolean defaultCB) { assertEquals(1, countOccurences(input, "")); assertEquals(1, countOccurences(input, "")); } ; @Test public void testElementMatch() throws Exception { Assert.assertTrue("".matches(PluginBridge.toMatcher(PluginBridge.SANDBOX_REGEX))); Assert.assertTrue(" < sandbox > ".matches(PluginBridge.toMatcher(PluginBridge.SANDBOX_REGEX))); Assert.assertTrue(" < sandbox > \n".matches(PluginBridge.toMatcher(PluginBridge.SANDBOX_REGEX))); Assert.assertTrue("\n < SANDBOX > \n".matches(PluginBridge.toMatcher(PluginBridge.SANDBOX_REGEX))); Assert.assertEquals(" XX ", " < sAnDbOx > ".replaceAll(PluginBridge.SANDBOX_REGEX,"XX")); Assert.assertEquals(" A \n XX \n B ", " A \n \n B ".replaceAll(PluginBridge.SANDBOX_REGEX,"XX")); } @Test public void testClosingElementMatch() throws Exception { Assert.assertTrue("".matches(PluginBridge.toMatcher(PluginBridge.CLOSE_INFORMATION_REGEX))); Assert.assertTrue(" < /information > ".matches(PluginBridge.toMatcher(PluginBridge.CLOSE_INFORMATION_REGEX))); Assert.assertTrue(" < / information > \n".matches(PluginBridge.toMatcher(PluginBridge.CLOSE_INFORMATION_REGEX))); Assert.assertTrue("\n \n".matches(PluginBridge.toMatcher(PluginBridge.CLOSE_INFORMATION_REGEX))); Assert.assertEquals(" XX ", " ".replaceAll(PluginBridge.CLOSE_INFORMATION_REGEX,"XX")); Assert.assertEquals(" A \n XX \n B ", " A \n \n B ".replaceAll(PluginBridge.CLOSE_INFORMATION_REGEX,"XX")); } @Test public void testCodeBaseMatches() throws Exception { Assert.assertFalse("zzz codebase zzz".matches(PluginBridge.toMatcher(PluginBridge.CODEBASE_REGEX1))); Assert.assertTrue("zzz codebase='someVal' zzz".matches(PluginBridge.toMatcher(PluginBridge.CODEBASE_REGEX1))); Assert.assertTrue("zzz codebase='' \nzzz".matches(PluginBridge.toMatcher(PluginBridge.CODEBASE_REGEX1))); Assert.assertTrue("zzz codebase=\"\" zzz".matches(PluginBridge.toMatcher(PluginBridge.CODEBASE_REGEX1))); Assert.assertTrue("zzz \ncodebase='.' zzz".matches(PluginBridge.toMatcher(PluginBridge.CODEBASE_REGEX1))); Assert.assertTrue("zzz codebase=\".\" zzz\n".matches(PluginBridge.toMatcher(PluginBridge.CODEBASE_REGEX1))); Assert.assertTrue("zzz codebase='' zzz".matches(PluginBridge.toMatcher(PluginBridge.CODEBASE_REGEX2))); Assert.assertTrue("zzz codebase=\"\" zzz".matches(PluginBridge.toMatcher(PluginBridge.CODEBASE_REGEX2))); Assert.assertTrue("zzz codebase='.' zzz".matches(PluginBridge.toMatcher(PluginBridge.CODEBASE_REGEX2))); Assert.assertTrue("zzz codebase=\".\" zzz".matches(PluginBridge.toMatcher(PluginBridge.CODEBASE_REGEX2))); Assert.assertTrue("zzz codebase=\".\">".matches(PluginBridge.toMatcher(PluginBridge.CODEBASE_REGEX2))); Assert.assertFalse("zzz codebase=\".\"X".matches(PluginBridge.toMatcher(PluginBridge.CODEBASE_REGEX2))); Assert.assertFalse("zzz codebase='x' zzz".matches(PluginBridge.toMatcher(PluginBridge.CODEBASE_REGEX2))); Assert.assertFalse("zzz codebase=\"..\" zzz".matches(PluginBridge.toMatcher(PluginBridge.CODEBASE_REGEX2))); Assert.assertFalse("zzz codebase zzz".matches(PluginBridge.toMatcher(PluginBridge.CODEBASE_REGEX2))); Assert.assertFalse("zzz codebase='someVal' zzz".matches(PluginBridge.toMatcher(PluginBridge.CODEBASE_REGEX2))); } private static final String jnlpTempalte = " " + " @INFO@ \n" + " @SEC@ \n " + "\n" + " \n " + " \n" + "\n" + "\n" + " \n" + "\n" + " "; private static String prepareTemplate(String codebase, String information, String security ){ return jnlpTempalte.replace("@CB@", codebase).replace("@INFO@", information).replace("@SEC@", security); } @Test public void fixCommonIssuesNothingUnsigned() throws Exception { String source = prepareTemplate("","", ""); String fixed = fixCommonIssues(source, false); checkIssuesFixed(fixed, false, true); } @Test public void fixCommonNothingSigned() throws Exception { String source = prepareTemplate("","", ""); String fixed = fixCommonIssues(source, true); checkIssuesFixed(fixed, true, true); } @Test public void fixCommonIssuesEmptyInformationUnsigned() throws Exception { String source = prepareTemplate("","", ""); String fixed = fixCommonIssues(source, false); checkIssuesFixed(fixed, false, true); } @Test public void fixCommonIssuesEmptyInformationSigned() throws Exception { String source = prepareTemplate("","", ""); String fixed = fixCommonIssues(source, true); checkIssuesFixed(fixed, true, true); } @Test public void fixCommonIssuesInformationUnsigned() throws Exception { String source = prepareTemplate("","blahargh", ""); String fixed = fixCommonIssues(source, false); checkIssuesFixed(fixed, false, true); } @Test public void fixCommonIssuesInformationSigned() throws Exception { String source = prepareTemplate("","blahargh", ""); String fixed = fixCommonIssues(source, true); checkIssuesFixed(fixed, true, true); } @Test public void fixCommonIssuesInformationCodebaseDotUnsigned() throws Exception { String source = prepareTemplate("codebase='.'", "blahargh", ""); String fixed = fixCommonIssues(source, false); checkIssuesFixed(fixed, false, true); } @Test public void fixCommonIssuesInformationCodebaseDotUnsigned2() throws Exception { String source = prepareTemplate("codebase=\"\"", "blahargh", ""); String fixed = fixCommonIssues(source, false); checkIssuesFixed(fixed, false, true); } @Test public void fixCommonIssuesInformationCodebaseSigned() throws Exception { String source = prepareTemplate("codebase='customOne'","blahargh", ""); String fixed = fixCommonIssues(source, true); checkIssuesFixed(fixed, true, false); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.17941/ParserTest.java0000644000000000000000000000013112654402377025556 xustar0030 mtime=1454507263.285431941 29 atime=1454507327.19257963 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/ParserTest.java0000644000175000002070000022443112654402377026310 0ustar00jvanekmock00000000000000/* ParserTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp; import java.io.ByteArrayInputStream; import java.net.URL; import java.util.ArrayList; import java.util.List; import java.util.Locale; import net.sourceforge.jnlp.mock.MockJNLPFile; import net.sourceforge.jnlp.util.logging.NoStdOutErrTest; import org.junit.Assert; import org.junit.Test; /** Test various corner cases of the parser */ public class ParserTest extends NoStdOutErrTest { private static final String LANG = "en"; private static final String COUNTRY = "CA"; private static final String VARIANT = "utf8"; private static final Locale LANG_LOCALE = new Locale(LANG); private static final Locale LANG_COUNTRY_LOCALE = new Locale(LANG, COUNTRY); private static final Locale ALL_LOCALE = new Locale(LANG, COUNTRY, VARIANT); ParserSettings defaultParser=new ParserSettings(); ParserSettings strictParser=new ParserSettings(true, true, true); @Test(expected = MissingInformationException.class) public void testMissingInfoFullLocale() throws ParseException { String data = "\n"; Node root = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root.getNodeName()); MockJNLPFile file = new MockJNLPFile(ALL_LOCALE); Parser parser = new Parser(file, null, root, defaultParser); parser.getInfo(root); } @Test(expected = MissingTitleException.class) public void testEmptyLocalizedInfoFullLocale() throws ParseException { String data = "\n" + " \n" + " \n" + "\n"; Node root = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root.getNodeName()); MockJNLPFile file = new MockJNLPFile(ALL_LOCALE); Parser parser = new Parser(file, null, root, defaultParser); List infoDescs = new ArrayList(); infoDescs.addAll(parser.getInfo(root)); Assert.assertTrue("Exactly one info desc should be found", infoDescs.size() == 1); file.setInfo(infoDescs); parser.checkForInformation(); } @Test public void testOneFullyLocalizedInfoFullLocale() throws ParseException { String data = "\n" + " \n" + " English_CA_utf8_T\n" + " English_CA_utf8_V\n" + " \n" + "\n"; Node root = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root.getNodeName()); MockJNLPFile file = new MockJNLPFile(ALL_LOCALE); Parser parser = new Parser(file, null, root, defaultParser); List infoDescs = parser.getInfo(root); Assert.assertTrue("Exactly one info desc should be found", infoDescs.size() == 1); file.setInfo(infoDescs); Assert.assertEquals("Title should be `English_CA_utf8_T' but wasn't", "English_CA_utf8_T", file.getTitle()); Assert.assertEquals("Vendor should be `English_CA_utf8_V' but wasn't", "English_CA_utf8_V", file.getVendor()); } @Test public void testOneLangCountryLocalizedInfoFullLocale() throws ParseException { String data = "\n" + " \n" + " Generalized_T\n" + " Generalized_V\n" + " \n" + " \n" + " English_CA_T\n" + " English_CA_V\n" + " \n" + "\n"; Node root = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root.getNodeName()); MockJNLPFile file = new MockJNLPFile(ALL_LOCALE); Parser parser = new Parser(file, null, root, defaultParser); List infoDescs = parser.getInfo(root); Assert.assertTrue("Exactly two info descs should be found", infoDescs.size() == 2); file.setInfo(infoDescs); Assert.assertEquals("Title should be `English_CA_T' but wasn't", "English_CA_T", file.getTitle()); Assert.assertEquals("Vendor should be `English_CA_V' but wasn't", "English_CA_V", file.getVendor()); } @Test public void testOneLangLocalizedInfoFullLocale() throws ParseException { String data = "\n" + " \n" + " Generalized_T\n" + " Generalized_V\n" + " \n" + " \n" + " English_T\n" + " English_V\n" + " \n" + "\n"; Node root = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root.getNodeName()); MockJNLPFile file = new MockJNLPFile(ALL_LOCALE); Parser parser = new Parser(file, null, root, defaultParser); List infoDescs = parser.getInfo(root); Assert.assertTrue("Exactly two info descs should be found", infoDescs.size() == 2); file.setInfo(infoDescs); Assert.assertEquals("Title should be `English_T' but wasn't", "English_T", file.getTitle()); Assert.assertEquals("Vendor should be `English_V' but wasn't", "English_V", file.getVendor()); } @Test public void testGeneralizedInfoFullLocale() throws ParseException { String data = "\n" + " \n" + " Generalized_T\n" + " Generalized_V\n" + " \n" + "\n"; Node root = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root.getNodeName()); MockJNLPFile file = new MockJNLPFile(ALL_LOCALE); Parser parser = new Parser(file, null, root, defaultParser); List infoDescs = parser.getInfo(root); Assert.assertTrue("Exactly one info desc should be found", infoDescs.size() == 1); file.setInfo(infoDescs); Assert.assertEquals("Title should be `Generalized_T' but wasn't", "Generalized_T", file.getTitle()); Assert.assertEquals("Vendor should be `Generalized_V' but wasn't", "Generalized_V", file.getVendor()); } @Test public void testTwoDifferentLocalizedInfoFullLocale() throws ParseException { String data = "\n" + " \n" + " Generalized_T\n" + " Generalized_V\n" + " \n" + " \n" + " English_T\n" + " English_V\n" + " \n" + " \n" + " French_T\n" + " French_V\n" + " \n" + "\n"; Node root = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root.getNodeName()); MockJNLPFile file = new MockJNLPFile(ALL_LOCALE); Parser parser = new Parser(file, null, root, defaultParser); List infoDescs = parser.getInfo(root); Assert.assertTrue("Exactly three info descs should be found", infoDescs.size() == 3); file.setInfo(infoDescs); Assert.assertEquals("Title should be `English_T' but wasn't", "English_T", file.getTitle()); Assert.assertEquals("Vendor should be `English_V' but wasn't", "English_V", file.getVendor()); } @Test public void testTwoLocalizedWithSameLangInfoFullLocale() throws ParseException { String data = "\n" + " \n" + " Generalized_T\n" + " Generalized_V\n" + " \n" + " \n" + " English_T\n" + " English_V\n" + " \n" + " \n" + " English_CA_T\n" + " English_CA_V\n" + " \n" + "\n"; Node root = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root.getNodeName()); MockJNLPFile file = new MockJNLPFile(ALL_LOCALE); Parser parser = new Parser(file, null, root, defaultParser); List infoDescs = parser.getInfo(root); Assert.assertTrue("Exactly three info descs should be found", infoDescs.size() == 3); file.setInfo(infoDescs); Assert.assertEquals("Title should be `English_CA_T' but wasn't", "English_CA_T", file.getTitle()); Assert.assertEquals("Vendor should be `English_CA_V' but wasn't", "English_CA_V", file.getVendor()); } @Test public void testTwoSameLangOneMissingTitleFullLocale() throws ParseException { String data = "\n" + " \n" + " Generalized_T\n" + " Generalized_V\n" + " \n" + " \n" + " English_T\n" + " English_V\n" + " \n" + " \n" + " English_CA_V\n" + " \n" + "\n"; Node root = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root.getNodeName()); MockJNLPFile file = new MockJNLPFile(ALL_LOCALE); Parser parser = new Parser(file, null, root, defaultParser); List infoDescs = parser.getInfo(root); Assert.assertTrue("Exactly three info descs should be found", infoDescs.size() == 3); file.setInfo(infoDescs); Assert.assertEquals("Title should be `English_T' but wasn't", "English_T", file.getTitle()); Assert.assertEquals("Vendor should be `English_CA_V' but wasn't", "English_CA_V", file.getVendor()); } @Test public void testTwoSameLangWithGeneralizedTitleFullLocale() throws ParseException { String data = "\n" + " \n" + " Generalized_T\n" + " Generalized_V\n" + " \n" + " \n" + " English_V\n" + " \n" + " \n" + " English_CA_V\n" + " \n" + "\n"; Node root = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root.getNodeName()); MockJNLPFile file = new MockJNLPFile(ALL_LOCALE); Parser parser = new Parser(file, null, root, defaultParser); List infoDescs = parser.getInfo(root); Assert.assertTrue("Exactly three info descs should be found", infoDescs.size() == 3); file.setInfo(infoDescs); Assert.assertEquals("Title should be `Generalized_T' but wasn't", "Generalized_T", file.getTitle()); Assert.assertEquals("Vendor should be `English_CA_V' but wasn't", "English_CA_V", file.getVendor()); } @Test(expected = MissingTitleException.class) public void testMissingTitleFullLocale() throws ParseException { String data = "\n" + " \n" + " Generalized_V\n" + " \n" + " \n" + " English_V\n" + " \n" + " \n" + " English_CA_V\n" + " \n" + "\n"; Node root = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root.getNodeName()); MockJNLPFile file = new MockJNLPFile(ALL_LOCALE); Parser parser = new Parser(file, null, root, defaultParser); List infoDescs = new ArrayList(); infoDescs.addAll(parser.getInfo(root)); Assert.assertTrue("Exactly three info descs should be found", infoDescs.size() == 3); file.setInfo(infoDescs); parser.checkForInformation(); } @Test(expected = MissingVendorException.class) public void testMissingVendorFullLocale() throws ParseException { String data = "\n" + " \n" + " Generalized_T\n" + " \n" + " \n" + " English_T\n" + " \n" + " \n" + " English_CA_T\n" + " \n" + "\n"; Node root = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root.getNodeName()); MockJNLPFile file = new MockJNLPFile(ALL_LOCALE); Parser parser = new Parser(file, null, root, defaultParser); List infoDescs = new ArrayList(); infoDescs.addAll(parser.getInfo(root)); Assert.assertTrue("Exactly three info descs should be found", infoDescs.size() == 3); file.setInfo(infoDescs); parser.checkForInformation(); } @Test(expected = MissingTitleException.class) public void testMissingLocalizedTitleFullLocale() throws ParseException { String data = "\n" + " \n" + " Generalized_V\n" + " \n" + " \n" + " English_CA_V\n" + " \n" + "\n"; Node root = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root.getNodeName()); MockJNLPFile file = new MockJNLPFile(ALL_LOCALE); Parser parser = new Parser(file, null, root, defaultParser); List infoDescs = new ArrayList(); infoDescs.addAll(parser.getInfo(root)); Assert.assertTrue("Exactly two info descs should be found", infoDescs.size() == 2); file.setInfo(infoDescs); parser.checkForInformation(); } @Test(expected = MissingVendorException.class) public void testMissingLocalizedVendorFullLocale() throws ParseException { String data = "\n" + " \n" + " Generalized_T\n" + " \n" + " \n" + " English_CA_T\n" + " \n" + "\n"; Node root = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root.getNodeName()); MockJNLPFile file = new MockJNLPFile(ALL_LOCALE); Parser parser = new Parser(file, null, root, defaultParser); List infoDescs = new ArrayList(); infoDescs.addAll(parser.getInfo(root)); Assert.assertTrue("Exactly two info descs should be found",infoDescs.size() == 2); file.setInfo(infoDescs); parser.checkForInformation(); } @Test(expected = MissingTitleException.class) public void testEmptyLocalizedTitleFullLocale() throws ParseException { String data = "\n" + " \n" + " \n" + " English_CA_utf8_V\n" + " \n" + "\n"; Node root = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root.getNodeName()); MockJNLPFile file = new MockJNLPFile(ALL_LOCALE); Parser parser = new Parser(file, null, root, defaultParser); List infoDescs = new ArrayList(); infoDescs.addAll(parser.getInfo(root)); Assert.assertTrue("Exactly one info desc should be found", infoDescs.size() == 1); file.setInfo(infoDescs); parser.checkForInformation(); } @Test(expected = MissingVendorException.class) public void testEmptyLocalizedVendorFullLocale() throws ParseException { String data = "\n" + " \n" + " English_CA_utf8_T\n" + " \n" + " \n" + "\n"; Node root = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root.getNodeName()); MockJNLPFile file = new MockJNLPFile(ALL_LOCALE); Parser parser = new Parser(file, null, root, defaultParser); List infoDescs = new ArrayList(); infoDescs.addAll(parser.getInfo(root)); Assert.assertTrue("Exactly one info desc should be found", infoDescs.size() == 1); file.setInfo(infoDescs); parser.checkForInformation(); } @Test public void testFallbackEmptyLocalizedTitleVendorFullLocale() throws ParseException { String data = "\n" + " \n" + " Generalized_T\n" + " Generalized_V\n" + " \n" + " \n" + " English_T\n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " French_CA_utf8_T\n" + " French_CA_utf8_V\n" + " \n" + "\n"; Node root = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root.getNodeName()); MockJNLPFile file = new MockJNLPFile(ALL_LOCALE); Parser parser = new Parser(file, null, root, defaultParser); List infoDescs = parser.getInfo(root); Assert.assertTrue("Exactly five info descs should be found", infoDescs.size() == 5); file.setInfo(infoDescs); Assert.assertEquals("Title should be `English_T' but wasn't", "English_T", file.getTitle()); Assert.assertEquals("Vendor should be `Generalized_V' but wasn't", "Generalized_V", file.getVendor()); parser.checkForInformation(); } @Test(expected = MissingInformationException.class) public void testMissingInfoLangCountryLocale() throws ParseException { String data = "\n"; Node root = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root.getNodeName()); MockJNLPFile file = new MockJNLPFile(LANG_COUNTRY_LOCALE); Parser parser = new Parser(file, null, root, defaultParser); parser.getInfo(root); } @Test(expected = MissingTitleException.class) public void testEmptyLocalizedInfoLangCountryLocale() throws ParseException { String data = "\n" + " \n" + " \n" + "\n"; Node root = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root.getNodeName()); MockJNLPFile file = new MockJNLPFile(LANG_COUNTRY_LOCALE); Parser parser = new Parser(file, null, root, defaultParser); List infoDescs = new ArrayList(); infoDescs.addAll(parser.getInfo(root)); Assert.assertTrue("Exactly one info desc should be found", infoDescs.size() == 1); file.setInfo(infoDescs); parser.checkForInformation(); } @Test(expected = MissingTitleException.class) public void testOneFullyLocalizedInfoLangCountryLocale() throws ParseException { String data = "\n" + " \n" + " English_CA_utf8_T\n" + " English_CA_utf8_V\n" + " \n" + "\n"; Node root = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root.getNodeName()); MockJNLPFile file = new MockJNLPFile(LANG_COUNTRY_LOCALE); Parser parser = new Parser(file, null, root, defaultParser); List infoDescs = parser.getInfo(root); Assert.assertTrue("Exactly one info desc should be found", infoDescs.size() == 1); file.setInfo(infoDescs); parser.checkForInformation(); } @Test public void testOneLangCountryLocalizedInfoLangCountryLocale() throws ParseException { String data = "\n" + " \n" + " Generalized_T\n" + " Generalized_V\n" + " \n" + " \n" + " English_CA_T\n" + " English_CA_V\n" + " \n" + "\n"; Node root = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root.getNodeName()); MockJNLPFile file = new MockJNLPFile(LANG_COUNTRY_LOCALE); Parser parser = new Parser(file, null, root, defaultParser); List infoDescs = parser.getInfo(root); Assert.assertTrue("Exactly two info descs should be found", infoDescs.size() == 2); file.setInfo(infoDescs); Assert.assertEquals("Title should be `English_CA_T' but wasn't", "English_CA_T", file.getTitle()); Assert.assertEquals("Vendor should be `English_CA_V' but wasn't", "English_CA_V", file.getVendor()); } @Test public void testOneLangLocalizedInfoLangCountryLocale() throws ParseException { String data = "\n" + " \n" + " Generalized_T\n" + " Generalized_V\n" + " \n" + " \n" + " English_T\n" + " English_V\n" + " \n" + "\n"; Node root = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root.getNodeName()); MockJNLPFile file = new MockJNLPFile(LANG_COUNTRY_LOCALE); Parser parser = new Parser(file, null, root, defaultParser); List infoDescs = parser.getInfo(root); Assert.assertTrue("Exactly two info descs should be found", infoDescs.size() == 2); file.setInfo(infoDescs); Assert.assertEquals("Title should be `English_T' but wasn't", "English_T", file.getTitle()); Assert.assertEquals("Vendor should be `English_V' but wasn't", "English_V", file.getVendor()); } @Test public void testGeneralizedInfoLangCountryLocale() throws ParseException { String data = "\n" + " \n" + " Generalized_T\n" + " Generalized_V\n" + " \n" + "\n"; Node root = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root.getNodeName()); MockJNLPFile file = new MockJNLPFile(LANG_COUNTRY_LOCALE); Parser parser = new Parser(file, null, root, defaultParser); List infoDescs = parser.getInfo(root); Assert.assertTrue("Exactly one info desc should be found", infoDescs.size() == 1); file.setInfo(infoDescs); Assert.assertEquals("Title should be `Generalized_T' but wasn't", "Generalized_T", file.getTitle()); Assert.assertEquals("Vendor should be `Generalized_V' but wasn't", "Generalized_V", file.getVendor()); } @Test public void testTwoDifferentLocalizedInfoLangCountryLocale() throws ParseException { String data = "\n" + " \n" + " Generalized_T\n" + " Generalized_V\n" + " \n" + " \n" + " English_T\n" + " English_V\n" + " \n" + " \n" + " French_T\n" + " French_V\n" + " \n" + "\n"; Node root = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root.getNodeName()); MockJNLPFile file = new MockJNLPFile(LANG_COUNTRY_LOCALE); Parser parser = new Parser(file, null, root, defaultParser); List infoDescs = parser.getInfo(root); Assert.assertTrue("Exactly three info descs should be found", infoDescs.size() == 3); file.setInfo(infoDescs); Assert.assertEquals("Title should be `English_T' but wasn't", "English_T", file.getTitle()); Assert.assertEquals("Vendor should be `English_V' but wasn't", "English_V", file.getVendor()); } @Test public void testTwoLocalizedWithSameLangInfoLangCountryLocale() throws ParseException { String data = "\n" + " \n" + " Generalized_T\n" + " Generalized_V\n" + " \n" + " \n" + " English_T\n" + " English_V\n" + " \n" + " \n" + " English_CA_T\n" + " English_CA_V\n" + " \n" + "\n"; Node root = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root.getNodeName()); MockJNLPFile file = new MockJNLPFile(LANG_COUNTRY_LOCALE); Parser parser = new Parser(file, null, root, defaultParser); List infoDescs = parser.getInfo(root); Assert.assertTrue("Exactly three info descs should be found", infoDescs.size() == 3); file.setInfo(infoDescs); Assert.assertEquals("Title should be `English_CA_T' but wasn't", "English_CA_T", file.getTitle()); Assert.assertEquals("Vendor should be `English_CA_V' but wasn't", "English_CA_V", file.getVendor()); } @Test public void testTwoSameLangOneMissingTitleLangCountryLocale() throws ParseException { String data = "\n" + " \n" + " Generalized_T\n" + " Generalized_V\n" + " \n" + " \n" + " English_T\n" + " English_V\n" + " \n" + " \n" + " English_CA_V\n" + " \n" + "\n"; Node root = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root.getNodeName()); MockJNLPFile file = new MockJNLPFile(LANG_COUNTRY_LOCALE); Parser parser = new Parser(file, null, root, defaultParser); List infoDescs = parser.getInfo(root); Assert.assertTrue("Exactly three info descs should be found", infoDescs.size() == 3); file.setInfo(infoDescs); Assert.assertEquals("Title should be `English_T' but wasn't", "English_T", file.getTitle()); Assert.assertEquals("Vendor should be `English_CA_V' but wasn't", "English_CA_V", file.getVendor()); } @Test public void testTwoSameLangWithGeneralizedTitleLangCountryLocale() throws ParseException { String data = "\n" + " \n" + " Generalized_T\n" + " Generalized_V\n" + " \n" + " \n" + " English_V\n" + " \n" + " \n" + " English_CA_V\n" + " \n" + "\n"; Node root = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root.getNodeName()); MockJNLPFile file = new MockJNLPFile(LANG_COUNTRY_LOCALE); Parser parser = new Parser(file, null, root, defaultParser); List infoDescs = parser.getInfo(root); Assert.assertTrue("Exactly three info descs should be found", infoDescs.size() == 3); file.setInfo(infoDescs); Assert.assertEquals("Title should be `Generalized_T' but wasn't", "Generalized_T", file.getTitle()); Assert.assertEquals("Vendor should be `English_CA_V' but wasn't", "English_CA_V", file.getVendor()); } @Test(expected = MissingTitleException.class) public void testMissingTitleLangCountryLocale() throws ParseException { String data = "\n" + " \n" + " Generalized_V\n" + " \n" + " \n" + " English_V\n" + " \n" + " \n" + " English_CA_V\n" + " \n" + "\n"; Node root = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root.getNodeName()); MockJNLPFile file = new MockJNLPFile(LANG_COUNTRY_LOCALE); Parser parser = new Parser(file, null, root, defaultParser); List infoDescs = new ArrayList(); infoDescs.addAll(parser.getInfo(root)); Assert.assertTrue("Exactly three info descs should be found", infoDescs.size() == 3); file.setInfo(infoDescs); parser.checkForInformation(); } @Test(expected = MissingVendorException.class) public void testMissingVendorLangCountryLocale() throws ParseException { String data = "\n" + " \n" + " Generalized_T\n" + " \n" + " \n" + " English_T\n" + " \n" + " \n" + " English_CA_T\n" + " \n" + "\n"; Node root = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root.getNodeName()); MockJNLPFile file = new MockJNLPFile(LANG_COUNTRY_LOCALE); Parser parser = new Parser(file, null, root, defaultParser); List infoDescs = new ArrayList(); infoDescs.addAll(parser.getInfo(root)); Assert.assertTrue("Exactly three info descs should be found", infoDescs.size() == 3); file.setInfo(infoDescs); parser.checkForInformation(); } @Test(expected = MissingTitleException.class) public void testMissingLocalizedTitleLangCountryLocale() throws ParseException { String data = "\n" + " \n" + " Generalized_V\n" + " \n" + " \n" + " English_CA_V\n" + " \n" + "\n"; Node root = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root.getNodeName()); MockJNLPFile file = new MockJNLPFile(LANG_COUNTRY_LOCALE); Parser parser = new Parser(file, null, root, defaultParser); List infoDescs = new ArrayList(); infoDescs.addAll(parser.getInfo(root)); Assert.assertTrue("Exactly two info descs should be found", infoDescs.size() == 2); file.setInfo(infoDescs); parser.checkForInformation(); } @Test(expected = MissingVendorException.class) public void testMissingLocalizedVendorLangCountryLocale() throws ParseException { String data = "\n" + " \n" + " Generalized_T\n" + " \n" + " \n" + " English_CA_T\n" + " \n" + "\n"; Node root = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root.getNodeName()); MockJNLPFile file = new MockJNLPFile(LANG_COUNTRY_LOCALE); Parser parser = new Parser(file, null, root, defaultParser); List infoDescs = new ArrayList(); infoDescs.addAll(parser.getInfo(root)); Assert.assertTrue("Exactly two info descs should be found",infoDescs.size() == 2); file.setInfo(infoDescs); parser.checkForInformation(); } @Test(expected = MissingTitleException.class) public void testEmptyLocalizedTitleLangCountryLocale() throws ParseException { String data = "\n" + " \n" + " \n" + " English_CA_utf8_V\n" + " \n" + "\n"; Node root = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root.getNodeName()); MockJNLPFile file = new MockJNLPFile(LANG_COUNTRY_LOCALE); Parser parser = new Parser(file, null, root, defaultParser); List infoDescs = new ArrayList(); infoDescs.addAll(parser.getInfo(root)); Assert.assertTrue("Exactly one info desc should be found", infoDescs.size() == 1); file.setInfo(infoDescs); parser.checkForInformation(); } @Test(expected = MissingVendorException.class) public void testEmptyLocalizedVendorLangCountryLocale() throws ParseException { String data = "\n" + " \n" + " English_CA_utf8_T\n" + " \n" + " \n" + "\n"; Node root = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root.getNodeName()); MockJNLPFile file = new MockJNLPFile(LANG_COUNTRY_LOCALE); Parser parser = new Parser(file, null, root, defaultParser); List infoDescs = new ArrayList(); infoDescs.addAll(parser.getInfo(root)); Assert.assertTrue("Exactly one info desc should be found", infoDescs.size() == 1); file.setInfo(infoDescs); parser.checkForInformation(); } @Test public void testFallbackEmptyLocalizedTitleVendorLangCountryLocale() throws ParseException { String data = "\n" + " \n" + " Generalized_T\n" + " Generalized_V\n" + " \n" + " \n" + " English_T\n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " French_CA_utf8_T\n" + " French_CA_utf8_V\n" + " \n" + "\n"; Node root = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root.getNodeName()); MockJNLPFile file = new MockJNLPFile(LANG_COUNTRY_LOCALE); Parser parser = new Parser(file, null, root, defaultParser); List infoDescs = parser.getInfo(root); Assert.assertTrue("Exactly five info descs should be found", infoDescs.size() == 5); file.setInfo(infoDescs); Assert.assertEquals("Title should be `English_T' but wasn't", "English_T", file.getTitle()); Assert.assertEquals("Vendor should be `Generalized_V' but wasn't", "Generalized_V", file.getVendor()); parser.checkForInformation(); } @Test(expected = MissingInformationException.class) public void testMissingInfoLangLocale() throws ParseException { String data = "\n"; Node root = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root.getNodeName()); MockJNLPFile file = new MockJNLPFile(LANG_LOCALE); Parser parser = new Parser(file, null, root, defaultParser); parser.getInfo(root); } @Test(expected = MissingTitleException.class) public void testEmptyLocalizedInfoLangLocale() throws ParseException { String data = "\n" + " \n" + " \n" + "\n"; Node root = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root.getNodeName()); MockJNLPFile file = new MockJNLPFile(LANG_LOCALE); Parser parser = new Parser(file, null, root, defaultParser); List infoDescs = new ArrayList(); infoDescs.addAll(parser.getInfo(root)); Assert.assertTrue("Exactly one info desc should be found", infoDescs.size() == 1); file.setInfo(infoDescs); parser.checkForInformation(); } @Test(expected = MissingTitleException.class) public void testOneFullyLocalizedInfoLangLocale() throws ParseException { String data = "\n" + " \n" + " English_CA_utf8_T\n" + " English_CA_utf8_V\n" + " \n" + "\n"; Node root = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root.getNodeName()); MockJNLPFile file = new MockJNLPFile(LANG_LOCALE); Parser parser = new Parser(file, null, root, defaultParser); List infoDescs = parser.getInfo(root); Assert.assertTrue("Exactly one info desc should be found", infoDescs.size() == 1); file.setInfo(infoDescs); parser.checkForInformation(); } @Test(expected = MissingTitleException.class) public void testOneLangCountryLocalizedInfoLangLocale() throws ParseException { String data = "\n" + " \n" + " English_CA_T\n" + " English_CA_V\n" + " \n" + "\n"; Node root = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root.getNodeName()); MockJNLPFile file = new MockJNLPFile(LANG_LOCALE); Parser parser = new Parser(file, null, root, defaultParser); List infoDescs = parser.getInfo(root); Assert.assertTrue("Exactly one info desc should be found", infoDescs.size() == 1); file.setInfo(infoDescs); parser.checkForInformation(); } @Test public void testOneLangLocalizedInfoLangLocale() throws ParseException { String data = "\n" + " \n" + " Generalized_T\n" + " Generalized_V\n" + " \n" + " \n" + " English_T\n" + " English_V\n" + " \n" + "\n"; Node root = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root.getNodeName()); MockJNLPFile file = new MockJNLPFile(LANG_LOCALE); Parser parser = new Parser(file, null, root, defaultParser); List infoDescs = parser.getInfo(root); Assert.assertTrue("Exactly two info descs should be found", infoDescs.size() == 2); file.setInfo(infoDescs); Assert.assertEquals("Title should be `English_T' but wasn't", "English_T", file.getTitle()); Assert.assertEquals("Vendor should be `English_V' but wasn't", "English_V", file.getVendor()); } @Test public void testGeneralizedInfoLangLocale() throws ParseException { String data = "\n" + " \n" + " Generalized_T\n" + " Generalized_V\n" + " \n" + "\n"; Node root = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root.getNodeName()); MockJNLPFile file = new MockJNLPFile(LANG_LOCALE); Parser parser = new Parser(file, null, root, defaultParser); List infoDescs = parser.getInfo(root); Assert.assertTrue("Exactly one info desc should be found", infoDescs.size() == 1); file.setInfo(infoDescs); Assert.assertEquals("Title should be `Generalized_T' but wasn't", "Generalized_T", file.getTitle()); Assert.assertEquals("Vendor should be `Generalized_V' but wasn't", "Generalized_V", file.getVendor()); } @Test public void testTwoDifferentLocalizedInfoLangLocale() throws ParseException { String data = "\n" + " \n" + " Generalized_T\n" + " Generalized_V\n" + " \n" + " \n" + " English_T\n" + " English_V\n" + " \n" + " \n" + " French_T\n" + " French_V\n" + " \n" + "\n"; Node root = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root.getNodeName()); MockJNLPFile file = new MockJNLPFile(LANG_LOCALE); Parser parser = new Parser(file, null, root, defaultParser); List infoDescs = parser.getInfo(root); Assert.assertTrue("Exactly three info descs should be found", infoDescs.size() == 3); file.setInfo(infoDescs); Assert.assertEquals("Title should be `English_T' but wasn't", "English_T", file.getTitle()); Assert.assertEquals("Vendor should be `English_V' but wasn't", "English_V", file.getVendor()); } @Test public void testTwoLocalizedWithSameLangInfoLangLocale() throws ParseException { String data = "\n" + " \n" + " Generalized_T\n" + " Generalized_V\n" + " \n" + " \n" + " English_T\n" + " English_V\n" + " \n" + " \n" + " English_CA_T\n" + " English_CA_V\n" + " \n" + "\n"; Node root = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root.getNodeName()); MockJNLPFile file = new MockJNLPFile(LANG_LOCALE); Parser parser = new Parser(file, null, root, defaultParser); List infoDescs = parser.getInfo(root); Assert.assertTrue("Exactly three info descs should be found", infoDescs.size() == 3); file.setInfo(infoDescs); Assert.assertEquals("Title should be `English_T' but wasn't", "English_T", file.getTitle()); Assert.assertEquals("Vendor should be `English_V' but wasn't", "English_V", file.getVendor()); } @Test public void testTwoSameLangOneMissingTitleLangLocale() throws ParseException { String data = "\n" + " \n" + " Generalized_T\n" + " Generalized_V\n" + " \n" + " \n" + " English_T\n" + " \n" + "\n"; Node root = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root.getNodeName()); MockJNLPFile file = new MockJNLPFile(LANG_LOCALE); Parser parser = new Parser(file, null, root, defaultParser); List infoDescs = parser.getInfo(root); Assert.assertTrue("Exactly two info descs should be found", infoDescs.size() == 2); file.setInfo(infoDescs); Assert.assertEquals("Title should be `English_T' but wasn't", "English_T", file.getTitle()); Assert.assertEquals("Vendor should be `Generalized_V' but wasn't", "Generalized_V", file.getVendor()); } @Test(expected = MissingTitleException.class) public void testMissingTitleLangLocale() throws ParseException { String data = "\n" + " \n" + " Generalized_V\n" + " \n" + " \n" + " English_V\n" + " \n" + " \n" + " English_CA_V\n" + " \n" + "\n"; Node root = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root.getNodeName()); MockJNLPFile file = new MockJNLPFile(LANG_LOCALE); Parser parser = new Parser(file, null, root, defaultParser); List infoDescs = new ArrayList(); infoDescs.addAll(parser.getInfo(root)); Assert.assertTrue("Exactly three info descs should be found", infoDescs.size() == 3); file.setInfo(infoDescs); parser.checkForInformation(); } @Test(expected = MissingVendorException.class) public void testMissingVendorLangLocale() throws ParseException { String data = "\n" + " \n" + " Generalized_T\n" + " \n" + " \n" + " English_T\n" + " \n" + " \n" + " English_CA_T\n" + " \n" + "\n"; Node root = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root.getNodeName()); MockJNLPFile file = new MockJNLPFile(LANG_LOCALE); Parser parser = new Parser(file, null, root, defaultParser); List infoDescs = new ArrayList(); infoDescs.addAll(parser.getInfo(root)); Assert.assertTrue("Exactly three info descs should be found", infoDescs.size() == 3); file.setInfo(infoDescs); parser.checkForInformation(); } @Test(expected = MissingTitleException.class) public void testMissingLocalizedTitleLangLocale() throws ParseException { String data = "\n" + " \n" + " Generalized_V\n" + " \n" + " \n" + " English_CA_V\n" + " \n" + "\n"; Node root = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root.getNodeName()); MockJNLPFile file = new MockJNLPFile(LANG_LOCALE); Parser parser = new Parser(file, null, root, defaultParser); List infoDescs = new ArrayList(); infoDescs.addAll(parser.getInfo(root)); Assert.assertTrue("Exactly two info descs should be found", infoDescs.size() == 2); file.setInfo(infoDescs); parser.checkForInformation(); } @Test(expected = MissingVendorException.class) public void testMissingLocalizedVendorLangLocale() throws ParseException { String data = "\n" + " \n" + " Generalized_T\n" + " \n" + " \n" + " English_CA_T\n" + " \n" + "\n"; Node root = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root.getNodeName()); MockJNLPFile file = new MockJNLPFile(LANG_LOCALE); Parser parser = new Parser(file, null, root, defaultParser); List infoDescs = new ArrayList(); infoDescs.addAll(parser.getInfo(root)); Assert.assertTrue("Exactly two info descs should be found",infoDescs.size() == 2); file.setInfo(infoDescs); parser.checkForInformation(); } @Test(expected = MissingTitleException.class) public void testEmptyLocalizedTitleLangLocale() throws ParseException { String data = "\n" + " \n" + " \n" + " English_CA_utf8_V\n" + " \n" + "\n"; Node root = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root.getNodeName()); MockJNLPFile file = new MockJNLPFile(LANG_LOCALE); Parser parser = new Parser(file, null, root, defaultParser); List infoDescs = new ArrayList(); infoDescs.addAll(parser.getInfo(root)); Assert.assertTrue("Exactly one info desc should be found", infoDescs.size() == 1); file.setInfo(infoDescs); parser.checkForInformation(); } @Test(expected = MissingVendorException.class) public void testEmptyLocalizedVendorLangLocale() throws ParseException { String data = "\n" + " \n" + " English_CA_utf8_T\n" + " \n" + " \n" + "\n"; Node root = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root.getNodeName()); MockJNLPFile file = new MockJNLPFile(LANG_LOCALE); Parser parser = new Parser(file, null, root, defaultParser); List infoDescs = new ArrayList(); infoDescs.addAll(parser.getInfo(root)); Assert.assertTrue("Exactly one info desc should be found", infoDescs.size() == 1); file.setInfo(infoDescs); parser.checkForInformation(); } @Test public void testFallbackEmptyLocalizedTitleVendorLangLocale() throws ParseException { String data = "\n" + " \n" + " Generalized_T\n" + " Generalized_V\n" + " \n" + " \n" + " English_T\n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " French_CA_utf8_T\n" + " French_CA_utf8_V\n" + " \n" + "\n"; Node root = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root.getNodeName()); MockJNLPFile file = new MockJNLPFile(LANG_LOCALE); Parser parser = new Parser(file, null, root, defaultParser); List infoDescs = parser.getInfo(root); Assert.assertTrue("Exactly five info descs should be found", infoDescs.size() == 5); file.setInfo(infoDescs); Assert.assertEquals("Title should be `English_T' but wasn't", "English_T", file.getTitle()); Assert.assertEquals("Vendor should be `Generalized_V' but wasn't", "Generalized_V", file.getVendor()); parser.checkForInformation(); } @Test public void testOverwrittenCodebaseWithValidJnlpCodebase() throws Exception { String data = "\n" + "\n" + ""; Node root = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root.getNodeName()); URL overwrittenCodebase = new URL("http://icedtea.classpath.org"); MockJNLPFile file = new MockJNLPFile(LANG_LOCALE); Parser parser = new Parser(file, null, root, defaultParser, overwrittenCodebase); Assert.assertEquals("http://www.redhat.com/", parser.getCodeBase().toExternalForm()); } @Test public void testOverwrittenCodebaseWithInvalidJnlpCodebase() throws Exception { String data = "\n" + "\n" + ""; Node root = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root.getNodeName()); URL overwrittenCodebase = new URL("http://icedtea.classpath.org"); MockJNLPFile file = new MockJNLPFile(LANG_LOCALE); Parser parser = new Parser(file, null, root, defaultParser, overwrittenCodebase); Assert.assertEquals(overwrittenCodebase.toExternalForm(), parser.getCodeBase().toExternalForm()); } @Test public void testOverwrittenCodebaseWithNoJnlpCodebase() throws Exception { String data = "\n" + "\n" + ""; Node root = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root.getNodeName()); URL overwrittenCodebase = new URL("http://icedtea.classpath.org"); MockJNLPFile file = new MockJNLPFile(LANG_LOCALE); Parser parser = new Parser(file, null, root, defaultParser, overwrittenCodebase); Assert.assertEquals(overwrittenCodebase.toExternalForm(), parser.getCodeBase().toExternalForm()); } @Test public void testEmptyCodebase() throws Exception { String data = "\n" + "\n" + ""; Node root = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root.getNodeName()); MockJNLPFile file = new MockJNLPFile(LANG_LOCALE); Parser parser = new Parser(file, null, root, defaultParser, null); ParseException eex = null; //non codebase element is unaffected URL u = parser.getURL(root, "aaa", null); Assert.assertEquals(null, u); try { parser.getURL(root, "codebase", null); } catch (ParseException ex) { eex = ex; } Assert.assertEquals(true, eex != null); Assert.assertEquals(true, eex instanceof ParseException); } @Test public void testNullMainClassApplication() throws Exception { String data = "\n" + "\n" + "\n" + "\n" + ""; Node root1 = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root1.getNodeName()); MockJNLPFile file1 = new MockJNLPFile(LANG_LOCALE); Parser parser1 = new Parser(file1, null, root1, defaultParser, null); String main1 = parser1.getLauncher(root1).getMainClass(); Assert.assertEquals(null, main1); //strict also ok Node root2 = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), strictParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root2.getNodeName()); MockJNLPFile file2 = new MockJNLPFile(LANG_LOCALE); Parser parser2 = new Parser(file2, null, root2, defaultParser, null); String main2 = parser2.getLauncher(root2).getMainClass(); Assert.assertEquals(null, main2); } @Test public void testNullMainClassInstaller() throws Exception { String data = "\n" + "\n" + "\n" + "\n" + ""; Node root1 = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root1.getNodeName()); MockJNLPFile file1 = new MockJNLPFile(LANG_LOCALE); Parser parser1 = new Parser(file1, null, root1, defaultParser, null); String main1 = parser1.getLauncher(root1).getMainClass(); Assert.assertEquals(null, main1); //strict also ok Node root2 = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), strictParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root2.getNodeName()); MockJNLPFile file2 = new MockJNLPFile(LANG_LOCALE); Parser parser2 = new Parser(file2, null, root2, strictParser, null); String main2 = parser2.getLauncher(root2).getMainClass(); Assert.assertEquals(null, main2); } @Test(expected = ParseException.class) public void testNullMainClassApplet() throws Exception { String data = "\n" + "\n" + "\n" + "\n" + ""; Node root1 = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root1.getNodeName()); MockJNLPFile file1 = new MockJNLPFile(LANG_LOCALE); Parser parser1 = new Parser(file1, null, root1, defaultParser, null); parser1.getLauncher(root1).getMainClass(); //both throw } @Test public void testOkMainClassApplication() throws Exception { String data = "\n" + "\n" + "\n" + "\n" + ""; Node root1 = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root1.getNodeName()); MockJNLPFile file1 = new MockJNLPFile(LANG_LOCALE); Parser parser1 = new Parser(file1, null, root1, defaultParser, null); String main1 = parser1.getLauncher(root1).getMainClass(); Assert.assertEquals("some.main.class", main1); //strict also ok Node root2 = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), strictParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root2.getNodeName()); MockJNLPFile file2 = new MockJNLPFile(LANG_LOCALE); Parser parser2 = new Parser(file2, null, root2, strictParser, null); String main2 = parser2.getLauncher(root2).getMainClass(); Assert.assertEquals("some.main.class", main2); } @Test(expected = ParseException.class) public void testNeedToBeTrimmed1MainClassApplication() throws Exception { String data = "\n" + "\n" + "\n" + "\n" + ""; Node root1 = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root1.getNodeName()); MockJNLPFile file1 = new MockJNLPFile(LANG_LOCALE); Parser parser1 = new Parser(file1, null, root1, defaultParser, null); String main1 = parser1.getLauncher(root1).getMainClass(); Assert.assertEquals("some.main.class", main1); //strict throws Node root2 = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), strictParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root2.getNodeName()); MockJNLPFile file2 = new MockJNLPFile(LANG_LOCALE); Parser parser2 = new Parser(file2, null, root2, strictParser, null); parser2.getLauncher(root2).getMainClass(); } @Test(expected = ParseException.class) public void testNeedToBeTrimmed2MainClassApplication() throws Exception { String data = "\n" + "\n" + "\n" + "\n" + ""; Node root1 = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root1.getNodeName()); MockJNLPFile file1 = new MockJNLPFile(LANG_LOCALE); Parser parser1 = new Parser(file1, null, root1, defaultParser, null); String main1 = parser1.getLauncher(root1).getMainClass(); Assert.assertEquals("some.main.class", main1); //strict throws Node root2 = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), strictParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root2.getNodeName()); MockJNLPFile file2 = new MockJNLPFile(LANG_LOCALE); Parser parser2 = new Parser(file2, null, root2, strictParser, null); parser2.getLauncher(root2).getMainClass(); } @Test(expected = ParseException.class) public void testSpacesInsidePersistedMainClassApplication() throws Exception { String data = "\n" + "\n" + "\n" + "\n" + ""; Node root1 = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root1.getNodeName()); MockJNLPFile file1 = new MockJNLPFile(LANG_LOCALE); Parser parser1 = new Parser(file1, null, root1, defaultParser, null); String main1 = parser1.getLauncher(root1).getMainClass(); Assert.assertEquals("som e.main .class", main1); //strict throws Node root2 = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), strictParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root2.getNodeName()); MockJNLPFile file2 = new MockJNLPFile(LANG_LOCALE); Parser parser2 = new Parser(file2, null, root2, strictParser, null); parser2.getLauncher(root2).getMainClass(); } @Test(expected = ParseException.class) public void testSpacesAroundDots() throws Exception { String data = "\n" + "\n" + "\n" + "\n" + ""; Node root1 = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root1.getNodeName()); MockJNLPFile file1 = new MockJNLPFile(LANG_LOCALE); Parser parser1 = new Parser(file1, null, root1, defaultParser, null); String main1 = parser1.getLauncher(root1).getMainClass(); Assert.assertEquals("some . another . main .class. here", main1); //strict throws Node root2 = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), strictParser); Assert.assertEquals("Root name is not jnlp", "jnlp", root2.getNodeName()); MockJNLPFile file2 = new MockJNLPFile(LANG_LOCALE); Parser parser2 = new Parser(file2, null, root2, strictParser, null); parser2.getLauncher(root2).getMainClass(); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.17941/ParserSettingsTest.java0000644000000000000000000000013112654402377027277 xustar0030 mtime=1454507263.284431954 29 atime=1454507327.19257963 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/ParserSettingsTest.java0000644000175000002070000000747312654402377030036 0ustar00jvanekmock00000000000000/* ParserSettingsTest.java Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp; import net.sourceforge.jnlp.util.optionparser.OptionParser; import org.junit.Assert; import org.junit.Test; import net.sourceforge.jnlp.ParserSettings; public class ParserSettingsTest { @Test public void testDefaultSettings() { Assert.assertNotNull("Default parser settings should not be null", ParserSettings.getGlobalParserSettings()); } @Test public void testSetGlobalParserSettings() { ParserSettings globalSettings, settings; settings = new ParserSettings(false, false, false); ParserSettings.setGlobalParserSettings(settings); globalSettings = ParserSettings.getGlobalParserSettings(); Assert.assertEquals(settings.isStrict(), globalSettings.isStrict()); Assert.assertEquals(settings.isMalformedXmlAllowed(), globalSettings.isMalformedXmlAllowed()); Assert.assertEquals(settings.isExtensionAllowed(), globalSettings.isExtensionAllowed()); } @Test public void testSetGlobalParserSettingsFromOptionParser() { String args[] = {"-xml", "-strict"}; OptionParser optionParser = new OptionParser(args, OptionsDefinitions.getJavaWsOptions()); ParserSettings settings = ParserSettings.setGlobalParserSettingsFromOptionParser(optionParser); ParserSettings globalSettings = ParserSettings.getGlobalParserSettings(); Assert.assertEquals(settings.isStrict(), globalSettings.isStrict()); Assert.assertEquals(settings.isExtensionAllowed(), globalSettings.isExtensionAllowed()); Assert.assertEquals(settings.isMalformedXmlAllowed(), globalSettings.isMalformedXmlAllowed()); } @Test public void testSetGlobalParserSettingsFromOptionParserHasSameOptionsAsOptionParser() { String args[] = {"-xml", "-strict"}; OptionParser optionParser = new OptionParser(args, OptionsDefinitions.getJavaWsOptions()); ParserSettings settings = ParserSettings.setGlobalParserSettingsFromOptionParser(optionParser); Assert.assertEquals(settings.isStrict(), optionParser.hasOption(OptionsDefinitions.OPTIONS.STRICT)); Assert.assertEquals(settings.isMalformedXmlAllowed(), !optionParser.hasOption(OptionsDefinitions.OPTIONS.XML)); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.17941/ParserMalformedXml.java0000644000000000000000000000013112654402377027226 xustar0030 mtime=1454507263.284431954 29 atime=1454507327.19257963 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/ParserMalformedXml.java0000644000175000002070000001227212654402377027756 0ustar00jvanekmock00000000000000/* ParserMalformedXml.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp; import java.io.BufferedReader; import java.io.ByteArrayInputStream; import java.io.InputStream; import java.io.InputStreamReader; import java.io.IOException; import net.sourceforge.jnlp.annotations.Bug; import net.sourceforge.jnlp.annotations.KnownToFail; import net.sourceforge.jnlp.util.FileUtils; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; /** Test how well the parser deals with malformed xml */ public class ParserMalformedXml { private static String originalJnlp = null; private static ParserSettings lenientParserSettings = new ParserSettings(false, true, true); @BeforeClass public static void setUp() throws IOException { ClassLoader cl = ParserMalformedXml.class.getClassLoader(); if (cl == null) { cl = ClassLoader.getSystemClassLoader(); } InputStream is = cl.getResourceAsStream("net/sourceforge/jnlp/basic.jnlp"); BufferedReader reader = new BufferedReader(new InputStreamReader(is)); StringBuilder jnlpBuilder = new StringBuilder(); String line; while ( (line = reader.readLine()) != null) { jnlpBuilder.append(line).append("\n"); } originalJnlp = jnlpBuilder.toString(); } @Test public void testMissingXmlDecleration() throws ParseException { String malformedJnlp = originalJnlp.replaceFirst("<\\?xml.*\\?>", ""); Parser.getRootNode(new ByteArrayInputStream(malformedJnlp.getBytes()), lenientParserSettings); } @Test @KnownToFail public void testMalformedArguments() throws ParseException { String malformedJnlp = originalJnlp.replace("arg2", ""); Parser.getRootNode(new ByteArrayInputStream(malformedJnlp.getBytes()), lenientParserSettings); } @Test public void testUnquotedAttributes() throws ParseException { String malformedJnlp = originalJnlp.replace("'jnlp.jnlp'", "jnlp.jnlp"); Parser.getRootNode(new ByteArrayInputStream(malformedJnlp.getBytes()), lenientParserSettings); } @Test(expected = ParseException.class) public void testTagNotClosedNoTagSoup() throws ParseException { String malformedJnlp = originalJnlp.replace("", ""); Parser.getRootNode(new ByteArrayInputStream(malformedJnlp.getBytes()), new ParserSettings(false, true, false)); } @Test(expected = ParseException.class) public void testUnquotedAttributesNoTagSoup() throws ParseException { String malformedJnlp = originalJnlp.replace("'jnlp.jnlp'", "jnlp.jnlp"); Parser.getRootNode(new ByteArrayInputStream(malformedJnlp.getBytes()), new ParserSettings(false, true, false)); } @Bug(id = "PR2690") @Test public void testXmlBomTagSoupOff() throws ParseException { InputStream is = ClassLoader.getSystemClassLoader().getResourceAsStream("net/sourceforge/jnlp/templates/EFBBBF.jnlp"); Assert.assertNotNull(is); Parser.getRootNode(is, new ParserSettings(false, true, false)); } @Test public void testXmlBomTagSoupOn() throws ParseException { InputStream is = ClassLoader.getSystemClassLoader().getResourceAsStream("net/sourceforge/jnlp/templates/EFBBBF.jnlp"); Assert.assertNotNull(is); Parser.getRootNode(is, new ParserSettings(false, true, true)); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.17941/ParserCornerCases.java0000644000000000000000000000013112654402377027046 xustar0030 mtime=1454507263.284431954 29 atime=1454507327.19257963 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/ParserCornerCases.java0000644000175000002070000002626212654402377027602 0ustar00jvanekmock00000000000000/* ParserCornerCases.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.io.StringReader; import net.sourceforge.jnlp.annotations.KnownToFail; import net.sourceforge.nanoxml.XMLElement; import net.sourceforge.nanoxml.XMLParseException; import org.junit.Assert; import org.junit.Test; /** Test various corner cases of the parser */ public class ParserCornerCases { private static final ParserSettings defaultParser = new ParserSettings(false, true,true); @Test public void testCdata() throws ParseException, XMLParseException, IOException { String data = " value ]]>"; XMLElement elem = new XMLElement(); elem.parseFromReader(new StringReader(data)); XMLElement target = elem; Assert.assertEquals("argument", target.getName()); Assert.assertTrue("too small", target.getContent().length() > 20); Assert.assertTrue(target.getContent().contains("xml")); Assert.assertTrue(target.getContent().contains("DOCTYPE")); Assert.assertTrue(target.getContent().contains("value")); Node node = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); Assert.assertEquals("argument", node.getNodeName()); String contents = node.getNodeValue(); Assert.assertTrue(contents.contains("xml")); Assert.assertTrue(contents.contains("DOCTYPE")); Assert.assertTrue(contents.contains("value")); } @Test public void testCdataNested() throws ParseException, XMLParseException, IOException { String data = "\n" + "\n" + "\n" + " value ]]>" + "\n" + "1\n" + "\n" + ""; XMLElement elem = new XMLElement(); elem.parseFromReader(new StringReader(data)); XMLElement target = (elem.enumerateChildren().nextElement()).enumerateChildren().nextElement(); Assert.assertEquals("argument", target.getName()); Assert.assertTrue("too small", target.getContent().length() > 20); Assert.assertTrue(target.getContent().contains("xml")); Assert.assertTrue(target.getContent().contains("DOCTYPE")); Assert.assertTrue(target.getContent().contains("value")); Node node = Parser.getRootNode(new ByteArrayInputStream(data.getBytes()), defaultParser); node = node.getFirstChild().getFirstChild(); Assert.assertEquals("argument", node.getNodeName()); String contents = node.getNodeValue(); Assert.assertTrue(contents.contains("xml")); Assert.assertTrue(contents.contains("DOCTYPE")); Assert.assertTrue(contents.contains("value")); } @Test @KnownToFail public void testCDataFirstChild() throws XMLParseException, IOException { String xml = "\n" + "\n" + " random tag test ]]>\n" + "\n" + ""; XMLElement elem = new XMLElement(); elem.parseFromReader(new StringReader(xml)); } @Test @KnownToFail public void testCDataSecondChild() throws XMLParseException, IOException { String xml = "\n" + "\n" + "\n" + " random tag test ]]>\n" + ""; XMLElement elem = new XMLElement(); elem.parseFromReader(new StringReader(xml)); } @Test public void testUnsupportedSpecNumber() throws ParseException { String malformedJnlp = ""; Node root = Parser.getRootNode(new ByteArrayInputStream(malformedJnlp.getBytes()), defaultParser); Parser parser = new Parser(null, null, root, defaultParser); Assert.assertEquals("11.11", parser.getSpecVersion().toString()); } @Test public void testApplicationAndComponent() throws ParseException { String malformedJnlp = ""; Node root = Parser.getRootNode(new ByteArrayInputStream(malformedJnlp.getBytes()), defaultParser); Parser parser = new Parser(null, null, root, defaultParser); Assert.assertNotNull(parser.getLauncher(root)); } @Test public void testCommentInElements() throws ParseException { String malformedJnlp = "> "; Node root = Parser.getRootNode(new ByteArrayInputStream(malformedJnlp.getBytes()), defaultParser); Parser p = new Parser(null, null, root, defaultParser); Assert.assertEquals("1.0", p.getSpecVersion().toString()); } @Test public void testNestedComments() throws ParseException { String malformedJnlp = "" + "testNestedComments" + "IcedTea" + " -->" + ""; Node root = Parser.getRootNode(new ByteArrayInputStream(malformedJnlp.getBytes()), defaultParser); Parser p = new Parser(null, null, root, defaultParser); Assert.assertEquals(" -->", p.getInfo(root).get(0).getDescription()); } @Test public void testDoubleDashesInComments() throws ParseException { String malformedJnlp = "" + " \n" + " " + ""; Node root = Parser.getRootNode(new ByteArrayInputStream(malformedJnlp.getBytes()), defaultParser); Parser p = new Parser(null, null, root, defaultParser); } @Test public void testCommentInElements2() throws ParseException { String malformedJnlp = " spec='1.0'> "; Node root = Parser.getRootNode(new ByteArrayInputStream(malformedJnlp.getBytes()), new ParserSettings(false, true,true)); Parser p = new Parser(null, null, root, defaultParser); //defaultis used Assert.assertEquals("1.0+", p.getSpecVersion().toString()); } @Test public void testCommentInElements2_malformedOff() throws ParseException { String malformedJnlp = " spec='1.0'> "; Node root = Parser.getRootNode(new ByteArrayInputStream(malformedJnlp.getBytes()), new ParserSettings(false, true,false)); Parser p = new Parser(null, null, root, defaultParser); Assert.assertEquals("1.0", p.getSpecVersion().toString()); } @Test public void testCommentInAttributes() throws ParseException { String malformedJnlp = ""; Node root = Parser.getRootNode(new ByteArrayInputStream(malformedJnlp.getBytes()), new ParserSettings(false, true,true)); Parser p = new Parser(null, null, root, defaultParser); Assert.assertEquals("", p.getSpecVersion().toString()); } @Test public void testCommentInAttributes_malformedOff() throws ParseException { String malformedJnlp = ""; Node root = Parser.getRootNode(new ByteArrayInputStream(malformedJnlp.getBytes()), new ParserSettings(false, true,false)); Parser p = new Parser(null, null, root, defaultParser); //defaultis used Assert.assertEquals("1.0+", p.getSpecVersion().toString()); } @Test public void testCommentInElements3_malformedOff() throws JNLPMatcherException, IOException, ParseException { //heving comment inside element declaration is invalid but internal parser can handle it try (InputStream fileStream = ClassLoader.getSystemClassLoader() .getResourceAsStream("net/sourceforge/jnlp/templates/template5.jnlp")) { Node root = Parser.getRootNode(fileStream, new ParserSettings(false, true, false)); String a = root.getChildNodes()[2].getAttribute("main-class"); Assert.assertEquals("*", a); } } @Test @KnownToFail public void testCommentInElements3_malformedOn() throws JNLPMatcherException, IOException, ParseException { //heving comment inside element declaration is invalid anyway, so tagsoup can be excused for failing in this case try (InputStream fileStream = ClassLoader.getSystemClassLoader() .getResourceAsStream("net/sourceforge/jnlp/templates/template5.jnlp")) { Node root = Parser.getRootNode(fileStream, new ParserSettings(false, true, true)); String a = root.getChildNodes()[2].getAttribute("main-class"); Assert.assertEquals("*", a); } } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.17941/ParserBasic.java0000644000000000000000000000013212654402377025661 xustar0030 mtime=1454507263.283431967 30 atime=1454507327.191579643 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/ParserBasic.java0000644000175000002070000002600412654402377026406 0ustar00jvanekmock00000000000000/* ParserBasic.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp; import java.io.InputStream; import java.util.List; import net.sourceforge.jnlp.mock.DummyJNLPFile; import net.sourceforge.jnlp.util.logging.NoStdOutErrTest; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; /** Test that the parser works with basic jnlp files */ public class ParserBasic extends NoStdOutErrTest{ private static Node root; private static Parser parser; @BeforeClass public static void setUp() throws ParseException { ClassLoader cl = ParserBasic.class.getClassLoader(); if (cl == null) { cl = ClassLoader.getSystemClassLoader(); } ParserSettings defaultParser = new ParserSettings(); InputStream jnlpStream = cl.getResourceAsStream("net/sourceforge/jnlp/basic.jnlp"); root = Parser.getRootNode(jnlpStream, defaultParser); parser = new Parser(new DummyJNLPFile(), null, root, defaultParser); } @Test public void testJNLP() { Assert.assertEquals("1.0", parser.getSpecVersion().toString()); Assert.assertEquals("http://localhost/", parser.getCodeBase().toString()); Assert.assertEquals("http://localhost/jnlp.jnlp", parser.getFileLocation().toString()); } @Test public void testInformation() throws ParseException { List infos = parser.getInfo(root); Assert.assertNotNull(infos); Assert.assertEquals(1, infos.size()); InformationDesc info = infos.get(0); Assert.assertNotNull(info); } @Test public void testInformationTitle() throws ParseException { InformationDesc info = parser.getInfo(root).get(0); Assert.assertEquals("Large JNLP", info.getTitle()); } @Test public void testInformationVendor() throws ParseException { InformationDesc info = parser.getInfo(root).get(0); Assert.assertEquals("The IcedTea Project", info.getVendor()); } @Test public void testInformationHomePage() throws ParseException { InformationDesc info = parser.getInfo(root).get(0); Assert.assertEquals("http://homepage/", info.getHomepage().toString()); } @Test public void testInformationDescription() throws ParseException { InformationDesc info = parser.getInfo(root).get(0); Assert.assertEquals("one-line", info.getDescription("one-line")); Assert.assertEquals("short", info.getDescription("short")); Assert.assertEquals("tooltip", info.getDescription("tooltip")); } @Test public void testInformationOfflineAllowed() throws ParseException { InformationDesc info = parser.getInfo(root).get(0); Assert.assertEquals(true, info.isOfflineAllowed()); } @Test public void testInformationIcon() throws ParseException { InformationDesc info = parser.getInfo(root).get(0); IconDesc[] icons = info.getIcons(IconDesc.DEFAULT); Assert.assertNotNull(icons); Assert.assertEquals(1, icons.length); IconDesc icon = icons[0]; Assert.assertNotNull(icon); Assert.assertEquals("http://localhost/icon.png", icon.getLocation().toString()); icons = info.getIcons(IconDesc.SPLASH); Assert.assertNotNull(icons); Assert.assertEquals(1, icons.length); icon = icons[0]; Assert.assertNotNull(icon); Assert.assertEquals("http://localhost/splash.png", icon.getLocation().toString()); } @Test public void testInformationShortcut() throws ParseException { InformationDesc info = parser.getInfo(root).get(0); ShortcutDesc shortcut = info.getShortcut(); Assert.assertNotNull(shortcut); Assert.assertTrue(shortcut.isOnlineValue()); Assert.assertTrue(shortcut.onDesktop()); MenuDesc menu = shortcut.getMenu(); Assert.assertNotNull(menu); Assert.assertEquals("submenu", menu.getSubMenu()); } @Test public void testInformationAssociation() throws ParseException { InformationDesc info = parser.getInfo(root).get(0); AssociationDesc[] associations = info.getAssociations(); Assert.assertNotNull(associations); Assert.assertEquals(1, associations.length); AssociationDesc association = associations[0]; Assert.assertNotNull(association); String[] extensions = association.getExtensions(); Assert.assertNotNull(extensions); Assert.assertEquals(1, extensions.length); String extension = extensions[0]; Assert.assertNotNull(extension); Assert.assertEquals("*.foo", extension); String mimeType = association.getMimeType(); Assert.assertNotNull(mimeType); Assert.assertEquals("foo/bar", mimeType); } @Test public void testInformationRelatedContent() throws ParseException { InformationDesc info = parser.getInfo(root).get(0); RelatedContentDesc[] relatedContents = info.getRelatedContents(); Assert.assertNotNull(relatedContents); Assert.assertEquals(1, relatedContents.length); RelatedContentDesc relatedContent = relatedContents[0]; Assert.assertNotNull(relatedContent); Assert.assertEquals("related-content title", relatedContent.getTitle()); Assert.assertNotNull(relatedContent.getLocation()); Assert.assertEquals("http://related-content/", relatedContent.getLocation().toString()); Assert.assertEquals("decription of related-content", relatedContent.getDescription()); IconDesc relatedIcon = relatedContent.getIcon(); Assert.assertNotNull(relatedIcon.getLocation()); Assert.assertEquals("http://localhost/related-content-icon.png", relatedIcon.getLocation().toString()); } @Test public void testSecurity() throws ParseException { SecurityDesc security = parser.getSecurity(root); Assert.assertNotNull(security); Assert.assertEquals(SecurityDesc.ALL_PERMISSIONS, security.getSecurityType()); } @Test public void testResources() throws ParseException { List allResources = parser.getResources(root, false); Assert.assertNotNull(allResources); Assert.assertEquals(1, allResources.size()); ResourcesDesc resources = allResources.get(0); Assert.assertNotNull(resources); } @Test public void testResourcesJava() throws ParseException { ResourcesDesc resources = parser.getResources(root, false).get(0); JREDesc[] jres = resources.getJREs(); Assert.assertNotNull(jres); Assert.assertEquals(1, jres.length); JREDesc jre = jres[0]; Assert.assertNotNull(jre); Assert.assertEquals("1.3+", jre.getVersion().toString()); Assert.assertEquals("http://java-url/", jre.getLocation().toString()); Assert.assertEquals("64m", jre.getInitialHeapSize()); Assert.assertEquals("128m", jre.getMaximumHeapSize()); } @Test public void testResourcesJar() throws ParseException { ResourcesDesc resources = parser.getResources(root, false).get(0); boolean foundNative = false; boolean foundEager = false; boolean foundLazy = false; JARDesc[] jars = resources.getJARs(); Assert.assertEquals(3, jars.length); for (int i = 0; i < jars.length; i++) { if (jars[i].isNative()) { foundNative = true; Assert.assertEquals("http://localhost/native.jar", jars[i].getLocation().toString()); } else if (jars[i].isEager()) { foundEager = true; Assert.assertEquals("http://localhost/eager.jar", jars[i].getLocation().toString()); } else if (jars[i].isLazy()) { foundLazy = true; Assert.assertEquals("http://localhost/lazy.jar", jars[i].getLocation().toString()); } else { Assert.assertFalse(true); } } Assert.assertTrue(foundNative); Assert.assertTrue(foundLazy); Assert.assertTrue(foundEager); } @Test public void testResourcesExtensions() throws ParseException { ResourcesDesc resources = parser.getResources(root, false).get(0); ExtensionDesc[] extensions = resources.getExtensions(); Assert.assertNotNull(extensions); Assert.assertEquals(1, extensions.length); ExtensionDesc extension = extensions[0]; Assert.assertNotNull(extension); Assert.assertEquals("http://extension/", extension.getLocation().toString()); Assert.assertEquals("extension", extension.getName()); Assert.assertEquals("0.1.1", extension.getVersion().toString()); } @Test public void testResourcesProperty() throws ParseException { ResourcesDesc resources = parser.getResources(root, false).get(0); PropertyDesc[] properties = resources.getProperties(); Assert.assertNotNull(properties); Assert.assertEquals(1, properties.length); PropertyDesc property = properties[0]; Assert.assertNotNull(property); Assert.assertEquals("key", property.getKey()); Assert.assertEquals("value", property.getValue()); } @Test public void testApplication() throws ParseException { ApplicationDesc app = (ApplicationDesc) parser.getLauncher(root); Assert.assertNotNull(app); Assert.assertEquals("MainClass", app.getMainClass()); Assert.assertArrayEquals(new String[] { "arg1", "arg2" }, app.getArguments()); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.17941/LaunchExceptionTest.java0000644000000000000000000000013212654402377027414 xustar0030 mtime=1454507263.283431967 30 atime=1454507327.191579643 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/LaunchExceptionTest.java0000644000175000002070000000546112654402377030145 0ustar00jvanekmock00000000000000/* LaunchExceptionTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import java.io.ByteArrayOutputStream; import java.io.PrintStream; import org.junit.Test; public class LaunchExceptionTest { @Test public void testPrintStackTrace() { NullPointerException cause = new NullPointerException("test"); LaunchException exception = new LaunchException(null, cause, "severe", "category", "test exception", "test description"); ByteArrayOutputStream baos = new ByteArrayOutputStream(); exception.printStackTrace(new PrintStream(baos)); String output = baos.toString(); assertNotNull(output); assertFalse(output.trim().length() == 0); assertTrue(output.contains("LaunchException: severe: category: test exception test description")); assertTrue(output.contains("NullPointerException: test")); int causedByAt = output.indexOf("Caused by:"); assertTrue(causedByAt != -1); causedByAt = output.indexOf("Caused by:", causedByAt+1); assertTrue(causedByAt == -1); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.17941/JREDescTest.java0000644000000000000000000000013212654402377025542 xustar0030 mtime=1454507263.283431967 30 atime=1454507327.191579643 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/JREDescTest.java0000644000175000002070000001323212654402377026266 0ustar00jvanekmock00000000000000/* Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp; import org.junit.Assert; import org.junit.Test; public class JREDescTest { @Test public void testNulls() throws ParseException { JREDesc a = new JREDesc(null, null, null, null, null, null); } @Test public void testInitialHeapSize() throws ParseException { JREDesc a = new JREDesc(null, null, null, "1", null, null); a = new JREDesc(null, null, null, "99999999", null, null); a = new JREDesc(null, null, null, "1k", null, null); a = new JREDesc(null, null, null, "1000k", null, null); a = new JREDesc(null, null, null, "1K", null, null); a = new JREDesc(null, null, null, "1000K", null, null); a = new JREDesc(null, null, null, "1m", null, null); a = new JREDesc(null, null, null, "1m", null, null); a = new JREDesc(null, null, null, "1M", null, null); a = new JREDesc(null, null, null, "1g", null, null); a = new JREDesc(null, null, null, "1G", null, null); a = new JREDesc(null, null, null, "10000G", null, null); } @Test public void testMaximumHeapSize() throws ParseException { JREDesc a = new JREDesc(null, null, null, null, "1", null); a = new JREDesc(null, null, null, null, "99999999", null); a = new JREDesc(null, null, null, null, "1k", null); a = new JREDesc(null, null, null, null, "1000k", null); a = new JREDesc(null, null, null, null, "1K", null); a = new JREDesc(null, null, null, null, "1000K", null); a = new JREDesc(null, null, null, null, "1m", null); a = new JREDesc(null, null, null, null, "1m", null); a = new JREDesc(null, null, null, null, "1M", null); a = new JREDesc(null, null, null, null, "1g", null); a = new JREDesc(null, null, null, null, "1G", null); a = new JREDesc(null, null, null, null, "10000G", null); } @Test(expected = ParseException.class) public void testInitialHeapSizeBad() throws ParseException { JREDesc a = new JREDesc(null, null, null, "blah", null, null); } @Test(expected = ParseException.class) public void testMaximumHeapSizeBad() throws ParseException { JREDesc a = new JREDesc(null, null, null, null, "blah", null); } @Test public void checkHeapSize() throws ParseException { String s = JREDesc.checkHeapSize(null); Assert.assertEquals(null, s); s = JREDesc.checkHeapSize("0"); Assert.assertEquals("0", s); s = JREDesc.checkHeapSize(" 0k"); Assert.assertEquals("0k", s); s = JREDesc.checkHeapSize("1 "); Assert.assertEquals("1", s); s = JREDesc.checkHeapSize("10"); Assert.assertEquals("10", s); s = JREDesc.checkHeapSize(" 1k"); Assert.assertEquals("1k", s); s = JREDesc.checkHeapSize("10m "); Assert.assertEquals("10m", s); s = JREDesc.checkHeapSize("0"); Assert.assertEquals("0", s); s = JREDesc.checkHeapSize(" 0K"); Assert.assertEquals("0K", s); s = JREDesc.checkHeapSize("1 "); Assert.assertEquals("1", s); s = JREDesc.checkHeapSize("10"); Assert.assertEquals("10", s); s = JREDesc.checkHeapSize(" 1M"); Assert.assertEquals("1M", s); s = JREDesc.checkHeapSize("10G "); Assert.assertEquals("10G", s); s = JREDesc.checkHeapSize("99K"); Assert.assertEquals("99K", s); } @Test(expected = ParseException.class) public void checkHeapSizeBad1() throws ParseException { JREDesc.checkHeapSize("10k10m"); } @Test(expected = ParseException.class) public void checkHeapSizeBad2() throws ParseException { JREDesc.checkHeapSize("one gigabyte"); } @Test(expected = ParseException.class) public void checkHeapSizeBad3() throws ParseException { JREDesc.checkHeapSize("99l"); } @Test(expected = ParseException.class) public void checkHeapSizeBad4() throws ParseException { JREDesc.checkHeapSize("99KK"); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.17941/JNLPMatcherTestMallformedAll0000644000000000000000000000013212654402377030106 xustar0030 mtime=1454507263.283431967 30 atime=1454507327.191579643 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/JNLPMatcherTestMallformedAllowed.java0000644000175000002070000004024212654402377032432 0ustar00jvanekmock00000000000000/* JNLPMatcherTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.io.UnsupportedEncodingException; import java.util.Random; import net.sourceforge.jnlp.annotations.KnownToFail; import org.junit.Assert; import org.junit.Test; public class JNLPMatcherTestMallformedAllowed { final String tests[] = JNLPMatcherTest.tests; private final ClassLoader cl = ClassLoader.getSystemClassLoader(); private final boolean MALLFORMED_ALLOWED = true; private InputStream getLaunchReader() { return cl.getResourceAsStream("net/sourceforge/jnlp/launchApp.jnlp"); } @Test @KnownToFail public void testTemplateCDATA() throws JNLPMatcherException, IOException { try (InputStream launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/templates/template0.jnlp")) { JNLPMatcher test = new JNLPMatcher(fileStream, launchReader, true, new ParserSettings(true, true, MALLFORMED_ALLOWED)); Assert.assertEquals(tests[0], true, test.isMatch()); } } @Test public void testTemplateDuplicate() throws JNLPMatcherException, IOException { try (InputStream launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/templates/template1.jnlp")) { JNLPMatcher test = new JNLPMatcher(fileStream, launchReader, true, new ParserSettings(true, true, MALLFORMED_ALLOWED)); Assert.assertEquals(tests[1], true, test.isMatch()); } } @Test public void testTemplateWildCharsRandom() throws JNLPMatcherException, IOException { try (InputStream launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/templates/template2.jnlp")) { JNLPMatcher test = new JNLPMatcher(fileStream, launchReader, true, new ParserSettings(true, true, MALLFORMED_ALLOWED)); Assert.assertEquals(tests[2], true, test.isMatch()); } } @Test public void testTemplateDifferentOrder() throws JNLPMatcherException, IOException { try (InputStream launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/templates/template3.jnlp")) { JNLPMatcher test = new JNLPMatcher(fileStream, launchReader, true, new ParserSettings(true, true, MALLFORMED_ALLOWED)); Assert.assertEquals(tests[3], true, test.isMatch()); } } @Test public void testTemplateWildCharsAsAllValues() throws JNLPMatcherException, IOException { try (InputStream launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/templates/template4.jnlp")) { JNLPMatcher test = new JNLPMatcher(fileStream, launchReader, true, new ParserSettings(true, true, MALLFORMED_ALLOWED)); Assert.assertEquals(tests[4], true, test.isMatch()); } } @Test @KnownToFail public void testTemplateComments() throws JNLPMatcherException, IOException { //heving comment inside element declaration is invalid anyway, so tagsoup can be excused for failing in this case try (InputStream launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/templates/template5.jnlp")) { JNLPMatcher test = new JNLPMatcher(fileStream, launchReader, true, new ParserSettings(true, true, MALLFORMED_ALLOWED)); Assert.assertEquals(tests[5], true, test.isMatch()); } } @Test public void testTemplateDifferentValues() throws JNLPMatcherException, IOException { try (InputStream launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/templates/template6.jnlp")) { JNLPMatcher test = new JNLPMatcher(fileStream, launchReader, true, new ParserSettings(true, true, MALLFORMED_ALLOWED)); Assert.assertEquals(tests[6], false, test.isMatch()); } } @Test public void testTemplateExtraChild() throws JNLPMatcherException, IOException { try (InputStream launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/templates/template7.jnlp")) { JNLPMatcher test = new JNLPMatcher(fileStream, launchReader, true, new ParserSettings(true, true, MALLFORMED_ALLOWED)); Assert.assertEquals(tests[7], false, test.isMatch()); } } @Test public void testTemplateFewerChild() throws JNLPMatcherException, IOException { try (InputStream launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/templates/template8.jnlp")) { JNLPMatcher test = new JNLPMatcher(fileStream, launchReader, true, new ParserSettings(true, true, MALLFORMED_ALLOWED)); Assert.assertEquals(tests[8], false, test.isMatch()); } } @Test public void testTemplateDifferentFile() throws JNLPMatcherException, IOException { try (InputStream launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/templates/template9.jnlp")) { JNLPMatcher test = new JNLPMatcher(fileStream, launchReader, true, new ParserSettings(true, true, MALLFORMED_ALLOWED)); Assert.assertEquals(tests[9], false, test.isMatch()); } } @Test @KnownToFail public void testApplicationCDATA() throws JNLPMatcherException, IOException { try (InputStream launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/application/application0.jnlp")) { JNLPMatcher test = new JNLPMatcher(fileStream, launchReader, false, new ParserSettings(true, true, MALLFORMED_ALLOWED)); Assert.assertEquals(tests[10], true, test.isMatch()); } } @Test public void testApplicationDuplicate() throws JNLPMatcherException, IOException { try (InputStream launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/application/application1.jnlp")) { JNLPMatcher test = new JNLPMatcher(fileStream, launchReader, false, new ParserSettings(true, true, MALLFORMED_ALLOWED)); Assert.assertEquals(tests[11], true, test.isMatch()); } } @Test public void testApplicationDifferentOrder() throws JNLPMatcherException, IOException { try (InputStream launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/application/application2.jnlp")) { JNLPMatcher test = new JNLPMatcher(fileStream, launchReader, false, new ParserSettings(true, true, MALLFORMED_ALLOWED)); Assert.assertEquals(tests[12], true, test.isMatch()); } } @Test public void testApplicationComments() throws JNLPMatcherException, IOException { try (InputStream launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/application/application3.jnlp")) { JNLPMatcher test = new JNLPMatcher(fileStream, launchReader, false, new ParserSettings(true, true, MALLFORMED_ALLOWED)); Assert.assertEquals(tests[13], true, test.isMatch()); } } @Test public void testApplicationWildCharsRandom() throws JNLPMatcherException, IOException { try (InputStream launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/application/application4.jnlp")) { JNLPMatcher test = new JNLPMatcher(fileStream, launchReader, false, new ParserSettings(true, true, MALLFORMED_ALLOWED)); Assert.assertEquals(tests[14], false, test.isMatch()); } } @Test public void testApplicationDifferentCodebaseValue() throws JNLPMatcherException, IOException { try (InputStream launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/application/application5.jnlp")) { JNLPMatcher test = new JNLPMatcher(fileStream, launchReader, false, new ParserSettings(true, true, MALLFORMED_ALLOWED)); Assert.assertEquals(tests[15], false, test.isMatch()); } } @Test public void testApplicationExtraChild() throws JNLPMatcherException, IOException { try (InputStream launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/application/application6.jnlp")) { JNLPMatcher test = new JNLPMatcher(fileStream, launchReader, false, new ParserSettings(true, true, MALLFORMED_ALLOWED)); Assert.assertEquals(tests[16], false, test.isMatch()); } } @Test public void testApplicationFewerChild() throws JNLPMatcherException, IOException { try (InputStream launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/application/application7.jnlp")) { JNLPMatcher test = new JNLPMatcher(fileStream, launchReader, false, new ParserSettings(true, true, MALLFORMED_ALLOWED)); Assert.assertEquals(tests[17], false, test.isMatch()); } } @Test public void testApplicationDifferentFile() throws JNLPMatcherException, IOException { try (InputStream launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/application/application8.jnlp")) { JNLPMatcher test = new JNLPMatcher(fileStream, launchReader, false, new ParserSettings(true, true, MALLFORMED_ALLOWED)); Assert.assertEquals(tests[18], false, test.isMatch()); } } @SuppressWarnings("unused") @Test public void testNullJNLPFiles() throws IOException { Exception expectedException = null; InputStream fileStream; try (InputStream launchReader = this.getLaunchReader()) { fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/application/application8.jnlp"); try { JNLPMatcher test = new JNLPMatcher(null, launchReader, false, new ParserSettings(true, true, MALLFORMED_ALLOWED)); } catch (Exception e) { expectedException = e; } Assert.assertEquals( "Checking exception after trying to create an instance with null signed application/template reader", expectedException.getClass().getName(), "net.sourceforge.jnlp.JNLPMatcherException"); try { JNLPMatcher test = new JNLPMatcher(fileStream, null, false, new ParserSettings(true, true, MALLFORMED_ALLOWED)); } catch (Exception e) { expectedException = e; } Assert.assertEquals( "Checking exception after trying to create an instance with null launching JNLP file reader", expectedException.getClass().getName(), "net.sourceforge.jnlp.JNLPMatcherException"); try { JNLPMatcher test = new JNLPMatcher(null, null, false, new ParserSettings(true, true, MALLFORMED_ALLOWED)); } catch (Exception e) { expectedException = e; } Assert.assertEquals( "Checking exception after trying to create an instance with both readers being null", expectedException.getClass().getName(), "net.sourceforge.jnlp.JNLPMatcherException"); } fileStream.close(); } @Test public void testCallingMatchMultiple() throws JNLPMatcherException, IOException { // Check with application InputStream launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/application/application8.jnlp"); JNLPMatcher test = new JNLPMatcher(fileStream, launchReader, false, new ParserSettings(true, true, MALLFORMED_ALLOWED)); Assert.assertEquals(tests[19], false, test.isMatch()); Assert.assertEquals(tests[19], false, test.isMatch()); fileStream.close(); launchReader.close(); // Check with template launchReader = this.getLaunchReader(); fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/templates/template6.jnlp"); test = new JNLPMatcher(fileStream, launchReader, true, new ParserSettings(true, true, MALLFORMED_ALLOWED)); Assert.assertEquals(tests[19], false, test.isMatch()); Assert.assertEquals(tests[19], false, test.isMatch()); fileStream.close(); launchReader.close(); } @Test (timeout=5000 /*ms*/) public void testIsMatchDoesNotHangOnLargeData() throws JNLPMatcherException, UnsupportedEncodingException { /* construct an alphabet containing characters 'a' to 'z' */ final int ALPHABET_SIZE = 26; char[] alphabet = new char[ALPHABET_SIZE]; for (int i = 0; i < ALPHABET_SIZE; i++) { alphabet[i] = (char)('a' + i); } /* generate a long but random string using the alphabet */ final Random r = new Random(); final int STRING_SIZE = 1024 * 1024; // 1 MB StringBuilder descriptionBuilder = new StringBuilder(STRING_SIZE); for (int i = 0; i < STRING_SIZE; i++) { descriptionBuilder.append(alphabet[r.nextInt(ALPHABET_SIZE)]); } String longDescription = descriptionBuilder.toString(); String file = "\n" + " \n" + " JNLPMatcher hanges on large file size\n" + " IcedTea\n" + " " + longDescription + "\n" + " \n" + "\n"; InputStream reader1 = new ByteArrayInputStream(file.getBytes("utf-8")); InputStream reader2 = new ByteArrayInputStream(file.getBytes("utf-8")); JNLPMatcher matcher = new JNLPMatcher(reader1, reader2, false, new ParserSettings(true, true, MALLFORMED_ALLOWED)); Assert.assertTrue(matcher.isMatch()); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.17941/JNLPMatcherTest.java0000644000000000000000000000013212654402377026372 xustar0030 mtime=1454507263.282431981 30 atime=1454507327.191579643 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/JNLPMatcherTest.java0000644000175000002070000004305012654402377027117 0ustar00jvanekmock00000000000000/* JNLPMatcherTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.io.UnsupportedEncodingException; import java.util.Random; import net.sourceforge.jnlp.annotations.KnownToFail; import org.junit.Assert; import org.junit.Test; public class JNLPMatcherTest { static final String tests[] = { "Testing template with CDATA", "Testing template with an exact duplicate of the launching JNLP file", "Testing template with wildchars as attribute/element values", "Testing template with attributes/elements in different order", "Testing template with wildchars as ALL element/attribute values", "Testing template with comments", "Testing template with different attribute/element values", "Testing template by adding an additional children to element", "Testing template by removing children from element", "Testing template with a complete different JNLP template file ", "Testing application with CDATA", "Testing application with an exact duplicate of the launching JNLP file", "Testing application with the same element/attribute name and value pair in different orders", "Testing application with comments", "Testing application with wildchars as attribute/element values", "Testing application with a different codebase attribute value", "Testing application by adding additional children to element", "Testing application by removing children from element", "Testing application with a complete different JNLP application file", "Testing by calling JNLPMatcher.match() multiple times. Checking to see if the returns value is consistent" }; private final ClassLoader cl = ClassLoader.getSystemClassLoader(); private final boolean MALLFORMED_ALLOWED = false; private InputStream getLaunchReader() { return cl.getResourceAsStream("net/sourceforge/jnlp/launchApp.jnlp"); } @Test @KnownToFail public void testTemplateCDATA() throws JNLPMatcherException, IOException { try (InputStream launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/templates/template0.jnlp")) { JNLPMatcher test = new JNLPMatcher(fileStream, launchReader, true, new ParserSettings(true, true, MALLFORMED_ALLOWED)); Assert.assertEquals(tests[0], true, test.isMatch()); } } @Test public void testTemplateDuplicate() throws JNLPMatcherException, IOException { try (InputStream launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/templates/template1.jnlp")) { JNLPMatcher test = new JNLPMatcher(fileStream, launchReader, true, new ParserSettings(true, true, MALLFORMED_ALLOWED)); Assert.assertEquals(tests[1], true, test.isMatch()); } } @Test public void testTemplateWildCharsRandom() throws JNLPMatcherException, IOException { try (InputStream launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/templates/template2.jnlp")) { JNLPMatcher test = new JNLPMatcher(fileStream, launchReader, true, new ParserSettings(true, true, MALLFORMED_ALLOWED)); Assert.assertEquals(tests[2], true, test.isMatch()); } } @Test public void testTemplateDifferentOrder() throws JNLPMatcherException, IOException { try (InputStream launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/templates/template3.jnlp")) { JNLPMatcher test = new JNLPMatcher(fileStream, launchReader, true, new ParserSettings(true, true, MALLFORMED_ALLOWED)); Assert.assertEquals(tests[3], true, test.isMatch()); } } @Test public void testTemplateWildCharsAsAllValues() throws JNLPMatcherException, IOException { try (InputStream launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/templates/template4.jnlp")) { JNLPMatcher test = new JNLPMatcher(fileStream, launchReader, true, new ParserSettings(true, true, MALLFORMED_ALLOWED)); Assert.assertEquals(tests[4], true, test.isMatch()); } } @Test public void testTemplateComments() throws JNLPMatcherException, IOException { //heving comment inside element declaration is invalid but internal parser can handle it try (InputStream launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/templates/template5.jnlp")) { JNLPMatcher test = new JNLPMatcher(fileStream, launchReader, true, new ParserSettings(true, true, MALLFORMED_ALLOWED)); Assert.assertEquals(tests[5], true, test.isMatch()); } } @Test public void testTemplateDifferentValues() throws JNLPMatcherException, IOException { try (InputStream launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/templates/template6.jnlp")) { JNLPMatcher test = new JNLPMatcher(fileStream, launchReader, true, new ParserSettings(true, true, MALLFORMED_ALLOWED)); Assert.assertEquals(tests[6], false, test.isMatch()); } } @Test public void testTemplateExtraChild() throws JNLPMatcherException, IOException { try (InputStream launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/templates/template7.jnlp")) { JNLPMatcher test = new JNLPMatcher(fileStream, launchReader, true, new ParserSettings(true, true, MALLFORMED_ALLOWED)); Assert.assertEquals(tests[7], false, test.isMatch()); } } @Test public void testTemplateFewerChild() throws JNLPMatcherException, IOException { try (InputStream launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/templates/template8.jnlp")) { JNLPMatcher test = new JNLPMatcher(fileStream, launchReader, true, new ParserSettings(true, true, MALLFORMED_ALLOWED)); Assert.assertEquals(tests[8], false, test.isMatch()); } } @Test public void testTemplateDifferentFile() throws JNLPMatcherException, IOException { try (InputStream launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/templates/template9.jnlp")) { JNLPMatcher test = new JNLPMatcher(fileStream, launchReader, true, new ParserSettings(true, true, MALLFORMED_ALLOWED)); Assert.assertEquals(tests[9], false, test.isMatch()); } } @Test @KnownToFail public void testApplicationCDATA() throws JNLPMatcherException, IOException { try (InputStream launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/application/application0.jnlp")) { JNLPMatcher test = new JNLPMatcher(fileStream, launchReader, false, new ParserSettings(true, true, MALLFORMED_ALLOWED)); Assert.assertEquals(tests[10], true, test.isMatch()); } } @Test public void testApplicationDuplicate() throws JNLPMatcherException, IOException { try (InputStream launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/application/application1.jnlp")) { JNLPMatcher test = new JNLPMatcher(fileStream, launchReader, false, new ParserSettings(true, true, MALLFORMED_ALLOWED)); Assert.assertEquals(tests[11], true, test.isMatch()); } } @Test public void testApplicationDifferentOrder() throws JNLPMatcherException, IOException { try (InputStream launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/application/application2.jnlp")) { JNLPMatcher test = new JNLPMatcher(fileStream, launchReader, false, new ParserSettings(true, true, MALLFORMED_ALLOWED)); Assert.assertEquals(tests[12], true, test.isMatch()); } } @Test public void testApplicationComments() throws JNLPMatcherException, IOException { try (InputStream launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/application/application3.jnlp")) { JNLPMatcher test = new JNLPMatcher(fileStream, launchReader, false, new ParserSettings(true, true, MALLFORMED_ALLOWED)); Assert.assertEquals(tests[13], true, test.isMatch()); } } @Test public void testApplicationWildCharsRandom() throws JNLPMatcherException, IOException { try (InputStream launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/application/application4.jnlp")) { JNLPMatcher test = new JNLPMatcher(fileStream, launchReader, false, new ParserSettings(true, true, MALLFORMED_ALLOWED)); Assert.assertEquals(tests[14], false, test.isMatch()); } } @Test public void testApplicationDifferentCodebaseValue() throws JNLPMatcherException, IOException { try (InputStream launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/application/application5.jnlp")) { JNLPMatcher test = new JNLPMatcher(fileStream, launchReader, false, new ParserSettings(true, true, MALLFORMED_ALLOWED)); Assert.assertEquals(tests[15], false, test.isMatch()); } } @Test public void testApplicationExtraChild() throws JNLPMatcherException, IOException { try (InputStream launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/application/application6.jnlp")) { JNLPMatcher test = new JNLPMatcher(fileStream, launchReader, false, new ParserSettings(true, true, MALLFORMED_ALLOWED)); Assert.assertEquals(tests[16], false, test.isMatch()); } } @Test public void testApplicationFewerChild() throws JNLPMatcherException, IOException { try (InputStream launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/application/application7.jnlp")) { JNLPMatcher test = new JNLPMatcher(fileStream, launchReader, false, new ParserSettings(true, true, MALLFORMED_ALLOWED)); Assert.assertEquals(tests[17], false, test.isMatch()); } } @Test public void testApplicationDifferentFile() throws JNLPMatcherException, IOException { try (InputStream launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/application/application8.jnlp")) { JNLPMatcher test = new JNLPMatcher(fileStream, launchReader, false, new ParserSettings(true, true, MALLFORMED_ALLOWED)); Assert.assertEquals(tests[18], false, test.isMatch()); } } @SuppressWarnings("unused") @Test public void testNullJNLPFiles() throws IOException { Exception expectedException = null; InputStream fileStream; try (InputStream launchReader = this.getLaunchReader()) { fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/application/application8.jnlp"); try { JNLPMatcher test = new JNLPMatcher(null, launchReader, false, new ParserSettings(true, true, MALLFORMED_ALLOWED)); } catch (Exception e) { expectedException = e; } Assert.assertEquals( "Checking exception after trying to create an instance with null signed application/template reader", expectedException.getClass().getName(), "net.sourceforge.jnlp.JNLPMatcherException"); try { JNLPMatcher test = new JNLPMatcher(fileStream, null, false, new ParserSettings(true, true, MALLFORMED_ALLOWED)); } catch (Exception e) { expectedException = e; } Assert.assertEquals( "Checking exception after trying to create an instance with null launching JNLP file reader", expectedException.getClass().getName(), "net.sourceforge.jnlp.JNLPMatcherException"); try { JNLPMatcher test = new JNLPMatcher(null, null, false, new ParserSettings(true, true, MALLFORMED_ALLOWED)); } catch (Exception e) { expectedException = e; } Assert.assertEquals( "Checking exception after trying to create an instance with both readers being null", expectedException.getClass().getName(), "net.sourceforge.jnlp.JNLPMatcherException"); } fileStream.close(); } @Test public void testCallingMatchMultiple() throws JNLPMatcherException, IOException { // Check with application InputStream launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/application/application8.jnlp"); JNLPMatcher test = new JNLPMatcher(fileStream, launchReader, false, new ParserSettings(true, true, MALLFORMED_ALLOWED)); Assert.assertEquals(tests[19], false, test.isMatch()); Assert.assertEquals(tests[19], false, test.isMatch()); fileStream.close(); launchReader.close(); // Check with template launchReader = this.getLaunchReader(); fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/templates/template6.jnlp"); test = new JNLPMatcher(fileStream, launchReader, true, new ParserSettings(true, true, MALLFORMED_ALLOWED)); Assert.assertEquals(tests[19], false, test.isMatch()); Assert.assertEquals(tests[19], false, test.isMatch()); fileStream.close(); launchReader.close(); } @Test (timeout=5000 /*ms*/) public void testIsMatchDoesNotHangOnLargeData() throws JNLPMatcherException, UnsupportedEncodingException { /* construct an alphabet containing characters 'a' to 'z' */ final int ALPHABET_SIZE = 26; char[] alphabet = new char[ALPHABET_SIZE]; for (int i = 0; i < ALPHABET_SIZE; i++) { alphabet[i] = (char)('a' + i); } /* generate a long but random string using the alphabet */ final Random r = new Random(); final int STRING_SIZE = 1024 * 1024; // 1 MB StringBuilder descriptionBuilder = new StringBuilder(STRING_SIZE); for (int i = 0; i < STRING_SIZE; i++) { descriptionBuilder.append(alphabet[r.nextInt(ALPHABET_SIZE)]); } String longDescription = descriptionBuilder.toString(); String file = "\n" + " \n" + " JNLPMatcher hanges on large file size\n" + " IcedTea\n" + " " + longDescription + "\n" + " \n" + "\n"; InputStream reader1 = new ByteArrayInputStream(file.getBytes("utf-8")); InputStream reader2 = new ByteArrayInputStream(file.getBytes("utf-8")); JNLPMatcher matcher = new JNLPMatcher(reader1, reader2, false, new ParserSettings(true, true, MALLFORMED_ALLOWED)); Assert.assertTrue(matcher.isMatch()); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.17941/JNLPFileTest.java0000644000000000000000000000013212654402377025666 xustar0030 mtime=1454507263.282431981 30 atime=1454507327.191579643 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/JNLPFileTest.java0000644000175000002070000004404712654402377026422 0ustar00jvanekmock00000000000000/* JNLPFileTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp; import java.io.ByteArrayInputStream; import java.io.InputStream; import java.net.MalformedURLException; import java.net.URL; import java.util.Locale; import java.util.Map; import net.sourceforge.jnlp.JNLPFile.Match; import net.sourceforge.jnlp.annotations.Bug; import net.sourceforge.jnlp.mock.MockJNLPFile; import net.sourceforge.jnlp.util.logging.NoStdOutErrTest; import org.junit.Assert; import org.junit.Test; public class JNLPFileTest extends NoStdOutErrTest{ Locale jvmLocale = new Locale("en", "CA", "utf8"); MockJNLPFile file = new MockJNLPFile(jvmLocale); @Test public void testCompareAll() { Locale[] correctAvailable = { new Locale("en", "CA", "utf8") }; Assert.assertTrue("Entire locale should match but did not.", file.localeMatches(jvmLocale, correctAvailable, Match.LANG_COUNTRY_VARIANT)); Locale[] mismatchedAvailable = { new Locale("en", "CA", "utf16") }; Assert.assertFalse("Should not match variant but did.", file.localeMatches(jvmLocale, mismatchedAvailable, Match.LANG_COUNTRY_VARIANT)); } @Test public void testLangAndCountry() { Locale[] correctAvailable = { new Locale("en", "CA") }; Assert.assertTrue("Should match language and country, ignoring variant but did not.", file.localeMatches(jvmLocale, correctAvailable, Match.LANG_COUNTRY)); Locale[] mismatchedAvailable = { new Locale("en", "EN") }; Assert.assertFalse("Should not match country but did.", file.localeMatches(jvmLocale, mismatchedAvailable, Match.LANG_COUNTRY)); Locale[] extraMismatched = { new Locale("en", "CA", "utf16") }; Assert.assertFalse("Should not match because of extra variant but did.", file.localeMatches(jvmLocale, extraMismatched, Match.LANG_COUNTRY)); } @Test public void testLangOnly() { Locale[] correctAvailable = { new Locale("en") }; Assert.assertTrue("Should match only language but did not.", file.localeMatches(jvmLocale, correctAvailable, Match.LANG)); Locale[] mismatchedAvailable = { new Locale("fr", "CA", "utf8") }; Assert.assertFalse("Should not match language but did.", file.localeMatches(jvmLocale, mismatchedAvailable, Match.LANG)); Locale[] extraMismatched = { new Locale("en", "EN") }; Assert.assertFalse("Should not match because of extra country but did.", file.localeMatches(jvmLocale, extraMismatched, Match.LANG)); } @Test public void testNoLocalAvailable() { Assert.assertTrue("Null locales should match but did not.", file.localeMatches(jvmLocale, null, Match.GENERALIZED)); Locale[] emptyAvailable = {}; Assert.assertTrue("Empty locales list should match but did not.", file.localeMatches(jvmLocale, emptyAvailable, Match.GENERALIZED)); Locale[] mismatchAvailable = { new Locale("fr", "FR", "utf16") }; Assert.assertFalse("Locales list should not match generalized case but did.", file.localeMatches(jvmLocale, mismatchAvailable, Match.GENERALIZED)); } @Test public void testCodebaseConstructorWithInputstreamAndCodebase() throws Exception { String jnlpContext = "\n" + "\n" + "" + "\n" + "Sample Test\n" + "RedHat\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + ""; URL codeBase = new URL("http://www.redhat.com/"); InputStream is = new ByteArrayInputStream(jnlpContext.getBytes()); JNLPFile jnlpFile = new JNLPFile(is, codeBase, new ParserSettings(false,false,false)); Assert.assertEquals("http://icedtea.claspath.org/", jnlpFile.getCodeBase().toExternalForm()); Assert.assertEquals("redhat.embeddedjnlp", jnlpFile.getApplet().getMainClass()); Assert.assertEquals("Sample Test", jnlpFile.getTitle()); Assert.assertEquals(2, jnlpFile.getResources().getJARs().length); } @Test public void testPropertyRestrictions() throws MalformedURLException, ParseException { String jnlpContents = "\n" + "\n" + " \n" + " Parsing Test\n" + " IcedTea\n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " " + " \n" + " \n" + " " + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + ""; URL codeBase = new URL("http://www.redhat.com/"); InputStream is = new ByteArrayInputStream(jnlpContents.getBytes()); JNLPFile jnlpFile = new JNLPFile(is, codeBase, new ParserSettings(false,false,false)); ResourcesDesc resources; Map properties; resources = jnlpFile.getResources(Locale.getDefault(), "os0", "arch0"); properties = resources.getPropertiesMap(); Assert.assertEquals("general", properties.get("general")); Assert.assertEquals("general", properties.get("os")); Assert.assertEquals("general", properties.get("arch")); resources = jnlpFile.getResources(Locale.getDefault(), "os1", "arch0"); properties = resources.getPropertiesMap(); Assert.assertEquals("general", properties.get("general")); Assert.assertEquals("os1", properties.get("os")); Assert.assertEquals("general", properties.get("arch")); resources = jnlpFile.getResources(Locale.getDefault(), "os1", "arch1"); properties = resources.getPropertiesMap(); Assert.assertEquals("general", properties.get("general")); Assert.assertEquals("os1", properties.get("os")); Assert.assertEquals("arch1", properties.get("arch")); resources = jnlpFile.getResources(Locale.getDefault(), "os2", "arch2"); properties = resources.getPropertiesMap(); Assert.assertEquals("general", properties.get("general")); Assert.assertEquals("os2", properties.get("os")); Assert.assertEquals("arch2", properties.get("arch")); } @Bug(id={"PR1533"}) @Test public void testDownloadOptionsAppliedEverywhere() throws MalformedURLException, ParseException { String os = System.getProperty("os.name"); String arch = System.getProperty("os.arch"); String jnlpContents = "\n" + "\n" + " \n" + " Parsing Test\n" + " IcedTea\n" + " \n" + " \n" + " \n" + " " + " " + " \n" + " " + " " + " \n" + " " + " " + " \n" + " \n" + ""; URL codeBase = new URL("http://icedtea.classpath.org"); InputStream is = new ByteArrayInputStream(jnlpContents.getBytes()); JNLPFile jnlpFile = new JNLPFile(is, codeBase, new ParserSettings(false,false,false)); DownloadOptions downloadOptions = jnlpFile.getDownloadOptions(); Assert.assertTrue(downloadOptions.useExplicitPack()); Assert.assertTrue(downloadOptions.useExplicitVersion()); } @Bug(id={"PR1533"}) @Test public void testDownloadOptionsFilteredOut() throws MalformedURLException, ParseException { String jnlpContents = "\n" + "\n" + " \n" + " Parsing Test\n" + " IcedTea\n" + " \n" + " \n" + " \n" + " " + " " + " \n" + " " + " " + " \n" + " " + " " + " \n" + " \n" + ""; URL codeBase = new URL("http://icedtea.classpath.org"); InputStream is = new ByteArrayInputStream(jnlpContents.getBytes()); JNLPFile jnlpFile = new JNLPFile(is, codeBase, new ParserSettings(false,false,false)); DownloadOptions downloadOptions = jnlpFile.getDownloadOptions(); Assert.assertFalse(downloadOptions.useExplicitPack()); Assert.assertFalse(downloadOptions.useExplicitVersion()); } public static final String minimalJnlp = "\n" + "\n" + " \n" + " Parsing Test\n" + " IcedTea\n" + " \n" + "\n" + " \n" + "SECURITY" + ""; @Test public void testGetRequestedPermissionLevel1() throws MalformedURLException, ParseException { String jnlpContents = minimalJnlp.replace("SECURITY", ""); URL codeBase = new URL("http://icedtea.classpath.org"); InputStream is = new ByteArrayInputStream(jnlpContents.getBytes()); JNLPFile jnlpFile = new JNLPFile(is, codeBase, new ParserSettings(false, false, false)); Assert.assertEquals(SecurityDesc.RequestedPermissionLevel.NONE, jnlpFile.getRequestedPermissionLevel()); } @Test public void testGetRequestedPermissionLevel2() throws MalformedURLException, ParseException { String jnlpContents = minimalJnlp.replace("SECURITY", "<"+SecurityDesc.RequestedPermissionLevel.ALL.toJnlpString()+"/>"); URL codeBase = new URL("http://icedtea.classpath.org"); InputStream is = new ByteArrayInputStream(jnlpContents.getBytes()); JNLPFile jnlpFile = new JNLPFile(is, codeBase, new ParserSettings(false, false, false)); Assert.assertEquals(SecurityDesc.RequestedPermissionLevel.ALL, jnlpFile.getRequestedPermissionLevel()); } @Test public void testGetRequestedPermissionLevel3() throws MalformedURLException, ParseException { String jnlpContents = minimalJnlp.replace("SECURITY", ""); URL codeBase = new URL("http://icedtea.classpath.org"); InputStream is = new ByteArrayInputStream(jnlpContents.getBytes()); JNLPFile jnlpFile = new JNLPFile(is, codeBase, new ParserSettings(false, false, false)); Assert.assertEquals(SecurityDesc.RequestedPermissionLevel.NONE, jnlpFile.getRequestedPermissionLevel()); } @Test public void testGetRequestedPermissionLevel4() throws MalformedURLException, ParseException { String jnlpContents = minimalJnlp.replace("SECURITY", "whatever"); URL codeBase = new URL("http://icedtea.classpath.org"); InputStream is = new ByteArrayInputStream(jnlpContents.getBytes()); JNLPFile jnlpFile = new JNLPFile(is, codeBase, new ParserSettings(false, false, false)); Assert.assertEquals(SecurityDesc.RequestedPermissionLevel.NONE, jnlpFile.getRequestedPermissionLevel()); } @Test public void testGetRequestedPermissionLevel5() throws MalformedURLException, ParseException { String jnlpContents = minimalJnlp.replace("SECURITY", "<"+SecurityDesc.RequestedPermissionLevel.J2EE.toJnlpString()+"/>"); URL codeBase = new URL("http://icedtea.classpath.org"); InputStream is = new ByteArrayInputStream(jnlpContents.getBytes()); JNLPFile jnlpFile = new JNLPFile(is, codeBase, new ParserSettings(false, false, false)); Assert.assertEquals(SecurityDesc.RequestedPermissionLevel.J2EE, jnlpFile.getRequestedPermissionLevel()); } @Test //unknown for jnlp public void testGetRequestedPermissionLevel6() throws MalformedURLException, ParseException { String jnlpContents = minimalJnlp.replace("SECURITY", "<" + SecurityDesc.RequestedPermissionLevel.SANDBOX.toHtmlString() + "/>"); URL codeBase = new URL("http://icedtea.classpath.org"); InputStream is = new ByteArrayInputStream(jnlpContents.getBytes()); JNLPFile jnlpFile = new JNLPFile(is, codeBase, new ParserSettings(false, false, false)); Assert.assertEquals(SecurityDesc.RequestedPermissionLevel.NONE, jnlpFile.getRequestedPermissionLevel()); } @Test //unknown for jnlp public void testGetRequestedPermissionLevel7() throws MalformedURLException, ParseException { String jnlpContents = minimalJnlp.replace("SECURITY", "<" + SecurityDesc.RequestedPermissionLevel.DEFAULT.toHtmlString() + "/>"); URL codeBase = new URL("http://icedtea.classpath.org"); InputStream is = new ByteArrayInputStream(jnlpContents.getBytes()); JNLPFile jnlpFile = new JNLPFile(is, codeBase, new ParserSettings(false, false, false)); Assert.assertEquals(SecurityDesc.RequestedPermissionLevel.NONE, jnlpFile.getRequestedPermissionLevel()); } @Test public void splitEmptyEntryPointsReturnsTests() throws Exception { Assert.assertArrayEquals(null, JNLPFile.splitEntryPoints(" ")); Assert.assertArrayEquals(null, JNLPFile.splitEntryPoints(null)); } @Test public void ensureSingleEntryPointIsParsed() throws Exception { Assert.assertArrayEquals(new String[]{"a.b.c"}, JNLPFile.splitEntryPoints(" a.b.c ")); Assert.assertArrayEquals(new String[]{"a.b.c"}, JNLPFile.splitEntryPoints("a.b.c")); Assert.assertArrayEquals(new String[]{"a.b.c"}, JNLPFile.splitEntryPoints(" a.b.c")); Assert.assertArrayEquals(new String[]{"a.b.c"}, JNLPFile.splitEntryPoints("a.b.c ")); } @Test public void ensureMultipleEntryPointsAreParsed() throws Exception { Assert.assertArrayEquals(new String[]{"a.b.c", "cde"}, JNLPFile.splitEntryPoints(" a.b.c cde")); Assert.assertArrayEquals(new String[]{"a.b.c", "cde"}, JNLPFile.splitEntryPoints(" a.b.c cde ")); Assert.assertArrayEquals(new String[]{"a.b.c", "cde"}, JNLPFile.splitEntryPoints("a.b.c cde ")); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.17941/InformationDescTest.java0000644000000000000000000000013212654402377027407 xustar0030 mtime=1454507263.282431981 30 atime=1454507327.190579657 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/InformationDescTest.java0000644000175000002070000002105612654402377030136 0ustar00jvanekmock00000000000000/* InformationDescTest.java Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertSame; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import java.net.MalformedURLException; import java.net.URL; import java.util.Locale; import org.junit.Test; public class InformationDescTest { @Test public void testLocales() { InformationDesc info; info = new InformationDesc(new Locale[0]); assertArrayEquals(new Locale[0], info.getLocales()); Locale[] someLocales = new Locale[] { Locale.ENGLISH, Locale.FRENCH }; info = new InformationDesc(someLocales); assertArrayEquals(someLocales, info.getLocales()); } @Test public void testTitle() { InformationDesc info = new InformationDesc(new Locale[0]); info.addItem("title", "A Title"); assertEquals("A Title", info.getTitle()); } @Test public void testVendor() { InformationDesc info = new InformationDesc(new Locale[0]); info.addItem("vendor", "Some Vendor"); assertEquals("Some Vendor", info.getVendor()); } @Test public void testHomePage() throws MalformedURLException { URL url = new URL("http://some.home.page.example.com"); InformationDesc info = new InformationDesc(new Locale[0]); info.addItem("homepage", url); assertEquals(url, info.getHomepage()); } @Test public void testDescription() { InformationDesc info = new InformationDesc(new Locale[0]); info.addItem("description-" + InformationDesc.DEFAULT, "Default Description"); assertEquals("Default Description", info.getDescription()); } @Test public void testDescriptionFallbackOrder() { InformationDesc info = new InformationDesc(new Locale[0]); info.addItem("description-" + InformationDesc.TOOLTIP, "Tooltip Description"); assertEquals("Tooltip Description", info.getDescription()); info.addItem("description-" + InformationDesc.SHORT, "Short Description"); assertEquals("Short Description", info.getDescription()); info.addItem("description-" + InformationDesc.ONE_LINE, "One-line Description"); assertEquals("One-line Description", info.getDescription()); info.addItem("description-" + InformationDesc.DEFAULT, "Default Description"); assertEquals("Default Description", info.getDescription()); } @Test public void testDescriptionKind() { InformationDesc info = new InformationDesc(new Locale[0]); info.addItem("description-" + InformationDesc.DEFAULT, "Default Description"); info.addItem("description-" + InformationDesc.ONE_LINE, "One-line Description"); info.addItem("description-" + InformationDesc.SHORT, "Short Description"); info.addItem("description-" + InformationDesc.TOOLTIP, "Tooltip Description"); assertEquals("Default Description", info.getDescription(InformationDesc.DEFAULT)); assertEquals("One-line Description", info.getDescription(InformationDesc.ONE_LINE)); assertEquals("Short Description", info.getDescription(InformationDesc.SHORT)); assertEquals("Tooltip Description", info.getDescription(InformationDesc.TOOLTIP)); } @Test public void testGetIcons() { InformationDesc info = new InformationDesc(new Locale[0]); assertArrayEquals(new IconDesc[0], info.getIcons(IconDesc.DEFAULT)); IconDesc icon1 = new IconDesc(null, null, -1, -1, -1, -1); IconDesc icon2 = new IconDesc(null, null, -1, -1, -1, -1); info.addItem("icon-" + IconDesc.DEFAULT, icon1); info.addItem("icon-" + IconDesc.DEFAULT, icon2); assertArrayEquals(new IconDesc[] { icon1, icon2 }, info.getIcons(IconDesc.DEFAULT)); } @Test public void testGetIconLocations() throws MalformedURLException { InformationDesc info = new InformationDesc(new Locale[0]); URL location1 = new URL("http://location1.example.org"); URL location2 = new URL("http://location2.example.org"); IconDesc icon1 = new IconDesc(location1, null, 10, 10, -1, -1); IconDesc icon2 = new IconDesc(location2, null, 20, 20, -1, -1); info.addItem("icon-" + IconDesc.DEFAULT, icon1); info.addItem("icon-" + IconDesc.DEFAULT, icon2); // exact size matches assertEquals(location1, info.getIconLocation(IconDesc.DEFAULT, 10, 10)); assertEquals(location2, info.getIconLocation(IconDesc.DEFAULT, 20, 20)); // match a bigger icon assertEquals(location1, info.getIconLocation(IconDesc.DEFAULT, 1, 1)); assertEquals(location2, info.getIconLocation(IconDesc.DEFAULT, 15, 15)); // match a smaller icon assertEquals(location1, info.getIconLocation(IconDesc.DEFAULT, 25, 25)); } @Test public void testIsOfflineAllowed() { InformationDesc info = new InformationDesc(new Locale[0], true); assertFalse(info.isOfflineAllowed()); info.addItem("offline-allowed", new Object()); assertTrue(info.isOfflineAllowed()); } @Test public void testIsOfflineAllowedNotStrict() { InformationDesc info = new InformationDesc(new Locale[0], false); assertTrue(info.isOfflineAllowed()); info.addItem("offline-allowed", new Object()); assertTrue(info.isOfflineAllowed()); } @Test public void testIsSharingAllowed() { InformationDesc info = new InformationDesc(new Locale[0]); assertFalse(info.isSharingAllowed()); info.addItem("sharing-allowed", new Object()); assertTrue(info.isSharingAllowed()); } @Test public void testGetShortcut() { InformationDesc info = new InformationDesc(new Locale[0]); assertNull(info.getShortcut()); ShortcutDesc shortcut = new ShortcutDesc(false, false); info.addItem("shortcut", shortcut); assertSame(shortcut, info.getShortcut()); } @Test public void testGetAssociation() throws ParseException { InformationDesc info = new InformationDesc(new Locale[0]); assertArrayEquals(new AssociationDesc[0], info.getAssociations()); AssociationDesc association = new AssociationDesc(null, null); info.addItem("association", association); assertArrayEquals(new AssociationDesc[] { association }, info.getAssociations()); } @Test public void testGetRelatedContents() { InformationDesc info = new InformationDesc(new Locale[0]); assertArrayEquals(new RelatedContentDesc[0], info.getRelatedContents()); RelatedContentDesc relatedContent = new RelatedContentDesc(null); info.addItem("related-content", relatedContent); assertArrayEquals(new RelatedContentDesc[] { relatedContent }, info.getRelatedContents()); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.17941/DefaultLaunchHandlerTest.jav0000644000000000000000000000013212654402377030177 xustar0030 mtime=1454507263.281431994 30 atime=1454507327.190579657 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/DefaultLaunchHandlerTest.java0000644000175000002070000001404712654402377031071 0ustar00jvanekmock00000000000000/* DefaultLaunchHandlerTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import java.io.ByteArrayOutputStream; import java.io.PrintStream; import java.lang.reflect.Field; import net.sourceforge.jnlp.util.logging.LogConfig; import net.sourceforge.jnlp.util.logging.OutputController; import org.junit.Test; public class DefaultLaunchHandlerTest { private static class LocalLogger extends OutputController { private static class AccessibleStream extends PrintStream { public AccessibleStream(ByteArrayOutputStream out) { super(out); } public ByteArrayOutputStream getOut() { return (ByteArrayOutputStream) out; } } LocalLogger() { super(new AccessibleStream(new ByteArrayOutputStream()), new AccessibleStream(new ByteArrayOutputStream())); try{ Field f = LogConfig.class.getDeclaredField("logToStreams"); f.setAccessible(true); f.set(LogConfig.getLogConfig(), true); }catch(Exception ex){ ServerAccess.logException(ex); } } public String getStream1() { return ((AccessibleStream) (super.getOut())).getOut().toString(); } public String getStream2() { return ((AccessibleStream) (super.getErr())).getOut().toString(); } } @Test public void testBasicLaunch() { LocalLogger l = new LocalLogger(); DefaultLaunchHandler handler = new DefaultLaunchHandler(l); // all no-ops with no output handler.launchInitialized(null); handler.launchStarting(null); handler.launchCompleted(null); assertEquals("", l.getStream1()); assertEquals("", l.getStream2()); } @Test public void testLaunchWarning() { LocalLogger l = new LocalLogger(); DefaultLaunchHandler handler = new DefaultLaunchHandler(l); LaunchException warning = new LaunchException(null, null, "severe", "warning type", "test warning", "this is a test of the warning"); boolean continueLaunch = handler.launchWarning(warning); assertTrue(continueLaunch); assertEquals("netx: warning type: test warning\n", l.getStream1()); } @Test public void testLaunchError() { LocalLogger l = new LocalLogger(); DefaultLaunchHandler handler = new DefaultLaunchHandler(l); LaunchException error = new LaunchException(null, null, "severe", "error type", "test error", "this is a test of the error"); handler.launchError(error); assertEquals("netx: error type: test error\n", l.getStream1()); } @Test public void testLaunchErrorWithCause() { LocalLogger l = new LocalLogger(); DefaultLaunchHandler handler = new DefaultLaunchHandler(l); ParseException parse = new ParseException("no information element"); LaunchException error = new LaunchException(null, parse, "severe", "error type", "test error", "this is a test of the error"); handler.launchError(error); assertEquals("netx: error type: test error (no information element)\n", l.getStream1()); } @Test public void testLaunchErrorWithNestedCause() { LocalLogger l = new LocalLogger(); DefaultLaunchHandler handler = new DefaultLaunchHandler(l); ParseException parse = new ParseException("no information element"); RuntimeException runtime = new RuntimeException("programmer made a mistake", parse); LaunchException error = new LaunchException(null, runtime, "severe", "error type", "test error", "this is a test of the error"); handler.launchError(error); assertEquals("netx: error type: test error (programmer made a mistake (no information element))\n", l.getStream1()); } @Test public void testValidationError() { LocalLogger l = new LocalLogger(); DefaultLaunchHandler handler = new DefaultLaunchHandler(l); LaunchException error = new LaunchException(null, null, "severe", "validation-error type", "test validation-error", "this is a test of a validation error"); handler.validationError(error); assertEquals("netx: validation-error type: test validation-error\n", l.getStream1()); } } icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.17941/AsyncCallTest.java0000644000000000000000000000013212654402377026174 xustar0030 mtime=1454507263.281431994 30 atime=1454507327.190579657 30 ctime=1454507658.768157503 icedtea-web-1.6.2/tests/netx/unit/net/sourceforge/jnlp/AsyncCallTest.java0000644000175000002070000000462512654402377026726 0ustar00jvanekmock00000000000000package net.sourceforge.jnlp; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import java.util.concurrent.Callable; import org.junit.Test; public class AsyncCallTest { @Test public void timeOutTest() { final boolean[] wasInterrupted = { false }; AsyncCall call = AsyncCall.startWithTimeOut(new Callable() { @Override public synchronized Void call() { try { wait(); } catch (InterruptedException ie) { // Received on time-out wasInterrupted[0] = true; } return null; } }, 100 /* 100 millisecond time-out */); boolean completedNormally = false; try { call.join(); completedNormally = true; } catch (Exception e) { ServerAccess.logErrorReprint(e.toString()); assertTrue(e instanceof AsyncCall.TimeOutException); } assertFalse(completedNormally); assertTrue(wasInterrupted[0]); } @Test public void normalReturnTest() { AsyncCall call = AsyncCall.startWithTimeOut(new Callable() { @Override public Integer call() { return 1; } }); Integer result = null; boolean completedNormally = false; try { result = call.join(); completedNormally = true; } catch (Exception e) { ServerAccess.logErrorReprint(e.toString()); } assertTrue(completedNormally); assertEquals(Integer.valueOf(1), result); } @Test public void thrownExceptionTest() { @SuppressWarnings("serial") class TestException extends RuntimeException { } AsyncCall call = AsyncCall.startWithTimeOut(new Callable() { @Override public Void call() { throw new TestException(); } }); boolean completedNormally = false; try { call.join(); completedNormally = true; } catch (Exception e) { ServerAccess.logErrorReprint(e.toString()); assertTrue(e instanceof TestException); } assertFalse(completedNormally); } }icedtea-web-1.6.2/tests/netx/PaxHeaders.17941/pac0000644000000000000000000000013212654402377016253 xustar0030 mtime=1454507263.281431994 30 atime=1454507658.776157397 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/netx/pac/0000755000175000002070000000000012654402377017053 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/netx/pac/PaxHeaders.17941/pac-funcs-test.js0000644000000000000000000000013212654402377021522 xustar0030 mtime=1454507263.281431994 30 atime=1454507327.190579657 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/netx/pac/pac-funcs-test.js0000644000175000002070000005703512654402377022257 0ustar00jvanekmock00000000000000 var ICEDTEA_CLASSPATH_ORG_IP = "208.78.240.231"; var CLASSPATH_ORG_IP = "199.232.41.10"; var testsFailed = 0; var testsPassed = 0; print("loading needed files\n"); file = arguments[0] + ""; load(file) print("finished loaded needed files\n"); function main() { testIsPlainHostName(); testDnsDomainIs(); testLocalHostOrDomainIs(); testIsResolvable(); testIsInNet(); testDnsResolve(); testDnsDomainLevels(); testShExpMatch(); testDateRange(); testTimeRange(); testWeekdayRange(); testDateRange2(); testDateRange3(); java.lang.System.out.println("Test results: passed: " + testsPassed + "; failed: " + testsFailed + ";"); } function runTests(name, tests) { var undefined_var; for ( var i = 0; i < tests.length; i++) { runTest(name, tests[i]); } } function runTest(name, test) { var expectedVal = test[0]; var args = test.slice(1); var returnVal; try { returnVal = name.apply(null, args); } catch (e) { returnVal = e; } if (returnVal === expectedVal) { java.lang.System.out.println("Passed: " + name.name + "(" + args.join(", ") + ")"); testsPassed++; } else { java.lang.System.out.println("FAILED: " + name.name + "(" + args.join(", ") + ")"); java.lang.System.out.println(" Expected '" + expectedVal + "' but got '" + returnVal + "'"); testsFailed++; } } function testIsPlainHostName() { var tests = [ [ false, "icedtea.classpath.org" ], [ false, "classpath.org" ], [ true, "org" ], [ true, "icedtea" ], [ false, ".icedtea.classpath.org" ], [ false, "icedtea." ], [ false, "icedtea.classpath." ] ]; runTests(isPlainHostName, tests); } function testDnsDomainIs() { var tests = [ [ true, "icedtea.classpath.org", "icedtea.classpath.org" ], [ true, "icedtea.classpath.org", ".classpath.org" ], [ true, "icedtea.classpath.org", ".org" ], [ false, "icedtea.classpath.org", "icedtea.classpath.com" ], [ false, "icedtea.classpath.org", "icedtea.classpath" ], [ false, "icedtea.classpath", "icedtea.classpath.org" ], [ false, "icedtea", "icedtea.classpath.org" ] ]; runTests(dnsDomainIs, tests); } function testLocalHostOrDomainIs() { var tests = [ [ true, "icedtea.classpath.org", "icedtea.classpath.org" ], [ true, "icedtea", "icedtea.classpath.org" ], [ false, "icedtea.classpath.org", "icedtea.classpath.com" ], [ false, "icedtea.classpath", "icedtea.classpath.org" ], [ false, "foo.classpath.org", "icedtea.classpath.org" ], [ false, "foo", "icedtea.classpath.org" ] ]; runTests(localHostOrDomainIs, tests); } function testIsResolvable() { var tests = [ [ true, "icedtea.classpath.org", "icedtea.classpath.org" ], [ true, "classpath.org" ], [ false, "NotIcedTeaHost" ], [ false, "foobar.classpath.org" ], [ false, "icedtea.classpath.com" ] ]; runTests(isResolvable, tests); } function testIsInNet() { var parts = ICEDTEA_CLASSPATH_ORG_IP.split("\."); var fakeParts = ICEDTEA_CLASSPATH_ORG_IP.split("\."); fakeParts[0] = fakeParts[0] + 1; function createIp(array) { return array[0] + "." + array[1] + "." + array[2] + "." + array[3]; } var tests = [ [ true, "icedtea.classpath.org", ICEDTEA_CLASSPATH_ORG_IP, "255.255.255.255"], [ true, "icedtea.classpath.org", ICEDTEA_CLASSPATH_ORG_IP, "255.255.255.0"], [ true, "icedtea.classpath.org", ICEDTEA_CLASSPATH_ORG_IP, "255.255.0.0"], [ true, "icedtea.classpath.org", ICEDTEA_CLASSPATH_ORG_IP, "255.0.0.0"], [ true, "icedtea.classpath.org", ICEDTEA_CLASSPATH_ORG_IP, "0.0.0.0"], [ true, "icedtea.classpath.org", ICEDTEA_CLASSPATH_ORG_IP, "255.255.255.255"], [ true, "icedtea.classpath.org", ICEDTEA_CLASSPATH_ORG_IP, "0.0.0.0"], [ true, "icedtea.classpath.org", createIp(parts), "255.255.255.255" ], [ false, "icedtea.classpath.org", createIp(fakeParts), "255.255.255.255"], [ false, "icedtea.classpath.org", createIp(fakeParts), "255.255.255.0"], [ false, "icedtea.classpath.org", createIp(fakeParts), "255.255.0.0"], [ false, "icedtea.classpath.org", createIp(fakeParts), "255.0.0.0"], [ true, "icedtea.classpath.org", createIp(fakeParts), "0.0.0.0"] ]; runTests(isInNet, tests); } function testDnsResolve() { var tests = [ [ ICEDTEA_CLASSPATH_ORG_IP, "icedtea.classpath.org" ], //[ CLASSPATH_ORG_IP, "classpath.org" ], [ "127.0.0.1", "localhost" ] ]; runTests(dnsResolve, tests); } function testDnsDomainLevels() { var tests = [ [ 0, "org" ], [ 1, "classpath.org" ], [ 2, "icedtea.classpath.org" ], [ 3, "foo.icedtea.classpath.org" ] ]; runTests(dnsDomainLevels, tests); } function testShExpMatch() { var tests = [ [ true, "icedtea.classpath.org", "icedtea.classpath.org"], [ false, "icedtea.classpath.org", ".org"], [ false, "icedtea.classpath.org", "icedtea."], [ false, "icedtea", "icedtea.classpath.org"], [ true, "icedtea.classpath.org", "*" ], [ true, "icedtea.classpath.org", "*.classpath.org" ], [ true, "http://icedtea.classpath.org", "*.classpath.org" ], [ true, "http://icedtea.classpath.org/foobar/", "*.classpath.org/*" ], [ true, "http://icedtea.classpath.org/foobar/", "*/foobar/*" ], [ true, "http://icedtea.classpath.org/foobar/", "*foobar*" ], [ true, "http://icedtea.classpath.org/foobar/", "*foo*" ], [ false, "http://icedtea.classpath.org/foobar/", "*/foo/*" ], [ false, "http://icedtea.classpath.org/foobar/", "*/foob/*" ], [ false, "http://icedtea.classpath.org/foobar/", "*/fooba/*" ], [ false, "http://icedtea.classpath.org/foo/", "*foobar*" ], [ true, "1", "?" ], [ true, "12", "??" ], [ true, "123", "1?3" ], [ true, "123", "?23" ], [ true, "123", "12?" ], [ true, "1234567890", "??????????" ], [ false, "1234567890", "?????????" ], [ false, "123", "1?1" ], [ false, "123", "??" ], [ true, "http://icedtea.classpath.org/f1/", "*/f?/*" ], [ true, "http://icedtea1.classpath.org/f1/", "*icedtea?.classpath*/f?/*" ], [ false, "http://icedtea.classpath.org/f1/", "*/f2/*" ], [ true, "http://icedtea.classpath.org/f1/", "*/f?/*" ], [ false, "http://icedtea.classpath.org/f1", "f?*"], [ false, "http://icedtea.classpath.org/f1", "f?*"], [ false, "http://icedtea.classpath.org/f1", "f?*"], [ true, "http://icedtea.classpath.org/foobar/", "*.classpath.org/*" ], [ true, "http://icedtea.classpath.org/foobar/", "*.classpath.org/*" ], [ true, "http://icedtea.classpath.org/foobar/", "*.classpath.org/*" ], [ true, "http://icedtea.classpath.org/foo.php?id=bah", "*foo.php*" ], [ false, "http://icedtea.classpath.org/foo_php?id=bah", "*foo.php*" ] ]; runTests(shExpMatch, tests); } function testWeekdayRange() { var today = new Date(); var day = today.getDay(); function dayToStr(day) { switch (day) { case -2: return "FRI"; case -1: return "SAT"; case 0: return "SUN"; case 1: return "MON"; case 2: return "TUE"; case 3: return "WED"; case 4: return "THU"; case 5: return "FRI"; case 6: return "SAT"; case 7: return "SUN"; case 8: return "MON"; default: return "FRI"; } } var tests = [ [ true, dayToStr(day) ], [ false, dayToStr(day+1) ], [ false, dayToStr(day-1) ], ]; runTests(weekdayRange, tests); } /** Returns an array: [day, month, year] */ function incDate() { if ((arguments.length >= 3) && (arguments.length % 2 === 1)) { var date = arguments[0]; var result = date; var index = 1; while (index < arguments.length) { var whichThing = arguments[index]; var by = arguments[index+1]; switch (whichThing) { case 'year': result = new Date(result.getFullYear()+by, result.getMonth(), result.getDate()); break; case 'month': result = new Date(result.getFullYear(), result.getMonth()+by, result.getDate()); break; case 'day': result = new Date(result.getFullYear(), result.getMonth(), result.getDate()+by); break; } index += 2; } return [result.getDate(), result.getMonth(), result.getFullYear()]; } throw "Please call incDate properly"; } function monthToStr(month) { switch (month) { case -1: return "DEC"; case 0: return "JAN"; case 1: return "FEB"; case 2: return "MAR"; case 3: return "APR"; case 4: return "MAY"; case 5: return "JUN"; case 6: return "JUL"; case 7: return "AUG"; case 8: return "SEP"; case 9: return "OCT"; case 10: return "NOV"; case 11: return "DEC"; case 12: return "JAN"; default: throw "Invalid Month" + month; } } function testDateRange() { { var current = new Date(); var date = current.getDate(); var month = current.getMonth(); var year = current.getFullYear(); var today = incDate(current, 'day', 0); var tomorrow = incDate(current, 'day', 1); var yesterday = incDate(current, 'day', -1); runTest(dateRange, [ true, date ]); runTest(dateRange, [ false, tomorrow[0] ]); runTest(dateRange, [ false, yesterday[0] ]); runTest(dateRange, [ true, monthToStr(month) ]); runTest(dateRange, [ false, monthToStr(month+1) ]); runTest(dateRange, [ false, monthToStr(month-1) ]); runTest(dateRange, [ true, year ]); runTest(dateRange, [ false, year - 1]); runTest(dateRange, [ false, year + 1]); runTest(dateRange, [ true, date, date ]); runTest(dateRange, [ true, today[0], tomorrow[0] ]); runTest(dateRange, [ true, yesterday[0], today[0] ]); runTest(dateRange, [ true, yesterday[0], tomorrow[0] ]); runTest(dateRange, [ false, tomorrow[0], yesterday[0] ]); runTest(dateRange, [ false, incDate(current,'day',-2)[0], yesterday[0] ]); runTest(dateRange, [ false, tomorrow[0], incDate(current,'day',2)[0] ]); runTest(dateRange, [ true, monthToStr(month), monthToStr(month) ]); runTest(dateRange, [ true, monthToStr(month), monthToStr(month+1) ]); runTest(dateRange, [ true, monthToStr(month-1), monthToStr(month) ]); runTest(dateRange, [ true, monthToStr(month-1), monthToStr(month+1) ]); runTest(dateRange, [ true, "JAN", "DEC" ]); runTest(dateRange, [ true, "FEB", "JAN" ]); runTest(dateRange, [ true, "DEC", "NOV" ]); runTest(dateRange, [ true, "JUL", "JUN"]); runTest(dateRange, [ false, monthToStr(month+1), monthToStr(month+1) ]); runTest(dateRange, [ false, monthToStr(month-1), monthToStr(month-1) ]); runTest(dateRange, [ false, monthToStr(month+1), monthToStr(month-1) ]); runTest(dateRange, [ true, year, year ]); runTest(dateRange, [ true, year, year+1 ]); runTest(dateRange, [ true, year-1, year ]); runTest(dateRange, [ true, year-1, year+1 ]); runTest(dateRange, [ false, year-2, year-1 ]); runTest(dateRange, [ false, year+1, year+1 ]); runTest(dateRange, [ false, year+1, year+2 ]); runTest(dateRange, [ false, year+1, year-1 ]); runTest(dateRange, [ true, date, monthToStr(month) , date, monthToStr(month) ]); runTest(dateRange, [ true, yesterday[0], monthToStr(yesterday[1]) , date, monthToStr(month) ]); runTest(dateRange, [ false, yesterday[0], monthToStr(yesterday[1]) , yesterday[0], monthToStr(yesterday[1]) ]); runTest(dateRange, [ true, date, monthToStr(month) , tomorrow[0], monthToStr(tomorrow[1]) ]); runTest(dateRange, [ false, tomorrow[0], monthToStr(tomorrow[1]) , tomorrow[0], monthToStr(tomorrow[1]) ]); runTest(dateRange, [ true, yesterday[0], monthToStr(yesterday[1]) , tomorrow[0], monthToStr(tomorrow[1]) ]); runTest(dateRange, [ false, tomorrow[0], monthToStr(tomorrow[1]) , yesterday[0], monthToStr(yesterday[1]) ]); } { var lastMonth = incDate(new Date(), 'month', -1); var thisMonth = incDate(new Date(), 'month', 0); var nextMonth = incDate(new Date(), 'month', +1); runTest(dateRange, [ true, lastMonth[0], monthToStr(lastMonth[1]) , thisMonth[0], monthToStr(thisMonth[1]) ]); runTest(dateRange, [ true, thisMonth[0], monthToStr(thisMonth[1]) , nextMonth[0], monthToStr(nextMonth[1]) ]); runTest(dateRange, [ true, lastMonth[0], monthToStr(lastMonth[1]) , nextMonth[0], monthToStr(nextMonth[1]) ]); var date1 = incDate(new Date(), 'day', +1, 'month', -1); var date2 = incDate(new Date(), 'day', -1, 'month', +1); runTest(dateRange, [ true, date1[0], monthToStr(date1[1]) , nextMonth[0], monthToStr(nextMonth[1]) ]); runTest(dateRange, [ true, lastMonth[0], monthToStr(lastMonth[1]) , date2[0], monthToStr(date2[1]) ]); runTest(dateRange, [ false, nextMonth[0], monthToStr(nextMonth[1]) , lastMonth[0], monthToStr(lastMonth[1]) ]); var date3 = incDate(new Date(), 'day', +1, 'month', +1); var date4 = incDate(new Date(), 'day', +1, 'month', -1); runTest(dateRange, [ false, date3[0], monthToStr(date3[1]) , date4[0], monthToStr(date4[1]) ]); var date5 = incDate(new Date(), 'day', -1, 'month', -1); runTest(dateRange, [ false, date2[0], monthToStr(date2[1]) , date5[0], monthToStr(date5[1]) ]); runTest(dateRange, [ true, 1, "JAN", 31, "DEC" ]); runTest(dateRange, [ true, 2, "JAN", 1, "JAN" ]); var month = new Date().getMonth(); runTest(dateRange, [ false, 1, monthToStr(month+1), 31, monthToStr(month+1) ]); runTest(dateRange, [ false, 1, monthToStr(month-1), 31, monthToStr(month-1) ]); } { var lastMonth = incDate(new Date(), 'month', -1); var thisMonth = incDate(new Date(), 'month', 0); var nextMonth = incDate(new Date(), 'month', +1); runTest(dateRange, [ true, monthToStr(thisMonth[1]), thisMonth[2], monthToStr(thisMonth[1]), thisMonth[2] ]); runTest(dateRange, [ true, monthToStr(lastMonth[1]), lastMonth[2], monthToStr(thisMonth[1]), thisMonth[2] ]); runTest(dateRange, [ true, monthToStr(thisMonth[1]), thisMonth[2], monthToStr(nextMonth[1]), nextMonth[2] ]); runTest(dateRange, [ true, monthToStr(lastMonth[1]), lastMonth[2], monthToStr(nextMonth[1]), nextMonth[2] ]); runTest(dateRange, [ true, monthToStr(0), year, monthToStr(11), year ]); runTest(dateRange, [ false, monthToStr(nextMonth[1]), nextMonth[2], monthToStr(lastMonth[1]), lastMonth[2] ]); runTest(dateRange, [ false, monthToStr(nextMonth[1]), nextMonth[2], monthToStr(nextMonth[1]), nextMonth[2] ]); runTest(dateRange, [ false, monthToStr(lastMonth[1]), lastMonth[2], monthToStr(lastMonth[1]), lastMonth[2] ]); var lastYear = incDate(new Date(), 'year', -1); var nextYear = incDate(new Date(), 'year', +1); runTest(dateRange, [ false, monthToStr(lastYear[1]), lastYear[2], monthToStr(lastMonth[1]), lastMonth[2] ]); runTest(dateRange, [ true, monthToStr(thisMonth[1]), thisMonth[2], monthToStr(nextYear[1]), nextYear[2] ]); var year = new Date().getFullYear(); var month = new Date().getMonth(); runTest(dateRange, [ true, monthToStr(month), year-1, monthToStr(month), year ]); runTest(dateRange, [ true, monthToStr(month), year-1, monthToStr(month), year+1 ]); runTest(dateRange, [ true, monthToStr(0), year, monthToStr(0), year+1 ]); runTest(dateRange, [ true, monthToStr(0), year-1, monthToStr(0), year+1 ]); runTest(dateRange, [ false, monthToStr(0), year-1, monthToStr(11), year-1 ]); runTest(dateRange, [ false, monthToStr(0), year+1, monthToStr(11), year+1 ]); } { var today = incDate(new Date(), 'day', 0); var yesterday = incDate(new Date(), 'day', -1); var tomorrow = incDate(new Date(), 'day', +1); runTest(dateRange, [ true, today[0], monthToStr(today[1]), today[2], today[0], monthToStr(today[1]), today[2] ]); runTest(dateRange, [ true, yesterday[0], monthToStr(yesterday[1]), yesterday[2], tomorrow[0], monthToStr(tomorrow[1]), tomorrow[2] ]); } { var dayLastMonth = incDate(new Date(), 'day', -1, 'month', -1); var dayNextMonth = incDate(new Date(), 'day', +1, 'month', +1); runTest(dateRange, [ true, dayLastMonth[0], monthToStr(dayLastMonth[1]), dayLastMonth[2], dayNextMonth[0], monthToStr(dayNextMonth[1]), dayNextMonth[2] ]); } { var dayLastYear = incDate(new Date(), 'day', -1, 'month', -1, 'year', -1); var dayNextYear = incDate(new Date(), 'day', +1, 'month', +1, 'year', +1); runTest(dateRange, [ true, dayLastYear[0], monthToStr(dayLastYear[1]), dayLastYear[2], dayNextYear[0], monthToStr(dayNextYear[1]), dayNextYear[2] ]); } { var dayLastYear = incDate(new Date(), 'day', +1, 'month', -1, 'year', -1); var dayNextYear = incDate(new Date(), 'day', +1, 'month', +1, 'year', +1); runTest(dateRange, [ true, dayLastYear[0], monthToStr(dayLastYear[1]), dayLastYear[2], dayNextYear[0], monthToStr(dayNextYear[1]), dayNextYear[2] ]); } { var tomorrow = incDate(new Date(), 'day', +1); var dayNextYear = incDate(new Date(), 'day', +1, 'month', +1, 'year', +1); runTest(dateRange, [ false, tomorrow[0], monthToStr(tomorrow[1]), tomorrow[2], dayNextYear[0], monthToStr(dayNextYear[1]), dayNextYear[2] ]); } { var nextMonth = incDate(new Date(), 'month', +1); var nextYear = incDate(new Date(), 'day', +1, 'month', +1, 'year', +1); runTest(dateRange, [ false, nextMonth[0], monthToStr(nextMonth[1]), nextMonth[2], nextYear[0], monthToStr(nextYear[1]), nextYear[2] ]); } { runTest(dateRange, [ true, 1, monthToStr(0), 0, 31, monthToStr(11), 100000 ]); runTest(dateRange, [ true, 1, monthToStr(0), year, 31, monthToStr(11), year ]); runTest(dateRange, [ true, 1, monthToStr(0), year-1, 31, monthToStr(11), year+1 ]); runTest(dateRange, [ false, 1, monthToStr(0), year-1, 31, monthToStr(11), year-1 ]); runTest(dateRange, [ false, 1, monthToStr(0), year+1, 31, monthToStr(11), year+1 ]); } } function testDateRange2() { var dates = [ new Date("January 31, 2011 3:33:33"), new Date("February 28, 2011 3:33:33"), new Date("February 29, 2012 3:33:33"), new Date("March 31, 2011 3:33:33"), new Date("April 30, 2011 3:33:33"), new Date("May 31, 2011 3:33:33"), new Date("June 30, 2011 3:33:33"), new Date("July 31, 2011 3:33:33"), new Date("August 31, 2011 3:33:33"), new Date("September 30, 2011 3:33:33"), new Date("October 31, 2011 3:33:33"), new Date("November 30, 2011 3:33:33"), new Date("December 31, 2011 3:33:33"), ] for (var i = 0; i < dates.length; i++) { var current = dates[i]; var today = incDate(current, 'day', 0); var yesterday = incDate(current, 'day', -1); var tomorrow = incDate(current, 'day', 1); var aYearFromNow = new Date(current.getFullYear()+1, current.getMonth()+1, current.getDate()+1); var later = [aYearFromNow.getDate(), aYearFromNow.getMonth(), aYearFromNow.getFullYear()]; runTest(isDateInRange_internallForIcedTeaWebTesting, [ true, current, today[0], monthToStr(today[1]) , tomorrow[0], monthToStr(tomorrow[1]) ]); runTest(isDateInRange_internallForIcedTeaWebTesting, [ true, current, yesterday[0], monthToStr(yesterday[1]) , tomorrow[0], monthToStr(tomorrow[1]) ]); runTest(isDateInRange_internallForIcedTeaWebTesting, [ true, current, yesterday[0], monthToStr(yesterday[1]), yesterday[2], tomorrow[0], monthToStr(tomorrow[1]), tomorrow[2] ]); runTest(isDateInRange_internallForIcedTeaWebTesting, [ false, current, tomorrow[0], monthToStr(tomorrow[1]), tomorrow[2], later[0], monthToStr(later[1]), later[2] ]); } } function testDateRange3() { var dates = [ new Date("January 1, 2011 1:11:11"), new Date("February 1, 2011 1:11:11"), new Date("March 1, 2011 1:11:11"), new Date("April 1, 2011 1:11:11"), new Date("May 1, 2011 1:11:11"), new Date("June 1, 2011 1:11:11"), new Date("July 1, 2011 1:11:11"), new Date("August 1, 2011 1:11:11"), new Date("September 1, 2011 1:11:11"), new Date("October 1, 2011 1:11:11"), new Date("November 1, 2011 1:11:11"), new Date("December 1, 2011 1:11:11"), ] for (var i = 0; i < dates.length; i++) { var current = dates[i]; var yesterday = incDate(current,'day',-1); var today = incDate(current,'day',0); var tomorrow = incDate(current,'day',1); runTest(isDateInRange_internallForIcedTeaWebTesting, [ true, current, yesterday[0], monthToStr(yesterday[1]) , today[0], monthToStr(today[1]) ]); runTest(isDateInRange_internallForIcedTeaWebTesting, [ true, current, yesterday[0], monthToStr(yesterday[1]) , tomorrow[0], monthToStr(tomorrow[1]) ]); runTest(isDateInRange_internallForIcedTeaWebTesting, [ true, current, yesterday[0], monthToStr(yesterday[1]), yesterday[2], tomorrow[0], monthToStr(tomorrow[1]), tomorrow[2] ]); } } function testTimeRange() { var now = new Date(); var hour = now.getHours(); var min = now.getMinutes(); var sec = now.getSeconds(); function toHour(input) { if (input < 0) { while (input < 0) { input = input + 24; } return (input % 24); } else { return (input % 24); } } function toMin(input) { if (input < 0) { while (input < 0) { input = input + 60; } return (input % 60); } else { return (input % 60); } } tests = [ [ true, hour ], [ false, toHour(hour+1)], [ false, toHour(hour-1)], [ true, hour, hour ], [ true, toHour(hour-1), hour ], [ true, hour, toHour(hour+1)], [ true, toHour(hour-1), toHour(hour+1)], [ true, toHour(hour+1), hour ], [ true, hour, toHour(hour-1) ], [ false, toHour(hour-2), toHour(hour-1)], [ false, toHour(hour+1), toHour(hour+2)], [ false, toHour(hour+1), toHour(hour-1) ], [ true, 0, 23 ], [ true, 12, 11 ], [ true, hour, min, hour, min ], [ true, hour, min, hour, toMin(min+1) ], [ true, hour, toMin(min-1), hour, min ], [ true, hour, toMin(min-1), hour, toMin(min+1) ], [ true, hour, toMin(min+2), hour, toMin(min+1) ], [ false, hour, toMin(min+1), hour, toMin(min+1) ], [ false, hour, toMin(min-1), hour, toMin(min-1) ], [ false, hour, toMin(min+1), hour, toMin(min-1) ], [ true, toHour(hour-1), min, hour, min ], [ true, hour, min, toHour(hour+1), min ], [ true, toHour(hour-1), min, toHour(hour+1), min ], [ true, 0, 0, 23, 59 ], [ true, 0, 1, 0, 0 ], [ true, 0, 1, 0, 0, 0, 0 ], [ true, hour, min, sec, hour, min, sec ], [ true, hour, min, sec, hour, min + 10, sec ], [ true, hour, min, sec - 10, hour, min, sec ], [ true, hour, min, sec, hour, min-1 , sec ], ]; runTests(timeRange, tests); } main(); icedtea-web-1.6.2/tests/PaxHeaders.17941/junit-runner0000644000000000000000000000013212654402377017172 xustar0030 mtime=1454507263.280432008 30 atime=1454507658.776157397 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/junit-runner/0000755000175000002070000000000012654402377017772 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/junit-runner/PaxHeaders.17941/README0000644000000000000000000000013212654402377020127 xustar0030 mtime=1454507263.280432008 30 atime=1454507327.190579657 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/junit-runner/README0000644000175000002070000000027212654402377020653 0ustar00jvanekmock00000000000000junit-runner is used to run tests instead of the standard runner org.junit.runner.JUnitCore. It provides output similar to that used by JTreg, which is useful for automated comparison. icedtea-web-1.6.2/tests/junit-runner/PaxHeaders.17941/LessVerboseTextListener.java0000644000000000000000000000013212654402377024721 xustar0030 mtime=1454507263.280432008 30 atime=1454507327.190579657 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/junit-runner/LessVerboseTextListener.java0000644000175000002070000001304312654402377025445 0ustar00jvanekmock00000000000000/* * Copyright 2011 Red Hat, Inc. * * This file is made available under the terms of the Common Public License * v1.0 which accompanies this distribution, and is available at * http://www.eclipse.org/legal/cpl-v10.html */ import java.io.PrintStream; import java.lang.annotation.Annotation; import java.lang.reflect.Method; import net.sourceforge.jnlp.annotations.KnownToFail; import net.sourceforge.jnlp.annotations.Remote; import net.sourceforge.jnlp.browsertesting.Browsers; import org.junit.internal.JUnitSystem; import org.junit.runner.Description; import org.junit.runner.Result; import org.junit.runner.notification.Failure; import org.junit.runner.notification.RunListener; public class LessVerboseTextListener extends RunListener { private PrintStream writer; private boolean testFailed = false; private int totalK2F=0; private int failedK2F=0; private int passedK2F=0; private int ignoredK2F=0; public LessVerboseTextListener(JUnitSystem system) { writer= system.out(); } @Override public void testStarted(Description description) throws Exception { testFailed = false; } @Override public void testIgnored(Description description) throws Exception { writer.println("Ignored: " + description.getClassName() + "." + description.getMethodName()); printK2F(writer, null, description); printRemote(writer, description); } @Override public void testFailure(Failure failure) { testFailed = true; writer.println("FAILED: " + failure.getTestHeader() + " " + failure.getMessage()); printK2F(writer,true,failure.getDescription()); printRemote(writer, failure.getDescription()); } @Override public void testFinished(org.junit.runner.Description description) throws Exception { if (!testFailed) { writer.println("Passed: " + description.getClassName() + "." + description.getMethodName()); printK2F(writer,false,description); printRemote(writer, description); } } @Override public void testRunFinished(Result result) throws Exception { int passed = result.getRunCount() - result.getFailureCount() - result.getIgnoreCount(); int failed = result.getFailureCount(); int ignored = result.getIgnoreCount(); writer.println("Total tests run: "+result.getRunCount()+"; From those : " + totalK2F + " known to fail"); writer.println("Test known to fail: passed: " + passedK2F + "; failed: " + failedK2F + "; ignored: " + ignoredK2F); writer.println("Test results: passed: " + passed + "; failed: " + failed + "; ignored: " + ignored); } private void printK2F(PrintStream writer, Boolean failed, Description description) { try { KnownToFail k2f = getK2F(description); boolean thisTestIsK2F = false; if (k2f != null){ //determine if k2f in the current browser Browsers[] br = k2f.failsIn(); if(0 == br.length){ //@KnownToFail with default optional parameter failsIn={} thisTestIsK2F = true; }else{ for(Browsers b : br){ if(description.toString().contains(b.toString())){ thisTestIsK2F = true; } } } } if( thisTestIsK2F ){ totalK2F++; if (failed != null) { if (failed) { failedK2F++; } else { passedK2F++; } } else { ignoredK2F++; } if (failed != null && !failed) { writer.println(" - WARNING This test is known to fail, but have passed!"); } else { writer.println(" - This test is known to fail"); } } } catch (Exception ex) { ex.printStackTrace(); } } @SuppressWarnings("unchecked") public static T getAnnotation(Class q, String methodName, Class a) { try { if (q != null) { T rem = q.getAnnotation(a); if (rem != null) { return rem; } String qs = methodName; if (qs.contains(" - ")) { qs = qs.replaceAll(" - .*", ""); } Method qm = q.getMethod(qs); if (qm != null) { rem = qm.getAnnotation(a); return rem; } } } catch (Exception ex) { ex.printStackTrace(); } return null; } public static KnownToFail getK2F(Description description) { return getAnnotation(description.getTestClass(), description.getMethodName(), KnownToFail.class); } public static Remote getRemote(Description description) { return getAnnotation(description.getTestClass(), description.getMethodName(), Remote.class); } private void printRemote(PrintStream writer, Description description) { try { Remote rem = getRemote(description); if (rem != null) { writer.println(" - This test is running remote content, note that failures may be caused by broken target application or connection"); } } catch (Exception ex) { ex.printStackTrace(); } } } icedtea-web-1.6.2/tests/junit-runner/PaxHeaders.17941/JunitLikeXmlOutputListener.java0000644000000000000000000000013112654402377025417 xustar0030 mtime=1454507263.280432008 29 atime=1454507327.18957967 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/junit-runner/JunitLikeXmlOutputListener.java0000644000175000002070000004466612654402377026163 0ustar00jvanekmock00000000000000/* * Copyright 2011 Red Hat, Inc. * * This file is made available under the terms of the Common Public License * v1.0 which accompanies this distribution, and is available at * http://www.eclipse.org/legal/cpl-v10.html */ import java.io.BufferedWriter; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStreamWriter; import java.lang.reflect.Method; import java.text.DecimalFormat; import java.text.NumberFormat; import java.util.Date; import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; import java.util.Set; import java.util.Arrays; import java.util.concurrent.TimeUnit; import net.sourceforge.jnlp.annotations.Bug; import net.sourceforge.jnlp.annotations.KnownToFail; import net.sourceforge.jnlp.annotations.Remote; import net.sourceforge.jnlp.browsertesting.Browsers; import org.junit.internal.JUnitSystem; import org.junit.runner.Description; import org.junit.runner.Result; import org.junit.runner.notification.Failure; import org.junit.runner.notification.RunListener; /** * This class listens for events in junit testsuite and wrote output to xml. * Xml tryes to follow ant-tests schema, and is enriched for by-class statistics * stdout and err elements are added, but must be filled from elsewhere (eg tee * in make) as junit suite and listener run from our executer have no access to * them. * */ public class JunitLikeXmlOutputListener extends RunListener { private BufferedWriter writer; private Failure testFailed = null; private static final String ROOT = "testsuite"; private static final String DATE_ELEMENT = "date"; private static final String TEST_ELEMENT = "testcase"; private static final String BUGS = "bugs"; private static final String BUG = "bug"; private static final String K2F = "known-to-fail"; private static final String REMOTE = "remote"; private static final String TEST_NAME_ATTRIBUTE = "name"; private static final String TEST_TIME_ATTRIBUTE = "time"; private static final String TEST_IGNORED_ATTRIBUTE = "ignored"; private static final String TEST_ERROR_ELEMENT = "error"; private static final String TEST_CLASS_ATTRIBUTE = "classname"; private static final String ERROR_MESSAGE_ATTRIBUTE = "message"; private static final String ERROR_TYPE_ATTRIBUTE = "type"; private static final String SOUT_ELEMENT = "system-out"; private static final String SERR_ELEMENT = "system-err"; private static final String CDATA_START = ""; private static final String TEST_CLASS_ELEMENT = "class"; private static final String STATS_ELEMENT = "stats"; private static final String CLASSES_ELEMENT = "classes"; private static final String SUMMARY_ELEMENT = "summary"; private static final String SUMMARY_TOTAL_ELEMENT = "total"; private static final String SUMMARY_PASSED_ELEMENT = "passed"; private static final String SUMMARY_FAILED_ELEMENT = "failed"; private static final String SUMMARY_IGNORED_ELEMENT = "ignored"; private long testStart; private int failedK2F=0; private int passedK2F=0; private int ignoredK2F=0; private class ClassStat { Class c; int total; int failed; int passed; int ignored; long time = 0; int totalK2F=0; int failedK2F=0; int passedK2F=0; int ignoredK2F=0; } Map classStats = new HashMap(); public JunitLikeXmlOutputListener(JUnitSystem system, File f) { try { writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(f), "UTF-8")); } catch (Exception ex) { throw new RuntimeException(ex); } } @Override public void testRunStarted(Description description) throws Exception { openElement(ROOT); writeElement(DATE_ELEMENT, new Date().toString()); } private void openElement(String name) throws IOException { openElement(name, null); } private void openElement(String name, Map atts) throws IOException { StringBuilder attString = new StringBuilder(); if (atts != null) { attString.append(" "); Set> entries = atts.entrySet(); for (Entry entry : entries) { String k = entry.getKey(); String v = entry.getValue(); if (v == null) { v = "null"; } attString.append(k).append("=\"").append(attributize(v)).append("\""); attString.append(" "); } } writer.write("<" + name + attString.toString() + ">"); writer.newLine(); } private static String attributize(String s) { return s.replace("&", "&").replace("<", "<").replace("\"", """); } private void closeElement(String name) throws IOException { writer.newLine(); writer.write(""); writer.newLine(); } private void writeContent(String content) throws IOException { writer.write(CDATA_START + content + CDATA_END); } private void writeElement(String name, String content) throws IOException { writeElement(name, content, null); } private void writeElement(String name, String content, Map atts) throws IOException { openElement(name, atts); writeContent(content); closeElement(name); } @Override public void testStarted(Description description) throws Exception { testFailed = null; testStart = System.nanoTime(); } @Override public void testFailure(Failure failure) throws IOException { testFailed = failure; } @Override public void testIgnored(Description description) throws Exception { testDone(description, 0, 0, true); } @Override public void testFinished(org.junit.runner.Description description) throws Exception { long testTime = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - testStart); double testTimeSeconds = ((double) testTime) / 1000d; testDone(description, testTime, testTimeSeconds, false); } @SuppressWarnings("unchecked") private void testDone(Description description, long testTime, double testTimeSeconds, boolean ignored) throws Exception { Class testClass = null; Method testMethod = null; try { testClass = description.getTestClass(); String qs = description.getMethodName(); //handling @Browser'bugsIds marking of used browser if (qs.contains(" - ")) { qs = qs.replaceAll(" - .*", ""); } testMethod = testClass.getMethod(qs); } catch (Exception ex) { ex.printStackTrace(); } Map testcaseAtts = new HashMap(4); NumberFormat formatter = new DecimalFormat("#0.0000"); String stringedTime = formatter.format(testTimeSeconds); stringedTime.replace(",", "."); testcaseAtts.put(TEST_TIME_ATTRIBUTE, stringedTime); testcaseAtts.put(TEST_CLASS_ATTRIBUTE, description.getClassName()); testcaseAtts.put(TEST_NAME_ATTRIBUTE, description.getMethodName()); if (ignored){ testcaseAtts.put(TEST_IGNORED_ATTRIBUTE, Boolean.TRUE.toString()); } KnownToFail k2f = LessVerboseTextListener.getAnnotation(testClass, testMethod.getName(), KnownToFail.class); boolean thisTestIsK2F = false; Remote remote = LessVerboseTextListener.getAnnotation(testClass, testMethod.getName(), Remote.class); if (k2f != null) { //determine if k2f in the current browser //?? Browsers[] br = k2f.failsIn(); if(0 == br.length){//the KnownToFail annotation without optional parameter thisTestIsK2F = true; }else{ for(Browsers b : br){ if(description.toString().contains(b.toString())){ thisTestIsK2F = true; } } } } if( thisTestIsK2F ) testcaseAtts.put(K2F, Boolean.TRUE.toString()); if (remote != null) { testcaseAtts.put(REMOTE, Boolean.TRUE.toString()); } openElement(TEST_ELEMENT, testcaseAtts); if (testFailed != null) { if (thisTestIsK2F) { failedK2F++; } Map errorAtts = new HashMap(3); errorAtts.put(ERROR_MESSAGE_ATTRIBUTE, testFailed.getMessage()); int i = testFailed.getTrace().indexOf(":"); if (i >= 0) { errorAtts.put(ERROR_TYPE_ATTRIBUTE, testFailed.getTrace().substring(0, i)); } else { errorAtts.put(ERROR_TYPE_ATTRIBUTE, "?"); } writeElement(TEST_ERROR_ELEMENT, testFailed.getTrace(), errorAtts); } else { if (thisTestIsK2F) { if (ignored) { ignoredK2F++; } else { passedK2F++; } } } try { if (testClass != null && testMethod != null) { Bug bug = testMethod.getAnnotation(Bug.class); if (bug != null) { openElement(BUGS); String[] bugsIds = bug.id(); for (String bugId : bugsIds) { String idAndUrl[] = createBug(bugId); Map visibleNameAtt = new HashMap(1); visibleNameAtt.put("visibleName", idAndUrl[0]); openElement(BUG, visibleNameAtt); writer.write(idAndUrl[1]); closeElement(BUG); } closeElement(BUGS); } } } catch (Exception ex) { ex.printStackTrace(); } closeElement(TEST_ELEMENT); writer.flush(); ClassStat classStat = classStats.get(description.getClassName()); if (classStat == null) { classStat = new ClassStat(); classStat.c = description.getTestClass(); classStats.put(description.getClassName(), classStat); } classStat.total++; if (thisTestIsK2F) { classStat.totalK2F++; } classStat.time += testTime; if (testFailed == null) { if (ignored) { classStat.ignored++; if (thisTestIsK2F) { classStat.ignoredK2F++; } } else { classStat.passed++; if (thisTestIsK2F) { classStat.passedK2F++; } } } else { classStat.failed++; if (thisTestIsK2F) { classStat.failedK2F++; } } } @Override @SuppressWarnings("unchecked") public void testRunFinished(Result result) throws Exception { writeElement(SOUT_ELEMENT, "@sout@"); writeElement(SERR_ELEMENT, "@serr@"); openElement(STATS_ELEMENT); openElement(SUMMARY_ELEMENT); int passed = result.getRunCount() - result.getFailureCount() - result.getIgnoreCount(); int failed = result.getFailureCount(); int ignored = result.getIgnoreCount(); writeElement(SUMMARY_TOTAL_ELEMENT, String.valueOf(result.getRunCount()),createKnownToFailSumamryAttribute(failedK2F+passedK2F+ignoredK2F)); writeElement(SUMMARY_FAILED_ELEMENT, String.valueOf(failed),createKnownToFailSumamryAttribute(failedK2F)); writeElement(SUMMARY_IGNORED_ELEMENT, String.valueOf(ignored),createKnownToFailSumamryAttribute(ignoredK2F)); writeElement(SUMMARY_PASSED_ELEMENT, String.valueOf(passed),createKnownToFailSumamryAttribute(passedK2F)); closeElement(SUMMARY_ELEMENT); openElement(CLASSES_ELEMENT); Set> e = classStats.entrySet(); for (Entry entry : e) { Map testcaseAtts = new HashMap(3); testcaseAtts.put(TEST_NAME_ATTRIBUTE, entry.getKey()); testcaseAtts.put(TEST_TIME_ATTRIBUTE, String.valueOf(entry.getValue().time)); openElement(TEST_CLASS_ELEMENT, testcaseAtts); writeElement(SUMMARY_PASSED_ELEMENT, String.valueOf(entry.getValue().passed),createKnownToFailSumamryAttribute(entry.getValue().passedK2F)); writeElement(SUMMARY_FAILED_ELEMENT, String.valueOf(entry.getValue().failed),createKnownToFailSumamryAttribute(entry.getValue().failedK2F)); writeElement(SUMMARY_IGNORED_ELEMENT, String.valueOf(entry.getValue().ignored),createKnownToFailSumamryAttribute(entry.getValue().ignoredK2F)); writeElement(SUMMARY_TOTAL_ELEMENT, String.valueOf(entry.getValue().total),createKnownToFailSumamryAttribute(entry.getValue().totalK2F)); try { Bug b = null; if (entry.getValue().c != null) { b = entry.getValue().c.getAnnotation(Bug.class); } if (b != null) { openElement(BUGS); String[] s = b.id(); for (String string : s) { String ss[] = createBug(string); Map visibleNameAtt = new HashMap(1); visibleNameAtt.put("visibleName", ss[0]); openElement(BUG, visibleNameAtt); writer.write(ss[1]); closeElement(BUG); } closeElement(BUGS); } } catch (Exception ex) { ex.printStackTrace(); } closeElement(TEST_CLASS_ELEMENT); } closeElement(CLASSES_ELEMENT); closeElement(STATS_ELEMENT); closeElement(ROOT); writer.flush(); writer.close(); } public Map createKnownToFailSumamryAttribute(int count) { Map atts = new HashMap(1); atts.put(K2F, String.valueOf(count)); return atts; } /** * When declare for suite class or for Test-marked method, * should be interpreted by report generating tool to links. * Known shortcuts are * SX - http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=X * PRX - http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=X * RHX - https://bugzilla.redhat.com/show_bug.cgi?id=X * DX - http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=X * GX - http://bugs.gentoo.org/show_bug.cgi?id=X * CAX - http://server.complang.tuwien.ac.at/cgi-bin/bugzilla/show_bug.cgi?id=X * LPX - https://bugs.launchpad.net/bugs/X * * http://mail.openjdk.java.net/pipermail/distro-pkg-dev/ * and http://mail.openjdk.java.net/pipermail/ are proceed differently * * You just put eg @Bug(id="RH12345",id="http:/my.bukpage.com/terribleNew") * and RH12345 will be transalated as * 123456 or * similar, the url will be inclueded as is. Both added to proper tests or suites * * @return Strng[2]{nameToBeShown, hrefValue} */ public static String[] createBug(String string) { String[] r = {"ex", string}; String[] prefixes = { "S", "PR", "RH", "D", "G", "CA", "LP",}; String[] urls = { "http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=", "http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=", "https://bugzilla.redhat.com/show_bug.cgi?id=", "http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=", "http://bugs.gentoo.org/show_bug.cgi?id=", "http://server.complang.tuwien.ac.at/cgi-bin/bugzilla/show_bug.cgi?id", "https://bugs.launchpad.net/bugs/",}; for (int i = 0; i < urls.length; i++) { if (string.startsWith(prefixes[i])) { r[0] = string; r[1] = urls[i] + string.substring(prefixes[i].length()); return r; } } String distro = "http://mail.openjdk.java.net/pipermail/distro-pkg-dev/"; String openjdk = "http://mail.openjdk.java.net/pipermail/"; String pushHead = "http://icedtea.classpath.org/hg/"; String pushBranch = "http://icedtea.classpath.org/hg/release/"; if (string.startsWith(distro)) { r[0] = "distro-pkg"; return r; } if (string.startsWith(openjdk)) { r[0] = "openjdk"; return r; } if (string.startsWith(pushBranch)) { r[0] = "push (branch)"; return r; } if (string.startsWith(pushHead)) { r[0] = "push (head)"; return r; } return r; } public static void main(String[] args) { String[] q = createBug("PR608"); System.out.println(q[0] + " : " + q[1]); q = createBug("S4854"); System.out.println(q[0] + " : " + q[1]); q = createBug("RH649423"); System.out.println(q[0] + " : " + q[1]); q = createBug("D464"); System.out.println(q[0] + " : " + q[1]); q = createBug("G6554"); System.out.println(q[0] + " : " + q[1]); q = createBug("CA1654"); System.out.println(q[0] + " : " + q[1]); q = createBug("LP5445"); System.out.println(q[0] + " : " + q[1]); q = createBug("http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2011-November/016178.html"); System.out.println(q[0] + " : " + q[1]); q = createBug("http://mail.openjdk.java.net/pipermail/awt-dev/2012-March/002324.html"); System.out.println(q[0] + " : " + q[1]); q = createBug("http://lists.fedoraproject.org/pipermail/chinese/2012-January/008868.html"); System.out.println(q[0] + " : " + q[1]); q = createBug("http://icedtea.classpath.org/hg/icedtea-web/rev/22b7becd48a7"); System.out.println(q[0] + " : " + q[1]); q = createBug("http://icedtea.classpath.org/hg/release/icedtea-web-1.6/rev/0d9faf51357d"); System.out.println(q[0] + " : " + q[1]); } } icedtea-web-1.6.2/tests/junit-runner/PaxHeaders.17941/CommandLine.java0000644000000000000000000000013112654402377022277 xustar0030 mtime=1454507263.279432021 29 atime=1454507327.18957967 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/junit-runner/CommandLine.java0000644000175000002070000000351112654402377023023 0ustar00jvanekmock00000000000000/* * Copyright 2011 Red Hat, Inc. * Based on code from JUnit * * This file is made available under the terms of the Common Public License * v1.0 which accompanies this distribution, and is available at * http://www.eclipse.org/legal/cpl-v10.html */ import java.io.File; import java.util.ArrayList; import java.util.List; import org.junit.internal.JUnitSystem; import org.junit.internal.RealSystem; import org.junit.runner.JUnitCore; import org.junit.runner.Result; import org.junit.runner.notification.Failure; import org.junit.runner.notification.RunListener; public class CommandLine extends JUnitCore { public static void main(String... args) { runMainAndExit(new RealSystem(), args); } public static void runMainAndExit(JUnitSystem system, String... args) { new CommandLine().runMain(system, args); System.exit(0); } public Result runMain(JUnitSystem system, String... args) { List> classes = new ArrayList>(); List missingClasses = new ArrayList(); for (String each : args) { try { if (each.contains("$")) continue; if (each.toLowerCase().endsWith(".jnlp")) continue; classes.add(Class.forName(each)); } catch (ClassNotFoundException e) { system.out().println("ERROR: Could not find class: " + each); } } RunListener jXmlOutput = new JunitLikeXmlOutputListener(system, new File("tests-output.xml")); addListener(jXmlOutput); RunListener listener = new LessVerboseTextListener(system); addListener(listener); Result result = run(classes.toArray(new Class[0])); for (Failure each : missingClasses) { result.getFailures().add(each); } return result; } } icedtea-web-1.6.2/tests/PaxHeaders.17941/jacoco-operator0000644000000000000000000000013212654402377017621 xustar0030 mtime=1454507263.278432034 30 atime=1454507658.776157397 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/jacoco-operator/0000755000175000002070000000000012654402377020421 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/jacoco-operator/PaxHeaders.17941/org0000644000000000000000000000013212654402377020410 xustar0030 mtime=1454507263.278432034 30 atime=1454507658.776157397 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/jacoco-operator/org/0000755000175000002070000000000012654402377021210 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/jacoco-operator/org/PaxHeaders.17941/jacoco0000644000000000000000000000013212654402377021646 xustar0030 mtime=1454507263.278432034 30 atime=1454507658.776157397 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/jacoco-operator/org/jacoco/0000755000175000002070000000000012654402377022446 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/jacoco-operator/org/jacoco/PaxHeaders.17941/operator0000644000000000000000000000013212654402377023501 xustar0030 mtime=1454507263.279432021 30 atime=1454507658.776157397 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/jacoco-operator/org/jacoco/operator/0000755000175000002070000000000012654402377024301 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/jacoco-operator/org/jacoco/operator/PaxHeaders.17941/ReportGenerator.java0000644000000000000000000000013112654402377027542 xustar0030 mtime=1454507263.279432021 29 atime=1454507327.18957967 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/jacoco-operator/org/jacoco/operator/ReportGenerator.java0000644000175000002070000002454612654402377030301 0ustar00jvanekmock00000000000000/* Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package org.jacoco.operator; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; import java.util.ArrayList; import java.util.List; import org.jacoco.core.analysis.Analyzer; import org.jacoco.core.analysis.CoverageBuilder; import org.jacoco.core.analysis.IBundleCoverage; import org.jacoco.core.data.ExecutionDataReader; import org.jacoco.core.data.ExecutionDataStore; import org.jacoco.core.data.SessionInfoStore; import org.jacoco.report.DirectorySourceFileLocator; import org.jacoco.report.FileMultiReportOutput; import org.jacoco.report.IReportVisitor; import org.jacoco.report.MultiSourceFileLocator; import org.jacoco.report.html.HTMLFormatter; import org.jacoco.report.xml.XMLFormatter; /** * This example creates a HTML report for eclipse like projects based on a * single execution data store called jacoco.exec. The report contains no * grouping information. * * The class files under test must be compiled with debug information, otherwise * source highlighting will not work. * * Originally based on: * http://www.eclemma.org/jacoco/trunk/doc/examples/java/ReportGenerator.java */ public class ReportGenerator implements Runnable { private final String title; private final File executionDataFile; private final List classesDirectories = new ArrayList(1); private final List sourceDirectories = new ArrayList(1); private File reportDirectory; private File xmlOutput; private ExecutionDataStore executionDataStore; private SessionInfoStore sessionInfoStore; private String XML_DEF_NAME = "coverage-summary.xml"; /** * Create a new generator based for the given project. * * @param projectDirectory */ public ReportGenerator(final File projectDirectory) { this.title = projectDirectory.getName(); this.executionDataFile = new File(projectDirectory, MergeTask.DEFAULT_NAME); this.classesDirectories.add(new File(projectDirectory, "bin")); this.sourceDirectories.add(new File(projectDirectory, "src")); this.reportDirectory = new File(projectDirectory, "coveragereport"); this.xmlOutput = new File(projectDirectory, XML_DEF_NAME); } public ReportGenerator(String title, File exec, File classes, File sources, File htmlReport, File xmlReport) { this.title = title; this.executionDataFile = exec; if (classes != null) { this.classesDirectories.add(classes); } if (sources != null) { this.sourceDirectories.add(sources); } this.reportDirectory = htmlReport; this.xmlOutput = xmlReport; } public ReportGenerator(String title, File exec, List classes, List sources, File htmlReport, File xmlReport) { this.title = title; this.executionDataFile = exec; if (classes != null) { this.classesDirectories.addAll(classes); } if (sources != null) { this.sourceDirectories.addAll(sources); } this.reportDirectory = htmlReport; this.xmlOutput = xmlReport; } public ReportGenerator(String title, File exec, List classes, List sources, File report) { this.title = title; this.executionDataFile = exec; if (classes != null) { this.classesDirectories.addAll(classes); } if (sources != null) { this.sourceDirectories.addAll(sources); } this.reportDirectory = report; this.xmlOutput = new File(report, XML_DEF_NAME); } public ReportGenerator(String title, File exec, File htmlReport, File xmlReport) { this.title = title; this.executionDataFile = exec; this.reportDirectory = htmlReport; this.xmlOutput = xmlReport; } public ReportGenerator(String title, File exec, File report) { this.title = title; this.executionDataFile = exec; this.reportDirectory = report; this.xmlOutput = new File(report, XML_DEF_NAME); } public void addSource(File f) { sourceDirectories.add(f); } public void addClasses(File f) { classesDirectories.add(f); } /** * Create the report. * * @throws IOException */ public void execute() throws IOException { // Read the jacoco.exec file. Multiple data stores could be merged // at this point loadExecutionData(); // Run the structure analyzer on a single class folder to build up // the coverage model. The process would be similar if your classes // were in a jar file. Typically you would create a bundle for each // class folder and each jar you want in your report. If you have // more than one bundle you will need to add a grouping node to your // report final IBundleCoverage bundleCoverage = analyzeStructure(); if (reportDirectory != null) { createHtmlReport(bundleCoverage); } if (xmlOutput != null) { createXmlReport(bundleCoverage); } } private void createHtmlReport(final IBundleCoverage bundleCoverage) throws IOException { // Create a concrete report visitor based on some supplied // configuration. In this case we use the defaults final HTMLFormatter htmlFormatter = new HTMLFormatter(); final IReportVisitor visitor = htmlFormatter.createVisitor(new FileMultiReportOutput(reportDirectory)); // Initialize the report with all of the execution and session // information. At this point the report doesn't know about the // structure of the report being created visitor.visitInfo(sessionInfoStore.getInfos(), executionDataStore.getContents()); // Populate the report structure with the bundle coverage information. // Call visitGroup if you need groups in your report. MultiSourceFileLocator msf = new MultiSourceFileLocator(4); for (File file : sourceDirectories) { msf.add(new DirectorySourceFileLocator( file, "utf-8", 4)); } visitor.visitBundle(bundleCoverage, msf); // Signal end of structure information to allow report to write all // information out visitor.visitEnd(); } private void createXmlReport(final IBundleCoverage bundleCoverage) throws IOException { OutputStream fos = new FileOutputStream(xmlOutput); try { // Create a concrete report visitor based on some supplied // configuration. In this case we use the defaults final XMLFormatter htmlFormatter = new XMLFormatter(); final IReportVisitor visitor = htmlFormatter.createVisitor(fos); // Initialize the report with all of the execution and session // information. At this point the report doesn't know about the // structure of the report being created visitor.visitInfo(sessionInfoStore.getInfos(), executionDataStore.getContents()); // Populate the report structure with the bundle coverage information. // Call visitGroup if you need groups in your report. visitor.visitBundle(bundleCoverage, null); // Signal end of structure information to allow report to write all // information out visitor.visitEnd(); } finally { if (fos != null) { fos.close(); } } } private void loadExecutionData() throws IOException { final FileInputStream fis = new FileInputStream(executionDataFile); try { final ExecutionDataReader executionDataReader = new ExecutionDataReader( fis); executionDataStore = new ExecutionDataStore(); sessionInfoStore = new SessionInfoStore(); executionDataReader.setExecutionDataVisitor(executionDataStore); executionDataReader.setSessionInfoVisitor(sessionInfoStore); while (executionDataReader.read()) { } } finally { if (fis != null) { fis.close(); } } } private IBundleCoverage analyzeStructure() throws IOException { final CoverageBuilder coverageBuilder = new CoverageBuilder(); final Analyzer analyzer = new Analyzer(executionDataStore, coverageBuilder); for (File file : classesDirectories) { analyzer.analyzeAll(file); } return coverageBuilder.getBundle(title); } @Override public void run() { try { execute(); } catch (IOException ex) { throw new RuntimeException(ex); } } } icedtea-web-1.6.2/tests/jacoco-operator/org/jacoco/operator/PaxHeaders.17941/MergeTask.java0000644000000000000000000000013112654402377026302 xustar0030 mtime=1454507263.279432021 29 atime=1454507327.18957967 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/jacoco-operator/org/jacoco/operator/MergeTask.java0000644000175000002070000001217312654402377027032 0ustar00jvanekmock00000000000000/* Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package org.jacoco.operator; import java.io.BufferedOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import org.jacoco.core.data.ExecutionDataReader; import org.jacoco.core.data.ExecutionDataStore; import org.jacoco.core.data.ExecutionDataWriter; import org.jacoco.core.data.SessionInfoStore; /** * Task for merging a set of execution data store files into a single file * * Inspired by: * https://raw.github.com/jacoco/jacoco/master/org.jacoco.ant/src/org/jacoco/ant/MergeTask.java */ public class MergeTask implements Runnable { public static final String DEFAULT_NAME = "jacoco.exec"; private File destfile; private final List files = new ArrayList(1); public MergeTask(File destfile) { this.destfile = destfile; } public MergeTask(File destfile, List inputs) { this.destfile = destfile; files.addAll(inputs); } /** * Sets the location of the merged data store * * @param destfile Destination data store location */ public void setDestfile(final File destfile) { this.destfile = destfile; } public void addInputFile(final File input) { if (input != null) { files.add(input); } } public void addInputFiles(final List input) { files.addAll(input); } public void execute() throws IOException { if (destfile == null) { throw new RuntimeException("Destination file must be supplied"); } final SessionInfoStore infoStore = new SessionInfoStore(); final ExecutionDataStore dataStore = new ExecutionDataStore(); loadSourceFiles(infoStore, dataStore); OutputStream outputStream = null; try { outputStream = new BufferedOutputStream(new FileOutputStream( destfile)); final ExecutionDataWriter dataWriter = new ExecutionDataWriter( outputStream); infoStore.accept(dataWriter); dataStore.accept(dataWriter); } finally { if (outputStream != null) { outputStream.close(); } } } private void loadSourceFiles(final SessionInfoStore infoStore, final ExecutionDataStore dataStore) throws IOException { if (files == null || files.isEmpty()) { throw new RuntimeException("No input files"); } final Iterator resourceIterator = files.iterator(); while (resourceIterator.hasNext()) { final File resource = (File) resourceIterator.next(); if (resource.isDirectory()) { continue; } InputStream resourceStream = null; try { resourceStream = new FileInputStream(resource); final ExecutionDataReader reader = new ExecutionDataReader( resourceStream); reader.setSessionInfoVisitor(infoStore); reader.setExecutionDataVisitor(dataStore); reader.read(); } finally { if (resourceStream != null) { resourceStream.close(); } } } } @Override public void run() { try { execute(); } catch (IOException ex) { throw new RuntimeException(ex); } } } icedtea-web-1.6.2/tests/jacoco-operator/org/jacoco/operator/PaxHeaders.17941/Main.java0000644000000000000000000000013112654402377025304 xustar0030 mtime=1454507263.278432034 29 atime=1454507327.18957967 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/jacoco-operator/org/jacoco/operator/Main.java0000644000175000002070000002762612654402377026045 0ustar00jvanekmock00000000000000/* Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package org.jacoco.operator; import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.List; /** * Commandline launcher */ public class Main { //main switches private static final String MERGE = "merge"; private static final String REPORT = "report"; //switches private static final String die_on_failure = "--die-soon"; //merge private static final String output_file = "--output-file"; private static final String input_files = "--input-files"; //report private static final String html_output = "--html-output"; private static final String xml_output = "--xml-output"; private static final String input_srcs = "--input-srcs"; private static final String input_builds = "--input-builds"; private static final String title = "--title"; private static String input_file = "--input-file"; /** * * */ private static boolean dieOnFailure = false; private static boolean warned = false; public static void main(String[] args) throws IOException { if (args.length < 2) { printHelp(); System.exit(0); } Runnable r = null; if (args[0].equalsIgnoreCase(MERGE)) { r = proceedMerge(cutFirstParam(args)); } else if (args[0].equalsIgnoreCase(REPORT)) { r = proceedReport(cutFirstParam(args)); } else { System.err.println("Unsuported main switch `" + args[0] + "`, use " + MERGE + " or " + REPORT); printHelp(); System.exit(1); } if (dieOnFailure && warned) { System.err.println(die_on_failure + " is specified and warning occured. Exiting"); System.exit(2); } r.run(); } private static void printHelp() { System.out.println("Usage: java `classpath` org.jacoco.operator.Main [" + MERGE + "|" + REPORT + "] switches/files"); System.out.println(" order of switches does not matter"); System.out.println(" Merge usage: java `classpath` org.jacoco.operator.Main " + MERGE + " " + output_file + " file " + input_files + " file file file ..."); System.out.println(" Report usage: java `classpath` org.jacoco.operator.Main " + REPORT + " " + html_output + " file " + xml_output + " file " + input_srcs + " file file file ... " + input_builds + " file file file " + title + " titleOfReport " + input_file + " file"); System.out.println("Where:"); System.out.println(" classpath should contain this application, and complete jacoco, and sometimes asm3 (depends on jacoco bundle)"); System.out.println(" " + die_on_failure + " - can be set as first parameter (after main switch), each warning then will cause exit of application"); System.out.println(" " + MERGE); System.out.println(" " + output_file + " - is file where merged inputs will be saved"); System.out.println(" " + input_files + " - is list of files which will be merged into output file"); System.out.println(" " + REPORT); System.out.println(" " + html_output + " - name of directory into which report will be generated. Should be empty or not yet exist"); System.out.println(" " + xml_output + " - is name of file into which xml report will be written"); System.out.println(" " + input_srcs + " - jars, zips or directories with java sources which will be used during report generation"); System.out.println(" " + input_builds + " - jars, zips or directories with compiled java classes, debug information must be present"); System.out.println(" " + title + " - title of report"); System.out.println(" " + input_file + " - input file with recorded coverage-run-session. By default jacoco saves into " + MergeTask.DEFAULT_NAME); } private static String[] cutFirstParam(String[] args) { String[] arg = new String[args.length - 1]; System.arraycopy(args, 1, arg, 0, arg.length); return arg; } private static Runnable proceedMerge(String[] a) throws IOException { String doing = null; String outputFile = null; List inputFiles = new ArrayList(2); for (String s : a) { if (s.startsWith("--")) { if (s.equalsIgnoreCase(die_on_failure)) { doing = null; dieOnFailure = true; } else if (s.equalsIgnoreCase(output_file)) { doing = output_file; } else if (s.equalsIgnoreCase(input_files)) { doing = input_files; } else { warnOrDie("Unknown Switch for merge " + s); doing = null; } } else { if (doing == null) { warnOrDie("Missing switch during processing of " + s); } else { if (doing.equalsIgnoreCase(output_file)) { outputFile = s; } else if (doing.equalsIgnoreCase(input_files)) { inputFiles.add(s); } else { warnOrDie("Unknown processing of switch of" + doing); } } } } throwIfNullOrEmpty(outputFile, "empty output file"); File ff = new File(outputFile); if (ff.exists()) { warnOrDie("Warning, output file " + ff.getAbsolutePath() + " exists"); } MergeTask m = new MergeTask(ff); for (String string : inputFiles) { if (checkIfNotNullOrEmpty(string)) { File f = new File(string); if (!f.exists()) { warnOrDie("Warning, input coverage " + f.getAbsolutePath() + " does not exists!"); } m.addInputFile(f); } } return m; } private static Runnable proceedReport(String[] a) throws IOException { String doing = null; String htmlDir = null; String xmlFile = null; List inputSrcs = new ArrayList(1); List inputBuilds = new ArrayList(1); String titleValue = null; String inputFile = null; for (String s : a) { if (s.startsWith("--")) { if (s.equalsIgnoreCase(die_on_failure)) { doing = null; dieOnFailure = true; } else if (s.equalsIgnoreCase(html_output)) { doing = html_output; } else if (s.equalsIgnoreCase(xml_output)) { doing = xml_output; } else if (s.equalsIgnoreCase(input_srcs)) { doing = input_srcs; } else if (s.equalsIgnoreCase(input_builds)) { doing = input_builds; } else if (s.equalsIgnoreCase(title)) { doing = title; } else if (s.equalsIgnoreCase(input_file)) { doing = input_file; } else { warnOrDie("Unknown Switch for report " + s); doing = null; } } else { if (doing == null) { warnOrDie("Missing switch during processing of " + s); } else { if (doing.equalsIgnoreCase(html_output)) { htmlDir = s; } else if (doing.equalsIgnoreCase(xml_output)) { xmlFile = s; } else if (doing.equalsIgnoreCase(input_srcs)) { inputSrcs.add(s); } else if (doing.equalsIgnoreCase(input_builds)) { inputBuilds.add(s); } else if (doing.equalsIgnoreCase(title)) { titleValue = s; } else if (doing.equalsIgnoreCase(input_file)) { inputFile = s; } else { warnOrDie("Unknown processing of switch of " + doing); } } } } File finalHtmlFile = null; if (checkIfNotNullOrEmpty(htmlDir)) { finalHtmlFile = new File(htmlDir); if (finalHtmlFile.exists()) { warnOrDie("Warning, direcotry for html report exists! " + finalHtmlFile.getAbsolutePath()); } } File finalXmlFile = null; if (checkIfNotNullOrEmpty(xmlFile)) { finalXmlFile = new File(xmlFile); if (finalXmlFile.exists()) { warnOrDie("Warning, file for xml report exists! " + finalHtmlFile.getAbsolutePath()); } } if (chckIfNUllOrEmpty(titleValue)) { titleValue = "Coverage report"; } throwIfNullOrEmpty(inputFile, "No coverage data file specified!"); File finalInputFile = new File(inputFile); ReportGenerator rg = new ReportGenerator(titleValue, finalInputFile, finalHtmlFile, finalXmlFile); for (String string : inputSrcs) { if (checkIfNotNullOrEmpty(string)) { File f = new File(string); if (!f.exists()) { warnOrDie("Warning, input source " + f.getAbsolutePath() + " does not exists!"); } rg.addSource(f); } } for (String string : inputBuilds) { if (checkIfNotNullOrEmpty(string)) { File f = new File(string); if (!f.exists()) { warnOrDie("Warning, input build " + f.getAbsolutePath() + " does not exists!"); } rg.addClasses(f); } } return rg; } private static String throwIfNullOrEmpty(String outputFile, String message) throws RuntimeException { if (chckIfNUllOrEmpty(outputFile)) { throw new RuntimeException(message); } return outputFile; } private static boolean checkIfNotNullOrEmpty(String string) { return string != null && string.trim().length() != 0; } private static boolean chckIfNUllOrEmpty(String outputFile) { return outputFile == null || outputFile.trim().length() == 0; } private static void warnOrDie(String string) { System.err.println(string); warned = true; } } icedtea-web-1.6.2/tests/PaxHeaders.17941/cpp-unit-tests0000644000000000000000000000013212654402377017431 xustar0030 mtime=1454507263.278432034 30 atime=1454507658.776157397 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/cpp-unit-tests/0000755000175000002070000000000012654402377020231 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/cpp-unit-tests/PaxHeaders.17941/main.cc0000644000000000000000000000013212654402377020741 xustar0030 mtime=1454507263.278432034 30 atime=1454507327.188579683 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/cpp-unit-tests/main.cc0000644000175000002070000001254212654402377021470 0ustar00jvanekmock00000000000000/* Copyright (C) 2012 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ // The test runner. // Note that all modules compiled with the TEST macro will append tests to // a global test list, that is accessible via Test::GetTestList(). #include #include #include #include #include "IcedTeaNPPlugin.h" #include "browser_mock.h" #include "MemoryLeakDetector.h" #include "checked_allocations.h" using namespace UnitTest; static std::string full_testname(const TestDetails& details) { std::string suite = details.suiteName; if (suite == "DefaultSuite") { return details.testName; } else { return suite + "." + details.testName; } } // Important for testing purposes of eg leaks between tests static void reset_global_state() { browsermock_clear_state(); MemoryLeakDetector::reset_global_state(); } class IcedteaWebUnitTestReporter: public TestReporter { public: IcedteaWebUnitTestReporter() { // Unfortunately, there is no 'ReportSuccess' // We use 'did_finish_correctly' to track successes did_finish_correctly = false; } virtual void ReportTestStart(const TestDetails& test) { reset_global_state(); pretest_allocs = cpp_unfreed_allocations(); did_finish_correctly = true; } virtual void ReportFailure(const TestDetails& details, char const* failure) { std::string testname = full_testname(details); printf("FAILED: %s line %d (%s)\n", testname.c_str(), details.lineNumber, failure); did_finish_correctly = false; } virtual void ReportTestFinish(const TestDetails& details, float secondsElapsed) { reset_global_state(); int posttest_allocs = cpp_unfreed_allocations(); std::string testname = full_testname(details); if (browsermock_unfreed_allocations() > 0) { printf("*** WARNING: %s has a memory leak! %d more NPAPI allocations than frees!\n", testname.c_str(), browsermock_unfreed_allocations()); } if (posttest_allocs > pretest_allocs) { printf("*** WARNING: %s has a memory leak! %d more operator 'new' allocations than 'delete's!\n", testname.c_str(), posttest_allocs - pretest_allocs); } if (did_finish_correctly) { printf("Passed: %s\n", testname.c_str()); } } virtual void ReportSummary(int totalTestCount, int failedTestCount, int failureCount, float secondsElapsed) { if (failedTestCount > 0) { printf("TEST SUITE FAILURE: Not all tests have passed!\n"); } printf("Total tests run: %d\n", totalTestCount); printf("Test results: passed: %d; failed: %d\n", totalTestCount - failedTestCount, failedTestCount); } private: int pretest_allocs; bool did_finish_correctly; }; static int run_icedtea_web_unit_tests() { IcedteaWebUnitTestReporter reporter; TestRunner runner(reporter); return runner.RunTestsIf(Test::GetTestList(), NULL /*All suites*/, True() /*All tests*/, 0 /*No time limit*/); } /* Spawns the Java-side of the plugin, create request processing threads, * and sets up a mocked 'browser' environment. */ static void initialize_plugin_components() { NPNetscapeFuncs mocked_browser_functions = browsermock_create_table(); NPPluginFuncs unused_plugin_functions; memset(&unused_plugin_functions, 0, sizeof(NPPluginFuncs)); unused_plugin_functions.size = sizeof(NPPluginFuncs); NP_Initialize (&mocked_browser_functions, &unused_plugin_functions); start_jvm_if_needed(); } int main() { initialize_plugin_components(); int exitcode = run_icedtea_web_unit_tests(); return exitcode; } icedtea-web-1.6.2/tests/cpp-unit-tests/PaxHeaders.17941/checked_allocations.h0000644000000000000000000000013212654402377023635 xustar0030 mtime=1454507263.278432034 30 atime=1454507327.188579683 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/cpp-unit-tests/checked_allocations.h0000644000175000002070000000433612654402377024366 0ustar00jvanekmock00000000000000/* Copyright (C) 2012 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ // Overrides global 'new' operator with one that does error checking. #ifndef CHECKED_ALLOCATIONS_H_ #define CHECKED_ALLOCATIONS_H_ #include #include #include #include #include #include #include //GNU extension // Classes that play nice with custom-defined operator new by using 'vanilla' malloc typedef __gnu_cxx::malloc_allocator SafeAllocator; typedef std::set, SafeAllocator> AllocationSet; int cpp_unfreed_allocations(); #endif /* CHECKED_ALLOCATIONS_H_ */ icedtea-web-1.6.2/tests/cpp-unit-tests/PaxHeaders.17941/checked_allocations.cc0000644000000000000000000000013212654402377023773 xustar0030 mtime=1454507263.277432047 30 atime=1454507327.188579683 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/cpp-unit-tests/checked_allocations.cc0000644000175000002070000000566012654402377024525 0ustar00jvanekmock00000000000000/* Copyright (C) 2012 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ // Overrides global 'new' operator with one that does error checking. #include #include #include "checked_allocations.h" // We keep a set of allocations, that, for obvious reasons, does not itself use the 'new' operator. static AllocationSet* __allocations = NULL; // Override global definition of new and delete! void* operator new(size_t size) throw (std::bad_alloc) { if (!__allocations) { // This uses placement-new, which calls the constructor on a specific memory location // This is needed because we cannot call 'new' in this context, nor can we rely on static-initialization // for the set to occur before any call to 'new'! void* memory = malloc(sizeof(AllocationSet)); __allocations = new (memory) AllocationSet(); } void* mem = malloc(size); if (mem == 0) { throw std::bad_alloc(); // ANSI/ISO compliant behavior } __allocations->insert(mem); return mem; } void operator delete(void* ptr) throw () { if (__allocations->erase(ptr)) { free(ptr); } else { printf( "Attempt to free memory with operator 'delete' that was not allocated by 'new'!\n"); CHECK(false); } } int cpp_unfreed_allocations() { return __allocations->size(); } icedtea-web-1.6.2/tests/cpp-unit-tests/PaxHeaders.17941/browser_mock_npidentifier.h0000644000000000000000000000013212654402377025113 xustar0030 mtime=1454507263.277432047 30 atime=1454507327.188579683 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/cpp-unit-tests/browser_mock_npidentifier.h0000644000175000002070000000453412654402377025644 0ustar00jvanekmock00000000000000/* Copyright (C) 2013 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ /* * browser_mock_npidentifier.h: * Handles NPAPI functions related to NPIdentifier, NPIdentifier has the following constraints: * - Unique for each integer & string * - Should not interfere with leak detection, so use malloc-based allocators (specified by templates) everywhere. */ #ifndef __BROWSER_MOCK_NPIDENTIFIER_H__ #define __BROWSER_MOCK_NPIDENTIFIER_H__ #include #include NPIdentifier browsermock_getstringidentifier(const NPUTF8* name); NPIdentifier browsermock_getintidentifier(int i); bool browsermock_identifierisstring(NPIdentifier identifier); NPUTF8* browsermock_utf8fromidentifier(NPIdentifier identifier); #endif // __BROWSER_MOCK_NPIDENTIFIER_H__ icedtea-web-1.6.2/tests/cpp-unit-tests/PaxHeaders.17941/browser_mock_npidentifier.cc0000644000000000000000000000013212654402377025251 xustar0030 mtime=1454507263.277432047 30 atime=1454507327.188579683 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/cpp-unit-tests/browser_mock_npidentifier.cc0000644000175000002070000001123212654402377025773 0ustar00jvanekmock00000000000000/* Copyright (C) 2013 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #include #include #include "IcedTeaNPPlugin.h" #include "checked_allocations.h" #include "browser_mock_npidentifier.h" struct MockedNPIdentifier_t; // foward declare typedef std::basic_string, SafeAllocator> SafeString; typedef std::map, SafeAllocator> SafeIntToIDMap; typedef std::map, SafeAllocator> SafeStringToIDMap; // Handles creation of NPIdentifier // Carefully avoids operator new so as not to interfere with leak detection. // This mimics browser internal state. struct MockedNPIdentifier_t { SafeString string; int integer; bool is_integer; // If false, it is a string // Carefully avoids operator new so as not to interfere with leak detection static MockedNPIdentifier_t* safe_allocate(SafeString str) { MockedNPIdentifier_t* mem = (MockedNPIdentifier_t*)malloc(sizeof(MockedNPIdentifier_t)); new (&mem->string) SafeString(str); mem->integer = -1; mem->is_integer = false; return mem; } // Carefully avoids operator new so as not to interfere with leak detection static MockedNPIdentifier_t* safe_allocate(int i) { MockedNPIdentifier_t* mem = (MockedNPIdentifier_t*) malloc( sizeof(MockedNPIdentifier_t)); new (&mem->string) SafeString(); mem->integer = i; mem->is_integer = true; return mem; } }; // Mimics global browser data. OK if not cleared in-between tests, does not change semantics. // Used to ensure NPIdentifiers are unique. Never freed. static SafeIntToIDMap __np_int_identifiers; static SafeStringToIDMap __np_string_identifiers; // Carefully avoids operator new so as not to interfere with leak detection NPIdentifier browsermock_getstringidentifier(const NPUTF8* name) { SafeString safe_copy(name); if (__np_string_identifiers.find(safe_copy) == __np_string_identifiers.end()) { __np_string_identifiers[safe_copy] = MockedNPIdentifier_t::safe_allocate(safe_copy); } return __np_string_identifiers[safe_copy]; } // Carefully avoids operator new so as not to interfere with leak detection NPIdentifier browsermock_getintidentifier(int i) { if (__np_int_identifiers.find(i) == __np_int_identifiers.end()) { __np_int_identifiers[i] = MockedNPIdentifier_t::safe_allocate(i); } return __np_int_identifiers[i]; } bool browsermock_identifierisstring(NPIdentifier identifier) { MockedNPIdentifier_t* contents = (MockedNPIdentifier_t*)identifier; return !contents->is_integer; } NPUTF8* browsermock_utf8fromidentifier(NPIdentifier identifier) { MockedNPIdentifier_t* contents = (MockedNPIdentifier_t*)identifier; if (contents->is_integer) { return NULL; } // We expect this string to be freed with 'memfree' NPUTF8* copy = (NPUTF8*) browser_functions.memalloc(contents->string.size() + 1); memcpy(copy, contents->string.c_str(), contents->string.size() + 1); return copy; } icedtea-web-1.6.2/tests/cpp-unit-tests/PaxHeaders.17941/browser_mock.h0000644000000000000000000000013212654402377022353 xustar0030 mtime=1454507263.277432047 30 atime=1454507327.188579683 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/cpp-unit-tests/browser_mock.h0000644000175000002070000000423412654402377023101 0ustar00jvanekmock00000000000000/* Copyright (C) 2012 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ // Browser mock functions. // This sets up a mock for unit testing purposes that puts simple // functions in the 'browserfunctions' table. This enables unit testing // of some functions that would otherwise not be possible. // Add additional mock functions in browser_mock.cc as needed #ifndef __BROWSER_MOCK_H__ #define __BROWSER_MOCK_H__ #include NPNetscapeFuncs browsermock_create_table(); void browsermock_clear_state(); int browsermock_unfreed_allocations(); #endif // __BROWSER_MOCK_H__ icedtea-web-1.6.2/tests/cpp-unit-tests/PaxHeaders.17941/browser_mock.cc0000644000000000000000000000013212654402377022511 xustar0030 mtime=1454507263.276432061 30 atime=1454507327.188579683 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/cpp-unit-tests/browser_mock.cc0000644000175000002070000001164312654402377023241 0ustar00jvanekmock00000000000000/* Copyright (C) 2012 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ // Browser mock functions. Add more as needed. #include #include #include #include #include "checked_allocations.h" #include "UnitTest++.h" #include "browser_mock.h" #include "browser_mock_npidentifier.h" // 'Browser' global data // Stores NPAPI allocations static AllocationSet __allocations; // Mocked functions // It is expected that these will only run during a unit test static void* mock_memalloc(uint32_t size) { void* mem = malloc(size); __allocations.insert(mem); return mem; } static void mock_memfree(void* ptr) { if (__allocations.erase(ptr)) { free(ptr); } else { printf("Attempt to free memory with browserfunctions.memfree that was not allocated by the browser!\n"); CHECK(false); } } static NPObject* mock_retainobject(NPObject* obj) { obj->referenceCount++; return obj; } static void mock_releaseobject(NPObject* obj) { if (--(obj->referenceCount) == 0) { if (obj->_class->deallocate) { obj->_class->deallocate(obj); } else { mock_memfree(obj); } } } static void mock_releasevariantvalue(NPVariant* variant) { if (variant->type == NPVariantType_String) { /* Only string and object values require freeing */ mock_memfree((void*)variant->value.stringValue.UTF8Characters); } else if (variant->type == NPVariantType_Object) { mock_releaseobject(variant->value.objectValue); } } static NPObject* mock_createobject(NPP instance, NPClass* np_class) { NPObject* obj; if (np_class->allocate) { obj = np_class->allocate(instance, np_class); } else { obj = (NPObject*) mock_memalloc(sizeof(NPObject)); } obj->referenceCount = 1; obj->_class = np_class; return obj; } static bool mock_getproperty(NPP npp, NPObject* obj, NPIdentifier property_name, NPVariant* result) { if (obj->_class->getProperty) { return obj->_class->getProperty(obj, property_name, result); } else { return false; } } static bool mock_setproperty(NPP npp, NPObject* obj, NPIdentifier property_name, const NPVariant* value) { if (obj->_class->setProperty) { return obj->_class->setProperty(obj, property_name, value); } else { return false; } } NPNetscapeFuncs browsermock_create_table() { NPNetscapeFuncs browser_functions; memset(&browser_functions, 0, sizeof(NPNetscapeFuncs)); browser_functions.size = sizeof(NPNetscapeFuncs); browser_functions.memalloc = &mock_memalloc; browser_functions.memfree = &mock_memfree; browser_functions.createobject = &mock_createobject; browser_functions.retainobject = &mock_retainobject; browser_functions.releaseobject = &mock_releaseobject; browser_functions.releasevariantvalue = &mock_releasevariantvalue; browser_functions.setproperty = &mock_setproperty; browser_functions.getproperty = &mock_getproperty; browser_functions.utf8fromidentifier = &browsermock_utf8fromidentifier; browser_functions.getstringidentifier = &browsermock_getstringidentifier; browser_functions.identifierisstring = &browsermock_identifierisstring; return browser_functions; } void browsermock_clear_state() { __allocations.clear(); } int browsermock_unfreed_allocations() { return __allocations.size(); } icedtea-web-1.6.2/tests/cpp-unit-tests/PaxHeaders.17941/PluginParametersTest.cc0000644000000000000000000000013212654402377024137 xustar0030 mtime=1454507263.276432061 30 atime=1454507327.188579683 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/cpp-unit-tests/PluginParametersTest.cc0000644000175000002070000000660212654402377024666 0ustar00jvanekmock00000000000000/* Copyright (C) 2012 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ /****************************************************************************** * Unit tests for functions related to sending applet parameters * * (key value pairs). * ******************************************************************************/ #include #include "IcedTeaNPPlugin.h" /* Not normally exposed */ std::string escape_parameter_string(const char* to_encode); TEST(escape_parameter_string) { CHECK_EQUAL("\\n", escape_parameter_string("\n")); CHECK_EQUAL("\\\\", escape_parameter_string("\\")); CHECK_EQUAL("\\:", escape_parameter_string(";")); CHECK_EQUAL(std::string("test") + "\\n" + "\\\\" + "\\:", escape_parameter_string("test\n\\;")); } /* Not normally exposed */ std::string plugin_parameters_string(int argc, char* argn[], char* argv[]); TEST(plugin_parameters_string) { /* test empty */{ const char* argn[] = { "" }; const char* argv[] = { "" }; CHECK_EQUAL("", plugin_parameters_string(0, (char**)argn, (char**)argv)); } /* test simple key & value */{ const char* argn[] = { "key" }; const char* argv[] = { "value" }; CHECK_EQUAL("key;value;", plugin_parameters_string(1, (char**)argn, (char**)argv)); } /* test key & value characters that require escaping */{ const char* argn[] = { "key\\" }; const char* argv[] = { "value;" }; CHECK_EQUAL("key\\\\;value\\:;", plugin_parameters_string(1, (char**)argn, (char**)argv)); } /* multiple key & value pairs that require escaping*/{ const char* argn[] = { "key1\\", "key2\\" }; const char* argv[] = { "value1;", "value2;" }; CHECK_EQUAL("key1\\\\;value1\\:;key2\\\\;value2\\:;", plugin_parameters_string(2, (char**)argn, (char**)argv)); } } icedtea-web-1.6.2/tests/cpp-unit-tests/PaxHeaders.17941/MemoryLeakDetector.h0000644000000000000000000000013212654402377023416 xustar0030 mtime=1454507263.276432061 30 atime=1454507327.187579697 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/cpp-unit-tests/MemoryLeakDetector.h0000644000175000002070000000643412654402377024150 0ustar00jvanekmock00000000000000/* Copyright (C) 2013 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ // Memory leak detection helper class. // This utilizes checked_allocations.h & browser_mock.h to query how many unfreed allocations exist. // As well, it clears global state that is problematic for accurate measure of memory leaks. #ifndef MEMORYLEAKDETECTOR_H_ #define MEMORYLEAKDETECTOR_H_ #include #include "browser_mock.h" #include "checked_allocations.h" #include "IcedTeaPluginUtils.h" class MemoryLeakDetector { public: MemoryLeakDetector() { reset(); } /* Reset allocation counts and certain global state touched by the tests. * This is necessary to ensure accurate leak reporting for some functions. */ void reset() { reset_global_state(); initial_cpp_allocations = cpp_unfreed_allocations(); initial_npapi_allocations = browsermock_unfreed_allocations(); } /* Return allocation counts, after clearing global state that can conflict with the * leak detection. */ int memory_leaks() { reset_global_state(); int cpp_leaks = cpp_unfreed_allocations() - initial_cpp_allocations; int npapi_leaks = browsermock_unfreed_allocations() - initial_npapi_allocations; return cpp_leaks + npapi_leaks; } static void reset_global_state() { /* Clears allocations caused by storeInstanceID */ IcedTeaPluginUtilities::clearInstanceIDs(); /* Clears allocations caused by storeObjectMapping */ IcedTeaPluginUtilities::clearObjectMapping(); /*reset messages*/ reset_pre_init_messages(); } int initial_cpp_allocations; int initial_npapi_allocations; }; #endif /* MEMORYLEAKDETECTOR_H_ */ icedtea-web-1.6.2/tests/cpp-unit-tests/PaxHeaders.17941/IcedTeaScriptablePluginObjectTest.cc0000644000000000000000000000013212654402377026472 xustar0030 mtime=1454507263.276432061 30 atime=1454507327.187579697 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/cpp-unit-tests/IcedTeaScriptablePluginObjectTest.cc0000644000175000002070000001250112654402377027214 0ustar00jvanekmock00000000000000/* Copyright (C) 2012 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #include #include #include "browser_mock.h" #include "MemoryLeakDetector.h" #include "IcedTeaScriptablePluginObject.h" #include "IcedTeaPluginUtils.h" static NPP_t dummy_npp = {0,0}; SUITE(IcedTeaScriptablePluginObject) { TEST(destructor) { MemoryLeakDetector leak_detector; IcedTeaScriptablePluginObject* obj = new IcedTeaScriptablePluginObject(&dummy_npp); delete obj; CHECK(leak_detector.memory_leaks() == 0); } } SUITE(IcedTeaScriptableJavaObject) { TEST(deallocate) { MemoryLeakDetector leak_detector; IcedTeaScriptableJavaObject* obj = new IcedTeaScriptableJavaObject(&dummy_npp); IcedTeaScriptableJavaObject::deAllocate(obj); CHECK(leak_detector.memory_leaks() == 0); } TEST(get_scriptable_java_object) { MemoryLeakDetector leak_detector; NPObject* first_obj = IcedTeaScriptableJavaObject::get_scriptable_java_object(&dummy_npp, "DummyClass", "DummyInstance", false); browser_functions.releaseobject(first_obj); /* After the first call, the object should be cached in the object map */ NPObject* second_obj = IcedTeaScriptableJavaObject::get_scriptable_java_object(&dummy_npp, "DummyClass", "DummyInstance", false); /* Objects should be the same, because of caching */ CHECK(first_obj == second_obj); browser_functions.releaseobject(second_obj); CHECK(leak_detector.memory_leaks() == 0); } } SUITE(IcedTeaScriptableJavaPackageObject) { TEST(deallocate) { MemoryLeakDetector leak_detector; IcedTeaScriptableJavaPackageObject* obj = new IcedTeaScriptableJavaPackageObject(&dummy_npp); IcedTeaScriptableJavaPackageObject::deAllocate(obj); CHECK(leak_detector.memory_leaks() == 0); } TEST(get_scriptable_java_object) { MemoryLeakDetector leak_detector; NPObject* obj = IcedTeaScriptableJavaPackageObject::get_scriptable_java_package_object(&dummy_npp, "DummyPackage"); browser_functions.releaseobject(obj); CHECK(leak_detector.memory_leaks() == 0); } static NPVariant np_checked_get(NPObject* obj, const char* identifier) { NPVariant result; CHECK(browser_functions.getproperty(&dummy_npp, obj, browser_functions.getstringidentifier(identifier), &result)); return result; } /* NOTICE: Requires icedtea-web Java-side to be running! * Loads java.lang.Integer.MAX_VALUE */ TEST(getProperty) { MemoryLeakDetector leak_detector; /* Ensure destruction */{ /* Get the 'root' package */ NPObject* obj = IcedTeaScriptableJavaPackageObject::get_scriptable_java_package_object(&dummy_npp, ""); // Look up java.lang.Integer.MAX_VALUE NPVariant java_result = np_checked_get(obj, "java"); NPVariant lang_result = np_checked_get(NPVARIANT_TO_OBJECT(java_result), "lang"); NPVariant integer_result = np_checked_get(NPVARIANT_TO_OBJECT(lang_result), "Integer"); NPVariant max_value_result = np_checked_get(NPVARIANT_TO_OBJECT(integer_result), "MAX_VALUE"); // Check that it is indeed equal to 2147483647 CHECK(NPVARIANT_IS_INT32(max_value_result)); CHECK_EQUAL(2147483647, NPVARIANT_TO_INT32(max_value_result)); browser_functions.releasevariantvalue(&java_result); browser_functions.releasevariantvalue(&lang_result); browser_functions.releasevariantvalue(&integer_result); browser_functions.releasevariantvalue(&max_value_result); browser_functions.releaseobject(obj); } CHECK(leak_detector.memory_leaks() == 0); } } icedtea-web-1.6.2/tests/cpp-unit-tests/PaxHeaders.17941/IcedTeaPluginUtilsTest.cc0000644000000000000000000000013212654402377024353 xustar0030 mtime=1454507263.275432074 30 atime=1454507327.187579697 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/cpp-unit-tests/IcedTeaPluginUtilsTest.cc0000644000175000002070000003032512654402377025101 0ustar00jvanekmock00000000000000/* Copyright (C) 2012 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #include #include #include #include #include "browser_mock.h" #include "MemoryLeakDetector.h" #include "IcedTeaPluginUtils.h" #include "IcedTeaNPPlugin.h" void doDebugErrorRun(); TEST(NPVariantAsString) { NPVariant var; STRINGZ_TO_NPVARIANT("test", var); std::string cppstr = IcedTeaPluginUtilities::NPVariantAsString(var); CHECK_EQUAL("test", cppstr); } TEST(NPStringCopy) { std::string cppstr = "test"; NPString npstr = IcedTeaPluginUtilities::NPStringCopy(cppstr); CHECK_EQUAL(4, npstr.UTF8Length); CHECK_EQUAL("test", npstr.UTF8Characters); // NPAPI states that browser allocation function should be used for NPString/NPVariant CHECK_EQUAL(1, browsermock_unfreed_allocations()); browser_functions.memfree((void*) npstr.UTF8Characters); CHECK_EQUAL(0, browsermock_unfreed_allocations()); } TEST(NPVariantStringCopy) { std::string cppstr = "test"; NPVariant npvar = IcedTeaPluginUtilities::NPVariantStringCopy(cppstr); CHECK_EQUAL(NPVariantType_String, npvar.type); CHECK_EQUAL(4, npvar.value.stringValue.UTF8Length); CHECK_EQUAL("test", npvar.value.stringValue.UTF8Characters); CHECK_EQUAL(1, browsermock_unfreed_allocations()); browser_functions.memfree((void*) npvar.value.stringValue.UTF8Characters); CHECK_EQUAL(0, browsermock_unfreed_allocations()); } TEST(NPIdentifierAsString) { const char test_string[] = "foobar"; MemoryLeakDetector leak_detector; /* Ensure destruction */{ std::string str = IcedTeaPluginUtilities::NPIdentifierAsString( browser_functions.getstringidentifier(test_string)); CHECK_EQUAL(test_string, str); } CHECK_EQUAL(0, leak_detector.memory_leaks()); } TEST(trim) { std::string toBeTrimmed = std::string(" testX "); IcedTeaPluginUtilities::trim (toBeTrimmed); CHECK_EQUAL("testX", toBeTrimmed); std::string toBeTrimmed2 = std::string(" \t testX\n"); IcedTeaPluginUtilities::trim (toBeTrimmed2); CHECK_EQUAL("testX", toBeTrimmed2); std::string toBeTrimmed3 = std::string(" \t \n te \n stX\n"); IcedTeaPluginUtilities::trim (toBeTrimmed3); CHECK_EQUAL("te \n stX", toBeTrimmed3); } TEST(unescape1) { std::string toBeEscaped = std::string("he\\\\=llo\\=my=boy\\\\ who :liv\\es in\\: space \\ and \\\\likes\\"); /*he\\=llo\=my=boy\\ who :liv\es in\: space \ and \\likes\ */ IcedTeaPluginUtilities::unescape(toBeEscaped); /* \\= -> \= , \= -> = , \\ -> \ , \e -> \e , \: -> : , \ -> \ , \\ -> \*/ /*he\=llo=my=boy\ who :liv\es in: space \ and \likes\ */ CHECK_EQUAL("he\\=llo=my=boy\\ who :liv\\es in: space \\ and \\likes\\", toBeEscaped); } TEST(unescape2) { std::string toBeEscaped = std::string("w1\\tw2\\\\tw3\\nw4\\\\nw5\\="); /*w1\tw2\\tw3\nw4\\nw5\=*/ IcedTeaPluginUtilities::unescape(toBeEscaped); /*w1TABw2\tw3NWLINEw4\nw5=*/ CHECK_EQUAL("w1\tw2\\tw3\nw4\\nw5=", toBeEscaped); } TEST(unescape3) { std::string toBeEscaped = std::string("w1\\rw2\\\\rw3="); IcedTeaPluginUtilities::unescape(toBeEscaped); CHECK_EQUAL("w1\rw2\\rw3=", toBeEscaped); } /* Creates a temporary file with the specified contents */ static std::string temporary_file(const std::string& contents) { std::string path = tmpnam(NULL); /* POSIX function, fine for test suite */ std::ofstream myfile; myfile.open (path.c_str()); myfile << contents; myfile.close(); return path; } TEST(file_exists) { std::string f1 = temporary_file("dummy content"); bool a = IcedTeaPluginUtilities::file_exists(f1); CHECK_EQUAL(a, true); remove(f1.c_str()); bool b = IcedTeaPluginUtilities::file_exists(f1); CHECK_EQUAL(b, false); std::string dir = tmpnam(NULL); const int PERMISSIONS_MASK = S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH; // 0755 bool created_dir = g_mkdir(dir.c_str(), PERMISSIONS_MASK); CHECK_EQUAL(created_dir, false); CHECK_EQUAL(IcedTeaPluginUtilities::file_exists(dir), true); } TEST(is_directory) { std::string n = tmpnam(NULL); bool no_file = IcedTeaPluginUtilities::is_directory(n); CHECK_EQUAL(no_file, false); std::string f = temporary_file("dummy content"); bool is_directory = IcedTeaPluginUtilities::is_directory(f); CHECK_EQUAL(is_directory, false); std::string d = tmpnam(NULL); const int PERMISSIONS_MASK = S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH; // 0755 bool created_test_dir = g_mkdir(d.c_str(), PERMISSIONS_MASK); CHECK_EQUAL(created_test_dir, false); bool is_directory2 = IcedTeaPluginUtilities::is_directory(d); CHECK_EQUAL(is_directory2, true); } TEST(create_dir) { FILE* old1 = stdout; FILE* old2 = stderr; char* buf1 = " "; char* buf2 = " "; stdout = fmemopen (buf1, strlen (buf1), "rw"); stderr = fmemopen (buf2, strlen (buf2), "rw"); std::string f1 = tmpnam(NULL); bool res1 = IcedTeaPluginUtilities::create_dir(f1); CHECK_EQUAL(res1, true); CHECK_EQUAL(IcedTeaPluginUtilities::is_directory(f1), true); std::string f2 = temporary_file("dummy content"); bool res2 = IcedTeaPluginUtilities::create_dir(f2); CHECK_EQUAL(res2, false); CHECK_EQUAL(IcedTeaPluginUtilities::is_directory(f2), false); std::string f3 = tmpnam(NULL); const int PERMISSIONS_MASK = S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH; // 0755 bool created_test_dir = g_mkdir(f3.c_str(), PERMISSIONS_MASK); CHECK_EQUAL(created_test_dir, false); bool res3 = IcedTeaPluginUtilities::create_dir(f3); CHECK_EQUAL(res3, true); CHECK_EQUAL(IcedTeaPluginUtilities::is_directory(f3), true); std::string f4 = tmpnam(NULL); const int READONLY_PERMISSIONS_MASK = S_IRUSR | S_IRGRP | S_IROTH; // 0444 bool created_test_dir2 = g_mkdir(f4.c_str(), READONLY_PERMISSIONS_MASK); CHECK_EQUAL(created_test_dir2, false); std::string subdir = f4 + "/test"; bool res4 = IcedTeaPluginUtilities::create_dir(subdir); CHECK_EQUAL(res4, false); CHECK_EQUAL(IcedTeaPluginUtilities::is_directory(subdir), false); fclose(stdout); fclose(stderr); stdout = old1; stderr = old2; } void doDebugErrorRun(int max) { FILE* old1 = stdout; FILE* old2 = stderr; char* buf1 = " "; char* buf2 = " "; stdout = fmemopen (buf1, strlen (buf1), "rw"); stderr = fmemopen (buf2, strlen (buf2), "rw"); clock_t begin1, end1; clock_t begin2, end2; int i; std::string hello = std::string("hello"); std::string eello = std::string("eello"); begin1 = clock(); for (i = 0 ; i < max ; i++ ) { PLUGIN_DEBUG("hello \n"); PLUGIN_DEBUG("hello %s\n", hello.c_str()); PLUGIN_DEBUG("hello %d %d\n", 10 , 0.5); PLUGIN_DEBUG("hello %s %s \n", hello.c_str() , hello.c_str()); PLUGIN_DEBUG("hello %s %d %s %d\n", hello.c_str() ,10, hello.c_str(), 0.5); } end1 = clock(); begin2 = clock(); for (i = 0 ; i < max ; i++ ) { PLUGIN_ERROR("eello \n"); PLUGIN_ERROR("eello %s\n", eello.c_str()); PLUGIN_ERROR("eello %d %d\n", 10 , 0.5); PLUGIN_ERROR("eello %s %s \n", eello.c_str() , eello.c_str()); PLUGIN_ERROR("eello %s %d %s %d\n", eello.c_str() ,10, eello.c_str(), 0.5); } end2 = clock(); fclose(stdout); fclose(stderr); stdout = old1; stderr = old2; long time_spent1 = ((end1 - begin1)); long time_spent2 = ((end2 - begin2)); fprintf (stdout, " PLUGIN_DEBUG %d, ", time_spent1); fprintf (stdout, "PLUGIN_ERROR %d\n", time_spent2); } void doDebugErrorRun() { doDebugErrorRun(1000000); } /* *The family of PLUGIN_DEBUG_ERROR_PROFILING tests actually do not test. *It is just messure that the mechanisms around do not break soething fataly. */ TEST(PLUGIN_DEBUG_ERROR_PROFILING_debug_on_headers_off) { bool plugin_debug_backup = plugin_debug; bool plugin_debug_headers_backup = plugin_debug_headers; bool plugin_debug_console_backup = plugin_debug_to_console; bool plugin_debug_system_backup = plugin_debug_to_system; plugin_debug_to_console = false; plugin_debug = true; plugin_debug_to_system = false; //no need to torture system log in testing doDebugErrorRun(); plugin_debug = plugin_debug_backup; plugin_debug_headers = plugin_debug_headers_backup; plugin_debug_to_console = plugin_debug_console_backup; plugin_debug_to_system = plugin_debug_system_backup; } TEST(PLUGIN_DEBUG_ERROR_PROFILING_debug_off_headers_off) { bool plugin_debug_backup = plugin_debug; bool plugin_debug_headers_backup = plugin_debug_headers; bool plugin_debug_console_backup = plugin_debug_to_console; bool plugin_debug_system_backup = plugin_debug_to_system; plugin_debug_to_console = false; plugin_debug = false; plugin_debug_to_system = false; //no need to torture system log in testing doDebugErrorRun(); plugin_debug = plugin_debug_backup; plugin_debug_headers = plugin_debug_headers_backup; plugin_debug_to_console = plugin_debug_console_backup; plugin_debug_to_system = plugin_debug_system_backup; } TEST(PLUGIN_DEBUG_ERROR_PROFILING_debug_on_headers_on) { bool plugin_debug_backup = plugin_debug; bool plugin_debug_headers_backup = plugin_debug_headers; bool plugin_debug_console_backup = plugin_debug_to_console; bool plugin_debug_system_backup = plugin_debug_to_system; plugin_debug_to_console = false; plugin_debug = true; plugin_debug_headers = true; plugin_debug_to_system = false; //no need to torture system log in testing doDebugErrorRun(); plugin_debug = plugin_debug_backup; plugin_debug_headers = plugin_debug_headers_backup; plugin_debug_to_console = plugin_debug_console_backup; plugin_debug_to_system = plugin_debug_system_backup; } TEST(PLUGIN_DEBUG_ERROR_PROFILING_debug_off_headers_on) { bool plugin_debug_backup = plugin_debug; bool plugin_debug_headers_backup = plugin_debug_headers; bool plugin_debug_console_backup = plugin_debug_to_console; bool plugin_debug_system_backup = plugin_debug_to_system; plugin_debug_to_console = false; plugin_debug = false; plugin_debug_headers = true; plugin_debug_to_system = false; //no need to torture system log in testing doDebugErrorRun(); plugin_debug = plugin_debug_backup; plugin_debug_headers = plugin_debug_headers_backup; plugin_debug_to_console = plugin_debug_console_backup; plugin_debug_to_system = plugin_debug_system_backup; } TEST(PLUGIN_DEBUG_ERROR_PROFILING_debug_on_headers_on_syslog_on) { bool plugin_debug_backup = plugin_debug; bool plugin_debug_headers_backup = plugin_debug_headers; bool plugin_debug_console_backup = plugin_debug_to_console; bool plugin_debug_system_backup = plugin_debug_to_system; plugin_debug_to_console = false; plugin_debug = true; plugin_debug_headers = true; plugin_debug_to_system = true; doDebugErrorRun(50); plugin_debug = plugin_debug_backup; plugin_debug_headers = plugin_debug_headers_backup; plugin_debug_to_console = plugin_debug_console_backup; plugin_debug_to_system = plugin_debug_system_backup; } icedtea-web-1.6.2/tests/cpp-unit-tests/PaxHeaders.17941/IcedTeaParsePropertiesTest.cc0000644000000000000000000000013212654402377025223 xustar0030 mtime=1454507263.275432074 30 atime=1454507327.187579697 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/cpp-unit-tests/IcedTeaParsePropertiesTest.cc0000644000175000002070000004043612654402377025755 0ustar00jvanekmock00000000000000/* Copyright (C) 2012 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #include #include #include #include #include #include #include #include #include #include #include #include #include "IcedTeaParseProperties.h" using namespace std; //not exposed via IcedTeaParseProperties but needed extern void remove_all_spaces(string& str); extern bool get_property_value(string c, string& dest); extern bool starts_with(string c1, string c2); extern string user_properties_file(); extern string main_properties_file(); extern string default_java_properties_file(); //for passing three dummy files bool find_system_config_file(string main_file, string custom_jre_file, bool usecustom_jre, string default_java_file, string& dest); bool find_property(string filename, string property, string& dest); //for passing two dummy files bool read_deploy_property_value(string user_file, string system_file, bool usesystem_file, string property, string& dest); //for passing two dummy files bool find_custom_jre(string user_file, string main_file,string& dest); //end of non-public IcedTeaParseProperties api /* Creates a temporary file with the specified contents */ static string temporary_file(const string& contents) { string path = tmpnam(NULL); /* POSIX function, fine for test suite */ ofstream myfile; myfile.open (path.c_str()); myfile << contents; myfile.close(); return path; } /*private api fundamental tests*/ TEST(RemoveAllSpaces) { string toBeTrimmed = string(" te st X "); remove_all_spaces (toBeTrimmed); CHECK_EQUAL("testX", toBeTrimmed); string toBeTrimmed1 = string(" te st X "); remove_all_spaces (toBeTrimmed1); CHECK_EQUAL("testX", toBeTrimmed1); string toBeTrimmed2 = string(" \t t e\nst\tX\n"); remove_all_spaces (toBeTrimmed2); CHECK_EQUAL("testX", toBeTrimmed2); string toBeTrimmed3 = string(" \t \n te \n stX\n"); remove_all_spaces (toBeTrimmed3); CHECK_EQUAL("testX", toBeTrimmed3); } TEST(get_property_value) { string dest = string(""); bool a = get_property_value("key.key=value+eulav ",dest); CHECK_EQUAL("value+eulav", dest); CHECK_EQUAL(a, true); dest = string(""); a = get_property_value("horrible key = value/value",dest); CHECK_EQUAL("value/value", dest); CHECK_EQUAL(a, true); dest = string(""); a = get_property_value("better.key = but very horrible value ",dest); CHECK_EQUAL("but very horrible value", dest); CHECK_EQUAL(a, true); dest = string(""); a = get_property_value("better.key but errornous value ",dest); CHECK_EQUAL("", dest); CHECK_EQUAL(a, false); dest = string(""); a = get_property_value("key=nice\\=value=\\\\=with\\tescapes",dest); CHECK_EQUAL("nice=value=\\=with\tescapes", dest); CHECK_EQUAL(a, true); } TEST(starts_with) { bool a = starts_with("aa bb cc","aa b"); CHECK_EQUAL(a, true); a = starts_with("aa bb cc","aab"); CHECK_EQUAL(a, false); } TEST(user_properties_file) { string f = user_properties_file(); CHECK_EQUAL(f.find(".icedtea") >= 0, true); CHECK_EQUAL(f.find(default_file_ITW_deploy_props_name) >= 0, true); } TEST(main_properties_file) { string f = main_properties_file(); CHECK_EQUAL(f.find(default_file_ITW_deploy_props_name) >= 0, true); CHECK_EQUAL(f.find(".java") >= 0, true); } TEST(default_java_properties_file) { string f = default_java_properties_file(); CHECK_EQUAL(f.find(default_file_ITW_deploy_props_name) >= 0, true); CHECK_EQUAL(f.find("lib") >= 0, true); } TEST(find_system_config_file) { string f1 = temporary_file("key1=value1"); string f2 = temporary_file("key2=value2"); string f3 = temporary_file("key3=value3"); string dest=string(""); find_system_config_file(f1, f2, true, f3, dest); CHECK_EQUAL(f1, dest); dest=string(""); find_system_config_file(f1, f2, false, f3, dest); CHECK_EQUAL(f1, dest); remove(f1.c_str()); dest=string(""); find_system_config_file(f1, f2, true, f3, dest); CHECK_EQUAL(f2, dest); dest=string(""); find_system_config_file(f1, f2, false, f3, dest); CHECK_EQUAL(f3, dest); remove(f2.c_str()); dest=string(""); find_system_config_file(f1, f2, true, f3, dest); CHECK_EQUAL("", dest); //forcing not existing f2 dest=string(""); find_system_config_file(f1, f2, false, f3, dest); CHECK_EQUAL(f3, dest); remove(f3.c_str()); dest=string(""); find_system_config_file(f1, f2, true, f3, dest); CHECK_EQUAL("", dest); dest=string(""); find_system_config_file(f1, f2, true, f3, dest); CHECK_EQUAL("", dest); } TEST(find_property) { string f1 = temporary_file("key1=value1"); string dest=string(""); find_property(f1, "key1", dest); CHECK_EQUAL("value1", dest); dest=string(""); find_property(f1, "key2", dest); CHECK_EQUAL("", dest); dest=string(""); find_property(f1, "value1", dest); CHECK_EQUAL("", dest); remove(f1.c_str()); string f2 = temporary_file("key2 =value2 key3=value3\n key5 = value5"); dest=string(""); find_property(f2, "key2", dest); CHECK_EQUAL("value2 key3=value3", dest); dest=string(""); find_property(f2, "key1", dest); CHECK_EQUAL("", dest); dest=string(""); find_property(f2, "key3", dest); CHECK_EQUAL("", dest); dest=string(""); find_property(f2, "key5", dest); CHECK_EQUAL("value5", dest); remove(f2.c_str()); string f3 = temporary_file("ke.y3= value3\nkey4=value4"); dest=string(""); find_property(f3, "ke.y3", dest); CHECK_EQUAL("value3", dest); dest=string(""); find_property(f3, "key4", dest); CHECK_EQUAL("value4", dest); remove(f3.c_str()); } TEST(read_deploy_property_value1) { string f1 = temporary_file("key1=value11"); string f2 = temporary_file("key1=value12"); string f3 = temporary_file("key2=value23"); string dest=string(""); read_deploy_property_value(f1,f2,true, "key1", dest); CHECK_EQUAL("value11", dest); dest=string(""); read_deploy_property_value(f2,f1,true, "key1", dest); CHECK_EQUAL("value12", dest); dest=string(""); read_deploy_property_value(f1,f3,true, "key1", dest); CHECK_EQUAL("value11", dest); dest=string(""); read_deploy_property_value(f3,f1,true, "key1", dest); CHECK_EQUAL("value11", dest); read_deploy_property_value(f3,f2,true, "key1", dest); CHECK_EQUAL("value12", dest); dest=string(""); read_deploy_property_value(f2,f3,true, "key1", dest); CHECK_EQUAL("value12", dest); dest=string(""); read_deploy_property_value(f1,f2,true, "key2", dest); CHECK_EQUAL("", dest); dest=string(""); read_deploy_property_value(f2,f1,true, "key2", dest); CHECK_EQUAL("", dest); dest=string(""); read_deploy_property_value(f1,f3,true, "key2", dest); CHECK_EQUAL("value23", dest); dest=string(""); read_deploy_property_value(f3,f1,true, "key2", dest); CHECK_EQUAL("value23", dest); read_deploy_property_value(f3,f2,true, "key2", dest); CHECK_EQUAL("value23", dest); dest=string(""); read_deploy_property_value(f2,f3,true, "key2", dest); CHECK_EQUAL("value23", dest); remove(f1.c_str());///////////////////////////////// dest=string(""); read_deploy_property_value(f1,f2,true, "key1", dest); CHECK_EQUAL("value12", dest); dest=string(""); read_deploy_property_value(f2,f1,true, "key1", dest); CHECK_EQUAL("value12", dest); dest=string(""); read_deploy_property_value(f1,f3,true, "key1", dest); CHECK_EQUAL("", dest); dest=string(""); read_deploy_property_value(f3,f1,true, "key1", dest); CHECK_EQUAL("", dest); read_deploy_property_value(f3,f2,true, "key1", dest); CHECK_EQUAL("value12", dest); dest=string(""); read_deploy_property_value(f2,f3,true, "key1", dest); CHECK_EQUAL("value12", dest); dest=string(""); read_deploy_property_value(f1,f2,true, "key2", dest); CHECK_EQUAL("", dest); dest=string(""); read_deploy_property_value(f2,f1,true, "key2", dest); CHECK_EQUAL("", dest); dest=string(""); read_deploy_property_value(f1,f3,true, "key2", dest); CHECK_EQUAL("value23", dest); dest=string(""); read_deploy_property_value(f3,f1,true, "key2", dest); CHECK_EQUAL("value23", dest); read_deploy_property_value(f3,f2,true, "key2", dest); CHECK_EQUAL("value23", dest); dest=string(""); read_deploy_property_value(f2,f3,true, "key2", dest); CHECK_EQUAL("value23", dest); remove(f3.c_str());///////////////////////////////// dest=string(""); read_deploy_property_value(f1,f2,true, "key1", dest); CHECK_EQUAL("value12", dest); dest=string(""); read_deploy_property_value(f2,f1,true, "key1", dest); CHECK_EQUAL("value12", dest); dest=string(""); read_deploy_property_value(f1,f3,true, "key1", dest); CHECK_EQUAL("", dest); dest=string(""); read_deploy_property_value(f3,f1,true, "key1", dest); CHECK_EQUAL("", dest); read_deploy_property_value(f3,f2,true, "key1", dest); CHECK_EQUAL("value12", dest); dest=string(""); read_deploy_property_value(f2,f3,true, "key1", dest); CHECK_EQUAL("value12", dest); dest=string(""); read_deploy_property_value(f1,f2,true, "key2", dest); CHECK_EQUAL("", dest); dest=string(""); read_deploy_property_value(f2,f1,true, "key2", dest); CHECK_EQUAL("", dest); dest=string(""); read_deploy_property_value(f1,f3,true, "key2", dest); CHECK_EQUAL("", dest); dest=string(""); read_deploy_property_value(f3,f1,true, "key2", dest); CHECK_EQUAL("", dest); read_deploy_property_value(f3,f2,true, "key2", dest); CHECK_EQUAL("", dest); dest=string(""); read_deploy_property_value(f2,f3,true, "key2", dest); CHECK_EQUAL("", dest); remove(f2.c_str());///////////////////////////////// } TEST(read_deploy_property_value2) { string f1 = temporary_file("key1=value11"); string f2 = temporary_file("key1=value12"); string f3 = temporary_file("key2=value23"); string dest=string(""); read_deploy_property_value(f1,f2,false, "key1", dest); CHECK_EQUAL("value11", dest); dest=string(""); read_deploy_property_value(f2,f1,false, "key1", dest); CHECK_EQUAL("value12", dest); dest=string(""); read_deploy_property_value(f1,f3,false, "key1", dest); CHECK_EQUAL("value11", dest); dest=string(""); read_deploy_property_value(f3,f1,false, "key1", dest); CHECK_EQUAL("", dest); read_deploy_property_value(f3,f2,false, "key1", dest); CHECK_EQUAL("", dest); dest=string(""); read_deploy_property_value(f2,f3,false, "key1", dest); CHECK_EQUAL("value12", dest); dest=string(""); read_deploy_property_value(f1,f2,false, "key2", dest); CHECK_EQUAL("", dest); dest=string(""); read_deploy_property_value(f2,f1,false, "key2", dest); CHECK_EQUAL("", dest); dest=string(""); read_deploy_property_value(f1,f3,false, "key2", dest); CHECK_EQUAL("", dest); dest=string(""); read_deploy_property_value(f3,f1,false, "key2", dest); CHECK_EQUAL("value23", dest); read_deploy_property_value(f3,f2,false, "key2", dest); CHECK_EQUAL("value23", dest); dest=string(""); read_deploy_property_value(f2,f3,false, "key2", dest); CHECK_EQUAL("", dest); remove(f1.c_str());///////////////////////////////// dest=string(""); read_deploy_property_value(f1,f2,false, "key1", dest); CHECK_EQUAL("", dest); dest=string(""); read_deploy_property_value(f2,f1,false, "key1", dest); CHECK_EQUAL("value12", dest); dest=string(""); read_deploy_property_value(f1,f3,false, "key1", dest); CHECK_EQUAL("", dest); dest=string(""); read_deploy_property_value(f3,f1,false, "key1", dest); CHECK_EQUAL("", dest); read_deploy_property_value(f3,f2,false, "key1", dest); CHECK_EQUAL("", dest); dest=string(""); read_deploy_property_value(f2,f3,false, "key1", dest); CHECK_EQUAL("value12", dest); dest=string(""); read_deploy_property_value(f1,f2,false, "key2", dest); CHECK_EQUAL("", dest); dest=string(""); read_deploy_property_value(f2,f1,false, "key2", dest); CHECK_EQUAL("", dest); dest=string(""); read_deploy_property_value(f1,f3,false, "key2", dest); CHECK_EQUAL("", dest); dest=string(""); read_deploy_property_value(f3,f1,false, "key2", dest); CHECK_EQUAL("value23", dest); read_deploy_property_value(f3,f2,false, "key2", dest); CHECK_EQUAL("value23", dest); dest=string(""); read_deploy_property_value(f2,f3,false, "key2", dest); CHECK_EQUAL("", dest); remove(f3.c_str());///////////////////////////////// dest=string(""); read_deploy_property_value(f1,f2,false, "key1", dest); CHECK_EQUAL("", dest); dest=string(""); read_deploy_property_value(f2,f1,false, "key1", dest); CHECK_EQUAL("value12", dest); dest=string(""); read_deploy_property_value(f1,f3,false, "key1", dest); CHECK_EQUAL("", dest); dest=string(""); read_deploy_property_value(f3,f1,false, "key1", dest); CHECK_EQUAL("", dest); read_deploy_property_value(f3,f2,false, "key1", dest); CHECK_EQUAL("", dest); dest=string(""); read_deploy_property_value(f2,f3,false, "key1", dest); CHECK_EQUAL("value12", dest); dest=string(""); read_deploy_property_value(f1,f2,false, "key2", dest); CHECK_EQUAL("", dest); dest=string(""); read_deploy_property_value(f2,f1,false, "key2", dest); CHECK_EQUAL("", dest); dest=string(""); read_deploy_property_value(f1,f3,false, "key2", dest); CHECK_EQUAL("", dest); dest=string(""); read_deploy_property_value(f3,f1,false, "key2", dest); CHECK_EQUAL("", dest); read_deploy_property_value(f3,f2,false, "key2", dest); CHECK_EQUAL("", dest); dest=string(""); read_deploy_property_value(f2,f3,false, "key2", dest); CHECK_EQUAL("", dest); remove(f2.c_str());///////////////////////////////// } TEST(find_custom_jre) { string f1 = temporary_file(custom_jre_key+"=value11"); string f2 = temporary_file(custom_jre_key+"=value12"); string f3 = temporary_file("key2=value23"); string f4 = temporary_file("key2=value24"); string dest=string(""); find_custom_jre(f1,f2, dest); CHECK_EQUAL("value11", dest); dest=string(""); find_custom_jre(f2,f1, dest); CHECK_EQUAL("value12", dest); dest=string(""); find_custom_jre(f1,f3, dest); CHECK_EQUAL("value11", dest); dest=string(""); find_custom_jre(f3,f1, dest); CHECK_EQUAL("value11", dest); dest=string(""); find_custom_jre(f3,f4, dest); CHECK_EQUAL("", dest); remove(f1.c_str());///////////////////////////////// dest=string(""); find_custom_jre(f1,f2, dest); CHECK_EQUAL("value12", dest); dest=string(""); find_custom_jre(f2,f1, dest); CHECK_EQUAL("value12", dest); dest=string(""); find_custom_jre(f1,f3, dest); CHECK_EQUAL("", dest); dest=string(""); find_custom_jre(f3,f1, dest); CHECK_EQUAL("", dest); remove(f3.c_str());///////////////////////////////// dest=string(""); find_custom_jre(f1,f2, dest); CHECK_EQUAL("value12", dest); dest=string(""); find_custom_jre(f2,f1, dest); CHECK_EQUAL("value12", dest); dest=string(""); find_custom_jre(f1,f3, dest); CHECK_EQUAL("", dest); dest=string(""); find_custom_jre(f3,f1, dest); CHECK_EQUAL("", dest); remove(f2.c_str());///////////////////////////////// dest=string(""); find_custom_jre(f1,f2, dest); CHECK_EQUAL("", dest); dest=string(""); find_custom_jre(f2,f1, dest); CHECK_EQUAL("", dest); dest=string(""); find_custom_jre(f1,f3, dest); CHECK_EQUAL("", dest); dest=string(""); find_custom_jre(f3,f1, dest); CHECK_EQUAL("", dest); remove(f4.c_str());///////////////////////////////// } icedtea-web-1.6.2/tests/cpp-unit-tests/PaxHeaders.17941/IcedTeaNPPluginTest.cc0000644000000000000000000000013212654402377023570 xustar0030 mtime=1454507263.275432074 30 atime=1454507327.187579697 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/cpp-unit-tests/IcedTeaNPPluginTest.cc0000644000175000002070000000772312654402377024324 0ustar00jvanekmock00000000000000/* Copyright (C) 2012 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #include #include #include #include "MemoryLeakDetector.h" #include "IcedTeaNPPlugin.h" #include "IcedTeaScriptablePluginObject.h" #include "IcedTeaPluginUtils.h" TEST(NP_GetMIMEDescription) { std::string MIME_type = NP_GetMIMEDescription(); CHECK(MIME_type.find("application/x-java-applet") != std::string::npos); CHECK(MIME_type.find("application/x-java-vm") != std::string::npos); } /* Not normally exposed */ std::vector* get_jvm_args(); TEST(get_jvm_args) { std::vector* args = get_jvm_args(); CHECK(args != NULL); IcedTeaPluginUtilities::freeStringPtrVector(args); } static IcedTeaScriptableJavaPackageObject* get_scriptable_package_object() { NPP_t instance = { /*Plugin data*/plugin_data_new(), /* Browser data*/0 }; /* Get the packages object (since instance.pdata->is_applet_instance == false) */ NPObject* obj = get_scriptable_object(&instance); /* Make sure we got an IcedTeaScriptableJavaPackageObject */ CHECK(obj->_class->deallocate == IcedTeaScriptableJavaPackageObject::deAllocate); plugin_data_destroy(&instance); return (IcedTeaScriptableJavaPackageObject*)obj; } TEST(get_scriptable_object) { MemoryLeakDetector leak_detector; // We test without an applet context, pending mocking of applet instances. IcedTeaScriptableJavaPackageObject* obj = get_scriptable_package_object(); // Calls get_scriptable_object browser_functions.releaseobject(obj); CHECK(leak_detector.memory_leaks() == 0); } TEST(NP_GetValue) { void* __unused = NULL; gchar* char_value = NULL; /* test plugin name */ { CHECK_EQUAL(NPERR_NO_ERROR, NP_GetValue(__unused, NPPVpluginNameString, &char_value)); CHECK(std::string(char_value).find(PLUGIN_NAME) != std::string::npos); g_free(char_value); char_value = NULL; } /* test plugin desc */ { CHECK_EQUAL(NPERR_NO_ERROR, NP_GetValue(__unused, NPPVpluginDescriptionString, &char_value)); CHECK(std::string(char_value).find("executes Java applets") != std::string::npos); g_free(char_value); char_value = NULL; } /* test plugin unknown */ { printf("NOTE: Next error expected\n"); // the following will print an error message CHECK_EQUAL(NPERR_GENERIC_ERROR, NP_GetValue(__unused, NPPVformValue, &char_value)); g_free(char_value); char_value = NULL; } } icedtea-web-1.6.2/tests/cpp-unit-tests/PaxHeaders.17941/IcedTeaJavaRequestProcessorTest.cc0000644000000000000000000000013212654402377026226 xustar0030 mtime=1454507263.274432088 30 atime=1454507327.187579697 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/cpp-unit-tests/IcedTeaJavaRequestProcessorTest.cc0000644000175000002070000003526212654402377026761 0ustar00jvanekmock00000000000000/* Copyright (C) 2013 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #include #include #include #include #include #include "MemoryLeakDetector.h" #include "IcedTeaJavaRequestProcessor.h" /****************************************************************************** * Simple helper methods to keep the tests clean. * ******************************************************************************/ static const char* TEST_SOURCE = "[System]"; static std::string checked_return(JavaResultData* result) { CHECK(!result->error_occurred); return *result->return_string; } // Packages static bool jrp_has_package(std::string package_name) { JavaRequestProcessor processor; JavaResultData* result = processor.hasPackage(0, package_name); CHECK(!result->error_occurred); return (result->return_identifier != 0); } // Classes static std::string jrp_find_class(std::string name) { return checked_return( JavaRequestProcessor().findClass(0, name) ); } // Object creation static std::string jrp_new_object_with_constructor(std::string class_id, std::string method_id, std::vector args = std::vector()) { return checked_return( JavaRequestProcessor().newObjectWithConstructor(TEST_SOURCE, class_id, method_id, args) ); } static std::string jrp_new_array(std::string class_id, std::string len) { return checked_return( JavaRequestProcessor().newArray(class_id, len) ); } static std::string jrp_new_string(std::string str) { return checked_return( JavaRequestProcessor().newString(str) ); } static std::string jrp_new_object(std::string class_id, std::vector args = std::vector()) { return checked_return( JavaRequestProcessor().newObject(TEST_SOURCE, class_id, args) ); } static std::string jrp_get_value(std::string object_id) { return checked_return( JavaRequestProcessor().getValue(object_id) ); } // Inheritance static bool jrp_is_instance_of(std::string object_id, std::string class_id) { JavaRequestProcessor processor; JavaResultData* result = processor.isInstanceOf(object_id, class_id); CHECK(!result->error_occurred); return (result->return_identifier != 0); } // Java methods operations. static std::string jrp_get_method_id(std::string class_id, std::string method_name, std::vector args = std::vector()) { return checked_return( JavaRequestProcessor().getMethodID(class_id, browser_functions.getstringidentifier(method_name.c_str()), args) ); } static std::string jrp_get_static_method_id(std::string class_id, std::string method_name, std::vector args = std::vector()) { return checked_return( JavaRequestProcessor().getStaticMethodID(class_id, browser_functions.getstringidentifier(method_name.c_str()), args) ); } static std::string jrp_call_method(std::string object_id, std::string method_name, std::vector args = std::vector()) { return checked_return( JavaRequestProcessor().callMethod(TEST_SOURCE, object_id, method_name, args) ); } static std::string jrp_call_static_method(std::string class_id, std::string method_name, std::vector args = std::vector()) { return checked_return( JavaRequestProcessor().callStaticMethod(TEST_SOURCE, class_id, method_name, args) ); } static std::string jrp_get_string(std::string object_id) { return checked_return( JavaRequestProcessor().getString(object_id) ); } static std::string jrp_get_class_id(std::string object_id) { return checked_return( JavaRequestProcessor().getClassID(object_id) ); } // Java field operations. static std::string jrp_get_field(std::string object_id, std::string field_name) { return checked_return( JavaRequestProcessor().getField(TEST_SOURCE, jrp_get_class_id(object_id), object_id, field_name) ); } static std::string jrp_get_field_id(std::string class_id, std::string field_name) { return checked_return( JavaRequestProcessor().getFieldID(class_id, field_name) ); } static std::string jrp_get_static_field_id(std::string class_id, std::string field_name) { return checked_return( JavaRequestProcessor().getStaticFieldID(class_id, field_name) ); } static std::string jrp_get_static_field(std::string class_id, std::string field_name) { return checked_return( JavaRequestProcessor().getStaticField(TEST_SOURCE, class_id, field_name) ); } static std::string jrp_set_field(std::string object_id, std::string field_name, std::string value_id) { return checked_return( JavaRequestProcessor().setField(TEST_SOURCE, jrp_get_class_id(object_id), object_id, field_name, value_id) ); } static std::string jrp_set_static_field(std::string class_id, std::string field_name, std::string value_id) { return checked_return( JavaRequestProcessor().setStaticField(TEST_SOURCE, class_id, field_name, value_id) ); } // Java array operations. static std::string jrp_set_slot(std::string object_id, std::string index, std::string value_id) { return checked_return( JavaRequestProcessor().setSlot(object_id, index, value_id) ); } static std::string jrp_get_slot(std::string object_id, std::string index) { return checked_return( JavaRequestProcessor().getSlot(object_id, index) ); } static std::string jrp_get_array_length(std::string object_id) { return checked_return( JavaRequestProcessor().getArrayLength(object_id) ); } // Result of toString() static std::string jrp_get_to_string_value(std::string object_id) { return checked_return( JavaRequestProcessor().getToStringValue(object_id) ); } /****************************************************************************** * Compound helper methods. * ******************************************************************************/ static NPP_t dummy_npp = {0,0}; static std::string create_java_integer(int value) { // Prepare a java integer object with the value 1 NPVariant integer_variant; std::string integer_id; INT32_TO_NPVARIANT(value, integer_variant); createJavaObjectFromVariant(&dummy_npp, integer_variant, &integer_id); return integer_id; } static std::string create_null() { // Prepare a null object NPVariant null_variant; std::string null_id; NULL_TO_NPVARIANT(null_variant); createJavaObjectFromVariant(&dummy_npp, null_variant, &null_id); return null_id; } static NPVariant java_result_to_variant(std::string object_id) { NPVariant variant; IcedTeaPluginUtilities::javaResultToNPVariant(&dummy_npp, &object_id, &variant); return variant; } /* Call the no-argument constructor of an object */ static std::string jrp_noarg_construct(std::string classname) { std::string class_id = jrp_find_class(classname); std::string constructor_id = jrp_get_method_id(class_id, ""); return jrp_new_object_with_constructor(class_id, constructor_id); } /****************************************************************************** * Test cases. Note that the tests exercise a variety of functions to first * * create the appropriate conditions for the intended test. * ******************************************************************************/ SUITE(JavaRequestProcessor) { TEST(callMethod) { std::string object_id = jrp_noarg_construct("java.lang.Object"); std::string tostring_result = jrp_get_string( jrp_call_method(object_id, "toString")); const char substr[] = "java.lang.Object@"; // Check that the result of toString is as expected CHECK(strncmp(tostring_result.c_str(), substr, strlen(substr)) == 0); } /* Create a java.awt.Point, since it is one of the few standard classes with public fields. */ TEST(getField_and_setField) { std::string object_id = jrp_noarg_construct("java.awt.Point"); // Set the field 'x' to 1 jrp_set_field(object_id, "x", create_java_integer(1)); // Get the field 'x' NPVariant field_value = java_result_to_variant(jrp_get_field(object_id, "x")); // Ensure that the received field is 1 CHECK(NPVARIANT_IS_INT32(field_value) && NPVARIANT_TO_INT32(field_value) == 1); } TEST(getStaticField_and_setStaticField) { // One of the few classes with a public & non-final static field that we can tinker with. // If it moves, this test will fail, in which-case this test should be updated to another appropriate field. std::string class_id = jrp_find_class("net.sourceforge.jnlp.controlpanel.DebuggingPanel"); std::string properties_id = jrp_get_static_field(class_id, "properties"); // Check that the field is initially a non-null object NPVariant sh_variant = java_result_to_variant(properties_id); CHECK(!NPVARIANT_IS_NULL(sh_variant) && NPVARIANT_IS_OBJECT(sh_variant)); browser_functions.releasevariantvalue(&sh_variant); jrp_set_static_field(class_id, "properties", create_null()); sh_variant = java_result_to_variant(jrp_get_static_field(class_id, "properties")); CHECK(NPVARIANT_IS_NULL(sh_variant)); // Reset the field to its original contents jrp_set_static_field(class_id, "properties", properties_id); sh_variant = java_result_to_variant(jrp_get_static_field(class_id, "properties")); CHECK(!NPVARIANT_IS_NULL(sh_variant) && NPVARIANT_IS_OBJECT(sh_variant)); browser_functions.releasevariantvalue(&sh_variant); } TEST(arrayIndexing) { const int ARRAY_LEN = 1; // We will create an Integer array of ARRAY_LEN std::vector args; args.push_back(jrp_find_class("java.lang.Integer")); args.push_back(create_java_integer(ARRAY_LEN)); // Create an array 'the hard way' (ie not using 'newArray') to test more of the API std::string array_id = jrp_call_static_method(jrp_find_class("java.lang.reflect.Array"), "newInstance", args); // Attempt to set the first element to 1 jrp_set_slot(array_id, "0", create_java_integer(1)); // Note we get an integer _object_, not a plain int literal std::string integer_id = jrp_get_slot(array_id, "0"); NPVariant unboxed_slot_value = java_result_to_variant(jrp_call_method(integer_id, "intValue")); // Ensure that the received slot is 1 CHECK(NPVARIANT_IS_INT32(unboxed_slot_value) && NPVARIANT_TO_INT32(unboxed_slot_value) == 1); } // Also exercises 'getToStringValue' TEST(newObject) { std::string object_id = jrp_new_object(jrp_find_class("java.lang.Object")); const char substr[] = "java.lang.Object@"; // Check that the result of toString is as expected CHECK(strncmp(jrp_get_to_string_value(object_id).c_str(), substr, strlen(substr)) == 0); } TEST(hasPackage) { CHECK(jrp_has_package("java.lang")); CHECK(!jrp_has_package("not.an.icedtea_web.package")); } TEST(newArray) { const char ARRAY_LEN[] = "10"; std::string array_id = jrp_new_array(jrp_find_class("java.lang.Integer"), ARRAY_LEN); CHECK_EQUAL(ARRAY_LEN, jrp_get_array_length(array_id)); } TEST(newString) { const char TEST_STRING[] = "foobar"; std::string string_id = jrp_new_string(TEST_STRING); CHECK_EQUAL(TEST_STRING, jrp_get_string(string_id)); CHECK_EQUAL(TEST_STRING, jrp_get_to_string_value(string_id)); } // Can only really do sanity checks with given API TEST(getFieldID_getStaticFieldID) { CHECK(!jrp_get_field_id(jrp_find_class("java.awt.Point"), "x").empty()); CHECK(!jrp_get_static_field_id(jrp_find_class("java.lang.Integer"), "MAX_VALUE").empty()); } // Can only really do sanity checks with given API TEST(getStaticMethodID) { std::string class_id = jrp_find_class("java.lang.Integer"); std::vector argtypes; argtypes.push_back("Ljava.lang.String;"); CHECK(!jrp_get_static_method_id(class_id, "valueOf", argtypes).empty()); } TEST(isInstanceOf) { std::string point_id = jrp_noarg_construct("java.awt.Point"); std::string object_class_id = jrp_find_class("java.lang.Object"); CHECK(jrp_is_instance_of(point_id, object_class_id)); } // Wasn't sure what the point of this method is to be honest, but it is used. // Here it simply returns back a passed string object. TEST(getValue) { const char TEST_STRING[] = "foobar"; std::string str = jrp_get_string(jrp_get_value(jrp_new_string(TEST_STRING))); CHECK_EQUAL(TEST_STRING, str); } } icedtea-web-1.6.2/tests/PaxHeaders.17941/UnitTest++0000644000000000000000000000013212654402377016437 xustar0030 mtime=1454507263.265432208 30 atime=1454507658.776157397 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/UnitTest++/0000755000175000002070000000000012654402377017237 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/UnitTest++/PaxHeaders.17941/src0000644000000000000000000000013212654402377017226 xustar0030 mtime=1454507263.274432088 30 atime=1454507658.776157397 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/UnitTest++/src/0000755000175000002070000000000012654402377020026 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/UnitTest++/src/PaxHeaders.17941/XmlTestReporter.h0000644000000000000000000000013212654402377022577 xustar0030 mtime=1454507263.274432088 30 atime=1454507327.187579697 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/UnitTest++/src/XmlTestReporter.h0000644000175000002070000000171412654402377023325 0ustar00jvanekmock00000000000000#ifndef UNITTEST_XMLTESTREPORTER_H #define UNITTEST_XMLTESTREPORTER_H #include "DeferredTestReporter.h" #include namespace UnitTest { class XmlTestReporter : public DeferredTestReporter { public: explicit XmlTestReporter(std::ostream& ostream); virtual void ReportSummary(int totalTestCount, int failedTestCount, int failureCount, float secondsElapsed); private: XmlTestReporter(XmlTestReporter const&); XmlTestReporter& operator=(XmlTestReporter const&); void AddXmlElement(std::ostream& os, char const* encoding); void BeginResults(std::ostream& os, int totalTestCount, int failedTestCount, int failureCount, float secondsElapsed); void EndResults(std::ostream& os); void BeginTest(std::ostream& os, DeferredTestResult const& result); void AddFailure(std::ostream& os, DeferredTestResult const& result); void EndTest(std::ostream& os, DeferredTestResult const& result); std::ostream& m_ostream; }; } #endif icedtea-web-1.6.2/tests/UnitTest++/src/PaxHeaders.17941/XmlTestReporter.cpp0000644000000000000000000000013112654402377023131 xustar0030 mtime=1454507263.274432088 29 atime=1454507327.18657971 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/UnitTest++/src/XmlTestReporter.cpp0000644000175000002070000000630312654402377023657 0ustar00jvanekmock00000000000000#include "XmlTestReporter.h" #include "Config.h" #include #include #include using std::string; using std::ostringstream; using std::ostream; namespace { void ReplaceChar(string& str, char c, string const& replacement) { for (size_t pos = str.find(c); pos != string::npos; pos = str.find(c, pos + 1)) str.replace(pos, 1, replacement); } string XmlEscape(string const& value) { string escaped = value; ReplaceChar(escaped, '&', "&"); ReplaceChar(escaped, '<', "<"); ReplaceChar(escaped, '>', ">"); ReplaceChar(escaped, '\'', "'"); ReplaceChar(escaped, '\"', """); return escaped; } string BuildFailureMessage(string const& file, int line, string const& message) { ostringstream failureMessage; failureMessage << file << "(" << line << ") : " << message; return failureMessage.str(); } } namespace UnitTest { XmlTestReporter::XmlTestReporter(ostream& ostream) : m_ostream(ostream) { } void XmlTestReporter::ReportSummary(int totalTestCount, int failedTestCount, int failureCount, float secondsElapsed) { AddXmlElement(m_ostream, NULL); BeginResults(m_ostream, totalTestCount, failedTestCount, failureCount, secondsElapsed); DeferredTestResultList const& results = GetResults(); for (DeferredTestResultList::const_iterator i = results.begin(); i != results.end(); ++i) { BeginTest(m_ostream, *i); if (i->failed) AddFailure(m_ostream, *i); EndTest(m_ostream, *i); } EndResults(m_ostream); } void XmlTestReporter::AddXmlElement(ostream& os, char const* encoding) { os << ""; } void XmlTestReporter::BeginResults(std::ostream& os, int totalTestCount, int failedTestCount, int failureCount, float secondsElapsed) { os << ""; } void XmlTestReporter::EndResults(std::ostream& os) { os << ""; } void XmlTestReporter::BeginTest(std::ostream& os, DeferredTestResult const& result) { os << ""; else os << "/>"; } void XmlTestReporter::AddFailure(std::ostream& os, DeferredTestResult const& result) { os << ">"; // close element for (DeferredTestResult::FailureVec::const_iterator it = result.failures.begin(); it != result.failures.end(); ++it) { string const escapedMessage = XmlEscape(it->second); string const message = BuildFailureMessage(result.failureFile, it->first, escapedMessage); os << ""; } } } icedtea-web-1.6.2/tests/UnitTest++/src/PaxHeaders.17941/UnitTest++.h0000644000000000000000000000013112654402377021360 xustar0030 mtime=1454507263.274432088 29 atime=1454507327.18657971 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/UnitTest++/src/UnitTest++.h0000644000175000002070000000044512654402377022107 0ustar00jvanekmock00000000000000#ifndef UNITTESTCPP_H #define UNITTESTCPP_H //lint -esym(1509,*Fixture) #include "Config.h" #include "Test.h" #include "TestList.h" #include "TestSuite.h" #include "TestResults.h" #include "TestMacros.h" #include "CheckMacros.h" #include "TestRunner.h" #include "TimeConstraint.h" #endif icedtea-web-1.6.2/tests/UnitTest++/src/PaxHeaders.17941/TimeHelpers.h0000644000000000000000000000013112654402377021674 xustar0030 mtime=1454507263.273432101 29 atime=1454507327.18657971 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/UnitTest++/src/TimeHelpers.h0000644000175000002070000000020312654402377022413 0ustar00jvanekmock00000000000000#include "Config.h" #if defined UNITTEST_POSIX #include "Posix/TimeHelpers.h" #else #include "Win32/TimeHelpers.h" #endif icedtea-web-1.6.2/tests/UnitTest++/src/PaxHeaders.17941/TimeConstraint.h0000644000000000000000000000013112654402377022416 xustar0030 mtime=1454507263.273432101 29 atime=1454507327.18657971 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/UnitTest++/src/TimeConstraint.h0000644000175000002070000000124512654402377023144 0ustar00jvanekmock00000000000000#ifndef UNITTEST_TIMECONSTRAINT_H #define UNITTEST_TIMECONSTRAINT_H #include "TimeHelpers.h" namespace UnitTest { class TestResults; class TestDetails; class TimeConstraint { public: TimeConstraint(int ms, TestDetails const& details); ~TimeConstraint(); private: void operator=(TimeConstraint const&); TimeConstraint(TimeConstraint const&); Timer m_timer; TestDetails const& m_details; int const m_maxMs; }; #define UNITTEST_TIME_CONSTRAINT(ms) \ UnitTest::TimeConstraint unitTest__timeConstraint__(ms, UnitTest::TestDetails(m_details, __LINE__)) #define UNITTEST_TIME_CONSTRAINT_EXEMPT() do { m_timeConstraintExempt = true; } while (0) } #endif icedtea-web-1.6.2/tests/UnitTest++/src/PaxHeaders.17941/TimeConstraint.cpp0000644000000000000000000000013112654402377022751 xustar0030 mtime=1454507263.273432101 29 atime=1454507327.18657971 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/UnitTest++/src/TimeConstraint.cpp0000644000175000002070000000122612654402377023476 0ustar00jvanekmock00000000000000#include "TimeConstraint.h" #include "TestResults.h" #include "MemoryOutStream.h" #include "CurrentTest.h" namespace UnitTest { TimeConstraint::TimeConstraint(int ms, TestDetails const& details) : m_details(details) , m_maxMs(ms) { m_timer.Start(); } TimeConstraint::~TimeConstraint() { int const totalTimeInMs = m_timer.GetTimeInMs(); if (totalTimeInMs > m_maxMs) { MemoryOutStream stream; stream << "Time constraint failed. Expected to run test under " << m_maxMs << "ms but took " << totalTimeInMs << "ms."; UnitTest::CurrentTest::Results()->OnTestFailure(m_details, stream.GetText()); } } } icedtea-web-1.6.2/tests/UnitTest++/src/PaxHeaders.17941/TestSuite.h0000644000000000000000000000013112654402377021404 xustar0030 mtime=1454507263.273432101 29 atime=1454507327.18657971 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/UnitTest++/src/TestSuite.h0000644000175000002070000000026412654402377022132 0ustar00jvanekmock00000000000000#ifndef UNITTEST_TESTSUITE_H #define UNITTEST_TESTSUITE_H namespace UnitTestSuite { inline char const* GetSuiteName () { return "DefaultSuite"; } } #endif icedtea-web-1.6.2/tests/UnitTest++/src/PaxHeaders.17941/TestRunner.h0000644000000000000000000000013112654402377021564 xustar0030 mtime=1454507263.272432114 29 atime=1454507327.18657971 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/UnitTest++/src/TestRunner.h0000644000175000002070000000210712654402377022310 0ustar00jvanekmock00000000000000#ifndef UNITTEST_TESTRUNNER_H #define UNITTEST_TESTRUNNER_H #include "Test.h" #include "TestList.h" #include "CurrentTest.h" namespace UnitTest { class TestReporter; class TestResults; class Timer; int RunAllTests(); struct True { bool operator()(const Test* const) const { return true; } }; class TestRunner { public: explicit TestRunner(TestReporter& reporter); ~TestRunner(); template int RunTestsIf(TestList const& list, char const* suiteName, const Predicate& predicate, int maxTestTimeInMs) const { Test* curTest = list.GetHead(); while (curTest != 0) { if (IsTestInSuite(curTest,suiteName) && predicate(curTest)) { RunTest(m_result, curTest, maxTestTimeInMs); } curTest = curTest->next; } return Finish(); } private: TestReporter* m_reporter; TestResults* m_result; Timer* m_timer; int Finish() const; bool IsTestInSuite(const Test* const curTest, char const* suiteName) const; void RunTest(TestResults* const result, Test* const curTest, int const maxTestTimeInMs) const; }; } #endif icedtea-web-1.6.2/tests/UnitTest++/src/PaxHeaders.17941/TestRunner.cpp0000644000000000000000000000013212654402377022120 xustar0030 mtime=1454507263.272432114 30 atime=1454507327.185579723 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/UnitTest++/src/TestRunner.cpp0000644000175000002070000000337612654402377022654 0ustar00jvanekmock00000000000000#include "TestRunner.h" #include "TestResults.h" #include "TestReporter.h" #include "TestReporterStdout.h" #include "TimeHelpers.h" #include "MemoryOutStream.h" #include namespace UnitTest { int RunAllTests() { TestReporterStdout reporter; TestRunner runner(reporter); return runner.RunTestsIf(Test::GetTestList(), NULL, True(), 0); } TestRunner::TestRunner(TestReporter& reporter) : m_reporter(&reporter) , m_result(new TestResults(&reporter)) , m_timer(new Timer) { m_timer->Start(); } TestRunner::~TestRunner() { delete m_result; delete m_timer; } int TestRunner::Finish() const { float const secondsElapsed = m_timer->GetTimeInMs() / 1000.0f; m_reporter->ReportSummary(m_result->GetTotalTestCount(), m_result->GetFailedTestCount(), m_result->GetFailureCount(), secondsElapsed); return m_result->GetFailureCount(); } bool TestRunner::IsTestInSuite(const Test* const curTest, char const* suiteName) const { using namespace std; return (suiteName == NULL) || !strcmp(curTest->m_details.suiteName, suiteName); } void TestRunner::RunTest(TestResults* const result, Test* const curTest, int const maxTestTimeInMs) const { CurrentTest::Results() = result; Timer testTimer; testTimer.Start(); result->OnTestStart(curTest->m_details); curTest->Run(); int const testTimeInMs = testTimer.GetTimeInMs(); if (maxTestTimeInMs > 0 && testTimeInMs > maxTestTimeInMs && !curTest->m_timeConstraintExempt) { MemoryOutStream stream; stream << "Global time constraint failed. Expected under " << maxTestTimeInMs << "ms but took " << testTimeInMs << "ms."; result->OnTestFailure(curTest->m_details, stream.GetText()); } result->OnTestFinish(curTest->m_details, testTimeInMs/1000.0f); } } icedtea-web-1.6.2/tests/UnitTest++/src/PaxHeaders.17941/TestResults.h0000644000000000000000000000013212654402377021755 xustar0030 mtime=1454507263.272432114 30 atime=1454507327.185579723 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/UnitTest++/src/TestResults.h0000644000175000002070000000136112654402377022501 0ustar00jvanekmock00000000000000#ifndef UNITTEST_TESTRESULTS_H #define UNITTEST_TESTRESULTS_H namespace UnitTest { class TestReporter; class TestDetails; class TestResults { public: explicit TestResults(TestReporter* reporter = 0); void OnTestStart(TestDetails const& test); void OnTestFailure(TestDetails const& test, char const* failure); void OnTestFinish(TestDetails const& test, float secondsElapsed); int GetTotalTestCount() const; int GetFailedTestCount() const; int GetFailureCount() const; private: TestReporter* m_testReporter; int m_totalTestCount; int m_failedTestCount; int m_failureCount; bool m_currentTestFailed; TestResults(TestResults const&); TestResults& operator =(TestResults const&); }; } #endif icedtea-web-1.6.2/tests/UnitTest++/src/PaxHeaders.17941/TestResults.cpp0000644000000000000000000000013212654402377022310 xustar0030 mtime=1454507263.272432114 30 atime=1454507327.185579723 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/UnitTest++/src/TestResults.cpp0000644000175000002070000000224112654402377023032 0ustar00jvanekmock00000000000000#include "TestResults.h" #include "TestReporter.h" #include "TestDetails.h" namespace UnitTest { TestResults::TestResults(TestReporter* testReporter) : m_testReporter(testReporter) , m_totalTestCount(0) , m_failedTestCount(0) , m_failureCount(0) , m_currentTestFailed(false) { } void TestResults::OnTestStart(TestDetails const& test) { ++m_totalTestCount; m_currentTestFailed = false; if (m_testReporter) m_testReporter->ReportTestStart(test); } void TestResults::OnTestFailure(TestDetails const& test, char const* failure) { ++m_failureCount; if (!m_currentTestFailed) { ++m_failedTestCount; m_currentTestFailed = true; } if (m_testReporter) m_testReporter->ReportFailure(test, failure); } void TestResults::OnTestFinish(TestDetails const& test, float secondsElapsed) { if (m_testReporter) m_testReporter->ReportTestFinish(test, secondsElapsed); } int TestResults::GetTotalTestCount() const { return m_totalTestCount; } int TestResults::GetFailedTestCount() const { return m_failedTestCount; } int TestResults::GetFailureCount() const { return m_failureCount; } } icedtea-web-1.6.2/tests/UnitTest++/src/PaxHeaders.17941/TestReporterStdout.h0000644000000000000000000000013212654402377023321 xustar0030 mtime=1454507263.272432114 30 atime=1454507327.185579723 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/UnitTest++/src/TestReporterStdout.h0000644000175000002070000000102312654402377024040 0ustar00jvanekmock00000000000000#ifndef UNITTEST_TESTREPORTERSTDOUT_H #define UNITTEST_TESTREPORTERSTDOUT_H #include "TestReporter.h" namespace UnitTest { class TestReporterStdout : public TestReporter { private: virtual void ReportTestStart(TestDetails const& test); virtual void ReportFailure(TestDetails const& test, char const* failure); virtual void ReportTestFinish(TestDetails const& test, float secondsElapsed); virtual void ReportSummary(int totalTestCount, int failedTestCount, int failureCount, float secondsElapsed); }; } #endif icedtea-web-1.6.2/tests/UnitTest++/src/PaxHeaders.17941/TestReporterStdout.cpp0000644000000000000000000000013212654402377023654 xustar0030 mtime=1454507263.271432128 30 atime=1454507327.185579723 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/UnitTest++/src/TestReporterStdout.cpp0000644000175000002070000000217512654402377024404 0ustar00jvanekmock00000000000000#include "TestReporterStdout.h" #include #include "TestDetails.h" namespace UnitTest { void TestReporterStdout::ReportFailure(TestDetails const& details, char const* failure) { #if defined(__APPLE__) || defined(__GNUG__) char const* const errorFormat = "%s:%d: error: Failure in %s: %s\n"; #else char const* const errorFormat = "%s(%d): error: Failure in %s: %s\n"; #endif using namespace std; printf(errorFormat, details.filename, details.lineNumber, details.testName, failure); } void TestReporterStdout::ReportTestStart(TestDetails const& /*test*/) { } void TestReporterStdout::ReportTestFinish(TestDetails const& /*test*/, float) { } void TestReporterStdout::ReportSummary(int const totalTestCount, int const failedTestCount, int const failureCount, float secondsElapsed) { using namespace std; if (failureCount > 0) printf("FAILURE: %d out of %d tests failed (%d failures).\n", failedTestCount, totalTestCount, failureCount); else printf("Success: %d tests passed.\n", totalTestCount); printf("Test time: %.2f seconds.\n", secondsElapsed); } } icedtea-web-1.6.2/tests/UnitTest++/src/PaxHeaders.17941/TestReporter.h0000644000000000000000000000013212654402377022116 xustar0030 mtime=1454507263.271432128 30 atime=1454507327.185579723 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/UnitTest++/src/TestReporter.h0000644000175000002070000000101712654402377022640 0ustar00jvanekmock00000000000000#ifndef UNITTEST_TESTREPORTER_H #define UNITTEST_TESTREPORTER_H namespace UnitTest { class TestDetails; class TestReporter { public: virtual ~TestReporter(); virtual void ReportTestStart(TestDetails const& test) = 0; virtual void ReportFailure(TestDetails const& test, char const* failure) = 0; virtual void ReportTestFinish(TestDetails const& test, float secondsElapsed) = 0; virtual void ReportSummary(int totalTestCount, int failedTestCount, int failureCount, float secondsElapsed) = 0; }; } #endif icedtea-web-1.6.2/tests/UnitTest++/src/PaxHeaders.17941/TestReporter.cpp0000644000000000000000000000013212654402377022451 xustar0030 mtime=1454507263.271432128 30 atime=1454507327.185579723 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/UnitTest++/src/TestReporter.cpp0000644000175000002070000000012712654402377023174 0ustar00jvanekmock00000000000000#include "TestReporter.h" namespace UnitTest { TestReporter::~TestReporter() { } } icedtea-web-1.6.2/tests/UnitTest++/src/PaxHeaders.17941/TestMacros.h0000644000000000000000000000013212654402377021540 xustar0030 mtime=1454507263.271432128 30 atime=1454507327.184579737 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/UnitTest++/src/TestMacros.h0000644000175000002070000001207712654402377022272 0ustar00jvanekmock00000000000000#ifndef UNITTEST_TESTMACROS_H #define UNITTEST_TESTMACROS_H #include "Config.h" #include "ExecuteTest.h" #include "AssertException.h" #include "TestDetails.h" #include "MemoryOutStream.h" #ifndef UNITTEST_POSIX #define UNITTEST_THROW_SIGNALS #else #include "Posix/SignalTranslator.h" #endif #ifdef TEST #error UnitTest++ redefines TEST #endif #ifdef TEST_EX #error UnitTest++ redefines TEST_EX #endif #ifdef TEST_FIXTURE_EX #error UnitTest++ redefines TEST_FIXTURE_EX #endif #define SUITE(Name) \ namespace Suite##Name { \ namespace UnitTestSuite { \ inline char const* GetSuiteName () { \ return #Name ; \ } \ } \ } \ namespace Suite##Name #define TEST_EX(Name, List) \ class Test##Name : public UnitTest::Test \ { \ public: \ Test##Name() : Test(#Name, UnitTestSuite::GetSuiteName(), __FILE__, __LINE__) {} \ private: \ virtual void RunImpl() const; \ } test##Name##Instance; \ \ UnitTest::ListAdder adder##Name (List, &test##Name##Instance); \ \ void Test##Name::RunImpl() const #define TEST(Name) TEST_EX(Name, UnitTest::Test::GetTestList()) #define TEST_FIXTURE_EX(Fixture, Name, List) \ class Fixture##Name##Helper : public Fixture \ { \ public: \ explicit Fixture##Name##Helper(UnitTest::TestDetails const& details) : m_details(details) {} \ void RunImpl(); \ UnitTest::TestDetails const& m_details; \ private: \ Fixture##Name##Helper(Fixture##Name##Helper const&); \ Fixture##Name##Helper& operator =(Fixture##Name##Helper const&); \ }; \ \ class Test##Fixture##Name : public UnitTest::Test \ { \ public: \ Test##Fixture##Name() : Test(#Name, UnitTestSuite::GetSuiteName(), __FILE__, __LINE__) {} \ private: \ virtual void RunImpl() const; \ } test##Fixture##Name##Instance; \ \ UnitTest::ListAdder adder##Fixture##Name (List, &test##Fixture##Name##Instance); \ \ void Test##Fixture##Name::RunImpl() const \ { \ bool ctorOk = false; \ try { \ Fixture##Name##Helper fixtureHelper(m_details); \ ctorOk = true; \ UnitTest::ExecuteTest(fixtureHelper, m_details); \ } \ catch (UnitTest::AssertException const& e) \ { \ UnitTest::CurrentTest::Results()->OnTestFailure(UnitTest::TestDetails(m_details.testName, m_details.suiteName, e.Filename(), e.LineNumber()), e.what()); \ } \ catch (std::exception const& e) \ { \ UnitTest::MemoryOutStream stream; \ stream << "Unhandled exception: " << e.what(); \ UnitTest::CurrentTest::Results()->OnTestFailure(m_details, stream.GetText()); \ } \ catch (...) { \ if (ctorOk) \ { \ UnitTest::CurrentTest::Results()->OnTestFailure(UnitTest::TestDetails(m_details, __LINE__), \ "Unhandled exception while destroying fixture " #Fixture); \ } \ else \ { \ UnitTest::CurrentTest::Results()->OnTestFailure(UnitTest::TestDetails(m_details, __LINE__), \ "Unhandled exception while constructing fixture " #Fixture); \ } \ } \ } \ void Fixture##Name##Helper::RunImpl() #define TEST_FIXTURE(Fixture,Name) TEST_FIXTURE_EX(Fixture, Name, UnitTest::Test::GetTestList()) #endif icedtea-web-1.6.2/tests/UnitTest++/src/PaxHeaders.17941/TestList.h0000644000000000000000000000013212654402377021227 xustar0030 mtime=1454507263.271432128 30 atime=1454507327.184579737 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/UnitTest++/src/TestList.h0000644000175000002070000000050412654402377021751 0ustar00jvanekmock00000000000000#ifndef UNITTEST_TESTLIST_H #define UNITTEST_TESTLIST_H namespace UnitTest { class Test; class TestList { public: TestList(); void Add (Test* test); Test* GetHead() const; private: Test* m_head; Test* m_tail; }; class ListAdder { public: ListAdder(TestList& list, Test* test); }; } #endif icedtea-web-1.6.2/tests/UnitTest++/src/PaxHeaders.17941/TestList.cpp0000644000000000000000000000013212654402377021562 xustar0030 mtime=1454507263.270432141 30 atime=1454507327.184579737 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/UnitTest++/src/TestList.cpp0000644000175000002070000000075312654402377022312 0ustar00jvanekmock00000000000000#include "TestList.h" #include "Test.h" #include namespace UnitTest { TestList::TestList() : m_head(0) , m_tail(0) { } void TestList::Add(Test* test) { if (m_tail == 0) { assert(m_head == 0); m_head = test; m_tail = test; } else { m_tail->next = test; m_tail = test; } } Test* TestList::GetHead() const { return m_head; } ListAdder::ListAdder(TestList& list, Test* test) { list.Add(test); } } icedtea-web-1.6.2/tests/UnitTest++/src/PaxHeaders.17941/TestDetails.h0000644000000000000000000000013212654402377021701 xustar0030 mtime=1454507263.270432141 30 atime=1454507327.184579737 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/UnitTest++/src/TestDetails.h0000644000175000002070000000107612654402377022430 0ustar00jvanekmock00000000000000#ifndef UNITTEST_TESTDETAILS_H #define UNITTEST_TESTDETAILS_H namespace UnitTest { class TestDetails { public: TestDetails(char const* testName, char const* suiteName, char const* filename, int lineNumber); TestDetails(const TestDetails& details, int lineNumber); char const* const suiteName; char const* const testName; char const* const filename; int const lineNumber; TestDetails(TestDetails const&); // Why is it public? --> http://gcc.gnu.org/bugs.html#cxx_rvalbind private: TestDetails& operator=(TestDetails const&); }; } #endif icedtea-web-1.6.2/tests/UnitTest++/src/PaxHeaders.17941/TestDetails.cpp0000644000000000000000000000013212654402377022234 xustar0030 mtime=1454507263.270432141 30 atime=1454507327.184579737 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/UnitTest++/src/TestDetails.cpp0000644000175000002070000000074412654402377022764 0ustar00jvanekmock00000000000000#include "TestDetails.h" namespace UnitTest { TestDetails::TestDetails(char const* testName_, char const* suiteName_, char const* filename_, int lineNumber_) : suiteName(suiteName_) , testName(testName_) , filename(filename_) , lineNumber(lineNumber_) { } TestDetails::TestDetails(const TestDetails& details, int lineNumber_) : suiteName(details.suiteName) , testName(details.testName) , filename(details.filename) , lineNumber(lineNumber_) { } } icedtea-web-1.6.2/tests/UnitTest++/src/PaxHeaders.17941/Test.h0000644000000000000000000000013212654402377020373 xustar0030 mtime=1454507263.270432141 30 atime=1454507327.184579737 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/UnitTest++/src/Test.h0000644000175000002070000000106212654402377021115 0ustar00jvanekmock00000000000000#ifndef UNITTEST_TEST_H #define UNITTEST_TEST_H #include "TestDetails.h" namespace UnitTest { class TestResults; class TestList; class Test { public: explicit Test(char const* testName, char const* suiteName = "DefaultSuite", char const* filename = "", int lineNumber = 0); virtual ~Test(); void Run(); TestDetails const m_details; Test* next; mutable bool m_timeConstraintExempt; static TestList& GetTestList(); virtual void RunImpl() const; private: Test(Test const&); Test& operator =(Test const&); }; } #endif icedtea-web-1.6.2/tests/UnitTest++/src/PaxHeaders.17941/Test.cpp0000644000000000000000000000013212654402377020726 xustar0030 mtime=1454507263.270432141 30 atime=1454507327.184579737 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/UnitTest++/src/Test.cpp0000644000175000002070000000122212654402377021446 0ustar00jvanekmock00000000000000#include "Config.h" #include "Test.h" #include "TestList.h" #include "TestResults.h" #include "AssertException.h" #include "MemoryOutStream.h" #include "ExecuteTest.h" #ifdef UNITTEST_POSIX #include "Posix/SignalTranslator.h" #endif namespace UnitTest { TestList& Test::GetTestList() { static TestList s_list; return s_list; } Test::Test(char const* testName, char const* suiteName, char const* filename, int lineNumber) : m_details(testName, suiteName, filename, lineNumber) , next(0) , m_timeConstraintExempt(false) { } Test::~Test() { } void Test::Run() { ExecuteTest(*this, m_details); } void Test::RunImpl() const { } } icedtea-web-1.6.2/tests/UnitTest++/src/PaxHeaders.17941/ReportAssert.h0000644000000000000000000000013112654402377022110 xustar0030 mtime=1454507263.269432154 29 atime=1454507327.18357975 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/UnitTest++/src/ReportAssert.h0000644000175000002070000000025412654402377022635 0ustar00jvanekmock00000000000000#ifndef UNITTEST_ASSERT_H #define UNITTEST_ASSERT_H namespace UnitTest { void ReportAssert(char const* description, char const* filename, int lineNumber); } #endif icedtea-web-1.6.2/tests/UnitTest++/src/PaxHeaders.17941/ReportAssert.cpp0000644000000000000000000000013112654402377022443 xustar0030 mtime=1454507263.269432154 29 atime=1454507327.18357975 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/UnitTest++/src/ReportAssert.cpp0000644000175000002070000000031212654402377023163 0ustar00jvanekmock00000000000000#include "AssertException.h" namespace UnitTest { void ReportAssert(char const* description, char const* filename, int lineNumber) { throw AssertException(description, filename, lineNumber); } } icedtea-web-1.6.2/tests/UnitTest++/src/PaxHeaders.17941/Posix0000644000000000000000000000013212654402377020330 xustar0030 mtime=1454507263.269432154 30 atime=1454507658.776157397 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/UnitTest++/src/Posix/0000755000175000002070000000000012654402377021130 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/UnitTest++/src/Posix/PaxHeaders.17941/TimeHelpers.h0000644000000000000000000000013112654402377022776 xustar0030 mtime=1454507263.269432154 29 atime=1454507327.18357975 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/UnitTest++/src/Posix/TimeHelpers.h0000644000175000002070000000046212654402377023524 0ustar00jvanekmock00000000000000#ifndef UNITTEST_TIMEHELPERS_H #define UNITTEST_TIMEHELPERS_H #include namespace UnitTest { class Timer { public: Timer(); void Start(); int GetTimeInMs() const; private: struct timeval m_startTime; }; namespace TimeHelpers { void SleepMs (int ms); } } #endif icedtea-web-1.6.2/tests/UnitTest++/src/Posix/PaxHeaders.17941/TimeHelpers.cpp0000644000000000000000000000013112654402377023331 xustar0030 mtime=1454507263.269432154 29 atime=1454507327.18357975 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/UnitTest++/src/Posix/TimeHelpers.cpp0000644000175000002070000000102712654402377024055 0ustar00jvanekmock00000000000000#include "TimeHelpers.h" #include namespace UnitTest { Timer::Timer() { m_startTime.tv_sec = 0; m_startTime.tv_usec = 0; } void Timer::Start() { gettimeofday(&m_startTime, 0); } int Timer::GetTimeInMs() const { struct timeval currentTime; gettimeofday(¤tTime, 0); int const dsecs = currentTime.tv_sec - m_startTime.tv_sec; int const dus = currentTime.tv_usec - m_startTime.tv_usec; return dsecs*1000 + dus/1000; } void TimeHelpers::SleepMs (int ms) { usleep(ms * 1000); } } icedtea-web-1.6.2/tests/UnitTest++/src/Posix/PaxHeaders.17941/SignalTranslator.h0000644000000000000000000000013112654402377024044 xustar0030 mtime=1454507263.269432154 29 atime=1454507327.18357975 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/UnitTest++/src/Posix/SignalTranslator.h0000644000175000002070000000163412654402377024574 0ustar00jvanekmock00000000000000#ifndef UNITTEST_SIGNALTRANSLATOR_H #define UNITTEST_SIGNALTRANSLATOR_H #include #include namespace UnitTest { class SignalTranslator { public: SignalTranslator(); ~SignalTranslator(); static sigjmp_buf* s_jumpTarget; private: sigjmp_buf m_currentJumpTarget; sigjmp_buf* m_oldJumpTarget; struct sigaction m_old_SIGFPE_action; struct sigaction m_old_SIGTRAP_action; struct sigaction m_old_SIGSEGV_action; struct sigaction m_old_SIGBUS_action; struct sigaction m_old_SIGABRT_action; struct sigaction m_old_SIGALRM_action; }; #if !defined (__GNUC__) #define UNITTEST_EXTENSION #else #define UNITTEST_EXTENSION __extension__ #endif #define UNITTEST_THROW_SIGNALS \ UnitTest::SignalTranslator sig; \ if (UNITTEST_EXTENSION sigsetjmp(*UnitTest::SignalTranslator::s_jumpTarget, 1) != 0) \ throw ("Unhandled system exception"); } #endif icedtea-web-1.6.2/tests/UnitTest++/src/Posix/PaxHeaders.17941/SignalTranslator.cpp0000644000000000000000000000013112654402377024377 xustar0030 mtime=1454507263.268432167 29 atime=1454507327.18357975 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/UnitTest++/src/Posix/SignalTranslator.cpp0000644000175000002070000000210212654402377025116 0ustar00jvanekmock00000000000000#include "SignalTranslator.h" namespace UnitTest { sigjmp_buf* SignalTranslator::s_jumpTarget = 0; namespace { void SignalHandler(int sig) { siglongjmp(*SignalTranslator::s_jumpTarget, sig ); } } SignalTranslator::SignalTranslator() { m_oldJumpTarget = s_jumpTarget; s_jumpTarget = &m_currentJumpTarget; struct sigaction action; action.sa_flags = 0; action.sa_handler = SignalHandler; sigemptyset( &action.sa_mask ); sigaction( SIGSEGV, &action, &m_old_SIGSEGV_action ); sigaction( SIGFPE , &action, &m_old_SIGFPE_action ); sigaction( SIGTRAP, &action, &m_old_SIGTRAP_action ); sigaction( SIGBUS , &action, &m_old_SIGBUS_action ); sigaction( SIGILL , &action, &m_old_SIGBUS_action ); } SignalTranslator::~SignalTranslator() { sigaction( SIGILL , &m_old_SIGBUS_action , 0 ); sigaction( SIGBUS , &m_old_SIGBUS_action , 0 ); sigaction( SIGTRAP, &m_old_SIGTRAP_action, 0 ); sigaction( SIGFPE , &m_old_SIGFPE_action , 0 ); sigaction( SIGSEGV, &m_old_SIGSEGV_action, 0 ); s_jumpTarget = m_oldJumpTarget; } } icedtea-web-1.6.2/tests/UnitTest++/src/PaxHeaders.17941/MemoryOutStream.h0000644000000000000000000000013112654402377022567 xustar0030 mtime=1454507263.268432167 29 atime=1454507327.18357975 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/UnitTest++/src/MemoryOutStream.h0000644000175000002070000000230212654402377023310 0ustar00jvanekmock00000000000000#ifndef UNITTEST_MEMORYOUTSTREAM_H #define UNITTEST_MEMORYOUTSTREAM_H #include "Config.h" #ifndef UNITTEST_USE_CUSTOM_STREAMS #include namespace UnitTest { class MemoryOutStream : public std::ostringstream { public: MemoryOutStream() {} char const* GetText() const; private: MemoryOutStream(MemoryOutStream const&); void operator =(MemoryOutStream const&); mutable std::string m_text; }; } #else #include namespace UnitTest { class MemoryOutStream { public: explicit MemoryOutStream(int const size = 256); ~MemoryOutStream(); char const* GetText() const; MemoryOutStream& operator << (char const* txt); MemoryOutStream& operator << (int n); MemoryOutStream& operator << (long n); MemoryOutStream& operator << (unsigned long n); MemoryOutStream& operator << (float f); MemoryOutStream& operator << (double d); MemoryOutStream& operator << (void const* p); MemoryOutStream& operator << (unsigned int s); enum { GROW_CHUNK_SIZE = 32 }; int GetCapacity() const; private: void operator= (MemoryOutStream const&); void GrowBuffer(int capacity); int m_capacity; char* m_buffer; }; } #endif #endif icedtea-web-1.6.2/tests/UnitTest++/src/PaxHeaders.17941/MemoryOutStream.cpp0000644000000000000000000000013212654402377023123 xustar0030 mtime=1454507263.268432167 30 atime=1454507327.182579763 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/UnitTest++/src/MemoryOutStream.cpp0000644000175000002070000000510112654402377023643 0ustar00jvanekmock00000000000000#include "MemoryOutStream.h" #ifndef UNITTEST_USE_CUSTOM_STREAMS namespace UnitTest { char const* MemoryOutStream::GetText() const { m_text = this->str(); return m_text.c_str(); } } #else #include #include namespace UnitTest { namespace { template void FormatToStream(MemoryOutStream& stream, char const* format, ValueType const& value) { using namespace std; char txt[32]; sprintf(txt, format, value); stream << txt; } int RoundUpToMultipleOfPow2Number (int n, int pow2Number) { return (n + (pow2Number - 1)) & ~(pow2Number - 1); } } MemoryOutStream::MemoryOutStream(int const size) : m_capacity (0) , m_buffer (0) { GrowBuffer(size); } MemoryOutStream::~MemoryOutStream() { delete [] m_buffer; } char const* MemoryOutStream::GetText() const { return m_buffer; } MemoryOutStream& MemoryOutStream::operator << (char const* txt) { using namespace std; int const bytesLeft = m_capacity - (int)strlen(m_buffer); int const bytesRequired = (int)strlen(txt) + 1; if (bytesRequired > bytesLeft) { int const requiredCapacity = bytesRequired + m_capacity - bytesLeft; GrowBuffer(requiredCapacity); } strcat(m_buffer, txt); return *this; } MemoryOutStream& MemoryOutStream::operator << (int const n) { FormatToStream(*this, "%i", n); return *this; } MemoryOutStream& MemoryOutStream::operator << (long const n) { FormatToStream(*this, "%li", n); return *this; } MemoryOutStream& MemoryOutStream::operator << (unsigned long const n) { FormatToStream(*this, "%lu", n); return *this; } MemoryOutStream& MemoryOutStream::operator << (float const f) { FormatToStream(*this, "%ff", f); return *this; } MemoryOutStream& MemoryOutStream::operator << (void const* p) { FormatToStream(*this, "%p", p); return *this; } MemoryOutStream& MemoryOutStream::operator << (unsigned int const s) { FormatToStream(*this, "%u", s); return *this; } MemoryOutStream& MemoryOutStream::operator <<(double const d) { FormatToStream(*this, "%f", d); return *this; } int MemoryOutStream::GetCapacity() const { return m_capacity; } void MemoryOutStream::GrowBuffer(int const desiredCapacity) { int const newCapacity = RoundUpToMultipleOfPow2Number(desiredCapacity, GROW_CHUNK_SIZE); using namespace std; char* buffer = new char[newCapacity]; if (m_buffer) strcpy(buffer, m_buffer); else strcpy(buffer, ""); delete [] m_buffer; m_buffer = buffer; m_capacity = newCapacity; } } #endif icedtea-web-1.6.2/tests/UnitTest++/src/PaxHeaders.17941/ExecuteTest.h0000644000000000000000000000013212654402377021716 xustar0030 mtime=1454507263.268432167 30 atime=1454507327.182579763 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/UnitTest++/src/ExecuteTest.h0000644000175000002070000000166012654402377022444 0ustar00jvanekmock00000000000000#ifndef UNITTEST_EXECUTE_TEST_H #define UNITTEST_EXECUTE_TEST_H #include "TestDetails.h" #include "MemoryOutStream.h" #include "AssertException.h" #include "CurrentTest.h" #ifdef UNITTEST_POSIX #include "Posix/SignalTranslator.h" #endif namespace UnitTest { template< typename T > void ExecuteTest(T& testObject, TestDetails const& details) { CurrentTest::Details() = &details; try { #ifdef UNITTEST_POSIX UNITTEST_THROW_SIGNALS #endif testObject.RunImpl(); } catch (AssertException const& e) { CurrentTest::Results()->OnTestFailure( TestDetails(details.testName, details.suiteName, e.Filename(), e.LineNumber()), e.what()); } catch (std::exception const& e) { MemoryOutStream stream; stream << "Unhandled exception: " << e.what(); CurrentTest::Results()->OnTestFailure(details, stream.GetText()); } catch (...) { CurrentTest::Results()->OnTestFailure(details, "Unhandled exception: Crash!"); } } } #endif icedtea-web-1.6.2/tests/UnitTest++/src/PaxHeaders.17941/DeferredTestResult.h0000644000000000000000000000013212654402377023233 xustar0030 mtime=1454507263.267432181 30 atime=1454507327.182579763 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/UnitTest++/src/DeferredTestResult.h0000644000175000002070000000104312654402377023754 0ustar00jvanekmock00000000000000#ifndef UNITTEST_DEFERREDTESTRESULT_H #define UNITTEST_DEFERREDTESTRESULT_H #include #include namespace UnitTest { struct DeferredTestResult { DeferredTestResult(); DeferredTestResult(char const* suite, char const* test); std::string suiteName; std::string testName; std::string failureFile; typedef std::pair< int, std::string > Failure; typedef std::vector< Failure > FailureVec; FailureVec failures; float timeElapsed; bool failed; }; } #endif //UNITTEST_DEFERREDTESTRESULT_H icedtea-web-1.6.2/tests/UnitTest++/src/PaxHeaders.17941/DeferredTestResult.cpp0000644000000000000000000000013212654402377023566 xustar0030 mtime=1454507263.267432181 30 atime=1454507327.182579763 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/UnitTest++/src/DeferredTestResult.cpp0000644000175000002070000000060512654402377024312 0ustar00jvanekmock00000000000000#include "DeferredTestResult.h" #include "Config.h" namespace UnitTest { DeferredTestResult::DeferredTestResult() : suiteName("") , testName("") , failureFile("") , timeElapsed(0.0f) , failed(false) { } DeferredTestResult::DeferredTestResult(char const* suite, char const* test) : suiteName(suite) , testName(test) , failureFile("") , timeElapsed(0.0f) , failed(false) { } } icedtea-web-1.6.2/tests/UnitTest++/src/PaxHeaders.17941/DeferredTestReporter.h0000644000000000000000000000013212654402377023557 xustar0030 mtime=1454507263.267432181 30 atime=1454507327.182579763 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/UnitTest++/src/DeferredTestReporter.h0000644000175000002070000000120312654402377024276 0ustar00jvanekmock00000000000000#ifndef UNITTEST_DEFERREDTESTREPORTER_H #define UNITTEST_DEFERREDTESTREPORTER_H #include "TestReporter.h" #include "DeferredTestResult.h" #include namespace UnitTest { class DeferredTestReporter : public TestReporter { public: virtual void ReportTestStart(TestDetails const& details); virtual void ReportFailure(TestDetails const& details, char const* failure); virtual void ReportTestFinish(TestDetails const& details, float secondsElapsed); typedef std::vector< DeferredTestResult > DeferredTestResultList; DeferredTestResultList& GetResults(); private: DeferredTestResultList m_results; }; } #endif icedtea-web-1.6.2/tests/UnitTest++/src/PaxHeaders.17941/DeferredTestReporter.cpp0000644000000000000000000000013212654402377024112 xustar0030 mtime=1454507263.267432181 30 atime=1454507327.182579763 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/UnitTest++/src/DeferredTestReporter.cpp0000644000175000002070000000147512654402377024644 0ustar00jvanekmock00000000000000#include "DeferredTestReporter.h" #include "TestDetails.h" #include "Config.h" using namespace UnitTest; void DeferredTestReporter::ReportTestStart(TestDetails const& details) { m_results.push_back(DeferredTestResult(details.suiteName, details.testName)); } void DeferredTestReporter::ReportFailure(TestDetails const& details, char const* failure) { DeferredTestResult& r = m_results.back(); r.failed = true; r.failures.push_back(DeferredTestResult::Failure(details.lineNumber, failure)); r.failureFile = details.filename; } void DeferredTestReporter::ReportTestFinish(TestDetails const&, float secondsElapsed) { DeferredTestResult& r = m_results.back(); r.timeElapsed = secondsElapsed; } DeferredTestReporter::DeferredTestResultList& DeferredTestReporter::GetResults() { return m_results; } icedtea-web-1.6.2/tests/UnitTest++/src/PaxHeaders.17941/CurrentTest.h0000644000000000000000000000013212654402377021736 xustar0030 mtime=1454507263.267432181 30 atime=1454507327.182579763 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/UnitTest++/src/CurrentTest.h0000644000175000002070000000035112654402377022460 0ustar00jvanekmock00000000000000#ifndef UNITTEST_CURRENTTESTRESULTS_H #define UNITTEST_CURRENTTESTRESULTS_H namespace UnitTest { class TestResults; class TestDetails; namespace CurrentTest { TestResults*& Results(); const TestDetails*& Details(); } } #endif icedtea-web-1.6.2/tests/UnitTest++/src/PaxHeaders.17941/CurrentTest.cpp0000644000000000000000000000013212654402377022271 xustar0030 mtime=1454507263.266432194 30 atime=1454507327.181579777 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/UnitTest++/src/CurrentTest.cpp0000644000175000002070000000044112654402377023013 0ustar00jvanekmock00000000000000#include "CurrentTest.h" #include namespace UnitTest { TestResults*& CurrentTest::Results() { static TestResults* testResults = NULL; return testResults; } const TestDetails*& CurrentTest::Details() { static const TestDetails* testDetails = NULL; return testDetails; } } icedtea-web-1.6.2/tests/UnitTest++/src/PaxHeaders.17941/Config.h0000644000000000000000000000013212654402377020661 xustar0030 mtime=1454507263.266432194 30 atime=1454507327.181579777 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/UnitTest++/src/Config.h0000644000175000002070000000172212654402377021406 0ustar00jvanekmock00000000000000#ifndef UNITTEST_CONFIG_H #define UNITTEST_CONFIG_H // Standard defines documented here: http://predef.sourceforge.net #if defined(_MSC_VER) #pragma warning(disable:4127) // conditional expression is constant #pragma warning(disable:4702) // unreachable code #pragma warning(disable:4722) // destructor never returns, potential memory leak #if (_MSC_VER == 1200) // VC6 #pragma warning(disable:4786) #pragma warning(disable:4290) #endif #endif #if defined(unix) || defined(__unix__) || defined(__unix) || defined(linux) || \ defined(__APPLE__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__) #define UNITTEST_POSIX #endif #if defined(__MINGW32__) #define UNITTEST_MINGW #endif // by default, MemoryOutStream is implemented in terms of std::ostringstream, which can be expensive. // uncomment this line to use the custom MemoryOutStream (no deps on std::ostringstream). //#define UNITTEST_USE_CUSTOM_STREAMS #endif icedtea-web-1.6.2/tests/UnitTest++/src/PaxHeaders.17941/Checks.h0000644000000000000000000000013212654402377020654 xustar0030 mtime=1454507263.266432194 30 atime=1454507327.181579777 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/UnitTest++/src/Checks.h0000644000175000002070000001150712654402377021403 0ustar00jvanekmock00000000000000#ifndef UNITTEST_CHECKS_H #define UNITTEST_CHECKS_H #include "Config.h" #include "TestResults.h" #include "MemoryOutStream.h" namespace UnitTest { template< typename Value > bool Check(Value const value) { return !!value; // doing double negative to avoid silly VS warnings } template< typename Expected, typename Actual > void CheckEqual(TestResults& results, Expected const& expected, Actual const& actual, TestDetails const& details) { if (!(expected == actual)) { UnitTest::MemoryOutStream stream; stream << "Expected " << expected << " but was " << actual; results.OnTestFailure(details, stream.GetText()); } } void CheckEqual(TestResults& results, char const* expected, char const* actual, TestDetails const& details); void CheckEqual(TestResults& results, char* expected, char* actual, TestDetails const& details); void CheckEqual(TestResults& results, char* expected, char const* actual, TestDetails const& details); void CheckEqual(TestResults& results, char const* expected, char* actual, TestDetails const& details); template< typename Expected, typename Actual, typename Tolerance > bool AreClose(Expected const& expected, Actual const& actual, Tolerance const& tolerance) { return (actual >= (expected - tolerance)) && (actual <= (expected + tolerance)); } template< typename Expected, typename Actual, typename Tolerance > void CheckClose(TestResults& results, Expected const& expected, Actual const& actual, Tolerance const& tolerance, TestDetails const& details) { if (!AreClose(expected, actual, tolerance)) { UnitTest::MemoryOutStream stream; stream << "Expected " << expected << " +/- " << tolerance << " but was " << actual; results.OnTestFailure(details, stream.GetText()); } } template< typename Expected, typename Actual > void CheckArrayEqual(TestResults& results, Expected const& expected, Actual const& actual, int const count, TestDetails const& details) { bool equal = true; for (int i = 0; i < count; ++i) equal &= (expected[i] == actual[i]); if (!equal) { UnitTest::MemoryOutStream stream; stream << "Expected [ "; for (int expectedIndex = 0; expectedIndex < count; ++expectedIndex) stream << expected[expectedIndex] << " "; stream << "] but was [ "; for (int actualIndex = 0; actualIndex < count; ++actualIndex) stream << actual[actualIndex] << " "; stream << "]"; results.OnTestFailure(details, stream.GetText()); } } template< typename Expected, typename Actual, typename Tolerance > bool ArrayAreClose(Expected const& expected, Actual const& actual, int const count, Tolerance const& tolerance) { bool equal = true; for (int i = 0; i < count; ++i) equal &= AreClose(expected[i], actual[i], tolerance); return equal; } template< typename Expected, typename Actual, typename Tolerance > void CheckArrayClose(TestResults& results, Expected const& expected, Actual const& actual, int const count, Tolerance const& tolerance, TestDetails const& details) { bool equal = ArrayAreClose(expected, actual, count, tolerance); if (!equal) { UnitTest::MemoryOutStream stream; stream << "Expected [ "; for (int expectedIndex = 0; expectedIndex < count; ++expectedIndex) stream << expected[expectedIndex] << " "; stream << "] +/- " << tolerance << " but was [ "; for (int actualIndex = 0; actualIndex < count; ++actualIndex) stream << actual[actualIndex] << " "; stream << "]"; results.OnTestFailure(details, stream.GetText()); } } template< typename Expected, typename Actual, typename Tolerance > void CheckArray2DClose(TestResults& results, Expected const& expected, Actual const& actual, int const rows, int const columns, Tolerance const& tolerance, TestDetails const& details) { bool equal = true; for (int i = 0; i < rows; ++i) equal &= ArrayAreClose(expected[i], actual[i], columns, tolerance); if (!equal) { UnitTest::MemoryOutStream stream; stream << "Expected [ "; for (int expectedRow = 0; expectedRow < rows; ++expectedRow) { stream << "[ "; for (int expectedColumn = 0; expectedColumn < columns; ++expectedColumn) stream << expected[expectedRow][expectedColumn] << " "; stream << "] "; } stream << "] +/- " << tolerance << " but was [ "; for (int actualRow = 0; actualRow < rows; ++actualRow) { stream << "[ "; for (int actualColumn = 0; actualColumn < columns; ++actualColumn) stream << actual[actualRow][actualColumn] << " "; stream << "] "; } stream << "]"; results.OnTestFailure(details, stream.GetText()); } } } #endif icedtea-web-1.6.2/tests/UnitTest++/src/PaxHeaders.17941/Checks.cpp0000644000000000000000000000013212654402377021207 xustar0030 mtime=1454507263.266432194 30 atime=1454507327.181579777 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/UnitTest++/src/Checks.cpp0000644000175000002070000000225012654402377021731 0ustar00jvanekmock00000000000000#include "Checks.h" #include namespace UnitTest { namespace { void CheckStringsEqual(TestResults& results, char const* expected, char const* actual, TestDetails const& details) { using namespace std; if (strcmp(expected, actual)) { UnitTest::MemoryOutStream stream; stream << "Expected " << expected << " but was " << actual; results.OnTestFailure(details, stream.GetText()); } } } void CheckEqual(TestResults& results, char const* expected, char const* actual, TestDetails const& details) { CheckStringsEqual(results, expected, actual, details); } void CheckEqual(TestResults& results, char* expected, char* actual, TestDetails const& details) { CheckStringsEqual(results, expected, actual, details); } void CheckEqual(TestResults& results, char* expected, char const* actual, TestDetails const& details) { CheckStringsEqual(results, expected, actual, details); } void CheckEqual(TestResults& results, char const* expected, char* actual, TestDetails const& details) { CheckStringsEqual(results, expected, actual, details); } } icedtea-web-1.6.2/tests/UnitTest++/src/PaxHeaders.17941/CheckMacros.h0000644000000000000000000000013212654402377021636 xustar0030 mtime=1454507263.266432194 30 atime=1454507327.181579777 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/UnitTest++/src/CheckMacros.h0000644000175000002070000001054112654402377022362 0ustar00jvanekmock00000000000000#ifndef UNITTEST_CHECKMACROS_H #define UNITTEST_CHECKMACROS_H #include "Checks.h" #include "AssertException.h" #include "MemoryOutStream.h" #include "TestDetails.h" #include "CurrentTest.h" #ifdef CHECK #error UnitTest++ redefines CHECK #endif #ifdef CHECK_EQUAL #error UnitTest++ redefines CHECK_EQUAL #endif #ifdef CHECK_CLOSE #error UnitTest++ redefines CHECK_CLOSE #endif #ifdef CHECK_ARRAY_EQUAL #error UnitTest++ redefines CHECK_ARRAY_EQUAL #endif #ifdef CHECK_ARRAY_CLOSE #error UnitTest++ redefines CHECK_ARRAY_CLOSE #endif #ifdef CHECK_ARRAY2D_CLOSE #error UnitTest++ redefines CHECK_ARRAY2D_CLOSE #endif #define CHECK(value) \ do \ { \ try { \ if (!UnitTest::Check(value)) \ UnitTest::CurrentTest::Results()->OnTestFailure(UnitTest::TestDetails(*UnitTest::CurrentTest::Details(), __LINE__), #value); \ } \ catch (...) { \ UnitTest::CurrentTest::Results()->OnTestFailure(UnitTest::TestDetails(*UnitTest::CurrentTest::Details(), __LINE__), \ "Unhandled exception in CHECK(" #value ")"); \ } \ } while (0) #define CHECK_EQUAL(expected, actual) \ do \ { \ try { \ UnitTest::CheckEqual(*UnitTest::CurrentTest::Results(), expected, actual, UnitTest::TestDetails(*UnitTest::CurrentTest::Details(), __LINE__)); \ } \ catch (...) { \ UnitTest::CurrentTest::Results()->OnTestFailure(UnitTest::TestDetails(*UnitTest::CurrentTest::Details(), __LINE__), \ "Unhandled exception in CHECK_EQUAL(" #expected ", " #actual ")"); \ } \ } while (0) #define CHECK_CLOSE(expected, actual, tolerance) \ do \ { \ try { \ UnitTest::CheckClose(*UnitTest::CurrentTest::Results(), expected, actual, tolerance, UnitTest::TestDetails(*UnitTest::CurrentTest::Details(), __LINE__)); \ } \ catch (...) { \ UnitTest::CurrentTest::Results()->OnTestFailure(UnitTest::TestDetails(*UnitTest::CurrentTest::Details(), __LINE__), \ "Unhandled exception in CHECK_CLOSE(" #expected ", " #actual ")"); \ } \ } while (0) #define CHECK_ARRAY_EQUAL(expected, actual, count) \ do \ { \ try { \ UnitTest::CheckArrayEqual(*UnitTest::CurrentTest::Results(), expected, actual, count, UnitTest::TestDetails(*UnitTest::CurrentTest::Details(), __LINE__)); \ } \ catch (...) { \ UnitTest::CurrentTest::Results()->OnTestFailure(UnitTest::TestDetails(*UnitTest::CurrentTest::Details(), __LINE__), \ "Unhandled exception in CHECK_ARRAY_EQUAL(" #expected ", " #actual ")"); \ } \ } while (0) #define CHECK_ARRAY_CLOSE(expected, actual, count, tolerance) \ do \ { \ try { \ UnitTest::CheckArrayClose(*UnitTest::CurrentTest::Results(), expected, actual, count, tolerance, UnitTest::TestDetails(*UnitTest::CurrentTest::Details(), __LINE__)); \ } \ catch (...) { \ UnitTest::CurrentTest::Results()->OnTestFailure(UnitTest::TestDetails(*UnitTest::CurrentTest::Details(), __LINE__), \ "Unhandled exception in CHECK_ARRAY_CLOSE(" #expected ", " #actual ")"); \ } \ } while (0) #define CHECK_ARRAY2D_CLOSE(expected, actual, rows, columns, tolerance) \ do \ { \ try { \ UnitTest::CheckArray2DClose(*UnitTest::CurrentTest::Results(), expected, actual, rows, columns, tolerance, UnitTest::TestDetails(*UnitTest::CurrentTest::Details(), __LINE__)); \ } \ catch (...) { \ UnitTest::CurrentTest::Results()->OnTestFailure(UnitTest::TestDetails(*UnitTest::CurrentTest::Details(), __LINE__), \ "Unhandled exception in CHECK_ARRAY_CLOSE(" #expected ", " #actual ")"); \ } \ } while (0) #define CHECK_THROW(expression, ExpectedExceptionType) \ do \ { \ bool caught_ = false; \ try { expression; } \ catch (ExpectedExceptionType const&) { caught_ = true; } \ catch (...) {} \ if (!caught_) \ UnitTest::CurrentTest::Results()->OnTestFailure(UnitTest::TestDetails(*UnitTest::CurrentTest::Details(), __LINE__), "Expected exception: \"" #ExpectedExceptionType "\" not thrown"); \ } while(0) #define CHECK_ASSERT(expression) \ CHECK_THROW(expression, UnitTest::AssertException); #endif icedtea-web-1.6.2/tests/UnitTest++/src/PaxHeaders.17941/AssertException.h0000644000000000000000000000013212654402377022574 xustar0030 mtime=1454507263.265432208 30 atime=1454507327.181579777 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/UnitTest++/src/AssertException.h0000644000175000002070000000077312654402377023326 0ustar00jvanekmock00000000000000#ifndef UNITTEST_ASSERTEXCEPTION_H #define UNITTEST_ASSERTEXCEPTION_H #include namespace UnitTest { class AssertException : public std::exception { public: AssertException(char const* description, char const* filename, int lineNumber); virtual ~AssertException() throw(); virtual char const* what() const throw(); char const* Filename() const; int LineNumber() const; private: char m_description[512]; char m_filename[256]; int m_lineNumber; }; } #endif icedtea-web-1.6.2/tests/UnitTest++/src/PaxHeaders.17941/AssertException.cpp0000644000000000000000000000013212654402377023127 xustar0030 mtime=1454507263.265432208 30 atime=1454507327.181579777 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/UnitTest++/src/AssertException.cpp0000644000175000002070000000110012654402377023642 0ustar00jvanekmock00000000000000#include "AssertException.h" #include namespace UnitTest { AssertException::AssertException(char const* description, char const* filename, int lineNumber) : m_lineNumber(lineNumber) { using namespace std; strcpy(m_description, description); strcpy(m_filename, filename); } AssertException::~AssertException() throw() { } char const* AssertException::what() const throw() { return m_description; } char const* AssertException::Filename() const { return m_filename; } int AssertException::LineNumber() const { return m_lineNumber; } } icedtea-web-1.6.2/tests/UnitTest++/PaxHeaders.17941/README0000644000000000000000000000013112654402377017373 xustar0030 mtime=1454507263.265432208 29 atime=1454507327.18057979 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/UnitTest++/README0000644000175000002070000000407612654402377020126 0ustar00jvanekmock00000000000000UnitTest++ README Version: v1.4 Last update: 2008-10-30 UnitTest++ is free software. You may copy, distribute, and modify it under the terms of the License contained in the file COPYING distributed with this package. This license is the same as the MIT/X Consortium license. See src/tests/TestUnitTest++.cpp for usage. Authors: Noel Llopis (llopis@convexhull.com) Charles Nicholson (charles.nicholson@gmail.com) Contributors: Jim Tilander Kim Grasman Jonathan Jansson Dirck Blaskey Rory Driscoll Dan Lind Matt Kimmel -- Submitted with permission from Blue Fang Games Anthony Moralez Jeff Dixon Randy Coulman Lieven van der Heide Release notes: -------------- Version 1.4 (2008-10-30) - CHECK macros work at arbitrary stack depth from inside TESTs. - Remove obsolete TEST_UTILITY macros - Predicated test execution (via TestRunner::RunTestsIf) - Better exception handling for fixture ctors/dtors. - VC6/7/8/9 support Version 1.3 (2007-4-22) - Removed dynamic memory allocations (other than streams) - MinGW support - Consistent (native) line endings - Minor bug fixing Version 1.2 (2006-10-29) - First pass at documentation. - More detailed error crash catching in fixtures. - Standard streams used for printing objects under check. This should allow the use of standard class types such as std::string or other custom classes with stream operators to ostream. - Standard streams can be optionally compiled off by defining UNITTEST_USE_CUSTOM_STREAMS in Config.h - Added named test suites - Added CHECK_ARRAY2D_CLOSE - Posix library name is libUnitTest++.a now - Floating point numbers are postfixed with f in the failure reports Version 1.1 (2006-04-18) - CHECK macros do not have side effects even if one of the parameters changes state - Removed CHECK_ARRAY_EQUAL (too similar to CHECK_ARRAY_CLOSE) - Added local and global time constraints - Removed dependencies on strstream - Improved Posix signal to exception translator - Failing tests are added to Visual Studio's error list - Fixed Visual Studio projects to work with spaces in directories Version 1.0 (2006-03-15) - Initial release icedtea-web-1.6.2/tests/UnitTest++/PaxHeaders.17941/Makefile0000644000000000000000000000013112654402377020153 xustar0030 mtime=1454507263.265432208 29 atime=1454507327.18057979 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/UnitTest++/Makefile0000644000175000002070000000433612654402377020705 0ustar00jvanekmock00000000000000CXX = g++ CXXFLAGS ?= -g -Wall -W -ansi # -pedantic LDFLAGS ?= SED = sed MV = mv RM = rm .SUFFIXES: .o .cpp lib = libUnitTest++.a test = TestUnitTest++ src = src/AssertException.cpp \ src/Test.cpp \ src/Checks.cpp \ src/TestRunner.cpp \ src/TestResults.cpp \ src/TestReporter.cpp \ src/TestReporterStdout.cpp \ src/ReportAssert.cpp \ src/TestList.cpp \ src/TimeConstraint.cpp \ src/TestDetails.cpp \ src/MemoryOutStream.cpp \ src/DeferredTestReporter.cpp \ src/DeferredTestResult.cpp \ src/XmlTestReporter.cpp \ src/CurrentTest.cpp ifeq ($(MSYSTEM), MINGW32) src += src/Win32/TimeHelpers.cpp else src += src/Posix/SignalTranslator.cpp \ src/Posix/TimeHelpers.cpp endif test_src = src/tests/Main.cpp \ src/tests/TestAssertHandler.cpp \ src/tests/TestChecks.cpp \ src/tests/TestUnitTest++.cpp \ src/tests/TestTest.cpp \ src/tests/TestTestResults.cpp \ src/tests/TestTestRunner.cpp \ src/tests/TestCheckMacros.cpp \ src/tests/TestTestList.cpp \ src/tests/TestTestMacros.cpp \ src/tests/TestTimeConstraint.cpp \ src/tests/TestTimeConstraintMacro.cpp \ src/tests/TestMemoryOutStream.cpp \ src/tests/TestDeferredTestReporter.cpp \ src/tests/TestXmlTestReporter.cpp \ src/tests/TestCurrentTest.cpp objects = $(patsubst %.cpp, %.o, $(src)) test_objects = $(patsubst %.cpp, %.o, $(test_src)) dependencies = $(subst .o,.d,$(objects)) test_dependencies = $(subst .o,.d,$(test_objects)) define make-depend $(CXX) $(CXXFLAGS) -M $1 | \ $(SED) -e 's,\($(notdir $2)\) *:,$(dir $2)\1: ,' > $3.tmp $(SED) -e 's/#.*//' \ -e 's/^[^:]*: *//' \ -e 's/ *\\$$//' \ -e '/^$$/ d' \ -e 's/$$/ :/' $3.tmp >> $3.tmp $(MV) $3.tmp $3 endef all: $(lib) $(lib): $(objects) @echo Creating $(lib) library... @ar cr $(lib) $(objects) $(test): $(lib) $(test_objects) @echo Linking $(test)... @$(CXX) $(LDFLAGS) -o $(test) $(test_objects) $(lib) @echo Running unit tests... @./$(test) clean: -@$(RM) $(objects) $(test_objects) $(dependencies) $(test_dependencies) $(test) $(lib) 2> /dev/null %.o : %.cpp @echo $< @$(call make-depend,$<,$@,$(subst .o,.d,$@)) @$(CXX) $(CXXFLAGS) -c $< -o $(patsubst %.cpp, %.o, $<) ifneq "$(MAKECMDGOALS)" "clean" -include $(dependencies) -include $(test_dependencies) endif icedtea-web-1.6.2/tests/UnitTest++/PaxHeaders.17941/COPYING0000644000000000000000000000013112654402377017546 xustar0030 mtime=1454507263.264432221 29 atime=1454507327.18057979 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/UnitTest++/COPYING0000644000175000002070000000206512654402377020275 0ustar00jvanekmock00000000000000Copyright (c) 2006 Noel Llopis and Charles Nicholson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. icedtea-web-1.6.2/tests/PaxHeaders.17941/test-extensions0000644000000000000000000000013212654402377017706 xustar0030 mtime=1454507263.262432247 30 atime=1454507658.776157397 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/test-extensions/0000755000175000002070000000000012654402377020506 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/test-extensions/PaxHeaders.17941/sun0000644000000000000000000000013212654402377020513 xustar0030 mtime=1454507263.262432247 30 atime=1454507658.776157397 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/test-extensions/sun/0000755000175000002070000000000012654402377021313 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/test-extensions/sun/PaxHeaders.17941/applet0000644000000000000000000000013212654402377022000 xustar0030 mtime=1454507263.263432234 30 atime=1454507658.776157397 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/test-extensions/sun/applet/0000755000175000002070000000000012654402377022600 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/test-extensions/sun/applet/PaxHeaders.17941/mock0000644000000000000000000000013212654402377022731 xustar0030 mtime=1454507263.263432234 30 atime=1454507658.776157397 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/test-extensions/sun/applet/mock/0000755000175000002070000000000012654402377023531 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/test-extensions/sun/applet/mock/PaxHeaders.17941/PluginPipeMock.java0000644000000000000000000000013212654402377026537 xustar0030 mtime=1454507263.263432234 30 atime=1454507327.360577389 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/test-extensions/sun/applet/mock/PluginPipeMock.java0000644000175000002070000000724412654402377027271 0ustar00jvanekmock00000000000000package sun.applet.mock; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.StringReader; import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; /** * Helper for getting an input & output stream for use with PluginStreamHandler. * Provides a convenient way of reading the Java requests and sending mocked * plugin responses. * * The handling of these requests should be done on a different thread from the * tested method, as icedtea-web will block waiting for a reply after sending a * request. */ public class PluginPipeMock { private ResponseInputPipeMock responseInputStream = new ResponseInputPipeMock(); private RequestOutputPipeMock requestOutputStream = new RequestOutputPipeMock(); /* * A queue of mocked responses that are sent as replies to icedtea-web * Java-side requests. */ private BlockingQueue mockedResponseQueue = new LinkedBlockingQueue(); /* * A queue of actual (ie, not mocked) requests that come from methods * under test. */ private BlockingQueue requestQueue = new LinkedBlockingQueue(); public InputStream getResponseInputStream() { return responseInputStream; } public OutputStream getRequestOutputStream() { return requestOutputStream; } public String getNextRequest() { try { return requestQueue.take(); } catch (InterruptedException e) { // Nothing to do return null; } } public void sendResponse(String response) { try { mockedResponseQueue.put(response); } catch (InterruptedException e) { // Nothing to do } } /** * Queues mocked responses and sends them as replies to icedtea-web. A * synchronized message queue is read from. Blocks until it gets the next * message. */ private class ResponseInputPipeMock extends InputStream { private StringReader reader = null; @Override public int read() throws IOException { try { while (true) { if (reader == null) { reader = new StringReader(mockedResponseQueue.take() + '\n'); } int chr = reader.read(); if (chr == -1) { reader = null; continue; } return chr; } } catch (InterruptedException e) { // Nothing to do return -1; } } /* Necessary for correct behaviour with BufferedReader! */ @Override public int read(byte b[], int off, int len) throws IOException { if (len == 0) { return 0; } b[off] = (byte) read(); return 1; } } /** * Outputs requests from icedtea-web as a stream of lines. A synchronized * message queue is written to. */ private class RequestOutputPipeMock extends OutputStream { private StringBuilder lineBuffer = new StringBuilder(); @Override public synchronized void write(int b) throws IOException { try { char chr = (char) b; if (chr == '\0') { requestQueue.put(lineBuffer.toString()); lineBuffer.setLength(0); } else { lineBuffer.append((char) b); } } catch (InterruptedException e) { // Nothing to do } } } } icedtea-web-1.6.2/tests/test-extensions/sun/applet/PaxHeaders.17941/PluginPipeMockUtil.java0000644000000000000000000000013212654402377026444 xustar0030 mtime=1454507263.263432234 30 atime=1454507327.360577389 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/test-extensions/sun/applet/PluginPipeMockUtil.java0000644000175000002070000001320012654402377027163 0ustar00jvanekmock00000000000000/* Copyright (C) 2013 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ /* Must be in sun.applet to access PluginAppletSecurityContext's constructor and PluginObjectStore */ package sun.applet; import java.util.IdentityHashMap; import sun.applet.mock.PluginPipeMock; /* * Convenience class for PluginPipeMock. * Provides convenient methods for installing a custom pipe mock and cleaning it up. * * Provides PipeMessageHandler interface and accompany convenience methods which can * be used to define mocked pipes in a simple manner. * */ public class PluginPipeMockUtil { /************************************************************************** * Basic setup & teardown * **************************************************************************/ /* Maps PluginPipeMock instances to a ThreadGroup, allowing us to stop all the * message handling threads that we started when setting up the mock pipes. */ static private IdentityHashMap pipeToThreadGroup = new IdentityHashMap(); /* By providing custom implementations of the input stream & output stream used by PluginStreamHandler, * we are able to mock the C++-side of the plugin. We do this by sending the messages the Java-side expects * to receive. Additionally, we are able to test that the Java-side sends the correct requests. * See PluginPipeMock for more details. */ static private PluginPipeMock installPipeMock() { AppletSecurityContextManager.addContext(0, new PluginAppletSecurityContext(0, false /* no security manager */)); PluginPipeMock pipeMock = new PluginPipeMock(); PluginStreamHandler streamHandler = new PluginStreamHandler(pipeMock.getResponseInputStream(), pipeMock.getRequestOutputStream()); PluginAppletViewer.setStreamhandler(streamHandler); PluginAppletViewer.setPluginCallRequestFactory(new PluginCallRequestFactory()); streamHandler.startProcessing(); return pipeMock; } /* Set up the mocked plugin pipe environment. See installPipeMock for details. */ static public PluginPipeMock setupMockedMessageHandling() throws Exception { ThreadGroup pipeThreadGroup = new ThreadGroup("PluginAppletViewerTestThreadGroup") { public void uncaughtException(Thread t, Throwable e) { // Silent death for plugin message handler threads } }; final PluginPipeMock[] pipeMock = {null}; // Do set-up in a thread so we can pass along our thread-group, used for clean-up. Thread initThread = new Thread(pipeThreadGroup, "InstallPipeMockThread") { @Override public void run() { pipeMock[0] = installPipeMock(); } }; initThread.start(); initThread.join(); pipeToThreadGroup.put(pipeMock[0], pipeThreadGroup); return pipeMock[0]; } /* Kill any message handling threads started when setting up the mocked pipes */ @SuppressWarnings("deprecation") static public void cleanUpMockedMessageHandling(PluginPipeMock pipeMock) throws Exception { ThreadGroup pipeThreadGroup = pipeToThreadGroup.get(pipeMock); if (pipeThreadGroup != null) { pipeThreadGroup.stop(); } pipeToThreadGroup.remove(pipeMock); } /************************************************************************** * Object store utilities * **************************************************************************/ /* * Helpers for manipulating the object mapping using to refer to objects in * the plugin */ public static Object getPluginStoreObject(int id) { return PluginObjectStore.getInstance().getObject(id); } /* Stores the object if it is not yet stored */ public static int getPluginStoreId(Object obj) { PluginObjectStore.getInstance().reference(obj); return PluginObjectStore.getInstance().getIdentifier(obj); } } icedtea-web-1.6.2/tests/test-extensions/PaxHeaders.17941/net0000644000000000000000000000013212654402377020474 xustar0030 mtime=1454507263.244432488 30 atime=1454507658.776157397 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/test-extensions/net/0000755000175000002070000000000012654402377021274 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/test-extensions/net/PaxHeaders.17941/sourceforge0000644000000000000000000000013212654402377023017 xustar0030 mtime=1454507263.244432488 30 atime=1454507658.776157397 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/0000755000175000002070000000000012654402377023617 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/PaxHeaders.17941/jnlp0000644000000000000000000000013212654402377023762 xustar0030 mtime=1454507263.262432247 30 atime=1454507658.776157397 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/0000755000175000002070000000000012654402377024562 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/PaxHeaders.17941/util0000644000000000000000000000013212654402377024737 xustar0030 mtime=1454507263.262432247 30 atime=1454507658.776157397 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/util/0000755000175000002070000000000012654402377025537 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/util/PaxHeaders.17941/logging0000644000000000000000000000013212654402377026365 xustar0030 mtime=1454507263.262432247 30 atime=1454507658.776157397 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/util/logging/0000755000175000002070000000000012654402377027165 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/util/logging/PaxHeaders.17941/NoStdOutE0000644000000000000000000000013212654402377030211 xustar0030 mtime=1454507263.262432247 30 atime=1454507327.360577389 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/util/logging/NoStdOutErrTest.java0000644000175000002070000001003712654402377033061 0ustar00jvanekmock00000000000000/* Copyright (C) 2011-2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util.logging; import java.lang.reflect.Method; import net.sourceforge.jnlp.ServerAccess; import org.junit.AfterClass; import org.junit.BeforeClass; /** * It is crucial that BeforeClass inits logging subsystem. * If logging subsytem of itw is enabled from itw, then junit's classloader do not * see it. And so when is junit manipualting with logging, then it creates new (second!) * static instance. On opposite, if junit creates the instance, then itw see this one. * * Explanation is that junit classloader (fresh for each test-class) is creating * special classloader for itw (or better itw is creating its own one). The itw * classloader is then branch...or leaf of junit classloader. So any class loaded * by junit classloader is visible from itw, but not vice verse. */ public class NoStdOutErrTest { private static boolean origialStds; private static final String setLogToStreams = "setLogToStreams"; /* * "printed" exceptions are otherwise consumed via junit if thrown :-/ */ @BeforeClass public static synchronized void disableStds() { try { //init logger and log and flush message //it is crucial for junit to grip it OutputController.getLogger().log("initialising"); //one more times: if TESTED class is the first which creates instance of logger //then when junit can not access this class, and creates its own for its purposes //when junit creates this class, then also TESTED class have access to it and so it behaves as expected OutputController.getLogger().flush(); origialStds = LogConfig.getLogConfig().isLogToStreams(); invokeSetLogToStreams(false); } catch (Exception ex) { ServerAccess.logException(ex); } } @AfterClass public static synchronized void restoreStds() { try { OutputController.getLogger().flush(); invokeSetLogToStreams(origialStds); } catch (Exception ex) { ServerAccess.logException(ex); } } private static synchronized void invokeSetLogToStreams(boolean state) { try { Method lcs = LogConfig.class.getDeclaredMethod(setLogToStreams, boolean.class); lcs.setAccessible(true); lcs.invoke(LogConfig.getLogConfig(), state); } catch (Exception ex) { ServerAccess.logException(ex); } } } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/util/PaxHeaders.17941/FileTestUtils.jav0000644000000000000000000000013212654402377030256 xustar0030 mtime=1454507263.262432247 30 atime=1454507327.359577403 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/util/FileTestUtils.java0000644000175000002070000001345612654402377031153 0ustar00jvanekmock00000000000000/* Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util; import static org.junit.Assert.assertEquals; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.PrintWriter; import java.lang.management.ManagementFactory; import java.util.jar.Attributes; import java.util.jar.JarEntry; import java.util.jar.JarOutputStream; import java.util.jar.Manifest; import javax.management.MBeanServer; import javax.management.ObjectName; import net.sourceforge.jnlp.ServerAccess; public class FileTestUtils { /* Get the open file-descriptor count for the process. Note that this is * specific to Unix-like operating systems. */ static public long getOpenFileDescriptorCount() { MBeanServer beanServer = ManagementFactory.getPlatformMBeanServer(); try { return (Long) beanServer.getAttribute(new ObjectName( "java.lang:type=OperatingSystem"), "OpenFileDescriptorCount"); } catch (Exception e) { // Effectively disables leak tests ServerAccess.logErrorReprint("Warning: Cannot get file descriptors for this platform!"); return 0; } } /* Check the amount of file descriptors before and after a Runnable */ static public void assertNoFileLeak(Runnable runnable) throws InterruptedException { Thread.sleep(10); long filesOpenBefore = getOpenFileDescriptorCount(); runnable.run(); Thread.sleep(10); long filesLeaked = getOpenFileDescriptorCount() - filesOpenBefore; //how come? Appearently can... if (filesLeaked<0){ return; } assertEquals(0, filesLeaked); } /* Creates a file with the given contents */ static public void createFileWithContents(File file, String contents) throws IOException { PrintWriter out = new PrintWriter(file); out.write(contents); out.close(); } /* Creates a jar in a temporary directory, with the given name & file contents */ static public void createJarWithoutManifestContents(File jarFile, File... fileContents) throws Exception{ createJarWithContents(jarFile, null, fileContents); } /* Creates a jar in a temporary directory, with the given name & file contents */ static public void createJarWithContents(File jarFile, Manifest manifestContents, File... fileContents) throws Exception { /* Manifest quite evilly ignores all attributes if we don't specify a version! * Make sure it's set here. */ if (manifestContents != null){ manifestContents.getMainAttributes().put(Attributes.Name.MANIFEST_VERSION, "1.0"); } JarOutputStream jarWriter; if (manifestContents == null){ jarWriter = new JarOutputStream(new FileOutputStream(jarFile)); } else { jarWriter = new JarOutputStream(new FileOutputStream(jarFile), manifestContents); } for (File file : fileContents) { jarWriter.putNextEntry(new JarEntry(file.getName())); FileInputStream fileReader = new FileInputStream(file); StreamUtils.copyStream(fileReader, jarWriter); fileReader.close(); jarWriter.closeEntry(); } jarWriter.close(); } /* Creates a jar in a temporary directory, with the given name, manifest & file contents */ static public void createJarWithContents(File jarFile, File... fileContents) throws Exception { /* Note that we always specify a manifest, to avoid empty jars. * Empty jars are not allowed by icedtea-web during the zip-file header check. */ createJarWithContents(jarFile, new Manifest(), fileContents); } /* Creates a temporary directory. Note that Java 7 has a method for this, * but we want to remain 6-compatible. */ static public File createTempDirectory() throws IOException { File file = File.createTempFile("temp", Long.toString(System.nanoTime())); file.delete(); if (!file.mkdir()) { throw new IOException("Failed to create temporary directory '" + file + "' for test."); } return file; } } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/util/PaxHeaders.17941/CacheTestUtils.ja0000644000000000000000000000013212654402377030214 xustar0030 mtime=1454507263.262432247 30 atime=1454507327.359577403 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/util/CacheTestUtils.java0000644000175000002070000000410312654402377031264 0ustar00jvanekmock00000000000000/* Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util; public class CacheTestUtils { //Check if input string contains only one instance of given substring public static boolean stringContainsOnlySingleInstance(String in, String substr) { int firstIndex = in.indexOf(substr); int lastIndex = in.lastIndexOf(substr); boolean containsString = firstIndex != -1; boolean onlyOneInstance = firstIndex == lastIndex; return containsString && onlyOneInstance; } } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/PaxHeaders.17941/tools0000644000000000000000000000013212654402377025122 xustar0030 mtime=1454507263.261432261 30 atime=1454507658.776157397 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/tools/0000755000175000002070000000000012654402377025722 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/tools/PaxHeaders.17941/WaitingForString0000644000000000000000000000013212654402377030362 xustar0030 mtime=1454507263.261432261 30 atime=1454507327.359577403 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/tools/WaitingForStringProcess.java0000644000175000002070000000507212654402377033370 0ustar00jvanekmock00000000000000package net.sourceforge.jnlp.tools; import java.util.List; import net.sourceforge.jnlp.ContentReaderListener; import net.sourceforge.jnlp.ServerAccess; import org.junit.Assert; /** * You can see ClipboardContext reproducers as examples * */ public class WaitingForStringProcess implements ContentReaderListener, Runnable { private final boolean headless; private final String url; private StringBuilder output = new StringBuilder(); private StringBuilder err = new StringBuilder(); private AsyncJavaws aj; ContentReaderListener errListener = new ContentReaderListener() { @Override public void charReaded(char ch) { err.append(ch); } @Override public void lineReaded(String s) { } }; private final String waitingFor; private boolean canRun = true; private final ServerAccess server; private final List otherArgs; public WaitingForStringProcess(ServerAccess server, String url, List otherArgs, boolean headless, String waitingFor) { this.url = url; this.headless = headless; this.waitingFor = waitingFor; Assert.assertNotNull(waitingFor); Assert.assertNotNull(url); this.server = server; this.otherArgs = otherArgs; Assert.assertNotNull(server); } @Override public void charReaded(char ch) { output.append(ch); } @Override public void lineReaded(String s) { if (s.contains(waitingFor)) { canRun = false; } } @Override public void run() { aj = new AsyncJavaws(server, url, otherArgs, headless, this, errListener); ServerAccess.logOutputReprint("Starting thread with " + url + " and waiting for result or string " + waitingFor); new Thread(aj).start(); while (canRun && aj.getResult() == null) { try { Thread.sleep(100); } catch (InterruptedException ex) { ServerAccess.logErrorReprint("iteration interrupted"); throw new RuntimeException(ex); } } if (aj.getResult() != null) { ServerAccess.logOutputReprint("Waiting done. Result have been delivered"); } if (!canRun) { ServerAccess.logOutputReprint("Waiting done. String " + waitingFor + " delivered"); } } public String getErr() { return err.toString(); } public String getOutput() { return output.toString(); } public AsyncJavaws getAj() { return aj; } } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/tools/PaxHeaders.17941/MessagePropertie0000644000000000000000000000013212654402377030400 xustar0030 mtime=1454507263.261432261 30 atime=1454507327.359577403 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/tools/MessageProperties.java0000644000175000002070000000565212654402377032236 0ustar00jvanekmock00000000000000/* MessageProperties.java Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.tools; import java.util.Locale; import java.util.PropertyResourceBundle; import java.util.ResourceBundle; import java.io.IOException; public class MessageProperties { public enum SupportedLanguage { en("en"), cs("cs"), de("de"), pl("pl"); private Locale locale; private SupportedLanguage(String lang) { this.locale = new Locale(lang); } public Locale getLocale() { return this.locale; } } private static final String resourcePath = "net/sourceforge/jnlp/resources/Messages"; /** * Same as {@link #getMessage(Locale, String)}, using the current default Locale */ public static String getMessage(String key) { return getMessage(Locale.getDefault(), key); } /** * Retrieve a localized message from resource file * @param locale the localization of Messages.properties to search * @param key * @return the message corresponding to the given key from the specified localization * @throws IOException if the specified Messages localization is unavailable */ public static String getMessage(Locale locale, String key) { ResourceBundle bundle = PropertyResourceBundle.getBundle(resourcePath, locale); return bundle.getString(key); } } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/tools/PaxHeaders.17941/DeploymentProper0000644000000000000000000000013212654402377030432 xustar0030 mtime=1454507263.261432261 30 atime=1454507327.359577403 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/tools/DeploymentPropertiesModifier.java0000644000175000002070000001303312654402377034441 0ustar00jvanekmock00000000000000/* Copyright (C) 2015 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.tools; import java.io.IOException; import java.util.AbstractMap; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import net.sourceforge.jnlp.config.InfrastructureFileDescriptor; import net.sourceforge.jnlp.config.PathsAndFiles; import net.sourceforge.jnlp.util.FileUtils; public class DeploymentPropertiesModifier { /** * for advanced users, less verbose, less fool-proof multi-impl */ public static class MultipleDeploymentPropertiesModifier { private final InfrastructureFileDescriptor src; private final AbstractMap.SimpleEntry[] keyValue; private List modifications; public MultipleDeploymentPropertiesModifier(AbstractMap.SimpleEntry... keyValue) { this(PathsAndFiles.USER_DEPLOYMENT_FILE, keyValue); } public MultipleDeploymentPropertiesModifier(InfrastructureFileDescriptor src, HashMap.SimpleEntry... keyValue) { this.src = src; this.keyValue = keyValue; } public void setProperties() throws IOException { modifications = new ArrayList<>(keyValue.length); for (AbstractMap.SimpleEntry keyValue1 : keyValue) { DeploymentPropertiesModifier dm = new DeploymentPropertiesModifier(src); dm.setProperties(keyValue1.getKey(), keyValue1.getValue()); //adding to beggining, soe restoring goes from last. Not necessary, but nice. modifications.add(0, dm); } } public void restoreProperties() throws IOException { for (DeploymentPropertiesModifier dm : modifications) { dm.restoreProperties(); } } } private final InfrastructureFileDescriptor src; private String savedValue; private String requestedProperty; private String requestedValue; private boolean isPropertiesSet; public DeploymentPropertiesModifier() { this(PathsAndFiles.USER_DEPLOYMENT_FILE); } public DeploymentPropertiesModifier(InfrastructureFileDescriptor src) { this.src = src; isPropertiesSet = false; } public void setProperties(String property, String value) throws IOException { if (isPropertiesSet) { throw new IllegalStateException("Properties can be set only once. Revert and use naother instance."); } isPropertiesSet = true; requestedProperty = property; requestedValue = value; setDeploymentProperties(requestedProperty, requestedValue); } public void restoreProperties() throws IOException { if (!isPropertiesSet) { throw new IllegalStateException("Prperties must be set before they can be reverted"); } isPropertiesSet = false; restoreDeploymentProperties(); } private void setDeploymentProperties(String property, String value) throws IOException { String properties = FileUtils.loadFileAsString(src.getFile()); for (String line : properties.split("\n")) { if (line.contains(property)) { savedValue = line; properties = properties.replace(line, property + "=" + value + "\n"); } } if (savedValue == null) { properties += property + "=" + value + "\n"; } FileUtils.saveFile(properties, src.getFile()); } private void restoreDeploymentProperties() throws IOException { String properties = FileUtils.loadFileAsString(src.getFile()); if (savedValue != null) { properties = properties.replace(requestedProperty + "=" + requestedValue + "\n", savedValue); } else { properties = properties.replace(requestedProperty + "=" + requestedValue + "\n", ""); } FileUtils.saveFile(properties, src.getFile()); } } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/tools/PaxHeaders.17941/CodeSignerCreato0000644000000000000000000000013212654402377030302 xustar0030 mtime=1454507263.261432261 30 atime=1454507327.359577403 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/tools/CodeSignerCreator.java0000644000175000002070000002361712654402377032140 0ustar00jvanekmock00000000000000/* * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package net.sourceforge.jnlp.tools; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.security.CodeSigner; import java.security.InvalidKeyException; import java.security.NoSuchAlgorithmException; import java.security.NoSuchProviderException; import java.security.PrivateKey; import java.security.SignatureException; import java.security.Timestamp; import java.security.cert.CertPath; import java.security.cert.CertificateException; import java.security.cert.CertificateFactory; import java.security.cert.X509Certificate; import java.util.ArrayList; import java.util.Date; import sun.security.x509.AlgorithmId; import sun.security.x509.CertificateAlgorithmId; import sun.security.x509.CertificateIssuerName; import sun.security.x509.CertificateSerialNumber; import sun.security.x509.CertificateSubjectName; import sun.security.x509.CertificateValidity; import sun.security.x509.CertificateVersion; import sun.security.x509.X500Name; import sun.security.x509.X509CertImpl; import sun.security.x509.X509CertInfo; public class CodeSignerCreator { /** * Create an X509 Certificate signed using SHA1withRSA with a 2048 bit key. * @param dname Domain Name to represent the certificate * @param notBefore The date by which the certificate starts being valid. Cannot be null. * @param validity The number of days the certificate is valid after notBefore. * @return An X509 certificate setup with properties using the specified parameters. * @throws Exception */ public static X509Certificate createCert(String dname, Date notBefore, int validity) throws Exception { int keysize = 2048; String keyAlgName = "RSA"; String sigAlgName = "SHA1withRSA"; if (dname == null) throw new Exception("Required DN is null. Please specify cert Domain Name via dname"); if (notBefore == null) throw new Exception("Required start date is null. Please specify the date at which the cert is valid via notBefore"); if (validity < 0) throw new Exception("Required validity is negative. Please specify the number of days for which the cert is valid after the start date."); // KeyTool#doGenKeyPair X500Name x500Name = new X500Name(dname); KeyPair keyPair = new KeyPair(keyAlgName, sigAlgName, keysize); PrivateKey privKey = keyPair.getPrivateKey(); X509Certificate oldCert = keyPair.getSelfCertificate(x500Name, notBefore, validity); // KeyTool#doSelfCert byte[] encoded = oldCert.getEncoded(); X509CertImpl certImpl = new X509CertImpl(encoded); X509CertInfo certInfo = (X509CertInfo) certImpl.get(X509CertImpl.NAME + "." + X509CertImpl.INFO); Date notAfter = new Date(notBefore.getTime() + validity*1000L*24L*60L*60L); CertificateValidity interval = new CertificateValidity(notBefore, notAfter); certInfo.set(X509CertInfo.VALIDITY, interval); certInfo.set(X509CertInfo.SERIAL_NUMBER, new CertificateSerialNumber( new java.util.Random().nextInt() & 0x7fffffff)); certInfo.set(X509CertInfo.SUBJECT + "." + CertificateSubjectName.DN_NAME, x500Name); certInfo.set(X509CertInfo.ISSUER + "." + CertificateIssuerName.DN_NAME, x500Name); // The inner and outer signature algorithms have to match. // The way we achieve that is really ugly, but there seems to be no // other solution: We first sign the cert, then retrieve the // outer sigalg and use it to set the inner sigalg X509CertImpl newCert = new X509CertImpl(certInfo); newCert.sign(privKey, sigAlgName); AlgorithmId sigAlgid = (AlgorithmId)newCert.get(X509CertImpl.SIG_ALG); certInfo.set(CertificateAlgorithmId.NAME + "." + CertificateAlgorithmId.ALGORITHM, sigAlgid); certInfo.set(X509CertInfo.VERSION, new CertificateVersion(CertificateVersion.V3)); // FIXME Figure out extensions // CertificateExtensions ext = createV3Extensions( // null, // (CertificateExtensions)certInfo.get(X509CertInfo.EXTENSIONS), // v3ext, // oldCert.getPublicKey(), // null); // certInfo.set(X509CertInfo.EXTENSIONS, ext); newCert = new X509CertImpl(certInfo); newCert.sign(privKey, sigAlgName); return newCert; } /** * Create a new code signer with the specified information. * @param domainName Domain Name to represent the certificate * @param notBefore The date by which the certificate starts being valid. Cannot be null. * @param validity The number of days the certificate is valid after notBefore. * @return A code signer with the properties passed through its parameters. */ public static CodeSigner getOneCodeSigner(String domainName, Date notBefore, int validity) throws Exception { X509Certificate jarEntryCert = createCert(domainName, notBefore, validity); ArrayList certs = new ArrayList(1); certs.add(jarEntryCert); CertificateFactory cf = CertificateFactory.getInstance("X.509"); CertPath certPath = cf.generateCertPath(certs); Timestamp certTimestamp = new Timestamp(jarEntryCert.getNotBefore(), certPath); return new CodeSigner(certPath, certTimestamp); } /** * A wrapper over JDK-internal CertAndKeyGen Class. *

* This is an internal class whose package changed between OpenJDK 7 and 8. * Use reflection to access the right thing. */ public static class KeyPair { private /* CertAndKeyGen */ Object keyPair; public KeyPair(String keyAlgName, String sigAlgName, int keySize) throws NoSuchAlgorithmException, InvalidKeyException { try { // keyPair = new CertAndKeyGen(keyAlgName, sigAlgName); Class certAndKeyGenClass = Class.forName(getCertAndKeyGenClass()); Constructor constructor = certAndKeyGenClass.getDeclaredConstructor(String.class, String.class); keyPair = constructor.newInstance(keyAlgName, sigAlgName); // keyPair.generate(keySize); Method generate = certAndKeyGenClass.getMethod("generate", int.class); generate.invoke(keyPair, keySize); } catch (ClassNotFoundException | NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException certAndKeyGenClassError) { throw new AssertionError("Unable to use CertAndKeyGen class", certAndKeyGenClassError); } } public PrivateKey getPrivateKey() { try { // return keyPair.getPrivateKey(); Class klass = keyPair.getClass(); Method method = klass.getMethod("getPrivateKey"); return (PrivateKey) method.invoke(keyPair); } catch (NoSuchMethodException | IllegalAccessException | IllegalArgumentException | InvocationTargetException error) { throw new AssertionError(error); } } public X509Certificate getSelfCertificate(X500Name name, Date notBefore, long validityInDays) throws InvalidKeyException, CertificateException, SignatureException, NoSuchAlgorithmException, NoSuchProviderException { try { // return keyPair.getSelfCertificate(name, notBefore, validityInDays * 24L * 60L * 60L); Class klass = keyPair.getClass(); Method method = klass.getMethod("getSelfCertificate", X500Name.class, Date.class, long.class); return (X509Certificate) method.invoke(keyPair, name, notBefore, validityInDays * 24L * 60L * 60L); } catch (InvocationTargetException ite) { throw new RuntimeException(ite.getCause()); } catch (NoSuchMethodException | IllegalAccessException | IllegalArgumentException error) { throw new AssertionError(error); } } private String getCertAndKeyGenClass() { String javaVersion = System.getProperty("java.version"); String className = null; if (javaVersion.startsWith("1.7")) { className = "sun.security.x509.CertAndKeyGen"; } else if (javaVersion.startsWith("1.8") || javaVersion.startsWith("1.9")) { className = "sun.security.tools.keytool.CertAndKeyGen"; } else { throw new AssertionError("Unrecognized Java Version"); } return className; } } } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/tools/PaxHeaders.17941/ClipboardHelpers0000644000000000000000000000013212654402377030344 xustar0030 mtime=1454507263.260432274 30 atime=1454507327.359577403 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/tools/ClipboardHelpers.java0000644000175000002070000000521712654402377032014 0ustar00jvanekmock00000000000000/* ClipboardHelpers.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.tools; import java.awt.Toolkit; import java.awt.datatransfer.Clipboard; import java.awt.datatransfer.DataFlavor; import java.awt.datatransfer.StringSelection; import java.awt.datatransfer.Transferable; import java.awt.datatransfer.UnsupportedFlavorException; import java.io.IOException; public class ClipboardHelpers { public static void putToClipboard(String str) { Toolkit toolkit = Toolkit.getDefaultToolkit(); Clipboard clipboard = toolkit.getSystemClipboard(); StringSelection strSel = new StringSelection(str); clipboard.setContents(strSel, null); } public static String pasteFromClipboard() throws UnsupportedFlavorException, IOException { Toolkit toolkit = Toolkit.getDefaultToolkit(); Clipboard clipboard = toolkit.getSystemClipboard(); Transferable clipData = clipboard.getContents(clipboard); String s = (String) (clipData.getTransferData( DataFlavor.stringFlavor)); return s; } } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/tools/PaxHeaders.17941/AsyncJavaws.java0000644000000000000000000000013212654402377030273 xustar0030 mtime=1454507263.260432274 30 atime=1454507327.358577416 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/tools/AsyncJavaws.java0000644000175000002070000000651012654402377031020 0ustar00jvanekmock00000000000000/* AsyncJavaws.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.tools; import java.util.List; import net.sourceforge.jnlp.ContentReaderListener; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import org.junit.Assert; /** * You can see ClipboardContext reproducers as examples * */ public class AsyncJavaws implements Runnable { private final boolean headless; private final String url; private ProcessResult result; private ContentReaderListener contentReaderListener; private ContentReaderListener errorReaderListener; private final List argList; private final ServerAccess server; public AsyncJavaws(ServerAccess server, String url, List argList, boolean headless, ContentReaderListener contentReaderListener, ContentReaderListener errorReaderListener) { this.url = url; this.headless = headless; this.contentReaderListener = contentReaderListener; this.errorReaderListener = errorReaderListener; this.argList = argList; this.server = server; Assert.assertNotNull(server); } @Override public void run() { try { if (headless) { result = server.executeJavawsHeadless(argList, url, contentReaderListener, errorReaderListener, null); } else { result = server.executeJavaws(argList, url, contentReaderListener, errorReaderListener); } } catch (Exception ex) { if (result == null) { result = new ProcessResult("", ex.getMessage(), null, true, 1, ex); } throw new RuntimeException(ex); } } public ProcessResult getResult() { return result; } } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/PaxHeaders.17941/mock0000644000000000000000000000013212654402377024713 xustar0030 mtime=1454507263.260432274 30 atime=1454507658.776157397 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/mock/0000755000175000002070000000000012654402377025513 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/mock/PaxHeaders.17941/MockJNLPFile.java0000644000000000000000000000013212654402377030010 xustar0030 mtime=1454507263.260432274 30 atime=1454507327.358577416 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/mock/MockJNLPFile.java0000644000175000002070000000375712654402377030547 0ustar00jvanekmock00000000000000/* MockJNLPFile.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.mock; import java.util.List; import java.util.Locale; import net.sourceforge.jnlp.InformationDesc; import net.sourceforge.jnlp.JNLPFile; public class MockJNLPFile extends JNLPFile { public MockJNLPFile(Locale locale) { defaultLocale = locale; } public void setInfo(List infoList) { info = infoList; } } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/mock/PaxHeaders.17941/DummyJNLPFileWith0000644000000000000000000000013212654402377030126 xustar0030 mtime=1454507263.259432288 30 atime=1454507327.358577416 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/mock/DummyJNLPFileWithJar.java0000644000175000002070000000576712654402377032245 0ustar00jvanekmock00000000000000package net.sourceforge.jnlp.mock; import java.io.File; import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; import java.util.List; import java.util.Locale; import net.sourceforge.jnlp.InformationDesc; import net.sourceforge.jnlp.JARDesc; import net.sourceforge.jnlp.JNLPFile; import net.sourceforge.jnlp.ResourcesDesc; import net.sourceforge.jnlp.SecurityDesc; import net.sourceforge.jnlp.Version; /* A mocked dummy JNLP file with a single JAR. */ public class DummyJNLPFileWithJar extends JNLPFile { /* Create a JARDesc for the given URL location */ static JARDesc makeJarDesc(URL jarLocation, boolean main) { return new JARDesc(jarLocation, new Version("1"), null, false,main, false,false); } private final JARDesc[] jarDescs; private final URL[] jarFiles; public DummyJNLPFileWithJar(File... jarFiles) throws MalformedURLException { this(-1, jarFiles); } public DummyJNLPFileWithJar(URL codebaseRewritter, URL... jarFiles) throws MalformedURLException { this(-1, codebaseRewritter, jarFiles); } public DummyJNLPFileWithJar(int main, File... jarFiles) throws MalformedURLException { this(main, jarFiles[0].getParentFile().toURI().toURL(), filesToUrls(jarFiles)); } private static URL[] filesToUrls(File[] f) throws MalformedURLException{ URL[] r = new URL[f.length]; for (int i = 0; i < f.length; i++) { r[i]=f[i].toURI().toURL(); } return r; } public DummyJNLPFileWithJar(int main, URL codebaseRewritter, URL... jarFiles) throws MalformedURLException { codeBase = codebaseRewritter; this.jarFiles = jarFiles; jarDescs = new JARDesc[jarFiles.length]; for (int i = 0; i < jarFiles.length; i++) { jarDescs[i] = makeJarDesc(jarFiles[i], i==main); } info = new ArrayList<>(); this.security = new SecurityDesc(this, SecurityDesc.SANDBOX_PERMISSIONS, null); } public URL getJarLocation() { return jarFiles[0]; } public URL getJarLocation(int i) { return jarFiles[i]; } public JARDesc[] getJarDescs() { return jarDescs; } public JARDesc getJarDesc() { return jarDescs[0]; } public JARDesc getJarDesc(int i) { return jarDescs[i]; } @Override public ResourcesDesc getResources() { ResourcesDesc localResources = new ResourcesDesc(null, new Locale[0], new String[0], new String[0]); for (JARDesc j : jarDescs) { localResources.addResource(j); } return localResources; } @Override public ResourcesDesc[] getResourcesDescs(final Locale locale, final String os, final String arch) { return new ResourcesDesc[] { getResources() }; } @Override public URL getCodeBase() { return codeBase; } public void setInfo(List info) { this.info = info; } }icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/mock/PaxHeaders.17941/DummyJNLPFile.jav0000644000000000000000000000013212654402377030051 xustar0030 mtime=1454507263.259432288 30 atime=1454507327.358577416 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/mock/DummyJNLPFile.java0000644000175000002070000000502012654402377030732 0ustar00jvanekmock00000000000000/* Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.mock; import java.net.URL; import java.util.Locale; import net.sourceforge.jnlp.JNLPFile; import net.sourceforge.jnlp.ResourcesDesc; import net.sourceforge.jnlp.SecurityDesc; public class DummyJNLPFile extends JNLPFile { public static final URL JAR_URL; public static final URL CODEBASE_URL; static { try { JAR_URL = new URL("http://icedtea.classpath.org/netx/about.jar"); CODEBASE_URL = new URL("http://icedtea.classpath.org/netx/"); } catch (Exception ex) { throw new RuntimeException(ex); } } { this.security = new SecurityDesc(this, SecurityDesc.SANDBOX_PERMISSIONS, null); } @Override public ResourcesDesc getResources() { return new ResourcesDesc(null, new Locale[0], new String[0], new String[0]); } @Override public URL getCodeBase() { return CODEBASE_URL; } } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/PaxHeaders.17941/closinglisteners0000644000000000000000000000013212654402377027351 xustar0030 mtime=1454507263.259432288 30 atime=1454507658.776157397 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/0000755000175000002070000000000012654402377030151 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/PaxHeaders.17941/Strin0000644000000000000000000000013212654402377030450 xustar0030 mtime=1454507263.259432288 30 atime=1454507327.358577416 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/StringRule.java0000644000175000002070000000375112654402377033120 0ustar00jvanekmock00000000000000/* StringRule.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.closinglisteners; public abstract class StringRule implements Rule{ protected String rule; public StringRule(String rule) { setRule(rule); } public StringRule() { } @Override public void setRule(String rule){ this.rule=rule; } @Override public abstract boolean evaluate(T upon); } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/PaxHeaders.17941/Strin0000644000000000000000000000032112654402377030450 xustar00119 path=icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/StringMatchClosingListener.java 30 mtime=1454507263.259432288 30 atime=1454507327.358577416 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/StringMatchClosingList0000644000175000002070000000402312654402377034471 0ustar00jvanekmock00000000000000/* StringMatchClosingListener.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.closinglisteners; import net.sourceforge.jnlp.closinglisteners.StringBasedClosingListener; public class StringMatchClosingListener extends StringBasedClosingListener { public StringMatchClosingListener(String s) { super(s); } @Override public void lineReaded(String s) { if (s.matches(getCondition())) { terminate(); } } } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/PaxHeaders.17941/Strin0000644000000000000000000000032112654402377030450 xustar00119 path=icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/StringBasedClosingListener.java 30 mtime=1454507263.258432301 30 atime=1454507327.358577416 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/StringBasedClosingList0000644000175000002070000000425612654402377034463 0ustar00jvanekmock00000000000000/* StringBasedClosingListener.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.closinglisteners; import net.sourceforge.jnlp.ClosingListener; public class StringBasedClosingListener extends ClosingListener { protected final String condition; public StringBasedClosingListener(String condition) { this.condition = condition; } @Override public void charReaded(char ch) { } @Override public void lineReaded(String s) { if (s.contains(condition)){ terminate(); } } public String getCondition() { return condition; } } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/PaxHeaders.17941/Rules0000644000000000000000000000032312654402377030445 xustar00121 path=icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/RulesFolowingClosingListener.java 30 mtime=1454507263.258432301 30 atime=1454507327.357577429 30 ctime=1454507658.767157517 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/RulesFolowingClosingLi0000644000175000002070000001502112654402377034476 0ustar00jvanekmock00000000000000/* RulesFolowingClosingListener.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.closinglisteners; import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class RulesFolowingClosingListener extends CountingClosingListener { private List> rules = new ArrayList>(); public static class ContainsRule extends StringRule { public ContainsRule(String s) { super(s); } @Override public boolean evaluate(String upon) { return (upon.contains(rule)); } @Override public String toPassingString() { return "should contain `" + rule + "`"; } @Override public String toFailingString() { return "should NOT contain `" + rule + "`"; } } public static class NotContainsRule extends StringRule { public NotContainsRule(String s) { super(s); } @Override public boolean evaluate(String upon) { return !(upon.contains(rule)); } @Override public String toPassingString() { return "should NOT contain `" + rule + "`"; } @Override public String toFailingString() { return "should contain `" + rule + "`"; } } public static class MatchesRule extends StringRule { public MatchesRule(String s) { super(s); } @Override public boolean evaluate(String upon) { return (upon.matches(rule)); } @Override public String toPassingString() { return "should match `" + rule + "`"; } @Override public String toFailingString() { return "should NOT match `" + rule + "`"; } } public static class NotMatchesRule extends StringRule { public NotMatchesRule(String s) { super(s); } @Override public boolean evaluate(String upon) { return !(upon.matches(rule)); } @Override public String toPassingString() { return "should NOT match`" + rule + "`"; } @Override public String toFailingString() { return "should match`" + rule + "`"; } } /** * * @param rule * @return self, to alow chaing add(...).add(..)... */ public RulesFolowingClosingListener addMatchingRule(String rule) { this.rules.add(new MatchesRule(rule)); return this; } /** * * @param rule * @return self, to alow chaing add(...).add(..)... */ public RulesFolowingClosingListener addNotMatchingRule(String rule) { this.rules.add(new NotMatchesRule(rule)); return this; } /** * * @param rule * @return self, to alow chaing add(...).add(..)... */ public RulesFolowingClosingListener addContainsRule(String rule) { this.rules.add(new ContainsRule(rule)); return this; } /** * * @param rule * @return self, to alow chaing add(...).add(..)... */ public RulesFolowingClosingListener addNotContainsRule(String rule) { this.rules.add(new NotContainsRule(rule)); return this; } public RulesFolowingClosingListener() { } public RulesFolowingClosingListener(List> l) { addRules(l); } public RulesFolowingClosingListener(Rule... l) { addRules(l); } public List> getRules() { return rules; } public void setRules(List> rules) { if (rules == null) { throw new NullPointerException("rules cant be null"); } this.rules = rules; } /** * no more rules will be possible to add by doing this * @param rules */ public void setRules(Rule[] rules) { if (rules == null) { throw new NullPointerException("rules cant be null"); } this.rules = Arrays.asList(rules); } final public RulesFolowingClosingListener addRules(List> rules) { if (rules == null) { throw new NullPointerException("rules cant be null"); } this.rules.addAll(rules); return this; } final public RulesFolowingClosingListener addRules(Rule... rules) { if (rules == null) { throw new NullPointerException("rules cant be null"); } this.rules.addAll(Arrays.asList(rules)); return this; } @Override protected boolean isAlowedToFinish(String content) { if (rules == null || rules.size() < 1) { throw new IllegalStateException("No rules specified"); } for (Rule rule : rules) { if (!rule.evaluate(content)) { return false; } } return true; } } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/PaxHeaders.17941/Rule.0000644000000000000000000000013112654402377030335 xustar0030 mtime=1454507263.258432301 30 atime=1454507327.357577429 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/Rule.java0000644000175000002070000000350112654402377031722 0ustar00jvanekmock00000000000000/* Rule.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.closinglisteners; public interface Rule { public void setRule(S rule); public boolean evaluate(T upon); public String toPassingString(); public String toFailingString(); } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/PaxHeaders.17941/Count0000644000000000000000000000031512654402377030444 xustar00116 path=icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/CountingClosingListener.java 30 mtime=1454507263.258432301 30 atime=1454507327.357577429 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/CountingClosingListene0000644000175000002070000000421612654402377034530 0ustar00jvanekmock00000000000000/* CountingClosingListener.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.closinglisteners; import net.sourceforge.jnlp.ClosingListener; public abstract class CountingClosingListener extends ClosingListener { protected StringBuilder sb = new StringBuilder(); @Override public void charReaded(char ch) { sb.append(ch); if (isAlowedToFinish(sb.toString())) { terminate(); } } @Override public void lineReaded(String s) { //nothing to do } protected abstract boolean isAlowedToFinish(String content); } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/PaxHeaders.17941/AutoO0000644000000000000000000000031312654402377030401 xustar00114 path=icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/AutoOkClosingListener.java 30 mtime=1454507263.257432314 30 atime=1454507327.357577429 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/AutoOkClosingListener.0000644000175000002070000000364012654402377034404 0ustar00jvanekmock00000000000000/* CountingClosingListener.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.closinglisteners; public class AutoOkClosingListener extends StringBasedClosingListener { public static final String MAGICAL_OK_CLOSING_STRING = "*** APPLET FINISHED ***"; public AutoOkClosingListener() { super(MAGICAL_OK_CLOSING_STRING); } } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/PaxHeaders.17941/AutoE0000644000000000000000000000031612654402377030372 xustar00117 path=icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/AutoErrorClosingListener.java 30 mtime=1454507263.257432314 30 atime=1454507327.357577429 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/AutoErrorClosingListen0000644000175000002070000000424612654402377034522 0ustar00jvanekmock00000000000000/* AutoErrorClosingListener.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.closinglisteners; public class AutoErrorClosingListener extends StringBasedClosingListener { public static final String MAGICAL_ERROR_CLOSING_STRING = "xception"; public AutoErrorClosingListener() { super(MAGICAL_ERROR_CLOSING_STRING); } @Override public void lineReaded(String s) { if (s.contains("FAILED ASSERTION")) { //dont terminate if it is rhino's org.mozilla.javascript.Kit } else { super.lineReaded(s); } } } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/PaxHeaders.17941/AutoA0000644000000000000000000000031412654402377030364 xustar00115 path=icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/AutoAllClosingListener.java 30 mtime=1454507263.257432314 30 atime=1454507327.357577429 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/AutoAllClosingListener0000644000175000002070000000410312654402377034460 0ustar00jvanekmock00000000000000/* CountingClosingListener.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.closinglisteners; import net.sourceforge.jnlp.ClosingListener; public class AutoAllClosingListener extends ClosingListener { @Override public void charReaded(char ch) { } @Override public void lineReaded(String s) { if (s.contains(AutoErrorClosingListener.MAGICAL_ERROR_CLOSING_STRING) || s.contains(AutoOkClosingListener.MAGICAL_OK_CLOSING_STRING)){ terminate(); } } } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/PaxHeaders.17941/browsertesting0000644000000000000000000000013112654402377027042 xustar0030 mtime=1454507263.254432354 30 atime=1454507658.776157397 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/browsertesting/0000755000175000002070000000000012654402377027643 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/browsertesting/PaxHeaders.17941/browser0000644000000000000000000000013112654402377030525 xustar0030 mtime=1454507263.257432314 30 atime=1454507658.776157397 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/0000755000175000002070000000000012654402377031511 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/PaxHeaders.17940000644000000000000000000000013112654402377030627 xustar0030 mtime=1454507263.257432314 30 atime=1454507658.776157397 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/firefox/0000755000175000002070000000000012654402377033153 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/firefox/PaxHead0000644000000000000000000000033412654402377031161 xustar00131 path=icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/firefox/FirefoxProfilesOperator.java 30 mtime=1454507263.257432314 30 atime=1454507327.357577429 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/firefox/Firefox0000644000175000002070000001362412654402377034506 0ustar00jvanekmock00000000000000/* FirefoxProfilesOperator.java Copyright (C) 2011,2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.browsertesting.browsers.firefox; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.FilenameFilter; import java.io.IOException; import java.nio.channels.FileChannel; import net.sourceforge.jnlp.ServerAccess; /** * This class is able to backup and restore firefox profiles. * */ public class FirefoxProfilesOperator { private File backupDir; private File sourceDir; private boolean backuped = false; private FilenameFilter firefoxProfilesFilter = new FilenameFilter() { @Override public boolean accept(File dir, String name) { return name.endsWith(".default") || name.equals("profiles.ini"); } }; public void backupProfiles() throws IOException { if (backuped) { return; } sourceDir = new File(System.getProperty("user.home") + "/.mozilla/firefox/"); File f = File.createTempFile("backupedFirefox_", "_profiles.default"); f.delete(); f.mkdir(); backupDir = f; String message = "Backuping firefox profiles from " + sourceDir.getAbsolutePath() + " to " + backupDir.getAbsolutePath(); ServerAccess.logOutputReprint(message); copyDirs(sourceDir, backupDir, firefoxProfilesFilter); backuped = true; Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() { @Override public void run() { try { restoreProfiles(); } catch (Exception ex) { ServerAccess.logException(ex); } } })); } public void restoreProfiles() throws IOException { if (!backuped) { return; } try { removeProfiles(); } catch (Exception ex) { ServerAccess.logException(ex); } String message = ("Restoring all firefox profiles in " + sourceDir.getAbsolutePath() + " from in " + backupDir.getAbsolutePath()); ServerAccess.logOutputReprint(message); copyDirs(backupDir, sourceDir, firefoxProfilesFilter); } public void removeProfiles() throws IOException { if (!backuped) { return; } String message = ("Removing all firefox profiles from " + sourceDir.getAbsolutePath() + " backup avaiable in " + backupDir.getAbsolutePath()); ServerAccess.logOutputReprint(message); File[] oldProfiles = sourceDir.listFiles(firefoxProfilesFilter); for (File file : oldProfiles) { deleteRecursively(file); } } private void copyDirs(File sourceDir, File backupDir, FilenameFilter firefoxProfilesFilter) throws IOException { File[] profiles = sourceDir.listFiles(firefoxProfilesFilter); for (File file : profiles) { copyRecursively(file, backupDir); } } public static void copyFile(File from, File to) throws IOException { FileInputStream is = new FileInputStream(from); FileOutputStream fos = new FileOutputStream(to); FileChannel f = is.getChannel(); try (FileChannel f2 = fos.getChannel()) { f.transferTo(0, f.size(), f2); } finally { f.close(); } } public static void deleteRecursively(File f) throws IOException { if (f.isDirectory()) { for (File c : f.listFiles()) { deleteRecursively(c); } } boolean d = true; d = f.delete(); if (!d) { throw new IOException("Failed to delete file: " + f); } } public static void copyRecursively(File srcFileDir, File destDir) throws IOException { if (srcFileDir.isDirectory()) { File nwDest = new File(destDir, srcFileDir.getName()); nwDest.mkdir(); for (File c : srcFileDir.listFiles()) { copyRecursively(c, nwDest); } } else { copyFile(srcFileDir, new File(destDir, srcFileDir.getName())); } } public static void main(String[] args) throws IOException { FirefoxProfilesOperator ff = new FirefoxProfilesOperator(); ff.restoreProfiles(); ff.backupProfiles(); ff.restoreProfiles(); ff.backupProfiles(); } } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/PaxHeaders.17940000644000000000000000000000013112654402377030627 xustar0030 mtime=1454507263.256432328 30 atime=1454507327.356577443 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/Opera.java0000644000175000002070000000447412654402377033433 0ustar00jvanekmock00000000000000/* Opera.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.browsertesting.browsers; import java.util.Arrays; import java.util.List; import net.sourceforge.jnlp.browsertesting.Browsers; public class Opera extends LinuxBrowser { public Opera(String bin) { super(bin); fsdir="opera"; } @Override public Browsers getID() { return Browsers.opera; } @Override public String getUserDefaultPluginExpectedLocation() { return null; } String[] cs={"-nosession", "-nomail", "-nolirc", "-newtab"}; @Override public List getComaptibilitySwitches() { return Arrays.asList(cs); } @Override public List getDefaultSwitches() { return null; } } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/PaxHeaders.17940000644000000000000000000000032612654402377030635 xustar00125 path=icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/MozillaFamilyLinuxBrowser.java 30 mtime=1454507263.256432328 30 atime=1454507327.356577443 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/MozillaFamilyLi0000644000175000002070000000431412654402377034474 0ustar00jvanekmock00000000000000/* MozillaFamilyLinuxBrowser.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.browsertesting.browsers; import java.util.List; public abstract class MozillaFamilyLinuxBrowser extends LinuxBrowser{ public MozillaFamilyLinuxBrowser(String bin) { super(bin); fsdir="mozilla"; } @Override public List getComaptibilitySwitches() { return null; } @Override public List getDefaultSwitches() { return null; } @Override public String getUserDefaultPluginExpectedLocation() { return System.getProperty("user.home")+"/.mozilla/plugins"; } } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/PaxHeaders.17940000644000000000000000000000013112654402377030627 xustar0030 mtime=1454507263.256432328 30 atime=1454507327.356577443 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/Midory.java0000644000175000002070000000364512654402377033627 0ustar00jvanekmock00000000000000/* Midory.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.browsertesting.browsers; import net.sourceforge.jnlp.browsertesting.Browsers; public class Midory extends MozillaFamilyLinuxBrowser { public Midory(String bin) { super(bin); } @Override public Browsers getID() { return Browsers.midori; } } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/PaxHeaders.17940000644000000000000000000000031112654402377030627 xustar00112 path=icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/LinuxBrowser.java 30 mtime=1454507263.255432341 30 atime=1454507327.356577443 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/LinuxBrowser.ja0000644000175000002070000000627212654402377034477 0ustar00jvanekmock00000000000000/* LinuxBrowser.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.browsertesting.browsers; import net.sourceforge.jnlp.browsertesting.Browser; public abstract class LinuxBrowser implements Browser{ public static final String DEFAULT_PLUGIN_NAME="libjavaplugin.so"; public static final String DEFAULT_BIN_PATH="/usr/bin/"; protected final String bin; protected String fsdir="unknown"; public LinuxBrowser(String bin) { this.bin = bin; } @Override public String getBin() { return bin; } // @Override // public void setBin(String bin) { // this.bin=bin; // } @Override public String getDefaultBin() { return DEFAULT_BIN_PATH+getID().toExec(); } @Override public boolean equals(Object obj) { if (!(obj instanceof Browser)) return false; Browser b=(Browser) obj; return b.getBin().equals(getBin()); } @Override public int hashCode() { int hash = 5; hash = 59 * hash + (this.bin != null ? this.bin.hashCode() : 0); return hash; } @Override public String getDefaultPluginExpectedLocation() { if (System.getProperty("os.arch").contains("64")) { return "/usr/lib64/"+fsdir+"/plugins"; } else { return "/usr/lib/"+fsdir+"/plugins"; } } @Override public void beforeProcess(String s) { } @Override public void afterProcess(String s) { } @Override public void beforeKill(String s) { } @Override public void afterKill(String s) { } } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/PaxHeaders.17940000644000000000000000000000013112654402377030627 xustar0030 mtime=1454507263.255432341 30 atime=1454507327.356577443 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/Firefox.java0000644000175000002070000000605312654402377033762 0ustar00jvanekmock00000000000000/* Firefox.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.browsertesting.browsers; import java.util.Arrays; import java.util.List; import net.sourceforge.jnlp.ProcessAssasin; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.browsertesting.browsers.firefox.FirefoxProfilesOperator; public class Firefox extends MozillaFamilyLinuxBrowser { private static final FirefoxProfilesOperator firefoxProfilesOperatorSingleton = new FirefoxProfilesOperator(); public Firefox(String bin) { super(bin); } String[] cs = {"-new-tab"}; @Override public Browsers getID() { return Browsers.firefox; } @Override public List getComaptibilitySwitches() { return Arrays.asList(cs); } @Override public void beforeProcess(String s) { try { firefoxProfilesOperatorSingleton.backupProfiles(); //assuming firefox is not in safemode already } catch (Exception ex) { throw new RuntimeException("Firefox profile backup failed", ex); } } @Override public void afterProcess(String s) { } @Override public void beforeKill(String s) { } @Override public void afterKill(String s) { try { firefoxProfilesOperatorSingleton.restoreProfiles(); } catch (Exception ex) { throw new RuntimeException("Firefox profile restoration failed", ex); } } } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/PaxHeaders.17940000644000000000000000000000013112654402377030627 xustar0030 mtime=1454507263.255432341 30 atime=1454507327.356577443 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/Epiphany.java0000644000175000002070000000413012654402377034127 0ustar00jvanekmock00000000000000/* Epiphany.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.browsertesting.browsers; import java.util.Arrays; import java.util.List; import net.sourceforge.jnlp.browsertesting.Browsers; public class Epiphany extends MozillaFamilyLinuxBrowser { String[] cs = {}; public Epiphany(String bin) { super(bin); } @Override public List getComaptibilitySwitches() { return Arrays.asList(cs); } @Override public Browsers getID() { return Browsers.epiphany; } } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/PaxHeaders.17940000644000000000000000000000013112654402377030627 xustar0030 mtime=1454507263.255432341 30 atime=1454507327.356577443 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/Chromium.java0000644000175000002070000000365012654402377034143 0ustar00jvanekmock00000000000000/* Chromium.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.browsertesting.browsers; import net.sourceforge.jnlp.browsertesting.Browsers; public class Chromium extends MozillaFamilyLinuxBrowser { public Chromium(String bin) { super(bin); } @Override public Browsers getID() { return Browsers.chromiumBrowser; } } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/PaxHeaders.17940000644000000000000000000000013112654402377030627 xustar0030 mtime=1454507263.254432354 30 atime=1454507327.356577443 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/Chrome.java0000644000175000002070000000363712654402377033602 0ustar00jvanekmock00000000000000/* Chrome.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.browsertesting.browsers; import net.sourceforge.jnlp.browsertesting.Browsers; public class Chrome extends MozillaFamilyLinuxBrowser { public Chrome(String bin) { super(bin); } @Override public Browsers getID() { return Browsers.googleChrome; } } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/browsertesting/PaxHeaders.17941/Reactin0000644000000000000000000000013112654402377030427 xustar0030 mtime=1454507263.254432354 30 atime=1454507327.356577443 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/browsertesting/ReactingProcess.java0000644000175000002070000000431712654402377033606 0ustar00jvanekmock00000000000000/* ReactingProcess.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.browsertesting; /** * interface which represents process which can react to events during its lifetime. */ public interface ReactingProcess { /** * called before process is launched */ public void beforeProcess(String s); /** * called after process is finished or killed */ public void afterProcess(String s); /** * called after before process is timeouted and is going to be killed */ public void beforeKill(String s); /** * called after process have been killed */ public void afterKill(String s); } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/browsertesting/PaxHeaders.17941/Browser0000644000000000000000000000013112654402377030465 xustar0030 mtime=1454507263.254432354 30 atime=1454507327.355577456 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/browsertesting/Browsers.java0000644000175000002070000000615712654402377032325 0ustar00jvanekmock00000000000000/* Browsers.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.browsertesting; import java.io.File; import net.sourceforge.jnlp.browsertesting.browsers.LinuxBrowser; /** * When all represent all configured browser, one represens one random * (the first found) configured browser. Each other represents inidivdual browsers * */ public enum Browsers { none, all, one, opera, googleChrome, chromiumBrowser, firefox, midori,epiphany; public static final String CHROMIUM; static { final String def = "chromium"; final String alt = "chromium-browser"; if (new File(LinuxBrowser.DEFAULT_BIN_PATH, alt).exists()) { CHROMIUM = alt; } else { CHROMIUM = def; } } public String toExec() { switch (this) { case opera: return "opera"; case googleChrome: return "google-chrome"; case chromiumBrowser: return CHROMIUM; case firefox: return "firefox"; case midori: return "midori"; case epiphany: return "epiphany"; default: return null; } } @Override public String toString() { if (toExec()!=null) return toExec(); switch (this) { case all: return "all"; case one: return "one"; case none: return "unset_browser"; default: return "unknown"; } } } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/browsertesting/PaxHeaders.17941/Browser0000644000000000000000000000013112654402377030465 xustar0030 mtime=1454507263.253432368 30 atime=1454507327.355577456 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/browsertesting/BrowserTestRunner.java0000644000175000002070000001766712654402377034204 0ustar00jvanekmock00000000000000/* BrowserTestRunner.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.browsertesting; import java.lang.annotation.Annotation; import java.lang.reflect.InvocationTargetException; import net.sourceforge.jnlp.annotations.TestInBrowsers; import java.lang.reflect.Method; import java.util.Arrays; import java.util.List; import java.util.Random; import net.sourceforge.jnlp.ServerAccess; import org.junit.Ignore; import org.junit.internal.AssumptionViolatedException; import org.junit.internal.runners.model.EachTestNotifier; import org.junit.runner.Description; import org.junit.runner.notification.RunNotifier; import org.junit.runners.BlockJUnit4ClassRunner; import org.junit.runners.model.FrameworkMethod; import org.junit.runners.model.InitializationError; import org.junit.runners.model.Statement; public class BrowserTestRunner extends BlockJUnit4ClassRunner { public BrowserTestRunner(java.lang.Class testClass) throws InitializationError { super(testClass); } @Override protected void runChild(FrameworkMethod method, RunNotifier notifier) { Method mm = method.getMethod(); TestInBrowsers tib = mm.getAnnotation(TestInBrowsers.class); injectBrowserCatched(method, Browsers.none); boolean browserIgnoration = false; if (tib != null) { try { List testableBrowsers = BrowserFactory.getFactory().getBrowsers(tib); String mbr = System.getProperty("modified.browsers.run"); if (mbr != null) { if (mbr.equalsIgnoreCase("all")) { if (!isBrowsersNoneSet(tib)) { testableBrowsers = BrowserFactory.getFactory().getBrowsers(new Browsers[]{Browsers.all}); } } else if (mbr.equalsIgnoreCase("one")) { //this complication here is for case like // namely enumerated concrete browsers, so we want to pick up // random one from those already enumerated if (isBrowsersNoneSet(tib)) { testableBrowsers = Arrays.asList(new Browsers[]{testableBrowsers.get(new Random().nextInt(testableBrowsers.size()))}); } } else if (mbr.equalsIgnoreCase("ignore")) { testableBrowsers = BrowserFactory.getFactory().getBrowsers(new Browsers[]{Browsers.none}); browserIgnoration = true; } else { ServerAccess.logErrorReprint("unrecognized value of modified.browsers.run - " + mbr); } } for (Browsers browser : testableBrowsers) { try { injcetBrowser(method, browser); runChildX(method, notifier, browser, browserIgnoration); } catch (Exception ex) { //throw new RuntimeException("unabled to inject browser", ex); ServerAccess.logException(ex, true); } } } finally { injectBrowserCatched(method, Browsers.none); } } else { runChildX(method, notifier, null, false); } } private boolean isBrowsersNoneSet(TestInBrowsers tib) { if (tib.testIn().length == 1 && tib.testIn()[0] == Browsers.none) { return true; } return false; } private void injectBrowserCatched(FrameworkMethod method, Browsers browser) { try { injcetBrowser(method, browser); } catch (Exception ex) { //throw new RuntimeException("unabled to inject browser", ex); ServerAccess.logException(ex, true); } } private void injcetBrowser(FrameworkMethod method, Browsers browser) throws IllegalAccessException, SecurityException, NoSuchMethodException, IllegalArgumentException, InvocationTargetException { Method ff = method.getMethod().getDeclaringClass().getMethod("setBrowser", Browsers.class); ff.invoke(null, browser); } protected void runChildX(final FrameworkMethod method, RunNotifier notifier, Browsers browser, boolean browserIgnoration) { Description description = describeChild(method, browser); if (method.getAnnotation(Ignore.class) != null) { notifier.fireTestIgnored(description); } else { try { runLeaf(methodBlock(method), description, notifier, browserIgnoration); // ServerAccess.logOutputReprint("trying leaf"); // Method m = this.getClass().getMethod("runLeaf", Statement.class, Description.class, RunNotifier.class); // m.setAccessible(true); // m.invoke(this, methodBlock(method), description, notifier); // ServerAccess.logOutputReprint("leaf invoked"); } catch (Exception ex) { //throw new RuntimeException("unabled to lunch test on leaf", ex); ServerAccess.logException(ex, true); } } } /** * Runs a {@link Statement} that represents a leaf (aka atomic) test. */ protected final void runLeaf(Statement statement, Description description, RunNotifier notifier, boolean ignore) { EachTestNotifier eachNotifier = new EachTestNotifier(notifier, description); eachNotifier.fireTestStarted(); if (ignore) { eachNotifier.fireTestIgnored(); return; } try { statement.evaluate(); } catch (AssumptionViolatedException e) { eachNotifier.addFailedAssumption(e); } catch (Throwable e) { eachNotifier.addFailure(e); } finally { eachNotifier.fireTestFinished(); } } protected Description describeChild(FrameworkMethod method, Browsers browser) { if (browser == null) { return super.describeChild(method); } else { try { return Description.createTestDescription(getTestClass().getJavaClass(), testName(method) + " - " + browser.toString(), method.getAnnotations()); } catch (Exception ex) { ServerAccess.logException(ex, true); return super.describeChild(method); } } } } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/browsertesting/PaxHeaders.17941/Browser0000644000000000000000000000013112654402377030465 xustar0030 mtime=1454507263.253432368 30 atime=1454507327.355577456 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/browsertesting/BrowserTest.java0000644000175000002070000000414212654402377032772 0ustar00jvanekmock00000000000000/* BrowserTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.browsertesting; import net.sourceforge.jnlp.ServerAccess; import org.junit.runner.RunWith; @RunWith(value = BrowserTestRunner.class) public abstract class BrowserTest { public static Browsers browser=null; public static final ServerAccess server = new ServerAccess(); public static void setBrowser(Browsers b) { browser = b; server.setCurrentBrowser(browser); } public static Browsers getBrowser() { return browser; } } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/browsertesting/PaxHeaders.17941/Browser0000644000000000000000000000013112654402377030465 xustar0030 mtime=1454507263.253432368 30 atime=1454507327.355577456 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/browsertesting/BrowserFactory.java0000644000175000002070000001776312654402377033477 0ustar00jvanekmock00000000000000/* BrowserFactory.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.browsertesting; import net.sourceforge.jnlp.annotations.TestInBrowsers; import java.io.File; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Random; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.browsertesting.browsers.Chrome; import net.sourceforge.jnlp.browsertesting.browsers.Chromium; import net.sourceforge.jnlp.browsertesting.browsers.Epiphany; import net.sourceforge.jnlp.browsertesting.browsers.Firefox; import net.sourceforge.jnlp.browsertesting.browsers.Midory; import net.sourceforge.jnlp.browsertesting.browsers.Opera; public class BrowserFactory { private static final BrowserFactory factory = new BrowserFactory(System.getProperty(ServerAccess.USED_BROWSERS)); private List configuredBrowsers; Random oneGenerator = new Random(); public static BrowserFactory getFactory() { return factory; } /** * This is public just for testing purposes! */ public BrowserFactory(String browsers) { if (browsers == null) { configuredBrowsers = new ArrayList(0); } else { String[] s = browsers.split(File.pathSeparator); configuredBrowsers = new ArrayList(s.length); for (int i = 0; i < s.length; i++) { String string = s[i]; String[] p = string.split("/"); if (p.length > 1) { string = p[p.length - 1]; } if (string.equals(Browsers.chromiumBrowser.toString())) { configuredBrowsers.add(new Chromium(s[i])); } if (string.equals(Browsers.googleChrome.toString())) { configuredBrowsers.add(new Chrome(s[i])); } if (string.equals(Browsers.opera.toString())) { configuredBrowsers.add(new Opera(s[i])); } if (string.equals(Browsers.firefox.toString())) { configuredBrowsers.add(new Firefox(s[i])); } if (string.equals(Browsers.epiphany.toString())) { configuredBrowsers.add(new Epiphany(s[i])); } if (string.equals(Browsers.midori.toString())) { configuredBrowsers.add(new Midory(s[i])); } } } } public Browser getBrowser(Browsers id) { for (int i = 0; i < configuredBrowsers.size(); i++) { Browser browser = configuredBrowsers.get(i); if (browser.getID() == id) { return browser; } } return null; } public Browser getFirst() { for (int i = 0; i < configuredBrowsers.size(); i++) { Browser browser = configuredBrowsers.get(i); return browser; } return null; } public Browser getRandom() { if (configuredBrowsers.isEmpty()){ return null; } return configuredBrowsers.get(oneGenerator.nextInt(configuredBrowsers.size())); } public List getAllBrowsers() { return Collections.unmodifiableList(configuredBrowsers); } public List getBrowsers(TestInBrowsers tib) { return getBrowsers(tib.testIn()); } public List getBrowsers(Browsers[] testIn) { List q = translateAnnotationSilently(testIn); if (q==null || q.isEmpty()){ List qq = new ArrayList(0); qq.add(Browsers.none); return qq; } List qq = new ArrayList(q.size()); for (Browser browser : q) { qq.add(browser.getID()); } return qq; } /** * * @param testIn Bbrowsers which should be transformed to list of Browser * @return all matching browser, if browser do not exists, this is ignored and run is silently continued */ public List translateAnnotationSilently(Browsers[] testIn) { if (testIn==null) { return null; } List r = new ArrayList(configuredBrowsers.size()); for (Browsers b : testIn) { if (b == Browsers.all) { if (getAllBrowsers().isEmpty()) { ServerAccess.logErrorReprint("You try to add all browsers, but there is none"); } else { r.addAll(getAllBrowsers()); } } else if (b == Browsers.one) { Browser bb = getRandom(); if (bb == null) { ServerAccess.logErrorReprint("You try to add random browser, but there is none"); } else { r.add(bb); } } else { Browser bb = getBrowser(b); if (bb == null) { ServerAccess.logErrorReprint("You try to add " + b.toString() + " browser, but it do not exists"); } else { r.add(bb); } } } return r; } /** * * @param tib * @return all matching browser, if browser do not exists, exception is thrown */ public List translateAnnotationLaudly(TestInBrowsers tib) { return translateAnnotationLaudly(tib.testIn()); } public List translateAnnotationLaudly(Browsers[] testIn) { List r = new ArrayList(configuredBrowsers.size()); for (Browsers b :testIn) { if (b == Browsers.all) { if (getAllBrowsers().isEmpty()) { throw new IllegalStateException("You try to add all browsers, but there is none"); } r.addAll(getAllBrowsers()); } else if (b == Browsers.one) { Browser bb = getRandom(); if (bb == null) { throw new IllegalStateException("You try to add random browser, but there is none"); } r.add(bb); } else { Browser bb = getBrowser(b); if (bb == null) { throw new IllegalStateException("You try to add " + b.toString() + " browser, but it do not exists"); } r.add(bb); } } return r; } } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/browsertesting/PaxHeaders.17941/Browser0000644000000000000000000000013112654402377030465 xustar0030 mtime=1454507263.253432368 30 atime=1454507327.355577456 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/browsertesting/Browser.java0000644000175000002070000000415612654402377032137 0ustar00jvanekmock00000000000000/* Browser.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.browsertesting; import java.util.List; /** * interface which represents individual browsers */ public interface Browser extends ReactingProcess{ public String getDefaultBin(); public String getDefaultPluginExpectedLocation(); public String getBin(); //public void setBin(String bin); public String getUserDefaultPluginExpectedLocation(); public Browsers getID(); public List getComaptibilitySwitches(); public List getDefaultSwitches(); } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/PaxHeaders.17941/awt0000644000000000000000000000013112654402377024554 xustar0030 mtime=1454507263.251432394 30 atime=1454507658.776157397 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/awt/0000755000175000002070000000000012654402377025355 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/awt/PaxHeaders.17941/imagesearch0000644000000000000000000000013112654402377027024 xustar0030 mtime=1454507263.252432381 30 atime=1454507658.776157397 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/awt/imagesearch/0000755000175000002070000000000012654402377027625 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/awt/imagesearch/PaxHeaders.17941/marker0000644000000000000000000000013112654402377030305 xustar0030 mtime=1454507263.252432381 30 atime=1454507327.355577456 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/awt/imagesearch/marker.png0000644000175000002070000000026412654402377031616 0ustar00jvanekmock00000000000000PNG  IHDR DPLTE$$$mmmjΰjTIDAT81 B].ZsŃ#b~g 54= 6lQ3FeBq BCks5ܔi +RIENDB`icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/awt/imagesearch/PaxHeaders.17941/ImageS0000644000000000000000000000013112654402377030171 xustar0030 mtime=1454507263.252432381 30 atime=1454507327.355577456 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/awt/imagesearch/ImageSeeker.java0000644000175000002070000003364212654402377032661 0ustar00jvanekmock00000000000000/* ImageSeeker.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.awt.imagesearch; import java.awt.Color; import java.awt.Rectangle; import java.awt.image.BufferedImage; public class ImageSeeker { public static Rectangle findExactImage(BufferedImage marker, BufferedImage screen){ return findExactImage(marker, screen, new Rectangle(0,0,screen.getWidth(), screen.getHeight())); } public static Rectangle findExactImage(BufferedImage marker /*usually small*/, BufferedImage screen, Rectangle actionArea) { Rectangle result = new Rectangle(0, 0, 0, 0); boolean found = false; boolean ok = true; //to filter out values with alpha boolean[][] mask = getMask(marker); //accessing those too often, copying int[][] markerPixels = getPixels(marker); int mw = marker.getWidth(); int mh = marker.getHeight(); for (int y = actionArea.y; (y < (actionArea.y + actionArea.height - marker.getHeight())) && !found; y++) { for (int x = actionArea.x; (x < (actionArea.x + actionArea.width - marker.getWidth())) && !found; x++) { for (int my = 0; (my < mh) && ok; my++) { for (int mx = 0; (mx < mw) && ok; mx++) { //ignore masked (having alpha) values if (!mask[mx][my]) { continue; } if (markerPixels[mx][my] != screen.getRGB(x + mx, y + my)) { ok = false; } } } if( ok ){ found = true; result.x = x; result.y = y; result.height = marker.getHeight(); result.width = marker.getWidth(); }else{ ok = true; } } } if(found){ return result; }else{ return null; } } public static Rectangle findBlurredImage(BufferedImage marker, BufferedImage testImage, double minCorrelation){ return findBlurredImage(marker, testImage, minCorrelation, new Rectangle(0,0,testImage.getWidth(), testImage.getHeight())); } public static Rectangle findBlurredImage(BufferedImage marker, BufferedImage testImage, double minCorrelation, Rectangle actionArea) { int maxX = actionArea.width - marker.getWidth() - 1; int maxY = actionArea.height - marker.getHeight() - 1; int markerMaxX = marker.getWidth(); int markerMaxY = marker.getHeight(); // it is much faster to work directly with color components stored as float values float[][][] testImageArray = createArrayForOneColorComponent(actionArea); float[][][] markerImageArray = createArrayForOneColorComponent(marker); convertImageToFloatArray(testImage, testImageArray, actionArea); convertImageToFloatArray(marker, markerImageArray); int bestX = -1; int bestY = -1; double bestCorrelation = -1; for (int yoffset = 0; yoffset < maxY; yoffset++ ) { for (int xoffset = 0; xoffset < maxX; xoffset++) { double correlation = computeCorrelation(markerMaxX, markerMaxY, testImageArray, markerImageArray, yoffset, xoffset); if (correlation > bestCorrelation) { bestCorrelation = correlation; bestX = xoffset + actionArea.x; bestY = yoffset + actionArea.y; } } } if(bestCorrelation > minCorrelation){ return new Rectangle(bestX, bestY, marker.getWidth(), marker.getHeight()); }else{ return null; } } /** * Create three-dimensional array with the same size as tested image * dimensions (last dimension is used for storing RGB components). * * @param testImage tested image * @return newly created three-dimensional array */ private static float[][][] createArrayForOneColorComponent(BufferedImage testImage) { return new float[testImage.getHeight()][testImage.getWidth()][3]; } /** * Create three-dimensional array with the same size as the given area * dimensions (last dimension is used for storing RGB components). * * @param actionArea * @return newly created three-dimensional array */ private static float[][][] createArrayForOneColorComponent(Rectangle actionArea) { return new float[actionArea.height][actionArea.width][3]; } /** * Conversion from BufferedImage into three dimensional float arrays. * It's much faster to work with float arrays even if it's memory ineficient. * * @param testImage tested image * @param array array to fill */ private static void convertImageToFloatArray(BufferedImage testImage, float[][][] array) { for (int y = 0; y < testImage.getHeight(); y++) { for (int x = 0; x < testImage.getWidth(); x++) { int c = testImage.getRGB(x, y); // filter out alpha channel c = c & 0xffffff; array[y][x][0] = ((c >> 16) & 0xff) - 128f; array[y][x][1] = ((c >> 8) & 0xff) - 128f; array[y][x][2] = (c & 0xff) - 128f; } } } /** * Conversion from BufferedImage into three dimensional float arrays. * It's much faster to work with float arrays even if it's memory ineficient. * This method converts only a given part of the image (actionArea) * * @param testImage tested image * @param array array to fill * @param actionArea rectangle part of the image to convert */ private static void convertImageToFloatArray(BufferedImage testImage, float[][][] array, Rectangle actionArea) { for (int y = actionArea.y; y < (actionArea.height + actionArea.y); y++) { for (int x = actionArea.x; x < (actionArea.width + actionArea.x); x++) { int c = testImage.getRGB(x, y); // filter out alpha channel c = c & 0xffffff; array[y - actionArea.y][x - actionArea.x][0] = ((c >> 16) & 0xff) - 128f; array[y - actionArea.y][x - actionArea.x][1] = ((c >> 8) & 0xff) - 128f; array[y - actionArea.y][x - actionArea.x][2] = (c & 0xff) - 128f; } } } /** * Compute correlation for given two images and 2D offset. * * @param maxX * @param maxY * @param testImageArray * @param markerImageArray * @param yoffset * @param xoffset * @return */ private static double computeCorrelation(int maxX, int maxY, float[][][] testImageArray, float[][][] markerImageArray, int yoffset, int xoffset) { double correlation = 0; for (int y = 0; y < maxY; y++) { for (int x = 0; x < maxX; x++) { for (int rgbIndex = 0; rgbIndex < 3; rgbIndex++) { float colorComponent1 = markerImageArray[y][x][rgbIndex]; float colorComponent2 = testImageArray[yoffset + y][xoffset + x][rgbIndex]; correlation += colorComponent1 * colorComponent2; } } } return correlation; } public static int findHorizontalRule(BufferedImage screen, Color ruleColor, Color bgColor, boolean fromTop) { final int height = screen.getHeight(); int gap = 0; if (!fromTop) { return findHorizontalEdgeGap(screen, ruleColor, bgColor, 1, height - 1, gap); } else { return findHorizontalEdgeGap(screen, bgColor, ruleColor, 1, height - 1, gap); } } public static int findHorizontalEdgeGap(BufferedImage screen, Color area1Color, Color area2Color, int y1, int y2, int gap) { final int width = screen.getWidth(); final int area1RGB = area1Color.getRGB(); final int area2RGB = area2Color.getRGB(); int edgePosition = Integer.MIN_VALUE; int lastFound = Integer.MIN_VALUE; for (int y = y1+1; y < y2 - gap; y++) { int found = 0; for (int x = 0; x < width; x++) { int c1 = screen.getRGB(x, y - 1); int c2 = screen.getRGB(x, y + gap); if (c1 == area1RGB && c2 == area2RGB) { found++; } } if (found > lastFound) { lastFound = found; edgePosition = y; } } return edgePosition; } public static int findVerticalEdgeGap(BufferedImage screen, Color area1Color, Color area2Color, int y1, int y2, int gap) { final int width = screen.getWidth(); final int area1RGB = area1Color.getRGB(); final int area2RGB = area2Color.getRGB(); int edgePosition = Integer.MIN_VALUE; int lastFound = Integer.MIN_VALUE; for (int x = 1; x < width - 1 - gap; x++) { int found = 0; for (int y = y1; y < y2; y++) { int c1 = screen.getRGB(x - 1, y); int c2 = screen.getRGB(x + gap, y); if (c1 == area1RGB && c2 == area2RGB) { found++; } } if (found > lastFound) { lastFound = found; edgePosition = x; } } return edgePosition; } /** * method findColoredAreaGap finds a rectangle of given color surrounded by * area of the second color with a possible gap at the border * * @param screen * @param searchForColor * @param surroundWithColor * @param y1 * @param y2 * @param gap * @return */ public static Rectangle findColoredAreaGap(BufferedImage screen, Color searchForColor, Color surroundWithColor, int y1, int y2, int gap) { int ymin = findHorizontalEdgeGap(screen, surroundWithColor, searchForColor, y1, y2, gap); int ymax = findHorizontalEdgeGap(screen, searchForColor, surroundWithColor, y1, y2, gap); int xmin = findVerticalEdgeGap(screen, surroundWithColor, searchForColor, ymin, ymax, gap); int xmax = findVerticalEdgeGap(screen, searchForColor, surroundWithColor, ymin, ymax, gap); return new Rectangle(xmin, ymin, xmax - xmin, ymax - ymin); } public static boolean isRectangleValid(Rectangle r){ if (r == null) return false; return (r.width != 0)&&(r.height != 0)&&(r.x != Integer.MIN_VALUE)&&(r.y != Integer.MIN_VALUE); } public static BufferedImage getMaskImage(BufferedImage icon) { int w = icon.getWidth(); int h = icon.getHeight(); boolean[][] b = getMask(icon); BufferedImage mask = new BufferedImage(w, h, BufferedImage.TYPE_BYTE_BINARY); for (int y = 0; y < h; y++) { for (int x = 0; x < w; x++) { if (b[x][y]) { mask.setRGB(x, y, Color.white.getRGB()); } else { mask.setRGB(x, y, Color.black.getRGB()); } } } return mask; } public static boolean[][] getMask(BufferedImage icon) { int w = icon.getWidth(); int h = icon.getHeight(); boolean[][] r = new boolean[w][h]; for (int y = 0; y < h; y++) { for (int x = 0; x < w; x++) { int i = icon.getRGB(x, y); int alpha = (i >> 24) & 0xff; if (alpha == 255) { r[x][y] = true; } else { r[x][y] = false; } } } return r; } public static int[][] getPixels(BufferedImage icon) { int w = icon.getWidth(); int h = icon.getHeight(); int[][] r = new int[w][h]; for (int x = 0; x < w; x++) { for (int y = 0; y < h; y++) { int i = icon.getRGB(x, y); //remove mask? not yet... r[x][y] = i; } } return r; } } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/awt/imagesearch/PaxHeaders.17941/Compon0000644000000000000000000000031712654402377030265 xustar00118 path=icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/awt/imagesearch/ComponentNotFoundException.java 30 mtime=1454507263.252432381 30 atime=1454507327.355577456 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/awt/imagesearch/ComponentNotFoundExcept0000644000175000002070000000472712654402377034352 0ustar00jvanekmock00000000000000/* ComponentNotFoundException.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.awt.imagesearch; /** * Class ComponentNotFoundException is thrown in the AWTFramework * in such cases when a position of a component is needed for further * action and the component is not found in the screenshot (for example * a method should click on a button of given colour and the button * is not found, then the method cannot perform its action and * throws ComponentNotFoundException). * */ public class ComponentNotFoundException extends Exception { public ComponentNotFoundException() { super(); } public ComponentNotFoundException(String s) { super(s); } public ComponentNotFoundException(String s, Throwable throwable) { super(s, throwable); } public ComponentNotFoundException(Throwable throwable) { super(throwable); } } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/awt/imagesearch/PaxHeaders.17941/Compon0000644000000000000000000000013112654402377030257 xustar0030 mtime=1454507263.251432394 30 atime=1454507327.354577469 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/awt/imagesearch/ComponentFinder.java0000644000175000002070000001222012654402377033557 0ustar00jvanekmock00000000000000/* ComponentFinder.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.awt.imagesearch; import java.awt.Color; import java.awt.Point; import java.awt.Rectangle; import java.awt.image.BufferedImage; import java.io.IOException; import javax.imageio.ImageIO; public class ComponentFinder { public static final BufferedImage defaultIcon; static{ try { defaultIcon = ImageIO.read(ClassLoader.getSystemClassLoader().getResource("net/sourceforge/jnlp/awt/imagesearch/marker.png")); } catch (IOException e) { throw new RuntimeException("ComponentFinder - problem initializing defaultIcon",e); } } /** * method findColoredRectangle determines coordinates of a rectangle colored * by rectangleColor surrounded by a neighbourhood of surroundingColor * * @param rectangleColor * @param surroundingColor * @param screenshot * @return */ public static Rectangle findColoredRectangle(Color rectangleColor, Color surroundingColor, BufferedImage screenshot) { Rectangle r = ImageSeeker.findColoredAreaGap(screenshot, rectangleColor, surroundingColor, 0, screenshot.getHeight(), 0); if( ImageSeeker.isRectangleValid(r)){ return r; }else{ return null; } } /** * method findColoredRectangle determines coordinates of a rectangle colored * by rectangleColor surrounded by a neighbourhood of surroundingColor with * possible gap of several pixels * * @param rectangleColor * @param surroundingColor * @param screenshot * @param gap * @return */ public static Rectangle findColoredRectangle(Color rectangleColor, Color surroundingColor, BufferedImage screenshot, int gap) { Rectangle r = ImageSeeker.findColoredAreaGap(screenshot, rectangleColor, surroundingColor, 0, screenshot.getHeight(), gap); if( ImageSeeker.isRectangleValid(r)){ return r; }else{ return null; } } /** * Method findWindowByIcon finds the application area assuming there is a * given icon in given position on the application window * the dimension of the window has to be given. * * @param icon * @param iconPosition * @param appletWidth * @param appletHeight * @param screenshot * @return Rectangle rectangle where the applet resides */ public static Rectangle findWindowByIcon(BufferedImage icon, Point iconPosition, int windowWidth, int windowHeight, BufferedImage screenshot) { Rectangle r = ImageSeeker.findExactImage(icon, screenshot); if( ImageSeeker.isRectangleValid(r)){ return windowPositionFromIconPosition(r.getLocation(), iconPosition, windowWidth, windowHeight); }else{ return null; } } public static Rectangle findWindowByIconBlurred(BufferedImage icon, Point iconPosition, int windowWidth, int windowHeight, BufferedImage screenshot, double minCorrelation) { Rectangle r = ImageSeeker.findBlurredImage(icon, screenshot, minCorrelation); if( ImageSeeker.isRectangleValid(r)){ return windowPositionFromIconPosition(r.getLocation(), iconPosition, windowWidth, windowHeight); }else{ return null; } } public static Rectangle windowPositionFromIconPosition(Point iconAbsolute, Point iconRelative, int windowWidth, int windowHeight){ return new Rectangle( iconAbsolute.x - iconRelative.x, iconAbsolute.y - iconRelative.y, windowWidth, windowHeight); } } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/awt/PaxHeaders.17941/awtactions0000644000000000000000000000013112654402377026730 xustar0030 mtime=1454507263.251432394 30 atime=1454507658.776157397 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/awt/awtactions/0000755000175000002070000000000012654402377027531 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/awt/awtactions/PaxHeaders.17941/MouseAc0000644000000000000000000000013112654402377030264 xustar0030 mtime=1454507263.251432394 30 atime=1454507327.354577469 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/awt/awtactions/MouseActions.java0000644000175000002070000001624412654402377033014 0ustar00jvanekmock00000000000000/* MouseActions.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.awt.awtactions; import java.awt.Rectangle; import java.awt.Robot; import java.awt.event.InputEvent; /** * class MouseActions * * static methods for manipulating the mouse via AWT robot */ public class MouseActions { private static final int defaultDelay = 250; /** * method click presses and releases given mouse keys * with reasonable delay before the event * * @param mouseKeyMask * @param robot * @param delayMs */ public static void click(int mouseKeyMask, Robot robot, int delayMs){ robot.delay(delayMs); robot.mousePress(mouseKeyMask); robot.delay(delayMs); robot.mouseRelease(mouseKeyMask); } public static void click(int mouseKeyMask, Robot robot){ robot.delay(defaultDelay); robot.mousePress(mouseKeyMask); robot.delay(defaultDelay); robot.mouseRelease(mouseKeyMask); } /** * method doubleClick presses and releases given mouse keys * two times with reasonable delays * * @param mouseKeyMask * @param robot * @param delayMs */ public static void doubleClick(int mouseKeyMask, Robot robot, int delayMs){ click(mouseKeyMask, robot, delayMs); click(mouseKeyMask, robot, delayMs); } public static void doubleClick(int mouseKeyMask, Robot robot){ click(mouseKeyMask, robot, defaultDelay); click(mouseKeyMask, robot, defaultDelay); } /** * method drag presses the right mouse key, * drags the mouse to a point, and releases the mouse key * with reasonable delays * * @param xTo * @param yTo * @param robot * @param delayMs */ public static void drag(int xTo, int yTo, Robot robot, int delayMs){ robot.delay(delayMs); robot.mousePress(InputEvent.BUTTON1_MASK); robot.delay(delayMs); robot.mouseMove(xTo, yTo); } public static void drag(int xTo, int yTo, Robot robot){ robot.delay(defaultDelay); robot.mousePress(InputEvent.BUTTON1_MASK); robot.delay(defaultDelay); robot.mouseMove(xTo, yTo); } /** * method dragFromRectangle clicks in the middle * of the given rectangle and drags the mouse from the rectangle * with reasonable delays * * @param rectangle * @param robot * @param delayMs */ public static void dragFromRectangle(Rectangle rectangle, Robot robot, int delayMs){ int x1 = rectangle.x + rectangle.width/2; int y1 = rectangle.y + rectangle.height/2; int x2 = x1 + 2*rectangle.width; int y2 = y1 + 2*rectangle.height; robot.delay(delayMs); robot.mouseMove(x1, y1); drag(x2,y2, robot); } public static void dragFromRectangle(Rectangle rectangle, Robot robot){ dragFromRectangle(rectangle, robot, defaultDelay); } /** * method moveInsideRectangle places the mouse in the middle * of the given rectangle and moves the mouse inside the rectangle * with reasonable delays * * @param rectangle * @param robot * @param delayMs */ public static void moveInsideRectangle(Rectangle rectangle, Robot robot, int delayMs){ int x1 = rectangle.x + rectangle.width/2; int y1 = rectangle.y + rectangle.height/2; int x2 = x1 + rectangle.width/4; int y2 = y1 + rectangle.height/4; robot.delay(delayMs); robot.mouseMove(x1, y1); robot.delay(delayMs); robot.mouseMove(x2, y2); } public static void moveInsideRectangle(Rectangle rectangle, Robot robot){ moveInsideRectangle(rectangle, robot, defaultDelay); } /** * * @param rectangle * @param robot * @param delayMs */ public static void moveMouseToMiddle(Rectangle rectangle, Robot robot, int delayMs){ robot.delay(delayMs); int x = rectangle.x + (rectangle.width/2); int y = rectangle.y + (rectangle.height/2); robot.mouseMove(x,y); } public static void moveMouseToMiddle(Rectangle rectangle, Robot robot){ moveMouseToMiddle(rectangle, robot, defaultDelay); } /** * * @param rectangle * @param robot * @param delayMs */ public static void moveMouseOutside(Rectangle rectangle, Robot robot, int delayMs){ robot.delay(delayMs); int x = rectangle.x + 2*rectangle.width; int y = rectangle.y + 2*rectangle.height; robot.mouseMove(x,y); } public static void moveMouseOutside(Rectangle rectangle, Robot robot){ moveMouseOutside(rectangle, robot, defaultDelay); } /** * method clickInside moves the mouse in the middle point * of a given rectangle and clicks with reasonable delay * * @param rectangle * @param robot * @param delayMs */ public static void clickInside(int mouseKey, Rectangle rectangle, Robot robot, int delayMs){ moveMouseToMiddle(rectangle, robot, delayMs); robot.delay(delayMs); click(mouseKey, robot, delayMs); } public static void clickInside(int mouseKey, Rectangle rectangle, Robot robot){ clickInside(mouseKey, rectangle, robot, defaultDelay); } public static void clickInside(Rectangle rectangle, Robot robot, int delayMs){ clickInside(InputEvent.BUTTON1_MASK, rectangle, robot, delayMs); } public static void clickInside(Rectangle rectangle, Robot robot){ clickInside(rectangle, robot, defaultDelay); } } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/awt/awtactions/PaxHeaders.17941/Keyboar0000644000000000000000000000013112654402377030324 xustar0030 mtime=1454507263.251432394 30 atime=1454507327.354577469 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/awt/awtactions/KeyboardActions.java0000644000175000002070000000666512654402377033472 0ustar00jvanekmock00000000000000/* KeyboardActions.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.awt.awtactions; import java.awt.Robot; import java.awt.event.KeyEvent; public class KeyboardActions { private static final int defaultDelay = 250; /** * method writeText for simulating typing the * given String text by a user with delays * allowed characters in the text: 0-9, a-z, the space * between the keystrokes * * @param robot * @param text * @param delayMs */ public static void writeText(Robot robot, String text, int delayMs){ for (int i = 0; i < text.length(); i++){ char c = text.charAt(i); typeKey(robot, keyFromChar(c), delayMs); } } public static void writeText(Robot robot, String text){ writeText(robot,text, defaultDelay); } /** * method typeKey for pressing and releasing given key * with a reasonable delay * * @param robot * @param key * @param delayMs */ public static void typeKey(Robot robot, int key, int delayMs){ robot.delay(delayMs); robot.keyPress(key); robot.delay(delayMs); robot.keyRelease(key); } public static void typeKey(Robot robot, int key){ typeKey(robot, key, defaultDelay); } /** * method returning the KeyInput event int * if the character is not from a-b, 0-9, the returned value is * KeyEvent.VK_SPACE * * @param ch * @return */ public static int keyFromChar(char ch){ int key; if( ('0' <= ch) && ('9' >= ch) ){ key = (ch - '0') + KeyEvent.VK_0; }else if( ( 'a' <= ch) && ('z' >= ch) ){ key = (ch - 'a') + KeyEvent.VK_A; }else{ key = KeyEvent.VK_SPACE; } return key; } } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/awt/PaxHeaders.17941/AWTHelper.java0000644000000000000000000000013112654402377027267 xustar0030 mtime=1454507263.251432394 30 atime=1454507327.354577469 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/awt/AWTHelper.java0000644000175000002070000005052212654402377030017 0ustar00jvanekmock00000000000000/* AWTHelper.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.awt; import java.awt.AWTException; import java.awt.Color; import java.awt.Point; import java.awt.Rectangle; import java.awt.Robot; import java.awt.Toolkit; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import javax.imageio.ImageIO; import net.sourceforge.jnlp.awt.awtactions.KeyboardActions; import net.sourceforge.jnlp.awt.awtactions.MouseActions; import net.sourceforge.jnlp.awt.imagesearch.ComponentFinder; import net.sourceforge.jnlp.awt.imagesearch.ComponentNotFoundException; import net.sourceforge.jnlp.awt.imagesearch.ImageSeeker; import net.sourceforge.jnlp.closinglisteners.Rule; import net.sourceforge.jnlp.closinglisteners.RulesFolowingClosingListener; public abstract class AWTHelper extends RulesFolowingClosingListener implements Runnable{ //attributes possibly set by user private String initStr = null; private Color appletColor; private BufferedImage marker; private Point markerPosition; private int appletHeight; private int appletWidth; private int tryKTimes = DEFAULT_K; //other protected StringBuilder sb = new StringBuilder(); private boolean actionStarted = false; private Rectangle actionArea; private BufferedImage screenshot; private Robot robot; private boolean appletFound = false; private boolean appletColorGiven = false; //impossible to search for color difference if not given private boolean markerGiven = false; //impossible to find the applet if marker not given private boolean appletDimensionGiven = false; private boolean screenshotTaken = false; private int defaultWaitForApplet = 1000; //default number of times the screen is captured and the applet is searched for //in the screenshot public static final int DEFAULT_K = 3; //several constructors /** * the minimal constructor - use: * - if we do not want to find the bounds of applet area first * - searching for buttons and other components is then done in the whole * screen, confusion with other icons on display is then possible * - less effective, deprecated (better bound the area first) */ @Deprecated public AWTHelper() { try { this.robot = new Robot(); } catch (AWTException e) { throw new RuntimeException("AWTHelper could not create its Robot instance.",e); } } /** * the minimal constructor with initStr - use: * - we want to know from stdout that the applet (or sth else) is ready * - if we do not want to find the bounds of applet area first * - searching for buttons and other components is then done in the whole * screen, confusion with other icons on display is then possible * - less effective, deprecated (better bound the area first) */ @Deprecated public AWTHelper(String initStr){ this(); this.initStr = initStr; } /** * the constructor with icon and its position in applet of given dimension * use: * - we want to find and activate the applet first * - the search for applet will be done via searching for icon * of given position(x,y,w,h) inside applet of given width and height * * @param icon marker by which the applet will be found * @param iconPosition relatively to applet (including icon width and height) * @param appletWidth * @param appletHeight */ public AWTHelper(BufferedImage icon, Point iconPosition, int appletWidth, int appletHeight){ this(); this.marker = icon; this.markerPosition = iconPosition; this.markerGiven = true; this.appletWidth = appletWidth; this.appletHeight = appletHeight; this.appletDimensionGiven = true; } public AWTHelper(String initString, BufferedImage icon, Point iconPosition, int appletWidth, int appletHeight) throws AWTException{ this(icon, iconPosition, appletWidth, appletHeight); this.initStr = initString; } /** * the constructor with applet width and height only - use: * - we want to find the applet by finding the default icon * that is located in the upper left corner of applet * * @param appletWidth * @param appletHeight */ public AWTHelper(int appletWidth, int appletHeight){ this(); String test_server_dir_path = System.getProperty("test.server.dir"); this.marker = ComponentFinder.defaultIcon; this.markerPosition = new Point(0,0); this.markerGiven = true; this.appletWidth = appletWidth; this.appletHeight = appletHeight; this.appletDimensionGiven = true; } public AWTHelper(String initString, int appletWidth, int appletHeight){ this(appletWidth, appletHeight); this.initStr = initString; } /** * refers to AWTHelper functioning as RulesFolowingClosingListener * * @param strs array of strings to be added as contains rules */ public void addClosingRulesFromStringArray(String [] strs){ for(String s : strs){ this.addContainsRule(s); } } /** * override of method charReaded (from RulesFolowingClosingListener) * * waiting for the applet, when applet is ready run action thread * (if initStr==null, do not check and do not call run) * * when all the wanted strings are in the stdout, applet can be closed * * @param ch */ @Override public void charReaded(char ch) { sb.append(ch); //is applet ready to start clicking? //check and run applet only if initStr is not null if ((initStr != null) && !actionStarted && appletIsReady(sb.toString())) { try{ actionStarted = true; this.findAndActivateApplet(); this.run(); } catch (ComponentNotFoundException e1) { throw new RuntimeException("AWTHelper problems finding applet.",e1); } catch (AWTFrameworkException e2){ throw new RuntimeException("AWTHelper problems with unset attributes.",e2); } } //is all the wanted output in stdout? super.charReaded(ch); } /** * method runAWTHelper - we can call run and declared the action as started * without finding out if initStr is in the output, if this method is * called * */ public void runAWTHelper(){ actionStarted = true; this.run(); } /** * implementation of AWTHelper should implement the run method */ public abstract void run(); /** * method getInitStrAsRule returns the initStr in the form * of Contains rule that can be evaluated on a string * * @return */ public Rule getInitStrAsRule(){ if( initStr != null ){ return new ContainsRule(this.initStr); }else{ return new Rule(){ @Override public void setRule(String rule) { } @Override public boolean evaluate(String upon) { return true; } @Override public String toPassingString() { return "nothing to check, initStr is null"; } @Override public String toFailingString() { return "nothing to check, initStr is null"; } } ; } } //boolean controls getters protected boolean appletIsReady(String content) { return this.getInitStrAsRule().evaluate(content); } public boolean isActionStarted() { return actionStarted; } public boolean isAppletColorGiven(){ return appletColorGiven; } public boolean isAppletDimensionGiven(){ return appletDimensionGiven; } public boolean isMarkerGiven(){ return markerGiven; } //setters /** * method setDefaultWaitForApplet sets the time (in ms) for which the method * captureScreenAndFindApplet will wait (for the applet to load) before it * gets the screenshot the default time is 1000ms * * @param defaultWaitForApplet */ public void setDefaultWaitForApplet(int defaultWaitForApplet) { this.defaultWaitForApplet = defaultWaitForApplet; } public void setTryKTimes(int tryKTimes) { this.tryKTimes = tryKTimes; } public void setAppletColor(Color appletColor) { this.appletColor = appletColor; this.appletColorGiven = true; } public void setInitStr(String initStr) { this.initStr = initStr; } public void setMarker(BufferedImage marker, Point markerPosition) { this.marker = marker; this.markerPosition = markerPosition; this.markerGiven = true; } public void setAppletDimension(int width, int height){ this.appletWidth = width; this.appletHeight = height; this.appletDimensionGiven = true; } //creating screenshots, searching for applet /** * method captureScreenAndFindAppletByIcon * 1. checks that all needed attributes of AWTHelper are given * (marker, its position and applet width and height) * 2. captures screen, * 3. finds the rectangle where applet is and saves it to the attribute * actionArea * 4. sets screenCapture indicator to true (after tryKTimes unsuccessfull * tries an exception "ComponentNotFound" will be raised) * * @throws AWTException * @throws ComponentNotFoundException * @throws AWTFrameworkException */ public void captureScreenAndFindAppletByIcon() throws ComponentNotFoundException, AWTFrameworkException { if(!appletDimensionGiven || !markerGiven){ throw new AWTFrameworkException("AWTFramework cannot find applet without dimension or marker!"); } captureScreenAndFindAppletByIconTryKTimes(marker, markerPosition, appletWidth, appletHeight, tryKTimes); } /** ** method captureScreenAndFindAppletByIcon * 1. captures screen, * 2. finds the rectangle where applet is and saves it to the attribute * actionArea * 3. sets screenCapture indicator to true (after tryKTimes unsuccessfull * tries an exception "ComponentNotFound" will be raised) * * @param icon * @param iconPosition * @param width * @param height * @param K * @throws ComponentNotFoundException */ public void captureScreenAndFindAppletByIconTryKTimes(BufferedImage icon, Point iconPosition, int width, int height, int K) throws ComponentNotFoundException { int count = 0; appletFound = false; while ((count < K) && !appletFound) { robot.delay(defaultWaitForApplet); try { screenshot = robot.createScreenCapture(new Rectangle(Toolkit.getDefaultToolkit().getScreenSize())); initialiseOnScreenshot(icon, iconPosition, width, height, screenshot); } catch (ComponentNotFoundException ex) { //keeping silent and try more-times } count++; } if (ImageSeeker.isRectangleValid(actionArea)) { appletFound = true; } else { throw new ComponentNotFoundException("Object not found in the screenshot!"); } } public void initialiseOnScreenshot(BufferedImage icon, Point iconPosition, int width, int height, BufferedImage screenshot) throws ComponentNotFoundException { Rectangle r = ComponentFinder.findWindowByIcon(icon, iconPosition, width, height, screenshot); initialiseOnScreenshotAndArea(screenshot, r); } public void initialiseOnScreenshotAndArea(BufferedImage screenshot, Rectangle actionArea) throws ComponentNotFoundException { this.screenshot = screenshot; screenshotTaken = true; this.actionArea = actionArea; if (ImageSeeker.isRectangleValid(actionArea)) { appletFound = true; } else { throw new ComponentNotFoundException("set invalid area!"); } } /** * auxiliary method writeAppletScreen for writing Buffered image into png * * @param appletScreen * @param filename * @throws IOException */ private void writeAppletScreen(BufferedImage appletScreen, String filename) throws IOException {// into png file ImageIO.write(appletScreen, "png", new File(filename+".png")); } /** * method findAndActivateApplet finds the applet by icon * and clicks in the middle of applet area * * @throws ComponentNotFoundException (applet not found) * @throws AWTFrameworkException */ public void findAndActivateApplet() throws ComponentNotFoundException, AWTFrameworkException { captureScreenAndFindAppletByIcon(); clickInTheMiddleOfApplet(); } //methods for clicking and typing /** * method clickInTheMiddleOfApplet focuses the applet by clicking in the * middle of its location rectangle */ public void clickInTheMiddleOfApplet() { MouseActions.clickInside(this.actionArea, this.robot); } /** * Method clickOnIconExact - click in the middle of a rectangle with * given pattern (icon) using specified mouse key. * If the applet has not been found yet, the search includes whole screen. * * @param icon * @param mouseKey * @throws ComponentNotFoundException */ public void clickOnIconExact(BufferedImage icon, int mouseKey) throws ComponentNotFoundException{ Rectangle areaOfSearch; if(!appletFound){//searching whole screen, less effective areaOfSearch = new Rectangle(0, 0, this.screenshot.getWidth(), this.screenshot.getHeight()); }else{ areaOfSearch = this.actionArea; } Rectangle iconRectangle = ImageSeeker.findExactImage(icon, this.screenshot, areaOfSearch); if (ImageSeeker.isRectangleValid(iconRectangle)) { MouseActions.clickInside(mouseKey, iconRectangle, this.robot); }else{ throw new ComponentNotFoundException("Exact icon not found!"); } } /** * Method clickOnIconBlurred - click in the middle of a rectangle with * given pattern (icon) using specified mouse key. * If the applet has not been found yet, the search includes whole screen. * * @param icon * @param mouseKey * @param precision tolerated minimal correlation (see ImageSeeker methods) * @throws ComponentNotFoundException */ public void clickOnIconBlurred(BufferedImage icon, int mouseKey, double precision) throws ComponentNotFoundException{ Rectangle areaOfSearch; if(!appletFound){//searching whole screen, less effective areaOfSearch = new Rectangle(0, 0, this.screenshot.getWidth(), this.screenshot.getHeight()); }else{ areaOfSearch = this.actionArea; } Rectangle iconRectangle = ImageSeeker.findBlurredImage(icon, this.screenshot, precision, areaOfSearch); if (ImageSeeker.isRectangleValid(iconRectangle)) { MouseActions.clickInside(mouseKey, iconRectangle, this.robot); }else{ throw new ComponentNotFoundException("Blurred icon not found!"); } } /** * Method clickOnColoredRectangle - click in the middle of a rectangle with * given color (appletColor must be specified as the background) using * specified mouse key. * * @param c * @param mouseKey * @throws ComponentNotFoundException * @throws AWTFrameworkException * */ public void clickOnColoredRectangle(Color c, int mouseKey) throws ComponentNotFoundException, AWTFrameworkException { Rectangle buttonRectangle = findColoredRectangle(c); if (ImageSeeker.isRectangleValid(buttonRectangle)) { MouseActions.clickInside(mouseKey, buttonRectangle, this.robot); }else{ throw new ComponentNotFoundException("Colored rectangle not found!"); } } public void moveToMiddleOfColoredRectangle(Color c) throws ComponentNotFoundException, AWTFrameworkException { Rectangle buttonRectangle = findColoredRectangle(c); if (ImageSeeker.isRectangleValid(buttonRectangle)) { MouseActions.moveMouseToMiddle(buttonRectangle, this.robot); }else{ throw new ComponentNotFoundException("Colored rectangle not found!"); } } public void moveOutsideColoredRectangle(Color c) throws ComponentNotFoundException, AWTFrameworkException { Rectangle buttonRectangle = findColoredRectangle(c); if (ImageSeeker.isRectangleValid(buttonRectangle)) { MouseActions.moveMouseOutside(buttonRectangle, this.robot); }else{ throw new ComponentNotFoundException("Colored rectangle not found!"); } } public void moveInsideColoredRectangle(Color c) throws ComponentNotFoundException, AWTFrameworkException { Rectangle buttonRectangle = findColoredRectangle(c); if (ImageSeeker.isRectangleValid(buttonRectangle)) { MouseActions.moveInsideRectangle(buttonRectangle, this.robot); }else{ throw new ComponentNotFoundException("Colored rectangle not found!"); } } public void dragFromColoredRectangle(Color c) throws ComponentNotFoundException, AWTFrameworkException { Rectangle buttonRectangle = findColoredRectangle(c); if (ImageSeeker.isRectangleValid(buttonRectangle)) { MouseActions.dragFromRectangle(buttonRectangle, this.robot); }else{ throw new ComponentNotFoundException("Colored rectangle not found!"); } } public Rectangle findColoredRectangle(Color c) throws AWTFrameworkException { if(!appletColorGiven || !appletFound){ throw new AWTFrameworkException("AWTHelper could not search for colored rectangle, needs appletColor and applet position."); } Rectangle result; int gap = 5; result = ImageSeeker.findColoredAreaGap(this.screenshot, c, appletColor, this.actionArea.y, this.actionArea.y + this.actionArea.height, gap); return result; } /** * method writeText writes string containing small letters and numbers and * spaces like the keyboard input (using KeyboardActions so delays are * inserted) * * @param text */ public void writeText(String text) { KeyboardActions.writeText(this.robot, text); } /** * method typeKey writes one key on the keyboard (again using * KeyboardActions) * * @param key */ public void typeKey(int key) { KeyboardActions.typeKey(this.robot, key); } } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/awt/PaxHeaders.17941/AWTFrameworkExcept0000644000000000000000000000013112654402377030236 xustar0030 mtime=1454507263.250432408 30 atime=1454507327.354577469 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/awt/AWTFrameworkException.java0000644000175000002070000000453112654402377032413 0ustar00jvanekmock00000000000000/* AWTFrameworkException.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.awt; /** * Class AWTFrameworkException is thrown in the AWTFramework * whenever the framework encounters not enough data specified * to perform an action (for example it is impossible to ascertain * the position of an applet in the screenshot if the width or height * of the applet is not known. * */ public class AWTFrameworkException extends Exception { public AWTFrameworkException() { super(); } public AWTFrameworkException(String s) { super(s); } public AWTFrameworkException(String s, Throwable throwable) { super(s, throwable); } public AWTFrameworkException(Throwable throwable) { super(throwable); } } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/PaxHeaders.17941/annotations0000644000000000000000000000013112654402377026316 xustar0030 mtime=1454507263.250432408 30 atime=1454507658.776157397 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/annotations/0000755000175000002070000000000012654402377027117 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/annotations/PaxHeaders.17941/TestInBrow0000644000000000000000000000013112654402377030356 xustar0030 mtime=1454507263.250432408 30 atime=1454507327.354577469 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/annotations/TestInBrowsers.java0000644000175000002070000000376312654402377032730 0ustar00jvanekmock00000000000000/* TestInBrowsers.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import net.sourceforge.jnlp.browsertesting.Browsers; @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) public @interface TestInBrowsers { public Browsers[] testIn(); } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/annotations/PaxHeaders.17941/Remote.jav0000644000000000000000000000013112654402377030330 xustar0030 mtime=1454507263.250432408 30 atime=1454507327.353577483 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/annotations/Remote.java0000644000175000002070000000373312654402377031223 0ustar00jvanekmock00000000000000/* Bug.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Mark for tests running content on remote servers */ @Target({ElementType.TYPE,ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) public @interface Remote { } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/annotations/PaxHeaders.17941/NeedsDispl0000644000000000000000000000013112654402377030350 xustar0030 mtime=1454507263.249432421 30 atime=1454507327.353577483 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/annotations/NeedsDisplay.java0000644000175000002070000000407012654402377032347 0ustar00jvanekmock00000000000000/* NeedsDisplay.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * This annotation should be declared for each test which requires DISPALY defined. * If no display is defined, then those test will not be run * */ @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) public @interface NeedsDisplay { } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/annotations/PaxHeaders.17941/KnownToFai0000644000000000000000000000013112654402377030335 xustar0030 mtime=1454507263.249432421 30 atime=1454507327.353577483 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/annotations/KnownToFail.java0000644000175000002070000000512712654402377032162 0ustar00jvanekmock00000000000000/* KnownToFail.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import net.sourceforge.jnlp.browsertesting.Browsers; /** *

* This annotation marks a test as a known failure (as opposed to a * regression). A test that is a known failure will not hold of a release, * nor should developers hold off a fix if they run the unit tests and a * test marked as a known failure fails. *

* This annotation is meant for adding tests for bugs before the fix is * implemented. *

*

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

*/ @Target({ElementType.METHOD,ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME) public @interface KnownToFail { public Browsers[] failsIn() default {}; } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/annotations/PaxHeaders.17941/Bug.java0000644000000000000000000000013112654402377027753 xustar0030 mtime=1454507263.249432421 30 atime=1454507327.353577483 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/annotations/Bug.java0000644000175000002070000000560112654402377030501 0ustar00jvanekmock00000000000000/* Bug.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * When declare for suite class or for Test-marked method, * should be interpreted by report generating tool to links. * Known shortcuts are * SX - http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=X * PRX - http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=X * RHX - https://bugzilla.redhat.com/show_bug.cgi?id=X * DX - http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=X * GX - http://bugs.gentoo.org/show_bug.cgi?id=X * CAX - http://server.complang.tuwien.ac.at/cgi-bin/bugzilla/show_bug.cgi?id=X * LPX - https://bugs.launchpad.net/bugs/X * * http://mail.openjdk.java.net/pipermail/distro-pkg-dev/ * and http://mail.openjdk.java.net/pipermail/ are proceed differently * You just put eg @Bug(id="RH12345",id="http:/my.bukpage.com/terribleNew") * and RH12345 will be transalated as *
123456 or * similar, the url will be inclueded as is. Both added to proper tests or suites * */ @Target({ElementType.METHOD,ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME) public @interface Bug { public String[] id(); } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/PaxHeaders.17941/TinyHttpdImpl.java0000644000000000000000000000013112654402377027452 xustar0030 mtime=1454507263.248432434 30 atime=1454507327.353577483 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/TinyHttpdImpl.java0000644000175000002070000003217012654402377030201 0ustar00jvanekmock00000000000000/* TinyHttpdImpl.java Copyright (C) 2011,2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp; import java.io.BufferedReader; import java.io.DataOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.InputStreamReader; import java.io.UnsupportedEncodingException; import java.net.HttpURLConnection; import java.net.Socket; import java.net.SocketException; import java.net.URLDecoder; import java.util.Date; import java.util.HashMap; import java.util.Map; import java.util.StringTokenizer; import net.sourceforge.jnlp.cache.ResourceTracker; /** * based on http://www.mcwalter.org/technology/java/httpd/tiny/index.html Very * small implementation of http return headers for our served resources * Originally Licenced under GPLv2.0 * * When resource starts with XslowX prefix, then resouce (without XslowX) is * returned, but its delivery is delayed */ public class TinyHttpdImpl extends Thread { private static final String CRLF = "\r\n"; private static final String HTTP_NOT_IMPLEMENTED = "HTTP/1.0 " + HttpURLConnection.HTTP_NOT_IMPLEMENTED + " Not Implemented" + CRLF; private static final String HTTP_NOT_FOUND = "HTTP/1.0 " + HttpURLConnection.HTTP_NOT_FOUND + " Not Found" + CRLF; private static final String HTTP_OK = "HTTP/1.0 " + HttpURLConnection.HTTP_OK + " OK" + CRLF; private static final String XSX = "/XslowX"; private Socket socket; private final File testDir; private boolean canRun = true; private boolean supportingHeadRequest = true; private boolean supportLastModified = false; public TinyHttpdImpl(Socket socket, File dir) { this(socket, dir, true); } public TinyHttpdImpl(Socket socket, File dir, boolean start) { this.socket = socket; this.testDir = dir; if (start) { start(); } } public void setCanRun(boolean canRun) { this.canRun = canRun; } public void setSupportingHeadRequest(boolean supportsHead) { this.supportingHeadRequest = supportsHead; } public boolean isSupportingHeadRequest() { return this.supportingHeadRequest; } public void setSupportLastModified(boolean supportLastModified) { this.supportLastModified = supportLastModified; } public boolean isSupportingLastModified() { return this.supportLastModified; } public int getPort() { return this.socket.getPort(); } @Override public void run() { try { BufferedReader reader = new BufferedReader(new InputStreamReader(this.socket.getInputStream())); DataOutputStream writer = new DataOutputStream(this.socket.getOutputStream()); try { while (canRun) { String line = reader.readLine(); if (line.length() < 1) { break; } StringTokenizer t = new StringTokenizer(line, " "); String request = t.nextToken(); boolean isHeadRequest = request.equals(ResourceTracker.RequestMethods.HEAD.toString()); boolean isGetRequest = request.equals(ResourceTracker.RequestMethods.GET.toString()); if (isHeadRequest && !isSupportingHeadRequest()) { ServerAccess.logOutputReprint("Received HEAD request but not supported"); writer.writeBytes(HTTP_NOT_IMPLEMENTED); continue; } if (!isHeadRequest && !isGetRequest) { ServerAccess.logOutputReprint("Received unknown request type " + request); continue; } String filePath = t.nextToken(); boolean slowSend = filePath.startsWith(XSX); if (requestsCounter != null) { String resource = filePath.replace(XSX, "/"); resource = urlToFilePath(resource); Map reosurceRecord = requestsCounter.get(resource); if (reosurceRecord == null) { reosurceRecord = new HashMap<>(); requestsCounter.put(resource, reosurceRecord); } Integer i = reosurceRecord.get(request); if (i == null) { i = 0; } i++; reosurceRecord.put(request, i); } if (redirect != null) { String where = redirect.getUrl(filePath).toExternalForm(); ServerAccess.logOutputReprint("Redirecting " + request + "as " + redirectCode + " to " + where); writer.writeBytes("HTTP/1.0 " + redirectCode + " Moved" + CRLF); writer.writeBytes("Location: " + where + CRLF); writer.writeBytes(CRLF); } else { if (slowSend) { filePath = filePath.replace(XSX, "/"); } ServerAccess.logOutputReprint("Getting- " + request + ": " + filePath); filePath = urlToFilePath(filePath); File resource = new File(this.testDir, filePath); if (!(resource.isFile() && resource.canRead())) { ServerAccess.logOutputReprint("Could not open file " + filePath); writer.writeBytes(HTTP_NOT_FOUND); continue; } ServerAccess.logOutputReprint("Serving- " + request + ": " + filePath); int resourceLength = (int) resource.length(); byte[] buff = new byte[resourceLength]; FileInputStream fis = new FileInputStream(resource); fis.read(buff); fis.close(); String contentType = "Content-Type: "; if (filePath.toLowerCase().endsWith(".jnlp")) { contentType += "application/x-java-jnlp-file"; } else if (filePath.toLowerCase().endsWith(".jar")) { contentType += "application/x-jar"; } else { contentType += "text/html"; } String lastModified = ""; if (supportLastModified) { lastModified = "Last-Modified: " + new Date(resource.lastModified()) + CRLF; } writer.writeBytes(HTTP_OK + "Content-Length:" + resourceLength + CRLF + lastModified + contentType + CRLF + CRLF); if (isGetRequest) { if (slowSend) { byte[][] bb = splitArray(buff, 10); for (int j = 0; j < bb.length; j++) { Thread.sleep(2000); byte[] bs = bb[j]; writer.write(bs, 0, bs.length); } } else { writer.write(buff, 0, resourceLength); } } } } } catch (SocketException e) { ServerAccess.logException(e, false); } catch (Exception e) { writer.writeBytes(HTTP_NOT_FOUND); ServerAccess.logException(e, false); } finally { reader.close(); writer.close(); } } catch (Exception e) { ServerAccess.logException(e, false); } } /** * This function splits input array to severasl pieces from byte[length] * splitt to n pieces s is retrunrd byte[n][length/n], except last piece * which contains length%n * * @param input - array to be splitted * @param pieces - to how many pieces it should be broken * @return inidividual pices of original array, which concatet again givs * original array */ public static byte[][] splitArray(byte[] input, int pieces) { int rest = input.length; int rowLength = rest / pieces; if (rest % pieces > 0) { rowLength++; } if (pieces * rowLength >= rest + rowLength) { pieces--; } int i = 0, j = 0; byte[][] array = new byte[pieces][]; array[0] = new byte[rowLength]; for (byte b : input) { if (i >= rowLength) { i = 0; array[++j] = new byte[Math.min(rowLength, rest)]; } array[j][i++] = b; rest--; } return array; } /** * This function transforms a request URL into a path to a file which the * server will return to the requester. * * @param url - the request URL * @return a String representation of the local path to the file * @throws UnsupportedEncodingException */ public static String urlToFilePath(String url) throws UnsupportedEncodingException { url = URLDecoder.decode(url, "UTF-8"); // Decode URL encoded charaters, eg "%3B" becomes ';' if (url.startsWith(XSX)) { url = url.replace(XSX, "/"); } url = url.replaceAll("\\?.*", ""); // Remove query string from URL url = ".".concat(url); // Change path into relative path if (url.endsWith("/")) { url += "index.html"; } url = url.replace('/', File.separatorChar); // If running on Windows, replace '/' in path with "\\" url = stripHttpPathParams(url); return url; } /** * This function removes the HTTP Path Parameter from a given JAR URL, * assuming that the path param delimiter is a semicolon * * @param url - the URL from which to remove the path parameter * @return the URL with the path parameter removed */ public static String stripHttpPathParams(String url) { if (url == null) { return null; } // If JNLP specifies JAR URL with .JAR extension (as it should), then look for any semicolons // after this position. If one is found, remove it and any following characters. int fileExtension = url.toUpperCase().lastIndexOf(".JAR"); if (fileExtension != -1) { int firstSemiColon = url.indexOf(';', fileExtension); if (firstSemiColon != -1) { url = url.substring(0, firstSemiColon); } } return url; } /** * When redirect is set, the requests to this server will just redirect to * the underlying ServerLauncher */ private ServerLauncher redirect = null; void setRedirect(ServerLauncher redirect) { this.redirect = redirect; } /** * one of: 301, 302,303, 307, 308, */ private int redirectCode = 302; void setRedirectCode(int redirectPort) { this.redirectCode = redirectPort; } //resoource -> request -> number of requests on of this rsource on this server // eg simpletest1.jnlp -> GET -> 3 private Map> requestsCounter; public void setRequestsCounter(Map> requestsCounter) { this.requestsCounter = requestsCounter; } } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/PaxHeaders.17941/ThreadedProcess.java0000644000000000000000000000013112654402377027760 xustar0030 mtime=1454507263.248432434 30 atime=1454507327.353577483 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/ThreadedProcess.java0000644000175000002070000001241112654402377030503 0ustar00jvanekmock00000000000000/* ThreadedProcess.java Copyright (C) 2011,2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp; import java.io.File; import java.util.List; /** * * wrapper around Runtime.getRuntime().exec(...) which ensures that process is run inside its own, by us controlled, thread. * Process builder caused some unexpected and weird behavior :/ */ public class ThreadedProcess extends Thread { Process p = null; List args; Integer exitCode; Boolean running; String[] variables; File dir; Throwable deadlyException = null; /* * before removing this "useless" variable * check DeadLockTestTest.testDeadLockTestTerminated2 */ private boolean destoyed = false; private ProcessAssasin assasin; public boolean isDestoyed() { return destoyed; } public void setDestoyed(boolean destoyed) { this.destoyed = destoyed; } public Boolean isRunning() { return running; } public Integer getExitCode() { return exitCode; } public void setVariables(String[] variables) { this.variables = variables; } public String[] getVariables() { return variables; } public ThreadedProcess(List args) { this.args = args; } public ThreadedProcess(List args, File dir) { this(args); this.dir = dir; } public ThreadedProcess(List args,String[] vars) { this(args); this.variables = vars; } public ThreadedProcess(List args, File dir,String[] vars) { this(args,dir); this.variables = vars; } public String getCommandLine() { String commandLine = "unknown command"; try { if (args != null && args.size() > 0) { commandLine = ""; for (String string : args) { commandLine = commandLine + " " + string; } } } catch (Exception ex) { ex.printStackTrace(); } return commandLine; } public Process getP() { return p; } @Override public void run() { try { running = true; Runtime r = Runtime.getRuntime(); if (dir == null) { if (variables == null) { p = r.exec(args.toArray(new String[0])); } else { p = r.exec(args.toArray(new String[0]), variables); } } else { p = r.exec(args.toArray(new String[0]), variables, dir); } try { exitCode = p.waitFor(); Thread.sleep(500); //this is giving to fast done proecesses's e/o readers time to read all. I would like to know better solution :-/ while(assasin.isKilling() && !assasin.haveKilled()){ Thread.sleep(100); }; } finally { destoyed = true; } } catch (Exception ex) { if (ex instanceof InterruptedException) { //add to the set of terminated threaded processes deadlyException = ex; ServerAccess.logException(deadlyException, false); //ServerAccess.terminated.add(this); } else { //happens when non-existing process is launched, is causing p null! //ServerAccess.terminated.add(this); deadlyException = ex; ServerAccess.logException(deadlyException, false); throw new RuntimeException(ex); } } finally { running = false; } } void setAssasin(ProcessAssasin pa) { this.assasin=pa; } } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/PaxHeaders.17941/TestsLogs.java0000644000000000000000000000013112654402377026630 xustar0030 mtime=1454507263.248432434 30 atime=1454507327.353577483 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/TestsLogs.java0000644000175000002070000000574012654402377027362 0ustar00jvanekmock00000000000000/* TestsLogs.java Copyright (C) 2011,2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp; import java.util.LinkedList; import java.util.List; class TestsLogs { public final List outs = new LinkedList(); public final List errs = new LinkedList(); public final List all = new LinkedList(); private static final String LOG_ELEMENT = "log"; private static final String LOG_ID_ATTRIBUTE = "id"; synchronized void add(boolean err, boolean out, String text) { if (text == null) { text = "null"; } LogItem li = new LogItem(text); if (out) { outs.add(li); } if (err) { errs.add(li); } all.add(li); } @Override public String toString() { StringBuilder sb = listToStringBuilder(outs, "out"); sb.append(listToStringBuilder(errs, "err")); sb.append(listToStringBuilder(all, "all")); return sb.toString(); } private StringBuilder listToStringBuilder(List l, String id) { StringBuilder sb = new StringBuilder(); sb.append("<" + LOG_ELEMENT + " " + LOG_ID_ATTRIBUTE + "=\"").append(id).append("\">\n"); int i = 0; for (LogItem logItem : l) { i++; sb.append(logItem.toStringBuilder(i)); } sb.append("\n"); return sb; } } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/PaxHeaders.17941/ServerLauncher.java0000644000000000000000000000013112654402377027631 xustar0030 mtime=1454507263.247432448 30 atime=1454507327.353577483 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/ServerLauncher.java0000644000175000002070000001274112654402377030362 0ustar00jvanekmock00000000000000/* ServerLauncher.java Copyright (C) 2011,2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp; import java.io.File; import java.net.MalformedURLException; import java.net.ServerSocket; import java.net.URL; import java.util.Map; /** * wrapper around tiny http server to separate lunch configurations and servers. * to allow terminations and stuff around. */ public class ServerLauncher implements Runnable { /** * default url name part. This can be changed in runtime, but will affect * all following tasks upon those server */ private String serverName = ServerAccess.DEFAULT_LOCALHOST_NAME; private boolean running; private final Integer port; private final File dir; private ServerSocket serverSocket; private boolean supportingHeadRequest = true; public void setSupportingHeadRequest(boolean supportsHead) { this.supportingHeadRequest = supportsHead; } public boolean isSupportingHeadRequest() { return supportingHeadRequest; } public String getServerName() { return serverName; } public void setServerName(String serverName) { this.serverName = serverName; } public ServerLauncher(Integer port, File dir) { this.port = port; this.dir = dir; System.err.println("port: " + port); System.err.println("dir: " + dir); } public boolean isRunning() { return running; } public Integer getPort() { return port; } public File getDir() { return dir; } public ServerLauncher(File dir) { this(8181, dir); } public ServerLauncher(Integer port) { this(port, new File(System.getProperty("user.dir"))); } public ServerLauncher() { this(8181, new File(System.getProperty("user.dir"))); } /** * When redirect is set, the requests to this server will just redirect to * the underlying ServerLauncher */ private ServerLauncher redirect = null; /** * one of: 301, 302,303, 307, 308, */ private int redirectCode = 302; public void setRedirect(ServerLauncher redirect) { this.redirect = redirect; } public void setRedirectCode(int redirectPort) { this.redirectCode = redirectPort; } //resoource -> request -> number of requests on of this rsource on this server // eg simpletest1.jnlp -> GET -> 3 private Map> requestsCounter; public void setRequestsCounter(Map> requestsCounter) { this.requestsCounter = requestsCounter; } public void run() { running = true; try { serverSocket = new ServerSocket(port); while (running) { TinyHttpdImpl server = new TinyHttpdImpl(serverSocket.accept(), dir, false); server.setRedirect(redirect); server.setRedirectCode(redirectCode); server.setRequestsCounter(requestsCounter); server.setSupportingHeadRequest(isSupportingHeadRequest()); server.start(); } } catch (Exception e) { ServerAccess.logException(e); } finally { running = false; } } public URL getUrl(String resource) throws MalformedURLException { if (resource == null) { resource = ""; } if (resource.trim().length() > 0 && !resource.startsWith("/")) { resource = "/" + resource; } return new URL("http", getServerName(), getPort(), resource); } public URL getUrl() throws MalformedURLException { return getUrl(""); } public void stop() { this.running = false; if (serverSocket != null) { try { serverSocket.close(); } catch (Exception ex) { ServerAccess.logException(ex); } } } } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/PaxHeaders.17941/ServerAccess.java0000644000000000000000000000013112654402377027271 xustar0030 mtime=1454507263.247432448 30 atime=1454507327.352577496 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java0000644000175000002070000011055212654402377030021 0ustar00jvanekmock00000000000000/* ServerAccess.java Copyright (C) 2011, 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.ServerSocket; import java.net.URL; import java.net.URLConnection; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import net.sourceforge.jnlp.browsertesting.Browser; import net.sourceforge.jnlp.browsertesting.BrowserFactory; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.AutoErrorClosingListener; import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; import net.sourceforge.jnlp.util.FileUtils; import net.sourceforge.jnlp.util.logging.OutputController; /** * * This class provides access to virtual server and stuff around. * It can find unoccupied port, start server, provides its singleton instantiation, launch parallel instantiations, * read location of installed (tested javaws) see javaws.build.bin java property, * location of server www root on file system (see test.server.dir java property), * stubs for launching javaws and for locating resources and read resources. * * It can also execute processes with timeout (@see PROCESS_TIMEOUT) (used during launching javaws) * Some protected apis are exported because public classes in this package are put to be tested by makefile. * * There are included test cases which show some basic usages. * * */ public class ServerAccess { public static enum AutoClose { CLOSE_ON_EXCEPTION, CLOSE_ON_CORRECT_END, CLOSE_ON_BOTH } public static final long NANO_TIME_DELIMITER=1000000l; /** * java property which value containing path to default (makefile by) directory with deployed resources */ public static final String TEST_SERVER_DIR = "test.server.dir"; /** * java property which value containing path to installed (makefile by) javaws binary */ public static final String JAVAWS_BUILD_BIN = "javaws.build.bin"; /** property to set the different then default browser */ public static final String USED_BROWSERS = "used.browsers"; public static final String DEFAULT_LOCALHOST_NAME = "localhost"; /** * server instance singleton */ private static ServerLauncher server; /** * inner version of engine */ private static final String version = "5"; /** * timeout to read 'remote' resources * This can be changed in runtime, but will affect all following tasks */ public static int READ_TIMEOUT = 1000; /** * timeout in ms to let process to finish, before assassin will kill it. * This can be changed in runtime, but will affect all following tasks */ public static long PROCESS_TIMEOUT = 10 * 1000;//ms /** * this flag is indicating whether output of executeProcess should be logged. By default true. */ public static boolean PROCESS_LOG = true; public static boolean LOGS_REPRINT = false; private Browser currentBrowser; public static final String UNSET_BROWSER="unset_browser"; /** * main method of this class prints out random free port * or runs server * param "port" prints out the port * nothing or number will run server on random(or on number specified) * port in -Dtest.server.dir * @param args params from commandline. recognized params are port and randomport * @throws java.lang.Exception if anything happens */ public static void main(String[] args) throws Exception { if (args.length > 0 && args[0].equalsIgnoreCase("port")) { int i = findFreePort(); System.out.println(i); System.exit(0); } else { int port = 44321; if (args.length > 0 && args[0].equalsIgnoreCase("randomport")) { port = findFreePort(); } else if (args.length > 0) { port = new Integer(args[0]); } getIndependentInstance(port); while (true) { Thread.sleep(1000); } } } /** * utility method to find random free port * * @return - found random free port * @throws IOException - if socket can't be opened or no free port exists */ public static int findFreePort() throws IOException { ServerSocket findPortTestingSocket = new ServerSocket(0); int port = findPortTestingSocket.getLocalPort(); findPortTestingSocket.close(); return port; } public static final String HEADLES_OPTION=OptionsDefinitions.OPTIONS.HEADLESS.option; public static final String VERBOSE_OPTION=OptionsDefinitions.OPTIONS.VERBOSE.option; /** * we would like to have an singleton instance ASAP */ public ServerAccess() { getInstance(); } /** * * @return cached instance. If none, then creates new */ public static ServerLauncher getInstance() { if (server == null) { server = getIndependentInstance(); } return server; } /** * * @return new not cached iserver instance on random port, * useful for testing application loading from different url then base */ public static ServerLauncher getIndependentInstance() { return getIndependentInstance(true); } public static ServerLauncher getIndependentInstance(boolean daemon) { String dir = (System.getProperty(TEST_SERVER_DIR)); try{ return getIndependentInstance(dir, findFreePort(),daemon); }catch (Exception ex){ throw new RuntimeException(ex); } } /** * * @param port specific port on which this server is accepting requests * @return new not cached iserver instance on random port, * useful for testing application loading from different url then base */ public static ServerLauncher getIndependentInstance(int port) { return getIndependentInstance(port, true); } public static ServerLauncher getIndependentInstance(int port,boolean daemon) { String dir = (System.getProperty(TEST_SERVER_DIR)); return getIndependentInstance(dir,port,daemon); } /** * * @param dir directory from which server returns resources * @param port specific port on which this server is accepting requests * @return new not cached iserver instance on random port upon custom www root directory, * useful for testing application loading from different url then base */ public static ServerLauncher getIndependentInstance(String dir, int port) { return getIndependentInstance(dir, port, true); } public static ServerLauncher getIndependentInstance(String dir) throws IOException { return getIndependentInstance(dir, findFreePort(), true); } public static ServerLauncher getIndependentInstanceOnTmpDir() throws IOException { File f = File.createTempFile("itwReproducers_", "_anotherDeployDir"); f.delete(); f.mkdir(); f.deleteOnExit(); return getIndependentInstance(f.getAbsolutePath(), findFreePort(), true); } public static ServerLauncher getIndependentInstance(String dir, int port, boolean daemon) { if (dir == null || dir.trim().length() == 0 || !new File(dir).exists() || !new File(dir).isDirectory()) { throw new RuntimeException("test.server.dir property must be set to valid directory!"); } try { ServerLauncher lServerLuncher = new ServerLauncher(port, new File(dir)); Thread r=new Thread(lServerLuncher); r.setDaemon(daemon); r.start(); return lServerLuncher; } catch (Exception ex) { throw new RuntimeException(ex); } } /** * * @return - value passed inside as javaws binary location. See JAVAWS_BUILD_BIN */ public String getJavawsLocation() { return System.getProperty(JAVAWS_BUILD_BIN); } /** * * @return - bianry from where to lunch current browser */ public String getBrowserLocation() { if (this.currentBrowser==null) return UNSET_BROWSER; return this.currentBrowser.getBin(); } public List getBrowserParams() { if (this.currentBrowser==null) return null; List l1=this.currentBrowser.getComaptibilitySwitches(); List l2=this.currentBrowser.getDefaultSwitches(); List l= new ArrayList<>(); if (l1!=null)l.addAll(l1); if (l2!=null)l.addAll(l2); return l; } public Browsers getCurrentBrowsers() { if (currentBrowser==null) return null; return currentBrowser.getID(); } public Browser getCurrentBrowser() { return currentBrowser; } public void setCurrentBrowser(Browsers currentBrowser) { this.currentBrowser = BrowserFactory.getFactory().getBrowser(currentBrowser); if (this.currentBrowser == null) { LoggingBottleneck.getDefaultLoggingBottleneck().setLoggedBrowser(UNSET_BROWSER); } else { LoggingBottleneck.getDefaultLoggingBottleneck().setLoggedBrowser(this.currentBrowser.getID().toString()); } } public void setCurrentBrowser(Browser currentBrowser) { this.currentBrowser = currentBrowser; if (this.currentBrowser == null) { LoggingBottleneck.getDefaultLoggingBottleneck().setLoggedBrowser(UNSET_BROWSER); } else { LoggingBottleneck.getDefaultLoggingBottleneck().setLoggedBrowser(this.currentBrowser.getID().toString()); } } /** * * @return - value passed inside as javaws binary location as file. See JAVAWS_BUILD_BIN */ public File getJavawsFile() { return new File(System.getProperty(JAVAWS_BUILD_BIN)); } /** * * @return port on which is running cached server. If non singleton instance is running, new is created. */ public int getPort() { if (server == null) { getInstance(); } //if (!server.isRunning()) throw new RuntimeException("Server mysteriously died"); return server.getPort(); } /** * * @return directory upon which is running cached server. If non singleton instance is running, new is created. */ public File getDir() { if (server == null) { getInstance(); } // if (!server.isRunning()) throw new RuntimeException("Server mysteriously died"); return server.getDir(); } /** * * @throws java.net.MalformedURLException if url for this resource can not be constructed * @return complete url for this resource on this server * @param resource relative path pointing to server resource. If non singleton instance is running, new is created. */ public URL getUrl(String resource) throws MalformedURLException { if (server == null) { getInstance(); } //if (!server.isRunning()) throw new RuntimeException("Server mysteriously died"); return server.getUrl(resource); } /** * * @return url pointing to cached server . If non singleton instance is running, new is created. * @throws java.net.MalformedURLException */ public URL getUrl() throws MalformedURLException { return getUrl(""); } /** * * @return whether cached server is alive. If non singleton instance is running, new is created. */ public boolean isRunning() { if (server == null) { getInstance(); } //if (!server.isRunning()) throw new RuntimeException("Server mysteriously died"); return server.isRunning(); } /** * Return resource from cached server * * @param resource to be located on cached server * @return individual bytes of resource * @throws IOException if connection can't be established or resource does not exist */ public ByteArrayOutputStream getResourceAsBytes(String resource) throws IOException { return getResourceAsBytes(getUrl(resource)); } /** * Return resource from cached server * * @param resource to be located on cached server * @return string constructed from resource * @throws IOException if connection can't be established or resource does not exist */ public String getResourceAsString(String resource) throws IOException { return getResourceAsString(getUrl(resource)); } /** * utility method which can read bytes of any stream * * @param is stream to be read * @return individual bytes of resource * @throws IOException if connection can't be established or resource does not exist */ public static ByteArrayOutputStream getBytesFromStream(InputStream is) throws IOException { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); int nRead; byte[] data = new byte[16384]; while ((nRead = is.read(data, 0, data.length)) != -1) { buffer.write(data, 0, nRead); } buffer.flush(); return buffer; } /** * utility method which can read from any stream as one long String * * @param is stream to be read * @param encoding encoding of this stream * @return stream as string * @throws IOException if connection can't be established or resource does not exist */ public static String getContentOfStream(InputStream is, String encoding) throws IOException { return FileUtils.getContentOfStream(is, encoding); } /** * utility method which can read from any stream as one long String * * @param is input stream to read from * @return stream as string * @throws IOException if connection can't be established or resource does not exist */ public static String getContentOfStream(InputStream is) throws IOException { return FileUtils.getContentOfStream(is); } /** * utility method which can read bytes of resource from any url * * @param u full url to read from * @return individual bytes of resource * @throws IOException if connection can't be established or resource does not exist */ public static ByteArrayOutputStream getResourceAsBytes(URL u) throws IOException { URLConnection connection = null; try { connection = u.openConnection(); if (connection instanceof HttpURLConnection) { ((HttpURLConnection) connection).setRequestMethod("GET"); } connection.setDoOutput(true); connection.setReadTimeout(READ_TIMEOUT); connection.connect(); return getBytesFromStream(connection.getInputStream()); } finally { if (connection != null && connection instanceof HttpURLConnection) { ((HttpURLConnection) connection).disconnect(); } } } /** * utility method which can read string of resource from any url * * @param u full url to read from * @return resource as string * @throws IOException if connection can't be established or resource does * not exist */ public static String getResourceAsString(URL u) throws IOException { URLConnection connection = null; try { connection = (HttpURLConnection) u.openConnection(); if (connection instanceof HttpURLConnection) { ((HttpURLConnection) connection).setRequestMethod("GET"); } connection.setDoOutput(true); connection.setReadTimeout(READ_TIMEOUT); connection.connect(); return getContentOfStream(connection.getInputStream()); } finally { if (connection != null && connection instanceof HttpURLConnection) { ((HttpURLConnection) connection).disconnect(); } } } /** * helping dummy method to save String as file in UTF-8 encoding. * * @param content which will be saved as it is saved in this String * @param f file to be saved. No warnings provided * @throws IOException */ public static void saveFile(String content, File f) throws IOException { FileUtils.saveFile(content, f); } /** * helping dummy method to save String as file in specified encoding/. * * @param content which will be saved as it is saved in this String * @param f file to be saved. No warnings provided * @param encoding of output byte representation * @throws IOException */ public static void saveFile(String content, File f,String encoding) throws IOException { FileUtils.saveFile(content, f, encoding); } /** * wrapping method to executeProcess (eg: javaws -headless http://localhost:port/resource) * will execute default javaws (@see JAVAWS_BUILD_BIN) upon default url upon cached server (@see SERVER_NAME @see getPort(), @see getInstance()) * with parameter -headless (no gui, no asking) * @param resource name of resource * @return result what left after running this process * @throws Exception */ public ProcessResult executeJavawsHeadless(String resource) throws Exception { return executeJavawsHeadless(null, resource); } public ProcessResult executeJavawsHeadless(String resource,ContentReaderListener stdoutl,ContentReaderListener stderrl) throws Exception { return executeJavawsHeadless(null, resource,stdoutl,stderrl,null); } public ProcessResult executeJavawsClearCache() throws Exception { return executeProcess(Arrays.asList(new String[]{getJavawsLocation(), OptionsDefinitions.OPTIONS.CLEARCACHE.option, ServerAccess.HEADLES_OPTION})); } /** * wrapping method to executeProcess (eg: javaws arg arg -headless http://localhost:port/resource) * will execute default javaws (@see JAVAWS_BUILD_BIN) upon default url upon cached server (@see SERVER_NAME @see getPort(), @see getInstance()) * with parameter -headless (no gui, no asking) * @param resource name of resource * @param otherargs other arguments to be added to headless one * @return result what left after running this process * @throws Exception */ public ProcessResult executeJavawsHeadless(List otherargs, String resource) throws Exception { return executeJavawsHeadless(otherargs, resource,null,null,null); } public ProcessResult executeJavawsHeadless(List otherargs, String resource, String[] vars) throws Exception { return executeJavawsHeadless(otherargs, resource,null,null,vars); } public ProcessResult executeJavawsHeadless(List otherargs, String resource,ContentReaderListener stdoutl,ContentReaderListener stderrl,String[] vars) throws Exception { if (otherargs == null) { otherargs = new ArrayList<>(1); } List headlesList = new ArrayList<>(otherargs); headlesList.add(HEADLES_OPTION); return executeJavaws(headlesList, resource,stdoutl,stderrl,vars); } /** * wrapping method to executeProcess (eg: javaws http://localhost:port/resource) * will execute default javaws (@see JAVAWS_BUILD_BIN) upon default url upon cached server (@see SERVER_NAME @see getPort(), @see getInstance()) * @param resource name of resource * @return result what left after running this process * @throws Exception */ public ProcessResult executeJavaws(String resource) throws Exception { return executeJavaws(null, resource); } public ProcessResult executeJavaws(String resource,ContentReaderListener stdoutl,ContentReaderListener stderrl) throws Exception { return executeJavaws(null, resource,stdoutl,stderrl); } public net.sourceforge.jnlp.ProcessResult executeBrowser(String string, AutoClose autoClose) throws Exception { ClosingListener errClosing = null; ClosingListener outClosing = null; if (autoClose == AutoClose.CLOSE_ON_BOTH || autoClose == AutoClose.CLOSE_ON_EXCEPTION){ errClosing=new AutoErrorClosingListener(); } if (autoClose == AutoClose.CLOSE_ON_BOTH || autoClose == AutoClose.CLOSE_ON_CORRECT_END){ outClosing=new AutoOkClosingListener(); } return executeBrowser(string, outClosing, errClosing); } /** * * @param resource relative resource to be opened in browser for current server instance. * @return result of browser run * */ public ProcessResult executeBrowser(String resource) throws Exception { return executeBrowser(getBrowserParams(), resource); } /** * * @param resource relative resource to be opened in browser for current server instance. * @param stdoutl listener for stdout * @param stderrl listener for stderr * @return result of browser run * */ public ProcessResult executeBrowser(String resource,ContentReaderListener stdoutl,ContentReaderListener stderrl) throws Exception { return executeBrowser(getBrowserParams(), resource, stdoutl, stderrl); } /** * * @param resource elative resource to be opened in browser for current server instance. * @param stdoutl listeners for stdout * @param stderrl listeners for stderr * @return result of browser run * */ public ProcessResult executeBrowser(String resource, List stdoutl, List stderrl) throws Exception { return executeBrowser(getBrowserParams(), resource, stdoutl, stderrl); } /** * wrapping method to executeProcess (eg: javaws arg arg http://localhost:port/resource) * will execute default javaws (@see JAVAWS_BUILD_BIN) upon default url upon cached server (@see SERVER_NAME @see getPort(), @see getInstance())) * @param resource name of resource * @param otherargs other arguments to be added * @return result what left after running this process * @throws Exception */ public ProcessResult executeJavaws(List otherargs, String resource) throws Exception { return executeProcessUponURL(getJavawsLocation(), otherargs, getUrlUponThisInstance(resource)); } public ProcessResult executeJavaws(List otherargs, String resource,ContentReaderListener stdoutl,ContentReaderListener stderrl) throws Exception { return executeProcessUponURL(getJavawsLocation(), otherargs, getUrlUponThisInstance(resource),stdoutl,stderrl); } public ProcessResult executeJavaws(List otherargs, String resource,ContentReaderListener stdoutl,ContentReaderListener stderrl,String[] vars) throws Exception { return executeProcessUponURL(getJavawsLocation(), otherargs, getUrlUponThisInstance(resource),stdoutl,stderrl,vars); } public ProcessResult executeBrowser(List otherargs, String resource) throws Exception { return executeBrowser(otherargs, getUrlUponThisInstance(resource)); } public ProcessResult executeBrowser(List otherargs, URL url) throws Exception { ProcessWrapper rpw = new ProcessWrapper(getBrowserLocation(), otherargs, url); rpw.setReactingProcess(getCurrentBrowser());//current browser may be null, but it does not metter return rpw.execute(); } public ProcessResult executeBrowser(List otherargs, String resource, ContentReaderListener stdoutl, ContentReaderListener stderrl) throws Exception { ProcessWrapper rpw = new ProcessWrapper(getBrowserLocation(), otherargs, getUrlUponThisInstance(resource), stdoutl, stderrl, null); rpw.setReactingProcess(getCurrentBrowser());//current browser may be null, but it does not metter return rpw.execute(); } public ProcessResult executeBrowser(List otherargs, URL url, ContentReaderListener stdoutl, ContentReaderListener stderrl) throws Exception { ProcessWrapper rpw = new ProcessWrapper(getBrowserLocation(), otherargs, url, stdoutl, stderrl, null); rpw.setReactingProcess(getCurrentBrowser());//current browser may be null, but it does not metter return rpw.execute(); } public ProcessResult executeBrowser(List otherargs, String resource, List stdoutl, List stderrl) throws Exception { ProcessWrapper rpw = new ProcessWrapper(getBrowserLocation(), otherargs, getUrlUponThisInstance(resource), stdoutl, stderrl, null); rpw.setReactingProcess(getCurrentBrowser());// current browser may be null, but it does not matter return rpw.execute(); } public ProcessResult executeBrowser(Browser b, List otherargs, String resource) throws Exception { ProcessWrapper rpw = new ProcessWrapper(b.getBin(), otherargs, getUrlUponThisInstance(resource)); rpw.setReactingProcess(b); return rpw.execute(); } public ProcessResult executeBrowser(Browser b, List otherargs, String resource, ContentReaderListener stdoutl, ContentReaderListener stderrl) throws Exception { ProcessWrapper rpw = new ProcessWrapper(b.getBin(), otherargs, getUrlUponThisInstance(resource), stdoutl, stderrl, null); rpw.setReactingProcess(b); return rpw.execute(); } public ProcessResult executeBrowser(Browser b, List otherargs, String resource, List stdoutl, List stderrl) throws Exception { ProcessWrapper rpw = new ProcessWrapper(b.getBin(), otherargs, getUrlUponThisInstance(resource), stdoutl, stderrl, null); rpw.setReactingProcess(b); return rpw.execute(); } /** * Create resource on http, on 'localhost' on port on which this cached instance is running * @param resource * @return * @throws MalformedURLException */ public URL getUrlUponThisInstance(String resource) throws MalformedURLException { getInstance(); return getUrlUponInstance(server, resource); } /** * Create resource on http, on 'localhost' on port on which this instance is running * @param instance of server to return the resource * @param resource relative path to resource to be loaded from specified instance * @return the absolute url * @throws MalformedURLException */ public static URL getUrlUponInstance(ServerLauncher instance,String resource) throws MalformedURLException { return instance.getUrl(resource); } /** * wrapping method to executeProcess (eg: javaws arg arg arg url) * will execute default javaws (@see JAVAWS_BUILD_BIN) upon any server * @param otherargs - commandline arguments for javaws process * @param u url of resource upon any server * @return result what left after running this process * @throws Exception */ public ProcessResult executeJavawsUponUrl(List otherargs, URL u) throws Exception { return executeProcessUponURL(getJavawsLocation(), otherargs, u); } public ProcessResult executeJavawsUponUrl(List otherargs, URL u,ContentReaderListener stdoutl,ContentReaderListener stderrl) throws Exception { return executeProcessUponURL(getJavawsLocation(), otherargs, u,stdoutl,stderrl); } /** * wrapping utility method to executeProcess (eg: any_binary arg arg arg url) * * will execute any process upon url upon any server * @param toBeExecuted - command to lunch javaws program * @param u url of resource upon any server * @param otherargs commandline arguments for new process * @return result what left after running this process * @throws Exception */ public static ProcessResult executeProcessUponURL(String toBeExecuted, List otherargs, URL u) throws Exception { return new ProcessWrapper(toBeExecuted, otherargs, u).execute(); } public static ProcessResult executeProcessUponURL(String toBeExecuted, List otherargs, URL u, ContentReaderListener stdoutl, ContentReaderListener stderrl) throws Exception { return new ProcessWrapper(toBeExecuted, otherargs, u, stdoutl, stderrl, null).execute(); } public static ProcessResult executeProcessUponURL(String toBeExecuted, List otherargs, URL u, ContentReaderListener stdoutl, ContentReaderListener stderrl, String[] vars) throws Exception { return new ProcessWrapper(toBeExecuted, otherargs, u, stdoutl, stderrl, vars).execute(); } public static ProcessResult executeProcess(final List args) throws Exception { return executeProcess(args, null); } public static ProcessResult executeProcess(final List args,ContentReaderListener stdoutl,ContentReaderListener stderrl) throws Exception { return executeProcess(args, null,stdoutl,stderrl); } public static ProcessResult executeProcess(final List args,ContentReaderListener stdoutl,ContentReaderListener stderrl,String[] vars) throws Exception { return executeProcess(args, null,stdoutl,stderrl,vars); } /** * utility method to lunch process, get its stdout/stderr, its return value and to kill it if running to long (@see PROCESS_TIMEOUT) * * * Small background: * This method creates thread inside which exec will be executed. Then creates assassin thread with given timeout to kill the previously created thread if necessary. * Starts assassin thread, starts process thread. Wait until process is running, then starts content readers. * Closes input of process. * Wait until process is running (no matter if it terminate itself (correctly or badly), or is terminated by its assassin. * Construct result from read stdout, stderr, process return value, assassin successfully * * @param args binary with args to be executed * @param dir optional, directory where this process will run * @return what left from process - process itself, its stdout, stderr and return value and whether it was terminated by assassin. * @throws Exception */ public static ProcessResult executeProcess(final List args,File dir) throws Exception { return executeProcess(args, dir, null, null); } /** * Proceed message s to logging with request to reprint to System.err * @param s */ public static void logErrorReprint(String s) { log(s, false, true); } /** * Proceed message s to logging with request to reprint to System.out * @param s */ public static void logOutputReprint(String s) { log(s, true, false); } /** * Proceed message s to logging withhout request to reprint * @param s */ public static void logNoReprint(String s) { log(s, false, false); } static void log(String message, boolean printToOut, boolean printToErr) { String idded; StackTraceElement ste = getTestMethod(); String fullId = LoggingBottleneck.getDefaultLoggingBottleneck().modifyMethodWithForBrowser(ste.getMethodName(), ste.getClassName()); if (message.contains("\n")) { idded = fullId + ": \n" + message + "\n" + fullId + " ---"; } else { idded = fullId + ": " + message; } if (LOGS_REPRINT) { if (printToOut) { System.out.println(idded); } if (printToErr) { System.err.println(idded); } } LoggingBottleneck.getDefaultLoggingBottleneck().logIntoPlaintextLog(idded, printToOut,printToErr); LoggingBottleneck.getDefaultLoggingBottleneck().addToXmlLog(message,printToOut,printToErr,ste); } public static void logException(Throwable t){ logException(t, true); } public static void logException(Throwable t, boolean print){ log(OutputController.exceptionToString(t), false, print); } private static StackTraceElement getTestMethod() { return getTestMethod(Thread.currentThread().getStackTrace()); } private static StackTraceElement getTestMethod(StackTraceElement[] stack) { //0 is always thread //1 is net.sourceforge.jnlp.* //we need to get out of all of classes from this package or pick last of it StackTraceElement result = stack[1]; String baseClass = stack[1].getClassName(); int i = 2; for (; i < stack.length; i++) { result = stack[i];//at least moving up if (stack[i].getClassName().contains("$")) { continue; } //probablky it is necessary to get out of net.sourceforge.jnlp. //package where are right now all test-extensions //for now keeping exactly the three classes helping you access the log try { Class clazz = Class.forName(stack[i].getClassName()); String path = null; try { path = clazz.getProtectionDomain().getCodeSource().getLocation().getPath(); } catch (NullPointerException ex) { //silently ignoring and continuing with null path } if (path != null && path.contains("/tests.build/")) { if (!path.contains("/test-extensions/")) { break; } } else { //running from ide if (!stack[i].getClassName().startsWith("net.sourceforge.jnlp.")) { break; } } } catch (ClassNotFoundException ex) { ///should not happen, searching only for already loaded class ex.printStackTrace(); } } //if nothing left in stack then we have been in ServerAccess already //so the target method is the highest form it and better to return it //rather then die to ArrayOutOfBounds if (i >= stack.length) { return result; } //now we are out of test-extensions //method we need (the test) is highest from following class baseClass = stack[i].getClassName(); for (; i < stack.length; i++) { if(stack[i].getClassName().contains("$")){ continue; } if (!baseClass.equals(stack[i].getClassName())) { break; } result = stack[i]; } return result; } public static ProcessResult executeProcess(final List args, File dir, ContentReaderListener stdoutl, ContentReaderListener stderrl) throws Exception { return executeProcess(args, dir, stdoutl, stderrl,null); } public static ProcessResult executeProcess(final List args, File dir, ContentReaderListener stdoutl, ContentReaderListener stderrl, String[] vars) throws Exception { return new ProcessWrapper(args, dir, stdoutl, stderrl, vars).execute(); } } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/PaxHeaders.17941/ProcessWrapper.java0000644000000000000000000000013112654402377027660 xustar0030 mtime=1454507263.246432461 30 atime=1454507327.352577496 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/ProcessWrapper.java0000644000175000002070000002064612654402377030414 0ustar00jvanekmock00000000000000/* ProcessWrapper.java Copyright (C) 2011,2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp; import java.io.File; import java.io.OutputStream; import java.net.URL; import java.util.ArrayList; import java.util.List; import net.sourceforge.jnlp.browsertesting.ReactingProcess; import org.junit.Assert; /** * This class wraps execution of ThreadedProcess. * Add listeners and allows another setters, eg of ReactingProcess * */ public class ProcessWrapper { private List args; private File dir; private final List stdoutl = new ArrayList(1); private final List stderrl = new ArrayList(1); private String[] vars; private ReactingProcess reactingProcess; public ProcessWrapper() { } public ProcessWrapper(String toBeExecuted, List otherargs, URL u) { this(toBeExecuted, otherargs, u.toString()); } public ProcessWrapper(String toBeExecuted, List otherargs, String s) { Assert.assertNotNull(s); Assert.assertNotNull(toBeExecuted); Assert.assertTrue(toBeExecuted.trim().length() > 1); if (otherargs == null) { otherargs = new ArrayList(1); } List urledArgs = new ArrayList(otherargs); urledArgs.add(0, toBeExecuted); urledArgs.add(s); this.args = urledArgs; this.vars=null; } public ProcessWrapper(String toBeExecuted, List otherargs, URL u, ContentReaderListener stdoutl, ContentReaderListener stderrl, String[] vars) throws Exception { this(toBeExecuted, otherargs, u); this.addStdOutListener(stdoutl); this.addStdErrListener(stderrl); this.vars=vars; } public ProcessWrapper(String toBeExecuted, List otherargs, URL u, List stdoutl, List stderrl, String[] vars) throws Exception { this(toBeExecuted, otherargs, u); this.addStdOutListeners(stdoutl); this.addStdErrListeners(stderrl); this.vars=vars; } ProcessWrapper(final List args, File dir, ContentReaderListener stdoutl, ContentReaderListener stderrl, String[] vars) { this.args = args; this.dir = dir; this.addStdOutListener(stdoutl); this.addStdErrListener(stderrl); this.vars = vars; } public ProcessWrapper(final List args, File dir, List stdoutl, List stderrl, String[] vars) { this.args = args; this.dir = dir; this.addStdOutListeners(stdoutl); this.addStdErrListeners(stderrl); this.vars = vars; } public final void addStdOutListener(ContentReaderListener l) { if (l == null) { return; } stdoutl.add(l); } public final void addStdErrListener(ContentReaderListener l) { if (l == null) { return; } stderrl.add(l); } public final void addStdOutListeners(List l) { if (l == null) { return; } stdoutl.addAll(l); } public final void addStdErrListeners(List l) { if (l == null) { return; } stderrl.addAll(l); } /** * @return the args */ public List getArgs() { return args; } /** * @param args the args to set */ public void setArgs(List args) { this.args = args; } /** * @return the dir */ public File getDir() { return dir; } /** * @param dir the dir to set */ public void setDir(File dir) { this.dir = dir; } /** * @return the stdoutl */ public List getStdoutListeners() { return stdoutl; } /** * @return the stderrl */ public List getStderrListeners() { return stderrl; } /** * @return the vars */ public String[] getVars() { return vars; } /** * @param vars the vars to set */ public void setVars(String[] vars) { this.vars = vars; } public ProcessResult execute() throws Exception { if (reactingProcess !=null ){ reactingProcess.beforeProcess(""); }; ThreadedProcess t = new ThreadedProcess(args, dir, vars); if (ServerAccess.PROCESS_LOG) { String connectionMesaage = createConnectionMessage(t); ServerAccess.log(connectionMesaage, true, true); } ProcessAssasin pa = new ProcessAssasin(t, ServerAccess.PROCESS_TIMEOUT); t.setAssasin(pa); pa.setReactingProcess(reactingProcess); setUpClosingListener(stdoutl, pa, t); setUpClosingListener(stderrl, pa, t); pa.start(); t.start(); while (t.getP() == null && t.deadlyException == null) { Thread.sleep(100); } if (t.deadlyException != null) { pa.setCanRun(false); return new ProcessResult("", "", null, true, Integer.MIN_VALUE, t.deadlyException); } ContentReader crs = new ContentReader(t.getP().getInputStream(), stdoutl); ContentReader cre = new ContentReader(t.getP().getErrorStream(), stderrl); OutputStream out = t.getP().getOutputStream(); if (out != null) { out.close(); } new Thread(crs).start(); new Thread(cre).start(); while (t.isRunning()) { Thread.sleep(100); } while (!t.isDestoyed()) { Thread.sleep(100); } pa.setCanRun(false); // ServerAccess.logOutputReprint(t.getP().exitValue()); when process is killed, this throws exception ProcessResult pr = new ProcessResult(crs.getContent(), cre.getContent(), t.getP(), pa.wasTerminated(), t.getExitCode(), null); if (ServerAccess.PROCESS_LOG) { ServerAccess.log(pr.stdout, true, false); ServerAccess.log(pr.stderr, false, true); } if (reactingProcess != null) { reactingProcess.afterProcess(""); }; return pr; } private static void setUpClosingListener(List listeners, ProcessAssasin pa, ThreadedProcess t) { for (ContentReaderListener listener : listeners) { if (listener != null && (listener instanceof ClosingListener)) { ((ClosingListener) listener).setAssasin(pa); ((ClosingListener) listener).setProcess(t); } } } private static String createConnectionMessage(ThreadedProcess t) { return "Connecting " + t.getCommandLine(); } void setReactingProcess(ReactingProcess reactingProcess) { this.reactingProcess = reactingProcess; } } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/PaxHeaders.17941/ProcessResult.java0000644000000000000000000000013112654402377027516 xustar0030 mtime=1454507263.246432461 30 atime=1454507327.352577496 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/ProcessResult.java0000644000175000002070000000510512654402377030243 0ustar00jvanekmock00000000000000/* ProcessResult.java Copyright (C) 2011,2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp; /** * artefacts what are left by finished process */ public class ProcessResult { public final String stdout; public final String notFilteredStdout; public final String stderr; public final Process process; public final Integer returnValue; public final boolean wasTerminated; /* * possible exception which caused Process not to be launched */ public final Throwable deadlyException; public ProcessResult(String stdout, String stderr, Process process, boolean wasTerminated, Integer r, Throwable deadlyException) { this.notFilteredStdout = stdout; if (stdout == null) { this.stdout = null; } else { this.stdout = stdout.replaceAll("EMMA:.*\n?", ""); } this.stderr = stderr; this.process = process; this.wasTerminated = wasTerminated; this.returnValue = r; this.deadlyException = deadlyException; } } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/PaxHeaders.17941/ProcessAssasin.java0000644000000000000000000000013112654402377027641 xustar0030 mtime=1454507263.246432461 30 atime=1454507327.352577496 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/ProcessAssasin.java0000644000175000002070000002162112654402377030367 0ustar00jvanekmock00000000000000/* ProcessAssasin.java Copyright (C) 2011,2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp; import java.lang.reflect.Field; import java.util.ArrayList; import java.util.List; import net.sourceforge.jnlp.browsertesting.ReactingProcess; /** * class which timeout any ThreadedProcess. This killing of 'thread with * process' replaced not working process.destroy(). */ public class ProcessAssasin extends Thread { long timeout; private final ThreadedProcess p; //false == is disabled:( private boolean canRun = true; private boolean wasTerminated = false; //signifies that assasin have been summoned private volatile boolean killing = false; //signifies that assasin have done its job private volatile boolean killed = false; /** * if this is true, then process is not destroyed after timeout, but just * left to its own destiny. Its stdout/err is no longer recorded, and it is * leaking system resources until it dies by itself The contorl is returned * to main thread with all informations recorded untill now. You will be * able to listen to std out from listeners still */ private boolean skipInstedOfDesroy = false; private ReactingProcess reactingProcess; public ProcessAssasin(ThreadedProcess p, long timeout) { this.p = (p); this.timeout = timeout; } public ProcessAssasin(ThreadedProcess p, long timeout, boolean skipInstedOfDesroy) { this.p = (p); this.timeout = timeout; this.skipInstedOfDesroy = skipInstedOfDesroy; } public void setCanRun(boolean canRun) { this.canRun = canRun; if (p != null) { if (p.getP() != null) { ServerAccess.logNoReprint("Stopping assassin for" + p.toString() + " " + p.getP().toString() + " " + p.getCommandLine() + ": "); } else { ServerAccess.logNoReprint("Stopping assassin for" + p.toString() + " " + p.getCommandLine() + ": "); } } else { ServerAccess.logNoReprint("Stopping assassin for null job: "); } } public boolean isCanRun() { return canRun; } public boolean wasTerminated() { return wasTerminated; } public void setSkipInstedOfDesroy(boolean skipInstedOfDesroy) { this.skipInstedOfDesroy = skipInstedOfDesroy; } public boolean isSkipInstedOfDesroy() { return skipInstedOfDesroy; } void setTimeout(long timeout) { this.timeout = timeout; } @Override public void run() { long startTime = System.nanoTime() / ServerAccess.NANO_TIME_DELIMITER; while (canRun) { try { long time = System.nanoTime() / ServerAccess.NANO_TIME_DELIMITER; //ServerAccess.logOutputReprint(time - startTime); //ServerAccess.logOutputReprint((time - startTime) > timeout); if ((time - startTime) > timeout) { try { if (p != null) { if (p.getP() != null) { ServerAccess.logErrorReprint("Timed out " + p.toString() + " " + p.getP().toString() + " .. killing " + p.getCommandLine() + ": "); } else { ServerAccess.logErrorReprint("Timed out " + p.toString() + " " + "null .. killing " + p.getCommandLine() + ": "); } wasTerminated = true; if (p.getP() != null) { try { if (!skipInstedOfDesroy) { destroyProcess(); } } catch (Throwable ex) { if (p.deadlyException == null) { p.deadlyException = ex; } ex.printStackTrace(); } } p.interrupt(); // while (!ServerAccess.terminated.contains(p)) { // Thread.sleep(100); // } if (p.getP() != null) { ServerAccess.logErrorReprint("Timed out " + p.toString() + " " + p.getP().toString() + " .. killed " + p.getCommandLine()); } else { ServerAccess.logErrorReprint("Timed out " + p.toString() + " null .. killed " + p.getCommandLine()); } } else { ServerAccess.logErrorReprint("Timed out null job"); } break; } finally { p.setDestoyed(true); } } Thread.sleep(100); } catch (Exception ex) { ex.printStackTrace(); } } if (p != null) { if (p.getP() != null) { ServerAccess.logNoReprint("assassin for" + p.toString() + " " + p.getP().toString() + " .. done " + p.getCommandLine() + " termination " + wasTerminated); } else { ServerAccess.logNoReprint("assassin for" + p.toString() + " null .. done " + p.getCommandLine() + " termination " + wasTerminated); } } else { ServerAccess.logNoReprint("assassin for non existing job termination " + wasTerminated); } } public void destroyProcess() { try { killing = true; destroyProcess(p, reactingProcess); } finally { killed = true; } } public boolean haveKilled() { return killed; } public boolean isKilling() { return killing; } public static void destroyProcess(ThreadedProcess pp, ReactingProcess reactingProcess) { Process p = pp.getP(); try { Field f = p.getClass().getDeclaredField("pid"); f.setAccessible(true); String pid = (f.get(p)).toString(); if (reactingProcess != null) { reactingProcess.beforeKill(pid); } // sigInt(pid); sigTerm(pid); // sigKill(pid); } catch (Exception ex) { ServerAccess.logException(ex); } finally { if (reactingProcess != null) { reactingProcess.afterKill(""); } } } public static void sigInt(String pid) throws Exception { kill(pid, "SIGINT"); } public static void sigKill(String pid) throws Exception { kill(pid, "SIGKILL"); } public static void sigTerm(String pid) throws Exception { kill(pid, "SIGTERM"); } public static void kill(String pid, String signal) throws InterruptedException, Exception { List ll = new ArrayList(4); ll.add("kill"); ll.add("-s"); ll.add(signal); ll.add(pid); ServerAccess.executeProcess(ll); //sync, but acctually release //before affected application close Thread.sleep(1000); } void setReactingProcess(ReactingProcess reactingProcess) { this.reactingProcess = reactingProcess; } } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/PaxHeaders.17941/LoggingBottleneck.java0000644000000000000000000000013112654402377030302 xustar0030 mtime=1454507263.245432474 30 atime=1454507327.352577496 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/LoggingBottleneck.java0000644000175000002070000002355712654402377031042 0ustar00jvanekmock00000000000000/* LoggingBottleneck.java Copyright (C) 2011,2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp; import java.io.BufferedWriter; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStreamWriter; import java.io.Writer; import java.lang.reflect.Method; import java.util.Collections; import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; import java.util.Set; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; public class LoggingBottleneck { /** * default singleton */ private static LoggingBottleneck loggingBottleneck; private static final File DEFAULT_LOG_FILE = new File("ServerAccess-logs.xml"); private static final File DEFAULT_STDERR_FILE = new File("stderr.log"); private static final File DEFAULT_STDOUT_FILE = new File("stdout.log"); private static final File DEFAULT_STDLOGS_FILE = new File("all.log"); private static final String LOGS_ELEMENT = "logs"; private static final String CLASSLOG_ELEMENT = "classlog"; private static final String CLASSNAME_ATTRIBUTE = "className"; private static final String TESTLOG_ELEMENT = "testLog"; private static final String TESTMETHOD_ATTRIBUTE = "testMethod"; private static final String FULLID_ATTRIBUTE = "fullId"; private BufferedWriter DEFAULT_STDERR_WRITER; private BufferedWriter DEFAULT_STDOUT_WRITER; private BufferedWriter DEFAULT_STDLOGS_WRITER; /** * This is static copy of name of id of currentBrowser for logging purposes */ private String loggedBrowser = Browsers.none.toString(); /** * map of classes, each have map of methods, each have errorlist, outLIst, and allList (allist contains also not std or err messages) * class.testMethod.logs */ final Map> processLogs = Collections.synchronizedMap(new HashMap>(1000)); private boolean added = false; synchronized public static LoggingBottleneck getDefaultLoggingBottleneck() { if (loggingBottleneck == null) { loggingBottleneck = new LoggingBottleneck(); } return loggingBottleneck; } private LoggingBottleneck() { try { DEFAULT_STDOUT_WRITER = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(DEFAULT_STDOUT_FILE))); DEFAULT_STDERR_WRITER = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(DEFAULT_STDERR_FILE))); DEFAULT_STDLOGS_WRITER = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(DEFAULT_STDLOGS_FILE))); } catch (Throwable t) { t.printStackTrace(); } } synchronized void writeXmlLog() throws FileNotFoundException, IOException { writeXmlLog(DEFAULT_LOG_FILE); } synchronized void writeXmlLog(File f) throws FileNotFoundException, IOException { writeXmlLog(f, Collections.unmodifiableMap(processLogs)); } synchronized static void writeXmlLog(File f, Map> processLogs) throws FileNotFoundException, IOException { Writer w = new OutputStreamWriter(new FileOutputStream(f)); Set>> classes = processLogs.entrySet(); w.write("<" + LOGS_ELEMENT + ">"); for (Entry> classLog : classes) { String className = classLog.getKey(); w.write("<" + CLASSLOG_ELEMENT + " " + CLASSNAME_ATTRIBUTE + "=\"" + className + "\">"); Set> testsLogs = classLog.getValue().entrySet(); for (Entry testLog : testsLogs) { String testName = testLog.getKey(); String testLogs = testLog.getValue().toString(); w.write("<" + TESTLOG_ELEMENT + " " + TESTMETHOD_ATTRIBUTE + "=\"" + testName + "\" " + FULLID_ATTRIBUTE + "=\"" + className + "." + testName + "\" >"); w.write(clearChars(testLogs)); w.write(""); } w.write(""); } w.write(""); w.flush(); w.close(); } synchronized void addToXmlLog(String message, boolean printToOut, boolean printToErr, StackTraceElement ste) { Map classLog = processLogs.get(ste.getClassName()); if (classLog == null) { classLog = new HashMap(50); processLogs.put(ste.getClassName(), classLog); } String methodBrowseredName = ste.getMethodName(); methodBrowseredName = modifyMethodWithForBrowser(methodBrowseredName, ste.getClassName()); TestsLogs methodLog = classLog.get(methodBrowseredName); if (methodLog == null) { methodLog = new TestsLogs(); classLog.put(methodBrowseredName, methodLog); } if (!added) { Runtime.getRuntime().addShutdownHook(new Thread() { @Override public void run() { try { LoggingBottleneck.getDefaultLoggingBottleneck().writeXmlLog(); } catch (Exception ex) { ex.printStackTrace(); } } }); added = true; } methodLog.add(printToErr, printToOut, message); } synchronized public String modifyMethodWithForBrowser(String methodBrowseredName, String className) { try { Class clazz = Class.forName(className); /* * By using this isAssignable to ensure corect class before invocation, * then we lost possibility to track manualy set browsers, but it is correct, * as method description is set only when annotation is used */ if (clazz != null && BrowserTest.class.isAssignableFrom(clazz)) { Method testMethod = clazz.getMethod(methodBrowseredName); if (testMethod != null) { TestInBrowsers tib = testMethod.getAnnotation(TestInBrowsers.class); if (tib != null) { methodBrowseredName = methodBrowseredName + " - " + loggedBrowser; } } } } catch (Throwable ex) { ex.printStackTrace(); } return methodBrowseredName; } synchronized public void setLoggedBrowser(String loggedBrowser) { this.loggedBrowser = loggedBrowser; } synchronized public void logIntoPlaintextLog(String message, boolean printToOut, boolean printToErr) { try { if (printToOut) { LoggingBottleneck.getDefaultLoggingBottleneck().stdout(message); } if (printToErr) { LoggingBottleneck.getDefaultLoggingBottleneck().stderr(message); } LoggingBottleneck.getDefaultLoggingBottleneck().stdeall(message); } catch (Throwable t) { t.printStackTrace(); } } private void stdout(String idded) throws IOException { DEFAULT_STDOUT_WRITER.write(idded); DEFAULT_STDOUT_WRITER.newLine(); DEFAULT_STDOUT_WRITER.flush(); } private void stderr(String idded) throws IOException { DEFAULT_STDERR_WRITER.write(idded); DEFAULT_STDERR_WRITER.newLine(); DEFAULT_STDERR_WRITER.flush(); } private void stdeall(String idded) throws IOException { DEFAULT_STDLOGS_WRITER.write(idded); DEFAULT_STDLOGS_WRITER.newLine(); DEFAULT_STDLOGS_WRITER.flush(); } synchronized public static String clearChars(String ss) { StringBuilder s = new StringBuilder(ss); for (int i = 0; i < s.length(); i++) { char q = s.charAt(i); if (q == '\n') { continue; } if (q == '\t') { continue; } int iq = (int) q; if ((iq <= 31 || iq > 65533)||(iq >= 64976 && iq <= 65007)) { s.setCharAt(i, 'I'); s.insert(i + 1, "NVALID_CHAR_" + iq); i--; } } return s.toString(); } } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/PaxHeaders.17941/LogItem.java0000644000000000000000000000013112654402377026241 xustar0030 mtime=1454507263.245432474 30 atime=1454507327.352577496 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/LogItem.java0000644000175000002070000000601012654402377026762 0ustar00jvanekmock00000000000000/* LogItem.java Copyright (C) 2011,2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp; import java.util.Date; class LogItem { public final Date timeStamp = new Date(); public final StackTraceElement[] fullTrace = Thread.currentThread().getStackTrace(); public final String text; private static final String ITEM_ELEMENT = "item"; private static final String ITEM_ID_ATTRIBUTE = "id"; private static final String STAMP_ELEMENT = "stamp"; private static final String TEXT_ELEMENT = "text"; private static final String FULLTRACE_ELEMENT = "fulltrace"; public LogItem(String text) { this.text = text; } public StringBuilder toStringBuilder(int id) { StringBuilder sb = new StringBuilder(); sb.append(" <" + ITEM_ELEMENT + " " + ITEM_ID_ATTRIBUTE + "=\"").append(id).append("\">\n"); sb.append(" <" + STAMP_ELEMENT + ">\n"); sb.append(" <" + TEXT_ELEMENT + ">\n"); sb.append(" <" + FULLTRACE_ELEMENT + "> \n"); sb.append(" \n"); return sb; } } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/PaxHeaders.17941/ContentReaderListener.0000644000000000000000000000013112654402377030302 xustar0030 mtime=1454507263.245432474 30 atime=1454507327.352577496 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/ContentReaderListener.java0000644000175000002070000000341512654402377031673 0ustar00jvanekmock00000000000000/* ContentReaderListener.java Copyright (C) 2011,2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp; public interface ContentReaderListener { public void charReaded(char ch); public void lineReaded(String s); } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/PaxHeaders.17941/ContentReader.java0000644000000000000000000000013112654402377027436 xustar0030 mtime=1454507263.244432488 30 atime=1454507327.351577509 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/ContentReader.java0000644000175000002070000001260312654402377030164 0ustar00jvanekmock00000000000000/* ContentReader.java Copyright (C) 2011,2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import java.util.ArrayList; import java.util.List; /** * Class to read content of stdout/stderr of process, and to cooperate with its * running/terminated/finished statuses. */ class ContentReader implements Runnable { StringBuilder sb = new StringBuilder(); private final InputStream is; private boolean done; final List listeners = new ArrayList(1); public String getContent() { return sb.toString(); } public ContentReader(InputStream is) throws IOException { this.is = is; } public ContentReader(InputStream is, ContentReaderListener l) throws IOException { this.is = is; if (l != null) { this.listeners.add(l); } } public ContentReader(InputStream is, List l) throws IOException { this.is = is; if (l != null) { this.listeners.addAll(l); } } public void addListener(ContentReaderListener listener) { this.listeners.add(listener); } public List getListener() { return listeners; } /** * Blocks until the copy is complete, or until the thread is interrupted */ public synchronized void waitUntilDone() throws InterruptedException { boolean interrupted = false; // poll interrupted flag, while waiting for copy to complete while (!(interrupted = Thread.interrupted()) && !done) { wait(1000); } if (interrupted) { ServerAccess.logNoReprint("Stream copier: throwing InterruptedException"); //throw new InterruptedException(); } } @Override public void run() { try { Reader br = new InputStreamReader(is, "UTF-8"); StringBuilder line = new StringBuilder(); while (true) { int s = br.read(); if (s < 0) { if (line.length() > 0 && listeners != null) { for (ContentReaderListener listener : listeners) { if (listener != null) { listener.lineReaded(line.toString()); } } } break; } char ch = (char) s; sb.append(ch); line.append(ch); if (ch == '\n') { if (listeners != null) { for (ContentReaderListener listener : listeners) { if (listener != null) { listener.lineReaded(line.toString()); } } } line = new StringBuilder(); } if (listeners != null) { for (ContentReaderListener listener : listeners) { if (listener != null) { listener.charReaded(ch); } } } } } catch (NullPointerException ex) { ex.printStackTrace(); } //do not want to bother output with terminations //mostly compaling when assassin kill the process about StreamClosed catch (Exception ex) { // logException(ex); //ex.printStackTrace(); } finally { try { is.close(); } catch (Exception ex) { // ex.printStackTrace(); } finally { done = true; } } } } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/PaxHeaders.17941/ClosingListener.java0000644000000000000000000000013112654402377030005 xustar0030 mtime=1454507263.244432488 30 atime=1454507327.351577509 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/ClosingListener.java0000644000175000002070000000402012654402377030525 0ustar00jvanekmock00000000000000/* ClosingListener.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp; public abstract class ClosingListener implements ContentReaderListener { private ThreadedProcess process; private ProcessAssasin assasin; void setProcess(ThreadedProcess p) { this.process = p; } void setAssasin(ProcessAssasin assasin) { this.assasin = assasin; } public void terminate() { assasin.setTimeout(Long.MIN_VALUE); } } icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/PaxHeaders.17941/AsyncCall.java0000644000000000000000000000013112654402377026552 xustar0030 mtime=1454507263.244432488 30 atime=1454507327.351577509 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions/net/sourceforge/jnlp/AsyncCall.java0000644000175000002070000000612112654402377027276 0ustar00jvanekmock00000000000000package net.sourceforge.jnlp; import java.util.concurrent.Callable; /** * A call that runs on a separate thread, with an optional timeout. It takes a runnable and allows * joining. * * On join, throws any exceptions that occurred within the call, or a TimeOutException if * it did not finish. Returns the value from the call. */ public class AsyncCall { static public class TimeOutException extends RuntimeException { public TimeOutException() { super("Call did not finish within the allocated time."); } } private Thread handler; private Callable callable; private long timeout; private T callResult; /* Captures exception from async call */ private Exception asyncException = null; /* Create an AsyncCall with a given time-out */ public AsyncCall(Callable callable, long timeout) { this.callable = callable; this.timeout = timeout; this.handler = new HandlerThread(); } /* Create an AsyncCall with (effectively) no time-out */ public AsyncCall(Callable call) { this(call, Long.MAX_VALUE); } /* Chains construction + start for convenience */ public static AsyncCall startWithTimeOut(Callable callable, long timeout) { AsyncCall asyncCall = new AsyncCall(callable, timeout); asyncCall.start(); return asyncCall; } /* Chains construction + start for convenience */ public static AsyncCall startWithTimeOut(Callable callable) { return startWithTimeOut(callable, 1000); // Default timeout of 1 second } public void start() { this.handler.start(); } // Rethrows exceptions from handler thread, and throws TimeOutException in case of time-out. public T join() throws Exception { handler.join(); if (asyncException != null) { throw asyncException; } return callResult; } /* The handler thread is responsible for timing-out the Callable thread. * The resulting thread */ private class HandlerThread extends Thread { @Override public void run() { Thread thread = new Thread() { @Override public void run() { try { /* Capture result of the call */ callResult = callable.call(); } catch (Exception e) { /* In case of exception, capture for re-throw */ asyncException = e; } handler.interrupt(); // Finish early } }; thread.start(); try { Thread.sleep(timeout); } catch (InterruptedException e) { // Finish early return; } if (thread.isAlive()) { asyncException = new TimeOutException(); } // Make sure the thread is finished while (thread.isAlive()) { thread.interrupt(); } } } } icedtea-web-1.6.2/tests/PaxHeaders.17941/test-extensions-tests0000644000000000000000000000013112654402377021045 xustar0030 mtime=1454507263.242432514 30 atime=1454507658.776157397 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions-tests/0000755000175000002070000000000012654402377021646 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/test-extensions-tests/PaxHeaders.17941/net0000644000000000000000000000013112654402377021633 xustar0030 mtime=1454507263.242432514 30 atime=1454507658.776157397 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions-tests/net/0000755000175000002070000000000012654402377022434 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/test-extensions-tests/net/PaxHeaders.17941/sourceforge0000644000000000000000000000013112654402377024156 xustar0030 mtime=1454507263.242432514 30 atime=1454507658.776157397 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions-tests/net/sourceforge/0000755000175000002070000000000012654402377024757 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/test-extensions-tests/net/sourceforge/PaxHeaders.17941/jnlp0000644000000000000000000000013112654402377025121 xustar0030 mtime=1454507263.243432501 30 atime=1454507658.776157397 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions-tests/net/sourceforge/jnlp/0000755000175000002070000000000012654402377025722 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/test-extensions-tests/net/sourceforge/jnlp/PaxHeaders.17941/tools0000644000000000000000000000013112654402377026261 xustar0030 mtime=1454507263.243432501 30 atime=1454507658.776157397 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions-tests/net/sourceforge/jnlp/tools/0000755000175000002070000000000012654402377027062 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/test-extensions-tests/net/sourceforge/jnlp/tools/PaxHeaders.17941/Deployment0000644000000000000000000000032112654402377030402 xustar00120 path=icedtea-web-1.6.2/tests/test-extensions-tests/net/sourceforge/jnlp/tools/DeploymentPropertiesModifierTest.java 30 mtime=1454507263.243432501 30 atime=1454507327.351577509 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions-tests/net/sourceforge/jnlp/tools/DeploymentPropertiesModifie0000644000175000002070000002435112654402377034504 0ustar00jvanekmock00000000000000/* Copyright (C) 2015 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.tools; import static org.junit.Assert.assertEquals; import java.io.File; import java.io.IOException; import java.util.AbstractMap; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.config.InfrastructureFileDescriptor; import net.sourceforge.jnlp.runtime.ManifestAttributesChecker; import net.sourceforge.jnlp.security.appletextendedsecurity.AppletSecurityLevel; import net.sourceforge.jnlp.util.FileUtils; import org.junit.Assert; import org.junit.Test; public class DeploymentPropertiesModifierTest { private File deploymentFile; @Test public void testSetProperties() throws IOException { File tempUserFile = File.createTempFile("userDeploy", ""); tempUserFile.deleteOnExit(); deploymentFile = tempUserFile; DummyInfrastructureFileDescriptor deploymentInfrastructure = new DummyInfrastructureFileDescriptor(deploymentFile); String properties = FileUtils.loadFileAsString(deploymentFile); assertEquals(0, properties.length()); DeploymentPropertiesModifier dpm = new DeploymentPropertiesModifier(deploymentInfrastructure); dpm.setProperties(DeploymentConfiguration.KEY_SECURITY_LEVEL, AppletSecurityLevel.ALLOW_UNSIGNED.toChars()); String setProperty = DeploymentConfiguration.KEY_SECURITY_LEVEL + "=" + AppletSecurityLevel.ALLOW_UNSIGNED.toChars() + "\n"; properties = FileUtils.loadFileAsString(deploymentFile); assertEquals(setProperty, properties); } @Test public void testRestoreProperties() throws IOException { File tempUserFile = File.createTempFile("userDeploy", ""); tempUserFile.deleteOnExit(); deploymentFile = tempUserFile; DummyInfrastructureFileDescriptor deploymentInfrastructure = new DummyInfrastructureFileDescriptor(deploymentFile); String properties = FileUtils.loadFileAsString(deploymentFile); assertEquals(0, properties.length()); DeploymentPropertiesModifier dpm = new DeploymentPropertiesModifier(deploymentInfrastructure); dpm.setProperties(DeploymentConfiguration.KEY_SECURITY_LEVEL, AppletSecurityLevel.ALLOW_UNSIGNED.toChars()); String setProperty = DeploymentConfiguration.KEY_SECURITY_LEVEL + "=" + AppletSecurityLevel.ALLOW_UNSIGNED.toChars() + "\n"; properties = FileUtils.loadFileAsString(deploymentFile); assertEquals(setProperty, properties); dpm.restoreProperties(); properties = FileUtils.loadFileAsString(deploymentFile); assertEquals(0, properties.length()); } @Test(expected = IllegalStateException.class) public void testRestorePropertiesRequiresPropertiesSetFirst() throws IOException { File tempUserFile = File.createTempFile("userDeploy", ""); tempUserFile.deleteOnExit(); deploymentFile = tempUserFile; DummyInfrastructureFileDescriptor deploymentInfrastructure = new DummyInfrastructureFileDescriptor(deploymentFile); DeploymentPropertiesModifier dpm = new DeploymentPropertiesModifier(deploymentInfrastructure); dpm.restoreProperties(); String properties = FileUtils.loadFileAsString(deploymentFile); assertEquals(0, properties.length()); } @Test (expected = IllegalStateException.class) public void testUsingSameDeploymentPropertiesModifierThrowsException() throws IOException { File tempUserFile = File.createTempFile("userDeploy", ""); tempUserFile.deleteOnExit(); deploymentFile = tempUserFile; DummyInfrastructureFileDescriptor deploymentInfrastructure = new DummyInfrastructureFileDescriptor(deploymentFile); DeploymentPropertiesModifier dpm = new DeploymentPropertiesModifier(deploymentInfrastructure); dpm.setProperties(DeploymentConfiguration.KEY_SECURITY_LEVEL, AppletSecurityLevel.ALLOW_UNSIGNED.toChars()); try { dpm.setProperties(DeploymentConfiguration.KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK, ManifestAttributesChecker.MANIFEST_ATTRIBUTES_CHECK.PERMISSIONS.toString()); } catch (IllegalStateException ise) { dpm.restoreProperties(); throw new IllegalStateException(); } } @Test public void testUsingDifferentDeploymentPropertiesModifier() throws IOException { File tempUserFile = File.createTempFile("userDeploy", ""); tempUserFile.deleteOnExit(); deploymentFile = tempUserFile; DummyInfrastructureFileDescriptor deploymentInfrastructure = new DummyInfrastructureFileDescriptor(deploymentFile); DeploymentPropertiesModifier dpm1 = new DeploymentPropertiesModifier(deploymentInfrastructure); DeploymentPropertiesModifier dpm2 = new DeploymentPropertiesModifier(deploymentInfrastructure); dpm1.setProperties(DeploymentConfiguration.KEY_SECURITY_LEVEL, AppletSecurityLevel.ALLOW_UNSIGNED.toChars()); dpm2.setProperties(DeploymentConfiguration.KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK, ManifestAttributesChecker.MANIFEST_ATTRIBUTES_CHECK.PERMISSIONS.toString()); String contents = DeploymentConfiguration.KEY_SECURITY_LEVEL + "=" + AppletSecurityLevel.ALLOW_UNSIGNED.toChars() + "\n" + DeploymentConfiguration.KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK + "=" + ManifestAttributesChecker.MANIFEST_ATTRIBUTES_CHECK.PERMISSIONS.toString() + "\n"; String properties = FileUtils.loadFileAsString(deploymentFile); assertEquals(contents, properties); dpm2.restoreProperties(); dpm1.restoreProperties(); } @Test public void testMultipleDeploymentPropertiesModifier() throws IOException { File tempUserFile = File.createTempFile("userDeploy", ""); tempUserFile.deleteOnExit(); String content = "a.b=12\nc.d=34\ne.f=56\ng.h=78\ni.j=90"; FileUtils.saveFile(content, tempUserFile); deploymentFile = tempUserFile; DummyInfrastructureFileDescriptor deploymentInfrastructure = new DummyInfrastructureFileDescriptor(deploymentFile); DeploymentPropertiesModifier.MultipleDeploymentPropertiesModifier dpm1 = new DeploymentPropertiesModifier.MultipleDeploymentPropertiesModifier(deploymentInfrastructure, new AbstractMap.SimpleEntry<>("c.d", "22"), new AbstractMap.SimpleEntry<>("i.j", "44") ); dpm1.setProperties(); String propertiesChanged = FileUtils.loadFileAsString(deploymentFile); Assert.assertNotEquals(content, propertiesChanged); Assert.assertTrue(propertiesChanged.contains("12")); Assert.assertFalse(propertiesChanged.contains("34")); Assert.assertTrue(propertiesChanged.contains("22")); Assert.assertTrue(propertiesChanged.contains("56")); Assert.assertTrue(propertiesChanged.contains("78")); Assert.assertFalse(propertiesChanged.contains("90")); Assert.assertTrue(propertiesChanged.contains("44")); Assert.assertTrue(propertiesChanged.contains("a.b")); Assert.assertTrue(propertiesChanged.contains("c.d")); Assert.assertTrue(propertiesChanged.contains("e.f")); Assert.assertTrue(propertiesChanged.contains("g.h")); Assert.assertTrue(propertiesChanged.contains("i.j")); dpm1.restoreProperties(); String propertiesResored = FileUtils.loadFileAsString(deploymentFile); Assert.assertNotEquals(content, propertiesChanged); Assert.assertTrue(propertiesResored.contains("12")); Assert.assertTrue(propertiesResored.contains("34")); Assert.assertFalse(propertiesResored.contains("22")); Assert.assertTrue(propertiesResored.contains("56")); Assert.assertTrue(propertiesResored.contains("78")); Assert.assertTrue(propertiesResored.contains("90")); Assert.assertFalse(propertiesResored.contains("44")); Assert.assertTrue(propertiesResored.contains("a.b")); Assert.assertTrue(propertiesResored.contains("c.d")); Assert.assertTrue(propertiesResored.contains("e.f")); Assert.assertTrue(propertiesResored.contains("g.h")); Assert.assertTrue(propertiesResored.contains("i.j")); // /n at the end of last line may not matter assertEquals(content.trim(), propertiesResored.trim()); } private static class DummyInfrastructureFileDescriptor extends InfrastructureFileDescriptor { private final File file; private DummyInfrastructureFileDescriptor(File file) { super(); this.file = file; } @Override public File getFile() { return file; } @Override public String getFullPath() { return file.getAbsolutePath(); } } } icedtea-web-1.6.2/tests/test-extensions-tests/net/sourceforge/jnlp/PaxHeaders.17941/awt0000644000000000000000000000013112654402377025714 xustar0030 mtime=1454507263.243432501 30 atime=1454507658.776157397 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions-tests/net/sourceforge/jnlp/awt/0000755000175000002070000000000012654402377026515 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/test-extensions-tests/net/sourceforge/jnlp/awt/PaxHeaders.17941/imagesearch0000644000000000000000000000013112654402377030164 xustar0030 mtime=1454507263.243432501 30 atime=1454507658.776157397 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions-tests/net/sourceforge/jnlp/awt/imagesearch/0000755000175000002070000000000012654402377030765 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/test-extensions-tests/net/sourceforge/jnlp/awt/imagesearch/PaxHeaders.17941/0000644000000000000000000000031612654402377030250 xustar00117 path=icedtea-web-1.6.2/tests/test-extensions-tests/net/sourceforge/jnlp/awt/imagesearch/ComponentFinderTest.java 30 mtime=1454507263.243432501 30 atime=1454507327.351577509 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions-tests/net/sourceforge/jnlp/awt/imagesearch/ComponentFinderTe0000644000175000002070000000412412654402377034274 0ustar00jvanekmock00000000000000/* ComponentFinderTest.java Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.awt.imagesearch; import java.awt.image.BufferedImage; import org.junit.Assert; import org.junit.Test; /** * * This class is a part of AWTFramework, contains component finding * by searching for icons. * */ public class ComponentFinderTest { @Test public void initialiseDefaultIcon() { BufferedImage icon = ComponentFinder.defaultIcon; Assert.assertNotNull("The default icon marker.png was not initialized.", icon); } } icedtea-web-1.6.2/tests/test-extensions-tests/net/sourceforge/jnlp/PaxHeaders.17941/TinyHttpdImplTes0000644000000000000000000000013112654402377030346 xustar0030 mtime=1454507263.243432501 30 atime=1454507327.350577523 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions-tests/net/sourceforge/jnlp/TinyHttpdImplTest.java0000644000175000002070000002361612654402377032206 0ustar00jvanekmock00000000000000package net.sourceforge.jnlp; import java.io.BufferedReader; import java.io.DataOutputStream; import java.io.File; import java.io.IOException; import java.io.InputStreamReader; import java.net.ServerSocket; import java.net.Socket; import java.net.URLDecoder; import java.nio.file.Files; import java.util.regex.Matcher; import java.util.regex.Pattern; import org.junit.Assert; import org.junit.Test; public class TinyHttpdImplTest { private static final String HTTP_OK = "HTTP/1.0 200 OK"; private static final String HTTP_404 = "HTTP/1.0 404 Not Found"; private static final String HTTP_501 = "HTTP/1.0 501 Not Implemented"; private static final String CONTENT_JNLP = "Content-Type: application/x-java-jnlp-file"; private static final String CONTENT_HTML = "Content-Type: text/html"; private static final String CONTENT_JAR = "Content-Type: application/x-jar"; private static final Pattern CONTENT_LENGTH = Pattern.compile("Content-Length:([0-9]+)"); private static final String[] FilePathTestUrls = { "/foo.html", "/foo/", "/foo/bar.jar", "/foo/bar.jar;path_param", "/foo/bar.jar%3Bpath_param", "/foo/bar?query=string&red=hat" }; private static BufferedReader mReader; private static DataOutputStream mWriter; private static TinyHttpdImpl mServer; static { try { ServerSocket sSocket = new ServerSocket(44322); sSocket.setReuseAddress(true); File dir = new File(System.getProperty("test.server.dir")); Socket extSock = new Socket("localhost", 44322); extSock.setReuseAddress(true); mServer = new TinyHttpdImpl(extSock, dir); Socket socket = sSocket.accept(); socket.setReuseAddress(true); mReader = new BufferedReader(new InputStreamReader(socket.getInputStream())); mWriter = new DataOutputStream(socket.getOutputStream()); } catch (Exception ex) { ex.printStackTrace(); } } @Test public void urlToFilePathTest() throws Exception { for (String url : FilePathTestUrls) { String newUrl = TinyHttpdImpl.urlToFilePath(url); Assert.assertFalse("File path should not contain query string: " + newUrl, newUrl.contains("?")); Assert.assertTrue("File path should be relative: " + newUrl, newUrl.startsWith("./")); Assert.assertFalse("File path should not contain \"/XslowX\":" + newUrl, newUrl.toLowerCase().contains("/XslowX".toLowerCase())); if (url.endsWith("/")) { Assert.assertTrue(newUrl.endsWith("/index.html")); } } } @Test public void urlToFilePathUrlDecodeTest() throws Exception { // This test may fail with strange original URLs, eg those containing the substring "%253B", // which can be decoded into "%3B", then decoded again into ';'. for (String url : FilePathTestUrls) { String newUrl = TinyHttpdImpl.urlToFilePath(url); Assert.assertEquals(newUrl, URLDecoder.decode(newUrl, "UTF-8")); } } @Test public void stripHttpPathParamTest() { String[] testBaseUrls = { "http://foo.com/bar", "localhost:8080", "https://bar.co.uk/site;para/baz?u=param1&v=param2" }; String[] testJarNames = { "jar", "foo.jar", "bar;baz.jar", "nom.jar;", "rhat.jar.pack.gz;tag" }; for (String url : testBaseUrls) { for (String jar : testJarNames) { String newUrl = TinyHttpdImpl.stripHttpPathParams(url), newJar = TinyHttpdImpl.stripHttpPathParams(jar), path = newUrl + "/" + newJar; Assert.assertTrue("Base URL should not have been modified: " + url + " => " + newUrl, newUrl.equals(url)); Assert.assertTrue("JAR name should not be altered other than removing path param: " + jar + " => " + newJar, jar.startsWith(newJar)); Assert.assertTrue("New path should be a substring of old path: " + path + " => " + url + "/" + jar, (url + "/" + jar).startsWith(path)); } } } private void headTestHelper(String request, String contentType) { Matcher matcher = CONTENT_LENGTH.matcher(request); Assert.assertTrue("Status should have been " + HTTP_OK, request.contains(HTTP_OK)); Assert.assertTrue("Content type should have been " + contentType, request.contains(contentType)); Assert.assertTrue("Should have had a content length", matcher.find()); } @Test public void JnlpHeadTest() throws IOException, InterruptedException { String head = getTinyHttpdImplResponse("HEAD", "/simpletest1.jnlp"); headTestHelper(head, CONTENT_JNLP); } @Test public void HtmlHeadTest() throws Exception { String head = getTinyHttpdImplResponse("HEAD", "/StripHttpPathParams.html"); headTestHelper(head, CONTENT_HTML); } @Test public void JarHeadTest() throws Exception { String head = getTinyHttpdImplResponse("HEAD", "/StripHttpPathParams.jar"); headTestHelper(head, CONTENT_JAR); } @Test public void PngHeadTest() throws Exception { // TinyHttpdImpl doesn't recognize PNG type - default content type should be HTML String head = getTinyHttpdImplResponse("HEAD", "/netxPlugin.png"); headTestHelper(head, CONTENT_HTML); } @Test public void testLastModifiedHeader() throws IOException, InterruptedException { mServer.setSupportLastModified(true); String head = getTinyHttpdImplResponse("HEAD", "/simpletest1.jnlp"); headTestHelper(head, CONTENT_JNLP); Assert.assertTrue(head.contains("Last-Modified: ")); mServer.setSupportLastModified(false); } @Test public void testLastModifiedHeaderNotIncluded() throws IOException, InterruptedException { mServer.setSupportLastModified(false); String head = getTinyHttpdImplResponse("HEAD", "/simpletest1.jnlp"); headTestHelper(head, CONTENT_JNLP); Assert.assertTrue(!head.contains("Last-Modified: ")); } @Test public void SlowSendTest() throws Exception { // This test is VERY SLOW due to the extremely slow sending speed TinyHttpdImpl uses when XslowX is specified. // Running time will be over two minutes. long fastStartTime = System.nanoTime(); String req1 = getTinyHttpdImplResponse("GET", "/simpletest1.jnlp"); long fastElapsed = System.nanoTime() - fastStartTime; long slowStartTime = System.nanoTime(); String req2 = getTinyHttpdImplResponse("GET", "/XslowXsimpletest1.jnlp"); long slowElapsed = System.nanoTime() - slowStartTime; Assert.assertTrue("Slow request should have returned the same data as normal request", req1.equals(req2)); // This isn't a very good test since as it is, getTinyHttpdImpl is slowing down its receive rate to // deal with the reduced sending rate. It is hardcoded to be slower. Assert.assertTrue("Slow request should have taken longer than normal request", slowElapsed > fastElapsed); } @Test public void GetTest() throws Exception { String jnlpHead = getTinyHttpdImplResponse("HEAD", "/simpletest1.jnlp"); String jnlpGet = getTinyHttpdImplResponse("GET", "/simpletest1.jnlp"); Assert.assertTrue("GET status should be " + HTTP_OK, jnlpGet.contains(HTTP_OK)); Assert.assertTrue("GET content type should have been " + CONTENT_JNLP, jnlpGet.contains(CONTENT_JNLP)); Assert.assertTrue("GET response should contain HEAD response", jnlpGet.contains(jnlpHead)); Assert.assertTrue("GET response should have been longer than HEAD response", jnlpGet.length() > jnlpHead.length()); } @Test public void Error404DoesNotCauseShutdown() throws Exception { // Pre-refactoring, 404 errors were sent after catching an IOException when trying to open the requested // resource. However this was caught by a try/catch clause around the entire while loop, so a 404 would // shut down the server. String firstRequest = getTinyHttpdImplResponse("HEAD", "/no_such_file"); String secondRequest = getTinyHttpdImplResponse("HEAD", "/simpletest1.jnlp"); Assert.assertTrue("First request should have been " + HTTP_404, firstRequest.trim().equals(HTTP_404)); Assert.assertTrue("Second request should have been " + HTTP_OK, secondRequest.contains(HTTP_OK)); } @Test public void NotSupportingHeadRequest() throws Exception { boolean headRequestSupport = mServer.isSupportingHeadRequest(); mServer.setSupportingHeadRequest(false); String head = getTinyHttpdImplResponse("HEAD", "/simpletest1.jnlp"); Assert.assertTrue("Status should have been " + HTTP_501, head.trim().equals(HTTP_501)); mServer.setSupportingHeadRequest(headRequestSupport); } private String getTinyHttpdImplResponse(String requestType, String filePath) throws IOException, InterruptedException { if (!filePath.startsWith("/")) { filePath = "/" + filePath; } mWriter.writeBytes(requestType + " " + filePath + " HTTP/1.1\r\n"); Thread.sleep(250); // Wait a while for server to be able to respond to request StringBuilder builder = new StringBuilder(); while (mReader.ready()) { // TODO: come up with a better way to deal with slow sending - this works but is hackish if (filePath.startsWith("/XslowX")) { Thread.sleep(2100); // Wait for next chunk to have been sent, otherwise it'll appear as if the response // has finished being sent prematurely } builder.append(mReader.readLine()); builder.append("\n"); } return builder.toString(); } } icedtea-web-1.6.2/tests/test-extensions-tests/net/sourceforge/jnlp/PaxHeaders.17941/ServerAccessTest0000644000000000000000000000013112654402377030351 xustar0030 mtime=1454507263.242432514 30 atime=1454507327.350577523 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions-tests/net/sourceforge/jnlp/ServerAccessTest.java0000644000175000002070000002474312654402377032027 0ustar00jvanekmock00000000000000/* ServerAccessTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp; import java.io.File; import java.io.FileInputStream; import java.net.HttpURLConnection; import java.net.URL; import java.net.URLConnection; import org.junit.Assert; import org.junit.Test; /** * * This class provides access to virtual server and stuff around. * It can find unoccupied port, start server, provides its singleton instantiation, lunch parallel instantiations, * read location of installed (tested javaws) see javaws.build.bin java property, * location of server www root on file system (see test.server.dir java property), * stubs for lunching javaws and for locating resources and read resources. * * It can also execute processes with timeout (@see PROCESS_TIMEOUT) (used during lunching javaws) * Some protected apis are exported because public classes in this package are put to be tested by makefile. * * There are included test cases which show some basic usages. * * */ public class ServerAccessTest { ServerAccess serverAccess = new ServerAccess(); @Test public void testsProcessResultFiltering() throws Exception { ProcessResult pn = new ProcessResult(null, null, null, true, 0, null); Assert.assertNull(pn.notFilteredStdout); Assert.assertNull(pn.stdout); Assert.assertNull(pn.stderr); String fakeOut2 = "EMMA: processing instrumentation path ...\n" + "EMMA: package [net.sourceforge.filebrowser] contains classes [ArrayOfString] without full debug info\n" + "EMMA: instrumentation path processed in 1407 ms\n" + "test stage 1\n" + "test stage 2\n" + "EMMA: The intruder!\n" + "test stage 3\n" + "EMMA: [45 class(es) instrumented, 13 resource(s) copied]\n" + "EMMA: metadata merged into [icedtea-web/inc] {in 105 ms}\n" + "EMMA: processing instrumentation path ..."; String filteredOut2 = "test stage 1\n" + "test stage 2\n" + "test stage 3\n"; ProcessResult p2 = new ProcessResult(fakeOut2, fakeOut2, null, true, 0, null); Assert.assertEquals(p2.notFilteredStdout, fakeOut2); Assert.assertEquals(p2.stdout, filteredOut2); Assert.assertEquals(p2.stderr, fakeOut2); fakeOut2 += "\n"; p2 = new ProcessResult(fakeOut2, fakeOut2, null, true, 0, null); Assert.assertEquals(p2.notFilteredStdout, fakeOut2); Assert.assertEquals(p2.stdout, filteredOut2); Assert.assertEquals(p2.stderr, fakeOut2); String fakeOut = "test string\n" + "EMMA: processing instrumentation path ...\n" + "EMMA: package [net.sourceforge.filebrowser] contains classes [ArrayOfString] without full debug info\n" + "EMMA: instrumentation path processed in 1407 ms\n" + "test stage 1\n" + "test stage 2\n" + "test stage 3\n" + "EMMA: [45 class(es) instrumented, 13 resource(s) copied]\n" + "EMMA: metadata merged into [icedtea-web/inc] {in 105 ms}\n" + "EMMA: processing instrumentation path ...\n" + "test ends"; String filteredOut = "test string\n" + "test stage 1\n" + "test stage 2\n" + "test stage 3\n" + "test ends"; ProcessResult p = new ProcessResult(fakeOut, fakeOut, null, true, 0, null); Assert.assertEquals(p.notFilteredStdout, fakeOut); Assert.assertEquals(p.stdout, filteredOut); Assert.assertEquals(p.stderr, fakeOut); fakeOut += "\n"; filteredOut += "\n"; p = new ProcessResult(fakeOut, fakeOut, null, true, 0, null); Assert.assertEquals(p.notFilteredStdout, fakeOut); Assert.assertEquals(p.stdout, filteredOut); Assert.assertEquals(p.stderr, fakeOut); } @Test public void ensureJavaws() throws Exception { String javawsValue = serverAccess.getJavawsLocation(); Assert.assertNotNull(javawsValue); Assert.assertTrue(javawsValue.trim().length() > 2); File javawsFile = serverAccess.getJavawsFile(); Assert.assertTrue(javawsFile.exists()); Assert.assertFalse(javawsFile.isDirectory()); } @Test public void ensureServer() throws Exception { ServerLauncher server = ServerAccess.getInstance(); Assert.assertNotNull(server.getPort()); Assert.assertNotNull(server.getDir()); Assert.assertTrue(server.getPort() > 999); Assert.assertTrue(server.getDir().toString().trim().length() > 2); Assert.assertTrue(server.getDir().exists()); Assert.assertTrue(server.getDir().isDirectory()); File portFile = new File(server.getDir(), "server.port"); File dirFile = new File(server.getDir(), "server.dir"); ServerAccess.saveFile(server.getDir().getAbsolutePath(), dirFile); ServerAccess.saveFile(server.getPort().toString(), portFile); ServerAccess.saveFile(server.getPort().toString(), portFile); Assert.assertTrue(portFile.exists()); Assert.assertTrue(dirFile.exists()); Assert.assertTrue(server.getDir().listFiles().length > 1); String portFileContent = ServerAccess.getContentOfStream(new FileInputStream(portFile)); String dirFileContent = ServerAccess.getContentOfStream(new FileInputStream(dirFile)); URL portUrl = new URL("http", "localhost", server.getPort(), "/server.port"); HttpURLConnection portConn = (HttpURLConnection) portUrl.openConnection(); URL dirUrl = new URL("http", "localhost", server.getPort(), "/server.dir"); HttpURLConnection dirConn = (HttpURLConnection) dirUrl.openConnection(); String portUrlContent = ServerAccess.getContentOfStream(portConn.getInputStream()); String dirUrlContent = ServerAccess.getContentOfStream(dirConn.getInputStream()); Assert.assertEquals(portUrlContent.trim(), portFileContent.trim()); Assert.assertEquals(dirUrlContent.trim(), dirFileContent.trim()); Assert.assertEquals(new File(dirUrlContent.trim()), server.getDir()); Assert.assertEquals(new Integer(portUrlContent.trim()), server.getPort()); URL fastUrl = new URL("http", "localhost", server.getPort(), "/simpletest1.jnlp"); HttpURLConnection fastUrlConn = (HttpURLConnection) fastUrl.openConnection(); URL slowUrl = new URL("http", "localhost", server.getPort(), "/XslowXsimpletest1.jnlp"); HttpURLConnection slowUrlConn = (HttpURLConnection) slowUrl.openConnection(); String fastUrlcontent = ServerAccess.getContentOfStream(fastUrlConn.getInputStream()); String slowUrlContent = ServerAccess.getContentOfStream(slowUrlConn.getInputStream()); Assert.assertEquals(fastUrlcontent, slowUrlContent); portConn.disconnect(); dirConn.disconnect(); fastUrlConn.disconnect(); slowUrlConn.disconnect(); } @Test public void splitArrayTest0() throws Exception { byte[] b = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}; byte[][] bb = TinyHttpdImpl.splitArray(b, 3); //printArrays(bb); byte[] b1 = {1, 2, 3, 4, 5}; byte[] b2 = {6, 7, 8, 9, 10}; byte[] b3 = {11, 12, 13, 14}; Assert.assertEquals(3, bb.length); Assert.assertArrayEquals(b1, bb[0]); Assert.assertArrayEquals(b2, bb[1]); Assert.assertArrayEquals(b3, bb[2]); } @Test public void splitArrayTest1() throws Exception { byte[] b = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}; byte[][] bb = TinyHttpdImpl.splitArray(b, 3); //printArrays(bb); byte[] b1 = {1, 2, 3, 4, 5}; byte[] b2 = {6, 7, 8, 9, 10}; byte[] b3 = {11, 12, 13}; Assert.assertEquals(3, bb.length); Assert.assertArrayEquals(b1, bb[0]); Assert.assertArrayEquals(b2, bb[1]); Assert.assertArrayEquals(b3, bb[2]); } @Test public void splitArrayTest2() throws Exception { byte[] b = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}; byte[][] bb = TinyHttpdImpl.splitArray(b, 3); //printArrays(bb); byte[] b1 = {1, 2, 3, 4}; byte[] b2 = {5, 6, 7, 8}; byte[] b3 = {9, 10, 11, 12}; Assert.assertEquals(3, bb.length); Assert.assertArrayEquals(b1, bb[0]); Assert.assertArrayEquals(b2, bb[1]); Assert.assertArrayEquals(b3, bb[2]); } private void printArrays(byte[][] bb) { System.out.println("[][] l=" + bb.length); for (int i = 0; i < bb.length; i++) { byte[] bs = bb[i]; System.out.println(i + ": l=" + bs.length); for (int j = 0; j < bs.length; j++) { byte c = bs[j]; System.out.print(" " + j + ":" + c + " "); } System.out.println(""); } } } icedtea-web-1.6.2/tests/test-extensions-tests/net/sourceforge/jnlp/PaxHeaders.17941/ResourcesTest.ja0000644000000000000000000000013112654402377030324 xustar0030 mtime=1454507263.242432514 30 atime=1454507327.350577523 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions-tests/net/sourceforge/jnlp/ResourcesTest.java0000644000175000002070000004222512654402377031404 0ustar00jvanekmock00000000000000/* ResourcesTest.java Copyright (C) 2011-2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp; import java.io.File; import java.io.FileFilter; import java.io.FileInputStream; import java.io.IOException; import java.net.MalformedURLException; import java.net.URI; import java.net.URL; import java.util.Arrays; import java.util.List; import net.sourceforge.jnlp.browsertesting.Browser; import net.sourceforge.jnlp.browsertesting.BrowserFactory; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.browsers.LinuxBrowser; import net.sourceforge.jnlp.annotations.TestInBrowsers; import org.junit.Assert; import org.junit.Test; public class ResourcesTest extends BrowserTest{ @Test @NeedsDisplay public void testNonExisitngBrowserWillNotDeadlock() throws Exception { server.setCurrentBrowser(Browsers.none); ProcessResult pr = server.executeBrowser("not_existing_url.html"); Assert.assertNull(pr.process); Assert.assertEquals(pr.stderr, ""); Assert.assertEquals(pr.stdout, ""); Assert.assertTrue(pr.wasTerminated); Assert.assertTrue(pr.returnValue < 0); Assert.assertNotNull(pr.deadlyException); } @Test public void testUnexistingProcessWillFailRecognizedly() throws Exception { server.setCurrentBrowser(Browsers.none); List al=Arrays.asList(new String[] {"definietly_not_Existing_process"}); ProcessResult pr = server.executeProcess(al); Assert.assertNull(pr.process); Assert.assertEquals(pr.stderr, ""); Assert.assertEquals(pr.stdout, ""); Assert.assertTrue(pr.wasTerminated); Assert.assertTrue(pr.returnValue < 0); Assert.assertNotNull(pr.deadlyException); } @Test public void testGetUrlUponThisInstance() throws MalformedURLException{ URL u1=server.getUrlUponThisInstance("simple.jsp"); URL u2=server.getUrlUponThisInstance("/simple.jsp"); Assert.assertEquals(u1, u2); } @Test @TestInBrowsers(testIn=Browsers.none) public void testNonExisitngBrowserWillNotCauseMess() throws Exception { ProcessResult pr = server.executeBrowser("not_existing_url.html"); Assert.assertNull(pr.process); Assert.assertEquals(pr.stderr, ""); Assert.assertEquals(pr.stdout, ""); Assert.assertTrue(pr.wasTerminated); Assert.assertTrue(pr.returnValue < 0); Assert.assertNotNull(pr.deadlyException); } @Test public void testBrowsers2() throws Exception { List a = BrowserFactory.getFactory().getAllBrowsers(); Assert.assertNotNull("returned browsers array must not be null", a); Assert.assertTrue("at least one browser must be configured", a.size() > 0); for (Browser b : a) { testBrowser(b); } } @Test @TestInBrowsers(testIn = Browsers.all) public void testBrowser3() throws Exception { testBrowser(server.getCurrentBrowser()); } @Test public void testBrowsers1() throws Exception { BrowserFactory bf = new BrowserFactory(null); int expected = 0; Assert.assertTrue("Created from null there must be " + expected + " browsers in factory. Is" + bf.getAllBrowsers().size(), bf.getAllBrowsers().size() == expected); bf = new BrowserFactory(""); expected = 0; Assert.assertTrue("Created from empty there must be " + expected + " browsers in factory. Is" + bf.getAllBrowsers().size(), bf.getAllBrowsers().size() == expected); String s = "dsgrdg"; bf = new BrowserFactory(s); expected = 0; Assert.assertTrue("Created from nonsense " + s + " there must be " + expected + " browsers in factory. Is" + bf.getAllBrowsers().size(), bf.getAllBrowsers().size() == expected); s = "sgrg/jkik"; bf = new BrowserFactory(s); expected = 0; Assert.assertTrue("Created from nonsense " + s + " there must be " + expected + " browsers in factory. Is" + bf.getAllBrowsers().size(), bf.getAllBrowsers().size() == expected); s = Browsers.firefox + "/jkik"; bf = new BrowserFactory(s); expected = 0; Assert.assertTrue("Created from nonsense " + s + "there must be " + expected + " browsers in factory. Is" + bf.getAllBrowsers().size(), bf.getAllBrowsers().size() == expected); s = "sgrg/jkik:sege"; bf = new BrowserFactory(s); expected = 0; Assert.assertTrue("Created from two nonsenses " + s + "there must be " + expected + " browsers in factory. Is" + bf.getAllBrowsers().size(), bf.getAllBrowsers().size() == expected); s = Browsers.firefox.toExec() + ":" + Browsers.firefox; bf = new BrowserFactory(s); expected = 2; Assert.assertTrue("Created from " + s + "there must be " + expected + " browsers in factory. Is" + bf.getAllBrowsers().size(), bf.getAllBrowsers().size() == expected); s = Browsers.firefox.toExec(); bf = new BrowserFactory(s); expected = 1; Assert.assertTrue("Created from " + s + "there must be " + expected + " browsers in factory. Is" + bf.getAllBrowsers().size(), bf.getAllBrowsers().size() == expected); s = "something/somewhere/" + Browsers.firefox.toExec(); bf = new BrowserFactory(s); expected = 1; Assert.assertTrue("Created from " + s + "there must be " + expected + " browsers in factory. Is" + bf.getAllBrowsers().size(), bf.getAllBrowsers().size() == expected); s = "something/somewhere/" + Browsers.firefox.toExec() + ":" + "something/somewhere/" + Browsers.opera.toExec(); bf = new BrowserFactory(s); expected = 2; Assert.assertTrue("Created from " + s + "there must be " + expected + " browsers in factory. Is" + bf.getAllBrowsers().size(), bf.getAllBrowsers().size() == expected); s = "something/somewhere/" + Browsers.firefox.toExec() + ":" + "something/somewhere/" + Browsers.opera.toExec() + ":" + Browsers.chromiumBrowser; bf = new BrowserFactory(s); expected = 3; Assert.assertTrue("Created from " + s + "there must be " + expected + " browsers in factory. Is" + bf.getAllBrowsers().size(), bf.getAllBrowsers().size() == expected); s = Browsers.firefox.toExec() + ":" + "vfdgf" + ":" + Browsers.googleChrome.toExec(); bf = new BrowserFactory(s); expected = 2; Assert.assertTrue("Created from " + s + "there must be " + expected + " browsers in factory. Is" + bf.getAllBrowsers().size(), bf.getAllBrowsers().size() == expected); s = Browsers.firefox.toExec() + ":" + Browsers.chromiumBrowser + ":" + Browsers.googleChrome.toExec() + ":" + Browsers.opera + ":" + Browsers.epiphany + ":" + Browsers.midori; bf = new BrowserFactory(s); expected = 6; Assert.assertTrue("Created from " + s + "there must be " + expected + " browsers in factory. Is" + bf.getAllBrowsers().size(), bf.getAllBrowsers().size() == expected); testFullFactory(bf); s = "fgfd/" + Browsers.firefox.toExec() + ":" + "/fgfd/" + Browsers.chromiumBrowser + ":" + "fgfd/dfsdf/" + Browsers.googleChrome.toExec() + ":" + "/g/fgfd/" + Browsers.opera + ":" + Browsers.epiphany + ":" + Browsers.midori; bf = new BrowserFactory(s); expected = 6; Assert.assertTrue("Created from " + s + "there must be " + expected + " browsers in factory. Is" + bf.getAllBrowsers().size(), bf.getAllBrowsers().size() == expected); testFullFactory(bf); s = Browsers.firefox.toExec() + ":" + ":" + Browsers.googleChrome.toExec() + ":" + Browsers.opera; bf = new BrowserFactory(s); expected = 3; Assert.assertTrue("Created from " + s + "there must be " + expected + " browsers in factory. Is" + bf.getAllBrowsers().size(), bf.getAllBrowsers().size() == expected); s = Browsers.firefox.toExec() + ":" + ":" + ":" + Browsers.opera; bf = new BrowserFactory(s); expected = 2; Assert.assertTrue("Created from " + s + "there must be " + expected + " browsers in factory. Is" + bf.getAllBrowsers().size(), bf.getAllBrowsers().size() == expected); s = ":" + ":" + Browsers.googleChrome.toExec() + ":"; bf = new BrowserFactory(s); expected = 1; Assert.assertTrue("Created from " + s + "there must be " + expected + " browsers in factory. Is" + bf.getAllBrowsers().size(), bf.getAllBrowsers().size() == expected); s = ":" + Browsers.firefox.toExec() + ":bfgbfg/fddf/" + Browsers.googleChrome.toExec() + ":"; bf = new BrowserFactory(s); expected = 2; Assert.assertTrue("Created from " + s + "there must be " + expected + " browsers in factory. Is" + bf.getAllBrowsers().size(), bf.getAllBrowsers().size() == expected); } @Test public void testResourcesExists() throws Exception { File[] simpleContent = server.getDir().listFiles(new FileFilter() { public boolean accept(File file) { if (!file.isDirectory()) { return true; } else { return false; } } }); Assert.assertNotNull(simpleContent); Assert.assertTrue(simpleContent.length > 5); for (int i = 0; i < simpleContent.length; i++) { File file = simpleContent[i]; ServerAccess.logOutputReprint(file.getName()); //server port have in fact no usage in converting filename to uri-like-filename. //But if there is null, instead if some number, then nullpointer exception is thrown (Integer->int). //So I'm using "real" currently used port, instead of some random value. URI u = new URI((String) null, (String) null, (String) null, server.getPort(), file.getName(), (String) null, null); ServerAccess.logOutputReprint(" ("+u.toString()+")"); String fname = u.toString(); if (file.getName().toLowerCase().endsWith(".jnlp")) { String c = server.getResourceAsString("/" + fname); Assert.assertTrue(c.contains("<")); Assert.assertTrue(c.contains(">")); Assert.assertTrue(c.contains("jnlp")); Assert.assertTrue(c.contains("resources")); Assert.assertTrue(c.replaceAll("\\s*", "").contains("
")); } else { byte[] c = server.getResourceAsBytes("/" + fname).toByteArray(); Assert.assertEquals(c.length, file.length()); } } } @Test @NeedsDisplay @TestInBrowsers(testIn = Browsers.one) public void testListeners() throws Exception { final StringBuilder o1 = new StringBuilder(); final StringBuilder e1 = new StringBuilder(); final StringBuilder o2 = new StringBuilder(); final StringBuilder e2 = new StringBuilder(); final ContentReaderListener lo = new ContentReaderListener() { @Override public void charReaded(char ch) { o1.append(ch); } @Override public void lineReaded(String s) { o2.append(s).append("\n"); } }; ContentReaderListener le = new ContentReaderListener() { @Override public void charReaded(char ch) { e1.append(ch); } @Override public void lineReaded(String s) { e2.append(s).append("\n"); } }; ProcessResult pr = server.executeBrowser("not_existing_url.html",lo,le); server.setCurrentBrowser(BrowserFactory.getFactory().getFirst().getID()); Assert.assertNotNull(server.getCurrentBrowsers()); Assert.assertNotNull(server.getCurrentBrowser()); Assert.assertEquals(pr.stdout, o1.toString()); Assert.assertEquals(pr.stderr, e1.toString()); //the last \n is mandatory as las tline is flushed also when proces dies Assert.assertEquals(pr.stdout.replace("\n", ""), o2.toString().replace("\n", "")); Assert.assertEquals(pr.stderr.replace("\n", ""), e2.toString().replace("\n", "")); } private void testFullFactory(BrowserFactory bf) { Assert.assertEquals(bf.getBrowser(Browsers.chromiumBrowser).getID(), Browsers.chromiumBrowser); Assert.assertEquals(bf.getBrowser(Browsers.googleChrome).getID(), Browsers.googleChrome); Assert.assertEquals(bf.getBrowser(Browsers.firefox).getID(), Browsers.firefox); Assert.assertEquals(bf.getBrowser(Browsers.opera).getID(), Browsers.opera); Assert.assertEquals(bf.getBrowser(Browsers.epiphany).getID(), Browsers.epiphany); Assert.assertEquals(bf.getBrowser(Browsers.midori).getID(), Browsers.midori); } private void testBrowser(Browser browser) throws IOException { File defaultPluginDir = null; if (browser.getDefaultPluginExpectedLocation() != null) { defaultPluginDir = new File(browser.getDefaultPluginExpectedLocation()); } if (defaultPluginDir != null) { Assert.assertTrue("browser's plugins location should exist " + defaultPluginDir.toString() + " for " + browser.getID().toString(), defaultPluginDir.exists()); } File userPluginDir = null; if (browser.getUserDefaultPluginExpectedLocation() != null) { userPluginDir = new File(browser.getUserDefaultPluginExpectedLocation()); } // userPluginDir (~/.mozilla/plugins/) may not exist if user has not installed any Firefox plugins. File[] defaultPlugins = new File[0]; if (defaultPluginDir != null && defaultPluginDir.isDirectory()) { defaultPlugins = defaultPluginDir.listFiles(); } File[] userPlugins = new File[0]; if (userPluginDir != null && userPluginDir.isDirectory()) { userPlugins = userPluginDir.listFiles(); } Assert.assertTrue("at least one of browser's plugins directory should contains at least one file didn't. For " + browser.getID().toString(), defaultPlugins.length + userPlugins.length > 0); defaultPlugins = new File[0]; if (defaultPluginDir != null && defaultPluginDir.isDirectory()) { defaultPlugins = defaultPluginDir.listFiles(new FileFilter() { @Override public boolean accept(File pathname) { return (pathname.getName().equals(LinuxBrowser.DEFAULT_PLUGIN_NAME)); } }); } userPlugins = new File[0]; if (userPluginDir != null && userPluginDir.isDirectory()) { userPlugins = userPluginDir.listFiles(new FileFilter() { @Override public boolean accept(File pathname) { return (pathname.getName().equals(LinuxBrowser.DEFAULT_PLUGIN_NAME)); } }); } Assert.assertTrue("browser's plugins directories should contains exactly one " + LinuxBrowser.DEFAULT_PLUGIN_NAME + ", but didnt for " + browser.getID().toString(), defaultPlugins.length + userPlugins.length == 1); String currentPath = server.getJavawsFile().getParentFile().getParentFile().getAbsolutePath(); File[] plugins; if (defaultPlugins.length == 1) { plugins = defaultPlugins; } else { plugins = userPlugins; } String s = ServerAccess.getContentOfStream(new FileInputStream(plugins[0]), "ASCII"); Assert.assertTrue("browser's plugins shoud points to" + currentPath + ", but didnt", s.contains(s)); } } icedtea-web-1.6.2/tests/test-extensions-tests/net/sourceforge/jnlp/PaxHeaders.17941/MessagePropertie0000644000000000000000000000013112654402377030377 xustar0030 mtime=1454507263.242432514 30 atime=1454507327.350577523 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/test-extensions-tests/net/sourceforge/jnlp/MessagePropertiesTest.java0000644000175000002070000000773612654402377033103 0ustar00jvanekmock00000000000000/* MessagePropertiesTest.java Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.tools; import java.util.Locale; import net.sourceforge.jnlp.tools.MessageProperties; import org.junit.Test; import org.junit.Assert; public class MessagePropertiesTest { private static final Locale locale_en = MessageProperties.SupportedLanguage.en.getLocale(), locale_cs = MessageProperties.SupportedLanguage.cs.getLocale(), locale_de = MessageProperties.SupportedLanguage.de.getLocale(), locale_pl = MessageProperties.SupportedLanguage.pl.getLocale(); private void testMessageStringEquals(Locale locale, String key, String expected) { String message = MessageProperties.getMessage(locale, key); Assert.assertEquals(message, expected); } @Test public void testLocalization_en() throws Exception { testMessageStringEquals(locale_en, "Continue", "Do you want to continue?"); } @Test public void testLocalization_cs() throws Exception { testMessageStringEquals(locale_cs, "Continue", "Chcete pokra\u010dovat?"); } @Test public void testLocalization_de() throws Exception { testMessageStringEquals(locale_de, "Continue", "Soll fortgefahren werden?"); } @Test public void testLocalization_pl() throws Exception { testMessageStringEquals(locale_pl, "Continue", "Czy chcesz kontynuowa\u0107?"); } @Test public void testNonexistentLocalization() throws Exception { String message_en = MessageProperties.getMessage(locale_en, "Continue"); String message_abcd = MessageProperties.getMessage(new Locale("abcd"), "Continue"); Assert.assertEquals(message_en, message_abcd); // There is no abcd localization, should fall back to English } @Test public void testDefaultLocalization() throws Exception { String sysPropLang = System.getProperty("user.language"); Locale sysPropLocale = new Locale(sysPropLang); Locale defaultLocale = Locale.getDefault(); String sysPropMessage = MessageProperties.getMessage(sysPropLocale, "LThreadInterruptedInfo"); String defaultMessage = MessageProperties.getMessage(defaultLocale, "LThreadInterruptedInfo"); String implMessage = MessageProperties.getMessage("LThreadInterruptedInfo"); Assert.assertEquals(sysPropMessage, implMessage); Assert.assertEquals(defaultMessage, implMessage); } } icedtea-web-1.6.2/tests/PaxHeaders.17941/reproducers0000644000000000000000000000013112654402377017066 xustar0030 mtime=1454507263.236432594 30 atime=1454507658.776157397 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/reproducers/0000755000175000002070000000000012654402377017667 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/PaxHeaders.17941/custom0000644000000000000000000000013112654402377020400 xustar0030 mtime=1454507263.257432314 30 atime=1454507658.776157397 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/reproducers/custom/0000755000175000002070000000000012654402377021201 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/PaxHeaders.17941/remote0000644000000000000000000000013112654402377021673 xustar0030 mtime=1454507263.214432888 30 atime=1454507658.776157397 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/reproducers/custom/remote/0000755000175000002070000000000012654402377022474 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/remote/PaxHeaders.17941/testcases0000644000000000000000000000013112654402377023671 xustar0030 mtime=1454507263.214432888 30 atime=1454507658.776157397 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/reproducers/custom/remote/testcases/0000755000175000002070000000000012654402377024472 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/remote/testcases/PaxHeaders.17941/RemoteApplicationTests.0000644000000000000000000000013112654402377030411 xustar0030 mtime=1454507263.214432888 30 atime=1454507327.230579123 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/reproducers/custom/remote/testcases/RemoteApplicationTests.java0000644000175000002070000001446512654402377032011 0ustar00jvanekmock00000000000000/* Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.util.Arrays; import java.util.Collections; import java.util.List; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.Remote; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; @Remote public class RemoteApplicationTests { private static ServerAccess server = new ServerAccess(); private final List l = Collections.unmodifiableList(Arrays.asList(new String[]{"-Xtrustall"})); private final List ll = Collections.unmodifiableList(Arrays.asList(new String[]{"-Xtrustall", "-Xnofork"})); private static final long defaultTimeout = server.PROCESS_TIMEOUT; @BeforeClass public static void setup() { //Remote applications need to download files and take a little longer (20s) server.PROCESS_TIMEOUT = 20 * 1000l; } @AfterClass public static void teardown() { server.PROCESS_TIMEOUT = defaultTimeout; } @Test @NeedsDisplay public void topCoderRemoteTest() throws Exception { RemoteApplicationSettings.RemoteApplicationTestcaseSettings settings = new RemoteApplicationSettings.TopCoder(); ProcessResult pr = server.executeJavawsUponUrl(ll, settings.getUrl()); settings.evaluate(pr); } @Test @NeedsDisplay public void sunSwingRemoteTest() throws Exception { RemoteApplicationSettings.RemoteApplicationTestcaseSettings settings = new RemoteApplicationSettings.SunSwingDemo(); ProcessResult pr = server.executeJavawsUponUrl(l, settings.getUrl()); settings.evaluate(pr); } @Test @NeedsDisplay public void fourierTransformRemoteTest() throws Exception { RemoteApplicationSettings.RemoteApplicationTestcaseSettings settings = new RemoteApplicationSettings.FourierTransform(); ProcessResult pr = server.executeJavawsUponUrl(null, settings.getUrl()); settings.evaluate(pr); } @Test @NeedsDisplay public void arboresRemoteTest() throws Exception { RemoteApplicationSettings.RemoteApplicationTestcaseSettings settings = new RemoteApplicationSettings.Arbores(); ProcessResult pr = server.executeJavawsUponUrl(l, settings.getUrl()); settings.evaluate(pr); } @Test @NeedsDisplay public void phetsimsRemoteTest() throws Exception { RemoteApplicationSettings.RemoteApplicationTestcaseSettings settings = new RemoteApplicationSettings.PhetSims(); ProcessResult pr = server.executeJavawsUponUrl(l, settings.getUrl()); settings.evaluate(pr); } @Test @NeedsDisplay public void arboresDepositRemoteTest() throws Exception { RemoteApplicationSettings.RemoteApplicationTestcaseSettings settings = new RemoteApplicationSettings.ArboresDeposit(); ProcessResult pr = server.executeJavawsUponUrl(l, settings.getUrl()); settings.evaluate(pr); } /* This application need all permissions, but contains unsigned jar. Have exception but works at least somehow */ @Test @NeedsDisplay public void orawebCernChRemoteTest() throws Exception { RemoteApplicationSettings.RemoteApplicationTestcaseSettings settings = new RemoteApplicationSettings.OrawebCernCh(); ProcessResult pr = server.executeJavawsUponUrl(settings.modifyParams(ll), settings.getUrl()); settings.evaluate(pr); } @Test @NeedsDisplay public void AviationWeatherRemoteTest() throws Exception { RemoteApplicationSettings.RemoteApplicationTestcaseSettings settings = new RemoteApplicationSettings.AviationWeather(); ProcessResult pr = server.executeJavawsUponUrl(ll, settings.getUrl()); settings.evaluate(pr); } @Test @NeedsDisplay public void fuseSysRemoteTest() throws Exception { RemoteApplicationSettings.RemoteApplicationTestcaseSettings settings = new RemoteApplicationSettings.FuseSwing(); ProcessResult pr = server.executeJavawsUponUrl(l, settings.getUrl()); settings.evaluate(pr); } @Test @NeedsDisplay public void gantProjectRemoteTest() throws Exception { RemoteApplicationSettings.RemoteApplicationTestcaseSettings settings = new RemoteApplicationSettings.GnattProject(); ProcessResult pr = server.executeJavawsUponUrl(l, settings.getUrl()); settings.evaluate(pr); } @Test @NeedsDisplay public void geogebraRemoteTest() throws Exception { RemoteApplicationSettings.RemoteApplicationTestcaseSettings settings = new RemoteApplicationSettings.GeoGebra(); ProcessResult pr = server.executeJavawsUponUrl(ll, settings.getUrl()); settings.evaluate(pr); } } icedtea-web-1.6.2/tests/reproducers/custom/remote/testcases/PaxHeaders.17941/RemoteApplicationSettin0000644000000000000000000000013112654402377030477 xustar0030 mtime=1454507263.214432888 30 atime=1454507327.230579123 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/reproducers/custom/remote/testcases/RemoteApplicationSettings.java0000644000175000002070000002604712654402377032506 0ustar00jvanekmock00000000000000/* RemoteApplicationTests.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; import java.util.List; import net.sourceforge.jnlp.JNLPFile; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.runtime.Translator; import org.junit.Assert; import org.junit.Test; public class RemoteApplicationSettings { public static final String mustEmpty = "must be empty, was not"; public static final String stdout = "Stdout"; public static final String stderr = "Stderr"; public static final String stdoutEmpty = stdout + " " + mustEmpty; public static final String stderrEmpty = stderr + " " + mustEmpty; public static URL createCatchedUrl(String r) { try { return new URL(r); } catch (MalformedURLException mex) { throw new RuntimeException(mex); } } public interface RemoteApplicationTestcaseSettings { public URL getUrl(); public void evaluate(ProcessResult pr); public List modifyParams(List global); } public static abstract class StringBasedURL implements RemoteApplicationTestcaseSettings { URL u; public String clean(String s){ s = s.replace(Translator.R("MACDisabledMessage"),""); s = s.replace(Translator.R("MACCheckSkipped", ".*", ".*"), ""); s = s.replace(JNLPFile.TITLE_NOT_FOUND, ""); s = s.replaceAll("Fontconfig warning.*", ""); return s.replaceAll("\\s*" + JNLPFile.TITLE_NOT_FOUND + "\\s*", "").trim(); } @Override public URL getUrl() { return u; } public StringBasedURL(String r) { this.u = createCatchedUrl(r); } @Override public List modifyParams(List global) { return global; } } public static class FourierTransform extends StringBasedURL { public FourierTransform() { super("http://www.cs.brown.edu/exploratories/freeSoftware/repository/edu/brown/cs/exploratories/applets/fft1DApp/1d_fast_fourier_transform_java_jnlp.jnlp"); } @Override public void evaluate(ProcessResult pr) { Assert.assertTrue(stdoutEmpty, clean(pr.stdout).length() == 0); Assert.assertTrue(clean(pr.stderr).length() == 0 || pr.stderr.contains(IllegalStateException.class.getName())); } } public static class OrawebCernCh extends StringBasedURL { public OrawebCernCh() { super("https://oraweb.cern.ch/pls/atlasintegration/docs/EMDH_atlas.jnlp"); } @Override public void evaluate(ProcessResult pr) { Assert.assertTrue(stdoutEmpty, clean(pr.stdout).length() == 0); Assert.assertTrue(clean(pr.stderr).length() == 0 || pr.stderr.contains("Cannot grant permissions to unsigned jars. Application requested security permissions, but jars are not signed")); } @Override public List modifyParams(List global) { List l = new ArrayList(global); l.add("-J-Dhttps.protocols=TLSv1,SSLv3,SSLv2Hello"); return l; } } public static class GnattProject extends StringBasedURL { public GnattProject() { super("http://ganttproject.googlecode.com/svn/webstart/ganttproject-2.0.10/ganttproject-2.0.10.jnlp"); } @Override public void evaluate(ProcessResult pr) { Assert.assertTrue(stdout, clean(pr.stdout).length() == 0); Assert.assertTrue(pr.stderr.contains("Splash closed")); Assert.assertFalse(pr.stderr.contains("Exception")); } } public static class GeoGebra extends StringBasedURL { public GeoGebra() { super("http://www.geogebra.org/webstart/geogebra.jnlp"); } @Override public void evaluate(ProcessResult pr) { //some debug coords are appearing Assert.assertTrue(pr.stdout.toLowerCase().contains("geogebra")); Assert.assertFalse(pr.stderr.toLowerCase().contains("exception")); } } public abstract static class NoOutputs extends StringBasedURL { public NoOutputs(String r) { super(r); } @Override public void evaluate(ProcessResult pr) { Assert.assertTrue(stdoutEmpty, pr.stdout.length() == 0); Assert.assertTrue(stderrEmpty, pr.stderr.length() == 0); } } public abstract static class NearlyNoOutputs extends StringBasedURL { public NearlyNoOutputs(String r) { super(r); } @Override public void evaluate(ProcessResult pr) { Assert.assertTrue(stdoutEmpty, clean(pr.stdout).length() == 0); Assert.assertTrue(stderrEmpty, clean(pr.stderr).length() == 0); } } public abstract static class NearlyNoOutputsOnWrongJRE extends NearlyNoOutputs { public NearlyNoOutputsOnWrongJRE(String r) { super(r); } @Override public void evaluate(ProcessResult pr) { Assert.assertTrue(stdoutEmpty, removeJreVersionWarning(clean(pr.stdout)).length() == 0); Assert.assertTrue(stderrEmpty, removeJreVersionWarning(clean(pr.stderr)).length() == 0); } } private static final String pattern = ".*" + Translator.R("JREversionDontMatch", ".*", ".*") + ".*"; private static String removeJreVersionWarning(String clean) { return clean.replaceAll(pattern, ""); } @Test public void testJREversionDontMatchRemoval(){ Assert.assertTrue(removeJreVersionWarning(Translator.R("JREversionDontMatch", "1.8.0-pre.whatever", "{0}")).isEmpty()); Assert.assertTrue(removeJreVersionWarning(Translator.R("JREversionDontMatch", "{0}", "{1}")).isEmpty()); Assert.assertTrue(removeJreVersionWarning(Translator.R("JREversionDontMatch", "1.3.0-pre-pac", "1.8.0-pre.whatever}")).isEmpty()); Assert.assertTrue(removeJreVersionWarning(Translator.R("JREversionDontMatch", "", "")).isEmpty()); Assert.assertTrue(removeJreVersionWarning(Translator.R("JREversionDontMatch", " - - - - ", " - - - ")).isEmpty()); Assert.assertFalse(removeJreVersionWarning("AA\n"+Translator.R("JREversionDontMatch", "1.3+", "1.7")+"\nBB").equals("AA\nBB")); } public static class Arbores extends NearlyNoOutputsOnWrongJRE { public Arbores() { super("http://www.arbores.ca/AnnuityCalc.jnlp"); } } public static class PhetSims extends NearlyNoOutputs { public PhetSims() { super("http://phetsims.colorado.edu/sims/circuit-construction-kit/circuit-construction-kit-dc_en.jnlp"); } } public static class TopCoder extends NearlyNoOutputs { public TopCoder() { super("http://www.topcoder.com/contest/arena/ContestAppletProd.jnlp"); } } public static class SunSwingDemo extends NearlyNoOutputs { public SunSwingDemo() throws MalformedURLException { super("http://java.sun.com/docs/books/tutorialJWS/uiswing/events/ex6/ComponentEventDemo.jnlp"); } } public static class ArboresDeposit extends NearlyNoOutputsOnWrongJRE { public ArboresDeposit() throws MalformedURLException { super("http://www.arbores.ca/Deposit.jnlp"); } } public static class AviationWeather extends StringBasedURL { @Override public void evaluate(ProcessResult pr) { Assert.assertTrue(stdoutEmpty, clean(pr.stdout).length() == 0); Assert.assertTrue(clean(pr.stderr).length() == 0 || (clean(pr.stderr).contains("Cannot read File Manager history data file,") && pr.stderr.contains("FileMgr will be initialized with default options"))); } public AviationWeather() { super("http://aviationweather.gov/static/adds/java/fpt/fpt.jnlp"); } } public static class FuseSwing extends NearlyNoOutputs { public FuseSwing() { super("http://www.progx.org/users/Gfx/apps/fuse-swing-demo.jnlp"); } } @Test public void remoteApplicationSettingsAreWorking() throws Exception { RemoteApplicationTestcaseSettings s5 = new FourierTransform(); Assert.assertNotNull(s5.getUrl()); RemoteApplicationTestcaseSettings s4 = new Arbores(); Assert.assertNotNull(s4.getUrl()); RemoteApplicationTestcaseSettings s3 = new PhetSims(); Assert.assertNotNull(s3.getUrl()); RemoteApplicationTestcaseSettings s2 = new TopCoder(); Assert.assertNotNull(s2.getUrl()); RemoteApplicationTestcaseSettings s1 = new SunSwingDemo(); Assert.assertNotNull(s1.getUrl()); RemoteApplicationTestcaseSettings s6 = new ArboresDeposit(); Assert.assertNotNull(s6.getUrl()); RemoteApplicationTestcaseSettings s7 = new OrawebCernCh(); Assert.assertNotNull(s7.getUrl()); RemoteApplicationTestcaseSettings s8 = new AviationWeather(); Assert.assertNotNull(s8.getUrl()); RemoteApplicationTestcaseSettings s9 = new FuseSwing(); Assert.assertNotNull(s9.getUrl()); RemoteApplicationTestcaseSettings s10 = new GnattProject(); Assert.assertNotNull(s10.getUrl()); RemoteApplicationTestcaseSettings s11 = new GeoGebra(); Assert.assertNotNull(s11.getUrl()); } } icedtea-web-1.6.2/tests/reproducers/custom/remote/PaxHeaders.17941/srcs0000644000000000000000000000013112654402377022645 xustar0030 mtime=1454507263.213432901 30 atime=1454507658.776157397 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/reproducers/custom/remote/srcs/0000755000175000002070000000000012654402377023446 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/remote/srcs/PaxHeaders.17941/Makefile0000644000000000000000000000013112654402377024362 xustar0030 mtime=1454507263.213432901 30 atime=1454507327.230579123 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/reproducers/custom/remote/srcs/Makefile0000644000175000002070000000022512654402377025105 0ustar00jvanekmock00000000000000prepare-reproducer: echo "Nothing to do to prepare remote reproducers now" clean-reproducer: echo "Nothing to do to clean remote reproducers now" icedtea-web-1.6.2/tests/reproducers/custom/PaxHeaders.17941/UnsignedContentInMETAINF0000644000000000000000000000013112654402377025002 xustar0030 mtime=1454507263.260432274 30 atime=1454507658.776157397 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/reproducers/custom/UnsignedContentInMETAINF/0000755000175000002070000000000012654402377025603 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/UnsignedContentInMETAINF/PaxHeaders.17941/testcases0000644000000000000000000000013112654402377027000 xustar0030 mtime=1454507263.213432901 30 atime=1454507658.776157397 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/reproducers/custom/UnsignedContentInMETAINF/testcases/0000755000175000002070000000000012654402377027601 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/UnsignedContentInMETAINF/testcases/PaxHeaders.17941/Unsig0000644000000000000000000000031612654402377030072 xustar00117 path=icedtea-web-1.6.2/tests/reproducers/custom/UnsignedContentInMETAINF/testcases/UnsignedContentInMETAINF.java 30 mtime=1454507263.213432901 30 atime=1454507327.230579123 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/reproducers/custom/UnsignedContentInMETAINF/testcases/UnsignedContentInMETAI0000644000175000002070000000571312654402377033710 0ustar00jvanekmock00000000000000/* UnsignedContentInMETAINF.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.util.Arrays; import java.util.Collections; import java.util.List; import net.sourceforge.jnlp.ServerAccess; import org.junit.Assert; import org.junit.Test; import net.sourceforge.jnlp.ProcessResult;; public class UnsignedContentInMETAINF { private static ServerAccess server = new ServerAccess(); private final List l=Collections.unmodifiableList(Arrays.asList(new String[] {"-Xtrustall"})); String accessMatcher = "(?s).*java.security.AccessControlException.{0,5}access denied.{0,5}java.util.PropertyPermission.{0,5}" + "user.name.{0,5}read" + ".*"; @Test public void ReadSignedPropertiesWithUnsignedContentInMETAINF() throws Exception { //request for allpermissions ProcessResult pr=server.executeJavawsHeadless(l,"/UnsignedContentInMETAINF.jnlp"); Assert.assertFalse("Stderr should NOT match "+accessMatcher+" but did",pr.stderr.matches(accessMatcher)); String ss="ClassNotFoundException"; Assert.assertFalse("Stderr should not contain "+ss+" but did",pr.stderr.contains(ss)); Assert.assertTrue("Stdout length should be >= 4 but was "+pr.stdout.length(),pr.stdout.length()>=4); // /home/user or /root or anything else :( Assert.assertFalse("Should not be terminated but was",pr.wasTerminated); Assert.assertEquals((Integer)0, pr.returnValue); } } icedtea-web-1.6.2/tests/reproducers/custom/UnsignedContentInMETAINF/PaxHeaders.17941/srcs0000644000000000000000000000013112654402377025754 xustar0030 mtime=1454507263.260432274 30 atime=1454507658.776157397 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/reproducers/custom/UnsignedContentInMETAINF/srcs/0000755000175000002070000000000012654402377026555 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/UnsignedContentInMETAINF/srcs/PaxHeaders.17941/Makefile0000644000000000000000000000013112654402377027471 xustar0030 mtime=1454507263.260432274 30 atime=1454507327.230579123 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/reproducers/custom/UnsignedContentInMETAINF/srcs/Makefile0000644000175000002070000000135412654402377030220 0ustar00jvanekmock00000000000000TESTNAME=UnsignedContentInMETAINF JAVAC_CLASSPATH=$(TEST_EXTENSIONS_DIR):$(NETX_DIR)/lib/classes.jar DEPLOY_DIR=$(REPRODUCERS_TESTS_SERVER_DEPLOYDIR) JAVAC=$(EXPORTED_JAVAC) JAR=$(EXPORTED_JAR) ABS_SRC_PATH=$(REPRODUCERS_TESTS_SRCDIR)/custom/$(TESTNAME)/srcs prepare-reproducer: echo PREPARING REPRODUCER $(TESTNAME) echo "USING ABSPATH = " $(ABS_SRC_PATH) cp $(DEPLOY_DIR)/ReadPropertiesSigned.jar $(DEPLOY_DIR)/UnsignedContentInMETAINF.jar # Place an unsigned file in the META-INF folder cd $(ABS_SRC_PATH) $(JAR) uf $(DEPLOY_DIR)/UnsignedContentInMETAINF.jar META-INF/ echo PREPARED REPRODUCER $(TESTNAME) clean-reproducer: echo CLEANING REPRODUCER $(TESTNAME) rm -f UnsignedContentInMETAINF.jar echo CLEANED REPRODUCER $(TESTNAME) icedtea-web-1.6.2/tests/reproducers/custom/UnsignedContentInMETAINF/srcs/PaxHeaders.17941/META-INF0000644000000000000000000000013112654402377027114 xustar0030 mtime=1454507263.260432274 30 atime=1454507658.776157397 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/reproducers/custom/UnsignedContentInMETAINF/srcs/META-INF/0000755000175000002070000000000012654402377027715 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/UnsignedContentInMETAINF/srcs/META-INF/PaxHeaders.17941/u0000644000000000000000000000031512654402377027364 xustar00116 path=icedtea-web-1.6.2/tests/reproducers/custom/UnsignedContentInMETAINF/srcs/META-INF/unsigned_file_in_metainf 30 mtime=1454507263.260432274 30 atime=1454507327.230579123 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/reproducers/custom/UnsignedContentInMETAINF/srcs/META-INF/unsigned_file_in_m0000644000175000002070000000012112654402377033447 0ustar00jvanekmock00000000000000This is an unsigned file to be placed in the META-INF/ folder of the copied jar. icedtea-web-1.6.2/tests/reproducers/custom/UnsignedContentInMETAINF/PaxHeaders.17941/resources0000644000000000000000000000013112654402377027014 xustar0030 mtime=1454507263.259432288 30 atime=1454507658.776157397 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/reproducers/custom/UnsignedContentInMETAINF/resources/0000755000175000002070000000000012654402377027615 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/UnsignedContentInMETAINF/resources/PaxHeaders.17941/Unsig0000644000000000000000000000031612654402377030106 xustar00117 path=icedtea-web-1.6.2/tests/reproducers/custom/UnsignedContentInMETAINF/resources/UnsignedContentInMETAINF.jnlp 30 mtime=1454507263.259432288 30 atime=1454507327.229579136 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/reproducers/custom/UnsignedContentInMETAINF/resources/UnsignedContentInMETAI0000644000175000002070000000436312654402377033724 0ustar00jvanekmock00000000000000 read properties using System.getenv() with unsigned content in META-INF IcedTea user.name icedtea-web-1.6.2/tests/reproducers/custom/PaxHeaders.17941/TrustedOnlyAttribute0000644000000000000000000000013112654402377024560 xustar0030 mtime=1454507263.259432288 30 atime=1454507658.776157397 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/reproducers/custom/TrustedOnlyAttribute/0000755000175000002070000000000012654402377025361 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/TrustedOnlyAttribute/PaxHeaders.17941/testcases0000644000000000000000000000013112654402377026556 xustar0030 mtime=1454507263.259432288 30 atime=1454507658.776157397 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/reproducers/custom/TrustedOnlyAttribute/testcases/0000755000175000002070000000000012654402377027357 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/TrustedOnlyAttribute/testcases/PaxHeaders.17941/TrustedOn0000644000000000000000000000031212654402377030506 xustar00113 path=icedtea-web-1.6.2/tests/reproducers/custom/TrustedOnlyAttribute/testcases/TrustedOnlyAttributeTest.java 30 mtime=1454507263.259432288 30 atime=1454507327.229579136 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/reproducers/custom/TrustedOnlyAttribute/testcases/TrustedOnlyAttributeTest.j0000644000175000002070000001455112654402377034560 0ustar00jvanekmock00000000000000/* TrustedOnlyAttributeTest.java Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess.AutoClose; import net.sourceforge.jnlp.annotations.Bug; import net.sourceforge.jnlp.annotations.KnownToFail; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; import net.sourceforge.jnlp.config.PathsAndFiles; import net.sourceforge.jnlp.util.FileUtils; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertFalse; import java.io.File; import java.io.IOException; public class TrustedOnlyAttributeTest extends BrowserTest { private static final String RUNNING_STRING = "TrustedOnlyAttribute applet running"; private static final String CLOSE_STRING = AutoOkClosingListener.MAGICAL_OK_CLOSING_STRING; private static File deployFile; private static String attributesCheck; @BeforeClass public static void setupDeploymentProperties() throws IOException { deployFile = PathsAndFiles.USER_DEPLOYMENT_FILE.getFile(); String properties = FileUtils.loadFileAsString(deployFile); for (String line : properties.split("\n")) { if (line.contains("deployment.manifest.attribute.check")) { attributesCheck = line; properties = properties.replace(line, "deployment.manifest.attributes.check=TRUSTED\n"); } } if (attributesCheck == null) { properties += "deployment.manifest.attributes.check=TRUSTED\n"; } FileUtils.saveFile(properties, deployFile); } @AfterClass public static void setbackDeploymentProperties() throws IOException { String properties = FileUtils.loadFileAsString(deployFile); if (attributesCheck != null) { properties = properties.replace("deployment.manifest.attributes.check=TRUSTED\n", attributesCheck); } else { properties = properties.replace("deployment.manifest.attributes.check=TRUSTED\n", ""); } FileUtils.saveFile(properties, deployFile); } @NeedsDisplay @Test @TestInBrowsers(testIn={Browsers.one}) public void testSignedAppletWithManifestAttributeAndNoHtmlSecurity() throws Exception { ProcessResult pr = server.executeBrowser("TrustedOnlyAttribute-signed.html", AutoClose.CLOSE_ON_BOTH); assertFalse("Applet should not have failed to launch", pr.stderr.contains("LaunchException")); assertTrue("Applet should have run", pr.stdout.contains(RUNNING_STRING)); } @Test public void testSignedAppletWithManifestAttributeAndNoJnlpSecurity() throws Exception { ProcessResult pr = server.executeJavawsHeadless("TrustedOnlyAttribute-signed-nosecurity.jnlp"); assertTrue("Applet should have failed to launch", pr.stderr.contains("LaunchException")); assertFalse("Applet should not have run", pr.stdout.contains(RUNNING_STRING)); } @Test public void testSignedAppletWithManifestAttributeWithJnlpSecurity() throws Exception { ProcessResult pr = server.executeJavawsHeadless("TrustedOnlyAttribute-signed-security.jnlp"); assertFalse("Applet should not have failed to launch", pr.stderr.contains("LaunchException")); assertTrue("Applet should have run", pr.stdout.contains(RUNNING_STRING)); } @NeedsDisplay @Test @TestInBrowsers(testIn={Browsers.one}) public void testUnsignedAppletWithManifestAttributeAndNoHtmlSecurity() throws Exception { ProcessResult pr = server.executeBrowser("TrustedOnlyAttribute-unsigned.html", AutoClose.CLOSE_ON_BOTH); assertTrue("Applet should have failed to launch", pr.stderr.contains("LaunchException")); assertFalse("Applet should not have run", pr.stdout.contains(RUNNING_STRING)); } @Test public void testUnsignedAppletWithManifestAttributeAndNoJnlpSecurity() throws Exception { ProcessResult pr = server.executeJavawsHeadless("TrustedOnlyAttribute-unsigned-nosecurity.jnlp"); assertTrue("Applet should have failed to launch", pr.stderr.contains("LaunchException")); assertFalse("Applet should not have run", pr.stdout.contains(RUNNING_STRING)); } @Test public void testUnsignedAppletWithManifestAttributeWithJnlpSecurity() throws Exception { ProcessResult pr = server.executeJavawsHeadless("TrustedOnlyAttribute-unsigned-security.jnlp"); assertTrue("Applet should have failed to launch", pr.stderr.contains("LaunchException")); assertFalse("Applet should not have run", pr.stdout.contains(RUNNING_STRING)); } } icedtea-web-1.6.2/tests/reproducers/custom/TrustedOnlyAttribute/PaxHeaders.17941/srcs0000644000000000000000000000013112654402377025532 xustar0030 mtime=1454507263.259432288 30 atime=1454507658.776157397 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/reproducers/custom/TrustedOnlyAttribute/srcs/0000755000175000002070000000000012654402377026333 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/TrustedOnlyAttribute/srcs/PaxHeaders.17941/TrustedOnlyAtt0000644000000000000000000000013112654402377030477 xustar0030 mtime=1454507263.259432288 30 atime=1454507327.229579136 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/reproducers/custom/TrustedOnlyAttribute/srcs/TrustedOnlyAttribute.java0000644000175000002070000000371312654402377033362 0ustar00jvanekmock00000000000000/* TrustedOnlyAttribute.java Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.applet.Applet; public class TrustedOnlyAttribute extends Applet { private static final String appletCloseString = "*** APPLET FINISHED ***"; @Override public void init() { System.out.println("TrustedOnlyAttribute applet running"); System.out.println(appletCloseString); System.exit(0); } } icedtea-web-1.6.2/tests/reproducers/custom/TrustedOnlyAttribute/srcs/PaxHeaders.17941/Makefile0000644000000000000000000000013112654402377027247 xustar0030 mtime=1454507263.259432288 30 atime=1454507327.229579136 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/reproducers/custom/TrustedOnlyAttribute/srcs/Makefile0000644000175000002070000000167012654402377027777 0ustar00jvanekmock00000000000000TESTNAME=TrustedOnlyAttribute JARSIGNER=$(EXPORTED_JARSIGNER) JAVAC=$(EXPORTED_JAVAC) JAR=$(EXPORTED_JAR) TMPDIR:=$(shell mktemp -d) prepare-reproducer: echo PREPARING REPRODUCER $(TESTNAME) in $(TMPDIR) cp MANIFEST.MF $(TMPDIR) ; \ $(JAVAC) -d $(TMPDIR) $(TESTNAME).java ; \ cd $(TMPDIR) ; \ $(JAR) cvfm $(TESTNAME)Signed.jar MANIFEST.MF $(TESTNAME).class ; \ $(JAR) cvfm $(TESTNAME)Unsigned.jar MANIFEST.MF $(TESTNAME).class ; \ $(EXPORTED_JARSIGNER) -keystore $(TOP_BUILD_DIR)/$(PRIVATE_KEYSTORE_NAME) -storepass $(PRIVATE_KEYSTORE_PASS) \ -keypass $(PRIVATE_KEYSTORE_PASS) "$(TMPDIR)/$(TESTNAME)Signed.jar" $(TEST_CERT_ALIAS)_signed ; \ cd $(TMPDIR); \ mv $(TESTNAME)Signed.jar $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR) ; \ mv $(TESTNAME)Unsigned.jar $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR) ; \ echo PREPARED REPRODUCER $(TESTNAME), removing $(TMPDIR) rm -rf $(TMPDIR) clean-reproducer: echo NOTHING TO CLEAN FOR $(TESTNAME) icedtea-web-1.6.2/tests/reproducers/custom/TrustedOnlyAttribute/srcs/PaxHeaders.17941/MANIFEST.MF0000644000000000000000000000013112654402377027241 xustar0030 mtime=1454507263.258432301 30 atime=1454507327.229579136 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/reproducers/custom/TrustedOnlyAttribute/srcs/MANIFEST.MF0000644000175000002070000000007312654402377027765 0ustar00jvanekmock00000000000000Trusted-Only: true Application-Name: TrustedOnlyAttribute icedtea-web-1.6.2/tests/reproducers/custom/TrustedOnlyAttribute/PaxHeaders.17941/resources0000644000000000000000000000013112654402377026572 xustar0030 mtime=1454507263.258432301 30 atime=1454507658.776157397 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/reproducers/custom/TrustedOnlyAttribute/resources/0000755000175000002070000000000012654402377027373 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/TrustedOnlyAttribute/resources/PaxHeaders.17941/TrustedOn0000644000000000000000000000031712654402377030527 xustar00118 path=icedtea-web-1.6.2/tests/reproducers/custom/TrustedOnlyAttribute/resources/TrustedOnlyAttribute-unsigned.html 30 mtime=1454507263.258432301 30 atime=1454507327.229579136 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/reproducers/custom/TrustedOnlyAttribute/resources/TrustedOnlyAttribute-unsig0000644000175000002070000000353112654402377034623 0ustar00jvanekmock00000000000000 icedtea-web-1.6.2/tests/reproducers/custom/TrustedOnlyAttribute/resources/PaxHeaders.17941/TrustedOn0000644000000000000000000000032712654402377030530 xustar00127 path=icedtea-web-1.6.2/tests/reproducers/custom/TrustedOnlyAttribute/resources/TrustedOnlyAttribute-unsigned-security.jnlp 30 mtime=1454507263.258432301 29 atime=1454507327.22857915 29 ctime=1454507658.76615753 icedtea-web-1.6.2/tests/reproducers/custom/TrustedOnlyAttribute/resources/TrustedOnlyAttribute-unsig0000644000175000002070000000444212654402377034625 0ustar00jvanekmock00000000000000 TrustedOnlyAttribute IcedTea Trusted-Only Manifest Attribute Test icedtea-web-1.6.2/tests/reproducers/custom/TrustedOnlyAttribute/resources/PaxHeaders.17941/TrustedOn0000644000000000000000000000033212654402377030524 xustar00129 path=icedtea-web-1.6.2/tests/reproducers/custom/TrustedOnlyAttribute/resources/TrustedOnlyAttribute-unsigned-nosecurity.jnlp 30 mtime=1454507263.258432301 29 atime=1454507327.22857915 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/TrustedOnlyAttribute/resources/TrustedOnlyAttribute-unsig0000644000175000002070000000435012654402377034623 0ustar00jvanekmock00000000000000 TrustedOnlyAttribute IcedTea Trusted-Only Manifest Attribute Test icedtea-web-1.6.2/tests/reproducers/custom/TrustedOnlyAttribute/resources/PaxHeaders.17941/TrustedOn0000644000000000000000000000031512654402377030525 xustar00116 path=icedtea-web-1.6.2/tests/reproducers/custom/TrustedOnlyAttribute/resources/TrustedOnlyAttribute-signed.html 30 mtime=1454507263.257432314 29 atime=1454507327.22857915 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/TrustedOnlyAttribute/resources/TrustedOnlyAttribute-signe0000644000175000002070000000352712654402377034610 0ustar00jvanekmock00000000000000 icedtea-web-1.6.2/tests/reproducers/custom/TrustedOnlyAttribute/resources/PaxHeaders.17941/TrustedOn0000644000000000000000000000032612654402377030527 xustar00125 path=icedtea-web-1.6.2/tests/reproducers/custom/TrustedOnlyAttribute/resources/TrustedOnlyAttribute-signed-security.jnlp 30 mtime=1454507263.257432314 29 atime=1454507327.22857915 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/TrustedOnlyAttribute/resources/TrustedOnlyAttribute-signe0000644000175000002070000000443612654402377034610 0ustar00jvanekmock00000000000000 TrustedOnlyAttribute IcedTea Trusted-Only Manifest Attribute Test icedtea-web-1.6.2/tests/reproducers/custom/TrustedOnlyAttribute/resources/PaxHeaders.17941/TrustedOn0000644000000000000000000000033012654402377030522 xustar00127 path=icedtea-web-1.6.2/tests/reproducers/custom/TrustedOnlyAttribute/resources/TrustedOnlyAttribute-signed-nosecurity.jnlp 30 mtime=1454507263.257432314 29 atime=1454507327.22857915 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/TrustedOnlyAttribute/resources/TrustedOnlyAttribute-signe0000644000175000002070000000434612654402377034610 0ustar00jvanekmock00000000000000 TrustedOnlyAttribute IcedTea Trusted-Only Manifest Attribute Test icedtea-web-1.6.2/tests/reproducers/custom/PaxHeaders.17941/SignedAppletExternalMainClass0000644000000000000000000000013212654402377026256 xustar0030 mtime=1454507263.256432328 30 atime=1454507658.776157397 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/SignedAppletExternalMainClass/0000755000175000002070000000000012654402377027056 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/SignedAppletExternalMainClass/PaxHeaders.17941/testcases0000644000000000000000000000013212654402377030254 xustar0030 mtime=1454507263.256432328 30 atime=1454507658.776157397 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/SignedAppletExternalMainClass/testcases/0000755000175000002070000000000012654402377031054 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/SignedAppletExternalMainClass/testcases/PaxHeaders.17941/0000644000000000000000000000033512654402377030340 xustar00131 path=icedtea-web-1.6.2/tests/reproducers/custom/SignedAppletExternalMainClass/testcases/SignedAppletExternalMainClassTest.java 30 mtime=1454507263.257432314 30 atime=1454507327.227579163 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/SignedAppletExternalMainClass/testcases/SignedAppletExter0000644000175000002070000000630112654402377034366 0ustar00jvanekmock00000000000000/* SignedAppletExternalMainClassTest.java Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess.AutoClose; import net.sourceforge.jnlp.annotations.Bug; import net.sourceforge.jnlp.annotations.KnownToFail; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; import org.junit.Test; import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertFalse; /* see also signed/SignedAppletCodebaseLoading which is related */ public class SignedAppletExternalMainClassTest extends BrowserTest { private static final String RUNNING_STRING = "SignedAppletExternalMainClass Applet Running"; private static final String CLOSE_STRING = AutoOkClosingListener.MAGICAL_OK_CLOSING_STRING; @Bug(id="PR1513") @NeedsDisplay @Test @TestInBrowsers(testIn={Browsers.one}) public void testSignedAppletWithExternalMainClassLaunch() throws Exception { ProcessResult pr = server.executeBrowser("SignedAppletExternalMainClass.html", AutoClose.CLOSE_ON_CORRECT_END); assertProperStart(pr); assertCloseString(pr); } private static void assertProperStart(ProcessResult pr) { assertTrue("applet did not initialize", pr.stdout.contains(RUNNING_STRING)); } private static void assertCloseString(ProcessResult pr) { assertTrue("applet should have closed normally", pr.stdout.contains(CLOSE_STRING)); } } icedtea-web-1.6.2/tests/reproducers/custom/SignedAppletExternalMainClass/PaxHeaders.17941/srcs0000644000000000000000000000013212654402377027230 xustar0030 mtime=1454507263.256432328 30 atime=1454507658.776157397 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/SignedAppletExternalMainClass/srcs/0000755000175000002070000000000012654402377030030 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/SignedAppletExternalMainClass/srcs/PaxHeaders.17941/Signe0000644000000000000000000000033212654402377030277 xustar00128 path=icedtea-web-1.6.2/tests/reproducers/custom/SignedAppletExternalMainClass/srcs/SignedAppletExternalMainClassHelper.java 30 mtime=1454507263.256432328 30 atime=1454507327.227579163 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/SignedAppletExternalMainClass/srcs/SignedAppletExternalMa0000644000175000002070000000343512654402377034320 0ustar00jvanekmock00000000000000/* SignedAppletExternalMainClassHelper.java Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class SignedAppletExternalMainClassHelper { public static String help() { return "SignedAppletExternalMainClass Applet Running"; } } icedtea-web-1.6.2/tests/reproducers/custom/SignedAppletExternalMainClass/srcs/PaxHeaders.17941/Signe0000644000000000000000000000032412654402377030300 xustar00122 path=icedtea-web-1.6.2/tests/reproducers/custom/SignedAppletExternalMainClass/srcs/SignedAppletExternalMainClass.java 30 mtime=1454507263.256432328 30 atime=1454507327.227579163 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/SignedAppletExternalMainClass/srcs/SignedAppletExternalMa0000644000175000002070000000371212654402377034316 0ustar00jvanekmock00000000000000/* SignedAppletExternalMainClass.java Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.applet.Applet; public class SignedAppletExternalMainClass extends Applet { private static final String appletCloseString = "*** APPLET FINISHED ***"; @Override public void init() { System.out.println(SignedAppletExternalMainClassHelper.help()); System.out.println(appletCloseString); } } icedtea-web-1.6.2/tests/reproducers/custom/SignedAppletExternalMainClass/srcs/PaxHeaders.17941/Makef0000644000000000000000000000013212654402377030253 xustar0030 mtime=1454507263.256432328 30 atime=1454507327.226579177 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/SignedAppletExternalMainClass/srcs/Makefile0000644000175000002070000000154212654402377031472 0ustar00jvanekmock00000000000000TESTNAME=SignedAppletExternalMainClass JARSIGNER=$(EXPORTED_JARSIGNER) JAVAC=$(EXPORTED_JAVAC) JAR=$(EXPORTED_JAR) TMPDIR:=$(shell mktemp -d) prepare-reproducer: echo PREPARING REPRODUCER $(TESTNAME) in $(TMPDIR) $(JAVAC) -d $(TMPDIR) $(TESTNAME).java $(TESTNAME)Helper.java cd $(TMPDIR) ; \ $(JAR) cvf $(TESTNAME)Helper.jar $(TESTNAME)Helper.class ; \ $(EXPORTED_JARSIGNER) -keystore $(TOP_BUILD_DIR)/$(PRIVATE_KEYSTORE_NAME) -storepass $(PRIVATE_KEYSTORE_PASS) \ -keypass $(PRIVATE_KEYSTORE_PASS) "$(TMPDIR)/$(TESTNAME)Helper.jar" $(TEST_CERT_ALIAS)_signed ; \ cd $(TMPDIR); \ mv $(TESTNAME).class $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR) ; \ mv $(TESTNAME)Helper.jar $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR) ; echo PREPARED REPRODUCER $(TESTNAME), removing $(TMPDIR) rm -rf $(TMPDIR) clean-reproducer: echo NOTHING TO CLEAN FOR $(TESTNAME) icedtea-web-1.6.2/tests/reproducers/custom/SignedAppletExternalMainClass/PaxHeaders.17941/resources0000644000000000000000000000013212654402377030270 xustar0030 mtime=1454507263.255432341 30 atime=1454507658.776157397 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/SignedAppletExternalMainClass/resources/0000755000175000002070000000000012654402377031070 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/SignedAppletExternalMainClass/resources/PaxHeaders.17941/0000644000000000000000000000033112654402377030350 xustar00127 path=icedtea-web-1.6.2/tests/reproducers/custom/SignedAppletExternalMainClass/resources/SignedAppletExternalMainClass.html 30 mtime=1454507263.255432341 30 atime=1454507327.226579177 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/SignedAppletExternalMainClass/resources/SignedAppletExter0000644000175000002070000000355112654402377034406 0ustar00jvanekmock00000000000000 icedtea-web-1.6.2/tests/reproducers/custom/PaxHeaders.17941/SignedAppletCodebaseLoading0000644000000000000000000000013212654402377025704 xustar0030 mtime=1454507263.255432341 30 atime=1454507658.776157397 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/SignedAppletCodebaseLoading/0000755000175000002070000000000012654402377026504 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/SignedAppletCodebaseLoading/PaxHeaders.17941/testcases0000644000000000000000000000013212654402377027702 xustar0030 mtime=1454507263.255432341 30 atime=1454507658.776157397 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/SignedAppletCodebaseLoading/testcases/0000755000175000002070000000000012654402377030502 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/SignedAppletCodebaseLoading/testcases/PaxHeaders.17941/Si0000644000000000000000000000033212654402377030257 xustar00128 path=icedtea-web-1.6.2/tests/reproducers/custom/SignedAppletCodebaseLoading/testcases/SignedAppletCodebaseLoadingTests.java 30 mtime=1454507263.255432341 30 atime=1454507327.226579177 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/SignedAppletCodebaseLoading/testcases/SignedAppletCodebas0000644000175000002070000000640612654402377034273 0ustar00jvanekmock00000000000000/* SignedAppletCodebaseLoadingTests.java Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.io.File; import java.io.FileInputStream; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.ServerAccess.AutoClose; import net.sourceforge.jnlp.annotations.Bug; import net.sourceforge.jnlp.annotations.KnownToFail; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; import org.junit.Test; import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertFalse; /* see also signed/SignedAppletExternalMainClass which is related */ public class SignedAppletCodebaseLoadingTests extends BrowserTest { private static final String RUNNING_STRING = "SignedAppletCodebaseLoading Applet Running"; private static final String CLOSE_STRING = AutoOkClosingListener.MAGICAL_OK_CLOSING_STRING; @Bug(id="PR1513") @NeedsDisplay @Test @TestInBrowsers(testIn={Browsers.one}) public void testCodebaseLoading() throws Exception { ProcessResult pr = server.executeBrowser("SignedAppletCodebaseLoading.html", AutoClose.CLOSE_ON_CORRECT_END); assertProperStart(pr); assertCloseString(pr); } private static void assertProperStart(ProcessResult pr) { assertTrue("applet did not initialize", pr.stdout.contains(RUNNING_STRING)); } private static void assertCloseString(ProcessResult pr) { assertTrue("applet should have closed normally", pr.stdout.contains(CLOSE_STRING)); } } icedtea-web-1.6.2/tests/reproducers/custom/SignedAppletCodebaseLoading/PaxHeaders.17941/srcs0000644000000000000000000000013212654402377026656 xustar0030 mtime=1454507263.255432341 30 atime=1454507658.776157397 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/SignedAppletCodebaseLoading/srcs/0000755000175000002070000000000012654402377027456 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/SignedAppletCodebaseLoading/srcs/PaxHeaders.17941/SignedA0000644000000000000000000000032612654402377030175 xustar00124 path=icedtea-web-1.6.2/tests/reproducers/custom/SignedAppletCodebaseLoading/srcs/SignedAppletCodebaseLoadingHelper.java 30 mtime=1454507263.255432341 30 atime=1454507327.226579177 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/SignedAppletCodebaseLoading/srcs/SignedAppletCodebaseLoad0000644000175000002070000000353312654402377034212 0ustar00jvanekmock00000000000000/* SignedAppletCodebaseLoadingHelper.java Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package helper; import signed.SignedAppletCodebaseLoading; public class SignedAppletCodebaseLoadingHelper { public static String getMessage() { return "SignedAppletCodebaseLoading Applet Running"; } } icedtea-web-1.6.2/tests/reproducers/custom/SignedAppletCodebaseLoading/srcs/PaxHeaders.17941/SignedA0000644000000000000000000000031712654402377030175 xustar00118 path=icedtea-web-1.6.2/tests/reproducers/custom/SignedAppletCodebaseLoading/srcs/SignedAppletCodebaseLoading.java 30 mtime=1454507263.255432341 29 atime=1454507327.22557919 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/SignedAppletCodebaseLoading/srcs/SignedAppletCodebaseLoad0000644000175000002070000000370512654402377034213 0ustar00jvanekmock00000000000000/* SignedAppletCodebaseLoading.java Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package signed; import helper.SignedAppletCodebaseLoadingHelper; import java.applet.Applet; public class SignedAppletCodebaseLoading extends Applet { @Override public void start() { System.out.println(SignedAppletCodebaseLoadingHelper.getMessage()); System.out.println("*** APPLET FINISHED ***"); } } icedtea-web-1.6.2/tests/reproducers/custom/SignedAppletCodebaseLoading/srcs/PaxHeaders.17941/Makefil0000644000000000000000000000013112654402377030225 xustar0030 mtime=1454507263.254432354 29 atime=1454507327.22557919 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/SignedAppletCodebaseLoading/srcs/Makefile0000644000175000002070000000217312654402377031121 0ustar00jvanekmock00000000000000TESTNAME=SignedAppletCodebaseLoading SRC_FILES=SignedAppletCodebaseLoading.java SignedAppletCodebaseLoadingHelper.java JAVAC_CLASSPATH=$(TEST_EXTENSIONS_DIR):$(NETX_DIR)/lib/classes.jar JAVAC=$(EXPORTED_JAVAC) JAR=$(EXPORTED_JAR) JARSIGNER=$(EXPORTED_JARSIGNER) JARSIGNER_CMD=$(JARSIGNER) -keystore $(TOP_BUILD_DIR)/$(PRIVATE_KEYSTORE_NAME) -storepass $(PRIVATE_KEYSTORE_PASS) -keypass $(PRIVATE_KEYSTORE_PASS) TMPDIR:=$(shell mktemp -d) prepare-reproducer: echo PREPARING REPRODUCER $(TESTNAME) $(JAVAC) -d $(TMPDIR) -classpath $(JAVAC_CLASSPATH) $(SRC_FILES); \ cp ../resources/* $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR); \ cd $(TMPDIR); \ $(JAR) cfe SignedAppletCodebaseLoading.jar signed.SignedAppletCodebaseLoading signed; \ cd -; \ $(JARSIGNER_CMD) -sigfile Alpha $(TMPDIR)/SignedAppletCodebaseLoading.jar $(TEST_CERT_ALIAS)_signed; \ cp $(TMPDIR)/SignedAppletCodebaseLoading.jar $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR); \ cp -r $(TMPDIR)/helper $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR); \ echo PREPARED REPRODUCER $(TESTNAME), removing $(TMPDIR); \ rm -rf $(TMPDIR); \ clean-reproducer: echo NOTHING TO CLEAN FOR $(TESTNAME) icedtea-web-1.6.2/tests/reproducers/custom/SignedAppletCodebaseLoading/PaxHeaders.17941/resources0000644000000000000000000000013212654402377027716 xustar0030 mtime=1454507263.254432354 30 atime=1454507658.776157397 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/SignedAppletCodebaseLoading/resources/0000755000175000002070000000000012654402377030516 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/SignedAppletCodebaseLoading/resources/PaxHeaders.17941/Si0000644000000000000000000000032412654402377030274 xustar00123 path=icedtea-web-1.6.2/tests/reproducers/custom/SignedAppletCodebaseLoading/resources/SignedAppletCodebaseLoading.html 30 mtime=1454507263.254432354 29 atime=1454507327.22557919 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/SignedAppletCodebaseLoading/resources/SignedAppletCodebas0000644000175000002070000000407512654402377034307 0ustar00jvanekmock00000000000000 icedtea-web-1.6.2/tests/reproducers/custom/PaxHeaders.17941/PartiallySignedAppletManifestSpecifiesSa0000644000000000000000000000013212654402377030450 xustar0030 mtime=1454507263.254432354 30 atime=1454507658.776157397 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/0000755000175000002070000000000012654402377032303 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/PaxHeaders.0000644000000000000000000000013212654402377031075 xustar0030 mtime=1454507263.254432354 30 atime=1454507658.776157397 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/testcases/0000755000175000002070000000000012654402377034301 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/testcases/P0000644000000000000000000000037512654402377031201 xustar00164 path=icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/testcases/PartiallySignedAppletManifestSpecifiesSandboxTests.java 30 mtime=1454507263.254432354 29 atime=1454507327.22557919 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/testcases/P0000644000175000002070000002716112654402377034432 0ustar00jvanekmock00000000000000/* SignedAppletManifestSpecifiesSandboxTests.java Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import static org.junit.Assert.assertTrue; import java.io.IOException; import java.util.AbstractMap; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.annotations.Bug; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.ManifestAttributesChecker; import net.sourceforge.jnlp.security.appletextendedsecurity.AppletSecurityLevel; import net.sourceforge.jnlp.tools.DeploymentPropertiesModifier; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; public class PartiallySignedAppletManifestSpecifiesSandboxTests extends BrowserTest { private static final String STARTING_STRING = "PartiallySignedAppletManifestSpecifiesSandbox Applet Starting"; private static final String CLOSE_STRING = AutoOkClosingListener.MAGICAL_OK_CLOSING_STRING; private static final String UNSIGNED_EXPECTED_STDOUT_PRINT = "UNSIGNED: SECURITY EXCEPTION"; private static final String SIGNED_EXPECTED_STDOUT_PRINT = "IS SIGNED: SECURITY EXCEPTION"; private static final String STACKTRACE_EX_TYPE = "AccessControlException"; private static final String STACKTRACE_NOT_GRANT_PERMISSIONS_TYPE = "Cannot grant permissions to unsigned jars"; private static final String USER_HOME = System.getProperty("user.home"); private static DeploymentPropertiesModifier.MultipleDeploymentPropertiesModifier modifier; @BeforeClass public static void setupDeploymentProperties() throws IOException { modifier = new DeploymentPropertiesModifier.MultipleDeploymentPropertiesModifier( new AbstractMap.SimpleEntry<>(DeploymentConfiguration.KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK, ManifestAttributesChecker.MANIFEST_ATTRIBUTES_CHECK.PERMISSIONS.toString()), new AbstractMap.SimpleEntry<>(DeploymentConfiguration.KEY_SECURITY_LEVEL, AppletSecurityLevel.ALLOW_UNSIGNED.toChars() ) ); modifier.setProperties(); } @AfterClass public static void setbackDeploymentProperties() throws IOException { modifier.restoreProperties(); } @Test @NeedsDisplay @TestInBrowsers(testIn={Browsers.one}) @Bug(id="PR1769") public void testPartiallySignedAppletWithSandboxPermissionsInManifestLaunchWithUnsignedHTMLApp() throws Exception { final ProcessResult pr = server.executeBrowser("PartiallySignedAppletManifestSpecifiesSandboxUnsigned.html", new AutoOkClosingListener(), null); assertProperResult(pr); } @Test @NeedsDisplay @TestInBrowsers(testIn={Browsers.one}) @Bug(id="PR1769") public void testPartiallySignedAppletWithSandboxPermissionsInManifestLaunchWithSignedHTMLApp() throws Exception { final ProcessResult pr = server.executeBrowser("PartiallySignedAppletManifestSpecifiesSandboxSigned.html", new AutoOkClosingListener(), null); assertProperResult(pr); } @Test @NeedsDisplay @TestInBrowsers(testIn={Browsers.one}) @Bug(id="PR1769") public void testPartiallySignedJNLPAppletWithSandboxPermissionsInManifestLaunchWithUnsignedApp() throws Exception { final ProcessResult pr = server.executeBrowser("PartiallySignedAppletManifestSpecifiesSandboxUnsignedJNLPhref.html", new AutoOkClosingListener(), null); assertProperResult(pr); } @Test @NeedsDisplay @TestInBrowsers(testIn={Browsers.one}) @Bug(id="PR1769") public void testPartiallySignedJNLPAppletWithSandboxPermissionsInManifestLaunchWithSignedApp() throws Exception { final ProcessResult pr = server.executeBrowser("PartiallySignedAppletManifestSpecifiesSandboxSignedJNLPhref.html", new AutoOkClosingListener(), null); assertProperResult(pr); } @Test @Bug(id="PR1769") public void testPartiallySignedJNLPAppletWithSandboxPermissionsInManifestLaunchSigned() throws Exception { final ProcessResult pr = server.executeJavawsHeadless("PartiallySignedAppletManifestSpecifiesSandboxSigned.jnlp"); assertProperResult(pr); } @Test @Bug(id="PR1769") public void testPartiallySignedJNLPAppletWithSandboxPermissionsInManifestLaunchUnsigned() throws Exception { final ProcessResult pr = server.executeJavawsHeadless("PartiallySignedAppletManifestSpecifiesSandboxUnsigned.jnlp"); assertProperResult(pr); } @Test @Bug(id="PR1769") public void testPartiallySignedJNLPApplicationWithSandboxPermissionsInManifestLaunchSigned() throws Exception { final ProcessResult pr = server.executeJavawsHeadless("PartiallySignedApplicationManifestSpecifiesSandboxSigned.jnlp"); assertProperResult(pr); } @Test @Bug(id="PR1769") public void testPartiallySignedJNLPApplicationWithSandboxPermissionsInManifestLaunchUnsigned() throws Exception { final ProcessResult pr = server.executeJavawsHeadless("PartiallySignedApplicationManifestSpecifiesSandboxUnsigned.jnlp"); assertProperResult(pr); } @Test @NeedsDisplay @TestInBrowsers(testIn={Browsers.one}) @Bug(id="PR1769") public void testPartiallySignedAppletWithAllPermissionsInManifestLaunchWithUnsignedHTMLApp() throws Exception { final ProcessResult pr = server.executeBrowser("PartiallySignedAppletManifestSpecifiesAllPermissionUnsigned.html", new AutoOkClosingListener(), null); assertProperResult(pr); } @Test @NeedsDisplay @TestInBrowsers(testIn={Browsers.one}) @Bug(id="PR1769") public void testPartiallySignedAppletWithAllPermissionsInManifestLaunchWithSignedHTMLApp() throws Exception { final ProcessResult pr = server.executeBrowser("PartiallySignedAppletManifestSpecifiesAllPermissionSigned.html", new AutoOkClosingListener(), null); assertProperResultSignedAllowedAccess(pr); } @Test @NeedsDisplay @TestInBrowsers(testIn={Browsers.one}) @Bug(id="PR1769") public void testPartiallySignedJNLPAppletWithAllPermissionsInManifestLaunchWithUnsignedApp() throws Exception { final ProcessResult pr = server.executeBrowser("PartiallySignedAppletManifestSpecifiesAllPermissionUnsignedJNLPhref.html", new AutoOkClosingListener(), null); assertProperResult(pr); } @Test @NeedsDisplay @TestInBrowsers(testIn={Browsers.one}) @Bug(id="PR1769") public void testPartiallySignedJNLPAppletWithAllPermissionsInManifestLaunchWithSignedApp() throws Exception { final ProcessResult pr = server.executeBrowser("PartiallySignedAppletManifestSpecifiesAllPermissionSignedJNLPhref.html", new AutoOkClosingListener(), null); assertProperResultSignedAllowedAccess(pr); } @Test @Bug(id="PR1769") public void testPartiallySignedJNLPAppletWithAllPermissionsInManifestLaunchSigned() throws Exception { final ProcessResult pr = server.executeJavawsHeadless("PartiallySignedAppletManifestSpecifiesAllPermissionSigned.jnlp"); assertJNLPPartialSignedNotRun(pr); } @Test @Bug(id="PR1769") public void testPartiallySignedJNLPAppletWithAllPermissionsInManifestLaunchUnsigned() throws Exception { final ProcessResult pr = server.executeJavawsHeadless("PartiallySignedAppletManifestSpecifiesAllPermissionUnsigned.jnlp"); assertJNLPPartialSignedNotRun(pr); } @Test @Bug(id="PR1769") public void testPartiallySignedJNLPApplicationWithAllPermissionsInManifestLaunchSigned() throws Exception { final ProcessResult pr = server.executeJavawsHeadless("PartiallySignedApplicationManifestSpecifiesAllPermissionSigned.jnlp"); assertJNLPPartialSignedNotRun(pr); } @Test @Bug(id="PR1769") public void testPartiallySignedJNLPApplicationWithAllPermissionsInManifestLaunchUnsigned() throws Exception { final ProcessResult pr = server.executeJavawsHeadless("PartiallySignedApplicationManifestSpecifiesAllPermissionUnsigned.jnlp"); assertJNLPPartialSignedNotRun(pr); } private static void assertProperResult(ProcessResult pr) { assertCorrectInit(pr); assertStdoutContainsUnsignedSecurityException(pr); assertStdoutContainsSignedSecurityException(pr); assertStderrContainsStacktrace(pr); assertCorrectClose(pr); } private static void assertProperResultSignedAllowedAccess(ProcessResult pr) { assertCorrectInit(pr); assertStdoutContainsUnsignedSecurityException(pr); assertStdoutContainsUserHome(pr); assertStderrContainsStacktrace(pr); assertCorrectClose(pr); } private static void assertJNLPPartialSignedNotRun(ProcessResult pr) { assertTrue("Applet should have not allowed the Partially Signed JNLP to launch", pr.stderr.contains(STACKTRACE_NOT_GRANT_PERMISSIONS_TYPE)); } private static void assertCorrectInit(ProcessResult pr) { assertTrue("Applet should have initialized", pr.stdout.contains(STARTING_STRING)); } private static void assertCorrectClose(ProcessResult pr) { assertTrue("Applet should have printed its exit string", pr.stdout.contains(CLOSE_STRING)); } private static void assertStderrContainsStacktrace(ProcessResult pr) { assertTrue("Applet should have produced an AccessControlException stacktrace", pr.stderr.contains(STACKTRACE_EX_TYPE)); } private static void assertStdoutContainsUnsignedSecurityException(ProcessResult pr) { assertTrue("Applet should have printed UNSIGNED: SECURITY EXCEPTION", pr.stdout.contains(UNSIGNED_EXPECTED_STDOUT_PRINT)); } private static void assertStdoutContainsSignedSecurityException(ProcessResult pr) { assertTrue("Applet should have printed SIGNED: SECURITY EXCEPTION", pr.stdout.contains(SIGNED_EXPECTED_STDOUT_PRINT)); } private static void assertStdoutContainsUserHome(ProcessResult pr) { assertTrue("Applet should have printed "+USER_HOME, pr.stdout.contains(USER_HOME)); } } icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/PaxHeaders.0000644000000000000000000000013212654402377031075 xustar0030 mtime=1454507263.253432368 30 atime=1454507658.776157397 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/srcs/0000755000175000002070000000000012654402377033255 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/srcs/PaxHea0000644000000000000000000000037412654402377031123 xustar00162 path=icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/srcs/PartiallySignedAppletManifestSpecifiesSandboxUnsigned.java 30 mtime=1454507263.253432368 30 atime=1454507327.224579203 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/srcs/Partia0000644000175000002070000000526012654402377034423 0ustar00jvanekmock00000000000000/* MixedSigningAppletHelper.java Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package unsigned; import java.applet.Applet; import java.lang.SecurityException; import static signed.PartiallySignedAppletManifestSpecifiesSandboxSigned.getPropSigned; /* See also signed/PartiallySignedAppletManifestSpecifiesSandboxSigned */ public class PartiallySignedAppletManifestSpecifiesSandboxUnsigned extends Applet { public static void main(String[] args) { Applet app = new PartiallySignedAppletManifestSpecifiesSandboxUnsigned(); app.init(); } @Override public void init() { System.out.println("PartiallySignedAppletManifestSpecifiesSandbox Applet Starting"); System.out.println("UNSIGNED: " + getPropUnsigned("user.home")); System.out.println("IS SIGNED: " + getPropSigned("user.home")); System.out.println("*** APPLET FINISHED ***"); } public static String getPropUnsigned(final String key) { try { return System.getProperty(key); } catch (final SecurityException se) { se.printStackTrace(); return "SECURITY EXCEPTION"; } } } icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/srcs/PaxHea0000644000000000000000000000037212654402377031121 xustar00160 path=icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/srcs/PartiallySignedAppletManifestSpecifiesSandboxSigned.java 30 mtime=1454507263.253432368 30 atime=1454507327.224579203 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/srcs/Partia0000644000175000002070000000516012654402377034422 0ustar00jvanekmock00000000000000/* SignedAppletManifestSpecifiesSandbox.java Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package signed; import java.applet.Applet; import java.lang.SecurityException; import static unsigned.PartiallySignedAppletManifestSpecifiesSandboxUnsigned.getPropUnsigned; public class PartiallySignedAppletManifestSpecifiesSandboxSigned extends Applet{ public static void main(String[] args) { Applet app = new PartiallySignedAppletManifestSpecifiesSandboxSigned(); app.init(); } @Override public void init() { System.out.println("PartiallySignedAppletManifestSpecifiesSandbox Applet Starting"); System.out.println("UNSIGNED: " + getPropUnsigned("user.home")); System.out.println("IS SIGNED: " + getPropSigned("user.home")); System.out.println("*** APPLET FINISHED ***"); } public static String getPropSigned(final String key) { try { return System.getProperty(key); } catch (final SecurityException se) { se.printStackTrace(); return "SECURITY EXCEPTION"; } } } icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/srcs/PaxHea0000644000000000000000000000031212654402377031113 xustar00112 path=icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/srcs/Makefile 30 mtime=1454507263.253432368 30 atime=1454507327.224579203 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/srcs/Makefi0000644000175000002070000000371112654402377034376 0ustar00jvanekmock00000000000000TESTNAME=PartiallySignedAppletManifestSpecifiesSandbox SRC_FILES=PartiallySignedAppletManifestSpecifiesSandboxSigned.java PartiallySignedAppletManifestSpecifiesSandboxUnsigned.java ENTRYPOINT_CLASSES=PartiallySignedAppletManifestSpecifiesSandboxHelper JAVAC_CLASSPATH=$(TEST_EXTENSIONS_DIR):$(NETX_DIR)/lib/classes.jar JAVAC=$(EXPORTED_JAVAC) JAR=$(EXPORTED_JAR) JARSIGNER=$(EXPORTED_JARSIGNER) JARSIGNER_CMD=$(JARSIGNER) -keystore $(TOP_BUILD_DIR)/$(PRIVATE_KEYSTORE_NAME) -storepass $(PRIVATE_KEYSTORE_PASS) -keypass $(PRIVATE_KEYSTORE_PASS) TMPDIR:=$(shell mktemp -d) prepare-reproducer: echo PREPARING REPRODUCER $(TESTNAME) $(JAVAC) -d $(TMPDIR) -classpath $(JAVAC_CLASSPATH) $(SRC_FILES); \ cp ../resources/* $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR); \ cp ../srcs/MANIFEST.MF* $(TMPDIR); \ cd $(TMPDIR); \ $(JAR) cfme PartiallySignedAppletManifestSpecifiesSandboxSigned.jar MANIFEST.MF.1 signed.PartiallySignedAppletManifestSpecifiesSandboxSigned signed; \ $(JAR) cfme PartiallySignedAppletManifestSpecifiesSandbox.jar MANIFEST.MF.1 unsigned.PartiallySignedAppletManifestSpecifiesSandboxUnsigned unsigned; \ $(JAR) cfme PartiallySignedAppletManifestSpecifiesAllPermissionSigned.jar MANIFEST.MF.2 signed.PartiallySignedAppletManifestSpecifiesSandboxSigned signed; \ $(JAR) cfme PartiallySignedAppletManifestSpecifiesAllPermission.jar MANIFEST.MF.2 unsigned.PartiallySignedAppletManifestSpecifiesSandboxUnsigned unsigned; \ cd -; \ $(JARSIGNER_CMD) -sigfile Alpha $(TMPDIR)/PartiallySignedAppletManifestSpecifiesSandboxSigned.jar $(TEST_CERT_ALIAS)_signed; \ $(JARSIGNER_CMD) -sigfile Alpha $(TMPDIR)/PartiallySignedAppletManifestSpecifiesAllPermissionSigned.jar $(TEST_CERT_ALIAS)_signed; \ cp $(TMPDIR)/PartiallySignedAppletManifestSpecifies{Sandbox,AllPermission}{Signed,}.jar $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR); \ echo PREPARED REPRODUCER $(TESTNAME), removing $(TMPDIR); \ rm -rf $(TMPDIR); \ clean-reproducer: echo NOTHING TO CLEAN FOR $(TESTNAME) icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/srcs/PaxHea0000644000000000000000000000031712654402377031120 xustar00117 path=icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/srcs/MANIFEST.MF.2 30 mtime=1454507263.253432368 30 atime=1454507327.224579203 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/srcs/MANIFE0000644000175000002070000000022712654402377034140 0ustar00jvanekmock00000000000000Permissions: all-permissions Application-Library-Allowable-Codebase: http://localhost Application-Name: PartiallySignedAppletManifestSpecifiesSandbox icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/srcs/PaxHea0000644000000000000000000000031712654402377031120 xustar00117 path=icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/srcs/MANIFEST.MF.1 30 mtime=1454507263.252432381 30 atime=1454507327.223579217 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/srcs/MANIFE0000644000175000002070000000021712654402377034137 0ustar00jvanekmock00000000000000Permissions: sandbox Application-Library-Allowable-Codebase: http://localhost Application-Name: PartiallySignedAppletManifestSpecifiesSandbox icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/PaxHeaders.0000644000000000000000000000013212654402377031075 xustar0030 mtime=1454507263.252432381 30 atime=1454507658.776157397 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/0000755000175000002070000000000012654402377034315 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/P0000644000000000000000000000040612654402377031210 xustar00172 path=icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/PartiallySignedApplicationManifestSpecifiesSandboxUnsigned.jnlp 30 mtime=1454507263.252432381 30 atime=1454507327.223579217 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/P0000644000175000002070000000462212654402377034443 0ustar00jvanekmock00000000000000 PartiallySigningAppletUnsigned IcedTea Test Partially Signing Applet Specifying Sandbox icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/P0000644000000000000000000000040412654402377031206 xustar00170 path=icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/PartiallySignedApplicationManifestSpecifiesSandboxSigned.jnlp 30 mtime=1454507263.252432381 30 atime=1454507327.223579217 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/P0000644000175000002070000000461212654402377034442 0ustar00jvanekmock00000000000000 PartiallySigningAppletSigned IcedTea Test Partially Signing Applet Specifying Sandbox icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/P0000644000000000000000000000041412654402377031207 xustar00178 path=icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/PartiallySignedApplicationManifestSpecifiesAllPermissionUnsigned.jnlp 30 mtime=1454507263.252432381 30 atime=1454507327.223579217 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/P0000644000175000002070000000466212654402377034447 0ustar00jvanekmock00000000000000 PartiallySigningAppletUnsigned IcedTea Test Partially Signing Applet Specifying AllPermission icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/P0000644000000000000000000000041212654402377031205 xustar00176 path=icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/PartiallySignedApplicationManifestSpecifiesAllPermissionSigned.jnlp 30 mtime=1454507263.251432394 30 atime=1454507327.223579217 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/P0000644000175000002070000000465212654402377034446 0ustar00jvanekmock00000000000000 PartiallySigningAppletSigned IcedTea Test Partially Signing Applet Specifying AllPermission icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/P0000644000000000000000000000041012654402377031203 xustar00175 path=icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/PartiallySignedAppletManifestSpecifiesSandboxUnsignedJNLPhref.html 30 mtime=1454507263.251432394 29 atime=1454507327.22257923 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/P0000644000175000002070000000360312654402377034441 0ustar00jvanekmock00000000000000 icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/P0000644000000000000000000000040012654402377031202 xustar00167 path=icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/PartiallySignedAppletManifestSpecifiesSandboxUnsigned.jnlp 30 mtime=1454507263.251432394 29 atime=1454507327.22257923 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/P0000644000175000002070000000460312654402377034442 0ustar00jvanekmock00000000000000 PartiallySigningAppletUnsigned IcedTea Test Partially Signing Applet Specifying Sandbox icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/P0000644000000000000000000000040012654402377031202 xustar00167 path=icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/PartiallySignedAppletManifestSpecifiesSandboxUnsigned.html 30 mtime=1454507263.251432394 29 atime=1454507327.22257923 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/P0000644000175000002070000000370512654402377034444 0ustar00jvanekmock00000000000000 icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/P0000644000000000000000000000040612654402377031210 xustar00173 path=icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/PartiallySignedAppletManifestSpecifiesSandboxSignedJNLPhref.html 30 mtime=1454507263.250432408 29 atime=1454507327.22257923 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/P0000644000175000002070000000357312654402377034447 0ustar00jvanekmock00000000000000 icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/P0000644000000000000000000000037612654402377031216 xustar00165 path=icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/PartiallySignedAppletManifestSpecifiesSandboxSigned.jnlp 30 mtime=1454507263.250432408 29 atime=1454507327.22257923 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/P0000644000175000002070000000457312654402377034450 0ustar00jvanekmock00000000000000 PartiallySigningAppletSigned IcedTea Test Partially Signing Applet Specifying Sandbox icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/P0000644000000000000000000000037712654402377031217 xustar00165 path=icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/PartiallySignedAppletManifestSpecifiesSandboxSigned.html 30 mtime=1454507263.250432408 30 atime=1454507327.221579243 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/P0000644000175000002070000000370012654402377034437 0ustar00jvanekmock00000000000000 icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/P0000644000000000000000000000041712654402377031212 xustar00181 path=icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/PartiallySignedAppletManifestSpecifiesAllPermissionUnsignedJNLPhref.html 30 mtime=1454507263.250432408 30 atime=1454507327.221579243 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/P0000644000175000002070000000361112654402377034440 0ustar00jvanekmock00000000000000 icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/P0000644000000000000000000000040712654402377031211 xustar00173 path=icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/PartiallySignedAppletManifestSpecifiesAllPermissionUnsigned.jnlp 30 mtime=1454507263.249432421 30 atime=1454507327.221579243 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/P0000644000175000002070000000464312654402377034446 0ustar00jvanekmock00000000000000 PartiallySigningAppletUnsigned IcedTea Test Partially Signing Applet Specifying AllPermission icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/P0000644000000000000000000000040712654402377031211 xustar00173 path=icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/PartiallySignedAppletManifestSpecifiesAllPermissionUnsigned.html 30 mtime=1454507263.249432421 30 atime=1454507327.221579243 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/P0000644000175000002070000000372112654402377034442 0ustar00jvanekmock00000000000000 icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/P0000644000000000000000000000041512654402377031210 xustar00179 path=icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/PartiallySignedAppletManifestSpecifiesAllPermissionSignedJNLPhref.html 30 mtime=1454507263.249432421 30 atime=1454507327.221579243 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/P0000644000175000002070000000360112654402377034437 0ustar00jvanekmock00000000000000 icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/P0000644000000000000000000000040512654402377031207 xustar00171 path=icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/PartiallySignedAppletManifestSpecifiesAllPermissionSigned.jnlp 30 mtime=1454507263.249432421 30 atime=1454507327.221579243 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/P0000644000175000002070000000463312654402377034445 0ustar00jvanekmock00000000000000 PartiallySigningAppletSigned IcedTea Test Partially Signing Applet Specifying AllPermission icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/P0000644000000000000000000000040512654402377031207 xustar00171 path=icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/PartiallySignedAppletManifestSpecifiesAllPermissionSigned.html 30 mtime=1454507263.248432434 30 atime=1454507327.220579256 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/P0000644000175000002070000000371512654402377034445 0ustar00jvanekmock00000000000000 icedtea-web-1.6.2/tests/reproducers/custom/PaxHeaders.17941/PackGZip0000644000000000000000000000013212654402377022051 xustar0030 mtime=1454507263.248432434 30 atime=1454507658.776157397 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/PackGZip/0000755000175000002070000000000012654402377022651 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/PackGZip/PaxHeaders.17941/testcases0000644000000000000000000000013212654402377024047 xustar0030 mtime=1454507263.248432434 30 atime=1454507658.776157397 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/PackGZip/testcases/0000755000175000002070000000000012654402377024647 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/PackGZip/testcases/PaxHeaders.17941/PackGZipTest.java0000644000000000000000000000013212654402377027277 xustar0030 mtime=1454507263.248432434 30 atime=1454507327.220579256 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/PackGZip/testcases/PackGZipTest.java0000644000175000002070000000727012654402377030030 0ustar00jvanekmock00000000000000/* Copyright (C) 2014 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 org.junit.Assert; import org.junit.Before; import org.junit.Test; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.annotations.KnownToFail; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.cache.CacheUtil; import net.sourceforge.jnlp.closinglisteners.CountingClosingListener; public class PackGZipTest extends BrowserTest { private static final String initStr = "init"; private class CountingClosingListenerImpl extends CountingClosingListener { @Override protected boolean isAlowedToFinish(String s) { return s.contains(initStr); } } @Before public void setup() { CacheUtil.clearCache(); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void testBrowserJNLP() throws Exception { String url = "/PackGZipJNLP.html"; ProcessResult pr = server.executeBrowser(url, new CountingClosingListenerImpl(), new CountingClosingListenerImpl()); Assert.assertTrue("stdout should contain " + initStr + ", but it didnt.", pr.stdout.contains(initStr)); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void testBrowserApplet() throws Exception { String url = "/PackGZipApplet.html"; ProcessResult pr = server.executeBrowser(url, new CountingClosingListenerImpl(), new CountingClosingListenerImpl()); Assert.assertTrue("stdout should contain " + initStr + ", but it didnt.", pr.stdout.contains(initStr)); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void testJavawsJNLP() throws Exception { String url = "/PackGZip.jnlp"; ProcessResult pr = server.executeJavawsHeadless(url, new CountingClosingListenerImpl(), new CountingClosingListenerImpl()); Assert.assertTrue("stdout should contain " + initStr + ", but it didnt.", pr.stdout.contains(initStr)); } } icedtea-web-1.6.2/tests/reproducers/custom/PackGZip/PaxHeaders.17941/srcs0000644000000000000000000000013212654402377023023 xustar0030 mtime=1454507263.248432434 30 atime=1454507658.776157397 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/PackGZip/srcs/0000755000175000002070000000000012654402377023623 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/PackGZip/srcs/PaxHeaders.17941/PackGZip.java0000644000000000000000000000013212654402377025413 xustar0030 mtime=1454507263.248432434 30 atime=1454507327.220579256 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/PackGZip/srcs/PackGZip.java0000644000175000002070000000347212654402377026144 0ustar00jvanekmock00000000000000/* Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.applet.Applet; import java.lang.System; public class PackGZip extends Applet { private static final String initStr = "init"; @Override public void init() { System.out.println(initStr); } } icedtea-web-1.6.2/tests/reproducers/custom/PackGZip/srcs/PaxHeaders.17941/Makefile0000644000000000000000000000013212654402377024540 xustar0030 mtime=1454507263.248432434 30 atime=1454507327.220579256 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/PackGZip/srcs/Makefile0000644000175000002070000000140512654402377025263 0ustar00jvanekmock00000000000000TESTNAME=PackGZip JAVAC_CLASSPATH=$(TEST_EXTENSIONS_DIR):$(NETX_DIR)/lib/classes.jar JAVAC=$(EXPORTED_JAVAC) JAR=$(EXPORTED_JAR) JARSIGNER=$(EXPORTED_JARSIGNER) PACKER=$(EXPORTED_PACK200) TMPDIR:=$(shell mktemp -d) prepare-reproducer: echo PREPARING REPRODUCER $(TESTNAME) $(JAVAC) -d $(TMPDIR) -classpath $(JAVAC_CLASSPATH) $(TESTNAME).java; \ cp ../resources/* $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR); \ cd $(TMPDIR); \ $(JAR) cf $(TESTNAME).jar $(TESTNAME).class; \ cd $(TMPDIR); \ $(PACKER) $(TESTNAME).jar.pack.gz $(TESTNAME).jar; \ cp $(TMPDIR)/$(TESTNAME).jar.pack.gz $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR); \ echo PREPARED REPRODUCER $(TESTNAME), removing $(TMPDIR); \ rm -rf $(TMPDIR); \ clean-reproducer: echo NOTHING TO CLEAN FOR $(TESTNAME) icedtea-web-1.6.2/tests/reproducers/custom/PackGZip/PaxHeaders.17941/resources0000644000000000000000000000013212654402377024063 xustar0030 mtime=1454507263.247432448 30 atime=1454507658.776157397 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/PackGZip/resources/0000755000175000002070000000000012654402377024663 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/PackGZip/resources/PaxHeaders.17941/PackGZipJNLP.html0000644000000000000000000000013212654402377027162 xustar0030 mtime=1454507263.247432448 30 atime=1454507327.220579256 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/PackGZip/resources/PackGZipJNLP.html0000644000175000002070000000040712654402377027706 0ustar00jvanekmock00000000000000 icedtea-web-1.6.2/tests/reproducers/custom/PackGZip/resources/PaxHeaders.17941/PackGZipApplet.html0000644000000000000000000000013212654402377027644 xustar0030 mtime=1454507263.247432448 30 atime=1454507327.220579256 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/PackGZip/resources/PackGZipApplet.html0000644000175000002070000000051012654402377030363 0ustar00jvanekmock00000000000000 icedtea-web-1.6.2/tests/reproducers/custom/PackGZip/resources/PaxHeaders.17941/PackGZip.jnlp0000644000000000000000000000013112654402377026474 xustar0030 mtime=1454507263.247432448 29 atime=1454507327.21957927 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/PackGZip/resources/PackGZip.jnlp0000644000175000002070000000407412654402377027225 0ustar00jvanekmock00000000000000 simple application IcedTea icedtea-web-1.6.2/tests/reproducers/custom/PaxHeaders.17941/NoClassDeff0000644000000000000000000000013212654402377022530 xustar0030 mtime=1454507263.246432461 30 atime=1454507658.776157397 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/NoClassDeff/0000755000175000002070000000000012654402377023330 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/NoClassDeff/PaxHeaders.17941/testcases0000644000000000000000000000013212654402377024526 xustar0030 mtime=1454507263.246432461 30 atime=1454507658.776157397 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/NoClassDeff/testcases/0000755000175000002070000000000012654402377025326 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/NoClassDeff/testcases/PaxHeaders.17941/NoClassDeffTest.ja0000644000000000000000000000013112654402377030105 xustar0030 mtime=1454507263.247432448 29 atime=1454507327.21957927 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/NoClassDeff/testcases/NoClassDeffTest.java0000644000175000002070000010604712654402377031170 0ustar00jvanekmock00000000000000/* NoClassDeffTest.java Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.io.File; import java.io.IOException; 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.annotations.Bug; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; import net.sourceforge.jnlp.closinglisteners.StringBasedClosingListener; import net.sourceforge.jnlp.util.FileUtils; import org.junit.Assert; import org.junit.Test; @Bug(id = "PR2219") /** * * When NoClassDefFound is thrown from ITW. Current behaviour: javaws app * correctly dies browsers and -html correctly dies * * javaws applet SURVIVES init and start throwing this. But correctly dies in * paint * * */ public class NoClassDeffTest extends BrowserTest { private class NoClassDefFoundErrorClosingListener extends StringBasedClosingListener { public NoClassDefFoundErrorClosingListener() { super(NoClassDefFoundError.class.getSimpleName()); } } private static final String appletCloseString = AutoOkClosingListener.MAGICAL_OK_CLOSING_STRING; private static final String[] HTMLA = new String[]{OptionsDefinitions.OPTIONS.HTML.option}; private static final List HTMLL = Arrays.asList(HTMLA); private static final String JNLPAPP = "NoClassDeffApp.jnlp"; private static final String JNLPAPPLET = "NoClassDeffApplet.jnlp"; private static final String HTML = "NoClassDeff.html"; private static final String HTMLHREF = "NoClassDeffJnlpHref.html"; //jnlp app OK run @Test @NeedsDisplay public void noClassDeffTestWorksJnlp1() throws Exception { prepare("okRun", false); ProcessResult pr = server.executeJavaws(JNLPAPP, new AutoOkClosingListener(), null); Assert.assertFalse(pr.stdout.contains("Loading LostClass")); Assert.assertTrue(pr.stdout.contains("main1")); Assert.assertTrue(pr.stdout.contains("main2")); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertFalse(pr.stdout.contains("EX: ")); } //jnlp bad run 1 @Test @NeedsDisplay public void noClassDeffTestThrowJnlp1() throws Exception { prepare("main", false); ProcessResult pr = server.executeJavaws(JNLPAPP, new AutoOkClosingListener(), null); Assert.assertTrue(pr.stdout.contains("Loading LostClass")); Assert.assertTrue(pr.stdout.contains("main1")); Assert.assertFalse(pr.stdout.contains("main2")); Assert.assertFalse(pr.stdout.contains(appletCloseString)); Assert.assertFalse(pr.stdout.contains("EX: ")); } //jnlp bad run 2 @Test @NeedsDisplay public void noClassDeffTestThrowCatchJnlp1() throws Exception { prepare("main", true); ProcessResult pr = server.executeJavaws(JNLPAPP, new AutoOkClosingListener(), null); Assert.assertTrue(pr.stdout.contains("Loading LostClass")); Assert.assertTrue(pr.stdout.contains("main1")); Assert.assertTrue(pr.stdout.contains("main2")); Assert.assertTrue(pr.stdout.contains("EX: ")); Assert.assertTrue(pr.stdout.contains(appletCloseString)); } //applets OK run //opera should go correctly up to destroy WITHOUT paint //epiphany only start and init //midori up to paint //firefox, no data //-html and jnlp applet get init, start, paint @Test @NeedsDisplay @TestInBrowsers(testIn = {Browsers.one}) public void noClassDeffTestWorksHtml1() throws Exception { prepare("okRun", false); ProcessResult pr = server.executeBrowser(HTML, new AutoOkClosingListener(), null); Assert.assertFalse(pr.stdout.contains("Loading LostClass")); Assert.assertFalse(pr.stdout.contains("EX: ")); Assert.assertTrue(pr.stdout.contains("init1")); Assert.assertTrue(pr.stdout.contains("init2")); Assert.assertTrue(pr.stdout.contains("start1")); Assert.assertTrue(pr.stdout.contains("start2")); // Assert.assertTrue(pr.stdout.contains("paint1")); // Assert.assertTrue(pr.stdout.contains("paint2")); // Assert.assertTrue(pr.stdout.contains("stop1")); // Assert.assertTrue(pr.stdout.contains("stop2")); // Assert.assertTrue(pr.stdout.contains("destroy1")); // Assert.assertTrue(pr.stdout.contains("destroy2")); // Assert.assertTrue(pr.stdout.contains(appletCloseString)); } @Test @NeedsDisplay @TestInBrowsers(testIn = {Browsers.one}) public void noClassDeffTestWorksHtml2() throws Exception { prepare("okRun", false); ProcessResult pr = server.executeBrowser(HTMLHREF, new AutoOkClosingListener(), null); Assert.assertFalse(pr.stdout.contains("Loading LostClass")); Assert.assertFalse(pr.stdout.contains("EX: ")); Assert.assertTrue(pr.stdout.contains("init1")); Assert.assertTrue(pr.stdout.contains("init2")); Assert.assertTrue(pr.stdout.contains("start1")); Assert.assertTrue(pr.stdout.contains("start2")); // Assert.assertTrue(pr.stdout.contains("paint1")); // Assert.assertTrue(pr.stdout.contains("paint2")); // Assert.assertTrue(pr.stdout.contains("stop1")); // Assert.assertTrue(pr.stdout.contains("stop2")); // Assert.assertTrue(pr.stdout.contains("destroy1")); // Assert.assertTrue(pr.stdout.contains("destroy2")); // Assert.assertTrue(pr.stdout.contains(appletCloseString)); } @Test @NeedsDisplay public void noClassDeffTestWorksJnlp2() throws Exception { prepare("okRun", false); ProcessResult pr = server.executeJavaws(JNLPAPPLET, new AutoOkClosingListener(), null); Assert.assertFalse(pr.stdout.contains("Loading LostClass")); Assert.assertFalse(pr.stdout.contains("EX: ")); Assert.assertTrue(pr.stdout.contains("init1")); Assert.assertTrue(pr.stdout.contains("init2")); Assert.assertTrue(pr.stdout.contains("start1")); Assert.assertTrue(pr.stdout.contains("start2")); Assert.assertTrue(pr.stdout.contains("paint1")); Assert.assertTrue(pr.stdout.contains("paint2")); // Assert.assertTrue(pr.stdout.contains("stop1")); // Assert.assertTrue(pr.stdout.contains("stop2")); // Assert.assertTrue(pr.stdout.contains("destroy1")); // Assert.assertTrue(pr.stdout.contains("destroy2")); Assert.assertTrue(pr.stdout.contains(appletCloseString)); } @Test @NeedsDisplay @TestInBrowsers(testIn = {Browsers.one}) public void noClassDeffTestWorksJavawsHtml1() throws Exception { prepare("okRun", false); ProcessResult pr = server.executeJavaws(HTMLL, HTML, new AutoOkClosingListener(), null); Assert.assertFalse(pr.stdout.contains("Loading LostClass")); Assert.assertFalse(pr.stdout.contains("EX: ")); Assert.assertTrue(pr.stdout.contains("init1")); Assert.assertTrue(pr.stdout.contains("init2")); Assert.assertTrue(pr.stdout.contains("start1")); Assert.assertTrue(pr.stdout.contains("start2")); // Assert.assertTrue(pr.stdout.contains("paint1")); // Assert.assertTrue(pr.stdout.contains("paint2")); // Assert.assertTrue(pr.stdout.contains("stop1")); // Assert.assertTrue(pr.stdout.contains("stop2")); // Assert.assertTrue(pr.stdout.contains("destroy1")); // Assert.assertTrue(pr.stdout.contains("destroy2")); } @Test @NeedsDisplay @TestInBrowsers(testIn = {Browsers.one}) public void noClassDeffTestWorksJavawsHtml2() throws Exception { prepare("okRun", false); ProcessResult pr = server.executeJavaws(HTMLL, HTMLHREF, new AutoOkClosingListener(), null); Assert.assertFalse(pr.stdout.contains("Loading LostClass")); Assert.assertFalse(pr.stdout.contains("EX: ")); Assert.assertTrue(pr.stdout.contains("init1")); Assert.assertTrue(pr.stdout.contains("init2")); Assert.assertTrue(pr.stdout.contains("start1")); Assert.assertTrue(pr.stdout.contains("start2")); // Assert.assertTrue(pr.stdout.contains("paint1")); // Assert.assertTrue(pr.stdout.contains("paint2")); // Assert.assertTrue(pr.stdout.contains("stop1")); // Assert.assertTrue(pr.stdout.contains("stop2")); // Assert.assertTrue(pr.stdout.contains("destroy1")); // Assert.assertTrue(pr.stdout.contains("destroy2")); Assert.assertTrue(pr.stdout.contains(appletCloseString)); } //jnlp applets crashes //they behave a bit differently form browser ones @Test @NeedsDisplay public void noClassDeffTestThrowsInitJnlp2() throws Exception { prepare("init", false); ProcessResult pr = server.executeJavaws(JNLPAPPLET, new AutoOkClosingListener(), new NoClassDefFoundErrorClosingListener()); Assert.assertTrue(pr.stdout.contains("Loading LostClass")); Assert.assertFalse(pr.stdout.contains("EX: ")); Assert.assertFalse(pr.stderr.contains(NoClassDefFoundError.class.getSimpleName())); Assert.assertTrue(pr.stdout.contains("init1")); Assert.assertFalse(pr.stdout.contains("init2")); Assert.assertFalse(pr.stdout.contains("start1")); Assert.assertFalse(pr.stdout.contains("start2")); Assert.assertTrue(pr.stdout.contains("paint1")); Assert.assertTrue(pr.stdout.contains("paint2")); // Assert.assertTrue(pr.stdout.contains("stop1")); // Assert.assertTrue(pr.stdout.contains("stop2")); // Assert.assertTrue(pr.stdout.contains("destroy1")); // Assert.assertTrue(pr.stdout.contains("destroy2")); Assert.assertTrue(pr.stdout.contains(appletCloseString)); } @Test @NeedsDisplay public void noClassDeffTestThrowsStartJnlp2() throws Exception { prepare("start", false); ProcessResult pr = server.executeJavaws(JNLPAPPLET, new AutoOkClosingListener(), new NoClassDefFoundErrorClosingListener()); Assert.assertTrue(pr.stdout.contains("Loading LostClass")); Assert.assertFalse(pr.stdout.contains("EX: ")); Assert.assertFalse(pr.stderr.contains(NoClassDefFoundError.class.getSimpleName())); Assert.assertTrue(pr.stdout.contains("init1")); Assert.assertTrue(pr.stdout.contains("init2")); Assert.assertTrue(pr.stdout.contains("start1")); Assert.assertFalse(pr.stdout.contains("start2")); Assert.assertTrue(pr.stdout.contains("paint1")); Assert.assertTrue(pr.stdout.contains("paint2")); // Assert.assertTrue(pr.stdout.contains("stop1")); // Assert.assertTrue(pr.stdout.contains("stop2")); // Assert.assertTrue(pr.stdout.contains("destroy1")); // Assert.assertTrue(pr.stdout.contains("destroy2")); Assert.assertTrue(pr.stdout.contains(appletCloseString)); } @Test @NeedsDisplay public void noClassDeffTestThrowsPaintJnlp2() throws Exception { prepare("paint", false); ProcessResult pr = server.executeJavaws(JNLPAPPLET, new AutoOkClosingListener(), new NoClassDefFoundErrorClosingListener()); Assert.assertTrue(pr.stdout.contains("Loading LostClass")); Assert.assertFalse(pr.stdout.contains("EX: ")); Assert.assertTrue(pr.stderr.contains(NoClassDefFoundError.class.getSimpleName())); Assert.assertTrue(pr.stdout.contains("init1")); Assert.assertTrue(pr.stdout.contains("init2")); Assert.assertTrue(pr.stdout.contains("start1")); Assert.assertTrue(pr.stdout.contains("start2")); Assert.assertTrue(pr.stdout.contains("paint1")); Assert.assertFalse(pr.stdout.contains("paint2")); // Assert.assertTrue(pr.stdout.contains("stop1")); // Assert.assertTrue(pr.stdout.contains("stop2")); // Assert.assertTrue(pr.stdout.contains("destroy1")); // Assert.assertTrue(pr.stdout.contains("destroy2")); Assert.assertFalse(pr.stdout.contains(appletCloseString)); } @Test @NeedsDisplay public void noClassDeffTestThrowsCatchInitJnlp2() throws Exception { prepare("init", true); ProcessResult pr = server.executeJavaws(JNLPAPPLET, new AutoOkClosingListener(), null); Assert.assertTrue(pr.stdout.contains("Loading LostClass")); Assert.assertTrue(pr.stdout.contains("EX: ")); Assert.assertTrue(pr.stdout.contains("init1")); Assert.assertTrue(pr.stdout.contains("init2")); Assert.assertTrue(pr.stdout.contains("start1")); Assert.assertTrue(pr.stdout.contains("start2")); Assert.assertTrue(pr.stdout.contains("paint1")); Assert.assertTrue(pr.stdout.contains("paint2")); // Assert.assertTrue(pr.stdout.contains("stop1")); // Assert.assertTrue(pr.stdout.contains("stop2")); // Assert.assertTrue(pr.stdout.contains("destroy1")); // Assert.assertTrue(pr.stdout.contains("destroy2")); Assert.assertTrue(pr.stdout.contains(appletCloseString)); } @Test @NeedsDisplay public void noClassDeffTestThrowsCatchStartJnlp2() throws Exception { prepare("start", true); ProcessResult pr = server.executeJavaws(JNLPAPPLET, new AutoOkClosingListener(), null); Assert.assertTrue(pr.stdout.contains("Loading LostClass")); Assert.assertTrue(pr.stdout.contains("EX: ")); Assert.assertTrue(pr.stdout.contains("init1")); Assert.assertTrue(pr.stdout.contains("init2")); Assert.assertTrue(pr.stdout.contains("start1")); Assert.assertTrue(pr.stdout.contains("start2")); Assert.assertTrue(pr.stdout.contains("paint1")); Assert.assertTrue(pr.stdout.contains("paint2")); // Assert.assertTrue(pr.stdout.contains("stop1")); // Assert.assertTrue(pr.stdout.contains("stop2")); // Assert.assertTrue(pr.stdout.contains("destroy1")); // Assert.assertTrue(pr.stdout.contains("destroy2")); Assert.assertTrue(pr.stdout.contains(appletCloseString)); } @Test @NeedsDisplay public void noClassDeffTestThrowsCatchPaintJnlp2() throws Exception { prepare("paint", true); ProcessResult pr = server.executeJavaws(JNLPAPPLET, new AutoOkClosingListener(), null); Assert.assertTrue(pr.stdout.contains("Loading LostClass")); Assert.assertTrue(pr.stdout.contains("EX: ")); Assert.assertTrue(pr.stdout.contains("init1")); Assert.assertTrue(pr.stdout.contains("init2")); Assert.assertTrue(pr.stdout.contains("start1")); Assert.assertTrue(pr.stdout.contains("start2")); Assert.assertTrue(pr.stdout.contains("paint1")); Assert.assertTrue(pr.stdout.contains("paint2")); // Assert.assertTrue(pr.stdout.contains("stop1")); // Assert.assertTrue(pr.stdout.contains("stop2")); // Assert.assertTrue(pr.stdout.contains("destroy1")); // Assert.assertTrue(pr.stdout.contains("destroy2")); Assert.assertTrue(pr.stdout.contains(appletCloseString)); } //-html and browser crashes // //applets crash init 1 @Test @NeedsDisplay @TestInBrowsers(testIn = {Browsers.one}) public void noClassDeffTestThrowsInitHtml1() throws Exception { prepare("init", false); ProcessResult pr = server.executeBrowser(HTML, null, new NoClassDefFoundErrorClosingListener()); Assert.assertTrue(pr.stdout.contains("Loading LostClass")); Assert.assertFalse(pr.stdout.contains("EX: ")); Assert.assertTrue(pr.stderr.contains(NoClassDefFoundError.class.getSimpleName())); Assert.assertTrue(pr.stdout.contains("init1")); Assert.assertFalse(pr.stdout.contains("init2")); Assert.assertFalse(pr.stdout.contains("start1")); Assert.assertFalse(pr.stdout.contains("start2")); // Assert.assertTrue(pr.stdout.contains("paint1")); // Assert.assertTrue(pr.stdout.contains("paint2")); // Assert.assertTrue(pr.stdout.contains("stop1")); // Assert.assertTrue(pr.stdout.contains("stop2")); // Assert.assertTrue(pr.stdout.contains("destroy1")); // Assert.assertTrue(pr.stdout.contains("destroy2")); // Assert.assertTrue(pr.stdout.contains(appletCloseString)); } @Test @NeedsDisplay @TestInBrowsers(testIn = {Browsers.one}) public void noClassDeffTestThrowsInitHtml2() throws Exception { prepare("init", false); ProcessResult pr = server.executeBrowser(HTMLHREF, null, new NoClassDefFoundErrorClosingListener()); Assert.assertTrue(pr.stdout.contains("Loading LostClass")); Assert.assertFalse(pr.stdout.contains("EX: ")); Assert.assertTrue(pr.stderr.contains(NoClassDefFoundError.class.getSimpleName())); Assert.assertTrue(pr.stdout.contains("init1")); Assert.assertFalse(pr.stdout.contains("init2")); Assert.assertFalse(pr.stdout.contains("start1")); Assert.assertFalse(pr.stdout.contains("start2")); // Assert.assertTrue(pr.stdout.contains("paint1")); // Assert.assertTrue(pr.stdout.contains("paint2")); // Assert.assertTrue(pr.stdout.contains("stop1")); // Assert.assertTrue(pr.stdout.contains("stop2")); // Assert.assertTrue(pr.stdout.contains("destroy1")); // Assert.assertTrue(pr.stdout.contains("destroy2")); // Assert.assertTrue(pr.stdout.contains(appletCloseString)); } @Test @NeedsDisplay @TestInBrowsers(testIn = {Browsers.one}) public void noClassDeffTestThrowsInitJavawsHtml1() throws Exception { prepare("init", false); ProcessResult pr = server.executeJavaws(HTMLL, HTML, null, new NoClassDefFoundErrorClosingListener()); Assert.assertTrue(pr.stdout.contains("Loading LostClass")); Assert.assertFalse(pr.stdout.contains("EX: ")); Assert.assertTrue(pr.stdout.contains("init1")); Assert.assertTrue(pr.stderr.contains(NoClassDefFoundError.class.getSimpleName())); Assert.assertFalse(pr.stdout.contains("init2")); Assert.assertFalse(pr.stdout.contains("start1")); Assert.assertFalse(pr.stdout.contains("start2")); // Assert.assertTrue(pr.stdout.contains("paint1")); // Assert.assertTrue(pr.stdout.contains("paint2")); // Assert.assertTrue(pr.stdout.contains("stop1")); // Assert.assertTrue(pr.stdout.contains("stop2")); // Assert.assertTrue(pr.stdout.contains("destroy1")); // Assert.assertTrue(pr.stdout.contains("destroy2")); } @Test @NeedsDisplay @TestInBrowsers(testIn = {Browsers.one}) public void noClassDeffTestThrowsInitJavawsHtml2() throws Exception { prepare("init", false); ProcessResult pr = server.executeJavaws(HTMLL, HTMLHREF, null, new NoClassDefFoundErrorClosingListener()); Assert.assertTrue(pr.stdout.contains("Loading LostClass")); Assert.assertFalse(pr.stdout.contains("EX: ")); Assert.assertTrue(pr.stderr.contains(NoClassDefFoundError.class.getSimpleName())); Assert.assertTrue(pr.stdout.contains("init1")); Assert.assertFalse(pr.stdout.contains("init2")); Assert.assertFalse(pr.stdout.contains("start1")); Assert.assertFalse(pr.stdout.contains("start2")); // Assert.assertTrue(pr.stdout.contains("paint1")); // Assert.assertTrue(pr.stdout.contains("paint2")); // Assert.assertTrue(pr.stdout.contains("stop1")); // Assert.assertTrue(pr.stdout.contains("stop2")); // Assert.assertTrue(pr.stdout.contains("destroy1")); // Assert.assertTrue(pr.stdout.contains("destroy2")); Assert.assertFalse(pr.stdout.contains(appletCloseString)); } //applets crash start 1 @Test @NeedsDisplay @TestInBrowsers(testIn = {Browsers.one}) public void noClassDeffTestThrowsStartHtml1() throws Exception { prepare("start", false); ProcessResult pr = server.executeBrowser(HTML, null, new NoClassDefFoundErrorClosingListener()); Assert.assertTrue(pr.stdout.contains("Loading LostClass")); Assert.assertFalse(pr.stdout.contains("EX: ")); Assert.assertTrue(pr.stderr.contains(NoClassDefFoundError.class.getSimpleName())); Assert.assertTrue(pr.stdout.contains("init1")); Assert.assertTrue(pr.stdout.contains("init2")); Assert.assertTrue(pr.stdout.contains("start1")); Assert.assertFalse(pr.stdout.contains("start2")); // Assert.assertTrue(pr.stdout.contains("paint1")); // Assert.assertTrue(pr.stdout.contains("paint2")); // Assert.assertTrue(pr.stdout.contains("stop1")); // Assert.assertTrue(pr.stdout.contains("stop2")); // Assert.assertTrue(pr.stdout.contains("destroy1")); // Assert.assertTrue(pr.stdout.contains("destroy2")); // Assert.assertTrue(pr.stdout.contains(appletCloseString)); } @Test @NeedsDisplay @TestInBrowsers(testIn = {Browsers.one}) public void noClassDeffTestThrowsStartHtml2() throws Exception { prepare("start", false); ProcessResult pr = server.executeBrowser(HTMLHREF, null, new NoClassDefFoundErrorClosingListener()); Assert.assertTrue(pr.stdout.contains("Loading LostClass")); Assert.assertFalse(pr.stdout.contains("EX: ")); Assert.assertTrue(pr.stderr.contains(NoClassDefFoundError.class.getSimpleName())); Assert.assertTrue(pr.stdout.contains("init1")); Assert.assertTrue(pr.stdout.contains("init2")); Assert.assertTrue(pr.stdout.contains("start1")); Assert.assertFalse(pr.stdout.contains("start2")); // Assert.assertTrue(pr.stdout.contains("paint1")); // Assert.assertTrue(pr.stdout.contains("paint2")); // Assert.assertTrue(pr.stdout.contains("stop1")); // Assert.assertTrue(pr.stdout.contains("stop2")); // Assert.assertTrue(pr.stdout.contains("destroy1")); // Assert.assertTrue(pr.stdout.contains("destroy2")); // Assert.assertTrue(pr.stdout.contains(appletCloseString)); } @Test @NeedsDisplay @TestInBrowsers(testIn = {Browsers.one}) public void noClassDeffTestThrowsStartJavawsHtml1() throws Exception { prepare("start", false); ProcessResult pr = server.executeJavaws(HTMLL, HTML, null, new NoClassDefFoundErrorClosingListener()); Assert.assertTrue(pr.stdout.contains("Loading LostClass")); Assert.assertFalse(pr.stdout.contains("EX: ")); Assert.assertTrue(pr.stdout.contains("init1")); Assert.assertTrue(pr.stderr.contains(NoClassDefFoundError.class.getSimpleName())); Assert.assertTrue(pr.stdout.contains("init2")); Assert.assertTrue(pr.stdout.contains("start1")); Assert.assertFalse(pr.stdout.contains("start2")); // Assert.assertTrue(pr.stdout.contains("paint1")); // Assert.assertTrue(pr.stdout.contains("paint2")); // Assert.assertTrue(pr.stdout.contains("stop1")); // Assert.assertTrue(pr.stdout.contains("stop2")); // Assert.assertTrue(pr.stdout.contains("destroy1")); // Assert.assertTrue(pr.stdout.contains("destroy2")); } @Test @NeedsDisplay @TestInBrowsers(testIn = {Browsers.one}) public void noClassDeffTestThrowsStartJavawsHtml2() throws Exception { prepare("start", false); ProcessResult pr = server.executeJavaws(HTMLL, HTMLHREF, null, new NoClassDefFoundErrorClosingListener()); Assert.assertTrue(pr.stdout.contains("Loading LostClass")); Assert.assertFalse(pr.stdout.contains("EX: ")); Assert.assertTrue(pr.stderr.contains(NoClassDefFoundError.class.getSimpleName())); Assert.assertTrue(pr.stdout.contains("init1")); Assert.assertTrue(pr.stdout.contains("init2")); Assert.assertTrue(pr.stdout.contains("start1")); Assert.assertFalse(pr.stdout.contains("start2")); // Assert.assertTrue(pr.stdout.contains("paint1")); // Assert.assertTrue(pr.stdout.contains("paint2")); // Assert.assertTrue(pr.stdout.contains("stop1")); // Assert.assertTrue(pr.stdout.contains("stop2")); // Assert.assertTrue(pr.stdout.contains("destroy1")); // Assert.assertTrue(pr.stdout.contains("destroy2")); Assert.assertFalse(pr.stdout.contains(appletCloseString)); } private void prepare(String when, boolean catchError) throws IOException { File dir = ServerAccess.getInstance().getDir(); String[] files = new String[]{"NoClassDeffApp.jnlp", "NoClassDeff.html", "NoClassDeffApplet.jnlp", "NoClassDeffJnlpHref.html"}; for (String file : files) { String s = FileUtils.loadFileAsString(new File(dir, file + ".in")); s = s.replaceAll("DIE_ON_STAGE", when); s = s.replaceAll("CATCH_ERROR", String.valueOf(catchError)); FileUtils.saveFile(s, new File(dir, file)); } } //applets crash init 2 @Test @NeedsDisplay @TestInBrowsers(testIn = {Browsers.one}) public void noClassDeffTestThrowsCatchInitHtml1() throws Exception { prepare("init", true); ProcessResult pr = server.executeBrowser(HTML, new AutoOkClosingListener(), null); Assert.assertTrue(pr.stdout.contains("Loading LostClass")); Assert.assertTrue(pr.stdout.contains("EX: ")); Assert.assertTrue(pr.stderr.contains(NoClassDefFoundError.class.getSimpleName())); Assert.assertTrue(pr.stdout.contains("init1")); Assert.assertTrue(pr.stdout.contains("init2")); Assert.assertTrue(pr.stdout.contains("start1")); Assert.assertTrue(pr.stdout.contains("start2")); // Assert.assertTrue(pr.stdout.contains("paint1")); // Assert.assertTrue(pr.stdout.contains("paint2")); // Assert.assertTrue(pr.stdout.contains("stop1")); // Assert.assertTrue(pr.stdout.contains("stop2")); // Assert.assertTrue(pr.stdout.contains("destroy1")); // Assert.assertTrue(pr.stdout.contains("destroy2")); // Assert.assertTrue(pr.stdout.contains(appletCloseString)); } @Test @NeedsDisplay @TestInBrowsers(testIn = {Browsers.one}) public void noClassDeffTestThrowsCatchInitHtml2() throws Exception { prepare("init", true); ProcessResult pr = server.executeBrowser(HTMLHREF, new AutoOkClosingListener(), null); Assert.assertTrue(pr.stdout.contains("Loading LostClass")); Assert.assertTrue(pr.stdout.contains("EX: ")); Assert.assertTrue(pr.stderr.contains(NoClassDefFoundError.class.getSimpleName())); Assert.assertTrue(pr.stdout.contains("init1")); Assert.assertTrue(pr.stdout.contains("init2")); Assert.assertTrue(pr.stdout.contains("start1")); Assert.assertTrue(pr.stdout.contains("start2")); // Assert.assertTrue(pr.stdout.contains("paint1")); // Assert.assertTrue(pr.stdout.contains("paint2")); // Assert.assertTrue(pr.stdout.contains("stop1")); // Assert.assertTrue(pr.stdout.contains("stop2")); // Assert.assertTrue(pr.stdout.contains("destroy1")); // Assert.assertTrue(pr.stdout.contains("destroy2")); // Assert.assertTrue(pr.stdout.contains(appletCloseString)); } @Test @NeedsDisplay @TestInBrowsers(testIn = {Browsers.one}) public void noClassDeffTestThrowsCatchInitJavawsHtml1() throws Exception { prepare("init", true); ProcessResult pr = server.executeJavaws(HTMLL, HTML, new AutoOkClosingListener(), null); Assert.assertTrue(pr.stdout.contains("Loading LostClass")); Assert.assertTrue(pr.stdout.contains("EX: ")); Assert.assertTrue(pr.stdout.contains("init1")); Assert.assertTrue(pr.stderr.contains(NoClassDefFoundError.class.getSimpleName())); Assert.assertTrue(pr.stdout.contains("init2")); Assert.assertTrue(pr.stdout.contains("start1")); Assert.assertTrue(pr.stdout.contains("start2")); // Assert.assertTrue(pr.stdout.contains("paint1")); // Assert.assertTrue(pr.stdout.contains("paint2")); // Assert.assertTrue(pr.stdout.contains("stop1")); // Assert.assertTrue(pr.stdout.contains("stop2")); // Assert.assertTrue(pr.stdout.contains("destroy1")); // Assert.assertTrue(pr.stdout.contains("destroy2")); } @Test @NeedsDisplay @TestInBrowsers(testIn = {Browsers.one}) public void noClassDeffTestThrowsCatchInitJavawsHtml2() throws Exception { prepare("init", true); ProcessResult pr = server.executeJavaws(HTMLL, HTMLHREF, new AutoOkClosingListener(), null); Assert.assertTrue(pr.stdout.contains("Loading LostClass")); Assert.assertTrue(pr.stdout.contains("EX: ")); Assert.assertTrue(pr.stderr.contains(NoClassDefFoundError.class.getSimpleName())); Assert.assertTrue(pr.stdout.contains("init1")); Assert.assertTrue(pr.stdout.contains("init2")); Assert.assertTrue(pr.stdout.contains("start1")); Assert.assertTrue(pr.stdout.contains("start2")); // Assert.assertTrue(pr.stdout.contains("paint1")); // Assert.assertTrue(pr.stdout.contains("paint2")); // Assert.assertTrue(pr.stdout.contains("stop1")); // Assert.assertTrue(pr.stdout.contains("stop2")); // Assert.assertTrue(pr.stdout.contains("destroy1")); // Assert.assertTrue(pr.stdout.contains("destroy2")); Assert.assertTrue(pr.stdout.contains(appletCloseString)); } //applets crash start 2 @Test @NeedsDisplay @TestInBrowsers(testIn = {Browsers.one}) public void noClassDeffTestThrowsCatchStartHtml1() throws Exception { prepare("start", true); ProcessResult pr = server.executeBrowser(HTML, new AutoOkClosingListener(), null); Assert.assertTrue(pr.stdout.contains("Loading LostClass")); Assert.assertTrue(pr.stdout.contains("EX: ")); Assert.assertTrue(pr.stderr.contains(NoClassDefFoundError.class.getSimpleName())); Assert.assertTrue(pr.stdout.contains("init1")); Assert.assertTrue(pr.stdout.contains("init2")); Assert.assertTrue(pr.stdout.contains("start1")); Assert.assertTrue(pr.stdout.contains("start2")); // Assert.assertTrue(pr.stdout.contains("paint1")); // Assert.assertTrue(pr.stdout.contains("paint2")); // Assert.assertTrue(pr.stdout.contains("stop1")); // Assert.assertTrue(pr.stdout.contains("stop2")); // Assert.assertTrue(pr.stdout.contains("destroy1")); // Assert.assertTrue(pr.stdout.contains("destroy2")); // Assert.assertTrue(pr.stdout.contains(appletCloseString)); } @Test @NeedsDisplay @TestInBrowsers(testIn = {Browsers.one}) public void noClassDeffTestThrowsCatchStartHtml2() throws Exception { prepare("start", true); ProcessResult pr = server.executeBrowser(HTMLHREF, new AutoOkClosingListener(), null); Assert.assertTrue(pr.stdout.contains("Loading LostClass")); Assert.assertTrue(pr.stdout.contains("EX: ")); Assert.assertTrue(pr.stderr.contains(NoClassDefFoundError.class.getSimpleName())); Assert.assertTrue(pr.stdout.contains("init1")); Assert.assertTrue(pr.stdout.contains("init2")); Assert.assertTrue(pr.stdout.contains("start1")); Assert.assertTrue(pr.stdout.contains("start2")); // Assert.assertTrue(pr.stdout.contains("paint1")); // Assert.assertTrue(pr.stdout.contains("paint2")); // Assert.assertTrue(pr.stdout.contains("stop1")); // Assert.assertTrue(pr.stdout.contains("stop2")); // Assert.assertTrue(pr.stdout.contains("destroy1")); // Assert.assertTrue(pr.stdout.contains("destroy2")); // Assert.assertTrue(pr.stdout.contains(appletCloseString)); } @Test @NeedsDisplay @TestInBrowsers(testIn = {Browsers.one}) public void noClassDeffTestThrowsCatchStartJavawsHtml1() throws Exception { prepare("start", true); ProcessResult pr = server.executeJavaws(HTMLL, HTML, new AutoOkClosingListener(), null); Assert.assertTrue(pr.stdout.contains("Loading LostClass")); Assert.assertTrue(pr.stdout.contains("EX: ")); Assert.assertTrue(pr.stdout.contains("init1")); Assert.assertTrue(pr.stderr.contains(NoClassDefFoundError.class.getSimpleName())); Assert.assertTrue(pr.stdout.contains("init2")); Assert.assertTrue(pr.stdout.contains("start1")); Assert.assertTrue(pr.stdout.contains("start2")); // Assert.assertTrue(pr.stdout.contains("paint1")); // Assert.assertTrue(pr.stdout.contains("paint2")); // Assert.assertTrue(pr.stdout.contains("stop1")); // Assert.assertTrue(pr.stdout.contains("stop2")); // Assert.assertTrue(pr.stdout.contains("destroy1")); // Assert.assertTrue(pr.stdout.contains("destroy2")); } @Test @NeedsDisplay @TestInBrowsers(testIn = {Browsers.one}) public void noClassDeffTestThrowsCatchStartJavawsHtml2() throws Exception { prepare("start", true); ProcessResult pr = server.executeJavaws(HTMLL, HTMLHREF, new AutoOkClosingListener(), null); Assert.assertTrue(pr.stdout.contains("Loading LostClass")); Assert.assertTrue(pr.stdout.contains("EX: ")); Assert.assertTrue(pr.stderr.contains(NoClassDefFoundError.class.getSimpleName())); Assert.assertTrue(pr.stdout.contains("init1")); Assert.assertTrue(pr.stdout.contains("init2")); Assert.assertTrue(pr.stdout.contains("start1")); Assert.assertTrue(pr.stdout.contains("start2")); // Assert.assertTrue(pr.stdout.contains("paint1")); // Assert.assertTrue(pr.stdout.contains("paint2")); // Assert.assertTrue(pr.stdout.contains("stop1")); // Assert.assertTrue(pr.stdout.contains("stop2")); // Assert.assertTrue(pr.stdout.contains("destroy1")); // Assert.assertTrue(pr.stdout.contains("destroy2")); Assert.assertTrue(pr.stdout.contains(appletCloseString)); } } icedtea-web-1.6.2/tests/reproducers/custom/NoClassDeff/PaxHeaders.17941/srcs0000644000000000000000000000013212654402377023502 xustar0030 mtime=1454507263.246432461 30 atime=1454507658.776157397 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/NoClassDeff/srcs/0000755000175000002070000000000012654402377024302 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/NoClassDeff/srcs/PaxHeaders.17941/NoClassDeff.java0000644000000000000000000000013112654402377026550 xustar0030 mtime=1454507263.246432461 29 atime=1454507327.21957927 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/NoClassDeff/srcs/NoClassDeff.java0000644000175000002070000001140412654402377027274 0ustar00jvanekmock00000000000000/* ExtensionJnlpTestApplet.java Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.applet.*; import java.awt.Graphics; public class NoClassDeff extends Applet { private static final String appletCloseString = "*** APPLET FINISHED ***"; private static String stage = null; private static boolean catchError = false; private static void checkStage() { if (stage == null) { throw new NullPointerException("satge cant be null"); } System.out.println(stage); System.out.println("catchError: " + catchError); } private static void lostClass() { System.out.println("Loading LostClass"); System.out.flush(); if (catchError) { try { LostClass l = new LostClass(); } catch (Throwable ex) {// vs exception System.out.println("EX: " + ex.toString()); System.out.flush(); ex.printStackTrace(); } } else { try { LostClass l = new LostClass(); } catch (Exception ex) {// vs throwable System.out.println("EX: " + ex.toString()); System.out.flush(); ex.printStackTrace(); } } } private static class LostClass { } public static void main(String[] args) { stage = args[0]; catchError = Boolean.valueOf(args[1]); checkStage(); System.out.println("main1"); if (stage.equalsIgnoreCase("main")) { lostClass(); } System.out.println("main2"); System.out.println(appletCloseString); System.out.flush(); System.out.println("some garbage"); } @Override public void init() { stage = getParameter("die"); catchError = Boolean.valueOf(getParameter("catchError")); System.out.println("init1"); if (stage.equalsIgnoreCase("init")) { lostClass(); } System.out.println("init2"); } @Override public void start() { checkStage(); System.out.println("start1"); if (stage.equalsIgnoreCase("start")) { lostClass(); } System.out.println("start2"); } @Override public void stop() { checkStage(); System.out.println("stop1"); if (stage.equalsIgnoreCase("stop")) { lostClass(); } System.out.println("stop2"); System.out.flush(); System.out.println("some garbage"); } @Override public void destroy() { checkStage(); System.out.println("destroy1"); if (stage.equalsIgnoreCase("destroy")) { lostClass(); } System.out.println("destroy2"); System.out.flush(); System.out.println("some garbage"); } @Override public void paint(Graphics g) { super.paint(g); checkStage(); System.out.println("paint1"); if (stage.equalsIgnoreCase("paint")) { lostClass(); } System.out.println("paint2"); System.out.println(appletCloseString); System.out.flush(); System.out.println("some garbage"); } } icedtea-web-1.6.2/tests/reproducers/custom/NoClassDeff/srcs/PaxHeaders.17941/Makefile0000644000000000000000000000013112654402377025216 xustar0030 mtime=1454507263.246432461 29 atime=1454507327.21957927 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/NoClassDeff/srcs/Makefile0000644000175000002070000000156012654402377025744 0ustar00jvanekmock00000000000000TESTNAME=NoClassDeff SRC_FILES=NoClassDeff ENTRYPOINT_CLASSES=NoClassDeff JAVAC_CLASSPATH=$(TEST_EXTENSIONS_DIR):$(NETX_DIR)/lib/classes.jar JAVAC=$(EXPORTED_JAVAC) JAR=$(EXPORTED_JAR) TMPDIR:=$(shell mktemp -d) prepare-reproducer: echo PREPARING REPRODUCER $(TESTNAME); pwd; ls ; $(JAVAC) -d $(TMPDIR) -classpath $(JAVAC_CLASSPATH) *.java; #now the hack, remove inner class so we can later die on CNFE or NCDFE ls $(TMPDIR)/ rm $(TMPDIR)/*\$$* ; ls $(TMPDIR)/ cp ../resources/* $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR); \ for CLASS in $(ENTRYPOINT_CLASSES); \ do \ cd $(TMPDIR); \ $(JAR) cfe "$$CLASS.jar" "$$CLASS" "$$CLASS.class"; \ cd -;\ mv $(TMPDIR)/"$$CLASS.jar" $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR); \ done; \ echo PREPARED REPRODUCER $(TESTNAME), removing $(TMPDIR) ; \ rm -rf $(TMPDIR) clean-reproducer: echo NOTHING TO CLEAN FOR $(TESTNAME) icedtea-web-1.6.2/tests/reproducers/custom/NoClassDeff/PaxHeaders.17941/resources0000644000000000000000000000013212654402377024542 xustar0030 mtime=1454507263.245432474 30 atime=1454507658.776157397 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/NoClassDeff/resources/0000755000175000002070000000000012654402377025342 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/NoClassDeff/resources/PaxHeaders.17941/NoClassDeffJnlpHre0000644000000000000000000000013112654402377030153 xustar0030 mtime=1454507263.245432474 29 atime=1454507327.21957927 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/NoClassDeff/resources/NoClassDeffJnlpHref.html.in0000644000175000002070000000357012654402377032422 0ustar00jvanekmock00000000000000 icedtea-web-1.6.2/tests/reproducers/custom/NoClassDeff/resources/PaxHeaders.17941/NoClassDeffApplet.0000644000000000000000000000013212654402377030115 xustar0030 mtime=1454507263.245432474 30 atime=1454507327.218579283 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/NoClassDeff/resources/NoClassDeffApplet.jnlp.in0000644000175000002070000000436112654402377032135 0ustar00jvanekmock00000000000000 NoClassDeff IcedTea PR2219 icedtea-web-1.6.2/tests/reproducers/custom/NoClassDeff/resources/PaxHeaders.17941/NoClassDeffApp.jnl0000644000000000000000000000013212654402377030114 xustar0030 mtime=1454507263.245432474 30 atime=1454507327.218579283 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/NoClassDeff/resources/NoClassDeffApp.jnlp.in0000644000175000002070000000430112654402377031422 0ustar00jvanekmock00000000000000 NoClassDeff IcedTea PR2219 DIE_ON_STAGE CATCH_ERROR icedtea-web-1.6.2/tests/reproducers/custom/NoClassDeff/resources/PaxHeaders.17941/NoClassDeff.html.i0000644000000000000000000000013212654402377030063 xustar0030 mtime=1454507263.245432474 30 atime=1454507327.218579283 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/NoClassDeff/resources/NoClassDeff.html.in0000644000175000002070000000355312654402377030772 0ustar00jvanekmock00000000000000 icedtea-web-1.6.2/tests/reproducers/custom/PaxHeaders.17941/MultipleSignaturesPerJar0000644000000000000000000000013212654402377025345 xustar0030 mtime=1454507263.244432488 30 atime=1454507658.776157397 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/MultipleSignaturesPerJar/0000755000175000002070000000000012654402377026145 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/MultipleSignaturesPerJar/PaxHeaders.17941/testcases0000644000000000000000000000013212654402377027343 xustar0030 mtime=1454507263.244432488 30 atime=1454507658.776157397 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/MultipleSignaturesPerJar/testcases/0000755000175000002070000000000012654402377030143 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/MultipleSignaturesPerJar/testcases/PaxHeaders.17941/Multi0000644000000000000000000000032412654402377030440 xustar00122 path=icedtea-web-1.6.2/tests/reproducers/custom/MultipleSignaturesPerJar/testcases/MultipleSignaturesPerJarTests.java 30 mtime=1454507263.244432488 30 atime=1454507327.218579283 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/MultipleSignaturesPerJar/testcases/MultipleSignaturesPerJ0000644000175000002070000001344512654402377034516 0ustar00jvanekmock00000000000000/* MultipleSignaturesTestTests.java Copyright (C) 20121 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertFalse; import java.util.Arrays; import java.util.Collections; import java.util.List; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess.AutoClose; import net.sourceforge.jnlp.annotations.Bug; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import org.junit.Test; @Bug(id = { "PR822" }) public class MultipleSignaturesPerJarTests extends BrowserTest { private final List TRUST_ALL = Collections.unmodifiableList(Arrays.asList(new String[] { "-Xtrustall" })); public static final String CORRECT_FINISH = "Test has finished."; public static final String CNFEXCEPTION = "ClassNotFoundException"; public static final String DIFF_CERTS_EXCEPTION = "Fatal: Application Error: The JNLP application is not fully signed by a single cert."; public static final String ACEXCEPTION = "java.security.AccessControlException: access denied"; @Test @NeedsDisplay public void multipleSignaturesPerJarMatchingJNLP() throws Exception { ProcessResult pr = server.executeJavawsHeadless(TRUST_ALL, "/MultipleSignaturesPerJarMatching.jnlp"); // Assert relevant exceptions did not occur assertFalse("stderr should NOT contain `" + CNFEXCEPTION + "`, but did", pr.stderr.contains(CNFEXCEPTION)); assertFalse("stderr should NOT contain `" + ACEXCEPTION + "`, but did", pr.stderr.contains(ACEXCEPTION)); assertFalse("stderr should NOT contain `" + DIFF_CERTS_EXCEPTION + "`, but did", pr.stderr.contains(DIFF_CERTS_EXCEPTION)); // Assert that we correctly finish assertTrue("stdout should contain `" + CORRECT_FINISH + "`, but did not", pr.stdout.contains(CORRECT_FINISH)); } @Test @NeedsDisplay public void multipleSignaturesPerJarMismatchingJNLP() throws Exception { ProcessResult pr = server.executeJavawsHeadless(TRUST_ALL, "/MultipleSignaturesPerJarMismatching.jnlp"); // Assert only for the expected exception assertTrue("stderr should contain `" + DIFF_CERTS_EXCEPTION + "`, but did not", pr.stderr.contains(DIFF_CERTS_EXCEPTION)); // Assert that we did not correctly finish assertFalse("stdout should NOT contain " + CORRECT_FINISH + " but did", pr.stdout.contains(CORRECT_FINISH)); } private static void testForCorrectAppletExecution(ProcessResult pr) { // Assert relevant exceptions did not occur assertFalse("stderr should NOT contain `" + CNFEXCEPTION + "`, but did", pr.stderr.contains(CNFEXCEPTION)); assertFalse("stderr should NOT contain `" + ACEXCEPTION + "`, but did", pr.stderr.contains(ACEXCEPTION)); assertFalse("stderr should NOT contain `" + DIFF_CERTS_EXCEPTION + "`, but did", pr.stderr.contains(DIFF_CERTS_EXCEPTION)); // Assert that we correctly finish // It is difficult to check for user.home's value here, so we only check for the ending message: assertTrue("stdout should contain `" + CORRECT_FINISH + "`, but did not", pr.stdout.contains(CORRECT_FINISH)); } @Test @NeedsDisplay @TestInBrowsers(testIn = Browsers.one) @Bug(id = { "PR822" }) public void multipleSignaturesPerJarMismatchingApplet() throws Exception { ProcessResult pr = server.executeBrowser("/MultipleSignaturesPerJarMismatching.html", AutoClose.CLOSE_ON_CORRECT_END); // NB: Both this and the matching applet should pass // Unlike JNLPs, applets pass as long as all their parts are signed by *something* testForCorrectAppletExecution(pr); } @Test @NeedsDisplay @TestInBrowsers(testIn = Browsers.one) public void multipleSignaturesPerJarMatchingApplet() throws Exception { ProcessResult pr = server.executeBrowser("/MultipleSignaturesPerJarMatching.html", AutoClose.CLOSE_ON_CORRECT_END); testForCorrectAppletExecution(pr); } }icedtea-web-1.6.2/tests/reproducers/custom/MultipleSignaturesPerJar/PaxHeaders.17941/srcs0000644000000000000000000000013212654402377026317 xustar0030 mtime=1454507263.244432488 30 atime=1454507658.776157397 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/MultipleSignaturesPerJar/srcs/0000755000175000002070000000000012654402377027117 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/MultipleSignaturesPerJar/srcs/PaxHeaders.17941/somecrazyt0000644000000000000000000000013212654402377030517 xustar0030 mtime=1454507263.244432488 30 atime=1454507658.776157397 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/MultipleSignaturesPerJar/srcs/somecrazytestpackage/0000755000175000002070000000000012654402377033347 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/MultipleSignaturesPerJar/srcs/somecrazytestpackage/PaxHea0000644000000000000000000000034312654402377031211 xustar00137 path=icedtea-web-1.6.2/tests/reproducers/custom/MultipleSignaturesPerJar/srcs/somecrazytestpackage/MultipleSignaturesPerJarMain.java 30 mtime=1454507263.244432488 30 atime=1454507327.218579283 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/MultipleSignaturesPerJar/srcs/somecrazytestpackage/Multip0000644000175000002070000000607312654402377034552 0ustar00jvanekmock00000000000000 /* MultipleSignaturesPerJarMain.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package somecrazytestpackage; import java.applet.Applet; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; public class MultipleSignaturesPerJarMain extends Applet { public static void main(String[] args) { executeForeignMethodCaught(); } public static void executeForeignMethodCaught() { try { executeForeignMethod(); } catch (Exception ex) { throw new RuntimeException(ex); } } public static void executeForeignMethod() throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, InstantiationException { Class clazz = Class.forName("ReadPropertiesSigned"); Method mainMethod = clazz.getDeclaredMethod("main", String[].class); mainMethod.invoke(clazz.newInstance(), (Object)new String[] {"user.home"}); System.out.println("Test has finished."); } private class Killer extends Thread { public int n = 2000; @Override public void run() { try { Thread.sleep(n); System.exit(0); } catch (Exception ex) { } } } private Killer killer; @Override public void init() { killer = new Killer(); } @Override public void start() { main(null); System.out.println("*** APPLET FINISHED ***"); } } icedtea-web-1.6.2/tests/reproducers/custom/MultipleSignaturesPerJar/srcs/PaxHeaders.17941/Makefile0000644000000000000000000000013212654402377030034 xustar0030 mtime=1454507263.244432488 30 atime=1454507327.217579297 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/MultipleSignaturesPerJar/srcs/Makefile0000644000175000002070000000440212654402377030557 0ustar00jvanekmock00000000000000TESTNAME=MultipleSignaturesPerJar JAVAC_CLASSPATH=$(TEST_EXTENSIONS_DIR):$(NETX_DIR)/lib/classes.jar KEYTOOL=$(EXPORTED_KEYTOOL) JARSIGNER=$(EXPORTED_JARSIGNER) JARSIGNER_CMD=$(JARSIGNER) -keystore $(TOP_BUILD_DIR)/$(PRIVATE_KEYSTORE_NAME) -storepass $(PRIVATE_KEYSTORE_PASS) -keypass $(PRIVATE_KEYSTORE_PASS) JAVAC=$(EXPORTED_JAVAC) JAR=$(EXPORTED_JAR) # Index jar causes main class jar to load TMPDIR:=$(shell mktemp -d) prepare-reproducer: echo PREPARING REPRODUCER $(TESTNAME) in $(TMPDIR) $(JAVAC) -d $(TMPDIR) -classpath $(JAVAC_CLASSPATH) somecrazytestpackage/MultipleSignaturesPerJarMain.java # Extract ReadPropertiesSigned.class for our usage cd $(TMPDIR) ; \ $(JAR) xf $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR)/ReadPropertiesSigned.jar ReadPropertiesSigned.class ; # Create jars *testname*_A_and_B.jar, *testname*_A_only.jar, *testname*_B_only.jar # These are signed by signatures A and B, A only, B only, respectively. # *testname*_A_and_B.jar as well as *testname*_B_only.jar contain ReadPropertiesSigned.class, which exercises the signing. # *testname*_A_only.jar contains MultipleSignaturesTest.class, the (reused) main class for this reproducer. cd $(TMPDIR) ; \ $(JAR) cvf $(TESTNAME)_B_only.jar ReadPropertiesSigned.class ; \ cp $(TESTNAME)_B_only.jar $(TESTNAME)_A_and_B.jar ; \ $(JAR) cvf $(TESTNAME)_A_only.jar somecrazytestpackage ; # Sign with signature 'A', the signature used in the 'signed' reproducer group cd $(TMPDIR) ; \ for jar_to_sign in $(TESTNAME)_A_only.jar $(TESTNAME)_A_and_B.jar; do \ $(JARSIGNER_CMD) -sigfile Alpha "$$jar_to_sign" $(TEST_CERT_ALIAS)_signed ; \ done # Sign with signature 'B', the signature used in the 'signed2' reproducer group cd $(TMPDIR) ; \ for jar_to_sign in $(TESTNAME)_B_only.jar $(TESTNAME)_A_and_B.jar; do \ $(JARSIGNER_CMD) -sigfile Beta "$$jar_to_sign" $(TEST_CERT_ALIAS)_signed2 ; \ done # Move jars into deployment directory cd $(TMPDIR); \ mv $(TESTNAME)_B_only.jar $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR) ; \ mv $(TESTNAME)_A_only.jar $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR) ; \ mv $(TESTNAME)_A_and_B.jar $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR) ; echo PREPARED REPRODUCER $(TESTNAME), removing $(TMPDIR) rm -rf $(TMPDIR) clean-reproducer: echo NOTHING TO CLEAN FOR $(TESTNAME)icedtea-web-1.6.2/tests/reproducers/custom/MultipleSignaturesPerJar/PaxHeaders.17941/resources0000644000000000000000000000013212654402377027357 xustar0030 mtime=1454507263.244432488 30 atime=1454507658.776157397 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/MultipleSignaturesPerJar/resources/0000755000175000002070000000000012654402377030157 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/MultipleSignaturesPerJar/resources/PaxHeaders.17941/Multi0000644000000000000000000000033212654402377030453 xustar00128 path=icedtea-web-1.6.2/tests/reproducers/custom/MultipleSignaturesPerJar/resources/MultipleSignaturesPerJarMismatching.jnlp 30 mtime=1454507263.244432488 30 atime=1454507327.217579297 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/MultipleSignaturesPerJar/resources/MultipleSignaturesPerJ0000644000175000002070000000450612654402377034530 0ustar00jvanekmock00000000000000 MultipleSignaturesPerJarMismatching IcedTea MultipleSignaturesPerJarMismatching icedtea-web-1.6.2/tests/reproducers/custom/MultipleSignaturesPerJar/resources/PaxHeaders.17941/Multi0000644000000000000000000000033212654402377030453 xustar00128 path=icedtea-web-1.6.2/tests/reproducers/custom/MultipleSignaturesPerJar/resources/MultipleSignaturesPerJarMismatching.html 30 mtime=1454507263.243432501 30 atime=1454507327.217579297 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/MultipleSignaturesPerJar/resources/MultipleSignaturesPerJ0000644000175000002070000000356712654402377034536 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/custom/MultipleSignaturesPerJar/resources/PaxHeaders.17941/Multi0000644000000000000000000000032712654402377030457 xustar00125 path=icedtea-web-1.6.2/tests/reproducers/custom/MultipleSignaturesPerJar/resources/MultipleSignaturesPerJarMatching.jnlp 30 mtime=1454507263.243432501 30 atime=1454507327.217579297 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/MultipleSignaturesPerJar/resources/MultipleSignaturesPerJ0000644000175000002070000000447612654402377034536 0ustar00jvanekmock00000000000000 MultipleSignaturesPerJarMatching IcedTea MultipleSignaturesPerJarMatching icedtea-web-1.6.2/tests/reproducers/custom/MultipleSignaturesPerJar/resources/PaxHeaders.17941/Multi0000644000000000000000000000032712654402377030457 xustar00125 path=icedtea-web-1.6.2/tests/reproducers/custom/MultipleSignaturesPerJar/resources/MultipleSignaturesPerJarMatching.html 30 mtime=1454507263.243432501 30 atime=1454507327.217579297 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/MultipleSignaturesPerJar/resources/MultipleSignaturesPerJ0000644000175000002070000000357112654402377034531 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/custom/PaxHeaders.17941/MixedSigningApplet0000644000000000000000000000013212654402377024134 xustar0030 mtime=1454507263.243432501 30 atime=1454507658.776157397 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/MixedSigningApplet/0000755000175000002070000000000012654402377024734 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/MixedSigningApplet/PaxHeaders.17941/testcases0000644000000000000000000000013212654402377026132 xustar0030 mtime=1454507263.243432501 30 atime=1454507658.776157397 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/MixedSigningApplet/testcases/0000755000175000002070000000000012654402377026732 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/MixedSigningApplet/testcases/PaxHeaders.17941/MixedSignin0000644000000000000000000000031612654402377030354 xustar00116 path=icedtea-web-1.6.2/tests/reproducers/custom/MixedSigningApplet/testcases/MixedSigningAppletSignedTests.java 30 mtime=1454507263.243432501 30 atime=1454507327.217579297 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/MixedSigningApplet/testcases/MixedSigningAppletSignedTest0000644000175000002070000007411712654402377034414 0ustar00jvanekmock00000000000000/* MixedSigningAppletSignedTests.java Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import static org.junit.Assert.assertTrue; import java.io.File; import java.io.FileInputStream; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.ServerAccess.AutoClose; import net.sourceforge.jnlp.annotations.Bug; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; import org.junit.Test; /* * All JNLP tests expect to be unable to perform restricted actions, * such as reading from System.getProperty. This is because partially signed * applet support (PR1592) is enabled *only* for browser plugin applets, and * not for JNLP applets or applications. The expected result in all JNLP * tests is therefore an AccessControlException. Most plugin applets expect * AccessControlExceptions as well, since they test to ensure that the signed * JAR(s) of an applet cannot leak information to unsigned parts of the applet * nor allow them to perform restricted actions. These tests also similarly * expect AccessControlExceptions. The only tests that expect to be able to * read successfully from System.getProperty are the plugin applet tests * where the signed JAR reads the data and then does not in any way transfer * it to the unsigned code, except when the signed JAR method specifically uses * AccessController.doPrivileged. These are "testSignedReadProperties", * "testSignedReadPropertiesDoPrivileged", and * "testUnsignedAttacksSignedDoPrivileged2". */ public class MixedSigningAppletSignedTests extends BrowserTest { private static final String CLOSE_STRING = AutoOkClosingListener.MAGICAL_OK_CLOSING_STRING; private static final String USER_HOME = System.getProperty("user.home"); private static final String HREF_TARGET = "JNLP_HREF", APP_TYPE_TARGET = "APP_TYPE_TARGET", ARG_TARGET = "PARAM_ARG_TARGET", SECURITY_TARGET = "SECURITY_TAG_TARGET"; private static final String JNLP_SECURITY_TAG = ""; private static ProcessResult runJnlpApplet(String arg, boolean security) throws Exception { String argString = ""; String href = "MixedSigningApplet-Applet-" + arg + ".jnlp"; return prepareJnlpFromTemplate(href, "applet-desc", argString, security); } private static ProcessResult runJnlpApplication(String arg, boolean security) throws Exception { String argString = "\"" + arg + "\""; String href = "MixedSigningApplet-Application-" + arg + ".jnlp"; return prepareJnlpFromTemplate(href, "application-desc", argString, security); } private static ProcessResult prepareJnlpFromTemplate(String href, String type, String arg, boolean security) throws Exception { File src = new File(server.getDir(), "MixedSigningApplet.jnlp"); File dest = new File(server.getDir(), href); String srcJnlp = ServerAccess.getContentOfStream(new FileInputStream(src)); String resultJnlp = srcJnlp.replaceAll(HREF_TARGET, href) .replaceAll(APP_TYPE_TARGET, type) .replaceAll(ARG_TARGET, arg) .replaceAll(SECURITY_TARGET, security ? JNLP_SECURITY_TAG : ""); ServerAccess.saveFile(resultJnlp, dest); return server.executeJavawsHeadless(href); } /* * All browser tests disabled due to requiring user intervention to run * (partially signed dialog will appear) */ @Bug(id="PR1592") @NeedsDisplay //@Test @TestInBrowsers(testIn={Browsers.one}) public void testNonPrivilegedAction() throws Exception { ProcessResult pr = server.executeBrowser("MixedSigningApplet.html?testNonPrivilegedAction", AutoClose.CLOSE_ON_CORRECT_END); assertProperStart(pr); assertCloseString(pr); } @Bug(id="PR1592") @NeedsDisplay //@Test @TestInBrowsers(testIn={Browsers.one}) public void testNonPrivilegedActionDoPrivileged() throws Exception { ProcessResult pr = server.executeBrowser("MixedSigningApplet.html?testNonPrivilegedActionDoPrivileged", AutoClose.CLOSE_ON_CORRECT_END); assertProperStart(pr); assertCloseString(pr); } @Bug(id="PR1592") @NeedsDisplay //@Test @TestInBrowsers(testIn={Browsers.one}) public void testNonPrivilegedActionDoPrivileged2() throws Exception { ProcessResult pr = server.executeBrowser("MixedSigningApplet.html?testNonPrivilegedActionDoPrivileged2", AutoClose.CLOSE_ON_CORRECT_END); assertProperStart(pr); assertCloseString(pr); } @Bug(id="PR1592") @NeedsDisplay //@Test @TestInBrowsers(testIn={Browsers.one}) public void testUnsignedReadProperties() throws Exception { ProcessResult pr = server.executeBrowser("MixedSigningApplet.html?testUnsignedReadProperties", AutoClose.CLOSE_ON_CORRECT_END); assertAccessControlException(pr); assertCloseString(pr); } @Bug(id="PR1592") @NeedsDisplay //@Test @TestInBrowsers(testIn={Browsers.one}) public void testUnsignedReadPropertiesDoPrivileged() throws Exception { ProcessResult pr = server.executeBrowser("MixedSigningApplet.html?testUnsignedReadPropertiesDoPrivileged", AutoClose.CLOSE_ON_CORRECT_END); assertAccessControlException(pr); assertCloseString(pr); } @Bug(id="PR1592") @NeedsDisplay //@Test @TestInBrowsers(testIn={Browsers.one}) public void testUnsignedReadPropertiesDoPrivileged2() throws Exception { ProcessResult pr = server.executeBrowser("MixedSigningApplet.html?testUnsignedReadPropertiesDoPrivileged2", AutoClose.CLOSE_ON_CORRECT_END); assertAccessControlException(pr); assertCloseString(pr); } @Bug(id="PR1592") @NeedsDisplay //@Test @TestInBrowsers(testIn={Browsers.one}) public void testSignedReadProperties() throws Exception { ProcessResult pr = server.executeBrowser("MixedSigningApplet.html?testSignedReadProperties", AutoClose.CLOSE_ON_CORRECT_END); assertContainsUserHome(pr); assertCloseString(pr); } @Bug(id="PR1592") @NeedsDisplay //@Test @TestInBrowsers(testIn={Browsers.one}) public void testSignedReadPropertiesDoPrivileged() throws Exception { ProcessResult pr = server.executeBrowser("MixedSigningApplet.html?testSignedReadPropertiesDoPrivileged", AutoClose.CLOSE_ON_CORRECT_END); assertContainsUserHome(pr); assertCloseString(pr); } @Bug(id="PR1592") @NeedsDisplay //@Test @TestInBrowsers(testIn={Browsers.one}) public void testSignedExportPropertiesToUnsigned() throws Exception { ProcessResult pr = server.executeBrowser("MixedSigningApplet.html?testSignedExportPropertiesToUnsigned", AutoClose.CLOSE_ON_CORRECT_END); assertAccessControlException(pr); assertCloseString(pr); } @Bug(id="PR1592") @NeedsDisplay //@Test @TestInBrowsers(testIn={Browsers.one}) public void testSignedExportPropertiesToUnsignedDoPrivileged() throws Exception { ProcessResult pr = server.executeBrowser("MixedSigningApplet.html?testSignedExportPropertiesToUnsignedDoPrivileged", AutoClose.CLOSE_ON_CORRECT_END); assertAccessControlException(pr); assertCloseString(pr); } @Bug(id="PR1592") @NeedsDisplay //@Test @TestInBrowsers(testIn={Browsers.one}) public void testSignedExportPropertiesToUnsignedDoPrivileged2() throws Exception { ProcessResult pr = server.executeBrowser("MixedSigningApplet.html?testSignedExportPropertiesToUnsignedDoPrivileged2", AutoClose.CLOSE_ON_CORRECT_END); assertAccessControlException(pr); assertCloseString(pr); } @Bug(id="PR1592") @NeedsDisplay //@Test @TestInBrowsers(testIn={Browsers.one}) public void testUnsignedAttacksSigned() throws Exception { ProcessResult pr = server.executeBrowser("MixedSigningApplet.html?testUnsignedAttacksSigned", AutoClose.CLOSE_ON_CORRECT_END); assertAccessControlException(pr); assertCloseString(pr); } @Bug(id="PR1592") @NeedsDisplay //@Test @TestInBrowsers(testIn={Browsers.one}) public void testUnsignedAttacksSignedDoPrivileged() throws Exception { ProcessResult pr = server.executeBrowser("MixedSigningApplet.html?testUnsignedAttacksSignedDoPrivileged", AutoClose.CLOSE_ON_CORRECT_END); assertAccessControlException(pr); assertCloseString(pr); } @Bug(id="PR1592") @NeedsDisplay //@Test @TestInBrowsers(testIn={Browsers.one}) public void testUnsignedAttacksSignedDoPrivileged2() throws Exception { ProcessResult pr = server.executeBrowser("MixedSigningApplet.html?testUnsignedAttacksSignedDoPrivileged2", AutoClose.CLOSE_ON_CORRECT_END); assertContainsUserHome(pr); assertCloseString(pr); } @Bug(id="PR1592") @NeedsDisplay //@Test @TestInBrowsers(testIn={Browsers.one}) public void testUnsignedReflectionAttack() throws Exception { ProcessResult pr = server.executeBrowser("MixedSigningApplet.html?testUnsignedReflectionAttack", AutoClose.CLOSE_ON_CORRECT_END); assertAccessControlException(pr); assertCloseString(pr); } @Bug(id="PR1592") @NeedsDisplay //@Test @TestInBrowsers(testIn={Browsers.one}) public void testUnsignedReflectionAttackDoPrivileged() throws Exception { ProcessResult pr = server.executeBrowser("MixedSigningApplet.html?testUnsignedReflectionAttackDoPrivileged", AutoClose.CLOSE_ON_CORRECT_END); assertAccessControlException(pr); assertCloseString(pr); } @Bug(id="PR1592") @NeedsDisplay //@Test @TestInBrowsers(testIn={Browsers.one}) public void testUnsignedReflectionAttackDoPrivileged2() throws Exception { ProcessResult pr = server.executeBrowser("MixedSigningApplet.html?testUnsignedReflectionAttackDoPrivileged2", AutoClose.CLOSE_ON_CORRECT_END); assertAccessControlException(pr); assertCloseString(pr); } @Bug(id="PR1592") @Test public void testNonPrivilegedActionJNLPAppletWithSecurity() throws Exception { ProcessResult pr = runJnlpApplet("testNonPrivilegedAction", true); assertSecurityTagException(pr); } @Bug(id="PR1592") @Test public void testNonPrivilegedActionJNLPApplet() throws Exception { ProcessResult pr = runJnlpApplet("testNonPrivilegedAction", false); assertProperStart(pr); assertCloseString(pr); } @Bug(id="PR1592") @Test public void testNonPrivilegedActionDoPrivilegedJNLPAppletWithSecurity() throws Exception { ProcessResult pr = runJnlpApplet("testNonPrivilegedActionDoPrivileged", true); assertSecurityTagException(pr); } @Bug(id="PR1592") @Test public void testNonPrivilegedActionDoPrivilegedJNLPApplet() throws Exception { ProcessResult pr = runJnlpApplet("testNonPrivilegedActionDoPrivileged", false); assertProperStart(pr); assertCloseString(pr); } @Bug(id="PR1592") @Test public void testNonPrivilegedActionDoPrivileged2JNLPAppletWithSecurity() throws Exception { ProcessResult pr = runJnlpApplet("testNonPrivilegedActionDoPrivileged2", true); assertSecurityTagException(pr); } @Bug(id="PR1592") @Test public void testNonPrivilegedActionDoPrivileged2JNLPApplet() throws Exception { ProcessResult pr = runJnlpApplet("testNonPrivilegedActionDoPrivileged2", false); assertProperStart(pr); assertCloseString(pr); } @Bug(id="PR1592") @Test public void testUnsignedReadPropertiesJNLPApplet() throws Exception { ProcessResult pr = runJnlpApplet("testUnsignedReadProperties", false); assertAccessControlException(pr); assertCloseString(pr); } @Bug(id="PR1592") @Test public void testUnsignedReadPropertiesJNLPAppletWithSecurity() throws Exception { ProcessResult pr = runJnlpApplet("testUnsignedReadProperties", true); assertSecurityTagException(pr); } @Bug(id="PR1592") @Test public void testUnsignedReadPropertiesDoPrivilegedJNLPAppletWithSecurity() throws Exception { ProcessResult pr = runJnlpApplet("testUnsignedReadPropertiesDoPrivileged", true); assertSecurityTagException(pr); } @Bug(id="PR1592") @Test public void testUnsignedReadPropertiesDoPrivilegedJNLPApplet() throws Exception { ProcessResult pr = runJnlpApplet("testUnsignedReadPropertiesDoPrivileged", false); assertAccessControlException(pr); assertCloseString(pr); } @Bug(id="PR1592") @Test public void testSignedReadPropertiesJNLPAppletWithSecurity() throws Exception { ProcessResult pr = runJnlpApplet("testSignedReadProperties", true); assertSecurityTagException(pr); } @Bug(id="PR1592") @Test public void testSignedReadPropertiesJNLPApplet() throws Exception { ProcessResult pr = runJnlpApplet("testSignedReadProperties", false); assertAccessControlException(pr); assertCloseString(pr); } @Bug(id="PR1592") @Test public void testSignedReadPropertiesDoPrivilegedJNLPAppletWithSecurity() throws Exception { ProcessResult pr = runJnlpApplet("testSignedReadPropertiesDoPrivileged", true); assertSecurityTagException(pr); } @Bug(id="PR1592") @Test public void testSignedReadPropertiesDoPrivilegedJNLPApplet() throws Exception { ProcessResult pr = runJnlpApplet("testSignedReadPropertiesDoPrivileged", false); assertAccessControlException(pr); assertCloseString(pr); } @Bug(id="PR1592") @Test public void testSignedExportPropertiesToUnsignedJNLPAppletWithSecurity() throws Exception { ProcessResult pr = runJnlpApplet("testSignedExportPropertiesToUnsigned", true); assertSecurityTagException(pr); } @Bug(id="PR1592") @Test public void testSignedExportPropertiesToUnsignedJNLPApplet() throws Exception { ProcessResult pr = runJnlpApplet("testSignedExportPropertiesToUnsigned", false); assertAccessControlException(pr); assertCloseString(pr); } @Bug(id="PR1592") @Test public void testSignedExportPropertiesToUnsignedDoPrivilegedJNLPAppletWithSecurity() throws Exception { ProcessResult pr = runJnlpApplet("testSignedExportPropertiesToUnsignedDoPrivileged", true); assertSecurityTagException(pr); } @Bug(id="PR1592") @Test public void testSignedExportPropertiesToUnsignedDoPrivilegedJNLPApplet() throws Exception { ProcessResult pr = runJnlpApplet("testSignedExportPropertiesToUnsignedDoPrivileged", false); assertAccessControlException(pr); assertCloseString(pr); } @Bug(id="PR1592") @Test public void testSignedExportPropertiesToUnsignedDoPrivileged2JNLPAppletWithSecurity() throws Exception { ProcessResult pr = runJnlpApplet("testSignedExportPropertiesToUnsignedDoPrivileged2", true); assertSecurityTagException(pr); } @Bug(id="PR1592") @Test public void testSignedExportPropertiesToUnsignedDoPrivileged2JNLPApplet() throws Exception { ProcessResult pr = runJnlpApplet("testSignedExportPropertiesToUnsignedDoPrivileged2", false); assertAccessControlException(pr); assertCloseString(pr); } @Bug(id="PR1592") @Test public void testUnsignedAttacksSignedJNLPAppletWithSecurity() throws Exception { ProcessResult pr = runJnlpApplet("testUnsignedAttacksSigned", true); assertSecurityTagException(pr); } @Bug(id="PR1592") @Test public void testUnsignedAttacksSignedJNLPApplet() throws Exception { ProcessResult pr = runJnlpApplet("testUnsignedAttacksSigned", false); assertAccessControlException(pr); assertCloseString(pr); } @Bug(id="PR1592") @Test public void testUnsignedAttacksSignedDoPrivilegedJNLPAppletWithSecurity() throws Exception { ProcessResult pr = runJnlpApplet("testUnsignedAttacksSignedDoPrivileged", true); assertSecurityTagException(pr); } @Bug(id="PR1592") @Test public void testUnsignedAttacksSignedDoPrivilegedJNLPApplet() throws Exception { ProcessResult pr = runJnlpApplet("testUnsignedAttacksSignedDoPrivileged", false); assertAccessControlException(pr); assertCloseString(pr); } @Bug(id="PR1592") @Test public void testUnsignedAttacksSignedDoPrivileged2JNLPAppletWithSecurity() throws Exception { ProcessResult pr = runJnlpApplet("testUnsignedAttacksSignedDoPrivileged2", true); assertSecurityTagException(pr); } @Bug(id="PR1592") @Test public void testUnsignedAttacksSignedDoPrivileged2JNLPApplet() throws Exception { ProcessResult pr = runJnlpApplet("testUnsignedAttacksSignedDoPrivileged2", false); assertAccessControlException(pr); assertCloseString(pr); } @Bug(id="PR1592") @Test public void testUnsignedReflectionAttackJNLPAppletWithSecurity() throws Exception { ProcessResult pr = runJnlpApplet("testUnsignedReflectionAttack", true); assertSecurityTagException(pr); } @Bug(id="PR1592") @Test public void testUnsignedReflectionAttackJNLPApplet() throws Exception { ProcessResult pr = runJnlpApplet("testUnsignedReflectionAttack", false); assertAccessControlException(pr); assertCloseString(pr); } @Bug(id="PR1592") @Test public void testUnsignedReflectionAttackDoPrivilegedJNLPAppletWithSecurity() throws Exception { ProcessResult pr = runJnlpApplet("testUnsignedReflectionAttackDoPrivileged", true); assertSecurityTagException(pr); } @Bug(id="PR1592") @Test public void testUnsignedReflectionAttackDoPrivilegedJNLPApplet() throws Exception { ProcessResult pr = runJnlpApplet("testUnsignedReflectionAttackDoPrivileged", false); assertAccessControlException(pr); assertCloseString(pr); } @Bug(id="PR1592") @Test public void testUnsignedReflectionAttackDoPrivileged2JNLPAppletWithSecurity() throws Exception { ProcessResult pr = runJnlpApplet("testUnsignedReflectionAttackDoPrivileged2", true); assertSecurityTagException(pr); } @Bug(id="PR1592") @Test public void testUnsignedReflectionAttackDoPrivileged2JNLPApplet() throws Exception { ProcessResult pr = runJnlpApplet("testUnsignedReflectionAttackDoPrivileged2", false); assertAccessControlException(pr); assertCloseString(pr); } @Bug(id="PR1592") @Test public void testNonPrivilegedActionJNLPApplicationWithSecurity() throws Exception { ProcessResult pr = runJnlpApplication("testNonPrivilegedAction", true); assertSecurityTagException(pr); } @Bug(id="PR1592") @Test public void testNonPrivilegedActionJNLPApplication() throws Exception { ProcessResult pr = runJnlpApplication("testNonPrivilegedAction", false); assertProperStart(pr); assertCloseString(pr); } @Bug(id="PR1592") @Test public void testNonPrivilegedActionDoPrivilegedJNLPApplicationWithSecurity() throws Exception { ProcessResult pr = runJnlpApplication("testNonPrivilegedActionDoPrivileged", true); assertSecurityTagException(pr); } @Bug(id="PR1592") @Test public void testNonPrivilegedActionDoPrivilegedJNLPApplication() throws Exception { ProcessResult pr = runJnlpApplication("testNonPrivilegedActionDoPrivileged", false); assertProperStart(pr); assertCloseString(pr); } @Bug(id="PR1592") @Test public void testNonPrivilegedActionDoPrivileged2JNLPApplicationWithSecurity() throws Exception { ProcessResult pr = runJnlpApplication("testNonPrivilegedActionDoPrivileged2", true); assertSecurityTagException(pr); } @Bug(id="PR1592") @Test public void testNonPrivilegedActionDoPrivileged2JNLPApplication() throws Exception { ProcessResult pr = runJnlpApplication("testNonPrivilegedActionDoPrivileged2", false); assertProperStart(pr); assertCloseString(pr); } @Bug(id="PR1592") @Test public void testUnsignedReadPropertiesJNLPApplicationWithSecurity() throws Exception { ProcessResult pr = runJnlpApplication("testUnsignedReadProperties", true); assertSecurityTagException(pr); } @Bug(id="PR1592") @Test public void testUnsignedReadPropertiesJNLPApplication() throws Exception { ProcessResult pr = runJnlpApplication("testUnsignedReadProperties", false); assertAccessControlException(pr); assertCloseString(pr); } @Bug(id="PR1592") @Test public void testUnsignedReadPropertiesDoPrivilegedJNLPApplicationWithSecurity() throws Exception { ProcessResult pr = runJnlpApplication("testUnsignedReadPropertiesDoPrivileged", true); assertSecurityTagException(pr); } @Bug(id="PR1592") @Test public void testUnsignedReadPropertiesDoPrivilegedJNLPApplication() throws Exception { ProcessResult pr = runJnlpApplication("testUnsignedReadPropertiesDoPrivileged", false); assertAccessControlException(pr); assertCloseString(pr); } @Bug(id="PR1592") @Test public void testSignedReadPropertiesJNLPApplicationWithSecurity() throws Exception { ProcessResult pr = runJnlpApplication("testSignedReadProperties", true); assertSecurityTagException(pr); } @Bug(id="PR1592") @Test public void testSignedReadPropertiesJNLPApplication() throws Exception { ProcessResult pr = runJnlpApplication("testSignedReadProperties", false); assertAccessControlException(pr); assertCloseString(pr); } @Bug(id="PR1592") @Test public void testSignedReadPropertiesDoPrivilegedJNLPApplicationWithSecurity() throws Exception { ProcessResult pr = runJnlpApplication("testSignedReadPropertiesDoPrivileged", true); assertSecurityTagException(pr); } @Bug(id="PR1592") @Test public void testSignedReadPropertiesDoPrivilegedJNLPApplication() throws Exception { ProcessResult pr = runJnlpApplication("testSignedReadPropertiesDoPrivileged", false); assertAccessControlException(pr); assertCloseString(pr); } @Bug(id="PR1592") @Test public void testSignedExportPropertiesToUnsignedJNLPApplicationWithSecurity() throws Exception { ProcessResult pr = runJnlpApplication("testSignedExportPropertiesToUnsigned", true); assertSecurityTagException(pr); } @Bug(id="PR1592") @Test public void testSignedExportPropertiesToUnsignedJNLPApplication() throws Exception { ProcessResult pr = runJnlpApplication("testSignedExportPropertiesToUnsigned", false); assertAccessControlException(pr); assertCloseString(pr); } @Bug(id="PR1592") @Test public void testSignedExportPropertiesToUnsignedDoPrivilegedJNLPApplicationWithSecurity() throws Exception { ProcessResult pr = runJnlpApplication("testSignedExportPropertiesToUnsignedDoPrivileged", true); assertSecurityTagException(pr); } @Bug(id="PR1592") @Test public void testSignedExportPropertiesToUnsignedDoPrivilegedJNLPApplication() throws Exception { ProcessResult pr = runJnlpApplication("testSignedExportPropertiesToUnsignedDoPrivileged", false); assertAccessControlException(pr); assertCloseString(pr); } @Bug(id="PR1592") @Test public void testSignedExportPropertiesToUnsignedDoPrivileged2JNLPApplicationWithSecurity() throws Exception { ProcessResult pr = runJnlpApplication("testSignedExportPropertiesToUnsignedDoPrivileged2", true); assertSecurityTagException(pr); } @Bug(id="PR1592") @Test public void testSignedExportPropertiesToUnsignedDoPrivileged2JNLPApplication() throws Exception { ProcessResult pr = runJnlpApplication("testSignedExportPropertiesToUnsignedDoPrivileged2", false); assertAccessControlException(pr); assertCloseString(pr); } @Bug(id="PR1592") @Test public void testUnsignedAttacksSignedJNLPApplicationWithSecurity() throws Exception { ProcessResult pr = runJnlpApplication("testUnsignedAttacksSigned", true); assertSecurityTagException(pr); } @Bug(id="PR1592") @Test public void testUnsignedAttacksSignedJNLPApplication() throws Exception { ProcessResult pr = runJnlpApplication("testUnsignedAttacksSigned", false); assertAccessControlException(pr); assertCloseString(pr); } @Bug(id="PR1592") @Test public void testUnsignedAttacksSignedDoPrivilegedJNLPApplicationWithSecurity() throws Exception { ProcessResult pr = runJnlpApplication("testUnsignedAttacksSignedDoPrivileged", true); assertSecurityTagException(pr); } @Bug(id="PR1592") @Test public void testUnsignedAttacksSignedDoPrivilegedJNLPApplication() throws Exception { ProcessResult pr = runJnlpApplication("testUnsignedAttacksSignedDoPrivileged", false); assertAccessControlException(pr); assertCloseString(pr); } @Bug(id="PR1592") @Test public void testUnsignedAttacksSignedDoPrivileged2JNLPApplicationWithSecurity() throws Exception { ProcessResult pr = runJnlpApplication("testUnsignedAttacksSignedDoPrivileged2", true); assertSecurityTagException(pr); } @Bug(id="PR1592") @Test public void testUnsignedAttacksSignedDoPrivileged2JNLPApplication() throws Exception { ProcessResult pr = runJnlpApplication("testUnsignedAttacksSignedDoPrivileged2", false); assertAccessControlException(pr); assertCloseString(pr); } @Bug(id="PR1592") @Test public void testUnsignedReflectionAttackJNLPApplicationWithSecurity() throws Exception { ProcessResult pr = runJnlpApplication("testUnsignedReflectionAttack", true); assertSecurityTagException(pr); } @Bug(id="PR1592") @Test public void testUnsignedReflectionAttackJNLPApplication() throws Exception { ProcessResult pr = runJnlpApplication("testUnsignedReflectionAttack", false); assertAccessControlException(pr); assertCloseString(pr); } @Bug(id="PR1592") @Test public void testUnsignedReflectionAttackDoPrivilegedJNLPApplicationWithSecurity() throws Exception { ProcessResult pr = runJnlpApplication("testUnsignedReflectionAttackDoPrivileged", true); assertSecurityTagException(pr); } @Bug(id="PR1592") @Test public void testUnsignedReflectionAttackDoPrivilegedJNLPApplication() throws Exception { ProcessResult pr = runJnlpApplication("testUnsignedReflectionAttackDoPrivileged", false); assertAccessControlException(pr); assertCloseString(pr); } @Bug(id="PR1592") @Test public void testUnsignedReflectionAttackDoPrivileged2JNLPApplicationWithSecurity() throws Exception { ProcessResult pr = runJnlpApplication("testUnsignedReflectionAttackDoPrivileged2", true); assertSecurityTagException(pr); } @Bug(id="PR1592") @Test public void testUnsignedReflectionAttackDoPrivileged2JNLPApplication() throws Exception { ProcessResult pr = runJnlpApplication("testUnsignedReflectionAttackDoPrivileged2", false); assertAccessControlException(pr); assertCloseString(pr); } private static void assertProperStart(ProcessResult pr) { assertTrue("stdout should contain MixedSigningApplet Applet Running but did not", pr.stdout.contains("MixedSigningApplet Applet Running")); } private static void assertContainsUserHome(ProcessResult pr) { assertTrue("stdout should contain " + USER_HOME + " but did not", pr.stdout.contains(USER_HOME)); } private static void assertAccessControlException(ProcessResult pr) { assertTrue("stderr should contain \"AccessControlException: access denied\" but did not", pr.stderr.contains("AccessControlException: access denied")); } private static void assertSecurityTagException(ProcessResult pr) { final String errorMessage = "Cannot grant permissions to unsigned jars. Application requested security permissions, but jars are not signed"; assertTrue("stderr should contain \"" + errorMessage + "\" but did not.", pr.stderr.contains(errorMessage)); } private static void assertCloseString(ProcessResult pr) { assertTrue("stdout should contain " + CLOSE_STRING + " but did not", pr.stdout.contains(CLOSE_STRING)); } } icedtea-web-1.6.2/tests/reproducers/custom/MixedSigningApplet/PaxHeaders.17941/srcs0000644000000000000000000000013212654402377025106 xustar0030 mtime=1454507263.242432514 30 atime=1454507658.776157397 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/MixedSigningApplet/srcs/0000755000175000002070000000000012654402377025706 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/MixedSigningApplet/srcs/PaxHeaders.17941/MixedSigningAppl0000644000000000000000000000013112654402377030307 xustar0030 mtime=1454507263.242432514 29 atime=1454507327.21657931 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/MixedSigningApplet/srcs/MixedSigningAppletSigned.java0000644000175000002070000002745312654402377033451 0ustar00jvanekmock00000000000000/* MixedSigningAppletSigned.java Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package signed; import helper.MixedSigningAppletHelper; import java.applet.Applet; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.List; import java.security.AccessController; import java.security.PrivilegedAction; /* See also simple/MixedSigningApplet */ public class MixedSigningAppletSigned extends Applet { public static void main(String[] args) { MixedSigningAppletSigned applet = new MixedSigningAppletSigned(); applet.jnlpStart(args[0].replaceAll("\"", "")); } public void jnlpStart(String testName) { try { Method m = this.getClass().getMethod(testName); final String result = (String) m.invoke(this); System.out.println(result); } catch (Exception e) { e.printStackTrace(); } try { Method m = this.getClass().getMethod(testName + "Reflect"); final String result = (String) m.invoke(this); System.out.println(result); } catch (Exception e) { e.printStackTrace(); } System.out.println("*** APPLET FINISHED ***"); System.exit(0); } @Override public void start() { jnlpStart(getParameter("testName")); } public String testNonPrivilegedActionReflect() { return new HelperMethodCall().method("help").call(); } public String testNonPrivilegedAction() { return MixedSigningAppletHelper.help(); } public String testNonPrivilegedActionDoPrivilegedReflect() { return AccessController.doPrivileged(new PrivilegedAction() { @Override public String run() { return testNonPrivilegedActionReflect(); } }); } public String testNonPrivilegedActionDoPrivileged() { return testNonPrivilegedActionDoPrivileged(); } public String testNonPrivilegedActionDoPrivileged2Reflect() { return new HelperMethodCall().method("helpDoPrivileged").call(); } public String testNonPrivilegedActionDoPrivileged2() { return MixedSigningAppletHelper.helpDoPrivileged(); } // Should succeed public String testSignedReadProperties() { return getProperty("user.home"); } // Should just be the same as above. It doesn't make much sense to make a reflective version here public String testSignedReadPropertiesReflect() { return testSignedReadProperties(); } public String testSignedReadPropertiesDoPrivileged() { return AccessController.doPrivileged(new PrivilegedAction() { @Override public String run() { return testSignedReadProperties(); } }); } public String testSignedReadPropertiesDoPrivilegedReflect() { return AccessController.doPrivileged(new PrivilegedAction() { @Override public String run() { return testSignedReadPropertiesReflect(); } }); } // Should result in AccessControlException public String testUnsignedReadPropertiesReflect() { return new HelperMethodCall().type(String.class).method("getProperty").arg("user.home").call(); } public String testUnsignedReadProperties() { return MixedSigningAppletHelper.getProperty("user.home"); } public String testUnsignedReadPropertiesDoPrivileged() { return AccessController.doPrivileged(new PrivilegedAction() { @Override public String run() { return testUnsignedReadProperties(); } }); } public String testUnsignedReadPropertiesDoPrivilegedReflect() { return AccessController.doPrivileged(new PrivilegedAction() { @Override public String run() { return testUnsignedReadPropertiesReflect(); } }); } public String testUnsignedReadPropertiesDoPrivileged2Reflect() { return new HelperMethodCall().type(String.class).method("getPropertyDoPrivileged").arg("user.home").call(); } public String testUnsignedReadPropertiesDoPrivileged2() { return MixedSigningAppletHelper.getPropertyDoPrivileged("user.home"); } // Should result in AccessControlException public String testSignedExportPropertiesToUnsignedReflect() { return new HelperMethodCall().type(String.class).method("getPropertyFromSignedJar").arg("user.home").call(); } public String testSignedExportPropertiesToUnsigned() { return MixedSigningAppletHelper.getPropertyFromSignedJar("user.home"); } public String testSignedExportPropertiesToUnsignedDoPrivilegedReflect() { return AccessController.doPrivileged(new PrivilegedAction() { @Override public String run() { return testSignedExportPropertiesToUnsignedReflect(); } }); } public String testSignedExportPropertiesToUnsignedDoPrivileged() { return AccessController.doPrivileged(new PrivilegedAction() { @Override public String run() { return testSignedExportPropertiesToUnsigned(); } }); } public String testSignedExportPropertiesToUnsignedDoPrivileged2Reflect() { return new HelperMethodCall().type(String.class).method("getPropertyFromSignedJarDoPrivileged").arg("user.home").call(); } public String testSignedExportPropertiesToUnsignedDoPrivileged2() { return MixedSigningAppletHelper.getPropertyFromSignedJarDoPrivileged("user.home"); } // Should result in AccessControlException public String testUnsignedAttacksSignedReflect() { return new HelperMethodCall().method("attack").call(); } public String testUnsignedAttacksSigned() { return MixedSigningAppletHelper.attack(); } public String testUnsignedAttacksSignedDoPrivilegedReflect() { return AccessController.doPrivileged(new PrivilegedAction() { @Override public String run() { return testUnsignedAttacksSignedReflect(); } }); } public String testUnsignedAttacksSignedDoPrivileged() { return AccessController.doPrivileged(new PrivilegedAction() { @Override public String run() { return testUnsignedAttacksSigned(); } }); } public String testUnsignedAttacksSignedDoPrivileged2Reflect() { return new HelperMethodCall().method("attackDoPrivileged").call(); } public String testUnsignedAttacksSignedDoPrivileged2() { return MixedSigningAppletHelper.attackDoPrivileged(); } // Should result in InvocationTargetException (due to AccessControlException) public String testUnsignedReflectionAttackReflect() { return new HelperMethodCall().method("reflectiveAttack").call(); } public String testUnsignedReflectionAttack() { return MixedSigningAppletHelper.reflectiveAttack(); } public String testUnsignedReflectionAttackDoPrivilegedReflect() { return AccessController.doPrivileged(new PrivilegedAction() { @Override public String run() { return testUnsignedReflectionAttackReflect(); } }); } public String testUnsignedReflectionAttackDoPrivileged() { return AccessController.doPrivileged(new PrivilegedAction() { @Override public String run() { return testUnsignedReflectionAttack(); } }); } public String testUnsignedReflectionAttackDoPrivileged2Reflect() { return new HelperMethodCall().method("reflectiveAttackDoPrivileged").call(); } public String testUnsignedReflectionAttackDoPrivileged2() { return MixedSigningAppletHelper.reflectiveAttackDoPrivileged(); } public String calledByReflection() { return System.getProperty("user.home"); } public String calledByReflectionDoPrivileged() { return AccessController.doPrivileged(new PrivilegedAction() { @Override public String run() { return calledByReflection(); } }); } public static String getProperty(String prop) { return System.getProperty(prop); } public static String getPropertyDoPrivileged(String prop) { final String fProp = prop; return AccessController.doPrivileged(new PrivilegedAction() { @Override public String run() { return System.getProperty(fProp); } }); } private static class HelperMethodCall { private String methodName; private final List> methodSignature; private final List args; public HelperMethodCall() { methodSignature = new ArrayList>(); args = new ArrayList(); } public HelperMethodCall method(String methodName) { this.methodName = methodName; return this; } public HelperMethodCall type(Class methodSignature) { this.methodSignature.add(methodSignature); return this; } public HelperMethodCall arg(String arg) { this.args.add(arg); return this; } public T call() { try { Class helper = Class.forName("helper.MixedSigningAppletHelper"); Method m; if (this.methodSignature == null) { m = helper.getMethod(this.methodName); } else { m = helper.getMethod(this.methodName, this.methodSignature.toArray(new Class[methodSignature.size()])); } Object[] params = args.toArray(new String[args.size()]); @SuppressWarnings("unchecked") T result = (T) m.invoke(null, params); return result; } catch (Exception e) { e.printStackTrace(); return null; } } } } icedtea-web-1.6.2/tests/reproducers/custom/MixedSigningApplet/srcs/PaxHeaders.17941/MixedSigningAppl0000644000000000000000000000013112654402377030307 xustar0030 mtime=1454507263.242432514 29 atime=1454507327.21657931 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/MixedSigningApplet/srcs/MixedSigningAppletHelper.java0000644000175000002070000001155412654402377033452 0ustar00jvanekmock00000000000000/* MixedSigningAppletHelper.java Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package helper; import signed.MixedSigningAppletSigned; import java.lang.reflect.Method; import java.lang.reflect.InvocationTargetException; import java.security.AccessController; import java.security.PrivilegedAction; /* See also signed/MixedSigningAppletSigned */ public class MixedSigningAppletHelper { public static String help() { return "MixedSigningApplet Applet Running"; } public static String helpDoPrivileged() { return AccessController.doPrivileged(new PrivilegedAction() { @Override public String run() { return "MixedSigningApplet Applet Running"; } }); } public static String getProperty(String prop) { return System.getProperty(prop); } public static String getPropertyDoPrivileged(final String prop) { return AccessController.doPrivileged(new PrivilegedAction() { @Override public String run() { return getProperty(prop); } }); } public static String getPropertyFromSignedJar(String prop) { try { Class signedAppletClass = Class.forName("signed.MixedSigningAppletSigned"); Method m = signedAppletClass.getMethod("getProperty", String.class); String result = (String) m.invoke(null, prop); return result; } catch (Exception e) { e.printStackTrace(); return e.toString(); } } public static String getPropertyFromSignedJarDoPrivileged(final String prop) { return AccessController.doPrivileged(new PrivilegedAction() { @Override public String run() { return getPropertyFromSignedJar(prop); } }); } public static String attack() { try { Class signedAppletClass = Class.forName("signed.MixedSigningAppletSigned"); Method m = signedAppletClass.getMethod("getProperty", String.class); String result = (String) m.invoke(signedAppletClass.newInstance(), "user.home"); return result; } catch (Exception e) { e.printStackTrace(); return e.toString(); } } public static String attackDoPrivileged() { return AccessController.doPrivileged(new PrivilegedAction() { @Override public String run() { return new MixedSigningAppletSigned().testSignedReadPropertiesDoPrivileged(); } }); } public static String reflectiveAttack() { String result = null; try { Object signedApplet = Class.forName("signed.MixedSigningAppletSigned").newInstance(); Method getProp = signedApplet.getClass().getMethod("calledByReflection"); result = (String)getProp.invoke(signedApplet); } catch (Exception e) { e.printStackTrace(); result = e.toString(); } return result; } public static String reflectiveAttackDoPrivileged() { return AccessController.doPrivileged(new PrivilegedAction() { @Override public String run() { return reflectiveAttack(); } }); } } icedtea-web-1.6.2/tests/reproducers/custom/MixedSigningApplet/srcs/PaxHeaders.17941/Makefile0000644000000000000000000000013112654402377026622 xustar0030 mtime=1454507263.242432514 29 atime=1454507327.21657931 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/MixedSigningApplet/srcs/Makefile0000644000175000002070000000215612654402377027352 0ustar00jvanekmock00000000000000TESTNAME=MixedSigningApplet SRC_FILES=MixedSigningAppletSigned.java MixedSigningAppletHelper.java ENTRYPOINT_CLASSES=MixedSigningApplet JAVAC_CLASSPATH=$(TEST_EXTENSIONS_DIR):$(NETX_DIR)/lib/classes.jar JAVAC=$(EXPORTED_JAVAC) JAR=$(EXPORTED_JAR) JARSIGNER=$(EXPORTED_JARSIGNER) JARSIGNER_CMD=$(JARSIGNER) -keystore $(TOP_BUILD_DIR)/$(PRIVATE_KEYSTORE_NAME) -storepass $(PRIVATE_KEYSTORE_PASS) -keypass $(PRIVATE_KEYSTORE_PASS) TMPDIR:=$(shell mktemp -d) prepare-reproducer: echo PREPARING REPRODUCER $(TESTNAME) $(JAVAC) -d $(TMPDIR) -classpath $(JAVAC_CLASSPATH) $(SRC_FILES); \ cp ../resources/* $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR); \ cd $(TMPDIR); \ $(JAR) cfe MixedSigningAppletSigned.jar signed.MixedSigningAppletSigned signed; \ $(JAR) cf MixedSigningApplet.jar helper; \ cd -; \ $(JARSIGNER_CMD) -sigfile Alpha $(TMPDIR)/MixedSigningAppletSigned.jar $(TEST_CERT_ALIAS)_signed; \ cp $(TMPDIR)/MixedSigningApplet{Signed,}.jar $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR); \ echo PREPARED REPRODUCER $(TESTNAME), removing $(TMPDIR); \ rm -rf $(TMPDIR); \ clean-reproducer: echo NOTHING TO CLEAN FOR $(TESTNAME) icedtea-web-1.6.2/tests/reproducers/custom/MixedSigningApplet/PaxHeaders.17941/resources0000644000000000000000000000013212654402377026146 xustar0030 mtime=1454507263.241432528 30 atime=1454507658.776157397 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/MixedSigningApplet/resources/0000755000175000002070000000000012654402377026746 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/MixedSigningApplet/resources/PaxHeaders.17941/MixedSignin0000644000000000000000000000013112654402377030363 xustar0030 mtime=1454507263.241432528 29 atime=1454507327.21657931 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/MixedSigningApplet/resources/MixedSigningApplet.jnlp0000644000175000002070000000451012654402377033366 0ustar00jvanekmock00000000000000 MixedSigningApplet IcedTea Test per-JAR security assignment and permissions PARAM_ARG_TARGET SECURITY_TAG_TARGET icedtea-web-1.6.2/tests/reproducers/custom/MixedSigningApplet/resources/PaxHeaders.17941/MixedSignin0000644000000000000000000000013112654402377030363 xustar0030 mtime=1454507263.241432528 29 atime=1454507327.21657931 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/MixedSigningApplet/resources/MixedSigningApplet.html0000644000175000002070000000411612654402377033371 0ustar00jvanekmock00000000000000 icedtea-web-1.6.2/tests/reproducers/custom/PaxHeaders.17941/JNLPClassLoaderDeadlock0000644000000000000000000000013212654402377024710 xustar0030 mtime=1454507263.241432528 30 atime=1454507658.776157397 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/JNLPClassLoaderDeadlock/0000755000175000002070000000000012654402377025510 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/JNLPClassLoaderDeadlock/PaxHeaders.17941/testcases0000644000000000000000000000013212654402377026706 xustar0030 mtime=1454507263.241432528 30 atime=1454507658.776157397 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/JNLPClassLoaderDeadlock/testcases/0000755000175000002070000000000012654402377027506 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/JNLPClassLoaderDeadlock/testcases/PaxHeaders.17941/JNLPCl0000644000000000000000000000032112654402377027730 xustar00119 path=icedtea-web-1.6.2/tests/reproducers/custom/JNLPClassLoaderDeadlock/testcases/JNLPClassLoaderDeadlockTest.java 30 mtime=1454507263.241432528 30 atime=1454507327.215579323 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/JNLPClassLoaderDeadlock/testcases/JNLPClassLoaderDeadlock0000644000175000002070000000642412654402377033746 0ustar00jvanekmock00000000000000/* JNLPClassLoaderDeadlockTest.java Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess.AutoClose; import net.sourceforge.jnlp.annotations.Bug; import net.sourceforge.jnlp.annotations.KnownToFail; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.RulesFolowingClosingListener; import static org.junit.Assert.assertTrue; import org.junit.Test; public class JNLPClassLoaderDeadlockTest extends BrowserTest { @NeedsDisplay @Test @TestInBrowsers(testIn={Browsers.one}) @Bug(id="RH976833") public void testClassLoaderDeadlock() throws Exception { RulesFolowingClosingListener listener = new RulesFolowingClosingListener(); listener.addContainsRule("JNLPClassLoaderDeadlock_1 applet finished"); listener.addContainsRule("JNLPClassLoaderDeadlock_2 applet finished"); ProcessResult pr = server.executeBrowser("JNLPClassLoaderDeadlock.html", listener, null); assertTrue("First applet should have initialized", pr.stdout.contains("JNLPClassLoaderDeadlock_1 applet initialized")); assertTrue("Second applet should have initialized", pr.stdout.contains("JNLPClassLoaderDeadlock_2 applet initialized")); assertTrue("First applet should have finished", pr.stdout.contains("JNLPClassLoaderDeadlock_1 applet finished")); assertTrue("Second applet should have finished", pr.stdout.contains("JNLPClassLoaderDeadlock_2 applet finished")); } } icedtea-web-1.6.2/tests/reproducers/custom/JNLPClassLoaderDeadlock/PaxHeaders.17941/srcs0000644000000000000000000000013212654402377025662 xustar0030 mtime=1454507263.240432541 30 atime=1454507658.776157397 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/JNLPClassLoaderDeadlock/srcs/0000755000175000002070000000000012654402377026462 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/JNLPClassLoaderDeadlock/srcs/PaxHeaders.17941/Makefile0000644000000000000000000000013212654402377027377 xustar0030 mtime=1454507263.240432541 30 atime=1454507327.215579323 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/JNLPClassLoaderDeadlock/srcs/Makefile0000644000175000002070000000151212654402377030121 0ustar00jvanekmock00000000000000TESTNAME=JNLPClassLoaderDeadlock SRC_FILES=JNLPClassLoaderDeadlock_1.java JNLPClassLoaderDeadlock_2.java RESOURCE_FILES=JNLPClassLoaderDeadlock.html ENTRYPOINT_CLASSES=JNLPClassLoaderDeadlock_1 JNLPClassLoaderDeadlock_2 JAVAC_CLASSPATH=$(TEST_EXTENSIONS_DIR):$(NETX_DIR)/lib/classes.jar JAVAC=$(EXPORTED_JAVAC) JAR=$(EXPORTED_JAR) TMPDIR:=$(shell mktemp -d) prepare-reproducer: echo PREPARING REPRODUCER $(TESTNAME) $(JAVAC) -d $(TMPDIR) -classpath $(JAVAC_CLASSPATH) $(SRC_FILES) cd ../resources; \ cp $(RESOURCE_FILES) $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR); \ cd -; \ for CLASS in $(ENTRYPOINT_CLASSES); \ do \ mv $(TMPDIR)/"$$CLASS.class" $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR); \ done; \ echo PREPARED REPRODUCER $(TESTNAME), removing $(TMPDIR) rm -rf $(TMPDIR) clean-reproducer: echo NOTHING TO CLEAN FOR $(TESTNAME) icedtea-web-1.6.2/tests/reproducers/custom/JNLPClassLoaderDeadlock/srcs/PaxHeaders.17941/JNLPClassLo0000644000000000000000000000031212654402377027706 xustar00112 path=icedtea-web-1.6.2/tests/reproducers/custom/JNLPClassLoaderDeadlock/srcs/JNLPClassLoaderDeadlock_2.java 30 mtime=1454507263.240432541 30 atime=1454507327.215579323 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/JNLPClassLoaderDeadlock/srcs/JNLPClassLoaderDeadlock_2.ja0000644000175000002070000000464512654402377033537 0ustar00jvanekmock00000000000000import java.applet.Applet; import java.awt.*; import java.security.*; import java.util.PropertyPermission; public class JNLPClassLoaderDeadlock_2 extends Applet implements Runnable { private static final String propertyNames[] = { "java.version", "java.vendor", "java.vendor.url", "java.home", "java.vm.specification.version", "java.vm.specification.vendor", "java.vm.specification.name", "java.vm.version", "java.vm.name", "java.vm.home", "java.specification.version", "java.specification.vendor", "java.specification.name", "java.class.version", "java.class.path", "os.name", "os.arch", "os.version", "file.separator", "path.separator", "line.separator", "user.home", "user.name", "user.dir", }; private Label[] propertyValues; @Override public void init() { System.out.println("JNLPClassLoaderDeadlock_2 applet initialized"); GridBagLayout gridbaglayout = new GridBagLayout(); setLayout(gridbaglayout); GridBagConstraints leftColumn = new GridBagConstraints(); leftColumn.anchor = 20; leftColumn.ipadx = 16; GridBagConstraints rightColumn = new GridBagConstraints(); rightColumn.fill = 2; rightColumn.gridwidth = 0; rightColumn.weightx = 1.0D; Label labels[] = new Label[propertyNames.length]; propertyValues = new Label[propertyNames.length]; final String preloadText = "..."; for (int i = 0; i < propertyNames.length; ++i) { labels[i] = new Label(propertyNames[i]); gridbaglayout.setConstraints(labels[i], leftColumn); add(labels[i]); propertyValues[i] = new Label(preloadText); gridbaglayout.setConstraints(propertyValues[i], rightColumn); add(propertyValues[i]); } Thread t = new Thread(this); t.start(); } @Override public void run() { for (int i = 0; i < propertyNames.length; ++i) { try { final String propertyValue = System.getProperty(propertyNames[i]); propertyValues[i].setText(propertyValue); } catch (SecurityException securityexception) { } } System.out.println("JNLPClassLoaderDeadlock_2 applet finished"); } } icedtea-web-1.6.2/tests/reproducers/custom/JNLPClassLoaderDeadlock/srcs/PaxHeaders.17941/JNLPClassLo0000644000000000000000000000031212654402377027706 xustar00112 path=icedtea-web-1.6.2/tests/reproducers/custom/JNLPClassLoaderDeadlock/srcs/JNLPClassLoaderDeadlock_1.java 30 mtime=1454507263.240432541 30 atime=1454507327.215579323 30 ctime=1454507658.765157544 icedtea-web-1.6.2/tests/reproducers/custom/JNLPClassLoaderDeadlock/srcs/JNLPClassLoaderDeadlock_1.ja0000644000175000002070000000144312654402377033527 0ustar00jvanekmock00000000000000import java.applet.Applet; import java.awt.*; public class JNLPClassLoaderDeadlock_1 extends Applet { @Override public void init() { System.out.println("JNLPClassLoaderDeadlock_1 applet initialized"); final String version = System.getProperty("java.version") + " (" + System.getProperty("java.vm.version") + ")"; final String vendor = System.getProperty("java.vendor"); final TextField tf = new TextField(40); tf.setText(version + " -- " + vendor); tf.setEditable(false); tf.setBackground(Color.white); setBackground(Color.white); add(tf); System.out.println("JNLPClassLoaderDeadlock_1 applet finished"); } public static void main(String[] args) { new JNLPClassLoaderDeadlock_1().init(); } } icedtea-web-1.6.2/tests/reproducers/custom/JNLPClassLoaderDeadlock/PaxHeaders.17941/resources0000644000000000000000000000013212654402377026722 xustar0030 mtime=1454507263.240432541 30 atime=1454507658.776157397 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/custom/JNLPClassLoaderDeadlock/resources/0000755000175000002070000000000012654402377027522 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/JNLPClassLoaderDeadlock/resources/PaxHeaders.17941/JNLPCl0000644000000000000000000000031512654402377027747 xustar00115 path=icedtea-web-1.6.2/tests/reproducers/custom/JNLPClassLoaderDeadlock/resources/JNLPClassLoaderDeadlock.html 30 mtime=1454507263.240432541 30 atime=1454507327.215579323 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/custom/JNLPClassLoaderDeadlock/resources/JNLPClassLoaderDeadlock0000644000175000002070000000036712654402377033762 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/custom/PaxHeaders.17941/GifarCreator0000644000000000000000000000013212654402377022751 xustar0030 mtime=1454507263.239432554 30 atime=1454507658.776157397 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/custom/GifarCreator/0000755000175000002070000000000012654402377023551 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/GifarCreator/PaxHeaders.17941/srcs0000644000000000000000000000013212654402377023723 xustar0030 mtime=1454507263.239432554 30 atime=1454507658.776157397 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/custom/GifarCreator/srcs/0000755000175000002070000000000012654402377024523 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/GifarCreator/srcs/PaxHeaders.17941/Makefile0000644000000000000000000000013212654402377025440 xustar0030 mtime=1454507263.239432554 30 atime=1454507327.215579323 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/custom/GifarCreator/srcs/Makefile0000644000175000002070000000062712654402377026170 0ustar00jvanekmock00000000000000DEPLOY_SUBDIR=$(REPRODUCERS_TESTS_SERVER_DEPLOYDIR) GIF=$(DEPLOY_SUBDIR)/happyNonAnimated.gif JAR=$(DEPLOY_SUBDIR)/GifarBase.jar RESULT1=$(DEPLOY_SUBDIR)/Gifar.jar RESULT2=$(DEPLOY_SUBDIR)/Gifar.gif #this is dependent on reproducers/signed/GifarBase prepare-reproducer: cat $(GIF) > $(RESULT1) cat $(JAR) >> $(RESULT1) cp $(RESULT1) $(RESULT2) clean-reproducer: rm -rf $(RESULT1) rm -rf $(RESULT2) icedtea-web-1.6.2/tests/reproducers/custom/PaxHeaders.17941/ExtensionJnlpsInApplet0000644000000000000000000000013212654402377025021 xustar0030 mtime=1454507263.239432554 30 atime=1454507658.776157397 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/custom/ExtensionJnlpsInApplet/0000755000175000002070000000000012654402377025621 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/ExtensionJnlpsInApplet/PaxHeaders.17941/testcases0000644000000000000000000000013212654402377027017 xustar0030 mtime=1454507263.239432554 30 atime=1454507658.776157397 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/custom/ExtensionJnlpsInApplet/testcases/0000755000175000002070000000000012654402377027617 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/ExtensionJnlpsInApplet/testcases/PaxHeaders.17941/Extensi0000644000000000000000000000031712654402377030443 xustar00117 path=icedtea-web-1.6.2/tests/reproducers/custom/ExtensionJnlpsInApplet/testcases/ExtensionJnlpsInAppletTest.java 30 mtime=1454507263.239432554 30 atime=1454507327.215579323 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/custom/ExtensionJnlpsInApplet/testcases/ExtensionJnlpsInAppletTe0000644000175000002070000000641112654402377034455 0ustar00jvanekmock00000000000000/* ExtensionJnlpsInAppletTest.java Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess.AutoClose; import net.sourceforge.jnlp.annotations.Bug; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; import org.junit.Assert; import org.junit.Test; public class ExtensionJnlpsInAppletTest extends BrowserTest { private static final String appletCloseString = AutoOkClosingListener.MAGICAL_OK_CLOSING_STRING; @Test @NeedsDisplay @TestInBrowsers(testIn={Browsers.one}) public void testExtensionJnlpsInAppletLaunch() throws Exception { ProcessResult pr = server.executeBrowser("ExtensionJnlpTest.html", AutoClose.CLOSE_ON_CORRECT_END); Assert.assertTrue("stdout should contain \"" + appletCloseString + "\" but did not", pr.stdout.contains(appletCloseString)); Assert.assertTrue("stdout should contain \"Applet test running\" but did not", pr.stdout.contains("Applet test running")); } @Test @NeedsDisplay @TestInBrowsers(testIn={Browsers.one}) @Bug(id="PR974") public void testExtensionJnlpsInAppletHelper() throws Exception { ProcessResult pr = server.executeBrowser("ExtensionJnlpTest.html", AutoClose.CLOSE_ON_CORRECT_END); Assert.assertTrue("stdout should contain \"" + appletCloseString + "\" but did not", pr.stdout.contains(appletCloseString)); Assert.assertTrue("stdout should contain \"Helper!\" but did not", pr.stdout.contains("Helper!")); } } icedtea-web-1.6.2/tests/reproducers/custom/ExtensionJnlpsInApplet/PaxHeaders.17941/srcs0000644000000000000000000000013212654402377025773 xustar0030 mtime=1454507263.239432554 30 atime=1454507658.776157397 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/custom/ExtensionJnlpsInApplet/srcs/0000755000175000002070000000000012654402377026573 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/ExtensionJnlpsInApplet/srcs/PaxHeaders.17941/Makefile0000644000000000000000000000013212654402377027510 xustar0030 mtime=1454507263.239432554 30 atime=1454507327.214579336 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/custom/ExtensionJnlpsInApplet/srcs/Makefile0000644000175000002070000000170112654402377030232 0ustar00jvanekmock00000000000000TESTNAME=ExtensionJnlpsInApplet SRC_FILES=ExtensionJnlpHelper.java ExtensionJnlpTestApplet.java RESOURCE_FILES=ExtensionJnlpTest.html ExtensionJnlpTestApplet.jnlp ExtensionJnlpHelper.jnlp ENTRYPOINT_CLASSES=ExtensionJnlpHelper ExtensionJnlpTestApplet JAVAC_CLASSPATH=$(TEST_EXTENSIONS_DIR):$(NETX_DIR)/lib/classes.jar JAVAC=$(EXPORTED_JAVAC) JAR=$(EXPORTED_JAR) TMPDIR:=$(shell mktemp -d) prepare-reproducer: echo PREPARING REPRODUCER $(TESTNAME) $(JAVAC) -d $(TMPDIR) -classpath $(JAVAC_CLASSPATH) $(SRC_FILES) cd ../resources; \ cp $(RESOURCE_FILES) $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR); \ cd -; \ ls; \ for CLASS in $(ENTRYPOINT_CLASSES); \ do \ cd $(TMPDIR); \ $(JAR) cfe "$$CLASS.jar" "$$CLASS" "$$CLASS.class"; \ cd -;\ mv $(TMPDIR)/"$$CLASS.jar" $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR); \ done; \ echo PREPARED REPRODUCER $(TESTNAME), removing $(TMPDIR) rm -rf $(TMPDIR) clean-reproducer: echo NOTHING TO CLEAN FOR $(TESTNAME) icedtea-web-1.6.2/tests/reproducers/custom/ExtensionJnlpsInApplet/srcs/PaxHeaders.17941/ExtensionJnl0000644000000000000000000000013212654402377030413 xustar0030 mtime=1454507263.239432554 30 atime=1454507327.214579336 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/custom/ExtensionJnlpsInApplet/srcs/ExtensionJnlpTestApplet.java0000644000175000002070000000425412654402377034251 0ustar00jvanekmock00000000000000/* ExtensionJnlpTestApplet.java Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.applet.*; public class ExtensionJnlpTestApplet extends Applet { private static final String appletCloseString = "*** APPLET FINISHED ***"; public static void main(String[] args) { System.out.println("Running as standalone application"); System.out.println(ExtensionJnlpHelper.help()); System.out.println(appletCloseString); } public void start() { System.out.println("Applet test running!"); System.out.println(ExtensionJnlpHelper.help()); System.out.println(appletCloseString); } } icedtea-web-1.6.2/tests/reproducers/custom/ExtensionJnlpsInApplet/srcs/PaxHeaders.17941/ExtensionJnl0000644000000000000000000000013212654402377030413 xustar0030 mtime=1454507263.238432568 30 atime=1454507327.214579336 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/custom/ExtensionJnlpsInApplet/srcs/ExtensionJnlpHelper.java0000644000175000002070000000333012654402377033375 0ustar00jvanekmock00000000000000/* ExtensionJnlpHelper.java Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class ExtensionJnlpHelper { public static String help() { return "Helper!"; } } icedtea-web-1.6.2/tests/reproducers/custom/ExtensionJnlpsInApplet/PaxHeaders.17941/resources0000644000000000000000000000013212654402377027033 xustar0030 mtime=1454507263.238432568 30 atime=1454507658.776157397 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/custom/ExtensionJnlpsInApplet/resources/0000755000175000002070000000000012654402377027633 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/ExtensionJnlpsInApplet/resources/PaxHeaders.17941/Extensi0000644000000000000000000000031412654402377030454 xustar00114 path=icedtea-web-1.6.2/tests/reproducers/custom/ExtensionJnlpsInApplet/resources/ExtensionJnlpTestApplet.jnlp 30 mtime=1454507263.238432568 30 atime=1454507327.214579336 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/custom/ExtensionJnlpsInApplet/resources/ExtensionJnlpTestApplet.0000644000175000002070000000441712654402377034450 0ustar00jvanekmock00000000000000 ExtensionJnlpTestApplet IcedTea PR974 Test icedtea-web-1.6.2/tests/reproducers/custom/ExtensionJnlpsInApplet/resources/PaxHeaders.17941/Extensi0000644000000000000000000000013212654402377030452 xustar0030 mtime=1454507263.238432568 30 atime=1454507327.214579336 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/custom/ExtensionJnlpsInApplet/resources/ExtensionJnlpTest.html0000644000175000002070000000344212654402377034164 0ustar00jvanekmock00000000000000 icedtea-web-1.6.2/tests/reproducers/custom/ExtensionJnlpsInApplet/resources/PaxHeaders.17941/Extensi0000644000000000000000000000013212654402377030452 xustar0030 mtime=1454507263.238432568 30 atime=1454507327.214579336 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/custom/ExtensionJnlpsInApplet/resources/ExtensionJnlpHelper.jnlp0000644000175000002070000000414412654402377034463 0ustar00jvanekmock00000000000000 ExtensionJnlpHelper IcedTea PR974 Test icedtea-web-1.6.2/tests/reproducers/custom/PaxHeaders.17941/AppletFolderInArchiveTag0000644000000000000000000000013212654402377025207 xustar0030 mtime=1454507263.237432581 30 atime=1454507658.777157383 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/custom/AppletFolderInArchiveTag/0000755000175000002070000000000012654402377026007 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/AppletFolderInArchiveTag/PaxHeaders.17941/testcases0000644000000000000000000000013212654402377027205 xustar0030 mtime=1454507263.237432581 30 atime=1454507658.777157383 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/custom/AppletFolderInArchiveTag/testcases/0000755000175000002070000000000012654402377030005 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/AppletFolderInArchiveTag/testcases/PaxHeaders.17941/Apple0000644000000000000000000000032312654402377030250 xustar00122 path=icedtea-web-1.6.2/tests/reproducers/custom/AppletFolderInArchiveTag/testcases/AppletFolderInArchiveTagTests.java 30 mtime=1454507263.237432581 29 atime=1454507327.21357935 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/custom/AppletFolderInArchiveTag/testcases/AppletFolderInArchiveT0000644000175000002070000000471312654402377034233 0ustar00jvanekmock00000000000000/* AppletFolderInArchiveTagTests.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.annotations.Bug; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import org.junit.Assert; import org.junit.Test; public class AppletFolderInArchiveTagTests extends BrowserTest{ @NeedsDisplay @Test @TestInBrowsers(testIn={Browsers.all}) @Bug(id="PR1011") public void testClassInAppletFolder() throws Exception { ProcessResult pr = server.executeBrowser("/AppletFolderInArchiveTag.html"); String s0 = "This was ran from a folder specified in the archive tag."; Assert.assertTrue("Expected '"+s0+"', stdout was: " + pr.stdout, pr.stdout.contains(s0)); } } icedtea-web-1.6.2/tests/reproducers/custom/AppletFolderInArchiveTag/PaxHeaders.17941/srcs0000644000000000000000000000013212654402377026161 xustar0030 mtime=1454507263.237432581 30 atime=1454507658.777157383 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/custom/AppletFolderInArchiveTag/srcs/0000755000175000002070000000000012654402377026761 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/AppletFolderInArchiveTag/srcs/PaxHeaders.17941/Makefile0000644000000000000000000000013112654402377027675 xustar0030 mtime=1454507263.237432581 29 atime=1454507327.21357935 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/custom/AppletFolderInArchiveTag/srcs/Makefile0000644000175000002070000000127212654402377030423 0ustar00jvanekmock00000000000000TESTNAME=AppletFolderInArchiveTag ARCHIVE_TEST_FOLDER=archive_tag_folder_test JAVAC_CLASSPATH=$(TEST_EXTENSIONS_DIR):$(NETX_DIR)/lib/classes.jar DEPLOY_SUBDIR=$(REPRODUCERS_TESTS_SERVER_DEPLOYDIR)/$(ARCHIVE_TEST_FOLDER) INDEX_HTML_BODY="

Required to recognize folder structure

" prepare-reproducer: echo PREPARING REPRODUCER $(TESTNAME) mkdir -p $(DEPLOY_SUBDIR) echo $(INDEX_HTML_BODY) > $(DEPLOY_SUBDIR)/index.html $(EXPORTED_JAVAC) -classpath $(JAVAC_CLASSPATH) -d $(DEPLOY_SUBDIR) $(TESTNAME).java echo PREPARED REPRODUCER $(TESTNAME) clean-reproducer: echo CLEANING REPRODUCER $(TESTNAME) rm -rf $(DEPLOY_SUBDIR) echo CLEANED REPRODUCER $(TESTNAME) icedtea-web-1.6.2/tests/reproducers/custom/AppletFolderInArchiveTag/srcs/PaxHeaders.17941/AppletFold0000644000000000000000000000031112654402377030212 xustar00112 path=icedtea-web-1.6.2/tests/reproducers/custom/AppletFolderInArchiveTag/srcs/AppletFolderInArchiveTag.java 30 mtime=1454507263.237432581 29 atime=1454507327.21357935 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/custom/AppletFolderInArchiveTag/srcs/AppletFolderInArchiveTag.ja0000644000175000002070000000414412654402377034106 0ustar00jvanekmock00000000000000import java.applet.Applet; /* Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class AppletFolderInArchiveTag extends Applet { private static class Killer extends Thread { @Override public void run() { try { int n = 2000; Thread.sleep(n); System.exit(0); } catch (Exception ex) { } } } @Override public void init() { new Killer().start(); System.out.println("This was ran from a folder specified in the archive tag."); } } icedtea-web-1.6.2/tests/reproducers/custom/AppletFolderInArchiveTag/PaxHeaders.17941/resources0000644000000000000000000000013212654402377027221 xustar0030 mtime=1454507263.236432594 30 atime=1454507658.777157383 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/custom/AppletFolderInArchiveTag/resources/0000755000175000002070000000000012654402377030021 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/AppletFolderInArchiveTag/resources/PaxHeaders.17941/Apple0000644000000000000000000000031612654402377030266 xustar00117 path=icedtea-web-1.6.2/tests/reproducers/custom/AppletFolderInArchiveTag/resources/AppletFolderInArchiveTag.html 30 mtime=1454507263.236432594 29 atime=1454507327.21357935 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/custom/AppletFolderInArchiveTag/resources/AppletFolderInArchiveT0000644000175000002070000000340412654402377034243 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/custom/PaxHeaders.17941/AppletExtendsFromOutsideJar0000644000000000000000000000013212654402377025777 xustar0030 mtime=1454507263.236432594 30 atime=1454507658.777157383 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/custom/AppletExtendsFromOutsideJar/0000755000175000002070000000000012654402377026577 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/AppletExtendsFromOutsideJar/PaxHeaders.17941/testcases0000644000000000000000000000013212654402377027775 xustar0030 mtime=1454507263.236432594 30 atime=1454507658.777157383 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/custom/AppletExtendsFromOutsideJar/testcases/0000755000175000002070000000000012654402377030575 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/AppletExtendsFromOutsideJar/testcases/PaxHeaders.17941/Ap0000644000000000000000000000033112654402377030336 xustar00128 path=icedtea-web-1.6.2/tests/reproducers/custom/AppletExtendsFromOutsideJar/testcases/AppletExtendsFromOutsideJarTests.java 30 mtime=1454507263.236432594 29 atime=1454507327.21357935 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/custom/AppletExtendsFromOutsideJar/testcases/AppletExtendsFromOu0000644000175000002070000000542012654402377034431 0ustar00jvanekmock00000000000000/* AppletExtendsFromOutsideJarTests.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess.AutoClose; import net.sourceforge.jnlp.annotations.Bug; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import org.junit.Assert; import org.junit.Test; public class AppletExtendsFromOutsideJarTests extends BrowserTest { private static final String LINKAGE_ERROR_OCCURRENCE = "java.lang.LinkageError: "; private static final String APPLET_RUNNING = "My simple applet is running."; @NeedsDisplay @Test @TestInBrowsers(testIn = { Browsers.one }) @Bug(id = "PR920") public void testClassInAppletFolder() throws Exception { ProcessResult pr = server.executeBrowser("/AppletExtendsFromOutsideJar.html", AutoClose.CLOSE_ON_BOTH); Assert.assertFalse("Linkage error should not occur but did!", pr.stderr.contains(LINKAGE_ERROR_OCCURRENCE)); Assert.assertTrue("Expected '" + APPLET_RUNNING + "', stdout was: " + pr.stdout, pr.stdout.contains(APPLET_RUNNING)); } } icedtea-web-1.6.2/tests/reproducers/custom/AppletExtendsFromOutsideJar/PaxHeaders.17941/srcs0000644000000000000000000000013212654402377026751 xustar0030 mtime=1454507263.236432594 30 atime=1454507658.777157383 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/custom/AppletExtendsFromOutsideJar/srcs/0000755000175000002070000000000012654402377027551 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/AppletExtendsFromOutsideJar/srcs/PaxHeaders.17941/Referen0000644000000000000000000000013112654402377030336 xustar0030 mtime=1454507263.236432594 29 atime=1454507327.21357935 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/custom/AppletExtendsFromOutsideJar/srcs/Referenced.java0000644000175000002070000000316512654402377032463 0ustar00jvanekmock00000000000000/* Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class Referenced { } icedtea-web-1.6.2/tests/reproducers/custom/AppletExtendsFromOutsideJar/srcs/PaxHeaders.17941/Makefil0000644000000000000000000000013212654402377030321 xustar0030 mtime=1454507263.236432594 30 atime=1454507327.212579363 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/custom/AppletExtendsFromOutsideJar/srcs/Makefile0000644000175000002070000000146512654402377031217 0ustar00jvanekmock00000000000000TESTNAME=AppletExtendsFromOutsideJar SRC_FILES=AppletReferenceInSameJar.java AppletReferenceOutOfJar.java Referenced.java JAR_FILES=AppletReferenceInSameJar.class Referenced.class OUTER_FILE=AppletReferenceOutOfJar.class JAVAC_CLASSPATH=$(TEST_EXTENSIONS_DIR):$(NETX_DIR)/lib/classes.jar JAVAC=$(EXPORTED_JAVAC) JAR=$(EXPORTED_JAR) TMPDIR:=$(shell mktemp -d) prepare-reproducer: echo PREPARING REPRODUCER $(TESTNAME) in $(TMPDIR) $(JAVAC) -d $(TMPDIR) -classpath $(JAVAC_CLASSPATH) $(SRC_FILES) cd $(TMPDIR); \ $(JAR) cvf $(TESTNAME).jar $(JAR_FILES); \ mv $(OUTER_FILE) $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR); \ mv $(TESTNAME).jar $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR); echo PREPARED REPRODUCER $(TESTNAME), removing $(TMPDIR) rm -rf $(TMPDIR) clean-reproducer: echo NOTHING TO CLEAN FOR $(TESTNAME) icedtea-web-1.6.2/tests/reproducers/custom/AppletExtendsFromOutsideJar/srcs/PaxHeaders.17941/AppletR0000644000000000000000000000031412654402377030322 xustar00114 path=icedtea-web-1.6.2/tests/reproducers/custom/AppletExtendsFromOutsideJar/srcs/AppletReferenceOutOfJar.java 30 mtime=1454507263.235432608 30 atime=1454507327.212579363 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/custom/AppletExtendsFromOutsideJar/srcs/AppletReferenceOutOfJar.0000644000175000002070000000357712654402377034244 0ustar00jvanekmock00000000000000/* Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import javax.swing.JApplet; public class AppletReferenceOutOfJar extends AppletReferenceInSameJar { Referenced outOfJarReference = new Referenced(); public void init() { System.out.println("My simple applet is running."); System.out.println("*** APPLET FINISHED ***"); } } icedtea-web-1.6.2/tests/reproducers/custom/AppletExtendsFromOutsideJar/srcs/PaxHeaders.17941/AppletR0000644000000000000000000000031512654402377030323 xustar00115 path=icedtea-web-1.6.2/tests/reproducers/custom/AppletExtendsFromOutsideJar/srcs/AppletReferenceInSameJar.java 30 mtime=1454507263.235432608 30 atime=1454507327.212579363 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/custom/AppletExtendsFromOutsideJar/srcs/AppletReferenceInSameJar0000644000175000002070000000334112654402377034273 0ustar00jvanekmock00000000000000/* Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import javax.swing.JApplet; public class AppletReferenceInSameJar extends JApplet { Referenced sameJarReference = new Referenced(); } icedtea-web-1.6.2/tests/reproducers/custom/AppletExtendsFromOutsideJar/PaxHeaders.17941/resources0000644000000000000000000000013212654402377030011 xustar0030 mtime=1454507263.235432608 30 atime=1454507658.777157383 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/custom/AppletExtendsFromOutsideJar/resources/0000755000175000002070000000000012654402377030611 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/AppletExtendsFromOutsideJar/resources/PaxHeaders.17941/Ap0000644000000000000000000000032512654402377030355 xustar00123 path=icedtea-web-1.6.2/tests/reproducers/custom/AppletExtendsFromOutsideJar/resources/AppletExtendsFromOutsideJar.html 30 mtime=1454507263.235432608 30 atime=1454507327.212579363 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/custom/AppletExtendsFromOutsideJar/resources/AppletExtendsFromOu0000644000175000002070000000363112654402377034447 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/custom/AppletExtendsFromOutsideJar/PaxHeaders.17941/README0000644000000000000000000000013212654402377026734 xustar0030 mtime=1454507263.234432621 30 atime=1454507327.212579363 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/custom/AppletExtendsFromOutsideJar/README0000644000175000002070000000035012654402377027455 0ustar00jvanekmock00000000000000This reproducer encapsulates PR920. A LinkageError occurs, complaining of duplicate class definition, when an extended class outside of a jar references a common class with its parent class. The common class attempts to load twice. icedtea-web-1.6.2/tests/reproducers/custom/PaxHeaders.17941/AdditionalJarsInMetaInfIndexList0000644000000000000000000000013212654402377026650 xustar0030 mtime=1454507263.234432621 30 atime=1454507658.777157383 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/0000755000175000002070000000000012654402377027450 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/PaxHeaders.17941/testcas0000644000000000000000000000013212654402377030316 xustar0030 mtime=1454507263.234432621 30 atime=1454507658.777157383 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/testcases/0000755000175000002070000000000012654402377031446 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/testcases/PaxHeaders.1790000644000000000000000000000034412654402377030506 xustar00138 path=icedtea-web-1.6.2/tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/testcases/AdditionalJarsInMetaInfIndexListTests.java 30 mtime=1454507263.234432621 30 atime=1454507327.212579363 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/testcases/AdditionalJars0000644000175000002070000000602612654402377034265 0ustar00jvanekmock00000000000000/* AdditionalJarsInMetaInfIndexListTests.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import static org.junit.Assert.*; import java.util.Arrays; import java.util.Collections; import java.util.List; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.annotations.Bug; import net.sourceforge.jnlp.annotations.KnownToFail; import net.sourceforge.jnlp.browsertesting.BrowserTest; import org.junit.Test; public class AdditionalJarsInMetaInfIndexListTests extends BrowserTest { private static ServerAccess server = new ServerAccess(); private static final List TRUSTALL = Collections.unmodifiableList(Arrays.asList(new String[] { "-Xtrustall" })); private static final String CORRECT_EXEC = "Program Executed Correctly."; @Test @KnownToFail @Bug(id = "PR1112") public void SignedMetaInfIndexListTest() throws Exception { ProcessResult pr = server.executeJavawsHeadless("/AdditionalJarsInMetaInfIndexListSigned.jnlp"); assertTrue("LoadedViaMetaInfIndexList's stdout should contain " + CORRECT_EXEC + " but did not.", pr.stdout.contains(CORRECT_EXEC)); } @Test public void UnsignedMetaInfIndexListTest() throws Exception { ProcessResult pr = server.executeJavawsHeadless(TRUSTALL, "/AdditionalJarsInMetaInfIndexListUnsigned.jnlp"); assertTrue("LoadedViaMetaInfIndexList's stdout should contain " + CORRECT_EXEC + " but did not.", pr.stdout.contains(CORRECT_EXEC)); } } icedtea-web-1.6.2/tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/PaxHeaders.17941/srcs0000644000000000000000000000013212654402377027622 xustar0030 mtime=1454507263.234432621 30 atime=1454507658.777157383 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/srcs/0000755000175000002070000000000012654402377030422 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/srcs/PaxHeaders.17941/Ma0000644000000000000000000000013212654402377030157 xustar0030 mtime=1454507263.234432621 30 atime=1454507327.211579377 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/srcs/Makefile0000644000175000002070000000432012654402377032061 0ustar00jvanekmock00000000000000TESTNAME=AdditionalJarsInMetaInfIndexList ARCHIVE_TEST_FOLDER=archive_tag_folder_test JAVAC_CLASSPATH=$(TEST_EXTENSIONS_DIR):$(NETX_DIR)/lib/classes.jar KEYTOOL=$(EXPORTED_KEYTOOL) JARSIGNER=$(EXPORTED_JARSIGNER) JAVAC=$(EXPORTED_JAVAC) JAR=$(EXPORTED_JAR) # File used because the 'jar' command does not accept an empty file DUMMY_FILE=jar_dummy_content # Index jar causes main class jar to load INDEX_JAR_UNSIGNED=AdditionalJarsInMetaInfIndexListUnsigned.jar INDEX_JAR_SIGNED=AdditionalJarsInMetaInfIndexListSigned.jar MAINCLASS=LoadedViaMetaInfIndexList MAINCLASS_JAR_UNSIGNED=LoadedViaMetaInfIndexListUnsigned.jar MAINCLASS_JAR_SIGNED=LoadedViaMetaInfIndexListSigned.jar TMPDIR:=$(shell mktemp -d) prepare-reproducer: echo PREPARING REPRODUCER $(TESTNAME) in $(TMPDIR) $(JAVAC) -d $(TMPDIR) -classpath $(JAVAC_CLASSPATH) $(MAINCLASS).java # Create the jars which have INDEX.LIST cd $(TMPDIR) ; \ echo "This file exists because jar command does not take 0 args" > $(DUMMY_FILE) ; \ $(JAR) cvf $(INDEX_JAR_UNSIGNED) $(DUMMY_FILE) ; \ $(JAR) cvf $(INDEX_JAR_SIGNED) $(DUMMY_FILE) ; # Create the jar which has the main-class # and update INDEX_JAR_*'s index cd $(TMPDIR) ; \ $(JAR) cvf $(MAINCLASS_JAR_UNSIGNED) $(MAINCLASS).class ; \ $(JAR) cvf $(MAINCLASS_JAR_SIGNED) $(MAINCLASS).class ; \ $(JAR) i $(INDEX_JAR_UNSIGNED) $(MAINCLASS_JAR_UNSIGNED) ; \ $(JAR) i $(INDEX_JAR_SIGNED) $(MAINCLASS_JAR_SIGNED) ; # Sign some of the jars for the signed jar test cd $(TMPDIR) ; \ for jar_to_sign in $(MAINCLASS_JAR_SIGNED) $(INDEX_JAR_SIGNED); do \ $(EXPORTED_JARSIGNER) -keystore $(TOP_BUILD_DIR)/$(PRIVATE_KEYSTORE_NAME) -storepass $(PRIVATE_KEYSTORE_PASS) \ -keypass $(PRIVATE_KEYSTORE_PASS) "$$jar_to_sign" $(TEST_CERT_ALIAS)_signed ; \ done # Move jars into deployment directory cd $(TMPDIR); \ mv $(INDEX_JAR_UNSIGNED) $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR) ; \ mv $(INDEX_JAR_SIGNED) $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR) ; \ mv $(MAINCLASS_JAR_UNSIGNED) $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR) ; \ mv $(MAINCLASS_JAR_SIGNED) $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR) ; echo PREPARED REPRODUCER $(TESTNAME), removing $(TMPDIR) rm -rf $(TMPDIR) clean-reproducer: echo NOTHING TO CLEAN FOR $(TESTNAME) icedtea-web-1.6.2/tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/srcs/PaxHeaders.17941/Lo0000644000000000000000000000032312654402377030176 xustar00121 path=icedtea-web-1.6.2/tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/srcs/LoadedViaMetaInfIndexList.java 30 mtime=1454507263.234432621 30 atime=1454507327.211579377 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/srcs/LoadedViaMetaInfInd0000644000175000002070000000336012654402377034076 0ustar00jvanekmock00000000000000/* Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class LoadedViaMetaInfIndexList { public static void main(String[] args) { System.out.println("Program Executed Correctly."); } } icedtea-web-1.6.2/tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/PaxHeaders.17941/resourc0000644000000000000000000000013212654402377030332 xustar0030 mtime=1454507263.233432634 30 atime=1454507658.777157383 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/resources/0000755000175000002070000000000012654402377031462 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/resources/PaxHeaders.1790000644000000000000000000000034712654402377030525 xustar00141 path=icedtea-web-1.6.2/tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/resources/AdditionalJarsInMetaInfIndexListUnsigned.jnlp 30 mtime=1454507263.233432634 30 atime=1454507327.211579377 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/resources/AdditionalJars0000644000175000002070000000440612654402377034301 0ustar00jvanekmock00000000000000 AdditionalJarsInMetaInfIndexListUnsigned IcedTea AdditionalJarsInMetaInfIndexListUnsigned icedtea-web-1.6.2/tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/resources/PaxHeaders.1790000644000000000000000000000034512654402377030523 xustar00139 path=icedtea-web-1.6.2/tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/resources/AdditionalJarsInMetaInfIndexListSigned.jnlp 30 mtime=1454507263.233432634 30 atime=1454507327.211579377 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/resources/AdditionalJars0000644000175000002070000000447012654402377034302 0ustar00jvanekmock00000000000000 AdditionalJarsInMetaInfIndexListSigned IcedTea AdditionalJarsInMetaInfIndexListSigned icedtea-web-1.6.2/tests/reproducers/PaxHeaders.17941/signed0000644000000000000000000000013212654402377020340 xustar0030 mtime=1454507263.263432234 30 atime=1454507658.777157383 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/signed/0000755000175000002070000000000012654402377021140 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/PaxHeaders.17941/ReadPropertiesSigned0000644000000000000000000000013212654402377024422 xustar0030 mtime=1454507263.264432221 30 atime=1454507658.777157383 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/signed/ReadPropertiesSigned/0000755000175000002070000000000012654402377025222 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/ReadPropertiesSigned/PaxHeaders.17941/testcases0000644000000000000000000000013212654402377026420 xustar0030 mtime=1454507263.264432221 30 atime=1454507658.777157383 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/signed/ReadPropertiesSigned/testcases/0000755000175000002070000000000012654402377027220 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/ReadPropertiesSigned/testcases/PaxHeaders.17941/ReadPrope0000644000000000000000000000031312654402377030302 xustar00113 path=icedtea-web-1.6.2/tests/reproducers/signed/ReadPropertiesSigned/testcases/ReadPropertiesSignedTest.java 30 mtime=1454507263.264432221 30 atime=1454507327.262578696 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/signed/ReadPropertiesSigned/testcases/ReadPropertiesSignedTest.j0000644000175000002070000001023012654402377034311 0ustar00jvanekmock00000000000000/* ReadPropertiesSignedTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.util.Arrays; import java.util.Collections; import java.util.List; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import org.junit.Assert; import org.junit.Test; public class ReadPropertiesSignedTest { private static ServerAccess server = new ServerAccess(); private final List l=Collections.unmodifiableList(Arrays.asList(new String[] {"-Xtrustall"})); String accessMatcher = "(?s).*java.security.AccessControlException.{0,5}access denied.{0,5}java.util.PropertyPermission.{0,5}" + "user.name.{0,5}read" + ".*"; @Test public void ReadSignedPropertiesWithoutPermissionsWithXtrustAll() throws Exception { //no request for permissions ProcessResult pr=server.executeJavawsHeadless(l,"/ReadPropertiesSigned1.jnlp"); Assert.assertTrue("Stderr should match "+accessMatcher+" but did not",pr.stderr.matches(accessMatcher)); String ss="ClassNotFoundException"; Assert.assertFalse("Stderr should not contains "+ss+" but did",pr.stderr.contains(ss)); Assert.assertFalse("should not be terminated but was",pr.wasTerminated); Assert.assertEquals((Integer)0, pr.returnValue); } @Test public void ReadSignedPropertiesWithPermissionsWithXtrustAll() throws Exception { //request for allpermissions ProcessResult pr=server.executeJavawsHeadless(l,"/ReadPropertiesSigned2.jnlp"); Assert.assertFalse("Stderr should NOT match "+accessMatcher+" but did",pr.stderr.matches(accessMatcher)); String ss="ClassNotFoundException"; Assert.assertFalse("Stderr should not contains "+ss+" but did",pr.stderr.contains(ss)); Assert.assertFalse("should not be terminated but was",pr.wasTerminated); Assert.assertEquals((Integer)0, pr.returnValue); } @Test public void EnsureXtrustallNotAffectingUnsignedBehaviour() throws Exception { ProcessResult pr=server.executeJavawsHeadless(l,"/ReadProperties1.jnlp"); Assert.assertTrue("Stderr should match "+accessMatcher+" but did not",pr.stderr.matches(accessMatcher)); String ss="ClassNotFoundException"; Assert.assertFalse("Stderr should not contains "+ss+" but did",pr.stderr.contains(ss)); Assert.assertFalse("should not be terminated but was",pr.wasTerminated); Assert.assertEquals((Integer)0, pr.returnValue); ProcessResult pr2=server.executeJavawsHeadless(null,"/ReadProperties1.jnlp"); Assert.assertEquals(pr.stderr, pr2.stderr); Assert.assertEquals(pr.stdout, pr2.stdout); } } icedtea-web-1.6.2/tests/reproducers/signed/ReadPropertiesSigned/PaxHeaders.17941/srcs0000644000000000000000000000013212654402377025374 xustar0030 mtime=1454507263.264432221 30 atime=1454507658.777157383 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/signed/ReadPropertiesSigned/srcs/0000755000175000002070000000000012654402377026174 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/ReadPropertiesSigned/srcs/PaxHeaders.17941/ReadProperties0000644000000000000000000000013212654402377030324 xustar0030 mtime=1454507263.264432221 30 atime=1454507327.262578696 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/signed/ReadPropertiesSigned/srcs/ReadPropertiesSigned.java0000644000175000002070000000354112654402377033124 0ustar00jvanekmock00000000000000/* ReadPropertiesSigned.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class ReadPropertiesSigned { /** *some system property is expected as arg[0], eg user.name or user.home */ public static void main(String[] args) { System.out.println(System.getProperty(args[0])); } } icedtea-web-1.6.2/tests/reproducers/signed/ReadPropertiesSigned/PaxHeaders.17941/resources0000644000000000000000000000013212654402377026434 xustar0030 mtime=1454507263.264432221 30 atime=1454507658.777157383 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/signed/ReadPropertiesSigned/resources/0000755000175000002070000000000012654402377027234 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/ReadPropertiesSigned/resources/PaxHeaders.17941/ReadPrope0000644000000000000000000000013212654402377030315 xustar0030 mtime=1454507263.264432221 30 atime=1454507327.262578696 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/signed/ReadPropertiesSigned/resources/ReadPropertiesSigned2.jnlp0000644000175000002070000000101312654402377034260 0ustar00jvanekmock00000000000000 read properties using System.getenv() IcedTea user.name icedtea-web-1.6.2/tests/reproducers/signed/ReadPropertiesSigned/resources/PaxHeaders.17941/ReadPrope0000644000000000000000000000013212654402377030315 xustar0030 mtime=1454507263.264432221 30 atime=1454507327.262578696 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/signed/ReadPropertiesSigned/resources/ReadPropertiesSigned1.jnlp0000644000175000002070000000072312654402377034266 0ustar00jvanekmock00000000000000 read properties using System.getenv() IcedTea user.name icedtea-web-1.6.2/tests/reproducers/signed/ReadPropertiesSigned/PaxHeaders.17941/README0000644000000000000000000000013212654402377025357 xustar0030 mtime=1454507263.264432221 30 atime=1454507327.262578696 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/signed/ReadPropertiesSigned/README0000644000175000002070000000016412654402377026103 0ustar00jvanekmock00000000000000This test is relied on by custom/MultipleSignaturesPerJar. Any changes to this reproducer may require updates there.icedtea-web-1.6.2/tests/reproducers/signed/PaxHeaders.17941/ReadPropertiesBySignedHack0000644000000000000000000000013212654402377025504 xustar0030 mtime=1454507263.263432234 30 atime=1454507658.777157383 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/signed/ReadPropertiesBySignedHack/0000755000175000002070000000000012654402377026304 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/ReadPropertiesBySignedHack/PaxHeaders.17941/testcases0000644000000000000000000000013212654402377027502 xustar0030 mtime=1454507263.263432234 30 atime=1454507658.777157383 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/signed/ReadPropertiesBySignedHack/testcases/0000755000175000002070000000000012654402377030302 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/ReadPropertiesBySignedHack/testcases/PaxHeaders.17941/Rea0000644000000000000000000000032712654402377030217 xustar00125 path=icedtea-web-1.6.2/tests/reproducers/signed/ReadPropertiesBySignedHack/testcases/ReadPropertiesBySignedHackTest.java 30 mtime=1454507263.263432234 30 atime=1454507327.262578696 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/signed/ReadPropertiesBySignedHack/testcases/ReadPropertiesBySign0000644000175000002070000000545212654402377034277 0ustar00jvanekmock00000000000000/* ReadPropertiesBySignedHackTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.util.Arrays; import java.util.Collections; import java.util.List; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import org.junit.Assert; import org.junit.Test; public class ReadPropertiesBySignedHackTest { private static ServerAccess server = new ServerAccess(); private final List l=Collections.unmodifiableList(Arrays.asList(new String[] {"-Xtrustall"})); @Test public void ReadPropertiesBySignedHackWithjoutXtrustAll() throws Exception { //no request for permissions ProcessResult pr=server.executeJavawsHeadless(l,"/ReadPropertiesBySignedHack.jnlp"); String s="java.lang.SecurityException: class \"ReadProperties\"'s signer information does not match signer information of other classes in the same package"; Assert.assertTrue("Stderr should contains "+s+" but did not",pr.stderr.contains(s)); String ss="ClassNotFoundException"; Assert.assertFalse("Stderr should not contains "+ss+" but did",pr.stderr.contains(ss)); Assert.assertFalse("should not be terminated but was",pr.wasTerminated); Assert.assertEquals((Integer)0, pr.returnValue); } } icedtea-web-1.6.2/tests/reproducers/signed/ReadPropertiesBySignedHack/PaxHeaders.17941/srcs0000644000000000000000000000013212654402377026456 xustar0030 mtime=1454507263.263432234 30 atime=1454507658.777157383 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/signed/ReadPropertiesBySignedHack/srcs/0000755000175000002070000000000012654402377027256 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/ReadPropertiesBySignedHack/srcs/PaxHeaders.17941/ReadProp0000644000000000000000000000031512654402377030175 xustar00116 path=icedtea-web-1.6.2/tests/reproducers/signed/ReadPropertiesBySignedHack/srcs/ReadPropertiesBySignedHack.java 30 mtime=1454507263.263432234 29 atime=1454507327.26157871 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/signed/ReadPropertiesBySignedHack/srcs/ReadPropertiesBySignedHac0000644000175000002070000000514712654402377034201 0ustar00jvanekmock00000000000000/* ReadPropertiesSigned.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.lang.reflect.*; public class ReadPropertiesBySignedHack { /** *some system property is expected as arg[0], eg user.name or user.home */ public static void main(String[] args) throws Throwable { //security manager is not protecting us from accessing classes from //net.sourceforge.jnlp.runtime via reflection Class c2= Class.forName("net.sourceforge.jnlp.runtime.JNLPRuntime"); Field f2 = c2.getDeclaredField("trustAll"); f2.setAccessible(true); f2.setBoolean(null, true); Method m2=c2.getDeclaredMethod("setTrustAll",Boolean.TYPE); m2.setAccessible(true); m2.invoke((Object) null, true ); //but security manager is guarding us against lunching unsigned code //from signed archvive even if Xtrustall is on. Class c1= Class.forName("ReadProperties"); Method m1=c1.getDeclaredMethod("main",args.getClass()); m1.invoke((Object) null, (Object)args); } } icedtea-web-1.6.2/tests/reproducers/signed/ReadPropertiesBySignedHack/PaxHeaders.17941/resources0000644000000000000000000000013212654402377027516 xustar0030 mtime=1454507263.263432234 30 atime=1454507658.777157383 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/signed/ReadPropertiesBySignedHack/resources/0000755000175000002070000000000012654402377030316 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/ReadPropertiesBySignedHack/resources/PaxHeaders.17941/Rea0000644000000000000000000000032212654402377030226 xustar00121 path=icedtea-web-1.6.2/tests/reproducers/signed/ReadPropertiesBySignedHack/resources/ReadPropertiesBySignedHack.jnlp 30 mtime=1454507263.263432234 29 atime=1454507327.26157871 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/signed/ReadPropertiesBySignedHack/resources/ReadPropertiesBySign0000644000175000002070000000114512654402377034306 0ustar00jvanekmock00000000000000 read properties using System.getenv() IcedTea user.name icedtea-web-1.6.2/tests/reproducers/signed/PaxHeaders.17941/MultiJar-SignedJnlpTemplate0000644000000000000000000000013212654402377025616 xustar0030 mtime=1454507263.262432247 30 atime=1454507658.777157383 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/signed/MultiJar-SignedJnlpTemplate/0000755000175000002070000000000012654402377026416 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/MultiJar-SignedJnlpTemplate/PaxHeaders.17941/srcs0000644000000000000000000000013212654402377026570 xustar0030 mtime=1454507263.262432247 30 atime=1454507658.777157383 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/signed/MultiJar-SignedJnlpTemplate/srcs/0000755000175000002070000000000012654402377027370 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/MultiJar-SignedJnlpTemplate/srcs/PaxHeaders.17941/SignedJ0000644000000000000000000000013112654402377030112 xustar0030 mtime=1454507263.262432247 29 atime=1454507327.26157871 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/signed/MultiJar-SignedJnlpTemplate/srcs/SignedJnlpTemplate.java0000644000175000002070000000471612654402377033774 0ustar00jvanekmock00000000000000/* SignedJnlpTemplate.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.lang.reflect.*; public class SignedJnlpTemplate { public static void run() { System.out.println("**Running SignedJnlpTemplate"); } @SuppressWarnings({ "unchecked", "rawtypes" }) public static void main(String[] args) throws Exception { System.out.println("Starting application with signed application_template jnlp"); //No parameters Class noparam[] = {}; //Run SignedJnlpApplication Class c1 = Class.forName("SignedJnlpApplication"); Method m1 = c1.getDeclaredMethod("run", noparam); m1.invoke(c1); //Run SimpleApplication Class c2 = Class.forName("SimpleApplication"); Method m2 = c2.getDeclaredMethod("run", noparam); m2.invoke(c2); System.out.println("Ending application with signed application_template jnlp"); } } icedtea-web-1.6.2/tests/reproducers/signed/MultiJar-SignedJnlpTemplate/srcs/PaxHeaders.17941/JNLP-IN0000644000000000000000000000013212654402377027637 xustar0030 mtime=1454507263.262432247 30 atime=1454507658.777157383 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/signed/MultiJar-SignedJnlpTemplate/srcs/JNLP-INF/0000755000175000002070000000000012654402377030545 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/MultiJar-SignedJnlpTemplate/srcs/JNLP-INF/PaxHeaders.17940000644000000000000000000000032112654402377027664 xustar00120 path=icedtea-web-1.6.2/tests/reproducers/signed/MultiJar-SignedJnlpTemplate/srcs/JNLP-INF/APPLICATION_TEMPLATE.jnlp 30 mtime=1454507263.262432247 29 atime=1454507327.26157871 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/signed/MultiJar-SignedJnlpTemplate/srcs/JNLP-INF/APPLICATION_TEM0000644000175000002070000000440412654402377032742 0ustar00jvanekmock00000000000000 Matching Signed Jnlp Template IcedTea Matching Signed Jnlp Template icedtea-web-1.6.2/tests/reproducers/signed/MultiJar-SignedJnlpTemplate/PaxHeaders.17941/resources0000644000000000000000000000013212654402377027630 xustar0030 mtime=1454507263.262432247 30 atime=1454507658.777157383 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/signed/MultiJar-SignedJnlpTemplate/resources/0000755000175000002070000000000012654402377030430 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/MultiJar-SignedJnlpTemplate/resources/PaxHeaders.17941/Ma0000644000000000000000000000034012654402377030166 xustar00135 path=icedtea-web-1.6.2/tests/reproducers/signed/MultiJar-SignedJnlpTemplate/resources/MainJarWithUnmatchingSignedJnlpTemplate.jnlp 30 mtime=1454507263.262432247 29 atime=1454507327.26157871 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/signed/MultiJar-SignedJnlpTemplate/resources/MainJarWithUnmatchi0000644000175000002070000000560412654402377034226 0ustar00jvanekmock00000000000000 XXXXXXX - THIS FILE DOES NOT MATCH THE SIGNED JNLP TEMPLATE FILE - XXXXXXX IcedTea XXXXXXX - THIS FILE DOES NOT MATCH THE SIGNED JNLP TEMPLATE FILE - XXXXXXX icedtea-web-1.6.2/tests/reproducers/signed/MultiJar-SignedJnlpTemplate/resources/PaxHeaders.17941/Ma0000644000000000000000000000033712654402377030174 xustar00133 path=icedtea-web-1.6.2/tests/reproducers/signed/MultiJar-SignedJnlpTemplate/resources/MainJarWithMatchingSignedJnlpTemplate.jnlp 30 mtime=1454507263.262432247 30 atime=1454507327.260578723 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/signed/MultiJar-SignedJnlpTemplate/resources/MainJarWithMatching0000644000175000002070000000543612654402377034213 0ustar00jvanekmock00000000000000 Matching Signed Jnlp Template IcedTea Matching Signed Jnlp Template icedtea-web-1.6.2/tests/reproducers/signed/PaxHeaders.17941/MultiJar-SignedJnlpApplication0000644000000000000000000000013212654402377026306 xustar0030 mtime=1454507263.261432261 30 atime=1454507658.777157383 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/signed/MultiJar-SignedJnlpApplication/0000755000175000002070000000000012654402377027106 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/MultiJar-SignedJnlpApplication/PaxHeaders.17941/testcases0000644000000000000000000000013212654402377030304 xustar0030 mtime=1454507263.261432261 30 atime=1454507658.777157383 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/signed/MultiJar-SignedJnlpApplication/testcases/0000755000175000002070000000000012654402377031104 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/MultiJar-SignedJnlpApplication/testcases/PaxHeaders.179410000644000000000000000000000032312654402377030306 xustar00121 path=icedtea-web-1.6.2/tests/reproducers/signed/MultiJar-SignedJnlpApplication/testcases/MultiJarSignedJnlpTest.java 30 mtime=1454507263.261432261 30 atime=1454507327.260578723 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/signed/MultiJar-SignedJnlpApplication/testcases/MultiJarSignedJn0000644000175000002070000001162612654402377034206 0ustar00jvanekmock00000000000000/* MultiJarSignedJnlpTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.util.Arrays; import java.util.Collections; import java.util.List; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import org.junit.Assert; import org.junit.Test; public class MultiJarSignedJnlpTest { private static ServerAccess server = new ServerAccess(); private final List l = Collections.unmodifiableList(Arrays.asList(new String[] { "-Xtrustall" })); private final String signedJnlpException = "net.sourceforge.jnlp.LaunchException: Fatal: Application Error: " + "The signed JNLP file did not match the launching JNLP file. Missing Resource: Signed Application " + "did not match launching JNLP File"; @Test public void checkingForRequiredResources() throws Exception { //MainJarWithoutSignedJnlp.jnlp includes all three required jars String s = "Ending application without a Signed Jnlp"; ProcessResult pr = server.executeJavawsHeadless(l, "/MainJarWithoutSignedJnlp.jnlp"); Assert.assertTrue("Could not locate the required resources required to run this test", pr.stdout.contains(s)); } @Test public void mainJarMatchingSignedJnlpTemplate() throws Exception { ProcessResult pr = server.executeJavawsHeadless(l, "/MainJarWithMatchingSignedJnlpTemplate.jnlp"); String s = "Ending application with signed application_template jnlp"; Assert.assertTrue("Could not locate SignedJnlpTemplate class within MultiJar-SignedJnlpTemplate.jar", pr.stdout.contains(s)); Assert.assertFalse(pr.stderr.contains(signedJnlpException)); } @Test public void mainJarMatchingSignedJnlpApplication() throws Exception { ProcessResult pr = server.executeJavawsHeadless(l, "/MainJarWithMatchingSignedJnlpApplication.jnlp"); String s = "Ending application with signed application jnlp"; Assert.assertTrue("Could not locate SignedJnlpApplication class within MultiJar-SignedJnlpApplication.jar", pr.stdout.contains(s)); Assert.assertFalse(pr.stderr.contains(signedJnlpException)); } @Test public void mainJarWithUnmatchingSignedJnlpApplication() throws Exception { String s = "Ending application with signed application jnlp"; ProcessResult pr = server.executeJavawsHeadless(l, "/MainJarWithUnmatchingSignedJnlpApplication.jnlp"); Assert.assertTrue("Stdout should contains " + signedJnlpException + " but did not", pr.stderr.contains(signedJnlpException)); Assert.assertFalse( pr.stdout.contains(s)); } @Test public void mainJarWithUnmatchingSignedJnlpTemplate() throws Exception { String s = "Ending application with signed application_template jnlp"; ProcessResult pr = server.executeJavawsHeadless(l, "/MainJarWithUnmatchingSignedJnlpTemplate.jnlp"); Assert.assertTrue("Stdout should contains " + signedJnlpException + " but did not", pr.stderr.contains(signedJnlpException)); Assert.assertFalse(pr.stdout.contains(s)); } @Test public void mainJarWithoutSignedJnlp() throws Exception { ProcessResult pr = server.executeJavawsHeadless(l, "/MainJarWithoutSignedJnlp.jnlp"); String s = "Ending application without a Signed Jnlp"; Assert.assertTrue("Stdout should contains " + s + " but did not", pr.stdout.contains(s)); } } icedtea-web-1.6.2/tests/reproducers/signed/MultiJar-SignedJnlpApplication/PaxHeaders.17941/srcs0000644000000000000000000000013212654402377027260 xustar0030 mtime=1454507263.261432261 30 atime=1454507658.777157383 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/signed/MultiJar-SignedJnlpApplication/srcs/0000755000175000002070000000000012654402377030060 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/MultiJar-SignedJnlpApplication/srcs/PaxHeaders.17941/Sign0000644000000000000000000000031512654402377030163 xustar00115 path=icedtea-web-1.6.2/tests/reproducers/signed/MultiJar-SignedJnlpApplication/srcs/SignedJnlpApplication.java 30 mtime=1454507263.261432261 30 atime=1454507327.260578723 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/signed/MultiJar-SignedJnlpApplication/srcs/SignedJnlpApplication0000644000175000002070000000467712654402377034242 0ustar00jvanekmock00000000000000/* SignedJnlpApplication.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.lang.reflect.*; public class SignedJnlpApplication { public static void run() { System.out.println("**Running SignedJnlpApplication"); } @SuppressWarnings({ "unchecked", "rawtypes" }) public static void main(String[] args) throws Exception { System.out.println("Starting application with signed application jnlp"); //No parameters Class noparam[] = {}; //Run SignedJnlpTemplate Class c1 = Class.forName("SignedJnlpTemplate"); Method m1 = c1.getDeclaredMethod("run", noparam); m1.invoke(c1); //Run SimpleApplication Class c2 = Class.forName("SimpleApplication"); Method m2 = c2.getDeclaredMethod("run", noparam); m2.invoke(c2); System.out.println("Ending application with signed application jnlp"); } } icedtea-web-1.6.2/tests/reproducers/signed/MultiJar-SignedJnlpApplication/srcs/PaxHeaders.17941/JNLP0000644000000000000000000000013212654402377030023 xustar0030 mtime=1454507263.261432261 30 atime=1454507658.777157383 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/signed/MultiJar-SignedJnlpApplication/srcs/JNLP-INF/0000755000175000002070000000000012654402377031235 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/MultiJar-SignedJnlpApplication/srcs/JNLP-INF/PaxHeaders.10000644000000000000000000000031412654402377030112 xustar00114 path=icedtea-web-1.6.2/tests/reproducers/signed/MultiJar-SignedJnlpApplication/srcs/JNLP-INF/APPLICATION.jnlp 30 mtime=1454507263.261432261 30 atime=1454507327.260578723 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/signed/MultiJar-SignedJnlpApplication/srcs/JNLP-INF/APPLICATION.0000644000175000002070000000464312654402377033010 0ustar00jvanekmock00000000000000 Matching Signed JNLP IcedTea Matching Signed JNLP icedtea-web-1.6.2/tests/reproducers/signed/MultiJar-SignedJnlpApplication/PaxHeaders.17941/resources0000644000000000000000000000013212654402377030320 xustar0030 mtime=1454507263.260432274 30 atime=1454507658.777157383 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/signed/MultiJar-SignedJnlpApplication/resources/0000755000175000002070000000000012654402377031120 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/MultiJar-SignedJnlpApplication/resources/PaxHeaders.179410000644000000000000000000000034712654402377030330 xustar00141 path=icedtea-web-1.6.2/tests/reproducers/signed/MultiJar-SignedJnlpApplication/resources/MainJarWithUnmatchingSignedJnlpApplication.jnlp 30 mtime=1454507263.260432274 30 atime=1454507327.260578723 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/signed/MultiJar-SignedJnlpApplication/resources/MainJarWithUnmat0000644000175000002070000000561212654402377034231 0ustar00jvanekmock00000000000000 XXXXXXX - THIS FILE DOES NOT MATCH THE SIGNED JNLP FILE - XXXXXXX IcedTea XXXXXXX - THIS FILE DOES NOT MATCH THE SIGNED JNLP FILE - XXXXXXX icedtea-web-1.6.2/tests/reproducers/signed/MultiJar-SignedJnlpApplication/resources/PaxHeaders.179410000644000000000000000000000034512654402377030326 xustar00139 path=icedtea-web-1.6.2/tests/reproducers/signed/MultiJar-SignedJnlpApplication/resources/MainJarWithMatchingSignedJnlpApplication.jnlp 30 mtime=1454507263.260432274 30 atime=1454507327.259578736 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/signed/MultiJar-SignedJnlpApplication/resources/MainJarWithMatch0000644000175000002070000000544412654402377034204 0ustar00jvanekmock00000000000000 Matching Signed JNLP IcedTea Matching Signed JNLP icedtea-web-1.6.2/tests/reproducers/signed/PaxHeaders.17941/MultiJar-NoSignedJnlp0000644000000000000000000000013212654402377024417 xustar0030 mtime=1454507263.260432274 30 atime=1454507658.777157383 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/signed/MultiJar-NoSignedJnlp/0000755000175000002070000000000012654402377025217 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/MultiJar-NoSignedJnlp/PaxHeaders.17941/srcs0000644000000000000000000000013212654402377025371 xustar0030 mtime=1454507263.260432274 30 atime=1454507658.777157383 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/signed/MultiJar-NoSignedJnlp/srcs/0000755000175000002070000000000012654402377026171 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/MultiJar-NoSignedJnlp/srcs/PaxHeaders.17941/SimpleApplica0000644000000000000000000000013212654402377030114 xustar0030 mtime=1454507263.260432274 30 atime=1454507327.259578736 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/signed/MultiJar-NoSignedJnlp/srcs/SimpleApplication.java0000644000175000002070000000465512654402377032463 0ustar00jvanekmock00000000000000/* SimpleApplication.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.lang.reflect.*; public class SimpleApplication { public static void run() { System.out.println("**Running SimpleApplication"); } @SuppressWarnings({ "unchecked", "rawtypes" }) public static void main(String[] args) throws Exception { System.out.println("Starting application without a Signed Jnlp"); //No parameters Class noparam[] = {}; //Run SignedJnlpApplication Class c1 = Class.forName("SignedJnlpApplication"); Method m1 = c1.getDeclaredMethod("run", noparam); m1.invoke(c1); //Run SignedJnlpTemplate Class c2 = Class.forName("SignedJnlpTemplate"); Method m2 = c2.getDeclaredMethod("run", noparam); m2.invoke(c2); System.out.println("Ending application without a Signed Jnlp"); } } icedtea-web-1.6.2/tests/reproducers/signed/MultiJar-NoSignedJnlp/PaxHeaders.17941/resources0000644000000000000000000000013212654402377026431 xustar0030 mtime=1454507263.259432288 30 atime=1454507658.777157383 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/signed/MultiJar-NoSignedJnlp/resources/0000755000175000002070000000000012654402377027231 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/MultiJar-NoSignedJnlp/resources/PaxHeaders.17941/MainJarW0000644000000000000000000000031412654402377030103 xustar00114 path=icedtea-web-1.6.2/tests/reproducers/signed/MultiJar-NoSignedJnlp/resources/MainJarWithoutSignedJnlp.jnlp 30 mtime=1454507263.259432288 30 atime=1454507327.259578736 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/signed/MultiJar-NoSignedJnlp/resources/MainJarWithoutSignedJnlp.0000644000175000002070000000540512654402377034121 0ustar00jvanekmock00000000000000 Main Jar does have a signed jnlp IcedTea Main Jar does have a signed jnlp icedtea-web-1.6.2/tests/reproducers/signed/PaxHeaders.17941/MissingJar0000644000000000000000000000013212654402377022406 xustar0030 mtime=1454507263.259432288 30 atime=1454507658.777157383 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/signed/MissingJar/0000755000175000002070000000000012654402377023206 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/MissingJar/PaxHeaders.17941/testcases0000644000000000000000000000013212654402377024404 xustar0030 mtime=1454507263.259432288 30 atime=1454507658.777157383 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/signed/MissingJar/testcases/0000755000175000002070000000000012654402377025204 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/MissingJar/testcases/PaxHeaders.17941/MissingJarTest.java0000644000000000000000000000013212654402377030232 xustar0030 mtime=1454507263.259432288 30 atime=1454507327.259578736 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/signed/MissingJar/testcases/MissingJarTest.java0000644000175000002070000000633712654402377030766 0ustar00jvanekmock00000000000000/* MissingJarTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.util.Arrays; import java.util.Collections; import java.util.List; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import org.junit.Assert; import org.junit.Test; public class MissingJarTest { private static ServerAccess server = new ServerAccess(); private final List l = Collections.unmodifiableList(Arrays.asList(new String[]{"-Xtrustall"})); private void evaluateResult(ProcessResult pr) { String c = "only fixed classloader can initialize this app"; Assert.assertTrue("stdout should contains `" + c + "`, but didn't ", pr.stdout.contains(c)); String cc = "ClassNotFoundException"; Assert.assertFalse("stderr should NOT contains `" + cc + "`, but did ", pr.stderr.contains(cc)); Assert.assertFalse("should not be terminated, but was", pr.wasTerminated); Assert.assertEquals((Integer) 0, pr.returnValue); } @Test public void MissingJarTest1() throws Exception { ProcessResult pr = server.executeJavawsHeadless(l, "/MissingJar.jnlp"); evaluateResult(pr); } @Test public void MissingJarTest2() throws Exception { ProcessResult pr = server.executeJavawsHeadless(l, "/MissingJar2.jnlp"); evaluateResult(pr); } @Test public void MissingJarTest3() throws Exception { ProcessResult pr = server.executeJavawsHeadless(l, "/MissingJar3.jnlp"); evaluateResult(pr); } @Test public void MissingJarTest4() throws Exception { ProcessResult pr = server.executeJavawsHeadless(l, "/MissingJar4.jnlp"); evaluateResult(pr); } } icedtea-web-1.6.2/tests/reproducers/signed/MissingJar/PaxHeaders.17941/srcs0000644000000000000000000000013212654402377023360 xustar0030 mtime=1454507263.259432288 30 atime=1454507658.777157383 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/signed/MissingJar/srcs/0000755000175000002070000000000012654402377024160 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/MissingJar/srcs/PaxHeaders.17941/MissingJar.java0000644000000000000000000000013212654402377026346 xustar0030 mtime=1454507263.259432288 30 atime=1454507327.259578736 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/signed/MissingJar/srcs/MissingJar.java0000644000175000002070000000341112654402377027070 0ustar00jvanekmock00000000000000/* MissingJar.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class MissingJar { public static void main(String[] args) { System.out.println("only fixed classloader can initialize this app"); } } icedtea-web-1.6.2/tests/reproducers/signed/MissingJar/PaxHeaders.17941/resources0000644000000000000000000000013212654402377024420 xustar0030 mtime=1454507263.259432288 30 atime=1454507658.777157383 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/signed/MissingJar/resources/0000755000175000002070000000000012654402377025220 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/MissingJar/resources/PaxHeaders.17941/MissingJar4.jnlp0000644000000000000000000000013212654402377027514 xustar0030 mtime=1454507263.259432288 30 atime=1454507327.259578736 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/signed/MissingJar/resources/MissingJar4.jnlp0000644000175000002070000000114312654402377030236 0ustar00jvanekmock00000000000000 test MissingJar IcedTea icedtea-web-1.6.2/tests/reproducers/signed/MissingJar/resources/PaxHeaders.17941/MissingJar3.jnlp0000644000000000000000000000013112654402377027512 xustar0030 mtime=1454507263.258432301 29 atime=1454507327.25857875 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/signed/MissingJar/resources/MissingJar3.jnlp0000644000175000002070000000110412654402377030232 0ustar00jvanekmock00000000000000 test MissingJar IcedTea icedtea-web-1.6.2/tests/reproducers/signed/MissingJar/resources/PaxHeaders.17941/MissingJar2.jnlp0000644000000000000000000000013112654402377027511 xustar0030 mtime=1454507263.258432301 29 atime=1454507327.25857875 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/signed/MissingJar/resources/MissingJar2.jnlp0000644000175000002070000000110412654402377030231 0ustar00jvanekmock00000000000000 test MissingJar IcedTea icedtea-web-1.6.2/tests/reproducers/signed/MissingJar/resources/PaxHeaders.17941/MissingJar.jnlp0000644000000000000000000000013112654402377027427 xustar0030 mtime=1454507263.258432301 29 atime=1454507327.25857875 30 ctime=1454507658.764157557 icedtea-web-1.6.2/tests/reproducers/signed/MissingJar/resources/MissingJar.jnlp0000644000175000002070000000114212654402377030151 0ustar00jvanekmock00000000000000 test MissingJar IcedTea icedtea-web-1.6.2/tests/reproducers/signed/PaxHeaders.17941/InternalClassloaderWithDownloadedResourc0000644000000000000000000000013112654402377030470 xustar0030 mtime=1454507263.258432301 30 atime=1454507658.777157383 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/0000755000175000002070000000000012654402377031436 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/PaxHeaders.17940000644000000000000000000000013112654402377030554 xustar0030 mtime=1454507263.258432301 30 atime=1454507658.777157383 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/testcases/0000755000175000002070000000000012654402377033434 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/testcases/PaxHe0000644000000000000000000000036312654402377031137 xustar00155 path=icedtea-web-1.6.2/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/testcases/InternalClassloaderWithDownloadedResourceTest.java 30 mtime=1454507263.258432301 29 atime=1454507327.25857875 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/testcases/Inter0000644000175000002070000001407512654402377034447 0ustar00jvanekmock00000000000000/* InternalClassloaderWithDownloadedResourceTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.io.File; import java.util.Arrays; import java.util.Collections; import java.util.List; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.annotations.Bug; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.Test; @Bug(id = {"RH816592","PR858"}) public class InternalClassloaderWithDownloadedResourceTest extends BrowserTest { private final List l = Collections.unmodifiableList(Arrays.asList(new String[]{"-verbose", "-Xtrustall", "-J-Dserveraccess.port=" + server.getPort()})); private static final File portsFile = new File(System.getProperty("java.io.tmpdir"), "serveraccess.port"); @Before public void setUp() { try { ServerAccess.logOutputReprint("Writeing " + server.getPort() + " to " + portsFile.getAbsolutePath()); ServerAccess.saveFile("" + server.getPort(), portsFile); ServerAccess.logOutputReprint("done"); } catch (Exception ex) { ServerAccess.logException(ex); } } @After public void tearDown() { ServerAccess.logOutputReprint("Deleting " + portsFile.getAbsolutePath()); boolean b = portsFile.delete(); ServerAccess.logOutputReprint("Deletion state (should be true) is " + b); } @Test @Bug(id = {"RH816592","PR858"}) public void launchInternalClassloaderWithDownloadedResourceAsJnlpApplication() throws Exception { ProcessResult pr = server.executeJavawsHeadless(l, "/InternalClassloaderWithDownloadedResource-new.jnlp"); evaluate(pr); Assert.assertFalse("should not be terminated but was", pr.wasTerminated); Assert.assertEquals((Integer) 0, pr.returnValue); } private void evaluate(ProcessResult pr) { String ss = "Good simple javaws exapmle"; Assert.assertTrue("Stdout should contains " + ss + " but didn't", pr.stdout.contains(ss)); } @Test @Bug(id = {"RH816592","PR858"}) public void launchInternalClassloaderWithDownloadedResourceAsJnlpApplet() throws Exception { ProcessResult pr = server.executeJavawsHeadless(l, "/InternalClassloaderWithDownloadedResource-applet-new.jnlp"); evaluate(pr); Assert.assertFalse("should not be terminated but was", pr.wasTerminated); Assert.assertEquals((Integer) 0, pr.returnValue); } @Test @Bug(id = {"RH816592","PR858"}) @NeedsDisplay @TestInBrowsers(testIn={Browsers.all}) public void launchInternalClassloaderWithDownloadedResourceAsHtmlApplet() throws Exception { ProcessResult pr = server.executeBrowser("/InternalClassloaderWithDownloadedResource-new.html"); evaluate(pr); Assert.assertTrue("should be terminated but was not", pr.wasTerminated); } @Test @Bug(id = {"http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2012-May/018737.html"}) public void launchInternalClassloaderWithDownloadedResourceAsJnlpApplicationHack() throws Exception { ProcessResult pr = server.executeJavawsHeadless(l, "/InternalClassloaderWithDownloadedResource-hack.jnlp"); evaluate(pr); Assert.assertFalse("should not be terminated but was", pr.wasTerminated); Assert.assertEquals((Integer) 0, pr.returnValue); } @Test @Bug(id = {"http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2012-May/018737.html"}) public void launchInternalClassloaderWithDownloadedResourceAsJnlpAppletHack() throws Exception { ProcessResult pr = server.executeJavawsHeadless(l, "/InternalClassloaderWithDownloadedResource-applet-hack.jnlp"); evaluate(pr); Assert.assertFalse("should not be terminated but was", pr.wasTerminated); Assert.assertEquals((Integer) 0, pr.returnValue); } @Test @NeedsDisplay @Bug(id = {"http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2012-May/018737.html"}) @TestInBrowsers(testIn={Browsers.all}) public void launchInternalClassloaderWithDownloadedResourceAsHtmlAppletHack() throws Exception { ProcessResult pr = server.executeBrowser("/InternalClassloaderWithDownloadedResource-hack.html"); evaluate(pr); Assert.assertTrue("should be terminated but was not", pr.wasTerminated); } } icedtea-web-1.6.2/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/PaxHeaders.17940000644000000000000000000000013112654402377030554 xustar0030 mtime=1454507263.257432314 30 atime=1454507658.777157383 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/srcs/0000755000175000002070000000000012654402377032410 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/srcs/PaxHeaders0000644000000000000000000000035212654402377031130 xustar00146 path=icedtea-web-1.6.2/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/srcs/InternalClassloaderWithDownloadedResource.java 30 mtime=1454507263.257432314 29 atime=1454507327.25857875 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/srcs/InternalCl0000644000175000002070000001435212654402377034373 0ustar00jvanekmock00000000000000/* InternalClassloaderWithDownloadedResource.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.applet.Applet; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.InputStreamReader; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.net.MalformedURLException; import java.net.URL; import java.net.URLClassLoader; public class InternalClassloaderWithDownloadedResource extends Applet { public static void main(String[] args) throws Exception { int port = 44321; //debug default String sPort = System.getProperty("serveraccess.port"); if (sPort != null) { port = new Integer(sPort); } if (args.length != 1) { throw new IllegalArgumentException("exactly one argument expected"); } resolveArgument(args[0], port); } private static void downlaodAndExecuteForeignMethod(int port, int classlaoder) throws SecurityException, InvocationTargetException, ClassNotFoundException, NoSuchMethodException, IllegalAccessException, MalformedURLException, IllegalArgumentException { URL url = new URL("http://localhost:" + port + "/SimpletestSigned1.jar"); URLClassLoader ucl = null; if (classlaoder == 1) { ucl = (URLClassLoader) InternalClassloaderWithDownloadedResource.class.getClassLoader(); System.out.println("Downloading " + url.toString()); Method privateStringMethod = URLClassLoader.class.getDeclaredMethod("addURL", URL.class); privateStringMethod.setAccessible(true); privateStringMethod.invoke(ucl, url); } else if (classlaoder == 2) { ucl = new URLClassLoader(new URL[]{url}); } else { throw new IllegalArgumentException("just 1 or 2 classlaoder id expected"); } executeForeignMethod(port, ucl); } private static void executeForeignMethod(int port, URLClassLoader loader) throws SecurityException, InvocationTargetException, ClassNotFoundException, NoSuchMethodException, IllegalAccessException, MalformedURLException, IllegalArgumentException { String className = "SimpletestSigned1"; Class cls = loader.loadClass(className); Method m = cls.getMethod("main", new Class[]{new String[0].getClass()}); System.out.println("executing " + className + "'s main"); m.invoke(null, (Object) new String[0]); } private static void resolveArgument(String s, int port) throws Exception { if (s == null) { throw new IllegalArgumentException("arg was null"); } else if (s.equalsIgnoreCase("hack")) { downlaodAndExecuteForeignMethod(port, 1); } else if (s.equalsIgnoreCase("new")) { downlaodAndExecuteForeignMethod(port, 2); } else { throw new IllegalArgumentException("hack or new expected as argument"); } } private class Killer extends Thread { public int n = 2000; @Override public void run() { try { Thread.sleep(n); System.out.println("Applet killing himself after " + n + " ms of life"); System.exit(0); } catch (Exception ex) { } } } private Killer killer; @Override public void init() { System.out.println("applet was initialised"); killer = new Killer(); } @Override public void start() { System.out.println("applet was started"); killer.start(); int port = 44321; //debug default try { File portsFile = new File(System.getProperty("java.io.tmpdir"), "serveraccess.port"); if (portsFile.exists()) { String sPort = null; BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(portsFile), "utf-8")); try { sPort = br.readLine(); } finally { br.close(); } if (sPort != null) { port = new Integer(sPort.trim()); } } } catch (Exception ex) { ex.printStackTrace(); throw new RuntimeException(ex); } try { resolveArgument(getParameter("arg"), port); } catch (Exception ex) { ex.printStackTrace(); throw new RuntimeException(ex); } System.out.println("killer was started"); } @Override public void stop() { System.out.println("applet was stopped"); } @Override public void destroy() { System.out.println("applet will be destroyed"); } } icedtea-web-1.6.2/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/PaxHeaders.17940000644000000000000000000000013112654402377030554 xustar0030 mtime=1454507263.257432314 30 atime=1454507658.777157383 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/resources/0000755000175000002070000000000012654402377033450 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/resources/PaxHe0000644000000000000000000000036412654402377031154 xustar00155 path=icedtea-web-1.6.2/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/resources/InternalClassloaderWithDownloadedResource-new.jnlp 30 mtime=1454507263.257432314 30 atime=1454507327.257578763 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/resources/Inter0000644000175000002070000000460012654402377034454 0ustar00jvanekmock00000000000000 InternalClassloaderWithDownloadedResource-new IcedTea InternalClassloaderWithDownloadedResource-new new icedtea-web-1.6.2/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/resources/PaxHe0000644000000000000000000000036412654402377031154 xustar00155 path=icedtea-web-1.6.2/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/resources/InternalClassloaderWithDownloadedResource-new.html 30 mtime=1454507263.257432314 30 atime=1454507327.257578763 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/resources/Inter0000644000175000002070000000367312654402377034465 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/resources/PaxHe0000644000000000000000000000036512654402377031155 xustar00156 path=icedtea-web-1.6.2/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/resources/InternalClassloaderWithDownloadedResource-hack.jnlp 30 mtime=1454507263.256432328 30 atime=1454507327.257578763 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/resources/Inter0000644000175000002070000000460412654402377034460 0ustar00jvanekmock00000000000000 InternalClassloaderWithDownloadedResource-hack IcedTea InternalClassloaderWithDownloadedResource-hack hack icedtea-web-1.6.2/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/resources/PaxHe0000644000000000000000000000036512654402377031155 xustar00156 path=icedtea-web-1.6.2/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/resources/InternalClassloaderWithDownloadedResource-hack.html 30 mtime=1454507263.256432328 30 atime=1454507327.257578763 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/resources/Inter0000644000175000002070000000367412654402377034466 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/resources/PaxHe0000644000000000000000000000037312654402377031154 xustar00162 path=icedtea-web-1.6.2/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/resources/InternalClassloaderWithDownloadedResource-applet-new.jnlp 30 mtime=1454507263.256432328 30 atime=1454507327.257578763 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/resources/Inter0000644000175000002070000000502212654402377034453 0ustar00jvanekmock00000000000000 InternalClassloaderWithDownloadedResource-applet-new IcedTea InternalClassloaderWithDownloadedResource-applet-new icedtea-web-1.6.2/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/resources/PaxHe0000644000000000000000000000037412654402377031155 xustar00163 path=icedtea-web-1.6.2/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/resources/InternalClassloaderWithDownloadedResource-applet-hack.jnlp 30 mtime=1454507263.256432328 30 atime=1454507327.256578776 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/resources/Inter0000644000175000002070000000502612654402377034457 0ustar00jvanekmock00000000000000 InternalClassloaderWithDownloadedResource-applet-hack IcedTea InternalClassloaderWithDownloadedResource-applet-hack icedtea-web-1.6.2/tests/reproducers/signed/PaxHeaders.17941/GifarBase0000644000000000000000000000013112654402377022162 xustar0030 mtime=1454507263.255432341 30 atime=1454507658.777157383 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/GifarBase/0000755000175000002070000000000012654402377022763 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/GifarBase/PaxHeaders.17941/testcases0000644000000000000000000000013112654402377024160 xustar0030 mtime=1454507263.255432341 30 atime=1454507658.777157383 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/GifarBase/testcases/0000755000175000002070000000000012654402377024761 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/GifarBase/testcases/PaxHeaders.17941/GifarTestcases.java0000644000000000000000000000013112654402377030007 xustar0030 mtime=1454507263.255432341 30 atime=1454507327.256578776 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/GifarBase/testcases/GifarTestcases.java0000644000175000002070000002121312654402377030532 0ustar00jvanekmock00000000000000/* AppletTestTests.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import java.util.Arrays; import java.util.List; import javax.imageio.ImageIO; import net.sourceforge.jnlp.ClosingListener; import net.sourceforge.jnlp.OptionsDefinitions; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.RulesFolowingClosingListener; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.util.InvalidJarHeaderException; import net.sourceforge.jnlp.util.JarFile; import org.junit.Assert; import org.junit.Test; public class GifarTestcases extends BrowserTest { List trustIgnore = Arrays.asList(new String[]{ServerAccess.HEADLES_OPTION, OptionsDefinitions.OPTIONS.TRUSTALL.option, OptionsDefinitions.OPTIONS.NOHEADERS.option}); List trust = Arrays.asList(new String[]{ServerAccess.HEADLES_OPTION, OptionsDefinitions.OPTIONS.TRUSTALL.option}); RulesFolowingClosingListener.ContainsRule exceptionRule = new RulesFolowingClosingListener.ContainsRule(InvalidJarHeaderException.class.getName()); RulesFolowingClosingListener.ContainsRule okRule = new RulesFolowingClosingListener.ContainsRule("Image loaded"); RulesFolowingClosingListener.ContainsRule sucideRule = new RulesFolowingClosingListener.ContainsRule("gifar killing himself"); private ClosingListener getExceptionClosingListener() { return new RulesFolowingClosingListener(exceptionRule); } private ClosingListener getOkClosingListener() { return new RulesFolowingClosingListener(okRule, sucideRule); } File okJar = new File(server.getDir(), "GifarBase.jar"); File hackedJar = new File(server.getDir(), "Gifar.jar"); File okImage = new File(server.getDir(), "happyNonAnimated.gif"); File hackedImage = new File(server.getDir(), "Gifar.gif"); @Test public void unittest_verify_okJar() throws IOException { JNLPRuntime.setIgnoreHeaders(false); JarFile j1 = new JarFile(okJar); Assert.assertNotNull(j1); JNLPRuntime.setIgnoreHeaders(true); JarFile j2 = new JarFile(okJar); Assert.assertNotNull(j2); } @Test public void unittest_verify_badJar() throws IOException { JNLPRuntime.setIgnoreHeaders(false); Exception ex=null; JarFile j1=null; try{ j1 = new JarFile(hackedJar); }catch(InvalidJarHeaderException e){ ex=e; } Assert.assertNull(j1); Assert.assertNotNull(ex); Assert.assertEquals(InvalidJarHeaderException.class, ex.getClass()); JNLPRuntime.setIgnoreHeaders(true); JarFile j2 = new JarFile(hackedJar); Assert.assertNotNull(j2); } @Test public void unittest_verify_badImageAsJar() throws IOException { JNLPRuntime.setIgnoreHeaders(false); Exception ex=null; JarFile j1=null; try{ j1 = new JarFile(hackedImage); }catch(InvalidJarHeaderException e){ ex=e; } Assert.assertNull(j1); Assert.assertNotNull(ex); Assert.assertEquals(InvalidJarHeaderException.class, ex.getClass()); JNLPRuntime.setIgnoreHeaders(true); JarFile j2 = new JarFile(hackedImage); Assert.assertNotNull(j2); } @Test public void unittest_verify_okImage() throws IOException { JNLPRuntime.setIgnoreHeaders(false); BufferedImage j1 = ImageIO.read(okImage); Assert.assertNotNull(j1); JNLPRuntime.setIgnoreHeaders(true); BufferedImage j2 = ImageIO.read(okImage); Assert.assertNotNull(j2); } @Test public void unittest_verify_badImaqe() throws IOException { JNLPRuntime.setIgnoreHeaders(false); BufferedImage j1 = ImageIO.read(hackedImage); Assert.assertNotNull(j1); JNLPRuntime.setIgnoreHeaders(true); BufferedImage j2 = ImageIO.read(hackedImage); Assert.assertNotNull(j2); } @Test @NeedsDisplay public void GifarViaJnlp_application() throws Exception { ProcessResult pr = server.executeJavaws(trust, "gifar_application.jnlp"); Assert.assertEquals((Integer) 0, pr.returnValue); Assert.assertFalse("stdout " + okRule.toFailingString() + " but did", okRule.evaluate(pr.stdout)); Assert.assertTrue("stderr " + exceptionRule.toPassingString() + " but did'nt", exceptionRule.evaluate(pr.stderr)); } @Test @NeedsDisplay public void GifarViaJnlp_application_ignoreHeaders() throws Exception { ProcessResult pr = server.executeJavaws(trustIgnore, "gifar_application.jnlp"); Assert.assertEquals((Integer) 0, pr.returnValue); Assert.assertTrue("stdout " + okRule.toPassingString() + " but didn't", okRule.evaluate(pr.stdout)); Assert.assertFalse("stderr " + exceptionRule.toFailingString() + " but did", exceptionRule.evaluate(pr.stderr)); } @Test @NeedsDisplay public void GifarViaJnlp_applet() throws Exception { ProcessResult pr = server.executeJavaws(trust, "gifar_applet.jnlp"); Assert.assertEquals((Integer) 0, pr.returnValue); Assert.assertFalse("stdout " + okRule.toFailingString() + " but did", okRule.evaluate(pr.stdout)); Assert.assertTrue("stderr " + exceptionRule.toPassingString() + " but didn't", exceptionRule.evaluate(pr.stderr)); } @Test @NeedsDisplay public void GifarViaJnlp_applet_ignoreHeaders() throws Exception { ProcessResult pr = server.executeJavaws(trustIgnore, "gifar_applet.jnlp"); Assert.assertEquals((Integer) 0, pr.returnValue); Assert.assertTrue("stdout " + okRule.toPassingString() + " but didn't", okRule.evaluate(pr.stdout)); Assert.assertFalse("stderr " + exceptionRule.toFailingString() + " but did", exceptionRule.evaluate(pr.stderr)); } @Test @TestInBrowsers(testIn = {Browsers.all}) @NeedsDisplay public void GifarViaBrowser_hacked() throws Exception { ProcessResult pr = server.executeBrowser("gifarView_hacked.html", getOkClosingListener(), getExceptionClosingListener()); Assert.assertFalse("stdout " + okRule.toFailingString() + " but did", okRule.evaluate(pr.stdout)); Assert.assertTrue("stderr " + exceptionRule.toPassingString() + " but didn't", exceptionRule.evaluate(pr.stderr)); } @Test @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay public void GifarViaBrowser_ok() throws Exception { ProcessResult pr = server.executeBrowser("gifarView_ok.html", getOkClosingListener(), getExceptionClosingListener()); Assert.assertTrue("stdout " + okRule.toPassingString() + " but didn't", okRule.evaluate(pr.stdout)); Assert.assertFalse("stderr " + exceptionRule.toFailingString() + " but did", exceptionRule.evaluate(pr.stderr)); } } icedtea-web-1.6.2/tests/reproducers/signed/GifarBase/PaxHeaders.17941/srcs0000644000000000000000000000013112654402377023134 xustar0030 mtime=1454507263.255432341 30 atime=1454507658.777157383 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/GifarBase/srcs/0000755000175000002070000000000012654402377023735 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/GifarBase/srcs/PaxHeaders.17941/GifarMain.java0000644000000000000000000000013112654402377025711 xustar0030 mtime=1454507263.255432341 30 atime=1454507327.256578776 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/GifarBase/srcs/GifarMain.java0000644000175000002070000001547512654402377026451 0ustar00jvanekmock00000000000000 import java.awt.BorderLayout; import java.awt.image.BufferedImage; import java.net.URL; import javax.imageio.ImageIO; import javax.jnlp.BasicService; import javax.jnlp.ServiceManager; import javax.swing.Icon; import javax.swing.ImageIcon; import javax.swing.JApplet; import javax.swing.JFrame; import javax.swing.JLabel; /* AppletTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class GifarMain extends JApplet { boolean isApplet = true; String defaultPath = "happyNonAnimated.gif"; String imageName; URL path = null; private class Killer extends Thread { public int n = 3000; @Override public void run() { try { Thread.sleep(n); System.out.println("gifar killing himself after " + n + " ms of life"); System.exit(0); } catch (Exception ex) { } } } private Killer killer; @Override public void init() { System.out.println("gifar was initialised"); killer = new Killer(); this.setLayout(new BorderLayout()); String futurePath = null; if (isApplet) { futurePath = getParameter("image"); if ("yes".equals(futurePath)) { imageName = defaultPath; } else if (futurePath != null) { imageName = futurePath; } } } @Override public void start() { System.out.println("gifar is starting"); String s = "" + System.getProperty("java.vm.version") + "
" + System.getProperty("java.vm.vendor") + "
" + System.getProperty("java.vm.name") + "
" + System.getProperty("java.specification.version") + "
" + System.getProperty("java.specification.vendor") + "
" + System.getProperty("java.specification.name") + ""; JLabel jLabel1 = new JLabel(s); this.add(jLabel1, BorderLayout.NORTH); System.out.println("Used image: " + imageName); if (imageName != null) { try { path = new URL(getIndependentCodebase(), imageName); System.out.println("Loading: "+path.toString()); JLabel jLabel2 = new JLabel(loadIcon(path)); System.out.println("Image loaded"); this.add(jLabel2, BorderLayout.SOUTH); } catch (Exception ex) { //ex.printStackTrace(); throw new RuntimeException(ex); } } killer.start(); System.out.println("is applet: " + isApplet); System.out.println("gifar was started"); } Icon loadIcon(URL u) { try { BufferedImage i = ImageIO.read(u.openStream()); return new ImageIcon(i); } catch (Exception ex) { throw new RuntimeException(ex); } } public URL getIndependentCodebase() { try { URL u1 = getCodeBaseApplet(); URL u2 = getCodeBaseJavaws(); if (u1 != null) { return u1; } if (u2 != null) { return u2; } return new URL("http://localhost:44321/"); } catch (Exception ex) { throw new RuntimeException(ex); } } public URL getCodeBaseApplet() { try { URL codebase = getCodeBase(); if (codebase != null) { System.out.println("applet codebase: " + codebase.toString()); return codebase; } else { System.out.println("applet codebase: null"); } } catch (Exception ex) { ex.printStackTrace(); System.out.println("applet codebase: null"); } return null; } public URL getCodeBaseJavaws() { try { BasicService bs = (BasicService) ServiceManager.lookup("javax.jnlp.BasicService"); URL codebase = bs.getCodeBase(); if (codebase != null) { System.out.println("javaws codebase: " + codebase.toString()); return codebase; } else { System.out.println("javaws codebase: null"); } } catch (Exception ex) { ex.printStackTrace(); System.out.println("javaws codebase: null"); } return null; } @Override public void stop() { System.out.println("gifar was stopped"); } @Override public void destroy() { System.out.println("gifar will be destroyed"); } public static void main(String[] args){ final JFrame f = new JFrame(); f.setLayout(new BorderLayout()); f.setSize(250, 200); GifarMain gm = new GifarMain(); gm.isApplet = false; f.add(gm); gm.init(); if (args.length > 0) { if ("yes".equals(args[0])) { gm.imageName = gm.defaultPath; } else { gm.imageName = args[0]; } } gm.start(); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); java.awt.EventQueue.invokeLater(new Runnable() { public void run() { f.setVisible(true); } }); } } icedtea-web-1.6.2/tests/reproducers/signed/GifarBase/PaxHeaders.17941/resources0000644000000000000000000000013112654402377024174 xustar0030 mtime=1454507263.255432341 30 atime=1454507658.777157383 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/GifarBase/resources/0000755000175000002070000000000012654402377024775 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/GifarBase/resources/PaxHeaders.17941/happyNonAnimated.gif0000644000000000000000000000013112654402377030177 xustar0030 mtime=1454507263.255432341 30 atime=1454507327.256578776 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/GifarBase/resources/happyNonAnimated.gif0000644000175000002070000001542712654402377030734 0ustar00jvanekmock00000000000000GIF89addR1P6N9L=O>KBIE_?KGGJDMWHMMFP?UFSeKTQ]O?XGVGX@[SVA];#9`bUA`9ctRO^C(AcHa9fpXW`9iAgJ.P9D%~Wn\BiLfSd9l_aP2U@9oFmz]f|jcyQ/Ys8r|Ol{5uyZj|]AM(AsxZ8`xNpxsh]_lr6xvcUtgsMtsco3|se_fOjo[R%eonEym@zrZtbkP3ozjobh}lW/ld:cTX-d\cvXMѣJ=JʨKPקDAKDٯF?̸M׵KCFIFS.!Created with GIMP! ,ddT`A#X!aHla∋!BtQ BZ0a l0$@@7  0O@ QY4B Bb5vQ$ɒ(Ud S̙5qIϟA=T҃  U'ȸ"G~ +KgԹ-\Cέk%yFՋr5W,{Mk| йpsӧPFxU0᭭]-4!x`˙^xq E+_s:Aʱ BF`E [Q1qL_S1gQVq}WY%@Bvd]qi\נSg Vax- vb v9p(&x,&ey98ZiUYejϭH!L)iH@m\P`w#ij(]< mE"]fr@@JxF)%AQĩz~eY#u,m`fW@pG-Ad[rB$Wۧhg_,S8AĵŶCt;D 5PDjG̷Xl < DwaG$FG-nr.&5Gl1C 3<[tqLXm;KnE[X%\BkJq]=aw8E4CHt 1pGD~jL]@e޲A dGx X`B7+ m:2v!];@ 6:p3VY4X !DU,G1$@8JM(B.2 X%w>f6g(+ PlO{iv/&b*٘TwHĖh!T*o ^H,P MApr!DH9Bu.6p BP/LLcc>'5mD Y]SbB೟ D` PH^dKuK&IPb zTLJG"zS6@YUgP-,@ Dp©NDFk@R+  [>P d8CD"V fHBzΩ4Q|0&"7(I\odK8>.K(U =H9 :p# | E%R[HB``"VZ5!{fMVO|:qYqkl@D ]4c7cbU@/ |ηZF0&_GD3* }G)>pVD[>ͼ=OwJ@HVrJ \H"9Pb7a%*Ʈ{P/ hf57P2AgI4 ;P.F\Z "h n +|4&-0*@`0 |NkAbP'DCjUHymʰ` Guw{qA oLA3|?-anNHЄLxDİBᝦc&lp/M%@n h$<}[$73A }nQ@6BoX \,]]p,衽KXBa~=M 6pa@"-Pa =6 np+XDWL,$ mLcL厘q0? qȃ]ohCN{\%3PM"N'#%m_wkzbl"؄̹G<|{nZ  ")P߮*.nJi|_ Q<&$@ىyK-< AGdB{`ϡhķY0/E9Q ysF:qCP10|/m;WEm0v(wj3}}~^P %{0 gKqW16 0 V0* ¦$Hm (t@sH 7n^ h~ "8b5e Ӏ /1p1yŔɷ y6x 9d 3 j0KuK]=`nqg %kІ6o 'ECIKu0aU@pg~TSZU(`prPan p4HYdwE~u0*`X `KUW38Q! 5jĉc˸ $OPz8tL_P_Pz 6 d`Dž%w/Pcx(؆ tҸ}L};'w d QIk:bI8p }?v'tXp@fE_ R.zf#%F#* =?0G$ɄX {Дk3YPn0 P\Zya-Wu`=醬 0kF}p0 z yuyVu" fdf_'Te(cg|jƹ}P 0tai_ 9G` `d𝺐 𚯹-EP= R;tɛ @{s0  sЀx07ttP OX%ƕ` p  e. &' | p  (}s0 Р 1J .TZ i=ɘن.r2JPj2G?3hp|9GӠ ` !P/@Je`]Z_ ٘mxv. Щ S7y0G:GuU" :J: P=0_/|:J9st ԙ Pw jZʨP0-*xʺک 3 D H%`` ߀*Z`.Юjʬzy| C)6 c`0 ZzZ :9 K ȱe2ϚG@ @ \K ʠ [p9h]=ڬGA0 K^` ` 0;[` PrBe[;Bk Zڦx Ӏ])6 h5 @0 ` 0 `Ð nﺱd+fЂ 0 0 ; k~-x0+g m ɊEkʹ:P Q`Cp*fydW!о? Kjڬ ۿp{VIJ (]-5gX%@ >;Z[ пp qcƒ:44 z=LK<|GK̿P|^c@ ̠ۻ`f[N>,Kf|lJlpP#l ;ȀWȹ0<[?kȊF\ Psptg 1̀ٶ8V ,ƞ, pƣlZ ֐\` pZ @˷jЪJ!˿\5 p PҗL}}=؄- f05S `mδ p P;Ŭ֬ +iJ: `J]۴ b` p € p ͳg ذ hl̦:}ڪml5밲M0 &M @ ` L ߀ \F| @ݲ=m, Ԡ p m P @ k E k஀˰^^޶Dѐ0- p }@ հ h{-ζG 3n:9 Ap G ?,Ѳ ې ۀ RNTF H3۰}޶Bn qN_j V ްP@ P؅.덾} l ,J LzNm  ̧~ ۰~؎аIW뺞 ٜ,k{Nlk05`ωP0ӞuPWB Pz|ީ p G Sc :-0 ~  5*Va ǰ cl p ׀ ]<ݤ,۠ լD'~ ݐh` @ Ro| 0` P € z ^ ,饧mҐ ְP p +ɝ< 0^7.GDB?qMYĕ p ~`i^^ p Ϡ & 'n P <Ϩo ,؏M GifarView IcedTea Gifar issue Gifar.jar icedtea-web-1.6.2/tests/reproducers/signed/GifarBase/resources/PaxHeaders.17941/gifar_applet.jnlp0000644000000000000000000000013012654402377027572 xustar0030 mtime=1454507263.254432354 29 atime=1454507327.25557879 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/GifarBase/resources/gifar_applet.jnlp0000644000175000002070000000447012654402377030324 0ustar00jvanekmock00000000000000 GifarView IcedTea Gifar issue icedtea-web-1.6.2/tests/reproducers/signed/GifarBase/resources/PaxHeaders.17941/gifarView_ok.html0000644000000000000000000000013012654402377027552 xustar0030 mtime=1454507263.254432354 29 atime=1454507327.25557879 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/GifarBase/resources/gifarView_ok.html0000644000175000002070000000376212654402377030307 0ustar00jvanekmock00000000000000

There should be gif image There should be gif image There should be gif image

icedtea-web-1.6.2/tests/reproducers/signed/GifarBase/resources/PaxHeaders.17941/gifarView_hacked.htm0000644000000000000000000000013012654402377030204 xustar0030 mtime=1454507263.254432354 29 atime=1454507327.25557879 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/GifarBase/resources/gifarView_hacked.html0000644000175000002070000000375612654402377031120 0ustar00jvanekmock00000000000000

There should be gif image There should be gif image There should be gif image

icedtea-web-1.6.2/tests/reproducers/signed/PaxHeaders.17941/ExtensionJnlp0000644000000000000000000000013112654402377023137 xustar0030 mtime=1454507263.253432368 30 atime=1454507658.777157383 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/ExtensionJnlp/0000755000175000002070000000000012654402377023740 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/ExtensionJnlp/PaxHeaders.17941/testcases0000644000000000000000000000013112654402377025135 xustar0030 mtime=1454507263.253432368 30 atime=1454507658.777157383 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/ExtensionJnlp/testcases/0000755000175000002070000000000012654402377025736 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/ExtensionJnlp/testcases/PaxHeaders.17941/ExtensionJnlpTes0000644000000000000000000000013012654402377030410 xustar0030 mtime=1454507263.253432368 29 atime=1454507327.25557879 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/ExtensionJnlp/testcases/ExtensionJnlpTest.java0000644000175000002070000000757012654402377032252 0ustar00jvanekmock00000000000000/* ExtensionJnlpTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.util.Arrays; import java.util.Collections; import java.util.List; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.annotations.Bug; import org.junit.Assert; import org.junit.Test; public class ExtensionJnlpTest { private static ServerAccess server = new ServerAccess(); private final List l = Collections.unmodifiableList(Arrays.asList(new String[] { "-Xtrustall" })); private final String jarOutput = "Running SignedJarResource.."; private final String signedJnlpException = "net.sourceforge.jnlp.LaunchException: Fatal: Application Error: " + "The signed JNLP file did not match the launching JNLP file. Missing Resource: Signed Application " + "did not match launching JNLP File"; @Test public void checkingForRequiredResources() throws Exception { ProcessResult pr = server.executeJavawsHeadless(l, "/UsesSignedJar.jnlp"); Assert.assertTrue("Could not locate SignedJarResource class within SignedJarResource jar", pr.stdout.contains(jarOutput)); String s = "Running SignedJnlpResource.."; pr = server.executeJavawsHeadless(l, "/UsesSignedJnlp.jnlp"); Assert.assertTrue("Could not locate SignedJnlpResource class within SignedJnlpResource jar", pr.stdout.contains(s)); } @Bug(id = "PR1040") @Test public void usingSignedExtension() throws Exception { ProcessResult pr = server.executeJavawsHeadless(l, "/UsesSignedJarExtension.jnlp"); Assert.assertTrue("Stdout should contain " + jarOutput + " but did not", pr.stdout.contains(jarOutput)); } @Bug(id = "PR1041") @Test public void mainJarInExtension() throws Exception { ProcessResult pr = server.executeJavawsHeadless(l, "/UsesSignedJnlpJarAndSignedJarExtension.jnlp"); Assert.assertTrue("Stdout should contain " + jarOutput + " but did not", pr.stdout.contains(jarOutput)); } @Bug(id = "PR1042") @Test public void checkingSignedJnlpInExtension() throws Exception { ProcessResult pr = server.executeJavawsHeadless(l, "/UsesSignedJnlpExtension.jnlp"); Assert.assertTrue("Stdout should contain " + signedJnlpException + " but did not", pr.stderr.contains(signedJnlpException)); } } icedtea-web-1.6.2/tests/reproducers/signed/ExtensionJnlp/PaxHeaders.17941/resources0000644000000000000000000000013112654402377025151 xustar0030 mtime=1454507263.253432368 30 atime=1454507658.777157383 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/ExtensionJnlp/resources/0000755000175000002070000000000012654402377025752 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/ExtensionJnlp/resources/PaxHeaders.17941/UsesSignedJnlpJa0000644000000000000000000000032012654402377030321 xustar00120 path=icedtea-web-1.6.2/tests/reproducers/signed/ExtensionJnlp/resources/UsesSignedJnlpJarAndSignedJarExtension.jnlp 30 mtime=1454507263.253432368 29 atime=1454507327.25557879 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/ExtensionJnlp/resources/UsesSignedJnlpJarAndSignedJarExte0000644000175000002070000000505512654402377034274 0ustar00jvanekmock00000000000000 UsesSignedJnlpJarAndSignedJarExtension IcedTea UsesSignedJnlpJarAndSignedJarExtension icedtea-web-1.6.2/tests/reproducers/signed/ExtensionJnlp/resources/PaxHeaders.17941/UsesSignedJnlpEx0000644000000000000000000000013012654402377030342 xustar0030 mtime=1454507263.253432368 29 atime=1454507327.25557879 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/ExtensionJnlp/resources/UsesSignedJnlpExtension.jnlp0000644000175000002070000000471112654402377033434 0ustar00jvanekmock00000000000000 UsesSignedJnlpExtension IcedTea UsesSignedJnlpExtension icedtea-web-1.6.2/tests/reproducers/signed/ExtensionJnlp/resources/PaxHeaders.17941/UsesSignedJnlp.j0000644000000000000000000000013112654402377030276 xustar0030 mtime=1454507263.253432368 30 atime=1454507327.254578803 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/ExtensionJnlp/resources/UsesSignedJnlp.jnlp0000644000175000002070000000465012654402377031541 0ustar00jvanekmock00000000000000 UsesSignedJnlp IcedTea UsesSignedJnlp icedtea-web-1.6.2/tests/reproducers/signed/ExtensionJnlp/resources/PaxHeaders.17941/UsesSignedJarExt0000644000000000000000000000013112654402377030340 xustar0030 mtime=1454507263.252432381 30 atime=1454507327.254578803 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/ExtensionJnlp/resources/UsesSignedJarExtension.jnlp0000644000175000002070000000464212654402377033250 0ustar00jvanekmock00000000000000 UseSignedJarExtension IcedTea UseSignedJarExtension icedtea-web-1.6.2/tests/reproducers/signed/ExtensionJnlp/resources/PaxHeaders.17941/UsesSignedJar.jn0000644000000000000000000000013112654402377030265 xustar0030 mtime=1454507263.252432381 30 atime=1454507327.254578803 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/ExtensionJnlp/resources/UsesSignedJar.jnlp0000644000175000002070000000466612654402377031361 0ustar00jvanekmock00000000000000 UsesSignedJar IcedTea UsesSignedJar icedtea-web-1.6.2/tests/reproducers/signed/PaxHeaders.17941/EntryPointSignedSingleSecondInvalidFirst0000644000000000000000000000013112654402377030421 xustar0030 mtime=1454507263.252432381 30 atime=1454507658.777157383 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleSecondInvalidFirstOk/0000755000175000002070000000000012654402377031514 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleSecondInvalidFirstOk/PaxHeaders.1790000644000000000000000000000013112654402377030546 xustar0030 mtime=1454507263.252432381 30 atime=1454507658.777157383 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleSecondInvalidFirstOk/testcases/0000755000175000002070000000000012654402377033512 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleSecondInvalidFirstOk/testcases/PaxH0000644000000000000000000000036612654402377031053 xustar00157 path=icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleSecondInvalidFirstOk/testcases/EntryPointSignedSingleSecondInvalidFirstOkTest.java 30 mtime=1454507263.252432381 30 atime=1454507327.254578803 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleSecondInvalidFirstOk/testcases/Entr0000644000175000002070000001377312654402377034360 0ustar00jvanekmock00000000000000 import java.io.IOException; import java.util.Arrays; import net.sourceforge.jnlp.OptionsDefinitions; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import static net.sourceforge.jnlp.browsertesting.BrowserTest.server; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.AutoErrorClosingListener; import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; import net.sourceforge.jnlp.closinglisteners.StringBasedClosingListener; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.ManifestAttributesChecker; import net.sourceforge.jnlp.tools.DeploymentPropertiesModifier; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; /* AppletTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class EntryPointSignedSingleSecondInvalidFirstOkTest extends BrowserTest { private static final DeploymentPropertiesModifier dpm = new DeploymentPropertiesModifier(); private static final StringBasedClosingListener aok = new AutoOkClosingListener(); private static final StringBasedClosingListener aer = new AutoErrorClosingListener(); private static final String confirmation = "*** applet running ***"; @BeforeClass public static void setDeploymentManifestPermissionReadingOnly() throws IOException { dpm.setProperties(DeploymentConfiguration.KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK, ManifestAttributesChecker.MANIFEST_ATTRIBUTES_CHECK.ENTRYPOINT.toString()); } @AfterClass public static void restoreDeploymentProeprtiees() throws IOException { dpm.restoreProperties(); } @Test public void javawsAllPermNoSecurity() throws Exception { ProcessResult p = server.executeJavawsHeadless("EntryPointSignedSingleSecondInvalidFirstOk.jnlp"); Assert.assertTrue(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } @Test public void javawsAllPermAllSecurity() throws Exception { ProcessResult p = server.executeJavawsHeadless("EntryPointSignedSingleSecondInvalidFirstOk_security.jnlp"); Assert.assertTrue(p.stdout.contains(confirmation)); Assert.assertTrue(p.stdout.contains(aok.getCondition())); Assert.assertFalse(p.stderr.contains(aer.getCondition())); } @Test public void javawsAppletAllPermNoSecurity() throws Exception { ProcessResult p = server.executeJavaws(Arrays.asList(new String[]{"-headless", "-verbose"}), "EntryPointSignedSingleSecondInvalidFirstOk_applet.jnlp", new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } @Test public void javawsAppletAllPermAllSecurity() throws Exception { ProcessResult p = server.executeJavawsHeadless("EntryPointSignedSingleSecondInvalidFirstOk_applet_security.jnlp", new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(p.stdout.contains(confirmation)); Assert.assertTrue(p.stdout.contains(aok.getCondition())); Assert.assertFalse(p.stderr.contains(aer.getCondition())); } @Test @TestInBrowsers(testIn = Browsers.one) public void appletAllPermAllSecurity() throws Exception { server.getBrowserLocation(); ProcessResult p = server.executeBrowser("EntryPointSignedSingleSecondInvalidFirstOk.html", ServerAccess.AutoClose.CLOSE_ON_BOTH); Assert.assertTrue(p.stdout.contains(confirmation)); Assert.assertTrue(p.stdout.contains(aok.getCondition())); Assert.assertFalse(p.stderr.contains(aer.getCondition())); } @Test public void javawsHtml() throws Exception { ProcessResult p = server.executeJavaws(Arrays.asList(new String[]{OptionsDefinitions.OPTIONS.HTML.option}), "EntryPointSignedSingleSecondInvalidFirstOk.html", new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(p.stdout.contains(confirmation)); Assert.assertTrue(p.stdout.contains(aok.getCondition())); Assert.assertFalse(p.stderr.contains(aer.getCondition())); } } icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleSecondInvalidFirstOk/PaxHeaders.1790000644000000000000000000000013112654402377030546 xustar0030 mtime=1454507263.252432381 30 atime=1454507658.777157383 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleSecondInvalidFirstOk/srcs/0000755000175000002070000000000012654402377032466 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleSecondInvalidFirstOk/srcs/PaxHeader0000644000000000000000000000013112654402377031016 xustar0030 mtime=1454507263.252432381 30 atime=1454507658.777157383 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleSecondInvalidFirstOk/srcs/META-INF/0000755000175000002070000000000012654402377033626 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleSecondInvalidFirstOk/srcs/META-INF/0000644000000000000000000000032212654402377030376 xustar00121 path=icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleSecondInvalidFirstOk/srcs/META-INF/MANIFEST.MF 30 mtime=1454507263.252432381 30 atime=1454507327.254578803 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleSecondInvalidFirstOk/srcs/META-INF/0000644000175000002070000000014612654402377033631 0ustar00jvanekmock00000000000000Manifest-Version: 1.0 Entry-Point: EntryPointSignedSingleSecondInvalidFirstOk SomeDifferentMainClass icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleSecondInvalidFirstOk/srcs/PaxHeader0000644000000000000000000000035512654402377031026 xustar00148 path=icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleSecondInvalidFirstOk/srcs/EntryPointSignedSingleSecondInvalidFirstOk.java 30 mtime=1454507263.251432394 30 atime=1454507327.254578803 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleSecondInvalidFirstOk/srcs/EntryPoin0000644000175000002070000000410712654402377034342 0ustar00jvanekmock00000000000000 import java.applet.Applet; /* AppletTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class EntryPointSignedSingleSecondInvalidFirstOk extends Applet { @Override public void init() { confirm(); } public static void main(String... s) { confirm(); } private static void confirm() { System.out.println("*** applet running ***"); System.out.println(System.getProperty("user.home")); System.out.println("*** APPLET FINISHED ***"); } } icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleSecondInvalidFirstOk/PaxHeaders.1790000644000000000000000000000013112654402377030546 xustar0030 mtime=1454507263.251432394 30 atime=1454507658.777157383 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleSecondInvalidFirstOk/resources/0000755000175000002070000000000012654402377033526 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleSecondInvalidFirstOk/resources/PaxH0000644000000000000000000000037312654402377031065 xustar00162 path=icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleSecondInvalidFirstOk/resources/EntryPointSignedSingleSecondInvalidFirstOk_security.jnlp 30 mtime=1454507263.251432394 30 atime=1454507327.253578816 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleSecondInvalidFirstOk/resources/Entr0000644000175000002070000000453012654402377034363 0ustar00jvanekmock00000000000000 EntryPointSignedSingleSecondInvalidFirstOk IcedTea EntryPointSignedSingleSecondInvalidFirstOk icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleSecondInvalidFirstOk/resources/PaxH0000644000000000000000000000040212654402377031056 xustar00169 path=icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleSecondInvalidFirstOk/resources/EntryPointSignedSingleSecondInvalidFirstOk_applet_security.jnlp 30 mtime=1454507263.251432394 30 atime=1454507327.253578816 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleSecondInvalidFirstOk/resources/Entr0000644000175000002070000000474112654402377034367 0ustar00jvanekmock00000000000000 EntryPointSignedSingleSecondInvalidFirstOk IcedTea EntryPointSignedSingleSecondInvalidFirstOk icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleSecondInvalidFirstOk/resources/PaxH0000644000000000000000000000037112654402377031063 xustar00160 path=icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleSecondInvalidFirstOk/resources/EntryPointSignedSingleSecondInvalidFirstOk_applet.jnlp 30 mtime=1454507263.251432394 30 atime=1454507327.253578816 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleSecondInvalidFirstOk/resources/Entr0000644000175000002070000000462312654402377034366 0ustar00jvanekmock00000000000000 EntryPointSignedSingleSecondInvalidFirstOk IcedTea EntryPointSignedSingleSecondInvalidFirstOk icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleSecondInvalidFirstOk/resources/PaxH0000644000000000000000000000036212654402377031063 xustar00153 path=icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleSecondInvalidFirstOk/resources/EntryPointSignedSingleSecondInvalidFirstOk.jnlp 30 mtime=1454507263.250432408 30 atime=1454507327.253578816 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleSecondInvalidFirstOk/resources/Entr0000644000175000002070000000443212654402377034364 0ustar00jvanekmock00000000000000 EntryPointSignedSingleSecondInvalidFirstOk IcedTea EntryPointSignedSingleSecondInvalidFirstOk icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleSecondInvalidFirstOk/resources/PaxH0000644000000000000000000000036212654402377031063 xustar00153 path=icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleSecondInvalidFirstOk/resources/EntryPointSignedSingleSecondInvalidFirstOk.html 30 mtime=1454507263.250432408 30 atime=1454507327.253578816 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleSecondInvalidFirstOk/resources/Entr0000644000175000002070000000352012654402377034361 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/signed/PaxHeaders.17941/EntryPointSignedSingleOk0000644000000000000000000000013112654402377025240 xustar0030 mtime=1454507263.250432408 30 atime=1454507658.777157383 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleOk/0000755000175000002070000000000012654402377026041 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleOk/PaxHeaders.17941/testcases0000644000000000000000000000013112654402377027236 xustar0030 mtime=1454507263.250432408 30 atime=1454507658.777157383 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleOk/testcases/0000755000175000002070000000000012654402377030037 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleOk/testcases/PaxHeaders.17941/Entry0000644000000000000000000000032212654402377030341 xustar00121 path=icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleOk/testcases/EntryPointSignedSingleOkTest.java 30 mtime=1454507263.250432408 30 atime=1454507327.253578816 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleOk/testcases/EntryPointSignedSingle0000644000175000002070000001403012654402377034367 0ustar00jvanekmock00000000000000 import java.io.IOException; import java.util.Arrays; import net.sourceforge.jnlp.OptionsDefinitions; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import static net.sourceforge.jnlp.browsertesting.BrowserTest.server; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.AutoErrorClosingListener; import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; import net.sourceforge.jnlp.closinglisteners.StringBasedClosingListener; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.ManifestAttributesChecker; import net.sourceforge.jnlp.tools.DeploymentPropertiesModifier; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; /* AppletTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class EntryPointSignedSingleOkTest extends BrowserTest { private static final DeploymentPropertiesModifier dpm = new DeploymentPropertiesModifier(); private static final StringBasedClosingListener aok = new AutoOkClosingListener(); private static final StringBasedClosingListener aer = new AutoErrorClosingListener(); private static final String confirmation = "*** applet running ***"; @BeforeClass public static void setDeploymentManifestPermissionReadingOnly() throws IOException{ dpm.setProperties(DeploymentConfiguration.KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK, ManifestAttributesChecker.MANIFEST_ATTRIBUTES_CHECK.ENTRYPOINT.toString()); } @AfterClass public static void restoreDeploymentProeprtiees() throws IOException{ dpm.restoreProperties(); } @Test public void javawsAllPermNoSecurity() throws Exception{ ProcessResult p = server.executeJavawsHeadless("EntryPointSignedSingleOk.jnlp"); Assert.assertTrue(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } @Test public void javawsAllPermAllSecurity() throws Exception{ ProcessResult p = server.executeJavawsHeadless("EntryPointSignedSingleOk_security.jnlp"); Assert.assertTrue(p.stdout.contains(confirmation)); Assert.assertTrue(p.stdout.contains(aok.getCondition())); Assert.assertFalse(p.stderr.contains(aer.getCondition())); } @Test public void javawsAppletAllPermNoSecurity() throws Exception{ ProcessResult p = server.executeJavaws(Arrays.asList(new String[]{"-headless", "-verbose"}), "EntryPointSignedSingleOk_applet.jnlp", new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } @Test public void javawsAppletAllPermAllSecurity() throws Exception{ ProcessResult p = server.executeJavawsHeadless("EntryPointSignedSingleOk_applet_security.jnlp", new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(p.stdout.contains(confirmation)); Assert.assertTrue(p.stdout.contains(aok.getCondition())); Assert.assertFalse(p.stderr.contains(aer.getCondition())); } @Test @TestInBrowsers(testIn = Browsers.one) public void appletAllPermAllSecurity() throws Exception{ server.getBrowserLocation(); ProcessResult p = server.executeBrowser("EntryPointSignedSingleOk.html", ServerAccess.AutoClose.CLOSE_ON_BOTH); Assert.assertTrue(p.stdout.contains(confirmation)); Assert.assertTrue(p.stdout.contains(aok.getCondition())); Assert.assertFalse(p.stderr.contains(aer.getCondition())); } @Test public void javawsHtml() throws Exception { ProcessResult p = server.executeJavaws(Arrays.asList(new String[]{OptionsDefinitions.OPTIONS.HTML.option}), "EntryPointSignedSingleOk.html", new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(p.stdout.contains(confirmation)); Assert.assertTrue(p.stdout.contains(aok.getCondition())); Assert.assertFalse(p.stderr.contains(aer.getCondition())); } } icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleOk/PaxHeaders.17941/srcs0000644000000000000000000000013112654402377026212 xustar0030 mtime=1454507263.249432421 30 atime=1454507658.777157383 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleOk/srcs/0000755000175000002070000000000012654402377027013 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleOk/srcs/PaxHeaders.17941/META-INF0000644000000000000000000000013112654402377027352 xustar0030 mtime=1454507263.249432421 30 atime=1454507658.777157383 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleOk/srcs/META-INF/0000755000175000002070000000000012654402377030153 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleOk/srcs/META-INF/PaxHeaders.17941/M0000644000000000000000000000013012654402377027545 xustar0030 mtime=1454507263.249432421 29 atime=1454507327.25257883 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleOk/srcs/META-INF/MANIFEST.MF0000644000175000002070000000007512654402377031607 0ustar00jvanekmock00000000000000Manifest-Version: 1.0 Entry-Point: EntryPointSignedSingleOk icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleOk/srcs/PaxHeaders.17941/EntryPoint0000644000000000000000000000031012654402377030324 xustar00112 path=icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleOk/srcs/EntryPointSignedSingleOk.java 30 mtime=1454507263.249432421 29 atime=1454507327.25257883 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleOk/srcs/EntryPointSignedSingleOk.ja0000644000175000002070000000406512654402377034235 0ustar00jvanekmock00000000000000 import java.applet.Applet; /* AppletTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class EntryPointSignedSingleOk extends Applet { @Override public void init() { confirm(); } public static void main(String... s) { confirm(); } private static void confirm() { System.out.println("*** applet running ***"); System.out.println(System.getProperty("user.home")); System.out.println("*** APPLET FINISHED ***"); } } icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleOk/PaxHeaders.17941/resources0000644000000000000000000000013112654402377027252 xustar0030 mtime=1454507263.249432421 30 atime=1454507658.777157383 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleOk/resources/0000755000175000002070000000000012654402377030053 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleOk/resources/PaxHeaders.17941/Entry0000644000000000000000000000032612654402377030361 xustar00126 path=icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleOk/resources/EntryPointSignedSingleOk_security.jnlp 30 mtime=1454507263.249432421 29 atime=1454507327.25257883 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleOk/resources/EntryPointSignedSingle0000644000175000002070000000437612654402377034417 0ustar00jvanekmock00000000000000 EntryPointSignedSingleOk IcedTea EntryPointSignedSingleOk icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleOk/resources/PaxHeaders.17941/Entry0000644000000000000000000000033512654402377030361 xustar00133 path=icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleOk/resources/EntryPointSignedSingleOk_applet_security.jnlp 30 mtime=1454507263.249432421 29 atime=1454507327.25257883 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleOk/resources/EntryPointSignedSingle0000644000175000002070000000456512654402377034417 0ustar00jvanekmock00000000000000 EntryPointSignedSingleOk IcedTea EntryPointSignedSingleOk icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleOk/resources/PaxHeaders.17941/Entry0000644000000000000000000000032412654402377030357 xustar00124 path=icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleOk/resources/EntryPointSignedSingleOk_applet.jnlp 30 mtime=1454507263.248432434 29 atime=1454507327.25257883 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleOk/resources/EntryPointSignedSingle0000644000175000002070000000444712654402377034416 0ustar00jvanekmock00000000000000 EntryPointSignedSingleOk IcedTea EntryPointSignedSingleOk icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleOk/resources/PaxHeaders.17941/Entry0000644000000000000000000000031512654402377030357 xustar00117 path=icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleOk/resources/EntryPointSignedSingleOk.jnlp 30 mtime=1454507263.248432434 29 atime=1454507327.25257883 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleOk/resources/EntryPointSignedSingle0000644000175000002070000000430012654402377034402 0ustar00jvanekmock00000000000000 EntryPointSignedSingleOk IcedTea EntryPointSignedSingleOk icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleOk/resources/PaxHeaders.17941/Entry0000644000000000000000000000031612654402377030360 xustar00117 path=icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleOk/resources/EntryPointSignedSingleOk.html 30 mtime=1454507263.248432434 30 atime=1454507327.251578843 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleOk/resources/EntryPointSignedSingle0000644000175000002070000000345412654402377034413 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/signed/PaxHeaders.17941/EntryPointSignedSingleInvalid0000644000000000000000000000013112654402377026255 xustar0030 mtime=1454507263.248432434 30 atime=1454507658.777157383 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleInvalid/0000755000175000002070000000000012654402377027056 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleInvalid/PaxHeaders.17941/testcases0000644000000000000000000000013112654402377030253 xustar0030 mtime=1454507263.248432434 30 atime=1454507658.777157383 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleInvalid/testcases/0000755000175000002070000000000012654402377031054 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleInvalid/testcases/PaxHeaders.17941/0000644000000000000000000000033412654402377030337 xustar00131 path=icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleInvalid/testcases/EntryPointSignedSingleInvalidTest.java 30 mtime=1454507263.248432434 30 atime=1454507327.251578843 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleInvalid/testcases/EntryPointSignedS0000644000175000002070000001364612654402377034401 0ustar00jvanekmock00000000000000 import java.io.IOException; import java.util.Arrays; import net.sourceforge.jnlp.OptionsDefinitions; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import static net.sourceforge.jnlp.browsertesting.BrowserTest.server; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.AutoErrorClosingListener; import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; import net.sourceforge.jnlp.closinglisteners.StringBasedClosingListener; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.ManifestAttributesChecker; import net.sourceforge.jnlp.tools.DeploymentPropertiesModifier; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; /* AppletTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class EntryPointSignedSingleInvalidTest extends BrowserTest { private static final DeploymentPropertiesModifier dpm = new DeploymentPropertiesModifier(); private static final StringBasedClosingListener aok = new AutoOkClosingListener(); private static final StringBasedClosingListener aer = new AutoErrorClosingListener(); private static final String confirmation = "*** applet running ***"; @BeforeClass public static void setDeploymentManifestPermissionReadingOnly() throws IOException { dpm.setProperties(DeploymentConfiguration.KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK, ManifestAttributesChecker.MANIFEST_ATTRIBUTES_CHECK.ENTRYPOINT.toString()); } @AfterClass public static void restoreDeploymentProeprtiees() throws IOException { dpm.restoreProperties(); } @Test public void javawsAllPermNoSecurity() throws Exception { ProcessResult p = server.executeJavawsHeadless("EntryPointSignedSingleInvalid.jnlp"); Assert.assertFalse(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } @Test public void javawsAllPermAllSecurity() throws Exception { ProcessResult p = server.executeJavawsHeadless("EntryPointSignedSingleInvalid_security.jnlp"); Assert.assertFalse(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } @Test public void javawsAppletAllPermNoSecurity() throws Exception { ProcessResult p = server.executeJavaws(Arrays.asList(new String[]{"-headless", "-verbose"}), "EntryPointSignedSingleInvalid_applet.jnlp", new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertFalse(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } @Test public void javawsAppletAllPermAllSecurity() throws Exception { ProcessResult p = server.executeJavawsHeadless("EntryPointSignedSingleInvalid_applet_security.jnlp", new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertFalse(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } @Test @TestInBrowsers(testIn = Browsers.one) public void appletAllPermAllSecurity() throws Exception { server.getBrowserLocation(); ProcessResult p = server.executeBrowser("EntryPointSignedSingleInvalid.html", ServerAccess.AutoClose.CLOSE_ON_BOTH); Assert.assertFalse(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } @Test public void javawsHtml() throws Exception { ProcessResult p = server.executeJavaws(Arrays.asList(new String[]{OptionsDefinitions.OPTIONS.HTML.option}), "EntryPointSignedSingleInvalid.html", new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertFalse(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } } icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleInvalid/PaxHeaders.17941/srcs0000644000000000000000000000013112654402377027227 xustar0030 mtime=1454507263.247432448 30 atime=1454507658.777157383 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleInvalid/srcs/0000755000175000002070000000000012654402377030030 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleInvalid/srcs/PaxHeaders.17941/META-0000644000000000000000000000013112654402377030032 xustar0030 mtime=1454507263.247432448 30 atime=1454507658.777157383 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleInvalid/srcs/META-INF/0000755000175000002070000000000012654402377031170 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleInvalid/srcs/META-INF/PaxHeaders.170000644000000000000000000000013112654402377030131 xustar0030 mtime=1454507263.247432448 30 atime=1454507327.251578843 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleInvalid/srcs/META-INF/MANIFEST.MF0000644000175000002070000000007312654402377032622 0ustar00jvanekmock00000000000000Manifest-Version: 1.0 Entry-Point: SomeDifferentMainClass icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleInvalid/srcs/PaxHeaders.17941/Entry0000644000000000000000000000032312654402377030333 xustar00122 path=icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleInvalid/srcs/EntryPointSignedSingleInvalid.java 30 mtime=1454507263.247432448 30 atime=1454507327.251578843 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleInvalid/srcs/EntryPointSignedSingle0000644000175000002070000000407212654402377034365 0ustar00jvanekmock00000000000000 import java.applet.Applet; /* AppletTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class EntryPointSignedSingleInvalid extends Applet { @Override public void init() { confirm(); } public static void main(String... s) { confirm(); } private static void confirm() { System.out.println("*** applet running ***"); System.out.println(System.getProperty("user.home")); System.out.println("*** APPLET FINISHED ***"); } } icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleInvalid/PaxHeaders.17941/resources0000644000000000000000000000013112654402377030267 xustar0030 mtime=1454507263.247432448 30 atime=1454507658.777157383 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleInvalid/resources/0000755000175000002070000000000012654402377031070 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleInvalid/resources/PaxHeaders.17941/0000644000000000000000000000034112654402377030351 xustar00136 path=icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleInvalid/resources/EntryPointSignedSingleInvalid_security.jnlp 30 mtime=1454507263.247432448 30 atime=1454507327.251578843 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleInvalid/resources/EntryPointSignedS0000644000175000002070000000442712654402377034412 0ustar00jvanekmock00000000000000 EntryPointSignedSingleInvalid IcedTea EntryPointSignedSingleInvalid icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleInvalid/resources/PaxHeaders.17941/0000644000000000000000000000035012654402377030351 xustar00143 path=icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleInvalid/resources/EntryPointSignedSingleInvalid_applet_security.jnlp 30 mtime=1454507263.247432448 30 atime=1454507327.250578856 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleInvalid/resources/EntryPointSignedS0000644000175000002070000000462312654402377034410 0ustar00jvanekmock00000000000000 EntryPointSignedSingleInvalid IcedTea EntryPointSignedSingleInvalid icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleInvalid/resources/PaxHeaders.17941/0000644000000000000000000000033712654402377030356 xustar00134 path=icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleInvalid/resources/EntryPointSignedSingleInvalid_applet.jnlp 30 mtime=1454507263.246432461 30 atime=1454507327.250578856 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleInvalid/resources/EntryPointSignedS0000644000175000002070000000450512654402377034407 0ustar00jvanekmock00000000000000 EntryPointSignedSingleInvalid IcedTea EntryPointSignedSingleInvalid icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleInvalid/resources/PaxHeaders.17941/0000644000000000000000000000033012654402377030347 xustar00127 path=icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleInvalid/resources/EntryPointSignedSingleInvalid.jnlp 30 mtime=1454507263.246432461 30 atime=1454507327.250578856 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleInvalid/resources/EntryPointSignedS0000644000175000002070000000433112654402377034404 0ustar00jvanekmock00000000000000 EntryPointSignedSingleInvalid IcedTea EntryPointSignedSingleInvalid icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleInvalid/resources/PaxHeaders.17941/0000644000000000000000000000033012654402377030347 xustar00127 path=icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleInvalid/resources/EntryPointSignedSingleInvalid.html 30 mtime=1454507263.246432461 30 atime=1454507327.250578856 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleInvalid/resources/EntryPointSignedS0000644000175000002070000000346612654402377034414 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/signed/PaxHeaders.17941/EntryPointSignedSingleFirstInvalidSecond0000644000000000000000000000013112654402377030421 xustar0030 mtime=1454507263.245432474 30 atime=1454507658.777157383 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleFirstInvalidSecondOk/0000755000175000002070000000000012654402377031514 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleFirstInvalidSecondOk/PaxHeaders.1790000644000000000000000000000013112654402377030546 xustar0030 mtime=1454507263.245432474 30 atime=1454507658.777157383 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleFirstInvalidSecondOk/testcases/0000755000175000002070000000000012654402377033512 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleFirstInvalidSecondOk/testcases/PaxH0000644000000000000000000000036612654402377031053 xustar00157 path=icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleFirstInvalidSecondOk/testcases/EntryPointSignedSingleFirstInvalidSecondOkTest.java 30 mtime=1454507263.245432474 30 atime=1454507327.250578856 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleFirstInvalidSecondOk/testcases/Entr0000644000175000002070000001377312654402377034360 0ustar00jvanekmock00000000000000 import java.io.IOException; import java.util.Arrays; import net.sourceforge.jnlp.OptionsDefinitions; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import static net.sourceforge.jnlp.browsertesting.BrowserTest.server; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.AutoErrorClosingListener; import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; import net.sourceforge.jnlp.closinglisteners.StringBasedClosingListener; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.ManifestAttributesChecker; import net.sourceforge.jnlp.tools.DeploymentPropertiesModifier; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; /* AppletTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class EntryPointSignedSingleFirstInvalidSecondOkTest extends BrowserTest { private static final DeploymentPropertiesModifier dpm = new DeploymentPropertiesModifier(); private static final StringBasedClosingListener aok = new AutoOkClosingListener(); private static final StringBasedClosingListener aer = new AutoErrorClosingListener(); private static final String confirmation = "*** applet running ***"; @BeforeClass public static void setDeploymentManifestPermissionReadingOnly() throws IOException { dpm.setProperties(DeploymentConfiguration.KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK, ManifestAttributesChecker.MANIFEST_ATTRIBUTES_CHECK.ENTRYPOINT.toString()); } @AfterClass public static void restoreDeploymentProeprtiees() throws IOException { dpm.restoreProperties(); } @Test public void javawsAllPermNoSecurity() throws Exception { ProcessResult p = server.executeJavawsHeadless("EntryPointSignedSingleFirstInvalidSecondOk.jnlp"); Assert.assertTrue(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } @Test public void javawsAllPermAllSecurity() throws Exception { ProcessResult p = server.executeJavawsHeadless("EntryPointSignedSingleFirstInvalidSecondOk_security.jnlp"); Assert.assertTrue(p.stdout.contains(confirmation)); Assert.assertTrue(p.stdout.contains(aok.getCondition())); Assert.assertFalse(p.stderr.contains(aer.getCondition())); } @Test public void javawsAppletAllPermNoSecurity() throws Exception { ProcessResult p = server.executeJavaws(Arrays.asList(new String[]{"-headless", "-verbose"}), "EntryPointSignedSingleFirstInvalidSecondOk_applet.jnlp", new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } @Test public void javawsAppletAllPermAllSecurity() throws Exception { ProcessResult p = server.executeJavawsHeadless("EntryPointSignedSingleFirstInvalidSecondOk_applet_security.jnlp", new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(p.stdout.contains(confirmation)); Assert.assertTrue(p.stdout.contains(aok.getCondition())); Assert.assertFalse(p.stderr.contains(aer.getCondition())); } @Test @TestInBrowsers(testIn = Browsers.one) public void appletAllPermAllSecurity() throws Exception { server.getBrowserLocation(); ProcessResult p = server.executeBrowser("EntryPointSignedSingleFirstInvalidSecondOk.html", ServerAccess.AutoClose.CLOSE_ON_BOTH); Assert.assertTrue(p.stdout.contains(confirmation)); Assert.assertTrue(p.stdout.contains(aok.getCondition())); Assert.assertFalse(p.stderr.contains(aer.getCondition())); } @Test public void javawsHtml() throws Exception { ProcessResult p = server.executeJavaws(Arrays.asList(new String[]{OptionsDefinitions.OPTIONS.HTML.option}), "EntryPointSignedSingleFirstInvalidSecondOk.html", new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(p.stdout.contains(confirmation)); Assert.assertTrue(p.stdout.contains(aok.getCondition())); Assert.assertFalse(p.stderr.contains(aer.getCondition())); } } icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleFirstInvalidSecondOk/PaxHeaders.1790000644000000000000000000000013112654402377030546 xustar0030 mtime=1454507263.245432474 30 atime=1454507658.777157383 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleFirstInvalidSecondOk/srcs/0000755000175000002070000000000012654402377032466 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleFirstInvalidSecondOk/srcs/PaxHeader0000644000000000000000000000013112654402377031016 xustar0030 mtime=1454507263.245432474 30 atime=1454507658.777157383 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleFirstInvalidSecondOk/srcs/META-INF/0000755000175000002070000000000012654402377033626 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleFirstInvalidSecondOk/srcs/META-INF/0000644000000000000000000000032212654402377030376 xustar00121 path=icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleFirstInvalidSecondOk/srcs/META-INF/MANIFEST.MF 30 mtime=1454507263.245432474 30 atime=1454507327.250578856 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleFirstInvalidSecondOk/srcs/META-INF/0000644000175000002070000000014612654402377033631 0ustar00jvanekmock00000000000000Manifest-Version: 1.0 Entry-Point: SomeDifferentMainClass EntryPointSignedSingleFirstInvalidSecondOk icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleFirstInvalidSecondOk/srcs/PaxHeader0000644000000000000000000000035412654402377031025 xustar00148 path=icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleFirstInvalidSecondOk/srcs/EntryPointSignedSingleFirstInvalidSecondOk.java 30 mtime=1454507263.245432474 29 atime=1454507327.24957887 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleFirstInvalidSecondOk/srcs/EntryPoin0000644000175000002070000000410712654402377034342 0ustar00jvanekmock00000000000000 import java.applet.Applet; /* AppletTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class EntryPointSignedSingleFirstInvalidSecondOk extends Applet { @Override public void init() { confirm(); } public static void main(String... s) { confirm(); } private static void confirm() { System.out.println("*** applet running ***"); System.out.println(System.getProperty("user.home")); System.out.println("*** APPLET FINISHED ***"); } } icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleFirstInvalidSecondOk/PaxHeaders.1790000644000000000000000000000013112654402377030546 xustar0030 mtime=1454507263.245432474 30 atime=1454507658.777157383 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleFirstInvalidSecondOk/resources/0000755000175000002070000000000012654402377033526 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleFirstInvalidSecondOk/resources/PaxH0000644000000000000000000000037212654402377031064 xustar00162 path=icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleFirstInvalidSecondOk/resources/EntryPointSignedSingleFirstInvalidSecondOk_security.jnlp 30 mtime=1454507263.245432474 29 atime=1454507327.24957887 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleFirstInvalidSecondOk/resources/Entr0000644000175000002070000000453012654402377034363 0ustar00jvanekmock00000000000000 EntryPointSignedSingleFirstInvalidSecondOk IcedTea EntryPointSignedSingleFirstInvalidSecondOk icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleFirstInvalidSecondOk/resources/PaxH0000644000000000000000000000040112654402377031055 xustar00169 path=icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleFirstInvalidSecondOk/resources/EntryPointSignedSingleFirstInvalidSecondOk_applet_security.jnlp 30 mtime=1454507263.244432488 29 atime=1454507327.24957887 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleFirstInvalidSecondOk/resources/Entr0000644000175000002070000000474112654402377034367 0ustar00jvanekmock00000000000000 EntryPointSignedSingleFirstInvalidSecondOk IcedTea EntryPointSignedSingleFirstInvalidSecondOk icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleFirstInvalidSecondOk/resources/PaxH0000644000000000000000000000037012654402377031062 xustar00160 path=icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleFirstInvalidSecondOk/resources/EntryPointSignedSingleFirstInvalidSecondOk_applet.jnlp 30 mtime=1454507263.244432488 29 atime=1454507327.24957887 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleFirstInvalidSecondOk/resources/Entr0000644000175000002070000000462312654402377034366 0ustar00jvanekmock00000000000000 EntryPointSignedSingleFirstInvalidSecondOk IcedTea EntryPointSignedSingleFirstInvalidSecondOk icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleFirstInvalidSecondOk/resources/PaxH0000644000000000000000000000036112654402377031062 xustar00153 path=icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleFirstInvalidSecondOk/resources/EntryPointSignedSingleFirstInvalidSecondOk.jnlp 30 mtime=1454507263.244432488 29 atime=1454507327.24957887 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleFirstInvalidSecondOk/resources/Entr0000644000175000002070000000443212654402377034364 0ustar00jvanekmock00000000000000 EntryPointSignedSingleFirstInvalidSecondOk IcedTea EntryPointSignedSingleFirstInvalidSecondOk icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleFirstInvalidSecondOk/resources/PaxH0000644000000000000000000000036112654402377031062 xustar00153 path=icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleFirstInvalidSecondOk/resources/EntryPointSignedSingleFirstInvalidSecondOk.html 30 mtime=1454507263.244432488 29 atime=1454507327.24957887 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleFirstInvalidSecondOk/resources/Entr0000644000175000002070000000352012654402377034361 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/signed/PaxHeaders.17941/EntryPointSignedSingleBothOk0000644000000000000000000000013112654402377026055 xustar0030 mtime=1454507263.243432501 30 atime=1454507658.777157383 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothOk/0000755000175000002070000000000012654402377026656 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothOk/PaxHeaders.17941/testcases0000644000000000000000000000013112654402377030053 xustar0030 mtime=1454507263.243432501 30 atime=1454507658.777157383 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothOk/testcases/0000755000175000002070000000000012654402377030654 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothOk/testcases/PaxHeaders.17941/E0000644000000000000000000000033312654402377030243 xustar00130 path=icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothOk/testcases/EntryPointSignedSingleBothOkTest2.java 30 mtime=1454507263.243432501 30 atime=1454507327.248578883 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothOk/testcases/EntryPointSignedSi0000644000175000002070000001576612654402377034357 0ustar00jvanekmock00000000000000/* Copyright (C) 2015 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.io.IOException; import java.util.Arrays; import net.sourceforge.jnlp.OptionsDefinitions; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import static net.sourceforge.jnlp.browsertesting.BrowserTest.server; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.AutoErrorClosingListener; import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; import net.sourceforge.jnlp.closinglisteners.StringBasedClosingListener; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.ManifestAttributesChecker; import net.sourceforge.jnlp.tools.DeploymentPropertiesModifier; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; public class EntryPointSignedSingleBothOkTest2 extends BrowserTest { public static final String MAGICAL_OK1_CLOSING_STRING = "*** APPLET1 FINISHED ***"; public static final String MAGICAL_OK2_CLOSING_STRING = "*** APPLET2 FINISHED ***"; private static class AutoOk1ClosingListener extends StringBasedClosingListener { public AutoOk1ClosingListener() { super(MAGICAL_OK1_CLOSING_STRING); } } private static class AutoOk2ClosingListener extends StringBasedClosingListener { public AutoOk2ClosingListener() { super(MAGICAL_OK2_CLOSING_STRING); } } private static final DeploymentPropertiesModifier dpm = new DeploymentPropertiesModifier(); private static final StringBasedClosingListener aok = new AutoOkClosingListener(); private static final StringBasedClosingListener aok1 = new AutoOk1ClosingListener(); private static final StringBasedClosingListener aok2 = new AutoOk2ClosingListener(); private static final StringBasedClosingListener aer = new AutoErrorClosingListener(); private static final String confirmation1 = "*** applet1 running ***"; private static final String confirmation2 = "*** applet2 running ***"; @BeforeClass public static void setDeploymentManifestPermissionReadingOnly() throws IOException { dpm.setProperties(DeploymentConfiguration.KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK, ManifestAttributesChecker.MANIFEST_ATTRIBUTES_CHECK.ENTRYPOINT.toString()); } @AfterClass public static void restoreDeploymentProeprtiees() throws IOException { dpm.restoreProperties(); } @Test public void javawsAllPermNoSecurity2() throws Exception { ProcessResult p = server.executeJavawsHeadless("EntryPointSignedSingleBothOk2.jnlp"); Assert.assertTrue(p.stdout.contains(confirmation2)); Assert.assertFalse(p.stdout.contains(aok2.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); assertNope(p); } @Test public void javawsAllPermAllSecurity2() throws Exception { ProcessResult p = server.executeJavawsHeadless("EntryPointSignedSingleBothOk_security2.jnlp"); Assert.assertTrue(p.stdout.contains(confirmation2)); Assert.assertTrue(p.stdout.contains(aok2.getCondition())); Assert.assertFalse(p.stderr.contains(aer.getCondition())); } @Test public void javawsAppletAllPermNoSecurity2() throws Exception { ProcessResult p = server.executeJavaws(Arrays.asList(new String[]{"-headless", "-verbose"}), "EntryPointSignedSingleBothOk_applet2.jnlp", new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(p.stdout.contains(confirmation2)); Assert.assertFalse(p.stdout.contains(aok2.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); assertNope(p); } @Test public void javawsAppletAllPermAllSecurity2() throws Exception { ProcessResult p = server.executeJavawsHeadless("EntryPointSignedSingleBothOk_applet_security2.jnlp", new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(p.stdout.contains(confirmation2)); Assert.assertTrue(p.stdout.contains(aok2.getCondition())); Assert.assertFalse(p.stderr.contains(aer.getCondition())); assertNope(p); } @Test @TestInBrowsers(testIn = Browsers.one) public void appletAllPermAllSecurity2() throws Exception { server.getBrowserLocation(); ProcessResult p = server.executeBrowser("EntryPointSignedSingleBothOk2.html", ServerAccess.AutoClose.CLOSE_ON_BOTH); Assert.assertTrue(p.stdout.contains(confirmation2)); Assert.assertTrue(p.stdout.contains(aok2.getCondition())); Assert.assertFalse(p.stderr.contains(aer.getCondition())); assertNope(p); } @Test public void javawsHtml2() throws Exception { ProcessResult p = server.executeJavaws(Arrays.asList(new String[]{OptionsDefinitions.OPTIONS.HTML.option}), "EntryPointSignedSingleBothOk2.html", new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(p.stdout.contains(confirmation2)); Assert.assertTrue(p.stdout.contains(aok2.getCondition())); Assert.assertFalse(p.stderr.contains(aer.getCondition())); assertNope(p); } public void assertNope(ProcessResult p){ Assert.assertFalse(p.stdout.contains(confirmation1)); Assert.assertFalse(p.stdout.contains(aok1.getCondition())); } } icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothOk/testcases/PaxHeaders.17941/E0000644000000000000000000000033312654402377030243 xustar00130 path=icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothOk/testcases/EntryPointSignedSingleBothOkTest1.java 30 mtime=1454507263.243432501 30 atime=1454507327.248578883 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothOk/testcases/EntryPointSignedSi0000644000175000002070000001601512654402377034343 0ustar00jvanekmock00000000000000/* Copyright (C) 2015 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.io.IOException; import java.util.Arrays; import net.sourceforge.jnlp.OptionsDefinitions; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import static net.sourceforge.jnlp.browsertesting.BrowserTest.server; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.AutoErrorClosingListener; import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; import net.sourceforge.jnlp.closinglisteners.StringBasedClosingListener; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.ManifestAttributesChecker; import net.sourceforge.jnlp.tools.DeploymentPropertiesModifier; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; public class EntryPointSignedSingleBothOkTest1 extends BrowserTest { public static final String MAGICAL_OK1_CLOSING_STRING = "*** APPLET1 FINISHED ***"; public static final String MAGICAL_OK2_CLOSING_STRING = "*** APPLET2 FINISHED ***"; private static class AutoOk1ClosingListener extends StringBasedClosingListener { public AutoOk1ClosingListener() { super(MAGICAL_OK1_CLOSING_STRING); } } private static class AutoOk2ClosingListener extends StringBasedClosingListener { public AutoOk2ClosingListener() { super(MAGICAL_OK2_CLOSING_STRING); } } private static final DeploymentPropertiesModifier dpm = new DeploymentPropertiesModifier(); private static final StringBasedClosingListener aok = new AutoOkClosingListener(); private static final StringBasedClosingListener aok1 = new AutoOk1ClosingListener(); private static final StringBasedClosingListener aok2 = new AutoOk2ClosingListener(); private static final StringBasedClosingListener aer = new AutoErrorClosingListener(); private static final String confirmation1 = "*** applet1 running ***"; private static final String confirmation2 = "*** applet2 running ***"; @BeforeClass public static void setDeploymentManifestPermissionReadingOnly() throws IOException { dpm.setProperties(DeploymentConfiguration.KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK, ManifestAttributesChecker.MANIFEST_ATTRIBUTES_CHECK.ENTRYPOINT.toString()); } @AfterClass public static void restoreDeploymentProeprtiees() throws IOException { dpm.restoreProperties(); } @Test public void javawsAllPermNoSecurity1() throws Exception { ProcessResult p = server.executeJavawsHeadless("EntryPointSignedSingleBothOk1.jnlp"); Assert.assertTrue(p.stdout.contains(confirmation1)); Assert.assertFalse(p.stdout.contains(aok1.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); assertNope(p); } @Test public void javawsAllPermAllSecurity1() throws Exception { ProcessResult p = server.executeJavawsHeadless("EntryPointSignedSingleBothOk_security1.jnlp"); Assert.assertTrue(p.stdout.contains(confirmation1)); Assert.assertTrue(p.stdout.contains(aok1.getCondition())); Assert.assertFalse(p.stderr.contains(aer.getCondition())); assertNope(p); } @Test public void javawsAppletAllPermNoSecurity1() throws Exception { ProcessResult p = server.executeJavaws(Arrays.asList(new String[]{"-headless", "-verbose"}), "EntryPointSignedSingleBothOk_applet1.jnlp", new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(p.stdout.contains(confirmation1)); Assert.assertFalse(p.stdout.contains(aok1.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); assertNope(p); } @Test public void javawsAppletAllPermAllSecurity1() throws Exception { ProcessResult p = server.executeJavawsHeadless("EntryPointSignedSingleBothOk_applet_security1.jnlp", new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(p.stdout.contains(confirmation1)); Assert.assertTrue(p.stdout.contains(aok1.getCondition())); Assert.assertFalse(p.stderr.contains(aer.getCondition())); assertNope(p); } @Test @TestInBrowsers(testIn = Browsers.one) public void appletAllPermAllSecurity1() throws Exception { server.getBrowserLocation(); ProcessResult p = server.executeBrowser("EntryPointSignedSingleBothOk1.html", ServerAccess.AutoClose.CLOSE_ON_BOTH); Assert.assertTrue(p.stdout.contains(confirmation1)); Assert.assertTrue(p.stdout.contains(aok1.getCondition())); Assert.assertFalse(p.stderr.contains(aer.getCondition())); assertNope(p); } @Test public void javawsHtml1() throws Exception { ProcessResult p = server.executeJavaws(Arrays.asList(new String[]{OptionsDefinitions.OPTIONS.HTML.option}), "EntryPointSignedSingleBothOk1.html", new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(p.stdout.contains(confirmation1)); Assert.assertTrue(p.stdout.contains(aok1.getCondition())); Assert.assertFalse(p.stderr.contains(aer.getCondition())); assertNope(p); } public void assertNope(ProcessResult p){ Assert.assertFalse(p.stdout.contains(confirmation2)); Assert.assertFalse(p.stdout.contains(aok2.getCondition())); } } icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothOk/PaxHeaders.17941/srcs0000644000000000000000000000013112654402377027027 xustar0030 mtime=1454507263.243432501 30 atime=1454507658.777157383 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothOk/srcs/0000755000175000002070000000000012654402377027630 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothOk/srcs/PaxHeaders.17941/META-I0000644000000000000000000000013112654402377027743 xustar0030 mtime=1454507263.243432501 30 atime=1454507658.777157383 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothOk/srcs/META-INF/0000755000175000002070000000000012654402377030770 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothOk/srcs/META-INF/PaxHeaders.1790000644000000000000000000000013112654402377030022 xustar0030 mtime=1454507263.243432501 30 atime=1454507327.248578883 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothOk/srcs/META-INF/MANIFEST.MF0000644000175000002070000000014012654402377032415 0ustar00jvanekmock00000000000000Manifest-Version: 1.0 Entry-Point: EntryPointSignedSingleBothOk2 EntryPointSignedSingleBothOk1 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothOk/srcs/PaxHeaders.17941/EntryP0000644000000000000000000000032212654402377030252 xustar00121 path=icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothOk/srcs/EntryPointSignedSingleBothOk2.java 30 mtime=1454507263.242432514 30 atime=1454507327.248578883 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothOk/srcs/EntryPointSignedSingleB0000644000175000002070000000416312654402377034270 0ustar00jvanekmock00000000000000 import java.applet.Applet; /* AppletTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class EntryPointSignedSingleBothOk2 extends Applet { @Override public void init() { confirm(); } public static void main(String... s) { confirm(); } private static void confirm() { System.out.println("*** applet2 running ***"); System.out.println(System.getProperty("user.home")); System.out.println("*** APPLET2 FINISHED ***"); System.out.println("*** APPLET FINISHED ***"); } } icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothOk/srcs/PaxHeaders.17941/EntryP0000644000000000000000000000032212654402377030252 xustar00121 path=icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothOk/srcs/EntryPointSignedSingleBothOk1.java 30 mtime=1454507263.242432514 30 atime=1454507327.248578883 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothOk/srcs/EntryPointSignedSingleB0000644000175000002070000000416312654402377034270 0ustar00jvanekmock00000000000000 import java.applet.Applet; /* AppletTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class EntryPointSignedSingleBothOk1 extends Applet { @Override public void init() { confirm(); } public static void main(String... s) { confirm(); } private static void confirm() { System.out.println("*** applet1 running ***"); System.out.println(System.getProperty("user.home")); System.out.println("*** APPLET1 FINISHED ***"); System.out.println("*** APPLET FINISHED ***"); } } icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothOk/PaxHeaders.17941/resources0000644000000000000000000000013112654402377030067 xustar0030 mtime=1454507263.242432514 30 atime=1454507658.777157383 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothOk/resources/0000755000175000002070000000000012654402377030670 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothOk/resources/PaxHeaders.17941/E0000644000000000000000000000034012654402377030255 xustar00135 path=icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothOk/resources/EntryPointSignedSingleBothOk_security2.jnlp 30 mtime=1454507263.242432514 30 atime=1454507327.247578896 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothOk/resources/EntryPointSignedSi0000644000175000002070000000442412654402377034360 0ustar00jvanekmock00000000000000 EntryPointSignedSingleBothOk IcedTea EntryPointSignedSingleBothOk icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothOk/resources/PaxHeaders.17941/E0000644000000000000000000000034012654402377030255 xustar00135 path=icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothOk/resources/EntryPointSignedSingleBothOk_security1.jnlp 30 mtime=1454507263.242432514 30 atime=1454507327.247578896 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothOk/resources/EntryPointSignedSi0000644000175000002070000000442412654402377034360 0ustar00jvanekmock00000000000000 EntryPointSignedSingleBothOk IcedTea EntryPointSignedSingleBothOk icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothOk/resources/PaxHeaders.17941/E0000644000000000000000000000034712654402377030264 xustar00142 path=icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothOk/resources/EntryPointSignedSingleBothOk_applet_security2.jnlp 30 mtime=1454507263.241432528 30 atime=1454507327.247578896 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothOk/resources/EntryPointSignedSi0000644000175000002070000000461712654402377034364 0ustar00jvanekmock00000000000000 EntryPointSignedSingleBothOk IcedTea EntryPointSignedSingleBothOk icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothOk/resources/PaxHeaders.17941/E0000644000000000000000000000034712654402377030264 xustar00142 path=icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothOk/resources/EntryPointSignedSingleBothOk_applet_security1.jnlp 30 mtime=1454507263.241432528 30 atime=1454507327.247578896 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothOk/resources/EntryPointSignedSi0000644000175000002070000000461712654402377034364 0ustar00jvanekmock00000000000000 EntryPointSignedSingleBothOk IcedTea EntryPointSignedSingleBothOk icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothOk/resources/PaxHeaders.17941/E0000644000000000000000000000033612654402377030262 xustar00133 path=icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothOk/resources/EntryPointSignedSingleBothOk_applet2.jnlp 30 mtime=1454507263.241432528 30 atime=1454507327.247578896 29 ctime=1454507658.76315757 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothOk/resources/EntryPointSignedSi0000644000175000002070000000450112654402377034354 0ustar00jvanekmock00000000000000 EntryPointSignedSingleBothOk IcedTea EntryPointSignedSingleBothOk icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothOk/resources/PaxHeaders.17941/E0000644000000000000000000000033712654402377030263 xustar00133 path=icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothOk/resources/EntryPointSignedSingleBothOk_applet1.jnlp 30 mtime=1454507263.241432528 30 atime=1454507327.247578896 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothOk/resources/EntryPointSignedSi0000644000175000002070000000450112654402377034354 0ustar00jvanekmock00000000000000 EntryPointSignedSingleBothOk IcedTea EntryPointSignedSingleBothOk icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothOk/resources/PaxHeaders.17941/E0000644000000000000000000000032712654402377030262 xustar00126 path=icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothOk/resources/EntryPointSignedSingleBothOk2.jnlp 30 mtime=1454507263.240432541 29 atime=1454507327.24657891 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothOk/resources/EntryPointSignedSi0000644000175000002070000000432612654402377034361 0ustar00jvanekmock00000000000000 EntryPointSignedSingleBothOk IcedTea EntryPointSignedSingleBothOk icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothOk/resources/PaxHeaders.17941/E0000644000000000000000000000032712654402377030262 xustar00126 path=icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothOk/resources/EntryPointSignedSingleBothOk2.html 30 mtime=1454507263.240432541 29 atime=1454507327.24657891 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothOk/resources/EntryPointSignedSi0000644000175000002070000000346512654402377034364 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothOk/resources/PaxHeaders.17941/E0000644000000000000000000000032712654402377030262 xustar00126 path=icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothOk/resources/EntryPointSignedSingleBothOk1.jnlp 30 mtime=1454507263.240432541 29 atime=1454507327.24657891 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothOk/resources/EntryPointSignedSi0000644000175000002070000000432612654402377034361 0ustar00jvanekmock00000000000000 EntryPointSignedSingleBothOk IcedTea EntryPointSignedSingleBothOk icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothOk/resources/PaxHeaders.17941/E0000644000000000000000000000032712654402377030262 xustar00126 path=icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothOk/resources/EntryPointSignedSingleBothOk1.html 30 mtime=1454507263.240432541 29 atime=1454507327.24657891 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothOk/resources/EntryPointSignedSi0000644000175000002070000000346512654402377034364 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/signed/PaxHeaders.17941/EntryPointSignedSingleBothInvalid0000644000000000000000000000013212654402377027073 xustar0030 mtime=1454507263.239432554 30 atime=1454507658.777157383 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothInvalid/0000755000175000002070000000000012654402377027673 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothInvalid/PaxHeaders.17941/testca0000644000000000000000000000013212654402377030356 xustar0030 mtime=1454507263.239432554 30 atime=1454507658.777157383 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothInvalid/testcases/0000755000175000002070000000000012654402377031671 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothInvalid/testcases/PaxHeaders.170000644000000000000000000000034412654402377030640 xustar00139 path=icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothInvalid/testcases/EntryPointSignedSingleBothInvalidTest.java 30 mtime=1454507263.239432554 29 atime=1454507327.24657891 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothInvalid/testcases/EntryPointSig0000644000175000002070000001370212654402377034375 0ustar00jvanekmock00000000000000 import java.io.IOException; import java.util.Arrays; import net.sourceforge.jnlp.OptionsDefinitions; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import static net.sourceforge.jnlp.browsertesting.BrowserTest.server; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.AutoErrorClosingListener; import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; import net.sourceforge.jnlp.closinglisteners.StringBasedClosingListener; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.ManifestAttributesChecker; import net.sourceforge.jnlp.tools.DeploymentPropertiesModifier; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; /* AppletTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class EntryPointSignedSingleBothInvalidTest extends BrowserTest { private static final DeploymentPropertiesModifier dpm = new DeploymentPropertiesModifier(); private static final StringBasedClosingListener aok = new AutoOkClosingListener(); private static final StringBasedClosingListener aer = new AutoErrorClosingListener(); private static final String confirmation = "*** applet running ***"; @BeforeClass public static void setDeploymentManifestPermissionReadingOnly() throws IOException { dpm.setProperties(DeploymentConfiguration.KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK, ManifestAttributesChecker.MANIFEST_ATTRIBUTES_CHECK.ENTRYPOINT.toString()); } @AfterClass public static void restoreDeploymentProeprtiees() throws IOException { dpm.restoreProperties(); } @Test public void javawsAllPermNoSecurity() throws Exception { ProcessResult p = server.executeJavawsHeadless("EntryPointSignedSingleBothInvalid.jnlp"); Assert.assertFalse(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } @Test public void javawsAllPermAllSecurity() throws Exception { ProcessResult p = server.executeJavawsHeadless("EntryPointSignedSingleBothInvalid_security.jnlp"); Assert.assertFalse(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } @Test public void javawsAppletAllPermNoSecurity() throws Exception { ProcessResult p = server.executeJavaws(Arrays.asList(new String[]{"-headless", "-verbose"}), "EntryPointSignedSingleBothInvalid_applet.jnlp", new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertFalse(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } @Test public void javawsAppletAllPermAllSecurity() throws Exception { ProcessResult p = server.executeJavawsHeadless("EntryPointSignedSingleBothInvalid_applet_security.jnlp", new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertFalse(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } @Test @TestInBrowsers(testIn = Browsers.one) public void appletAllPermAllSecurity() throws Exception { server.getBrowserLocation(); ProcessResult p = server.executeBrowser("EntryPointSignedSingleBothInvalid.html", ServerAccess.AutoClose.CLOSE_ON_BOTH); Assert.assertFalse(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } @Test public void javawsHtml() throws Exception { ProcessResult p = server.executeJavaws(Arrays.asList(new String[]{OptionsDefinitions.OPTIONS.HTML.option}), "EntryPointSignedSingleBothInvalid.html", new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertFalse(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } } icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothInvalid/PaxHeaders.17941/srcs0000644000000000000000000000013212654402377030045 xustar0030 mtime=1454507263.239432554 30 atime=1454507658.777157383 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothInvalid/srcs/0000755000175000002070000000000012654402377030645 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothInvalid/srcs/PaxHeaders.17941/M0000644000000000000000000000013212654402377030241 xustar0030 mtime=1454507263.239432554 30 atime=1454507658.777157383 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothInvalid/srcs/META-INF/0000755000175000002070000000000012654402377032005 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothInvalid/srcs/META-INF/PaxHeader0000644000000000000000000000031112654402377030335 xustar00112 path=icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothInvalid/srcs/META-INF/MANIFEST.MF 30 mtime=1454507263.239432554 29 atime=1454507327.24657891 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothInvalid/srcs/META-INF/MANIFEST.0000644000175000002070000000012512654402377033212 0ustar00jvanekmock00000000000000Manifest-Version: 1.0 Entry-Point: SomeDifferentMainClass AnotherDifferentMainClass icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothInvalid/srcs/PaxHeaders.17941/E0000644000000000000000000000033412654402377030235 xustar00130 path=icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothInvalid/srcs/EntryPointSignedSingleBothInvalid.java 30 mtime=1454507263.239432554 30 atime=1454507327.245578923 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothInvalid/srcs/EntryPointSignedSi0000644000175000002070000000407612654402377034340 0ustar00jvanekmock00000000000000 import java.applet.Applet; /* AppletTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class EntryPointSignedSingleBothInvalid extends Applet { @Override public void init() { confirm(); } public static void main(String... s) { confirm(); } private static void confirm() { System.out.println("*** applet running ***"); System.out.println(System.getProperty("user.home")); System.out.println("*** APPLET FINISHED ***"); } } icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothInvalid/PaxHeaders.17941/resour0000644000000000000000000000013212654402377030412 xustar0030 mtime=1454507263.238432568 30 atime=1454507658.777157383 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothInvalid/resources/0000755000175000002070000000000012654402377031705 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothInvalid/resources/PaxHeaders.170000644000000000000000000000035212654402377030653 xustar00144 path=icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothInvalid/resources/EntryPointSignedSingleBothInvalid_security.jnlp 30 mtime=1454507263.238432568 30 atime=1454507327.245578923 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothInvalid/resources/EntryPointSig0000644000175000002070000000445312654402377034414 0ustar00jvanekmock00000000000000 EntryPointSignedSingleBothInvalid IcedTea EntryPointSignedSingleBothInvalid icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothInvalid/resources/PaxHeaders.170000644000000000000000000000036112654402377030653 xustar00151 path=icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothInvalid/resources/EntryPointSignedSingleBothInvalid_applet_security.jnlp 30 mtime=1454507263.238432568 30 atime=1454507327.245578923 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothInvalid/resources/EntryPointSig0000644000175000002070000000465312654402377034416 0ustar00jvanekmock00000000000000 EntryPointSignedSingleBothInvalid IcedTea EntryPointSignedSingleBothInvalid icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothInvalid/resources/PaxHeaders.170000644000000000000000000000035012654402377030651 xustar00142 path=icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothInvalid/resources/EntryPointSignedSingleBothInvalid_applet.jnlp 30 mtime=1454507263.238432568 30 atime=1454507327.245578923 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothInvalid/resources/EntryPointSig0000644000175000002070000000453512654402377034415 0ustar00jvanekmock00000000000000 EntryPointSignedSingleBothInvalid IcedTea EntryPointSignedSingleBothInvalid icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothInvalid/resources/PaxHeaders.170000644000000000000000000000034112654402377030651 xustar00135 path=icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothInvalid/resources/EntryPointSignedSingleBothInvalid.jnlp 30 mtime=1454507263.238432568 30 atime=1454507327.245578923 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothInvalid/resources/EntryPointSig0000644000175000002070000000435512654402377034415 0ustar00jvanekmock00000000000000 EntryPointSignedSingleBothInvalid IcedTea EntryPointSignedSingleBothInvalid icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothInvalid/resources/PaxHeaders.170000644000000000000000000000034112654402377030651 xustar00135 path=icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothInvalid/resources/EntryPointSignedSingleBothInvalid.html 30 mtime=1454507263.237432581 30 atime=1454507327.245578923 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/EntryPointSignedSingleBothInvalid/resources/EntryPointSig0000644000175000002070000000347612654402377034420 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/signed/PaxHeaders.17941/EmptySignedJar0000644000000000000000000000013212654402377023225 xustar0030 mtime=1454507263.237432581 30 atime=1454507658.777157383 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/EmptySignedJar/0000755000175000002070000000000012654402377024025 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/EmptySignedJar/PaxHeaders.17941/testcases0000644000000000000000000000013212654402377025223 xustar0030 mtime=1454507263.237432581 30 atime=1454507658.777157383 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/EmptySignedJar/testcases/0000755000175000002070000000000012654402377026023 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/EmptySignedJar/testcases/PaxHeaders.17941/EmptySignedJarT0000644000000000000000000000013212654402377030234 xustar0030 mtime=1454507263.237432581 30 atime=1454507327.244578936 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/EmptySignedJar/testcases/EmptySignedJarTest.java0000644000175000002070000000612712654402377032421 0ustar00jvanekmock00000000000000/* EmptySignedJarTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.util.Arrays; import java.util.Collections; import java.util.List; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.annotations.Bug; import org.junit.Assert; import org.junit.Test; public class EmptySignedJarTest { private static ServerAccess server = new ServerAccess(); private final List l = Collections.unmodifiableList(Arrays.asList(new String[] { "-Xtrustall" })); private final String jarOutput = "Running SignedJarResource.."; @Test public void checkingForRequiredResources() throws Exception { String s = "Running SignedJarResource.."; ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJarResource.jnlp"); Assert.assertTrue("Could not locate SignedJarResource class within SignedJarResource jar", pr.stdout.contains(s)); } @Bug(id = "PR1049") @Test public void usingExtensionWithEmptyJar() throws Exception { ProcessResult pr = server.executeJavawsHeadless(l, "/EmptySignedJarInExtensionJnlp.jnlp"); Assert.assertTrue("Stdout should contain " + jarOutput + " but did not", pr.stdout.contains(jarOutput)); } @Bug(id = "PR1049") @Test public void usingLauncherWithEmptyJar() throws Exception { ProcessResult pr = server.executeJavawsHeadless(l, "/EmptySignedJarInLaunchingJnlp.jnlp"); Assert.assertTrue("Stdout should contain " + jarOutput + " but did not", pr.stdout.contains(jarOutput)); } } icedtea-web-1.6.2/tests/reproducers/signed/EmptySignedJar/PaxHeaders.17941/srcs0000644000000000000000000000013212654402377024177 xustar0030 mtime=1454507263.237432581 30 atime=1454507658.777157383 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/EmptySignedJar/srcs/0000755000175000002070000000000012654402377024777 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/EmptySignedJar/srcs/PaxHeaders.17941/META-INF0000644000000000000000000000013212654402377025337 xustar0030 mtime=1454507263.237432581 30 atime=1454507658.777157383 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/EmptySignedJar/srcs/META-INF/0000755000175000002070000000000012654402377026137 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/EmptySignedJar/srcs/META-INF/PaxHeaders.17941/empty_file0000644000000000000000000000013212654402377027474 xustar0030 mtime=1454507263.237432581 30 atime=1454507327.244578936 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/EmptySignedJar/srcs/META-INF/empty_file0000644000175000002070000000002712654402377030216 0ustar00jvanekmock00000000000000This is an empty file. icedtea-web-1.6.2/tests/reproducers/signed/EmptySignedJar/PaxHeaders.17941/resources0000644000000000000000000000013212654402377025237 xustar0030 mtime=1454507263.237432581 30 atime=1454507658.777157383 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/EmptySignedJar/resources/0000755000175000002070000000000012654402377026037 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/EmptySignedJar/resources/PaxHeaders.17941/EmptySignedJarI0000644000000000000000000000031212654402377030235 xustar00112 path=icedtea-web-1.6.2/tests/reproducers/signed/EmptySignedJar/resources/EmptySignedJarInLaunchingJnlp.jnlp 30 mtime=1454507263.237432581 30 atime=1454507327.244578936 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/EmptySignedJar/resources/EmptySignedJarInLaunchingJnlp.jn0000644000175000002070000000500512654402377034221 0ustar00jvanekmock00000000000000 EmptySignedJar IcedTea EmptySignedJar icedtea-web-1.6.2/tests/reproducers/signed/EmptySignedJar/resources/PaxHeaders.17941/EmptySignedJarI0000644000000000000000000000031212654402377030235 xustar00112 path=icedtea-web-1.6.2/tests/reproducers/signed/EmptySignedJar/resources/EmptySignedJarInExtensionJnlp.jnlp 30 mtime=1454507263.236432594 30 atime=1454507327.244578936 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/EmptySignedJar/resources/EmptySignedJarInExtensionJnlp.jn0000644000175000002070000000502112654402377034263 0ustar00jvanekmock00000000000000 EmptySignedJar IcedTea EmptySignedJar icedtea-web-1.6.2/tests/reproducers/signed/EmptySignedJar/resources/PaxHeaders.17941/EmptySignedJarE0000644000000000000000000000013212654402377030231 xustar0030 mtime=1454507263.236432594 30 atime=1454507327.244578936 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/EmptySignedJar/resources/EmptySignedJarExtension.jnlp0000644000175000002070000000451412654402377033512 0ustar00jvanekmock00000000000000 EmptySignedJarExtension IcedTea EmptySignedJarExtension icedtea-web-1.6.2/tests/reproducers/signed/PaxHeaders.17941/DownloadService0000644000000000000000000000013212654402377023430 xustar0030 mtime=1454507263.236432594 30 atime=1454507658.777157383 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/DownloadService/0000755000175000002070000000000012654402377024230 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/DownloadService/PaxHeaders.17941/testcases0000644000000000000000000000013212654402377025426 xustar0030 mtime=1454507263.236432594 30 atime=1454507658.777157383 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/DownloadService/testcases/0000755000175000002070000000000012654402377026226 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/DownloadService/testcases/PaxHeaders.17941/DownloadServic0000644000000000000000000000013212654402377030351 xustar0030 mtime=1454507263.236432594 30 atime=1454507327.244578936 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/DownloadService/testcases/DownloadServiceTest.java0000644000175000002070000004353612654402377033034 0ustar00jvanekmock00000000000000/* DownloadServiceTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.io.File; import java.net.MalformedURLException; import java.util.ArrayList; import java.util.List; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; public class DownloadServiceTest { private static final ServerAccess server = new ServerAccess(); private final String exitString = "Exiting DownloadService.."; private static final List checkCache = new ArrayList<>(); private static final List manageJnlpResources = new ArrayList<>(); private static final List manageExternalResources = new ArrayList<>(); @BeforeClass public static void initalizeClass() throws MalformedURLException { //Check Cache checkCache.add(server.getJavawsLocation()); checkCache.add("-arg"); checkCache.add(server.getUrl().toString() + "/"); checkCache.add("-arg"); checkCache.add("checkCache"); checkCache.add("-Xtrustall"); checkCache.add(ServerAccess.HEADLES_OPTION); checkCache.add(server.getUrl() + "/DownloadService.jnlp"); //Manage Jnlp Resouces manageJnlpResources.add(server.getJavawsLocation()); manageJnlpResources.add("-arg"); manageJnlpResources.add(server.getUrl().toString() + "/"); manageJnlpResources.add("-arg"); manageJnlpResources.add("manageJnlpJars"); manageJnlpResources.add("-Xtrustall"); manageJnlpResources.add(ServerAccess.HEADLES_OPTION); manageJnlpResources.add(server.getUrl() + "/DownloadService.jnlp"); //Manage External Resources manageExternalResources.add(server.getJavawsLocation()); manageExternalResources.add("-arg"); manageExternalResources.add(server.getUrl().toString() + "/"); manageExternalResources.add("-arg"); manageExternalResources.add("manageExternalJars"); manageExternalResources.add("-Xtrustall"); manageExternalResources.add(ServerAccess.HEADLES_OPTION); manageExternalResources.add(server.getUrl() + "/DownloadService.jnlp"); } /** * Executes reproducer to checks if DownloadServices's cache checks are working correctly. * @return stdout of reproducer. */ private String runCacheCheckTests() throws Exception { //Check cache test ProcessResult processResult = ServerAccess.executeProcess(checkCache); String stdoutCheckCache = processResult.stdout; Assert.assertTrue("CheckCache - DownloadServiceRunner instance did not close as expected, this test may fail.", stdoutCheckCache.contains(exitString)); return stdoutCheckCache; } /** * Executes reproducer to checks if DownloadServices's management of external jars are working correctly. * @return stdout of reproducer. */ private String runExternalTests() throws Exception { ProcessResult processResult = ServerAccess.executeProcess(manageExternalResources); String stdoutExternalResources = processResult.stdout; Assert.assertTrue("ManageExternalResources - DownloadServiceRunner instance did not close as expected, this test may fail.", stdoutExternalResources.contains(exitString)); return stdoutExternalResources; } /** * Executes reproducer to checks if DownloadServices's management of jnlp jars are working correctly. * @return stdout of reproducer. */ private String runJnlpResourceTests() throws Exception { ProcessResult processResult = ServerAccess.executeProcess(manageJnlpResources); String stdoutJnlpResources = processResult.stdout; Assert.assertTrue("ManageJnlpResources - DownloadServiceRunner instance did not close as expected, this test may fail.", stdoutJnlpResources.contains(exitString)); return stdoutJnlpResources; } @Test public void checkIfRequiredResourcesExist() { //Jnlp files Assert.assertTrue("DownloadService.jnlp is a required resource that's missing.", new File(server.getDir().getAbsolutePath() + "/DownloadService.jnlp").isFile()); Assert.assertTrue("DownloadServiceExtension.jnlp is a required resource that's missing.", new File(server.getDir().getAbsolutePath() + "/DownloadServiceExtension.jnlp").isFile()); //Jar files Assert.assertTrue("DownloadService.jar is a required resource that's missing.", new File(server.getDir().getAbsolutePath() + "/DownloadService.jar").isFile()); Assert.assertTrue("SignedJnlpResource.jar is a required resource that's missing.", new File(server.getDir().getAbsolutePath() + "/SignedJnlpResource.jar").isFile()); Assert.assertTrue("SignedJarResource.jar is a required resource that's missing.", new File(server.getDir().getAbsolutePath() + "/SignedJarResource.jar").isFile()); Assert.assertTrue("MultiJar-NoSignedJnlp.jar is a required resource that's missing.", new File(server.getDir().getAbsolutePath() + "/MultiJar-NoSignedJnlp.jar").isFile()); } @Test public void testcheckCaches() throws Exception { String stdoutCheckCache = runCacheCheckTests(); //Stdout validations String s = "CHECKCACHE-isPartCached: LaunchPartOne: true"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutCheckCache.contains(s)); s = "CHECKCACHE-isPartCached: LaunchPartTwo: true"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutCheckCache.contains(s)); s = "CHECKCACHE-isPartCached: NonExistingPart: false"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutCheckCache.contains(s)); } @Test public void testcheckCachesUsingArray() throws Exception { String stdoutCheckCache = runCacheCheckTests(); //Stdout validations String s = "CHECKCACHEUSINGMUTIPLEPARTS-isPartCached(Array): ValidLaunchParts: true"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutCheckCache.contains(s)); s = "CHECKCACHEUSINGMUTIPLEPARTS-isPartCached(Array): HalfValidLaunchParts: false"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutCheckCache.contains(s)); s = "CHECKCACHEUSINGMUTIPLEPARTS-isPartCached(Array): InvalidParts: false"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutCheckCache.contains(s)); } @Test public void testExtensioncheckCaches() throws Exception { String stdoutCheckCache = runCacheCheckTests(); //Stdout validations String s = "CHECKEXTENSIONCACHE-isExtensionPartCached: ExtensionPartOne: true"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutCheckCache.contains(s)); s = "CHECKEXTENSIONCACHE-isExtensionPartCached: NonExistingPart: false"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutCheckCache.contains(s)); s = "CHECKEXTENSIONCACHE-isExtensionPartCached: NonExistingUrl: false"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutCheckCache.contains(s)); } @Test public void testExtensioncheckCachesUsingArray() throws Exception { String stdoutCheckCache = runCacheCheckTests(); //Stdout validations String s = "CHECKEXTENSIONCACHEUSINGMUTIPLEPARTS-isExtensionPartCached(Array): ValidExtensionParts: true"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutCheckCache.contains(s)); s = "CHECKEXTENSIONCACHEUSINGMUTIPLEPARTS-isExtensionPartCached(Array): HalfValidExtensionParts: false"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutCheckCache.contains(s)); s = "CHECKEXTENSIONCACHEUSINGMUTIPLEPARTS-isExtensionPartCached(Array): InvalidParts: false"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutCheckCache.contains(s)); } @Test public void testExternalResourceChecks() throws Exception { runCacheCheckTests(); String stdoutExternalResources = runExternalTests(); //Stdout validations //This is automatically cached from the test engine because the .jar exists String s = "CHECKEXTERNALCACHE-isResourceCached: UrlToExternalResource: true"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutExternalResources.contains(s)); s = "CHECKEXTERNALCACHE-isResourceCached: NonExistingUrl: false"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutExternalResources.contains(s)); } @Test public void testRemovePart() throws Exception { runCacheCheckTests(); String stdoutJnlpResources = runJnlpResourceTests(); String s = "REMOVEPART-removePart: LaunchPartOne-BEFORE: true"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); s = "REMOVEPART-removePart: LaunchPartOne-AFTER: false"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); s = "REMOVEPART-removePart: LaunchPartTwo-BEFORE: true"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); s = "REMOVEPART-removePart: LaunchPartTwo-AFTER: false"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); } @Test public void testRemoveExtensionPart() throws Exception { runCacheCheckTests(); String stdoutJnlpResources = runJnlpResourceTests(); //Stdout validations String s = "REMOVEEXTENSIONPART-removeExtensionPart: ExtensionPartOne-BEFORE: true"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); s = "REMOVEEXTENSIONPART-removeExtensionPart: ExtensionPartOne-AFTER: false"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); } @Test public void testRemoveExtensionPartUsingArray() throws Exception { runCacheCheckTests(); String stdoutJnlpResources = runJnlpResourceTests(); //Stdout validations String s = "REMOVEEXTENSIONUSINGVALIDPARTINARRAY-removeExtensionPart(Array): ValidExtensionParts-BEFORE: true"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); s = "REMOVEEXTENSIONUSINGVALIDPARTINARRAY-removeExtensionPart(Array): ValidExtensionParts-AFTER: false"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); s = "REMOVEEXTENSIONUSINGHALFVALIDPARTINARRAY-removeExtensionPart(Array): HalfValidExtensionParts-BEFORE: true"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); s = "REMOVEEXTENSIONUSINGHALFVALIDPARTINARRAY-removeExtensionPart(Array): HalfValidExtensionParts-AFTER: false"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); } @Test public void testRemoveExternalResource() throws Exception { runCacheCheckTests(); String stdoutExternalResources = runExternalTests(); //Stdout validations String s = "REMOVEEXTERNALPART-removeResource: UrlToExternalResource-BEFORE: true"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutExternalResources.contains(s)); s = "REMOVEEXTERNALPART-removeResource: UrlToExternalResource-AFTER: false"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutExternalResources.contains(s)); } @Test public void testLoadPart() throws Exception { runCacheCheckTests(); String stdoutJnlpResources = runJnlpResourceTests(); //Stdout validations //Part 'one' String s = "LOADPART-loadPart: LaunchPartOne-BEFORE: false"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); s = "LOADPART-loadPart: LaunchPartOne-AFTER: true"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); //Part 'two' s = "LOADPART-loadPart: LaunchPartTwo-BEFORE: false"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); s = "LOADPART-loadPart: LaunchPartTwo-AFTER: true"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); } @Test public void testLoadExtensionPart() throws Exception { runCacheCheckTests(); String stdoutJnlpResources = runJnlpResourceTests(); //Stdout validations String s = "LOADEXTENSIONPART-loadExtensionPart: ExtensionPartOne-BEFORE: false"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); s = "LOADEXTENSIONPART-loadExtensionPart: ExtensionPartOne-AFTER: true"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); } @Test public void testLoadExtensionPartUsingArray() throws Exception { runCacheCheckTests(); String stdoutJnlpResources = runJnlpResourceTests(); //Stdout validations String s = "LOADEXTENSIONUSINGVALIDPARTINARRAY-loadExtensionPart(Array): ValidExtensionParts-BEFORE: false"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); s = "LOADEXTENSIONUSINGVALIDPARTINARRAY-loadExtensionPart(Array): ValidExtensionParts-AFTER: true"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); s = "LOADEXTENSIONUSINGHALFVALIDPARTINARRAY-loadExtensionPart(Array): HalfValidExtensionParts-BEFORE: false"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); s = "LOADEXTENSIONUSINGHALFVALIDPARTINARRAY-loadExtensionPart(Array): HalfValidExtensionParts-AFTER: true"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); } @Test public void testLoadExternalResource() throws Exception { runCacheCheckTests(); String stdoutExternalResources = runExternalTests(); //Stdout validations String s = "LOADEXTERNALRESOURCE-loadResource: UrlToExternalResource-BEFORE: false"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutExternalResources.contains(s)); s = "LOADEXTERNALRESOURCE-loadResource: UrlToExternalResource-AFTER: true"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutExternalResources.contains(s)); } @Test public void testRepeatedlyLoadingAndUnloadingJnlpResources() throws Exception { runCacheCheckTests(); String stdoutJnlpResources = runJnlpResourceTests(); //Stdout validations String s = "MULTIPLEMETHODCALLS - removePart: LaunchPartOne: false"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); s = "MULTIPLEMETHODCALLS - loadPart: LaunchPartOne: true"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); } @Test public void testRepeatedlyLoadingAndUnloadingExternalResources() throws Exception { runCacheCheckTests(); String stdoutExternalResources = runExternalTests(); //Stdout validations String s = "MULTIPLEMETHODCALLS - removeResource: UrlToExternalResource: false"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutExternalResources.contains(s)); s = "MULTIPLEMETHODCALLS - loadResource: UrlToExternalResource: true"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutExternalResources.contains(s)); } } icedtea-web-1.6.2/tests/reproducers/signed/DownloadService/PaxHeaders.17941/srcs0000644000000000000000000000013212654402377024402 xustar0030 mtime=1454507263.235432608 30 atime=1454507658.777157383 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/DownloadService/srcs/0000755000175000002070000000000012654402377025202 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/DownloadService/srcs/PaxHeaders.17941/DownloadServiceRunn0000644000000000000000000000013112654402377030334 xustar0030 mtime=1454507263.235432608 29 atime=1454507327.24357895 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/DownloadService/srcs/DownloadServiceRunner.java0000644000175000002070000004123412654402377032333 0ustar00jvanekmock00000000000000/* DownloadService.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; import javax.jnlp.DownloadService; import javax.jnlp.ServiceManager; import javax.jnlp.UnavailableServiceException; public class DownloadServiceRunner { URL serverUrl = null; URL extensionUrl = null; URL NonExistingUrl = null; URL urlToExternalResource = null; /** * Launching jnlp and extension jnlp PARTS */ final String launchPartOne = "one"; final String launchPartTwo = "two"; final String extensionPartOne = "extOne"; final String nonExistingPart = "random"; /** * Parts in Array */ final String[] validLaunchParts = { launchPartOne, launchPartTwo }; final String[] halfValidLaunchParts = { launchPartOne, nonExistingPart }; final String[] validExtensionParts = { extensionPartOne }; final String[] halfValidExtensionParts = { extensionPartOne, nonExistingPart }; final String[] invalidParts = { nonExistingPart, "random2" }; private static DownloadService downloadService; static { try { downloadService = (DownloadService) ServiceManager.lookup("javax.jnlp.DownloadService"); } catch (UnavailableServiceException ex) { System.err.println("DownloadService is not available."); } } public DownloadServiceRunner(String urlToServer) throws MalformedURLException, InterruptedException { serverUrl = new URL(urlToServer); extensionUrl = new URL(urlToServer + "DownloadServiceExtension.jnlp"); NonExistingUrl = new URL(urlToServer + "NONEXISTINGFILE.JNLP"); urlToExternalResource = new URL(urlToServer + "EmptySignedJar.jar"); System.out.println(urlToExternalResource.toString()); } /** * Checks the cache status of resources using isPartCached() */ private void checkCache() throws MalformedURLException { System.out.println("CHECKCACHE-isPartCached: LaunchPartOne: " + downloadService.isPartCached(launchPartOne)); System.out.println("CHECKCACHE-isPartCached: LaunchPartTwo: " + downloadService.isPartCached(launchPartTwo)); System.out.println("CHECKCACHE-isPartCached: NonExistingPart: " + downloadService.isPartCached(nonExistingPart)); } /** * Checks the cache status of resources using isPartCached([]) - an array with part names */ private void checkCacheUsingMultipleParts() throws MalformedURLException { System.out.println("CHECKCACHEUSINGMUTIPLEPARTS-isPartCached(Array): ValidLaunchParts: " + downloadService.isPartCached(validLaunchParts)); System.out.println("CHECKCACHEUSINGMUTIPLEPARTS-isPartCached(Array): HalfValidLaunchParts: " + downloadService.isPartCached(halfValidLaunchParts)); System.out.println("CHECKCACHEUSINGMUTIPLEPARTS-isPartCached(Array): InvalidParts: " + downloadService.isPartCached(invalidParts)); } /** * Checks the cache status of extension resources using isExtensionPartCached() */ private void checkExtensionCache() throws MalformedURLException { System.out.println("CHECKEXTENSIONCACHE-isExtensionPartCached: ExtensionPartOne: " + downloadService.isExtensionPartCached(extensionUrl, null, extensionPartOne)); System.out.println("CHECKEXTENSIONCACHE-isExtensionPartCached: NonExistingPart: " + downloadService.isExtensionPartCached(extensionUrl, null, nonExistingPart)); System.out.println("CHECKEXTENSIONCACHE-isExtensionPartCached: NonExistingUrl: " + downloadService.isExtensionPartCached(NonExistingUrl, null, extensionPartOne)); } /** * Checks the cache status of extension resources using isExtensionPartCached([]) - an array with part names */ private void checkExtensionCacheUsingMultipleParts() throws MalformedURLException { System.out.println("CHECKEXTENSIONCACHEUSINGMUTIPLEPARTS-isExtensionPartCached(Array): ValidExtensionParts: " + downloadService.isExtensionPartCached(extensionUrl, null, validExtensionParts)); System.out.println("CHECKEXTENSIONCACHEUSINGMUTIPLEPARTS-isExtensionPartCached(Array): HalfValidExtensionParts: " + downloadService.isExtensionPartCached(extensionUrl, null, halfValidExtensionParts)); System.out.println("CHECKEXTENSIONCACHEUSINGMUTIPLEPARTS-isExtensionPartCached(Array): InvalidParts: " + downloadService.isExtensionPartCached(NonExistingUrl, null, invalidParts)); } /** * Checks the cache status of external (not mentioned in jnlps) resources using isResourceCached() */ private void checkExternalCache() { System.out.println("CHECKEXTERNALCACHE-isResourceCached: UrlToExternalResource: " + downloadService.isResourceCached(urlToExternalResource, null)); System.out.println("CHECKEXTERNALCACHE-isResourceCached: NonExistingUrl: " + downloadService.isResourceCached(NonExistingUrl, null)); } /** * Removes resources from cache using removePart() */ private void removePart() throws IOException { System.out.println("REMOVEPART-removePart: LaunchPartOne-BEFORE: " + downloadService.isPartCached(launchPartOne)); downloadService.removePart(launchPartOne); System.out.println("REMOVEPART-removePart: LaunchPartOne-AFTER: " + downloadService.isPartCached(launchPartOne)); System.out.println("REMOVEPART-removePart: LaunchPartTwo-BEFORE: " + downloadService.isPartCached(launchPartTwo)); downloadService.removePart(launchPartTwo); System.out.println("REMOVEPART-removePart: LaunchPartTwo-AFTER: " + downloadService.isPartCached(launchPartTwo)); } /** * Removes extension resources from cache using isExtensionPartCached() */ private void removeExtensionPart() throws IOException { System.out.println("REMOVEEXTENSIONPART-removeExtensionPart: ExtensionPartOne-BEFORE: " + downloadService.isExtensionPartCached(extensionUrl, null, extensionPartOne)); downloadService.removeExtensionPart(extensionUrl, null, extensionPartOne); System.out.println("REMOVEEXTENSIONPART-removeExtensionPart: ExtensionPartOne-AFTER: " + downloadService.isExtensionPartCached(extensionUrl, null, extensionPartOne)); } /** * Removes extension resources using part array (all parts exist) from cache using isExtensionPartCached() */ private void removeExtensionUsingValidPartInArray() throws IOException { System.out.println("REMOVEEXTENSIONUSINGVALIDPARTINARRAY-removeExtensionPart(Array): ValidExtensionParts-BEFORE: " + downloadService.isExtensionPartCached(extensionUrl, null, extensionPartOne)); downloadService.removeExtensionPart(extensionUrl, null, validExtensionParts); System.out.println("REMOVEEXTENSIONUSINGVALIDPARTINARRAY-removeExtensionPart(Array): ValidExtensionParts-AFTER: " + downloadService.isExtensionPartCached(extensionUrl, null, extensionPartOne)); } /** * Removes extension resources using part array (one part exists, the other one does not) from cache using isExtensionPartCached() */ private void removeExtensionUsingHalfValidPartInArray() throws IOException { System.out.println("REMOVEEXTENSIONUSINGHALFVALIDPARTINARRAY-removeExtensionPart(Array): HalfValidExtensionParts-BEFORE: " + downloadService.isExtensionPartCached(extensionUrl, null, extensionPartOne)); downloadService.removeExtensionPart(extensionUrl, null, halfValidExtensionParts); System.out.println("REMOVEEXTENSIONUSINGHALFVALIDPARTINARRAY-removeExtensionPart(Array): HalfValidExtensionParts-AFTER: " + downloadService.isExtensionPartCached(extensionUrl, null, extensionPartOne)); } /** * Removes external (not mentioned in jnlps) resources from cache using removeResource() */ private void removeExternalResource() throws IOException { System.out.println("REMOVEEXTERNALPART-removeResource: UrlToExternalResource-BEFORE: " + downloadService.isResourceCached(urlToExternalResource, null)); downloadService.removeResource(urlToExternalResource, null); System.out.println("REMOVEEXTERNALPART-removeResource: UrlToExternalResource-AFTER: " + downloadService.isResourceCached(urlToExternalResource, null)); } /** * Loads resources from cache using loadPart() */ private void loadPart() throws IOException { System.out.println("LOADPART-loadPart: LaunchPartOne-BEFORE: " + downloadService.isPartCached(launchPartOne)); downloadService.loadPart(launchPartOne, null); System.out.println("LOADPART-loadPart: LaunchPartOne-AFTER: " + downloadService.isPartCached(launchPartOne)); System.out.println("LOADPART-loadPart: LaunchPartTwo-BEFORE: " + downloadService.isPartCached(launchPartTwo)); downloadService.loadPart(launchPartTwo, null); System.out.println("LOADPART-loadPart: LaunchPartTwo-AFTER: " + downloadService.isPartCached(launchPartTwo)); } /** * Load extension resources from cache using loadExtensionPart() */ private void loadExtensionPart() throws IOException { System.out.println("LOADEXTENSIONPART-loadExtensionPart: ExtensionPartOne-BEFORE: " + downloadService.isExtensionPartCached(extensionUrl, null, extensionPartOne)); downloadService.loadExtensionPart(extensionUrl, null, extensionPartOne, null); System.out.println("LOADEXTENSIONPART-loadExtensionPart: ExtensionPartOne-AFTER: " + downloadService.isExtensionPartCached(extensionUrl, null, extensionPartOne)); } /** * Loads extension resources using part array (all parts exist) from cache using isExtensionPartCached() */ private void loadExtensionUsingValidPartInArray() throws IOException { System.out.println("LOADEXTENSIONUSINGVALIDPARTINARRAY-loadExtensionPart(Array): ValidExtensionParts-BEFORE: " + downloadService.isExtensionPartCached(extensionUrl, null, extensionPartOne)); downloadService.loadExtensionPart(extensionUrl, null, validExtensionParts, null); System.out.println("LOADEXTENSIONUSINGVALIDPARTINARRAY-loadExtensionPart(Array): ValidExtensionParts-AFTER: " + downloadService.isExtensionPartCached(extensionUrl, null, extensionPartOne)); } /** * Loads extension resources using part array (one part exists, the other one does not) from cache using isExtensionPartCached() */ private void loadExtensionUsingHalfValidPartInArray() throws IOException { System.out.println("LOADEXTENSIONUSINGHALFVALIDPARTINARRAY-loadExtensionPart(Array): HalfValidExtensionParts-BEFORE: " + downloadService.isExtensionPartCached(extensionUrl, null, extensionPartOne)); downloadService.loadExtensionPart(extensionUrl, null, halfValidExtensionParts, null); System.out.println("LOADEXTENSIONUSINGHALFVALIDPARTINARRAY-loadExtensionPart(Array): HalfValidExtensionParts-AFTER: " + downloadService.isExtensionPartCached(extensionUrl, null, extensionPartOne)); } /** * Loads external (not mentioned in jnlps) resources from cache using removeResource() */ private void loadExternalResource() throws IOException { System.out.println("LOADEXTERNALRESOURCE-loadResource: UrlToExternalResource-BEFORE: " + downloadService.isResourceCached(urlToExternalResource, null)); downloadService.loadResource(urlToExternalResource, null, null); System.out.println("LOADEXTERNALRESOURCE-loadResource: UrlToExternalResource-AFTER: " + downloadService.isResourceCached(urlToExternalResource, null)); } /** * Repeatedly unloads and loads jars */ private void repeatedlyLoadingAndUnloadingJars() throws IOException { downloadService.removePart(launchPartOne); downloadService.loadPart(launchPartOne, null); downloadService.removePart(launchPartOne); System.out.println("MULTIPLEMETHODCALLS - removePart: LaunchPartOne: " + downloadService.isPartCached(launchPartOne)); downloadService.loadPart(launchPartOne, null); System.out.println("MULTIPLEMETHODCALLS - loadPart: LaunchPartOne: " + downloadService.isPartCached(launchPartOne)); } /** * Repeatedly unloads and loads external jars */ private void repeatedlyLoadingAndUnloadingExternalJars() throws IOException { downloadService.removeResource(urlToExternalResource, null); downloadService.loadResource(urlToExternalResource, null, null); downloadService.removeResource(urlToExternalResource, null); System.out.println("MULTIPLEMETHODCALLS - removeResource: UrlToExternalResource: " + downloadService.isResourceCached(urlToExternalResource, null)); downloadService.loadResource(urlToExternalResource, null, null); System.out.println("MULTIPLEMETHODCALLS - loadResource: UrlToExternalResource: " + downloadService.isResourceCached(urlToExternalResource, null)); } /** * Loads external jar as preparation for external resource testing */ private void prepareExternalResourceTests() { try { if (!downloadService.isResourceCached(urlToExternalResource, null)) downloadService.loadResource(urlToExternalResource, null, null); } catch (Exception e) { //Continue testing // This is okay to ignore as it may be a problem with loadResouce( ), which will be identified within tests } } public static void main(String[] args) throws IOException, InterruptedException { System.out.println("Running DownloadService.."); if (args.length < 2) { System.out.println("Requires 2 arguments: [server_url] [checkCache | manageJars | manageExternalJars]"); System.out.println("Exiting.."); return; } DownloadServiceRunner ds = new DownloadServiceRunner(args[0]); if (args[1].equals("checkCache")) { //Cache Resources ds.checkCache(); ds.checkCacheUsingMultipleParts(); ds.checkExtensionCache(); ds.checkExtensionCacheUsingMultipleParts(); } if (args[1].equals("manageJnlpJars")) { //Remove Resources ds.removePart(); ds.removeExtensionPart(); //Load Resources ds.loadPart(); ds.loadExtensionPart(); //Manage using multiple part arrays ds.removeExtensionUsingValidPartInArray(); ds.loadExtensionUsingValidPartInArray(); ds.removeExtensionUsingHalfValidPartInArray(); ds.loadExtensionUsingHalfValidPartInArray(); //Unloads and loads jars repeatedly ds.repeatedlyLoadingAndUnloadingJars(); } else if (args[1].equals("manageExternalJars")) { ds.prepareExternalResourceTests(); ds.checkExternalCache(); ds.removeExternalResource(); ds.loadExternalResource(); //Unloads and loads jars repeatedly ds.repeatedlyLoadingAndUnloadingExternalJars(); } System.out.println("Exiting DownloadService.."); } } icedtea-web-1.6.2/tests/reproducers/signed/DownloadService/PaxHeaders.17941/resources0000644000000000000000000000013212654402377025442 xustar0030 mtime=1454507263.235432608 30 atime=1454507658.777157383 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/DownloadService/resources/0000755000175000002070000000000012654402377026242 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/DownloadService/resources/PaxHeaders.17941/DownloadServic0000644000000000000000000000013112654402377030364 xustar0030 mtime=1454507263.235432608 29 atime=1454507327.24357895 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/DownloadService/resources/DownloadServiceExtension.jnlp0000644000175000002070000000457712654402377034131 0ustar00jvanekmock00000000000000 DownloadServiceExtension IcedTea DownloadServiceExtension icedtea-web-1.6.2/tests/reproducers/signed/DownloadService/resources/PaxHeaders.17941/DownloadServic0000644000000000000000000000013112654402377030364 xustar0030 mtime=1454507263.235432608 29 atime=1454507327.24357895 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/DownloadService/resources/DownloadService.jnlp0000644000175000002070000000503712654402377032224 0ustar00jvanekmock00000000000000 DownloadService IcedTea DownloadService icedtea-web-1.6.2/tests/reproducers/signed/PaxHeaders.17941/DeploymentPropertiesAreExposed0000644000000000000000000000013212654402377026515 xustar0030 mtime=1454507263.234432621 30 atime=1454507658.777157383 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/DeploymentPropertiesAreExposed/0000755000175000002070000000000012654402377027315 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/DeploymentPropertiesAreExposed/PaxHeaders.17941/testcases0000644000000000000000000000013212654402377030513 xustar0030 mtime=1454507263.234432621 30 atime=1454507658.777157383 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/DeploymentPropertiesAreExposed/testcases/0000755000175000002070000000000012654402377031313 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/DeploymentPropertiesAreExposed/testcases/PaxHeaders.179410000644000000000000000000000033612654402377030521 xustar00133 path=icedtea-web-1.6.2/tests/reproducers/signed/DeploymentPropertiesAreExposed/testcases/DeploymentPropertiesAreExposedTest.java 30 mtime=1454507263.234432621 29 atime=1454507327.24357895 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/DeploymentPropertiesAreExposed/testcases/DeploymentProper0000644000175000002070000000552412654402377034554 0ustar00jvanekmock00000000000000/* DeploymentPropertiesAreExposedTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import static org.junit.Assert.*; import java.io.File; import java.util.Arrays; import java.util.Collections; import java.util.List; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.config.DeploymentConfiguration; import org.junit.Test; public class DeploymentPropertiesAreExposedTest { @Test public void verifyDeploymentConfigrationIsExposedAsSystemProperties() throws Exception { ServerAccess server = new ServerAccess(); List trustCertificates = Arrays.asList(new String[] {"-Xtrustall"}); ProcessResult result = server.executeJavawsHeadless( trustCertificates, "/DeploymentPropertiesAreExposed.jnlp"); DeploymentConfiguration config = JNLPRuntime.getConfiguration(); config.load(); String userLogDir = config.getProperty(DeploymentConfiguration.KEY_USER_LOG_DIR); String expectedRegex = userLogDir + "/?"; String actual = result.stdout.trim(); boolean stdOutMatches = actual.matches(expectedRegex); assertTrue("'" + actual + "' should match '" + expectedRegex + "' but did not", stdOutMatches); } } icedtea-web-1.6.2/tests/reproducers/signed/DeploymentPropertiesAreExposed/PaxHeaders.17941/srcs0000644000000000000000000000013212654402377027467 xustar0030 mtime=1454507263.234432621 30 atime=1454507658.777157383 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/DeploymentPropertiesAreExposed/srcs/0000755000175000002070000000000012654402377030267 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/DeploymentPropertiesAreExposed/srcs/PaxHeaders.17941/Test0000644000000000000000000000013112654402377030405 xustar0030 mtime=1454507263.234432621 29 atime=1454507327.24357895 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/DeploymentPropertiesAreExposed/srcs/Test.java0000644000175000002070000000336412654402377032057 0ustar00jvanekmock00000000000000/* Test.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class Test { public static void main(String[] args) { System.out.println(System.getProperty("deployment.user.logdir")); } } icedtea-web-1.6.2/tests/reproducers/signed/DeploymentPropertiesAreExposed/PaxHeaders.17941/resources0000644000000000000000000000013212654402377030527 xustar0030 mtime=1454507263.234432621 30 atime=1454507658.777157383 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/DeploymentPropertiesAreExposed/resources/0000755000175000002070000000000012654402377031327 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/DeploymentPropertiesAreExposed/resources/PaxHeaders.179410000644000000000000000000000033312654402377030532 xustar00129 path=icedtea-web-1.6.2/tests/reproducers/signed/DeploymentPropertiesAreExposed/resources/DeploymentPropertiesAreExposed.jnlp 30 mtime=1454507263.234432621 30 atime=1454507327.242578963 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/DeploymentPropertiesAreExposed/resources/DeploymentProper0000644000175000002070000000406512654402377034567 0ustar00jvanekmock00000000000000 Verify that deployment configuration properties are exposed IcedTea icedtea-web-1.6.2/tests/reproducers/signed/PaxHeaders.17941/CustomPolicy0000644000000000000000000000013212654402377022772 xustar0030 mtime=1454507263.233432634 30 atime=1454507658.777157383 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/CustomPolicy/0000755000175000002070000000000012654402377023572 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/CustomPolicy/PaxHeaders.17941/testcases0000644000000000000000000000013212654402377024770 xustar0030 mtime=1454507263.233432634 30 atime=1454507658.777157383 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/CustomPolicy/testcases/0000755000175000002070000000000012654402377025570 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/CustomPolicy/testcases/PaxHeaders.17941/CustomPolicyTests0000644000000000000000000000013212654402377030445 xustar0030 mtime=1454507263.234432621 30 atime=1454507327.242578963 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/CustomPolicy/testcases/CustomPolicyTests.java0000644000175000002070000000522112654402377032110 0ustar00jvanekmock00000000000000/* CustomPolicyTests.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.util.Arrays; import java.util.Collections; import java.util.List; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.annotations.Bug; import org.junit.Assert; import org.junit.Test; public class CustomPolicyTests { private ServerAccess server = new ServerAccess(); private static final List TRUSTALL = Collections.unmodifiableList(Arrays.asList(new String[] { "-Xtrustall" })); @Bug(id="1145") @Test public void customPolicyTest() throws Exception { final String expectedACE = "AccessControlException: Cannot set context class loader"; final String expectedOutput = "Program Executed Correctly"; ProcessResult pr = server.executeJavawsHeadless(TRUSTALL, "/CustomPolicy.jnlp"); Assert.assertTrue("Stdout should contain " + expectedACE + " but did not", pr.stdout.contains(expectedACE)); Assert.assertTrue("Stdout should contain " + expectedOutput + " but did not", pr.stdout.contains(expectedOutput)); } } icedtea-web-1.6.2/tests/reproducers/signed/CustomPolicy/PaxHeaders.17941/srcs0000644000000000000000000000013212654402377023744 xustar0030 mtime=1454507263.233432634 30 atime=1454507658.777157383 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/CustomPolicy/srcs/0000755000175000002070000000000012654402377024544 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/CustomPolicy/srcs/PaxHeaders.17941/CustomPolicy.java0000644000000000000000000000013212654402377027316 xustar0030 mtime=1454507263.233432634 30 atime=1454507327.242578963 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/CustomPolicy/srcs/CustomPolicy.java0000644000175000002070000000702312654402377030043 0ustar00jvanekmock00000000000000/* CustomPolicy.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.net.MalformedURLException; import java.net.URL; import java.security.AccessControlContext; import java.security.AccessController; import java.security.cert.Certificate; import java.security.AccessControlException; import java.security.CodeSource; import java.security.PermissionCollection; import java.security.Permissions; import java.security.Policy; import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; import java.security.ProtectionDomain; public class CustomPolicy { public static AccessControlContext strictAccessControlContext() throws MalformedURLException { CodeSource code = new CodeSource(new URL("http://localhost"), (Certificate[]) null); ProtectionDomain pd = new ProtectionDomain(code, new Permissions(), null, null); return new AccessControlContext(new ProtectionDomain[] { pd }); } public static void main(String[] args) throws PrivilegedActionException, MalformedURLException { final Policy defaultPolicy = Policy.getPolicy(); Policy.setPolicy(new Policy() { public PermissionCollection getPermissions(CodeSource codesource) { System.out.println("Loading System here may cause problems."); return defaultPolicy.getPermissions(codesource); } public void refresh() { defaultPolicy.refresh(); } }); try { AccessController.doPrivileged(new PrivilegedExceptionAction() { public Void run() { Thread.currentThread().setContextClassLoader(null); return null; } }, strictAccessControlContext()); } catch (AccessControlException ace) { System.out.println("AccessControlException: Cannot set context class loader"); } System.out.println("Program Executed Correctly"); } } icedtea-web-1.6.2/tests/reproducers/signed/CustomPolicy/PaxHeaders.17941/resources0000644000000000000000000000013212654402377025004 xustar0030 mtime=1454507263.233432634 30 atime=1454507658.777157383 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/CustomPolicy/resources/0000755000175000002070000000000012654402377025604 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/CustomPolicy/resources/PaxHeaders.17941/CustomPolicy.jnlp0000644000000000000000000000013212654402377030400 xustar0030 mtime=1454507263.233432634 30 atime=1454507327.242578963 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/CustomPolicy/resources/CustomPolicy.jnlp0000644000175000002070000000401512654402377031123 0ustar00jvanekmock00000000000000 CustomPolicy IcedTea icedtea-web-1.6.2/tests/reproducers/signed/PaxHeaders.17941/CountingAppletSigned0000644000000000000000000000013212654402377024426 xustar0030 mtime=1454507263.233432634 30 atime=1454507658.777157383 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/CountingAppletSigned/0000755000175000002070000000000012654402377025226 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/CountingAppletSigned/PaxHeaders.17941/srcs0000644000000000000000000000013212654402377025400 xustar0030 mtime=1454507263.233432634 30 atime=1454507658.777157383 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/CountingAppletSigned/srcs/0000755000175000002070000000000012654402377026200 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/CountingAppletSigned/srcs/PaxHeaders.17941/CountingApplet0000644000000000000000000000013212654402377030334 xustar0030 mtime=1454507263.233432634 30 atime=1454507327.242578963 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/CountingAppletSigned/srcs/CountingAppletSigned.java0000644000175000002070000000667712654402377033151 0ustar00jvanekmock00000000000000 import java.applet.Applet; import java.awt.BorderLayout; import javax.swing.JLabel; import javax.swing.SwingUtilities; /* CountingAppletSigned.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class CountingAppletSigned extends Applet { public static void main(String[] args) throws InterruptedException { Integer counter = null; if (args.length > 0) { counter = new Integer(args[0]); ; } int i = 0; while (true) { System.out.println("counting... " + i); if (counter != null && i == counter.intValue()) { System.exit(-i); } i++; Thread.sleep(1000); } } @Override public void init() { System.out.println("applet was initialised"); final CountingAppletSigned self = this; SwingUtilities.invokeLater(new Runnable() { @Override public void run() { self.setLayout(new BorderLayout()); self.add(new JLabel("S")); self.validateTree(); self.repaint(); } }); } @Override public void start() { System.out.println("applet was started"); String s = getParameter("kill"); final String[] params; if (s != null) { params = new String[]{s}; } else { params = new String[0]; } new Thread(new Runnable() { @Override public void run() { try { main(params); } catch (Exception ex) { ex.printStackTrace(); } } }).start(); } @Override public void stop() { System.out.println("applet was stopped"); } @Override public void destroy() { System.out.println("applet will be destroyed"); } } icedtea-web-1.6.2/tests/reproducers/signed/PaxHeaders.17941/CodebasesAttsSigned0000644000000000000000000000013212654402377024216 xustar0030 mtime=1454507263.232432648 30 atime=1454507658.777157383 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/CodebasesAttsSigned/0000755000175000002070000000000012654402377025016 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/CodebasesAttsSigned/PaxHeaders.17941/testcases0000644000000000000000000000013212654402377026214 xustar0030 mtime=1454507263.232432648 30 atime=1454507658.777157383 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/CodebasesAttsSigned/testcases/0000755000175000002070000000000012654402377027014 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/CodebasesAttsSigned/testcases/PaxHeaders.17941/CodebasesA0000644000000000000000000000032112654402377030205 xustar00119 path=icedtea-web-1.6.2/tests/reproducers/signed/CodebasesAttsSigned/testcases/CodebasesAttsSignedDialogsTest1.java 30 mtime=1454507263.232432648 30 atime=1454507327.241578976 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/CodebasesAttsSigned/testcases/CodebasesAttsSignedDialogsT0000644000175000002070000005565512654402377034264 0ustar00jvanekmock00000000000000/* CodebasesAttsSignedNoDialogsTest1.java Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.URL; import java.util.AbstractMap; import java.util.ArrayList; import java.util.Arrays; import java.util.Enumeration; import java.util.List; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; import java.util.zip.ZipOutputStream; import net.sourceforge.jnlp.OptionsDefinitions; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ProcessWrapper; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.ServerLauncher; import net.sourceforge.jnlp.annotations.Bug; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import static net.sourceforge.jnlp.browsertesting.BrowserTest.server; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.AutoErrorClosingListener; import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.ManifestAttributesChecker; import net.sourceforge.jnlp.security.appletextendedsecurity.AppletSecurityLevel; import net.sourceforge.jnlp.tools.DeploymentPropertiesModifier; import net.sourceforge.jnlp.util.FileUtils; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; /** * * null, empty, none, wrong, correct jnlp x html different codebases. * * no dialogs should be appeared. Second testsuite with ALL dialogs (head only) * * */ public class CodebasesAttsSignedDialogsTest1 extends BrowserTest { public static final String appletCloseString = AutoOkClosingListener.MAGICAL_OK_CLOSING_STRING; public static final String[] JAVAWS_HTML_ARRAY = new String[]{OptionsDefinitions.OPTIONS.HTML.option}; public static final List JAVAWS_HTML_LIST = Arrays.asList(JAVAWS_HTML_ARRAY); //disabled - 1.6 specific. We need dialogs to pop up. Anyway, in 1.6 all such tests are disbaled for runtime anyway private static final String[] JAVAWS_HEADLES_ARRAY = new String[]{};//{OptionsDefinitions.OPTIONS.HTML.HEADLESS.option}; private static final List JAVAWS_HEADLES_LIST = Arrays.asList(JAVAWS_HEADLES_ARRAY); public static final String JNLPAPP = "CodebasesAttsSignedApp.jnlp"; public static final String JNLPAPPLET = "CodebasesAttsSignedApplet.jnlp"; public static final String HTML = "CodebasesAttsSigned.html"; public static final String HTMLHREF = "CodebasesAttsSignedJnlpHref.html"; public static final String CodebasesAttsSigned = "CodebasesAttsSigned"; private static ServerLauncher secondValidServer; private static DeploymentPropertiesModifier.MultipleDeploymentPropertiesModifier ensuredDP; public static final String[] files = new String[]{"CodebasesAttsSignedApp.jnlp", "CodebasesAttsSigned.html", "CodebasesAttsSignedApplet.jnlp", "CodebasesAttsSignedJnlpHref.html"}; @BeforeClass public static void initSecondaryServers() throws IOException { secondValidServer = ServerAccess.getIndependentInstanceOnTmpDir(); } @AfterClass public static void stopSecondaryServers() throws IOException { secondValidServer.stop(); } @BeforeClass public static void setProperties() throws IOException { ensuredDP = new DeploymentPropertiesModifier.MultipleDeploymentPropertiesModifier( new AbstractMap.SimpleEntry(DeploymentConfiguration.KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK, ManifestAttributesChecker.MANIFEST_ATTRIBUTES_CHECK.ALL.name()), new AbstractMap.SimpleEntry(DeploymentConfiguration.KEY_SECURITY_LEVEL, AppletSecurityLevel.ASK_UNSIGNED.name()) ); ensuredDP.setProperties(); } @AfterClass public static void resetProperties() throws IOException { ensuredDP.restoreProperties(); } //jar from different source @NeedsDisplay //@Test @Bug(id = "PR2489") public void codebasesAttsSignedTestWorksJnlp1_null_foreignJar() throws Exception { prepareSwapResources(); ProcessWrapper pw = new ProcessWrapper(server.getJavawsLocation(), JAVAWS_HEADLES_LIST, secondValidServer.getUrl(JNLPAPP)); pw.addStdOutListener(new AutoOkClosingListener()); pw.addStdErrListener(new AutoErrorClosingListener()); //pw.setWriter("YES\nYES\nYES\nYES\n"); ProcessResult pr = pw.execute(); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAttsSigned)); Assert.assertTrue(pr.stdout.contains("id: 2")); Assert.assertTrue(pr.stdout.contains("BID0")); } @NeedsDisplay //@Test @Bug(id = "PR2489") public void codebasesAttsSignedTestWorksJnlp2_null_foreignJar() throws Exception { prepareSwapResources(); ProcessWrapper pw = new ProcessWrapper(server.getJavawsLocation(), JAVAWS_HEADLES_LIST, secondValidServer.getUrl(JNLPAPPLET)); pw.addStdOutListener(new AutoOkClosingListener()); pw.addStdErrListener(new AutoErrorClosingListener()); //pw.setWriter("YES\nYES\nYES\nYES\n"); ProcessResult pr = pw.execute(); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAttsSigned)); Assert.assertTrue(pr.stdout.contains("id: 2")); Assert.assertTrue(pr.stdout.contains("BID0")); } @NeedsDisplay //@Test// browsers dont support headless dialogues @TestInBrowsers(testIn = Browsers.one) @Bug(id = "PR2489") public void codebasesAttsSignedTestWorksHtml1_null_foreignJar() throws Exception { prepareSwapResources(); ProcessResult pr = server.executeBrowser(null, secondValidServer.getUrl(HTML), new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAttsSigned)); Assert.assertTrue(pr.stdout.contains("id: 2")); Assert.assertTrue(pr.stdout.contains("BID0")); } @NeedsDisplay //@Test //browsers do not support ehadless dialogues @TestInBrowsers(testIn = Browsers.one) @Bug(id = "PR2489") public void codebasesAttsSignedTestWorksHtml2_null_foreignJar() throws Exception { prepareSwapResources(); ProcessResult pr = server.executeBrowser(null, secondValidServer.getUrl(HTMLHREF), new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAttsSigned)); Assert.assertTrue(pr.stdout.contains("id: 2")); Assert.assertTrue(pr.stdout.contains("BID0")); } @NeedsDisplay //@Test @Bug(id = "PR2489") public void codebasesAttsSignedTestWorksJavawsHtml1_null_foreignJar() throws Exception { prepareSwapResources(); ArrayList HTML_HEADLESS = new ArrayList<>(); HTML_HEADLESS.addAll(JAVAWS_HEADLES_LIST); HTML_HEADLESS.addAll(JAVAWS_HTML_LIST); ProcessWrapper pw = new ProcessWrapper(server.getJavawsLocation(), HTML_HEADLESS, secondValidServer.getUrl(HTML)); pw.addStdOutListener(new AutoOkClosingListener()); pw.addStdErrListener(new AutoErrorClosingListener()); //pw.setWriter("YES\nYES\nYES\nYES\n"); ProcessResult pr = pw.execute(); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAttsSigned)); Assert.assertTrue(pr.stdout.contains("id: 2")); Assert.assertTrue(pr.stdout.contains("BID0")); } @NeedsDisplay //@Test @Bug(id = "PR2489") public void codebasesAttsSignedTestWorksJavawsHtml2_null_foreignJar() throws Exception { prepareSwapResources(); ArrayList HTML_HEADLESS = new ArrayList<>(); HTML_HEADLESS.addAll(JAVAWS_HEADLES_LIST); HTML_HEADLESS.addAll(JAVAWS_HTML_LIST); ProcessWrapper pw = new ProcessWrapper(server.getJavawsLocation(), HTML_HEADLESS, secondValidServer.getUrl(HTMLHREF)); pw.addStdOutListener(new AutoOkClosingListener()); pw.addStdErrListener(new AutoErrorClosingListener()); //pw.setWriter("YES\nYES\nYES\nYES\n"); ProcessResult pr = pw.execute(); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAttsSigned)); Assert.assertTrue(pr.stdout.contains("id: 2")); Assert.assertTrue(pr.stdout.contains("BID0")); } //done cross jars @NeedsDisplay //@Test @Bug(id = "PR2489") //the only alaca one in "normal mode" public void codebasesAttsSignedTestWorksJnlp1_null() throws Exception { prepare(null); ProcessWrapper pw = new ProcessWrapper(server.getJavawsLocation(), JAVAWS_HEADLES_LIST, server.getUrl(JNLPAPP)); pw.addStdOutListener(new AutoOkClosingListener()); pw.addStdErrListener(new AutoErrorClosingListener()); //pw.setWriter("YES\nYES\nYES\nYES\n"); ProcessResult pr = pw.execute(); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAttsSigned)); Assert.assertTrue(pr.stdout.contains("id: 1")); Assert.assertTrue(pr.stdout.contains("BID0")); } @NeedsDisplay //@Test @Bug(id = "PR2489") public void codebasesAttsSignedTestWorksJnlp2_null() throws Exception { prepare(null); ProcessWrapper pw = new ProcessWrapper(server.getJavawsLocation(), JAVAWS_HEADLES_LIST, server.getUrl(JNLPAPPLET)); pw.addStdOutListener(new AutoOkClosingListener()); pw.addStdErrListener(new AutoErrorClosingListener()); //pw.setWriter("YES\nYES\nYES\nYES\n"); ProcessResult pr = pw.execute(); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAttsSigned)); Assert.assertTrue(pr.stdout.contains("id: 1")); Assert.assertTrue(pr.stdout.contains("BID0")); } @NeedsDisplay //@Test // browsers dont support headless dialogues @TestInBrowsers(testIn = Browsers.one) @Bug(id = "PR2489") public void codebasesAttsSignedTestWorksHtml1_null() throws Exception { prepare(null); ProcessResult pr = server.executeBrowser(null, HTML, new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAttsSigned)); Assert.assertTrue(pr.stdout.contains("id: 1")); Assert.assertTrue(pr.stdout.contains("BID0")); } @NeedsDisplay //@Test // browsers do not support ehadless dialogues @TestInBrowsers(testIn = Browsers.one) @Bug(id = "PR2489") public void codebasesAttsSignedTestWorksHtml2_null() throws Exception { prepare(null); ProcessResult pr = server.executeBrowser(null, HTMLHREF, new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAttsSigned)); Assert.assertTrue(pr.stdout.contains("id: 1")); Assert.assertTrue(pr.stdout.contains("BID0")); } @NeedsDisplay //@Test @Bug(id = "PR2489") public void codebasesAttsSignedTestWorksJavawsHtml1_null() throws Exception { prepare(null); ArrayList HTML_HEADLESS = new ArrayList<>(); HTML_HEADLESS.addAll(JAVAWS_HEADLES_LIST); HTML_HEADLESS.addAll(JAVAWS_HTML_LIST); ProcessWrapper pw = new ProcessWrapper(server.getJavawsLocation(), HTML_HEADLESS, server.getUrl(HTML)); pw.addStdOutListener(new AutoOkClosingListener()); pw.addStdErrListener(new AutoErrorClosingListener()); //pw.setWriter("YES\nYES\nYES\nYES\n"); ProcessResult pr = pw.execute(); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAttsSigned)); Assert.assertTrue(pr.stdout.contains("id: 1")); Assert.assertTrue(pr.stdout.contains("BID0")); } @NeedsDisplay //@Test @Bug(id = "PR2489") public void codebasesAttsSignedTestWorksJavawsHtml2_null() throws Exception { prepare(null); ArrayList HTML_HEADLESS = new ArrayList<>(); HTML_HEADLESS.addAll(JAVAWS_HEADLES_LIST); HTML_HEADLESS.addAll(JAVAWS_HTML_LIST); ProcessWrapper pw = new ProcessWrapper(server.getJavawsLocation(), HTML_HEADLESS, server.getUrl(HTMLHREF)); pw.addStdOutListener(new AutoOkClosingListener()); pw.addStdErrListener(new AutoErrorClosingListener()); //pw.setWriter("YES\nYES\nYES\nYES\n"); ProcessResult pr = pw.execute(); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAttsSigned)); Assert.assertTrue(pr.stdout.contains("id: 1")); Assert.assertTrue(pr.stdout.contains("BID0")); } public static void prepare(String codebase) throws IOException { prepare(codebase, codebase); } public static void prepare(String codebase1, String codebase2) throws IOException { prepareSingle(codebase1, null, null, '1', ServerAccess.getInstance().getDir(), files, true); prepareSingle(codebase2, null, null, '2', secondValidServer.getDir(), files, true); } //note, that the modification of jar is breaking signature.. well worthy to add test :) public static void prepareSingle(String codebase, String jnlphref, String jar, char id, File targetDir, String[] files, boolean corrupt) throws IOException { File srcDir = ServerAccess.getInstance().getDir(); for (String file : files) { String s1 = FileUtils.loadFileAsString(new File(srcDir, file + ".in")); if (codebase == null) { s1 = s1.replace("@CODEBASE@", ""); } else { s1 = s1.replace("@CODEBASE@", "codebase=\"" + codebase + "\""); } if (jnlphref == null) { s1 = s1.replace("@JNLPHREF@", "CodebasesAttsSignedApplet.jnlp"); } else { s1 = s1.replace("@JNLPHREF@", jnlphref + "/CodebasesAttsSignedApplet.jnlp"); } if (jar == null) { s1 = s1.replace("@JAR@", "CodebasesAttsSigned"); } else { s1 = s1.replace("@JAR@", jar + "/CodebasesAttsSigned"); } s1 = s1.replace("@ID@", "" + id); FileUtils.saveFile(s1, new File(targetDir, file)); } String n = "CodebasesAttsSigned.jar"; if (!srcDir.equals(targetDir)) { copyJarAndChange(new File(srcDir, n), new File(targetDir, n), id, corrupt); } } /** * This copy zip jar entry by entry, and for one particular class it do BYTE * changes * * @param from * @param to * @param id * @throws FileNotFoundException * @throws IOException */ private static void copyJarAndChange(File from, File to, char id, boolean corruptSignatures) throws FileNotFoundException, IOException { ZipFile original = new ZipFile(from); try (ZipOutputStream outputStream = new ZipOutputStream(new FileOutputStream(to))) { Enumeration entries = original.entries(); byte[] buffer = new byte[512]; while (entries.hasMoreElements()) { ZipEntry entry = (ZipEntry) entries.nextElement(); if (entry.getName().endsWith("CodebasesAttsSigned.class") && corruptSignatures) { ZipEntry newEntry = new ZipEntry(entry.getName()); outputStream.putNextEntry(newEntry); try (InputStream in = original.getInputStream(entry)) { copyStreamAndChange(in, outputStream, id); } } else { ZipEntry newEntry = new ZipEntry(entry.getName()); outputStream.putNextEntry(newEntry); try (InputStream in = original.getInputStream(entry)) { while (0 < in.available()) { int read = in.read(buffer); outputStream.write(buffer, 0, read); } } } outputStream.closeEntry(); } } } /** * This changes bytes BID0 to BID'idchar'. * * @param din * @param dout * @param id * @throws FileNotFoundException * @throws IOException */ private static void copyStreamAndChange(InputStream din, OutputStream dout, char id) throws FileNotFoundException, IOException { int c; final boolean[] BID0 = new boolean[]{false, false, false}; while ((c = din.read()) != -1) { if (c == 'B') { BID0[0] = true; dout.write((byte) c); } else if (c == 'I' && BID0[0]) { BID0[1] = true; dout.write((byte) c); } else if (c == 'D' && BID0[1]) { BID0[2] = true; dout.write((byte) c); } else if (c == '0' && BID0[2]) { dout.write((byte) id); reset(BID0); } else { reset(BID0); dout.write((byte) c); } } } private static void reset(final boolean[] b) { for (int i = 0; i < b.length; i++) { b[i] = false; } } //reading corruptied jars @NeedsDisplay @Test public void codebasesAttsSignedTestWorksJnlp1_null_corruptedJar() throws Exception { prepare(null); ProcessWrapper pw = new ProcessWrapper(server.getJavawsLocation(), JAVAWS_HEADLES_LIST, secondValidServer.getUrl(JNLPAPP)); pw.addStdOutListener(new AutoOkClosingListener()); pw.addStdErrListener(new AutoErrorClosingListener()); ProcessResult pr = pw.execute(); generalFailure(pr); } @NeedsDisplay @Test @Bug(id = "PR2489") public void codebasesAttsSignedTestWorksJnlp2_null_corruptedJar() throws Exception { prepare(null); ProcessWrapper pw = new ProcessWrapper(server.getJavawsLocation(), JAVAWS_HEADLES_LIST, secondValidServer.getUrl(JNLPAPPLET)); pw.addStdOutListener(new AutoOkClosingListener()); pw.addStdErrListener(new AutoErrorClosingListener()); ProcessResult pr = pw.execute(); generalFailure(pr); } @NeedsDisplay @Test // browsers dont support headless dialogues @TestInBrowsers(testIn = Browsers.one) @Bug(id = "PR2489") public void codebasesAttsSignedTestWorksHtml1_null_corruptedJar() throws Exception { prepare(null); ProcessResult pr = server.executeBrowser(null, secondValidServer.getUrl(HTML), new AutoOkClosingListener(), new AutoErrorClosingListener()); generalFailure(pr); } @NeedsDisplay @Test //browsers do not support ehadless dialogues @TestInBrowsers(testIn = Browsers.one) @Bug(id = "PR2489") public void codebasesAttsSignedTestWorksHtml2_null_corruptedJar() throws Exception { prepare(null); ProcessResult pr = server.executeBrowser(null, secondValidServer.getUrl(HTMLHREF), new AutoOkClosingListener(), new AutoErrorClosingListener()); generalFailure(pr); } @NeedsDisplay @Test @Bug(id = "PR2489") public void codebasesAttsSignedTestWorksJavawsHtml1_null_corruptedJar() throws Exception { prepare(null); ArrayList HTML_HEADLESS = new ArrayList<>(); HTML_HEADLESS.addAll(JAVAWS_HEADLES_LIST); HTML_HEADLESS.addAll(JAVAWS_HTML_LIST); ProcessWrapper pw = new ProcessWrapper(server.getJavawsLocation(), HTML_HEADLESS, secondValidServer.getUrl(HTML)); pw.addStdOutListener(new AutoOkClosingListener()); pw.addStdErrListener(new AutoErrorClosingListener()); ProcessResult pr = pw.execute(); generalFailure(pr); } @NeedsDisplay @Test @Bug(id = "PR2489") public void codebasesAttsSignedTestWorksJavawsHtml2_null_corruptedJar() throws Exception { prepare(null); ArrayList HTML_HEADLESS = new ArrayList<>(); HTML_HEADLESS.addAll(JAVAWS_HEADLES_LIST); HTML_HEADLESS.addAll(JAVAWS_HTML_LIST); ProcessWrapper pw = new ProcessWrapper(server.getJavawsLocation(), HTML_HEADLESS, secondValidServer.getUrl(HTMLHREF)); pw.addStdOutListener(new AutoOkClosingListener()); pw.addStdErrListener(new AutoErrorClosingListener()); ProcessResult pr = pw.execute(); generalFailure(pr); } public void generalFailure(String s) { Assert.assertFalse(s.contains(appletCloseString)); Assert.assertFalse(s.contains("id:")); Assert.assertFalse(s.contains("BID")); } private void generalFailure(ProcessResult pr) { generalFailure(pr.stdout); } private void prepareSwapResources() throws IOException { prepareSingle(null, null, secondValidServer.getUrl().toExternalForm(), '1', ServerAccess.getInstance().getDir(), files, true); prepareSingle(null, null, server.getUrl().toExternalForm(), '2', secondValidServer.getDir(), files, true); } } icedtea-web-1.6.2/tests/reproducers/signed/CodebasesAttsSigned/PaxHeaders.17941/srcs0000644000000000000000000000013212654402377025170 xustar0030 mtime=1454507263.232432648 30 atime=1454507658.777157383 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/CodebasesAttsSigned/srcs/0000755000175000002070000000000012654402377025770 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/CodebasesAttsSigned/srcs/PaxHeaders.17941/CodebasesAttsSi0000644000000000000000000000013212654402377030210 xustar0030 mtime=1454507263.232432648 30 atime=1454507327.241578976 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/CodebasesAttsSigned/srcs/CodebasesAttsSigned.java0000644000175000002070000000507112654402377032514 0ustar00jvanekmock00000000000000/* ExtensionJnlpTestApplet.java Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.applet.*; import java.awt.Graphics; /** * * Note that for html's appelt and jnlphreff's jnlp file may have different * codebase. * */ public class CodebasesAttsSigned extends Applet { private static final String appletCloseString = "*** APPLET FINISHED ***"; private static final String bid = "BID0"; public static void main(String... args) { System.out.println("id: "+args[0]); System.out.println("BID: "+bid); System.out.println(CodebasesAttsSigned.class.getName()); System.out.println(appletCloseString); System.out.flush(); System.out.println("some garbage"); } @Override public void init() { } @Override public void start() { main(getParameter("id")); } @Override public void stop() { } @Override public void destroy() { } @Override public void paint(Graphics g) { } } icedtea-web-1.6.2/tests/reproducers/signed/CodebasesAttsSigned/PaxHeaders.17941/resources0000644000000000000000000000013212654402377026230 xustar0030 mtime=1454507263.232432648 30 atime=1454507658.777157383 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/CodebasesAttsSigned/resources/0000755000175000002070000000000012654402377027030 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/CodebasesAttsSigned/resources/PaxHeaders.17941/CodebasesA0000644000000000000000000000032012654402377030220 xustar00118 path=icedtea-web-1.6.2/tests/reproducers/signed/CodebasesAttsSigned/resources/CodebasesAttsSignedJnlpHref.html.in 30 mtime=1454507263.232432648 30 atime=1454507327.241578976 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/CodebasesAttsSigned/resources/CodebasesAttsSignedJnlpHref0000644000175000002070000000347212654402377034270 0ustar00jvanekmock00000000000000 icedtea-web-1.6.2/tests/reproducers/signed/CodebasesAttsSigned/resources/PaxHeaders.17941/CodebasesA0000644000000000000000000000031612654402377030225 xustar00116 path=icedtea-web-1.6.2/tests/reproducers/signed/CodebasesAttsSigned/resources/CodebasesAttsSignedApplet.jnlp.in 30 mtime=1454507263.231432661 30 atime=1454507327.241578976 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/CodebasesAttsSigned/resources/CodebasesAttsSignedApplet.j0000644000175000002070000000431412654402377034231 0ustar00jvanekmock00000000000000 CodebasesAttsSigned IcedTea PR2489 icedtea-web-1.6.2/tests/reproducers/signed/CodebasesAttsSigned/resources/PaxHeaders.17941/CodebasesA0000644000000000000000000000031312654402377030222 xustar00113 path=icedtea-web-1.6.2/tests/reproducers/signed/CodebasesAttsSigned/resources/CodebasesAttsSignedApp.jnlp.in 30 mtime=1454507263.231432661 30 atime=1454507327.241578976 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/CodebasesAttsSigned/resources/CodebasesAttsSignedApp.jnlp0000644000175000002070000000420612654402377034236 0ustar00jvanekmock00000000000000 CodebasesAttsSigned IcedTea PR2489 @ID@ icedtea-web-1.6.2/tests/reproducers/signed/CodebasesAttsSigned/resources/PaxHeaders.17941/CodebasesA0000644000000000000000000000013112654402377030220 xustar0030 mtime=1454507263.231432661 29 atime=1454507327.24057899 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/CodebasesAttsSigned/resources/CodebasesAttsSigned.html.in0000644000175000002070000000344412654402377034206 0ustar00jvanekmock00000000000000 icedtea-web-1.6.2/tests/reproducers/signed/PaxHeaders.17941/CodeBaseManifestEntrySignedNotMatching0000644000000000000000000000013212654402377030004 xustar0030 mtime=1454507263.230432674 30 atime=1454507658.777157383 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedNotMatching/0000755000175000002070000000000012654402377030604 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedNotMatching/PaxHeaders.17941/s0000644000000000000000000000013212654402377030246 xustar0030 mtime=1454507263.231432661 30 atime=1454507658.777157383 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedNotMatching/srcs/0000755000175000002070000000000012654402377031556 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedNotMatching/srcs/PaxHeaders.170000644000000000000000000000013212654402377030520 xustar0030 mtime=1454507263.231432661 30 atime=1454507658.777157383 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedNotMatching/srcs/META-INF/0000755000175000002070000000000012654402377032716 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedNotMatching/srcs/META-INF/PaxH0000644000000000000000000000031612654402377030252 xustar00117 path=icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedNotMatching/srcs/META-INF/MANIFEST.MF 30 mtime=1454507263.231432661 29 atime=1454507327.24057899 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedNotMatching/srcs/META-INF/MANI0000644000175000002070000000017412654402377033367 0ustar00jvanekmock00000000000000Manifest-Version: 1.0 Codebase: somthingWhatShould mustNeverMatch Application-Name: CodeBaseManifestEntrySignedNotMatching icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedNotMatching/srcs/PaxHeaders.170000644000000000000000000000034512654402377030526 xustar00140 path=icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedNotMatching/srcs/CodeBaseManifestEntrySignedNotMatching.java 30 mtime=1454507263.230432674 29 atime=1454507327.24057899 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedNotMatching/srcs/CodeBaseManif0000644000175000002070000000454412654402377034130 0ustar00jvanekmock00000000000000/* ClasspathManifest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.applet.Applet; public class CodeBaseManifestEntrySignedNotMatching extends Applet { private class Killer extends Thread { public int n = 1000; @Override public void run() { try { Thread.sleep(n); System.out.println("Applet killing himself after " + n + " ms of life"); System.exit(0); } catch (Exception ex) { } } } private Killer killer; public static void main(String[] args) { x(); } @Override public void start() { x(); killer = new Killer(); killer.start(); } public static void x() { System.out.println("*** APPLET FINISHED ***"); } } icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedNotMatching/PaxHeaders.17941/r0000644000000000000000000000013212654402377030245 xustar0030 mtime=1454507263.230432674 30 atime=1454507658.777157383 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedNotMatching/resources/0000755000175000002070000000000012654402377032616 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedNotMatching/resources/PaxHeade0000644000000000000000000000035612654402377030775 xustar00149 path=icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedNotMatching/resources/CodeBaseManifestEntrySignedNotMatchingJnlp.html 30 mtime=1454507263.230432674 29 atime=1454507327.24057899 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedNotMatching/resources/CodeBase0000644000175000002070000000354512654402377034215 0ustar00jvanekmock00000000000000 icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedNotMatching/resources/PaxHeade0000644000000000000000000000036012654402377030770 xustar00151 path=icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedNotMatching/resources/CodeBaseManifestEntrySignedNotMatchingApplet.jnlp 30 mtime=1454507263.230432674 29 atime=1454507327.24057899 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedNotMatching/resources/CodeBase0000644000175000002070000000463312654402377034214 0ustar00jvanekmock00000000000000 Classpath Manifest Applet Test IcedTea ClasspathManifest icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedNotMatching/resources/PaxHeade0000644000000000000000000000035212654402377030771 xustar00145 path=icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedNotMatching/resources/CodeBaseManifestEntrySignedNotMatching.jnlp 30 mtime=1454507263.230432674 29 atime=1454507327.24057899 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedNotMatching/resources/CodeBase0000644000175000002070000000443412654402377034213 0ustar00jvanekmock00000000000000 ClasspathManifest IcedTea ClasspathManifest icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedNotMatching/resources/PaxHeade0000644000000000000000000000035312654402377030772 xustar00145 path=icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedNotMatching/resources/CodeBaseManifestEntrySignedNotMatching.html 30 mtime=1454507263.229432688 30 atime=1454507327.239579003 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedNotMatching/resources/CodeBase0000644000175000002070000000357412654402377034217 0ustar00jvanekmock00000000000000 icedtea-web-1.6.2/tests/reproducers/signed/PaxHeaders.17941/CodeBaseManifestEntrySignedMatching0000644000000000000000000000013212654402377027323 xustar0030 mtime=1454507263.228432701 30 atime=1454507658.777157383 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/0000755000175000002070000000000012654402377030123 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/PaxHeaders.17941/test0000644000000000000000000000013212654402377030302 xustar0030 mtime=1454507263.229432688 30 atime=1454507658.777157383 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/testcases/0000755000175000002070000000000012654402377032121 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/testcases/PaxHeaders.0000644000000000000000000000035212654402377030717 xustar00144 path=icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/testcases/CodeBaseManifestEntryUnsignedNotMatching.java 30 mtime=1454507263.229432688 30 atime=1454507327.239579003 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/testcases/CodeBaseMan0000644000175000002070000001573412654402377034157 0ustar00jvanekmock00000000000000/* ClasspathManifestTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.List; import net.sourceforge.jnlp.LaunchException; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; import net.sourceforge.jnlp.closinglisteners.RulesFolowingClosingListener; import net.sourceforge.jnlp.util.FileUtils; import org.junit.Assert; import org.junit.Test; public class CodeBaseManifestEntryUnsignedNotMatching extends BrowserTest { RulesFolowingClosingListener.ContainsRule aokr = new RulesFolowingClosingListener.ContainsRule(AutoOkClosingListener.MAGICAL_OK_CLOSING_STRING); RulesFolowingClosingListener.ContainsRule eekr = new RulesFolowingClosingListener.ContainsRule(LaunchException.class.getSimpleName()); public static final String GENERAL_NAME = "CodeBaseManifestEntry"; public static final String SIGNATURE = "UnsignedNotMatching"; public void checkMessage(ProcessResult pr, int i) { CodeBaseManifestEntrySignedMatching.checkMessage(pr, i); } @NeedsDisplay @Test public void ApplicationJNLPRemoteTest() throws Exception { ProcessResult pr = server.executeJavawsHeadless(null, GENERAL_NAME + SIGNATURE + ".jnlp"); Assert.assertTrue(aokr.toPassingString(), aokr.evaluate(pr.stdout)); checkMessage(pr, 3); } @Test public void ApplicationJNLPLocalTest() throws Exception { List commands = new ArrayList<>(3); commands.add(server.getJavawsLocation()); commands.add(ServerAccess.HEADLES_OPTION); commands.add(GENERAL_NAME + SIGNATURE + ".jnlp"); ProcessResult pr = ServerAccess.executeProcess(commands, server.getDir()); Assert.assertTrue(aokr.toPassingString(), aokr.evaluate(pr.stdout)); checkMessage(pr, 0); } private static void prepareCopyFile() throws IOException { CodeBaseManifestEntrySignedMatching.prepareCopyFile(GENERAL_NAME + SIGNATURE); } @Test public void ApplicationJNLPLocalTestWithRemoteCodebase() throws Exception { prepareCopyFile(); List commands = new ArrayList<>(3); commands.add(server.getJavawsLocation()); commands.add(ServerAccess.HEADLES_OPTION); commands.add(GENERAL_NAME + SIGNATURE + "_copy.jnlp"); ProcessResult pr = ServerAccess.executeProcess(commands, server.getDir()); Assert.assertTrue(aokr.toPassingString(), aokr.evaluate(pr.stdout)); checkMessage(pr, 3); } @NeedsDisplay @Test public void AppletJNLPRemoteTest() throws Exception { ProcessResult pr = server.executeJavawsHeadless(null, GENERAL_NAME + SIGNATURE + "Applet.jnlp"); Assert.assertTrue(aokr.toPassingString(), aokr.evaluate(pr.stdout)); checkMessage(pr, 3); } @NeedsDisplay @Test public void AppletJNLPRLocalTest() throws Exception { List commands = new ArrayList<>(3); commands.add(server.getJavawsLocation()); commands.add(ServerAccess.HEADLES_OPTION); commands.add(GENERAL_NAME + SIGNATURE + "Applet.jnlp"); ProcessResult pr = ServerAccess.executeProcess(commands, server.getDir()); Assert.assertTrue(aokr.toPassingString(), aokr.evaluate(pr.stdout)); checkMessage(pr, 0); } @NeedsDisplay @TestInBrowsers(testIn = {Browsers.one}) @Test public void BrowserJNLPHrefRemoteTest() throws Exception { ProcessResult pr = server.executeBrowser(GENERAL_NAME + SIGNATURE + "Jnlp.html", new AutoOkClosingListener(), new RulesFolowingClosingListener(eekr)); Assert.assertTrue(aokr.toPassingString(), aokr.evaluate(pr.stdout)); checkMessage(pr, 3); } @NeedsDisplay @TestInBrowsers(testIn = {Browsers.one}) @Test public void BrowserJNLPHrefLocalTest() throws Exception { List commands = new ArrayList<>(2); commands.add(server.getBrowserLocation()); commands.add(GENERAL_NAME + SIGNATURE + "Jnlp.html"); ProcessResult pr = ServerAccess.executeProcess(commands, server.getDir(), new AutoOkClosingListener(), null); Assert.assertTrue(aokr.toPassingString(), aokr.evaluate(pr.stdout)); checkMessage(pr, 0); } @NeedsDisplay @TestInBrowsers(testIn = {Browsers.one}) @Test public void BrowserAppletLocalTest() throws Exception { List commands = new ArrayList<>(2); commands.add(server.getBrowserLocation()); commands.add(GENERAL_NAME + SIGNATURE + ".html"); ProcessResult pr = ServerAccess.executeProcess(commands, server.getDir(), new AutoOkClosingListener(), null); Assert.assertTrue(aokr.toPassingString(), aokr.evaluate(pr.stdout)); checkMessage(pr, 0); } @NeedsDisplay @TestInBrowsers(testIn = {Browsers.one}) @Test public void BrowserAppletRemoteTest() throws Exception { ProcessResult pr = server.executeBrowser(GENERAL_NAME + SIGNATURE + ".html", new AutoOkClosingListener(), new RulesFolowingClosingListener(eekr)); Assert.assertTrue(aokr.toPassingString(), aokr.evaluate(pr.stdout)); checkMessage(pr, 3); } } icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/testcases/PaxHeaders.0000644000000000000000000000034712654402377030723 xustar00141 path=icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/testcases/CodeBaseManifestEntryUnsignedMatching.java 30 mtime=1454507263.229432688 30 atime=1454507327.239579003 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/testcases/CodeBaseMan0000644000175000002070000001535612654402377034157 0ustar00jvanekmock00000000000000/* ClasspathManifestTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.List; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; import net.sourceforge.jnlp.closinglisteners.RulesFolowingClosingListener; import net.sourceforge.jnlp.util.FileUtils; import org.junit.Assert; import org.junit.Test; public class CodeBaseManifestEntryUnsignedMatching extends BrowserTest { RulesFolowingClosingListener.ContainsRule aokr = new RulesFolowingClosingListener.ContainsRule(AutoOkClosingListener.MAGICAL_OK_CLOSING_STRING); public static final String GENERAL_NAME = "CodeBaseManifestEntry"; public static final String SIGNATURE = "UnsignedMatching"; public void checkMessage(ProcessResult pr, int i) { CodeBaseManifestEntrySignedMatching.checkMessage(pr, i); } @NeedsDisplay @Test public void ApplicationJNLPRemoteTest() throws Exception { ProcessResult pr = server.executeJavawsHeadless(null, GENERAL_NAME + SIGNATURE + ".jnlp"); Assert.assertTrue(aokr.toPassingString(), aokr.evaluate(pr.stdout)); checkMessage(pr, 2); } @Test public void ApplicationJNLPLocalTest() throws Exception { List commands = new ArrayList<>(3); commands.add(server.getJavawsLocation()); commands.add(ServerAccess.HEADLES_OPTION); commands.add(GENERAL_NAME + SIGNATURE + ".jnlp"); ProcessResult pr = ServerAccess.executeProcess(commands, server.getDir()); Assert.assertTrue(aokr.toPassingString(), aokr.evaluate(pr.stdout)); checkMessage(pr, 0); } private static void prepareCopyFile() throws IOException { CodeBaseManifestEntrySignedMatching.prepareCopyFile(GENERAL_NAME + SIGNATURE); } @Test public void ApplicationJNLPLocalTestWithRemoteCodebase() throws Exception { prepareCopyFile(); List commands = new ArrayList<>(3); commands.add(server.getJavawsLocation()); commands.add(ServerAccess.HEADLES_OPTION); commands.add(GENERAL_NAME + SIGNATURE + "_copy.jnlp"); ProcessResult pr = ServerAccess.executeProcess(commands, server.getDir()); Assert.assertTrue(aokr.toPassingString(), aokr.evaluate(pr.stdout)); checkMessage(pr, 2); } @NeedsDisplay @Test public void AppletJNLPRemoteTest() throws Exception { ProcessResult pr = server.executeJavawsHeadless(null, GENERAL_NAME + SIGNATURE + "Applet.jnlp"); Assert.assertTrue(aokr.toPassingString(), aokr.evaluate(pr.stdout)); checkMessage(pr, 2); } @NeedsDisplay @Test public void AppletJNLPRLocalTest() throws Exception { List commands = new ArrayList<>(3); commands.add(server.getJavawsLocation()); commands.add(ServerAccess.HEADLES_OPTION); commands.add(GENERAL_NAME + SIGNATURE + "Applet.jnlp"); ProcessResult pr = ServerAccess.executeProcess(commands, server.getDir()); Assert.assertTrue(aokr.toPassingString(), aokr.evaluate(pr.stdout)); checkMessage(pr, 0); } @NeedsDisplay @TestInBrowsers(testIn = {Browsers.one}) @Test public void BrowserJNLPHrefRemoteTest() throws Exception { ProcessResult pr = server.executeBrowser(GENERAL_NAME + SIGNATURE + "Jnlp.html", ServerAccess.AutoClose.CLOSE_ON_CORRECT_END); Assert.assertTrue(aokr.toPassingString(), aokr.evaluate(pr.stdout)); checkMessage(pr, 2); } @NeedsDisplay @TestInBrowsers(testIn = {Browsers.one}) @Test public void BrowserJNLPHrefLocalTest() throws Exception { List commands = new ArrayList<>(2); commands.add(server.getBrowserLocation()); commands.add(GENERAL_NAME + SIGNATURE + "Jnlp.html"); ProcessResult pr = ServerAccess.executeProcess(commands, server.getDir(), new AutoOkClosingListener(), null); Assert.assertTrue(aokr.toPassingString(), aokr.evaluate(pr.stdout)); checkMessage(pr, 0); } @NeedsDisplay @TestInBrowsers(testIn = {Browsers.one}) @Test public void BrowserAppletLocalTest() throws Exception { List commands = new ArrayList<>(2); commands.add(server.getBrowserLocation()); commands.add(GENERAL_NAME + SIGNATURE + ".html"); ProcessResult pr = ServerAccess.executeProcess(commands, server.getDir(), new AutoOkClosingListener(), null); Assert.assertTrue(aokr.toPassingString(), aokr.evaluate(pr.stdout)); checkMessage(pr, 0); } @NeedsDisplay @TestInBrowsers(testIn = {Browsers.one}) @Test public void BrowserAppletRemoteTest() throws Exception { ProcessResult pr = server.executeBrowser(GENERAL_NAME + SIGNATURE + ".html", ServerAccess.AutoClose.CLOSE_ON_CORRECT_END); Assert.assertTrue(aokr.toPassingString(), aokr.evaluate(pr.stdout)); checkMessage(pr, 2); } } icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/testcases/PaxHeaders.0000644000000000000000000000035012654402377030715 xustar00142 path=icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/testcases/CodeBaseManifestEntrySignedNotMatching.java 30 mtime=1454507263.228432701 30 atime=1454507327.239579003 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/testcases/CodeBaseMan0000644000175000002070000001617112654402377034153 0ustar00jvanekmock00000000000000/* ClasspathManifestTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.List; import net.sourceforge.jnlp.LaunchException; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; import net.sourceforge.jnlp.closinglisteners.RulesFolowingClosingListener; import net.sourceforge.jnlp.util.FileUtils; import org.junit.Assert; import org.junit.Test; public class CodeBaseManifestEntrySignedNotMatching extends BrowserTest { RulesFolowingClosingListener.ContainsRule aokr = new RulesFolowingClosingListener.ContainsRule(AutoOkClosingListener.MAGICAL_OK_CLOSING_STRING); RulesFolowingClosingListener.ContainsRule eekr = new RulesFolowingClosingListener.ContainsRule(LaunchException.class.getSimpleName()); public static final String GENERAL_NAME = "CodeBaseManifestEntry"; public static final String SIGNATURE = "SignedNotMatching"; public void checkMessage(ProcessResult pr, int i) { CodeBaseManifestEntrySignedMatching.checkMessage(pr, i); } @NeedsDisplay @Test public void ApplicationJNLPRemoteTest() throws Exception { ProcessResult pr = server.executeJavawsHeadless(null, GENERAL_NAME + SIGNATURE + ".jnlp"); Assert.assertTrue(aokr.toPassingString(), aokr.evaluate(pr.stdout)); checkMessage(pr, 6); } @NeedsDisplay @Test public void ApplicationJNLPLocalTest() throws Exception { List commands = new ArrayList<>(3); commands.add(server.getJavawsLocation()); commands.add(ServerAccess.HEADLES_OPTION); commands.add(GENERAL_NAME + SIGNATURE + ".jnlp"); ProcessResult pr = ServerAccess.executeProcess(commands, server.getDir()); Assert.assertTrue(aokr.toPassingString(), aokr.evaluate(pr.stdout)); checkMessage(pr, 0); } private static void prepareCopyFile() throws IOException { CodeBaseManifestEntrySignedMatching.prepareCopyFile(GENERAL_NAME + SIGNATURE); } @Test public void ApplicationJNLPLocalTestWithRemoteCodebase() throws Exception { prepareCopyFile(); List commands = new ArrayList<>(3); commands.add(server.getJavawsLocation()); commands.add(ServerAccess.HEADLES_OPTION); commands.add(GENERAL_NAME + SIGNATURE + "_copy.jnlp"); ProcessResult pr = ServerAccess.executeProcess(commands, server.getDir()); Assert.assertTrue(aokr.toPassingString(), aokr.evaluate(pr.stdout)); checkMessage(pr, 6); } @Test public void AppletJNLPRemoteTest() throws Exception { ProcessResult pr = server.executeJavawsHeadless(null, GENERAL_NAME + SIGNATURE + "Applet.jnlp"); Assert.assertTrue(aokr.toPassingString(), aokr.evaluate(pr.stdout)); checkMessage(pr, 6); } @NeedsDisplay @Test public void AppletJNLPRLocalTest() throws Exception { List commands = new ArrayList<>(3); commands.add(server.getJavawsLocation()); commands.add(ServerAccess.HEADLES_OPTION); commands.add(GENERAL_NAME + SIGNATURE + "Applet.jnlp"); ProcessResult pr = ServerAccess.executeProcess(commands, server.getDir()); Assert.assertTrue(aokr.toPassingString(), aokr.evaluate(pr.stdout)); checkMessage(pr, 0); } @NeedsDisplay @TestInBrowsers(testIn = {Browsers.one}) @Test public void BrowserJNLPHrefRemoteTest() throws Exception { ProcessResult pr = server.executeBrowser(GENERAL_NAME + SIGNATURE + "Jnlp.html", new AutoOkClosingListener(), new RulesFolowingClosingListener(eekr)); Assert.assertFalse(aokr.toFailingString(), aokr.evaluate(pr.stdout)); Assert.assertTrue(eekr.toPassingString(), eekr.evaluate(pr.stderr)); checkMessage(pr, 5); } @NeedsDisplay @TestInBrowsers(testIn = {Browsers.one}) @Test public void BrowserJNLPHrefLocalTest() throws Exception { List commands = new ArrayList<>(2); commands.add(server.getBrowserLocation()); commands.add(GENERAL_NAME + SIGNATURE + "Jnlp.html"); ProcessResult pr = ServerAccess.executeProcess(commands, server.getDir(), new AutoOkClosingListener(), null); Assert.assertTrue(aokr.toPassingString(), aokr.evaluate(pr.stdout)); checkMessage(pr, 0); } @NeedsDisplay @TestInBrowsers(testIn = {Browsers.one}) @Test public void BrowserAppletLocalTest() throws Exception { List commands = new ArrayList<>(2); commands.add(server.getBrowserLocation()); commands.add(GENERAL_NAME + SIGNATURE + ".html"); ProcessResult pr = ServerAccess.executeProcess(commands, server.getDir(), new AutoOkClosingListener(), null); Assert.assertTrue(aokr.toPassingString(), aokr.evaluate(pr.stdout)); checkMessage(pr, 0); } @NeedsDisplay @TestInBrowsers(testIn = {Browsers.one}) @Test public void BrowserAppletRemoteTest() throws Exception { ProcessResult pr = server.executeBrowser(GENERAL_NAME + SIGNATURE + ".html", new AutoOkClosingListener(), new RulesFolowingClosingListener(eekr)); Assert.assertFalse(aokr.toFailingString(), aokr.evaluate(pr.stdout)); Assert.assertTrue(eekr.toPassingString(), eekr.evaluate(pr.stderr)); checkMessage(pr, 5); } } icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/testcases/PaxHeaders.0000644000000000000000000000034512654402377030721 xustar00139 path=icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/testcases/CodeBaseManifestEntrySignedMatching.java 30 mtime=1454507263.228432701 30 atime=1454507327.239579003 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/testcases/CodeBaseMan0000644000175000002070000002214212654402377034146 0ustar00jvanekmock00000000000000/* ClasspathManifestTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.List; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; import net.sourceforge.jnlp.closinglisteners.RulesFolowingClosingListener; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.ManifestAttributesChecker; import net.sourceforge.jnlp.tools.DeploymentPropertiesModifier; import net.sourceforge.jnlp.util.FileUtils; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; public class CodeBaseManifestEntrySignedMatching extends BrowserTest { RulesFolowingClosingListener.ContainsRule aokr = new RulesFolowingClosingListener.ContainsRule(AutoOkClosingListener.MAGICAL_OK_CLOSING_STRING); public static final String GENERAL_NAME = "CodeBaseManifestEntry"; public static final String SIGNATURE = "SignedMatching"; public static final String[] keys = { /*0*/"CBCheckFile", /*1*/ "CBCheckNoEntry", /*2*/ "CBCheckUnsignedPass", /*3*/ "CBCheckUnsignedFail", /*4*/ "CBCheckOkSignedOk", /*5*/ "CBCheckSignedAppletDontMatchException", /*6*/ "CBCheckSignedFail"}; private static DeploymentPropertiesModifier codebaseModifier; @BeforeClass public static void setupDeploymentProperties() throws IOException { codebaseModifier = new DeploymentPropertiesModifier(); codebaseModifier.setProperties(DeploymentConfiguration.KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK, ManifestAttributesChecker.MANIFEST_ATTRIBUTES_CHECK.CODEBASE.toString()); } @AfterClass public static void setbackDeploymentProperties() throws IOException { codebaseModifier.restoreProperties(); } public static String getMessage(int i) { try { String s = "";//_cs, _de, _pl PropertyResourceBundle props = new PropertyResourceBundle(CodeBaseManifestEntrySignedMatching.class.getResourceAsStream("/net/sourceforge/jnlp/resources/Messages" + s + ".properties")); //Bundle messages need to be formatted return MessageFormat.format(props.getString(keys[i]), new Object[0]); } catch (IOException ex) { throw new RuntimeException(ex); } } //may broke if run on non default locales //as those messages are localised public static final boolean CHECK_MESSAGES = true; public static void checkMessage(ProcessResult pr, int i) { if (CHECK_MESSAGES) { String m = getMessage(i).substring(0, 60);//there are variables in some cases, so cut it before boolean stdout = pr.stdout.contains(m); boolean stderr = pr.stderr.contains(m); Assert.assertTrue("result should contains " + m + " have not", stderr || stdout); } } @NeedsDisplay @Test public void ApplicationJNLPRemoteTest() throws Exception { ProcessResult pr = server.executeJavawsHeadless(null, GENERAL_NAME + SIGNATURE + ".jnlp"); Assert.assertTrue(aokr.toPassingString(), aokr.evaluate(pr.stdout)); checkMessage(pr, 4); } @Test public void ApplicationJNLPLocalTest() throws Exception { List commands = new ArrayList(3); commands.add(server.getJavawsLocation()); commands.add(ServerAccess.HEADLES_OPTION); commands.add(GENERAL_NAME + SIGNATURE + ".jnlp"); ProcessResult pr = ServerAccess.executeProcess(commands, server.getDir()); Assert.assertTrue(aokr.toPassingString(), aokr.evaluate(pr.stdout)); checkMessage(pr, 0); } public static void prepareCopyFile(String s) throws IOException { String orig = FileUtils.loadFileAsString(new File(server.getDir() + "/" + s + ".jnlp")); String processed = orig.replace("codebase=\".\"", "codebase=\"" + server.getUrl().toExternalForm() + "\""); FileUtils.saveFile(processed, new File(server.getDir() + "/" + s + "_copy.jnlp")); } private static void prepareCopyFile() throws IOException { prepareCopyFile(GENERAL_NAME + SIGNATURE); } @Test public void ApplicationJNLPLocalTestWithRemoteCodebase() throws Exception { prepareCopyFile(); List commands = new ArrayList(3); commands.add(server.getJavawsLocation()); commands.add(ServerAccess.HEADLES_OPTION); commands.add(GENERAL_NAME + SIGNATURE + "_copy.jnlp"); ProcessResult pr = ServerAccess.executeProcess(commands, server.getDir()); Assert.assertTrue(aokr.toPassingString(), aokr.evaluate(pr.stdout)); checkMessage(pr, 4); } @NeedsDisplay @Test public void AppletJNLPRemoteTest() throws Exception { ProcessResult pr = server.executeJavawsHeadless(null, GENERAL_NAME + SIGNATURE + "Applet.jnlp"); Assert.assertTrue(aokr.toPassingString(), aokr.evaluate(pr.stdout)); checkMessage(pr, 4); } @NeedsDisplay @Test public void AppletJNLPRLocalTest() throws Exception { List commands = new ArrayList(3); commands.add(server.getJavawsLocation()); commands.add(ServerAccess.HEADLES_OPTION); commands.add(GENERAL_NAME + SIGNATURE + "Applet.jnlp"); ProcessResult pr = ServerAccess.executeProcess(commands, server.getDir()); Assert.assertTrue(aokr.toPassingString(), aokr.evaluate(pr.stdout)); checkMessage(pr, 0); } @NeedsDisplay @TestInBrowsers(testIn = {Browsers.one}) @Test public void BrowserJNLPHrefRemoteTest() throws Exception { ProcessResult pr = server.executeBrowser(GENERAL_NAME + SIGNATURE + "Jnlp.html", ServerAccess.AutoClose.CLOSE_ON_CORRECT_END); Assert.assertTrue(aokr.toPassingString(), aokr.evaluate(pr.stdout)); checkMessage(pr, 4); } @NeedsDisplay @TestInBrowsers(testIn = {Browsers.one}) @Test public void BrowserJNLPHrefLocalTest() throws Exception { List commands = new ArrayList(2); commands.add(server.getBrowserLocation()); commands.add(GENERAL_NAME + SIGNATURE + "Jnlp.html"); ProcessResult pr = ServerAccess.executeProcess(commands, server.getDir(), new AutoOkClosingListener(), null); Assert.assertTrue(aokr.toPassingString(), aokr.evaluate(pr.stdout)); checkMessage(pr, 0); } @NeedsDisplay @TestInBrowsers(testIn = {Browsers.one}) @Test public void BrowserAppletLocalTest() throws Exception { List commands = new ArrayList(2); commands.add(server.getBrowserLocation()); commands.add(GENERAL_NAME + SIGNATURE + ".html"); ProcessResult pr = ServerAccess.executeProcess(commands, server.getDir(), new AutoOkClosingListener(), null); Assert.assertTrue(aokr.toPassingString(), aokr.evaluate(pr.stdout)); checkMessage(pr, 0); } @NeedsDisplay @TestInBrowsers(testIn = {Browsers.one}) @Test public void BrowserAppletRemoteTest() throws Exception { ProcessResult pr = server.executeBrowser(GENERAL_NAME + SIGNATURE + ".html", ServerAccess.AutoClose.CLOSE_ON_CORRECT_END); Assert.assertTrue(aokr.toPassingString(), aokr.evaluate(pr.stdout)); checkMessage(pr, 4); } } icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/PaxHeaders.17941/srcs0000644000000000000000000000013212654402377030275 xustar0030 mtime=1454507263.228432701 30 atime=1454507658.777157383 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/srcs/0000755000175000002070000000000012654402377031075 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/srcs/PaxHeaders.179410000644000000000000000000000013212654402377030275 xustar0030 mtime=1454507263.228432701 30 atime=1454507658.777157383 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/srcs/META-INF/0000755000175000002070000000000012654402377032235 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/srcs/META-INF/PaxHead0000644000000000000000000000031412654402377030241 xustar00114 path=icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/srcs/META-INF/MANIFEST.MF 30 mtime=1454507263.228432701 30 atime=1454507327.239579003 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/srcs/META-INF/MANIFES0000644000175000002070000000017212654402377033242 0ustar00jvanekmock00000000000000Manifest-Version: 1.0 Codebase: http://localhost https://localhost Application-Name: CodeBaseManifestEntrySignedMatching icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/srcs/PaxHeaders.179410000644000000000000000000000034012654402377030276 xustar00134 path=icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/srcs/CodeBaseManifestEntrySignedMatching.java 30 mtime=1454507263.227432714 30 atime=1454507327.239579003 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/srcs/CodeBaseManifest0000644000175000002070000000454112654402377034160 0ustar00jvanekmock00000000000000/* ClasspathManifest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.applet.Applet; public class CodeBaseManifestEntrySignedMatching extends Applet { private class Killer extends Thread { public int n = 1000; @Override public void run() { try { Thread.sleep(n); System.out.println("Applet killing himself after " + n + " ms of life"); System.exit(0); } catch (Exception ex) { } } } private Killer killer; public static void main(String[] args) { x(); } @Override public void start() { x(); killer = new Killer(); killer.start(); } public static void x() { System.out.println("*** APPLET FINISHED ***"); } } icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/PaxHeaders.17941/reso0000644000000000000000000000013212654402377030273 xustar0030 mtime=1454507263.227432714 30 atime=1454507658.777157383 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/resources/0000755000175000002070000000000012654402377032135 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/resources/PaxHeaders.0000644000000000000000000000035112654402377030732 xustar00143 path=icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/resources/CodeBaseManifestEntrySignedMatchingJnlp.html 30 mtime=1454507263.227432714 30 atime=1454507327.238579016 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/resources/CodeBaseMan0000644000175000002070000000353712654402377034171 0ustar00jvanekmock00000000000000 icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/resources/PaxHeaders.0000644000000000000000000000035312654402377030734 xustar00145 path=icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/resources/CodeBaseManifestEntrySignedMatchingApplet.jnlp 30 mtime=1454507263.227432714 30 atime=1454507327.238579016 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/resources/CodeBaseMan0000644000175000002070000000461712654402377034171 0ustar00jvanekmock00000000000000 Classpath Manifest Applet Test IcedTea ClasspathManifest icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/resources/PaxHeaders.0000644000000000000000000000034512654402377030735 xustar00139 path=icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/resources/CodeBaseManifestEntrySignedMatching.jnlp 30 mtime=1454507263.227432714 30 atime=1454507327.238579016 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/resources/CodeBaseMan0000644000175000002070000000442312654402377034164 0ustar00jvanekmock00000000000000 ClasspathManifest IcedTea ClasspathManifest icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/resources/PaxHeaders.0000644000000000000000000000034512654402377030735 xustar00139 path=icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/resources/CodeBaseManifestEntrySignedMatching.html 30 mtime=1454507263.226432728 30 atime=1454507327.238579016 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/resources/CodeBaseMan0000644000175000002070000000356612654402377034173 0ustar00jvanekmock00000000000000 icedtea-web-1.6.2/tests/reproducers/signed/PaxHeaders.17941/ClipboardContentSigned0000644000000000000000000000013212654402377024724 xustar0030 mtime=1454507263.226432728 30 atime=1454507658.777157383 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/ClipboardContentSigned/0000755000175000002070000000000012654402377025524 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/ClipboardContentSigned/PaxHeaders.17941/testcases0000644000000000000000000000013212654402377026722 xustar0030 mtime=1454507263.226432728 30 atime=1454507658.777157383 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/ClipboardContentSigned/testcases/0000755000175000002070000000000012654402377027522 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/ClipboardContentSigned/testcases/PaxHeaders.17941/Clipboa0000644000000000000000000000032012654402377030272 xustar00118 path=icedtea-web-1.6.2/tests/reproducers/signed/ClipboardContentSigned/testcases/ClipboardContentSignedTests.java 30 mtime=1454507263.226432728 30 atime=1454507327.238579016 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/ClipboardContentSigned/testcases/ClipboardContentSignedTe0000644000175000002070000001323112654402377034322 0ustar00jvanekmock00000000000000/* ClipboardContentSignedTests.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.util.Arrays; import java.util.Collections; import java.util.List; import net.sourceforge.jnlp.ContentReaderListener; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.annotations.Bug; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.tools.AsyncJavaws; import static net.sourceforge.jnlp.tools.ClipboardHelpers.pasteFromClipboard; import static net.sourceforge.jnlp.tools.ClipboardHelpers.putToClipboard; import net.sourceforge.jnlp.tools.WaitingForStringProcess; import org.junit.Assert; import org.junit.Test; @Bug(id = "PR708") public class ClipboardContentSignedTests { private static final String contentC = "COPY#$REPRODUCER"; private static final String contentP = "PASTE#$REPRODUCER"; private static final String emptyContent = "empty content"; private static ServerAccess server = new ServerAccess(); private static final List javawsTrustArg = Collections.unmodifiableList(Arrays.asList(new String[]{"-Xtrustall"})); @Test public void assertClipboardIsWorking() throws Exception { putToClipboard(emptyContent); Assert.assertEquals("Clipboard must contain new value, did not", emptyContent, pasteFromClipboard()); putToClipboard(contentC); Assert.assertEquals("Clipboard must contain new value, did not", contentC, pasteFromClipboard()); } @Test @Bug(id = "PR708") public void ClipboardContentSignedTestCopy1() throws Exception { putToClipboard(emptyContent); Assert.assertEquals("Clipboard must contain new value, did not", emptyContent, pasteFromClipboard()); WaitingForStringProcess wfsp = new WaitingForStringProcess(server, "/ClipboardContentSignedCopy1.jnlp", javawsTrustArg, true, "copied"); wfsp.run(); String ss = pasteFromClipboard(); Assert.assertEquals("Clipboard must contain new value, did not", contentC, ss); } @Test @Bug(id = "PR708") @NeedsDisplay public void ClipboardContentSignedTestCopy2() throws Exception { putToClipboard(emptyContent); Assert.assertEquals("Clipboard must contain new value, did not", emptyContent, pasteFromClipboard()); WaitingForStringProcess wfsp = new WaitingForStringProcess(server, "/ClipboardContentSignedCopy2.jnlp", javawsTrustArg, false, "copied"); wfsp.run(); String ss = pasteFromClipboard(); Assert.assertEquals("Clipboard must contain new value, did not", contentC, ss); } @Test @Bug(id = "PR708") public void ClipboardContentSignedTestPaste1() throws Exception { //necessery errasing putToClipboard(emptyContent); Assert.assertEquals("Clipboard must contain new value, did not", emptyContent, pasteFromClipboard()); //now put the tested data putToClipboard(contentP); Assert.assertEquals("Clipboard must contain new value, did not", contentP, pasteFromClipboard()); ProcessResult pr = server.executeJavawsHeadless(javawsTrustArg, "/ClipboardContentSignedPaste1.jnlp"); Assert.assertTrue("ClipboardContentSignedTestPaste stdout should contain " + contentP + " but didn't", pr.stdout.contains(contentP)); } @Test @Bug(id = "PR708") @NeedsDisplay public void ClipboardContentSignedTestPaste2() throws Exception { //necessery errasing putToClipboard(emptyContent); Assert.assertEquals("Clipboard must contain new value, did not", emptyContent, pasteFromClipboard()); //now put the tested data putToClipboard(contentP); Assert.assertEquals("Clipboard must contain new value, did not", contentP, pasteFromClipboard()); Assert.assertEquals("Clipboard must contain new value, did not", contentP, pasteFromClipboard()); ProcessResult pr = server.executeJavaws(javawsTrustArg, "/ClipboardContentSignedPaste2.jnlp"); Assert.assertTrue("ClipboardContentSignedTestPaste stdout should contain " + contentP + " but didn't", pr.stdout.contains(contentP)); } } icedtea-web-1.6.2/tests/reproducers/signed/ClipboardContentSigned/PaxHeaders.17941/srcs0000644000000000000000000000013212654402377025676 xustar0030 mtime=1454507263.226432728 30 atime=1454507658.777157383 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/ClipboardContentSigned/srcs/0000755000175000002070000000000012654402377026476 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/ClipboardContentSigned/srcs/PaxHeaders.17941/ClipboardCon0000644000000000000000000000013212654402377030235 xustar0030 mtime=1454507263.226432728 30 atime=1454507327.238579016 30 ctime=1454507658.762157583 icedtea-web-1.6.2/tests/reproducers/signed/ClipboardContentSigned/srcs/ClipboardContentSigned.java0000644000175000002070000001621512654402377033732 0ustar00jvanekmock00000000000000/* ClipboardContentSigned.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.awt.Toolkit; import java.awt.datatransfer.Clipboard; import java.awt.datatransfer.DataFlavor; import java.awt.datatransfer.StringSelection; import java.awt.datatransfer.Transferable; import java.awt.datatransfer.UnsupportedFlavorException; import java.io.IOException; import java.lang.reflect.InvocationTargetException; import java.util.concurrent.TimeUnit; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JTextField; import javax.swing.SwingUtilities; import javax.swing.text.JTextComponent; public class ClipboardContentSigned extends JPanel { private static final String contentC = "COPY#$REPRODUCER"; private static final String contentP = "PASTE#$REPRODUCER"; private static class LocalFrame extends JFrame { JTextField t; public LocalFrame(String str) { super(); t = new JTextField(str); this.add(t); this.setSize(100, 100); this.pack(); t.selectAll(); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } public void run() throws InterruptedException { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { setVisible(true); } }); while (!this.isVisible()) { Thread.sleep(100); } } public JTextField getT() { return t; } } public void putToClipboard1(String str) { Toolkit toolkit = Toolkit.getDefaultToolkit(); Clipboard clipboard = toolkit.getSystemClipboard(); StringSelection strSel = new StringSelection(str); clipboard.setContents(strSel, null); printFlavors(); } public void putToClipboard2(final String str) throws InterruptedException, NoSuchMethodException, IllegalAccessException, UnsupportedFlavorException, IllegalArgumentException, InvocationTargetException, IOException { final LocalFrame lf = new LocalFrame(str); lf.run(); ((JTextComponent) (lf.getT())).copy(); printFlavors(); lf.dispose(); } public String pasteFromClipboard2() throws InterruptedException, NoSuchMethodException, IllegalAccessException, UnsupportedFlavorException, IllegalArgumentException, InvocationTargetException, IOException { final LocalFrame lf = new LocalFrame("xxx"); lf.run(); ((JTextComponent) (lf.getT())).paste(); printFlavors(); String s = lf.getT().getText(); lf.dispose(); return s; } private void printFlavors() { //just for debugging // Toolkit toolkit = Toolkit.getDefaultToolkit(); // Clipboard clipboard = toolkit.getSystemClipboard(); // Transferable clipData = clipboard.getContents(clipboard); // DataFlavor[] cd = clipData.getTransferDataFlavors(); // for (DataFlavor dataFlavor : cd) { // System.out.println(dataFlavor.getMimeType()); // } } public String pasteFromClipboard1() throws UnsupportedFlavorException, IOException { Toolkit toolkit = Toolkit.getDefaultToolkit(); Clipboard clipboard = toolkit.getSystemClipboard(); Transferable clipData = clipboard.getContents(clipboard); printFlavors(); String s = (String) (clipData.getTransferData( DataFlavor.stringFlavor)); return s; } public static void main(String[] args) throws Exception { ClipboardContentSigned cl = new ClipboardContentSigned(); if (args.length == 0) { throw new IllegalArgumentException("at least copy1|2 or paste1|2 must be as argument (+mandatory number giving use timeout in seconds before termination)"); } else if (args.length == 1) { cl.proceed(args[0]); } else { cl.proceed(args[0], args[1]); } } public void proceed(String arg) throws Exception { proceed(arg, 0); } public void proceed(String arg, String keepAliveFor) throws Exception { proceed(arg, Long.valueOf(keepAliveFor)); } public void proceed(String arg, long timeOut) throws Exception { if (arg.equals("copy1")) { System.out.println(this.getClass().getName() + " copying1 to clipboard " + contentC); putToClipboard1(contentC); System.out.println(this.getClass().getName() + " copied1 to clipboard " + pasteFromClipboard1()); } else if (arg.equals("paste1")) { System.out.println(this.getClass().getName() + " pasting1 from clipboard "); String nwContent = pasteFromClipboard1(); System.out.println(this.getClass().getName() + " pasted1 from clipboard " + nwContent); } else if (arg.equals("copy2")) { System.out.println(this.getClass().getName() + " copying2 to clipboard " + contentC); putToClipboard2(contentC); System.out.println(this.getClass().getName() + " copied2 to clipboard " + pasteFromClipboard2()); } else if (arg.equals("paste2")) { System.out.println(this.getClass().getName() + " pasting2 from clipboard "); String nwContent = pasteFromClipboard2(); System.out.println(this.getClass().getName() + " pasted2 from clipboard " + nwContent); } else { throw new IllegalArgumentException("supported copy1|2 paste1|2"); } long start = System.nanoTime(); while (TimeUnit.NANOSECONDS.toSeconds(System.nanoTime() - start) < timeOut) { Thread.sleep(500); } } } icedtea-web-1.6.2/tests/reproducers/signed/ClipboardContentSigned/PaxHeaders.17941/resources0000644000000000000000000000013212654402377026736 xustar0030 mtime=1454507263.225432741 30 atime=1454507658.777157383 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/ClipboardContentSigned/resources/0000755000175000002070000000000012654402377027536 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/ClipboardContentSigned/resources/PaxHeaders.17941/Clipboa0000644000000000000000000000032012654402377030306 xustar00119 path=icedtea-web-1.6.2/tests/reproducers/signed/ClipboardContentSigned/resources/ClipboardContentSignedPaste2.jnlp 30 mtime=1454507263.225432741 29 atime=1454507327.23757903 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/ClipboardContentSigned/resources/ClipboardContentSignedPa0000644000175000002070000000445312654402377034334 0ustar00jvanekmock00000000000000 ClipboardContentSignedPaste2 IcedTea ClipboardContentSignedPaste2 paste2 icedtea-web-1.6.2/tests/reproducers/signed/ClipboardContentSigned/resources/PaxHeaders.17941/Clipboa0000644000000000000000000000032012654402377030306 xustar00119 path=icedtea-web-1.6.2/tests/reproducers/signed/ClipboardContentSigned/resources/ClipboardContentSignedPaste1.jnlp 30 mtime=1454507263.225432741 29 atime=1454507327.23757903 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/ClipboardContentSigned/resources/ClipboardContentSignedPa0000644000175000002070000000445312654402377034334 0ustar00jvanekmock00000000000000 ClipboardContentSignedPaste1 IcedTea ClipboardContentSignedPaste1 paste1 icedtea-web-1.6.2/tests/reproducers/signed/ClipboardContentSigned/resources/PaxHeaders.17941/Clipboa0000644000000000000000000000031712654402377030314 xustar00118 path=icedtea-web-1.6.2/tests/reproducers/signed/ClipboardContentSigned/resources/ClipboardContentSignedCopy2.jnlp 30 mtime=1454507263.225432741 29 atime=1454507327.23757903 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/ClipboardContentSigned/resources/ClipboardContentSignedCo0000644000175000002070000000450712654402377034335 0ustar00jvanekmock00000000000000 ClipboardContentSignedCopy2 IcedTea ClipboardContentSignedCopy2 copy2 10 icedtea-web-1.6.2/tests/reproducers/signed/ClipboardContentSigned/resources/PaxHeaders.17941/Clipboa0000644000000000000000000000031712654402377030314 xustar00118 path=icedtea-web-1.6.2/tests/reproducers/signed/ClipboardContentSigned/resources/ClipboardContentSignedCopy1.jnlp 30 mtime=1454507263.225432741 29 atime=1454507327.23757903 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/ClipboardContentSigned/resources/ClipboardContentSignedCo0000644000175000002070000000450712654402377034335 0ustar00jvanekmock00000000000000 ClipboardContentSignedCopy1 IcedTea ClipboardContentSignedCopy1 copy1 10 icedtea-web-1.6.2/tests/reproducers/signed/PaxHeaders.17941/ClasspathManifestTest0000644000000000000000000000013212654402377024611 xustar0030 mtime=1454507263.224432754 30 atime=1454507658.777157383 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/ClasspathManifestTest/0000755000175000002070000000000012654402377025411 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/ClasspathManifestTest/PaxHeaders.17941/testcases0000644000000000000000000000013212654402377026607 xustar0030 mtime=1454507263.224432754 30 atime=1454507658.777157383 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/ClasspathManifestTest/testcases/0000755000175000002070000000000012654402377027407 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/ClasspathManifestTest/testcases/PaxHeaders.17941/Classpat0000644000000000000000000000031012654402377030357 xustar00111 path=icedtea-web-1.6.2/tests/reproducers/signed/ClasspathManifestTest/testcases/ClasspathManifestTest.java 30 mtime=1454507263.224432754 29 atime=1454507327.23757903 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/ClasspathManifestTest/testcases/ClasspathManifestTest.jav0000644000175000002070000002234512654402377034370 0ustar00jvanekmock00000000000000/* ClasspathManifestTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.List; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.browsertesting.browsers.firefox.FirefoxProfilesOperator; import net.sourceforge.jnlp.util.FileUtils; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; public class ClasspathManifestTest extends BrowserTest { private static final String s1 = "Searching for CheckForClasspath."; private static final String s2 = "CheckForClasspath found on classpath."; private static final String ss = "xception"; private static final String n1 = "ClasspathManifestJNLPHrefTest.html"; private static final String n4 = "ClasspathManifestApplicationTest.jnlp"; private static final String n2 = "ClasspathManifestAppletTest.jnlp"; private static final String n3 = "ClasspathManifestAppletTest.html"; private static final String[] ns = new String[]{n1, n2, n3, n4}; private static final String n0 = "ClasspathManifestTest.jar"; private static File newRoot; private static File newRoot1; public void checkAppFails(ProcessResult pr, String testName) { Assert.assertTrue("ClasspathManifest." + testName + " stdout should contain " + s1 + " but didn't", pr.stdout.contains(s1)); Assert.assertFalse("ClasspathManifest." + testName + " stdout should not contain " + s2 + " but did", pr.stdout.contains(s2)); Assert.assertTrue("ClasspathManifest." + testName + " stderr should contain " + ss + " but didn't", pr.stderr.contains(ss)); } public void checkAppPass(ProcessResult pr, String testName) { Assert.assertTrue("ClasspathManifest." + testName + " stdout should contain " + s1 + " but didn't", pr.stdout.contains(s1)); Assert.assertTrue("ClasspathManifest." + testName + " stdout should not contain " + s2 + " but did", pr.stdout.contains(s2)); Assert.assertFalse("ClasspathManifest." + testName + " stderr should contain " + ss + " but didn't", pr.stderr.contains(ss)); } @AfterClass public static void removeAlternativeLocalDirs() throws IOException { FirefoxProfilesOperator.deleteRecursively(newRoot); } @BeforeClass public static void createAlternativeLocalDirs() throws IOException { newRoot = File.createTempFile("itw", "ClasspathManifestTest"); newRoot.delete(); newRoot.mkdirs(); newRoot.deleteOnExit(); newRoot1 = new File(newRoot, "r1"); newRoot1.mkdir(); FirefoxProfilesOperator.copyRecursively(new File(server.getDir(), "Classpath"), newRoot); for (String n : ns) { copyTextFile(new File(server.getDir(), n), new File(newRoot, n)); } FirefoxProfilesOperator.copyFile(new File(server.getDir(), n0), new File(newRoot1, n0)); } public static void copyTextFile(File from, File to) throws IOException { String s = FileUtils.loadFileAsString(from); // for (String n : ns) { // s = s.replaceAll(n, newRoot1.getName()+"/" + n); // } s = s.replaceAll(n0, newRoot1.getName() + "/" + n0); FileUtils.saveFile(s, to); } @NeedsDisplay @Test public void ApplicationJNLPRemoteTest() throws Exception { ProcessResult pr = server.executeJavawsHeadless(null, "/" + n4); checkAppFails(pr, "ApplicationJNLPRemoteTest"); } /** * See the difference between *LocalTest() and *LocalTest_differentDir(). * * Itw always have "." on classpath. So * * ./jnlp or ./html (calling to jar.jar) + ./jar.jar + * ./Codebase/../second.jar are all on classapth but ./jnlp or ./html * (calling to someDir/jar.jar)+ ./someDir/jar.jar + * ./Codebase/../second.jar Is making the jar.jar laodable for startup, but * diapearing after encauntering Class-Path: in Manifest.mf * * @throws Exception */ @NeedsDisplay @Test public void ApplicationJNLPLocalTest() throws Exception { List commands = new ArrayList<>(3); commands.add(server.getJavawsLocation()); commands.add(ServerAccess.HEADLES_OPTION); commands.add(n4); ProcessResult pr = ServerAccess.executeProcess(commands, server.getDir()); checkAppPass(pr, "ApplicationJNLPLocalTest"); } @NeedsDisplay @Test public void ApplicationJNLPLocalTest_differentDir() throws Exception { List commands = new ArrayList<>(3); commands.add(server.getJavawsLocation()); commands.add(ServerAccess.HEADLES_OPTION); commands.add(n4); ProcessResult pr = ServerAccess.executeProcess(commands, newRoot); checkAppFails(pr, "ApplicationJNLPLocalTest_differentDir"); } @NeedsDisplay @Test public void AppletJNLPRemoteTest() throws Exception { ProcessResult pr = server.executeJavawsHeadless(null, "/" + n2); checkAppFails(pr, "AppletJNLPRemoteTest"); } @NeedsDisplay @Test public void AppletJNLPRLocalTest() throws Exception { List commands = new ArrayList<>(3); commands.add(server.getJavawsLocation()); commands.add(ServerAccess.HEADLES_OPTION); commands.add(n2); ProcessResult pr = ServerAccess.executeProcess(commands, server.getDir()); checkAppPass(pr, "AppletJNLPRLocalTest"); } @NeedsDisplay @Test public void AppletJNLPRLocalTest_differentDir() throws Exception { List commands = new ArrayList<>(3); commands.add(server.getJavawsLocation()); commands.add(ServerAccess.HEADLES_OPTION); commands.add(n2); ProcessResult pr = ServerAccess.executeProcess(commands, newRoot); checkAppFails(pr, "AppletJNLPRLocalTest_differentDir"); } @NeedsDisplay @TestInBrowsers(testIn = {Browsers.one}) @Test public void BrowserJNLPHrefRemoteTest() throws Exception { ProcessResult pr = server.executeBrowser("/" + n1); checkAppFails(pr, "BrowserJNLPHrefRemoteTest"); } @NeedsDisplay @TestInBrowsers(testIn = {Browsers.one}) @Test public void BrowserJNLPHrefLocalTest() throws Exception { List commands = new ArrayList<>(2); commands.add(server.getBrowserLocation()); commands.add(n1); ProcessResult pr = ServerAccess.executeProcess(commands, server.getDir()); checkAppPass(pr, "BrowserJNLPHrefLocalTest"); } @NeedsDisplay @TestInBrowsers(testIn = {Browsers.one}) @Test public void BrowserJNLPHrefLocalTest_differentDir() throws Exception { List commands = new ArrayList<>(2); commands.add(server.getBrowserLocation()); commands.add(n1); ProcessResult pr = ServerAccess.executeProcess(commands, newRoot); checkAppFails(pr, "BrowserJNLPHrefLocalTest_differentDir"); } @NeedsDisplay @TestInBrowsers(testIn = {Browsers.one}) @Test public void BrowserAppletRemoteTest() throws Exception { ProcessResult pr = server.executeBrowser("/" + n3); Assert.assertTrue("ClasspathManifest.BrowserAppletRemoteTest stdout should contain " + s1 + " but didn't", pr.stdout.contains(s1)); // Should be the only one to search manifest for classpath. Assert.assertTrue("ClasspathManifest.BrowserAppletRemoteTest stdout should contain " + s2 + " but didn't", pr.stdout.contains(s2)); } } icedtea-web-1.6.2/tests/reproducers/signed/ClasspathManifestTest/PaxHeaders.17941/srcs0000644000000000000000000000013212654402377025563 xustar0030 mtime=1454507263.224432754 30 atime=1454507658.777157383 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/ClasspathManifestTest/srcs/0000755000175000002070000000000012654402377026363 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/ClasspathManifestTest/srcs/PaxHeaders.17941/META-INF0000644000000000000000000000013212654402377026723 xustar0030 mtime=1454507263.224432754 30 atime=1454507658.777157383 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/ClasspathManifestTest/srcs/META-INF/0000755000175000002070000000000012654402377027523 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/ClasspathManifestTest/srcs/META-INF/PaxHeaders.17941/MANI0000644000000000000000000000013212654402377027447 xustar0030 mtime=1454507263.224432754 30 atime=1454507327.236579043 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/ClasspathManifestTest/srcs/META-INF/MANIFEST.MF0000644000175000002070000000015612654402377031157 0ustar00jvanekmock00000000000000Manifest-Version: 1.0 Class-Path: Classpath/Manifest/Test/Helper.jar Application-Name: ClasspathManifestTest icedtea-web-1.6.2/tests/reproducers/signed/ClasspathManifestTest/srcs/PaxHeaders.17941/ClasspathMani0000644000000000000000000000013212654402377030312 xustar0030 mtime=1454507263.224432754 30 atime=1454507327.236579043 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/ClasspathManifestTest/srcs/ClasspathManifest.java0000644000175000002070000000544212654402377032644 0ustar00jvanekmock00000000000000/* ClasspathManifest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.applet.Applet; import java.lang.reflect.*; public class ClasspathManifest extends Applet { private class Killer extends Thread { public int n = 1000; @Override public void run() { try { Thread.sleep(n); System.out.println("Applet killing himself after " + n + " ms of life"); System.exit(0); } catch (Exception ex) { } } } private Killer killer; public static void main(String[] args) { searchForClasspath(); } @Override public void init() { searchForClasspath(); killer = new Killer(); killer.start(); } public static void searchForClasspath() { System.out.println("Searching for CheckForClasspath."); try { Class checkClass = Class.forName("CheckForClasspath"); Method checkMethod = checkClass.getDeclaredMethod("checkClasspathAndPrint"); checkMethod.invoke((Object) null); } catch (Exception ex) { System.out.println("Exception was thrown, class not found on classpath."); ex.printStackTrace(); } } } icedtea-web-1.6.2/tests/reproducers/signed/ClasspathManifestTest/PaxHeaders.17941/resources0000644000000000000000000000013212654402377026623 xustar0030 mtime=1454507263.223432768 30 atime=1454507658.777157383 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/ClasspathManifestTest/resources/0000755000175000002070000000000012654402377027423 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/ClasspathManifestTest/resources/PaxHeaders.17941/Classpat0000644000000000000000000000032112654402377030375 xustar00119 path=icedtea-web-1.6.2/tests/reproducers/signed/ClasspathManifestTest/resources/ClasspathManifestJNLPHrefTest.html 30 mtime=1454507263.223432768 30 atime=1454507327.236579043 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/ClasspathManifestTest/resources/ClasspathManifestJNLPHref0000644000175000002070000000346112654402377034254 0ustar00jvanekmock00000000000000 icedtea-web-1.6.2/tests/reproducers/signed/ClasspathManifestTest/resources/PaxHeaders.17941/Classpat0000644000000000000000000000032412654402377030400 xustar00122 path=icedtea-web-1.6.2/tests/reproducers/signed/ClasspathManifestTest/resources/ClasspathManifestApplicationTest.jnlp 30 mtime=1454507263.223432768 30 atime=1454507327.236579043 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/ClasspathManifestTest/resources/ClasspathManifestApplicat0000644000175000002070000000436012654402377034440 0ustar00jvanekmock00000000000000 ClasspathManifest IcedTea ClasspathManifest icedtea-web-1.6.2/tests/reproducers/signed/ClasspathManifestTest/resources/PaxHeaders.17941/Classpat0000644000000000000000000000031712654402377030402 xustar00117 path=icedtea-web-1.6.2/tests/reproducers/signed/ClasspathManifestTest/resources/ClasspathManifestAppletTest.jnlp 30 mtime=1454507263.223432768 30 atime=1454507327.236579043 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/ClasspathManifestTest/resources/ClasspathManifestAppletTe0000644000175000002070000000451712654402377034425 0ustar00jvanekmock00000000000000 Classpath Manifest Applet Test IcedTea ClasspathManifest icedtea-web-1.6.2/tests/reproducers/signed/ClasspathManifestTest/resources/PaxHeaders.17941/Classpat0000644000000000000000000000031712654402377030402 xustar00117 path=icedtea-web-1.6.2/tests/reproducers/signed/ClasspathManifestTest/resources/ClasspathManifestAppletTest.html 30 mtime=1454507263.223432768 30 atime=1454507327.236579043 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/ClasspathManifestTest/resources/ClasspathManifestAppletTe0000644000175000002070000000351212654402377034417 0ustar00jvanekmock00000000000000 icedtea-web-1.6.2/tests/reproducers/signed/PaxHeaders.17941/Classpath.Manifest.Test.Helper0000644000000000000000000000013212654402377026163 xustar0030 mtime=1454507263.222432781 30 atime=1454507658.777157383 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/Classpath.Manifest.Test.Helper/0000755000175000002070000000000012654402377026763 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/Classpath.Manifest.Test.Helper/PaxHeaders.17941/srcs0000644000000000000000000000013212654402377027135 xustar0030 mtime=1454507263.222432781 30 atime=1454507658.777157383 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/Classpath.Manifest.Test.Helper/srcs/0000755000175000002070000000000012654402377027735 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/Classpath.Manifest.Test.Helper/srcs/PaxHeaders.17941/Chec0000644000000000000000000000031112654402377027776 xustar00111 path=icedtea-web-1.6.2/tests/reproducers/signed/Classpath.Manifest.Test.Helper/srcs/CheckForClasspath.java 30 mtime=1454507263.222432781 30 atime=1454507327.235579056 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/Classpath.Manifest.Test.Helper/srcs/CheckForClasspath.jav0000644000175000002070000000341712654402377033773 0ustar00jvanekmock00000000000000/* CheckForClasspath.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class CheckForClasspath { public static void checkClasspathAndPrint() { System.out.println("CheckForClasspath found on classpath."); } } icedtea-web-1.6.2/tests/reproducers/signed/PaxHeaders.17941/CheckPluginParams0000644000000000000000000000013212654402377023700 xustar0030 mtime=1454507263.222432781 30 atime=1454507658.777157383 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/CheckPluginParams/0000755000175000002070000000000012654402377024500 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/CheckPluginParams/PaxHeaders.17941/testcases0000644000000000000000000000013212654402377025676 xustar0030 mtime=1454507263.222432781 30 atime=1454507658.777157383 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/CheckPluginParams/testcases/0000755000175000002070000000000012654402377026476 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/CheckPluginParams/testcases/PaxHeaders.17941/CheckPluginP0000644000000000000000000000013212654402377030212 xustar0030 mtime=1454507263.222432781 30 atime=1454507327.235579056 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/CheckPluginParams/testcases/CheckPluginParamsTests.java0000644000175000002070000001004612654402377033725 0ustar00jvanekmock00000000000000/* CheckPluginParamsTests.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.io.IOException; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.annotations.Bug; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.AutoErrorClosingListener; import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.tools.DeploymentPropertiesModifier; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; @Bug(id = "RH1273691") public class CheckPluginParamsTests extends BrowserTest { private static DeploymentPropertiesModifier d; private static final String ID = "test.custom"; @BeforeClass public static void setup() throws IOException { String value = " -D" + ID + "1=value1" + " -D" + ID + "2\\=value2=value2" + " -D" + ID + "3=value3\\=value3" + " -D" + ID + "4\\=value4\\\\=value4"; d = new DeploymentPropertiesModifier(); d.setProperties(DeploymentConfiguration.KEY_PLUGIN_JVM_ARGUMENTS, value); } @AfterClass public static void tearDown() throws IOException { d.restoreProperties(); } public void evaluateApplet(ProcessResult pr) { String s = pr.stdout; Assert.assertTrue(s.contains(ID + "1: value1")); Assert.assertTrue(s.contains(ID + "2: value2=value2")); Assert.assertTrue(s.contains(ID + "3: value3=value3")); Assert.assertTrue(s.contains(ID + "4: value4\\=value4")); } @Bug(id = "RH1273691") @Test @NeedsDisplay @TestInBrowsers(testIn = {Browsers.one}) public void CheckWebstartServices() throws Exception { ProcessResult pr = server.executeBrowser(null, "/CheckPluginParams1.html", new AutoOkClosingListener(), new AutoErrorClosingListener()); evaluateApplet(pr); } @Bug(id = "RH1273691") @Test @NeedsDisplay @TestInBrowsers(testIn = {Browsers.one}) public void CheckPluginJNLPHServices() throws Exception { ProcessResult pr = server.executeBrowser(null, "/CheckPluginParams2.html", new AutoOkClosingListener(), new AutoErrorClosingListener()); evaluateApplet(pr); } } icedtea-web-1.6.2/tests/reproducers/signed/CheckPluginParams/PaxHeaders.17941/srcs0000644000000000000000000000013212654402377024652 xustar0030 mtime=1454507263.222432781 30 atime=1454507658.777157383 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/CheckPluginParams/srcs/0000755000175000002070000000000012654402377025452 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/CheckPluginParams/srcs/PaxHeaders.17941/CheckPluginParams0000644000000000000000000000013212654402377030212 xustar0030 mtime=1454507263.222432781 30 atime=1454507327.235579056 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/CheckPluginParams/srcs/CheckPluginParams.java0000644000175000002070000000444212654402377031661 0ustar00jvanekmock00000000000000/* CheckPluginParams.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.applet.Applet; public class CheckPluginParams extends Applet { private static final String ID ="test.custom"; public static void main(String... args){ System.out.println(""+ID+"1: "+System.getProperty(""+ID+"1")); System.out.println(""+ID+"2: "+System.getProperty(""+ID+"2")); System.out.println(""+ID+"3: "+System.getProperty(""+ID+"3")); System.out.println(""+ID+"4: "+System.getProperty(""+ID+"4")); } @Override public void init() { main(); } @Override public void start() { //main(); System.out.println("*** APPLET FINISHED ***"); } } icedtea-web-1.6.2/tests/reproducers/signed/CheckPluginParams/PaxHeaders.17941/resources0000644000000000000000000000013212654402377025712 xustar0030 mtime=1454507263.221432794 30 atime=1454507658.777157383 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/CheckPluginParams/resources/0000755000175000002070000000000012654402377026512 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/CheckPluginParams/resources/PaxHeaders.17941/CheckPluginP0000644000000000000000000000013212654402377030226 xustar0030 mtime=1454507263.221432794 30 atime=1454507327.235579056 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/CheckPluginParams/resources/CheckPluginParams2.html0000644000175000002070000000342712654402377033030 0ustar00jvanekmock00000000000000 icedtea-web-1.6.2/tests/reproducers/signed/CheckPluginParams/resources/PaxHeaders.17941/CheckPluginP0000644000000000000000000000013212654402377030226 xustar0030 mtime=1454507263.221432794 30 atime=1454507327.235579056 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/CheckPluginParams/resources/CheckPluginParams1.html0000644000175000002070000000344512654402377033027 0ustar00jvanekmock00000000000000 icedtea-web-1.6.2/tests/reproducers/signed/CheckPluginParams/resources/PaxHeaders.17941/CheckPluginP0000644000000000000000000000013212654402377030226 xustar0030 mtime=1454507263.221432794 30 atime=1454507327.235579056 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/CheckPluginParams/resources/CheckPluginParams.jnlp0000644000175000002070000000435012654402377032741 0ustar00jvanekmock00000000000000 CheckPluginParams IcedTea CheckPluginParams icedtea-web-1.6.2/tests/reproducers/signed/PaxHeaders.17941/CacheReproducer0000644000000000000000000000013212654402377023376 xustar0030 mtime=1454507263.221432794 30 atime=1454507658.777157383 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/CacheReproducer/0000755000175000002070000000000012654402377024176 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/CacheReproducer/PaxHeaders.17941/testcases0000644000000000000000000000013212654402377025374 xustar0030 mtime=1454507263.221432794 30 atime=1454507658.777157383 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/CacheReproducer/testcases/0000755000175000002070000000000012654402377026174 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/CacheReproducer/testcases/PaxHeaders.17941/CacheReproduce0000644000000000000000000000013112654402377030247 xustar0030 mtime=1454507263.221432794 29 atime=1454507327.23457907 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/CacheReproducer/testcases/CacheReproducerTest.java0000644000175000002070000004104212654402377032736 0ustar00jvanekmock00000000000000/* CacheReproducerTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStreamReader; import java.io.UnsupportedEncodingException; import java.util.Arrays; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.annotations.KnownToFail; import net.sourceforge.jnlp.config.PathsAndFiles; import net.sourceforge.jnlp.tools.MessageProperties; import org.junit.AfterClass; import org.junit.Assert; import org.junit.Test; public class CacheReproducerTest { private static final ServerAccess server = new ServerAccess(); private static final List trustedVerboses = Arrays.asList(new String[]{"-Xtrustall", ServerAccess.HEADLES_OPTION,"-verbose"}); private static final List verbosed = Arrays.asList(new String[]{"-verbose", ServerAccess.HEADLES_OPTION}); private static final String lre = "LruCacheException"; private static final String ioobe = "IndexOutOfBoundsException"; private static final String corruptRegex = "\\d{13}"; private static final Pattern corruptPatern = Pattern.compile(corruptRegex); private static final String corruptString = "156dsf1562kd5"; //recently.used is always here private static final int PERMANENT_FILES = 1; private static final File icedteaCache = PathsAndFiles.CACHE_DIR.getFile(); private static final File icedteaCacheFile = PathsAndFiles.getRecentlyUsedFile().getFile(); private static final File netxLock = PathsAndFiles.MAIN_LOCK.getFile(); String testS = "#netx file\n" + "#Mon Dec 12 16:20:46 CET 2011\n" + "1323703236508,0=/home/xp13/.icedtea/cache/0/http/localhost/ReadPropertiesBySignedHack.jnlp\n" + "1323703243086,2=/home/xp14/.icedtea/cache/2/http/localhost/ReadProperties.jar\n" + "1323703243082,1=/home/xp15/.icedtea/cache/1/http/localhost/ReadPropertiesBySignedHack.jar"; @Test public void cacheIsWorkingTest() throws Exception { clearAndEvaluateCache(); evaluateSimpleTest1OkCache(runSimpleTest1()); assertCacheIsNotEmpty(); } @Test public void cacheIsWorkingTestSigned() throws Exception { clearAndEvaluateCache(); evaluateSimpleTest1OkCache(runSimpleTest1Signed()); assertCacheIsNotEmpty(); } private class ParallelSimpleTestRunner extends Thread { public boolean b=false; @Override public void run() { try { ProcessResult pr = runSimpleTest1(); evaluateSimpleTest1OkCache(pr); b=true; } catch (Exception ex) { throw new RuntimeException(ex); } } } @Test @KnownToFail public void startParallelInstancesUponBrokenCache() throws Exception { clearAndEvaluateCache(); evaluateSimpleTest1OkCache(runSimpleTest1()); assertCacheIsNotEmpty(); breakCache1(); ParallelSimpleTestRunner t1=new ParallelSimpleTestRunner(); ParallelSimpleTestRunner t2=new ParallelSimpleTestRunner(); ParallelSimpleTestRunner t3=new ParallelSimpleTestRunner(); t1.start(); t2.start(); t3.start(); int c=0; while(true){ c++; Thread.sleep(100); if (c>600) throw new Error("threads have not died in time"); if (!t1.isAlive() && !t2.isAlive() && !t3.isAlive()) break; } Thread.sleep(1000); Assert.assertTrue(t1.b); Assert.assertTrue(t2.b); Assert.assertTrue(t3.b); } private void assertCacheIsNotEmpty() { Assert.assertTrue("icedtea cache " + icedteaCache.getAbsolutePath() + " should exist some any run", icedteaCache.exists()); Assert.assertTrue("icedtea cache file " + icedteaCacheFile.getAbsolutePath() + " should exist some any run", icedteaCacheFile.exists()); Assert.assertTrue("icedtea cache file " + icedteaCacheFile.getAbsolutePath() + " should not be empty", icedteaCacheFile.length() > PERMANENT_FILES); } /** * This is breaking integer numbers in first part of cache file item * @throws Exception */ @Test public void coruptAndRunCache1() throws Exception { clearAndEvaluateCache(); evaluateSimpleTest1OkCache(runSimpleTest1()); assertCacheIsNotEmpty(); breakCache1(); ProcessResult pr = runSimpleTest1(); assertLruExceptionAppeared(pr); evaluateSimpleTest1OkCache(pr); clearAndEvaluateCache(); ProcessResult pr2 = runSimpleTest1(); evaluateSimpleTest1OkCache(pr2); assertLruExceptionNOTappeared(pr2); } /** * This is breaking integer numbers in first part of cache file item * @throws Exception */ @Test public void coruptAndRunCache2() throws Exception { clearAndEvaluateCache(); evaluateSimpleTest1OkCache(runSimpleTest1()); assertCacheIsNotEmpty(); breakCache1(); ProcessResult pr = runSimpleTest1(); assertLruExceptionAppeared(pr); evaluateSimpleTest1OkCache(pr); ProcessResult pr3 = runSimpleTest1(); evaluateSimpleTest1OkCache(pr3); assertLruExceptionNOTappeared(pr3); clearAndEvaluateCache(); ProcessResult pr2 = runSimpleTest1(); evaluateSimpleTest1OkCache(pr2); assertLruExceptionNOTappeared(pr2); } /** * This is breaking paths in second part of cache file item * @throws Exception */ @Test public void coruptAndRunCache3() throws Exception { clearAndEvaluateCache(); evaluateSimpleTest1OkCache(runSimpleTest1()); assertCacheIsNotEmpty(); breakCache3(); ProcessResult pr = runSimpleTest1(); assertAoobNOTappeared(pr); assertLruExceptionAppeared(pr); evaluateSimpleTest1OkCache(pr); ProcessResult pr3 = runSimpleTest1(); evaluateSimpleTest1OkCache(pr3); assertLruExceptionNOTappeared(pr3); clearAndEvaluateCache(); ProcessResult pr2 = runSimpleTest1(); evaluateSimpleTest1OkCache(pr2); assertLruExceptionNOTappeared(pr2); } private void assertAoobNOTappeared(ProcessResult pr2) { Assert.assertFalse("serr should NOT contain " + ioobe, pr2.stderr.contains(ioobe)); } private void assertLruExceptionNOTappeared(ProcessResult pr2) { Assert.assertFalse("serr should NOT contain " + lre, pr2.stderr.contains(lre)); } private void assertLruExceptionAppeared(ProcessResult pr) { Assert.assertTrue("serr should contain " + lre, pr.stderr.contains(lre)); } @Test public void coruptAndRunCache1Signed() throws Exception { clearAndEvaluateCache(); evaluateSimpleTest1OkCache(runSimpleTest1()); assertCacheIsNotEmpty(); breakCache1(); ProcessResult pr = runSimpleTest1Signed(); assertLruExceptionAppeared(pr); evaluateSimpleTest1OkCache(pr); clearAndEvaluateCache(); ProcessResult pr2 = runSimpleTest1Signed(); evaluateSimpleTest1OkCache(pr2); assertLruExceptionNOTappeared(pr2); } @Test public void coruptAndRunCache2Signed() throws Exception { clearAndEvaluateCache(); evaluateSimpleTest1OkCache(runSimpleTest1()); assertCacheIsNotEmpty(); breakCache1(); ProcessResult pr = runSimpleTest1Signed(); assertLruExceptionAppeared(pr); evaluateSimpleTest1OkCache(pr); ProcessResult pr3 = runSimpleTest1Signed(); evaluateSimpleTest1OkCache(pr3); assertLruExceptionNOTappeared(pr3); clearAndEvaluateCache(); ProcessResult pr2 = runSimpleTest1Signed(); evaluateSimpleTest1OkCache(pr2); assertLruExceptionNOTappeared(pr2); } @Test public void clearCacheUnsucessfully() throws Exception { evaluateSimpleTest1OkCache(runSimpleTest1()); assertCacheIsNotEmpty(); ProcessResult pr; Thread t = new Thread(new Runnable() { @Override public void run() { try { ProcessResult pr = server.executeJavawsHeadless(verbosed, "/deadlocktest.jnlp"); } catch (Exception ex) { throw new RuntimeException(ex); } } }); t.start(); Thread.sleep(1000); pr = tryToClearcache(); String cacheClearError = MessageProperties.getMessage("CCannotClearCache"); Assert.assertTrue("Stderr should contain " + cacheClearError + ", but did not.", pr.stderr.contains(cacheClearError)); assertCacheIsNotEmpty(); } //next four tests are designed to ensure, that corrupted cache will not break already loaded cached files public static final String CR1 = "CacheReproducer1"; public static final String CR2 = "CacheReproducer2"; public static final String CR11 = "CacheReproducer1_1"; public static final String CR21 = "CacheReproducer2_1"; public void testsBody(String id, int breaker) throws Exception { clearAndEvaluateCache(); ProcessResult pr1 = runSimpleTestSigned(id); assertLruExceptionNOTappeared(pr1); evaluateSimpleTest1OkCache(pr1); if (breaker < 0) { breakCache1(); } else { breakCache2(breaker); } ProcessResult pr2 = runSimpleTestSigned(id); assertLruExceptionAppeared(pr2); evaluateSimpleTest1OkCache(pr2); } @Test public void testAlreadyLoadedCached1() throws Exception { testsBody(CR1, 1); testsBody(CR1, 2); testsBody(CR1, -1); } @Test public void testAlreadyLoadedCached2() throws Exception { testsBody(CR2, 1); testsBody(CR2, 2); testsBody(CR2, -1); } @Test public void testAlreadyLoadedCached11() throws Exception { testsBody(CR11, 1); testsBody(CR11, 2); testsBody(CR11, -1); } @Test public void testAlreadyLoadedCached21() throws Exception { testsBody(CR21, 1); testsBody(CR21, 2); testsBody(CR21, -1); } @AfterClass public static void clearCache() throws Exception { clearAndEvaluateCache(); } private static void clearAndEvaluateCache() throws Exception { clearAndEvaluateCache(true); } private static void clearAndEvaluateCache(boolean force) throws Exception { if (force) { if (netxLock.isFile()) { boolean b = netxLock.delete(); Assert.assertTrue(b); } } tryToClearcache(); Assert.assertTrue("icedtea cache " + icedteaCache.getAbsolutePath() + " should be empty after clearing", icedteaCache.listFiles().length == PERMANENT_FILES); } private static String loadFile(File f) throws FileNotFoundException, UnsupportedEncodingException, IOException { BufferedReader r = new BufferedReader(new InputStreamReader(new FileInputStream(icedteaCacheFile), "UTF-8")); StringBuilder sb = new StringBuilder(); while (true) { String s = r.readLine(); if (s == null) { break; } sb.append(s).append("\n"); } return sb.toString(); } private static String loadCacheFile() throws IOException { return loadFile(icedteaCacheFile); } @Test public void assertBreakers1AreWorking() { String s=testS; String sp[] = s.split("\n"); String ss[] = breakAll(s).split("\n"); for (int i = 0; i < 2; i++) { Assert.assertEquals(sp[i], ss[i]); } for (int i = 2; i < ss.length; i++) { Assert.assertNotSame(sp[i], ss[i]); } String sb = breakOne(s, 0); Assert.assertEquals(s, sb); for (int x = 1; x <= 3; x++) { String[] sx = breakOne(s, x).split("\n"); for (int i = 0; i < sx.length; i++) { if (i == x + 1) { Assert.assertNotSame(sp[i], sx[i]); } else { Assert.assertEquals(sp[i], sx[i]); } } } String sbb = breakOne(s, 4); Assert.assertEquals(s, sbb); } private static String breakAll(String s) { return s.replaceAll(corruptRegex, corruptString); } private static String breakOne(String s, int i) { Matcher m1 = corruptPatern.matcher(s); int x = 0; while (m1.find()) { x++; String r = (m1.group(0)); if (x == i) { return s.replace(r, corruptString); } } return s; } @Test public void assertBreakers2AreWorking() { String s=testS; String sp[] = s.split("\n"); String ss[] = breakPaths (s).split("\n"); for (int i = 0; i < 2; i++) { Assert.assertEquals(sp[i], ss[i]); } for (int i = 2; i < ss.length; i++) { Assert.assertNotSame(sp[i], ss[i]); } } private static String breakPaths(String s) { return s.replaceAll(System.getProperty("user.home") + ".*", "/ho"); } private static void breakCache1() throws IOException { String s = loadCacheFile(); s = breakAll(s); ServerAccess.saveFile(s, icedteaCacheFile); } private static void breakCache2(int i) throws FileNotFoundException, UnsupportedEncodingException, IOException { String s = loadCacheFile(); s = breakOne(s, i); ServerAccess.saveFile(s, icedteaCacheFile); } private static void breakCache3() throws IOException { String s = loadCacheFile(); s = breakPaths(s); ServerAccess.saveFile(s, icedteaCacheFile); } private static ProcessResult runSimpleTest1() throws Exception { return runSimpleTest1(verbosed, "simpletest1"); } private static ProcessResult runSimpleTest1(List args, String s) throws Exception { ProcessResult pr2 = server.executeJavawsHeadless(args, "/" + s + ".jnlp"); return pr2; } private static ProcessResult runSimpleTest1Signed() throws Exception { return runSimpleTestSigned("SimpletestSigned1"); } private static ProcessResult runSimpleTestSigned(String id) throws Exception { return runSimpleTest1(trustedVerboses, id); } private static void evaluateSimpleTest1OkCache(ProcessResult pr2) throws Exception { String s = "Good simple javaws exapmle"; Assert.assertTrue("test stdout should contain " + s + " but didn't", pr2.stdout.contains(s)); Assert.assertFalse(pr2.wasTerminated); Assert.assertEquals((Integer) 0, pr2.returnValue); } private static ProcessResult tryToClearcache() throws Exception { ProcessResult pr1 = server.executeJavawsClearCache(); return pr1; } } icedtea-web-1.6.2/tests/reproducers/signed/CacheReproducer/PaxHeaders.17941/srcs0000644000000000000000000000013212654402377024350 xustar0030 mtime=1454507263.220432808 30 atime=1454507658.777157383 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/CacheReproducer/srcs/0000755000175000002070000000000012654402377025150 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/CacheReproducer/srcs/PaxHeaders.17941/CacheReproducer.jav0000644000000000000000000000013112654402377030164 xustar0030 mtime=1454507263.220432808 29 atime=1454507327.23457907 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/CacheReproducer/srcs/CacheReproducer.java0000644000175000002070000000362412654402377031056 0ustar00jvanekmock00000000000000/* CacheReproducer.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.lang.reflect.*; public class CacheReproducer{ public static void main(String[] args) throws Exception{ Class c1= Class.forName("SimpletestSigned1"); Method m1=c1.getDeclaredMethod("main",args.getClass()); m1.invoke((Object) null, (Object)args); } } icedtea-web-1.6.2/tests/reproducers/signed/CacheReproducer/PaxHeaders.17941/resources0000644000000000000000000000013212654402377025410 xustar0030 mtime=1454507263.220432808 30 atime=1454507658.777157383 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/CacheReproducer/resources/0000755000175000002070000000000012654402377026210 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/CacheReproducer/resources/PaxHeaders.17941/CacheReproduce0000644000000000000000000000013112654402377030263 xustar0030 mtime=1454507263.220432808 29 atime=1454507327.23457907 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/CacheReproducer/resources/CacheReproducer2_1.jnlp0000644000175000002070000000113012654402377032430 0ustar00jvanekmock00000000000000 Just prints out "Good simple javaws exapmle" using reflection call from CacheReproducer.jar SimpletestSigned1.jar IcedTea icedtea-web-1.6.2/tests/reproducers/signed/CacheReproducer/resources/PaxHeaders.17941/CacheReproduce0000644000000000000000000000013112654402377030263 xustar0030 mtime=1454507263.220432808 29 atime=1454507327.23457907 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/CacheReproducer/resources/CacheReproducer2.jnlp0000644000175000002070000000112712654402377032216 0ustar00jvanekmock00000000000000 Just prints out "Good simple javaws exapmle" using reflection call from CacheReproducer.jar SimpletestSigned1.jar IcedTea icedtea-web-1.6.2/tests/reproducers/signed/CacheReproducer/resources/PaxHeaders.17941/CacheReproduce0000644000000000000000000000013112654402377030263 xustar0030 mtime=1454507263.219432821 29 atime=1454507327.23457907 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/CacheReproducer/resources/CacheReproducer1_1.jnlp0000644000175000002070000000113012654402377032427 0ustar00jvanekmock00000000000000 Just prints out "Good simple javaws exapmle" using reflection call from CacheReproducer.jar SimpletestSigned1.jar IcedTea icedtea-web-1.6.2/tests/reproducers/signed/CacheReproducer/resources/PaxHeaders.17941/CacheReproduce0000644000000000000000000000013212654402377030264 xustar0030 mtime=1454507263.219432821 30 atime=1454507327.233579083 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/CacheReproducer/resources/CacheReproducer1.jnlp0000644000175000002070000000113112654402377032210 0ustar00jvanekmock00000000000000 Just prints out "Good simple javaws exapmle" using reflection call from CacheReproducer.jar SimpletestSigned1.jar IcedTea icedtea-web-1.6.2/tests/reproducers/signed/PaxHeaders.17941/AppletTestSigned0000644000000000000000000000013212654402377023557 xustar0030 mtime=1454507263.219432821 30 atime=1454507658.777157383 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/AppletTestSigned/0000755000175000002070000000000012654402377024357 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/AppletTestSigned/PaxHeaders.17941/testcases0000644000000000000000000000013212654402377025555 xustar0030 mtime=1454507263.219432821 30 atime=1454507658.777157383 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/AppletTestSigned/testcases/0000755000175000002070000000000012654402377026355 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/AppletTestSigned/testcases/PaxHeaders.17941/AppletTestSig0000644000000000000000000000013212654402377030305 xustar0030 mtime=1454507263.219432821 30 atime=1454507327.233579083 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/AppletTestSigned/testcases/AppletTestSignedTests.java0000644000175000002070000001336312654402377033470 0ustar00jvanekmock00000000000000/* AppletTestSignedTests.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.util.Arrays; import java.util.Collections; import java.util.List; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.closinglisteners.Rule; import net.sourceforge.jnlp.closinglisteners.RulesFolowingClosingListener; import static net.sourceforge.jnlp.closinglisteners.RulesFolowingClosingListener.*; import org.junit.Assert; import org.junit.Test; public class AppletTestSignedTests extends BrowserTest { private final List l = Collections.unmodifiableList(Arrays.asList(new String[]{"-Xtrustall"})); private static final String s0 = "AppletTestSigned was started"; private static final String s1 = "value1"; private static final String s2 = "value2"; private static final String s3 = "AppletTestSigned was initialised"; private static final String s7 = "AppletTestSigned killing himself after 2000 ms of life"; private static final ContainsRule startedRule = new ContainsRule(s0); private static final ContainsRule variable1Rule = new ContainsRule(s1); private static final ContainsRule variable2Rule = new ContainsRule(s2); private static final ContainsRule initialisedRule = new ContainsRule(s3); private static final ContainsRule killedRule = new ContainsRule(s7); private static final RulesFolowingClosingListener okListener=new RulesFolowingClosingListener(startedRule, variable1Rule, variable2Rule, initialisedRule, killedRule); // @Test public void AppletTestSignedTest() throws Exception { ProcessResult pr = server.executeJavawsHeadless(l, "/AppletTestSigned.jnlp"); evaluateSignedApplet(pr, true); Assert.assertFalse(pr.wasTerminated); Assert.assertEquals((Integer) 0, pr.returnValue); } private void evaluateSignedApplet(ProcessResult pr, boolean javawsApplet) { Assert.assertTrue("AppletTestSigned stdout " + initialisedRule.toPassingString() + " but didn't", initialisedRule.evaluate(pr.stdout)); Assert.assertTrue("AppletTestSigned stdout " + startedRule.toPassingString() + " but didn't", startedRule.evaluate(pr.stdout)); Assert.assertTrue("AppletTestSigned stdout " + variable1Rule.toPassingString() + " but didn't", variable1Rule.evaluate(pr.stdout)); Assert.assertTrue("AppletTestSigned stdout " + variable2Rule.toPassingString() + " but didn't", variable2Rule.evaluate(pr.stdout)); Assert.assertTrue("AppletTestSigned stdout " + killedRule.toPassingString() + " but didn't", killedRule.evaluate(pr.stdout)); if (!javawsApplet) { /*this is working correctly in most browser, but not in all. temporarily disabling String s4 = "AppletTestSigned was stopped"; Assert.assertTrue("AppletTestSigned stdout shouldt contain " + s4 + " but did", pr.stdout.contains(s4)); String s5 = "AppletTestSigned will be destroyed"; Assert.assertTrue("AppletTestSigned stdout shouldt contain " + s5 + " but did", pr.stdout.contains(s5)); */ } } @Test @TestInBrowsers(testIn = {Browsers.all}) public void AppletTestSignedFirefoxTestXslowX() throws Exception { ServerAccess.PROCESS_TIMEOUT = 30 * 1000; try { ProcessResult pr = server.executeBrowser("/AppletTestSigned2.html", okListener, null); evaluateSignedApplet(pr, false); //Assert.assertTrue(pr.wasTerminated); //Assert.assertEquals((Integer) 0, pr.returnValue); due to destroy is null } finally { ServerAccess.PROCESS_TIMEOUT = 20 * 1000; //back to normal } } @Test @TestInBrowsers(testIn = {Browsers.all}) public void AppletTestSignedFirefoxTest() throws Exception { ProcessResult pr = server.executeBrowser("/AppletTestSigned.html", ServerAccess.AutoClose.CLOSE_ON_CORRECT_END); evaluateSignedApplet(pr, false); //Assert.assertTrue(pr.wasTerminated); //Assert.assertEquals((Integer) 0, pr.returnValue); due to destroy is null } } icedtea-web-1.6.2/tests/reproducers/signed/AppletTestSigned/PaxHeaders.17941/srcs0000644000000000000000000000013212654402377024531 xustar0030 mtime=1454507263.218432834 30 atime=1454507658.777157383 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/AppletTestSigned/srcs/0000755000175000002070000000000012654402377025331 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/AppletTestSigned/srcs/PaxHeaders.17941/AppletTestSigned.j0000644000000000000000000000013212654402377030200 xustar0030 mtime=1454507263.218432834 30 atime=1454507327.233579083 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/AppletTestSigned/srcs/AppletTestSigned.java0000644000175000002070000000541112654402377031414 0ustar00jvanekmock00000000000000/* AppletTestSigned.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.applet.Applet; public class AppletTestSigned extends Applet { private class Killer extends Thread { public int n = 2000; @Override public void run() { try { Thread.sleep(n); System.out.println("AppletTestSigned killing himself after " + n + " ms of life"); System.out.println("*** APPLET FINISHED ***"); System.exit(0); } catch (Exception ex) { } } } private Killer killer; @Override public void init() { System.out.println("AppletTestSigned was initialised"); killer = new Killer(); } @Override public void start() { System.out.println("AppletTestSigned was started"); System.out.println(getParameter("key1")); System.out.println(getParameter("key2")); killer.start(); System.out.println("killer was started"); } @Override public void stop() { System.out.println("AppletTestSigned was stopped"); } @Override public void destroy() { System.out.println("AppletTestSigned will be destroyed"); } } icedtea-web-1.6.2/tests/reproducers/signed/AppletTestSigned/PaxHeaders.17941/resources0000644000000000000000000000013212654402377025571 xustar0030 mtime=1454507263.218432834 30 atime=1454507658.777157383 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/AppletTestSigned/resources/0000755000175000002070000000000012654402377026371 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/AppletTestSigned/resources/PaxHeaders.17941/AppletTestSig0000644000000000000000000000013212654402377030321 xustar0030 mtime=1454507263.218432834 30 atime=1454507327.233579083 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/AppletTestSigned/resources/AppletTestSigned2.html0000644000175000002070000000357012654402377032565 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/signed/AppletTestSigned/resources/PaxHeaders.17941/AppletTestSig0000644000000000000000000000013212654402377030321 xustar0030 mtime=1454507263.218432834 30 atime=1454507327.233579083 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/AppletTestSigned/resources/AppletTestSigned.jnlp0000644000175000002070000000452712654402377032505 0ustar00jvanekmock00000000000000 SignedAppletTest IcedTea SignedAppletTest icedtea-web-1.6.2/tests/reproducers/signed/AppletTestSigned/resources/PaxHeaders.17941/AppletTestSig0000644000000000000000000000013212654402377030321 xustar0030 mtime=1454507263.218432834 30 atime=1454507327.233579083 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/AppletTestSigned/resources/AppletTestSigned.html0000644000175000002070000000356212654402377032504 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/signed/PaxHeaders.17941/AppContextHasJNLPClassLoader0000644000000000000000000000013212654402377025662 xustar0030 mtime=1454507263.217432848 30 atime=1454507658.777157383 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/AppContextHasJNLPClassLoader/0000755000175000002070000000000012654402377026462 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/AppContextHasJNLPClassLoader/PaxHeaders.17941/testcases0000644000000000000000000000013212654402377027660 xustar0030 mtime=1454507263.217432848 30 atime=1454507658.777157383 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/AppContextHasJNLPClassLoader/testcases/0000755000175000002070000000000012654402377030460 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/AppContextHasJNLPClassLoader/testcases/PaxHeaders.17941/A0000644000000000000000000000033312654402377030043 xustar00129 path=icedtea-web-1.6.2/tests/reproducers/signed/AppContextHasJNLPClassLoader/testcases/AppContextHasJNLPClassLoaderTest.java 30 mtime=1454507263.217432848 30 atime=1454507327.232579097 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/AppContextHasJNLPClassLoader/testcases/AppContextHasJNLPC0000644000175000002070000001056612654402377033723 0ustar00jvanekmock00000000000000/* Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import net.sourceforge.jnlp.annotations.KnownToFail; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.annotations.Bug; import org.junit.Assert; import net.sourceforge.jnlp.ServerAccess.AutoClose; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.ProcessResult; import org.junit.Test; public class AppContextHasJNLPClassLoaderTest extends BrowserTest { private static final String MAIN_APP_CONTEXT_CLASSLOADER = "main-thread: app context classloader == JNLPClassLoader"; private static final String MAIN_THREAD_CONTEXT_CLASSLOADER = "main-thread: thread context classloader == JNLPClassLoader"; private static final String SWING_APP_CONTEXT_CLASSLOADER = "swing-thread: app context classloader == JNLPClassLoader"; private static final String SWING_THREAD_CONTEXT_CLASSLOADER = "swing-thread: thread context classloader == JNLPClassLoader"; private void assertHasJNLPClassLoaderAsContextClassloader(ProcessResult pr) { // This shouldn't fail even with PR1251 // If the main thread does not have the right context classloader, something is quite wrong Assert.assertTrue("stdout should contains '" + MAIN_THREAD_CONTEXT_CLASSLOADER + "', but did not", pr.stdout.contains(MAIN_THREAD_CONTEXT_CLASSLOADER)); // PR1251 Assert.assertTrue("stdout should contains '" + MAIN_APP_CONTEXT_CLASSLOADER + "', but did not", pr.stdout.contains(MAIN_APP_CONTEXT_CLASSLOADER)); Assert.assertTrue("stdout should contains '" + SWING_APP_CONTEXT_CLASSLOADER + "', but did not", pr.stdout.contains(SWING_APP_CONTEXT_CLASSLOADER)); Assert.assertTrue("stdout should contains '" + SWING_THREAD_CONTEXT_CLASSLOADER + "', but did not", pr.stdout.contains(SWING_THREAD_CONTEXT_CLASSLOADER)); } @Test @KnownToFail @Bug(id="PR1251") public void testJNLPApplicationAppContext() throws Exception { ProcessResult pr = server.executeJavawsHeadless("/AppContextHasJNLPClassLoader.jnlp"); assertHasJNLPClassLoaderAsContextClassloader(pr); } @Test @KnownToFail // EventQueue.invokeAndWait is broken in JNLP applets, see PR1253 @Bug(id={"PR1251","PR1253"}) public void testJNLPAppletAppContext() throws Exception { ProcessResult pr = server.executeJavaws("/AppContextHasJNLPClassLoaderForJNLPApplet.jnlp"); assertHasJNLPClassLoaderAsContextClassloader(pr); } @Test @TestInBrowsers(testIn={Browsers.one}) @KnownToFail @Bug(id="PR1251") public void testAppletAppContext() throws Exception { ProcessResult pr = server.executeBrowser("/AppContextHasJNLPClassLoader.html", AutoClose.CLOSE_ON_CORRECT_END); assertHasJNLPClassLoaderAsContextClassloader(pr); } } icedtea-web-1.6.2/tests/reproducers/signed/AppContextHasJNLPClassLoader/PaxHeaders.17941/srcs0000644000000000000000000000013212654402377026634 xustar0030 mtime=1454507263.217432848 30 atime=1454507658.777157383 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/AppContextHasJNLPClassLoader/srcs/0000755000175000002070000000000012654402377027434 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/AppContextHasJNLPClassLoader/srcs/PaxHeaders.17941/AppCon0000644000000000000000000000032212654402377030015 xustar00120 path=icedtea-web-1.6.2/tests/reproducers/signed/AppContextHasJNLPClassLoader/srcs/AppContextHasJNLPClassLoader.java 30 mtime=1454507263.217432848 30 atime=1454507327.232579097 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/AppContextHasJNLPClassLoader/srcs/AppContextHasJNLPClassL0000644000175000002070000000626712654402377033701 0ustar00jvanekmock00000000000000/* Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.applet.Applet; import sun.awt.AppContext; import java.awt.EventQueue; /* Hybrid applet/application */ public class AppContextHasJNLPClassLoader extends Applet { /* * Output the current context classloader, and the current AppContext's * stored context classloader. * * The context classloader should never be the system classloader for a * webstart application or applet in any thread. */ static void printClassloaders(String location) { ClassLoader appContextClassLoader = AppContext.getAppContext().getContextClassLoader(); ClassLoader threadContextClassLoader = Thread.currentThread().getContextClassLoader(); System.out.println(location + ": app context classloader == " + appContextClassLoader.getClass().getSimpleName()); System.out.println(location + ": thread context classloader == " + threadContextClassLoader.getClass().getSimpleName()); } /* Applet start point */ @Override public void start() { try { main(null); } catch (Exception e) { e.printStackTrace(); } } /* Application start point */ public static void main(String[] args) throws Exception { printClassloaders("main-thread"); EventQueue.invokeAndWait(new Runnable() { public void run() { printClassloaders("swing-thread"); } }); // NB: The following is for JNLP applets only try { System.exit(0); } catch (Exception e) {e.printStackTrace(); } } } icedtea-web-1.6.2/tests/reproducers/signed/AppContextHasJNLPClassLoader/PaxHeaders.17941/resources0000644000000000000000000000013212654402377027674 xustar0030 mtime=1454507263.217432848 30 atime=1454507658.777157383 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/AppContextHasJNLPClassLoader/resources/0000755000175000002070000000000012654402377030474 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/AppContextHasJNLPClassLoader/resources/PaxHeaders.17941/A0000644000000000000000000000034412654402377030061 xustar00138 path=icedtea-web-1.6.2/tests/reproducers/signed/AppContextHasJNLPClassLoader/resources/AppContextHasJNLPClassLoaderForJNLPApplet.jnlp 30 mtime=1454507263.217432848 30 atime=1454507327.232579097 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/AppContextHasJNLPClassLoader/resources/AppContextHasJNLPC0000644000175000002070000000463112654402377033733 0ustar00jvanekmock00000000000000 Test AppContext Classloader IcedTea Test that AppContext's context classloader is a JNLPClassLoader icedtea-web-1.6.2/tests/reproducers/signed/AppContextHasJNLPClassLoader/resources/PaxHeaders.17941/A0000644000000000000000000000032712654402377030062 xustar00125 path=icedtea-web-1.6.2/tests/reproducers/signed/AppContextHasJNLPClassLoader/resources/AppContextHasJNLPClassLoader.jnlp 30 mtime=1454507263.216432861 30 atime=1454507327.232579097 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/AppContextHasJNLPClassLoader/resources/AppContextHasJNLPC0000644000175000002070000000446312654402377033736 0ustar00jvanekmock00000000000000 Test AppContext Classloader IcedTea Test that AppContext's context classloader is a JNLPClassLoader icedtea-web-1.6.2/tests/reproducers/signed/AppContextHasJNLPClassLoader/resources/PaxHeaders.17941/A0000644000000000000000000000032712654402377030062 xustar00125 path=icedtea-web-1.6.2/tests/reproducers/signed/AppContextHasJNLPClassLoader/resources/AppContextHasJNLPClassLoader.html 30 mtime=1454507263.216432861 30 atime=1454507327.232579097 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/AppContextHasJNLPClassLoader/resources/AppContextHasJNLPC0000644000175000002070000000347312654402377033736 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/signed/PaxHeaders.17941/AccessClassInPackageSigned0000644000000000000000000000013212654402377025424 xustar0030 mtime=1454507263.216432861 30 atime=1454507658.777157383 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/AccessClassInPackageSigned/0000755000175000002070000000000012654402377026224 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/AccessClassInPackageSigned/PaxHeaders.17941/srcs0000644000000000000000000000013212654402377026376 xustar0030 mtime=1454507263.216432861 30 atime=1454507658.777157383 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/AccessClassInPackageSigned/srcs/0000755000175000002070000000000012654402377027176 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/AccessClassInPackageSigned/srcs/PaxHeaders.17941/AccessCl0000644000000000000000000000031512654402377030061 xustar00116 path=icedtea-web-1.6.2/tests/reproducers/signed/AccessClassInPackageSigned/srcs/AccessClassInPackageSigned.java 30 mtime=1454507263.216432861 29 atime=1454507327.23157911 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/AccessClassInPackageSigned/srcs/AccessClassInPackageSigne0000644000175000002070000000350712654402377034046 0ustar00jvanekmock00000000000000/* AccessClassInPackage.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class AccessClassInPackageSigned { public static void main(String[] args) throws Exception{ Class.forName(args[0]); System.out.println("Class was obtained: "+ args[0]); } } icedtea-web-1.6.2/tests/reproducers/signed/AccessClassInPackageSigned/PaxHeaders.17941/resources0000644000000000000000000000013212654402377027436 xustar0030 mtime=1454507263.215432874 30 atime=1454507658.777157383 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/AccessClassInPackageSigned/resources/0000755000175000002070000000000012654402377030236 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/AccessClassInPackageSigned/resources/PaxHeaders.17941/Acc0000644000000000000000000000033012654402377030124 xustar00127 path=icedtea-web-1.6.2/tests/reproducers/signed/AccessClassInPackageSigned/resources/AccessClassInPackageSignedSUNSEC.jnlp 30 mtime=1454507263.215432874 29 atime=1454507327.23157911 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/AccessClassInPackageSigned/resources/AccessClassInPackage0000644000175000002070000000452312654402377034117 0ustar00jvanekmock00000000000000 Test accessClassInPackage by signed app IcedTea testing access to sun.security.* package by signed app sun.security.internal.spec.TlsKeyMaterialSpec icedtea-web-1.6.2/tests/reproducers/signed/AccessClassInPackageSigned/resources/PaxHeaders.17941/Acc0000644000000000000000000000032612654402377030131 xustar00125 path=icedtea-web-1.6.2/tests/reproducers/signed/AccessClassInPackageSigned/resources/AccessClassInPackageSignedSELF.jnlp 30 mtime=1454507263.215432874 29 atime=1454507327.23157911 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/AccessClassInPackageSigned/resources/AccessClassInPackage0000644000175000002070000000450312654402377034115 0ustar00jvanekmock00000000000000 Test accessClassInPackage by signed app IcedTea testing aaccess to package's internal class by signed app AccessClassInPackageSigned icedtea-web-1.6.2/tests/reproducers/signed/AccessClassInPackageSigned/resources/PaxHeaders.17941/Acc0000644000000000000000000000032712654402377030132 xustar00126 path=icedtea-web-1.6.2/tests/reproducers/signed/AccessClassInPackageSigned/resources/AccessClassInPackageSignedNETSF.jnlp 30 mtime=1454507263.215432874 29 atime=1454507327.23157911 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/AccessClassInPackageSigned/resources/AccessClassInPackage0000644000175000002070000000450712654402377034121 0ustar00jvanekmock00000000000000 Test accessClassInPackage by signed app IcedTea testing access to net.sourceforge.* package by signed app net.sourceforge.jnlp.Parser icedtea-web-1.6.2/tests/reproducers/signed/AccessClassInPackageSigned/resources/PaxHeaders.17941/Acc0000644000000000000000000000033312654402377030127 xustar00130 path=icedtea-web-1.6.2/tests/reproducers/signed/AccessClassInPackageSigned/resources/AccessClassInPackageSignedJAVAXJNLP.jnlp 30 mtime=1454507263.215432874 29 atime=1454507327.23157911 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/AccessClassInPackageSigned/resources/AccessClassInPackage0000644000175000002070000000447212654402377034122 0ustar00jvanekmock00000000000000 Test accessClassInPackage signed IcedTea testing access to some javax.jnlp.* package by signed app javax.jnlp.ServiceManager icedtea-web-1.6.2/tests/reproducers/signed/PaxHeaders.17941/SandboxSignedAllPerm0000644000000000000000000000013212654402377024345 xustar0030 mtime=1454507263.214432888 30 atime=1454507658.777157383 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedAllPerm/0000755000175000002070000000000012654402377025145 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedAllPerm/PaxHeaders.17941/resources0000644000000000000000000000013212654402377026357 xustar0030 mtime=1454507263.213432901 30 atime=1454507658.777157383 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedAllPerm/resources/0000755000175000002070000000000012654402377027157 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedAllPerm/resources/PaxHeaders.17941/SandboxSi0000644000000000000000000000013112654402377030250 xustar0030 mtime=1454507263.210432941 29 atime=1454507327.26457867 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedAllPerm/resources/SandboxSignedAllPerm.html0000644000175000002070000000344412654402377034057 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedAllPerm/resources/PaxHeaders.17941/SandboxSi0000644000000000000000000000031712654402377030256 xustar00118 path=icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedAllPerm/resources/SandboxSignedAllPerm_security.jnlp 30 mtime=1454507263.213432901 29 atime=1454507327.26457867 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedAllPerm/resources/SandboxSignedAllPerm_secur0000644000175000002070000000435212654402377034314 0ustar00jvanekmock00000000000000 SandboxSignedAllPerm IcedTea SandboxSignedAllPerm icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedAllPerm/resources/PaxHeaders.17941/SandboxSi0000644000000000000000000000032612654402377030256 xustar00125 path=icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedAllPerm/resources/SandboxSignedAllPerm_applet_security.jnlp 30 mtime=1454507263.213432901 29 atime=1454507327.26457867 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedAllPerm/resources/SandboxSignedAllPerm_apple0000644000175000002070000000453512654402377034277 0ustar00jvanekmock00000000000000 SandboxSignedAllPerm IcedTea SandboxSignedAllPerm icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedAllPerm/resources/PaxHeaders.17941/SandboxSi0000644000000000000000000000031512654402377030254 xustar00116 path=icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedAllPerm/resources/SandboxSignedAllPerm_applet.jnlp 30 mtime=1454507263.212432914 29 atime=1454507327.26457867 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedAllPerm/resources/SandboxSignedAllPerm_apple0000644000175000002070000000441712654402377034276 0ustar00jvanekmock00000000000000 SandboxSignedAllPerm IcedTea SandboxSignedAllPerm icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedAllPerm/resources/PaxHeaders.17941/SandboxSi0000644000000000000000000000013112654402377030250 xustar0030 mtime=1454507263.212432914 29 atime=1454507327.26457867 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedAllPerm/resources/SandboxSignedAllPerm.jnlp0000644000175000002070000000425412654402377034056 0ustar00jvanekmock00000000000000 SandboxSignedAllPerm IcedTea SandboxSignedAllPerm icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedAllPerm/PaxHeaders.17941/testcases0000644000000000000000000000013212654402377026343 xustar0030 mtime=1454507263.214432888 30 atime=1454507658.777157383 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedAllPerm/testcases/0000755000175000002070000000000012654402377027143 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedAllPerm/testcases/PaxHeaders.17941/SandboxSi0000644000000000000000000000031312654402377030236 xustar00113 path=icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedAllPerm/testcases/SandboxSignedAllPermTest.java 30 mtime=1454507263.214432888 30 atime=1454507327.265578656 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedAllPerm/testcases/SandboxSignedAllPermTest.j0000644000175000002070000001335112654402377034166 0ustar00jvanekmock00000000000000 import java.io.IOException; import java.util.Arrays; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.AutoErrorClosingListener; import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; import net.sourceforge.jnlp.closinglisteners.StringBasedClosingListener; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.ManifestAttributesChecker; import net.sourceforge.jnlp.tools.DeploymentPropertiesModifier; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; /* AppletTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class SandboxSignedAllPermTest extends BrowserTest { private static final DeploymentPropertiesModifier dpm = new DeploymentPropertiesModifier(); private static final StringBasedClosingListener aok = new AutoOkClosingListener(); private static final StringBasedClosingListener aer = new AutoErrorClosingListener(); private static final String confirmation = "*** applet running ***"; @BeforeClass public static void setDeploymentManifestPermissionReadingOnly() throws IOException{ dpm.setProperties(DeploymentConfiguration.KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK, ManifestAttributesChecker.MANIFEST_ATTRIBUTES_CHECK.PERMISSIONS.toString()); } @AfterClass public static void restoreDeploymentProeprtiees() throws IOException{ dpm.restoreProperties(); } @Test //no security dialog //crash (jnlp dont have all-permnissions) public void javawsAllPermNoSecurity() throws Exception{ ProcessResult p = server.executeJavawsHeadless("SandboxSignedAllPerm.jnlp"); Assert.assertTrue(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } @Test //no security dialog //pass public void javawsAllPermAllSecurity() throws Exception{ ProcessResult p = server.executeJavawsHeadless("SandboxSignedAllPerm_security.jnlp"); Assert.assertTrue(p.stdout.contains(confirmation)); Assert.assertTrue(p.stdout.contains(aok.getCondition())); Assert.assertFalse(p.stderr.contains(aer.getCondition())); } @Test //no security dialog //crash (jnlp dont have all-permnissions) public void javawsAppletAllPermNoSecurity() throws Exception{ ProcessResult p = server.executeJavaws(Arrays.asList(new String[]{"-headless", "-verbose"}), "SandboxSignedAllPerm_applet.jnlp", new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); //applets have exception flused only in verbose mode? strange... } @Test //no security dialog //pass public void javawsAppletAllPermAllSecurity() throws Exception{ ProcessResult p = server.executeJavawsHeadless("SandboxSignedAllPerm_applet_security.jnlp", new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(p.stdout.contains(confirmation)); Assert.assertTrue(p.stdout.contains(aok.getCondition())); Assert.assertFalse(p.stderr.contains(aer.getCondition())); } @Test @TestInBrowsers(testIn = Browsers.one) //no security dialog //pass public void appletAllPermAllSecurity() throws Exception{ server.getBrowserLocation(); ProcessResult p = server.executeBrowser("SandboxSignedAllPerm.html", ServerAccess.AutoClose.CLOSE_ON_BOTH); Assert.assertTrue(p.stdout.contains(confirmation)); Assert.assertTrue(p.stdout.contains(aok.getCondition())); Assert.assertFalse(p.stderr.contains(aer.getCondition())); } } icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedAllPerm/PaxHeaders.17941/srcs0000644000000000000000000000013212654402377025317 xustar0030 mtime=1454507263.213432901 30 atime=1454507658.777157383 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedAllPerm/srcs/0000755000175000002070000000000012654402377026117 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedAllPerm/srcs/PaxHeaders.17941/SandboxSignedA0000644000000000000000000000013212654402377030150 xustar0030 mtime=1454507263.213432901 30 atime=1454507327.265578656 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedAllPerm/srcs/SandboxSignedAllPerm.java0000644000175000002070000000406112654402377032770 0ustar00jvanekmock00000000000000 import java.applet.Applet; /* AppletTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class SandboxSignedAllPerm extends Applet { @Override public void init() { confirm(); } public static void main(String... s) { confirm(); } private static void confirm() { System.out.println("*** applet running ***"); System.out.println(System.getProperty("user.home")); System.out.println("*** APPLET FINISHED ***"); } } icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedAllPerm/srcs/PaxHeaders.17941/META-INF0000644000000000000000000000013212654402377026457 xustar0030 mtime=1454507263.213432901 30 atime=1454507658.777157383 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedAllPerm/srcs/META-INF/0000755000175000002070000000000012654402377027257 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedAllPerm/srcs/META-INF/PaxHeaders.17941/MANIF0000644000000000000000000000013212654402377027311 xustar0030 mtime=1454507263.213432901 30 atime=1454507327.265578656 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedAllPerm/srcs/META-INF/MANIFEST.MF0000644000175000002070000000006412654402377030711 0ustar00jvanekmock00000000000000Manifest-Version: 1.0 Permissions: all-permissions icedtea-web-1.6.2/tests/reproducers/signed/PaxHeaders.17941/RunInSandbox0000644000000000000000000000013212654402377022712 xustar0030 mtime=1454507263.265432208 30 atime=1454507658.777157383 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/RunInSandbox/0000755000175000002070000000000012654402377023512 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/RunInSandbox/PaxHeaders.17941/srcs0000644000000000000000000000013212654402377023664 xustar0030 mtime=1454507263.265432208 30 atime=1454507658.777157383 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/RunInSandbox/srcs/0000755000175000002070000000000012654402377024464 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/RunInSandbox/srcs/PaxHeaders.17941/RunInSandbox.java0000644000000000000000000000013212654402377027156 xustar0030 mtime=1454507263.265432208 30 atime=1454507327.263578683 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/RunInSandbox/srcs/RunInSandbox.java0000644000175000002070000000103012654402377027673 0ustar00jvanekmock00000000000000import java.applet.Applet; public class RunInSandbox extends Applet { @Override public void start() { System.out.println("RunInSandbox read: " + read("user.home")); System.out.println("*** APPLET FINISHED ***"); System.exit(0); } public static void main(String[] args) { new RunInSandbox().start(); } private String read(String key) { try { return System.getProperty(key); } catch (Exception e) { return e.toString(); } } } icedtea-web-1.6.2/tests/reproducers/signed/RunInSandbox/PaxHeaders.17941/resources0000644000000000000000000000013212654402377024724 xustar0030 mtime=1454507263.265432208 30 atime=1454507658.777157383 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/RunInSandbox/resources/0000755000175000002070000000000012654402377025524 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/RunInSandbox/resources/PaxHeaders.17941/RunInSandboxJnlpH0000644000000000000000000000013212654402377030232 xustar0030 mtime=1454507263.265432208 30 atime=1454507327.263578683 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/RunInSandbox/resources/RunInSandboxJnlpHref.html0000644000175000002070000000342712654402377032423 0ustar00jvanekmock00000000000000 icedtea-web-1.6.2/tests/reproducers/signed/RunInSandbox/resources/PaxHeaders.17941/RunInSandboxAppli0000644000000000000000000000013212654402377030264 xustar0030 mtime=1454507263.265432208 30 atime=1454507327.263578683 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/RunInSandbox/resources/RunInSandboxApplication.jnlp0000644000175000002070000000431712654402377033154 0ustar00jvanekmock00000000000000 UsesSignedJar IcedTea Test "Run in Sandbox" functionality for signed applets icedtea-web-1.6.2/tests/reproducers/signed/RunInSandbox/resources/PaxHeaders.17941/RunInSandboxApple0000644000000000000000000000013212654402377030260 xustar0030 mtime=1454507263.265432208 30 atime=1454507327.263578683 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/RunInSandbox/resources/RunInSandboxApplet.jnlp0000644000175000002070000000432412654402377032134 0ustar00jvanekmock00000000000000 UsesSignedJar IcedTea Test "Run in Sandbox" functionality for signed applets icedtea-web-1.6.2/tests/reproducers/signed/RunInSandbox/resources/PaxHeaders.17941/RunInSandbox.html0000644000000000000000000000013212654402377030241 xustar0030 mtime=1454507263.265432208 30 atime=1454507327.263578683 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/RunInSandbox/resources/RunInSandbox.html0000644000175000002070000000350012654402377030762 0ustar00jvanekmock00000000000000 icedtea-web-1.6.2/tests/reproducers/signed/RunInSandbox/PaxHeaders.17941/testcases0000644000000000000000000000013212654402377024710 xustar0030 mtime=1454507263.210432941 30 atime=1454507658.777157383 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/RunInSandbox/testcases/0000755000175000002070000000000012654402377025510 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/RunInSandbox/testcases/PaxHeaders.17941/RunInSandboxTest.0000644000000000000000000000013212654402377030200 xustar0030 mtime=1454507263.210432941 30 atime=1454507327.263578683 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/RunInSandbox/testcases/RunInSandboxTest.java0000644000175000002070000000765112654402377031576 0ustar00jvanekmock00000000000000/* RunInSandboxTest.java Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; import net.sourceforge.jnlp.browsertesting.BrowserTest; import java.util.List; import java.util.Collections; import java.util.Arrays; import static org.junit.Assert.*; import org.junit.Test; public class RunInSandboxTest extends BrowserTest { private final List TRUSTALL = Collections.unmodifiableList(Arrays.asList(new String[] { "-Xtrustall" })); private final List TRUSTNONE = Collections.unmodifiableList(Arrays.asList(new String[] { "-Xtrustnone" })); private static final String appletCloseString = AutoOkClosingListener.MAGICAL_OK_CLOSING_STRING; @Test public void testTrustAllJnlpAppletLaunch() throws Exception { ProcessResult pr = server.executeJavawsHeadless(TRUSTALL, "RunInSandboxApplet.jnlp"); assertReadProperty(pr); assertProperClose(pr); } @Test public void testTrustNoneJnlpAppletLaunch() throws Exception { ProcessResult pr = server.executeJavawsHeadless(TRUSTNONE, "RunInSandboxApplet.jnlp"); assertAccessControlException(pr); assertProperClose(pr); } @Test public void testTrustAllStandardJnlpApplicationLaunch() throws Exception { ProcessResult pr = server.executeJavawsHeadless(TRUSTALL, "RunInSandboxApplication.jnlp"); assertReadProperty(pr); assertProperClose(pr); } @Test public void testTrustNoneJnlpApplicationLaunch() throws Exception { ProcessResult pr = server.executeJavawsHeadless(TRUSTNONE, "RunInSandboxApplication.jnlp"); assertAccessControlException(pr); assertProperClose(pr); } private void assertProperClose(ProcessResult pr) { assertTrue("applet should have closed correctly", pr.stdout.contains(appletCloseString)); } private void assertReadProperty(ProcessResult pr) { assertTrue("applet should have been able to read user.home", pr.stdout.contains(System.getProperty("user.home"))); } private void assertAccessControlException(ProcessResult pr) { String ace = "java.security.AccessControlException: access denied (\"java.util.PropertyPermission\" \"user.home\" \"read\")"; assertTrue("applet should not have been able to read user.home", pr.stdout.contains(ace)); } } icedtea-web-1.6.2/tests/reproducers/signed/PaxHeaders.17941/Spaces can be everywhere signed0000644000000000000000000000013212654402377026247 xustar0030 mtime=1454507263.236432594 30 atime=1454507658.777157383 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/Spaces can be everywhere signed/0000755000175000002070000000000012654402377027047 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/Spaces can be everywhere signed/PaxHeaders.17941/testcase0000644000000000000000000000013212654402377030062 xustar0030 mtime=1454507263.236432594 30 atime=1454507658.777157383 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/Spaces can be everywhere signed/testcases/0000755000175000002070000000000012654402377031045 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/Spaces can be everywhere signed/testcases/PaxHeaders.17940000644000000000000000000000033512654402377030171 xustar00132 path=icedtea-web-1.6.2/tests/reproducers/signed/Spaces can be everywhere signed/testcases/SpacesCanBeEverywhereTestsSigned.java 30 mtime=1454507263.236432594 29 atime=1454507327.28257843 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/Spaces can be everywhere signed/testcases/SpacesCanBeEver0000644000175000002070000003075412654402377033732 0ustar00jvanekmock00000000000000/* SpacesCanBeEverywhereTestsSigned.java Copyright (C) 20121 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.util.ArrayList; import java.util.List; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.annotations.Bug; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.annotations.TestInBrowsers; import org.junit.Assert; import org.junit.Test; @Bug(id={"http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2011-October/016127.html","PR804","PR811"}) public class SpacesCanBeEverywhereTestsSigned extends BrowserTest { @Bug(id="PR811") @Test @NeedsDisplay public void SpacesCanBeEverywhereLocalAppletTestsJnlp2Signed() throws Exception { List commands=new ArrayList(1); commands.add(server.getJavawsLocation()); commands.add(server.getDir()+"/NotOnly spaces can kill ěščřž too signed.jnlp"); /* Change of dir is cousing the Exception bellow * ServerAccess.ProcessResult pr = ServerAccess.executeProcess(commands,server.getDir()); * No X11 DISPLAY variable was set, but this program performed an operation which requires it. * at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:173) * at java.awt.Window.(Window.java:476) * at java.awt.Frame.(Frame.java:419) * at java.awt.Frame.(Frame.java:384) * at javax.swing.SwingUtilities$SharedOwnerFrame.(SwingUtilities.java:1754) * at javax.swing.SwingUtilities.getSharedOwnerFrame(SwingUtilities.java:1831) * at javax.swing.JWindow.(JWindow.java:185) * at javax.swing.JWindow.(JWindow.java:137) * at net.sourceforge.jnlp.runtime.JNLPSecurityManager.(JNLPSecurityManager.java:121) * at net.sourceforge.jnlp.runtime.JNLPRuntime.initialize(JNLPRuntime.java:202) * at net.sourceforge.jnlp.runtime.Boot.run(Boot.java:177) * at net.sourceforge.jnlp.runtime.Boot.run(Boot.java:51) * at java.security.AccessController.doPrivileged(Native Method) * at net.sourceforge.jnlp.runtime.Boot.main(Boot.java:168) * * Thats why there is absolute path to the file. * * This is also why SpacesCanBeEverywhereLocalTests1Signed is passing - * it is in headless mode. This can be considered as bug, but because it is * only on ocal files, and probably only from test run - it can be ignored */ ProcessResult pr = ServerAccess.executeProcess(commands); String s="Signed spaces can be everywhere.jsr was launched correctly"; Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s)); Assert.assertFalse("should not be terminated, but was", pr.wasTerminated); Assert.assertEquals((Integer) 0, pr.returnValue); } @Bug(id="PR811") @Test @NeedsDisplay public void SpacesCanBeEverywhereRemoteAppletTestsJnlp2Signed() throws Exception { ProcessResult pr = server.executeJavaws("/NotOnly%20spaces%20can%20kill%20%C4%9B%C5%A1%C4%8D%C5%99%C5%BE%20too%20signed.jnlp"); String s="Signed spaces can be everywhere.jsr was launched correctly"; Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s)); Assert.assertFalse("should NOT be terminated, but was not", pr.wasTerminated); } @Bug(id="PR811") @Test @NeedsDisplay @TestInBrowsers(testIn = {Browsers.one}) public void SpacesCanBeEverywhereRemoteAppletTestsHtml2Signed() throws Exception { ProcessResult pr = server.executeBrowser("/spaces+applet+Tests+signed.html"); String s="Signed spaces can be everywhere.jsr was launched correctly"; Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s)); Assert.assertTrue("should be terminated, but was not", pr.wasTerminated); } @Bug(id={"PR811","http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2011-October/016144.html"}) @Test public void SpacesCanBeEverywhereRemoteTests1Signed() throws Exception { ProcessResult pr = server.executeJavawsHeadless(null, "/Spaces%20can%20be%20everywhere1%20signed.jnlp"); String s = "Good simple javaws exapmle"; Assert.assertTrue("stdout should contains `" + s + "`, but did not", pr.stdout.contains(s)); String cc = "ClassNotFoundException"; Assert.assertFalse("stderr should NOT contains `" + cc + "`, but did", pr.stderr.contains(cc)); Assert.assertFalse("should not be terminated, but was", pr.wasTerminated); Assert.assertEquals((Integer) 0, pr.returnValue); } @Bug(id="PR811") @Test public void SpacesCanBeEverywhereRemoteTests2Signed() throws Exception { ProcessResult pr = server.executeJavawsHeadless(null, "/Spaces%20can%20be%20everywhere2%20signed.jnlp"); String s="Signed spaces can be everywhere.jsr was launched correctly"; Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s)); String cc = "ClassNotFoundException"; Assert.assertFalse("stderr should NOT contains `" + cc + "`, but did", pr.stderr.contains(cc)); Assert.assertFalse("should not be terminated, but was", pr.wasTerminated); Assert.assertEquals((Integer) 0, pr.returnValue); } @Bug(id="PR811") @Test public void SpacesCanBeEverywhereRemoteTests2Signed_withQuery1() throws Exception { ProcessResult pr = server.executeJavawsHeadless(null, "/Spaces%20can%20be%20everywhere2%20signed.jnlp?test=20"); String s="Signed spaces can be everywhere.jsr was launched correctly"; Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s)); String cc = "ClassNotFoundException"; Assert.assertFalse("stderr should NOT contains `" + cc + "`, but did", pr.stderr.contains(cc)); Assert.assertFalse("should not be terminated, but was", pr.wasTerminated); Assert.assertEquals((Integer) 0, pr.returnValue); } @Bug(id="PR811") @Test public void SpacesCanBeEverywhereRemoteTests2Signed_withQuery2() throws Exception { ProcessResult pr = server.executeJavawsHeadless(null, "/Spaces%20can%20be%20everywhere2%20signed.jnlp?test%3D20"); String s="Signed spaces can be everywhere.jsr was launched correctly"; Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s)); String cc = "ClassNotFoundException"; Assert.assertFalse("stderr should NOT contains `" + cc + "`, but did", pr.stderr.contains(cc)); Assert.assertFalse("should not be terminated, but was", pr.wasTerminated); Assert.assertEquals((Integer) 0, pr.returnValue); } @Bug(id="PR811") @Test public void SpacesCanBeEverywhereRemoteTests3Signed() throws Exception { ProcessResult pr = server.executeJavawsHeadless(null, "/SpacesCanBeEverywhere1signed.jnlp"); String s="Signed spaces can be everywhere.jsr was launched correctly"; Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s)); String cc = "ClassNotFoundException"; Assert.assertFalse("stderr should NOT contains `" + cc + "`, but did", pr.stderr.contains(cc)); Assert.assertFalse("should not be terminated, but was", pr.wasTerminated); Assert.assertEquals((Integer) 0, pr.returnValue); } @Bug(id="PR804") @Test public void SpacesCanBeEverywhereLocalTests1Signed() throws Exception { List commands=new ArrayList(4); commands.add(server.getJavawsLocation()); commands.add(ServerAccess.HEADLES_OPTION); commands.add("Spaces can be everywhere1.jnlp"); ProcessResult pr = ServerAccess.executeProcess(commands,server.getDir()); String s = "Good simple javaws exapmle"; Assert.assertTrue("stdout should contains `" + s + "`, but did not", pr.stdout.contains(s)); String cc = "ClassNotFoundException"; Assert.assertFalse("stderr should NOT contains `" + cc + "`, but did", pr.stderr.contains(cc)); Assert.assertFalse("should not be terminated, but was", pr.wasTerminated); Assert.assertEquals((Integer) 0, pr.returnValue); } @Bug(id="PR804") @Test public void SpacesCanBeEverywhereLocalTests2Signed() throws Exception { List commands=new ArrayList(4); commands.add(server.getJavawsLocation()); commands.add(ServerAccess.HEADLES_OPTION); commands.add("Spaces can be everywhere2 signed.jnlp"); ProcessResult pr = ServerAccess.executeProcess(commands,server.getDir()); String s="Signed spaces can be everywhere.jsr was launched correctly"; Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s)); String cc = "ClassNotFoundException"; Assert.assertFalse("stderr should NOT contains `" + cc + "`, but did", pr.stderr.contains(cc)); Assert.assertFalse("should not be terminated, but was", pr.wasTerminated); Assert.assertEquals((Integer) 0, pr.returnValue); } @Bug(id="PR804") @Test public void SpacesCanBeEverywhereLocalTests4Signed() throws Exception { List commands=new ArrayList(4); commands.add(server.getJavawsLocation()); commands.add(ServerAccess.HEADLES_OPTION); commands.add(server.getDir()+"/Spaces can be everywhere2 signed.jnlp"); ProcessResult pr = ServerAccess.executeProcess(commands); String s="Signed spaces can be everywhere.jsr was launched correctly"; Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s)); String cc = "ClassNotFoundException"; Assert.assertFalse("stderr should NOT contains `" + cc + "`, but did", pr.stderr.contains(cc)); Assert.assertFalse("should not be terminated, but was", pr.wasTerminated); Assert.assertEquals((Integer) 0, pr.returnValue); } @Bug(id="PR804") @Test public void SpacesCanBeEverywhereLocalTests3Signed() throws Exception { List commands=new ArrayList(4); commands.add(server.getJavawsLocation()); commands.add(ServerAccess.HEADLES_OPTION); commands.add("SpacesCanBeEverywhere1signed.jnlp"); ProcessResult pr = ServerAccess.executeProcess(commands,server.getDir()); String s="Signed spaces can be everywhere.jsr was launched correctly"; Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s)); String cc = "ClassNotFoundException"; Assert.assertFalse("stderr should NOT contains `" + cc + "`, but did", pr.stderr.contains(cc)); Assert.assertFalse("should not be terminated, but was", pr.wasTerminated); Assert.assertEquals((Integer) 0, pr.returnValue); } } icedtea-web-1.6.2/tests/reproducers/signed/Spaces can be everywhere signed/PaxHeaders.17941/srcs0000644000000000000000000000013212654402377027221 xustar0030 mtime=1454507263.236432594 30 atime=1454507658.777157383 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/Spaces can be everywhere signed/srcs/0000755000175000002070000000000012654402377030021 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/Spaces can be everywhere signed/srcs/PaxHeaders.17941/Spa0000644000000000000000000000032312654402377027746 xustar00122 path=icedtea-web-1.6.2/tests/reproducers/signed/Spaces can be everywhere signed/srcs/SpacesCanBeEverywhereSigned.java 30 mtime=1454507263.236432594 29 atime=1454507327.28257843 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/Spaces can be everywhere signed/srcs/SpacesCanBeEverywher0000644000175000002070000000467712654402377033772 0ustar00jvanekmock00000000000000 import java.applet.Applet; /* SpacesCanBeEverywhereSigned.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class SpacesCanBeEverywhereSigned extends Applet{ public static void main(String[] args){ System.out.println("Signed spaces can be everywhere.jsr was launched correctly"); } private class Killer extends Thread { public int n = 2000; @Override public void run() { try { Thread.sleep(n); System.out.println("Applet killing himself after " + n + " ms of life"); System.exit(0); } catch (Exception ex) { } } } private Killer killer; @Override public void init() { killer = new Killer(); } @Override public void start() { main(null); killer.start(); System.out.println("killer was started"); } } icedtea-web-1.6.2/tests/reproducers/signed/Spaces can be everywhere signed/PaxHeaders.17941/resource0000644000000000000000000000013212654402377030076 xustar0030 mtime=1454507263.235432608 30 atime=1454507658.777157383 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/Spaces can be everywhere signed/resources/0000755000175000002070000000000012654402377031061 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/Spaces can be everywhere signed/resources/PaxHeaders.17940000644000000000000000000000033012654402377030200 xustar00126 path=icedtea-web-1.6.2/tests/reproducers/signed/Spaces can be everywhere signed/resources/spaces applet Tests signed.html 30 mtime=1454507263.235432608 30 atime=1454507327.281578443 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/Spaces can be everywhere signed/resources/spaces applet T0000644000175000002070000000346312654402377033722 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/signed/Spaces can be everywhere signed/resources/PaxHeaders.17940000644000000000000000000000033212654402377030202 xustar00128 path=icedtea-web-1.6.2/tests/reproducers/signed/Spaces can be everywhere signed/resources/SpacesCanBeEverywhere1signed.jnlp 30 mtime=1454507263.235432608 30 atime=1454507327.281578443 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/Spaces can be everywhere signed/resources/SpacesCanBeEver0000644000175000002070000000424512654402377033742 0ustar00jvanekmock00000000000000 Spaces can be everywhere signed IcedTea simpletest1 icedtea-web-1.6.2/tests/reproducers/signed/Spaces can be everywhere signed/resources/PaxHeaders.17940000644000000000000000000000033612654402377030206 xustar00132 path=icedtea-web-1.6.2/tests/reproducers/signed/Spaces can be everywhere signed/resources/Spaces can be everywhere2 signed.jnlp 30 mtime=1454507263.235432608 30 atime=1454507327.281578443 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/Spaces can be everywhere signed/resources/Spaces can be e0000644000175000002070000000427012654402377033523 0ustar00jvanekmock00000000000000 Spaces can be everywhere2 IcedTea Spaces can be everywhere2 signed icedtea-web-1.6.2/tests/reproducers/signed/Spaces can be everywhere signed/resources/PaxHeaders.17940000644000000000000000000000033612654402377030206 xustar00132 path=icedtea-web-1.6.2/tests/reproducers/signed/Spaces can be everywhere signed/resources/Spaces can be everywhere1 signed.jnlp 30 mtime=1454507263.235432608 30 atime=1454507327.281578443 30 ctime=1454507658.761157597 icedtea-web-1.6.2/tests/reproducers/signed/Spaces can be everywhere signed/resources/Spaces can be e0000644000175000002070000000424712654402377033527 0ustar00jvanekmock00000000000000 Spaces can be everywhere1 signed IcedTea Spaces can be everywhere1 signed icedtea-web-1.6.2/tests/reproducers/signed/Spaces can be everywhere signed/resources/PaxHeaders.17940000644000000000000000000000035212654402377030204 xustar00145 path=icedtea-web-1.6.2/tests/reproducers/signed/Spaces can be everywhere signed/resources/NotOnly spaces can kill ěščřž too signed.jnlp 30 mtime=1454507263.234432621 30 atime=1454507327.281578443 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/Spaces can be everywhere signed/resources/NotOnly spaces 0000644000175000002070000000456512654402377033717 0ustar00jvanekmock00000000000000 Spaces can be everywhere test with few more chars for encoding signed IcedTea AppletTest icedtea-web-1.6.2/tests/reproducers/signed/PaxHeaders.17941/SimpletestSigned10000644000000000000000000000013112654402377023703 xustar0030 mtime=1454507263.234432621 30 atime=1454507658.777157383 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SimpletestSigned1/0000755000175000002070000000000012654402377024504 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/SimpletestSigned1/PaxHeaders.17941/srcs0000644000000000000000000000013112654402377024655 xustar0030 mtime=1454507263.234432621 30 atime=1454507658.777157383 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SimpletestSigned1/srcs/0000755000175000002070000000000012654402377025456 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/SimpletestSigned1/srcs/PaxHeaders.17941/SimpletestSigned10000644000000000000000000000013112654402377030221 xustar0030 mtime=1454507263.234432621 30 atime=1454507327.280578456 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SimpletestSigned1/srcs/SimpletestSigned1.java0000644000175000002070000000337612654402377031676 0ustar00jvanekmock00000000000000/* SimpletestSigned1.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class SimpletestSigned1{ public static void main(String[] args){ System.out.println("Good simple javaws exapmle"); } } icedtea-web-1.6.2/tests/reproducers/signed/SimpletestSigned1/PaxHeaders.17941/resources0000644000000000000000000000013112654402377025715 xustar0030 mtime=1454507263.234432621 30 atime=1454507658.777157383 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SimpletestSigned1/resources/0000755000175000002070000000000012654402377026516 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/SimpletestSigned1/resources/PaxHeaders.17941/SimpletestSi0000644000000000000000000000013112654402377030342 xustar0030 mtime=1454507263.234432621 30 atime=1454507327.280578456 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SimpletestSigned1/resources/SimpletestSigned1.jnlp0000644000175000002070000000415612654402377032755 0ustar00jvanekmock00000000000000 simpletest1 IcedTea simpletest1 icedtea-web-1.6.2/tests/reproducers/signed/PaxHeaders.17941/SignedJnlpTemplate0000644000000000000000000000013112654402377024070 xustar0030 mtime=1454507263.233432634 30 atime=1454507658.777157383 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpTemplate/0000755000175000002070000000000012654402377024671 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpTemplate/PaxHeaders.17941/testcases0000644000000000000000000000013112654402377026066 xustar0030 mtime=1454507263.233432634 30 atime=1454507658.777157383 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpTemplate/testcases/0000755000175000002070000000000012654402377026667 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpTemplate/testcases/PaxHeaders.17941/SignedJnlpT0000644000000000000000000000013112654402377030247 xustar0030 mtime=1454507263.233432634 30 atime=1454507327.280578456 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpTemplate/testcases/SignedJnlpTemplateTest.java0000644000175000002070000000665112654402377034133 0ustar00jvanekmock00000000000000/* SignedJnlpTemplateTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.util.Arrays; import java.util.Collections; import java.util.List; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import org.junit.Assert; import org.junit.Test; public class SignedJnlpTemplateTest { private static ServerAccess server = new ServerAccess(); private final List l = Collections.unmodifiableList(Arrays.asList(new String[] { "-Xtrustall" })); private final String signedException = "net.sourceforge.jnlp.LaunchException: Fatal: Application Error: The signed " + "JNLP file did not match the launching JNLP file. Missing Resource: Signed Application did not match " + "launching JNLP File"; @Test public void launchingFileMatchesSignedTemplate1() throws Exception { ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpTemplate1.jnlp"); String s = "Running signed application in main"; Assert.assertTrue("Stdout should contains " + s + " but did not", pr.stdout.contains(s)); } /** * Missing 'j2se' child within the 'resource' element in the launching JNLP file */ @Test public void launchingFileDoesNotMatchSignedTemplate2() throws Exception { ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpTemplate2.jnlp"); Assert.assertTrue("Stderr should contains " + signedException + " but did not", pr.stderr.contains(signedException)); } /** * Added an extra "information" element to the launching JNLP file * */ @Test public void launchingFileDoesNotMatchSignedTemplate3() throws Exception { ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpTemplate3.jnlp"); Assert.assertTrue("Stderr should contains " + signedException + " but did not", pr.stderr.contains(signedException)); } } icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpTemplate/PaxHeaders.17941/srcs0000644000000000000000000000013112654402377025042 xustar0030 mtime=1454507263.233432634 30 atime=1454507658.777157383 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpTemplate/srcs/0000755000175000002070000000000012654402377025643 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpTemplate/srcs/PaxHeaders.17941/SignedJnlpTempla0000644000000000000000000000013112654402377030242 xustar0030 mtime=1454507263.233432634 30 atime=1454507327.280578456 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpTemplate/srcs/SignedJnlpTemplate.java0000644000175000002070000000341212654402377032237 0ustar00jvanekmock00000000000000/* SignedJnlpTemplate.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class SignedJnlpTemplate { public static void main(String[] args) { System.out.println("Running signed application in main"); } } icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpTemplate/srcs/PaxHeaders.17941/JNLP-INF0000644000000000000000000000013112654402377026217 xustar0030 mtime=1454507263.233432634 30 atime=1454507658.777157383 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpTemplate/srcs/JNLP-INF/0000755000175000002070000000000012654402377027020 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpTemplate/srcs/JNLP-INF/PaxHeaders.17941/APPLICA0000644000000000000000000000031012654402377027267 xustar00111 path=icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpTemplate/srcs/JNLP-INF/APPLICATION_TEMPLATE.jnlp 30 mtime=1454507263.233432634 30 atime=1454507327.280578456 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpTemplate/srcs/JNLP-INF/APPLICATION_TEMPLATE.jnl0000644000175000002070000000432612654402377032570 0ustar00jvanekmock00000000000000 * IcedTea * icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpTemplate/PaxHeaders.17941/resources0000644000000000000000000000013112654402377026102 xustar0030 mtime=1454507263.232432648 30 atime=1454507658.777157383 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpTemplate/resources/0000755000175000002070000000000012654402377026703 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpTemplate/resources/PaxHeaders.17941/SignedJnlpT0000644000000000000000000000013012654402377030262 xustar0030 mtime=1454507263.232432648 29 atime=1454507327.27957847 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpTemplate/resources/SignedJnlpTemplate3.jnlp0000644000175000002070000000504712654402377033412 0ustar00jvanekmock00000000000000 SignedJnlpTemplate IcedTea SignedJnlpTemplate IcedTea-Web IcedTea icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpTemplate/resources/PaxHeaders.17941/SignedJnlpT0000644000000000000000000000013012654402377030262 xustar0030 mtime=1454507263.232432648 29 atime=1454507327.27957847 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpTemplate/resources/SignedJnlpTemplate2.jnlp0000644000175000002070000000467312654402377033415 0ustar00jvanekmock00000000000000 SignedJnlpTemplate IcedTea SignedJnlpTemplate icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpTemplate/resources/PaxHeaders.17941/SignedJnlpT0000644000000000000000000000013012654402377030262 xustar0030 mtime=1454507263.232432648 29 atime=1454507327.27957847 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpTemplate/resources/SignedJnlpTemplate1.jnlp0000644000175000002070000000464612654402377033414 0ustar00jvanekmock00000000000000 SignedJnlpTemplate IcedTea SignedJnlpTemplate icedtea-web-1.6.2/tests/reproducers/signed/PaxHeaders.17941/SignedJnlpResource0000644000000000000000000000013112654402377024104 xustar0030 mtime=1454507263.231432661 30 atime=1454507658.777157383 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpResource/0000755000175000002070000000000012654402377024705 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpResource/PaxHeaders.17941/srcs0000644000000000000000000000013112654402377025056 xustar0030 mtime=1454507263.232432648 30 atime=1454507658.777157383 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpResource/srcs/0000755000175000002070000000000012654402377025657 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpResource/srcs/PaxHeaders.17941/SignedJnlpResour0000644000000000000000000000013012654402377030312 xustar0030 mtime=1454507263.232432648 29 atime=1454507327.27957847 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpResource/srcs/SignedJnlpResource.java0000644000175000002070000000340512654402377032271 0ustar00jvanekmock00000000000000/* SignedJnlpResource..java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class SignedJnlpResource { public static void main(String[] args){ System.out.println("Running SignedJnlpResource..."); } } icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpResource/srcs/PaxHeaders.17941/JNLP-INF0000644000000000000000000000013112654402377026233 xustar0030 mtime=1454507263.231432661 30 atime=1454507658.777157383 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpResource/srcs/JNLP-INF/0000755000175000002070000000000012654402377027034 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpResource/srcs/JNLP-INF/PaxHeaders.17941/APPLICA0000644000000000000000000000030712654402377027311 xustar00111 path=icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpResource/srcs/JNLP-INF/APPLICATION_TEMPLATE.jnlp 30 mtime=1454507263.231432661 29 atime=1454507327.27957847 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpResource/srcs/JNLP-INF/APPLICATION_TEMPLATE.jnl0000644000175000002070000000405412654402377032602 0ustar00jvanekmock00000000000000 MATCHES SIGNED JNLP * MATCHES SIGNED JNLP icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpResource/PaxHeaders.17941/resources0000644000000000000000000000013112654402377026116 xustar0030 mtime=1454507263.231432661 30 atime=1454507658.777157383 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpResource/resources/0000755000175000002070000000000012654402377026717 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpResource/resources/PaxHeaders.17941/UnmatchingS0000644000000000000000000000031512654402377030342 xustar00116 path=icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpResource/resources/UnmatchingSignedJnlpExtension.jnlp 30 mtime=1454507263.231432661 30 atime=1454507327.278578483 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpResource/resources/UnmatchingSignedJnlpExtensio0000644000175000002070000000473112654402377034441 0ustar00jvanekmock00000000000000 UnmatchingSignedJnlpExtension IcedTea UnmatchingSignedJnlpExtension icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpResource/resources/PaxHeaders.17941/MatchingSig0000644000000000000000000000031312654402377030315 xustar00114 path=icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpResource/resources/MatchingSignedJnlpExtension.jnlp 30 mtime=1454507263.231432661 30 atime=1454507327.278578483 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpResource/resources/MatchingSignedJnlpExtension.0000644000175000002070000000461612654402377034334 0ustar00jvanekmock00000000000000 MATCHES SIGNED JNLP IcedTea MATCHES SIGNED JNLP icedtea-web-1.6.2/tests/reproducers/signed/PaxHeaders.17941/SignedJnlpCaseTestTwo0000644000000000000000000000013112654402377024522 xustar0030 mtime=1454507263.230432674 30 atime=1454507658.777157383 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpCaseTestTwo/0000755000175000002070000000000012654402377025323 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpCaseTestTwo/PaxHeaders.17941/testcases0000644000000000000000000000013112654402377026520 xustar0030 mtime=1454507263.230432674 30 atime=1454507658.777157383 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpCaseTestTwo/testcases/0000755000175000002070000000000012654402377027321 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpCaseTestTwo/testcases/PaxHeaders.17941/SignedJn0000644000000000000000000000031012654402377030220 xustar00111 path=icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpCaseTestTwo/testcases/SignedJnlpCaseTwoTest.java 30 mtime=1454507263.231432661 30 atime=1454507327.278578483 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpCaseTestTwo/testcases/SignedJnlpCaseTwoTest.jav0000644000175000002070000000557212654402377034217 0ustar00jvanekmock00000000000000/* SignedJnlpCaseTwoTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.util.Arrays; import java.util.Collections; import java.util.List; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import org.junit.Assert; import org.junit.Test; public class SignedJnlpCaseTwoTest { private static ServerAccess server = new ServerAccess(); private final List l = Collections.unmodifiableList(Arrays.asList(new String[] { "-Xtrustall" })); @Test public void launchingFileMatchesSigned() throws Exception { ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpCaseTestTwo1.jnlp"); String s = "Running signed application in main"; Assert.assertTrue("Stdout should contains " + s + " but did not", pr.stdout.contains(s)); } @Test public void launchingFileDoesNotMatchSigned() throws Exception { ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpCaseTestTwo2.jnlp"); String s = "net.sourceforge.jnlp.LaunchException: Fatal: Application Error: The signed " + "JNLP file did not match the launching JNLP file. Missing Resource: Signed Application did not match " + "launching JNLP File"; Assert.assertTrue("Stderr should contains " + s + " but did not", pr.stderr.contains(s)); } } icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpCaseTestTwo/PaxHeaders.17941/srcs0000644000000000000000000000013112654402377025474 xustar0030 mtime=1454507263.230432674 30 atime=1454507658.777157383 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpCaseTestTwo/srcs/0000755000175000002070000000000012654402377026275 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpCaseTestTwo/srcs/PaxHeaders.17941/SignedJnlpCas0000644000000000000000000000013112654402377030160 xustar0030 mtime=1454507263.230432674 30 atime=1454507327.278578483 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpCaseTestTwo/srcs/SignedJnlpCase.java0000644000175000002070000000340212654402377031770 0ustar00jvanekmock00000000000000/* SignedJnlpCase.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class SignedJnlpCase { public static void main(String[] args) { System.out.println("Running signed application in main"); } } icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpCaseTestTwo/srcs/PaxHeaders.17941/JNLP-INF0000644000000000000000000000013112654402377026651 xustar0030 mtime=1454507263.230432674 30 atime=1454507658.777157383 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpCaseTestTwo/srcs/JNLP-INF/0000755000175000002070000000000012654402377027452 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpCaseTestTwo/srcs/JNLP-INF/PaxHeaders.17941/aPpL0000644000000000000000000000031312654402377027507 xustar00114 path=icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpCaseTestTwo/srcs/JNLP-INF/aPpLiCaTiOn_tEmPlAte.jnlp 30 mtime=1454507263.230432674 30 atime=1454507327.278578483 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpCaseTestTwo/srcs/JNLP-INF/aPpLiCaTiOn_tEmPlAte.0000644000175000002070000000430712654402377033255 0ustar00jvanekmock00000000000000 SignedJnlpCaseTest IcedTea SignedJnlpCaseTest icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpCaseTestTwo/PaxHeaders.17941/resources0000644000000000000000000000013112654402377026534 xustar0030 mtime=1454507263.230432674 30 atime=1454507658.777157383 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpCaseTestTwo/resources/0000755000175000002070000000000012654402377027335 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpCaseTestTwo/resources/PaxHeaders.17941/SignedJn0000644000000000000000000000031112654402377030235 xustar00112 path=icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpCaseTestTwo/resources/SignedJnlpCaseTestTwo2.jnlp 30 mtime=1454507263.230432674 30 atime=1454507327.277578496 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpCaseTestTwo/resources/SignedJnlpCaseTestTwo2.jn0000644000175000002070000000443012654402377034134 0ustar00jvanekmock00000000000000 SignedJnlpCaseTest 2 IcedTea SignedJnlpCaseTest 2 icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpCaseTestTwo/resources/PaxHeaders.17941/SignedJn0000644000000000000000000000031112654402377030235 xustar00112 path=icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpCaseTestTwo/resources/SignedJnlpCaseTestTwo1.jnlp 30 mtime=1454507263.229432688 30 atime=1454507327.277578496 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpCaseTestTwo/resources/SignedJnlpCaseTestTwo1.jn0000644000175000002070000000442412654402377034136 0ustar00jvanekmock00000000000000 SignedJnlpCaseTest IcedTea SignedJnlpCaseTest icedtea-web-1.6.2/tests/reproducers/signed/PaxHeaders.17941/SignedJnlpCaseTestOne0000644000000000000000000000013112654402377024472 xustar0030 mtime=1454507263.229432688 30 atime=1454507658.777157383 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpCaseTestOne/0000755000175000002070000000000012654402377025273 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpCaseTestOne/PaxHeaders.17941/testcases0000644000000000000000000000013112654402377026470 xustar0030 mtime=1454507263.229432688 30 atime=1454507658.777157383 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpCaseTestOne/testcases/0000755000175000002070000000000012654402377027271 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpCaseTestOne/testcases/PaxHeaders.17941/SignedJn0000644000000000000000000000031012654402377030170 xustar00111 path=icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpCaseTestOne/testcases/SignedJnlpCaseOneTest.java 30 mtime=1454507263.229432688 30 atime=1454507327.277578496 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpCaseTestOne/testcases/SignedJnlpCaseOneTest.jav0000644000175000002070000000557312654402377034140 0ustar00jvanekmock00000000000000/* SignedJnlpCaseOneTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.util.Arrays; import java.util.Collections; import java.util.List; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import org.junit.Assert; import org.junit.Test; public class SignedJnlpCaseOneTest { private static ServerAccess server = new ServerAccess(); private final List l = Collections.unmodifiableList(Arrays.asList(new String[] { "-Xtrustall" })); @Test public void launchingFileMatchesSigned() throws Exception { ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpCaseTestOne1.jnlp"); String s = "Running signed application in main"; Assert.assertTrue("Stdout should contains " + s + " but did not", pr.stdout.contains(s)); } @Test public void launchingFileDoesNotMatchSigned() throws Exception { ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpCaseTestOne2.jnlp"); String s = "net.sourceforge.jnlp.LaunchException: Fatal: Application Error: The signed " + "JNLP file did not match the launching JNLP file. Missing Resource: Signed Application did not match " + "launching JNLP File"; Assert.assertTrue("Stderr should contains " + s + " but did not", pr.stderr.contains(s)); } } icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpCaseTestOne/PaxHeaders.17941/srcs0000644000000000000000000000013112654402377025444 xustar0030 mtime=1454507263.229432688 30 atime=1454507658.777157383 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpCaseTestOne/srcs/0000755000175000002070000000000012654402377026245 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpCaseTestOne/srcs/PaxHeaders.17941/SignedJnlpCas0000644000000000000000000000013112654402377030130 xustar0030 mtime=1454507263.229432688 30 atime=1454507327.277578496 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpCaseTestOne/srcs/SignedJnlpCase.java0000644000175000002070000000340212654402377031740 0ustar00jvanekmock00000000000000/* SignedJnlpCase.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class SignedJnlpCase { public static void main(String[] args) { System.out.println("Running signed application in main"); } } icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpCaseTestOne/srcs/PaxHeaders.17941/JNLP-INF0000644000000000000000000000013112654402377026621 xustar0030 mtime=1454507263.229432688 30 atime=1454507658.777157383 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpCaseTestOne/srcs/JNLP-INF/0000755000175000002070000000000012654402377027422 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpCaseTestOne/srcs/JNLP-INF/PaxHeaders.17941/aPpL0000644000000000000000000000013112654402377027455 xustar0030 mtime=1454507263.229432688 30 atime=1454507327.277578496 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpCaseTestOne/srcs/JNLP-INF/aPpLiCaTioN.jnlp0000644000175000002070000000442412654402377032356 0ustar00jvanekmock00000000000000 SignedJnlpCaseTest IcedTea SignedJnlpCaseTest icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpCaseTestOne/PaxHeaders.17941/resources0000644000000000000000000000013112654402377026504 xustar0030 mtime=1454507263.228432701 30 atime=1454507658.777157383 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpCaseTestOne/resources/0000755000175000002070000000000012654402377027305 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpCaseTestOne/resources/PaxHeaders.17941/SignedJn0000644000000000000000000000031112654402377030205 xustar00112 path=icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpCaseTestOne/resources/SignedJnlpCaseTestOne2.jnlp 30 mtime=1454507263.228432701 30 atime=1454507327.277578496 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpCaseTestOne/resources/SignedJnlpCaseTestOne2.jn0000644000175000002070000000443012654402377034054 0ustar00jvanekmock00000000000000 SignedJnlpCaseTest 2 IcedTea SignedJnlpCaseTest 2 icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpCaseTestOne/resources/PaxHeaders.17941/SignedJn0000644000000000000000000000031012654402377030204 xustar00112 path=icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpCaseTestOne/resources/SignedJnlpCaseTestOne1.jnlp 30 mtime=1454507263.228432701 29 atime=1454507327.27657851 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpCaseTestOne/resources/SignedJnlpCaseTestOne1.jn0000644000175000002070000000442412654402377034056 0ustar00jvanekmock00000000000000 SignedJnlpCaseTest IcedTea SignedJnlpCaseTest icedtea-web-1.6.2/tests/reproducers/signed/PaxHeaders.17941/SignedJnlpApplication0000644000000000000000000000013112654402377024560 xustar0030 mtime=1454507263.228432701 30 atime=1454507658.777157383 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpApplication/0000755000175000002070000000000012654402377025361 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpApplication/PaxHeaders.17941/testcases0000644000000000000000000000013112654402377026556 xustar0030 mtime=1454507263.228432701 30 atime=1454507658.777157383 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpApplication/testcases/0000755000175000002070000000000012654402377027357 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpApplication/testcases/PaxHeaders.17941/SignedJn0000644000000000000000000000031312654402377030261 xustar00115 path=icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpApplication/testcases/SignedJnlpApplicationTest.java 30 mtime=1454507263.228432701 29 atime=1454507327.27657851 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpApplication/testcases/SignedJnlpApplicationTest0000644000175000002070000000673012654402377034371 0ustar00jvanekmock00000000000000/* SignedJnlpApplicationTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.util.Arrays; import java.util.Collections; import java.util.List; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import org.junit.Assert; import org.junit.Test; public class SignedJnlpApplicationTest { private static ServerAccess server = new ServerAccess(); private final List l = Collections.unmodifiableList(Arrays.asList(new String[] { "-Xtrustall" })); private final String signedException = "net.sourceforge.jnlp.LaunchException: Fatal: Application Error: The signed " + "JNLP file did not match the launching JNLP file. Missing Resource: Signed Application did not match " + "launching JNLP File"; @Test public void launchingFileMatchesSignedApplication1() throws Exception { ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpApplication1.jnlp"); String s = "Running signed application in main"; Assert.assertTrue("Stdout should contains " + s + " but did not", pr.stdout.contains(s)); } /** * Using a different value of name within the 'property' element in the launching JNLP file */ @Test public void launchingFileDoesNotMatchSignedApplication1() throws Exception { ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpApplication2.jnlp"); Assert.assertTrue("Stderr should contains " + signedException + " but did not", pr.stderr.contains(signedException)); } /** * Missing 'property' child element within 'resource' in the launching JNLP file */ @Test public void launchingFileDoesNotMatchSignedApplication2() throws Exception { ProcessResult pr = server.executeJavawsHeadless(l, "/SignedJnlpApplication3.jnlp"); Assert.assertTrue("Stderr should contains " + signedException + " but did not", pr.stderr.contains(signedException)); } } icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpApplication/PaxHeaders.17941/srcs0000644000000000000000000000013112654402377025532 xustar0030 mtime=1454507263.227432714 30 atime=1454507658.777157383 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpApplication/srcs/0000755000175000002070000000000012654402377026333 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpApplication/srcs/PaxHeaders.17941/SignedJnlpApp0000644000000000000000000000013012654402377030227 xustar0030 mtime=1454507263.227432714 29 atime=1454507327.27657851 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpApplication/srcs/SignedJnlpApplication.java0000644000175000002070000000342012654402377033416 0ustar00jvanekmock00000000000000/* SignedJnlpApplication.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class SignedJnlpApplication { public static void main(String[] args) { System.out.println("Running signed application in main"); } } icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpApplication/srcs/PaxHeaders.17941/JNLP-INF0000644000000000000000000000013112654402377026707 xustar0030 mtime=1454507263.227432714 30 atime=1454507658.777157383 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpApplication/srcs/JNLP-INF/0000755000175000002070000000000012654402377027510 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpApplication/srcs/JNLP-INF/PaxHeaders.17941/APPL0000644000000000000000000000013012654402377027442 xustar0030 mtime=1454507263.227432714 29 atime=1454507327.27657851 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpApplication/srcs/JNLP-INF/APPLICATION.jnlp0000644000175000002070000000444112654402377032143 0ustar00jvanekmock00000000000000 SignedJnlpApplication IcedTea SignedJnlpApplication icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpApplication/PaxHeaders.17941/resources0000644000000000000000000000013112654402377026572 xustar0030 mtime=1454507263.227432714 30 atime=1454507658.777157383 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpApplication/resources/0000755000175000002070000000000012654402377027373 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpApplication/resources/PaxHeaders.17941/SignedJn0000644000000000000000000000031012654402377030272 xustar00112 path=icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpApplication/resources/SignedJnlpApplication3.jnlp 30 mtime=1454507263.227432714 29 atime=1454507327.27657851 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpApplication/resources/SignedJnlpApplication3.jn0000644000175000002070000000457712654402377034245 0ustar00jvanekmock00000000000000 SignedJnlpApplication IcedTea SignedJnlpApplication icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpApplication/resources/PaxHeaders.17941/SignedJn0000644000000000000000000000031112654402377030273 xustar00112 path=icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpApplication/resources/SignedJnlpApplication2.jnlp 30 mtime=1454507263.226432728 30 atime=1454507327.275578523 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpApplication/resources/SignedJnlpApplication2.jn0000644000175000002070000000501212654402377034225 0ustar00jvanekmock00000000000000 SignedJnlpApplication IcedTea SignedJnlpApplication icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpApplication/resources/PaxHeaders.17941/SignedJn0000644000000000000000000000031112654402377030273 xustar00112 path=icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpApplication/resources/SignedJnlpApplication1.jnlp 30 mtime=1454507263.226432728 30 atime=1454507327.275578523 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedJnlpApplication/resources/SignedJnlpApplication1.jn0000644000175000002070000000444112654402377034231 0ustar00jvanekmock00000000000000 SignedJnlpApplication IcedTea SignedJnlpApplication icedtea-web-1.6.2/tests/reproducers/signed/PaxHeaders.17941/SignedJarResource0000644000000000000000000000013112654402377023715 xustar0030 mtime=1454507263.226432728 30 atime=1454507658.777157383 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedJarResource/0000755000175000002070000000000012654402377024516 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/SignedJarResource/PaxHeaders.17941/srcs0000644000000000000000000000013112654402377024667 xustar0030 mtime=1454507263.226432728 30 atime=1454507658.777157383 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedJarResource/srcs/0000755000175000002070000000000012654402377025470 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/SignedJarResource/srcs/PaxHeaders.17941/SignedJarResource0000644000000000000000000000013112654402377030245 xustar0030 mtime=1454507263.226432728 30 atime=1454507327.275578523 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedJarResource/srcs/SignedJarResource.java0000644000175000002070000000340012654402377031706 0ustar00jvanekmock00000000000000/* SignedJarResource.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class SignedJarResource { public static void main(String[] args){ System.out.println("Running SignedJarResource.."); } } icedtea-web-1.6.2/tests/reproducers/signed/SignedJarResource/PaxHeaders.17941/resources0000644000000000000000000000013112654402377025727 xustar0030 mtime=1454507263.226432728 30 atime=1454507658.777157383 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedJarResource/resources/0000755000175000002070000000000012654402377026530 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/SignedJarResource/resources/PaxHeaders.17941/SignedJarRes0000644000000000000000000000013112654402377030247 xustar0030 mtime=1454507263.226432728 30 atime=1454507327.275578523 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedJarResource/resources/SignedJarResource.jnlp0000644000175000002070000000456112654402377033001 0ustar00jvanekmock00000000000000 SignedJarResource IcedTea SignedJarResource icedtea-web-1.6.2/tests/reproducers/signed/SignedJarResource/resources/PaxHeaders.17941/SignedJarExt0000644000000000000000000000013112654402377030256 xustar0030 mtime=1454507263.225432741 30 atime=1454507327.275578523 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedJarResource/resources/SignedJarExtension.jnlp0000644000175000002070000000464512654402377033171 0ustar00jvanekmock00000000000000 SignedJarExtension IcedTea SignedJarExtension icedtea-web-1.6.2/tests/reproducers/signed/PaxHeaders.17941/SignedAppletManifestSpecifiesSandbox0000644000000000000000000000013112654402377027557 xustar0030 mtime=1454507263.225432741 30 atime=1454507658.777157383 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedAppletManifestSpecifiesSandbox/0000755000175000002070000000000012654402377030360 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/SignedAppletManifestSpecifiesSandbox/PaxHeaders.17941/tes0000644000000000000000000000013112654402377030352 xustar0030 mtime=1454507263.225432741 30 atime=1454507658.777157383 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedAppletManifestSpecifiesSandbox/testcases/0000755000175000002070000000000012654402377032356 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/SignedAppletManifestSpecifiesSandbox/testcases/PaxHeaders0000644000000000000000000000035312654402377031077 xustar00146 path=icedtea-web-1.6.2/tests/reproducers/signed/SignedAppletManifestSpecifiesSandbox/testcases/SignedAppletManifestSpecifiesSandboxTests.java 30 mtime=1454507263.225432741 30 atime=1454507327.274578536 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedAppletManifestSpecifiesSandbox/testcases/SignedAppl0000644000175000002070000001431012654402377034326 0ustar00jvanekmock00000000000000/* SignedAppletManifestSpecifiesSandboxTests.java Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import static org.junit.Assert.assertTrue; import java.io.IOException; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.annotations.Bug; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.ManifestAttributesChecker; import net.sourceforge.jnlp.tools.DeploymentPropertiesModifier; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; public class SignedAppletManifestSpecifiesSandboxTests extends BrowserTest { private static final String STARTING_STRING = "SignedAppletManifestSpecifiesSandbox applet starting"; private static final String CLOSE_STRING = AutoOkClosingListener.MAGICAL_OK_CLOSING_STRING; private static final String EXPECTED_STDOUT_PRINT = "SECURITY EXCEPTION"; private static final String STACKTRACE_EX_TYPE = "AccessControlException"; private static final String JNLP_EXPECTED_STDOUT = "Initialization Error"; private static final String JNLP_EXPECTED_STDERR = "net.sourceforge.jnlp.LaunchException"; private static DeploymentPropertiesModifier deploymentPropertiesModifier; @BeforeClass public static void setupDeploymentProperties() throws IOException { deploymentPropertiesModifier = new DeploymentPropertiesModifier(); deploymentPropertiesModifier.setProperties(DeploymentConfiguration.KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK, ManifestAttributesChecker.MANIFEST_ATTRIBUTES_CHECK.PERMISSIONS.toString()); } @AfterClass public static void setbackDeploymentProperties() throws IOException { deploymentPropertiesModifier.restoreProperties(); } @Test @NeedsDisplay @TestInBrowsers(testIn={Browsers.one}) @Bug(id="PR1769") public void testSignedAppletWithSandboxPermissionsInManifestHtml() throws Exception { final ProcessResult pr = server.executeBrowser("SignedAppletManifestSpecifiesSandbox.html", new AutoOkClosingListener(), null); assertHtmlAppletInitializes(pr); assertHtmlAppletSecurityException(pr); assertHtmlAppletCloses(pr); } @Test @NeedsDisplay @TestInBrowsers(testIn={Browsers.one}) @Bug(id="PR1769") public void testSignedAppletWithSandboxPermissionsInManifestHtmlJnlpHref() throws Exception { final ProcessResult pr = server.executeBrowser("SignedAppletManifestSpecifiesSandboxJnlpHref.html", new AutoOkClosingListener(), null); assertHtmlAppletInitializes(pr); assertHtmlAppletSecurityException(pr); assertHtmlAppletCloses(pr); } /* * JNLP applets and applications are not allowed to have mismatched tags and manifest attributes */ @Test @Bug(id="PR1769") public void testSignedAppletWithSandboxPermissionsInManifestJnlpApplet() throws Exception { final ProcessResult pr = server.executeJavawsHeadless("SignedAppletManifestSpecifiesSandboxApplet.jnlp"); assertJnlpFailsToLaunch(pr); } /* * JNLP applets and applications are not allowed to have mismatched tags and manifest attributes */ @Test @Bug(id="PR1769") public void testSignedAppletWithSandboxPermissionsInManifestJnlpApplication() throws Exception { final ProcessResult pr = server.executeJavawsHeadless("SignedAppletManifestSpecifiesSandboxApplication.jnlp"); assertJnlpFailsToLaunch(pr); } private static void assertHtmlAppletInitializes(final ProcessResult pr) { assertTrue("Applet should have initialized", pr.stdout.contains(STARTING_STRING)); } private static void assertHtmlAppletSecurityException(final ProcessResult pr) { assertTrue("Applet should have printed SECURITY EXCEPTION", pr.stdout.contains(EXPECTED_STDOUT_PRINT)); assertTrue("Applet should have produced an AccessControlException stacktrace", pr.stderr.contains(STACKTRACE_EX_TYPE)); } private static void assertHtmlAppletCloses(final ProcessResult pr) { assertTrue("Applet should have printed its exit string", pr.stdout.contains(CLOSE_STRING)); } private static void assertJnlpFailsToLaunch(final ProcessResult pr) { assertTrue("stdout should have contained Initialization Error", pr.stdout.contains(JNLP_EXPECTED_STDOUT)); assertTrue("stderr should have contained LaunchException", pr.stderr.contains(JNLP_EXPECTED_STDERR)); } } icedtea-web-1.6.2/tests/reproducers/signed/SignedAppletManifestSpecifiesSandbox/PaxHeaders.17941/src0000644000000000000000000000013112654402377030346 xustar0030 mtime=1454507263.225432741 30 atime=1454507658.777157383 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedAppletManifestSpecifiesSandbox/srcs/0000755000175000002070000000000012654402377031332 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/SignedAppletManifestSpecifiesSandbox/srcs/PaxHeaders.17940000644000000000000000000000034112654402377030453 xustar00136 path=icedtea-web-1.6.2/tests/reproducers/signed/SignedAppletManifestSpecifiesSandbox/srcs/SignedAppletManifestSpecifiesSandbox.java 30 mtime=1454507263.225432741 30 atime=1454507327.274578536 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedAppletManifestSpecifiesSandbox/srcs/SignedAppletMan0000644000175000002070000000452712654402377034300 0ustar00jvanekmock00000000000000/* SignedAppletManifestSpecifiesSandbox.java Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.applet.Applet; public class SignedAppletManifestSpecifiesSandbox extends Applet { public static void main(final String[] args) { new SignedAppletManifestSpecifiesSandbox().init(); } @Override public void init() { System.out.println("SignedAppletManifestSpecifiesSandbox applet starting"); System.out.println("Reading user.home: " + getProp("user.home")); System.out.println("*** APPLET FINISHED ***"); } private static String getProp(final String key) { try { return System.getProperty(key); } catch (final SecurityException se) { se.printStackTrace(); return "SECURITY EXCEPTION"; } } } icedtea-web-1.6.2/tests/reproducers/signed/SignedAppletManifestSpecifiesSandbox/srcs/PaxHeaders.17940000644000000000000000000000013112654402377030450 xustar0030 mtime=1454507263.224432754 30 atime=1454507658.777157383 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedAppletManifestSpecifiesSandbox/srcs/META-INF/0000755000175000002070000000000012654402377032472 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/SignedAppletManifestSpecifiesSandbox/srcs/META-INF/PaxHea0000644000000000000000000000031412654402377030332 xustar00115 path=icedtea-web-1.6.2/tests/reproducers/signed/SignedAppletManifestSpecifiesSandbox/srcs/META-INF/MANIFEST.MF 30 mtime=1454507263.224432754 30 atime=1454507327.274578536 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedAppletManifestSpecifiesSandbox/srcs/META-INF/MANIFE0000644000175000002070000000023412654402377033353 0ustar00jvanekmock00000000000000Manifest-Version: 1.0 Permissions: sandbox Application-Library-Allowable-Codebase: http://localhost Application-Name: SignedAppletManifestSpecifiesSandbox icedtea-web-1.6.2/tests/reproducers/signed/SignedAppletManifestSpecifiesSandbox/PaxHeaders.17941/res0000644000000000000000000000013112654402377030350 xustar0030 mtime=1454507263.224432754 30 atime=1454507658.777157383 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedAppletManifestSpecifiesSandbox/resources/0000755000175000002070000000000012654402377032372 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/SignedAppletManifestSpecifiesSandbox/resources/PaxHeaders0000644000000000000000000000035612654402377031116 xustar00149 path=icedtea-web-1.6.2/tests/reproducers/signed/SignedAppletManifestSpecifiesSandbox/resources/SignedAppletManifestSpecifiesSandboxJnlpHref.html 30 mtime=1454507263.224432754 30 atime=1454507327.274578536 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedAppletManifestSpecifiesSandbox/resources/SignedAppl0000644000175000002070000000371512654402377034351 0ustar00jvanekmock00000000000000 icedtea-web-1.6.2/tests/reproducers/signed/SignedAppletManifestSpecifiesSandbox/resources/PaxHeaders0000644000000000000000000000036112654402377031112 xustar00152 path=icedtea-web-1.6.2/tests/reproducers/signed/SignedAppletManifestSpecifiesSandbox/resources/SignedAppletManifestSpecifiesSandboxApplication.jnlp 30 mtime=1454507263.224432754 30 atime=1454507327.274578536 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedAppletManifestSpecifiesSandbox/resources/SignedAppl0000644000175000002070000000453612654402377034353 0ustar00jvanekmock00000000000000 SignedAppletManifestSpecifiesSandbox IcedTea Test Permissions: sandbox manifest attribute icedtea-web-1.6.2/tests/reproducers/signed/SignedAppletManifestSpecifiesSandbox/resources/PaxHeaders0000644000000000000000000000035412654402377031114 xustar00147 path=icedtea-web-1.6.2/tests/reproducers/signed/SignedAppletManifestSpecifiesSandbox/resources/SignedAppletManifestSpecifiesSandboxApplet.jnlp 30 mtime=1454507263.224432754 30 atime=1454507327.274578536 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedAppletManifestSpecifiesSandbox/resources/SignedAppl0000644000175000002070000000451712654402377034352 0ustar00jvanekmock00000000000000 SignedAppletManifestSpecifiesSandbox IcedTea Test Permissions: sandbox manifest attribute icedtea-web-1.6.2/tests/reproducers/signed/SignedAppletManifestSpecifiesSandbox/resources/PaxHeaders0000644000000000000000000000034512654402377031114 xustar00141 path=icedtea-web-1.6.2/tests/reproducers/signed/SignedAppletManifestSpecifiesSandbox/resources/SignedAppletManifestSpecifiesSandbox.html 30 mtime=1454507263.223432768 29 atime=1454507327.27357855 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SignedAppletManifestSpecifiesSandbox/resources/SignedAppl0000644000175000002070000000356012654402377034347 0ustar00jvanekmock00000000000000 icedtea-web-1.6.2/tests/reproducers/signed/PaxHeaders.17941/SavingCookies0000644000000000000000000000013112654402377023103 xustar0030 mtime=1454507263.223432768 30 atime=1454507658.777157383 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SavingCookies/0000755000175000002070000000000012654402377023704 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/SavingCookies/PaxHeaders.17941/testcases0000644000000000000000000000013112654402377025101 xustar0030 mtime=1454507263.223432768 30 atime=1454507658.777157383 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SavingCookies/testcases/0000755000175000002070000000000012654402377025702 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/SavingCookies/testcases/PaxHeaders.17941/SavingCookiesTes0000644000000000000000000000013012654402377030320 xustar0030 mtime=1454507263.223432768 29 atime=1454507327.27357855 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SavingCookies/testcases/SavingCookiesTests.java0000644000175000002070000001713212654402377032340 0ustar00jvanekmock00000000000000/* SavingCookieTests.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.util.Arrays; import java.util.Collections; import java.util.List; import net.sourceforge.jnlp.ContentReaderListener; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.annotations.Bug; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import org.junit.Assert; import org.junit.Test; public class SavingCookiesTests extends BrowserTest { static final String ENTERING_CHECK = "Entered CheckingCookies"; static final String CHECKING_COMPLETION = "Finished CheckingCookies"; static final String SAVING_COMPLETION = "Finished SavingCookies"; private final static List TRUSTALL = Collections.unmodifiableList(Arrays.asList(new String[] { "-Xtrustall" })); static class ParallelRun extends Thread { ParallelRun(String url, String completionString) { this.url = url; this.completionString = completionString; this.completed = false; } ProcessResult pr; private String url; private String completionString; volatile boolean completed; @Override public void run() { try { final ContentReaderListener stdoutListener = new ContentReaderListener() { @Override public void charReaded(char ch) { } @Override public synchronized void lineReaded(String s) { if (completionString != null && s.contains(completionString)) { completed = true; } } }; if (url.endsWith(".html")) { pr = server.executeBrowser(url, stdoutListener, null); } else if (url.endsWith(".jnlp")) { pr = server.executeJavawsHeadless(TRUSTALL, url, stdoutListener, null, null); } } catch (Exception ex) { throw new RuntimeException(ex); } finally { completed = true; } } } final String COOKIE_SESSION_CHECK = "Found cookie: TEST=session"; final String COOKIE_PERSISTENT_CHECK = "Found cookie: TEST=persistent"; @Test @TestInBrowsers(testIn = { Browsers.one }) public void AppletCheckCookieIsntSet() throws Exception { final String COOKIE_SANITY_CHECK = "Found cookie: TEST="; ProcessResult pr = server.executeBrowser("/CheckCookie.html"); Assert.assertFalse("stdout should NOT contain '" + COOKIE_SANITY_CHECK + "' but did.", pr.stdout.contains(COOKIE_SANITY_CHECK)); Assert.assertTrue("stdout should contain '" + CHECKING_COMPLETION + "' but did not.", pr.stdout.contains(CHECKING_COMPLETION)); } @Test @TestInBrowsers(testIn = { Browsers.one }) @Bug(id = "PR588") public void AppletSessionCookieShowDoc() throws Exception { ProcessResult pr = server.executeBrowser("/SaveSessionCookieAndGotoCheck.html"); Assert.assertTrue("stdout should contain '" + ENTERING_CHECK + "' but did not.", pr.stdout.contains(ENTERING_CHECK)); Assert.assertTrue("stdout should contain '" + COOKIE_SESSION_CHECK + "' but did not.", pr.stdout.contains(COOKIE_SESSION_CHECK)); } @Test @TestInBrowsers(testIn = { Browsers.one }) @Bug(id = "PR588") public void AppletSessionCookieParallel() throws Exception { ParallelRun save = new ParallelRun("/SaveSessionCookie.html", SAVING_COMPLETION); save.start(); while (!save.completed) { Thread.sleep(100); } ProcessResult check = server.executeBrowser("/CheckCookie.html"); save.join(); Assert.assertTrue("stdout should contain '" + ENTERING_CHECK + "' but did not.", save.pr.stdout.contains(ENTERING_CHECK)); //XXX: It is necessary to check save.pr's stdout, because it does not show up in 'check.stdout' for some reason Assert.assertTrue("stdout should contain '" + COOKIE_SESSION_CHECK + "' but did not.", save.pr.stdout.contains(COOKIE_SESSION_CHECK)); } @Test @TestInBrowsers(testIn = { Browsers.one }) @Bug(id = "PR588") public void AppletSessionCookieSequential() throws Exception { ProcessResult save = server.executeBrowser("/SaveSessionCookie.html"); ProcessResult check = server.executeBrowser("/CheckCookie.html"); Assert.assertTrue("stdout should contain '" + ENTERING_CHECK + "' but did not.", check.stdout.contains(ENTERING_CHECK)); //Session cookies should NOT be intact upon browser close and re-open Assert.assertFalse("stdout should NOT contain '" + COOKIE_SESSION_CHECK + "' but did.", check.stdout.contains(COOKIE_SESSION_CHECK)); } @Test @TestInBrowsers(testIn = { Browsers.one }) @Bug(id = "PR588") public void AppletPersistentCookieShowDoc() throws Exception { ProcessResult pr = server.executeBrowser("/SavePersistentCookieAndGotoCheck.html"); Assert.assertTrue("stdout should contain '" + ENTERING_CHECK + "' but did not.", pr.stdout.contains(ENTERING_CHECK)); Assert.assertTrue("stdout should contain '" + COOKIE_PERSISTENT_CHECK + "' but did not.", pr.stdout.contains(COOKIE_PERSISTENT_CHECK)); } @Test @TestInBrowsers(testIn = { Browsers.one }) @Bug(id = "PR588") public void AppletPersistentCookieSequential() throws Exception { ProcessResult save = server.executeBrowser("/SavePersistentCookie.html"); //Use show doc to clear cookie afterwards ProcessResult check = server.executeBrowser("/CheckCookieAndGotoClear.html"); Assert.assertTrue("stdout should contain '" + ENTERING_CHECK + "' but did not.", check.stdout.contains(ENTERING_CHECK)); //Persistent cookies should be stored past this point Assert.assertTrue("stdout should contain '" + COOKIE_PERSISTENT_CHECK + "' but did not.", check.stdout.contains(COOKIE_PERSISTENT_CHECK)); } } icedtea-web-1.6.2/tests/reproducers/signed/SavingCookies/PaxHeaders.17941/srcs0000644000000000000000000000013112654402377024055 xustar0030 mtime=1454507263.223432768 30 atime=1454507658.777157383 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SavingCookies/srcs/0000755000175000002070000000000012654402377024656 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/SavingCookies/srcs/PaxHeaders.17941/SavingCookies.java0000644000000000000000000000013012654402377027540 xustar0030 mtime=1454507263.223432768 29 atime=1454507327.27357855 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SavingCookies/srcs/SavingCookies.java0000644000175000002070000001102612654402377030265 0ustar00jvanekmock00000000000000/* SavingCookies.java Store cookies in the java cookie store, and go to a page that confirms they are there. Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.applet.Applet; import java.io.IOException; import java.net.CookieHandler; import java.net.CookieManager; import java.net.HttpCookie; import java.net.URI; import java.net.URL; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; import java.util.HashMap; import java.util.List; import java.util.Locale; import java.util.Map; public class SavingCookies extends Applet { // Set up a response header with Set-Cookie static private Map> responseHeaders(String cookie) { List cookies = new ArrayList(); cookies.add(cookie); Map> rh = new HashMap>(); rh.put("Set-Cookie", cookies); rh.put("Cookie", cookies); return rh; } static private void saveCookie(URI uri, String cookie) throws IOException { CookieHandler handler = CookieHandler.getDefault(); if (handler == null) { System.out.println("Failing due to lack of CookieHandler class!"); return; } System.out.println("Using CookieHandler class: " + handler.getClass().getCanonicalName()); System.out.println("Putting " + cookie + " at " + uri.toString()); handler.put(uri, responseHeaders(cookie)); } /* If a show-document param was set, go there */ private void gotoNextDocument() { URL baseURL = getCodeBase(); String nextDocument = getParameter("show-document"); if (nextDocument != null) { try { System.out.println("Calling showDocument(" + nextDocument + ")"); getAppletContext().showDocument(new URL(baseURL.toString() + nextDocument)); } catch (Exception e) { e.printStackTrace(); } } } static private String formatCookie(String cookie, boolean persistent) { if (persistent) { // Put in the cookie date format final int TIMEOUT = 3600; DateFormat df = new SimpleDateFormat("EEE, dd-MMM-yyyy HH:mm:ss 'GMT'", Locale.US); Calendar cal = Calendar.getInstance(); cal.add(Calendar.SECOND, TIMEOUT); cookie += "; "; cookie += "Expires=" + df.format(cal.getTime()) + "; "; cookie += "Max-Age=" + TIMEOUT + "; "; } return cookie; } @Override public void start() { System.out.println("Entered SavingCookies.java"); URL baseURL = getCodeBase(); try { saveCookie(baseURL.toURI(), formatCookie(getParameter("cookie"), "yes".equals(getParameter("persistent")))); } catch (Exception e) { e.printStackTrace(); } System.out.println("Finished SavingCookies.java"); gotoNextDocument(); } } icedtea-web-1.6.2/tests/reproducers/signed/SavingCookies/srcs/PaxHeaders.17941/CheckingCookies.java0000644000000000000000000000013012654402377030024 xustar0030 mtime=1454507263.222432781 29 atime=1454507327.27357855 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SavingCookies/srcs/CheckingCookies.java0000644000175000002070000001010612654402377030547 0ustar00jvanekmock00000000000000/* CheckingCookies.java Confirms that a test cookie is in the cookie store Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.applet.Applet; import java.io.IOException; import java.net.CookieHandler; import java.net.CookieManager; import java.net.CookiePolicy; import java.net.URI; import java.net.URISyntaxException; import java.net.URL; import java.util.HashMap; import java.util.List; import java.util.Map; public class CheckingCookies extends Applet { static class Killer extends Thread { public int n = 2000; @Override public void run() { try { Thread.sleep(n); System.out.println("Applet killing itself after " + n + " ms of life"); System.exit(0); } catch (Exception ex) { } } } static private void printCookieInfo(URI uri) throws IOException { CookieHandler handler = CookieHandler.getDefault(); Map> cookieMap = null; if (handler == null) { System.out.println("Failing due to lack of CookieHandler class!"); return; } System.out.println("Using CookieHandler class: " + handler.getClass().getCanonicalName()); cookieMap = handler.get(uri, new HashMap>()); for (Map.Entry> entry : cookieMap.entrySet()) { System.out.println("Iterating cookiemap with " + entry.getKey() + " => " + entry.getValue()); if (entry.getKey().contains("Cookie")) { for (String cookie : entry.getValue()) { System.out.println("Found cookie: " + cookie); } } } } /* If a show-document param was set, go there */ private void gotoNextDocument() { URL baseURL = getCodeBase(); String nextDocument = getParameter("show-document"); if (nextDocument != null) { try { System.out.println("Calling showDocument(" + nextDocument + ")"); getAppletContext().showDocument(new URL(baseURL.toString() + nextDocument)); } catch (Exception e) { e.printStackTrace(); } } } @Override public void start() { System.out.println("Entered CheckingCookies.java"); try { printCookieInfo(getCodeBase().toURI()); } catch (Exception e) { e.printStackTrace(); } System.out.println("Finished CheckingCookies.java"); gotoNextDocument(); } } icedtea-web-1.6.2/tests/reproducers/signed/SavingCookies/PaxHeaders.17941/resources0000644000000000000000000000013112654402377025115 xustar0030 mtime=1454507263.222432781 30 atime=1454507658.777157383 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SavingCookies/resources/0000755000175000002070000000000012654402377025716 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/SavingCookies/resources/PaxHeaders.17941/SaveSessionCooki0000644000000000000000000000031012654402377030343 xustar00111 path=icedtea-web-1.6.2/tests/reproducers/signed/SavingCookies/resources/SaveSessionCookieAndGotoCheck.html 30 mtime=1454507263.222432781 30 atime=1454507327.272578563 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SavingCookies/resources/SaveSessionCookieAndGotoCheck.htm0000644000175000002070000000365612654402377034250 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/signed/SavingCookies/resources/PaxHeaders.17941/SaveSessionCooki0000644000000000000000000000013112654402377030344 xustar0030 mtime=1454507263.222432781 30 atime=1454507327.272578563 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SavingCookies/resources/SaveSessionCookie.html0000644000175000002070000000356412654402377032210 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/signed/SavingCookies/resources/PaxHeaders.17941/SavePersistentCo0000644000000000000000000000031312654402377030360 xustar00114 path=icedtea-web-1.6.2/tests/reproducers/signed/SavingCookies/resources/SavePersistentCookieAndGotoCheck.html 30 mtime=1454507263.222432781 30 atime=1454507327.272578563 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SavingCookies/resources/SavePersistentCookieAndGotoCheck.0000644000175000002070000000367412654402377034254 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/signed/SavingCookies/resources/PaxHeaders.17941/SavePersistentCo0000644000000000000000000000013112654402377030356 xustar0030 mtime=1454507263.221432794 30 atime=1454507327.272578563 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SavingCookies/resources/SavePersistentCookie.html0000644000175000002070000000357012654402377032722 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/signed/SavingCookies/resources/PaxHeaders.17941/ClearPersistentC0000644000000000000000000000013112654402377030327 xustar0030 mtime=1454507263.221432794 30 atime=1454507327.271578576 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SavingCookies/resources/ClearPersistentCookie.html0000644000175000002070000000363312654402377033052 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/signed/SavingCookies/resources/PaxHeaders.17941/CheckCookieAndGo0000644000000000000000000000013112654402377030175 xustar0030 mtime=1454507263.221432794 30 atime=1454507327.271578576 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SavingCookies/resources/CheckCookieAndGotoClear.html0000644000175000002070000000365112654402377033203 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/signed/SavingCookies/resources/PaxHeaders.17941/CheckCookie.html0000644000000000000000000000013112654402377030227 xustar0030 mtime=1454507263.221432794 30 atime=1454507327.271578576 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SavingCookies/resources/CheckCookie.html0000644000175000002070000000343712654402377030762 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/signed/PaxHeaders.17941/SandboxSignedSandbox0000644000000000000000000000013112654402377024406 xustar0030 mtime=1454507263.220432808 30 atime=1454507658.777157383 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedSandbox/0000755000175000002070000000000012654402377025207 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedSandbox/PaxHeaders.17941/testcases0000644000000000000000000000013112654402377026404 xustar0030 mtime=1454507263.220432808 30 atime=1454507658.777157383 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedSandbox/testcases/0000755000175000002070000000000012654402377027205 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedSandbox/testcases/PaxHeaders.17941/SandboxSi0000644000000000000000000000031112654402377030276 xustar00113 path=icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedSandbox/testcases/SandboxSignedSandboxTest.java 30 mtime=1454507263.220432808 29 atime=1454507327.27057859 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedSandbox/testcases/SandboxSignedSandboxTest.j0000644000175000002070000001374012654402377034274 0ustar00jvanekmock00000000000000 import java.io.IOException; import java.util.Arrays; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import static net.sourceforge.jnlp.browsertesting.BrowserTest.server; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.AutoErrorClosingListener; import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; import net.sourceforge.jnlp.closinglisteners.StringBasedClosingListener; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.ManifestAttributesChecker; import net.sourceforge.jnlp.tools.DeploymentPropertiesModifier; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; /* AppletTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class SandboxSignedSandboxTest extends BrowserTest { private static final DeploymentPropertiesModifier dpm = new DeploymentPropertiesModifier(); private static final StringBasedClosingListener aok = new AutoOkClosingListener(); private static final StringBasedClosingListener aer = new AutoErrorClosingListener(); private static final String confirmation = "*** applet running ***"; @BeforeClass public static void setDeploymentManifestPermissionReadingOnly() throws IOException{ dpm.setProperties(DeploymentConfiguration.KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK, ManifestAttributesChecker.MANIFEST_ATTRIBUTES_CHECK.PERMISSIONS.toString()); } @AfterClass public static void restoreDeploymentProeprtiees() throws IOException{ dpm.restoreProperties(); } @Test //no security dialog //should run in snadbox (jnlp dont have all-permnissions) public void javawsAllPermNoSecurity() throws Exception{ ProcessResult p = server.executeJavawsHeadless("SandboxSignedSandbox.jnlp"); Assert.assertTrue(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } @Test //no security dialog //pass, crash, invalid combination all-permissions x sandbox public void javawsAllPermAllSecurity() throws Exception{ ProcessResult p = server.executeJavawsHeadless("SandboxSignedSandbox_security.jnlp"); Assert.assertFalse(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } @Test //no security dialog //should run in snadbox (jnlp dont have all-permnissions) public void javawsAppletAllPermNoSecurity() throws Exception{ ProcessResult p = server.executeJavaws(Arrays.asList(new String[]{"-headless", "-verbose"}),"SandboxSignedSandbox_applet.jnlp", new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition()));//applets have exception flused only in verbose mode? strange... } @Test //no security dialog //pass, crash, invalid combination all-permissions x sandbox public void javawsAppletAllPermAllSecurity() throws Exception{ ProcessResult p = server.executeJavawsHeadless("SandboxSignedSandbox_applet_security.jnlp", new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertFalse(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } @Test @TestInBrowsers(testIn = Browsers.one) //no security dialog //started in sandbox public void appletAllPermAllSecurity() throws Exception{ server.getBrowserLocation(); ProcessResult p = server.executeBrowser("SandboxSignedSandbox.html", ServerAccess.AutoClose.CLOSE_ON_BOTH); Assert.assertTrue(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } } icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedSandbox/PaxHeaders.17941/srcs0000644000000000000000000000013112654402377025360 xustar0030 mtime=1454507263.220432808 30 atime=1454507658.777157383 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedSandbox/srcs/0000755000175000002070000000000012654402377026161 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedSandbox/srcs/PaxHeaders.17941/SandboxSignedS0000644000000000000000000000013012654402377030232 xustar0030 mtime=1454507263.220432808 29 atime=1454507327.27057859 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedSandbox/srcs/SandboxSignedSandbox.java0000644000175000002070000000406112654402377033074 0ustar00jvanekmock00000000000000 import java.applet.Applet; /* AppletTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class SandboxSignedSandbox extends Applet { @Override public void init() { confirm(); } public static void main(String... s) { confirm(); } private static void confirm() { System.out.println("*** applet running ***"); System.out.println(System.getProperty("user.home")); System.out.println("*** APPLET FINISHED ***"); } } icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedSandbox/srcs/PaxHeaders.17941/META-INF0000644000000000000000000000013112654402377026520 xustar0030 mtime=1454507263.220432808 30 atime=1454507658.777157383 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedSandbox/srcs/META-INF/0000755000175000002070000000000012654402377027321 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedSandbox/srcs/META-INF/PaxHeaders.17941/MANIF0000644000000000000000000000013012654402377027351 xustar0030 mtime=1454507263.220432808 29 atime=1454507327.27057859 29 ctime=1454507658.76015761 icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedSandbox/srcs/META-INF/MANIFEST.MF0000644000175000002070000000005412654402377030752 0ustar00jvanekmock00000000000000Manifest-Version: 1.0 Permissions: sandbox icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedSandbox/PaxHeaders.17941/resources0000644000000000000000000000013112654402377026420 xustar0030 mtime=1454507263.220432808 29 atime=1454507658.77815737 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedSandbox/resources/0000755000175000002070000000000012654402377027221 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedSandbox/resources/PaxHeaders.17941/SandboxSi0000644000000000000000000000031712654402377030320 xustar00118 path=icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedSandbox/resources/SandboxSignedSandbox_security.jnlp 30 mtime=1454507263.220432808 29 atime=1454507327.27057859 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedSandbox/resources/SandboxSignedSandbox_secur0000644000175000002070000000435212654402377034420 0ustar00jvanekmock00000000000000 SandboxSignedMissing IcedTea SandboxSignedSandbox icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedSandbox/resources/PaxHeaders.17941/SandboxSi0000644000000000000000000000032712654402377030321 xustar00125 path=icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedSandbox/resources/SandboxSignedSandbox_applet_security.jnlp 30 mtime=1454507263.219432821 30 atime=1454507327.269578603 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedSandbox/resources/SandboxSignedSandbox_apple0000644000175000002070000000452712654402377034404 0ustar00jvanekmock00000000000000 SandboxSignedMissing IcedTea SandboxSignedSandbox icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedSandbox/resources/PaxHeaders.17941/SandboxSi0000644000000000000000000000031612654402377030317 xustar00116 path=icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedSandbox/resources/SandboxSignedSandbox_applet.jnlp 30 mtime=1454507263.219432821 30 atime=1454507327.269578603 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedSandbox/resources/SandboxSignedSandbox_apple0000644000175000002070000000443212654402377034377 0ustar00jvanekmock00000000000000 SandboxSignedSandbox IcedTea SandboxSignedSandbox icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedSandbox/resources/PaxHeaders.17941/SandboxSi0000644000000000000000000000013212654402377030313 xustar0030 mtime=1454507263.219432821 30 atime=1454507327.269578603 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedSandbox/resources/SandboxSignedSandbox.jnlp0000644000175000002070000000425412654402377034162 0ustar00jvanekmock00000000000000 SandboxSignedSandbox IcedTea SandboxSignedSandbox icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedSandbox/resources/PaxHeaders.17941/SandboxSi0000644000000000000000000000013212654402377030313 xustar0030 mtime=1454507263.219432821 30 atime=1454507327.269578603 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedSandbox/resources/SandboxSignedSandbox.html0000644000175000002070000000344412654402377034163 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/signed/PaxHeaders.17941/SandboxSignedMissing0000644000000000000000000000013112654402377024421 xustar0030 mtime=1454507263.218432834 29 atime=1454507658.77815737 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedMissing/0000755000175000002070000000000012654402377025222 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedMissing/PaxHeaders.17941/testcases0000644000000000000000000000013112654402377026417 xustar0030 mtime=1454507263.218432834 29 atime=1454507658.77815737 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedMissing/testcases/0000755000175000002070000000000012654402377027220 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedMissing/testcases/PaxHeaders.17941/SandboxSi0000644000000000000000000000032712654402377030320 xustar00125 path=icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedMissing/testcases/SandboxSignedMissingTestHighSecurity.java 30 mtime=1454507263.218432834 30 atime=1454507327.268578616 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedMissing/testcases/SandboxSignedMissingTestHi0000644000175000002070000002261512654402377034354 0ustar00jvanekmock00000000000000 import java.io.IOException; import java.util.Arrays; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ProcessWrapper; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import static net.sourceforge.jnlp.browsertesting.BrowserTest.server; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.AutoErrorClosingListener; import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; import net.sourceforge.jnlp.closinglisteners.StringBasedClosingListener; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.ManifestAttributesChecker; import net.sourceforge.jnlp.security.appletextendedsecurity.AppletSecurityLevel; import net.sourceforge.jnlp.tools.DeploymentPropertiesModifier; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; /* AppletTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class SandboxSignedMissingTestHighSecurity extends BrowserTest { private static final DeploymentPropertiesModifier dpm1 = new DeploymentPropertiesModifier(); private static final DeploymentPropertiesModifier dpm2 = new DeploymentPropertiesModifier(); private static final StringBasedClosingListener aok = new AutoOkClosingListener(); private static final StringBasedClosingListener aer = new AutoErrorClosingListener(); private static final String confirmation = "*** applet running ***"; @BeforeClass public static void setDeploymentManifestPermissionReadingOnly() throws IOException{ dpm1.setProperties(DeploymentConfiguration.KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK, ManifestAttributesChecker.MANIFEST_ATTRIBUTES_CHECK.PERMISSIONS.toString()); dpm2.setProperties(DeploymentConfiguration.KEY_SECURITY_LEVEL, AppletSecurityLevel.ASK_UNSIGNED.toChars()); } @AfterClass public static void restoreDeploymentProeprtiees() throws IOException{ dpm2.restoreProperties(); dpm1.restoreProperties(); } @Test // security dialog //crash (jnlp dont have all-permnissions) public void javawsAllPermNoSecurityYes() throws Exception{ ProcessWrapper pw = new ProcessWrapper(server.getJavawsLocation(), Arrays.asList("-headless"), server.getUrl("SandboxSignedMissing.jnlp")); pw.setWriter("YES\n"); ProcessResult p = pw.execute(); Assert.assertTrue(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } // security dialog //crash (jnlp dont have all-permnissions) @Test public void javawsAllPermNoSecurityNo() throws Exception{ ProcessWrapper pw = new ProcessWrapper(server.getJavawsLocation(), Arrays.asList("-headless"), server.getUrl("SandboxSignedMissing.jnlp")); pw.setWriter("NO\n"); ProcessResult p = pw.execute(); Assert.assertFalse(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } @Test // security dialog //pass public void javawsAllPermAllSecurityYes() throws Exception{ ProcessWrapper pw = new ProcessWrapper(server.getJavawsLocation(), Arrays.asList("-headless"), server.getUrl("SandboxSignedMissing_security.jnlp")); pw.setWriter("YES\n"); ProcessResult p = pw.execute(); Assert.assertTrue(p.stdout.contains(confirmation)); Assert.assertTrue(p.stdout.contains(aok.getCondition())); Assert.assertFalse(p.stderr.contains(aer.getCondition())); } @Test // security dialog //pass public void javawsAllPermAllSecurityNo() throws Exception{ ProcessWrapper pw = new ProcessWrapper(server.getJavawsLocation(), Arrays.asList("-headless"), server.getUrl("SandboxSignedMissing_security.jnlp")); pw.setWriter("NO\n"); ProcessResult p = pw.execute(); Assert.assertFalse(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } @Test // security dialog //crash (jnlp dont have all-permnissions) public void javawsAppletAllPermNoSecurityYes() throws Exception{ ProcessWrapper pw = new ProcessWrapper(server.getJavawsLocation(), Arrays.asList("-headless", "-verbose"), server.getUrl("SandboxSignedMissing_applet.jnlp")); pw.addStdOutListener(new AutoOkClosingListener()); pw.setWriter("YES\n"); ProcessResult p = pw.execute(); Assert.assertTrue(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition()));//applets have exception flused only in verbose mode? strange... } @Test // security dialog //crash (jnlp dont have all-permnissions) public void javawsAppletAllPermNoSecurityNo() throws Exception{ ProcessWrapper pw = new ProcessWrapper(server.getJavawsLocation(), Arrays.asList("-headless", "-verbose"), server.getUrl("SandboxSignedMissing_applet.jnlp")); pw.addStdErrListener(new AutoErrorClosingListener()); pw.addStdOutListener(new AutoOkClosingListener()); pw.setWriter("NO\n"); ProcessResult p = pw.execute(); Assert.assertFalse(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition()));//applets have exception flused only in verbose mode? strange... } @Test //security dialog //pass public void javawsAppletAllPermAllSecurityYes() throws Exception{ ProcessWrapper pw = new ProcessWrapper(server.getJavawsLocation(), Arrays.asList("-headless"), server.getUrl("SandboxSignedMissing_applet_security.jnlp")); pw.addStdOutListener(new AutoOkClosingListener()); pw.setWriter("YES\n"); ProcessResult p = pw.execute(); Assert.assertTrue(p.stdout.contains(confirmation)); Assert.assertTrue(p.stdout.contains(aok.getCondition())); Assert.assertFalse(p.stderr.contains(aer.getCondition())); } @Test //security dialog //pass public void javawsAppletAllPermAllSecurityNo() throws Exception{ ProcessWrapper pw = new ProcessWrapper(server.getJavawsLocation(), Arrays.asList("-headless"), server.getUrl("SandboxSignedMissing_applet_security.jnlp")); pw.addStdErrListener(new AutoErrorClosingListener()); pw.addStdOutListener(new AutoOkClosingListener()); pw.setWriter("NO\n"); ProcessResult p = pw.execute(); Assert.assertFalse(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } //browser do not support headless dialogues //@Test //@TestInBrowsers(testIn = Browsers.one) //no security dialog //pass public void appletAllPermAllSecurity() throws Exception{ server.getBrowserLocation(); ProcessResult p = server.executeBrowser("SandboxSignedMissing.html", ServerAccess.AutoClose.CLOSE_ON_BOTH); Assert.assertTrue(p.stdout.contains(confirmation)); Assert.assertTrue(p.stdout.contains(aok.getCondition())); Assert.assertFalse(p.stderr.contains(aer.getCondition())); } } icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedMissing/testcases/PaxHeaders.17941/SandboxSi0000644000000000000000000000031312654402377030313 xustar00113 path=icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedMissing/testcases/SandboxSignedMissingTest.java 30 mtime=1454507263.218432834 30 atime=1454507327.268578616 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedMissing/testcases/SandboxSignedMissingTest.j0000644000175000002070000001423012654402377034315 0ustar00jvanekmock00000000000000 import java.io.IOException; import java.util.Arrays; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import static net.sourceforge.jnlp.browsertesting.BrowserTest.server; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.AutoErrorClosingListener; import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; import net.sourceforge.jnlp.closinglisteners.StringBasedClosingListener; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.ManifestAttributesChecker; import net.sourceforge.jnlp.security.appletextendedsecurity.AppletSecurityLevel; import net.sourceforge.jnlp.tools.DeploymentPropertiesModifier; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; /* AppletTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class SandboxSignedMissingTest extends BrowserTest { private static final DeploymentPropertiesModifier dpm1 = new DeploymentPropertiesModifier(); private static final DeploymentPropertiesModifier dpm2 = new DeploymentPropertiesModifier(); private static final StringBasedClosingListener aok = new AutoOkClosingListener(); private static final StringBasedClosingListener aer = new AutoErrorClosingListener(); private static final String confirmation = "*** applet running ***"; @BeforeClass public static void setDeploymentManifestPermissionReadingOnly() throws IOException{ dpm1.setProperties(DeploymentConfiguration.KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK, ManifestAttributesChecker.MANIFEST_ATTRIBUTES_CHECK.PERMISSIONS.toString()); dpm2.setProperties(DeploymentConfiguration.KEY_SECURITY_LEVEL, AppletSecurityLevel.ALLOW_UNSIGNED.toChars()); } @AfterClass public static void restoreDeploymentProeprtiees() throws IOException{ dpm2.restoreProperties(); dpm1.restoreProperties(); } @Test //no security dialog //crash (jnlp dont have all-permnissions) public void javawsAllPermNoSecurity() throws Exception{ ProcessResult p = server.executeJavawsHeadless("SandboxSignedMissing.jnlp"); Assert.assertTrue(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } @Test //no security dialog //pass public void javawsAllPermAllSecurity() throws Exception{ ProcessResult p = server.executeJavawsHeadless("SandboxSignedMissing_security.jnlp"); Assert.assertTrue(p.stdout.contains(confirmation)); Assert.assertTrue(p.stdout.contains(aok.getCondition())); Assert.assertFalse(p.stderr.contains(aer.getCondition())); } @Test //no security dialog //crash (jnlp dont have all-permnissions) public void javawsAppletAllPermNoSecurity() throws Exception{ ProcessResult p = server.executeJavaws(Arrays.asList(new String[]{"-headless", "-verbose"}),"SandboxSignedMissing_applet.jnlp", new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition()));//applets have exception flused only in verbose mode? strange... } @Test //no security dialog //pass public void javawsAppletAllPermAllSecurity() throws Exception{ ProcessResult p = server.executeJavawsHeadless("SandboxSignedMissing_applet_security.jnlp", new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(p.stdout.contains(confirmation)); Assert.assertTrue(p.stdout.contains(aok.getCondition())); Assert.assertFalse(p.stderr.contains(aer.getCondition())); } @Test @TestInBrowsers(testIn = Browsers.one) //no security dialog //pass public void appletAllPermAllSecurity() throws Exception{ server.getBrowserLocation(); ProcessResult p = server.executeBrowser("SandboxSignedMissing.html", ServerAccess.AutoClose.CLOSE_ON_BOTH); Assert.assertTrue(p.stdout.contains(confirmation)); Assert.assertTrue(p.stdout.contains(aok.getCondition())); Assert.assertFalse(p.stderr.contains(aer.getCondition())); } } icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedMissing/PaxHeaders.17941/srcs0000644000000000000000000000013112654402377025373 xustar0030 mtime=1454507263.218432834 29 atime=1454507658.77815737 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedMissing/srcs/0000755000175000002070000000000012654402377026174 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedMissing/srcs/PaxHeaders.17941/SandboxSignedM0000644000000000000000000000013212654402377030241 xustar0030 mtime=1454507263.218432834 30 atime=1454507327.268578616 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedMissing/srcs/SandboxSignedMissing.java0000644000175000002070000000406112654402377033122 0ustar00jvanekmock00000000000000 import java.applet.Applet; /* AppletTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class SandboxSignedMissing extends Applet { @Override public void init() { confirm(); } public static void main(String... s) { confirm(); } private static void confirm() { System.out.println("*** applet running ***"); System.out.println(System.getProperty("user.home")); System.out.println("*** APPLET FINISHED ***"); } } icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedMissing/srcs/PaxHeaders.17941/META-INF0000644000000000000000000000013112654402377026533 xustar0030 mtime=1454507263.217432848 29 atime=1454507658.77815737 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedMissing/srcs/META-INF/0000755000175000002070000000000012654402377027334 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedMissing/srcs/META-INF/PaxHeaders.17941/MANIF0000644000000000000000000000013112654402377027365 xustar0030 mtime=1454507263.217432848 29 atime=1454507327.26757863 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedMissing/srcs/META-INF/MANIFEST.MF0000644000175000002070000000002712654402377030765 0ustar00jvanekmock00000000000000Manifest-Version: 1.0 icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedMissing/PaxHeaders.17941/resources0000644000000000000000000000013112654402377026433 xustar0030 mtime=1454507263.217432848 29 atime=1454507658.77815737 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedMissing/resources/0000755000175000002070000000000012654402377027234 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedMissing/resources/PaxHeaders.17941/SandboxSi0000644000000000000000000000031712654402377030333 xustar00118 path=icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedMissing/resources/SandboxSignedMissing_security.jnlp 30 mtime=1454507263.217432848 29 atime=1454507327.26757863 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedMissing/resources/SandboxSignedMissing_secur0000644000175000002070000000435212654402377034446 0ustar00jvanekmock00000000000000 SandboxSignedMissing IcedTea SandboxSignedMissing icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedMissing/resources/PaxHeaders.17941/SandboxSi0000644000000000000000000000032612654402377030333 xustar00125 path=icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedMissing/resources/SandboxSignedMissing_applet_security.jnlp 30 mtime=1454507263.217432848 29 atime=1454507327.26757863 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedMissing/resources/SandboxSignedMissing_apple0000644000175000002070000000453312654402377034427 0ustar00jvanekmock00000000000000 SandboxSignedMissing IcedTea SandboxSignedMissing icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedMissing/resources/PaxHeaders.17941/SandboxSi0000644000000000000000000000031512654402377030331 xustar00116 path=icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedMissing/resources/SandboxSignedMissing_applet.jnlp 30 mtime=1454507263.217432848 29 atime=1454507327.26757863 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedMissing/resources/SandboxSignedMissing_apple0000644000175000002070000000443512654402377034430 0ustar00jvanekmock00000000000000 SandboxSignedMissing IcedTea SandboxSignedMissing icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedMissing/resources/PaxHeaders.17941/SandboxSi0000644000000000000000000000013112654402377030325 xustar0030 mtime=1454507263.216432861 29 atime=1454507327.26757863 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedMissing/resources/SandboxSignedMissing.jnlp0000644000175000002070000000425412654402377034210 0ustar00jvanekmock00000000000000 SandboxSignedMissing IcedTea SandboxSignedMissing icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedMissing/resources/PaxHeaders.17941/SandboxSi0000644000000000000000000000013112654402377030325 xustar0030 mtime=1454507263.216432861 29 atime=1454507327.26757863 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedMissing/resources/SandboxSignedMissing.html0000644000175000002070000000344412654402377034211 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/signed/PaxHeaders.17941/SandboxSignedInvalid0000644000000000000000000000013112654402377024376 xustar0030 mtime=1454507263.216432861 29 atime=1454507658.77815737 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedInvalid/0000755000175000002070000000000012654402377025177 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedInvalid/PaxHeaders.17941/testcases0000644000000000000000000000013112654402377026374 xustar0030 mtime=1454507263.216432861 29 atime=1454507658.77815737 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedInvalid/testcases/0000755000175000002070000000000012654402377027175 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedInvalid/testcases/PaxHeaders.17941/SandboxSi0000644000000000000000000000031312654402377030270 xustar00113 path=icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedInvalid/testcases/SandboxSignedInvalidTest.java 30 mtime=1454507263.216432861 30 atime=1454507327.266578643 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedInvalid/testcases/SandboxSignedInvalidTest.j0000644000175000002070000001327612654402377034260 0ustar00jvanekmock00000000000000 import java.io.IOException; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import static net.sourceforge.jnlp.browsertesting.BrowserTest.server; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.AutoErrorClosingListener; import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; import net.sourceforge.jnlp.closinglisteners.StringBasedClosingListener; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.ManifestAttributesChecker; import net.sourceforge.jnlp.tools.DeploymentPropertiesModifier; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; /* AppletTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class SandboxSignedInvalidTest extends BrowserTest { private static final DeploymentPropertiesModifier dpm = new DeploymentPropertiesModifier(); private static final StringBasedClosingListener aok = new AutoOkClosingListener(); private static final StringBasedClosingListener aer = new AutoErrorClosingListener(); private static final String confirmation = "*** applet running ***"; @BeforeClass public static void setDeploymentManifestPermissionReadingOnly() throws IOException{ dpm.setProperties(DeploymentConfiguration.KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK, ManifestAttributesChecker.MANIFEST_ATTRIBUTES_CHECK.PERMISSIONS.toString()); } @AfterClass public static void restoreDeploymentProeprtiees() throws IOException{ dpm.restoreProperties(); } @Test //no security dialog //crash (jnlp dont have all-permnissions) public void javawsAllPermNoSecurity() throws Exception{ ProcessResult p = server.executeJavawsHeadless("SandboxSignedInvalid.jnlp"); Assert.assertFalse(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } @Test //no security dialog //pass public void javawsAllPermAllSecurity() throws Exception{ ProcessResult p = server.executeJavawsHeadless("SandboxSignedInvalid_security.jnlp"); Assert.assertFalse(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } @Test //no security dialog //crash (jnlp dont have all-permnissions) public void javawsAppletAllPermNoSecurity() throws Exception{ ProcessResult p = server.executeJavawsHeadless("SandboxSignedInvalid_applet.jnlp", new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertFalse(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } @Test //no security dialog //pass public void javawsAppletAllPermAllSecurity() throws Exception{ ProcessResult p = server.executeJavawsHeadless("SandboxSignedInvalid_applet_security.jnlp", new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertFalse(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } @Test @TestInBrowsers(testIn = Browsers.one) //no security dialog //pass public void appletAllPermAllSecurity() throws Exception{ server.getBrowserLocation(); ProcessResult p = server.executeBrowser("SandboxSignedInvalid.html", ServerAccess.AutoClose.CLOSE_ON_BOTH); Assert.assertFalse(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } } icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedInvalid/PaxHeaders.17941/srcs0000644000000000000000000000013112654402377025350 xustar0030 mtime=1454507263.215432874 29 atime=1454507658.77815737 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedInvalid/srcs/0000755000175000002070000000000012654402377026151 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedInvalid/srcs/PaxHeaders.17941/SandboxSignedI0000644000000000000000000000013212654402377030212 xustar0030 mtime=1454507263.215432874 30 atime=1454507327.266578643 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedInvalid/srcs/SandboxSignedInvalid.java0000644000175000002070000000406112654402377033054 0ustar00jvanekmock00000000000000 import java.applet.Applet; /* AppletTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class SandboxSignedInvalid extends Applet { @Override public void init() { confirm(); } public static void main(String... s) { confirm(); } private static void confirm() { System.out.println("*** applet running ***"); System.out.println(System.getProperty("user.home")); System.out.println("*** APPLET FINISHED ***"); } } icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedInvalid/srcs/PaxHeaders.17941/META-INF0000644000000000000000000000013112654402377026510 xustar0030 mtime=1454507263.215432874 29 atime=1454507658.77815737 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedInvalid/srcs/META-INF/0000755000175000002070000000000012654402377027311 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedInvalid/srcs/META-INF/PaxHeaders.17941/MANIF0000644000000000000000000000013212654402377027343 xustar0030 mtime=1454507263.215432874 30 atime=1454507327.266578643 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedInvalid/srcs/META-INF/MANIFEST.MF0000644000175000002070000000006112654402377030740 0ustar00jvanekmock00000000000000Manifest-Version: 1.0 Permissions: invalidValue icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedInvalid/PaxHeaders.17941/resources0000644000000000000000000000013112654402377026410 xustar0030 mtime=1454507263.215432874 29 atime=1454507658.77815737 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedInvalid/resources/0000755000175000002070000000000012654402377027211 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedInvalid/resources/PaxHeaders.17941/SandboxSi0000644000000000000000000000032012654402377030302 xustar00118 path=icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedInvalid/resources/SandboxSignedInvalid_security.jnlp 30 mtime=1454507263.215432874 30 atime=1454507327.266578643 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedInvalid/resources/SandboxSignedInvalid_secur0000644000175000002070000000435212654402377034400 0ustar00jvanekmock00000000000000 SandboxSignedMissing IcedTea SandboxSignedInvalid icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedInvalid/resources/PaxHeaders.17941/SandboxSi0000644000000000000000000000032712654402377030311 xustar00125 path=icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedInvalid/resources/SandboxSignedInvalid_applet_security.jnlp 30 mtime=1454507263.215432874 30 atime=1454507327.266578643 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedInvalid/resources/SandboxSignedInvalid_apple0000644000175000002070000000453112654402377034357 0ustar00jvanekmock00000000000000 SandboxSignedMissing IcedTea SandboxSignedInvalid icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedInvalid/resources/PaxHeaders.17941/SandboxSi0000644000000000000000000000031612654402377030307 xustar00116 path=icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedInvalid/resources/SandboxSignedInvalid_applet.jnlp 30 mtime=1454507263.214432888 30 atime=1454507327.265578656 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedInvalid/resources/SandboxSignedInvalid_apple0000644000175000002070000000443312654402377034360 0ustar00jvanekmock00000000000000 SandboxSignedInvalid IcedTea SandboxSignedInvalid icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedInvalid/resources/PaxHeaders.17941/SandboxSi0000644000000000000000000000013212654402377030303 xustar0030 mtime=1454507263.214432888 30 atime=1454507327.265578656 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedInvalid/resources/SandboxSignedInvalid.jnlp0000644000175000002070000000425412654402377034142 0ustar00jvanekmock00000000000000 SandboxSignedInvalid IcedTea SandboxSignedInvalid icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedInvalid/resources/PaxHeaders.17941/SandboxSi0000644000000000000000000000013212654402377030303 xustar0030 mtime=1454507263.214432888 30 atime=1454507327.265578656 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/signed/SandboxSignedInvalid/resources/SandboxSignedInvalid.html0000644000175000002070000000344412654402377034143 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/PaxHeaders.17941/README0000644000000000000000000000013212654402377020024 xustar0030 mtime=1454507263.233432634 30 atime=1454507327.211579377 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/README0000644000175000002070000000442612654402377020555 0ustar00jvanekmock00000000000000Each file in directory simple must follows hierarchy conventions and is compiled/jared automatically into server's working directory and content of resources likewise. The name of jnlp is independent, and there can be even more jnlps for each future jar. Directories are honored in srcs and in resources, but not in testcases. Directories in signed handle their content in similar way as simple's content is handled, but in addition final jars are signed with simple testkey. Files in custom directory have to care about compilation/packaging and deploying of srcs directory themselves. This can affect also testcase and resources, but testcases and resources are still automatically prepared like they are in the other test types. There are three reproducers – simpletest1, simpletest2 and deadlocktest, which tests test’s suite itself and serve as examples of behaviour. Directory "signed" is listed in Makefile.am. You can specify as much to-be-signed directories as you want. And jars in each of those signed directories will be signed by their's own unique key (number of signed directories == number of certificates). Do not forget to add each this directory into list n Makefile.am If the name of a folder in simple/signed is composed of dots, then its contents are deployed from under a directory structure such that each part evaluates to a folder. For example, my.dir.reproducer/ will be deployed as jnlp_test_server/my/dir/reproducer.jar. Inside custom directory are expected directories which are handling themselves. The only strictly necessary file is custom/reproducerName/srcs/Makefile. Upon all custom/*/srcs are then launched make prepare-reproducer and during cleaning make clean-reproducer. Those targets are run after all simple and signed reproducers are prepared, so they can reuse components of the simple and signed reproducers, eg certificates or dependencies. to keep this custom makefiles as simple as possible. Some comment in makefile or readme file is recommended for each custom reproducer to tell dependencies and what it does. Some readme (or comment in classes) is good advice for any reproducer anyway;) Because of automake only small set of variables from icedtea-web Makefile is available for custom makefiles, but feel free to export others if needed. icedtea-web-1.6.2/tests/reproducers/PaxHeaders.17941/signed20000644000000000000000000000013112654402377020421 xustar0030 mtime=1454507263.239432554 29 atime=1454507658.77815737 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/signed2/0000755000175000002070000000000012654402377021222 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed2/PaxHeaders.17941/MultipleSignaturesTestSamePackage0000644000000000000000000000013112654402377027203 xustar0030 mtime=1454507263.240432541 29 atime=1454507658.77815737 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/0000755000175000002070000000000012654402377030004 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/PaxHeaders.17941/testc0000644000000000000000000000013112654402377030325 xustar0030 mtime=1454507263.240432541 29 atime=1454507658.77815737 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/testcases/0000755000175000002070000000000012654402377032002 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/testcases/PaxHeaders.10000644000000000000000000000034712654402377030665 xustar00141 path=icedtea-web-1.6.2/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/testcases/MultipleSignaturesTestTestsSamePackage.java 30 mtime=1454507263.240432541 30 atime=1454507327.284578403 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/testcases/MultipleSign0000644000175000002070000001306712654402377034350 0ustar00jvanekmock00000000000000/* MultipleSignaturesTestTests.java Copyright (C) 20121 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.util.Arrays; import java.util.List; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.annotations.Bug; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import org.junit.Assert; import org.junit.Test; public class MultipleSignaturesTestTestsSamePackage extends BrowserTest{ public static final String secExcRegex = "(?s).*java.lang.SecurityException: .* signer information does not match signer information of other classes in the same package.*"; public static final String launchExcDiffCerts = "Fatal: Application Error: The JNLP application is not fully signed by a single cert."; public static final List v = Arrays.asList(new String[] {ServerAccess.VERBOSE_OPTION}); private static final String GSJE= "Good simple javaws exapmle"; @Test @NeedsDisplay public void multipleSignaturesTestSamePackageJnlpApplet() throws Exception { ProcessResult pr = server.executeJavaws(v,"/MultipleSignaturesTest2_SamePackage.jnlp"); String s = GSJE; Assert.assertFalse("stdout should NOT contains `"+s+"`, but did",pr.stdout.contains(s)); String ss = "killer was started"; Assert.assertTrue("stdout should contains `"+ss+"`, but did not",pr.stdout.contains(ss)); String sss="Applet killing himself after 2000 ms of life"; Assert.assertTrue("stdout should contains `"+sss+"`, but did not",pr.stdout.contains(sss)); //Applet in jnlp have exception consumed even in verbose mode. Howevwer at least foreign method is not invoken // String cc = "xception"; // Assert.assertTrue("stderr should contains `" + cc + "`, but did not", pr.stderr.contains(cc)); // Assert.assertTrue("stderr should match " + secExcRegex + "`, but did not", pr.stderr.matches(secExcRegex)); } @Test @NeedsDisplay @TestInBrowsers(testIn=Browsers.one) public void multipleSignaturesTestSamePackageHtmlApplet() throws Exception { ProcessResult pr = server.executeBrowser("/MultipleSignaturesTest_SamePackage.html"); String s = GSJE; Assert.assertFalse("stdout should NOT contains `"+s+"`, but did",pr.stdout.contains(s)); String cc = "xception"; Assert.assertTrue("stderr should contains `" + cc + "`, but did not", pr.stderr.contains(cc)); Assert.assertTrue("stderr should match " + secExcRegex + "`, but did not", pr.stderr.matches(secExcRegex)); String ss = "killer was started"; Assert.assertTrue("stdout should contains `"+ss+"`, but did not",pr.stdout.contains(ss)); String sss="Applet killing himself after 2000 ms of life"; Assert.assertTrue("stdout should contains `"+sss+"`, but did not",pr.stdout.contains(sss)); } @Test public void multipleSignaturesTestSamePackageJnlpApplication() throws Exception { ProcessResult pr = server.executeJavawsHeadless(null, "/MultipleSignaturesTest1_SamePackage.jnlp"); String s = GSJE; Assert.assertFalse("stdout should NOT contains `"+s+"`, but did",pr.stdout.contains(s)); String cc = "xception"; Assert.assertTrue("stderr should contains `" + cc + "`, but did not", pr.stderr.contains(cc)); Assert.assertTrue("stderr should match " + secExcRegex + "`, but did not", pr.stderr.matches(secExcRegex)); } @Test public void multipleSignaturesTestSamePackageJnlpApplicationRequesting() throws Exception { ProcessResult pr = server.executeJavawsHeadless(null, "/MultipleSignaturesTest1_SamePackage_requesting.jnlp"); String s = GSJE; Assert.assertFalse("stdout should NOT contain `"+s+"`, but did", pr.stdout.contains(s)); Assert.assertTrue("stderr should contain `" + launchExcDiffCerts + "`, but did not", pr.stderr.contains(launchExcDiffCerts)); } } icedtea-web-1.6.2/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/PaxHeaders.17941/srcs0000644000000000000000000000013112654402377030155 xustar0030 mtime=1454507263.240432541 29 atime=1454507658.77815737 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/srcs/0000755000175000002070000000000012654402377030756 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/srcs/PaxHeaders.17941/0000644000000000000000000000033512654402377030242 xustar00131 path=icedtea-web-1.6.2/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/srcs/MultipleSignaturesTestSamePackage.java 30 mtime=1454507263.240432541 30 atime=1454507327.284578403 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/srcs/MultipleSignature0000644000175000002070000000612112654402377034356 0ustar00jvanekmock00000000000000import java.applet.Applet; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; /* MultipleSignaturesTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class MultipleSignaturesTestSamePackage extends Applet { public static void main(String[] args) { executeForeignMethodCaught(); } public static void executeForeignMethodCaught() { try { executeForeignMethod(); } catch (Exception ex) { throw new RuntimeException(ex); } } public static void executeForeignMethod() throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, InstantiationException { Class clazz = Class.forName("SimpletestSigned1"); Method mainMethod = clazz.getDeclaredMethod("main", String[].class); mainMethod.invoke(clazz.newInstance(), (Object) null); } private static class Killer extends Thread { public static final int n = 2000; @Override public void run() { try { Thread.sleep(n); System.out.println("Applet killing himself after " + n + " ms of life"); System.exit(0); } catch (Exception ex) { } } } private Killer killer; @Override public void init() { killer = new Killer(); } @Override public void start() { killer.start(); System.out.println("killer was started"); main(null); } } icedtea-web-1.6.2/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/PaxHeaders.17941/resou0000644000000000000000000000013112654402377030340 xustar0030 mtime=1454507263.239432554 29 atime=1454507658.77815737 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/0000755000175000002070000000000012654402377032016 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/PaxHeaders.10000644000000000000000000000034312654402377030675 xustar00137 path=icedtea-web-1.6.2/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/MultipleSignaturesTest_SamePackage.html 30 mtime=1454507263.239432554 30 atime=1454507327.284578403 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/MultipleSign0000644000175000002070000000351712654402377034363 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/PaxHeaders.10000644000000000000000000000034412654402377030676 xustar00138 path=icedtea-web-1.6.2/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/MultipleSignaturesTest2_SamePackage.jnlp 30 mtime=1454507263.239432554 30 atime=1454507327.283578416 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/MultipleSign0000644000175000002070000000461412654402377034362 0ustar00jvanekmock00000000000000 MultipleSignaturesTest2_SamePackage IcedTea MultipleSignaturesTest2_SamePackage icedtea-web-1.6.2/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/PaxHeaders.10000644000000000000000000000035712654402377030702 xustar00149 path=icedtea-web-1.6.2/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/MultipleSignaturesTest1_SamePackage_requesting.jnlp 30 mtime=1454507263.239432554 30 atime=1454507327.283578416 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/MultipleSign0000644000175000002070000000446512654402377034366 0ustar00jvanekmock00000000000000 MultipleSignaturesTest1_SamePackage IcedTea MultipleSignaturesTest1_SamePackage icedtea-web-1.6.2/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/PaxHeaders.10000644000000000000000000000034412654402377030676 xustar00138 path=icedtea-web-1.6.2/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/MultipleSignaturesTest1_SamePackage.jnlp 30 mtime=1454507263.239432554 30 atime=1454507327.283578416 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/MultipleSign0000644000175000002070000000437012654402377034361 0ustar00jvanekmock00000000000000 MultipleSignaturesTest1_SamePackage IcedTea MultipleSignaturesTest1_SamePackage icedtea-web-1.6.2/tests/reproducers/signed2/PaxHeaders.17941/MultipleSignaturesTest0000644000000000000000000000013112654402377025121 xustar0030 mtime=1454507263.238432568 29 atime=1454507658.77815737 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/signed2/MultipleSignaturesTest/0000755000175000002070000000000012654402377025722 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed2/MultipleSignaturesTest/PaxHeaders.17941/testcases0000644000000000000000000000013112654402377027117 xustar0030 mtime=1454507263.238432568 29 atime=1454507658.77815737 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/signed2/MultipleSignaturesTest/testcases/0000755000175000002070000000000012654402377027720 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed2/MultipleSignaturesTest/testcases/PaxHeaders.17941/Multip0000644000000000000000000000032112654402377030372 xustar00119 path=icedtea-web-1.6.2/tests/reproducers/signed2/MultipleSignaturesTest/testcases/MultipleSignaturesTestTests.java 30 mtime=1454507263.238432568 30 atime=1454507327.283578416 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/signed2/MultipleSignaturesTest/testcases/MultipleSignaturesTestT0000644000175000002070000001162712654402377034476 0ustar00jvanekmock00000000000000/* MultipleSignaturesTestTests.java Copyright (C) 20121 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess.AutoClose; import net.sourceforge.jnlp.annotations.Bug; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import org.junit.Assert; import org.junit.Test; @Bug(id = {"PR822"}) public class MultipleSignaturesTestTests extends BrowserTest{ public static final String GSJE = "Good simple javaws exapmle"; public static final String launchExcDiffCerts = "Fatal: Application Error: The JNLP application is not fully signed by a single cert."; public static final String accExcString = "java.security.AccessControlException: access denied"; @Test @NeedsDisplay public void multipleSignaturesTestJnlpApplet() throws Exception { ProcessResult pr = server.executeJavaws("/MultipleSignaturesTest2.jnlp"); String s = GSJE; Assert.assertTrue("stdout should contains `" + s + "`, but did not", pr.stdout.contains(s)); } @Test @NeedsDisplay @TestInBrowsers(testIn=Browsers.one) public void multipleSignaturesTestHtmlApplet() throws Exception { ProcessResult pr = server.executeBrowser("/MultipleSignaturesTest.html", AutoClose.CLOSE_ON_CORRECT_END); String s = GSJE; Assert.assertTrue("stdout should contains `" + s + "`, but did not", pr.stdout.contains(s)); Assert.assertFalse("stderr should NOT contains `" + accExcString + "`, but did", pr.stderr.contains(accExcString)); } @Test @NeedsDisplay @TestInBrowsers(testIn=Browsers.one) @Bug(id={"PR822"}) public void multipleSignaturesTestHtmlAppletUsesPermissions() throws Exception { ProcessResult pr = server.executeBrowser("/MultipleSignaturesTestUsesPermissions.html", AutoClose.CLOSE_ON_CORRECT_END); // This calls ReadPropertiesSigned with user.home, it is not easy to think of a pattern to match this // Instead we make sure _something_ was printed Assert.assertFalse("stdout should NOT be empty, but was", pr.stdout.isEmpty()); Assert.assertFalse("stderr should NOT contains `" + accExcString + "`, but did", pr.stderr.contains(accExcString)); } @Test public void multipleSignaturesTestJnlpApplication() throws Exception { ProcessResult pr = server.executeJavawsHeadless("/MultipleSignaturesTest1.jnlp"); //well this is questionable - application is signed but is not requesting // permissions, but still usage of foreign code is allowed. String s = GSJE; Assert.assertTrue("stdout should contains `" + s + "`, but did not", pr.stdout.contains(s)); } @Test public void multipleSignaturesTestJnlpApplicationRequesting() throws Exception { // This jar is fully signed - however a JNLP application requires that one of the signers signs everything ProcessResult pr = server.executeJavawsHeadless("/MultipleSignaturesTest1_requesting.jnlp"); String s = GSJE; Assert.assertFalse("stdout should NOT contain `" + s + "`, but did", pr.stdout.contains(s)); Assert.assertTrue("stderr should contain `" + launchExcDiffCerts + "`, but did not", pr.stderr.contains(launchExcDiffCerts)); } } icedtea-web-1.6.2/tests/reproducers/signed2/MultipleSignaturesTest/PaxHeaders.17941/srcs0000644000000000000000000000013112654402377026073 xustar0030 mtime=1454507263.238432568 29 atime=1454507658.77815737 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/signed2/MultipleSignaturesTest/srcs/0000755000175000002070000000000012654402377026674 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed2/MultipleSignaturesTest/srcs/PaxHeaders.17941/somecrazyte0000644000000000000000000000013112654402377030440 xustar0030 mtime=1454507263.238432568 29 atime=1454507658.77815737 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/signed2/MultipleSignaturesTest/srcs/somecrazytestpackage/0000755000175000002070000000000012654402377033124 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed2/MultipleSignaturesTest/srcs/somecrazytestpackage/PaxHead0000644000000000000000000000033412654402377031132 xustar00130 path=icedtea-web-1.6.2/tests/reproducers/signed2/MultipleSignaturesTest/srcs/somecrazytestpackage/MultipleSignaturesTest.java 30 mtime=1454507263.238432568 30 atime=1454507327.283578416 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/signed2/MultipleSignaturesTest/srcs/somecrazytestpackage/Multipl0000644000175000002070000000657712654402377034514 0ustar00jvanekmock00000000000000package somecrazytestpackage; import java.applet.Applet; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; /* MultipleSignaturesTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class MultipleSignaturesTest extends Applet { //Ignored when class being called is SimpletestSigned1, used with ReadPropertiesSigned private static final String SYSTEM_PROPERTY = "user.home"; public static void main(String[] args) { executeForeignMethodCaught(args[0]); } public static void executeForeignMethodCaught(String classname) { try { executeForeignMethod(classname); } catch (Exception ex) { throw new RuntimeException(ex); } } public static void executeForeignMethod(String classname) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, InstantiationException { Class clazz = Class.forName(classname); Method mainMethod = clazz.getDeclaredMethod("main", String[].class); mainMethod.invoke(clazz.newInstance(), (Object) new String[] {SYSTEM_PROPERTY}); } private class Killer extends Thread { public int n = 2000; @Override public void run() { try { Thread.sleep(n); System.out.println("Applet killing himself after " + n + " ms of life"); System.exit(0); } catch (Exception ex) { } } } private Killer killer; @Override public void init() { killer = new Killer(); } @Override public void start() { killer.start(); System.out.println("killer was started"); main(new String[]{getParameter("mainclass")}); System.out.println("*** APPLET FINISHED ***"); } } icedtea-web-1.6.2/tests/reproducers/signed2/MultipleSignaturesTest/PaxHeaders.17941/resources0000644000000000000000000000013112654402377027133 xustar0030 mtime=1454507263.238432568 29 atime=1454507658.77815737 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/signed2/MultipleSignaturesTest/resources/0000755000175000002070000000000012654402377027734 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed2/MultipleSignaturesTest/resources/PaxHeaders.17941/Multip0000644000000000000000000000033312654402377030411 xustar00129 path=icedtea-web-1.6.2/tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTestUsesPermissions.html 30 mtime=1454507263.238432568 30 atime=1454507327.283578416 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTestU0000644000175000002070000000361212654402377034506 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/signed2/MultipleSignaturesTest/resources/PaxHeaders.17941/Multip0000644000000000000000000000031412654402377030410 xustar00115 path=icedtea-web-1.6.2/tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest2.jnlp 30 mtime=1454507263.237432581 29 atime=1454507327.28257843 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest20000644000175000002070000000462412654402377034447 0ustar00jvanekmock00000000000000 MultipleSignaturesTest2 IcedTea MultipleSignaturesTest2 icedtea-web-1.6.2/tests/reproducers/signed2/MultipleSignaturesTest/resources/PaxHeaders.17941/Multip0000644000000000000000000000032712654402377030414 xustar00126 path=icedtea-web-1.6.2/tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest1_requesting.jnlp 30 mtime=1454507263.237432581 29 atime=1454507327.28257843 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest10000644000175000002070000000447412654402377034451 0ustar00jvanekmock00000000000000 MultipleSignaturesTest1 IcedTea MultipleSignaturesTest1 SimpletestSigned1 icedtea-web-1.6.2/tests/reproducers/signed2/MultipleSignaturesTest/resources/PaxHeaders.17941/Multip0000644000000000000000000000031412654402377030410 xustar00115 path=icedtea-web-1.6.2/tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest1.jnlp 30 mtime=1454507263.237432581 29 atime=1454507327.28257843 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest10000644000175000002070000000437712654402377034453 0ustar00jvanekmock00000000000000 MultipleSignaturesTest1 IcedTea MultipleSignaturesTest1 SimpletestSigned1 icedtea-web-1.6.2/tests/reproducers/signed2/MultipleSignaturesTest/resources/PaxHeaders.17941/Multip0000644000000000000000000000031312654402377030407 xustar00114 path=icedtea-web-1.6.2/tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest.html 30 mtime=1454507263.237432581 29 atime=1454507327.28257843 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest.0000644000175000002070000000360412654402377034440 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/signed2/PaxHeaders.17941/AppletTestSigned20000644000000000000000000000013112654402377023722 xustar0030 mtime=1454507263.236432594 29 atime=1454507658.77815737 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/signed2/AppletTestSigned2/0000755000175000002070000000000012654402377024523 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed2/AppletTestSigned2/PaxHeaders.17941/srcs0000644000000000000000000000013112654402377024674 xustar0030 mtime=1454507263.236432594 29 atime=1454507658.77815737 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/signed2/AppletTestSigned2/srcs/0000755000175000002070000000000012654402377025475 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/signed2/AppletTestSigned2/srcs/PaxHeaders.17941/AppletTestSigned0000644000000000000000000000013112654402377030113 xustar0030 mtime=1454507263.236432594 29 atime=1454507327.28257843 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/signed2/AppletTestSigned2/srcs/AppletTestSigned2.java0000644000175000002070000000417312654402377031646 0ustar00jvanekmock00000000000000/* AppletTestSigned2.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.applet.Applet; public class AppletTestSigned2 extends Applet { @Override public void init() { System.out.println("AppletTestSigned2 was initialised"); } @Override public void start() { System.out.println("AppletTestSigned2 was started"); } @Override public void stop() { System.out.println("AppletTestSigned2 was stopped"); } @Override public void destroy() { System.out.println("AppletTestSigned2 will be destroyed"); } } icedtea-web-1.6.2/tests/reproducers/PaxHeaders.17941/simple0000644000000000000000000000013112654402377020357 xustar0030 mtime=1454507263.264432221 29 atime=1454507658.77815737 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/simple/0000755000175000002070000000000012654402377021160 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/ReadEnvironment0000644000000000000000000000013112654402377023457 xustar0030 mtime=1454507263.264432221 29 atime=1454507658.77815737 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/simple/ReadEnvironment/0000755000175000002070000000000012654402377024260 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/ReadEnvironment/PaxHeaders.17941/testcases0000644000000000000000000000013112654402377025455 xustar0030 mtime=1454507263.264432221 29 atime=1454507658.77815737 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/simple/ReadEnvironment/testcases/0000755000175000002070000000000012654402377026256 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/ReadEnvironment/testcases/PaxHeaders.17941/ReadEnvironmen0000644000000000000000000000013212654402377030372 xustar0030 mtime=1454507263.264432221 30 atime=1454507327.329577803 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/simple/ReadEnvironment/testcases/ReadEnvironmentTest.java0000644000175000002070000000502712654402377033065 0ustar00jvanekmock00000000000000/* ReadEnvironmentTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import org.junit.Assert; import org.junit.Test; public class ReadEnvironmentTest { private static ServerAccess server = new ServerAccess(); @Test public void ReadEnvironmentLunch1() throws Exception { ProcessResult pr = server.executeJavawsHeadless(null, "/ReadEnvironment.jnlp"); String s = "(?s).*java.security.AccessControlException.{0,5}access denied.{0,5}java.lang.RuntimePermission.{0,5}" + "getenv.USER" + ".*"; Assert.assertTrue("stderr should match"+s+"but didn't",pr.stderr.matches(s)); String cc="ClassNotFoundException"; Assert.assertFalse("stderr should NOT contains `"+cc+"`, but did",pr.stderr.contains(cc)); Assert.assertFalse("ReadEnvironmentLunch1 should not be terminated, but was",pr.wasTerminated); Assert.assertEquals((Integer) 0, pr.returnValue); } } icedtea-web-1.6.2/tests/reproducers/simple/ReadEnvironment/PaxHeaders.17941/srcs0000644000000000000000000000013112654402377024431 xustar0030 mtime=1454507263.264432221 29 atime=1454507658.77815737 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/simple/ReadEnvironment/srcs/0000755000175000002070000000000012654402377025232 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/ReadEnvironment/srcs/PaxHeaders.17941/ReadEnvironment.jav0000644000000000000000000000013212654402377030311 xustar0030 mtime=1454507263.264432221 30 atime=1454507327.329577803 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/simple/ReadEnvironment/srcs/ReadEnvironment.java0000644000175000002070000000334612654402377031203 0ustar00jvanekmock00000000000000/* ReadEnvironment.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class ReadEnvironment { public static void main(String[] args) { System.getenv("USER"); } } icedtea-web-1.6.2/tests/reproducers/simple/ReadEnvironment/PaxHeaders.17941/resources0000644000000000000000000000013112654402377025471 xustar0030 mtime=1454507263.264432221 29 atime=1454507658.77815737 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/simple/ReadEnvironment/resources/0000755000175000002070000000000012654402377026272 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/ReadEnvironment/resources/PaxHeaders.17941/ReadEnvironmen0000644000000000000000000000013212654402377030406 xustar0030 mtime=1454507263.264432221 30 atime=1454507327.329577803 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/simple/ReadEnvironment/resources/ReadEnvironment.jnlp0000644000175000002070000000376212654402377032267 0ustar00jvanekmock00000000000000 ReadEnvironment using System.getenv() IcedTea icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/ParametrizedJarUrl0000644000000000000000000000013112654402377024126 xustar0030 mtime=1454507263.264432221 29 atime=1454507658.77815737 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/simple/ParametrizedJarUrl/0000755000175000002070000000000012654402377024727 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/ParametrizedJarUrl/PaxHeaders.17941/testcases0000644000000000000000000000013112654402377026124 xustar0030 mtime=1454507263.264432221 29 atime=1454507658.77815737 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/simple/ParametrizedJarUrl/testcases/0000755000175000002070000000000012654402377026725 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/ParametrizedJarUrl/testcases/PaxHeaders.17941/Parametrize0000644000000000000000000000013212654402377030410 xustar0030 mtime=1454507263.264432221 30 atime=1454507327.328577816 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/simple/ParametrizedJarUrl/testcases/ParametrizedJarUrlTests.java0000644000175000002070000002340112654402377034362 0ustar00jvanekmock00000000000000/* SimpleTest1Test.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; import java.util.Arrays; import java.util.Collections; import java.util.List; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.ServerLauncher; import net.sourceforge.jnlp.annotations.Bug; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import org.junit.Assert; import org.junit.Test; public class ParametrizedJarUrlTests extends BrowserTest{ private final List l = Collections.unmodifiableList(Arrays.asList(new String[]{"-Xtrustall"})); @Test @TestInBrowsers(testIn = Browsers.one) @Bug(id = "PR905") public void parametrizedAppletTestSignedBrowserTest_hardcodedDifferentCodeBase() throws Exception { ServerLauncher server2 = ServerAccess.getIndependentInstance(); String originalResourceName = "ParametrizedJarUrlSigned.html"; String newResourceName = "ParametrizedJarUrlSigned_COPY2.html"; createCodeBase(originalResourceName, newResourceName, server2.getUrl("")); //set codebase to second server ProcessResult pr = server.executeBrowser(newResourceName); server2.stop(); evaluateSignedApplet(pr); } @Test @TestInBrowsers(testIn = Browsers.one) @Bug(id = "PR905") public void parametrizedAppletTestSignedBrowserTest_hardcodedCodeBase() throws Exception { String originalResourceName = "ParametrizedJarUrlSigned.html"; String newResourceName = "ParametrizedJarUrlSigned_COPY1.html"; createCodeBase(originalResourceName, newResourceName, server.getUrl("")); ProcessResult pr = server.executeBrowser(newResourceName); evaluateSignedApplet(pr); } private void createCodeBase(String originalResourceName, String newResourceName, URL codebase) throws MalformedURLException, IOException { String originalContent = ServerAccess.getContentOfStream(new FileInputStream(new File(server.getDir(), originalResourceName))); String nwContent = originalContent.replaceAll("codebase=\".\"", "codebase=\"" + codebase + "\""); ServerAccess.saveFile(nwContent, new File(server.getDir(), newResourceName)); } @Test @TestInBrowsers(testIn = Browsers.one) @Bug(id = "PR905") public void parametrizedAppletTestSignedBrowserTest() throws Exception { ProcessResult pr = server.executeBrowser("/ParametrizedJarUrlSigned.html"); evaluateSignedApplet(pr); } @Test @TestInBrowsers(testIn=Browsers.one) public void parametrizedAppletInBrowserWithParamTest() throws Exception { ProcessResult pr = server.executeBrowser("/ParametrizedJarUrl.html?giveMeMore?orNot"); evaluateApplet(pr); } @Test public void parametrizedAppletJavawsTest() throws Exception { ProcessResult pr = server.executeJavawsHeadless(null, "/ParametrizedJarAppletUrl2.jnlp"); evaluateApplet(pr); } @Test public void parametrizedAppletJavawsTest2() throws Exception { ProcessResult pr = server.executeJavawsHeadless(null, "/ParametrizedJarAppletUrl2.jnlp?test=123456"); evaluateApplet(pr); } @Test public void parametrizedAppletJavawsTest3() throws Exception { ProcessResult pr = server.executeJavawsHeadless(null, "/ParametrizedJarAppletUrl.jnlp"); evaluateApplet(pr); } @Test public void parametrizedAppletJavawsTestSignedTest() throws Exception { ProcessResult pr = server.executeJavawsHeadless(l, "/ParametrizedJarAppletUrlSigned2.jnlp"); evaluateSignedApplet(pr); } @Test public void parametrizedAppletJavawsTestSigned2Test() throws Exception { ProcessResult pr = server.executeJavawsHeadless(l, "/ParametrizedJarAppletUrlSigned2.jnlp?test=123456"); evaluateSignedApplet(pr); } @Test public void parametrizedAppletJavawsTestSignedTest4() throws Exception { ProcessResult pr = server.executeJavawsHeadless(l, "/ParametrizedJarAppletUrlSigned.jnlp"); evaluateSignedApplet(pr); } private void evaluateSignedApplet(ProcessResult pr) { String s3 = "AppletTestSigned was initialised"; Assert.assertTrue("AppletTestSigned stdout should contain " + s3 + " but didn't", pr.stdout.contains(s3)); String s0 = "AppletTestSigned was started"; Assert.assertTrue("AppletTestSigned stdout should contain " + s0 + " but didn't", pr.stdout.contains(s0)); String s1 = "value1"; Assert.assertTrue("AppletTestSigned stdout should contain " + s1 + " but didn't", pr.stdout.contains(s1)); String s2 = "value2"; Assert.assertTrue("AppletTestSigned stdout should contain " + s2 + " but didn't", pr.stdout.contains(s2)); String s7 = "AppletTestSigned killing himself after 2000 ms of life"; Assert.assertTrue("AppletTestSigned stdout should contain " + s7 + " but didn't", pr.stdout.contains(s7)); } @Test public void testParametrizedJarUrlSigned1() throws Exception { ProcessResult pr = server.executeJavawsHeadless(l, "/ParametrizedJarUrlSigned1.jnlp"); String s = "Good simple javaws exapmle"; Assert.assertTrue("ParametrizedJarUrlSigned1 stdout should contain " + s + " but didn't", pr.stdout.contains(s)); } @Test public void testParametrizedJarUrlSigned2() throws Exception { ProcessResult pr = server.executeJavawsHeadless(l, "/ParametrizedJarUrlSigned2.jnlp"); String s = "Good simple javaws exapmle"; Assert.assertTrue("ParametrizedJarUrlSigned2 stdout should contain " + s + " but didn't", pr.stdout.contains(s)); } @Test public void testParametrizedJarUrlSigned3() throws Exception { ProcessResult pr = server.executeJavawsHeadless(l, "/ParametrizedJarUrlSigned2.jnlp?test=123456"); String s = "Good simple javaws exapmle"; Assert.assertTrue("ParametrizedJarUrlSigned2 stdout should contain " + s + " but didn't", pr.stdout.contains(s)); } @Test public void testParametrizedJarUrl1() throws Exception { ProcessResult pr = server.executeJavawsHeadless(null, "/ParametrizedJarUrl1.jnlp"); String s = "Good simple javaws exapmle"; Assert.assertTrue("ParametrizedJarUrl1 stdout should contain " + s + " but didn't", pr.stdout.contains(s)); } @Test public void testParametrizedJarUrl2() throws Exception { ProcessResult pr = server.executeJavawsHeadless(null, "/ParametrizedJarUrl2.jnlp"); String s = "Good simple javaws exapmle"; Assert.assertTrue("ParametrizedJarUrl2 stdout should contain " + s + " but didn't", pr.stdout.contains(s)); } @Test public void testParametrizedJarUrl3() throws Exception { ProcessResult pr = server.executeJavawsHeadless(null, "/ParametrizedJarUrl2.jnlp?test=123456"); String s = "Good simple javaws exapmle"; Assert.assertTrue("ParametrizedJarUrl2 stdout should contain " + s + " but didn't", pr.stdout.contains(s)); ; } private void evaluateApplet(ProcessResult pr) { String s3 = "applet was initialised"; Assert.assertTrue("AppletTest stdout should contain " + s3 + " but didn't", pr.stdout.contains(s3)); String s0 = "applet was started"; Assert.assertTrue("AppletTest stdout should contain " + s0 + " but didn't", pr.stdout.contains(s0)); String s1 = "value1"; Assert.assertTrue("AppletTest stdout should contain " + s1 + " but didn't", pr.stdout.contains(s1)); String s2 = "value2"; Assert.assertTrue("AppletTest stdout should contain " + s2 + " but didn't", pr.stdout.contains(s2)); String s7 = "Aplet killing himself after 2000 ms of life"; Assert.assertTrue("AppletTest stdout should contain " + s7 + " but didn't", pr.stdout.contains(s7)); } @Test @TestInBrowsers(testIn=Browsers.one) public void parametrizedAppletInBrowserTest() throws Exception { ProcessResult pr = server.executeBrowser("/ParametrizedJarUrl.html"); pr.process.destroy(); evaluateApplet(pr); } } icedtea-web-1.6.2/tests/reproducers/simple/ParametrizedJarUrl/PaxHeaders.17941/resources0000644000000000000000000000013112654402377026140 xustar0030 mtime=1454507263.264432221 29 atime=1454507658.77815737 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/simple/ParametrizedJarUrl/resources/0000755000175000002070000000000012654402377026741 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/ParametrizedJarUrl/resources/PaxHeaders.17941/Parametrize0000644000000000000000000000031212654402377030424 xustar00112 path=icedtea-web-1.6.2/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarUrlSigned2.jnlp 30 mtime=1454507263.264432221 30 atime=1454507327.328577816 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarUrlSigned2.jn0000644000175000002070000000425212654402377034260 0ustar00jvanekmock00000000000000 ParametrizedJarUrlSigned2 IcedTea ParametrizedJarUrlSigned2 icedtea-web-1.6.2/tests/reproducers/simple/ParametrizedJarUrl/resources/PaxHeaders.17941/Parametrize0000644000000000000000000000031212654402377030424 xustar00112 path=icedtea-web-1.6.2/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarUrlSigned1.jnlp 30 mtime=1454507263.263432234 30 atime=1454507327.328577816 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarUrlSigned1.jn0000644000175000002070000000423612654402377034261 0ustar00jvanekmock00000000000000 ParametrizedJarUrlSigned1 IcedTea ParametrizedJarUrlSigned1 icedtea-web-1.6.2/tests/reproducers/simple/ParametrizedJarUrl/resources/PaxHeaders.17941/Parametrize0000644000000000000000000000031112654402377030423 xustar00111 path=icedtea-web-1.6.2/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarUrlSigned.html 30 mtime=1454507263.263432234 30 atime=1454507327.328577816 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarUrlSigned.htm0000644000175000002070000000356512654402377034365 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/simple/ParametrizedJarUrl/resources/PaxHeaders.17941/Parametrize0000644000000000000000000000013212654402377030424 xustar0030 mtime=1454507263.263432234 30 atime=1454507327.328577816 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarUrl2.jnlp0000644000175000002070000000420012654402377033453 0ustar00jvanekmock00000000000000 ParametrizedJarUrl2 IcedTea ParametrizedJarUrl2 icedtea-web-1.6.2/tests/reproducers/simple/ParametrizedJarUrl/resources/PaxHeaders.17941/Parametrize0000644000000000000000000000013212654402377030424 xustar0030 mtime=1454507263.263432234 30 atime=1454507327.328577816 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarUrl1.jnlp0000644000175000002070000000420012654402377033452 0ustar00jvanekmock00000000000000 ParametrizedJarUrl1 IcedTea ParametrizedJarUrl1 icedtea-web-1.6.2/tests/reproducers/simple/ParametrizedJarUrl/resources/PaxHeaders.17941/Parametrize0000644000000000000000000000013212654402377030424 xustar0030 mtime=1454507263.263432234 30 atime=1454507327.328577816 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarUrl.html0000644000175000002070000000355112654402377033402 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/simple/ParametrizedJarUrl/resources/PaxHeaders.17941/Parametrize0000644000000000000000000000031712654402377030431 xustar00118 path=icedtea-web-1.6.2/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarAppletUrlSigned2.jnlp 30 mtime=1454507263.263432234 29 atime=1454507327.32757783 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarAppletUrlSign0000644000175000002070000000452612654402377034431 0ustar00jvanekmock00000000000000 AppletTest IcedTea AppletTest icedtea-web-1.6.2/tests/reproducers/simple/ParametrizedJarUrl/resources/PaxHeaders.17941/Parametrize0000644000000000000000000000031612654402377030430 xustar00117 path=icedtea-web-1.6.2/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarAppletUrlSigned.jnlp 30 mtime=1454507263.263432234 29 atime=1454507327.32757783 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarAppletUrlSign0000644000175000002070000000461412654402377034427 0ustar00jvanekmock00000000000000 ParametrizedJarAppletUrlSigned IcedTea ParametrizedJarAppletUrlSigned icedtea-web-1.6.2/tests/reproducers/simple/ParametrizedJarUrl/resources/PaxHeaders.17941/Parametrize0000644000000000000000000000031112654402377030423 xustar00112 path=icedtea-web-1.6.2/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarAppletUrl2.jnlp 30 mtime=1454507263.262432247 29 atime=1454507327.32757783 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarAppletUrl2.jn0000644000175000002070000000450412654402377034274 0ustar00jvanekmock00000000000000 AppletTest IcedTea AppletTest icedtea-web-1.6.2/tests/reproducers/simple/ParametrizedJarUrl/resources/PaxHeaders.17941/Parametrize0000644000000000000000000000031012654402377030422 xustar00111 path=icedtea-web-1.6.2/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarAppletUrl.jnlp 30 mtime=1454507263.262432247 29 atime=1454507327.32757783 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarAppletUrl.jnl0000644000175000002070000000455612654402377034375 0ustar00jvanekmock00000000000000 ParametrizedJarAppletUrl IcedTea ParametrizedJarAppletUrl icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/ManifestedJar20000644000000000000000000000013112654402377023155 xustar0030 mtime=1454507263.262432247 29 atime=1454507658.77815737 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/simple/ManifestedJar2/0000755000175000002070000000000012654402377023756 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/ManifestedJar2/PaxHeaders.17941/srcs0000644000000000000000000000013112654402377024127 xustar0030 mtime=1454507263.262432247 29 atime=1454507658.77815737 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/simple/ManifestedJar2/srcs/0000755000175000002070000000000012654402377024730 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/ManifestedJar2/srcs/PaxHeaders.17941/ManifestedJar2.java0000644000000000000000000000013112654402377027645 xustar0030 mtime=1454507263.262432247 29 atime=1454507327.32757783 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/simple/ManifestedJar2/srcs/ManifestedJar2.java0000644000175000002070000000350412654402377030373 0ustar00jvanekmock00000000000000/* AllStackTraces.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class ManifestedJar2 { public static void main(String[] args) { hello2(); } public static void hello2() { System.out.println("Hello from ManifestedJar2"); } } icedtea-web-1.6.2/tests/reproducers/simple/ManifestedJar2/srcs/PaxHeaders.17941/META-INF0000644000000000000000000000013112654402377025267 xustar0030 mtime=1454507263.262432247 29 atime=1454507658.77815737 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/simple/ManifestedJar2/srcs/META-INF/0000755000175000002070000000000012654402377026070 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/ManifestedJar2/srcs/META-INF/PaxHeaders.17941/MANIFEST.MF0000644000000000000000000000013112654402377026776 xustar0030 mtime=1454507263.262432247 29 atime=1454507327.32757783 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/simple/ManifestedJar2/srcs/META-INF/MANIFEST.MF0000644000175000002070000000012312654402377027516 0ustar00jvanekmock00000000000000Manifest-Version: 1.0 Main-Class: ManifestedJar2 Application-Name: ManifestedJar2 icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/ManifestedJar10000644000000000000000000000013112654402377023154 xustar0030 mtime=1454507263.262432247 29 atime=1454507658.77815737 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/simple/ManifestedJar1/0000755000175000002070000000000012654402377023755 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/ManifestedJar1/PaxHeaders.17941/testcases0000644000000000000000000000013112654402377025152 xustar0030 mtime=1454507263.262432247 29 atime=1454507658.77815737 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/simple/ManifestedJar1/testcases/0000755000175000002070000000000012654402377025753 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/ManifestedJar1/testcases/PaxHeaders.17941/ManifestedJar1T0000644000000000000000000000013212654402377030074 xustar0030 mtime=1454507263.262432247 30 atime=1454507327.326577843 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/simple/ManifestedJar1/testcases/ManifestedJar1Test.java0000644000175000002070000002162712654402377032263 0ustar00jvanekmock00000000000000/* ManifestedJar1Test.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 net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.annotations.Bug; import net.sourceforge.jnlp.runtime.Translator; import org.junit.Assert; import org.junit.Test; @Bug(id="http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2012-February/017435.html") public class ManifestedJar1Test { private static ServerAccess server = new ServerAccess(); private static final String nonLunchableMessage = "net.sourceforge.jnlp.LaunchException: Fatal: Application Error: Not a launchable JNLP file. File must be a JNLP application, applet, or installer type."; //actually this on eis never printed as stderr will not recieve this message in headless mode :( private static final String twoMainException = "net.sourceforge.jnlp.ParseException: Invalid XML document syntax"; private void assertManifestedJar1(String id, ProcessResult q) { String s = "Hello from ManifestedJar1"; Assert.assertTrue(id + " stdout should contains `" + s + "`, but didn't ", q.stdout.contains(s)); } private void assertManifestedJar2(String id, ProcessResult q) { String s = "Hello from ManifestedJar2"; Assert.assertTrue(id + " stdout should contains `" + s + "`, but didn't ", q.stdout.contains(s)); } private void assertNotManifestedJar1(String id, ProcessResult q) { String s = "Hello from ManifestedJar1"; Assert.assertFalse(id + " stdout should NOT contains `" + s + "`, but didn ", q.stdout.contains(s)); } private void assertAppError(String id, ProcessResult q) { Assert.assertTrue(id + " stderr should contains `" + nonLunchableMessage + "`, but didnn't ", q.stderr.contains(nonLunchableMessage)); } private void assertNotManifestedJar2(String id, ProcessResult q) { String s = "Hello from ManifestedJar2"; Assert.assertFalse(id + " stdout should NOT contains `" + s + "`, but didn ", q.stdout.contains(s)); } private void assertNotDead(String id, ProcessResult pr) { String cc = "ClassNotFoundException"; Assert.assertFalse(id + " stderr should NOT contains `" + cc + "`, but did", pr.stderr.contains(cc)); Assert.assertFalse(id + " should not be terminated, but was", pr.wasTerminated); Assert.assertEquals((Integer) 0, pr.returnValue); } @Test /** * if two jars with manifest specified, none is main and no main class, then first one is loaded */ public void manifestedJar1nothing2nothingNoAppDesc() throws Exception { String id = "ManifestedJar-1nothing2nothingNoAppDesc"; ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp"); assertManifestedJar1(id, pr); assertNotDead(id, pr); } /** *if one jar with manifest, is not main, and no main class then is lunched * */ @Test public void manifestedJar1noAppDesc() throws Exception { String id = "ManifestedJar-1noAppDesc"; ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp"); assertManifestedJar1(id, pr); assertNotDead(id, pr); } /** *if one jar with manifest, but not marked as main and no main class then is lunched * */ @Test public void manifestedJar1mainNoAppDesc() throws Exception { String id = "ManifestedJar-1mainNoAppDesc"; ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp"); assertManifestedJar1(id, pr); assertNotDead(id, pr); } /** *if one jar with manifest, marked as main and no main class then is lunched * */ @Test public void ManifestedJar1mainHaveAppDesc() throws Exception { String id = "ManifestedJar-1mainHaveAppDesc"; ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp"); assertManifestedJar2(id, pr); assertNotDead(id, pr); } /** * * Two jars, both with manifest, First is main, but specified mainclass belongs to second one, then second one should be lunched */ @Test public void ManifestedJar1main2nothingNoAppDesc() throws Exception { String id = "ManifestedJar-1main2nothingNoAppDesc"; ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp"); assertManifestedJar2(id, pr); assertNotDead(id, pr); } /** * * Two jars, both with manifest, seconds is main, no mainclass, then the one marked as main is lunched */ @Test public void manifestedJar1main2nothingNoAppDesc() throws Exception { String id = "ManifestedJar-1main2nothingNoAppDesc"; ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp"); assertManifestedJar2(id, pr); assertNotDead(id, pr); } /** * * Two jars, both with manifest, sboth with main tag, no app desc * first jar is taken * */ @Test public void manifestedJar1main2mainNoAppDesc() throws Exception { String id = "ManifestedJar-1main2mainNoAppDesc"; ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp"); assertManifestedJar1(id, pr); assertNotManifestedJar2(id, pr); assertNotDead(id, pr); } /** * * Two jars, both with manifest, sboth with main tag, no app desc * two main jars reported * */ @Test public void manifestedJar1main2mainNoAppDescStrict() throws Exception { String id = "ManifestedJar-1main2mainNoAppDesc"; ProcessResult pr = server.executeJavawsHeadless(Arrays.asList(new String[]{"-strict"}), "/" + id + ".jnlp"); assertNotManifestedJar1(id, pr); assertNotManifestedJar2(id, pr); assertNotDead(id, pr); Assert.assertTrue(pr.stderr.contains(Translator.R("PTwoMains")) || pr.stdout.contains(Translator.R("PTwoMains"))); } /** * * Two jars, both with manifest, sboth with main tag, have app desc * * corectly failing with twoMainException */ @Test public void manifestedJar1main2mainAppDesc() throws Exception { String id = "ManifestedJar-1main2mainAppDesc"; ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp"); assertNotManifestedJar1(id, pr); assertNotManifestedJar2(id, pr); assertNotDead(id, pr); } /** * * Two jars, both with manifest, sboth with main tag, have app desc * * corectly failing */ @Test public void manifestedJar1noAppDescAtAll() throws Exception { String id = "ManifestedJar-1noAppDescAtAll"; ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp"); assertNotManifestedJar1(id, pr); assertNotManifestedJar2(id, pr); assertAppError(id, pr); assertNotDead(id, pr); } /** * * Two jars, both with manifest, non with main tag, have app desc * * this jnlp is NOT lunched, twoMainException thrown - ok * */ @Test public void manifestedJar1nothing2nothingAppDesc() throws Exception { String id = "ManifestedJar-1nothing2nothingAppDesc"; ProcessResult pr = server.executeJavawsHeadless(null, "/" + id + ".jnlp"); assertManifestedJar2(id, pr); assertNotManifestedJar1(id, pr); assertNotDead(id, pr); } } icedtea-web-1.6.2/tests/reproducers/simple/ManifestedJar1/PaxHeaders.17941/srcs0000644000000000000000000000013112654402377024126 xustar0030 mtime=1454507263.261432261 29 atime=1454507658.77815737 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/simple/ManifestedJar1/srcs/0000755000175000002070000000000012654402377024727 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/ManifestedJar1/srcs/PaxHeaders.17941/ManifestedJar1.java0000644000000000000000000000013212654402377027644 xustar0030 mtime=1454507263.261432261 30 atime=1454507327.326577843 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/simple/ManifestedJar1/srcs/ManifestedJar1.java0000644000175000002070000000350412654402377030371 0ustar00jvanekmock00000000000000/* AllStackTraces.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class ManifestedJar1 { public static void main(String[] args) { hello1(); } public static void hello1() { System.out.println("Hello from ManifestedJar1"); } } icedtea-web-1.6.2/tests/reproducers/simple/ManifestedJar1/srcs/PaxHeaders.17941/META-INF0000644000000000000000000000013112654402377025266 xustar0030 mtime=1454507263.261432261 29 atime=1454507658.77815737 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/simple/ManifestedJar1/srcs/META-INF/0000755000175000002070000000000012654402377026067 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/ManifestedJar1/srcs/META-INF/PaxHeaders.17941/MANIFEST.MF0000644000000000000000000000013212654402377026776 xustar0030 mtime=1454507263.261432261 30 atime=1454507327.326577843 30 ctime=1454507658.759157623 icedtea-web-1.6.2/tests/reproducers/simple/ManifestedJar1/srcs/META-INF/MANIFEST.MF0000644000175000002070000000012312654402377027515 0ustar00jvanekmock00000000000000Manifest-Version: 1.0 Main-Class: ManifestedJar1 Application-Name: ManifestedJar1 icedtea-web-1.6.2/tests/reproducers/simple/ManifestedJar1/PaxHeaders.17941/resources0000644000000000000000000000013112654402377025166 xustar0030 mtime=1454507263.261432261 29 atime=1454507658.77815737 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/ManifestedJar1/resources/0000755000175000002070000000000012654402377025767 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/ManifestedJar1/resources/PaxHeaders.17941/ManifestedJar-10000644000000000000000000000032412654402377030044 xustar00122 path=icedtea-web-1.6.2/tests/reproducers/simple/ManifestedJar1/resources/ManifestedJar-1nothing2nothingNoAppDesc.jnlp 30 mtime=1454507263.261432261 30 atime=1454507327.326577843 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/ManifestedJar1/resources/ManifestedJar-1nothing2nothingNo0000644000175000002070000000432412654402377034124 0ustar00jvanekmock00000000000000 ManifestedJar-1nothing2nothingNoAppDesc IcedTea testing jar with manin class in manifest. Hello from manifestedjar1 should be printed icedtea-web-1.6.2/tests/reproducers/simple/ManifestedJar1/resources/PaxHeaders.17941/ManifestedJar-10000644000000000000000000000032212654402377030042 xustar00120 path=icedtea-web-1.6.2/tests/reproducers/simple/ManifestedJar1/resources/ManifestedJar-1nothing2nothingAppDesc.jnlp 30 mtime=1454507263.261432261 30 atime=1454507327.326577843 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/ManifestedJar1/resources/ManifestedJar-1nothing2nothingAp0000644000175000002070000000435212654402377034111 0ustar00jvanekmock00000000000000 ManifestedJar-1nothing2nothingAppDesc IcedTea testing jar with manin class in manifest. Hello from manifestedjar2 should be printed icedtea-web-1.6.2/tests/reproducers/simple/ManifestedJar1/resources/PaxHeaders.17941/ManifestedJar-10000644000000000000000000000031212654402377030041 xustar00112 path=icedtea-web-1.6.2/tests/reproducers/simple/ManifestedJar1/resources/ManifestedJar-1noAppDescAtAll.jnlp 30 mtime=1454507263.261432261 30 atime=1454507327.326577843 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/ManifestedJar1/resources/ManifestedJar-1noAppDescAtAll.jn0000644000175000002070000000417612654402377033715 0ustar00jvanekmock00000000000000 ManifestedJar-1noAppDescAtAll IcedTea testing jar with manin class in manifest, exception during launching, no application specified icedtea-web-1.6.2/tests/reproducers/simple/ManifestedJar1/resources/PaxHeaders.17941/ManifestedJar-10000644000000000000000000000013212654402377030041 xustar0030 mtime=1454507263.260432274 30 atime=1454507327.325577856 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/ManifestedJar1/resources/ManifestedJar-1noAppDesc.jnlp0000644000175000002070000000421312654402377033323 0ustar00jvanekmock00000000000000 ManifestedJar-1noAppDesc IcedTea testing jar with manin class in manifest, hello from manifestedjar1 shold be printed icedtea-web-1.6.2/tests/reproducers/simple/ManifestedJar1/resources/PaxHeaders.17941/ManifestedJar-10000644000000000000000000000031112654402377030040 xustar00111 path=icedtea-web-1.6.2/tests/reproducers/simple/ManifestedJar1/resources/ManifestedJar-1mainNoAppDesc.jnlp 30 mtime=1454507263.260432274 30 atime=1454507327.325577856 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/ManifestedJar1/resources/ManifestedJar-1mainNoAppDesc.jnl0000644000175000002070000000424512654402377033755 0ustar00jvanekmock00000000000000 ManifestedJar-1mainNoAppDesc.jnlp IcedTea testing jar with manin class in manifest, hello from manifestedjar should be printed icedtea-web-1.6.2/tests/reproducers/simple/ManifestedJar1/resources/PaxHeaders.17941/ManifestedJar-10000644000000000000000000000031312654402377030042 xustar00113 path=icedtea-web-1.6.2/tests/reproducers/simple/ManifestedJar1/resources/ManifestedJar-1mainHaveAppDesc.jnlp 30 mtime=1454507263.260432274 30 atime=1454507327.325577856 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/ManifestedJar1/resources/ManifestedJar-1mainHaveAppDesc.j0000644000175000002070000000440212654402377033725 0ustar00jvanekmock00000000000000 "ManifestedJar-1mainHaveAppDesc.jnlp IcedTea testing jar with manin class in manifest, hello from manifestedjar2 should be printed icedtea-web-1.6.2/tests/reproducers/simple/ManifestedJar1/resources/PaxHeaders.17941/ManifestedJar-10000644000000000000000000000032112654402377030041 xustar00119 path=icedtea-web-1.6.2/tests/reproducers/simple/ManifestedJar1/resources/ManifestedJar-1main2nothingNoAppDesc.jnlp 30 mtime=1454507263.260432274 30 atime=1454507327.325577856 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/ManifestedJar1/resources/ManifestedJar-1main2nothingNoApp0000644000175000002070000000433112654402377034041 0ustar00jvanekmock00000000000000 ManifestedJar-1main2nothingNoAppDesc IcedTea testing jar with manin class in manifest, hello from manifestedjar2 should be printed icedtea-web-1.6.2/tests/reproducers/simple/ManifestedJar1/resources/PaxHeaders.17941/ManifestedJar-10000644000000000000000000000031612654402377030045 xustar00116 path=icedtea-web-1.6.2/tests/reproducers/simple/ManifestedJar1/resources/ManifestedJar-1main2mainNoAppDesc.jnlp 30 mtime=1454507263.259432288 30 atime=1454507327.325577856 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/ManifestedJar1/resources/ManifestedJar-1main2mainNoAppDes0000644000175000002070000000434012654402377033753 0ustar00jvanekmock00000000000000 ManifestedJar-1main2mainNoAppDesc.jnlp IcedTea testing jar with manin class in manifest, hello from manifestedjar1 should go out icedtea-web-1.6.2/tests/reproducers/simple/ManifestedJar1/resources/PaxHeaders.17941/ManifestedJar-10000644000000000000000000000031412654402377030043 xustar00114 path=icedtea-web-1.6.2/tests/reproducers/simple/ManifestedJar1/resources/ManifestedJar-1main2mainAppDesc.jnlp 30 mtime=1454507263.259432288 30 atime=1454507327.325577856 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/ManifestedJar1/resources/ManifestedJar-1main2mainAppDesc.0000644000175000002070000000435312654402377033703 0ustar00jvanekmock00000000000000 Test Thread.getAllStackTraces IcedTea testing jar with manin class in manifest. Invalid xml exception should go out icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/LocalisedInformationElement0000644000000000000000000000013112654402377025776 xustar0030 mtime=1454507263.259432288 29 atime=1454507658.77815737 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/LocalisedInformationElement/0000755000175000002070000000000012654402377026577 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/LocalisedInformationElement/PaxHeaders.17941/testcases0000644000000000000000000000013112654402377027774 xustar0030 mtime=1454507263.259432288 29 atime=1454507658.77815737 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/LocalisedInformationElement/testcases/0000755000175000002070000000000012654402377030575 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/LocalisedInformationElement/testcases/PaxHeaders.17941/Lo0000644000000000000000000000033112654402377030350 xustar00127 path=icedtea-web-1.6.2/tests/reproducers/simple/LocalisedInformationElement/testcases/LocalisedInformationElementTest.java 30 mtime=1454507263.259432288 30 atime=1454507327.324577869 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/LocalisedInformationElement/testcases/LocalisedInformatio0000644000175000002070000004207612654402377034460 0ustar00jvanekmock00000000000000/* LocalisedInformationElementTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Set; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.annotations.Bug; import org.junit.Assert; import org.junit.Test; public class LocalisedInformationElementTest { private static ServerAccess server = new ServerAccess(); /** * this will prepare new set of varibales with wanted locale, which * can be then passed to subprocess * @param locale - locale to be set to LANG variable, eg cs_CZ.UTF-8 */ public static String[] getChangeLocalesForSubproces(String locale) { ServerAccess.logOutputReprint("Setting locales"); Map p = System.getenv(); Set> r = p.entrySet(); List> rr = new ArrayList>(r); Collections.sort(rr, new Comparator>() { @Override public int compare(Entry o1, Entry o2) { return o1.getKey().compareTo(o2.getKey()); } }); String[] l = new String[rr.size()]; int i = -1; for (Iterator> it = rr.iterator(); it.hasNext();) { i++; Entry entry = it.next(); String v = entry.getValue(); String s = entry.getKey() + "=" + v; //System.out.println(s); if (entry.getKey().equals("LANG")) { ServerAccess.logOutputReprint("was " + v); v = locale; ServerAccess.logOutputReprint("set " + v); } s = entry.getKey() + "=" + v; l[i] = s; } return l; } public static ProcessResult evaluateLocalisedInformationElementTest(String id, String[] variables, boolean verbose) throws Exception { ProcessResult pr = executeJavaws(verbose, variables, id); String s = "LocalisedInformationElement launched"; Assert.assertTrue(id + " stdout should contains " + s + " bud didn't", pr.stdout.contains(s)); String locMatch = "(?s).*default locale: \\w{2}.*"; Assert.assertTrue(id + " stdout should match " + locMatch + " bud didn't", pr.stdout.matches(locMatch)); return pr; } public static ProcessResult evaluateLocalisedInformationElementTestNotLaunched(String id, String[] variables, boolean verbose) throws Exception { ProcessResult pr = executeJavaws(verbose, variables, id); String s = "LocalisedInformationElement launched"; Assert.assertFalse(id + " stdout should not contains " + s + " bud didn't", pr.stdout.contains(s)); String ss = "xception"; Assert.assertTrue(id + " stderr should contains " + ss + " but didn't", pr.stderr.contains(ss)); String locMatch = "(?s).*default locale: \\w{2}.*"; Assert.assertFalse(id + " stdout should not match " + locMatch + " bud didn't", pr.stdout.matches(locMatch)); String sss = "MissingVendorException"; Assert.assertTrue(id + " stderr should contains " + sss + " but didn't", pr.stderr.contains(sss)); return pr; } private static ProcessResult executeJavaws(boolean verbose, String[] variables, String id) throws Exception { List oa = new ArrayList(1); if (verbose) { oa.add("-verbose"); } final ProcessResult pr; if (variables == null) { pr = server.executeJavawsHeadless(oa, "/" + id + ".jnlp"); } else { pr = server.executeJavawsHeadless(oa, "/" + id + ".jnlp", variables); } return pr; } //the description checkis disabled for all PR955, so it is representing just //PR955 issue. Tests with enable description check are introduced later private final boolean w1=false; @Test @Bug(id = "PR955") public void testLocalisedInformationElementLaunchWithLocalisedInformation1() throws Exception { String[] l = getChangeLocalesForSubproces("en_US.UTF-8"); ProcessResult pr = evaluateLocalisedInformationElementTest("LocalisedInformationElement1", l, true); assertTiVeDe(pr, "localisedJnlp1.jnlp1", "IcedTea", "LocalisedInformationElement1.jnlp", w1); } //LANG variable do not 'accept' nationales without regions :( // @Test // @Bug(id = "PR955") // public void testLocalisedInformationElementLaunchWithLocalisedInformation2() throws Exception { // String[] l = getChangeLocalesForSubproces("cs"); // ProcessResult pr = evaluateLocalisedInformationElementTest("LocalisedInformationElement1", l,true); // assertTiVeDe(pr,"LocalisedInformationElement1.jnlp po cesky","IcedTea CZ","Muj vlastni LocalisedInformationElement1.jnlp",w1); // } @Test @Bug(id = "PR955") public void testLocalisedInformationElementLaunchWithLocalisedInformation22() throws Exception { String[] l = getChangeLocalesForSubproces("cs_CZ"); ProcessResult pr = evaluateLocalisedInformationElementTest("LocalisedInformationElement1", l, true); assertTiVeDe(pr, "LocalisedInformationElement1.jnlp po cesky", "IcedTea CZ", "Muj vlastni LocalisedInformationElement1.jnlp", w1); } @Test @Bug(id = "PR955") public void testLocalisedInformationElementLaunchWithLocalisedInformation33_1() throws Exception { String[] l = getChangeLocalesForSubproces("fr_BE"); ProcessResult pr = evaluateLocalisedInformationElementTest("LocalisedInformationElement1", l, true); assertTiVeDe(pr, "LocalisedInformationElement1.jnlp la francee BE", "IcedTea", "La LocalisedInformationElement1.jnlp", w1); } // java is ignoring set encoding :( // @Test // @Bug(id = "PR955") // public void testLocalisedInformationElementLaunchWithLocalisedInformation33_2() throws Exception { // String[] l = getChangeLocalesForSubproces("fr_BE.iso88591"); // ProcessResult pr = evaluateLocalisedInformationElementTest("LocalisedInformationElement1", l, true); // assertTiVeDe(pr, "LocalisedInformationElement1.jnlp la francee BE iso88591", "IcedTea", "La LocalisedInformationElement1.jnlp",false); // } @Test @Bug(id = "PR955") public void testLocalisedInformationElementLaunchWithLocalisedInformation33_() throws Exception { String[] l = getChangeLocalesForSubproces("fr_CH"); ProcessResult pr = evaluateLocalisedInformationElementTest("LocalisedInformationElement1", l, true); assertTiVeDe(pr, "LocalisedInformationElement1.jnlp la francee", "IcedTea", "La LocalisedInformationElement1.jnlp", w1); } @Test @Bug(id = "PR955") public void testLocalisedInformationElementLaunchWithLocalisedInformation1_withPieceMissing() throws Exception { String[] l = getChangeLocalesForSubproces("en_US.UTF-8"); ProcessResult pr = evaluateLocalisedInformationElementTestNotLaunched("LocalisedInformationElement2", l, true); } @Test @Bug(id = "PR955") public void testLocalisedInformationElementLaunchWithLocalisedInformation22_withPieceMissing() throws Exception { String[] l = getChangeLocalesForSubproces("cs_CZ"); ProcessResult pr = evaluateLocalisedInformationElementTestNotLaunched("LocalisedInformationElement2", l, true); } @Test @Bug(id = "PR955") public void testLocalisedInformationElementLaunchWithLocalisedInformation33_1_withPieceMissing() throws Exception { String[] l = getChangeLocalesForSubproces("fr_BE"); ProcessResult pr = evaluateLocalisedInformationElementTest("LocalisedInformationElement2", l, true); assertTiVeDe(pr, "LocalisedInformationElement1.jnlp la francee BE", "IcedTea", "La LocalisedInformationElement1.jnlp", w1); } @Test @Bug(id = "PR955") public void testLocalisedInformationElementLaunchWithLocalisedInformation33_withPieceMissing() throws Exception { String[] l = getChangeLocalesForSubproces("fr_CH"); ProcessResult pr = evaluateLocalisedInformationElementTest("LocalisedInformationElement2", l, true); assertTiVeDe(pr, "LocalisedInformationElement1.jnlp la francee", "IcedTea", "La LocalisedInformationElement1.jnlp", w1); } //thsoe 11 methods are jsut for printing of locales passed to javaws //so actually testing the LOCALE hack @Test public void printLocales() throws Exception { ProcessResult pr = evaluateLocalisedInformationElementTest("LocalisedInformationElement_noLoc", null, false); } @Test public void printLocalesChanged1() throws Exception { String[] l = getChangeLocalesForSubproces("cs_CZ.UTF-8"); ProcessResult pr = evaluateLocalisedInformationElementTest("LocalisedInformationElement_noLoc", l, false); Assert.assertTrue(pr.stdout.contains("cs_CZ")); } // the following four have acepted iso encoding, but not used it @Test public void printLocalesChanged2() throws Exception { String[] l = getChangeLocalesForSubproces("en_AU.ISO-8859-1"); ProcessResult pr = evaluateLocalisedInformationElementTest("LocalisedInformationElement_noLoc", l, false); Assert.assertTrue(pr.stdout.contains("en_AU")); } @Test public void printLocalesChanged22() throws Exception { String[] l = getChangeLocalesForSubproces("en_AU.ISO88591"); ProcessResult pr = evaluateLocalisedInformationElementTest("LocalisedInformationElement_noLoc", l, false); Assert.assertTrue(pr.stdout.contains("en_AU")); } @Test public void printLocalesChanged2222() throws Exception { String[] l = getChangeLocalesForSubproces("en_AU.iso-8859-1"); ProcessResult pr = evaluateLocalisedInformationElementTest("LocalisedInformationElement_noLoc", l, false); Assert.assertTrue(pr.stdout.contains("en_AU")); } @Test public void printLocalesChanged3() throws Exception { String[] l = getChangeLocalesForSubproces("en_AU.UTF-8"); ProcessResult pr = evaluateLocalisedInformationElementTest("LocalisedInformationElement_noLoc", l, false); Assert.assertTrue(pr.stdout.contains("en_AU")); } // the following five have NOTacepted iso encoding at all @Test public void printLocalesChanged2_X() throws Exception { String[] l = getChangeLocalesForSubproces("en_AU.ISO-8859-2"); ProcessResult pr = evaluateLocalisedInformationElementTest("LocalisedInformationElement_noLoc", l, false); Assert.assertFalse(pr.stdout.contains("en_AU")); } @Test public void printLocalesChanged22_X() throws Exception { String[] l = getChangeLocalesForSubproces("en_AU.ISO88592"); ProcessResult pr = evaluateLocalisedInformationElementTest("LocalisedInformationElement_noLoc", l, false); Assert.assertFalse(pr.stdout.contains("en_AU")); } @Test public void printLocalesChanged2222_X() throws Exception { String[] l = getChangeLocalesForSubproces("en_AU.iso-8859-2"); ProcessResult pr = evaluateLocalisedInformationElementTest("LocalisedInformationElement_noLoc", l, false); Assert.assertFalse(pr.stdout.contains("en_AU")); } @Test public void printLocalesChanged3_X() throws Exception { String[] l = getChangeLocalesForSubproces("en_AU.UTF-16"); ProcessResult pr = evaluateLocalisedInformationElementTest("LocalisedInformationElement_noLoc", l, false); Assert.assertFalse(pr.stdout.contains("en_AU")); } @Test public void printLocalesChanged4_X() throws Exception { String[] l = getChangeLocalesForSubproces("en_AU.jklukl56489jkyk"); ProcessResult pr = evaluateLocalisedInformationElementTest("LocalisedInformationElement_noLoc", l, false); Assert.assertFalse(pr.stdout.contains("en_AU")); } private static final String DEFAULT_HOMEPAGE = "http://icedtea.classpath.org/wiki/IcedTea-Web#Testing_IcedTea-Web"; public static void assertTiVeDe(ProcessResult pr, String title, String vendor, String description, boolean descTests) { assertTiHpVeDe(pr, title, DEFAULT_HOMEPAGE, vendor, description, descTests); } public static void assertTiHpVeDe(ProcessResult pr, String title, String homepage, String vendor, String description, boolean descTests) { Assert.assertTrue("call shuld evaluate homepage as: " + homepage + " but did not", pr.stdout.contains("Homepage: " + homepage)); Assert.assertTrue("call shuld evaluate title as: " + title + " but did not", pr.stdout.contains("Acceptable title tag found, contains: " + title)); Assert.assertTrue("call shuld evaluate vendor as: " + " but did not", pr.stdout.contains("Acceptable vendor tag found, contains: " + vendor)); if (descTests) { Assert.assertTrue("call shuld evaluate description as: " + description + " but did not", pr.stdout.contains("Description: " + description)); } } //following tests are testing also localisation of description private final boolean w2=true; @Test public void testLocalisedInformationElementLaunchWithLocalisedInformation1_withDescription() throws Exception { String[] l = getChangeLocalesForSubproces("en_US.UTF-8"); ProcessResult pr = evaluateLocalisedInformationElementTest("LocalisedInformationElement3", l, true); assertTiVeDe(pr, "localisedJnlp1.jnlp1", "IcedTea", "D_DEF", w2); } @Test public void testLocalisedInformationElementLaunchWithLocalisedInformation22_withDescription() throws Exception { String[] l = getChangeLocalesForSubproces("cs_CZ"); ProcessResult pr = evaluateLocalisedInformationElementTest("LocalisedInformationElement3", l, true); assertTiVeDe(pr, "LocalisedInformationElement1.jnlp po cesky", "IcedTea CZ", "D_DEF_CS", w2); } @Test public void testLocalisedInformationElementLaunchWithLocalisedInformation33_1_withDescription() throws Exception { String[] l = getChangeLocalesForSubproces("fr_BE"); ProcessResult pr = evaluateLocalisedInformationElementTest("LocalisedInformationElement3", l, true); assertTiVeDe(pr, "LocalisedInformationElement1.jnlp la francee BE", "IcedTea", "D_FR_BE", w2); } @Test public void testLocalisedInformationElementLaunchWithLocalisedInformation33__withDescription() throws Exception { String[] l = getChangeLocalesForSubproces("fr_CH"); ProcessResult pr = evaluateLocalisedInformationElementTest("LocalisedInformationElement3", l, true); assertTiVeDe(pr, "LocalisedInformationElement1.jnlp la francee", "IcedTea", "D_DEF_FR", w2); } @Test public void testLocalisedInformationElementLaunchWithLocalisedInformation33_1_withPieceMissing_withDescription() throws Exception { String[] l = getChangeLocalesForSubproces("fr_BE"); ProcessResult pr = evaluateLocalisedInformationElementTest("LocalisedInformationElement4", l, true); assertTiVeDe(pr, "LocalisedInformationElement1.jnlp la francee BE", "IcedTea", "D_DEF_FR", w2); } @Test public void testLocalisedInformationElementLaunchWithLocalisedInformation33_withPieceMissing_withDescription() throws Exception { String[] l = getChangeLocalesForSubproces("fr_CH"); ProcessResult pr = evaluateLocalisedInformationElementTest("LocalisedInformationElement4", l, true); assertTiVeDe(pr, "LocalisedInformationElement1.jnlp la francee", "IcedTea", "D_DEF_FR", w2); } //following tests are testing localisation of homepage //to lazy to do... } icedtea-web-1.6.2/tests/reproducers/simple/LocalisedInformationElement/PaxHeaders.17941/srcs0000644000000000000000000000013112654402377026750 xustar0030 mtime=1454507263.258432301 29 atime=1454507658.77815737 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/LocalisedInformationElement/srcs/0000755000175000002070000000000012654402377027551 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/LocalisedInformationElement/srcs/PaxHeaders.17941/Localis0000644000000000000000000000032012654402377030336 xustar00118 path=icedtea-web-1.6.2/tests/reproducers/simple/LocalisedInformationElement/srcs/LocalisedInformationElement.java 30 mtime=1454507263.258432301 30 atime=1454507327.324577869 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/LocalisedInformationElement/srcs/LocalisedInformationElem0000644000175000002070000000424412654402377034410 0ustar00jvanekmock00000000000000/* LocalisedInformationElement.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.util.Locale; public class LocalisedInformationElement{ public static void main(String[] args){ System.out.println("LocalisedInformationElement launched"); System.out.println("*******************"); // This needs signed code // String locale = System.getProperty("user.language"); // System.out.println("value of user.language: "+locale); Locale loc=Locale.getDefault(); System.out.println("default locale: "+loc.toString()); System.out.println("*******************"); } } icedtea-web-1.6.2/tests/reproducers/simple/LocalisedInformationElement/PaxHeaders.17941/resources0000644000000000000000000000013112654402377030010 xustar0030 mtime=1454507263.258432301 29 atime=1454507658.77815737 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/LocalisedInformationElement/resources/0000755000175000002070000000000012654402377030611 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/LocalisedInformationElement/resources/PaxHeaders.17941/Lo0000644000000000000000000000033312654402377030366 xustar00129 path=icedtea-web-1.6.2/tests/reproducers/simple/LocalisedInformationElement/resources/LocalisedInformationElement_noLoc.jnlp 30 mtime=1454507263.258432301 30 atime=1454507327.324577869 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/LocalisedInformationElement/resources/LocalisedInformatio0000644000175000002070000000427312654402377034471 0ustar00jvanekmock00000000000000 localisedJnlp_noLoc.jnlp1 IcedTea LocalisedInformationElement_noLoc.jnlp icedtea-web-1.6.2/tests/reproducers/simple/LocalisedInformationElement/resources/PaxHeaders.17941/Lo0000644000000000000000000000032612654402377030370 xustar00124 path=icedtea-web-1.6.2/tests/reproducers/simple/LocalisedInformationElement/resources/LocalisedInformationElement4.jnlp 30 mtime=1454507263.258432301 30 atime=1454507327.324577869 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/LocalisedInformationElement/resources/LocalisedInformatio0000644000175000002070000000533612654402377034472 0ustar00jvanekmock00000000000000 localisedJnlp1.jnlp1 D_DEF LocalisedInformationElement1.jnlp la francee IcedTea D_DEF_FR LocalisedInformationElement1.jnlp la francee BE LocalisedInformationElement1.jnlp po cesky D_DEF_CS icedtea-web-1.6.2/tests/reproducers/simple/LocalisedInformationElement/resources/PaxHeaders.17941/Lo0000644000000000000000000000032612654402377030370 xustar00124 path=icedtea-web-1.6.2/tests/reproducers/simple/LocalisedInformationElement/resources/LocalisedInformationElement3.jnlp 30 mtime=1454507263.258432301 30 atime=1454507327.324577869 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/LocalisedInformationElement/resources/LocalisedInformatio0000644000175000002070000000524212654402377034466 0ustar00jvanekmock00000000000000 localisedJnlp1.jnlp1 IcedTea D_DEF LocalisedInformationElement1.jnlp la francee D_DEF_FR LocalisedInformationElement1.jnlp la francee BE D_FR_BE LocalisedInformationElement1.jnlp po cesky IcedTea CZ D_DEF_CS icedtea-web-1.6.2/tests/reproducers/simple/LocalisedInformationElement/resources/PaxHeaders.17941/Lo0000644000000000000000000000032612654402377030370 xustar00124 path=icedtea-web-1.6.2/tests/reproducers/simple/LocalisedInformationElement/resources/LocalisedInformationElement2.jnlp 30 mtime=1454507263.257432314 30 atime=1454507327.323577883 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/LocalisedInformationElement/resources/LocalisedInformatio0000644000175000002070000000547312654402377034474 0ustar00jvanekmock00000000000000 localisedJnlp1.jnlp1 LocalisedInformationElement1.jnlp LocalisedInformationElement1.jnlp la francee IcedTea La LocalisedInformationElement1.jnlp LocalisedInformationElement1.jnlp la francee BE LocalisedInformationElement1.jnlp po cesky Muj vlastni LocalisedInformationElement1.jnlp icedtea-web-1.6.2/tests/reproducers/simple/LocalisedInformationElement/resources/PaxHeaders.17941/Lo0000644000000000000000000000032612654402377030370 xustar00124 path=icedtea-web-1.6.2/tests/reproducers/simple/LocalisedInformationElement/resources/LocalisedInformationElement1.jnlp 30 mtime=1454507263.257432314 30 atime=1454507327.323577883 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/LocalisedInformationElement/resources/LocalisedInformatio0000644000175000002070000000555512654402377034475 0ustar00jvanekmock00000000000000 localisedJnlp1.jnlp1 IcedTea LocalisedInformationElement1.jnlp LocalisedInformationElement1.jnlp la francee La LocalisedInformationElement1.jnlp LocalisedInformationElement1.jnlp la francee BE LocalisedInformationElement1.jnlp la francee BE iso88591 LocalisedInformationElement1.jnlp po cesky IcedTea CZ Muj vlastni LocalisedInformationElement1.jnlp icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/LocalesTest0000644000000000000000000000013112654402377022601 xustar0030 mtime=1454507263.257432314 29 atime=1454507658.77815737 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/LocalesTest/0000755000175000002070000000000012654402377023402 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/LocalesTest/PaxHeaders.17941/testcases0000644000000000000000000000013112654402377024577 xustar0030 mtime=1454507263.257432314 29 atime=1454507658.77815737 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/LocalesTest/testcases/0000755000175000002070000000000012654402377025400 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/LocalesTest/testcases/PaxHeaders.17941/LocalesTestTest.ja0000644000000000000000000000013212654402377030253 xustar0030 mtime=1454507263.257432314 30 atime=1454507327.323577883 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/LocalesTest/testcases/LocalesTestTest.java0000644000175000002070000003652312654402377031336 0ustar00jvanekmock00000000000000/* LocalisedInformationElementTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.PropertyResourceBundle; import java.util.ResourceBundle; import java.util.Set; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import org.junit.Assert; import org.junit.Test; public class LocalesTestTest { private static final ServerAccess server = new ServerAccess(); String[] keys = { "BOUsage", "BOUsage2", "BOArg", "BOParam", "BOProperty", "BOLicense", "BOVerbose", "BOAbout", "BONosecurity", "BONoupdate", "BOHeadless", "BOStrict", "BOViewer", "BXnofork", "BXclearcache", "BOHelp1"}; /** * this will prepare new set of variables with wanted locale, which can be * then passed to subprocess * * @param locale - locale to be set to LANG variable, eg cs_CZ.UTF-8 */ public static String[] getChangeLocalesForSubproces(String locale) { ServerAccess.logOutputReprint("Setting locales"); Map p = System.getenv(); Set> r = p.entrySet(); List> rr = new ArrayList>(r); Collections.sort(rr, new Comparator>() { @Override public int compare(Entry o1, Entry o2) { return o1.getKey().compareTo(o2.getKey()); } }); String[] l = new String[rr.size()]; int i = 0; for (Iterator> it = rr.iterator(); it.hasNext(); i++) { Entry entry = it.next(); String v = entry.getValue(); String s = entry.getKey() + "=" + v; //System.out.println(s); if (entry.getKey().equals("LANG")) { ServerAccess.logOutputReprint("was " + v); v = locale; ServerAccess.logOutputReprint("set " + v); } s = entry.getKey() + "=" + v; l[i] = s; } return l; } private ResourceBundle getPropertiesDe() throws IOException { return getProperties("_de"); } public ResourceBundle getPropertiesCz() throws IOException { return getProperties("_cs"); } public ResourceBundle getPropertiesPl() throws IOException { return getProperties("_pl"); } public ResourceBundle getPropertiesEn() throws IOException { return getProperties(""); } public ResourceBundle getProperties(String s) throws IOException { ClassLoader cl = this.getClass().getClassLoader(); ServerAccess.logOutputReprint(cl==null?"null":cl.toString()); if (cl == null) { cl = ClassLoader.getSystemClassLoader(); ServerAccess.logOutputReprint(cl==null?"null":cl.toString()); } InputStream q = cl.getResourceAsStream("net/sourceforge/jnlp/resources/Messages" + s + ".properties"); return new PropertyResourceBundle(q); } //just launching javaws -about to see if messages are corectly localised List javaws = Arrays.asList(new String[]{server.getJavawsLocation(), "-help", ServerAccess.HEADLES_OPTION}); @Test public void testLocalesEnUsUtf() throws Exception { String[] l = getChangeLocalesForSubproces("en_US.UTF-8"); ProcessResult pr = ServerAccess.executeProcess(javaws, null, null, l); assertEnglish(pr.stdout); assertNotCz(pr.stdout); assertNotDe(pr.stdout); assertNotPl(pr.stdout); } @Test public void testLocalesCsCz() throws Exception { String[] l = getChangeLocalesForSubproces("cs_CZ"); ProcessResult pr = ServerAccess.executeProcess(javaws, null, null, l); assertNotEnglish(pr.stdout); assertNotCz(pr.stdout); assertNotDe(pr.stdout); assertNotPl(pr.stdout); iteratePropertiesForAproxCzCs(pr.stdout); } @Test public void testLocalesCsCzUtf() throws Exception { String[] l = getChangeLocalesForSubproces("cs_CZ.UTF-8"); ProcessResult pr = ServerAccess.executeProcess(javaws, null, null, l); assertNotEnglish(pr.stdout); assertNotDe(pr.stdout); assertCz(pr.stdout); assertNotPl(pr.stdout); iteratePropertiesForAproxCzCs(pr.stdout); } @Test public void testLocalesPlPL() throws Exception { String[] l = getChangeLocalesForSubproces("pl_PL"); ProcessResult pr = ServerAccess.executeProcess(javaws, null, null, l); assertNotEnglish(pr.stdout); assertNotCz(pr.stdout); assertNotDe(pr.stdout); iteratePropertiesForAproxPl(pr.stdout); } @Test public void testLocalesPlPLUtf() throws Exception { String[] l = getChangeLocalesForSubproces("pl_PL.UTF-8"); ProcessResult pr = ServerAccess.executeProcess(javaws, null, null, l); assertNotEnglish(pr.stdout); assertNotDe(pr.stdout); assertNotCz(pr.stdout); assertPl(pr.stdout); iteratePropertiesForAproxPl(pr.stdout); } @Test public void testLocalesDeDe() throws Exception { String[] l = getChangeLocalesForSubproces("de_DE"); ProcessResult pr = ServerAccess.executeProcess(javaws, null, null, l); assertNotEnglish(pr.stdout); assertNotCz(pr.stdout); assertNotPl(pr.stdout); iteratePropertiesForAproxDe(pr.stdout); } @Test public void testLocalesDeDeUtf() throws Exception { String[] l = getChangeLocalesForSubproces("de_DE.UTF-8"); ProcessResult pr = ServerAccess.executeProcess(javaws, null, null, l); assertNotEnglish(pr.stdout); assertNotCz(pr.stdout); assertDe(pr.stdout); assertNotPl(pr.stdout); iteratePropertiesForAproxDe(pr.stdout); } @Test public void testLocalesDe_unknowButValidDeLocale() throws Exception { String[] l = getChangeLocalesForSubproces("de_LU"); ProcessResult pr = ServerAccess.executeProcess(javaws, null, null, l); assertNotEnglish(pr.stdout); assertNotCz(pr.stdout); assertNotPl(pr.stdout); iteratePropertiesForAproxDe(pr.stdout); } @Test public void testLocalesDeUtf_unknowButValidDeLocale() throws Exception { String[] l = getChangeLocalesForSubproces("de_LU.UTF-8"); ProcessResult pr = ServerAccess.executeProcess(javaws, null, null, l); assertNotEnglish(pr.stdout); assertNotCz(pr.stdout); assertDe(pr.stdout); assertNotPl(pr.stdout); iteratePropertiesForAproxDe(pr.stdout); } @Test public void testLocalesDe_globalDe() throws Exception { String[] l = getChangeLocalesForSubproces("deutsch"); ProcessResult pr = ServerAccess.executeProcess(javaws, null, null, l); assertNotEnglish(pr.stdout); assertNotCz(pr.stdout); assertNotPl(pr.stdout); iteratePropertiesForAproxDe(pr.stdout); } @Test public void testLocalesInvalid() throws Exception { String[] l = getChangeLocalesForSubproces("ax_BU"); ProcessResult pr = ServerAccess.executeProcess(javaws, null, null, l); assertEnglish(pr.stdout); assertNotCz(pr.stdout); assertNotDe(pr.stdout); assertNotPl(pr.stdout); } private void assertEnglish(String s) throws IOException { ResourceBundle props = getPropertiesEn(); iteratePropertiesFor(props, s, true, "english"); } private void assertNotEnglish(String s) throws IOException { ResourceBundle props = getPropertiesEn(); iteratePropertiesFor(props, s, false, "english"); } private void assertCz(String s) throws IOException { ResourceBundle props = getPropertiesCz(); iteratePropertiesFor(props, s, true, "czech"); } private void assertPl(String s) throws IOException { ResourceBundle props = getPropertiesPl(); iteratePropertiesFor(props, s, true, "polish"); } private void assertDe(String s) throws IOException { ResourceBundle props = getPropertiesDe(); iteratePropertiesFor(props, s, true, "de"); } private void assertNotCz(String s) throws IOException { ResourceBundle props = getPropertiesCz(); iteratePropertiesFor(props, s, false, "czech"); } private void assertNotPl(String s) throws IOException { ResourceBundle props = getPropertiesPl(); iteratePropertiesFor(props, s, false, "polish"); } private void assertNotDe(String s) throws IOException { ResourceBundle props = getPropertiesDe(); iteratePropertiesFor(props, s, false, "de"); } /** * This method is iterating all keys defined in this class, geting their value in given * properties, and then checking if given output have/have not (depends on value of assertTrue) * this string contained. * * @param props * @param outputToExamine * @param assertTrue * @param languageId */ private void iteratePropertiesFor(ResourceBundle props, String outputToExamine, boolean assertTrue, String languageId) { int keysFound = 0; for (int i = 0; i < keys.length; i++) { String string = keys[i]; String value = props.getString(string); if (value == null) { continue; } keysFound++; if (assertTrue) { Assert.assertTrue("Output must contains " + languageId + " text, failed on " + string, outputToExamine.contains(value)); } else { Assert.assertFalse("Output must NOT contains " + languageId + " text, failed on " + string, outputToExamine.contains(value)); } } Assert.assertTrue("At least one key must be found, was not", keysFound > 0); } /** * This method is iterating all keys defined in this class, geting their value in given * properties, transforming this to asci-ionly regex and then checking if * given output match/matchnot (depends on value of assertTrue) this string, * * @param outputToBeChecked * @param props bundle with strings * @param reg regexter with rules how to handle national characters * @throws IOException */ private void iteratePropertiesForAprox(String outputToBeChecked, ResourceBundle props, Regexer reg) throws IOException { int keysFound = 0; for (int i = 0; i < keys.length; i++) { String string = keys[i]; String value = props.getString(string); if (value == null) { continue; } value = reg.regexIt(value); keysFound++; { Assert.assertTrue("Output must match "+reg.getId() +" text, failed on " + string, outputToBeChecked.matches(value)); } } Assert.assertTrue("At least one key must be found, was not", keysFound > 0); } private void iteratePropertiesForAproxCzCs(String stdout) throws IOException { iteratePropertiesForAprox(stdout, getPropertiesCz(), Regexer.cz); } private void iteratePropertiesForAproxDe(String stdout) throws IOException { iteratePropertiesForAprox(stdout, getPropertiesDe(), Regexer.de); } private void iteratePropertiesForAproxPl(String stdout) throws IOException { iteratePropertiesForAprox(stdout, getPropertiesPl(), Regexer.pl); } private static final class Regexer { private static final String[] czEvil = { "á", "č", "ď", "ě", "é", "í", "ň", "ó", "ř", "š", "ť", "ú", "ů", "ý", "ž", "[", "]", "(", ")"}; private static final String[] deEvil = { "ä", "ö", "ß", "ü", "[", "]", "(", ")"}; private static final String[] plEvil = { "ó", "ą", "ę", "ó", "ł", "ć", "ś", "ź", "ż", "ń", "[", "]", "(", ")"}; private static final Regexer cz = new Regexer(czEvil,"cz"); private static final Regexer de = new Regexer(deEvil,"de"); private static final Regexer pl = new Regexer(plEvil,"pl"); private final String[] map; private final String id; public Regexer(String[] map, String id) { this.map = map; this.id = id; } public String getId() { return id; } /** * This method transforms given string to asci-only regex, replacing * groups of national characters (defined by array variable) by .+ * * @param value * @return */ public String regexIt(String value) { for (int i = 0; i < map.length; i++) { String string = map[i]; value = value.replace(string, "."); value = value.replace(string.toUpperCase(), "."); } value = value.replaceAll("\\.+", ".+"); value = "(?s).*" + value + ".*"; return value; } } } icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/JnlpHrefAttribute0000644000000000000000000000013112654402377023753 xustar0030 mtime=1454507263.256432328 29 atime=1454507658.77815737 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JnlpHrefAttribute/0000755000175000002070000000000012654402377024554 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JnlpHrefAttribute/PaxHeaders.17941/testcases0000644000000000000000000000013112654402377025751 xustar0030 mtime=1454507263.256432328 29 atime=1454507658.77815737 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JnlpHrefAttribute/testcases/0000755000175000002070000000000012654402377026552 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JnlpHrefAttribute/testcases/PaxHeaders.17941/JnlpHrefAttr0000644000000000000000000000013212654402377030315 xustar0030 mtime=1454507263.256432328 30 atime=1454507327.323577883 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JnlpHrefAttribute/testcases/JnlpHrefAttributeTest.java0000644000175000002070000000617612654402377033663 0ustar00jvanekmock00000000000000/* Copyright (C) 2014 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 org.junit.Assert; import org.junit.Test; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.AutoErrorClosingListener; import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; public class JnlpHrefAttributeTest extends BrowserTest { @Test @TestInBrowsers(testIn = { Browsers.firefox, Browsers.opera}) @NeedsDisplay public void testJnlpHrefAttributeWorks() throws Exception { String url = "./JnlpHrefAttribute.html"; ProcessResult pr = server.executeBrowser(url, new AutoOkClosingListener(), new AutoOkClosingListener()); Assert.assertTrue("The stdout should contain " + AutoOkClosingListener.MAGICAL_OK_CLOSING_STRING + ", but it didnt.", pr.stdout.contains(AutoOkClosingListener.MAGICAL_OK_CLOSING_STRING)); } @Test @TestInBrowsers(testIn = { Browsers.midori, Browsers.epiphany}) @NeedsDisplay public void testJnlpHrefAttributeDoesNotWork() throws Exception { String url = "./JnlpHrefAttribute.html"; ProcessResult pr = server.executeBrowser(url, new AutoErrorClosingListener(), new AutoErrorClosingListener()); Assert.assertFalse("The stdout should not contain " + AutoOkClosingListener.MAGICAL_OK_CLOSING_STRING + ", but it did.", pr.stdout.contains(AutoOkClosingListener.MAGICAL_OK_CLOSING_STRING)); } } icedtea-web-1.6.2/tests/reproducers/simple/JnlpHrefAttribute/PaxHeaders.17941/srcs0000644000000000000000000000013112654402377024725 xustar0030 mtime=1454507263.256432328 29 atime=1454507658.77815737 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JnlpHrefAttribute/srcs/0000755000175000002070000000000012654402377025526 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JnlpHrefAttribute/srcs/PaxHeaders.17941/JnlpHrefAttribute0000644000000000000000000000013212654402377030322 xustar0030 mtime=1454507263.256432328 30 atime=1454507327.323577883 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JnlpHrefAttribute/srcs/JnlpHrefAttribute.java0000644000175000002070000000352712654402377031774 0ustar00jvanekmock00000000000000/* Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.lang.System; import java.applet.Applet; public class JnlpHrefAttribute extends Applet { private static final String initStr = "*** APPLET FINISHED ***"; @Override public void init() { System.out.println(initStr); } }icedtea-web-1.6.2/tests/reproducers/simple/JnlpHrefAttribute/PaxHeaders.17941/resources0000644000000000000000000000013112654402377025765 xustar0030 mtime=1454507263.256432328 29 atime=1454507658.77815737 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JnlpHrefAttribute/resources/0000755000175000002070000000000012654402377026566 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JnlpHrefAttribute/resources/PaxHeaders.17941/JnlpHrefAttr0000644000000000000000000000013212654402377030331 xustar0030 mtime=1454507263.256432328 30 atime=1454507327.323577883 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JnlpHrefAttribute/resources/JnlpHrefAttribute.jnlp0000644000175000002070000000402612654402377033051 0ustar00jvanekmock00000000000000 simple application IcedTea icedtea-web-1.6.2/tests/reproducers/simple/JnlpHrefAttribute/resources/PaxHeaders.17941/JnlpHrefAttr0000644000000000000000000000013212654402377030331 xustar0030 mtime=1454507263.256432328 30 atime=1454507327.322577896 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JnlpHrefAttribute/resources/JnlpHrefAttribute.html0000644000175000002070000000043012654402377033045 0ustar00jvanekmock00000000000000 icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/JavawsAWTRobotUsageSample0000644000000000000000000000013112654402377025323 xustar0030 mtime=1454507263.255432341 29 atime=1454507658.77815737 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavawsAWTRobotUsageSample/0000755000175000002070000000000012654402377026124 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JavawsAWTRobotUsageSample/PaxHeaders.17941/testcases0000644000000000000000000000013112654402377027321 xustar0030 mtime=1454507263.255432341 29 atime=1454507658.77815737 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavawsAWTRobotUsageSample/testcases/0000755000175000002070000000000012654402377030122 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JavawsAWTRobotUsageSample/testcases/PaxHeaders.17941/Java0000644000000000000000000000032512654402377030207 xustar00123 path=icedtea-web-1.6.2/tests/reproducers/simple/JavawsAWTRobotUsageSample/testcases/JavawsAWTRobotUsageSampleTest.java 30 mtime=1454507263.255432341 30 atime=1454507327.322577896 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavawsAWTRobotUsageSample/testcases/JavawsAWTRobotUsageSa0000644000175000002070000002301212654402377034131 0ustar00jvanekmock00000000000000/* JavawsAWTRobotUsageSampleTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.awt.Color; import java.awt.event.InputEvent; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import javax.imageio.ImageIO; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.awt.AWTFrameworkException; import net.sourceforge.jnlp.awt.AWTHelper; import net.sourceforge.jnlp.awt.imagesearch.ComponentNotFoundException; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.closinglisteners.Rule; import org.junit.Assert; import org.junit.Test; public class JavawsAWTRobotUsageSampleTest { public static final ServerAccess server = new ServerAccess(); private final String initStr = "JavawsAWTRobotUsageSample is ready for awt tests!"; private static final Color APPLET_COLOR = new Color(230, 230, 250); // lavender private static final Color BUTTON_COLOR1 = new Color(32, 178, 170); // light sea green private abstract class AWTHelperImpl extends AWTHelper{ public AWTHelperImpl() { super(initStr, 400, 400); this.setAppletColor(APPLET_COLOR); } } private class AWTHelperImpl_EnterExit extends AWTHelperImpl { @Override public void run() { // move mouse into the button area and out try { moveToMiddleOfColoredRectangle(BUTTON_COLOR1); moveOutsideColoredRectangle(BUTTON_COLOR1); } catch (ComponentNotFoundException e) { Assert.fail("Button not found: "+e.getMessage()); } catch (AWTFrameworkException e2){ Assert.fail("AWTFrameworkException: "+e2.getMessage()); } } } private class AWTHelperImpl_MouseClick1 extends AWTHelperImpl{ @Override public void run() { // click in the middle of the button try { clickOnColoredRectangle(BUTTON_COLOR1, InputEvent.BUTTON1_MASK); } catch (ComponentNotFoundException e) { Assert.fail("Button not found: "+e.getMessage()); } catch (AWTFrameworkException e2){ Assert.fail("AWTFrameworkException: "+e2.getMessage()); } } } private class AWTHelperImpl_MouseClick2 extends AWTHelperImpl{ @Override public void run() { // move mouse in the middle of the button and click 2nd // button try { clickOnColoredRectangle(BUTTON_COLOR1, InputEvent.BUTTON2_MASK); } catch (ComponentNotFoundException e) { Assert.fail("Button not found: "+e.getMessage()); } catch (AWTFrameworkException e2){ Assert.fail("AWTFrameworkException: "+e2.getMessage()); } } } private class AWTHelperImpl_MouseClick3 extends AWTHelperImpl{ @Override public void run() { // move mouse in the middle of the button and click 3rd // button try { clickOnColoredRectangle(BUTTON_COLOR1, InputEvent.BUTTON3_MASK); } catch (ComponentNotFoundException e) { Assert.fail("Button not found: "+e.getMessage()); } catch (AWTFrameworkException e2){ Assert.fail("AWTFrameworkException: "+e2.getMessage()); } } } private class AWTHelperImpl_MouseDrag extends AWTHelperImpl{ @Override public void run() { // move into the rectangle, press 1st button, drag out try { dragFromColoredRectangle(BUTTON_COLOR1); } catch (ComponentNotFoundException e) { Assert.fail("Button not found: "+e.getMessage()); } catch (AWTFrameworkException e2){ Assert.fail("AWTFrameworkException: "+e2.getMessage()); } } } private class AWTHelperImpl_MouseMove extends AWTHelperImpl{ @Override public void run() { clickInTheMiddleOfApplet(); try { moveInsideColoredRectangle(BUTTON_COLOR1); } catch (ComponentNotFoundException e) { Assert.fail("Button not found: "+e.getMessage()); } catch (AWTFrameworkException e2){ Assert.fail("AWTFrameworkException: "+e2.getMessage()); } } } private void evaluateStdoutContents(ProcessResult pr, AWTHelper helper) { // Assert that the applet was initialized. Rule i = helper.getInitStrAsRule(); Assert.assertTrue(i.toPassingString(), i.evaluate(initStr)); // Assert there are all the test messages from applet for (Rule r : helper.getRules() ) { Assert.assertTrue(r.toPassingString(), r.evaluate(pr.stdout)); } } private void appletAWTMouseTest(String url, AWTHelper helper) throws Exception { String strURL = "/" + url; try { ServerAccess.PROCESS_TIMEOUT = 40 * 1000;// ms ProcessResult pr = server.executeJavaws(strURL, helper, helper); evaluateStdoutContents(pr, helper); } finally { ServerAccess.PROCESS_TIMEOUT = 20 * 1000;// ms } } @Test @NeedsDisplay public void AppletAWTMouse_EnterAndExit_Test() throws Exception { // display the page, activate applet, move over the button AWTHelper helper = new AWTHelperImpl_EnterExit(); helper.addClosingRulesFromStringArray(new String[] { "mouseEntered", "mouseExited"}); appletAWTMouseTest("javaws-awtrobot-usage-sample.jnlp", helper); } @Test @NeedsDisplay public void AppletAWTMouse_ClickButton1_Test() throws Exception { // display the page, activate applet, click on button AWTHelper helper = new AWTHelperImpl_MouseClick1(); helper.addClosingRulesFromStringArray(new String[] { "mousePressedButton1", "mouseReleasedButton1", "mouseClickedButton1" }); appletAWTMouseTest("javaws-awtrobot-usage-sample.jnlp", helper); } @Test @NeedsDisplay public void AppletAWTMouse_ClickButton2_Test() throws Exception { // display the page, activate applet, click on button AWTHelper helper = new AWTHelperImpl_MouseClick2(); helper.addClosingRulesFromStringArray(new String[] { "mousePressedButton2", "mouseReleasedButton2", "mouseClickedButton2" }); appletAWTMouseTest("javaws-awtrobot-usage-sample.jnlp", helper); } @Test @NeedsDisplay public void AppletAWTMouse_ClickButton3_Test() throws Exception { // display the page, activate applet, click on button AWTHelper helper = new AWTHelperImpl_MouseClick3(); helper.addClosingRulesFromStringArray(new String[] { "mousePressedButton3", "mouseReleasedButton3", "mouseClickedButton3" }); appletAWTMouseTest("javaws-awtrobot-usage-sample.jnlp", helper); } @Test @NeedsDisplay public void AppletAWTMouse_Drag_Test() throws Exception { // display the page, activate applet, click on button AWTHelper helper = new AWTHelperImpl_MouseDrag(); helper.addClosingRulesFromStringArray(new String[] { "mouseDragged" }); appletAWTMouseTest("javaws-awtrobot-usage-sample.jnlp", helper); } @Test @NeedsDisplay public void AppletAWTMouse_Move_Test() throws Exception { // display the page, activate applet, click on button AWTHelper helper = new AWTHelperImpl_MouseMove(); helper.addClosingRulesFromStringArray(new String[] { "mouseMoved" }); appletAWTMouseTest("javaws-awtrobot-usage-sample.jnlp", helper); } } icedtea-web-1.6.2/tests/reproducers/simple/JavawsAWTRobotUsageSample/testcases/PaxHeaders.17941/Appl0000644000000000000000000000032512654402377030222 xustar00123 path=icedtea-web-1.6.2/tests/reproducers/simple/JavawsAWTRobotUsageSample/testcases/AppletAWTRobotUsageSampleTest.java 30 mtime=1454507263.255432341 30 atime=1454507327.322577896 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavawsAWTRobotUsageSample/testcases/AppletAWTRobotUsageSa0000644000175000002070000002325512654402377034134 0ustar00jvanekmock00000000000000/* AppletAWTRobotUsageSampleTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.awt.AWTException; import java.awt.Color; import java.awt.event.InputEvent; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import javax.imageio.ImageIO; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.awt.AWTFrameworkException; import net.sourceforge.jnlp.awt.AWTHelper; import net.sourceforge.jnlp.awt.imagesearch.ComponentNotFoundException; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.Rule; import org.junit.Assert; import org.junit.Test; public class AppletAWTRobotUsageSampleTest extends BrowserTest { private final String initStr = "JavawsAWTRobotUsageSample is ready for awt tests!"; private static final Color APPLET_COLOR = new Color(230, 230, 250); // lavender private static final Color BUTTON_COLOR1 = new Color(32, 178, 170); // light sea green private abstract class AWTHelperImpl extends AWTHelper{ public AWTHelperImpl() { super(initStr, 400, 400); this.setAppletColor(APPLET_COLOR); } } private class AWTHelperImpl_EnterExit extends AWTHelperImpl { @Override public void run() { // move mouse into the button area and out try { moveToMiddleOfColoredRectangle(BUTTON_COLOR1); moveOutsideColoredRectangle(BUTTON_COLOR1); } catch (ComponentNotFoundException e) { Assert.fail("Button not found: "+e.getMessage()); } catch (AWTFrameworkException e2){ Assert.fail("AWTFrameworkException: "+e2.getMessage()); } } } private class AWTHelperImpl_MouseClick1 extends AWTHelperImpl{ @Override public void run() { // click in the middle of the button try { clickOnColoredRectangle(BUTTON_COLOR1, InputEvent.BUTTON1_MASK); } catch (ComponentNotFoundException e) { Assert.fail("Button not found: "+e.getMessage()); } catch (AWTFrameworkException e2){ Assert.fail("AWTFrameworkException: "+e2.getMessage()); } } } private class AWTHelperImpl_MouseClick2 extends AWTHelperImpl{ @Override public void run() { // move mouse in the middle of the button and click 2nd // button try { clickOnColoredRectangle(BUTTON_COLOR1, InputEvent.BUTTON2_MASK); } catch (ComponentNotFoundException e) { Assert.fail("Button not found: "+e.getMessage()); } catch (AWTFrameworkException e2){ Assert.fail("AWTFrameworkException: "+e2.getMessage()); } } } private class AWTHelperImpl_MouseClick3 extends AWTHelperImpl{ @Override public void run() { // move mouse in the middle of the button and click 3rd // button try { clickOnColoredRectangle(BUTTON_COLOR1, InputEvent.BUTTON3_MASK); } catch (ComponentNotFoundException e) { Assert.fail("Button not found: "+e.getMessage()); } catch (AWTFrameworkException e2){ Assert.fail("AWTFrameworkException: "+e2.getMessage()); } } } private class AWTHelperImpl_MouseDrag extends AWTHelperImpl{ @Override public void run() { // move into the rectangle, press 1st button, drag out try { dragFromColoredRectangle(BUTTON_COLOR1); } catch (ComponentNotFoundException e) { Assert.fail("Button not found: "+e.getMessage()); } catch (AWTFrameworkException e2){ Assert.fail("AWTFrameworkException: "+e2.getMessage()); } } } private class AWTHelperImpl_MouseMove extends AWTHelperImpl{ @Override public void run() { clickInTheMiddleOfApplet(); try { moveInsideColoredRectangle(BUTTON_COLOR1); } catch (ComponentNotFoundException e) { Assert.fail("Button not found: "+e.getMessage()); } catch (AWTFrameworkException e2){ Assert.fail("AWTFrameworkException: "+e2.getMessage()); } } } private void evaluateStdoutContents(ProcessResult pr, AWTHelper helper) { // Assert that the applet was initialized. Rule i = helper.getInitStrAsRule(); Assert.assertTrue(i.toPassingString(), i.evaluate(initStr)); // Assert there are all the test messages from applet for (Rule r : helper.getRules() ) { Assert.assertTrue(r.toPassingString(), r.evaluate(pr.stdout)); } } private void appletAWTMouseTest(String url, AWTHelper helper) throws Exception { String strURL = "/" + url; ProcessResult pr = server.executeBrowser(strURL, helper, helper); evaluateStdoutContents(pr, helper); } @Test @TestInBrowsers(testIn = { Browsers.one }) @NeedsDisplay public void AppletAWTMouse_EnterAndExit_Test() throws Exception { // display the page, activate applet, move over the button AWTHelper helper = new AWTHelperImpl_EnterExit(); helper.addClosingRulesFromStringArray(new String[] { "mouseEntered", "mouseExited"}); appletAWTMouseTest("AppletAWTRobotUsageSample.html", helper); } @Test @TestInBrowsers(testIn = { Browsers.one }) @NeedsDisplay public void AppletAWTMouse_ClickButton1_Test() throws Exception { // display the page, activate applet, click on button AWTHelper helper = new AWTHelperImpl_MouseClick1(); helper.addClosingRulesFromStringArray(new String[] { "mousePressedButton1", "mouseReleasedButton1", "mouseClickedButton1" }); appletAWTMouseTest("AppletAWTRobotUsageSample.html", helper); } @Test @TestInBrowsers(testIn = { Browsers.one }) @NeedsDisplay public void AppletAWTMouse_ClickButton2_Test() throws Exception { // display the page, activate applet, click on button AWTHelper helper = new AWTHelperImpl_MouseClick2(); helper.addClosingRulesFromStringArray(new String[] { "mousePressedButton2", "mouseReleasedButton2", "mouseClickedButton2" }); appletAWTMouseTest("AppletAWTRobotUsageSample.html", helper); } @Test @TestInBrowsers(testIn = { Browsers.one }) @NeedsDisplay public void AppletAWTMouse_ClickButton3_Test() throws Exception { // display the page, activate applet, click on button AWTHelper helper = new AWTHelperImpl_MouseClick3(); helper.addClosingRulesFromStringArray(new String[] { "mousePressedButton3", "mouseReleasedButton3", "mouseClickedButton3" }); appletAWTMouseTest("AppletAWTRobotUsageSample.html", helper); } @Test @TestInBrowsers(testIn = { Browsers.one }) @NeedsDisplay public void AppletAWTMouse_Drag_Test() throws Exception { // display the page, activate applet, click on button AWTHelper helper = new AWTHelperImpl_MouseDrag(); helper.addClosingRulesFromStringArray(new String[] { "mouseDragged" }); appletAWTMouseTest("AppletAWTRobotUsageSample.html", helper); } @Test @TestInBrowsers(testIn = { Browsers.one }) @NeedsDisplay public void AppletAWTMouse_Move_Test() throws Exception { // display the page, activate applet, click on button AWTHelper helper = new AWTHelperImpl_MouseMove(); helper.addClosingRulesFromStringArray(new String[] { "mouseMoved" }); appletAWTMouseTest("AppletAWTRobotUsageSample.html", helper); } } icedtea-web-1.6.2/tests/reproducers/simple/JavawsAWTRobotUsageSample/PaxHeaders.17941/srcs0000644000000000000000000000013112654402377026275 xustar0030 mtime=1454507263.255432341 29 atime=1454507658.77815737 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavawsAWTRobotUsageSample/srcs/0000755000175000002070000000000012654402377027076 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JavawsAWTRobotUsageSample/srcs/PaxHeaders.17941/JavawsAWT0000644000000000000000000000031412654402377030107 xustar00114 path=icedtea-web-1.6.2/tests/reproducers/simple/JavawsAWTRobotUsageSample/srcs/JavawsAWTRobotUsageSample.java 30 mtime=1454507263.255432341 30 atime=1454507327.322577896 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavawsAWTRobotUsageSample/srcs/JavawsAWTRobotUsageSample.0000644000175000002070000001355412654402377034053 0ustar00jvanekmock00000000000000/* JavawsAWTRobotUsageSample.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.applet.Applet; import java.awt.Graphics; import java.awt.Color; import java.awt.Image; import java.awt.Panel; import java.awt.Button; import java.awt.Dimension; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; public class JavawsAWTRobotUsageSample extends Applet { private static final String initStr = "JavawsAWTRobotUsageSample is ready for awt tests!"; public static final String iconFile = "marker.png"; public static final Color APPLET_COLOR = new Color(230, 230, 250); // lavender public static final Color BUTTON_COLOR1 = new Color(32, 178, 170); // light sea green public Image img; public Panel panel; public void init(){ img = getImage(getCodeBase(), iconFile); createGUI(); writeAppletInitialized(); } //this method should be called by the extending applet //when the whole gui is ready public void writeAppletInitialized(){ System.out.println(initStr); } //paint the icon in upper left corner @Override public void paint(Graphics g){ int width = 32; int height = 32; int x = 0; int y = 0; g.drawImage(img, x, y, width, height, this); super.paint(g); } private Button createButton(String label, Color color) { Button b = new Button(label); b.setBackground(color); b.setPreferredSize(new Dimension(100, 50)); return b; } // sets background of the applet and adds the panel with one button private void createGUI() { setBackground(APPLET_COLOR); panel = new Panel(); panel.setBounds(33,33,267,267); Button b = createButton("", BUTTON_COLOR1); b.addMouseMotionListener(new MouseMotionListener() { public void mouseDragged(MouseEvent e) { System.out.println("mouseDragged"); } public void mouseMoved(MouseEvent e) { System.out.println("mouseMoved"); } }); b.addMouseListener(new MouseListener() { public void mouseClicked(MouseEvent e) { // figure out which mouse button is pressed switch (e.getButton()) { case MouseEvent.BUTTON1: System.out.println("mouseClickedButton1"); break; case MouseEvent.BUTTON2: System.out.println("mouseClickedButton2"); break; case MouseEvent.BUTTON3: System.out.println("mouseClickedButton3"); break; default: break; } } public void mouseEntered(MouseEvent e) { System.out.println("mouseEntered"); } public void mouseExited(MouseEvent e) { System.out.println("mouseExited"); } public void mousePressed(MouseEvent e) { // figure out which mouse button is pressed switch (e.getButton()) { case MouseEvent.BUTTON1: System.out.println("mousePressedButton1"); break; case MouseEvent.BUTTON2: System.out.println("mousePressedButton2"); break; case MouseEvent.BUTTON3: System.out.println("mousePressedButton3"); break; default: break; } } public void mouseReleased(MouseEvent e) { // figure out which mouse button was pressed switch (e.getButton()) { case MouseEvent.BUTTON1: System.out.println("mouseReleasedButton1"); break; case MouseEvent.BUTTON2: System.out.println("mouseReleasedButton2"); break; case MouseEvent.BUTTON3: System.out.println("mouseReleasedButton3"); break; default: break; } } }); panel.add(b); this.add(panel); } } icedtea-web-1.6.2/tests/reproducers/simple/JavawsAWTRobotUsageSample/PaxHeaders.17941/resources0000644000000000000000000000013112654402377027335 xustar0030 mtime=1454507263.254432354 29 atime=1454507658.77815737 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavawsAWTRobotUsageSample/resources/0000755000175000002070000000000012654402377030136 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JavawsAWTRobotUsageSample/resources/PaxHeaders.17941/java0000644000000000000000000000032412654402377030262 xustar00122 path=icedtea-web-1.6.2/tests/reproducers/simple/JavawsAWTRobotUsageSample/resources/javaws-awtrobot-usage-sample.jnlp 30 mtime=1454507263.254432354 30 atime=1454507327.322577896 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavawsAWTRobotUsageSample/resources/javaws-awtrobot-usage0000644000175000002070000000447212654402377034324 0ustar00jvanekmock00000000000000 AWTRobot usage sample IcedTea AWTRobot usage sample icedtea-web-1.6.2/tests/reproducers/simple/JavawsAWTRobotUsageSample/resources/PaxHeaders.17941/Appl0000644000000000000000000000032112654402377030232 xustar00119 path=icedtea-web-1.6.2/tests/reproducers/simple/JavawsAWTRobotUsageSample/resources/AppletAWTRobotUsageSample.html 30 mtime=1454507263.254432354 30 atime=1454507327.322577896 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavawsAWTRobotUsageSample/resources/AppletAWTRobotUsageSa0000644000175000002070000000464012654402377034145 0ustar00jvanekmock00000000000000 AWTRobot usage sample page with an applet










icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/JavawsAWTRobotFindsButton0000644000000000000000000000013112654402377025354 xustar0030 mtime=1454507263.253432368 29 atime=1454507658.77815737 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavawsAWTRobotFindsButton/0000755000175000002070000000000012654402377026155 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JavawsAWTRobotFindsButton/PaxHeaders.17941/testcases0000644000000000000000000000013112654402377027352 xustar0030 mtime=1454507263.254432354 29 atime=1454507658.77815737 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavawsAWTRobotFindsButton/testcases/0000755000175000002070000000000012654402377030153 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JavawsAWTRobotFindsButton/testcases/PaxHeaders.17941/butt0000644000000000000000000000013112654402377030330 xustar0030 mtime=1454507263.254432354 29 atime=1454507327.32157791 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavawsAWTRobotFindsButton/testcases/buttonA.png0000644000175000002070000000070412654402377032276 0ustar00jvanekmock00000000000000PNG  IHDRj9QY) pHYs  tIME5/ ~cIDATx108?a~73M7ݣ"hNbmJ_Zv`*(@IOEAHt6lqBJxuRMjI}wѮ]@}1 =q%? ^ۘG4˜~LBjRuxVi>;rQ]٤Ntfؔmsؤ٤UJ㦍{^}>}>}>o=D6OgLw^ܯ`_1OL[&?MAIENDB`icedtea-web-1.6.2/tests/reproducers/simple/JavawsAWTRobotFindsButton/testcases/PaxHeaders.17941/Java0000644000000000000000000000032412654402377030237 xustar00123 path=icedtea-web-1.6.2/tests/reproducers/simple/JavawsAWTRobotFindsButton/testcases/JavawsAWTRobotFindsButtonTest.java 30 mtime=1454507263.253432368 29 atime=1454507327.32157791 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavawsAWTRobotFindsButton/testcases/JavawsAWTRobotFindsBu0000644000175000002070000001171212654402377034170 0ustar00jvanekmock00000000000000/* JavawsAWTRobotFindsButtonTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.awt.Color; import java.awt.event.InputEvent; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import javax.imageio.ImageIO; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.awt.AWTFrameworkException; import net.sourceforge.jnlp.awt.AWTHelper; import net.sourceforge.jnlp.awt.imagesearch.ComponentFinder; import net.sourceforge.jnlp.awt.imagesearch.ComponentNotFoundException; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.closinglisteners.Rule; import org.junit.Assert; import org.junit.Test; public class JavawsAWTRobotFindsButtonTest { public static final ServerAccess server = new ServerAccess(); private final String initStr = "JavawsAWTRobotFindsButton is ready for awt tests!"; private static final Color APPLET_COLOR = new Color(230, 230, 250); // lavender private static final Color BUTTON_COLOR1 = new Color(32, 178, 170); // light sea green private static final BufferedImage buttonIcon; static{ try { buttonIcon = ImageIO.read(ClassLoader.getSystemClassLoader().getResource("buttonA.png")); } catch (IOException e) { throw new RuntimeException("Problem initializing buttonIcon",e); } } private class AWTHelperImpl_ClickButtonIcon extends AWTHelper{ public AWTHelperImpl_ClickButtonIcon() { super(initStr, 400, 400); this.setAppletColor(APPLET_COLOR); } @Override public void run() { // move mouse into the button area and out try { clickOnIconExact(buttonIcon, InputEvent.BUTTON1_MASK); } catch (ComponentNotFoundException e) { Assert.fail("Button icon not found: "+e.getMessage()); } } } private void evaluateStdoutContents(ProcessResult pr, AWTHelper helper) { // Assert that the applet was initialized. Rule i = helper.getInitStrAsRule(); Assert.assertTrue(i.toPassingString(), i.evaluate(initStr)); // Assert there are all the test messages from applet for (Rule r : helper.getRules() ) { Assert.assertTrue(r.toPassingString(), r.evaluate(pr.stdout)); } } private void appletAWTMouseTest(String url, AWTHelper helper) throws Exception { String strURL = "/" + url; try { ServerAccess.PROCESS_TIMEOUT = 40 * 1000;// ms ProcessResult pr = server.executeJavaws(strURL, helper, helper); evaluateStdoutContents(pr, helper); } finally { ServerAccess.PROCESS_TIMEOUT = 20 * 1000;// ms } } @Test @NeedsDisplay public void findAndClickButtonByIcon_Test() throws Exception { // display the page, activate applet, click on button AWTHelper helper = new AWTHelperImpl_ClickButtonIcon(); helper.addClosingRulesFromStringArray(new String[] { "Mouse clicked button A." }); appletAWTMouseTest("javaws-awtrobot-finds-button.jnlp", helper); } @Test public void iconFileLoaded_Test() throws IOException { Assert.assertNotNull("buttonIcon should not be null", buttonIcon); } } icedtea-web-1.6.2/tests/reproducers/simple/JavawsAWTRobotFindsButton/PaxHeaders.17941/srcs0000644000000000000000000000013112654402377026326 xustar0030 mtime=1454507263.253432368 29 atime=1454507658.77815737 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavawsAWTRobotFindsButton/srcs/0000755000175000002070000000000012654402377027127 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JavawsAWTRobotFindsButton/srcs/PaxHeaders.17941/JavawsAWT0000644000000000000000000000031312654402377030137 xustar00114 path=icedtea-web-1.6.2/tests/reproducers/simple/JavawsAWTRobotFindsButton/srcs/JavawsAWTRobotFindsButton.java 30 mtime=1454507263.253432368 29 atime=1454507327.32157791 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavawsAWTRobotFindsButton/srcs/JavawsAWTRobotFindsButton.0000644000175000002070000001131212654402377034123 0ustar00jvanekmock00000000000000/* JavawsAWTRobotFindsButton.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.applet.Applet; import java.awt.Graphics; import java.awt.Color; import java.awt.Image; import java.awt.Panel; import java.awt.Button; import java.awt.Dimension; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; public class JavawsAWTRobotFindsButton extends Applet { private static final String initStr = "JavawsAWTRobotFindsButton is ready for awt tests!"; public static final String iconFile = "marker.png"; public static final Color APPLET_COLOR = new Color(230, 230, 250); // lavender public static final Color BUTTON_COLOR1 = new Color(32, 178, 170); // light sea green public Image img; public Panel panel; public void init(){ img = getImage(getCodeBase(), iconFile); createGUI(); writeAppletInitialized(); } //this method should be called by the extending applet //when the whole gui is ready public void writeAppletInitialized(){ System.out.println(initStr); } //paint the icon in upper left corner @Override public void paint(Graphics g){ int width = 32; int height = 32; int x = 0; int y = 0; g.drawImage(img, x, y, width, height, this); super.paint(g); } private Button createButton(String label, Color color) { Button b = new Button(label); b.setBackground(color); b.setPreferredSize(new Dimension(100, 50)); return b; } // sets background of the applet // and adds the panel with 2 buttons private void createGUI() { setBackground(APPLET_COLOR); panel = new Panel(); panel.setBounds(33,33,267,267); Button bA = createButton("Button A", BUTTON_COLOR1); bA.addMouseListener(new MouseListener() { public void mouseClicked(MouseEvent e) { System.out.println("Mouse clicked button A."); } @Override public void mouseEntered(MouseEvent arg0) { } @Override public void mouseExited(MouseEvent arg0) { } @Override public void mousePressed(MouseEvent arg0) { } @Override public void mouseReleased(MouseEvent arg0) { } }); panel.add(bA); Button bB = createButton("Button B", BUTTON_COLOR1); bB.addMouseListener(new MouseListener() { public void mouseClicked(MouseEvent e) { System.out.println("Mouse clicked button B."); } @Override public void mouseEntered(MouseEvent e) { } @Override public void mouseExited(MouseEvent e) { } @Override public void mousePressed(MouseEvent e) { } @Override public void mouseReleased(MouseEvent e) { } }); panel.add(bB); this.add(panel); } } icedtea-web-1.6.2/tests/reproducers/simple/JavawsAWTRobotFindsButton/PaxHeaders.17941/resources0000644000000000000000000000013112654402377027366 xustar0030 mtime=1454507263.253432368 29 atime=1454507658.77815737 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavawsAWTRobotFindsButton/resources/0000755000175000002070000000000012654402377030167 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JavawsAWTRobotFindsButton/resources/PaxHeaders.17941/java0000644000000000000000000000032312654402377030312 xustar00122 path=icedtea-web-1.6.2/tests/reproducers/simple/JavawsAWTRobotFindsButton/resources/javaws-awtrobot-finds-button.jnlp 30 mtime=1454507263.253432368 29 atime=1454507327.32157791 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavawsAWTRobotFindsButton/resources/javaws-awtrobot-finds0000644000175000002070000000447212654402377034354 0ustar00jvanekmock00000000000000 AWTRobot usage sample IcedTea AWTRobot usage sample icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/JavascriptURLProtocol0000644000000000000000000000013112654402377024572 xustar0030 mtime=1454507263.252432381 29 atime=1454507658.77815737 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavascriptURLProtocol/0000755000175000002070000000000012654402377025373 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JavascriptURLProtocol/PaxHeaders.17941/testcases0000644000000000000000000000013112654402377026570 xustar0030 mtime=1454507263.252432381 29 atime=1454507658.77815737 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavascriptURLProtocol/testcases/0000755000175000002070000000000012654402377027371 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JavascriptURLProtocol/testcases/PaxHeaders.17941/Javascri0000644000000000000000000000031112654402377030332 xustar00112 path=icedtea-web-1.6.2/tests/reproducers/simple/JavascriptURLProtocol/testcases/JavascriptProtocolTest.java 30 mtime=1454507263.252432381 29 atime=1454507327.32157791 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavascriptURLProtocol/testcases/JavascriptProtocolTest.ja0000644000175000002070000000637512654402377034410 0ustar00jvanekmock00000000000000/* Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess.AutoClose; import net.sourceforge.jnlp.annotations.Bug; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; import org.junit.Test; public class JavascriptProtocolTest extends BrowserTest { private static final String END_STRING = AutoOkClosingListener.MAGICAL_OK_CLOSING_STRING; private static void assertContains(String source, String message, String substring) { assertTrue(source + " should contain '" + substring + "' but did not!", message.contains(substring)); } private static void assertNotContains(String source, String message, String substring) { assertFalse(source + " should not contain '" + substring + "' but did!", message.contains(substring)); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay @Bug(id = { "PR1271" }) public void testJavascriptProtocolFollowed() throws Exception { ProcessResult pr = server.executeBrowser("/JavascriptProtocol.html", AutoClose.CLOSE_ON_BOTH); assertNotContains("stdout", pr.stdout, "HasntRun"); assertContains("stdout", pr.stdout, "Javascript URL string was evaluated."); assertContains("stdout", pr.stdout, "HasRun"); assertContains("stdout", pr.stdout, END_STRING); } } icedtea-web-1.6.2/tests/reproducers/simple/JavascriptURLProtocol/PaxHeaders.17941/srcs0000644000000000000000000000013112654402377025544 xustar0030 mtime=1454507263.252432381 29 atime=1454507658.77815737 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavascriptURLProtocol/srcs/0000755000175000002070000000000012654402377026345 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JavascriptURLProtocol/srcs/PaxHeaders.17941/JavascriptPro0000644000000000000000000000013212654402377030334 xustar0030 mtime=1454507263.252432381 30 atime=1454507327.320577923 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavascriptURLProtocol/srcs/JavascriptProtocol.java0000644000175000002070000000115112654402377033036 0ustar00jvanekmock00000000000000import java.applet.Applet; import java.net.URL; import netscape.javascript.JSObject; public class JavascriptProtocol extends Applet { public String state = "HasntRun"; @Override public void start() { try { getAppletContext().showDocument(new URL("javascript:runSomeJS()")); System.out.println("State after showDocument was " + state); } catch (Exception e) { e.printStackTrace(); } System.out.println("*** APPLET FINISHED ***"); } // Utility for JS side public void print(String s) { System.out.println(s); } } icedtea-web-1.6.2/tests/reproducers/simple/JavascriptURLProtocol/PaxHeaders.17941/resources0000644000000000000000000000013112654402377026604 xustar0030 mtime=1454507263.252432381 29 atime=1454507658.77815737 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavascriptURLProtocol/resources/0000755000175000002070000000000012654402377027405 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JavascriptURLProtocol/resources/PaxHeaders.17941/Javascri0000644000000000000000000000013212654402377030347 xustar0030 mtime=1454507263.252432381 30 atime=1454507327.320577923 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavascriptURLProtocol/resources/JavascriptProtocol.js0000644000175000002070000000016012654402377033570 0ustar00jvanekmock00000000000000function runSomeJS() { applet.print("Javascript URL string was evaluated.") applet.state = "HasRun"; } icedtea-web-1.6.2/tests/reproducers/simple/JavascriptURLProtocol/resources/PaxHeaders.17941/Javascri0000644000000000000000000000013212654402377030347 xustar0030 mtime=1454507263.252432381 30 atime=1454507327.320577923 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavascriptURLProtocol/resources/JavascriptProtocol.html0000644000175000002070000000351512654402377034127 0ustar00jvanekmock00000000000000 icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/JavascriptSet0000644000000000000000000000013112654402377023141 xustar0030 mtime=1454507263.251432394 29 atime=1454507658.77815737 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavascriptSet/0000755000175000002070000000000012654402377023742 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JavascriptSet/PaxHeaders.17941/testcases0000644000000000000000000000013112654402377025137 xustar0030 mtime=1454507263.251432394 29 atime=1454507658.77815737 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavascriptSet/testcases/0000755000175000002070000000000012654402377025740 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JavascriptSet/testcases/PaxHeaders.17941/JavascriptSetTes0000644000000000000000000000013212654402377030376 xustar0030 mtime=1454507263.251432394 30 atime=1454507327.320577923 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavascriptSet/testcases/JavascriptSetTest.java0000644000175000002070000001744012654402377032233 0ustar00jvanekmock00000000000000/* JToJSSetTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.CountingClosingListener; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import org.junit.Assert; import org.junit.Test; public class JavascriptSetTest extends BrowserTest { public final boolean doNotRunInOpera = false; private final String initStr = "JToJSSet applet initialized."; private final String afterStr = "afterTests"; private class CountingClosingListenerImpl extends CountingClosingListener { @Override protected boolean isAlowedToFinish(String s) { return (s.contains(initStr) && s.contains(afterStr)); } } private void evaluateStdoutContents(String[] expectedStdoutsOR, ProcessResult pr) { // Assert that the applet was initialized. Assert.assertTrue("JToJSSetTest stdout should contain " + initStr + " but it didnt.", pr.stdout.contains(initStr)); // Assert that the values set from JavaScript are ok boolean atLeastOne = false; for (String s : expectedStdoutsOR) { if (pr.stdout.contains(s)) { atLeastOne = true; } } Assert.assertTrue("JToJSSet: the output should include at least one of expected Stdouts, but it didnt.", atLeastOne); } private void javaToJSSetTest(String urlEnd, String[] expectedValsOR) throws Exception { if (doNotRunInOpera) { Browsers b = server.getCurrentBrowser().getID(); if (b == Browsers.opera) { return; } } String strURL = "/JavascriptSet.html?" + urlEnd; ProcessResult pr = server.executeBrowser(strURL, new CountingClosingListenerImpl(), new CountingClosingListenerImpl()); evaluateStdoutContents(expectedValsOR, pr); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSSet_int_Test() throws Exception { javaToJSSetTest("jjsSetInt", new String[] { "1" }); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSSet_Integer_Test() throws Exception { javaToJSSetTest("jjsSetInteger", new String[] { "2" }); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSSet_double_Test() throws Exception { javaToJSSetTest("jjsSetdouble", new String[] { "2.5" }); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSSet_Double_Test() throws Exception { javaToJSSetTest("jjsSetDouble", new String[] { "2.5" }); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSSet_float_Test() throws Exception { javaToJSSetTest("jjsSetfloat", new String[] { "2.5" }); // 2.3->2.2999... } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSSet_Float_Test() throws Exception { javaToJSSetTest("jjsSetFloat", new String[] { "2.5" }); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSSet_long_Test() throws Exception { javaToJSSetTest("jjsSetlong", new String[] { "4294967296" }); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSSet_Long_Test() throws Exception { javaToJSSetTest("jjsSetLong", new String[] { "4294967297" }); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSSet_short_Test() throws Exception { javaToJSSetTest("jjsSetshort", new String[] { "3" }); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSSet_Short_Test() throws Exception { javaToJSSetTest("jjsSetShort", new String[] { "4" }); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSSet_byte_Test() throws Exception { javaToJSSetTest("jjsSetbyte", new String[] { "5" }); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSSet_Byte_Test() throws Exception { javaToJSSetTest("jjsSetByte", new String[] { "6" }); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSSet_char_Test() throws Exception { javaToJSSetTest("jjsSetchar", new String[] { "97" }); // i.e. 'a' } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSSet_Character_Test() throws Exception { javaToJSSetTest("jjsSetCharacter", new String[] { "97" }); // i.e. 'a' } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSSet_boolean_Test() throws Exception { javaToJSSetTest("jjsSetboolean", new String[] { "true" }); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSSet_Boolean_Test() throws Exception { javaToJSSetTest("jjsSetBoolean", new String[] { "true" }); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSSet_String_Test() throws Exception { javaToJSSetTest("jjsSetString", new String[] { "𠁎〒£$ǣ€𝍖" }); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSSet_object_Test() throws Exception { javaToJSSetTest("jjsSetObject", new String[] { "DummyObject2" }); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSSet_1DArrayElement_Test() throws Exception { javaToJSSetTest("jjsSet1DArray", new String[] { "100" }); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSSet_2DArrayElement_Test() throws Exception { javaToJSSetTest("jjsSet2DArray", new String[] { "200" }); } } icedtea-web-1.6.2/tests/reproducers/simple/JavascriptSet/PaxHeaders.17941/srcs0000644000000000000000000000013112654402377024113 xustar0030 mtime=1454507263.251432394 29 atime=1454507658.77815737 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavascriptSet/srcs/0000755000175000002070000000000012654402377024714 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JavascriptSet/srcs/PaxHeaders.17941/JavascriptSet.java0000644000000000000000000000013212654402377027616 xustar0030 mtime=1454507263.251432394 30 atime=1454507327.320577923 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavascriptSet/srcs/JavascriptSet.java0000644000175000002070000000614612654402377030350 0ustar00jvanekmock00000000000000import java.applet.Applet; import netscape.javascript.JSObject; public class JavascriptSet extends Applet { private JSObject window; public void init() { window = JSObject.getWindow(this); String initStr = "JToJSSet applet initialized."; System.out.println(initStr); } // methods for testing setting of JavaScript variables public void jjsSetInt() { setWindowMember((int) 1); } public void jjsSetInteger() { setWindowMember(new Integer(2)); } public void jjsSetdouble() { setWindowMember((double) 2.5); } public void jjsSetDouble() { setWindowMember(new Double(2.5)); } public void jjsSetfloat() { setWindowMember((float) 2.5); } public void jjsSetFloat() { setWindowMember(new Float(2.5)); } public void jjsSetshort() { setWindowMember((short) 3); } public void jjsSetShort() { setWindowMember(new Short((short) 4)); } public void jjsSetlong() { setWindowMember((long) 4294967296L); } public void jjsSetLong() { setWindowMember(new Long(4294967297L)); } public void jjsSetbyte() { setWindowMember((byte) 5); } public void jjsSetByte() { setWindowMember(new Byte((byte) 6)); } public void jjsSetchar() { setWindowMember((char) 'a'); } public void jjsSetCharacter() { setWindowMember(new Character('a')); } public void jjsSetboolean() { setWindowMember((boolean) true); } public void jjsSetBoolean() { setWindowMember(new Boolean(true)); } public void jjsSetString() { setWindowMember("𠁎〒£$ǣ€𝍖"); } public void jjsSetObject() { DummyObject dummyObject = new DummyObject("DummyObject2"); setWindowMember(dummyObject); } public void jjsSet1DArray() { if (window == null) { window = JSObject.getWindow(this); System.out.println("Null window"); } ((JSObject) window.getMember("setvar")).setSlot(1, 100); } public void jjsSet2DArray() { if (window == null) { window = JSObject.getWindow(this); System.out.println("Null window"); } ((JSObject) ((JSObject) window.getMember("setvar")).getSlot(1)).setSlot(1, 200); } public void jjsSetJSObject() { setWindowMember(window); } public void setWindowMember(Object value) { if (window == null) { window = JSObject.getWindow(this); System.out.println("Null window"); } window.setMember("setvar", value); } // auxiliary class and method for writing output: public void printStrAndFinish(String str) { System.out.println(str); System.out.println("afterTests"); } public class DummyObject { private String str; public DummyObject(String s) { this.str = s; } public void setStr(String s) { this.str = s; } public String toString() { return str; } } } icedtea-web-1.6.2/tests/reproducers/simple/JavascriptSet/PaxHeaders.17941/resources0000644000000000000000000000013112654402377025153 xustar0030 mtime=1454507263.251432394 29 atime=1454507658.77815737 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavascriptSet/resources/0000755000175000002070000000000012654402377025754 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JavascriptSet/resources/PaxHeaders.17941/javascript-set.j0000644000000000000000000000013212654402377030343 xustar0030 mtime=1454507263.251432394 30 atime=1454507327.320577923 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavascriptSet/resources/javascript-set.jnlp0000644000175000002070000000132312654402377031577 0ustar00jvanekmock00000000000000 Java to JavaScript LiveConnect - Set IcedTea LiveConnect - tests for setting JS values from Java. icedtea-web-1.6.2/tests/reproducers/simple/JavascriptSet/resources/PaxHeaders.17941/Javascript_Set.j0000644000000000000000000000013212654402377030325 xustar0030 mtime=1454507263.250432408 30 atime=1454507327.320577923 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavascriptSet/resources/Javascript_Set.js0000644000175000002070000000142012654402377031230 0ustar00jvanekmock00000000000000var setvar; function doJToJSSetTests() { var urlArgs = document.URL.split("?"); var func = urlArgs[1]; // pre-initialization of arrays if (func === "jjsSet1DArray") { setvar = new Array(); } else if (func === "jjsSet2DArray") { setvar = new Array(); setvar[1] = new Array(); } // calling the applet function eval('applet.' + func + '()'); // preparing jsvar value string for output if (func === "jjsSet1DArray") { str = "" + setvar[1]; } else if (func === "jjsSet2DArray") { str = "" + setvar[1][1]; } else if (func === "jjsSetObject") { str = setvar.toString(); } else { var str = "" + setvar; } applet.printStrAndFinish(str); } doTest(doJToJSSetTests, applet);icedtea-web-1.6.2/tests/reproducers/simple/JavascriptSet/resources/PaxHeaders.17941/JavascriptSet.ht0000644000000000000000000000013212654402377030350 xustar0030 mtime=1454507263.250432408 30 atime=1454507327.320577923 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavascriptSet/resources/JavascriptSet.html0000644000175000002070000000110412654402377031420 0ustar00jvanekmock00000000000000 Java JavaScript LiveConnect - Set values from applet

The JToJSSet html page

icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/JavascriptGet0000644000000000000000000000013112654402377023125 xustar0030 mtime=1454507263.250432408 29 atime=1454507658.77815737 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavascriptGet/0000755000175000002070000000000012654402377023726 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JavascriptGet/PaxHeaders.17941/testcases0000644000000000000000000000013112654402377025123 xustar0030 mtime=1454507263.250432408 29 atime=1454507658.77815737 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavascriptGet/testcases/0000755000175000002070000000000012654402377025724 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JavascriptGet/testcases/PaxHeaders.17941/JavascriptGetTes0000644000000000000000000000013212654402377030346 xustar0030 mtime=1454507263.250432408 30 atime=1454507327.319577936 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavascriptGet/testcases/JavascriptGetTest.java0000644000175000002070000001241012654402377032173 0ustar00jvanekmock00000000000000/* JToJSGetTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.CountingClosingListener; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.annotations.KnownToFail; import org.junit.Assert; import org.junit.Test; public class JavascriptGetTest extends BrowserTest { public final boolean doNotRunInOpera = false; private final String initStr = "JToJSGet applet initialized."; private final String afterStr = "afterTests"; private class CountingClosingListenerImpl extends CountingClosingListener { @Override protected boolean isAlowedToFinish(String s) { return (s.contains(initStr) && s.contains(afterStr)); } } private void evaluateStdoutContents(String expectedStdout, ProcessResult pr) { // Assert that the applet was initialized. Assert.assertTrue("JToJSGetTest stdout should contain " + initStr + " but it didnt.", pr.stdout.contains(initStr)); // Assert that the values get from JavaScript are ok Assert.assertTrue("JToJSGet: the output should include: "+expectedStdout+", but it didnt.", pr.stdout.contains(expectedStdout)); } private void javaToJSGetTest(String funcStr, String paramStr, String expectedVal) throws Exception { if( doNotRunInOpera){ Browsers b = server.getCurrentBrowser().getID(); if(b == Browsers.opera){ return; } } String strURL = "/JavascriptGet.html?" + funcStr + ";" + paramStr; ProcessResult pr = server.executeBrowser(strURL, new CountingClosingListenerImpl(), new CountingClosingListenerImpl()); evaluateStdoutContents(expectedVal, pr); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSGet_double_Test() throws Exception { javaToJSGetTest("jjsReadDouble", "1.1", "1.1"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSGet_boolean_Test() throws Exception { javaToJSGetTest("jjsReadBoolean", "true", "true"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSGet_string_Test() throws Exception { javaToJSGetTest("jjsReadString", "\"teststring\"", "teststring"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSGet_object_Test() throws Exception { javaToJSGetTest("jjsReadObject", "applet.getNewDummyObject(\"dummy1\")", "dummy1"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay @KnownToFail(failsIn={Browsers.midori, Browsers.epiphany, Browsers.googleChrome, Browsers.chromiumBrowser}) public void AppletJToJSGet_1DArray_Test() throws Exception { javaToJSGetTest("jjsRead1DArray", "[1,2,3]", "[1, 2, 3]"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay @KnownToFail(failsIn={Browsers.midori, Browsers.epiphany, Browsers.googleChrome, Browsers.chromiumBrowser}) public void AppletJToJSGet_2DArray_Test() throws Exception { javaToJSGetTest("jjsRead2DArray", "[[1,2],[3,4]]","[[1, 2], [3, 4]]"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSGet_JSObject_Test() throws Exception { javaToJSGetTest("jjsReadJSObject", "window","Window]");//[object Window], [object DOMWindow] } } icedtea-web-1.6.2/tests/reproducers/simple/JavascriptGet/PaxHeaders.17941/srcs0000644000000000000000000000013112654402377024077 xustar0030 mtime=1454507263.249432421 29 atime=1454507658.77815737 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavascriptGet/srcs/0000755000175000002070000000000012654402377024700 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JavascriptGet/srcs/PaxHeaders.17941/JavascriptGet.java0000644000000000000000000000013212654402377027566 xustar0030 mtime=1454507263.249432421 30 atime=1454507327.319577936 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavascriptGet/srcs/JavascriptGet.java0000644000175000002070000000645312654402377030321 0ustar00jvanekmock00000000000000import java.applet.Applet; import java.util.Arrays; import netscape.javascript.JSObject; public class JavascriptGet extends Applet { public DummyObject dummyObject = new DummyObject("DummyObject1"); public Object value; private JSObject window; private final String jsvar = "jsvar"; public void init() { window = JSObject.getWindow(this); String initStr = "JToJSGet applet initialized."; System.out.println(initStr); } // methods for testing read from JavaScript variables public void jjsReadInt() { if (window == null) { window = JSObject.getWindow(this); System.out.println("Null window"); } // value = new Integer(window.getMember(jsvar).toString()); int num = ((Number) window.getMember(jsvar)).intValue(); System.out.println(value); } public void jjsReadDouble() { if (window == null) { window = JSObject.getWindow(this); System.out.println("Null window"); } value = new Double(window.getMember(jsvar).toString()); System.out.println(value); } public void jjsReadBoolean() { if (window == null) { window = JSObject.getWindow(this); System.out.println("Null window"); } value = new Boolean(window.getMember(jsvar).toString()); System.out.println(value); } public void jjsReadString() { if (window == null) { window = JSObject.getWindow(this); System.out.println("Null window"); } value = window.getMember(jsvar).toString(); System.out.println(value); } public void jjsReadObject() { if (window == null) { window = JSObject.getWindow(this); System.out.println("Null window"); } value = window.getMember(jsvar).toString(); System.out.println(value); } public void jjsRead1DArray() { if (window == null) { window = JSObject.getWindow(this); System.out.println("Null window"); } Object[] arrayvalue = (Object[]) window.getMember(jsvar); System.out.println(Arrays.toString(arrayvalue)); } public void jjsRead2DArray() { if (window == null) { window = JSObject.getWindow(this); System.out.println("Null window"); } Object[][] arrayvalue = (Object[][]) window.getMember(jsvar); System.out.println(Arrays.deepToString(arrayvalue)); } public void jjsReadJSObject() { if (window == null) { window = JSObject.getWindow(this); System.out.println("Null window"); } JSObject jsobjectvalue = (JSObject) window.getMember(jsvar); System.out.println(jsobjectvalue); } // auxiliary class DummyObject public class DummyObject { private String str; public DummyObject(String s) { this.str = s; } public void setStr(String s) { this.str = s; } public String toString() { return str; } } // auxiliary methods: public DummyObject getNewDummyObject(String s) { return new DummyObject(s); } public void writeAfterTests() { System.out.println("afterTests"); } } icedtea-web-1.6.2/tests/reproducers/simple/JavascriptGet/PaxHeaders.17941/resources0000644000000000000000000000013112654402377025137 xustar0030 mtime=1454507263.249432421 29 atime=1454507658.77815737 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavascriptGet/resources/0000755000175000002070000000000012654402377025740 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JavascriptGet/resources/PaxHeaders.17941/javascript-get.j0000644000000000000000000000013212654402377030313 xustar0030 mtime=1454507263.249432421 30 atime=1454507327.319577936 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavascriptGet/resources/javascript-get.jnlp0000644000175000002070000000133312654402377031550 0ustar00jvanekmock00000000000000 Java to JavaScript LiveConnect - Get IcedTea LiveConnect - tests for reading JavaScript values from Java. icedtea-web-1.6.2/tests/reproducers/simple/JavascriptGet/resources/PaxHeaders.17941/Javascript_Get.j0000644000000000000000000000013212654402377030275 xustar0030 mtime=1454507263.249432421 30 atime=1454507327.319577936 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavascriptGet/resources/Javascript_Get.js0000644000175000002070000000052312654402377031203 0ustar00jvanekmock00000000000000function doJToJSGetTests() { var urlArgs = document.URL.split("?"); var testParams = urlArgs[1].split(";"); var func = testParams[0]; var value = decodeURIComponent(testParams[1]); eval('jsvar=' + value); eval('applet.' + func + '()'); applet.writeAfterTests(); } var jsvar; doTest(doJToJSGetTests, applet);icedtea-web-1.6.2/tests/reproducers/simple/JavascriptGet/resources/PaxHeaders.17941/JavascriptGet.ht0000644000000000000000000000013212654402377030320 xustar0030 mtime=1454507263.249432421 30 atime=1454507327.319577936 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavascriptGet/resources/JavascriptGet.html0000644000175000002070000000111712654402377031374 0ustar00jvanekmock00000000000000 Java JavaScript LiveConnect - Get values from applet

The JToJSGet html page

icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/JavascriptFuncReturn0000644000000000000000000000013112654402377024501 xustar0030 mtime=1454507263.248432434 29 atime=1454507658.77815737 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavascriptFuncReturn/0000755000175000002070000000000012654402377025302 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JavascriptFuncReturn/PaxHeaders.17941/testcases0000644000000000000000000000013112654402377026477 xustar0030 mtime=1454507263.248432434 29 atime=1454507658.77815737 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavascriptFuncReturn/testcases/0000755000175000002070000000000012654402377027300 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JavascriptFuncReturn/testcases/PaxHeaders.17941/Javascrip0000644000000000000000000000031312654402377030423 xustar00113 path=icedtea-web-1.6.2/tests/reproducers/simple/JavascriptFuncReturn/testcases/JavascriptFuncReturnTest.java 30 mtime=1454507263.248432434 30 atime=1454507327.319577936 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavascriptFuncReturn/testcases/JavascriptFuncReturnTest.j0000644000175000002070000001141512654402377034437 0ustar00jvanekmock00000000000000/* JToJSFuncReturnTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.CountingClosingListener; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import org.junit.Assert; import org.junit.Test; public class JavascriptFuncReturnTest extends BrowserTest { public final boolean doNotRunInOpera = false; private final String initStr = "JToJSFuncReturn applet initialized."; private final String afterStr = "afterTests"; private class CountingClosingListenerImpl extends CountingClosingListener { @Override protected boolean isAlowedToFinish(String s) { return (s.contains(initStr) && s.contains(afterStr)); } } private void evaluateStdoutContents(String[] expectedStdoutsOR, ProcessResult pr) { // Assert that the applet was initialized. Assert.assertTrue("JToJSFuncReturnTest stdout should contain " + initStr + " but it didnt.", pr.stdout.contains(initStr)); // Assert that the values set from JavaScript are ok boolean atLeastOne = false; for(String s : expectedStdoutsOR){ if(pr.stdout.contains(s)) atLeastOne = true; } Assert.assertTrue("JToJSFuncReturn: the output should include at least one of expected Stdouts, but it didnt.", atLeastOne); } private void javaToJSFuncReturnTest(String urlEnd, String[] expectedValsOR) throws Exception { if( doNotRunInOpera){ Browsers b = server.getCurrentBrowser().getID(); if(b == Browsers.opera){ return; } } String strURL = "/JavascriptFuncReturn.html?" + urlEnd; ProcessResult pr = server.executeBrowser(strURL, new CountingClosingListenerImpl(), new CountingClosingListenerImpl()); evaluateStdoutContents(expectedValsOR, pr); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSFuncReturn_number_Test() throws Exception { javaToJSFuncReturnTest("123", new String[] {"123"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSFuncReturn_boolean_Test() throws Exception { javaToJSFuncReturnTest("true", new String[] {"true"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSFuncReturn_String_Test() throws Exception { javaToJSFuncReturnTest("\"𠁎〒£$ǣ€𝍖\"", new String[] {"𠁎〒£$ǣ€𝍖"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSFuncReturn_Object_Test() throws Exception { javaToJSFuncReturnTest("applet.getNewDummyObject(\"dummy1\")", new String[] {"dummy1"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSFuncReturn_JSObject_Test() throws Exception { javaToJSFuncReturnTest("window", new String[] {"[object Window]", "[object DOMWindow]"}); } } icedtea-web-1.6.2/tests/reproducers/simple/JavascriptFuncReturn/PaxHeaders.17941/srcs0000644000000000000000000000013112654402377025453 xustar0030 mtime=1454507263.248432434 29 atime=1454507658.77815737 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavascriptFuncReturn/srcs/0000755000175000002070000000000012654402377026254 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JavascriptFuncReturn/srcs/PaxHeaders.17941/JavascriptFunc0000644000000000000000000000013212654402377030376 xustar0030 mtime=1454507263.248432434 30 atime=1454507327.319577936 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavascriptFuncReturn/srcs/JavascriptFuncReturn.java0000644000175000002070000000234012654402377033240 0ustar00jvanekmock00000000000000import java.applet.Applet; import netscape.javascript.JSObject; public class JavascriptFuncReturn extends Applet { private JSObject window; public void init() { window = JSObject.getWindow(this); String initStr = "JToJSFuncReturn applet initialized."; System.out.println(initStr); } // method for testing return types of JavaScript function public void jCallJSFunction() { if (window == null) { window = JSObject.getWindow(this); System.out.println("Null window."); } String returnTypeTestFuncName = "jsReturningFunction"; Object ret = window.call(returnTypeTestFuncName, new Object[]{}); System.out.println(ret.toString()); } // auxiliary class and methods public void writeAfterTests() { System.out.print("afterTests"); } public class DummyObject { private String str; public DummyObject(String s) { this.str = s; } public void setStr(String s) { this.str = s; } public String toString() { return str; } } public DummyObject getNewDummyObject(String s){ return new DummyObject(s); } } icedtea-web-1.6.2/tests/reproducers/simple/JavascriptFuncReturn/PaxHeaders.17941/resources0000644000000000000000000000013112654402377026513 xustar0030 mtime=1454507263.248432434 29 atime=1454507658.77815737 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavascriptFuncReturn/resources/0000755000175000002070000000000012654402377027314 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JavascriptFuncReturn/resources/PaxHeaders.17941/Javascrip0000644000000000000000000000013212654402377030436 xustar0030 mtime=1454507263.248432434 30 atime=1454507327.319577936 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavascriptFuncReturn/resources/JavascriptFuncReturn.js0000644000175000002070000000045112654402377033774 0ustar00jvanekmock00000000000000function doJToJSFuncReturnTests(){ var urlArgs = document.URL.split("?"); value = eval(decodeURIComponent(urlArgs[1])); applet.jCallJSFunction(); applet.writeAfterTests(); } function jsReturningFunction(){ return value; } var value; doTest(doJToJSFuncReturnTests, applet);icedtea-web-1.6.2/tests/reproducers/simple/JavascriptFuncReturn/resources/PaxHeaders.17941/Javascrip0000644000000000000000000000013212654402377030436 xustar0030 mtime=1454507263.247432448 30 atime=1454507327.318577949 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavascriptFuncReturn/resources/JavascriptFuncReturn.jnlp0000644000175000002070000000143712654402377034330 0ustar00jvanekmock00000000000000 Java to JavaScript LiveConnect - FuncReturn IcedTea LiveConnect - tests for returning different types of values when calling JS function from Java. icedtea-web-1.6.2/tests/reproducers/simple/JavascriptFuncReturn/resources/PaxHeaders.17941/Javascrip0000644000000000000000000000013212654402377030436 xustar0030 mtime=1454507263.247432448 30 atime=1454507327.318577949 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavascriptFuncReturn/resources/JavascriptFuncReturn.html0000644000175000002070000000116112654402377034323 0ustar00jvanekmock00000000000000 Java JavaScript LiveConnect - Function Return types

The JToJSFuncReturn html page

icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/JavascriptFuncParam0000644000000000000000000000013112654402377024262 xustar0030 mtime=1454507263.247432448 29 atime=1454507658.77815737 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavascriptFuncParam/0000755000175000002070000000000012654402377025063 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JavascriptFuncParam/PaxHeaders.17941/testcases0000644000000000000000000000013112654402377026260 xustar0030 mtime=1454507263.247432448 29 atime=1454507658.77815737 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavascriptFuncParam/testcases/0000755000175000002070000000000012654402377027061 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JavascriptFuncParam/testcases/PaxHeaders.17941/Javascript0000644000000000000000000000031112654402377030366 xustar00111 path=icedtea-web-1.6.2/tests/reproducers/simple/JavascriptFuncParam/testcases/JavascriptFuncParamTest.java 30 mtime=1454507263.247432448 30 atime=1454507327.318577949 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavascriptFuncParam/testcases/JavascriptFuncParamTest.jav0000644000175000002070000001740612654402377034336 0ustar00jvanekmock00000000000000/* JToJSFuncParamTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.CountingClosingListener; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.annotations.KnownToFail; import org.junit.Assert; import org.junit.Test; public class JavascriptFuncParamTest extends BrowserTest { public final boolean doNotRunInOpera = false; private final String initStr = "JToJSFuncParam applet initialized."; private final String afterStr = "afterTests"; private final String globStart = "Call with "; private final String globEnd = " from JS"; private final String jEnd = " from J"; private class CountingClosingListenerImpl extends CountingClosingListener { @Override protected boolean isAlowedToFinish(String s) { return (s.contains(initStr) && s.contains(afterStr)); } } private void evaluateStdoutContents(ProcessResult pr) { // Assert that the applet was initialized. Assert.assertTrue("JToJSFuncParamTest stdout should contain " + initStr + " but it didnt.", pr.stdout.contains(initStr)); // Assert that the results of two calls of js func are the same int gs = pr.stdout.indexOf(globStart); int ge = pr.stdout.indexOf(globEnd); int je = pr.stdout.indexOf(jEnd); int jss = je + jEnd.length() + 1; String javaOutput = pr.stdout.substring(gs, je); String jsOutput = pr.stdout.substring(jss, ge); Assert.assertTrue("JToJSFuncParam: the J and JS outputs are not equal!", javaOutput.equals(jsOutput)); } private void javaToJSFuncParamTest(String funcStr) throws Exception { if( doNotRunInOpera){ Browsers b = server.getCurrentBrowser().getID(); if(b == Browsers.opera){ return; } } String strURL = "/JavascriptFuncParam.html?" + funcStr; ProcessResult pr = server.executeBrowser(strURL, new CountingClosingListenerImpl(), new CountingClosingListenerImpl()); evaluateStdoutContents(pr); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSFuncParam_int_Test() throws Exception { javaToJSFuncParamTest("jjsCallintParam"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSFuncParam_double_Test() throws Exception { javaToJSFuncParamTest("jjsCalldoubleParam"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSFuncParam_float_Test() throws Exception { javaToJSFuncParamTest("jjsCallfloatParam"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSFuncParam_long_Test() throws Exception { javaToJSFuncParamTest("jjsCalllongParam"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSFuncParam_short_Test() throws Exception { javaToJSFuncParamTest("jjsCallshortParam"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSFuncParam_byte_Test() throws Exception { javaToJSFuncParamTest("jjsCallbyteParam"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSFuncParam_char_Test() throws Exception { javaToJSFuncParamTest("jjsCallcharParam"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSFuncParam_boolean_Test() throws Exception { javaToJSFuncParamTest("jjsCallbooleanParam"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSFuncParam_Integer_Test() throws Exception { javaToJSFuncParamTest("jjsCallIntegerParam"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSFuncParam_Double_Test() throws Exception { javaToJSFuncParamTest("jjsCallDoubleParam"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSFuncParam_Float_Test() throws Exception { javaToJSFuncParamTest("jjsCallFloatParam"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSFuncParam_Long_Test() throws Exception { javaToJSFuncParamTest("jjsCallLongParam"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSFuncParam_Short_Test() throws Exception { javaToJSFuncParamTest("jjsCallShortParam"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSFuncParam_Byte_Test() throws Exception { javaToJSFuncParamTest("jjsCallByteParam"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSFuncParam_Boolean_Test() throws Exception { javaToJSFuncParamTest("jjsCallBooleanParam"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSFuncParam_Character_Test() throws Exception { javaToJSFuncParamTest("jjsCallCharacterParam"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSFuncParam_String_Test() throws Exception { javaToJSFuncParamTest("jjsCallStringParam"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSFuncParam_DummyObject_Test() throws Exception { javaToJSFuncParamTest("jjsCallDummyObjectParam"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay @KnownToFail(failsIn={Browsers.googleChrome, Browsers.chromiumBrowser}) public void AppletJToJSFuncParam_JSObject_Test() throws Exception { javaToJSFuncParamTest("jjsCallJSObjectParam"); } } icedtea-web-1.6.2/tests/reproducers/simple/JavascriptFuncParam/PaxHeaders.17941/srcs0000644000000000000000000000013112654402377025234 xustar0030 mtime=1454507263.247432448 29 atime=1454507658.77815737 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavascriptFuncParam/srcs/0000755000175000002070000000000012654402377026035 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JavascriptFuncParam/srcs/PaxHeaders.17941/JavascriptFuncP0000644000000000000000000000013212654402377030277 xustar0030 mtime=1454507263.247432448 30 atime=1454507327.318577949 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavascriptFuncParam/srcs/JavascriptFuncParam.java0000644000175000002070000000665012654402377032612 0ustar00jvanekmock00000000000000import java.applet.Applet; import netscape.javascript.JSObject; public class JavascriptFuncParam extends Applet { public DummyObject dummyObject = new DummyObject("DummyObject1"); private JSObject window; private final String jsFunctionName = "JJSParameterTypeFunc"; public void init() { window = JSObject.getWindow(this); String initStr = "JToJSFuncParam applet initialized."; System.out.println(initStr); } // methods for testing calling JavaScript function with different parameters public void jjsCallintParam() { int i = 1; passToJavascript(i); } public void jjsCalldoubleParam() { double d = 1.1; passToJavascript(d); } public void jjsCallfloatParam() { float f = 1.5f; passToJavascript(f); } public void jjsCalllongParam() { long l = 10000; passToJavascript(l); } public void jjsCallshortParam() { short s = 1; passToJavascript(s); } public void jjsCallbyteParam() { byte b = 1; passToJavascript(b); } public void jjsCallcharParam() { char c = 'a'; passToJavascript(c, "97"); } public void jjsCallbooleanParam() { boolean b = true; passToJavascript(b); } public void jjsCallIntegerParam() { Integer i = new Integer(1); passToJavascript(i); } public void jjsCallDoubleParam() { Double i = new Double(1.5); passToJavascript(i); } public void jjsCallFloatParam() { Float i = new Float(1.5); passToJavascript(i); } public void jjsCallLongParam() { Long i = new Long(10000); passToJavascript(i); } public void jjsCallShortParam() { Short i = new Short((short) 1); passToJavascript(i); } public void jjsCallByteParam() { Byte i = new Byte((byte) 1); passToJavascript(i); } public void jjsCallBooleanParam() { Boolean i = new Boolean(true); passToJavascript(i); } public void jjsCallCharacterParam() { Character i = new Character('a');// 97 passToJavascript(i, "97"); } public void jjsCallStringParam() { String i = "teststring"; passToJavascript(i, "\"teststring\""); } public void jjsCallDummyObjectParam() { DummyObject i = new DummyObject("dummy1"); passToJavascript(i, "applet.getNewDummyObject(\"dummy1\")"); } public void jjsCallJSObjectParam() { passToJavascript(JSObject.getWindow(this), "window"); } private void passToJavascript(Object obj, String repr) { if (window == null) { window = JSObject.getWindow(this); System.out.println("Null window."); } window.call(jsFunctionName, new Object[] { obj, repr }); } private void passToJavascript(Object obj) { passToJavascript(obj, obj.toString()); } // auxiliary methods and class: public void printOut(String s) { System.out.println(s); } public class DummyObject { private String str; public DummyObject(String s) { this.str = s; } public void setStr(String s) { this.str = s; } public String toString() { return str; } } public DummyObject getNewDummyObject(String s) { return new DummyObject(s); } } icedtea-web-1.6.2/tests/reproducers/simple/JavascriptFuncParam/PaxHeaders.17941/resources0000644000000000000000000000013112654402377026274 xustar0030 mtime=1454507263.246432461 29 atime=1454507658.77815737 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavascriptFuncParam/resources/0000755000175000002070000000000012654402377027075 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JavascriptFuncParam/resources/PaxHeaders.17941/javascript0000644000000000000000000000013212654402377030443 xustar0030 mtime=1454507263.246432461 30 atime=1454507327.318577949 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavascriptFuncParam/resources/javascript-funcparam.jnlp0000644000175000002070000000140612654402377034103 0ustar00jvanekmock00000000000000 Java to JavaScript LiveConnect - FuncParam IcedTea LiveConnect - tests for parameter conversion between Java and JavaScript. icedtea-web-1.6.2/tests/reproducers/simple/JavascriptFuncParam/resources/PaxHeaders.17941/Javascript0000644000000000000000000000013212654402377030403 xustar0030 mtime=1454507263.246432461 30 atime=1454507327.318577949 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavascriptFuncParam/resources/JavascriptFuncParam.js0000644000175000002070000000120112654402377033330 0ustar00jvanekmock00000000000000function JJSParameterTypeFunc(type_parameter, js_str_param) { var str = "Call with " + type_parameter.toString() + ":" + typeof (type_parameter) + " from J"; applet.printOut(str); var value = eval(js_str_param); JSSubFunc(value); } function JSSubFunc(type_parameter) { var str = "Call with " + type_parameter.toString() + ":" + typeof (type_parameter) + " from JS"; applet.printOut(str); } function attemptFuncParamTest() { var urlArgs = document.URL.split("?"); var func = urlArgs[1]; applet[func](); applet.printOut("afterTests"); } doTest(attemptFuncParamTest, applet);icedtea-web-1.6.2/tests/reproducers/simple/JavascriptFuncParam/resources/PaxHeaders.17941/Javascript0000644000000000000000000000013212654402377030403 xustar0030 mtime=1454507263.246432461 30 atime=1454507327.317577963 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JavascriptFuncParam/resources/JavascriptFuncParam.html0000644000175000002070000000114012654402377033662 0ustar00jvanekmock00000000000000 Java JavaScript LiveConnect - Function Parameters

The JToJSFuncParam html page

icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/JToJSString0000644000000000000000000000013112654402377022477 xustar0030 mtime=1454507263.245432474 29 atime=1454507658.77815737 30 ctime=1454507658.758157637 icedtea-web-1.6.2/tests/reproducers/simple/JToJSString/0000755000175000002070000000000012654402377023300 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JToJSString/PaxHeaders.17941/testcases0000644000000000000000000000013012654402377024474 xustar0030 mtime=1454507263.245432474 29 atime=1454507658.77815737 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JToJSString/testcases/0000755000175000002070000000000012654402377025276 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JToJSString/testcases/PaxHeaders.17941/JToJSStringTest.ja0000644000000000000000000000013112654402377030046 xustar0030 mtime=1454507263.246432461 30 atime=1454507327.317577963 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JToJSString/testcases/JToJSStringTest.java0000644000175000002070000001036712654402377031130 0ustar00jvanekmock00000000000000/* Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.annotations.Bug; import net.sourceforge.jnlp.annotations.KnownToFail; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; import net.sourceforge.jnlp.closinglisteners.CountingClosingListener; import org.junit.Assert; import org.junit.Test; public class JToJSStringTest extends BrowserTest { // the JS<->J tests tend to make Opera unusable private static final boolean doNotRunInOpera = false; private static final String initStr = "init"; private static final String afterStr = "afterTests"; private class CountingClosingListenerImpl extends CountingClosingListener { @Override protected boolean isAlowedToFinish(String s) { return (s.contains(initStr) && s.contains(afterStr)); } } private static void evaluateStdoutContents(String expectedStdout, ProcessResult pr) { Assert.assertTrue("JSToJSet: the stdout should contain " + initStr + ", but it didnt.", pr.stdout.contains(initStr)); Assert.assertTrue("JSToJSet: the output should include: " + expectedStdout + ", but it didnt.", pr.stdout.contains(expectedStdout)); } private void javaToJSTest(String url, String expectedStdout) throws Exception { if (doNotRunInOpera) { if (server.getCurrentBrowser().getID() == Browsers.opera) { return; } ProcessResult pr = server.executeBrowser(url, new CountingClosingListenerImpl(), new CountingClosingListenerImpl()); evaluateStdoutContents(expectedStdout, pr); } } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay @Bug(id = { "PR1794" }) public void StringArrayTest() throws Exception { javaToJSTest("/JToJSString.html", "abc"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void StringTest() throws Exception { javaToJSTest("/JToJSString.html", "notarrayitem"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay @Bug(id = { "PR1794" }) public void jnlpStringArrayAppletTest() throws Exception { javaToJSTest("/JToJSStringJnlpApplet.html", "abc"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay @Bug(id = { "PR1794" }) public void jnlpStringAppletTest() throws Exception { javaToJSTest("/JToJSStringJnlpApplet.html", "notarrayitem"); } } icedtea-web-1.6.2/tests/reproducers/simple/JToJSString/PaxHeaders.17941/srcs0000644000000000000000000000013012654402377023450 xustar0030 mtime=1454507263.245432474 29 atime=1454507658.77815737 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JToJSString/srcs/0000755000175000002070000000000012654402377024252 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JToJSString/srcs/PaxHeaders.17941/JToJSString.java0000644000000000000000000000013112654402377026511 xustar0030 mtime=1454507263.245432474 30 atime=1454507327.317577963 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JToJSString/srcs/JToJSString.java0000644000175000002070000000617012654402377027241 0ustar00jvanekmock00000000000000/* Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.applet.Applet; import netscape.javascript.JSObject; public class JToJSString extends Applet { public String[] myStringArray = { "a", "b", "c" }; public String myString = "notarrayitem"; private final String writetojs = "writetojs"; private final String writetojss = "writetojss"; private JSObject window; @Override public void init() { System.out.println("init"); window = JSObject.getWindow(this); if (window == null) { System.out.println("init stage: window is null"); } else { window.call("writeToJS", new Object[] { myStringArray }); window.call("writeToJSs", new Object[] { myString }); System.out.println("init stage: complete"); } } public void jjsReadString(String element) { System.out.println("jjsReadString " + element); if (window == null) { window = JSObject.getWindow(this); System.out.println("jjsReadString stage: window is null"); } Object value = window.call("getDOMElementByID", new Object[] { element }); System.out.println(value); } public void readStringAndFinish() { System.out.println("readStringAndFinish"); jjsReadString("writetojs"); jjsReadString("writetojss"); System.out.println("afterTests"); } public void printFromJS(String message) { System.out.println(message); } @Override public void destroy() { System.out.println("destroy"); } } icedtea-web-1.6.2/tests/reproducers/simple/JToJSString/PaxHeaders.17941/resources0000644000000000000000000000013012654402377024510 xustar0030 mtime=1454507263.245432474 29 atime=1454507658.77815737 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JToJSString/resources/0000755000175000002070000000000012654402377025312 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JToJSString/resources/PaxHeaders.17941/JToJSStringJnlpApp0000644000000000000000000000013112654402377030116 xustar0030 mtime=1454507263.245432474 30 atime=1454507327.317577963 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JToJSString/resources/JToJSStringJnlpApplet.html0000644000175000002070000000426212654402377032316 0ustar00jvanekmock00000000000000


------------


icedtea-web-1.6.2/tests/reproducers/simple/JToJSString/resources/PaxHeaders.17941/JToJSStringApplet.0000644000000000000000000000013112654402377030055 xustar0030 mtime=1454507263.245432474 30 atime=1454507327.317577963 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JToJSString/resources/JToJSStringApplet.jnlp0000644000175000002070000000417312654402377031472 0ustar00jvanekmock00000000000000 JavaToJS IcedTea LiveConnect - Output Strings from Array from Java to JS icedtea-web-1.6.2/tests/reproducers/simple/JToJSString/resources/PaxHeaders.17941/JToJSString.js0000644000000000000000000000013112654402377027244 xustar0030 mtime=1454507263.244432488 30 atime=1454507327.317577963 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JToJSString/resources/JToJSString.js0000644000175000002070000000253512654402377027775 0ustar00jvanekmock00000000000000function writeToJS(myStringArray) { var tojs = document.getElementById("writetojs"); tojs.innerHTML = "" + myStringArray[0] + myStringArray[1] + myStringArray[2]; } function writeToJSs(myString) { var tojss = document.getElementById("writetojss"); tojss.innerHTML = myString; } function getDOMElementByID(id) { return document.getElementById(id).innerHTML; } function attemptJToJSStringTest() { notice.innerHTML = "1"; applet.printFromJS("Stage 1 reached"); var byids = document.getElementById("byids"); notice.innerHTML = "2"; applet.printFromJS("Stage 2 reached"); byids.innerHTML = "String by Id: " + applet.myString; notice.innerHTML = "3"; applet.printFromJS("Stage 3 reached"); var byid = document.getElementById("byid"); notice.innerHTML = "4"; applet.printFromJS("Stage 4 reached"); byid.innerHTML = "StringArray by Id: " + applet.myStringArray[0] + ", " + applet.myStringArray[1] + ", " + applet.myStringArray[2]; notice.innerHTML = "5"; applet.printFromJS("Stage 5 reached"); applet.readStringAndFinish(); notice.innerHTML = "6"; applet.printFromJS("Stage 6 reached"); } try { doTest(attemptJToJSStringTest, applet); } catch (err) { alert(err); }icedtea-web-1.6.2/tests/reproducers/simple/JToJSString/resources/PaxHeaders.17941/JToJSString.html0000644000000000000000000000013112654402377027574 xustar0030 mtime=1454507263.244432488 30 atime=1454507327.317577963 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JToJSString/resources/JToJSString.html0000644000175000002070000000422212654402377030320 0ustar00jvanekmock00000000000000


------------


icedtea-web-1.6.2/tests/reproducers/simple/JToJSString/resources/PaxHeaders.17941/JSTest.js0000644000000000000000000000013112654402377026300 xustar0030 mtime=1454507263.244432488 30 atime=1454507327.317577963 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JToJSString/resources/JSTest.js0000644000175000002070000000024212654402377027022 0ustar00jvanekmock00000000000000function doTest(funcCallback, applet) { if (applet.init != null) { funcCallback(); } else { setTimeout(function(){doTest(funcCallback, applet)}, 100); } } icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/JSToJTypeConv0000644000000000000000000000013012654402377022777 xustar0030 mtime=1454507263.243432501 29 atime=1454507658.77815737 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSToJTypeConv/0000755000175000002070000000000012654402377023601 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JSToJTypeConv/PaxHeaders.17941/testcases0000644000000000000000000000013012654402377024775 xustar0030 mtime=1454507263.243432501 29 atime=1454507658.77815737 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSToJTypeConv/testcases/0000755000175000002070000000000012654402377025577 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JSToJTypeConv/testcases/PaxHeaders.17941/JSToJTypeConvTes0000644000000000000000000000013112654402377030073 xustar0030 mtime=1454507263.244432488 30 atime=1454507327.316577976 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSToJTypeConv/testcases/JSToJTypeConvTest.java0000644000175000002070000004171512654402377031733 0ustar00jvanekmock00000000000000/* JSToJTypeConvTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.CountingClosingListener; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import org.junit.Assert; import org.junit.Test; public class JSToJTypeConvTest extends BrowserTest { //the JS<->J tests tend to make Opera unusable public final boolean doNotRunInOpera = false; private final String initStr = "JSToJTypeConv applet initialized."; private final String afterStr = "afterTests"; private class CountingClosingListenerImpl extends CountingClosingListener { @Override protected boolean isAlowedToFinish(String s) { return (s.contains(initStr) && s.contains(afterStr)); } } private void evaluateStdoutContents(String[] expectedStdouts, ProcessResult pr) { // Assert that the applet was initialized. Assert.assertTrue("JSToJTypeConv: the stdout should contain " + initStr + ", but it didnt.", pr.stdout.contains(initStr)); // Assert that the values set by JavaScript are ok for(String str : expectedStdouts){ String xmlStr = "new value"; if(str.contains("nonXML char")) { str = str.substring(12); }else{ xmlStr = str; } Assert.assertTrue("JSToJTypeConv: the output should include "+xmlStr+", but it didnt.", pr.stdout.contains(str)); } } private void jsToJavaTypeConvTest(String fieldStr, String valueStr, String[] expectedValueAndOutputs) throws Exception { if( doNotRunInOpera){ if(server.getCurrentBrowser().getID() == Browsers.opera){ return; } } String strURL = "/JSToJTypeConv.html?" + fieldStr + ";" + valueStr; ProcessResult pr = server.executeBrowser(strURL, new CountingClosingListenerImpl(), new CountingClosingListenerImpl()); String[] expectedStdouts = expectedValueAndOutputs; evaluateStdoutContents(expectedStdouts, pr); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_NumToJavaStringInteger_Test() throws Exception { jsToJavaTypeConvTest("_String", "1", new String[] {"1"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_NumToJavaStringDouble_Test() throws Exception { jsToJavaTypeConvTest("_String", "1.1", new String[] {"1.1"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_NumToJavaObjectInteger_Test() throws Exception { jsToJavaTypeConvTest("_Object", "1.0", new String[] {"1","superclass is java.lang.Number"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_NumToJavaObjectDouble_Test() throws Exception { jsToJavaTypeConvTest("_Object", "1.1", new String[] {"1.1","superclass is java.lang.Number"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_NumToboolean0_Test() throws Exception { jsToJavaTypeConvTest("_boolean", "0", new String[] {"false"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_NumToboolean1dot1_Test() throws Exception { jsToJavaTypeConvTest("_boolean", "1.1", new String[] {"true"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_BoolToJavaBoolTrue_Test() throws Exception { jsToJavaTypeConvTest("_Boolean", "true", new String[] {"true"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_BoolToJavaBoolFalse_Test() throws Exception { jsToJavaTypeConvTest("_Boolean", "false", new String[] {"false"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_BoolToJavaObject_Test() throws Exception { jsToJavaTypeConvTest("_Object", "true", new String[] {"true", "class is java.lang.Boolean"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_BoolToJavaString_Test() throws Exception { jsToJavaTypeConvTest("_String", "true", new String[] {"true"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_BoolTobyteTrue_Test() throws Exception { jsToJavaTypeConvTest("_byte", "true", new String[] {"1"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_BoolTocharTrue_Test() throws Exception { jsToJavaTypeConvTest("_char", "true", new String[] { "nonXML char "+((char)1) }); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_BoolToshortTrue_Test() throws Exception { jsToJavaTypeConvTest("_short", "true", new String[] {"1"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_BoolTointTrue_Test() throws Exception { jsToJavaTypeConvTest("_int", "true", new String[] {"1"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_BoolTolongTrue_Test() throws Exception { jsToJavaTypeConvTest("_long", "true", new String[] {"1"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_BoolTofloatTrue_Test() throws Exception { jsToJavaTypeConvTest("_float", "true", new String[] {"1"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_BoolTodoubleTrue_Test() throws Exception { jsToJavaTypeConvTest("_double", "true", new String[] {"1"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_BoolTobyteFalse_Test() throws Exception { jsToJavaTypeConvTest("_byte", "false", new String[] {"0"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_BoolTocharFalse_Test() throws Exception { jsToJavaTypeConvTest("_char", "false", new String[] { "nonXML char "+((char)0) }); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_BoolToshortFalse_Test() throws Exception { jsToJavaTypeConvTest("_short", "false", new String[] {"0"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_BoolTointFalse_Test() throws Exception { jsToJavaTypeConvTest("_int", "false", new String[] {"0"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_BoolTolongFalse_Test() throws Exception { jsToJavaTypeConvTest("_long", "false", new String[] {"0"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_BoolTofloatFalse_Test() throws Exception { jsToJavaTypeConvTest("_float", "false", new String[] {"0"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_BoolTodoubleFalse_Test() throws Exception { jsToJavaTypeConvTest("_double", "false", new String[] {"0"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_StringToObject_Test() throws Exception { jsToJavaTypeConvTest("_Object", "\"𠁎〒£$ǣ€𝍖\"", new String[] {"𠁎〒£$ǣ€𝍖"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_StringTobyte_Test() throws Exception { jsToJavaTypeConvTest("_byte", "\'1\'", new String[] {"1"}); //JS string 'str' or "str" both ok } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_StringToshort_Test() throws Exception { jsToJavaTypeConvTest("_short", "\"1\"", new String[] {"1"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_StringToint_Test() throws Exception { jsToJavaTypeConvTest("_int", "\"1\"", new String[] {"1"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_StringTolong_Test() throws Exception { jsToJavaTypeConvTest("_long", "\"1\"", new String[] {"1"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_StringTofloat_Test() throws Exception { jsToJavaTypeConvTest("_float", "\"1.1\"", new String[] {"1.1"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_StringTodouble_Test() throws Exception { jsToJavaTypeConvTest("_double", "\"1.1\"", new String[] {"1.1"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_StringTochar_Test() throws Exception { jsToJavaTypeConvTest("_char", "\"1\"", new String[] { "nonXML char "+((char)1) }); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_StringTobooleanEmptyFalse_Test() throws Exception { jsToJavaTypeConvTest("_boolean", "\"\"", new String[] {"false"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_StringTobooleanNonemptyTrue_Test() throws Exception { jsToJavaTypeConvTest("_boolean", "\"a nonempty string\"", new String[] {"true"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_ArrayTobyteArr_Test() throws Exception { jsToJavaTypeConvTest("_byteArray", "[1,null,2]", new String[] {"[1,0,2]"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_ArrayTocharArr_Test() throws Exception { jsToJavaTypeConvTest("_charArray", "[97,null,98]", new String[] {"nonXML char [a,"+((char)0) +",b]"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_ArrayToshortArr_Test() throws Exception { jsToJavaTypeConvTest("_shortArray", "[1,null,2]", new String[] {"[1,0,2]"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_ArrayTointArr_Test() throws Exception { jsToJavaTypeConvTest("_intArray", "[1,null,2]", new String[] {"[1,0,2]"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_ArrayTolongArr_Test() throws Exception { jsToJavaTypeConvTest("_longArray", "[1,null,2]", new String[] {"[1,0,2]"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_ArrayTofloatArr_Test() throws Exception { jsToJavaTypeConvTest("_floatArray", "[1,null,2]", new String[] {"[1.0,0.0,2.0]"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_ArrayTodoubleArr_Test() throws Exception { jsToJavaTypeConvTest("_doubleArray", "[1,null,2]", new String[] {"[1.0,0.0,2.0]"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_ArrayToStringArr_Test() throws Exception { jsToJavaTypeConvTest("_StringArray", "[1,null,2]", new String[] {"[1,null,2]"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_ArrayTocharArrArr_Test() throws Exception { jsToJavaTypeConvTest("_charArray2D", "[[\"97\",null,\"98\"],[],[\"99\",\"100\",null,\"101\"]]", new String[] {"nonXML char [[a,"+((char)0)+",b],[],[c,d,"+((char)0)+",e]]"}); //Error on Java side: array element type mismatch } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_ArrayToStringArrArr_Test() throws Exception { jsToJavaTypeConvTest("_StringArray2D", "[[\"00\",null,\"02\"],[],[\"20\",\"21\",null,\"23\"]]", new String[] {"[[00,null,02],[],[20,21,null,23]]"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_ArrayToString_Test() throws Exception { jsToJavaTypeConvTest("_String", "[[\"00\",null,\"02\"],[],[\"20\",\"21\",null,\"23\"]]", new String[] {"00,,02,,20,21,,23"}); //Error on Java side: array element type mismatch } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_JSObjectToJSObject_Test() throws Exception { jsToJavaTypeConvTest("_JSObject", "window", new String[] {"[object Window]"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_JSObjectToString_Test() throws Exception { jsToJavaTypeConvTest("_String", "window", new String[] {"[object Window]"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_JavaObjectToJavaObject_Test() throws Exception { jsToJavaTypeConvTest("_Object", "new applet.Packages.java.lang.Float(1.1)", new String[] {"1.1","class is java.lang.Float"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_JavaObjectToString_Test() throws Exception { jsToJavaTypeConvTest("_String", "applet.getNewDummyObject(\"dummy1\")", new String[] {"dummy1"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_nullToJavaObjectString_Test() throws Exception { jsToJavaTypeConvTest("_String", "null", new String[] {"null"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_StringTobooleanFalseStr_Test() throws Exception { jsToJavaTypeConvTest("_boolean", "\"false\"", new String[] {"true"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_StringTobooleanTrueStr_Test() throws Exception { jsToJavaTypeConvTest("_boolean", "\"true\"", new String[] {"true"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_StringToBooleanFalseStr_Test() throws Exception { jsToJavaTypeConvTest("_Boolean", "\"false\"", new String[] {"true"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_StringToBooleanTrueStr_Test() throws Exception { jsToJavaTypeConvTest("_Boolean", "\"true\"", new String[] {"true"}); } } icedtea-web-1.6.2/tests/reproducers/simple/JSToJTypeConv/PaxHeaders.17941/srcs0000644000000000000000000000013012654402377023751 xustar0030 mtime=1454507263.243432501 29 atime=1454507658.77815737 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSToJTypeConv/srcs/0000755000175000002070000000000012654402377024553 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JSToJTypeConv/srcs/PaxHeaders.17941/JSToJTypeConv.java0000644000000000000000000000013112654402377027313 xustar0030 mtime=1454507263.243432501 30 atime=1454507327.316577976 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSToJTypeConv/srcs/JSToJTypeConv.java0000644000175000002070000000712712654402377030046 0ustar00jvanekmock00000000000000import java.applet.Applet; import java.lang.reflect.Array; import java.lang.reflect.Field; import netscape.javascript.JSObject; public class JSToJTypeConv extends Applet { public byte _byte = 0; public char _char = 'A'; public short _short = 0; public int _int = 0; public long _long = 0L; public float _float = 0F; public double _double = 0.0; public boolean _boolean = false; public byte[] _byteArray = null; public char[] _charArray = null; public short[] _shortArray = null; public int[] _intArray = null; public long[] _longArray = null; public float[] _floatArray = null; public double[] _doubleArray = null; public char[][] _charArray2D = null; public Byte _Byte = null; public Character _Character = 'A'; public Short _Short = 0; public Integer _Integer = 0; public Long _Long = 0L; public Float _Float = 0F; public Double _Double = 0.0; public String _String = ""; public Boolean _Boolean = false; public JSObject _JSObject = null; public Byte[] _ByteArray = null; public Character[] _CharacterArray = null; public Short[] _ShortArray = null; public Integer[] _IntegerArray = null; public Long[] _LongArray = null; public Float[] _FloatArray = null; public Double[] _DoubleArray = null; public String[] _StringArray = null; public String[][] _StringArray2D = null; public Object _Object = null; public String getArrayAsStr(Object array) { if( array == null){ return "null"; }else{ int size = Array.getLength(array); String ret = ""; for (int i=0; i < size; i++) { ret += ((Array.get(array, i) == null) ? "null" : Array.get(array, i).toString()); ret += ","; } if (ret.length() > 0) { ret = ret.substring(0, ret.length()-1); } return "["+ret+"]"; } } public void init() { String initStr = "JSToJTypeConv applet initialized."; System.out.println(initStr); } public class DummyObject { private String str; public DummyObject(String s) { this.str = s; } public void setStr(String s) { this.str = s; } public String toString() { return str; } } public DummyObject getNewDummyObject(String s){ return new DummyObject(s); } public void printNewValueAndFinish(String fieldname) throws Exception { if( fieldname.equals("_Object")){ System.out.println( "New value is: " + _Object + " class is " + _Object.getClass().getName() + " superclass is " + _Object.getClass().getSuperclass().getName() ); }else{ Field field = getClass().getDeclaredField(fieldname); Object value = field.get(this); //2D arrays if( fieldname.contains("2D") ){ Object row1 = Array.get(value,0); Object row2 = Array.get(value,1); Object row3 = Array.get(value,2); System.out.println( "New value is: [" + getArrayAsStr(row1) + "," + getArrayAsStr(row2) + "," + getArrayAsStr(row3) + "]"); //arrays }else if (value != null && value.getClass().isArray()) { System.out.println("New value is: " + getArrayAsStr(value)); //classic fields } else { System.out.println("New value is: " + value); } } System.out.println("afterTests"); } } icedtea-web-1.6.2/tests/reproducers/simple/JSToJTypeConv/PaxHeaders.17941/resources0000644000000000000000000000013012654402377025011 xustar0030 mtime=1454507263.243432501 29 atime=1454507658.77815737 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSToJTypeConv/resources/0000755000175000002070000000000012654402377025613 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JSToJTypeConv/resources/PaxHeaders.17941/jstoj-typeconv.j0000644000000000000000000000013112654402377030240 xustar0030 mtime=1454507263.243432501 30 atime=1454507327.316577976 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSToJTypeConv/resources/jstoj-typeconv.jnlp0000644000175000002070000000135712654402377031504 0ustar00jvanekmock00000000000000 JavaScript to Java LiveConnect - TypeConv IcedTea LiveConnect - tests for data type conversion from JS to Java variables. icedtea-web-1.6.2/tests/reproducers/simple/JSToJTypeConv/resources/PaxHeaders.17941/JSToJava_TypeCon0000644000000000000000000000013112654402377030074 xustar0030 mtime=1454507263.243432501 30 atime=1454507327.316577976 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSToJTypeConv/resources/JSToJava_TypeConv.js0000644000175000002070000000051512654402377031422 0ustar00jvanekmock00000000000000function attemptTypeConvTests() { var urlArgs = document.URL.split("?"); var testParams = urlArgs[1].split(";"); var field = testParams[0]; var value = decodeURIComponent(testParams[1]); eval('applet.' + field + '=' + value); applet.printNewValueAndFinish(field); } doTest(attemptTypeConvTests, applet); icedtea-web-1.6.2/tests/reproducers/simple/JSToJTypeConv/resources/PaxHeaders.17941/JSToJTypeConv.ht0000644000000000000000000000013112654402377030045 xustar0030 mtime=1454507263.242432514 30 atime=1454507327.316577976 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSToJTypeConv/resources/JSToJTypeConv.html0000644000175000002070000000113312654402377031120 0ustar00jvanekmock00000000000000 JavaScript to Java LiveConnect - Types Conversion

The JSToJTypeConv html page

icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/JSToJSet0000644000000000000000000000013012654402377021763 xustar0030 mtime=1454507263.242432514 29 atime=1454507658.77815737 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSToJSet/0000755000175000002070000000000012654402377022565 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JSToJSet/PaxHeaders.17941/testcases0000644000000000000000000000013012654402377023761 xustar0030 mtime=1454507263.242432514 29 atime=1454507658.77815737 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSToJSet/testcases/0000755000175000002070000000000012654402377024563 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JSToJSet/testcases/PaxHeaders.17941/JSToJSetTest.java0000644000000000000000000000013112654402377027147 xustar0030 mtime=1454507263.242432514 30 atime=1454507327.316577976 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSToJSet/testcases/JSToJSetTest.java0000644000175000002070000002246212654402377027701 0ustar00jvanekmock00000000000000/* JSToJSetTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.CountingClosingListener; import net.sourceforge.jnlp.annotations.Bug; import net.sourceforge.jnlp.annotations.KnownToFail; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import org.junit.Assert; import org.junit.Test; @Bug(id = { "PR1298" }) public class JSToJSetTest extends BrowserTest { // the JS<->J tests tend to make Opera unusable public final boolean doNotRunInOpera = false; private final String initStr = "JSToJSet applet initialized."; private final String afterStr = "afterTests"; public enum TestType { ARRAY_ELEMENT, WHOLE_ARRAY, NORMAL_VALUE } private class CountingClosingListenerImpl extends CountingClosingListener { @Override protected boolean isAlowedToFinish(String s) { return (s.contains(initStr) && s.contains(afterStr)); } } private void evaluateStdoutContents(String expectedStdout, ProcessResult pr) { // Assert that the applet was initialized. Assert.assertTrue("JSToJSet: the stdout should contain " + initStr + ", but it didnt.", pr.stdout.contains(initStr)); // Assert that the values set by JavaScript are ok Assert.assertTrue("JSToJSet: the output should include: " + expectedStdout + ", but it didnt.", pr.stdout.contains(expectedStdout)); } private void jsToJavaSetNormalTest(String fieldStr, String valueStr) throws Exception { if (doNotRunInOpera) { if (server.getCurrentBrowser().getID() == Browsers.opera) { return; } } String strURL = "/JSToJSet.html?" + fieldStr + ";" + valueStr; ProcessResult pr = server.executeBrowser(strURL, new CountingClosingListenerImpl(), new CountingClosingListenerImpl()); String expectedStdout = "New value is: " + valueStr; evaluateStdoutContents(expectedStdout, pr); } private void jsToJavaSetSpecialTest(String fieldStr, String valueStr, TestType testType) throws Exception { if (doNotRunInOpera) { Browsers b = server.getCurrentBrowser().getID(); if (b == Browsers.opera) { return; } } String strURL = "/JSToJSet.html?"; String expectedStdout = ""; switch (testType) { case ARRAY_ELEMENT:// array element strURL += fieldStr + ";" + valueStr; expectedStdout = "New array value is: " + valueStr; break; case WHOLE_ARRAY:// whole array, set 1st element strURL += fieldStr + ";[" + valueStr; expectedStdout = "New array value is: " + valueStr; break; case NORMAL_VALUE:// char et al - to be set at JS side strURL += fieldStr + ";JavaScript"; expectedStdout = "New value is: " + valueStr; break; default: break; } ProcessResult pr = server.executeBrowser(strURL, new CountingClosingListenerImpl(), new CountingClosingListenerImpl()); evaluateStdoutContents(expectedStdout, pr); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJSet_int_Test() throws Exception { jsToJavaSetNormalTest("_int", "1"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJSet_double_Test() throws Exception { jsToJavaSetNormalTest("_double", "1.0"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJSet_float_Test() throws Exception { jsToJavaSetNormalTest("_float", "1.1"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJSet_long_Test() throws Exception { jsToJavaSetNormalTest("_long", "10000"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJSet_boolean_Test() throws Exception { jsToJavaSetNormalTest("_boolean", "true"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJSet_char_Test() throws Exception { jsToJavaSetSpecialTest("_char", "a", TestType.NORMAL_VALUE); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJSet_byte_Test() throws Exception { jsToJavaSetNormalTest("_byte", "10"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay @Bug(id = { "PR1298" }) public void AppletJSToJSet_intArrayElement_Test() throws Exception { jsToJavaSetSpecialTest("_intArray[0]", "1", TestType.ARRAY_ELEMENT); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJSet_regularString_Test() throws Exception { jsToJavaSetNormalTest("_String", "teststring"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJSet_specialCharsString_Test() throws Exception { jsToJavaSetSpecialTest("_specialString", "𠁎〒£$ǣ€𝍖", TestType.NORMAL_VALUE); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJSet_null_Test() throws Exception { jsToJavaSetNormalTest("_Object", "null"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay @KnownToFail public void AppletJSToJSet_Integer_Test() throws Exception { jsToJavaSetNormalTest("_Integer", "1"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay @KnownToFail public void AppletJSToJSet_Double_Test() throws Exception { jsToJavaSetNormalTest("_Double", "1.0"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay @KnownToFail public void AppletJSToJSet_Float_Test() throws Exception { jsToJavaSetNormalTest("_Float", "1.1"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay @KnownToFail public void AppletJSToJSet_Long_Test() throws Exception { jsToJavaSetNormalTest("_Long", "10000"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJSet_Boolean_Test() throws Exception { jsToJavaSetNormalTest("_Boolean", "true"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJSet_Character_Test() throws Exception { jsToJavaSetSpecialTest("_Character", "A", TestType.NORMAL_VALUE); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay @KnownToFail public void AppletJSToJSet_Byte_Test() throws Exception { jsToJavaSetNormalTest("_Byte", "100"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay @KnownToFail @Bug(id = { "PR1298" }) public void AppletJSToJSet_DoubleArrayElement_Test() throws Exception { jsToJavaSetSpecialTest("_DoubleArray[0]", "1.1", TestType.ARRAY_ELEMENT); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay @KnownToFail public void AppletJSToJSet_DoubleFullArray_Test() throws Exception { jsToJavaSetSpecialTest("_DoubleArray2", "0.1", TestType.WHOLE_ARRAY); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJSet_JSObject_Test() throws Exception { jsToJavaSetSpecialTest("_JSObject", "100, red", TestType.NORMAL_VALUE); } } icedtea-web-1.6.2/tests/reproducers/simple/JSToJSet/PaxHeaders.17941/srcs0000644000000000000000000000013012654402377022735 xustar0030 mtime=1454507263.242432514 29 atime=1454507658.77815737 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSToJSet/srcs/0000755000175000002070000000000012654402377023537 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JSToJSet/srcs/PaxHeaders.17941/JSToJSet.java0000644000000000000000000000013112654402377025263 xustar0030 mtime=1454507263.242432514 30 atime=1454507327.316577976 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSToJSet/srcs/JSToJSet.java0000644000175000002070000000341212654402377026007 0ustar00jvanekmock00000000000000import java.applet.Applet; import java.lang.reflect.Array; import java.lang.reflect.Field; import netscape.javascript.JSObject; public class JSToJSet extends Applet { public int _int; public double _double; public float _float; public long _long; public boolean _boolean; public char _char; public byte _byte; public String _String; public String _specialString; public Object _Object = new String("non-null object"); public int[] _intArray = new int[1]; public Integer _Integer; public Double _Double; public Float _Float; public Long _Long; public Boolean _Boolean; public Character _Character = 'B'; public Byte _Byte; public Double[] _DoubleArray = new Double[10]; public Double[] _DoubleArray2; public char[] _charArray = new char[1]; public Character[] _CharacterArray = new Character[1]; public JSObject _JSObject; public void init() { String initStr = "JSToJSet applet initialized."; System.out.println(initStr); } public void printNewValueAndFinish(String fieldname) throws Exception { Field field = getClass().getDeclaredField(fieldname); Object value = field.get(this); System.out.println("Old value is: " + value); if (fieldname.equals("_JSObject")) { Integer mph = (Integer) _JSObject.getMember("mph"); String color = (String) _JSObject.getMember("color"); System.out.println("New value is: " + mph + ", " + color); } else if (value != null && value.getClass().isArray()) { System.out.println("New array value is: " + Array.get(value, 0)); } else { System.out.println("New value is: " + value); } System.out.println("afterTests"); } } icedtea-web-1.6.2/tests/reproducers/simple/JSToJSet/PaxHeaders.17941/resources0000644000000000000000000000013012654402377023775 xustar0030 mtime=1454507263.241432528 29 atime=1454507658.77815737 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSToJSet/resources/0000755000175000002070000000000012654402377024577 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JSToJSet/resources/PaxHeaders.17941/jstoj-set.jnlp0000644000000000000000000000013012654402377026661 xustar0030 mtime=1454507263.241432528 29 atime=1454507327.31557799 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSToJSet/resources/jstoj-set.jnlp0000644000175000002070000000130212654402377027402 0ustar00jvanekmock00000000000000 JavaScript to Java LiveConnect - Set RedHat LiveConnect - tests for setting members on Java side. icedtea-web-1.6.2/tests/reproducers/simple/JSToJSet/resources/PaxHeaders.17941/JSToJava_Set.js0000644000000000000000000000013012654402377026644 xustar0030 mtime=1454507263.241432528 29 atime=1454507327.31557799 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSToJSet/resources/JSToJava_Set.js0000644000175000002070000000233212654402377027371 0ustar00jvanekmock00000000000000//dummy javascript class whose instance is passed as JSObject parameter: function JSCar(mph, color) { this.mph = mph; this.color = color; } function attemptSetTests() { var decodedUrl = decodeURI(document.URL); var urlArgs = decodedUrl.split("?"); var testParams = urlArgs[1].split(";"); var field = testParams[0]; var value = testParams[1]; if (value === "JavaScript") { if (field === "_char") { value = 97; } if (field === "_Character") { value = new (applet.Packages).java.lang.Character(65); } if (field === "_specialString") { value = "𠁎〒£$ǣ€𝍖"; } if (field === "_JSObject") { value = new JSCar(100, "red"); } } else if (value.indexOf('[') != -1) { var elem = value.substring(1); value = new Array(); value[0] = elem; } eval('applet.' + field + ' = value'); // modifying _intArray[0] into _intArray // _DoubleArray[0] into _DoubleArray var nameEnd = field.indexOf('['); if (nameEnd != -1) { field = field.substring(0, nameEnd); } applet.printNewValueAndFinish(field); } doTest(attemptSetTests, applet); icedtea-web-1.6.2/tests/reproducers/simple/JSToJSet/resources/PaxHeaders.17941/JSToJSet.html0000644000000000000000000000013012654402377026345 xustar0030 mtime=1454507263.241432528 29 atime=1454507327.31557799 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSToJSet/resources/JSToJSet.html0000644000175000002070000000120612654402377027071 0ustar00jvanekmock00000000000000 JavaScript to Java LiveConnect - Set values from applet

The JSToJSet html page

icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/JSToJGet0000644000000000000000000000013012654402377021747 xustar0030 mtime=1454507263.240432541 29 atime=1454507658.77815737 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSToJGet/0000755000175000002070000000000012654402377022551 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JSToJGet/PaxHeaders.17941/testcases0000644000000000000000000000013012654402377023745 xustar0030 mtime=1454507263.240432541 29 atime=1454507658.77815737 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSToJGet/testcases/0000755000175000002070000000000012654402377024547 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JSToJGet/testcases/PaxHeaders.17941/JSToJGetTest.java0000644000000000000000000000013012654402377027116 xustar0030 mtime=1454507263.240432541 29 atime=1454507327.31557799 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSToJGet/testcases/JSToJGetTest.java0000644000175000002070000002360212654402377027646 0ustar00jvanekmock00000000000000/* JSToJGetTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.CountingClosingListener; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.annotations.KnownToFail; import org.junit.Assert; import org.junit.Test; public class JSToJGetTest extends BrowserTest { // the JS<->J tests tend to make Opera unusable public final boolean doNotRunInOpera = false; public String passStr = " - passed."; public String failValStr = " - failed, value mismatch."; public String failTypeStr = " - failed, type mismatch."; public String expStr = "expected:["; public String foundStr = "] found:["; public String endStr = "]."; private final String initStr = "JSToJGet applet initialized."; private final String setupStr = "JSToJGet applet set up for GET tests."; private final String afterStr = "afterTests"; private class CountingClosingListenerImpl extends CountingClosingListener { @Override protected boolean isAlowedToFinish(String s) { return (s.contains(initStr) && s.contains(setupStr) && s.contains(afterStr)); } } private void evaluateStdoutContents(String testStr, ProcessResult pr) { // Assert that the applet was initialized. Assert.assertTrue("JSToJGetTest stdout should contain " + initStr + " but it didnt.", pr.stdout.contains(initStr)); // Assert that the applet was set up for the GM tests. Assert.assertTrue("JSToJGetTest stdout should contain " + setupStr + " but it didnt.", pr.stdout.contains(setupStr)); // Assert that the tests have passed. String s0 = testStr + passStr; String s1 = testStr + failValStr; String s2 = testStr + failTypeStr; int ind0 = pr.stdout.indexOf(s0); int ind1 = pr.stdout.indexOf(s1); int ind2 = pr.stdout.indexOf(s2); int indBegin = pr.stdout.indexOf(setupStr); if (indBegin != -1) { indBegin += setupStr.length(); } else { indBegin = 0; } String failStr = "JSToJGet " + testStr + ": passed not found in the applet stdout."; if (ind1 != -1) { // int inde = pr.stdout.indexOf(expStr); // int indf = pr.stdout.indexOf(foundStr); // int indend = pr.stdout.indexOf(endStr); failStr = "JSToJGet: value mismatch in " + testStr; } if (ind2 != -1) { // int inde = pr.stdout.indexOf(expStr); // int indf = pr.stdout.indexOf(foundStr); // int indend = pr.stdout.indexOf(endStr); failStr = "JSToJGet: type mismatch in " + testStr; } Assert.assertTrue(failStr, (ind1 == -1));// no value mismatch Assert.assertTrue(failStr, (ind2 == -1));// no type mismatch Assert.assertTrue(failStr, (ind0 != -1));// test passed } private void jsToJavaGetTest(String urlEnd, String testStr) throws Exception { if (doNotRunInOpera) { if (server.getCurrentBrowser().getID() == Browsers.opera) { return; } } String strURL = "/JSToJGet.html?" + urlEnd; ProcessResult pr = server.executeBrowser(strURL, new CountingClosingListenerImpl(), new CountingClosingListenerImpl()); evaluateStdoutContents(testStr, pr); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJGet_int_Test() throws Exception { jsToJavaGetTest("int", "Test no. 1 - (int)"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJGet_double_Test() throws Exception { jsToJavaGetTest("double", "Test no. 2 - (double)"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJGet_float_Test() throws Exception { jsToJavaGetTest("float", "Test no. 3 - (float)"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJGet_long_Test() throws Exception { jsToJavaGetTest("long", "Test no. 4 - (long)"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJGet_boolean_Test() throws Exception { jsToJavaGetTest("boolean", "Test no. 5 - (boolean)"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJGet_char_Test() throws Exception { jsToJavaGetTest("char", "Test no. 6 - (char)"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJGet_byte_Test() throws Exception { jsToJavaGetTest("byte", "Test no. 7 - (byte)"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay @KnownToFail public void AppletJSToJGet_intArrayElement_Test() throws Exception { jsToJavaGetTest("intArrayElement", "Test no. 8 - (int[] - element access)"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJGet_intArrayBeyond_Test() throws Exception { jsToJavaGetTest("intArrayBeyond", "Test no. 9 - (int[] - beyond length)"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJGet_regularString_Test() throws Exception { jsToJavaGetTest("regularString", "Test no.10 - (regular string)"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJGet_specialCharsString_Test() throws Exception { jsToJavaGetTest("specialCharsString", "Test no.11 - (string with special characters)"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJGet_null_Test() throws Exception { jsToJavaGetTest("null", "Test no.12 - (null)"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay @KnownToFail public void AppletJSToJGet_Integer_Test() throws Exception { jsToJavaGetTest("Integer", "Test no.13 - (Integer)"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay @KnownToFail public void AppletJSToJGet_Double_Test() throws Exception { jsToJavaGetTest("Double", "Test no.14 - (Double)"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay @KnownToFail public void AppletJSToJGet_Float_Test() throws Exception { jsToJavaGetTest("Float", "Test no.15 - (Float)"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay @KnownToFail public void AppletJSToJGet_Long_Test() throws Exception { jsToJavaGetTest("Long", "Test no.16 - (Long)"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay @KnownToFail public void AppletJSToJGet_Boolean_Test() throws Exception { jsToJavaGetTest("Boolean", "Test no.17 - (Boolean)"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay @KnownToFail public void AppletJSToJGet_Character_Test() throws Exception { jsToJavaGetTest("Character", "Test no.18 - (Character)"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay @KnownToFail public void AppletJSToJGet_Byte_Test() throws Exception { jsToJavaGetTest("Byte", "Test no.19 - (Byte)"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay @KnownToFail public void AppletJSToJGet_DoubleArrayElement_Test() throws Exception { jsToJavaGetTest("DoubleArrayElement", "Test no.20 - (Double[] - element access)"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay @KnownToFail public void AppletJSToJGet_DoubleFullArray_Test() throws Exception { jsToJavaGetTest("DoubleFullArray", "Test no.21 - (Double[] - full array)"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJGet_JSObject_Test() throws Exception { jsToJavaGetTest("JSObject", "Test no.22 - (JSObject)"); } } icedtea-web-1.6.2/tests/reproducers/simple/JSToJGet/PaxHeaders.17941/srcs0000644000000000000000000000013012654402377022721 xustar0030 mtime=1454507263.240432541 29 atime=1454507658.77815737 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSToJGet/srcs/0000755000175000002070000000000012654402377023523 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JSToJGet/srcs/PaxHeaders.17941/JSToJGet.java0000644000000000000000000000013012654402377025232 xustar0030 mtime=1454507263.240432541 29 atime=1454507327.31557799 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSToJGet/srcs/JSToJGet.java0000644000175000002070000000466712654402377025774 0ustar00jvanekmock00000000000000import java.applet.Applet; import java.awt.Label; import java.awt.BorderLayout; import netscape.javascript.JSObject; public class JSToJGet extends Applet { public static final int i = 42; public static final double d = 42.42; public static final float f = 42.1F; public static final long l = 4294967296L; public static final boolean b = true; public static final char c = '\u2323'; public static final byte by = 43; public static final String rs = "I'm a string!"; public static final String ss = "𠁎〒£$ǣ€𝍖"; public static final Object n = null; public int[] ia = new int[5]; public static final Integer I = 24; public static final Double D = 24.24; public static final Float F = 24.124F; public static final Long L = 6927694924L; public static final Boolean B = false; public static final Character C = '\u1526'; public static final Byte By = 34; public Double[] Da1 = new Double[10]; public Double[] Da2 = null; public char[] ca = new char[3]; public Character[] Ca = new Character[3]; public JSObject jso; private boolean objectReady = false; private Label statusLabel; public void start() { JSObject win = JSObject.getWindow(this); jso = (JSObject) win.getMember("document"); System.out.println("Document JSObject: " + jso.toString()); jso.setMember("key1", "value1"); ia[4] = 1024; Da1[9] = D; String setupStr = "JSToJGet applet set up for GET tests."; System.out.println(setupStr); statusLabel.setText(setupStr); objectReady = true; } public void init() { setLayout(new BorderLayout()); statusLabel = new Label(); add(statusLabel); String initStr = "JSToJGet applet initialized."; System.out.println(initStr); statusLabel.setText(initStr); } // auxiliary method for setting the statusLabel text: public void setStatusLabel(String s) { statusLabel.setText(s); } public boolean Ready() { return objectReady; } // auxiliary methods for writing to stdout and stderr: public void stdOutWrite(String s) { System.out.print(s); } public void stdErrWrite(String s) { System.err.print(s); } public void stdOutWriteln(String s) { System.out.println(s); } public void stdErrWriteln(String s) { System.err.println(s); } } icedtea-web-1.6.2/tests/reproducers/simple/JSToJGet/PaxHeaders.17941/resources0000644000000000000000000000013012654402377023761 xustar0030 mtime=1454507263.240432541 29 atime=1454507658.77815737 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSToJGet/resources/0000755000175000002070000000000012654402377024563 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JSToJGet/resources/PaxHeaders.17941/jstoj-get.jnlp0000644000000000000000000000013012654402377026631 xustar0030 mtime=1454507263.240432541 29 atime=1454507327.31557799 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSToJGet/resources/jstoj-get.jnlp0000644000175000002070000000130412654402377027354 0ustar00jvanekmock00000000000000 JavaScript to Java LiveConnect - Get RedHat LiveConnect - tests for getting members from Java side. icedtea-web-1.6.2/tests/reproducers/simple/JSToJGet/resources/PaxHeaders.17941/JSToJava_Get.js0000644000000000000000000000013012654402377026614 xustar0030 mtime=1454507263.239432554 29 atime=1454507327.31557799 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSToJGet/resources/JSToJava_Get.js0000644000175000002070000002061212654402377027342 0ustar00jvanekmock00000000000000function test_get_int() { try { var i = document.getElementById("applet").i; check(i, 42, "number", " 1 - (int)", applet); } catch (e) { appletStdOut(applet, e); appendMessageDiv(e); } } function test_get_double() { try { var d = document.getElementById("applet").d; check(d, 42.42, "number", " 2 - (double)", applet); } catch (e) { appletStdOut(applet, e); appendMessageDiv(e); } } function test_get_float() { try { var f = document.getElementById("applet").f; check(f, 42.099998474121094, "number", " 3 - (float)", applet); } catch (e) { appletStdOut(applet, e); appendMessageDiv(e); } } function test_get_long() { try { var l = document.getElementById("applet").l; check(l, 4294967296, "number", " 4 - (long)", applet); } catch (e) { appletStdOut(applet, e); appendMessageDiv(e); } } function test_get_boolean() { try { var b = document.getElementById("applet").b; check(b, true, "boolean", " 5 - (boolean)", applet); } catch (e) { appletStdOut(applet, e); appendMessageDiv(e); } } function test_get_char() { try { var c = document.getElementById("applet").c; check(c, 8995, "number", " 6 - (char)", applet); } catch (e) { appletStdOut(applet, e); appendMessageDiv(e); } } function test_get_byte() { try { var by = document.getElementById("applet").by; check(by, 43, "number", " 7 - (byte)", applet); } catch (e) { appletStdOut(applet, e); appendMessageDiv(e); } } function test_get_intArrayElement() { try { var ia = document.getElementById("applet").ia[4]; check(ia, 1024, "number", " 8 - (int[] - element access)", applet); } catch (e) { appletStdOut(applet, e); appendMessageDiv(e); } } function test_get_intArrayBeyond() { try { var ia2 = document.getElementById("applet").ia[30]; check(ia2, null, "undefined", " 9 - (int[] - beyond length)", applet); } catch (e) { appletStdOut(applet, e); appendMessageDiv(e); } } function test_get_regularString() { try { var rs = document.getElementById("applet").rs; check(rs, "I'm a string!", "string", "10 - (regular string)", applet); } catch (e) { appletStdOut(applet, e); appendMessageDiv(e); } } function test_get_specialCharsString() { try { var ss = document.getElementById("applet").ss; check(ss, "𠁎〒£$ǣ€𝍖", "string", "11 - (string with special characters)", applet); } catch (e) { appletStdOut(applet, e); appendMessageDiv(e); } } function test_get_null() { try { var n = document.getElementById("applet").n; check(n, null, "object", "12 - (null)", applet); } catch (e) { appletStdOut(applet, e); appendMessageDiv(e); } } function test_get_Integer() { try { var I = document.getElementById("applet").I; check(I, 24, "object", "13 - (Integer)", applet); } catch (e) { appletStdOut(applet, e); appendMessageDiv(e); } } function test_get_Double() { try { var D = document.getElementById("applet").D; check(D, 24.24, "object", "14 - (Double)", applet); } catch (e) { appletStdOut(applet, e); appendMessageDiv(e); } } function test_get_Float() { try { var F = document.getElementById("applet").F; check(F, 24.124, "object", "15 - (Float)", applet); } catch (e) { appletStdOut(applet, e); appendMessageDiv(e); } } function test_get_Long() { try { var L = document.getElementById("applet").L; check(L, 6927694924, "object", "16 - (Long)", applet); } catch (e) { appletStdOut(applet, e); appendMessageDiv(e); } } function test_get_Boolean() { try { var B = document.getElementById("applet").B; check(B, false, "object", "17 - (Boolean)", applet); } catch (e) { appletStdOut(applet, e); appendMessageDiv(e); } } function test_get_Character() { try { var C = document.getElementById("applet").C; check(C, 'ᔦ', "object", "18 - (Character)", applet); } catch (e) { appletStdOut(applet, e); appendMessageDiv(e); } } function test_get_Byte() { try { var By = document.getElementById("applet").By; check(By, 34, "object", "19 - (Byte)", applet); } catch (e) { appletStdOut(applet, e); appendMessageDiv(e); } } function test_get_DoubleArrayElement() { try { var DaE = document.getElementById("applet").Da1[9]; check(DaE, 24.24, "object", "20 - (Double[] - element access)", applet); } catch (e) { appletStdOut(applet, e); appendMessageDiv(e); } } function test_get_DoubleFullArray() { try { var DaStr = applet.Da1.toString().substr(0, 20); var Da = applet.Da1; var testid = "21 - (Double[] - full array)"; var expected = "[Ljava.lang.Double;@"; var expectedtype = "object"; if (DaStr == expected) { // the same value if (typeof (Da) == expectedtype) { // the same type passTest(testid, applet); } else { failTypeTest(testid, applet, typeof (Da), expectedtype); } } else { failValTest(testid, applet, DaStr, expected); } } catch (e) { appletStdOut(applet, e); appendMessageDiv(e); } } function test_get_JSObject() { try { var javao = new Object(applet.jso); check(javao.key1, "value1", "string", "22 - (JSObject)", applet); } catch (e) { appletStdOut(applet, e); appendMessageDiv(e); } } function attemptGetTests() { if (applet.Ready()) { var urlArgs = document.URL.split("?"); var testid = urlArgs[1]; if (testid != null) { applet.setStatusLabel(testid); appendMessageDiv(testid + "... "); } else { applet.setStatusLabel("url without ?"); appendMessageDiv("no url arguments..."); } switch (testid) { case "int": test_get_int(); break; case "double": test_get_double(); break; case "float": test_get_float(); break; case "long": test_get_long(); break; case "boolean": test_get_boolean(); break; case "char": test_get_char(); break; case "byte": test_get_byte(); break; case "intArrayElement": test_get_intArrayElement(); break; case "intArrayBeyond": test_get_intArrayBeyond(); break; case "regularString": test_get_regularString(); break; case "specialCharsString": test_get_specialCharsString(); break; case "null": test_get_null(); break; case "Integer": test_get_Integer(); break; case "Double": test_get_Double(); break; case "Float": test_get_Float(); break; case "Long": test_get_Long(); break; case "Boolean": test_get_Boolean(); break; case "Character": test_get_Character(); break; case "Byte": test_get_Byte(); break; case "DoubleArrayElement": test_get_DoubleArrayElement(); break; case "DoubleFullArray": test_get_DoubleFullArray(); break; case "JSObject": test_get_JSObject(); break; default: appletStdOutLn('applet', "No argument in URL! Should be e.g. JSToJGet.html?int"); document .getElementById('applet') .setStatusLabel( "Not a valid argument in URL! Should be e.g. JSToJGet.html?int"); break; } afterTestsMessage('applet'); } else { setTimeout(attemptGetTests, 100); } } doTest(attemptGetTests, applet); icedtea-web-1.6.2/tests/reproducers/simple/JSToJGet/resources/PaxHeaders.17941/JSToJ_auxiliary.js0000644000000000000000000000013012654402377027414 xustar0030 mtime=1454507263.239432554 29 atime=1454507327.31557799 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSToJGet/resources/JSToJ_auxiliary.js0000644000175000002070000000337212654402377030146 0ustar00jvanekmock00000000000000/* JSToJ_auxiliary.js This file contains auxiliary JavaScript functions for LiveConnect tests output it is used by JSToJGet reproducer. */ function check(actual, expected, expectedtype, testid, appletName ) { if (actual == expected) { //the same value if (typeof(actual) == expectedtype) { //the same type passTest( testid, appletName ); } else { failTypeTest( testid, appletName, actual, expectedtype ); } } else { failValTest( testid, appletName, actual, expected ); } } function passTest( testid, appletName ){ var passStr = "Test no."+testid+" - passed."; //applet stdout appletStdOut( appletName, passStr); //html page appendMessageDiv(passStr); } function failValTest( testid, appletName, actual, expected ){ var failValStr = "Test no."+testid+" - failed, value mismatch. expected:["+expected+"] found:["+actual+"]."; //applet stdout appletStdOut( appletName, failValStr); //html page appendMessageDiv(failValStr); } function failTypeTest( testid, appletName, actual, expectedtype ){ var failTypeStr = "Test no."+testid+" - failed, type mismatch. expected:["+expectedtype+"] found:["+typeof(actual)+"]."; //applet stdout appletStdOutLn( appletName, failTypeStr); //html page appendMessageDiv(failTypeStr); } function appletStdOut( appletName, str ){ appletName.stdOutWrite( str ); } function appletStdOutLn( appletName, str ){ appletName.stdOutWriteln( str ); } function afterTestsMessage( appletName ){ appletName.stdOutWriteln("afterTests"); } function appendMessageDiv( message ){ var messageDiv = document.getElementById( 'messageDiv' ); messageDiv.appendChild( document.createTextNode(message) ); } icedtea-web-1.6.2/tests/reproducers/simple/JSToJGet/resources/PaxHeaders.17941/JSToJGet.html0000644000000000000000000000013112654402377026316 xustar0030 mtime=1454507263.239432554 30 atime=1454507327.314578003 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSToJGet/resources/JSToJGet.html0000644000175000002070000000124612654402377027045 0ustar00jvanekmock00000000000000 JavaScript to Java LiveConnect - Get values from applet

The JSToJGet html page

icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/JSToJFuncReturn0000644000000000000000000000013012654402377023323 xustar0030 mtime=1454507263.238432568 29 atime=1454507658.77815737 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSToJFuncReturn/0000755000175000002070000000000012654402377024125 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JSToJFuncReturn/PaxHeaders.17941/testcases0000644000000000000000000000013012654402377025321 xustar0030 mtime=1454507263.238432568 29 atime=1454507658.77815737 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSToJFuncReturn/testcases/0000755000175000002070000000000012654402377026123 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JSToJFuncReturn/testcases/PaxHeaders.17941/JSToJFuncRetur0000644000000000000000000000013112654402377030111 xustar0030 mtime=1454507263.238432568 30 atime=1454507327.314578003 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSToJFuncReturn/testcases/JSToJFuncReturnTest.java0000644000175000002070000002031212654402377032571 0ustar00jvanekmock00000000000000/* JSToJFuncReturnTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.CountingClosingListener; import net.sourceforge.jnlp.annotations.KnownToFail; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import org.junit.Assert; import org.junit.Test; public class JSToJFuncReturnTest extends BrowserTest { private final String initStr = "JSToJFuncReturn applet initialized."; private final String afterStr = "afterTests"; private class CountingClosingListenerImpl extends CountingClosingListener { @Override protected boolean isAlowedToFinish(String s) { return (s.contains(initStr) && s.contains(afterStr)); } } private void evaluateStdoutContents(String expectedStdout, ProcessResult pr) { // Assert that the applet was initialized. Assert.assertTrue("JSToJFuncReturnTest stdout should contain " + initStr + " but it didnt.", pr.stdout.contains(initStr)); // Assert that the tests have passed. Assert.assertTrue("JSToJFuncReturnTest stdout should contain " + expectedStdout + " but it didnt.", pr.stdout.contains(expectedStdout)); } private void jsToJavaFuncReturnNormalTest(String methodStr, String expectedStdout) throws Exception { String strURL = "/JSToJFuncReturn.html?" + methodStr; ProcessResult pr = server.executeBrowser(strURL, new CountingClosingListenerImpl(), new CountingClosingListenerImpl()); evaluateStdoutContents(expectedStdout, pr); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncReturn_int_Test() throws Exception { jsToJavaFuncReturnNormalTest("_int", "number 1"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncReturn_double_Test() throws Exception { jsToJavaFuncReturnNormalTest("_double", "number 1.1"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncReturn_float_Test() throws Exception { jsToJavaFuncReturnNormalTest("_float", "number 1.1"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncReturn_long_Test() throws Exception { jsToJavaFuncReturnNormalTest("_long", "number 10000"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncReturn_boolean_Test() throws Exception { jsToJavaFuncReturnNormalTest("_boolean", "boolean true"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncReturn_char_Test() throws Exception { jsToJavaFuncReturnNormalTest("_char", "number 97"); // 'a' } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncReturn_byte_Test() throws Exception { jsToJavaFuncReturnNormalTest("_byte", "number 10"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncReturn_charArrayElement_Test() throws Exception { jsToJavaFuncReturnNormalTest("_charArrayElement", "number 97"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncReturn_void_Test() throws Exception { jsToJavaFuncReturnNormalTest("_void", "undefined undefined"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncReturn_regularString_Test() throws Exception { jsToJavaFuncReturnNormalTest("_regularString", "string test"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncReturn_specialCharsString_Test() throws Exception { jsToJavaFuncReturnNormalTest("_specialString", "string 𠁎〒£$ǣ€𝍖"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncReturn_null_Test() throws Exception { jsToJavaFuncReturnNormalTest("_null", "object null"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay @KnownToFail public void AppletJSToJFuncReturn_Integer_Test() throws Exception { jsToJavaFuncReturnNormalTest("_Integer", "object 1"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay @KnownToFail public void AppletJSToJFuncReturn_Double_Test() throws Exception { jsToJavaFuncReturnNormalTest("_Double", "object 1.1"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay @KnownToFail public void AppletJSToJFuncReturn_Float_Test() throws Exception { jsToJavaFuncReturnNormalTest("_Float", "object 1.1"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay @KnownToFail public void AppletJSToJFuncReturn_Long_Test() throws Exception { jsToJavaFuncReturnNormalTest("_Long", "object 10000"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay @KnownToFail public void AppletJSToJFuncReturn_Boolean_Test() throws Exception { jsToJavaFuncReturnNormalTest("_Boolean", "object true"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay @KnownToFail public void AppletJSToJFuncReturn_Character_Test() throws Exception { jsToJavaFuncReturnNormalTest("_Character", "object A"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay @KnownToFail public void AppletJSToJFuncReturn_Byte_Test() throws Exception { jsToJavaFuncReturnNormalTest("_Byte", "object 10"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay @KnownToFail public void AppletJSToJFuncReturn_CharArrayElement_Test() throws Exception { jsToJavaFuncReturnNormalTest("_CharacterArrayElement", "object A"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay @KnownToFail public void AppletJSToJFuncReturn_CharFullArray_Test() throws Exception { jsToJavaFuncReturnNormalTest("_CharacterArray", "object [Ljava.lang.Character;@"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncReturn_JSObject_Test() throws Exception { jsToJavaFuncReturnNormalTest("_JSObject", "object value1"); } } icedtea-web-1.6.2/tests/reproducers/simple/JSToJFuncReturn/PaxHeaders.17941/srcs0000644000000000000000000000013012654402377024275 xustar0030 mtime=1454507263.238432568 29 atime=1454507658.77815737 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSToJFuncReturn/srcs/0000755000175000002070000000000012654402377025077 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JSToJFuncReturn/srcs/PaxHeaders.17941/JSToJFuncReturn.jav0000644000000000000000000000013112654402377030022 xustar0030 mtime=1454507263.238432568 30 atime=1454507327.314578003 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSToJFuncReturn/srcs/JSToJFuncReturn.java0000644000175000002070000000517412654402377030716 0ustar00jvanekmock00000000000000import java.applet.Applet; import java.awt.Label; import java.awt.BorderLayout; import netscape.javascript.JSObject; public class JSToJFuncReturn extends Applet { private Label statusLabel; public int _int() { int i = 1; return i; } public double _double() { double d = 1.1; return d; } public float _float() { float f = 1.1F; return f; } public long _long() { long l = 10000L; return l; } public boolean _boolean() { boolean b = true; return b; } public char _char() { char c = 'a'; return c; } public byte _byte() { byte by = 10; return by; } public char _charArrayElement() { char[] ca = new char[] { 'a', 'b', 'c' }; return ca[0]; } public char[] _charArray() { char[] ca = new char[] { 'a', 'b', 'c' }; return ca; } public String _regularString() { String rs = "test"; return rs; } public String _specialString() { String ss = "𠁎〒£$ǣ€𝍖"; return ss; } public void _void() { } public Object _null() { return null; } public Integer _Integer() { Integer I = 1; return I; } public Double _Double() { Double D = 1.1; return D; } public Float _Float() { Float F = 1.1F; return F; } public Long _Long() { Long L = 10000L; return L; } public Boolean _Boolean() { Boolean B = true; return B; } public Character _CharacterArrayElement() { Character[] Ca = new Character[] { 'A', 'B', 'C' }; return Ca[0]; } public Character _Character() { Character C = 'A'; return C; } public Byte _Byte() { Byte By = 10; return By; } public Character[] _CharacterArray() { Character[] Ca = new Character[] { 'A', 'B', 'C' }; return Ca; } public JSObject _JSObject() { JSObject win = JSObject.getWindow(this); JSObject jso = (JSObject) win.getMember("document"); jso.setMember("key1", "value1"); return jso; } public void init() { setLayout(new BorderLayout()); statusLabel = new Label(); add(statusLabel); String initStr = "JSToJFuncReturn applet initialized."; System.out.println(initStr); statusLabel.setText(initStr); } public void printStringAndFinish(String str) { System.out.println(str); System.out.println("afterTests"); } } icedtea-web-1.6.2/tests/reproducers/simple/JSToJFuncReturn/PaxHeaders.17941/resources0000644000000000000000000000013012654402377025335 xustar0030 mtime=1454507263.238432568 29 atime=1454507658.77815737 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSToJFuncReturn/resources/0000755000175000002070000000000012654402377026137 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JSToJFuncReturn/resources/PaxHeaders.17941/jstoj-funcretu0000644000000000000000000000013112654402377030320 xustar0030 mtime=1454507263.238432568 30 atime=1454507327.314578003 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSToJFuncReturn/resources/jstoj-funcreturn.jnlp0000644000175000002070000000140412654402377032345 0ustar00jvanekmock00000000000000 JavaScript to Java LiveConnect - FuncReturn RedHat LiveConnect - tests to process various return types from Java side function calls. icedtea-web-1.6.2/tests/reproducers/simple/JSToJFuncReturn/resources/PaxHeaders.17941/JSToJava_FuncR0000644000000000000000000000013112654402377030054 xustar0030 mtime=1454507263.237432581 30 atime=1454507327.314578003 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSToJFuncReturn/resources/JSToJava_FuncReturn.js0000644000175000002070000000070712654402377032275 0ustar00jvanekmock00000000000000function attemptFuncReturnTests() { var urlArgs = document.URL.split("?"); var method = urlArgs[1]; eval('var value = applet.' + method + '()'); var checked_string = typeof (value) + ' '; if (method === '_JSObject') { checked_string = checked_string + value.key1; } else { checked_string = checked_string + value; } applet.printStringAndFinish(checked_string); } doTest(attemptFuncReturnTests, applet);icedtea-web-1.6.2/tests/reproducers/simple/JSToJFuncReturn/resources/PaxHeaders.17941/JSToJFuncRetur0000644000000000000000000000013112654402377030125 xustar0030 mtime=1454507263.237432581 30 atime=1454507327.314578003 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSToJFuncReturn/resources/JSToJFuncReturn.html0000644000175000002070000000122112654402377031766 0ustar00jvanekmock00000000000000 JavaScript to Java LiveConnect - Function return values from applet

The JSToJFuncReturn html page

icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/JSToJFuncResol0000644000000000000000000000013012654402377023130 xustar0030 mtime=1454507263.237432581 29 atime=1454507658.77815737 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSToJFuncResol/0000755000175000002070000000000012654402377023732 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JSToJFuncResol/PaxHeaders.17941/testcases0000644000000000000000000000013012654402377025126 xustar0030 mtime=1454507263.237432581 29 atime=1454507658.77815737 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSToJFuncResol/testcases/0000755000175000002070000000000012654402377025730 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JSToJFuncResol/testcases/PaxHeaders.17941/JSToJFuncResolT0000644000000000000000000000013112654402377030025 xustar0030 mtime=1454507263.237432581 30 atime=1454507327.314578003 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSToJFuncResol/testcases/JSToJFuncResolTest.java0000644000175000002070000001742112654402377032212 0ustar00jvanekmock00000000000000/* JSToJFuncResolTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.CountingClosingListener; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.annotations.KnownToFail; import org.junit.Assert; import org.junit.Test; public class JSToJFuncResolTest extends BrowserTest { private final String initStr = "JSToJFuncResol applet initialized."; private final String afterStr = "afterTests"; private class CountingClosingListenerImpl extends CountingClosingListener { @Override protected boolean isAlowedToFinish(String s) { return (s.contains(initStr) && s.contains(afterStr)); } } private void evaluateStdoutContents(String expectedStdout, ProcessResult pr) { // Assert that the applet was initialized. Assert.assertTrue("JSToJFuncResol: the stdout should contain " + initStr + ", but it didnt.", pr.stdout.contains(initStr)); // Assert that the values set by JavaScript are ok Assert.assertTrue("JSToJFuncResol: the output should include: " + expectedStdout + ", but it didnt.", (pr.stderr.contains(expectedStdout) || pr.stdout.contains(expectedStdout))); } private void jsToJavaFuncResolTest(String methodStr, String valueStr, String expectedStdout) throws Exception { String strURL = "/JSToJFuncResol.html?" + methodStr + ";" + valueStr; ProcessResult pr = server.executeBrowser(strURL, new CountingClosingListenerImpl(), new CountingClosingListenerImpl()); evaluateStdoutContents(expectedStdout, pr); } /****** Primitive (numeric) value resolutions ******/ @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncResol_numeric_Test() throws Exception { jsToJavaFuncResolTest("numeric", "1", "numeric(int) with 1"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncResol_numericToDifferentNumeric_Test() throws Exception { jsToJavaFuncResolTest("numericToDifferentNumeric", "1.1", "numericToDifferentNumeric(double) with 1.1"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncResol_numericToDouble_Test() throws Exception { jsToJavaFuncResolTest("numericToDouble", "1.1", "numericToDouble(double) with 1.1"); } /****** Null resolutions ******/ @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncResol_nullToInteger_Test() throws Exception { jsToJavaFuncResolTest("nullToInteger", "null", "nullToInteger(Integer) with null"); } /****** Java inherited class resolutions ******/ @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncResol_inheritedClass_Test() throws Exception { jsToJavaFuncResolTest("inheritedClass", "applet.getNewOverloadTestHelper2()", "inheritedClass(OverloadTestHelper2) with JSToJFuncResol$OverloadTestHelper2@"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncResol_inheritedClassToParent1_Test() throws Exception { jsToJavaFuncResolTest("inheritedClassToParent1", "applet.getNewOverloadTestHelper3()", "inheritedClassToParent1(OverloadTestHelper2) with JSToJFuncResol$OverloadTestHelper3@"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncResol_inheritedClassToParent2_Test() throws Exception { jsToJavaFuncResolTest("inheritedClassToParent2", "applet.getNewOverloadTestHelper2()", "inheritedClassToParent2(OverloadTestHelper1) with JSToJFuncResol$OverloadTestHelper2@"); } /****** Java object resolutions ******/ @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncResol_javaObjectToString_Test() throws Exception { jsToJavaFuncResolTest("javaObjectToString", "applet.getNewOverloadTestHelper1()", "javaObjectToString(String) with JSToJFuncResol$OverloadTestHelper1@"); } /****** String resolutions ******/ @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncResol_javascriptStringToNumeric_Test() throws Exception { jsToJavaFuncResolTest("javascriptStringToNumeric", "\"1.1\"", "javascriptStringToNumeric(double) with 1.1"); } /****** Javascript object resolutions ******/ @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncResol_javascriptObject_Test() throws Exception { jsToJavaFuncResolTest("javascriptObject", "window", "javascriptObject(JSObject) with [object Window]"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncResol_javascriptObjectToArray_Test() throws Exception { jsToJavaFuncResolTest("javascriptObjectToArray", "[10]", "javascriptObjectToArray(int[]) with [I@"); } /****** The unsupported resolutions: *****/ @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncResol_nullToPrimitive_Test() throws Exception { jsToJavaFuncResolTest("nullToPrimitive", "null", "Error on Java side: No suitable method named nullToPrimitive with matching args found"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncResol_javascriptObjectToUnrelatedType_Test() throws Exception { jsToJavaFuncResolTest("javascriptObjectToUnrelatedType", "window", "Error on Java side: No suitable method named javascriptObjectToUnrelatedType with matching args found"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncResol_unsupported_Test() throws Exception { jsToJavaFuncResolTest("unsupported", "25", "Error on Java side: No suitable method named unsupported with matching args found"); } } icedtea-web-1.6.2/tests/reproducers/simple/JSToJFuncResol/PaxHeaders.17941/srcs0000644000000000000000000000013012654402377024102 xustar0030 mtime=1454507263.237432581 29 atime=1454507658.77815737 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSToJFuncResol/srcs/0000755000175000002070000000000012654402377024704 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JSToJFuncResol/srcs/PaxHeaders.17941/JSToJFuncResol.java0000644000000000000000000000013112654402377027575 xustar0030 mtime=1454507263.237432581 30 atime=1454507327.313578016 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSToJFuncResol/srcs/JSToJFuncResol.java0000644000175000002070000001716212654402377030330 0ustar00jvanekmock00000000000000import java.applet.Applet; import netscape.javascript.JSObject; public class JSToJFuncResol extends Applet { /****** Primitive (numeric) value resolutions ******/ /* * Javascript primitive numeric (int) value resolutions: - to an analogous * primitive Java type (best - lowest cost) - to another primitive numeric * Java type (long) (second lowest) - to Java String type (third lowest) */ public void numeric(int p) { System.out.println("numeric(int) with " + p); } public void numeric(long p) { System.out.println("numeric(long) with " + p); } public void numeric(String p) { System.out.println("numeric(String) with " + p); } /* * Javascript primitive numeric (int) value resolutions: - to a different * primitive Java numeric type (double) (best - second lowest cost) - to * Java string (third lowest cost) */ public void numericToDifferentNumeric(double p) { System.out.println("numericToDifferentNumeric(double) with " + p); } public void numericToDifferentNumeric(String p) { System.out.println("numericToDifferentNumeric(String) with " + p); } /* * Javascript primitive numeric (floating point) value resolutions: - to a * primitive Java numeric type (double) (best - lowest cost) - to Java char */ public void numericToDouble(double p) { System.out.println("numericToDouble(double) with " + p); } public void numericToDouble(char p) { System.out.println("numericToDouble(char) with " + p); } /****** Null resolutions ******/ /* * Javascript null value resolutions: - to any nonprimitive Java type (e.g. * Integer) (best) - to a primitive Java type (int) (not allowed) */ public void nullToInteger(Integer p) { System.out.println("nullToInteger(Integer) with " + p); } public void nullToInteger(int p) { System.out.println("nullToInteger(int) with " + p); } /****** Java inherited class resolutions ******/ /* * Java inherited class (OverloadTestHelper2) value resolutions: - to the * same class type (OverloadTestHelper2) (best) - to a superclass * (OverloadTestHelper1) (second best) - to a subclass (OverloadTestHelper3) * (not possible) */ public void inheritedClass(OverloadTestHelper2 p) { System.out.println("inheritedClass(OverloadTestHelper2) with " + p); } public void inheritedClass(OverloadTestHelper1 p) { System.out.println("inheritedClass(OverloadTestHelper1) with " + p); } public void inheritedClass(OverloadTestHelper3 p) { System.out.println("inheritedClass(OverloadTestHelper3) with " + p); } /* * Java inherited class (OverloadTestHelper3) value resolutions: - to a * superclass (OverloadTestHelper2) (best - second lowest cost) - to a * superclass of superclass (OverloadTestHelper1) (higher cost) */ public void inheritedClassToParent1(OverloadTestHelper2 p) { System.out.println("inheritedClassToParent1(OverloadTestHelper2) with " + p); } public void inheritedClassToParent1(OverloadTestHelper1 p) { System.out.println("inheritedClassToParent1(OverloadTestHelper1) with " + p); } /* * Java inherited class (OverloadTestHelper2) resolutions: - to the * superclass (OverloadTestHelper1) (best - second lowest cost) - to Java * String (third lowest cost) */ public void inheritedClassToParent2(OverloadTestHelper1 p) { System.out.println("inheritedClassToParent2(OverloadTestHelper1) with " + p); } public void inheritedClassToParent2(String p) { System.out.println("inheritedClassToParent2(String) with " + p); } /****** Java object resolutions ******/ /* * Java object (OverloadTestHelper1) value resolutions: - to Java String * (best - third lowest cost) - to a different nonprimitive Java class * (JSObject) (not possible) */ public void javaObjectToString(String p) { System.out.println("javaObjectToString(String) with " + p); } public void javaObjectToString(JSObject p) { System.out.println("javaObjectToString(JSObject) with " + p); } /****** String resolutions ******/ /* * Javascript string value resolutions: - to a primitive numeric Java type * (double) (best - second lowest cost) - to a nonprimitive Java class * (OverloadTestHelper1 as a dummy)(not possible) */ public void javascriptStringToNumeric(double p) { System.out.println("javascriptStringToNumeric(double) with " + p); } public void javascriptStringToNumeric(OverloadTestHelper1 p) { System.out.println("javascriptStringToNumeric(OverloadTestHelper1) with " + p); } /****** Javascript object resolutions ******/ /* * Javascript object value resolutions: - to JSObject Java type (best - * lowest cost) - to Java String type (fourth lowest cost) - to Java array * of Strings (fourth lowest cost) - to a Java superclass (Object) (second * lowest cost) */ public void javascriptObject(JSObject p) { System.out.println("javascriptObject(JSObject) with " + p); } public void javascriptObject(String p) { System.out.println("javascriptObject(String) with " + p); } public void javascriptObject(String[] p) { System.out.println("javascriptObject(String[]) with " + p); } public void javascriptObject(Object p) { System.out.println("javascriptObject(Object) with " + p); } /* * Javascript object (array) value resolutions: - to a Java array of * primitive numeric Java type (int[]) (best - fourth lowest cost) - to a * nonprimitive Java class Integer (impossible) */ public void javascriptObjectToArray(int[] p) { System.out.println("javascriptObjectToArray(int[]) with " + p); } public void javascriptObjectToArray(Integer p) { System.out.println("javascriptObjectToArray(Integer) with " + p); } /****** Not allowed resolutions *******/ /* * Impossible resolutions all should result in * "Error on Java side: No suitable method named ... with matching args found" * - null to a primitive numeric Java type (int) - JSObject (window) to a * different nonprimitive Java class (OverloadTestHelper1) - non-array value * (numeric primitive 25) to array */ public void nullToPrimitive(int p) { System.out.println("nullToPrimitive(int) with " + p); } public void javascriptObjectToUnrelatedType(OverloadTestHelper1 p) { System.out.println("javascriptObjectToUnrelatedType(OverloadTesthelper1) with " + p); } public void unsupported(Object[] p) { System.out.println("unsupported(Object[]) with " + p); } /****** Auxiliary methods and classes ******/ public void init() { String initStr = "JSToJFuncResol applet initialized."; System.out.println(initStr); } public void writeAfterTests() { System.out.println("afterTests"); } // dummy classes for passing objects as function parameters public class OverloadTestHelper1 { }; public class OverloadTestHelper2 extends OverloadTestHelper1 { }; public class OverloadTestHelper3 extends OverloadTestHelper2 { }; public OverloadTestHelper1 getNewOverloadTestHelper1() { return new OverloadTestHelper1(); } public OverloadTestHelper2 getNewOverloadTestHelper2() { return new OverloadTestHelper2(); } public OverloadTestHelper3 getNewOverloadTestHelper3() { return new OverloadTestHelper3(); } } icedtea-web-1.6.2/tests/reproducers/simple/JSToJFuncResol/PaxHeaders.17941/resources0000644000000000000000000000013012654402377025142 xustar0030 mtime=1454507263.236432594 29 atime=1454507658.77815737 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSToJFuncResol/resources/0000755000175000002070000000000012654402377025744 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JSToJFuncResol/resources/PaxHeaders.17941/jstoj-funcresol0000644000000000000000000000013112654402377030272 xustar0030 mtime=1454507263.236432594 30 atime=1454507327.313578016 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSToJFuncResol/resources/jstoj-funcresol.jnlp0000644000175000002070000000141012654402377031754 0ustar00jvanekmock00000000000000 JavaScript to Java LiveConnect - FuncResol IcedTea LiveConnect - tests for overloaded function resolution when calling Java functions from JS. icedtea-web-1.6.2/tests/reproducers/simple/JSToJFuncResol/resources/PaxHeaders.17941/JSToJava_FuncRe0000644000000000000000000000013112654402377030026 xustar0030 mtime=1454507263.236432594 30 atime=1454507327.313578016 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSToJFuncResol/resources/JSToJava_FuncResol.js0000644000175000002070000000050312654402377031701 0ustar00jvanekmock00000000000000function attemptFuncResolTests() { var urlArgs = document.URL.split("?"); var testParams = urlArgs[1].split(";"); var func = testParams[0]; var value = decodeURIComponent(testParams[1]); eval('applet.' + func + '(' + value + ')'); applet.writeAfterTests(); } doTest(attemptFuncResolTests, applet);icedtea-web-1.6.2/tests/reproducers/simple/JSToJFuncResol/resources/PaxHeaders.17941/JSToJFuncResol.0000644000000000000000000000013112654402377027773 xustar0030 mtime=1454507263.236432594 30 atime=1454507327.313578016 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSToJFuncResol/resources/JSToJFuncResol.html0000644000175000002070000000124312654402377031404 0ustar00jvanekmock00000000000000 JavaScript to Java LiveConnect - FuncResol values from applet

The JSToJFuncResol html page

icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/JSToJFuncParam0000644000000000000000000000013012654402377023104 xustar0030 mtime=1454507263.235432608 29 atime=1454507658.77815737 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSToJFuncParam/0000755000175000002070000000000012654402377023706 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JSToJFuncParam/PaxHeaders.17941/testcases0000644000000000000000000000013012654402377025102 xustar0030 mtime=1454507263.235432608 29 atime=1454507658.77815737 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSToJFuncParam/testcases/0000755000175000002070000000000012654402377025704 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JSToJFuncParam/testcases/PaxHeaders.17941/JSToJFuncParamT0000644000000000000000000000013112654402377027755 xustar0030 mtime=1454507263.235432608 30 atime=1454507327.313578016 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSToJFuncParam/testcases/JSToJFuncParamTest.java0000644000175000002070000002042512654402377032140 0ustar00jvanekmock00000000000000/* JSToJFuncParamTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.CountingClosingListener; import net.sourceforge.jnlp.annotations.KnownToFail; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import org.junit.Assert; import org.junit.Test; public class JSToJFuncParamTest extends BrowserTest { // the JS<->J tests tend to make Opera unusable public final boolean doNotRunInOpera = false; private final String initStr = "JSToJFuncParam applet initialized."; private final String afterStr = "afterTests"; private class CountingClosingListenerImpl extends CountingClosingListener { @Override protected boolean isAlowedToFinish(String s) { return (s.contains(initStr) && s.contains(afterStr)); } } private void evaluateStdoutContents(String expectedStdout, ProcessResult pr) { // Assert that the applet was initialized. Assert.assertTrue("JSToJFuncParam: the stdout should contain " + initStr + ", but it didnt.", pr.stdout.contains(initStr)); // Assert that the values set by JavaScript are ok Assert.assertTrue("JSToJFuncParam: the output should include: " + expectedStdout + ", but it didnt.", pr.stdout.contains(expectedStdout)); } private void jsToJavaFuncParamTest(String funcStr, String paramStr, String expectedVal) throws Exception { if (doNotRunInOpera) { if (server.getCurrentBrowser().getID() == Browsers.opera) { return; } } String strURL = "/JSToJFuncParam.html?" + funcStr + ";" + paramStr; ProcessResult pr = server.executeBrowser(strURL, new CountingClosingListenerImpl(), new CountingClosingListenerImpl()); String expectedStdout = funcStr + " " + expectedVal; evaluateStdoutContents(expectedStdout, pr); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncParam_int_Test() throws Exception { jsToJavaFuncParamTest("intParam", "1", "1"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncParam_double_Test() throws Exception { jsToJavaFuncParamTest("doubleParam", "1.1", "1.1"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncParam_float_Test() throws Exception { jsToJavaFuncParamTest("floatParam", "1.1", "1.1"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncParam_long_Test() throws Exception { jsToJavaFuncParamTest("longParam", "10000", "10000"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncParam_boolean_Test() throws Exception { jsToJavaFuncParamTest("booleanParam", "true", "true"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncParam_char_Test() throws Exception { jsToJavaFuncParamTest("charParam", "97", "a"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncParam_byte_Test() throws Exception { jsToJavaFuncParamTest("byteParam", "10", "10"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncParam_charArray_Test() throws Exception { jsToJavaFuncParamTest("charArrayParam", "[97,98,99]", "[a, b, c]"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncParam_String_Test() throws Exception { jsToJavaFuncParamTest("StringParam", "\"test\"", "test"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncParam_Integer_Test() throws Exception { jsToJavaFuncParamTest("IntegerParam", "1", "1"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncParam_Double_Test() throws Exception { jsToJavaFuncParamTest("DoubleParam", "1.1", "1.1"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay @KnownToFail public void AppletJSToJFuncParam_Float_Test() throws Exception { jsToJavaFuncParamTest("FloatParam", "1.1", "1.1"); } // @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay @KnownToFail public void AppletJSToJFuncParam_Long_Test() throws Exception { jsToJavaFuncParamTest("LongParam", "10000", "10000"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncParam_Boolean_Test() throws Exception { jsToJavaFuncParamTest("BooleanParam", "true", "true"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncParam_Character_Test() throws Exception { jsToJavaFuncParamTest("CharacterParam", "new applet.Packages.java.lang.Character(65)", "A"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay @KnownToFail public void AppletJSToJFuncParam_Byte_Test() throws Exception { jsToJavaFuncParamTest("ByteParam", "10", "10"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncParam_StringIntMixed_Test() throws Exception { jsToJavaFuncParamTest("StringIntMixedParam", "[\"test\",123]", "[test, 123]"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncParam_DummyObjectArray_Test() throws Exception { jsToJavaFuncParamTest("DummyObjectArrayParam", "[applet.getNewDummyObject(\"Dummy1\"),applet.getNewDummyObject(\"Dummy2\")]", "[Dummy1, Dummy2]"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncParam_JSObject_Test() throws Exception { jsToJavaFuncParamTest("JSObjectParam", "new JSCar(100,\"red\")", "100, red"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncParam_booleanFalseStr_Test() throws Exception { jsToJavaFuncParamTest("booleanParam", "false", "false"); } // @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncParam_BooleanFalseStr_Test() throws Exception { jsToJavaFuncParamTest("BooleanParam", "false", "false"); } } icedtea-web-1.6.2/tests/reproducers/simple/JSToJFuncParam/PaxHeaders.17941/srcs0000644000000000000000000000013012654402377024056 xustar0030 mtime=1454507263.235432608 29 atime=1454507658.77815737 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSToJFuncParam/srcs/0000755000175000002070000000000012654402377024660 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JSToJFuncParam/srcs/PaxHeaders.17941/JSToJFuncParam.java0000644000000000000000000000013112654402377027525 xustar0030 mtime=1454507263.235432608 30 atime=1454507327.313578016 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSToJFuncParam/srcs/JSToJFuncParam.java0000644000175000002070000000544112654402377030255 0ustar00jvanekmock00000000000000import java.applet.Applet; import java.util.Arrays; import netscape.javascript.JSObject; public class JSToJFuncParam extends Applet { public void init() { String initStr = "JSToJFuncParam applet initialized."; System.out.println(initStr); } public void intParam(int i) { System.out.println("intParam " + i); } public void doubleParam(double d) { System.out.println("doubleParam " + d); } public void floatParam(float f) { System.out.println("floatParam " + f); } public void longParam(long l) { System.out.println("longParam " + l); } public void booleanParam(boolean b) { System.out.println("booleanParam " + b); } public void charParam(char c) { System.out.println("charParam " + c); } public void byteParam(byte b) { System.out.println("byteParam " + b); } public void charArrayParam(char[] ca) { System.out.println("charArrayParam " + Arrays.toString(ca)); } public void StringParam(String s) { System.out.println("StringParam " + s); } public void IntegerParam(Integer p) { System.out.println("IntegerParam " + p); } public void DoubleParam(Double p) { System.out.println("DoubleParam " + p); } public void FloatParam(Float p) { System.out.println("FloatParam " + p); } public void LongParam(Long p) { System.out.println("LongParam " + p); } public void BooleanParam(Boolean p) { System.out.println("BooleanParam " + p); } public void CharacterParam(Character p) { System.out.println("CharacterParam " + p); } public void ByteParam(Byte p) { System.out.println("ByteParam " + p); } public void StringIntMixedParam(String[] s) { System.out.println("StringIntMixedParam " + Arrays.toString(s)); } public void DummyObjectArrayParam(DummyObject[] ca) { System.out.println("DummyObjectArrayParam " + Arrays.toString(ca)); } public void JSObjectParam(JSObject car) { Integer mph = (Integer) car.getMember("mph"); String color = (String) car.getMember("color"); System.out.println("JSObjectParam " + mph + ", " + color); } public void writeAfterTest() { System.out.println("afterTests"); } public void readFromJS(String message) { System.out.println(message); } public class DummyObject { private String str; public DummyObject(String s) { this.str = s; } public void setStr(String s) { this.str = s; } public String toString() { return str; } } public DummyObject getNewDummyObject(String str) { return new DummyObject(str); } } icedtea-web-1.6.2/tests/reproducers/simple/JSToJFuncParam/PaxHeaders.17941/resources0000644000000000000000000000013012654402377025116 xustar0030 mtime=1454507263.235432608 29 atime=1454507658.77815737 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSToJFuncParam/resources/0000755000175000002070000000000012654402377025720 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JSToJFuncParam/resources/PaxHeaders.17941/jstoj-funcparam0000644000000000000000000000013112654402377030222 xustar0030 mtime=1454507263.235432608 30 atime=1454507327.313578016 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSToJFuncParam/resources/jstoj-funcparam.jnlp0000644000175000002070000000137512654402377031716 0ustar00jvanekmock00000000000000 JavaScript to Java LiveConnect - FuncParam IcedTea LiveConnect - tests for function parameter conversion when calling Java from JS. icedtea-web-1.6.2/tests/reproducers/simple/JSToJFuncParam/resources/PaxHeaders.17941/JSToJava_FuncPa0000644000000000000000000000013112654402377027774 xustar0030 mtime=1454507263.234432621 30 atime=1454507327.313578016 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSToJFuncParam/resources/JSToJava_FuncParam.js0000644000175000002070000000110012654402377031623 0ustar00jvanekmock00000000000000//dummy javascript class whose instance is passed as JSObject parameter: function JSCar(mph, color) { this.mph = mph; this.color = color; } // the main routine used for all tests: function attemptFuncParamTests() { var urlArgs = document.URL.split("?"); var testParams = urlArgs[1].split(";"); var func = testParams[0]; var value = decodeURIComponent(testParams[1]); notice.innerHTML = notice.innerHTML + func + " " + value; eval('applet.' + func + '(' + value + ')'); applet.writeAfterTest(); } doTest(attemptFuncParamTests, applet); icedtea-web-1.6.2/tests/reproducers/simple/JSToJFuncParam/resources/PaxHeaders.17941/JSToJFuncParam.0000644000000000000000000000013012654402377027722 xustar0030 mtime=1454507263.234432621 29 atime=1454507327.31257803 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSToJFuncParam/resources/JSToJFuncParam.html0000644000175000002070000000127212654402377031336 0ustar00jvanekmock00000000000000 JavaScript to Java LiveConnect - function parameter conversion

The JSToJFuncParam html page

icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/JSObjectWithoutToString0000644000000000000000000000013012654402377025077 xustar0030 mtime=1454507263.234432621 29 atime=1454507658.77815737 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSObjectWithoutToString/0000755000175000002070000000000012654402377025701 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JSObjectWithoutToString/PaxHeaders.17941/testcases0000644000000000000000000000013012654402377027075 xustar0030 mtime=1454507263.234432621 29 atime=1454507658.77815737 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSObjectWithoutToString/testcases/0000755000175000002070000000000012654402377027677 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JSObjectWithoutToString/testcases/PaxHeaders.17941/JSObje0000644000000000000000000000031712654402377030220 xustar00119 path=icedtea-web-1.6.2/tests/reproducers/simple/JSObjectWithoutToString/testcases/JSObjectWithoutToStringTest.java 30 mtime=1454507263.234432621 29 atime=1454507327.31257803 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSObjectWithoutToString/testcases/JSObjectWithoutToString0000644000175000002070000000544712654402377034355 0ustar00jvanekmock00000000000000/* JSObjectWithoutToStringTest.java Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.ServerAccess.AutoClose; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; import net.sourceforge.jnlp.annotations.KnownToFail; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import org.junit.Assert; import org.junit.Test; public class JSObjectWithoutToStringTest extends BrowserTest { private static final String appletCloseString = AutoOkClosingListener.MAGICAL_OK_CLOSING_STRING; @Test @NeedsDisplay @TestInBrowsers(testIn={Browsers.one}) public void testJSObjectWithoutToString() throws Exception { ProcessResult pr = server.executeBrowser("/JSObjectWithoutToString.html", AutoClose.CLOSE_ON_CORRECT_END); Assert.assertFalse("IndexOutOfBounds exception should not have occurred", pr.stderr.contains("java.lang.ArrayIndexOutOfBoundsException")); Assert.assertTrue("Applet should have completed normally", pr.stdout.contains(appletCloseString)); } } icedtea-web-1.6.2/tests/reproducers/simple/JSObjectWithoutToString/PaxHeaders.17941/srcs0000644000000000000000000000013012654402377026051 xustar0030 mtime=1454507263.234432621 29 atime=1454507658.77815737 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSObjectWithoutToString/srcs/0000755000175000002070000000000012654402377026653 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JSObjectWithoutToString/srcs/PaxHeaders.17941/JSObjectWit0000644000000000000000000000013012654402377030200 xustar0030 mtime=1454507263.234432621 29 atime=1454507327.31257803 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSObjectWithoutToString/srcs/JSObjectWithoutToString.java0000644000175000002070000000042312654402377034236 0ustar00jvanekmock00000000000000import java.applet.Applet; import netscape.javascript.JSObject; public class JSObjectWithoutToString extends Applet { public void callJSToString(JSObject jso) { System.out.println(jso.toString()); System.out.println("*** APPLET FINISHED ***"); } } icedtea-web-1.6.2/tests/reproducers/simple/JSObjectWithoutToString/PaxHeaders.17941/resources0000644000000000000000000000013012654402377027111 xustar0030 mtime=1454507263.233432634 29 atime=1454507658.77815737 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSObjectWithoutToString/resources/0000755000175000002070000000000012654402377027713 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JSObjectWithoutToString/resources/PaxHeaders.17941/JSObje0000644000000000000000000000031112654402377030226 xustar00113 path=icedtea-web-1.6.2/tests/reproducers/simple/JSObjectWithoutToString/resources/JSObjectWithoutToString.js 30 mtime=1454507263.233432634 29 atime=1454507327.31257803 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSObjectWithoutToString/resources/JSObjectWithoutToString0000644000175000002070000000022612654402377034357 0ustar00jvanekmock00000000000000function attemptToStringTest() { var null_obj = Object.create(null); applet.callJSToString(null_obj); } doTest(attemptToStringTest, applet); icedtea-web-1.6.2/tests/reproducers/simple/JSObjectWithoutToString/resources/PaxHeaders.17941/JSObje0000644000000000000000000000031312654402377030230 xustar00115 path=icedtea-web-1.6.2/tests/reproducers/simple/JSObjectWithoutToString/resources/JSObjectWithoutToString.html 30 mtime=1454507263.233432634 29 atime=1454507327.31257803 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSObjectWithoutToString/resources/JSObjectWithoutToString0000644000175000002070000000131412654402377034356 0ustar00jvanekmock00000000000000 JavaScript to Java LiveConnect - Function return values from applet

The JSObjectWithoutToString html page

icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/JSObjectFromEval0000644000000000000000000000013012654402377023455 xustar0030 mtime=1454507263.233432634 29 atime=1454507658.77815737 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSObjectFromEval/0000755000175000002070000000000012654402377024257 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JSObjectFromEval/PaxHeaders.17941/testcases0000644000000000000000000000013012654402377025453 xustar0030 mtime=1454507263.233432634 29 atime=1454507658.77815737 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSObjectFromEval/testcases/0000755000175000002070000000000012654402377026255 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JSObjectFromEval/testcases/PaxHeaders.17941/JSObjectFromE0000644000000000000000000000013012654402377030047 xustar0030 mtime=1454507263.233432634 29 atime=1454507327.31257803 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSObjectFromEval/testcases/JSObjectFromEvalTest.java0000644000175000002070000000703412654402377033063 0ustar00jvanekmock00000000000000/* Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import static org.junit.Assert.assertTrue; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess.AutoClose; import net.sourceforge.jnlp.annotations.Bug; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; import org.junit.Test; public class JSObjectFromEvalTest extends BrowserTest { private static final String END_STRING = AutoOkClosingListener.MAGICAL_OK_CLOSING_STRING; private static final String JAVA_CREATE = "Java create\n"; private static final String JS_CREATE = "JS create\n"; private static final String JAVA_SET = "Java set\n"; private static final String CORRECT_VALUE = "obj.test = 0"; @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay @Bug(id = { "PR1198" }) public void testJSObjectSetMemberIsSet() throws Exception { ProcessResult pr = server.executeBrowser("/JSObjectFromEval.html", AutoClose.CLOSE_ON_BOTH); String expectedJSCreateOutput = JS_CREATE + JAVA_SET + CORRECT_VALUE; String expectedJavaCreateOutput = JAVA_CREATE + JAVA_SET + CORRECT_VALUE; // No reason JS create should fail, this is mostly a sanity check: assertTrue("stdout should contain 'JS create [...] " + CORRECT_VALUE + "' but did not.", pr.stdout.contains(expectedJSCreateOutput)); // Demonstrates PR1198: assertTrue("stdout should contain 'Java create [...] " + CORRECT_VALUE + "' but did not.", pr.stdout.contains(expectedJavaCreateOutput)); // Make sure we got to the end of the script assertTrue("stdout should contain '" + END_STRING + "' but did not.", pr.stdout.contains(END_STRING)); } } icedtea-web-1.6.2/tests/reproducers/simple/JSObjectFromEval/PaxHeaders.17941/srcs0000644000000000000000000000013012654402377024427 xustar0030 mtime=1454507263.232432648 29 atime=1454507658.77815737 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSObjectFromEval/srcs/0000755000175000002070000000000012654402377025231 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JSObjectFromEval/srcs/PaxHeaders.17941/JSObjectFromEval.j0000644000000000000000000000013012654402377027756 xustar0030 mtime=1454507263.232432648 29 atime=1454507327.31257803 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSObjectFromEval/srcs/JSObjectFromEval.java0000644000175000002070000000411212654402377031171 0ustar00jvanekmock00000000000000/* Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.applet.Applet; import netscape.javascript.JSObject; public class JSObjectFromEval extends Applet { @Override public void start() { System.out.println(getClass().getSimpleName() + " started."); } public void output(String s) { System.out.println(s); } public JSObject newJSObject() { JSObject win = JSObject.getWindow(this); return (JSObject) win.eval("new Object()"); } public void setJSMember(JSObject js, String memb, Object val) { js.setMember(memb, val); } }icedtea-web-1.6.2/tests/reproducers/simple/JSObjectFromEval/PaxHeaders.17941/resources0000644000000000000000000000013012654402377025467 xustar0030 mtime=1454507263.232432648 29 atime=1454507658.77815737 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSObjectFromEval/resources/0000755000175000002070000000000012654402377026271 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/JSObjectFromEval/resources/PaxHeaders.17941/JSObjectFromE0000644000000000000000000000013112654402377030064 xustar0030 mtime=1454507263.232432648 30 atime=1454507327.311578043 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSObjectFromEval/resources/JSObjectFromEval.js0000644000175000002070000000116712654402377031733 0ustar00jvanekmock00000000000000function attemptJSObjectFromEvalTest() { var obj; applet.output("*** Test JSObject from JS ***"); applet.output("JS create"); obj = new Object(); applet.output("Java set"); applet.setJSMember(obj, "test", 0); applet.output("obj.test = " + obj.test); applet.output("*** Test JSObject from Java ***"); applet.output("Java create"); obj = applet.newJSObject(); applet.output("Java set"); applet.setJSMember(obj, "test", 0); applet.output("obj.test = " + obj.test); applet.output("*** APPLET FINISHED ***"); // We're done here } doTest(attemptJSObjectFromEvalTest, applet);icedtea-web-1.6.2/tests/reproducers/simple/JSObjectFromEval/resources/PaxHeaders.17941/JSObjectFromE0000644000000000000000000000013112654402377030064 xustar0030 mtime=1454507263.232432648 30 atime=1454507327.311578043 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/JSObjectFromEval/resources/JSObjectFromEval.html0000644000175000002070000000356712654402377032271 0ustar00jvanekmock00000000000000 icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/InformationTitleVendorParser0000644000000000000000000000013012654402377026200 xustar0030 mtime=1454507263.231432661 29 atime=1454507658.77815737 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/InformationTitleVendorParser/0000755000175000002070000000000012654402377027002 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/InformationTitleVendorParser/PaxHeaders.17941/testcases0000644000000000000000000000013012654402377030176 xustar0030 mtime=1454507263.231432661 29 atime=1454507658.77815737 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/InformationTitleVendorParser/testcases/0000755000175000002070000000000012654402377031000 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/InformationTitleVendorParser/testcases/PaxHeaders.17941/I0000644000000000000000000000033212654402377030372 xustar00129 path=icedtea-web-1.6.2/tests/reproducers/simple/InformationTitleVendorParser/testcases/InformationTitleVendorParserTest.java 30 mtime=1454507263.231432661 30 atime=1454507327.311578043 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/InformationTitleVendorParser/testcases/InformationTitleVe0000644000175000002070000000641012654402377034506 0ustar00jvanekmock00000000000000/* InformationTitleVendorParserTest.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.List; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import org.junit.Assert; import org.junit.Test; public class InformationTitleVendorParserTest { private static ServerAccess server = new ServerAccess(); public void runTest(String jnlpName, String exception) throws Exception { List verbosed = Arrays.asList(new String[] { "-verbose" }); ProcessResult pr=server.executeJavawsHeadless(verbosed, "/" + jnlpName + ".jnlp"); String s1 = "Good simple javaws exapmle"; Assert.assertFalse("test" + jnlpName + " stdout should not contain " + s1 + " but did.", pr.stdout.contains(s1)); Assert.assertTrue("testForTitle stderr should contain " + exception + " but did not.", pr.stderr.contains(exception)); Assert.assertFalse(pr.wasTerminated); Assert.assertEquals((Integer)0, pr.returnValue); } @Test public void testInformationeParser() throws Exception { runTest("InformationParser", "net.sourceforge.jnlp.MissingInformationException"); } @Test public void testTitleParser() throws Exception { runTest("TitleParser", "net.sourceforge.jnlp.MissingTitleException"); } @Test public void testVendorParser() throws Exception { runTest("VendorParser", "net.sourceforge.jnlp.MissingVendorException"); } @Test public void testTitleVendorParser() throws Exception { // Note that the title message missing causes an immediate exception, regardless of Vendor. runTest("TitleVendorParser", "net.sourceforge.jnlp.MissingTitleException"); } } icedtea-web-1.6.2/tests/reproducers/simple/InformationTitleVendorParser/PaxHeaders.17941/resources0000644000000000000000000000013012654402377030212 xustar0030 mtime=1454507263.231432661 29 atime=1454507658.77815737 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/InformationTitleVendorParser/resources/0000755000175000002070000000000012654402377031014 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/InformationTitleVendorParser/resources/PaxHeaders.17941/V0000644000000000000000000000013112654402377030420 xustar0030 mtime=1454507263.231432661 30 atime=1454507327.311578043 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/InformationTitleVendorParser/resources/VendorParser.jnlp0000644000175000002070000000411612654402377034315 0ustar00jvanekmock00000000000000 VendorParser Vendor tag missing icedtea-web-1.6.2/tests/reproducers/simple/InformationTitleVendorParser/resources/PaxHeaders.17941/T0000644000000000000000000000031312654402377030420 xustar00114 path=icedtea-web-1.6.2/tests/reproducers/simple/InformationTitleVendorParser/resources/TitleVendorParser.jnlp 30 mtime=1454507263.231432661 30 atime=1454507327.311578043 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/InformationTitleVendorParser/resources/TitleVendorParser.0000644000175000002070000000407212654402377034434 0ustar00jvanekmock00000000000000 Title/Vendor tags missing icedtea-web-1.6.2/tests/reproducers/simple/InformationTitleVendorParser/resources/PaxHeaders.17941/T0000644000000000000000000000013112654402377030416 xustar0030 mtime=1454507263.231432661 30 atime=1454507327.311578043 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/InformationTitleVendorParser/resources/TitleParser.jnlp0000644000175000002070000000411112654402377034134 0ustar00jvanekmock00000000000000 IcedTea Title tag missing icedtea-web-1.6.2/tests/reproducers/simple/InformationTitleVendorParser/resources/PaxHeaders.17941/I0000644000000000000000000000031312654402377030405 xustar00114 path=icedtea-web-1.6.2/tests/reproducers/simple/InformationTitleVendorParser/resources/InformationParser.jnlp 30 mtime=1454507263.230432674 30 atime=1454507327.310578056 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/InformationTitleVendorParser/resources/InformationParser.0000644000175000002070000000363312654402377034464 0ustar00jvanekmock00000000000000 icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/GeneratedId0000644000000000000000000000013012654402377022531 xustar0030 mtime=1454507263.230432674 29 atime=1454507658.77815737 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/GeneratedId/0000755000175000002070000000000012654402377023333 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/GeneratedId/PaxHeaders.17941/testcases0000644000000000000000000000013012654402377024527 xustar0030 mtime=1454507263.230432674 29 atime=1454507658.77815737 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/GeneratedId/testcases/0000755000175000002070000000000012654402377025331 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/GeneratedId/testcases/PaxHeaders.17941/GeneratedIdTest.ja0000644000000000000000000000013112654402377030134 xustar0030 mtime=1454507263.230432674 30 atime=1454507327.310578056 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/GeneratedId/testcases/GeneratedIdTest.java0000644000175000002070000001666112654402377031221 0ustar00jvanekmock00000000000000/* Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.util.ArrayList; import java.util.List; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import org.junit.Assert; import org.junit.Test; public class GeneratedIdTest { private static final ServerAccess server = new ServerAccess(); private static final String okBase = "0 - id: "; private static final String someId1 = "SomeId"; private static final String someId2 = "AnotherId"; private static final String okBase1 = okBase + someId1; private static final String okBase2 = okBase + someId2; private static final String baseName1 = "GeneratedId.jnlp"; private static final String baseName1_noHref = "GeneratedIdNoHref.jnlp"; private static final String baseName2 = "GeneratedId_1_tmp.jnlp"; private static final String baseName2_noHref = "GeneratedIdNoHref_1_tmp.jnlp"; public static File prepareChangedFileWithHref() throws IOException { File src = new File(server.getDir(), baseName1); File dest = new File(server.getDir(), baseName2); String srcJnlp = ServerAccess.getContentOfStream(new FileInputStream(src)); ServerAccess.saveFile(srcJnlp.replace(someId1, someId2), dest); return dest; } public static File prepareChangedFileNoHref() throws IOException { File src = new File(server.getDir(), baseName1); File dest = new File(server.getDir(), baseName2_noHref); String srcJnlp = ServerAccess.getContentOfStream(new FileInputStream(src)); ServerAccess.saveFile(srcJnlp.replace(someId1, someId2).replace("href=\"GeneratedId.jnlp\"", ""), dest); return dest; } public static File prepareCopiedFileNoHref() throws IOException { File src = new File(server.getDir(), baseName1); File dest = new File(server.getDir(), baseName1_noHref); String srcJnlp = ServerAccess.getContentOfStream(new FileInputStream(src)); ServerAccess.saveFile(srcJnlp.replace("href=\"GeneratedId.jnlp\"", ""), dest); return dest; } @Test //have href //is local //should be redownloaded //href points to different file public void launchLocalChangedFileWithHref() throws Exception { File dest = prepareChangedFileWithHref(); List l = new ArrayList(3); l.add(server.getJavawsLocation()); l.add(ServerAccess.HEADLES_OPTION); l.add(dest.getAbsolutePath()); ProcessResult pr = ServerAccess.executeProcess(l); Assert.assertTrue("Stdout should contain '" + okBase1 + "', but did not.", pr.stdout.contains(okBase1)); } @Test //do not have href //is local //should NOT be redownloaded public void launchLocalChangedFileWithNoHref() throws Exception { File dest = prepareChangedFileNoHref(); List l = new ArrayList(3); l.add(server.getJavawsLocation()); l.add(ServerAccess.HEADLES_OPTION); l.add(dest.getAbsolutePath()); ProcessResult pr = ServerAccess.executeProcess(l); Assert.assertTrue("Stdout should contain '" + okBase2 + "', but did not.", pr.stdout.contains(okBase2)); } @Test //do have href //is local //should be redownloaded (how to verify!?!) public void launchLocalFileWithHref() throws Exception { File dest = new File(server.getDir(), baseName1); List l = new ArrayList(3); l.add(server.getJavawsLocation()); l.add(ServerAccess.HEADLES_OPTION); l.add(dest.getAbsolutePath()); ProcessResult pr = ServerAccess.executeProcess(l); Assert.assertTrue("Stdout should contain '" + okBase1 + "', but did not.", pr.stdout.contains(okBase1)); } @Test //do not have href //is local //should NOT be redownloaded (how to verify!?!) public void launchLocalFileNoHref() throws Exception { File dest = prepareCopiedFileNoHref(); List l = new ArrayList(3); l.add(server.getJavawsLocation()); l.add(ServerAccess.HEADLES_OPTION); l.add(dest.getAbsolutePath()); ProcessResult pr = ServerAccess.executeProcess(l); Assert.assertTrue("Stdout should contain '" + okBase1 + "', but did not.", pr.stdout.contains(okBase1)); } @Test //remote //have href //should not be redownloaded (how to verify!?!) //href is same file public void launchRemoteFileWithHref() throws Exception { ProcessResult pr = server.executeJavawsHeadless("/" + baseName1); Assert.assertTrue("Stdout should contain '" + okBase1 + "', but did not.", pr.stdout.contains(okBase1)); } //remote //have href //should be redownloaded as href is different file @Test public void launchRemoteChangedFileWithHref() throws Exception { File f = prepareChangedFileWithHref(); ProcessResult pr = server.executeJavawsHeadless("/" + f.getName()); Assert.assertTrue("Stdout should contain '" + okBase1 + "', but did not.", pr.stdout.contains(okBase1)); } @Test //remote //have not href //should not be redownloaded (how to verify!?!) public void launchRemoteFileWithNoHref() throws Exception { File f = prepareCopiedFileNoHref(); ProcessResult pr = server.executeJavawsHeadless("/" + f.getName()); Assert.assertTrue("Stdout should contain '" + okBase1 + "', but did not.", pr.stdout.contains(okBase1)); } //remote //have not href //should NOT be redownloaded @Test public void launchRemoteChangedFileWithNoHref() throws Exception { File f = prepareChangedFileNoHref(); ProcessResult pr = server.executeJavawsHeadless("/" + f.getName()); Assert.assertTrue("Stdout should contain '" + okBase2 + "', but did not.", pr.stdout.contains(okBase2)); } } icedtea-web-1.6.2/tests/reproducers/simple/GeneratedId/PaxHeaders.17941/srcs0000644000000000000000000000013012654402377023503 xustar0030 mtime=1454507263.230432674 29 atime=1454507658.77815737 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/GeneratedId/srcs/0000755000175000002070000000000012654402377024305 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/GeneratedId/srcs/PaxHeaders.17941/GeneratedId.java0000644000000000000000000000013112654402377026577 xustar0030 mtime=1454507263.230432674 30 atime=1454507327.310578056 29 ctime=1454507658.75715765 icedtea-web-1.6.2/tests/reproducers/simple/GeneratedId/srcs/GeneratedId.java0000644000175000002070000000342412654402377027326 0ustar00jvanekmock00000000000000/* Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class GeneratedId { static public void main(String[] args) { for(int x = 0; x Test Generated Id IcedTea SomeId icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/FakeCodebase0000644000000000000000000000013112654402377022653 xustar0030 mtime=1454507263.229432688 29 atime=1454507658.77815737 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/FakeCodebase/0000755000175000002070000000000012654402377023454 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/FakeCodebase/PaxHeaders.17941/testcases0000644000000000000000000000013112654402377024651 xustar0030 mtime=1454507263.229432688 29 atime=1454507658.77815737 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/FakeCodebase/testcases/0000755000175000002070000000000012654402377025452 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/FakeCodebase/testcases/PaxHeaders.17941/FakeCodebaseTests0000644000000000000000000000013212654402377030171 xustar0030 mtime=1454507263.229432688 30 atime=1454507327.310578056 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/FakeCodebase/testcases/FakeCodebaseTests.java0000644000175000002070000001633712654402377031646 0ustar00jvanekmock00000000000000/* AppletTestTests.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.io.File; import java.io.IOException; import java.util.Arrays; import net.sourceforge.jnlp.OptionsDefinitions; import static org.junit.Assert.assertTrue; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ProcessWrapper; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.ServerAccess.AutoClose; import net.sourceforge.jnlp.ServerLauncher; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.browsers.firefox.FirefoxProfilesOperator; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.config.PathsAndFiles; import net.sourceforge.jnlp.runtime.ManifestAttributesChecker; import net.sourceforge.jnlp.security.appletextendedsecurity.AppletSecurityLevel; import net.sourceforge.jnlp.tools.DeploymentPropertiesModifier; import net.sourceforge.jnlp.util.FileUtils; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; public class FakeCodebaseTests extends BrowserTest { private static DeploymentPropertiesModifier dp; private static File backup; private static final String HTMLIN = "FakeCodebase.html"; private static final String ORIG_BASE = "OriginalCodebase.html"; private static final String JHTMLIN = "FakeCodebase.jnlp"; private static final String JORIG_BASE = "OriginalCodebase.jnlp"; private static final ServerLauncher evilServer1 = ServerAccess.getIndependentInstance(); private static final ServerLauncher evilServer2 = ServerAccess.getIndependentInstance(); @AfterClass public static void killServer1() throws IOException { evilServer1.stop(); } @AfterClass public static void killServer2() throws IOException { evilServer2.stop(); } @BeforeClass public static void setSecurity() throws IOException { dp = new DeploymentPropertiesModifier(); dp.setProperties(DeploymentConfiguration.KEY_SECURITY_LEVEL, AppletSecurityLevel.ASK_UNSIGNED.name()); } @BeforeClass public static void backupAppTrust() throws IOException { backup = File.createTempFile("fakeCodebase", "itwReproducers"); backup.deleteOnExit(); FirefoxProfilesOperator.copyFile(PathsAndFiles.APPLET_TRUST_SETTINGS_USER.getFile(), backup); } @AfterClass public static void restoreAppTrust() throws IOException { FirefoxProfilesOperator.copyFile(backup, PathsAndFiles.APPLET_TRUST_SETTINGS_USER.getFile()); } @AfterClass public static void resetSecurity() throws IOException { dp.restoreProperties(); } //placeholder to make unittest happy @Test public void FakeCodebaseTestFake() throws Exception { } //headless dialogues now works only for javaws. //@Test @TestInBrowsers(testIn = {Browsers.all}) @NeedsDisplay public void FakeCodebaseTest() throws Exception { DeploymentPropertiesModifier dp = new DeploymentPropertiesModifier(); dp.setProperties(DeploymentConfiguration.KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK, ManifestAttributesChecker.MANIFEST_ATTRIBUTES_CHECK.NONE.name()); try { String ob1 = FileUtils.loadFileAsString(new File(server.getDir(), ORIG_BASE)); assertTrue(ob1.contains("id=\"FakeCodebase0\"")); //check orig.html is correct one PathsAndFiles.APPLET_TRUST_SETTINGS_USER.getFile().delete(); //clean file is an must //run normal applet on normal codebase with standard server //answer YES + rember for ever + for codebase ProcessResult pr1 = server.executeBrowser("/" + ORIG_BASE, AutoClose.CLOSE_ON_CORRECT_END); assertTrue(pr1.stdout.contains(AutoOkClosingListener.MAGICAL_OK_CLOSING_STRING)); //the record was added to .appletSecuritySettings String s2 = FileUtils.loadFileAsString(PathsAndFiles.APPLET_TRUST_SETTINGS_USER.getFile()).trim(); String[] ss2 = s2.split("\n"); Assert.assertEquals(1, ss2.length); //create atacker String htmlin = FileUtils.loadFileAsString(new File(server.getDir(), HTMLIN + ".in")); //now change codebase to be same as ^ but launch applet from evilServer1 htmlin = htmlin.replaceAll("EVILURL2", server.getUrl().toExternalForm()); //and as bonus get resources from evilServer2 htmlin = htmlin.replaceAll("EVILURL1", evilServer2.getUrl().toExternalForm()); FileUtils.saveFile(htmlin, new File(server.getDir(), HTMLIN)); String ob2 = FileUtils.loadFileAsString(new File(server.getDir(), HTMLIN)); assertTrue(ob2.contains("id=\"FakeCodebase1\"")); ProcessResult pr2 = ServerAccess.executeProcessUponURL( server.getBrowserLocation(), null, evilServer1.getUrl("/" + HTMLIN), new AutoOkClosingListener(), null ); //this MUST ask for permissions to run, otherwise fail assertTrue(pr2.stdout.contains(AutoOkClosingListener.MAGICAL_OK_CLOSING_STRING)); String s1 = FileUtils.loadFileAsString(PathsAndFiles.APPLET_TRUST_SETTINGS_USER.getFile()).trim(); String[] ss1 = s1.split("\n"); Assert.assertEquals(2, ss1.length); } finally { dp.restoreProperties(); } } } icedtea-web-1.6.2/tests/reproducers/simple/FakeCodebase/PaxHeaders.17941/srcs0000644000000000000000000000013112654402377023625 xustar0030 mtime=1454507263.229432688 29 atime=1454507658.77815737 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/FakeCodebase/srcs/0000755000175000002070000000000012654402377024426 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/FakeCodebase/srcs/PaxHeaders.17941/FakeCodebase.java0000644000000000000000000000013212654402377027042 xustar0030 mtime=1454507263.229432688 30 atime=1454507327.310578056 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/FakeCodebase/srcs/FakeCodebase.java0000644000175000002070000000366612654402377027600 0ustar00jvanekmock00000000000000 import java.applet.Applet; /* AppletTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class FakeCodebase extends Applet { @Override public void init() { confirm(); } public static void main(String... s) { confirm(); } private static void confirm() { System.out.println("*** APPLET FINISHED ***"); } } icedtea-web-1.6.2/tests/reproducers/simple/FakeCodebase/PaxHeaders.17941/resources0000644000000000000000000000013112654402377024665 xustar0030 mtime=1454507263.228432701 29 atime=1454507658.77815737 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/FakeCodebase/resources/0000755000175000002070000000000012654402377025466 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/FakeCodebase/resources/PaxHeaders.17941/OriginalCodebase.0000644000000000000000000000013112654402377030135 xustar0030 mtime=1454507263.228432701 29 atime=1454507327.30957807 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/FakeCodebase/resources/OriginalCodebase.jnlp0000644000175000002070000000055612654402377031553 0ustar00jvanekmock00000000000000 OriginalCodebase FakeCodebase IcedTea icedtea-web-1.6.2/tests/reproducers/simple/FakeCodebase/resources/PaxHeaders.17941/OriginalCodebase.0000644000000000000000000000013112654402377030135 xustar0030 mtime=1454507263.228432701 29 atime=1454507327.30957807 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/FakeCodebase/resources/OriginalCodebase.html0000644000175000002070000000345312654402377031553 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/simple/FakeCodebase/resources/PaxHeaders.17941/FakeCodebase.jnlp0000644000000000000000000000013112654402377030123 xustar0030 mtime=1454507263.228432701 29 atime=1454507327.30957807 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/FakeCodebase/resources/FakeCodebase.jnlp.in0000644000175000002070000000057512654402377031263 0ustar00jvanekmock00000000000000 OriginalCodebase FakeCodebase IcedTea icedtea-web-1.6.2/tests/reproducers/simple/FakeCodebase/resources/PaxHeaders.17941/FakeCodebase.html0000644000000000000000000000013112654402377030124 xustar0030 mtime=1454507263.228432701 29 atime=1454507327.30957807 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/FakeCodebase/resources/FakeCodebase.html.in0000644000175000002070000000347312654402377031264 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/EntryPointUnsignedSingleInvalid0000644000000000000000000000013112654402377026640 xustar0030 mtime=1454507263.227432714 29 atime=1454507658.77815737 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/EntryPointUnsignedSingleInvalid/0000755000175000002070000000000012654402377027441 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/EntryPointUnsignedSingleInvalid/PaxHeaders.17941/testcase0000644000000000000000000000013112654402377030453 xustar0030 mtime=1454507263.227432714 29 atime=1454507658.77815737 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/EntryPointUnsignedSingleInvalid/testcases/0000755000175000002070000000000012654402377031437 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/EntryPointUnsignedSingleInvalid/testcases/PaxHeaders.17940000644000000000000000000000034012654402377030557 xustar00135 path=icedtea-web-1.6.2/tests/reproducers/simple/EntryPointUnsignedSingleInvalid/testcases/EntryPointUnsignedSingleInvalidTest.java 30 mtime=1454507263.227432714 29 atime=1454507327.30957807 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/EntryPointUnsignedSingleInvalid/testcases/EntryPointUnsig0000644000175000002070000001400712654402377034505 0ustar00jvanekmock00000000000000 import java.io.IOException; import java.util.Arrays; import net.sourceforge.jnlp.OptionsDefinitions; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import static net.sourceforge.jnlp.browsertesting.BrowserTest.server; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.AutoErrorClosingListener; import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; import net.sourceforge.jnlp.closinglisteners.StringBasedClosingListener; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.ManifestAttributesChecker; import net.sourceforge.jnlp.tools.DeploymentPropertiesModifier; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; /* AppletTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class EntryPointUnsignedSingleInvalidTest extends BrowserTest { private static final DeploymentPropertiesModifier dpm = new DeploymentPropertiesModifier(); private static final StringBasedClosingListener aok = new AutoOkClosingListener(); private static final StringBasedClosingListener aer = new AutoErrorClosingListener(); private static final String confirmation = "*** applet running ***"; //this test is moreover only testing that the attribute is ignored in unsigend app @BeforeClass public static void setDeploymentManifestPermissionReadingOnly() throws IOException { dpm.setProperties(DeploymentConfiguration.KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK, ManifestAttributesChecker.MANIFEST_ATTRIBUTES_CHECK.ENTRYPOINT.toString()); } @AfterClass public static void restoreDeploymentProeprtiees() throws IOException { dpm.restoreProperties(); } @Test public void javawsAllPermNoSecurity() throws Exception { ProcessResult p = server.executeJavawsHeadless("EntryPointUnsignedSingleInvalid.jnlp"); Assert.assertTrue(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } @Test public void javawsAllPermAllSecurity() throws Exception { ProcessResult p = server.executeJavawsHeadless("EntryPointUnsignedSingleInvalid_security.jnlp"); Assert.assertFalse(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } @Test public void javawsAppletAllPermNoSecurity() throws Exception { ProcessResult p = server.executeJavaws(Arrays.asList(new String[]{"-headless", "-verbose"}), "EntryPointUnsignedSingleInvalid_applet.jnlp", new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } @Test public void javawsAppletAllPermAllSecurity() throws Exception { ProcessResult p = server.executeJavawsHeadless("EntryPointUnsignedSingleInvalid_applet_security.jnlp", new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertFalse(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } @Test @TestInBrowsers(testIn = Browsers.one) public void appletAllPermAllSecurity() throws Exception { server.getBrowserLocation(); ProcessResult p = server.executeBrowser("EntryPointUnsignedSingleInvalid.html", ServerAccess.AutoClose.CLOSE_ON_BOTH); Assert.assertTrue(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } @Test public void javawsHtml() throws Exception { ProcessResult p = server.executeJavaws(Arrays.asList(new String[]{OptionsDefinitions.OPTIONS.HTML.option}), "EntryPointUnsignedSingleInvalid.html", new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } } icedtea-web-1.6.2/tests/reproducers/simple/EntryPointUnsignedSingleInvalid/PaxHeaders.17941/srcs0000644000000000000000000000013112654402377027612 xustar0030 mtime=1454507263.227432714 29 atime=1454507658.77815737 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/EntryPointUnsignedSingleInvalid/srcs/0000755000175000002070000000000012654402377030413 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/EntryPointUnsignedSingleInvalid/srcs/PaxHeaders.17941/MET0000644000000000000000000000013112654402377030237 xustar0030 mtime=1454507263.227432714 29 atime=1454507658.77815737 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/EntryPointUnsignedSingleInvalid/srcs/META-INF/0000755000175000002070000000000012654402377031553 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/EntryPointUnsignedSingleInvalid/srcs/META-INF/PaxHeaders.0000644000000000000000000000013212654402377030345 xustar0030 mtime=1454507263.227432714 30 atime=1454507327.308578083 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/EntryPointUnsignedSingleInvalid/srcs/META-INF/MANIFEST.MF0000644000175000002070000000007312654402377033205 0ustar00jvanekmock00000000000000Manifest-Version: 1.0 Entry-Point: SomeDifferentMainClass icedtea-web-1.6.2/tests/reproducers/simple/EntryPointUnsignedSingleInvalid/srcs/PaxHeaders.17941/Ent0000644000000000000000000000033012654402377030341 xustar00126 path=icedtea-web-1.6.2/tests/reproducers/simple/EntryPointUnsignedSingleInvalid/srcs/EntryPointUnsignedSingleInvalid.java 30 mtime=1454507263.227432714 30 atime=1454507327.308578083 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/EntryPointUnsignedSingleInvalid/srcs/EntryPointUnsignedSi0000644000175000002070000000407412654402377034447 0ustar00jvanekmock00000000000000 import java.applet.Applet; /* AppletTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class EntryPointUnsignedSingleInvalid extends Applet { @Override public void init() { confirm(); } public static void main(String... s) { confirm(); } private static void confirm() { System.out.println("*** applet running ***"); System.out.println(System.getProperty("user.home")); System.out.println("*** APPLET FINISHED ***"); } } icedtea-web-1.6.2/tests/reproducers/simple/EntryPointUnsignedSingleInvalid/PaxHeaders.17941/resource0000644000000000000000000000013112654402377030467 xustar0030 mtime=1454507263.227432714 29 atime=1454507658.77815737 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/EntryPointUnsignedSingleInvalid/resources/0000755000175000002070000000000012654402377031453 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/EntryPointUnsignedSingleInvalid/resources/PaxHeaders.17940000644000000000000000000000034612654402377030601 xustar00140 path=icedtea-web-1.6.2/tests/reproducers/simple/EntryPointUnsignedSingleInvalid/resources/EntryPointUnsignedSingleInvalid_security.jnlp 30 mtime=1454507263.227432714 30 atime=1454507327.308578083 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/EntryPointUnsignedSingleInvalid/resources/EntryPointUnsig0000644000175000002070000000444112654402377034522 0ustar00jvanekmock00000000000000 EntryPointUnsignedSingleInvalid IcedTea EntryPointUnsignedSingleInvalid icedtea-web-1.6.2/tests/reproducers/simple/EntryPointUnsignedSingleInvalid/resources/PaxHeaders.17940000644000000000000000000000035512654402377030601 xustar00147 path=icedtea-web-1.6.2/tests/reproducers/simple/EntryPointUnsignedSingleInvalid/resources/EntryPointUnsignedSingleInvalid_applet_security.jnlp 30 mtime=1454507263.226432728 30 atime=1454507327.308578083 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/EntryPointUnsignedSingleInvalid/resources/EntryPointUnsig0000644000175000002070000000463712654402377034531 0ustar00jvanekmock00000000000000 EntryPointUnsignedSingleInvalid IcedTea EntryPointUnsignedSingleInvalid icedtea-web-1.6.2/tests/reproducers/simple/EntryPointUnsignedSingleInvalid/resources/PaxHeaders.17940000644000000000000000000000034412654402377030577 xustar00138 path=icedtea-web-1.6.2/tests/reproducers/simple/EntryPointUnsignedSingleInvalid/resources/EntryPointUnsignedSingleInvalid_applet.jnlp 30 mtime=1454507263.226432728 30 atime=1454507327.308578083 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/EntryPointUnsignedSingleInvalid/resources/EntryPointUnsig0000644000175000002070000000452112654402377034521 0ustar00jvanekmock00000000000000 EntryPointUnsignedSingleInvalid IcedTea EntryPointUnsignedSingleInvalid icedtea-web-1.6.2/tests/reproducers/simple/EntryPointUnsignedSingleInvalid/resources/PaxHeaders.17940000644000000000000000000000033512654402377030577 xustar00131 path=icedtea-web-1.6.2/tests/reproducers/simple/EntryPointUnsignedSingleInvalid/resources/EntryPointUnsignedSingleInvalid.jnlp 30 mtime=1454507263.226432728 30 atime=1454507327.308578083 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/EntryPointUnsignedSingleInvalid/resources/EntryPointUnsig0000644000175000002070000000434312654402377034523 0ustar00jvanekmock00000000000000 EntryPointUnsignedSingleInvalid IcedTea EntryPointUnsignedSingleInvalid icedtea-web-1.6.2/tests/reproducers/simple/EntryPointUnsignedSingleInvalid/resources/PaxHeaders.17940000644000000000000000000000033512654402377030577 xustar00131 path=icedtea-web-1.6.2/tests/reproducers/simple/EntryPointUnsignedSingleInvalid/resources/EntryPointUnsignedSingleInvalid.html 30 mtime=1454507263.226432728 30 atime=1454507327.307578096 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/EntryPointUnsignedSingleInvalid/resources/EntryPointUnsig0000644000175000002070000000347312654402377034526 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/EmbeddedJnlpInApplet0000644000000000000000000000013112654402377024331 xustar0030 mtime=1454507263.225432741 29 atime=1454507658.77815737 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/EmbeddedJnlpInApplet/0000755000175000002070000000000012654402377025132 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/EmbeddedJnlpInApplet/PaxHeaders.17941/testcases0000644000000000000000000000013112654402377026327 xustar0030 mtime=1454507263.225432741 29 atime=1454507658.77815737 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/EmbeddedJnlpInApplet/testcases/0000755000175000002070000000000012654402377027130 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/EmbeddedJnlpInApplet/testcases/PaxHeaders.17941/EmbeddedJ0000644000000000000000000000031312654402377030134 xustar00113 path=icedtea-web-1.6.2/tests/reproducers/simple/EmbeddedJnlpInApplet/testcases/EmbeddedJnlpInAppletTest.java 30 mtime=1454507263.225432741 30 atime=1454507327.307578096 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/EmbeddedJnlpInApplet/testcases/EmbeddedJnlpInAppletTest.j0000644000175000002070000000620512654402377034120 0ustar00jvanekmock00000000000000/* EmbeddedJnlpInAppletTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess.AutoClose; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; import net.sourceforge.jnlp.annotations.TestInBrowsers; import org.junit.Assert; import org.junit.Test; public class EmbeddedJnlpInAppletTest extends BrowserTest { final static String s = AutoOkClosingListener.MAGICAL_OK_CLOSING_STRING; @Test @TestInBrowsers(testIn = { Browsers.one }) public void JnlpInApplet() throws Exception { ProcessResult pr = server.executeBrowser("/JnlpInApplet.html", AutoClose.CLOSE_ON_CORRECT_END); Assert.assertTrue("Stdout should contain " + s + " but did not", pr.stdout.contains(s)); } @Test @TestInBrowsers(testIn = { Browsers.one }) public void EmbeddedJnlpInAppletWithADotAsCodebase() throws Exception { ProcessResult pr = server.executeBrowser("/EmbeddedJnlpInAppletWithDotCodebase.html", AutoClose.CLOSE_ON_CORRECT_END); Assert.assertTrue("Stdout should contain " + s + " but did not", pr.stdout.contains(s)); } @Test @TestInBrowsers(testIn = { Browsers.one }) public void EmbeddedJnlpInAppletWithNoCodebase() throws Exception { ProcessResult pr = server.executeBrowser("/EmbeddedJnlpInAppletNoCodebase.html", AutoClose.CLOSE_ON_CORRECT_END); Assert.assertTrue("Stdout should contain " + s + " but did not", pr.stdout.contains(s)); } } icedtea-web-1.6.2/tests/reproducers/simple/EmbeddedJnlpInApplet/PaxHeaders.17941/srcs0000644000000000000000000000013112654402377025303 xustar0030 mtime=1454507263.225432741 29 atime=1454507658.77815737 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/EmbeddedJnlpInApplet/srcs/0000755000175000002070000000000012654402377026104 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/EmbeddedJnlpInApplet/srcs/PaxHeaders.17941/EmbeddedJnlp.j0000644000000000000000000000013212654402377030051 xustar0030 mtime=1454507263.225432741 30 atime=1454507327.307578096 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/EmbeddedJnlpInApplet/srcs/EmbeddedJnlp.java0000644000175000002070000000346512654402377031274 0ustar00jvanekmock00000000000000/* EmbeddedJnlp.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.applet.Applet; @SuppressWarnings("serial") public class EmbeddedJnlp extends Applet { @Override public void start() { System.out.println("*** APPLET FINISHED ***"); } } icedtea-web-1.6.2/tests/reproducers/simple/EmbeddedJnlpInApplet/PaxHeaders.17941/resources0000644000000000000000000000013112654402377026343 xustar0030 mtime=1454507263.225432741 29 atime=1454507658.77815737 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/EmbeddedJnlpInApplet/resources/0000755000175000002070000000000012654402377027144 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/EmbeddedJnlpInApplet/resources/PaxHeaders.17941/JnlpInApp0000644000000000000000000000013212654402377030177 xustar0030 mtime=1454507263.225432741 30 atime=1454507327.307578096 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/EmbeddedJnlpInApplet/resources/JnlpInApplet.html0000644000175000002070000000346212654402377032377 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/simple/EmbeddedJnlpInApplet/resources/PaxHeaders.17941/EmbeddedJ0000644000000000000000000000032612654402377030154 xustar00124 path=icedtea-web-1.6.2/tests/reproducers/simple/EmbeddedJnlpInApplet/resources/EmbeddedJnlpInAppletWithDotCodebase.html 30 mtime=1454507263.224432754 30 atime=1454507327.307578096 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/EmbeddedJnlpInApplet/resources/EmbeddedJnlpInAppletWithDo0000644000175000002070000001240512654402377034162 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/simple/EmbeddedJnlpInApplet/resources/PaxHeaders.17941/EmbeddedJ0000644000000000000000000000032112654402377030147 xustar00119 path=icedtea-web-1.6.2/tests/reproducers/simple/EmbeddedJnlpInApplet/resources/EmbeddedJnlpInAppletNoCodebase.html 30 mtime=1454507263.224432754 30 atime=1454507327.307578096 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/EmbeddedJnlpInApplet/resources/EmbeddedJnlpInAppletNoCode0000644000175000002070000001244512654402377034137 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/simple/EmbeddedJnlpInApplet/resources/PaxHeaders.17941/EmbeddedJ0000644000000000000000000000013112654402377030146 xustar0030 mtime=1454507263.224432754 29 atime=1454507327.30657811 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/EmbeddedJnlpInApplet/resources/EmbeddedJnlp.jnlp0000644000175000002070000000436012654402377032351 0ustar00jvanekmock00000000000000 SignedAppletTest IcedTea SignedAppletTest icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/DocumentBaseEncoding0000644000000000000000000000013112654402377024377 xustar0030 mtime=1454507263.224432754 29 atime=1454507658.77815737 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/DocumentBaseEncoding/0000755000175000002070000000000012654402377025200 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/DocumentBaseEncoding/PaxHeaders.17941/testcases0000644000000000000000000000013112654402377026375 xustar0030 mtime=1454507263.224432754 29 atime=1454507658.77815737 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/DocumentBaseEncoding/testcases/0000755000175000002070000000000012654402377027176 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/DocumentBaseEncoding/testcases/PaxHeaders.17941/DocumentB0000644000000000000000000000031312654402377030257 xustar00114 path=icedtea-web-1.6.2/tests/reproducers/simple/DocumentBaseEncoding/testcases/DocumentBaseEncodingTests.java 30 mtime=1454507263.224432754 29 atime=1454507327.30657811 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/DocumentBaseEncoding/testcases/DocumentBaseEncodingTests.0000644000175000002070000000724412654402377034251 0ustar00jvanekmock00000000000000/* Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess.AutoClose; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import org.junit.Assert; import org.junit.Test; public class DocumentBaseEncodingTests extends BrowserTest { static final private String urlPattern = "http://localhost:\\d+"; private String escapePattern(String plainText) { return "\\Q" + plainText + "\\E"; } // Surround a pattern with two plain text matches and wildcards to match any occurence private String surroundPattern(String plainText1, String pattern, String plainText2) { return "(?s).*" + escapePattern(plainText1) + pattern + escapePattern(plainText2) + "\\W.*"; } private void testEncoding(String urlParam, String encodedUrlParam) throws Exception { ProcessResult pr = server.executeBrowser("Document Base Encoding.html" + urlParam, AutoClose.CLOSE_ON_CORRECT_END); final String codeBasePattern = surroundPattern("CodeBase: ", urlPattern, "/"); final String documentBasePattern = surroundPattern("DocumentBase: ", urlPattern, "/Document%20Base%20Encoding.html" + encodedUrlParam); Assert.assertTrue("DocumentBaseEncoding stdout should match '" + codeBasePattern + "' but did not.", pr.stdout.matches(codeBasePattern)); Assert.assertTrue("DocumentBaseEncoding stdout should match '" + documentBasePattern + "' but did not.", pr.stdout.matches(documentBasePattern)); } @Test @TestInBrowsers(testIn = { Browsers.one }) public void testSpacesInUrl() throws Exception { testEncoding("?spaces test", "?spaces%20test"); } @Test @TestInBrowsers(testIn = { Browsers.one }) public void testComplexParameterInUrl() throws Exception { String urlParam = "?testkey=http%3A%2F%2Ftest.com%3Ftest%3Dtest"; // test value is 'http://test.com?test=test' percent-encoded testEncoding(urlParam, urlParam /* Already encoded. */); } } icedtea-web-1.6.2/tests/reproducers/simple/DocumentBaseEncoding/PaxHeaders.17941/srcs0000644000000000000000000000013112654402377025351 xustar0030 mtime=1454507263.223432768 29 atime=1454507658.77815737 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/DocumentBaseEncoding/srcs/0000755000175000002070000000000012654402377026152 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/DocumentBaseEncoding/srcs/PaxHeaders.17941/DocumentBaseEn0000644000000000000000000000013112654402377030205 xustar0030 mtime=1454507263.223432768 29 atime=1454507327.30657811 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/DocumentBaseEncoding/srcs/DocumentBaseEncoding.java0000644000175000002070000000361112654402377033036 0ustar00jvanekmock00000000000000/* Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.applet.Applet; public class DocumentBaseEncoding extends Applet { @Override public void init() { System.out.println("DocumentBase: " + getDocumentBase()); System.out.println("CodeBase: " + getCodeBase()); System.out.println("*** APPLET FINISHED ***"); } } icedtea-web-1.6.2/tests/reproducers/simple/DocumentBaseEncoding/PaxHeaders.17941/resources0000644000000000000000000000013112654402377026411 xustar0030 mtime=1454507263.223432768 29 atime=1454507658.77815737 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/DocumentBaseEncoding/resources/0000755000175000002070000000000012654402377027212 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/DocumentBaseEncoding/resources/PaxHeaders.17941/Document 0000644000000000000000000000031012654402377030226 xustar00111 path=icedtea-web-1.6.2/tests/reproducers/simple/DocumentBaseEncoding/resources/Document Base Encoding.html 30 mtime=1454507263.223432768 29 atime=1454507327.30657811 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/DocumentBaseEncoding/resources/Document Base Encoding.htm0000644000175000002070000000337312654402377034052 0ustar00jvanekmock00000000000000 icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/CustomPolicies0000644000000000000000000000013112654402377023321 xustar0030 mtime=1454507263.223432768 29 atime=1454507658.77815737 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/CustomPolicies/0000755000175000002070000000000012654402377024122 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/CustomPolicies/PaxHeaders.17941/testcases0000644000000000000000000000013112654402377025317 xustar0030 mtime=1454507263.223432768 29 atime=1454507658.77815737 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/CustomPolicies/testcases/0000755000175000002070000000000012654402377026120 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/CustomPolicies/testcases/PaxHeaders.17941/CustomPoliciesT0000644000000000000000000000013112654402377030405 xustar0030 mtime=1454507263.223432768 29 atime=1454507327.30657811 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/CustomPolicies/testcases/CustomPoliciesTest.java0000644000175000002070000002071212654402377032567 0ustar00jvanekmock00000000000000/* CustomPoliciesTest.java Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import java.io.File; import java.io.FileWriter; import java.io.FilenameFilter; import java.io.IOException; import java.net.URL; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.RulesFolowingClosingListener; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.JNLPRuntime; import org.junit.After; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; /* Test that adding permission for all codesources to read the user.home property * results in an unsigned applet being able to perform this action */ public class CustomPoliciesTest extends BrowserTest { private static DeploymentConfiguration config = JNLPRuntime.getConfiguration(); private static File policy, policyBackup; @BeforeClass public static void setPolicyLocation() throws Exception { policy = new File(new URL(config.getProperty(DeploymentConfiguration.KEY_USER_SECURITY_POLICY)).getPath()); File securityDir = policy.getParentFile(); File[] previousBackups = securityDir.listFiles(new FilenameFilter() { @Override public boolean accept(File dir, String name) { return name.startsWith("java.policy.bak"); } }); for (File backup : previousBackups) { ServerAccess.logErrorReprint("Warning: found previous policy file backup at " + backup); } } @Before public void backupPolicy() throws Exception { if (policy.isFile()) { policyBackup = File.createTempFile("java.policy.bak", null, policy.getParentFile()); if (!policy.renameTo(policyBackup)) { ServerAccess.logErrorReprint("Could not back up existing policy file"); throw new RuntimeException("Could not back up existing policy file"); } } } @After public void restorePolicy() { policy.delete(); if (policyBackup != null && policyBackup.isFile()) { policyBackup.renameTo(policy); } } private void writePolicy() throws IOException { FileWriter out = new FileWriter(policy); try { String policyText="grant {\n permission java.util.PropertyPermission \"user.home\", \"read\";\n};\n"; out.write(policyText, 0, policyText.length()); } finally { out.close(); } } @NeedsDisplay @Test @TestInBrowsers(testIn={Browsers.one}) public void testHtmlLaunchWithPolicy() throws Exception { writePolicy(); assertPolicyExists(); RulesFolowingClosingListener listener = new RulesFolowingClosingListener(); listener.addContainsRule("CustomPolicies applet read:"); ProcessResult pr = server.executeBrowser("CustomPolicies.html", listener, null); assertInit(pr); assertReadProps(pr); assertNoAccessControlException(pr); } @NeedsDisplay @Test @TestInBrowsers(testIn={Browsers.one}) public void testHtmlJnlpHrefLaunchWithPolicy() throws Exception { writePolicy(); assertPolicyExists(); RulesFolowingClosingListener listener = new RulesFolowingClosingListener(); listener.addContainsRule("CustomPolicies applet read:"); ProcessResult pr = server.executeBrowser("CustomPoliciesJnlpHref.html", listener, null); assertInit(pr); assertReadProps(pr); assertNoAccessControlException(pr); } @Test public void testJnlpAppletLaunchWithPolicy() throws Exception { writePolicy(); assertPolicyExists(); ProcessResult pr = server.executeJavawsHeadless("CustomPoliciesApplet.jnlp"); assertInit(pr); assertReadProps(pr); assertNoAccessControlException(pr); } @Test public void testJnlpApplicationLaunchWithPolicy() throws Exception { writePolicy(); assertPolicyExists(); ProcessResult pr = server.executeJavawsHeadless("CustomPoliciesApplication.jnlp"); assertInit(pr); assertReadProps(pr); assertNoAccessControlException(pr); } @NeedsDisplay @Test @TestInBrowsers(testIn = { Browsers.one }) public void testHtmlLaunch() throws Exception { assertNoPolicyExists(); RulesFolowingClosingListener listener = new RulesFolowingClosingListener(); listener.addContainsRule("CustomPolicies applet read:"); ProcessResult pr = server.executeBrowser("CustomPolicies.html", listener, null); assertInit(pr); assertAccessControlException(pr); } @NeedsDisplay @Test @TestInBrowsers(testIn = { Browsers.one }) public void testHtmlJnlpHrefLaunch() throws Exception { assertNoPolicyExists(); RulesFolowingClosingListener listener = new RulesFolowingClosingListener(); listener.addContainsRule("CustomPolicies applet read:"); ProcessResult pr = server.executeBrowser("CustomPoliciesJnlpHref.html", listener, null); assertInit(pr); assertAccessControlException(pr); } @Test public void testJnlpAppletLaunch() throws Exception { assertNoPolicyExists(); ProcessResult pr = server.executeJavawsHeadless("CustomPoliciesApplet.jnlp"); assertInit(pr); assertAccessControlException(pr); } @Test public void testJnlpApplicationLaunch() throws Exception { assertNoPolicyExists(); ProcessResult pr = server.executeJavawsHeadless("CustomPoliciesApplication.jnlp"); assertInit(pr); assertAccessControlException(pr); } private void assertAccessControlException(ProcessResult pr) { assertTrue("Applet should not have been able to read user.home", pr.stdout.contains("AccessControlException: access denied")); } private void assertPolicyExists() { assertTrue("A user policy file should be installed", policy.isFile()); } private void assertNoPolicyExists() { assertFalse("A user policy file should not be installed", policy.isFile()); } private void assertInit(ProcessResult pr) { assertTrue("Applet should have initialized", pr.stdout.contains("CustomPolicies applet read:")); } private void assertReadProps(ProcessResult pr) { assertTrue("stdout should contain user.home", pr.stdout.contains(System.getProperty("user.home"))); } private void assertNoAccessControlException(ProcessResult pr) { assertFalse("Applet should have been able to read user.home", pr.stdout.contains("AccessControlException: access denied")); } } icedtea-web-1.6.2/tests/reproducers/simple/CustomPolicies/PaxHeaders.17941/srcs0000644000000000000000000000013112654402377024273 xustar0030 mtime=1454507263.222432781 29 atime=1454507658.77815737 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/CustomPolicies/srcs/0000755000175000002070000000000012654402377025074 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/CustomPolicies/srcs/PaxHeaders.17941/CustomPolicies.java0000644000000000000000000000013212654402377030156 xustar0030 mtime=1454507263.222432781 30 atime=1454507327.305578123 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/CustomPolicies/srcs/CustomPolicies.java0000644000175000002070000000105412654402377030701 0ustar00jvanekmock00000000000000import java.applet.Applet; import java.security.AccessControlException; public class CustomPolicies extends Applet { @Override public void start() { System.out.println("CustomPolicies applet read: " + read("user.home")); System.exit(0); } private String read(String key) { try { return System.getProperty(key); } catch (AccessControlException ace) { return ace.toString(); } } public static void main(String[] args) { new CustomPolicies().start(); } } icedtea-web-1.6.2/tests/reproducers/simple/CustomPolicies/PaxHeaders.17941/resources0000644000000000000000000000013112654402377025333 xustar0030 mtime=1454507263.222432781 29 atime=1454507658.77815737 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/CustomPolicies/resources/0000755000175000002070000000000012654402377026134 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/CustomPolicies/resources/PaxHeaders.17941/CustomPoliciesJ0000644000000000000000000000013212654402377030410 xustar0030 mtime=1454507263.222432781 30 atime=1454507327.305578123 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/CustomPolicies/resources/CustomPoliciesJnlpHref.html0000644000175000002070000000343312654402377033420 0ustar00jvanekmock00000000000000 icedtea-web-1.6.2/tests/reproducers/simple/CustomPolicies/resources/PaxHeaders.17941/CustomPoliciesA0000644000000000000000000000013212654402377030377 xustar0030 mtime=1454507263.222432781 30 atime=1454507327.305578123 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/CustomPolicies/resources/CustomPoliciesApplication.jnlp0000644000175000002070000000431412654402377034151 0ustar00jvanekmock00000000000000 CustomPoliciesApplication IcedTea Test that unsigned applets can perform privileged actions when granted by custom policies icedtea-web-1.6.2/tests/reproducers/simple/CustomPolicies/resources/PaxHeaders.17941/CustomPoliciesA0000644000000000000000000000013212654402377030377 xustar0030 mtime=1454507263.222432781 30 atime=1454507327.305578123 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/CustomPolicies/resources/CustomPoliciesApplet.jnlp0000644000175000002070000000427012654402377033134 0ustar00jvanekmock00000000000000 CustomPoliciesApplet IcedTea Test that unsigned applets can perform privileged actions when granted by custom policies icedtea-web-1.6.2/tests/reproducers/simple/CustomPolicies/resources/PaxHeaders.17941/CustomPolicies.0000644000000000000000000000013212654402377030354 xustar0030 mtime=1454507263.221432794 30 atime=1454507327.305578123 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/CustomPolicies/resources/CustomPolicies.html0000644000175000002070000000350412654402377031766 0ustar00jvanekmock00000000000000 icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/CreateClassLoader0000644000000000000000000000013112654402377023677 xustar0030 mtime=1454507263.221432794 29 atime=1454507658.77815737 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/CreateClassLoader/0000755000175000002070000000000012654402377024500 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/CreateClassLoader/PaxHeaders.17941/testcases0000644000000000000000000000013112654402377025675 xustar0030 mtime=1454507263.221432794 29 atime=1454507658.77815737 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/CreateClassLoader/testcases/0000755000175000002070000000000012654402377026476 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/CreateClassLoader/testcases/PaxHeaders.17941/CreateClassL0000644000000000000000000000013212654402377030203 xustar0030 mtime=1454507263.221432794 30 atime=1454507327.305578123 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/CreateClassLoader/testcases/CreateClassLoaderTest.java0000644000175000002070000000505212654402377033523 0ustar00jvanekmock00000000000000/* CreateClassLoaderTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import org.junit.Assert; import org.junit.Test; public class CreateClassLoaderTest { private static ServerAccess server = new ServerAccess(); @Test public void CreateClassLoaderLunch1() throws Exception { ProcessResult pr = server.executeJavawsHeadless(null, "/CreateClassLoader.jnlp"); String s = "(?s).*java.security.AccessControlException.{0,5}access denied.{0,5}java.lang.RuntimePermission.{0,5}" + "createClassLoader" + ".*"; Assert.assertTrue("Stderr should match "+s+" but didn't",pr.stderr.matches(s)); String cc="ClassNotFoundException"; Assert.assertFalse("stderr should NOT contains `"+cc+"`, but did",pr.stderr.contains(cc)); Assert.assertFalse("CreateClassLoaderLunch1 should not be terminated, but was",pr.wasTerminated); Assert.assertEquals((Integer) 0, pr.returnValue); } } icedtea-web-1.6.2/tests/reproducers/simple/CreateClassLoader/PaxHeaders.17941/srcs0000644000000000000000000000013112654402377024651 xustar0030 mtime=1454507263.221432794 29 atime=1454507658.77815737 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/CreateClassLoader/srcs/0000755000175000002070000000000012654402377025452 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/CreateClassLoader/srcs/PaxHeaders.17941/CreateClassLoader0000644000000000000000000000013212654402377030172 xustar0030 mtime=1454507263.221432794 30 atime=1454507327.304578136 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/CreateClassLoader/srcs/CreateClassLoader.java0000644000175000002070000000351612654402377031642 0ustar00jvanekmock00000000000000/* CreateClassLoader.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.URL; import java.net.URLClassLoader; public class CreateClassLoader { public static void main(String[] args) throws Exception { URLClassLoader ucl = new URLClassLoader(new URL[0]); } } icedtea-web-1.6.2/tests/reproducers/simple/CreateClassLoader/PaxHeaders.17941/resources0000644000000000000000000000013112654402377025711 xustar0030 mtime=1454507263.220432808 29 atime=1454507658.77815737 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/CreateClassLoader/resources/0000755000175000002070000000000012654402377026512 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/CreateClassLoader/resources/PaxHeaders.17941/CreateClassL0000644000000000000000000000013212654402377030217 xustar0030 mtime=1454507263.220432808 30 atime=1454507327.304578136 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/CreateClassLoader/resources/CreateClassLoader.jnlp0000644000175000002070000000377212654402377032730 0ustar00jvanekmock00000000000000 set context classloader IcedTea icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/CountingApplet20000644000000000000000000000013112654402377023375 xustar0030 mtime=1454507263.220432808 29 atime=1454507658.77815737 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/CountingApplet2/0000755000175000002070000000000012654402377024176 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/CountingApplet2/PaxHeaders.17941/srcs0000644000000000000000000000013112654402377024347 xustar0030 mtime=1454507263.220432808 29 atime=1454507658.77815737 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/CountingApplet2/srcs/0000755000175000002070000000000012654402377025150 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/CountingApplet2/srcs/PaxHeaders.17941/CountingApplet2.jav0000644000000000000000000000013212654402377030145 xustar0030 mtime=1454507263.220432808 30 atime=1454507327.304578136 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/CountingApplet2/srcs/CountingApplet2.java0000644000175000002070000000664312654402377031042 0ustar00jvanekmock00000000000000 import java.applet.Applet; import java.awt.BorderLayout; import javax.swing.JLabel; import javax.swing.SwingUtilities; /* CountingApplet1.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class CountingApplet2 extends Applet { public static void main(String[] args) throws InterruptedException { Integer counter = null; if (args.length > 0) { counter = new Integer(args[0]); } int i = 0; while (true) { System.out.println("counting... " + i); if (counter != null && i == counter.intValue()) { System.exit(-i); } i++; Thread.sleep(1000); } } @Override public void init() { System.out.println("applet was initialised"); final CountingApplet2 self = this; SwingUtilities.invokeLater(new Runnable() { @Override public void run() { self.setLayout(new BorderLayout()); self.add(new JLabel("C2")); self.validateTree(); self.repaint(); } }); } @Override public void start() { System.out.println("applet was started"); String s = getParameter("kill"); final String[] params; if (s != null) { params = new String[]{s}; } else { params = new String[0]; } new Thread(new Runnable() { @Override public void run() { try { main(params); } catch (Exception ex) { ex.printStackTrace(); } } }).start(); } @Override public void stop() { System.out.println("applet was stopped"); } @Override public void destroy() { System.out.println("applet will be destroyed"); } } icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/CountingApplet10000644000000000000000000000013112654402377023374 xustar0030 mtime=1454507263.220432808 29 atime=1454507658.77815737 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/CountingApplet1/0000755000175000002070000000000012654402377024175 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/CountingApplet1/PaxHeaders.17941/testcases0000644000000000000000000000013112654402377025372 xustar0030 mtime=1454507263.220432808 29 atime=1454507658.77815737 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/CountingApplet1/testcases/0000755000175000002070000000000012654402377026173 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/CountingApplet1/testcases/PaxHeaders.17941/ParallelApplet0000644000000000000000000000013212654402377030275 xustar0030 mtime=1454507263.220432808 30 atime=1454507327.304578136 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/CountingApplet1/testcases/ParallelAppletsTest.java0000644000175000002070000002064312654402377032770 0ustar00jvanekmock00000000000000/* ParallelAppletsTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import org.junit.Assert; import org.junit.Test; public class ParallelAppletsTest extends BrowserTest { @Test @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay public void testParallelAppletsTest1Ex2s() throws Exception { ProcessResult pr = server.executeBrowser("ParallelAppletsTest_1EE_x_2s.html"); checkSimpleSignedStarted(pr); checkNotInitialised(pr); } @Test @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay public void testParallelAppletsTest1x2E() throws Exception { ProcessResult pr = server.executeBrowser("ParallelAppletsTest_1_x_2EE.html"); checkExactCounts(1, 10, pr); checkNotInitialised(pr); } @Test @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay public void testParallelAppletsTest1x2e() throws Exception { ProcessResult pr = server.executeBrowser("ParallelAppletsTest_1_x_2e.html"); checkExactCounts(1, 10, pr); checkException(pr); } @Test @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay public void testParallelAppletsTest1ex2s() throws Exception { ProcessResult pr = server.executeBrowser("ParallelAppletsTest_1e_x_2s.html"); checkSimpleSignedStarted(pr); checkException(pr); } @Test @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay public void testParallelAppletsTest1sx2() throws Exception { ProcessResult pr = server.executeBrowser("ParallelAppletsTest_1s_x_2.html"); checkAppletStarted(pr); checkSimpleSignedStarted(pr); } @Test @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay public void testParallelAppletsTest1sx2s() throws Exception { ProcessResult pr = server.executeBrowser("ParallelAppletsTest_1s_x_2s.html"); int found=countCounts(SimpleSignedStarted, pr.stdout); assertExactCount(SimpleSignedStarted, 2, found); } @Test @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay public void testParallelAppletsTest1sx2ssk() throws Exception { ProcessResult pr = server.executeBrowser("ParallelAppletsTest_1s_x_2ss.html"); checkSimpleSigned2Started(pr); checkSimpleSignedStarted(pr); } @Test @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay public void testParallelAppletsTest1x2sk() throws Exception { ProcessResult pr = server.executeBrowser("ParallelAppletsTest_1_x_2sk.html"); checkExitNotAllowed(pr); checkAtLeastCounts(1, 10, pr); checkExactCounts(2, 5, pr); } @Test @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay public void testParallelAppletsTest1kx2() throws Exception { ProcessResult pr = server.executeBrowser("ParallelAppletsTest_1k_x_2.html"); checkExitNotAllowed(pr); checkAtLeastCounts(1, 10, pr); checkExactCounts(2, 5, pr); } @Test @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay public void testParallelAppletsTest1x2() throws Exception { ProcessResult pr = server.executeBrowser("ParallelAppletsTest_1_x_2.html"); checkExactCounts(2, 10, pr); } @Test @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay public void testParallelAppletsTest1x1() throws Exception { ProcessResult pr = server.executeBrowser("ParallelAppletsTest_1_x_1.html"); checkExactCounts(2, 10, pr); } private static final String ACE = "java.security.AccessControlException"; private static final String Sexit = "System.exit()"; private static final String LE1 = "net.sourceforge.jnlp.LaunchException"; private static final String LE2 = "Fatal: Initialization Error"; private static final String Cinit = "Could not initialize applet"; private static final String CountStub = "counting... "; private static final String SimpleSignedStarted = "AppletTestSigned was started"; private static final String SimpleSigned2Started = "AppletTestSigned2 was started"; private static final String AppletStarted = "applet was started"; private static final String AppletThrowedException = "java.lang.RuntimeException: Correct exception"; private void checkExitNotAllowed(ProcessResult pr) { Assert.assertTrue("Applets cant call " + Sexit, pr.stderr.matches("(?s).*" + ACE + ".*" + Sexit + ".*")); } private void checkNotInitialised(ProcessResult pr) { Assert.assertTrue("Applets should not be initialised ", pr.stderr.matches("(?s).*" + LE1 + ".*" + LE2 + ".*" + Cinit + ".*")); } private void checkSimpleSignedStarted(ProcessResult pr) { Assert.assertTrue("Applet's start should be confirmed by " + SimpleSignedStarted, pr.stdout.contains(SimpleSignedStarted)); } private void checkSimpleSigned2Started(ProcessResult pr) { Assert.assertTrue("Applet's start should be confirmed by " + SimpleSigned2Started, pr.stdout.contains(SimpleSigned2Started)); } private void checkAppletStarted(ProcessResult pr) { Assert.assertTrue("Applet's start should be confirmed by " + AppletStarted, pr.stdout.contains(AppletStarted)); } private void checkException(ProcessResult pr) { Assert.assertTrue("Applet's exception should be confirmed by " + AppletThrowedException, pr.stderr.contains(AppletThrowedException)); } private void checkExactCounts(int howManyTimes, int countIdTill, ProcessResult pr) { for (int i = 0; i <= countIdTill; i++) { String countId = CountStub + i+"\n"; int found = countCounts(countId, pr.stdout); assertExactCount(countId, howManyTimes, found); } } private void assertExactCount(String what, int howManyTimes, int found) { Assert.assertEquals(what + " was expected exactly " + howManyTimes + " but was found " + found, howManyTimes, found); } private void checkAtLeastCounts(int howManyTimes, int countIdTill, ProcessResult pr) { for (int i = 0; i <= countIdTill; i++) { String countId = CountStub + i; int found = countCounts(countId, pr.stdout); Assert.assertTrue(countId + " was expected et least " + howManyTimes + " but was found " + found, found >= howManyTimes); } } private int countCounts(String what, String where) { int lastIndex = 0; int count = 0; while (lastIndex != -1) { lastIndex = where.indexOf(what, lastIndex); if (lastIndex != -1) { count++; lastIndex += what.length(); } } return count; } } icedtea-web-1.6.2/tests/reproducers/simple/CountingApplet1/PaxHeaders.17941/srcs0000644000000000000000000000013112654402377024346 xustar0030 mtime=1454507263.219432821 29 atime=1454507658.77815737 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/CountingApplet1/srcs/0000755000175000002070000000000012654402377025147 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/CountingApplet1/srcs/PaxHeaders.17941/CountingApplet1.jav0000644000000000000000000000013212654402377030143 xustar0030 mtime=1454507263.219432821 30 atime=1454507327.304578136 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/CountingApplet1/srcs/CountingApplet1.java0000644000175000002070000000664312654402377031040 0ustar00jvanekmock00000000000000 import java.applet.Applet; import java.awt.BorderLayout; import javax.swing.JLabel; import javax.swing.SwingUtilities; /* CountingApplet1.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class CountingApplet1 extends Applet { public static void main(String[] args) throws InterruptedException { Integer counter = null; if (args.length > 0) { counter = new Integer(args[0]); } int i = 0; while (true) { System.out.println("counting... " + i); if (counter != null && i == counter.intValue()) { System.exit(-i); } i++; Thread.sleep(1000); } } @Override public void init() { System.out.println("applet was initialised"); final CountingApplet1 self = this; SwingUtilities.invokeLater(new Runnable() { @Override public void run() { self.setLayout(new BorderLayout()); self.add(new JLabel("C1")); self.validateTree(); self.repaint(); } }); } @Override public void start() { System.out.println("applet was started"); String s = getParameter("kill"); final String[] params; if (s != null) { params = new String[]{s}; } else { params = new String[0]; } new Thread(new Runnable() { @Override public void run() { try { main(params); } catch (Exception ex) { ex.printStackTrace(); } } }).start(); } @Override public void stop() { System.out.println("applet was stopped"); } @Override public void destroy() { System.out.println("applet will be destroyed"); } } icedtea-web-1.6.2/tests/reproducers/simple/CountingApplet1/PaxHeaders.17941/resources0000644000000000000000000000013112654402377025406 xustar0030 mtime=1454507263.219432821 29 atime=1454507658.77815737 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/CountingApplet1/resources/0000755000175000002070000000000012654402377026207 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/CountingApplet1/resources/PaxHeaders.17941/ParallelApplet0000644000000000000000000000031212654402377030311 xustar00112 path=icedtea-web-1.6.2/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1s_x_2ss.html 30 mtime=1454507263.219432821 30 atime=1454507327.303578149 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1s_x_2ss.ht0000644000175000002070000000363212654402377034216 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/simple/CountingApplet1/resources/PaxHeaders.17941/ParallelApplet0000644000000000000000000000031112654402377030310 xustar00111 path=icedtea-web-1.6.2/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1s_x_2s.html 30 mtime=1454507263.219432821 30 atime=1454507327.303578149 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1s_x_2s.htm0000644000175000002070000000406612654402377034212 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/simple/CountingApplet1/resources/PaxHeaders.17941/ParallelApplet0000644000000000000000000000013212654402377030311 xustar0030 mtime=1454507263.219432821 30 atime=1454507327.303578149 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1s_x_2.html0000644000175000002070000000421012654402377034172 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/simple/CountingApplet1/resources/PaxHeaders.17941/ParallelApplet0000644000000000000000000000013212654402377030311 xustar0030 mtime=1454507263.218432834 30 atime=1454507327.303578149 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1k_x_2.html0000644000175000002070000000367012654402377034173 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/simple/CountingApplet1/resources/PaxHeaders.17941/ParallelApplet0000644000000000000000000000031112654402377030310 xustar00111 path=icedtea-web-1.6.2/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1e_x_2s.html 30 mtime=1454507263.218432834 30 atime=1454507327.303578149 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1e_x_2s.htm0000644000175000002070000000362112654402377034170 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/simple/CountingApplet1/resources/PaxHeaders.17941/ParallelApplet0000644000000000000000000000031112654402377030310 xustar00111 path=icedtea-web-1.6.2/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_2sk.html 30 mtime=1454507263.218432834 30 atime=1454507327.303578149 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_2sk.htm0000644000175000002070000000370512654402377034201 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/simple/CountingApplet1/resources/PaxHeaders.17941/ParallelApplet0000644000000000000000000000013212654402377030311 xustar0030 mtime=1454507263.218432834 30 atime=1454507327.303578149 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_2e.html0000644000175000002070000000361512654402377034164 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/simple/CountingApplet1/resources/PaxHeaders.17941/ParallelApplet0000644000000000000000000000031112654402377030310 xustar00111 path=icedtea-web-1.6.2/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_2EE.html 30 mtime=1454507263.217432848 30 atime=1454507327.302578163 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_2EE.htm0000644000175000002070000000361412654402377034054 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/simple/CountingApplet1/resources/PaxHeaders.17941/ParallelApplet0000644000000000000000000000013212654402377030311 xustar0030 mtime=1454507263.217432848 30 atime=1454507327.302578163 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_2.html0000644000175000002070000000363312654402377034017 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/simple/CountingApplet1/resources/PaxHeaders.17941/ParallelApplet0000644000000000000000000000013212654402377030311 xustar0030 mtime=1454507263.217432848 30 atime=1454507327.302578163 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_1.html0000644000175000002070000000362512654402377034017 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/simple/CountingApplet1/resources/PaxHeaders.17941/ParallelApplet0000644000000000000000000000031212654402377030311 xustar00112 path=icedtea-web-1.6.2/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1EE_x_2s.html 30 mtime=1454507263.217432848 30 atime=1454507327.302578163 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1EE_x_2s.ht0000644000175000002070000000362612654402377034065 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/CodebasesAtts0000644000000000000000000000013112654402377023103 xustar0030 mtime=1454507263.215432874 29 atime=1454507658.77815737 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/CodebasesAtts/0000755000175000002070000000000012654402377023704 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/CodebasesAtts/PaxHeaders.17941/testcases0000644000000000000000000000013112654402377025101 xustar0030 mtime=1454507263.216432861 29 atime=1454507658.77815737 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/CodebasesAtts/testcases/0000755000175000002070000000000012654402377025702 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/CodebasesAtts/testcases/PaxHeaders.17941/CodebasesAttsNoD0000644000000000000000000000013212654402377030227 xustar0030 mtime=1454507263.216432861 30 atime=1454507327.302578163 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/CodebasesAtts/testcases/CodebasesAttsNoDialogsTest3.java0000644000175000002070000004140312654402377034016 0ustar00jvanekmock00000000000000/* CodebasesAttsNoDialogsTest1.java Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; import java.util.AbstractMap; import java.util.Arrays; import java.util.List; import java.util.Random; import net.sourceforge.jnlp.OptionsDefinitions; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.ServerLauncher; import net.sourceforge.jnlp.annotations.Bug; import net.sourceforge.jnlp.annotations.KnownToFail; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.Browser; import net.sourceforge.jnlp.browsertesting.BrowserFactory; import net.sourceforge.jnlp.browsertesting.BrowserTest; import static net.sourceforge.jnlp.browsertesting.BrowserTest.server; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.AutoErrorClosingListener; import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.ManifestAttributesChecker; import net.sourceforge.jnlp.security.appletextendedsecurity.AppletSecurityLevel; import net.sourceforge.jnlp.tools.DeploymentPropertiesModifier; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; /** * * null, empty, none, wrong, correct jnlp x html different codebases. * * no dialogs should be appeared. Second testsuite with ALL dialogs (head only) * * */ public class CodebasesAttsNoDialogsTest3 extends BrowserTest { private static final String appletCloseString = CodebasesAttsNoDialogsTest1.appletCloseString; private static final String[] HTMLA = CodebasesAttsNoDialogsTest1.JAVAWS_HTML_ARRAY; private static final List HTMLL = CodebasesAttsNoDialogsTest1.JAVAWS_HTML_LIST; private static final String JNLPAPP = CodebasesAttsNoDialogsTest1.JNLPAPP; private static final String JNLPAPPLET = CodebasesAttsNoDialogsTest1.JNLPAPPLET; private static final String HTML = CodebasesAttsNoDialogsTest1.HTML; private static final String HTMLHREF = CodebasesAttsNoDialogsTest1.HTMLHREF; private static final String CodebasesAtts = CodebasesAttsNoDialogsTest1.CodebasesAtts; private static ServerLauncher secondValidServer; private static ServerLauncher thirdValidServer; private static DeploymentPropertiesModifier.MultipleDeploymentPropertiesModifier ensuredDP; private static final String ABS = "ABS"; private static boolean WAS; private static final boolean Force_Outputs = false;//set to true to see outputs of apps in big test @BeforeClass public static void initSecondaryServers() throws IOException { secondValidServer = ServerAccess.getIndependentInstanceOnTmpDir(); thirdValidServer = ServerAccess.getIndependentInstanceOnTmpDir(); } @AfterClass public static void stopSecondaryServers() throws IOException { secondValidServer.stop(); thirdValidServer.stop(); } @BeforeClass public static void setProperties() throws IOException { ensuredDP = new DeploymentPropertiesModifier.MultipleDeploymentPropertiesModifier( new AbstractMap.SimpleEntry(DeploymentConfiguration.KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK, ManifestAttributesChecker.MANIFEST_ATTRIBUTES_CHECK.NONE.name()), new AbstractMap.SimpleEntry(DeploymentConfiguration.KEY_SECURITY_LEVEL, AppletSecurityLevel.ALLOW_UNSIGNED.name()) ); ensuredDP.setProperties(); } @AfterClass public static void resetProperties() throws IOException { ensuredDP.restoreProperties(); } @BeforeClass public static void setOutput() throws IOException { WAS = ServerAccess.LOGS_REPRINT; } @AfterClass public static void resetOutput() throws IOException { ServerAccess.LOGS_REPRINT = WAS; } /* *Most fun. jnlp/applet is on page, jnlp on second and resource on third * (those should fail) * As adition, jnlphref have applet on one side, jnlp on second and this one have codebase on THIRD * (agian representation of that triple bug from CodebasesAttsNoDialogsTest1 */ //@Test test is disbaled. Is not testing much more then other CodebasesAttsNoDialogsTest1-3 tests and is fragile. Also its behaviour may change, if loading form non-codebase/docbase resources will be prohibited //@TestInBrowsers(testIn = Browsers.one) hacked manually. We really do not wont to iterate this test browser-times public void threeServers__okValues() throws IOException, Exception { Browser localBrowser = BrowserFactory.getFactory().getRandom(); setBrowser(localBrowser.getID()); Browsers browserBackup = getBrowser(); try { int totalCounter = 0; //we know that "" and " " behaves in same way, so let sminimalize this lopp //abs get substituted by hardcoded path String[] validValues = new String[]{ABS, null, "", "."}; for (int a = 0; a < validValues.length; a++) { String codebaseIn = validValues[a]; for (int b = 0; b < validValues.length; b++) { String jnlpHrefIn = validValues[b]; for (int c = 0; c < validValues.length; c++) { String jarIn = validValues[c]; if (jarIn != null) { if (jarIn.trim().isEmpty()) { jarIn = null; } } if (jnlpHrefIn != null) { if (jnlpHrefIn.trim().isEmpty()) { jnlpHrefIn = null; } } //ServerLauncher[] servers = new ServerLauncher[]{ServerAccess.getIndependentInstance(), secondValidServer, thirdValidServer}; //for (abs x abs or abs x relative or realtive x relative) x (nonm jnlp href) are enough two servers //lets yousee tmp ones, as they have aligned id and BID ServerLauncher[] servers = new ServerLauncher[]{secondValidServer, thirdValidServer}; for (int i = 0; i < servers.length; i++) { ServerLauncher usedServer = servers[i]; String[] codebaseJnlpHrefJar = setByServer(usedServer, codebaseIn, jnlpHrefIn, jarIn); CodebasesAttsNoDialogsTest1.prepareSingle(codebaseJnlpHrefJar[0], codebaseJnlpHrefJar[1], codebaseJnlpHrefJar[2], ("" + (i + 1)).charAt(0), usedServer.getDir(), CodebasesAttsNoDialogsTest1.files); } for (int i = 0; i < servers.length; i++) { totalCounter++; ServerLauncher usedServer = servers[i]; //server is caller, only because it knows javaws/browser location ServerAccess.LOGS_REPRINT = Force_Outputs; ServerAccess.logOutputReprint(totalCounter + ") i=" + i + ", c=" + c + ", b=" + b + ", a=" + a); ServerAccess.logOutputReprint(usedServer.getUrl().toExternalForm() + ": " + codebaseIn + ", " + jnlpHrefIn + ", " + jarIn); ServerAccess.logOutputReprint("jnlpapp " + JNLPAPP); ServerAccess.LOGS_REPRINT = false; ProcessResult pr1 = server.executeJavawsUponUrl(null, usedServer.getUrl(JNLPAPP), new AutoOkClosingListener(), new AutoErrorClosingListener()); ServerAccess.LOGS_REPRINT = Force_Outputs; ServerAccess.logOutputReprint(pr1.stdout); ServerAccess.logOutputReprint(pr1.stderr); generalPass(pr1); ServerAccess.logOutputReprint("jnlpapplet " + JNLPAPPLET); ServerAccess.LOGS_REPRINT = false; ProcessResult pr2 = server.executeJavawsUponUrl(null, usedServer.getUrl(JNLPAPPLET), new AutoOkClosingListener(), new AutoErrorClosingListener()); ServerAccess.LOGS_REPRINT = Force_Outputs; ServerAccess.logOutputReprint(pr2.stdout); ServerAccess.logOutputReprint(pr2.stderr); generalPass(pr2); ServerAccess.logOutputReprint("html " + HTML); ServerAccess.LOGS_REPRINT = false; ProcessResult pr3 = server.executeBrowser(null, usedServer.getUrl(HTML), new AutoOkClosingListener(), new AutoErrorClosingListener()); ServerAccess.LOGS_REPRINT = Force_Outputs; ServerAccess.logOutputReprint(pr3.stdout); ServerAccess.logOutputReprint(pr3.stderr); generalPass(pr3); ServerAccess.logOutputReprint("javaws html " + HTML); ServerAccess.LOGS_REPRINT = false; ProcessResult pr33 = server.executeJavawsUponUrl(HTMLL, usedServer.getUrl(HTML), new AutoOkClosingListener(), new AutoErrorClosingListener()); ServerAccess.LOGS_REPRINT = Force_Outputs; ServerAccess.logOutputReprint(pr33.stdout); ServerAccess.logOutputReprint(pr33.stderr); generalPass(pr33); ServerAccess.logOutputReprint("htmlhref " + HTMLHREF); ServerAccess.LOGS_REPRINT = false; ProcessResult pr4 = server.executeBrowser(null, usedServer.getUrl(HTMLHREF), new AutoOkClosingListener(), new AutoErrorClosingListener()); ServerAccess.LOGS_REPRINT = Force_Outputs; ServerAccess.logOutputReprint(pr4.stdout); ServerAccess.logOutputReprint(pr4.stderr); generalPass(pr4); ServerAccess.logOutputReprint("javaws htmlhref " + HTMLHREF); ServerAccess.LOGS_REPRINT = false; ProcessResult pr44 = server.executeJavawsUponUrl(HTMLL, usedServer.getUrl(HTMLHREF), new AutoOkClosingListener(), new AutoErrorClosingListener()); ServerAccess.LOGS_REPRINT = Force_Outputs; ServerAccess.logOutputReprint(pr44.stdout); ServerAccess.logOutputReprint(pr44.stderr); generalPass(pr44); } } } } } finally { setBrowser(browserBackup); } } //@Test @TestInBrowsers(testIn = Browsers.one) //all three are valid, but on l one bug is supported now @Bug(id = "http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2016-January/034446.html") //@Bug(id = "http://icedtea.classpath.org/hg/release/icedtea-web-1.6/rev/0d9faf51357d") //@Bug(id = "http://icedtea.classpath.org/hg/icedtea-web/rev/22b7becd48a public void threeServers_resourceIsElsewhere1_html() throws IOException, Exception { CodebasesAttsNoDialogsTest1.prepareSingle((String) null, secondValidServer.getUrl().toExternalForm(), null, '1', ServerAccess.getInstance().getDir(), CodebasesAttsNoDialogsTest1.files); CodebasesAttsNoDialogsTest1.prepareSingle((String) null, null, thirdValidServer.getUrl().toExternalForm(), '2', secondValidServer.getDir(), CodebasesAttsNoDialogsTest1.files); CodebasesAttsNoDialogsTest1.prepareSingle((String) null, null, null, '3', thirdValidServer.getDir(), CodebasesAttsNoDialogsTest1.files); ServerAccess.LOGS_REPRINT = Force_Outputs; ServerAccess.logOutputReprint("htmlhref " + HTMLHREF); ServerAccess.LOGS_REPRINT = false; ProcessResult pr4 = server.executeBrowser(null, ServerAccess.getInstance().getUrl(HTMLHREF), new AutoOkClosingListener(), new AutoErrorClosingListener()); ServerAccess.LOGS_REPRINT = Force_Outputs; ServerAccess.logOutputReprint(pr4.stdout); ServerAccess.logOutputReprint(pr4.stderr); Assert.assertTrue(pr4.stdout.contains("id: 1")); //param is from applet page Assert.assertTrue(pr4.stdout.contains("BID3")); ServerAccess.LOGS_REPRINT = WAS; } @Test @Bug(id = "PR2805") @KnownToFail //all three are valid, but on l one bug is supported now, but 2805 have priority //@Bug(id = "http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2016-January/034446.html") //@Bug(id = "http://icedtea.classpath.org/hg/release/icedtea-web-1.6/rev/0d9faf51357d") //@Bug(id = "http://icedtea.classpath.org/hg/icedtea-web/rev/22b7becd48a public void threeServers_resourceIsElsewhere1_javawshtml() throws IOException, Exception { CodebasesAttsNoDialogsTest1.prepareSingle((String) null, secondValidServer.getUrl().toExternalForm(), null, '1', ServerAccess.getInstance().getDir(), CodebasesAttsNoDialogsTest1.files); CodebasesAttsNoDialogsTest1.prepareSingle((String) null, null, thirdValidServer.getUrl().toExternalForm(), '2', secondValidServer.getDir(), CodebasesAttsNoDialogsTest1.files); CodebasesAttsNoDialogsTest1.prepareSingle((String) null, null, null, '3', thirdValidServer.getDir(), CodebasesAttsNoDialogsTest1.files); ServerAccess.LOGS_REPRINT = Force_Outputs; ServerAccess.logOutputReprint("javaws htmlhref " + HTMLHREF); ServerAccess.LOGS_REPRINT = false; ProcessResult pr44 = server.executeJavawsUponUrl(HTMLL, ServerAccess.getInstance().getUrl(HTMLHREF), new AutoOkClosingListener(), new AutoErrorClosingListener()); ServerAccess.LOGS_REPRINT = Force_Outputs; ServerAccess.logOutputReprint(pr44.stdout); ServerAccess.logOutputReprint(pr44.stderr); //Assert.assertTrue(pr44.stdout.contains("id: 2")); //param is from jnlphreffed file. This may be considered bug Assert.assertTrue(pr44.stdout.contains("BID3")); Assert.assertTrue(pr44.stdout.contains("id: 1")); //should be same as threeServers_resourceIsElsewhere1_html ServerAccess.LOGS_REPRINT = WAS; } private String[] setByServer(ServerLauncher instance, String codebaseIn, String jnlpHrefIn, String jarIn) throws MalformedURLException { String[] codebaseJnlpHrefJar = new String[]{codebaseIn, jnlpHrefIn, jarIn}; if (ABS.equals(codebaseIn)) { codebaseJnlpHrefJar[0] = instance.getUrl().toExternalForm(); } if (ABS.equals(jnlpHrefIn)) { codebaseJnlpHrefJar[1] = instance.getUrl().toExternalForm(); } if (ABS.equals(jarIn)) { codebaseJnlpHrefJar[2] = instance.getUrl().toExternalForm(); } return codebaseJnlpHrefJar; } private void generalPass(ProcessResult pr1) { generalPass(pr1.stdout); } private void generalPass(String s) { Assert.assertTrue(s.contains("id: ")); Assert.assertTrue(s.contains("BID")); } } icedtea-web-1.6.2/tests/reproducers/simple/CodebasesAtts/testcases/PaxHeaders.17941/CodebasesAttsNoD0000644000000000000000000000013212654402377030227 xustar0030 mtime=1454507263.216432861 30 atime=1454507327.301578176 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/CodebasesAtts/testcases/CodebasesAttsNoDialogsTest2.java0000644000175000002070000005657512654402377034035 0ustar00jvanekmock00000000000000/* CodebasesAttsNoDialogsTest1.java Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.io.IOException; import java.net.URL; import java.util.AbstractMap; 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 net.sourceforge.jnlp.annotations.Bug; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.AutoErrorClosingListener; import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.ManifestAttributesChecker; import net.sourceforge.jnlp.security.appletextendedsecurity.AppletSecurityLevel; import net.sourceforge.jnlp.tools.DeploymentPropertiesModifier; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; /** * * null, empty, none, wrong, correct jnlp x html different codebases. * * no dialogs should be appeared. Second testsuite with ALL dialogs (head only) * * */ public class CodebasesAttsNoDialogsTest2 extends BrowserTest { private static final String appletCloseString = CodebasesAttsNoDialogsTest1.appletCloseString; private static final String[] HTMLA = CodebasesAttsNoDialogsTest1.JAVAWS_HTML_ARRAY; private static final List HTMLL = CodebasesAttsNoDialogsTest1.JAVAWS_HTML_LIST; private static final String JNLPAPP = CodebasesAttsNoDialogsTest1.JNLPAPP; private static final String JNLPAPPLET = CodebasesAttsNoDialogsTest1.JNLPAPPLET; private static final String HTML = CodebasesAttsNoDialogsTest1.HTML; private static final String HTMLHREF = CodebasesAttsNoDialogsTest1.HTMLHREF; private static final String CodebasesAtts = CodebasesAttsNoDialogsTest1.CodebasesAtts; private static ServerLauncher secondValidServer; private static DeploymentPropertiesModifier.MultipleDeploymentPropertiesModifier ensuredDP; @BeforeClass public static void initSecondaryServers() throws IOException { secondValidServer = ServerAccess.getIndependentInstanceOnTmpDir(); } @AfterClass public static void stopSecondaryServers() throws IOException { secondValidServer.stop(); } @BeforeClass public static void setProperties() throws IOException { ensuredDP = new DeploymentPropertiesModifier.MultipleDeploymentPropertiesModifier( new AbstractMap.SimpleEntry(DeploymentConfiguration.KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK, ManifestAttributesChecker.MANIFEST_ATTRIBUTES_CHECK.NONE.name()), new AbstractMap.SimpleEntry(DeploymentConfiguration.KEY_SECURITY_LEVEL, AppletSecurityLevel.ALLOW_UNSIGNED.name()) ); ensuredDP.setProperties(); } @AfterClass public static void resetProperties() throws IOException { ensuredDP.restoreProperties(); } //jnlp app @NeedsDisplay @Test public void codebasesAttsTestWorksJnlp1_NormalValid_normal() throws Exception { prepare(server.getUrl(), secondValidServer.getUrl()); ProcessResult pr = server.executeJavawsUponUrl(null, server.getUrl(JNLPAPP), new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 1")); Assert.assertTrue(pr.stdout.contains("BID0")); } @NeedsDisplay @Test public void codebasesAttsTestWorksJnlp1_NormalValid_second() throws Exception { prepare(server.getUrl(), secondValidServer.getUrl()); ProcessResult pr = server.executeJavawsUponUrl(null, secondValidServer.getUrl(JNLPAPP), new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 2")); Assert.assertTrue(pr.stdout.contains("BID2")); } @NeedsDisplay @Test public void codebasesAttsTestWorksJnlp1_ValidNormal_normal() throws Exception { prepare(secondValidServer.getUrl(), server.getUrl()); ProcessResult pr = server.executeJavawsUponUrl(null, server.getUrl(JNLPAPP), new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 1")); Assert.assertTrue(pr.stdout.contains("BID2")); } @NeedsDisplay @Test public void codebasesAttsTestWorksJnlp1_ValidNormal_second() throws Exception { prepare(secondValidServer.getUrl(), server.getUrl()); ProcessResult pr = server.executeJavawsUponUrl(null, secondValidServer.getUrl(JNLPAPP), new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 2")); Assert.assertTrue(pr.stdout.contains("BID0")); } //jnlp app let @NeedsDisplay @Test public void codebasesAttsTestWorksJnlp2_NormalValid_normal() throws Exception { prepare(server.getUrl(), secondValidServer.getUrl()); ProcessResult pr = server.executeJavawsUponUrl(null, server.getUrl(JNLPAPPLET), new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 1")); Assert.assertTrue(pr.stdout.contains("BID0")); } @NeedsDisplay @Test public void codebasesAttsTestWorksJnlp2_NormalValid_second() throws Exception { prepare(server.getUrl(), secondValidServer.getUrl()); ProcessResult pr = server.executeJavawsUponUrl(null, secondValidServer.getUrl(JNLPAPPLET), new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 2")); Assert.assertTrue(pr.stdout.contains("BID2")); } @NeedsDisplay @Test public void codebasesAttsTestWorksJnlp2_ValidNormal_normal() throws Exception { prepare(secondValidServer.getUrl(), server.getUrl()); ProcessResult pr = server.executeJavawsUponUrl(null, server.getUrl(JNLPAPPLET), new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 1")); Assert.assertTrue(pr.stdout.contains("BID2")); } @NeedsDisplay @Test public void codebasesAttsTestWorksJnlp2_ValidNormal_second() throws Exception { prepare(secondValidServer.getUrl(), server.getUrl()); ProcessResult pr = server.executeJavawsUponUrl(null, secondValidServer.getUrl(JNLPAPPLET), new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 2")); Assert.assertTrue(pr.stdout.contains("BID0")); } //html @NeedsDisplay @Test @TestInBrowsers(testIn = Browsers.one) public void codebasesAttsTestWorksHtml1_NormalValid_normal() throws Exception { prepare(server.getUrl(), secondValidServer.getUrl()); ProcessResult pr = server.executeBrowser(null, server.getUrl(HTML), new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 1")); Assert.assertTrue(pr.stdout.contains("BID0")); } @NeedsDisplay @Test @TestInBrowsers(testIn = Browsers.one) public void codebasesAttsTestWorksHtml1_NormalValid_second() throws Exception { prepare(server.getUrl(), secondValidServer.getUrl()); ProcessResult pr = server.executeBrowser(null, secondValidServer.getUrl(HTML), new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 2")); Assert.assertTrue(pr.stdout.contains("BID2")); } @NeedsDisplay @Test @TestInBrowsers(testIn = Browsers.one) public void codebasesAttsTestWorksHtml1_ValidNormal_normal() throws Exception { prepare(secondValidServer.getUrl(), server.getUrl()); ProcessResult pr = server.executeBrowser(null, server.getUrl(HTML), new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 1")); Assert.assertTrue(pr.stdout.contains("BID2")); } @NeedsDisplay @Test @TestInBrowsers(testIn = Browsers.one) public void codebasesAttsTestWorksHtml1_ValidNormal_second() throws Exception { prepare(secondValidServer.getUrl(), server.getUrl()); ProcessResult pr = server.executeBrowser(null, secondValidServer.getUrl(HTML), new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 2")); Assert.assertTrue(pr.stdout.contains("BID0")); } //htmlhref relative hrefs @NeedsDisplay @Test @TestInBrowsers(testIn = Browsers.one) public void codebasesAttsTestWorksHtml2_NormalValid_normal() throws Exception { prepare(server.getUrl(), secondValidServer.getUrl()); ProcessResult pr = server.executeBrowser(null, server.getUrl(HTMLHREF), new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 1")); Assert.assertTrue(pr.stdout.contains("BID0")); } @NeedsDisplay @Test @TestInBrowsers(testIn = Browsers.one) public void codebasesAttsTestWorksHtml2_NormalValid_second() throws Exception { prepare(server.getUrl(), secondValidServer.getUrl()); ProcessResult pr = server.executeBrowser(null, secondValidServer.getUrl(HTMLHREF), new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 2")); Assert.assertTrue(pr.stdout.contains("BID2")); } @NeedsDisplay @Test @TestInBrowsers(testIn = Browsers.one) public void codebasesAttsTestWorksHtml2_ValidNormal_normal() throws Exception { prepare(secondValidServer.getUrl(), server.getUrl()); ProcessResult pr = server.executeBrowser(null, server.getUrl(HTMLHREF), new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 1")); Assert.assertTrue(pr.stdout.contains("BID0")); //codebase is relative, so launchiong server is used to locate jnlp } @NeedsDisplay @Test @TestInBrowsers(testIn = Browsers.one) public void codebasesAttsTestWorksHtml2_ValidNormal_second() throws Exception { prepare(secondValidServer.getUrl(), server.getUrl()); ProcessResult pr = server.executeBrowser(null, secondValidServer.getUrl(HTMLHREF), new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 2")); Assert.assertTrue(pr.stdout.contains("BID2"));//jnlphref is relative, so launchiong server is used to locate jnlp } public void prepare(URL c1, URL c2) throws IOException { prepare(c1.toExternalForm(), c2.toExternalForm()); } public static void prepare(String codebase1, String codebase2) throws IOException { CodebasesAttsNoDialogsTest1.prepareSingle(codebase1, null, null, '1', ServerAccess.getInstance().getDir(), CodebasesAttsNoDialogsTest1.files); CodebasesAttsNoDialogsTest1.prepareSingle(codebase2, null, null, '2', secondValidServer.getDir(), CodebasesAttsNoDialogsTest1.files); } //htmlhref absolute hrefs @NeedsDisplay @Test @TestInBrowsers(testIn = Browsers.one) public void codebasesAttsTestWorksHtml2_NormalValid_normal_absoluteJnlpHrefNormal() throws Exception { CodebasesAttsNoDialogsTest1.prepareSingle(server.getUrl(), server.getUrl().toExternalForm(), null, '1', ServerAccess.getInstance().getDir(), CodebasesAttsNoDialogsTest1.files); CodebasesAttsNoDialogsTest1.prepareSingle(secondValidServer.getUrl(), server.getUrl().toExternalForm(), null, '2', secondValidServer.getDir(), CodebasesAttsNoDialogsTest1.files); ProcessResult pr = server.executeBrowser(null, server.getUrl(HTMLHREF), new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 1")); Assert.assertTrue(pr.stdout.contains("BID0")); } @Test @TestInBrowsers(testIn = Browsers.one) //all three are valid, but on l one bug is supported now @Bug(id = "http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2016-January/034446.html") //@Bug(id = "http://icedtea.classpath.org/hg/release/icedtea-web-1.6/rev/0d9faf51357d") //@Bug(id = "http://icedtea.classpath.org/hg/icedtea-web/rev/22b7becd48a7") public void codebasesAttsTestWorksHtml2_NormalValid_normal_absoluteJnlpHrefSecond() throws Exception { CodebasesAttsNoDialogsTest1.prepareSingle(server.getUrl(), secondValidServer.getUrl().toExternalForm(), null, '1', ServerAccess.getInstance().getDir(), CodebasesAttsNoDialogsTest1.files); CodebasesAttsNoDialogsTest1.prepareSingle(secondValidServer.getUrl(), secondValidServer.getUrl().toExternalForm(), null, '2', secondValidServer.getDir(), CodebasesAttsNoDialogsTest1.files); ProcessResult pr = server.executeBrowser(null, server.getUrl(HTMLHREF), new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 1")); Assert.assertTrue(pr.stdout.contains("BID2")); } @NeedsDisplay @Test @TestInBrowsers(testIn = Browsers.one) //all three are valid, but on l one bug is supported now //@Bug(id = "http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2016-January/034446.html") @Bug(id = "http://icedtea.classpath.org/hg/release/icedtea-web-1.6/rev/0d9faf51357d") //@Bug(id = "http://icedtea.classpath.org/hg/icedtea-web/rev/22b7becd48a7") public void codebasesAttsTestWorksHtml2_NormalValid_second_absoluteJnlpHrefNormal() throws Exception { CodebasesAttsNoDialogsTest1.prepareSingle(server.getUrl(), server.getUrl().toExternalForm(), null, '1', ServerAccess.getInstance().getDir(), CodebasesAttsNoDialogsTest1.files); CodebasesAttsNoDialogsTest1.prepareSingle(secondValidServer.getUrl(), server.getUrl().toExternalForm(), null, '2', secondValidServer.getDir(), CodebasesAttsNoDialogsTest1.files); ProcessResult pr = server.executeBrowser(null, secondValidServer.getUrl(HTMLHREF), new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 2")); Assert.assertTrue(pr.stdout.contains("BID0")); } @NeedsDisplay @Test @TestInBrowsers(testIn = Browsers.one) public void codebasesAttsTestWorksHtml2_NormalValid_second_absoluteJnlpHrefSecond() throws Exception { CodebasesAttsNoDialogsTest1.prepareSingle(server.getUrl(), secondValidServer.getUrl().toExternalForm(), null, '1', ServerAccess.getInstance().getDir(), CodebasesAttsNoDialogsTest1.files); CodebasesAttsNoDialogsTest1.prepareSingle(secondValidServer.getUrl(), secondValidServer.getUrl().toExternalForm(), null, '2', secondValidServer.getDir(), CodebasesAttsNoDialogsTest1.files); ProcessResult pr = server.executeBrowser(null, secondValidServer.getUrl(HTMLHREF), new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 2")); Assert.assertTrue(pr.stdout.contains("BID2")); } @NeedsDisplay @Test @TestInBrowsers(testIn = Browsers.one) //all three are valid, but on l one bug is supported now //@Bug(id = "http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2016-January/034446.html") //@Bug(id = "http://icedtea.classpath.org/hg/release/icedtea-web-1.6/rev/0d9faf51357d") @Bug(id = "http://icedtea.classpath.org/hg/icedtea-web/rev/22b7becd48a7") public void codebasesAttsTestWorksHtml2_ValidNormal_normal_absoluteJnlpHrefNormal() throws Exception { CodebasesAttsNoDialogsTest1.prepareSingle(secondValidServer.getUrl(), server.getUrl().toExternalForm(), null, '1', ServerAccess.getInstance().getDir(), CodebasesAttsNoDialogsTest1.files); CodebasesAttsNoDialogsTest1.prepareSingle(server.getUrl(), server.getUrl().toExternalForm(), null, '2', secondValidServer.getDir(), CodebasesAttsNoDialogsTest1.files); ProcessResult pr = server.executeBrowser(null, server.getUrl(HTMLHREF), new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 1")); Assert.assertTrue(pr.stdout.contains("BID2")); } @NeedsDisplay @Test @TestInBrowsers(testIn = Browsers.one) public void codebasesAttsTestWorksHtml2_ValidNormal_normal_absoluteJnlpHrefSecond() throws Exception { CodebasesAttsNoDialogsTest1.prepareSingle(secondValidServer.getUrl(), secondValidServer.getUrl().toExternalForm(), null, '1', ServerAccess.getInstance().getDir(), CodebasesAttsNoDialogsTest1.files); CodebasesAttsNoDialogsTest1.prepareSingle(server.getUrl(), secondValidServer.getUrl().toExternalForm(), null, '2', secondValidServer.getDir(), CodebasesAttsNoDialogsTest1.files); ProcessResult pr = server.executeBrowser(null, server.getUrl(HTMLHREF), new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 1")); Assert.assertTrue(pr.stdout.contains("BID0")); } @NeedsDisplay @Test @TestInBrowsers(testIn = Browsers.one) public void codebasesAttsTestWorksHtml2_ValidNormal_second_bsoluteJnlpHrefNormal() throws Exception { CodebasesAttsNoDialogsTest1.prepareSingle(secondValidServer.getUrl(), server.getUrl().toExternalForm(), null, '1', ServerAccess.getInstance().getDir(), CodebasesAttsNoDialogsTest1.files); CodebasesAttsNoDialogsTest1.prepareSingle(server.getUrl(), server.getUrl().toExternalForm(), null, '2', secondValidServer.getDir(), CodebasesAttsNoDialogsTest1.files); ProcessResult pr = server.executeBrowser(null, secondValidServer.getUrl(HTMLHREF), new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 2")); Assert.assertTrue(pr.stdout.contains("BID2")); } @NeedsDisplay @Test @TestInBrowsers(testIn = Browsers.one) //all three are valid, but on l one bug is supported now @Bug(id = "http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2016-January/034446.html") //@Bug(id = "http://icedtea.classpath.org/hg/release/icedtea-web-1.6/rev/0d9faf51357d") //@Bug(id = "http://icedtea.classpath.org/hg/icedtea-web/rev/22b7becd48a public void codebasesAttsTestWorksHtml2_ValidNormal_second_bsoluteJnlpHrefSecond() throws Exception { CodebasesAttsNoDialogsTest1.prepareSingle(secondValidServer.getUrl(), secondValidServer.getUrl().toExternalForm(), null, '1', ServerAccess.getInstance().getDir(), CodebasesAttsNoDialogsTest1.files); CodebasesAttsNoDialogsTest1.prepareSingle(server.getUrl(), secondValidServer.getUrl().toExternalForm(), null, '2', secondValidServer.getDir(), CodebasesAttsNoDialogsTest1.files); ProcessResult pr = server.executeBrowser(null, secondValidServer.getUrl(HTMLHREF), new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 2")); Assert.assertTrue(pr.stdout.contains("BID0")); } } icedtea-web-1.6.2/tests/reproducers/simple/CodebasesAtts/testcases/PaxHeaders.17941/CodebasesAttsNoD0000644000000000000000000000013212654402377030227 xustar0030 mtime=1454507263.215432874 30 atime=1454507327.301578176 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/CodebasesAtts/testcases/CodebasesAttsNoDialogsTest1.java0000644000175000002070000010041412654402377034012 0ustar00jvanekmock00000000000000/* CodebasesAttsNoDialogsTest1.java Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.URL; import java.util.AbstractMap; import java.util.Arrays; import java.util.Enumeration; import java.util.List; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; import java.util.zip.ZipOutputStream; import net.sourceforge.jnlp.OptionsDefinitions; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.ServerLauncher; import net.sourceforge.jnlp.annotations.Bug; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.AutoErrorClosingListener; import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.ManifestAttributesChecker; import net.sourceforge.jnlp.security.appletextendedsecurity.AppletSecurityLevel; import net.sourceforge.jnlp.tools.DeploymentPropertiesModifier; import net.sourceforge.jnlp.util.FileUtils; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; /** * * null, empty, none, wrong, correct jnlp x html different codebases. * * no dialogs should be appeared. Second testsuite with ALL dialogs (head only) * * */ public class CodebasesAttsNoDialogsTest1 extends BrowserTest { public static final String appletCloseString = AutoOkClosingListener.MAGICAL_OK_CLOSING_STRING; public static final String[] JAVAWS_HTML_ARRAY = new String[]{OptionsDefinitions.OPTIONS.HTML.option}; public static final List JAVAWS_HTML_LIST = Arrays.asList(JAVAWS_HTML_ARRAY); public static final String JNLPAPP = "CodebasesAttsApp.jnlp"; public static final String JNLPAPPLET = "CodebasesAttsApplet.jnlp"; public static final String HTML = "CodebasesAtts.html"; public static final String HTMLHREF = "CodebasesAttsJnlpHref.html"; public static final String CodebasesAtts = "CodebasesAtts"; private static ServerLauncher emptyServer; private static ServerLauncher secondValidServer; private static DeploymentPropertiesModifier.MultipleDeploymentPropertiesModifier ensuredDP; public static final String[] files = new String[]{"CodebasesAttsApp.jnlp", "CodebasesAtts.html", "CodebasesAttsApplet.jnlp", "CodebasesAttsJnlpHref.html"}; @BeforeClass public static void initSecondaryServers() throws IOException { emptyServer = ServerAccess.getIndependentInstanceOnTmpDir(); secondValidServer = ServerAccess.getIndependentInstanceOnTmpDir(); } @AfterClass public static void stopSecondaryServers() throws IOException { emptyServer.stop(); secondValidServer.stop(); } @BeforeClass public static void setProperties() throws IOException { ensuredDP = new DeploymentPropertiesModifier.MultipleDeploymentPropertiesModifier( new AbstractMap.SimpleEntry(DeploymentConfiguration.KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK, ManifestAttributesChecker.MANIFEST_ATTRIBUTES_CHECK.NONE.name()), new AbstractMap.SimpleEntry(DeploymentConfiguration.KEY_SECURITY_LEVEL, AppletSecurityLevel.ALLOW_UNSIGNED.name()) ); ensuredDP.setProperties(); } @AfterClass public static void resetProperties() throws IOException { ensuredDP.restoreProperties(); } //jnlp app @NeedsDisplay @Test public void codebasesAttsTestWorksJnlp1_dot() throws Exception { prepare("\".\""); ProcessResult pr = server.executeJavaws(JNLPAPP, new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 1")); Assert.assertTrue(pr.stdout.contains("BID0")); } @NeedsDisplay @Test public void codebasesAttsTestWorksJnlp1_empty() throws Exception { prepare("\"\""); ProcessResult pr = server.executeJavaws(JNLPAPP, new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 1")); Assert.assertTrue(pr.stdout.contains("BID0")); } @NeedsDisplay @Test public void codebasesAttsTestWorksJnlp1_space() throws Exception { prepare("\" \""); ProcessResult pr = server.executeJavaws(JNLPAPP, new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 1")); Assert.assertTrue(pr.stdout.contains("BID0")); } @NeedsDisplay @Test public void codebasesAttsTestWorksJnlp1_spaces() throws Exception { prepare("\" \""); ProcessResult pr = server.executeJavaws(JNLPAPP, new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 1")); Assert.assertTrue(pr.stdout.contains("BID0")); } @NeedsDisplay @Test @Bug(id = "PR2489") public void codebasesAttsTestWorksJnlp1_null() throws Exception { prepare(null); ProcessResult pr = server.executeJavaws(JNLPAPP, new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 1")); Assert.assertTrue(pr.stdout.contains("BID0")); } @NeedsDisplay @Test public void codebasesAttsTestWorksJnlp1_value() throws Exception { prepare(server.getUrl().toString()); ProcessResult pr = server.executeJavaws(JNLPAPP, new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 1")); Assert.assertTrue(pr.stdout.contains("BID0")); } @NeedsDisplay @Test //all three are valid, but on l one bug is supported nows @Bug(id = "http://icedtea.classpath.org/hg/icedtea-web/rev/22b7becd48a7") //@Bug(id = "http://icedtea.classpath.org/hg/release/icedtea-web-1.6/rev/0d9faf51357d") //@Bug(id = "http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2016-January/034446.html") public void codebasesAttsTestWorksJnlp1_value2() throws Exception { prepare(secondValidServer.getUrl().toString()); ProcessResult pr = server.executeJavaws(JNLPAPP, new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 1")); //param comes from original jnlp, this will be visible on jnlp_href Assert.assertTrue(pr.stdout.contains("BID2")); } @NeedsDisplay @Test public void codebasesAttsTestWorksJnlp1_value3() throws Exception { prepare(secondValidServer.getUrl().toString()); ProcessResult pr = server.executeJavawsUponUrl(null, new URL(secondValidServer.getUrl().toString() + "/" + JNLPAPP), new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 2")); Assert.assertTrue(pr.stdout.contains("BID2")); } //value3 and 4 tests ar emoreover testing taht our three servers are working as expected. @NeedsDisplay @Test //all three are valid, but on l one bug is supported now @Bug(id = "http://icedtea.classpath.org/hg/release/icedtea-web-1.6/rev/0d9faf51357d") //@Bug(id = "http://icedtea.classpath.org/hg/icedtea-web/rev/22b7becd48a7") //@Bug(id = "http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2016-January/034446.html") public void codebasesAttsTestWorksJnlp1_value4() throws Exception { prepare(server.getUrl().toString()); ProcessResult pr = server.executeJavawsUponUrl(null, new URL(secondValidServer.getUrl().toString() + "/" + JNLPAPP), new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 2")); //param comes from original jnlp, this will be visible on jnlp_href Assert.assertTrue(pr.stdout.contains("BID0")); } //jnlp applet @NeedsDisplay @Test public void codebasesAttsTestWorksJnlp2_dot() throws Exception { prepare("\".\""); ProcessResult pr = server.executeJavaws(JNLPAPPLET, new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 1")); Assert.assertTrue(pr.stdout.contains("BID0")); } @NeedsDisplay @Test public void codebasesAttsTestWorksJnlp2_empty() throws Exception { prepare("\"\""); ProcessResult pr = server.executeJavaws(JNLPAPPLET, new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 1")); Assert.assertTrue(pr.stdout.contains("BID0")); } @NeedsDisplay @Test public void codebasesAttsTestWorksJnlp2_space() throws Exception { prepare("\" \""); ProcessResult pr = server.executeJavaws(JNLPAPPLET, new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 1")); Assert.assertTrue(pr.stdout.contains("BID0")); } @NeedsDisplay @Test public void codebasesAttsTestWorksJnlp2_spaces() throws Exception { prepare("\" \""); ProcessResult pr = server.executeJavaws(JNLPAPPLET, new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 1")); Assert.assertTrue(pr.stdout.contains("BID0")); } @NeedsDisplay @Test @Bug(id = "PR2489") public void codebasesAttsTestWorksJnlp2_null() throws Exception { prepare(null); ProcessResult pr = server.executeJavaws(JNLPAPPLET, new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 1")); Assert.assertTrue(pr.stdout.contains("BID0")); } @NeedsDisplay @Test public void codebasesAttsTestWorksJnlp2_value() throws Exception { prepare(server.getUrl().toString()); ProcessResult pr = server.executeJavaws(JNLPAPPLET, new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 1")); Assert.assertTrue(pr.stdout.contains("BID0")); } @NeedsDisplay @Test //all three are valid, but on l one bug is supported now @Bug(id = "http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2016-January/034446.html") //@Bug(id = "http://icedtea.classpath.org/hg/release/icedtea-web-1.6/rev/0d9faf51357d") //@Bug(id = "http://icedtea.classpath.org/hg/icedtea-web/rev/22b7becd48a7") public void codebasesAttsTestWorksJnlp2_value2() throws Exception { prepare(secondValidServer.getUrl().toString()); ProcessResult pr = server.executeJavaws(JNLPAPPLET, new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 1")); //param comes from original jnlp, this will be visible on jnlp_href Assert.assertTrue(pr.stdout.contains("BID2")); } @NeedsDisplay @Test public void codebasesAttsTestWorksJnlp2_value3() throws Exception { prepare(secondValidServer.getUrl().toString()); ProcessResult pr = server.executeJavawsUponUrl(null, new URL(secondValidServer.getUrl().toString() + "/" + JNLPAPPLET), new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 2")); Assert.assertTrue(pr.stdout.contains("BID2")); } //value3 and 4 tests ar emoreover testing taht our three servers are working as expected. @NeedsDisplay @Test //all three are valid, but on l one bug is supported now //@Bug(id = "http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2016-January/034446.html") @Bug(id = "http://icedtea.classpath.org/hg/release/icedtea-web-1.6/rev/0d9faf51357d") //@Bug(id = "http://icedtea.classpath.org/hg/icedtea-web/rev/22b7becd48a7") public void codebasesAttsTestWorksJnlp2_value4() throws Exception { prepare(server.getUrl().toString()); ProcessResult pr = server.executeJavawsUponUrl(null, new URL(secondValidServer.getUrl().toString() + "/" + JNLPAPPLET), new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 2")); //param comes from original jnlp, this will be visible on jnlp_href Assert.assertTrue(pr.stdout.contains("BID0")); } @NeedsDisplay @Test @TestInBrowsers(testIn = Browsers.one) public void codebasesAttsTestWorksHtml1_dot() throws Exception { prepare("\".\""); ProcessResult pr = server.executeBrowser(HTML, new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 1")); Assert.assertTrue(pr.stdout.contains("BID0")); } @NeedsDisplay @Test @TestInBrowsers(testIn = Browsers.one) public void codebasesAttsTestWorksHtml1_empty() throws Exception { prepare("\"\""); ProcessResult pr = server.executeBrowser(HTML, new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 1")); Assert.assertTrue(pr.stdout.contains("BID0")); } @NeedsDisplay @Test @TestInBrowsers(testIn = Browsers.one) public void codebasesAttsTestWorksJHtml1_space() throws Exception { prepare("\" \""); ProcessResult pr = server.executeBrowser(HTML, new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 1")); Assert.assertTrue(pr.stdout.contains("BID0")); } @NeedsDisplay @Test @TestInBrowsers(testIn = Browsers.one) public void codebasesAttsTestWorksHtml1_spaces() throws Exception { prepare("\" \""); ProcessResult pr = server.executeBrowser(HTML, new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 1")); Assert.assertTrue(pr.stdout.contains("BID0")); } @NeedsDisplay @Test @TestInBrowsers(testIn = Browsers.one) @Bug(id = "PR2489") public void codebasesAttsTestWorksHtml1_null() throws Exception { prepare(null); ProcessResult pr = server.executeBrowser(HTML, new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 1")); Assert.assertTrue(pr.stdout.contains("BID0")); } @NeedsDisplay @Test @TestInBrowsers(testIn = Browsers.one) public void codebasesAttsTestWorksHtml1_value() throws Exception { prepare(server.getUrl().toString()); ProcessResult pr = server.executeBrowser(HTML, new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 1")); Assert.assertTrue(pr.stdout.contains("BID0")); } @NeedsDisplay @Test @TestInBrowsers(testIn = Browsers.one) //all three are valid, but on l one bug is supported now //@Bug(id = "http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2016-January/034446.html") //@Bug(id = "http://icedtea.classpath.org/hg/release/icedtea-web-1.6/rev/0d9faf51357d") @Bug(id = "http://icedtea.classpath.org/hg/icedtea-web/rev/22b7becd48a7") public void codebasesAttsTestWorksHtml1_value2() throws Exception { prepare(secondValidServer.getUrl().toString()); ProcessResult pr = server.executeBrowser(HTML, new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 1")); //param comes from original jnlp, this will be visible on jnlp_href Assert.assertTrue(pr.stdout.contains("BID2")); } @NeedsDisplay @Test @TestInBrowsers(testIn = Browsers.one) public void codebasesAttsTestWorksHtml1_value3() throws Exception { prepare(secondValidServer.getUrl().toString()); ProcessResult pr = server.executeBrowser(null, new URL(secondValidServer.getUrl().toString() + "/" + HTML), new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 2")); Assert.assertTrue(pr.stdout.contains("BID2")); } //value3 and 4 tests ar emoreover testing taht our three servers are working as expected. @NeedsDisplay @Test @TestInBrowsers(testIn = Browsers.one) //all three are valid, but on l one bug is supported now @Bug(id = "http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2016-January/034446.html") //@Bug(id = "http://icedtea.classpath.org/hg/release/icedtea-web-1.6/rev/0d9faf51357d") //@Bug(id = "http://icedtea.classpath.org/hg/icedtea-web/rev/22b7becd48a7") public void codebasesAttsTestWorksHtml1_value4() throws Exception { prepare(server.getUrl().toString()); ProcessResult pr = server.executeBrowser(null, new URL(secondValidServer.getUrl().toString() + "/" + HTML), new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 2")); //param comes from original jnlp, this will be visible on jnlp_href Assert.assertTrue(pr.stdout.contains("BID0")); } @NeedsDisplay @Test @TestInBrowsers(testIn = Browsers.one) public void codebasesAttsTestWorksHtml2_dot() throws Exception { prepare("\".\""); ProcessResult pr = server.executeBrowser(HTMLHREF, new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 1")); Assert.assertTrue(pr.stdout.contains("BID0")); } @NeedsDisplay @Test @TestInBrowsers(testIn = Browsers.one) public void codebasesAttsTestWorksHtml2_empty() throws Exception { prepare("\"\""); ProcessResult pr = server.executeBrowser(HTMLHREF, new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 1")); Assert.assertTrue(pr.stdout.contains("BID0")); } @NeedsDisplay @Test @TestInBrowsers(testIn = Browsers.one) public void codebasesAttsTestWorksJHtml2_space() throws Exception { prepare("\" \""); ProcessResult pr = server.executeBrowser(HTMLHREF, new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 1")); Assert.assertTrue(pr.stdout.contains("BID0")); } @NeedsDisplay @Test @TestInBrowsers(testIn = Browsers.one) public void codebasesAttsTestWorksHtml2_spaces() throws Exception { prepare("\" \""); ProcessResult pr = server.executeBrowser(HTMLHREF, new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 1")); Assert.assertTrue(pr.stdout.contains("BID0")); } @NeedsDisplay @Test @TestInBrowsers(testIn = Browsers.one) @Bug(id = "PR2489") public void codebasesAttsTestWorksHtml2_null() throws Exception { prepare(null); ProcessResult pr = server.executeBrowser(HTMLHREF, new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 1")); Assert.assertTrue(pr.stdout.contains("BID0")); } @NeedsDisplay @Test @TestInBrowsers(testIn = Browsers.one) public void codebasesAttsTestWorksHtml2_value() throws Exception { prepare(server.getUrl().toString()); ProcessResult pr = server.executeBrowser(HTMLHREF, new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 1")); Assert.assertTrue(pr.stdout.contains("BID0")); } @NeedsDisplay @Test @TestInBrowsers(testIn = Browsers.one) //all three are valid, but on l one bug is supported now //@Bug(id = "http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2016-January/034446.html") @Bug(id = "http://icedtea.classpath.org/hg/release/icedtea-web-1.6/rev/0d9faf51357d") //@Bug(id = "http://icedtea.classpath.org/hg/icedtea-web/rev/22b7becd48a7") public void codebasesAttsTestWorksHtml2_value2() throws Exception { prepare(secondValidServer.getUrl().toString()); ProcessResult pr = server.executeBrowser(HTMLHREF, new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 1")); //param comes from original jnlp, this will be visible on SECOND jnlp_href tests Assert.assertTrue(pr.stdout.contains("BID2")); } @NeedsDisplay @Test @TestInBrowsers(testIn = Browsers.one) public void codebasesAttsTestWorksHtml2_value3() throws Exception { prepare(secondValidServer.getUrl().toString()); ProcessResult pr = server.executeBrowser(null, new URL(secondValidServer.getUrl().toString() + "/" + HTMLHREF), new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 2")); Assert.assertTrue(pr.stdout.contains("BID2")); } //value3 and 4 tests ar emoreover testing taht our three servers are working as expected. @NeedsDisplay @Test @TestInBrowsers(testIn = Browsers.one) //all three are valid, but on l one bug is supported now //@Bug(id = "http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2016-January/034446.html") //@Bug(id = "http://icedtea.classpath.org/hg/release/icedtea-web-1.6/rev/0d9faf51357d") @Bug(id = "http://icedtea.classpath.org/hg/icedtea-web/rev/22b7becd48a7") public void codebasesAttsTestWorksHtml2_value4() throws Exception { prepare(server.getUrl().toString()); ProcessResult pr = server.executeBrowser(null, new URL(secondValidServer.getUrl().toString() + "/" + HTMLHREF), new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 2")); //param comes from original jnlp, this will be visible on jnlp_href Assert.assertTrue(pr.stdout.contains("BID0")); } private static void prepare(String codebase) throws IOException { prepare(codebase, codebase); } private static void prepare(String codebase1, String codebase2) throws IOException { prepareSingle(codebase1, null, null, '1', ServerAccess.getInstance().getDir(), files); prepareSingle(codebase2, null, null, '2', secondValidServer.getDir(), files); } public static void prepareSingle(URL codebase, String jnlphref, String jar, char id, File targetDir, String[] files) throws IOException { prepareSingle(codebase.toExternalForm(), jnlphref, jar, id, targetDir, files); } public static void prepareSingle(String codebase, String jnlphref, String jar, char id, File targetDir, String[] files) throws IOException { File srcDir = ServerAccess.getInstance().getDir(); for (String file : files) { String s1 = FileUtils.loadFileAsString(new File(srcDir, file + ".in")); if (codebase == null) { s1 = s1.replace("@CODEBASE@", ""); } else { s1 = s1.replace("@CODEBASE@", "codebase=\"" + codebase + "\""); } if (jnlphref == null) { s1 = s1.replace("@JNLPHREF@", "CodebasesAttsApplet.jnlp"); } else { s1 = s1.replace("@JNLPHREF@", jnlphref + "/CodebasesAttsApplet.jnlp"); } if (jar == null) { s1 = s1.replace("@JAR@", "CodebasesAtts"); } else { s1 = s1.replace("@JAR@", jar + "/CodebasesAtts"); } s1 = s1.replace("@ID@", "" + id); FileUtils.saveFile(s1, new File(targetDir, file)); } String n = "CodebasesAtts.jar"; if (!srcDir.equals(targetDir)) { copyJarAndChange(new File(srcDir, n), new File(targetDir, n), id); } } /** * This copy zip jar entry by entry, and for one particular class it do BYTE * changes * * @param from * @param to * @param id * @throws FileNotFoundException * @throws IOException */ private static void copyJarAndChange(File from, File to, char id) throws FileNotFoundException, IOException { ZipFile original = new ZipFile(from); try (ZipOutputStream outputStream = new ZipOutputStream(new FileOutputStream(to))) { Enumeration entries = original.entries(); byte[] buffer = new byte[512]; while (entries.hasMoreElements()) { ZipEntry entry = (ZipEntry) entries.nextElement(); if (entry.getName().endsWith("CodebasesAtts.class")) { ZipEntry newEntry = new ZipEntry(entry.getName()); outputStream.putNextEntry(newEntry); try (InputStream in = original.getInputStream(entry)) { copyStreamAndChange(in, outputStream, id); } } else { ZipEntry newEntry = new ZipEntry(entry.getName()); outputStream.putNextEntry(newEntry); try (InputStream in = original.getInputStream(entry)) { while (0 < in.available()) { int read = in.read(buffer); outputStream.write(buffer, 0, read); } } } outputStream.closeEntry(); } } } /** * This changes bytes BID0 to BID'idchar'. * * @param din * @param dout * @param id * @throws FileNotFoundException * @throws IOException */ private static void copyStreamAndChange(InputStream din, OutputStream dout, char id) throws FileNotFoundException, IOException { int c; final boolean[] BID0 = new boolean[]{false, false, false}; while ((c = din.read()) != -1) { if (c == 'B') { BID0[0] = true; dout.write((byte) c); } else if (c == 'I' && BID0[0]) { BID0[1] = true; dout.write((byte) c); } else if (c == 'D' && BID0[1]) { BID0[2] = true; dout.write((byte) c); } else if (c == '0' && BID0[2]) { dout.write((byte) id); reset(BID0); } else { reset(BID0); dout.write((byte) c); } } } private static void reset(final boolean[] b) { for (int i = 0; i < b.length; i++) { b[i] = false; } } } icedtea-web-1.6.2/tests/reproducers/simple/CodebasesAtts/testcases/PaxHeaders.17941/CodebasesAttsDia0000644000000000000000000000013212654402377030244 xustar0030 mtime=1454507263.215432874 30 atime=1454507327.301578176 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/CodebasesAtts/testcases/CodebasesAttsDialogsTest1.java0000644000175000002070000002502012654402377033514 0ustar00jvanekmock00000000000000/* CodebasesAttsNoDialogsTest1.java Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.URL; import java.util.AbstractMap; import java.util.ArrayList; import java.util.Arrays; import java.util.Enumeration; import java.util.List; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; import java.util.zip.ZipOutputStream; import net.sourceforge.jnlp.OptionsDefinitions; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ProcessWrapper; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.ServerLauncher; import net.sourceforge.jnlp.annotations.Bug; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import static net.sourceforge.jnlp.browsertesting.BrowserTest.server; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.AutoErrorClosingListener; import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.ManifestAttributesChecker; import net.sourceforge.jnlp.security.appletextendedsecurity.AppletSecurityLevel; import net.sourceforge.jnlp.tools.DeploymentPropertiesModifier; import net.sourceforge.jnlp.util.FileUtils; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; /** * * null, empty, none, wrong, correct jnlp x html different codebases. * * no dialogs should be appeared. Second testsuite with ALL dialogs (head only) * * */ public class CodebasesAttsDialogsTest1 extends BrowserTest { private static final String appletCloseString = CodebasesAttsNoDialogsTest1.appletCloseString; private static final String[] JAVAWS_HTML_ARRAY = CodebasesAttsNoDialogsTest1.JAVAWS_HTML_ARRAY; private static final List JAVAWS_HTML_LIST = CodebasesAttsNoDialogsTest1.JAVAWS_HTML_LIST; //disabled - 1.6 specific. We need dialogs to pop up. Anyway, in 1.6 all such tests are disbaled for runtime anyway private static final String[] JAVAWS_HEADLES_ARRAY = new String[]{};//{OptionsDefinitions.OPTIONS.HTML.HEADLESS.option}; private static final List JAVAWS_HEADLES_LIST = Arrays.asList(JAVAWS_HEADLES_ARRAY); private static final String JNLPAPP = CodebasesAttsNoDialogsTest1.JNLPAPP; private static final String JNLPAPPLET = CodebasesAttsNoDialogsTest1.JNLPAPPLET; private static final String HTML = CodebasesAttsNoDialogsTest1.HTML; private static final String HTMLHREF = CodebasesAttsNoDialogsTest1.HTMLHREF; private static final String CodebasesAtts = CodebasesAttsNoDialogsTest1.CodebasesAtts; private static ServerLauncher secondValidServer; private static DeploymentPropertiesModifier.MultipleDeploymentPropertiesModifier ensuredDP; public static final String[] files = new String[]{"CodebasesAttsApp.jnlp", "CodebasesAtts.html", "CodebasesAttsApplet.jnlp", "CodebasesAttsJnlpHref.html"}; @BeforeClass public static void initSecondaryServers() throws IOException { secondValidServer = ServerAccess.getIndependentInstanceOnTmpDir(); } @AfterClass public static void stopSecondaryServers() throws IOException { secondValidServer.stop(); } @BeforeClass public static void setProperties() throws IOException { ensuredDP = new DeploymentPropertiesModifier.MultipleDeploymentPropertiesModifier( new AbstractMap.SimpleEntry(DeploymentConfiguration.KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK, ManifestAttributesChecker.MANIFEST_ATTRIBUTES_CHECK.ALL.name()), new AbstractMap.SimpleEntry(DeploymentConfiguration.KEY_SECURITY_LEVEL, AppletSecurityLevel.ASK_UNSIGNED.name()) ); ensuredDP.setProperties(); } @AfterClass public static void resetProperties() throws IOException { ensuredDP.restoreProperties(); } @Test public void allTestsInThisFileAreDisabled(){ //because 1.6 do not support headless dialogues } @NeedsDisplay //@Test @Bug(id = "PR2489") public void codebasesAttsTestWorksJnlp1_null() throws Exception { prepare(null); ProcessWrapper pw = new ProcessWrapper(server.getJavawsLocation(), JAVAWS_HEADLES_LIST, server.getUrl(JNLPAPP)); pw.addStdOutListener(new AutoOkClosingListener()); pw.addStdErrListener(new AutoErrorClosingListener()); //pw.setWriter("YES\nYES\nYES\nYES\n"); ProcessResult pr = pw.execute(); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 1")); Assert.assertTrue(pr.stdout.contains("BID0")); } @NeedsDisplay //@Test @Bug(id = "PR2489") public void codebasesAttsTestWorksJnlp2_null() throws Exception { prepare(null); ProcessWrapper pw = new ProcessWrapper(server.getJavawsLocation(), JAVAWS_HEADLES_LIST, server.getUrl(JNLPAPPLET)); pw.addStdOutListener(new AutoOkClosingListener()); pw.addStdErrListener(new AutoErrorClosingListener()); //pw.setWriter("YES\nYES\nYES\nYES\n"); ProcessResult pr = pw.execute(); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 1")); Assert.assertTrue(pr.stdout.contains("BID0")); } @NeedsDisplay //@Test //rowsers dont support headless dialogues @TestInBrowsers(testIn = Browsers.one) @Bug(id = "PR2489") public void codebasesAttsTestWorksHtml1_null() throws Exception { prepare(null); ProcessResult pr = server.executeBrowser(null, HTML, new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 1")); Assert.assertTrue(pr.stdout.contains("BID0")); } @NeedsDisplay //@Test //browsers do not support ehadless dialogues @TestInBrowsers(testIn = Browsers.one) @Bug(id = "PR2489") public void codebasesAttsTestWorksHtml2_null() throws Exception { prepare(null); ProcessResult pr = server.executeBrowser(null, HTMLHREF, new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 1")); Assert.assertTrue(pr.stdout.contains("BID0")); } @NeedsDisplay //@Test @Bug(id = "PR2489") public void codebasesAttsTestWorksJavawsHtml1_null() throws Exception { prepare(null); ArrayList HTML_HEADLESS = new ArrayList<>(); HTML_HEADLESS.addAll(JAVAWS_HEADLES_LIST); HTML_HEADLESS.addAll(JAVAWS_HTML_LIST); ProcessWrapper pw = new ProcessWrapper(server.getJavawsLocation(), HTML_HEADLESS, server.getUrl(HTML)); pw.addStdOutListener(new AutoOkClosingListener()); pw.addStdErrListener(new AutoErrorClosingListener()); //pw.setWriter("YES\nYES\nYES\nYES\n"); ProcessResult pr = pw.execute(); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 1")); Assert.assertTrue(pr.stdout.contains("BID0")); } @NeedsDisplay //@Test @Bug(id = "PR2489") public void codebasesAttsTestWorksJavawsHtml2_null() throws Exception { prepare(null); ArrayList HTML_HEADLESS = new ArrayList<>(); HTML_HEADLESS.addAll(JAVAWS_HEADLES_LIST); HTML_HEADLESS.addAll(JAVAWS_HTML_LIST); ProcessWrapper pw = new ProcessWrapper(server.getJavawsLocation(), HTML_HEADLESS, server.getUrl(HTMLHREF)); pw.addStdOutListener(new AutoOkClosingListener()); pw.addStdErrListener(new AutoErrorClosingListener()); //pw.setWriter("YES\nYES\nYES\nYES\n"); ProcessResult pr = pw.execute(); Assert.assertTrue(pr.stdout.contains(appletCloseString)); Assert.assertTrue(pr.stdout.contains(CodebasesAtts)); Assert.assertTrue(pr.stdout.contains("id: 1")); Assert.assertTrue(pr.stdout.contains("BID0")); } public static void prepare(String codebase) throws IOException { prepare(codebase, codebase); } public static void prepare(String codebase1, String codebase2) throws IOException { CodebasesAttsNoDialogsTest1.prepareSingle(codebase1, null, null, '1', ServerAccess.getInstance().getDir(), files); CodebasesAttsNoDialogsTest1.prepareSingle(codebase2, null, null, '2', secondValidServer.getDir(), files); } } icedtea-web-1.6.2/tests/reproducers/simple/CodebasesAtts/PaxHeaders.17941/srcs0000644000000000000000000000013112654402377024055 xustar0030 mtime=1454507263.215432874 29 atime=1454507658.77815737 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/CodebasesAtts/srcs/0000755000175000002070000000000012654402377024656 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/CodebasesAtts/srcs/PaxHeaders.17941/CodebasesAtts.java0000644000000000000000000000013212654402377027522 xustar0030 mtime=1454507263.215432874 30 atime=1454507327.301578176 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/CodebasesAtts/srcs/CodebasesAtts.java0000644000175000002070000000505512654402377030252 0ustar00jvanekmock00000000000000/* ExtensionJnlpTestApplet.java Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.applet.*; import java.awt.Graphics; /** * * Note that for html's appelt and jnlphreff's jnlp file may have different * codebase. * */ public class CodebasesAtts extends Applet { private static final String appletCloseString = "*** APPLET FINISHED ***"; private static final String bid = "BID0"; public static void main(String... args) { System.out.println("id: "+args[0]); System.out.println("BID: "+bid); System.out.println(CodebasesAtts.class.getName()); System.out.println(appletCloseString); System.out.flush(); System.out.println("some garbage"); } @Override public void init() { } @Override public void start() { main(getParameter("id")); } @Override public void stop() { } @Override public void destroy() { } @Override public void paint(Graphics g) { } } icedtea-web-1.6.2/tests/reproducers/simple/CodebasesAtts/PaxHeaders.17941/resources0000644000000000000000000000013112654402377025115 xustar0030 mtime=1454507263.214432888 29 atime=1454507658.77815737 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/CodebasesAtts/resources/0000755000175000002070000000000012654402377025716 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/CodebasesAtts/resources/PaxHeaders.17941/CodebasesAttsJnl0000644000000000000000000000013212654402377030306 xustar0030 mtime=1454507263.214432888 30 atime=1454507327.301578176 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/CodebasesAtts/resources/CodebasesAttsJnlpHref.html.in0000644000175000002070000000347212654402377033374 0ustar00jvanekmock00000000000000 icedtea-web-1.6.2/tests/reproducers/simple/CodebasesAtts/resources/PaxHeaders.17941/CodebasesAttsApp0000644000000000000000000000013112654402377030302 xustar0030 mtime=1454507263.214432888 29 atime=1454507327.30057819 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/CodebasesAtts/resources/CodebasesAttsApplet.jnlp.in0000644000175000002070000000426412654402377033110 0ustar00jvanekmock00000000000000 CodebasesAtts IcedTea PR2489 icedtea-web-1.6.2/tests/reproducers/simple/CodebasesAtts/resources/PaxHeaders.17941/CodebasesAttsApp0000644000000000000000000000013112654402377030302 xustar0030 mtime=1454507263.214432888 29 atime=1454507327.30057819 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/CodebasesAtts/resources/CodebasesAttsApp.jnlp.in0000644000175000002070000000416412654402377032402 0ustar00jvanekmock00000000000000 CodebasesAtts IcedTea PR2489 @ID@ icedtea-web-1.6.2/tests/reproducers/simple/CodebasesAtts/resources/PaxHeaders.17941/CodebasesAtts.ht0000644000000000000000000000013112654402377030253 xustar0030 mtime=1454507263.214432888 29 atime=1454507327.30057819 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/CodebasesAtts/resources/CodebasesAtts.html.in0000644000175000002070000000343612654402377031743 0ustar00jvanekmock00000000000000 icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/CodeBaseManifestEntryUnsignedNotMatching0000644000000000000000000000013112654402377030366 xustar0030 mtime=1454507263.213432901 29 atime=1454507658.77815737 30 ctime=1454507658.756157664 icedtea-web-1.6.2/tests/reproducers/simple/CodeBaseManifestEntryUnsignedNotMatching/0000755000175000002070000000000012654402377031167 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/CodeBaseManifestEntryUnsignedNotMatching/PaxHeaders.179410000644000000000000000000000013112654402377030366 xustar0030 mtime=1454507263.213432901 29 atime=1454507658.77815737 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/CodeBaseManifestEntryUnsignedNotMatching/srcs/0000755000175000002070000000000012654402377032141 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/CodeBaseManifestEntryUnsignedNotMatching/srcs/PaxHeaders.0000644000000000000000000000013112654402377030732 xustar0030 mtime=1454507263.213432901 29 atime=1454507658.77815737 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/CodeBaseManifestEntryUnsignedNotMatching/srcs/META-INF/0000755000175000002070000000000012654402377033301 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/CodeBaseManifestEntryUnsignedNotMatching/srcs/META-INF/Pa0000644000000000000000000000032012654402377030330 xustar00119 path=icedtea-web-1.6.2/tests/reproducers/simple/CodeBaseManifestEntryUnsignedNotMatching/srcs/META-INF/MANIFEST.MF 30 mtime=1454507263.213432901 29 atime=1454507327.30057819 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/CodeBaseManifestEntryUnsignedNotMatching/srcs/META-INF/MA0000644000175000002070000000017612654402377033525 0ustar00jvanekmock00000000000000Manifest-Version: 1.0 Codebase: somthingWhatShould mustNeverMatch Application-Name: CodeBaseManifestEntryUnsignedNotMatching icedtea-web-1.6.2/tests/reproducers/simple/CodeBaseManifestEntryUnsignedNotMatching/srcs/PaxHeaders.0000644000000000000000000000035112654402377030736 xustar00144 path=icedtea-web-1.6.2/tests/reproducers/simple/CodeBaseManifestEntryUnsignedNotMatching/srcs/CodeBaseManifestEntryUnsignedNotMatching.java 30 mtime=1454507263.213432901 29 atime=1454507327.30057819 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/CodeBaseManifestEntryUnsignedNotMatching/srcs/CodeBaseMan0000644000175000002070000000454612654402377034176 0ustar00jvanekmock00000000000000/* ClasspathManifest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.applet.Applet; public class CodeBaseManifestEntryUnsignedNotMatching extends Applet { private class Killer extends Thread { public int n = 1000; @Override public void run() { try { Thread.sleep(n); System.out.println("Applet killing himself after " + n + " ms of life"); System.exit(0); } catch (Exception ex) { } } } private Killer killer; public static void main(String[] args) { x(); } @Override public void start() { x(); killer = new Killer(); killer.start(); } public static void x() { System.out.println("*** APPLET FINISHED ***"); } } icedtea-web-1.6.2/tests/reproducers/simple/CodeBaseManifestEntryUnsignedNotMatching/PaxHeaders.179410000644000000000000000000000013112654402377030366 xustar0030 mtime=1454507263.264432221 29 atime=1454507658.77815737 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/CodeBaseManifestEntryUnsignedNotMatching/resources/0000755000175000002070000000000012654402377033201 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/CodeBaseManifestEntryUnsignedNotMatching/resources/PaxHea0000644000000000000000000000036212654402377031044 xustar00153 path=icedtea-web-1.6.2/tests/reproducers/simple/CodeBaseManifestEntryUnsignedNotMatching/resources/CodeBaseManifestEntryUnsignedNotMatchingJnlp.html 30 mtime=1454507263.213432901 29 atime=1454507327.30057819 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/CodeBaseManifestEntryUnsignedNotMatching/resources/CodeBa0000644000175000002070000000355212654402377034246 0ustar00jvanekmock00000000000000 icedtea-web-1.6.2/tests/reproducers/simple/CodeBaseManifestEntryUnsignedNotMatching/resources/PaxHea0000644000000000000000000000036512654402377031047 xustar00155 path=icedtea-web-1.6.2/tests/reproducers/simple/CodeBaseManifestEntryUnsignedNotMatching/resources/CodeBaseManifestEntryUnsignedNotMatchingApplet.jnlp 30 mtime=1454507263.212432914 30 atime=1454507327.299578203 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/CodeBaseManifestEntryUnsignedNotMatching/resources/CodeBa0000644000175000002070000000455012654402377034245 0ustar00jvanekmock00000000000000 Classpath Manifest Applet Test IcedTea ClasspathManifest icedtea-web-1.6.2/tests/reproducers/simple/CodeBaseManifestEntryUnsignedNotMatching/resources/PaxHea0000644000000000000000000000035712654402377031050 xustar00149 path=icedtea-web-1.6.2/tests/reproducers/simple/CodeBaseManifestEntryUnsignedNotMatching/resources/CodeBaseManifestEntryUnsignedNotMatching.jnlp 30 mtime=1454507263.212432914 30 atime=1454507327.299578203 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/CodeBaseManifestEntryUnsignedNotMatching/resources/CodeBa0000644000175000002070000000434712654402377034251 0ustar00jvanekmock00000000000000 ClasspathManifest IcedTea ClasspathManifest icedtea-web-1.6.2/tests/reproducers/simple/CodeBaseManifestEntryUnsignedNotMatching/resources/PaxHea0000644000000000000000000000035712654402377031050 xustar00149 path=icedtea-web-1.6.2/tests/reproducers/simple/CodeBaseManifestEntryUnsignedNotMatching/resources/CodeBaseManifestEntryUnsignedNotMatching.html 30 mtime=1454507263.264432221 30 atime=1454507327.299578203 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/CodeBaseManifestEntryUnsignedNotMatching/resources/CodeBa0000644000175000002070000000360112654402377034241 0ustar00jvanekmock00000000000000 icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/CodeBaseManifestEntryUnsignedMatching0000644000000000000000000000013112654402377027705 xustar0030 mtime=1454507263.263432234 29 atime=1454507658.77815737 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/CodeBaseManifestEntryUnsignedMatching/0000755000175000002070000000000012654402377030506 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/CodeBaseManifestEntryUnsignedMatching/PaxHeaders.17941/sr0000644000000000000000000000013112654402377030331 xustar0030 mtime=1454507263.263432234 29 atime=1454507658.77815737 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/CodeBaseManifestEntryUnsignedMatching/srcs/0000755000175000002070000000000012654402377031460 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/CodeBaseManifestEntryUnsignedMatching/srcs/PaxHeaders.1790000644000000000000000000000013112654402377030512 xustar0030 mtime=1454507263.263432234 29 atime=1454507658.77815737 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/CodeBaseManifestEntryUnsignedMatching/srcs/META-INF/0000755000175000002070000000000012654402377032620 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/CodeBaseManifestEntryUnsignedMatching/srcs/META-INF/PaxHe0000644000000000000000000000031612654402377030321 xustar00116 path=icedtea-web-1.6.2/tests/reproducers/simple/CodeBaseManifestEntryUnsignedMatching/srcs/META-INF/MANIFEST.MF 30 mtime=1454507263.263432234 30 atime=1454507327.299578203 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/CodeBaseManifestEntryUnsignedMatching/srcs/META-INF/MANIF0000644000175000002070000000017412654402377033377 0ustar00jvanekmock00000000000000Manifest-Version: 1.0 Codebase: http://localhost https://localhost Application-Name: CodeBaseManifestEntryUnsignedMatching icedtea-web-1.6.2/tests/reproducers/simple/CodeBaseManifestEntryUnsignedMatching/srcs/PaxHeaders.1790000644000000000000000000000034412654402377030520 xustar00138 path=icedtea-web-1.6.2/tests/reproducers/simple/CodeBaseManifestEntryUnsignedMatching/srcs/CodeBaseManifestEntryUnsignedMatching.java 30 mtime=1454507263.263432234 30 atime=1454507327.299578203 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/CodeBaseManifestEntryUnsignedMatching/srcs/CodeBaseManife0000644000175000002070000000454312654402377034176 0ustar00jvanekmock00000000000000/* ClasspathManifest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.applet.Applet; public class CodeBaseManifestEntryUnsignedMatching extends Applet { private class Killer extends Thread { public int n = 1000; @Override public void run() { try { Thread.sleep(n); System.out.println("Applet killing himself after " + n + " ms of life"); System.exit(0); } catch (Exception ex) { } } } private Killer killer; public static void main(String[] args) { x(); } @Override public void start() { x(); killer = new Killer(); killer.start(); } public static void x() { System.out.println("*** APPLET FINISHED ***"); } } icedtea-web-1.6.2/tests/reproducers/simple/CodeBaseManifestEntryUnsignedMatching/PaxHeaders.17941/re0000644000000000000000000000013112654402377030313 xustar0030 mtime=1454507263.263432234 29 atime=1454507658.77815737 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/CodeBaseManifestEntryUnsignedMatching/resources/0000755000175000002070000000000012654402377032520 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/CodeBaseManifestEntryUnsignedMatching/resources/PaxHeader0000644000000000000000000000035512654402377031060 xustar00147 path=icedtea-web-1.6.2/tests/reproducers/simple/CodeBaseManifestEntryUnsignedMatching/resources/CodeBaseManifestEntryUnsignedMatchingJnlp.html 30 mtime=1454507263.263432234 30 atime=1454507327.299578203 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/CodeBaseManifestEntryUnsignedMatching/resources/CodeBaseM0000644000175000002070000000354412654402377034233 0ustar00jvanekmock00000000000000 icedtea-web-1.6.2/tests/reproducers/simple/CodeBaseManifestEntryUnsignedMatching/resources/PaxHeader0000644000000000000000000000035712654402377031062 xustar00149 path=icedtea-web-1.6.2/tests/reproducers/simple/CodeBaseManifestEntryUnsignedMatching/resources/CodeBaseManifestEntryUnsignedMatchingApplet.jnlp 30 mtime=1454507263.263432234 30 atime=1454507327.298578216 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/CodeBaseManifestEntryUnsignedMatching/resources/CodeBaseM0000644000175000002070000000453412654402377034233 0ustar00jvanekmock00000000000000 Classpath Manifest Applet Test IcedTea ClasspathManifest icedtea-web-1.6.2/tests/reproducers/simple/CodeBaseManifestEntryUnsignedMatching/resources/PaxHeader0000644000000000000000000000035112654402377031054 xustar00143 path=icedtea-web-1.6.2/tests/reproducers/simple/CodeBaseManifestEntryUnsignedMatching/resources/CodeBaseManifestEntryUnsignedMatching.jnlp 30 mtime=1454507263.262432247 30 atime=1454507327.298578216 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/CodeBaseManifestEntryUnsignedMatching/resources/CodeBaseM0000644000175000002070000000433612654402377034233 0ustar00jvanekmock00000000000000 ClasspathManifest IcedTea ClasspathManifest icedtea-web-1.6.2/tests/reproducers/simple/CodeBaseManifestEntryUnsignedMatching/resources/PaxHeader0000644000000000000000000000035112654402377031054 xustar00143 path=icedtea-web-1.6.2/tests/reproducers/simple/CodeBaseManifestEntryUnsignedMatching/resources/CodeBaseManifestEntryUnsignedMatching.html 30 mtime=1454507263.262432247 30 atime=1454507327.298578216 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/CodeBaseManifestEntryUnsignedMatching/resources/CodeBaseM0000644000175000002070000000357312654402377034235 0ustar00jvanekmock00000000000000 icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/ClipboardContent0000644000000000000000000000013112654402377023611 xustar0030 mtime=1454507263.262432247 29 atime=1454507658.77815737 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/ClipboardContent/0000755000175000002070000000000012654402377024412 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/ClipboardContent/PaxHeaders.17941/testcases0000644000000000000000000000013112654402377025607 xustar0030 mtime=1454507263.262432247 29 atime=1454507658.77815737 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/ClipboardContent/testcases/0000755000175000002070000000000012654402377026410 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/ClipboardContent/testcases/PaxHeaders.17941/ClipboardCont0000644000000000000000000000013212654402377030333 xustar0030 mtime=1454507263.262432247 30 atime=1454507327.298578216 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/ClipboardContent/testcases/ClipboardContentTests.java0000644000175000002070000001517612654402377033542 0ustar00jvanekmock00000000000000/* ClipboardContentTests.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import net.sourceforge.jnlp.tools.WaitingForStringProcess; import java.util.Arrays; import java.util.Collections; import java.util.List; import net.sourceforge.jnlp.ContentReaderListener; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.annotations.Bug; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.tools.AsyncJavaws; import static net.sourceforge.jnlp.tools.ClipboardHelpers.pasteFromClipboard; import static net.sourceforge.jnlp.tools.ClipboardHelpers.putToClipboard; import org.junit.Assert; import org.junit.Test; @Bug(id="PR708") public class ClipboardContentTests { private static final String XCEPTION = "xception"; private static final String contentC = "COPY#$REPRODUCER"; private static final String contentP = "PASTE#$REPRODUCER"; private static final String emptyContent = "empty content"; private static ServerAccess server = new ServerAccess(); private static final List javawsTrustArg = Collections.unmodifiableList(Arrays.asList(new String[]{"-Xtrustall"})); @Test public void assertClipboardIsWorking() throws Exception { putToClipboard(emptyContent); Assert.assertEquals(emptyContent, pasteFromClipboard()); putToClipboard(contentC); Assert.assertEquals(contentC, pasteFromClipboard()); } @Test @Bug(id = "PR708") public void ClipboardContentTestCopy1() throws Exception { putToClipboard(emptyContent); Assert.assertEquals("Clipboard must contain new value, did not", emptyContent, pasteFromClipboard()); WaitingForStringProcess wfsp = new WaitingForStringProcess(server, "/ClipboardContentCopy1.jnlp", javawsTrustArg, true, "copied"); wfsp.run(); String ss = pasteFromClipboard(); Assert.assertEquals("Clipboard content must not be changed - was", emptyContent, ss); Assert.assertNotNull("Result had to be delivered, was not", wfsp.getAj().getResult()); Assert.assertTrue("ClipboardContentSignedCopy stderr should contain " + XCEPTION + " but did not ", wfsp.getAj().getResult().stderr.contains(XCEPTION)); } //@Test needs awt robot to close dialog @Bug(id = "PR708") @NeedsDisplay public void ClipboardContentTestCopy2() throws Exception { putToClipboard(emptyContent); Assert.assertEquals("Clipboard must contain new value, did not", emptyContent, pasteFromClipboard()); WaitingForStringProcess wfsp = new WaitingForStringProcess(server, "/ClipboardContentCopy2.jnlp", javawsTrustArg, false, "copied"); wfsp.run(); String ss = pasteFromClipboard(); Assert.assertEquals("Clipboard content must not be changed, was", emptyContent, ss); Assert.assertNotNull("Result had to be delivered, was not", wfsp.getAj().getResult()); Assert.assertTrue("ClipboardContentSignedCopy stderr should contain " + XCEPTION + " but did not", wfsp.getAj().getResult().stderr.contains(XCEPTION)); } @Test @Bug(id = "PR708") public void ClipboardContentTestPaste1() throws Exception { //necessery errasing putToClipboard(emptyContent); Assert.assertEquals("Clipboard must contain new value, did not", emptyContent, pasteFromClipboard()); //now put the tested data putToClipboard(contentP); Assert.assertEquals("Clipboard must contain new value, did not", contentP, pasteFromClipboard()); ProcessResult pr = server.executeJavawsHeadless(javawsTrustArg, "/ClipboardContentPaste1.jnlp"); Assert.assertFalse("ClipboardContentTestPaste stdout should not contain " + contentP + " but didn't", pr.stdout.contains(contentP)); Assert.assertTrue("ClipboardContentTestPaste stderr should contain " + XCEPTION + " but didn't ", pr.stderr.contains(XCEPTION)); } //@Test //needs awt robot to close dialog //Q - can this test be headless,and so automated? //A - no, headless test are present. Swing is handling clipoard by little bit more complicated ways // but imho at the end its the same privlidges. So this test is kept only fo record @Bug(id = "PR708") @NeedsDisplay public void ClipboardContentTestPaste2() throws Exception { //necessery errasing putToClipboard(emptyContent); Assert.assertEquals("Clipboard must contain new value, did not", emptyContent, pasteFromClipboard()); //now put the tested data putToClipboard(contentP); Assert.assertEquals("Clipboard must contain new value, did not", contentP, pasteFromClipboard()); Assert.assertEquals("Clipboard must contain new value, did not", contentP, pasteFromClipboard()); ProcessResult pr = server.executeJavaws(javawsTrustArg, "/ClipboardContentPaste2.jnlp"); Assert.assertFalse("ClipboardContentTestPaste stdout should not contain " + contentP + " but didn't", pr.stdout.contains(contentP)); Assert.assertTrue("ClipboardContentTestPaste stderr should contain " + XCEPTION + " but didn't ", pr.stderr.contains(XCEPTION)); } } icedtea-web-1.6.2/tests/reproducers/simple/ClipboardContent/PaxHeaders.17941/srcs0000644000000000000000000000013112654402377024563 xustar0030 mtime=1454507263.261432261 29 atime=1454507658.77815737 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/ClipboardContent/srcs/0000755000175000002070000000000012654402377025364 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/ClipboardContent/srcs/PaxHeaders.17941/ClipboardContent.j0000644000000000000000000000013212654402377030246 xustar0030 mtime=1454507263.261432261 30 atime=1454507327.298578216 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/ClipboardContent/srcs/ClipboardContent.java0000644000175000002070000001616512654402377031472 0ustar00jvanekmock00000000000000/* ClipboardContent.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.awt.Toolkit; import java.awt.datatransfer.Clipboard; import java.awt.datatransfer.DataFlavor; import java.awt.datatransfer.StringSelection; import java.awt.datatransfer.Transferable; import java.awt.datatransfer.UnsupportedFlavorException; import java.io.IOException; import java.lang.reflect.InvocationTargetException; import java.util.concurrent.TimeUnit; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JTextField; import javax.swing.SwingUtilities; import javax.swing.text.JTextComponent; public class ClipboardContent extends JPanel { private static final String contentC = "COPY#$REPRODUCER"; private static final String contentP = "PASTE#$REPRODUCER"; private static class LocalFrame extends JFrame { JTextField t; public LocalFrame(String str) { super(); t = new JTextField(str); this.add(t); this.setSize(100, 100); this.pack(); t.selectAll(); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } public void run() throws InterruptedException { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { setVisible(true); } }); while (!this.isVisible()) { Thread.sleep(100); } } public JTextField getT() { return t; } } public void putToClipboard1(String str) { Toolkit toolkit = Toolkit.getDefaultToolkit(); Clipboard clipboard = toolkit.getSystemClipboard(); StringSelection strSel = new StringSelection(str); clipboard.setContents(strSel, null); printFlavors(); } public void putToClipboard2(final String str) throws InterruptedException, NoSuchMethodException, IllegalAccessException, UnsupportedFlavorException, IllegalArgumentException, InvocationTargetException, IOException { final LocalFrame lf = new LocalFrame(str); lf.run(); ((JTextComponent) (lf.getT())).copy(); printFlavors(); lf.dispose(); } public String pasteFromClipboard2() throws InterruptedException, NoSuchMethodException, IllegalAccessException, UnsupportedFlavorException, IllegalArgumentException, InvocationTargetException, IOException { final LocalFrame lf = new LocalFrame("xxx"); lf.run(); ((JTextComponent) (lf.getT())).paste(); printFlavors(); String s = lf.getT().getText(); lf.dispose(); return s; } private void printFlavors() { //just for debugging // Toolkit toolkit = Toolkit.getDefaultToolkit(); // Clipboard clipboard = toolkit.getSystemClipboard(); // Transferable clipData = clipboard.getContents(clipboard); // DataFlavor[] cd = clipData.getTransferDataFlavors(); // for (DataFlavor dataFlavor : cd) { // System.out.println(dataFlavor.getMimeType()); // } } public String pasteFromClipboard1() throws UnsupportedFlavorException, IOException { Toolkit toolkit = Toolkit.getDefaultToolkit(); Clipboard clipboard = toolkit.getSystemClipboard(); Transferable clipData = clipboard.getContents(clipboard); printFlavors(); String s = (String) (clipData.getTransferData( DataFlavor.stringFlavor)); return s; } public static void main(String[] args) throws Exception { ClipboardContent cl = new ClipboardContent(); if (args.length == 0) { throw new IllegalArgumentException("at least copy1|2 or paste1|2 must be as argument (+mandatory number giving use timeout in seconds before termination)"); } else if (args.length == 1) { cl.proceed(args[0]); } else { cl.proceed(args[0], args[1]); } } public void proceed(String arg) throws Exception { proceed(arg, 0); } public void proceed(String arg, String keepAliveFor) throws Exception { proceed(arg, Long.valueOf(keepAliveFor)); } public void proceed(String arg, long timeOut) throws Exception { if (arg.equals("copy1")) { System.out.println(this.getClass().getName() + " copying1 to clipboard " + contentC); putToClipboard1(contentC); System.out.println(this.getClass().getName() + " copied1 to clipboard " + pasteFromClipboard1()); } else if (arg.equals("paste1")) { System.out.println(this.getClass().getName() + " pasting1 from clipboard "); String nwContent = pasteFromClipboard1(); System.out.println(this.getClass().getName() + " pasted1 from clipboard " + nwContent); } else if (arg.equals("copy2")) { System.out.println(this.getClass().getName() + " copying2 to clipboard " + contentC); putToClipboard2(contentC); System.out.println(this.getClass().getName() + " copied2 to clipboard " + pasteFromClipboard2()); } else if (arg.equals("paste2")) { System.out.println(this.getClass().getName() + " pasting2 from clipboard "); String nwContent = pasteFromClipboard2(); System.out.println(this.getClass().getName() + " pasted2 from clipboard " + nwContent); } else { throw new IllegalArgumentException("supported copy1|2 paste1|2"); } long start = System.nanoTime(); while (TimeUnit.NANOSECONDS.toSeconds(System.nanoTime() - start) < timeOut) { Thread.sleep(500); } } } icedtea-web-1.6.2/tests/reproducers/simple/ClipboardContent/PaxHeaders.17941/resources0000644000000000000000000000013112654402377025623 xustar0030 mtime=1454507263.261432261 29 atime=1454507658.77815737 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/ClipboardContent/resources/0000755000175000002070000000000012654402377026424 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/ClipboardContent/resources/PaxHeaders.17941/ClipboardCont0000644000000000000000000000013112654402377030346 xustar0030 mtime=1454507263.261432261 29 atime=1454507327.29757823 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/ClipboardContent/resources/ClipboardContentPaste2.jnlp0000644000175000002070000000441512654402377033626 0ustar00jvanekmock00000000000000 ClipboardContentPaste2 IcedTea ClipboardContentPaste2 paste2 icedtea-web-1.6.2/tests/reproducers/simple/ClipboardContent/resources/PaxHeaders.17941/ClipboardCont0000644000000000000000000000013112654402377030346 xustar0030 mtime=1454507263.261432261 29 atime=1454507327.29757823 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/ClipboardContent/resources/ClipboardContentPaste1.jnlp0000644000175000002070000000441512654402377033625 0ustar00jvanekmock00000000000000 ClipboardContentPaste1 IcedTea ClipboardContentPaste1 paste1 icedtea-web-1.6.2/tests/reproducers/simple/ClipboardContent/resources/PaxHeaders.17941/ClipboardCont0000644000000000000000000000013112654402377030346 xustar0030 mtime=1454507263.261432261 29 atime=1454507327.29757823 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/ClipboardContent/resources/ClipboardContentCopy2.jnlp0000644000175000002070000000445112654402377033464 0ustar00jvanekmock00000000000000 ClipboardContentCopy2 IcedTea ClipboardContentCopy2 copy2 10 icedtea-web-1.6.2/tests/reproducers/simple/ClipboardContent/resources/PaxHeaders.17941/ClipboardCont0000644000000000000000000000013112654402377030346 xustar0030 mtime=1454507263.260432274 29 atime=1454507327.29757823 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/ClipboardContent/resources/ClipboardContentCopy1.jnlp0000644000175000002070000000445112654402377033463 0ustar00jvanekmock00000000000000 ClipboardContentCopy1 IcedTea ClipboardContentCopy1 copy1 10 icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/CheckServices0000644000000000000000000000013112654402377023100 xustar0030 mtime=1454507263.260432274 29 atime=1454507658.77815737 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/CheckServices/0000755000175000002070000000000012654402377023701 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/CheckServices/PaxHeaders.17941/testcases0000644000000000000000000000013112654402377025076 xustar0030 mtime=1454507263.260432274 29 atime=1454507658.77815737 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/CheckServices/testcases/0000755000175000002070000000000012654402377025677 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/CheckServices/testcases/PaxHeaders.17941/CheckServicesTes0000644000000000000000000000013112654402377030273 xustar0030 mtime=1454507263.260432274 29 atime=1454507327.29757823 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/CheckServices/testcases/CheckServicesTests.java0000644000175000002070000001022312654402377032304 0ustar00jvanekmock00000000000000/* CheckServicesTests.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.annotations.Bug; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import org.junit.Assert; import org.junit.Test; @Bug(id="http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2012-February/017153.html") public class CheckServicesTests extends BrowserTest{ public void evaluateApplet(ProcessResult pr, boolean applet) { String s0 = "Codebase for applet was found in constructor"; Assert.assertTrue("CheckServices stdout should contain `" + s0 + "' but didn't.", pr.stdout.contains(s0)); String s1 = "Codebase for applet was found in init()"; Assert.assertTrue("CheckServices stdout should contain `" + s1 + "' but didn't.", pr.stdout.contains(s1)); String s2 = "Codebase for applet was found in start()"; Assert.assertTrue("CheckServices stdout should contain `" + s2 + "' but didn't.", pr.stdout.contains(s2)); if (applet){ /*this is working correctly in most browser, but not in all. temporarily disabling String s3 = "Codebase for applet was found in stop()"; Assert.assertTrue("CheckServices stdout should contain `" + s3 + "' but didn't.", pr.stdout.contains(s3)); String s4 = "Codebase for applet was found in destroy()"; Assert.assertTrue("CheckServices stdout should contain `" + s4 + "' but didn't.", pr.stdout.contains(s4)); */ } String s5 = "Exception occurred with null codebase in"; Assert.assertFalse("CheckServices stderr should not contain `" + s5 + "' but did.", pr.stdout.contains(s5)); String s6 = "Applet killing itself after 2000 ms of life"; Assert.assertTrue("CheckServices stdout should contain `" + s6 + "' but didn't.", pr.stdout.contains(s6)); } @Test @NeedsDisplay public void CheckWebstartServices() throws Exception { ProcessResult pr = server.executeJavaws(null, "/CheckServices.jnlp"); evaluateApplet(pr, false); Assert.assertFalse(pr.wasTerminated); Assert.assertEquals((Integer)0, pr.returnValue); } @Test @NeedsDisplay @TestInBrowsers(testIn={Browsers.one}) public void CheckPluginJNLPHServices() throws Exception { ProcessResult pr = server.executeBrowser(null, "/CheckPluginServices.html"); evaluateApplet(pr,false); Assert.assertTrue(pr.wasTerminated); } } icedtea-web-1.6.2/tests/reproducers/simple/CheckServices/PaxHeaders.17941/srcs0000644000000000000000000000013112654402377024052 xustar0030 mtime=1454507263.260432274 29 atime=1454507658.77815737 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/CheckServices/srcs/0000755000175000002070000000000012654402377024653 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/CheckServices/srcs/PaxHeaders.17941/CheckServices.java0000644000000000000000000000013112654402377027513 xustar0030 mtime=1454507263.260432274 29 atime=1454507327.29757823 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/CheckServices/srcs/CheckServices.java0000644000175000002070000000753412654402377030250 0ustar00jvanekmock00000000000000/* CheckServices.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import javax.jnlp.ServiceManager; import javax.jnlp.BasicService; import java.applet.Applet; public class CheckServices extends Applet { public CheckServices() { System.out.println("Applet constructor reached."); checkSetup("constructor"); } public void checkSetup(String method) { try { BasicService basicService = (BasicService)ServiceManager.lookup("javax.jnlp.BasicService"); // getCodeBase() will return null if ServiceManager does not // have access to ApplicationInstance. String codebase = basicService.getCodeBase().toString(); System.out.println("Codebase for applet was found in " + method + ": " + codebase); } catch (NullPointerException npe) { System.err.println("Exception occurred with null codebase in " + method); npe.printStackTrace(); } catch (Exception ex) { System.err.println("Exception occurred (probably with ServiceManager)."); ex.printStackTrace(); } } @Override public void init() { System.out.println("Applet is initializing."); checkSetup("init()"); } @Override public void start() { System.out.println("Applet is starting."); checkSetup("start()"); // FIXME: Instead of killing the thread, use the AWT robot to close // the applet window, signaling the event that runs stop/destroy. System.out.println("Killer thread is starting."); Thread killer = new Thread() { public int n = 2000; @Override public void run() { try { Thread.sleep(n); System.out.println("Applet killing itself after " + n + " ms of life"); System.exit(0); } catch (Exception ex) { } } }; killer.start(); } @Override public void stop() { System.out.println("Applet is stopping."); checkSetup("stop()"); } @Override public void destroy() { System.out.println("Applet is destorying itself."); checkSetup("destroy()"); } } icedtea-web-1.6.2/tests/reproducers/simple/CheckServices/PaxHeaders.17941/resources0000644000000000000000000000013112654402377025112 xustar0030 mtime=1454507263.259432288 29 atime=1454507658.77815737 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/CheckServices/resources/0000755000175000002070000000000012654402377025713 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/CheckServices/resources/PaxHeaders.17941/CheckServices.jn0000644000000000000000000000013212654402377030242 xustar0030 mtime=1454507263.259432288 30 atime=1454507327.296578243 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/CheckServices/resources/CheckServices.jnlp0000644000175000002070000000432012654402377031320 0ustar00jvanekmock00000000000000 CheckServices IcedTea CheckServices icedtea-web-1.6.2/tests/reproducers/simple/CheckServices/resources/PaxHeaders.17941/CheckPluginServi0000644000000000000000000000013212654402377030320 xustar0030 mtime=1454507263.259432288 30 atime=1454507327.296578243 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/CheckServices/resources/CheckPluginServices.html0000644000175000002070000000343512654402377032506 0ustar00jvanekmock00000000000000 icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/AppletTest0000644000000000000000000000013112654402377022444 xustar0030 mtime=1454507263.259432288 29 atime=1454507658.77815737 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletTest/0000755000175000002070000000000012654402377023245 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/AppletTest/PaxHeaders.17941/testcases0000644000000000000000000000013112654402377024442 xustar0030 mtime=1454507263.259432288 29 atime=1454507658.77815737 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletTest/testcases/0000755000175000002070000000000012654402377025243 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/AppletTest/testcases/PaxHeaders.17941/AppletTestTests.jav0000644000000000000000000000013212654402377030332 xustar0030 mtime=1454507263.259432288 30 atime=1454507327.296578243 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletTest/testcases/AppletTestTests.java0000644000175000002070000001775012654402377031230 0ustar00jvanekmock00000000000000/* Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import net.sourceforge.jnlp.closinglisteners.CountingClosingListener; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import org.junit.Assert; import org.junit.Test; public class AppletTestTests extends BrowserTest { private final String s7 = "Aplet killing himself after 2000 ms of life"; private final String s2 = "value2"; private final String s1 = "value1"; private final String s0 = "applet was started"; private final String s3 = "applet was initialised"; private class CountingClosingListenerImpl extends CountingClosingListener { @Override protected boolean isAlowedToFinish(String s) { return (s.contains(s0) && s.contains(s1) && s.contains(s2) && s.contains(s3) && s.contains(s7)); } } @Test @TestInBrowsers(testIn = {Browsers.googleChrome}) @NeedsDisplay public void doubleChrome() throws Exception { ServerAccess.PROCESS_TIMEOUT = 30 * 1000; try { //System.out.println("connecting AppletInFirefoxTest request in " + getBrowser().toString()); //just verify loging is recording browser ProcessResult pr1 = server.executeBrowser("/appletAutoTests2.html", new CountingClosingListenerImpl(), new CountingClosingListenerImpl()); if (pr1.process == null) { Assert.assertTrue("If proces was null here, then google-chrome had to not exist, and so " + ServerAccess.UNSET_BROWSER + " should be in exception, but exception was " + pr1.deadlyException.getMessage(), pr1.deadlyException.getMessage().contains(ServerAccess.UNSET_BROWSER)); return; } evaluateApplet(pr1, false); Assert.assertTrue(pr1.wasTerminated); //System.out.println("connecting AppletInFirefoxTest request in " + getBrowser().toString()); // just verify loging is recording browser ProcessResult pr = server.executeBrowser("/appletAutoTests2.html", new CountingClosingListenerImpl(), new CountingClosingListenerImpl()); evaluateApplet(pr, false); Assert.assertTrue(pr.wasTerminated); } finally { ServerAccess.PROCESS_TIMEOUT = 20 * 1000; //back to normal } } @Test @NeedsDisplay public void AppletTest() throws Exception { ProcessResult pr = server.executeJavawsHeadless(null, "/AppletTest.jnlp"); evaluateApplet(pr, true); Assert.assertFalse(pr.wasTerminated); Assert.assertEquals((Integer) 0, pr.returnValue); } private void evaluateApplet(ProcessResult pr, boolean javawsApplet) { Assert.assertTrue("AppletTest stdout should contains " + s3 + " bud didn't", pr.stdout.contains(s3)); Assert.assertTrue("AppletTest stdout should contains " + s0 + " bud didn't", pr.stdout.contains(s0)); Assert.assertTrue("AppletTest stdout should contains " + s1 + " bud didn't", pr.stdout.contains(s1)); Assert.assertTrue("AppletTest stdout should contains " + s2 + " bud didn't", pr.stdout.contains(s2)); Assert.assertTrue("AppletTest stdout should contains " + s7 + " bud didn't", pr.stdout.contains(s7)); if (!javawsApplet) { /*this is working correctly in most browser, but not in all. temporarily disabling String s4 = "applet was stopped"; Assert.assertTrue("AppletTest stdout should contain " + s4 + " bud did't", pr.stdout.contains(s4)); String s5 = "applet will be destroyed"; Assert.assertTrue("AppletTest stdout should contain " + s5 + " bud did't", pr.stdout.contains(s5)); */ } } @Test @TestInBrowsers(testIn = {Browsers.all}) @NeedsDisplay public void AppletInBrowserTest() throws Exception { //System.out.println("connecting AppletInFirefoxTest request in " + getBrowser().toString()); //just verify loging is recordingb rowser ServerAccess.PROCESS_TIMEOUT = 30 * 1000; try { ProcessResult pr = server.executeBrowser("/appletAutoTests2.html", new CountingClosingListenerImpl(), new CountingClosingListenerImpl()); evaluateApplet(pr, false); //Assert.assertTrue(pr.wasTerminated); this checks asre evil //Assert.assertEquals((Integer) 0, pr.returnValue); due to destroy is null } finally { ServerAccess.PROCESS_TIMEOUT = 20 * 1000; //back to normal } } @TestInBrowsers(testIn = {Browsers.all}) @NeedsDisplay public void AppletInBrowserTestXslowX() throws Exception { //System.out.println("connecting AppletInFirefoxTest request in " + getBrowser().toString()); //just verify loging is recording browser ServerAccess.PROCESS_TIMEOUT = 30 * 1000; try { ProcessResult pr = server.executeBrowser("/appletAutoTests.html", new CountingClosingListenerImpl(), new CountingClosingListenerImpl()); pr.process.destroy(); evaluateApplet(pr, false); Assert.assertTrue(pr.wasTerminated); //Assert.assertEquals((Integer) 0, pr.returnValue); due to destroy is null } finally { ServerAccess.PROCESS_TIMEOUT = 20 * 1000; //back to normal } } @Test @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay public void appletZeroWH() throws Exception { ProcessResult pr = server.executeBrowser("/appletZeroWH.html", new CountingClosingListenerImpl(), new CountingClosingListenerImpl()); evaluateApplet(pr, false); } @Test @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay public void appletZeroW() throws Exception { ProcessResult pr = server.executeBrowser("/appletZeroW.html", new CountingClosingListenerImpl(), new CountingClosingListenerImpl()); evaluateApplet(pr, false); } @Test @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay public void appletZeroH() throws Exception { ProcessResult pr = server.executeBrowser("/appletZeroH.html", new CountingClosingListenerImpl(), new CountingClosingListenerImpl()); evaluateApplet(pr, false); } } icedtea-web-1.6.2/tests/reproducers/simple/AppletTest/PaxHeaders.17941/srcs0000644000000000000000000000013112654402377023416 xustar0030 mtime=1454507263.258432301 29 atime=1454507658.77815737 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletTest/srcs/0000755000175000002070000000000012654402377024217 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/AppletTest/srcs/PaxHeaders.17941/AppletTest.java0000644000000000000000000000013212654402377026424 xustar0030 mtime=1454507263.258432301 30 atime=1454507327.296578243 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletTest/srcs/AppletTest.java0000644000175000002070000000521312654402377027150 0ustar00jvanekmock00000000000000 import java.applet.Applet; /* AppletTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class AppletTest extends Applet { private class Killer extends Thread { public int n = 2000; @Override public void run() { try { Thread.sleep(n); System.out.println("Aplet killing himself after " + n + " ms of life"); System.exit(0); } catch (Exception ex) { } } } private Killer killer; @Override public void init() { System.out.println("applet was initialised"); killer = new Killer(); } @Override public void start() { System.out.println("applet was started"); System.out.println(getParameter("key1")); System.out.println(getParameter("key2")); killer.start(); System.out.println("killer was started"); } @Override public void stop() { System.out.println("applet was stopped"); } @Override public void destroy() { System.out.println("applet will be destroyed"); } } icedtea-web-1.6.2/tests/reproducers/simple/AppletTest/srcs/PaxHeaders.17941/AppletErrorTest.java0000644000000000000000000000013212654402377027436 xustar0030 mtime=1454507263.258432301 30 atime=1454507327.296578243 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletTest/srcs/AppletErrorTest.java0000644000175000002070000002150712654402377030166 0ustar00jvanekmock00000000000000/* AppletErrorTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. * */ import java.applet.Applet; import java.awt.BorderLayout; import java.awt.Color; import java.awt.GridLayout; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.util.Random; import javax.swing.JApplet; import javax.swing.JComponent; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.SwingUtilities; public class AppletErrorTest extends JApplet { private class Killer extends Thread { public int n = 20000; @Override public void run() { try { Thread.sleep(n); System.out.println("Error Applet killing himself after " + n + " ms of life"); System.exit(0); } catch (Exception ex) { } } } private volatile boolean waiting = true; private boolean isApplet = true; private Killer killer; private final String IN_GUI_THREAD = "IN_GUI_THREAD"; private final String BEHIND_GUI_THREAD = "BEHIND_GUI_THREAD"; private final String IN_GUI = "IN_GUI"; private final String IN_INIT = "IN_INIT"; private final String IN_START = "IN_START"; private final String IN_STOP = "IN_STOP"; private final String IN_DESTROY = "IN_DESTROY"; private String levelOfDeath = BEHIND_GUI_THREAD; @Override public void init() { if (isApplet) { String s = getParameter("levelOfDeath"); if (s != null) { levelOfDeath = s; } } System.out.println("Error applet was initialised"); killer = new Killer(); if (levelOfDeath.equals(IN_INIT)) { throw new RuntimeException("Intentional exception from init"); } } public static void main(String[] args) { final JFrame f = new JFrame(); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.setSize(899, 600); f.setLayout(new BorderLayout()); AppletErrorTest ae = new AppletErrorTest(); ae.isApplet=false; ae.init(); f.add(ae); SwingUtilities.invokeLater(new Runnable() { @Override public void run() { f.setVisible(true); } }); ae.start(); } @Override public void start() { final AppletErrorTest aSelf = this; final JPanel self = new JPanel(); aSelf.setLayout(new BorderLayout()); aSelf.add(self); self.setLayout(new GridLayout(0, 4)); final Random r = new Random(); new Thread(new Runnable() { @Override public void run() { new Colorer(self, r).run(); } }).start(); System.out.println("Error applet was started"); killer.start(); System.out.println("killer was started"); if (levelOfDeath.equals(IN_GUI_THREAD) || levelOfDeath.equals(IN_GUI) || levelOfDeath.equals(BEHIND_GUI_THREAD)) { new Thread(new Runnable() { @Override public void run() { try { for (int i = 0; i < 15; i++) { try { System.out.println("Rainbow is shining"); new GuiRainbow(self, r, i).run(); if (levelOfDeath.equals(BEHIND_GUI_THREAD) && i >= 12) { throw new RuntimeException("Intentional error from start (gui is running)- " + levelOfDeath); } Thread.sleep(200); } catch (InterruptedException ex) { throw new RuntimeException(ex); } } } finally { waiting = false; } } }).start(); } if (!isApplet) { if (levelOfDeath.equals(IN_GUI)) { while (waiting) { try { Thread.sleep(100); SwingUtilities.invokeLater(new Runnable() { public void run() { aSelf.repaint(); aSelf.validate(); aSelf.repaint(); } }); } catch (InterruptedException ex) { throw new RuntimeException(ex); } } throw new RuntimeException("Intentional error from start (gui was running)- " + levelOfDeath); } } if (levelOfDeath.equals(IN_START)) { throw new RuntimeException("Intentional error from start (gui was not running)- " + levelOfDeath); } } @Override public void stop() { System.out.println("Error applet was stopped"); if (levelOfDeath.equals(IN_STOP)) { throw new RuntimeException("Intentional exception from stop" + levelOfDeath); } } @Override public void destroy() { System.out.println("Error applet will be destroyed"); if (levelOfDeath.equals(IN_DESTROY)) { throw new RuntimeException("Intentional exception from destroy" + levelOfDeath); } } private class GuiRainbow implements Runnable { private final JComponent self; private final Random r; private final int i; public GuiRainbow(JComponent self, Random r, int i) { this.self = self; this.r = r; this.i = i; } @Override public void run() { if (self.getComponentCount() > 1 && r.nextInt(2) == 0) { int x = r.nextInt(self.getComponentCount()); self.remove(x); self.validate(); } else { JLabel ll=new JLabel("Hi, its error applet here " + i); self.add(ll); self.validate(); ll.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { throw new RuntimeException("Intentional exception by click to "+i); } }); } System.out.println("Components are handled"); if (levelOfDeath.equals(IN_GUI_THREAD) && i >= 8) { throw new RuntimeException("Intentional error from swing thread (gui is running)- " + levelOfDeath); } } } class Colorer implements Runnable { private final JComponent self; private final Random r; public Colorer(JComponent self, Random r) { this.self = self; this.r = r; } @Override public void run() { int i = 0; while (true) { i++; try { self.setBackground(new Color(r.nextInt())); System.out.println("Applet is coloring " + i); Thread.sleep(200); } catch (Exception ex) { //intentionally silenced } } } } } icedtea-web-1.6.2/tests/reproducers/simple/AppletTest/PaxHeaders.17941/resources0000644000000000000000000000013112654402377024456 xustar0030 mtime=1454507263.258432301 29 atime=1454507658.77815737 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletTest/resources/0000755000175000002070000000000012654402377025257 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/AppletTest/resources/PaxHeaders.17941/errorAppletAutoTest0000644000000000000000000000013212654402377030447 xustar0030 mtime=1454507263.258432301 30 atime=1454507327.296578243 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletTest/resources/errorAppletAutoTests.html0000644000175000002070000000351712654402377032326 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/simple/AppletTest/resources/PaxHeaders.17941/appletZeroWH.html0000644000000000000000000000013212654402377030006 xustar0030 mtime=1454507263.258432301 30 atime=1454507327.295578256 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletTest/resources/appletZeroWH.html0000644000175000002070000000353112654402377030533 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/simple/AppletTest/resources/PaxHeaders.17941/appletZeroW.html0000644000000000000000000000013212654402377027676 xustar0030 mtime=1454507263.257432314 30 atime=1454507327.295578256 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletTest/resources/appletZeroW.html0000644000175000002070000000353312654402377030425 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/simple/AppletTest/resources/PaxHeaders.17941/appletZeroH.html0000644000000000000000000000013212654402377027657 xustar0030 mtime=1454507263.257432314 30 atime=1454507327.295578256 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletTest/resources/appletZeroH.html0000644000175000002070000000353312654402377030406 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/simple/AppletTest/resources/PaxHeaders.17941/appletViewTest.html0000644000000000000000000000013212654402377030402 xustar0030 mtime=1454507263.257432314 30 atime=1454507327.295578256 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletTest/resources/appletViewTest.html0000644000175000002070000000402312654402377031124 0ustar00jvanekmock00000000000000 ok applet

ok applet

ok applet

bad applet

bad applet

icedtea-web-1.6.2/tests/reproducers/simple/AppletTest/resources/PaxHeaders.17941/appletAutoTests2.ht0000644000000000000000000000013212654402377030314 xustar0030 mtime=1454507263.257432314 30 atime=1454507327.295578256 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletTest/resources/appletAutoTests2.html0000644000175000002070000000353512654402377031376 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/simple/AppletTest/resources/PaxHeaders.17941/appletAutoTests.htm0000644000000000000000000000013212654402377030407 xustar0030 mtime=1454507263.256432328 30 atime=1454507327.295578256 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletTest/resources/appletAutoTests.html0000644000175000002070000000354312654402377031313 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/simple/AppletTest/resources/PaxHeaders.17941/AppletTest.jnlp0000644000000000000000000000013112654402377027505 xustar0030 mtime=1454507263.256432328 29 atime=1454507327.29457827 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletTest/resources/AppletTest.jnlp0000644000175000002070000000447012654402377030236 0ustar00jvanekmock00000000000000 AppletTest IcedTea AppletTest icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/AppletTakesLastParam0000644000000000000000000000013112654402377024401 xustar0030 mtime=1454507263.256432328 29 atime=1454507658.77815737 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletTakesLastParam/0000755000175000002070000000000012654402377025202 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/AppletTakesLastParam/PaxHeaders.17941/testcases0000644000000000000000000000013112654402377026377 xustar0030 mtime=1454507263.256432328 29 atime=1454507658.77815737 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletTakesLastParam/testcases/0000755000175000002070000000000012654402377027200 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/AppletTakesLastParam/testcases/PaxHeaders.17941/AppletTak0000644000000000000000000000031312654402377030266 xustar00114 path=icedtea-web-1.6.2/tests/reproducers/simple/AppletTakesLastParam/testcases/AppletTakesLastParamTests.java 30 mtime=1454507263.256432328 29 atime=1454507327.29457827 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletTakesLastParam/testcases/AppletTakesLastParamTests.0000644000175000002070000000551012654402377034247 0ustar00jvanekmock00000000000000/* AppletTakesLastParamTests.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess.AutoClose; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.annotations.TestInBrowsers; import org.junit.Assert; import org.junit.Test; public class AppletTakesLastParamTests extends BrowserTest { private void evaluate(ProcessResult pr) { String firstParam = "value1"; String secondParam = "value2"; Assert.assertFalse("AppletTakesLastParam stdout should not contain " + firstParam + " but did.", pr.stdout.contains(firstParam)); Assert.assertTrue("AppletTakesLastParam stdout should contain " + secondParam + " but did not.", pr.stdout.contains(secondParam)); } @Test @TestInBrowsers(testIn = {Browsers.one}) public void appletTakesLastParam() throws Exception { ProcessResult pr = server.executeBrowser("/appletTakesLastParam.html", AutoClose.CLOSE_ON_BOTH); evaluate(pr); } @Test public void jnlpTakesLastParam() throws Exception { ProcessResult pr = server.executeJavaws("/appletTakesLastParam.jnlp"); evaluate(pr); } }icedtea-web-1.6.2/tests/reproducers/simple/AppletTakesLastParam/PaxHeaders.17941/srcs0000644000000000000000000000013112654402377025353 xustar0030 mtime=1454507263.256432328 29 atime=1454507658.77815737 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletTakesLastParam/srcs/0000755000175000002070000000000012654402377026154 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/AppletTakesLastParam/srcs/PaxHeaders.17941/AppletTakesLas0000644000000000000000000000013112654402377030230 xustar0030 mtime=1454507263.256432328 29 atime=1454507327.29457827 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletTakesLastParam/srcs/AppletTakesLastParam.java0000644000175000002070000000364612654402377033052 0ustar00jvanekmock00000000000000 import java.applet.Applet; /* AppletTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class AppletTakesLastParam extends Applet { public void init() { System.out.println(getParameter("param")); System.out.println("*** APPLET FINISHED ***"); // Exits JNLP-launched applets, throws exception on normal applet: System.exit(0); } } icedtea-web-1.6.2/tests/reproducers/simple/AppletTakesLastParam/PaxHeaders.17941/resources0000644000000000000000000000013112654402377026413 xustar0030 mtime=1454507263.255432341 29 atime=1454507658.77815737 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletTakesLastParam/resources/0000755000175000002070000000000012654402377027214 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/AppletTakesLastParam/resources/PaxHeaders.17941/appletTak0000644000000000000000000000013112654402377030340 xustar0030 mtime=1454507263.255432341 29 atime=1454507327.29457827 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletTakesLastParam/resources/appletTakesLastParam.jnlp0000644000175000002070000000456612654402377034176 0ustar00jvanekmock00000000000000 AppletTakesLastParam IcedTea AppletTakesLastParam icedtea-web-1.6.2/tests/reproducers/simple/AppletTakesLastParam/resources/PaxHeaders.17941/appletTak0000644000000000000000000000013112654402377030340 xustar0030 mtime=1454507263.255432341 29 atime=1454507327.29457827 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletTakesLastParam/resources/appletTakesLastParam.html0000644000175000002070000000351412654402377034167 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/AppletTagWithMissingCodeAttribute0000644000000000000000000000013112654402377027105 xustar0030 mtime=1454507263.255432341 29 atime=1454507658.77815737 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletTagWithMissingCodeAttribute/0000755000175000002070000000000012654402377027706 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/AppletTagWithMissingCodeAttribute/PaxHeaders.17941/testca0000644000000000000000000000013112654402377030370 xustar0030 mtime=1454507263.255432341 29 atime=1454507658.77815737 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletTagWithMissingCodeAttribute/testcases/0000755000175000002070000000000012654402377031704 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/AppletTagWithMissingCodeAttribute/testcases/PaxHeaders.170000644000000000000000000000034112654402377030650 xustar00135 path=icedtea-web-1.6.2/tests/reproducers/simple/AppletTagWithMissingCodeAttribute/testcases/AppletTagWithMissingCodeAttribute.java 30 mtime=1454507263.255432341 30 atime=1454507327.293578283 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletTagWithMissingCodeAttribute/testcases/AppletTagWith0000644000175000002070000000504112654402377034344 0ustar00jvanekmock00000000000000/* AppletTagWithMissingCodeAttribute.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess.AutoClose; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; import net.sourceforge.jnlp.annotations.TestInBrowsers; import org.junit.Assert; import org.junit.Test; public class AppletTagWithMissingCodeAttribute extends BrowserTest { final static String closingString = AutoOkClosingListener.MAGICAL_OK_CLOSING_STRING; @Test @TestInBrowsers(testIn = { Browsers.firefox }) public void EmbeddedAppletWithMissingCodeAttribute() throws Exception { ProcessResult pr = server.executeBrowser("/AppletTagWithMissingCodeAttribute.html", AutoClose.CLOSE_ON_CORRECT_END); Assert.assertTrue("Stdout should contain " + closingString + " but did not", pr.stdout.contains(closingString)); } } icedtea-web-1.6.2/tests/reproducers/simple/AppletTagWithMissingCodeAttribute/PaxHeaders.17941/resour0000644000000000000000000000013112654402377030424 xustar0030 mtime=1454507263.254432354 29 atime=1454507658.77815737 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletTagWithMissingCodeAttribute/resources/0000755000175000002070000000000012654402377031720 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/AppletTagWithMissingCodeAttribute/resources/PaxHeaders.170000644000000000000000000000034112654402377030664 xustar00135 path=icedtea-web-1.6.2/tests/reproducers/simple/AppletTagWithMissingCodeAttribute/resources/AppletTagWithMissingCodeAttribute.html 30 mtime=1454507263.254432354 30 atime=1454507327.293578283 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletTagWithMissingCodeAttribute/resources/AppletTagWith0000644000175000002070000000344412654402377034365 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/simple/AppletTagWithMissingCodeAttribute/resources/PaxHeaders.170000644000000000000000000000032712654402377030670 xustar00125 path=icedtea-web-1.6.2/tests/reproducers/simple/AppletTagWithMissingCodeAttribute/resources/AppletJnlpWithMainClass.jnlp 30 mtime=1454507263.254432354 30 atime=1454507327.293578283 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletTagWithMissingCodeAttribute/resources/AppletJnlpWit0000644000175000002070000000435612654402377034410 0ustar00jvanekmock00000000000000 AppletJnlpWithMainClass IcedTea AppletJnlpWithMainClass icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/AppletSharedClassLoader0000644000000000000000000000013112654402377025050 xustar0030 mtime=1454507263.253432368 29 atime=1454507658.77815737 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/0000755000175000002070000000000012654402377025651 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/PaxHeaders.17941/testcases0000644000000000000000000000013112654402377027046 xustar0030 mtime=1454507263.254432354 29 atime=1454507658.77815737 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/testcases/0000755000175000002070000000000012654402377027647 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/testcases/PaxHeaders.17941/Shared0000644000000000000000000000033512654402377030262 xustar00131 path=icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/testcases/SharedClassLoaderApplet_dotCodeBaseTest.java 30 mtime=1454507263.254432354 30 atime=1454507327.293578283 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/testcases/SharedClassLoaderApplet0000644000175000002070000003206512654402377034271 0ustar00jvanekmock00000000000000/* Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.io.File; import java.io.IOException; import java.net.URL; import java.util.ArrayList; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ProcessWrapper; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.ServerLauncher; import net.sourceforge.jnlp.annotations.Bug; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.browsertesting.browsers.firefox.FirefoxProfilesOperator; import net.sourceforge.jnlp.closinglisteners.Rule; import net.sourceforge.jnlp.closinglisteners.RulesFolowingClosingListener; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; public class SharedClassLoaderApplet_dotCodeBaseTest extends BrowserTest { private static final ServerLauncher secondServer = ServerAccess.getIndependentInstance(); public static final String readingKeyword = "Reading"; private static String reaadOneKeyword = readingKeyword + " 1 X"; public static final String writingKeyword = "Writing"; public static final String unknownKeyword = "Unknown destiny"; public static final RulesFolowingClosingListener.MatchesRule readShared = new RulesFolowingClosingListener.MatchesRule("(?s).*" + readingKeyword + "\\s+[1-9][0-9]+\\sX.*"); public static final RulesFolowingClosingListener.MatchesRule writeShared = new RulesFolowingClosingListener.MatchesRule("(?s).*" + writingKeyword + "\\s+[1-9][0-9]+\\sX.*"); public static final Rule tooMuchReading = new Rule() { public static final int countsToBelieve = 5; @Override public void setRule(Object rule) { //noop } @Override public boolean evaluate(String upon) { return countStrings(upon) > countsToBelieve; } @Override public String toPassingString() { return "should contain at least" + countsToBelieve + " occurences of: " + reaadOneKeyword; } @Override public String toFailingString() { return "should contain no more than " + countsToBelieve + " occurences of: " + reaadOneKeyword; } }; public static class UrlLaunchingListener extends net.sourceforge.jnlp.closinglisteners.RulesFolowingClosingListener { private final URL url; private boolean launched = false; public UrlLaunchingListener(URL url) { super(writeShared); this.url = url; } @Override protected boolean isAlowedToFinish(String content) { boolean b = super.isAlowedToFinish(content); if (b && !launched) { launched = true; try { //should imidately return because browser is running, if not, launch ins another thread ProcessWrapper pw = new ProcessWrapper(server.getBrowserLocation(), new ArrayList(), url); pw.execute(); } catch (Exception ex) { throw new RuntimeException(ex); } } return readShared.evaluate(content)/*ok*/ || tooMuchReading.evaluate(content)/*not ok*/; } } public static final String dotCodeBaseSuffix = ""; public static final String dotCodeBaseFileSuffix = dotCodeBaseSuffix+".html"; //names of used resources public static final String namePrefix = "LaunchSharedClassLoaderApplet-"; public static final String namePrefix2 = "LaunchSharedClassLoaderApplet2-"; public static final String r1w1 = namePrefix + "reader1-writer1"; public static final String r1w2 = namePrefix + "reader1-writer2"; public static final String r1 = namePrefix + "reader1"; public static final String w1 = namePrefix + "writer1"; public static final String r2 = namePrefix + "reader2"; public static final String w2 = namePrefix + "writer2"; public static final String r1w1_2 = namePrefix2 + "reader1-writer1"; public static final String r1w2_2 = namePrefix2 + "reader1-writer2"; public static final String r1_2 = namePrefix2 + "reader1"; public static final String w1_2 = namePrefix2 + "writer1"; public static final String r2_2 = namePrefix2 + "reader2"; public static final String w2_2 = namePrefix2 + "writer2"; public static final String jarPrefix = "AppletSharedClassLoader"; public static final String jar1 = jarPrefix + ".jar"; public static final String jar2 = jarPrefix + "2.jar"; @BeforeClass public static void createAlternativeArchive() throws IOException { FirefoxProfilesOperator.copyFile(new File(server.getDir(), jar1), new File(server.getDir(), jar2)); } @AfterClass public static void stopSecondServer() { secondServer.stop(); } @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay @Bug(id = "PR580") @Test public void SharedClassLoaderAppletTest_sharedAll_onePage() throws Exception { ProcessResult pr = server.executeBrowser(r1w1 + dotCodeBaseFileSuffix, new RulesFolowingClosingListener(readShared), null); assertSharedLoader(pr,false); } @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay @Bug(id = "PR580") @Test public void SharedClassLoaderAppletTest_sharedAllExceptMain_OnePage() throws Exception { ProcessResult pr = server.executeBrowser(r1w2 + dotCodeBaseFileSuffix, new RulesFolowingClosingListener(readShared), null); assertSharedLoader(pr,false); } @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay @Bug(id = "PR580") @Test public void SharedClassLoaderAppletTest_sharedAllButDocumentBase_twoPages() throws Exception { ProcessResult pr = server.executeBrowser(w1 + dotCodeBaseFileSuffix, new UrlLaunchingListener(server.getUrl(r1 + dotCodeBaseFileSuffix)), null); assertSharedLoader(pr,true); } @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay @Bug(id = "PR580") @Test public void SharedClassLoaderAppletTest_sharedAllButDocumentBaseAndMain_twoPages() throws Exception { ProcessResult pr = server.executeBrowser(w1 + dotCodeBaseFileSuffix, new UrlLaunchingListener(server.getUrl(r2 + dotCodeBaseFileSuffix)), null); assertSharedLoader(pr,true); } @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay @Test //codebase seems to be compared by dots only public void SharedClassLoaderAppletTest_sharedAllButDocumentBaseAndCodeBase_twoPages() throws Exception { ProcessResult pr = server.executeBrowser(w1 + dotCodeBaseFileSuffix, new UrlLaunchingListener(secondServer.getUrl(r1 + dotCodeBaseFileSuffix)), null); assertNotSharedLoader(pr); } @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay @Test //codebase seems to be compared by dots only public void SharedClassLoaderAppletTest_sharedAllButDocumentBaseCodeBaseAndMain_twoPages() throws Exception { ProcessResult pr = server.executeBrowser(w1 + dotCodeBaseFileSuffix, new UrlLaunchingListener(secondServer.getUrl(r2 + dotCodeBaseFileSuffix)), null); assertNotSharedLoader(pr); } public static int countStrings(String where) { return countStrings(reaadOneKeyword, where); } public static int countStrings(String what, String where) { int lastIndex = 0; int count = 0; while (lastIndex != -1) { lastIndex = where.indexOf(what, lastIndex); if (lastIndex != -1) { count++; lastIndex += what.length(); } } return count; } public static void assertSharedLoader(ProcessResult pr, boolean twoSyncPages) { Assert.assertFalse("stdout must not contains " + unknownKeyword, pr.stdout.contains(unknownKeyword)); Assert.assertTrue("stdout " + readShared.toPassingString(), readShared.evaluate(pr.stdout)); Assert.assertTrue("stdout " + writeShared.toPassingString(), writeShared.evaluate(pr.stdout)); if (twoSyncPages) { //for not synchronised applets there is danger of reading before writing //so this would be to strict and so randomly failing Assert.assertFalse("stdout should NOT contains several " + readingKeyword + " strings, have", tooMuchReading.evaluate(pr.stdout)); } } public static void assertNotSharedLoader(ProcessResult pr) { Assert.assertFalse("stdout " + readShared.toFailingString(), readShared.evaluate(pr.stdout)); Assert.assertTrue("stdout " + writeShared.toPassingString(), writeShared.evaluate(pr.stdout)); Assert.assertTrue("stdout should contain several " + readingKeyword + " strings, have not", tooMuchReading.evaluate(pr.stdout)); Assert.assertFalse("stdout must not contain " + unknownKeyword, pr.stdout.contains(unknownKeyword)); } @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay @Bug(id = "PR580") @Test public void SharedClassLoaderAppletTest_sharedAllButArchives_onePage() throws Exception { ProcessResult pr = server.executeBrowser(r1w1_2 + dotCodeBaseFileSuffix, new RulesFolowingClosingListener(readShared), null); assertNotSharedLoader(pr); } @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay @Bug(id = "PR580") @Test public void SharedClassLoaderAppletTest_sharedAllExceptMainAndArchives_OnePage() throws Exception { ProcessResult pr = server.executeBrowser(r1w2_2 + dotCodeBaseFileSuffix, new RulesFolowingClosingListener(readShared), null); assertNotSharedLoader(pr); } @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay @Bug(id = "PR580") @Test public void SharedClassLoaderAppletTest_sharedAllButDocumentBaseAndArchives_twoPages() throws Exception { ProcessResult pr = server.executeBrowser(w1_2 + dotCodeBaseFileSuffix,new UrlLaunchingListener(server.getUrl(r1 + dotCodeBaseFileSuffix)), null); assertNotSharedLoader(pr); } @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay @Bug(id = "PR580") @Test public void SharedClassLoaderAppletTest_sharedAllButDocumentBaseAndMainAndArchives_twoPages() throws Exception { ProcessResult pr = server.executeBrowser(w1_2 + dotCodeBaseFileSuffix, new UrlLaunchingListener(server.getUrl(r2 + dotCodeBaseFileSuffix)), null); assertNotSharedLoader(pr); } @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay @Test //although codebase seems to be compared by dots only, the archive does its job public void SharedClassLoaderAppletTest_sharedAllButDocumentBaseAndCodeBaseAndArchives_twoPages() throws Exception { ProcessResult pr = server.executeBrowser(w1_2 + dotCodeBaseFileSuffix, new UrlLaunchingListener(secondServer.getUrl(r1 + dotCodeBaseFileSuffix)), null); assertNotSharedLoader(pr); } @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay @Test //although codebase seems to be compared by dots only, the archive does its job public void SharedClassLoaderAppletTest_sharedAllButDocumentBaseCodeBaseAndMainAndArchives_twoPages() throws Exception { ProcessResult pr = server.executeBrowser(w1_2 + dotCodeBaseFileSuffix, new UrlLaunchingListener(secondServer.getUrl(r2 + dotCodeBaseFileSuffix)), null); assertNotSharedLoader(pr); } } icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/testcases/PaxHeaders.17941/Shared0000644000000000000000000000035412654402377030263 xustar00146 path=icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/testcases/SharedClassLoaderApplet_WrittenPartialStubCodeBaseTest.java 30 mtime=1454507263.253432368 30 atime=1454507327.293578283 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/testcases/SharedClassLoaderApplet0000644000175000002070000002514412654402377034271 0ustar00jvanekmock00000000000000/* Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.io.File; import java.io.FileInputStream; import java.io.IOException; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.ServerLauncher; import net.sourceforge.jnlp.annotations.Bug; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.browsertesting.browsers.firefox.FirefoxProfilesOperator; import net.sourceforge.jnlp.closinglisteners.RulesFolowingClosingListener; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; public class SharedClassLoaderApplet_WrittenPartialStubCodeBaseTest extends BrowserTest { //this is shortcut to avoid SharedClassLoaderApplet_dotCodeBaseTest.something //as static import from default package is forbidden private static final class X extends SharedClassLoaderApplet_dotCodeBaseTest { }; //this is shortcut to avoid SharedClassLoaderApplet_WrittenCompleteCodeBaseTest.something //as static import from default package is forbidden private static final class Y extends SharedClassLoaderApplet_WrittenCompleteCodeBaseTest { }; private static final ServerLauncher secondServer = ServerAccess.getIndependentInstance(); private static final String writtenCodeBaseSuffix = "_WCB2"; private static final String writtenCodeBaseFileSuffix = writtenCodeBaseSuffix + ".html"; private static final String subFolderName = "SharedClassLaoderSubCodebaseFolder"; private static final File root = server.getDir(); private static final File subRoot = new File(root, subFolderName); private static final File origJar1 = new File(server.getDir(), X.jar1); private static final File origJar2 = new File(server.getDir(), X.jar2); private static final String renamedJar1Name=X.jar1+"XYZ"; private static final String renamedJar2Name=X.jar2+"XYZ"; private static final File renamedJar1 = new File(server.getDir(), renamedJar1Name); private static final File renamedJar2 = new File(server.getDir(), renamedJar2Name); @BeforeClass public static void createAlternativeAndEnsureOriginalArchivesDontExist() throws IOException { if (!subRoot.exists()) { boolean b = subRoot.mkdir(); if (!b){ throw new RuntimeException(subRoot.toString()+" was not created"); } } FirefoxProfilesOperator.copyFile(origJar1, new File(subRoot, X.jar1)); FirefoxProfilesOperator.copyFile(origJar1, new File(subRoot, X.jar2)); //origJar2 is actually created by SharedClassLoaderApplet_dotCodeBaseTestcreateAlternativeArchive //so it do not need to exists if (origJar2.exists()){ boolean b = origJar2.renameTo(renamedJar2); if (!b) { throw new RuntimeException(origJar2.toString()+" was not renamed"); } } boolean b = origJar1.renameTo(renamedJar1); if (!b) { throw new RuntimeException(origJar1.toString()+" was not renamed"); } } @AfterClass public static void restoreRenamedJars(){ if (renamedJar2.exists()){ boolean b = renamedJar2.renameTo(origJar2); if (!b){ throw new RuntimeException(renamedJar2.toString()+" was not renamed"); } } boolean b = renamedJar1.renameTo(origJar1); if (!b) { throw new RuntimeException(renamedJar1.toString()+" was not renamed"); } } @BeforeClass public static void prepareFakeFiles() throws IOException { for (int i = 0; i < Y.originalNames.length; i++) { String string = Y.originalNames[i]; String content = ServerAccess.getContentOfStream(new FileInputStream(new File(server.getDir(), string + X.dotCodeBaseFileSuffix)), "utf-8"); String content1 = content.replaceAll("codebase=\"\\.\"", "codebase=\"/" + subFolderName + "/\""); ServerAccess.saveFile(content1, new File(server.getDir(), string + writtenCodeBaseFileSuffix)); } } @AfterClass public static void stopSecondServer() { secondServer.stop(); } @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay @Bug(id = "PR580") @Test public void SharedClassLoaderAppletTest_sharedAll_onePage() throws Exception { ProcessResult pr = server.executeBrowser(X.r1w1 + writtenCodeBaseFileSuffix, new RulesFolowingClosingListener(X.readShared), null); X.assertSharedLoader(pr, false); } @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay @Bug(id = "PR580") @Test public void SharedClassLoaderAppletTest_sharedAllExceptMain_OnePage() throws Exception { ProcessResult pr = server.executeBrowser(X.r1w2 + writtenCodeBaseFileSuffix, new RulesFolowingClosingListener(X.readShared), null); X.assertSharedLoader(pr, false); } @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay @Bug(id = "PR580") @Test public void SharedClassLoaderAppletTest_sharedAllButDocumentBase_twoPages() throws Exception { ProcessResult pr = server.executeBrowser(X.w1 + writtenCodeBaseFileSuffix, new X.UrlLaunchingListener(server.getUrl(X.r1 + writtenCodeBaseFileSuffix)), null); X.assertSharedLoader(pr, true); } @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay @Bug(id = "PR580") @Test public void SharedClassLoaderAppletTest_sharedAllButDocumentBaseAndMain_twoPages() throws Exception { ProcessResult pr = server.executeBrowser(X.w1 + writtenCodeBaseFileSuffix, new X.UrlLaunchingListener(server.getUrl(X.r2 + writtenCodeBaseFileSuffix)), null); X.assertSharedLoader(pr, true); } @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay @Test public void SharedClassLoaderAppletTest_sharedAllButDocumentBaseAndCodeBase_twoPages() throws Exception { ProcessResult pr = server.executeBrowser(X.w1 + writtenCodeBaseFileSuffix, new X.UrlLaunchingListener(secondServer.getUrl(X.r1 + writtenCodeBaseFileSuffix)), null); X.assertNotSharedLoader(pr); } @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay @Test public void SharedClassLoaderAppletTest_sharedAllButDocumentBaseCodeBaseAndMain_twoPages() throws Exception { ProcessResult pr = server.executeBrowser(X.w1 + writtenCodeBaseFileSuffix, new X.UrlLaunchingListener(secondServer.getUrl(X.r2 + writtenCodeBaseFileSuffix)), null); X.assertNotSharedLoader(pr); } @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay @Bug(id = "PR580") @Test public void SharedClassLoaderAppletTest_sharedAllButArchives_onePage() throws Exception { ProcessResult pr = server.executeBrowser(X.r1w1_2 + writtenCodeBaseFileSuffix, new RulesFolowingClosingListener(X.readShared), null); X.assertNotSharedLoader(pr); } @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay @Bug(id = "PR580") @Test public void SharedClassLoaderAppletTest_sharedAllExceptMainAndArchives_OnePage() throws Exception { ProcessResult pr = server.executeBrowser(X.r1w2_2 + writtenCodeBaseFileSuffix, new RulesFolowingClosingListener(X.readShared), null); X.assertNotSharedLoader(pr); } @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay @Bug(id = "PR580") @Test public void SharedClassLoaderAppletTest_sharedAllButDocumentBaseAndArchives_twoPages() throws Exception { ProcessResult pr = server.executeBrowser(X.w1_2 + writtenCodeBaseFileSuffix, new X.UrlLaunchingListener(server.getUrl(X.r1 + writtenCodeBaseFileSuffix)), null); X.assertNotSharedLoader(pr); } @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay @Bug(id = "PR580") @Test public void SharedClassLoaderAppletTest_sharedAllButDocumentBaseAndMainAndArchives_twoPages() throws Exception { ProcessResult pr = server.executeBrowser(X.w1_2 + writtenCodeBaseFileSuffix, new X.UrlLaunchingListener(server.getUrl(X.r2 + writtenCodeBaseFileSuffix)), null); X.assertNotSharedLoader(pr); } @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay @Test public void SharedClassLoaderAppletTest_sharedAllButDocumentBaseAndCodeBaseAndArchives_twoPages() throws Exception { ProcessResult pr = server.executeBrowser(X.w1_2 + writtenCodeBaseFileSuffix, new X.UrlLaunchingListener(secondServer.getUrl(X.r1 + writtenCodeBaseFileSuffix)), null); X.assertNotSharedLoader(pr); } @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay @Test public void SharedClassLoaderAppletTest_sharedAllButDocumentBaseCodeBaseAndMainAndArchives_twoPages() throws Exception { ProcessResult pr = server.executeBrowser(X.w1_2 + writtenCodeBaseFileSuffix, new X.UrlLaunchingListener(secondServer.getUrl(X.r2 + writtenCodeBaseFileSuffix)), null); X.assertNotSharedLoader(pr); } } icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/testcases/PaxHeaders.17941/Shared0000644000000000000000000000035112654402377030260 xustar00143 path=icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/testcases/SharedClassLoaderApplet_WrittenCompleteCodeBaseTest.java 30 mtime=1454507263.253432368 30 atime=1454507327.292578296 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/testcases/SharedClassLoaderApplet0000644000175000002070000002230012654402377034260 0ustar00jvanekmock00000000000000/* Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.io.File; import java.io.FileInputStream; import java.io.IOException; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.ServerLauncher; import net.sourceforge.jnlp.annotations.Bug; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.browsertesting.browsers.firefox.FirefoxProfilesOperator; import net.sourceforge.jnlp.closinglisteners.RulesFolowingClosingListener; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; public class SharedClassLoaderApplet_WrittenCompleteCodeBaseTest extends BrowserTest { //this is shortcut to avoid SharedClassLoaderApplet_dotCodeBaseTest.something //as static import from default package is forbidden private static final class X extends SharedClassLoaderApplet_dotCodeBaseTest { }; private static final ServerLauncher secondServer = ServerAccess.getIndependentInstance(); private static final String writtenCodeBaseSuffix = "_WCB"; private static final String writtenCodeBaseServer2Suffix =writtenCodeBaseSuffix+"_2"; private static final String writtenCodeBaseFileSuffix = writtenCodeBaseSuffix + ".html"; private static final String writtenCodeBaseFileServer2Suffix = writtenCodeBaseServer2Suffix + ".html"; public static final String[] originalNames = new String[]{ X.r1w1, X.r1w2, X.r1, X.w1, X.r2, X.w2, X.r1w1_2, X.r1w2_2, X.r1_2, X.w1_2, X.r2_2, X.w2_2}; @BeforeClass public static void createAlternativeArchive() throws IOException { FirefoxProfilesOperator.copyFile(new File(server.getDir(), X.jar1), new File(server.getDir(), X.jar2)); } @BeforeClass public static void prepareFakeFiles() throws IOException { for (int i = 0; i < originalNames.length; i++) { String string = originalNames[i]; String content = ServerAccess.getContentOfStream(new FileInputStream(new File(server.getDir(),string+X.dotCodeBaseFileSuffix)), "utf-8"); String content1=content.replaceAll("codebase=\"\\.\"", "codebase=\""+server.getUrl("") +"\""); ServerAccess.saveFile(content1, new File(server.getDir(),string+writtenCodeBaseFileSuffix)); if (string.equals(X.r1) || string.equals(X.r2)){ String content2=content.replaceAll("codebase=\"\\.\"", "codebase=\""+secondServer.getUrl() +"\""); ServerAccess.saveFile(content2, new File(server.getDir(),string+writtenCodeBaseFileServer2Suffix)); } } } @AfterClass public static void stopSecondServer() { secondServer.stop(); } @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay @Bug(id = "PR580") @Test public void SharedClassLoaderAppletTest_sharedAll_onePage() throws Exception { ProcessResult pr = server.executeBrowser(X.r1w1 + writtenCodeBaseFileSuffix, new RulesFolowingClosingListener(X.readShared), null); X.assertSharedLoader(pr,false); } @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay @Bug(id = "PR580") @Test public void SharedClassLoaderAppletTest_sharedAllExceptMain_OnePage() throws Exception { ProcessResult pr = server.executeBrowser(X.r1w2 + writtenCodeBaseFileSuffix, new RulesFolowingClosingListener(X.readShared), null); X.assertSharedLoader(pr,false); } @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay @Bug(id = "PR580") @Test public void SharedClassLoaderAppletTest_sharedAllButDocumentBase_twoPages() throws Exception { ProcessResult pr = server.executeBrowser(X.w1 + writtenCodeBaseFileSuffix, new X.UrlLaunchingListener(server.getUrl(X.r1 + writtenCodeBaseFileSuffix)), null); X.assertSharedLoader(pr,true); } @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay @Bug(id = "PR580") @Test public void SharedClassLoaderAppletTest_sharedAllButDocumentBaseAndMain_twoPages() throws Exception { ProcessResult pr = server.executeBrowser(X.w1 + writtenCodeBaseFileSuffix, new X.UrlLaunchingListener(server.getUrl(X.r2 + writtenCodeBaseFileSuffix)), null); X.assertSharedLoader(pr,true); } @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay @Test public void SharedClassLoaderAppletTest_sharedAllButDocumentBaseAndCodeBase_twoPages() throws Exception { ProcessResult pr = server.executeBrowser(X.w1 + writtenCodeBaseFileSuffix, new X.UrlLaunchingListener(secondServer.getUrl(X.r1 + writtenCodeBaseFileServer2Suffix)), null); X.assertNotSharedLoader(pr); } @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay @Test public void SharedClassLoaderAppletTest_sharedAllButDocumentBaseCodeBaseAndMain_twoPages() throws Exception { ProcessResult pr = server.executeBrowser(X.w1 + writtenCodeBaseFileSuffix, new X.UrlLaunchingListener(secondServer.getUrl(X.r2 + writtenCodeBaseFileServer2Suffix)), null); X.assertNotSharedLoader(pr); } @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay @Bug(id = "PR580") @Test public void SharedClassLoaderAppletTest_sharedAllButArchives_onePage() throws Exception { ProcessResult pr = server.executeBrowser(X.r1w1_2 + writtenCodeBaseFileSuffix, new RulesFolowingClosingListener(X.readShared), null); X.assertNotSharedLoader(pr); } @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay @Bug(id = "PR580") @Test public void SharedClassLoaderAppletTest_sharedAllExceptMainAndArchives_OnePage() throws Exception { ProcessResult pr = server.executeBrowser(X.r1w2_2 + writtenCodeBaseFileSuffix, new RulesFolowingClosingListener(X.readShared), null); X.assertNotSharedLoader(pr); } @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay @Bug(id = "PR580") @Test public void SharedClassLoaderAppletTest_sharedAllButDocumentBaseAndArchives_twoPages() throws Exception { ProcessResult pr = server.executeBrowser(X.w1_2 + writtenCodeBaseFileSuffix,new X.UrlLaunchingListener(server.getUrl(X.r1 + writtenCodeBaseFileSuffix)), null); X.assertNotSharedLoader(pr); } @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay @Bug(id = "PR580") @Test public void SharedClassLoaderAppletTest_sharedAllButDocumentBaseAndMainAndArchives_twoPages() throws Exception { ProcessResult pr = server.executeBrowser(X.w1_2 + writtenCodeBaseFileSuffix, new X.UrlLaunchingListener(server.getUrl(X.r2 + writtenCodeBaseFileSuffix)), null); X.assertNotSharedLoader(pr); } @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay @Test public void SharedClassLoaderAppletTest_sharedAllButDocumentBaseAndCodeBaseAndArchives_twoPages() throws Exception { ProcessResult pr = server.executeBrowser(X.w1_2 + writtenCodeBaseFileSuffix, new X.UrlLaunchingListener(secondServer.getUrl(X.r1 + writtenCodeBaseFileServer2Suffix)), null); X.assertNotSharedLoader(pr); } @TestInBrowsers(testIn = {Browsers.one}) @NeedsDisplay @Test public void SharedClassLoaderAppletTest_sharedAllButDocumentBaseCodeBaseAndMainAndArchives_twoPages() throws Exception { ProcessResult pr = server.executeBrowser(X.w1_2 + writtenCodeBaseFileSuffix, new X.UrlLaunchingListener(secondServer.getUrl(X.r2 + writtenCodeBaseFileServer2Suffix)), null); X.assertNotSharedLoader(pr); } } icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/PaxHeaders.17941/srcs0000644000000000000000000000013112654402377026022 xustar0030 mtime=1454507263.253432368 29 atime=1454507658.77815737 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/srcs/0000755000175000002070000000000012654402377026623 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/srcs/PaxHeaders.17941/SharedSecre0000644000000000000000000000013212654402377030213 xustar0030 mtime=1454507263.253432368 30 atime=1454507327.292578296 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/srcs/SharedSecret.java0000644000175000002070000000537312654402377032052 0ustar00jvanekmock00000000000000/* Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.applet.Applet; import java.util.Random; import java.util.concurrent.atomic.AtomicInteger; public class SharedSecret { public static AtomicInteger value = new AtomicInteger(1); private final Applet body; private static final Random r = new Random(); public SharedSecret(Applet body) { this.body = body; System.out.println(body.getCodeBase().toString() + body.toString() + "have " + this.getClass().getClassLoader().toString()); } public void run() { while (true) { if (body.getParameter("reader") != null) { System.out.println(this.toString() + " Reading " + value.toString() + " X"); } else if (body.getParameter("writer") != null) { int a = value.incrementAndGet(); System.out.println(this.toString() + " Writing " + a + " X"); } else { System.out.println(this.toString() + "Unknown destiny"); } try { Thread.sleep(r.nextInt(50) + 50); } catch (Exception ex) { throw new RuntimeException(ex); } } } } icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/srcs/PaxHeaders.17941/SharedClass0000644000000000000000000000031112654402377030216 xustar00111 path=icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/srcs/SharedClassLoaderApplet2.java 30 mtime=1454507263.253432368 30 atime=1454507327.292578296 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/srcs/SharedClassLoaderApplet2.jav0000644000175000002070000000351712654402377034106 0ustar00jvanekmock00000000000000/* Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import javax.swing.JApplet; public class SharedClassLoaderApplet2 extends JApplet { @Override public void init() { } @Override public void start() { new SharedSecret(this).run(); } } icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/srcs/PaxHeaders.17941/SharedClass0000644000000000000000000000031112654402377030216 xustar00111 path=icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/srcs/SharedClassLoaderApplet1.java 30 mtime=1454507263.252432381 30 atime=1454507327.292578296 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/srcs/SharedClassLoaderApplet1.jav0000644000175000002070000000351712654402377034105 0ustar00jvanekmock00000000000000/* Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import javax.swing.JApplet; public class SharedClassLoaderApplet1 extends JApplet { @Override public void init() { } @Override public void start() { new SharedSecret(this).run(); } } icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/PaxHeaders.17941/resources0000644000000000000000000000013112654402377027062 xustar0030 mtime=1454507263.252432381 29 atime=1454507658.77815737 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/resources/0000755000175000002070000000000012654402377027663 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/resources/PaxHeaders.17941/Launch0000644000000000000000000000033412654402377030301 xustar00130 path=icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoaderApplet2-writer2.html 30 mtime=1454507263.252432381 30 atime=1454507327.292578296 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoader0000644000175000002070000000352112654402377034265 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/resources/PaxHeaders.17941/Launch0000644000000000000000000000033412654402377030301 xustar00130 path=icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoaderApplet2-writer1.html 30 mtime=1454507263.252432381 30 atime=1454507327.292578296 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoader0000644000175000002070000000352112654402377034265 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/resources/PaxHeaders.17941/Launch0000644000000000000000000000033412654402377030301 xustar00130 path=icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoaderApplet2-reader2.html 30 mtime=1454507263.252432381 30 atime=1454507327.292578296 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoader0000644000175000002070000000352112654402377034265 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/resources/PaxHeaders.17941/Launch0000644000000000000000000000033312654402377030300 xustar00130 path=icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoaderApplet2-reader1.html 30 mtime=1454507263.251432394 29 atime=1454507327.29157831 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoader0000644000175000002070000000352112654402377034265 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/resources/PaxHeaders.17941/Launch0000644000000000000000000000034312654402377030301 xustar00138 path=icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoaderApplet2-reader1-writer2.html 30 mtime=1454507263.251432394 29 atime=1454507327.29157831 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoader0000644000175000002070000000400012654402377034256 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/resources/PaxHeaders.17941/Launch0000644000000000000000000000034312654402377030301 xustar00138 path=icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoaderApplet2-reader1-writer1.html 30 mtime=1454507263.251432394 29 atime=1454507327.29157831 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoader0000644000175000002070000000400012654402377034256 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/resources/PaxHeaders.17941/Launch0000644000000000000000000000033212654402377030277 xustar00129 path=icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoaderApplet-writer2.html 30 mtime=1454507263.251432394 29 atime=1454507327.29157831 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoader0000644000175000002070000000352012654402377034264 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/resources/PaxHeaders.17941/Launch0000644000000000000000000000033212654402377030277 xustar00129 path=icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoaderApplet-writer1.html 30 mtime=1454507263.250432408 29 atime=1454507327.29157831 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoader0000644000175000002070000000352012654402377034264 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/resources/PaxHeaders.17941/Launch0000644000000000000000000000033212654402377030277 xustar00129 path=icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoaderApplet-reader2.html 30 mtime=1454507263.250432408 29 atime=1454507327.29157831 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoader0000644000175000002070000000352012654402377034264 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/resources/PaxHeaders.17941/Launch0000644000000000000000000000033312654402377030300 xustar00129 path=icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoaderApplet-reader1.html 30 mtime=1454507263.250432408 30 atime=1454507327.290578323 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoader0000644000175000002070000000352012654402377034264 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/resources/PaxHeaders.17941/Launch0000644000000000000000000000034312654402377030301 xustar00137 path=icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoaderApplet-reader1-writer2.html 30 mtime=1454507263.250432408 30 atime=1454507327.290578323 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoader0000644000175000002070000000377712654402377034302 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/resources/PaxHeaders.17941/Launch0000644000000000000000000000034312654402377030301 xustar00137 path=icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoaderApplet-reader1-writer1.html 30 mtime=1454507263.249432421 30 atime=1454507327.290578323 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoader0000644000175000002070000000377712654402377034302 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/AppletReadsInvalidJar0000644000000000000000000000013112654402377024527 xustar0030 mtime=1454507263.249432421 29 atime=1454507658.77815737 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletReadsInvalidJar/0000755000175000002070000000000012654402377025330 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/AppletReadsInvalidJar/PaxHeaders.17941/testcases0000644000000000000000000000013112654402377026525 xustar0030 mtime=1454507263.249432421 29 atime=1454507658.77815737 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletReadsInvalidJar/testcases/0000755000175000002070000000000012654402377027326 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/AppletReadsInvalidJar/testcases/PaxHeaders.17941/AppletRe0000644000000000000000000000031612654402377030246 xustar00116 path=icedtea-web-1.6.2/tests/reproducers/simple/AppletReadsInvalidJar/testcases/AppletReadsInvalidJarTests.java 30 mtime=1454507263.249432421 30 atime=1454507327.290578323 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletReadsInvalidJar/testcases/AppletReadsInvalidJarTest0000644000175000002070000000602512654402377034264 0ustar00jvanekmock00000000000000/* AppletReadsInvalidJarTests.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import org.junit.Assert; import org.junit.Test; public class AppletReadsInvalidJarTests extends BrowserTest{ static final String CORRECT_EXECUTION = "Program Executed Correctly."; static final String JNLP_EXPECTED_EXCEPTION = "ZipException"; /*This SHOULD NOT execute the applet!*/ @Test public void AppletJNLPTest() throws Exception { ProcessResult pr = server.executeJavawsHeadless("/AppletReadsInvalidJar.jnlp"); Assert.assertFalse("AppletReadsInvalidJar stdout should NOT contain '" + CORRECT_EXECUTION + "', but did (applet should not have ran!).", pr.stdout.contains(CORRECT_EXECUTION)); Assert.assertTrue("AppletReadsInvalidJar stderr should contain 'ZipException', but did not.", pr.stderr.contains(JNLP_EXPECTED_EXCEPTION)); } /*This SHOULD execute the applet!*/ @Test @TestInBrowsers(testIn={Browsers.one}) public void AppletInFirefoxTest() throws Exception { ProcessResult pr = server.executeBrowser("/AppletReadsInvalidJar.html"); Assert.assertTrue("AppletReadsInvalidJar stdout should contain '" + CORRECT_EXECUTION + "' but did not.", pr.stdout.contains(CORRECT_EXECUTION)); } } icedtea-web-1.6.2/tests/reproducers/simple/AppletReadsInvalidJar/PaxHeaders.17941/srcs0000644000000000000000000000013112654402377025501 xustar0030 mtime=1454507263.249432421 29 atime=1454507658.77815737 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletReadsInvalidJar/srcs/0000755000175000002070000000000012654402377026302 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/AppletReadsInvalidJar/srcs/PaxHeaders.17941/Valid.java0000644000000000000000000000013212654402377027461 xustar0030 mtime=1454507263.249432421 30 atime=1454507327.290578323 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletReadsInvalidJar/srcs/Valid.java0000644000175000002070000000406412654402377030210 0ustar00jvanekmock00000000000000import java.applet.Applet; /* Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class Valid extends Applet { private static class Killer extends Thread { @Override public void run() { try { int n = 2000; Thread.sleep(n); System.exit(0); } catch (Exception ex) { } } } @Override public void init() { new Killer().start(); System.out.println("Program Executed Correctly."); } } icedtea-web-1.6.2/tests/reproducers/simple/AppletReadsInvalidJar/PaxHeaders.17941/resources0000644000000000000000000000013112654402377026541 xustar0030 mtime=1454507263.249432421 29 atime=1454507658.77815737 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletReadsInvalidJar/resources/0000755000175000002070000000000012654402377027342 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/AppletReadsInvalidJar/resources/PaxHeaders.17941/NOT_A_VA0000644000000000000000000000013212654402377030030 xustar0030 mtime=1454507263.249432421 30 atime=1454507327.290578323 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletReadsInvalidJar/resources/NOT_A_VALID_JAR.jar0000644000175000002070000000000012654402377032341 0ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/AppletReadsInvalidJar/resources/PaxHeaders.17941/AppletRe0000644000000000000000000000031112654402377030255 xustar00111 path=icedtea-web-1.6.2/tests/reproducers/simple/AppletReadsInvalidJar/resources/AppletReadsInvalidJar.jnlp 30 mtime=1454507263.248432434 30 atime=1454507327.289578336 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletReadsInvalidJar/resources/AppletReadsInvalidJar.jnl0000644000175000002070000000446112654402377034224 0ustar00jvanekmock00000000000000 AppletReadsInvalidJar IcedTea AppletTest icedtea-web-1.6.2/tests/reproducers/simple/AppletReadsInvalidJar/resources/PaxHeaders.17941/AppletRe0000644000000000000000000000031112654402377030255 xustar00111 path=icedtea-web-1.6.2/tests/reproducers/simple/AppletReadsInvalidJar/resources/AppletReadsInvalidJar.html 30 mtime=1454507263.248432434 30 atime=1454507327.289578336 30 ctime=1454507658.755157677 icedtea-web-1.6.2/tests/reproducers/simple/AppletReadsInvalidJar/resources/AppletReadsInvalidJar.htm0000644000175000002070000000340612654402377034227 0ustar00jvanekmock00000000000000

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

icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/AppletBaseURLTest0000644000000000000000000000013112654402377023622 xustar0030 mtime=1454507263.247432448 30 atime=1454507658.779157357 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/AppletBaseURLTest/0000755000175000002070000000000012654402377024423 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/AppletBaseURLTest/PaxHeaders.17941/testcases0000644000000000000000000000013112654402377025620 xustar0030 mtime=1454507263.247432448 30 atime=1454507658.779157357 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/AppletBaseURLTest/testcases/0000755000175000002070000000000012654402377026421 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/AppletBaseURLTest/testcases/PaxHeaders.17941/AppletBaseUR0000644000000000000000000000013012654402377030106 xustar0030 mtime=1454507263.247432448 29 atime=1454507327.28857835 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/AppletBaseURLTest/testcases/AppletBaseURLTest.java0000644000175000002070000000734412654402377032537 0ustar00jvanekmock00000000000000/* AppletBaseURLTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess.AutoClose; import net.sourceforge.jnlp.annotations.Bug; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import org.junit.Assert; import org.junit.Test; public class AppletBaseURLTest extends BrowserTest{ private void evaluateApplet(ProcessResult pr, String baseName) { String codebaseRule = "(?s).*Codebase is http://localhost:[0-9]{5}/ for this applet(?s).*"; Assert.assertTrue("AppletBaseURL stdout should match" + codebaseRule + " but didn't", pr.stdout.matches(codebaseRule)); String documentbaseRule = "(?s).*Document base is http://localhost:[0-9]{5}/" + baseName + " for this applet(?s).*"; Assert.assertTrue("AppletBaseURL stdout should match" + documentbaseRule + " but didn't", pr.stdout.matches(documentbaseRule)); } @NeedsDisplay @Test public void AppletWebstartBaseURLTest() throws Exception { ProcessResult pr = server.executeJavaws("/AppletBaseURLTest.jnlp"); evaluateApplet(pr, ""); Assert.assertFalse(pr.wasTerminated); Assert.assertEquals((Integer) 0, pr.returnValue); } @Bug(id="PR855") @NeedsDisplay @Test @TestInBrowsers(testIn={Browsers.one}) public void AppletInFirefoxTest() throws Exception { ProcessResult pr = server.executeBrowser("/AppletBaseURLTest.html", AutoClose.CLOSE_ON_BOTH); pr.process.destroy(); evaluateApplet(pr, "AppletBaseURLTest.html"); Assert.assertTrue(pr.wasTerminated); } @Bug(id="PR855") @NeedsDisplay @Test @TestInBrowsers(testIn={Browsers.one}) public void AppletWithJNLPHrefTest() throws Exception { ProcessResult pr = server.executeBrowser("/AppletJNLPHrefBaseURLTest.html", AutoClose.CLOSE_ON_BOTH); pr.process.destroy(); evaluateApplet(pr, "AppletJNLPHrefBaseURLTest.html"); Assert.assertTrue(pr.wasTerminated); } } icedtea-web-1.6.2/tests/reproducers/simple/AppletBaseURLTest/PaxHeaders.17941/srcs0000644000000000000000000000013112654402377024574 xustar0030 mtime=1454507263.247432448 30 atime=1454507658.779157357 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/AppletBaseURLTest/srcs/0000755000175000002070000000000012654402377025375 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/AppletBaseURLTest/srcs/PaxHeaders.17941/AppletBaseURL.jav0000644000000000000000000000013012654402377027755 xustar0030 mtime=1454507263.247432448 29 atime=1454507327.28857835 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/AppletBaseURLTest/srcs/AppletBaseURL.java0000644000175000002070000000404712654402377030650 0ustar00jvanekmock00000000000000/* AppletBaseURL.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.applet.Applet; public class AppletBaseURL extends Applet { @Override public void init() { System.out.println("Document base is " + getDocumentBase() + " for this applet"); System.out.println("Codebase is " + getCodeBase() + " for this applet"); System.out.println("*** APPLET FINISHED ***"); // Exits JNLP-launched applets, throws exception on normal applet: System.exit(0); } } icedtea-web-1.6.2/tests/reproducers/simple/AppletBaseURLTest/PaxHeaders.17941/resources0000644000000000000000000000013112654402377025634 xustar0030 mtime=1454507263.246432461 30 atime=1454507658.779157357 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/AppletBaseURLTest/resources/0000755000175000002070000000000012654402377026435 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/AppletBaseURLTest/resources/PaxHeaders.17941/AppletJNLPHr0000644000000000000000000000030712654402377030044 xustar00111 path=icedtea-web-1.6.2/tests/reproducers/simple/AppletBaseURLTest/resources/AppletJNLPHrefBaseURLTest.html 30 mtime=1454507263.246432461 29 atime=1454507327.28857835 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/AppletBaseURLTest/resources/AppletJNLPHrefBaseURLTest.htm0000644000175000002070000000344712654402377033713 0ustar00jvanekmock00000000000000 icedtea-web-1.6.2/tests/reproducers/simple/AppletBaseURLTest/resources/PaxHeaders.17941/AppletBaseUR0000644000000000000000000000013012654402377030122 xustar0030 mtime=1454507263.246432461 29 atime=1454507327.28857835 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/AppletBaseURLTest/resources/AppletBaseURLTest.jnlp0000644000175000002070000000435112654402377032570 0ustar00jvanekmock00000000000000 AppletBaseURL IcedTea AppletBaseURL icedtea-web-1.6.2/tests/reproducers/simple/AppletBaseURLTest/resources/PaxHeaders.17941/AppletBaseUR0000644000000000000000000000013012654402377030122 xustar0030 mtime=1454507263.246432461 29 atime=1454507327.28857835 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/AppletBaseURLTest/resources/AppletBaseURLTest.html0000644000175000002070000000350612654402377032572 0ustar00jvanekmock00000000000000 icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/AllStackTraces0000644000000000000000000000013112654402377023217 xustar0030 mtime=1454507263.245432474 30 atime=1454507658.779157357 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/AllStackTraces/0000755000175000002070000000000012654402377024020 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/AllStackTraces/PaxHeaders.17941/testcases0000644000000000000000000000013112654402377025215 xustar0030 mtime=1454507263.245432474 30 atime=1454507658.779157357 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/AllStackTraces/testcases/0000755000175000002070000000000012654402377026016 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/AllStackTraces/testcases/PaxHeaders.17941/AllStackTracesT0000644000000000000000000000013012654402377030200 xustar0030 mtime=1454507263.245432474 29 atime=1454507327.28857835 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/AllStackTraces/testcases/AllStackTracesTest.java0000644000175000002070000000503512654402377032364 0ustar00jvanekmock00000000000000/* AllStackTracesTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import org.junit.Assert; import org.junit.Test; public class AllStackTracesTest { private static ServerAccess server = new ServerAccess(); @Test public void AllStackTracesTest1() throws Exception { ProcessResult pr=server.executeJavawsHeadless(null,"/AllStackTraces.jnlp"); String c = "(?s).*java.security.AccessControlException.{0,5}access denied.{0,5}java.lang.RuntimePermission.{0,5}" + "getStackTrace" + ".*"; Assert.assertTrue("stderr should match `"+c+"`, but didn't ",pr.stderr.matches(c)); String cc="ClassNotFoundException"; Assert.assertFalse("stderr should NOT contains `"+cc+"`, but did ",pr.stderr.contains(cc)); Assert.assertFalse("AllStackTracesTest1 should not be terminated, but was",pr.wasTerminated); Assert.assertEquals((Integer)0, pr.returnValue); } } icedtea-web-1.6.2/tests/reproducers/simple/AllStackTraces/PaxHeaders.17941/srcs0000644000000000000000000000013112654402377024171 xustar0030 mtime=1454507263.245432474 30 atime=1454507658.779157357 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/AllStackTraces/srcs/0000755000175000002070000000000012654402377024772 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/AllStackTraces/srcs/PaxHeaders.17941/AllStackTraces.java0000644000000000000000000000013112654402377027751 xustar0030 mtime=1454507263.245432474 30 atime=1454507327.287578363 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/AllStackTraces/srcs/AllStackTraces.java0000644000175000002070000000334712654402377030504 0ustar00jvanekmock00000000000000/* AllStackTraces.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class AllStackTraces { public static void main(String[] args) { Thread.getAllStackTraces(); } } icedtea-web-1.6.2/tests/reproducers/simple/AllStackTraces/PaxHeaders.17941/resources0000644000000000000000000000013112654402377025231 xustar0030 mtime=1454507263.245432474 30 atime=1454507658.779157357 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/AllStackTraces/resources/0000755000175000002070000000000012654402377026032 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/AllStackTraces/resources/PaxHeaders.17941/AllStackTraces.0000644000000000000000000000013112654402377030147 xustar0030 mtime=1454507263.245432474 30 atime=1454507327.287578363 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/AllStackTraces/resources/AllStackTraces.jnlp0000644000175000002070000000060612654402377031561 0ustar00jvanekmock00000000000000 Test Thread.getAllStackTraces IcedTea icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/AddShutdownHook0000644000000000000000000000013112654402377023424 xustar0030 mtime=1454507263.244432488 30 atime=1454507658.779157357 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/AddShutdownHook/0000755000175000002070000000000012654402377024225 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/AddShutdownHook/PaxHeaders.17941/testcases0000644000000000000000000000013112654402377025422 xustar0030 mtime=1454507263.245432474 30 atime=1454507658.779157357 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/AddShutdownHook/testcases/0000755000175000002070000000000012654402377026223 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/AddShutdownHook/testcases/PaxHeaders.17941/HangFirefoxTes0000644000000000000000000000013112654402377030276 xustar0030 mtime=1454507263.245432474 30 atime=1454507327.287578363 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/AddShutdownHook/testcases/HangFirefoxTests.java0000644000175000002070000001325112654402377032313 0ustar00jvanekmock00000000000000/* AddShutdownHookTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.CountingClosingListener; import net.sourceforge.jnlp.closinglisteners.RulesFolowingClosingListener; import org.junit.Assert; import org.junit.Test; /** If this test has failed, you may try the following to reproduce the problem more consistently: - private static final int MAX_WORKERS = MAX_PARALLEL_INITS * 4; - private static final int PRIORITY_WORKERS = MAX_PARALLEL_INITS * 2; + private static final int MAX_WORKERS = MAX_PARALLEL_INITS * 2; + private static final int PRIORITY_WORKERS = MAX_PARALLEL_INITS * 1; in PluginMessageConsumer.java */ public class HangFirefoxTests extends BrowserTest { String leString = "LaunchException"; ; String startedString = "applet was started"; RulesFolowingClosingListener.ContainsRule leRule = new RulesFolowingClosingListener.ContainsRule(leString); RulesFolowingClosingListener.ContainsRule appleStartedRule = new RulesFolowingClosingListener.ContainsRule(startedString); @Test @TestInBrowsers(testIn = Browsers.firefox) public void HangFirefoxWithRuntimeExceptionTests() throws Exception { ProcessResult pr = server.executeBrowser("/AddShutdownHook.html", new RulesFolowingClosingListener(appleStartedRule), new CountingClosingListener() { private boolean launched = false; @Override protected boolean isAlowedToFinish(String content) { if (AddShutdownHookTest.mr.evaluate(content) && !launched) { launched = true; try { server.executeBrowser("/appletAutoTests2.html", null, (CountingClosingListener) null); } catch (Exception ex) { throw new RuntimeException(ex); } } return false; } }); Assert.assertTrue("stderr " + AddShutdownHookTest.mr.toPassingString(), AddShutdownHookTest.mr.evaluate(pr.stderr)); Assert.assertTrue("stdout " + appleStartedRule.toPassingString(), appleStartedRule.evaluate(pr.stdout)); Assert.assertFalse("stderr " + AddShutdownHookTest.cnf.toFailingString(), AddShutdownHookTest.cnf.evaluate(pr.stderr)); } @Test @TestInBrowsers(testIn = Browsers.firefox) public void HangFirefoxWithLaunchException() throws Exception { ProcessResult pr = server.executeBrowser("/AddShutdownHook_wrong.html", new RulesFolowingClosingListener(appleStartedRule), new CountingClosingListener() { private boolean launched = false; @Override protected boolean isAlowedToFinish(String content) { if (leRule.evaluate(content) && !launched) { launched = true; try { server.executeBrowser("/appletAutoTests2.html", null, (CountingClosingListener) null); } catch (Exception ex) { throw new RuntimeException(ex); } } return false; } }); Assert.assertTrue("stderr " + leRule.toPassingString(), leRule.evaluate(pr.stderr)); Assert.assertTrue("stdout " + appleStartedRule.toPassingString(), appleStartedRule.evaluate(pr.stdout)); Assert.assertFalse("stderr " + AddShutdownHookTest.cnf.toFailingString(), AddShutdownHookTest.cnf.evaluate(pr.stderr)); } @Test @TestInBrowsers(testIn = Browsers.one) public void TestAddShutdownHookWrong() throws Exception { ProcessResult pr = server.executeBrowser("/AddShutdownHook_wrong.html", null, new RulesFolowingClosingListener(leRule)); Assert.assertTrue("stderr " + leRule.toPassingString(), leRule.evaluate(pr.stderr)); Assert.assertFalse("stderr " + AddShutdownHookTest.cnf.toFailingString(), AddShutdownHookTest.cnf.evaluate(pr.stderr)); } } icedtea-web-1.6.2/tests/reproducers/simple/AddShutdownHook/testcases/PaxHeaders.17941/AddShutdownHoo0000644000000000000000000000013112654402377030314 xustar0030 mtime=1454507263.244432488 30 atime=1454507327.287578363 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/AddShutdownHook/testcases/AddShutdownHookTest.java0000644000175000002070000001013312654402377032771 0ustar00jvanekmock00000000000000/* AddShutdownHookTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import net.sourceforge.jnlp.ClosingListener; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.RulesFolowingClosingListener; import net.sourceforge.jnlp.closinglisteners.StringMatchClosingListener; import org.junit.Assert; import org.junit.Test; public class AddShutdownHookTest extends BrowserTest { public static final String s = "(?s).*java.security.AccessControlException.{0,5}access denied.{0,5}java.lang.RuntimePermission.{0,5}" + "shutdownHooks" + ".*"; public static final String cnfString = "ClassNotFoundException"; public static final String confirmFailure = "WRONG - ShutdownHook was probably added"; public static final RulesFolowingClosingListener.MatchesRule mr = new RulesFolowingClosingListener.MatchesRule(s); public static final RulesFolowingClosingListener.ContainsRule cnf = new RulesFolowingClosingListener.ContainsRule(cnfString); public static final RulesFolowingClosingListener.ContainsRule cf = new RulesFolowingClosingListener.ContainsRule(confirmFailure); public static final RulesFolowingClosingListener rfc = new RulesFolowingClosingListener(mr); @Test public void AddShutdownHookTestLunch1() throws Exception { ProcessResult pr = server.executeJavawsHeadless(null, "/AddShutdownHook.jnlp"); Assert.assertTrue("stderr " + mr.toPassingString(), mr.evaluate(pr.stderr)); Assert.assertFalse("stderr " + cnf.toFailingString(), cnf.evaluate(pr.stderr)); Assert.assertFalse("AddShutdownHookTestLunch1 should not be terminated, but was", pr.wasTerminated); Assert.assertFalse("stderr " + cf.toFailingString(), cf.evaluate(pr.stderr)); Assert.assertEquals((Integer) 0, pr.returnValue); } @Test @TestInBrowsers(testIn = Browsers.one) public void AddShutdownHookApplet() throws Exception { ProcessResult pr = server.executeBrowser("/AddShutdownHook.html", null, rfc); if (server.getCurrentBrowsers() == Browsers.firefox) { //lookslike only firefox is able to recieve this Assert.assertTrue("stderr " + mr.toPassingString(), mr.evaluate(pr.stderr)); } Assert.assertFalse("stderr " + cnf.toFailingString(), cnf.evaluate(pr.stderr)); Assert.assertFalse("stderr " + cf.toFailingString(), cf.evaluate(pr.stderr)); } } icedtea-web-1.6.2/tests/reproducers/simple/AddShutdownHook/PaxHeaders.17941/srcs0000644000000000000000000000013112654402377024376 xustar0030 mtime=1454507263.244432488 30 atime=1454507658.779157357 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/AddShutdownHook/srcs/0000755000175000002070000000000012654402377025177 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/AddShutdownHook/srcs/PaxHeaders.17941/AddShutdownHook.jav0000644000000000000000000000013112654402377030222 xustar0030 mtime=1454507263.244432488 30 atime=1454507327.287578363 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/AddShutdownHook/srcs/AddShutdownHook.java0000644000175000002070000000405412654402377031112 0ustar00jvanekmock00000000000000 import java.applet.Applet; /* AddShutdownHook.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class AddShutdownHook extends Applet { public static void main(String[] args) { Runtime.getRuntime().addShutdownHook(new Thread() { public void run() { // no op } }); } @Override public void start() { main(null); System.err.println("WRONG - ShutdownHook was probably added"); } } icedtea-web-1.6.2/tests/reproducers/simple/AddShutdownHook/PaxHeaders.17941/resources0000644000000000000000000000013112654402377025436 xustar0030 mtime=1454507263.244432488 30 atime=1454507658.779157357 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/AddShutdownHook/resources/0000755000175000002070000000000012654402377026237 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/AddShutdownHook/resources/PaxHeaders.17941/AddShutdownHoo0000644000000000000000000000013112654402377030330 xustar0030 mtime=1454507263.244432488 30 atime=1454507327.287578363 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/AddShutdownHook/resources/AddShutdownHook_wrong.html0000644000175000002070000000343612654402377033414 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/simple/AddShutdownHook/resources/PaxHeaders.17941/AddShutdownHoo0000644000000000000000000000013112654402377030330 xustar0030 mtime=1454507263.243432501 30 atime=1454507327.286578376 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/AddShutdownHook/resources/AddShutdownHook.jnlp0000644000175000002070000000060612654402377032173 0ustar00jvanekmock00000000000000 test adding shutdown hooks IcedTea icedtea-web-1.6.2/tests/reproducers/simple/AddShutdownHook/resources/PaxHeaders.17941/AddShutdownHoo0000644000000000000000000000013112654402377030330 xustar0030 mtime=1454507263.243432501 30 atime=1454507327.286578376 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/AddShutdownHook/resources/AddShutdownHook.html0000644000175000002070000000343312654402377032175 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/AccessClassInPackage0000644000000000000000000000013112654402377024311 xustar0030 mtime=1454507263.243432501 30 atime=1454507658.779157357 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/AccessClassInPackage/0000755000175000002070000000000012654402377025112 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/AccessClassInPackage/PaxHeaders.17941/testcases0000644000000000000000000000013112654402377026307 xustar0030 mtime=1454507263.243432501 30 atime=1454507658.779157357 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/AccessClassInPackage/testcases/0000755000175000002070000000000012654402377027110 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/AccessClassInPackage/testcases/PaxHeaders.17941/AccessCla0000644000000000000000000000031212654402377030131 xustar00113 path=icedtea-web-1.6.2/tests/reproducers/simple/AccessClassInPackage/testcases/AccessClassInPackageTest.java 30 mtime=1454507263.243432501 30 atime=1454507327.286578376 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/AccessClassInPackage/testcases/AccessClassInPackageTest.j0000644000175000002070000001477212654402377034070 0ustar00jvanekmock00000000000000/* AccessClassInPackageTest.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.List; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import org.junit.Assert; import org.junit.Test; public class AccessClassInPackageTest { private static ServerAccess server = new ServerAccess(); private String[] files = { "AccessClassInPackageJAVAXJNLP.jnlp", "AccessClassInPackageSELF.jnlp", "AccessClassInPackageNETSF.jnlp", "AccessClassInPackageSUNSEC.jnlp" }; private String[] filesSigned = { "AccessClassInPackageSignedJAVAXJNLP.jnlp", "AccessClassInPackageSignedSELF.jnlp", "AccessClassInPackageSignedNETSF.jnlp", "AccessClassInPackageSignedSUNSEC.jnlp" }; private String[] badExceptions = { "accessClassInPackage.javax.jnlp.ServiceManager", "accessClassInPackage.AccessClassInPackage", "accessClassInPackage.net.sourceforge.jnlp", "accessClassInPackage.sun.security.internal.spec" }; private String[] pass = { "javax.jnlp.ServiceManager", "AccessClassInPackage", "net.sourceforge.jnlp.Parser", "sun.security.internal.spec.TlsKeyMaterialSpec" }; private static final List xta = Arrays.asList(new String[]{"-Xtrustall"}); private void testShouldFail(ProcessResult pr, String s) { String c = "(?s).*java.security.AccessControlException.{0,5}access denied.{0,5}java.lang.RuntimePermission.{0,5}" + s + ".*"; Assert.assertTrue("stderr should match `" + c + "`, but didn't ", pr.stderr.matches(c)); } private void testShouldNOTFail(ProcessResult pr, String s) { String c = "(?s).*java.security.AccessControlException.{0,5}access denied.{0,5}java.lang.RuntimePermission.{0,5}" + s + ".*"; Assert.assertFalse("stderr should NOT match `" + c + "`, but did ", pr.stderr.matches(c)); } private void commonPitfall(ProcessResult pr) { String cc = "ClassNotFoundException"; Assert.assertFalse("stderr should NOT contains `" + cc + "`, but did", pr.stderr.contains(cc)); Assert.assertFalse("AccessClassInPackageTestLunch1 should not be terminated, but was", pr.wasTerminated); Assert.assertEquals((Integer) 0, pr.returnValue); } private void testShouldPass(ProcessResult pr, String s) { String c = "Class was obtained: " + s; Assert.assertTrue("stdout should contains `" + c + "`, but didn't ", pr.stdout.contains(c)); } private void testShouldNOTPass(ProcessResult pr, String s) { String c = "Class was obtained: " + s; Assert.assertFalse("stdout should not contains `" + c + "`, but did ", pr.stdout.contains(c)); } @Test public void AccessClassInPackageJAVAXJNLP() throws Exception { ProcessResult pr = server.executeJavawsHeadless(null, "/" + files[0]); commonPitfall(pr); testShouldPass(pr, pass[0]); testShouldNOTFail(pr, badExceptions[0]); } @Test public void AccessClassInPackageSELF() throws Exception { ProcessResult pr = server.executeJavawsHeadless(null, "/" + files[1]); commonPitfall(pr); testShouldPass(pr, pass[1]); testShouldNOTFail(pr, badExceptions[1]); } @Test public void AccessClassInPackageNETSF() throws Exception { ProcessResult pr = server.executeJavawsHeadless(null, "/" + files[2]); commonPitfall(pr); testShouldFail(pr, badExceptions[2]); testShouldNOTPass(pr, pass[2]); } @Test public void AccessClassInPackageSUNSEC() throws Exception { ProcessResult pr = server.executeJavawsHeadless(null, "/" + files[3]); commonPitfall(pr); commonPitfall(pr); testShouldFail(pr, badExceptions[3]); testShouldNOTPass(pr, pass[3]); } //now signed vaiants @Test public void AccessClassInPackageSignedJAVAXJNLP() throws Exception { ProcessResult pr = server.executeJavawsHeadless(xta, "/" + filesSigned[0]); commonPitfall(pr); testShouldPass(pr, pass[0]); testShouldNOTFail(pr, badExceptions[0]); } @Test public void AccessClassInPackageSignedSELF() throws Exception { ProcessResult pr = server.executeJavawsHeadless(xta, "/" + filesSigned[1]); commonPitfall(pr); testShouldPass(pr, pass[1]); testShouldNOTFail(pr, badExceptions[1]); } @Test public void AccessClassInPackageSignedNETSF() throws Exception { ProcessResult pr = server.executeJavawsHeadless(xta, "/" + filesSigned[2]); commonPitfall(pr); testShouldPass(pr, pass[2]); testShouldNOTFail(pr, badExceptions[2]); } @Test public void AccessClassInPackageSignedSUNSEC() throws Exception { ProcessResult pr = server.executeJavawsHeadless(xta, "/" + filesSigned[3]); commonPitfall(pr); testShouldPass(pr, pass[3]); testShouldNOTFail(pr, badExceptions[3]); } } icedtea-web-1.6.2/tests/reproducers/simple/AccessClassInPackage/PaxHeaders.17941/srcs0000644000000000000000000000013112654402377025263 xustar0030 mtime=1454507263.243432501 30 atime=1454507658.779157357 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/AccessClassInPackage/srcs/0000755000175000002070000000000012654402377026064 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/AccessClassInPackage/srcs/PaxHeaders.17941/AccessClassInP0000644000000000000000000000013112654402377030061 xustar0030 mtime=1454507263.243432501 30 atime=1454507327.286578376 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/AccessClassInPackage/srcs/AccessClassInPackage.java0000644000175000002070000000350112654402377032660 0ustar00jvanekmock00000000000000/* AccessClassInPackage.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class AccessClassInPackage { public static void main(String[] args) throws Exception{ Class.forName(args[0]); System.out.println("Class was obtained: "+ args[0]); } } icedtea-web-1.6.2/tests/reproducers/simple/AccessClassInPackage/PaxHeaders.17941/resources0000644000000000000000000000013112654402377026323 xustar0030 mtime=1454507263.242432514 30 atime=1454507658.779157357 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/AccessClassInPackage/resources/0000755000175000002070000000000012654402377027124 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/AccessClassInPackage/resources/PaxHeaders.17941/AccessCla0000644000000000000000000000031412654402377030147 xustar00115 path=icedtea-web-1.6.2/tests/reproducers/simple/AccessClassInPackage/resources/AccessClassInPackageSUNSEC.jnlp 30 mtime=1454507263.242432514 30 atime=1454507327.286578376 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/AccessClassInPackage/resources/AccessClassInPackageSUNSEC0000644000175000002070000000436012654402377033725 0ustar00jvanekmock00000000000000 Test accessClassInPackage IcedTea testing access to sun.security.* package sun.security.internal.spec.TlsKeyMaterialSpec icedtea-web-1.6.2/tests/reproducers/simple/AccessClassInPackage/resources/PaxHeaders.17941/AccessCla0000644000000000000000000000031112654402377030144 xustar00113 path=icedtea-web-1.6.2/tests/reproducers/simple/AccessClassInPackage/resources/AccessClassInPackageSELF.jnlp 30 mtime=1454507263.242432514 29 atime=1454507327.28557839 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/AccessClassInPackage/resources/AccessClassInPackageSELF.j0000644000175000002070000000433212654402377033705 0ustar00jvanekmock00000000000000 Test accessClassInPackage IcedTea testing aaccess to package's internal class AccessClassInPackage icedtea-web-1.6.2/tests/reproducers/simple/AccessClassInPackage/resources/PaxHeaders.17941/AccessCla0000644000000000000000000000031212654402377030145 xustar00114 path=icedtea-web-1.6.2/tests/reproducers/simple/AccessClassInPackage/resources/AccessClassInPackageNETSF.jnlp 30 mtime=1454507263.242432514 29 atime=1454507327.28557839 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/AccessClassInPackage/resources/AccessClassInPackageNETSF.0000644000175000002070000000434212654402377033662 0ustar00jvanekmock00000000000000 Test accessClassInPackage IcedTea testing access to net.sourceforge.* package net.sourceforge.jnlp.Parser icedtea-web-1.6.2/tests/reproducers/simple/AccessClassInPackage/resources/PaxHeaders.17941/AccessCla0000644000000000000000000000031612654402377030151 xustar00118 path=icedtea-web-1.6.2/tests/reproducers/simple/AccessClassInPackage/resources/AccessClassInPackageJAVAXJNLP.jnlp 30 mtime=1454507263.242432514 29 atime=1454507327.28557839 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/AccessClassInPackage/resources/AccessClassInPackageJAVAXJ0000644000175000002070000000434412654402377033712 0ustar00jvanekmock00000000000000 Test accessClassInPackage IcedTea testing access to some javax.jnlp.* package javax.jnlp.ServiceManager icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/AbsolutePathsAndQueryStrings0000644000000000000000000000013112654402377026160 xustar0030 mtime=1454507263.241432528 30 atime=1454507658.779157357 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/AbsolutePathsAndQueryStrings/0000755000175000002070000000000012654402377026761 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/AbsolutePathsAndQueryStrings/PaxHeaders.17941/testcases0000644000000000000000000000013112654402377030156 xustar0030 mtime=1454507263.241432528 30 atime=1454507658.779157357 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/AbsolutePathsAndQueryStrings/testcases/0000755000175000002070000000000012654402377030757 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/AbsolutePathsAndQueryStrings/testcases/PaxHeaders.17941/A0000644000000000000000000000032512654402377030343 xustar00125 path=icedtea-web-1.6.2/tests/reproducers/simple/AbsolutePathsAndQueryStrings/testcases/AbsolutePathsAndQueryStrings.java 30 mtime=1454507263.241432528 29 atime=1454507327.28557839 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/AbsolutePathsAndQueryStrings/testcases/AbsolutePathsAndQu0000644000175000002070000001214012654402377034407 0ustar00jvanekmock00000000000000/* AbsolutePathsAndQueryStrings.java Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.io.File; import java.net.URL; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess.AutoClose; import net.sourceforge.jnlp.annotations.Bug; import net.sourceforge.jnlp.annotations.KnownToFail; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.cache.CacheUtil; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.config.DeploymentConfiguration; import org.junit.Assert; import org.junit.Test; import org.junit.AfterClass; public class AbsolutePathsAndQueryStrings extends BrowserTest { private static final String appletCloseString = AutoOkClosingListener.MAGICAL_OK_CLOSING_STRING; @Bug(id="PR1204") @NeedsDisplay @Test @TestInBrowsers(testIn={Browsers.one}) public void testAbsolutePathAndQueryStringBrowser() throws Exception { /* HTML specifies absolute path and path params, ensure that this is able to launch correctly */ ProcessResult pr = server.executeBrowser("/AbsolutePathsAndQueryStrings.html", AutoClose.CLOSE_ON_BOTH); Assert.assertTrue("stdout should contain " + appletCloseString + " but did not", pr.stdout.contains(appletCloseString)); } @Bug(id="PR1204") @NeedsDisplay @Test public void testAbsolutePathAndQueryStringWebstart() throws Exception { /* JNLP specifies absolute path and path params, ensure that this is able to launch correctly */ ProcessResult pr = server.executeJavawsHeadless("/AbsolutePathsAndQueryStrings.jnlp"); Assert.assertTrue("stdout should contain \"running\"but did not", pr.stdout.contains("running")); } @Bug(id="PR1204") @Test public void testCaching() throws Exception { /* Test that caching ignores path parameters and double-slash issue from absolute codebase paths */ URL plainLocation = new URL("http://localhost:1234/StripHttpPathParams.jar"); URL paramLocation = new URL("http://localhost:1234/StripHttpPathParams.jar?i=abcd"); URL absoluteLocation = new URL("http://localhost:1234//StripHttpPathParams.jar"); URL absoluteParamLocation = new URL("http://localhost:1234//StripHttpPathParams.jar?i=abcd"); DeploymentConfiguration config = JNLPRuntime.getConfiguration(); config.load(); String cacheLocation = config.getProperty(DeploymentConfiguration.KEY_USER_CACHE_DIR) + File.separator; File cacheDir = new File(cacheLocation); Assert.assertTrue(cacheDir.isDirectory()); boolean hasCachedCopy = false; for (File cache : cacheDir.listFiles()) { File[] cacheFiles = new File[] { CacheUtil.urlToPath(plainLocation, cache.getPath()), CacheUtil.urlToPath(paramLocation, cache.getPath()), CacheUtil.urlToPath(absoluteLocation, cache.getPath()), CacheUtil.urlToPath(absoluteParamLocation, cache.getPath()), }; for (File f : cacheFiles) { if (f.isFile()) hasCachedCopy = true; for (File g : cacheFiles) { Assert.assertEquals(f.getPath(), g.getPath()); } } } Assert.assertTrue(hasCachedCopy); } } icedtea-web-1.6.2/tests/reproducers/simple/AbsolutePathsAndQueryStrings/PaxHeaders.17941/resources0000644000000000000000000000013112654402377030172 xustar0030 mtime=1454507263.241432528 30 atime=1454507658.779157357 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/AbsolutePathsAndQueryStrings/resources/0000755000175000002070000000000012654402377030773 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/AbsolutePathsAndQueryStrings/resources/PaxHeaders.17941/A0000644000000000000000000000032612654402377030360 xustar00125 path=icedtea-web-1.6.2/tests/reproducers/simple/AbsolutePathsAndQueryStrings/resources/AbsolutePathsAndQueryStrings.jnlp 30 mtime=1454507263.241432528 30 atime=1454507327.284578403 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/AbsolutePathsAndQueryStrings/resources/AbsolutePathsAndQu0000644000175000002070000000434412654402377034432 0ustar00jvanekmock00000000000000 AbsolutePathsAndQueryStrings IcedTea Use relative codebase URLs to append to host names, and correctly parse query strings icedtea-web-1.6.2/tests/reproducers/simple/AbsolutePathsAndQueryStrings/resources/PaxHeaders.17941/A0000644000000000000000000000032612654402377030360 xustar00125 path=icedtea-web-1.6.2/tests/reproducers/simple/AbsolutePathsAndQueryStrings/resources/AbsolutePathsAndQueryStrings.html 30 mtime=1454507263.241432528 30 atime=1454507327.284578403 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/AbsolutePathsAndQueryStrings/resources/AbsolutePathsAndQu0000644000175000002070000000356212654402377034433 0ustar00jvanekmock00000000000000 icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/AWTCommonResourcesOnly0000644000000000000000000000013112654402377024720 xustar0030 mtime=1454507263.240432541 30 atime=1454507658.779157357 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/AWTCommonResourcesOnly/0000755000175000002070000000000012654402377025521 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/AWTCommonResourcesOnly/PaxHeaders.17941/resources0000644000000000000000000000013112654402377026732 xustar0030 mtime=1454507263.240432541 30 atime=1454507658.779157357 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/AWTCommonResourcesOnly/resources/0000755000175000002070000000000012654402377027533 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/AWTCommonResourcesOnly/resources/PaxHeaders.17941/marker.0000644000000000000000000000013112654402377030271 xustar0030 mtime=1454507263.240432541 30 atime=1454507327.284578403 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/AWTCommonResourcesOnly/resources/marker.png0000644000175000002070000000026412654402377031524 0ustar00jvanekmock00000000000000PNG  IHDR DPLTE$$$mmmjΰjTIDAT81 B].ZsŃ#b~g 54= 6lQ3FeBq BCks5ܔi +RIENDB`icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/simpletest20000644000000000000000000000013112654402377022632 xustar0030 mtime=1454507263.241432528 30 atime=1454507658.779157357 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/simpletest2/0000755000175000002070000000000012654402377023433 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/simpletest2/PaxHeaders.17941/testcases0000644000000000000000000000013112654402377024630 xustar0030 mtime=1454507263.241432528 30 atime=1454507658.779157357 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/simpletest2/testcases/0000755000175000002070000000000012654402377025431 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/simpletest2/testcases/PaxHeaders.17941/SimpleTest2Test.ja0000644000000000000000000000013112654402377030234 xustar0030 mtime=1454507263.241432528 30 atime=1454507327.350577523 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/simpletest2/testcases/SimpleTest2Test.java0000644000175000002070000000456012654402377031314 0ustar00jvanekmock00000000000000/* SimpleTest2Test.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import org.junit.Assert; import org.junit.Test; public class SimpleTest2Test { private static ServerAccess server = new ServerAccess(); @Test public void testSimpletest2lunchException() throws Exception { ProcessResult pr=server.executeJavawsHeadless(null,"/simpletest2.jnlp"); String s="Correct exception"; Assert.assertTrue("stderr should contains "+s+" but didn't",pr.stderr.contains(s)); String ss="Exception"; Assert.assertTrue("stderr should contains "+ss+" but did not",pr.stderr.contains(ss)); Assert.assertFalse("testSimpletest2lunchException should not be terminated, but was",pr.wasTerminated); } } icedtea-web-1.6.2/tests/reproducers/simple/simpletest2/PaxHeaders.17941/srcs0000644000000000000000000000013112654402377023604 xustar0030 mtime=1454507263.241432528 30 atime=1454507658.779157357 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/simpletest2/srcs/0000755000175000002070000000000012654402377024405 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/simpletest2/srcs/PaxHeaders.17941/SimpleTest2.java0000644000000000000000000000013112654402377026677 xustar0030 mtime=1454507263.241432528 30 atime=1454507327.350577523 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/simpletest2/srcs/SimpleTest2.java0000644000175000002070000000430012654402377027420 0ustar00jvanekmock00000000000000 import java.applet.Applet; /* SimpleTest2.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class SimpleTest2 extends Applet{ public static void main(String[] args) { throw new RuntimeException("Correct exception"); } @Override public void init() { System.out.println("applet was initialised"); } @Override public void start() { System.out.println("applet was started"); main(null); } @Override public void stop() { System.out.println("applet was stopped"); } @Override public void destroy() { System.out.println("applet will be destroyed"); } } icedtea-web-1.6.2/tests/reproducers/simple/simpletest2/PaxHeaders.17941/resources0000644000000000000000000000013112654402377024644 xustar0030 mtime=1454507263.241432528 30 atime=1454507658.779157357 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/simpletest2/resources/0000755000175000002070000000000012654402377025445 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/simpletest2/resources/PaxHeaders.17941/simpletest2.jnlp0000644000000000000000000000013112654402377030061 xustar0030 mtime=1454507263.241432528 30 atime=1454507327.350577523 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/simpletest2/resources/simpletest2.jnlp0000644000175000002070000000413412654402377030607 0ustar00jvanekmock00000000000000 simpletest2 IcedTea simpletest2 icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/simpletest10000644000000000000000000000013112654402377022631 xustar0030 mtime=1454507263.239432554 30 atime=1454507658.779157357 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/simpletest1/0000755000175000002070000000000012654402377023432 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/simpletest1/PaxHeaders.17941/testcases0000644000000000000000000000013112654402377024627 xustar0030 mtime=1454507263.240432541 30 atime=1454507658.779157357 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/simpletest1/testcases/0000755000175000002070000000000012654402377025430 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/simpletest1/testcases/PaxHeaders.17941/XDGspecificationTe0000644000000000000000000000013112654402377030303 xustar0030 mtime=1454507263.240432541 30 atime=1454507327.349577536 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/simpletest1/testcases/XDGspecificationTests.java0000644000175000002070000016546612654402377032523 0ustar00jvanekmock00000000000000/* Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Set; import net.sourceforge.jnlp.ContentReaderListener; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ProcessWrapper; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.annotations.Bug; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.browsertesting.browsers.firefox.FirefoxProfilesOperator; import net.sourceforge.jnlp.closinglisteners.RulesFolowingClosingListener; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.config.PathsAndFiles; import org.junit.Assert; import org.junit.After; import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; @Bug(id = "RH947647") public class XDGspecificationTests extends BrowserTest { private static File backupMainDir; private static class Backup { public final File from; public final File to; public Backup(File from, File to) { this.from = from; this.to = to; } } //intentionaly not using constants from itw to check itw private static final File oldRoot = new File(System.getProperty("user.home"), ".icedtea"); private static final File realCache; private static final File realConfig; private static final File homeCache = new File(System.getProperty("user.home") + File.separator + ".cache" + File.separator + "icedtea-web"); private static final File homeConfig = new File(System.getProperty("user.home") + File.separator + ".config" + File.separator + "icedtea-web"); private static List hollyBackup; static { String configHome = System.getProperty("user.home") + File.separator + ".config"; String cacheHome = System.getProperty("user.home") + File.separator + ".cache"; String XDG_CONFIG_HOME_value = System.getenv(PathsAndFiles.XDG_CONFIG_HOME_VAR); String XDG_CACHE_HOME_value = System.getenv(PathsAndFiles.XDG_CACHE_HOME_VAR); if (XDG_CONFIG_HOME_value != null) { configHome = XDG_CONFIG_HOME_value; } if (XDG_CACHE_HOME_value != null) { cacheHome = XDG_CACHE_HOME_value; } realConfig = new File(configHome + File.separator + "icedtea-web"); realCache = new File(cacheHome + File.separator + "icedtea-web"); } // When current root is backuped, // also new files, which legacy impl is not aware about // cold be copied. Remove them in fake root // if they are not, then firstrun cleanup fails, and so second prints unexpected warnings public static void removeUnsupportedLegacyFiles() { File gjp = new File(oldRoot, "generated_jnlps"); File icons = new File(oldRoot, "icons"); if (gjp.exists()) { deleteRecursively(gjp); } if (icons.exists()) { deleteRecursively(icons); } Assert.assertFalse(gjp.exists()); Assert.assertFalse(icons.exists()); } @BeforeClass public static void backup() throws IOException { File base = tmpDir(); backupMainDir = base; hollyBackup = backupRealSettingsAndClear(base); } @AfterClass public static void restore() throws IOException { cleanRealSettings(); restoreSettings(hollyBackup); deleteRecursively(backupMainDir); } private static void mv(File oldRoot, File base, List l) { if (oldRoot.exists()) { ServerAccess.logOutputReprint("moving of " + oldRoot + " to " + base); File dest = new File(base, oldRoot.getName()); boolean a = oldRoot.renameTo(dest); if (!a) { ServerAccess.logErrorReprint("moving of " + oldRoot + " to " + base + " failed"); } else { ServerAccess.logOutputReprint("sucess"); } if (l != null) { l.add(new Backup(oldRoot, dest)); } } else { ServerAccess.logOutputReprint("Can not move " + oldRoot + " to " + base + " the source (the first) is misisng"); } } public static File tmpDir() throws IOException { //creating in home, not in tmp, as we need to be sure the backup is on same device File f = File.createTempFile("itwConfigCache", "tmpDir", new File(System.getProperty("user.home"))); f.delete(); f.mkdir(); return f; } private static List backupRealSettingsAndClear(File base) throws IOException { File config = new File(base, "config"); config.mkdirs(); File cache = new File(base, "cache"); cache.mkdirs(); List l = new ArrayList<>(); mv(oldRoot, base, l); mv(realCache, cache, l); mv(realConfig, config, l); return l; } private static void restoreSettings(List col) throws IOException { for (Backup l : col) { mv(l.to, l.from.getParentFile(), null); } } public static void deleteRecursively(File f) { if (f.exists()) { ServerAccess.logOutputReprint("removing " + f); try { FirefoxProfilesOperator.deleteRecursively(f); } catch (IOException ex) { ServerAccess.logException(ex); } } else { ServerAccess.logOutputReprint("removal of " + f + " failed, do not exists"); } } private static void cleanRealSettings() { deleteRecursively(oldRoot); deleteRecursively(realCache); deleteRecursively(realConfig); } private static void cleanHomeSettings() { deleteRecursively(oldRoot); deleteRecursively(homeCache); deleteRecursively(homeConfig); } private String[] removeXdgVAlues() { Map p = System.getenv(); Set> r = p.entrySet(); List> rr = new ArrayList<>(r); Collections.sort(rr, new Comparator>() { @Override public int compare(Entry o1, Entry o2) { return o1.getKey().compareTo(o2.getKey()); } }); List l = new ArrayList<>(p.size()); int i = 0; int c = 0; for (Iterator> it = rr.iterator(); it.hasNext(); i++) { Entry entry = it.next(); String v = entry.getValue(); String s = entry.getKey() + "=" + v; if (entry.getKey().equals(PathsAndFiles.XDG_CACHE_HOME_VAR) || entry.getKey().equals(PathsAndFiles.XDG_CONFIG_HOME_VAR)) { ServerAccess.logOutputReprint("ignoring " + s); c++; } else { l.add(s); } } if (c == 0) { ServerAccess.logOutputReprint("no XDG defined, no change in variables "); } return l.toArray(new String[l.size()]); } private static String[] setXdgVAlues(File fakeRoot) { return setXdgVAlues(new File(fakeRoot.getAbsolutePath() + File.separator + "customCache"), new File(fakeRoot.getAbsolutePath() + File.separator + "customConfig")); } private static String[] setXdgVAlues(File cacheF, File configF) { boolean cache = false; boolean config = false; Map p = System.getenv(); Set> r = p.entrySet(); List> rr = new ArrayList<>(r); Collections.sort(rr, new Comparator>() { @Override public int compare(Entry o1, Entry o2) { return o1.getKey().compareTo(o2.getKey()); } }); List l = new ArrayList<>(p.size() + 2); int i = 0; for (Iterator> it = rr.iterator(); it.hasNext(); i++) { Entry entry = it.next(); String v = entry.getValue(); String s = entry.getKey() + "=" + v; switch (entry.getKey()) { case PathsAndFiles.XDG_CACHE_HOME_VAR: ServerAccess.logOutputReprint(entry.getKey() + " was " + v); v = cacheF.getAbsolutePath(); ServerAccess.logOutputReprint("set " + v); cache = true; break; case PathsAndFiles.XDG_CONFIG_HOME_VAR: ServerAccess.logOutputReprint(entry.getKey() + " was " + v); v = configF.getAbsolutePath(); ServerAccess.logOutputReprint("set " + v); config = true; break; } s = entry.getKey() + "=" + v; l.add(s); } if (!cache) { ServerAccess.logOutputReprint("was no cache"); String v = cacheF.getAbsolutePath(); ServerAccess.logOutputReprint("set " + v); String s = PathsAndFiles.XDG_CACHE_HOME_VAR + "=" + v; l.add(s); } if (!config) { ServerAccess.logOutputReprint("was no config"); String v = configF.getAbsolutePath(); ServerAccess.logOutputReprint("set " + v); String s = PathsAndFiles.XDG_CONFIG_HOME_VAR + "=" + v; l.add(s); } return l.toArray(new String[l.size()]); } private static void createFakeOldHomeCache() throws Exception { File tmp = tmpDir(); fakeExtendedSecurity(new File(tmp, PathsAndFiles.DEPLOYMENT_SUBDIR_DIR)); try { ProcessWrapper pw = new ProcessWrapper( server.getJavawsLocation(), Arrays.asList(new String[]{ServerAccess.HEADLES_OPTION}), server.getUrl("simpletest2.jnlp"), (ContentReaderListener) null, null, setXdgVAlues(tmp, tmp)); ProcessResult pr = pw.execute(); Assert.assertTrue(simpletests2Run.toPassingString(), simpletests2Run.evaluate(pr.stderr)); File currentConfigCache = new File(tmp, PathsAndFiles.DEPLOYMENT_SUBDIR_DIR); File oldIcedTea = new File(new File(System.getProperty("user.home")) + File.separator + ".icedtea"); boolean a = currentConfigCache.renameTo(oldIcedTea); Assert.assertTrue("creation of old cache by renaming " + currentConfigCache + " to " + oldIcedTea + " failed", a); assertOldMainFilesInHome(false, true, false); assertNotMainFilesInHome(true, true, true); } finally { deleteRecursively(tmp); } } private static void createFakeOldHomeConfig() throws Exception { File tmp = tmpDir(); long t = ServerAccess.PROCESS_TIMEOUT; ServerAccess.PROCESS_TIMEOUT = 5000; try { ProcessWrapper pw1 = new ProcessWrapper(); pw1.setArgs(Arrays.asList( new String[]{ new File(server.getJavawsFile().getParentFile(), "itweb-settings").getAbsolutePath() })); pw1.setVars(setXdgVAlues(tmp, tmp)); ProcessResult pr1 = pw1.execute(); ProcessWrapper pw2 = new ProcessWrapper(); pw2.setArgs(Arrays.asList( new String[]{ new File(server.getJavawsFile().getParentFile(), "itweb-settings").getAbsolutePath(), //one impl of new parser was unable to handle duplicates "set", "oldBaf", "differentOldBaf" })); pw2.setVars(setXdgVAlues(tmp, tmp)); ProcessResult pr2 = pw2.execute(); Assert.assertTrue(notMoving.toPassingString(), notMoving.evaluate(pr1.stdout)); Assert.assertTrue(notMoving.toPassingString(), notMoving.evaluate(pr2.stdout)); Assert.assertTrue(unknownProperty.toPassingString(), unknownProperty.evaluate(pr2.stdout)); File currentConfigCache = new File(tmp, PathsAndFiles.DEPLOYMENT_SUBDIR_DIR); File oldIcedTea = new File(new File(System.getProperty("user.home")) + File.separator + ".icedtea"); boolean a = currentConfigCache.renameTo(oldIcedTea); Assert.assertTrue("creation of old config by renaming " + currentConfigCache + " to " + oldIcedTea + " failed", a); assertOldConfigFilesInHome(true, true, true); assertNotConfigFilesInHome(true, true, true); } finally { ServerAccess.PROCESS_TIMEOUT = t; deleteRecursively(tmp); } } @After @Before public void cleanHome() { cleanHomeSettings(); } @After @Before public void cleanReal() { cleanRealSettings(); } private static List getContentOfDirectory(File f) { List result = new ArrayList<>(); if (f == null || !f.exists() || !f.isDirectory()) { return result; } File[] files = f.listFiles(); for (File file : files) { if (file.isDirectory()) { result.addAll(getContentOfDirectory(file)); } else { result.add(file); } } return result; } private static String listToString(List... l) { StringBuilder sb = new StringBuilder(); for (List list : l) { for (File s : list) { sb.append(s.getAbsolutePath()).append('\n'); } } return sb.toString(); } private static void assertConfigFiles(String s, boolean certs, boolean trust, boolean props) { if (certs) { Assert.assertTrue(trustedCertsInside.toPassingString(), trustedCertsInside.evaluate(s)); } if (trust) { Assert.assertTrue(appletTrustInside.toPassingString(), appletTrustInside.evaluate(s)); } if (props) { Assert.assertTrue(propsInside.toPassingString(), propsInside.evaluate(s)); } Assert.assertTrue(icedteaHostInside.toPassingString(), icedteaHostInside.evaluate(s)); } private static void assertMainFiles(String s, boolean s1, boolean s2, boolean a1) { if (a1) { Assert.assertTrue(appletJarInside.toPassingString(), appletJarInside.evaluate(s)); } if (s1) { Assert.assertTrue(jnlpInside1.toPassingString(), jnlpInside1.evaluate(s)); Assert.assertTrue(jarInside1.toPassingString(), jarInside1.evaluate(s)); } if (s2) { Assert.assertTrue(jnlpInside2.toPassingString(), jnlpInside2.evaluate(s)); Assert.assertTrue(jarInside2.toPassingString(), jarInside2.evaluate(s)); } Assert.assertTrue(localHostInside.toPassingString(), localHostInside.evaluate(s)); Assert.assertTrue(cacheHostInside.toPassingString(), cacheHostInside.evaluate(s)); Assert.assertTrue(icedteaHostInside.toPassingString(), icedteaHostInside.evaluate(s)); Assert.assertTrue(securityHostInside.toPassingString(), securityHostInside.evaluate(s)); Assert.assertTrue(trustedHostInside.toPassingString(), trustedHostInside.evaluate(s)); } private static void assertNotConfigFiles(String s, boolean certs, boolean trust, boolean props) { if (certs) { Assert.assertFalse(trustedCertsInside.toFailingString(), trustedCertsInside.evaluate(s)); } if (trust) { Assert.assertFalse(appletTrustInside.toFailingString(), appletTrustInside.evaluate(s)); } if (props) { Assert.assertFalse(propsInside.toFailingString(), propsInside.evaluate(s)); } Assert.assertFalse(icedteaHostInside.toFailingString(), icedteaHostInside.evaluate(s)); } private static void assertNotMainFiles(String s, boolean s1, boolean s2, boolean a1) { if (a1) { Assert.assertFalse(appletJarInside.toFailingString(), appletJarInside.evaluate(s)); } if (s1) { Assert.assertFalse(jnlpInside1.toFailingString(), jnlpInside1.evaluate(s)); Assert.assertFalse(jarInside1.toFailingString(), jarInside1.evaluate(s)); } if (s2) { Assert.assertFalse(jnlpInside2.toFailingString(), jnlpInside2.evaluate(s)); Assert.assertFalse(jarInside2.toFailingString(), jarInside2.evaluate(s)); } Assert.assertFalse(localHostInside.toFailingString(), localHostInside.evaluate(s)); Assert.assertFalse(cacheHostInside.toFailingString(), cacheHostInside.evaluate(s)); Assert.assertFalse(icedteaHostInside.toFailingString(), icedteaHostInside.evaluate(s)); Assert.assertFalse(securityHostInside.toFailingString(), securityHostInside.evaluate(s)); Assert.assertFalse(trustedHostInside.toFailingString(), trustedHostInside.evaluate(s)); } private static void assertMainFilesInHome(boolean s1, boolean s2, boolean a1) { String configHome = System.getProperty("user.home") + File.separator + ".config" + File.separator + PathsAndFiles.DEPLOYMENT_SUBDIR_DIR; String cacheHome = System.getProperty("user.home") + File.separator + ".cache" + File.separator + PathsAndFiles.DEPLOYMENT_SUBDIR_DIR; assertMainFiles( listToString(getContentOfDirectory(new File(configHome))) + "\n" + listToString(getContentOfDirectory(new File(cacheHome))), s1, s2, a1); } private static void assertConfigFilesInHome(boolean certs, boolean trust, boolean props) { String configHome = System.getProperty("user.home") + File.separator + ".config" + File.separator + PathsAndFiles.DEPLOYMENT_SUBDIR_DIR; String cacheHome = System.getProperty("user.home") + File.separator + ".cache" + File.separator + PathsAndFiles.DEPLOYMENT_SUBDIR_DIR; assertConfigFiles( listToString(getContentOfDirectory(new File(configHome))) + "\n" + listToString(getContentOfDirectory(new File(cacheHome))), certs, trust, props); } private static void assertNotMainFilesInHome(boolean s1, boolean s2, boolean a1) { String configHome = System.getProperty("user.home") + File.separator + ".config" + File.separator + PathsAndFiles.DEPLOYMENT_SUBDIR_DIR; String cacheHome = System.getProperty("user.home") + File.separator + ".cache" + File.separator + PathsAndFiles.DEPLOYMENT_SUBDIR_DIR; assertNotMainFiles( listToString(getContentOfDirectory(new File(configHome))) + "\n" + listToString(getContentOfDirectory(new File(cacheHome))), s1, s2, a1); } private static void assertNotConfigFilesInHome(boolean certs, boolean trust, boolean props) { String configHome = System.getProperty("user.home") + File.separator + ".config" + File.separator + PathsAndFiles.DEPLOYMENT_SUBDIR_DIR; String cacheHome = System.getProperty("user.home") + File.separator + ".cache" + File.separator + PathsAndFiles.DEPLOYMENT_SUBDIR_DIR; assertNotConfigFiles( listToString(getContentOfDirectory(new File(configHome))) + "\n" + listToString(getContentOfDirectory(new File(cacheHome))), certs, trust, props); } //runs private static final RulesFolowingClosingListener.ContainsRule simpletests1Run = new RulesFolowingClosingListener.ContainsRule("Good simple javaws exapmle"); private static final RulesFolowingClosingListener.ContainsRule simpletests2Run = new RulesFolowingClosingListener.ContainsRule("Correct exception"); private static final RulesFolowingClosingListener.ContainsRule moving = new RulesFolowingClosingListener.ContainsRule(DeploymentConfiguration.TRANSFER_TITLE); private static final RulesFolowingClosingListener.NotContainsRule notMoving = new RulesFolowingClosingListener.NotContainsRule(DeploymentConfiguration.TRANSFER_TITLE); private static final RulesFolowingClosingListener.ContainsRule unknownProperty = new RulesFolowingClosingListener.ContainsRule("WARNING: Unknown property name"); private static final RulesFolowingClosingListener.ContainsRule applet1Run = new RulesFolowingClosingListener.ContainsRule("applet was started"); //javaws/plugin files private static final RulesFolowingClosingListener.ContainsRule jnlpInside1 = new RulesFolowingClosingListener.ContainsRule("/simpletest1.jnlp"); private static final RulesFolowingClosingListener.ContainsRule jarInside1 = new RulesFolowingClosingListener.ContainsRule("/simpletest1.jar"); private static final RulesFolowingClosingListener.ContainsRule jnlpInside2 = new RulesFolowingClosingListener.ContainsRule("/simpletest2.jnlp"); private static final RulesFolowingClosingListener.ContainsRule jarInside2 = new RulesFolowingClosingListener.ContainsRule("/simpletest2.jar"); private static final RulesFolowingClosingListener.ContainsRule appletJarInside = new RulesFolowingClosingListener.ContainsRule("AppletTest.jar"); //private static final RulesFolowingClosingListener.ContainsRule appletHtmlInside = new RulesFolowingClosingListener.ContainsRule("appletAutoTests2.html"); not caching htmls //common files private static final RulesFolowingClosingListener.ContainsRule localHostInside = new RulesFolowingClosingListener.ContainsRule("/localhost/"); private static final RulesFolowingClosingListener.ContainsRule cacheHostInside = new RulesFolowingClosingListener.ContainsRule("/cache/"); private static final RulesFolowingClosingListener.ContainsRule icedteaHostInside = new RulesFolowingClosingListener.ContainsRule("/icedtea-web/"); private static final RulesFolowingClosingListener.ContainsRule oldIcedteaHostInside = new RulesFolowingClosingListener.ContainsRule("/.icedtea/"); private static final RulesFolowingClosingListener.ContainsRule securityHostInside = new RulesFolowingClosingListener.ContainsRule("/security/"); private static final RulesFolowingClosingListener.ContainsRule trustedHostInside = new RulesFolowingClosingListener.ContainsRule("/trusted"); //config files private static final RulesFolowingClosingListener.ContainsRule trustedCertsInside = new RulesFolowingClosingListener.ContainsRule("trusted.cacerts"); private static final RulesFolowingClosingListener.ContainsRule appletTrustInside = new RulesFolowingClosingListener.ContainsRule(".appletTrustSettings"); private static final RulesFolowingClosingListener.ContainsRule propsInside = new RulesFolowingClosingListener.ContainsRule("deployment.properties"); /* *JAVAWS - NO OLD CONFIG */ @Test public void runJavawsInCleanSystemWithNoXdg() throws Exception { assertNotMainFilesInHome(true, true, true); assertOldNotMainFilesInHome(true, true, true); //we need fake security and manifests File ff = new File(PathsAndFiles.USER_CONFIG_HOME); try { fakeExtendedSecurity(ff); ProcessWrapper pw = new ProcessWrapper(server.getJavawsLocation(), null, server.getUrl("simpletest1.jnlp"), (ContentReaderListener) null, null, removeXdgVAlues()); ProcessResult pr = pw.execute(); Assert.assertTrue(simpletests1Run.toPassingString(), simpletests1Run.evaluate(pr.stdout)); Assert.assertTrue(notMoving.toPassingString(), notMoving.evaluate(pr.stdout)); itwDoesNotComplainAboutOldConfig(pr); //no old config assertMainFilesInHome(true, false, false); assertOldNotMainFilesInHome(true, true, true); ProcessResult pr2 = pw.execute(); itwDoesNotComplainAboutOldConfig(pr2); assertMainFilesInHome(true, false, false); assertOldNotMainFilesInHome(true, true, true); } finally { deleteRecursively(ff); } } @Test public void runJavawsInCleanSystemWithXdg() throws Exception { File f = tmpDir(); try { assertNotMainFiles(listToString(getContentOfDirectory(f)), true, true, true); assertOldNotMainFilesInHome(true, true, true); //we need fake security and manifests File ff = new File(f, "customConfig/" + PathsAndFiles.DEPLOYMENT_SUBDIR_DIR); fakeExtendedSecurity(ff); ProcessWrapper pw = new ProcessWrapper(server.getJavawsLocation(), null, server.getUrl("simpletest1.jnlp"), (ContentReaderListener) null, null, setXdgVAlues(f)); ProcessResult pr = pw.execute(); itwDoesNotComplainAboutOldConfig(pr); //no old config Assert.assertTrue(simpletests1Run.toPassingString(), simpletests1Run.evaluate(pr.stdout)); Assert.assertTrue(notMoving.toPassingString(), notMoving.evaluate(pr.stdout)); assertMainFiles(listToString(getContentOfDirectory(f)), true, false, false); assertOldNotMainFilesInHome(true, true, true); ProcessResult pr2 = pw.execute(); itwDoesNotComplainAboutOldConfig(pr2); //no old config Assert.assertTrue(simpletests1Run.toPassingString(), simpletests1Run.evaluate(pr2.stdout)); Assert.assertTrue(notMoving.toPassingString(), notMoving.evaluate(pr2.stdout)); assertMainFiles(listToString(getContentOfDirectory(f)), true, false, false); assertOldNotMainFilesInHome(true, true, true); } finally { deleteRecursively(f); } } @Test public void runJavawsInCleanSystemWithXdgAndNoParent() throws Exception { File f = tmpDir(); try { assertNotMainFiles(listToString(getContentOfDirectory(f)), true, true, true); assertOldNotMainFilesInHome(true, true, true); f.delete(); //we need fake security and manifests File ff = new File(f, "customConfig/" + PathsAndFiles.DEPLOYMENT_SUBDIR_DIR); fakeExtendedSecurity(ff); ProcessWrapper pw = new ProcessWrapper(server.getJavawsLocation(), null, server.getUrl("simpletest1.jnlp"), (ContentReaderListener) null, null, setXdgVAlues(f)); ProcessResult pr = pw.execute(); itwDoesNotComplainAboutOldConfig(pr); Assert.assertTrue(simpletests1Run.toPassingString(), simpletests1Run.evaluate(pr.stdout)); Assert.assertTrue(notMoving.toPassingString(), notMoving.evaluate(pr.stdout)); assertMainFiles(listToString(getContentOfDirectory(f)), true, false, false); assertOldNotMainFilesInHome(true, true, true); ProcessResult pr3 = pw.execute(); itwDoesNotComplainAboutOldConfig(pr3); Assert.assertTrue(simpletests1Run.toPassingString(), simpletests1Run.evaluate(pr3.stdout)); Assert.assertTrue(notMoving.toPassingString(), notMoving.evaluate(pr3.stdout)); assertMainFiles(listToString(getContentOfDirectory(f)), true, false, false); assertOldNotMainFilesInHome(true, true, true); } finally { deleteRecursively(f); } } private static void itwDoesNotComplainAboutOldConfig(ProcessResult pr) { itwDoesNotComplainAboutOldConfig(pr.stdout); } private static void itwDoesNotComplainAboutOldConfig(String stdout) { Assert.assertFalse(stdout.contains(DeploymentConfiguration.TRANSFER_TITLE)); } private static void itwDoesComplainAboutOldConfig(ProcessResult pr) { itwDoesComplainAboutOldConfig(pr.stdout); } private static void itwDoesComplainAboutOldConfig(String stdout) { Assert.assertTrue(stdout.contains(DeploymentConfiguration.TRANSFER_TITLE)); } private static void assertOldMainFiles(String s, boolean s1, boolean s2, boolean a1) { if (a1) { Assert.assertTrue(appletJarInside.toPassingString(), appletJarInside.evaluate(s)); } if (s1) { Assert.assertTrue(jnlpInside1.toPassingString(), jnlpInside1.evaluate(s)); Assert.assertTrue(jarInside1.toPassingString(), jarInside1.evaluate(s)); } if (s2) { Assert.assertTrue(jnlpInside2.toPassingString(), jnlpInside2.evaluate(s)); Assert.assertTrue(jarInside2.toPassingString(), jarInside2.evaluate(s)); } Assert.assertTrue(localHostInside.toPassingString(), localHostInside.evaluate(s)); Assert.assertTrue(cacheHostInside.toPassingString(), cacheHostInside.evaluate(s)); Assert.assertTrue(oldIcedteaHostInside.toPassingString(), oldIcedteaHostInside.evaluate(s)); Assert.assertTrue(securityHostInside.toPassingString(), securityHostInside.evaluate(s)); Assert.assertTrue(trustedHostInside.toPassingString(), trustedHostInside.evaluate(s)); } private static void assertOldConfigFiles(String s, boolean certs, boolean trust, boolean props) { if (certs) { Assert.assertTrue(trustedCertsInside.toPassingString(), trustedCertsInside.evaluate(s)); } if (trust) { Assert.assertTrue(appletTrustInside.toPassingString(), appletTrustInside.evaluate(s)); } if (props) { Assert.assertTrue(propsInside.toPassingString(), propsInside.evaluate(s)); } Assert.assertTrue(oldIcedteaHostInside.toPassingString(), oldIcedteaHostInside.evaluate(s)); } private static void assertOldNotMainFiles(String s, boolean s1, boolean s2, boolean a1) { if (a1) { Assert.assertFalse(appletJarInside.toFailingString(), appletJarInside.evaluate(s)); } if (s1) { Assert.assertFalse(jnlpInside1.toFailingString(), jnlpInside1.evaluate(s)); Assert.assertFalse(jarInside1.toFailingString(), jarInside1.evaluate(s)); } if (s2) { Assert.assertFalse(jnlpInside2.toFailingString(), jnlpInside2.evaluate(s)); Assert.assertFalse(jarInside2.toFailingString(), jarInside2.evaluate(s)); } Assert.assertFalse(localHostInside.toFailingString(), localHostInside.evaluate(s)); Assert.assertFalse(cacheHostInside.toFailingString(), cacheHostInside.evaluate(s)); Assert.assertFalse(oldIcedteaHostInside.toFailingString(), oldIcedteaHostInside.evaluate(s)); Assert.assertFalse(securityHostInside.toFailingString(), securityHostInside.evaluate(s)); Assert.assertFalse(trustedHostInside.toFailingString(), trustedHostInside.evaluate(s)); } private static void assertOldNotConfigFiles(String s, boolean certs, boolean trust, boolean props) { if (certs) { Assert.assertFalse(trustedCertsInside.toFailingString(), trustedCertsInside.evaluate(s)); } if (trust) { Assert.assertFalse(appletTrustInside.toFailingString(), appletTrustInside.evaluate(s)); } if (props) { Assert.assertFalse(propsInside.toFailingString(), propsInside.evaluate(s)); } Assert.assertFalse(oldIcedteaHostInside.toFailingString(), oldIcedteaHostInside.evaluate(s)); } private static void assertOldMainFilesInHome(boolean s1, boolean s2, boolean a1) { String oldHome = System.getProperty("user.home") + File.separator + ".icedtea"; assertOldMainFiles(listToString(getContentOfDirectory(new File(oldHome))), s1, s2, a1); } private static void assertOldNotMainFilesInHome(boolean s1, boolean s2, boolean a1) { String oldHome = System.getProperty("user.home") + File.separator + ".icedtea"; assertOldNotMainFiles(listToString(getContentOfDirectory(new File(oldHome))), s1, s2, a1); } private static void assertOldConfigFilesInHome(boolean certs, boolean trust, boolean props) { String oldHome = System.getProperty("user.home") + File.separator + ".icedtea"; assertOldConfigFiles(listToString(getContentOfDirectory(new File(oldHome))), certs, trust, props); } private static void assertOldNotConfigFilesInHome(boolean certs, boolean trust, boolean props) { String oldHome = System.getProperty("user.home") + File.separator + ".icedtea"; assertOldNotConfigFiles(listToString(getContentOfDirectory(new File(oldHome))), certs, trust, props); } /* *JAVAWS - OLD CONFIG EXISTS */ @Test public void runJavawsWithNoXdg_oldIcedTeaConfigExisted() throws Exception { File ff = new File(PathsAndFiles.USER_CONFIG_HOME); try { assertNotMainFilesInHome(true, true, true); assertOldNotMainFilesInHome(true, true, true); createFakeOldHomeCache(); removeUnsupportedLegacyFiles(); ProcessWrapper pw1 = new ProcessWrapper(server.getJavawsLocation(), null, server.getUrl("simpletest1.jnlp"), (ContentReaderListener) null, null, removeXdgVAlues()); ProcessResult pr1 = pw1.execute(); Assert.assertTrue(simpletests1Run.toPassingString(), simpletests1Run.evaluate(pr1.stdout)); Assert.assertTrue(moving.toPassingString(), moving.evaluate(pr1.stdout)); assertMainFilesInHome(true, true, false); assertOldNotMainFilesInHome(true, true, true); fakeExtendedSecurity(ff); ProcessWrapper pw2 = new ProcessWrapper(server.getJavawsLocation(), null, server.getUrl("simpletest1.jnlp"), (ContentReaderListener) null, null, removeXdgVAlues()); ProcessResult pr2 = pw2.execute(); Assert.assertTrue(simpletests1Run.toPassingString(), simpletests1Run.evaluate(pr2.stdout)); Assert.assertTrue(notMoving.toPassingString(), notMoving.evaluate(pr2.stdout)); assertMainFilesInHome(true, true, false); assertOldNotMainFilesInHome(true, true, true); } finally { deleteRecursively(ff); } } @Test public void runJavawsWithXdg_oldIcedTeaConfigExisted() throws Exception { File f = tmpDir(); File ff = new File(PathsAndFiles.USER_CONFIG_HOME); try { assertNotMainFiles(listToString(getContentOfDirectory(f)), true, true, true); assertOldNotMainFilesInHome(true, true, true); createFakeOldHomeCache(); removeUnsupportedLegacyFiles(); ProcessWrapper pw = new ProcessWrapper(server.getJavawsLocation(), null, server.getUrl("simpletest1.jnlp"), (ContentReaderListener) null, null, setXdgVAlues(f)); ProcessResult pr = pw.execute(); Assert.assertTrue(simpletests1Run.toPassingString(), simpletests1Run.evaluate(pr.stdout)); Assert.assertTrue(moving.toPassingString(), moving.evaluate(pr.stdout)); assertMainFiles(listToString(getContentOfDirectory(f)), true, true, false); assertOldNotMainFilesInHome(true, true, true); fakeExtendedSecurity(ff); ProcessWrapper pw2 = new ProcessWrapper(server.getJavawsLocation(), null, server.getUrl("simpletest1.jnlp"), (ContentReaderListener) null, null, removeXdgVAlues()); ProcessResult pr2 = pw2.execute(); Assert.assertTrue(simpletests1Run.toPassingString(), simpletests1Run.evaluate(pr2.stdout)); Assert.assertTrue(notMoving.toPassingString(), notMoving.evaluate(pr2.stdout)); assertMainFiles(listToString(getContentOfDirectory(f)), true, true, false); assertOldNotMainFilesInHome(true, true, true); } finally { deleteRecursively(f); deleteRecursively(ff); } } @Test public void runJavawsWithXdgAndNoParent_oldIcedTeaConfigExisted() throws Exception { File f = tmpDir(); File ff = new File(PathsAndFiles.USER_CONFIG_HOME); try { assertNotMainFiles(listToString(getContentOfDirectory(f)), true, true, true); assertOldNotMainFilesInHome(true, true, true); createFakeOldHomeCache(); f.delete(); removeUnsupportedLegacyFiles(); ProcessWrapper pw = new ProcessWrapper(server.getJavawsLocation(), null, server.getUrl("simpletest1.jnlp"), (ContentReaderListener) null, null, setXdgVAlues(f)); ProcessResult pr = pw.execute(); Assert.assertTrue(simpletests1Run.toPassingString(), simpletests1Run.evaluate(pr.stdout)); Assert.assertTrue(moving.toPassingString(), moving.evaluate(pr.stdout)); assertMainFiles(listToString(getContentOfDirectory(f)), true, true, false); assertOldNotMainFilesInHome(true, true, true); fakeExtendedSecurity(ff); ProcessWrapper pw2 = new ProcessWrapper(server.getJavawsLocation(), null, server.getUrl("simpletest1.jnlp"), (ContentReaderListener) null, null, removeXdgVAlues()); ProcessResult pr2 = pw2.execute(); Assert.assertTrue(simpletests1Run.toPassingString(), simpletests1Run.evaluate(pr2.stdout)); Assert.assertTrue(notMoving.toPassingString(), notMoving.evaluate(pr2.stdout)); assertMainFiles(listToString(getContentOfDirectory(f)), true, true, false); assertOldNotMainFilesInHome(true, true, true); } finally { deleteRecursively(f); deleteRecursively(ff); } } /* *ITW-SETTINGS gui - NO OLD CONFIG */ @Test public void runItwGuiInCleanSystemWithNoXdg() throws Exception { long t = ServerAccess.PROCESS_TIMEOUT; ServerAccess.PROCESS_TIMEOUT = 5000; try { assertNotConfigFilesInHome(true, true, true); assertOldNotConfigFilesInHome(true, true, true); ProcessWrapper pw = new ProcessWrapper(); pw.setArgs(Arrays.asList( new String[]{ new File(server.getJavawsFile().getParentFile(), "itweb-settings").getAbsolutePath() })); pw.setVars(removeXdgVAlues()); ProcessResult pr = pw.execute(); Assert.assertTrue(notMoving.toPassingString(), notMoving.evaluate(pr.stdout)); assertConfigFilesInHome(true, true, true); assertOldNotConfigFilesInHome(true, true, true); } finally { ServerAccess.PROCESS_TIMEOUT = t; } } @Test public void runItwGuiInCleanSystemWithXdg() throws Exception { File f = tmpDir(); long t = ServerAccess.PROCESS_TIMEOUT; ServerAccess.PROCESS_TIMEOUT = 5000; try { assertNotConfigFiles(listToString(getContentOfDirectory(f)), true, true, true); assertOldNotConfigFilesInHome(true, true, true); ProcessWrapper pw = new ProcessWrapper(); pw.setArgs(Arrays.asList( new String[]{ new File(server.getJavawsFile().getParentFile(), "itweb-settings").getAbsolutePath() })); pw.setVars(setXdgVAlues(f)); ProcessResult pr = pw.execute(); Assert.assertTrue(notMoving.toPassingString(), notMoving.evaluate(pr.stdout)); assertConfigFiles(listToString(getContentOfDirectory(f)), true, true, true); assertOldNotConfigFilesInHome(true, true, true); } finally { ServerAccess.PROCESS_TIMEOUT = t; deleteRecursively(f); } } /* *ITW-SETTINGS gui- OLD CONFIG EXISTS */ @Test public void runItwGuiWithNoXdg_oldIcedTeaConfigExisted() throws Exception { long t = ServerAccess.PROCESS_TIMEOUT; ServerAccess.PROCESS_TIMEOUT = 5000; try { assertNotConfigFilesInHome(true, true, true); assertOldNotConfigFilesInHome(true, true, true); createFakeOldHomeConfig(); ProcessWrapper pw1 = new ProcessWrapper(); pw1.setArgs(Arrays.asList( new String[]{ new File(server.getJavawsFile().getParentFile(), "itweb-settings").getAbsolutePath() })); pw1.setVars(removeXdgVAlues()); ProcessResult pr1 = pw1.execute(); Assert.assertTrue(moving.toPassingString(), moving.evaluate(pr1.stdout)); assertConfigFilesInHome(true, true, true); assertOldNotConfigFilesInHome(true, true, true); ProcessWrapper pw2 = new ProcessWrapper(); pw2.setArgs(Arrays.asList( new String[]{ new File(server.getJavawsFile().getParentFile(), "itweb-settings").getAbsolutePath() })); pw2.setVars(removeXdgVAlues()); ProcessResult pr2 = pw2.execute(); Assert.assertTrue(notMoving.toPassingString(), notMoving.evaluate(pr2.stdout)); assertConfigFilesInHome(true, true, true); assertOldNotConfigFilesInHome(true, true, true); } finally { ServerAccess.PROCESS_TIMEOUT = t; } } @Test public void runItwGuiWithXdg_oldIcedTeaConfigExisted() throws Exception { File f = tmpDir(); long t = ServerAccess.PROCESS_TIMEOUT; ServerAccess.PROCESS_TIMEOUT = 5000; try { assertNotConfigFiles(listToString(getContentOfDirectory(f)), true, true, true); assertOldNotConfigFilesInHome(true, true, true); createFakeOldHomeConfig(); ProcessWrapper pw1 = new ProcessWrapper(); pw1.setArgs(Arrays.asList( new String[]{ new File(server.getJavawsFile().getParentFile(), "itweb-settings").getAbsolutePath() })); pw1.setVars(setXdgVAlues(f)); ProcessResult pr = pw1.execute(); Assert.assertTrue(moving.toPassingString(), moving.evaluate(pr.stdout)); assertConfigFiles(listToString(getContentOfDirectory(f)), true, true, true); assertOldNotConfigFilesInHome(true, true, true); ProcessWrapper pw2 = new ProcessWrapper(); pw2.setArgs(Arrays.asList( new String[]{ new File(server.getJavawsFile().getParentFile(), "itweb-settings").getAbsolutePath() })); pw2.setVars(removeXdgVAlues()); ProcessResult pr2 = pw2.execute(); Assert.assertTrue(notMoving.toPassingString(), notMoving.evaluate(pr2.stdout)); assertConfigFiles(listToString(getContentOfDirectory(f)), true, true, true); assertOldNotConfigFilesInHome(true, true, true); } finally { ServerAccess.PROCESS_TIMEOUT = t; deleteRecursively(f); } } /* *ITW-SETTINGS commandline - NO OLD CONFIG */ @Test public void runItwCmdInCleanSystemWithNoXdg() throws Exception { long t = ServerAccess.PROCESS_TIMEOUT; ServerAccess.PROCESS_TIMEOUT = 5000; try { assertNotConfigFilesInHome(true, true, true); assertOldNotConfigFilesInHome(true, true, true); ProcessWrapper pw = new ProcessWrapper(); pw.setArgs(Arrays.asList( new String[]{ new File(server.getJavawsFile().getParentFile(), "itweb-settings").getAbsolutePath(), //one impl of new parser was unable to handle duplicates "set", "blah", "differentBlah" })); pw.setVars(removeXdgVAlues()); ProcessResult pr = pw.execute(); Assert.assertTrue(notMoving.toPassingString(), notMoving.evaluate(pr.stdout)); Assert.assertTrue(unknownProperty.toPassingString(), unknownProperty.evaluate(pr.stdout)); assertConfigFilesInHome(false, false, true); assertOldNotConfigFilesInHome(true, true, true); } finally { ServerAccess.PROCESS_TIMEOUT = t; } } @Test public void runItwCmdInCleanSystemWithXdg() throws Exception { File f = tmpDir(); long t = ServerAccess.PROCESS_TIMEOUT; ServerAccess.PROCESS_TIMEOUT = 5000; try { assertNotConfigFiles(listToString(getContentOfDirectory(f)), true, true, true); assertOldNotConfigFilesInHome(true, true, true); ProcessWrapper pw = new ProcessWrapper(); pw.setArgs(Arrays.asList( new String[]{ new File(server.getJavawsFile().getParentFile(), "itweb-settings").getAbsolutePath(), //one impl of new parser was unable to handle duplicates "set", "blah", "differentBlah" })); pw.setVars(setXdgVAlues(f)); ProcessResult pr = pw.execute(); Assert.assertTrue(notMoving.toPassingString(), notMoving.evaluate(pr.stdout)); Assert.assertTrue(unknownProperty.toPassingString(), unknownProperty.evaluate(pr.stdout)); assertConfigFiles(listToString(getContentOfDirectory(f)), false, false, true); assertOldNotConfigFilesInHome(true, true, true); } finally { ServerAccess.PROCESS_TIMEOUT = t; deleteRecursively(f); } } /* *ITW-SETTINGS commandline- OLD CONFIG EXISTS */ @Test public void runItwCmdWithNoXdg_oldIcedTeaConfigExisted() throws Exception { long t = ServerAccess.PROCESS_TIMEOUT; ServerAccess.PROCESS_TIMEOUT = 5000; try { assertNotConfigFilesInHome(true, true, true); assertOldNotConfigFilesInHome(true, true, true); createFakeOldHomeConfig(); ProcessWrapper pw1 = new ProcessWrapper(); pw1.setArgs(Arrays.asList( new String[]{ new File(server.getJavawsFile().getParentFile(), "itweb-settings").getAbsolutePath(), //one impl of new parser was unable to handle duplicates "set", "blah", "differentBlah" })); pw1.setVars(removeXdgVAlues()); ProcessResult pr1 = pw1.execute(); Assert.assertTrue(moving.toPassingString(), moving.evaluate(pr1.stdout)); Assert.assertTrue(unknownProperty.toPassingString(), unknownProperty.evaluate(pr1.stdout)); assertConfigFilesInHome(true, true, true); assertOldNotConfigFilesInHome(true, true, true); ProcessWrapper pw2 = new ProcessWrapper(); pw2.setArgs(Arrays.asList( new String[]{ new File(server.getJavawsFile().getParentFile(), "itweb-settings").getAbsolutePath(), //one impl of new parser was unable to handle duplicates "set", "baf", "differentBaf" })); pw2.setVars(removeXdgVAlues()); ProcessResult pr2 = pw2.execute(); Assert.assertTrue(notMoving.toPassingString(), notMoving.evaluate(pr2.stdout)); Assert.assertTrue(unknownProperty.toPassingString(), unknownProperty.evaluate(pr2.stdout)); assertConfigFilesInHome(true, true, true); assertOldNotConfigFilesInHome(true, true, true); } finally { ServerAccess.PROCESS_TIMEOUT = t; } } @Test public void runItwCmdWithXdg_oldIcedTeaConfigExisted() throws Exception { File f = tmpDir(); long t = ServerAccess.PROCESS_TIMEOUT; ServerAccess.PROCESS_TIMEOUT = 5000; try { assertNotConfigFiles(listToString(getContentOfDirectory(f)), true, true, true); assertOldNotConfigFilesInHome(true, true, true); createFakeOldHomeConfig(); ProcessWrapper pw1 = new ProcessWrapper(); pw1.setArgs(Arrays.asList( new String[]{ new File(server.getJavawsFile().getParentFile(), "itweb-settings").getAbsolutePath(), //one impl of new parser was unable to handle duplicates "set", "blah", "differentBlah" })); pw1.setVars(setXdgVAlues(f)); ProcessResult pr = pw1.execute(); Assert.assertTrue(moving.toPassingString(), moving.evaluate(pr.stdout)); Assert.assertTrue(unknownProperty.toPassingString(), unknownProperty.evaluate(pr.stdout)); assertConfigFiles(listToString(getContentOfDirectory(f)), true, true, true); assertOldNotConfigFilesInHome(true, true, true); ProcessWrapper pw2 = new ProcessWrapper(); pw2.setArgs(Arrays.asList( new String[]{ new File(server.getJavawsFile().getParentFile(), "itweb-settings").getAbsolutePath(), //one impl of new parser was unable to handle duplicates "set", "baf", "differentBaf" })); pw2.setVars(removeXdgVAlues()); ProcessResult pr2 = pw2.execute(); Assert.assertTrue(notMoving.toPassingString(), notMoving.evaluate(pr2.stdout)); Assert.assertTrue(unknownProperty.toPassingString(), unknownProperty.evaluate(pr2.stdout)); assertConfigFiles(listToString(getContentOfDirectory(f)), true, true, true); assertOldNotConfigFilesInHome(true, true, true); } finally { ServerAccess.PROCESS_TIMEOUT = t; deleteRecursively(f); } } private static void fakeExtendedSecurity(File file) throws IOException { if (!file.exists()) { boolean a = file.mkdirs(); Assert.assertTrue("creation of directories for " + file + " failed", a); } File f = new File(file, PathsAndFiles.USER_DEPLOYMENT_FILE.getDefaultFile().getName()); ServerAccess.saveFile("deployment.security.level=ALLOW_UNSIGNED\ndeployment.manifest.attributes.check=NONE", f); } /* *PLUGIN - NO OLD CONFIG */ @Test @TestInBrowsers(testIn = Browsers.one) public void runAppletInCleanSystemWithNoXdg() throws Exception { assertNotMainFilesInHome(true, true, true); assertOldNotMainFilesInHome(true, true, true); //intentionally hardoced default fakeExtendedSecurity(new File(System.getProperty("user.home") + File.separator + ".config" + File.separator + PathsAndFiles.DEPLOYMENT_SUBDIR_DIR)); ProcessWrapper pw = new ProcessWrapper(); pw.setArgs(Arrays.asList( new String[]{ server.getCurrentBrowser().getBin(), server.getUrl("appletAutoTests2.html").toString() })); pw.addStdOutListener(new RulesFolowingClosingListener(applet1Run)); pw.setVars(removeXdgVAlues()); ProcessResult pr = pw.execute(); Assert.assertTrue(applet1Run.toPassingString(), applet1Run.evaluate(pr.stdout)); Assert.assertTrue(notMoving.toPassingString(), notMoving.evaluate(pr.stdout)); assertMainFilesInHome(false, false, true); assertOldNotMainFilesInHome(true, true, true); } @Test @TestInBrowsers(testIn = Browsers.one) public void runAppletsInCleanSystemWithXdg() throws Exception { File f = tmpDir(); try { assertNotMainFiles(listToString(getContentOfDirectory(f)), true, true, true); assertOldNotMainFilesInHome(true, true, true); fakeExtendedSecurity(new File(f.getAbsolutePath() + File.separator + "customConfig" + File.separator + PathsAndFiles.DEPLOYMENT_SUBDIR_DIR)); ProcessWrapper pw = new ProcessWrapper(); pw.setArgs(Arrays.asList( new String[]{ server.getCurrentBrowser().getBin(), server.getUrl("appletAutoTests2.html").toString() })); pw.addStdOutListener(new RulesFolowingClosingListener(applet1Run)); pw.setVars(setXdgVAlues(f)); ProcessResult pr = pw.execute(); Assert.assertTrue(notMoving.toPassingString(), notMoving.evaluate(pr.stdout)); assertMainFiles(listToString(getContentOfDirectory(f)), false, false, true); assertOldNotMainFilesInHome(true, true, true); /*do alst, we need to check the migration, not applet lunching itself*/ Assert.assertTrue(applet1Run.toPassingString(), applet1Run.evaluate(pr.stdout)); } finally { deleteRecursively(f); } } /* *PLUGIN - OLD CONFIG EXISTS */ @Test @TestInBrowsers(testIn = Browsers.one) public void runAppletInCleanSystemWithNoXdg_oldIcedTeaConfigExisted() throws Exception { assertNotMainFilesInHome(true, true, true); assertOldNotMainFilesInHome(true, true, true); fakeExtendedSecurity(new File(System.getProperty("user.home") + File.separator + ".icedtea")); ProcessWrapper pw1 = new ProcessWrapper(); pw1.setArgs(Arrays.asList( new String[]{ server.getCurrentBrowser().getBin(), server.getUrl("appletAutoTests2.html").toString() })); pw1.addStdOutListener(new RulesFolowingClosingListener(applet1Run)); pw1.setVars(removeXdgVAlues()); ProcessResult pr1 = pw1.execute(); Assert.assertTrue(applet1Run.toPassingString(), applet1Run.evaluate(pr1.stdout)); Assert.assertTrue(moving.toPassingString(), moving.evaluate(pr1.stdout)); assertMainFilesInHome(false, false, true); assertOldNotMainFilesInHome(true, true, true); ProcessWrapper pw = new ProcessWrapper(); pw.setArgs(Arrays.asList( new String[]{ server.getCurrentBrowser().getBin(), server.getUrl("appletAutoTests2.html").toString() })); pw.addStdOutListener(new RulesFolowingClosingListener(applet1Run)); pw.setVars(removeXdgVAlues()); ProcessResult pr = pw.execute(); Assert.assertTrue(applet1Run.toPassingString(), applet1Run.evaluate(pr.stdout)); Assert.assertTrue(notMoving.toPassingString(), notMoving.evaluate(pr.stdout)); assertMainFilesInHome(false, false, true); assertOldNotMainFilesInHome(true, true, true); } @Test @TestInBrowsers(testIn = Browsers.one) public void runAppletsInCleanSystemWithXdg_oldIcedTeaConfigExisted() throws Exception { File f = tmpDir(); try { assertNotMainFiles(listToString(getContentOfDirectory(f)), true, true, true); assertOldNotMainFilesInHome(true, true, true); fakeExtendedSecurity(new File(System.getProperty("user.home") + File.separator + ".icedtea")); ProcessWrapper pw1 = new ProcessWrapper(); pw1.setArgs(Arrays.asList( new String[]{ server.getCurrentBrowser().getBin(), server.getUrl("appletAutoTests2.html").toString() })); pw1.addStdOutListener(new RulesFolowingClosingListener(applet1Run)); pw1.setVars(setXdgVAlues(f)); ProcessResult pr1 = pw1.execute(); Assert.assertTrue(applet1Run.toPassingString(), applet1Run.evaluate(pr1.stdout)); Assert.assertTrue(moving.toPassingString(), moving.evaluate(pr1.stdout)); assertMainFiles(listToString(getContentOfDirectory(f)), false, false, true); assertOldNotMainFilesInHome(true, true, true); ProcessWrapper pw = new ProcessWrapper(); pw.setArgs(Arrays.asList( new String[]{ server.getCurrentBrowser().getBin(), server.getUrl("appletAutoTests2.html").toString() })); pw.addStdOutListener(new RulesFolowingClosingListener(applet1Run)); pw.setVars(setXdgVAlues(f)); ProcessResult pr = pw.execute(); Assert.assertTrue(notMoving.toPassingString(), notMoving.evaluate(pr.stdout)); assertMainFiles(listToString(getContentOfDirectory(f)), false, false, true); assertOldNotMainFilesInHome(true, true, true); /*do last, we need to check the migration, not applet lunching itself*/ Assert.assertTrue(applet1Run.toPassingString(), applet1Run.evaluate(pr.stdout)); } finally { deleteRecursively(f); } } @Test //this test is unrelated to XDG, bus it testing issue in new option parser. //when this test was under fixing, it was found, that parser is unable to handle two same params in set //this is reproducing it. @Bug(id = "http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2015-March/031049.html") public void runItwCmdInCleanSystemWithNoXdgAndWithTwoSameValuesInCMD() throws Exception { long t = ServerAccess.PROCESS_TIMEOUT; ServerAccess.PROCESS_TIMEOUT = 5000; try { assertNotConfigFilesInHome(true, true, true); assertOldNotConfigFilesInHome(true, true, true); ProcessWrapper pw = new ProcessWrapper(); pw.setArgs(Arrays.asList( new String[]{ new File(server.getJavawsFile().getParentFile(), "itweb-settings").getAbsolutePath(), //one impl of new parser was unable to handle duplicates "set", "blah", "blah" })); pw.setVars(removeXdgVAlues()); ProcessResult pr = pw.execute(); Assert.assertTrue(notMoving.toPassingString(), notMoving.evaluate(pr.stdout)); Assert.assertTrue(unknownProperty.toPassingString(), unknownProperty.evaluate(pr.stdout)); assertConfigFilesInHome(false, false, true); assertOldNotConfigFilesInHome(true, true, true); } finally { ServerAccess.PROCESS_TIMEOUT = t; } } } icedtea-web-1.6.2/tests/reproducers/simple/simpletest1/testcases/PaxHeaders.17941/SimpleTestDefaultR0000644000000000000000000000013112654402377030347 xustar0030 mtime=1454507263.240432541 30 atime=1454507327.349577536 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/simpletest1/testcases/SimpleTestDefaultRedirects.java0000644000175000002070000002543412654402377033546 0ustar00jvanekmock00000000000000/* 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 { testbodyOthers(false, 302); } @Test public void testSimpletest1Redirect303AllowedOk() throws Exception { testbodyOthers(true, 303); } @Test public void testSimpletest1Redirect331NotAllowedOk() throws Exception { testbodyOthers(false, 303); } @Test public void testSimpletest1Redirect307AllowedOk() throws Exception { testbodyOthers(true, 307); } @Test public void testSimpletest1Redirect307NotAllowedOk() throws Exception { testbodyOthers(false, 307); } @Test public void testSimpletest1Redirect308AllowedOk() throws Exception { testbody308(true, 308); } @Test public void testSimpletest1Redirect308NotAllowedOk() throws Exception { server.executeJavawsClearCache(); testbody308(false, 308); } // end basic tests } icedtea-web-1.6.2/tests/reproducers/simple/simpletest1/testcases/PaxHeaders.17941/SimpleTest1Test.ja0000644000000000000000000000013112654402377030232 xustar0030 mtime=1454507263.239432554 30 atime=1454507327.349577536 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/simpletest1/testcases/SimpleTest1Test.java0000644000175000002070000001235212654402377031310 0ustar00jvanekmock00000000000000/* SimpleTest1Test.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; import java.util.Arrays; import java.util.List; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import org.junit.Assert; import org.junit.Test; public class SimpleTest1Test { private static final ServerAccess server = new ServerAccess(); private static final List strict = Arrays.asList(new String[]{"-strict", ServerAccess.VERBOSE_OPTION}); static void checkLaunched(ProcessResult pr) { checkLaunched(pr, false); } 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)); } else { Assert.assertTrue("testSimpletest1lunchOk stdout should contains " + s + " bud didn't", pr.stdout.contains(s)); } String ss = "xception"; if (negate) { Assert.assertTrue("testSimpletest1lunchOk stderr should contains " + ss + " but didn't", pr.stderr.contains(ss)); } else { //disabled, unnecessary exceptions may occure //Assert.assertFalse("testSimpletest1lunchOk stderr should not contains " + ss + " but did", pr.stderr.contains(ss)); } if (checkTermination) { Assert.assertFalse(pr.wasTerminated); if (negate) { Assert.assertEquals((Integer) 1, pr.returnValue); } else { Assert.assertEquals((Integer) 0, pr.returnValue); } } } @Test public void testSimpletest1lunchOk() throws Exception { ProcessResult pr = server.executeJavawsHeadless(null, "/simpletest1.jnlp"); checkLaunched(pr); } @Test public void testSimpletest1lunchNotOkJnlpStrict() throws Exception { ProcessResult pr = server.executeJavawsHeadless(strict, "/simpletest1.jnlp"); checkLaunched(pr, true); } @Test public void testSimpletest1lunchOkStrictJnlp() throws Exception { String originalResourceName = "simpletest1.jnlp"; String newResourceName = "simpletest1_strict.jnlp"; createStrictFile(originalResourceName, newResourceName, server.getUrl("")); ProcessResult pr = server.executeJavawsHeadless(null, "/" + newResourceName); checkLaunched(pr); } @Test public void testSimpletest1lunchOkStrictJnlpStrict() throws Exception { String originalResourceName = "simpletest1.jnlp"; String newResourceName = "simpletest1_strict.jnlp"; createStrictFile(originalResourceName, newResourceName, server.getUrl("")); ProcessResult pr = server.executeJavawsHeadless(strict, "/" + newResourceName); checkLaunched(pr); } private void createStrictFile(String originalResourceName, String newResourceName, URL codebase) throws MalformedURLException, IOException { String originalContent = ServerAccess.getContentOfStream(new FileInputStream(new File(server.getDir(), originalResourceName))); String nwContent1 = originalContent.replaceAll("href=\""+originalResourceName+"\"", "href=\""+newResourceName+"\""); String nwContent = nwContent1.replaceAll("codebase=\".\"", "codebase=\"" + codebase + "\""); ServerAccess.saveFile(nwContent, new File(server.getDir(), newResourceName)); } } icedtea-web-1.6.2/tests/reproducers/simple/simpletest1/testcases/PaxHeaders.17941/SimpleTest1CountRe0000644000000000000000000000013112654402377030301 xustar0030 mtime=1454507263.239432554 30 atime=1454507327.349577536 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/simpletest1/testcases/SimpleTest1CountRequests.java0000644000175000002070000001040012654402377033205 0ustar00jvanekmock00000000000000/* 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; @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)); } } icedtea-web-1.6.2/tests/reproducers/simple/simpletest1/PaxHeaders.17941/srcs0000644000000000000000000000013112654402377023603 xustar0030 mtime=1454507263.239432554 30 atime=1454507658.779157357 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/simpletest1/srcs/0000755000175000002070000000000012654402377024404 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/simpletest1/srcs/PaxHeaders.17941/SimpleTest1.java0000644000000000000000000000013112654402377026675 xustar0030 mtime=1454507263.239432554 30 atime=1454507327.349577536 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/simpletest1/srcs/SimpleTest1.java0000644000175000002070000000357212654402377027430 0ustar00jvanekmock00000000000000/* SimpleTest1.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class SimpleTest1{ public static void main(String[] args){ System.out.println("Good simple javaws exapmle"); for (int i = 0; i < args.length; i++) { String string = args[i]; System.out.println(string); } } } icedtea-web-1.6.2/tests/reproducers/simple/simpletest1/PaxHeaders.17941/resources0000644000000000000000000000013112654402377024643 xustar0030 mtime=1454507263.238432568 30 atime=1454507658.779157357 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/simpletest1/resources/0000755000175000002070000000000012654402377025444 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/simpletest1/resources/PaxHeaders.17941/simpletestSlowSlow0000644000000000000000000000013112654402377030546 xustar0030 mtime=1454507263.238432568 30 atime=1454507327.349577536 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/simpletest1/resources/simpletestSlowSlowCustomSplash.jnlp0000644000175000002070000000425312654402377034606 0ustar00jvanekmock00000000000000 simpletest1 IcedTea simpletest1 icedtea-web-1.6.2/tests/reproducers/simple/simpletest1/resources/PaxHeaders.17941/simpletestSlowBrok0000644000000000000000000000031112654402377030517 xustar00112 path=icedtea-web-1.6.2/tests/reproducers/simple/simpletest1/resources/simpletestSlowBrokenCustomSplash.jnlp 30 mtime=1454507263.238432568 30 atime=1454507327.348577549 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/simpletest1/resources/simpletestSlowBrokenCustomSplash.jn0000644000175000002070000000425212654402377034545 0ustar00jvanekmock00000000000000 simpletest1 IcedTea simpletest1 icedtea-web-1.6.2/tests/reproducers/simple/simpletest1/resources/PaxHeaders.17941/simpletestSlow.jnl0000644000000000000000000000013112654402377030463 xustar0030 mtime=1454507263.238432568 30 atime=1454507327.348577549 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/simpletest1/resources/simpletestSlow.jnlp0000644000175000002070000000414512654402377031373 0ustar00jvanekmock00000000000000 simpletest1 IcedTea simpletest1 icedtea-web-1.6.2/tests/reproducers/simple/simpletest1/resources/PaxHeaders.17941/simpletestMegaSlow0000644000000000000000000000013112654402377030473 xustar0030 mtime=1454507263.238432568 30 atime=1454507327.348577549 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/simpletest1/resources/simpletestMegaSlow.jnlp0000644000175000002070000000415712654402377032170 0ustar00jvanekmock00000000000000 simpletest1 IcedTea simpletest1 icedtea-web-1.6.2/tests/reproducers/simple/simpletest1/resources/PaxHeaders.17941/simpletestCustomSp0000644000000000000000000000013112654402377030532 xustar0030 mtime=1454507263.237432581 30 atime=1454507327.348577549 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/simpletest1/resources/simpletestCustomSplash.jnlp0000644000175000002070000000431412654402377033072 0ustar00jvanekmock00000000000000 simpletest1 IcedTea simpletest1 icedtea-web-1.6.2/tests/reproducers/simple/simpletest1/resources/PaxHeaders.17941/simpletest1.jnlp0000644000000000000000000000013112654402377030057 xustar0030 mtime=1454507263.237432581 30 atime=1454507327.348577549 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/simpletest1/resources/simpletest1.jnlp0000644000175000002070000000413412654402377030605 0ustar00jvanekmock00000000000000 simpletest1 IcedTea simpletest1 icedtea-web-1.6.2/tests/reproducers/simple/simpletest1/resources/PaxHeaders.17941/netxPlugin.png0000644000000000000000000000013112654402377027563 xustar0030 mtime=1454507263.237432581 30 atime=1454507327.347577563 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/simpletest1/resources/netxPlugin.png0000644000175000002070000013531212654402377030314 0ustar00jvanekmock00000000000000PNG  IHDR@8sRGBbKGD pHYs  tIME  $c^tEXtCommentCreated with GIMPW IDATxڄ}vkYv͏i8P"MRI4jMfRN#b"& b b#h*(i*M:ƦI̘$Z3(u='Z@UV* opϮ^`7XEjL^ku|?]ާ״.翱;~z[Um(h_c>nw^@aMuwoq΋sgkWUm\] =3jl[ y6U,nǟ P#[{}umPvny9n}fY]\kޱz6 {O{z=^o~˴_1{Ru U\Vq瑯G<Kt]_z]qurd/"3Aҿ +9O?tH65+LO~X=-er*\?q/{.j[j߇,&j=qc}<&ugy?㙻~klzg}E*ō|ZTew&'nNm e#'~a{ap:flS;[P>KR2xZX2|8>KbTGKGWU7Jb}Bx8W6yYycWr| SdY-TT禹fT,!lcO(Mx ({y=Gt&!IJ)<&8W52lfb8Q4hs*-u@$ݰO^fa$Gi޶VyՇ fMP/&YX?׏fgbcb/VEDiu]N}8\{(>'U=֪d]/%-fY?tV3ڬ rppA^w顤UnպVQ64_va*QzJ~KI*-cD/Wł'okx!TB'`?/.O,@_k!7Z_oNYҷc=p~߬@n(ڦhzţpa5v`DNlAB 6wm6+9 Wt쓅VT -yp(NVt^RSL:7bh~<j]hݴUh %b\\;.3 >ZA:xxq.-W=*+Zu#: ê1Bh;n[MGa>p^}:Dj_uC?j'ʋl׍zN'jbH=ZjM x^ `K>epehW; ~Q)(fȸOKפu W5f5=O 6,T\t2,C%&:WR+94x5m)jf0`iGl&qg@?cӿ$M0 SF!ֆZ۾)ebb mydb}~Vx_/kd:rrFF][,:Q-&}hxJ5@#jƸ>[iB ǝT*9^sm4ZLէҽRkpV*X.;\J",Dip# Yd2[mm5\`S PwL2HlyXR cj7i%W/\Ӕ*Nt`sfLOs Po }"Qgaj˩kfjx=y&+T.p`^rσKj:yx:O CFaK+sq@೔j\kpJlѦIkr#jN~q-iȪg-~#AIwwȢ~Rs-`وd-QWlgY>hmiPza4|*Q?rΆ3?b|Iѯb11Ce 0@;:8Uɶn7hu ƥN\NioLwVٯfPn4{ )x>H98,9զA DŽ'2=̦Fc`Ma_@cMXL*Q!}h ~ \[^";d`S@?W@mZ9?Tb KONSy9Q g8(0f'k?;i[V4 Żi>TP(_;G| 1oeA2T^Jf7 6i섅c[e2[q{fzk뚍cʔ0 oXPu[FWb7!De8فު8?WxΆwR(FVM?*N-C ZKg23q4u֏sqWclhDŐ3W@P  Οԉq5dRЁ݇%#] [5 ёu.^6;Z5ݩjW'eu@ Mo6haqA]ɤWFxUO gcՙJ{liU3kS!*PA~Y66ѧIn dsi0U>hվ JZ "|U镋:Q]&s9'z"VvI^1]sD՝ةʤ<_dW&Ldӯ dB(b`15ӾҫV4qnBCnS 9W~/DJ(T []Zi׀dZ^iē2(؈nȁsE|SS6lšJȒ}>w#nW^qa)lvlQMV\-<ƚ*qiRrhؤ5Z|j .gE} =TS7*!Lt܊6gWVRQ09q"qȢm6 Iwխa,60o2WIaS!mUjXjJmNhTPlNuҴ{(*iq1-׭zK`t(,đ-NlQ;TM+nPIUXXÉpƏԧ,0pA\\ A:ـz!Ov6%dcwyT7N nTMnOZi:(1~=p`.YN`ܝ:̧H5\j<>j9T ? .[?/SLl&̖gOȉNa'mիa*OXXIur8-o0 |-'zбcq&'s(rSd]&s/VeֵCvW(]ˇ G-UJ˯R2IPoV`Kf6 XҿWʊ9a#T_6:܂r[" Lm?d!%܆Ay UoQIɴf2%[}^e#o _JaYdO1_\ol`͗-xscomy%f'V(q;Ë! uN=;Ts7z_[7$3cBpi93LG7Ԭz$>Z ftѡ?UDP6Nj(]6@0,2* AVC-h-yzFs, C ~YI!EޚYmxv|i+E e8=JI%bJ 4_cDrp>PWŦNՉ%5BV0M65JiW\S8ʥf8$}p.ՙx&sT1n9&J; }d{n,@rsu(î)צ -vJrxrӂ=jCN6;u5AHPa ;h(ze0t{ 7NRۜBRޞG a?]@9z6.@q߫4+VgV_S~nJɉ c"m&G25՝Af ˰`oF1o&{R B`HKV_TT}0N# "1_cSA& 0lH<7F96M 1%lW ƠF~n<{j^UFw14FxkdSmB+%kw]Qn۱f~1wl0 - =VVfLo6*> ؀;Oo@MtϿ,6 NԶ!)jv0"tEet脅Nu(wԶ$} @fb &ʫS5˷SN&ՙL:(B[S@6\TԳnXjd5!@+c˰ZkjPj-68+& Mw^UٽZT! 4.QqK#QW <^'~1}C4QYajn!Zn_02Ge0W]d||1 IlI1yHYP faZT3ۃ $bnC~kϕj]I&@-@gpNƽ'- $7Ʀ樰0]I<sa >I#רchtNVFQ FJKeL7`'\MĈ[<9 5 Kv?;cG5̭WDʕNeXw 㘨Q66@n -jb5(:'YPImcJB ysA[DYX%;)J3NIXa['btSY_L0xryTx2=]xrUj]1qlWTNr25H,s@x ݥf˲<t3@@!Z+0qfp_գn'6$J lgY2t£ {y\0L4wܪN[*OyÍ$yD*G$9Z )L kʱ=h}i?@*× m+\7M7@S4PFߜ_8W2El.6Mٴw!354K9pDa/8%c&fZJopR~F4,1D]tTW+ǵBRe0K-يi1vıSc בs j9VkTj`j0;*=qe^u+v=6 en5ώF>LSkATO?Z[vQؐ\ϛ7ة;C;,<7_P2ߤLAK^W5 ^nPR$C` WDW4C+BCY<w8S DP3tm)v޹6&ۆ k Vpk $tg(jȆ!12h%pIQ= y,8E-ǬuC1P.-Kzǜۭ)Wp(ꖡVD7ݝi3iౢ,D%'&UH<6St09Y vͧ$tGT'3̜iR5 k& B qi 8K[v30M(G#jQ+Diw8Dx-w׀fތ,#ԍ@D+ T'$8T~ rjҧVS͸F73}0)tܿtzQ-)Gq%Aꭒk f3)aC47*O@r6ʾDw[f0P0yLԄW C3m'iݞF@a$}l!M@jNXI42xL{i$&sZ*{$nԲ`,jbEmWhA8ϙަ w?jdION= 2P(-b2OcP_ϰNT#|Jy?{~ʻ˩ Y?ɵH@2NiZnVX3]c3Na}YI?*ڿOZmbã70 8MaN` CrA:ȔСVFH;ˆI\j:cA4U8- \ џNf ףѨ̯uC=0AWq)۽QkC^?sEh|kB߇ۉxpBҝN9Y&<0dz41Iil-Qi~>gEo5.ۣXu=mO6 ]Ә&5'[_?f;6|Z;˄Mp [zMQl!hBO-f McAr\`z武-kooXta;*dd̽_~Y,~rRZ uZC~ZqW>o[U6Kծ]7ut嶸cc2i>/( y&݇jeh =])eְ͞{ф F< !.H|n̴'UpOopn6 ]w\.Vƞ Z$Ymg N)6rL NQ|m ׏|-OnD)ntaJ_ԋ/ ؿO#OSXP!Yx,Yɦ|nZZ6aӄeM,@F0`Q7Z8Ơ/eW2˦B?Slu%?ef6t JjW7WĬ^J(,4w lqp%;PHuKrG^SoѢe+JEaS<46Zm:E`yUl-:R6E\m֡x9B NP a,zYxkk6~ w.?:@֠XfMdh:_e#)`'(-EI!a5iS!-8taXym e뺆*6&bvx-i ׎hM\V+tP7rwXHȹUK$#1>I NKv -YpaPr̴"j!<)>5-*$uOeaKE{@^J}wWzFSv|BU8&VW`8F: b+5j:ٸQ_:D +2`cx FM=:CUoS MТ9ԛSm B7yüp1M":Un'). I{"ѲqoN M]#LYXvܣYή"cţA ӿMd†z.goë:x o^t}gޣ[1lѲZ MCaTuP4,U&N5$:U"6CIzxa F24.6(בi7k6@<>E.}lV~:ЖÙjz@Xgh꧚ |h=f3ڄz$b~lo6Wt``:ZrH.w*9wVK㞢3N`dMg`, FȫC 3)vJ2E䍪SytUތr ΍1 ٪E0IҔL~kQ4IBRljmW15J9 QNKM~5[d8]~;û-(a;Ui eݪI_(Q9 mxҫ**dF*Z3]i^ Regު,ŒzΑw u$O[_!j7ʸL H' n<ѵu0[ %wd(>RR1X ) ή.^ 6I=k.db0,̢ٗ~໎ըe}ktT>&6B|ҨM%ճQ+WOJώz!ڼa1qpb&`͈:޺Sx*G97 ;찐 Ȇ8y,F%L[IC0SU'hoIS7õ^iSj:h5 ->#?k:("6'DMIRUx҅r(dI%2Fce]~Mu&Ƙ1.Xt: k;k*6hvV D:ܠVpWrcU\stY/@zH -^^)G'#%_CkfHs"`TtӘ)iC̩zmR­O47l4-nKP# jж!T_%s#$W1?j2BbO*7]Z_CW_kK#ޮ9 vK; 23فFٗ,.F}a #l:+Ʊr3*dx9ĶoKHVWD)γ FH Q1cdQU#;4bRT9Ŧo uԮ4D"nJa*:Y).8[0覢A}{mVkgD?$WI*M4`X+A!\y g&N2 rN:ArBc\?w[S+Jk, XQ# {m1֬ .Pe2 ½=`;i>Ncȉt\Bx!_Ί"$>۲bwebh-i 4XGK@Zq "(nn[,) O)q!َ;! C*0I -Sşkx [`ilFbV%Q l*Y Nd֩!@[YC`(fnE2ؠ_8kMbVviXHВUejR4ޒĭgl߹x,̺1(mh2< ymHq,:D4'vNdfvԍÁ B%BLSe5cٵ:qp)Uy~cBkrkt˄xvw3.W#j/ea'5e1cA{K o})Dp v >\'+SZ܆;xX+)+.YK\j< ZlX&//λb6 ex.6:r:!g1J0Kj`DD:hMPF4ƅS>~oqgϢ /ǫl -O? y%R1yuֱETR ;Ml81=BrǩٯۅC[0OZ>d6VTKeoS>% *?%{΁MoiDUnV%}~@^m1 xofYi] ^'zxuC}FΖ+fKO 9 ._Z XAE6Ӡ#6 r ;pQZpЙj/ 1|!{^֏m-qRqΓq؜26pMٛ$a?ߊ q訟@;l[2 'l^/v]Md.q+˚VAiM"_NŁH /ؐe! 5Ny!30 j@:mfzn'+Qܒ>ؽ+TG5Kj1 5XJqI1HXK}rpΤǃ"`L0 >iF}QL3AtJ>/+*+8bFLpalUȷ T CV ^jT AIt"PɭtmSRLG:tWT-ô`RcMJ`h A P1`ЄܰS>Wyc* <^.Z$)RڣV\,0(dsHx;aVdn;t3Ep(h*/D#npJ]u;9*~O &AV55T>c??w 5q=ӌ.$VPѤN-Wm \p XO?wtTJ L-GWOx|{zWh6 | 0`"6Y a($P-嶊 xD:8e_T"ȳGoo_J!Jb8t쭹_ZOQ <Ď3tJ Ъ]}<Ɏ|'}R}Y)u_uw~}?{C~\ ب0 jy- 1L*ҋ_nj2OV|Fn~3>3hY!q 2\.(᪮ _`}ÿg\N!:L5"t&T?1໿mX%zڟm][\xJf$ ;oY _VF}{N ”3)U/zыz&i5j>(Z=O^{kt94geqW"[1ԤfD #ciy{nP(Xrq ׳XJ!x zZΈ\"S,ЉaV[![| `PnD{.y9<<+f??]y~Y-;zy4 $e)W:mUַE.7~ ʚ[5sS d7o.VWDЛޙ IDATgz 4>ByoxY+azw4n\{|f8\TT?T.oUiXoí9Lcyw}bAd#"a_?XJsz{id}72)P/z .IP F| ؘy.5bPlZ ݼ7[JC=ΫJ`NppA`di,hs)t(Cr]b#[+&za/js2qOϻ ώyk_xU*#/2:-/x_YE=&׍p3y\K•X26=MQ7;Qe_{7-h|kUul!$Pcg>O|4:Ț- [BJʰ%,1H\lƥ"c9*a]U~d8Nr&A%%ܲ;O{')mK,m6,/|&h}Ƿ֧' }fT'~j Ŏj5yM?^7 毾.X ـ?G#Tmat r ]lK:!z泞yT(< ]Sh-dp=Y  ﾿QG !|;3_O:X*(bwpf%#Z`LTEm%Ύq(ʴmV.̍G&aWhgWҜlh꫞?j@os鍹>xb?Vmc/Jț[X$'\bSַ6J !SݍȪ_ mGD0$)eW+mWf$f| g=|c$ +: {yДfff|Ł0pkRa:=ԂԐx?liXӱV]9ۿG<#lrȂǍrﭮ3m˰g]Y}$g>Cdav9>#wb5tXݨD='3eN2Bn(@~yZ91}3'0ȃ/Q~~ rxwx>t``聪zӛ~3#L;c>m曳*LI O~&AuM]d۩ n^Ka_82=z6>S?mkB;\6HztV?>`({%0DIq(WpUhd [* Pz#>I *8L†P*Qnz0muwSZ-wyI29,nN邒k5v"4a ??a-ۃݖR/}Ne*5[0!p+QN>MBv3g>aD6rŌV` dAe#ͥA.4"G@3*R#zֳ% qm6?L.8@⚥ކa 1S(5 HhY+&O +Sխ e~׆ ^64)NW8 qԕ9?}W|yn!2Zxp:r\: 2ͿjȢF™o`>sKVʪXr!rNא6gG0{ZPfO#mG|i79LAbvaUIULuN)\pP[K]M 3%jl"~l +F_4.B}wu(åH8Fٹҗ~]s-9MJ7Ɋ13&7E,iӤn*M$50 ׂGJTd/uKjgg u$O}EiB'A+꼹EmD)膰`2eb/wD3ڄVoy˛v3`$J%{7!(Xl^ )-->edz#vF.]DUl3"(=~ujK!A21]b`͙3Dҽ Unθ-<%f _;}<_&O+8fCA9Ǎ;nl17DjNK5 ɺPD4™+mUq"[;'= A:sq`.t]/h3``ъlnh2pWsp s݈ElyVjA~b1) NC^mr&IHH4.^;L U/x :E#/ b8bKD*AGMJYtX` ]lATƩ zk15Gb*Kx݌C(}{Seyh!b| ߡ3?3g#1̸!6SK`˯qY2U[8c?>4ݯfޙuzZ޸cpY%ֆ>6rޢ޺-xhQD̪@W"̜AfVFkynj* Z K3crjhµ sXe>VJbo03OxýJu˥*$zM}<ݘ}%ϙw%m~ʆ6uZoxLk밒E sbߕ̀,l*8a:Ww6 ك۩_zNBRCXtԅ&ӭ=1: Wqŕ`c yg{J0 Tø\elV[/sROΐ@2 ) !ۄgrR0ȗ)KS%;h zCQY)oR˭(^kNPssIzQ jT2/0 guf!՜ kv=!aZCVw1w,;2*¤6a JL'{~N|L\msc꯽K_uuϣe.10,BsSK'2*ݕ`W!VqG|Y#pyMH;ԧՇ>?y+'羽G \,6!$6GrJ2ɪzϼmXrg(Fo~˛uxH/&ơtY%zXC}( /Ff98T=y;=6dE;S#{YQV;H EFoȪ?W^uRщ\x턊Uoy[wt(d }iue7`_W|: !4 M𜬌dClkk{Q-Y=Xwvp0 N=Ќ6^҃}l=19݅ tEJ eF$RWN8LJE \QF#b88y@ c^җܯJoϳ:krURz"e}۷~I^T% G- #xZ`;f$N${>^W>B=~ucU> šV\|e:oo=pZч5W5V.yh?C?\??^q~TĪYYhz_XVU0!@#)id58k|;z`~*gq{QBۆzzԣU~3ŲSE꾌1j4:)c87qG8b9t/N3ԜJ8`D}trV_SŢ~Umjmȫ?;U'<}=71䳟l.4lr+bڗԐS+G0fY(O29_6|)Է}["r_5X"[_^5X\6V|p:.Y |3/+j:C=4|S[Tz !\Th+*`a4xiiOU`K6Q 03E }i89xfs-"Q/{7e/307etJ`v:J !$*j %S;)8OL`ysn0?tQvAd^WvYA8h.X 4;,Of8[{!HB10rIA*LZAD8swω8NZAc&7"O|Ba}ϚO~+Y$*ZO[dk`ruPBl±gU%DDV6d%/牊 F(p-^+vL3z%-ls »G!X}諸C(;Jܻx(|y'W^IWeK UݶHZeNBsLAr&TSz[Z_E_T'p% 7)K*CyLś pH;}i$"{s YjŚmƠEi__XFiOb,p36;JUsϽ[|N4/Fs*7[WJ0CZcL(nIz.6{>VgJth- #4])aλtmz`2&AC m-I2 #xFq=#3KrYI#AՀلm sn2us5Ehcyj:1J61-*J>PQko t0Lʑ?F/ZƉuftltyihem`;.8H4=..fj4]-Zb^Λ(SnLXqw~N ] P$o5)]?)rԮEG|q>yJW_lr?b)yـ4- pxKypO2sڦbhNȈiʒָ{X0CN9Ia~}ȕ]3*'EImiPF&6 N oEV7$B,`1"ꔔBWb|{X%opRC%ꁯ-Y&L\kn7t9@y\C]jُܝp_ =R & FL;$!@NǧCv5Er I:<͝s< q5:k\D^2AꞪ3h_h&C=ADq dh  #|>YGTϞ~,G]e$(+dBZ[mP6|;{~obj"׬G?|l# gN'?_|͋AW+Q#jTrn.TrR 4hɰ{zޮ}%鏖a+I{0OFVI_=̉M/C!:`q`7~@-S٫*3U[51r:69<َdZي;qdol"V=l(saP^\A_jԗ@mD8)F +xf ݵF;!fۂ/XGFFK! ڿNze]t=F;*\|}Y#͎p.߅§%7Uq._M֔Ac7pZ=6/e62IAF5߈UNthdYH`PI+=Mץp`Ey\Dh]svX+¡t6  A88;͡gW@e\PP XEPA}֓UA~P}6~R}vj7;OJ*^BLBzCi L[UK“@h9=. ^>u6 [U5&03-bᔮ ޏzփgǕR9֫ 糕Y4=4'?gv\Lڦؾ @kرcґ({ j%>=.e ]&'FתP@Yc{EȀ0_;xL;``;Rx<;Ͱ1fА52vzj_AfW3n$<\Q[UVX5ױaq0_Dש܌022~RVjJ<(M8b8ZTMi}}[$:ָ/>W{kC [z U`"}$~KhKo (% \P?3?HGdg dẲoIXet yFmgGj\N)+\)y-1[p:N,)U[Jh-&KGjHzR}EU w3I߻ޘ׷% U=Į~C+k V IDATb2I}2IgAϼ`0jp|}Vo0OH(3Bdf*`YR)\ŹRS FDC+(F5ΰKpfn <ꡇ*w*"ne>;6П 2Up:F`zLHpc5~'g85a1\æ89We) j>N O~6tzG\4WYq0.5(B]lKB99@#&A$cpWM!*c.xRg˂98zz/ÍFf L0i͋/L2vu#{`'1wh a(f2:j6â uu>U7";")if {m]Nnv 2Rju>`d\,j7KX'ya(˻6VĪU-"` fo. ?PQH#-lAcnGr$ŽubpCF70 Qb%{$a˾uajDm}4ÀX jIzr}BF3h }`4WⶫVV5ړwqMLM||us'wyq N.k#;/5SP1_~'JBE"Zkv|vMRSDŽJ3h뫃'Χ҈=t@pU#rֶpaڸ{vΊ53 "4kayK`VZщWtds-^̨S )f{+{FzUr[)Vzr=" OzHOSM6+qYFXzk5Tyʉ/*CFp`CϦWۓ&.Ӕ }\8@ýp04Z^<_ a]uKPUc5f%툱];/L ` id62*C{ٺSIM}g|F4ܩ!p>q/GV˙GT{Ï%`aMjY٩:a#ucC@a^~->ra␜f6N2[}&g^e0yP^r|L M$C6i4r"a/pX !HI*%)[^=ǼQ3 Js:6" x u&L{0:ۆAz[UU{Aj?gȟ*Bk Pl[E iXvAC'kT*/E$^IZkZ9r?OH/%O&!DG_UvgB ?"m%?EN!<[GcS7wRU_'TvAw]|Yz:_0WchizÄ^-GRŎi\<Ғ+m>ΈXx~cc'?ِUn:81NJ n ZZ 9O,ʹRswnRܧ]-Fd=)O'O=iQQQOzl-4J։+m%Imi6r%pYӍ=#Ǫ f3 /6]ݝ{pګYkz͋48aa2Ww s/dB_oɴ~`(#ͽ3莎|ROUm }ںg:-o#%/@V^Xoln8YMǩ5QKL^ٿ߻"OXq1h׷:Q\jWZ߳J>?h脓{t#W*=sIJb9,`4_؜Աڵsoظx"q]P`dq 7@c ,0Zک۵"BaD'sƺIƱѐm%Tf,YnXdr@ t2EՕ ]+B8JRL˪0,rqa킗;]Whhqks_<QH%ŇHOcUL詉GEhih \=}?q;Yf_%c^e e8P";>$\ڀF'D/'&&9͚ݫ+MqF[@r1kkZܕK~e)anHmϔ6y5d yM*c !m%;eQk^+t◪DO 23qP<}ѧIi P 䩨-q^rʉ; VBUEοӢ+µym={Wo^zL܌UoMN.^U } µi$hU "}9:CEXJ`/|/*Jxoo_?f!(:$c2 ,*R2D+-HZF VEq9$ .SS H5"nN {D<~HBM,H 8.H_طlV/)XE-PSL c둴(n **4&6-hmZt0hjF{d@F˷zsk ?soֵֺysXD~* 74\ZR]J2{ӨH~4$})FyM ~Icփ~5_516F2q|̌ 9XC-M礠)pfȯ<,Ә M;VڔX5DˉfKvsO s0RW[~Y޷˾7qlO2̛FڶB+^3H8mk䋿h^R ǐgҨMg:sjw ڦ xpe}NU=cE>cfqvOOP yɕF% O>gP^?0$^痘)U%a׿#{>;7׿%ڙF`3YrUjV˿ʫbzhyot/l^KZ(JUP܅bM<^촧;ǒ{$h'2nooox7XWW^_[w=fCIx+D2c/~/{}?~ &ڡE)߄݁k@j$K.oꯟy>@CN(8+[u?dRg{晏$R$ L1 =H:#!ܢT!@:$I1l]]&zͷ}[}~ky&ߏX8gl+w_/͔wc9葬]uNjbPQSz벘F`́Ѯ'Y?Ta4!U'55-G67z1^4 9j !TYq} = ??Ѧ2!/C{m'z ’zCȾ82_|sX-~)>n[`c- KwͥoC#Es }G>>\EaVq,꒵guhzgC6``|Xi Ir<6k6JM|0v,ax"ҧYBۍU  nmI SD+V _ %J9ld*F}\3 ,98|~@$LW1lyHЎFVs1]yBr ^WUu53OV00f[I[*.":Iz |pt6KA<I)%2>M?Aה(ժu0)gu{>C+Foܞ!:56t!)AtHs, =66$p)s%AX t PRm=4]Hd6hHn9#~Np]9>}m"-/0D\'-[fe4=}>D^_q/=é)=[n ERUKxQOmh=σOT#g[}|R\ @uF7$زHDb{Tk:{Ir W387cuOUEB߱@99(Z4Γl͙sbƐ<ȴ-uQ79XiHyԭ᝾8‚!CTmd9*7pcŔ8ʱQ5r6uh qA f gNr%qjm"0-6 H#!U-ο9SۄKv7cL%a iƬƤ| ZikRCgvQ9lJ68K枝OL)P gR@ƂLBrryd9I)gHVUpw(fsYuw-CEMXtdV+&8T?DPZڢǭvr(4>cl S&:^MWdj(xfKGW``hqwq\Djwx < axg~HEdį:pOO =*FJdS-`p#pbޒGYX ׉N2Br bl0f&+7%"I*np(AF|O;f=`;kV`y͔n!N`6vk|{q+"FK֒rV:V>͂ISDo}69oxk-O+w@K_ +Ϩ/}t/Sr1N%W݃T E=nwMfuʶ{ධ֐;MLK!TazJX^@=B6c_/@.!ia,L!PEoeCß{ ?Ud^ aT2mV??227aĹ|zy>v=їEsi:a} ufEB2Ol0 ߿k.i!.Dx;N4zO?tYWA.n"4'~[jNHKaQ]i ]@`{tҁҬvщofQT ɘ:m !IT2IBAx/,uKq1/"cX={V Gb;ڴ#-!皁evկʯ>FjeHZyV g/jDT}ov=Njgn?{{ ?ryɡl}@OJBըij\|uԜ0C:7ꤢU/5Z>!Xӣ >~Ӎd>}30lg=~j^¿w'F[nư&7,({ys|H-$X$ +NGSjp IDATM`^dn00'Wnx` oG7M; zv ]h`ړ{<⇎$q{ʳeY<^K*WW ʓdcJUTHA~ܖ7,!'ۂ%ӣ/Egd7o9ڞ!9$ofjN!e`"HY簉iZdLvgV$o?cI'@0Ds0('ً ǃJzN/Xs/Qvfo,O*dI`{Rb.)hyHYT FCW?߆mj8jXсF Y5jItk=6bBE1^U3ϸX>>$xrM}$Ļ[XAQ7o\<3E;fp4d}W~ '@{ WSy횇XKC%AgS7i=y!4ԳlNxڦyxVw_sPᮖ)s؜F \ݑQ*$z}Z< .?'5Gu&lwܷTKntDw(Ud, {{VpNipGl[7}?k,UU=SO=%R+hV?_28+:iLRt]TO&5+VlranRym5"UX=v 0ecHԞ?S[k8N|Wo;Dww=g~~"Zd*x@`a(妱-ʦ,%--{s^lz;a`YK,G~]?[g*r0{{5X臿G?Q$*a7F 0K>{qZb7ɺ_o?YϪ~gjM zWD+ yN/ބr<dž]W+䫔VeoxSH\lq{{}fy܆gPiv}};Q}kٕgD|)ٟzϽKkSUחdMKN#'և{q8T*&6TҌHfU-5+6䓄h`Ӿό +^!J{:~Ilp1m~5+//Vo0!H< !x:L7kfC%:oGn23>yW\_B w1v?D_4Nx y=B$v23Z%] @k,wV^c!Q\-ABou?;n9!ݒ~]";<]GBd;lŀ;b^jцBEY>䓃\ s  ~qr}=tW= EJ*d=L40P-j lmчHܿ\B^ O&P QK"6׸k"W|ы>wi߳OR6(f8hk(KʬhNL|?t>> I0??ۨD&?}~e!ƗIH5G-A1j'v EQxɋ_z !c 5o)KnZFMȷઁyqITf08銢;]jq( 8R0n^ynf BVM^߭PU /&_vy46UAa2mڋjt]?Z})ÁߣxUH{éπc >C#^# nE%1EGC} UUw[Cj*;'G)crloPʷx#9M AہuCEߙdoF%F2gǩu"Y5?<4漌+VirHkbSp/Ћ)Yx[9@I zPtM-Y"St`H[-9n._Nv3ZaBMj<XhX{I(pDhw3 qȚ,oo875*-lHN`hLq\70ʫ)=]ؠHjz2ojO*`S+TݷVA!Xms5&!j͛Zz:kvjtm$htKw&|nO`uZ0ǭge|V˖oC̹{aa}(rU\)wp3OeCT,Ar7Ϊ/b4;:}BA&UlgCrHE=uhܸ***6m ʱCT)P*g3 2lQΟ0 Zg9p~'P ]kXPib LK MOS%ṱE/5QpA=*0ۘ d2GZޚM\q5nh&VT-#ڛw6+.즫h48T4Gn+`uV{ V!UxU03wUI9)`ql=]\G*'2͇a{0ɫj1ΗcU&X ^HBI%뢌C?cV[+Y6l!6>-lk]A/r`-, -Ïu0~bK(hn"4a!<ڸLgKx= 5) bV@v[z3tٸQGʻ*`'d L2An 0RWzܑkU9g_H>olݦBEyAC ;:Ԝ .h-ݺ}x M*E+ia*ьן[1YcxgIf ze'W(GR`:zAΩ9$f`h4.\o{~R]IG*3- m{ Ua{?Ͼ +4+PmC+Zބ uŽ@<8iZlS`m+bYRpā*֑8@5:w9"3.?˦R >@k aB;bI5bS1P'/zı$kgoXUn` }E Vjć Td7Ss0HKk!pKyp^4&eSŖv Z!Р a\ |AzV7'0Y/DJ0-%**ٜGvc_\KLʍQ/^ r%5Ovm/h+\x>ejlLdH0752u 3*a3L'G+Gmq䲼eȰ( dD\Y3 Lf+յY~[\`78WH:H%l'o۞vSy(P{TK2Sp)3JR31_ۘ֬8咰%^rz]w^״9 _u}N Mk2AYT2'bTtfE%ycD0xHR4dV᳂.(9Jsd(?CcB9^_]D\AX3*Ş *fAE rk*FtjHϒN'ՠ<\טjD{c|v!tBjѦ=\2>Jdd>9WuTEqQYXD!* Y VSy0V4P3}'KkQEL t8/ȸ; _T1R g^XVl z0QI(QuZ"ٜ*iXn Y(mm˺]LX8uM-:uR] v(痴pXVW>8 ?@w]*4,Z 4h5*Gb'ˇU&(*Ťov% -UW2Ug' +56rBأm2EN'A {䩊PI7^ {7 NrU#K C; w0%A *n̥=10U*+*InLX:f]Y=5J6oܠTl"Fho *;1 B,6u솮nLt$.) .%W [ * Jt):Ꮬ$.(`C@`1$g!1s)C%p|rpXIB#ttzm,ĺN9Ink9ՓHH`)#9P =LK\%^x%P1!;J`fȦ#5ژ_X3[[CψZ}2,g"OF<-W''1yк(1cOO5܈ ;}[>9rv7oЁxHWaAJsQNœo.@$QϹ֛P* 0Y7d (.:HG̒*1IZPx)WDyTF>%]Ҫ~zS@Z*=P# 9G0Er/4:H[CT'S>-umӼ-d*>S~%XeOy(aGʯkƥU4a؄uYHZ<i\3%BOa &ZŹ&5:@)h0ȮuP(qksت6RQl1켔d,3 nqav ٸ :_6g7;ڇ5n;w٩UELv7| '*?mjUPa l<5K4`o3Zog'pze;\T6q Z%8T+FM)}Ž? "(_-Wa_?3"|#qW ++z 1a›d8eygcQnCP =7VMi&R`ضvȤbOSrd,k;K';Ò 7}r@3* uq ' P2!]ʫ,xINɂUO@8ꢑ u;u%ً+CY!!V$$m6a|W+ Bc;]x2qf_XwT)B3I<QmI T"ipΙ5K-{}"Q&3zZk2 *Nv6PlT '͍Ꝇ2 "pȌ9w(VCLL }Ц\(4]Xӄ! v zY#'ȍx&_\u]T&pY#3ܬEyGF]rk9Z5 U ަ+HΒ#,ZcFe5|UI`eJ{Ms(k,4b9B.$N~XNUi $ځ)j4Ť:0}eWJF_J5Ous_B"l߁PPҭ:#MoYH ,XwSTi{*.i)ѺgNPCo<ejܮ,ЖRԁ 遵J+ABF8y1ff{P",dSԶGO ʋh9d]H ;:^2ͫhuTJJeCņn68&t) G҆NW`Ͳ8 ԤOGc-h`eTY1 `!qEhߚ7B@aT2yQӤhh*Y"t<čTpcw'c]*gV ܪIDAT:#4,-A I$g 2V:єԖ3DcO=S @.8]2S!K]s60 ƅUVό$2J.x+ PdgL2[S$3"y;4mE5`ύ wַ"pO_@VƧ\Y؅$9䃻*l%7]5*H\@_gSb7YhdBQ)un/[zx`ߩ-Tt 3 /WpOuHqxzrheW'}MD! !`#YA3IXDFMMƢĠ0iâ |ZiB|; ez-4yњʍB[J.Ҡڶ"ͱTv!Ww͉x8h02{5.d1? Lօ 6 Gģ-`GW݉Hm|gtI^pݺ9/єܨĹޒs8nV IQa W..CHJx?[ /Lx/&'6G%h.5HJ>?0`B 0ٯi@lUKbde?yuCp.f_l[Њ/L jAQtt2I xd0VS6{[g]H/(eٴnf 5^=gh~u018D`?-fV>`Px%y`z*IDzqiB$%ت<]#9MmQIZ/qmij#EE`|7`TB͏4Nnh"rf+F:Tf:I8y5 Įmw*EL?7< I J**,jvn Qt0(vD|zKE#Ldm~ #=0Ih pI.3@H RFۊ1*Nśr\<4:?N~mt) M jhOa^ AQrwrq ZW5 $e&VbGwݫ[ElI(ҟƘ-m *Wr,PFgXۜ* *Z,[]̆gA:QGAN]F0I"#/~L#Be)/19=/q,4 h x<& 3|gw5DCɿS_XpqCׅZnykbv RȎgLW^Uی Ia4D6.Cso*LJGUpN\`:,8#DORAP; |7NTjjn(r%|bSw;.!oTsHR~tZMDΌjuN&Dz&bѰUrmwgxw|b!;쿃w#H9HqrHYIsWQ1Nn2u!1oc(T8 e5/ujﯸpCP L#U =fNaU&krHfB1!o<lvK}cb1 pa-wbZt)\ns7{7JU8;N>1GNlP EXCˑ]J ViV֔Ѵ4(lYEVgC Y+{iȹϼ 6M/A]dӆ8ݚ!}oj!Ňd!3ήGnZW/T3.B4( # .[O`#Ln)=˩R //Z#ԹHY11dձӎgdPby3M4 1bU͜9ڐK&w0mC.ccȍ?sZֆ,~b:65N:giN]4U&@<7틻vP|1m-)8mh#.;'a/@f@g E$, JFIONWfRЁ-c^`9![Z{(Zf_MQOx$Ô꒨P[+,K^rEUDdn1[۔K*jSQYu=Cc?U'4d$r!"Vt!1.|}X`Z m脶܎CIQ).0Ǫ`t zxWC_G!tUȓ3j[>"Pc2.H2A.A>vW^j;fݖՏ55L))դZ_۸;{jys:Ipb_ӌ@@~,K<4b&v\qKN I<]BO]Ùxs]Xy4HZ``AR1j9 •HTd+7ũڅ VSs(VaJFs56qa(H{`F __|NbQ (br|J0_.ȽJDa84 {,%!9J>1TpHN&9jQ6""V`yzXB<>q$"*DlR0'#Y#ZI40LDa y ̡=Z \] l..oq'iT2^]IWxecTIvz?dy娮 Vy_. !T-UB1%*fu"-`ch3sY- |Rr* slP HZbM7=dOUH+m-=*G!8#^e3;J4ma/L4|ЉCU]KKPUiMmPC]ϡ.&#T˩ ;"7(!]+LȾ/,ߣc{'P ϟ{ނg 89>dvHC HXK ziڄ=T&!;' ֒ WakP /W1Tn`%rlfS;p#'ܯx+kd\Q{ pf,i1:r!4oˇ_ Ic`-1`hQ9 vH`~&e`8ݜ6.V6ţax*QPA8m0$9J-ć&eE4kIlK.w1&t{LIBs^UJ* K[S 1$J"Mo.\ QzL$&Ӕ[G=$1Bom iZg@jB]}wey!Εv" m42@?3*%1SJ|2Mr vH2FDvvMh]kόTm")@F)O3wt!Tf:sv957(80tD*E.\aˬx(?*`V.kʸ! au lf=xhWΝc]="Y0s g*X[ IrLlCDzvaڑ'P$$!O;K^[emy&C:l|PBqG[z&$U|d ˪DKJkDᓔJ)?4%Q¨<@}Pe|" bt>hK LXخFZ`T/J@=]9DEGp9cnWP"NaV9Xp *D9?}зKͮa $?bwfQ|NLs7/IZWinWE/2,d*E`:[9@Ai6K>`ޤ︶>?]9Vc*X]00"Ƙ&F_P^wcĴm:dC:׶e <ӨmQye299[^XIvY+Xn[;7h%mQ4:L7ى%+w\mSE4"͇fk9eF"jsKB -` :OL p5^B3 !Cg9?͇C0[­]|+Se٧Vd]q\a- {^R>!ʏ5\Nhrf.UU 9Sp##bd8S5@O7^ae2枉WZmq=k@մA p>5|Sқk\$aѫ4h{;jV gLeSVU4e%w+ 8w؅w1@y4#]IENDB`icedtea-web-1.6.2/tests/reproducers/simple/simpletest1/resources/PaxHeaders.17941/favicon.ico0000644000000000000000000000013112654402377027041 xustar0030 mtime=1454507263.236432594 30 atime=1454507327.347577563 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/simpletest1/resources/favicon.ico0000644000175000002070000000257612654402377027577 0ustar00jvanekmock00000000000000h(   & % % & ' % & '&&'!'"(""*((()(=()>()> E? E E?@? VFGGHG W!H#H T%I #S "Z)J+K )f&|'| -s-~'& 7{/-01 #,96&>'1.=0;)8**<-/>6.80.@7792A11;D2<AC4;7?6A@;8BIA9;DKE<>=HPGJLEOXKJPRRMRLRKVMUWWXVSNWYWQ\RXVUUVX]_\a`aYYd\d\\^g]c``jeccjbmdefhqiphhjiitkllmwopppzt{sttww{~HNV]_PqpLTYZB-EvG3UWYgI%F%'`heA > [koR" =  @+swO D J{\()K'*f.0|b^luX6nyc&)zma24d tS9 verboseArg = Arrays.asList(new String[]{ServerAccess.VERBOSE_OPTION}); private static final String arg = "ěščřžýáíé=!@#$%^*()_+ú)ů§.-?:_\"!'(/ěéřťÝúíóášďźžčň;+ĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ1"; private static final String argEscaped = arg.replace("\"", """); private static final String utf = "UTF8"; private static final String iso88592 = "ISO88592"; private FileInputStream is; File[] utf8Files = server.getDir().listFiles(new FilenameFilter() { @Override public boolean accept(File dir, String name) { return name.contains(utf); } }); File[] iso88592Files = server.getDir().listFiles(new FilenameFilter() { @Override public boolean accept(File dir, String name) { return name.contains(iso88592); } }); @Test public void iso88592FileCanBeDecodedCorrectly() throws Exception { Assert.assertTrue("there must be more then 1 iso file in server's directory", iso88592Files.length > 0); for (int i = 0; i < iso88592Files.length; i++) { File f = iso88592Files[i]; is = new FileInputStream(f); String ff = ServerAccess.getContentOfStream(is, "ISO-8859-2"); ServerAccess.logOutputReprint(f.getName()); ServerAccess.logOutputReprint(ff); Assert.assertTrue("file " + f.getName() + " should contain " + arg + " bud didn't", ff.contains(arg) || ff.contains(argEscaped)); } } @Test public void iso88592FileCanBeDecodedWrongly() throws Exception { Assert.assertTrue("there must be more then 1 iso file in server's directory", iso88592Files.length > 0); for (int i = 0; i < iso88592Files.length; i++) { File f = iso88592Files[i]; is = new FileInputStream(f); String ff = ServerAccess.getContentOfStream(is, "UTF-8"); ServerAccess.logOutputReprint(f.getName()); ServerAccess.logOutputReprint(ff); Assert.assertFalse("file " + f.getName() + " should NOT contain " + arg + " bud did", ff.contains(arg) || ff.contains(argEscaped)); } } @Test public void utf8FileCanBeDecodedCorrectly() throws Exception { Assert.assertTrue("there must be more then 1 utf file in server's directory", utf8Files.length > 0); for (int i = 0; i < utf8Files.length; i++) { File f = utf8Files[i]; is = new FileInputStream(f); String ff = ServerAccess.getContentOfStream(is, "UTF-8"); ServerAccess.logOutputReprint(f.getName()); ServerAccess.logOutputReprint(ff); Assert.assertTrue("file " + f.getName() + " should contain " + arg + " bud didn't", ff.contains(arg) || ff.contains(argEscaped)); } } @Test public void utf8FileCanBeDecodedWrongly() throws Exception { Assert.assertTrue("there must be more then 1 utf file in server's directory", utf8Files.length > 0); for (int i = 0; i < utf8Files.length; i++) { File f = utf8Files[i]; is = new FileInputStream(f); String ff = ServerAccess.getContentOfStream(is, "ISO-8859-2"); ServerAccess.logOutputReprint(f.getName()); ServerAccess.logOutputReprint(ff); Assert.assertFalse("file " + f.getName() + " should NOT contain " + arg + " bud did", ff.contains(arg) || ff.contains(argEscaped)); } } @Test public void testEncodingTest1Utf8() throws Exception { testEncodingTest1(utf); } @Test @KnownToFail @Bug(id = "PR1108") public void testEncodingTest1Iso88592() throws Exception { testEncodingTest1(iso88592); } @Test public void testEncodingTest2Utf8() throws Exception { testEncodingTest2(utf); } @Test @KnownToFail @Bug(id = "PR1108") public void testEncodingTest2Iso88592() throws Exception { testEncodingTest2(iso88592); } @Test public void testEncodingTest3Utf8() throws Exception { testEncodingTest3(utf); } @Test @KnownToFail @Bug(id = "PR1108") public void testEncodingTest3Iso88592() throws Exception { testEncodingTest3(iso88592); } @Test @NeedsDisplay @TestInBrowsers(testIn = Browsers.one) public void testEncodingTest4Utf8() throws Exception { testEncodingTest4(utf); } @Test @NeedsDisplay @TestInBrowsers(testIn = Browsers.one) public void testEncodingTest4Iso88592() throws Exception { testEncodingTest4(iso88592); } @Test public void testEncodingTest5Utf8() throws Exception { testEncodingTest5(utf); } @Test @Bug(id = "PR1108") @KnownToFail public void testEncodingTest5Iso88592() throws Exception { testEncodingTest5(iso88592); } /** * launching simpletest1.jar from encoding encoded jnlp */ public void testEncodingTest1(String encoding) throws Exception { ProcessResult pr = server.executeJavawsHeadless(verboseArg, "/encodingTest1-" + encoding + ".jnlp"); String s = "Good simple javaws exapmle"; Assert.assertTrue("encodingTest1 (in " + encoding + ") stdout should contain " + s + " bud didn't", pr.stdout.contains(s)); //javaws in verbose mode is printing out readed jnlp. I'm no sure if the following test is relevant Assert.assertTrue("encodingTest1 (in " + encoding + ") stdout should contain " + arg + " bud didn't", pr.stdout.contains(arg)); } /** * launching simpletest1.jar fromencoding file with utf8/ISO-8859-2 uncompatible characters */ public void testEncodingTest2(String encoding) throws Exception { ProcessResult pr = server.executeJavawsHeadless(verboseArg, "/encodingTest2ĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ-" + encoding + ".jnlp"); String s = "Good simple javaws exapmle"; Assert.assertTrue("encodingTest2ĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ (in " + encoding + ") stdout should contain " + s + " bud didn't", pr.stdout.contains(s)); //javaws in verbose mode is printing out readed jnlp. I'm no sure if the following test is relevant Assert.assertTrue("encodingTest2ĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ (in " + encoding + ") stdout should contain " + arg + " bud didn't", pr.stdout.contains(arg)); } /** * launching encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ.jar from encoding file with utf8/ISO-8859-2 uncompatible characters included also in args and jar filename */ public void testEncodingTest3(String encoding) throws Exception { //not verbose in this case, this class is printing it's argument out ProcessResult pr = server.executeJavawsHeadless("/encodingTest3-" + encoding + ".jnlp"); String s = "Encoded jar decoded correctly"; Assert.assertTrue("encodingTest3 (in " + encoding + ") stdout should contain " + s + " bud didn't", pr.stdout.contains(s)); Assert.assertTrue("encodingTest3 (in " + encoding + ") stdout should contain " + arg + " bud didn't", pr.stdout.contains(arg)); } /** * launching encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ.jar from encoding file with utf8/ISO-8859-2 uncompatible characters included also in args and jar filename in browser */ public void testEncodingTest4(String encoding) throws Exception { ProcessResult pr = server.executeBrowser("/encodingTest4-" + encoding + ".html"); String s3 = "applet was initialised"; Assert.assertTrue("encodingTest4 stdout should contains " + s3 + " bud didn't", pr.stdout.contains(s3)); String s0 = "applet was started"; Assert.assertTrue("encodingTest4 stdout should contains " + s0 + " bud didn't", pr.stdout.contains(s3)); Assert.assertTrue("encodingTest4 (in " + encoding + ") stdout should contain " + arg + " bud didn't", pr.stdout.contains(arg)); } /** * launching encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ.jar from encoding file with utf8/ISO-8859-2 uncompatible characters included also in args and jar filename as applet by jnlp */ public void testEncodingTest5(String encoding) throws Exception { //not verbose in this case, this class is printing it's argument out ProcessResult pr = server.executeJavawsHeadless("/encodingTest5-" + encoding + ".jnlp"); String s3 = "applet was initialised"; Assert.assertTrue("encodingTest5 stdout should contains " + s3 + " bud didn't", pr.stdout.contains(s3)); String s0 = "applet was started"; Assert.assertTrue("encodingTest5 stdout should contains " + s0 + " bud didn't", pr.stdout.contains(s3)); Assert.assertTrue("encodingTest5 (in " + encoding + ") stdout should contain " + arg + " bud didn't", pr.stdout.contains(arg)); } } icedtea-web-1.6.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽ0000644000000000000000000000032112654402377037446 xustar00120 path=icedtea-web-1.6.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/srcs/ 30 mtime=1454507263.236432594 30 atime=1454507658.779157357 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽ0000755000175000002070000000000012654402377042677 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽ0000644000000000000000000000034212654402377037451 xustar00137 path=icedtea-web-1.6.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/srcs/EncodingTest.java 30 mtime=1454507263.236432594 30 atime=1454507327.347577563 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽ0000644000175000002070000000552612654402377042711 0ustar00jvanekmock00000000000000 import java.applet.Applet; /* EncodingTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class EncodingTest extends Applet { public static void main(String[] args){ System.out.println("Encoded jar decoded correctly"); for (int i = 0; i < args.length; i++) { String string = args[i]; System.out.println(string); } } private class Killer extends Thread { public int n = 2000; @Override public void run() { try { Thread.sleep(n); System.out.println("Aplet killing himself after " + n + " ms of life"); System.exit(0); } catch (Exception ex) { } } } private Killer killer; @Override public void init() { System.out.println("applet was initialised"); killer = new Killer(); } @Override public void start() { System.out.println("applet was started"); System.out.println(getParameter("key1")); killer.start(); System.out.println("killer was started"); } @Override public void stop() { System.out.println("applet was stopped"); } @Override public void destroy() { System.out.println("applet will be destroyed"); } } icedtea-web-1.6.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽ0000644000000000000000000000032612654402377037453 xustar00125 path=icedtea-web-1.6.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/resources/ 30 mtime=1454507263.235432608 30 atime=1454507658.779157357 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽ0000755000175000002070000000000012654402377042677 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽ0000644000000000000000000000035512654402377037455 xustar00148 path=icedtea-web-1.6.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/resources/encodingTest5-UTF8.jnlp 30 mtime=1454507263.235432608 30 atime=1454507327.347577563 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽ0000644000175000002070000000511212654402377042700 0ustar00jvanekmock00000000000000 encodingTest IcedTea ěščřžýáíé=!@#$%^*()_+ú)ů§.-?:_\"!'(/ěéřťÝúíóášďźžčň;+ĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ1 icedtea-web-1.6.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽ0000644000000000000000000000036112654402377037452 xustar00152 path=icedtea-web-1.6.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/resources/encodingTest5-ISO88592.jnlp 30 mtime=1454507263.235432608 30 atime=1454507327.346577576 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽ0000644000175000002070000000472512654402377042711 0ustar00jvanekmock00000000000000 encodingTest IcedTea =!@#$%^*()_+).-?:_\"!'(/^;+̩خثϮ1 icedtea-web-1.6.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽ0000644000000000000000000000035512654402377037455 xustar00148 path=icedtea-web-1.6.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/resources/encodingTest4-UTF8.html 30 mtime=1454507263.235432608 30 atime=1454507327.346577576 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽ0000644000175000002070000000405712654402377042707 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽ0000644000000000000000000000036112654402377037452 xustar00152 path=icedtea-web-1.6.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/resources/encodingTest4-ISO88592.html 30 mtime=1454507263.235432608 30 atime=1454507327.346577576 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽ0000644000175000002070000000375112654402377042707 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽ0000644000000000000000000000035512654402377037455 xustar00148 path=icedtea-web-1.6.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/resources/encodingTest3-UTF8.jnlp 30 mtime=1454507263.235432608 30 atime=1454507327.346577576 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽ0000644000175000002070000000464612654402377042713 0ustar00jvanekmock00000000000000 encodingTest3 IcedTea ěščřžýáíé=!@#$%^*()_+ú)ů§.-?:_"!'(/ěéřťÝúíóášďźžčň;+ĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ ěščřžýáíé=!@#$%^*()_+ú)ů§.-?:_"!'(/ěéřťÝúíóášďźžčň;+ĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ1 icedtea-web-1.6.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽ0000644000000000000000000000036112654402377037452 xustar00152 path=icedtea-web-1.6.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/resources/encodingTest3-ISO88592.jnlp 30 mtime=1454507263.234432621 30 atime=1454507327.346577576 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽ0000644000175000002070000000446112654402377042706 0ustar00jvanekmock00000000000000 encodingTest3 IcedTea =!@#$%^*()_+).-?:_"!'(/^;+̩خثϮ =!@#$%^*()_+).-?:_"!'(/^;+̩خثϮ1 icedtea-web-1.6.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽ0000644000000000000000000000043512654402377037454 xustar00196 path=icedtea-web-1.6.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/resources/encodingTest2ĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ-UTF8.jnlp 30 mtime=1454507263.234432621 30 atime=1454507327.346577576 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽ0000644000175000002070000000472312654402377042707 0ustar00jvanekmock00000000000000 encodingTest2ĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ IcedTea ěščřžýáíé=!@#$%^*()_+ú)ů§.-?:_"!'(/ěéřťÝúíóášďźžčň;+ĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ ěščřžýáíé=!@#$%^*()_+ú)ů§.-?:_"!'(/ěéřťÝúíóášďźžčň;+ĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ1 icedtea-web-1.6.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽ0000644000000000000000000000044112654402377037451 xustar00200 path=icedtea-web-1.6.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/resources/encodingTest2ĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ-ISO88592.jnlp 30 mtime=1454507263.234432621 30 atime=1454507327.346577576 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽ0000644000175000002070000000450612654402377042706 0ustar00jvanekmock00000000000000 encodingTest2̩خثϮ IcedTea =!@#$%^*()_+).-?:_"!'(/^;+̩خثϮ =!@#$%^*()_+).-?:_"!'(/^;+̩خثϮ1 icedtea-web-1.6.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽ0000644000000000000000000000035512654402377037455 xustar00148 path=icedtea-web-1.6.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/resources/encodingTest1-UTF8.jnlp 30 mtime=1454507263.233432634 30 atime=1454507327.345577589 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽ0000644000175000002070000000456312654402377042711 0ustar00jvanekmock00000000000000 encodingTest1 IcedTea ěščřžýáíé=!@#$%^*()_+ú)ů§.-?:_"!'(/ěéřťÝúíóášďźžčň;+ĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ ěščřžýáíé=!@#$%^*()_+ú)ů§.-?:_"!'(/ěéřťÝúíóášďźžčň;+ĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ1 icedtea-web-1.6.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽ0000644000000000000000000000036112654402377037452 xustar00152 path=icedtea-web-1.6.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/resources/encodingTest1-ISO88592.jnlp 30 mtime=1454507263.233432634 30 atime=1454507327.345577589 29 ctime=1454507658.75415769 icedtea-web-1.6.2/tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽ0000644000175000002070000000442612654402377042707 0ustar00jvanekmock00000000000000 encodingTest1 IcedTea =!@#$%^*()_+).-?:_"!'(/^;+̩خثϮ =!@#$%^*()_+).-?:_"!'(/^;+̩خثϮ1 icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/deadlocktest0000644000000000000000000000013212654402377023026 xustar0030 mtime=1454507263.233432634 30 atime=1454507658.779157357 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/deadlocktest/0000755000175000002070000000000012654402377023626 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/deadlocktest/PaxHeaders.17941/testcases0000644000000000000000000000013212654402377025024 xustar0030 mtime=1454507263.233432634 30 atime=1454507658.779157357 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/deadlocktest/testcases/0000755000175000002070000000000012654402377025624 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/deadlocktest/testcases/PaxHeaders.17941/DeadLockTestTest.0000644000000000000000000000013212654402377030250 xustar0030 mtime=1454507263.233432634 30 atime=1454507327.345577589 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/deadlocktest/testcases/DeadLockTestTest.java0000644000175000002070000002603112654402377031637 0ustar00jvanekmock00000000000000/* DeadLockTestTest.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.ArrayList; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import org.junit.Assert; import java.util.Arrays; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; import org.junit.BeforeClass; import org.junit.Test; public class DeadLockTestTest { private static ServerAccess server = new ServerAccess(); private static String deadlocktest_1 = "/deadlocktest_1.jnlp"; private static String deadlocktest = "/deadlocktest.jnlp"; @BeforeClass public static void printJavas() throws Exception { ServerAccess.logOutputReprint("Currently runnng javas1 " + countJavaInstances()); } @Test public void testDeadLockTestTerminated() throws Exception { testDeadLockTestTerminatedBody(deadlocktest); testDeadLockTestTerminatedBody(deadlocktest); ServerAccess.logOutputReprint("Currently running javas12 " + countJavaInstances()); } @Test public void testDeadLockTestTerminated2() throws Exception { testDeadLockTestTerminatedBody(deadlocktest_1); testDeadLockTestTerminatedBody(deadlocktest_1); /** * this happens, when p.p.destroy is called before p.interrupt. and destroyed variable is removedI have no idea why, but it is incorrect. Assert.assertNotNull("return can not be null in no fork process. Was ",pr.returnValue);//in this case forking is forbiden, and sojava throws an exception after destroy */ ServerAccess.logOutputReprint("Currently running javas13 " + countJavaInstances()); } public void testDeadLockTestTerminatedBody(String jnlp) throws Exception { List before = countJavaInstances(); ServerAccess.logOutputReprint("java1 " + jnlp + " : " + before.size()); ProcessResult pr = server.executeJavawsHeadless(null, jnlp); assertDeadlockTestLaunched(pr); List after = countJavaInstances(); ServerAccess.logOutputReprint("java2 " + jnlp + " : " + after.size()); killDiff(before, after); String ss = "This process is hanging more than 30s. Should be killed"; Assert.assertFalse("stdout should not contains: " + ss + ", but did", pr.stdout.contains(ss)); // as we are tryng to terminate process as harmless as possible those two are no longer valid in all cases // Assert.assertTrue("testDeadLockTestTerminated should be terminated, but wasn't", pr.wasTerminated); // Assert.assertNull("Killed process must have null return value. Have not - ", pr.returnValue); List afterKill = countJavaInstances(); ServerAccess.logOutputReprint("java3 " + jnlp + " : " + afterKill.size()); Assert.assertEquals("assert that just old javas remians", 0, (before.size() - afterKill.size())); } @Test public void ensureAtLeasOneJavaIsRunning() throws Exception { Assert.assertTrue("at least one java should be running, but isn't! Javas are probably counted badly", countJavaInstances().size() > 0); } @Test public void testSimpletest1lunchFork() throws Exception { List before = countJavaInstances(); ServerAccess.logOutputReprint("java4: " + before.size()); BackgroundDeadlock bd = new BackgroundDeadlock(deadlocktest_1, null); bd.start(); Thread.sleep(ServerAccess.PROCESS_TIMEOUT * 2 / 3); List during = countJavaInstances(); ServerAccess.logOutputReprint("java5: " + during.size()); waitForBackgroundDeadlock(bd); List after = countJavaInstances(); ServerAccess.logOutputReprint("java6: " + after.size()); Assert.assertNotNull("proces inside background deadlock cant be null. It was.", bd.getPr()); assertDeadlockTestLaunched(bd.getPr()); killDiff(before, during); List afterKill = countJavaInstances(); ServerAccess.logOutputReprint("java66: " + afterKill.size()); Assert.assertEquals("assert that just old javas remians", 0, (before.size() - afterKill.size())); // div by two is caused by jav in java process hierarchy Assert.assertEquals("launched JVMs must be exactly 2, was " + (during.size() - before.size()), 2, (during.size() - before.size())); } @Test public void testSimpletest1lunchNoFork() throws Exception { List before = countJavaInstances(); ServerAccess.logOutputReprint("java7: " + before.size()); BackgroundDeadlock bd = new BackgroundDeadlock(deadlocktest_1, Arrays.asList(new String[]{"-Xnofork"})); bd.start(); Thread.sleep(ServerAccess.PROCESS_TIMEOUT * 2 / 3); List during = countJavaInstances(); ServerAccess.logOutputReprint("java8: " + during.size()); waitForBackgroundDeadlock(bd); List after = countJavaInstances(); ServerAccess.logOutputReprint("java9: " + after.size()); Assert.assertNotNull("proces inside background deadlock cant be null. It was.", bd.getPr()); assertDeadlockTestLaunched(bd.getPr()); killDiff(before, during); List afterKill = countJavaInstances(); ServerAccess.logOutputReprint("java99: " + afterKill.size()); Assert.assertEquals("assert that just old javas remians", 0, (before.size() - afterKill.size())); // div by two is caused by jav in java process hierarchy Assert.assertEquals("launched JVMs must be exactly 1, was " + (during.size() - before.size()), 1, (during.size() - before.size())); } /** * by process assasin destroyed processes are hanging random amount of time as zombies. * Kill -9 is handling zombies pretty well. * * This function kills or processes which are in nw but are not in old * (eq.to killing new zombies:) ) * * @param old * @param nw * @return * @throws Exception */ private static List killDiff(List old, List nw) throws Exception { ensureLinux(); List result = new ArrayList(); for (String string : nw) { if (old.contains(string)) { continue; } ServerAccess.logOutputReprint("Killing " + string); ServerAccess.PROCESS_LOG = false; try { ProcessResult pr = ServerAccess.executeProcess(Arrays.asList(new String[]{"kill", "-9", string})); } finally { ServerAccess.PROCESS_LOG = true; } result.add(string); ServerAccess.logOutputReprint("Killed " + string); } return result; } private static List countJavaInstances() throws Exception { ensureLinux(); List result = new ArrayList(); ServerAccess.PROCESS_LOG = false; try { ProcessResult pr = ServerAccess.executeProcess(Arrays.asList(new String[]{"ps", "-eo", "pid,ppid,stat,fname"})); Matcher m = Pattern.compile("\\s*\\d+\\s+\\d+ .+ java\\s*").matcher(pr.stdout); int i = 0; while (m.find()) { i++; String ss = m.group(); //ServerAccess.logOutputReprint(i+": "+ss); result.add(ss.trim().split("\\s+")[0]); } } finally { ServerAccess.PROCESS_LOG = true; } return result; } public static void main(String[] args) throws Exception { ServerAccess.logOutputReprint("" + countJavaInstances()); } private void assertDeadlockTestLaunched(ProcessResult pr) { String s = "Deadlock test started"; Assert.assertTrue("Deadlock test should print out " + s + ", but did not", pr.stdout.contains(s)); //each 3500 seconds deadlock test stdout something //timeout is 20s //so it should write out FIVE sentences, but is mostly just three or four. Last is nearly always consumed by termination for (int i = 1; i <= 3; i++) { String sentence = i + " Deadlock sleeping"; Assert.assertTrue( "stdout should contains: " + sentence + ", didn't, so framework have consumed to much during termination", pr.stdout.contains(sentence)); } } private void waitForBackgroundDeadlock(final BackgroundDeadlock bd) throws InterruptedException { while (!bd.isFinished()) { Thread.sleep(500); } } private static class BackgroundDeadlock extends Thread { private boolean finished = false; private ProcessResult pr = null; String jnlp; List args; public BackgroundDeadlock(String jnlp, List args) { this.jnlp = jnlp; this.args = args; } @Override public void run() { try { pr = server.executeJavawsHeadless(args, jnlp); } catch (Exception ex) { ServerAccess.logException(ex); } finally { finished = true; } } public ProcessResult getPr() { return pr; } public boolean isFinished() { return finished; } } private static void ensureLinux() { String os = System.getProperty("os.name").toLowerCase(); if (!(os.contains("linux") || os.contains("unix"))) { throw new IllegalStateException("This test can be procesed only on linux like machines"); } } } icedtea-web-1.6.2/tests/reproducers/simple/deadlocktest/PaxHeaders.17941/srcs0000644000000000000000000000013212654402377024000 xustar0030 mtime=1454507263.232432648 30 atime=1454507658.779157357 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/deadlocktest/srcs/0000755000175000002070000000000012654402377024600 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/deadlocktest/srcs/PaxHeaders.17941/DeadlockTest.java0000644000000000000000000000013212654402377027266 xustar0030 mtime=1454507263.232432648 30 atime=1454507327.345577589 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/deadlocktest/srcs/DeadlockTest.java0000644000175000002070000000453312654402377030016 0ustar00jvanekmock00000000000000/* DeadlockTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class DeadlockTest { private static final int DEADLOCK_TEST_TIME_OF_LIFE=30000; public static void main(String[] args) throws Exception { long startTime = System.nanoTime() / 1000000l; System.out.println("Deadlock test started"); int i=0; while (true) { long now = System.nanoTime() / 1000000l; Thread.sleep(3500); i++; System.out.println(i+" Deadlock sleeping"); if (now - startTime > DEADLOCK_TEST_TIME_OF_LIFE) { System.out.println("This process is hanging more then "+DEADLOCK_TEST_TIME_OF_LIFE/1000+"s. Should be killed"); System.out.flush(); System.exit(5); } } } } icedtea-web-1.6.2/tests/reproducers/simple/deadlocktest/PaxHeaders.17941/resources0000644000000000000000000000013212654402377025040 xustar0030 mtime=1454507263.232432648 30 atime=1454507658.779157357 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/deadlocktest/resources/0000755000175000002070000000000012654402377025640 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/deadlocktest/resources/PaxHeaders.17941/deadlocktest_1.jn0000644000000000000000000000013212654402377030334 xustar0030 mtime=1454507263.232432648 30 atime=1454507327.345577589 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/deadlocktest/resources/deadlocktest_1.jnlp0000644000175000002070000000426612654402377031423 0ustar00jvanekmock00000000000000 simpletest1 IcedTea simpletest1 icedtea-web-1.6.2/tests/reproducers/simple/deadlocktest/resources/PaxHeaders.17941/deadlocktest.jnlp0000644000000000000000000000013212654402377030450 xustar0030 mtime=1454507263.232432648 30 atime=1454507327.344577603 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/deadlocktest/resources/deadlocktest.jnlp0000644000175000002070000000413712654402377031200 0ustar00jvanekmock00000000000000 simpletest1 IcedTea simpletest1 icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/VersionedJar__V10000644000000000000000000000013212654402377023460 xustar0030 mtime=1454507263.232432648 30 atime=1454507658.779157357 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/VersionedJar__V1/0000755000175000002070000000000012654402377024260 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/VersionedJar__V1/PaxHeaders.17941/testcases0000644000000000000000000000013212654402377025456 xustar0030 mtime=1454507263.232432648 30 atime=1454507658.779157357 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/VersionedJar__V1/testcases/0000755000175000002070000000000012654402377026256 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/VersionedJar__V1/testcases/PaxHeaders.17941/VersionedJarT0000644000000000000000000000013212654402377030175 xustar0030 mtime=1454507263.232432648 30 atime=1454507327.344577603 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/VersionedJar__V1/testcases/VersionedJarTest.java0000644000175000002070000000631712654402377032363 0ustar00jvanekmock00000000000000/* Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; public class VersionedJarTest { private static final ServerAccess server = new ServerAccess(); private static final String VERSIONED = "Versioned jar was accessed."; private static final String FAILURE = "net.sourceforge.jnlp.LaunchException"; @BeforeClass public static void clearCache() throws Exception{ //to speedup individual methods server.executeJavawsClearCache(); } @Test public void testDisabledVersionParameter() throws Exception { //if testEnabledVersionParameter is run before this onne, then it fails server.executeJavawsClearCache(); //the versioning is realted only to downloading of resources, so afaik this behaviour is correct ProcessResult pr = server.executeJavawsHeadless("/VersionedJarDisabled.jnlp"); Assert.assertFalse("Stdout should NOT contain '" + VERSIONED + "', but did.", pr.stdout.contains(VERSIONED)); Assert.assertTrue("Stderr should contain '" +FAILURE + "', but did not.", pr.stderr.contains(FAILURE)); } @Test public void testEnabledVersionParameter() throws Exception { server.executeJavawsClearCache(); ProcessResult pr = server.executeJavawsHeadless("/VersionedJarEnabled.jnlp"); Assert.assertTrue("Stdout should contain '" + VERSIONED + "', but did not.", pr.stdout.contains(VERSIONED)); Assert.assertFalse("Stderr should NOT contain '" +FAILURE + "', but did.", pr.stderr.contains(FAILURE)); } } icedtea-web-1.6.2/tests/reproducers/simple/VersionedJar__V1/PaxHeaders.17941/srcs0000644000000000000000000000013212654402377024432 xustar0030 mtime=1454507263.231432661 30 atime=1454507658.779157357 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/VersionedJar__V1/srcs/0000755000175000002070000000000012654402377025232 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/VersionedJar__V1/srcs/PaxHeaders.17941/VersionedJar.java0000644000000000000000000000013212654402377027745 xustar0030 mtime=1454507263.231432661 30 atime=1454507327.344577603 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/VersionedJar__V1/srcs/VersionedJar.java0000644000175000002070000000351512654402377030474 0ustar00jvanekmock00000000000000/* Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.applet.*; import java.awt.*; import java.lang.reflect.Array; import java.lang.reflect.Field; public class VersionedJar { static public void main(String[] args) { System.out.println("Versioned jar was accessed."); } }icedtea-web-1.6.2/tests/reproducers/simple/VersionedJar__V1/PaxHeaders.17941/resources0000644000000000000000000000013212654402377025472 xustar0030 mtime=1454507263.231432661 30 atime=1454507658.779157357 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/VersionedJar__V1/resources/0000755000175000002070000000000012654402377026272 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/VersionedJar__V1/resources/PaxHeaders.17941/VersionedJarE0000644000000000000000000000013212654402377030172 xustar0030 mtime=1454507263.231432661 30 atime=1454507327.344577603 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/VersionedJar__V1/resources/VersionedJarEnabled.jnlp0000644000175000002070000000404612654402377033031 0ustar00jvanekmock00000000000000 Test replacing security manager IcedTea icedtea-web-1.6.2/tests/reproducers/simple/VersionedJar__V1/resources/PaxHeaders.17941/VersionedJarD0000644000000000000000000000013212654402377030171 xustar0030 mtime=1454507263.231432661 30 atime=1454507327.344577603 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/VersionedJar__V1/resources/VersionedJarDisabled.jnlp0000644000175000002070000000403312654402377033202 0ustar00jvanekmock00000000000000 Test versioned jars IcedTea icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/UnsignedJnlpTemplate0000644000000000000000000000013212654402377024454 xustar0030 mtime=1454507263.230432674 30 atime=1454507658.779157357 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/UnsignedJnlpTemplate/0000755000175000002070000000000012654402377025254 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/UnsignedJnlpTemplate/PaxHeaders.17941/testcases0000644000000000000000000000013212654402377026452 xustar0030 mtime=1454507263.230432674 30 atime=1454507658.779157357 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/UnsignedJnlpTemplate/testcases/0000755000175000002070000000000012654402377027252 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/UnsignedJnlpTemplate/testcases/PaxHeaders.17941/UnsignedJ0000644000000000000000000000031312654402377030341 xustar00113 path=icedtea-web-1.6.2/tests/reproducers/simple/UnsignedJnlpTemplate/testcases/UnsignedJnlpTemplateTest.java 30 mtime=1454507263.230432674 30 atime=1454507327.344577603 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/UnsignedJnlpTemplate/testcases/UnsignedJnlpTemplateTest.j0000644000175000002070000000572712654402377034374 0ustar00jvanekmock00000000000000/* UnsignedJnlpTemplateTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.util.Arrays; import java.util.Collections; import java.util.List; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import org.junit.Assert; import org.junit.Test; public class UnsignedJnlpTemplateTest { private static ServerAccess server = new ServerAccess(); private final List l = Collections.unmodifiableList(Arrays.asList(new String[] { "-Xtrustall" })); private final String outputString = "Running unsigned application in main"; @Test public void jnlpTemplateIsUnchecked1() throws Exception { ProcessResult pr = server.executeJavawsHeadless(l, "/UnsignedJnlpTemplate1.jnlp"); Assert.assertTrue("Stdout should contains " + outputString + " but did not", pr.stdout.contains(outputString)); } @Test public void jnlpTemplateIsUnchecked2() throws Exception { ProcessResult pr = server.executeJavawsHeadless(l, "/UnsignedJnlpTemplate2.jnlp"); Assert.assertTrue("Stdout should contains " + outputString + " but did not", pr.stdout.contains(outputString)); } @Test public void jnlpTemplateIsUnchecked3() throws Exception { ProcessResult pr = server.executeJavawsHeadless(l, "/UnsignedJnlpTemplate3.jnlp"); Assert.assertTrue("Stdout should contains " + outputString + " but did not", pr.stdout.contains(outputString)); } } icedtea-web-1.6.2/tests/reproducers/simple/UnsignedJnlpTemplate/PaxHeaders.17941/srcs0000644000000000000000000000013212654402377025426 xustar0030 mtime=1454507263.230432674 30 atime=1454507658.779157357 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/UnsignedJnlpTemplate/srcs/0000755000175000002070000000000012654402377026226 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/UnsignedJnlpTemplate/srcs/PaxHeaders.17941/UnsignedJnlpTe0000644000000000000000000000013212654402377030317 xustar0030 mtime=1454507263.230432674 30 atime=1454507327.343577616 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/UnsignedJnlpTemplate/srcs/UnsignedJnlpTemplate.java0000644000175000002070000000342012654402377033164 0ustar00jvanekmock00000000000000/* UnsignedJnlpTemplate.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class UnsignedJnlpTemplate { public static void main(String[] args) { System.out.println("Running unsigned application in main"); } } icedtea-web-1.6.2/tests/reproducers/simple/UnsignedJnlpTemplate/srcs/PaxHeaders.17941/JNLP-INF0000644000000000000000000000013212654402377026603 xustar0030 mtime=1454507263.230432674 30 atime=1454507658.779157357 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/UnsignedJnlpTemplate/srcs/JNLP-INF/0000755000175000002070000000000012654402377027403 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/UnsignedJnlpTemplate/srcs/JNLP-INF/PaxHeaders.17941/APPLI0000644000000000000000000000031312654402377027451 xustar00113 path=icedtea-web-1.6.2/tests/reproducers/simple/UnsignedJnlpTemplate/srcs/JNLP-INF/APPLICATION_TEMPLATE.jnlp 30 mtime=1454507263.230432674 30 atime=1454507327.343577616 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/UnsignedJnlpTemplate/srcs/JNLP-INF/APPLICATION_TEMPLATE.j0000644000175000002070000000443412654402377032621 0ustar00jvanekmock00000000000000 UnsignedJnlpTemplate IcedTea UnsignedJnlpTemplate icedtea-web-1.6.2/tests/reproducers/simple/UnsignedJnlpTemplate/PaxHeaders.17941/resources0000644000000000000000000000013212654402377026466 xustar0030 mtime=1454507263.230432674 30 atime=1454507658.779157357 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/UnsignedJnlpTemplate/resources/0000755000175000002070000000000012654402377027266 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/UnsignedJnlpTemplate/resources/PaxHeaders.17941/UnsignedJ0000644000000000000000000000013212654402377030354 xustar0030 mtime=1454507263.230432674 30 atime=1454507327.343577616 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/UnsignedJnlpTemplate/resources/UnsignedJnlpTemplate3.jnlp0000644000175000002070000000455612654402377034344 0ustar00jvanekmock00000000000000 DIFFERENTJnlpTemplateNAME IcedTea UnsignedJnlpTemplate icedtea-web-1.6.2/tests/reproducers/simple/UnsignedJnlpTemplate/resources/PaxHeaders.17941/UnsignedJ0000644000000000000000000000013212654402377030354 xustar0030 mtime=1454507263.229432688 30 atime=1454507327.343577616 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/UnsignedJnlpTemplate/resources/UnsignedJnlpTemplate2.jnlp0000644000175000002070000000434612654402377034340 0ustar00jvanekmock00000000000000 UnsignedJnlpTemplate IcedTea icedtea-web-1.6.2/tests/reproducers/simple/UnsignedJnlpTemplate/resources/PaxHeaders.17941/UnsignedJ0000644000000000000000000000013212654402377030354 xustar0030 mtime=1454507263.229432688 30 atime=1454507327.343577616 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/UnsignedJnlpTemplate/resources/UnsignedJnlpTemplate1.jnlp0000644000175000002070000000421312654402377034330 0ustar00jvanekmock00000000000000 UnsignedJnlpTemplate IcedTea UnsignedJnlpTemplate icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/UnsignedJnlpApplication0000644000000000000000000000013212654402377025144 xustar0030 mtime=1454507263.229432688 30 atime=1454507658.779157357 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/UnsignedJnlpApplication/0000755000175000002070000000000012654402377025744 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/UnsignedJnlpApplication/PaxHeaders.17941/testcases0000644000000000000000000000013212654402377027142 xustar0030 mtime=1454507263.229432688 30 atime=1454507658.779157357 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/UnsignedJnlpApplication/testcases/0000755000175000002070000000000012654402377027742 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/UnsignedJnlpApplication/testcases/PaxHeaders.17941/Unsign0000644000000000000000000000032112654402377030405 xustar00119 path=icedtea-web-1.6.2/tests/reproducers/simple/UnsignedJnlpApplication/testcases/UnsignedJnlpApplicationTest.java 30 mtime=1454507263.229432688 30 atime=1454507327.342577629 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/UnsignedJnlpApplication/testcases/UnsignedJnlpApplication0000644000175000002070000000573212654402377034460 0ustar00jvanekmock00000000000000/* UnsignedJnlpApplicationTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.util.Arrays; import java.util.Collections; import java.util.List; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import org.junit.Assert; import org.junit.Test; public class UnsignedJnlpApplicationTest { private static ServerAccess server = new ServerAccess(); private final List l = Collections.unmodifiableList(Arrays.asList(new String[] { "-Xtrustall" })); private final String outputString = "Running unsigned application in main"; @Test public void jnlpFileIsUnchecked1() throws Exception { ProcessResult pr = server.executeJavawsHeadless(l, "/UnsignedJnlpApplication1.jnlp"); Assert.assertTrue("Stdout should contains " + outputString + " but did not", pr.stdout.contains(outputString)); } @Test public void jnlpFileIsUnchecked2() throws Exception { ProcessResult pr = server.executeJavawsHeadless(l, "/UnsignedJnlpApplication2.jnlp"); Assert.assertTrue("Stdout should contains " + outputString + " but did not", pr.stdout.contains(outputString)); } @Test public void jnlpFileIsUnchecked3() throws Exception { ProcessResult pr = server.executeJavawsHeadless(l, "/UnsignedJnlpApplication3.jnlp"); Assert.assertTrue("Stdout should contains " + outputString + " but did not", pr.stdout.contains(outputString)); } } icedtea-web-1.6.2/tests/reproducers/simple/UnsignedJnlpApplication/PaxHeaders.17941/srcs0000644000000000000000000000013212654402377026116 xustar0030 mtime=1454507263.228432701 30 atime=1454507658.779157357 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/UnsignedJnlpApplication/srcs/0000755000175000002070000000000012654402377026716 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/UnsignedJnlpApplication/srcs/PaxHeaders.17941/UnsignedJnl0000644000000000000000000000013212654402377030336 xustar0030 mtime=1454507263.229432688 30 atime=1454507327.342577629 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/UnsignedJnlpApplication/srcs/UnsignedJnlpApplication.java0000644000175000002070000000342612654402377034352 0ustar00jvanekmock00000000000000/* UnsignedJnlpApplication.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class UnsignedJnlpApplication { public static void main(String[] args) { System.out.println("Running unsigned application in main"); } } icedtea-web-1.6.2/tests/reproducers/simple/UnsignedJnlpApplication/srcs/PaxHeaders.17941/JNLP-INF0000644000000000000000000000013212654402377027273 xustar0030 mtime=1454507263.228432701 30 atime=1454507658.779157357 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/UnsignedJnlpApplication/srcs/JNLP-INF/0000755000175000002070000000000012654402377030073 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/UnsignedJnlpApplication/srcs/JNLP-INF/PaxHeaders.17941/AP0000644000000000000000000000013212654402377027573 xustar0030 mtime=1454507263.228432701 30 atime=1454507327.342577629 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/UnsignedJnlpApplication/srcs/JNLP-INF/APPLICATION.jnlp0000644000175000002070000000445312654402377032531 0ustar00jvanekmock00000000000000 UnsignedJnlpApplication IcedTea UnsignedJnlpApplication icedtea-web-1.6.2/tests/reproducers/simple/UnsignedJnlpApplication/PaxHeaders.17941/resources0000644000000000000000000000013212654402377027156 xustar0030 mtime=1454507263.228432701 30 atime=1454507658.779157357 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/UnsignedJnlpApplication/resources/0000755000175000002070000000000012654402377027756 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/UnsignedJnlpApplication/resources/PaxHeaders.17941/Unsign0000644000000000000000000000031612654402377030425 xustar00116 path=icedtea-web-1.6.2/tests/reproducers/simple/UnsignedJnlpApplication/resources/UnsignedJnlpApplication3.jnlp 30 mtime=1454507263.228432701 30 atime=1454507327.342577629 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/UnsignedJnlpApplication/resources/UnsignedJnlpApplication0000644000175000002070000000457512654402377034500 0ustar00jvanekmock00000000000000 DIFFERENTJnlpApplicationNAME IcedTea UnsignedJnlpApplication icedtea-web-1.6.2/tests/reproducers/simple/UnsignedJnlpApplication/resources/PaxHeaders.17941/Unsign0000644000000000000000000000031612654402377030425 xustar00116 path=icedtea-web-1.6.2/tests/reproducers/simple/UnsignedJnlpApplication/resources/UnsignedJnlpApplication2.jnlp 30 mtime=1454507263.228432701 30 atime=1454507327.342577629 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/UnsignedJnlpApplication/resources/UnsignedJnlpApplication0000644000175000002070000000436212654402377034472 0ustar00jvanekmock00000000000000 UnsignedJnlpApplication IcedTea icedtea-web-1.6.2/tests/reproducers/simple/UnsignedJnlpApplication/resources/PaxHeaders.17941/Unsign0000644000000000000000000000031612654402377030425 xustar00116 path=icedtea-web-1.6.2/tests/reproducers/simple/UnsignedJnlpApplication/resources/UnsignedJnlpApplication1.jnlp 30 mtime=1454507263.227432714 30 atime=1454507327.341577643 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/UnsignedJnlpApplication/resources/UnsignedJnlpApplication0000644000175000002070000000423212654402377034466 0ustar00jvanekmock00000000000000 UnsignedJnlpApplication IcedTea UnsignedJnlpApplication icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/UnicodeLineBreak0000644000000000000000000000013212654402377023523 xustar0030 mtime=1454507263.227432714 30 atime=1454507658.779157357 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/UnicodeLineBreak/0000755000175000002070000000000012654402377024323 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/UnicodeLineBreak/PaxHeaders.17941/testcases0000644000000000000000000000013212654402377025521 xustar0030 mtime=1454507263.227432714 30 atime=1454507658.779157357 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/UnicodeLineBreak/testcases/0000755000175000002070000000000012654402377026321 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/UnicodeLineBreak/testcases/PaxHeaders.17941/UnicodeLineBr0000644000000000000000000000013212654402377030203 xustar0030 mtime=1454507263.227432714 30 atime=1454507327.341577643 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/UnicodeLineBreak/testcases/UnicodeLineBreakTests.java0000644000175000002070000001112212654402377033347 0ustar00jvanekmock00000000000000/* AppletTestTests.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.io.File; import java.io.IOException; import java.util.Arrays; import net.sourceforge.jnlp.OptionsDefinitions; import static org.junit.Assert.assertTrue; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ProcessWrapper; import net.sourceforge.jnlp.ServerAccess.AutoClose; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.browsers.firefox.FirefoxProfilesOperator; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.config.PathsAndFiles; import net.sourceforge.jnlp.security.appletextendedsecurity.AppletSecurityLevel; import net.sourceforge.jnlp.tools.DeploymentPropertiesModifier; import net.sourceforge.jnlp.util.FileUtils; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; public class UnicodeLineBreakTests extends BrowserTest { private static DeploymentPropertiesModifier dp; private static File backup; @BeforeClass public static void setSecurity() throws IOException{ dp = new DeploymentPropertiesModifier(); dp.setProperties(DeploymentConfiguration.KEY_SECURITY_LEVEL, AppletSecurityLevel.ASK_UNSIGNED.name()); } @BeforeClass public static void backupAppTrust() throws IOException{ backup = File.createTempFile("unicodeNewLIne", "itwReproducers"); backup.deleteOnExit(); FirefoxProfilesOperator.copyFile(PathsAndFiles.APPLET_TRUST_SETTINGS_USER.getFile(), backup); } @AfterClass public static void restoreAppTrust() throws IOException{ FirefoxProfilesOperator.copyFile(backup, PathsAndFiles.APPLET_TRUST_SETTINGS_USER.getFile()); } @AfterClass public static void resetSecurity() throws IOException{ dp.restoreProperties(); } //placeholder to make junit happy @Test public void unicodeLineBreakTestFake() throws Exception { } //headless dialogues now works only for javaws. press ok, otherwise first assert fails //@Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void unicodeLineBreakTest() throws Exception { PathsAndFiles.APPLET_TRUST_SETTINGS_USER.getFile().delete(); //clean file to examine later ProcessResult pr = server.executeBrowser("/UnicodeLineBreak.html", AutoClose.CLOSE_ON_CORRECT_END); assertTrue(pr.stdout.contains(AutoOkClosingListener.MAGICAL_OK_CLOSING_STRING)); String s = FileUtils.loadFileAsString(PathsAndFiles.APPLET_TRUST_SETTINGS_USER.getFile()); String[] ss = s.split("\n"); for (String string : ss) { Assert.assertFalse(string.contains("\\Qhttp://evil-site/evil.page/\\E \\Qhttp://evil-site/\\E malware.jar")); } } } icedtea-web-1.6.2/tests/reproducers/simple/UnicodeLineBreak/PaxHeaders.17941/srcs0000644000000000000000000000013212654402377024475 xustar0030 mtime=1454507263.227432714 30 atime=1454507658.779157357 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/UnicodeLineBreak/srcs/0000755000175000002070000000000012654402377025275 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/UnicodeLineBreak/srcs/PaxHeaders.17941/UnicodeLineBreak.j0000644000000000000000000000013212654402377030070 xustar0030 mtime=1454507263.227432714 30 atime=1454507327.341577643 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/UnicodeLineBreak/srcs/UnicodeLineBreak.java0000644000175000002070000000343412654402377031307 0ustar00jvanekmock00000000000000 import java.applet.Applet; /* AppletTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class UnicodeLineBreak extends Applet { @Override public void init() { System.out.println("*** APPLET FINISHED ***"); } } icedtea-web-1.6.2/tests/reproducers/simple/UnicodeLineBreak/PaxHeaders.17941/resources0000644000000000000000000000013212654402377025535 xustar0030 mtime=1454507263.227432714 30 atime=1454507658.779157357 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/UnicodeLineBreak/resources/0000755000175000002070000000000012654402377026335 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/UnicodeLineBreak/resources/PaxHeaders.17941/UnicodeLineBr0000644000000000000000000000013212654402377030217 xustar0030 mtime=1454507263.227432714 30 atime=1454507327.341577643 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/UnicodeLineBreak/resources/UnicodeLineBreak.html0000644000175000002070000000403412654402377032367 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/StripHttpPathParams0000644000000000000000000000013212654402377024302 xustar0030 mtime=1454507263.226432728 30 atime=1454507658.779157357 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/StripHttpPathParams/0000755000175000002070000000000012654402377025102 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/StripHttpPathParams/PaxHeaders.17941/testcases0000644000000000000000000000013212654402377026300 xustar0030 mtime=1454507263.226432728 30 atime=1454507658.779157357 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/StripHttpPathParams/testcases/0000755000175000002070000000000012654402377027100 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/StripHttpPathParams/testcases/PaxHeaders.17941/StripHttpP0000644000000000000000000000031112654402377030360 xustar00111 path=icedtea-web-1.6.2/tests/reproducers/simple/StripHttpPathParams/testcases/StripHttpPathParamsTest.java 30 mtime=1454507263.226432728 30 atime=1454507327.341577643 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/StripHttpPathParams/testcases/StripHttpPathParamsTest.jav0000644000175000002070000000553512654402377034374 0ustar00jvanekmock00000000000000/* StripHttpPathParamsTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess.AutoClose; import net.sourceforge.jnlp.annotations.KnownToFail; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; import org.junit.Assert; import org.junit.Test; public class StripHttpPathParamsTest extends BrowserTest { private static final String appletCloseString = AutoOkClosingListener.MAGICAL_OK_CLOSING_STRING; @Test public void testStripHttpPathParamsLaunch() throws Exception { ProcessResult pr = server.executeJavawsHeadless("/StripHttpPathParams.jnlp"); Assert.assertTrue("stdout should contain \"running\" but did not", pr.stdout.contains("running")); } @NeedsDisplay @Test @TestInBrowsers(testIn={Browsers.one}) public void testStripHttpPathParamsApplet() throws Exception { ProcessResult pr = server.executeBrowser("/StripHttpPathParams.html", AutoClose.CLOSE_ON_BOTH); Assert.assertTrue("stdout should contain " + appletCloseString + " but did not", pr.stdout.contains(appletCloseString)); } } icedtea-web-1.6.2/tests/reproducers/simple/StripHttpPathParams/PaxHeaders.17941/srcs0000644000000000000000000000013212654402377025254 xustar0030 mtime=1454507263.226432728 30 atime=1454507658.779157357 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/StripHttpPathParams/srcs/0000755000175000002070000000000012654402377026054 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/StripHttpPathParams/srcs/PaxHeaders.17941/StripHttpPathPa0000644000000000000000000000013212654402377030313 xustar0030 mtime=1454507263.226432728 30 atime=1454507327.340577656 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/StripHttpPathParams/srcs/StripHttpPathParams.java0000644000175000002070000000365412654402377032651 0ustar00jvanekmock00000000000000/* StripHttpPathParams.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.applet.Applet; public class StripHttpPathParams extends Applet { private static final String appletCloseString = "*** APPLET FINISHED ***"; public static void main(String[] args) { System.out.println("running"); } @Override public void init() { System.out.println(appletCloseString); } } icedtea-web-1.6.2/tests/reproducers/simple/StripHttpPathParams/PaxHeaders.17941/resources0000644000000000000000000000013212654402377026314 xustar0030 mtime=1454507263.226432728 30 atime=1454507658.779157357 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/StripHttpPathParams/resources/0000755000175000002070000000000012654402377027114 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/StripHttpPathParams/resources/PaxHeaders.17941/StripHttpP0000644000000000000000000000013212654402377030375 xustar0030 mtime=1454507263.226432728 30 atime=1454507327.340577656 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/StripHttpPathParams/resources/StripHttpPathParams.jnlp0000644000175000002070000000424212654402377033725 0ustar00jvanekmock00000000000000 StripHttpPathParams IcedTea Remove HTTP Path Parameters from JAR URLs icedtea-web-1.6.2/tests/reproducers/simple/StripHttpPathParams/resources/PaxHeaders.17941/StripHttpP0000644000000000000000000000013212654402377030375 xustar0030 mtime=1454507263.225432741 30 atime=1454507327.340577656 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/StripHttpPathParams/resources/StripHttpPathParams.html0000644000175000002070000000352612654402377033732 0ustar00jvanekmock00000000000000 icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/Spaces can be everywhere0000644000000000000000000000013212654402377025035 xustar0030 mtime=1454507263.225432741 30 atime=1454507658.779157357 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/Spaces can be everywhere/0000755000175000002070000000000012654402377025635 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/Spaces can be everywhere/PaxHeaders.17941/testcases0000644000000000000000000000013212654402377027033 xustar0030 mtime=1454507263.225432741 30 atime=1454507658.779157357 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/Spaces can be everywhere/testcases/0000755000175000002070000000000012654402377027633 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/Spaces can be everywhere/testcases/PaxHeaders.17941/Space0000644000000000000000000000032112654402377030066 xustar00119 path=icedtea-web-1.6.2/tests/reproducers/simple/Spaces can be everywhere/testcases/SpacesCanBeEverywhereTests.java 30 mtime=1454507263.225432741 30 atime=1454507327.340577656 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/Spaces can be everywhere/testcases/SpacesCanBeEverywhereT0000644000175000002070000002754712654402377034076 0ustar00jvanekmock00000000000000/* SpacesCanBeEverywhereTests.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.ArrayList; import java.util.Arrays; import java.util.List; import net.sourceforge.jnlp.ContentReaderListener; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.annotations.Bug; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.closinglisteners.StringBasedClosingListener; import org.junit.Assert; import org.junit.Test; @Bug(id={"http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2011-October/016127.html","PR804","PR811"}) public class SpacesCanBeEverywhereTests extends BrowserTest { public static final String s = "Spaces can be everywhere.jsr was launched correctly"; @Bug(id="PR811") @Test @NeedsDisplay public void SpacesCanBeEverywhereLocalAppletTestsJnlp2() throws Exception { List commands=new ArrayList(1); commands.add(server.getJavawsLocation()); commands.add(server.getDir()+"/NotOnly spaces can kill ěščřž too.jnlp"); /* Change of dir is cousing the Exception bellow * ServerAccess.ProcessResult pr = ServerAccess.executeProcess(commands,server.getDir()); * No X11 DISPLAY variable was set, but this program performed an operation which requires it. * at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:173) * at java.awt.Window.(Window.java:476) * at java.awt.Frame.(Frame.java:419) * at java.awt.Frame.(Frame.java:384) * at javax.swing.SwingUtilities$SharedOwnerFrame.(SwingUtilities.java:1754) * at javax.swing.SwingUtilities.getSharedOwnerFrame(SwingUtilities.java:1831) * at javax.swing.JWindow.(JWindow.java:185) * at javax.swing.JWindow.(JWindow.java:137) * at net.sourceforge.jnlp.runtime.JNLPSecurityManager.(JNLPSecurityManager.java:121) * at net.sourceforge.jnlp.runtime.JNLPRuntime.initialize(JNLPRuntime.java:202) * at net.sourceforge.jnlp.runtime.Boot.run(Boot.java:177) * at net.sourceforge.jnlp.runtime.Boot.run(Boot.java:51) * at java.security.AccessController.doPrivileged(Native Method) * at net.sourceforge.jnlp.runtime.Boot.main(Boot.java:168) * * Thats why there is absolute path to the file. * * This is also why SpacesCanBeEverywhereLocalTests1Signed is passing - * it is in headless mode. This can be considered as bug, but because it is * only on ocal files, and probably only from test run - it can be ignored */ ProcessResult pr = ServerAccess.executeProcess(commands); Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s)); Assert.assertFalse("should not be terminated, but was", pr.wasTerminated); Assert.assertEquals((Integer) 0, pr.returnValue); } @Bug(id="PR811") @Test @NeedsDisplay public void SpacesCanBeEverywhereRemoteAppletTestsJnlp2() throws Exception { ProcessResult pr = server.executeJavaws("/NotOnly%20spaces%20can%20kill%20%C4%9B%C5%A1%C4%8D%C5%99%C5%BE%20too.jnlp"); Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s)); Assert.assertFalse("should NOT be terminated, but was", pr.wasTerminated); } @Bug(id="PR811") @Test @NeedsDisplay @TestInBrowsers(testIn = {Browsers.all}) public void SpacesCanBeEverywhereRemoteAppletTestsHtml2() throws Exception { ProcessResult pr = server.executeBrowser("/spaces+applet+Tests.html", Arrays.asList(new ContentReaderListener[] {new StringBasedClosingListener(s)}), null); Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s)); Assert.assertTrue("should be terminated, but was not", pr.wasTerminated); } @Bug(id={"PR811","http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2011-October/016144.html"}) @Test public void SpacesCanBeEverywhereRemoteTests1() throws Exception { ProcessResult pr = server.executeJavawsHeadless(null, "/Spaces%20can%20be%20everywhere1.jnlp"); String s = "Good simple javaws exapmle"; Assert.assertTrue("stdout should contains `" + s + "`, but did not", pr.stdout.contains(s)); String cc = "ClassNotFoundException"; Assert.assertFalse("stderr should NOT contains `" + cc + "`, but did", pr.stderr.contains(cc)); Assert.assertFalse("should not be terminated, but was", pr.wasTerminated); Assert.assertEquals((Integer) 0, pr.returnValue); } @Bug(id="PR811") @Test public void SpacesCanBeEverywhereRemoteTests2() throws Exception { ProcessResult pr = server.executeJavawsHeadless(null, "/Spaces%20can%20be%20everywhere2.jnlp"); Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s)); String cc = "ClassNotFoundException"; Assert.assertFalse("stderr should NOT contains `" + cc + "`, but did", pr.stderr.contains(cc)); Assert.assertFalse("should not be terminated, but was", pr.wasTerminated); Assert.assertEquals((Integer) 0, pr.returnValue); } @Bug(id="PR811") @Test public void SpacesCanBeEverywhereRemoteTests2_withQuery1() throws Exception { ProcessResult pr = server.executeJavawsHeadless(null, "/Spaces%20can%20be%20everywhere2.jnlp?test=10"); Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s)); String cc = "ClassNotFoundException"; Assert.assertFalse("stderr should NOT contains `" + cc + "`, but did", pr.stderr.contains(cc)); Assert.assertFalse("should not be terminated, but was", pr.wasTerminated); Assert.assertEquals((Integer) 0, pr.returnValue); } @Bug(id="PR811") @Test public void SpacesCanBeEverywhereRemoteTests2_withQuery2() throws Exception { ProcessResult pr = server.executeJavawsHeadless(null, "/Spaces%20can%20be%20everywhere2.jnlp?test%3D10"); Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s)); String cc = "ClassNotFoundException"; Assert.assertFalse("stderr should NOT contains `" + cc + "`, but did", pr.stderr.contains(cc)); Assert.assertFalse("should not be terminated, but was", pr.wasTerminated); Assert.assertEquals((Integer) 0, pr.returnValue); } @Bug(id="PR811") @Test public void SpacesCanBeEverywhereRemoteTests3() throws Exception { ProcessResult pr = server.executeJavawsHeadless(null, "/SpacesCanBeEverywhere1.jnlp"); Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s)); String cc = "ClassNotFoundException"; Assert.assertFalse("stderr should NOT contains `" + cc + "`, but did", pr.stderr.contains(cc)); Assert.assertFalse("should not be terminated, but was", pr.wasTerminated); Assert.assertEquals((Integer) 0, pr.returnValue); } @Bug(id="PR804") @Test public void SpacesCanBeEverywhereLocalTests1() throws Exception { List commands=new ArrayList(4); commands.add(server.getJavawsLocation()); commands.add(ServerAccess.HEADLES_OPTION); commands.add("Spaces can be everywhere1.jnlp"); ProcessResult pr = ServerAccess.executeProcess(commands,server.getDir()); String s = "Good simple javaws exapmle"; Assert.assertTrue("stdout should contains `" + s + "`, but did not", pr.stdout.contains(s)); String cc = "ClassNotFoundException"; Assert.assertFalse("stderr should NOT contains `" + cc + "`, but did", pr.stderr.contains(cc)); Assert.assertFalse("should not be terminated, but was", pr.wasTerminated); Assert.assertEquals((Integer) 0, pr.returnValue); } @Bug(id="PR804") @Test public void SpacesCanBeEverywhereLocalTests2() throws Exception { List commands=new ArrayList(4); commands.add(server.getJavawsLocation()); commands.add(ServerAccess.HEADLES_OPTION); commands.add("Spaces can be everywhere2.jnlp"); ProcessResult pr = ServerAccess.executeProcess(commands,server.getDir()); Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s)); String cc = "ClassNotFoundException"; Assert.assertFalse("stderr should NOT contains `" + cc + "`, but did", pr.stderr.contains(cc)); Assert.assertFalse("should not be terminated, but was", pr.wasTerminated); Assert.assertEquals((Integer) 0, pr.returnValue); } @Bug(id="PR804") @Test public void SpacesCanBeEverywhereLocalTests4() throws Exception { List commands=new ArrayList(4); commands.add(server.getJavawsLocation()); commands.add(ServerAccess.HEADLES_OPTION); commands.add(server.getDir()+"/Spaces can be everywhere2.jnlp"); ProcessResult pr = ServerAccess.executeProcess(commands); Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s)); String cc = "ClassNotFoundException"; Assert.assertFalse("stderr should NOT contains `" + cc + "`, but did", pr.stderr.contains(cc)); Assert.assertFalse("should not be terminated, but was", pr.wasTerminated); Assert.assertEquals((Integer) 0, pr.returnValue); } @Bug(id="PR804") @Test public void SpacesCanBeEverywhereLocalTests3() throws Exception { List commands=new ArrayList(4); commands.add(server.getJavawsLocation()); commands.add(ServerAccess.HEADLES_OPTION); commands.add("SpacesCanBeEverywhere1.jnlp"); ProcessResult pr = ServerAccess.executeProcess(commands,server.getDir()); Assert.assertTrue("stdout should contains `"+s+"`, but did not",pr.stdout.contains(s)); String cc = "ClassNotFoundException"; Assert.assertFalse("stderr should NOT contains `" + cc + "`, but did", pr.stderr.contains(cc)); Assert.assertFalse("should not be terminated, but was", pr.wasTerminated); Assert.assertEquals((Integer) 0, pr.returnValue); } } icedtea-web-1.6.2/tests/reproducers/simple/Spaces can be everywhere/PaxHeaders.17941/srcs0000644000000000000000000000013212654402377026007 xustar0030 mtime=1454507263.225432741 30 atime=1454507658.779157357 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/Spaces can be everywhere/srcs/0000755000175000002070000000000012654402377026607 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/Spaces can be everywhere/srcs/PaxHeaders.17941/SpacesCanB0000644000000000000000000000013212654402377027751 xustar0030 mtime=1454507263.225432741 30 atime=1454507327.340577656 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/Spaces can be everywhere/srcs/SpacesCanBeEverywhere.java0000644000175000002070000000465412654402377033640 0ustar00jvanekmock00000000000000 import java.applet.Applet; /* SpacesCanBeEverywhere.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class SpacesCanBeEverywhere extends Applet{ public static void main(String[] args){ System.out.println("Spaces can be everywhere.jsr was launched correctly"); } private class Killer extends Thread { public int n = 2000; @Override public void run() { try { Thread.sleep(n); System.out.println("Applet killing himself after " + n + " ms of life"); System.exit(0); } catch (Exception ex) { } } } private Killer killer; @Override public void init() { killer = new Killer(); } @Override public void start() { main(null); killer.start(); System.out.println("killer was started"); } } icedtea-web-1.6.2/tests/reproducers/simple/Spaces can be everywhere/PaxHeaders.17941/resources0000644000000000000000000000013212654402377027047 xustar0030 mtime=1454507263.224432754 30 atime=1454507658.779157357 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/Spaces can be everywhere/resources/0000755000175000002070000000000012654402377027647 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/Spaces can be everywhere/resources/PaxHeaders.17941/space0000644000000000000000000000031212654402377030142 xustar00112 path=icedtea-web-1.6.2/tests/reproducers/simple/Spaces can be everywhere/resources/spaces applet Tests.html 30 mtime=1454507263.224432754 30 atime=1454507327.340577656 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/Spaces can be everywhere/resources/spaces applet Tests.ht0000644000175000002070000000344712654402377034023 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/simple/Spaces can be everywhere/resources/PaxHeaders.17941/Space0000644000000000000000000000031512654402377030105 xustar00115 path=icedtea-web-1.6.2/tests/reproducers/simple/Spaces can be everywhere/resources/SpacesCanBeEverywhere1.jnlp 30 mtime=1454507263.224432754 30 atime=1454507327.339577669 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/Spaces can be everywhere/resources/SpacesCanBeEverywhere10000644000175000002070000000417612654402377034040 0ustar00jvanekmock00000000000000 simpletest1 IcedTea simpletest1 icedtea-web-1.6.2/tests/reproducers/simple/Spaces can be everywhere/resources/PaxHeaders.17941/Space0000644000000000000000000000032012654402377030101 xustar00118 path=icedtea-web-1.6.2/tests/reproducers/simple/Spaces can be everywhere/resources/Spaces can be everywhere2.jnlp 30 mtime=1454507263.224432754 30 atime=1454507327.339577669 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/Spaces can be everywhere/resources/Spaces can be everywhe0000644000175000002070000000423512654402377033724 0ustar00jvanekmock00000000000000 Spaces can be everywhere2 IcedTea Spaces can be everywhere2 icedtea-web-1.6.2/tests/reproducers/simple/Spaces can be everywhere/resources/PaxHeaders.17941/Space0000644000000000000000000000032012654402377030101 xustar00118 path=icedtea-web-1.6.2/tests/reproducers/simple/Spaces can be everywhere/resources/Spaces can be everywhere1.jnlp 30 mtime=1454507263.224432754 30 atime=1454507327.339577669 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/Spaces can be everywhere/resources/Spaces can be everywhe0000644000175000002070000000420612654402377033722 0ustar00jvanekmock00000000000000 Spaces can be everywhere1 IcedTea Spaces can be everywhere1 icedtea-web-1.6.2/tests/reproducers/simple/Spaces can be everywhere/resources/PaxHeaders.17941/NotOn0000644000000000000000000000033512654402377030111 xustar00131 path=icedtea-web-1.6.2/tests/reproducers/simple/Spaces can be everywhere/resources/NotOnly spaces can kill ěščřž too.jnlp 30 mtime=1454507263.223432768 30 atime=1454507327.339577669 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/Spaces can be everywhere/resources/NotOnly spaces can kil0000644000175000002070000000452412654402377033722 0ustar00jvanekmock00000000000000 Spaces can be everywhere test with few more chars for encoding IcedTea AppletTest icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/SingleInstanceServiceTest0000644000000000000000000000013212654402377025447 xustar0030 mtime=1454507263.223432768 30 atime=1454507658.779157357 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/SingleInstanceServiceTest/0000755000175000002070000000000012654402377026247 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/SingleInstanceServiceTest/PaxHeaders.17941/testcases0000644000000000000000000000013212654402377027445 xustar0030 mtime=1454507263.223432768 30 atime=1454507658.779157357 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/SingleInstanceServiceTest/testcases/0000755000175000002070000000000012654402377030245 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/SingleInstanceServiceTest/testcases/PaxHeaders.17941/Sing0000644000000000000000000000031212654402377030345 xustar00112 path=icedtea-web-1.6.2/tests/reproducers/simple/SingleInstanceServiceTest/testcases/SingleInstanceTest.java 30 mtime=1454507263.223432768 30 atime=1454507327.339577669 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/SingleInstanceServiceTest/testcases/SingleInstanceTest.ja0000644000175000002070000003147412654402377034340 0ustar00jvanekmock00000000000000/* SingleInstanceTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import net.sourceforge.jnlp.ContentReaderListener; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserFactory; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import org.junit.Assert; import org.junit.Test; public class SingleInstanceTest extends BrowserTest { private static boolean isJnlp(String launchFile) { return launchFile.toLowerCase().endsWith(".jnlp"); } private static boolean isHtml(String launchFile) { return launchFile.toLowerCase().endsWith(".html"); } private static void checkNulls(String testName, ProcessResult prSecondInst, String var) { Assert.assertNotNull(var + " SingleInstanceTest." + testName + "result was null ", prSecondInst); Assert.assertNotNull(var + " SingleInstanceTest." + testName + "result was null ", prSecondInst.stdout); Assert.assertNotNull(var + " SingleInstanceTest." + testName + "result was null ", prSecondInst.stderr); } private static void evaluateFirstInstance(ProcessResult prFirstInst, String testName) { checkNulls(testName, prFirstInst, "First"); // First Instance's result should run without exceptions. String s0 = "SingleInstanceChecker: Adding listener to service."; String s1 = "Parameters received by SingleInstanceChecker"; String ss = "SingleInstanceChecker: Service lookup failed."; Assert.assertTrue("SingleInstanceTest." + testName + "'s first PR stdout should contain " + s0 + " but didn't", prFirstInst.stdout.contains(s0)); Assert.assertTrue("SingleInstanceTest." + testName + "'s first PR stdout should contain " + s1 + " but didn't", prFirstInst.stdout.contains(s1)); Assert.assertFalse("SingleInstanceTest." + testName + "'s first PR stderr should not contain " + ss + " but did", prFirstInst.stderr.contains(ss)); } private static void evaluateSecondInstance(ProcessResult prSecondInst, String testName) { checkNulls(testName, prSecondInst, "Second"); // Second Instance's result should throw a LaunchException. String s2 = "net.sourceforge.jnlp.LaunchException"; Assert.assertTrue("SingleInstanceTest." + testName + "'s second PR stderr should contain " + s2 + " but didn't", prSecondInst.stderr.contains(s2)); } private static boolean bothHtml(String app1, String app2) { return isHtml(app1) && isHtml(app2); } private static class AsyncProcess extends Thread { private ProcessResult pr = null; private String launchFile; public AsyncProcess(String launchFile) { this.launchFile = launchFile; } @Override public void run() { try { boolean isJavawsTest = isJnlp(launchFile); pr = isJavawsTest ? server.executeJavawsHeadless(launchFile, null, null) : server.executeBrowser(launchFile); } catch (Exception ex) { ServerAccess.logException(ex); } finally { if (pr == null) { pr = new ProcessResult("", "", null, true, null, null); } } } public ProcessResult getPr() { return pr; } } private ProcessResult[] executeSingleInstanceCheck(String app1, String app2) throws Exception { final AsyncProcess ap = new AsyncProcess(app2); ContentReaderListener clr = new ContentReaderListener() { @Override public void charReaded(char ch) { //nothing to do } @Override public void lineReaded(String s) { if (s.contains(listenerConfirmed)) { ap.start(); } } }; boolean isJavawsTest = isJnlp(app1); final ProcessResult pr = isJavawsTest ? server.executeJavawsHeadless(app1, clr, null) : server.executeBrowser(app1, clr, null); int timeout = 0; while (ap.pr == null) { timeout++; Thread.sleep(500); if (timeout > 20) { break; } } return new ProcessResult[]{pr, ap.getPr()}; } //files private static final String jnlpApplet = "/SingleInstanceTest.jnlp"; private static final String jnlpApplication = "/SingleInstanceTestWS.jnlp"; private static final String htmlpApplet = "/SingleInstanceTest_clasical.html"; private static final String htmlJnlpHrefApplet = "/SingleInstanceTest_jnlpHref.html"; //constants private static final String listenerConfirmed = "SingleInstanceChecker: Listener added."; @Test @NeedsDisplay @TestInBrowsers(testIn = Browsers.one) public void htmlpAppletXhtmlpApplet() throws Exception { //others really do if ((server.getBrowserLocation().endsWith("midori") || server.getBrowserLocation().endsWith("epiphany"))) { return; } if (server.getBrowserLocation().endsWith(ServerAccess.UNSET_BROWSER)) { return; } ProcessResult[] results = executeSingleInstanceCheck(htmlpApplet, htmlpApplet); String id = "htmlpAppletXhtmlpApplet"; evaluateFirstInstance(results[0], id); //the first browser is consuming all the output evaluateSecondInstance(results[0], id); } @Test @NeedsDisplay @TestInBrowsers(testIn = Browsers.one) public void htmlJnlpHrefAppletXhtmlJnlpHrefApplet() throws Exception { //others really do if ((server.getBrowserLocation().endsWith("midori") || server.getBrowserLocation().endsWith("epiphany"))) { return; } if (server.getBrowserLocation().endsWith(ServerAccess.UNSET_BROWSER)) { return; } ProcessResult[] results = executeSingleInstanceCheck(htmlJnlpHrefApplet, htmlJnlpHrefApplet); String id = "htmlJnlpHrefAppletXhtmlJnlpHrefApplet"; evaluateFirstInstance(results[0], id); //the first browser is consuming all the output evaluateSecondInstance(results[0], id); } @Test public void jnlpApplicationXjnlpApplication() throws Exception { ProcessResult[] results = executeSingleInstanceCheck(jnlpApplication, jnlpApplication); String id = "jnlpApplicationXjnlpApplication"; evaluateFirstInstance(results[0], id); evaluateSecondInstance(results[1], id); } @Test @NeedsDisplay public void jnlpAppleXjnlpApplet() throws Exception { ProcessResult[] results = executeSingleInstanceCheck(jnlpApplet, jnlpApplet); String id = "jnlpAppleXjnlpApplet"; evaluateFirstInstance(results[0], id); evaluateSecondInstance(results[1], id); } public static void main(String[] args) throws Exception { new SingleInstanceTest().main(); } /** * This "test" is testing all possible variations of launches. * However html x jnlp (or vice versa) tests are failing * I do not suppose this should ever happen in real life, so I'm not including this as @KnownToFail * See the list of results on below for couriosity ;) * *Passed /SingleInstanceTest.jnlp x /SingleInstanceTest.jnlp *Passed /SingleInstanceTest.jnlp x /SingleInstanceTestWS.jnlp *FAILED /SingleInstanceTest.jnlp x /SingleInstanceTest_jnlpHref.html - java.lang.AssertionError: SingleInstanceTest.main's first PR stdout should contain Parameters received by SingleInstanceChecker but didn't *FAILED /SingleInstanceTest.jnlp x /SingleInstanceTest_clasical.html - java.lang.AssertionError: SingleInstanceTest.main's first PR stdout should contain Parameters received by SingleInstanceChecker but didn't *Passed /SingleInstanceTestWS.jnlp x /SingleInstanceTest.jnlp *Passed /SingleInstanceTestWS.jnlp x /SingleInstanceTestWS.jnlp *java.lang.NoSuchMethodException: SingleInstanceTest.access$000() *FAILED /SingleInstanceTestWS.jnlp x /SingleInstanceTest_jnlpHref.html - java.lang.AssertionError: SingleInstanceTest.main's first PR stdout should contain Parameters received by SingleInstanceChecker but didn't *FAILED /SingleInstanceTestWS.jnlp x /SingleInstanceTest_clasical.html - java.lang.AssertionError: SingleInstanceTest.main's first PR stdout should contain Parameters received by SingleInstanceChecker but didn't *FAILED /SingleInstanceTest_jnlpHref.html x /SingleInstanceTest.jnlp - java.lang.AssertionError: SingleInstanceTest.main's first PR stdout should contain Parameters received by SingleInstanceChecker but didn't *FAILED /SingleInstanceTest_jnlpHref.html x /SingleInstanceTestWS.jnlp - java.lang.AssertionError: SingleInstanceTest.main's first PR stdout should contain Parameters received by SingleInstanceChecker but didn't *Passed /SingleInstanceTest_jnlpHref.html x /SingleInstanceTest_jnlpHref.html *FAILED /SingleInstanceTest_jnlpHref.html x /SingleInstanceTest_clasical.html - java.lang.AssertionError: SingleInstanceTest.main's first PR stdout should contain Parameters received by SingleInstanceChecker but didn't *FAILED /SingleInstanceTest_clasical.html x /SingleInstanceTest.jnlp - java.lang.AssertionError: SingleInstanceTest.main's first PR stdout should contain Parameters received by SingleInstanceChecker but didn't *FAILED /SingleInstanceTest_clasical.html x /SingleInstanceTestWS.jnlp - java.lang.AssertionError: SingleInstanceTest.main's first PR stdout should contain Parameters received by SingleInstanceChecker but didn't *FAILED /SingleInstanceTest_clasical.html x /SingleInstanceTest_jnlpHref.html - java.lang.AssertionError: SingleInstanceTest.main's first PR stdout should contain Parameters received by SingleInstanceChecker but didn't *Passed /SingleInstanceTest_clasical.html x /SingleInstanceTest_clasical.html */ public void main() throws Exception { //just for fun try all not so probable cominations String[] args = new String[]{jnlpApplet, jnlpApplication, htmlJnlpHrefApplet, htmlpApplet}; //normally handled by annotation server.setCurrentBrowser(BrowserFactory.getFactory().getRandom()); for (int i = 0; i < args.length; i++) { String app1 = args[i]; for (int j = 0; j < args.length; j++) { String app2 = args[j]; try { ProcessResult[] results = executeSingleInstanceCheck(app1, app2); evaluateFirstInstance(results[0], "main"); if (bothHtml(app1, app2)) { evaluateSecondInstance(results[0], "main"); } else { evaluateSecondInstance(results[1], "main"); } System.out.println("Passed " + app1 + " x " + app2); } catch (Error ex) { System.out.println("FAILED " + app1 + " x " + app2 + " - " + ex.toString()); //ex.printStackTrace(); } } } } } icedtea-web-1.6.2/tests/reproducers/simple/SingleInstanceServiceTest/PaxHeaders.17941/srcs0000644000000000000000000000013212654402377026421 xustar0030 mtime=1454507263.223432768 30 atime=1454507658.779157357 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/SingleInstanceServiceTest/srcs/0000755000175000002070000000000012654402377027221 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/SingleInstanceServiceTest/srcs/PaxHeaders.17941/SingleIns0000644000000000000000000000013212654402377030314 xustar0030 mtime=1454507263.223432768 30 atime=1454507327.338577683 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/SingleInstanceServiceTest/srcs/SingleInstanceChecker.java0000644000175000002070000001213112654402377034255 0ustar00jvanekmock00000000000000/* SingleInstanceChecker.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.applet.Applet; import javax.jnlp.SingleInstanceListener; import javax.jnlp.SingleInstanceService; import javax.jnlp.ServiceManager; import javax.jnlp.UnavailableServiceException; public class SingleInstanceChecker extends Applet implements SingleInstanceListener { private SingleInstanceChecker self; Killer killer; private static class Killer extends Thread { private int timeout; private String timeoutText; public Killer() { timeout = 5000; timeoutText = Integer.toString(timeout); } public Killer(int n) { timeout = n; timeoutText = Integer.toString(timeout); } public Killer(int n, String s) { timeout = n; timeoutText = s; } @Override public void run() { try { Thread.sleep(timeout); System.out.println("Applet killing itself after " + timeoutText + " ms of life"); System.exit(0); } catch (Exception ex) { } } } public SingleInstanceChecker() { self = this; } private void proceed() { try { SingleInstanceService testService = (SingleInstanceService) ServiceManager.lookup("javax.jnlp.SingleInstanceService"); System.out.println("SingleInstanceChecker: Adding listener to service."); testService.addSingleInstanceListener(this); System.out.println("SingleInstanceChecker: Listener added."); } catch (UnavailableServiceException use) { System.err.println("SingleInstanceChecker: Service lookup failed."); use.printStackTrace(); } finally { new Thread(new Runnable() { @Override public void run() { try { Thread.sleep(5000); } catch (Exception ex) { ex.printStackTrace(); } finally { startKiller(2); } } }).start(); } } //killer is started when params are received, or when application is running to long private void startKiller(int a) { synchronized (self) { if (killer == null) { if (a == 2) { killer = new Killer(5000, "10000"); killer.start(); } else { killer = new Killer(5000); killer.start(); } } } } @Override public void newActivation(String[] params) { String paramsString = ""; for (String param : params) { paramsString += " "+param; } System.out.println("Parameters received by SingleInstanceChecker:" + paramsString); startKiller(1); } @Override public void start() { System.out.print("Parameters received by during launch:"); for (int i=1; i<10; i++ ) { String s=getParameter("p"+i); if (s!=null){ System.out.print(" "+s); } } System.out.println(); proceed(); } public static void main(String[] args) { System.out.print("Parameters received by during launch:"); for (String string : args) { System.out.print(" "+string); } System.out.println(); new SingleInstanceChecker().proceed(); } } icedtea-web-1.6.2/tests/reproducers/simple/SingleInstanceServiceTest/PaxHeaders.17941/resources0000644000000000000000000000013212654402377027461 xustar0030 mtime=1454507263.222432781 30 atime=1454507658.779157357 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/SingleInstanceServiceTest/resources/0000755000175000002070000000000012654402377030261 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/SingleInstanceServiceTest/resources/PaxHeaders.17941/Sing0000644000000000000000000000032312654402377030363 xustar00121 path=icedtea-web-1.6.2/tests/reproducers/simple/SingleInstanceServiceTest/resources/SingleInstanceTest_jnlpHref.html 30 mtime=1454507263.222432781 30 atime=1454507327.338577683 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/SingleInstanceServiceTest/resources/SingleInstanceTest_jn0000644000175000002070000000362712654402377034451 0ustar00jvanekmock00000000000000 icedtea-web-1.6.2/tests/reproducers/simple/SingleInstanceServiceTest/resources/PaxHeaders.17941/Sing0000644000000000000000000000032312654402377030363 xustar00121 path=icedtea-web-1.6.2/tests/reproducers/simple/SingleInstanceServiceTest/resources/SingleInstanceTest_clasical.html 30 mtime=1454507263.222432781 30 atime=1454507327.338577683 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/SingleInstanceServiceTest/resources/SingleInstanceTest_cl0000644000175000002070000000370712654402377034437 0ustar00jvanekmock00000000000000 icedtea-web-1.6.2/tests/reproducers/simple/SingleInstanceServiceTest/resources/PaxHeaders.17941/Sing0000644000000000000000000000031412654402377030363 xustar00114 path=icedtea-web-1.6.2/tests/reproducers/simple/SingleInstanceServiceTest/resources/SingleInstanceTestWS.jnlp 30 mtime=1454507263.222432781 30 atime=1454507327.338577683 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/SingleInstanceServiceTest/resources/SingleInstanceTestWS.0000644000175000002070000000437612654402377034314 0ustar00jvanekmock00000000000000 SingleInstanceAppletWS IcedTea SingleInstanceAppletWS v7 v8 icedtea-web-1.6.2/tests/reproducers/simple/SingleInstanceServiceTest/resources/PaxHeaders.17941/Sing0000644000000000000000000000031212654402377030361 xustar00112 path=icedtea-web-1.6.2/tests/reproducers/simple/SingleInstanceServiceTest/resources/SingleInstanceTest.jnlp 30 mtime=1454507263.222432781 30 atime=1454507327.338577683 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/SingleInstanceServiceTest/resources/SingleInstanceTest.jn0000644000175000002070000000454112654402377034364 0ustar00jvanekmock00000000000000 SingleInstanceApplet IcedTea SingleInstanceApplet icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/SimpleApplet0000644000000000000000000000013212654402377022757 xustar0030 mtime=1454507263.221432794 30 atime=1454507658.779157357 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/SimpleApplet/0000755000175000002070000000000012654402377023557 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/SimpleApplet/PaxHeaders.17941/srcs0000644000000000000000000000013212654402377023731 xustar0030 mtime=1454507263.221432794 30 atime=1454507658.779157357 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/SimpleApplet/srcs/0000755000175000002070000000000012654402377024531 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/SimpleApplet/srcs/PaxHeaders.17941/SimpleApplet.java0000644000000000000000000000013212654402377027250 xustar0030 mtime=1454507263.221432794 30 atime=1454507327.338577683 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/SimpleApplet/srcs/SimpleApplet.java0000644000175000002070000000346512654402377030003 0ustar00jvanekmock00000000000000/* SimpleApplet.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.applet.Applet; @SuppressWarnings("serial") public class SimpleApplet extends Applet { @Override public void start() { System.out.println("*** APPLET FINISHED ***"); } } icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/SetContextClassLoader0000644000000000000000000000013212654402377024575 xustar0030 mtime=1454507263.221432794 30 atime=1454507658.779157357 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/SetContextClassLoader/0000755000175000002070000000000012654402377025375 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/SetContextClassLoader/PaxHeaders.17941/testcases0000644000000000000000000000013212654402377026573 xustar0030 mtime=1454507263.221432794 30 atime=1454507658.779157357 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/SetContextClassLoader/testcases/0000755000175000002070000000000012654402377027373 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/SetContextClassLoader/testcases/PaxHeaders.17941/SetConte0000644000000000000000000000031512654402377030322 xustar00115 path=icedtea-web-1.6.2/tests/reproducers/simple/SetContextClassLoader/testcases/SetContextClassLoaderTest.java 30 mtime=1454507263.221432794 30 atime=1454507327.337577696 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/SetContextClassLoader/testcases/SetContextClassLoaderTest0000644000175000002070000000506712654402377034403 0ustar00jvanekmock00000000000000/* SetContextClassLoaderTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import org.junit.Assert; import org.junit.Test; public class SetContextClassLoaderTest { private static ServerAccess server = new ServerAccess(); @Test public void SetContextClassLoader1() throws Exception { ProcessResult pr = server.executeJavawsHeadless(null, "/SetContextClassLoader.jnlp"); String s = "(?s).*java.security.AccessControlException.{0,5}access denied.{0,5}java.lang.RuntimePermission.{0,5}" + "setContextClassLoader" + ".*"; Assert.assertTrue("stderr should match "+s+" but didn't",pr.stderr.matches(s)); String cc="ClassNotFoundException"; Assert.assertFalse("stderr should NOT contains `"+cc+"`, but did",pr.stderr.contains(cc)); Assert.assertFalse("SetContextClassLoader1 should not be terminated, but was",pr.wasTerminated); Assert.assertEquals((Integer) 0, pr.returnValue); } } icedtea-web-1.6.2/tests/reproducers/simple/SetContextClassLoader/PaxHeaders.17941/srcs0000644000000000000000000000013212654402377025547 xustar0030 mtime=1454507263.221432794 30 atime=1454507658.779157357 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/SetContextClassLoader/srcs/0000755000175000002070000000000012654402377026347 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/SetContextClassLoader/srcs/PaxHeaders.17941/SetContextCla0000644000000000000000000000013212654402377030267 xustar0030 mtime=1454507263.221432794 30 atime=1454507327.337577696 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/SetContextClassLoader/srcs/SetContextClassLoader.java0000644000175000002070000000344512654402377033435 0ustar00jvanekmock00000000000000/* SetContextClassLoader.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class SetContextClassLoader { public static void main(String[] args) throws Exception{ Thread.currentThread().setContextClassLoader(null); } } icedtea-web-1.6.2/tests/reproducers/simple/SetContextClassLoader/PaxHeaders.17941/resources0000644000000000000000000000013212654402377026607 xustar0030 mtime=1454507263.220432808 30 atime=1454507658.779157357 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/SetContextClassLoader/resources/0000755000175000002070000000000012654402377027407 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/SetContextClassLoader/resources/PaxHeaders.17941/SetConte0000644000000000000000000000031112654402377030332 xustar00111 path=icedtea-web-1.6.2/tests/reproducers/simple/SetContextClassLoader/resources/SetContextClassLoader.jnlp 30 mtime=1454507263.220432808 30 atime=1454507327.337577696 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/SetContextClassLoader/resources/SetContextClassLoader.jnl0000644000175000002070000000400612654402377034331 0ustar00jvanekmock00000000000000 set context classloader IcedTea icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/SandboxUnsignedSandbox0000644000000000000000000000013212654402377024772 xustar0030 mtime=1454507263.220432808 30 atime=1454507658.779157357 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedSandbox/0000755000175000002070000000000012654402377025572 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedSandbox/PaxHeaders.17941/testcases0000644000000000000000000000013212654402377026770 xustar0030 mtime=1454507263.220432808 30 atime=1454507658.779157357 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedSandbox/testcases/0000755000175000002070000000000012654402377027570 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedSandbox/testcases/PaxHeaders.17941/Sandbox0000644000000000000000000000031712654402377030373 xustar00117 path=icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedSandbox/testcases/SandboxUnsignedSandboxTest.java 30 mtime=1454507263.220432808 30 atime=1454507327.337577696 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedSandbox/testcases/SandboxUnsignedSandboxTe0000644000175000002070000001312212654402377034415 0ustar00jvanekmock00000000000000 import java.io.IOException; import java.util.Arrays; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import static net.sourceforge.jnlp.browsertesting.BrowserTest.server; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.AutoErrorClosingListener; import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; import net.sourceforge.jnlp.closinglisteners.StringBasedClosingListener; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.ManifestAttributesChecker; import net.sourceforge.jnlp.tools.DeploymentPropertiesModifier; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; /* AppletTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class SandboxUnsignedSandboxTest extends BrowserTest { private static final DeploymentPropertiesModifier dpm = new DeploymentPropertiesModifier(); private static final StringBasedClosingListener aok = new AutoOkClosingListener(); private static final StringBasedClosingListener aer = new AutoErrorClosingListener(); private static final String confirmation = "*** applet running ***"; @BeforeClass public static void setDeploymentManifestPermissionReadingOnly() throws IOException{ dpm.setProperties(DeploymentConfiguration.KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK, ManifestAttributesChecker.MANIFEST_ATTRIBUTES_CHECK.PERMISSIONS.toString()); } @AfterClass public static void restoreDeploymentProeprtiees() throws IOException{ dpm.restoreProperties(); } @Test public void javawsAllPermNoSecurity() throws Exception{ ProcessResult p = server.executeJavawsHeadless("SandboxUnsignedSandbox.jnlp"); Assert.assertTrue(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } @Test public void javawsAllPermAllSecurity() throws Exception{ ProcessResult p = server.executeJavawsHeadless("SandboxUnsignedSandbox_security.jnlp"); Assert.assertFalse(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } @Test public void javawsAppletAllPermNoSecurity() throws Exception{ ProcessResult p = server.executeJavaws(Arrays.asList(new String[]{"-headless", "-verbose"}),"SandboxUnsignedSandbox_applet.jnlp", new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition()));//applets have exception flused only in verbose mode? strange... } @Test public void javawsAppletAllPermAllSecurity() throws Exception{ ProcessResult p = server.executeJavawsHeadless("SandboxUnsignedSandbox_applet_security.jnlp", new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertFalse(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } @Test @TestInBrowsers(testIn = Browsers.one) public void appletAllPermAllSecurity() throws Exception{ server.getBrowserLocation(); ProcessResult p = server.executeBrowser("SandboxUnsignedSandbox.html", ServerAccess.AutoClose.CLOSE_ON_BOTH); Assert.assertTrue(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } } icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedSandbox/PaxHeaders.17941/srcs0000644000000000000000000000013212654402377025744 xustar0030 mtime=1454507263.220432808 30 atime=1454507658.779157357 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedSandbox/srcs/0000755000175000002070000000000012654402377026544 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedSandbox/srcs/PaxHeaders.17941/SandboxUnsig0000644000000000000000000000013212654402377030350 xustar0030 mtime=1454507263.220432808 30 atime=1454507327.337577696 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedSandbox/srcs/SandboxUnsignedSandbox.java0000644000175000002070000000406312654402377034024 0ustar00jvanekmock00000000000000 import java.applet.Applet; /* AppletTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class SandboxUnsignedSandbox extends Applet { @Override public void init() { confirm(); } public static void main(String... s) { confirm(); } private static void confirm() { System.out.println("*** applet running ***"); System.out.println(System.getProperty("user.home")); System.out.println("*** APPLET FINISHED ***"); } } icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedSandbox/srcs/PaxHeaders.17941/META-INF0000644000000000000000000000013212654402377027104 xustar0030 mtime=1454507263.219432821 30 atime=1454507658.779157357 30 ctime=1454507658.753157703 icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedSandbox/srcs/META-INF/0000755000175000002070000000000012654402377027704 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedSandbox/srcs/META-INF/PaxHeaders.17941/MAN0000644000000000000000000000013212654402377027517 xustar0030 mtime=1454507263.220432808 30 atime=1454507327.337577696 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedSandbox/srcs/META-INF/MANIFEST.MF0000644000175000002070000000005412654402377031335 0ustar00jvanekmock00000000000000Manifest-Version: 1.0 Permissions: sandbox icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedSandbox/PaxHeaders.17941/resources0000644000000000000000000000013212654402377027004 xustar0030 mtime=1454507263.219432821 30 atime=1454507658.779157357 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedSandbox/resources/0000755000175000002070000000000012654402377027604 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedSandbox/resources/PaxHeaders.17941/Sandbox0000644000000000000000000000032312654402377030404 xustar00122 path=icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedSandbox/resources/SandboxUnsignedSandbox_security.jnlp 30 mtime=1454507263.219432821 29 atime=1454507327.33657771 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedSandbox/resources/SandboxUnsignedSandbox_s0000644000175000002070000000436212654402377034470 0ustar00jvanekmock00000000000000 SandboxSignedMissing IcedTea SandboxUnsignedSandbox icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedSandbox/resources/PaxHeaders.17941/Sandbox0000644000000000000000000000033212654402377030404 xustar00129 path=icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedSandbox/resources/SandboxUnsignedSandbox_applet_security.jnlp 30 mtime=1454507263.219432821 29 atime=1454507327.33657771 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedSandbox/resources/SandboxUnsignedSandbox_a0000644000175000002070000000454112654402377034445 0ustar00jvanekmock00000000000000 SandboxSignedMissing IcedTea SandboxUnsignedSandbox icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedSandbox/resources/PaxHeaders.17941/Sandbox0000644000000000000000000000032112654402377030402 xustar00120 path=icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedSandbox/resources/SandboxUnsignedSandbox_applet.jnlp 30 mtime=1454507263.219432821 29 atime=1454507327.33657771 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedSandbox/resources/SandboxUnsignedSandbox_a0000644000175000002070000000444612654402377034451 0ustar00jvanekmock00000000000000 SandboxUnsignedSandbox IcedTea SandboxUnsignedSandbox icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedSandbox/resources/PaxHeaders.17941/Sandbox0000644000000000000000000000031212654402377030402 xustar00113 path=icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedSandbox/resources/SandboxUnsignedSandbox.jnlp 30 mtime=1454507263.218432834 29 atime=1454507327.33657771 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedSandbox/resources/SandboxUnsignedSandbox.j0000644000175000002070000000426612654402377034401 0ustar00jvanekmock00000000000000 SandboxUnsignedSandbox IcedTea SandboxUnsignedSandbox icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedSandbox/resources/PaxHeaders.17941/Sandbox0000644000000000000000000000031212654402377030402 xustar00113 path=icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedSandbox/resources/SandboxUnsignedSandbox.html 30 mtime=1454507263.218432834 29 atime=1454507327.33657771 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedSandbox/resources/SandboxUnsignedSandbox.h0000644000175000002070000000345112654402377034372 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/SandboxUnsignedMissing0000644000000000000000000000013212654402377025005 xustar0030 mtime=1454507263.218432834 30 atime=1454507658.779157357 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedMissing/0000755000175000002070000000000012654402377025605 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedMissing/PaxHeaders.17941/testcases0000644000000000000000000000013212654402377027003 xustar0030 mtime=1454507263.218432834 30 atime=1454507658.779157357 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedMissing/testcases/0000755000175000002070000000000012654402377027603 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedMissing/testcases/PaxHeaders.17941/Sandbox0000644000000000000000000000033312654402377030404 xustar00129 path=icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedMissing/testcases/SandboxUnsignedMissingTestHighSecurity.java 30 mtime=1454507263.218432834 30 atime=1454507327.335577723 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedMissing/testcases/SandboxUnsignedMissingTe0000644000175000002070000002174512654402377034455 0ustar00jvanekmock00000000000000 import java.io.IOException; import java.util.Arrays; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ProcessWrapper; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import static net.sourceforge.jnlp.browsertesting.BrowserTest.server; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.AutoErrorClosingListener; import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; import net.sourceforge.jnlp.closinglisteners.StringBasedClosingListener; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.ManifestAttributesChecker; import net.sourceforge.jnlp.security.appletextendedsecurity.AppletSecurityLevel; import net.sourceforge.jnlp.tools.DeploymentPropertiesModifier; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; /* AppletTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class SandboxUnsignedMissingTestHighSecurity extends BrowserTest { private static final DeploymentPropertiesModifier dpm1 = new DeploymentPropertiesModifier(); private static final DeploymentPropertiesModifier dpm2 = new DeploymentPropertiesModifier(); private static final StringBasedClosingListener aok = new AutoOkClosingListener(); private static final StringBasedClosingListener aer = new AutoErrorClosingListener(); private static final String confirmation = "*** applet running ***"; @BeforeClass public static void setDeploymentManifestPermissionReadingOnly() throws IOException{ dpm1.setProperties(DeploymentConfiguration.KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK, ManifestAttributesChecker.MANIFEST_ATTRIBUTES_CHECK.PERMISSIONS.toString()); dpm2.setProperties(DeploymentConfiguration.KEY_SECURITY_LEVEL, AppletSecurityLevel.ASK_UNSIGNED.toChars()); } @AfterClass public static void restoreDeploymentProeprtiees() throws IOException{ dpm2.restoreProperties(); dpm1.restoreProperties(); } @Test public void javawsAllPermNoSecurityYes() throws Exception{ ProcessWrapper pw = new ProcessWrapper(server.getJavawsLocation(), Arrays.asList("-headless"), server.getUrl("SandboxUnsignedMissing.jnlp")); pw.setWriter("YES\n"); ProcessResult p = pw.execute(); Assert.assertTrue(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } @Test public void javawsAllPermNoSecurityNo() throws Exception{ ProcessWrapper pw = new ProcessWrapper(server.getJavawsLocation(), Arrays.asList("-headless"), server.getUrl("SandboxUnsignedMissing.jnlp")); pw.setWriter("NO\n"); ProcessResult p = pw.execute(); Assert.assertFalse(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } @Test public void javawsAllPermAllSecurityYes() throws Exception{ ProcessWrapper pw = new ProcessWrapper(server.getJavawsLocation(), Arrays.asList("-headless"), server.getUrl("SandboxUnsignedMissing_security.jnlp")); pw.setWriter("YES\n"); ProcessResult p = pw.execute(); Assert.assertFalse(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } @Test public void javawsAllPermAllSecurityNo() throws Exception{ ProcessWrapper pw = new ProcessWrapper(server.getJavawsLocation(), Arrays.asList("-headless"), server.getUrl("SandboxUnsignedMissing_security.jnlp")); pw.setWriter("NO\n"); ProcessResult p = pw.execute(); Assert.assertFalse(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } @Test public void javawsAppletAllPermNoSecurityYes() throws Exception{ ProcessWrapper pw = new ProcessWrapper(server.getJavawsLocation(), Arrays.asList("-headless", "-verbose"), server.getUrl("SandboxUnsignedMissing_applet.jnlp")); pw.addStdOutListener(new AutoOkClosingListener()); pw.setWriter("YES\n"); ProcessResult p = pw.execute(); Assert.assertTrue(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition()));//applets have exception flused only in verbose mode? strange... } @Test public void javawsAppletAllPermNoSecurityNo() throws Exception{ ProcessWrapper pw = new ProcessWrapper(server.getJavawsLocation(), Arrays.asList("-headless", "-verbose"), server.getUrl("SandboxUnsignedMissing_applet.jnlp")); pw.addStdErrListener(new AutoErrorClosingListener()); pw.addStdOutListener(new AutoOkClosingListener()); pw.setWriter("NO\n"); ProcessResult p = pw.execute(); Assert.assertFalse(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition()));//applets have exception flused only in verbose mode? strange... } @Test public void javawsAppletAllPermAllSecurityYes() throws Exception{ ProcessWrapper pw = new ProcessWrapper(server.getJavawsLocation(), Arrays.asList("-headless"), server.getUrl("SandboxUnsignedMissing_applet_security.jnlp")); pw.addStdOutListener(new AutoOkClosingListener()); pw.setWriter("YES\n"); ProcessResult p = pw.execute(); Assert.assertFalse(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } @Test public void javawsAppletAllPermAllSecurityNo() throws Exception{ ProcessWrapper pw = new ProcessWrapper(server.getJavawsLocation(), Arrays.asList("-headless"), server.getUrl("SandboxUnsignedMissing_applet_security.jnlp")); pw.addStdErrListener(new AutoErrorClosingListener()); pw.addStdOutListener(new AutoOkClosingListener()); pw.setWriter("NO\n"); ProcessResult p = pw.execute(); Assert.assertFalse(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } //browser do not support headless dialogues //@Test //@TestInBrowsers(testIn = Browsers.one) public void appletAllPermAllSecurity() throws Exception{ server.getBrowserLocation(); ProcessResult p = server.executeBrowser("SandboxUnsignedMissing.html", ServerAccess.AutoClose.CLOSE_ON_BOTH); Assert.assertTrue(p.stdout.contains(confirmation)); Assert.assertTrue(p.stdout.contains(aok.getCondition())); Assert.assertFalse(p.stderr.contains(aer.getCondition())); } } icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedMissing/testcases/PaxHeaders.17941/Sandbox0000644000000000000000000000031712654402377030406 xustar00117 path=icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedMissing/testcases/SandboxUnsignedMissingTest.java 30 mtime=1454507263.218432834 30 atime=1454507327.335577723 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedMissing/testcases/SandboxUnsignedMissingTe0000644000175000002070000001365412654402377034455 0ustar00jvanekmock00000000000000 import java.io.IOException; import java.util.Arrays; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import static net.sourceforge.jnlp.browsertesting.BrowserTest.server; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.AutoErrorClosingListener; import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; import net.sourceforge.jnlp.closinglisteners.StringBasedClosingListener; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.ManifestAttributesChecker; import net.sourceforge.jnlp.security.appletextendedsecurity.AppletSecurityLevel; import net.sourceforge.jnlp.tools.DeploymentPropertiesModifier; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; /* AppletTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class SandboxUnsignedMissingTest extends BrowserTest { private static final DeploymentPropertiesModifier dpm1 = new DeploymentPropertiesModifier(); private static final DeploymentPropertiesModifier dpm2 = new DeploymentPropertiesModifier(); private static final StringBasedClosingListener aok = new AutoOkClosingListener(); private static final StringBasedClosingListener aer = new AutoErrorClosingListener(); private static final String confirmation = "*** applet running ***"; @BeforeClass public static void setDeploymentManifestPermissionReadingOnly() throws IOException{ dpm1.setProperties(DeploymentConfiguration.KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK, ManifestAttributesChecker.MANIFEST_ATTRIBUTES_CHECK.PERMISSIONS.toString()); dpm2.setProperties(DeploymentConfiguration.KEY_SECURITY_LEVEL, AppletSecurityLevel.ALLOW_UNSIGNED.toChars()); } @AfterClass public static void restoreDeploymentProeprtiees() throws IOException{ dpm2.restoreProperties(); dpm1.restoreProperties(); } @Test public void javawsAllPermNoSecurity() throws Exception{ ProcessResult p = server.executeJavawsHeadless("SandboxUnsignedMissing.jnlp"); Assert.assertTrue(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } @Test public void javawsAllPermAllSecurity() throws Exception{ ProcessResult p = server.executeJavawsHeadless("SandboxUnsignedMissing_security.jnlp"); Assert.assertFalse(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } @Test public void javawsAppletAllPermNoSecurity() throws Exception{ ProcessResult p = server.executeJavaws(Arrays.asList(new String[]{"-headless", "-verbose"}),"SandboxUnsignedMissing_applet.jnlp", new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition()));//applets have exception flused only in verbose mode? strange... } @Test public void javawsAppletAllPermAllSecurity() throws Exception{ ProcessResult p = server.executeJavawsHeadless("SandboxUnsignedMissing_applet_security.jnlp", new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertFalse(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } @Test @TestInBrowsers(testIn = Browsers.one) public void appletAllPermAllSecurity() throws Exception{ server.getBrowserLocation(); ProcessResult p = server.executeBrowser("SandboxUnsignedMissing.html", ServerAccess.AutoClose.CLOSE_ON_BOTH); Assert.assertTrue(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } } icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedMissing/PaxHeaders.17941/srcs0000644000000000000000000000013212654402377025757 xustar0030 mtime=1454507263.217432848 30 atime=1454507658.779157357 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedMissing/srcs/0000755000175000002070000000000012654402377026557 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedMissing/srcs/PaxHeaders.17941/SandboxUnsig0000644000000000000000000000013212654402377030363 xustar0030 mtime=1454507263.217432848 30 atime=1454507327.335577723 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedMissing/srcs/SandboxUnsignedMissing.java0000644000175000002070000000406312654402377034052 0ustar00jvanekmock00000000000000 import java.applet.Applet; /* AppletTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class SandboxUnsignedMissing extends Applet { @Override public void init() { confirm(); } public static void main(String... s) { confirm(); } private static void confirm() { System.out.println("*** applet running ***"); System.out.println(System.getProperty("user.home")); System.out.println("*** APPLET FINISHED ***"); } } icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedMissing/srcs/PaxHeaders.17941/META-INF0000644000000000000000000000013212654402377027117 xustar0030 mtime=1454507263.217432848 30 atime=1454507658.779157357 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedMissing/srcs/META-INF/0000755000175000002070000000000012654402377027717 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedMissing/srcs/META-INF/PaxHeaders.17941/MAN0000644000000000000000000000013212654402377027532 xustar0030 mtime=1454507263.217432848 30 atime=1454507327.335577723 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedMissing/srcs/META-INF/MANIFEST.MF0000644000175000002070000000002712654402377031350 0ustar00jvanekmock00000000000000Manifest-Version: 1.0 icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedMissing/PaxHeaders.17941/resources0000644000000000000000000000013212654402377027017 xustar0030 mtime=1454507263.217432848 30 atime=1454507658.779157357 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedMissing/resources/0000755000175000002070000000000012654402377027617 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedMissing/resources/PaxHeaders.17941/Sandbox0000644000000000000000000000032412654402377030420 xustar00122 path=icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedMissing/resources/SandboxUnsignedMissing_security.jnlp 30 mtime=1454507263.217432848 30 atime=1454507327.335577723 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedMissing/resources/SandboxUnsignedMissing_s0000644000175000002070000000436412654402377034520 0ustar00jvanekmock00000000000000 SandboxUnsignedMissing IcedTea SandboxUnsignedMissing icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedMissing/resources/PaxHeaders.17941/Sandbox0000644000000000000000000000033312654402377030420 xustar00129 path=icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedMissing/resources/SandboxUnsignedMissing_applet_security.jnlp 30 mtime=1454507263.217432848 30 atime=1454507327.335577723 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedMissing/resources/SandboxUnsignedMissing_a0000644000175000002070000000454712654402377034501 0ustar00jvanekmock00000000000000 SandboxUnsignedMissing IcedTea SandboxUnsignedMissing icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedMissing/resources/PaxHeaders.17941/Sandbox0000644000000000000000000000032212654402377030416 xustar00120 path=icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedMissing/resources/SandboxUnsignedMissing_applet.jnlp 30 mtime=1454507263.216432861 30 atime=1454507327.334577736 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedMissing/resources/SandboxUnsignedMissing_a0000644000175000002070000000445112654402377034473 0ustar00jvanekmock00000000000000 SandboxUnsignedMissing IcedTea SandboxUnsignedMissing icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedMissing/resources/PaxHeaders.17941/Sandbox0000644000000000000000000000031312654402377030416 xustar00113 path=icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedMissing/resources/SandboxUnsignedMissing.jnlp 30 mtime=1454507263.216432861 30 atime=1454507327.334577736 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedMissing/resources/SandboxUnsignedMissing.j0000644000175000002070000000426612654402377034427 0ustar00jvanekmock00000000000000 SandboxUnsignedMissing IcedTea SandboxUnsignedMissing icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedMissing/resources/PaxHeaders.17941/Sandbox0000644000000000000000000000031312654402377030416 xustar00113 path=icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedMissing/resources/SandboxUnsignedMissing.html 30 mtime=1454507263.216432861 30 atime=1454507327.334577736 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedMissing/resources/SandboxUnsignedMissing.h0000644000175000002070000000345112654402377034420 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/SandboxUnsignedInvalid0000644000000000000000000000013212654402377024762 xustar0030 mtime=1454507263.215432874 30 atime=1454507658.779157357 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedInvalid/0000755000175000002070000000000012654402377025562 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedInvalid/PaxHeaders.17941/testcases0000644000000000000000000000013212654402377026760 xustar0030 mtime=1454507263.215432874 30 atime=1454507658.779157357 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedInvalid/testcases/0000755000175000002070000000000012654402377027560 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedInvalid/testcases/PaxHeaders.17941/Sandbox0000644000000000000000000000031712654402377030363 xustar00117 path=icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedInvalid/testcases/SandboxUnsignedInvalidTest.java 30 mtime=1454507263.215432874 30 atime=1454507327.334577736 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedInvalid/testcases/SandboxUnsignedInvalidTe0000644000175000002070000001272012654402377034400 0ustar00jvanekmock00000000000000 import java.io.IOException; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import static net.sourceforge.jnlp.browsertesting.BrowserTest.server; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.AutoErrorClosingListener; import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; import net.sourceforge.jnlp.closinglisteners.StringBasedClosingListener; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.ManifestAttributesChecker; import net.sourceforge.jnlp.tools.DeploymentPropertiesModifier; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; /* AppletTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class SandboxUnsignedInvalidTest extends BrowserTest { private static final DeploymentPropertiesModifier dpm = new DeploymentPropertiesModifier(); private static final StringBasedClosingListener aok = new AutoOkClosingListener(); private static final StringBasedClosingListener aer = new AutoErrorClosingListener(); private static final String confirmation = "*** applet running ***"; @BeforeClass public static void setDeploymentManifestPermissionReadingOnly() throws IOException{ dpm.setProperties(DeploymentConfiguration.KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK, ManifestAttributesChecker.MANIFEST_ATTRIBUTES_CHECK.PERMISSIONS.toString()); } @AfterClass public static void restoreDeploymentProeprtiees() throws IOException{ dpm.restoreProperties(); } @Test public void javawsAllPermNoSecurity() throws Exception{ ProcessResult p = server.executeJavawsHeadless("SandboxUnsignedInvalid.jnlp"); Assert.assertFalse(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } @Test public void javawsAllPermAllSecurity() throws Exception{ ProcessResult p = server.executeJavawsHeadless("SandboxUnsignedInvalid_security.jnlp"); Assert.assertFalse(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } @Test public void javawsAppletAllPermNoSecurity() throws Exception{ ProcessResult p = server.executeJavawsHeadless("SandboxUnsignedInvalid_applet.jnlp", new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertFalse(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } @Test public void javawsAppletAllPermAllSecurity() throws Exception{ ProcessResult p = server.executeJavawsHeadless("SandboxUnsignedInvalid_applet_security.jnlp", new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertFalse(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } @Test @TestInBrowsers(testIn = Browsers.one) public void appletAllPermAllSecurity() throws Exception{ server.getBrowserLocation(); ProcessResult p = server.executeBrowser("SandboxUnsignedInvalid.html", ServerAccess.AutoClose.CLOSE_ON_BOTH); Assert.assertFalse(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } } icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedInvalid/PaxHeaders.17941/srcs0000644000000000000000000000013212654402377025734 xustar0030 mtime=1454507263.215432874 30 atime=1454507658.779157357 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedInvalid/srcs/0000755000175000002070000000000012654402377026534 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedInvalid/srcs/PaxHeaders.17941/SandboxUnsig0000644000000000000000000000013212654402377030340 xustar0030 mtime=1454507263.215432874 30 atime=1454507327.334577736 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedInvalid/srcs/SandboxUnsignedInvalid.java0000644000175000002070000000406312654402377034004 0ustar00jvanekmock00000000000000 import java.applet.Applet; /* AppletTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class SandboxUnsignedInvalid extends Applet { @Override public void init() { confirm(); } public static void main(String... s) { confirm(); } private static void confirm() { System.out.println("*** applet running ***"); System.out.println(System.getProperty("user.home")); System.out.println("*** APPLET FINISHED ***"); } } icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedInvalid/srcs/PaxHeaders.17941/META-INF0000644000000000000000000000013212654402377027074 xustar0030 mtime=1454507263.215432874 30 atime=1454507658.779157357 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedInvalid/srcs/META-INF/0000755000175000002070000000000012654402377027674 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedInvalid/srcs/META-INF/PaxHeaders.17941/MAN0000644000000000000000000000013212654402377027507 xustar0030 mtime=1454507263.215432874 30 atime=1454507327.334577736 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedInvalid/srcs/META-INF/MANIFEST.MF0000644000175000002070000000006112654402377031323 0ustar00jvanekmock00000000000000Manifest-Version: 1.0 Permissions: invalidValue icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedInvalid/PaxHeaders.17941/resources0000644000000000000000000000013212654402377026774 xustar0030 mtime=1454507263.215432874 30 atime=1454507658.779157357 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedInvalid/resources/0000755000175000002070000000000012654402377027574 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedInvalid/resources/PaxHeaders.17941/Sandbox0000644000000000000000000000032412654402377030375 xustar00122 path=icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedInvalid/resources/SandboxUnsignedInvalid_security.jnlp 30 mtime=1454507263.215432874 30 atime=1454507327.333577749 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedInvalid/resources/SandboxUnsignedInvalid_s0000644000175000002070000000436212654402377034450 0ustar00jvanekmock00000000000000 SandboxSignedMissing IcedTea SandboxUnsignedInvalid icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedInvalid/resources/PaxHeaders.17941/Sandbox0000644000000000000000000000033312654402377030375 xustar00129 path=icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedInvalid/resources/SandboxUnsignedInvalid_applet_security.jnlp 30 mtime=1454507263.214432888 30 atime=1454507327.333577749 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedInvalid/resources/SandboxUnsignedInvalid_a0000644000175000002070000000454312654402377034427 0ustar00jvanekmock00000000000000 SandboxSignedMissing IcedTea SandboxUnsignedInvalid icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedInvalid/resources/PaxHeaders.17941/Sandbox0000644000000000000000000000032212654402377030373 xustar00120 path=icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedInvalid/resources/SandboxUnsignedInvalid_applet.jnlp 30 mtime=1454507263.214432888 30 atime=1454507327.333577749 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedInvalid/resources/SandboxUnsignedInvalid_a0000644000175000002070000000444712654402377034432 0ustar00jvanekmock00000000000000 SandboxUnsignedInvalid IcedTea SandboxUnsignedInvalid icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedInvalid/resources/PaxHeaders.17941/Sandbox0000644000000000000000000000031312654402377030373 xustar00113 path=icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedInvalid/resources/SandboxUnsignedInvalid.jnlp 30 mtime=1454507263.214432888 30 atime=1454507327.333577749 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedInvalid/resources/SandboxUnsignedInvalid.j0000644000175000002070000000426612654402377034361 0ustar00jvanekmock00000000000000 SandboxUnsignedInvalid IcedTea SandboxUnsignedInvalid icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedInvalid/resources/PaxHeaders.17941/Sandbox0000644000000000000000000000031312654402377030373 xustar00113 path=icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedInvalid/resources/SandboxUnsignedInvalid.html 30 mtime=1454507263.214432888 30 atime=1454507327.333577749 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedInvalid/resources/SandboxUnsignedInvalid.h0000644000175000002070000000345012654402377034351 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/SandboxUnsignedAllPerm0000644000000000000000000000013212654402377024730 xustar0030 mtime=1454507263.213432901 30 atime=1454507658.779157357 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedAllPerm/0000755000175000002070000000000012654402377025530 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedAllPerm/PaxHeaders.17941/testcases0000644000000000000000000000013212654402377026726 xustar0030 mtime=1454507263.213432901 30 atime=1454507658.779157357 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedAllPerm/testcases/0000755000175000002070000000000012654402377027526 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedAllPerm/testcases/PaxHeaders.17941/Sandbox0000644000000000000000000000031712654402377030331 xustar00117 path=icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedAllPerm/testcases/SandboxUnsignedAllPermTest.java 30 mtime=1454507263.213432901 30 atime=1454507327.332577763 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedAllPerm/testcases/SandboxUnsignedAllPermTe0000644000175000002070000001261012654402377034312 0ustar00jvanekmock00000000000000 import java.io.IOException; import java.util.Arrays; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.AutoErrorClosingListener; import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; import net.sourceforge.jnlp.closinglisteners.StringBasedClosingListener; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.ManifestAttributesChecker; import net.sourceforge.jnlp.tools.DeploymentPropertiesModifier; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; /* AppletTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class SandboxUnsignedAllPermTest extends BrowserTest { private static final DeploymentPropertiesModifier dpm = new DeploymentPropertiesModifier(); private static final StringBasedClosingListener aok = new AutoOkClosingListener(); private static final StringBasedClosingListener aer = new AutoErrorClosingListener(); private static final String confirmation = "*** applet running ***"; @BeforeClass public static void setDeploymentManifestPermissionReadingOnly() throws IOException { dpm.setProperties(DeploymentConfiguration.KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK, ManifestAttributesChecker.MANIFEST_ATTRIBUTES_CHECK.PERMISSIONS.toString()); } @AfterClass public static void restoreDeploymentProeprtiees() throws IOException { dpm.restoreProperties(); } @Test public void javawsAllPermNoSecurity() throws Exception { ProcessResult p = server.executeJavawsHeadless("SandboxUnsignedAllPerm.jnlp"); Assert.assertTrue(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } @Test public void javawsAllPermAllSecurity() throws Exception { ProcessResult p = server.executeJavawsHeadless("SandboxUnsignedAllPerm_security.jnlp"); Assert.assertFalse(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } @Test public void javawsAppletAllPermNoSecurity() throws Exception { ProcessResult p = server.executeJavaws(Arrays.asList(new String[]{"-headless", "-verbose"}), "SandboxUnsignedAllPerm_applet.jnlp", new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertTrue(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); //applets have exception flused only in verbose mode? strange... } @Test public void javawsAppletAllPermAllSecurity() throws Exception { ProcessResult p = server.executeJavawsHeadless("SandboxUnsignedAllPerm_applet_security.jnlp", new AutoOkClosingListener(), new AutoErrorClosingListener()); Assert.assertFalse(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } @Test @TestInBrowsers(testIn = Browsers.one) //or this one should fail public void appletAllPermAllSecurity() throws Exception { server.getBrowserLocation(); ProcessResult p = server.executeBrowser("SandboxUnsignedAllPerm.html", ServerAccess.AutoClose.CLOSE_ON_BOTH); Assert.assertTrue(p.stdout.contains(confirmation)); Assert.assertFalse(p.stdout.contains(aok.getCondition())); Assert.assertTrue(p.stderr.contains(aer.getCondition())); } } icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedAllPerm/PaxHeaders.17941/srcs0000644000000000000000000000013212654402377025702 xustar0030 mtime=1454507263.213432901 30 atime=1454507658.779157357 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedAllPerm/srcs/0000755000175000002070000000000012654402377026502 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedAllPerm/srcs/PaxHeaders.17941/SandboxUnsig0000644000000000000000000000013212654402377030306 xustar0030 mtime=1454507263.213432901 30 atime=1454507327.332577763 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedAllPerm/srcs/SandboxUnsignedAllPerm.java0000644000175000002070000000406312654402377033720 0ustar00jvanekmock00000000000000 import java.applet.Applet; /* AppletTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class SandboxUnsignedAllPerm extends Applet { @Override public void init() { confirm(); } public static void main(String... s) { confirm(); } private static void confirm() { System.out.println("*** applet running ***"); System.out.println(System.getProperty("user.home")); System.out.println("*** APPLET FINISHED ***"); } } icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedAllPerm/srcs/PaxHeaders.17941/META-INF0000644000000000000000000000013212654402377027042 xustar0030 mtime=1454507263.213432901 30 atime=1454507658.779157357 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedAllPerm/srcs/META-INF/0000755000175000002070000000000012654402377027642 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedAllPerm/srcs/META-INF/PaxHeaders.17941/MAN0000644000000000000000000000013212654402377027455 xustar0030 mtime=1454507263.213432901 30 atime=1454507327.332577763 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedAllPerm/srcs/META-INF/MANIFEST.MF0000644000175000002070000000006412654402377031274 0ustar00jvanekmock00000000000000Manifest-Version: 1.0 Permissions: all-permissions icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedAllPerm/PaxHeaders.17941/resources0000644000000000000000000000013212654402377026742 xustar0030 mtime=1454507263.213432901 30 atime=1454507658.779157357 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedAllPerm/resources/0000755000175000002070000000000012654402377027542 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedAllPerm/resources/PaxHeaders.17941/Sandbox0000644000000000000000000000032412654402377030343 xustar00122 path=icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedAllPerm/resources/SandboxUnsignedAllPerm_security.jnlp 30 mtime=1454507263.213432901 30 atime=1454507327.332577763 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedAllPerm/resources/SandboxUnsignedAllPerm_s0000644000175000002070000000436412654402377034366 0ustar00jvanekmock00000000000000 SandboxUnsignedAllPerm IcedTea SandboxUnsignedAllPerm icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedAllPerm/resources/PaxHeaders.17941/Sandbox0000644000000000000000000000033312654402377030343 xustar00129 path=icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedAllPerm/resources/SandboxUnsignedAllPerm_applet_security.jnlp 30 mtime=1454507263.212432914 30 atime=1454507327.332577763 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedAllPerm/resources/SandboxUnsignedAllPerm_a0000644000175000002070000000455112654402377034342 0ustar00jvanekmock00000000000000 SandboxUnsignedAllPerm IcedTea SandboxUnsignedAllPerm icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedAllPerm/resources/PaxHeaders.17941/Sandbox0000644000000000000000000000032212654402377030341 xustar00120 path=icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedAllPerm/resources/SandboxUnsignedAllPerm_applet.jnlp 30 mtime=1454507263.212432914 30 atime=1454507327.332577763 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedAllPerm/resources/SandboxUnsignedAllPerm_a0000644000175000002070000000443312654402377034341 0ustar00jvanekmock00000000000000 SandboxUnsignedAllPerm IcedTea SandboxUnsignedAllPerm icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedAllPerm/resources/PaxHeaders.17941/Sandbox0000644000000000000000000000031312654402377030341 xustar00113 path=icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedAllPerm/resources/SandboxUnsignedAllPerm.jnlp 30 mtime=1454507263.212432914 30 atime=1454507327.332577763 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedAllPerm/resources/SandboxUnsignedAllPerm.j0000644000175000002070000000426612654402377034275 0ustar00jvanekmock00000000000000 SandboxUnsignedAllPerm IcedTea SandboxUnsignedAllPerm icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedAllPerm/resources/PaxHeaders.17941/Sandbox0000644000000000000000000000031312654402377030341 xustar00113 path=icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedAllPerm/resources/SandboxUnsignedAllPerm.html 30 mtime=1454507263.212432914 30 atime=1454507327.331577776 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/SandboxUnsignedAllPerm/resources/SandboxUnsignedAllPerm.h0000644000175000002070000000345112654402377034266 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/ResizeApplet0000644000000000000000000000013212654402377022767 xustar0030 mtime=1454507263.211432928 30 atime=1454507658.779157357 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/ResizeApplet/0000755000175000002070000000000012654402377023567 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/ResizeApplet/PaxHeaders.17941/testcases0000644000000000000000000000013212654402377024765 xustar0030 mtime=1454507263.211432928 30 atime=1454507658.779157357 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/ResizeApplet/testcases/0000755000175000002070000000000012654402377025565 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/ResizeApplet/testcases/PaxHeaders.17941/ResizeAppletTests0000644000000000000000000000013212654402377030417 xustar0030 mtime=1454507263.211432928 30 atime=1454507327.331577776 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/ResizeApplet/testcases/ResizeAppletTests.java0000644000175000002070000000531112654402377032062 0ustar00jvanekmock00000000000000/* AppletTestTests.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import static org.junit.Assert.assertTrue; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess.AutoClose; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import org.junit.Test; public class ResizeAppletTests extends BrowserTest { void assertContains(String source, String message, String substring) { assertTrue(source + " should contain '" + substring + "' but did not!", message.contains(substring)); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void testResizing() throws Exception { ProcessResult pr = server.executeBrowser("/ResizeApplet.html", AutoClose.CLOSE_ON_CORRECT_END); assertContains("stdout", pr.stdout, AutoOkClosingListener.MAGICAL_OK_CLOSING_STRING); assertContains("stdout", pr.stdout, "Resizing to 500 by 500"); } } icedtea-web-1.6.2/tests/reproducers/simple/ResizeApplet/PaxHeaders.17941/srcs0000644000000000000000000000013212654402377023741 xustar0030 mtime=1454507263.211432928 30 atime=1454507658.779157357 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/ResizeApplet/srcs/0000755000175000002070000000000012654402377024541 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/ResizeApplet/srcs/PaxHeaders.17941/ResizeApplet.java0000644000000000000000000000013212654402377027270 xustar0030 mtime=1454507263.211432928 30 atime=1454507327.331577776 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/ResizeApplet/srcs/ResizeApplet.java0000644000175000002070000000475012654402377030021 0ustar00jvanekmock00000000000000 import java.applet.Applet; /* AppletTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class ResizeApplet extends Applet { /* Make sures the process is exited if we stall */ private static class StallTimeoutThread extends Thread { private static final int MILLISECONDS_TO_SLEEP = 5000; @Override public void run() { try { Thread.sleep(MILLISECONDS_TO_SLEEP); System.out.println("*** APPLET FINISHED ***"); } catch (InterruptedException ie) { } } } @Override public void init() { new StallTimeoutThread().start(); } /* Utility for Javascript-side */ public void print(String str) { System.out.println(str); } /* Utility for Javascript-side */ public synchronized void sleep(int time) { try { wait(time); } catch (InterruptedException e) { } } } icedtea-web-1.6.2/tests/reproducers/simple/ResizeApplet/PaxHeaders.17941/resources0000644000000000000000000000013212654402377025001 xustar0030 mtime=1454507263.211432928 30 atime=1454507658.779157357 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/ResizeApplet/resources/0000755000175000002070000000000012654402377025601 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/ResizeApplet/resources/PaxHeaders.17941/ResizeApplet.html0000644000000000000000000000013212654402377030353 xustar0030 mtime=1454507263.211432928 30 atime=1454507327.331577776 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/ResizeApplet/resources/ResizeApplet.html0000644000175000002070000000425012654402377031077 0ustar00jvanekmock00000000000000

icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/ReplaceSecurityManager0000644000000000000000000000013212654402377024756 xustar0030 mtime=1454507263.210432941 30 atime=1454507658.779157357 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/ReplaceSecurityManager/0000755000175000002070000000000012654402377025556 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/ReplaceSecurityManager/PaxHeaders.17941/testcases0000644000000000000000000000013212654402377026754 xustar0030 mtime=1454507263.210432941 30 atime=1454507658.779157357 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/ReplaceSecurityManager/testcases/0000755000175000002070000000000012654402377027554 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/ReplaceSecurityManager/testcases/PaxHeaders.17941/Replace0000644000000000000000000000031712654402377030334 xustar00117 path=icedtea-web-1.6.2/tests/reproducers/simple/ReplaceSecurityManager/testcases/ReplaceSecurityManagerTest.java 30 mtime=1454507263.210432941 30 atime=1454507327.331577776 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/ReplaceSecurityManager/testcases/ReplaceSecurityManagerTe0000644000175000002070000000510312654402377034365 0ustar00jvanekmock00000000000000/* ReplaceSecurityManagerTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import org.junit.Assert; import org.junit.Test; public class ReplaceSecurityManagerTest { private static ServerAccess server = new ServerAccess(); @Test public void ReplaceSecurityManagerLunch1() throws Exception { ProcessResult pr = server.executeJavawsHeadless(null, "/ReplaceSecurityManager.jnlp"); String s = "(?s).*java.security.AccessControlException.{0,5}access denied.{0,5}java.lang.RuntimePermission.{0,5}" + "setSecurityManager" + ".*"; Assert.assertTrue("stderr should match "+s+" but didn't",pr.stderr.matches(s)); String cc="ClassNotFoundException"; Assert.assertFalse("stderr should NOT contains `"+cc+"`, but did",pr.stderr.contains(cc)); Assert.assertFalse("ReplaceSecurityManagerLunch1 should not be terminated, but was",pr.wasTerminated); Assert.assertEquals((Integer) 0, pr.returnValue); } } icedtea-web-1.6.2/tests/reproducers/simple/ReplaceSecurityManager/PaxHeaders.17941/srcs0000644000000000000000000000013212654402377025730 xustar0030 mtime=1454507263.210432941 30 atime=1454507658.779157357 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/ReplaceSecurityManager/srcs/0000755000175000002070000000000012654402377026530 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/ReplaceSecurityManager/srcs/PaxHeaders.17941/ReplaceSecur0000644000000000000000000000013112654402377030304 xustar0030 mtime=1454507263.210432941 29 atime=1454507327.33057779 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/ReplaceSecurityManager/srcs/ReplaceSecurityManager.java0000644000175000002070000000343312654402377033774 0ustar00jvanekmock00000000000000/* ReplaceSecurityManager.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class ReplaceSecurityManager { public static void main(String[] args) throws Exception{ System.setSecurityManager(null); } } icedtea-web-1.6.2/tests/reproducers/simple/ReplaceSecurityManager/PaxHeaders.17941/resources0000644000000000000000000000013212654402377026770 xustar0030 mtime=1454507263.210432941 30 atime=1454507658.779157357 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/ReplaceSecurityManager/resources/0000755000175000002070000000000012654402377027570 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/ReplaceSecurityManager/resources/PaxHeaders.17941/Replace0000644000000000000000000000031212654402377030343 xustar00113 path=icedtea-web-1.6.2/tests/reproducers/simple/ReplaceSecurityManager/resources/ReplaceSecurityManager.jnlp 30 mtime=1454507263.210432941 29 atime=1454507327.33057779 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/ReplaceSecurityManager/resources/ReplaceSecurityManager.j0000644000175000002070000000376712654402377034356 0ustar00jvanekmock00000000000000 Test replacing security manager IcedTea icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/RedirectStreams0000644000000000000000000000013212654402377023460 xustar0030 mtime=1454507263.209432954 30 atime=1454507658.779157357 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/RedirectStreams/0000755000175000002070000000000012654402377024260 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/RedirectStreams/PaxHeaders.17941/testcases0000644000000000000000000000013212654402377025456 xustar0030 mtime=1454507263.209432954 30 atime=1454507658.779157357 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/RedirectStreams/testcases/0000755000175000002070000000000012654402377026256 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/RedirectStreams/testcases/PaxHeaders.17941/RedirectStream0000644000000000000000000000013112654402377030372 xustar0030 mtime=1454507263.209432954 29 atime=1454507327.33057779 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/RedirectStreams/testcases/RedirectStreamsTest.java0000644000175000002070000000501412654402377033061 0ustar00jvanekmock00000000000000/* RedirectStreamsTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import org.junit.Assert; import org.junit.Test; public class RedirectStreamsTest { private static ServerAccess server = new ServerAccess(); @Test public void RedirectStreamsTest1() throws Exception { ProcessResult pr = server.executeJavawsHeadless(null, "/RedirectStreams.jnlp"); String s = "(?s).*java.security.AccessControlException.{0,5}access denied.{0,5}java.lang.RuntimePermission.{0,5}" + "setIO" + ".*"; Assert.assertTrue("Stderr should match "+s+" but didn't",pr.stderr.matches(s)); String cc="ClassNotFoundException"; Assert.assertFalse("stderr should NOT contains `"+cc+"`, but did",pr.stderr.contains(cc)); Assert.assertFalse("RedirectStreams should not be terminated, but was",pr.wasTerminated); Assert.assertEquals((Integer) 0, pr.returnValue); } } icedtea-web-1.6.2/tests/reproducers/simple/RedirectStreams/PaxHeaders.17941/srcs0000644000000000000000000000013212654402377024432 xustar0030 mtime=1454507263.209432954 30 atime=1454507658.779157357 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/RedirectStreams/srcs/0000755000175000002070000000000012654402377025232 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/RedirectStreams/srcs/PaxHeaders.17941/RedirectStreams.jav0000644000000000000000000000013112654402377030310 xustar0030 mtime=1454507263.209432954 29 atime=1454507327.33057779 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/RedirectStreams/srcs/RedirectStreams.java0000644000175000002070000000345112654402377031200 0ustar00jvanekmock00000000000000/* RedirectStreams.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.io.StringBufferInputStream; public class RedirectStreams { public static void main(String[] args) { System.setIn(new StringBufferInputStream("TEST")); } } icedtea-web-1.6.2/tests/reproducers/simple/RedirectStreams/PaxHeaders.17941/resources0000644000000000000000000000013212654402377025472 xustar0030 mtime=1454507263.209432954 30 atime=1454507658.779157357 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/RedirectStreams/resources/0000755000175000002070000000000012654402377026272 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/RedirectStreams/resources/PaxHeaders.17941/RedirectStream0000644000000000000000000000013112654402377030406 xustar0030 mtime=1454507263.209432954 29 atime=1454507327.33057779 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/RedirectStreams/resources/RedirectStreams.jnlp0000644000175000002070000000375112654402377032265 0ustar00jvanekmock00000000000000 redirect stdin/stdout streams IcedTea icedtea-web-1.6.2/tests/reproducers/simple/PaxHeaders.17941/ReadProperties0000644000000000000000000000013212654402377023310 xustar0030 mtime=1454507263.209432954 30 atime=1454507658.779157357 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/ReadProperties/0000755000175000002070000000000012654402377024110 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/ReadProperties/PaxHeaders.17941/testcases0000644000000000000000000000013212654402377025306 xustar0030 mtime=1454507263.209432954 30 atime=1454507658.779157357 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/ReadProperties/testcases/0000755000175000002070000000000012654402377026106 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/ReadProperties/testcases/PaxHeaders.17941/ReadPropertiesT0000644000000000000000000000013112654402377030361 xustar0030 mtime=1454507263.209432954 29 atime=1454507327.33057779 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/ReadProperties/testcases/ReadPropertiesTest.java0000644000175000002070000000634012654402377032544 0ustar00jvanekmock00000000000000/* ReadPropertiesTest.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import org.junit.Assert; import org.junit.Test; public class ReadPropertiesTest { private static ServerAccess server = new ServerAccess(); @Test public void ReadPropertiesLunch1() throws Exception { ProcessResult pr=server.executeJavawsHeadless(null,"/ReadProperties1.jnlp"); String s = "(?s).*java.security.AccessControlException.{0,5}access denied.{0,5}java.util.PropertyPermission.{0,5}" + "user.name.{0,5}read" + ".*"; Assert.assertTrue("stderr should match "+s+" but didn't",pr.stderr.matches(s)); String cc="ClassNotFoundException"; Assert.assertFalse("stderr should NOT contains `"+cc+"`, but did",pr.stderr.contains(cc)); Assert.assertFalse("ReadPropertiesLunch1 should not be terminated, but was",pr.wasTerminated); Assert.assertEquals((Integer)0, pr.returnValue); } @Test public void ReadPropertiesLunch2() throws Exception { ProcessResult pr=server.executeJavawsHeadless(null,"/ReadProperties2.jnlp"); String s = "(?s).*java.security.AccessControlException.{0,5}access denied.{0,5}java.util.PropertyPermission.{0,5}" + "user.home.{0,5}read" + ".*"; Assert.assertTrue("stderr should match "+s+" but didn't",pr.stderr.matches(s)); String cc="ClassNotFoundException"; Assert.assertFalse("stderr should NOT contains `"+cc+"`, but did",pr.stderr.contains(cc)); Assert.assertFalse("ReadPropertiesLunch2 should not be terminated, but was",pr.wasTerminated); Assert.assertEquals((Integer)0, pr.returnValue); } } icedtea-web-1.6.2/tests/reproducers/simple/ReadProperties/PaxHeaders.17941/srcs0000644000000000000000000000013212654402377024262 xustar0030 mtime=1454507263.208432968 30 atime=1454507658.779157357 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/ReadProperties/srcs/0000755000175000002070000000000012654402377025062 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/ReadProperties/srcs/PaxHeaders.17941/ReadProperties.java0000644000000000000000000000013212654402377030132 xustar0030 mtime=1454507263.208432968 30 atime=1454507327.329577803 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/ReadProperties/srcs/ReadProperties.java0000644000175000002070000000351312654402377030657 0ustar00jvanekmock00000000000000/* ReadProperties.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class ReadProperties { /** *some system property is expected as arg[0], eg user.name or user.home */ public static void main(String[] args) { System.out.println(System.getProperty(args[0])); } } icedtea-web-1.6.2/tests/reproducers/simple/ReadProperties/PaxHeaders.17941/resources0000644000000000000000000000013212654402377025322 xustar0030 mtime=1454507263.265432208 30 atime=1454507658.779157357 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/ReadProperties/resources/0000755000175000002070000000000012654402377026122 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/tests/reproducers/simple/ReadProperties/resources/PaxHeaders.17941/ReadProperties10000644000000000000000000000013212654402377030333 xustar0030 mtime=1454507263.265432208 30 atime=1454507327.329577803 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/ReadProperties/resources/ReadProperties1.jnlp0000644000175000002070000000405512654402377032024 0ustar00jvanekmock00000000000000 read properties using System.getenv() IcedTea user.name icedtea-web-1.6.2/tests/reproducers/simple/ReadProperties/resources/PaxHeaders.17941/ReadProperties20000644000000000000000000000013212654402377030334 xustar0030 mtime=1454507263.208432968 30 atime=1454507327.329577803 30 ctime=1454507658.752157717 icedtea-web-1.6.2/tests/reproducers/simple/ReadProperties/resources/ReadProperties2.jnlp0000644000175000002070000000405312654402377032023 0ustar00jvanekmock00000000000000 read properties using System.getenv() IcedTea user.home icedtea-web-1.6.2/PaxHeaders.17941/launcher0000644000000000000000000000013212654402377015171 xustar0030 mtime=1454507263.236432594 30 atime=1454507658.779157357 30 ctime=1454507658.750157744 icedtea-web-1.6.2/launcher/0000755000175000002070000000000012654402377015771 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/launcher/PaxHeaders.17941/launchers.in0000644000000000000000000000013212654402377017562 xustar0030 mtime=1454507263.236432594 30 atime=1454507327.116580643 30 ctime=1454507658.750157744 icedtea-web-1.6.2/launcher/launchers.in0000644000175000002070000000460512654402377020312 0ustar00jvanekmock00000000000000#!/bin/bash JAVA=@JAVA@ LAUNCHER_BOOTCLASSPATH=@LAUNCHER_BOOTCLASSPATH@ LAUNCHER_FLAGS=-Xms8m CLASSNAME=@MAIN_CLASS@ BINARY_LOCATION=@BIN_LOCATION@ SPLASH_LOCATION=@JAVAWS_SPLASH_LOCATION@ PROGRAM_NAME=@PROGRAM_NAME@ CP=@JRE@/lib/rt.jar:@JRE@/lib/jfxrt.jar CONFIG_HOME=$XDG_CONFIG_HOME if [ "x$CONFIG_HOME" = "x" ] ; then CONFIG_HOME=~/.config fi; PROPERTY_NAME=deployment.jre.dir CUSTOM_JRE_REGEX="^$PROPERTY_NAME *= *" CUSTOM_JRE=`grep "$CUSTOM_JRE_REGEX" $CONFIG_HOME/icedtea-web/deployment.properties 2>/dev/null | sed "s/$CUSTOM_JRE_REGEX//g"` #now check in legacy one if [ "x$CUSTOM_JRE" = "x" ] ; then CUSTOM_JRE=`grep "$CUSTOM_JRE_REGEX" ~/.icedtea/deployment.properties 2>/dev/null | sed "s/$CUSTOM_JRE_REGEX//g"` fi; #now check in global one if [ "x$CUSTOM_JRE" = "x" ] ; then CUSTOM_JRE=`grep "$CUSTOM_JRE_REGEX" /etc/.java/.deploy/deployment.properties 2>/dev/null | sed "s/$CUSTOM_JRE_REGEX//g"` fi; if [ "x$CUSTOM_JRE" != "x" ] ; then if [ -e "$CUSTOM_JRE" -a -e "$CUSTOM_JRE/bin/java" -a -e "$CUSTOM_JRE/lib/rt.jar" ] ; then JAVA=$CUSTOM_JRE/bin/java CP=$CUSTOM_JRE/lib/rt.jar:$CUSTOM_JRE/lib/jfxrt.jar else echo "Your custom JRE $CUSTOM_JRE read from deployment.properties under key $PROPERTY_NAME as $CUSTOM_JRE is not valid. Using default ($JAVA, $CP) in attempt to start. Please fix this." fi fi; JAVA_ARGS=( ) ARGS=( ) COMMAND=() i=0 j=0 SPLASH="false" if [ "x$ICEDTEA_WEB_SPLASH" = "x" ] ; then SPLASH="true" fi; while [ "$#" -gt "0" ]; do case "$1" in -J*) JAVA_ARGS[$i]="${1##-J}" i=$((i+1)) ;; *) ARGS[$j]="$1" j=$((j+1)) if [[ "$1" =~ ^[-]*headless ]] ; then SPLASH="false" fi ;; esac shift done k=0 COMMAND[k]="${JAVA}" k=$((k+1)) if [ "$SPLASH" = "true" ] ; then COMMAND[k]="-splash:${SPLASH_LOCATION}" k=$((k+1)) fi; COMMAND[k]="${LAUNCHER_BOOTCLASSPATH}" k=$((k+1)) COMMAND[k]="${LAUNCHER_FLAGS}" k=$((k+1)) i=0 while [ "$i" -lt "${#JAVA_ARGS[@]}" ]; do COMMAND[k]="${JAVA_ARGS[$i]}" i=$((i+1)) k=$((k+1)) done COMMAND[k]="-classpath" k=$((k+1)) COMMAND[k]="${CP}" k=$((k+1)) COMMAND[k]="-Dicedtea-web.bin.name=${PROGRAM_NAME}" k=$((k+1)) COMMAND[k]="-Dicedtea-web.bin.location=${BINARY_LOCATION}" k=$((k+1)) COMMAND[k]="${CLASSNAME}" k=$((k+1)) j=0 while [ "$j" -lt "${#ARGS[@]}" ]; do COMMAND[k]="${ARGS[$j]}" j=$((j+1)) k=$((k+1)) done exec -a "$PROGRAM_NAME" "${COMMAND[@]}" exit $? icedtea-web-1.6.2/PaxHeaders.17941/itweb-settings.desktop.in0000644000000000000000000000013112654402377020414 xustar0030 mtime=1454507263.235432608 30 atime=1454507327.115580657 29 ctime=1454507658.74815777 icedtea-web-1.6.2/itweb-settings.desktop.in0000644000175000002070000000110412654402377021134 0ustar00jvanekmock00000000000000[Desktop Entry] Name=IcedTea-Web Control Panel Name[de]=IcedTea-Web Systemsteuerung Name[pl]=Panel sterowania IcedTea-Web Name[cs]=Ovládací panel IcedTea-Web GenericName=Control Panel Comment=Configure IcedTea-Web (javaws and plugin) Comment[de]=Konfiguriert IcedTea-Web (javaws und Plug-in) Comment[pl]=Konfiguruj IcedTea-Web (javaws i wtyczkę) Comment[cs]=Konfigurace aplikace IcedTea-Web (javaws a zásuvný modul) Exec=PATH_TO_ITWEB_SETTINGS Icon=javaws Terminal=false Type=Application Categories=Settings; Keywords=IcedTea;IcedTea-Web;java;javaws;web;start;webstart;jnlp; icedtea-web-1.6.2/PaxHeaders.17941/icedteaweb-completion0000644000000000000000000000013212654402377017633 xustar0030 mtime=1454507263.235432608 30 atime=1454507327.115580657 30 ctime=1454507658.747157784 icedtea-web-1.6.2/icedteaweb-completion0000644000175000002070000000234312654402377020360 0ustar00jvanekmock00000000000000#/bin/bash #place this file over to /etc/bash_completion.d/ to make this file useful #Note: If you do not have bash-completion you will need to install it _itweb-settings() { local cur prev opts base cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" # Icedtea-web settings Options opts="-check -get -headless -help -info -list -reset -set -verbose" COMPREPLY=($(compgen -W "${opts}" -- ${cur})) return 0 } complete -F _itweb-settings itweb-settings _policyeditor() { local cur prev opts base cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" # PolicyEditor Options opts="-codebase -file -defaultfile -help" COMPREPLY=($(compgen -W "${opts}" -- ${cur})) return 0 } complete -F _policyeditor policyeditor _javaws() { local cur prev opts base cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" # JavaWs Options opts="-about -help -license -viewer -Xclearcache -allowredirect -arg -headless -html -jnlp -nosecurity -noupdate -param -property -strict -update -verbose -version -Xignoreheaders -xml -Xnofork -Xoffline -Xtrustnone" COMPREPLY=($(compgen -W "${opts}" -- ${cur})) return 0 } complete -F _javaws javaws icedtea-web-1.6.2/PaxHeaders.17941/policyeditor.desktop.in0000644000000000000000000000013112654402377020152 xustar0030 mtime=1454507263.264432221 29 atime=1454507327.18057979 30 ctime=1454507658.746157797 icedtea-web-1.6.2/policyeditor.desktop.in0000644000175000002070000000043512654402377020700 0ustar00jvanekmock00000000000000[Desktop Entry] Name=IcedTea-Web Policy Editor GenericName=Policy Tool Comment=Edit Java Applet policy and permission settings Exec=PATH_TO_POLICYEDITOR Icon=javaws Terminal=false Type=Application Categories=Settings; Keywords=IcedTea;IcedTea-Web;java;javaws;web;start;webstart;jnlp; icedtea-web-1.6.2/PaxHeaders.17941/javaws.desktop.in0000644000000000000000000000013112654402377016737 xustar0030 mtime=1454507263.235432608 30 atime=1454507327.115580657 29 ctime=1454507658.74515781 icedtea-web-1.6.2/javaws.desktop.in0000644000175000002070000000037712654402377017472 0ustar00jvanekmock00000000000000[Desktop Entry] Name=IcedTea Web Start GenericName=Java Web Start Comment=IcedTea Application Launcher Exec=PATH_TO_JAVAWS %f Icon=javaws Terminal=false Type=Application NoDisplay=true Categories=Network;WebBrowser; MimeType=application/x-java-jnlp-file; icedtea-web-1.6.2/PaxHeaders.17941/javaws.png0000644000000000000000000000013212654402377015446 xustar0030 mtime=1454507263.235432608 30 atime=1454507327.115580657 30 ctime=1454507658.744157824 icedtea-web-1.6.2/javaws.png0000644000175000002070000001115112654402377016170 0ustar00jvanekmock00000000000000PNG  IHDRSd sBIT|d IDATx]Qh"ɺYBɂt` t8̋O=e,Fa9pه,,!a`P4m!ˠ/2NC M Vیg՟__U{޿eo/_1)x.p+0 /߽3˅}$D,=B oݼRyqb2g;d,5xZҒyb+ա6%3wD|q$/̦:l]u|xtֹtd]_rraKG(UΥ#@).NXTdⅩ75KCǏR+oٳgKARܮ2ƐJf\a)faȸr2V}wnwNgs;&[睓yPR>HPUw;̲Zٹr6S2/VVf>;wJf"I19&Sxrb- ɝX睑*Qݝω'N77zeM}d66V5˳ bd6gB!Bsd򋙮e!N.Z],kTUwY\./w.|> "-N02}>S9p?%1+(YȌc xP,ryq2[u!YU{>zs! !sAlKjN5D4u]:Nfvg7!ǁ8@}F]g=yj/VV̈v/ J!0BA Lo,&* kzT:ڷsϕ̿f}B:#b ICPV fVP,ff}1*kuSx52IW !߆ȁ%EfQB@ E13 JuMϷnΜйB0ySB G! *qyQB Ե?-3  AX0lr A02}u0w2( h AͨhCr& ?P0ppa\|nm@\!XVMC\A.$@cͱ^&ϠO3s!?^ȁ3ZЪE5xW /.X MEd PF0Nf0T>Oy@2;]ȼr<Y 9`06P`cJ}>R Ir1HL3#ZV)l xܹ  *o[;HM2U4}V)Ke`}b~k:OxL\lB/Wn"ML&=oq L-eIBX KCgei`6`B[ %K<#36sXv2^aQABc@x" j5x|x|>wEEᇏfُq%Rxz7*G4ޓ0ḛ?{iٞE!@1Z;"R:!vKD< Գ[[k3z64s4:LCPe@O:c29򀇴eMAđDjc? TNgL^E!8$RTpGsӂ@A I1T &&D)σR&] ^@ӼO)r"lX<'0Jsɸݤ4{tJ)Hc躎FCc`kZZamr^ޚH 8i0Z mֆ(;5cmZc81B8B~bhBpͫ7x~FynCd^xC$8szz:P.,Ǥp !jAu\^1s^2ncB~T2;)J:@gÖ%?9-mιۂbƝЅ1fؐ&?Pv3׫x[6?vȔ$ `p||<Q,j 9p<BH5s^ݛtQWlZ]x_̰Dwo]}=r6k brw N%/[{Ѳ\nk$]]|ŷncRJپBlCpu=PTqW!d_puV+=%,_t"kήe8âesqvŦuB>۱C"ީ"'OX,sHQ+YV*lW|>[ ,MJTFYoJfs[iF];~c#Lnd<(ZcD2sq(r3O=KC$!#a\̓>K-5dytFKDL^ݡ[~3jI~=z!N{ZGQH'(vf#jZf,}FSk^@4E:q'ggf<$!} Y 8|\F&AZ$K"Iz/_yh L:y1Kd|` :ծ<#כݪXe3`K\ /8u0SɤX`.+NNZF^!$|o?;f|0(IENDB`icedtea-web-1.6.2/PaxHeaders.17941/plugin0000644000000000000000000000013212654402377014666 xustar0030 mtime=1454507263.248432434 30 atime=1454507658.779157357 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/0000755000175000002070000000000012654402377015466 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/plugin/PaxHeaders.17941/tests0000644000000000000000000000013212654402377016030 xustar0030 mtime=1454507263.248432434 30 atime=1454507658.779157357 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/tests/0000755000175000002070000000000012654402377016630 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/plugin/tests/PaxHeaders.17941/LiveConnect0000644000000000000000000000013212654402377020241 xustar0030 mtime=1454507263.264432221 30 atime=1454507658.779157357 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/tests/LiveConnect/0000755000175000002070000000000012654402377021041 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/plugin/tests/LiveConnect/PaxHeaders.17941/jsj_type_conversion_tests.js0000644000000000000000000000013112654402377026171 xustar0030 mtime=1454507263.264432221 29 atime=1454507327.18057979 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/tests/LiveConnect/jsj_type_conversion_tests.js0000644000175000002070000006173412654402377026730 0ustar00jvanekmock00000000000000/************************************************************ * Tests for data type conversion from JS to Java variables * ************************************************************/ function typeCastingTests() { document.getElementById("results").innerHTML += "

JS -> Java type casting tests:

"; var tbl = document.createElement("table"); var tblBody = document.createElement("tbody"); var columnNames = new Array(); columnNames[0] = "Test Type"; columnNames[1] = "Send Value"; columnNames[2] = "Expected Value"; columnNames[3] = "Actual Value"; columnNames[4] = "Status"; var row; createResultTable(tbl, tblBody, columnNames); try { row = document.createElement("tr"); type = "Numeric -> java.lang.String (Integer)"; setto = 1; PluginTest.String_type = setto; now = PluginTest.String_type; addResult (type, setto, setto, now, row); check(now, setto, "string", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Numeric -> java.lang.String (Double)"; setto = 1.1; PluginTest.String_type = setto; now = PluginTest.String_type; addResult (type, setto, setto, now, row); check(now, setto, "string", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Numeric -> java.lang.Object (Integer)"; setto = 1.0; PluginTest.Object_type = setto; now = PluginTest.Object_type + " | Superclass = " + PluginTest.Object_type.getClass().getSuperclass().getName(); addResult (type, setto, setto + " | Superclass = java.lang.Number", now, row); check(now, setto + " | Superclass = java.lang.Number", "string", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Numeric -> java.lang.Object (Double)"; setto = 1.1; PluginTest.Object_type = setto; now = PluginTest.Object_type + " | Superclass = " + PluginTest.Object_type.getClass().getSuperclass().getName(); addResult (type, setto, setto + " | Superclass = java.lang.Number", now, row); check(now, setto + " | Superclass = java.lang.Number", "string", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Numeric -> boolean (0)"; setto = 0; PluginTest.boolean_type = setto; now = PluginTest.boolean_type; addResult (type, setto, false, now, row); check(now, false, "boolean", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Numeric -> boolean (1.1)"; setto = 1.1; PluginTest.boolean_type = setto; now = PluginTest.boolean_type; addResult (type, setto, true, now, row); check(now, true, "boolean", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Boolean -> java.lang.Boolean (true)"; setto = true; PluginTest.Boolean_type = setto; now = PluginTest.Boolean_type; addResult (type, setto, "true", now, row); check(now, "true", "object", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Boolean -> java.lang.Boolean (false)"; setto = false; PluginTest.Boolean_type = setto; now = PluginTest.Boolean_type; addResult (type, setto, "false", now, row); check(now, "false", "object", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Boolean -> java.lang.Object"; setto = true; PluginTest.Boolean_type = setto; now = PluginTest.Boolean_type + " | Class = " + PluginTest.Boolean_type.getClass().getName(); addResult (type, setto, "true | Class = java.lang.Boolean", now, row); check(now, "true | Class = java.lang.Boolean", "string", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Boolean -> java.lang.String"; setto = true; PluginTest.String_type = setto; now = PluginTest.String_type; addResult (type, setto, "true", now, row); check(now, "true", "string", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Boolean -> java.lang.String"; setto = true; PluginTest.String_type = setto; now = PluginTest.String_type; addResult (type, setto, "true", now, row); check(now, "true", "string", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Boolean -> byte (true)"; setto = true; PluginTest.byte_type = setto; now = PluginTest.byte_type; addResult (type, setto, 1, now, row); check(now, 1, "number", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Boolean -> char (true)"; setto = true; PluginTest.char_type = setto; now = PluginTest.char_type; addResult (type, setto, 1, now, row); check(now, 1, "number", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Boolean -> short (true)"; setto = true; PluginTest.short_type = setto; now = PluginTest.short_type; addResult (type, setto, 1, now, row); check(now, 1, "number", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Boolean -> int (true)"; setto = true; PluginTest.int_type = setto; now = PluginTest.int_type; addResult (type, setto, 1, now, row); check(now, 1, "number", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Boolean -> long (true)"; setto = true; PluginTest.long_type = setto; now = PluginTest.long_type; addResult (type, setto, 1, now, row); check(now, 1, "number", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Boolean -> float (true)"; setto = true; PluginTest.float_type = setto; now = PluginTest.float_type; addResult (type, setto, 1, now, row); check(now, 1, "number", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Boolean -> double (true)"; setto = true; PluginTest.double_type = setto; now = PluginTest.double_type; addResult (type, setto, 1, now, row); check(now, 1, "number", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Boolean -> byte (false)"; setto = false; PluginTest.byte_type = setto; now = PluginTest.byte_type; addResult (type, setto, 0, now, row); check(now, 0, "number", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Boolean -> char (false)"; setto = false; PluginTest.char_type = setto; now = PluginTest.char_type; addResult (type, setto, 0, now, row); check(now, 0, "number", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Boolean -> short (false)"; setto = false; PluginTest.short_type = setto; now = PluginTest.short_type; addResult (type, setto, 0, now, row); check(now, 0, "number", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Boolean -> int (false)"; setto = false; PluginTest.int_type = setto; now = PluginTest.int_type; addResult (type, setto, 0, now, row); check(now, 0, "number", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Boolean -> long (false)"; setto = false; PluginTest.long_type = setto; now = PluginTest.long_type; addResult (type, setto, 0, now, row); check(now, 0, "number", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Boolean -> float (false)"; setto = false; PluginTest.float_type = setto; now = PluginTest.float_type; addResult (type, setto, 0, now, row); check(now, 0, "number", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Boolean -> double (false)"; setto = false; PluginTest.double_type = setto; now = PluginTest.double_type; addResult (type, setto, 0, now, row); check(now, 0, "number", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "String -> Object"; setto = "𠁎〒£$ǣ€𝍖"; PluginTest.Object_type = setto; // Some weird FF bug is causing getClass to not work correctly when set // to a String (hasProperty/hasMethod "getClass" doesn't come through // to the plugin at all, so it is definitely an ff issue). So for now, // we just compare values. //now = PluginTest.Object_type + " | Class = " + PluginTest.Object_type.getClass().getSuperclass().getName(); //addResult (type, setto, setto + " | Class = java.lang.String", now, row); //check(now, setto + " | Class = java.lang.String", "string", row); now = PluginTest.Object_type; PluginTest.Object_type.charAt(3); // try a String specific function to be sure it is a String addResult (type, setto, setto, now, row); check(now, setto, "string", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "String -> byte"; setto = "1"; PluginTest.byte_type = setto; now = PluginTest.byte_type; addResult (type, setto, 1, now, row); check(now, 1, "number", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "String -> short"; setto = "2"; PluginTest.short_type = setto; now = PluginTest.short_type; addResult (type, setto, 2, now, row); check(now, 2, "number", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "String -> int"; setto = "3"; PluginTest.int_type = setto; now = PluginTest.int_type; addResult (type, setto, 3, now, row); check(now, 3, "number", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "String -> long"; setto = "4"; PluginTest.long_type = setto; now = PluginTest.long_type; addResult (type, setto, 4, now, row); check(now, 4, "number", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "String -> float"; setto = "0.0"; PluginTest.float_type = setto; now = PluginTest.float_type; addResult (type, setto, 0, now, row); check(now, 0, "number", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "String -> double"; setto = "6.2"; PluginTest.double_type = setto; now = PluginTest.double_type; addResult (type, setto, 6.2, now, row); check(now, 6.2, "number", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "String -> char"; setto = "7"; PluginTest.char_type = setto; now = PluginTest.char_type; addResult (type, setto, 7, now, row); check(now, 7, "number", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "String -> boolean (empty/false)"; setto = ""; PluginTest.boolean_type = setto; now = PluginTest.boolean_type; addResult (type, setto, false, now, row); check(now, false, "boolean", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "String -> boolean (non-empty/true)"; setto = "A non-empty string"; PluginTest.boolean_type = setto; now = PluginTest.boolean_type; addResult (type, setto, true, now, row); check(now, true, "boolean", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Array -> byte[]"; setto = new Array(); setto[0] = 1; setto[2] = 2; PluginTest.byte_array = setto; now = PluginTest.getArrayAsStr(PluginTest.byte_array); addResult (type, setto, "1,0,2", now, row); check(now, "1,0,2", "string", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Array -> char[]"; setto = new Array(); setto[0] = 1; setto[2] = 2; PluginTest.char_array = setto; // For char array, don't convert to string.. the empty/null/0 character messes it up now = PluginTest.char_array[0] + "," + PluginTest.char_array[1] + "," + PluginTest.char_array[2]; addResult (type, setto, "1,0,2", now, row); check(now, "1,0,2", "string", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Array -> short[]"; setto = new Array(); setto[0] = 1; setto[2] = 2; PluginTest.short_array = setto; now = PluginTest.getArrayAsStr(PluginTest.short_array); addResult (type, setto, "1,0,2", now, row); check(now, "1,0,2", "string", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Array -> int[]"; setto = new Array(); setto[0] = 1; setto[2] = 2; PluginTest.int_array = setto; now = PluginTest.getArrayAsStr(PluginTest.int_array); addResult (type, setto, "1,0,2", now, row); check(now, "1,0,2", "string", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Array -> long[]"; setto = new Array(); setto[0] = 1; setto[2] = 2; PluginTest.long_array = setto; now = PluginTest.getArrayAsStr(PluginTest.long_array); addResult (type, setto, "1,0,2", now, row); check(now, "1,0,2", "string", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Array -> float[]"; setto = new Array(); setto[0] = 1; setto[2] = 2; PluginTest.float_array = setto; now = PluginTest.getArrayAsStr(PluginTest.float_array); addResult (type, setto, "1.0,0.0,2.0", now, row); check(now, "1.0,0.0,2.0", "string", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Array -> double[]"; setto = new Array(); setto[0] = 1; setto[2] = 2; PluginTest.double_array = setto; now = PluginTest.getArrayAsStr(PluginTest.double_array); addResult (type, setto, "1.0,0.0,2.0", now, row); check(now, "1.0,0.0,2.0", "string", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Array -> String[] (int)"; setto = new Array(); setto[0] = 1; setto[2] = 2; PluginTest.String_array = setto; now = PluginTest.getArrayAsStr(PluginTest.String_array); addResult (type, setto, "1,null,2", now, row); check(now, "1,null,2", "string", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Array -> String[] (int)"; setto = new Array(); setto[0] = 1; setto[2] = 2; PluginTest.String_array = setto; now = PluginTest.getArrayAsStr(PluginTest.String_array); addResult (type, setto, "1,null,2", now, row); check(now, "1,null,2", "string", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { var a = []; a[0] = []; a[1] = []; a[2] = []; a[0][0] = "100"; a[0][2] = "102"; a[2][0] = "120"; a[2][1] = "121"; a[2][3] = "123"; // // a = [[00, , 02] // normal // [] // empty // [20, 21, , 23]] // length = element0.length + 1 // row = document.createElement("tr"); type = "Array -> char[][] (string to primitive)"; PluginTest.char_array_array = a; now = PluginTest.char_array_array[0][0] + "," + PluginTest.char_array_array[0][1] + "," + PluginTest.char_array_array[0][2] + "," + PluginTest.char_array_array[1][0] + "," + PluginTest.char_array_array[2][0] + "," + PluginTest.char_array_array[2][1] + "," + PluginTest.char_array_array[2][2] + "," + PluginTest.char_array_array[2][3]; expected = "100,0,102,undefined,120,121,0,123" addResult (type, a, expected, now, row); check(now, expected, "string", row); } catch (e) { error(type, a, e, row); } tblBody.appendChild(row); try { var a = []; a[0] = []; a[1] = []; a[2] = []; a[0][0] = 100; a[0][2] = 102; a[2][0] = 120; a[2][1] = 121; a[2][3] = 123; // // a = [[00, , 02] // normal // [] // empty // [20, 21, , 23]] // length = element0.length + 1 // row = document.createElement("tr"); type = "Array -> String[][] (int to complex)"; PluginTest.String_array_array = a; now = PluginTest.String_array_array[0][0] + "," + PluginTest.String_array_array[0][1] + "," + PluginTest.String_array_array[0][2] + "," + PluginTest.String_array_array[1][0] + "," + PluginTest.String_array_array[2][0] + "," + PluginTest.String_array_array[2][1] + "," + PluginTest.String_array_array[2][2] + "," + PluginTest.String_array_array[2][3]; expected = "100,null,102,undefined,120,121,null,123"; addResult (type, a, expected, now, row); check(now, expected, "string", row); } catch (e) { error(type, a, e, row); } tblBody.appendChild(row); try { var a = []; a[0] = []; a[1] = []; a[2] = []; a[0][0] = 100; a[0][2] = 102; a[2][0] = 120; a[2][1] = 121; a[2][3] = 123; // // a = [[00, , 02] // normal // [] // empty // [20, 21, , 23]] // length = element0.length + 1 // row = document.createElement("tr"); type = "Array -> String"; PluginTest.String_type = a; now = PluginTest.String_type; expected = "100,,102,,120,121,,123"; addResult (type, a, expected, now, row); check(now, expected, "string", row); } catch (e) { error(type, a, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "JSObject -> JSObject"; setto = window; PluginTest.JSObject_type = setto; now = PluginTest.JSObject_type; addResult (type, setto, "[object Window]", now, row); check(now, "[object Window]", "object", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "JSObject -> String"; setto = window; PluginTest.String_type = setto; now = PluginTest.String_type; addResult (type, setto, "[object Window]", now, row); check(now, "[object Window]", "string", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Java Object -> Java Object"; PluginTest.Float_type = 1.111; orig_hash = PluginTest.Float_type.hashCode(); PluginTest.Object_type = PluginTest.Float_type; new_hash = PluginTest.Object_type.hashCode(); addResult (type, "hashcode=" + orig_hash, orig_hash, new_hash, row); check(new_hash, orig_hash, "number", row); } catch (e) { error(type, "", e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Java Object -> String"; setto = new PluginTest.Packages.DummyObject("Test object"); PluginTest.String_type = setto; now = PluginTest.String_type; addResult (type, setto, "Test object", now, row); check(now, "Test object", "string", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "null -> Java Object (String)"; // Assuming the set tests have passed, we know that object is non-null after this PluginTest.String_type = "Not Null"; setto = null; PluginTest.String_type = setto; now = PluginTest.String_type; addResult (type, setto, null, now, row); check(now, null, "object", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); /* // NULL -> primitive tests are disabled for now due to ambiguity. // Section 2.2 here: http://java.sun.com/javase/6/webnotes/6u10/plugin2/liveconnect/ // States that null to primitive is not allowed, yet, section 2.3.7 claims it is.. try { row = document.createElement("tr"); type = "null -> byte"; // Assuming the set tests have passed, we know that object is non-null after this PluginTest.byte_type = "100"; setto = null; PluginTest.byte_type = setto; now = PluginTest.byte_type; addResult (type, setto, null, now, row); check(now, null, "object", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); */ } icedtea-web-1.6.2/plugin/tests/LiveConnect/PaxHeaders.17941/jsj_type_casting_tests.js0000644000000000000000000000013212654402377025435 xustar0030 mtime=1454507263.263432234 30 atime=1454507327.179579803 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/tests/LiveConnect/jsj_type_casting_tests.js0000644000175000002070000006173412654402377026173 0ustar00jvanekmock00000000000000/************************************************************ * Tests for data type conversion from JS to Java variables * ************************************************************/ function typeCastingTests() { document.getElementById("results").innerHTML += "

JS -> Java type casting tests:

"; var tbl = document.createElement("table"); var tblBody = document.createElement("tbody"); var columnNames = new Array(); columnNames[0] = "Test Type"; columnNames[1] = "Send Value"; columnNames[2] = "Expected Value"; columnNames[3] = "Actual Value"; columnNames[4] = "Status"; var row; createResultTable(tbl, tblBody, columnNames); try { row = document.createElement("tr"); type = "Numeric -> java.lang.String (Integer)"; setto = 1; PluginTest.String_type = setto; now = PluginTest.String_type; addResult (type, setto, setto, now, row); check(now, setto, "string", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Numeric -> java.lang.String (Double)"; setto = 1.1; PluginTest.String_type = setto; now = PluginTest.String_type; addResult (type, setto, setto, now, row); check(now, setto, "string", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Numeric -> java.lang.Object (Integer)"; setto = 1.0; PluginTest.Object_type = setto; now = PluginTest.Object_type + " | Superclass = " + PluginTest.Object_type.getClass().getSuperclass().getName(); addResult (type, setto, setto + " | Superclass = java.lang.Number", now, row); check(now, setto + " | Superclass = java.lang.Number", "string", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Numeric -> java.lang.Object (Double)"; setto = 1.1; PluginTest.Object_type = setto; now = PluginTest.Object_type + " | Superclass = " + PluginTest.Object_type.getClass().getSuperclass().getName(); addResult (type, setto, setto + " | Superclass = java.lang.Number", now, row); check(now, setto + " | Superclass = java.lang.Number", "string", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Numeric -> boolean (0)"; setto = 0; PluginTest.boolean_type = setto; now = PluginTest.boolean_type; addResult (type, setto, false, now, row); check(now, false, "boolean", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Numeric -> boolean (1.1)"; setto = 1.1; PluginTest.boolean_type = setto; now = PluginTest.boolean_type; addResult (type, setto, true, now, row); check(now, true, "boolean", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Boolean -> java.lang.Boolean (true)"; setto = true; PluginTest.Boolean_type = setto; now = PluginTest.Boolean_type; addResult (type, setto, "true", now, row); check(now, "true", "object", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Boolean -> java.lang.Boolean (false)"; setto = false; PluginTest.Boolean_type = setto; now = PluginTest.Boolean_type; addResult (type, setto, "false", now, row); check(now, "false", "object", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Boolean -> java.lang.Object"; setto = true; PluginTest.Boolean_type = setto; now = PluginTest.Boolean_type + " | Class = " + PluginTest.Boolean_type.getClass().getName(); addResult (type, setto, "true | Class = java.lang.Boolean", now, row); check(now, "true | Class = java.lang.Boolean", "string", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Boolean -> java.lang.String"; setto = true; PluginTest.String_type = setto; now = PluginTest.String_type; addResult (type, setto, "true", now, row); check(now, "true", "string", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Boolean -> java.lang.String"; setto = true; PluginTest.String_type = setto; now = PluginTest.String_type; addResult (type, setto, "true", now, row); check(now, "true", "string", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Boolean -> byte (true)"; setto = true; PluginTest.byte_type = setto; now = PluginTest.byte_type; addResult (type, setto, 1, now, row); check(now, 1, "number", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Boolean -> char (true)"; setto = true; PluginTest.char_type = setto; now = PluginTest.char_type; addResult (type, setto, 1, now, row); check(now, 1, "number", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Boolean -> short (true)"; setto = true; PluginTest.short_type = setto; now = PluginTest.short_type; addResult (type, setto, 1, now, row); check(now, 1, "number", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Boolean -> int (true)"; setto = true; PluginTest.int_type = setto; now = PluginTest.int_type; addResult (type, setto, 1, now, row); check(now, 1, "number", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Boolean -> long (true)"; setto = true; PluginTest.long_type = setto; now = PluginTest.long_type; addResult (type, setto, 1, now, row); check(now, 1, "number", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Boolean -> float (true)"; setto = true; PluginTest.float_type = setto; now = PluginTest.float_type; addResult (type, setto, 1, now, row); check(now, 1, "number", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Boolean -> double (true)"; setto = true; PluginTest.double_type = setto; now = PluginTest.double_type; addResult (type, setto, 1, now, row); check(now, 1, "number", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Boolean -> byte (false)"; setto = false; PluginTest.byte_type = setto; now = PluginTest.byte_type; addResult (type, setto, 0, now, row); check(now, 0, "number", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Boolean -> char (false)"; setto = false; PluginTest.char_type = setto; now = PluginTest.char_type; addResult (type, setto, 0, now, row); check(now, 0, "number", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Boolean -> short (false)"; setto = false; PluginTest.short_type = setto; now = PluginTest.short_type; addResult (type, setto, 0, now, row); check(now, 0, "number", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Boolean -> int (false)"; setto = false; PluginTest.int_type = setto; now = PluginTest.int_type; addResult (type, setto, 0, now, row); check(now, 0, "number", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Boolean -> long (false)"; setto = false; PluginTest.long_type = setto; now = PluginTest.long_type; addResult (type, setto, 0, now, row); check(now, 0, "number", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Boolean -> float (false)"; setto = false; PluginTest.float_type = setto; now = PluginTest.float_type; addResult (type, setto, 0, now, row); check(now, 0, "number", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Boolean -> double (false)"; setto = false; PluginTest.double_type = setto; now = PluginTest.double_type; addResult (type, setto, 0, now, row); check(now, 0, "number", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "String -> Object"; setto = "𠁎〒£$ǣ€𝍖"; PluginTest.Object_type = setto; // Some weird FF bug is causing getClass to not work correctly when set // to a String (hasProperty/hasMethod "getClass" doesn't come through // to the plugin at all, so it is definitely an ff issue). So for now, // we just compare values. //now = PluginTest.Object_type + " | Class = " + PluginTest.Object_type.getClass().getSuperclass().getName(); //addResult (type, setto, setto + " | Class = java.lang.String", now, row); //check(now, setto + " | Class = java.lang.String", "string", row); now = PluginTest.Object_type; PluginTest.Object_type.charAt(3); // try a String specific function to be sure it is a String addResult (type, setto, setto, now, row); check(now, setto, "string", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "String -> byte"; setto = "1"; PluginTest.byte_type = setto; now = PluginTest.byte_type; addResult (type, setto, 1, now, row); check(now, 1, "number", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "String -> short"; setto = "2"; PluginTest.short_type = setto; now = PluginTest.short_type; addResult (type, setto, 2, now, row); check(now, 2, "number", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "String -> int"; setto = "3"; PluginTest.int_type = setto; now = PluginTest.int_type; addResult (type, setto, 3, now, row); check(now, 3, "number", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "String -> long"; setto = "4"; PluginTest.long_type = setto; now = PluginTest.long_type; addResult (type, setto, 4, now, row); check(now, 4, "number", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "String -> float"; setto = "0.0"; PluginTest.float_type = setto; now = PluginTest.float_type; addResult (type, setto, 0, now, row); check(now, 0, "number", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "String -> double"; setto = "6.2"; PluginTest.double_type = setto; now = PluginTest.double_type; addResult (type, setto, 6.2, now, row); check(now, 6.2, "number", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "String -> char"; setto = "7"; PluginTest.char_type = setto; now = PluginTest.char_type; addResult (type, setto, 7, now, row); check(now, 7, "number", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "String -> boolean (empty/false)"; setto = ""; PluginTest.boolean_type = setto; now = PluginTest.boolean_type; addResult (type, setto, false, now, row); check(now, false, "boolean", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "String -> boolean (non-empty/true)"; setto = "A non-empty string"; PluginTest.boolean_type = setto; now = PluginTest.boolean_type; addResult (type, setto, true, now, row); check(now, true, "boolean", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Array -> byte[]"; setto = new Array(); setto[0] = 1; setto[2] = 2; PluginTest.byte_array = setto; now = PluginTest.getArrayAsStr(PluginTest.byte_array); addResult (type, setto, "1,0,2", now, row); check(now, "1,0,2", "string", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Array -> char[]"; setto = new Array(); setto[0] = 1; setto[2] = 2; PluginTest.char_array = setto; // For char array, don't convert to string.. the empty/null/0 character messes it up now = PluginTest.char_array[0] + "," + PluginTest.char_array[1] + "," + PluginTest.char_array[2]; addResult (type, setto, "1,0,2", now, row); check(now, "1,0,2", "string", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Array -> short[]"; setto = new Array(); setto[0] = 1; setto[2] = 2; PluginTest.short_array = setto; now = PluginTest.getArrayAsStr(PluginTest.short_array); addResult (type, setto, "1,0,2", now, row); check(now, "1,0,2", "string", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Array -> int[]"; setto = new Array(); setto[0] = 1; setto[2] = 2; PluginTest.int_array = setto; now = PluginTest.getArrayAsStr(PluginTest.int_array); addResult (type, setto, "1,0,2", now, row); check(now, "1,0,2", "string", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Array -> long[]"; setto = new Array(); setto[0] = 1; setto[2] = 2; PluginTest.long_array = setto; now = PluginTest.getArrayAsStr(PluginTest.long_array); addResult (type, setto, "1,0,2", now, row); check(now, "1,0,2", "string", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Array -> float[]"; setto = new Array(); setto[0] = 1; setto[2] = 2; PluginTest.float_array = setto; now = PluginTest.getArrayAsStr(PluginTest.float_array); addResult (type, setto, "1.0,0.0,2.0", now, row); check(now, "1.0,0.0,2.0", "string", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Array -> double[]"; setto = new Array(); setto[0] = 1; setto[2] = 2; PluginTest.double_array = setto; now = PluginTest.getArrayAsStr(PluginTest.double_array); addResult (type, setto, "1.0,0.0,2.0", now, row); check(now, "1.0,0.0,2.0", "string", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Array -> String[] (int)"; setto = new Array(); setto[0] = 1; setto[2] = 2; PluginTest.String_array = setto; now = PluginTest.getArrayAsStr(PluginTest.String_array); addResult (type, setto, "1,null,2", now, row); check(now, "1,null,2", "string", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Array -> String[] (int)"; setto = new Array(); setto[0] = 1; setto[2] = 2; PluginTest.String_array = setto; now = PluginTest.getArrayAsStr(PluginTest.String_array); addResult (type, setto, "1,null,2", now, row); check(now, "1,null,2", "string", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { var a = []; a[0] = []; a[1] = []; a[2] = []; a[0][0] = "100"; a[0][2] = "102"; a[2][0] = "120"; a[2][1] = "121"; a[2][3] = "123"; // // a = [[00, , 02] // normal // [] // empty // [20, 21, , 23]] // length = element0.length + 1 // row = document.createElement("tr"); type = "Array -> char[][] (string to primitive)"; PluginTest.char_array_array = a; now = PluginTest.char_array_array[0][0] + "," + PluginTest.char_array_array[0][1] + "," + PluginTest.char_array_array[0][2] + "," + PluginTest.char_array_array[1][0] + "," + PluginTest.char_array_array[2][0] + "," + PluginTest.char_array_array[2][1] + "," + PluginTest.char_array_array[2][2] + "," + PluginTest.char_array_array[2][3]; expected = "100,0,102,undefined,120,121,0,123" addResult (type, a, expected, now, row); check(now, expected, "string", row); } catch (e) { error(type, a, e, row); } tblBody.appendChild(row); try { var a = []; a[0] = []; a[1] = []; a[2] = []; a[0][0] = 100; a[0][2] = 102; a[2][0] = 120; a[2][1] = 121; a[2][3] = 123; // // a = [[00, , 02] // normal // [] // empty // [20, 21, , 23]] // length = element0.length + 1 // row = document.createElement("tr"); type = "Array -> String[][] (int to complex)"; PluginTest.String_array_array = a; now = PluginTest.String_array_array[0][0] + "," + PluginTest.String_array_array[0][1] + "," + PluginTest.String_array_array[0][2] + "," + PluginTest.String_array_array[1][0] + "," + PluginTest.String_array_array[2][0] + "," + PluginTest.String_array_array[2][1] + "," + PluginTest.String_array_array[2][2] + "," + PluginTest.String_array_array[2][3]; expected = "100,null,102,undefined,120,121,null,123"; addResult (type, a, expected, now, row); check(now, expected, "string", row); } catch (e) { error(type, a, e, row); } tblBody.appendChild(row); try { var a = []; a[0] = []; a[1] = []; a[2] = []; a[0][0] = 100; a[0][2] = 102; a[2][0] = 120; a[2][1] = 121; a[2][3] = 123; // // a = [[00, , 02] // normal // [] // empty // [20, 21, , 23]] // length = element0.length + 1 // row = document.createElement("tr"); type = "Array -> String"; PluginTest.String_type = a; now = PluginTest.String_type; expected = "100,,102,,120,121,,123"; addResult (type, a, expected, now, row); check(now, expected, "string", row); } catch (e) { error(type, a, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "JSObject -> JSObject"; setto = window; PluginTest.JSObject_type = setto; now = PluginTest.JSObject_type; addResult (type, setto, "[object Window]", now, row); check(now, "[object Window]", "object", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "JSObject -> String"; setto = window; PluginTest.String_type = setto; now = PluginTest.String_type; addResult (type, setto, "[object Window]", now, row); check(now, "[object Window]", "string", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Java Object -> Java Object"; PluginTest.Float_type = 1.111; orig_hash = PluginTest.Float_type.hashCode(); PluginTest.Object_type = PluginTest.Float_type; new_hash = PluginTest.Object_type.hashCode(); addResult (type, "hashcode=" + orig_hash, orig_hash, new_hash, row); check(new_hash, orig_hash, "number", row); } catch (e) { error(type, "", e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Java Object -> String"; setto = new PluginTest.Packages.DummyObject("Test object"); PluginTest.String_type = setto; now = PluginTest.String_type; addResult (type, setto, "Test object", now, row); check(now, "Test object", "string", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "null -> Java Object (String)"; // Assuming the set tests have passed, we know that object is non-null after this PluginTest.String_type = "Not Null"; setto = null; PluginTest.String_type = setto; now = PluginTest.String_type; addResult (type, setto, null, now, row); check(now, null, "object", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); /* // NULL -> primitive tests are disabled for now due to ambiguity. // Section 2.2 here: http://java.sun.com/javase/6/webnotes/6u10/plugin2/liveconnect/ // States that null to primitive is not allowed, yet, section 2.3.7 claims it is.. try { row = document.createElement("tr"); type = "null -> byte"; // Assuming the set tests have passed, we know that object is non-null after this PluginTest.byte_type = "100"; setto = null; PluginTest.byte_type = setto; now = PluginTest.byte_type; addResult (type, setto, null, now, row); check(now, null, "object", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); */ } icedtea-web-1.6.2/plugin/tests/LiveConnect/PaxHeaders.17941/jsj_set_tests.js0000644000000000000000000000013212654402377023537 xustar0030 mtime=1454507263.263432234 30 atime=1454507327.179579803 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/tests/LiveConnect/jsj_set_tests.js0000644000175000002070000002130112654402377024257 0ustar00jvanekmock00000000000000/****************************************** * Tests for setting members on Java side * ******************************************/ function setMemberTests() { document.getElementById("results").innerHTML += "

JS -> Java set tests:

"; var tbl = document.createElement("table"); var tblBody = document.createElement("tbody"); var columnNames = new Array(); columnNames[0] = "Member Type"; columnNames[1] = "Old Value"; columnNames[2] = "Setting To"; columnNames[3] = "New Value"; columnNames[4] = "Status"; var row; createResultTable(tbl, tblBody, columnNames); PluginTest.setUpForSMTests(); try { row = document.createElement("tr"); type = "int"; setto = 42; curr = PluginTest.i; PluginTest.i = setto; now = PluginTest.i; addResult(type, curr, setto, now, row); check(now, setto, "number", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "double"; setto = 42.42; curr = PluginTest.d; PluginTest.d = setto; now = PluginTest.d; addResult(type, curr, setto, now, row); check(now, setto, "number", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "float"; setto = 42.421; curr = PluginTest.f; PluginTest.f = setto; now = PluginTest.f; addResult(type, curr, 42.42100143432617, now, row); check(now, 42.42100143432617, "number", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "long"; setto = 4294967296; curr = PluginTest.l; PluginTest.l = setto; now = PluginTest.l; addResult(type, curr, setto, now, row); check(now, setto, "number", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "boolean"; setto = true; curr = PluginTest.b; PluginTest.b = setto; now = PluginTest.b; addResult(type, curr, setto, now, row); check(now, setto, "boolean", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "char"; setto = 58; curr = PluginTest.c; PluginTest.c = setto; now = PluginTest.c; addResult(type, curr, setto, now, row); check(now, setto, "number", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "byte"; setto = 43; curr = PluginTest.by; PluginTest.by = setto; now = PluginTest.by; addResult(type, curr, setto, now, row); check(now, setto, "number", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "int[] (element)"; setto = 100; curr = PluginTest.ia[4]; PluginTest.ia[4] = setto; now = PluginTest.ia[4]; addResult(type, curr, setto, now, row); check(now, setto, "number", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "int[] (beyond length)"; setto = 100; curr = PluginTest.ia[30]; PluginTest.ia[30] = setto; now = PluginTest.ia[30]; addResult(type, curr, setto, now, row); check(now, null, "undefined", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Regular string"; setto = 'Test string'; curr = PluginTest.rs; PluginTest.rs = setto; now = PluginTest.rs; addResult(type, curr, setto, now, row); check(now, setto, "string", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "String with special chars"; setto = "𠁎〒£$ǣ€𝍖"; curr = PluginTest.ss; PluginTest.ss = setto; now = PluginTest.ss; addResult(type, curr, setto, now, row); check(now, setto, "string", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "null"; setto = null; curr = PluginTest.n; PluginTest.n = setto; now = PluginTest.n; addResult(type, curr, setto, now, row); check(now, setto, "object", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Integer"; setto = 24; curr = PluginTest.I; PluginTest.I = setto; now = PluginTest.I; addResult(type, curr, setto, now, row); check(now, setto, "object", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Double"; setto = 24.24; curr = PluginTest.D; PluginTest.D = setto; now = PluginTest.D; addResult(type, curr, setto, now, row); check(now, setto, "object", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Float"; setto = 24.124; curr = PluginTest.F; PluginTest.F = setto; now = PluginTest.F; addResult(type, curr, setto, now, row); check(now, setto, "object", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Long"; setto = 6927694924; curr = PluginTest.L; PluginTest.L = setto; now = PluginTest.L; addResult(type, curr, setto, now, row); check(now, setto, "object", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Boolean"; setto = new java.lang.Boolean("true"); curr = PluginTest.B; PluginTest.B = setto; now = PluginTest.B; addResult(type, curr, setto, now, row); check(now, setto, "object", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Character"; setto = new java.lang.Character(64); curr = PluginTest.C; PluginTest.C = setto; now = PluginTest.C; addResult(type, curr, setto, now, row); check(now, setto, "object", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Byte"; setto = new java.lang.Byte(39); curr = PluginTest.By; PluginTest.By = setto; now = PluginTest.By; addResult(type, curr, setto, now, row); check(now, setto, "object", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Double[] (element)"; setto = 100.100; curr = PluginTest.Da1[9]; PluginTest.Da1[9] = setto; now = PluginTest.Da1[9]; addResult(type, curr, setto, now, row); check(now, setto, "object", row); } catch (e) { error(type, setto, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Double[] (Full array)"; curr = PluginTest.Da2; PluginTest.Da2 = java.lang.reflect.Array.newInstance(java.lang.Double, 3); PluginTest.Da2[0] = 1.1; PluginTest.Da2[1] = 2.1; addResult(type, curr, "[1.1,2.1,null]", "["+PluginTest.Da2[0]+","+PluginTest.Da2[1]+","+PluginTest.Da2[2]+"]", row); check("["+PluginTest.Da2[0]+","+PluginTest.Da2[1]+","+PluginTest.Da2[2]+"]", "[1.1,2.1,null]", "string", row); } catch (e) { error(type, "[1.0,2.0,]", e, row); } tblBody.appendChild(row); } icedtea-web-1.6.2/plugin/tests/LiveConnect/PaxHeaders.17941/jsj_get_tests.js0000644000000000000000000000013212654402377023523 xustar0030 mtime=1454507263.263432234 30 atime=1454507327.179579803 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/tests/LiveConnect/jsj_get_tests.js0000644000175000002070000001743712654402377024262 0ustar00jvanekmock00000000000000/******************************************** * Tests for getting members from Java side * ********************************************/ function getMemberTests() { document.getElementById("results").innerHTML += "

JS -> Java get tests:

"; var tbl = document.createElement("table"); var tblBody = document.createElement("tbody"); var columnNames = new Array(); columnNames[0] = "Member Type"; columnNames[1] = "Expected Value"; columnNames[2] = "Actual Value"; columnNames[3] = "Status"; var row; createResultTable(tbl, tblBody, columnNames); PluginTest.setUpForGMTests(); try { row = document.createElement("tr"); type = "int"; expectedvalue = 42; addResult(type, expectedvalue, PluginTest.i, row); check(PluginTest.i, expectedvalue, "number", row); } catch (e) { error(type, expectedvalue, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "double"; expectedvalue = 42.42; addResult(type, expectedvalue, PluginTest.d, row); check(PluginTest.d, expectedvalue, "number", row); } catch (e) { error(type, expectedvalue, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "float"; expectedvalue = 42.099998474121094; addResult(type, expectedvalue, PluginTest.f, row); check(PluginTest.f, expectedvalue, "number", row); } catch (e) { error(type, expectedvalue, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "long"; expectedvalue = 4294967296; addResult(type, expectedvalue, PluginTest.l, row); check(PluginTest.l, expectedvalue, "number", row); } catch (e) { error(type, expectedvalue, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "boolean"; expectedvalue = true; addResult(type, expectedvalue, PluginTest.b, row); check(PluginTest.b, expectedvalue, "boolean", row); } catch (e) { error(type, expectedvalue, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "char"; expectedvalue = 8995; addResult(type, expectedvalue, PluginTest.c, row); check(PluginTest.c, expectedvalue, "number", row); } catch (e) { error(type, expectedvalue, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "byte"; expectedvalue = 43; addResult(type, expectedvalue, PluginTest.by, row); check(PluginTest.by, expectedvalue, "number", row); } catch (e) { error(type, expectedvalue, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "int[] (element access)"; expectedvalue = "1024"; addResult(type, expectedvalue, PluginTest.ia[4], row); check(PluginTest.ia[4], expectedvalue, "number", row); } catch (e) { error(type, expectedvalue, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "int[] (beyond length)"; expectedvalue = null; addResult(type, expectedvalue, PluginTest.ia[30], row); check(PluginTest.ia[30], expectedvalue, "undefined", row); } catch (e) { error(type, expectedvalue, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Regular String"; expectedvalue = "I'm a string!"; addResult(type, expectedvalue, PluginTest.rs, row); check(PluginTest.rs, expectedvalue, "string", row); } catch (e) { error(type, expectedvalue, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "String with special characters"; expectedvalue = "𠁎〒£$ǣ€𝍖"; addResult(type, expectedvalue, PluginTest.ss, row); check(PluginTest.ss, expectedvalue, "string", row); } catch (e) { error(type, expectedvalue, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "null"; expectedvalue = null; addResult(type, expectedvalue, PluginTest.n, row); check(PluginTest.n, expectedvalue, "object", row); } catch (e) { error(type, expectedvalue, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Integer"; expectedvalue = 24; addResult(type, expectedvalue, PluginTest.I, row); check(PluginTest.I, expectedvalue, "object", row); } catch (e) { error(type, expectedvalue, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Double"; expectedvalue = 24.24; addResult(type, expectedvalue, PluginTest.D, row); check(PluginTest.D, expectedvalue, "object", row); } catch (e) { error(type, expectedvalue, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Float"; expectedvalue = 24.124; addResult(type, expectedvalue, PluginTest.F, row); check(PluginTest.F, expectedvalue, "object", row); } catch (e) { error(type, expectedvalue, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Long"; expectedvalue = 6927694924; addResult(type, expectedvalue, PluginTest.L, row); check(PluginTest.L, expectedvalue, "object", row); } catch (e) { error(type, expectedvalue, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Boolean"; expectedvalue = "false"; addResult(type, expectedvalue, PluginTest.B, row); check(PluginTest.B, expectedvalue, "object", row); } catch (e) { error(type, expectedvalue, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Character"; expectedvalue = 'ᔦ'; addResult(type, expectedvalue, PluginTest.C, row); check(PluginTest.C, expectedvalue, "object", row); } catch (e) { error(type, expectedvalue, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Byte"; expectedvalue = 34; addResult(type, expectedvalue, PluginTest.By, row); check(PluginTest.By, expectedvalue, "object", row); } catch (e) { error(type, expectedvalue, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Double[] (element access)"; expectedvalue = "24.24"; addResult(type, expectedvalue, PluginTest.Da1[9], row); check(PluginTest.Da1[9], expectedvalue, "object", row); } catch (e) { error(type, expectedvalue, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Double[] (Full array)"; expectedvalue = "[Ljava.lang.Double;@"; addResult(type, expectedvalue+"*", PluginTest.Da1, row); if (PluginTest.Da1.toString().substr(0,20) == expectedvalue) if (typeof(PluginTest.Da1) == "object") { pass(row); } else { fail(row, "Type mismatch: " + typeof(PluginTest.Da1) + " != object"); } else fail(row, ""); } catch (e) { error(type, expectedvalue, e, row); } tblBody.appendChild(row); } icedtea-web-1.6.2/plugin/tests/LiveConnect/PaxHeaders.17941/jsj_func_rettype_tests.js0000644000000000000000000000013212654402377025453 xustar0030 mtime=1454507263.263432234 30 atime=1454507327.179579803 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/tests/LiveConnect/jsj_func_rettype_tests.js0000644000175000002070000002121112654402377026173 0ustar00jvanekmock00000000000000/*********************************************************************** * Tests to process various return types from Java side function calls * ***********************************************************************/ function rtCallTests() { document.getElementById("results").innerHTML += "

JS -> Java Call tests [Return Type]:

"; var tbl = document.createElement("table"); var tblBody = document.createElement("tbody"); var columnNames = new Array(); columnNames[0] = "Function return type"; columnNames[1] = "Expected Value"; columnNames[2] = "Actual Value"; columnNames[3] = "Status"; var row; createResultTable(tbl, tblBody, columnNames); PluginTest.setUpForParameterTests(); try { row = document.createElement("tr"); type = "int"; expectedvalue = 41; addResult(type, expectedvalue, PluginTest.intReturnTest(), row); check(PluginTest.intReturnTest(), expectedvalue, "number", row); } catch (e) { error(type, expectedvalue, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "double"; expectedvalue = 41.41; addResult(type, expectedvalue, PluginTest.doubleReturnTest(), row); check(PluginTest.doubleReturnTest(), expectedvalue, "number", row); } catch (e) { error(type, expectedvalue, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "float"; expectedvalue = 41.4109992980957; addResult(type, expectedvalue, PluginTest.floatReturnTest(), row); check(PluginTest.floatReturnTest(), expectedvalue, "number", row); } catch (e) { error(type, expectedvalue, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "long"; expectedvalue = 4294967297; addResult(type, expectedvalue, PluginTest.longReturnTest(), row); check(PluginTest.longReturnTest(), expectedvalue, "number", row); } catch (e) { error(type, expectedvalue, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "boolean"; expectedvalue = true; addResult(type, expectedvalue, PluginTest.booleanReturnTest(), row); check(PluginTest.booleanReturnTest(), expectedvalue, "boolean", row); } catch (e) { error(type, expectedvalue, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "char"; expectedvalue = 9001; addResult(type, expectedvalue, PluginTest.charReturnTest(), row); check(PluginTest.charReturnTest(), expectedvalue, "number", row); } catch (e) { error(type, expectedvalue, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "byte"; expectedvalue = 44; addResult(type, expectedvalue, PluginTest.byteReturnTest(), row); check(PluginTest.byteReturnTest(), expectedvalue, "number", row); } catch (e) { error(type, expectedvalue, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "char[] (direct element access)"; expectedvalue = 9234; addResult(type, expectedvalue, PluginTest.charArrayReturnTest()[2], row); check(PluginTest.charArrayReturnTest()[2], expectedvalue, "number", row); } catch (e) { error(type, expectedvalue, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Regular char string"; expectedvalue = "I'm a string too!"; addResult(type, expectedvalue, PluginTest.regularStringReturnTest(), row); check(PluginTest.regularStringReturnTest(), expectedvalue, "string", row); } catch (e) { error(type, expectedvalue, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Special char string"; expectedvalue = "𠁎〒£$ǣ€𝍖"; addResult(type, expectedvalue, PluginTest.specialStringReturnTest(), row); check(PluginTest.specialStringReturnTest(), expectedvalue, "string", row); } catch (e) { error(type, expectedvalue, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "void"; expectedvalue = null; addResult(type, "undefined", PluginTest.voidReturnTest(), row); check(PluginTest.voidReturnTest(), expectedvalue, "undefined", row); } catch (e) { error(type, expectedvalue, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "null"; expectedvalue = null; addResult(type, expectedvalue, PluginTest.nullReturnTest(), row); check(PluginTest.nullReturnTest(), expectedvalue, "object", row); } catch (e) { error(type, expectedvalue, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Integer"; expectedvalue = 14; addResult(type, expectedvalue, PluginTest.IntegerReturnTest(), row); check(PluginTest.IntegerReturnTest(), expectedvalue, "object", row); } catch (e) { error(type, expectedvalue, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Double"; expectedvalue = 14.14; addResult(type, expectedvalue, PluginTest.DoubleReturnTest(), row); check(PluginTest.DoubleReturnTest(), expectedvalue, "object", row); } catch (e) { error(type, expectedvalue, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Float"; expectedvalue = 14.114; addResult(type, expectedvalue, PluginTest.FloatReturnTest(), row); check(PluginTest.FloatReturnTest(), expectedvalue, "object", row); } catch (e) { error(type, expectedvalue, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Long"; expectedvalue = 6927694925; addResult(type, expectedvalue, PluginTest.LongReturnTest(), row); check(PluginTest.LongReturnTest(), expectedvalue, "object", row); } catch (e) { error(type, expectedvalue, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Boolean"; expectedvalue = "false"; addResult(type, expectedvalue, PluginTest.BooleanReturnTest(), row); check(PluginTest.BooleanReturnTest(), expectedvalue, "object", row); } catch (e) { error(type, expectedvalue, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Character"; expectedvalue = "␗"; addResult(type, expectedvalue, PluginTest.CharacterReturnTest(), row); check(PluginTest.CharacterReturnTest(), expectedvalue, "object", row); } catch (e) { error(type, expectedvalue, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Byte"; expectedvalue = 46; addResult(type, expectedvalue, PluginTest.ByteReturnTest(), row); check(PluginTest.ByteReturnTest(), expectedvalue, "object", row); } catch (e) { error(type, expectedvalue, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Character[] (direct element access)"; expectedvalue = "⍑"; addResult(type, expectedvalue, PluginTest.CharacterArrayReturnTest()[1], row); check(PluginTest.CharacterArrayReturnTest()[1], expectedvalue, "object", row); } catch (e) { error(type, expectedvalue, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Character[] (Full array)"; expectedvalue = "[Ljava.lang.Character;@"; addResult(type, expectedvalue+"*", PluginTest.CharacterArrayReturnTest(), row); if (PluginTest.CharacterArrayReturnTest().toString().substr(0,23) == "[Ljava.lang.Character;@") if (typeof(PluginTest.CharacterArrayReturnTest()) == "object") { pass(row); } else { fail(row, "Type mismatch: " + typeof(SMPluginTest.Da) + " != object"); } else fail(row, ""); } catch (e) { error(type, expectedvalue, e, row); } tblBody.appendChild(row); } icedtea-web-1.6.2/plugin/tests/LiveConnect/PaxHeaders.17941/jsj_func_parameters_tests.js0000644000000000000000000000013212654402377026122 xustar0030 mtime=1454507263.262432247 30 atime=1454507327.179579803 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/tests/LiveConnect/jsj_func_parameters_tests.js0000644000175000002070000001524612654402377026655 0ustar00jvanekmock00000000000000 /******************************************************************** * Tests for function parameter coversion when calling Java from JS * ********************************************************************/ function fpCallTests() { document.getElementById("results").innerHTML += "

JS -> Java Call tests [Parameter type]:

"; var tbl = document.createElement("table"); var tblBody = document.createElement("tbody"); var columnNames = new Array(); columnNames[0] = "Parameter type"; columnNames[1] = "Sending"; columnNames[2] = "Expected reply"; columnNames[3] = "Reply"; columnNames[4] = "Status"; var row; createResultTable(tbl, tblBody, columnNames); PluginTest.setUpForReturnTests(); try { row = document.createElement("tr"); type = "int"; send = 1; reply = PluginTest.functioniParamTest(send); addResult(type, send, send, reply, row); check(send, reply, "number", row); } catch (e) { error(type, send, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "double"; send = 1.1; reply = PluginTest.functiondParamTest(send); addResult(type, send, send, reply, row); check(send, reply, "number", row); } catch (e) { error(type, send, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "float"; send = 1.11; reply = PluginTest.functionfParamTest(send); addResult(type, send, send, reply, row); check(send, reply, "number", row); } catch (e) { error(type, send, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "long"; send = 4294967300; reply = PluginTest.functionlParamTest(send); addResult(type, send, send, reply, row); check(send, reply, "number", row); } catch (e) { error(type, send, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "boolean"; send = true; reply = PluginTest.functionbParamTest(send); addResult(type, send, send, reply, row); check("true", reply, "string", row); } catch (e) { error(type, send, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "char"; send = 75; reply = PluginTest.functioncParamTest(send); addResult(type, send, "K", reply, row); check("K", reply, "string", row); } catch (e) { error(type, send, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "byte"; send = 76; reply = PluginTest.functionbyParamTest(send); addResult(type, send, send, reply, row); check(send, reply, "number", row); } catch (e) { error(type, send, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "char[] (simple primitive)"; arr = new Array(); arr[0] = 80; arr[1] = 81; reply = PluginTest.functioncaParamTest(arr); addResult(type, "[80,81]", "P:Q", reply, row); check(reply, "P:Q", "string", row); } catch (e) { error(type, "P:Q", e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "String"; send = "$〒£€𝍖𠁎ǣ"; expectedreply = "$〒£€𝍖𠁎ǣ:java.lang.String"; reply = PluginTest.functionsParamTest(send); addResult(type, send, expectedreply, reply, row); check(expectedreply, reply, "string", row); } catch (e) { error(type, send, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Integer"; send = "32"; expectedreply = send+":java.lang.Integer"; reply = PluginTest.functionIParamTest(send); addResult(type, send, expectedreply, reply, row); check(expectedreply, reply, "string", row); } catch (e) { error(type, send, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Double"; send = 32.0; expectedreply = "32.0:java.lang.Double"; reply = PluginTest.functionDParamTest(send); addResult(type, send, expectedreply, reply, row); check(expectedreply, reply, "string", row); } catch (e) { error(type, send, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Float"; send = 32.01; expectedreply = send+":java.lang.Float"; reply = PluginTest.functionFParamTest(send); addResult(type, send, expectedreply, reply, row); check(expectedreply, reply, "string", row); } catch (e) { error(type, send, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "Long"; send = 4294967301; expectedreply = send+":java.lang.Long"; reply = PluginTest.functionLParamTest(send); addResult(type, send, expectedreply, reply, row); check(expectedreply, reply, "string", row); } catch (e) { error(type, send, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "String/Int [] (mixed)"; arr = new Array(); arr[0] = "s1"; arr[1] = 42; reply = PluginTest.functionsiaParamTest(arr); addResult(type, "[s1,42]", "s1:42", reply, row); check(reply, "s1:42", "string", row); } catch (e) { error(type, "s1:42", e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "DummyObject[] (complex)"; arr = new Array(); arr[0] = new PluginTest.Packages.DummyObject("DummyObject1"); arr[1] = new PluginTest.Packages.DummyObject("DummyObject2"); reply = PluginTest.functioncomplexaParamTest(arr); addResult(type, "[DummyObject1,DummyObjec2]", "DummyObject1:DummyObject2", reply, row); check(reply, "DummyObject1:DummyObject2", "string", row); } catch (e) { error(type, "DummyObject1:DummyObject2", e, row); } tblBody.appendChild(row); } icedtea-web-1.6.2/plugin/tests/LiveConnect/PaxHeaders.17941/jsj_func_overload_tests.js0000644000000000000000000000013212654402377025572 xustar0030 mtime=1454507263.262432247 30 atime=1454507327.179579803 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/tests/LiveConnect/jsj_func_overload_tests.js0000644000175000002070000001442512654402377026323 0ustar00jvanekmock00000000000000 /************************************************************** * Tests for overloaded function resolution when calling Java * * functions from JS * **************************************************************/ function frCallTests() { document.getElementById("results").innerHTML += "

JS -> Java Call tests [Overload and casting]:

"; var tbl = document.createElement("table"); var tblBody = document.createElement("tbody"); var columnNames = new Array(); columnNames[0] = "Available functions"; columnNames[1] = "Expected reply"; columnNames[2] = "Reply"; columnNames[3] = "Status"; var row; createResultTable(tbl, tblBody, columnNames); try { row = document.createElement("tr"); fname = "foo_null_to_nonprim"; available = fname + " [(Integer), (int)]"; expectedreply = fname + ":Integer"; reply = PluginTest.foo_null_to_nonprim(null); addResult(available, expectedreply, reply, row); check(fname + ":Integer", reply, "string", row); } catch (e) { error(null, null, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); fname = "foo_jso_to_jso"; available = fname + " [(JSObject), (String), (String[]), (Object)]"; expectedreply = fname + ":JSObject"; reply = PluginTest.foo_jso_to_jso(window); addResult(available, expectedreply, reply, row); check(fname + ":JSObject", reply, "string", row); } catch (e) { error(null, null, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); fname = "foo_ct_to_ct"; available = fname + " [(OverloadTestHelper1), (OverloadTestHelper2), (OverloadTestHelper3)]"; expectedreply = fname + ":OverloadTestHelper2"; reply = PluginTest.foo_ct_to_ct(new PluginTest.Packages.OverloadTestHelper2()); addResult(available, expectedreply, reply, row); check(fname + ":OverloadTestHelper2", reply, "string", row); } catch (e) { error(null, null, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); fname = "foo_multiprim"; available = fname + " [(double), (String)]"; expectedreply = fname + ":double"; reply = PluginTest.foo_multiprim(1.1); addResult(available, expectedreply, reply, row); check(fname + ":double", reply, "string", row); } catch (e) { error(null, null, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); fname = "foo_multiprim"; available = fname + " [(double), (String)]"; expectedreply = fname + ":double"; reply = PluginTest.foo_multiprim(1.1); addResult(available, expectedreply, reply, row); check(fname + ":double", reply, "string", row); } catch (e) { error(null, null, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); fname = "foo_strnum"; available = fname + " [(double), (OverloadTestHelper1)]"; expectedreply = fname + ":double"; reply = PluginTest.foo_strnum(1.1); addResult(available, expectedreply, reply, row); check(fname + ":double", reply, "string", row); } catch (e) { error(null, null, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); fname = "foo_ct_to_sc"; available = fname + " [(OverloadTestHelper1), (String)]"; expectedreply = fname + ":double"; reply = PluginTest.foo_ct_to_sc(new PluginTest.Packages.OverloadTestHelper2()); addResult(available, expectedreply, reply, row); check(fname + ":OverloadTestHelper1", reply, "string", row); } catch (e) { error(null, null, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); fname = "foo_jv_to_str"; available = fname + " [(String), (JSObject)]"; expectedreply = fname + ":String"; reply = PluginTest.foo_jv_to_str(new PluginTest.Packages.OverloadTestHelper1()); addResult(available, expectedreply, reply, row); check(fname + ":java.lang.String", reply, "string", row); } catch (e) { error(null, null, e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); fname = "foo_jso_to_array"; available = fname + " [(int[]), (Integer), (Integer[])]"; expectedreply = fname + ":int[]"; arr = new Array(); arr[0] = 10; reply = PluginTest.foo_jso_to_array(arr); addResult(available, expectedreply, reply, row); check(fname + ":int[]", reply, "string", row); } catch (e) { error(null, null, e, row); } tblBody.appendChild(row); // Tests where exceptions are expected fname = "foo_null_to_prim"; available = fname + " [(int)] -- Not allowed"; try { row = document.createElement("tr"); expectedreply = null; reply = PluginTest.foo_null_to_prim(null); fail(row, "An exception was expected. Instead, got reply: " + reply); } catch (e) { addResult(available, "[An exception]", e.toString(), row); pass(row); } tblBody.appendChild(row); fname = "foo_jso_to_somethingelse"; available = fname + " [(OverloadTestHelper1)] -- Not allowed"; try { row = document.createElement("tr"); expectedreply = null; reply = PluginTest.foo_jso_to_somethingelse(window); fail(row, "An exception was expected. Instead, got reply: " + reply); } catch (e) { addResult(available, "[An exception]", e.toString(), row); pass(row); } tblBody.appendChild(row); fname = "foo_unsupported"; available = fname + " [(Object[] p)] -- Not allowed"; try { row = document.createElement("tr"); expectedreply = null; reply = PluginTest.foo_unsupported(25); fail(row, "An exception was expected. Instead, got reply: " + reply); } catch (e) { addResult(available, "[An exception]", e.toString(), row); pass(row); } tblBody.appendChild(row); } icedtea-web-1.6.2/plugin/tests/LiveConnect/PaxHeaders.17941/jjs_set_tests.js0000644000000000000000000000013212654402377023537 xustar0030 mtime=1454507263.262432247 30 atime=1454507327.178579817 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/tests/LiveConnect/jjs_set_tests.js0000644000175000002070000002176012654402377024270 0ustar00jvanekmock00000000000000/***************************************** * Tests for setting JS values from Java * *****************************************/ function jjsSetMemberTests() { initVars(); document.getElementById("results").innerHTML += "

JS -> Java set tests:

"; var tbl = document.createElement("table"); var tblBody = document.createElement("tbody"); var columnNames = new Array(); columnNames[0] = "Java Member Type"; columnNames[1] = "Old Value"; columnNames[2] = "Expected value"; columnNames[3] = "Actual Value"; columnNames[4] = "Status"; var row; createResultTable(tbl, tblBody, columnNames); try { row = document.createElement("tr"); type = "int"; oldvalue = setvar; PluginTest.jjsSetIntTest(); expectedvalue = 1; addResult(type, oldvalue, expectedvalue, setvar, row); check(setvar, expectedvalue, "number", row); } catch (e) { error(type, "", e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "java.lang.Integer"; oldvalue = setvar; PluginTest.jjsSetIntegerTest(); expectedvalue = 2; addResult(type, oldvalue, expectedvalue, setvar, row); check(setvar, expectedvalue, "number", row); } catch (e) { error(type, "", e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "double"; oldvalue = setvar; PluginTest.jjsSetdoubleTest(); expectedvalue = 2.1; addResult(type, oldvalue, expectedvalue, setvar, row); check(setvar, expectedvalue, "number", row); } catch (e) { error(type, "", e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "java.lang.Double"; oldvalue = setvar; PluginTest.jjsSetDoubleTest(); expectedvalue = 2.2; addResult(type, oldvalue, expectedvalue, setvar, row); check(setvar, expectedvalue, "number", row); } catch (e) { error(type, "", e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "float"; oldvalue = setvar; PluginTest.jjsSetfloatTest(); expectedvalue = 2.299999952316284 ; addResult(type, oldvalue, expectedvalue, setvar, row); check(setvar, expectedvalue, "number", row); } catch (e) { error(type, "", e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "java.lang.Float"; oldvalue = setvar; PluginTest.jjsSetFloatTest(); expectedvalue = 2.4000000953674316; addResult(type, oldvalue, expectedvalue, setvar, row); check(setvar, expectedvalue, "number", row); } catch (e) { error(type, "", e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "long"; oldvalue = setvar; PluginTest.jjsSetlongTest(); expectedvalue = 4294967296; addResult(type, oldvalue, expectedvalue, setvar, row); check(setvar, expectedvalue, "number", row); } catch (e) { error(type, "", e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "java.lang.Long"; oldvalue = setvar; PluginTest.jjsSetLongTest(); expectedvalue = 4294967297; addResult(type, oldvalue, expectedvalue, setvar, row); check(setvar, expectedvalue, "number", row); } catch (e) { error(type, "", e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "short"; oldvalue = setvar; PluginTest.jjsSetshortTest(); expectedvalue = 3; addResult(type, oldvalue, expectedvalue, setvar, row); check(setvar, expectedvalue, "number", row); } catch (e) { error(type, "", e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "java.lang.Short"; oldvalue = setvar; PluginTest.jjsSetShortTest(); expectedvalue = 4; addResult(type, oldvalue, expectedvalue, setvar, row); check(setvar, expectedvalue, "number", row); } catch (e) { error(type, "", e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "byte"; oldvalue = setvar; PluginTest.jjsSetbyteTest(); expectedvalue = 5; addResult(type, oldvalue, expectedvalue, setvar, row); check(setvar, expectedvalue, "number", row); } catch (e) { error(type, "", e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "java.lang.Byte"; oldvalue = setvar; PluginTest.jjsSetByteTest(); expectedvalue = 6; addResult(type, oldvalue, expectedvalue, setvar, row); check(setvar, expectedvalue, "number", row); } catch (e) { error(type, "", e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "char"; oldvalue = setvar; PluginTest.jjsSetcharTest(); expectedvalue = 8995; addResult(type, oldvalue, expectedvalue, setvar, row); check(setvar, expectedvalue, "number", row); } catch (e) { error(type, "", e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "java.lang.Character"; oldvalue = setvar; PluginTest.jjsSetCharacterTest(); expectedvalue = 8996; addResult(type, oldvalue, expectedvalue, setvar, row); check(setvar, expectedvalue, "number", row); } catch (e) { error(type, "", e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "boolean"; oldvalue = setvar; PluginTest.jjsSetbooleanTest(); expectedvalue = true; addResult(type, oldvalue, expectedvalue, setvar, row); check(setvar, expectedvalue, "boolean", row); } catch (e) { error(type, "", e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "java.lang.Boolean"; oldvalue = setvar; PluginTest.jjsSetBooleanTest(); expectedvalue = false; addResult(type, oldvalue, expectedvalue, setvar, row); check(setvar, expectedvalue, "boolean", row); } catch (e) { error(type, "", e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "java.lang.String"; oldvalue = setvar; PluginTest.jjsSetStringTest(); expectedvalue = "𠁎〒£$ǣ€𝍖"; addResult(type, oldvalue, expectedvalue, setvar, row); check(setvar, expectedvalue, "string", row); } catch (e) { error(type, "", e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "(Complex java object)"; oldvalue = setvar; PluginTest.jjsSetObjectTest(); expectedvalue = PluginTest.dummyObject; addResult(type, oldvalue, expectedvalue, setvar, row); check(setvar, expectedvalue, "object", row); } catch (e) { error(type, "", e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "1D Array"; setvar = new Array(); oldvalue = setvar[1]; PluginTest.jjsSet1DArrayTest(); expectedvalue = 100; addResult(type, oldvalue, expectedvalue, setvar[1], row); check(setvar[1], expectedvalue, "number", row); } catch (e) { error(type, "", e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "2D Array"; setvar = new Array(); setvar[1] = new Array(); oldvalue = setvar[1][2]; PluginTest.jjsSet2DArrayTest(); expectedvalue = 200; addResult(type, oldvalue, expectedvalue, setvar[1][2], row); check(setvar[1][2], expectedvalue, "number", row); } catch (e) { error(type, "", e, row); } tblBody.appendChild(row); } function java_to_js_call_test_info (type, expectedreply, functionreply, row) { cell = document.createElement("td"); cell.setAttribute("width","25%"); cellText = document.createTextNode(type); cell.appendChild(cellText); row.appendChild(cell); cell = document.createElement("td"); cell.setAttribute("width","20%"); cellText = document.createTextNode(expectedreply); cell.appendChild(cellText); row.appendChild(cell); cell = document.createElement("td"); cell.setAttribute("width","20%"); cellText = document.createTextNode(functionreply); cell.appendChild(cellText); row.appendChild(cell); } icedtea-web-1.6.2/plugin/tests/LiveConnect/PaxHeaders.17941/jjs_get_tests.js0000644000000000000000000000013212654402377023523 xustar0030 mtime=1454507263.261432261 30 atime=1454507327.178579817 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/tests/LiveConnect/jjs_get_tests.js0000644000175000002070000000654412654402377024257 0ustar00jvanekmock00000000000000/***************************************** * Tests for reading JS values from Java * *****************************************/ function jjsGetMemberTests() { initVars(); document.getElementById("results").innerHTML += "

JS -> Java get tests:

"; var tbl = document.createElement("table"); var tblBody = document.createElement("tbody"); var columnNames = new Array(); columnNames[0] = "Member Type"; columnNames[1] = "Expected Value"; columnNames[2] = "Actual value"; columnNames[3] = "Status"; var row; createResultTable(tbl, tblBody, columnNames); try { row = document.createElement("tr"); type = "int"; expectedvalue = intvar; tpassed = PluginTest.jjsReadIntTest(); actualValue = PluginTest.value; addResult(type, expectedvalue, PluginTest.value, row); check(tpassed, true, "boolean", row); } catch (e) { error(type, "", e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "double"; expectedvalue = doublevar; tpassed = PluginTest.jjsReadDoubleTest(); actualValue = PluginTest.value; addResult(type, expectedvalue, PluginTest.value, row); check(tpassed, true, "boolean", row); } catch (e) { error(type, "", e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "boolean"; expectedvalue = boolvar; tpassed = PluginTest.jjsReadBooleanTest(); actualValue = PluginTest.value; addResult(type, expectedvalue, PluginTest.value, row); check(tpassed, true, "boolean", row); } catch (e) { error(type, "", e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "string"; expectedvalue = stringvar; tpassed = PluginTest.jjsReadStringTest(); actualValue = PluginTest.value; addResult(type, expectedvalue, PluginTest.value, row); check(tpassed, true, "boolean", row); } catch (e) { error(type, "", e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "object"; expectedvalue = objectvar; tpassed = PluginTest.jjsReadObjectTest(); actualValue = PluginTest.value; addResult(type, expectedvalue, PluginTest.value, row); check(tpassed, true, "boolean", row); } catch (e) { error(type, "", e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "1D Array"; expectedvalue = 100; tpassed = PluginTest.jjsRead1DArrayTest(); actualValue = PluginTest.value; addResult(type, expectedvalue, PluginTest.value, row); check(tpassed, true, "boolean", row); } catch (e) { error(type, "", e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); type = "2D Array"; expectedvalue = 200; tpassed = PluginTest.jjsRead2DArrayTest(); actualValue = PluginTest.value; addResult(type, expectedvalue, PluginTest.value, row); check(tpassed, true, "boolean", row); } catch (e) { error(type, "", e, row); } tblBody.appendChild(row); return; } icedtea-web-1.6.2/plugin/tests/LiveConnect/PaxHeaders.17941/jjs_func_rettype_tests.js0000644000000000000000000000013212654402377025453 xustar0030 mtime=1454507263.261432261 30 atime=1454507327.178579817 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/tests/LiveConnect/jjs_func_rettype_tests.js0000644000175000002070000000336112654402377026201 0ustar00jvanekmock00000000000000/****************************************************** * Tests for parameter conversion between Java and JS * ******************************************************/ function JJSReturnTypeCallTest(type) { if (type == "Number") return 1; if (type == "Boolean") return false; if (type == "String") return "𠁎〒£$ǣ€𝍖"; if (type == "Object") return window; } function runSingleJJSReturnTypeTest(type, row) { try { expectedvalue = JJSReturnTypeCallTest(type); actualvalue = PluginTest.jjsReturnTypeTest(type); addResult(type, expectedvalue, actualvalue, row); check(actualvalue, expectedvalue + "", "string", row); } catch (e) { error(type, "", e, row); } } function jjsCallReturnTypeTests() { document.getElementById("results").innerHTML += "

Java -> JS Call tests (Return Type):

"; var tbl = document.createElement("table"); var tblBody = document.createElement("tbody"); var columnNames = new Array(); columnNames[0] = "Parameter Type (Java side)"; columnNames[1] = "Expected return value"; columnNames[2] = "Actual return value"; columnNames[3] = "Status"; var row; createResultTable(tbl, tblBody, columnNames); row = document.createElement("tr"); runSingleJJSReturnTypeTest("Number", row); tblBody.appendChild(row); row = document.createElement("tr"); runSingleJJSReturnTypeTest("Boolean", row); tblBody.appendChild(row); row = document.createElement("tr"); runSingleJJSReturnTypeTest("String", row); tblBody.appendChild(row); row = document.createElement("tr"); runSingleJJSReturnTypeTest("Object", row); tblBody.appendChild(row); } icedtea-web-1.6.2/plugin/tests/LiveConnect/PaxHeaders.17941/jjs_func_parameters_tests.js0000644000000000000000000000013212654402377026122 xustar0030 mtime=1454507263.250432408 30 atime=1454507327.178579817 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/tests/LiveConnect/jjs_func_parameters_tests.js0000644000175000002070000000715412654402377026654 0ustar00jvanekmock00000000000000/****************************************************** * Tests for parameter conversion between Java and JS * ******************************************************/ function JJSParameterTypeCallTest(type_parameter) { return type_parameter + ":" + typeof(type_parameter); } function runSingleJjsCallParameterTest(type, control_arg, row) { try { expectedvalue = JJSParameterTypeCallTest(control_arg); actualvalue = PluginTest.jjsCallParamTest(type); addResult(type, expectedvalue, actualvalue, row); check(actualvalue, expectedvalue, "string", row); } catch (e) { error(type, "", e, row); } } function jjsCallParameterTests() { document.getElementById("results").innerHTML += "

Java -> JS Call tests (Parameter Type):

"; var tbl = document.createElement("table"); var tblBody = document.createElement("tbody"); var columnNames = new Array(); columnNames[0] = "Parameter Type (Java side)"; columnNames[1] = "Expecting Java to receive"; columnNames[2] = "Java Received"; columnNames[3] = "Status"; var row; createResultTable(tbl, tblBody, columnNames); row = document.createElement("tr"); runSingleJjsCallParameterTest("int", 1, row); tblBody.appendChild(row); row = document.createElement("tr"); runSingleJjsCallParameterTest("double", 1.1, row); tblBody.appendChild(row); row = document.createElement("tr"); runSingleJjsCallParameterTest("float", 1.2000000476837158, row); tblBody.appendChild(row); row = document.createElement("tr"); runSingleJjsCallParameterTest("long", 4294967296, row); tblBody.appendChild(row); row = document.createElement("tr"); runSingleJjsCallParameterTest("short", 2, row); tblBody.appendChild(row); row = document.createElement("tr"); runSingleJjsCallParameterTest("byte", 3, row); tblBody.appendChild(row); row = document.createElement("tr"); runSingleJjsCallParameterTest("char", 8995, row); tblBody.appendChild(row); row = document.createElement("tr"); runSingleJjsCallParameterTest("boolean", true, row); tblBody.appendChild(row); row = document.createElement("tr"); runSingleJjsCallParameterTest("java.lang.Integer", 4, row); tblBody.appendChild(row); row = document.createElement("tr"); runSingleJjsCallParameterTest("java.lang.Double", 4.1, row); tblBody.appendChild(row); row = document.createElement("tr"); runSingleJjsCallParameterTest("java.lang.Float", 4.199999809265137, row); tblBody.appendChild(row); row = document.createElement("tr"); runSingleJjsCallParameterTest("java.lang.Long", 4294967297, row); tblBody.appendChild(row); row = document.createElement("tr"); runSingleJjsCallParameterTest("java.lang.Short", 5, row); tblBody.appendChild(row); row = document.createElement("tr"); runSingleJjsCallParameterTest("java.lang.Byte", 6, row); tblBody.appendChild(row); row = document.createElement("tr"); runSingleJjsCallParameterTest("java.lang.Boolean", false, row); tblBody.appendChild(row); row = document.createElement("tr"); runSingleJjsCallParameterTest("java.lang.Character", 8996, row); tblBody.appendChild(row); row = document.createElement("tr"); runSingleJjsCallParameterTest("java.lang.String", "𠁎〒£$ǣ€𝍖", row); tblBody.appendChild(row); row = document.createElement("tr"); runSingleJjsCallParameterTest("PluginTest.Packages.DummyObject", (new PluginTest.Packages.DummyObject("d1")), row); tblBody.appendChild(row); } icedtea-web-1.6.2/plugin/tests/LiveConnect/PaxHeaders.17941/jjs_eval_test.js0000644000000000000000000000013212654402377023510 xustar0030 mtime=1454507263.250432408 30 atime=1454507327.178579817 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/tests/LiveConnect/jjs_eval_test.js0000644000175000002070000000337212654402377024240 0ustar00jvanekmock00000000000000/****************************************************** * Tests for parameter conversion between Java and JS * ******************************************************/ function jjsEvalTests() { document.getElementById("results").innerHTML += "

Java -> JS Eval Test:

"; var tbl = document.createElement("table"); var tblBody = document.createElement("tbody"); var columnNames = new Array(); columnNames[0] = "Evaluating"; columnNames[1] = "Expected result"; columnNames[2] = "Result"; columnNames[3] = "Status"; var row; createResultTable(tbl, tblBody, columnNames); try { row = document.createElement("tr"); evalstr = "document.location"; expectedvalue = eval(evalstr); actualValue = PluginTest.jjsEvalTest(evalstr); addResult(evalstr, expectedvalue, actualValue, row); check(actualValue, expectedvalue, "string", row); } catch (e) { error(type, "", e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); evalstr = "1+1"; expectedvalue = eval(evalstr); actualValue = PluginTest.jjsEvalTest(evalstr); addResult(evalstr, expectedvalue, actualValue, row); check(actualValue, expectedvalue, "string", row); } catch (e) { error(type, "", e, row); } tblBody.appendChild(row); try { row = document.createElement("tr"); evalstr = "typeof(true)"; expectedvalue = eval(evalstr); actualValue = PluginTest.jjsEvalTest(evalstr); addResult(evalstr, expectedvalue, actualValue, row); check(actualValue, expectedvalue, "string", row); } catch (e) { error(type, "", e, row); } tblBody.appendChild(row); } icedtea-web-1.6.2/plugin/tests/LiveConnect/PaxHeaders.17941/index.html0000644000000000000000000000013212654402377022313 xustar0030 mtime=1454507263.249432421 30 atime=1454507327.178579817 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/tests/LiveConnect/index.html0000644000175000002070000000723212654402377023042 0ustar00jvanekmock00000000000000
JS -> Java read tests
JS -> Java set tests
JS -> Java function parameter conversion tests
JS -> Java function return type tests
JS -> Java function resolution tests
JS -> Java type conversion tests
Java -> JS read tests
Java -> JS set tests
Java -> JS function parameter conversion tests
Java -> JS function return type tests
Java -> JS eval test

icedtea-web-1.6.2/plugin/tests/LiveConnect/PaxHeaders.17941/common.js0000644000000000000000000000013112654402377022143 xustar0030 mtime=1454507263.249432421 29 atime=1454507327.17757983 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/tests/LiveConnect/common.js0000644000175000002070000001672712654402377022704 0ustar00jvanekmock00000000000000/* * Commonly used functions */ var cell, cellText; // reused function updateTotals() { document.getElementById("totals").innerHTML = "" + ""; } function pass(row) { cell = document.createElement("td"); cell.setAttribute("style","color:green;text-align:center;font-weight: bold"); cellText = document.createTextNode("passed"); cell.appendChild(cellText); row.appendChild(cell); passed++; updateTotals(); } function fail(row, reason) { cell = document.createElement("td"); cell.setAttribute("style","color:red;text-align:center;font-weight: bold"); if (reason) cellText = document.createTextNode(reason); else cellText = document.createTextNode("failed"); cell.appendChild(cellText); row.appendChild(cell); failed++; updateTotals(); } function error(type, expected, e, row) { cell = document.createElement("td"); cell.setAttribute("style","color:red;text-align:center;font-weight: bold"); cell.setAttribute("colspan","5"); cellText = document.createTextNode("An error occurred when running this test: " + e); cell.appendChild(cellText); row.appendChild(cell); errored++; updateTotals(); } function check(actual, expected, expectedtype, row) { if (actual == expected) { if (typeof(actual) == expectedtype) { pass(row); } else { fail(row, "Type mismatch: " + typeof(actual) + " != " + expectedtype); } } else { fail(row, "Failed: " + actual + " [" + typeof(actual) + "] != " + expected + " [" + typeof(expected) + "]"); } } function doTest() { passed = 0; failed = 0; errored = 0; document.getElementById("results").innerHTML = ""; updateTotals(); try { if (document.getElementById("testForm").jsjget.checked == 1) getMemberTests(); if (document.getElementById("testForm").jsjset.checked == 1) setMemberTests(); if (document.getElementById("testForm").jsjfp.checked == 1) fpCallTests(); if (document.getElementById("testForm").jsjfrt.checked == 1) rtCallTests(); if (document.getElementById("testForm").jsjfr.checked == 1) frCallTests(); if (document.getElementById("testForm").jsjtc.checked == 1) typeCastingTests(); if (document.getElementById("testForm").jjsget.checked == 1) jjsGetMemberTests(); if (document.getElementById("testForm").jjsset.checked == 1) jjsSetMemberTests(); if (document.getElementById("testForm").jjcparam.checked == 1) jjsCallParameterTests(); if (document.getElementById("testForm").jjcrt.checked == 1) jjsCallReturnTypeTests(); if (document.getElementById("testForm").jjeval.checked == 1) jjsEvalTests(); } catch (e) { document.getElementById("results").innerHTML += "ERROR:
" + e; } } function testAll() { document.getElementById("testForm").jsjget.checked = 1; document.getElementById("testForm").jsjset.checked = 1; document.getElementById("testForm").jsjfp.checked = 1; document.getElementById("testForm").jsjfrt.checked = 1; document.getElementById("testForm").jsjfr.checked = 1; document.getElementById("testForm").jsjtc.checked = 1; document.getElementById("testForm").jjsget.checked = 1; document.getElementById("testForm").jjsset.checked = 1; document.getElementById("testForm").jjcparam.checked = 1; document.getElementById("testForm").jjcrt.checked = 1; document.getElementById("testForm").jjeval.checked = 1; doTest(); } var intvar; var doublevar; var boolvar; var stringvar; var objectvar; var arrayvar; var arrayvar2; var setvar; function initVars() { intvar = 1; doublevar = 1.1; boolvar = true; stringvar = "stringvar"; objectvar = new PluginTest.Packages.DummyObject("DummyObject1"); arrayvar = new Array(); arrayvar[1] = 100; arrayvar2 = new Array(); arrayvar2[1] = new Array(); arrayvar2[1][2] = 200; } function createResultTable(tbl, tblBody, columnNames) { tbl.setAttribute("border", "5"); tbl.setAttribute("width", "100%"); tbl.setAttribute("class", "results"); row = document.createElement("tr"); for (var i=0; i < columnNames.length; i++) { cell = document.createElement("th"); cellText = document.createTextNode(columnNames[i]); cell.appendChild(cellText); row.appendChild(cell); } tblBody.appendChild(row); tbl.appendChild(tblBody); document.getElementById("results").appendChild(tbl); } function addResult() { var row = arguments[arguments.length-1]; // Different length arguments imply different width distributions if (arguments.length == 4) { cell = document.createElement("td"); cell.setAttribute("width","25%"); cellText = document.createTextNode(arguments[0]); cell.appendChild(cellText); row.appendChild(cell); cell = document.createElement("td"); cell.setAttribute("width","20%"); cellText = document.createTextNode(arguments[1]); cell.appendChild(cellText); row.appendChild(cell); cell = document.createElement("td"); cell.setAttribute("width","40%"); cellText = document.createTextNode(arguments[2]); cell.appendChild(cellText); row.appendChild(cell); } else if (arguments.length == 5) { cell = document.createElement("td"); cell.setAttribute("width","25%"); cellText = document.createTextNode(arguments[0]); cell.appendChild(cellText); row.appendChild(cell); cell = document.createElement("td"); cell.setAttribute("width","20%"); cellText = document.createTextNode(arguments[1]); cell.appendChild(cellText); row.appendChild(cell); cell = document.createElement("td"); cell.setAttribute("width","20%"); cellText = document.createTextNode(arguments[2]); cell.appendChild(cellText); row.appendChild(cell); cell = document.createElement("td"); cell.setAttribute("width","20%"); cellText = document.createTextNode(arguments[3]); cell.appendChild(cellText); row.appendChild(cell); } } icedtea-web-1.6.2/plugin/tests/LiveConnect/PaxHeaders.17941/build0000644000000000000000000000013112654402377021337 xustar0030 mtime=1454507263.249432421 29 atime=1454507327.17757983 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/tests/LiveConnect/build0000644000175000002070000000060612654402377022065 0ustar00jvanekmock00000000000000#!/bin/sh # change to dir with tests cd `dirname $0` JAVAC=javac JAR=jar if [ ! -z $JAVA_HOME ]; then JAVAC=$JAVA_HOME/bin/javac JAVAC=$JAVA_HOME/bin/jar fi $JAVAC PluginTest.java DummyObject.java OverloadTestHelper*java $JAR cf PluginTest.jar PluginTest.class DummyObject.class OverloadTestHelper*class rm -f *class echo "Done. Now launch \"firefox file://`pwd`/index.html\"" icedtea-web-1.6.2/plugin/tests/LiveConnect/PaxHeaders.17941/PluginTest.java0000644000000000000000000000013112654402377023256 xustar0030 mtime=1454507263.249432421 29 atime=1454507327.17757983 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/tests/LiveConnect/PluginTest.java0000644000175000002070000005176212654402377024015 0ustar00jvanekmock00000000000000import javax.swing.JApplet; import java.awt.Graphics; import java.awt.*; import java.applet.*; import java.awt.event.*; import netscape.javascript.JSObject; import java.lang.reflect.Array; public class PluginTest extends JApplet { public int i = 42; public double d = 42.42; public float f = 42.1F; public long l = 4294967296L; public boolean b = true; public char c = '\u2323'; public byte by = 43; public String rs = "I'm a string!"; public String ss = "𠁎〒£$ǣ€𝍖"; public Object n = null; public int[] ia = new int[5]; public Integer I = 24; public Double D = 24.24; public Float F = 24.124F; public Long L = 6927694924L; public Boolean B = false; public Character C = '\u1526'; public Byte By = 34; public Double[] Da1 = new Double[10]; public Double[] Da2 = null; public char[] ca = new char[3]; public Character[] Ca = new Character[3]; public void setUpForGMTests() { i = 42; d = 42.42; f = 42.1F; l = 4294967296L; b = true; c = '\u2323'; by = 43; rs = "I'm a string!"; ss = "𠁎〒£$ǣ€𝍖"; n = null; I = 24; D = 24.24; F = 24.124F; L = 6927694924L; B = false; C = '\u1526'; By = 34; ia[4] = 1024; Da1[9] = D; } public void setUpForSMTests() { i = 0; d = 0.0; f = 0F; l = 0L; b = false; c = 'A'; by = 0; rs = ""; ss = ""; n = new String("non-null object"); I = 0; D = 0.0; F = 0F; L = 0L; B = false; C = 'A'; By = null; ia[4] = 0; Da1[9] = D; } /* ***************************************** * JS -> Java Parameter conversion tests * ***************************************** */ public void setUpForReturnTests() { i = 41; d = 41.41; f = 41.411F; l = 4294967297L; b = true; c = '\u2329'; by = 44; rs = "I'm a string too!"; ss = "𠁎〒£$ǣ€𝍖"; n = null; I = 14; D = 14.14; F = 14.114F; L = 6927694925L; B = false; C = '\u2417'; By = 46; } /* ************************************** * JS -> Java invocation return tests * ************************************** */ public int intReturnTest() { return i; } public double doubleReturnTest() { return d; } public float floatReturnTest() { return f; } public long longReturnTest() { return l; } public boolean booleanReturnTest() { return b; } public char charReturnTest() { return c; } public byte byteReturnTest() { return by; } public char[] charArrayReturnTest() { ca[0] = '\u2410'; ca[1] = '\u2411'; ca[2] = '\u2412'; return ca; } public String regularStringReturnTest() { return rs; } public String specialStringReturnTest() { return ss; } public void voidReturnTest() { } public Object nullReturnTest() { return null; } public Integer IntegerReturnTest() { return I; } public Double DoubleReturnTest() { return D; } public void DoubleSetTest(double set) { D = set; } public Float FloatReturnTest() { return F; } public Long LongReturnTest() { return L; } public Boolean BooleanReturnTest() { return B; } public Character CharacterReturnTest() { return C; } public Byte ByteReturnTest() { return By; } public Character[] CharacterArrayReturnTest() { Ca[0] = '\u2350'; Ca[1] = '\u2351'; Ca[2] = '\u2352'; return Ca; } /* ************************************** * JS -> Java parameter passing tests * ************************************** */ public void setUpForParameterTests() { i = 41; d = 41.41; f = 41.411F; l = 4294967297L; b = true; c = '\u2329'; by = 44; rs = "I'm a string too!"; ss = "𠁎〒£$ǣ€𝍖"; n = null; I = 14; D = 14.14; F = 14.114F; L = 6927694925L; B = false; C = '\u2417'; By = 46; } public String functioniParamTest(int i) { String ret = Integer.toString(i); return ret; } public String functiondParamTest(double d) { String ret = Double.toString(d); return ret; } public String functionfParamTest(float f) { String ret = Float.toString(f); return ret; } public String functionlParamTest(long l) { String ret = Long.toString(l); return ret; } public String functionbParamTest(boolean b) { String ret = Boolean.toString(b); return ret; } public String functioncParamTest(char c) { String ret = Character.toString(c); return ret; } public String functionbyParamTest(byte b) { String ret = Byte.toString(b); return ret; } public String functioncaParamTest(char[] ca) { String ret = ""; ret += ca[0]; for (int i=1 ; i < ca.length; i++) { ret += ":" + ca[i]; } return ret; } public String functionsiaParamTest(String[] s) { String ret = s[0]; for (int i=1 ; i < s.length; i++) { ret += ":" + s[i]; } return ret; } public String functionsParamTest(String s) { return s + ":" + s.getClass().getName(); } public String functionIParamTest(Integer p) { String ret = p.toString() + ":" + p.getClass().getName(); return ret; } public String functionDParamTest(Double p) { String ret = p.toString() + ":" + p.getClass().getName(); return ret; } public String functionFParamTest(Float p) { String ret = p.toString() + ":" + p.getClass().getName(); return ret; } public String functionLParamTest(Long p) { String ret = p.toString() + ":" + p.getClass().getName(); return ret; } public String functionBParamTest(Boolean p) { String ret = p.toString() + ":" + p.getClass().getName(); return ret; } public String functionCParamTest(Character p) { String ret = p.toString() + ":" + p.getClass().getName(); return ret; } public String functionBParamTest(Byte p) { String ret = p.toString() + ":" + p.getClass().getName(); return ret; } public String functionCaParamTest(Character p) { String ret = p.toString() + ":" + p.getClass().getName(); return ret; } public String functioncomplexaParamTest(DummyObject[] ca) { String ret = ca[0].toString(); for (int i=1 ; i < ca.length; i++) { ret += ":" + ca[i].toString(); } return ret; } /* *********************************************** * JS -> Java overload resolution plugin tests * *********************************************** */ /* Numeric type to the analogous Java primitive type */ public String foo_num_to_num(int p) { return (new Throwable()).getStackTrace()[0].getMethodName() + ":int"; } // int -> int is lower than: // int to double public String foo_num_to_num(long p) { return (new Throwable()).getStackTrace()[0].getMethodName() + ":long"; } // int to String public String foo_num_to_num(String p) { return (new Throwable()).getStackTrace()[0].getMethodName() + ":" + p.getClass().getName(); } /* Null to any non-primitive type */ public String foo_null_to_nonprim(Integer p) { return (new Throwable()).getStackTrace()[0].getMethodName() + ":Integer"; } // Null to non-prim is better than: // null -> prim (not allowed) public String foo_null_to_nonprim(int p) { return (new Throwable()).getStackTrace()[0].getMethodName() + ":int"; } /* JSObject to JSObject */ public String foo_jso_to_jso(JSObject p) { return (new Throwable()).getStackTrace()[0].getMethodName() + ":JSObject"; } // JSO -> JSO is better than: // JSO -> String public String foo_jso_to_jso(String p) { return (new Throwable()).getStackTrace()[0].getMethodName() + ":" + p.getClass().getName(); } // JSO -> Java array public String foo_jso_to_jso(String[] p) { return (new Throwable()).getStackTrace()[0].getMethodName() + ":" + p.getClass().getName(); } // JSO -> Superclass (Object) public String foo_jso_to_jso(Object p) { return (new Throwable()).getStackTrace()[0].getMethodName() + ":" + p.getClass().getName(); } /* Class type to Class type where the types are equal */ public String foo_ct_to_ct(OverloadTestHelper2 p) { return (new Throwable()).getStackTrace()[0].getMethodName() + ":" + p.getClass().getName(); } // CT -> CT is better than: // CT -> Superclass public String foo_ct_to_ct(OverloadTestHelper1 p) { return (new Throwable()).getStackTrace()[0].getMethodName() + ":" + p.getClass().getName(); } // CT->Subclass public String foo_ct_to_ct(OverloadTestHelper3 p) { return (new Throwable()).getStackTrace()[0].getMethodName() + ":" + p.getClass().getName(); } /* Numeric type to a different primitive type */ public String foo_multiprim(double p) { return (new Throwable()).getStackTrace()[0].getMethodName() + ":double"; } // Num -> Diff. prim. is better than: // Better than anything else.. using string as a dummy public String foo_multiprim(String p) { return (new Throwable()).getStackTrace()[0].getMethodName() + ":" + p.getClass().getName(); } /* String to numeric */ public String foo_strnum(double p) { return (new Throwable()).getStackTrace()[0].getMethodName() + ":double"; } // Str -> Num is better than: // Anything else .. using OverloadTestHelper1 as a dummy public String foo_strnum(OverloadTestHelper1 p) { return (new Throwable()).getStackTrace()[0].getMethodName() + ":" + p.getClass().getName(); } /* Class type to superclass type (with subclass passed) */ public String foo_ct_to_sc(OverloadTestHelper1 p) { return (new Throwable()).getStackTrace()[0].getMethodName() + ":OverloadTestHelper1"; } // CT -> Superclass is better than CT to String public String foo_ct_to_sc(String p) { return (new Throwable()).getStackTrace()[0].getMethodName() + ":" + p.getClass().getName(); } /* Any Java value to String */ public String foo_jv_to_str(String p) { return (new Throwable()).getStackTrace()[0].getMethodName() + ":" + p.getClass().getName(); } // JV -> Str is better than anything else allowed public String foo_jv_to_str(JSObject p) { return (new Throwable()).getStackTrace()[0].getMethodName() + ":" + p.getClass().getName(); } /* JSO to Array (lower cost) */ public String foo_jso_to_array(int[] p) { return (new Throwable()).getStackTrace()[0].getMethodName() + ":int[]"; } // JSO to array is better than: // something not possible public String foo_jso_to_array(Integer p) { return (new Throwable()).getStackTrace()[0].getMethodName() + ":" + p.getClass().getName(); } /****** Not allowed resolutions *******/ /* null to primitive */ public String foo_null_to_prim(int p) { return (new Throwable()).getStackTrace()[0].getMethodName() + ":int"; } /* JSObject to something else */ public String foo_jso_to_somethingelse(OverloadTestHelper1 p) { return (new Throwable()).getStackTrace()[0].getMethodName() + ":" + p.getClass().getName(); } /* Any other conversion not described ... e.g. sending non-array to array */ public String foo_unsupported(Object[] p) { return (new Throwable()).getStackTrace()[0].getMethodName() + ":" + p.getClass().getName(); } /* ****************************** * JS -> Java type conversion * ****************************** */ public byte byte_type = 0; public char char_type = 'A'; public short short_type = 0; public int int_type = 0; public long long_type = 0L; public float float_type = 0F; public double double_type = 0.0; public boolean boolean_type = false; public byte[] byte_array = null; public char[] char_array = null; public short[] short_array = null; public int[] int_array = null; public long[] long_array = null; public float[] float_array = null; public double[] double_array = null; public char[][] char_array_array = null; public Byte Byte_type = null; public Character Character_type = 'A'; public Short Short_type = 0; public Integer Integer_type = 0; public Long Long_type = 0L; public Float Float_type = 0F; public Double Double_type = 0.0; public String String_type = ""; public Boolean Boolean_type = false; public JSObject JSObject_type = null; public Byte[] Byte_array = null; public Character[] Character_array = null; public Short[] Short_array = null; public Integer[] Integer_array = null; public Long[] Long_array = null; public Float[] Float_array = null; public Double[] Double_array = null; public String[] String_array = null; public String[][] String_array_array = null; public Object Object_type = null; public String getArrayAsStr(Object array) { int size = Array.getLength(array); String ret = ""; for (int i=0; i < size; i++) { ret += Array.get(array, i) == null ? "null" : Array.get(array, i).toString(); ret += ","; } if (ret.length() > 0) { ret = ret.substring(0, ret.length()-1); } return ret; } /* ************************** ************************** * Begin Java -> JS tests * ************************** ************************** */ public DummyObject dummyObject = new DummyObject("DummyObject1"); public Object value; private JSObject window; /* ************************* * Java -> JS read tests * ************************* */ public boolean jjsReadIntTest() { value = new Integer(window.getMember("intvar").toString()); return ((Integer) value).equals(1); } public boolean jjsReadDoubleTest() { value = new Double(window.getMember("doublevar").toString()); return ((Double) value).equals(1.1); } public boolean jjsReadBooleanTest() { value = new Boolean(window.getMember("boolvar").toString()); return ((Boolean) value).equals(true); } public boolean jjsReadStringTest() { value = window.getMember("stringvar").toString(); return ((String) value).equals("stringvar"); } public boolean jjsReadObjectTest() { value = window.getMember("objectvar").toString(); return value.equals("DummyObject1"); } public boolean jjsRead1DArrayTest() { value = ((JSObject) window.getMember("arrayvar")).getSlot(1); return value.toString().equals("100"); } public boolean jjsRead2DArrayTest() { value = ((JSObject) ((JSObject) window.getMember("arrayvar2")).getSlot(1)).getSlot(2); return value.toString().equals("200"); } /* ************************** * Java -> JS write tests * ************************** */ public void jjsSetIntTest() { window.setMember("setvar", (int) 1); } public void jjsSetIntegerTest() { window.setMember("setvar", new Integer(2)); } public void jjsSetdoubleTest() { window.setMember("setvar", (double) 2.1); } public void jjsSetDoubleTest() { window.setMember("setvar", new Double(2.2)); } public void jjsSetfloatTest() { window.setMember("setvar", (float) 2.3); } public void jjsSetFloatTest() { window.setMember("setvar", new Float(2.4)); } public void jjsSetshortTest() { window.setMember("setvar", (short) 3); } public void jjsSetShortTest() { window.setMember("setvar", new Short((short) 4)); } public void jjsSetlongTest() { window.setMember("setvar", (long) 4294967296L); } public void jjsSetLongTest() { window.setMember("setvar", new Long(4294967297L)); } public void jjsSetbyteTest() { window.setMember("setvar", (byte) 5); } public void jjsSetByteTest() { window.setMember("setvar", new Byte((byte) 6)); } public void jjsSetcharTest() { window.setMember("setvar", (char) '\u2323'); } public void jjsSetCharacterTest() { window.setMember("setvar", new Character('\u2324')); } public void jjsSetbooleanTest() { window.setMember("setvar", (boolean) true); } public void jjsSetBooleanTest() { window.setMember("setvar", new Boolean(false)); } public void jjsSetStringTest() { window.setMember("setvar", "𠁎〒£$ǣ€𝍖"); } public void jjsSetObjectTest() { dummyObject = new DummyObject("DummyObject2"); window.setMember("setvar", dummyObject); } public void jjsSet1DArrayTest() { ((JSObject) window.getMember("setvar")).setSlot(1, 100); } public void jjsSet2DArrayTest() { ((JSObject) ((JSObject) window.getMember("setvar")).getSlot(1)).setSlot(2, 200); } /* **************************************** * Java -> JS call parameter conversion * **************************************** */ public String jjsCallParamTest(String type) { Object ret = new Object(); int i = 1; double d = 1.1; float f = 1.2F; long l = 4294967296L; short s = 2; byte b = 3; char c = '\u2323'; boolean bl = true; Integer I = 4; Double D = 4.1; Float F = 4.2F; Long L = 4294967297L; Short S = 5; Byte B = 6; Boolean Bl = false; Character C = '\u2324'; String str = "𠁎〒£$ǣ€𝍖"; Object o = new DummyObject("d1"); String callParamTestFuncName = "JJSParameterTypeCallTest"; if (type.equals("int")) ret = window.call(callParamTestFuncName, new Object[]{i}); else if (type.equals("double")) ret = window.call(callParamTestFuncName, new Object[]{d}); else if (type.equals("float")) ret = window.call(callParamTestFuncName, new Object[]{f}); else if (type.equals("long")) ret = window.call(callParamTestFuncName, new Object[]{l}); else if (type.equals("short")) ret = window.call(callParamTestFuncName, new Object[]{s}); else if (type.equals("byte")) ret = window.call(callParamTestFuncName, new Object[]{b}); else if (type.equals("char")) ret = window.call(callParamTestFuncName, new Object[]{c}); else if (type.equals("boolean")) ret = window.call(callParamTestFuncName, new Object[]{bl}); else if (type.equals("java.lang.Integer")) ret = window.call(callParamTestFuncName, new Object[]{I}); else if (type.equals("java.lang.Double")) ret = window.call(callParamTestFuncName, new Object[]{D}); else if (type.equals("java.lang.Float")) ret = window.call(callParamTestFuncName, new Object[]{F}); else if (type.equals("java.lang.Long")) ret = window.call(callParamTestFuncName, new Object[]{L}); else if (type.equals("java.lang.Short")) ret = window.call(callParamTestFuncName, new Object[]{S}); else if (type.equals("java.lang.Byte")) ret = window.call(callParamTestFuncName, new Object[]{B}); else if (type.equals("java.lang.Boolean")) ret = window.call(callParamTestFuncName, new Object[]{Bl}); else if (type.equals("java.lang.Character")) ret = window.call(callParamTestFuncName, new Object[]{C}); else if (type.equals("java.lang.String")) ret = window.call(callParamTestFuncName, new Object[]{str}); else if (type.equals("PluginTest.Packages.DummyObject")) ret = window.call(callParamTestFuncName, new Object[]{o}); else ret = "Unknown param type: " + type; return ret.toString(); } /* ******************************************* * Java -> JS invocation return type tests * ******************************************* */ public String jjsReturnTypeTest(String type) { String returnTypeTestFuncName = "JJSReturnTypeCallTest"; Object ret = window.call(returnTypeTestFuncName, new Object[]{type}); return ret.toString(); } /* *********************************** * Java -> JS invocation eval test * *********************************** */ public String jjsEvalTest(String str) { return window.eval(str).toString(); } public void init() { window = JSObject.getWindow(this); //JSObject.getWindow(this).call("appletLoaded", new Object[]{}); } } icedtea-web-1.6.2/plugin/tests/LiveConnect/PaxHeaders.17941/OverloadTestHelper3.java0000644000000000000000000000013112654402377025016 xustar0030 mtime=1454507263.248432434 29 atime=1454507327.17757983 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/tests/LiveConnect/OverloadTestHelper3.java0000644000175000002070000000010112654402377025532 0ustar00jvanekmock00000000000000public class OverloadTestHelper3 extends OverloadTestHelper2 {} icedtea-web-1.6.2/plugin/tests/LiveConnect/PaxHeaders.17941/OverloadTestHelper2.java0000644000000000000000000000013112654402377025015 xustar0030 mtime=1454507263.248432434 29 atime=1454507327.17757983 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/tests/LiveConnect/OverloadTestHelper2.java0000644000175000002070000000010012654402377025530 0ustar00jvanekmock00000000000000public class OverloadTestHelper2 extends OverloadTestHelper1 {} icedtea-web-1.6.2/plugin/tests/LiveConnect/PaxHeaders.17941/OverloadTestHelper1.java0000644000000000000000000000013112654402377025014 xustar0030 mtime=1454507263.248432434 29 atime=1454507327.17757983 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/tests/LiveConnect/OverloadTestHelper1.java0000644000175000002070000000004412654402377025536 0ustar00jvanekmock00000000000000public class OverloadTestHelper1 {} icedtea-web-1.6.2/plugin/tests/LiveConnect/PaxHeaders.17941/DummyObject.java0000644000000000000000000000013112654402377023402 xustar0030 mtime=1454507263.248432434 29 atime=1454507327.17757983 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/tests/LiveConnect/DummyObject.java0000644000175000002070000000040512654402377024125 0ustar00jvanekmock00000000000000public class DummyObject { private String str; public DummyObject(String s) { this.str = s; } public void setStr(String s) { this.str = s; } public String toString() { return str; } } icedtea-web-1.6.2/plugin/PaxHeaders.17941/icedteanp0000644000000000000000000000013212654402377016622 xustar0030 mtime=1454507263.219432821 30 atime=1454507658.779157357 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/icedteanp/0000755000175000002070000000000012654402377017422 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/plugin/icedteanp/PaxHeaders.17941/java0000644000000000000000000000013212654402377017543 xustar0030 mtime=1454507263.222432781 30 atime=1454507658.779157357 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/icedteanp/java/0000755000175000002070000000000012654402377020343 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/plugin/icedteanp/java/PaxHeaders.17941/sun0000644000000000000000000000013212654402377020350 xustar0030 mtime=1454507263.222432781 30 atime=1454507658.779157357 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/icedteanp/java/sun/0000755000175000002070000000000012654402377021150 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/plugin/icedteanp/java/sun/PaxHeaders.17941/applet0000644000000000000000000000013212654402377021635 xustar0030 mtime=1454507263.247432448 30 atime=1454507658.779157357 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/icedteanp/java/sun/applet/0000755000175000002070000000000012654402377022435 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/plugin/icedteanp/java/sun/applet/PaxHeaders.17941/VoidPluginCallRequest.java0000644000000000000000000000013212654402377027002 xustar0030 mtime=1454507263.247432448 30 atime=1454507327.176579843 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/icedteanp/java/sun/applet/VoidPluginCallRequest.java0000644000175000002070000000410312654402377027523 0ustar00jvanekmock00000000000000/* VoidPluginCallRequest -- represent Java-to-JavaScript requests Copyright (C) 2008 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package sun.applet; public class VoidPluginCallRequest extends PluginCallRequest { public VoidPluginCallRequest(String message, Long reference) { super(message, reference); PluginDebug.debug("VoidPluginCall ", message); } public void parseReturn(String message) { setDone(true); } public Object getObject() { return null; } } icedtea-web-1.6.2/plugin/icedteanp/java/sun/applet/PaxHeaders.17941/TestEnv.java0000644000000000000000000000013212654402377024145 xustar0030 mtime=1454507263.240432541 30 atime=1454507327.176579843 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/icedteanp/java/sun/applet/TestEnv.java0000644000175000002070000001221712654402377024673 0ustar00jvanekmock00000000000000/* TestEnv -- test JavaScript-to-Java calls Copyright (C) 2008 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package sun.applet; public class TestEnv { public static int intField = 103; public int intInstanceField = 7822; public String stringField = "hello"; // z public String complexStringField = "z\uD834\uDD1E\u6C34"; public static void TestIt() { PluginDebug.debug("TestIt"); } public static void TestItBool(boolean arg) { PluginDebug.debug("TestItBool: " + arg); } public static void TestItByte(byte arg) { PluginDebug.debug("TestItByte: " + arg); } public static void TestItChar(char arg) { PluginDebug.debug("TestItChar: " + arg); } public static void TestItShort(short arg) { PluginDebug.debug("TestItShort: " + arg); } public static void TestItInt(int arg) { PluginDebug.debug("TestItInt: " + arg); } public static void TestItLong(long arg) { PluginDebug.debug("TestItLong: " + arg); } public static void TestItFloat(float arg) { PluginDebug.debug("TestItFloat: " + arg); } public static void TestItDouble(double arg) { PluginDebug.debug("TestItDouble: " + arg); } public static void TestItObject(TestEnv arg) { PluginDebug.debug("TestItObject: " + arg); } public static void TestItObjectString(String arg) { PluginDebug.debug("TestItObjectString: " + arg); } public static void TestItIntArray(int[] arg) { PluginDebug.debug("TestItIntArray: " + arg); for (int i = 0; i < arg.length; i++) PluginDebug.debug("ELEMENT: " + i + " " + arg[i]); } public static void TestItObjectArray(String[] arg) { PluginDebug.debug("TestItObjectArray: " + arg); for (int i = 0; i < arg.length; i++) PluginDebug.debug("ELEMENT: " + i + " " + arg[i]); } public static void TestItObjectArrayMulti(String[][] arg) { PluginDebug.debug("TestItObjectArrayMulti: " + arg); for (int i = 0; i < arg.length; i++) for (int j = 0; j < arg[i].length; j++) PluginDebug.debug("ELEMENT: " + i + " " + j + " " + arg[i][j]); } public static boolean TestItBoolReturnTrue() { return true; } public static boolean TestItBoolReturnFalse() { return false; } public static byte TestItByteReturn() { return (byte) 0xfe; } public static char TestItCharReturn() { return 'K'; } public static char TestItCharUnicodeReturn() { return '\u6C34'; } public static short TestItShortReturn() { return 23; } public static int TestItIntReturn() { return 3445; } public static long TestItLongReturn() { return 3242883; } public static float TestItFloatReturn() { return 9.21E4f; } public static double TestItDoubleReturn() { return 8.33E88; } public static Object TestItObjectReturn() { return new String("Thomas"); } public static int[] TestItIntArrayReturn() { return new int[] { 6, 7, 8 }; } public static String[] TestItObjectArrayReturn() { return new String[] { "Thomas", "Brigitte" }; } public static String[][] TestItObjectArrayMultiReturn() { return new String[][] { { "Thomas", "Brigitte" }, { "Lindsay", "Michael" } }; } public int TestItIntInstance(int arg) { PluginDebug.debug("TestItIntInstance: " + this + " " + arg); return 899; } } icedtea-web-1.6.2/plugin/icedteanp/java/sun/applet/PaxHeaders.17941/RequestQueue.java0000644000000000000000000000013212654402377025212 xustar0030 mtime=1454507263.239432554 30 atime=1454507327.176579843 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/icedteanp/java/sun/applet/RequestQueue.java0000644000175000002070000000473612654402377025747 0ustar00jvanekmock00000000000000/* VoidPluginCallRequest -- represent Java-to-JavaScript requests Copyright (C) 2008 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package sun.applet; public class RequestQueue { PluginCallRequest head = null; PluginCallRequest tail = null; private int size = 0; public void post(PluginCallRequest request) { PluginDebug.debug("Securitymanager=", System.getSecurityManager()); if (head == null) { head = tail = request; tail.setNext(null); } else { tail.setNext(request); tail = request; tail.setNext(null); } size++; } public PluginCallRequest pop() { if (head == null) return null; PluginCallRequest ret = head; head = head.getNext(); ret.setNext(null); size--; return ret; } public int size() { return size; } } icedtea-web-1.6.2/plugin/icedteanp/java/sun/applet/PaxHeaders.17941/PluginStreamHandler.java0000644000000000000000000000013212654402377026465 xustar0030 mtime=1454507263.239432554 30 atime=1454507327.176579843 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/icedteanp/java/sun/applet/PluginStreamHandler.java0000644000175000002070000003406412654402377027217 0ustar00jvanekmock00000000000000/* Copyright (C) 2008 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package sun.applet; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.nio.charset.Charset; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.runtime.Translator; import net.sourceforge.jnlp.util.logging.JavaConsole; import net.sourceforge.jnlp.util.logging.OutputController; public class PluginStreamHandler { public static final PluginStreamHandler DummyHandler = new PluginStreamHandler( new InputStream() { @Override public int read() throws IOException { return 0; } }, new OutputStream() { @Override public void write(int b) throws IOException { // } }); private final BufferedReader pluginInputReader; private final BufferedWriter pluginOutputWriter; private final RequestQueue queue = new RequestQueue(); private final PluginMessageConsumer consumer; private volatile boolean shuttingDown = false; public PluginStreamHandler(InputStream inputstream, OutputStream outputstream) { PluginDebug.debug("Current context CL=", Thread.currentThread().getContextClassLoader()); PluginDebug.debug("Creating consumer..."); consumer = new PluginMessageConsumer(this); // Set up input and output pipes. Use UTF-8 encoding. pluginInputReader = new BufferedReader(new InputStreamReader(inputstream, Charset.forName("UTF-8"))); pluginOutputWriter = new BufferedWriter(new OutputStreamWriter (outputstream, Charset.forName("UTF-8"))); } public void startProcessing() { Thread listenerThread = new Thread("PluginStreamHandlerListenerThread") { @Override public void run() { while (true) { PluginDebug.debug("Waiting for data..."); String s = read(); if (s != null) { consumer.queue(s); } else { try { // Close input/output channels to plugin. pluginInputReader.close(); pluginOutputWriter.close(); } catch (IOException exception) { // Deliberately ignore IOException caused by broken // pipe since plugin may have already detached. } AppletSecurityContextManager.dumpStore(0); PluginDebug.debug("APPLETVIEWER: exiting appletviewer"); JNLPRuntime.exit(0); } } } }; listenerThread.start(); } /** * Given a string, reads the first two (space separated) tokens. * * @param message The string to read * @param start The position to start reading at * @param array The array into which the first two tokens are placed * @return Position where the next token starts */ private int readPair(String message, int start, String[] array) { int end = start; array[0] = null; array[1] = null; if (message.length() > start) { int firstSpace = message.indexOf(' ', start); if (firstSpace == -1) { array[0] = message.substring(start); end = message.length(); } else { array[0] = message.substring(start, firstSpace); if (message.length() > firstSpace + 1) { int secondSpace = message.indexOf(' ', firstSpace + 1); if (secondSpace == -1) { array[1] = message.substring(firstSpace + 1); end = message.length(); } else { array[1] = message.substring(firstSpace + 1, secondSpace); end = secondSpace + 1; } } } } PluginDebug.debug("readPair: '", array[0], "' - '", array[1], "' ", end); return end; } public void handleMessage(String message) throws PluginException { int reference = -1; String src = null; String[] privileges = null; String rest = ""; String[] msgComponents = new String[2]; int oldPos = 0; int pos = readPair(message, oldPos, msgComponents); if (msgComponents[0] == null || msgComponents[1] == null) { return; } if (msgComponents[0].startsWith("plugin")) { handlePluginMessage(message); return; } // type and identifier are guaranteed to be there String type = msgComponents[0]; final int identifier = Integer.parseInt(msgComponents[1]); // reference, src and privileges are optional components, // and are guaranteed to be in that order, if they occur oldPos = pos; pos = readPair(message, oldPos, msgComponents); // is there a reference ? if ("reference".equals(msgComponents[0])) { reference = Integer.parseInt(msgComponents[1]); oldPos = pos; pos = readPair(message, oldPos, msgComponents); } // is there a src? if ("src".equals(msgComponents[0])) { src = msgComponents[1]; oldPos = pos; pos = readPair(message, oldPos, msgComponents); } // is there a privileges? if ("privileges".equals(msgComponents[0])) { String privs = msgComponents[1]; privileges = privs.split(","); oldPos = pos; } // rest if (message.length() > oldPos) { rest = message.substring(oldPos); } try { PluginDebug.debug("Breakdown -- type: ", type, " identifier: ", identifier, " reference: ", reference, " src: ", src, " privileges: ", privileges, " rest: \"", rest, "\""); if (rest.contains("JavaScriptGetWindow") || rest.contains("JavaScriptGetMember") || rest.contains("JavaScriptSetMember") || rest.contains("JavaScriptGetSlot") || rest.contains("JavaScriptSetSlot") || rest.contains("JavaScriptEval") || rest.contains("JavaScriptRemoveMember") || rest.contains("JavaScriptCall") || rest.contains("JavaScriptFinalize") || rest.contains("JavaScriptToString")) { finishCallRequest("reference " + reference + " " + rest); return; } final int freference = reference; final String frest = rest; switch (type) { case "instance": PluginAppletViewer.handleMessage(identifier, freference, frest); break; case "context": PluginDebug.debug("Sending to PASC: ", identifier, "/", reference, " and ", rest); AppletSecurityContextManager.handleMessage(identifier, reference, src, privileges, rest); break; } } catch (Exception e) { throw new PluginException(this, identifier, reference, e); } } private void handlePluginMessage(String message) { switch (message) { case "plugin showconsole": if (JavaConsole.isEnabled()){ JavaConsole.getConsole().showConsoleLater(); } else { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, Translator.R("DPJavaConsoleDisabledHint")); } break; case "plugin hideconsole": if (JavaConsole.isEnabled()){ JavaConsole.getConsole().hideConsoleLater(); } else { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, Translator.R("DPJavaConsoleDisabledHint")); } break; default: // else this is something that was specifically requested finishCallRequest(message); break; } } public void postCallRequest(PluginCallRequest request) { synchronized (queue) { queue.post(request); } } private void finishCallRequest(String message) { PluginDebug.debug("DISPATCHCALLREQUESTS 1"); synchronized (queue) { PluginDebug.debug("DISPATCHCALLREQUESTS 2"); PluginCallRequest request = queue.pop(); // make sure we give the message to the right request // in the queue.. for the love of God, MAKE SURE! // first let's be efficient.. if there was only one // request in queue, we're already set if (queue.size() != 0) { int size = queue.size(); int count = 0; while (!request.serviceable(message)) { PluginDebug.debug(request, " cannot service ", message); // something is very wrong.. we have a message to // process, but no one to service it if (count >= size) { throw new RuntimeException("Unable to find processor for message " + message); } // post request at the end of the queue queue.post(request); // Look at the next request request = queue.pop(); count++; } } PluginDebug.debug("DISPATCHCALLREQUESTS 3"); if (request != null) { PluginDebug.debug("DISPATCHCALLREQUESTS 5"); synchronized (request) { request.parseReturn(message); request.notifyAll(); } PluginDebug.debug("DISPATCHCALLREQUESTS 6"); PluginDebug.debug("DISPATCHCALLREQUESTS 7"); } } PluginDebug.debug("DISPATCHCALLREQUESTS 8"); } /** * Read string from plugin. * * @return the read string */ private String read() { String message = null; try { message = pluginInputReader.readLine(); PluginDebug.debug(" PIPE: appletviewer read: ", message); if (message == null || message.equals("shutdown")) { shuttingDown = true; try { // Close input/output channels to plugin. pluginInputReader.close(); pluginOutputWriter.close(); } catch (IOException exception) { // Deliberately ignore IOException caused by broken // pipe since plugin may have already detached. } AppletSecurityContextManager.dumpStore(0); PluginDebug.debug("APPLETVIEWER: exiting appletviewer"); JNLPRuntime.exit(0); } } catch (IOException e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL,e); } return message; } /** * Write string to plugin. * * @param message the message to write */ public void write(String message) { PluginDebug.debug(" PIPE: appletviewer wrote: ", message); synchronized (pluginOutputWriter) { try { pluginOutputWriter.write(message + "\n", 0, message.length()); pluginOutputWriter.write(0); pluginOutputWriter.flush(); } catch (IOException e) { // if we are shutting down, ignore write failures as // pipe may have closed if (!shuttingDown) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL,e); } // either ways, if the pipe is broken, there is nothing // we can do anymore. Don't hang around. PluginDebug.debug("Unable to write to PIPE. APPLETVIEWER exiting"); JNLPRuntime.exit(1); } } } } icedtea-web-1.6.2/plugin/icedteanp/java/sun/applet/PaxHeaders.17941/PluginProxySelector.java0000644000000000000000000000013212654402377026556 xustar0030 mtime=1454507263.239432554 30 atime=1454507327.176579843 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/icedteanp/java/sun/applet/PluginProxySelector.java0000644000175000002070000001521612654402377027306 0ustar00jvanekmock00000000000000/* PluginProxySelector -- proxy selector for all connections from applets and the plugin Copyright (C) 2009 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package sun.applet; import java.io.UnsupportedEncodingException; import java.net.InetSocketAddress; import java.net.Proxy; import java.net.URI; import java.net.URISyntaxException; import java.util.ArrayList; import java.util.List; import com.sun.jndi.toolkit.url.UrlUtil; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.JNLPProxySelector; import net.sourceforge.jnlp.util.logging.OutputController; import net.sourceforge.jnlp.util.TimedHashMap; /** * Proxy selector implementation for plugin network functions. * * This class fetches proxy information from the web browser and * uses that information in the context of all network connection * (plugin specific and applet connections) as applicable * */ public class PluginProxySelector extends JNLPProxySelector { private final TimedHashMap proxyCache = new TimedHashMap<>(); public PluginProxySelector(DeploymentConfiguration config) { super(config); } /** * Selects the appropriate proxy (or DIRECT connection method) for the given URI * * @param uri The URI being accessed * @return A list of Proxy objects that are usable for this URI */ @Override protected List getFromBrowser(URI uri) { List proxyList = new ArrayList<>(); // check cache first Proxy cachedProxy = checkCache(uri); if (cachedProxy != null) { proxyList.add(cachedProxy); return proxyList; } // Nothing usable in cache. Fetch info from browser String requestURI; try { requestURI = convertUriSchemeForProxyQuery(uri); } catch (Exception e) { PluginDebug.debug("Cannot construct URL from ", uri.toString(), " ... falling back to DIRECT proxy"); OutputController.getLogger().log(OutputController.Level.ERROR_ALL,e); proxyList.add(Proxy.NO_PROXY); return proxyList; } Proxy proxy = Proxy.NO_PROXY; Object o = getProxyFromRemoteCallToBrowser(requestURI); // If the browser returned anything, try to parse it. If anything in the try block fails, the fallback is direct connection try { if (o != null) { PluginDebug.debug("Proxy URI = ", o); URI proxyURI = (URI) o; // If origin uri is http/ftp, we're good. If origin uri is not that, the proxy _must_ be socks, else we fallback to direct if (uri.getScheme().startsWith("http") || uri.getScheme().equals("ftp") || proxyURI.getScheme().startsWith("socks")) { Proxy.Type type = proxyURI.getScheme().equals("http") ? Proxy.Type.HTTP : Proxy.Type.SOCKS; InetSocketAddress socketAddr = new InetSocketAddress(proxyURI.getHost(), proxyURI.getPort()); proxy = new Proxy(type, socketAddr); String uriKey = computeKey(uri); proxyCache.put(uriKey, proxy); } else { PluginDebug.debug("Proxy ", proxyURI, " cannot be used for ", uri, ". Falling back to DIRECT"); } } } catch (Exception e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL,e); } proxyList.add(proxy); PluginDebug.debug("Proxy for ", uri.toString(), " is ", proxy); return proxyList; } /** For tests to override. * @param uri of proxy * @return information about proxy */ protected Object getProxyFromRemoteCallToBrowser(String uri) { return PluginAppletViewer.requestPluginProxyInfo(uri); } /** * Checks to see if proxy information is already cached. * * @param uri The URI to check * @return The cached Proxy. null if there is no suitable cached proxy. */ private Proxy checkCache(URI uri) { String uriKey = computeKey(uri); if (proxyCache.get(uriKey) != null) { return proxyCache.get(uriKey); } return null; } /** Compute a key to use for the proxy cache */ private String computeKey(URI uri) { return uri.getScheme() + "://" + uri.getHost(); } public static String convertUriSchemeForProxyQuery(URI uri) throws URISyntaxException, UnsupportedEncodingException { // there is no easy way to get SOCKS proxy info. So, we tell mozilla that we want proxy for // an HTTP uri in case of non http/ftp protocols. If we get back a SOCKS proxy, we can // use that, if we get back an http proxy, we fallback to DIRECT connect String scheme = uri.getScheme(); if (!scheme.startsWith("http") && !scheme.equals("ftp")) { scheme = "http"; } URI result = new URI(scheme, uri.getUserInfo(), uri.getHost(), uri.getPort(), uri.getPath(), uri.getQuery(), uri.getFragment()); return UrlUtil.encode(result.toString(), "UTF-8"); } } icedtea-web-1.6.2/plugin/icedteanp/java/sun/applet/PaxHeaders.17941/PluginProxyInfoRequest.java0000644000000000000000000000013212654402377027242 xustar0030 mtime=1454507263.238432568 30 atime=1454507327.176579843 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/icedteanp/java/sun/applet/PluginProxyInfoRequest.java0000644000175000002070000000612112654402377027765 0ustar00jvanekmock00000000000000/* PluginProxyInfoRequest -- Object representing a request for proxy information from the browser Copyright (C) 2009 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package sun.applet; import java.net.URI; import net.sourceforge.jnlp.util.logging.OutputController; /** * This class represents a request object for proxy information for a given URI */ public class PluginProxyInfoRequest extends PluginCallRequest { URI internal = null; public PluginProxyInfoRequest(String message, Long reference) { super(message, reference); } public void parseReturn(String proxyInfo) { // try to parse the proxy information. If things go wrong, do nothing .. // this will keep internal = null which forces a direct connection PluginDebug.debug("PluginProxyInfoRequest GOT: ", proxyInfo); String[] messageComponents = proxyInfo.split(" "); try { String protocol = messageComponents[4].equals("PROXY") ? "http" : "socks"; String host = messageComponents[5].split(":")[0]; int port = Integer.parseInt(messageComponents[5].split(":")[1]); internal = new URI(protocol, null, host, port, null, null, null); } catch (ArrayIndexOutOfBoundsException aioobe) { // Nothing.. this is expected if there is no proxy } catch (Exception e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL,e); } setDone(true); } public URI getObject() { return this.internal; } } icedtea-web-1.6.2/plugin/icedteanp/java/sun/applet/PaxHeaders.17941/PluginParameterParser.java0000644000000000000000000000013212654402377027031 xustar0030 mtime=1454507263.238432568 30 atime=1454507327.176579843 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/icedteanp/java/sun/applet/PluginParameterParser.java0000644000175000002070000000562312654402377027562 0ustar00jvanekmock00000000000000package sun.applet; import java.util.Arrays; import java.util.HashMap; import java.util.Map; import net.sourceforge.jnlp.PluginParameters; class PluginParameterParser { static private final char DELIMITER_ESCAPE = ':'; static private final String KEY_VALUE_DELIMITER = ";"; /** * Unescape characters passed from C++. * Specifically, "\n" -> new line, "\\" -> "\", "\:" -> ";" * * @param str The string to unescape * @return The unescaped string */ static String unescapeString(String str) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < str.length(); i++) { char chr = str.charAt(i); if (chr != '\\') { sb.append(chr); } else { i++; // Skip ahead one chr = str.charAt(i); if (chr == 'n') { sb.append('\n'); } else if (chr == '\\') { sb.append('\\'); } else if (chr == DELIMITER_ESCAPE) { sb.append(KEY_VALUE_DELIMITER); } } } return sb.toString(); } /** * Parse semi-colon delimited key-value pairs. * @param keyvalString the escaped, semicolon-delimited, string * @return a map of the keys to the values */ static Map parseEscapedKeyValuePairs(String keyvalString) { // Split on ';', ensuring empty strings at end are kept String[] strs = keyvalString.split(KEY_VALUE_DELIMITER, -1 /* Keep empty strings */); Map attributes = new HashMap(); /* Note that we will typically have one empty string at end */ for (int i = 0; i < strs.length - 1; i += 2) { String key = unescapeString(strs[i]).toLowerCase(); String value = unescapeString(strs[i + 1]); attributes.put(key, value); } return attributes; } static boolean isInt(String s) { try { Integer.parseInt(s); return true; } catch(NumberFormatException e) { return false; } } /** * Parsers parameters given a string containing * parameters in quotes. * * @param width default applet width * @param height default applet height * @param parameterString the parameters * @return the attributes in a hash table */ public PluginParameters parse(String width, String height, String parameterString) { Map params = parseEscapedKeyValuePairs(parameterString); if (params.get("width") == null || !isInt(params.get("width"))) { params.put("width", width); } if (params.get("height") == null || !isInt(params.get("height"))) { params.put("height", height); } return new PluginParameters(params); } } icedtea-web-1.6.2/plugin/icedteanp/java/sun/applet/PaxHeaders.17941/PluginObjectStore.java0000644000000000000000000000013212654402377026157 xustar0030 mtime=1454507263.238432568 30 atime=1454507327.176579843 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/icedteanp/java/sun/applet/PluginObjectStore.java0000644000175000002070000001125012654402377026701 0ustar00jvanekmock00000000000000/* PluginObjectStore -- manage identifier-to-object mapping Copyright (C) 2008 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package sun.applet; import java.util.HashMap; import java.util.Map; // Enums are the best way to implement singletons: // Bloch, Joshua. Effective Java, 2nd Edition. Item 3, Chapter 2. ISBN: 0-321-35668-3. enum PluginObjectStore { INSTANCE; private final Map objects = new HashMap(); private final Map counts = new HashMap(); private final Map identifiers = new HashMap(); private final Object lock = new Object(); private boolean wrapped = false; private int nextUniqueIdentifier = 1; public static PluginObjectStore getInstance() { return INSTANCE; } public Object getObject(Integer identifier) { synchronized(lock) { return objects.get(identifier); } } public Integer getIdentifier(Object object) { if (object == null) return 0; synchronized(lock) { return identifiers.get(object); } } public boolean contains(Object object) { if (object != null) { synchronized(lock) { return identifiers.containsKey(object); } } return false; } public boolean contains(int identifier) { synchronized(lock) { return objects.containsKey(identifier); } } private boolean checkNeg() { if (nextUniqueIdentifier < 1) { wrapped = true; nextUniqueIdentifier = 1; } return wrapped; } private int getNextID() { while (checkNeg() && objects.containsKey(nextUniqueIdentifier)) nextUniqueIdentifier++; return nextUniqueIdentifier++; } public void reference(Object object) { synchronized(lock) { Integer identifier = identifiers.get(object); if (identifier == null) { int next = getNextID(); objects.put(next, object); counts.put(next, 1); identifiers.put(object, next); } else { counts.put(identifier, counts.get(identifier) + 1); } } } public void unreference(int identifier) { synchronized(lock) { Integer currentCount = counts.get(identifier); if (currentCount == null) { return; } if (currentCount == 1) { Object object = objects.get(identifier); objects.remove(identifier); counts.remove(identifier); identifiers.remove(object); } else { counts.put(identifier, currentCount - 1); } } } public void dump() { synchronized(lock) { if (PluginDebug.DEBUG) { for (Map.Entry e : objects.entrySet()) { PluginDebug.debug(e.getKey(), "::", e.getValue()); } } } } } icedtea-web-1.6.2/plugin/icedteanp/java/sun/applet/PaxHeaders.17941/PluginMessageHandlerWorker.java0000644000000000000000000000013212654402377030010 xustar0030 mtime=1454507263.234432621 30 atime=1454507327.175579857 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/icedteanp/java/sun/applet/PluginMessageHandlerWorker.java0000644000175000002070000001163412654402377030540 0ustar00jvanekmock00000000000000/* PluginMessageHandlerWorker -- worker thread for handling messages Copyright (C) 2008 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package sun.applet; import net.sourceforge.jnlp.util.logging.OutputController; class PluginMessageHandlerWorker extends Thread { private boolean free = true; private final boolean isPriorityWorker; private final int id; private volatile String message; private PluginStreamHandler streamHandler; private PluginMessageConsumer consumer; public synchronized void notifyHasWork() { notifyAll(); } public synchronized void waitForWork() { try { // Do not wait indefinitely to avoid the potential of deadlock wait(1000); } catch (InterruptedException e) { // Should not typically occur OutputController.getLogger().log(OutputController.Level.ERROR_ALL,e); } } public PluginMessageHandlerWorker( PluginMessageConsumer consumer, PluginStreamHandler streamHandler, int id, boolean isPriorityWorker) { super("PluginMessageHandlerWorker" + id); this.id = id; this.streamHandler = streamHandler; this.isPriorityWorker = isPriorityWorker; this.consumer = consumer; PluginDebug.debug("Worker ", this.id, " (priority=", isPriorityWorker, ") created."); } public void setmessage(String message) { this.message = message; } public void run() { while (true) { if (message != null) { PluginDebug.debug("Consumer (priority=", isPriorityWorker, ") thread ", id, " consuming ", message); // ideally, whoever returns this object should mark it // busy first, but just in case.. busy(); try { streamHandler.handleMessage(message); } catch (PluginException pe) { /* catch the exception and DO NOTHING. The plugin should take over after this error and let the user know. We don't quit because otherwise the exception will spread to the rest of the applets which is a no-no */ } this.message = null; PluginDebug.debug("Consumption (priority=", isPriorityWorker, ") completed by consumer thread ", id); // mark ourselves free again free(); } else { waitForWork(); // Someone woke us up, see if there is work to do // PluginDebug.debug("Consumer thread ", id, " woken..."); } } } public int getWorkerId() { return id; } public void busy() { synchronized (this) { this.free = false; } } public void free() { synchronized (this) { this.free = true; } } public boolean isPriority() { return isPriorityWorker; } public boolean isFree(boolean prioritized) { synchronized (this) { return free && (prioritized == isPriorityWorker); } } public String toString() { return "Worker #" + this.id + "/IsPriority=" + this.isPriorityWorker + "/IsFree=" + this.free + "/Message=" + message; } } icedtea-web-1.6.2/plugin/icedteanp/java/sun/applet/PaxHeaders.17941/PluginMessageConsumer.java0000644000000000000000000000013212654402377027034 xustar0030 mtime=1454507263.233432634 30 atime=1454507327.175579857 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java0000644000175000002070000002173312654402377027565 0ustar00jvanekmock00000000000000/* Copyright (C) 2008 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package sun.applet; import java.util.ArrayList; import java.util.LinkedList; import net.sourceforge.jnlp.util.logging.OutputController; class PluginMessageConsumer { private static final int MAX_PARALLEL_INITS = 1; // Each initialization requires 5 responses (tag, handle, width, proxy, cookie) // before the message stack unlocks/collapses. This works out well because we // want to allow upto 5 parallel tasks anyway private static final int MAX_WORKERS = MAX_PARALLEL_INITS * 4; private static final int PRIORITY_WORKERS = MAX_PARALLEL_INITS * 2; private static LinkedList priorityWaitQueue = new LinkedList(); private LinkedList readQueue = new LinkedList(); private ArrayList workers = new ArrayList(); private PluginStreamHandler streamHandler; private ConsumerThread consumerThread = new ConsumerThread(); public PluginMessageConsumer(PluginStreamHandler streamHandler) { this.streamHandler = streamHandler; this.consumerThread.start(); } /** * Registers a reference to wait for. Responses to registered priority * references get handled by priority worker if normal workers are busy. * * @param reference The reference to give priority to */ public static void registerPriorityWait(Long reference) { PluginDebug.debug("Registering priority for reference ", reference); registerPriorityWait("reference " + reference.toString()); } /** * Registers a string to wait for. * * @param searchString the string to look for in a response */ private static void registerPriorityWait(String searchString) { PluginDebug.debug("Registering priority for string ", searchString); synchronized (priorityWaitQueue) { if (!priorityWaitQueue.contains(searchString)) { priorityWaitQueue.add(searchString); } } } /** * Unregisters a priority string to wait for. * * @param searchString The string to unregister from the priority list */ private static void unRegisterPriorityWait(String searchString) { synchronized (priorityWaitQueue) { priorityWaitQueue.remove(searchString); } } private static String getPriorityStrIfPriority(String message) { // Destroy messages are permanently high priority if (message.endsWith("destroy")) { return "destroy"; } synchronized (priorityWaitQueue) { for (String priorityStr : priorityWaitQueue) { if (message.indexOf(priorityStr) > 0) { return priorityStr; } } } return null; } public void queue(String message) { synchronized (readQueue) { readQueue.addLast(message); } // Wake that lazy consumer thread consumerThread.notifyHasWork(); } protected class ConsumerThread extends Thread { public ConsumerThread() { super("PluginMessageConsumer.ConsumerThread"); } // Notify that either work is ready to do, or a worker is available public synchronized void notifyHasWork() { notifyAll(); } // Wait a bit until either work is ready to do, or a worker is available public synchronized void waitForWork() { try { // Do not wait indefinitely to avoid the potential of deadlock wait(1000); } catch (InterruptedException e) { // Should not typically occur OutputController.getLogger().log(OutputController.Level.ERROR_ALL,e); } } /** * Scans the readQueue for priority messages and brings them to the front */ private void bringPriorityMessagesToFront() { synchronized (readQueue) { // iterate through the list for (int i = 0; i < readQueue.size(); i++) { // remove element at i to inspect it String message = readQueue.remove(i); // if element at i is a priority msg, bring it forward if (getPriorityStrIfPriority(message) != null) { readQueue.addFirst(message); } else { // else keep it where it was readQueue.add(i, message); } // by the end the queue size is the same, so the // position indicator (i) is still valid } } } public void run() { while (true) { String message = null; synchronized (readQueue) { message = readQueue.poll(); } if (message != null) { String priorityStr = getPriorityStrIfPriority(message); boolean isPriorityResponse = (priorityStr != null); //PluginDebug.debug("Message " + message + " (priority=" + isPriorityResponse + ") ready to be processed. Looking for free worker..."); final PluginMessageHandlerWorker worker = getFreeWorker(isPriorityResponse); if (worker == null) { synchronized (readQueue) { readQueue.addFirst(message); } // re-scan to see if any priority message came in bringPriorityMessagesToFront(); continue; // re-loop to try next msg } if (isPriorityResponse) { unRegisterPriorityWait(priorityStr); } worker.setmessage(message); worker.notifyHasWork(); } else { waitForWork(); } } } } private PluginMessageHandlerWorker getFreeWorker(boolean prioritized) { for (PluginMessageHandlerWorker worker : workers) { if (worker.isFree(prioritized)) { PluginDebug.debug("Found free worker (", worker.isPriority(), ") with id ", worker.getWorkerId()); // mark it busy before returning worker.busy(); return worker; } } // If we have less than MAX_WORKERS, create a new worker if (workers.size() <= MAX_WORKERS) { PluginMessageHandlerWorker worker = null; if (workers.size() < (MAX_WORKERS - PRIORITY_WORKERS)) { PluginDebug.debug("Cannot find free worker, creating worker ", workers.size()); worker = new PluginMessageHandlerWorker(this, streamHandler, workers.size(), false); } else if (prioritized) { PluginDebug.debug("Cannot find free worker, creating priority worker ", workers.size()); worker = new PluginMessageHandlerWorker(this, streamHandler, workers.size(), true); } else { return null; } worker.start(); worker.busy(); workers.add(worker); return worker; } // No workers available. Better luck next time! return null; } } icedtea-web-1.6.2/plugin/icedteanp/java/sun/applet/PaxHeaders.17941/PluginMain.java0000644000000000000000000000013212654402377024620 xustar0030 mtime=1454507263.233432634 30 atime=1454507327.175579857 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/icedteanp/java/sun/applet/PluginMain.java0000644000175000002070000002747112654402377025356 0ustar00jvanekmock00000000000000/* VoidPluginCallRequest -- represent Java-to-JavaScript requests Copyright (C) 2008 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ /* * Copyright 1999-2006 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Sun designates this * particular file as subject to the "Classpath" exception as provided * by Sun in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, * CA 95054 USA or visit www.sun.com if you need additional information or * have any questions. */ package sun.applet; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.lang.reflect.Field; import java.net.Authenticator; import java.net.CookieHandler; import java.net.CookieManager; import java.net.ProxySelector; import java.net.URL; import java.net.URLStreamHandler; import java.util.Enumeration; import java.util.Map; import java.util.Properties; import javax.swing.JFrame; import net.sourceforge.jnlp.PluginBridge; import sun.awt.AppContext; import sun.awt.SunToolkit; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.security.JNLPAuthenticator; import net.sourceforge.jnlp.util.logging.JavaConsole; import net.sourceforge.jnlp.util.logging.OutputController; /** * The main entry point into PluginAppletViewer. */ public class PluginMain { // This is used in init(). Getting rid of this is desirable but depends // on whether the property that uses it is necessary/standard. private static final String theVersion = System.getProperty("java.version"); /* Install a handler directly using reflection. This ensures that java doesn't error-out * when javascript is used in a URL. We can then handle these URLs correctly in eg PluginAppletViewer.showDocument(). */ static private void installDummyJavascriptProtocolHandler() { try { Field handlersField = URL.class.getDeclaredField("handlers"); handlersField.setAccessible(true); //hashtable implements map @SuppressWarnings("unchecked") Map handlers = (Map)handlersField.get(null); // Place an arbitrary handler, we only need the URL construction to not error-out handlers.put("javascript", new sun.net.www.protocol.http.Handler()); } catch (Exception e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, "Unable to install 'javascript:' URL protocol handler!"); OutputController.getLogger().log(e); } } /** * The main entry point into AppletViewer. * @param args regular command-line arguments to be passed from native part * @throws java.io.IOException if IO issues occur */ public static void main(String args[]) throws IOException { //we are polite, we reprint start arguments OutputController.getLogger().log("startup arguments: "); for (int i = 0; i < args.length; i++) { String string = args[i]; OutputController.getLogger().log(i + ": "+string); } if (AppContext.getAppContext() == null) { SunToolkit.createNewAppContext(); } installDummyJavascriptProtocolHandler(); if (args.length < 2 || !(new File(args[0]).exists()) || !(new File(args[1]).exists())) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, "Invalid pipe names provided. Refusing to proceed."); JNLPRuntime.exit(1); } DeploymentConfiguration.move14AndOlderFilesTo15StructureCatched(); if (JavaConsole.isEnabled()) { if ((args.length < 3) || !new File(args[2]).exists()) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, "Warning, although console is on, plugin debug connection do not exists. No plugin information will be displayed in console (only java ones)."); } else { JavaConsole.getConsole().createPluginReader(new File(args[2])); } } try { PluginStreamHandler streamHandler = connect(args[0], args[1]); initSecurityContext(streamHandler); PluginAppletViewer.setStreamhandler(streamHandler); PluginAppletViewer.setPluginCallRequestFactory(new PluginCallRequestFactory()); init(); // Streams set. Start processing. streamHandler.startProcessing(); setCookieHandler(streamHandler); JavaConsole.getConsole().setClassLoaderInfoProvider(new JavaConsole.ClassLoaderInfoProvider() { @Override public Map getLoaderInfo() { return PluginAppletSecurityContext.getLoaderInfo(); } }); } catch (Exception e) { OutputController.getLogger().log(e); OutputController.getLogger().log(OutputController.Level.ERROR_ALL, "Something very bad happened. I don't know what to do, so I am going to exit :("); JNLPRuntime.exit(1); } } public static void initSecurityContext(PluginStreamHandler streamHandler) { PluginAppletSecurityContext sc = new PluginAppletSecurityContext(0); sc.prePopulateLCClasses(); PluginAppletSecurityContext.setStreamhandler(streamHandler); AppletSecurityContextManager.addContext(0, sc); } private PluginMain() { // The PluginMain constructor should never, EVER, be called } private static PluginStreamHandler connect(String inPipe, String outPipe) { PluginStreamHandler streamHandler = null; try { streamHandler = new PluginStreamHandler(new FileInputStream(inPipe), new FileOutputStream(outPipe)); PluginDebug.debug("Streams initialized"); } catch (IOException ioe) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL,ioe); } return streamHandler; } private static void init() { Properties avProps = new Properties(); // ADD OTHER RANDOM PROPERTIES // XXX 5/18 need to revisit why these are here, is there some // standard for what is available? // Standard browser properties avProps.put("browser", "sun.applet.AppletViewer"); avProps.put("browser.version", "1.06"); avProps.put("browser.vendor", "Sun Microsystems Inc."); avProps.put("http.agent", "Java(tm) 2 SDK, Standard Edition v" + theVersion); // Define which packages can be extended by applets // XXX 5/19 probably not needed, not checked in AppletSecurity avProps.put("package.restrict.definition.java", "true"); avProps.put("package.restrict.definition.sun", "true"); // Define which properties can be read by applets. // A property named by "key" can be read only when its twin // property "key.applet" is true. The following ten properties // are open by default. Any other property can be explicitly // opened up by the browser user by calling appletviewer with // -J-Dkey.applet=true avProps.put("java.version.applet", "true"); avProps.put("java.vendor.applet", "true"); avProps.put("java.vendor.url.applet", "true"); avProps.put("java.class.version.applet", "true"); avProps.put("os.name.applet", "true"); avProps.put("os.version.applet", "true"); avProps.put("os.arch.applet", "true"); avProps.put("file.separator.applet", "true"); avProps.put("path.separator.applet", "true"); avProps.put("line.separator.applet", "true"); avProps.put("javaplugin.nodotversion", "160_17"); avProps.put("javaplugin.version", "1.6.0_17"); avProps.put("javaplugin.vm.options", ""); // Read in the System properties. If something is going to be // over-written, warn about it. Properties sysProps = System.getProperties(); for (Enumeration e = sysProps.propertyNames(); e.hasMoreElements();) { String key = (String) e.nextElement(); String val = sysProps.getProperty(key); avProps.setProperty(key, val); } // INSTALL THE PROPERTY LIST System.setProperties(avProps); // plug in a custom authenticator and proxy selector boolean installAuthenticator = Boolean.valueOf(JNLPRuntime.getConfiguration() .getProperty(DeploymentConfiguration.KEY_SECURITY_INSTALL_AUTHENTICATOR)); if (installAuthenticator) { Authenticator.setDefault(new JNLPAuthenticator()); } // override the proxy selector set by JNLPRuntime ProxySelector.setDefault(new PluginProxySelector(JNLPRuntime.getConfiguration())); } private static void setCookieHandler(PluginStreamHandler streamHandler) { CookieManager ckManager = new PluginCookieManager(streamHandler); CookieHandler.setDefault(ckManager); } public static JFrame javawsHtmlMain(PluginBridge pb, URL html) { PluginAppletViewer.setStreamhandler(PluginStreamHandler.DummyHandler); PluginMain.initSecurityContext(PluginStreamHandler.DummyHandler); AppletPanel p = PluginAppletViewer.initialize(pb.getParams(), 0, html, 0, pb); JFrame f = new JFrame(); f.setSize(p.getAppletWidth(), p.getAppletHeight()); f.add(p); return f; } } icedtea-web-1.6.2/plugin/icedteanp/java/sun/applet/PaxHeaders.17941/PluginException.java0000644000000000000000000000013212654402377025672 xustar0030 mtime=1454507263.232432648 30 atime=1454507327.175579857 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/icedteanp/java/sun/applet/PluginException.java0000644000175000002070000000435412654402377026423 0ustar00jvanekmock00000000000000/* PluginException -- represents an exception in handling a plugin message Copyright (C) 2008 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package sun.applet; import net.sourceforge.jnlp.util.logging.OutputController; public class PluginException extends Exception { public PluginException(PluginStreamHandler sh, int instance, int reference, Throwable t) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL,t); this.setStackTrace(t.getStackTrace()); AppletSecurityContextManager.dumpStore(0); String message = "instance " + instance + " reference " + reference + " Error " + t.getMessage(); sh.write(message); } } icedtea-web-1.6.2/plugin/icedteanp/java/sun/applet/PaxHeaders.17941/PluginDebug.java0000644000000000000000000000013212654402377024762 xustar0030 mtime=1454507263.232432648 30 atime=1454507327.175579857 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/icedteanp/java/sun/applet/PluginDebug.java0000644000175000002070000000453112654402377025510 0ustar00jvanekmock00000000000000/* VoidPluginCallRequest -- represent Java-to-JavaScript requests Copyright (C) 2008 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package sun.applet; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.util.logging.OutputController; public class PluginDebug { static final boolean DEBUG = JNLPRuntime.isDebug(); public static void debug(Object... messageChunks) { if (DEBUG) { if (messageChunks == null) { messageChunks = new Object[] {null}; } StringBuilder b = new StringBuilder(); for (Object chunk : messageChunks) { b.append(chunk); } OutputController.getLogger().log(OutputController.Level.MESSAGE_DEBUG, b.toString()); } } } icedtea-web-1.6.2/plugin/icedteanp/java/sun/applet/PaxHeaders.17941/PluginCookieManager.java0000644000000000000000000000013212654402377026440 xustar0030 mtime=1454507263.232432648 30 atime=1454507327.175579857 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/icedteanp/java/sun/applet/PluginCookieManager.java0000644000175000002070000001027512654402377027170 0ustar00jvanekmock00000000000000/* PluginCookieManager -- Cookie manager for the plugin Copyright (C) 2009 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package sun.applet; import java.io.IOException; import java.net.CookieManager; import java.net.HttpCookie; import java.net.URI; import java.util.Collections; import java.util.List; import java.util.Map; import com.sun.jndi.toolkit.url.UrlUtil; public class PluginCookieManager extends CookieManager { private PluginStreamHandler streamHandler; public PluginCookieManager(PluginStreamHandler streamHandler) { this.streamHandler = streamHandler; } @Override public Map> get(URI uri, Map> requestHeaders) throws IOException { // pre-condition check if (uri == null || requestHeaders == null) { throw new IllegalArgumentException("Argument is null"); } Map> cookieMap = new java.util.HashMap>(); String cookies = (String) PluginAppletViewer .requestPluginCookieInfo(uri); List cookieHeader = new java.util.ArrayList(); if (cookies != null && cookies.length() > 0) cookieHeader.add(cookies); // Add anything else that mozilla didn't add for (HttpCookie cookie : getCookieStore().get(uri)) { // apply path-matches rule (RFC 2965 sec. 3.3.4) if (pathMatches(uri.getPath(), cookie.getPath())) { cookieHeader.add(cookie.toString()); } } cookieMap.put("Cookie", cookieHeader); return Collections.unmodifiableMap(cookieMap); } private boolean pathMatches(String path, String pathToMatchWith) { if (path == pathToMatchWith) return true; if (path == null || pathToMatchWith == null) return false; if (path.startsWith(pathToMatchWith)) return true; return false; } @Override public void put(URI uri, Map> responseHeaders) throws IOException { super.put(uri, responseHeaders); for (Map.Entry> headerEntry : responseHeaders.entrySet()) { String type = headerEntry.getKey(); if ("Set-Cookie".equalsIgnoreCase(type) || "Set-Cookie2".equalsIgnoreCase(type)) { List cookies = headerEntry.getValue(); for (String cookie : cookies) { streamHandler.write("plugin PluginSetCookie reference -1 " + UrlUtil.encode(uri.toString(), "UTF-8") + " " + cookie); } } } } } icedtea-web-1.6.2/plugin/icedteanp/java/sun/applet/PaxHeaders.17941/PluginCookieInfoRequest.java0000644000000000000000000000013212654402377027332 xustar0030 mtime=1454507263.231432661 30 atime=1454507327.175579857 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/icedteanp/java/sun/applet/PluginCookieInfoRequest.java0000644000175000002070000000555012654402377030062 0ustar00jvanekmock00000000000000/* PluginCookieInfoRequest -- Object representing a request for cookie information from the browser Copyright (C) 2009 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package sun.applet; /** * This class represents a request object for cookie information for a given URI */ public class PluginCookieInfoRequest extends PluginCallRequest { String cookieString = new String(); public PluginCookieInfoRequest(String message, Long reference) { super(message, reference); } public void parseReturn(String cookieInfo) { // try to parse the proxy information. If things go wrong, do nothing .. // this will keep internal = null which forces a direct connection PluginDebug.debug("PluginCookieInfoRequest GOT: ", cookieInfo); // skip 'plugin' marker cookieInfo = cookieInfo.substring(cookieInfo.indexOf(' ') + 1); // skip 'PluginCookieInfo' tag cookieInfo = cookieInfo.substring(cookieInfo.indexOf(' ') + 1); // skip 'reference' tag cookieInfo = cookieInfo.substring(cookieInfo.indexOf(' ') + 1); // skip reference # and get the rest cookieString = cookieInfo.substring(cookieInfo.indexOf(' ') + 1); setDone(true); } public String getObject() { return this.cookieString; } } icedtea-web-1.6.2/plugin/icedteanp/java/sun/applet/PaxHeaders.17941/PluginClassLoader.java0000644000000000000000000000013212654402377026130 xustar0030 mtime=1454507263.231432661 30 atime=1454507327.175579857 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/icedteanp/java/sun/applet/PluginClassLoader.java0000644000175000002070000000373212654402377026660 0ustar00jvanekmock00000000000000/* VoidPluginCallRequest -- represent Java-to-JavaScript requests Copyright (C) 2008 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package sun.applet; public class PluginClassLoader extends ClassLoader { public PluginClassLoader() { super(); } public Class loadClass(String name, boolean resolve) throws ClassNotFoundException { return super.loadClass(name, resolve); } } icedtea-web-1.6.2/plugin/icedteanp/java/sun/applet/PaxHeaders.17941/PluginCallRequestFactory.java0000644000000000000000000000013212654402377027510 xustar0030 mtime=1454507263.231432661 30 atime=1454507327.175579857 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/icedteanp/java/sun/applet/PluginCallRequestFactory.java0000644000175000002070000000506712654402377030243 0ustar00jvanekmock00000000000000/* PluginCallRequestFactory -- contains factory methods for dispatching an appropriate PluginCallRequest. Copyright (C) 2008 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package sun.applet; public class PluginCallRequestFactory { public PluginCallRequest getPluginCallRequest(String id, String message, Long reference) { if ("member".equals(id)) { return new GetMemberPluginCallRequest(message, reference); } else if ("void".equals(id)) { return new VoidPluginCallRequest(message, reference); } else if ("window".equals(id)) { return new GetWindowPluginCallRequest(message, reference); } else if ("proxyinfo".equals(id)) { return new PluginProxyInfoRequest(message, reference); } else if ("cookieinfo".equals(id)) { return new PluginCookieInfoRequest(message, reference); } else { throw new RuntimeException("Unknown plugin call request type requested from factory"); } } } icedtea-web-1.6.2/plugin/icedteanp/java/sun/applet/PaxHeaders.17941/PluginCallRequest.java0000644000000000000000000000013112654402377026157 xustar0030 mtime=1454507263.231432661 29 atime=1454507327.17457987 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/icedteanp/java/sun/applet/PluginCallRequest.java0000644000175000002070000000542612654402377026712 0ustar00jvanekmock00000000000000/* PluginCallRequest -- represent Java-to-JavaScript requests Copyright (C) 2008 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package sun.applet; public abstract class PluginCallRequest { private String message; private Long reference; private PluginCallRequest next; private boolean done = false; public PluginCallRequest(String message, Long reference) { this.message = message; this.reference = reference; } public String getMessage() { return this.message; } public boolean isDone() { return this.done; } public boolean setDone(boolean done) { return this.done = done; } public void setNext(PluginCallRequest next) { this.next = next; } public PluginCallRequest getNext() { return this.next; } /** * Returns whether the given message is serviceable by this object * * @param message The message to service * @return boolean indicating if message is serviceable */ public boolean serviceable(String message) { return message.contains("reference " + reference); } public abstract void parseReturn(String message); public abstract Object getObject(); } icedtea-web-1.6.2/plugin/icedteanp/java/sun/applet/PaxHeaders.17941/PluginAppletViewer.java0000644000000000000000000000013112654402377026342 xustar0030 mtime=1454507263.230432674 29 atime=1454507327.17457987 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java0000644000175000002070000017172512654402377027103 0ustar00jvanekmock00000000000000/* PluginAppletViewer -- Handles embedding of the applet panel Copyright (C) 2008 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ /* * Copyright 1995-2004 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Sun designates this * particular file as subject to the "Classpath" exception as provided * by Sun in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, * CA 95054 USA or visit www.sun.com if you need additional information or * have any questions. */ package sun.applet; import com.sun.jndi.toolkit.url.UrlUtil; import java.applet.Applet; import java.applet.AppletContext; import java.applet.AudioClip; import java.awt.BorderLayout; import java.awt.Component; import java.awt.Dimension; import java.awt.Frame; import java.awt.Graphics; import java.awt.Image; import java.awt.Insets; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.awt.event.WindowListener; import java.awt.print.PageFormat; import java.awt.print.Printable; import java.io.IOException; import java.io.InputStream; import java.io.UnsupportedEncodingException; import java.net.SocketPermission; import java.net.URI; import java.net.URL; import java.net.URLConnection; import java.security.AccessController; import java.security.AllPermission; import java.security.PrivilegedAction; import java.util.Enumeration; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.Vector; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.TimeUnit; import java.util.concurrent.locks.Condition; import java.util.concurrent.locks.ReentrantLock; import javax.swing.SwingUtilities; import net.sourceforge.jnlp.LaunchException; import net.sourceforge.jnlp.NetxPanel; import net.sourceforge.jnlp.PluginBridge; import net.sourceforge.jnlp.PluginParameters; import net.sourceforge.jnlp.runtime.JNLPClassLoader; import net.sourceforge.jnlp.runtime.JNLPRuntime; import static net.sourceforge.jnlp.runtime.Translator.R; import net.sourceforge.jnlp.security.ConnectionFactory; import net.sourceforge.jnlp.security.appletextendedsecurity.AppletSecurityLevel; import net.sourceforge.jnlp.security.appletextendedsecurity.AppletStartupSecuritySettings; import net.sourceforge.jnlp.splashscreen.SplashController; import net.sourceforge.jnlp.splashscreen.SplashPanel; import net.sourceforge.jnlp.splashscreen.SplashUtils; import net.sourceforge.jnlp.util.UrlUtils; import net.sourceforge.jnlp.util.logging.OutputController; import sun.awt.AppContext; import sun.awt.SunToolkit; import sun.awt.X11.XEmbeddedFrame; /* */ // FIXME: declare JSProxy implementation @SuppressWarnings("serial") public class PluginAppletViewer extends XEmbeddedFrame implements AppletContext, Printable, SplashController { /** * Enumerates the current status of an applet * * PRE_INIT -> Parsing and initialization phase * INIT_COMPLETE -> Initialization complete, reframe pending * REFRAME_COMPLETE -> Reframe complete, applet is initialized and usable by the user * INACTIVE -> Browser has directed that the applet be destroyed (this state is non-overridable except by DESTROYED) * DESTROYED -> Applet has been destroyed */ private static enum PAV_INIT_STATUS { PRE_INIT, INIT_COMPLETE, REFRAME_COMPLETE, INACTIVE, DESTROYED }; /** * The panel in which the applet is being displayed. */ private NetxPanel panel; static final ReentrantLock panelLock = new ReentrantLock(); // CONDITION PREDICATE: panel.isAlive() static final Condition panelLive = panelLock.newCondition(); private int identifier; // Instance identifier -> PluginAppletViewer object. private static final ConcurrentMap applets = new ConcurrentHashMap<>(); private static final ReentrantLock appletsLock = new ReentrantLock(); // CONDITION PREDICATE: !applets.containsKey(identifier) private static final Condition appletAdded = appletsLock.newCondition(); private static PluginStreamHandler streamhandler; private static PluginCallRequestFactory requestFactory; private static final ConcurrentMap status = new ConcurrentHashMap<>(); private static final ReentrantLock statusLock = new ReentrantLock(); // CONDITION PREDICATE: !status.get(identifier).equals(PAV_INIT_STATUS.INIT_COMPLETE) private static final Condition initComplete = statusLock.newCondition(); private WindowListener windowEventListener = null; private AppletEventListener appletEventListener = null; public static final long APPLET_TIMEOUT = 180000000000L; // 180s in ns private static final Object requestMutex = new Object(); private static long requestIdentityCounter = 0L; private Image bufFrameImg; private Graphics bufFrameImgGraphics; private SplashPanel splashPanel; private static long REQUEST_TIMEOUT=60000;//60s private static void waitForRequestCompletion(PluginCallRequest request) { try { if (!request.isDone()) { request.wait(REQUEST_TIMEOUT); } if (!request.isDone()) { // Do not wait indefinitely to avoid the potential of deadlock throw new RuntimeException("Possible deadlock, releasing"); } } catch (InterruptedException ex) { throw new RuntimeException("Interrupted waiting for call request.", ex); } } /** * Null constructor to allow instantiation via newInstance() */ public PluginAppletViewer() { } public static PluginAppletViewer framePanel(int identifier, long handle, int width, int height, NetxPanel panel) { PluginDebug.debug("Framing ", panel); // SecurityManager MUST be set, and only privileged code may call framePanel() System.getSecurityManager().checkPermission(new AllPermission()); PluginAppletViewer appletFrame = new PluginAppletViewer(handle, identifier, panel); appletFrame.setSize(width, height); appletFrame.appletEventListener = new AppletEventListener(appletFrame, appletFrame); panel.addAppletListener(appletFrame.appletEventListener); // Clear references, if any if (applets.containsKey(identifier)) { PluginAppletViewer oldFrame = applets.get(identifier); oldFrame.remove(panel); panel.removeAppletListener(oldFrame.appletEventListener); } appletsLock.lock(); try { applets.put(identifier, appletFrame); appletAdded.signalAll(); } finally { appletsLock.unlock(); } PluginDebug.debug(panel, " framed"); return appletFrame; } /** * Create new plugin appletviewer frame */ private PluginAppletViewer(long handle, final int identifier, NetxPanel appletPanel) { super(handle, true); this.identifier = identifier; this.panel = appletPanel; synchronized(appletPanels) { if (!appletPanels.contains(panel)) appletPanels.addElement(panel); } windowEventListener = new WindowAdapter() { @Override public void windowClosing(WindowEvent evt) { destroyApplet(identifier); } @Override public void windowIconified(WindowEvent evt) { appletStop(); } @Override public void windowDeiconified(WindowEvent evt) { appletStart(); } }; addWindowListener(windowEventListener); final AppletPanel fPanel = panel; try { SwingUtilities.invokeAndWait(new SplashCreator(fPanel)); } catch (Exception e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL,e); // Not much we can do other than print } } @Override public void replaceSplash(final SplashPanel newSplash) { if (splashPanel == null) { return; } if (newSplash == null) { removeSplash(); return; } try { SwingUtilities.invokeAndWait(new Runnable() { @Override public void run() { splashPanel.getSplashComponent().setVisible(false); splashPanel.stopAnimation(); remove(splashPanel.getSplashComponent()); newSplash.setPercentage(splashPanel.getPercentage()); newSplash.setSplashWidth(splashPanel.getSplashWidth()); newSplash.setSplashHeight(splashPanel.getSplashHeight()); newSplash.adjustForSize(); splashPanel = newSplash; add("Center", splashPanel.getSplashComponent()); pack(); } }); } catch (Exception e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL,e); // Not much we can do other than print } } @Override public void removeSplash() { if (splashPanel == null) { return; } try { SwingUtilities.invokeAndWait(new Runnable() { @Override public void run() { splashPanel.getSplashComponent().setVisible(false); splashPanel.stopAnimation(); removeAll(); setLayout(new BorderLayout()); //remove(splashPanel.getSplashComponent()); splashPanel = null; //remove(panel); // Re-add the applet to notify container add(panel); panel.setVisible(true); pack(); } }); } catch (Exception e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL,e); // Not much we can do other than print } } @Override public int getSplashWidth() { if (splashPanel != null) { return splashPanel.getSplashWidth(); } else { return -1; } } @Override public int getSplashHeigth() { if (splashPanel != null) { return splashPanel.getSplashHeight(); } else { return -1; } } private static class AppletEventListener implements AppletListener { final Frame frame; final PluginAppletViewer appletViewer; public AppletEventListener(Frame frame, PluginAppletViewer appletViewer) { this.frame = frame; this.appletViewer = appletViewer; } @Override public void appletStateChanged(AppletEvent evt) { AppletPanel src = (AppletPanel) evt.getSource(); panelLock.lock(); try { panelLive.signalAll(); } finally { panelLock.unlock(); } switch (evt.getID()) { case AppletPanel.APPLET_RESIZE: { if (src != null) { appletViewer.setSize(appletViewer.getPreferredSize()); appletViewer.validate(); } break; } case AppletPanel.APPLET_LOADING_COMPLETED: { Applet a = src.getApplet(); // sun.applet.AppletPanel // Fixed #4754451: Applet can have methods running on main // thread event queue. // // The cause of this bug is that the frame of the applet // is created in main thread group. Thus, when certain // AWT/Swing events are generated, the events will be // dispatched through the wrong event dispatch thread. // // To fix this, we rearrange the AppContext with the frame, // so the proper event queue will be looked up. // // Swing also maintains a Frame list for the AppContext, // so we will have to rearrange it as well. // if (a != null) { AppletPanel.changeFrameAppContext(frame, SunToolkit.targetToAppContext(a)); } else { AppletPanel.changeFrameAppContext(frame, AppContext.getAppContext()); } updateStatus(appletViewer.identifier, PAV_INIT_STATUS.INIT_COMPLETE); break; } case AppletPanel.APPLET_START: { if (src.status != AppletPanel.APPLET_INIT && src.status != AppletPanel.APPLET_STOP) { String s="Applet started, but but reached invalid state"; PluginDebug.debug(s); SplashPanel sp=SplashUtils.getErrorSplashScreen(appletViewer.panel.getWidth(), appletViewer.panel.getHeight(), new Exception(s)); appletViewer.replaceSplash(sp); } break; } case AppletPanel.APPLET_ERROR: { String s="Undefined error causing applet not to staart appeared"; PluginDebug.debug(s); SplashPanel sp=SplashUtils.getErrorSplashScreen(appletViewer.panel.getWidth(), appletViewer.panel.getHeight(), new Exception(s)); appletViewer.replaceSplash(sp); break; } } } } public static void setStreamhandler(PluginStreamHandler sh) { streamhandler = sh; } public static void setPluginCallRequestFactory(PluginCallRequestFactory rf) { requestFactory = rf; } private static void handleInitializationMessage(int identifier, String message) throws IOException, LaunchException { /* The user has specified via a global setting that applets should not be run.*/ if (AppletStartupSecuritySettings.getInstance().getSecurityLevel() == AppletSecurityLevel.DENY_ALL) { throw new LaunchException(null, null, R("LSFatal"), R("LCClient"), R("LUnsignedApplet"), R("LUnsignedAppletPolicyDenied")); } // If there is a key for this status, it means it // was either initialized before, or destroy has been // processed. Stop moving further. if (updateStatus(identifier, PAV_INIT_STATUS.PRE_INIT) != null) { return; } // Extract the information from the message String[] msgParts = new String[4]; for (int i = 0; i < 3; i++) { int spaceLocation = message.indexOf(' '); int nextSpaceLocation = message.indexOf(' ', spaceLocation + 1); msgParts[i] = message.substring(spaceLocation + 1, nextSpaceLocation); message = message.substring(nextSpaceLocation + 1); } long handle = Long.parseLong(msgParts[0]); String width = msgParts[1]; String height = msgParts[2]; int spaceLocation = message.indexOf(' ', "tag".length() + 1); String documentBase = message.substring("tag".length() + 1, spaceLocation); String paramString = message.substring(spaceLocation + 1); PluginDebug.debug("Handle = ", handle, "\n", "Width = ", width, "\n", "Height = ", height, "\n", "DocumentBase = ", documentBase, "\n", "Params = ", paramString); JNLPRuntime.saveHistory(documentBase); AppletMessageHandler amh = new AppletMessageHandler("appletviewer"); URL url = new URL(documentBase); URLConnection conn = ConnectionFactory.getConnectionFactory().openConnection(url); /* The original URL may have been redirected - this * sets it to whatever URL/codebase we ended up getting */ url = conn.getURL(); ConnectionFactory.getConnectionFactory().disconnect(conn); PluginParameters params = new PluginParameterParser().parse(width, height, paramString); // Let user know we are starting up streamhandler.write("instance " + identifier + " status " + amh.getMessage("status.start")); initialize(params, handle, url, identifier, null); } public static AppletPanel initialize(PluginParameters params, long handle, URL url, int identifier, PluginBridge pb) { PluginAppletPanelFactory factory = new PluginAppletPanelFactory(); AppletPanel p = factory.createPanel(streamhandler, identifier, handle, url, params, pb); long maxTimeToSleep = APPLET_TIMEOUT; appletsLock.lock(); try { while (!applets.containsKey(identifier) && maxTimeToSleep > 0) { // Map is populated only by reFrame maxTimeToSleep -= waitTillTimeout(appletsLock, appletAdded, maxTimeToSleep); } } finally { appletsLock.unlock(); } // If wait exceeded maxWait, we timed out. Throw an exception if (maxTimeToSleep <= 0) { // Caught in handleMessage throw new RuntimeException("Applet initialization timeout"); } // We should not try to destroy an applet during // initialization. It may cause an inconsistent state, // which would bad if it's a trusted applet that // read/writes to files waitForAppletInit(applets.get(identifier).panel); // Should we proceed with reframing? PluginDebug.debug("Init complete"); if (updateStatus(identifier, PAV_INIT_STATUS.REFRAME_COMPLETE).equals(PAV_INIT_STATUS.INACTIVE)) { destroyApplet(identifier); return null; } return p; } /** * Handle an incoming message from the plugin. * @param identifier id of plugin * @param reference reference id of message * @param message text itself */ public static void handleMessage(int identifier, int reference, String message) { PluginDebug.debug("PAV handling: ", message); try { if (message.startsWith("handle")) { handleInitializationMessage(identifier, message); } else if (message.startsWith("destroy")) { // Set it inactive, and try to do cleanup is applicable PAV_INIT_STATUS previousStatus = updateStatus(identifier, PAV_INIT_STATUS.INACTIVE); PluginDebug.debug("Destroy status set for ", identifier); if (previousStatus != null && previousStatus.equals(PAV_INIT_STATUS.REFRAME_COMPLETE)) { destroyApplet(identifier); } } else { PluginDebug.debug("Handling message: ", message, " instance ", identifier, " ", Thread.currentThread()); // Wait till initialization finishes while (!applets.containsKey(identifier) && ( !status.containsKey(identifier) || status.get(identifier).equals(PAV_INIT_STATUS.PRE_INIT) )) ; // don't bother processing further for inactive applets if (status.get(identifier).equals(PAV_INIT_STATUS.INACTIVE)) { return; } applets.get(identifier).handleMessage(reference, message); } } catch (Exception e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL,e); // If an exception happened during pre-init, we need to update status updateStatus(identifier, PAV_INIT_STATUS.INACTIVE); throw new RuntimeException("Failed to handle message: " + message + " for instance " + identifier, e); } } /** * Sets the status unless an overriding status is set (e.g. if * status is DESTROYED, it may not be overridden). * * @param identifier The identifier for which the status is to be set * @param status The status to switch to * @return The previous status */ private static synchronized PAV_INIT_STATUS updateStatus(int identifier, PAV_INIT_STATUS newStatus) { PAV_INIT_STATUS prev = status.get(identifier); // If the status is set if (status.containsKey(identifier)) { // Nothing may override destroyed status if (status.get(identifier).equals(PAV_INIT_STATUS.DESTROYED)) { return prev; } // If status is inactive, only DESTROYED may override it if (status.get(identifier).equals(PAV_INIT_STATUS.INACTIVE)) { if (!newStatus.equals(PAV_INIT_STATUS.DESTROYED)) { return prev; } } } statusLock.lock(); try { status.put(identifier, newStatus); initComplete.signalAll(); } finally { statusLock.unlock(); } return prev; } /** * Destroys the given applet instance. * * This function may be called multiple times without problems. * It does a synchronized check on the status and will only * attempt to destroy the applet if not previously destroyed. * * @param identifier The instance which is to be destroyed */ private static synchronized void destroyApplet(int identifier) { // We should not try to destroy an applet during // initialization. It may cause an inconsistent state. waitForAppletInit( applets.get(identifier).panel ); PluginDebug.debug("DestroyApplet called for ", identifier); PAV_INIT_STATUS prev = updateStatus(identifier, PAV_INIT_STATUS.DESTROYED); // If already destroyed, return if (prev.equals(PAV_INIT_STATUS.DESTROYED)) { PluginDebug.debug(identifier, " already destroyed. Returning."); return; } PluginDebug.debug("Attempting to destroy frame ", identifier); // Try to dispose the panel right away final PluginAppletViewer pav = applets.get(identifier); if (pav != null) { pav.dispose(); // If panel is already disposed, return if (pav.panel.getApplet() == null) { PluginDebug.debug(identifier, " panel inactive. Returning."); return; } PluginDebug.debug("Attempting to destroy panel ", identifier); SwingUtilities.invokeLater(new Runnable() { @Override public void run() { pav.appletClose(); } }); } PluginDebug.debug(identifier, " destroyed"); } /** * Function to block until applet initialization is complete. * * This function will return if the wait is longer than {@link #APPLET_TIMEOUT} * * @param panel the instance to wait for. */ public static void waitForAppletInit(NetxPanel panel) { PluginDebug.debug("Waiting for applet init"); // Wait till initialization finishes long maxTimeToSleep = APPLET_TIMEOUT; panelLock.lock(); try { while (!panel.isInitialized() && maxTimeToSleep > 0) { PluginDebug.debug("Waiting for applet panel ", panel, " to initialize..."); maxTimeToSleep -= waitTillTimeout(panelLock, panelLive, maxTimeToSleep); } } finally { panelLock.unlock(); } PluginDebug.debug("Applet panel ", panel, " initialized"); } /* Resizes an applet panel, waiting for the applet to initialze. * Should be done asynchronously to avoid the chance of deadlock. */ private void resizeAppletPanel(final int width, final int height) { // Wait for panel to come alive waitForAppletInit(panel); SwingUtilities.invokeLater(new Runnable() { @Override public void run() { panel.updateSizeInAtts(height, width); setSize(width, height); // There is a rather odd drawing bug whereby resizing // the panel makes no difference on initial call // because the panel thinks that it is already the // right size. Validation has no effect there either. // So we work around by setting size to 1, validating, // and then setting to the right size and validating // again. This is not very efficient, and there is // probably a better way -- but resizing happens // quite infrequently, so for now this is how we do it panel.setSize(1, 1); panel.validate(); panel.setSize(width, height); panel.validate(); panel.getApplet().resize(width, height); panel.getApplet().validate(); } }); } public void handleMessage(int reference, String message) { if (message.startsWith("width")) { // 0 => width, 1=> width_value, 2 => height, 3=> height_value String[] dimMsg = message.split(" "); final int width = Integer.parseInt(dimMsg[1]); final int height = Integer.parseInt(dimMsg[3]); /* Resize the applet asynchronously, to avoid the chance of * deadlock while waiting for the applet to initialize. * * In general, worker threads should spawn new threads for any blocking operations. */ Thread resizeAppletThread = new Thread("resizeAppletThread") { @Override public void run() { resizeAppletPanel(width, height); } }; /* Let it eventually complete */ resizeAppletThread.start(); } else if (message.startsWith("GetJavaObject")) { // FIXME: how do we determine what security context this // object should belong to? Object o; // Wait for the panel to initialize // (happens in a separate thread) waitForAppletInit(panel); PluginDebug.debug(panel, " -- ", panel.getApplet(), " -- initialized: ", panel.isInitialized()); // Still null? if (panel.getApplet() == null) { streamhandler.write("instance " + identifier + " reference " + -1 + " fatalError: " + "Initialization failed"); streamhandler.write("context 0 reference " + reference + " Error"); return; } o = panel.getApplet(); PluginDebug.debug("Looking for object ", o, " panel is ", panel); AppletSecurityContextManager.getSecurityContext(0).store(o); PluginDebug.debug("WRITING 1: ", "context 0 reference ", reference, " GetJavaObject " , AppletSecurityContextManager.getSecurityContext(0).getIdentifier(o)); streamhandler.write("context 0 reference " + reference + " GetJavaObject " + AppletSecurityContextManager.getSecurityContext(0).getIdentifier(o)); PluginDebug.debug("WRITING 1 DONE"); } } /* * Methods for java.applet.AppletContext */ final private static Map audioClips = new HashMap<>(); /** * Get an audio clip. */ @Override public AudioClip getAudioClip(URL url) { checkConnect(url); synchronized (audioClips) { AudioClip clip = audioClips.get(url); if (clip == null) { audioClips.put(url, clip = new AppletAudioClip(url)); } return clip; } } final private static Map imageRefs = new HashMap<>(); /** * Get an image. */ @Override public Image getImage(URL url) { return getCachedImage(url); } private Image getCachedImage(URL url) { return (Image) getCachedImageRef(url).get(); } /** * Get an image ref. */ private synchronized AppletImageRef getCachedImageRef(URL url) { PluginDebug.debug("getCachedImageRef() searching for ", url); try { String originalURL = url.toString(); String codeBase = panel.getCodeBase().toString(); if (originalURL.startsWith(codeBase)) { PluginDebug.debug("getCachedImageRef() got URL = ", url); PluginDebug.debug("getCachedImageRef() plugin codebase = ", codeBase); String resourceName = originalURL.substring(codeBase.length()); if (panel.getAppletClassLoader() instanceof JNLPClassLoader) { JNLPClassLoader loader = (JNLPClassLoader) panel.getAppletClassLoader(); URL localURL = null; if (loader.resourceAvailableLocally(resourceName)) { url = loader.getResource(resourceName); } url = localURL != null ? localURL : url; } } PluginDebug.debug("getCachedImageRef() getting img from URL = ", url); synchronized (imageRefs) { AppletImageRef ref = imageRefs.get(url); if (ref == null) { ref = new AppletImageRef(url); imageRefs.put(url, ref); } return ref; } } catch (Exception e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, "Error occurred when trying to fetch image:"); OutputController.getLogger().log(e); return null; } } /** * Flush the image cache. */ static void flushImageCache() { imageRefs.clear(); } final private static Vector appletPanels = new Vector<>(); /** * Get an applet by name. */ @Override public Applet getApplet(String name) { name = name.toLowerCase(); SocketPermission panelSp = new SocketPermission(UrlUtils.getHostAndPort(panel.getCodeBase()), "connect"); synchronized(appletPanels) { for (Enumeration e = appletPanels.elements(); e.hasMoreElements();) { AppletPanel p = e.nextElement(); String param = p.getParameter("name"); if (param != null) { param = param.toLowerCase(); } if (name.equals(param) && p.getDocumentBase().equals(panel.getDocumentBase())) { SocketPermission sp = new SocketPermission(UrlUtils.getHostAndPort(p.getCodeBase()), "connect"); if (panelSp.implies(sp)) { return p.applet; } } } } return null; } /** * Return an enumeration of all the accessible * applets on this page. */ @Override public Enumeration getApplets() { Vector v = new Vector(); SocketPermission panelSp = new SocketPermission(UrlUtils.getHostAndPort(panel.getCodeBase()), "connect"); synchronized(appletPanels) { for (Enumeration e = appletPanels.elements(); e.hasMoreElements();) { AppletPanel p = e.nextElement(); if (p.getDocumentBase().equals(panel.getDocumentBase())) { SocketPermission sp = new SocketPermission(UrlUtils.getHostAndPort(p.getCodeBase()), "connect"); if (panelSp.implies(sp)) { v.addElement(p.applet); } } } } return v.elements(); } @Override public void showDocument(URL url) { PluginDebug.debug("Showing document..."); showDocument(url, "_self"); } @Override public void showDocument(URL url, String target) { // If it is a javascript document, eval on current page. if ("javascript".equals(url.getProtocol())) { // Snip protocol off string String evalString = url.toString().substring("javascript:".length()); eval(getWindow(), evalString); return; } try { Long reference = getRequestIdentifier(); write("reference " + reference + " LoadURL " + UrlUtil.encode(url.toString(), "UTF-8") + " " + target); } catch (IOException exception) { // Deliberately ignore IOException. showDocument may be // called from threads other than the main thread after // streamhandler.pluginOutputStream has been closed. } } /** * Show status. */ @Override public void showStatus(String status) { try { // FIXME: change to postCallRequest // For statuses, we cannot have a newline status = status.replace("\n", " "); write("status " + status); } catch (IOException exception) { // Deliberately ignore IOException. showStatus may be // called from threads other than the main thread after // streamhandler.pluginOutputStream has been closed. } } /** * Returns an incremental number (unique identifier) for a message. * If identifier hits Long.MAX_VALUE it loops back starting at 0. * * @return A unique Long identifier for the request */ private static long getRequestIdentifier() { synchronized(requestMutex) { if (requestIdentityCounter == Long.MAX_VALUE) { requestIdentityCounter = 0L; } return requestIdentityCounter++; } } public long getWindow() { PluginDebug.debug("STARTING getWindow"); Long reference = getRequestIdentifier(); PluginCallRequest request = requestFactory.getPluginCallRequest("window", "instance " + identifier + " reference " + +reference + " " + "GetWindow", reference); PluginDebug.debug("STARTING postCallRequest"); streamhandler.postCallRequest(request); PluginDebug.debug("STARTING postCallRequest done"); streamhandler.write(request.getMessage()); try { PluginDebug.debug("wait request 1"); synchronized (request) { PluginDebug.debug("wait request 2"); while ((Long) request.getObject() == 0) request.wait(); PluginDebug.debug("wait request 3"); } } catch (InterruptedException e) { throw new RuntimeException("Interrupted waiting for call request.", e); } PluginDebug.debug("STARTING getWindow DONE"); return (Long) request.getObject(); } // FIXME: make private, access via reflection. public static Object getMember(long internal, String name) { AppletSecurityContextManager.getSecurityContext(0).store(name); int nameID = AppletSecurityContextManager.getSecurityContext(0).getIdentifier(name); Long reference = getRequestIdentifier(); // Prefix with dummy instance for convenience. PluginCallRequest request = requestFactory.getPluginCallRequest("member", "instance " + 0 + " reference " + reference + " GetMember " + internal + " " + nameID, reference); streamhandler.postCallRequest(request); streamhandler.write(request.getMessage()); try { PluginDebug.debug("wait getMEM request 1"); synchronized (request) { PluginDebug.debug("wait getMEM request 2"); while (request.isDone() == false) request.wait(); PluginDebug.debug("wait getMEM request 3 GOT: ", request.getObject().getClass()); } } catch (InterruptedException e) { throw new RuntimeException("Interrupted waiting for call request.", e); } PluginDebug.debug(" getMember DONE"); return request.getObject(); } public static void setMember(long internal, String name, Object value) { PluginDebug.debug("Setting to class " + value.getClass() + ":" + value.getClass().isPrimitive()); PluginAppletSecurityContext securityContext = AppletSecurityContextManager.getSecurityContext(0); securityContext.store(name); int nameID = securityContext.getIdentifier(name); Long reference = getRequestIdentifier(); // work on a copy of value, as we don't want to be manipulating // complex objects String objIDStr = securityContext.toObjectIDString(value, value.getClass(), true /* unbox primitives */); // Prefix with dummy instance for convenience. PluginCallRequest request = requestFactory.getPluginCallRequest("void", "instance " + 0 + " reference " + reference + " SetMember " + internal + " " + nameID + " " + objIDStr, reference); streamhandler.postCallRequest(request); streamhandler.write(request.getMessage()); try { PluginDebug.debug("wait setMem request: ", request.getMessage()); PluginDebug.debug("wait setMem request 1"); synchronized (request) { PluginDebug.debug("wait setMem request 2"); while (request.isDone() == false) request.wait(); PluginDebug.debug("wait setMem request 3"); } } catch (InterruptedException e) { throw new RuntimeException("Interrupted waiting for call request.", e); } PluginDebug.debug(" setMember DONE"); } // FIXME: handle long index as well. public static void setSlot(long internal, int index, Object value) { PluginAppletSecurityContext securityContext = AppletSecurityContextManager.getSecurityContext(0); securityContext.store(value); Long reference = getRequestIdentifier(); String objIDStr = securityContext.toObjectIDString(value, value.getClass(), true /* unbox primitives */); // Prefix with dummy instance for convenience. PluginCallRequest request = requestFactory.getPluginCallRequest("void", "instance " + 0 + " reference " + reference + " SetSlot " + internal + " " + index + " " + objIDStr, reference); streamhandler.postCallRequest(request); streamhandler.write(request.getMessage()); try { PluginDebug.debug("wait setSlot request 1"); synchronized (request) { PluginDebug.debug("wait setSlot request 2"); while (request.isDone() == false) request.wait(); PluginDebug.debug("wait setSlot request 3"); } } catch (InterruptedException e) { throw new RuntimeException("Interrupted waiting for call request.", e); } PluginDebug.debug(" setSlot DONE"); } public static Object getSlot(long internal, int index) { Long reference = getRequestIdentifier(); // Prefix with dummy instance for convenience. PluginCallRequest request = requestFactory.getPluginCallRequest("member", "instance " + 0 + " reference " + reference + " GetSlot " + internal + " " + index, reference); streamhandler.postCallRequest(request); streamhandler.write(request.getMessage()); try { PluginDebug.debug("wait getSlot request 1"); synchronized (request) { PluginDebug.debug("wait getSlot request 2"); while (request.isDone() == false) request.wait(); PluginDebug.debug("wait getSlot request 3"); } } catch (InterruptedException e) { throw new RuntimeException("Interrupted waiting for call request.", e); } PluginDebug.debug(" getSlot DONE"); return request.getObject(); } public static Object eval(long internal, String s) { AppletSecurityContextManager.getSecurityContext(0).store(s); int stringID = AppletSecurityContextManager.getSecurityContext(0).getIdentifier(s); Long reference = getRequestIdentifier(); // Prefix with dummy instance for convenience. // FIXME: rename GetMemberPluginCallRequest ObjectPluginCallRequest. PluginCallRequest request = requestFactory.getPluginCallRequest("member", "instance " + 0 + " reference " + reference + " Eval " + internal + " " + stringID, reference); streamhandler.postCallRequest(request); streamhandler.write(request.getMessage()); try { PluginDebug.debug("wait eval request 1"); synchronized (request) { PluginDebug.debug("wait eval request 2"); while (request.isDone() == false) { request.wait(); } PluginDebug.debug("wait eval request 3"); } } catch (InterruptedException e) { throw new RuntimeException("Interrupted waiting for call request.", e); } PluginDebug.debug(" getSlot DONE"); return request.getObject(); } public static void removeMember(long internal, String name) { AppletSecurityContextManager.getSecurityContext(0).store(name); int nameID = AppletSecurityContextManager.getSecurityContext(0).getIdentifier(name); Long reference = getRequestIdentifier(); // Prefix with dummy instance for convenience. PluginCallRequest request = requestFactory.getPluginCallRequest("void", "instance " + 0 + " reference " + reference + " RemoveMember " + internal + " " + nameID, reference); streamhandler.postCallRequest(request); streamhandler.write(request.getMessage()); try { PluginDebug.debug("wait removeMember request 1"); synchronized (request) { PluginDebug.debug("wait removeMember request 2"); while (request.isDone() == false) request.wait(); PluginDebug.debug("wait removeMember request 3"); } } catch (InterruptedException e) { throw new RuntimeException("Interrupted waiting for call request.", e); } PluginDebug.debug(" RemoveMember DONE"); } public static Object call(long internal, String name, Object args[]) { // FIXME: when is this removed from the object store? // FIXME: reference should return the ID. // FIXME: convenience method for this long line. AppletSecurityContextManager.getSecurityContext(0).store(name); int nameID = AppletSecurityContextManager.getSecurityContext(0).getIdentifier(name); Long reference = getRequestIdentifier(); String argIDs = ""; for (Object arg : args) { AppletSecurityContextManager.getSecurityContext(0).store(arg); argIDs += AppletSecurityContextManager.getSecurityContext(0).getIdentifier(arg) + " "; } argIDs = argIDs.trim(); // Prefix with dummy instance for convenience. PluginCallRequest request = requestFactory.getPluginCallRequest("member", "instance " + 0 + " reference " + reference + " Call " + internal + " " + nameID + " " + argIDs, reference); streamhandler.postCallRequest(request); streamhandler.write(request.getMessage()); try { PluginDebug.debug("wait call request 1"); synchronized (request) { PluginDebug.debug("wait call request 2"); while (request.isDone() == false) { request.wait(); } PluginDebug.debug("wait call request 3"); } } catch (InterruptedException e) { throw new RuntimeException("Interrupted waiting for call request.", e); } PluginDebug.debug(" Call DONE"); return request.getObject(); } public static Object requestPluginCookieInfo(URI uri) { PluginCallRequest request; Long reference = getRequestIdentifier(); try { String encodedURI = UrlUtil.encode(uri.toString(), "UTF-8"); request = requestFactory.getPluginCallRequest("cookieinfo", "plugin PluginCookieInfo " + "reference " + reference + " " + encodedURI, reference); } catch (UnsupportedEncodingException e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL,e); return null; } PluginMessageConsumer.registerPriorityWait(reference); streamhandler.postCallRequest(request); streamhandler.write(request.getMessage()); try { PluginDebug.debug("wait cookieinfo request 1"); synchronized (request) { PluginDebug.debug("wait cookieinfo request 2"); while (request.isDone() == false) { request.wait(); } PluginDebug.debug("wait cookieinfo request 3"); } } catch (InterruptedException e) { throw new RuntimeException("Interrupted waiting for cookieinfo request.", e); } PluginDebug.debug(" Cookieinfo DONE"); return request.getObject(); } /** * Obtain information about the proxy from the browser. * * @param uri a String in url-encoded form * @return a {@link URI} that indicates a proxy. */ public static Object requestPluginProxyInfo(String uri) { Long reference = getRequestIdentifier(); PluginCallRequest request = requestFactory.getPluginCallRequest("proxyinfo", "plugin PluginProxyInfo reference " + reference + " " + uri, reference); PluginMessageConsumer.registerPriorityWait(reference); streamhandler.postCallRequest(request); streamhandler.write(request.getMessage()); try { PluginDebug.debug("wait call request 1"); synchronized (request) { PluginDebug.debug("wait call request 2"); while (request.isDone() == false) { request.wait(); } PluginDebug.debug("wait call request 3"); } } catch (InterruptedException e) { throw new RuntimeException("Interrupted waiting for call request.", e); } PluginDebug.debug(" Call DONE"); return request.getObject(); } public static void JavaScriptFinalize(long internal) { Long reference = getRequestIdentifier(); // Prefix with dummy instance for convenience. PluginCallRequest request = requestFactory.getPluginCallRequest("void", "instance " + 0 + " reference " + reference + " Finalize " + internal, reference); streamhandler.postCallRequest(request); streamhandler.write(request.getMessage()); try { PluginDebug.debug("wait finalize request 1"); synchronized (request) { PluginDebug.debug("wait finalize request 2"); while (request.isDone() == false) { request.wait(); } PluginDebug.debug("wait finalize request 3"); } } catch (InterruptedException e) { throw new RuntimeException("Interrupted waiting for call request.", e); } PluginDebug.debug(" finalize DONE"); } public static String javascriptToString(long internal) { Long reference = getRequestIdentifier(); // Prefix with dummy instance for convenience. PluginCallRequest request = requestFactory.getPluginCallRequest("member", "instance " + 0 + " reference " + reference + " ToString " + internal, reference); streamhandler.postCallRequest(request); streamhandler.write(request.getMessage()); PluginDebug.debug("wait ToString request 1"); synchronized (request) { PluginDebug.debug("wait ToString request 2"); waitForRequestCompletion(request); PluginDebug.debug("wait ToString request 3"); } PluginDebug.debug(" ToString DONE"); return (String) request.getObject(); } // FIXME: make this private and access it from JSObject using // reflection. private void write(String message) throws IOException { PluginDebug.debug("WRITING 2: ", "instance ", identifier, " " + message); streamhandler.write("instance " + identifier + " " + message); PluginDebug.debug("WRITING 2 DONE"); } @Override public void setStream(String key, InputStream stream) throws IOException { // We do nothing. } @Override public InputStream getStream(String key) { // We do nothing. return null; } @Override public Iterator getStreamKeys() { // We do nothing. return null; } /** * System parameters. */ private final static Map systemParam = new HashMap<>(); static { systemParam.put("codebase", "codebase"); systemParam.put("code", "code"); systemParam.put("alt", "alt"); systemParam.put("width", "width"); systemParam.put("height", "height"); systemParam.put("align", "align"); systemParam.put("vspace", "vspace"); systemParam.put("hspace", "hspace"); } /** * Make sure the atrributes are uptodate. */ public void updateAtts() { Dimension d = panel.getSize(); Insets in = panel.getInsets(); int width = d.width - (in.left + in.right); int height = d.height - (in.top + in.bottom); panel.updateSizeInAtts(height, width); } /** * Restart the applet. */ void appletRestart() { panel.sendEvent(AppletPanel.APPLET_STOP); panel.sendEvent(AppletPanel.APPLET_DESTROY); panel.sendEvent(AppletPanel.APPLET_INIT); panel.sendEvent(AppletPanel.APPLET_START); } /** * Reload the applet. */ void appletReload() { panel.sendEvent(AppletPanel.APPLET_STOP); panel.sendEvent(AppletPanel.APPLET_DESTROY); panel.sendEvent(AppletPanel.APPLET_DISPOSE); /** * Fixed #4501142: Classloader sharing policy doesn't * take "archive" into account. This will be overridden * by Java Plug-in. [stanleyh] */ AppletPanel.flushClassLoader(panel.getClassLoaderCacheKey()); /* * Make sure we don't have two threads running through the event queue * at the same time. */ try { ((AppletViewerPanelAccess)panel).joinAppletThread(); ((AppletViewerPanelAccess)panel).release(); } catch (InterruptedException e) { return; // abort the reload } AccessController.doPrivileged(new PrivilegedAction() { @Override public Void run() { ((AppletViewerPanelAccess)panel).createAppletThread(); return null; } }); panel.sendEvent(AppletPanel.APPLET_LOAD); panel.sendEvent(AppletPanel.APPLET_INIT); panel.sendEvent(AppletPanel.APPLET_START); } @Override public int print(Graphics graphics, PageFormat pf, int pageIndex) { return Printable.NO_SUCH_PAGE; } /** * Start the applet. */ void appletStart() { panel.sendEvent(AppletPanel.APPLET_START); } /** * Stop the applet. */ void appletStop() { panel.sendEvent(AppletPanel.APPLET_STOP); } /** * Shutdown a viewer. * Stop, Destroy, Dispose and Quit a viewer */ private void appletShutdown(AppletPanel p) { p.sendEvent(AppletPanel.APPLET_STOP); p.sendEvent(AppletPanel.APPLET_DESTROY); p.sendEvent(AppletPanel.APPLET_DISPOSE); p.sendEvent(AppletPanel.APPLET_QUIT); } /** * Close this viewer. * Stop, Destroy, Dispose and Quit an AppletView, then * reclaim resources and exit the program if this is * the last applet. */ void appletClose() { // The caller thread is event dispatch thread, so // spawn a new thread to avoid blocking the event queue // when calling appletShutdown. // final AppletPanel p = panel; new Thread(new Runnable() { @SuppressWarnings("deprecation") @Override public void run() { ClassLoader cl = p.applet.getClass().getClassLoader(); // Since we want to deal with JNLPClassLoader, extract it if this // is a codebase loader if (cl instanceof JNLPClassLoader.CodeBaseClassLoader) { cl = ((JNLPClassLoader.CodeBaseClassLoader) cl).getParentJNLPClassLoader(); } appletShutdown(p); appletPanels.removeElement(p); // Mark classloader unusable if (cl instanceof JNLPClassLoader) { ((JNLPClassLoader) cl).decrementLoaderUseCount(); } try { SwingUtilities.invokeAndWait(new Runnable() { @Override public void run() { dispose(); } }); } catch (Exception e) { // ignore, we are just disposing it } if (countApplets() == 0) { appletSystemExit(); } updateStatus(identifier, PAV_INIT_STATUS.DESTROYED); } }).start(); } /** * Exit the program. * Exit from the program (if not stand alone) - do no clean-up */ private void appletSystemExit() { // Do nothing. Exit is handled by another // block of code, called when _all_ applets are gone } /** * How many applets are running? * @return number of applets run in this JVM */ public static int countApplets() { return appletPanels.size(); } private static void checkConnect(URL url) { SecurityManager security = System.getSecurityManager(); if (security != null) { try { URLConnection conn = ConnectionFactory.getConnectionFactory().openConnection(url); java.security.Permission perm = conn.getPermission(); ConnectionFactory.getConnectionFactory().disconnect(conn); if (perm != null) { security.checkPermission(perm); } else { security.checkConnect(url.getHost(), url.getPort()); } } catch (java.io.IOException ioe) { security.checkConnect(url.getHost(), url.getPort()); } } } /** * {@inheritDoc} * * This method calls paint directly, rather than via super.update() since * the parent class's update() just does a couple of checks (both of * which are accounted for) and then calls paint anyway. */ @Override public void paint(Graphics g) { // If the image or the graphics don't exist, create new ones if (bufFrameImg == null || bufFrameImgGraphics == null) { // although invisible applets do not have right to paint // we rather paint to 1x1 to be sure all callbacks will be completed bufFrameImg = createImage(Math.max(1, getWidth()), Math.max(1, getHeight())); bufFrameImgGraphics = bufFrameImg.getGraphics(); } // Paint off-screen for (Component c: this.getComponents()) { c.paint(bufFrameImgGraphics); } // Draw the painted image g.drawImage(bufFrameImg, 0, 0, this); } @Override public void update(Graphics g) { paint(g); } /** * Waits on a given condition queue until timeout. * * This function assumes that the monitor lock has already been * acquired by the caller. * * If the given lock is null, this function returns immediately. * * @param lock the lock that must be held when this method is called. * @param cond the condition queue on which to wait for notifications. * @param timeout The maximum time to wait (nanoseconds) * @return Approximate time spent sleeping (not guaranteed to be perfect) */ public static long waitTillTimeout(ReentrantLock lock, Condition cond, long timeout) { // Can't wait on null. Return 0 indicating no wait happened. if (lock == null) { return 0; } assert lock.isHeldByCurrentThread(); // Record when we started sleeping long sleepStart = 0L; try { sleepStart = System.nanoTime(); cond.await(timeout, TimeUnit.NANOSECONDS); } catch (InterruptedException ie) {} // Discarded, time to return // Return the difference return System.nanoTime() - sleepStart; } private class SplashCreator implements Runnable { private final AppletPanel fPanel; public SplashCreator(AppletPanel fPanel) { this.fPanel = fPanel; } @Override public void run() { add("Center", fPanel); fPanel.setVisible(false); splashPanel = SplashUtils.getSplashScreen(fPanel.getWidth(), fPanel.getHeight()); if (splashPanel != null) { splashPanel.startAnimation(); PluginDebug.debug("Added splash " + splashPanel); add("Center", splashPanel.getSplashComponent()); } pack(); } } } icedtea-web-1.6.2/plugin/icedteanp/java/sun/applet/PaxHeaders.17941/PluginAppletSecurityContext.java0000644000000000000000000000013112654402377030255 xustar0030 mtime=1454507263.225432741 29 atime=1454507327.17457987 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java0000644000175000002070000015547412654402377031021 0ustar00jvanekmock00000000000000/* PluginAppletSecurityContext -- execute plugin JNI messages Copyright (C) 2008, 2010 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package sun.applet; import java.lang.reflect.Array; import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.net.MalformedURLException; import java.net.URL; import java.security.AccessControlContext; import java.security.AccessControlException; import java.security.AccessController; import java.security.AllPermission; import java.security.BasicPermission; import java.security.CodeSource; import java.security.Permissions; import java.security.PrivilegedAction; import java.security.ProtectionDomain; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import net.sourceforge.jnlp.DefaultLaunchHandler; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.util.logging.OutputController; import netscape.javascript.JSObject; import netscape.javascript.JSObjectCreatePermission; import netscape.javascript.JSUtil; class Signature { private String signature; private int currentIndex; private List> typeList; private static final char ARRAY = '['; private static final char OBJECT = 'L'; private static final char SIGNATURE_ENDCLASS = ';'; private static final char SIGNATURE_FUNC = '('; private static final char SIGNATURE_ENDFUNC = ')'; private static final char VOID = 'V'; private static final char BOOLEAN = 'Z'; private static final char BYTE = 'B'; private static final char CHARACTER = 'C'; private static final char SHORT = 'S'; private static final char INTEGER = 'I'; private static final char LONG = 'J'; private static final char FLOAT = 'F'; private static final char DOUBLE = 'D'; private String nextTypeName() { char key = signature.charAt(currentIndex++); switch (key) { case ARRAY: return nextTypeName() + "[]"; case OBJECT: int endClass = signature.indexOf(SIGNATURE_ENDCLASS, currentIndex); String retVal = signature.substring(currentIndex, endClass); retVal = retVal.replace('/', '.'); currentIndex = endClass + 1; return retVal; // FIXME: generated bytecode with classes named after // primitives will not work in this scheme -- those // classes will be incorrectly treated as primitive // types. case VOID: return "void"; case BOOLEAN: return "boolean"; case BYTE: return "byte"; case CHARACTER: return "char"; case SHORT: return "short"; case INTEGER: return "int"; case LONG: return "long"; case FLOAT: return "float"; case DOUBLE: return "double"; case SIGNATURE_ENDFUNC: return null; case SIGNATURE_FUNC: return nextTypeName(); default: throw new IllegalArgumentException( "Invalid JNI signature character '" + key + "'"); } } public Signature(String signature, ClassLoader cl) { this.signature = signature; currentIndex = 0; typeList = new ArrayList<>(10); String elem; while (currentIndex < signature.length()) { elem = nextTypeName(); if (elem == null) { continue; } Class primitive = primitiveNameToType(elem); if (primitive != null) { typeList.add(primitive); } else { int dimsize = 0; int n = elem.indexOf('['); if (n != -1) { String arrayType = elem.substring(0, n); dimsize++; n = elem.indexOf('[', n + 1); while (n != -1) { dimsize++; n = elem.indexOf('[', n + 1); } int[] dims = new int[dimsize]; primitive = primitiveNameToType(arrayType); if (primitive != null) { typeList.add(Array.newInstance(primitive, dims) .getClass()); } else { typeList.add(Array.newInstance( getClass(arrayType, cl), dims).getClass()); } } else { typeList.add(getClass(elem, cl)); } } } if (signature.length() < 2) { throw new IllegalArgumentException("Invalid JNI signature '" + signature + "'"); } } public static Class getClass(String name, ClassLoader cl) { Class c = null; try { c = Class.forName(name); } catch (ClassNotFoundException cnfe) { PluginDebug.debug("Class ", name, " not found in primordial loader. Looking in ", cl); try { c = cl.loadClass(name); } catch (ClassNotFoundException e) { throw (new RuntimeException(new ClassNotFoundException("Unable to find class " + name))); } } return c; } public static Class primitiveNameToType(String name) { switch (name) { case "void": return Void.TYPE; case "boolean": return Boolean.TYPE; case "byte": return Byte.TYPE; case "char": return Character.TYPE; case "short": return Short.TYPE; case "int": return Integer.TYPE; case "long": return Long.TYPE; case "float": return Float.TYPE; case "double": return Double.TYPE; default: return null; } } public Class[] getClassArray() { return typeList.subList(0, typeList.size()).toArray(new Class[] {}); } } public class PluginAppletSecurityContext { private static Map classLoaders = new HashMap<>(); private static Map instanceClassLoaders = new HashMap<>(); private PluginObjectStore store = PluginObjectStore.getInstance(); private Throwable throwable = null; private ClassLoader liveconnectLoader = ClassLoader.getSystemClassLoader(); int identifier = 0; private static PluginStreamHandler streamhandler; long startTime = 0; /* Package-private constructor that allows for bypassing security manager installation. * This is useful for testing. Note that while the public constructor should be used otherwise, * the security installation can't be bypassed if it has already occurred.*/ PluginAppletSecurityContext(int identifier, boolean ensureSecurityContext) { this.identifier = identifier; if (ensureSecurityContext) { // We need a security manager.. and since there is a good chance that // an applet will be loaded at some point, we should make it the SM // that JNLPRuntime will try to install if (System.getSecurityManager() == null) { JNLPRuntime.initialize(/* isApplication */false); JNLPRuntime.setDefaultLaunchHandler(new DefaultLaunchHandler(OutputController.getLogger())); } JNLPRuntime.disableExit(); } URL u = null; try { u = new URL("file://"); } catch (Exception e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL,e); } PluginAppletSecurityContext.classLoaders.put(liveconnectLoader, u); } public PluginAppletSecurityContext(int identifier) { this(identifier, true); } private static V parseCall(String s, ClassLoader cl, Class c) { if (c == Integer.class) { return c.cast(new Integer(s)); } else if (c == String.class) { return c.cast(s); } else if (c == Signature.class) { return c.cast(new Signature(s, cl)); } else { throw new RuntimeException("Unexpected call value."); } } private Object parseArgs(String s, Class c) { if (c == Boolean.TYPE || c == Boolean.class) { return Boolean.valueOf(s); } else if (c == Byte.TYPE || c == Byte.class) { return new Byte(s); } else if (c == Character.TYPE || c == Character.class) { String[] bytes = s.split("_"); int low = Integer.parseInt(bytes[0]); int high = Integer.parseInt(bytes[1]); int full = ((high << 8) & 0x0ff00) | (low & 0x0ff); return (char) full; } else if (c == Short.TYPE || c == Short.class) { return new Short(s); } else if (c == Integer.TYPE || c == Integer.class) { return new Integer(s); } else if (c == Long.TYPE || c == Long.class) { return new Long(s); } else if (c == Float.TYPE || c == Float.class) { return new Float(s); } else if (c == Double.TYPE || c == Double.class) { return new Double(s); } else { return store.getObject(new Integer(s)); } } public void associateSrc(ClassLoader cl, URL src) { PluginDebug.debug("Associating ", cl, " with ", src); PluginAppletSecurityContext.classLoaders.put(cl, src); } public void associateInstance(Integer i, ClassLoader cl) { PluginDebug.debug("Associating ", cl, " with instance ", i); PluginAppletSecurityContext.instanceClassLoaders.put(i, cl); } public static void setStreamhandler(PluginStreamHandler sh) { streamhandler = sh; } public static PluginStreamHandler getStreamhandler() { return streamhandler; } public static Map getLoaderInfo() { Map map = new HashMap<>(); for (ClassLoader loader : PluginAppletSecurityContext.classLoaders.keySet()) { map.put(loader.getClass().getName(), classLoaders.get(loader).toString()); } return map; } private static long privilegedJSObjectUnbox(final JSObject js) { return AccessController.doPrivileged(new PrivilegedAction() { @Override public Long run() { return JSUtil.getJSObjectInternalReference(js); } }); } /** * Create a string that identifies a Java object precisely, for passing to * Javascript. * * For builtin value types, a 'literalreturn' prefix is used and the object * is passed with a string representation. * * For JSObject's, a 'jsobject' prefix is used and the object is passed * with the JSObject's internal identifier. * * For other Java objects, an object store reference is used. * * @param obj the object for which to create an identifier * @param type the type to use for representation decisions * @param unboxPrimitives whether to treat boxed primitives as value types * @return an identifier string */ public String toObjectIDString(Object obj, Class type, boolean unboxPrimitives) { /* Void (can occur from declared return type), pass special "void" string: */ if (type == Void.TYPE) { return "literalreturn void"; } /* Null, pass special "null" string: */ if (obj == null) { return "literalreturn null"; } /* Primitive, accurately represented by its toString() form: */ boolean returnAsString = ( type == Boolean.TYPE || type == Byte.TYPE || type == Short.TYPE || type == Integer.TYPE || type == Long.TYPE ); if (unboxPrimitives) { returnAsString = ( returnAsString || type == Boolean.class || type == Byte.class || type == Short.class || type == Integer.class || type == Long.class); } if (returnAsString) { return "literalreturn " + obj.toString(); } /* Floating point number, we ensure we give enough precision: */ if ( type == Float.TYPE || type == Double.TYPE || ( unboxPrimitives && (type == Float.class || type == Double.class) )) { return "literalreturn " + String.format("%308.308e", obj); } /* Character that should be returned as number: */ if (type == Character.TYPE || (unboxPrimitives && type == Character.class)) { return "literalreturn " + (int) (Character) obj; } /* JSObject, unwrap underlying Javascript reference: */ if (type == netscape.javascript.JSObject.class) { long reference = privilegedJSObjectUnbox((JSObject)obj); return "jsobject " + Long.toString(reference); } /* Other kind of object, track this object and return our reference: */ store.reference(obj); return store.getIdentifier(obj).toString(); } public void handleMessage(int reference, String src, AccessControlContext callContext, String message) { startTime = new java.util.Date().getTime(); try { if (message.startsWith("FindClass")) { ClassLoader cl; Class c; cl = liveconnectLoader; String[] args = message.split(" "); Integer instance = new Integer(args[1]); String className = args[2].replace('/', '.'); PluginDebug.debug("Searching for class ", className, " in ", cl); try { c = cl.loadClass(className); store.reference(c); write(reference, "FindClass " + store.getIdentifier(c)); } catch (ClassNotFoundException cnfe) { cl = PluginAppletSecurityContext.instanceClassLoaders.get(instance); PluginDebug.debug("Not found. Looking in ", cl); if (instance != 0 && cl != null) { try { c = cl.loadClass(className); store.reference(c); write(reference, "FindClass " + store.getIdentifier(c)); } catch (ClassNotFoundException cnfe2) { write(reference, "FindClass 0"); } } else { write(reference, "FindClass 0"); } } } else if (message.startsWith("GetStaticMethodID") || message.startsWith("GetMethodID")) { String[] args = message.split(" "); Integer classID = parseCall(args[1], null, Integer.class); String methodName = parseCall(args[2], null, String.class); Signature signature = parseCall(args[3], ((Class) store.getObject(classID)).getClassLoader(), Signature.class); Object[] a = signature.getClassArray(); Class c; if (message.startsWith("GetStaticMethodID") || methodName.equals("") || methodName.equals("")) { c = (Class) store.getObject(classID); } else { c = store.getObject(classID).getClass(); } Method m; Constructor cs; Object o; if (methodName.equals("") || methodName.equals("")) { o = cs = c.getConstructor(signature.getClassArray()); store.reference(cs); } else { o = m = c.getMethod(methodName, signature.getClassArray()); store.reference(m); } PluginDebug.debug(o, " has id ", store.getIdentifier(o)); write(reference, args[0] + " " + store.getIdentifier(o)); } else if (message.startsWith("GetStaticFieldID") || message.startsWith("GetFieldID")) { String[] args = message.split(" "); Integer classID = parseCall(args[1], null, Integer.class); Integer fieldID = parseCall(args[2], null, Integer.class); String fieldName = (String) store.getObject(fieldID); Class c = (Class) store.getObject(classID); PluginDebug.debug("GetStaticFieldID/GetFieldID got class=", c.getName()); Field f; f = c.getField(fieldName); store.reference(f); write(reference, "GetStaticFieldID " + store.getIdentifier(f)); } else if (message.startsWith("GetStaticField")) { String[] args = message.split(" "); String type = parseCall(args[1], null, String.class); Integer classID = parseCall(args[1], null, Integer.class); Integer fieldID = parseCall(args[2], null, Integer.class); final Class c = (Class) store.getObject(classID); final Field f = (Field) store.getObject(fieldID); AccessControlContext acc = callContext != null ? callContext : getClosedAccessControlContext(); checkPermission(src, c, acc); Object ret = AccessController.doPrivileged(new PrivilegedAction() { @Override public Object run() { try { return f.get(c); } catch (Throwable t) { return t; } } }, acc); if (ret instanceof Throwable) { throw (Throwable) ret; } String objIDStr = toObjectIDString(ret, f.getType(), false /*do not unbox primitives*/); write(reference, "GetStaticField " + objIDStr); } else if (message.startsWith("GetValue")) { String[] args = message.split(" "); Integer index = parseCall(args[1], null, Integer.class); Object ret = store.getObject(index); Class retClass = ret != null ? ret.getClass() : null; String objIDStr = toObjectIDString(ret, retClass, true /*unbox primitives*/); write(reference, "GetValue " + objIDStr); } else if (message.startsWith("SetStaticField") || message.startsWith("SetField")) { String[] args = message.split(" "); Integer classOrObjectID = parseCall(args[1], null, Integer.class); Integer fieldID = parseCall(args[2], null, Integer.class); Object value = store.getObject(parseCall(args[3], null, Integer.class)); final Object o = store.getObject(classOrObjectID); final Field f = (Field) store.getObject(fieldID); final Object fValue = MethodOverloadResolver.getCostAndCastedObject(value, f.getType()).getCastedObject(); AccessControlContext acc = callContext != null ? callContext : getClosedAccessControlContext(); checkPermission(src, message.startsWith("SetStaticField") ? (Class) o : o.getClass(), acc); Object ret = AccessController.doPrivileged(new PrivilegedAction() { @Override public Object run() { try { f.set(o, fValue); } catch (Throwable t) { return t; } return null; } }, acc); if (ret instanceof Throwable) { throw (Throwable) ret; } write(reference, "SetField"); } else if (message.startsWith("GetObjectArrayElement")) { String[] args = message.split(" "); Integer arrayID = parseCall(args[1], null, Integer.class); Integer index = parseCall(args[2], null, Integer.class); Object array = store.getObject(arrayID); Object ret = Array.get(array, index); Class retClass = array.getClass().getComponentType(); // prevent auto-boxing influence String objIDStr = toObjectIDString(ret, retClass, false /*do not unbox primitives*/); write(reference, "GetObjectArrayElement " + objIDStr); } else if (message.startsWith("SetObjectArrayElement")) { String[] args = message.split(" "); Integer arrayID = parseCall(args[1], null, Integer.class); Integer index = parseCall(args[2], null, Integer.class); Integer objectID = parseCall(args[3], null, Integer.class); Object value = store.getObject(objectID); // Cast the object to appropriate type before insertion value = MethodOverloadResolver.getCostAndCastedObject(value, store.getObject(arrayID).getClass().getComponentType()).getCastedObject(); Array.set(store.getObject(arrayID), index, value); write(reference, "SetObjectArrayElement"); } else if (message.startsWith("GetArrayLength")) { String[] args = message.split(" "); Integer arrayID = parseCall(args[1], null, Integer.class); Object o = store.getObject(arrayID); int len = 0; len = Array.getLength(o); write(reference, "GetArrayLength " + Array.getLength(o)); } else if (message.startsWith("GetField")) { String[] args = message.split(" "); String type = parseCall(args[1], null, String.class); Integer objectID = parseCall(args[1], null, Integer.class); Integer fieldID = parseCall(args[2], null, Integer.class); final Object o = store.getObject(objectID); final Field f = (Field) store.getObject(fieldID); AccessControlContext acc = callContext != null ? callContext : getClosedAccessControlContext(); checkPermission(src, o.getClass(), acc); Object ret = AccessController.doPrivileged(new PrivilegedAction() { @Override public Object run() { try { return f.get(o); } catch (Throwable t) { return t; } } }, acc); if (ret instanceof Throwable) { throw (Throwable) ret; } String objIDStr = toObjectIDString(ret, f.getType(), false /*do not unbox primitives*/); write(reference, "GetField " + objIDStr); } else if (message.startsWith("GetObjectClass")) { int oid = Integer.parseInt(message.substring("GetObjectClass" .length() + 1)); Class c = store.getObject(oid).getClass(); store.reference(c); write(reference, "GetObjectClass " + store.getIdentifier(c)); } else if (message.startsWith("CallMethod") || message.startsWith("CallStaticMethod")) { String[] args = message.split(" "); Integer objectID = parseCall(args[1], null, Integer.class); String methodName = parseCall(args[2], null, String.class); Object o = null; Class c; if (message.startsWith("CallMethod")) { o = store.getObject(objectID); c = o.getClass(); } else { c = (Class) store.getObject(objectID); } // Discard first 3 parts of message Object[] arguments = new Object[args.length - 3]; for (int i = 0; i < arguments.length; i++) { arguments[i] = store.getObject(parseCall(args[3 + i], null, Integer.class)); PluginDebug.debug("GOT ARG: ", arguments[i]); } MethodOverloadResolver.ResolvedMethod rm = MethodOverloadResolver.getBestMatchMethod(c, methodName, arguments); if (rm == null) { write(reference, "Error: No suitable method named " + methodName + " with matching args found"); return; } final Method m = rm.getMethod(); final Object[] castedArgs = rm.getCastedParameters(); PluginDebug.debug("Calling method ", m, " on object ", o , " (", c, ") with ", Arrays.toString(castedArgs)); AccessControlContext acc = callContext != null ? callContext : getClosedAccessControlContext(); checkPermission(src, c, acc); final Object[] fArguments = castedArgs; final Object callableObject = o; // Set the method accessible prior to calling. See: // http://forums.sun.com/thread.jspa?threadID=332001&start=15&tstart=0 m.setAccessible(true); Object ret = AccessController.doPrivileged(new PrivilegedAction() { @Override public Object run() { try { return m.invoke(callableObject, fArguments); } catch (Throwable t) { return t; } } }, acc); if (ret instanceof Throwable) { throw (Throwable) ret; } String retO; if (ret == null) { retO = "null"; } else { retO = m.getReturnType().toString(); } PluginDebug.debug("Calling ", m, " on ", o, " with ", Arrays.toString(castedArgs), " and that returned: ", ret, " of type ", retO); String objIDStr = toObjectIDString(ret, m.getReturnType(), false /*do not unbox primitives*/); write(reference, "CallMethod " + objIDStr); } else if (message.startsWith("GetSuperclass")) { String[] args = message.split(" "); Integer classID = parseCall(args[1], null, Integer.class); Class c; Class ret; c = (Class) store.getObject(classID); ret = c.getSuperclass(); store.reference(ret); write(reference, "GetSuperclass " + store.getIdentifier(ret)); } else if (message.startsWith("IsAssignableFrom")) { String[] args = message.split(" "); Integer classID = parseCall(args[1], null, Integer.class); Integer superclassID = parseCall(args[2], null, Integer.class); Class clz = (Class) store.getObject(classID); Class sup = (Class) store.getObject(superclassID); boolean result = sup.isAssignableFrom(clz); write(reference, "IsAssignableFrom " + (result ? "1" : "0")); } else if (message.startsWith("IsInstanceOf")) { String[] args = message.split(" "); Integer objectID = parseCall(args[1], null, Integer.class); Integer classID = parseCall(args[2], null, Integer.class); Object o = store.getObject(objectID); Class c = (Class) store.getObject(classID); boolean result = c.isInstance(o); write(reference, "IsInstanceOf " + (result ? "1" : "0")); } else if (message.startsWith("GetStringUTFLength")) { String[] args = message.split(" "); Integer stringID = parseCall(args[1], null, Integer.class); String o; byte[] b = null; o = (String) store.getObject(stringID); b = o.getBytes("UTF-8"); write(reference, "GetStringUTFLength " + o.length()); } else if (message.startsWith("GetStringLength")) { String[] args = message.split(" "); Integer stringID = parseCall(args[1], null, Integer.class); String o; byte[] b = null; o = (String) store.getObject(stringID); b = o.getBytes("UTF-16LE"); write(reference, "GetStringLength " + o.length()); } else if (message.startsWith("GetStringUTFChars")) { String[] args = message.split(" "); Integer stringID = parseCall(args[1], null, Integer.class); String o; StringBuffer buf = null; o = (String) store.getObject(stringID); byte[] b = o.getBytes("UTF-8"); buf = new StringBuffer(b.length * 2); buf.append(b.length); for (int i = 0; i < b.length; i++) { buf.append(" ").append(Integer.toString(((int) b[i]) & 0x0ff, 16)); } write(reference, "GetStringUTFChars " + buf); } else if (message.startsWith("GetStringChars")) { String[] args = message.split(" "); Integer stringID = parseCall(args[1], null, Integer.class); String o; StringBuffer buf = null; o = (String) store.getObject(stringID); // FIXME: LiveConnect uses UCS-2. byte[] b = o.getBytes("UTF-16LE"); buf = new StringBuffer(b.length * 2); buf.append(b.length); for (int i = 0; i < b.length; i++) { buf.append(" ").append(Integer.toString(((int) b[i]) & 0x0ff, 16)); } PluginDebug.debug("Java: GetStringChars: ", o); PluginDebug.debug(" String BYTES: ", buf); write(reference, "GetStringChars " + buf); } else if (message.startsWith("GetToStringValue")) { String[] args = message.split(" "); Integer objectID = parseCall(args[1], null, Integer.class); String o; StringBuffer buf = null; o = store.getObject(objectID).toString(); byte[] b = o.getBytes("UTF-8"); buf = new StringBuffer(b.length * 2); buf.append(b.length); for (int i = 0; i < b.length; i++) { buf.append(" ").append(Integer.toString(((int) b[i]) & 0x0ff, 16)); } write(reference, "GetToStringValue " + buf); } else if (message.startsWith("NewArray")) { String[] args = message.split(" "); String type = parseCall(args[1], null, String.class); Integer length = parseCall(args[2], null, Integer.class); Object newArray; Class c; if (type.equals("bool")) { c = Boolean.class; } else if (type.equals("double")) { c = Double.class; } else if (type.equals("int")) { c = Integer.class; } else if (type.equals("string")) { c = String.class; } else if (isInt(type)) { c = (Class) store.getObject(Integer.parseInt(type)); } else { c = JSObject.class; } if (args.length > 3) { newArray = Array.newInstance(c, new int[] { length, parseCall(args[3], null, Integer.class) }); } else { newArray = Array.newInstance(c, length); } store.reference(newArray); write(reference, "NewArray " + store.getIdentifier(newArray)); } else if (message.startsWith("HasMethod")) { String[] args = message.split(" "); Integer classNameID = parseCall(args[1], null, Integer.class); Integer methodNameID = parseCall(args[2], null, Integer.class); Class c = (Class) store.getObject(classNameID); String methodName = (String) store.getObject(methodNameID); Method method = null; Method[] classMethods = c.getMethods(); for (Method m : classMethods) { if (m.getName().equals(methodName)) { method = m; break; } } int hasMethod = (method != null) ? 1 : 0; write(reference, "HasMethod " + hasMethod); } else if (message.startsWith("HasPackage")) { String[] args = message.split(" "); Integer instance = parseCall(args[1], null, Integer.class); Integer nameID = parseCall(args[2], null, Integer.class); String pkgName = (String) store.getObject(nameID); Package pkg = Package.getPackage(pkgName); int hasPkg = (pkg != null) ? 1 : 0; write(reference, "HasPackage " + hasPkg); } else if (message.startsWith("HasField")) { String[] args = message.split(" "); Integer classNameID = parseCall(args[1], null, Integer.class); Integer fieldNameID = parseCall(args[2], null, Integer.class); Class c = (Class) store.getObject(classNameID); String fieldName = (String) store.getObject(fieldNameID); Field field = null; Field[] classFields = c.getFields(); for (Field f : classFields) { if (f.getName().equals(fieldName)) { field = f; break; } } int hasField = (field != null) ? 1 : 0; write(reference, "HasField " + hasField); } else if (message.startsWith("NewObjectArray")) { String[] args = message.split(" "); Integer length = parseCall(args[1], null, Integer.class); Integer classID = parseCall(args[2], null, Integer.class); Integer objectID = parseCall(args[3], null, Integer.class); Object newArray; newArray = Array.newInstance((Class) store.getObject(classID), length); Object[] array = (Object[]) newArray; for (int i = 0; i < array.length; i++) { array[i] = store.getObject(objectID); } store.reference(newArray); write(reference, "NewObjectArray " + store.getIdentifier(newArray)); } else if (message.startsWith("NewObjectWithConstructor")) { String[] args = message.split(" "); Integer classID = parseCall(args[1], null, Integer.class); Integer methodID = parseCall(args[2], null, Integer.class); final Constructor m = (Constructor) store.getObject(methodID); Class[] argTypes = m.getParameterTypes(); Object[] arguments = new Object[argTypes.length]; for (int i = 0; i < argTypes.length; i++) { arguments[i] = parseArgs(args[3 + i], argTypes[i]); } final Object[] fArguments = arguments; AccessControlContext acc = callContext != null ? callContext : getClosedAccessControlContext(); Class c = (Class) store.getObject(classID); checkPermission(src, c, acc); Object ret = AccessController.doPrivileged(new PrivilegedAction() { @Override public Object run() { try { return m.newInstance(fArguments); } catch (Throwable t) { return t; } } }, acc); if (ret instanceof Throwable) { throw (Throwable) ret; } store.reference(ret); write(reference, "NewObject " + store.getIdentifier(ret)); } else if (message.startsWith("NewObject")) { String[] args = message.split(" "); Integer classID = parseCall(args[1], null, Integer.class); Class c = (Class) store.getObject(classID); // Discard first 2 parts of message Object[] arguments = new Object[args.length - 2]; for (int i = 0; i < arguments.length; i++) { arguments[i] = store.getObject(parseCall(args[2 + i], null, Integer.class)); PluginDebug.debug("GOT ARG: ", arguments[i]); } MethodOverloadResolver.ResolvedMethod resolvedConstructor = MethodOverloadResolver.getBestMatchConstructor(c, arguments); if (resolvedConstructor == null) { write(reference, "Error: No suitable constructor with matching args found"); return; } final Constructor cons = resolvedConstructor.getConstructor(); final Object[] castedArgs = resolvedConstructor.getCastedParameters(); PluginDebug.debug("Calling constructor on class ", c, " with ", Arrays.toString(castedArgs)); AccessControlContext acc = callContext != null ? callContext : getClosedAccessControlContext(); checkPermission(src, c, acc); Object ret = AccessController.doPrivileged(new PrivilegedAction() { @Override public Object run() { try { return cons.newInstance(castedArgs); } catch (Throwable t) { return t; } } }, acc); if (ret instanceof Throwable) { throw (Throwable) ret; } store.reference(ret); write(reference, "NewObject " + store.getIdentifier(ret)); } else if (message.startsWith("NewStringUTF")) { PluginDebug.debug("MESSAGE: ", message); String[] args = message.split(" "); int length = new Integer(args[1]); byte[] byteArray = new byte[length]; int i = 0; int j = 2; int c; while (i < length) { c = Integer.parseInt(args[j++], 16); byteArray[i++] = (byte) c; } String ret = new String(byteArray, "UTF-8"); PluginDebug.debug("NEWSTRINGUTF: ", ret); store.reference(ret); write(reference, "NewStringUTF " + store.getIdentifier(ret)); } else if (message.startsWith("NewString")) { PluginDebug.debug("MESSAGE: ", message); String[] args = message.split(" "); Integer strlength = parseCall(args[1], null, Integer.class); int bytelength = 2 * strlength; byte[] byteArray = new byte[bytelength]; String ret; for (int i = 0; i < strlength; i++) { int c = parseCall(args[2 + i], null, Integer.class); PluginDebug.debug("char ", i, " ", c); // Low. byteArray[2 * i] = (byte) (c & 0x0ff); // High. byteArray[2 * i + 1] = (byte) ((c >> 8) & 0x0ff); } ret = new String(byteArray, 0, bytelength, "UTF-16LE"); PluginDebug.debug("NEWSTRING: ", ret); store.reference(ret); write(reference, "NewString " + store.getIdentifier(ret)); } else if (message.startsWith("ExceptionOccurred")) { PluginDebug.debug("EXCEPTION: ", throwable); if (throwable != null) { store.reference(throwable); } write(reference, "ExceptionOccurred " + store.getIdentifier(throwable)); } else if (message.startsWith("ExceptionClear")) { if (throwable != null && store.contains(throwable)) { store.unreference(store.getIdentifier(throwable)); } throwable = null; write(reference, "ExceptionClear"); } else if (message.startsWith("DeleteGlobalRef")) { String[] args = message.split(" "); Integer id = parseCall(args[1], null, Integer.class); store.unreference(id); write(reference, "DeleteGlobalRef"); } else if (message.startsWith("DeleteLocalRef")) { String[] args = message.split(" "); Integer id = parseCall(args[1], null, Integer.class); store.unreference(id); write(reference, "DeleteLocalRef"); } else if (message.startsWith("NewGlobalRef")) { String[] args = message.split(" "); Integer id = parseCall(args[1], null, Integer.class); store.reference(store.getObject(id)); write(reference, "NewGlobalRef " + id); } else if (message.startsWith("GetClassName")) { String[] args = message.split(" "); Integer objectID = parseCall(args[1], null, Integer.class); Object o = store.getObject(objectID); write(reference, "GetClassName " + o.getClass().getName()); } else if (message.startsWith("GetClassID")) { String[] args = message.split(" "); Integer objectID = parseCall(args[1], null, Integer.class); store.reference(store.getObject(objectID).getClass()); write(reference, "GetClassID " + store.getIdentifier(store.getObject(objectID).getClass())); } } catch (Throwable t) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL,t); String msg = t.getCause() != null ? t.getCause().getMessage() : t.getMessage(); // add an identifier string to let javaside know of the type of error // check for cause as well, since the top level exception will be InvocationTargetException in most cases if (t instanceof AccessControlException || t.getCause() instanceof AccessControlException) { msg = "LiveConnectPermissionNeeded " + msg; } write(reference, " Error " + msg); // ExceptionOccured is only called after Callmethod() by mozilla. So // for exceptions that are not related to CallMethod, we need a way // to log them. This is how we do it.. send an error message to the // c++ side to let it know that something went wrong, and it will do // the right thing to let mozilla know // Store the cause as the actual exception. This is needed because // the exception we get here will always be an // "InvocationTargetException" due to the use of reflection above if (message.startsWith("CallMethod") || message.startsWith("CallStaticMethod")) { throwable = t.getCause(); } } } /** * Checks if the calling script is allowed to access the specified class * * @param jsSrc The source of the script * @param target The target class that the script is trying to access * @param acc AccessControlContext for this execution * @throws AccessControlException If the script has insufficient permissions */ public void checkPermission(String jsSrc, Class target, AccessControlContext acc) throws AccessControlException { // NPRuntime does not allow cross-site calling. We therefore always // allow this, for the time being } private void write(int reference, String message) { PluginDebug.debug("appletviewer writing ", message); streamhandler.write("context " + identifier + " reference " + reference + " " + message); } public void prePopulateLCClasses() { int classID; prepopulateClass("netscape/javascript/JSObject"); classID = prepopulateClass("netscape/javascript/JSException"); prepopulateMethod(classID, "", "(Ljava/lang/String;Ljava/lang/String;ILjava/lang/String;I)"); prepopulateMethod(classID, "", "(ILjava/lang/Object;)"); prepopulateField(classID, "lineno"); prepopulateField(classID, "tokenIndex"); prepopulateField(classID, "source"); prepopulateField(classID, "filename"); prepopulateField(classID, "wrappedExceptionType"); prepopulateField(classID, "wrappedException"); classID = prepopulateClass("netscape/javascript/JSUtil"); prepopulateMethod(classID, "getStackTrace", "(Ljava/lang/Throwable;)"); prepopulateClass("java/lang/Object"); classID = prepopulateClass("java/lang/Class"); prepopulateMethod(classID, "getMethods", "()"); prepopulateMethod(classID, "getConstructors", "()"); prepopulateMethod(classID, "getFields", "()"); prepopulateMethod(classID, "getName", "()"); prepopulateMethod(classID, "isArray", "()"); prepopulateMethod(classID, "getComponentType", "()"); prepopulateMethod(classID, "getModifiers", "()"); classID = prepopulateClass("java/lang/reflect/Method"); prepopulateMethod(classID, "getName", "()"); prepopulateMethod(classID, "getParameterTypes", "()"); prepopulateMethod(classID, "getReturnType", "()"); prepopulateMethod(classID, "getModifiers", "()"); classID = prepopulateClass("java/lang/reflect/Constructor"); prepopulateMethod(classID, "getParameterTypes", "()"); prepopulateMethod(classID, "getModifiers", "()"); classID = prepopulateClass("java/lang/reflect/Field"); prepopulateMethod(classID, "getName", "()"); prepopulateMethod(classID, "getType", "()"); prepopulateMethod(classID, "getModifiers", "()"); classID = prepopulateClass("java/lang/reflect/Array"); prepopulateMethod(classID, "newInstance", "(Ljava/lang/Class;I)"); classID = prepopulateClass("java/lang/Throwable"); prepopulateMethod(classID, "toString", "()"); prepopulateMethod(classID, "getMessage", "()"); classID = prepopulateClass("java/lang/System"); prepopulateMethod(classID, "identityHashCode", "(Ljava/lang/Object;)"); classID = prepopulateClass("java/lang/Boolean"); prepopulateMethod(classID, "booleanValue", "()"); prepopulateMethod(classID, "", "(Z)"); classID = prepopulateClass("java/lang/Double"); prepopulateMethod(classID, "doubleValue", "()"); prepopulateMethod(classID, "", "(D)"); classID = prepopulateClass("java/lang/Void"); prepopulateField(classID, "TYPE"); prepopulateClass("java/lang/String"); prepopulateClass("java/applet/Applet"); } private int prepopulateClass(String name) { name = name.replace('/', '.'); ClassLoader cl = liveconnectLoader; Class c = null; try { c = cl.loadClass(name); store.reference(c); } catch (ClassNotFoundException cnfe) { // do nothing ... this should never happen OutputController.getLogger().log(OutputController.Level.ERROR_ALL,cnfe); } return store.getIdentifier(c); } private int prepopulateMethod(int classID, String methodName, String signatureStr) { Signature signature = parseCall(signatureStr, ((Class) store.getObject(classID)).getClassLoader(), Signature.class); Object[] a = signature.getClassArray(); Class c = (Class) store.getObject(classID); Method m = null; try { if (methodName.equals("") || methodName.equals("")) { Constructor cs = c.getConstructor(signature.getClassArray()); store.reference(cs); } else { m = c.getMethod(methodName, signature.getClassArray()); store.reference(m); } } catch (NoSuchMethodException e) { // should never happen OutputController.getLogger().log(OutputController.Level.ERROR_ALL,e); } return store.getIdentifier(m); } private int prepopulateField(int classID, String fieldName) { Class c = (Class) store.getObject(classID); Field f = null; try { f = c.getField(fieldName); } catch (SecurityException e) { // should never happen OutputController.getLogger().log(OutputController.Level.ERROR_ALL,e); } catch (NoSuchFieldException e) { // should never happen OutputController.getLogger().log(OutputController.Level.ERROR_ALL,e); } store.reference(f); return store.getIdentifier(f); } public void dumpStore() { store.dump(); } public Object getObject(int identifier) { return store.getObject(identifier); } public int getIdentifier(Object o) { return store.getIdentifier(o); } public void store(Object o) { store.reference(o); } /** * @return a "closed" AccessControlContext i.e. no permissions to get out of sandbox. */ public AccessControlContext getClosedAccessControlContext() { // Deny everything Permissions p = new Permissions(); ProtectionDomain pd = new ProtectionDomain(null, p); return new AccessControlContext(new ProtectionDomain[] { pd }); } public AccessControlContext getAccessControlContext(String[] nsPrivilegeList, String src) { Permissions grantedPermissions = new Permissions(); for (String privilege : nsPrivilegeList) { switch (privilege) { case "UniversalBrowserRead": BrowserReadPermission bp = new BrowserReadPermission(); grantedPermissions.add(bp); break; case "UniversalJavaPermission": AllPermission ap = new AllPermission(); grantedPermissions.add(ap); break; } } CodeSource cs = new CodeSource((URL) null, (java.security.cert.Certificate[]) null); if (src != null && src.length() > 0) { try { cs = new CodeSource(new URL(src + "/"), (java.security.cert.Certificate[]) null); } catch (MalformedURLException mfue) { // do nothing } if (src.equals("[System]")) { grantedPermissions.add(new JSObjectCreatePermission()); } } else { JSObjectCreatePermission perm = new JSObjectCreatePermission(); grantedPermissions.add(perm); } ProtectionDomain pd = new ProtectionDomain(cs, grantedPermissions, null, null); // Add to hashmap return new AccessControlContext(new ProtectionDomain[] { pd }); } // private static final == inline private static final boolean isInt(Object o) { boolean isInt = false; try { Integer.parseInt((String) o); isInt = true; } catch (Exception e) { // don't care } return isInt; } class BrowserReadPermission extends BasicPermission { public BrowserReadPermission() { super("browserRead"); } } } icedtea-web-1.6.2/plugin/icedteanp/java/sun/applet/PaxHeaders.17941/PluginAppletPanelFactory.java0000644000000000000000000000013112654402377027470 xustar0030 mtime=1454507263.224432754 29 atime=1454507327.17457987 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/icedteanp/java/sun/applet/PluginAppletPanelFactory.java0000644000175000002070000002340312654402377030216 0ustar00jvanekmock00000000000000/* Copyright (C) 2012 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ /* * Copyright 1995-2004 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Sun designates this * particular file as subject to the "Classpath" exception as provided * by Sun in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, * CA 95054 USA or visit www.sun.com if you need additional information or * have any questions. */ package sun.applet; import java.applet.Applet; import java.lang.reflect.InvocationTargetException; import java.net.URL; import java.security.AccessController; import java.security.PrivilegedAction; import javax.swing.SwingUtilities; import net.sourceforge.jnlp.NetxPanel; import net.sourceforge.jnlp.PluginBridge; import net.sourceforge.jnlp.PluginParameters; import net.sourceforge.jnlp.util.logging.OutputController; /** * Lets us construct one using unix-style one shot behaviors */ class PluginAppletPanelFactory { public AppletPanel createPanel(PluginStreamHandler streamhandler, final int identifier, final long handle, final URL doc, final PluginParameters params, final PluginBridge pb) { final NetxPanel panel = AccessController.doPrivileged(new PrivilegedAction() { public NetxPanel run() { NetxPanel panel = new NetxPanel(doc, params, pb); OutputController.getLogger().log("Using NetX panel"); PluginDebug.debug(params.toString()); return panel; } }); // Framing the panel needs to happen in a thread whose thread group // is the same as the threadgroup of the applet thread. If this // isn't the case, the awt eventqueue thread's context classloader // won't be set to a JNLPClassLoader, and when an applet class needs // to be loaded from the awt eventqueue, it won't be found. Thread panelInit = new Thread(panel.getThreadGroup(), new Runnable() { @Override public void run() { panel.createNewAppContext(); // create the frame. PluginDebug.debug("X and Y are: " + params.getWidth() + " " + params.getHeight()); panel.setAppletViewerFrame(PluginAppletViewer.framePanel(identifier, handle, params.getWidth(), params.getHeight(), panel)); panel.init(); // Start the applet initEventQueue(panel); } }, "NetXPanel initializer"); panelInit.start(); try { panelInit.join(); } catch (InterruptedException e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL,e); } setAppletViewerSize(panel, params.getWidth(), params.getHeight()); // Wait for the panel to initialize PluginAppletViewer.waitForAppletInit(panel); Applet a = panel.getApplet(); // Still null? if (a == null) { streamhandler.write("instance " + identifier + " reference " + -1 + " fatalError: " + "Initialization timed out"); return null; } PluginDebug.debug("Applet ", a.getClass(), " initialized"); streamhandler.write("instance " + identifier + " reference 0 initialized"); panel.removeSplash(); AppletSecurityContextManager.getSecurityContext(0).associateSrc(panel.getAppletClassLoader(), doc); AppletSecurityContextManager.getSecurityContext(0).associateInstance(identifier, panel.getAppletClassLoader()); return panel; } /* AppletViewerPanel sometimes doesn't set size right initially. This * causes the parent frame to be the default (10x10) size. * * Normally it goes unnoticed since browsers like Firefox make a resize * call after init. However some browsers (e.g. Midori) don't. * * We therefore manually set the parent to the right size. */ static private void setAppletViewerSize(final AppletPanel panel, final int width, final int height) { try { SwingUtilities.invokeAndWait(new Runnable() { public void run() { panel.getParent().setSize(width, height); } }); } catch (InvocationTargetException e) { // Not being able to resize is non-fatal PluginDebug.debug("Unable to resize panel: "); OutputController.getLogger().log(OutputController.Level.ERROR_ALL,e); } catch (InterruptedException e) { // Not being able to resize is non-fatal PluginDebug.debug("Unable to resize panel: "); OutputController.getLogger().log(OutputController.Level.ERROR_ALL,e); } } /** * Send the initial set of events to the appletviewer event queue. * On start-up the current behaviour is to load the applet and call * Applet.init() and Applet.start(). */ private void initEventQueue(AppletPanel panel) { // appletviewer.send.event is an undocumented and unsupported system // property which is used exclusively for testing purposes. PrivilegedAction pa = new PrivilegedAction() { public String run() { return System.getProperty("appletviewer.send.event"); } }; String eventList = AccessController.doPrivileged(pa); if (eventList == null) { // Add the standard events onto the event queue. panel.sendEvent(AppletPanel.APPLET_LOAD); panel.sendEvent(AppletPanel.APPLET_INIT); panel.sendEvent(AppletPanel.APPLET_START); } else { // We're testing AppletViewer. Force the specified set of events // onto the event queue, wait for the events to be processed, and // exit. // The list of events that will be executed is provided as a // ","-separated list. No error-checking will be done on the list. String[] events = eventList.split(","); for (String event : events) { PluginDebug.debug("Adding event to queue: ", event); if ("dispose".equals(event)) panel.sendEvent(AppletPanel.APPLET_DISPOSE); else if ("load".equals(event)) panel.sendEvent(AppletPanel.APPLET_LOAD); else if ("init".equals(event)) panel.sendEvent(AppletPanel.APPLET_INIT); else if ("start".equals(event)) panel.sendEvent(AppletPanel.APPLET_START); else if ("stop".equals(event)) panel.sendEvent(AppletPanel.APPLET_STOP); else if ("destroy".equals(event)) panel.sendEvent(AppletPanel.APPLET_DESTROY); else if ("quit".equals(event)) panel.sendEvent(AppletPanel.APPLET_QUIT); else if ("error".equals(event)) panel.sendEvent(AppletPanel.APPLET_ERROR); else // non-fatal error if we get an unrecognized event PluginDebug.debug("Unrecognized event name: ", event); } while (!panel.emptyEventQueue()) ; } } }icedtea-web-1.6.2/plugin/icedteanp/java/sun/applet/PaxHeaders.17941/MethodOverloadResolver.java0000644000000000000000000000013112654402377027212 xustar0030 mtime=1454507263.223432768 29 atime=1454507327.17457987 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/icedteanp/java/sun/applet/MethodOverloadResolver.java0000644000175000002070000004672112654402377027750 0ustar00jvanekmock00000000000000/* MethodOverloadResolver -- Resolves overloaded methods Copyright (C) 2009 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package sun.applet; import java.lang.reflect.Array; import java.lang.reflect.Constructor; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.Arrays; import java.util.List; /* * This class resolved overloaded methods in Java objects using a cost * based-approach described here: * * http://jdk6.java.net/plugin2/liveconnect/#OVERLOADED_METHODS */ public class MethodOverloadResolver { static final int NUMERIC_SAME_COST = 1; static final int NULL_TO_OBJECT_COST = 2; static final int CLASS_SAME_COST = 3; static final int NUMERIC_CAST_COST = 4; static final int NUMERIC_BOOLEAN_COST = 5; static final int STRING_NUMERIC_CAST_COST = 5; static final int CLASS_SUPERCLASS_COST = 6; static final int CLASS_STRING_COST = 7; static final int ARRAY_CAST_COST = 8; /* A method signature with its casted parameters * We pretend a Constructor is a normal 'method' for ease of code reuse */ static class ResolvedMethod { private java.lang.reflect.AccessibleObject method; private Object[] castedParameters; private int cost; public ResolvedMethod(int cost, java.lang.reflect.AccessibleObject method, Object[] castedParameters) { this.cost = cost; this.method = method; this.castedParameters = castedParameters; } java.lang.reflect.AccessibleObject getAccessibleObject() { return method; } public Method getMethod() { return (Method)method; } public Constructor getConstructor() { return (Constructor)method; } public Object[] getCastedParameters() { return castedParameters; } public int getCost() { return cost; } } /* A cast with an associated 'cost', used for picking method overloads */ static class WeightedCast { private int cost; private final int distance; private Object castedObject; public WeightedCast(int cost, Object castedObject) { this.cost = cost; this.castedObject = castedObject; this.distance = 0; } public WeightedCast(int cost, Object castedObject, int distance) { this.cost = cost; this.castedObject = castedObject; this.distance = distance; } public Object getCastedObject() { return castedObject; } public int getCost() { return cost; } public int getDistance() { return distance; } } public static ResolvedMethod getBestMatchMethod(Class c, String methodName, Object[] args) { Method[] matchingMethods = getMatchingMethods(c, methodName, args.length); if (PluginDebug.DEBUG) { /* avoid toString if not needed */ PluginDebug.debug("getMatchingMethod called with: " + Arrays.toString(args)); } return getBestOverloadMatch(c, args, matchingMethods); } public static ResolvedMethod getBestMatchConstructor(Class c, Object[] args) { Constructor[] matchingConstructors = getMatchingConstructors(c, args.length); if (PluginDebug.DEBUG) { /* avoid toString if not needed */ PluginDebug.debug("getMatchingConstructor called with: " + Arrays.toString(args)); } return getBestOverloadMatch(c, args, matchingConstructors); } /* * Get best-matching method based on a cost based overload resolution * algorithm is used, described here: * * http://jdk6.java.net/plugin2/liveconnect/#OVERLOADED_METHODS * * Note that we consider Constructor's to be 'methods' for convenience. We * use the common parent class of Method/Constructor, 'AccessibleObject' * * NB: Although the spec specifies that ambiguous method calls (ie, same * cost) should throw errors, we simply pick the first overload for * simplicity. Method overrides should not be doing wildly different things * anyway. */ static ResolvedMethod getBestOverloadMatch(Class c, Object[] args, java.lang.reflect.AccessibleObject[] candidates) { int lowestCost = Integer.MAX_VALUE; int lowestDistance = Integer.MAX_VALUE; java.lang.reflect.AccessibleObject cheapestMethod = null; Object[] cheapestArgs = null; boolean ambiguous = false; methodLoop: for (java.lang.reflect.AccessibleObject candidate : candidates) { int methodCost = 0; int distance = 0; Class[] paramTypes = getParameterTypesFor(candidate); Object[] castedArgs = new Object[paramTypes.length]; // Figure out which of the matched methods best represents what we // want for (int i = 0; i < paramTypes.length; i++) { Class paramTypeClass = paramTypes[i]; Object suppliedParam = args[i]; Class suppliedParamClass = suppliedParam != null ? suppliedParam .getClass() : null; WeightedCast weightedCast = getCostAndCastedObject( suppliedParam, paramTypeClass); if (weightedCast == null) { continue methodLoop; // Cannot call this constructor! } methodCost += weightedCast.getCost(); distance = weightedCast.getDistance(); Object castedObj = paramTypeClass.isPrimitive() ? weightedCast.getCastedObject() : paramTypeClass.cast(weightedCast.getCastedObject()); castedArgs[i] = castedObj; if (PluginDebug.DEBUG) { /* avoid toString if not needed */ Class castedObjClass = castedObj == null ? null : castedObj.getClass(); boolean castedObjIsPrim = castedObj == null ? false : castedObj.getClass().isPrimitive(); PluginDebug.debug("Param " + i + " of method " + candidate + " has cost " + weightedCast.getCost() + " distance " + weightedCast.getDistance() + " original param type " + suppliedParamClass + " casted to " + castedObjClass + " isPrimitive=" + castedObjIsPrim + " value " + castedObj); } } if (methodCost < lowestCost || (methodCost == lowestCost && distance <= lowestDistance)) { if (methodCost < lowestCost || argumentsAreSubclassesOf(castedArgs, cheapestArgs)) { lowestCost = methodCost; cheapestArgs = castedArgs; cheapestMethod = candidate; lowestDistance = distance; ambiguous = false; } else { ambiguous = true; } } } // The spec says we should error out if the method call is ambiguous // Instead we will report it in debug output if (ambiguous) { PluginDebug.debug("*** Warning: Ambiguous overload of ", c.getClass(), "#", cheapestMethod, "!"); } if (cheapestMethod == null) { return null; } return new ResolvedMethod(lowestCost, cheapestMethod, cheapestArgs); } public static WeightedCast getCostAndCastedObject(Object suppliedParam, Class paramTypeClass) { Class suppliedParamClass = suppliedParam != null ? suppliedParam .getClass() : null; boolean suppliedParamIsArray = suppliedParamClass != null && suppliedParamClass.isArray(); if (suppliedParamIsArray) { if (paramTypeClass.isArray()) { return getArrayToArrayCastWeightedCost(suppliedParam, paramTypeClass); } // Target type must be an array, Object or String // If it an object, we return "as is" [Everything can be narrowed to an // object, cost=CLASS_SUPERCLASS_COST] // If it is a string, we need to convert according to the JS engine // rules if (paramTypeClass != String.class && paramTypeClass != Object.class) { return null; } if (paramTypeClass.equals(String.class)) { return new WeightedCast(ARRAY_CAST_COST, arrayToJavascriptStyleString(suppliedParam)); } } // If this is null, there are only 2 possible cases if (suppliedParamClass == null) { if (!paramTypeClass.isPrimitive()) { return new WeightedCast(NULL_TO_OBJECT_COST, null); // Null to any non-primitive type } return null;// Null to primitive not allowed } // Numeric type to the analogous Java primitive type if (paramTypeClass.isPrimitive() && paramTypeClass == getPrimitiveType(suppliedParam.getClass())) { return new WeightedCast(NUMERIC_SAME_COST, suppliedParam); } // Class type to Class type where the types are the same if (suppliedParamClass == paramTypeClass) { return new WeightedCast(CLASS_SAME_COST, suppliedParam); } // Numeric type to a different primitive type boolean wrapsPrimitive = (getPrimitiveType(suppliedParam.getClass()) != null); if (wrapsPrimitive && paramTypeClass.isPrimitive()) { double val; // Coerce booleans if (suppliedParam.equals(Boolean.TRUE)) { val = 1.0; } else if (suppliedParam.equals(Boolean.FALSE)){ val = 0.0; } else if (suppliedParam instanceof Character) { val = (double)(Character)suppliedParam; } else { val = ((Number)suppliedParam).doubleValue(); } int castCost = NUMERIC_CAST_COST; Object castedObj; if (paramTypeClass.equals(Boolean.TYPE)) { castedObj = (val != 0D && !Double.isNaN(val)); if (suppliedParam.getClass() != Boolean.class) { castCost = NUMERIC_BOOLEAN_COST; } } else { castedObj = toBoxedPrimitiveType(val, paramTypeClass); } return new WeightedCast(castCost, castedObj); } // Numeric string to numeric type if (isNumericString(suppliedParam) && paramTypeClass.isPrimitive()) { Object castedObj; if (paramTypeClass.equals(Character.TYPE)) { castedObj = (char) Short.decode((String)suppliedParam).shortValue(); } else { castedObj = stringAsPrimitiveType((String)suppliedParam, paramTypeClass); } return new WeightedCast(STRING_NUMERIC_CAST_COST, castedObj); } // Same cost as above if (suppliedParam instanceof java.lang.String && (paramTypeClass == java.lang.Boolean.class || paramTypeClass == java.lang.Boolean.TYPE)) { return new WeightedCast(STRING_NUMERIC_CAST_COST, !suppliedParam.equals("")); } // Class type to superclass type; if (paramTypeClass.isAssignableFrom(suppliedParamClass)) { return new WeightedCast(CLASS_SUPERCLASS_COST, paramTypeClass.cast(suppliedParam), classDistance(suppliedParamClass, paramTypeClass)); } // Any java value to String if (paramTypeClass.equals(String.class)) { return new WeightedCast(CLASS_STRING_COST, suppliedParam.toString()); } return null; } private static int classDistance(Class subClass, Class superClass) { int distance = 0; if (superClass.isAssignableFrom(subClass)) { while (!subClass.equals(superClass)) { subClass = subClass.getSuperclass(); distance++; } } return distance; } private static WeightedCast getArrayToArrayCastWeightedCost(Object suppliedArray, Class paramTypeClass) { int arrLength = Array.getLength(suppliedArray); Class arrType = paramTypeClass.getComponentType(); // If it is an array, we need to copy/cast as we scan the array Object newArray = Array.newInstance(arrType, arrLength); for (int i = 0; i < arrLength; i++) { Object original = Array.get(suppliedArray, i); // When dealing with arrays, we represent empty slots with // null. We need to convert this to 0 before recursive // calling, since normal transformation does not allow // null -> primitive if (original == null && arrType.isPrimitive()) { original = 0; } WeightedCast costAndCastedObject = getCostAndCastedObject(original, paramTypeClass.getComponentType()); if (costAndCastedObject == null) { return null; } Array.set(newArray, i, costAndCastedObject.getCastedObject()); } return new WeightedCast(ARRAY_CAST_COST, newArray); } private static Method[] getMatchingMethods(Class c, String name, int paramCount) { List matchingMethods = new ArrayList(); for (Method m : c.getMethods()) { if (m.getName().equals(name)) { if (m.getParameterTypes().length == paramCount) { matchingMethods.add(m); } } } return matchingMethods.toArray(new Method[0]); } private static Constructor[] getMatchingConstructors(Class c, int paramCount) { List> matchingConstructors = new ArrayList>(); for (Constructor cs : c.getConstructors()) { if (cs.getParameterTypes().length == paramCount) { matchingConstructors.add(cs); } } return matchingConstructors.toArray(new Constructor[0]); } private static Class getPrimitiveType(Class c) { if (c.isPrimitive()) { return c; } if (c == Byte.class) { return Byte.TYPE; } else if (c == Character.class) { return Character.TYPE; } else if (c == Short.class) { return Short.TYPE; } else if (c == Integer.class) { return Integer.TYPE; } else if (c == Long.class) { return Long.TYPE; } else if (c == Float.class) { return Float.TYPE; } else if (c == Double.class) { return Double.TYPE; } else if (c == Boolean.class) { return Boolean.TYPE; } else { return null; } } private static boolean isNumericString(Object o) { // At this point, it _has_ to be a string else automatically // return false if (!(o instanceof java.lang.String)) { return false; } try { Long.parseLong((String) o); // whole number test return true; } catch (NumberFormatException nfe) { } try { Float.parseFloat((String) o); // decimal return true; } catch (NumberFormatException nfe) { } return false; } private static Object toBoxedPrimitiveType(double val, Class c) { Class prim = getPrimitiveType(c); // See if we need to collapse first if (prim == Integer.TYPE) { return (int)val; } else if (prim == Long.TYPE) { return (long)val; } else if (prim == Short.TYPE) { return (short)val; } else if (prim == Float.TYPE) { return (float)val; } else if (prim == Double.TYPE) { return val; } else if (prim == Byte.TYPE) { return (byte)val; } else if (prim == Character.TYPE) { return (char)(short)val; } return val; } private static Object stringAsPrimitiveType(String s, Class c) throws NumberFormatException { double val = Double.parseDouble(s); return toBoxedPrimitiveType(val, c); } // Test whether we can get from 'args' to 'testArgs' only by using widening conversions, // eg String -> Object private static boolean argumentsAreSubclassesOf(Object[] args, Object[] testArgs) { for (int i = 0; i < args.length; i++) { if (!testArgs[i].getClass().isAssignableFrom(args[i].getClass())) { return false; } } return true; } static Class[] getParameterTypesFor(java.lang.reflect.AccessibleObject method) { if (method instanceof Method) { return ((Method)method).getParameterTypes(); } else /*m instanceof Constructor*/ { return ((Constructor)method).getParameterTypes(); } } private static String arrayToJavascriptStyleString(Object array) { int arrLength = Array.getLength(array); StringBuilder sb = new StringBuilder(); for (int i = 0; i < arrLength; i++) { Object element = Array.get(array, i); if (element != null) { if (element.getClass().isArray()) { sb.append(arrayToJavascriptStyleString(element)); } else { sb.append(element); } } sb.append(','); } // Trim the final "," if (arrLength > 0) { sb.setLength(sb.length() - 1); } return sb.toString(); } }icedtea-web-1.6.2/plugin/icedteanp/java/sun/applet/PaxHeaders.17941/GetWindowPluginCallRequest.java0000644000000000000000000000013112654402377030007 xustar0030 mtime=1454507263.223432768 29 atime=1454507327.17457987 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/icedteanp/java/sun/applet/GetWindowPluginCallRequest.java0000644000175000002070000000461212654402377030536 0ustar00jvanekmock00000000000000/* GetWindowPluginCallRequest -- represent Java-to-JavaScript requests Copyright (C) 2008 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package sun.applet; public class GetWindowPluginCallRequest extends PluginCallRequest { // FIXME: look into int vs long JavaScript internal values. long internal; public GetWindowPluginCallRequest(String message, Long reference) { super(message, reference); } public void parseReturn(String message) { PluginDebug.debug("GetWindowParseReturn GOT: ", message); String[] args = message.split(" "); // FIXME: add thread ID to messages to support multiple // threads using the netscape.javascript package. internal = Long.parseLong(args[3]); setDone(true); } public Long getObject() { return this.internal; } } icedtea-web-1.6.2/plugin/icedteanp/java/sun/applet/PaxHeaders.17941/GetMemberPluginCallRequest.java0000644000000000000000000000013112654402377027747 xustar0030 mtime=1454507263.222432781 29 atime=1454507327.17457987 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/icedteanp/java/sun/applet/GetMemberPluginCallRequest.java0000644000175000002070000000476112654402377030503 0ustar00jvanekmock00000000000000/* GetMemberPluginCallRequest -- represent Java-to-JavaScript requests Copyright (C) 2008 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package sun.applet; public class GetMemberPluginCallRequest extends PluginCallRequest { Object object = null; public GetMemberPluginCallRequest(String message, Long reference) { super(message, reference); PluginDebug.debug("GetMemberPluginCall ", message); } public void parseReturn(String message) { PluginDebug.debug("GetMemberParseReturn GOT: ", message); String[] args = message.split(" "); // FIXME: Is it even possible to distinguish between null and void // here? if (!"null".equals(args[3]) && !"void".equals(args[3])) object = AppletSecurityContextManager.getSecurityContext(0).getObject(Integer.parseInt(args[3])); setDone(true); } public Object getObject() { return this.object; } } icedtea-web-1.6.2/plugin/icedteanp/java/sun/applet/PaxHeaders.17941/AppletSecurityContextManager.jav0000644000000000000000000000013212654402377030231 xustar0030 mtime=1454507263.222432781 30 atime=1454507327.173579883 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/icedteanp/java/sun/applet/AppletSecurityContextManager.java0000644000175000002070000000571512654402377031125 0ustar00jvanekmock00000000000000/* AppletSecurityContextManager -- handles messages in an appropriate security context Copyright (C) 2008 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package sun.applet; import java.security.AccessControlContext; import java.util.HashMap; public class AppletSecurityContextManager { // Context identifier -> PluginAppletSecurityContext object. private static HashMap contexts = new HashMap(); public static void addContext(int identifier, PluginAppletSecurityContext context) { contexts.put(identifier, context); } public static PluginAppletSecurityContext getSecurityContext(int identifier) { return contexts.get(identifier); } public static void dumpStore(int identifier) { contexts.get(identifier).dumpStore(); } public static void handleMessage(int identifier, int reference, String src, String[] privileges, String message) { PluginDebug.debug(identifier, " -- ", src, " -- ", reference, " -- ", message, " CONTEXT= ", contexts.get(identifier)); AccessControlContext callContext = null; privileges = privileges != null ? privileges : new String[0]; callContext = contexts.get(identifier).getAccessControlContext(privileges, src); contexts.get(identifier).handleMessage(reference, src, callContext, message); } } icedtea-web-1.6.2/plugin/icedteanp/java/PaxHeaders.17941/netscape0000644000000000000000000000013212654402377021345 xustar0030 mtime=1454507263.221432794 30 atime=1454507658.779157357 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/icedteanp/java/netscape/0000755000175000002070000000000012654402377022145 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/plugin/icedteanp/java/netscape/PaxHeaders.17941/security0000644000000000000000000000013212654402377023214 xustar0030 mtime=1454507263.222432781 30 atime=1454507658.779157357 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/icedteanp/java/netscape/security/0000755000175000002070000000000012654402377024014 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/plugin/icedteanp/java/netscape/security/PaxHeaders.17941/PrivilegeManager.java0000644000000000000000000000013212654402377027355 xustar0030 mtime=1454507263.222432781 30 atime=1454507327.173579883 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/icedteanp/java/netscape/security/PrivilegeManager.java0000644000175000002070000000537312654402377030110 0ustar00jvanekmock00000000000000/* PrivilegeManager.java Copyright (C) 2011 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ /** * * This class does not implement any functionality and exists for backward * compatibility only. * * At one point Netscape required applets to request specific permissions to * do things. This is not longer the case with IcedTea-Web (and other modern * plug-ins). However because some old applets may still have code calling * this class, an empty stub is needed to prevent a ClassNotFoundException. * */ package netscape.security; import sun.applet.PluginDebug; public class PrivilegeManager { /** * Stub for enablePrivilege. Not used by IcedTea-Web, kept for compatibility * * @param privilege privilege to eb enabled */ public static void enablePrivilege(String privilege) { PluginDebug.debug("netscape.security.enablePrivilege stub called"); } /** * Stub for disablePrivilege. Not used by IcedTea-Web, kept for compatibility * * @param privilege privilege to be disabled */ public static void disablePrivilege(String privilege) { PluginDebug.debug("netscape.security.disablePrivilege stub called"); } } icedtea-web-1.6.2/plugin/icedteanp/java/netscape/security/PaxHeaders.17941/ForbiddenTargetException.0000644000000000000000000000013212654402377030214 xustar0030 mtime=1454507263.221432794 30 atime=1454507327.173579883 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/icedteanp/java/netscape/security/ForbiddenTargetException.java0000644000175000002070000000372212654402377031605 0ustar00jvanekmock00000000000000/* ForbiddenTargetException.java Copyright (C) 2010 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package netscape.security; public class ForbiddenTargetException extends RuntimeException { private static final long serialVersionUID = 1271219852541058396L; public ForbiddenTargetException() { super(); } public ForbiddenTargetException(String s) { super(s); } } icedtea-web-1.6.2/plugin/icedteanp/java/netscape/PaxHeaders.17941/javascript0000644000000000000000000000013212654402377023513 xustar0030 mtime=1454507263.221432794 30 atime=1454507658.779157357 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/icedteanp/java/netscape/javascript/0000755000175000002070000000000012654402377024313 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/plugin/icedteanp/java/netscape/javascript/PaxHeaders.17941/JSUtil.java0000644000000000000000000000013212654402377025605 xustar0030 mtime=1454507263.221432794 30 atime=1454507327.173579883 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/icedteanp/java/netscape/javascript/JSUtil.java0000644000175000002070000000520312654402377026330 0ustar00jvanekmock00000000000000/* -*- Mode: Java; tab-width: 8; c-basic-offset: 4 -*- * * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is Mozilla Communicator client code, released * March 31, 1998. * * The Initial Developer of the Original Code is * Netscape Communications Corporation. * Portions created by the Initial Developer are Copyright (C) 1998 * the Initial Developer. All Rights Reserved. * * Contributor(s): * * Alternatively, the contents of this file may be used under the terms of * either of the GNU General Public License Version 2 or later (the "GPL"), * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ /* ** */ package netscape.javascript; import java.io.*; public class JSUtil { /* Return the stack trace of an exception or error as a String */ public static String getStackTrace(Throwable t) { ByteArrayOutputStream captureStream; PrintWriter p; captureStream = new ByteArrayOutputStream(); p = new PrintWriter(captureStream); t.printStackTrace(p); p.flush(); return captureStream.toString(); } /** * Uses package-private method JSObject.getInternalReference. * This is package-private to avoid polluting the public interface. * @param js JSObject to unbox * @return the internal reference stored by the JSObject */ public static long getJSObjectInternalReference(JSObject js) { // NB: permission is checked in JSObject return js.getInternalReference(); } }icedtea-web-1.6.2/plugin/icedteanp/java/netscape/javascript/PaxHeaders.17941/JSRunnable.java0000644000000000000000000000013212654402377026436 xustar0030 mtime=1454507263.221432794 30 atime=1454507327.173579883 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/icedteanp/java/netscape/javascript/JSRunnable.java0000644000175000002070000000517512654402377027171 0ustar00jvanekmock00000000000000/* -*- Mode: Java; tab-width: 8; c-basic-offset: 4 -*- * * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is Mozilla Communicator client code, released * March 31, 1998. * * The Initial Developer of the Original Code is * Netscape Communications Corporation. * Portions created by the Initial Developer are Copyright (C) 1998 * the Initial Developer. All Rights Reserved. * * Contributor(s): * * Alternatively, the contents of this file may be used under the terms of * either of the GNU General Public License Version 2 or later (the "GPL"), * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ package netscape.javascript; import net.sourceforge.jnlp.util.logging.OutputController; import sun.applet.PluginDebug; /** * Runs a JavaScript object with a run() method in a separate thread. */ public class JSRunnable implements Runnable { private JSObject runnable; public JSRunnable(JSObject runnable) { this.runnable = runnable; synchronized (this) { new Thread(this).start(); try { this.wait(); } catch (InterruptedException ie) { } } } public void run() { try { runnable.call("run", null); synchronized (this) { notifyAll(); } } catch (Throwable t) { PluginDebug.debug(t.toString()); OutputController.getLogger().log(OutputController.Level.ERROR_ALL,t); } } } icedtea-web-1.6.2/plugin/icedteanp/java/netscape/javascript/PaxHeaders.17941/JSProxy.java0000644000000000000000000000013212654402377026011 xustar0030 mtime=1454507263.221432794 30 atime=1454507327.173579883 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/icedteanp/java/netscape/javascript/JSProxy.java0000644000175000002070000000463312654402377026542 0ustar00jvanekmock00000000000000/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- * * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is Mozilla Communicator client code, released * March 31, 1998. * * The Initial Developer of the Original Code is * Netscape Communications Corporation. * Portions created by the Initial Developer are Copyright (C) 1998 * the Initial Developer. All Rights Reserved. * * Contributor(s): * * Alternatively, the contents of this file may be used under the terms of * either of the GNU General Public License Version 2 or later (the "GPL"), * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ /** * The JSProxy interface allows applets and plugins to * share javascript contexts. */ package netscape.javascript; import java.applet.Applet; public interface JSProxy { Object getMember(JSObject jso, String name); Object getSlot(JSObject jso, int index); void setMember(JSObject jso, String name, Object value); void setSlot(JSObject jso, int index, Object value); void removeMember(JSObject jso, String name); Object call(JSObject jso, String methodName, Object args[]); Object eval(JSObject jso, String s); String toString(JSObject jso); JSObject getWindow(Applet applet); } icedtea-web-1.6.2/plugin/icedteanp/java/netscape/javascript/PaxHeaders.17941/JSObjectUnboxPermission0000644000000000000000000000013212654402377030243 xustar0030 mtime=1454507263.220432808 30 atime=1454507327.173579883 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/icedteanp/java/netscape/javascript/JSObjectUnboxPermission.java0000644000175000002070000000366212654402377031715 0ustar00jvanekmock00000000000000/* JSObjectUnboxPermission.java Copyright (C) 2012 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package netscape.javascript; import java.security.BasicPermission; /** * Permission to access internal reference of JSObject */ public class JSObjectUnboxPermission extends BasicPermission { public JSObjectUnboxPermission() { super("JSObjectUnbox"); } } icedtea-web-1.6.2/plugin/icedteanp/java/netscape/javascript/PaxHeaders.17941/JSObjectCreatePermissio0000644000000000000000000000013212654402377030175 xustar0030 mtime=1454507263.220432808 30 atime=1454507327.173579883 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/icedteanp/java/netscape/javascript/JSObjectCreatePermission.java0000644000175000002070000000356712654402377032031 0ustar00jvanekmock00000000000000/* JSObjectCreatePermission.java Copyright (C) 2009 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package netscape.javascript; import java.security.BasicPermission; public class JSObjectCreatePermission extends BasicPermission { public JSObjectCreatePermission() { super("JSObjectCreate"); } } icedtea-web-1.6.2/plugin/icedteanp/java/netscape/javascript/PaxHeaders.17941/JSObject.java0000644000000000000000000000013212654402377026076 xustar0030 mtime=1454507263.220432808 30 atime=1454507327.172579897 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/icedteanp/java/netscape/javascript/JSObject.java0000644000175000002070000002425412654402377026630 0ustar00jvanekmock00000000000000/* -*- Mode: Java; tab-width: 8; c-basic-offset: 4 -*- * * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is Mozilla Communicator client code, released * March 31, 1998. * * The Initial Developer of the Original Code is * Netscape Communications Corporation. * Portions created by the Initial Developer are Copyright (C) 1998 * the Initial Developer. All Rights Reserved. * * Contributor(s): * * Alternatively, the contents of this file may be used under the terms of * either of the GNU General Public License Version 2 or later (the "GPL"), * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ /* more doc TODO: * threads * gc * * */ package netscape.javascript; import java.applet.Applet; import java.security.AccessControlException; import java.security.AccessController; import sun.applet.PluginAppletViewer; import sun.applet.PluginDebug; /** * JSObject allows Java to manipulate objects that are * defined in JavaScript. * Values passed from Java to JavaScript are converted as * follows:
    *
  • JSObject is converted to the original JavaScript object *
  • Any other Java object is converted to a JavaScript wrapper, * which can be used to access methods and fields of the java object. * Converting this wrapper to a string will call the toString method * on the original object, converting to a number will call the * doubleValue method if possible and fail otherwise. Converting * to a boolean will try to call the booleanValue method in the * same way. *
  • Java arrays are wrapped with a JavaScript object that understands * array.length and array[index] *
  • A Java boolean is converted to a JavaScript boolean *
  • Java byte, char, short, int, long, float, and double are converted * to JavaScript numbers *
* Values passed from JavaScript to Java are converted as follows:
    *
  • objects which are wrappers around java objects are unwrapped *
  • other objects are wrapped with a JSObject *
  • strings, numbers and booleans are converted to String, Double, * and Boolean objects respectively *
* This means that all JavaScript values show up as some kind * of java.lang.Object in Java. In order to make much use of them, * you will have to cast them to the appropriate subclass of Object, * e.g. (String) window.getMember("name"); or * (JSObject) window.getMember("document");. */ public final class JSObject { /* the internal object data */ private long internal; /** * initialize */ private static void initClass() { PluginDebug.debug("JSObject.initClass"); } static { PluginDebug.debug("JSObject INITIALIZER"); } /** * Package-private method used through JSUtil#getJSObjectInternalReference. * We make this package-private to avoid polluting the public interface. * @return the internal identifier */ long getInternalReference() { AccessController.getContext().checkPermission(new JSObjectUnboxPermission()); return internal; } /** * it is illegal to construct a JSObject manually * @param jsobj_addr integer to become jsobject */ public JSObject(int jsobj_addr) { this((long) jsobj_addr); } /** * it is illegal to construct a JSObject manually * @param jsobj_addr string to become jsobject */ public JSObject(String jsobj_addr) { this(Long.parseLong(jsobj_addr)); } public JSObject(long jsobj_addr) { // See if the caller has permission try { AccessController.getContext().checkPermission(new JSObjectCreatePermission()); } catch (AccessControlException ace) { // If not, only caller with JSObject.getWindow on the stack may // make this call unprivileged. // Although this check is inefficient, it should happen only once // during applet init, so we look the other way StackTraceElement[] stack = Thread.currentThread().getStackTrace(); boolean mayProceed = false; for (StackTraceElement element : stack) { if (element.getClassName().equals("netscape.javascript.JSObject") && element.getMethodName().equals("getWindow")) { mayProceed = true; } } if (!mayProceed) throw ace; } PluginDebug.debug("JSObject long CONSTRUCTOR"); internal = jsobj_addr; } /** * Retrieves a named member of a JavaScript object. * Equivalent to "this.name" in JavaScript. * @param name name of the memebr to be searched in * @return object which is member of name */ public Object getMember(String name) { PluginDebug.debug("JSObject.getMember ", name); Object o = PluginAppletViewer.getMember(internal, name); PluginDebug.debug("JSObject.getMember GOT ", o); return o; } /** * Retrieves an indexed member of a JavaScript object. * Equivalent to "this[index]" in JavaScript. * @param index as in array-like touch in javascript array * @return object on index position */ // public Object getMember(int index) { return getSlot(index); } public Object getSlot(int index) { PluginDebug.debug("JSObject.getSlot ", index); return PluginAppletViewer.getSlot(internal, index); } /** * Sets a named member of a JavaScript object. * Equivalent to "this.name = value" in JavaScript. * @param name name of the member * @param value value to best to the named member */ public void setMember(String name, Object value) { PluginDebug.debug("JSObject.setMember ", name, " ", value); PluginAppletViewer.setMember(internal, name, value); } /** * Sets an indexed member of a JavaScript object. * Equivalent to "this[index] = value" in JavaScript. * @param index as in array-like touch in javascript array * @param value value to be set on the index palce */ // public void setMember(int index, Object value) { // setSlot(index, value); // } public void setSlot(int index, Object value) { PluginDebug.debug("JSObject.setSlot ", index, " ", value); PluginAppletViewer.setSlot(internal, index, value); } /** * Removes a named member of a JavaScript object. * @param name name of member of given name */ public void removeMember(String name) { PluginDebug.debug("JSObject.removeMember ", name); PluginAppletViewer.removeMember(internal, name); } /** * Calls a JavaScript method. * Equivalent to "this.methodName(args[0], args[1], ...)" in JavaScript. * @param methodName - name of the method to be called * @param args parameters for method * @return result of method call */ public Object call(String methodName, Object args[]) { if (args == null) args = new Object[0]; PluginDebug.debug("JSObject.call ", methodName); for (Object arg : args) { PluginDebug.debug(" ", arg); } PluginDebug.debug(""); return PluginAppletViewer.call(internal, methodName, args); } /** * Evaluates a JavaScript expression. The expression is a string * of JavaScript source code which will be evaluated in the context * given by "this". * @param s expression to be evaluated * @return result of evaluation */ public Object eval(String s) { PluginDebug.debug("JSObject.eval ", s); return PluginAppletViewer.eval(internal, s); } /** * Converts a JSObject to a String. * @return string representation of this object */ @Override public String toString() { PluginDebug.debug("JSObject.toString"); return PluginAppletViewer.javascriptToString(internal); } // should use some sort of identifier rather than String // is "property" the right word? // native String[] listProperties(); /** * get a JSObject for the window containing the given applet * @param applet applet which will be searched for window * @return the JSObject representing window of applet */ public static JSObject getWindow(Applet applet) { PluginDebug.debug("JSObject.getWindow"); // FIXME: handle long case as well. long internal = ((PluginAppletViewer) applet.getAppletContext()).getWindow(); PluginDebug.debug("GOT IT: ", internal); return new JSObject(internal); } /** * Finalization decrements the reference count on the corresponding * JavaScript object. */ @Override protected void finalize() { // Proceed if this is a valid object (0L == default long == invalid) if (internal == 0L) return; PluginDebug.debug("JSObject.finalize "); PluginAppletViewer.JavaScriptFinalize(internal); } } icedtea-web-1.6.2/plugin/icedteanp/java/netscape/javascript/PaxHeaders.17941/JSException.java0000644000000000000000000000013212654402377026626 xustar0030 mtime=1454507263.219432821 30 atime=1454507327.172579897 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/icedteanp/java/netscape/javascript/JSException.java0000644000175000002070000001220512654402377027351 0ustar00jvanekmock00000000000000/* -*- Mode: Java; tab-width: 8; c-basic-offset: 4 -*- * * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is Mozilla Communicator client code, released * March 31, 1998. * * The Initial Developer of the Original Code is * Netscape Communications Corporation. * Portions created by the Initial Developer are Copyright (C) 1998 * the Initial Developer. All Rights Reserved. * * Contributor(s): * * Alternatively, the contents of this file may be used under the terms of * either of the GNU General Public License Version 2 or later (the "GPL"), * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ package netscape.javascript; /** * JSException is an exception which is thrown when JavaScript code * returns an error. */ public class JSException extends RuntimeException { public static final int EXCEPTION_TYPE_EMPTY = -1; public static final int EXCEPTION_TYPE_VOID = 0; public static final int EXCEPTION_TYPE_OBJECT = 1; public static final int EXCEPTION_TYPE_FUNCTION = 2; public static final int EXCEPTION_TYPE_STRING = 3; public static final int EXCEPTION_TYPE_NUMBER = 4; public static final int EXCEPTION_TYPE_BOOLEAN = 5; public static final int EXCEPTION_TYPE_ERROR = 6; public String filename; public int lineno; public String source; public int tokenIndex; public int wrappedExceptionType; public Object wrappedException; /** * Constructs a JSException without a detail message. * A detail message is a String that describes this particular exception. * * @deprecated Not for public use in future versions. */ @Deprecated public JSException() { super(); filename = "unknown"; lineno = 0; source = ""; tokenIndex = 0; wrappedExceptionType = EXCEPTION_TYPE_EMPTY; } /** * Constructs a JSException with a detail message. * A detail message is a String that describes this particular exception. * @param s the detail message * * @deprecated Not for public use in future versions. */ @Deprecated public JSException(String s) { super(s); filename = "unknown"; lineno = 0; source = ""; tokenIndex = 0; wrappedExceptionType = EXCEPTION_TYPE_EMPTY; } /** * Constructs a JSException with a wrapped JavaScript exception object. * This constructor needs to be public so that Java users can throw * exceptions to JS cleanly. * @param wrappedExceptionType type of exception * @param wrappedException actual exception */ public JSException(int wrappedExceptionType, Object wrappedException) { super(); this.wrappedExceptionType = wrappedExceptionType; this.wrappedException = wrappedException; } /** * Constructs a JSException with a detail message and all the * other info that usually comes with a JavaScript error. * @param s the detail message * @param filename source file where exception raised * @param lineno line where exception raised * @param source source text of exception * @param tokenIndex index on line where exception raised * * @deprecated Not for public use in future versions. */ @Deprecated public JSException(String s, String filename, int lineno, String source, int tokenIndex) { super(s); this.filename = filename; this.lineno = lineno; this.source = source; this.tokenIndex = tokenIndex; wrappedExceptionType = EXCEPTION_TYPE_EMPTY; } /** * Instance method getWrappedExceptionType returns the int mapping of the * type of the wrappedException Object. * @return type of exception */ public int getWrappedExceptionType() { return wrappedExceptionType; } /** * Instance method getWrappedException. * @return actual exception */ public Object getWrappedException() { return wrappedException; } } icedtea-web-1.6.2/plugin/icedteanp/PaxHeaders.17941/IcedTeaScriptablePluginObject.h0000644000000000000000000000013212654402377024665 xustar0030 mtime=1454507263.219432821 30 atime=1454507327.172579897 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/icedteanp/IcedTeaScriptablePluginObject.h0000644000175000002070000001673112654402377025420 0ustar00jvanekmock00000000000000/* IcedTeaScriptablePluginObject.h Copyright (C) 2009, 2010 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #ifndef __ICEDTEASCRIPTABLEPLUGINOBJECT_H_ #define __ICEDTEASCRIPTABLEPLUGINOBJECT_H_ #include #include #include "IcedTeaJavaRequestProcessor.h" #include "IcedTeaNPPlugin.h" /** * IcedTeaScriptablePluginObject, an extended NPObject that implements * static functions whose pointers are supplied to NPClass. */ class IcedTeaScriptablePluginObject: public NPObject { private: NPP instance; public: IcedTeaScriptablePluginObject(NPP instance); static void deAllocate(NPObject *npobj); static void invalidate(NPObject *npobj); static bool hasMethod(NPObject *npobj, NPIdentifier name_id); static bool invoke(NPObject *npobj, NPIdentifier name_id, const NPVariant *args, uint32_t argCount, NPVariant *result); static bool invokeDefault(NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result); static bool hasProperty(NPObject *npobj, NPIdentifier name_id); static bool getProperty(NPObject *npobj, NPIdentifier name_id, NPVariant *result); static bool setProperty(NPObject *npobj, NPIdentifier name_id, const NPVariant *value); static bool removeProperty(NPObject *npobj, NPIdentifier name_id); static bool enumerate(NPObject *npobj, NPIdentifier **value, uint32_t *count); static bool construct(NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result); }; NPObject* allocate_scriptable_jp_object(NPP npp, NPClass *aClass); class IcedTeaScriptableJavaPackageObject: public NPObject { private: NPP instance; std::string* package_name; public: IcedTeaScriptableJavaPackageObject(NPP instance); ~IcedTeaScriptableJavaPackageObject(); void setPackageName(const NPUTF8* name); std::string getPackageName(); static void deAllocate(NPObject *npobj); static void invalidate(NPObject *npobj); static bool hasMethod(NPObject *npobj, NPIdentifier name_id); static bool invoke(NPObject *npobj, NPIdentifier name_id, const NPVariant *args, uint32_t argCount, NPVariant *result); static bool invokeDefault(NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result); static bool hasProperty(NPObject *npobj, NPIdentifier name_id); static bool getProperty(NPObject *npobj, NPIdentifier name_id, NPVariant *result); static bool setProperty(NPObject *npobj, NPIdentifier name_id, const NPVariant *value); static bool removeProperty(NPObject *npobj, NPIdentifier name_id); static bool enumerate(NPObject *npobj, NPIdentifier **value, uint32_t *count); static bool construct(NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result); static NPObject* get_scriptable_java_package_object(NPP instance, const NPUTF8* name); static bool is_valid_java_object(NPObject* object_ptr); }; class IcedTeaScriptableJavaObject: public NPObject { private: NPP instance; bool is_object_array; /* These may be empty if 'is_applet_instance' is true * and the object has not yet been used */ std::string class_id, instance_id; public: IcedTeaScriptableJavaObject(NPP instance) { this->instance = instance; is_object_array = false; } static void deAllocate(NPObject *npobj) { delete (IcedTeaScriptableJavaObject*)npobj; } std::string getInstanceID() { return instance_id; } std::string getClassID() { return class_id; } std::string objectKey() { return getClassID() + ":" + getInstanceID(); } static void invalidate(NPObject *npobj) { IcedTeaPluginUtilities::removeInstanceID(npobj); IcedTeaScriptableJavaObject* scriptable_object = (IcedTeaScriptableJavaObject*) npobj; IcedTeaPluginUtilities::removeObjectMapping(scriptable_object->objectKey()); } static bool hasMethod(NPObject *npobj, NPIdentifier name_id); static bool invoke(NPObject *npobj, NPIdentifier name_id, const NPVariant *args, uint32_t argCount, NPVariant *result); static bool invokeDefault(NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result) { PLUGIN_ERROR ("** Unimplemented: IcedTeaScriptableJavaObject::invokeDefault %p\n", npobj); return false; } static bool hasProperty(NPObject *npobj, NPIdentifier name_id); static bool getProperty(NPObject *npobj, NPIdentifier name_id, NPVariant *result); static bool setProperty(NPObject *npobj, NPIdentifier name_id, const NPVariant *value); static bool removeProperty(NPObject *npobj, NPIdentifier name_id) { PLUGIN_ERROR ("** Unimplemented: IcedTeaScriptableJavaObject::removeProperty %p\n", npobj); return false; } static bool enumerate(NPObject *npobj, NPIdentifier **value, uint32_t *count) { PLUGIN_ERROR ("** Unimplemented: IcedTeaScriptableJavaObject::enumerate %p\n", npobj); return false; } static bool construct(NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result); /* Creates and retains a scriptable java object (intended to be called asynch.) */ static NPObject* get_scriptable_java_object(NPP instance, std::string class_id, std::string instance_id, bool isArray); }; /* Creates and retains a scriptable java object (intended to be called asynch.) */ void _createAndRetainJavaObject(void* data); #endif /* __ICEDTEASCRIPTABLEPLUGINOBJECT_H_ */ icedtea-web-1.6.2/plugin/icedteanp/PaxHeaders.17941/IcedTeaScriptablePluginObject.cc0000644000000000000000000000013212654402377025023 xustar0030 mtime=1454507263.218432834 30 atime=1454507327.172579897 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/icedteanp/IcedTeaScriptablePluginObject.cc0000644000175000002070000007026212654402377025555 0ustar00jvanekmock00000000000000/* IcedTeaScriptablePluginObject.cc Copyright (C) 2009, 2010 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #include #include "IcedTeaScriptablePluginObject.h" IcedTeaScriptablePluginObject::IcedTeaScriptablePluginObject(NPP instance) { this->instance = instance; IcedTeaPluginUtilities::storeInstanceID(this, instance); } void IcedTeaScriptablePluginObject::deAllocate(NPObject *npobj) { PLUGIN_ERROR ("** Unimplemented: IcedTeaScriptablePluginObject::deAllocate %p\n", npobj); } void IcedTeaScriptablePluginObject::invalidate(NPObject *npobj) { PLUGIN_ERROR ("** Unimplemented: IcedTeaScriptablePluginObject::invalidate %p\n", npobj); } bool IcedTeaScriptablePluginObject::hasMethod(NPObject *npobj, NPIdentifier name_id) { PLUGIN_ERROR ("** Unimplemented: IcedTeaScriptablePluginObject::hasMethod %p\n", npobj); return false; } bool IcedTeaScriptablePluginObject::invoke(NPObject *npobj, NPIdentifier name_id, const NPVariant *args, uint32_t argCount,NPVariant *result) { PLUGIN_ERROR ("** Unimplemented: IcedTeaScriptablePluginObject::invoke %p\n", npobj); return false; } bool IcedTeaScriptablePluginObject::invokeDefault(NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result) { PLUGIN_ERROR ("** Unimplemented: IcedTeaScriptablePluginObject::invokeDefault %p\n", npobj); return false; } bool IcedTeaScriptablePluginObject::hasProperty(NPObject *npobj, NPIdentifier name_id) { PLUGIN_ERROR ("** Unimplemented: IcedTeaScriptablePluginObject::hasProperty %p\n", npobj); return false; } bool IcedTeaScriptablePluginObject::getProperty(NPObject *npobj, NPIdentifier name_id, NPVariant *result) { // Package request? if (IcedTeaPluginUtilities::NPIdentifierAsString(name_id) == "java") { //NPObject* obj = IcedTeaScriptableJavaPackageObject::get_scriptable_java_package_object(getInstanceFromMemberPtr(npobj), name); //OBJECT_TO_NPVARIANT(obj, *result); //PLUGIN_ERROR ("Filling variant %p with object %p\n", result); } return false; } bool IcedTeaScriptablePluginObject::setProperty(NPObject *npobj, NPIdentifier name_id, const NPVariant *value) { PLUGIN_ERROR ("** Unimplemented: IcedTeaScriptablePluginObject::setProperty %p\n", npobj); return false; } bool IcedTeaScriptablePluginObject::removeProperty(NPObject *npobj, NPIdentifier name_id) { PLUGIN_ERROR ("** Unimplemented: IcedTeaScriptablePluginObject::removeProperty %p\n", npobj); return false; } bool IcedTeaScriptablePluginObject::enumerate(NPObject *npobj, NPIdentifier **value, uint32_t *count) { PLUGIN_ERROR ("** Unimplemented: IcedTeaScriptablePluginObject::enumerate %p\n", npobj); return false; } bool IcedTeaScriptablePluginObject::construct(NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result) { PLUGIN_ERROR ("** Unimplemented: IcedTeaScriptablePluginObject::construct %p\n", npobj); return false; } NPObject* allocate_scriptable_jp_object(NPP npp, NPClass *aClass) { PLUGIN_DEBUG("Allocating new scriptable Java Package object\n"); return new IcedTeaScriptableJavaPackageObject(npp); } static NPClass scriptable_plugin_object_class() { NPClass np_class; np_class.structVersion = NP_CLASS_STRUCT_VERSION; np_class.allocate = allocate_scriptable_jp_object; np_class.deallocate = IcedTeaScriptableJavaPackageObject::deAllocate; np_class.invalidate = IcedTeaScriptableJavaPackageObject::invalidate; np_class.hasMethod = IcedTeaScriptableJavaPackageObject::hasMethod; np_class.invoke = IcedTeaScriptableJavaPackageObject::invoke; np_class.invokeDefault = IcedTeaScriptableJavaPackageObject::invokeDefault; np_class.hasProperty = IcedTeaScriptableJavaPackageObject::hasProperty; np_class.getProperty = IcedTeaScriptableJavaPackageObject::getProperty; np_class.setProperty = IcedTeaScriptableJavaPackageObject::setProperty; np_class.removeProperty = IcedTeaScriptableJavaPackageObject::removeProperty; np_class.enumerate = IcedTeaScriptableJavaPackageObject::enumerate; np_class.construct = IcedTeaScriptableJavaPackageObject::construct; return np_class; } NPObject* IcedTeaScriptableJavaPackageObject::get_scriptable_java_package_object(NPP instance, const NPUTF8* name) { /* Shared NPClass instance for IcedTeaScriptablePluginObject */ static NPClass np_class = scriptable_plugin_object_class(); NPObject* scriptable_object = browser_functions.createobject(instance, &np_class); PLUGIN_DEBUG("Returning new scriptable package class: %p from instance %p with name %s\n", scriptable_object, instance, name); ((IcedTeaScriptableJavaPackageObject*) scriptable_object)->setPackageName(name); IcedTeaPluginUtilities::storeInstanceID(scriptable_object, instance); return scriptable_object; } IcedTeaScriptableJavaPackageObject::IcedTeaScriptableJavaPackageObject(NPP instance) { PLUGIN_DEBUG("Constructing new scriptable java package object\n"); this->instance = instance; this->package_name = new std::string(); } IcedTeaScriptableJavaPackageObject::~IcedTeaScriptableJavaPackageObject() { delete this->package_name; } void IcedTeaScriptableJavaPackageObject::setPackageName(const NPUTF8* name) { this->package_name->assign(name); } std::string IcedTeaScriptableJavaPackageObject::getPackageName() { return *this->package_name; } void IcedTeaScriptableJavaPackageObject::deAllocate(NPObject *npobj) { delete (IcedTeaScriptableJavaPackageObject*)npobj; } void IcedTeaScriptableJavaPackageObject::invalidate(NPObject *npobj) { // nothing to do for these } bool IcedTeaScriptableJavaPackageObject::hasMethod(NPObject *npobj, NPIdentifier name_id) { // Silly caller. Methods are for objects! return false; } bool IcedTeaScriptableJavaPackageObject::invoke(NPObject *npobj, NPIdentifier name_id, const NPVariant *args, uint32_t argCount,NPVariant *result) { PLUGIN_ERROR ("** Unimplemented: IcedTeaScriptableJavaPackageObject::invoke %p\n", npobj); return false; } bool IcedTeaScriptableJavaPackageObject::invokeDefault(NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result) { PLUGIN_ERROR ("** Unimplemented: IcedTeaScriptableJavaPackageObject::invokeDefault %p\n", npobj); return false; } bool IcedTeaScriptableJavaPackageObject::hasProperty(NPObject *npobj, NPIdentifier name_id) { std::string name = IcedTeaPluginUtilities::NPIdentifierAsString(name_id); PLUGIN_DEBUG("IcedTeaScriptableJavaPackageObject::hasProperty %s\n", name.c_str()); bool hasProperty = false; JavaResultData* java_result; JavaRequestProcessor* java_request = new JavaRequestProcessor(); NPP instance = IcedTeaPluginUtilities::getInstanceFromMemberPtr(npobj); int plugin_instance_id = get_id_from_instance(instance); IcedTeaScriptableJavaPackageObject* scriptable_obj = (IcedTeaScriptableJavaPackageObject*)npobj; PLUGIN_DEBUG("Object package name: \"%s\"\n", scriptable_obj->getPackageName().c_str()); // "^java" is always a package if (scriptable_obj->getPackageName().empty() && (name == "java" || name == "javax")) { return true; } std::string property_name = scriptable_obj->getPackageName(); if (!property_name.empty()) property_name += "."; property_name += name; PLUGIN_DEBUG("Looking for name \"%s\"\n", property_name.c_str()); java_result = java_request->hasPackage(plugin_instance_id, property_name); if (!java_result->error_occurred && java_result->return_identifier != 0) hasProperty = true; // No such package. Do we have a class with that name? if (!hasProperty) { java_result = java_request->findClass(plugin_instance_id, property_name); } if (java_result->return_identifier != 0) hasProperty = true; delete java_request; return hasProperty; } bool IcedTeaScriptableJavaPackageObject::getProperty(NPObject *npobj, NPIdentifier name_id, NPVariant *result) { std::string name = IcedTeaPluginUtilities::NPIdentifierAsString(name_id); PLUGIN_DEBUG("IcedTeaScriptableJavaPackageObject::getProperty %s\n", name.c_str()); if (!browser_functions.identifierisstring(name_id)) return false; bool isPropertyClass = false; JavaResultData* java_result; JavaRequestProcessor java_request = JavaRequestProcessor(); NPP instance = IcedTeaPluginUtilities::getInstanceFromMemberPtr(npobj); int plugin_instance_id = get_id_from_instance(instance); IcedTeaScriptableJavaPackageObject* scriptable_obj = (IcedTeaScriptableJavaPackageObject*)npobj; std::string property_name = scriptable_obj->getPackageName(); if (!property_name.empty()) property_name += "."; property_name += name; java_result = java_request.findClass(plugin_instance_id, property_name); isPropertyClass = (java_result->return_identifier == 0); //NPIdentifier property = browser_functions.getstringidentifier(property_name.c_str()); NPObject* obj; if (isPropertyClass) { PLUGIN_DEBUG("Returning package object\n"); obj = IcedTeaScriptableJavaPackageObject::get_scriptable_java_package_object( IcedTeaPluginUtilities::getInstanceFromMemberPtr(npobj), property_name.c_str()); } else { PLUGIN_DEBUG("Returning Java object\n"); obj = IcedTeaScriptableJavaObject::get_scriptable_java_object( IcedTeaPluginUtilities::getInstanceFromMemberPtr(npobj), *(java_result->return_string), "0", false); } OBJECT_TO_NPVARIANT(obj, *result); return true; } bool IcedTeaScriptableJavaPackageObject::setProperty(NPObject *npobj, NPIdentifier name_id, const NPVariant *value) { // Can't be going around setting properties on namespaces.. that's madness! return false; } bool IcedTeaScriptableJavaPackageObject::removeProperty(NPObject *npobj, NPIdentifier name_id) { PLUGIN_ERROR ("** Unimplemented: IcedTeaScriptableJavaPackageObject::removeProperty %p\n", npobj); return false; } bool IcedTeaScriptableJavaPackageObject::enumerate(NPObject *npobj, NPIdentifier **value, uint32_t *count) { PLUGIN_ERROR ("** Unimplemented: IcedTeaScriptableJavaPackageObject::enumerate %p\n", npobj); return false; } bool IcedTeaScriptableJavaPackageObject::construct(NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result) { PLUGIN_ERROR ("** Unimplemented: IcedTeaScriptableJavaPackageObject::construct %p\n", npobj); return false; } NPObject* allocate_scriptable_java_object(NPP npp, NPClass *aClass) { PLUGIN_DEBUG("Allocating new scriptable Java object\n"); return new IcedTeaScriptableJavaObject(npp); } static NPClass scriptable_java_package_object_class() { NPClass np_class; np_class.structVersion = NP_CLASS_STRUCT_VERSION; np_class.allocate = allocate_scriptable_java_object; np_class.deallocate = IcedTeaScriptableJavaObject::deAllocate; np_class.invalidate = IcedTeaScriptableJavaObject::invalidate; np_class.hasMethod = IcedTeaScriptableJavaObject::hasMethod; np_class.invoke = IcedTeaScriptableJavaObject::invoke; np_class.invokeDefault = IcedTeaScriptableJavaObject::invokeDefault; np_class.hasProperty = IcedTeaScriptableJavaObject::hasProperty; np_class.getProperty = IcedTeaScriptableJavaObject::getProperty; np_class.setProperty = IcedTeaScriptableJavaObject::setProperty; np_class.removeProperty = IcedTeaScriptableJavaObject::removeProperty; np_class.enumerate = IcedTeaScriptableJavaObject::enumerate; np_class.construct = IcedTeaScriptableJavaObject::construct; return np_class; } NPObject* IcedTeaScriptableJavaObject::get_scriptable_java_object(NPP instance, std::string class_id, std::string instance_id, bool isArray) { /* Shared NPClass instance for IcedTeaScriptablePluginObject */ static NPClass np_class = scriptable_java_package_object_class(); std::string obj_key = class_id + ":" + instance_id; PLUGIN_DEBUG("get_scriptable_java_object searching for %s...\n", obj_key.c_str()); IcedTeaScriptableJavaObject* scriptable_object = (IcedTeaScriptableJavaObject*) IcedTeaPluginUtilities::getNPObjectFromJavaKey(obj_key); if (scriptable_object != NULL) { PLUGIN_DEBUG("Returning existing object %p\n", scriptable_object); browser_functions.retainobject(scriptable_object); return scriptable_object; } // try to create normally scriptable_object = (IcedTeaScriptableJavaObject*)browser_functions.createobject(instance, &np_class); // didn't work? try creating asynch if (!scriptable_object) { AsyncCallThreadData thread_data = AsyncCallThreadData(); thread_data.result_ready = false; thread_data.parameters = std::vector(); thread_data.result = std::string(); thread_data.parameters.push_back(instance); thread_data.parameters.push_back(&np_class); thread_data.parameters.push_back(&scriptable_object); IcedTeaPluginUtilities::callAndWaitForResult(instance, &_createAndRetainJavaObject, &thread_data); } else { // Else retain object and continue browser_functions.retainobject(scriptable_object); } PLUGIN_DEBUG("Constructed new Java Object with classid=%s, instanceid=%s, isArray=%d and scriptable_object=%p\n", class_id.c_str(), instance_id.c_str(), isArray, scriptable_object); scriptable_object->class_id = class_id; scriptable_object->is_object_array = isArray; if (instance_id != "0") scriptable_object->instance_id = instance_id; IcedTeaPluginUtilities::storeInstanceID(scriptable_object, instance); IcedTeaPluginUtilities::storeObjectMapping(obj_key, scriptable_object); PLUGIN_DEBUG("Inserting into object_map key %s->%p\n", obj_key.c_str(), scriptable_object); return scriptable_object; } /* Creates and retains a scriptable java object (intended to be called asynch.) */ void _createAndRetainJavaObject(void* data) { PLUGIN_DEBUG("Asynchronously creating/retaining object ...\n"); std::vector parameters = ((AsyncCallThreadData*) data)->parameters; NPP instance = (NPP) parameters.at(0); NPClass* np_class = (NPClass*) parameters.at(1); NPObject** scriptable_object = (NPObject**) parameters.at(2); *scriptable_object = browser_functions.createobject(instance, np_class); browser_functions.retainobject(*scriptable_object); ((AsyncCallThreadData*) data)->result_ready = true; } bool IcedTeaScriptableJavaPackageObject::is_valid_java_object(NPObject* object_ptr) { return IcedTeaPluginUtilities::getInstanceFromMemberPtr(object_ptr) != NULL; } bool IcedTeaScriptableJavaObject::hasMethod(NPObject *npobj, NPIdentifier name_id) { std::string name = IcedTeaPluginUtilities::NPIdentifierAsString(name_id); IcedTeaScriptableJavaObject* scriptable_object = (IcedTeaScriptableJavaObject*) npobj; PLUGIN_DEBUG("IcedTeaScriptableJavaObject::hasMethod %s (ival=%d)\n", name.c_str(), browser_functions.intfromidentifier(name_id)); bool hasMethod = false; // If object is an array and requested "method" may be a number, check for it first if ( !scriptable_object->is_object_array || (browser_functions.intfromidentifier(name_id) < 0)) { if (!browser_functions.identifierisstring(name_id)) return false; JavaResultData* java_result; JavaRequestProcessor java_request = JavaRequestProcessor(); java_result = java_request.hasMethod(scriptable_object->class_id, name); hasMethod = java_result->return_identifier != 0; } PLUGIN_DEBUG("IcedTeaScriptableJavaObject::hasMethod returning %d\n", hasMethod); return hasMethod; } bool IcedTeaScriptableJavaObject::invoke(NPObject *npobj, NPIdentifier name_id, const NPVariant *args, uint32_t argCount, NPVariant *result) { std::string name = IcedTeaPluginUtilities::NPIdentifierAsString(name_id); // Extract arg type array PLUGIN_DEBUG("IcedTeaScriptableJavaObject::invoke %s. Args follow.\n", name.c_str()); for (int i=0; i < argCount; i++) { IcedTeaPluginUtilities::printNPVariant(args[i]); } JavaResultData* java_result; JavaRequestProcessor java_request = JavaRequestProcessor(); IcedTeaScriptableJavaObject* scriptable_object = (IcedTeaScriptableJavaObject*)npobj; std::string instance_id = scriptable_object->instance_id; std::string class_id = scriptable_object->class_id; NPP instance = IcedTeaPluginUtilities::getInstanceFromMemberPtr(npobj); // First, load the arguments into the java-side table std::string id = std::string(); std::vector arg_ids = std::vector(); for (int i=0; i < argCount; i++) { id.clear(); createJavaObjectFromVariant(instance, args[i], &id); if (id == "-1") { PLUGIN_ERROR("Unable to create arguments on Java side\n"); return false; } arg_ids.push_back(id); } if (instance_id.length() == 0) // Static { PLUGIN_DEBUG("Calling static method\n"); java_result = java_request.callStaticMethod( IcedTeaPluginUtilities::getSourceFromInstance(instance), scriptable_object->class_id, name, arg_ids); } else { PLUGIN_DEBUG("Calling method normally\n"); java_result = java_request.callMethod( IcedTeaPluginUtilities::getSourceFromInstance(instance), scriptable_object->instance_id, name, arg_ids); } if (java_result->error_occurred) { browser_functions.setexception(npobj, java_result->error_msg->c_str()); return false; } PLUGIN_DEBUG("IcedTeaScriptableJavaObject::invoke converting and returning.\n"); return IcedTeaPluginUtilities::javaResultToNPVariant(instance, java_result->return_string, result); } bool IcedTeaScriptableJavaObject::hasProperty(NPObject *npobj, NPIdentifier name_id) { std::string name = IcedTeaPluginUtilities::NPIdentifierAsString(name_id); PLUGIN_DEBUG("IcedTeaScriptableJavaObject::hasProperty %s (ival=%d)\n", name.c_str(), browser_functions.intfromidentifier(name_id)); bool hasProperty = false; IcedTeaScriptableJavaObject* scriptable_object = (IcedTeaScriptableJavaObject*)npobj; // If it is an array, only length and indexes are valid if (scriptable_object->is_object_array) { if (browser_functions.intfromidentifier(name_id) >= 0 || name == "length") hasProperty = true; } else { if (!browser_functions.identifierisstring(name_id)) return false; if (name == "Packages") { hasProperty = true; } else { JavaResultData* java_result; JavaRequestProcessor java_request = JavaRequestProcessor(); java_result = java_request.hasField(scriptable_object->class_id, name); hasProperty = java_result->return_identifier != 0; } } PLUGIN_DEBUG("IcedTeaScriptableJavaObject::hasProperty returning %d\n", hasProperty); return hasProperty; } bool IcedTeaScriptableJavaObject::getProperty(NPObject *npobj, NPIdentifier name_id, NPVariant *result) { std::string name = IcedTeaPluginUtilities::NPIdentifierAsString(name_id); bool is_string_id = browser_functions.identifierisstring(name_id); PLUGIN_DEBUG("IcedTeaScriptableJavaObject::getProperty %s (ival=%d)\n", name.c_str(), browser_functions.intfromidentifier(name_id)); JavaResultData* java_result; JavaRequestProcessor java_request = JavaRequestProcessor(); IcedTeaScriptableJavaObject* scriptable_object = (IcedTeaScriptableJavaObject*)npobj; std::string instance_id = scriptable_object->getInstanceID(); std::string class_id = scriptable_object->getClassID(); NPP instance = scriptable_object->instance; if (instance_id.length() > 0) // Could be an array or a simple object { // If array and requesting length if ( scriptable_object->is_object_array && name == "length") { java_result = java_request.getArrayLength(instance_id); } else if ( scriptable_object->is_object_array && browser_functions.intfromidentifier(name_id) >= 0) // else if array and requesting index { java_result = java_request.getArrayLength(instance_id); if (java_result->error_occurred) { PLUGIN_ERROR("ERROR: Couldn't fetch array length\n"); return false; } int length = atoi(java_result->return_string->c_str()); // Access beyond size? if (browser_functions.intfromidentifier(name_id) >= length) { VOID_TO_NPVARIANT(*result); return true; } std::string index = std::string(); IcedTeaPluginUtilities::itoa(browser_functions.intfromidentifier(name_id), &index); java_result = java_request.getSlot(instance_id, index); } else // Everything else { if (!is_string_id) { return false; } if (name == "Packages") { NPObject* pkgObject = IcedTeaScriptableJavaPackageObject::get_scriptable_java_package_object(instance, ""); OBJECT_TO_NPVARIANT(pkgObject, *result); return true; } java_result = java_request.getField( IcedTeaPluginUtilities::getSourceFromInstance(instance), class_id, instance_id, name); } } else { if (!is_string_id) { return false; } java_result = java_request.getStaticField( IcedTeaPluginUtilities::getSourceFromInstance(instance), class_id, name); } if (java_result->error_occurred) { return false; } PLUGIN_DEBUG("IcedTeaScriptableJavaObject::getProperty converting and returning.\n"); return IcedTeaPluginUtilities::javaResultToNPVariant(instance, java_result->return_string, result); } bool IcedTeaScriptableJavaObject::setProperty(NPObject *npobj, NPIdentifier name_id, const NPVariant *value) { std::string name = IcedTeaPluginUtilities::NPIdentifierAsString(name_id); PLUGIN_DEBUG("IcedTeaScriptableJavaObject::setProperty %s (ival=%d) to:\n", name.c_str(), browser_functions.intfromidentifier(name_id)); IcedTeaPluginUtilities::printNPVariant(*value); JavaResultData* java_result; JavaRequestProcessor java_request = JavaRequestProcessor(); IcedTeaScriptableJavaObject* scriptable_object = (IcedTeaScriptableJavaObject*)npobj; std::string instance_id = scriptable_object->getInstanceID(); std::string class_id = scriptable_object->getClassID(); NPP instance = IcedTeaPluginUtilities::getInstanceFromMemberPtr(npobj); if (instance_id.length() > 0) // Could be an array or a simple object { // If array if (scriptable_object->is_object_array && name == "length") { PLUGIN_ERROR("ERROR: Array length is not a modifiable property\n"); return false; } else if ( scriptable_object->is_object_array && browser_functions.intfromidentifier(name_id) >= 0) // else if array and requesting index { java_result = java_request.getArrayLength(instance_id); if (java_result->error_occurred) { PLUGIN_ERROR("ERROR: Couldn't fetch array length\n"); return false; } int length = atoi(java_result->return_string->c_str()); // Access beyond size? if (browser_functions.intfromidentifier(name_id) >= length) { return true; } std::string index = std::string(); IcedTeaPluginUtilities::itoa(browser_functions.intfromidentifier(name_id), &index); std::string value_id = std::string(); createJavaObjectFromVariant(instance, *value, &value_id); java_result = java_request.setSlot(instance_id, index, value_id); } else // Everything else { std::string value_id = std::string(); createJavaObjectFromVariant(instance, *value, &value_id); java_result = java_request.setField( IcedTeaPluginUtilities::getSourceFromInstance(instance), class_id, instance_id, name, value_id); } } else { std::string value_id = std::string(); createJavaObjectFromVariant(instance, *value, &value_id); java_result = java_request.setStaticField( IcedTeaPluginUtilities::getSourceFromInstance(instance), class_id, name, value_id); } if (java_result->error_occurred) { return false; } PLUGIN_DEBUG("IcedTeaScriptableJavaObject::setProperty returning.\n"); return true; } bool IcedTeaScriptableJavaObject::construct(NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result) { IcedTeaScriptableJavaObject* scriptable_object = (IcedTeaScriptableJavaObject*)npobj; // Extract arg type array PLUGIN_DEBUG("IcedTeaScriptableJavaObject::construct %s. Args follow.\n", scriptable_object->getClassID().c_str()); for (int i=0; i < argCount; i++) { IcedTeaPluginUtilities::printNPVariant(args[i]); } JavaResultData* java_result; JavaRequestProcessor java_request = JavaRequestProcessor(); NPP instance = IcedTeaPluginUtilities::getInstanceFromMemberPtr(npobj); // First, load the arguments into the java-side table std::string id = std::string(); std::vector arg_ids = std::vector(); for (int i=0; i < argCount; i++) { id.clear(); createJavaObjectFromVariant(instance, args[i], &id); if (id == "0") { browser_functions.setexception(npobj, "Unable to create argument on Java side"); return false; } arg_ids.push_back(id); } java_result = java_request.newObject( IcedTeaPluginUtilities::getSourceFromInstance(instance), scriptable_object->class_id, arg_ids); if (java_result->error_occurred) { browser_functions.setexception(npobj, java_result->error_msg->c_str()); return false; } std::string return_obj_instance_id = *java_result->return_string; std::string return_obj_class_id = scriptable_object->class_id; NPObject* obj = IcedTeaScriptableJavaObject::get_scriptable_java_object( IcedTeaPluginUtilities::getInstanceFromMemberPtr(npobj), return_obj_class_id, return_obj_instance_id, false); OBJECT_TO_NPVARIANT(obj, *result); PLUGIN_DEBUG("IcedTeaScriptableJavaObject::construct returning.\n"); return true; } icedtea-web-1.6.2/plugin/icedteanp/PaxHeaders.17941/IcedTeaPluginUtils.h0000644000000000000000000000013212654402377022546 xustar0030 mtime=1454507263.217432848 30 atime=1454507327.172579897 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/icedteanp/IcedTeaPluginUtils.h0000644000175000002070000004655512654402377023310 0ustar00jvanekmock00000000000000/* IcedTeaPluginUtils.h Copyright (C) 2009, 2010 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ /** * Utility classes for the IcedTeaPlugin */ #ifndef __ICEDTEAPLUGINUTILS_H__ #define __ICEDTEAPLUGINUTILS_H__ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "IcedTeaParseProperties.h" void *flush_pre_init_messages(void* data); void push_pre_init_messages(char * ldm); void reset_pre_init_messages(); // debugging macro. #define initialize_debug() \ do \ { \ if (!debug_initiated) { \ debug_initiated = true; \ plugin_debug = getenv ("ICEDTEAPLUGIN_DEBUG") != NULL || is_debug_on(); \ plugin_debug_headers = is_debug_header_on(); \ plugin_debug_to_file = is_logging_to_file(); \ plugin_debug_to_streams = is_logging_to_stds(); \ plugin_debug_to_system = is_logging_to_system(); \ plugin_debug_to_console = is_java_console_enabled(); \ if (plugin_debug_to_file) { \ IcedTeaPluginUtilities::initFileLog(); \ file_logs_initiated = true; \ } \ if (plugin_debug_to_console) { \ /*initialisation done during jvm startup*/ \ } \ IcedTeaPluginUtilities::printDebugStatus(); \ } \ } while (0) #define HEADER_SIZE 500 #define BODY_SIZE 500 #define MESSAGE_SIZE HEADER_SIZE + BODY_SIZE #define LDEBUG_MESSAGE_SIZE MESSAGE_SIZE+50 //header is destination char array #define CREATE_HEADER(ldebug_header) \ do \ { \ char times[100]; \ time_t t = time(NULL); \ struct tm p; \ localtime_r(&t, &p); \ strftime(times, 100, "%a %b %d %H:%M:%S %Z %Y", &p);\ const char *userNameforDebug = (getenv("USERNAME") == NULL) ? "unknown user" : getenv("USERNAME"); \ /*this message is parsed in JavaConsole*/ \ snprintf(ldebug_header, HEADER_SIZE, "[%s][ITW-C-PLUGIN][MESSAGE_DEBUG][%s][%s:%d] ITNPP Thread# %ld, gthread %p: ", \ userNameforDebug, times, __FILE__, __LINE__, pthread_self(), g_thread_self ()); \ } while (0) #define PLUGIN_DEBUG(...) \ do \ { \ initialize_debug(); \ if (plugin_debug) { \ char ldebug_header[HEADER_SIZE]; \ char ldebug_body[BODY_SIZE]; \ char ldebug_message[MESSAGE_SIZE];\ if (plugin_debug_headers) { \ CREATE_HEADER(ldebug_header); \ } else { \ sprintf(ldebug_header,""); \ } \ snprintf(ldebug_body, BODY_SIZE, __VA_ARGS__); \ if (plugin_debug_to_streams) { \ snprintf(ldebug_message, MESSAGE_SIZE, "%s%s", ldebug_header, ldebug_body); \ fprintf (stdout, "%s", ldebug_message);\ } \ if (plugin_debug_to_file && file_logs_initiated) { \ snprintf(ldebug_message, MESSAGE_SIZE, "%s%s", ldebug_header, ldebug_body); \ fprintf (plugin_file_log, "%s", ldebug_message); \ fflush(plugin_file_log); \ } \ if (plugin_debug_to_console) { \ /*headers are always going to console*/ \ if (!plugin_debug_headers){ \ CREATE_HEADER(ldebug_header); \ } \ snprintf(ldebug_message, MESSAGE_SIZE, "%s%s", ldebug_header, ldebug_body); \ char ldebug_channel_message[LDEBUG_MESSAGE_SIZE]; \ struct timeval current_time; \ gettimeofday (¤t_time, NULL);\ if (jvm_up) { \ snprintf(ldebug_channel_message, LDEBUG_MESSAGE_SIZE, "%s %ld %s", "plugindebug", current_time.tv_sec*1000000L+current_time.tv_usec, ldebug_message); \ push_pre_init_messages(ldebug_channel_message); \ } else { \ snprintf(ldebug_channel_message, LDEBUG_MESSAGE_SIZE, "%s %ld %s", "preinit_plugindebug", current_time.tv_sec*1000000L+current_time.tv_usec, ldebug_message); \ push_pre_init_messages(ldebug_channel_message); \ } \ } \ if (plugin_debug_to_system){ \ /*no debug messages to systemlog*/\ } \ } \ } while (0) #define PLUGIN_ERROR(...) \ do \ { \ initialize_debug(); \ char ldebug_header[HEADER_SIZE]; \ char ldebug_body[BODY_SIZE]; \ char ldebug_message[MESSAGE_SIZE]; \ if (plugin_debug_headers) { \ CREATE_HEADER(ldebug_header); \ } else { \ sprintf(ldebug_header,""); \ } \ snprintf(ldebug_body, BODY_SIZE, __VA_ARGS__); \ if (plugin_debug_to_streams) { \ snprintf(ldebug_message, MESSAGE_SIZE, "%s%s", ldebug_header, ldebug_body); \ fprintf (stderr, "%s", ldebug_message); \ } \ if (plugin_debug_to_file && file_logs_initiated) { \ snprintf(ldebug_message, MESSAGE_SIZE, "%s%s", ldebug_header, ldebug_body); \ fprintf (plugin_file_log, "%s", ldebug_message); \ fflush(plugin_file_log); \ } \ if (plugin_debug_to_console) { \ /*headers are always going to console*/ \ if (!plugin_debug_headers){ \ CREATE_HEADER(ldebug_header); \ } \ snprintf(ldebug_message, MESSAGE_SIZE, "%s%s", ldebug_header, ldebug_body); \ char ldebug_channel_message[LDEBUG_MESSAGE_SIZE]; \ struct timeval current_time; \ gettimeofday (¤t_time, NULL);\ if (jvm_up) { \ snprintf(ldebug_channel_message, LDEBUG_MESSAGE_SIZE, "%s %ld %s", "pluginerror", current_time.tv_sec*1000000L+current_time.tv_usec, ldebug_message); \ push_pre_init_messages(ldebug_channel_message); \ } else { \ snprintf(ldebug_channel_message, LDEBUG_MESSAGE_SIZE, "%s %ld %s", "preinit_pluginerror", current_time.tv_sec*1000000L+current_time.tv_usec, ldebug_message); \ push_pre_init_messages(ldebug_channel_message); \ } \ } \ if (plugin_debug_to_system){ \ /*java can not have prefix*/ \ openlog("", LOG_NDELAY, LOG_USER);\ syslog(LOG_ERR, "%s", "IcedTea-Web c-plugin - for more info see itweb-settings debug options or console. See http://icedtea.classpath.org/wiki/IcedTea-Web#Filing_bugs for help.");\ syslog(LOG_ERR, "%s", "IcedTea-Web c-plugin error manual log:");\ /*no headers to syslog*/ \ syslog(LOG_ERR, "%s", ldebug_body); \ closelog(); \ } \ } while (0) #define CHECK_JAVA_RESULT(result_data) \ { \ if (((JavaResultData*) result_data)->error_occurred) \ { \ PLUGIN_ERROR("Error: Error occurred on Java side: %s.\n", \ ((JavaResultData*) result_data)->error_msg->c_str()); \ return; \ } \ } #define HEX_TO_INT(c) \ ((*c >= 'a') ? *c - 'a' + 10 : \ (*c >= 'A') ? *c - 'A' + 10 : \ *c - '0') #define IS_VALID_HEX(c) \ ((*c >= '0' && *c <= '9') || \ (*c >= 'a' && *c <= 'f') || \ (*c >= 'A' && *c <= 'F')) //long long max ~ 19 chars + terminator //leave some room for converting strings like " = %d" const size_t NUM_STR_BUFFER_SIZE = 32; /* * This struct holds data specific to a Java operation requested by the plugin */ typedef struct java_result_data { // Return identifier (if applicable) int return_identifier; // Return string (if applicable) std::string* return_string; // Return wide/mb string (if applicable) std::wstring* return_wstring; // Error message (if an error occurred) std::string* error_msg; // Boolean indicating if an error occurred bool error_occurred; } JavaResultData; /** * This struct holds data to do calls that need to be run in the plugin thread */ typedef struct plugin_thread_call { // The plugin instance NPP instance; // The function to call void (*func) (void *); // The data to pass to the function void *userData; } PluginThreadCall; /** * Data structure passed to functions called in a new thread. */ typedef struct async_call_thread_data { std::vector parameters; std::string result; bool result_ready; bool call_successful; } AsyncCallThreadData; /* * Misc. utility functions * * This class is never instantiated and should contain static functions only */ /* Function to process all pending async calls */ void processAsyncCallQueue(void*); class IcedTeaPluginUtilities { private: static int reference; /* Reference count */ /* Mutex lock for updating reference count */ static pthread_mutex_t reference_mutex; /* Map holding window pointer<->instance relationships */ static std::map* instance_map; /* Map holding java-side-obj-key->NPObject relationship */ static std::map* object_map; /* Posts a call in the async call queue */ static bool postPluginThreadAsyncCall(NPP instance, void (*func) (void *), void* data); public: /* Constructs message prefix with given context */ static void constructMessagePrefix(int context, std::string* result); /* Constructs message prefix with given context and reference */ static void constructMessagePrefix(int context, int reference, std::string* result); /* Constructs message prefix with given context, reference and src */ static void constructMessagePrefix(int context, int reference, std::string address, std::string* result); /* Converts given pointer to a string representation */ static void JSIDToString(void* id, std::string* result); /* Converts the given string representation to a pointer */ static void* stringToJSID(std::string id_str); static void* stringToJSID(std::string* id_str); /* Increments reference count and returns it */ static int getReference(); /* Decrements reference count */ static void releaseReference(); /* Converts the given integer to a string */ static void itoa(int i, std::string* result); /* Copies a variant data type into a C++ string */ static std::string NPVariantAsString(NPVariant variant); /* This must be freed with browserfunctions.memfree */ static NPString NPStringCopy(const std::string& result); /* This must be freed with browserfunctions.releasevariantvalue */ static NPVariant NPVariantStringCopy(const std::string& result); /* Returns an std::string represented by the given identifier. */ static std::string NPIdentifierAsString(NPIdentifier id); /* Frees the given vector and the strings that its contents point to */ static void freeStringPtrVector(std::vector* v); /* Splits the given string based on the delimiter provided */ static std::vector* strSplit(const char* str, const char* delim); /* Converts given unicode integer byte array to UTF8 string */ static void getUTF8String(int length, int begin, std::vector* unicode_byte_array, std::string* result_unicode_str); /* Converts given UTF8 string to unicode integer byte array */ static void convertStringToUTF8(std::string* str, std::string* utf_str); /* Converts given unicode integer byte array to UTF16LE/UCS-2 string */ static void getUTF16LEString(int length, int begin, std::vector* unicode_byte_array, std::wstring* result_unicode_str); /* Prints contents of given string vector */ static void printStringVector(const char* prefix, std::vector* cv); /* Prints contents of given string pointer vector */ static void printStringPtrVector(const char* prefix, std::vector* cv); static std::string* variantToClassName(NPVariant variant); static void printNPVariant(NPVariant variant); static void NPVariantToString(NPVariant variant, std::string* result); static bool javaResultToNPVariant(NPP instance, std::string* java_result, NPVariant* variant); static const gchar* getSourceFromInstance(NPP instance); static void storeInstanceID(void* member_ptr, NPP instance); static void removeInstanceID(void* member_ptr); /* Clear object_map. Useful for tests. */ static void clearInstanceIDs(); static NPP getInstanceFromMemberPtr(void* member_ptr); static NPObject* getNPObjectFromJavaKey(std::string key); static void storeObjectMapping(std::string key, NPObject* object); static void removeObjectMapping(std::string key); /* Clear object_map. Useful for tests. */ static void clearObjectMapping(); static void invalidateInstance(NPP instance); static bool isObjectJSArray(NPP instance, NPObject* object); static void decodeURL(const char* url, char** decoded_url); /* Returns a vector of gchar* pointing to the elements of the vector string passed in*/ static std::vector vectorStringToVectorGchar(const std::vector* stringVec); /* Posts call in async queue and waits till execution completes */ static void callAndWaitForResult(NPP instance, void (*func) (void *), AsyncCallThreadData* data); /*cutting whitespaces from end and start of string*/ static void trim(std::string& str); /*Unescape various escaped chars like \\ -> \ or \= -> = or \: -> \*/ static void unescape(std::string& str); static bool file_exists(std::string filename); static bool is_directory(std::string filename); //file-loggers helpers static std::string generateLogFileName(); static void initFileLog(); static void printDebugStatus(); static std::string getTmpPath(); static std::string getRuntimePath(); static bool create_dir(std::string); }; /* * A bus subscriber interface. Implementors must implement the newMessageOnBus * method. */ class BusSubscriber { private: public: BusSubscriber() {} /* Notifies this subscriber that a new message as arrived */ virtual bool newMessageOnBus(const char* message) = 0; }; /* * This implementation is very simple and is therefore folded into this file * rather than a new one. */ class JavaMessageSender : public BusSubscriber { private: public: /* Sends given message to Java side */ virtual bool newMessageOnBus(const char* message); }; /* * Represents a message bus. * The bus can also have subscribers who are notified when a new message * arrives. */ class MessageBus { private: /* Mutex for locking the message queue */ pthread_mutex_t msg_queue_mutex; /* Mutex used when adjusting subscriber list */ pthread_mutex_t subscriber_mutex; /* Subscriber list */ std::list subscribers; /* Queued messages */ std::queue msgQueue; public: MessageBus(); ~MessageBus(); /* subscribe to this bus */ void subscribe(BusSubscriber* b); /* unsubscribe from this bus */ void unSubscribe(BusSubscriber* b); /* Post a message on to the bus (it is safe to free the message pointer after this function returns) */ void post(const char* message); }; #endif // __ICEDTEAPLUGINUTILS_H__ icedtea-web-1.6.2/plugin/icedteanp/PaxHeaders.17941/IcedTeaPluginUtils.cc0000644000000000000000000000013212654402377022704 xustar0030 mtime=1454507263.216432861 30 atime=1454507327.172579897 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/icedteanp/IcedTeaPluginUtils.cc0000644000175000002070000011651312654402377023436 0ustar00jvanekmock00000000000000/* IcedTeaPluginUtils.cc Copyright (C) 2009, 2010 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #include "IcedTeaNPPlugin.h" #include "IcedTeaScriptablePluginObject.h" #include "IcedTeaPluginUtils.h" #include /** * Misc. utility functions used by the plugin */ /*********************************************** * Begin IcedTeaPluginUtilities implementation * ************************************************/ // Initialize static variables int IcedTeaPluginUtilities::reference = -1; pthread_mutex_t IcedTeaPluginUtilities::reference_mutex = PTHREAD_MUTEX_INITIALIZER; std::map* IcedTeaPluginUtilities::instance_map = new std::map(); std::map* IcedTeaPluginUtilities::object_map = new std::map(); std::queue pre_jvm_message; /* Plugin async call queue */ static std::vector< PluginThreadCall* >* pendingPluginThreadRequests = new std::vector< PluginThreadCall* >(); bool IcedTeaPluginUtilities::create_dir(std::string dir) { if (file_exists(dir)) { if (!is_directory(dir)) { PLUGIN_ERROR("WARNING: Needed to create directory %s but there is already a file of the same name at this location.\n", dir.c_str()); return false; } PLUGIN_DEBUG("Directory %s already exists\n", dir.c_str()); } else { PLUGIN_DEBUG("Directory %s does not yet exist\n", dir.c_str()); const int PERMISSIONS_MASK = S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH; // 0755 bool created_directory = (g_mkdir(dir.c_str(), PERMISSIONS_MASK) == 0); int err = errno; if (!created_directory) { PLUGIN_ERROR("WARNING: Failed to create new directory %s. Reason: %s\n", dir.c_str(), strerror(err)); return false; } PLUGIN_DEBUG("Directory %s created\n", dir.c_str()); } return true; } void *flush_pre_init_messages(void* data) { while (true){ struct timespec ts; ts.tv_sec = 1; ts.tv_nsec = 0; nanosleep(&ts ,0); if (jvm_up) { while (!pre_jvm_message.empty()) { pthread_mutex_lock(&debug_pipe_lock); std::string message = pre_jvm_message.front(); pre_jvm_message.pop(); pthread_mutex_unlock(&debug_pipe_lock); plugin_send_message_to_appletviewer_console(message.c_str()); } flush_plugin_send_message_to_appletviewer_console(); } } return NULL; } void push_pre_init_messages(char * ldm){ pthread_mutex_lock(&debug_pipe_lock); pre_jvm_message.push(std::string(ldm)); pthread_mutex_unlock(&debug_pipe_lock); } void reset_pre_init_messages(){ pre_jvm_message = std::queue(); } /** * Given a context number, constructs a message prefix to send to Java * * @param context The context of the request * @return The string prefix (allocated on heap) */ void IcedTeaPluginUtilities::constructMessagePrefix(int context, std::string *result) { std::string context_str = std::string(); itoa(context, &context_str); result->append("context "); result->append(context_str); result->append(" reference -1"); } /** * Given a context number, and reference number, constructs a message prefix to * send to Java * * @param context The context of the request * @param rerefence The reference number of the request * @param result The message */ void IcedTeaPluginUtilities::constructMessagePrefix(int context, int reference, std::string* result) { // Until security is implemented, use file:// source for _everything_ std::string context_str = std::string(); std::string reference_str = std::string(); itoa(context, &context_str); itoa(reference, &reference_str); *result += "context "; result->append(context_str); *result += " reference "; result->append(reference_str); } /** * Given a context number, reference number, and source location, constructs * a message prefix to send to Java * * @param context The context of the request * @param rerefence The reference number of the request * @param address The address for the script that made the request * @param result The message */ void IcedTeaPluginUtilities::constructMessagePrefix(int context, int reference, std::string address, std::string* result) { std::string context_str = std::string(); std::string reference_str = std::string(); itoa(context, &context_str); itoa(reference, &reference_str); *result += "context "; result->append(context_str); *result += " reference "; result->append(reference_str); if (address.length() > 0) { *result += " src "; result->append(address); } } /** * Returns a string representation of a void pointer * * @param id The pointer * @param result The string representation */ void IcedTeaPluginUtilities::JSIDToString(void* id, std::string* result) { char id_str[NUM_STR_BUFFER_SIZE]; if (sizeof(void*) == sizeof(long long)) { snprintf(id_str, NUM_STR_BUFFER_SIZE, "%llu", id); } else { snprintf(id_str, NUM_STR_BUFFER_SIZE, "%lu", id); // else use long } result->append(id_str); PLUGIN_DEBUG("Converting pointer %p to %s\n", id, id_str); } /** * Returns a void pointer from a string representation * * @param id_str The string representation * @return The pointer */ void* IcedTeaPluginUtilities::stringToJSID(std::string id_str) { void* ptr; if (sizeof(void*) == sizeof(long long)) { PLUGIN_DEBUG("Casting (long long) \"%s\" -- %llu\n", id_str.c_str(), strtoull(id_str.c_str(), NULL, 0)); ptr = reinterpret_cast ((unsigned long long) strtoull(id_str.c_str(), NULL, 0)); } else { PLUGIN_DEBUG("Casting (long) \"%s\" -- %lu\n", id_str.c_str(), strtoul(id_str.c_str(), NULL, 0)); ptr = reinterpret_cast ((unsigned long) strtoul(id_str.c_str(), NULL, 0)); } PLUGIN_DEBUG("Casted: %p\n", ptr); return ptr; } /** * Returns a void pointer from a string representation * * @param id_str The pointer to the string representation * @return The pointer */ void* IcedTeaPluginUtilities::stringToJSID(std::string* id_str) { void* ptr; if (sizeof(void*) == sizeof(long long)) { PLUGIN_DEBUG("Casting (long long) \"%s\" -- %llu\n", id_str->c_str(), strtoull(id_str->c_str(), NULL, 0)); ptr = reinterpret_cast ((unsigned long long) strtoull(id_str->c_str(), NULL, 0)); } else { PLUGIN_DEBUG("Casting (long) \"%s\" -- %lu\n", id_str->c_str(), strtoul(id_str->c_str(), NULL, 0)); ptr = reinterpret_cast ((unsigned long) strtoul(id_str->c_str(), NULL, 0)); } PLUGIN_DEBUG("Casted: %p\n", ptr); return ptr; } /** * Increments the global reference number and returns it. * * This function is thread-safe. */ int IcedTeaPluginUtilities::getReference() { pthread_mutex_lock(&reference_mutex); // If we are nearing the max, reset if (reference < -0x7FFFFFFF + 10) { reference = -1; } reference--; pthread_mutex_unlock(&reference_mutex); return reference; } /** * Decrements the global reference number. * * This function is thread-safe. */ void IcedTeaPluginUtilities::releaseReference() { // do nothing for now } /** * Converts integer to char* * * @param i The integer to convert to ascii * @param result The resulting string */ void IcedTeaPluginUtilities::itoa(int i, std::string* result) { char int_str[NUM_STR_BUFFER_SIZE]; snprintf(int_str, NUM_STR_BUFFER_SIZE, "%d", i); result->append(int_str); } /** * Frees memory from a string* vector * * The vector deconstructor will only delete string pointers upon being * called. This function frees the associated string memory as well. * * @param v The vector whose strings are to be freed */ void IcedTeaPluginUtilities::freeStringPtrVector(std::vector* v) { if (v) { for (int i=0; i < v->size(); i++) { delete v->at(i); } delete v; } } /** * Given a string, splits it on the given delimiters. * * @param str The string to split * @param The delimiters to split on * @return A string vector containing the split components */ std::vector* IcedTeaPluginUtilities::strSplit(const char* str, const char* delim) { std::vector* v = new std::vector(); v->reserve(strlen(str)/2); char* copy; // Tokenization is done on a copy copy = (char*) malloc (sizeof(char)*strlen(str) + 1); strcpy(copy, str); char* tok_ptr; tok_ptr = strtok (copy, delim); while (tok_ptr != NULL) { // Allocation on heap since caller has no way to knowing how much will // be needed. Make sure caller cleans up! std::string* s = new std::string(); s->append(tok_ptr); v->push_back(s); tok_ptr = strtok (NULL, delim); } free(copy); return v; } /** * Given a unicode byte array, converts it to a UTF8 string * * The actual contents in the array may be surrounded by other data. * * e.g. with length 5, begin = 3, * unicode_byte_array = "37 28 5 48 45 4c 4c 4f 9e 47": * * We'd start at 3 i.e. "48" and go on for 5 i.e. upto and including "4f". * So we convert "48 45 4c 4c 4f" which is "hello" * * @param length The length of the string * @param begin Where in the array to begin conversion * @param result_unicode_str The return variable in which the * converted string is placed */ void IcedTeaPluginUtilities::getUTF8String(int length, int begin, std::vector* unicode_byte_array, std::string* result_unicode_str) { result_unicode_str->clear(); result_unicode_str->reserve(unicode_byte_array->size()/2); for (int i = begin; i < begin+length; i++) result_unicode_str->push_back((char) strtol(unicode_byte_array->at(i)->c_str(), NULL, 16)); PLUGIN_DEBUG("Converted UTF-8 string: %s. Length=%d\n", result_unicode_str->c_str(), result_unicode_str->length()); } /** * Given a UTF8 string, converts it to a space delimited string of hex characters * * The first element in the return array is the length of the string * * e.g. "hello" would convert to: "5 48 45 4c 4c 4f" * * @param str The string to convert * @param urt_str The result */ void IcedTeaPluginUtilities::convertStringToUTF8(std::string* str, std::string* utf_str) { std::ostringstream ostream; std::string length = std::string(); itoa(str->length(), &length); ostream << length; char hex_value[NUM_STR_BUFFER_SIZE]; for (int i = 0; i < str->length(); i++) { snprintf(hex_value, NUM_STR_BUFFER_SIZE," %hx", str->at(i)); ostream << hex_value; } utf_str->clear(); *utf_str = ostream.str(); PLUGIN_DEBUG("Converted %s to UTF-8 string %s\n", str->c_str(), utf_str->c_str()); } /** * Given a unicode byte array, converts it to a UTF16LE/UCS-2 string * * This works in a manner similar to getUTF8String, except that it reads 2 * slots for each byte. * * @param length The length of the string * @param begin Where in the array to begin conversion * @param result_unicode_str The return variable in which the * converted string is placed */ void IcedTeaPluginUtilities::getUTF16LEString(int length, int begin, std::vector* unicode_byte_array, std::wstring* result_unicode_str) { wchar_t c; PLUGIN_DEBUG("Converted UTF-16LE string: \n"); result_unicode_str->clear(); for (int i = begin; i < begin+length; i+=2) { int low = strtol(unicode_byte_array->at(i)->c_str(), NULL, 16); int high = strtol(unicode_byte_array->at(i+1)->c_str(), NULL, 16); c = ((high << 8) | low); if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9')) { PLUGIN_DEBUG("%c\n", c); } result_unicode_str->push_back(c); } // not routing via debug print macros due to wide-string issues PLUGIN_DEBUG(". Length=%d\n", result_unicode_str->length()); } /* * Prints the given string vector (if debug is true) * * @param prefix The prefix to print before printing the vector contents * @param cv The string vector whose contents are to be printed */ void IcedTeaPluginUtilities::printStringVector(const char* prefix, std::vector* str_vector) { // This is a CPU intensive function. Run only if debugging if (!plugin_debug) return; std::string* str = new std::string(); *str += "{ "; for (int i=0; i < str_vector->size(); i++) { *str += str_vector->at(i); if (i != str_vector->size() - 1) *str += ", "; } *str += " }"; PLUGIN_DEBUG("%s %s\n", prefix, str->c_str()); delete str; } const gchar* IcedTeaPluginUtilities::getSourceFromInstance(NPP instance) { // At the moment, src cannot be securely fetched via NPAPI // See: // http://www.mail-archive.com/chromium-dev@googlegroups.com/msg04872.html // Since we use the insecure window.location.href attribute to compute // source, we cannot use it to make security decisions. Therefore, // instance associated source will always return empty //ITNPPluginData* data = (ITNPPluginData*) instance->pdata; //return (data->source) ? data->source : ""; return "http://null.null"; } /** * Stores a window pointer <-> instance mapping * * @param member_ptr The pointer key * @param instance The instance to associate with this pointer */ void IcedTeaPluginUtilities::storeInstanceID(void* member_ptr, NPP instance) { PLUGIN_DEBUG("Storing instance %p with key %p\n", instance, member_ptr); instance_map->insert(std::make_pair(member_ptr, instance)); } /** * Removes a window pointer <-> instance mapping * * @param member_ptr The key to remove */ void IcedTeaPluginUtilities::removeInstanceID(void* member_ptr) { PLUGIN_DEBUG("Removing key %p from instance map\n", member_ptr); instance_map->erase(member_ptr); } /* Clear instance_map. Useful for tests. */ void IcedTeaPluginUtilities::clearInstanceIDs() { delete instance_map; instance_map = new std::map(); } /** * Removes all mappings to a given instance, and all associated objects */ void IcedTeaPluginUtilities::invalidateInstance(NPP instance) { PLUGIN_DEBUG("Invalidating instance %p\n", instance); std::map::iterator iterator; for (iterator = instance_map->begin(); iterator != instance_map->end(); ) { if ((*iterator).second == instance) { instance_map->erase(iterator++); } else { ++iterator; } } } /** * Given the window pointer, returns the instance associated with it * * @param member_ptr The pointer key * @return The associated instance */ NPP IcedTeaPluginUtilities::getInstanceFromMemberPtr(void* member_ptr) { NPP instance = NULL; PLUGIN_DEBUG("getInstanceFromMemberPtr looking for %p\n", member_ptr); std::map::iterator iterator = instance_map->find(member_ptr); if (iterator != instance_map->end()) { instance = instance_map->find(member_ptr)->second; PLUGIN_DEBUG("getInstanceFromMemberPtr found %p. Instance = %p\n", member_ptr, instance); } return instance; } /** * Given a java id key ('classid:instanceid'), returns the associated valid NPObject, if any * * @param key the key * @return The associated active NPObject, NULL otherwise */ NPObject* IcedTeaPluginUtilities::getNPObjectFromJavaKey(std::string key) { NPObject* object = NULL; PLUGIN_DEBUG("getNPObjectFromJavaKey looking for %s\n", key.c_str()); std::map::iterator iterator = object_map->find(key); if (iterator != object_map->end()) { NPObject* mapped_object = object_map->find(key)->second; if (getInstanceFromMemberPtr(mapped_object) != NULL) { object = mapped_object; PLUGIN_DEBUG("getNPObjectFromJavaKey found %s. NPObject = %p\n", key.c_str(), object); } } return object; } /** * Stores a java id key <-> NPObject mapping * * @param key The Java ID Key * @param object The object to map to */ void IcedTeaPluginUtilities::storeObjectMapping(std::string key, NPObject* object) { PLUGIN_DEBUG("Storing object %p with key %s\n", object, key.c_str()); object_map->insert(std::make_pair(key, object)); } /** * Removes a java id key <-> NPObject mapping * * @param key The key to remove */ void IcedTeaPluginUtilities::removeObjectMapping(std::string key) { PLUGIN_DEBUG("Removing key %s from object map\n", key.c_str()); object_map->erase(key); } /* Clear object_map. Useful for tests. */ void IcedTeaPluginUtilities::clearObjectMapping() { std::map::iterator iter = object_map->begin(); for (; iter != object_map->end(); ++iter) { browser_functions.releaseobject(iter->second); } delete object_map; object_map = new std::map(); } /* * Similar to printStringVector, but takes a vector of string pointers instead * * @param prefix The prefix to print before printing the vector contents * @param cv The string* vector whose contents are to be printed */ void IcedTeaPluginUtilities::printStringPtrVector(const char* prefix, std::vector* str_ptr_vector) { // This is a CPU intensive function. Run only if debugging if (!plugin_debug) return; std::string* str = new std::string(); *str += "{ "; for (int i=0; i < str_ptr_vector->size(); i++) { *str += *(str_ptr_vector->at(i)); if (i != str_ptr_vector->size() - 1) *str += ", "; } *str += " }"; PLUGIN_DEBUG("%s %s\n", prefix, str->c_str()); delete str; } void IcedTeaPluginUtilities::printNPVariant(NPVariant variant) { // This is a CPU intensive function. Run only if debugging if (!plugin_debug) return; if (NPVARIANT_IS_VOID(variant)) { PLUGIN_DEBUG("VOID %d\n", variant); } else if (NPVARIANT_IS_NULL(variant)) { PLUGIN_DEBUG("NULL\n", variant); } else if (NPVARIANT_IS_BOOLEAN(variant)) { PLUGIN_DEBUG("BOOL: %d\n", NPVARIANT_TO_BOOLEAN(variant)); } else if (NPVARIANT_IS_INT32(variant)) { PLUGIN_DEBUG("INT32: %d\n", NPVARIANT_TO_INT32(variant)); } else if (NPVARIANT_IS_DOUBLE(variant)) { PLUGIN_DEBUG("DOUBLE: %f\n", NPVARIANT_TO_DOUBLE(variant)); } else if (NPVARIANT_IS_STRING(variant)) { std::string str = IcedTeaPluginUtilities::NPVariantAsString(variant); PLUGIN_DEBUG("STRING: %s (length=%d)\n", str.c_str(), str.size()); } else { PLUGIN_DEBUG("OBJ: %p\n", NPVARIANT_TO_OBJECT(variant)); } } void IcedTeaPluginUtilities::NPVariantToString(NPVariant variant, std::string* result) { char conv_str[NUM_STR_BUFFER_SIZE]; // conversion buffer bool was_string_already = false; if (NPVARIANT_IS_STRING(variant)) { result->append(IcedTeaPluginUtilities::NPVariantAsString(variant)); was_string_already = true; } else if (NPVARIANT_IS_VOID(variant)) { snprintf(conv_str, NUM_STR_BUFFER_SIZE, "%p", variant); } else if (NPVARIANT_IS_NULL(variant)) { snprintf(conv_str, NUM_STR_BUFFER_SIZE, "NULL"); } else if (NPVARIANT_IS_BOOLEAN(variant)) { if (NPVARIANT_TO_BOOLEAN(variant)) snprintf(conv_str, NUM_STR_BUFFER_SIZE, "true"); else snprintf(conv_str, NUM_STR_BUFFER_SIZE, "false"); } else if (NPVARIANT_IS_INT32(variant)) { snprintf(conv_str, NUM_STR_BUFFER_SIZE, "%d", NPVARIANT_TO_INT32(variant)); } else if (NPVARIANT_IS_DOUBLE(variant)) { snprintf(conv_str, NUM_STR_BUFFER_SIZE, "%f", NPVARIANT_TO_DOUBLE(variant)); } else { snprintf(conv_str, NUM_STR_BUFFER_SIZE, "[Object %p]", variant); } if (!was_string_already){ result->append(conv_str); } } /** * Convert either a void, boolean, or a number */ static void javaPrimitiveResultToNPVariant(const std::string& value, NPVariant* variant) { if (value == "void") { PLUGIN_DEBUG("Method call returned void\n"); VOID_TO_NPVARIANT(*variant); } else if (value == "null") { PLUGIN_DEBUG("Method call returned null\n"); NULL_TO_NPVARIANT(*variant); } else if (value == "true") { PLUGIN_DEBUG("Method call returned a boolean (true)\n"); BOOLEAN_TO_NPVARIANT(true, *variant); } else if (value == "false") { PLUGIN_DEBUG("Method call returned a boolean (false)\n"); BOOLEAN_TO_NPVARIANT(false, *variant); } else { double d = strtod(value.c_str(), NULL); // See if it is convertible to int if (value.find(".") != std::string::npos || d < -(0x7fffffffL - 1L) || d > 0x7fffffffL) { PLUGIN_DEBUG("Method call returned a double %f\n", d); DOUBLE_TO_NPVARIANT(d, *variant); } else { int32_t i = (int32_t) d; PLUGIN_DEBUG("Method call returned an int %d\n", i); INT32_TO_NPVARIANT(i, *variant); } } } static bool javaStringResultToNPVariant(const std::string& jobject_id, NPVariant* variant) { JavaRequestProcessor jrequest_processor; JavaResultData* jstring_result = jrequest_processor.getString(jobject_id); if (jstring_result->error_occurred) { return false; } std::string str = *jstring_result->return_string; PLUGIN_DEBUG( "Method call returned a string:\"%s\"\n", str.c_str()); *variant = IcedTeaPluginUtilities::NPVariantStringCopy(str); return true; } static bool javaJSObjectResultToNPVariant(const std::string& js_id, NPVariant* variant) { NPVariant* result_variant = (NPVariant*) IcedTeaPluginUtilities::stringToJSID(js_id); *variant = *result_variant; return true; } static bool javaObjectResultToNPVariant(NPP instance, const std::string& jclass_name, const std::string& jobject_id, NPVariant* variant) { // Reference the class object so we can construct an NPObject with it and the instance JavaRequestProcessor jrequest_processor; JavaResultData* jclass_result = jrequest_processor.getClassID(jobject_id); if (jclass_result->error_occurred) { return false; } std::string jclass_id = *jclass_result->return_string; NPObject* obj; if (jclass_name.at(0) == '[') // array { PLUGIN_DEBUG( "javaObjectResultToNPVariant Array detected: \"%s\"\n", jclass_name.c_str()); obj = IcedTeaScriptableJavaObject::get_scriptable_java_object(instance, jclass_id, jobject_id, true); } else { PLUGIN_DEBUG( "javaObjectResultToNPVariant Scalar object: \"%s\"\n", jclass_name.c_str()); obj = IcedTeaScriptableJavaObject::get_scriptable_java_object(instance, jclass_id, jobject_id, false); } OBJECT_TO_NPVARIANT(obj, *variant); return true; } bool IcedTeaPluginUtilities::javaResultToNPVariant(NPP instance, std::string* java_value, NPVariant* variant) { int literal_n = sizeof("literalreturn"); // Accounts for one space char int jsobject_n = sizeof("jsobject"); // Accounts for one space char if (strncmp("literalreturn ", java_value->c_str(), literal_n) == 0) { javaPrimitiveResultToNPVariant(java_value->substr(literal_n), variant); } else if (strncmp("jsobject ", java_value->c_str(), jsobject_n) == 0) { javaJSObjectResultToNPVariant(java_value->substr(jsobject_n), variant); } else { std::string jobject_id = *java_value; JavaRequestProcessor jrequest_processor; JavaResultData* jclassname_result = jrequest_processor.getClassName(jobject_id); if (jclassname_result->error_occurred) { return false; } // Special-case for NPString if string if (*jclassname_result->return_string == "java.lang.String") { return javaStringResultToNPVariant(jobject_id, variant); } else // Else this needs a java object wrapper { return javaObjectResultToNPVariant(instance, *jclassname_result->return_string, jobject_id, variant); } } return true; } bool IcedTeaPluginUtilities::isObjectJSArray(NPP instance, NPObject* object) { NPVariant constructor_v = NPVariant(); NPIdentifier constructor_id = browser_functions.getstringidentifier("constructor"); browser_functions.getproperty(instance, object, constructor_id, &constructor_v); IcedTeaPluginUtilities::printNPVariant(constructor_v); // void constructor => not an array if (NPVARIANT_IS_VOID(constructor_v)) return false; NPObject* constructor = NPVARIANT_TO_OBJECT(constructor_v); NPVariant constructor_str; NPIdentifier toString = browser_functions.getstringidentifier("toString"); browser_functions.invoke(instance, constructor, toString, NULL, 0, &constructor_str); IcedTeaPluginUtilities::printNPVariant(constructor_str); std::string constructor_name = IcedTeaPluginUtilities::NPVariantAsString(constructor_str); PLUGIN_DEBUG("Constructor for NPObject is %s\n", constructor_name.c_str()); return constructor_name.find("function Array") == 0; } void IcedTeaPluginUtilities::decodeURL(const gchar* url, gchar** decoded_url) { PLUGIN_DEBUG("GOT URL: %s -- %s\n", url, *decoded_url); int length = strlen(url); for (int i=0; i < length; i++) { if (url[i] == '%' && i < length - 2) { unsigned char code1 = (unsigned char) url[i+1]; unsigned char code2 = (unsigned char) url[i+2]; if (!IS_VALID_HEX(&code1) || !IS_VALID_HEX(&code2)) continue; // Convert hex value to integer int converted1 = HEX_TO_INT(&code1); int converted2 = HEX_TO_INT(&code2); // bitshift 4 to simulate *16 int value = (converted1 << 4) + converted2; char decoded = value; strncat(*decoded_url, &decoded, 1); i += 2; } else { strncat(*decoded_url, &url[i], 1); } } PLUGIN_DEBUG("SENDING URL: %s\n", *decoded_url); } /* Copies a variant data type into a C++ string */ std::string IcedTeaPluginUtilities::NPVariantAsString(NPVariant variant) { return std::string( NPVARIANT_TO_STRING(variant).UTF8Characters, NPVARIANT_TO_STRING(variant).UTF8Length); } /** * Posts a function for execution on the plug-in thread and wait for result. * * @param instance The NPP instance * @param func The function to post * @param data Arguments to *func */ NPString IcedTeaPluginUtilities::NPStringCopy(const std::string& result) { char* utf8 = (char*)browser_functions.memalloc(result.size() + 1); strncpy(utf8, result.c_str(), result.size() + 1); NPString npstr = {utf8, result.size()}; return npstr; } NPVariant IcedTeaPluginUtilities::NPVariantStringCopy(const std::string& result) { NPString npstr = NPStringCopy(result); NPVariant npvar; STRINGN_TO_NPVARIANT(npstr.UTF8Characters, npstr.UTF8Length, npvar); return npvar; } void IcedTeaPluginUtilities::callAndWaitForResult(NPP instance, void (*func) (void *), AsyncCallThreadData* data) { struct timespec t; struct timespec curr_t; clock_gettime(CLOCK_REALTIME, &t); t.tv_sec += REQUESTTIMEOUT; // timeout // post request postPluginThreadAsyncCall(instance, func, data); do { clock_gettime(CLOCK_REALTIME, &curr_t); if (data != NULL && !data->result_ready && (curr_t.tv_sec < t.tv_sec)) { usleep(2000); } else { break; } } while (1); } /** * Posts a request that needs to be handled in a plugin thread. * * @param instance The plugin instance * @param func The function to execute * @param userData The userData for the function to consume/write to * @return if the call was posted successfully */ bool IcedTeaPluginUtilities::postPluginThreadAsyncCall(NPP instance, void (*func) (void *), void* data) { if (instance) { PluginThreadCall* call = new PluginThreadCall(); call->instance = instance; call->func = func; call->userData = data; pthread_mutex_lock(&pluginAsyncCallMutex); pendingPluginThreadRequests->push_back(call); pthread_mutex_unlock(&pluginAsyncCallMutex); browser_functions.pluginthreadasynccall(instance, &processAsyncCallQueue, NULL); // Always returns immediately PLUGIN_DEBUG("Pushed back call evt %p\n", call); return true; } // Else PLUGIN_DEBUG("Instance is not active. Call rejected.\n"); return false; } /** * Returns a vector of gchar* pointing to the elements of the vector string passed in. * @param stringVec The vector of strings reference. */ std::vector IcedTeaPluginUtilities::vectorStringToVectorGchar(const std::vector* stringVec) { std::vector charVec; for (int i = 0; i < stringVec->size(); i++) { gchar* element = (gchar*) stringVec->at(i).c_str(); //cast from const char charVec.push_back(element); } charVec.push_back(NULL); return charVec; } /** * Runs through the async call wait queue and executes all calls * * @param param Ignored -- required to conform to NPN_PluginThreadAsynCall API */ void processAsyncCallQueue(void* param /* ignored */) { do { PluginThreadCall* call = NULL; pthread_mutex_lock(&pluginAsyncCallMutex); if (pendingPluginThreadRequests->size() > 0) { call = pendingPluginThreadRequests->front(); pendingPluginThreadRequests->erase(pendingPluginThreadRequests->begin()); } pthread_mutex_unlock(&pluginAsyncCallMutex); if (call) { PLUGIN_DEBUG("Processing call evt %p\n", call); call->func(call->userData); PLUGIN_DEBUG("Call evt %p processed\n", call); delete call; } else { break; } } while(1); } void IcedTeaPluginUtilities::trim(std::string& str) { size_t start = str.find_first_not_of(" \t\n"), end = str.find_last_not_of(" \t\n"); if (start == std::string::npos) { return; } str = str.substr(start, end - start + 1); } /*Unescape various escaped chars like \\ -> \ or \= -> = or \: -> , \t -> TAB , \n -> NwLine\*/ /* examples * \\= -> \= * \= -> = * \\ -> \ * \e -> \e * \: -> : * \ -> \ * \\ -> \ */ void IcedTeaPluginUtilities::unescape(std::string& str) { std::string result = ""; int len = str.length(); for (unsigned int i = 0; i < len; i++) { bool processed = false; char c1 = str[i]; if (c1 == '\\') { if (i < len - 1) { char c2 = str[i + 1]; if (c2 == '=' || c2 == '\\' || c2 == ':') { result += c2; i++; processed = true; } if (c2 == 't') { result += '\t'; i++; processed = true; } if (c2 == 'n') { result += '\n'; i++; processed = true; } if (c2 == 'r') { result += '\r'; i++; processed = true; } } } if (!processed) { result += c1; } } str = result; } std::string IcedTeaPluginUtilities::NPIdentifierAsString(NPIdentifier id) { NPUTF8* cstr = browser_functions.utf8fromidentifier(id); if (cstr == NULL) { /* Treat not-existing strings as empty. To tell if it was a valid string, * use browser_functions.identifierisstring. */ return std::string(); } std::string str = cstr; browser_functions.memfree(cstr); return str; } bool IcedTeaPluginUtilities::file_exists(std::string filename) { std::ifstream infile(filename.c_str()); return infile.good(); } bool IcedTeaPluginUtilities::is_directory(std::string filename) { if (!file_exists) { return false; } struct stat buf; stat(filename.c_str(), &buf); return S_ISDIR(buf.st_mode); } void IcedTeaPluginUtilities::initFileLog(){ if (plugin_file_log != NULL ) { //reusing return; } plugin_file_log_name = get_log_dir() + "/" + IcedTeaPluginUtilities::generateLogFileName(); int plugin_file_log_fd = open(plugin_file_log_name.c_str(), O_WRONLY | O_CREAT | O_EXCL, 0600); if (plugin_file_log_fd <=0 ) { plugin_debug_to_file = false; } else { plugin_file_log = fdopen(plugin_file_log_fd, "w"); } if (plugin_file_log == NULL ) { plugin_debug_to_file = false; } } std::string IcedTeaPluginUtilities::generateLogFileName(){ char times[96]; char result[100]; time_t t = time(NULL); struct tm p; localtime_r(&t, &p); struct timeval current_time; \ gettimeofday (¤t_time, NULL);\ strftime(times, 96, "%Y-%m-%d_%H:%M:%S", &p); snprintf(result, 100, "%s.%i",times, current_time.tv_usec/1000); return "itw-cplugin-"+std::string(result)+".log"; } void IcedTeaPluginUtilities::printDebugStatus(){ if (plugin_debug){ PLUGIN_DEBUG("plugin_debug: true, initialised\n"); if (plugin_debug_headers){ PLUGIN_DEBUG("plugin_debug_headers: true\n"); } else { PLUGIN_DEBUG("plugin_debug_headers: false\n"); } if (plugin_debug_to_file){ PLUGIN_DEBUG("plugin_debug_to_file: true, using %s\n", plugin_file_log_name.c_str()); } else { PLUGIN_DEBUG("plugin_debug_to_file: false\n"); } if (plugin_debug_to_streams){ PLUGIN_DEBUG("plugin_debug_to_streams: true\n"); } else { PLUGIN_DEBUG("plugin_debug_to_streams: false\n"); } if (plugin_debug_to_system){ PLUGIN_DEBUG("plugin_debug_to_system: true\n"); } else { PLUGIN_DEBUG("plugin_debug_to_system: false\n"); } if (plugin_debug_to_console){ if (debug_pipe_name){ PLUGIN_DEBUG("plugin_debug_to_console: true, pipe %s\n", debug_pipe_name); } else { PLUGIN_DEBUG("plugin_debug_to_console: true, pipe not yet known or broken\n"); } } else { PLUGIN_DEBUG("plugin_debug_to_console: false\n"); } } } std::string IcedTeaPluginUtilities::getTmpPath(){ const char* tmpdir_env = getenv("TMPDIR"); if (tmpdir_env != NULL && g_file_test (tmpdir_env, (GFileTest) (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))) { return std::string(tmpdir_env); } else if (g_file_test (P_tmpdir, (GFileTest) (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))) { return std::string(P_tmpdir); } else { // If TMPDIR and P_tmpdir do not exist, try /tmp directly return "/tmp"; } } std::string IcedTeaPluginUtilities::getRuntimePath(){ const char* rntdir_env = getenv("XDG_RUNTIME_DIR"); if (rntdir_env != NULL && g_file_test (rntdir_env, (GFileTest) (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))) { return std::string(rntdir_env); } return IcedTeaPluginUtilities::getTmpPath(); } /****************************************** * Begin JavaMessageSender implementation * ****************************************** * * This implementation is very simple and is therefore folded into this file * rather than a new one. */ /** * Sends to the Java side * * @param message The message to send. * @param returns whether the message was consumable (always true) */ bool JavaMessageSender::newMessageOnBus(const char* message) { char* msg = (char*) malloc(sizeof(char)*strlen(message) + 1); strcpy(msg, message); plugin_send_message_to_appletviewer(msg); free(msg); msg = NULL; // Always successful return true; } /*********************************** * Begin MessageBus implementation * ***********************************/ /** * Constructor. * * Initializes the mutexes needed by the other functions. */ MessageBus::MessageBus() { int ret; ret = pthread_mutex_init(&subscriber_mutex, NULL); if(ret) PLUGIN_DEBUG("Error: Unable to initialize subscriber mutex: %d\n", ret); ret = pthread_mutex_init(&msg_queue_mutex, NULL); if(ret) PLUGIN_DEBUG("Error: Unable to initialize message queue mutex: %d\n", ret); PLUGIN_DEBUG("Mutexes %p and %p initialized\n", &subscriber_mutex, &msg_queue_mutex); } /** * Destructor. * * Destroy the mutexes initialized by the constructor. */ MessageBus::~MessageBus() { PLUGIN_DEBUG("MessageBus::~MessageBus\n"); int ret; ret = pthread_mutex_destroy(&subscriber_mutex); if(ret) PLUGIN_DEBUG("Error: Unable to destroy subscriber mutex: %d\n", ret); ret = pthread_mutex_destroy(&msg_queue_mutex); if(ret) PLUGIN_DEBUG("Error: Unable to destroy message queue mutex: %d\n", ret); } /** * Adds the given BusSubscriber as a subscriber to self * * @param b The BusSubscriber to subscribe */ void MessageBus::subscribe(BusSubscriber* b) { // Applets may initialize in parallel. So lock before pushing. PLUGIN_DEBUG("Subscribing %p to bus %p\n", b, this); pthread_mutex_lock(&subscriber_mutex); subscribers.push_back(b); pthread_mutex_unlock(&subscriber_mutex); } /** * Removes the given BusSubscriber from the subscriber list * * @param b The BusSubscriber to ubsubscribe */ void MessageBus::unSubscribe(BusSubscriber* b) { // Applets may initialize in parallel. So lock before pushing. PLUGIN_DEBUG("Un-subscribing %p from bus %p\n", b, this); pthread_mutex_lock(&subscriber_mutex); subscribers.remove(b); pthread_mutex_unlock(&subscriber_mutex); } /** * Notifies all subscribers with the given message * * @param message The message to send to the subscribers */ void MessageBus::post(const char* message) { bool message_consumed = false; PLUGIN_DEBUG("Trying to lock %p...\n", &msg_queue_mutex); pthread_mutex_lock(&subscriber_mutex); PLUGIN_DEBUG("Message %s received on bus. Notifying subscribers.\n", message); std::list::const_iterator i; for( i = subscribers.begin(); i != subscribers.end() && !message_consumed; ++i ) { PLUGIN_DEBUG("Notifying subscriber %p of %s\n", *i, message); message_consumed = ((BusSubscriber*) *i)->newMessageOnBus(message); } pthread_mutex_unlock(&subscriber_mutex); if (!message_consumed) PLUGIN_DEBUG("Warning: No consumer found for message %s\n", message); PLUGIN_DEBUG("%p unlocked...\n", &msg_queue_mutex); } icedtea-web-1.6.2/plugin/icedteanp/PaxHeaders.17941/IcedTeaPluginRequestProcessor.h0000644000000000000000000000013212654402377024776 xustar0030 mtime=1454507263.215432874 30 atime=1454507327.172579897 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/icedteanp/IcedTeaPluginRequestProcessor.h0000644000175000002070000001115412654402377025523 0ustar00jvanekmock00000000000000/* IcedTeaPluginRequestProcessor.h Copyright (C) 2009, 2010 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #ifndef __ICEDTEAPLUGINREQUESTPROCESSOR_H__ #define __ICEDTEAPLUGINREQUESTPROCESSOR_H__ #include #include #include #include #include #include #include #include "IcedTeaPluginUtils.h" #include "IcedTeaJavaRequestProcessor.h" /* Internal request reference counter */ static long internal_req_ref_counter; /* Given a value and type, performs the appropriate Java->JS type * mapping and puts it in the given variant */ static void convertToNPVariant(std::string value, std::string type, NPVariant* result_variant); // Internal methods that need to run in main thread void _getMember(void* data); void _setMember(void* data); void _call(void* data); void _eval(void* data); void _getString(void* data); void _loadURL(void* data); void* queue_processor(void* data); /** * Processes requests made TO the plugin (by java or anyone else) */ class PluginRequestProcessor : public BusSubscriber { private: /* Mutex to ensure that the request queue is accessed synchronously */ pthread_mutex_t message_queue_mutex; /* Condition on which the queue processor waits */ pthread_cond_t cond_message_available; /* Queue for holding messages that get processed in a separate thread */ std::vector< std::vector* >* message_queue; /* Mutex to ensure synchronized writes */ pthread_mutex_t syn_write_mutex; /* Dispatch request processing to a new thread for asynch. processing */ void dispatch(void* func_ptr (void*), std::vector* message, std::string* src); /* Send main window pointer to Java */ void sendWindow(std::vector* message_parts); /* Stores the variant on java side */ void storeVariantInJava(NPVariant variant, std::string* result); /* Send member ID to Java */ void sendMember(std::vector* message_parts); /* Set member to given value */ void setMember(std::vector* message_parts); /* Send string value of requested object */ void sendString(std::vector* message_parts); /* Evaluate the given script */ void eval(std::vector* message_parts); /* Evaluate the given script */ void call(std::vector* message_parts); /* Decrements reference count for given object */ void finalize(std::vector* message_parts); /* Loads a URL into the specified target */ void loadURL(std::vector* message_parts); public: PluginRequestProcessor(); /* Constructor */ ~PluginRequestProcessor(); /* Destructor */ /* Process new requests (if applicable) */ virtual bool newMessageOnBus(const char* message); /* Thread run method for processing queued messages */ void queueProcessorThread(); }; #endif // __ICEDTEAPLUGINREQUESTPROCESSOR_H__ icedtea-web-1.6.2/plugin/icedteanp/PaxHeaders.17941/IcedTeaPluginRequestProcessor.cc0000644000000000000000000000013112654402377025133 xustar0030 mtime=1454507263.215432874 29 atime=1454507327.17157991 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/icedteanp/IcedTeaPluginRequestProcessor.cc0000644000175000002070000007620312654402377025667 0ustar00jvanekmock00000000000000/* IcedTeaPluginRequestProcessor.cc Copyright (C) 2009, 2010 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #include #include "IcedTeaScriptablePluginObject.h" #include "IcedTeaNPPlugin.h" #include "IcedTeaPluginRequestProcessor.h" /* * This class processes requests made by Java. The requests include pointer * information, script execution and variable get/set */ /** * PluginRequestProcessor constructor. * * Initializes various complex data structures used by the class. */ PluginRequestProcessor::PluginRequestProcessor() { this->message_queue = new std::vector< std::vector* >(); internal_req_ref_counter = 0; pthread_mutex_init(&this->message_queue_mutex, NULL); pthread_mutex_init(&this->syn_write_mutex, NULL); pthread_cond_init(&this->cond_message_available, NULL); } /** * PluginRequestProcessor destructor. * * Frees memory used by complex objects. */ PluginRequestProcessor::~PluginRequestProcessor() { PLUGIN_DEBUG("PluginRequestProcessor::~PluginRequestProcessor\n"); if (message_queue) delete message_queue; pthread_mutex_destroy(&message_queue_mutex); pthread_mutex_destroy(&syn_write_mutex); pthread_cond_destroy(&cond_message_available); } /** * Processes plugin (C++ side) requests from the Java side, and internally. * * @param message The message request to process * @return boolean indicating whether the message is serviceable by this object */ bool PluginRequestProcessor::newMessageOnBus(const char* message) { PLUGIN_DEBUG("PluginRequestProcessor processing %s\n", message); std::string* type; std::string* command; int counter = 0; std::vector* message_parts = IcedTeaPluginUtilities::strSplit(message, " "); std::vector::iterator the_iterator; the_iterator = message_parts->begin(); IcedTeaPluginUtilities::printStringPtrVector("PluginRequestProcessor::newMessageOnBus:", message_parts); type = message_parts->at(0); command = message_parts->at(4); if (!type->find("instance")) { if (!command->find("GetWindow")) { // Window can be queried from the main thread only. And this call // returns immediately, so we do it in the same thread. this->sendWindow(message_parts); return true; } else if (!command->find("Finalize")) { // Object can be finalized from the main thread only. And this // call returns immediately, so we do it in the same thread. this->finalize(message_parts); return true; } else if (!command->find("GetMember") || !command->find("SetMember") || !command->find("ToString") || !command->find("Call") || !command->find("GetSlot") || !command->find("SetSlot") || !command->find("Eval") || !command->find("LoadURL")) { // Update queue synchronously pthread_mutex_lock(&message_queue_mutex); message_queue->push_back(message_parts); pthread_cond_signal(&cond_message_available); pthread_mutex_unlock(&message_queue_mutex); return true; } } IcedTeaPluginUtilities::freeStringPtrVector(message_parts); // If we got here, it means we couldn't process the message. Let the caller know. return false; } /** * Sends the window pointer to the Java side. * * @param message_parts The request message. */ void PluginRequestProcessor::sendWindow(std::vector* message_parts) { std::string* type; std::string* command; int reference; std::string response = std::string(); std::string window_ptr_str = std::string(); NPVariant* variant = new NPVariant(); static NPObject* window_ptr; int id; type = message_parts->at(0); id = atoi(message_parts->at(1)->c_str()); reference = atoi(message_parts->at(3)->c_str()); command = message_parts->at(4); NPP instance; get_instance_from_id(id, instance); browser_functions.getvalue(instance, NPNVWindowNPObject, &window_ptr); PLUGIN_DEBUG("ID=%d, Instance=%p, WindowPTR = %p\n", id, instance, window_ptr); OBJECT_TO_NPVARIANT(window_ptr, *variant); browser_functions.retainobject(window_ptr); IcedTeaPluginUtilities::JSIDToString(variant, &window_ptr_str); // We need the context 0 for backwards compatibility with the Java side IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &response); response += " JavaScriptGetWindow "; response += window_ptr_str; plugin_to_java_bus->post(response.c_str()); // store the instance pointer for future reference IcedTeaPluginUtilities::storeInstanceID(variant, instance); } /** * Evaluates the given script * * @param message_parts The request message. */ void PluginRequestProcessor::eval(std::vector* message_parts) { JavaRequestProcessor request_processor = JavaRequestProcessor(); JavaResultData* java_result; NPVariant* window_ptr; NPP instance; std::string script; NPVariant result; int reference; std::string response = std::string(); std::string return_type = std::string(); int id; reference = atoi(message_parts->at(3)->c_str()); window_ptr = (NPVariant*) IcedTeaPluginUtilities::stringToJSID(message_parts->at(5)); instance = IcedTeaPluginUtilities::getInstanceFromMemberPtr(window_ptr); // If instance is invalid, do not proceed further if (!instance) return; java_result = request_processor.getString(*(message_parts->at(6))); CHECK_JAVA_RESULT(java_result); script.append(*(java_result->return_string)); AsyncCallThreadData thread_data = AsyncCallThreadData(); thread_data.result_ready = false; thread_data.parameters = std::vector(); thread_data.result = std::string(); thread_data.parameters.push_back(instance); thread_data.parameters.push_back(NPVARIANT_TO_OBJECT(*window_ptr)); thread_data.parameters.push_back(&script); IcedTeaPluginUtilities::callAndWaitForResult(instance, &_eval, &thread_data); IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &response); response += " JavaScriptEval "; response += thread_data.result; plugin_to_java_bus->post(response.c_str()); } /** * Calls the given javascript script * * @param message_parts The request message. */ void PluginRequestProcessor::call(std::vector* message_parts) { NPP instance; std::string* window_ptr_str; NPVariant* window_ptr; int reference; std::string window_function_name; std::vector args = std::vector(); std::vector arg_ids = std::vector(); int arg_count; std::string response = std::string(); JavaRequestProcessor java_request = JavaRequestProcessor(); JavaResultData* java_result; NPVariant* result_variant; std::string result_variant_jniid = std::string(); NPVariant* args_array = NULL; AsyncCallThreadData thread_data = AsyncCallThreadData(); reference = atoi(message_parts->at(3)->c_str()); // window window_ptr_str = message_parts->at(5); window_ptr = (NPVariant*) IcedTeaPluginUtilities::stringToJSID(window_ptr_str); // instance instance = IcedTeaPluginUtilities::getInstanceFromMemberPtr(window_ptr); // If instance is invalid, do not proceed further if (!instance) goto cleanup; // function name java_result = java_request.getString(*(message_parts->at(6))); CHECK_JAVA_RESULT(java_result); window_function_name.append(*(java_result->return_string)); // arguments for (int i=7; i < message_parts->size(); i++) { arg_ids.push_back(*(message_parts->at(i))); } // determine arguments for (int i=0; i < arg_ids.size(); i++) { NPVariant* variant = new NPVariant(); java_result = java_request.getValue(arg_ids[i]); CHECK_JAVA_RESULT(java_result); IcedTeaPluginUtilities::javaResultToNPVariant(instance, java_result->return_string, variant); args.push_back(*variant); } arg_count = args.size(); args_array = (NPVariant*) malloc(sizeof(NPVariant)*args.size()); for (int i=0; i < args.size(); i++) args_array[i] = args[i]; thread_data.result_ready = false; thread_data.parameters = std::vector(); thread_data.result = std::string(); thread_data.parameters.push_back(instance); thread_data.parameters.push_back(NPVARIANT_TO_OBJECT(*window_ptr)); thread_data.parameters.push_back(&window_function_name); thread_data.parameters.push_back(&arg_count); thread_data.parameters.push_back(args_array); IcedTeaPluginUtilities::callAndWaitForResult(instance, &_call, &thread_data); IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &response); response += " JavaScriptCall "; response += thread_data.result; plugin_to_java_bus->post(response.c_str()); cleanup: free(args_array); } /** * Sends the string value of the requested variable * * @param message_parts The request message. */ void PluginRequestProcessor::sendString(std::vector* message_parts) { std::string variant_ptr; NPVariant* variant; JavaRequestProcessor java_request = JavaRequestProcessor(); JavaResultData* java_result; int reference; std::string response = std::string(); reference = atoi(message_parts->at(3)->c_str()); variant_ptr = *(message_parts->at(5)); variant = (NPVariant*) IcedTeaPluginUtilities::stringToJSID(variant_ptr); AsyncCallThreadData thread_data = AsyncCallThreadData(); thread_data.result_ready = false; thread_data.parameters = std::vector(); thread_data.result = std::string(); NPP instance = IcedTeaPluginUtilities::getInstanceFromMemberPtr(variant); // If instance is invalid, do not proceed further if (!instance) return; thread_data.parameters.push_back(instance); thread_data.parameters.push_back(variant); IcedTeaPluginUtilities::callAndWaitForResult(instance, &_getString, &thread_data); // We need the context 0 for backwards compatibility with the Java side IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &response); response += " JavaScriptToString "; response += thread_data.result; plugin_to_java_bus->post(response.c_str()); } /** * Sets variable to given value * * @param message_parts The request message. */ void PluginRequestProcessor::setMember(std::vector* message_parts) { std::string propertyNameID; std::string value = std::string(); std::string response = std::string(); int reference; NPP instance; NPVariant* member; std::string property_id = std::string(); bool int_identifier; JavaRequestProcessor java_request = JavaRequestProcessor(); JavaResultData* java_result; IcedTeaPluginUtilities::printStringPtrVector("PluginRequestProcessor::_setMember - ", message_parts); reference = atoi(message_parts->at(3)->c_str()); member = (NPVariant*) (IcedTeaPluginUtilities::stringToJSID(*(message_parts->at(5)))); propertyNameID = *(message_parts->at(6)); if (*(message_parts->at(7)) == "literalreturn" || *(message_parts->at(7)) == "jsobject" ) { value.append(*(message_parts->at(7))); value.append(" "); value.append(*(message_parts->at(8))); } else { value.append(*(message_parts->at(7))); } instance = IcedTeaPluginUtilities::getInstanceFromMemberPtr(member); // If instance is invalid, do not proceed further if (!instance) return; if (*(message_parts->at(4)) == "SetSlot") { property_id.append(*(message_parts->at(6))); int_identifier = true; } else { java_result = java_request.getString(propertyNameID); // the result we want is in result_string (assuming there was no error) if (java_result->error_occurred) { PLUGIN_ERROR("Unable to get member name for setMember. Error occurred: %s\n", java_result->error_msg->c_str()); //goto cleanup; } property_id.append(*(java_result->return_string)); int_identifier = false; } AsyncCallThreadData thread_data = AsyncCallThreadData(); thread_data.result_ready = false; thread_data.parameters = std::vector(); thread_data.result = std::string(); thread_data.parameters.push_back(instance); thread_data.parameters.push_back(NPVARIANT_TO_OBJECT(*member)); thread_data.parameters.push_back(&property_id); thread_data.parameters.push_back(&value); thread_data.parameters.push_back(&int_identifier); IcedTeaPluginUtilities::callAndWaitForResult(instance, &_setMember, &thread_data); IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &response); response.append(" JavaScriptSetMember "); plugin_to_java_bus->post(response.c_str()); } /** * Sends request member pointer to the Java side. * * This is a static function, called in another thread. Since certain data * can only be requested from the main thread in Mozilla, this function * does whatever it can separately, and then makes an internal request that * causes _getMember to do the rest of the work. * * @param message_parts The request message */ void PluginRequestProcessor::sendMember(std::vector* message_parts) { // member initialization std::vector args; JavaRequestProcessor java_request = JavaRequestProcessor(); JavaResultData* java_result; NPVariant* parent_ptr; NPVariant* member_ptr; //int reference; std::string member_id = std::string(); std::string response = std::string(); std::string result_id = std::string(); NPIdentifier member_identifier; int method_id; int instance_id; int reference; bool int_identifier; // debug printout of parent thread data IcedTeaPluginUtilities::printStringPtrVector("PluginRequestProcessor::getMember:", message_parts); reference = atoi(message_parts->at(3)->c_str()); // store info in local variables for easy access instance_id = atoi(message_parts->at(1)->c_str()); parent_ptr = (NPVariant*) (IcedTeaPluginUtilities::stringToJSID(message_parts->at(5))); member_id.append(*(message_parts->at(6))); /** Request data from Java if necessary **/ if (*(message_parts->at(4)) == "GetSlot") { int_identifier=true; } else { // make a new request for getString, to get the name of the identifier java_result = java_request.getString(member_id); // the result we want is in result_string (assuming there was no error) if (java_result->error_occurred) { PLUGIN_ERROR("Unable to process getMember request. Error occurred: %s\n", java_result->error_msg->c_str()); //goto cleanup; } member_id.assign(*(java_result->return_string)); int_identifier=false; } AsyncCallThreadData thread_data = AsyncCallThreadData(); thread_data.result_ready = false; thread_data.parameters = std::vector(); thread_data.result = std::string(); NPP instance = IcedTeaPluginUtilities::getInstanceFromMemberPtr(parent_ptr); // If instance is invalid, do not proceed further if (!instance) return; thread_data.parameters.push_back(instance); thread_data.parameters.push_back(NPVARIANT_TO_OBJECT(*parent_ptr)); thread_data.parameters.push_back(&member_id); thread_data.parameters.push_back(&int_identifier); IcedTeaPluginUtilities::callAndWaitForResult(instance, &_getMember, &thread_data); IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &response); if (*(message_parts->at(4)) == "GetSlot") { response.append(" JavaScriptGetSlot "); } else { response.append(" JavaScriptGetMember "); } response.append(thread_data.result); plugin_to_java_bus->post(response.c_str()); } /** * Decrements reference count to given object * * @param message_parts The request message. */ void PluginRequestProcessor::finalize(std::vector* message_parts) { std::string* type; std::string* command; int reference; std::string response = std::string(); std::string* variant_ptr_str; NPVariant* variant_ptr; NPObject* window_ptr; int id; type = message_parts->at(0); id = atoi(message_parts->at(1)->c_str()); reference = atoi(message_parts->at(3)->c_str()); variant_ptr_str = message_parts->at(5); NPP instance; get_instance_from_id(id, instance); variant_ptr = (NPVariant*) IcedTeaPluginUtilities::stringToJSID(variant_ptr_str); window_ptr = NPVARIANT_TO_OBJECT(*variant_ptr); browser_functions.releaseobject(window_ptr); // remove reference IcedTeaPluginUtilities::removeInstanceID(variant_ptr); // clear memory free(variant_ptr); // We need the context 0 for backwards compatibility with the Java side IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &response); response += " JavaScriptFinalize"; plugin_to_java_bus->post(response.c_str()); } /** * Fetches the URL and loads it into the given target * * @param message_parts The request message. */ void PluginRequestProcessor::loadURL(std::vector* message_parts) { int id = atoi(message_parts->at(1)->c_str()); AsyncCallThreadData thread_data = AsyncCallThreadData(); thread_data.result_ready = false; thread_data.parameters = std::vector(); thread_data.result = std::string(); NPP instance; get_instance_from_id(id, instance); // If instance is invalid, do not proceed further if (!instance) return; thread_data.parameters.push_back(instance); thread_data.parameters.push_back(message_parts->at(5)); // push url thread_data.parameters.push_back(message_parts->at(6)); // push target thread_data.result_ready = false; IcedTeaPluginUtilities::callAndWaitForResult(instance, &_loadURL, &thread_data); } static void queue_cleanup(void* data) { PLUGIN_DEBUG("Queue processing stopped.\n"); } static void queue_wait_cleanup(void* data) { pthread_mutex_unlock((pthread_mutex_t*) data); } void* queue_processor(void* data) { PluginRequestProcessor* processor = (PluginRequestProcessor*) data; processor->queueProcessorThread(); return NULL; } void PluginRequestProcessor::queueProcessorThread() { std::vector* message_parts = NULL; std::string command; PLUGIN_DEBUG("Queue processor initialized. Queue = %p\n", message_queue); pthread_cleanup_push(queue_cleanup, NULL); while (true) { pthread_mutex_lock(&message_queue_mutex); if (message_queue->size() > 0) { message_parts = message_queue->front(); message_queue->erase(message_queue->begin()); } pthread_mutex_unlock(&message_queue_mutex); if (message_parts) { command = *(message_parts->at(4)); if (command == "GetMember") { sendMember(message_parts); } else if (command == "ToString") { sendString(message_parts); } else if (command == "SetMember") { // write methods are synchronized pthread_mutex_lock(&syn_write_mutex); setMember(message_parts); pthread_mutex_unlock(&syn_write_mutex); } else if (command == "Call") { // write methods are synchronized pthread_mutex_lock(&syn_write_mutex); call(message_parts); pthread_mutex_unlock(&syn_write_mutex); } else if (command == "Eval") { // write methods are synchronized pthread_mutex_lock(&syn_write_mutex); eval(message_parts); pthread_mutex_unlock(&syn_write_mutex); } else if (command == "GetSlot") { // write methods are synchronized pthread_mutex_lock(&syn_write_mutex); sendMember(message_parts); pthread_mutex_unlock(&syn_write_mutex); } else if (command == "SetSlot") { // write methods are synchronized pthread_mutex_lock(&syn_write_mutex); setMember(message_parts); pthread_mutex_unlock(&syn_write_mutex); } else if (command == "LoadURL") // For instance X url { // write methods are synchronized pthread_mutex_lock(&syn_write_mutex); loadURL(message_parts); pthread_mutex_unlock(&syn_write_mutex); } else { // Nothing matched IcedTeaPluginUtilities::printStringPtrVector("Error: Unable to process message: ", message_parts); } // Free memory for message_parts IcedTeaPluginUtilities::freeStringPtrVector(message_parts); } else { pthread_mutex_lock(&message_queue_mutex); if (message_queue->size() == 0) { pthread_cleanup_push(queue_wait_cleanup, &message_queue_mutex); pthread_cond_wait(&cond_message_available, &message_queue_mutex); pthread_cleanup_pop(0); } pthread_mutex_unlock(&message_queue_mutex); } message_parts = NULL; pthread_testcancel(); } pthread_cleanup_pop(1); } /****************************************** * Functions delegated to the main thread * ******************************************/ void _setMember(void* data) { std::string* value; NPP instance; NPVariant value_variant = NPVariant(); NPObject* member; NPIdentifier property_identifier; std::vector parameters = ((AsyncCallThreadData*) data)->parameters; instance = (NPP) parameters.at(0); member = (NPObject*) parameters.at(1); std::string* property_id = (std::string*) parameters.at(2); value = (std::string*) parameters.at(3); bool* int_identifier = (bool*) parameters.at(4); if(*int_identifier==true) property_identifier = browser_functions.getintidentifier(atoi(property_id->c_str())); else property_identifier = browser_functions.getstringidentifier(property_id->c_str()); PLUGIN_DEBUG("Setting %s on instance %p, object %p to value %s\n", IcedTeaPluginUtilities::NPIdentifierAsString(property_identifier).c_str(), instance, member, value->c_str()); IcedTeaPluginUtilities::javaResultToNPVariant(instance, value, &value_variant); ((AsyncCallThreadData*) data)->call_successful = browser_functions.setproperty(instance, member, property_identifier, &value_variant); ((AsyncCallThreadData*) data)->result_ready = true; } void _getMember(void* data) { NPObject* parent_ptr; NPVariant* member_ptr = new NPVariant(); std::string member_ptr_str = std::string(); NPP instance; std::vector parameters = ((AsyncCallThreadData*) data)->parameters; instance = (NPP) parameters.at(0); parent_ptr = (NPObject*) parameters.at(1); std::string* member_id = (std::string*) parameters.at(2); NPIdentifier member_identifier; bool* int_identifier = (bool*) parameters.at(3); if(*int_identifier==true) member_identifier = browser_functions.getintidentifier(atoi(member_id->c_str())); else member_identifier = browser_functions.getstringidentifier(member_id->c_str()); // Get the NPVariant corresponding to this member PLUGIN_DEBUG("Looking for %p %p %p (%s)\n", instance, parent_ptr, member_identifier, IcedTeaPluginUtilities::NPIdentifierAsString(member_identifier).c_str()); if (!browser_functions.hasproperty(instance, parent_ptr, member_identifier)) { PLUGIN_ERROR("%s not found!\n", IcedTeaPluginUtilities::NPIdentifierAsString(member_identifier).c_str()); } ((AsyncCallThreadData*) data)->call_successful = browser_functions.getproperty(instance, parent_ptr, member_identifier, member_ptr); IcedTeaPluginUtilities::printNPVariant(*member_ptr); if (((AsyncCallThreadData*) data)->call_successful) { createJavaObjectFromVariant(instance, *member_ptr, &member_ptr_str); ((AsyncCallThreadData*) data)->result.append(member_ptr_str); } else { ((AsyncCallThreadData*) data)->result.append("null"); } ((AsyncCallThreadData*) data)->result_ready = true; // store member -> instance link IcedTeaPluginUtilities::storeInstanceID(member_ptr, instance); PLUGIN_DEBUG("_getMember returning.\n"); } void _eval(void* data) { NPP instance; NPObject* window_ptr; std::string* script_str; NPIdentifier script_identifier; NPString script = NPString(); NPVariant* eval_variant = new NPVariant(); std::string eval_variant_str = std::string(); PLUGIN_DEBUG("_eval called\n"); std::vector* call_data = (std::vector*) data; instance = (NPP) call_data->at(0); window_ptr = (NPObject*) call_data->at(1); script_str = (std::string*) call_data->at(2); script.UTF8Characters = script_str->c_str(); script.UTF8Length = script_str->size(); PLUGIN_DEBUG("Evaluating: %s\n", script_str->c_str()); ((AsyncCallThreadData*) data)->call_successful = browser_functions.evaluate(instance, window_ptr, &script, eval_variant); IcedTeaPluginUtilities::printNPVariant(*eval_variant); if (((AsyncCallThreadData*) data)->call_successful) { if (eval_variant) { createJavaObjectFromVariant(instance, *eval_variant, &eval_variant_str); } else { eval_variant_str = "0"; } } else { eval_variant_str = "0"; } ((AsyncCallThreadData*) data)->result.append(eval_variant_str); ((AsyncCallThreadData*) data)->result_ready = true; PLUGIN_DEBUG("_eval returning\n"); } void _call(void* data) { NPP instance; NPObject* window_ptr; std::string* function_name; NPIdentifier function; int* arg_count; NPVariant* args; NPVariant* call_result = new NPVariant(); std::string call_result_ptr_str = std::string(); PLUGIN_DEBUG("_call called\n"); std::vector* call_data = (std::vector*) data; instance = (NPP) call_data->at(0); window_ptr = (NPObject*) call_data->at(1); function_name = (std::string*) call_data->at(2); function = browser_functions.getstringidentifier(function_name->c_str()); arg_count = (int*) call_data->at(3); args = (NPVariant*) call_data->at(4); for (int i=0; i < *arg_count; i++) { IcedTeaPluginUtilities::printNPVariant(args[i]); } PLUGIN_DEBUG("_calling\n"); ((AsyncCallThreadData*) data)->call_successful = browser_functions.invoke(instance, window_ptr, function, args, *arg_count, call_result); PLUGIN_DEBUG("_called\n"); IcedTeaPluginUtilities::printNPVariant(*call_result); if (((AsyncCallThreadData*) data)->call_successful) { if (call_result) { createJavaObjectFromVariant(instance, *call_result, &call_result_ptr_str); } else { call_result_ptr_str = "0"; } } else { call_result_ptr_str = "0"; } ((AsyncCallThreadData*) data)->result.append(call_result_ptr_str); ((AsyncCallThreadData*) data)->result_ready = true; PLUGIN_DEBUG("_call returning\n"); } void _getString(void* data) { NPP instance; NPObject* object; NPIdentifier toString = browser_functions.getstringidentifier("toString"); NPVariant tostring_result; std::string result = std::string(); std::vector* call_data = (std::vector*) data; instance = (NPP) call_data->at(0); NPVariant* variant = (NPVariant*) call_data->at(1); PLUGIN_DEBUG("_getString called with %p and %p\n", instance, variant); if (NPVARIANT_IS_OBJECT(*variant)) { ((AsyncCallThreadData*) data)->call_successful = browser_functions.invoke(instance, NPVARIANT_TO_OBJECT(*variant), toString, NULL, 0, &tostring_result); } else { IcedTeaPluginUtilities::NPVariantToString(*variant, &result); tostring_result = NPVariant(); STRINGZ_TO_NPVARIANT(result.c_str(), tostring_result); ((AsyncCallThreadData*) data)->call_successful = true; } PLUGIN_DEBUG("ToString result: "); IcedTeaPluginUtilities::printNPVariant(tostring_result); if (((AsyncCallThreadData*) data)->call_successful) { createJavaObjectFromVariant(instance, tostring_result, &(((AsyncCallThreadData*) data)->result)); } else { ((AsyncCallThreadData*) data)->result.append("null"); } ((AsyncCallThreadData*) data)->result_ready = true; PLUGIN_DEBUG("_getString returning\n"); } void _loadURL(void* data) { PLUGIN_DEBUG("_loadURL called\n"); NPP instance; std::string* url; std::string* target; std::vector parameters = ((AsyncCallThreadData*) data)->parameters; instance = (NPP) parameters.at(0); url = (std::string*) parameters.at(1); target = (std::string*) parameters.at(2); PLUGIN_DEBUG("Launching %s in %s\n", url->c_str(), target->c_str()); // Each decode can expand to 4 chars at the most gchar* decoded_url = (gchar*) calloc(strlen(url->c_str())*4 + 1, sizeof(gchar)); IcedTeaPluginUtilities::decodeURL(url->c_str(), &decoded_url); ((AsyncCallThreadData*) data)->call_successful = (*browser_functions.geturl) (instance, decoded_url, target->c_str()); ((AsyncCallThreadData*) data)->result_ready = true; free(decoded_url); decoded_url = NULL; PLUGIN_DEBUG("_loadURL returning %d\n", ((AsyncCallThreadData*) data)->call_successful); } icedtea-web-1.6.2/plugin/icedteanp/PaxHeaders.17941/IcedTeaParseProperties.h0000644000000000000000000000013112654402377023415 xustar0030 mtime=1454507263.214432888 29 atime=1454507327.17157991 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/icedteanp/IcedTeaParseProperties.h0000644000175000002070000000453612654402377024151 0ustar00jvanekmock00000000000000/* IcedTeaPluginUtils.h Copyright (C) 2013 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ /** * Utility classes for parsing values from properties files */ #include #include //public api std::string user_properties_file(); std::string get_log_dir(); bool find_system_config_file(std::string& dest); bool find_custom_jre(std::string& dest); bool read_deploy_property_value(std::string property, std::string& dest); bool is_debug_on(); bool is_debug_header_on(); bool is_logging_to_file(); bool is_logging_to_stds(); bool is_logging_to_system(); bool is_java_console_enabled(); //half public api extern const std::string default_file_ITW_deploy_props_name; extern const std::string default_itw_log_dir_name; extern const std::string custom_jre_key; //end of public api icedtea-web-1.6.2/plugin/icedteanp/PaxHeaders.17941/IcedTeaParseProperties.cc0000644000000000000000000000013112654402377023553 xustar0030 mtime=1454507263.214432888 29 atime=1454507327.17157991 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/icedteanp/IcedTeaParseProperties.cc0000644000175000002070000002366512654402377024313 0ustar00jvanekmock00000000000000/* IcedTeaRunnable.cc Copyright (C) 2013 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #include #include #include #include #include #include #include #include #include #include #include #include "IcedTeaPluginUtils.h" #include "IcedTeaNPPlugin.h" #include "IcedTeaParseProperties.h" /* The public api is nearly impossible to test due to "hardcoded paths" All public methods have theirs equivalents wit set-up-able files, and those are tested. */ using namespace std; //private api void remove_all_spaces(string& str); bool get_property_value(string c, string& dest); bool starts_with(string c1, string c2); string user_properties_file(); string main_properties_file(); string default_java_properties_file(); //for passing three dummy files bool find_system_config_file(string main_file, string custom_jre_file, bool usecustom_jre, string default_java_file, string& dest); bool find_property(string filename, string property, string& dest); //for passing two dummy files bool read_deploy_property_value(string user_file, string system_file, bool usesystem_file, string property, string& dest); //for passing two dummy files bool find_custom_jre(string user_file, string main_file,string& dest); //end of non-public IcedTeaParseProperties api const std::string default_file_ITW_deploy_props_name = "deployment.properties"; const std::string default_itw_log_dir_name = "log"; const std::string custom_jre_key = "deployment.jre.dir"; void remove_all_spaces(string& str) { for(int i=0; ipw_dir)+"/.icedtea/"+default_file_ITW_deploy_props_name; //exists? then itw was not yet migrated. Use it if (IcedTeaPluginUtilities::file_exists(old_name)) { PLUGIN_ERROR("IcedTea-Web plugin is using out-dated configuration\n"); return old_name; } //we are probably on XDG specification now //is specified custom value? if (getenv ("XDG_CONFIG_HOME") != NULL){ return string(getenv ("XDG_CONFIG_HOME"))+"/icedtea-web/"+default_file_ITW_deploy_props_name; } //if not then use default return string(mypasswd->pw_dir)+"/.config/icedtea-web/"+default_file_ITW_deploy_props_name; } string get_log_dir(){ string value; if (!read_deploy_property_value("deployment.user.logdir", value)) { string config_dir; if (getenv ("XDG_CONFIG_HOME") != NULL){ config_dir = string(getenv("XDG_CONFIG_HOME")); } else { int myuid = getuid(); struct passwd *mypasswd = getpwuid(myuid); config_dir = string(mypasswd->pw_dir) + "/.config"; } string itw_dir = config_dir+"/icedtea-web"; string log_dir = itw_dir+"/"+default_itw_log_dir_name; bool created_config = IcedTeaPluginUtilities::create_dir(itw_dir); bool created_log = IcedTeaPluginUtilities::create_dir(log_dir); if (!created_config || !created_log){ PLUGIN_ERROR("IcedTea-Web log directory creation failed. IcedTea-Web may fail to work!"); } return log_dir; } return value; } string main_properties_file(){ return "/etc/.java/deployment/"+default_file_ITW_deploy_props_name; } string default_java_properties_file(){ return ICEDTEA_WEB_JRE "/lib/"+default_file_ITW_deploy_props_name; } /* this is the same search done by icedtea-web settings: try the main file in /etc/.java/deployment if found, then return this file try to find setUp jre if found, then try if this file exists and end if no jre custom jvm is set, then tries default jre if its deploy file exists, then return not found otherwise*/ bool find_system_config_file(string& dest){ string jdest; bool found = find_custom_jre(jdest); if (found) { jdest = jdest + "/lib/"+default_file_ITW_deploy_props_name; } return find_system_config_file(main_properties_file(), jdest, found, default_java_properties_file(), dest); } bool is_java_console_enabled(){ string value; if (!read_deploy_property_value("deployment.console.startup.mode", value)) { return true; } if (value == "DISABLE") { return false; } else { return true; } } bool read_bool_property(string key, bool defaultValue){ string value; if (!read_deploy_property_value(key, value)) { return defaultValue; } if (value == "true") { return true; } else { return false; } } bool is_debug_on(){ return read_bool_property("deployment.log",false); } bool is_debug_header_on(){ return read_bool_property("deployment.log.headers",false); } bool is_logging_to_file(){ return read_bool_property("deployment.log.file",false); } bool is_logging_to_stds(){ return read_bool_property("deployment.log.stdstreams",true); } bool is_logging_to_system(){ return read_bool_property("deployment.log.system",true); } //abstraction for testing purposes bool find_system_config_file(string main_file, string custom_jre_file, bool usecustom_jre, string default_java_file, string& dest){ if (IcedTeaPluginUtilities::file_exists(main_file)) { dest = main_file; return true; } else { if (usecustom_jre){ if(IcedTeaPluginUtilities::file_exists(custom_jre_file) ) { dest = custom_jre_file; return true; } } else { if(IcedTeaPluginUtilities::file_exists(default_java_file)) { dest = default_java_file; return true; } } } return false; //nothing of above found } //Returns whether property was found, if found stores result in 'dest' bool find_property(string filename, string property, string& dest){ string property_matcher(property); IcedTeaPluginUtilities::trim( property_matcher); property_matcher= property_matcher+"="; ifstream input( filename.c_str() ); for( string line; getline( input, line ); ){ /* read a line */ string copy = line; //java tolerates spaces around = char, remove them for matching remove_all_spaces(copy); if (starts_with(copy, property_matcher)) { //provide non-spaced value, trimming is done in get_property_value get_property_value(line, dest); return true; } } return false; } /* this is reimplementation of itw-settings operations first check in user's settings, if found, return then check in global file (see the magic of find_system_config_file)*/ bool read_deploy_property_value(string property, string& dest){ string futurefile; bool found = find_system_config_file(futurefile); return read_deploy_property_value(user_properties_file(), futurefile, found, property, dest); } //abstraction for testing purposes bool read_deploy_property_value(string user_file, string system_file, bool usesystem_file, string property, string& dest){ //is it in user's file? bool found = find_property(user_file, property, dest); if (found) { return true; } //is it in global file? if (usesystem_file) { return find_property(system_file, property, dest); } return false; } //This is different from common get property, as it is avoiding to search in *java* //properties files bool find_custom_jre(string& dest){ return find_custom_jre(user_properties_file(), main_properties_file(), dest); } //abstraction for testing purposes bool find_custom_jre(string user_file, string main_file,string& dest){ string key = custom_jre_key; if(IcedTeaPluginUtilities::file_exists(user_file)) { bool a = find_property(user_file, key, dest); if (a) { return true; } } if(IcedTeaPluginUtilities::file_exists(main_file)) { return find_property(main_file, key, dest); } return false; } int test_main(void){ cout << ("user's settings file\n"); cout << user_properties_file(); cout << ("\nmain settings file:\n"); cout << (main_properties_file()); cout << ("\njava settings file \n"); cout << (default_java_properties_file()); cout << ("\nsystem config file\n"); string a1; find_system_config_file(a1); cout << a1; cout << ("\ncustom jre\n"); string a2; find_custom_jre(a2); cout << a2; cout << ("\nsome custom property\n"); string a3; read_deploy_property_value("deployment.security.level", a3); cout << a3; cout << ("\n"); return 0; } icedtea-web-1.6.2/plugin/icedteanp/PaxHeaders.17941/IcedTeaNPPlugin.h0000644000000000000000000000013112654402377021762 xustar0030 mtime=1454507263.214432888 29 atime=1454507327.17157991 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/icedteanp/IcedTeaNPPlugin.h0000644000175000002070000001335212654402377022512 0ustar00jvanekmock00000000000000/* IcedTeaNPPlugin.h Copyright (C) 2009, 2010 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #ifndef __ICEDTEANPPLUGIN_H__ #define __ICEDTEANPPLUGIN_H__ #include #include #include // GLib includes. #include #include #include "IcedTeaPluginUtils.h" #include "IcedTeaPluginRequestProcessor.h" // ITNPPluginData stores all the data associated with a single plugin // instance. A separate plugin instance is created for each // tag. For now, each plugin instance spawns its own applet viewer // process but this may need to change if we find pages containing // multiple applets that expect to be running in the same VM. struct ITNPPluginData { // A unique identifier for this plugin window. gchar* instance_id; // The parameter list string sent to Java side gchar* parameters_string; // Mutex to protect appletviewer_alive. GMutex* appletviewer_mutex; // Back-pointer to the plugin instance to which this data belongs. // This should not be freed but instead simply set to NULL. NPP owner; // The address of the plugin window. This should not be freed but // instead simply set to NULL. gpointer window_handle; // The last plugin window width sent to us by the browser. guint32 window_width; // The last plugin window height sent to us by the browser. guint32 window_height; // The source location for this instance std::string source; // If this is an actual applet instance, or a dummy instance for static calls bool is_applet_instance; ITNPPluginData() { instance_id = NULL; parameters_string = NULL; appletviewer_mutex = NULL; owner = (NPP)NULL; window_handle = NULL; window_width = 0; window_height = 0; is_applet_instance = false; } ~ITNPPluginData() { if (appletviewer_mutex) { g_mutex_free (appletviewer_mutex); } // cleanup_instance_string: g_free (instance_id); // cleanup applet tag g_free (parameters_string); } }; // Have the browser allocate a new ITNPPluginData structure. ITNPPluginData* plugin_data_new (); void plugin_data_destroy (NPP instance); NPError initialize_data_directory(); NPError start_jvm_if_needed(); // ID of plug-in thread extern pthread_t itnp_plugin_thread_id; /* Mutex around plugin async call queue ops */ extern pthread_mutex_t pluginAsyncCallMutex; /*to sync pipe to apletviewer console*/ extern pthread_mutex_t debug_pipe_lock; // debug switches extern bool debug_initiated; extern bool file_logs_initiated; extern int plugin_debug; extern bool plugin_debug_headers; extern bool plugin_debug_to_file; extern bool plugin_debug_to_streams; extern bool plugin_debug_to_system; extern bool plugin_debug_to_console; extern FILE * plugin_file_log; extern std::string plugin_file_log_name; extern gchar* debug_pipe_name; extern gboolean jvm_up; // Browser function table. extern NPNetscapeFuncs browser_functions; // messages to the java side extern MessageBus* plugin_to_java_bus; // messages from the java side extern MessageBus* java_to_plugin_bus; // internal messages (e.g ones that need processing in main thread) //extern MessageBus* internal_bus; // subscribes to plugin_to_java_bus and sends messages over the link extern JavaMessageSender java_request_processor; // processes requests made to the plugin extern PluginRequestProcessor plugin_request_processor; /* Given an instance pointer, return its id */ void get_instance_from_id(int id, NPP& instance); /* Given an instance id, return its pointer */ int get_id_from_instance(NPP instance); /* Sends a message to the appletviewer */ void plugin_send_message_to_appletviewer(gchar const* message); /*this method is not logging, do not add \n and is using different pipe*/ void plugin_send_message_to_appletviewer_console(gchar const* message); void flush_plugin_send_message_to_appletviewer_console(); /* Returns an appropriate (package/object) scriptable npobject */ NPObject* get_scriptable_object(NPP instance); /* Creates a new scriptable plugin object and returns it */ NPObject* allocate_scriptable_object(NPP npp, NPClass *aClass); NPError plugin_start_appletviewer (ITNPPluginData* data); #endif /* __ICEDTEANPPLUGIN_H__ */ icedtea-web-1.6.2/plugin/icedteanp/PaxHeaders.17941/IcedTeaNPPlugin.cc0000644000000000000000000000013112654402377022120 xustar0030 mtime=1454507263.213432901 29 atime=1454507327.17157991 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/icedteanp/IcedTeaNPPlugin.cc0000644000175000002070000022115012654402377022645 0ustar00jvanekmock00000000000000/* IcedTeaNPPlugin.cc -- web browser plugin to execute Java applets Copyright (C) 2003, 2004, 2006, 2007 Free Software Foundation, Inc. Copyright (C) 2009, 2010 Red Hat This file is part of GNU Classpath. GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GNU Classpath is distributed in the hope that it will be 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 GNU Classpath; 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. */ // System includes. #include #include #include #include #include #include #include #include #include #include #include #include #include #include //IcedTea-plugin includes #include "IcedTeaPluginUtils.h" #include "IcedTeaParseProperties.h" // Liveconnect extension #include "IcedTeaScriptablePluginObject.h" #include "IcedTeaNPPlugin.h" // Plugin information passed to about:plugins. #define PLUGIN_FULL_NAME PLUGIN_NAME " (using " PLUGIN_VERSION ")" #define PLUGIN_DESC "The " PLUGIN_NAME " executes Java applets." #ifdef HAVE_JAVA9 #define JPI_VERSION "1.9.0_" JDK_UPDATE_VERSION #define PLUGIN_APPLET_MIME_DESC \ "application/x-java-applet;version=1.8:class,jar:IcedTea;"\ "application/x-java-applet;version=1.9:class,jar:IcedTea;" #define PLUGIN_BEAN_MIME_DESC \ "application/x-java-bean;version=1.8:class,jar:IcedTea;" \ "application/x-java-bean;version=1.9:class,jar:IcedTea;" #elif HAVE_JAVA8 #define JPI_VERSION "1.8.0_" JDK_UPDATE_VERSION #define PLUGIN_APPLET_MIME_DESC \ "application/x-java-applet;version=1.8:class,jar:IcedTea;" #define PLUGIN_BEAN_MIME_DESC \ "application/x-java-bean;version=1.8:class,jar:IcedTea;" #else #define JPI_VERSION "1.7.0_" JDK_UPDATE_VERSION #define PLUGIN_APPLET_MIME_DESC #define PLUGIN_BEAN_MIME_DESC #endif #define PLUGIN_MIME_DESC \ "application/x-java-vm:class,jar:IcedTea;" \ "application/x-java-applet:class,jar:IcedTea;" \ "application/x-java-applet;version=1.1:class,jar:IcedTea;" \ "application/x-java-applet;version=1.1.1:class,jar:IcedTea;" \ "application/x-java-applet;version=1.1.2:class,jar:IcedTea;" \ "application/x-java-applet;version=1.1.3:class,jar:IcedTea;" \ "application/x-java-applet;version=1.2:class,jar:IcedTea;" \ "application/x-java-applet;version=1.2.1:class,jar:IcedTea;" \ "application/x-java-applet;version=1.2.2:class,jar:IcedTea;" \ "application/x-java-applet;version=1.3:class,jar:IcedTea;" \ "application/x-java-applet;version=1.3.1:class,jar:IcedTea;" \ "application/x-java-applet;version=1.4:class,jar:IcedTea;" \ "application/x-java-applet;version=1.4.1:class,jar:IcedTea;" \ "application/x-java-applet;version=1.4.2:class,jar:IcedTea;" \ "application/x-java-applet;version=1.5:class,jar:IcedTea;" \ "application/x-java-applet;version=1.6:class,jar:IcedTea;" \ "application/x-java-applet;version=1.7:class,jar:IcedTea;" \ PLUGIN_APPLET_MIME_DESC \ "application/x-java-applet;jpi-version=" JPI_VERSION ":class,jar:IcedTea;" \ "application/x-java-bean:class,jar:IcedTea;" \ "application/x-java-bean;version=1.1:class,jar:IcedTea;" \ "application/x-java-bean;version=1.1.1:class,jar:IcedTea;" \ "application/x-java-bean;version=1.1.2:class,jar:IcedTea;" \ "application/x-java-bean;version=1.1.3:class,jar:IcedTea;" \ "application/x-java-bean;version=1.2:class,jar:IcedTea;" \ "application/x-java-bean;version=1.2.1:class,jar:IcedTea;" \ "application/x-java-bean;version=1.2.2:class,jar:IcedTea;" \ "application/x-java-bean;version=1.3:class,jar:IcedTea;" \ "application/x-java-bean;version=1.3.1:class,jar:IcedTea;" \ "application/x-java-bean;version=1.4:class,jar:IcedTea;" \ "application/x-java-bean;version=1.4.1:class,jar:IcedTea;" \ "application/x-java-bean;version=1.4.2:class,jar:IcedTea;" \ "application/x-java-bean;version=1.5:class,jar:IcedTea;" \ "application/x-java-bean;version=1.6:class,jar:IcedTea;" \ "application/x-java-bean;version=1.7:class,jar:IcedTea;" \ PLUGIN_BEAN_MIME_DESC \ "application/x-java-bean;jpi-version=" JPI_VERSION ":class,jar:IcedTea;" \ "application/x-java-vm-npruntime::IcedTea;" #define PLUGIN_URL NS_INLINE_PLUGIN_CONTRACTID_PREFIX NS_JVM_MIME_TYPE #define PLUGIN_MIME_TYPE "application/x-java-vm" #define PLUGIN_FILE_EXTS "class,jar,zip" #define PLUGIN_MIME_COUNT 1 #define FAILURE_MESSAGE "icedteanp plugin error: Failed to run %s." \ " For more detail rerun \"firefox -g\" in a terminal window." // Data directory for plugin. static std::string data_directory; static DIR *data_directory_descriptor; // Fully-qualified appletviewer default executable and rt.jar static const char* appletviewer_default_executable = ICEDTEA_WEB_JRE "/bin/java"; static const char* appletviewer_default_rtjar = ICEDTEA_WEB_JRE "/lib/rt.jar"; //javaws name and binary static const char* javaws_bin_property = "-Dicedtea-web.bin.location=" JAVAWS_BIN; static const char* javaws_name_property = "-Dicedtea-web.bin.name=" JAVAWS_NAME; // Applet viewer input channel (needs to be static because it is used in plugin_in_pipe_callback) static GIOChannel* in_from_appletviewer = NULL; // Applet viewer input pipe name. gchar* in_pipe_name; // Applet viewer input watch source. gint in_watch_source; // Applet viewer output pipe name. gchar* out_pipe_name; // Applet viewer debug pipe name. gchar* debug_pipe_name = NULL; // Applet viewer output watch source. gint out_watch_source; // Thread ID of plug-in thread pthread_t itnp_plugin_thread_id; // Mutex to lock async call queue pthread_mutex_t pluginAsyncCallMutex; /*to sync pipe to apletviewer console*/ pthread_mutex_t debug_pipe_lock = PTHREAD_MUTEX_INITIALIZER; // Applet viewer output channel. GIOChannel* out_to_appletviewer; // Applet viewer debug channel. GIOChannel* debug_to_appletviewer = NULL; // Tracks jvm status gboolean jvm_up = FALSE; // Keeps track of initialization. NP_Initialize should only be // called once. gboolean initialized = false; // browser functions into mozilla NPNetscapeFuncs browser_functions; // Various message buses carrying information to/from Java, and internally MessageBus* plugin_to_java_bus; MessageBus* java_to_plugin_bus; //MessageBus* internal_bus = new MessageBus(); // Processor for plugin requests PluginRequestProcessor* plugin_req_proc; // Sends messages to Java over the bus JavaMessageSender* java_req_proc; // Queue processing threads static pthread_t plugin_request_processor_thread1; static pthread_t plugin_request_processor_thread2; static pthread_t plugin_request_processor_thread3; // Static instance helper functions. // Retrieve the current document's documentbase. static std::string plugin_get_documentbase (NPP instance); // Callback used to monitor input pipe status. static gboolean plugin_in_pipe_callback (GIOChannel* source, GIOCondition condition, gpointer plugin_data); // Callback used to monitor output pipe status. static gboolean plugin_out_pipe_callback (GIOChannel* source, GIOCondition condition, gpointer plugin_data); std::string plugin_parameters_string (int argc, char* argn[], char* argv[]); static void plugin_stop_appletviewer (); NPError get_cookie_info(const char* siteAddr, char** cookieString, uint32_t* len); NPError get_proxy_info(const char* siteAddr, char** proxy, uint32_t* len); void consume_message(gchar* message); static void appletviewer_monitor(GPid pid, gint status, gpointer data); void plugin_send_initialization_message(char* instance, gulong handle, int width, int height, char* url); /* Returns JVM options set in itw-settings */ std::vector* get_jvm_args(); // Global instance counter. // Mutex to protect plugin_instance_counter. static GMutex* plugin_instance_mutex = NULL; // A global variable for reporting GLib errors. This must be free'd // and set to NULL after each use. static GError* channel_error = NULL; static GHashTable* instance_to_id_map = g_hash_table_new(NULL, NULL); static GHashTable* id_to_instance_map = g_hash_table_new(NULL, NULL); static gint instance_counter = 1; static GPid appletviewer_pid = -1; static guint appletviewer_watch_id = -1; bool debug_initiated = false; bool file_logs_initiated = false; int plugin_debug = getenv ("ICEDTEAPLUGIN_DEBUG") != NULL; bool plugin_debug_headers = false; bool plugin_debug_to_file = false ; bool plugin_debug_to_streams = true ; bool plugin_debug_to_system = false; bool plugin_debug_to_console = true; FILE * plugin_file_log = NULL; std::string plugin_file_log_name; int plugin_debug_suspend = (getenv("ICEDTEAPLUGIN_DEBUG") != NULL) && (strcmp(getenv("ICEDTEAPLUGIN_DEBUG"), "suspend") == 0); #ifdef LEGACY_GLIB // Returns key from first item stored in hashtable gboolean find_first_item_in_hash_table(gpointer key, gpointer value, gpointer user_data) { user_data = key; return (gboolean)TRUE; } int g_strcmp0(char *str1, char *str2) { if (str1 != NULL) return str2 != NULL ? strcmp(str1, str2) : 1; else // str1 == NULL return str2 != NULL ? 1 : 0; } #endif static std::string get_plugin_executable(){ std::string custom_jre; bool custom_jre_defined = find_custom_jre(custom_jre); if (custom_jre_defined) { if (IcedTeaPluginUtilities::file_exists(custom_jre+"/bin/java")){ return custom_jre+"/bin/java"; } else { PLUGIN_ERROR("Your custom jre (/bin/java check) %s is not valid. Please fix %s in your %s. In attempt to run using default one. \n", custom_jre.c_str(), custom_jre_key.c_str(), default_file_ITW_deploy_props_name.c_str()); } } return appletviewer_default_executable; } static std::string get_plugin_rt_jar(){ std::string custom_jre; bool custom_jre_defined = find_custom_jre(custom_jre); if (custom_jre_defined) { if (IcedTeaPluginUtilities::file_exists(custom_jre+"/lib/rt.jar")){ return custom_jre+"/lib/rt.jar"; } else { PLUGIN_ERROR("Your custom jre (/lib/rt.jar check) %s is not valid. Please fix %s in your %s. In attempt to run using default one. \n", custom_jre.c_str(), custom_jre_key.c_str(), default_file_ITW_deploy_props_name.c_str()); } } return appletviewer_default_rtjar; } static void cleanUpDir(){ //free data_directory descriptor if (data_directory_descriptor != NULL) { closedir(data_directory_descriptor); } //clean up pipes directory PLUGIN_DEBUG ("Removing runtime directory %s \n", data_directory.c_str()); int removed = rmdir(data_directory.c_str()); if (removed != 0) { PLUGIN_ERROR ("Failed to remove runtime directory %s, because of %s \n", data_directory.c_str(), strerror(errno)); } else { PLUGIN_DEBUG ("Removed runtime directory %s \n", data_directory.c_str()); } data_directory_descriptor = NULL; } /* * Find first member in GHashTable* depending on version of glib */ gpointer getFirstInTableInstance(GHashTable* table) { gpointer id, instance; #ifndef LEGACY_GLIB GHashTableIter iter; g_hash_table_iter_init (&iter, table); g_hash_table_iter_next (&iter, &instance, &id); #else g_hash_table_find(table, (GHRFunc)find_first_item_in_hash_table, &instance); #endif return instance; } // Functions prefixed by ITNP_ are instance functions. They are called // by the browser and operate on instances of ITNPPluginData. // Functions prefixed by plugin_ are static helper functions. // Functions prefixed by NP_ are factory functions. They are called // by the browser and provide functionality needed to create plugin // instances. // INSTANCE FUNCTIONS // Creates a new icedtea np plugin instance. This function creates a // ITNPPluginData* and stores it in instance->pdata. The following // ITNPPluginData fields are initialized: instance_id, in_pipe_name, // in_from_appletviewer, in_watch_source, out_pipe_name, // out_to_appletviewer, out_watch_source, appletviewer_mutex, owner, // appletviewer_alive. In addition two pipe files are created. All // of those fields must be properly destroyed, and the pipes deleted, // by ITNP_Destroy. If an error occurs during initialization then this // function will free anything that's been allocated so far, set // instance->pdata to NULL and return an error code. NPError ITNP_New (NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc, char* argn[], char* argv[], NPSavedData* saved) { PLUGIN_DEBUG("ITNP_New\n"); static NPObject *window_ptr; NPIdentifier identifier; NPVariant member_ptr; browser_functions.getvalue(instance, NPNVWindowNPObject, &window_ptr); identifier = browser_functions.getstringidentifier("document"); if (!browser_functions.hasproperty(instance, window_ptr, identifier)) { PLUGIN_ERROR("%s not found!\n", "document"); } browser_functions.getproperty(instance, window_ptr, identifier, &member_ptr); PLUGIN_DEBUG("Got variant %p\n", &member_ptr); if (!instance) { PLUGIN_ERROR ("Browser-provided instance pointer is NULL.\n"); return NPERR_INVALID_INSTANCE_ERROR; } // data ITNPPluginData* data = plugin_data_new (); if (data == NULL) { PLUGIN_ERROR ("Failed to allocate plugin data.\n"); return NPERR_OUT_OF_MEMORY_ERROR; } // start the jvm if needed NPError startup_error = start_jvm_if_needed(); if (startup_error != NPERR_NO_ERROR) { PLUGIN_ERROR ("Failed to start JVM\n"); return startup_error; } // Initialize data->instance_id. // // instance_id should be unique for this process so we use a // combination of getpid and plugin_instance_counter. // // Critical region. Reference and increment plugin_instance_counter // global. g_mutex_lock (plugin_instance_mutex); // data->instance_id data->instance_id = g_strdup_printf ("%d", instance_counter); g_mutex_unlock (plugin_instance_mutex); // data->appletviewer_mutex data->appletviewer_mutex = g_mutex_new (); g_mutex_lock (data->appletviewer_mutex); std::string documentbase = plugin_get_documentbase (instance); // Documentbase retrieval. if (argc != 0) { // Send parameters to appletviewer. std::string params_string = plugin_parameters_string(argc, argn, argv); data->parameters_string = g_strdup_printf("tag %s %s", documentbase.c_str(), params_string.c_str()); data->is_applet_instance = true; } else { data->is_applet_instance = false; } g_mutex_unlock (data->appletviewer_mutex); // If initialization succeeded entirely then we store the plugin // data in the instance structure and return. Otherwise we free the // data we've allocated so far and set instance->pdata to NULL. // Set back-pointer to owner instance. data->owner = instance; // source of this instance // don't use documentbase, it is cleared later data->source = plugin_get_documentbase(instance); instance->pdata = data; // store an identifier for this plugin PLUGIN_DEBUG("Mapping id %d and instance %p\n", instance_counter, instance); g_hash_table_insert(instance_to_id_map, instance, GINT_TO_POINTER(instance_counter)); g_hash_table_insert(id_to_instance_map, GINT_TO_POINTER(instance_counter), instance); instance_counter++; PLUGIN_DEBUG ("ITNP_New return\n"); return NPERR_NO_ERROR; } // Starts the JVM if it is not already running NPError start_jvm_if_needed() { // This is asynchronized function. It must // have exclusivity when running. GMutex *vm_start_mutex = g_mutex_new(); g_mutex_lock(vm_start_mutex); PLUGIN_DEBUG("Checking JVM status...\n"); // If the jvm is already up, do nothing if (jvm_up) { PLUGIN_DEBUG("JVM is up. Returning.\n"); return NPERR_NO_ERROR; } PLUGIN_DEBUG("No JVM is running. Attempting to start one...\n"); NPError np_error = NPERR_NO_ERROR; ITNPPluginData* data = NULL; // Create appletviewer-to-plugin pipe which we refer to as the input // pipe. // in_pipe_name in_pipe_name = g_strdup_printf ("%s/%d-icedteanp-appletviewer-to-plugin", data_directory.c_str(), getpid()); if (!in_pipe_name) { PLUGIN_ERROR ("Failed to create input pipe name.\n"); np_error = NPERR_OUT_OF_MEMORY_ERROR; // If in_pipe_name is NULL then the g_free at // cleanup_in_pipe_name will simply return. goto cleanup_in_pipe_name; } // clean up any older pip unlink (in_pipe_name); PLUGIN_DEBUG ("ITNP_New: creating input fifo: %s\n", in_pipe_name); if (mkfifo (in_pipe_name, 0600) == -1 && errno != EEXIST) { PLUGIN_ERROR ("Failed to create input pipe\n", strerror (errno)); np_error = NPERR_GENERIC_ERROR; goto cleanup_in_pipe_name; } PLUGIN_DEBUG ("ITNP_New: created input fifo: %s\n", in_pipe_name); // Create plugin-to-appletviewer pipe which we refer to as the // output pipe. // out_pipe_name out_pipe_name = g_strdup_printf ("%s/%d-icedteanp-plugin-to-appletviewer", data_directory.c_str(), getpid()); if (!out_pipe_name) { PLUGIN_ERROR ("Failed to create output pipe name.\n"); np_error = NPERR_OUT_OF_MEMORY_ERROR; goto cleanup_out_pipe_name; } // clean up any older pip unlink (out_pipe_name); PLUGIN_DEBUG ("ITNP_New: creating output fifo: %s\n", out_pipe_name); if (mkfifo (out_pipe_name, 0600) == -1 && errno != EEXIST) { PLUGIN_ERROR ("Failed to create output pipe\n", strerror (errno)); np_error = NPERR_GENERIC_ERROR; goto cleanup_out_pipe_name; } PLUGIN_DEBUG ("ITNP_New: created output fifo: %s\n", out_pipe_name); // Create plugin-debug-to-appletviewer pipe which we refer to as the // debug pipe. initialize_debug();//should be already initialized, but... if (plugin_debug_to_console){ // debug_pipe_name debug_pipe_name = g_strdup_printf ("%s/%d-icedteanp-plugin-debug-to-appletviewer", data_directory.c_str(), getpid()); if (!debug_pipe_name) { PLUGIN_ERROR ("Failed to create debug pipe name.\n"); np_error = NPERR_OUT_OF_MEMORY_ERROR; goto cleanup_debug_pipe_name; } // clean up any older pip unlink (debug_pipe_name); PLUGIN_DEBUG ("ITNP_New: creating debug fifo: %s\n", debug_pipe_name); if (mkfifo (debug_pipe_name, 0600) == -1 && errno != EEXIST) { PLUGIN_ERROR ("Failed to create debug pipe\n", strerror (errno)); np_error = NPERR_GENERIC_ERROR; goto cleanup_debug_pipe_name; } PLUGIN_DEBUG ("ITNP_New: created debug fifo: %s\n", debug_pipe_name); } // Start a separate appletviewer process for each applet, even if // there are multiple applets in the same page. We may need to // change this behaviour if we find pages with multiple applets that // rely on being run in the same VM. np_error = plugin_start_appletviewer (data); // Create plugin-to-appletviewer channel. The default encoding for // the file is UTF-8. // out_to_appletviewer out_to_appletviewer = g_io_channel_new_file (out_pipe_name, "w", &channel_error); if (!out_to_appletviewer) { if (channel_error) { PLUGIN_ERROR ("Failed to create output channel, '%s'\n", channel_error->message); g_error_free (channel_error); channel_error = NULL; } else PLUGIN_ERROR ("Failed to create output channel\n"); np_error = NPERR_GENERIC_ERROR; goto cleanup_out_to_appletviewer; } // Watch for hangup and error signals on the output pipe. out_watch_source = g_io_add_watch (out_to_appletviewer, (GIOCondition) (G_IO_ERR | G_IO_HUP), plugin_out_pipe_callback, (gpointer) out_to_appletviewer); // Create appletviewer-to-plugin channel. The default encoding for // the file is UTF-8. // in_from_appletviewer in_from_appletviewer = g_io_channel_new_file (in_pipe_name, "r", &channel_error); if (!in_from_appletviewer) { if (channel_error) { PLUGIN_ERROR ("Failed to create input channel, '%s'\n", channel_error->message); g_error_free (channel_error); channel_error = NULL; } else PLUGIN_ERROR ("Failed to create input channel\n"); np_error = NPERR_GENERIC_ERROR; goto cleanup_in_from_appletviewer; } // Watch for hangup and error signals on the input pipe. in_watch_source = g_io_add_watch (in_from_appletviewer, (GIOCondition) (G_IO_IN | G_IO_ERR | G_IO_HUP), plugin_in_pipe_callback, (gpointer) in_from_appletviewer); // Create plugin-to-appletviewer console debug channel. The default encoding for // the file is UTF-8. // debug_to_appletviewer if (plugin_debug_to_console){ debug_to_appletviewer = g_io_channel_new_file (debug_pipe_name, "w", &channel_error); if (!debug_to_appletviewer) { if (channel_error) { PLUGIN_ERROR ("Failed to debug output channel, '%s'\n", channel_error->message); g_error_free (channel_error); channel_error = NULL; } else PLUGIN_ERROR ("Failed to create debug channel\n"); np_error = NPERR_GENERIC_ERROR; goto cleanup_debug_to_appletviewer; } } jvm_up = TRUE; if (plugin_debug_to_console){ //jvm is up, we can start console producer thread pthread_t debug_to_console_consumer; pthread_create(&debug_to_console_consumer,NULL,&flush_pre_init_messages,NULL); } goto done; // Free allocated data in case of error cleanup_debug_to_appletviewer: if (plugin_debug_to_console){ if (debug_to_appletviewer) g_io_channel_unref (debug_to_appletviewer); debug_to_appletviewer = NULL; } cleanup_in_watch_source: // Removing a source is harmless if it fails since it just means the // source has already been removed. g_source_remove (in_watch_source); in_watch_source = 0; cleanup_in_from_appletviewer: if (in_from_appletviewer) g_io_channel_unref (in_from_appletviewer); in_from_appletviewer = NULL; // cleanup_out_watch_source: g_source_remove (out_watch_source); out_watch_source = 0; cleanup_out_to_appletviewer: if (out_to_appletviewer) g_io_channel_unref (out_to_appletviewer); out_to_appletviewer = NULL; if (plugin_debug_to_console){ // cleanup_debug_pipe: // Delete output pipe. PLUGIN_DEBUG ("ITNP_New: deleting debug fifo: %s\n", debug_pipe_name); unlink (debug_pipe_name); PLUGIN_DEBUG ("ITNP_New: deleted debug fifo: %s\n", debug_pipe_name); } cleanup_debug_pipe_name: if (plugin_debug_to_console){ g_free (debug_pipe_name); debug_pipe_name = NULL; } // cleanup_out_pipe: // Delete output pipe. PLUGIN_DEBUG ("ITNP_New: deleting input fifo: %s\n", in_pipe_name); unlink (out_pipe_name); PLUGIN_DEBUG ("ITNP_New: deleted input fifo: %s\n", in_pipe_name); cleanup_out_pipe_name: g_free (out_pipe_name); out_pipe_name = NULL; // cleanup_in_pipe: // Delete input pipe. PLUGIN_DEBUG ("ITNP_New: deleting output fifo: %s\n", out_pipe_name); unlink (in_pipe_name); PLUGIN_DEBUG ("ITNP_New: deleted output fifo: %s\n", out_pipe_name); cleanup_in_pipe_name: g_free (in_pipe_name); in_pipe_name = NULL; cleanUpDir(); done: IcedTeaPluginUtilities::printDebugStatus(); // Now other threads may re-enter.. unlock the mutex g_mutex_unlock(vm_start_mutex); return np_error; } NPError ITNP_GetValue (NPP instance, NPPVariable variable, void* value) { PLUGIN_DEBUG ("ITNP_GetValue\n"); NPError np_error = NPERR_NO_ERROR; switch (variable) { // This plugin needs XEmbed support. case NPPVpluginNeedsXEmbed: { PLUGIN_DEBUG ("ITNP_GetValue: returning TRUE for NeedsXEmbed.\n"); bool* bool_value = (bool*) value; *bool_value = true; } break; case NPPVpluginScriptableNPObject: { *(NPObject **)value = get_scriptable_object(instance); } break; default: PLUGIN_ERROR ("Unknown plugin value requested.\n"); np_error = NPERR_GENERIC_ERROR; break; } PLUGIN_DEBUG ("ITNP_GetValue return\n"); return np_error; } NPError ITNP_Destroy (NPP instance, NPSavedData** save) { PLUGIN_DEBUG ("ITNP_Destroy %p\n", instance); ITNPPluginData* data = (ITNPPluginData*) instance->pdata; int id = get_id_from_instance(instance); // Let Java know that this applet needs to be destroyed gchar* msg = (gchar*) g_malloc(512*sizeof(gchar)); // 512 is more than enough. We need < 100 g_sprintf(msg, "instance %d destroy", id); plugin_send_message_to_appletviewer(msg); g_free(msg); msg = NULL; if (data) { // Free plugin data. plugin_data_destroy (instance); } g_hash_table_remove(instance_to_id_map, instance); g_hash_table_remove(id_to_instance_map, GINT_TO_POINTER(id)); IcedTeaPluginUtilities::invalidateInstance(instance); PLUGIN_DEBUG ("ITNP_Destroy return\n"); return NPERR_NO_ERROR; } NPError ITNP_SetWindow (NPP instance, NPWindow* window) { PLUGIN_DEBUG ("ITNP_SetWindow\n"); if (instance == NULL) { PLUGIN_ERROR ("Invalid instance.\n"); return NPERR_INVALID_INSTANCE_ERROR; } gpointer id_ptr = g_hash_table_lookup(instance_to_id_map, instance); gint id = 0; if (id_ptr) { id = GPOINTER_TO_INT(id_ptr); } ITNPPluginData* data = (ITNPPluginData*) instance->pdata; // Simply return if we receive a NULL window. if ((window == NULL) || (window->window == NULL)) { PLUGIN_DEBUG ("ITNP_SetWindow: got NULL window.\n"); return NPERR_NO_ERROR; } if (data->window_handle) { // The window already exists. if (data->window_handle == window->window) { // The parent window is the same as in previous calls. PLUGIN_DEBUG ("ITNP_SetWindow: window already exists.\n"); // Critical region. Read data->appletviewer_mutex and send // a message to the appletviewer. g_mutex_lock (data->appletviewer_mutex); if (jvm_up) { gboolean dim_changed = FALSE; // The window is the same as it was for the last // SetWindow call. if (window->width != data->window_width) { PLUGIN_DEBUG ("ITNP_SetWindow: window width changed.\n"); // The width of the plugin window has changed. // Store the new width. data->window_width = window->width; dim_changed = TRUE; } if (window->height != data->window_height) { PLUGIN_DEBUG ("ITNP_SetWindow: window height changed.\n"); // The height of the plugin window has changed. // Store the new height. data->window_height = window->height; dim_changed = TRUE; } if (dim_changed) { gchar* message = g_strdup_printf ("instance %d width %d height %d", id, window->width, window->height); plugin_send_message_to_appletviewer (message); g_free (message); message = NULL; } } else { // The appletviewer is not running. PLUGIN_DEBUG ("ITNP_SetWindow: appletviewer is not running.\n"); } g_mutex_unlock (data->appletviewer_mutex); } else { // The parent window has changed. This branch does run but // doing nothing in response seems to be sufficient. PLUGIN_DEBUG ("ITNP_SetWindow: parent window changed.\n"); } } else { // Else this is initialization PLUGIN_DEBUG ("ITNP_SetWindow: setting window.\n"); // Critical region. Send messages to appletviewer. g_mutex_lock (data->appletviewer_mutex); // Store the window handle and dimensions data->window_handle = window->window; data->window_width = window->width; data->window_height = window->height; // Now we have everything. Send this data to the Java side plugin_send_initialization_message( data->instance_id, (gulong) data->window_handle, data->window_width, data->window_height, data->parameters_string); g_mutex_unlock (data->appletviewer_mutex); } PLUGIN_DEBUG ("ITNP_SetWindow return\n"); return NPERR_NO_ERROR; } NPError ITNP_NewStream (NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16_t* stype) { PLUGIN_DEBUG ("ITNP_NewStream\n"); PLUGIN_DEBUG ("ITNP_NewStream return\n"); return NPERR_GENERIC_ERROR; } void ITNP_StreamAsFile (NPP instance, NPStream* stream, const char* filename) { PLUGIN_DEBUG ("ITNP_StreamAsFile\n"); PLUGIN_DEBUG ("ITNP_StreamAsFile return\n"); } NPError ITNP_DestroyStream (NPP instance, NPStream* stream, NPReason reason) { PLUGIN_DEBUG ("ITNP_DestroyStream\n"); PLUGIN_DEBUG ("ITNP_DestroyStream return\n"); return NPERR_NO_ERROR; } int32_t ITNP_WriteReady (NPP instance, NPStream* stream) { PLUGIN_DEBUG ("ITNP_WriteReady\n"); PLUGIN_DEBUG ("ITNP_WriteReady return\n"); return 0; } int32_t ITNP_Write (NPP instance, NPStream* stream, int32_t offset, int32_t len, void* buffer) { PLUGIN_DEBUG ("ITNP_Write\n"); PLUGIN_DEBUG ("ITNP_Write return\n"); return 0; } void ITNP_Print (NPP instance, NPPrint* platformPrint) { PLUGIN_DEBUG ("ITNP_Print\n"); PLUGIN_DEBUG ("ITNP_Print return\n"); } int16_t ITNP_HandleEvent (NPP instance, void* event) { PLUGIN_DEBUG ("ITNP_HandleEvent\n"); PLUGIN_DEBUG ("ITNP_HandleEvent return\n"); return 0; } void ITNP_URLNotify (NPP instance, const char* url, NPReason reason, void* notifyData) { PLUGIN_DEBUG ("ITNP_URLNotify\n"); PLUGIN_DEBUG ("ITNP_URLNotify return\n"); } NPError get_cookie_info(const char* siteAddr, char** cookieString, uint32_t* len) { // Only attempt to perform this operation if there is a valid plugin instance if (g_hash_table_size(instance_to_id_map) <= 0) { return NPERR_GENERIC_ERROR; } // getvalueforurl needs an NPP instance. Quite frankly, there is no easy way // to know which instance needs the information, as applets on Java side can // be multi-threaded and the thread making a proxy.cookie request cannot be // easily tracked. // Fortunately, XULRunner does not care about the instance as long as it is // valid. So we just pick the first valid one and use it. Proxy/Cookie // information is not instance specific anyway, it is URL specific. if (browser_functions.getvalueforurl) { gpointer instance=getFirstInTableInstance(instance_to_id_map); return browser_functions.getvalueforurl((NPP) instance, NPNURLVCookie, siteAddr, cookieString, len); } else { return NPERR_GENERIC_ERROR; } return NPERR_NO_ERROR; } static NPError set_cookie_info(const char* siteAddr, const char* cookieString, uint32_t len) { // Only attempt to perform this operation if there is a valid plugin instance if (g_hash_table_size(instance_to_id_map) > 0 && browser_functions.getvalueforurl) { // We arbitrarily use the first valid instance we can grab // For an explanation of the logic behind this, see get_cookie_info gpointer instance = getFirstInTableInstance(instance_to_id_map); return browser_functions.setvalueforurl((NPP) instance, NPNURLVCookie, siteAddr, cookieString, len); } return NPERR_GENERIC_ERROR;; } // HELPER FUNCTIONS ITNPPluginData* plugin_data_new () { PLUGIN_DEBUG ("plugin_data_new\n"); ITNPPluginData* data = (ITNPPluginData*)browser_functions.memalloc(sizeof (struct ITNPPluginData)); if (data) { // Call constructor on allocated data new (data) ITNPPluginData(); } PLUGIN_DEBUG ("plugin_data_new return\n"); return data; } // Documentbase retrieval. This function gets the current document's // documentbase. This function relies on browser-private data so it // will only work when the plugin is loaded in a Mozilla-based // browser. static std::string plugin_get_documentbase (NPP instance) { PLUGIN_DEBUG ("plugin_get_documentbase\n"); // FIXME: This method is not ideal, but there are no known NPAPI call // for this. See thread for more information: // http://www.mail-archive.com/chromium-dev@googlegroups.com/msg04844.html // Additionally, since it is insecure, we cannot use it for making // security decisions. NPObject* window; browser_functions.getvalue(instance, NPNVWindowNPObject, &window); NPVariant location; NPIdentifier location_id = browser_functions.getstringidentifier("location"); browser_functions.getproperty(instance, window, location_id, &location); NPVariant href; NPIdentifier href_id = browser_functions.getstringidentifier("href"); browser_functions.getproperty(instance, NPVARIANT_TO_OBJECT(location), href_id, &href); std::string href_str = IcedTeaPluginUtilities::NPVariantAsString(href); // Release references. browser_functions.releasevariantvalue(&href); browser_functions.releasevariantvalue(&location); PLUGIN_DEBUG ("plugin_get_documentbase return\n"); PLUGIN_DEBUG("plugin_get_documentbase returning: %s\n", href_str.c_str()); return href_str; } // plugin_in_pipe_callback is called when data is available on the // input pipe, or when the appletviewer crashes or is killed. It may // be called after data has been destroyed in which case it simply // returns FALSE to remove itself from the glib main loop. static gboolean plugin_in_pipe_callback (GIOChannel* source, GIOCondition condition, gpointer plugin_data) { PLUGIN_DEBUG ("plugin_in_pipe_callback\n"); gboolean keep_installed = TRUE; if (condition & G_IO_IN) { gchar* message = NULL; if (g_io_channel_read_line (in_from_appletviewer, &message, NULL, NULL, &channel_error) != G_IO_STATUS_NORMAL) { if (channel_error) { PLUGIN_ERROR ("Failed to read line from input channel, %s\n", channel_error->message); g_error_free (channel_error); channel_error = NULL; } else PLUGIN_ERROR ("Failed to read line from input channel\n"); } else { consume_message(message); } g_free (message); message = NULL; keep_installed = TRUE; } if (condition & (G_IO_ERR | G_IO_HUP)) { PLUGIN_DEBUG ("appletviewer has stopped.\n"); keep_installed = FALSE; } PLUGIN_DEBUG ("plugin_in_pipe_callback return\n"); return keep_installed; } static void consume_plugin_message(gchar* message) { // internal plugin related message gchar** parts = g_strsplit (message, " ", 5); if (g_str_has_prefix(parts[1], "PluginProxyInfo")) { gchar* proxy = NULL; uint32_t len = 0; gchar* decoded_url = (gchar*) calloc(strlen(parts[4]) + 1, sizeof(gchar)); IcedTeaPluginUtilities::decodeURL(parts[4], &decoded_url); PLUGIN_DEBUG("parts[0]=%s, parts[1]=%s, reference, parts[3]=%s, parts[4]=%s -- decoded_url=%s\n", parts[0], parts[1], parts[3], parts[4], decoded_url); gchar* proxy_info = NULL; proxy_info = g_strconcat ("plugin PluginProxyInfo reference ", parts[3], " ", NULL); if (get_proxy_info(decoded_url, &proxy, &len) == NPERR_NO_ERROR) { proxy_info = g_strconcat (proxy_info, proxy, NULL); } PLUGIN_DEBUG("Proxy info: %s\n", proxy_info); plugin_send_message_to_appletviewer(proxy_info); free(decoded_url); decoded_url = NULL; g_free(proxy_info); proxy_info = NULL; g_free(proxy); proxy = NULL; } else if (g_str_has_prefix(parts[1], "PluginCookieInfo")) { gchar* decoded_url = (gchar*) calloc(strlen(parts[4])+1, sizeof(gchar)); IcedTeaPluginUtilities::decodeURL(parts[4], &decoded_url); gchar* cookie_info = g_strconcat ("plugin PluginCookieInfo reference ", parts[3], " ", NULL); gchar* cookie_string = NULL; uint32_t len; if (get_cookie_info(decoded_url, &cookie_string, &len) == NPERR_NO_ERROR) { cookie_info = g_strconcat (cookie_info, cookie_string, NULL); } PLUGIN_DEBUG("Cookie info: %s\n", cookie_info); plugin_send_message_to_appletviewer(cookie_info); free(decoded_url); decoded_url = NULL; g_free(cookie_info); cookie_info = NULL; g_free(cookie_string); cookie_string = NULL; } else if (g_str_has_prefix(parts[1], "PluginSetCookie")) { // Message structure: plugin PluginSetCookie reference -1 gchar** cookie_parts = g_strsplit (message, " ", 6); if (g_strv_length(cookie_parts) < 6) { g_strfreev (parts); g_strfreev (cookie_parts); return; // Defensive, message _should_ be properly formatted } gchar* decoded_url = (gchar*) calloc(strlen(cookie_parts[4])+1, sizeof(gchar)); IcedTeaPluginUtilities::decodeURL(cookie_parts[4], &decoded_url); gchar* cookie_string = cookie_parts[5]; uint32_t len = strlen(cookie_string); if (set_cookie_info(decoded_url, cookie_string, len) == NPERR_NO_ERROR) { PLUGIN_DEBUG("Setting cookie for URL %s to %s\n", decoded_url, cookie_string); } else { PLUGIN_DEBUG("Not able to set cookie for URL %s to %s\n", decoded_url, cookie_string); } free(decoded_url); decoded_url = NULL; g_strfreev (cookie_parts); cookie_parts = NULL; } g_strfreev (parts); parts = NULL; } void consume_message(gchar* message) { PLUGIN_DEBUG (" PIPE: plugin read: %s\n", message); if (g_str_has_prefix (message, "instance")) { ITNPPluginData* data; gchar** parts = g_strsplit (message, " ", -1); guint parts_sz = g_strv_length (parts); int instance_id = atoi(parts[1]); NPP instance = (NPP) g_hash_table_lookup(id_to_instance_map, GINT_TO_POINTER(instance_id)); if (instance_id > 0 && !instance) { PLUGIN_DEBUG("Instance %d is not active. Refusing to consume message \"%s\"\n", instance_id, message); return; } else if (instance) { data = (ITNPPluginData*) instance->pdata; } if (g_str_has_prefix (parts[2], "status")) { // clear the "instance X status" parts strcpy(parts[0], ""); strcpy(parts[1], ""); strcpy(parts[2], ""); // join the rest gchar* status_message = g_strjoinv(" ", parts); PLUGIN_DEBUG ("plugin_in_pipe_callback: setting status %s\n", status_message); (*browser_functions.status) (data->owner, status_message); g_free(status_message); status_message = NULL; } else if (g_str_has_prefix (parts[1], "internal")) { //s->post(message); } else { // All other messages are posted to the bus, and subscribers are // expected to take care of them. They better! java_to_plugin_bus->post(message); } g_strfreev (parts); parts = NULL; } else if (g_str_has_prefix (message, "context")) { java_to_plugin_bus->post(message); } else if (g_str_has_prefix (message, "plugin ")) { consume_plugin_message(message); } else { g_print (" Unable to handle message: %s\n", message); } } void get_instance_from_id(int id, NPP& instance) { instance = (NPP) g_hash_table_lookup(id_to_instance_map, GINT_TO_POINTER(id)); } int get_id_from_instance(NPP instance) { int id = GPOINTER_TO_INT(g_hash_table_lookup(instance_to_id_map, instance)); PLUGIN_DEBUG("Returning id %d for instance %p\n", id, instance); return id; } NPError get_proxy_info(const char* siteAddr, char** proxy, uint32_t* len) { // Only attempt to perform this operation if there is a valid plugin instance if (g_hash_table_size(instance_to_id_map) <= 0) { return NPERR_GENERIC_ERROR; } if (browser_functions.getvalueforurl) { NPError err; // As in get_cookie_info, we use the first active instance gpointer instance=getFirstInTableInstance(instance_to_id_map); err = browser_functions.getvalueforurl((NPP) instance, NPNURLVProxy, siteAddr, proxy, len); if (err != NPERR_NO_ERROR) { *proxy = (char *) malloc(sizeof **proxy * 7); *len = g_strlcpy(*proxy, "DIRECT", 7); } } else { return NPERR_GENERIC_ERROR; } return NPERR_NO_ERROR; } // plugin_out_pipe_callback is called when the appletviewer crashes or // is killed. It may be called after data has been destroyed in which // case it simply returns FALSE to remove itself from the glib main // loop. static gboolean plugin_out_pipe_callback (GIOChannel* source, GIOCondition condition, gpointer plugin_data) { PLUGIN_DEBUG ("plugin_out_pipe_callback\n"); ITNPPluginData* data = (ITNPPluginData*) plugin_data; PLUGIN_DEBUG ("plugin_out_pipe_callback: appletviewer has stopped.\n"); PLUGIN_DEBUG ("plugin_out_pipe_callback return\n"); return FALSE; } // remove all components from LD_LIBRARY_PATH, which start with // MOZILLA_FIVE_HOME; firefox has its own NSS based security provider, // which conflicts with the one configured in nss.cfg. static gchar* plugin_filter_ld_library_path(gchar *path_old) { gchar *moz_home = g_strdup (g_getenv ("MOZILLA_FIVE_HOME")); gchar *moz_prefix; gchar *path_new; gchar** components; int i1, i2; if (moz_home == NULL || path_old == NULL || strlen (path_old) == 0) return path_old; if (g_str_has_suffix (moz_home, "/")) moz_home[strlen (moz_home - 1)] = '\0'; moz_prefix = g_strconcat (moz_home, "/", NULL); components = g_strsplit (path_old, ":", -1); for (i1 = 0, i2 = 0; components[i1] != NULL; i1++) { if (g_strcmp0 (components[i1], moz_home) == 0 || g_str_has_prefix (components[i1], moz_home)) components[i2] = components[i1]; else components[i2++] = components[i1]; } components[i2] = NULL; if (i1 > i2) path_new = g_strjoinv (":", components); g_strfreev (components); g_free (moz_home); g_free (moz_prefix); g_free (path_old); if (path_new == NULL || strlen (path_new) == 0) { PLUGIN_DEBUG("Unset LD_LIBRARY_PATH\n"); return NULL; } else { PLUGIN_DEBUG ("Set LD_LIBRARY_PATH: %s\n", path_new); return path_new; } } // build the environment to pass to the external plugin process static gchar** plugin_filter_environment(void) { gchar **var_names = g_listenv(); gchar **new_env = (gchar**) malloc(sizeof(gchar*) * (g_strv_length (var_names) + 1)); int i_var, i_env; for (i_var = 0, i_env = 0; var_names[i_var] != NULL; i_var++) { gchar *env_value = g_strdup (g_getenv (var_names[i_var])); if (g_str_has_prefix (var_names[i_var], "LD_LIBRARY_PATH")) env_value = plugin_filter_ld_library_path (env_value); if (env_value != NULL) { new_env[i_env++] = g_strdup_printf ("%s=%s", var_names[i_var], env_value); g_free (env_value); } } new_env[i_env] = NULL; return new_env; } static NPError plugin_test_appletviewer () { PLUGIN_DEBUG ("plugin_test_appletviewer: %s\n", get_plugin_executable().c_str()); NPError error = NPERR_NO_ERROR; gchar* command_line[3] = { NULL, NULL, NULL }; gchar** environment; command_line[0] = g_strdup (get_plugin_executable().c_str()); command_line[1] = g_strdup("-version"); command_line[2] = NULL; environment = plugin_filter_environment(); if (!g_spawn_async (NULL, command_line, environment, (GSpawnFlags) 0, NULL, NULL, NULL, &channel_error)) { if (channel_error) { PLUGIN_ERROR ("Failed to spawn applet viewer %s\n", channel_error->message); g_error_free (channel_error); channel_error = NULL; } else PLUGIN_ERROR ("Failed to spawn applet viewer\n"); error = NPERR_GENERIC_ERROR; } g_strfreev (environment); g_free (command_line[0]); command_line[0] = NULL; g_free (command_line[1]); command_line[1] = NULL; g_free (command_line[2]); command_line[2] = NULL; PLUGIN_DEBUG ("plugin_test_appletviewer return\n"); return error; } NPError plugin_start_appletviewer (ITNPPluginData* data) { PLUGIN_DEBUG ("plugin_start_appletviewer\n"); NPError error = NPERR_NO_ERROR; std::vector command_line; gchar** environment = NULL; std::vector* jvm_args = get_jvm_args(); // Construct command line parameters command_line.push_back(get_plugin_executable()); //for javaws shortcuts command_line.push_back(javaws_bin_property); command_line.push_back(javaws_name_property); //Add JVM args to command_line for (int i = 0; i < jvm_args->size(); i++) { command_line.push_back(*jvm_args->at(i)); } command_line.push_back(PLUGIN_BOOTCLASSPATH); // set the classpath to avoid using the default (cwd). command_line.push_back("-classpath"); command_line.push_back(get_plugin_rt_jar()); // Enable coverage agent if we are running instrumented plugin #ifdef COVERAGE_AGENT command_line.push_back(COVERAGE_AGENT); #endif if (plugin_debug) { command_line.push_back("-Xdebug"); command_line.push_back("-Xnoagent"); //Debug flags std::string debug_flags = "-Xrunjdwp:transport=dt_socket,address=8787,server=y,"; debug_flags += plugin_debug_suspend ? "suspend=y" : "suspend=n"; command_line.push_back(debug_flags); } command_line.push_back("sun.applet.PluginMain"); command_line.push_back(out_pipe_name); command_line.push_back(in_pipe_name); if (plugin_debug_to_console){ command_line.push_back(debug_pipe_name); } // Finished command line parameters environment = plugin_filter_environment(); std::vector vector_gchar = IcedTeaPluginUtilities::vectorStringToVectorGchar(&command_line); gchar **command_line_args = &vector_gchar[0]; if (!g_spawn_async (NULL, command_line_args, environment, (GSpawnFlags) G_SPAWN_DO_NOT_REAP_CHILD, NULL, NULL, &appletviewer_pid, &channel_error)) { if (channel_error) { PLUGIN_ERROR ("Failed to spawn applet viewer %s\n", channel_error->message); g_error_free (channel_error); channel_error = NULL; } else PLUGIN_ERROR ("Failed to spawn applet viewer\n"); error = NPERR_GENERIC_ERROR; } //Free memory g_strfreev(environment); IcedTeaPluginUtilities::freeStringPtrVector(jvm_args); jvm_args = NULL; command_line_args = NULL; if (appletviewer_pid) { PLUGIN_DEBUG("Initialized VM with pid=%d\n", appletviewer_pid); appletviewer_watch_id = g_child_watch_add(appletviewer_pid, (GChildWatchFunc) appletviewer_monitor, (gpointer) appletviewer_pid); } PLUGIN_DEBUG ("plugin_start_appletviewer return\n"); return error; } /* * Returns JVM options set in itw-settings */ std::vector* get_jvm_args() { std::string output; std::vector* tokenOutput = NULL; bool args_defined = read_deploy_property_value("deployment.plugin.jvm.arguments", output); if (!args_defined){ return new std::vector(); } tokenOutput = IcedTeaPluginUtilities::strSplit(output.c_str(), " \n"); return tokenOutput; } /* * Escape characters for passing to Java. * "\n" for new line, "\\" for "\", "\:" for ";" */ std::string escape_parameter_string(const char* to_encode) { std::string encoded; if (to_encode == NULL) { return encoded; } size_t length = strlen(to_encode); for (int i = 0; i < length; i++) { if (to_encode[i] == '\n') encoded += "\\n"; else if (to_encode[i] == '\\') encoded += "\\\\"; else if (to_encode[i] == ';') encoded += "\\:"; else encoded += to_encode[i]; } return encoded; } /* * Build a string containing an encoded list of parameters to send to the applet viewer. * The parameters are separated as 'key1;value1;key2;value2;'. As well, they are * separated and escaped as: * "\n" for new line, "\\" for "\", "\:" for ";" */ std::string plugin_parameters_string (int argc, char* argn[], char* argv[]) { PLUGIN_DEBUG ("plugin_parameters_string\n"); std::string parameters; for (int i = 0; i < argc; i++) { if (argv[i] != NULL) { std::string name_escaped = escape_parameter_string(argn[i]); std::string value_escaped = escape_parameter_string(argv[i]); //Encode parameters and send as 'key1;value1;key2;value2;' etc parameters += name_escaped; parameters += ';'; parameters += value_escaped; parameters += ';'; } } PLUGIN_DEBUG ("plugin_parameters_string return\n"); return parameters; } // plugin_send_message_to_appletviewer must be called while holding // data->appletviewer_mutex. void plugin_send_message_to_appletviewer (gchar const* message) { PLUGIN_DEBUG ("plugin_send_message_to_appletviewer\n"); if (jvm_up) { gchar* newline_message = NULL; gsize bytes_written = 0; // Send message to appletviewer. newline_message = g_strdup_printf ("%s\n", message); // g_io_channel_write_chars will return something other than // G_IO_STATUS_NORMAL if not all the data is written. In that // case we fail rather than retrying. if (g_io_channel_write_chars (out_to_appletviewer, newline_message, -1, &bytes_written, &channel_error) != G_IO_STATUS_NORMAL) { if (channel_error) { PLUGIN_ERROR ("Failed to write bytes to output channel '%s' \n", channel_error->message); g_error_free (channel_error); channel_error = NULL; } else PLUGIN_ERROR ("Failed to write bytes to output channel for %s", newline_message); } if (g_io_channel_flush (out_to_appletviewer, &channel_error) != G_IO_STATUS_NORMAL) { if (channel_error) { PLUGIN_ERROR ("Failed to flush bytes to output channel '%s'\n", channel_error->message); g_error_free (channel_error); channel_error = NULL; } else PLUGIN_ERROR ("Failed to flush bytes to output channel for %s", newline_message); } g_free (newline_message); newline_message = NULL; PLUGIN_DEBUG (" PIPE: plugin wrote(?): %s\n", message); } PLUGIN_DEBUG ("plugin_send_message_to_appletviewer return\n"); } // unlike like plugin_send_message_to_appletviewer // do not debug // do not error // do not have its own line end // is accesed by only one thread // have own pipe // jvm must be up void plugin_send_message_to_appletviewer_console (gchar const* newline_message) { gsize bytes_written = 0; if (g_io_channel_write_chars (debug_to_appletviewer, newline_message, -1, &bytes_written, &channel_error) != G_IO_STATUS_NORMAL) { if (channel_error) { //error must be freed g_error_free (channel_error); channel_error = NULL; } } } //flush only when its full void flush_plugin_send_message_to_appletviewer_console (){ if (g_io_channel_flush (debug_to_appletviewer, &channel_error) != G_IO_STATUS_NORMAL) { if (channel_error) { g_error_free (channel_error); channel_error = NULL; } } } /* * Sends the initialization message (handle/size/url) to the plugin */ void plugin_send_initialization_message(char* instance, gulong handle, int width, int height, char* url) { PLUGIN_DEBUG ("plugin_send_initialization_message\n"); gchar *window_message = g_strdup_printf ("instance %s handle %ld width %d height %d %s", instance, handle, width, height, url); plugin_send_message_to_appletviewer (window_message); g_free (window_message); window_message = NULL; PLUGIN_DEBUG ("plugin_send_initialization_message return\n"); } // Stop the appletviewer process. When this is called the // appletviewer can be in any of three states: running, crashed or // hung. If the appletviewer is running then sending it "shutdown" // will cause it to exit. This will cause // plugin_out_pipe_callback/plugin_in_pipe_callback to be called and // the input and output channels to be shut down. If the appletviewer // has crashed then plugin_out_pipe_callback/plugin_in_pipe_callback // would already have been called and data->appletviewer_alive cleared // in which case this function simply returns. If the appletviewer is // hung then this function will be successful and the input and output // watches will be removed by plugin_data_destroy. // plugin_stop_appletviewer must be called with // data->appletviewer_mutex held. static void plugin_stop_appletviewer () { PLUGIN_DEBUG ("plugin_stop_appletviewer\n"); if (jvm_up) { // Shut down the appletviewer. gsize bytes_written = 0; if (out_to_appletviewer) { if (g_io_channel_write_chars (out_to_appletviewer, "shutdown", -1, &bytes_written, &channel_error) != G_IO_STATUS_NORMAL) { if (channel_error) { PLUGIN_ERROR ("Failed to write shutdown message to " " appletviewer, %s \n", channel_error->message); g_error_free (channel_error); channel_error = NULL; } else PLUGIN_ERROR ("Failed to write shutdown message to\n"); } if (g_io_channel_flush (out_to_appletviewer, &channel_error) != G_IO_STATUS_NORMAL) { if (channel_error) { PLUGIN_ERROR ("Failed to write shutdown message to" " appletviewer %s \n", channel_error->message); g_error_free (channel_error); channel_error = NULL; } else PLUGIN_ERROR ("Failed to write shutdown message to\n"); } if (g_io_channel_shutdown (out_to_appletviewer, TRUE, &channel_error) != G_IO_STATUS_NORMAL) { if (channel_error) { PLUGIN_ERROR ("Failed to shut down appletviewer" " output channel %s \n", channel_error->message); g_error_free (channel_error); channel_error = NULL; } else PLUGIN_ERROR ("Failed to shut down appletviewer\n"); } } if (in_from_appletviewer) { if (g_io_channel_shutdown (in_from_appletviewer, TRUE, &channel_error) != G_IO_STATUS_NORMAL) { if (channel_error) { PLUGIN_ERROR ("Failed to shut down appletviewer" " input channel %s \n", channel_error->message); g_error_free (channel_error); channel_error = NULL; } else PLUGIN_ERROR ("Failed to shut down appletviewer\n"); } } } jvm_up = FALSE; sleep(2); /* Needed to prevent crashes during debug (when JDWP port is not freed by the kernel right away) */ PLUGIN_DEBUG ("plugin_stop_appletviewer return\n"); } static void appletviewer_monitor(GPid pid, gint status, gpointer data) { PLUGIN_DEBUG ("appletviewer_monitor\n"); jvm_up = FALSE; pid = -1; PLUGIN_DEBUG ("appletviewer_monitor return\n"); } void plugin_data_destroy (NPP instance) { PLUGIN_DEBUG ("plugin_data_destroy\n"); ITNPPluginData* tofree = (ITNPPluginData*) instance->pdata; // Remove instance from map gpointer id_ptr = g_hash_table_lookup(instance_to_id_map, instance); if (id_ptr) { gint id = GPOINTER_TO_INT(id_ptr); g_hash_table_remove(instance_to_id_map, instance); g_hash_table_remove(id_to_instance_map, id_ptr); } /* Explicitly call destructor */ tofree->~ITNPPluginData(); (*browser_functions.memfree) (tofree); PLUGIN_DEBUG ("plugin_data_destroy return\n"); } static bool initialize_browser_functions(const NPNetscapeFuncs* browserTable) { #define NPNETSCAPEFUNCS_LAST_FIELD_USED (browserTable->setvalueforurl) //Determine the size in bytes, as a difference of the address past the last used field //And the browser table address size_t usedSize = (char*)(1 + &NPNETSCAPEFUNCS_LAST_FIELD_USED) - (char*)browserTable; // compare the reported size versus the size we required if (browserTable->size < usedSize) { return false; } //Ensure any unused fields are NULL memset(&browser_functions, 0, sizeof(NPNetscapeFuncs)); //browserTable->size can be larger than sizeof(NPNetscapeFuncs) (PR1106) size_t copySize = browserTable->size < sizeof(NPNetscapeFuncs) ? browserTable->size : sizeof(NPNetscapeFuncs); //Copy fields according to given size memcpy(&browser_functions, browserTable, copySize); return true; } /* Set the plugin table to the correct contents, taking care not to write past * the provided object space */ static bool initialize_plugin_table(NPPluginFuncs* pluginTable) { #define NPPLUGINFUNCS_LAST_FIELD_USED (pluginTable->getvalue) //Determine the size in bytes, as a difference of the address past the last used field //And the browser table address size_t usedSize = (char*)(1 + &NPPLUGINFUNCS_LAST_FIELD_USED) - (char*)pluginTable; // compare the reported size versus the size we required if (pluginTable->size < usedSize) return false; pluginTable->version = (NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR; pluginTable->size = sizeof (NPPluginFuncs); pluginTable->newp = NPP_NewProcPtr (ITNP_New); pluginTable->destroy = NPP_DestroyProcPtr (ITNP_Destroy); pluginTable->setwindow = NPP_SetWindowProcPtr (ITNP_SetWindow); pluginTable->newstream = NPP_NewStreamProcPtr (ITNP_NewStream); pluginTable->destroystream = NPP_DestroyStreamProcPtr (ITNP_DestroyStream); pluginTable->asfile = NPP_StreamAsFileProcPtr (ITNP_StreamAsFile); pluginTable->writeready = NPP_WriteReadyProcPtr (ITNP_WriteReady); pluginTable->write = NPP_WriteProcPtr (ITNP_Write); pluginTable->print = NPP_PrintProcPtr (ITNP_Print); pluginTable->urlnotify = NPP_URLNotifyProcPtr (ITNP_URLNotify); pluginTable->getvalue = NPP_GetValueProcPtr (ITNP_GetValue); return true; } // Make sure the plugin data directory exists, creating it if necessary. NPError initialize_data_directory() { data_directory = IcedTeaPluginUtilities::getRuntimePath() + "/icedteaplugin-"; if (getenv("USER") != NULL) { data_directory = data_directory + getenv("USER") + "-"; } data_directory += "XXXXXX"; // Now create a icedteaplugin subdir char fileNameX[data_directory.length()+1]; std::strcpy (fileNameX, data_directory.c_str()); char * fileName = mkdtemp(fileNameX); if (fileName == NULL) { PLUGIN_ERROR ("Failed to create data directory %s, %s\n", data_directory.c_str(), strerror (errno)); return NPERR_GENERIC_ERROR; } data_directory = std::string(fileName); //open uniques icedteaplugin subdir for one single run data_directory_descriptor = opendir(data_directory.c_str()); if (data_directory_descriptor == NULL) { PLUGIN_ERROR ("Failed to open data directory %s %s\n", data_directory.c_str(), strerror (errno)); return NPERR_GENERIC_ERROR; } return NPERR_NO_ERROR; } // FACTORY FUNCTIONS // Provides the browser with pointers to the plugin functions that we // implement and initializes a local table with browser functions that // we may wish to call. Called once, after browser startup and before // the first plugin instance is created. // The field 'initialized' is set to true once this function has // finished. If 'initialized' is already true at the beginning of // this function, then it is evident that NP_Initialize has already // been called. There is no need to call this function more than once and // this workaround avoids any duplicate calls. __attribute__ ((visibility ("default"))) NPError NP_Initialize (NPNetscapeFuncs* browserTable, NPPluginFuncs* pluginTable) { PLUGIN_DEBUG ("NP_Initialize\n"); if ((browserTable == NULL) || (pluginTable == NULL)) { PLUGIN_ERROR ("Browser or plugin function table is NULL.\n"); return NPERR_INVALID_FUNCTABLE_ERROR; } // Ensure that the major version of the plugin API that the browser // expects is not more recent than the major version of the API that // we've implemented. if ((browserTable->version >> 8) > NP_VERSION_MAJOR) { PLUGIN_ERROR ("Incompatible version.\n"); return NPERR_INCOMPATIBLE_VERSION_ERROR; } // Copy into a global table (browser_functions) the browser functions that we may use. // If the browser functions needed change, update NPNETSCAPEFUNCS_LAST_FIELD_USED // within this function bool browser_functions_supported = initialize_browser_functions(browserTable); // Check if everything we rely on is supported if ( !browser_functions_supported ) { PLUGIN_ERROR ("Invalid browser function table.\n"); return NPERR_INVALID_FUNCTABLE_ERROR; } // Return to the browser the plugin functions that we implement. // If the plugin functions needed change, update NPPLUGINFUNCS_LAST_FIELD_USED // within this function bool plugin_functions_supported = initialize_plugin_table(pluginTable); // Check if everything we rely on is supported if ( !plugin_functions_supported ) { PLUGIN_ERROR ("Invalid plugin function table.\n"); return NPERR_INVALID_FUNCTABLE_ERROR; } // Re-setting the above tables multiple times is OK (as the // browser may change its function locations). However // anything beyond this point should only run once. if (initialized) return NPERR_NO_ERROR; // create directory for pipes NPError np_error = initialize_data_directory(); if (np_error != NPERR_NO_ERROR) { PLUGIN_ERROR("Unable to create data directory %s\n", data_directory.c_str()); return np_error; } // Set appletviewer_executable. PLUGIN_DEBUG("Executing java at %s\n", get_plugin_executable().c_str()); np_error = plugin_test_appletviewer (); if (np_error != NPERR_NO_ERROR) { PLUGIN_ERROR("Unable to find java executable %s\n", get_plugin_executable().c_str()); return np_error; } initialized = true; // Initialize threads (needed for mutexes). if (!g_thread_supported ()) g_thread_init (NULL); plugin_instance_mutex = g_mutex_new (); PLUGIN_DEBUG ("NP_Initialize: using %s\n", get_plugin_executable().c_str()); plugin_req_proc = new PluginRequestProcessor(); java_req_proc = new JavaMessageSender(); java_to_plugin_bus = new MessageBus(); plugin_to_java_bus = new MessageBus(); java_to_plugin_bus->subscribe(plugin_req_proc); plugin_to_java_bus->subscribe(java_req_proc); pthread_create (&plugin_request_processor_thread1, NULL, &queue_processor, (void*) plugin_req_proc); pthread_create (&plugin_request_processor_thread2, NULL, &queue_processor, (void*) plugin_req_proc); pthread_create (&plugin_request_processor_thread3, NULL, &queue_processor, (void*) plugin_req_proc); itnp_plugin_thread_id = pthread_self(); pthread_mutexattr_t attribute; pthread_mutexattr_init(&attribute); pthread_mutexattr_settype(&attribute, PTHREAD_MUTEX_RECURSIVE); pthread_mutex_init(&pluginAsyncCallMutex, &attribute); pthread_mutexattr_destroy(&attribute); PLUGIN_DEBUG ("NP_Initialize return\n"); return NPERR_NO_ERROR; } // Returns a string describing the MIME type that this plugin // handles. __attribute__ ((visibility ("default"))) #ifdef LEGACY_XULRUNNERAPI char* #else const char* #endif NP_GetMIMEDescription () { //this function is called severaltimes between lunches PLUGIN_DEBUG ("NP_GetMIMEDescription\n"); PLUGIN_DEBUG ("NP_GetMIMEDescription return\n"); return (char*) PLUGIN_MIME_DESC; } // Returns a value relevant to the plugin as a whole. The browser // calls this function to obtain information about the plugin. __attribute__ ((visibility ("default"))) NPError NP_GetValue (void* future, NPPVariable variable, void* value) { PLUGIN_DEBUG ("NP_GetValue\n"); NPError result = NPERR_NO_ERROR; gchar** char_value = (gchar**) value; switch (variable) { case NPPVpluginNameString: PLUGIN_DEBUG ("NP_GetValue: returning plugin name.\n"); *char_value = g_strdup (PLUGIN_FULL_NAME); break; case NPPVpluginDescriptionString: PLUGIN_DEBUG ("NP_GetValue: returning plugin description.\n"); *char_value = g_strdup (PLUGIN_DESC); break; default: PLUGIN_ERROR ("Unknown plugin value requested.\n"); result = NPERR_GENERIC_ERROR; break; } PLUGIN_DEBUG ("NP_GetValue return\n"); return result; } // Shuts down the plugin. Called after the last plugin instance is // destroyed. __attribute__ ((visibility ("default"))) NPError NP_Shutdown (void) { PLUGIN_DEBUG ("NP_Shutdown\n"); // Free mutex. if (plugin_instance_mutex) { g_mutex_free (plugin_instance_mutex); plugin_instance_mutex = NULL; } // stop the appletviewer plugin_stop_appletviewer(); // remove monitor if (appletviewer_watch_id != -1) g_source_remove(appletviewer_watch_id); // Removing a source is harmless if it fails since it just means the // source has already been removed. g_source_remove (in_watch_source); in_watch_source = 0; // cleanup_in_from_appletviewer: if (in_from_appletviewer) g_io_channel_unref (in_from_appletviewer); in_from_appletviewer = NULL; // cleanup_out_watch_source: g_source_remove (out_watch_source); out_watch_source = 0; // cleanup_out_to_appletviewer: if (out_to_appletviewer) g_io_channel_unref (out_to_appletviewer); out_to_appletviewer = NULL; // cleanup_out_pipe: // Delete output pipe. PLUGIN_DEBUG ("NP_Shutdown: deleting output fifo: %s\n", out_pipe_name); unlink (out_pipe_name); PLUGIN_DEBUG ("NP_Shutdown: deleted output fifo: %s\n", out_pipe_name); // cleanup_out_pipe_name: g_free (out_pipe_name); out_pipe_name = NULL; // cleanup_in_pipe: // Delete input pipe. PLUGIN_DEBUG ("NP_Shutdown: deleting input fifo: %s\n", in_pipe_name); unlink (in_pipe_name); PLUGIN_DEBUG ("NP_Shutdown: deleted input fifo: %s\n", in_pipe_name); // cleanup_in_pipe_name: g_free (in_pipe_name); in_pipe_name = NULL; if (plugin_debug_to_console){ //jvm_up is now false if (g_io_channel_shutdown (debug_to_appletviewer, TRUE, &channel_error) != G_IO_STATUS_NORMAL) { if (channel_error) { PLUGIN_ERROR ("Failed to shut down appletviewer" " debug channel\n", channel_error->message); g_error_free (channel_error); channel_error = NULL; } else PLUGIN_ERROR ("Failed to shut down debug to appletviewer\n"); } // cleanup_out_to_appletviewer: if (debug_to_appletviewer) g_io_channel_unref (debug_to_appletviewer); out_to_appletviewer = NULL; // cleanup_debug_pipe: // Delete debug pipe. PLUGIN_DEBUG ("NP_Shutdown: deleting debug fifo: %s\n", debug_pipe_name); unlink (debug_pipe_name); PLUGIN_DEBUG ("NP_Shutdown: deleted debug fifo: %s\n", debug_pipe_name); // cleanup_out_pipe_name: g_free (debug_pipe_name); debug_pipe_name = NULL; } // Destroy the call queue mutex pthread_mutex_destroy(&pluginAsyncCallMutex); initialized = false; pthread_cancel(plugin_request_processor_thread1); pthread_cancel(plugin_request_processor_thread2); pthread_cancel(plugin_request_processor_thread3); pthread_join(plugin_request_processor_thread1, NULL); pthread_join(plugin_request_processor_thread2, NULL); pthread_join(plugin_request_processor_thread3, NULL); java_to_plugin_bus->unSubscribe(plugin_req_proc); plugin_to_java_bus->unSubscribe(java_req_proc); //internal_bus->unSubscribe(java_req_proc); //internal_bus->unSubscribe(plugin_req_proc); delete plugin_req_proc; delete java_req_proc; delete java_to_plugin_bus; delete plugin_to_java_bus; //delete internal_bus; cleanUpDir(); PLUGIN_DEBUG ("NP_Shutdown return\n"); if (plugin_debug_to_file){ fflush (plugin_file_log); //fclose (plugin_file_log); //keep writing untill possible! } return NPERR_NO_ERROR; } NPObject* get_scriptable_object(NPP instance) { NPObject* obj; ITNPPluginData* data = (ITNPPluginData*) instance->pdata; if (data->is_applet_instance) // dummy instance/package? { JavaRequestProcessor java_request = JavaRequestProcessor(); JavaResultData* java_result; std::string instance_id = std::string(); std::string applet_class_id = std::string(); int id = get_id_from_instance(instance); gchar* id_str = g_strdup_printf ("%d", id); // Some browsers.. (e.g. chromium) don't call NPP_SetWindow // for 0x0 plugins and therefore require initialization with // a 0 handle if (!data->window_handle) { plugin_send_initialization_message(data->instance_id, 0, 0, 0, data->parameters_string); } java_result = java_request.getAppletObjectInstance(id_str); g_free(id_str); if (java_result->error_occurred) { PLUGIN_ERROR("Error: Unable to fetch applet instance id from Java side.\n"); return NULL; } instance_id.append(*(java_result->return_string)); java_result = java_request.getClassID(instance_id); if (java_result->error_occurred) { PLUGIN_ERROR("Error: Unable to fetch applet instance id from Java side.\n"); return NULL; } applet_class_id.append(*(java_result->return_string)); obj = IcedTeaScriptableJavaObject::get_scriptable_java_object(instance, applet_class_id, instance_id, false); } else { obj = IcedTeaScriptableJavaPackageObject::get_scriptable_java_package_object(instance, ""); } return obj; } NPObject* allocate_scriptable_object(NPP npp, NPClass *aClass) { PLUGIN_DEBUG("Allocating new scriptable object\n"); return new IcedTeaScriptablePluginObject(npp); } icedtea-web-1.6.2/plugin/icedteanp/PaxHeaders.17941/IcedTeaJavaRequestProcessor.h0000644000000000000000000000013112654402377024420 xustar0030 mtime=1454507263.211432928 29 atime=1454507327.17157991 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/icedteanp/IcedTeaJavaRequestProcessor.h0000644000175000002070000002141212654402377025144 0ustar00jvanekmock00000000000000/* IcedTeaJavaRequestProcessor.h Copyright (C) 2009, 2010 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #ifndef ICEDTEAJAVAREQUEST_H_ #define ICEDTEAJAVAREQUEST_H_ #include #include #include #include #include "IcedTeaNPPlugin.h" #include "IcedTeaPluginUtils.h" #define REQUESTTIMEOUT 180 /* * This struct holds data specific to a Java operation requested by the plugin */ typedef struct java_request { // Instance id (if applicable) int instance; // Context id (if applicable) int context; // request specific data std::vector* data; // source of the request std::string* source; } JavaRequest; /* Creates a argument on java-side with appropriate type */ void createJavaObjectFromVariant(NPP instance, NPVariant variant, std::string* id); /* Returns the type of array based on the given element */ void getArrayTypeForJava(NPP instance, NPVariant element, std::string* type); class JavaRequestProcessor : BusSubscriber { private: // instance and references are constant throughout this objects // lifecycle int instance; int reference; bool result_ready; JavaResultData* result; /* Post message on bus and wait */ void postAndWaitForResponse(std::string message); // Call a method, static or otherwise, depending on supplied arg JavaResultData* call(std::string source, bool isStatic, std::string objectID, std::string methodName, std::vector args); // Set a static/non-static field to given value JavaResultData* set(std::string source, bool isStatic, std::string classID, std::string objectID, std::string fieldName, std::string value_id); /* Resets the results */ void resetResult(); public: JavaRequestProcessor(); ~JavaRequestProcessor(); virtual bool newMessageOnBus(const char* message); /* Increments reference count by 1 */ void addReference(std::string object_id); /* Decrements reference count by 1 */ void deleteReference(std::string object_id); /* Returns the toString() value, given an object identifier */ JavaResultData* getToStringValue(std::string object_id); /* Returns the value, given an object identifier */ JavaResultData* getValue(std::string object_id); /* Returns the string, given the identifier */ JavaResultData* getString(std::string string_id); /* Returns the field object */ JavaResultData* getField(std::string source, std::string classID, std::string objectID, std::string fieldName); /* Returns the static field object */ JavaResultData* getStaticField(std::string source, std::string classID, std::string fieldName); /* Sets the field object */ JavaResultData* setField(std::string source, std::string classID, std::string objectID, std::string fieldName, std::string value_id); /* Sets the static field object */ JavaResultData* setStaticField(std::string source, std::string classID, std::string fieldName, std::string value_id); /* Returns the field id */ JavaResultData* getFieldID(std::string classID, std::string fieldName); /* Returns the static field id */ JavaResultData* getStaticFieldID(std::string classID, std::string fieldName); /* Returns the method id */ JavaResultData* getMethodID(std::string classID, NPIdentifier methodName, std::vector args); /* Returns the static method id */ JavaResultData* getStaticMethodID(std::string classID, NPIdentifier methodName, std::vector args); /* Calls a static method */ JavaResultData* callStaticMethod(std::string source, std::string classID, std::string methodName, std::vector args); /* Calls a method on an instance */ JavaResultData* callMethod(std::string source, std::string objectID, std::string methodName, std::vector args); /* Returns the class of the given object */ JavaResultData* getObjectClass(std::string objectID); /* Creates a new object with choosable constructor */ JavaResultData* newObject(std::string source, std::string classID, std::vector args); /* Creates a new object when constructor is undetermined */ JavaResultData* newObjectWithConstructor(std::string source, std::string classID, std::string methodID, std::vector args); /* Returns the class ID */ JavaResultData* findClass(int plugin_instance_id, std::string name); /* Returns the type class name */ JavaResultData* getClassName(std::string objectID); /* Returns the type class id */ JavaResultData* getClassID(std::string objectID); /* Returns the length of the array object. -1 if not found */ JavaResultData* getArrayLength(std::string objectID); /* Returns the item at the given index for the array */ JavaResultData* getSlot(std::string objectID, std::string index); /* Sets the item at the given index to the given value */ JavaResultData* setSlot(std::string objectID, std::string index, std::string value_id); /* Creates a new array of given length */ JavaResultData* newArray(std::string component_class, std::string length); /* Creates a new string in the Java store */ JavaResultData* newString(std::string str); /* Check if package exists */ JavaResultData* hasPackage(int plugin_instance_id, std::string package_name); /* Check if method exists */ JavaResultData* hasMethod(std::string classID, std::string method_name); /* Check if field exists */ JavaResultData* hasField(std::string classID, std::string method_name); /* Check if given object is instance of given class */ JavaResultData* isInstanceOf(std::string objectID, std::string classID); /* Returns the instance ID of the java applet */ JavaResultData* getAppletObjectInstance(std::string instanceID); }; #endif /* ICEDTEAJAVAREQUESTPROCESSOR_H_ */ icedtea-web-1.6.2/plugin/icedteanp/PaxHeaders.17941/IcedTeaJavaRequestProcessor.cc0000644000000000000000000000013112654402377024556 xustar0030 mtime=1454507263.211432928 29 atime=1454507327.17157991 30 ctime=1454507658.743157837 icedtea-web-1.6.2/plugin/icedteanp/IcedTeaJavaRequestProcessor.cc0000644000175000002070000012507112654402377025310 0ustar00jvanekmock00000000000000/* IcedTeaJavaRequestProcessor.cc Copyright (C) 2009, 2010 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #include #include "IcedTeaJavaRequestProcessor.h" #include "IcedTeaScriptablePluginObject.h" /* * This class processes LiveConnect requests from JavaScript to Java. * * It sends the requests to Java, gets the return information, and sends it * back to the browser/JavaScript */ /** * Processes return information from JavaSide (return messages of requests) * * @param message The message request to process * @return boolean indicating whether the message is serviceable by this object */ bool JavaRequestProcessor::newMessageOnBus(const char* message) { // Anything we are waiting for _MUST_ have and instance id and reference # std::vector* message_parts = IcedTeaPluginUtilities::strSplit(message, " "); IcedTeaPluginUtilities::printStringPtrVector("JavaRequest::newMessageOnBus:", message_parts); if (*(message_parts->at(0)) == "context" && *(message_parts->at(2)) == "reference") if (atoi(message_parts->at(1)->c_str()) == this->instance && atoi(message_parts->at(3)->c_str()) == this->reference) { // Gather the results // Let's get errors out of the way first if (!message_parts->at(4)->find("Error")) { for (int i=5; i < message_parts->size(); i++) { result->error_msg->append(*(message_parts->at(i))); result->error_msg->append(" "); } PLUGIN_ERROR("Error on Java side: %s\n", result->error_msg->c_str()); result->error_occurred = true; result_ready = true; } else if (!message_parts->at(4)->find("GetStringUTFChars") || !message_parts->at(4)->find("GetToStringValue")) { // first item is length, and it is radix 10 int length = strtol(message_parts->at(5)->c_str(), NULL, 10); IcedTeaPluginUtilities::getUTF8String(length, 6 /* start at */, message_parts, result->return_string); result_ready = true; } else if (!message_parts->at(4)->find("GetStringChars")) // GetStringChars (UTF-16LE/UCS-2) { // first item is length, and it is radix 10 int length = strtol(message_parts->at(5)->c_str(), NULL, 10); IcedTeaPluginUtilities::getUTF16LEString(length, 6 /* start at */, message_parts, result->return_wstring); result_ready = true; } else if (!message_parts->at(4)->find("FindClass") || !message_parts->at(4)->find("GetClassName") || !message_parts->at(4)->find("GetClassID") || !message_parts->at(4)->find("GetMethodID") || !message_parts->at(4)->find("GetStaticMethodID") || !message_parts->at(4)->find("GetObjectClass") || !message_parts->at(4)->find("NewObject") || !message_parts->at(4)->find("NewStringUTF") || !message_parts->at(4)->find("HasPackage") || !message_parts->at(4)->find("HasMethod") || !message_parts->at(4)->find("HasField") || !message_parts->at(4)->find("GetStaticFieldID") || !message_parts->at(4)->find("GetFieldID") || !message_parts->at(4)->find("GetJavaObject") || !message_parts->at(4)->find("IsInstanceOf") || !message_parts->at(4)->find("NewArray")) { result->return_identifier = atoi(message_parts->at(5)->c_str()); result->return_string->append(*(message_parts->at(5))); // store it as a string as well, for easy access result_ready = true; } else if (!message_parts->at(4)->find("DeleteLocalRef") || !message_parts->at(4)->find("NewGlobalRef")) { result_ready = true; // nothing else to do } else if (!message_parts->at(4)->find("CallMethod") || !message_parts->at(4)->find("CallStaticMethod") || !message_parts->at(4)->find("GetField") || !message_parts->at(4)->find("GetStaticField") || !message_parts->at(4)->find("GetValue") || !message_parts->at(4)->find("GetObjectArrayElement")) { if (!message_parts->at(5)->find("literalreturn") || !message_parts->at(5)->find("jsobject")) { // literal returns don't have a corresponding jni id result->return_identifier = 0; result->return_string->append(*(message_parts->at(5))); result->return_string->append(" "); result->return_string->append(*(message_parts->at(6))); } else { // Else it is a complex object result->return_identifier = atoi(message_parts->at(5)->c_str()); result->return_string->append(*(message_parts->at(5))); // store it as a string as well, for easy access } result_ready = true; } else if (!message_parts->at(4)->find("GetArrayLength")) { result->return_identifier = 0; // length is not an "identifier" result->return_string->append(*(message_parts->at(5))); result_ready = true; } else if (!message_parts->at(4)->find("SetField") || !message_parts->at(4)->find("SetObjectArrayElement")) { // nothing to do result->return_identifier = 0; result_ready = true; } IcedTeaPluginUtilities::freeStringPtrVector(message_parts); return true; } IcedTeaPluginUtilities::freeStringPtrVector(message_parts); return false; } /** * Constructor. * * Initializes the result data structure (heap) */ JavaRequestProcessor::JavaRequestProcessor() { PLUGIN_DEBUG("JavaRequestProcessor constructor\n"); // caller frees this result = new JavaResultData(); result->error_msg = new std::string(); result->return_identifier = 0; result->return_string = new std::string(); result->return_wstring = new std::wstring(); result->error_occurred = false; result_ready = false; } /** * Destructor * * Frees memory used by the result struct */ JavaRequestProcessor::~JavaRequestProcessor() { PLUGIN_DEBUG("JavaRequestProcessor::~JavaRequestProcessor\n"); if (result) { if (result->error_msg) delete result->error_msg; if (result->return_string) delete result->return_string; if (result->return_wstring) delete result->return_wstring; delete result; } } /** * Resets the results */ void JavaRequestProcessor::resetResult() { // caller frees this result->error_msg->clear(); result->return_identifier = 0; result->return_string->clear(); result->return_wstring->clear(); result->error_occurred = false; result_ready = false; } void JavaRequestProcessor::postAndWaitForResponse(std::string message) { struct timespec t; clock_gettime(CLOCK_REALTIME, &t); t.tv_sec += REQUESTTIMEOUT; // 1 minute timeout // Clear the result resetResult(); java_to_plugin_bus->subscribe(this); plugin_to_java_bus->post(message.c_str()); // Wait for result to be filled in. struct timespec curr_t; bool isPluginThread = false; if (pthread_self() == itnp_plugin_thread_id) { isPluginThread = true; PLUGIN_DEBUG("JRP is in plug-in thread...\n"); } do { clock_gettime(CLOCK_REALTIME, &curr_t); if (!result_ready && (curr_t.tv_sec < t.tv_sec)) { if (isPluginThread) { processAsyncCallQueue(NULL); // Let the browser run its pending events too if (g_main_context_pending(NULL)) { g_main_context_iteration(NULL, false); } else { usleep(1000); // 1ms } } else { usleep(1000); // 1ms } } else { break; } } while (1); if (curr_t.tv_sec >= t.tv_sec) { result->error_occurred = true; result->error_msg->append("Error: Timed out when waiting for response"); // Report error PLUGIN_DEBUG("Error: Timed out when waiting for response to %s\n", message.c_str()); } java_to_plugin_bus->unSubscribe(this); } /** * Given an object id, fetches the toString() value from Java * * @param object_id The ID of the object * @return A JavaResultData struct containing the result of the request */ JavaResultData* JavaRequestProcessor::getToStringValue(std::string object_id) { std::string message = std::string(); this->instance = 0; // context is always 0 (needed for java-side backwards compat.) this->reference = IcedTeaPluginUtilities::getReference(); IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &message); message.append(" GetToStringValue "); // get it in UTF8 message.append(object_id); postAndWaitForResponse(message); IcedTeaPluginUtilities::releaseReference(); return result; } /** * Given an object id, fetches the value of that ID from Java * * @param object_id The ID of the object * @return A JavaResultData struct containing the result of the request */ JavaResultData* JavaRequestProcessor::getValue(std::string object_id) { std::string message = std::string(); this->instance = 0; // context is always 0 (needed for java-side backwards compat.) this->reference = IcedTeaPluginUtilities::getReference(); IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &message); message.append(" GetValue "); // get it in UTF8 message.append(object_id); postAndWaitForResponse(message); IcedTeaPluginUtilities::releaseReference(); return result; } /** * Given a string id, fetches the actual string from Java side * * @param string_id The ID of the string * @return A JavaResultData struct containing the result of the request */ JavaResultData* JavaRequestProcessor::getString(std::string string_id) { std::string message = std::string(); this->instance = 0; // context is always 0 (needed for java-side backwards compat.) this->reference = IcedTeaPluginUtilities::getReference(); IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &message); message.append(" GetStringUTFChars "); // get it in UTF8 message.append(string_id); postAndWaitForResponse(message); IcedTeaPluginUtilities::releaseReference(); return result; } /** * Decrements reference count by 1 * * @param object_id The ID of the object */ void JavaRequestProcessor::deleteReference(std::string object_id) { std::string message = std::string(); this->instance = 0; // context is always 0 (needed for java-side backwards compat.) this->reference = IcedTeaPluginUtilities::getReference(); IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &message); message.append(" DeleteLocalRef "); message.append(object_id); postAndWaitForResponse(message); IcedTeaPluginUtilities::releaseReference(); } /** * Increments reference count by 1 * * @param object_id The ID of the object */ void JavaRequestProcessor::addReference(std::string object_id) { std::string message = std::string(); this->instance = 0; // context is always 0 (needed for java-side backwards compat.) this->reference = IcedTeaPluginUtilities::getReference(); IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &message); message.append(" NewGlobalRef "); message.append(object_id); postAndWaitForResponse(message); IcedTeaPluginUtilities::releaseReference(); } JavaResultData* JavaRequestProcessor::findClass(int plugin_instance_id, std::string name) { std::string message = std::string(); std::string plugin_instance_id_str = std::string(); IcedTeaPluginUtilities::itoa(plugin_instance_id, &plugin_instance_id_str); this->instance = 0; // context is always 0 (needed for java-side backwards compat.) this->reference = IcedTeaPluginUtilities::getReference(); IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &message); message.append(" FindClass "); message.append(plugin_instance_id_str); message.append(" "); message.append(name); postAndWaitForResponse(message); return result; } JavaResultData* JavaRequestProcessor::getClassName(std::string objectID) { std::string message = std::string(); this->instance = 0; // context is always 0 (needed for java-side backwards compat.) this->reference = IcedTeaPluginUtilities::getReference(); IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &message); message.append(" GetClassName "); message.append(objectID); postAndWaitForResponse(message); return result; } JavaResultData* JavaRequestProcessor::getClassID(std::string objectID) { std::string message = std::string(); this->instance = 0; // context is always 0 (needed for java-side backwards compat.) this->reference = IcedTeaPluginUtilities::getReference(); IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &message); message.append(" GetClassID "); message.append(objectID); postAndWaitForResponse(message); return result; } JavaResultData* JavaRequestProcessor::getArrayLength(std::string objectID) { std::string message = std::string(); this->instance = 0; // context is always 0 (needed for java-side backwards compat.) this->reference = IcedTeaPluginUtilities::getReference(); IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &message); message.append(" GetArrayLength "); message.append(objectID); postAndWaitForResponse(message); return result; } JavaResultData* JavaRequestProcessor::getSlot(std::string objectID, std::string index) { std::string message = std::string(); this->instance = 0; // context is always 0 (needed for java-side backwards compat.) this->reference = IcedTeaPluginUtilities::getReference(); IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &message); message.append(" GetObjectArrayElement "); message.append(objectID); message.append(" "); message.append(index); postAndWaitForResponse(message); return result; } JavaResultData* JavaRequestProcessor::setSlot(std::string objectID, std::string index, std::string value_id) { std::string message = std::string(); this->instance = 0; // context is always 0 (needed for java-side backwards compat.) this->reference = IcedTeaPluginUtilities::getReference(); IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &message); message.append(" SetObjectArrayElement "); message.append(objectID); message.append(" "); message.append(index); message.append(" "); message.append(value_id); postAndWaitForResponse(message); IcedTeaPluginUtilities::releaseReference(); return result; } JavaResultData* JavaRequestProcessor::newArray(std::string array_class, std::string length) { std::string message = std::string(); this->instance = 0; // context is always 0 (needed for java-side backwards compat.) this->reference = IcedTeaPluginUtilities::getReference(); IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &message); message.append(" NewArray "); message.append(array_class); message.append(" "); message.append(length); postAndWaitForResponse(message); IcedTeaPluginUtilities::releaseReference(); return result; } JavaResultData* JavaRequestProcessor::getFieldID(std::string classID, std::string fieldName) { JavaResultData* java_result; JavaRequestProcessor* java_request = new JavaRequestProcessor(); std::string message = std::string(); java_result = java_request->newString(fieldName); this->instance = 0; // context is always 0 (needed for java-side backwards compat.) this->reference = IcedTeaPluginUtilities::getReference(); IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &message); message.append(" GetFieldID "); message.append(classID); message.append(" "); message.append(java_result->return_string->c_str()); postAndWaitForResponse(message); IcedTeaPluginUtilities::releaseReference(); delete java_request; return result; } JavaResultData* JavaRequestProcessor::getStaticFieldID(std::string classID, std::string fieldName) { JavaResultData* java_result; JavaRequestProcessor* java_request = new JavaRequestProcessor(); std::string message = std::string(); java_result = java_request->newString(fieldName); this->instance = 0; // context is always 0 (needed for java-side backwards compat.) this->reference = IcedTeaPluginUtilities::getReference(); IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &message); message.append(" GetStaticFieldID "); message.append(classID); message.append(" "); message.append(java_result->return_string->c_str()); postAndWaitForResponse(message); IcedTeaPluginUtilities::releaseReference(); delete java_request; return result; } JavaResultData* JavaRequestProcessor::getField(std::string source, std::string classID, std::string objectID, std::string fieldName) { JavaResultData* java_result; JavaRequestProcessor* java_request = new JavaRequestProcessor(); std::string message = std::string(); java_result = java_request->getFieldID(classID, fieldName); this->instance = 0; // context is always 0 (needed for java-side backwards compat.) this->reference = IcedTeaPluginUtilities::getReference(); IcedTeaPluginUtilities::constructMessagePrefix(0, reference, source, &message); message.append(" GetField "); message.append(objectID); message.append(" "); message.append(java_result->return_string->c_str()); postAndWaitForResponse(message); IcedTeaPluginUtilities::releaseReference(); delete java_request; return result; } JavaResultData* JavaRequestProcessor::getStaticField(std::string source, std::string classID, std::string fieldName) { JavaResultData* java_result; JavaRequestProcessor* java_request = new JavaRequestProcessor(); std::string message = std::string(); java_result = java_request->getStaticFieldID(classID, fieldName); this->instance = 0; // context is always 0 (needed for java-side backwards compat.) this->reference = IcedTeaPluginUtilities::getReference(); IcedTeaPluginUtilities::constructMessagePrefix(0, reference, source, &message); message.append(" GetStaticField "); message.append(classID); message.append(" "); message.append(java_result->return_string->c_str()); postAndWaitForResponse(message); IcedTeaPluginUtilities::releaseReference(); delete java_request; return result; } JavaResultData* JavaRequestProcessor::set(std::string source, bool isStatic, std::string classID, std::string objectID, std::string fieldName, std::string value_id) { JavaResultData* java_result; JavaRequestProcessor java_request = JavaRequestProcessor(); std::string message = std::string(); java_result = java_request.getFieldID(classID, fieldName); this->instance = 0; // context is always 0 (needed for java-side backwards compat.) this->reference = IcedTeaPluginUtilities::getReference(); IcedTeaPluginUtilities::constructMessagePrefix(0, reference, source, &message); if (isStatic) { message.append(" SetStaticField "); message.append(classID); } else { message.append(" SetField "); message.append(objectID); } message.append(" "); message.append(java_result->return_string->c_str()); message.append(" "); message.append(value_id); postAndWaitForResponse(message); IcedTeaPluginUtilities::releaseReference(); return result; } JavaResultData* JavaRequestProcessor::setStaticField(std::string source, std::string classID, std::string fieldName, std::string value_id) { return set(source, true, classID, "", fieldName, value_id); } JavaResultData* JavaRequestProcessor::setField(std::string source, std::string classID, std::string objectID, std::string fieldName, std::string value_id) { return set(source, false, classID, objectID, fieldName, value_id); } JavaResultData* JavaRequestProcessor::getMethodID(std::string classID, NPIdentifier methodName, std::vector args) { std::string message, signature = "("; // FIXME: Need to determine how to extract array types and complex java objects for (int i=0; i < args.size(); i++) { signature += args[i]; } signature += ")"; this->instance = 0; // context is always 0 (needed for java-side backwards compat.) this->reference = IcedTeaPluginUtilities::getReference(); IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &message); message += " GetMethodID " + classID + " "; message += IcedTeaPluginUtilities::NPIdentifierAsString(methodName) + " "; message += signature; postAndWaitForResponse(message); IcedTeaPluginUtilities::releaseReference(); return result; } JavaResultData* JavaRequestProcessor::getStaticMethodID(std::string classID, NPIdentifier methodName, std::vector args) { std::string message, signature = "("; // FIXME: Need to determine how to extract array types and complex java objects for (int i=0; i < args.size(); i++) { signature += args[i]; } signature += ")"; this->instance = 0; // context is always 0 (needed for java-side backwards compat.) this->reference = IcedTeaPluginUtilities::getReference(); IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &message); message += " GetStaticMethodID " + classID + " "; message += IcedTeaPluginUtilities::NPIdentifierAsString(methodName) + " "; message += signature; postAndWaitForResponse(message); IcedTeaPluginUtilities::releaseReference(); return result; } void getArrayTypeForJava(NPP instance, NPVariant element, std::string* type) { if (NPVARIANT_IS_BOOLEAN(element)) { type->append("string"); } else if (NPVARIANT_IS_INT32(element)) { type->append("string"); } else if (NPVARIANT_IS_DOUBLE(element)) { type->append("string"); } else if (NPVARIANT_IS_STRING(element)) { type->append("string"); } else if (NPVARIANT_IS_OBJECT(element)) { NPObject* first_element_obj = NPVARIANT_TO_OBJECT(element); if (IcedTeaScriptableJavaPackageObject::is_valid_java_object(first_element_obj)) { std::string class_id = std::string(((IcedTeaScriptableJavaObject*) first_element_obj)->getClassID()); type->append(class_id); } else { type->append("jsobject"); } } else { type->append("jsobject"); // Else it is a string } } void createJavaObjectFromVariant(NPP instance, NPVariant variant, std::string* id) { JavaResultData* java_result; std::string className; std::string jsObjectClassID = std::string(); std::string jsObjectConstructorID = std::string(); std::string stringArg = std::string(); std::vector args = std::vector(); JavaRequestProcessor java_request = JavaRequestProcessor(); bool alreadyCreated = false; if (NPVARIANT_IS_VOID(variant)) { PLUGIN_DEBUG("VOID %d\n", variant); id->append("0"); return; // no need to go further } else if (NPVARIANT_IS_NULL(variant)) { PLUGIN_DEBUG("NULL\n", variant); id->append("0"); return; // no need to go further } else if (NPVARIANT_IS_BOOLEAN(variant)) { className = "java.lang.Boolean"; if (NPVARIANT_TO_BOOLEAN(variant)) stringArg = "true"; else stringArg = "false"; } else if (NPVARIANT_IS_INT32(variant)) { className = "java.lang.Integer"; char* valueStr = (char*) malloc(sizeof(char)*32); sprintf(valueStr, "%d", NPVARIANT_TO_INT32(variant)); stringArg += valueStr; free(valueStr); } else if (NPVARIANT_IS_DOUBLE(variant)) { className = "java.lang.Double"; char* valueStr = (char*) malloc(sizeof(char)*1024); sprintf(valueStr, "%f", NPVARIANT_TO_DOUBLE(variant)); stringArg += valueStr; free(valueStr); } else if (NPVARIANT_IS_STRING(variant)) { className = "java.lang.String"; stringArg = IcedTeaPluginUtilities::NPVariantAsString(variant); } else if (NPVARIANT_IS_OBJECT(variant)) { NPObject* obj = NPVARIANT_TO_OBJECT(variant); if (IcedTeaScriptableJavaPackageObject::is_valid_java_object(obj)) { PLUGIN_DEBUG("NPObject is a Java object\n"); alreadyCreated = true; } else { PLUGIN_DEBUG("NPObject is not a Java object\n"); NPIdentifier length_id = browser_functions.getstringidentifier("length"); bool isJSObjectArray = false; // FIXME: We currently only handle <= 2 dim arrays. Do we really need more though? // Is it an array? if (IcedTeaPluginUtilities::isObjectJSArray(instance, obj)) { PLUGIN_DEBUG("NPObject is an array\n"); std::string array_id = std::string(); std::string java_array_type = std::string(); NPVariant length = NPVariant(); browser_functions.getproperty(instance, obj, length_id, &length); std::string length_str = std::string(); IcedTeaPluginUtilities::itoa(NPVARIANT_TO_INT32(length), &length_str); if (NPVARIANT_TO_INT32(length) >= 0) { NPIdentifier id_0 = browser_functions.getintidentifier(0); NPVariant first_element = NPVariant(); browser_functions.getproperty(instance, obj, id_0, &first_element); // Check for multi-dim array if (NPVARIANT_IS_OBJECT(first_element) && IcedTeaPluginUtilities::isObjectJSArray(instance, NPVARIANT_TO_OBJECT(first_element))) { NPVariant first_nested_element = NPVariant(); browser_functions.getproperty(instance, NPVARIANT_TO_OBJECT(first_element), id_0, &first_nested_element); getArrayTypeForJava(instance, first_nested_element, &java_array_type); length_str.append(" 0"); // secondary array is created on the fly } else { getArrayTypeForJava(instance, first_element, &java_array_type); } } // For JSObject arrays, we create a regular object (accessible via JSObject.getSlot()) if (NPVARIANT_TO_INT32(length) < 0 || !java_array_type.compare("jsobject")) { isJSObjectArray = true; goto createRegularObject; } java_result = java_request.newArray(java_array_type, length_str); if (java_result->error_occurred) { PLUGIN_ERROR("Unable to create array\n"); id->append("-1"); return; } id->append(*(java_result->return_string)); NPIdentifier index_id = NPIdentifier(); for (int i=0; i < NPVARIANT_TO_INT32(length); i++) { NPVariant value = NPVariant(); index_id = browser_functions.getintidentifier(i); browser_functions.getproperty(instance, obj, index_id, &value); std::string value_id = std::string(); createJavaObjectFromVariant(instance, value, &value_id); if (value_id == "-1") { PLUGIN_ERROR("Unable to populate array\n"); id->clear(); id->append("-1"); return; } std::string value_str = std::string(); IcedTeaPluginUtilities::itoa(i, &value_str); java_result = java_request.setSlot(*id, value_str, value_id); } // Got here => no errors above. We're good to return! return; } createRegularObject: if (!IcedTeaPluginUtilities::isObjectJSArray(instance, obj) || isJSObjectArray) // Else it is not an array { NPVariant* variant_copy = new NPVariant(); OBJECT_TO_NPVARIANT(NPVARIANT_TO_OBJECT(variant), *variant_copy); className = "netscape.javascript.JSObject"; IcedTeaPluginUtilities::JSIDToString(variant_copy, &stringArg); browser_functions.retainobject(NPVARIANT_TO_OBJECT(variant)); std::string jsObjectClassID = std::string(); std::string jsObjectConstructorID = std::string(); std::vector args = std::vector(); java_result = java_request.findClass(0, "netscape.javascript.JSObject"); // the result we want is in result_string (assuming there was no error) if (java_result->error_occurred) { PLUGIN_ERROR("Unable to get JSObject class id\n"); id->clear(); id->append("-1"); return; } jsObjectClassID.append(*(java_result->return_string)); args.push_back("J"); java_result = java_request.getMethodID(jsObjectClassID, browser_functions.getstringidentifier(""), args); // the result we want is in result_string (assuming there was no error) if (java_result->error_occurred) { PLUGIN_ERROR("Unable to get JSObject constructor id\n"); id->clear(); id->append("-1"); return; } jsObjectConstructorID.append(*(java_result->return_string)); // We have the method id. Now create a new object. args.clear(); args.push_back(stringArg); java_result = java_request.newObjectWithConstructor("", jsObjectClassID, jsObjectConstructorID, args); // Store the instance ID for future reference IcedTeaPluginUtilities::storeInstanceID(variant_copy, instance); // the result we want is in result_string (assuming there was no error) // the result we want is in result_string (assuming there was no error) if (java_result->error_occurred) { PLUGIN_ERROR("Unable to create JSObject\n"); id->clear(); id->append("-1"); return; } id->append(*(java_result->return_string)); return; } } } if (!alreadyCreated) { java_result = java_request.findClass(0, className); // the result we want is in result_string (assuming there was no error) if (java_result->error_occurred) { PLUGIN_ERROR("Unable to find classid for %s\n", className.c_str()); id->append("-1"); return; } jsObjectClassID.append(*(java_result->return_string)); std::string stringClassName = "Ljava/lang/String;"; args.push_back(stringClassName); java_result = java_request.getMethodID(jsObjectClassID, browser_functions.getstringidentifier(""), args); // the result we want is in result_string (assuming there was no error) if (java_result->error_occurred) { PLUGIN_ERROR("Unable to find string constructor for %s\n", className.c_str()); id->append("-1"); return; } jsObjectConstructorID.append(*(java_result->return_string)); // We have class id and constructor ID. So we know we can create the // object.. now create the string that will be provided as the arg java_result = java_request.newString(stringArg); if (java_result->error_occurred) { PLUGIN_ERROR("Unable to create requested object\n"); id->append("-1"); return; } // Create the object args.clear(); std::string arg = std::string(); arg.append(*(java_result->return_string)); args.push_back(arg); java_result = java_request.newObjectWithConstructor("[System]", jsObjectClassID, jsObjectConstructorID, args); if (java_result->error_occurred) { PLUGIN_ERROR("Unable to create requested object\n"); id->append("-1"); return; } id->append(*(java_result->return_string)); } else { // Else already created std::string classId = std::string(((IcedTeaScriptableJavaObject*) NPVARIANT_TO_OBJECT(variant))->getClassID()); std::string instanceId = std::string(((IcedTeaScriptableJavaObject*) NPVARIANT_TO_OBJECT(variant))->getInstanceID()); if (instanceId.length() == 0) id->append(classId.c_str()); else id->append(instanceId.c_str()); } } JavaResultData* JavaRequestProcessor::callStaticMethod(std::string source, std::string classID, std::string methodName, std::vector args) { return call(source, true, classID, methodName, args); } JavaResultData* JavaRequestProcessor::callMethod(std::string source, std::string objectID, std::string methodName, std::vector args) { return call(source, false, objectID, methodName, args); } JavaResultData* JavaRequestProcessor::call(std::string source, bool isStatic, std::string objectID, std::string methodName, std::vector args) { std::string message = std::string(); this->instance = 0; // context is always 0 (needed for java-side backwards compat.) this->reference = IcedTeaPluginUtilities::getReference(); IcedTeaPluginUtilities::constructMessagePrefix(0, reference, source, &message); if (isStatic) message += " CallStaticMethod "; else message += " CallMethod "; message += objectID; message += " "; message += methodName; message += " "; for (int i=0; i < args.size(); i++) { message += args[i]; message += " "; } postAndWaitForResponse(message); IcedTeaPluginUtilities::releaseReference(); return result; } JavaResultData* JavaRequestProcessor::getObjectClass(std::string objectID) { JavaRequestProcessor* java_request; std::string message = std::string(); this->instance = 0; // context is always 0 (needed for java-side backwards compat.) this->reference = IcedTeaPluginUtilities::getReference(); IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &message); message += " GetObjectClass "; message += objectID; postAndWaitForResponse(message); IcedTeaPluginUtilities::releaseReference(); return result; } JavaResultData* JavaRequestProcessor::newObject(std::string source, std::string classID, std::vector args) { JavaRequestProcessor* java_request; std::string message = std::string(); this->instance = 0; // context is always 0 (needed for java-side backwards compat.) this->reference = IcedTeaPluginUtilities::getReference(); IcedTeaPluginUtilities::constructMessagePrefix(0, reference, source, &message); message += " NewObject "; message += classID; message += " "; for (int i=0; i < args.size(); i++) { message += args[i]; message += " "; } postAndWaitForResponse(message); IcedTeaPluginUtilities::releaseReference(); return result; } JavaResultData* JavaRequestProcessor::newObjectWithConstructor(std::string source, std::string classID, std::string methodID, std::vector args) { JavaRequestProcessor* java_request; std::string message = std::string(); this->instance = 0; // context is always 0 (needed for java-side backwards compat.) this->reference = IcedTeaPluginUtilities::getReference(); IcedTeaPluginUtilities::constructMessagePrefix(0, reference, source, &message); message += " NewObjectWithConstructor "; message += classID; message += " "; message += methodID; message += " "; for (int i=0; i < args.size(); i++) { message += args[i]; message += " "; } postAndWaitForResponse(message); IcedTeaPluginUtilities::releaseReference(); return result; } JavaResultData* JavaRequestProcessor::newString(std::string str) { std::string utf_string = std::string(); std::string message = std::string(); IcedTeaPluginUtilities::convertStringToUTF8(&str, &utf_string); this->instance = 0; // context is always 0 (needed for java-side backwards compat.) this->reference = IcedTeaPluginUtilities::getReference(); IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &message); message.append(" NewStringUTF "); message.append(utf_string); postAndWaitForResponse(message); IcedTeaPluginUtilities::releaseReference(); return result; } JavaResultData* JavaRequestProcessor::hasPackage(int plugin_instance_id, std::string package_name) { JavaResultData* java_result; JavaRequestProcessor* java_request = new JavaRequestProcessor(); std::string plugin_instance_id_str = std::string(); IcedTeaPluginUtilities::itoa(plugin_instance_id, &plugin_instance_id_str); java_result = java_request->newString(package_name); this->instance = 0; // context is always 0 (needed for java-side backwards compat.) this->reference = IcedTeaPluginUtilities::getReference(); std::string message; IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &message); message += " HasPackage " + plugin_instance_id_str + " " + *java_result->return_string; postAndWaitForResponse(message); IcedTeaPluginUtilities::releaseReference(); delete java_request; return result; } JavaResultData* JavaRequestProcessor::hasMethod(std::string classID, std::string method_name) { JavaResultData* java_result; JavaRequestProcessor* java_request = new JavaRequestProcessor(); std::string message = std::string(); java_result = java_request->newString(method_name); this->instance = 0; // context is always 0 (needed for java-side backwards compat.) this->reference = IcedTeaPluginUtilities::getReference(); IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &message); message.append(" HasMethod "); message.append(classID); message.append(" "); message.append(java_result->return_string->c_str()); postAndWaitForResponse(message); IcedTeaPluginUtilities::releaseReference(); delete java_request; return result; } JavaResultData* JavaRequestProcessor::hasField(std::string classID, std::string method_name) { JavaResultData* java_result; JavaRequestProcessor java_request = JavaRequestProcessor(); std::string message = std::string(); java_result = java_request.newString(method_name); this->instance = 0; // context is always 0 (needed for java-side backwards compat.) this->reference = IcedTeaPluginUtilities::getReference(); IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &message); message.append(" HasField "); message.append(classID); message.append(" "); message.append(java_result->return_string->c_str()); postAndWaitForResponse(message); IcedTeaPluginUtilities::releaseReference(); return result; } JavaResultData* JavaRequestProcessor::isInstanceOf(std::string objectID, std::string classID) { std::string message = std::string(); this->instance = 0; // context is always 0 (needed for java-side backwards compat.) this->reference = IcedTeaPluginUtilities::getReference(); IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &message); message.append(" IsInstanceOf "); message.append(objectID); message.append(" "); message.append(classID); postAndWaitForResponse(message); IcedTeaPluginUtilities::releaseReference(); return result; } JavaResultData* JavaRequestProcessor::getAppletObjectInstance(std::string instanceID) { std::string message = std::string(); std::string ref_str = std::string(); this->instance = 0; this->reference = IcedTeaPluginUtilities::getReference(); IcedTeaPluginUtilities::itoa(reference, &ref_str); message = "instance "; message += instanceID; message += " reference "; message += ref_str; message += " GetJavaObject"; postAndWaitForResponse(message); IcedTeaPluginUtilities::releaseReference(); return result; } icedtea-web-1.6.2/plugin/PaxHeaders.17941/docs0000644000000000000000000000013112654402377015615 xustar0030 mtime=1454507263.210432941 30 atime=1454507658.779157357 29 ctime=1454507658.74215785 icedtea-web-1.6.2/plugin/docs/0000755000175000002070000000000012654402377016416 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/plugin/docs/PaxHeaders.17941/npplugin_liveconnect_design.html0000644000000000000000000000013112654402377024336 xustar0030 mtime=1454507263.210432941 30 atime=1454507327.170579923 29 ctime=1454507658.74215785 icedtea-web-1.6.2/plugin/docs/npplugin_liveconnect_design.html0000644000175000002070000001353712654402377025073 0ustar00jvanekmock00000000000000 IcedTeaNPPlugin LiveConnect Design

IcedTeaNPPlugin LiveConnect Design

Plugin Architecture

  • Divided into C++ and Java components
    • C++ side talks to the browser
    • Java side talks to the JVM
    • Linked via a FIFO link
    • Common string exchange format (UTF-8)
  • Over 95% of changes in NPPlugin have been on the C++ side
  • Java side has been reused as much as possible to re-use the proven stable code

C++ Architecture

  • Encompassing classes from the LiveConnect engine (which previously resided in Mozilla and was exposed via OJI)
  • Each JavaScript var corresponding to a Java object has a corresponding IcedTeaScriptableJavaObject
  • Engine controls the object life and services all requests (get field, set field, invoke method, etc.)

C++ Architecture (Browser Interface)

  • Browser interface consists primarily of IcedTeaScriptableJavaPackageObject, IcedTeaScriptableJavaObject and IcedTeaPluginRequestProcessor.
  • Above classes are unaware of Java interactions and delegate to the Java interfaces for Java interaction.
  • They process all requests coming from the browser and going to the browser (getMember, call, eval, etc.)

C++ Architecture (Java Interface)

  • Java interface consists primarily of IcedTeaJavaRequestProcessor.
  • This class has full knowledge of how the Java side works, and constructs appropriate requests to get all information from Java.
  • The class processes all requests to the JVM.

Java Architecture

  • Java side has two core classes aside from helpers: PluginAppletViewer and PluginAppletSecurityContext.
  • PluginAppletViewer is an interface to NetX and processes JS-related requests to and from NetX (the applet).
  • PluginAppletSecurityContext is a direct reflection-based interface to the VM. It processes all LiveConnect requests to and from the JVM.
  • Request processing is asynchronous, with scalable generic request processing workers.

Java Architecture (PluginAppletViewer)

  • Control of applet (initialize, resize, destroy, etc.) from browser.
  • Access to JavaScript from the applet (getMember, setMember, call, eval, etc.)

Java Architecture (PluginAppletSecurityContext)

  • Direct access to the JVM from the browser (LiveConnect) via reflection.
  • All reflection is built-in, so C++ side never needs to be aware of the complexities, unlike how OJI was.
  • All VM calls are inside a sandbox, so JavaScript can not do things that the default sandboxed VM can't.

MessageBus Architecture (C++)

  • The link to Java is exposed to the rest of the code via a uniform "MessageBus" interface.
  • Since the code is unaware of the link specifics and has no synchronicity guarantee, the communication medium can be switched relatively easily.
  • Classes interested in the messages implement a BusSubscriber class and subscribe to the bus of interest.
  • When messages come in, the bus notifies all subscribers.

Example JS->Java Workflow

  • Example shows how NPP_HasProperty() works
  • Browser has a link to an IcedTeaScriptableJavaObject representing a Java object instance.
  • It call IcedTeaScriptableJavaObject::HasProperty()
  • HasProperty() creates an IcedTeaJavaRequestProcessor ("Java processor")
  • The Java processor exposes all necessary APIs to the VM, including hasProperty (called hasField for Java naming consistency).
  • Before making a hasField request, the processor subscribes itself to the "from Java" bus, so that it can read the response.
  • The hasField request is made by the processor and posted to the "to Java" bus.
  • The processor waits for either a response or a timeout.
  • Once a response is received, the processor unsubscribes itself from the "from Java" bus, performs post-processing and returns.
  • The IcedTeaScriptableJavaObject object reads the response and sends it to the browser.

Example Java->JS Workflow

  • All access to JS is via JSObject instances as defined in the LiveConnect specification.
  • If an applet wants to access a member of JSObject, "window" for example, it will call getMember on the window's JSObject.
  • getMember calls a similarly named function in PluginAppletViewer.
  • PluginAppletViewer constructs a request for the C++ side and posts it on the FIFO link.
  • On the C++ side, IcedTeaPluginRequestProcessor (the plugin processor) is always subscribed to the "from Java" bus.
  • When the getMember request comes through, the plugin processor gets notified.
  • The embedded request
icedtea-web-1.6.2/plugin/docs/PaxHeaders.17941/js-java-wf.png0000644000000000000000000000013112654402377020345 xustar0030 mtime=1454507263.210432941 30 atime=1454507327.170579923 29 ctime=1454507658.74215785 icedtea-web-1.6.2/plugin/docs/js-java-wf.png0000644000175000002070000007765612654402377021116 0ustar00jvanekmock00000000000000PNG  IHDRV)sBITO IDATxy`SU6I6ta{hK*= HEP:e^eSGPZE,8 ((iekn%ݗq2޴;yT'n7ю %sHV hQ79^Gum1D%H$Ir&kO2v`t(NC[5pώgFNۤf1CbkёtlO1Hn!.AGB÷UbKБС8/Ft$t(:|Q;0:*z>-h ^cTn!.AGBbq*؁Qm1D%HPt v`tT|p[ p :<>lʶj ?ha C4Zg$7^_'ncH7 !ͦ4HVwܹ%dggI65u6[i71*GKYYY[ml6k%`τ ;˔˗k4jU$''/^[&c FQC 9s挜~С'O6޽{:?T(~jiT;On6??}~Mhln碖VZջwoZ}뭷:t;_ o71gwcyvU)eYlJn8Ҝ.8rqy0-++9sN3 /5緉fܜ|V(2dH_s<Ѽ뮻'.qС!CSL&ӟ'NL(e%BٳgL@Je2JJJy~>;/hzkkkMxⲲzw}wꫯ6oެT_zڍQ[aL'Ojd2\Ufb/`0`A\XEjkk^W__ޅhT*ձc򊊊ں9Bri2Nwygƌ)^^^{va-ZX PTcǎMMMumh cJ?a/w˛O:?ќ%y[ntIv朿Za %SVVh0z9s*++ׯ_UU<G]r ..NPvxIII|||``^l9 t۶mAl6i 믿.4p7BӧO_ь3F> \ӧO !~_WyyywyԖ;buv'=yՎ˴5kz})!fm 6udⱱMGl/߿9CLL|fls-X`˖-٭[Vy|;vw}ŕbݺu={T!!!+WsL9vqFUU,'O0ӧO_p$IjkkҠX8|]]ݒ%K,IRuuu.]Ν{zMJHH(++qƹs"B}G-?iIϚ5wm6= @/_UUU6s^vMPE?~<88A;kNj:>@{}'Guy(J|tڵ^$Kkٲes1#+2;/=#߱|W=y|XoX_ dcC<~g b׮]zc١CBCCoZFC]WWD^{vnիW۬ɚ_yl#N%t:n589OJJJhJ$Hhoq!d$:NN &;<t\bTwߠ?9Qtӧ;&IN66qA]>k֬_]իWϜ9^lsٳgAX7Jܧhᵶn9r>>gϞ;{)=.<k4V-eO۷oժU<ڜ'9`3qݻw8p?('} X`ĺ"!m@XX=$7BjZ-ZO8֠;Y~3 4?doZ13gbls8F+ $Goo~S2Qf͊Ο?ou:`p=؝wioR`4Q-9^#Gz-IҤI6n(I|Jyye[޼l6Q[i޽Bݻwߴ8Z$$ŋ_ {?6m" {MW5*Fqm~:6lj ;&IN66qDܹsgIg :TQFر^ΫWڜGMu~pn=6lGo{>~xпJ.fea"s-ZtJWln|-u:Nޗl欯O~:hgmes+9>@NՙQ huuu+Vhpeͱ͊,?r-S(M),,ɓPՙ[U]x,0۴i;O|9xLڜbqN;AZYY{AmUUߡC$IZty/g͝;1{gy]߾}ׯ_O}yI[6HNIyܹs}^\\P(233k駟,>mڴ3g޸qO?uA6hg)k֬߿NN$I'N8z$I 4 6l3<K4gΜ?igz!57n!'No/_gϞǏ4H1a„/իgNHHB \h4KJJmVjOL;w !,X ?u:]LLLJJJ]]]JJ2m.^]]]WW׵kךUV9x7nl޼׿&5VJJJ}};zhsb```uuuVVv&Wsܸq`ooo:\ͷz̙3$ܹS^T &̟?{SPL>^(**z7|Alf;l[ @G`s(((عsgyyB$IR !l&5koذAEfHk׮0!Dppϑ#G~f펍7.--DGGG'''c-q,0۷o1yyyw}ۂژ^njSRRcǎ͛7s_fbƍ:n555B"oooN'[T$PTFlܹkM4i0%%3 AAArÇ5#lV_{淓'OxR.\222򗿘chN!oh[KBbbbBCCwS߿|fnsu ! 5{Ě ҠIr3Ξ=KxGVxj!7oe˖92mTdHMM}7?#_{txW_߿8:$o$iȐ!$eeeoF߾}⍺Qr %-QՖ?_>sL^̏1L=X.]juxxU$I:qz3l.k4ݻrɓ'<~r$oСC d2ْ4͐!C^jO?"_Fnc-_fZr䈓<;6=XaaZ;v{dlbTG,'$$͛7/>>^yޱGƨAIOOo%v3=]u4Ǐڪvz-ZdfQ%[6gl&Ͻ駟,zjNlNؼ$5kO˗/7_p$=CÆ 3?ANIΝrʛ1Ç& F}O֭hǨMtd-w6?4JQ;du)kyZOjÝN|066V~;{nrL\dEYۨ?./~]IDfddƶh r̙oHÕ1G[RL&SiiѣϟZdi֭1ce ǎ–d2}N z'8SΓҽ{w{FQ^^PUUՠ1cTUU3-/^\|Y;vw=bu>|]Z~93JJJz?.'%&& ^?gΜJ!ĉ'W^LYG~~~юo_ߜ!&&/p\R|G6tIy?ӿ[gϞj:$$dʕr΁<|GMzMzBCCu:ݶmۄO߿F3fLQQQc#Mh"M5<<رcF122򩧞B%%%m߾<##c̵[l۷:+++;;{Æ rJzz/߿ٳ?ɓ'_y!DRRhɹ|rAA/ؠ/R0Lݻw9s槟~*]vFtRDDDFF}Ȑ$iv]vڵ&|ϟ_WWw1cȉ?˗333\R^^ /!͛WPPpue\<((h߾}&iر9rȋ/!rssϝ;'ʬ.MJLLl]~ʎ?# T* 6l۶m$\rԩϟj [['q?W^qӒGyDϜ9SZW^:c Iϟ-yUVVJ[o%IիBV .\J$F3iҤ?A|#p IDAT{sYYYRȐ}1BRI8`7,▙O>`uYf$^z̙r//\~^JJJk~-1U*Ֆ-[ʬ7XqÇOOOL7`$5ȽzlDlcn5FyTJeűc,?Z~}DD#ʄZvǎ7o :t-Kؿmf.6 @QPPP(={J9GW^ϯz~򙨹4~-[!l2sLNWWWWQQaƍz Wyy{7rAlݺu…|PYYy…'xBragFznͥ.]0ak`Iu9yկ~ 6&&FމƌSRRR\\jr2Blܸ122R >>`v]f9[noFznߒ,FEE:{RO?m2jjjv)܉233te\\ vZSSj*9[ouIv_ZNSR&L0{AN)SݻEGGׯ[N^$88ȑ#B?ܹ\PH$2yjס룣,fl&ڬt,.w/U`UK={o/]4dV+?ᄏ<$ISN |'_yCCCZ6 Fj**u:݅ {:t(&&Ɯ244['qٳ- 8poYPP̧6Q-e36-gl.%o}рqmݺSU>ߩZVN~̙3zN~''L{K.j:<<|ժU$8qo߾O=yT{?{9%%G;w۷o^:LIl gntɓ'k#""|IsEW֭[ll>kN^իC;~ O?t```HHȧ~<$I?w7jԨF}G6d6+bоpjɿr@sSYYYv<;zɓ/^ة'N3 !srrI 6ڵkŊsν>BHII=z-Ҡ?<#~~~Nȸۺuvԩ>}$$$رd2]rk׮6o+ݻٳCBB,>i;տWglAgs$y[`st{}ۗ5kǛT!?O9@B$&&?~m.\0x`g>MNN 3 ouk׮U*ZvȑgΜҥ˒%Kbbbۯ_?9[``DDD/Z/%gۼyٳg/^l:pC̣WͣEEE}嗎X^I:2&`ilni49QѪ$)Z MpFۢs61*](ۺhdQ,x`C: 51*\`` 2F b鰜h) V iSZ#eʰN94AJ^a<*\'͜!S(gOE MFf!GF#%@ s&#Fh) :ubTK<HĨwA pĨwA pĨJVs) QsG"F bT F KT(./0 ļ]srG3BG bTx/ں!p<럙L!FECh xֈQyd\x̣­56.uޅ{m1##F[sՉ;$'?wa87Gk܅˽0ѝr6axN2<*ш["~ Zc&<*<(30 p2pwA NM@ pĨx\=Q5bT.q<*]1*;lbT"8E41*]`sG"F bTܹ  jluYYYvĉB$''/^؅k0wP(4xz]XX؜2>\XX+={vjjjqq O<*RL_uf̘a.|ر/V2 ݻw唷~GjzȐ!k׮޽_nx ,-//OLL HHHYTTtj4ȯʜ{#F>|׮][WGm^` FuUUݻgΜ麕R³7֨'ĉy䜜W^y[pFۢs61*Z 0ĽE<@ d8NG -k1\TkĨc *M1 A*WĨpsg$ɲ=mAP<*K<*g$և+z8urrŋ]$7Gm^[kFmAݻ >|066V~;{b<*ˮ[nƌ*jرhW; 9hQnڵݻw֭oay nVVF1LII޽c=VSScsq!Diii|||@@N{׬Y_e'&&$$$TUU !v=b˖>|׮]-i8ĨVTT}򌌌ѣGY]]g'O|W-PYYy…'xB^6+++;;{Æ 7-Sd4srr._\PP/K.EDDX.y)oΑ F5oo ɤov{9%IzW|}} ß-[\죏>ZbR}罽U*MˬxWXjjҥKmVRRkV5-]PĨjwرy搐C44ٳgdd8LN x$bT[r_|QYYT*Zm}}}HHFOW^mΩP(,YRQQQTT/>C6WӦMxƍZTqqq ,())BٳG1~or}7%6 5bT.qnٲe]th4)))6mz7͛.T3dȐ^z׿^hŅ^^^aaa᭷rP2k׮U*ZvȑgΜB$$$|ev=s̖,x*$ZB]p>'1A<ĉyX!DrrrNNQ p!bT*cANu.QKrhbT F e[7˻(ܖBUD 1ǫVa<m'c+BfV-4J.G SXh9Nr'$R8F71*hν-8 Q#p[tN#8TsgF 3Q\?nbT F bTKN x$bTmĉ_'''/^mhK\eee);ӜRUUu-h46l7|p;wAfy]4FjFrÇ ccc巳gNMM-..n _0 pOaaO?$O C6Iw)S/..>|a.]`Je2L&Saaa~fϞݨ׭[7c Ǝڴ)>jhbTdYYY;w^j`޽/'&&$$$TUU !֭[C !Z?/xb@@@}}B߸q\† ,C;]{~~~ݺu{7l=zPC 6?aF,Oڬe…˗/6mR}'Ml2{nIR͚5KG󛷛yغͻw1be9ÇߵkW* FW]]]TTtG}t…rbRRhɹ|rAA/(6lXZZA~6tN: !f͚ZWW{I&k.())iGNB;vh4FFF>S͛TPPp>^-G>}*}ReeM.{[ϺFҥK"##O:՘ٛbv "9YۛujA|k A233$${{{y:ԧO`~_z饰W_}533SRI4|?|IIIj^;w޴iӍ7tKGڵd2u\_~Vm֒T*myt:NյkןYNQ~-uϟ?e]FqHnxС0 NRiZ!ouu"??&**JѣGș6|9r$--mذafϞqƍ7Zk@Vcǎ͛7 :)BGDD1L.SNկaaaj k n&Fh4L~r6t l7njںF NPPwnn 6o=rȠA '?~eM{nJeh.,,2eʬYSFcbb[RR7ߘP__U$GGGo۶rn:j(g6EΝyNS[[[__/(((0if^zYr222nv6?p:Z`y4//oϞ=GÆ {Rbcc׮];h 櫯?q\_TVV*JV[__oR]]]WWX]]b 'NhѢ_~A_}%Kl߾bʕ۷o_t3:555<<\h>իW,?~~kYξ}ƍ1*wYvR j#G`I_[+4hЭz-[֥KFi&.],Y$&&o߾,pݺu׮]3 w}^{9r;V\w޴4`{G :qĦM^^^oycbbmB$$$${3g6kVhMCu<;=w~ꩧۺ!kĉ<'''+m(c1< 1*ZvKOԩӭޚ;uѣG/iFh @QxҤI;߿>-Y#ts0VuPvx #VccQ:3mt,h{}fh놸@VVB;w oϝ;f&mlOG@3-w6/IRaa`pacT*dr:޽{Nr}$''6ȑ#h]vk׮.l0Zc3.jvv^z_^N)..>}N z'kkk̙3Ǽȸqy!DyyybbbPPP@@@BBBUU<5f͚fm…˗/'6mڲeO3yO>^?- S^^} 6:uj[n?7o+W&N/? JNN)**JKK۲e")),''SN3g|̙S]]]__ߜ9rdݖqqqsΕ__ti֭Zbb̙3̙s7FpfjZ.8Z͎ s{۷of2rss巻v튌$i;w$)99y„ ${{{9:ԧOL!Dqqqt/>#9QRːT*$;wgF IDATѣkgZA:'c܅d'L݅m 1*hpyhj)""_pK/֫Ww}WV'MhѢ^xaƌB={zs3f3..n%%%B={%Ko^[[[QQr۷/]Tsԩ]vM>]<1*ZZ://o۶… ynݺEFFyK,g^|ڵJ2<<\Վ9̙3mȑ#wرrʀ{<#ؼyٳg/^z?(0; pOU8ۢs֘G8{}.Tx+ _̣L ҚG-7!bU F!lĥ@FhVZ 3 <عsg|Mll@@9),;`$I*,,4 .,VDRL&3ݻwԩ)))w_MMMrraÎ9&vZ׮]HPVx/hE#u{^ѻ\vv^z_^N)..>}N z'kkk̙3Ǽȸqy!DyyybbbPPP@@@BBBUU<5f͚fm…˗/6mR}'Ml2>}L1/"Yhfp-bTv{#G4hPAA֭[.\(4obTpIwy9[nh4m*F=yZvԨQ7}tG.,,Ξ=;55+MT*cQAABڵkB|p֭B[>B(9=ztIIBRXWRag k0H5X0444***<<<''܅OaaO?$O]L&ۻw)S~ >|ذa.]r<TXXد_ٳg7u͘1òcǦ6푧^k1e 8֩ScFGGZ < M>>;'O, ͕ʒ|6?::Z5ۺuQג$۷oܹ!!!7oNHHkpo01*vwäЋUV ݻr1֭{衇uuuZB\x1 ^PoܸQ.aÆ ׮]۽{w??nݺ6S~=z!Cdgg ϟ0aFLNN'lmbQݒJ5k<Sm޽{#,>|]U֡)a*"""^~ .KiiizzwjzҤI-(,,|k={[Ν;f9g\\܂ ӼNڵk] 1N\ի>A61lذ4! :--mС:uB̚5+55.77ѣ&M2b]`QQQRR322Fm"?vh|ꩧΛ7/((|Z?[ܴi]weoYh4^t)""2[dd?:4uۋ2@5~m۶]par;S^^ޭ[;sɒ%rz\\ܞ={̋]VTkڑ#G9sƵ9r;V\w޴4g7o>{ŋCBB\[/Z3Wq?$33SQZZ*Iҏ? IRyyw^^СC}_ _^ JLL|W333U*$IÇϗ/_VXZZڹsM6ݸqCNNtѮ]ʯM&SN~jf-999JAQz溛Nt^^^]vtyY^^^5j4Vi KRiZ!!:thZZZZZxȑaÆK={ƍ7nhyZ;6o2tЃZ!֯_ۻ㟁%ZR.i5$ef^M2M6"M3Ӿ׾|5 4BLTPa:93 ax=s>s3g{Y:>ƍREEEݺuWq.MǮNjk4fb4dԅQ…1: :Ot@t17XUURL˯Zj֬Y={},X[WWRDGGXN"##M)C577gffJnHJ2`uy.Qt'OtK.yzz655t#G˛.EϞ=Gñ~رc.ٲB )g*!|V^1dȐ/;:thjj gVewﮭU*tH}}}SSSPPP}}5k +^QRRoZ 8>(ѣZnHLcB;:twQrT@z~t:˟߆7Jxw߲¦PZi&!III111QQQ}5pׯ_ yGwZ 8̪|M6 !<==׮];{޽{H%McB$$$_$Ֆ1eYryp*WPݓE[>e$6@\(##c޼yΝsu _\\… d>--ŋ)))xwA )D </m^_.q8~ThRо@gK . Y9*!nT[3 []-_NNNNZ^Onnnppcu:tH;--m-9*!++kС~~~;w۷_s;ĉC9s-[JKK~T@kڲvnjeg[!Gȅݳ999jZ? ;zT ??0!!ARyzz8pȐ!fkKOO ܹ9saaa]v]zb遁SN*{5}t{M묮NLL  LHHBddd >paÆٳ@;G k׮͚5_ѣW^_}mϟp©SRRRJJJΝcǎX!DBBBmmKJJJ^xiœ܍7޲N!ܹsZŋ\RTT|rV{刈i###O>N͟?'z+WoBVG=VjP(III555%%%˗/s}}}Β7ZkРAwq=ܳhѢPZi&!DZZg^BBB>#1)HMMU*{h4#F8{"!!?OXWW1e 7 D[^aZg{Im :TvE=nL48xMV8vGS1QrA c999:urb.''GV;t"--mN nrrr z;,..nI'N(.. 3s-[:)^7tu\ۻʉ_>>>^_1cl /8qچٿ'K$ fG*GЪGJC֭[7hР\}԰0__߮]^ڴ*ûy KWՑ~~xFF6lϞ=[VՁ[}}}IIɵkf͚/K{j###͛' ,));w;ccc፛|Bʩrrrz]QQhN>=l0?ƍw5!DeeehhhZZڄ WIK7lp}{オ555.]֭ĉ'O޳g4ƍyyyݻwBdddL8ҥKwuWcc>TVVYkn |cKp 5<*оy{{k4!O}}4pÆ )))Rjj4;wZ^~n6oooV-''GO>ҿ:[_HPH oojjTVVʒ㜝Hhy{ h3Z611?.//?pa3vؽ{O0aƌV* VTW^jZP?6$$DK^tI# gϞϟחΎvfTr/xp7MMMAAAk֬/((ؽ{wmmRh4V*4iK/T^^.߷o-)..NNN֏;v:tsRY@+q~ʥYBCCbbbԔV7mdTRٻwoF3bĈgMOO/)) sﺺ)S8or "9O XI: :4--ŋ)))`(>*-}`k GEb%`A{z #cx hKqQ.}]-=!5ϣCI-^ص&Wds-u5''SNj{kP(j/&&Ύ c6ĉC9s-[JKK[;6=5UXf$tL=Gu oo着g}hlccecmׯ7p̘1[lqb$mCӵeH&Pr(aZnݺp??AJSSS|}}vzj}aOOI&egg]~a^O^ZZ/gJe:wpY gϞoVɖ2F(OX"GwYYYZ622r޼yBsر:;;;66V_q֭QQQҿ9997n={J*((8wѣG|M}Ç?… NJIIB̝;W^xʕ+EEE˗/7ozn¦LW_ !_wߍ5!6F*n߿nMR ǏBxyyT쪪h} ^~4N{T*Ucc_;,[LϭNKII Yt֭[kjj>5kh4??%Kl߾ݰ6ooo]v !mc !<==}|| i4V $["Gڛ Gmذ!""sÇqBܹs=zޖ|'<( dTnn(A%M9*ȎٷgfHSю 1 #*i*u Gej44rTT2ٕ͐$Maq;%Ԁ!T}yiZbJ'FSqQѦ, ~ZzS۠5: $F5Л `m8\ Q=$p`T}m ;Q5Z#$A3Q9+[ޒ]1FD?*@."G U-G9*dvp3<%p 9*8Z  G@픀["GE[\؂~T\Bl7Ç!Gg:]K hpKhK\[Џ rTf51L\k rT\BQr@&G9*@.QrA rT\  G9*@.QrA rT\  G9*@.QrA rT\  G9*@.QrA rT\  G9*@.QrA rT\  G9*@.QrA rT\  G9*@.QrA rT\  G9*@.QrA rT\  G9*@.QrA rT\OծZjȑ]tի׈#ϟ_߸q؊+ B0. \bKj80~]T*^X6ޮWlY0߷oy::Q<5644^rVz'6nֲ{QFڵ덍UÊ~i͚5;vpu8=h=pgq_o:u?cZZZ\\Jru@+JNNnnnZmeeeeer&qzW+oRSSMvyWG5Zъ+o]?<44g ] \B;sI!D||A\K`)///Z-V 0pիW6<-я ww^!O?mxj[nQQQmІ~~~6'TUU9*?cB}: !ܹs=\TT~_~lw}󋉉IKKknn6X g駟>~~~[vmSS_^|hZRBCCG[o}t[j+WY&...,,[VGEE=999f멫{뭷>CN廚 ԹsgB;a|A~:uhƎ?JeKǍeC,_}U÷Hu:ݖ-[}Ѡ OOϠѣGf;oV8vqxw.]L6m޽VR':uP(y466vEP/rؾñkUUU)))?pPPR;Ǐf]۷ի!\FݷoիW744X ́}ـ ūjXR˞ *** Err-[ҖACEFmY4-Z-tҥbvM[o)fnWT6m2*\QQ0a²eL2ioa:7xViWHҨ˗O>tɓ'۵BK:6ٳ}||+eee>i᧞z|.]:~x-cW -[6aIѣGml^ƍRƱDFc۸c !z/Ni?B}҄Ǐwr[wcܯ^z]w-,8z--,Y"oTZ6bvB 24*DBN7f!#}zfffqq?0yd!D^LW\ I*`3gΔ9rdҨ6ڵkQQQQ6m-++ٶmĉ 7+m:+|_|YرBFse'Nyg~ǒ?ORY%&&fff;w.33ӁSR.\(,,ܸqb/Wrr~TNy _d JNO'L?H/ 5k-`c_߁maUUU7o=zdXvmQQQKjnS̙3KXoǮK{xx,^ɓEEE'OLKK9rcliINO!.–jǶi5m4i9uTiԌ3&qln)J}^t۷oF믦#qѦLY?ڸYop-D w믿&CCC.]7ߘ^tR&o:t_~'Nj3gQٳgk8ރ! .Ë5⩧2~e///aJCCX@鬶A%K9rD_4*?w\BkJFnذpʕ+F7egg Fg͚%2J>k+4%fm)}]QJ?~;+vmmm@@bF嫪-[Xo޹ s `L[ٳ sK+kuK}ZBB4*++K?%vK^ĺn/UP]Fm_48b;s:wذҥKMMMU1Ѳސ뮻K]~ŋ !<==/^h:cMT^wsz!?BZmz[z"|@L0022hٳgo9>=-6g!OYYQd7ǁRXb׷kw~i=z4((hΜ9F7RWlD(<3oF`l;+WzyyiI&?wޱמwqٳ1V;XߧIûS6C!Ľ+=$'_|lXa6 C GEǢT*t9ĉǎxZV[[+!ŚI, !ź !X+cʉMyfO111[n=w\qqW^yEa lBW:naFVF鬾O4OzXj+nY-1{jL+**6l$uT*_co) )/?۶mkllT*&MjId޹5رcwڵpxO>_/ jhh]~kٵmIޝ:I]_~7{gvUe6 CʁUәjիdff>CBooƤ$['UR^^n~Icc@{CrF)++3N ƉM&8}~Ձ:uoYZZg ҍcƌ1 Ƶ+sׯߗ_~Y]]}GݻСCO<۟z)^^^-LoFl ~yUWWo߾}_~Cr~Tt\?絤{_m!=)Gdܹs;6VPP`:ސNq[tb04%?bGFC!-=kwyXr 5FKeZεc[b V9r֭O<__>{'^x&¡'n.\:Mou}}}G3gHҿƹF o}Ν;K}m۶Ri8 m0BKhPݥ?F-Ȱ֠ !ۧoJO߿tDӗt_ >#XV81Β:!ً _ "yGvVUUwzr 5MDz2j966Bkv]w=#֭+))6m޽{/]'脣M'%vܺuBHmygڴiJ6b}f8Ikۥg[})S7nicpa*gKp 9*3 _:mn{8p`ddoP(F'\vO?pԱٹsԛ:a7$'',??ȑ#VzGvjX~ʔ)Rӧ%%%@S ޽[8hРcǎ<<_^c,4Ɍ3􍟕eBgy峖88v-wT[dddrrr^^S4+tgoƴLk.K;P(}ueeefffΝ;k׊jcۈ6i$YYYu1!Č3&q]"D-HHHrJ}}}CCCCCQqSHHH}}-ec} յaUrTΝ;  Ŝ9sJOO^zxM\lكMϜ9sf4ЮSFi7s.]`p.ZEE7f23{F&N !<==mXбQXƍcƌ1 >-āƱ,+V06{رcNʈEs6mڤ/ܭ[&2N]5w+ȑ#l Ʈun#˖-`:B8k߮'jĨLAAFk2>Z0j0pgw^`{RnΛ7/++룏>2Mrss_}՘ OOOZOoذӆ5́yhJ~;vtƍ~|7nT(Į+:ujΜ9JK.FzwƁTo;JF2d͛?c9rʻ[RSSm&YzWz!mlll``G```ll֭[wezkÜ8ǽ޲6?0&&)Uh7݄ 75vkǎ[t飏>ڳgO/////ݻmݺoslرc|xyyw}޾}̆}_~t_V[:tuܸqNWvr48(t-VXꫯ g|m'ܹsgtt.ȄV B&&&:grEP7ސ>*sO?mx~ձX1G! :ӿI;qE<}Wu:Q)Qt,f_h"O?t[/* Ajkk}}}YTp:㯓{̜={vbbblllxxxCCӧZ1|p鵨*Vsw}W1a„WnhƦ}%'' !}YW摣p.\pBy|h4 q.7^4ȓJݽ{wQO'бoժUqqq:uR*>hzzcǺvo|||,X?8/dK8p ((ձE   G9*@.QrA rT\  G9*@.N?nݙIENDB`icedtea-web-1.6.2/plugin/docs/PaxHeaders.17941/java-js-wf.png0000644000000000000000000000013112654402377020345 xustar0030 mtime=1454507263.209432954 30 atime=1454507327.170579923 29 ctime=1454507658.74215785 icedtea-web-1.6.2/plugin/docs/java-js-wf.png0000644000175000002070000007760212654402377021105 0ustar00jvanekmock00000000000000PNG  IHDRPsBITO IDATx{\W?  jڏЭT[^[nWjݭ+zi /Pz][TES (0&$u6K&ay=L9sɼLEQ㹺 \qtz"n9B`x7YEw<Ƴb’}G+)-^!h -pF/pfU>E^VJdl57n#7rh-z[rY_s=܎mcJŋggg744رN-U℮ʼZ5,*ӺH$.))Iڀ!ǗO{wR|@z1cD" ! *//g*T*!CAڵ~9--MTdgyݻVJIQT^^ƍ=δ?Y,GEEjkְرcx^OG}}փ>wa׬Yc4o߾]\\w۷E]v8>pB;2kS7W\>|xPP_W}/ҥKӟn޼y[nl޼ZCJ)/\`2fϞ?Ѕz>44Tф 6 Y  wWX;y ʕ+srrr:6m pxQ&''d?O.O qbuҥO?ZsSx1/<^SSn:Ѕs Bȉ'&OhuNz#p-ƀJNj/_`mwd9[APtXf.m۶m^VVY:555%%úh8qӧ?'x.aݳje-LΉs [;ں yyyӱcǎ5-ӗ2r}zС iׯ_f>_RRB?>%iO`0oɒ%.\hoo kjjx<^[[ҥK^3-hNg̘qΝիWS8&^'X{o׎HRTS\\l?O_. )jFCQӧBko't:^*JrF]ϟOQ3<ꫯv;v]Ν;R^xNrrmٳӧO KַSlck#hW^{JKKKKK],w햝h4jc'Zl@ 8~yfu,l |>R555gΜ(_5L֭8q"]CFgaͲ!f F͛}QJZk:omm%>>>MMM׮](j„ ̗BZZF/x<^nn.˚mY`eeeEݼyS&zkI;{lpppMS]"D h-cztz5nܸF199C%e} 0WX1i$ ;ʣ$y<ގ;L&K/4n8e6lc|dd$O?4ݐ.q^1o. Xb F]EQa͚5?8SgdYY/>68~?ѣGG=X^^EQ_}U||R3fw}GQԯHRDT*Y⾦R &EGdfm,եb;-++3xFnӡNENS]]izv(h(.ϵ\RR2h z.ɺwpĎ60h˖-?~YpD"E"S -d^wa`4G9uTzYlZV 4773og-4$ Xb~___RIv^v>>>#СC$slm>t(QhѢE[ ,$N+Dt(ҥu8mס.^tYTu|Ν;:O7DSl?z6i9 C7`mK<(꧟~۷e9>ԡMMM[bŗ_~s 8ydڹs'dss$:5zZ>7˗_tۄFBH}}\.f-$L&R󫪪h4F/y?x1_7uuuӦMj lkk3---bҷo_eWF122R&dӧkZZǮ=t>o2mnn Fq_"GrDD[[[Gmu7'Nضm۱c.]4a„9rB`0be/ 0v(d &55uϞ=ɓk!iAAAmmmMMMb=tO$''OYl?~w ~BBȁ"""Rĉ!Rҷo_ BFinn^dɪUuZd2d~5~~~d644~)x>}ͷ r!sO!| s7뒴F' #֣#a m@F9qİaúy֘F BsI^UUҒgtC۾,~5 }v,hE憄X[@&7.##d2effN6"_PPc7ْj?oiixE BH```RRʕ+p~_~iw;h6lؾ}vAdzgSRRrwLO?tR,˵k׾ ]~9kuړWd2~.ooodW^:RVKQӧ^v<`cRR,egϞ(j.0LK,d;Drjjɓm kFZ4iRxx%{rnɡ30z?F?[̅If)mKRf&u(c:?Z83zf~Ν;|>رc/^<Ϝzgm#taJJ }pBn߾=ydX8~~^R-[_~B0,,7ZqY_] 7nHҒ[ү}QHt9Bȿ/pHceBr?ZCzm+((ꀰW(B3.]裏XoK - Za=:bݬR4229 Q'm={yj?1=gϮ=~u7n\fff{{{VV.qѺ}ܷ&A?;=GOwmBȅ xJ>cƌ^xaĉ.iݾsƍ۷sY{ Z,e*j̘1N82ĭ]OVUU5k,V;n8v 0KsqU7kGWwQ-vnR^bknm۶m۶M$їGf͚5k+D${x7-nκv᫛pb#υ^p+8] .KW\Ww| )%tRJ&y"z?B,+W,X -;D pP{xp]/^TkY=ɹ{~ 2̙3;wׯ_HH?`ޥPDlٲ6۵$''BLb^OLLLnn.q}!0==]є߼ySVoٲrQ@t:]hh(!dѢE&… 3gde`0ܺukɒ%nZtի7 SN/;vQJ*++ۿF 7_+Wti4(7vg;vuiY"ܼy{!|O>ZJ7nܠ ϝ;7ׯT#G޽{<2eʪU 򗿌3FӵZ֐j%IQQȑ#u:]```QQQTTT}}=]mXXXUU !|/^h\Nq~; XFII㛚!}Ip7ІN H;D 88sӌ5jO>tF !ֶ >.(J Xa(,,a $ !/00000~L_XKt>IOt͚5kKMMen/Dyyy ,xGOwyz~k+VK.jժhBHFFFyy9}X.p{7{MBO)^ڧO#FTUU͙3gڴi[ny<RJ7;_0sLH4z1clذ=?|˾#{%!s%x_ګ~ꎸJk׮S\Rz#LT'F5o

p]/^TkY=ɹ{~ 2̙3;wׯ_HH?`ޥPDlٲ6۵$''BLb^OLLLnn#>pC!0K$))) BV>}СCtazzF)//yZ޲e !ѣ@tPBȢEM&SUUՅ fΜTZ`u֒%KoݺtիW3o4 N*--_ wa6JUVV~FSYYnjW\qGa=cc7͛s!o}'jT*q]xܹ_~]R9ݻ)SVZUXXX]]e̘1:ղܰ0V+HFjªHo/_~Ek544rBȍ7~W2JJJƏq48' >Sb·2ܠ'"ϧZӧBBBB!mmmÇ )jXx srrBk5DB |>OB|m$!D*Lր&LҍU:Rloo}6P(|}}4FjܹsرcBk5pa4RL& .--5/,))5jvRz?Pf͚۷ӅIII+WjcǎBr9cHD"w}w.x<޺ulٲek?yyI~~~\\;BJ+dee(ʇ~xܹ|>g>&NZTTD ze2YEESÄ FѡZ4iRxxСC5kp-55!D-X͜y$n.6yyy+V(..].!!aժUфr`/;D 8 )p^zO>#F3gδiӶnz73wWhhh9sH$=z1c6l7,:=l;Ћ0%@~x2Bѥ$$$ӏ322֮]~kWw1bF̝J9rݻwm,sܹ?@?aaa/_ rJ0K @-93]Z>++k޼yS@m~9\_荜ySQMWӡ[meee͟?b2bƍ !r]R޽;$$dҤIOE"H$hiiIKKS(r<55UBLbVLLLnn)%j~JQ@ J&_.@XrǏϙ3'33'hkkȈ:|HH!v0f)Xtu㔕mڴiСKRBX|hܺu3<ü%..n޽4B!SSSz=={m۶m;w.X|ܹs_~eo֬Y~i[[[CJ _^I;SN0aZ>|իRRR|}}oݺU\\|̙۷'%%}R___PP0{lBHzzF)//yZ޲e !`0TϟOLL4/LJJǕ3fxWW\yʕ4yuw*%%%$$ȑ#ovdd$Rssk*_|1;;;,,lС| !䣏>2eJPPPkk{キsNX, ׯ_B(ڸq@ 0oT~[ >>>AAAׯ~,:uJ(>ƍ;v#F :R|>Æ 3IVxO RSSCpË/&ֶ >^(:rܲQ@hl&}bccǍo2Rloo޸qNbb_|믿㏳f"( __ߪ*FhZmmm;)HƍG|2>#Џ)_dɠA}W^$<<|7nx饗 " gΜfֺ͚͛7ϛ72dȐ#F,Yd^2))iʕZR]]mN_yu9rh4ڵȑ#ׯ_~z}]r%77711åLI)m8p>ƍ'N 2`ǯ[.OJJ:vXRR={0X~gg}T*]%gϞ?:&&&**[Ntuuu<ŋbVVּyk^<ŁnMRJ244̙3tyKKKZZB婩z5|Bd7n$TTTv|gbٳ'44400p:kɿ I&1Θ1C$EDDdddӡ^z۶ms˗/;w/lm Eѳ̸1}˛2ey=111=Ty H)T`0߾}g]z5]ho޼VlB*(( \tITҏ &OܧOBȢEM&SUUՅ fΜɴbYa}}}zz#GZZZJJJMfYB xFXbSaJJBPէO>t萵Vϟ?hIIIu7w݃>CFϲ2<<|+Wte!۬7@sOPN=H_Nill(꧟~EVWW˜={+ʲ/RHH^OKK{W_.(ꫯmۖ~uPhF655%.\пNӧSѣGB!k+|>CU2uݙ1JRǧ ]N#^5>>>>-DN7f)ܝ@ ń@mkk>|L&dӦMj“'O.(((((;v /^|_ZX,}AM<,!۷/<<\"L2PV{Xk%((d2u5NmmB`]wfL4Ft .4Rd2/$ɺi)% k=M( __ߪ*:jKQQQ'O< >_uر{Ν' U͞={ѢE%&--V=q̆Rloo}6k+dܸq| >|G2O?Bhloo'jf}d59*7x1t III+W'';F{ ::zϞ=&Lc+ oݺ_߽{v`2 Ν;+LHHXfMkkk}}mtW^Ynݑ#GFckk]9~z.Ca0! D~`x뭷,L?yy=qqq]YJk]_bԩS|(?.ҏͯzM0aĈVh2^~~D̃ZoݺuÆ {+ʪQ*?0}7Wkݞ:uk.\>pǏZKP(._|ABoI/igBHjj*s  ty3%g9蘘QEuDn;`\^ //oŊŮ%$$Zν322wN8Q3LR;!GG8\c\zO>#F3gδiӶnNyR;(y~ݜ 3gDG3f̆ \#/K`a <> v)2%;``` !8RJ/8J)q" A,K+2 &z-gnzǦb%o%p&R=p NJr}\TH)R8UBBB~~>!$##cڵN8*/*RT</55y*_DB022ʕ+g;qDX,JL_ʼuΝ;WWWMYxqvvvCC8On߾m@ tӦM[tiw_>쳛6mh4ׯ'8bma4W)eee͛7alllvv{B;Çpif|>?99y׮]IJJ*))]׋D"HTQQa:={dBHCCCbbT*U(˗/72dٲemmm-vC۶m[h.#M2)Ҁ3xVX{{؆8?x+VݻUј3l0ӴZmaa3X_MOOh47oT[l!=zt JUVV~BHJJ[Ϝ9}vzSN/tڢymZ_`g}v]BHMMӧ̙h*++ÙpEz*$$dƌzL&S(Ntysw~L%BZ[[{};wbP~>)ڸq@ hnn_{@R/נRcǎRiӦk-֡=/ >|8..N*jZf1Xh8=6矏0(K˛F*o޼RƌCmkk>|8$EQ\.j7p@!Cjjj!|>)>ɓ2qqq;R6 ۼyL&۷[ojٳ燅SB{pLն{ 0 ""b֭#M4)<<|С5kh -XY,55СCc^g!ss<[!zܗp죸PT#Gs.\5kVEEE>KHHXjUtttFFFyy9Q6(vX_*n8rowt> >mf:p R1Suu 0՝¿\qt8 cNX};c$mowؠn36GJ `u5؛-Rx w-RgevMOs&sQ0K `8GH)ܔf _JwDxρ;D PquG:YJf)Rpk,!nrTJwG )%tRJw9phn k׺;=IRxTH$2I$ +W^UnnĉbT*2e_m36Zw(m8w\]]]tt4!d C!On߾m@ tӦM[tiw_>쳛6mh4ׯ'8bma4W)eee͛7alllvv{|H)85H|~rr]-㓔TRRqyƆ ^8>裏ر~%--MPT^O>}^D"²uz"q!!!ɄDTP(/_n4e233CCC%ɲeX[P[ַm۶h"f]bccG˛2e Sۥw7H)GVXwަ&WFcNNΰa8.Oj3f`}5==]є߼ySVoٲrQCi IDATzfRӅn0T*UYY !)))n*..>seN:UZZ/y,kuh}}ݻw !555O3gF gV$"" :RJ砚̘1###C^d ԩSYYY.oΝ;|>_"ODBHkk{キsNX, ׯ_X:EQ7n͟kT*_|ETvT*7mڔcE:>xѣGÇIRV,&5 QvW|Wwx<\ ?aRQ X˗X7'ˍFccc#U޼ySR3R[[6|pzI,3:k \N?V<o!CB|>S8x۷o[kѼ6K .yꩧrrrV^MJ&*d2<.|9r!!a߾}7od}}뭷Y={0X};jժ茌r?t;lP#&!6Dt A!Zq0j{G7|g m6fRJ\ ]]jإfW ,,,_8΁;t`": -8=ԲC"nf))_p#b)%R&ٍ Lko[%R; 6ρ;D &{2K)/*H)\rˮ:X޾˻ RJ.MRp)g%АR@̻˹6zqal-iG&p|qFFڵk]b9phJ<=w\]]]tt4t .BJ ^(++k޼yS@.x%iPDlٲ6BHCCCbbT*U(˗/7{ 0`믿>}t^/D"QEEE^^ޔ)S돉uzx7$'0 N*--_ wAIIIuVqq3goNOOO?rHKKKIIɴiӎ=*t:NH$GDD\r5+ཐR(jǎJrӦM999͟kT*_|EU???__ߒN'Fe^V 0/Ʃ 8*|ǃ}ZxL!Cjjj!b?~w 4yѼTj2Z[[ d2S,%<]jqEEEJe{{;Sxƍӏۺٳg/ZW*2,88Լ򒒒ʙG&H)\g\_gx֭kmm߲eB̙3׬YZWWyf>n޽bq{{\.7 &!$>>ɓŹ`RJw9~~~&M :t߿fB޽{[ZZ 1~uBL&/ܯ_?Hy{.<<\&UTT:tY-XexÇ쌞x}IRFy]{UjժhBHFFFyy9} QvdNR9>R%`w|Ww3` &^\E62I+R9jW 89I[svC7p^D'o)<s E\/pJ{9WwK!WAJ nb Vd-%tRJ!zG#M=w vYJ&Rb` ` )%t.|x`O T*橧 m,@9qDttD"O>k\9󦾸=@q{:Ri:F#C@l,o̙OeddDEE?>$$RSSӿ;va;`nMYY٦Mo>!11Q**˗ƭ[>3[KiiiIKKS(r<55Uw INNaV^m۶s˗ϝ;__f͚駟!> )%@KK;3u &Ç^~)%%֭[gΜپ}{RRҧ~j0!g&k47o-[B J*++ۿOzxD¤~\YY9cƌW_}588xʕW\Is )%8[JJJHHȑ#Gӫ<.zgF`@ p%\\62ke57FfkmZfqov1-3(nh ;w6g> #Y>=s3}>|NA[o5tPeŋwڵn:??e˖%%%իG_}#BBBjkk??s~BӽjpuuuAعsiTF yzz.Ӯ]9s>| ųM(;;˫O>{1U\\R:u۽{B!C=cǎǎfB544GYR)9Z6ݨZjV2Z0,** 5ZK.}իWFF>k:zxx7nРA6lgbaaa/_.((PU2eݻG>BPoo|Vj+**d``AO;v=Z[y_R9GўM mKn*RTTيI9h3(H#ifÆ aaa]v=r2lʔ)m۶ ?~ccbرuuuFѤi̙3W&ƾ3g>nܸ>e>ח^pG]h2>|vv#GV^-ػwZڵT&n߾}_|rglaaC&N؂ @J t:ݳ>9qǏ !.^k׮u-[,))ɖuvM7޽[cǎ{m۶΍.GJ ju@@׷^Q\\R:u,н{BK1cƶmۄ۶m>}sB@KrVJi~"aaa/_.((Pm߾;>yԌ_u -^J,^䥗^B[ =z?ұYQ.f=H6q$О7}F2ܡR2'g)a/+) C!NgewZ1&bxY G}ʳPRJ#|W5#5p<+ l |3(H#4@kBJ d0KDH)R2vzRp WR$R tepgQFJ DJ DJ DJ 䬔R9d- ''M6ҫGGG\yfBJ c^NNJm4K{8`8s8p )w-,, 'M%xz0rȬ,!DHHȼy"""% 2o߾FŚ->>>ÇѣG~/^lciᅄuuu)))ӧO>8Q>|@?%%駟Ζ.eEGG/\B$&&oʀH C+ ){8\yfܔYg 󽜜J5x`ܺ뮻N8|6:vXII !ĬYʚ_ַu-KSRR/(~aaa-IccwߍOTƍKJJrl-)¶:栅8Zzu昔-f?^DFF&&&*݌555s B;Nh4f+9sfZٳ-22vv[p澮D儗]x100ܹs;vB۷,..n۶mnn2رcӦM;uTNN΍7x%!#F,\033੧0`@uuummi {իWEEE```VV֍7X]]痕uw*+??SNBjJ+++ BSVĉrAMB;;CIՄB>}(u:ZT¬Ylْm6DK%@!rcK'ݺup႕Ҕ|RѶmۦZ___}QUUUAAAno| | Ϟ=+ jZHXsҤI)))j[oOT- ڷooKiAAA]t9y'N;sǔ?::zŵWV&N:gB !! Kh4_'|bTlRx/_>m4K{8`8s{hp噉;Bw}0,,o4iիW@@ȑ#!!!͋ ӗ0dȐ}k[ ><""G[xBեL>wIIIy駳%s .뮻2`FqQۜ 8Zzu+wǏ۷o~~ĉV\ٜ8`G@ĸ"؎QʐRߐɓ'_M6*@&&/1hqԵ2ܡӧH7Cܐ[WL)m$--cj_"N)*qW:4lվ<>[䍯tw@EF؎Qin1<%܇biY>IDATj#nR[UĽRJ=n8&S-jEJ DJ }̄ W+hqA)%@)%@cKIG9Z=Jū)#R$5~f9W8 W)3n|Hb&   {HrVJ0գh}̄ 9l㨃4RJ$RJ$RJ& rVJT2MK DJ }̄q mXrH"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"H"HվkFj߾oxxȑ#}]v]x+WT*Je4]r*7tl^-rԛc3f+$$_~3fغukee>_]]misP[<.^-j8p`ԩ) Ν;w7|kmذ'l/˗/t p;m8)ÉYYYIII_|ysb^r / tW\fΝqqqt:]RRRs"5ήCpz)8u ^y1111::ۻchժU/_֭ۡCZmUUUUUUKضq۶mG>uT۶m}gݻg몪VXOd$00P{pYHlRNo>!C=dxdcǎ{viL ![:\-[6lx㍦&K_?~5wvFvڢԏjܹsׯڵZh4{7o^NNr֮]ۿev￯8,˗yÇT^zI.|́i& {e^ueV۶mǏaC&_xe8٘1cBBB<==CBBƎ}v]W+{X~yyy6mT*۫T_#o޷o }n|7Bk^>Ҩ(mlOT*0J s޽"<<|ĈBho]|rbb!Cj7]eE{׳z͚5Æ cbb֯_oȀ"::N\2;Zkڵ^^fnG6l&LXl\b 4jfHʬ˗bڴiv}j!ҥKުR{]t1_|apyyAL|xȐ!ʬ_Fx7Y{Ϝ9S^^cǎI&Fko0V[uVj/**j?{VKNN[gϞ5\xҤIJ9gKKK322yҬlW9 3gNzzzYYYvvvzzDtbŊӧOm޼W1xgygժUYmڴB 25^2O?(L|G+K* 倌pRUWWoݺuر[o7(..nNfMm4KiUƌ#]IUUkiyxG(..63M+GuwY)Mi~aaLOOߣ;sԡe+J4ۯǒ%K~駲~)11qԨQiii%m<#BP~֮]Kݻ״Fӝ?^_zѬK1p@cǎ)%ϝ;h{L](  !&Ol8ٳ>>>%`,:3U[[< s'>|X)dF/v/-Q|_~Yat]׉'ll}x}Qe\ Xar,i޿tRPPbɒ%FWWW+O.[IۨW_u,hm-O>D`퉕(=g !/_}7 0]X.$~6ʬ lwʊagHH0eˡG$,Ǐ7{kM``_גÅ.]*hjj2-ʺ͛'jF +WhoHMStup%K&%U3n6?BFcz9R?톆{NoaFӳ8?=56w\!oyy򥥥IؼyLˑ+,U%?˻ufп0''9; tYj̝;<[X7FK>tVcccz퉽)KY5tP!ījr[G}F^:`ﲕ%p_O ,V8_~>rȂ . !*++x[npZ1z蚚j}Q_^F2ޯ 9rd7$(ӡz%0|~w})W݁"""4~իW ! aPz)Ge" vs`ts=zP5jYFO¡CM(]vBBBdz X!Q9N*_077W=%>L߿+o߾8FSVViӦaÆEFFٳ6ZgvTXv~'ɓ'?9zrw)]0.]Q" 70`wO3RJnW^y%--*==}ժUʐyyy'NBlڴL( ]vbP_7$=W !O>-5uR0[uO=Ԉ#nzԩ/5|HXkD9Сiv\a+3e'wvM@{*MOgm~_GTTԇ~XXXf9_ѣ6`m%J>j%6 e&''_ti֭BQFmcFkfreK+Jᆿ/V:ujXXXLL̺ughqxyyr- cǎ)sm3}GĎ;N͞+++?脄%fooo%bmB}vx0?p?h4?10o6!ZnllLHHXjTTTXp#Bh:ސ$M!.11QyA;LO+++M$+;ypvH?cƌիWٳGyi7=-s޽[A6m-:t?{# 7EիW/^̙3~~~ʻdZ0+&Kឿkjj=zȑ}tR.]-Zuر/'m%Jzj݊ 7-y!ă>he!Yga4|MÝ=FǏ+Cd)%OtICy!uJJ7qBTQCZv(ܘ{.ooHƌ#8p F,B̺$55h߮l״ty߿~,//W*_svȕdwﮪڶm" @yCʗ믿={7mTZZ۷/77w͚5ym%FR^xOTJ'ʣ飼GTXpМzht%¸Z~=\0(w(FJ 8ٳ- Zs !<==GL|'(fϞmi7ëfB,^h <%%poib!I4sL1)r`0Ugr2tO=RN =nu`GB(0ٳg;d[ήccc===kkkwܩUN0AWƯ7dȐ+V9sFR9r˖-.\裏<<|`ohJz뭷Ξ={}]p$}lAAB|Jzèyp%p_OKw(WXWIs9$5NG-((j999III~iU^ue7߼e˖򂂂Çk~{ >}|\\܏?XZZLԏa_~L>|xZZZYY/Cѧ7$ea_ޥ֯_LׯG}ᅲ>}zǎ'N4,`,}ezllҔ'^r&LL,++駟 k׮oW:Ͳ*3gW~FFa !fϞM+$*Ǯ"]9p޽ΎߖOjժ#% |駿sUTToڴiJV2\DY;wኟq`{+1K nfdd9s* :+J4ۯJ3f̦M222ӟ|I_[EH) Ts666;y7npeeׅ?˖-3#gY/_nvy{CR&ڕR*,LtR`:dԩ7pJ2e{wܹUV?_t469\Zᑜoz뭾>>>7tT/@jp_ϴK3K.>>>>>>:u޶m_mZ.8{t~wr^xA8Ep'ܹ&Zmppߞ3gNKsՠp5C/%eAt,0KFy1lD\/Vƚ衇\?Bx{{ۅzk Nc͙3'**[n ? v%1b2(AuuVݹs端*0aBPPPKuDJ s N[o@ # @wn`0W A .2p^{-::[nmڴj׮ݘ1cy睴:t{^`?йsA_H"H"H"H"H"H"H"H"H"H"H"H"Hσz^e>IENDB`icedtea-web-1.6.2/plugin/docs/PaxHeaders.17941/OverallArchitecture.png0000644000000000000000000000013112654402377022347 xustar0030 mtime=1454507263.208432968 30 atime=1454507327.169579937 29 ctime=1454507658.74215785 icedtea-web-1.6.2/plugin/docs/OverallArchitecture.png0000644000175000002070000027403012654402377023101 0ustar00jvanekmock00000000000000PNG  IHDRG<?TsBITO IDATx{@T E3P3KfTN:OiWd^Բjyy*hGSSei|RQ^Qfc3†͚5{]f=^j0uWU 2GT|tHT| Q]eCl=.! .K/! .K/! .K/! .K/! .K/! .K/! \W<#qBԭ*v[nB .Y=~} 2F1:<|"_?w8ƍ߽{wYWjuߠ8eK.jcѢE"R.\hX5.\)|XD6mjd_}UNF'E?~iӲzUu੮]nڴرc.+::zڴi"b ϳ߿iӦtE~rhȑ{C%777--Yfaaa͚5;vl^^m'N5I&!!!UVرҥKc6g͚ռyu릥]zúXl^pacccBCC5k6~"Wh9rb7ohӦz%[\X1b{ի7f̘<Ǖs,U^:wܔ)Sbbbcbbf͚Fm_I&Zr{':?D???ʉ'L&STTZI٥DMHHo8v+p# J[h1k֬k׮ѣwl޼={d۷oǎݛ2vX]=iiiǏѣG6mΝ;p@Oꦧ_'Xvmڵ׳gϛ7oN6u֎.]}GvL+ OWT+<3F u{sky,3<#" r,%==]DV\Y\EgҤI"j<]-[DF*ѣQQQN:N^U/_xQ"P\=xGE?d/\~ s="cfgڵ"ҵkW 6^ K.C΃>:CZZ >.]۷o_#<""ӧO3e:-ҡCDN:?>(([nŕnbXΜ9o]Vb3gKTo'OlG-ITW[ǏH```aaaqU-Rb(jٳ|gZE;pco9""5k?.@mÆ "2tP'y֯_/"Ko۶ܹSk.ym$%%KMgʞ={lrرk׮Yւ)rԚ5k/333'''&&###m 6mF6oٱc$''&vݪ.U֭+"nݺ|rjɓ'EVZVL}C 333R,Y"E<v*CAAAPP톨.>51qNUGµm*ٳgEN:{t{Y1ϭ[|SO=dɒyMڵkSRR~{キI&n͖ O"tETx_ttC>\~}'y<8a„x']vnnӧm:uʓ)wٲe"x:hOv#G YYYnWfbR~7hܰ{ljjB.]g S 9qx +](?RSSƢEzׯ0`+W6lئM}M0aĉ*ƍۺuJ*ݻʕ+ƍ:u6lذ %%%YM6lrǎP'S+/"m۶;;>|޼y:W_uImۦ;jiɒ%ٳz:f͚޽{H˖-4hs޽{v1b!!!III6mرu䏝jECjjE Wɓэ7.rTTTvTj:?YΝ;\fY`MIHHسg/x @uu-*W.P~8 78f>vs=״iӐJ*5m4--yN81f̘+444 nݺݻw>}z^^pƌ*USѣy%VEܵk!!! s~5.y}\fk޼yqqqɼy7nP^^{бCj={v۶m7nhӦ͖-[\fAxX G[n=zhݺu^*,,2dȲe˂###?wv=/]ԨQxlb| @i[jG}o߾3g 0`e]56 0'ϟQ =!EcjJ֭_|tǔǏ''':t_~뭷\ cf$qP9rdFFƍ{;t|:uӧOO0Ǐ6mZVVV^J,c| \0'$%%mٲȑ#5*"z}7x# PTWyg INN سgcCHAAAff}mڴK.111[nMKKPowOVVb޽{n۶MD|A﹇zhݫVzWʰn_VpjNNz׬Yf}O?Tm8q"<|X[m,sX,gyFD XJzz\ҋϤID$11l%6y-[H5UѣGt睼^xJy7D$!!z裏\䫵jߡVj]VDv%tpߌ3\sϙLNСàA<۰aFe[ɓEdΜ9*?cĨƍ MOaaa#FR_:thPPPrdZϞ=;}t5j'<$ /4iDxkx ٷolv{+"Z%\tID޿5k&"+:}6l翵_~ <.m۶"sN]gIII/{uYgϞ-[;vڵkV@D\Zf͚ЎC4ӦMSSP-jEdĮ]z[եJݺuE֭[/_V{;|\N0!>>ɮj׮{iiMO˖-ŋwAK<}9^rz^o6-oQ|Iour)_Ϝ9ӠAW-[)gΜH_P&xZ}ݻwb˳j*j׮lݺ6q֭r/^(" 6M\zwgC |rqW."yyyZ"Ҿ}{ٸqm_~zzw-",TɴhѢ_~zz7z谰ŋϜ9v޽{/_Rʛofj V\|'E$===77W9r$==ݓ)WZ-[w^FGyxh-DdڵehݺhW_}.EdƌZ4''gƌQaOtYD"_mܸQ.]Իwo5gV9w_Wcj֥Kc;<- ЋSඒ6-Z$?K]~\Ұa6mggg۷o„ 'NTy6nؿ֭[WT)//o޽W\7nԩSUaÆ-X ,,,))jnڴe˖;v+V_Dڶm{w;vo>|y󤘧SNjii%>+G-Yd={ b͚5{-[6h`Ν{J1bCBB6mԱcu;Y; 233EdСګZѥ'OFGG7nܸ7o8pի###vyM7j6IHHسgD\Bwm<@TЋa4n+N]xΜ9sÆ f966Giii_|ENNNAAATTT- T^=l6{;rH5 sϩ܋,?2eʿo?rȾ}E,%>>>;;[ O~\d̟?ڴiǎUְa&L`Wby222=9hРo111UTϷ^qwQ]իڵk{=WKΟ?Ϟ=/_VZV 0rH ;;t}. _Du1P!m߾=11M6v*Ո#\XcǦ^ZM W.6`]]n#?׵? &M$"jx/^|ԩ\tiܹڵ# 1WЋ*肂o̙3۷ߺutr9q-Z.K/! .K/! .K/! .K/! .K/! .K/! .K/! .K/! .K/! .K/! .K/! .K/! .K/! .K/! .;-] IDATK/! .K/! .K/! .K/! .`??????fmf튽 9c`?Zu|GŽSƓv#x k|X| Q]}m۶ȃ>Xb hѢЮ]o޼߶mʕ+iii6mҥKLL֭["""T\ʦ"~^|aÆ=z0LOOO U.vh")f1RUbcy晌={8GqPqCY)6u?^gwb^p!000<<ƍsرCyĉp4w\-ɓ'DdƍZbZDΫvZ:rJˋŋ;66>>ŋ*7WoENNNXX̚5l6k۷oO]i-[DF*ѣQQQN.NZ]d.a| h^ zx1kZ{)"}rA;4>|{WX!"}R|SN9R~Dd鶉Ν;&R?.".eߊg}VDRSS¶h/FuycSRRDdɶo6mQ? ܶ0Fr +0*!C|癙}Q)K,ky֯_omVDvܩXx׮]PCRR|UAJݺuE֭[/_Vl[aYc`:sp;vHrr[vaJ w2.` ^ԫWk^z544TDC Jjs}q#F?~HHHRRR@@M:vn:%ZqPq%tDu<F3 z: 47>rHppٳgVw}/)((jѢERRҠAիgKΟ?Ϟ=/_VZV 0rH-b8`Zg}V-h`XoEu]jEnn̙37lؐk6ccc{葖֠Aleً/>xիW^=|ddX,^FFѣG### -&&J*z IO+ ܆0Fr .# ۴ik׮ p"k hJs-?׵? &M$"/J``(z19ʃ肂o̙3۷ߺu㺽9W.6(q4!8xz۾}vώ=.P^ P5 7/! O͐.Jsbc`$/! @hHDu.`V#1W| Q]4*6F;F" k 6۷6N.`V#܆ԉ_zSmfm7nyV*f۰ 2Q]Ӿmf튺Twb Pp| ry86m{ Q]C܆ 8"O,m.?nG s\f綝\[./x:yr0Fr @j._m@,N|.0 \wy5ykGzBQ>stK.໼xv@PT<|Q] @'N|> K.XW Eg (N^1W0Љ`.b]]2Ją3|'/F`]]:qQ\0\rźeD\(*>SGqpXWN|?5p|_pZ:gΜ/<};vL6dΝ;=[222D$33GeRϕU׉HnԶ:]>}@gΐUMOO;v-2e+Rj!C4l߿uhٲ?%ǀVܺuu?+yۗvվ}5k߿Fn[z[nY>`ѢE|d0auՀɓTZZq֭OoNׯ_ɓ!f6j[7n^ѥʀË4n_({cŸ."urzzpW7f裏\6l֭{uw߼y>=:oŮ]ڵk8pJ**l6'$$˖-߿*''teɎWZnݭ[7kⶲ:8qoa㫇~x7WӬY~IAAAOPVkF?.ƶ?{G<ƿ6dX]vUVYٳ˺^:oݺu $"&믾jttt@@@ttoiXwq˖-ҥKj*UԠA'|رcf̘!"SNZ͛7Wvo/^|cbbCCC۷o|"g%''W^=00~Æ nl6ϙ3'!!!444$$:u7+Iel̙3gϞۍ7W."soh1K*dwyqP^BŢ`tQ?OZ[<9KlѣEdԨQZ;#"}q2䭫ߩN6MKq{j6usUtt[j~7vO'Hbbb4HD&Ol~Z[jFWCEaK%D]~z-ZO?=uӧO2eÆ meu%[V>42(s?vr~8W{͛O81---44TD}]lӧO6m<݆Կz?"E4[l~$''4i_WB+׶h+Q[o}vK"ҨQ1cL<9%%߿J*vrz:ED4i+-Zݻf7-z-"3gδ۲eD]v.  ]%^չWv+u޽W'"+Wԩ_vvJ,2:[q;VaaaժU;u{H.یR$/ իaaa~~~yyyv/]vMkQqqqgذaM4jK\.(n|SNJ.kRV]WbeߔeT/5_JIzkc-Z,qBЦMDM6/_gϞ-"m۶ˬ~UVjժ-\IK,w"ҭ[7-eŊMꫯDe˖W\?#iժ{I\*Պ-Z\zU$$$ŋ+ב֬Y#"sOϟ*/dw:keuNj*yꩧTo͛E{-,,T7>C7o #OD =w.M3f̰KWöN:6J>ׯWZU{Ho(o4kQq~8Wmg_xQD*UdФgo֭;6ƍjo r^=șMOKD$ 6c76/ޥV'ۧOOl.]*"ݻww" :֭[k׶kSTD[½7Va*d'빪sνVT&TwygHHȅ kRc0|pի$''Qy8ik=g"WkBmذkZ){޼yoEd„ V533SDkiP~݁Ɠteuz:MO*믿z 5jC/f;4m400f͚?'V]׳gOQs믿LLL ]vJJO?^l%j6h@DLKq>t'2a䵨yq_n\\]VK~6lzB=Wu꿎zQb9|p~~RXX(""B:NQ{1SO? ."qB+u0 s&XK^mlҮ&.5VgP///jժ7PaI~^v&rœ&[Nj,W^͛E6m۶"_\{K[=89TT*DDD͛7f/';vcǎ٦j}͵D5tOԪUVZ"rՋ/jaٹsw}5LoۭݻwHl~JD[53Nsȁ=ljS_RO޳gτ Twuz}۶mKNN?~C=.;ċziFm(iXL&c:lذaȑǏSbש ]tRԏw}۷oW]b͛+VP뫔F+J:iӦ͉'FijJݕY}fee-ZW)'OkuJGf͚ׯ/_rC *.RNm^6 0sLOպ"^nnsWZuĉs^ϝ;'OzDz '4ا~:??޼ysINN~'wڥQTȓ700l6/[A;Z~O?t*UƍײeKu@败6%{Ydu"l߾/֭Ν;[j~X\c+K.}׬Ysƍ=خ]~3p0qD.ކwY IDATu~FڮaZ]&Km&8W⇈"cʕ+Koիg;;KSU-IM_ڷo""G͛EYf&V5##CD:vv+truV?[;[_εn8o<iݺ6bҤI"bhήӨ/o :UWpsI.o]})=8EN# tl~[nRr{wΜ9ڼ7\ti 6 P#GfpkVpo %UN^W=q3]jViݻoAxOJCޥ3+>t"J}LuݫN$ǘy~j{(w@ɉg`[e:sF"VZerJINN.tvR0Ls̝;WDN_ϟ?o˗/spO@yh1RPK瘍{unB'9vlVϡLuҊu։HƍgX,jٳkKՀ+r{_HxbPP^ur 篶 2& `0ړzeY4DѾ}RXXxBkhKg}"ҥK??j[zԞ=a(C\\Bw.)c6 -RO]kӦKN$}+guz8ydy(1==]m;VDM=s̘1vuc^LGydժU5jHJJ?uϞ=ex|ի2N:+VqƼy VdsKSXX-Udwmܸ?믿~'N\hΝ;;w/G9sf Xzݻwg_}U&MkN%v :tX,VڿO( \!@wṺdx:ȅBOta.&๺ $>(|@c0.QH^1+VxWnf9X]+Wx+Vv :c0@H|Q}r^iӦZJr/^ɕ{ﹸ{{I&?Jl"ߙ5kgӦMW\LT- gh4!|51\(0.5rͅFQH^VMMwnnnrrr׮]%mUWWgbЃF !mڴQm㏉'666zyy=~رcuuu9sSN'}Էo_77T@;8`V@Q`,(0hd‘eBCCåY]ͨҥ/__TT$ޞ㥤O<9|p[[[@-zÇf͚NBd''wkaaannwHւWWWWnnn|>mڵboSԙ3gFeooojjcx<^^^3>3B[3t( O` @A$h.0@ѣG0`hYаm6BHccN oVTTԶm-Z$ɓ[.]uO>...ܹsW1ǏpBTTԤIDK23332,99uTccӧO=… 55kVRRҴi_z?|'M=LZBV\awwSݽ{ɓW\e۲e ۶7ofs,0`@\\>j(YǀɣWSkcT4t?hFFF֭Yctܙ"^PP r@=/c<: !@GarKKK !ܹsGnܸ>Ӗ e_oH-`nnj]Zؒ^D)kY Eaa!!AfuDv5 S  >QH^xmPyxx 80&&?5jT\\\ZZZϞ=n)>p >/Y7}VVVWhJS-kAcPv+} o1!W TWW}9rdԨQ u !m۶ׯ>4Yzꕚ!qΝ=!)77ݝ=F^Rm۶.**>L9C* jJW <-X (EA($/E?O6ٳ_>y򤹹̙3ENɩc_ۄ'NvO>d/!ƍ٪1Ĉ8ycǾzJt;Hcc"1h>eE -BU.*/VM#Dhڂ4h B˗9# \%1!!!o2g7nxιƌ '''''J[n<̙3affft !=z[^~Mo)RSɍ`-\Bڵkyy9{؞={!l:sssB۷%wI& 4HžCS݇}TRJT@($/կ_ׯߺukĈGN})<<\1cƜ:uj#F066~ك\In"V%0@(9S.JbŊU(w"&A#5?F'Q6V)٘ݺu{r;v$$$|~K.0`aEEEWpB^^A+yưxp6󋍍|){}eK.0 6 -sʠF:奥}贴]:;;geeN4=4A'SמARPA &&&K,av,J7off5KTX (U RS~5m='0tD$/;777%%}->} mcV@[|gP7`BG 4І\@wކ@wӮ 7)]/fu @. } |˗߸qc͚5ڎkժUo KO`Pt *#0L::O`08a=P >QH^fX_3--B e!@w01 `(?ȅBOtaV@}: `]*_QH^Q \]h2ra?SnfF3`gϞݧOUhbb CUؒEuT(v}ӦMJ`7n=l лwjl|RTnᖕ5|www{{~;%%E,Y{%''+}&TKcZ} K'0WnUDoo!C-gϮ9q}٪UYRRۡCׯ7444:>ommqqq,911q„ vM:Un oߖUBǿ{6lrJpp֭[+-11100PJuܹ3f;;w[zbccw#,--s&t拕߮]7oO۱ ݧh 2PU (F)+*RBYYNj/_xh"7776m|Wt{~~~hhh۶m|~Ϟ=^ʖI&ko֜9sD/Ѷm˗n(m{677 ì]̬RV-k={L6wߥ[.]0LMM ߹s3-[0Lcc؄`qqh9?-,,7oLw˝;w֥Cq0;v/*yyyX,ڿ{aO6lYMzP}?;9""bܸqn$33mm:@}{H1 1vnRfݻJ;<=dA5d%6mڀTYfZٶmgϞ]QQt [[\ꄼKMmgO`0t BJKK%%%Ǐ?vX\\\@@GQϟ߱cGLL6Yp5kD;/11Qn?x𠦦FUdUS - ztdS O!P#F4h2**Jbo߾-:}TWW3uٳg/|>]:uԑ#G~BHLL Γfee)R'OZXX0 Bghhٳgdk.+ٙNqSNtnLL !DFٻwQbb"}ؾ}{6,,M6rkaP(Z#Zzueee{ƍMLLhTTT|gׯ_>KVovvv~D!"ܾ}MRSS !,y„ ݺu?smmmvUMoJ$fN| AlΥO<ɞ3qDE|BÆ &NBwѻPOӧO69|0!bWwrrbg8ZO?>|8wsTS r !Nqx{{6?ɹz*Hwss NNN~ѧ~jaaA׶m۠;w~`)!ĉ]?bĈ={2 M>[yE'dwѺukhY(,,dr۶m?-{w޽;wb׮]p;;;6:oquVWWר'Oe֬Y=,//WRM:sL{{oF<7Y'6ٷo!ѣGbW !ܖ4h]v-+boY4&[~| c>R}uNF^ݻ`Emw͛o{o޼IywcƌkEI.lg/F9yd%]DL?DKPFKKƩI:t4lm.A^%!fuL/gu !?30.\ CӅTbΟ?O̤/_xѦM̦Ҏ=jllL':y𡩩%||kkkMMM,3g0 S__ߪUy{ׯ_߮];H5k(-g…֭sww;uw^ip@ccž}M[o)_urnҨ7njr!tWEEܹs$))"6i.hF++cǎq_EV57,8u:}KO<ѣG)))K.%^iRϝ;gll\UUE_ۗ2Zn-R|}}7nCzx}"77WF̿n߾DˊPFKKƩaM N )-r}@8rPD^hfuZ䤶~ʽs!A/^0Lyyȑ#o߾u%%%1 SXX(N? >d˖-l(v Gi4}egg:u7ޠ9ϙ3gO>sˍ~'Zwj>n3)))謬[ !ba<==rss awB|njffFD5]1Jq!j@t+Yt nҜaN8!._]TQQ@ 1cFFFFll!CLLLv& [H|1=ԩS^ReE(u#ǥ%0c`V@(7hqF9rVwժU֍ell@ իןI'&&B} ?~Ņ~K_W+w?N.\( Í^|e???###;;c^tI@aGDDۋ&СCNNN]t155۷ڴ_ٙѵ~cvvviF @V׭[vDžB.]*Z/VZeeeg)ؤ7o{.wQ'Otuu ~3Ummڵk=<<|Ï9"Z?q℅vzËd1?[~uS9/.՗N_tei^ȭ;ŋɶ̿Lػ/A(e>|8_[^G\ DHԍSôu4@p@/aVeF:OEEZtXnlٲA*n>A%Z~:)u\/w>]YO]|r E>k֬ׯ2￧xݻw3 7aWqyeff۷O(Ҧ-˗/fϞNgZq ҒqjXMt4lm.A^%!fu 6-mٰa '66ɓ) _55yU||ƍw.ꪤ?ħDsƖ/T{hxBA۷3l1 i&䇣G/6U_ejj*|}}### .lg/NNN!!!쮦eqiqjrS9E> ]]9tz"N3z3D61 ccck׮3gj+/NKINNի_; K OQYL/5ZO`cZN\NaMQǂ>5i:,BG @رյ9%_[nTڭH!@w01 `(0e ra?S1g6((˗tWBBB޽S nܸ/_tvvx͹.`۷owwwg_8pb<{jդU1ŝmY]Msu@AH|Q8:*>>ݾ}c%!$11666W_9\R0?Kwt֭[ !wVBJJJ-ZԱcGSSSPؽ{M65?Ed`222>.][ZZ<JWZ01 `(0e ra?SQ>0`@6mڷo?gΜ޽{߹sR]]Jgdy<^vv6{Ϻu>|]tVt׮].QRPPkԴW^'!a++Ǐ?~1JJJz왖VWWpڵ_uΝfffU,!dȑK,?۷EDDЗ?~<*၁Jtŝ;+%%%wލ̼yG}dnnxѬm1;wGaaa7n3f̊+DjRj-Dg0椌 i>_*Y+`TJ܉RDlh]pBH||<}:k,an޼Ic&<<Ύ=&&&0999sν~RRUxx80qqq"aڷ^z={ɓ'tF8---~-0'Ofwݾ}ҩSG>y'>}{hnnnɏ=O-,,322x< ޽K^WW׭[@RRefڴi^m۶ݴi0Zz**;v}:gGGG@0l0v/R~tt4!$&&O'bbb! 0UUU?3}eKKK:;,V)b͛7m4aN>'XaGvxf1xƝ;+ .IIIq/{ذagNNիW:tOrrrXpp٢֭[סCׯ_3 3booﺺ:m%'';C"53 3z!C7UV~gh fuZjTaʩ)Z~ڶ 榎-m' Bŋ鮐qџ+B-,,u EGGN>lHHĉs:=a'),, o{ϟ/v޽r6]lFFFfffB+W0 ?5˳ܾ};w+V3f 0~~~W7o^mm/"#bhy;+wV80ݻw֯_oii#Y5 Mh6I(TT||̙3W^mllloooeeJLL7n!.%%eŢgՋطo_vݻwufjjJK0a[ѣ\\\e˖=|С$&&_|y}X^]4;w0 scccC#,-]shTRUTTdffڵ+55ɓ|>ڴirOOLL3f K/֭[ ׯ_w$D$11um۶-..>s̥K]VVV|>{>6))iРA^^^eff&!seQQʕ+h;77&)M4???*l_TTt)SSSNG&&&]vI&(gϞb-,E9+b~ݻ{^dСC'MD E"QO>|E_nFBHy睕+WYfj0 >ֳ$>(}=SXXo3;{}嗄욚]]/_<{lhh(!n?DDD9-aժUZv}6;zڵȘљCY݆:LOƍ%?]gccӺukFsΔ)S6vډ'bccىWJqkkk[QQiӦ  kkϟo߾}ѢE4U$M8;+Rx~o///(ڵk +鈴'-&C\\\IIݻG~"-=zn155&"w3B/\nZHk"@'~`@* }ʊ'_r׽{jkk5+++~lw-))"`Ŋ?8qb~~>EK`Y`'>装 !ˋ~H955.\|'Om7ݻ̌chvvvgNHH˻}ܹC#xiqq1ϳgBBB>~5 wvvvG}DpN'b4OWJDt>}KB߇vWDD=KzgEtWꝕ;" !IUU{؝Dѩ;wٓ(" t4BDYV`~~~ׯ__peat; !tcccmۦNjnn/bp7GF`/믿f/'y42Ϳ"@}Ԕ_-?m[~IGsSGu4AuU%wEDD۳/7mdccӾ}=z#ɓ`FFFb%DDD~[ѫW/\0mll?.@ppp9t萓Sttt.]LMM>ƗcXoP(411qww={vYY믿:;;x}n:<==rss飴̙~O޹sgFFF)xzwΎt9m1㹺zJMfii=o޼K2 Kٳggdd$$$/8S773 SQQj*ZhZӐ-%9@˄Y]*) @ˤpcHi嚋,tAs[Se~駢.]9tzؼƝFʖ-[lllƎ{%Eʉ733z?N|H檭ݸqcniǎRRR޸8___>RXX(_ %%%]v>}:r۶m jǾny{[ht1T.V*7.G14:]$qqqO>_7lp#F߿͛ tG*K^}~ÇE=x ::IUPPPAAAUYU&oK0=4 >UgϞ}999fff:[\>0B$`]*_ ra?Snh \ݥŬ.khhٳ'?.++ziqq5k!111?NNN޸q#ݘy'~ǑUUUiii#F(`ܹ9!$::]M*(Q]tILL,++\xdMVAY٥ .-d˖-{zj֭P\\|ƍ_~UkYVTTYE3DnBBB|~~~~jjjll dT*HO~̙ZBHii7OhhuqqqLL̑#G.”1ȅBOt`@1O_GB|ݓ'O*>3֭[;wэ.]?qbEE١C^|) a޽kkkK#lEɒкukԳ*++#7|ӷo_R522bk- eZ2<z zdyy90x^?уfJuEOOO5wHիٳgٳgϸq8dI;{8B1jZo!aѰEͅ..5^Rkc.eeet-!fĈvc h 'ZZZ:uȑ#y%!UVt%ɢؿСC_z%Y*HU\\#Y?ҥK*K=Ȩm۶VZ)@`eeE155577777?P/&r+%v{aaJ% !Ǐw8dqy$Tt>ra?S94m 2J7늮ULMM*++cWVVLDutѥJ'jkk{OOOYE=zoȐ\)Z/^ߍ UzZݛ7o:99]vMZ|zVqdKH=Rgm"R5DmDcl Y}eee% e/^tI(ʭ T.V*7.G14:]]9.{@&M%o~BP(>}%KgϞ]z^hʕ_.--]fͻ+V/\P]]mbbbii(|IdQ644n߾]jUzP(:uҥK_|Y__/_~'N>}z||s'Lb zYVHR/&r+% 'MD[믿1cⵐU}ww]5YPoP8qD6u)R;%GT(@G!yfu4ANJ6nw޼y?ڽ{I.],-- BGub B$OlhhXnExxCd/n666999Rb999\^^^>>>R cllk.B rɓ'I=w޽SN5118r;EJɢ`_4MV*""M6+WT$xfӯ^:}tC /--utt8p {BvT9Q;Q} K@ :ϢɔQ䊒?ǫ*挌7xhVpҥŋjkz޽Ch;4&uQI @M 8&QBhG*k̿u&(@i~ ]S_u=##]}SLvD:ҥKݻwvڄ@4C.RabV@?siӦ}ڎH̝;ڵkǎv z \(@G!y(]yE-\'0Dˏ0hnhڢBh@/ Y'>ȅBOtaV@}B"`]*_Z0F033v5a„[UBxU@Ч: 0 >xr9, |||Ξ=\9JcFFdz OIIQZ)$w=___mG4$>@  T0PǏ1cFYYً/kkkKkB@ 1b|H(p޽3f̐a x1c4N1ȅBOtaV@}Ϟ=+** 4hRӌ g33pWWW++?NFz-ZT__O޹sKPPШQjjj,,,,,,rrrvjnnަMm۶IFcGGGWWX%,,M(effҍO>=--M,hVj޼y555z{{ksac=zŪvҥCJV933s:t`O΢/ڛ 6)[;'''ww۷;99jYJJu+**lmmg͚%*;wazpFFFffJPGFFVUU1Bҥs.]$&&yzz.^RZZQN}}cǼ"Vj>㲲OYF{ruu9sfTTTuu5!ƍSL,77ÃRUUuaÆׯܵShR>=QMF++* .--]p7nܦMڷod'lTVV޿meh0e ra?S9PSW.ɓ'ԩ}\B7FEEM6Q5 -sˏ0hnhڢBh@/5 ±Vpedd{k׎=@bnwwwkGZZZ:uȑ#yҒҪUZqVVVC}G9,&&7DVRVTTTWWmccccc3bĈrBf͚u1BȱcfΜ)ںejjiZI-x heeE155577777?g HmJJu:Y۷ҥKVVVII ݨ_P7|X@Ч: 0 -𹺢/_~}SSFBؗt?{ӺukYt(;v˗KJJDD+KYYټyW^^~5ZGR4qyyyQQG!ӦMzjbbÇǍ'Ʀ}7_ndd4z}ر]S;_RAV%M$BjTR0 {0Uᅢ9ٳ@z֥Kt4 \]h?yRVVk׮}:;;[XX9s~=\ץk֬ywem &MZbׯKJJ3f]֖>…jKKK:MɭήvtpD+jӧO_d ](ٳWʪ7ߜ={)Sdcǎ믿ؗ6lo_ޡC}I]S;K&U%Dj_HJuBԩS.]7ojN:v9%%ŋl#[YYmVL\(@G!yfu4Aj+ݻ7p@ss;8p ҥwLyxxtС[n+VQUUզMOOO__ߕ+W]n666YYY֭srr?tV\ٿ///pD+jw611ҥah \ݥa Pgd49##7ިQ?j 'O12~#m„ ˗/ ]]9tz_^gffOt={zМ!h5=.PfZ]MPsuO'ܹ3((H֔.!=Çv Q@ctbxB)))JձcG5M>UFF"qd?XQFmذAt˚5kƏOK{{{e:O'~RssKj;|r>(ZL\(iFFfVbPX5~ˤ$@ 1b| ^+QiV\Yf;vLtѣGg͚E155-))>訅[hֹΝ;K~tBFWUU%$$74}Qz0*c%%%:R+]vѣ:J W)=VKbwNEEŋǏڦ/@\ccӧoΝ...AAAϟ? vppXh\vϞN&饥'N?ƪy988چBvjnnަMm۶& 233v+Y :kԨQ555t$zhׯ_?gѣG߿_*pWWW++?"bb#d$aB$,EN_e"&Ry]o!}tAAZYYر㣏>z!d|򉷷c;E_fdddff8p $$秦OO>̙3ׯjmm]\\s?.++ziqq5kJKK?Ȫ#F֥KIJ2OOŋᕖ̝;?d͎9sfTT]RXXxƍ)S]6&&&==7n$Hm1" CV7)r"%&R[eaa[o=zZjE_Ι3ѣ yyy &MUbMƬO_*Y+`TJ܉RD.x@ ۘngg0LRR'O:t@ B0;;aW^}666!!!մL0A(zxx B=,,ťUV[޺udx->L4={XZZΟ?c#[d5r {prr y׮]t?~ YGe5(YmO;lN4GR)pˡPZ` .U r@EPqXE H҃gd$3 9^;gmXXXN\2,,C'N)k18V]3iii-bf9W0cǎMKKۺuk׮]8-aClEN=Dco|W2׮]#8;w0 SSS]TTĮǾݻ9r$-h4>>>SNuҥ۶mk׎ as)x k['zw0իǏ/Xz\999]v,1ˣEbBm"re YT;vlnnnlll׮w}!C{oܹfmqh 2r%syĜ.##cN!3sE By<ƾӧO:uN:YH=򚚚>'%%ܹ].8 Np!eF)?6P|D5%%%fJNN*))={6`{sKKKۼysuucvڏ>(---##r hcg5<򶒟h4Ǐ޽;088R^^Rڷo.}6zĉv"ڵkĉ}ZnE)++~n݂+++u:޽{o9hР'Oʎft6mڰds+Y;whZԩSiiHb3kohwh|Itر^V63nݺuVNdNfP*髌#ڬN)?D{; g5 h9'ho`t$Ӻ)Ӱ}Ginnd2555LUV偬̎S?^pJJOO3 K,0Ґ!C$(,T򕕕9]!##2ZkO&mc=)Uf{ /?\)5ډu{nzz_y )**b{B+++w0Lqq1B#F|ƍBjjj۷{}ݻ͛ڵPb󎵅,g$XoVT.\:u_|[reC_f-/8󟠠 pB ƎkV, t,[D*?SdddSS[ODak(s{IĪ.h֬Y!!!G޳gOCC-+*Y,]E& 4_SN}aGY/_j֊[f㗤=Up^ݖ>1ڔa"qa5 @P0D|22 ]ҫKdgg;wf o޼ٶmSN1 3w\^XXX0LMM͟0Vfk]lBi4 6Nзo|I7믏9=DFFFt:ٳDr[Fy4Mtt/ލ(ʇ8p/CזZL ^΅~iΝkkk;u_X2AOͲu,5s=xbЫ+w.h1&$$.\0{@V?TlńNw8p 11Q8kvds{DoܸAx_qjkkwؑk.nX]c0+˗/ݤ ΂垃]fZ1##ga&>>~޽ X/PEro%gM8qķ)y屖,Yg; y*RמM6***WjH:~8v옗O?ݷo5kTTToM'2\ZKjG0Mngm+a=:k֬۷'''s^rG 2Bss3x v/&b3"s3Y&L8tЙ3g~ב#G(6b&y7x#))Q{ɕmmVp.]KHÉT]|yaaҥK;ֹs-[B4MRR҂ P?rTc!%CvfO=zAf+5]`0,_Z-}2'Z>)U|HVsoe-M<82 Ы >%{Ĉw.,,0`0##ۻcǎaaaׯVP?rT!%V}W.^822rG4mڴaaaLJJRՂ:dR' >)ZY HVpy/` )q%0;hrˉWNl?UG>fy(((XbdGIKK|׽{wgݳ;͛^^ PKmvnme4,YuS:&E+.p K:\=QNujW8V1js̑(.\zᇋ~KpPXnݴiХ+1ϩ :$&@X]ܹ3fV裏_wwD g.Xݱ3&4ʃs S 30 30g`p ϏN22 ]\Q\8z HGGAC<82 0.0. d C$&@0.8ǨQ=ꬽ;koR^1fdd,^Q! 쀆BypNd ġW@ }/nN>]QQ1x`f.\ׯ3fرcǝ;w;;;99ϏrU^ÉeREsQ]` 9)T^^])8y`SSS?#Fؽ{waa-[j333m>111X ;w~G-ZdO$]vٳ)lܸQVtaÆ]t2ZkY;hFFwǎ֯_o@۷_zuő{0 Vp"b9EА?j( S} \rbU!"eimaԨQ>,u޽^ >|ѢECp/##`Ŋ\&qΥo Ϊq4)-XqoS^"uz v|Sb`Ʊ,oWBO<3gCL@2hrˉcu՚]|س$ ~Q8s{t0R0)p/P$W ÷zuar)@2hr @lBC<82 Ы ̫ vBB 4yu0;؄BypNd a.0. d j 4yup6P{)xV6Ȩ^])`^]*>.ɠ/'_]` ?8 T$*E:\4\w~= =*  g*mP@Tp=W=h]9ɕ=LO@1؄By<ӕLE){r,ӓ,=*f`;L֠/ɔ|R4 Mz'_XlBC<|N=60C=5=ғ2W@ W섊2~ɔ|ݛ\P3Ihs`^]h1tMh(c)=] ȔNOc+/3NOdW@ W섊2 ZOsѓ)Ky]ĥAIL= GMh(3ϩ"dJ7`xd{=dT0V@ 8 SSp Fٙ*85tKKOOWh㧦d=]؄By<&\* ByYC[ ^])`^]*>.p mW%s?LRC'P`^]h1YBypN=:ME<3WǞ*YeX])`^]*>nchr|4rWUt%yup6PSρNh)Ӑ#m*zuyuN Sh1]9K Uꂲᢒ mj0p 94ʋyudcuyuN S  yuA1Х+'_=+ah(=u3Ox 5^{k cSbrko?]c䵳`.0. d >;on94( C8hgBCj딝aLΪq4)-Z'S:v~)1F+cu؇S L+Nrdѓ)(Fzuh/` A (=?А#m*zuyuN Sh1]9K =2#/wqsW@aP:M@b3dcuyuN S COxҕ#_<&4NPz~!G>UHP@pchr(ɗz2e,GWM @C:4eJEUʀR`'T|) Xv`^]'SPchr0Г)(t chȑ|R`'T|)4\ڮJ~LApmSP:M@0RQ2`.0. d 1]9WWa]r^]Z؄ui@Ϗ14G[ ^])`^]*>.p mW%s?COxЂh(\& WWJV0V@ W섊2kڮ̫0d .]9B.-lBC:4er-_@.0. d 8+|鹟'SP<\ryuhA`4NP̫TT% c|X_y-_S"???44u犔;"iZ'!1ھvP,=3d GI0xT*Vhϟ?EZ=Iao9rdz>88g_Ͷ}+**w&L`ZOF chL*Ye@.08??ٳg薨\3󪩩9{FBÇǍ?Ν;C y7w{+d鹟'SP>>%%%/_>quRSS üy!s5n*//_d`;w={jkk\h 9shKKK3M~^e ,//?~fO䆗FEERUUO?_[IJpRRRg2!رcƍ\M:Ԯ];R3Lt̙ .e%~YGW_pڮJ~LA(iʸKį]F 8p繅waۻ]?;;;..r90>>>?O:եK*m۶UWW-ع5ڵc^%%xPd5مvm=yq`ju._de\0 ӻw3 1rH5E;ӷo_R5 !as[D0500?<437JEťȤ*YP0\ɊeG IDATs*#\X]oůx*>h4Ǐwޝ[L)//WT۷gGGG߾}r9!ݺu JLLt{ݾ}{ddAN?`"Ν1_0sbcQ)4PAI֭[tRwRrhr(Iz2ţuR/BoEEŋE_~eXXqx{{oTUU%&&Ξ=fԨQs̑6Xrss޽[TTt9n`"eҥ\_x饗***(3A1P:M@1DU/BJ6m֭[E}ь35ܹ:FBHϞ=Z-;ZVRsaÆN:i4|jiV^mm)))W\?~;l5k¢N8Ayꩧn޼m˾Xn]xxxtt'VZޱcamm9sBCCSSS,㏟}ٱc~$ >αAχ%pP@p ʡ$YzgIaM>}ǎMMMEEEcƌx}||JJJ._|ĉ˗BΞ=}s&NZZ͛mllܹsg׮] ӫW/L&PZZ:s̅ B<ȍ5d2ݾ}d֬YUUU%%%gf7$̝;h4ܺu|ɒ%fkjjOƏsfm7I _<&4f 3HU>|Ϳ___v{# ,,wٱcΝ;,ILLl۶ϼyN<)NǎGa!(((446m/lӦڵkm0̂ Ǐ+eW.**^}ǫVt^۽{!C$&&޻w"%0. ECCCk:F_,roftl[ \,]9$K =Q:)jƌ[nݺu+rJվ}{ѷof__x1--?t6z=k+W6L~~~Fh4?~{_~} ۴icsz=!7 }δPVVvnݺ%&&VVVa>>EEEFp}y{{&B6l@1k  +UP9SSS?'|aÇ#Gssv%F0O=Jc{-w 8+|鹟'SP<\rcuZw}駟h4cƌYhQ]]]EEo=i$Bs=8yd{a2BBBL&ӪUW~Wׯ_o]vӧOVVVddVݷodZvVhRRR^~evnqqC+ݻ7((ի/rU65__rýjO>b -'=ro>5 Gjqqq}x7n XrckQxUUUӦM  2e lY 2Mgղۢ2Y‚P :M@Jg"U*ؼysmmmDDD\\\~ !yVVǃOOOڵkϞ=WPYgϞ62ɥ"AgsǏQd0ΝgϞ+W$&&:Z___XXh0͛.,G ijY?)Z0qm_}Yhr(Iz2ţuR@Τ[s,T7P iZ322R׷mۖaZbSNuڵk~~~׮]#έ yMMwQQnvvFdUUm۪%.E᙭i)77]vl<-_ 2믿~Ν{5XArbܹs⏋kQ p{RdRP,(dE9߼9N nllbaz֭^zޓK5R37|NH:n޽?͛ףG> ""u(<59YYY+V(--%v\ftϞ=sNnoZ[ZD %4\ڮJ~LApˑUdh)={}KckQxfknٲȑ#6ݓrrrc3H{߮]LZDF ?ZPhL*Ye@(f4? Ks}ݴof >砊?Tь={Ne˸4c8p^Vtf&el&))iՍ'O$-|-(] IS1'eC &{0|]9$K =Q:) zuAh;x5*++ j۶ڵkwe=U!,,lРA'Oߺuo߾5-[j333mجg!$##ۻcǎaaaׯ'-|-KQAڙcxOJfL.p mW%s?COxDy`18 aJ.f>JV0V@ Wdd 1]9WWa]r^]Z؄ui@Ϗ14G[ ^])`^]*>.p mW%s?COxЂh(\& WWJV0V@ W섊2kڮ̫0d .]9B.-lBC:4er-_@.0. d 8+|鹟'SP<\ryuhA`4NP̫TT%  ̫ vB€5p mWUz2CW6pt2c 9іW@ W섊2 CەCIГ)(.c9¼ o%%%*ԩSD{#8w6lh߾[k֬rN$~"䋶h(\& WWJVЫ > a9u>}8kogΜQwUY1tPv[QQ1|Wy饗~Z*::}wk[| v/BttZn۶>{y;1cٳg>tJ3)+d鹟'SP+**wܹ͛7zJB6pt2c mT% c_^]јٳgo׷wއ?vXFuV?.^8`"{[zu>}4AΝ;G(--ꫯx:t_;w.`>>>:nƌob2|}}ׯ_?ydW^!0 wڵk.WTTX ŋ۵k7qDNo_|0;w ^]kz衇ӹuxb~gCСC||}z+?{?e`y JҾ) h BەCIГ)(% W$0 ۫k0Ξ=u;wv҅RZZc577\tiȐ!cƌa: t|ᇇ,***))D!+W?ަMӧBn߾t5}ƿo&Lt%lxϟ?QF;w7|GU*ծ]JJJJKKCCCFpdZnĉ/\K/+";w;HֹgϞ.\޸qݻw~^k[͛7[nK,ᗘBB™3g'\tf N$)/` A (=?HU }ZSeUf$%%M:gSSW_}žOro}'ǏsK~҂{f>j \t)66&n5ka_^R8q$22}Iwz衿 ?~RQQa/0a6mu:tXx106l5 ?#[;wf_M6weBHVV:FzGgf֭6Sv lsy`)11q8n:6D",.E&%d䎪d;Y ̩Sz]VVk׮W(++ۻw޽{(//߻woNN\{yyՋ[rPyY"{#Xoll|衇!ݺurӧ9=f̘qƱX r̙'uO ˾FY``/VNڶm˽e-0BHnnO<ѻwo**$$2޽{{yygϞ7nܸwFyw###gΜ)ӧ !655:ujĈB~g-OYIQh(\@+ r-_@.kayqB~/0 /x{{GEE9r166VpK̞&7ؿ={~:u={vT*UꫯΚ5+++200Z؄3g >lɨQުxkFӧx`gΜϭ\UUu63gΌ9R{,{DRv ,K,؄uP@蹒iLTT$ xZd?a20 00pܹϟy)q2uܢ~_ ^}ׯ8qbG `^?͛_|ŸqL&S>}f̘|~ٳ .ܶm{60@Qv ۓ{庺|7nXr;Si&BH}}}^^ޭ[E#\t:rorʥKnٲLJ=["Y&r BJѣGVVpylիWW^ye۶mW^{채 !ׯ_bKL$k$eJy(A#eYhr(Iz2ţuR P2nV|f'N8p_޽>.gH_ѨSF]vuo_5!СCwE)**ޚ͛hz}rrrffWuu￟2bĈ޼ys۶ml۶-<<111}=x 槟~RDcf֭!!! ,kY/[;"b  d2>>>AAAO<۹3.?0wjcD.kWYI/P8s{t,-/,.E&e UɂJV$S WK?hi5K.chr(grdѓ)(t chȑ|R`'T|)4\ڮJ~LApmSP:M@0RQ2`.0. d 1]9WWa]r^]Z؄ui@Ϗ14G[ ^])`^]*>.p mW%s?COxЂh(\& WWJV0V@ W섊2kڮ̫0d .]9B.-lBC:4er-_@.0. d 8+|鹟'SP<\ryuhA`4NP̫TT%  ̫ vB€5p mWUz2CW6pt2c 9іW@ W섊2 CەCIГ)(.c9¼mj0p A (U*U;La8+* =KWЫ @ |P:M@1hWЫ ̫ vBBʡ$_zga^]Z658 *U*zu؇=.???44ԱmGiMb-Ӽ>)))|'/_ή xϬeֲ&܉L?%%e߾}&-cǎ7΁jVǏ߾}HdPھvP,=3d GI4 ا5U]M׮]#ܸq]^[[S\\ԩS]taW.**btڕ]x mV]]msUUU Ü;w.88Ϗ rWklfܜۛ+ K+;el֒/'L`츸84,y\qϝ={s޽0LFFȑ#E䈜P85`Q9ڏQjpnŽo.L/s*#\X])+\:h4 cB߿߭[JBZn߾=NNJKK=lݻ}A>>555f+ o)!d2}qqqh튿ݻjѣ͹#u2VW}!&%%_fG2:tR Ò%K&Ol KJJ8P__Vu:]ss[ 6L(T]W6LMMM!!!&iժU{ܜke`Fa"+26d^xF3f̘EUTTۓ&Mbw%rK^0T=X;stt?+`gr[S!S -^]͙3gڵlƍjuLLN6lإK! ;w~G-Zd -[j333mfmBBB^zؠ7o ߵkמ={Zrs77[ݱcǰ[ qZ&lvvM6o\[[ׯ_tvi,yPe-r\q{ӔrСkZ+4!,,lРA\׶`d$PȂ 7mvb2?b׽{z7|E :E[]vW^3ԅ ZQQ\EmMMKy~tiݔir8`z2uÙrɕfs.`Ǖ'x'xb-… QQQN999=zpc`  6c?L,`-dݺuoƍ]=fΜyȑ;w+B0)a{滊P[Mùn:Ö"Sni6ά{N4KOv{8<1V@ 7BB %̫ @ L 6H/H <%//Q֨Q=LCCCkpyyyZ}xb'|;@Jљ3ghz}Ϟ=/١%STZVǟ?Շki^OXQQњ}Θ1cǎwielĢd$>/P]` Y@.1/&Md4޽iӦ`ڡ9ϯ*11q.ānڴiҤIN9:)>s~;v~W;v^ޝ5uaK(⾢UpikK­XRvz+~o+ֺ/Z֪ת U  @_+%IH 'J2癙!yL,5<,@vlbqC ќϨM|}ǎ2lѢE:7>|8eOOO__߷zy栠ٳg9*߶m[pp{@@ ݴi_ppK薭[vQ" <8//n(qԩM"Vgjjj.\=:tYX6_|qϞ=MvԩÇsԄj57nT* ?saÆN,H$K,9tPMMMvv#/]QQQRR2wܕ+WҍJ2<<|ٲe r8$huVmɒ%JݻNJJ k0KKKU*ŋ{90zSS?ʱ퉹|xk9/;vܺuknnnIIIpp9s8vrrj߾={bII B$CBB\`Kzxx>|xMpqq T*qϞ=aaa2l?(ET*ݻ7D_:VVVV__ߥK/////#FTVVrT2sB80cƌ&{===c&o_w;;wj&2r6!DPǯ_j#SGY~Ç=u֍;j.^s?Dܸq#::ݽSN_~>o޼Ёj$..\$jY^^K/-Yπyٳg h[YHleeBj蟙[s w^aƍw… & tdFT:88lܸ1$$W^1Bd/@*>~غŶ'|Uټyٳi?>tP>C2… ҤIܸqN-,,\fĉy ņF< *...O?W_}95lmmmmmb515?M6Y/L1~v6m>Z`MU*Ւ%Knj9VLֽ{wHԮ]8lj:///33֭[/4:J̡CFnPA'_~+VvMEE{zz˭KKyRiϞ={{Y;"/}f2dHYYӨ2$[n?~f0-`Mׯ_yOOOT`0-#::G"/55ŋ:W_eF7 5ϧ0h vjV T*Dqqqnnn>>>k֬vf1?1 !7"ˢ;_v[qVcӴXY&l?5MtÇ۷o?AٳgB]O=B ھ};oYFBAwMrn~2we !/^ (..9sٳgyR5-// 9sRܹs'=C999Mr<22҄ akL} !EEEᥥ&mV˗/{yyF5۞ ` yE1`si~S"t֭cǎ}"5wMk0-?O>Rw4]%PƬ2wrڵ /!5jo/ܺu֭[ sMF^Q;Ğ"BEE Ǎuy,,VǛV27Y>KYk ܹ.ArO>Ν;:u/[khh0a¾}LJK:t%KLbU0=XPhGD?xl{" `,s|8l̘1R4<<|tdMM… }}}ϟ_WW7rȺ::4??_XͩڧkYQQ1n8z3gh6lɓ'9߶m[pp{@@ qԩl7o )Sxzz[ ;vdE뫚f]tѼz\\\ll,/g1!dӦM~~~.][nڱcGD2x༼<}Dg޻w/=/3gfZDWWrWӮ2FZ& H-4ET[͛P([qɒ%Jݻ}Z"Ԉbv+W:wžCˏ?}G ޓ'OJ$ج,TFUUU[ gTTٍ>dIHvS"""t^IMa!C| lܸqĉ=bBUUU dddx{{79 %%m۶:+0lذ_~%..nɒ%999ՍVJjV|`:Mzb\g"=g ,K_ϖ.]ڣGO?4 `Md7z{{ nرcII G4 lb̙S4G)(( BRT*+++ʌ^<0LQQ}z}s{Qѣ򘘘X3CeCR՚!mۖno۶-w(O<ܹso3fLMzIJlѾЦT*.\{ϳT=~ҤINrqqׯή& ߭.ZպѣG_p>H$/ҪU! `ϟ*!dΝ~~~QQQ&Mrrr"l۶)44gYxqXXW~~>%Oܻcǎ ??ӧN:5c BȃߤuK;v۷P]vGFF^a.Rc@˱eh>6M a 6 &s:г|3t.?Oprl{:Y;O.7J =UY4o{E@ (2b = 6/c7XW6qmk溺Z(c%JaY[( 6&k7XLdf suǴ?^KN:[<ې۽{Z k"DV6-j=˲oQг su`YM趄k@Lf?짦~jjпj! `;4.@lڴ/88ҥK>W^a5jԮ]!>2e[o$ѹe˖={,\{uuuMغukǎ%8"7nT* ?sTUU͞=s̙:Wmۂ6l@9rd]]T*JΝsuuݼysPPٳ5\B;B o2pNl' r+BDM.Jn%--Z8z6 uk-RRUTT̝;wʕtԩS'JExbLL !d޼yb8++ҥK1[ߝ;w;wm۶K,Q*w}BXvm*e˖qD2|OOOB~U?~mm+**.]/N+**,YrС#FBN>ѣGTܼ/R_jФw 5B:a/{6{=QkuA-1 k 7qqq!UUU dddx{{رc l߾}̘1 OMMUe&3s^\\\<<<!nnntr./ @L{?];n]wۮ7{m׶kgÐL?߻w/99y„ ???Z]TTD~۶m !NNN'O|7/\@ŅJRTVVViT*.\{s|cFSѣG111󏙳sCCZ&( }p`]HAQofշÆoUɞ.,յ]#GdD2~UV=y򤼼|͚5ӦM0￟:u\.H$SN}ݢsiR}||T*UBBG dܸq׭[I&-_!99#&O8Q[[Aӵ*Nm"00P* }p`&@! ՗xZ/[ U}….6usM:ݲk׮իW w &ܸqc۶mNNN>lfffW8p`DDD^cرcGEE_ttu}vGGǠ ??-[pǩqݺuRtǎ#,^8,,+??_xGG?|޼y@rW7HAQ?/ 66YFJqUemoDt|W?B$б)аŖ#`ɖzPUem{qv${f1]ε%6fvUY.L9f `0@QO d[ (Y]> s^>n\|rvHnQ0@U>! `/mpduuuH Pq  , F   FW .@ @#a@' `/\& `..  _507 A@VXWWךhͱY]US}*K쬾vU֦聆.r`n|`$ |(|@(GiSGV^<  F OXW^`L07 A\]>`]]0>j'du-`n..  7.>a]]{2 (suuuH PȶAQV`0&|FW >ivZȦM)!..[nHAQ̚5KooٳgWWW])))}5ŋ'%%ѣ57~40BaN}CCC=<<_jk\i0a@! s)...((HHH8p~Hw22 vKuue˂CBB ?sϞ= nz֭QFZڡduR`n o4hP@@@bcc훖FʢYTHt}^z[>} $Iv=vEb?BǏXoooLI+***//?Ν;FFF-%%% ,h߾s>}~7a 6tY*07nد_?DJWnܸ1u^{1bDPPPϞ=W^B),,3gs=w-z"G #hܹsʔ)۷着/^'>#uرcʔ)z-|`$ |(g))) ðr)-- $ddd444])))>>>;vfffӇRPP+ˏ?iӦDzVzz:[BzzZNHH4iRZZڪU& _LOOW߾}͛SRRhVgQէN6li 8!!!!!!>>>''G.+tnuuu}Yvvvbb[ll, .,[,$$O>iҼmڴ!EFF2 s̙ WWѣG9͢3x`|֭sMOOZhє)S $_>.O>ɩaw}ŋ lݺ5 p=+99RTT0LLL /ڷo!ի lٲ%00nߴicVV}ZRRB?0ڴi0̰a>SZ=xw}N4iҬY 566aQFM>]vkR)}QݻG/]^0a4%%-Yt lٲ֭[ѣG !ǏO !uDK.q@+ԬN(t ,=l>ivLvʕF:ɓ'=z8~xtt4O >=+55m۶ڵS(?өS]2L,у}Yk׮ 2$"">#tܙ ~޽?|aZ'.\0''gĉ111ۋO>]RRR__OBիW !QQQ:[ŋ-cf`:4,,>w^ǎKDLMMzgtV`{]p3fHKK~6j(_~?=>vZ Y*##[nδԁ&i!}MJJZjUBBD"iii ä]NNM@ϛ7Ν;ӧKޮT* pΝO?4111--m3X//:;o!]?CppˠA:ڤ]v=~ĉlڵӎ!==L>)$$d֬YJa5kDDD8;;DFF:ts{ccҥK%L&2eʎ;0**>>[n...Ν:u={˗/GFFby敖l}&%%%BSR)Ν;]& ,,b=) n @˱eh>6M a ͅW_egg[; ؉ffvj٠"\0X>n\ ,/_~Adddmmw}?~AȖCV^ e Fvhʕ<}СCl.`<`,8,+`,56M.+0+0$\I @fa@'k<D4k n|0m! |(|O d[ (Y]>`]]0>n\|ºeAQv Y\Tڢ6x rss]]][ .sxR}{.L0  |(9K*FFF߿مG)))-t zSN-W 03[ SduR`nVq… &̛7jÆ gΜvPvѱSNM744X|58! > a B:+VX~)SGy)S<==}}}z뭆:oӦM~~~.]b ٶm[pp{@@ 4'Aq. IDAT!!!.]JHH |2[TMM… }}}ϟ_WW]fkd[nڱcGD2x༼cBJ());wʕ+K,9tPMMMvv#]NRSL*..^`[!dɒ%Jݻ TVV2 sMHcLJ\SS#+WtY|M5Lmۖ[ӧiL\!>F6 K_j^Fn^}϶ΗKν[_l/KBt}uWl^bӉitte|lL!fjh`ot>>>M+ HԾ}{4$$AqssSTtÇr...2N_N/++ҥ׈#*++ ]eʞ={d2?~L[]v췿MI-9ߘ4سa߾}?~#R}DKN%̌A^}ݭ/ZҸNv9`k5'Y&tZCY]> _C PH#22Mꢢ"m۶(gѿkyyyLLLllsCCZ&( ŅJRTVVVi߬:_f-Jr…wﮬ<<Ж)))X<6NzB#LMMH$ʿ^~~~ hOkjN.af :nj渖3}f4 ،2ء5X)c07 OV\y!J0˗̙#HƏjժ'OYfڴiJ(..>qDmmZ J?J/F"L:ߦs񊊊Ν;]~*hd[T*UccJJHH`K{饗hTTTZ0f5>=kB98%Hƍn:vvhuw 3cйW_wۛ.nq-AQ| _" |(ܸuupi0a@|BV^ F 0@p1;Cۀ..I(Ih`>! ` 4FaйY]>`]]0R96"`'"+'7(suuuH PY]{l   F OXW^`L07 A\]>`]]0>j'duE-3ؑduuuH Pq Y]{a17%A@VZW_2 Ȥ@! 'du-`n6 hLx..>(~Hd7(ܸ.@ sZ ! k t0ȶAQ|  PqOD"~F   FW .@ @#a@' `/\& `..  _5 apbHtkbM6YH\\\n,4 n.L@! |1k֬~YT''?SM R$-]ݢR\]]nݪy={jRRRkV YxqRR)c>HKڥKaÆeĈC a=zԴ :V閌̙3 !!~]gu===,L > a  ofJrٲe!!!b]v|^RR`;;;~cK˛0aD" ܻw/͓͛ bzzzrq~I$WW茌 6{… H\ҳgOz:7--{WmmmVVꦦDﳑkݺu۷i;t{c.Z!?vttꫯbcce2ٿ40|BV^ e̛ahVb{;p@Ν !%%%uTffaƏ_^^N)**JNN>qoi~-,,,..߿?4BH]]g} /9H\ޫW/X^a@] tWJJOǎa}!DEEǏoڴ)11-0==-$==]V'$$L4)--mժUqqq3 n.. 6r777c_K.uww?yÃ}ٳgCݵkWϞ=;wg]|ov}߾}ݻwի׊+*++5Wz*!Ds!+V6lXPPP.\Ky駧N?644/!˝zA^reaa… woߞBsM-oV>}vݵk޽{UUUlV755500Ϗ>vtt}|avc}}B8|S2w\b4BHqqq||ӧKJJ~i$;a„={6:::++wakئMBȓ'Ozqh]?3nm۶m׮B駟Q,41ʼ׮]2dHDD}׬@i a\CIKKSՃ jr@ZZ0iiiۃϟ?V5^|9,,L"[^GiJrzO;v`: aL6jԨ566jTڌ3>CGG6md2 ە:fBH}}ח-[y{5ZYnݺ9;;K_|=2%%%((H_˃! 'du-(---((iFBHMM1 xyym۶?ˋT*wsisUŸK;tPqq;wh4'''))O> 2u_=44#<|m,R~ʕ+Jn5kV]]OyzzA>ㆆgϾog}FٳI~[ZDDСC׮]ؘ7n͛=<<!sQ*4K!<>:v؃bqNf͚b BHBBBBB½{L|fLIIa444d/vuu5l@s@c.XLee۷y^Jrٲe!!!b]vld۷wvvӧoƖ7aDw^议yAاѯK$WW茌 6HZHbccK\[[E'ĥDﳥkݺu۷oP;t{c5.kkkb?BǏXoooL. I9rd@@@```LLLxxxyy9[>G޽#JǏOש42ٰaC׮]Rnݺ%D77X6HXaJKK !לSRR|||藈 !욏QQQr6mJLL'ꄄI&Z*..fiC%<~8!!!;;74X(OO3g_MdkCg:7r_Z;N@kak5ܛRBk:{,!D.ӧj:88x̙_ ٱc{֓'O~a}}}Ν{k׮K&رa˗/BѧOcǎݻwfiK.׮]kZ՜Q۩S>??;v|Wsrr|MTP(h!ׯ?|~~\.1bD޽Bs;wL4_ܿݻwW\)hVT0ܹsا:]v͞=iii}ܸqc]054{<˜zucbb0LiiǛ@J4BΞ=[VVpi_~ѣG_Ɣ0LQQo%H\\\vJD`^z|8{ዉ0aBNNח/_N?XSS3w[ܹ!222>>l0ޱc&t5b&77VMxmPFKki).ͳbV״qKiduLcgu0 F ?c.LѲe''[nG%ol+]f̘U٫pWcfsԮff&gutZBHZZkÛiE9BmqGGA}0Q^F(Gt8ΌryEQRhڦ~ٓIv6nmg&+~wW_9*22xZZھ}ۥ=yA8tРAĩ=ѣG_j9rwꫯ`0̛7鍊n C=󑑑{.<~}'Bkk7|O:WM/loow._=xh1_Jg?tڱcRSS]9`q灗_~yǎ7n={z.4A3g΄ vYXXf͏<ȱc\{n "СCDGGzᮄ=d-/grh0P~⋶޽{ 4dȐogcǎI;;v{:~xJJ 7P]]cǎ]vI/EEE 2Dםaˬ iii g~AnӧO9rd߾};wشiOS)1fo:z8O*CytSN}w#""R}}JƍZfi` ?~޽3fLbb/cǎ]|ѣV1`0<3Ν;xkjjC?b8 Z\\\[[_^^eڴi6mذab!?HNsӃ3GA `*?~F^߿/K*uT0f̘ ٳGJ֭%Rkkk[hh1cFAAADDĵkמ{86mԻwoK/pM7(ٳgWoߞf0ˆǏ$i&` bX؏?Xl+{ssho~㵕>Ûn`0dffAj[ev322 È# nFN'D1bDTTTrr9s^*{C!krv =퐢j@ 2$梵}Ǐ pqUNp8._,.ݶmᨪ2 >`IIǎׯ_/PVVTJodzg^jՑ#G.]W_=3jzzY.^(p..11?ѣG/]tȑ+W eeeEEE~ b"Rip 0_vn%i^C=$Cs_z`0䔔O~_y:z)?QbVV\%Y޽[~Kr$:ZЖ.:daG:+2z脄ĉ'ڵK:eEr_W?nv8VUIh\ 4w\\V:]B߳:`sdpСK.1?|M0!%yϝ;c;Zw/!4C5W`s@Xj>} t>7K,)//ѣǨQvޝ%%9qℴs.x@.Wutu@`.V _r _̀ PG됢j@w!COX tVu tpIINݫ}eggřLS~R6FoA0`@MMMp x`04\}v5ݻwڴiO}ZU=z(((HKK[`Akk OJJ2Lsmii f@xbVp1@Q__3f8Ϸ|AFFqv3gΜ;wĉWa…V.]^bE'@¬. @%:> tpKKKuEEE^_LLLt>-99YaxmRRҁ6nXzuϞ=f?455k׮5˖-۶m[GW D/t j511yb*))ɧz}߾}rJUUUkk뭷*t8@0.4*j7|pU[n?~O qyyyJJJRRRTT˗Vjr.)c^ub͚5yyyviݺu˖-)NdXVX1sLјSO PQQgϞΩ?1 PUJKK?OIII=:$ J\$3? @%:O2eΜ9UUUڧ~Յ۷yu޽ӦM{'jkk+**ƎuŠN@s;e3ϬYfƌ[lvƌIII/כ洴){---*z_~FqѥҞDzէO^{͹. \'%%Ls綴8K,YjUNN^ٳŋsrrV\rZ}}YL&S||?,<(((HKK[`Akk8{7zUoFrrrdݻwK ]xq՚OS'bX.\XXXx &8bAXpj=KWX`=ztƌsss?33Ν\VVfX-Z$Fpn9sܹs'NXzH^y啍7ٳ'%%%WVVV>c3f̨7on!s΍>p|+bAK,>...̌pvzIv6u[:ujă?\pAˏ744DFF^|Y|sg P__p8k$zY Oرc))).'(&R__ߣG-[\vMGcccTTTEE/[\!?d_u8ϟ7ΩS6m8ǧ;IIIQQQ/_ZVJe >|۶mn:~x#fpHm%v]<%%Ery."^s_MM+C\ YVV&0++kG9rdVV֎;.\0l059*ht7~;_^Ct|E/Ғ%K m68t#н1 _BdKdddnnӧ>xYfΘ1#>>>))iҌ[}}YL&S||?,Bcc󓒒L&ܹs[ZZAOKKիW>}^{5#*/t[oh4=TM]꥘b4iRLLLzzz~~Teoib{---[1ԏz)ZdɪUrrrz}Ϟ=/^]fsZZ좠 ---..nj7n>s Lv5w%wo9tЫWfGt t99;\*`V݆n222ħ6wޙ3gNTTTeeS'u]{SٳgA3f7|#u8 /_߹sgzzhll~rK}}}=lr5 9vXJJXl KzRY^+k4)Uۥ$j%e!:^w9ԩS .W9Rz_L&bM$]222Լl.--}W_xԖYFw.~ >sfMs^UB`7##ʵ]( j:P^`B xh|%.b jZ8pKM& :o߾_zU~\[o5!!!!!a„ uuuEEEލ7ޘya{̓ {~G류^OKLLlkku=))sMcccAٳfPf zr加 Bfffqqqqqرc v⬬,w9_u=n* PqC"5t^ Z Aϧ*k!P}6DF3t@aV:Lvllp iYYYJJxpHAHJJ|8G\WWWUU%ĉ?䓚iӦ͞=[~D:~n߾}~|QԥReeeh.BuuOhR7|m۶9ܺu㝏yG+3.@yyx% dee߿ѣ#GڱcDž  &bDܹ׿UVo08S)Z(A7NW ࠡ0ჿtcH;FqK.mjjY|>(y駯]f>l4sssz)q]dEEŞ={*++?f^.?BRlDͶvZ%h4N4Ioٱcf{= /dl҂Vrg͚5yyyviݺu˖-s>%#v9G555Y,+V1МSP|?} #GFGGnȑ۶m=r_CxHw\| 'pϞ=yE@"yc.6KHj6 (QlLwCJnذ%A7#Xz,ĊtjznΣkt #o<|>X)_iӦ>}1"//O hm9yR?<6G襗^ٳloESS￿vXѸlٲm۶EGGGEE>}!!!aȐ!)W1Y+**jmmmdddbbij6ϕPbŊ[ٳC\5Y] @:Oۉ;1Bzw!Wݸj!.l5g'O:twvuBT7n(>`/m޼yРAqqqsϏ?(+BϞ=m6 :o߾ wɢ[oO'LPWWT{x㍙Ҭr䫘M6뫉mmm.W3!+/ v}ݺuO?dN^蚚ov ltRKb;vn\5qit쒒.Z[,TbVٓ_fgg;l6; qb儤˗/F'N8qbkkgϞ}i%5wl m۶nݺu%w9iҤnaرTLnVuOaqE&.tYfb:#<"%+OA\o$''k׮MNNNMM=ts ,X9YfbyjVMk:jϯ~+鄟6mBQ__?k,ˣF3햺lmmm6mڵ4&MZtiSSSMM1w沲2Ųh"P`y3207jԨ;l6gffΜ9S~B~~^8p`llq+W&''lٲ|РA jEdq[d2w޽ũ9vw}wʔ)~fSL9BCCCDDDEEtF1**J:_RcJǎ}ժU ."*pYAǷ~~Gqbb /_ڵ+##CjjW__ߣG-[\vM:.@&C:jJr]w}GcÆ wUǎKIIq묡!22R*t&fڵ:vpΡ_D2ȝ;ww]] xw Z:=(ħ?lMŃ`0KGywO8Hݥ`0AիW^&"^/%ׯߕ+W@15UCIm=c{vk\w<׮]V_B1M5-/s.P)c=#(X[[;cƌŋKd.]")F5X,&MC~.sb??Bc\@72ׯ7iiitI6""bΝSY|,\ʣ.1'[&)?"B}ˮс 0 _|ƍ^j6nj7ȑvK~o=zA|̓^t.]4|p#S\<$77wϞ=Sq!ܥaÆTo_B1M5-iiiiRR缴;~hR(8gΜSNp{璻 ##çWfY,+WlW@@-bDG`YYYJJ%\b񕕕..kQ+ FGGvqoj DIllڵk_{:XwpPo#*!E@XaV u%%% %??_5 @# Nku>*aw`'_@(f Y]-bfu` k^0DQ \D4x@ }uDQ  \0+ M`VF1p..W Z] WJt|O Y]-bfu``_]*h@0.2x@ }uDQ  \0+ M`VF1p..W Z] WJt|O Y]-bfu``_]*h@0.2x@ }uDQ  \0+ M`VF1p..W Z] WJt|O Y]-bfu``_]*h@0.2x@ }uDQ  \0+ M`VF1p..W Z] WJt|O Y{fu̶@}uDQ \{@w¬./]%M`VW@CIQLma. ]._ab.Nǖ,Ĭ.^1Ph@0tվ4@}ul + M`. @%:>Ĭ.^1Ph@0.4 WpvbT(~jL.m&0 C J;/1y]:oV%tjc8.ȱ.v!Ax#R X\g$\@q1 Z?J,B@?0 $?H"H-# IENDB`icedtea-web-1.6.2/plugin/docs/PaxHeaders.17941/MessageBusArchitecture.png0000644000000000000000000000013112654402377023001 xustar0030 mtime=1454507263.207432981 30 atime=1454507327.169579937 29 ctime=1454507658.74215785 icedtea-web-1.6.2/plugin/docs/MessageBusArchitecture.png0000644000175000002070000011737312654402377023541 0ustar00jvanekmock00000000000000PNG  IHDR2EsBITO IDATxy`E2!!3dBH$\EP.AYDt  |#XX9[\`eW<"F<`I%p%\791Iޯzk>S=$IPH \Mh4[sꇈP9$"r@ID%J""DD(P9$"r@ID%J""DD(P9$"r@ID%J""DD(P9$"r@ID%J""DD(P9$"r@ID%J""DD(P9$"r@ID%J""DD(P9$"r@ID%J""DD(P9$"r@ID%J""DD(l2rJQjjFfرrof~~~F/R:wӐ+ǎG9fj׮N:thzzzCq"̽%p_Dиf_?yyywߠA^feeyxxtܹ6+++-_vĉ=z:uj4 "rPycƌjZzƌtR<-͛7͚5ZyÒ@8}rsiiiz'B7`0 rovHHHlleΝ9cƌ?e˖zJQUUh"!ĕ+WFcuubÆ ;vtOKKB&M2n۶ͲXh0&N(':hvpppXXؑ#GV^rQsAmT^oN\n]PPPhh#G oFZ#\bYݩQ)EDRXX?721&&櫯d2}ϟxbrrej6>>>??ҥK׮]NHH0oҹsd/6mgffٳg9o%6w~޽uA>,$/>|x-ZBDDD?~}zYY˗sss{99^o޼9uqfffΘ1c޼y#8=&)77ƍSLٺ{~&Ǖp'l^T/\ 0eoKZmrΞ=o]ڵkk$3##CNtRXI=<<̅$&&FEE%;ׯ_oӦ_msmPPPZZڪU/^R^^|َ;֦MyyРA|$Ik֬y',hm]PP Iӧ5ͭ[倀spN3oXXX(IRJJht|&/NJP?@啟_UUUyyyĬ,_jڵ;vxƍۮʪ֭.Ieggk4s!aaa7oޔl4mnRZZc2d9Q!(..8pÇ>>>>>>ym3+hժdr|MvA V@]X&޽2##C^rJ6mn600YYYZT]]m.5A~O>/eU!ĠA|8$$F-[?22SN=z?~mnܸQFDD:̙3Zu֒mFEE} .ty|`m۶wޒ$ <ؼiw5@-ɳ\vQMMMٳ#$u]v;裏^rEI4+Ǹߎ%TquWnnOrrrE)a 8F讀pP9$"rhDJBҬvTjSF*Sp"rP EwUڹs眜TT{zw߽sFH@U}iӦeee0u|{͛CCCf͚UQQ!()) 4ӧO///B >\W^yE*__E !\b4`(_n]PPPhh#G7uÆ ;vtOKKB,Yg1g1b֭[m洴qPm۾o5JGEE`{mfΝ|qƵlٲEܾ}S{5v^Є@2L~/^l2!D|||~~K] ؿWqqqqq >,$/>|x,fdͽqƔ)S͛縵ǏϏz111{5LBÇ?6sٳܹsÆ Q Cvv~k+b`lVaVTTO?;tw^n2 6/.\B\~]~o߾]xzzfddȉ?c.]^^^mVZx␐򸸸˗Kdr %IJII1-رcmڴ{'HiӦ#G:)+,,޾}{QQuEc5;UXj/\cگ}.9ph ͅVm׮ܱc7ndeeUTTtMN$zÁ>|s9v?|I& !l`X///___!DV[l۶mٲe7n3~ݻw5jݓ'OvSos=jժ~fggk41 GiͽYPc֭["??6k~֭7]@܇hRl^Tk#U\\Y\\\#sjjoSLСCYY٪U?Kdmٵ믿jCUWW;v̜ҥK~~~.]tr`2VZ%ٿOo>Ng٬٬F}ݶmr̼]s1*#ƥh.\XZZSOt9s!222Fd2ݼySpРA~aΝqƾ}lRa{֞d 0LW6u}ԩÇsS_iZ___QT3N7jԨ痖,]զm6٬+V̛7oϞ=&IGo7ݷװ;nFh4oٲe###;uԣG !6nܨj#""|}}z!D@@>ʕ޽{K4x`!|m ǻoa;w@ip2RnwQ=uԐ!C^w׽4*s(Ҿ}nMq@AD05UgVqL7߼{J7JwiZw9wLp]q9j%ʠɐ/G4+e[+P* GG&rXMq9"rbq4ytrŘG(P9$"r@IDL<+"r@ID%J""DD(P9$"r@ID%J""DD(P9$"r@ID%J""DD(P9$"r@ID%J""DD(P9$"r@IDJ7$IJ7{GMG@pP9$"r@ID%J""DD(P9$"r@ID%J""DD(P9$"r@ID%J""DD(P9$"r@ID%J""DD(P9$"r@ID%J""DD(P9h4FVpR<p' !(It_$I⤠""NDt'*ADEEmG扈;aѝ97C'+a9'"rNDwD Q\Ԇyhj8 Jp3DQp"rQ摣y""NDt'*ADEEmG扈;aѝ97C'+a9'"rNDwD Q\ԆyhJ7 YAhXHh,97CP'/Sd8׻ p7 Ã$I|q-D Q\F픓™m Ovp'xjѝ97C'6{hj8 Jp3DQp"rQ~9wP ';P "rn( NW.j{1Z %^|;S㽼nܸ_ԏ( NW.4V[VV=cNILLh4Ǐox !Iի###u:]@@?Ϝ9ӳgO #"GSS+**.]jժSΚ5K^>tPv$:}]w%ٳgqqqII̙3g͚e/ԩS\#G][+ɓ' ~nnn-JKK׿g3"99yׯ_Bܹ3""Khl2N|xҥ8X$ˈ涷nZxqNN:_0jԨO>D~-ߙKNN/\lc=f/yrrwYcO/_|С9sJJ9ɓ'>77O>[li8ۼn:((H-I_K)~zyٲE?^hl21113g,**ȐANY1^-[~뭷[PP`q9,6GR%F/IҐ!C}IAk֬Yb̙3;(e öm***ZXWgoWKzz۶mj'NXZZj/͑Hj>}曷=uc)..NKKիח_~y=or3۪&OW_{FQN9r,OIgVuַ~ҥKr3uǏONN~G .]lubees{ ׮] WL4F{Q]]}yUUՙ3grԩ|9Gpg#GL .ȭ/r=z;w^ۺu!;;>DQfݯ bbbV\ib]1A-;vܼy#G:tuN{#͑f]87r;ZAb4;t萕e{#YYY'NMQQѺu벲 kRR=)+6ݻwڵkwڕwVZu=%%]v[B=O>9q\NJJJ-#o{.\؝>}[nrmWTT355`0Ur6 IL\A={ۻs6/rݻ={v׮]aaa 3%%; &Oܶm[LKk׮5&QZZ/put=zh4|9OO:x%K;CS[?6GO>իB[nEDDXجaǏ$֭[+Wxm7Im`y Dh׻|pƌ t&MB9s!Ct:ݝw !FDEE 4讻jm~霜SOu]l i*_hX}ҽ{{,44Tyx ""b=z􈊊:y͈ԩS;wvOwMWP{:m^e=z8sLttJՎ1BQf}||ƍEEEYجa'xBӵokE0 IDATСCn׮͜F#Gp$~ƳhѢk*P:dSHg0aWeݑgqǷ6Ovn~ 6lpQ[wB 3'N^#9=CLnݺٳG扸uBWq_w1-0k.E5^ L7Cmh4n-o}k9w#jyp1lx V4e 5ָG\3kBAp:cb6yC[f?jUCjIMM+wӦM ,pj$I[-&7>9O?3x`{:w&\c'Oٹ:C2jp$WWwp "r-[}zyyeF`0L8QNܰaCǎu:]f67Ylwy͛7-=zŽ9z=Xz^r劜mݺuAAAGSƍg0_xJ9=77wԨQz>**w}O"QwM9@~~իW###)&o=ŋ-[fK.]v-;;;!!rӧ]|977瞓#""?/kmnn"!ʕ+lْԦMo޼9uqfffΘ1c޼yvm^^^šr!7nܘ2eyiӦyzzfff={ȑ#o񆹑!;;oݹs%QQQ'O{w7XOĉOg5LzHaHoWϺna~y!ڵ 쭕$3##CNtb.ücǎiF.\mnn]\k֧O< $I:}Fu떼`oͳ,PhݘĨ(:N^>{^wnTT)~f~Wt:^?N;vlРA>>>wyl/g+S4̲\6=rPUUUZZjNjڵ;vx 6feeUTTtذaM5y+m۶EFF 2֭[Zh=֛۬r͚5/hYe˖>>>>>>믿nٲHD ,AO9܀Ο?oNȐ\Rc͵ׯ_/((2o$Iy+Y~~~\\;SPP78mhssiٳgY4i/"{6Gf7n i۶o5}tOOO}4޶2j)l=d~f)$$$66d2_Qj>R"rz2Zh4 .,--MHHxꩧ,3\bbb̙#?HJJ2oƌK/UVVBTUU`2V^y6k͊}bbb~駺f47=zKKKsrr^}UN5j9}ҥM:4bĈP-鬟}2+++۾}=co={;wnذa۷ y'?cǗtsMe ;O4LԴw}qΣY%Qm)8cP{]9y^^^6mС3kLﮱVް###׭[gYE~~  ll/t+Wsm#WYNKLL;Nsp?4 5yh>y{{?e˖Blsz/y'MdyppܹsO>mo[a繦e|2?ej|1ƳOf&i׮]B{LzKΐ_iZ__ꜜ_]'~>}Vf\uhǺLǏfYZ""ҥKYYY8}K?(8qbBkN6-""_~rΪK͛7o߾ԩSܹsnnks[Y˖-٩S=z̟?ߺL!ĦM<<ƨ1|y~s)ݜxg?,!"fT̡i;z> !bcc^ҥOlllYY?nٲeVzga9SN-Y$((hɒ%Bnݺy{{{{{BI׿{zzkn׮]6KKII6lh6mZqqlҤI>>>waǎB;v kosgm&;o޼ ۫QhѢkn߾]aoy_rf{B} Zn陛+w׶m[!ļy$I B7...{MHH$irgyf[nCm۶=<"22R7xCy1cƼ֥jjɃ BL0Anܹs͍l׮ͷ8}tV{֭[Ϙ1CNt$Iʷ6m3f̐A{-?*͖6ۣ\9w\=-z|vɒ$ !6o,w^I+С$IcΝO/Lj旻v2U^^}sk;v(رcºm۶ !z5{Yf !ZmII$I۷B|'Fڋ:ԢEC !Zosgm&;I:t 裏$I?)rPorQx41꼰}ѣDt'uRy1b;|.!Đ!CUrϟ?/I)СÐ!Cڴi !Fm۶񑑑W.((ڵkV*,,4'Μ9s3gLJJ*..뮻,XPE͝;wΝk퓓KKKMZre\\~;vlppp߾}k?cʷ6m⩧ZbԩSG-Gk%$$Ϫ}rb=͛oY3n#߃'Ӆ 5h槮'4 !6mdNG6l0aޝ;w~뭷j`aF~wq+,wF@#qBcR04 uQ@kJz_ީD=)gy*))nѢbϞ=cǎԩSi'ȬnqNDwR!NJ󔒒2cƌ?&iBg}VF9V8= PP5,((sŊUUU䲫V.MFNJ5 Zj_?Djb?Ź;k4{ǜhƏ6$7L͚5˽b1&[!v\p3. 撓BTWWϟ??<<\s%''w޽7o>zMr_*lK 9V8+Srr_.عsgDDW^Ջ/ tǏ/++B:ujz`0̘1fʕ+W bcc+**L&S||h ߺukΝ"GV{tҽ⋋/ӿ~˖mps@=_9; |zzzVA \p3. 撓{ճgϳgϖ%$$,ZrDhѢcǎݼy3;;{B3gedd̚5fʭ[/^sC}ruӟ_~C%$$^-戼lٲe;v{;xe\s܈_8z>ٳgϞ'lHNpֈѸՅ.$GgΜYn+++Fcv233׬Yk׮`^O!w*N׻wo)ݺu{[hѡC{֭[r;vl۶ϯ}ٳZW\׬YSh(<%%%::Z^lˎ̹݉/U :Yzի=U77#\ȿk/ct!āʺw/ !vCgϖ#'딭[[pϞ=ݺuB|W{/{aanz? !]VQQ&`[ν8;񥊳3nݺy{{{{{r-Y$((hɒ%BI׿{zzkn׮]rO?4$$$ 3kycuIѤUi4MV\\,Y~mKl`{ϟN}wڵ$ԩSB$is̑$iʕ'OիW;u駟Z|GѧO8\2&&F\XXh0N8a`0TWW/GGGKo߾}ʉYYY֭ǡcG-<</5kVX1scǎJ_.ܲeĉ%I2 ۶m0bb)&&f׮]$]v`0,X`p iiiI֬YS6ԕOwl۶Gr[7Btgyf̘1SN#GBTUUYn.ǻ33<تUɓ'4H1aykl;{%[/g"RSxhV4;X~C=$IREEEbbbQQ$ICݾ}$I;Μ9#IR~~W_}%I|Iϝ;gt҇z"33޽\޽{۶m{˜2_~Ȑ!V.\ӧ… &u֭d2ĴmVS 854FKݶ"F7C۶m{$IڱcV5FKo߾i7L6Slr]wzxx?~\۷1\?f-r.\ IRYYԩSG%IիW}}}z$/[zRU۷ϝ;5^yY$رbǎKD>H^6p-_n۶MѫWٳgߖhڒ;.油6+jcTĨ UU7[>qℼk.^Xg}6((UVQQQ|͔+W}z~С/*++'L`ԭkj:Nu/Kee$IÇ9r?r mhޗz_d"1cƈ.Z7$u={֜"IMM͖/$5\|f2O Y;sᠣqކs5ݱW^ySv!zGw|bO0^^^BX8X/8h k?Nd̀S4?g6lP5z#݉m0?jG!'ȉfΜ9dȐӧ }뭷֭[W#駟޻whߙGy""""""Ǝ{I///$''z^+!ミݻpV94AAA׮][jUaa3g\`̙3m۶̌ lݺΝ;'''ʿd] ,\zu=͛{lܹ6+pQ?8Q.\r[zht}on# ?:)IVTQYػwoppp@@C&[n{Qm8^?nzR9mNC擢涹))Pg'7?4F3AwR!o9ZAq P1mНTf +35*yiii˄pᐢaB#G3?|p^wܹ)z{{[tuH-%qz'Ш¹NMwJBut'^u:FAXsYBqG}tڴiYYYoneeee7ԯ$ŃTiرQQk(ޝu:]om pBs._|ܸq-[lѢo.7n` |*++A Bӧ;<,Yg11b֭ B\n]PPPhh#GH٬066h4 '>\}\bG67W]VVȑ#z}TTԦMzko+ٲ7m7߬e'hT\X\*N^^^?\ʻnJ=_;`=˹aÆ;tɉ6W9ܖ˜EEE??nnڴigϞ=ro!0Liii">>>??ҥK׮]NHHe111{5LBÇm.A 4277ƍSL7of]>}zYY˗sss{P;66mZ```vvw}[ͭjysssSRRrܹaÆ\E%w+lFThnݺ%/XW8rrIu57(j4wy'""WכXr@S0h\ց[}׿j; Ȑ_^|M65zzz^~=????? ++֍xƍ駟>tfrk.VZNG@n7W^w e~衇d?IjS~c@é;yyyFSe4]vrΰ7oBlG^vζm"## r-9qwB޽{rz$;Y;|7Rcxuc. cZ!VX1o޼={L&I=:ydN7z痖O>du:]LL̜9s IIIuYL ޽ԩS.R B9mu:ݘ1c^z饢~h4L&Z#`#ȭu05~Udff~eeeZ׷p/* iKb);D]Tqd2UUULիW[1:ȩNL !}Gmڴ)((>|b֭%%%m۶.\hƍZ]СCϜ9S#Cyyy+ ׮]\@{-e#YM<<۶m,066h4 'lLee"77wԨQz>**r̓#ؼyshh߬Y***UdɒgyƼՈ#nZz]I=74Н|uFwVL&Snn7?=<\rLn (&`4,&z+ A@b+D O BAZjR1( " I !\utn$3;k5ٳ{Κw֚9s… =۳p8rrrϟ/+..B|W6My\\\ۭ[7=嗔s8'N8}tuu%K|*3{츸Ç޽{֭7N79ԩSy睆!ٳg?쳉'zUPPPVVf~ပyg=wڵyfe6+XUwuǏ߿m6%&L縀+j׾* ؝L5JǞhX;&8>p@jjx޽{Vl~ҥ=\ϝ;v***}W^yNgLLLyy|㿊u87|v 'N qhX<U}w/XI R~jjiРAs656L^zgϞ=eNgڴi[l{lUqCTc8w̙Wۺuw޹u|0&lBt'z hPV!DuuuGaa+R[['x^3yyy;w/m۶'O^W^^p8GmmmUU6Bwa0{;wߍ?nsٳ, VfOQNRv&O{jժٳgggg1"/1b ~׺QFyGQQQlllvvvbb⭷z!^~>}x㍋/no C6mڡCNudddl5kքvfUfiU5>>~ȑ ˇ hѢW ??ǎ_O5qcEdѝt@NBS-1Ir[B{O:խVKI岡&w-D @h1]BP{饗ON8%!Q: u@f% =<`322 ի%ǧ|{rPA9$)堞:"GisPA9h{3ASlTqa1r@$"NBS-fPKJJw4--Ͳ< st' L&F-`#++&Bۻ?t+"n[rT cHANQ`@ƎhZVSWlwRTTЧO+V,{OB´Ԃ(Ct:Ngffr3g̜9s…{y[G3fL8Xylj'N>]]]dɒ]$>Н$$g6@5t ,8qwәrUWs /^k\211b WTTرcE02 At' ֳg_ HII̵LKK˲eӭV7mfgg'&&z뭇pQ7VDII;M0$mz%" 4nFUA|kdF"$!a@]]a,ާu@ @h1D4Fx:@w"*:2 At' G"k`"i@wy<t$!D9@U|u>#1d N"D 0D:  4 0y9IB4 4---yrtߝtja 9H0ױ7eL&jXF7tYYY555:jMLL۾W$lo|fTCDƊYw2Ncƌ3gu:555Æ {9<_;8"r`nڵX,#G,--U6>?='?y1vFeԩSBsM<9999--GinnX#Gxoq/))Z㪪[֜u)=;+V^m233wf31`Beff&$$'$I><#"ѝp8rrrϟl߶mB &? ?gff !fϞWYYyݻw?+ܼe˖SٳgUWWgo.n9sf̙ . QTCCæMny[>:Lθ;>UQ]]]3g?v޽<;bܸq}QMM̈́ :s89Iōs\---={t\+WW;vosO!DϞ=_ 0 %%Ek_ӧONN΍7޸xjժٳgggg1³}Æ gϞl7|Ibc۽gBzӦM!Ҳlٲtպ~K~%oֲP"g6@5&FU]nH:xѣ\UGZ۷o?Ç"Z/dgg[,=tЗ_~*)):thCCC*ìrB4|k0@jy#1qW]uUDꣲ:tHQ^^SOM8kmR,$._@JC""Gtqc֬Y$rܹj^}\sO<5j7yrڼ;k&hoj S_*W &WZbE hyXD+HkԨQ%%%Nnu Bv-$Z)M^aJZ*W |V3fLW'l|fTB: B}:JBCxMOѣG=g;x/za&N:G~pgO4?^x-quwz gw:iiiyV^0 "rD7V>I)jJ\+L[g{RޫG͘1] hy<t})jJ\+L[g{+6R>G)zD#!Wg;[MItn0b*%BR>G){:Z A.~ @Z&S~ӱcǮ暀"_vB'  y:IЪ+!D9HJ^ :Vh$AIh/J|yu`9WVh P %? ^0 V] ! Aabr 0bDIB4 ōyFse19 IDATF)"$!^0 ] <7>GANQ`@D.n|ՙ u 3 0rLA% 1Fg0 $!ÞxTqU%D#vMs4pUM#k3H+J ؗg8 ō  0I9nBh3NwDD t^GdGANQ`@TWgU4nPڤ΍_vИ.@IՂ&NsD @UDZЅh<t$!D9@U&Ii"? "1sxÀZJi> "1shY+Uɓ@@D4Fx:@_qY+U32M@D4Fx:@w"k*yrHAK5"k*yF HANQ`@dT%ONIy9}IBa@dT%4aIy9IB4 I  "r#O</I8 & "r#O<;IFP<9 D~$AD@c% P<#z 乪:k`L&o*edw Ɛc/I8 "1shY+Фv=O>#JU&yrHR;ydZ=z|7eeeqqq\rI2gΜIII XYYYngkNn;99¿>sY|67y>!"?tPY__C͝;WqCFXV̙3'ɓ^z>Ev%& "rHm]wd2|BoFϟtReϿo#FP\y楦^q/rVV^5k矟n#Ѻ!CO[n.WUSSbJJsWb„ >;vMNN<%-->馛빌WgK>ՈyQqOWBH:p@߾}7;v,===99o4hZ]]퉀=Ad]]ݮ]ZRRܫW$<-TݻW^&i޼yN?BTUUM6OuuuW>{|СC'` Bo}Ν_~{׿r}wS{IIbQrօCBn߾}̘1UUU>ɄY-FCM|67y>!"߯ `{[nuuuMMM?fSFpʝ;w>}t8;3}RO '!BرCqWܹp̜9t4(X}~Bs]p!;;d2) !O?ŋկF5t;v(?Wo***¬W# B& "rKggrKFFLO<}wvm7|!Crrrf7|rq !#1FP<#}&Ϸ1(VPᚄh9@U\PDN"5"!a@T%%am 4+V*((>|x^^^*֯_4wܦ&2ϟ>}zjjjrri I><C?`544lڴ馛n \>o޼zȑ#cƌ۷oFFƔ)Sy睳g϶yt˵k׮G?~|˗//SQPPPVVf~asKJJJKK_}e !͛p8N8q%K,!''o i_%O=:I.zɓ'cbb<;vLӻwǏ+fgvϟ?߽{M6yC]q&iԨQǏ\ϱ˕?o>p@2NgLLg7;wreUTT(+ҧÇVk.hGEp.NC^ ǏիW'4i+]`rEp86m=711޼ys߾}sss#ׯڵkKJJΜ9: =66K/U̙3eVWWL&n _fUUUSSӠARRRRRRƌS[[յ@Gv #Jm%"m'+D9)))]vѣGս{x?B777 !=7>0aŒ3o \!DsssEEԩS{/fnnm/3---..\Q[[[UUGꪫ<`|67?ݻ~(//?p<ȡgƍ۹svggg !kZmr^|Ee!66611g9ypYn\dZxŋv%K~2-ˤI,XPWWܬć_bG񊊊;v|~WPb"i;q} ?~}ݯE]zfܽ{g7n8vFejSN)y4% !ƏoZsrr֭[3U ~!DKKKbbO>)8uTjj2*v~Y,#G;Om=Xܹs'ONNNNKK{Gg B;Sߔס3pHD=+((x7<zniii_M111V={vvv#=[ZZ-[nZׯ_i&|܄,ꫯ|">>~ȑ ˇ h"2֭Ȱlk֬ }:e !bccoC?qSNtHg7xcĉ&Mڲe !\.n?s̙3.\(:u; 8{g}6q?3nfff'ٳҪ?3w.E^^^qq⫯lnݺ !p8rrr<9mgj_ٳ*++>{g}{3 5,((HNN޵k͛m *à?ݹsgW]EEE .쪣srTY|ЫWƔ?ӟ?v8p 55U9//7t/ĉ~? Diwp:ݺuL?͢f+--}.]XXXsw޽{SOi>|999pb~_~_vzCgy`:EY p"`H7o{bccNȫlNLLBr)Me!Ė-[}w֭%\쐑[n/nܸqIIIGpB5|LWпɂg81?C D4I\d}m۶~{.{;wߍ?^D(f9sF'//oΝ_~DݶmN)))G믿G*jjmL8l6+[\.W8+Dž`XE)IVO2ͣF***>|x||rr\2āU6kSb뮻kjjz)Sxp0'Pʿ;=/[g𯃄hkˬ4--My|Tϟ!BḾmk6sK.D#Kf͚q%iӦ:tȓҳg_ HII̵6l8{f'Mõ^v}x㍋/? O~znrssg¤z&In17 KdС .kҤI N=2ޜNgjjѣGԯL Yn>{O:Lr ۷o?ÇT~YR1rU.kĉn!TUUGuDۘ^zi< ?S'Nl#gTC9rM0r;ʲk[ܨ,x~̤s655ybE 7QZZzUW)ۧLp)NK|6&/X ⅟;wZW_}5\OD gt&v'L E--xk׮G?~|Q[ōk|dee߿_o\ʤÅ^ $R#:"mL^۫W5jTIIEEELגVQ o>:cǺu떐__׶ga۷8Ч|ފ999!b)Q3:A7t!5/y@h\\O8W^<Ğ-nlQYآ_~)~=\#I֔L-[/@:LPDNR ;vMw)E/= [:uጀ淨Ksk+@yϬ{.$4a„^z鮻/ml ɴxbe%KϤP7\)6%Ump\էݪ geeԨp`U @L>g7n7|pmG9`/|Ȑ!- p+nƇR&mjs|)¢N:8~b7/ҁ~>??mT?/l~}+Vl]vݻ}.\0gΜ^z̞=Aپvڌ=zc-k֬LHHя~tqgϞ7nb0`@QQ`GQ\~BbXnn{z_uXt>o߰aCz_~ʔ)njwseee)))G.oͽnݺćzr;^GNnw)IDAT@TjٯgVVVΚ5kϟ3g3{뭷92f-B}9+f4Q<<5 !??۶mOv{qq #//XW_l6qqqqnnnK 8~őHW$SG]w]MMMڹsW\aXzYXXxPʣe&ZߚL .({2ɩ>|7mTWW{d`G=$༨!k}]۽nݺLJӛf+--}.]XXXsy1r7l x=Kyq§-1r+RYG5[Āɬ@~Sa6 ce ^|))))))cƌQ~oo޼o߾{"ظqF}d`G ]Aq}mݺUu/Ğrsso믿/,..k4l x=љIc9M_%OwН!"CaLƍ裏jjj&L0c -W^Of4Q<π:!&O{|x^^޶mNb<8zhuVim4B$yrYBA}VXᝰQRRbZ={_>333))iܹMMM.8SSSMK/eddL>'!$`iii>_m-X &&fĉu""I*"Vl6Yf%E f911QѣGe"6ZA9Hgfejn_|fsݞ=C XfK h9MgNkEumj~OSku&oz<$5P Vi;ꀀ"Ih_t]˹s&O#477+Wlw\___XXZPP]ڵkgXFYZZ~ӧ&''O6-j_>333))iܹMMMBc666ZVzԩ̄>}X»>>{*+Ii+d@D@E={v\\\eeÇwϊ̛7p8qK,.*;;{߾}#''{Ϳ2x/}bXBl")O*|䑣M$R mq:111ʟ|ANNαcDŽϟwHMMU[__WQQ_\yݻwo޽"%+}cǎfewiӦ:jx^។&o9$5y4I\jYtijjj4h6ޥmܸq!S9D-Jns]e9??UW]{Om6"`%K"R2BlײOJj "r ,]wݵhѢ/Z[[+رc.gϞ.kʕϚ4i҂ ꚛpK%IMY$%ImḴ"I#G'م ,/r}}}>}rrrnŋع(666;;;11[o=t_/1b udddl5kduIĿ.}rĉ+HJ.I>08GI"w9-CۡMt c" k&1x]Ḵ"IhG'مZě jm6I`42``P NR 1F0.52`&1]D'0Fm+))޽K/޿ݻw\2===##O}}}aaaZZZjjjAAAcc(333!!O>+VeڵX,#G,--UXUU5~x՚n:(Ȁ&n\.ٳg+++g͚5yWVVΙ3g…s8'N8}tuu%Kv}޼yoV}}#GƌEo>Ñ3|ٳgUWWgoFhm Ḵ"IL&MP m+))ήMJJ:tСCNgBB¡Cvŋ.!?رcuuu֭0a2۾}Ə̙ .$%%>}Z)>~V]](_`>r}#/; ~椤$!D|||BBBBBXjjj4hPJJJJJʘ1cjkko͛훛g-B70 ))i.\BTWWwM!-\I+"DocQjv!"rrp8jkk7>0aŒ38W^yO>Ql6[kk3gBGAH$F,K~~> ZWTTرCQYY744&&&oq\---={t\+Wxw,Zŋvg qmǥ]]Ȑ)IKN7?h!cPُdj333))iܹMMMB̄>}XBqӧ&''O6M3;套^9rOiii%L>D~ߦ͙3端bqCqݒ N%O'AD}fddL2w9{l\]v=z_|n7o[oU__ȑ1c! v?ynIIIii髯L!ļylj'N>]]]dɒ%x۳g;sM-t,n>5O" 7Mt'O>CW\qd5jǏ;f6;vbx !˕?o>pw}ӦMuuuvΝS{_f}}}\\\EE/+Kw!:@4Wt.: 1r_oڵ%%%gΜ|C{饗zx̙ķ~{}ݳgOuuda6&YUU4hР1cֆ(Aq{7ѣq]D=)d$d@DoonnnmmBTWW{\QQ<>uT޽ƍ裏jjj&L0c v=ɿ̴rp8jkkBvxna:El44Ḵ$:ȁSSS3(:5kp }Z۶ms\/&i/^K,+++V2iҤ 577ٳ't˴X,>24^QQcǎЅ$;r`9 6rzq`9p]:''66rzyGl`#!XF@/9l`#k^FI6rH@"; %_6ޑ@W+ I@"$EI9$)rHR!iffy19$o^6rHR I@"$EI9$)rHR I@"$EI9$)rHR5t$IENDB`icedtea-web-1.6.2/PaxHeaders.17941/netx0000644000000000000000000000013212654402377014346 xustar0030 mtime=1454507263.270432141 30 atime=1454507658.779157357 30 ctime=1454507658.740157877 icedtea-web-1.6.2/netx/0000755000175000002070000000000012654402377015146 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/netx/PaxHeaders.17941/sun0000644000000000000000000000013212654402377015153 xustar0030 mtime=1454507263.270432141 30 atime=1454507658.779157357 30 ctime=1454507658.740157877 icedtea-web-1.6.2/netx/sun/0000755000175000002070000000000012654402377015753 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/netx/sun/PaxHeaders.17941/applet0000644000000000000000000000013212654402377016440 xustar0030 mtime=1454507263.270432141 30 atime=1454507658.779157357 30 ctime=1454507658.740157877 icedtea-web-1.6.2/netx/sun/applet/0000755000175000002070000000000012654402377017240 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/netx/sun/applet/PaxHeaders.17941/package-info.java0000644000000000000000000000013112654402377021703 xustar0030 mtime=1454507263.270432141 29 atime=1454507327.16857995 30 ctime=1454507658.740157877 icedtea-web-1.6.2/netx/sun/applet/package-info.java0000644000175000002070000000336012654402377022431 0ustar00jvanekmock00000000000000/* package-info.java Copyright (C) 2014 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.*/ /** * This package serve as access to package private classes in JDK. *

Do not use it for anything else

*/ package sun.applet; icedtea-web-1.6.2/netx/sun/applet/PaxHeaders.17941/AppletViewerPanelAccess.java0000644000000000000000000000013112654402377024070 xustar0030 mtime=1454507263.270432141 29 atime=1454507327.16857995 30 ctime=1454507658.740157877 icedtea-web-1.6.2/netx/sun/applet/AppletViewerPanelAccess.java0000644000175000002070000001444712654402377024626 0ustar00jvanekmock00000000000000/* package-info.java Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.*/ package sun.applet; import java.applet.Applet; import java.applet.AppletContext; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.net.URL; import java.util.Hashtable; import java.util.Map; import net.sourceforge.jnlp.NetxPanel; import net.sourceforge.jnlp.util.logging.OutputController; public abstract class AppletViewerPanelAccess extends AppletViewerPanel { public AppletViewerPanelAccess(URL documentURL, Map atts) { // note, this is copy. // But th eonly usecasein applet outside ITW is get on parameters super(documentURL, new Hashtable<>(atts)); } protected URL getDocumentURL() { try { Field field = AppletViewerPanel.class.getDeclaredField("documentURL"); field.setAccessible(true); return (URL) field.get(this); } catch (IllegalAccessException | IllegalArgumentException | NoSuchFieldException | SecurityException ex) { throw new RuntimeException(ex); } } protected void setApplet(Applet iapplet) { try { Field field = AppletPanel.class.getDeclaredField("applet"); field.setAccessible(true); field.set(this, iapplet); } catch (IllegalAccessException | IllegalArgumentException | NoSuchFieldException | SecurityException ex) { throw new RuntimeException(ex); } } @Override public void run() { // this is copypasted chunk from AppletPanel.run (the only current // call of runLoader). Pray it do not change Thread curThread = Thread.currentThread(); if (curThread == loaderThread) { ourRunLoader(); return; } super.run(); } @Override public AppletContext getAppletContext() { if (getParent() instanceof AppletContext) { return super.getAppletContext(); } return ((NetxPanel)this).getAppInst().getAppletEnvironment(); } /** * NOTE. We cannot override private method, and this call is unused and useless. * But kept for record of troubles to run on any openjdk. * upstream patch posted http://mail.openjdk.java.net/pipermail/awt-dev/2014-May/007828.html */ private void superRunLoader() { try { Class klazz = AppletPanel.class; Method runLoaderMethod = klazz.getDeclaredMethod("runLoader"); runLoaderMethod.setAccessible(true); runLoaderMethod.invoke(getApplet()); } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException ex) { throw new RuntimeException(ex); } } protected URL getBaseURL() { try { Field field = AppletViewerPanel.class .getDeclaredField("baseURL"); field.setAccessible( true); return (URL) field.get( this); } catch (IllegalAccessException | IllegalArgumentException | NoSuchFieldException | SecurityException ex) { throw new RuntimeException(ex); } } @Override //remaining stub of unpatched jdk protected synchronized void createAppletThread() { throw new RuntimeException("Not yet implemented"); //no need to call super, is overriden, and not used in upstream //AppletViewerPanel or AppletPanel } abstract protected void ourRunLoader(); /** * jdk9 removed doInit. * http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/2b680924a73f This is way how * to set it in older jdks and still compile on jdk9+ * * @param a value to set to doInit if it exists */ protected void setDoInitIfExists(boolean a) { //doInit = a; try { Class c = this.getClass(); Field fs = null; while (c != null) { if (AppletPanel.class.equals(c)) { fs = c.getDeclaredField("doInit"); break; } //known location is NetxPanel->AppeltViwerPannelAccess->AppletViwerPanel->AppletPanel c = c.getSuperclass(); } if (fs == null) { throw new NoSuchFieldException("AppletPanel not found."); } fs.setAccessible(true); fs.set(this, a); } catch (IllegalAccessException | IllegalArgumentException | NoSuchFieldException | SecurityException ex) { OutputController.getLogger().log("Can't get/set doInit. Runing on JDK9 or higher?"); OutputController.getLogger().log(ex); } } } icedtea-web-1.6.2/netx/PaxHeaders.17941/net0000644000000000000000000000013212654402377015134 xustar0030 mtime=1454507263.207432981 30 atime=1454507658.779157357 30 ctime=1454507658.740157877 icedtea-web-1.6.2/netx/net/0000755000175000002070000000000012654402377015734 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/netx/net/PaxHeaders.17941/sourceforge0000644000000000000000000000013212654402377017457 xustar0030 mtime=1454507263.270432141 30 atime=1454507658.779157357 30 ctime=1454507658.740157877 icedtea-web-1.6.2/netx/net/sourceforge/0000755000175000002070000000000012654402377020257 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/netx/net/sourceforge/PaxHeaders.17941/nanoxml0000644000000000000000000000013212654402377021133 xustar0030 mtime=1454507263.270432141 30 atime=1454507658.779157357 30 ctime=1454507658.740157877 icedtea-web-1.6.2/netx/net/sourceforge/nanoxml/0000755000175000002070000000000012654402377021733 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/netx/net/sourceforge/nanoxml/PaxHeaders.17941/XMLParseException.java0000644000000000000000000000013112654402377025364 xustar0030 mtime=1454507263.270432141 29 atime=1454507327.16857995 30 ctime=1454507658.740157877 icedtea-web-1.6.2/netx/net/sourceforge/nanoxml/XMLParseException.java0000644000175000002070000000766012654402377026121 0ustar00jvanekmock00000000000000/* XMLParseException.java * * $Revision: 1.1 $ * $Date: 2002/08/03 04:05:32 $ * $Name: $ * * This file is part of NanoXML 2 Lite. * Copyright (C) 2000-2002 Marc De Scheemaecker, All Rights Reserved. * * This software is provided 'as-is', without any express or implied warranty. * In no event will the authors be held liable for any damages arising from the * use of this software. * * Permission is granted to anyone to use this software for any purpose, * including commercial applications, and to alter it and redistribute it * freely, subject to the following restrictions: * * 1. The origin of this software must not be misrepresented; you must not * claim that you wrote the original software. If you use this software in * a product, an acknowledgment in the product documentation would be * appreciated but is not required. * * 2. Altered source versions must be plainly marked as such, and must not be * misrepresented as being the original software. * * 3. This notice may not be removed or altered from any source distribution. *****************************************************************************/ package net.sourceforge.nanoxml; /** * An XMLParseException is thrown when an error occures while parsing an XML * string. *

* $Revision: 1.1 $

*

* $Date: 2002/08/03 04:05:32 $

* * @see net.sourceforge.nanoxml.XMLElement * * @author Marc De Scheemaecker * @version $Name: $, $Revision: 1.1 $ */ public class XMLParseException extends RuntimeException { /** * Indicates that no line number has been associated with this exception. */ public static final int NO_LINE = -1; /** * The line number in the source code where the error occurred, or * NO_LINE if the line number is unknown. * *
Invariants:
*
  • {@code lineNr > 0 || lineNr == NO_LINE} *
*/ private final int lineNr; /** * Creates an exception. * * @param name The name of the element where the error is located. * @param message A message describing what went wrong. * *
Preconditions:
*
  • {@code message != null}
  • *
* *
Postconditions:
*
  • {@code getLineNr() => NO_LINE}
  • *
*/ public XMLParseException(String name, String message) { super("XML Parse Exception during parsing of " + ((name == null) ? "the XML definition" : ("a " + name + " element")) + ": " + message); this.lineNr = XMLParseException.NO_LINE; } /** * Creates an exception. * * @param name The name of the element where the error is located. * @param lineNr The number of the line in the input. * @param message A message describing what went wrong. * *
Preconditions:
*
  • {@code message != null}
  • *
  • {@code lineNr > 0}
  • *
* *
Postconditions:
*
  • {@code getLineNr() => lineNr}
  • *
*/ public XMLParseException(String name, int lineNr, String message) { super("XML Parse Exception during parsing of " + ((name == null) ? "the XML definition" : ("a " + name + " element")) + " at line " + lineNr + ": " + message); this.lineNr = lineNr; } /** * Where the error occurred, or {@code NO_LINE} if the line number is * unknown. * * @return line in source where exception occurred * @see net.sourceforge.nanoxml.XMLParseException#NO_LINE */ public int getLineNr() { return this.lineNr; } } icedtea-web-1.6.2/netx/net/sourceforge/nanoxml/PaxHeaders.17941/XMLElement.java0000644000000000000000000000013112654402377024024 xustar0030 mtime=1454507263.270432141 29 atime=1454507327.16857995 30 ctime=1454507658.740157877 icedtea-web-1.6.2/netx/net/sourceforge/nanoxml/XMLElement.java0000644000175000002070000012651512654402377024562 0ustar00jvanekmock00000000000000/* XMLElement.java * * $Revision: 1.2 $ * $Date: 2002/08/03 04:36:34 $ * $Name: $ * * This file is part of NanoXML 2 Lite. * Copyright (C) 2000-2002 Marc De Scheemaecker, All Rights Reserved. * * This software is provided 'as-is', without any express or implied warranty. * In no event will the authors be held liable for any damages arising from the * use of this software. * * Permission is granted to anyone to use this software for any purpose, * including commercial applications, and to alter it and redistribute it * freely, subject to the following restrictions: * * 1. The origin of this software must not be misrepresented; you must not * claim that you wrote the original software. If you use this software in * a product, an acknowledgment in the product documentation would be * appreciated but is not required. * * 2. Altered source versions must be plainly marked as such, and must not be * misrepresented as being the original software. * * 3. This notice may not be removed or altered from any source distribution. *****************************************************************************/ /* JAM: hacked the source to remove unneeded methods and comments. */ package net.sourceforge.nanoxml; import java.io.IOException; import java.io.OutputStream; import java.io.PrintStream; import java.io.Reader; import java.util.Enumeration; import java.util.HashMap; import java.util.Map; import java.util.Set; import java.util.Vector; import net.sourceforge.jnlp.util.logging.OutputController; /** * XMLElement is a representation of an XML object. The object is able to parse * XML code. *
*
Parsing XML Data
*
* You can parse XML data using the following code: *
{@code
 *XMLElement xml = new XMLElement();
 *FileReader reader = new FileReader("filename.xml");
 *xml.parseFromReader(reader);
 *}
*
Retrieving Attributes
*
* You can enumerate the attributes of an element using the method * {@link #enumerateAttributeNames() enumerateAttributeNames}. * The attribute values can be retrieved using the method * {@link #getAttribute(java.lang.String) getAttribute}. * The following example shows how to list the attributes of an element: *
{@code
 *XMLElement element = ...;
 *Enumeration enum = element.enumerateAttributeNames();
 *while (enum.hasMoreElements()) {
 *    String key = (String) enum.nextElement();
 *    String value = (String) element.getAttribute(key);
 *    System.out.println(key + " = " + value);
 *}}
*
Retrieving Child Elements
*
* You can enumerate the children of an element using * {@link #enumerateChildren() enumerateChildren}. * The number of child elements can be retrieved using * {@link #countChildren() countChildren}. *
*
Elements Containing Character Data
*
* If an elements contains character data, like in the following example: *
{@code The Title}
* you can retrieve that data using the method * {@link #getContent() getContent}. *
*
Subclassing XMLElement
*
* When subclassing XMLElement, you need to override the method * {@link #createAnotherElement() createAnotherElement} * which has to return a new copy of the receiver. *
* * @see net.sourceforge.nanoxml.XMLParseException * * @author Marc De Scheemaecker * <cyberelf@mac.com> * @version $Name: $, $Revision: 1.2 $ */ public class XMLElement { /** * The attributes given to the element. * *
Invariants:
*
  • The field can be empty.
  • *
  • The field is never {@code null}.
  • *
  • The keys and the values are strings.
  • *
*/ private Map attributes; /** * Child elements of the element. * *
Invariants:
*
  • The field can be empty.
  • *
  • The field is never {@code null}.
  • *
  • The elements are instances of {@code XMLElement} * or a subclass of {@code XMLElement}.
  • *
*/ private Vector children; /** * The name of the element. * *
Invariants:
*
  • The field is {@code null} iff the element is not * initialized by either parse or {@link #setName setName()}.
  • *
  • If the field is not {@code null}, it's not empty.
  • *
  • If the field is not {@code null}, it contains a valid * XML identifier.
  • *
*/ private String name; /** * The {@code #PCDATA} content of the object. * *
Invariants:
*
  • The field is {@code null} iff the element is not a * {@code #PCDATA} element.
  • *
  • The field can be any string, including the empty string.
  • *
*/ private String contents; /** * Conversion table for &...; entities. The keys are the entity names * without the & and ; delimiters. * *
Invariants:
*
  • The field is never {@code null}.
  • *
  • The field always contains the following associations: * "lt" => "<", "gt" => ">", * "quot" => "\"", "apos" => "'", * "amp" => "&"
  • *
  • The keys are strings
  • *
  • The values are char arrays
  • *
*/ private Map entities; /** * The line number where the element starts. * *
Invariants:
*
  • {@code lineNr >= 0}
  • *
*/ private int lineNr; /** * {@code true} if the case of the element and attribute names are case * insensitive. */ private boolean ignoreCase; /** * {@code true} if the leading and trailing whitespace of {@code #PCDATA} * sections have to be ignored. */ private boolean ignoreWhitespace; /** * Character read too much. *

* This character provides push-back functionality to the input reader * without having to use a PushbackReader. * If there is no such character, this field is {@code '\0'}. */ private char charReadTooMuch; /** * Character read too much for the comment remover. */ private char sanitizeCharReadTooMuch; /** * Whether the BOM header appeared */ private boolean BOM = false; /** * The reader provided by the caller of the parse method. * *

Invariants:
*
  • The field is not {@code null} while the parse method is * running.
  • *
*/ private Reader reader; /** * The current line number in the source content. * *
Invariants:
*
  • parserLineNr > 0 while the parse method is running.
  • *
*/ private int parserLineNr; /** * Creates and initializes a new XML element. *

* Calling the construction is equivalent to: *

  • {@code new XMLElement(new HashMap(), false, true)}
* *
Postconditions:
*
  • {@linkplain #countChildren} => 0
  • *
  • {@linkplain #enumerateChildren} => empty enumeration
  • *
  • enumeratePropertyNames() => empty enumeration
  • *
  • getChildren() => empty vector
  • *
  • {@linkplain #getContent} => ""
  • *
  • {@linkplain #getLineNr} => 0
  • *
  • {@linkplain #getName} => null
  • *
*/ public XMLElement() { this(new HashMap(), false, true, true); } /** * Creates and initializes a new XML element. *

* This constructor should only be called from * {@link #createAnotherElement} to create child elements. * * @param entities * The entity conversion table. * @param skipLeadingWhitespace * {@code true} if leading and trailing whitespace in PCDATA * content has to be removed. * @param fillBasicConversionTable * {@code true} if the basic entities need to be added to * the entity list (client code calling this constructor). * @param ignoreCase * {@code true} if the case of element and attribute names have * to be ignored. * *

Preconditions:
*
  • {@code entities != null}
  • *
  • if {@code fillBasicConversionTable == false} * then {@code entities} contains at least the following * entries: {@code amp}, {@code lt}, {@code gt}, {@code apos} and * {@code quot}
  • *
* *
Postconditions:
*
  • {@linkplain #countChildren} => 0
  • *
  • {@linkplain #enumerateChildren} => empty enumeration
  • *
  • enumeratePropertyNames() => empty enumeration
  • *
  • getChildren() => empty vector
  • *
  • {@linkplain #getContent} => ""
  • *
  • {@linkplain #getLineNr} => 0
  • *
  • {@linkplain #getName} => null
  • *
*/ protected XMLElement(Map entities, boolean skipLeadingWhitespace, boolean fillBasicConversionTable, boolean ignoreCase) { this.ignoreWhitespace = skipLeadingWhitespace; this.ignoreCase = ignoreCase; this.name = null; this.contents = ""; this.attributes = new HashMap<>(); this.children = new Vector<>(); this.entities = entities; this.lineNr = 0; Set e = this.entities.keySet(); for(String key: e) { Object value = this.entities.get(key); if (value instanceof String) { entities.put(key, ((String) value).toCharArray()); } } if (fillBasicConversionTable) { this.entities.put("amp", new char[] { '&' }); this.entities.put("quot", new char[] { '"' }); this.entities.put("apos", new char[] { '\'' }); this.entities.put("lt", new char[] { '<' }); this.entities.put("gt", new char[] { '>' }); } } /** * Adds a child element. * * @param child * The child element to add. * *
Preconditions:
*
  • {@code child != null}
  • *
  • {@code child.getName() != null}
  • *
  • {@code child} does not have a parent element
  • *
* *
Postconditions:
*
  • {@linkplain #countChildren} => old.countChildren() + 1
  • *
  • {@linkplain #enumerateChildren} => old.enumerateChildren() + child
  • *
  • getChildren() => old.enumerateChildren() + child
  • *
* */ public void addChild(XMLElement child) { this.children.addElement(child); } /** * Adds or modifies an attribute. * * @param name * The name of the attribute. * @param value * The value of the attribute. * *
Preconditions:
*
  • {@code name != null}
  • *
  • {@code name} is a valid XML identifier
  • *
  • {@code value != null}
  • *
* *
Postconditions:
*
  • {@linkplain #enumerateAttributeNames} * => old.enumerateAttributeNames() + name
  • *
  • {@linkplain #getAttribute(java.lang.String) getAttribute(name)} * => value
  • *
*/ public void setAttribute(String name, Object value) { if (this.ignoreCase) { name = name.toUpperCase(); } this.attributes.put(name, value.toString()); } /** * @return the number of child elements of the element. * *
Postconditions:
*
  • {@code result >= 0}
  • *
*/ public int countChildren() { return this.children.size(); } /** * @return Enumeration of the attribute names. * *
Postconditions:
*
  • {@code result != null}
  • *
*/ public Enumeration enumerateAttributeNames() { return new Vector(this.attributes.keySet()).elements(); } /** * @return Enumeration the child elements. * *
Postconditions:
*
  • {@code result != null}
  • *
*/ public Enumeration enumerateChildren() { return this.children.elements(); } /** * @return the PCDATA content of the object. If there is no such content, * {@code null} is returned. */ public String getContent() { return this.contents; } /** * @return the line nr in the source data on which the element is found. * This method returns {@code 0} there is no associated source data. * *
Postconditions:
*
  • {@code result >= 0}
  • *
*/ public int getLineNr() { return this.lineNr; } /** * @return an attribute of the element. *

* If the attribute doesn't exist, {@code null} is returned. * * @param name The name of the attribute. * *

Preconditions:
*
  • {@code name != null}
  • *
  • {@code name} is a valid XML identifier
  • *
*/ public Object getAttribute(String name) { if (this.ignoreCase) { name = name.toUpperCase(); } Object value = this.attributes.get(name); return value; } /** * Returns the name of the element. * @return this {@code XMLElement} object's name */ public String getName() { return this.name; } /** * Reads one XML element from a {@link java.io.Reader} and parses it. * * @param reader * The reader from which to retrieve the XML data. * *
Preconditions:
*
  • {@code reader != null}
  • *
  • {@code reader} is not closed
  • *
* *
Postconditions:
*
  • the state of the receiver is updated to reflect the XML element * parsed from the reader
  • *
  • the reader points to the first character following the last * {@code '>'} character of the XML element
  • *
* * @throws java.io.IOException * If an error occured while reading the input. * @throws net.sourceforge.nanoxml.XMLParseException * If an error occured while parsing the read data. */ public void parseFromReader(Reader reader) throws IOException, XMLParseException { this.parseFromReader(reader, /*startingLineNr*/1); } /** * Reads one XML element from a java.io.Reader and parses it. * * @param reader * The reader from which to retrieve the XML data. * @param startingLineNr * The line number of the first line in the data. * *
Preconditions:
*
  • {@code reader != null}
  • *
  • {@code reader} is not closed
  • *
* *
Postconditions:
*
  • the state of the receiver is updated to reflect the XML element * parsed from the reader
  • *
  • the reader points to the first character following the last * {@code '>'} character of the XML element
  • *
* * @throws java.io.IOException * If an error occured while reading the input. * @throws net.sourceforge.nanoxml.XMLParseException * If an error occured while parsing the read data. */ public void parseFromReader(Reader reader, int startingLineNr) throws IOException, XMLParseException { this.charReadTooMuch = '\0'; this.reader = reader; this.parserLineNr = startingLineNr; for (;;) { char ch = this.scanLeadingWhitespace(); if (ch != '<') { throw this.expectedInput("<", ch); } ch = this.readChar(); if ((ch == '!') || (ch == '?')) { this.skipSpecialTag(0); } else { this.unreadChar(ch); this.scanElement(this); return; } } } /** * Creates a new similar XML element. *

* You should override this method when subclassing XMLElement. *

* @return next element in tree based on global settings */ protected XMLElement createAnotherElement() { return new XMLElement(this.entities, this.ignoreWhitespace, false, this.ignoreCase); } /** * Changes the content string. * * @param content * The new content string. */ public void setContent(String content) { this.contents = content; } /** * Changes the name of the element. * * @param name * The new name. * *
Preconditions:
*
  • {@code name != null}
  • *
  • {@code name} is a valid XML identifier
  • *
*/ public void setName(String name) { this.name = name; } /** * Scans an identifier from the current reader. * The scanned identifier is appended to result. * * @param result * The buffer in which the scanned identifier will be put. * *
Preconditions:
*
  • {@code result != null}
  • *
  • The next character read from the reader is a valid first * character of an XML identifier.
  • *
* *
Postconditions:
*
  • The next character read from the reader won't be an identifier * character.
  • *
* @throws java.io.IOException if something goes wrong */ protected void scanIdentifier(StringBuffer result) throws IOException { for (;;) { char ch = this.readChar(); if (((ch < 'A') || (ch > 'Z')) && ((ch < 'a') || (ch > 'z')) && ((ch < '0') || (ch > '9')) && (ch != '_') && (ch != '.') && (ch != ':') && (ch != '-') && (ch <= '\u007E')) { this.unreadChar(ch); return; } result.append(ch); } } private boolean isRegularWhiteSpace(char ch) { switch (ch) { case ' ': case '\t': case '\n': case '\r': return true; default: return false; } } /** * This method scans an identifier from the current reader. * * @return the next character following the whitespace. * @throws java.io.IOException if something goes wrong */ private char scanWhitespace() throws IOException { while(true) { char ch = this.readChar(); if (!isRegularWhiteSpace(ch)) { return ch; } } } /** * This method scans an leading identifier from the current reader. * * UNlike scanWhitespace, it skipps also BOM * * @return the next character following the whitespace. * @throws java.io.IOException if something goes wrong */ private char scanLeadingWhitespace() throws IOException { while(true) { char ch = this.readChar(); //this is BOM , not space if (ch == '') { BOM = true; } else if (!isRegularWhiteSpace(ch)) { return ch; } } } /** * This method scans an identifier from the current reader. *

* The scanned whitespace is appended to {@code result}. * * @param result where to append scanned text * @return the next character following the whitespace. * *

Preconditions:
*
  • {@code result != null}
  • *
* @throws java.io.IOException if something goes wrong */ protected char scanWhitespace(StringBuffer result) throws IOException { while (true) { char ch = this.readChar(); if (!isRegularWhiteSpace(ch)) { return ch; } else { switch (ch) { case ' ': case '\t': case '\n': result.append(ch); } } } } /** * This method scans a delimited string from the current reader. *

* The scanned string without delimiters is appended to {@code string}. * *

Preconditions:
*
  • {@code string != null}
  • *
  • the next char read is the string delimiter
  • *
* @param string where to append the result * @throws java.io.IOException if something goes wrong */ protected void scanString(StringBuffer string) throws IOException { char delimiter = this.readChar(); if ((delimiter != '\'') && (delimiter != '"')) { throw this.expectedInput("' or \""); } for (;;) { char ch = this.readChar(); if (ch == delimiter) { return; } else if (ch == '&') { this.resolveEntity(string); } else { string.append(ch); } } } /** * Scans a {@code #PCDATA} element. CDATA sections and entities are * resolved. *

* The next < char is skipped. *

* The scanned data is appended to {@code data}. * *

Preconditions:
*
  • {@code data != null}
  • *
* @param data where to append data * @throws java.io.IOException if something goes wrong */ protected void scanPCData(StringBuffer data) throws IOException { for (;;) { char ch = this.readChar(); if (ch == '<') { ch = this.readChar(); if (ch == '!') { this.checkCDATA(data); } else { this.unreadChar(ch); return; } } else if (ch == '&') { this.resolveEntity(data); } else { data.append(ch); } } } /** * Scans a special tag and if the tag is a CDATA section, append its * content to {@code buf}. * *
Preconditions:
*
  • {@code buf != null}
  • *
  • The first < has already been read.
  • *
* @param buf buffer where to append data * @return whether the CDATA were ok * @throws java.io.IOException if something goes wrong */ protected boolean checkCDATA(StringBuffer buf) throws IOException { char ch = this.readChar(); if (ch != '[') { this.unreadChar(ch); this.skipSpecialTag(0); return false; } else if (!this.checkLiteral("CDATA[")) { this.skipSpecialTag(1); // one [ has already been read return false; } else { int delimiterCharsSkipped = 0; while (delimiterCharsSkipped < 3) { ch = this.readChar(); switch (ch) { case ']': if (delimiterCharsSkipped < 2) { delimiterCharsSkipped += 1; } else { buf.append(']'); buf.append(']'); delimiterCharsSkipped = 0; } break; case '>': if (delimiterCharsSkipped < 2) { for (int i = 0; i < delimiterCharsSkipped; i++) { buf.append(']'); } delimiterCharsSkipped = 0; buf.append('>'); } else { delimiterCharsSkipped = 3; } break; default: for (int i = 0; i < delimiterCharsSkipped; i += 1) { buf.append(']'); } buf.append(ch); delimiterCharsSkipped = 0; } } return true; } } /** * Skips a comment. * *
Preconditions:
*
  • The first <!-- has already been read.
  • *
* @throws java.io.IOException if something goes wrong */ protected void skipComment() throws IOException { int dashesToRead = 2; while (dashesToRead > 0) { char ch = this.readChar(); if (ch == '-') { dashesToRead -= 1; } else { dashesToRead = 2; } // Be more tolerant of extra -- (double dashes) // in comments. if (dashesToRead == 0) { ch = this.readChar(); if (ch == '>') { return; } else { dashesToRead = 2; this.unreadChar(ch); } } } /* if (this.readChar() != '>') { throw this.expectedInput(">"); } */ } /** * Skips a special tag or comment. * * @param bracketLevel The number of open square brackets ([) that have * already been read. * *
Preconditions:
*
  • The first <! has already been read.
  • *
  • {@code bracketLevel >= 0}
  • *
* @throws java.io.IOException if something goes wrong */ protected void skipSpecialTag(int bracketLevel) throws IOException { int tagLevel = 1; // < char stringDelimiter = '\0'; if (bracketLevel == 0) { char ch = this.readChar(); if (ch == '[') { bracketLevel += 1; } else if (ch == '-') { ch = this.readChar(); if (ch == '[') { bracketLevel += 1; } else if (ch == ']') { bracketLevel -= 1; } else if (ch == '-') { this.skipComment(); return; } } } while (tagLevel > 0) { char ch = this.readChar(); if (stringDelimiter == '\0') { if ((ch == '"') || (ch == '\'')) { stringDelimiter = ch; } else if (bracketLevel <= 0) { if (ch == '<') { tagLevel += 1; } else if (ch == '>') { tagLevel -= 1; } } if (ch == '[') { bracketLevel += 1; } else if (ch == ']') { bracketLevel -= 1; } } else { if (ch == stringDelimiter) { stringDelimiter = '\0'; } } } } /** * Scans the data for literal text. *

* Scanning stops when a character does not match or after the complete * text has been checked, whichever comes first. * * @param literal the literal to check. * *

Preconditions:
*
  • {@code literal != null}
  • *
* @return true if literal was ok * @throws java.io.IOException if something goes wrong */ protected boolean checkLiteral(String literal) throws IOException { int length = literal.length(); for (int i = 0; i < length; i += 1) { if (this.readChar() != literal.charAt(i)) { return false; } } return true; } /** * Reads a character from a reader. * @return the read char * @throws java.io.IOException if something goes wrong */ protected char readChar() throws IOException { if (this.charReadTooMuch != '\0') { char ch = this.charReadTooMuch; this.charReadTooMuch = '\0'; return ch; } else { int i = this.reader.read(); if (i < 0) { throw this.unexpectedEndOfData(); } else if (i == 10) { this.parserLineNr += 1; return '\n'; } else { return (char) i; } } } /** * Scans an XML element. * * @param elt The element that will contain the result. * *
Preconditions:
*
  • The first < has already been read.
  • *
  • {@code elt != null}
  • *
* @throws java.io.IOException if something goes wrong */ protected void scanElement(XMLElement elt) throws IOException { StringBuffer buf = new StringBuffer(); this.scanIdentifier(buf); String lname = buf.toString(); elt.setName(lname); char ch = this.scanWhitespace(); while ((ch != '>') && (ch != '/')) { buf.setLength(0); this.unreadChar(ch); this.scanIdentifier(buf); String key = buf.toString(); ch = this.scanWhitespace(); if (ch != '=') { throw this.expectedInput("="); } this.unreadChar(this.scanWhitespace()); buf.setLength(0); this.scanString(buf); elt.setAttribute(key, buf); ch = this.scanWhitespace(); } if (ch == '/') { ch = this.readChar(); if (ch != '>') { throw this.expectedInput(">"); } return; } buf.setLength(0); ch = this.scanWhitespace(buf); if (ch != '<') { this.unreadChar(ch); this.scanPCData(buf); } else { for (;;) { ch = this.readChar(); if (ch == '!') { if (this.checkCDATA(buf)) { this.scanPCData(buf); break; } else { ch = this.scanWhitespace(buf); if (ch != '<') { this.unreadChar(ch); this.scanPCData(buf); break; } } } else { buf.setLength(0); break; } } } if (buf.length() == 0) { while (ch != '/') { if (ch == '!') { ch = this.readChar(); if (ch != '-') { throw this.expectedInput("Comment or Element"); } ch = this.readChar(); if (ch != '-') { throw this.expectedInput("Comment or Element"); } this.skipComment(); } else { this.unreadChar(ch); XMLElement child = this.createAnotherElement(); this.scanElement(child); elt.addChild(child); } ch = this.scanWhitespace(); if (ch != '<') { throw this.expectedInput("<"); } ch = this.readChar(); } this.unreadChar(ch); } else { if (this.ignoreWhitespace) { elt.setContent(buf.toString().trim()); } else { elt.setContent(buf.toString()); } } ch = this.readChar(); if (ch != '/') { throw this.expectedInput("/"); } this.unreadChar(this.scanWhitespace()); if (!this.checkLiteral(lname)) { throw this.expectedInput(lname); } if (this.scanWhitespace() != '>') { throw this.expectedInput(">"); } } /** * Resolves an entity. The name of the entity is read from the reader. *

* The value of the entity is appended to {@code buf}. * * @param buf Where to put the entity value. * *

Preconditions:
*
  • The first & has already been read.
  • *
  • {@code buf != null}
  • *
* @throws java.io.IOException if something goes wrong */ protected void resolveEntity(StringBuffer buf) throws IOException { char ch = '\0'; StringBuffer keyBuf = new StringBuffer(); for (;;) { ch = this.readChar(); if (ch == ';') { break; } keyBuf.append(ch); } String key = keyBuf.toString(); if (key.charAt(0) == '#') { try { if (key.charAt(1) == 'x') { ch = (char) Integer.parseInt(key.substring(2), 16); } else { ch = (char) Integer.parseInt(key.substring(1), 10); } } catch (NumberFormatException e) { throw this.unknownEntity(key); } buf.append(ch); } else { char[] value = entities.get(key); if (value == null) { throw this.unknownEntity(key); } buf.append(value); } } /** * Pushes a character back to the read-back buffer. * * @param ch The character to push back. * *
Preconditions:
*
  • The read-back buffer is empty.
  • *
  • {@code ch != '\0'}
  • *
*/ protected void unreadChar(char ch) { this.charReadTooMuch = ch; } /** * Creates a parse exception for when an invalid valueset is given to * a method. * * @param name The name of the entity. * *
Preconditions:
*
  • {@code name != null}
  • *
* @return exception to be thrown */ protected XMLParseException invalidValueSet(String name) { String msg = "Invalid value set (entity name = \"" + name + "\")"; return new XMLParseException(this.getName(), this.parserLineNr, msg); } /** * Creates a parse exception for when an invalid value is given to a * method. * * @param name The name of the entity. * @param value The value of the entity. * *
Preconditions:
*
  • {@code name != null}
  • *
  • {@code value != null}
  • *
* @return exception to be used */ protected XMLParseException invalidValue(String name, String value) { String msg = "Attribute \"" + name + "\" does not contain a valid " + "value (\"" + value + "\")"; return new XMLParseException(this.getName(), this.parserLineNr, msg); } /** * Creates a parse exception for when the end of the data input has been * reached. * @return exception to be used */ protected XMLParseException unexpectedEndOfData() { String msg = "Unexpected end of data reached"; return new XMLParseException(this.getName(), this.parserLineNr, msg); } /** * Creates a parse exception for when a syntax error occured. * * @param context The context in which the error occured. * *
Preconditions:
*
  • {@code context != null}
  • *
  • {@code context.length() > 0}
  • *
* @return exception to be used */ protected XMLParseException syntaxError(String context) { String msg = "Syntax error while parsing " + context; return new XMLParseException(this.getName(), this.parserLineNr, msg); } /** * Creates a parse exception for when the next character read is not * the character that was expected. * * @param charSet The set of characters (in human readable form) that was * expected. * *
Preconditions:
*
  • {@code charSet != null}
  • *
  • {@code charSet.length() > 0}
  • *
* @return exception to be used */ protected XMLParseException expectedInput(String charSet) { String msg = "Expected: " + charSet; return new XMLParseException(this.getName(), this.parserLineNr, msg); } /** * Creates a parse exception for when the next character read is not * the character that was expected. * * @param charSet The set of characters (in human readable form) that was * expected. * @param ch The character that was received instead. *
Preconditions:
*
  • {@code charSet != null}
  • *
  • {@code charSet.length() > 0}
  • *
* @return exception to be used */ protected XMLParseException expectedInput(String charSet, char ch) { String msg = "Expected: '" + charSet + "'" + " but got: '" + ch + "'"; return new XMLParseException(this.getName(), this.parserLineNr, msg); } /** * Creates a parse exception for when an entity could not be resolved. * * @param name The name of the entity. * @return exception to be used * *
Preconditions:
*
  • {@code name != null}
  • *
  • {@code name.length() > 0}
  • *
*/ protected XMLParseException unknownEntity(String name) { String msg = "Unknown or invalid entity: &" + name + ";"; return new XMLParseException(this.getName(), this.parserLineNr, msg); } /** * Reads an xml file and removes the comments, leaving only relevant * xml code. * * @param isr The reader of the {@link java.io.InputStream} containing the xml. * @param pout The {@link java.io.PipedOutputStream} that will be receiving the * filtered xml file. */ public void sanitizeInput(Reader isr, OutputStream pout) { StringBuilder line = new StringBuilder(); try (PrintStream out = new PrintStream(pout)) { this.sanitizeCharReadTooMuch = '\0'; this.reader = isr; this.parserLineNr = 0; int newline = 2; char prev = ' '; while (true) { char ch; if (this.sanitizeCharReadTooMuch != '\0') { ch = this.sanitizeCharReadTooMuch; this.sanitizeCharReadTooMuch = '\0'; } else { int i = this.reader.read(); if (i == -1) { // no character in buffer, and nothing read out.flush(); break; } else if (i == 10) { ch = '\n'; } else { ch = (char) i; } } char next; int i = this.reader.read(); if (i == -1) { // character in buffer and nothing read. write out // what's in the buffer out.print(ch); out.flush(); if (ch == 10) { OutputController.getLogger().log(line.toString()); line = new StringBuilder("line: " + newline + " "); newline++; } else { line.append(ch); } break; } else if (i == 10) { next = '\n'; } else { next = (char) i; } this.sanitizeCharReadTooMuch = next; // If the next chars are !--, then we've hit a comment tag, // and should skip it. if (ch == '<' && sanitizeCharReadTooMuch == '!') { ch = (char) this.reader.read(); if (ch == '-') { ch = (char) this.reader.read(); if (ch == '-') { this.skipComment(); this.sanitizeCharReadTooMuch = '\0'; } else { out.print('<'); out.print('!'); out.print('-'); this.sanitizeCharReadTooMuch = ch; line.append("<"); line.append("!"); line.append("-"); } } else { out.print('<'); out.print('!'); this.sanitizeCharReadTooMuch = ch; line.append("<"); line.append("!"); } } // Otherwise we haven't hit a comment, and we should write ch. else { out.print(ch); if (ch == 10) { OutputController.getLogger().log(line.toString()); line = new StringBuilder("line: " + newline + " "); newline++; } else { line.append(ch); } } prev = next; } isr.close(); } catch (Exception e) { // Print the stack trace here -- xml.parseFromReader() will // throw the ParseException if something goes wrong. OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); } finally { OutputController.getLogger().log("");//force new line in all cases OutputController.getLogger().log(line.toString()); //flush remaining line } } public boolean isBOM() { return BOM; } } icedtea-web-1.6.2/netx/net/sourceforge/PaxHeaders.17941/jnlp0000644000000000000000000000013212654402377020422 xustar0030 mtime=1454507263.286431928 30 atime=1454507658.779157357 30 ctime=1454507658.740157877 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/0000755000175000002070000000000012654402377021222 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/resources0000644000000000000000000000013212654402377022434 xustar0030 mtime=1454507263.291431861 30 atime=1454507658.779157357 30 ctime=1454507658.740157877 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/resources/0000755000175000002070000000000012654402377023234 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/netx/net/sourceforge/jnlp/resources/PaxHeaders.17941/warning.png0000644000000000000000000000013112654402377024663 xustar0030 mtime=1454507263.291431861 29 atime=1454507327.13858035 30 ctime=1454507658.740157877 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/resources/warning.png0000644000175000002070000000250212654402377025406 0ustar00jvanekmock00000000000000PNG  IHDR77FsRGBbKGD3Y(Z pHYs  tIME  ;.tEXtCommentCreated with GIMPWIDAThZϋE^Ϭ ;K%Cn= "Go _~kx͒A{$@LjGGQrOB +;t{^r$"VտT}ɨ0-d`ܰ_͚O:a*8[_ʚf`HKp-^a>י,5;S GWʑbmOo{Ż ÒwT?? &@4HS+Mf^l!Q}޹D@Qı+.pz'+K}9sνe&'BDq5 iL eFcsƙ^ F:Z|M g,嫶j$%hGp\{lCr{BFRՐx<9mwp7`_Q `(K8{hmQ=kqI& 5K[p+k %Y`JJAHG]0%_6B .4$x'h`ɹ@3WOz-VAFI3Z,LB %ݘ %t#yp7'-~[aR:$-ɲONq6~>| &Q {(k"U51q ZqLdK/ޣ[kS+[,$¤TT-'f{-uj=֙Yffb B],LU7[ DbZE}+UbMC /↌ʎXVQ > r s-a!NbΝP^JZVub#!ԟ'IENDB`icedtea-web-1.6.2/netx/net/sourceforge/jnlp/resources/PaxHeaders.17941/warning-small.png0000644000000000000000000000013112654402377025771 xustar0030 mtime=1454507263.291431861 29 atime=1454507327.13858035 30 ctime=1454507658.740157877 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/resources/warning-small.png0000644000175000002070000000214312654402377026515 0ustar00jvanekmock00000000000000PNG  IHDR;0sRGBbKGD3Y(Z pHYs  tIME "W+tEXtCommentCreated with GIMPWIDATH]h\Es?+ޛnMHhM71MՒ@[F( Ԧш$ۊ*RE(DJLQZARИB " m6{p&˾̜35_#u%@p{A͡_rޱ(5lNO}#54uL܊)>~-1,n=vGb1m'rΊ*Ûc5U٘[M!DƖumB'P_oGN)JЧ ,K˭DZW>YrQHf)(.V0Šk\QP9z<ԭ8z󺁰! AJZ0 ViS@kK5RتuT R)H8Q$˶۪۷+ T7ͳz&i & Ԃ)-g<;?;3's*6 l;/ "jtD^҅KEo6*ǭWz^tm.%8e xDZW1_\ڮVn=*J'N#G˩|ݾ\.ttTˣGZZ_mL&gA:ML$lu])tSzӣuӻ˗64u/[[[>P {W?NO맹9M~ .V{hF iV ]7UO߾y6<=~j,FN۳gݾͬ!;;-}9gz{NKnlF'lXYO><S{0@+dIENDB`icedtea-web-1.6.2/netx/net/sourceforge/jnlp/resources/PaxHeaders.17941/question.png0000644000000000000000000000013112654402377025065 xustar0030 mtime=1454507263.291431861 29 atime=1454507327.13858035 30 ctime=1454507658.740157877 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/resources/question.png0000644000175000002070000000474012654402377025616 0ustar00jvanekmock00000000000000PNG  IHDR77FsRGBbKGD pHYs  tIME:k,tEXtCommentCreated with GIMPW ;IDAThZml=w5&ڔz}hc+HtKY50iDlh*]'݊ĊmlR"n&Qi !CҤ/i-m&nlⷳߝ9'vN{snF5bOS>R]wx>gG:ylr&-+93زy/ocv'k\:HD/?r:7u ,V^ ca8ƻi ;7/}:P/ wՃm:B@aa!k\at?o pPg0KwXF 'oc\T5my-U7Rgje&aB6j]`&hjoEflm .{kM#&_[׀Y24΄ E>͎碗:H"0#e1L,ȋuF5lޅ [SAjrmp\qGMK8+klٰq\x5Y>{7xy_[S\` hY`D9S4))9-S(Nf碗d`H,KMJh6x܇m- X3hYP S(8\ MXʫ !XJ&M떙8h\l)籥G9vK 63ڽ cY#㣴 zZR0.l)~^G~lwp,R,.MVgdu1̄<ɳ-.NJxlS98O5E-41paqk:1WcE,,"u,kmo^G0rxz/ l݁u|s1tB֎Dᙎ jyzG% bw{vOO j٬?tCXΆzeTlo}VJ(!6V]-_{zQ-j=!鐯itf@?pB6*zҫU_WOu 2)I v+ pصJۭ| sc/ObǠU1G3c)pM\v@VUaC/IZ[\nj".cV 75zmfƇ4HkؐbaqfFl 1 o;* -`izqq+c}܇*XXyP?i_79bP?b TTI^ 'N:*ϫ.XX Ϲ3踬e*-Kee% ϩt<rw#a,baQL `ax[xW|Pѩ\U4˳_E1%r+(؃mh!)<إZnآXXM ڜ6FHXrL |5af_XM:ŪFmk f :5U`55VU*-GGcK Ni[`7Q~x=^z}Jlj^aoliTR_ $1=6zG^-aXXL28*d4;]8W*@ײKYDz{W3 טK''>\O`Kxi|k \WcIENDB`icedtea-web-1.6.2/netx/net/sourceforge/jnlp/resources/PaxHeaders.17941/netx-icon.png0000644000000000000000000000013212654402377025123 xustar0030 mtime=1454507263.291431861 30 atime=1454507327.137580363 30 ctime=1454507658.740157877 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/resources/netx-icon.png0000644000175000002070000000105312654402377025645 0ustar00jvanekmock00000000000000PNG  IHDRabKGDC pHYs  d_tIME 1NvIDATxQa%2E&@ "Ii'|YI%.f5L V[ cf?+arnw Lbf$Iq\PS՗fcwRSDwM̆"b@/eC3+Y|h7AAU{VDn$E3I'ՠ8o@D>EbBaE?|?H :t:} áV*AEoឈNEd_D$Fju~~3izԶn!@Tr0DUf|^TՇ]\>jY̊H`d)=3"M^h YY_U <>0LWl/6|U5\9aunnIENDB`icedtea-web-1.6.2/netx/net/sourceforge/jnlp/resources/PaxHeaders.17941/jamIcon.jpg0000644000000000000000000000013212654402377024573 xustar0030 mtime=1454507263.290431874 30 atime=1454507327.137580363 30 ctime=1454507658.740157877 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/resources/jamIcon.jpg0000644000175000002070000002452412654402377025325 0ustar00jvanekmock00000000000000JFIFhhC  !"$"$  }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz?.ʛYҠt)uHK^X- M"'g;V񎻧_÷ze6ցȣĎ0:#Xާ{k:Q5 qbnVI7EQEQE7:(e}ڊYb3$,jnih EyAoJkz̋x6iR0z-)nf]z\][DHOPΣFF ^EQE(x'͔x[;yKsd9ێ5󯋿lim'-Cw\or0:=H 5-|rC#~f+9WL;HE`JMYy#l4QEUye̒:ƪw0xMX~G~jxXMIG#3pdҲncL]C 6gq,!uܒ9ڶ|Y^&<9$) ٻl GԜg5ڿ^Ԯ4}O5D5)fr90/@?ABo~O6f|C0/%~:mMyCqw R $=mvUկen/5_&[$E⛍'S?.8I/6 G,]ϓ$q/ S5o?~h]k:]I62$Mg}+'W)Nb.'5!S VwMyF<;xCJ& g\[:<Xڗs@ u>|2c&L8WY_\Aw}rXE%J-[7ًi[<\j2Kˏ,c>W|Vs²[?M52i1'zc5%ljg \mgd fgn#wcOw_mmih,PFd5P73у'jWg*|y:>k+|Im2^ ERt a.߻DXw᷉!4`<ȡwLe|o)0Ohŭxƞ ӭ@NmMd$~ |ci EM,{Aya7y2A]!:t± Zh.|:>xo)*R|@t?B`k_]WZlZqț^!Csa-fMf+]f c2c5T:P@,-ŝR;;R=ِu5eB\rv׿ K +Sd{Kp~T}ػvx*LjcHY X\q>,AGX@FQ^Oiş3HRk?IUfPd>shHȊ,>ך,oU{S;DWc8_!?똋޽Uӭ5&K Y`{{O!u(W σE. u;+x,צd{~>:G|G3Ɖg>w$v7[dI"G@x9yҭ2OH(ƉGR=6M I#}y0 a,ڍ=wLP#v-{S[+k?$~Ⱦ%&if~Ufj>gȗ}彝HO?w< _BC<%gT|sE{\ȗ2YBo&G^~ |Լ ]E(24E١odߜq~kz-8+g7Z4Uye̒:ƪw0xMXψ a7F,l vCy{cGCg׌X&{c(NI rxznOw' YFb2>ǜI"Hw#9=Ǩ[I $q"8bwf 0ЭW)$hBp<͑ ?dk_E;6rOΞk2 Ӹ ¾"]GY(7hv"+7Jޢ;o-yW0w>>6MK:glCgEmCn"[ҭn|Cijʦ8gQ D1W%<h\xAjofefpvuOu Lzd_,P!5tq0ZUye̒:ƪw0xMXxNjeI[g[4{!YuH4$LCW P]VK-c9A;!]?Fj_ Zx3+[M\s}]gs>\&k׊xj>%HFgE{1O[_,4xM. ?-,Z8e%BYB:un2Rnt;=fZX7-{+o& G–iۼS]ۧ"1K|gi|e,j;F6"qwQ_ߵV㟉`ўA| #G#${yuga ,vCx;p>;:m^EUy%̒:ƪw0xMXGM $(u$ [InTzt{)V߅ԭ~ tWPV||G_~:ǽehqii=Qw,6;ɿ .ҽdž,|# M[}8`wwgtK_xx[D-;6k|5KJdmo.u2Ɲ2yoq-I/yofzwǽy$ Ik$H]!=܎DH[xgxo7w4e#;OHmjiٖ1y>~/xb;OiVfGG|OĺK6w6%ϟf<ܟ_2[[Z^q%嵮L0Hm On?߯H*qGڸV(-k&o5*Ǭ˂?Y5W3[?LJ|cLmmcFB8-fI{f̨+( l>Ԭ?9R9 ZZw'=%mm袊t;Q6ieD '2gd3+P+QE߈/\74)^NK=kCZƥ4ZOcllIiwN uE^lneMf;{(U/N-}sC=ExO}EUye̒:ƪw0xMXj6uY]?)$n6:b2+d>wL. Hal:!W(9>Yyoz\:.qes{c[s̖sz-s~9_ _xk^k:BJFGu`F* }+⯅ھ_~SeF{<ј#?眞lrJ渟>//WŖ$B_S^9_ \xXG%˷o'>Y%C2DvqxgB5XDK-6Um̝494WP> lm] 9I}Y6g,qj㤑Cs_'|zuF;];Dilfty0Yy_L|3f/i#+ojt>y3k($uT ` Ez_FXwLWhdf %D7@9g_^(}WY^mZPim(:k 뺗}gvs\iSk#tڟ'wiuŞ0}k, d GAȏ}ևLE-vn;d# Mq_luk~-|fᅏ[( =7?f':; 3j͓*iqIz'xĺG5-vY @ h}d-/t4M^k_ZlۥT2~`W]QEUye̒:ƪw0xMXڧ?Ai6k4ĈxW#q}|-;1wgu:j~'RS5 6y9_uC4jYgx,bi2#GGL)?F; l/]cpGsWϠ5|C߄Qj~-M!Wv"$_#>?Jצ7{<;߶j3m;S 7># O}ab7 lVŔ %Cl!SQEQU(#2Hh5b)g~o Ŧkݕw.bpiQ|\uG^Ms/_| QxWVD1E Nw|ӏ׿ivz0][\G)H:(,PFd5P73у'jQյ #NQ$h9$6E|K>a #kq !>i*x[V+[ͣJeGc?~̟ |-{tCĒkG,qt;++Xm-M"^? ^]ᕧ,l& x4LIBѧ!~S6hu$x)$i2Gml< pZ~$*k'٭-|zՊߊ-#y`/Lcm弹s^|j໛^~d2dў3ϳ*ͯOGľ'Ѷk lٶD#ڽJKKxmAQEDDU[8oKˉZcƯ~5[x4oèͳe}仌D3zU^Yb3$?SV+]M<2\G8_Fջ;DoH$ɲ]3}y(#d>}8::ɺuO˴CMG+OO~ wLAoϧk:Ui!`I?T~+¾4 ~yYD\c]y9'5|x[Y?Rԕ;qq|W AYb3$?SU|AXj2yvZ}Nh\WοZx⯈Kk[uqMoؘھA]!{RkdյyFv8X"GĚ%v3}oo;bk/9j?+&ʶ[͓tr1Eyƿh|Mϡj)ah6rH)^UQ'-AR^I]2+gf{rc}OEѵ+gcayrW|k<ׇ]?\΃/QyLd/txK/ ,][G+&4hb{׹_zP.l{!GmkM< sSkvuP-i,Q@Of2:'N-A}#>u{e9YY,N;|^y/_~_4=nH4- D srR8Guj4-еm,ZӠ51ų￙ڧY?5l]I[Z%pi`Q2Nu[qWZ 30u1_=VRWul7{9(#2Hh54o R$@̮Ÿ|+9-M_|޻j2b 5^ލmaӅATO 4}3>$~`$5<m}i[/p%iPmfSӵp_77=Goj2'D' ڹ_ >$R7^{Kv-bObC;d#?:vz6_ᾙ <8Mu,73 a¼qF6`Ŏ=Jw}#j^\G_$Y"?Q#)jP;ʣ[Nx_W,PFd5P73у'kO(~cWkv[ȅ?<~F=iօ ^rʑ]_wqKO[UG^|-OZxB?0B?M)o]s?Wxl,6hqהi_Y0ŏ=;)=-7l.zgPd)8 Ísl_…n= igo&݌3ecU{p/@ X TUUf$<4~ny%ĈK]UqGO1:g,n(Nڐ;U| pxYG}gҷҞ\<'!gpzC{x4F=K|G~] Ct'hOGߩeP_?%K6<Shѽac2i+a1X? q%gU{zzn̴gⵚ;s-מ~?m(?[|gy}Q狱M*vy .bѶ@QuDެ?\EY %btU{Sˉm ^U=rX;ƛ;V.toW y1 B'q7|/ +wfЇ3;#jV#Uh޶ѤK_L&ӑM$`^*;_Yj'.Nk4^:ODW'C0)6̎wxK;}X8@{eX8!`4>=bq;;MʊBP( BP( BP( BP( BPI=zQv˲IENDB`icedtea-web-1.6.2/netx/net/sourceforge/jnlp/resources/PaxHeaders.17941/install.png0000644000000000000000000000013212654402377024665 xustar0030 mtime=1454507263.290431874 30 atime=1454507327.137580363 30 ctime=1454507658.740157877 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/resources/install.png0000644000175000002070000000442412654402377025414 0ustar00jvanekmock00000000000000PNG  IHDRw4q{x pHYs  d_IDATxq:מց8uCGś(oF3,E`xx]K1_< ?3>]߼ĩ W!7noy *:4xm/a] '}hYs଄qD~NZ5wZҵLn-#pFQB{蛻x_9ӄ%c鼮Xc\dp{,3mЩEMABYG>nכֿjFcw?562#;ґj=e.(L$ơZgѿUQet GsV陃4q S!gtMeAYp;î}*<1ꌢܝ)Źr0 1- ˧nTҝT UcYAYfF{Dbf\"sbL2:xD`G ?2/mX*9b!XuYTmnLM;'t$/A^RKԮγ ?J]TGvgS*j3RlhG%kF1{Z4?n7B2.a-[\tFYroEWZ.PYK]-H%>MQ2gD(/^뜕Q(,+҄X24cuy`\$D_$Dܥ1q^^F4!wITmGv# }cS0Z>#WMe˯ /3 #n['Z%ɑ#}ہMKl١jpp:h\j wሜk3T#jS Ož6߉2yNLNzؚKR_6(?'{A %3ZRV~-x& ʌ.Qw3#u&NI߬am,uɤ-U>wg|Ft߫֒m} ?ZgARd/ŽD|8GDieKP(^-l@{=q?+#}n'-֝ұ7@ܓB7ښ,&ޛʻF5x|>^A =}w~ -qk?wr=`q֥#sҳ=q~63 7rmxZ{[f"LܰE ;gAGzD 3 g:ӋS ocGMHЊtDSN e۩SBȎlރUG;36/1{iq]^Gm )ÿJ4VL_wK!(^wVNދ:_t\oRq~l/'+~{WhEm[(ŕaf%"C.YsCx=nRaլI>`r8s?'pπ{ȟ{ic@XsQc\Fs4J0$)]UCo_qoOt׃=$>CUtvwO9Z(]aRw7NS G |n7VDEt{963a*J\W qύG;wRsAܥKtˣCU%lvdHWQ4ljGHaW*>_CתC%֒,'7gW޹A&YGnxmw&G_ƈ5aJc'R D\DUBŮ6:5=вv_~cUMu3 #5IAukU8MJjv;a}kh{e>;C$ Ykh]Qw}Bjv.+cDBmQ~"zqƛaؽ97zvtR#;LjߨD;ՕqhT&/Z^%SLrљ.EOdnzAj'3ذ4%>,& @ڭe~]zp>&_XS~08GqL,1M]HB(&,-4Y4tvMB )1zR)]1^Tv\l-'HYכ(U3{sy/4he/Qx%TNH6.mԶn,<{΍"9ILnM Wcwg'듌E1CsO ԫ--WqT{;=NAM(_>=' v7;0'zg҇#eSP5Nb.av2 g8zg(W W E)E!εJlPm.L)lx E!* 8Wl8n}4l\_ƥ1KR"Iെc.y0SL1zZu*qAdT0]ԱV/CHPUs~UxqariP.ǧ$tAGmuT41 tWwU|'Q"$D>$b3N2`o;9E#OM!jRQc9)x`%Q{&r THܒKvUB~!8d/DU8AWVy\}@&\Aq jir,OMT, 27WCOYd&XPto}yLXFIJm4I}C٭rL/l,2c/op>(,'܇gs3'/5-8غDÝ?{op0P탂8ܭcmiG{;s̅ii*Q66#5W3k9) NǍ'y!g$|.IENDB`icedtea-web-1.6.2/netx/net/sourceforge/jnlp/resources/PaxHeaders.17941/hideDownloadDetails.png0000644000000000000000000000013212654402377027126 xustar0030 mtime=1454507263.289431888 30 atime=1454507327.137580363 30 ctime=1454507658.740157877 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/resources/hideDownloadDetails.png0000644000175000002070000000153612654402377027656 0ustar00jvanekmock00000000000000PNG  IHDR bKGDAT pHYs  tIME $gIDAT8˅OHT{?j3ԴmBIW g]SAYDlFZ[DZ1+[%{-TBFZA+/&sgN #f3~ιs?;燈PiiKiNjT5MI$NNA*8eYֽrx<.MR1g}>߫<ivgxxX-`hzOƤW( ay9 b,x kyൈ<+Uvm?ݡWVng<gp1@^;VΨlx8|l |Vvá[)Sq|w6IENDB`icedtea-web-1.6.2/netx/net/sourceforge/jnlp/resources/PaxHeaders.17941/Messages_pl.properties0000644000000000000000000000013212654402377027071 xustar0030 mtime=1454507263.289431888 30 atime=1454507327.136580377 30 ctime=1454507658.740157877 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/resources/Messages_pl.properties0000644000175000002070000015427112654402377027626 0ustar00jvanekmock00000000000000# Polish UI messages for netx # L=Launcher, B=Boot, P=Parser, C=cache S=security # # General NullParameter=Parametr zerowy ButAllow=Pozw\u00f3l ButBrowse=Przegl\u0105daj... ButCancel=\u00a0Anuluj\u00a0 ButClose=Zamknij ButCopy=Kopiuj do schowka ButMoreInformation=Wi\u0119cej\u00a0informacji... ButOk=OK ButProceed=Kontynuuj ButRun=Uruchom ButSandbox=Do piaskownicy ButApply=Zastosuj ButDone=Gotowe ButShowDetails=Poka\u017c szczeg\u00f3\u0142y ButHideDetails=Chowaj szczeg\u00f3\u0142y ButYes=Tak ButNo=Nie CertWarnRunTip=Ufaj temu applet-owi i uruchom CertWarnSandboxTip=Nie ufaj temu applet-owi i uruchom go z ograniczonymi uprawnieniami CertWarnCancelTip=Nie uruchamiaj tego applet-u. CertWarnPolicyTip=Zaawansowane ustawienia piaskownicy CertWarnPolicyEditorItem=Startuj edytor wytycznej AFileOnTheMachine=plik na komputerze AlwaysAllowAction=Zawsze zezwalaj na t\u0105 akcj\u0119 Usage=Stosowanie: Error=B\u0142\u0105d Warning=Ostrze\u017cenie Continue=Czy chcesz kontynuowa\u0107? Field=Pole From=Od Name=Nazwa Password=Has\u0142o: Publisher=Wydawca Unknown= Username=U\u017cytkownik: Value=Warto\u015b\u0107 Version=Wersja # about dialogue AboutDialogueTabAbout=O AboutDialogueTabAuthors=Autorzy AboutDialogueTabChangelog=Dziennik zmian AboutDialogueTabNews=Nowo\u015bci AboutDialogueTabGPLv2=GPLv2 # missing permissions dialogue MissingPermissionsMainTitle=Aplikacji \u201e{0}\u201d \ z \u201e{1}\u201d brakuje atrybut \u201epermissions\u201d. Aplikacjom bez tego atrybutu nie powinno si\u0119 ufa\u0107.
\ Czy chcesz zezwoli\u0107 na uruchomienie tej aplikacji? MissingPermissionsInfo=Wi\u0119cej informacji uzyskasz na:
\ \ JAR File Manifest Attributes
\ i
\ \ Preventing the repurposing of Applications # missing Application-Library-Allowable-Codebase dialogue ALACAMissingMainTitle=Aplikacja \u201e{0}\u201d \ z \u201e{1}\u201d pobiera zasoby z nast\u0119puj\u0105cych obcych lokalizacji:
\ {2}
\ Czy na pewno chcesz uruchomi\u0107 t\u0105 aplikacj\u0119? ALACAMissingInfo=Wi\u0119cej informacji uzyskasz na:
\ \ JAR File Manifest Attributes
\ i
\ \ Preventing the Repurposing of an Application # matching Application-Library-Allowable-Codebase dialogue ALACAMatchingMainTitle=Aplikacja \u201e{0}\u201d \ z \u201e{1}\u201d pobiera zasoby z nast\u0119puj\u0105cych obcych lokalizacji:
\ {2}
\ Czy na pewno chcesz uruchomi\u0107 t\u0105 aplikacj\u0119? ALACAMatchingInfo=Wi\u0119cej informacji uzyskasz na:
\ \ JAR File Manifest Attributes
\ i
\ \ Preventing the Repurposing of an Application # LS - Severity LSMinor=Mniejszy LSFatal=Fatalny # LC - Category LCSystem=B\u0142\u0105d systemowy LCExternalLaunch=Zewn\u0119trzny b\u0142\u0105d startowy LCFileFormat=B\u0142\u0119dny format pliku LCReadError=B\u0142\u0105d odczytu LCClient=B\u0142\u0105d aplikacji LCLaunching=B\u0142\u0105d startowy LCNotSupported=Nieobs\u0142ugiwana cecha LCInit=B\u0142\u0105d inicjalizacyjny LAllThreadGroup=Wszystkie aplikacje JNLP LNullUpdatePolicy=Wytyczna aktualizacji nie mo\u017ce by\u0107 null. LThreadInterrupted=W\u0105tek przerwany podczas czekania na wystartowanie pliku. LThreadInterruptedInfo=To mo\u017ce doprowadzi\u0107 do zablokowania lub innego uszkodzenia w trakcie wykonywania. Prosz\u0119 uruchomi\u0107 ponownie aplikacj\u0119 lub przegl\u0105dark\u0119. LCouldNotLaunch=Nie mo\u017cna wystartowa\u0107 pliku JNLP. LCouldNotLaunchInfo=Nie zainicjalizowano aplikacji. Aby uzyska\u0107 wi\u0119cej informacji, uruchom javaws lub przegl\u0105dark\u0119 z wiersza polece\u0144 i wy\u015blij raport o b\u0142\u0119dzie. LCantRead=Nie mo\u017cna odczyta\u0107 lub przeprowadzi\u0107 analizy sk\u0142adni pliku JNLP. LCantReadInfo=Mo\u017cesz spr\u00f3bowa\u0107 r\u0119cznie pobra\u0107 ten plik i wys\u0142a\u0107 go razem ze zg\u0142oszeniem b\u0142\u0119du do zespo\u0142u IcedTea-Web. LNullLocation=Nie mo\u017cna ustali\u0107 lokalizacj\u0119 pliku .jnlp. LNullLocationInfo=Podj\u0119to pr\u00f3b\u0119 wystartowania pliku JNLP w innej JVM, lecz nie mo\u017cna by\u0142o zlokalizowa\u0107 plik. Aby wystartowa\u0107 w zewn\u0119trznej JVM, uruchomienie programowe musi by\u0107 w stanie zlokalizowa\u0107 plik .jnlp albo w lokalnym systemie plik\u00f3w czy na serwerze. LNetxJarMissing=Nie mo\u017cna ustali\u0107 lokalizacj\u0119 netx.jar. LNetxJarMissingInfo=Podj\u0119to pr\u00f3b\u0119 wystartowania pliku JNLP w innej JVM, lecz nie mo\u017cna by\u0142o zlokalizowa\u0107 netx.jar. Aby wystartowa\u0107 w zewn\u0119trznej JVM, uruchomienie programowe musi by\u0107 w stanie zlokalizowa\u0107 plik netx.jar. LNotToSpec=Plik JNLP nie spe\u0142nia \u015bci\u015ble specyfikacji. LNotToSpecInfo=Plik JNLP zawiera dane, kt\u00f3re s\u0105 zabronione wed\u0142ug specyfikacji JNLP. Uruchomienie programowe mo\u017ce pr\u00f3bowa\u0107 ignorowa\u0107 niepoprawne informacje i kontynuowa\u0107 startowanie pliku. LNotApplication=Brak pliku applet-owego. LNotApplicationInfo=Podj\u0119to pr\u00f3b\u0119 za\u0142adowania innego pliku ni\u017c applet-owego jako aplikacj\u0119. LNotApplet=Brak pliku applet-owego. LNotAppletInfo=Podj\u0119to pr\u00f3b\u0119 za\u0142adowania innego pliku ni\u017c applet-owy jako applet. LNoInstallers=Brak obs\u0142ugi instalator\u00f3w. LNoInstallersInfo=Pliki instalacyjne JNLP nie s\u0105 jeszcze obs\u0142ugiwane. LInitApplet=Nie mo\u017cna zainicjalizowa\u0107 applet-u. LInitAppletInfo=Aby uzyska\u0107 wi\u0119cej informacji kliknij na przycisk \u201eWi\u0119cej\u00a0informacji\u201d. LInitApplication=Nie mo\u017cna zainicjalizowa\u0107 aplikacj\u0119. LInitApplicationInfo=Nie zainicjalizowano aplikacji. Aby uzyska\u0107 wi\u0119cej informacji, uruchom javaws z wiersza polece\u0144. LNotLaunchable=Plik JNLP nie do uruchomienia. LNotLaunchableInfo=Plik musi by\u0107 typu aplikacja, applet lub instalator JNLP. LCantDetermineMainClass=Klasa g\u0142\u00f3wna nieznana. LCantDetermineMainClassInfo=Nie da\u0142o si\u0119 ustali\u0107 klasy g\u0142\u00f3wnej tej aplikacji. LUnsignedJarWithSecurity=Nie mo\u017cna nada\u0107 uprawnie\u0144 niepodpisanym plikom jar. LUnsignedJarWithSecurityInfo=Aplikacja za\u017c\u0105da\u0142a uprawnie\u0144 bezpiecze\u0144stwa, lecz pliki jar nie s\u0105 podpisane. LUnsignedApplet=Applet by\u0142 niepodpisany. LUnsignedAppletPolicyDenied=Applet by\u0142 niepodpisany, a wytyczna bezpiecze\u0144stwa wstrzyma\u0142a jego uruchomienie. LUnsignedAppletUserDenied=Applet by\u0142 niepodpisany i nie zaufano mu. LPartiallySignedApplet=Applet by\u0142 cz\u0119\u015bciowo podpisany. LPartiallySignedAppletUserDenied=Applet by\u0142 cz\u0119\u015bciowo podpisany, a u\u017cytkownik mu nie zaufa\u0142. LSignedJNLPAppDifferentCerts=Aplikacja JNLP nie jest w pe\u0142ni podpisana jednym certyfikatem. LSignedJNLPAppDifferentCertsInfo=Komponenty tej aplikacji JNLP podpisano indywidualnie, jednak musi by\u0107 wsp\u00f3lny podpisuj\u0105cy dla wszystkich wpis\u00f3w. LSignedAppJarUsingUnsignedJar=Podpisana aplikacja u\u017cywa niepodpisane pliki jar. LSignedAppJarUsingUnsignedJarInfo=G\u0142\u00f3wny jar aplikacji jest podpisany, lecz niekt\u00f3re pliki jar kt\u00f3re u\u017cywa nie s\u0105. LRunInSandboxError=Wywo\u0142anie do uruchomienia w piaskownicy wykonano za p\u00f3\u017ano. LRunInSandboxErrorInfo=Polecono \u0142adowarce klas uruchomi\u0107 applet w piaskownicy, lecz ustawienia bezpiecze\u0144stwa zosta\u0142y ju\u017c zainicjalizowane. LSignedJNLPFileDidNotMatch=Podpisany plik JNLP nie pasuje do starowanego pliku JNLP. LNoSecInstance=B\u0142\u0105d: Brak instancji bezpiecze\u0144stwa dla {0}. Aplikacja mo\u017ce dozna\u0107 problem\u00f3w w kontynuowaniu LCertFoundIn=Znalezino {0} w cacerts ({1}) LSingleInstanceExists=Inna instancja tego applet-u ju\u017c istnieje, a wy\u0142\u0105cznie jedna mo\u017ce by\u0107 wykonywana r\u00f3wnocze\u015bnie. JNotApplet=Plik nie jest applet-em. JNotApplication=Plik nie jest aplikacj\u0105. JNotComponent=Plik nie jest komponentem. JNotInstaller=Plik nie jest instalatorem. JInvalidExtensionDescriptor=Rozszerzenie nie odnosi si\u0119 do komponentu lub instalatora (nazwa={1}, lokalizacja={2}). LNotVerified=Nie zweryfikowano plik\u00f3w jar. LCancelOnUserRequest=Anulowano na \u017c\u0105danie u\u017cytkownika. LFatalVerification=Wyst\u0105pi\u0142 b\u0142\u0105d krytyczny podczas pr\u00f3bowania zweryfikowa\u0107 pliki jar. LFatalVerificationInfo=Wyrzucono wyj\u0105tek w klasie JarCertVerifier. Brak mo\u017cliwo\u015bci odczytu plik\u00f3w cacerts lub trusted.certs jest jedn\u0105 mo\u017cliw\u0105 przyczyn\u0105 tego wyj\u0105tku. LNotVerifiedDialog=Nie wszystkie pliki jar zweryfikowano. LAskToContinue=Czy mimo to chcesz kontynuowa\u0107 wykonywanie tej aplikacji? # Parser PInvalidRoot=Element bazowy nie jest elementem \u201ejnlp\u201d. PNoResources=Brak elementu \u201eresources\u201d. PUntrustedNative=Element \u201enativelib\u201d nie mo\u017ce wyst\u0119powa\u0107 bez za\u017c\u0105dania bezpiecznego \u015brodowiska. PExtensionHasJ2SE=Element \u201ej2se\u201d nie mo\u017ce wyst\u0119powa\u0107 w pliku rozszerzenia komponentu. PInnerJ2SE=Element \u201ej2se\u201d nie mo\u017ce wyst\u0119powa\u0107 wewn\u0105trz elementu \u201ej2se\u201d. PTwoMains=Atrybut \u201emain\u201d wyst\u0119puje podw\u00f3jnie na elemencie \u201eresources\u201d (mo\u017ce wyst\u0119powa\u0107 wy\u0142\u0105cznie jeden raz) PNativeHasMain=Atrybut \u201emain\u201d nie mo\u017ce wyst\u0119powa\u0107 na elemencie \u201enativelib\u201d. PNoInfoElement=Brak elementu \u201einformation\u201d. PMissingTitle=Tytu\u0142 PMissingVendor=Dostawca PMissingElement=Brak sekcji \u201e{0}\u201d dla aktywnych ustawie\u0144 regionalnych, jak i warto\u015bci domy\u015blnej w pliku JNLP. PTwoDescriptions=Podw\u00f3jne elementy \u201edescription\u201d rodzaju \u201e{0}\u201d s\u0105 niedozwolone. PSharing=Element \u201esharing-allowed\u201d jest niedozwolony w powszechnym pliku JNLP. PTwoSecurity=Wy\u0142\u0105cznie jeden element \u201esecurity\u201d jest dozwolony w pliku JNLP. PEmptySecurity=Element \u201esecurity\u201d wyst\u0119puje bez zawierania elementu \u201epermissions\u201d. PTwoDescriptors=Wy\u0142\u0105cznie jeden element \u201eapplication-desc\u201d jest dozwolony w pliku JNLP. PTwoDesktops=Wy\u0142\u0105cznie jeden element \u201edesktop\u201d jest dozwolony. PTwoMenus=Wy\u0142\u0105cznie jeden element \u201emenu\u201d jest dozwolony. PTwoTitles=Wy\u0142\u0105cznie jeden element \u201etitle\u201d jest dozwolony. PTwoIcons=Wy\u0142\u0105cznie jeden element \u201eicon\u201d jest dozwolony. PTwoUpdates=Wy\u0142\u0105cznie jeden element \u201eupdate\u201d jest dozwolony. PUnknownApplet=Nieznany applet PBadWidth=Nieprawid\u0142owa szeroko\u015b\u0107 applet-u PBadHeight=Nieprawid\u0142owa wysoko\u015b\u0107 applet-u PUrlNotInCodebase=Po\u015bredni URL nie wskazuje na podkatalog bazy kodu. (w\u0119ze\u0142={0}, href={1}, baza={2}) PBadRelativeUrl=Nieprawid\u0142owy po\u015bredni URL (w\u0119ze\u0142={0}, href={1}, baza={2}) PBadNonrelativeUrl=Nieprawid\u0142owy bezpo\u015bredni URL (w\u0119ze\u0142={0}, href={1}) PNeedsAttribute=Na elemencie \u201e{0}\u201d musi wyst\u0119powa\u0107 atrybut \u201e{1}\u201d. PBadXML=Nieprawid\u0142owa sk\u0142adnia dokumentu XML. PBadHeapSize=Nieprawid\u0142owa warto\u015b\u0107 wielko\u015bci sterty ({0}) # Runtime BLaunchAbout=Startowanie okna O... BLaunchAboutFailure=Nie mo\u017cna otworzy\u0107 okna O... BNeedsFile=Potrzebny plik .jnlp RNoAboutJnlp=Nie znaleziono pliku about.jnlp BFileLoc=Lokalizacja pliku JNLP BBadProp=B\u0142\u0119dny format w\u0142a\u015bciwo\u015bci \u201e{0}\u201d (powinien by\u0107 klucz=warto\u015b\u0107) BBadParam=B\u0142\u0119dny format parametru \u201e{0}\u201d (powinien by\u0107 nazwa=warto\u015b\u0107) BNoDir=Katalog \u201e{0}\u201d nie istnieje. BNoCodeOrObjectApplet=Na znaczniku applet musi wyst\u0119powa\u0107 atrybut \u201ecode\u201d lub \u201eobject\u201d. RNoResource=Brak zasobu: {0} RShutdown=Ten wyj\u0105tek aby zapobiec zamkni\u0119ciu JVM, lecz proces ten zako\u0144czono. RExitTaken=Klasa zako\u0144czenia ju\u017c nastawiona i wywo\u0142uj\u0105cy nie jest klas\u0105 zako\u0144czenia. RCantReplaceSM=Wymiana SecurityManager jest niedozwolona. RCantCreateFile=Nie mo\u017cna utworzy\u0107 pliku \u201e{0}\u201d RCantDeleteFile=Nie mo\u017cna usun\u0105\u0107 pliku \u201e{0}\u201d RCantOpenFile=Nie mo\u017cna otworzy\u0107 pliku \u201e{0}\u201d RCantWriteFile=Nie mo\u017cna zapisa\u0107 pliku \u201e{0}\u201d RFileReadOnly=Otwieranie pliku w trybie wy\u0142\u0105cznie do odczytu RExpectedFile=Oczekiwano \u201e{0}\u201d bycie plikiem, lecz nie by\u0142o RRemoveRPermFailed=Brak powodzenia przy usuwaniu praw odczytu z pliku \u201e{0}\u201d RRemoveWPermFailed=Brak powodzenia przy usuwaniu praw zapisu z pliku \u201e{0}\u201d RRemoveXPermFailed=Brak powodzenia przy usuwaniu praw wykonawczych z pliku \u201e{0}\u201d RGetRPermFailed=Brak powodzenia przy pozyskiwaniu praw odczytu dla pliku \u201e{0}\u201d RGetWPermFailed=Brak powodzenia przy pozyskiwaniu praw zapisu dla pliku \u201e{0}\u201d RGetXPermFailed=Brak powodzenia przy pozyskiwaniu praw wykonawczych dla pliku \u201e{0}\u201d RCantCreateDir=Nie mo\u017cna utworzy\u0107 katalogu \u201e{0}\u201d RCantRename=Nie mo\u017cna przemianowa\u0107 \u201e{0}\u201d w \u201e{1}\u201d RDenyStopped=Zatrzymane aplikacje nie posiadaj\u0105 praw dost\u0119pu. RExitNoApp=Nie mo\u017cna zako\u0144czy\u0107 maszyny wirtualnej Java (JVM) poniewa\u017c nie mo\u017cna ustali\u0107 bie\u017c\u0105cej aplikacji. RNoLockDir=Nie mo\u017cna utworzy\u0107 katalogu blokuj\u0105cego ({0}) RNestedJarExtration=Nie mo\u017cna wyodr\u0119bni\u0107 zagnie\u017cd\u017conego jar-a. RUnexpected=Nie oczekiwano {0} w {1} RConfigurationError=B\u0142\u0105d fatalny podczas wczytywania konfiguracji, kontynuacja z pust\u0105. Prosz\u0119 naprawi\u0107 RConfigurationFatal=B\u0141\u0104D: Wyst\u0105pi\u0142 b\u0142\u0105d fatalny podczas \u0142adowania konfiguracji. By\u0107 mo\u017ce wymagano konfiguracj\u0119 globaln\u0105, ale nie znaleziono jej. RFailingToDefault=Zawodzenie na konfiguracj\u0119 domy\u015bln\u0105 RPRoxyPacNotSupported=U\u017cycie plik\u00f3w automatycznej konfiguracji proxy (PAC) nie jest obs\u0142ugiwane. RProxyFirefoxNotFound=Nie mo\u017cna u\u017cy\u0107 ustawie\u0144 proxy Firefox-a. Zastosowano \u201eDIRECT\u201d jako typ proxy. RProxyFirefoxOptionNotImplemented=Opcja proxy \u201e{0}\u201d ({1}) przegl\u0105darki jeszcze nie jest obs\u0142ugiwana. RBrowserLocationPromptTitle=Lokalizacja przegl\u0105darki RBrowserLocationPromptMessage=Podaj lokalizacj\u0119 przegl\u0105darki RBrowserLocationPromptMessageWithReason=Podaj lokalizacj\u0119 przegl\u0105darki (polecenie \u201e{0}\u201d jest nieprawid\u0142owe). BFileInfoAuthors=Nazwiska i adresy poczty elektronicznej zas\u0142u\u017conych dla tego projektu umieszczono w pliku AUTHORS, znajduj\u0105cym si\u0119 w katalogu g\u0142\u00f3wnym IcedTea-Web. BFileInfoCopying=Kompletny egzemplarz licencji GPLv2 tego projektu umieszczono w pliku COPYING, znajduj\u0105cym si\u0119 w katalogu g\u0142\u00f3wnym IcedTea-Web. BFileInfoNews=Nowo\u015bci o wydaniach tego projektu umieszczono w pliku NEWS, znajduj\u0105cym si\u0119 w katalogu g\u0142\u00f3wnym IcedTea-Web. # Boot options, message should be shorter than this ----------------> BOUsage=javaws [-opcje-uruchomienia] BOUsage2=javaws [-opcje-sterowania] BOJnlp=Lokalizacja pliku JNLP do wystartowania (URL lub plik) BOArg=Do wiesza argument aplikacji przed wystartowaniem BOParam=Do wiesza parametr applet-u przed wystartowaniem BOProperty=Ustawia w\u0142a\u015bciwo\u015b\u0107 systemow\u0105 przed wystartowaniem BOUpdate=Sprawd\u017a dost\u0119pno\u015b\u0107 aktualizacji BOLicense=Wy\u015bwietl licencj\u0119 GPL i zako\u0144cz BOVerbose=W\u0142\u0105cz rozmowne komunikaty BOAbout=Pokazuje aplikacj\u0119 przyk\u0142adow\u0105 BOVersion=Wy\u015bwietl wersj\u0119 IcedTea-Web i zako\u0144cz BONosecurity=Wy\u0142\u0105cza bezpieczne \u015brodowisko uruchomieniowe BONoupdate=Wy\u0142\u0105cza sprawdzanie dost\u0119pno\u015bci aktualizacji BOHeadless=Wy\u0142\u0105cza okno pobierania i inne interfejsy graficzne BOStrict=W\u0142\u0105cza \u015bcis\u0142e sprawdzanie format pliku JNLP BOViewer=Pokazuje podgl\u0105d zaufanych certyfikat\u00f3w BOXml=Stosuje \u015bcis\u0142y analizator sk\u0142adniowy XML do analizy pliku JNLP BOredirect=Idzie za przekierowaniami HTTP BXnofork=Nie tw\u00f3rz nast\u0119pnej JVM BXclearcache=Wyczy\u015b\u0107 pami\u0119\u0107 podr\u0119czn\u0105 aplikacji JNLP BXignoreheaders=Pomijaj weryfikacj\u0119 nag\u0142\u00f3wk\u00f3w plik\u00f3w jar BOHelp1=Wy\u015bwietl ten komunikat i zako\u0144cz # Cache CAutoGen=Wygenerowano automatycznie - nie edytowa\u0107 CNotCacheable=Zas\u00f3b \u201e{0}\u201d jest nie do przechowania w pami\u0119ci podr\u0119cznej. CDownloading=Pobieranie CComplete=Uko\u0144czono CChooseCache=Wybierz katalog pami\u0119ci podr\u0119cznej... CChooseCacheInfo=NetX wymaga lokalizacj\u0119 do sk\u0142adowania plik\u00f3w pami\u0119ci podr\u0119cznej. CChooseCacheDir=Katalog pami\u0119ci podr\u0119cznej CCannotClearCache=Obecnie, nie mo\u017cna wyczy\u015bci\u0107 pami\u0119ci podr\u0119cznej. Spr\u00f3buj p\u00f3\u017aniej. Je\u015bli problem nadal istnieje, zamknij przegl\u0105dark\u0119/i i aplikacje JNLP. Ostatecznie, spr\u00f3buj unicestwi\u0107 wszystkie aplikacje Java. \\\n Pami\u0119\u0107 podr\u0119czn\u0105 mo\u017cesz wyczy\u015bci\u0107 za pomoc\u0105 polecenia \u201ejavaws -Xclearcache\u201d lub Pami\u0119\u0107\u00a0podr\u0119czna/Przegl\u0105daj\u00a0pliki/Wyczy\u015b\u0107 w panelu IcedTea-Web. CFakeCache=Pami\u0119\u0107 podr\u0119czna jest uszkodzona. Naprawianie. CFakedCache=Naprawiono uszkodzon\u0105 pami\u0119\u0107 podr\u0119czn\u0105. Stanowczo si\u0119 zaleca uruchomi\u0107 polecenie \u201ejavaws -Xclearcache\u201d wraz z nast\u0119puj\u0105cym ponownym uruchomieniem aplikacji.\nPami\u0119\u0107 podr\u0119czn\u0105 mo\u017cesz zar\u00f3wno wyczy\u015bci\u0107 w panelu IcedTea-Web poprzez Pami\u0119\u0107\u00a0podr\u0119czna/Przegl\u0105daj\u00a0pliki/Wyczy\u015b\u0107. # Security SFileReadAccess=Aplikacja za\u017c\u0105da\u0142a uprawnienie do odczytu \u201e{0}\u201d. Czy chcesz zezwoli\u0107 na t\u0105 akcj\u0119? SFileWriteAccess=Aplikacja za\u017c\u0105da\u0142a uprawnienie do zapisu \u201e{0}\u201d. Czy chcesz zezwoli\u0107 na t\u0105 akcj\u0119? SDesktopShortcut=Aplikacja za\u017c\u0105da\u0142a uprawnienie do utworzenia aktywatora na pulpicie. Czy chcesz zezwoli\u0107 na t\u0105 akcj\u0119? SSigUnverified=Nie mo\u017cna zweryfikowa\u0107 podpisu cyfrowego aplikacji. Aplikacja otrzyma nieograniczony dost\u0119p do komputera.\nCzy chcesz uruchomi\u0107 aplikacj\u0119? SSigVerified=Zweryfikowano podpis cyfrowy aplikacji. Aplikacja otrzyma nieograniczony dost\u0119p do komputera.\nCzy chcesz uruchomi\u0107 aplikacj\u0119? SSignatureError=Podpis cyfrowy aplikacji zawiera b\u0142\u0105d. Aplikacja otrzyma nieograniczony dost\u0119p do komputera.\nCzy chcesz uruchomi\u0107 aplikacj\u0119? SUntrustedSource=Nie zweryfikowano podpisu cyfrowego przez zaufanego wydawc\u0119. Uruchamiaj wy\u0142\u0105cznie je\u015bli ufasz pochodzeniu aplikacji. SWarnFullPermissionsIgnorePolicy=Kodowi wykonywalnemu zostan\u0105 wydane pe\u0142ne uprawnienia, ignoruj\u0105c wszelkie wytyczne Java. STrustedSource=Potwierdzono podpis cyfrowy przez zaufanego wydawc\u0119. SClipboardReadAccess=Aplikacja za\u017c\u0105da\u0142a wy\u0142\u0105czne uprawnienie do odczytu do schowka. Czy chcesz zezwoli\u0107 na t\u0105 akcj\u0119? SClipboardWriteAccess=Aplikacja za\u017c\u0105da\u0142a wy\u0142\u0105czne uprawnienie do zapisu do schowka. Czy chcesz zezwoli\u0107 na t\u0105 akcj\u0119? SPrinterAccess=Aplikacja za\u017c\u0105da\u0142a dost\u0119p do drukarki. Czy chcesz zezwoli\u0107 na t\u0105 akcj\u0119? SNetworkAccess=Aplikacja za\u017c\u0105da\u0142a zezwolenie na nawi\u0105zywanie po\u0142\u0105cze\u0144 do \u201e{0}\u201d. Czy chcesz zezwoli\u0107 na t\u0105 akcj\u0119? SNoAssociatedCertificate= SUnverified=(niezweryfikowany) SAlwaysTrustPublisher=Zawsze ufaj materia\u0142om od tego wydawcy. SHttpsUnverified=Nie zweryfikowano certyfikat HTTPS witryny internetowej. SRememberOption=Czy chcesz zapami\u0119ta\u0107 t\u0105 opcj\u0119? SRememberAppletOnly=Dla applet-u SRememberCodebase=Dla witryny {0} SUnsignedSummary=Niepodpisana aplikacja Java domaga si\u0119 uruchomienia. SUnsignedDetail=Niepodpisana aplikacja z nast\u0119puj\u0105cej lokalizacji domaga si\u0119 uruchomienia:
  {0}
Strona, kt\u00f3ra postawi\u0142a \u017c\u0105danie:
  {1}

Zaleca si\u0119 uruchamia\u0107 wy\u0142\u0105cznie aplikacje z zaufanych witryn. SUnsignedAllowedBefore=Zaakceptowa\u0142e\u015b ten applet poprzednio. SUnsignedRejectedBefore=Odrzuci\u0142e\u015b ten applet poprzednio. SUnsignedQuestion=Czy chcesz zezwoli\u0107 temu applet-owi na uruchomienie? SPartiallySignedSummary=Zaledwie cz\u0119\u015bci kodu tej aplikacji s\u0105 podpisane. SPartiallySignedDetail=Ta aplikacja zawiera zar\u00f3wno podpisany jak i niepodpisany kod. Cho\u0107 kod, kt\u00f3ry jest podpisany przez zaufanego dostawc\u0119 jest bezpieczny, niepodpisany kod mo\u017ce poci\u0105ga\u0107 za sob\u0105 kod, kt\u00f3ry jest poza kontrolnym zasi\u0119giem zaufanego dostawcy. SPartiallySignedQuestion=Czy chcesz kontynuowa\u0107 i mimo to uruchomi\u0107 t\u0105 aplikacj\u0119? SAuthenticationPrompt=Serwer {0} w \u201e{1}\u201d \u017c\u0105da uwierzytelnienia. Podaje komunikat: \u201e{2}\u201d SJNLPFileIsNotSigned=Ta aplikacja zawiera podpis cyfrowy, jednak startowany plik JNLP jest bez podpisu. SAppletTitle=Tytu\u0142 applet-u: {0} STrustedOnlyAttributeFailure=Aplikacja podaje \u201etrue\u201d dla Trusted-only w swoim manife\u015bcie. {0} i \u017c\u0105da poziom uprawnienia: {1}. To jest niedozwolone. STOAsignedMsgFully=Aplet zosta\u0142 podpisany ca\u0142kowicie STOAsignedMsgAndSandbox=Aplet zosta\u0142 podpisany ca\u0142kowicie i umieszczony w piaskownicy STOAsignedMsgPartiall=Aplet zosta\u0142 podpisany cz\u0119\u015bciowo STempPermNoFile=Zakaz dost\u0119pu do plik\u00f3w STempPermNoNetwork=Zakaz dost\u0119pu do sieci STempPermNoExec=Zakaz uruchamiania polece\u0144 STempNoFileOrNetwork=Zakaz dost\u0119pu do plik\u00f3w lub sieci STempNoExecOrNetwork=Zakaz uruchamiania polece\u0144 lub dost\u0119pu do sieci STempNoFileOrExec=Zakaz dost\u0119pu do plik\u00f3w lub uruchamiania polece\u0144 STempNoFileOrNetworkOrExec=Zakaz dost\u0119pu do plik\u00f3w, sieci lub uruchamiania polece\u0144 STempAllMedia=Wszystkie media STempSoundOnly=Odtwarzanie d\u017awi\u0119ku STempClipboardOnly=Dost\u0119p do schowka STempPrintOnly=Druk dokument\u00f3w STempAllFileAndPropertyAccess=Dost\u0119p do wszystkich plik\u00f3w i w\u0142a\u015bciwo\u015bci STempReadLocalFilesAndProperties=Wy\u0142\u0105cznie odczyt lokalnych plik\u00f3w i w\u0142a\u015bciwo\u015bci STempReflectionOnly=Wy\u0142\u0105cznie introspekcja Java # Security - used for the More Information dialog SBadKeyUsage=Zasoby zawieraj\u0105 wpisy dla kt\u00f3rych rozszerzenie KeyUsage certyfikatu podpisuj\u0105cego nie zezwala na podpisywanie kodu. SBadExtendedKeyUsage=Zasoby zawieraj\u0105 wpisy dla kt\u00f3rych rozszerzenie ExtendedKeyUsage certyfikatu podpisuj\u0105cego nie zezwala na podpisywanie kodu. SBadNetscapeCertType=Zasoby zawieraj\u0105 wpisy dla kt\u00f3rych rozszerzenie NetscapeCertType certyfikatu podpisuj\u0105cego nie zezwala na podpisywanie kodu. SHasExpiredCert=Podpis cyfrowy wygas\u0142. SHasExpiringCert=Zasoby zawieraj\u0105 wpisy kt\u00f3rych certyfikat podpisuj\u0105cego wyga\u015bnie za sze\u015b\u0107 miesi\u0119cy. SNotYetValidCert=Zasoby zawieraj\u0105 wpisy kt\u00f3rych certyfikat podpisuj\u0105cego nie jest jeszcze wa\u017cny. SUntrustedCertificate=Ten podpis cyfrowy wygenerowano za pomoc\u0105 niezaufanego certyfikatu. STrustedCertificate=Ten podpis cyfrowy wygenerowano za pomoc\u0105 zaufanego certyfikatu. SCNMisMatch=Oczekiwana nazwa komputera w tym certyfikacie to: \u201e{0}\u201d
Adres pod kt\u00f3rym nawi\u0105zywane jesz po\u0142\u0105czenie: \u201e{1}\u201d SRunWithoutRestrictions=Aplikacja zostanie uruchomiona bez restrykcji bezpiecze\u0144stwa zwykle oferowanych przez Java. SCertificateDetails=Szczeg\u00f3\u0142y certyfikatu # Security - certificate information SIssuer=Wystawca SSerial=Numer seryjny SMD5Fingerprint=Odcisk MD5 SSHA1Fingerprint=Odcisk SHA1 SSignature=Podpis SSignatureAlgorithm=Algorytm podpisu SSubject=Podmiot SValidity=Wa\u017cno\u015b\u0107 # Certificate Viewer CVCertificateViewer=Certyfikaty CVCertificateType=Typ certyfikatu CVDetails=Szczeg\u00f3\u0142y CVExport=Eksportuj CVExportPasswordMessage=Wprowad\u017a has\u0142o zabezpieczaj\u0105ce plik z kluczami: CVImport=Importuj CVImportPasswordMessage=Wprowad\u017a has\u0142o dost\u0119pu do pliku: CVIssuedBy=Wystawiono przez CVIssuedTo=Wystawiono dla CVPasswordTitle=Uwierzytelnianie CVRemove=Usu\u0144 CVRemoveConfirmMessage=Czy na pewno chcesz usun\u0105\u0107 zaznaczony certyfikat? CVRemoveConfirmTitle=Zatwierdzanie usuni\u0119cia certyfikatu CVUser=U\u017cytkownik CVSystem=System # KeyStores: see KeyStores.java KS=Baza kluczy KSCerts=Zaufane certyfikaty KSJsseCerts=Zaufane certyfikaty JSSE KSCaCerts=Zaufane certyfikaty bazowe organ\u00f3w certyfikacji KSJsseCaCerts=Zaufane certyfikaty bazowe JSSE organ\u00f3w certyfikacji KSClientCerts=Certyfikaty uwierzytelnienia klient\u00f3w # Deployment Configuration messages DCIncorrectValue=W\u0142a\u015bciwo\u015b\u0107 \u201e{0}\u201d zawiera b\u0142\u0119dn\u0105 warto\u015b\u0107 \u201e{1}\u201d. Mo\u017cliwe warto\u015bci s\u0105 {2}. DCInternal=B\u0142\u0105d wewn\u0119trzny: {0} DCSourceInternal= DCUnknownSettingWithName=W\u0142a\u015bciwo\u015b\u0107 \u201e{0}\u201d jest nieznana. DCmaindircheckNotexists=Po wszystkich pr\u00f3bach, Tw\u00f3j katalog konfiguracyjny \u201e{0}\u201d nie istnieje. DCmaindircheckNotdir=Tw\u00f3j katalog konfiguracyjny \u201e{0}\u201d nie jest katalogiem. DCmaindircheckRwproblem=Nie mo\u017cna odpowiednio odczyta\u0107/zapisa\u0107 Tw\u00f3j katalog konfiguracyjny \u201e{0}\u201d. # Value Validator messages. Messages should follow "Possible values ..." VVPossibleValues=Mo\u017cliwe warto\u015bci {0} VVPossibleBooleanValues=s\u0105 \u201e{0}\u201d lub \u201e{1}\u201d. VVPossibleFileValues=to bezpo\u015brednie \u015bcie\u017cki do pliku lub katalogu. VVPossibleRangedIntegerValues=le\u017c\u0105 \u0142\u0105cznie w przedziale mi\u0119dzy {0} do {1}. VVPossibleUrlValues=to ka\u017cdy prawid\u0142owy URL, np. http://icedtea.classpath.org/hg/ # Control Panel - Main CPMainDescriptionShort=Konfiguracja IcedTea-Web CPMainDescriptionLong=Konfiguruje funkcjonowanie wtyczki do przegl\u0105darki (IcedTeaNPPlugin) i javaws (NetX) # Control Panel - Tab Descriptions CPAboutDescription=Przegl\u0105daj informacje o wersji panela sterowania IcedTea. CPNetworkSettingsDescription=Konfiguruj ustawienia sieciowe, razem ze sposobem \u0142\u0105czenia si\u0119 IcedTea-Web z internetem, czy te\u017c za po\u015brednictwem serwera proxy. CPTempInternetFilesDescription=Java sk\u0142aduje dane aplikacji dla szybszego wykonywania podczas nast\u0119pnego uruchomienia. CPJRESettingsDescription=Zarz\u0105dzaj wersjami Java Runtime Environment, jak i ustawieniami aplikacji i applet-\u00f3w Java. CPCertificatesDescription=Stosuj certyfikaty aby legitymowa\u0107 si\u0119, jak i sprawdza\u0107 to\u017csamo\u015b\u0107 certyfikat\u00f3w, organ\u00f3w certyfikacji i wydawc\u00f3w. CPSecurityDescription=Konfiguruj t\u0105 mask\u0105 ustawienia bezpiecze\u0144stwa. CPDebuggingDescription=W\u0142\u0105czaj opcje aby pom\u00f3c w usuwaniu b\u0142\u0119d\u00f3w w programie. CPDesktopIntegrationDescription=Ustaw czy zezwala\u0107 na tworzenie skr\u00f3tu na pulpicie. CPJVMPluginArguments=Ustaw argumenty maszyny wirtualnej Java (JVM) dla wtyczki. CPJVMitwExec=Ustaw maszyn\u0119 wirtualn\u0105 Java (JVM) dla IcedTea-Web \u2014 dzia\u0142aj\u0105c\u0105 najlepiej z OpenJDK CPJVMitwExecValidation=Sprawd\u017a JVM dla IcedTea-Web CPJVMPluginSelectExec=Przegl\u0105daj za JVM dla IcedTea-Web CPJVMnone=Brak wyniku sprawdzianu dla CPJVMvalidated=Wynik sprawdzianu dla CPJVMvalueNotSet=Nie ustawiono warto\u015bci. Stosowana b\u0119dzie JVM zakodowana na sztywno. CPJVMnotLaunched=B\u0142\u0105d: Nie wystartowano procesu. Zobacz komunikaty konsoli, aby uzyska\u0107 wi\u0119cej informacji. CPJVMnoSuccess=B\u0142\u0105d: Nie zako\u0144czono procesu pomy\u015blnie. Zobacz komunikaty aby uzyska\u0107 szczeg\u00f3\u0142y, przyczym Java jest \u017ale ustawiona. CPJVMopenJdkFound=Znakomicie, wykryto OpenJDK CPJVMoracleFound=Wspaniale, wykryto Oracle Java CPJVMibmFound=Dobrze, wykryto IBM Java CPJVMgijFound=Ostrze\u017cenie, wykryto gij CPJVMstrangeProcess=\u015acie\u017cka mia\u0142a proces wykonywalny, lecz go nie rozpoznano. Sprawd\u017a wersj\u0119 Java w komunikatach konsoli. CPJVMnotDir=B\u0142\u0105d: Wybrana \u015bcie\u017cka nie jest katalogiem. CPJVMisDir=Wybrana \u015bcie\u017cka jest katalogiem. CPJVMnoJava=B\u0142\u0105d: Wybrana \u015bcie\u017cka nie zawiera bin/java. CPJVMjava=Wybrana \u015bcie\u017cka zawiera bin/java. CPJVMnoRtJar=B\u0142\u0105d: Wybrana \u015bcie\u017cka nie zawiera lib/rt.jar. CPJVMrtJar=Wybrana \u015bcie\u017cka zawiera lib/rt.jar. CPJVMPluginAllowTTValidation=Sprawd\u017a JRE bezzw\u0142ocznie CPJVMNotokMessage1=Wprowadzono nieprawid\u0142ow\u0105 warto\u015b\u0107 JDK
  • {0}
z nast\u0119puj\u0105cym komunikatem o b\u0142\u0119dzie: CPJVMNotokMessage2=Przyczyn\u0105 tego komunikatu mog\u0105 by\u0107:
* Nie zaliczono niekt\u00f3rych sprawdzian\u00f3w
* Wykryto inny ni\u017c OpenJDK
Ze wzgl\u0119du na nieprawid\u0142owy JDK IcedTea-Web prawdopodobnie nie b\u0119dzie w stanie wystartowa\u0107.
Trzeba b\u0119dzie dostosowa\u0107 lub usun\u0105\u0107 w\u0142a\u015bciwo\u015b\u0107 \u201e{0}\u201d w pliku konfiguracyjnym
  • {1}

Przeszukaj system za OpenJDK. CPJVMconfirmInvalidJdkTitle=Nieprawid\u0142owy JDK CPJVMconfirmReset=Przywr\u00f3ci\u0107 stan domy\u015blny? CPPolicyDetail=Przegl\u0105daj i edytuj plik u\u017cytkownika wytycznej Java. Pozwala na udzielanie lub odmawianie praw applet-om, niezale\u017cnie od standardowych regu\u0142 bezpiecze\u0144stwa piaskownicy. CPPolicyTooltip=Otwiera \u201e{0}\u201d w edytorze wytycznej (policytool) CPPolicyEditorNotFound=Nie znaleziono systemowego edytora plik\u00f3w wytycznej. Sprawd\u017a, czy zmienna \u015brodowiskowa \u201ePATH\u201d rozwi\u0105zuje lokalizacj\u0119 \u201epolicytool\u201d. # Control Panel - Buttons CPButAbout=O... CPButNetworkSettings=Ustawienia sieciowe... CPButSettings=Ustawienia... CPButView=Przegl\u0105daj... CPButCertificates=Certyfikaty... CPButSimpleEditor=Edytor uproszczony... CPButAdvancedEditor=Edytor zaawansowany... # Control Panel - Headers CPHead=Panel sterowania IcedTea-Web CPHeadAbout=\u00a0O\u00a0IcedTea-Web\u00a0 CPHeadNetworkSettings=\u00a0Ustawienia\u00a0proxy\u00a0sieciowego\u00a0 CPHeadTempInternetFiles=\u00a0Internetowe\u00a0pliki\u00a0tymczasowe\u00a0 CPHeadJRESettings=\u00a0Ustawienia\u00a0\u015brodowiska\u00a0uruchomieniowego\u00a0Java\u00a0 CPHeadCertificates=\u00a0Certyfikaty\u00a0 CPHeadDebugging=\u00a0Ustawienia\u00a0analizy\u00a0i\u00a0usuwania\u00a0b\u0142\u0119d\u00f3w\u00a0 CPHeadDesktopIntegration=\u00a0Integracja\u00a0z\u00a0pulpitem\u00a0 CPHeadSecurity=\u00a0Ustawienia\u00a0bezpiecze\u0144stwa\u00a0 CPHeadJVMSettings=\u00a0Ustawienia\u00a0maszyny\u00a0wirtualnej\u00a0Java\u00a0(JVM)\u00a0 CPHeadPolicy=\u00a0Dostosowania\u00a0wytycznej\u00a0 # Control Panel - Tabs CPTabAbout=O IcedTea-Web CPTabCache=Pami\u0119\u0107 podr\u0119czna CPTabCertificate=Certyfikaty CPTabClassLoader=\u0141adowarki klas CPTabDebugging=Usuwanie b\u0142\u0119d\u00f3w CPTabDesktopIntegration=Integracja z pulpitem CPTabNetwork=Sie\u0107 CPTabRuntimes=\u015arodowiska uruchomieniowe CPTabSecurity=Bezpiecze\u0144stwo CPTabJVMSettings=Ustawienia JVM CPTabPolicy=Ustawienia wytycznej # Control Panel - AboutPanel CPAboutInfo=Ten panel sterowania s\u0142u\u017cy do ustawiania pliku deployments.properties.
Nie wszystkie opcje maj\u0105 efekt, dop\u00f3ki nie zostan\u0105 obj\u0119te implementacj\u0105.
Stosowanie wielu \u015brodowisk uruchomieniowych Java (JRE) jest obecnie ograniczone do OpenJDK.
# Control Panel - AdvancedProxySettings APSDialogTitle=Ustawienia sieciowe APSServersPanel=Serwery APSProxyTypeLabel=Typ APSProxyAddressLabel=Adres proxy APSProxyPortLabel=Port proxy APSLabelHTTP=HTTP APSLabelSecure=Bezpieczny APSLabelFTP=FTP APSLabelSocks=Socks APSSameProxyForAllProtocols=Stosuj ten sam serwer proxy dla wszystkich protoko\u0142\u00f3w. APSExceptionsLabel=Wyj\u0105tki APSExceptionsDescription=Nie stosuj serwera proxy dla adres\u00f3w zaczynaj\u0105cych si\u0119 na: APSExceptionInstruction=Odgradzaj ka\u017cd\u0105 pozycj\u0119 \u015brednikiem (;). # Control Panel - DebugginPanel CPDebuggingPossibilites=Zapis dziennika DPEnableLogging=W\u0142\u0105cz usuwanie b\u0142\u0119d\u00f3w DPEnableLoggingHint=Powoduje zapis wydarze\u0144 usuwania b\u0142\u0119d\u00f3w. R\u00f3wnoznaczne z prze\u0142\u0105cznikami \u201e-verbose\u201d lub \u201eICEDTEAPLUGIN_DEBUG=true\u201d. DPEnableHeaders=W\u0142\u0105cz nag\u0142\u00f3wki DPEnableHeadersHint=Wypisuje nag\u0142\u00f3wki, takie jak u\u017cytkownik, pozycja w kodzie i czas, z ka\u017cdym wydarzeniem. DPEnableFile=Zapisuj dziennik w plik CPFilesLogsDestDir=Katalog dziennik\u00f3w CPFilesLogsDestDirResert=Domy\u015blny DPEnableFileHint=Dziennik b\u0119dzie zapisany w katalogu \u201e{0}\u201d. DPEnableStds=Zapisuj dziennik w standardowy strumie\u0144 wyj\u015bcia DPEnableStdsHint=Wydarzenia b\u0119d\u0105 wy\u015bwietlane na wyj\u015bciu standardowym. DPEnableSyslog=Zapisuj do dziennika systemowego DPEnableSyslogHint=Wydarzenia b\u0119d\u0105 zapisywane w dzienniku systemowym. DPDisable=Wy\u0142\u0105cz DPHide=Ukrywaj podczas startu DPShow=Pokazuj podczas startu DPShowPluginOnly=Pokazuj podczas startu wtyczki DPShowJavawsOnly=Pokazuj podczas startu javaws DPJavaConsole=Konsola Java DPJavaConsoleDisabledHint=Konsola Java jest wy\u0142\u0105czona. U\u017cyj itweb-settings do skonfigurowania widoczno\u015bci konsoli Java. # PolicyEditor PEUsage=policyeditor [-file plik_wytycznej] PEHelpFlag=Wy\u015bwietl ten komunikat i zako\u0144cz PEFileFlag=Okre\u015bla \u015bcie\u017ck\u0119 plika wytycznej do otwarcia PECodebaseFlag=Specify (a) codebase URL(s) to add and/or focus in the editor PETitle=Edytor wytycznej PEReadProps=Odczyt w\u0142a\u015bciwo\u015bci systemowych PEReadPropsDetail=Zezwala aplet-om na odczyt w\u0142a\u015bciwo\u015bci systemowych, np. Twoj\u0105 nazw\u0119 u\u017cytkownika lub lokalizacja Twojego katalogu domowego PEWriteProps=Zapis w\u0142a\u015bciwo\u015bci systemowych PEWritePropsDetail=Zezwala aplet-om na zapis w\u0142a\u015bciwo\u015bci systemowych PEReadFiles=Odczyt z plik\u00f3w lokalnych PEReadFilesDetail=Zezwala aplet-om na odczyt plik\u00f3w w Twoim katalogu domowym PEWriteFiles=Zapis w pliki lokalne PEWriteFilesDetail=Zezwala aplet-om na zapis plik\u00f3w w Twoim katalogu domowym PEDeleteFiles=Usuni\u0119cie plik\u00f3w lokalnych PEDeleteFilesDetail=Zezwala aplet-om na usuwanie plik\u00f3w w Twoim katalogu domowym PEReadSystemFiles=Odczyt wszystkich plik\u00f3w systemu PEReadSystemFilesDetail=Zezwala aplet-om na odczyt z wszystkich lokalizacji na komputerze PEWriteSystemFiles=Zapis wszystkich plik\u00f3w systemu PEWriteSystemFilesDetail=Zezwala aplet-om na zapis do wszystkich lokalizacji na komputerze PEReadTempFiles=Odczyt z plik\u00f3w tymczasowych PEReadTempFilesDetail=Zezwala aplet-om na odczyt z Twojego katalogu plik\u00f3w tymczasowych PEWriteTempFiles=Zapis w pliki tymczasowe PEWriteTempFilesDetail=Zezwala aplet-om na zapis do Twojego katalogu plik\u00f3w tymczasowych PEDeleteTempFiles=Usuni\u0119cie plik\u00f3w tymczasowych PEDeleteTempFilesDetail=Zezwala aplet-om na usuwanie plik\u00f3w z Twojego katalogu plik\u00f3w tymczasowych PEAWTPermission=Dost\u0119p do systemu okien PEAWTPermissionDetail=Zezwala aplet-om na ca\u0142kowity dost\u0119p do systemu okien AWT PEClipboard=Dost\u0119p do schowka PEClipboardDetail=Zezwala aplet-om na odczyt z i zapis do schowka PENetwork=Dost\u0119p do sieci PENetworkDetail=Zezwala aplet-om na tworzenie po\u0142\u0105cze\u0144 sieciowych PEPrint=Druk dokument\u00f3w PEPrintDetail=Zezwala aplet-om na wstawianie zada\u0144 drukowania do kolejki PEPlayAudio=Odtworzenie d\u017awi\u0119k\u00f3w PEPlayAudioDetail=Zezwala aplet-om na odtwarzanie d\u017awi\u0119k\u00f3w, lecz nie na nagrywanie PERecordAudio=Nagrywanie d\u017awi\u0119ku PERecordAudioDetail=Zezwala aplet-om na nagrywanie d\u017awi\u0119ku, lecz nie na odtwarzanie PEReflection=Introspekcja Java PEReflectionDetail=Zezwala aplet-om na dost\u0119p do Java Reflection API PEClassLoader=Pozyskanie \u0142adowarki klas PEClassLoaderDetail=Zezwala aplet-om na dost\u0119p do systemowej \u0142adowarki klas (cz\u0119sto u\u017cywane z introspekcj\u0105) PEClassInPackage=Dost\u0119p do innych pakiet\u00f3w PEClassInPackageDetail=Zezwala aplet-om na dost\u0119p do klas z obcych pakiet\u00f3w (cz\u0119sto u\u017cywane z introspekcj\u0105) PEDeclaredMembers=Dost\u0119p do prywatnych danych klasy PEDeclaredMembersDetail=Zezwala na dost\u0119p do danych zwyczajnie ukrytych przed obcymi klasami Java (cz\u0119sto u\u017cywane z introspekcj\u0105) PEExec=Wykonanie polece\u0144 PEExecDetail=Zezwala aplet-om na wykonanie polece\u0144 systemowych PEGetEnv=Pozyskanie zmiennych \u015brodowiskowych PEGetEnvDetail=Zezwala aplet-om na odczyt zmiennych \u015brodowiskowych PECouldNotOpen=Nie mo\u017cna otworzy\u0107 pliku wytycznej PECouldNotSave=Nie mo\u017cna zapisa\u0107 pliku wytycznej PEAddCodebase=Dodaj baz\u0119 kodu PERemoveCodebase=Usu\u0144 PECodebasePrompt=Podaj now\u0105 baz\u0119 kodu PEGlobalSettings=Wszystkie Applet-y PESaveChanges=Zapisa\u0107 zmiany przed zako\u0144czeniem? PEChangesSaved=Zapisano zmiany PECheckboxLabel=Uprawniena PECodebaseLabel=Bazy kodu PEFileMenu=Plik PEOpenMenuItem=Otw\u00f3rz... PESaveMenuItem=Zapisz PESaveAsMenuItem=Zapisz\u00a0jako... PEExitMenuItem=Zako\u0144cz PEEditMenu=Edycja PERenameCodebaseItem=Przemianuj baz\u0119 kodu PECopyCodebaseItem=Kopiuj baz\u0119 kodu PEPasteCodebaseItem=Wklej baz\u0119 kodu PECopyCodebaseToClipboardItem=Kopiuj URL bazy kodu do schowka PERenameCodebase=Przemianowana baza kodu: PEPasteCodebase=Skopiowana baza kodu: PEViewMenu=Widok PECustomPermissionsItem=Uprawnienia\u00a0dostosowane... PEFileModified=Ostrze\u017cenie o modyfikacji pliku PEFileModifiedDetail=Plik wytycznej \u201e{0}\u201d zosta\u0142 zmodyfikowany od jego otwarcia. Czy chcesz go za\u0142adowa\u0107 ponownie? PEGAccesUnowenedCode=Wykonanie obcego kodu PEGMediaAccess=Dost\u0119p do medi\u00f3w PEGrightClick=Kliknij prawym klawiszem myszy, aby ro/zwin\u0105\u0107 PEGReadFileSystem=Odczyt w system PEGWriteFileSystem=Zapis w system # Policy Editor CustomPolicyViewer PECPTitle=Podgl\u0105d dostosowanych wytycznych PECPListLabel=Dalsze wytyczne dla \u201e{0}\u201d PECPAddButton=Dodaj PECPRemoveButton=Usu\u0144 PECPCloseButton=Zamknij PECPType=typ PECPTarget=cel PECPActions=akcja PECPPrompt=Podaj dostosowane uprawnienie. Pomi\u0144 \u201epermission\u201d lub znaki interpunkcji. # PolicyEditor key mnemonics. See KeyEvent.VK_* # N # R # A # C # F # I # O # S # A # X # U # conole itself labels CONSOLErungc=Uruchom od\u015bmiecanie CONSOLErunFinalizers=Uruchom finalizatory CONSOLErunningFinalizers=Wykonywanie finalizator\u00f3w.... CONSOLEmemoryInfo=Informacja o pami\u0119ci CONSOLEsystemProperties=W\u0142a\u015bciwo\u015bci systemowe CONSOLEclassLoaders=Dost\u0119pne \u0142adowarki klas CONSOLEthreadList=Lista w\u0105tk\u00f3w CONSOLEthread=W\u0105tek CONSOLEnoClassLoaders=Brak informacji o \u0142adowarkach klas CONSOLEmemoryMax=Pami\u0119\u0107 maksymalnie CONSOLEmemoryTotal=Pami\u0119\u0107 ca\u0142kowicie CONSOLEmemoryFree=Pami\u0119\u0107 dost\u0119pna CONSOLEClean=Wyczy\u015b\u0107 # console output pane labels COPsortCopyAllDate=Sortuj \u201eSkopiuj wszytko\u201d wed\u0142ug daty COPshowHeaders=Pokazuj nag\u0142\u00f3wki: COPuser=U\u017cytkownik COPorigin=Pochodzenie COPlevel=Poziom COPdate=Data COPthread1=W\u0105tek 1 COPthread2=W\u0105tek 2 COPShowMessages=Pokazuj komunikaty: COPstdOut=Standardowy strumie\u0144 wyj\u015bcia COPstdErr=Standardowy strumie\u0144 b\u0142\u0119d\u00f3w COPjava=Java COPplugin=Wtyczka COPpreInit=Przed\u00a0inicjalizacj\u0105 COPpluginOnly=Wy\u0142\u0105cznie wtyczka COPSortBy=Sortuj wed\u0142ug COPregex=Filtr wyra\u017cenia regularnego COPAsArrived=Wed\u0142ug pojawienia (bez sortowania) COPcode=Kod COPmessage=Komunikat COPSearch=Szukaj COPautoRefresh=Auto-od\u015bwie\u017canie COPrefresh=Od\u015bwie\u017c COPApply=Zastosuj COPmark=Zaznacz COPCopyAllPlain=Skopiuj wszystko (nago) COPCopyAllRich=Skopiuj wszystko (wzbogacono) COPnext=Dalej\u00a0>>> COPprevious=<<<\u00a0Wr\u00f3\u0107 COPcaseSensitive=Rozr\u00f3\u017cniaj\u00a0wielko\u015b\u0107\u00a0liter COPincomplete=Niezupe\u0142ne COPhighlight=Wyr\u00f3\u017cniaj COPwordWrap=Dziel\u00a0s\u0142owa COPdebug=Debug COPinfo=Info COPpostInit=Po\u00a0inicjalizacji COPcomplete=Zupe\u0142ne COPmatch=R\u00f3wne COPnot=Nie COPrevert=Odwrotnie COPclientApp=Aplikacja # Control Panel - DesktopShortcutPanel DSPNeverCreate=Nigdy nie tw\u00f3rz DSPAlwaysAllow=Zawsze zezwalaj DSPAskUser=Pytaj u\u017cytkownika DSPAskIfHinted=Pytaj je\u015bli sugerowane DSPAlwaysIfHinted=Zawsze je\u015bli sugerowane # Control Panel - NetworkSettingsPanel NSDescription-1=Brak ustawienia NSDescription0=Stosuj po\u0142\u0105czenia bezpo\u015bredniego. NSDescription1=Zast\u0105p ustawienia proxy przegl\u0105darki. NSDescription2=Stosuj skrypt automatycznej konfiguracji proxy z danej lokalizacji. NSDescription3=Stosuj ustawienia proxy domy\u015blnej przegl\u0105darki do \u0142\u0105czenia si\u0119 z internetem. NSAddress=Adres NSPort=Port NSAdvanced=Zaawansowane NSBypassLocal=Pomijaj serwer proxy dla adres\u00f3w lokalnych NSDirectConnection=Bezpo\u015brednie po\u0142\u0105czenie NSManualProxy=R\u0119czny serwer proxy NSAutoProxy=Skrypt automatycznej konfiguracji proxy NSBrowserProxy=Stosuj ustawienia przegl\u0105darki NSScriptLocation=Lokalizacja skryptu # Control Panel - SecurityGeneralPanel SGPAllowUserGrantSigned=Zezw\u00f3l u\u017cytkownikom udziela\u0107 uprawnienia podpisanemu materia\u0142owi SGPAllowUserGrantUntrust=Zezw\u00f3l u\u017cytkownikom udziela\u0107 uprawnienia materia\u0142owi od niezaufanego organu SGPUseBrowserKeystore=U\u017cywaj certyfikaty i klucze z bazy kluczy przegl\u0105darki (nieobs\u0142ugiwane) SGPUsePersonalCertOneMatch=Automatycznie u\u017cywaj certyfikat osobisty gdy wy\u0142\u0105cznie jeden pasuje do \u017c\u0105dania serwera (nieobs\u0142ugiwane) SGPWarnCertHostMismatch=Ostrzegaj gdy certyfikat witryny nie odpowiada nazwie komputera SGPShowValid=Pokazuj certyfikat witryny, nawet gdy jest wa\u017cny (nieobs\u0142ugiwane) SGPShowSandboxWarning=Pokazuj ostrzegawczy nag\u0142\u00f3wek piaskownicy SGPAllowUserAcceptJNLPSecurityRequests=Zezw\u00f3l u\u017cytkownikom akceptowa\u0107 \u017c\u0105dania bezpiecze\u0144stwa JNLP SGPCheckCertRevocationList=Sprawdzaj odwo\u0142anie certyfikat\u00f3w stosuj\u0105c listy odwo\u0142ania certyfikat\u00f3w (CRL) (nieobs\u0142ugiwane) SGPEnableOnlineCertValidate=W\u0142\u0105cz internetowe potwierdzanie certyfikat\u00f3w (nieobs\u0142ugiwane) SGPEnableTrustedPublisherList=W\u0142\u0105cz list\u0119 zaufanych wydawc\u00f3w (nieobs\u0142ugiwane) SGPEnableBlacklistRevocation=W\u0142\u0105cz sprawdzanie odwo\u0142ania czarnej listy (nieobs\u0142ugiwane) SGPEnableCachingPassword=W\u0142\u0105cz przechowywanie has\u0142a do uwierzytelniania (nieobs\u0142ugiwane) SGPUseSSL2=U\u017cywaj format ClientHello kompatybilny do SSL 2.0 (nieobs\u0142ugiwane) SGPUseSSL3=U\u017cywaj SSL 3.0 (nieobs\u0142ugiwane) SGPUseTLS1=U\u017cywaj TLS 1.0 (nieobs\u0142ugiwane) # Control Panel - TemporaryInternetFilesPanel TIFPEnableCache=Pozostawiaj pliki tymczasowe na moim komputerze. TIFPLocation=\u00a0Lokalizacja\u00a0 TIFPLocationLabel=Wybierz lokalizacj\u0119 sk\u0142adowania plik\u00f3w tymczasowych TIFPChange=Zmie\u0144 TIFPDiskSpace=\u00a0Miejsce\u00a0na\u00a0dysku\u00a0 TIFPCompressionLevel=Wybierz poziom kompresji plik\u00f3w JAR TIFPNone=Brak TIFPMax=Maksymalny TIFPCacheSize=Nastaw wielko\u015b\u0107 miejsca na dysku do sk\u0142adowania plik\u00f3w tymczasowych TIFPDeleteFiles=Usu\u0144 pliki TIFPViewFiles=Przegl\u0105daj pliki... TIFPFileChooserChooseButton=Wybierz # Control Panel - Cache Viewer CVCPDialogTitle=Podgl\u0105d pami\u0119ci podr\u0119cznej CVCPButRefresh=Od\u015bwie\u017c CVCPButDelete=Usu\u0144 CVCPCleanCache=Wyczy\u015b\u0107 CVCPCleanCacheTip=Niekt\u00f3re b\u0142\u0119dy mog\u0105 wyst\u0119powa\u0107 z powodu przestarza\u0142ych plik\u00f3w w pami\u0119ci podr\u0119cznej. Przed zg\u0142oszeniem b\u0142\u0119du, prosz\u0119 wyczy\u015bci\u0107 pami\u0119\u0107 podr\u0119czn\u0105 i spr\u00f3bowa\u0107 ponownie uruchomi\u0107 aplikacj\u0119.\\nPami\u0119\u0107 podr\u0119czn\u0105 mo\u017cna wyczy\u015bci\u0107 za pomoc\u0105 polecenia \u201ejavaws -Xclearcache\u201d lub w panelu IcedTea-Web poprzez \u201ePami\u0119\u0107 podr\u0119czna\u201d -> \u201ePrzegl\u0105daj pliki...\u201d -> \u201eWyczy\u015b\u0107\u201d CVCPColLastModified=Data modyfikacji CVCPColSize=Wielko\u015b\u0107 (w bajtach) CVCPColDomain=Domena CVCPColType=Typ CVCPColPath=\u015acie\u017cka CVCPColName=Nazwa # Control Panel - Misc. CPJRESupport=IcedTea-Web obecnie nie obs\u0142uguje stosowania wielu \u015brodowisk uruchomieniowych Java (JRE). CPInvalidPort=Podano nieprawid\u0142owy numer portu.\n[Prawid\u0142owe numery portu s\u0105 1-65535] CPInvalidPortTitle=B\u0142\u0105d przy wczytywaniu. # command line control panel CLNoInfo=Brak informacji (czy ta opcja jest prawid\u0142owa?). CLValue=Warto\u015b\u0107: {0} CLValueSource=Pochodzi z: {0} CLDescription=Opis: {0} CLUnknownCommand=Nie rozpoznano rozkazu \u201e{0}\u201d. CLUnknownProperty=Nieznana nazwa w\u0142a\u015bciwo\u015bci \u201e{0}\u201d CLWarningUnknownProperty=UWAGA: W\u0142a\u015bciwo\u015b\u0107 \u201e{0}\u201d jest nieznana, utworzono now\u0105 w\u0142a\u015bciwo\u015b\u0107 CLNoIssuesFound=Nie znaleziono \u017cadnych problem\u00f3w. CLIncorrectValue=W\u0142a\u015bciwo\u015b\u0107 \u201e{0}\u201d zawiera nieprawid\u0142ow\u0105 warto\u015b\u0107 \u201e{1}\u201d. Mo\u017cliwe warto\u015bci {2} CLListDescription=Pokazuje list\u0119 z wszystkimi nazwami i warto\u015bciami w\u0142a\u015bciwo\u015bci, kt\u00f3re s\u0105\nprzestrzegane przez IcedTea-Web. CLGetDescription=Pokazuje warto\u015b\u0107 property-name CLSetDescription=Ustawia warto\u015b\u0107 w\u0142a\u015bciwo\u015bci property-name, je\u015bli to mo\u017cliwe.\nWarto\u015b\u0107 podlega analizie prawid\u0142owo\u015bci. Je\u015bli administrator zablokowa\u0142 t\u0119\nw\u0142a\u015bciwo\u015b\u0107, ustawianie nie b\u0119dzie mia\u0142o efektu. CLResetDescription=Przywraca warto\u015b\u0107 domy\u015bln\u0105 dla w\u0142a\u015bciwo\u015bci property-name.\nall przywraca warto\u015bci domy\u015blne dla wszystkich w\u0142a\u015bciwo\u015bci przestrzeganych\nprzez IcedTea-Web. CLInfoDescription=Pokazuje wi\u0119cej informacji o podanej w\u0142a\u015bciwo\u015bci CLCheckDescription=Pokazuje w\u0142a\u015bciwo\u015bci kt\u00f3re zdefiniowano, lecz nie s\u0105 przestrzegane przez\nIcedTea-Web. CLHelpDescription=Za pomoc\u0105 narz\u0119dzia itweb-settings u\u017cytkownik mo\u017ce modyfikowa\u0107, przegl\u0105da\u0107 i\nsprawdza\u0107 konfiguracj\u0119. Aby u\u017cy\u0107 interfejsu graficznego, nie podawaj \u017cadnych\nargument\u00f3w. Aby u\u017cy\u0107 trybu wiersza polece\u0144, podaj w\u0142a\u015bciwy rozkaz i parametry.\n\u201e{0} rozkaz help\u201d udziela pomocy dla szczeg\u00f3lnego rozkazu. # splash screen related SPLASHerror=Kliknij tu aby uzyska\u0107 szczeg\u00f3\u0142y. Wyst\u0105pi\u0142 powa\u017cny wyj\u0105tek. SPLASH_ERROR=B\u0141\u0104D SPLASHtitle=Tytu\u0142 SPLASHvendor=Dostawca SPLASHhomepage=Witryna SPLASHdescription=Opis SPLASHClose=Zamknij SPLASHclosewAndCopyException=Zamknij i kopiuj \u015blad stosu do schowka SPLASHexOccured=Wyst\u0105pi\u0142 powa\u017cny wyj\u0105tek... SPLASHHome=Pocz\u0105tek SPLASHcantCopyEx=Nie mo\u017cna skopiowa\u0107 wyj\u0105tku SPLASHnoExRecorded=Nie odnotowano wyj\u0105tku SPLASHmainL1=Aby uzyska\u0107 wi\u0119cej informacji wejd\u017a na stron\u0119 {0} i zastosuj tam opisane kroki aby pozyska\u0107 informacje niezb\u0119dne do z\u0142o\u017cenia raportu o b\u0142\u0119dzie w programie. SPLASHmainL3=Brak dodatkowych informacji, spr\u00f3buj uruchomi\u0107 przegl\u0105dark\u0119 z wiersza polece\u0144 i przeanalizowa\u0107 dane wyj\u015bciowe. SPLASHcloseAndCopyShorter=Zamknij i kopiuj do schowka SPLASHmainL4=Wyst\u0105pi\u0142 nast\u0119puj\u0105cy wyj\u0105tek. Aby uzyska\u0107 wi\u0119cej informacji, spr\u00f3buj uruchomi\u0107 przegl\u0105dark\u0119 z wiersza polece\u0144 i przeanalizowa\u0107 dane wyj\u015bciowe. SPLASHexWas=Wyj\u0105tek: SPLASHcfl=Brak dost\u0119pu za pomoc\u0105 odno\u015bnika do SPLASHvendorsInfo=Informacje od dostawcy twojej aplikacji SPLASHanotherInfo=Inna dost\u0119pna informacja SPLASHdefaultHomepage=Brak witryny, sprawd\u017a raczej \u017ar\u00f3d\u0142o SPLASHerrorInInformation=Wyst\u0105pi\u0142 b\u0142\u0105d w trakcie \u0142adowania elementu \u201einformation\u201d, sprawd\u017a raczej \u017ar\u00f3d\u0142o SPLASHmissingInformation=Brak elementu \u201einformation\u201d, sprawd\u017a raczej \u017ar\u00f3d\u0142o SPLASHchainWas=To jest lista wyj\u0105tk\u00f3w kt\u00f3re wyst\u0105pi\u0142y w trakcie startowania applet-u. Prosz\u0119 zauwa\u017cy\u0107, \u017ce wyj\u0105tki te mog\u0105 pochodzi\u0107 z r\u00f3\u017cnych applet-\u00f3w. Aby uzyska\u0107 po\u017cyteczny raport o b\u0142\u0119dzie w programie, upewnij si\u0119 aby wykonywano wy\u0142\u0105cznie jeden applet. APPEXTSECappletSecurityLevelExtraHighId=Wy\u0142\u0105cz uruchamianie wszystkich applet-\u00f3w Java APPEXTSECappletSecurityLevelVeryHighId=Bardzo wysokie bezpiecze\u0144stwo APPEXTSECappletSecurityLevelHighId=Wysokie bezpiecze\u0144stwo APPEXTSECappletSecurityLevelLowId=Niskie bezpiecze\u0144stwo APPEXTSECappletSecurityLevelExtraHighExplanation=\u017baden applet nie b\u0119dzie uruchamiany APPEXTSECappletSecurityLevelVeryHighExplanation=Wy\u0142\u0105cznie podpisane applet-y b\u0119d\u0105 uruchamianie APPEXTSECappletSecurityLevelHighExplanation=U\u017cytkownik b\u0119dzie pytany dla ka\u017cdego applet-u APPEXTSECappletSecurityLevelLowExplanation=Wszystkie applet-y b\u0119d\u0105 uruchamianie, nawet niepodpisane APPEXTSECunsignedAppletActionAlways=Zawsze ufaj tym (zaznaczonym) applet-om APPEXTSECunsignedAppletActionNever=Nigdy nie ufaj tym (zaznaczonym) applet-om APPEXTSECunsignedAppletActionYes=Wizytowano i zezwolono temu applet-owi APPEXTSECunsignedAppletActionNo=Wizytowano i odm\u00f3wiono zezwolenia temu applet-owi APPEXTSECControlPanelExtendedAppletSecurityTitle=Rozszerzone bezpiecze\u0144stwo applet-\u00f3w APPEXTSECguiTableModelTableColumnAction=Akcja APPEXTSECguiTableModelTableColumnDateOfAction=Data akcji APPEXTSECguiTableModelTableColumnDocumentBase=Baza dokumentu APPEXTSECguiTableModelTableColumnCodeBase=Baza kodu APPEXTSECguiTableModelTableColumnArchives=Archiwa APPEXTSECguiPanelAppletInfoHederPart1={0} {1} APPEXTSECguiPanelAppletInfoHederPart2={0} od {1} APPEXTSECguiPanelConfirmDeletionOf=Czy na pewno chcesz usun\u0105\u0107 nast\u0119puj\u0105ce pozycje: {0}? APPEXTSECguiPanelHelpButton=Pomoc APPEXTSECguiPanelSecurityLevel=Poziom bezpiecze\u0144stwa APPEXTSECguiPanelGlobalBehaviourCaption=Ustawienia systemowe post\u0119powania przy obs\u0142udze applet-\u00f3w APPEXTSECguiPanelDeleteMenuSelected=Zaznaczone APPEXTSECguiPanelDeleteMenuAllA=Wszystkie dozwolone (A) APPEXTSECguiPanelDeleteMenuAllN=Wszystkie zabronione (N) APPEXTSECguiPanelDeleteMenuAlly=Wszystkie zatwierdzone (y) APPEXTSECguiPanelDeleteMenuAlln=Wszystkie odrzucone (n) APPEXTSECguiPanelDeleteMenuAllAll=Bezwzgl\u0119dnie wszystkie APPEXTSECguiPanelDeleteButton=Usu\u0144 APPEXTSECguiPanelDeleteButtonToolTip=Naciskaj\u0105c klawisz DEL, podczas przegl\u0105dania tabeli, mo\u017cesz usun\u0105\u0107 zaznaczone wpisy APPEXTSECguiPanelTestUrlButton=Testuj URL APPEXTSECguiPanelAddRowButton=Dodaj now\u0105 linijk\u0119 APPEXTSECguiPanelValidateTableButton=Sprawd\u017a tabel\u0119 APPEXTSECguiPanelAskeforeActionBox=Pytaj przed akcj\u0105 APPEXTSECguiPanelShowRegExesBox=W pe\u0142ni pokazuj wyra\u017cenia regularne APPEXTSECguiPanelInverSelection=Odwr\u00f3\u0107 zaznaczenia APPEXTSECguiPanelMoveRowUp=Przesu\u0144 linijk\u0119 w g\u00f3r\u0119 APPEXTSECguiPanelMoveRowDown=Przesu\u0144 linijk\u0119 w d\u00f3\u0142 APPEXTSECguiPanelCustomDefs=Definicje u\u017cytkownika APPEXTSECguiPanelGlobalDefs=Definicje systemowe APPEXTSECguiPanelDocTest=Wpisz URL bazy dokumentowej APPEXTSECguiPanelCodeTest=Wpisz URL bazy kodu APPEXTSECguiPanelNoMatch=Nie znaleziono hase\u0142 APPEXTSECguiPanelMatchingNote=Tylko pierwsze znalezione has\u0142o b\u0119dzie uwzgl\u0119dniane w rezultacie. APPEXTSECguiPanelMatched=Znaleziono APPEXTSECguiPanelMatchingError=B\u0142\u0105d podczas wyszukiwania: {0} APPEXTSECguiPanelCanNotValidate=Nie mo\u017cna potwierdzi\u0107, poniewa\u017c nie mo\u017cna utworzy\u0107 pliku tymczasowego \u201e{0}\u201d. APPEXTSECguiPanelEmptyDoc=Wszystkie bazy dokumentowe musz\u0105 by\u0107 wype\u0142nione APPEXTSECguiPanelEmptyCode=Wszystkie bazy kodu musz\u0105 by\u0107 wype\u0142nione APPEXTSECguiPanelTableValid=Tabela wygl\u0105da w porz\u0105dku APPEXTSECguiPanelTableInvalid=Tabela niepoprawna z powodu nast\u0119puj\u0105cego b\u0142\u0119du: {0} APPEXTSECguiPanelShowOnlyPermanent=Pokazuj wy\u0142\u0105cznie wpisy sta\u0142e APPEXTSECguiPanelShowOnlyTemporal=Pokazuj wy\u0142\u0105cznie wpisy tymczasowo zadecydowane APPEXTSECguiPanelShowAll=Pokazuj wszystkie wpisy APPEXTSECguiPanelShowOnlyPermanentA=Pokazuj wy\u0142\u0105cznie zezwolone wpisy sta\u0142e APPEXTSECguiPanelShowOnlyPermanentN=Pokazuj wy\u0142\u0105cznie zabronione wpisy sta\u0142e APPEXTSECguiPanelShowOnlyTemporalY=Pokazuj poprzednio zezwolone wpisy applet-\u00f3w APPEXTSECguiPanelShowOnlyTemporalN=Pokazuj poprzednio odm\u00f3wione wpisy applet-\u00f3w APPEXTSEChelpHomeDialogue=Dialog icedtea-web-1.6.2/netx/net/sourceforge/jnlp/resources/PaxHeaders.17941/Messages_de.properties0000644000000000000000000000013212654402377027046 xustar0030 mtime=1454507263.288431901 30 atime=1454507327.136580377 30 ctime=1454507658.740157877 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/resources/Messages_de.properties0000644000175000002070000021105012654402377027570 0ustar00jvanekmock00000000000000# German UI messages for netx # # All messages are formatted using Java's java.text.MessageFormat class. # Apostrophe characters ' need to be escaped by using two: '' # Curly brackets need to be escaped by surrounding them with single apostrophes '{' '{hello}' # # L=Launcher, B=Boot, P=Parser, C=cache S=security # # General NullParameter=Nullparameter ButAllow=Zulassen ButBrowse=Durchsuchen... ButCancel=\ Abbrechen ButClose=Schlie\u00dfen ButAdvancedOptions=Fortgeschrittene\u00a0Optionen ButCopy=In die Zwischenablage kopieren ButMoreInformation=Weitere\u00a0Informationen... ButOk=OK ButProceed=Fortfahren ButRun=Ausf\u00fchren ButSandbox=Sandkasten ButApply=Anwenden ButDone=Fertig ButShowDetails=Details zeigen ButHideDetails=Details verbergen ButYes=Ja ButNo=Nein BUTControlledBy=Gesteuert durch {0} BUTmodified=modifiziert CertWarnRunTip=Diesem Applet vertrauen und mit vollen Berechtigungen ausf\u00fchren CertWarnSandboxTip=Diesem Applet nicht vertrauen und mit eingeschr\u00e4nkten Berechtigungen ausf\u00fchren CertWarnCancelTip=Dieses Applet nicht ausf\u00fchren CertWarnPolicyTip=Erweiterte Sandkasten-Einstellungen CertWarnPolicyEditorItem=Richtlinieneditor starten CertWarnHTTPSAcceptTip=Dieses Zertifikat akzeptieren und der HTTPS-Verbindung vertrauen CertWarnHTTPSRejectTip=Dieses Zertifikat nicht akzeptieren und keine HTTPS-Verbindung aufbauen AFileOnTheMachine=eine Datei auf dem Rechner AlwaysAllowAction=Diese Aktion immer zulassen AlwaysForbidAction=Diese Aktion immer verbieten Usage=Gebrauch: Error=Fehler Warning=Warnung Continue=Soll fortgefahren werden? Field=Feld From=Von Name=Name Password=Kennwort: Publisher=Herausgeber Unknown= Username=Benutzername: Value=Wert Version=Version # about dialogue AboutDialogueTabAbout=\u00dcber AboutDialogueTabAuthors=Autoren AboutDialogueTabChangelog=\u00c4nderungsprotokoll AboutDialogueTabNews=Neuigkeiten AboutDialogueTabGPLv2=GPLv2 # version check minidialogue JREversionDontMatch=Warnung: Die angeforderte JRE \u201e{1}\u201c stimmt nicht mit der vorhandenen JRE \u201e{0}\u201c \u00fcberein JREContinueDialogSentence2=Soll Ausf\u00fchrung fortgesetzt werden? JREContinueDialogSentenceTitle=Inkompatible JRE # missing permissions dialogue MissingPermissionsMainTitle=Der Anwendung \u201e{0}\u201c \ mit der Codebasis \u201e{1}\u201c fehlt das Attribut \u201epermission\u201c. \ Anwendungen ohne dieses Attribut sollte nicht vertraut werden.
\ Soll die Ausf\u00fchrung dieser Anwendung zugelassen werden? MissingPermissionsInfo=Um weitere Informationen zu erhalten siehe:
\ \ JAR File Manifest Attributes
\ und
\ \ Preventing the repurposing of Applications # missing Application-Library-Allowable-Codebase dialogue ALACAMissingMainTitle=Die Anwendung \u201e{0}\u201c \ mit der Codebasis \u201e{1}\u201c l\u00e4dt die folgenden Ressourcen von einer fremden Dom\u00e4ne:
\ {2}
\ Soll diese Anwendung wirklich ausgef\u00fchrt werden? ALACAMissingInfo=Um weitere Informationen zu erhalten siehe:
\ \ JAR File Manifest Attributes
\ und
\ \ Preventing the Repurposing of an Application # matching Application-Library-Allowable-Codebase dialogue ALACAMatchingMainTitle=Die Anwendung \u201e{0}\u201c \ mit der Codebasis \u201e{1}\u201c l\u00e4dt die folgenden Ressourcen von einer fremden Dom\u00e4ne:
\ {2}
\ Es ist richtig. Soll diese Anwendung wirklich ausgef\u00fchrt werden? ALACAMatchingInfo=Um weitere Informationen zu erhalten siehe:
\ \ JAR File Manifest Attributes
\ und
\ \ Preventing the Repurposing of an Application MACDisabledMessage=Die Pr\u00fcfung von Manifestattributen ist deaktiviert. MACCheckSkipped=Die Pr\u00fcfung von \u201e{0}\u201c wurde ausgelassen, da die Eigenschaft \u201edeployment.manifest.attributes.check\u201c weder den Wert \u201eALL\u201c hat, noch ihr Wert aus einer Kombination mit \u201e{1}\u201c besteht. # LS - Severity LSMinor=Gering LSFatal=Fatal # LC - Category LCSystem=Systemfehler LCExternalLaunch=Externer Startfehler LCFileFormat=Dateiformatfehler LCReadError=Lesefehler LCClient=Anwendungsfehler LCLaunching=Startfehler LCNotSupported=Nicht unterst\u00fctztes Feature LCInit=Initialisierungsfehler LAllThreadGroup=Alle JNLP Anwendungen LNullUpdatePolicy=Aktualisierungsrichtlinie darf nicht null sein. LThreadInterrupted=Ausf\u00fchrungsstrang unterbrochen, w\u00e4hrend auf den Start der Datei gewartet wird. LThreadInterruptedInfo=Dies kann zum Einfrieren oder sonstigen Sch\u00e4den w\u00e4hrend der Ausf\u00fchrung f\u00fchren. Bitte die Anwendung oder den Web-Browser neustarten. LCouldNotLaunch=Konnte JNLP-Datei nicht starten. LCouldNotLaunchInfo=Die Anwendung war nicht initialisiert. Um detailierte Informationen zu erhalten k\u00f6nnen javaws oder der Web-Browser von der Befehlszeile aus gestartet werden und die Textausgabe in einem Fehlerbericht gesendet werden. LCantRead=Konnte die JNLP-Datei nicht lesen oder die Syntax analysieren. LCantReadInfo=Die Datei kann m\u00f6glicherweise manuell heruntergeladen und als Fehlerbericht an das IcedTea-Web Team gesendet werden. LNullLocation=Konnte den Ort der .jnlp Datei nicht bestimmen. LNullLocationInfo=Es wurde versucht eine JNLP-Datei in einer anderen JVM zu starten, aber die Datei konnte am Ort nicht ermittelt werden. Um in einer externen JVM zu starten, muss die Laufzeitumgebung in der Lage sein die .jnlp Datei entweder auf dem lokalen Dateisystem oder einem Server zu ermitteln. LNetxJarMissing=Konnte den Ort von netx.jar nicht bestimmen. LNetxJarMissingInfo=Ein wurde versucht eine JNLP-Datei in einer anderen JVM zu starten, aber das netx.jar konnte am Ort nicht ermittelt werden. Um in einer externen JVM zu starten, muss die Laufzeitumgebung in der Lage sein das netx.jar zu ermitteln. LNotToSpec=JNLP-Datei nicht strikt nach Spezifikation. LNotToSpecInfo=Die JNLP-Datei enth\u00e4lt Daten, die nach JNLP Spezifikation verboten sind. Die Laufzeitumgebung kann versuchen die ung\u00fcltigen Information zu ignorieren und die Datei zu starten fortfahren. LNotApplication=Keine Anwendungsdatei. LNotApplicationInfo=Es wurde versucht eine Nichtanwendungsdatei als eine Anwendung zu laden. LNotApplet=Keine Applet-Datei. LNotAppletInfo=Es wurde versucht eine Nichtappletdatei als ein Applet zu laden. LNoInstallers=Installer werden nicht unterst\u00fctzt. LNoInstallersInfo=JNLP Installerdateien werden noch nicht unterst\u00fctzt. LInitApplet=Konnte Applet nicht initialisieren. LInitAppletInfo=Um weitere Information zu erhalten, bitte den Knopf \u201eWeitere Informationen\u201c klicken. LInitApplication=Konnte Anwendung nicht initialisieren. LInitApplicationInfo=Die Anwendung war nicht initialisiert. Um weitere Informationen zu erhalten kann javaws von der Befehlszeile aus ausgef\u00fchrt werden. LNotLaunchable=Keine startbare JNLP-Datei. LNotLaunchableInfo=Datei muss ein JNLP Anwendungs-, Applet- oder Installertyp sein. LCantDetermineMainClass=Unbekannte Hauptklasse. LCantDetermineMainClassInfo=Konnte die Hauptklasse f\u00fcr diese Anwendung nicht bestimmen. LUnsignedJarWithSecurity=Kann nicht signierten JARs keine Berechtigungen gew\u00e4hren. LUnsignedJarWithSecurityInfo=Anwendung hat Sicherheitsberechtigungen angefordert, aber JARs sind nicht signiert. LSignedJNLPAppDifferentCerts=Die JNLP Anwendung ist nicht vollst\u00e4ndig durch ein einzelnes Zertifikat signiert. LSignedJNLPAppDifferentCertsInfo=Der JNLP Anwendung wurden ihre Komponenten individuell signiert, jedoch muss es einen gemeinsamen Unterzeichner zu allen Eintr\u00e4gen geben. LUnsignedApplet=Das Applet war nicht signiert. LUnsignedAppletPolicyDenied=Das Applet war nicht signiert, deshalb wurde es an der Ausf\u00fchrung durch die Sicherheitsrichtlinie gehindert. LUnsignedAppletUserDenied=Das Applet war nicht signiert und nicht vertrauensw\u00fcrdig. LPartiallySignedApplet=Das Applet wurde teilweise signiert. LPartiallySignedAppletUserDenied=Das Applet wurde teilweise signiert und ihm wurde nicht vertraut. LSignedAppJarUsingUnsignedJar=Signierte Anwendung nutzt nicht signierte JARs. LSignedAppJarUsingUnsignedJarInfo=Das Haupt-JAR der Anwendung ist signiert, aber manche JARs, die sie nutzt, nicht. LRunInSandboxError=Ausf\u00fchren im Sandkasten-Aufruf wurde zu sp\u00e4t ausgef\u00fchrt. LRunInSandboxErrorInfo=Der Klassenlader wurde benachrichtigt das Applet im Sandkasten auszuf\u00fchren, aber die Sicherheitseinstellungen waren bereits initialisiert. LSignedJNLPFileDidNotMatch=Die signierte JNLP-Datei stimmt nicht mit der startenden JNLP-Datei \u00fcberein. LNoSecInstance=Fehler: Keine Sicherheitsinstanz f\u00fcr {0}. Die Anwendung k\u00f6nnte Schwierigkeiten haben fortzufahren LCertFoundIn={0} in cacerts gefunden ({1}) LSingleInstanceExists=Eine andere Instanz dieses Applets existiert bereits und nur eine kann zur selben Zeit ausgef\u00fchrt werden. JNotApplet=Datei ist kein Applet. JNotApplication=Datei ist keine Anwendung. JNotComponent=Datei ist keine Komponente. JNotInstaller=Datei ist kein Installer. JInvalidExtensionDescriptor=Erweiterung verweist nicht auf eine Komponente oder einen Installer (Name={1}, Ort={2}). LNotVerified=JARs nicht verifiziert. LCancelOnUserRequest=Abgebrochen auf Anfrage des Benutzers. LFatalVerification=W\u00e4hrend des Versuchs, JARs zu verifizieren, ist ein fataler Fehler aufgetreten. LFatalVerificationInfo=Eine Ausnahme in der Klasse JarCertVerifier wurde abgefangen. Die Unlesbarkeit der Dateien cacerts oder trusted.certs k\u00f6nnte eine Ursache dieser Ausnahmen sein. LNotVerifiedDialog=Nicht alle JARs konnten verifiziert werden. LAskToContinue=Soll die Ausf\u00fchrung dieser Anwendung dennoch fortgesetzt werden? # Parser PInvalidRoot=Der Wurzelknoten ist nicht das Element jnlp PNoResources=Kein Element resources angeben PUntrustedNative=Das Element nativelib kann nicht angegeben werden sofern eine vertrauensw\u00fcrdige Umgebung angefordert wird. PExtensionHasJ2SE=Das Element j2se kann nicht in einer Komponentenerweiterungsdatei angegeben werden. PInnerJ2SE=Das Element j2se kann nicht innerhalb eines j2se-Elements angegeben werden. PTwoMains=Doppeltes main JAR in einem resources-Element definiert (es kann nur eins geben) PNativeHasMain=Das Attribut main darf nicht am Element nativelib angeben werden PNoInfoElement=Kein Element information angegeben PMissingTitle=Titel PMissingVendor=Lieferant PMissingElement=Der Abschnitt {0} wurde f\u00fcr das aktive Gebietsschema nicht definiert, noch existiert ein Standardwert in der JNLP-Datei. PTwoDescriptions=Doppelte Elemente description mit Attribut kind {0} sind nicht erlaubt. PSharing=Das Element \u201esharing-allowed\u201c ist in einer Standard-JNLP-Datei nicht erlaubt PTwoSecurity=Nur ein Element security pro JNLP-Datei zugelassen. PEmptySecurity=Security-Element angegeben, enth\u00e4lt aber das Element permissions nicht. PTwoDescriptors=Nur ein Element application-desc pro JNLP-Datei zugelassen. PTwoDesktops=Nur ein Element desktop zugelassen PTwoMenus=Nur ein Element menu zugelassen PTwoTitles=Nur ein Element title zugelassen PTwoIcons=Nur ein Element icon zugelassen PTwoUpdates=Nur ein Element update ist zugelassen PUnknownApplet=Unbekanntes Applet PBadWidth=Ung\u00fcltige Appletbreite. PBadHeight=Ung\u00fcltige Appleth\u00f6he. PUrlNotInCodebase=Relative URL gibt kein Unterverzeichnis der Codebasis an. (Knoten={0}, href={1}, Basis={2}) PBadRelativeUrl=Ung\u00fcltige relative URL (Knoten={0}, href={1}, Basis={2}) PBadNonrelativeUrl=Ung\u00fcltige nicht-relative URL (Knoten={0}, href={1}) PNeedsAttribute=Das {0} Element muss ein {1} Attribut angeben. PBadXML=Ung\u00fcltige XML Dokumentsyntax. PBadHeapSize=Ung\u00fcltiger Wert f\u00fcr die Gr\u00f6\u00dfe des dynamischen Speichers ({0}) # Runtime BLaunchAbout=Das Fenster \u201e\u00dcber IcedTea-Web\u201c wird ge\u00f6ffnet... BLaunchAboutFailure=Konnte das \u201e\u00dcber\u201c-Fenster nicht starten BNeedsFile=Muss eine .jnlp Datei angeben RNoAboutJnlp=Es ist nicht m\u00f6glich about.jnlp zu finden BFileLoc=JNLP-Dateiort BBadProp=Falsches Eigenschaftformat {0} (sollte Schl\u00fcssel=Wert sein) BBadParam=Falsches Parameterformat {0} (sollte Name=Wert sein) BNoDir=Verzeichnis {0} existiert nicht. BNoCodeOrObjectApplet=Die Auszeichnung applet muss ein Attribut ''code'' oder ''object'' angegeben. RNoResource=Fehlende Ressource: {0} RShutdown=Diese Ausnahme um Herunterfahren der JVM zu verhindern, aber der Prozess wurde terminiert. RExitTaken=Ausstiegsklasse bereits gesetzt und Aufrufender ist keine Ausstiegsklasse. RCantReplaceSM=Wechseln des SecurityManager ist nicht zugelassen. RCantCreateFile=Kann Datei {0} nicht erstellen RCantDeleteFile=Kann Datei {0} nicht l\u00f6schen RCantOpenFile=Konnte die Datei \u201e{0}\u201c nicht \u00f6ffnen RCantWriteFile=Konnte in die Datei \u201e{0}\u201c nicht schreiben RFileReadOnly=\u00d6ffnen der Datei im Schreibschutzmodus RExpectedFile=Erwartete von \u201e{0}\u201c eine Datei zu sein, war es aber nicht RRemoveRPermFailed=Entfernen der Leseberechtigung f\u00fcr Datei {0} schlug fehl RRemoveWPermFailed=Entfernen der Schreibberechtigungen f\u00fcr Datei {0} schlug fehl RRemoveXPermFailed=Entfernen der Ausf\u00fchrberechtigungen f\u00fcr Datei {0} schlug fehl RGetRPermFailed=Erwerben der Leseberechtigungen f\u00fcr Datei {0} schlug fehl RGetWPermFailed=Erwerben der Schreibberechtigungen f\u00fcr Datei {0} schlug fehl RGetXPermFailed=Erwerben der Ausf\u00fchrberechtigungen f\u00fcr Datei {0} schlug fehl RCantCreateDir=Kann Verzeichnis {0} nicht erstellen RCantRename=Kann {0} nicht in {1} umbenennen RDenyStopped=Angehaltene Anwendungen haben keine Berechtigungen. RExitNoApp=Kann die JVM nicht beenden, da die gegenw\u00e4rtige Anwendung nicht bestimmt werden kann. RNoLockDir=Kann Ausschlussverzeichnis nicht erstellen ({0}) RNestedJarExtration=Kann verschachteltes JAR nicht extrahieren. RUnexpected=Unerwartetes {0} bei {1} RConfigurationError=Fataler Fehler beim Lesen der Konfiguration. Fahre fort mit leer. Bitte reparieren RConfigurationFatal=FEHLER: Ein fataler Fehler ist beim Laden der Konfiguration aufgetreten. Vielleicht war eine globale Konfiguration erforderlich, konnte jedoch nicht gefunden werden RFailingToDefault=Versage auf Standardkonfiguration RPRoxyPacNotSupported=Die Verwendung von Autoproxykonfigurationsdateien (PAC) wird nicht unterst\u00fctzt. RProxyFirefoxNotFound=Es ist nicht m\u00f6glich Firefoxs Proxyeinstellungen zu verwenden. Nutze \u201eDIRECT\u201c als Proxytyp. RProxyFirefoxOptionNotImplemented=Browserproxyoption \u201e{0}\u201c ({1}) wird noch nicht unterst\u00fctzt. RBrowserLocationPromptTitle=Browserort RBrowserLocationPromptMessage=Bitte den Ort des Browsers angeben RBrowserLocationPromptMessageWithReason=Bitte den Ort des Browsers angeben (der Browserbefehl \u201e{0}\u201c ist ung\u00fcltig). HTMLnoneFound=Es wurde kein Applet auf dieser HTML-Seite gefunden (unterst\u00fctzt werden die Elemente \u201eOBJECT\u201c, \u201eEMBED\u201c und \u201eAPPLET\u201c). # icedtea-web man (note, spaces are important due to man pages markup ITWintroL1=Mit {0} wird ein Browser Plug-in als freie Software angeboten, mit dem in Java geschriebene Applets ausgef\u00fchrt werden k\u00f6nnen, sowie eine Implementierung von \u201eJava Web Start\u201c, urspr\u00fcnglich auf dem NetX-Projekt basierend. ITWintroL2=NetX erm\u00f6glicht das Herunterladen, die Zwischenspeicherung und die Ausf\u00fchrung von Java-Applets und Anwendungen in einer sicheren Sandkastenumgebung (Standardeinstellung). Bei nachfolgenden Starts eines Applets wird die jeweils neueste Version automatisch heruntergeladen. Mit dem Befehl \u201eitw-settings\u201c k\u00f6nnen unter anderem Aktualisierungs- sowie Sicherheitseinstellungen gesetzt werden. ITWintroL3=\u201e{0}\u201c enth\u00e4lt ebenfalls ein Plug-in f\u00fcr \u201e{1}\u201c in Webbrowsern. ITWintroUrlCaption=Java-Applets aktivieren BFileInfoAuthors=Die Namen sowie E-Mail Adressen der an diesem Projekt Mitwirkenden wurden in der im Stammverzeichnis von IcedTea-Web befindenden Datei AUTHORS hinterlegt. BFileInfoCopying=Eine vollst\u00e4ndige Ausfertigung der GPLv2 Lizenz dieses Projekts wurde in der im Stammverzeichnis von IcedTea-Web befindenden Datei COPYING hinterlegt. BFileInfoNews=Neuigkeiten \u00fcber die Ver\u00f6ffentlichungen dieses Projekts k\u00f6nnen der im Stammverzeichnis von IcedTea-Web befindenden Datei NEWS entnommen werden. ITWdescO1title=Modularit\u00e4t ITWdescO1text=Einfaches Hinzuf\u00fcgen von JNLP-Merkmalen zu einer Anwendung. ITWdescO2title=Reduzierter Arbeitsspeicherverbrauch ITWdescO2text=Starten von Programmen in einer gemeinsamen Java-VM ITWdescO3title=Schnellstart ITWdescO3text=Anwendungen aus einem Zwischenspeicher f\u00fcr schnelles Starten ausf\u00fchren ITWdescO4title=Sicherheit ITWdescO4text=Eine beliebige Anwendung in einer Sandkastenumgebung ausf\u00fchren oder deren T\u00e4tigkeit protokollieren ITWdescO5title=Automatische Aktualisierung ITWdescO5text=Anwendungen ohne zus\u00e4tzlichen Code automatisch aktualisieren ITWdescO6title=Bereitstellung im Netzwerk ITWdescO6text=Ohne Installer im Internet bereitstellen ITWdescO7title=Quelloffenheit ITWdescO7text=GNU Lesser General Public License ITWdescL1=Um weitere Informationen einzuholen, k\u00f6nnen das {0} oder insbesondere die {1} besucht werden. ITWdescWikiUrlTitle=IcedTea-Projektwiki ITWdescItwWikiUrlTitle=IcedTea-Web-Hauptseite ITWdescL2=Hilfe zu allgemeinen Problemen mit IcedTea-Web ist {0} zu finden. ITWdescIssuesUrlTitle=hier ITWdescL3=Merkmale von NetX: ITWoptionsL1=Eine {0}anleitung f\u00fcr das IcedTea Projekt ist im Wiki verf\u00fcgbar. ITWoptionsQuickStartUrlCaption=Schnellstart ITWoptionsCodeUrlUrlCaption=Codestil ITWoptionsL2={0}-Richtlinien und Instruktionen zu {1} f\u00fcr IcedTea-Web sind ebenfalls verf\u00fcgbar. Patches sollten Modultests und {2} beiliegen bevor sie an die {3} gesendet werden. ITWoptionsEclipseUrlCaption=Eclipse-Einstellungen ITWoptionsReproducersUrlCaption=Reproduzierer ITWoptionsDistroUrlCaption=Mailingliste ITWoptionsL3=Beitr\u00e4ge: # policyeditor man (note, spaces (especially the one around markup) are important due to man pages markup). Only bold tag is now recognized by ReplacingTextFormatter. PEintro=\ \u2014 Einstellungen der Sicherheitsrichtlinie f\u00fcr javaws und das Browser Plug-in anzeigen und bearbeiten PEsynopseP1=Richtliniendatei PEsynopseP2=URL PEdescL1=ist eine Anwendung mit grafischer Benutzeroberfl\u00e4che sowie ein wenig Kommandozeilenunterst\u00fctzung. Die Anwendung erm\u00f6glicht die Anzeige und Bearbeitung von Sicherheitsrichtlinieneinstellungen f\u00fcr Applets, die durch die Implementierungen von javaws und des Browser Plug-ins in IcedTea-Web verwendet werden. Sie ist als eine vereinfachte und leichter zu nutzende Alternative zum JDK Policy Tool gedacht. Administratoren und fortgeschrittene Benutzer, die eine fein granulare Kontrolle \u00fcber Richtliniendateien brauchen, sollten das policytool statt des PolicyEditor verwenden. PEdescL2=Werden keine Parameter bei der Ausf\u00fchrung angegeben, so wird keine Datei ge\u00f6ffnet, und eine Aufforderung zur Angabe des Speicherortes erscheint. Wird ansonsten ein Dateipfad als Parameter an der Kommandozeile angegeben, so wird der Dateipfand ge\u00f6ffnet und als eine Richtliniendatei verarbeitet. PEexampleL1=Zeigt den GUI-Editor mit der ge\u00f6ffneten Standardrichtliniendatei an. PEexampleL2=Zeigt den GUI-Editor ohne eine ge\u00f6ffnete Datei an. # javaws man (note, spaces (especially the one around markup) are important due to man pages markup). Only bold tag is now recognized by ReplacingTextFormatter. JWSintro=\ \u2014 ein Java Web Start Klient JWSdescL1=ist eine Implementierung eines JNLP-Klients. Sie verwendet eine JNLP-Datei (Java Network Launch Protocol) um eine Java-Anwendung oder ein Applet sicher auszuf\u00fchren. \ Diese Implementierung von {0} basiert auf dem NetX Projekt und wird durch das IcedTea Projekt vertrieben. JWSdescL2=Eine JNLP-Datei ist eine XML-Datei mit einer Beschreibung zur sicheren Ausf\u00fchrung einer Java-Anwendung oder eines Applets. JWSoptionsL1=Bei der Angabe von Optionen muss der Name der JNLP-Datei als letzter Parameter an javaws \u00fcbergeben werden. Alle Optionen m\u00fcssen ihm vorausgehen. JWSoptionsL2=Die JNLP-Datei kann entweder eine URL oder ein lokaler Pfad sein. JWSoptionsTitle1=Ausf\u00fchrungsoptionen: JWSoptionsTitle2=Steuerungsoptionen: JWSexampleL1=Zeigt grundlegende Hilfehinweise und Versionsinformationen an. JWSexampleL2=Zeigt grundlegende Hilfehinweise und Versionsinformationen ausschlie\u00dflich im Terminal an. JWSexampleL3=Startet die Anwendung \u201e{0}\u201c, urspr\u00fcnglich aus \u201e{1}\u201c, ohne sie herunterzuladen, ohne die Metadaten von JAR-Dateien zu pr\u00fcfen sowie zwingend in einer einzigen VM. # Boot options, message should be shorter than this ----------------> BOUsage=javaws [-Ausf\u00fchrungsoptionen] BOUsage2=javaws [-Steuerungsoptionen] BOJnlp=Ort der zu startenden JNLP-Datei (URL oder Datei). BOHtml=Ort der zu startenden HTML-Datei (URL oder Datei).\nAn diese Option kann \u201eALL\u201c oder eine Aneinanderreihung von\nZahlen, z.B. "1 2 5", \u00fcbergeben werden, um Applets einer Seite zur\nAusf\u00fchrung auszuw\u00e4hlen. Diese Funktion ist in der Erprobung, jedoch\nsicher. BOArg=F\u00fcgt einen Anwendungsparameter vor dem Start hinzu. BOParam=F\u00fcgt einen Appletparameter vor dem Start hinzu. BOProperty=Setzt eine Systemeigenschaft vor dem Start. BOUpdate=Pr\u00fcfe auf Aktualisierungen. BOLicense=Die GPL Lizenz zeigen und beenden. BOVerbose=Ausf\u00fchrliche Ausgabe aktivieren. BOAbout=Zeigt eine Beispielanwendung. BOVersion=Version von IcedTea-Web ausgeben und beenden. BONosecurity=Deaktiviert die sichere Laufzeitumgebung. BONoupdate=Deaktiviert die Pr\u00fcfung nach Aktualisierungen. BOHeadless=Deaktiviert Herunterladefenster und andere Benutzeroberfl\u00e4chen. BOStrict=Aktiviert die strikte Pr\u00fcfung des JNLP-Dateiformats. BOViewer=Zeigt die Ansicht der vertrauensw\u00fcrdigen Zertifikate. BOXml=Verwendet einen strikten XML-Parser f\u00fcr die JNLP-Datei. BOredirect=Folgt HTTP-Umlenkungen. BXnofork=Keine weitere JVM erstellen. BXclearcache=Den JNLP-Anwendungszwischenspeicher s\u00e4ubern. BXignoreheaders=Die Pr\u00fcfung der Metadaten von JAR-Dateien auslassen. BXoffline=Deaktiviert den Netzwerkzugriff von IcedTea-Web. Ausschlie\u00dflich der Zwischenspeicher wird verwendet. Anwendungen k\u00f6nnen weiterhin auf das Netzwerk zugreifen. BOHelp1=Gibt Informationen \u00fcber unterst\u00fctzte Befehle und grundlegende Verwendung aus. BOHelp2=Gibt Informationen \u00fcber unterst\u00fctzte Befehle und grundlegende Verwendung aus. Wird ein Befehl als Parameter angegeben, dann wird eine detaillierte Beschreibung des Befehls ausgegeben. BOTrustnone=Alle Benutzeraufforderungen werden mit \u201eNein\u201c beantwortet. # Itweb-settings boot commands IBOList=Zeigt eine Liste aller IcedTea-Web Einstellungen und deren aktuelle Werte an. IBOGet=Zeigt den Wert der angegebenen Einstellungen an. IBOInfo=Zeigt zus\u00e4tzliche Informationen \u00fcber die angegebenen Einstellungen an, inklusive einer Beschreibung des aktuellen Werts, der zul\u00e4ssigen Werte sowie des Ursprungs der Einstellung. IBOSet=Setzt die Einstellungen auf den neuen angegebenen Wert, vorausgesetzt der Wert ist zul\u00e4ssig. IBOResetAll=Setzt alle Einstellungen auf ihre urspr\u00fcnglichen Werte zur\u00fcck. IBOReset=Setzt die angegebenen Einstellungen auf ihren urspr\u00fcnglichen Wert zur\u00fcck. IBOCheck=\u00dcberpr\u00fcft alle Einstellungen auf G\u00fcltigkeit der Werte. PBOFile=Gibt den Pfad der zu \u00f6ffnenden Richtliniendatei an. Falls genau ein \ Parameter \u00fcbergeben wird, der nicht diese Option ist, wird er als ein zu \ \u00f6ffnender Dateipfad interpretiert, so als ob diese Option als erste angegeben \ werden w\u00e4re. Diese Option ist haupts\u00e4chlich aus Kompatibilit\u00e4tsgr\u00fcnden zum \ Richtlinieneditor policytool verf\u00fcgbar, wird aber auch zum \u00d6ffnen \ einer Richtliniendatei sowie mit der Option \u201e-codebase\u201c verwendet. PBOCodebase=Gibt die Codebasis-URL eines Applets an. Falls die angegebene \ Codebasis in der Richtliniendatei bereits existiert, wird diese im \ ge\u00f6ffneten Editor markiert. Falls die Codebasis neu ist, wird diese zur \ Richtliniendatei hinzugef\u00fcgt und im ge\u00f6ffneten Editor markiert. An die Option \ \u201e-codebase\u201c k\u00f6nnen auch mehrere, durch Leerzeichen getrennte URLs \ \u00fcbergeben werden. In diesem Fall werden alle Codebasen zur Richtliniendatei \ hinzugef\u00fcgt und die letzte im ge\u00f6ffneten Editor markiert. Ausschlie\u00dflich die \ erste in der Kommandozeile vorkommende Option \u201e-codebase\u201c wird \ verarbeitet. # Option Parser OPUnevenParams=F\u00fcr die Option \u201e{0}\u201c wurde eine gerade Anzahl von Parametern erwartet. # NumberOfArguments descriptions. NOAnone=Kein Parameter erwartet NOAone=Genau ein Parameter erwartet NOAonemore=Ein oder mehrere Parameter erwartet NOAevennumber=Eine gerade Anzahl von Parametern mit \u201eParameter=Wert\u201c als g\u00fcltigen Parameter erwartet # Allowed man sections manNAME=NAME manSYNOPSIS=\u00dcBERSICHT manDESCRIPTION=BESCHREIBUNG manOPTIONS=OPTIONEN manCOMMANDS=BEFEHLE manEXAMPLES=BEISPIELE manFILES=DATEIEN manBUGS=FEHLER manAUTHOR=AUTOR manSEE_ALSO=SIEHE AUCH # Cache CAutoGen=Automatisch generiert - Nicht bearbeiten! CNotCacheable={0} ist keine zwischenspeicherbare Ressource CDownloading=Herunterladen CComplete=Vollst\u00e4ndig CChooseCache=Ein Zwischenspeicherverzeichnis w\u00e4hlen... CChooseCacheInfo=Netx ben\u00f6tigt einen Ort zur Ablage von Zwischenspeicherdateien. CChooseCacheDir=Zwischenspeicherverzeichnis CCannotClearCache=Der Zwischenspeicher kann zur Zeit nicht geleert werden, vielleicht sp\u00e4ter. Wenn das Problem bestehen bleibt, kann versucht werden den Browser und die JNLP-Anwendeungen zu schlie\u00dfen. Am Ende kann man versuchen alle Java-Anwendungen zu terminieren. \\\n Der Zwischenspeicher kann mit javaws -Xclearcache oder \u00fcber itw-settings Zwischenspeicher/Dateien anzeigen.../Leeren geleert werden. CFakeCache=Der Zwischenspeicher ist durcheinander; wird geordnet. CFakedCache=Der Zwischenspeicher war durcheinander und wurde geordnet. Es wird strengstens empfohlen, dass \u201ejavaws -Xclearcache\u201c und anschlie\u00dfend die Anwendung ausgef\u00fchrt wird. Es kann ebenso \u00fcber itw-settings Zwischenspeicher/Dateien anzeigen.../Leeren verwendet werden. # extended access warning pane EXAWdesktopWants=Symbolverkn\u00fcpfung auf dem Desktop (durch die Anwendung vorgesehen). EXAWdesktopDontWants=Symbolverkn\u00fcpfung auf dem Desktop (durch die Anwendung nicht vorgesehen, aber auf Benutzeranforderung m\u00f6glich). EXAWsubmenu=Symbolverkn\u00fcpfung im Men\u00fc (Anwendung wird versuchen im Untermen\u00fc \u201e{0}\u201c anzulegen). EXAWmenuWants=Symbolverkn\u00fcpfung im Men\u00fc (durch die Anwendung vorgesehen). EXAWmenuDontWants=Symbolverkn\u00fcpfung im Men\u00fc (durch die Anwendung nicht vorgesehen, aber auf Benutzeranforderung m\u00f6glich). EXAWsettingsInfo=\u201e{0}\u201c ist eingestellt. Es kann \u00fcber das Panel \u201e{1}\u201c in itweb-settings ge\u00e4ndert werden. EXAWsettingsManage=Bestehende Men\u00fceintr\u00e4ge k\u00f6nnen \u00fcber das Panel \u201e{0}\u201c in itweb-settings verwaltet werden. EXAWrememberByApp=Per Anwendung merken EXAWrememberByPage=Per Dom\u00e4ne merken EXAWdontRemember=Nicht merken EXAWrememberByAppTooltip=Diese Anwendung wird nie nach weiteren Berechtigungen fragen EXAWrememberByPageTooltip=Alle Anwendungen in dieser Dom\u00e4ne werden nicht mehr nach Berechtigungen fragen, sondern die bestehenden Berechtigungen verwenden EXAWdontRememberTooltip=Die Entscheidung wird ausschlie\u00dflich f\u00fcr diese Berechtigung und die Dauer dieser Ausf\u00fchrung verwendet EXAWbrowser=Browserdesktopelement EXAWgenjnlp=JNLP-Generiert EXAWjnlphref=jnlp href EXAWhtml=javaws html EXAWfixhref=Probleme in jnlp-href beheben EXAWbrowserTolltip=Browser-Verkn\u00fcpfung
\
  • Diese Option erstellt eine Verkn\u00fcpfung, die den Browser mit der aktuell geladenen Seite \u00f6ffnet
  • \
  • Falls der Browser den Offlinebetrieb unterst\u00fctzt, ist dies die sicherste Option
  • EXAWbrowsersTolltip=Ein Browser, der zum Start dieses Applets (im IcedTea-Web Plug-in ausgef\u00fchrt) verwendet wird
    \
  • Der Standardbrowser war voreingestellt
  • \
  • Das Einf\u00fcgen eines beliebigen bevorzugten Browsers steht frei
  • EXAWgeneratedTolltip=
  • Eine JNLP-Datei wird aus der aktuellen HTML-Seite erzeugt
  • \
  • Die Symbolverkn\u00fcpfung startet javaws mit dieser JNLP-Datei
  • \
  • Das Applet wird au\u00dferhalb des Browsers ausgef\u00fchrt

  • \ Diese Funktion ist in der Erprobung, funktioniert aber erstaunlich gut. EXAWhrefTolltip=Manche Applets verweisen lediglich auf eine JNLP-Datei, welche die eigentlichen Informationen \u00fcber die Ressourcen dieser Anwendung enth\u00e4lt.
    \
  • Diese Option speichert diese JNLP-Datei f\u00fcr sp\u00e4tere Starts
  • \
  • Die JNLP-Datei wird mit javaws gestartet und das Applet au\u00dferhalb des Browsers ausgef\u00fchrt

  • \ Diese Funktion ist in der Erprobung und funktioniert nicht richtig. EXAWhtmlTolltip=Unter Verwendung des Schalters \u201e-html\u201c kann versucht werden die HTML-Seite zu analysieren, das Applet zu extrahieren und es au\u00dferhalb des Browsers zu starten.
    \ Diese Funktion ist in der Erprobung. EXAWfixTolltip=Manche von einem Applet verwiesene JNLP-Dateien wurden nicht als JNLP-Anwendungen erstellt oder vorgesehen
    \
  • Dies f\u00fcgt dieser JNLP-Datei bekannte, oft fehlende Elemente hinzu (wenn sie fehlen)
  • # Security SFileReadAccess=Die Anwendung hat Lesezugriff auf {0} angefordert. Soll diese Aktion zugelassen werden? SFileWriteAccess=Die Anwendung hat Schreibzugriff auf {0} angefordert. Soll diese Aktion zugelassen werden? SDesktopShortcut=Die Anwendung hat die Berechtigung eine Verkn\u00fcpfung auf dem Desktop zu erstellen angefordert. Soll diese Aktion zugelassen werden? SSigUnverified=Die digitale Signatur der Anwendung kann nicht verifiziert werden. Soll die Anwendung zur Ausf\u00fchrung gebracht werden? Sie erh\u00e4lt unbeschr\u00e4nkten Zugriff auf den Computer. SSigVerified=Die digitale Signatur der Anwendung wurde verifiziert. Soll die Anwendung zur Ausf\u00fchrung gebracht werden? Sie erh\u00e4lt unbeschr\u00e4nkten Zugriff auf den Computer. SSignatureError=Die digitale Signatur der Anwendung hat einen Fehler. Soll die Anwendung zur Ausf\u00fchrung gebracht werden? Sie erh\u00e4lt unbeschr\u00e4nkten Zugriff auf den Computer. SUntrustedSource=Die digitale Signatur konnte nicht durch eine vertrauensw\u00fcrdige Quelle verifiziert werden. Die Anwendung sollte nur zur Ausgef\u00fchrung gebracht werden, wenn der Ursprung der Anwendung vertrauensw\u00fcrdig ist. SWarnFullPermissionsIgnorePolicy=Dem ausgef\u00fchrten Code werden volle Berechtigungen erteilt, wobei jedwede Java-Richtlinien, die eingerichtet sein k\u00f6nnten, ignoriert werden. STrustedSource=Die digitale Signatur wurde durch eine vertrauensw\u00fcrdige Quelle best\u00e4tigt. SClipboardReadAccess=Die Anwendung hat den ausschlie\u00dflichen Lesezugriff auf die Systemzwischenablage angefordert. Soll diese Aktion zugelassen werden? SClipboardWriteAccess=Die Anwendung hat den ausschlie\u00dflichen Schreibzugriff auf die Systemzwischenablage angefordert. Soll diese Aktion zugelassen werden? SPrinterAccess=Die Anwendung hat den Druckerzugriff angefordert. Soll diese Aktion zugelassen werden? SNetworkAccess=Die Anwendung hat die Berechtigung Verbindungen zu {0} herzustellen angefordert. Soll diese Aktion zugelassen werden? SNoAssociatedCertificate= SUnverified=(nicht verifiziert) SAlwaysTrustPublisher=Dem Inhalt von diesem Herausgeber immer vertrauen SHttpsUnverified=Das HTTPS Zertifikat dieser Website kann nicht verifiziert werden. SRememberOption=Soll diese Option gespeichert werden? SRememberAppletOnly=F\u00fcr Applet SRememberCodebase=F\u00fcr Website {0} SUnsignedSummary=Eine nicht signierte Java Anwendung m\u00f6chte zur Ausf\u00fchrung gebracht werden. SUnsignedDetail=Eine nicht signierte Anwendung am folgenden Ort m\u00f6chte zur Ausf\u00fchrung gebracht werden:
      {0}
    Seite, welche die Anforderung gestellt hat:
      {1}

    Es wird empfohlen, ausschlie\u00dflich Anwendungen zur Ausf\u00fchrung zu bringen, die von vertrauensw\u00fcrdigen Websites stammen. SUnsignedAllowedBefore=Dieses Applet wurde bereits akzeptiert ({0}). SUnsignedRejectedBefore=Dieses Applet wurde bereits abgelehnt ({0}). SUnsignedQuestion=Soll dem Applet die Ausf\u00fchrung erlaubt werden? SPartiallySignedSummary=Nur Teile des Anwendungscodes sind signiert. SPartiallySignedDetail=Diese Anwendung enth\u00e4lt sowohl signierten als auch nicht signierten Code. W\u00e4hrend signierter Code sicher ist, wenn Sie dem Anbieter vertrauen, kann nicht signierter Code sich \u00fcber Code erstrecken, der sich der Kontrolle des Anbieters entzieht. SPartiallySignedQuestion=Soll fortgefahren und diese Anwendung dennoch zur Ausf\u00fchrung gebracht werden? SAuthenticationPrompt=Der Server {0} von {1} fordert Authentifizierung an. Er sagt: \u201e{2}\u201c SJNLPFileIsNotSigned=Die Anwendung enth\u00e4lt eine digitale Signatur in der, die startende JNLP-Datei nicht signiert ist. STrustedOnlyAttributeFailure=Diese Anwendung gibt true f\u00fcr Trusted-only in ihrem Manifest an. {0} und fordert Berechtigungsstufe: {1}. Dies ist nicht erlaubt. STOAsignedMsgFully=Das Applet ist vollst\u00e4ndig signiert STOAsignedMsgAndSandbox=Das Applet ist vollst\u00e4ndig signiert und im Sandkasten STOAsignedMsgPartiall=Das Applet ist nicht vollst\u00e4ndig signiert STempNetwork=Ein- und ausgehende Netzwerkverbindungen zulassen STempReadFilesAndProperties=Ausschlie\u00dflich Lesezugriff auf alle Dateien und Eigenschaften STempWriteFilesAndProperties=Ausschlie\u00dflich Schreibzugriff auf alle Dateien und Eigenschaften STempReflectionAndExternal=Java-Introspektion und externer Codezugriff STempAllMedia=Alle Medien (Drucken, Audio, Zwischenablage) # Security - used for the More Information dialog SBadKeyUsage=Ressourcen enthalten Eintr\u00e4ge, deren Signaturzertifikaterweiterung KeyUsage die Codesignatur nicht zul\u00e4sst. SBadExtendedKeyUsage=Ressourcen enthalten Eintr\u00e4ge, deren Signaturzertifikaterweiterung ExtendedKeyUsage die Codesignatur nicht zul\u00e4sst. SBadNetscapeCertType=Ressourcen enthalten Eintr\u00e4ge, deren Signaturzertifikaterweiterung NetscapeCertType die Codesignatur nicht zul\u00e4sst. SHasExpiredCert=Die digitale Signatur ist abgelaufen. SHasExpiringCert=Ressourcen enthalten Eintr\u00e4ge, deren Signaturzertifikat innerhalb von 6 Monaten ablaufen wird. SNotYetValidCert=Ressourcen enthalten Eintr\u00e4ge, deren Signaturzertifikat noch nicht g\u00fcltig ist. SUntrustedCertificate=Die digitale Signatur wurde mit einem nicht vertrauensw\u00fcrdigen Zertifikat generiert. STrustedCertificate=Die digitale Signatur wurde mit einem vertrauensw\u00fcrdigen Zertifikat generiert. SCNMisMatch=Der erwartete Hostname f\u00fcr dieses Zertifikat ist: \u201e{0}\u201c
    Die Adresse zu der verbunden wird ist: \u201e{1}\u201c SRunWithoutRestrictions=Diese Anwendung wird ohne die von Java normalerweise gebotenen Sicherheitsbeschr\u00e4nkungen ausgef\u00fchrt werden. SCertificateDetails=Zertifikatdetails # Security - certificate information SIssuer=Aussteller SSerial=Seriennummer SMD5Fingerprint=MD5 Fingerabdruck SSHA1Fingerprint=SHA1 Fingerabdruck SSignature=Signatur SSignatureAlgorithm=Signaturalgorithmus SSubject=Inhaber SValidity=G\u00fcltigkeit # Certificate Viewer CVCertificateViewer=Zertifikate CVCertificateType=Zertifikattyp CVDetails=Details CVExport=Exportieren CVExportPasswordMessage=Kennwort eingeben, um Schl\u00fcsseldatei zu sch\u00fctzen: CVImport=Importieren CVImportPasswordMessage=Kennwort eingeben, um auf Datei zuzugreifen: CVIssuedBy=Ausgestellt von CVIssuedTo=Ausgestellt f\u00fcr CVPasswordTitle=Authentifizierung erforderlich CVRemove=Entfernen CVRemoveConfirmMessage=Soll das markierte Zertifikat wirklich entfernt werden? CVRemoveConfirmTitle=Zertifikat entfernen CVUser=Benutzer CVSystem=System # KeyStores: see KeyStores.java KS=Schl\u00fcsselspeicher KSCerts=Vertrauensw\u00fcrdige Zertifikate KSJsseCerts=Vertrauensw\u00fcrdige JSSE Zertifikate KSCaCerts=Vertrauensw\u00fcrdige Stammzertifizierungsstellenzertifikate KSJsseCaCerts=Vertrauensw\u00fcrdige JSSE Stammzertifizierungsstellenzertifikate KSClientCerts=Clientauthentifizierungszertifikate # Deployment Configuration messages DCIncorrectValue=Die Eigenschaft \u201e{0}\u201c hat den falschen Wert \u201e{1}\u201c. M\u00f6gliche Werte {2}. DCInternal=Interner Fehler: {0} DCSourceInternal= DCUnknownSettingWithName=Die Eigenschaft \u201e{0}\u201c ist unbekannt. DCmaindircheckNotexists=Nach allen Versuchen, das Benutzerkonfigurationsverzeichnis \u201e{0}\u201c existiert nicht. DCmaindircheckNotdir=Das Benutzerkonfigurationsverzeichnis \u201e{0}\u201c ist kein Verzeichnis. DCmaindircheckRwproblem=Schreib- oder Lesefehler beim Zugriff auf das Benutzerkonfigurationsverzeichnis \u201e{0}\u201c. # Value Validator messages. Messages should follow "Possible values ..." VVPossibleValues=M\u00f6gliche Werte {0} VVPossibleBooleanValues=sind {0} oder {1} VVPossibleFileValues=sind ein absoluter Pfad zu einer Datei oder einem Verzeichnis VVPossibleRangedIntegerValues=liegen im Bereich von {0} bis {1} (inklusive) VVPossibleUrlValues=sind jede g\u00fcltige URL (z.B. http://icedtea.classpath.org/hg/) # Control Panel - Main CPMainDescriptionShort=IcedTea-Web Konfigurieren CPMainDescriptionLong=Konfiguriert, wie das Browser-Plugin (IcedTeaNPPlugin) und javaws (NetX) arbeiten # Control Panel - Tab Descriptions CPAboutDescription=Versionsinformationen \u00fcber die IcedTea Systemsteuerung anzeigen. CPNetworkSettingsDescription=Netzwerkeinstellungen konfigurieren, inklusive wie IcedTea-Web sich mit dem Internet verbindet und ob Proxys verwendet werden. CPTempInternetFilesDescription=Java h\u00e4lt Anwendungsdaten f\u00fcr eine schnellere Ausf\u00fchrung beim n\u00e4chsten Start vor. CPJRESettingsDescription=Java Runtime Environment Versionen und Einstellungen zu Java Anwendungen sowie Applets anzeigen und verwalten. CPCertificatesDescription=Nutzen Sie Zertifikate um sich erfolgreich auszuweisen sowie die Identit\u00e4t von Zertifikatinhabern, Zertifizierungsstellen und Herausgebern festzustellen. CPSecurityDescription=Dies zur Konfiguration von Sicherheitseinstellungen nutzen. CPDebuggingDescription=Hier Optionen aktivieren um bei der Fehlerbeseitigung zu helfen CPDesktopIntegrationDescription=Die Erstellung von Desktopverkn\u00fcpfungen zulassen oder verhindern. CPJVMPluginArguments=JVM-Parameter f\u00fcr das Plug-in setzen. CPJVMitwExec=Eine JVM f\u00fcr IcedTea-Web einstellen, welche am besten mit OpenJDK funktioniert CPJVMitwExecValidation=JVM f\u00fcr IcedTea-Web pr\u00fcfen CPJVMPluginSelectExec=Nach JVM f\u00fcr IcedTea-Web durchsuchen CPJVMnone=Kein Pr\u00fcfergebnis f\u00fcr CPJVMvalidated=Pr\u00fcfergebnis f\u00fcr CPJVMvalueNotSet=Kein Wert angegeben. Die fest eincodierte JVM wird verwendet. CPJVMnotLaunched=Fehler: Der Prozess wurde nicht gestartet. F\u00fcr weitere Informationen, bitte die Konsolenausgabe beachten. CPJVMnoSuccess=Der Prozess wurde mit einem Fehler beendet. Bitte die Ausgabe f\u00fcr weitere Details beachten. Die Java-Laufzeitumgebung ist nicht korrekt eingestellt. CPJVMopenJdkFound=Exzellent, OpenJDK wurde erkannt CPJVMoracleFound=Gro\u00dfartig, Oracle Java wurde erkannt CPJVMibmFound=Gut, IBM Java wurde erkannt CPJVMgijFound=Warnung, gij wurde erkannt CPJVMstrangeProcess=Der Pfad hatte einen ausf\u00fchrbaren Prozess, aber dies wurde nicht erkannt. Bitte die Java-Version anhand der Konsolenausgabe \u00fcberpr\u00fcfen. CPJVMnotDir=Fehler: Der gew\u00e4hlte Pfad ist kein Verzeichnis. CPJVMisDir=Der gew\u00e4hlte Pfad ist ein Verzeichnis. CPJVMnoJava=Fehler: Das gew\u00e4hlte Verzeichnis enth\u00e4lt bin/java nicht. CPJVMjava=Das gew\u00e4hlte Verzeichnis enth\u00e4lt bin/java. CPJVMnoRtJar=Fehler: Das gew\u00e4hlte Verzeichnis enth\u00e4lt lib/rt.jar nicht. CPJVMrtJar=Das Verzeichnis enth\u00e4lt lib/rt.jar. CPJVMPluginAllowTTValidation=JRE sofort pr\u00fcfen CPJVMNotokMessage1=Es wurde der ung\u00fcltige JDK-Wert
    • {0}
    mit folgender Fehlermeldung eingegeben: CPJVMNotokMessage2=M\u00f6gliche Gr\u00fcnde f\u00fcr diese Meldung sind:
    * Einige Pr\u00fcftests wurden nicht bestanden
    * Es wurde kein OpenJDK erkannt
    Wegen eines ungeeigneten JDKs wird IcedTea-Web wahrscheinlich nicht starten k\u00f6nnen.
    Die Eigenschaft {0} in der Konfigurationsdatei
    • {1}
    m\u00fcsste angepasst oder entfernt werden.
    Es wird empfohlen nach OpenJDK auf diesem System zu suchen. CPJVMconfirmInvalidJdkTitle=Ungeeignetes JDK CPJVMconfirmReset=Auf Standard zur\u00fccksetzen? CPPolicyDetail=Die Java-Richtliniendatei des aktuellen Benutzers anschauen und bearbeiten.
    Dies erlaubt Laufzeitberechtigungen an Applets zu gew\u00e4hren oder abzulehnen, unabh\u00e4ngig von den Sandbox-Standardsicherheitsregeln. CPPolicyTooltip=\u00d6ffnet \u201e{0}\u201c im Richtlinieneditor (policytool) CPPolicyEditorNotFound=Konnte keinen Richtlinieneditor finden. Es sollte gepr\u00fcft werden, dass policytool \u00fcber die Umgebungsvariable PATH aufgel\u00f6st werden kann. # Control Panel - Buttons CPButAbout=\u00dcber... CPButNetworkSettings=Netzwerkeinstellungen... CPButSettings=Einstellungen... CPButView=Anzeigen... CPButCertificates=Zertifikate... CPButSimpleEditor=Einfacher Editor... CPButAdvancedEditor=Erweiterter Editor... # Control Panel - Headers CPHead=IcedTea-Web Systemsteuerung CPHeadAbout=\u00a0\u00dcber\u00a0IcedTea-Web\u00a0 CPHeadNetworkSettings=\u00a0Netzwerkproxyeinstellungen\u00a0 CPHeadTempInternetFiles=\u00a0Tempor\u00e4re\u00a0Internetdateien\u00a0 CPHeadJRESettings=\u00a0Java\u00a0Runtime\u00a0Environment\u00a0Einstellungen\u00a0 CPHeadCertificates=\u00a0Zertifikate\u00a0 CPHeadDebugging=\u00a0Fehlerbeseitigungseinstellungen\u00a0 CPHeadDesktopIntegration=\u00a0Desktopintegration\u00a0 CPHeadSecurity=\u00a0Sicherheitseinstellungen\u00a0 CPHeadJVMSettings=\u00a0JVM\u00a0Einstellungen\u00a0 CPHeadPolicy=\u00a0Benutzerdefinierte\u00a0Richtlinieneinstellungen\u00a0 # Control Panel - Tabs CPTabAbout=\u00dcber IcedTea-Web CPTabCache=Zwischenspeicher CPTabCertificate=Zertifikate CPTabClassLoader=Klassenlader CPTabDebugging=Fehlerbeseitigung CPTabDesktopIntegration=Desktopintegration CPTabMenuShortcuts=Installierte Men\u00fcverkn\u00fcpfungen CPTabNetwork=Netzwerk CPTabRuntimes=Laufzeitumgebungen CPTabSecurity=Sicherheit CPTabJVMSettings=JVM Einstellungen CPTabPolicy=Richtlinieneinstellungen # Control Panel - AboutPanel CPAboutInfo=Diese Systemsteuerung dient der Einstellung von deployment.properties.
    Nicht alle Optionen haben eine Wirkung, bis Sie implementiert wurden.
    Die Verwendung mehrerer JREs ist derzeit auf OpenJDK beschr\u00e4nkt.
    # Control Panel - AdvancedProxySettings APSDialogTitle=Netzwerkeinstellungen APSServersPanel=Server APSProxyTypeLabel=Typ APSProxyAddressLabel=Proxyadresse APSProxyPortLabel=Proxyanschluss APSLabelHTTP=HTTP APSLabelSecure=Gesichert APSLabelFTP=FTP APSLabelSocks=Socks APSSameProxyForAllProtocols=Denselben Proxyserver f\u00fcr alle Protokolle verwenden. APSExceptionsLabel=Ausnahmen APSExceptionsDescription=Keinen Proxyserver f\u00fcr Adressen verwenden, die damit beginnen APSExceptionInstruction=Trennen Sie jeden Eintrag mit einem Semikolon (;). # Control Panel - DebugginPanel CPDebuggingPossibilites=Protokollausgabe DPEnableLogging=Protokollierung aktivieren DPEnableLoggingHint=Wenn dieser Schalter gesetzt ist, dann werden ebenfalls Meldungen zur Fehlerbeseitigung protokolliert. Dies ist gleichbedeutend zu -verbose oder ICEDTEAPLUGIN_DEBUG=true. DPEnableHeaders=Tabellen\u00fcberschriften aktivieren DPEnableHeadersHint=Wenn dieser Schalter gesetzt ist, wird jede protokollierte Meldung mit zus\u00e4tzlichen \u00dcberschriften, wie Benutzer, Quellcodezeile und Zeit versehen. DPEnableFile=Protokollierung in Datei aktivieren CPFilesLogsDestDir=Protokolldateiverzeichnis CPFilesLogsDestDirResert=Standard DPEnableFileHint=Ausgabemeldungen werden in eine Datei im Verzeichnis \u201e{0}\u201c gespeichert DPEnableStds=Protokollierung auf Standardausgabe aktivieren DPEnableStdsHint=Meldungen werden auf der Standardausgabe ausgegeben DPEnableSyslog=Protokollierung in das Systemprotokoll aktivieren DPEnableSyslogHint=Ausgabemeldungen werden im Systemprotokoll gespeichert DPDisable=Deaktivieren DPHide=Beim Start verbergen DPShow=Beim Start anzeigen DPShowPluginOnly=Beim Start des Plug-ins anzeigen DPShowJavawsOnly=Beim Start von javaws anzeigen DPJavaConsole=Javakonsole DPJavaConsoleDisabledHint=Die Javakonsole ist deaktiviert. Mit itweb-settings kann sie von \u201eDeaktiviert\u201c auf einen beliebigen Anzeige- oder Verborgenheitswert konfiguriert werden. # PolicyEditor PETitle=PolicyEditor PETitleWithPath=PolicyEditor \u2014 {0} PETitleWithChangesMade={0} * PEReadProps=Systemeigenschaften lesen PEReadPropsDetail=Applets das Lesen von Systemeigenschaften, wie den aktuellen Benutzernamen und den Ort des Benutzerverzeichnisses erlauben PEWriteProps=Systemeigenschaften schreiben PEWritePropsDetail=Applets das (\u00dcber)schreiben von Systemeigenschaften erlauben PEReadFiles=Aus lokalen Dateien lesen PEReadFilesDetail=Applets das Lesen aus Dateien im aktuellen Benutzerverzeichnis erlauben PEWriteFiles=In lokale Dateien schreiben PEWriteFilesDetail=Applets das Schreiben in Dateien im Benutzerverzeichnis des aktuellen Benutzers erlauben PEDeleteFiles=Lokale Dateien l\u00f6schen PEDeleteFilesDetail=Applets das L\u00f6schen von Dateien im Benutzerverzeichnis des aktuellen Benutzers erlauben PEReadSystemFiles=Alle Systemdateien lesen PEReadSystemFilesDetail=Applets ausschlie\u00dflichen Lesezugriff auf alle Orte im Computer erlauben PEWriteSystemFiles=Alle Systemdateien schreiben PEWriteSystemFilesDetail=Applets ausschlie\u00dflichen Schreibzugriff auf alle Orte im Computer erlauben PEReadTempFiles=Aus tempor\u00e4ren Dateien lesen PEReadTempFilesDetail=Applets das Lesen aus dem Verzeichnis tempor\u00e4rer Dateien des aktuellen Benutzers erlauben PEWriteTempFiles=In tempor\u00e4re Dateien schreiben PEWriteTempFilesDetail=Applets das Schreiben in das Verzeichnis tempor\u00e4rer Dateien des aktuellen Benutzers erlauben PEDeleteTempFiles=Tempor\u00e4re Dateien l\u00f6schen PEDeleteTempFilesDetail=Applets das L\u00f6schen von Dateien im Verzeichnis tempor\u00e4rer Dateien des aktuellen Benutzers erlauben PEAWTPermission=Fenstersystemzugriff PEAWTPermissionDetail=Applets den vollen Zugriff auf das AWT Fenstersystem erlauben PEClipboard=Zugriff auf die Zwischenablage PEClipboardDetail=Applets das Lesen und Schreiben der Zwischenablage des aktuellen Benutzers erlauben PENetwork=Netzwerkzugriff PENetworkDetail=Applets die Herstellung von beliebigen Netzwerkverbindungen erlauben PEPrint=Dokumente drucken PEPrintDetail=Applets das Einreihen von Druckauftr\u00e4gen erlauben PEPlayAudio=Kl\u00e4nge abspielen PEPlayAudioDetail=Applets das Abspielen von Kl\u00e4ngen, ohne Aufnahme erlauben PERecordAudio=Ton aufnehmen PERecordAudioDetail=Applets die Tonaufnahme, ohne Abspielen erlauben PEReflection=Java-Introspektion PEReflectionDetail=Applets den Zugriff auf die Java Reflection API erlauben PEClassLoader=Klassenlader abrufen PEClassLoaderDetail=Applets den Zugriff auf den Systemklasslader (oft bei Introspektion verwendet) erlauben PEClassInPackage=Zugriff auf fremde Pakete PEClassInPackageDetail=Applets den Zugriff auf Klassen in fremden Applet-Paketen (oft bei Introspektion verwendet) erlauben PEDeclaredMembers=Zugriff auf private Daten einer Klasse PEDeclaredMembersDetail=Applets den Zugriff auf gekapselte Daten (oft bei Introspektion verwendet) erlauben PEAccessThreads=Ausf\u00fchrungsstr\u00e4nge \u00e4ndern PEAccessThreadsDetail=Applets den Start, Stopp sowie anderweitige Verwaltung von Ausf\u00fchrungsstr\u00e4ngen erlauben PEAccessThreadGroups=Ausf\u00fchrungsstranggruppen \u00e4ndern PEAccessThreadGroupsDetail=Applets den Start, Stopp sowie anderweitige Verwaltung von Ausf\u00fchrungsstranggruppen erlauben PEExec=Befehle ausf\u00fchren PEExecDetail=Applets die Ausf\u00fchrung von Systembefehlen erlauben PEGetEnv=Umgebungsvariablen abrufen PEGetEnvDetail=Applets das Lesen von Systemumgebungsvariablen erlauben PECouldNotOpen=Kann die Richtliniendatei nicht \u00f6ffnen PECouldNotSave=Kann die Richtliniendatei nicht speichern PEAddCodebase=Neue Codebasis hinzuf\u00fcgen PERemoveCodebase=Entfernen PECodebasePrompt=Eine neue Codebasis eingeben: PEGlobalSettings=Alle Applets PESaveChanges=Sollen die \u00c4nderungen vor dem Beenden gespeichert werden? PEChangesSaved=\u00c4nderungen gespeichert PECheckboxLabel=Berechtigungen PECodebaseLabel=Codebasen PEFileMenu=Datei PENewMenuItem=Neu PEOpenMenuItem=\u00d6ffnen... PEOpenDefaultMenuItem=Standardrichtliniendatei \u00f6ffnen PESaveMenuItem=Speichern PESaveAsMenuItem=Speichern unter... PEExitMenuItem=Beenden PECodebaseMenu=Codebasis PEAddCodebaseItem=Hinzuf\u00fcgen... PERemoveCodebaseItem=Entfernen PERenameCodebaseItem=Umbenennen PECopyCodebaseItem=Kopieren PEPasteCodebaseItem=Einf\u00fcgen... PERenameCodebase=Codebasis umbenennen in: PEPasteCodebase=Kopierte Codebasis einf\u00fcgen als: PEViewMenu=Ansicht PECustomPermissionsItem=Benutzerdefinierte Berechtigungen... PEFileModified=Datei\u00e4nderungswarnung PEFileModifiedDetail=Die Richtliniendatei \u201e{0}\u201c wurde ge\u00e4ndert seit sie ge\u00f6ffnet wurde.\nNeu laden und bearbeiten vor dem Speichern? PEFileMissing=Die Richtliniendatei war nicht gespeichert. Eine neue Datei mit demselben Namen wurde gespeichert. PEGAccesUnowenedCode=Fremden Code ausf\u00fchren PEGMediaAccess=Medienzugriff PEGrightClick=Rechtsklick zum auf-/zuklappen PEGReadFileSystem=Zum System lesen PEGReadFileSystem=Vom System lesen PEGWriteFileSystem=Zum System schreiben PEClipboardError=Die Zwischenablage scheint keine g\u00fcltig formatierten Richtlinieneintr\u00e4ge zu enthalten PEInvalidPolicy=Einf\u00fcgen gescheitert: Ein Richtlinieneintrag f\u00fcr die Codebasis \u201e{0}\u201c konnte nicht aus der Zwischenablage gelesen werden. PEClipboardAccessError=Konnte nicht aus der Zwischenablage lesen PEHelpMenu=Hilfe PEAboutPolicyEditorItem=\u00dcber PolicyEditor... PEPolicyEditorHelpItem=PolicyEditor-Hilfe... PEHelpDialogTitle=PolicyEditor-Hilfe # Policy Editor CustomPolicyViewer PECPTitle=Ansicht benutzerdefinierter Richtlinien PECPListLabel=Weitere Richtlinien f\u00fcr \u201e{0}\u201c PECPAddButton=Hinzuf\u00fcgen PECPRemoveButton=Entfernen PECPCloseButton=Schlie\u00dfen PECPType=Typ PECPTarget=Ziel PECPActions=Aktionen PECPPrompt=Eingabe einer benutzerdefinierten Berechtigung\n\u201epermission\u201c oder Satzzeichen d\u00fcrfen nicht enthalten sein: # PolicyEditor mnemonics. See javax.swing.KeyStroke.getKeyStroke(String) PEFileMenuMnemonic=D PECodebaseMenuMnemonic=C PEViewMenuMnemonic=S PEHelpMenuMnemonic=H PEHelpMenuMnemonic=H PEAddCodebaseMnemonic=N PEAddCodebaseItemMnemonic=H PERemoveCodebaseMnemonic=E PERemoveCodebaseItemMnemonic=E PENewMenuItemMnemonic=N PEOpenMenuItemMnemonic=\u00d6 PEOpenDefaultMenuItemMnemonic=D PESaveMenuItemMnemonic=S PEExitMenuItemMnemonic=B PECustomPermissionsItemMnemonic=B PECopyCodebaseItemMnemonic=K PEPasteCodebaseItemMnemonic=E PECopyCodebaseToClipboardItemMnemonic=U PESaveAsMenuItemMnemonic=U PERenameCodebaseItemMnemonic=U PEAboutPolicyEditorItemMnemonic=\u00dc PEPolicyEditorHelpItemMnemonic=H # PolicyEditor accelerators. See javax.swing.KeyStroke.getKeyStroke(String) PEAddCodebaseItemAccelerator=control shift N PERemoveCodebaseItemAccelerator=DELETE PENewMenuItemAccelerator=control N PEOpenMenuItemAccelerator=control O PEOpenDefaultMenuItemAccelerator=control D PESaveMenuItemAccelerator=control S PESaveAsMenuItemAccelerator=control shift S PEExitMenuItemAccelerator=control Q PECustomPermissionsItemAccelerator=control B PECopyCodebaseItemAccelerator=control C PEPasteCodebaseItemAccelerator=control V PERenameCodebaseItemAccelerator=F2 PECopyCodebaseToClipboardItemAccelerator=control shift C PEAboutPolicyEditorCloseAccelerator=control Q # conole itself labels CONSOLErungc=Speicher bereinigen CONSOLErunFinalizers=Finalisieren CONSOLErunningFinalizers=Finalisierer werden ausgef\u00fchrt... CONSOLEmemoryInfo=Speicher\u00fcbersicht CONSOLEsystemProperties=Systemeigenschaften CONSOLEclassLoaders=Verf\u00fcgbare Klassenlader CONSOLEthreadList=Liste der Ausf\u00fchrungsstr\u00e4nge CONSOLEthread=Ausf\u00fchrungsstrang CONSOLEnoClassLoaders=Keine Informationen \u00fcber Klassenlader im System CONSOLEmemoryMax=Maximal verf\u00fcgbarer Speicher CONSOLEmemoryTotal=Gesamtspeicher CONSOLEmemoryFree=Freier Speicher CONSOLEClean=Konsole bereinigen # console output pane labels COPsortCopyAllDate=\u201eAlles kopieren\u201c nach Datum sortieren COPshowHeaders=\u00dcberschriften anzeigen: COPuser=Benutzer COPorigin=Herkunft COPlevel=Stufe COPdate=Datum COPthread1=Ausf\u00fchrungsstrang 1 COPthread2=Ausf\u00fchrungsstrang 2 COPShowMessages=Meldungen anzeigen COPstdOut=Standardausgabe COPstdErr=Standardfehlerausgabe COPjava=Java COPplugin=Plug-in COPpreInit=Pr\u00e4-Initialisierung COPpluginOnly=Nur Plug-in COPSortBy=Sortieren nach COPregex=Filter regul\u00e4rer Ausdr\u00fccke COPAsArrived=Nach Ankunft (keine Sortierung) COPcode=Code COPmessage=Meldung COPSearch=Suchen COPautoRefresh=Auto-Aktualisieren COPrefresh=Aktualisieren COPApply=Anwenden COPmark=markieren COPCopyAllPlain=Alles kopieren (einfach) COPCopyAllRich=Alles kopieren (angereichert) COPnext=Weiter>>> COPprevious=<<WARNUNG: Verwendet mehr Speicher als die verf\u00fcgbaren {0} MB TIFPCacheSizeSpinnerLargeValueWarning={0} MB verf\u00fcgbar TIFPCacheSizeSetToNoCaching=Zwischengespeicherte Dateien werden nach dem Beenden von IcedTea-Web gel\u00f6scht. TIFPCacheSizeSpinnerTooltip=Minimum: {0} Maximum: {1} # Control Panel - Cache Viewer CVCPDialogTitle=Zwischenspeicheranzeige CVCPButRefresh=Aktualisieren CVCPButDelete=Entfernen CVCPCleanCache=Leeren CVCPCleanCacheTip=Manche Fehler k\u00f6nnen durch veraltete Dateien im Zwischenspeicher verursacht werden. Vor der Einsendung von Fehlerberichten sollte der Zwischenspeicher geleert und eine betreffende Anwendung neu gestartet werden. \\\n Der Zwischenspeicher kann mit javaws -Xclearcache oder \u00fcber itw-settings Zwischenspeicher/Dateien anzeigen.../Leeren geleert werden. CVCPColLastModified=Zuletzt ge\u00e4ndert CVCPColSize=Gr\u00f6\u00dfe (Bytes) CVCPColDomain=Dom\u00e4ne CVCPColType=Typ CVCPColPath=Pfad CVCPColName=Name # Control Panel - Misc. CPJRESupport=IcedTea-Web unterst\u00fctzt die Verwendung mehrerer JREs derzeit nicht. CPInvalidPort=Ung\u00fcltige Anschlussnummer eingegeben.\n[G\u00fcltige Anschlussnummern sind 1-65535] CPInvalidPortTitle=Eingabefehler # command line control panel CLNoInfo=Keine Informationen verf\u00fcgbar (ist dies eine g\u00fcltige Option?). CLValue=Wert: {0} CLValueSource=Herkunft: {0} CLDescription=Beschreibung: {0} CLUnknownCommand=Unbekannter Befehl {0} CLUnknownProperty=Unbekannter Eigenschaftenname \u201e{0}\u201c CLWarningUnknownProperty=WARNUNG: Unbekannter Eigenschaftenname \u201e{0}\u201c - erstelle neue Eigenschaft CLNoIssuesFound=Keine Probleme gefunden. CLIncorrectValue=Die Eigenschaft \u201e{0}\u201c hat den falschen Wert \u201e{1}\u201c. M\u00f6gliche Werte {2}. CLListDescription=Zeigt eine Liste aller Eigenschaftennamen und Werte an, die durch IcedTea-Web\nverwendet werden CLGetDescription=Zeigt den Wert der Eigenschaft property-name an CLSetDescription=Wenn m\u00f6glich, setzt die Eigenschaft property-name auf den Wert value. Der Wert\nwird auf G\u00fcltigkeit gepr\u00fcft. Falls der Administrator die Eigenschaft gesperrt\nhat, wird dies keine Wirkung haben. CLResetDescription=Setzt den Wert der Eigenschaft property-name auf seinen Standardwert zur\u00fcck.\nall setzt alle durch IcedTea-Web verwendeten Eigenschaften auf ihren Standardwert zur\u00fcck. CLInfoDescription=Zeigt weitere Informationen \u00fcber die gegebene Eigenschaft an. CLCheckDescription=Zeigt alle Eigenschaften an, die definiert wurden, aber durch IcedTea-Web nicht\nerkannt werden. CLUnexpectedNumberOfCommands=itweb-settings kann nur einen Befehl pro Aufruf verarbeiten. # splash screen related SPLASHerror=Um Details zu erhalten, hier klicken. Eine Ausnahme ist aufgetreten. SPLASH_ERROR=FEHLER SPLASHtitle=Titel SPLASHvendor=Lieferant SPLASHhomepage=Homepage SPLASHdescription=Beschreibung SPLASHClose=Schlie\u00dfen SPLASHclosewAndCopyException=Schlie\u00dfen und den Stapelverlauf in die Zwischenablage kopieren SPLASHexOccured=Eine schwerwiegende Ausnahme ist aufgetreten... SPLASHHome=Seitenanfang SPLASHcantCopyEx=Kann Ausnahme nicht kopieren SPLASHnoExRecorded=Keine Ausnahme aufgezeichnet SPLASHmainL1=Um noch mehr Informationen zu erhalten, kann {0} besucht und die dort beschriebenen Schritte befolgt werden, um notwendige Informationen zu erhalten einen Fehler zu melden SPLASHmainL3=Keine weiteren Informationen verf\u00fcgbar. Es kann versucht werden den Web-Browser von der Befehlszeile aus zu starten und die Ausgabe zu untersuchen. SPLASHcloseAndCopyShorter=Schlie\u00dfen und in die Zwischenablage kopieren SPLASHmainL4=Die folgende Ausnahme ist aufgetreten. Um weitere Informationen zu erhalten, kann der Web-Browser von der Befehlszeile aus gestartet und die Ausgabe untersucht werden. SPLASHmainL2=Die Konsole oder Protokolle k\u00f6nnen weitere Informationen bereithalten. Mit der Aktivierung der Fehlerbeseitigung k\u00f6nnen noch mehr Informationen bereitgestellt werden. SPLASHexWas=Die Ausnahme war: SPLASHcfl=Kann der Verkn\u00fcpfung zu nicht folgen SPLASHvendorsInfo=Informationen vom Lieferanten der Anwendung SPLASHanotherInfo=Eine weitere verf\u00fcgbare Info SPLASHdefaultHomepage=Homepage nicht angegeben, verifiziere eher Quelle SPLASHerrorInInformation=Fehler w\u00e4hrend des Ladens des Elements information, verifiziere eher Quelle SPLASHmissingInformation=Das Element information fehlt, verifiziere eher Quelle SPLASHchainWas=Dies ist die Liste der Ausnahmen, die w\u00e4hrend des Starts des Applets aufgetreten sind. Hinweis: Diese Ausnahmen k\u00f6nnen von mehreren Applets stammen. Um einen hilfreichen Fehlerbericht zu erstellen, sollte sichergestellt sein, dass nur ein Applet ausgef\u00fchrt wird. CBCheckFile=Die Anwendung ist eine lokale Datei. Die Pr\u00fcfung der Codebasis ist deaktiviert. Um Einzelheiten zu erfahren siehe: http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/security/no_redeploy.html. CBCheckNoEntry=Die Anwendung gibt keine Codebasis in ihrem Manifest an. Dies bedarf einer R\u00fcckfrage an den Lieferanten des Applets. Fahre fort. Um Einzelheiten zu erfahren siehe: http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/security/no_redeploy.html. CBCheckUnsignedPass=Die Codebasis stimmt mit der Codebasis im Manifest \u00fcberein. Fahre fort. Um Einzelheiten zu erfahren siehe: http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/security/no_redeploy.html. CBCheckUnsignedFail=Die Codebasis der Anwendung stimmt NICHT mit der in ihrem Manifest angegebenen Codebasis \u00fcberein, aber die Anwendung ist nicht signiert. Fahre fort. Um Einzelheiten zu erfahren siehe: http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/security/no_redeploy.html. CBCheckOkSignedOk=Die Codebasis stimmt mit der Codebasis im Manifest \u00fcberein und die Anwendung ist signiert. Fahre fort. Um Einzelheiten zu erfahren siehe: http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/security/no_redeploy.html. CBCheckSignedAppletDontMatchException=Die Ausf\u00fchrung von signierten Applets ist nicht zugelassen, w\u00e4hrend ihre tats\u00e4chliche Codebasis nicht mit der in ihrem Manifest angegebenen Codebasis \u00fcbereinstimmt. Erwartet: {0}. Tats\u00e4chlich: {1}. Um Einzelheiten zu erfahren siehe: http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/security/no_redeploy.html. CBCheckSignedFail=Die Codebasis der Anwendung stimmt NICHT mit der im Manifest der Anwendung angegebenen Codebasis \u00fcberein und die Anwendung ist signiert. Es wird strengstens von der Ausf\u00fchrung dieser Anwendung abgeraten. Um Einzelheiten zu erfahren siehe: http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/security/no_redeploy.html. # itweb-settings man (note, spaces (especially the one around markup) are important due to man pages markup). Only bold tag is now recognized by ReplacingTextFormatter. # itweb-plugin man (note, spaces (especially the one around markup) are important due to man pages markup). Only bold tag is now recognized by ReplacingTextFormatter. # files descriptions APPEXTSECappletSecurityLevelExtraHighId=Die Ausf\u00fchrung aller Java-Applets deaktivieren APPEXTSECappletSecurityLevelVeryHighId=Sehr hohe Sicherheit APPEXTSECappletSecurityLevelHighId=Hohe Sicherheit APPEXTSECappletSecurityLevelLowId=Niedrige Sicherheit APPEXTSECappletSecurityLevelExtraHighExplanation=Kein Applet wird ausgef\u00fchrt werden APPEXTSECappletSecurityLevelVeryHighExplanation=Keine nicht signierten Applets werden ausgef\u00fchrt werden APPEXTSECappletSecurityLevelHighExplanation=Benutzer wird bei jedem nicht signierten Applet gefragt werden APPEXTSECappletSecurityLevelLowExplanation=Alle, sogar nicht signierte Applets werden ausgef\u00fchrt werden APPEXTSECunsignedAppletActionAlways=Diesem/n (\u00fcbereinstimmenden) Applet/s immer vertrauen APPEXTSECunsignedAppletActionNever=Diesem/n (\u00fcbereinstimmenden) Applet/s nie vertrauen APPEXTSECunsignedAppletActionYes=Dieses Applet wurde besucht und zugelassen APPEXTSecunsignedAppletActionSandbox=Dieses Applet wurde besucht und zur Ausf\u00fchrung mit eingeschr\u00e4nkten Berechtigungen zugelassen APPEXTSECunsignedAppletActionNo=Dieses Applet wurde besucht und verweigert APPEXTSECControlPanelExtendedAppletSecurityTitle=Erweiterte Applet-Sicherheit APPEXTSECguiTableModelTableColumnDateOfAction=Aktionsdatum APPEXTSECguiTableModelTableColumnDocumentBase=Dokumentbasis APPEXTSECguiTableModelTableColumnCodeBase=Codebasis APPEXTSECguiTableModelTableColumnArchives=Archive APPEXTSECguiPanelAppletInfoHederPart1={0} {1} APPEXTSECguiPanelAppletInfoHederPart2={0} von {1} APPEXTSECguiPanelConfirmDeletionOf=Sollen die folgenden {0} Inhalte wirklich gel\u00f6scht werden? APPEXTSECguiPanelHelpButton=Hilfe APPEXTSECguiPanelSecurityLevel=Sicherheitsstufe APPEXTSECguiPanelGlobalBehaviourCaption=Einstellungen der globalen Verhaltensweise von Applets APPEXTSECguiPanelDeleteMenuSelected=markiert APPEXTSECguiPanelDeleteMenuAllA=alle zugelassenen (A) APPEXTSECguiPanelDeleteMenuAllN=alle verbotenen (N) APPEXTSECguiPanelDeleteMenuAlly=alle genehmigten (y) APPEXTSECguiPanelDeleteMenuAlln=alle abgelehnten (n) APPEXTSECguiPanelDeleteMenuAllAll=absolut alle APPEXTSECguiPanelDeleteButton=L\u00f6schen APPEXTSECguiPanelDeleteButtonToolTip=Durch dr\u00fccken der Entf-Taste w\u00e4hrend der Durchsicht der Tabelle wird der markierte Inhalt gel\u00f6scht APPEXTSECguiPanelTestUrlButton=Teste URL APPEXTSECguiPanelAddRowButton=Neue\u00a0Zeile\u00a0hinzuf\u00fcgen APPEXTSECguiPanelValidateTableButton=Tabelle\u00a0\u00fcberpr\u00fcfen APPEXTSECguiPanelAskeforeActionBox=Vor\u00a0Aktion\u00a0fragen APPEXTSECguiPanelShowRegExesBox=Regul\u00e4re\u00a0Ausdr\u00fccke\u00a0vollst\u00e4ndig\u00a0zeigen APPEXTSECguiPanelInverSelection=Markierung umkehren APPEXTSECguiPanelMoveRowUp=Zeile auf APPEXTSECguiPanelMoveRowDown=Zeile ab APPEXTSECguiPanelCustomDefs=Benutzerdefinitionen APPEXTSECguiPanelGlobalDefs=Systemdefinitionen APPEXTSECguiPanelDocTest=URL der Dokumentbasis eingeben APPEXTSECguiPanelCodeTest=URL der Codebasis eingeben APPEXTSECguiPanelNoMatch=Keine \u00dcbereinstimmung APPEXTSECguiPanelMatchingNote=HINWEIS: Nur die erste \u00dcbereinstimmung wird als Ergebnis gewertet. APPEXTSECguiPanelMatched=\u00dcbereinstimmung APPEXTSECguiPanelMatchingError=Fehler bei der Suche nach \u00dcbereinstimmungen: {0} APPEXTSECguiPanelCanNotValidate=Keine \u00dcberpr\u00fcfung m\u00f6glich; Die tempor\u00e4re Datei \u201e{0}\u201c kann nicht erstellt werden APPEXTSECguiPanelEmptyDoc=Alle Dokumentbasen m\u00fcssen ausgef\u00fcllt sein APPEXTSECguiPanelEmptyCode=Alle Codebasen m\u00fcssen ausgef\u00fcllt sein APPEXTSECguiPanelTableValid=Tabelle sieht g\u00fcltig aus APPEXTSECguiPanelTableInvalid=Ung\u00fcltig durch folgenden Fehler: {0} APPEXTSECguiPanelShowOnlyPermanent=Nur dauerhafte Eintr\u00e4ge zeigen APPEXTSECguiPanelShowOnlyTemporal=Nur vorher vorr\u00fcbergehend entschiedene Eintr\u00e4ge zeigen APPEXTSECguiPanelShowAll=Alle Eintr\u00e4ge zeigen APPEXTSECguiPanelShowOnlyPermanentA=Nur zugelassene dauerhafte Eintr\u00e4ge zeigen APPEXTSECguiPanelShowOnlyPermanentN=Nur verbotene dauerhafte Eintr\u00e4ge zeigen APPEXTSECguiPanelShowOnlyTemporalY=Nur vorher zugelassene Applet-Eintr\u00e4ge zeigen APPEXTSECguiPanelShowOnlyTemporalN=Nur vorher verweigerte Applet-Eintr\u00e4ge zeigen APPEXTSEChelpHomeDialogue=Dialog icedtea-web-1.6.2/netx/net/sourceforge/jnlp/resources/PaxHeaders.17941/Messages_cs.properties0000644000000000000000000000013212654402377027063 xustar0030 mtime=1454507263.287431914 30 atime=1454507327.136580377 30 ctime=1454507658.740157877 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/resources/Messages_cs.properties0000644000175000002070000027277512654402377027632 0ustar00jvanekmock00000000000000# Czech UI messages for netx # # All messages are formatted using Java's MessageFormat class. # Apostrophe characters ' need to be escaped by using two: '' # Curly brackets need to be escaped by surrounding them with single apostrophes '{' '{hello}' # # L=Launcher, B=Boot, P=Parser, C=cache S=security # # General NullParameter=Pr\u00e1zdn\u00fd parametr ButAllow=Povolit ButBrowse=Proch\u00e1zet... ButCancel=\ Zru\u0161it ButClose=Zav\u0159\u00edt ButAdvancedOptions=Pokro\u010dil\u00e9 mo\u017enosti ButCopy=Kop\u00edrovat do schr\u00e1nky ButMoreInformation=Dal\u0161\u00ed informace... ButOk=OK ButProceed=Pokra\u010dovat ButRun=Spustit ButSandbox=Izolovan\u00fd prostor (sandbox) ButApply=Pou\u017e\u00edt ButDone=Hotovo ButShowDetails=Zobrazit podrobnosti ButHideDetails=Skr\u00fdt podrobnosti ButYes=Ano ButNo=Ne BUTControlledBy=Ovl\u00e1d\u00e1no pomoc\u00ed {0} BUTmodified=upraveno CertWarnRunTip=Apletu m\u016f\u017eete v\u011b\u0159it a spustit ho s pln\u00fdmi opr\u00e1vn\u011bn\u00edmi. CertWarnSandboxTip=Apletu nev\u011b\u0159te a spus\u0165te ho s omezen\u00fdmi opr\u00e1vn\u011bn\u00edmi. CertWarnCancelTip=Tento aplet nespou\u0161t\u011bjte. CertWarnPolicyTip=Pokro\u010dil\u00e1 nastaven\u00ed izolovan\u00e9ho prostoru CertWarnPolicyEditorItem=Spustit n\u00e1stroj PolicyEditor CertWarnHTTPSAcceptTip=P\u0159ijmout tento certifik\u00e1t a v\u011b\u0159it spojen\u00ed HTTPS. CertWarnHTTPSRejectTip=Nep\u0159ij\u00edmat tento certifik\u00e1t a nenav\u00e1zat spojen\u00ed HTTPS. AFileOnTheMachine=soubor v po\u010d\u00edta\u010di AlwaysAllowAction=V\u017edy povolit tuto akci AlwaysForbidAction=V\u017edy zak\u00e1zat tuto akci Usage=Pou\u017eit\u00ed: Error=Chyba Warning=Varov\u00e1n\u00ed Continue=Chcete pokra\u010dovat? Field=Pole From=Od Name=N\u00e1zev Password=Heslo: Publisher=Vydavatel Unknown= Username=U\u017eivatelsk\u00e9 jm\u00e9no: Value=Hodnota Version=Verze # about dialogue AboutDialogueTabAbout=O aplikaci IcedTea-Web AboutDialogueTabAuthors=Auto\u0159i AboutDialogueTabChangelog=Seznam zm\u011bn AboutDialogueTabNews=Novinky AboutDialogueTabGPLv2=GPLv2 # version check minidialogue JREversionDontMatch=Varov\u00e1n\u00ed \u2013 prost\u0159ed\u00ed JRE ve va\u0161em po\u010d\u00edta\u010di ({0}) nesouhlas\u00ed s po\u017eadovan\u00fdm prost\u0159ed\u00edm JRE ({1}). JREContinueDialogSentence2=Chcete pokra\u010dovat v jeho spou\u0161t\u011bn\u00ed? JREContinueDialogSentenceTitle=Nekompatibiln\u00ed prost\u0159ed\u00ed JRE # missing permissions dialogue MissingPermissionsMainTitle=Aplikace {0} z {1} postr\u00e1d\u00e1 atribut permissions. Aplikaci bez tohoto elementu byste nem\u011bli v\u011b\u0159it. Chcete povolit b\u011bh t\u00e9to aplikace? MissingPermissionsInfo=Chcete-li z\u00edskat v\u00edce informac\u00ed, nav\u0161tivte n\u00e1sleduj\u00edc\u00ed weby:
    JAR File Manifest Attributes
    a
    Preventing the repurposing of Applications. # missing Application-Library-Allowable-Codebase dialogue ALACAMissingMainTitle=Aplikace {0} z {1} pou\u017e\u00edv\u00e1 zdroje z n\u00e1sleduj\u00edc\u00edch vzd\u00e1len\u00fdch um\u00edst\u011bn\u00ed:{2}. Bu\u010fte velmi opatrn\u00ed pokud jde o k\u00f3d z neo\u010dek\u00e1van destinace. Ur\u010dit\u011b chcete spustit tuto aplikaci? ALACAMissingInfo=Chcete-li z\u00edskat v\u00edce informac\u00ed, nav\u0161tivte n\u00e1sleduj\u00edc\u00ed weby:
    JAR File Manifest Attributes
    a
    Preventing the Repurposing of an Applications. # matching Application-Library-Allowable-Codebase dialogue ALACAMatchingMainTitle=Aplikace {0} z {1} pou\u017e\u00edv\u00e1 zdroje z n\u00e1sleduj\u00edc\u00edch vzd\u00e1len\u00fdch um\u00edst\u011bn\u00ed:
    {2}.
    Zdroje se zdaj\u00ed v po\u0159\u00e1dku. Chcete spustit tuto aplikaci? ALACAMatchingInfo=Chcete-li z\u00edskat v\u00edce informac\u00ed, nav\u0161tivte n\u00e1sleduj\u00edc\u00ed weby:
    JAR File Manifest Attributes
    a
    Preventing the repurposing of Applications MACDisabledMessage=Kontroly atribut\u016f v manifestu jsou vypnut\u00e9. MACCheckSkipped=kontrola {0} vynech\u00e1na, proto\u017ee vlastnost deployment.manifest.attributes.check nen\u00ed nastavena na ALL nebo obsahuje {1} v kombinaci s mo\u017enost\u00ed # LS - Severity LSMinor=Mal\u00e1 LSFatal=Z\u00e1va\u017en\u00e1 # LC - Category LCSystem=Syst\u00e9mov\u00e1 chyba LCExternalLaunch=Chyba extern\u00edho spu\u0161t\u011bn\u00ed LCFileFormat=Chybn\u00fd form\u00e1t souboru LCReadError=Chyba p\u0159i \u010dten\u00ed LCClient=Chyba aplikace LCLaunching=Chyba p\u0159i spou\u0161t\u011bn\u00ed LCNotSupported=Nepodporovan\u00e1 funkce LCInit=Chyba inicializace LAllThreadGroup=V\u0161echny aplikace JNLP LNullUpdatePolicy=Z\u00e1sady pro aktualizaci nesm\u00ed b\u00fdt pr\u00e1zdn\u00e9. LThreadInterrupted=Vl\u00e1kno bylo p\u0159eru\u0161eno p\u0159i \u010dek\u00e1n\u00ed na spu\u0161t\u011bn\u00ed souboru. LThreadInterruptedInfo=Tato akce m\u016f\u017ee v\u00e9st k zablokov\u00e1n\u00ed nebo jin\u00e9mu po\u0161kozen\u00ed v pr\u016fb\u011bhu spou\u0161t\u011bn\u00ed. Restartujte aplikaci/prohl\u00ed\u017ee\u010d. LCouldNotLaunch=Nelze spustit soubor JNLP. LCouldNotLaunchInfo=Aplikace nebyla inicializov\u00e1na. Chcete-li z\u00edskat v\u00edce informac\u00ed, spus\u0165te javaws/prohl\u00ed\u017ee\u010d z p\u0159\u00edkazov\u00e9 \u0159\u00e1dky a za\u0161lete hl\u00e1\u0161en\u00ed o chyb\u011b. LCantRead=Nelze \u010d\u00edst nebo analyzovat soubor JNLP. LCantReadInfo=M\u016f\u017eete zkusit st\u00e1hnout tento soubor ru\u010dn\u011b a zaslat ho prost\u0159ednictv\u00edm hl\u00e1\u0161en\u00ed o chyb\u011b t\u00fdmu IcedTea-Web. LNullLocation=Nelze ur\u010dit um\u00edst\u011bn\u00ed souboru JNLP. LNullLocationInfo=Byl u\u010din\u011bn pokus o spu\u0161t\u011bn\u00ed souboru JNLP v jin\u00e9m prost\u0159ed\u00ed JVM, av\u0161ak soubor nebyl nalezen. Chcete-li spustit extern\u00ed prost\u0159ed\u00ed JVM, modul runtime mus\u00ed b\u00fdt schopen nal\u00e9zt soubor .jnlp v lok\u00e1ln\u00edm souborov\u00e9m syst\u00e9mu nebo na serveru. LNetxJarMissing=Nelze ur\u010dit um\u00edst\u011bn\u00ed souboru netx.jar. LNetxJarMissingInfo=Byl u\u010din\u011bn pokus o spu\u0161t\u011bn\u00ed souboru JNLP v jin\u00e9m prost\u0159ed\u00ed JVM, av\u0161ak nebyl nalezen soubor netx.jar. Chcete-li spustit extern\u00ed prost\u0159ed\u00ed JVM, modul runtime mus\u00ed b\u00fdt schopen nal\u00e9zt soubor netx.jar. LNotToSpec=Soubor JNLP p\u0159esn\u011b neodpov\u00edd\u00e1 specifikaci. LNotToSpecInfo=Soubor JNLP obsahuje data, kter\u00e1 jsou zak\u00e1z\u00e1na v r\u00e1mci specifikace JNLP. Modul runtime se m\u016f\u017ee pokusit ignorovat neplatn\u00e9 informace a pokra\u010dovat ve spou\u0161t\u011bn\u00ed souboru. LNotApplication=Nejedn\u00e1 se o soubor aplikace. LNotApplicationInfo=Byl u\u010din\u011bn pokus o na\u010dten\u00ed souboru, kter\u00fd nen\u00ed aplikac\u00ed, jako soubor aplikace. LNotApplet=Nejedn\u00e1 se o soubor apletu. LNotAppletInfo=Byl u\u010din\u011bn pokus o na\u010dten\u00ed souboru, kter\u00fd nen\u00ed apletem, jako soubor apletu. LNoInstallers=Instal\u00e1tory nejsou podporov\u00e1ny. LNoInstallersInfo=Instal\u00e1tory JNLP je\u0161t\u011b nejsou podporov\u00e1ny. LInitApplet=Nelze inicializovat aplet. LInitAppletInfo=Dal\u0161\u00ed informace z\u00edsk\u00e1te kliknut\u00edm na tla\u010d\u00edtko Dal\u0161\u00ed informace... LInitApplication=Nelze inicializovat aplikaci. LInitApplicationInfo=Aplikace nebyla inicializov\u00e1na. Chcete-li z\u00edskat v\u00edce informac\u00ed, spus\u0165te javaws z p\u0159\u00edkazov\u00e9 \u0159\u00e1dky. LNotLaunchable=Nejedn\u00e1 se o spustiteln\u00fd soubor JNLP. LNotLaunchableInfo=Soubor mus\u00ed b\u00fdt aplikac\u00ed, apletem nebo instal\u00e1torem JNLP. LCantDetermineMainClass=Nezn\u00e1m\u00e1 t\u0159\u00edda Main-Class. LCantDetermineMainClassInfo=Nelze ur\u010dit t\u0159\u00eddu main class pro tuto aplikaci. LUnsignedJarWithSecurity=Nelze ud\u011blit opr\u00e1vn\u011bn\u00ed nepodepsan\u00fdm soubor\u016fm JAR. LUnsignedJarWithSecurityInfo=Aplikace po\u017e\u00e1dala o bezpe\u010dnostn\u00ed opr\u00e1vn\u011bn\u00ed, av\u0161ak soubory JAR nejsou podeps\u00e1ny. LSignedJNLPAppDifferentCerts=Aplikace JNLP nen\u00ed kompletn\u011b podepsan\u00e1 jednou certifika\u010dn\u00ed autoritou. LSignedJNLPAppDifferentCertsInfo=Jednotliv\u00e9 komponenty aplikace JNLP jsou individu\u00e1ln\u011b podeps\u00e1ny, nicm\u00e9n\u011b pro v\u0161echny polo\u017eky mus\u00ed b\u00fdt jeden spole\u010dn\u00fd podepisovatel. LUnsignedApplet=Aplet nebyl podepsan\u00fd. LUnsignedAppletPolicyDenied=Aplet nebyl podepsan\u00fd a bezpe\u010dnostn\u00ed z\u00e1sady zabr\u00e1nily jeho spu\u0161t\u011bn\u00ed. LUnsignedAppletUserDenied=Aplet nebyl podepsan\u00fd a byl vyhodnocen jako ned\u016fv\u011bryhodn\u00fd. LPartiallySignedApplet=Aplet byl \u010d\u00e1ste\u010dn\u011b podepsan\u00fd. LPartiallySignedAppletUserDenied=Aplet byl \u010d\u00e1ste\u010dn\u011b podepsan\u00fd a u\u017eivatel ho vyhodnotil jako ned\u016fv\u011bryhodn\u00fd. LSignedAppJarUsingUnsignedJar=Podepsan\u00e1 aplikace pou\u017e\u00edvaj\u00edc\u00ed nepodepsan\u00e9 soubory JAR. LSignedAppJarUsingUnsignedJarInfo=Hlavn\u00ed soubor JAR aplikace je podepsan\u00fd, av\u0161ak n\u011bkter\u00e9 z dal\u0161\u00edch pou\u017e\u00edvan\u00fdch soubor\u016f JAR nejsou podeps\u00e1ny. LRunInSandboxError=Vol\u00e1n\u00ed pro b\u011bh v izolovan\u00e9m prostoru (sandbox) bylo vykon\u00e1no p\u0159\u00edli\u0161 pozd\u011b. LRunInSandboxErrorInfo=Zavad\u011b\u010d t\u0159\u00edd dostal hl\u00e1\u0161en\u00ed, aby spustil aplet v izolovan\u00e9m prost\u0159ed\u00ed, av\u0161ak bezpe\u010dnostn\u00ed nastaven\u00ed ji\u017e byla inicializov\u00e1na. LSignedJNLPFileDidNotMatch=Podepsan\u00fd soubor JNLP se neshoduje se spou\u0161t\u011bn\u00fdm souborem JNLP. LNoSecInstance=Chyba: Neexistuje bezpe\u010dnostn\u00ed instance pro aplikaci {0}. Aplikace m\u016f\u017ee m\u00edt pot\u00ed\u017ee pokra\u010dovat. LCertFoundIn=Certifik\u00e1t {0} byl nalezen v arch\u00edvu cacerts ({1}). LSingleInstanceExists=Ji\u017e existuje jin\u00e1 instance tohoto apletu. Nelze provozovat v\u00edce instanc\u00ed apletu z\u00e1rove\u0148. JNotApplet=Soubor nen\u00ed aplet. JNotApplication=Soubor nen\u00ed aplikace. JNotComponent=Soubor nen\u00ed komponenta. JNotInstaller=Soubor nen\u00ed instal\u00e1tor. JInvalidExtensionDescriptor=P\u0159\u00edpona souboru neodkazuje na komponentu nebo instal\u00e1tor (n\u00e1zev={1}, um\u00edst\u011bn\u00ed={2}). LNotVerified=Soubory JAR nebyly ov\u011b\u0159eny. LCancelOnUserRequest=Zru\u0161eno u\u017eivatelem. LFatalVerification=P\u0159i ov\u011b\u0159ov\u00e1n\u00ed soubor\u016f JAR do\u0161lo k z\u00e1va\u017en\u00e9 chyb\u011b. LFatalVerificationInfo=Do\u0161lo k v\u00fdjimce ve t\u0159\u00edd\u011b JarCertVerifier. P\u0159\u00ed\u010dinou t\u00e9to v\u00fdjimky m\u016f\u017ee b\u00fdt neschopnost \u010d\u00edst soubory cacerts nebo trusted.certs. LNotVerifiedDialog=Nemohly b\u00fdt ov\u011b\u0159eny v\u0161echny soubory JAR. LAskToContinue=Chcete p\u0159esto pokra\u010dovat ve spou\u0161t\u011bn\u00ed t\u00e9to aplikace? # Parser PInvalidRoot=Element \u201eroot" nen\u00ed elementem jnlp. PNoResources=Nen\u00ed definov\u00e1n element \u201eresources\u201c. PUntrustedNative=Nelze deklarovat element \u201enativelib\u201c, ani\u017e by bylo po\u017e\u00e1d\u00e1no o p\u0159\u00edslu\u0161n\u00e1 opr\u00e1vn\u011bn\u00ed. PExtensionHasJ2SE=V souboru roz\u0161\u00ed\u0159en\u00ed nelze deklarovat element \u201ej2se\u201c. PInnerJ2SE=Uvnit\u0159 elementu \u201ej2se\u201c nelze deklarovat dal\u0161\u00ed element \u201ej2se\u201c. PTwoMains=V elementu \u201eresources\u201c je duplicitn\u011b definov\u00e1n atribut \u201emain" (lze definovat pouze jeden). PNativeHasMain=Uvnit\u0159 elementu \u201ej2se\u201c nelze deklarovat dal\u0161\u00ed element \u201ej2se\u201c. PNoInfoElement=Nen\u00ed definov\u00e1n element \u201einformation\u201c. PMissingTitle=N\u00e1zev PMissingVendor=Dodavatel PMissingElement=Pro va\u0161e n\u00e1rodn\u00ed prost\u0159ed\u00ed nebyla zad\u00e1na sekce {0}, ani neexistuje v\u00fdchoz\u00ed hodnota v souboru JNLP. PTwoDescriptions=Duplicitn\u00ed elementy \u201edescription" typu {0} jsou neplatn\u00e9. PSharing=Element \u201esharing-allowed\u201c je neplatn\u00fd ve standardn\u00edm souboru JNLP. PTwoSecurity=V ka\u017ed\u00e9m souboru JNLP m\u016f\u017ee b\u00fdt pouze jeden element \u201esecurity\u201c. PEmptySecurity=Element \u201esecurity\u201c je definov\u00e1n, av\u0161ak neobsahuje element \u201epermissions\u201c. PTwoDescriptors=V ka\u017ed\u00e9m souboru JNLP m\u016f\u017ee b\u00fdt pouze jeden element \u201eapplication-desc\u201c. PTwoDesktops=Je povolen pouze jeden element \u201edesktop\u201c. PTwoMenus=Je povolen pouze jeden element \u201emenu\u201c. PTwoTitles=Je povolen pouze jeden element \u201etitle\u201c. PTwoIcons=Je povolen pouze jeden element \u201eicon\u201c. PTwoUpdates=Je povolen pouze jeden element \u201eupdate\u201c. PUnknownApplet=Nezn\u00e1m\u00fd aplet PBadWidth=Neplatn\u00e1 \u0161\u00ed\u0159ka apletu PBadHeight=Neplatn\u00e1 v\u00fd\u0161ka apletu PUrlNotInCodebase=Relativn\u00ed adresa URL neuv\u00e1d\u00ed podadres\u00e1\u0159 se z\u00e1kladnou k\u00f3du (codebase). (uzel (node)={0}, odkaz (href)={1}, z\u00e1kladna k\u00f3du (codebase)={2}) PBadRelativeUrl=Neplatn\u00e1 relativn\u00ed adresa URL (uzel (node)={0}, odkaz (href)={1}, z\u00e1kladna k\u00f3du (codebase)={2}) PBadNonrelativeUrl=Neplatn\u00e1 absolutn\u00ed adresa URL (uzel (node)={0}, odkaz (href)={1}) PNeedsAttribute=Element {0} mus\u00ed deklarovat atribut {1}. PBadXML=Neplatn\u00e1 syntax dokumentu XML PBadHeapSize=Neplatn\u00e1 hodnota pro velikost haldy (heap size) ({0}) # Runtime BLaunchAbout=Prob\u00edh\u00e1 spou\u0161t\u011bn\u00ed okna O aplikaci IcedTea-Web... BLaunchAboutFailure=Spu\u0161t\u011bn\u00ed okna O aplikaci IcedTea-Web se nezda\u0159ilo. BNeedsFile=Je nutn\u00e9 zadat soubor JNLP. RNoAboutJnlp=Nelze nal\u00e9zt soubor about.jnlp. BFileLoc=Um\u00edst\u011bn\u00ed souboru JNLP BBadProp=Neplatn\u00fd form\u00e1t vlastnosti {0} (platn\u00fd form\u00e1t: kl\u00ed\u010d=hodnota) BBadParam=Neplatn\u00fd form\u00e1t parametru {0} (platn\u00fd form\u00e1t: n\u00e1zev=hodnota) BNoDir=Adres\u00e1\u0159 {0} neexistuje. BNoCodeOrObjectApplet=Zna\u010dka apletu mus\u00ed deklarovat atribut \u201ecode" nebo \u201eobject" nebo \u201ejnlp_href". RNoResource=Chyb\u011bj\u00edc\u00ed zdroj: {0} RShutdown=Tato v\u00fdjimka zabra\u0148uje ukon\u010den\u00ed prost\u0159ed\u00ed JVM, av\u0161ak proces byl ukon\u010den. RExitTaken=T\u0159\u00edda exit class m\u016f\u017ee b\u00fdt nastavena pouze jednou a pouze ta pak m\u016f\u017ee ukon\u010dit prost\u0159ed\u00ed JVM. RCantReplaceSM=Nen\u00ed dovoleno vym\u011bnit t\u0159\u00eddu SecurityManager. RCantCreateFile=Nelze vytvo\u0159it soubor {0}. RCantDeleteFile=Nelze smazat soubor {0}. RCantOpenFile=Nepoda\u0159ilo se otev\u0159\u00edt soubor {0}. RCantWriteFile=Nepoda\u0159ilo se zapisovat do souboru {0}. RFileReadOnly=Soubor bude otev\u0159en v re\u017eimu pro \u010dten\u00ed. RExpectedFile={0}m\u011bl b\u00fdt dle o\u010dek\u00e1v\u00e1n\u00ed soubor, ale nen\u00ed. RRemoveRPermFailed=Selhalo odstra\u0148ov\u00e1n\u00ed opr\u00e1vn\u011bn\u00ed ke \u010dten\u00ed u souboru {0}. RRemoveWPermFailed=Selhalo odstra\u0148ov\u00e1n\u00ed opr\u00e1vn\u011bn\u00ed k z\u00e1pisu u souboru {0}. RRemoveXPermFailed=Selhalo odstra\u0148ov\u00e1n\u00ed opr\u00e1vn\u011bn\u00ed ke spou\u0161t\u011bn\u00ed u souboru {0}. RGetRPermFailed=Selhalo z\u00edsk\u00e1v\u00e1n\u00ed opr\u00e1vn\u011bn\u00ed ke \u010dten\u00ed u souboru {0}. RGetWPermFailed=Selhalo z\u00edsk\u00e1v\u00e1n\u00ed opr\u00e1vn\u011bn\u00ed k z\u00e1pisu u souboru {0}. RGetXPermFailed=Selhalo z\u00edsk\u00e1v\u00e1n\u00ed opr\u00e1vn\u011bn\u00ed ke spou\u0161t\u011bn\u00ed u souboru {0}. RCantCreateDir=Nelze vytvo\u0159it adres\u00e1\u0159 {0}. RCantRename=Nelze prov\u00e9st p\u0159ejmenov\u00e1n\u00ed z {0} na {1}. RDenyStopped=Pozastaven\u00e1 aplikace nem\u00e1 pat\u0159i\u010dn\u00e1 opr\u00e1vn\u011bn\u00ed. RExitNoApp=Nelze ukon\u010dit prost\u0159ed\u00ed JVM, proto\u017ee sou\u010dasn\u00e1 aplikace neodpov\u00edd\u00e1. RNoLockDir=Nelze vytvo\u0159it uzamykac\u00ed adres\u00e1\u0159 ({0}). RNestedJarExtration=Nelze extrahovat vno\u0159en\u00fd soubor JAR. RUnexpected=Neo\u010dek\u00e1van\u00e1 v\u00fdjimka {0} v n\u00e1sleduj\u00edc\u00ed \u010d\u00e1sti v\u00fdpisu trasov\u00e1n\u00ed: {1} RConfigurationError=P\u0159i \u010dten\u00ed konfigurace do\u0161lo k z\u00e1va\u017en\u00e9 chyb\u011b. Pokra\u010duji s pr\u00e1zdnou konfigurac\u00ed. Opravte chybu. RConfigurationFatal=CHYBA: P\u0159i na\u010d\u00edt\u00e1n\u00ed konfigurace do\u0161lo k z\u00e1va\u017en\u00e9 chyb\u011b. Mo\u017en\u00e1 je nutn\u00e9 pou\u017e\u00edt glob\u00e1ln\u00ed konfiguraci, kter\u00e1 v\u0161ak nebyla nalezena. RFailingToDefault=Bude pou\u017eita v\u00fdchoz\u00ed konfigurace. RPRoxyPacNotSupported=Pou\u017eit\u00ed soubor\u016f PAC (Proxy Auto Config) nen\u00ed podporov\u00e1no. RProxyFirefoxNotFound=Nelze pou\u017e\u00edt nastaven\u00ed proxy server\u016f prohl\u00ed\u017ee\u010de Firefox. Je pou\u017eito nastaven\u00ed bez proxy serveru (DIRECT). RProxyFirefoxOptionNotImplemented=Mo\u017enost nastaven\u00ed proxy serveru prohl\u00ed\u017ee\u010de {0} ({1}) je\u0161t\u011b nen\u00ed podporov\u00e1na. RBrowserLocationPromptTitle=Um\u00edst\u011bn\u00ed prohl\u00ed\u017ee\u010de RBrowserLocationPromptMessage=Zadejte um\u00edst\u011bn\u00ed prohl\u00ed\u017ee\u010de. RBrowserLocationPromptMessageWithReason=Zadejte um\u00edst\u011bn\u00ed prohl\u00ed\u017ee\u010de (p\u0159\u00edkaz prohl\u00ed\u017ee\u010de {0} je neplatn\u00fd). HTMLnoneFound=Na t\u00e9to str\u00e1nce html nebyl nalezen \u017e\u00e1dn\u00fd aplet (podporov\u00e1ny jsou zna\u010dky \u201eobject\u201c, \u201eembed\u201c a \u201eapplet\u201c). HTMLmoreThenOne=Bylo nalezeno v\u00edce aplet\u016f ({0}). Pou\u017eije se prvn\u00ed. M\u016f\u017eete specifikovat \u010d\u00edsla aplet\u016f nebo pou\u017e\u00edt volbu \u201ev\u0161echny\u201c (all) a vybrat tak, kter\u00e9 aplety chcete spustit. # icedtea-web man (note, spaces are important due to man pages markup ITWintroL1={0}poskytuje svobodn\u00fd z\u00e1suvn\u00fd modul pro webov\u00fd prohl\u00ed\u017ee\u010d, kter\u00fd spou\u0161t\u00ed aplety napsan\u00e9 v programovac\u00edm jazyce Java, a implementaci technologie Java Web Start, p\u016fvodn\u011b zalo\u017een\u00e9 na projektu NetX. ITWintroL2=NetX umo\u017e\u0148uje pro aplety a aplikace Java jejich stahov\u00e1n\u00ed po s\u00edti, zapisov\u00e1n\u00ed do vyrovn\u00e1vac\u00ed pam\u011bti a (ve v\u00fdchoz\u00edm stavu) spou\u0161t\u011bn\u00ed v bezpe\u010dn\u00e9m izolovan\u00e9m prostoru (sandbox). N\u00e1sledn\u00e1 spu\u0161t\u011bn\u00ed apletu automaticky st\u00e1hnou nejnov\u011bj\u0161\u00ed verzi. Nastaven\u00ed aktualizac\u00ed a zabezpe\u010den\u00ed lze nastavit (mimo jin\u00e9) pomoc\u00ed p\u0159\u00edkazu itw-settings. ITWintroL3={0} tak\u00e9 obsahuje z\u00e1suvn\u00fd modul, kter\u00fd {1} ve webov\u00fdch prohl\u00ed\u017ee\u010d\u00edch. ITWintroUrlCaption= zapne aplety Java BFileInfoAuthors=Jm\u00e9na a e-mailov\u00e9 adresy p\u0159ip\u011bvatel\u016f do projektu naleznete v souboru AUTHORS v ko\u0159enov\u00e9m adres\u00e1\u0159i aplikace IcedTea-Web. BFileInfoCopying=Kompletn\u00ed licen\u010dn\u00ed ujedn\u00e1n\u00ed GPLv2 tohoto projektu naleznete v souboru COPYING v ko\u0159enov\u00e9m adres\u00e1\u0159i aplikace IcedTea-Web. BFileInfoNews=Novinky o vyd\u00e1n\u00edch aplikac\u00ed tohoto projektu naleznete v souboru NEWS v ko\u0159enov\u00e9m adres\u00e1\u0159i aplikace IcedTea-Web. ITWdescO1title=Modul\u00e1rn\u00ed ITWdescO1text=M\u016f\u017eete snadno dod\u00e1vat aplikac\u00edm mo\u017enosti protokolu JNLP. ITWdescO2title=\u0160et\u0159\u00ed pam\u011b\u0165 ITWdescO2text=M\u016f\u017eete spou\u0161t\u011bt programy ve sd\u00edlen\u00fdch prost\u0159ed\u00edch JVM. ITWdescO3title=Rychl\u00fd start ITWdescO3text=Urychlen\u00ed startu aplikac\u00ed spou\u0161t\u011bn\u00edm z vyrovn\u00e1vac\u00ed pam\u011bti. ITWdescO4title=Zabezpe\u010den\u00ed ITWdescO4text=V\u0161echny aplikace m\u016f\u017eete spou\u0161t\u011bt v izolovan\u00e9m prostoru a protokolovat jejich aktivity. ITWdescO5title=Automatick\u00e9 aktualizace ITWdescO5text=Aplikace se m\u016f\u017eou automaticky aktualizovat bez speci\u00e1ln\u00edho k\u00f3du. ITWdescO6title=Nasazen\u00ed po s\u00edti ITWdescO6text=Nasazujte aplikace p\u0159es internet, nikoliv pomoc\u00ed instal\u00e1tor\u016f. ITWdescO7title=Otev\u0159en\u00fd zdrojov\u00fd k\u00f3d ITWdescO7text=GNU Lesser General Public License. ITWdescL1=V\u00edce informac\u00ed naleznete na {0} nebo p\u0159\u00edmo na domovsk\u00fdch str\u00e1nk\u00e1ch {1}. ITWdescWikiUrlTitle=wiki projektu IcedTea ITWdescItwWikiUrlTitle=IcedTea-Web ITWdescL2=Pomoc p\u0159i \u0159e\u0161en\u00ed b\u011b\u017en\u00fdch pot\u00ed\u017e\u00ed s aplikac\u00ed IcedTea-Web najdete {0}. ITWdescIssuesUrlTitle=zde ITWdescL3=Hlavn\u00ed vlastnosti NetX: ITWoptionsL1={0} projektu IcedTea je dostupn\u00e1 na wiki. ITWoptionsQuickStartUrlCaption=Rychl\u00e1 \u00favodn\u00ed p\u0159\u00edru\u010dka ITWoptionsCodeUrlUrlCaption=stylu z\u00e1pisu k\u00f3du ITWoptionsL2=Pokyny ke {0} a instrukce pro {1} pro IcedTea-Web jsou takt\u00e9\u017e dostupn\u00e9. Opravy doprov\u00e1zejte testy jednotliv\u00fdch \u010d\u00e1st\u00ed (unit tests) a {2}, ne\u017e je za\u0161lete do {3}. ITWoptionsEclipseUrlCaption=nastaven\u00ed v\u00fdvojov\u00e9ho prost\u0159ed\u00ed Eclipse ITWoptionsReproducersUrlCaption=testy vnit\u0159n\u00ed integrace ITWoptionsDistroUrlCaption=mailing listu ITWoptionsL3=P\u0159isp\u00edv\u00e1n\u00ed do projektu: # policyeditor man (note, spaces (especially the one around markup) are important due to man pages markup). Only bold tag is now recognized by ReplacingTextFormatter. PEintro= - zobrazen\u00ed a \u00fapravy nastaven\u00ed bezpe\u010dnostn\u00edch z\u00e1sad pro javaws a z\u00e1suvn\u00fd modul prohl\u00ed\u017ee\u010de PEsynopseP1=policy_file PEsynopseP2=url PEdescL1=je grafick\u00e1 aplikace s omezenou podporou p\u0159\u00edkazov\u00e9 \u0159\u00e1dky slou\u017e\u00edc\u00ed ke zobrazen\u00ed a \u00faprav\u011b nastaven\u00ed bezpe\u010dnostn\u00edch z\u00e1sad aplet\u016f pou\u017e\u00edvan\u00e1 implementac\u00ed rozhran\u00ed javaws pou\u017e\u00edvanou aplikac\u00ed IcedTea-Web a z\u00e1suvn\u00fdm modulem prohl\u00ed\u017ee\u010de. Jedn\u00e1 se o jednodu\u0161\u0161\u00ed, sn\u00e1ze pou\u017eitelnou a p\u0159\u00edstupn\u011bj\u0161\u00ed alternativu ke standardn\u00edmu n\u00e1stroji JDK Policy Tool. Spr\u00e1vci a zku\u0161en\u00ed u\u017eivatel\u00e9, kte\u0159\u00ed pot\u0159ebuj\u00ed dokonalou kontrolu nad soubory se z\u00e1sadami by m\u011bli rad\u011bji pou\u017e\u00edt Policy Tool ne\u017e n\u00e1stroj PolicyEditor. PEdescL2=Pokud je p\u0159\u00edkaz spu\u0161t\u011bn bez dal\u0161\u00edch argument\u016f, neotev\u0159e se \u017e\u00e1dn\u00fd soubor. P\u0159i n\u00e1sledn\u00e9m ulo\u017een\u00ed souboru budete dot\u00e1z\u00e1n\u00ed, kam se m\u00e1 soubor ulo\u017eit. V opa\u010dn\u00e9m p\u0159\u00edpad\u011b pokud je cesta k souboru zad\u00e1na jako argument v p\u0159\u00edkazov\u00e9 \u0159\u00e1dce, zadan\u00e1 cesta bude pou\u017eita jako soubor se z\u00e1sadami. PEexampleL1=Zobraz\u00ed grafick\u00e9 rozhran\u00ed a otev\u0159e v\u00fdchoz\u00ed soubor se z\u00e1sadami. PEexampleL2=Zobraz\u00ed grafick\u00fd editor bez otev\u0159en\u00e9ho souboru se z\u00e1sadami. # javaws man (note, spaces (especially the one around markup) are important due to man pages markup). Only bold tag is now recognized by ReplacingTextFormatter. JWSintro= - klient aplikace Java Web Start JWSdescL1=je implementac\u00ed klienta protokolu JNLP. Pou\u017e\u00edv\u00e1 soubor JNLP (Java Network Launch Protocol) k bezpe\u010dn\u00e9mu spou\u0161t\u011bn\u00ed vzd\u00e1len\u00fdch aplikac\u00ed a aplet\u016f Java. Tato implementace {0} je vytv\u00e1\u0159ena v r\u00e1mci projektu IcedTea a je zalo\u017eena na projektu NetX. JWSdescL2=Soubor JNLP je v jazyce xml a popisuje, jak bezpe\u010dn\u011b spou\u0161t\u011bt vzd\u00e1len\u00e9 aplikace a aplety Java. JWSoptionsL1=P\u0159i zad\u00e1v\u00e1n\u00ed voleb m\u016f\u017ee b\u00fdt soubor JNLP zad\u00e1n v p\u0159\u00edkazu za volbou -jnlp, nebo jako samostatn\u00e1 volba bez dal\u0161\u00edch argument\u016f. Soubor HTML, kter\u00fd spou\u0161t\u00ed soubor JNLP lze uv\u00e9st za argumentem -html. JWSoptionsL2=Soubor JNLP lze specifikovat bu\u010f pomoc\u00ed adresy URL nebo pomoc\u00ed cesty k m\u00edstn\u00edmu souboru. JWSoptionsL3=Soubor JNLP by m\u011bl b\u00fdt uveden pouze jednou. Bu\u010f jako hlavn\u00ed argument za parametrem -jnlp, nebo v souboru HTML. JWSoptionsTitle1=Mo\u017enosti spou\u0161t\u011bn\u00ed: JWSoptionsTitle2=Ovl\u00e1dac\u00ed mo\u017enosti: JWSexampleL1=Zobraz\u00ed z\u00e1kladn\u00ed n\u00e1pov\u011bdu a informace o aplikaci. JWSexampleL2=Zobraz\u00ed z\u00e1kladn\u00ed n\u00e1pov\u011bdu a informace o aplikaci pouze v termin\u00e1lu. JWSexampleL3=Spust\u00ed aplikaci {0} p\u0159\u00edmo z um\u00edst\u011bn\u00ed {1}, ani\u017e by aplikace byla sta\u017eena, bez kontroly hlavi\u010dek a ve vynucen\u00e9m virtu\u00e1ln\u00edm prost\u0159ed\u00ed. # Boot options, message should be shorter than this ----------------> BOUsage=[-volby-spu\u0161t\u011bn\u00ed] soubor jnlp BOUsage2=[-volby-ovl\u00e1d\u00e1n\u00ed] BOJnlp= Um\u00edst\u011bn\u00ed souboru JNLP ke spu\u0161t\u011bn\u00ed (URL nebo soubor) BOHtml= Um\u00edst\u011bn\u00ed souboru HTML ke spu\u0161t\u011bn\u00ed (URL nebo soubor) K vybr\u00e1n\u00ed aplet\u016f na str\u00e1nce m\u016f\u017eete pou\u017e\u00edt parametr ALL nebo \u010d\u00edsla (jako 1 2 5). A\u010dkoliv se jedn\u00e1 o experiment\u00e1ln\u00ed p\u0159ep\u00edna\u010d, jeho pou\u017eit\u00ed by st\u00e1le m\u011blo b\u00fdt bezpe\u010dn\u00e9. BOArg= P\u0159id\u00e1 p\u0159ed spu\u0161t\u011bn\u00edm parametr aplikace. BOParam= P\u0159id\u00e1 p\u0159ed spu\u0161t\u011bn\u00edm parametr apletu. BOProperty= P\u0159ed spu\u0161t\u011bn\u00edm nastav\u00ed syst\u00e9movou vlastnost. BOUpdate= Zkontroluje aktualizace. BOLicense= Zobraz\u00ed licenci GPL a ukon\u010d\u00ed aplikaci. BOVerbose= Zapne podrobn\u00fd v\u00fdstup. BOAbout= Uk\u00e1\u017ee vzorovou aplikaci. BOVersion= Vyp\u00ed\u0161e verzi aplikace IcedTea-Web a ukon\u010d\u00ed aplikaci. BONosecurity= Vypne zabezpe\u010den\u00e9 b\u011bhov\u00e9 prost\u0159ed\u00ed. BONoupdate= Vypne kontrolu aktualizac\u00ed. BOHeadless= Vypne ve\u0161ker\u00e9 grafick\u00e9 prvky u\u017eiv. rozhran\u00ed IcedTea-Web. BOStrict= Zapne striktn\u00ed kontrolu souborov\u00e9ho form\u00e1tu JNLP. BOViewer= Zobraz\u00ed prohl\u00ed\u017ee\u010d d\u016fv\u011bryhodn\u00fdch certifik\u00e1t\u016f. BOXml= Pou\u017eije pro anal\u00fdzu souboru JNLP striktn\u00ed XML parser. BOredirect= N\u00e1sleduje p\u0159esm\u011brov\u00e1n\u00ed HTTP. BXnofork= Zak\u00e1\u017ee vytv\u00e1\u0159en\u00ed jin\u00fdch prost\u0159ed\u00ed JVM. BXclearcache= Vy\u010dist\u00ed vyrovn\u00e1vac\u00ed pam\u011b\u0165 aplikace JNLP. BXignoreheaders= Vynech\u00e1 ov\u011b\u0159ov\u00e1n\u00ed hlavi\u010dky souboru JAR. BXoffline= Zabr\u00e1n\u00ed ITW v p\u0159ipojen\u00ed k s\u00edti. Bude pou\u017eita pouze vyrovn\u00e1vac\u00ed pam\u011b\u0165. Aplikace se st\u00e1le m\u016f\u017ee p\u0159ipojit. BOHelp1= Vyp\u00ed\u0161e informace o podporovan\u00fdch p\u0159\u00edkazech a z\u00e1kladn\u00edm pou\u017eit\u00ed. BOHelp2= Vyp\u00ed\u0161e informace o podporovan\u00fdch p\u0159\u00edkazech a z\u00e1kladn\u00edm pou\u017eit\u00ed. Lze tak\u00e9 zadat parametr k vyps\u00e1n\u00ed podrobn\u00e9 n\u00e1pov\u011bdy k tomuto p\u0159\u00edkazu. BOTrustnone= M\u00edsto dot\u00e1z\u00e1n\u00ed se u\u017eivatele bude p\u0159edpokl\u00e1dat z\u00e1pornou odpov\u011b\u010f na v\u0161echny dotazy. # Itweb-settings boot commands IBOList=Zobraz\u00ed seznam v\u0161ech nastaven\u00ed aplikace IcedTea-Web a jejich aktu\u00e1ln\u00edch hodnot. IBOGet=Zobraz\u00ed hodnotu zadan\u00e9ho nastaven\u00ed. IBOInfo=Zobraz\u00ed dal\u0161\u00ed informace o uveden\u00e9m nastaven\u00ed. Obsahuje popis, aktu\u00e1ln\u00ed hodnotu, mo\u017en\u00e9 dal\u0161\u00ed hodnoty a zdroj nastaven\u00ed. IBOSet=Nastav\u00ed nov\u011b zadanou hodnotu nastaven\u00ed (pokud p\u016fjde o platnou hodnotu). IBOResetAll= Obnov\u00ed v\u00fdchoz\u00ed hodnoty v\u0161ech nastaven\u00ed. IBOReset=Obnov\u00ed v\u00fdchoz\u00ed hodnotu zadan\u00e9ho nastaven\u00ed. IBOCheck=Zkontroluje, zda maj\u00ed sou\u010dasn\u00e1 nastaven\u00ed platn\u00e9 hodnoty. PBOFile=Ud\u00e1v\u00e1 cestu k souboru se z\u00e1sadami, kter\u00fd se m\u00e1 otev\u0159\u00edt. Pokud je zad\u00e1n p\u0159esn\u011b jeden argument, a nejedn\u00e1 se o tento p\u0159\u00edznak, je interpretov\u00e1n jako cesta k souboru, kter\u00fd se m\u00e1 otev\u0159\u00edt, jako kdyby byl tento p\u0159\u00edznak zad\u00e1n prvn\u00ed. Tento p\u0159\u00edznak existuje hlavn\u011b z d\u016fvodu kompatibility s n\u00e1strojem Policy Tool, av\u0161ak je pot\u0159eba tak\u00e9 p\u0159i otev\u00edr\u00e1n\u00ed souboru se z\u00e1sadami a p\u0159i pou\u017eit\u00ed p\u0159\u00edznaku -codebase. PBOCodebase=Ud\u00e1v\u00e1 adresu URL z\u00e1kladny k\u00f3du (codebase) apletu. Pokud uv\u00e1d\u011bn\u00e1 z\u00e1kladna k\u00f3du ji\u017e existuje v souboru se z\u00e1sadami (existuje-li i samotn\u00fd soubor), bude vybr\u00e1na p\u0159i spu\u0161t\u011bn\u00ed editoru. Pokud se jedn\u00e1 o novou z\u00e1kladnu k\u00f3du, bude p\u0159id\u00e1na a vybr\u00e1na. P\u0159i pou\u017eit\u00ed p\u0159\u00edznaku -codebase m\u016f\u017ee b\u00fdt zad\u00e1no v\u00edce adres URL. V takov\u00e9m p\u0159\u00edpad\u011b je nutn\u00e9 odd\u011blovat je mezerami. V takov\u00e9m p\u0159\u00edpad\u011b bude vybr\u00e1na a p\u0159id\u00e1na posledn\u00ed uveden\u00e1 z\u00e1kladna k\u00f3du. Pokud je tento p\u0159\u00edznak zad\u00e1n v\u00edce ne\u017e jednou, bude pou\u017eit pouze prvn\u00ed v\u00fdskyt. # Option Parser OPUnevenParams=Pro argument {0} se o\u010dek\u00e1v\u00e1 sud\u00fd po\u010det parametr\u016f. # NumberOfArguments descriptions. NOAnone=Neo\u010dek\u00e1v\u00e1 se \u017e\u00e1dn\u00fd argument. NOAone=O\u010dek\u00e1v\u00e1 se p\u0159esn\u011b jeden argument. NOAonemore=O\u010dek\u00e1v\u00e1 se jeden nebo v\u00edce argument\u016f. NOAevennumber=O\u010dek\u00e1v\u00e1 se sud\u00fd po\u010det argument\u016f ve form\u00e1tu parametr=hodnota. # Allowed man sections manNAME=N\u00c1ZEV manSYNOPSIS=ANOTACE manDESCRIPTION=POPIS manOPTIONS=MO\u017dNOSTI manCOMMANDS=P\u0158\u00cdKAZY manEXAMPLES=P\u0158\u00cdKLADY manFILES=SOUBORY manBUGS=CHYBY manAUTHOR=AUTOR manSEE_ALSO=VIZ T\u00c9\u017d # Cache CAutoGen=vygenerov\u00e1no automaticky \u2013 nem\u011bnit CNotCacheable={0} nen\u00ed zdroj, kter\u00fd lze zapsat do vyrovn\u00e1vac\u00ed pam\u011bti. CDownloading=Prob\u00edh\u00e1 stahov\u00e1n\u00ed. CComplete=Dokon\u010deno CChooseCache=Zvolit adres\u00e1\u0159 pro vyrovn\u00e1vac\u00ed pam\u011b\u0165... CChooseCacheInfo=NetX pot\u0159ebuje um\u00edst\u011bn\u00ed pro uchov\u00e1v\u00e1n\u00ed soubor\u016f vyrovn\u00e1vac\u00ed pam\u011bti. CChooseCacheDir=Adres\u00e1\u0159 vyrovn\u00e1vac\u00ed pam\u011bti CCannotClearCache=Moment\u00e1ln\u011b nelze vy\u010distit vyrovn\u00e1vac\u00ed pam\u011b\u0165. Zkuste to pozd\u011bji. Pokud probl\u00e9m p\u0159etrv\u00e1v\u00e1, zkuste zav\u0159\u00edt prohl\u00ed\u017ee\u010de a aplikace JNLP. Jako posledn\u00ed prost\u0159edek m\u016f\u017eete zkusit zab\u00edt v\u0161echny Java aplikace. \\\n Vyrovn\u00e1vac\u00ed pam\u011b\u0165 m\u016f\u017eete vy\u010distit pomoc\u00ed p\u0159\u00edkazu javaws -Xclearcache nebo pomoc\u00ed programu itw-settings, volby Vyrovn\u00e1vac\u00ed pam\u011b\u0165 -> Zobrazit soubory... -> Vy\u010distit vyrovn\u00e1vac\u00ed pam\u011b\u0165. CFakeCache=Vyrovn\u00e1vac\u00ed pam\u011b\u0165 je po\u0161kozena. Prob\u00edh\u00e1 oprava. CFakedCache=Po\u0161kozen\u00e1 vyrovn\u00e1vac\u00ed pam\u011b\u0165 byla opravena. D\u016frazn\u011b doporu\u010dujeme co nejd\u0159\u00edve spustit p\u0159\u00edkaz \u201ejavaws -Xclearcache\u201c a pak znovu spustit aplikaci. M\u016f\u017eete tak\u00e9 pou\u017e\u00edt program itw-settings, volby Vyrovn\u00e1vac\u00ed pam\u011b\u0165 -> Zobrazit soubory... -> Vy\u010distit vyrovn\u00e1vac\u00ed pam\u011b\u0165. # extended access warning pane EXAWdesktopWants=Ikona z\u00e1stupce na plo\u0161e (aplikace ji nab\u00edz\u00ed) EXAWdesktopDontWants=Ikona z\u00e1stupce na plo\u0161e (aplikace ji nenab\u00edz\u00ed, ale p\u0159esto ji m\u016f\u017eete vytvo\u0159it) EXAWsubmenu=Ikona z\u00e1stupce v m\u00edstn\u00ed nab\u00eddce (aplikace se ji pokus\u00ed vytvo\u0159it v podnab\u00eddce \u2013 {0}) EXAWmenuWants=Ikona z\u00e1stupce v m\u00edstn\u00ed nab\u00eddce (aplikace ji nab\u00edz\u00ed) EXAWmenuDontWants=Ikona z\u00e1stupce v m\u00edstn\u00ed nab\u00eddce (aplikace ji nenab\u00edz\u00ed, ale p\u0159esto ji m\u016f\u017eete vytvo\u0159it) EXAWsettingsInfo=Va\u0161e sou\u010dasn\u00e9 nastaven\u00ed: {0} M\u016f\u017eete ho zm\u011bnit v programu itweb-settings v panelu {1}. EXAWsettingsManage=Spravovat existuj\u00edc\u00ed polo\u017eky nab\u00eddek v programu itweb-settings v panelu {0}. EXAWrememberByApp=Pamatovat podle aplikace EXAWrememberByPage=Pamatovat podle dom\u00e9ny EXAWdontRemember=Nepamatovat EXAWrememberByAppTooltip=Tato aplikace nebude po\u017eadovat dal\u0161\u00ed opr\u00e1vn\u011bn\u00ed. EXAWrememberByPageTooltip=V\u0161echny aplikace z t\u00e9to dom\u00e9ny ji\u017e nebudou zas\u00edlat dal\u0161\u00ed dotazy a pou\u017eij\u00ed sou\u010dasn\u00e9 rozhodnut\u00ed na v\u0161echna opr\u00e1vn\u011bn\u00ed. EXAWdontRememberTooltip=Va\u0161e rozhodnut\u00ed bude pou\u017eito pouze pro toto jedin\u00e9 opr\u00e1vn\u011bn\u00ed pro toto jedin\u00e9 spu\u0161t\u011bn\u00ed. EXAWbrowser=z\u00e1stupce prohl\u00ed\u017ee\u010de na plo\u0161e EXAWgenjnlp=vytvo\u0159en soubor jnlp EXAWjnlphref=jnlp href EXAWhtml=javaws html EXAWfixhref=oprav\u00ed pot\u00ed\u017ee v jnlp-href EXAWbrowserTolltip=Z\u00e1stupce prohl\u00ed\u017ee\u010de
  • Tato volba vytvo\u0159\u00ed z\u00e1stupce, s jeho\u017e pomoc\u00ed otev\u0159ete prohl\u00ed\u017ee\u010d s na\u010dtenou aktu\u00e1ln\u00ed str\u00e1nkou.
  • Pokud v\u00e1\u0161 prohl\u00ed\u017ee\u010d podporuje prohl\u00ed\u017een\u00ed offline, je to ta nejbezpe\u010dn\u011bj\u0161\u00ed mo\u017enost.
  • EXAWbrowsersTolltip=prohl\u00ed\u017ee\u010d pou\u017eit\u00fd pro spu\u0161t\u011bn\u00ed tohoto apletu (spust\u00ed IcedTea-Web pozd\u011bji)
  • V\u00fdchoz\u00ed prohl\u00ed\u017ee\u010d byl p\u0159ednastaven.
  • M\u016f\u017eete p\u0159idat dal\u0161\u00ed prohl\u00ed\u017ee\u010de dle va\u0161ich preferenc\u00ed.
  • EXAWgeneratedTolltip=
  • Soubor JNLP bude vygenerov\u00e1n ze sou\u010dasn\u00e9 str\u00e1nky HTML.
  • Kdy\u017e pou\u017eijete z\u00e1stupce ke spu\u0161t\u011bn\u00ed, rozhran\u00ed javaws spust\u00ed tento soubor JNLP.
  • Aplet pak pob\u011b\u017e\u00ed bez prohl\u00ed\u017ee\u010de.
  • A\u010dkoliv je tato funkce experiment\u00e1ln\u00ed, funguje p\u0159ekvapiv\u011b dob\u0159e.
  • EXAWhrefTolltip=N\u011bkter\u00e9 aplety pouze odkazuj\u00ed na soubor JNLP, kter\u00fd obsahuje informace o zdroj\u00edch t\u00e9to aplikace.
  • Pou\u017eit\u00edm t\u00e9to mo\u017enosti dan\u00fd soubor JNLP ulo\u017e\u00edte pro pou\u017eit\u00ed p\u0159i n\u00e1sleduj\u00edc\u00edch spu\u0161t\u011bn\u00edch.
  • Rozhran\u00ed javaws aplet spust\u00ed a ten pob\u011b\u017e\u00ed mimo prohl\u00ed\u017ee\u010d.
  • A\u010dkoliv to zn\u00ed dob\u0159e, p\u0159ekvapiv\u011b to nefunguje.
  • EXAWhtmlTolltip=Pou\u017eit\u00edm p\u0159ep\u00edna\u010de -html se m\u016f\u017ee rozhran\u00ed javaws pokusit analyzovat html, aplet z n\u011bho extrahovat a spustit ho mimo prohl\u00ed\u017ee\u010d.
  • Vysoce experiment\u00e1ln\u00ed funkce.
  • Ale fakt super!
  • EXAWfixTolltip=N\u011bkter\u00e9 soubory JNLP odkazovan\u00e9 z aplet\u016f nejsou navr\u017eeny tak, aby mohly b\u00fdt pou\u017eity jako aplikace JNLP.
  • Tato volba p\u0159id\u00e1 do dan\u00e9ho souboru JNLP elementy, o kter\u00fdch se v\u00ed, \u017ee \u010dasto chyb\u00ed (pokud opravdu chyb\u00ed).
  • # Security SFileReadAccess=Aplikace vy\u017eaduje p\u0159\u00edstup ke \u010dten\u00ed souboru {0}. Chcete tuto akci povolit? SFileWriteAccess=Aplikace vy\u017eaduje p\u0159\u00edstup k zapisov\u00e1n\u00ed do souboru {0}. Chcete tuto akci povolit? SDesktopShortcut=Aplikace vy\u017eaduje opr\u00e1vn\u011bn\u00ed k vytvo\u0159en\u00ed spou\u0161t\u011bc\u00edho souboru na plo\u0161e anebo v m\u00edstn\u00ed nab\u00eddce. Chcete tuto akci povolit? SSigUnverified=Digit\u00e1ln\u00ed podpis aplikace nelze ov\u011b\u0159it. Chcete aplikaci spustit? Aplikace z\u00edsk\u00e1 neomezen\u00fd p\u0159\u00edstup k va\u0161emu po\u010d\u00edta\u010di. SSigVerified=Digit\u00e1ln\u00ed podpis aplikace byl ov\u011b\u0159en. Chcete aplikaci spustit? Aplikace z\u00edsk\u00e1 neomezen\u00fd p\u0159\u00edstup k va\u0161emu po\u010d\u00edta\u010di. SSignatureError=Digit\u00e1ln\u00ed podpis aplikace obsahuje chybu. Chcete aplikaci spustit? Aplikace z\u00edsk\u00e1 neomezen\u00fd p\u0159\u00edstup k va\u0161emu po\u010d\u00edta\u010di. SUntrustedSource=Digit\u00e1ln\u00ed podpis nelze ov\u011b\u0159it pomoc\u00ed d\u016fv\u011bryhodn\u00e9ho zdroje. Aplikaci spus\u0165te, pouze pokud v\u011b\u0159\u00edte p\u016fvodu aplikace. SWarnFullPermissionsIgnorePolicy=Spou\u0161t\u011bn\u00e9mu k\u00f3du budou ud\u011blena pln\u00e1 opr\u00e1vn\u011bn\u00ed bez ohledu na p\u0159\u00edpadn\u00e1 va\u0161e vlastn\u00ed z\u00e1sady chov\u00e1n\u00ed prost\u0159ed\u00ed Java. STrustedSource=Digit\u00e1ln\u00ed podpis byl ov\u011b\u0159en pomoc\u00ed d\u016fv\u011bryhodn\u00e9ho zdroje. SClipboardReadAccess=Aplikace po\u017eaduje p\u0159\u00edstup ke \u010dten\u00ed syst\u00e9mov\u00e9 schr\u00e1nky. Chcete tuto akci povolit? SClipboardWriteAccess=Aplikace vy\u017eaduje p\u0159\u00edstup k zapisov\u00e1n\u00ed do syst\u00e9mov\u00e9 schr\u00e1nky. Chcete tuto akci povolit? SPrinterAccess=Aplikace vy\u017eaduje p\u0159\u00edstup k tisk\u00e1rn\u011b. Chcete tuto akci povolit? SNetworkAccess=Aplikace vy\u017eaduje povolen\u00ed k vytvo\u0159en\u00ed spojen\u00ed s {0}. Chcete tuto akci povolit? SNoAssociatedCertificate=<\u017e\u00e1dn\u00fd p\u0159idru\u017een\u00fd certifik\u00e1t> SUnverified=(neov\u011b\u0159eno) SAlwaysTrustPublisher=V\u017edy d\u016fv\u011b\u0159ovat obsahu od tohoto vydavatele SHttpsUnverified=Certifik\u00e1t HTTPS webu nelze ov\u011b\u0159it. SRememberOption=Zapamatovat si tuto volbu? SRememberAppletOnly=Pro aplet SRememberCodebase=Pro web {0} SUnsignedSummary=Do\u0161lo k pokusu o spu\u0161t\u011bn\u00ed nepodepsan\u00e9 aplikace Java. SUnsignedDetail=Do\u0161lo k pokusu o spu\u0161t\u011bn\u00ed nepodepsan\u00e9 aplikace z n\u00e1sleduj\u00edc\u00edho um\u00edst\u011bn\u00ed:
      {0}
    Str\u00e1nka, kter\u00e1 p\u0159edala tento po\u017eadavek:
      {1}

    Doporu\u010dujeme, abyste spou\u0161t\u011bli aplikace pouze z web\u016f, kter\u00fdm d\u016fv\u011b\u0159ujete. SUnsignedAllowedBefore=Tento aplet jste ji\u017e d\u0159\u00edve povolili ({0}). SUnsignedRejectedBefore=Tento aplet jste ji\u017e d\u0159\u00edve odm\u00edtli ({0}). SUnsignedQuestion=Povolit spu\u0161t\u011bn\u00ed apletu? SPartiallySignedSummary=Podeps\u00e1ny jsou jen \u010d\u00e1sti k\u00f3du t\u00e9to aplikace. SPartiallySignedDetail=Tato aplikace obsahuje podepsan\u00fd i nepodepsan\u00fd k\u00f3d. Podepsan\u00fd k\u00f3d je bezpe\u010dn\u00fd, pokud d\u016fv\u011b\u0159ujete poskytovateli tohoto k\u00f3du. Nepodepsan\u00e9 \u010d\u00e1sti v\u0161ak mohou obsahovat k\u00f3d, kter\u00fd nen\u00ed pod kontrolou d\u016fv\u011bryhodn\u00e9ho poskytovatele. SPartiallySignedQuestion=Chcete p\u0159esto pokra\u010dovat a spustit aplikaci? SAuthenticationPrompt=Server {0} na adrese {1} vy\u017eaduje ov\u011b\u0159en\u00ed. Zpr\u00e1va: \u201e{2}\u201c SJNLPFileIsNotSigned=Tato aplikace obsahuje digit\u00e1ln\u00ed podpis, v r\u00e1mci kter\u00e9ho v\u0161ak nen\u00ed podeps\u00e1n spou\u0161t\u011bn\u00fd soubor JNLP. STrustedOnlyAttributeFailure=Element \u201etrusted-only\u201c v manifestu aplikace m\u00e1 hodnotu true. {0} a po\u017eaduje n\u00e1sleduj\u00edc\u00ed \u00farove\u0148 opr\u00e1vn\u011bn\u00ed: {1}. To nen\u00ed dovoleno. STOAsignedMsgFully= Aplet je kompletn\u011b podepsan\u00fd. STOAsignedMsgAndSandbox= Aplet je kompletn\u011b podepsan\u00fd a spou\u0161t\u00ed se v izolovan\u00e9m prostoru (sandbox). STOAsignedMsgPartiall= Aplet nen\u00ed kompletn\u011b podepsan\u00fd. STempNetwork=Povolit p\u0159\u00edchoz\u00ed a odchoz\u00ed s\u00ed\u0165ov\u00e1 p\u0159ipojen\u00ed STempReadFilesAndProperties=Opr\u00e1vn\u011bn\u00ed pouze ke \u010dten\u00ed ke v\u0161em soubor\u016fm a vlastnostem STempWriteFilesAndProperties=Opr\u00e1vn\u011bn\u00ed pouze k z\u00e1pisu ke v\u0161em soubor\u016fm a vlastnostem STempReflectionAndExternal=P\u0159\u00edstup k Java Reflection a extern\u00edmu k\u00f3du STempAllMedia=V\u0161echna m\u00e9dia (p\u0159\u00edstup k tisku, audiu, schr\u00e1nce) # Security - used for the More Information dialog SBadKeyUsage=Zdroj obsahuje polo\u017eky, u nich\u017e roz\u0161\u00ed\u0159en\u00ed pou\u017eit\u00ed kl\u00ed\u010de KeyUsage certifik\u00e1tu podepisovatele nedovoluje podeps\u00e1n\u00ed k\u00f3du. SBadExtendedKeyUsage=Zdroj obsahuje polo\u017eky, u nich\u017e roz\u0161\u00ed\u0159en\u00ed pou\u017eit\u00ed kl\u00ed\u010de ExtendedKeyUsage certifik\u00e1tu podepisovatele nedovoluje podeps\u00e1n\u00ed k\u00f3du. SBadNetscapeCertType=Zdroj obsahuje polo\u017eky, u nich\u017e roz\u0161\u00ed\u0159en\u00ed pou\u017eit\u00ed kl\u00ed\u010de NetscapeCertType certifik\u00e1tu podepisovatele nedovoluje podeps\u00e1n\u00ed k\u00f3du. SHasExpiredCert=Platnost digit\u00e1ln\u00edho podpisu vypr\u0161ela. SHasExpiringCert=Zdroje obsahuj\u00ed polo\u017eky, u nich\u017e vypr\u0161\u00ed platnost certifik\u00e1tu jejich podepisovatele do \u0161esti m\u011bs\u00edc\u016f. SNotYetValidCert=Zdroje obsahuj\u00ed polo\u017eky, u nich\u017e je\u0161t\u011b nen\u00ed platn\u00fd certifik\u00e1t podepisovatele. SUntrustedCertificate=Digit\u00e1ln\u00ed podpis byl vytvo\u0159en pomoc\u00ed ned\u016fv\u011bryhodn\u00e9ho certifik\u00e1tu. STrustedCertificate=Digit\u00e1ln\u00ed podpis byl vytvo\u0159en pomoc\u00ed d\u016fv\u011bryhodn\u00e9ho certifik\u00e1tu. SCNMisMatch=O\u010dek\u00e1van\u00fd n\u00e1zev hostitele pro tento certifik\u00e1t je: {0}.
    Adresa, ke kter\u00e9 se navazuje p\u0159ipojen\u00ed: {1}. SRunWithoutRestrictions=Tato aplikace bude spu\u0161t\u011bna bez obvykl\u00fdch bezpe\u010dnostn\u00edch omezen\u00ed aplikovan\u00fdch platformou Java. SCertificateDetails=Podrobnosti certifik\u00e1tu # Security - certificate information SIssuer=Vydavatel SSerial=S\u00e9riov\u00e9 \u010d\u00edslo SMD5Fingerprint=Otisk MD5 SSHA1Fingerprint=Otisk SHA1 SSignature=Podpis SSignatureAlgorithm=Algoritmus podpisu SSubject=Subjekt SValidity=Platnost # Certificate Viewer CVCertificateViewer=Certifik\u00e1ty CVCertificateType=Typ certifik\u00e1tu CVDetails=Podrobnosti CVExport=Exportovat CVExportPasswordMessage=Zadejte heslo pro ochranu souboru s kl\u00ed\u010di: CVImport=Importovat CVImportPasswordMessage=Zadejte heslo pro p\u0159\u00edstup k souboru: CVIssuedBy=Vydavatel: CVIssuedTo=P\u0159\u00edjemce: CVPasswordTitle=Vy\u017eadov\u00e1no ov\u011b\u0159en\u00ed CVRemove=Odstranit CVRemoveConfirmMessage=Skute\u010dn\u011b chcete odstranit vybran\u00fd certifik\u00e1t? CVRemoveConfirmTitle=Potvrzen\u00ed odstran\u011bn\u00ed certifik\u00e1tu CVUser=U\u017eivatel CVSystem=Syst\u00e9m # KeyStores: see KeyStores.java KS=\u00dalo\u017ei\u0161t\u011b kl\u00ed\u010d\u016f KSCerts=D\u016fv\u011bryhodn\u00e9 certifik\u00e1ty KSJsseCerts=D\u016fv\u011bryhodn\u00e9 certifik\u00e1ty JSSE KSCaCerts=D\u016fv\u011bryhodn\u00e9 certifik\u00e1ty Root CA KSJsseCaCerts=D\u016fv\u011bryhodn\u00e9 certifik\u00e1ty JSSE Root CA KSClientCerts=Certifik\u00e1ty pro ov\u011b\u0159en\u00ed klienta # KeyStores: set password KSresultUntilNow=P\u0159i operaci s ulo\u017ei\u0161t\u011bm kl\u00ed\u010d\u016f {1} do\u0161lo k v\u00fdjimce {0}. Po\u010det pokus\u016f o odem\u010den\u00ed: {2} KSinvalidPassword=Neplatn\u00e9 heslo? KSheadlesWarning=Re\u017eim p\u0159\u00edkazov\u00e9 \u0159\u00e1dky moment\u00e1ln\u011b nepodporuje zad\u00e1v\u00e1n\u00ed hesla za b\u011bhu. KSnwPassHelp=Zadejte nov\u00e9 heslo a klikn\u011bte na tla\u010d\u00edtko OK. Nebo m\u016f\u017eete opustit tento dialog zm\u00e1\u010dknut\u00edm jak\u00e9hokoliv jin\u00e9ho tla\u010d\u00edtka. # Deployment Configuration messages DCIncorrectValue=Vlastnost {0} m\u00e1 nespr\u00e1vnou hodnotu {1}. Mo\u017en\u00e9 hodnoty {2}. DCInternal=Vnit\u0159n\u00ed chyba: {0} DCSourceInternal= DCUnknownSettingWithName=Vlastnost {0} je nezn\u00e1m\u00e1. DCmaindircheckNotexists=P\u0159es v\u0161echny pokusy nebyl v\u00e1\u0161 konfigura\u010dn\u00ed adres\u00e1\u0159 {0} nalezen. DCmaindircheckNotdir=V\u00e1\u0161 konfigura\u010dn\u00ed adres\u00e1\u0159 {0} nen\u00ed adres\u00e1\u0159. DCmaindircheckRwproblem=V\u00e1\u0161 konfigura\u010dn\u00ed adres\u00e1\u0159 {0} nen\u00ed mo\u017en\u00e9 spr\u00e1vn\u011b \u010d\u00edst ani do n\u011bj zapisovat. # Value Validator messages. Messages should follow "Possible values ..." VVPossibleValues=Mo\u017en\u00e9 hodnoty {0} VVPossibleBooleanValues=jsou {0} nebo {1}. VVPossibleFileValues=obsahuj\u00ed absolutn\u00ed um\u00edst\u011bn\u00ed souboru nebo adres\u00e1\u0159e. VVPossibleRangedIntegerValues=jsou v rozmez\u00ed {0} a\u017e {1} (v\u010detn\u011b). VVPossibleUrlValues=obsahuj\u00ed jakoukoliv platnou adresu URL (nap\u0159. http://icedtea.classpath.org/hg/). # Control Panel - Main CPMainDescriptionShort=Nastaven\u00ed aplikace IcedTea-Web CPMainDescriptionLong=Nastaven\u00ed fungov\u00e1n\u00ed z\u00e1suvn\u00e9ho modulu prohl\u00ed\u017ee\u010de (IcedTeaNPPlugin) a rozhran\u00ed javaws (NetX) # Control Panel - Tab Descriptions CPAboutDescription=Zobrazen\u00ed informace o verzi ovl\u00e1dac\u00edho panelu IcedTea CPNetworkSettingsDescription=Nastaven\u00ed s\u00edt\u011b v\u010detn\u011b zp\u016fsobu p\u0159ipojen\u00ed aplikace IcedTea-Web k Internetu a p\u0159\u00edpadn\u00e9ho pou\u017eit\u00ed proxy server\u016f CPTempInternetFilesDescription=Ukl\u00e1d\u00e1n\u00ed dat aplikac\u00ed prost\u0159ed\u00edm Java, aby bylo p\u0159i p\u0159\u00ed\u0161t\u00edm spu\u0161t\u011bn\u00ed umo\u017en\u011bno rychlej\u0161\u00ed na\u010dten\u00ed CPJRESettingsDescription=Zobrazen\u00ed a spravov\u00e1n\u00ed verze a nastaven\u00ed prost\u0159ed\u00ed Java Runtime Environment pro aplikace a aplety Java CPCertificatesDescription=Pou\u017eit\u00ed certifik\u00e1t\u016f k pozitivn\u00ed identifikaci v\u00e1s, certifikac\u00ed, certifika\u010dn\u00edch autorit a vydavatel\u016f CPSecurityDescription=Konfigurace nastaven\u00ed zabezpe\u010den\u00ed CPDebuggingDescription=Zapnut\u00ed mo\u017enost\u00ed pom\u00e1haj\u00edc\u00edch p\u0159i lad\u011bn\u00ed CPDesktopIntegrationDescription=Nastaven\u00ed, zda m\u00e1 b\u00fdt povoleno vytvo\u0159en\u00ed z\u00e1stupce na plo\u0161e CPJVMPluginArguments=Nastaven\u00ed parametr\u016f prost\u0159ed\u00ed JVM pro z\u00e1suvn\u00fd modul CPJVMitwExec=Nastaven\u00ed prost\u0159ed\u00ed JVM pro aplikaci IcedTea-Web (pracuje nejl\u00e9pe s prost\u0159ed\u00edm OpenJDK) CPJVMitwExecValidation=Ov\u011b\u0159en\u00ed prost\u0159ed\u00ed JVM pro aplikaci IcedTea-Web CPJVMPluginSelectExec=Vyhledat prost\u0159ed\u00ed JVM pro aplikaci IcedTea-Web CPJVMnone=\u017d\u00e1dn\u00e9 v\u00fdsledky ov\u011b\u0159en\u00ed pro cestu CPJVMvalidated=V\u00fdsledky ov\u011b\u0159en\u00ed pro cestu CPJVMvalueNotSet=Hodnota nen\u00ed nastavena. Bude pou\u017eito p\u0159edvolen\u00e9 prost\u0159ed\u00ed JVM. CPJVMnotLaunched=Chyba: proces nebyl spu\u0161t\u011bn. V\u00edce informac\u00ed naleznete ve v\u00fdstupu konzole. CPJVMnoSuccess=Chyba: proces nebyl \u00fasp\u011b\u0161n\u011b ukon\u010den. Podrobnosti naleznete ve v\u00fdstupu konzole, av\u0161ak va\u0161e prost\u0159ed\u00ed Java nen\u00ed spr\u00e1vn\u011b nastaveno. CPJVMopenJdkFound=Excelentn\u00ed! Bylo detekov\u00e1no prost\u0159ed\u00ed OpenJDK. CPJVMoracleFound=V\u00fdborn\u011b! Bylo detekov\u00e1no prost\u0159ed\u00ed Oracle Java. CPJVMibmFound=Dob\u0159e! Bylo detekov\u00e1no prost\u0159ed\u00ed IBM Java. CPJVMgijFound=Varov\u00e1n\u00ed! Bylo detekov\u00e1no prost\u0159ed\u00ed gij. CPJVMstrangeProcess=Zadan\u00e1 cesta je spustiteln\u00fd proces, ov\u0161em nebyl rozpozn\u00e1n jako aplikace Java. Ve v\u00fdstupu konzole ov\u011b\u0159te verzi prost\u0159ed\u00ed Java. CPJVMnotDir=Chyba: cesta, kterou jste vybrali, nen\u00ed adres\u00e1\u0159. CPJVMisDir=OK, cesta, kterou jste vybrali, je adres\u00e1\u0159. CPJVMnoJava=Chyba: adres\u00e1\u0159, kter\u00fd jste vybrali, neobsahuje podadres\u00e1\u0159 a soubor \u201ebin/java\u201c. CPJVMjava=OK, adres\u00e1\u0159, kter\u00fd jste vybrali, obsahuje podadres\u00e1\u0159 a soubor \u201ebin/java\u201c. CPJVMnoRtJar=Chyba: adres\u00e1\u0159, kter\u00fd jste vybrali, neobsahuje podadres\u00e1\u0159 a soubor \u201elib/rt.jar\u201c. CPJVMrtJar=OK, adres\u00e1\u0159, kter\u00fd jste vybrali, obsahuje podadres\u00e1\u0159 a soubor \u201elib/rt.jar\u201c. CPJVMPluginAllowTTValidation=Ov\u011b\u0159it prost\u0159ed\u00ed JRE ihned CPJVMNotokMessage1=Zadali jste neplatnou hodnotu:
    • {0}
    prost\u0159ed\u00ed JDK. Chybov\u00e1 zpr\u00e1va: CPJVMNotokMessage2=Tuto zpr\u00e1vu vid\u00edte pravd\u011bpodobn\u011b proto\u017ee:
    * V\u00e1\u0161 syst\u00e9m nepro\u0161el n\u011bkter\u00fdm z ov\u011b\u0159ovac\u00edch test\u016f
    * Bylo detekov\u00e1no jin\u00e9 prost\u0159ed\u00ed ne\u017e OpenJDK
    S neplatn\u00fdm prost\u0159ed\u00edm JDK nebude se pravd\u011bpodobn\u011b nebude aplikace IcedTea-Web schopna spustit.
    Pokud se ITW rozbije, pudete muset upravit nebo odstranit vlastnost
    • {1}
    ve va\u0161em konfigura\u010dn\u00edm souboru {1}.
    Rad\u011bji v\u011b\u0159te sv\u00e9mu adminovi, nebo aleso\u0148 ve sv\u00e9m syst\u00e9mu najd\u011bte prost\u0159ed\u00ed OpenJDK, nebo byste m\u011bli dob\u0159e v\u011bd\u011bt, co d\u011bl\u00e1te. CPJVMconfirmInvalidJdkTitle=Potvrzen\u00ed neplatn\u00e9ho prost\u0159ed\u00ed JDK CPJVMconfirmReset=Obnovit v\u00fdchoz\u00ed nastaven\u00ed? CPPolicyDetail=Zobrazen\u00ed nebo upravov\u00e1n\u00ed va\u0161eho u\u017eivatelsk\u00e9ho souboru se z\u00e1sadami prost\u0159ed\u00ed Java: Toto nastaven\u00ed v\u00e1m umo\u017en\u00ed ud\u011blit nebo odep\u0159\u00edt opr\u00e1vn\u011bn\u00ed modulu runtime pro aplet bez ohledu na standardn\u00ed bezpe\u010dnostn\u00ed pravidla pro pr\u00e1ci v izolovan\u00e9m prostoru (sandbox). CPPolicyTooltip=Otev\u0159\u00edt soubor {0} v n\u00e1stroji PolicyEditor. CPPolicyEditorNotFound=Nelze nal\u00e9zt editor pro tvorbu souboru syst\u00e9mov\u00fdch z\u00e1sad. Zkontrolujte, zda je n\u00e1stroj Policy Tool dosa\u017eiteln\u00fd z PATH. # Control Panel - Buttons CPButAbout=O aplikaci IcedTea-Web CPButNetworkSettings=Nastaven\u00ed s\u00edt\u011b... CPButSettings=Nastaven\u00ed... CPButView=Zobrazit... CPButCertificates=Certifik\u00e1ty... CPButSimpleEditor=Jednoduch\u00fd editor CPButAdvancedEditor=Roz\u0161\u00ed\u0159en\u00fd editor # Control Panel - Headers CPHead=Ovl\u00e1dac\u00ed panel IcedTea-Web CPHeadAbout=\u00a0O aplikaci IcedTea-Web\u00a0 CPHeadNetworkSettings=\u00a0Nastaven\u00ed proxy server\u016f s\u00edt\u011b\u00a0 CPHeadTempInternetFiles=\u00a0Do\u010dasn\u00e9 soubory Internetu\u00a0 CPHeadJRESettings=\u00a0Nastaven\u00ed prost\u0159ed\u00ed Java Runtime Environment\u00a0 CPHeadCertificates=\u00a0Certifik\u00e1ty\u00a0 CPHeadDebugging=\u00a0Nastaven\u00ed lad\u011bn\u00ed\u00a0 CPHeadDesktopIntegration=\u00a0Integrace s pracovn\u00ed plochou\u00a0 CPHeadSecurity=\u00a0Nastaven\u00ed zabezpe\u010den\u00ed\u00a0 CPHeadJVMSettings=\u00a0Nastaven\u00ed JVM\u00a0 CPHeadPolicy=\u00a0Vlastn\u00ed nastaven\u00ed z\u00e1sad\u00a0 # Control Panel - Tabs CPTabAbout=O aplikaci IcedTea-Web CPTabCache=Vyrovn\u00e1vac\u00ed pam\u011b\u0165 CPTabCertificate=Certifik\u00e1ty CPTabClassLoader=Zavad\u011b\u010de t\u0159\u00edd CPTabDebugging=Lad\u011bn\u00ed CPTabDesktopIntegration=Integrace s pracovn\u00ed plochou CPTabMenuShortcuts=Spr\u00e1va nainstalovan\u00fdch m\u00edstn\u00edch nab\u00eddek a z\u00e1stupc\u016f CPTabNetwork=S\u00ed\u0165 CPTabRuntimes=Moduly runtime CPTabSecurity=Zabezpe\u010den\u00ed CPTabJVMSettings=Nastaven\u00ed JVM CPTabPolicy=Nastaven\u00ed z\u00e1sad # Control Panel - AboutPanel CPAboutInfo=Toto je ovl\u00e1dac\u00ed panel umo\u017e\u0148uj\u00edc\u00ed \u00fapravu nastaven\u00ed v souboru deployment.properties.
    Dokud nebudou implementov\u00e1ny v\u0161echny funkce, n\u011bkter\u00e9 z nich nebudou funk\u010dn\u00ed.
    V sou\u010dasnosti je pou\u017e\u00edv\u00e1n\u00ed v\u00edce prost\u0159ed\u00ed JRE omezeno na OpenJDK.
    # Control Panel - AdvancedProxySettings APSDialogTitle=Nastaven\u00ed s\u00edt\u011b APSServersPanel=Servery APSProxyTypeLabel=Typ APSProxyAddressLabel=Adresa proxy serveru APSProxyPortLabel=Port proxy serveru APSLabelHTTP=HTTP APSLabelSecure=Zabezpe\u010den\u00fd APSLabelFTP=FTP APSLabelSocks=Socks APSSameProxyForAllProtocols=Pou\u017e\u00edt stejn\u00fd proxy server pro v\u0161echny protokoly APSExceptionsLabel=V\u00fdjimky APSExceptionsDescription=Nepou\u017e\u00edvat proxy server pro adresy za\u010d\u00ednaj\u00edc\u00ed na APSExceptionInstruction=Odd\u011blte ka\u017edou polo\u017eku st\u0159edn\u00edkem. # Control Panel - DebugginPanel CPDebuggingPossibilites=V\u00fdstupy protokolov\u00e1n\u00ed DPEnableLogging=Zapnout lad\u011bn\u00ed DPEnableLoggingHint=Kdy\u017e je tento p\u0159ep\u00edna\u010d zapnut\u00fd, jsou protokolov\u00e1ny tak\u00e9 zpr\u00e1vy z lad\u011bn\u00ed. Ekvivalent pou\u017eit\u00ed p\u0159ep\u00edna\u010de -verbose nebo pou\u017eit\u00ed nastaven\u00ed ICEDTEAPLUGIN_DEBUG=true. DPEnableHeaders=Povolit hlavi\u010dky DPEnableHeadersHint=Kdy\u017e je tento p\u0159ep\u00edna\u010d zapnut\u00fd, ka\u017ed\u00e1 zaprotokolovan\u00e1 zpr\u00e1va m\u00e1 hlavi\u010dku s dodate\u010dn\u00fdmi informacemi, jako jsou nap\u0159\u00edklad podrobnosti o u\u017eivateli, um\u00edst\u011bn\u00ed v k\u00f3du a \u010dasu. DPEnableFile=Zapnout protokolov\u00e1n\u00ed do souboru CPFilesLogsDestDir=Adres\u00e1\u0159 pro souborov\u00e9 protokoly CPFilesLogsDestDirResert=Obnovit v\u00fdchoz\u00ed nastaven\u00ed DPEnableFileHint=Zpr\u00e1vy v\u00fdstupu budou ulo\u017eeny do souboru v adres\u00e1\u0159i {0}. DPEnableStds=Zapnout protokolov\u00e1n\u00ed na standardn\u00ed v\u00fdstupy DPEnableStdsHint=Zpr\u00e1vy budou vyps\u00e1ny na standardn\u00edch v\u00fdstupech. DPEnableSyslog=Zapnout protokolov\u00e1n\u00ed do syst\u00e9mov\u00fdch protokol\u016f DPEnableSyslogHint=Zpr\u00e1vy v\u00fdstupu budou ulo\u017eeny do syst\u00e9mov\u00fdch protokol\u016f. DPDisable=Vypnout DPHide=Skr\u00fdt p\u0159i spou\u0161t\u011bn\u00ed DPShow=Zobrazit p\u0159i spou\u0161t\u011bn\u00ed DPShowPluginOnly=Zobrazit p\u0159i spou\u0161t\u011bn\u00ed z\u00e1suvn\u00e9ho modulu DPShowJavawsOnly=Zobrazit p\u0159i spou\u0161t\u011bn\u00ed javaws DPJavaConsole=Konzola Java DPJavaConsoleDisabledHint=Konzola Java je vypnuta. Pomoc\u00ed programu itw-settings ji m\u016f\u017eete zapnout a nastavit jej\u00ed zobrazov\u00e1n\u00ed/nezobrazov\u00e1n\u00ed po startu. # PolicyEditor PETitle=PolicyEditor PETitleWithPath=PolicyEditor \u2013 {0} PETitleWithChangesMade={0} * PEReadProps=\u010cten\u00ed syst\u00e9mov\u00fdch vlastnosti PEReadPropsDetail=Povol\u00ed aplet\u016fm \u010d\u00edst syst\u00e9mov\u00e9 vlastnosti, jako jen va\u0161e u\u017eivatelsk\u00e9 jm\u00e9no a um\u00edst\u011bn\u00ed domovsk\u00e9ho adres\u00e1\u0159e. PEWriteProps=Z\u00e1pis do syst\u00e9mov\u00fdch vlastnost\u00ed PEWritePropsDetail=Povol\u00ed aplet\u016fm zapisovat do syst\u00e9mov\u00fdch vlastnost\u00ed (nebo je p\u0159episovat). PEReadFiles=\u010cten\u00ed z lok\u00e1ln\u00edch soubor\u016f PEReadFilesDetail=Povol\u00ed aplet\u016fm \u010d\u00edst ze soubor\u016f ve va\u0161em domovsk\u00e9m adres\u00e1\u0159i. PEWriteFiles=Z\u00e1pis do lok\u00e1ln\u00edch soubor\u016f PEWriteFilesDetail=Povol\u00ed aplet\u016fm zapisovat do soubor\u016f ve va\u0161em domovsk\u00e9m adres\u00e1\u0159i. PEDeleteFiles=Maz\u00e1n\u00ed m\u00edstn\u00edch soubor\u016f PEDeleteFilesDetail=Povol\u00ed aplet\u016fm mazat soubory ve va\u0161em domovsk\u00e9m adres\u00e1\u0159i. PEReadSystemFiles=\u010cten\u00ed v\u0161ech syst\u00e9mov\u00fdch soubor\u016f PEReadSystemFilesDetail=Povol\u00ed aplet\u016fm p\u0159istupovat ke v\u0161em um\u00edst\u011bn\u00edm ve va\u0161em po\u010d\u00edta\u010di v re\u017eimu pro \u010dten\u00ed. PEWriteSystemFiles=Z\u00e1pis do v\u0161ech syst\u00e9mov\u00fdch soubor\u016f PEWriteSystemFilesDetail=Povol\u00ed aplet\u016fm zapisovat do v\u0161ech um\u00edst\u011bn\u00ed ve va\u0161em po\u010d\u00edta\u010di. PEReadTempFiles=\u010cten\u00ed z do\u010dasn\u00fdch soubor\u016f PEReadTempFilesDetail=Povol\u00ed aplet\u016fm \u010d\u00edst z adres\u00e1\u0159e s do\u010dasn\u00fdmi soubory. PEWriteTempFiles=Z\u00e1pis do do\u010dasn\u00fdch soubor\u016f PEWriteTempFilesDetail=Povol\u00ed aplet\u016fm zapisovat do adres\u00e1\u0159e s do\u010dasn\u00fdmi soubory. PEDeleteTempFiles=Maz\u00e1n\u00ed do\u010dasn\u00fdch soubor\u016f PEDeleteTempFilesDetail=Povol\u00ed aplet\u016fm mazat soubory v adres\u00e1\u0159i s do\u010dasn\u00fdmi soubory. PEAWTPermission=P\u0159\u00edstup k okenn\u00edmu syst\u00e9mu PEAWTPermissionDetail=Povol\u00ed aplet\u016fm p\u0159\u00edstup ke v\u0161em funkc\u00edm sady n\u00e1stroj\u016f AWT (Abstract Window Toolkit) PEClipboard=P\u0159\u00edstup do schr\u00e1nky PEClipboardDetail=Povol\u00ed aplet\u016fm \u010d\u00edst a zapisovat ve schr\u00e1nce. PENetwork=P\u0159\u00edstup k s\u00edti PENetworkDetail=Povol\u00ed aplet\u016fm navazovat jak\u00e1koli s\u00ed\u0165ov\u00e1 spojen\u00ed. PEPrint=Tisknut\u00ed dokument\u016f PEPrintDetail=Povol\u00ed aplet\u016fm p\u0159id\u00e1vat \u00falohy do tiskov\u00e9 fronty. PEPlayAudio=P\u0159ehr\u00e1v\u00e1n\u00ed zvuk\u016f PEPlayAudioDetail=Povol\u00ed aplet\u016fm p\u0159ehr\u00e1vat zvuky, nikoliv v\u0161ak zvuky nahr\u00e1vat. PERecordAudio=Nahr\u00e1v\u00e1n\u00ed audia PERecordAudioDetail=Povol\u00ed aplet\u016fm nahr\u00e1vat audio, av\u0161ak nikoli ho op\u011bt p\u0159ehr\u00e1vat. PEReflection=Java Reflection PEReflectionDetail=Povol\u00ed aplet\u016fm p\u0159\u00edstup k Java Reflection API. PEClassLoader=P\u0159\u00edstup k zavad\u011b\u010di t\u0159\u00edd PEClassLoaderDetail=Povol\u00ed aplet\u016fm p\u0159\u00edstup k syst\u00e9mov\u00e9mu zavad\u011b\u010di t\u0159\u00edd (\u010dasto pou\u017e\u00edv\u00e1no s Java Reflection). PEClassInPackage=P\u0159\u00edstup k ostatn\u00edm bal\u00ed\u010dk\u016fm PEClassInPackageDetail=Povol\u00ed aplet\u016fm p\u0159\u00edstup k t\u0159\u00edd\u00e1m ostatn\u00edch bal\u00ed\u010dk\u016f aplet\u016f (\u010dasto pou\u017e\u00edv\u00e1no s Java Reflection). PEDeclaredMembers=P\u0159\u00edstup k soukrom\u00fdm dat\u016fm t\u0159\u00edd PEDeclaredMembersDetail=Povol\u00ed aplet\u016fm p\u0159\u00edstup k norm\u00e1ln\u011b skryt\u00fdm dat\u016fm ostatn\u00edch t\u0159\u00edd Java (\u010dasto pou\u017e\u00edv\u00e1no s Java Reflection). PEAccessThreads=Pr\u00e1ce s vl\u00e1kny PEAccessThreadsDetail=Umo\u017en\u00ed aplet\u016fm spou\u0161t\u011bt, zastavovat \u010di jinak spravovat vl\u00e1kna. PEAccessThreadGroups=Pr\u00e1ce se skupinami vl\u00e1ken PEAccessThreadGroupsDetail=Umo\u017en\u00ed aplet\u016fm spou\u0161t\u011bt, zastavovat \u010di jinak spravovat skupiny vl\u00e1ken. PEExec=Spou\u0161t\u011bn\u00ed p\u0159\u00edkaz\u016f PEExecDetail=Umo\u017en\u00ed aplet\u016fm spou\u0161t\u011bt syst\u00e9mov\u00e9 p\u0159\u00edkazy. PEGetEnv=P\u0159\u00edstup k prom\u011bnn\u00fdm prost\u0159ed\u00ed PEGetEnvDetail=Umo\u017en\u00ed aplet\u016fm p\u0159\u00edstup ke \u010dten\u00ed prom\u011bnn\u00fdch syst\u00e9mov\u00e9ho prost\u0159ed\u00ed. PECouldNotOpen=Nelze otev\u0159\u00edt soubor se z\u00e1sadami PECouldNotSave=Nelze ulo\u017eit soubor se z\u00e1sadami PEAddCodebase=P\u0159idat novou z\u00e1kladnu k\u00f3du (codebase) PERemoveCodebase=Odstranit PECodebasePrompt=Zadejte novou z\u00e1kladnu k\u00f3du (codebase) PEGlobalSettings=V\u0161echny aplety PESaveChanges=Ulo\u017eit zm\u011bny p\u0159ed ukon\u010den\u00edm? PEChangesSaved=Zm\u011bny byly ulo\u017eeny. PECheckboxLabel=Opr\u00e1vn\u011bn\u00ed PECodebaseLabel=Z\u00e1kladny k\u00f3du (codebases) PEFileMenu=Soubor PENewMenuItem=Nov\u00fd PEOpenMenuItem=Otev\u0159\u00edt... PEOpenDefaultMenuItem=Otev\u0159\u00edt v\u00fdchoz\u00ed soubor se z\u00e1sadami PESaveMenuItem=Ulo\u017eit PESaveAsMenuItem=Ulo\u017eit jako... PEExitMenuItem=Ukon\u010dit PECodebaseMenu=Z\u00e1kladna k\u00f3du (codebase) PEAddCodebaseItem=P\u0159idat novou... PERemoveCodebaseItem=Odstranit PERenameCodebaseItem=P\u0159ejmenovat PECopyCodebaseItem=Kop\u00edrovat PEPasteCodebaseItem=Vlo\u017eit... PERenameCodebase=P\u0159ejmenovat z\u00e1kladnu k\u00f3du (codebase) na: PEPasteCodebase=Vlo\u017eit kop\u00edrovanou z\u00e1kladnu k\u00f3du (codebase) jako: PEViewMenu=Zobrazit PECustomPermissionsItem=Vlastn\u00ed opr\u00e1vn\u011bn\u00ed PEFileModified=Varov\u00e1n\u00ed ohledn\u011b zm\u011bny souboru PEFileModifiedDetail=Soubor se z\u00e1sadami v um\u00edst\u011bn\u00ed {0} byl od posledn\u00edho otev\u0159en\u00ed zm\u011bn\u011bn. Chcete ho p\u0159ed ulo\u017een\u00edm znovu na\u010d\u00edst a upravit? PEFileMissing=Soubor se z\u00e1sadami na disku chyb\u011bl. Byl ulo\u017een nov\u00fd soubor se stejn\u00fdm n\u00e1zvem. PEGAccesUnowenedCode= Spou\u0161t\u011bn\u00ed k\u00f3du, kter\u00fd nevlastn\u00edte PEGMediaAccess= P\u0159\u00edstup k m\u00e9di\u00edm PEGrightClick= Prav\u00fdm tla\u010d\u00edtkem my\u0161i rozbalit/sbalit nab\u00eddku PEGReadFileSystem= \u010cten\u00ed ze syst\u00e9mu PEGWriteFileSystem= Zapisov\u00e1n\u00ed do syst\u00e9mu PEClipboardError=Zd\u00e1 se, \u017ee schr\u00e1nka neobsahuje pat\u0159i\u010dn\u011b form\u00e1tovan\u00e9 polo\u017eky z\u00e1sad. PEInvalidPolicy=Vlo\u017een\u00ed se nezda\u0159ilo: Ze syst\u00e9mov\u00e9 schr\u00e1nky nebylo mo\u017en\u00e9 p\u0159e\u010d\u00edst polo\u017eku z\u00e1sad pro z\u00e1kladnu k\u00f3du (codebase) {0}. PEClipboardAccessError=Nebylo mo\u017en\u00e9 \u010d\u00edst ze schr\u00e1nky. PEHelpMenu=N\u00e1pov\u011bda PEAboutPolicyEditorItem=O aplikaci PolicyEditor PEPolicyEditorHelpItem=N\u00e1pov\u011bda aplikace PolicyEditor PEHelpDialogTitle=N\u00e1pov\u011bda aplikace PolicyEditor PEHelpDialogContent=

    N\u00e1pov\u011bda k n\u00e1stroji PolicyEditor

    PolicyEditor v\u00e1m umo\u017e\u0148uje zabezpe\u010dit aplety nebo aplikace Java, kter\u00e9 chcete spustit, pomoc\u00ed definovan\u00fdch opr\u00e1vn\u011bn\u00ed, kter\u00e1 se rozhodnete jim ud\u011blit.

    Hlavn\u00ed vlastnosti

    • P\u0159\u00edstupnost: pou\u017eit\u00edm kl\u00e1vesnice, my\u0161i nebo oboj\u00edho
    • P\u0159izp\u016fsoben\u00ed: definov\u00e1n\u00edm opr\u00e1vn\u011bn\u00ed, kter\u00e1 zvol\u00edte
    • Bezpe\u010dnost: aplety a aplikace pou\u017eij\u00ed pouze ta opr\u00e1vn\u011bn\u00ed, kter\u00e1 jim ud\u011bl\u00edte
    • Mo\u017enosti spr\u00e1vy: spravujte z\u00e1kladny k\u00f3du (codebases) a jejich opr\u00e1vn\u011bn\u00ed
    N\u00e1stroj PolicyEditor pracuje tak, \u017ee vyberete z\u00e1kladnu k\u00f3du (codebase) a za\u0161krtnete opr\u00e1vn\u011bn\u00ed, kter\u00e9 chcete dan\u00e9mu apletu \u010di aplikaci Java ud\u011blit. Chcete-li spustit aplet/aplikaci pouze s p\u0159esn\u011b definovan\u00fdmi opr\u00e1vn\u011bn\u00edmi, pou\u017eijte tla\u010d\u00edtko pro izolovan\u00fd prostor (sandbox) nebo zadejte re\u017eim izolovan\u00e9ho prostoru v manifestu.

    V r\u00e1mci n\u00e1stroje PolicyEditor je dostupn\u00fdch mnoho dal\u0161\u00edch akc\u00ed. Kliknut\u00edm prav\u00fdm tla\u010d\u00edtkem my\u0161i nebo stisknut\u00edm enteru (po najet\u00ed na skupinu) na skupinu opr\u00e1vn\u011bn\u00ed s malou \u0161ipkou rozbal\u00edte nebo sbal\u00edte dal\u0161\u00ed za\u0161krt\u00e1vac\u00ed pol\u00ed\u010dka s opr\u00e1vn\u011bn\u00edmi pro danou skupinu. Dal\u0161\u00ed u\u017eite\u010dnou funkc\u00ed je mo\u017enost kop\u00edrovat a vkl\u00e1dat sady opr\u00e1vn\u011bn\u00ed do nov\u00e9 z\u00e1kladny k\u00f3du (codebase), co\u017e v\u00e1m umo\u017e\u0148uje rychlou pr\u00e1ci se skupinami vlastn\u00edch opr\u00e1vn\u011bn\u00ed. Nav\u00edc nejste omezeni pouze na p\u0159edem definovan\u00e1 opr\u00e1vn\u011bn\u00ed u za\u0161krt\u00e1vac\u00edch pol\u00ed\u010dek. Pou\u017eit\u00edm nab\u00eddky Zobrazit > Vlastn\u00ed opr\u00e1vn\u011bn\u00ed... m\u016f\u017eete p\u0159id\u00e1vat jak\u00e1koliv vlastn\u00ed nastaven\u00ed opr\u00e1vn\u011bn\u00ed. # Policy Editor CustomPolicyViewer PECPTitle=Prohl\u00ed\u017ee\u010d vlastn\u00edch z\u00e1sad PECPListLabel=Jin\u00e9 z\u00e1sady pro {0} PECPAddButton=P\u0159idat PECPRemoveButton=Odstranit PECPCloseButton=Zav\u0159\u00edt PECPType=typ PECPTarget=c\u00edl PECPActions=akce PECPPrompt=Zadejte vlastn\u00ed opr\u00e1vn\u011bn\u00ed. Nezad\u00e1vejte \u201eopr\u00e1vn\u011bn\u00ed\u201c ani interpunk\u010dn\u00ed znam\u00e9nka. # PolicyEditor key mnemonics. See KeyEvent.VK_* PEFileMenuMnemonic=F PECodebaseMenuMnemonic=C PEViewMenuMnemonic=V PEHelpMenuMnemonic=H PEAddCodebaseMnemonic=N PEAddCodebaseItemMnemonic=N PERemoveCodebaseMnemonic=R PERemoveCodebaseItemMnemonic=R PENewMenuItemMnemonic=N PEOpenMenuItemMnemonic=O PEOpenDefaultMenuItemMnemonic=D PESaveMenuItemMnemonic=S PEExitMenuItemMnemonic=X PECustomPermissionsItemMnemonic=U PECopyCodebaseItemMnemonic=C PEPasteCodebaseItemMnemonic=P PECopyCodebaseToClipboardItemMnemonic=U PESaveAsMenuItemMnemonic=A PERenameCodebaseItemMnemonic=E PEAboutPolicyEditorItemMnemonic=A PEPolicyEditorHelpItemMnemonic=H # See javax.swing.KeyStroke.getKeyStroke(String) PEAddCodebaseItemAccelerator=ctrl shift N PERemoveCodebaseItemAccelerator=DEL PENewMenuItemAccelerator=ctrl N PEOpenMenuItemAccelerator=ctrl O PEOpenDefaultMenuItemAccelerator=ctrl D PESaveMenuItemAccelerator=ctrl S PESaveAsMenuItemAccelerator=ctrl shift S PEExitMenuItemAccelerator=ctrl Q PECustomPermissionsItemAccelerator=ctrl U PECopyCodebaseItemAccelerator=ctrl C PEPasteCodebaseItemAccelerator=ctrl V PERenameCodebaseItemAccelerator=F2 PECopyCodebaseToClipboardItemAccelerator=ctrl shift C PEAboutPolicyEditorCloseAccelerator=ctrl Q #conole itself labels CONSOLErungc= Spustit GC (uvol\u0148ov\u00e1n\u00ed pam\u011bti) CONSOLErunFinalizers= Spustit finaliza\u010dn\u00ed metody CONSOLErunningFinalizers= Prob\u00edh\u00e1 finalizace... CONSOLEmemoryInfo= Informace o pam\u011bti CONSOLEsystemProperties= Syst\u00e9mov\u00e9 vlastnosti CONSOLEclassLoaders= Dostupn\u00e9 zavad\u011b\u010de t\u0159\u00edd CONSOLEthreadList= Seznam vl\u00e1ken CONSOLEthread= Vl\u00e1kno CONSOLEnoClassLoaders= V syst\u00e9mu nen\u00ed informace o zavad\u011b\u010di t\u0159\u00edd. CONSOLEmemoryMax= Maxim\u00e1ln\u00ed pam\u011b\u0165 CONSOLEmemoryTotal= Celkov\u00e1 pam\u011b\u0165 CONSOLEmemoryFree= Voln\u00e1 pam\u011b\u0165 CONSOLEClean=Vy\u010distit # console output pane labels COPsortCopyAllDate=\u0159adit \u201eKop\u00edrovat v\u0161e\u201c podle data COPshowHeaders=Zobrazit hlavi\u010dky: COPuser=u\u017eivatel COPorigin=p\u016fvod COPlevel=\u00farove\u0148 COPdate=datum COPthread1=vl\u00e1kno 1 COPthread2=vl\u00e1kno 2 COPShowMessages=Zobrazit zpr\u00e1vy: COPstdOut=std. out COPstdErr=std. err COPjava=java COPplugin=z\u00e1suvn\u00fd modul COPpreInit=p\u0159ed inicializac\u00ed COPpluginOnly=pouze z\u00e1suvn\u00fd modul COPSortBy=\u0158adit podle COPregex=Filtr s regul\u00e1rn\u00edmi v\u00fdrazy COPAsArrived=Po\u0159ad\u00ed p\u0159\u00edchodu (ne\u0159azeno) COPcode=k\u00f3d COPmessage=zpr\u00e1va COPSearch=Vyhled\u00e1v\u00e1n\u00ed COPautoRefresh=Automaticky obnovovat COPrefresh=Obnovit COPApply=Pou\u017e\u00edt COPmark=ozna\u010dit COPCopyAllPlain=Kop\u00edrovat v\u0161e (prost\u00fd text) COPCopyAllRich=Kop\u00edrovat v\u0161e (form\u00e1tovan\u00fd text) COPnext=dal\u0161\u00ed>>> COPprevious=<<VAROV\u00c1N\u00cd: Je vyu\u017e\u00edv\u00e1no v\u00edce m\u00edsta ne\u017e {0} MB dostupn\u00e9 pam\u011bti. TIFPCacheSizeSpinnerLargeValueWarning=K dispozici: {0} MB TIFPCacheSizeSetToNoCaching=Soubory ulo\u017een\u00e9 do vyrovn\u00e1vac\u00ed pam\u011bti budou p\u0159i ukon\u010den\u00ed aplikace IcedTea-Web smaz\u00e1ny. TIFPCacheSizeSpinnerTooltip=Minimum: {0} Maximum: {1} # Control Panel - Cache Viewer CVCPDialogTitle=Prohl\u00ed\u017ee\u010d vyrovn\u00e1vac\u00ed pam\u011bti CVCPButRefresh=Obnovit CVCPButDelete=Vymazat CVCPCleanCache=Vy\u010distit vyrovn\u00e1vac\u00ed pam\u011b\u0165 CVCPCleanCacheTip=N\u011bkter\u00e9 chyby mohou b\u00fdt zp\u016fsobeny star\u00fdmi soubory ve vyrovn\u00e1vac\u00ed pam\u011bti. Ne\u017e zad\u00e1te hl\u00e1\u0161en\u00ed o chyb\u011b, m\u016f\u017eete zkusit vy\u010distit vyrovn\u00e1vac\u00ed pam\u011b\u0165 a spustit aplikaci znovu. \\\n Vyrovn\u00e1vac\u00ed pam\u011b\u0165 m\u016f\u017eete vy\u010distit pomoc\u00ed p\u0159\u00edkazu javaws -Xclearcache nebo pomoc\u00ed programu itw-settings, volby Vyrovn\u00e1vac\u00ed pam\u011b\u0165 -> Zobrazit soubory... -> Vy\u010distit vyrovn\u00e1vac\u00ed pam\u011b\u0165. CVCPColLastModified=Posledn\u00ed zm\u011bna CVCPColSize=Velikost (v bajtech) CVCPColDomain=Dom\u00e9na CVCPColType=Typ CVCPColPath=Cesta CVCPColName=N\u00e1zev # Control Panel - Misc. CPJRESupport=Aplikace IcedTea-Web v sou\u010dasnosti nepodporuje pou\u017eit\u00ed v\u00edce prost\u0159ed\u00ed JRE. CPInvalidPort=Zad\u00e1no neplatn\u00e9 \u010d\u00edslo portu\n[Platn\u00e1 \u010d\u00edsla port\u016f: 1 \u2013 65535] CPInvalidPortTitle=Chyba na vstupu # command line control panel CLNoInfo=Nejsou dostupn\u00e9 \u017e\u00e1dn\u00e9 informace (je pou\u017eit\u00e1 volba platn\u00e1?). CLValue=Hodnota: {0} CLValueSource=Zdroj: {0} CLDescription=Popis: {0} CLUnknownCommand=Nezn\u00e1m\u00fd p\u0159\u00edkaz {0} CLUnknownProperty=Nezn\u00e1m\u00fd n\u00e1zev vlastnosti {0} CLWarningUnknownProperty=VAROV\u00c1N\u00cd: Nezn\u00e1m\u00fd n\u00e1zev vlastnosti {0}. Prob\u00edh\u00e1 vytv\u00e1\u0159en\u00ed nov\u00e9 vlastnosti. CLNoIssuesFound=Nebyly zaznamen\u00e1ny \u017e\u00e1dn\u00e9 pot\u00ed\u017ee. CLIncorrectValue=Vlastnost {0} m\u00e1 nespr\u00e1vnou hodnotu {1}. Mo\u017en\u00e9 hodnoty {2}. CLListDescription=Zobraz\u00ed seznam v\u0161ech n\u00e1zv\u016f vlastnost\u00ed a hodnot, kter\u00e9 jsou vyu\u017e\u00edv\u00e1ny aplikac\u00ed IcedTea-Web. CLGetDescription=Zobraz\u00ed hodnoty pro n\u00e1zev vlastnosti. CLSetDescription=P\u0159i\u0159ad\u00ed hodnotu k n\u00e1zvu vlastnosti (pokud je to mo\u017en\u00e9). Kontrola platnosti hodnoty - pokud spr\u00e1vce vlastnost uzamkl, tato funkce nebude m\u00edt \u017e\u00e1dn\u00fd efekt. CLResetDescription=Resetuje hodnotu n\u00e1zvu vlastnosti na v\u00fdchoz\u00ed hodnotu.\nVolba \u201ev\u0161echny\u201c (all) resetuje v\u0161echny vlastnosti rozpoznan\u00e9 aplikac\u00ed IcedTea-Web na jejich v\u00fdchoz\u00ed hodnoty. CLInfoDescription=Zobraz\u00ed dal\u0161\u00ed informace o dan\u00e9 vlastnosti. CLCheckDescription=Zobraz\u00ed v\u0161echny vlastnosti, kter\u00e9 byly definov\u00e1ny, av\u0161ak nebyly rozpozn\u00e1ny aplikac\u00ed IcedTea-Web. CLUnexpectedNumberOfCommands=Program itweb-settings m\u016f\u017ee v jednu chv\u00edli spustit pouze jeden p\u0159\u00edkaz. # splash screen related SPLASHerror= Podrobnosti z\u00edsk\u00e1te kliknut\u00edm zde. Do\u0161lo k v\u00fdjimce. SPLASH_ERROR= CHYBA SPLASHtitle= N\u00e1zev SPLASHvendor= Dodavatel SPLASHhomepage= Domovsk\u00e1 str\u00e1nka SPLASHdescription= Popis SPLASHClose= Zav\u0159\u00edt SPLASHclosewAndCopyException= Zav\u0159\u00edt a zkop\u00edrovat v\u00fdpis trasov\u00e1n\u00ed z\u00e1sobn\u00edku do schr\u00e1nky SPLASHexOccured= Do\u0161lo k v\u00fdjimce... SPLASHHome= Dom\u016f SPLASHcantCopyEx= Nelze kop\u00edrovat v\u00fdjimku. SPLASHnoExRecorded= Nebyla zaznamen\u00e1na \u017e\u00e1dn\u00e1 v\u00fdjimka. SPLASHmainL1= Je\u0161t\u011b v\u00edce informac\u00ed naleznete na webu {0}. Postupujte dle uveden\u00fdch krok\u016f, abyste z\u00edskali informace nebo nahl\u00e1sili chybu. SPLASHmainL3= Nejsou dostupn\u00e9 \u017e\u00e1dn\u00e9 dal\u0161\u00ed informace. Zkuste spustit prohl\u00ed\u017ee\u010d z p\u0159\u00edkazov\u00e9 \u0159\u00e1dky a analyzovat v\u00fdstup. SPLASHcloseAndCopyShorter= Zav\u0159\u00edt a kop\u00edrovat do schr\u00e1nky SPLASHmainL4= Do\u0161lo k n\u00e1sleduj\u00edc\u00ed v\u00fdjimce. Chcete-li v\u00edce informac\u00ed, zkuste spustit prohl\u00ed\u017ee\u010d z p\u0159\u00edkazov\u00e9 \u0159\u00e1dky a analyzovat v\u00fdstup. SPLASHmainL2= Dal\u0161\u00ed informace mohou b\u00fdt dostupn\u00e9 v konzoli nebo protokolech. Je\u0161t\u011b v\u00edce informac\u00ed z\u00edsk\u00e1te zapnut\u00edm lad\u011bn\u00ed. SPLASHexWas= Zaznamenan\u00e1 v\u00fdjimka: SPLASHcfl= Nelze \u010d\u00edst odkaz SPLASHvendorsInfo= Informace od dodavatele va\u0161\u00ed aplikace SPLASHanotherInfo= Dal\u0161\u00ed dostupn\u00e9 informace SPLASHdefaultHomepage= Nen\u00ed definov\u00e1n atribut \u201ehomepage\u201c, rad\u011bji ov\u011b\u0159te zdroj. SPLASHerrorInInformation= Chyba p\u0159i na\u010d\u00edt\u00e1n\u00ed elementu \u201einformation\u201c, rad\u011bji ov\u011b\u0159te zdroj. SPLASHmissingInformation= Chyb\u00ed element \u201einformation\u201c, rad\u011bji ov\u011b\u0159te zdroj. SPLASHchainWas= Toto je seznam v\u00fdjimek, ke kter\u00fdm do\u0161lo p\u0159i spou\u0161t\u011bn\u00ed apletu. Vezm\u011bte na v\u011bdom\u00ed, \u017ee zdroji uveden\u00fdch v\u00fdjimek m\u016f\u017ee b\u00fdt v\u00edce r\u016fzn\u00fdch aplet\u016f. Abyste mohli vytvo\u0159it u\u017eite\u010dn\u00e9 hl\u00e1\u0161en\u00ed o chyb\u011b, ujist\u011bte se, \u017ee b\u011b\u017e\u00ed pouze jeden aplet. CBCheckFile= Aplikace je lok\u00e1ln\u00ed soubor. Ov\u011b\u0159ov\u00e1n\u00ed z\u00e1kladny k\u00f3du (codebase) je vypnuto. Podrobnosti z\u00edsk\u00e1te na adrese http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/security/no_redeploy.html. CBCheckNoEntry= Tato aplikace v manifestu neuv\u00e1d\u00ed z\u00e1kladnu k\u00f3du (codebase). Ov\u011b\u0159te ji u dodavatele apletu. Pokra\u010duji. Podrobnosti z\u00edsk\u00e1te na adrese http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/security/no_redeploy.html. CBCheckUnsignedPass= Z\u00e1kladna k\u00f3du (codebase) aplikace souhlas\u00ed se z\u00e1kladnou k\u00f3du uvedenou v manifestu a aplikace nen\u00ed podepsan\u00e1. Pokra\u010duji. Podrobnosti z\u00edsk\u00e1te na adrese http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/security/no_redeploy.html. CBCheckUnsignedFail= Z\u00e1kladna k\u00f3du (codebase) aplikace NESOUHLAS\u00cd se z\u00e1kladnou k\u00f3du uvedenou v manifestu a aplikace nen\u00ed podepsan\u00e1. Pokra\u010duji. Podrobnosti z\u00edsk\u00e1te na adrese http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/security/no_redeploy.html. CBCheckOkSignedOk= Z\u00e1kladna k\u00f3du (codebase) aplikace souhlas\u00ed se z\u00e1kladnou k\u00f3du uvedenou v manifestu a aplikace je podepsan\u00e1. Pokra\u010duji. Podrobnosti z\u00edsk\u00e1te na adrese http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/security/no_redeploy.html. CBCheckSignedAppletDontMatchException= Nen\u00ed povoleno spou\u0161t\u011bn\u00ed podepsan\u00fdch aplikac\u00ed, pokud jejich skute\u010dn\u00e1 z\u00e1kladna k\u00f3du (codebase) nesouhlas\u00ed se z\u00e1kladnou k\u00f3du uvedenou v manifestu. O\u010dek\u00e1v\u00e1no: {0}. Skute\u010dnost: {1}. Podrobnosti z\u00edsk\u00e1te na adrese http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/security/no_redeploy.html. CBCheckSignedFail= Z\u00e1kladna k\u00f3du (codebase) aplikace NESOUHLAS\u00cd se z\u00e1kladnou k\u00f3du uvedenou v manifestu aplikace a aplikace je podepsan\u00e1. D\u016frazn\u011b doporu\u010dujeme, abyste tuto aplikaci nespou\u0161t\u011bli. Podrobnosti z\u00edsk\u00e1te na adrese http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/security/no_redeploy.html. # itweb man base (note, spaces (especially the one around markup) are important due to man pages markup). Only bold tag is now recognized by ReplacingTextFormatter. ITWTBbugs=Moment\u00e1ln\u011b neevidujeme \u017e\u00e1dn\u00e9 zn\u00e1m\u00e9 chyby. Pokud na n\u011bjakou naraz\u00edte, nahla\u0161te ji na str\u00e1nk\u00e1ch ITWTBdebug=Pros\u00edme, abyste p\u0159i zad\u00e1v\u00e1n\u00ed hl\u00e1\u0161en\u00ed o chyb\u011b pou\u017eili re\u017eim lad\u011bn\u00ed (pou\u017eijte p\u0159ep\u00edna\u010d -verbose nebo pat\u0159i\u010dn\u00e9 nastaven\u00ed v itw-settings nebo nastavte prom\u011bnnou ICEDTEAPLUGIN_DEBUG na mo\u017enost \u201etrue\u201c) a p\u0159idali v\u00fdstup (nejl\u00e9pe z konzoly Java) k adrese URL vedouc\u00ed na soubor JNLP nebo HTML (p\u0159\u00edpadn\u011b p\u0159\u00edmo k soubor\u016fm JNLP/HTML nebo samotn\u00e9 aplikaci). ITWTBwritten=Naprogramov\u00e1no a udr\u017eov\u00e1no p\u0159isp\u011bvateli do projektu IcedTea. ITWTBdirs=Kde jsou pro prom\u011bnn\u00e9 $XDG_CONFIG_DIR, $XDG_CACHE_DIR a $XDG_RUNTIME_DIR nastaveny na mo\u017enosti ~/.config, ~/.cache a /tmp. Pokud nejsou nastaveny, pou\u017eije se /var/tmp. # itweb-settings man (note, spaces (especially the one around markup) are important due to man pages markup). Only bold tag is now recognized by ReplacingTextFormatter. ITWSintro= - zobrazen\u00ed a \u00fapravy nastaven\u00ed pro javaws a z\u00e1suvn\u00fd modul prohl\u00ed\u017ee\u010de ITWSsynops=argumenty p\u0159\u00edkazu IWSdescL1=je program jak pro p\u0159\u00edkazovou \u0159\u00e1dku tak i s grafick\u00fdm rozhran\u00edm slou\u017e\u00edc\u00ed k \u00faprav\u011b nastaven\u00ed pou\u017e\u00edvan\u00fdch implementac\u00ed rozhran\u00ed javaws pou\u017e\u00edvanou aplikac\u00ed IcedTea-Web a z\u00e1suvn\u00fdm modulem prohl\u00ed\u017ee\u010de. IWSdescL2=Pokud je spu\u0161t\u011bn bez dal\u0161\u00edch argument\u016f, spust\u00ed se v grafick\u00e9m rozhran\u00ed. V opa\u010dn\u00e9m p\u0159\u00edpad\u011b se pokus\u00ed vykonat po\u017eadavky zadan\u00e9 pomoc\u00ed argument\u016f. IWSdescL3=P\u0159\u00edkazov\u00e1 \u0159\u00e1dka umo\u017e\u0148uje rychl\u00e9 vyhled\u00e1n\u00ed, kop\u00edrov\u00e1n\u00ed a upravov\u00e1n\u00ed specifick\u00fdch nastaven\u00ed bez nutnosti zdlouhav\u00e9ho proch\u00e1zen\u00ed grafick\u00e9ho u\u017eivatelsk\u00e9ho rozhran\u00ed. IWSexampleL1=Zobraz\u00ed grafick\u00fd editor. IWSexampleL2=Obnov\u00ed hodnotu nastaven\u00ed \u201e{0}\u201c. ITWSdefault=v\u00fdchoz\u00ed IWSexampleL3=Zn\u00e1m\u00e9 vlastnosti IWSexampleL31=(kl\u00ed\u010d, hodnota a v\u00fdchoz\u00ed hodnota \u2013 pokud je odli\u0161n\u00e1 od aktu\u00e1ln\u00ed): IWSexampleL32=(kl\u00ed\u010d a v\u00fdchoz\u00ed hodnota): IWSpossible=Mo\u017enosti: # itweb-plugin man (note, spaces (especially the one around markup) are important due to man pages markup). Only bold tag is now recognized by ReplacingTextFormatter. ITWPintro= - umo\u017en\u011bn\u00ed spou\u0161t\u011bn\u00ed aplet\u016f Java ve va\u0161em obl\u00edben\u00e9m prohl\u00ed\u017ee\u010di ITWPsynopsL1=funguje ve va\u0161em prohl\u00ed\u017ee\u010di (pokud ho do n\u011bj nainstalujete). ITWPsynopsL2=Soubor {0} mus\u00ed b\u00fdt um\u00edst\u011bn v pat\u0159i\u010dn\u00fdch adres\u00e1\u0159\u00edch (nebo na n\u011bj z t\u011bchto adres\u00e1\u0159\u016f mus\u00ed v\u00e9st odkaz). Viz {1} ITWPsynopsL3= Prohl\u00ed\u017ee\u010de kompatibiln\u00ed s prohl\u00ed\u017ee\u010dem Mozilla, jako nap\u0159\u00edklad Firefox, Midori, Epiphany, Chrome nebo Chromium pou\u017e\u00edvaj\u00ed: ITWPsynopsL4= Prohl\u00ed\u017ee\u010de od firmy Opera, jako nap\u0159\u00edklad Opera pou\u017e\u00edvaj\u00ed: ITWPtrademarks=V\u0161echny ochrann\u00e9 zn\u00e1mky t\u0159et\u00edch stran jsou vlastnictv\u00edm jejich p\u0159\u00edslu\u0161n\u00fdch vlastn\u00edk\u016f. # files descriptions FILEpipe=Obsahuje vstupn\u00ed a v\u00fdstupn\u00ed roury pro komunikaci pomoc\u00ed rozhran\u00ed native2java a rouru pro lad\u011bn\u00ed (pokud zapnuto). FILEmozillauser=Um\u00edst\u011bn\u00ed knihovny z\u00e1suvn\u00e9ho modulu na \u00farovni u\u017eivatele pro pou\u017eit\u00ed s prohl\u00ed\u017ee\u010di zalo\u017een\u00fdmi na projektu Mozilla. FILEmozillaglobal64=Um\u00edst\u011bn\u00ed knihovny z\u00e1suvn\u00e9ho modulu na glob\u00e1ln\u00ed \u00farovni pro pou\u017eit\u00ed s prohl\u00ed\u017ee\u010di zalo\u017een\u00fdmi na projektu Mozilla, 64bitov\u00e9 syst\u00e9my. FILEmozillaglobal32=Um\u00edst\u011bn\u00ed knihovny z\u00e1suvn\u00e9ho modulu na glob\u00e1ln\u00ed \u00farovni pro pou\u017eit\u00ed s prohl\u00ed\u017ee\u010di zalo\u017een\u00fdmi na projektu Mozilla, 32bitov\u00e9 syst\u00e9my. FILEopera64=Um\u00edst\u011bn\u00ed knihovny z\u00e1suvn\u00e9ho modulu na glob\u00e1ln\u00ed \u00farovni pro pou\u017eit\u00ed s prohl\u00ed\u017ee\u010di od firmy Opera, 64bitov\u00e9 syst\u00e9my. FILEopera32=Um\u00edst\u011bn\u00ed knihovny z\u00e1suvn\u00e9ho modulu na glob\u00e1ln\u00ed \u00farovni pro pou\u017eit\u00ed s prohl\u00ed\u017ee\u010di od firmy Opera, 32bitov\u00e9 syst\u00e9my. FILEcache=Obsahuje polo\u017eky b\u011bhov\u00e9ho prost\u0159ed\u00ed ulo\u017een\u00e9 ve vyrovn\u00e1vac\u00ed pam\u011bti. FILErecentlyUsed=Dal\u0161\u00ed informace o polo\u017ek\u00e1ch ve vyrovn\u00e1vac\u00ed pam\u011bti. FILEappdata=Obsahuje ulo\u017een\u00e1 data aplikac\u00ed. FILElogs=obsahuje soubor s protokoly (pokud je protokolov\u00e1n\u00ed zapnuto) \u2013 soubor tw-cplugin-date_time.log pro nativn\u00ed z\u00e1suvn\u00fd modul a soubor itw-javantx-date_time.log pro v\u0161echno ostatn\u00ed. FILEicons=Um\u00edst\u011bn\u00ed, kde jsou uchov\u00e1v\u00e1ny ikony z\u00e1stupc\u016f na plo\u0161e nebo v m\u00edstn\u00ed nab\u00eddce k aplikac\u00edm javaws. FILEjnlps=Um\u00edst\u011bn\u00ed, kde jsou uchov\u00e1v\u00e1ny soubory jnlp generovan\u00e9 ze str\u00e1nek html pro aplikace javaws v p\u0159\u00edpad\u011b spou\u0161t\u011bn\u00ed pomoc\u00ed z\u00e1stupce na plo\u0161e / v m\u00edstn\u00ed nab\u00eddce. FILEmenus=Podadres\u00e1\u0159 v u\u017eivatelsk\u00e9m prostoru pro nab\u00eddky, kam budou ulo\u017eeni vlastn\u00ed z\u00e1stupci zobrazuj\u00edc\u00ed se v m\u00edstn\u00ed nab\u00eddce. FILEextasuser=Soubor zodpov\u011bdn\u00fd chov\u00e1n\u00ed jednotliv\u00fdch aplet\u016f a aplikac\u00ed na z\u00e1klad\u011b jejich z\u00e1kladny k\u00f3du (codebase) a u\u017eivatelsk\u00fdch akc\u00ed. FILEextasadmin=Soubor zodpov\u011bdn\u00fd chov\u00e1n\u00ed jednotliv\u00fdch aplet\u016f a aplikac\u00ed na z\u00e1klad\u011b jejich z\u00e1kladny k\u00f3du (codebase) a akc\u00ed spr\u00e1vce. FILEglobaldp=Glob\u00e1ln\u00ed soubor s nastaven\u00edmi deployment.properties FILEtmpappdata=Obsahuje do\u010dasn\u00e9 soubory b\u011bhov\u00e9ho prost\u0159ed\u00ed. FILElocksdir=Um\u00edst\u011bn\u00ed z\u00e1mk\u016f jednotliv\u00fdch proces\u016f netx FILEmainlock=Um\u00edst\u011bn\u00ed hlavn\u00edho z\u00e1mku procesu netx FILEpolicy=Obsahuje opr\u00e1vn\u011bn\u00ed ud\u011blen\u00e1 vybran\u00fdm nepodepsan\u00fdm aplikac\u00edm. FILEusercerts=Obsahuje r\u016fzn\u00e9 certifik\u00e1ty ulo\u017een\u00e9 u\u017eivateli. FILEjavacerts=Obsahuje r\u016fzn\u00e9 syst\u00e9mov\u00e9 certifik\u00e1ty ulo\u017een\u00e9 glob\u00e1ln\u011b v r\u00e1mci prost\u0159ed\u00ed Java. FILEjavadp=Glob\u00e1ln\u00ed soubor deployment.properties M\u016f\u017ee b\u00fdt ovlivn\u011bn {0}. FILEuserdp=Hlavn\u00ed u\u017eivatelsk\u00fd soubor deployment.properties. APPEXTSECappletSecurityLevelExtraHighId=Vypnut\u00ed b\u011bhu v\u0161ech aplet\u016f prost\u0159ed\u00ed Java APPEXTSECappletSecurityLevelVeryHighId=Velmi vysok\u00e1 \u00farove\u0148 zabezpe\u010den\u00ed APPEXTSECappletSecurityLevelHighId=Vysok\u00e1 \u00farove\u0148 zabezpe\u010den\u00ed APPEXTSECappletSecurityLevelLowId=N\u00edzk\u00e1 \u00farove\u0148 zabezpe\u010den\u00ed APPEXTSECappletSecurityLevelExtraHighExplanation=Nebude spu\u0161t\u011bn \u017e\u00e1dn\u00fd aplet. APPEXTSECappletSecurityLevelVeryHighExplanation=Nebude spu\u0161t\u011bn \u017e\u00e1dn\u00fd nepodepsan\u00fd aplet. APPEXTSECappletSecurityLevelHighExplanation=U\u017eivatel bude dot\u00e1z\u00e1n na spu\u0161t\u011bn\u00ed ka\u017ed\u00e9ho nepodepsan\u00e9ho apletu. APPEXTSECappletSecurityLevelLowExplanation=Budou spu\u0161t\u011bny v\u0161echny aplety (dokonce i ty nepodepsan\u00e9). APPEXTSECunsignedAppletActionAlways=V\u017edy d\u016fv\u011b\u0159ovat t\u011bmto (odpov\u00eddaj\u00edc\u00edm) aplet\u016fm APPEXTSECunsignedAppletActionNever=Nikdy ned\u016fv\u011b\u0159ovat t\u011bmto (odpov\u00eddaj\u00edc\u00edm) aplet\u016fm APPEXTSECunsignedAppletActionYes=Tento aplet byl zhl\u00e9dnut a povolen. APPEXTSecunsignedAppletActionSandbox=Tento aplet byl zhl\u00e9dnut a byl povolen jeho b\u011bh s omezen\u00fdmi opr\u00e1vn\u011bn\u00edmi. APPEXTSECunsignedAppletActionNo=Tento aplet byl zhl\u00e9dnut a odm\u00edtnut. APPEXTSECunsetAppletAction=Aplet je\u0161t\u011b ne\u017e\u00e1dal o povolen\u00ed t\u00e9to akce. APPEXTSECControlPanelExtendedAppletSecurityTitle=Roz\u0161\u00ed\u0159en\u00e9 zabezpe\u010den\u00ed aplet\u016f APPEXTSECguiTableModelTableColumnActionUA=Akce nepodepsan\u00e9ho apletu APPEXTSECguiTableModelTableColumnActionMatchALACA=Akce nad knihovnou APPEXTSECguiTableModelTableColumnDateOfAction=Datum akce APPEXTSECguiTableModelTableColumnDocumentBase=Z\u00e1kladna dokumentu (document base) APPEXTSECguiTableModelTableColumnCodeBase=Z\u00e1kladna k\u00f3du (codebase) APPEXTSECguiTableModelTableColumnArchives=Arch\u00edvy APPEXTSECguiPanelAppletInfoHederPart1={0} {1} APPEXTSECguiPanelAppletInfoHederPart2={0} z {1} APPEXTSECguiPanelConfirmDeletionOf=Skute\u010dn\u011b chcete odstranit n\u00e1sleduj\u00edc\u00ed po\u010det polo\u017eek: {0}? APPEXTSECguiPanelHelpButton=N\u00e1pov\u011bda APPEXTSECguiPanelSecurityLevel=\u00darove\u0148 zabezpe\u010den\u00ed APPEXTSECguiPanelGlobalBehaviourCaption=Nastaven\u00ed glob\u00e1ln\u00edho chov\u00e1n\u00ed aplet\u016f APPEXTSECguiPanelDeleteMenuSelected=vybran\u00e9 APPEXTSECguiPanelDeleteMenuAllA=v\u0161echny povolen\u00e9 (A) APPEXTSECguiPanelDeleteMenuAllN=v\u0161echny zak\u00e1zan\u00e9 (N) APPEXTSECguiPanelDeleteMenuAlly=v\u0161echny schv\u00e1len\u00e9 (y) APPEXTSECguiPanelDeleteMenuAlln=v\u0161echny odm\u00edtnut\u00e9 (n) APPEXTSECguiPanelDeleteMenuAllAll=\u00fapln\u011b v\u0161echny APPEXTSECguiPanelDeleteButton=Vymazat APPEXTSECguiPanelDeleteButtonToolTip=V pr\u016fb\u011bhu proch\u00e1zen\u00ed tabulky m\u016f\u017eete stisknout kl\u00e1vesu Delete. T\u00edm provedete akci odstranit vybran\u00e9. APPEXTSECguiPanelTestUrlButton=Otestovat URL APPEXTSECguiPanelAddRowButton=P\u0159idat \u0159\u00e1dek APPEXTSECguiPanelValidateTableButton=Ov\u011b\u0159it tabulku APPEXTSECguiPanelAskeforeActionBox=P\u0159ed akc\u00ed se dot\u00e1zat APPEXTSECguiPanelShowRegExesBox=Zobrazit \u00fapln\u00e9 regul\u00e1rn\u00ed v\u00fdrazy APPEXTSECguiPanelInverSelection=P\u0159evr\u00e1tit v\u00fdb\u011br APPEXTSECguiPanelMoveRowUp=Posunout \u0159\u00e1dek nahoru APPEXTSECguiPanelMoveRowDown=Posunout \u0159\u00e1dek dol\u016f APPEXTSECguiPanelCustomDefs=U\u017eivatelsk\u00e9 definice APPEXTSECguiPanelGlobalDefs=Syst\u00e9mov\u00e9 definice APPEXTSECguiPanelDocTest=Zadejte adresu URL z\u00e1kladny dokumentu (document base) APPEXTSECguiPanelCodeTest=Zadejte adresu URL z\u00e1kladny k\u00f3du (codebase) APPEXTSECguiPanelNoMatch=\u017d\u00e1dn\u00e1 shoda APPEXTSECguiPanelMatchingNote=Vezm\u011bte na v\u011bdom\u00ed, \u017ee jako v\u00fdsledek bude br\u00e1n pouze prvn\u00ed shodn\u00fd v\u00fdskyt. APPEXTSECguiPanelMatched=Shody APPEXTSECguiPanelMatchingError=Chyba p\u0159i hled\u00e1n\u00ed shody: {0} APPEXTSECguiPanelCanNotValidate=Nelze ov\u011b\u0159it, nebo nelze vytvo\u0159it soubor tmp \u2013 {0}. APPEXTSECguiPanelEmptyDoc=V\u0161echny z\u00e1kladny dokumentu (document bases) musej\u00ed b\u00fdt vypln\u011bny. APPEXTSECguiPanelEmptyCode=V\u0161echny z\u00e1kladny k\u00f3du (codebases) musej\u00ed b\u00fdt vypln\u011bny. APPEXTSECguiPanelTableValid=Zd\u00e1 se, \u017ee tabulka je v po\u0159\u00e1dku. APPEXTSECguiPanelTableInvalid=Tabulka je neplatn\u00e1. Chyba: {0} APPEXTSECguiPanelShowOnlyPermanent=Zobrazit pouze trval\u00e9 z\u00e1znamy APPEXTSECguiPanelShowOnlyTemporal=Zobrazit pouze ji\u017e d\u0159\u00edve do\u010dasn\u011b povolen\u00e9 nebo zak\u00e1zan\u00e9 z\u00e1znamy APPEXTSECguiPanelShowAll=Zobrazit v\u0161echny z\u00e1znamy APPEXTSECguiPanelShowOnlyPermanentA=Zobrazit pouze povolen\u00e9 trval\u00e9 z\u00e1znamy APPEXTSECguiPanelShowOnlyPermanentN=Zobrazit pouze zak\u00e1zan\u00e9 trval\u00e9 z\u00e1znamy APPEXTSECguiPanelShowOnlyTemporalY=Zobrazit pouze d\u0159\u00edve povolen\u00e9 z\u00e1znamy aplet\u016f APPEXTSECguiPanelShowOnlyTemporalN=Zobrazit pouze d\u0159\u00edve zak\u00e1zan\u00e9 z\u00e1znamy aplet\u016f APPEXTSEChelpHomeDialogue=Dialogue icedtea-web-1.6.2/netx/net/sourceforge/jnlp/resources/PaxHeaders.17941/Messages.properties0000644000000000000000000000013212654402377026376 xustar0030 mtime=1454507263.286431928 30 atime=1454507327.136580377 30 ctime=1454507658.740157877 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/resources/Messages.properties0000644000175000002070000023444212654402377027132 0ustar00jvanekmock00000000000000# Default (English) UI messages for netx # # All messages are formatted using Java's MessageFormat class. # Apostrophe characters ' need to be escaped by using two: '' # Curly brackets need to be escaped by surrounding them with single apostrophes '{' '{hello}' # # L=Launcher, B=Boot, P=Parser, C=cache S=security # # General NullParameter=Null parameter ButAllow=Allow ButBrowse=Browse... ButCancel=\ Cancel\ ButClose=Close ButAdvancedOptions=Advanced Options ButCopy=Copy to Clipboard ButMoreInformation=More Information... ButOk=OK ButProceed=Proceed ButRun=Run ButSandbox=Sandbox ButApply=Apply ButDone=Done ButShowDetails=Show Details ButHideDetails=Hide Details ButYes=Yes ButNo=No BUTControlledBy=Controlled by {0} BUTmodified=modified CertWarnRunTip=Trust this applet and run with full permissions CertWarnSandboxTip=Do not trust this applet and run with restricted permissions CertWarnCancelTip=Do not run this applet CertWarnPolicyTip=Advanced sandbox settings CertWarnPolicyEditorItem=Launch PolicyEditor CertWarnHTTPSAcceptTip=Accept this certificate and trust the HTTPS connection CertWarnHTTPSRejectTip=Do not accept this certificate and do not establish the HTTPS connection AFileOnTheMachine=a file on the machine AlwaysAllowAction=Always allow this action AlwaysForbidAction=Always forbid this action Usage=Usage: Error=Error Warning=Warning Continue=Do you want to continue? Field=Field From=From Name=Name Password=Password: Publisher=Publisher Unknown= Username=Username: Value=Value Version=Version # about dialogue AboutDialogueTabAbout=About AboutDialogueTabAuthors=Authors AboutDialogueTabChangelog=Changelog AboutDialogueTabNews=News AboutDialogueTabGPLv2=GPLv2 # version check minidialogue JREversionDontMatch=Warning - your JRE - {0} - does not match requested JRE - {1} JREContinueDialogSentence2=Do you wont to continue in running? JREContinueDialogSentenceTitle=Incompatible JRE # missing permissions dialogue MissingPermissionsMainTitle=Application {0} \ from {1} is missing the permissions attribute. \ Applications without this attribute should not be trusted. Do you wish to allow this application to run? MissingPermissionsInfo=For more information you can visit:
    \ \ JAR File Manifest Attributes
    \ and
    \ Preventing the repurposing of Applications # missing Application-Library-Allowable-Codebase dialogue ALACAMissingMainTitle=The application {0} \ from {1} uses resources from the following remote locations: \ {2} \ Be very careful when application is loading from different space then you expect. Are you sure you want to run this application? ALACAMissingInfo=For more information see:
    \ \ JAR File Manifest Attributes
    \ and
    \ Preventing the Repurposing of an Application # matching Application-Library-Allowable-Codebase dialogue ALACAMatchingMainTitle=The application {0} \ from {1} uses resources from the following remote locations:
    {2}
    \ They looks ok. Are you sure you want to run this application? ALACAMatchingInfo=For more information you can visit:
    \ \ JAR File Manifest Attributes
    \ and
    \ Preventing the Repurposing of an Application MACDisabledMessage=Manifest attribute checks are disabled. MACCheckSkipped=check on {0} skipped because property of deployment.manifest.attributes.check \ was not set to ALL or includes {1} in the combination of options # LS - Severity LSMinor=Minor LSFatal=Fatal # LC - Category LCSystem=System Error LCExternalLaunch=External Launch Error LCFileFormat=File Format Error LCReadError=Read Error LCClient=Application Error LCLaunching=Launch Error LCNotSupported=Unsupported Feature LCInit=Initialization Error LAllThreadGroup=All JNLP applications LNullUpdatePolicy=Update policy cannot be null. LThreadInterrupted=Thread interrupted while waiting for file to launch. LThreadInterruptedInfo=This can lead to deadlock or yield other damage during execution. Please restart your application/browser. LCouldNotLaunch=Could not launch JNLP file. LCouldNotLaunchInfo=The application has not been initialized, for more information execute javaws/browser from the command line and send a bug report. LCantRead=Could not read or parse the JNLP file. LCantReadInfo=You can try to download this file manually and send it as bug report to IcedTea-Web team. LNullLocation=Could not determine .jnlp file location. LNullLocationInfo=An attempt was made to launch a JNLP file in another JVM, but the file could not be located. In order to launch in an external JVM, the runtime must be able to locate the .jnlp file either in the local file system or on a server. LNetxJarMissing=Could not determine location of netx.jar. LNetxJarMissingInfo=An attempt was made to launch a JNLP file in another JVM, but the netx.jar could not be located. In order to launch in an external JVM, the runtime must be able to locate the netx.jar file. LNotToSpec=JNLP file not strictly to specifications. LNotToSpecInfo=The JNLP file contains data that is prohibited by the JNLP specification. The runtime can attempt to ignore the invalid information and continue launching the file. LNotApplication=Not an application file. LNotApplicationInfo=An attempt was made to load a non-application file as an application. LNotApplet=Not an applet file. LNotAppletInfo=An attempt was made to load a non-applet file as an applet. LNoInstallers=Installers not supported. LNoInstallersInfo=JNLP installer files are not yet supported. LInitApplet=Could not initialize applet. LInitAppletInfo=For more information click "more information button". LInitApplication=Could not initialize application. LInitApplicationInfo=The application has not been initialized, for more information execute javaws from the command line. LNotLaunchable=Not a launchable JNLP file. LNotLaunchableInfo=File must be a JNLP application, applet, or installer type. LCantDetermineMainClass=Unknown Main-Class. LCantDetermineMainClassInfo=Could not determine the main class for this application. LUnsignedJarWithSecurity=Cannot grant permissions to unsigned jars. LUnsignedJarWithSecurityInfo=Application requested security permissions, but jars are not signed. LSignedJNLPAppDifferentCerts=The JNLP application is not fully signed by a single cert. LSignedJNLPAppDifferentCertsInfo=The JNLP application has its components individually signed, however there must be a common signer to all entries. LUnsignedApplet=The applet was unsigned. LUnsignedAppletPolicyDenied=The applet was unsigned, and the security policy prevented it from running. LUnsignedAppletUserDenied=The applet was unsigned, and was not trusted. LPartiallySignedApplet=The applet was partially signed. LPartiallySignedAppletUserDenied=The applet was partially signed, and the user did not trust it. LSignedAppJarUsingUnsignedJar=Signed application using unsigned jars. LSignedAppJarUsingUnsignedJarInfo=The main application jar is signed, but some of the jars it is using aren''t. LRunInSandboxError=Run in Sandbox call performed too late. LRunInSandboxErrorInfo=The classloader was notified to run the applet sandboxed, but security settings were already initialized. LSignedJNLPFileDidNotMatch=The signed JNLP file did not match the launching JNLP file. LNoSecInstance=Error: No security instance for {0}. The application may have trouble continuing LCertFoundIn={0} found in cacerts ({1}) LSingleInstanceExists=Another instance of this applet already exists and only one may be run at the same time. JNotApplet=File is not an applet. JNotApplication=File is not an application. JNotComponent=File is not a component. JNotInstaller=File is not an installer. JInvalidExtensionDescriptor=Extension does not refer to a component or installer (name={1}, location={2}). LNotVerified=Jars not verified. LCancelOnUserRequest=Cancelled on user request. LFatalVerification=A fatal error occurred while trying to verify jars. LFatalVerificationInfo=An exception has been thrown in class JarCertVerifier. Being unable to read the cacerts or trusted.certs files could be a possible cause for this exception. LNotVerifiedDialog=Not all jars could be verified. LAskToContinue=Would you still like to continue running this application? # Parser PInvalidRoot=Root element is not a jnlp element. PNoResources=No resources element specified. PUntrustedNative=nativelib element cannot be specified unless a trusted environment is requested. PExtensionHasJ2SE=j2se element cannot be specified in a component extension file. PInnerJ2SE=j2se element cannot be specified within a j2se element. PTwoMains=Duplicate main attribute specified on a resources element (there can be only one) PNativeHasMain=main attribute cannot be specified on a nativelib element. PNoInfoElement=No information element specified. PMissingTitle=title PMissingVendor=vendor PMissingElement=The {0} section has not been specified for your locale nor does a default value exist in the JNLP file. PTwoDescriptions=Duplicate description elements of kind {0} are illegal. PSharing=sharing-allowed element is illegal in a standard JNLP file PTwoSecurity=Only one security element allowed per JNLP file. PEmptySecurity=security element specified but does not contain a permissions element. PTwoDescriptors=Only one application-desc element allowed per JNLP file. PTwoDesktops=Only one desktop element allowed PTwoMenus=Only one menu element allowed PTwoTitles=Only one title element allowed PTwoIcons=Only one icon element allowed PTwoUpdates=Only one update element is allowed PUnknownApplet=Unknown Applet PBadWidth=Invalid applet width. PBadHeight=Invalid applet height. PUrlNotInCodebase=Relative URL does not specify a subdirectory of the codebase. (node={0}, href={1}, base={2}) PBadRelativeUrl=Invalid relative URL (node={0}, href={1}, base={2}) PBadNonrelativeUrl=Invalid non-relative URL (node={0}, href={1}) PNeedsAttribute=The {0} element must specify a {1} attribute. PBadXML=Invalid XML document syntax. PBadHeapSize=Invalid value for heap size ({0}) # Runtime BLaunchAbout=Launching about window... BLaunchAboutFailure=Was not able to launch About window BNeedsFile=Must specify a .jnlp file RNoAboutJnlp=Unable to find about.jnlp BFileLoc=JNLP file location BBadProp=Incorrect property format {0} (should be key=value) BBadParam=Incorrect parameter format {0} (should be name=value) BNoDir=Directory {0} does not exist. BNoCodeOrObjectApplet=Applet tag must specify a ''code'' or ''object'' or ''jnlp_href'' attribute. RNoResource=Missing Resource: {0} RShutdown=This exception to prevent shutdown of JVM, but the process has been terminated. RExitTaken=Exit class already set and caller is not exit class. RCantReplaceSM=Changing the SecurityManager is not allowed. RCantCreateFile=Cant create file {0} RCantDeleteFile=Cant delete file {0} RCantOpenFile=Could not open file {0} RCantWriteFile=Could not write to file {0} RFileReadOnly=Opening file in read-only mode RExpectedFile=Expected {0} to be a file but it was not RRemoveRPermFailed=Removing read permission on file {0} failed RRemoveWPermFailed=Removing write permissions on file {0} failed RRemoveXPermFailed=Removing execute permissions on file {0} failed RGetRPermFailed=Acquiring read permissions on file {0} failed RGetWPermFailed=Acquiring write permissions on file {0} failed RGetXPermFailed=Acquiring execute permissions on file {0} failed RCantCreateDir=Cant create directory {0} RCantRename=Cant rename {0} to {1} RDenyStopped=Stopped applications have no permissions. RExitNoApp=Cannot exit the JVM because the current application cannot be determined. RNoLockDir=Unable to create locks directory ({0}) RNestedJarExtration=Unable to extract nested jar. RUnexpected=Unexpected {0} at {1} RConfigurationError=Fatal error while reading the configuration, continuing with empty. Please fix RConfigurationFatal=ERROR: a fatal error has occurred while loading configuration. Perhaps a global configuration was required but could not be found RFailingToDefault=Failing to default configuration RPRoxyPacNotSupported=Using Proxy Auto Config (PAC) files is not supported. RProxyFirefoxNotFound=Unable to use Firefox''s proxy settings. Using "DIRECT" as proxy type. RProxyFirefoxOptionNotImplemented=Browser proxy option "{0}" ({1}) not supported yet. RBrowserLocationPromptTitle=Browser Location RBrowserLocationPromptMessage=Specify Browser Location RBrowserLocationPromptMessageWithReason=Specify Browser Location (the browser command "{0}" is invalid). HTMLnoneFound=No applet found on this html page (supported are object, embed and applet tags) HTMLmoreThenOne=More then one ({0}) applets found. Using first. You can specify ''all'' or numbers to specify applets you want to run. # icedtea-web man (note, spaces are important due to man pages markup ITWintroL1={0}provides a Free Software web browser plugin running applets written in the Java programming language and an implementation of Java Web Start, originally based on the NetX project. ITWintroL2=NetX allows Java applets and applications to be downloaded over the network, cached, and (by default) run in a secure sandbox environment. Subsequent runs of the applet download the latest version automatically. Update and security settings, among others, can be set using the itw-settings command. ITWintroL3={0} also includes a plugin to {1} within web browsers. ITWintroUrlCaption = enable Java applets BFileInfoAuthors=Names and email addresses of contributors to this project can be found in the file AUTHORS in the IcedTea-Web root directory. BFileInfoCopying=The full GPLv2 license of this project can be found in the file COPYING in the IcedTea-Web root directory. BFileInfoNews=News about releases of this project can be found in the file NEWS in the IcedTea-Web root directory. ITWdescO1title=Modular ITWdescO1text=Easily add JNLP capabilities to an application. ITWdescO2title=Saves Memory ITWdescO2text=Launch programs in a shared JVM. ITWdescO3title=Fast startup ITWdescO3text=Runs applications from a cache for fast starting. ITWdescO4title=Security ITWdescO4text=Run any application in a sandbox or log its activities. ITWdescO5title=Auto-Update ITWdescO5text=Applications can auto-update without special code. ITWdescO6title=Network Deployment ITWdescO6text=Deploy to the internet, not with installers. ITWdescO7title=Open Source ITWdescO7text=GNU Lesser General Public License. ITWdescL1=Visit the {0} or specifically the {1} pages for more information. ITWdescWikiUrlTitle=IcedTea project wiki ITWdescItwWikiUrlTitle=IcedTea-Web home ITWdescL2=Help with common issues with IcedTea-Web can be found {0} . ITWdescIssuesUrlTitle=here ITWdescL3=NetX features: ITWoptionsL1=A {0} guide for the IcedTea project is available on the wiki. ITWoptionsQuickStartUrlCaption=QuickStart ITWoptionsCodeUrlUrlCaption=Code style ITWoptionsL2={0} guidelines and {1} instructions for IcedTea-Web are available as well. Patches should be accompanied by unit tests and {2} before being sent to {3} ITWoptionsEclipseUrlCaption=Eclipse setup ITWoptionsReproducersUrlCaption=reproducers ITWoptionsDistroUrlCaption=the mailing list ITWoptionsL3=Contributing: # policyeditor man (note, spaces (especially the one around markup) are important due to man pages markup). Only bold tag is now recognized by ReplacingTextFormatter. PEintro= - view and modify security policy settings for javaws and the browser plugin PEsynopseP1=policy_file PEsynopseP2=url PEdescL1=is a GUI application with small command line support to view and edit applet security policy settings used by the IcedTea-Web implementation \ of javaws and the browser plugin. It is intended as a simpler, easier to use, and more accessible alternative \ to the standard JDK Policy Tool. Administrators and power users who need fine grained control over policy files should probably use \ Policy Tool instead of PolicyEditor. PEdescL2=If executed without any arguments, no file is opened, and saving the file will result in a prompt on where to save it. Otherwise, if a file path is given as \ a command line argument, then that file path will be opened and parsed as policy file. PEexampleL1=Show GUI and opens the default policy file. PEexampleL2=Show the GUI editor with no file opened. # javaws man (note, spaces (especially the one around markup) are important due to man pages markup). Only bold tag is now recognized by ReplacingTextFormatter. JWSintro= - a Java Web Start client JWSdescL1=is an implementation of a JNLP client. It uses a JNLP (Java Network Launch Protocol) file to securely run a remote Java application or a Java applet. \ This implementation of {0}is from the IcedTea project and is based on the NetX project. JWSdescL2=A JNLP file is an xml file that describes how to securely run a remote Java application or a Java applet. JWSoptionsL1=When specifying options, the name of the jnlp file can be after the command, the -jnlp option, an option with no arguments, or after an argument with an option that takes one argument. A html file that launches a jnlp can be specified after the -html option. JWSoptionsL2=The jnlp-file can either be a url or a local path. JWSoptionsL3=The JNLP file should only be specified once, whether as a main argument, after -jnlp or through an html file. JWSoptionsTitle1=Run options: JWSoptionsTitle2=Control options: JWSexampleL1=Shows basic help and about informations. JWSexampleL2=Shows basic help and about informations in terminal only. JWSexampleL3=Will start {0} application, originally from {1}, without downloading it, without headers check and in forced single VM. # Boot options, message should be shorter than this ----------------> BOUsage=[-run-options] jnlp file BOUsage2=[-control-options] BOJnlp = Location of JNLP file to launch (url or file). BOHtml = Location of HTML file to launch (url or file). You can use parameter ALL or numbers (like 1 2 5) to select applets on page. However experimental, this switch should keep you still in safety. BOArg = Adds an application argument before launching. BOParam = Adds an applet parameter before launching. BOProperty = Sets a system property before launching. BOUpdate = Check for updates. BOLicense = Display the GPL license and exit. BOVerbose = Enable verbose output. BOAbout = Shows a sample application. BOVersion = Print the IcedTea-Web version and exit. BONosecurity= Disables the secure runtime environment. BONoupdate = Disables checking for updates. BOHeadless = Disables download window, other UIs. BOStrict = Enables strict checking of JNLP file format. BOViewer = Shows the trusted certificate viewer. BOXml = Uses a strict XML parser to parse the JNLP file. BOredirect = Follows HTTP redirects. BXnofork = Do not create another JVM. BXclearcache= Clean the JNLP application cache. BXignoreheaders= Skip jar header verification. BXoffline = Prevent ITW network connection. Only cache will be used. Application can still connect. BOHelp1 = Prints out information about supported command and basic usage. BOHelp2 = Prints out information about supported command and basic usage. Can also take an parameter, and then it prints detailed help for this command. BOTrustnone = Instead of asking user, will foretold all answers as no. # Itweb-settings boot commands IBOList=Shows a list of all the IcedTea-Web settings and their current values. IBOGet=Shows the value of the specified settings. IBOInfo=Shows additional information about the named settings. Includes a description, the current value, the possible values, and the source of the setting. IBOSet=Sets the settings to the new value specified, if it is an appropriate value. IBOResetAll= Resets all settings to their original values. IBOReset=Resets the specified settings to their original value. IBOCheck=Checks that all the current settings have valid values. PBOFile=Specifies a policy file path to open. If exactly one argument is given, and it is not this flag, it is interpreted as a file path to open, as if this flag was given first. This flag exists \ mostly for compatibility with Policy Tool, but is also needed when opening a policy file and also using the -codebase flag. PBODefaultFile=Specifies that the default user-level policy file should be opened. This is the file which is normally used by IcedTea-Web to make decisions about custom policies and permissions \ for applets at runtime, unless configured otherwise. PBOCodebase=Specifies an applet codebase URL. If the specified codebase already exists in the policy file (if any), then it will be selected when the editor opens. If it is a new codebase then it will \ be added and selected. Multiple URLs may also be given with a single -codebase flag by separating them with spaces. In this case, the last codebase given will be selected, and all will be \ added. If this flag is given more than once, only the first is used. # Option Parser OPUnevenParams=For option {0} expected an even number of params. # NumberOfArguments descriptions. NOAnone=No argument expected NOAone=Exactly one argument expected NOAonemore=Expected one or more arguments NOAevennumber=Expected even number of arguments with param=value as valid argument # Allowed man sections manNAME=NAME manSYNOPSIS=SYNOPSIS manDESCRIPTION=DESCRIPTION manOPTIONS=OPTIONS manCOMMANDS=COMMANDS manEXAMPLES=EXAMPLES manFILES=FILES manBUGS=BUGS manAUTHOR=AUTHOR manSEE_ALSO=SEE ALSO # Cache CAutoGen=automatically generated - do not edit CNotCacheable={0} is not a cacheable resource CDownloading=Downloading CComplete=Complete CChooseCache=Choose a cache directory... CChooseCacheInfo=NetX needs a location for storing cache files. CChooseCacheDir=Cache directory CCannotClearCache=Cannot clear the cache at this time. Try later. If the problem persists, try closing your browser(s) & JNLP applications. At the end you can try to kill all java applications. \\\n You can clear cache by javaws -Xclearcache or via itw-settings Cache -> View files -> Purge CFakeCache=Cache is corrupt. Fixing. CFakedCache=Cache was corrupt and has been fixed. It is strongly recommended that you run ''javaws -Xclearcache'' and rerun your application as soon as possible. You can also use via itw-settings Cache -> View files -> Purge # extended access warning pane EXAWdesktopWants=Desktop icon shortcut (applications want to). EXAWdesktopDontWants=Desktop icon shortcut (applications don''t want to, but you still can). EXAWsubmenu=Menu icon shortcut (applications will try to include to submenu - {0}). EXAWmenuWants=Menu icon shortcut (applications want to). EXAWmenuDontWants=Menu icon shortcut (applications don''t want to, but you still can). EXAWsettingsInfo=Your current setting is: {0}. You can change it in itweb-settings in {1} panel. EXAWsettingsManage=You can manage existing menu entries in itweb-settings in {0} panel. EXAWrememberByApp=Remember by application EXAWrememberByPage=Remember by domain EXAWdontRemember=Don''t remember EXAWrememberByAppTooltip=This application will never ask for more permissions questions EXAWrememberByPageTooltip=All applications from this domain will stop asking, and will follow your current decision on all permissions EXAWdontRememberTooltip=Your decision will be used only for this single permission for this single run EXAWbrowser=browser desktop item EXAWgenjnlp=jnlp generated EXAWjnlphref=jnlp href EXAWhtml=javaws html EXAWfixhref=fix issues in jnlp-href EXAWbrowserTolltip=Browser shortcut
    \
  • This option will create shortcut to open your browser with current page loaded
  • \
  • If your browser support offline run, this is the safest option
  • EXAWbrowsersTolltip=browser used for lunching this applet (will launch IcedTea-web later)
    \
  • The default browser was preset
  • \
  • Feel free to include a browser of your choice
  • EXAWgeneratedTolltip=
  • The jnlp file will be generated from your current html page
  • \
  • Once you launch your shortcut, javaws will launch this jnlp file
  • \
  • This applet will then run without the browser
  • \
  • However experimental, this is working surprisingly well.
  • EXAWhrefTolltip=Some applets are just pointing to jnlp file, which is containing actual informations about the resources of this app.
    \
  • By selecting this option, this jnlp file will be saved and used for later launches.
  • \
  • Javaws will be the launcher, and this applet will run out of browser
  • \
  • However good this sounds, this is surprisingly not working
  • EXAWhtmlTolltip=BY using -html switch, javaws can try to parse html and try to extract applet, and to launch it out of browser
    \
  • highly experimental
  • \
  • really cool
  • EXAWfixTolltip=Some jnlp files pointed from applet are not designed to be used as jnlp apps
    \
  • This will add the known often missing elements to this file (if missing)
  • # Security SFileReadAccess=The application has requested read access to {0}. Do you want to allow this action? SFileWriteAccess=The application has requested write access to {0}. Do you want to allow this action? SDesktopShortcut=The application has requested permission to create a desktop and/or menu launcher. Do you want to allow this action? SSigUnverified=The application''s digital signature cannot be verified. Do you want to run the application? It will be granted unrestricted access to your computer. SSigVerified=The application''s digital signature has been verified. Do you want to run the application? It will be granted unrestricted access to your computer. SSignatureError=The application''s digital signature has an error. Do you want to run the application? It will be granted unrestricted access to your computer. SUntrustedSource=The digital signature could not be verified by a trusted source. Only run if you trust the origin of the application. SWarnFullPermissionsIgnorePolicy=The code executed will be given full permissions, ignoring any Java policies you may have. STrustedSource=The digital signature has been validated by a trusted source. SClipboardReadAccess=The application has requested read-only access to the system clipboard. Do you want to allow this action? SClipboardWriteAccess=The application has requested write-only access to the system clipboard. Do you want to allow this action? SPrinterAccess=The application has requested printer access. Do you want to allow this action? SNetworkAccess=The application has requested permission to establish connections to {0}. Do you want to allow this action? SNoAssociatedCertificate= SUnverified=(unverified) SAlwaysTrustPublisher=Always trust content from this publisher SHttpsUnverified=The website''s HTTPS certificate cannot be verified. SRememberOption=Remember this option? SRememberAppletOnly=For applet SRememberCodebase=For site {0} SUnsignedSummary=An unsigned Java application wants to run SUnsignedDetail=An unsigned application from the following location wants to run:
      {0}
    The page which made the request was:
      {1}

    It is recommended you only run applications from sites you trust. SUnsignedAllowedBefore=You have accepted this applet previously - ({0}). SUnsignedRejectedBefore=You have rejected this applet previously - ({0}). SUnsignedQuestion=Allow the applet to run? SPartiallySignedSummary=Only parts of this application code are signed. SPartiallySignedDetail=This application contains both signed and unsigned code. While signed code is safe if you trust the provider, unsigned code may imply code outside of the trusted provider''s control. SPartiallySignedQuestion=Do you wish to proceed and run this application anyway? SAuthenticationPrompt=The {0} server at {1} is requesting authentication. It says "{2}" SJNLPFileIsNotSigned=This application contains a digital signature in which the launching JNLP file is not signed. STrustedOnlyAttributeFailure=This application specifies Trusted-only as True in its Manifest. {0} and requests permission level: {1}. This is not allowed. STOAsignedMsgFully = The applet is fully signed STOAsignedMsgAndSandbox = The applet is fully signed and sandboxed STOAsignedMsgPartiall = The applet is not fully signed STempNetwork=Allow incoming and outgoing network connections STempReadFilesAndProperties=Read-only access to all files and properties STempWriteFilesAndProperties=Write-only access to all files and properties STempReflectionAndExternal=Java Reflection and external code access STempAllMedia=All media (printing, audio, clipboard access) # Security - used for the More Information dialog SBadKeyUsage=Resources contain entries whose signer certificate''s KeyUsage extension doesn''t allow code signing. SBadExtendedKeyUsage=Resources contain entries whose signer certificate''s ExtendedKeyUsage extension doesn''t allow code signing. SBadNetscapeCertType=Resources contain entries whose signer certificate''s NetscapeCertType extension doesn''t allow code signing. SHasExpiredCert=The digital signature has expired. SHasExpiringCert=Resources contain entries whose signer certificate will expire within six months. SNotYetValidCert=Resources contain entries whose signer certificate is not yet valid. SUntrustedCertificate=The digital signature was generated with an untrusted certificate. STrustedCertificate=The digital signature was generated with a trusted certificate. SCNMisMatch=The expected hostname for this certificate is: "{0}"
    The address being connected to is: "{1}" SRunWithoutRestrictions=This application will be run without the security restrictions normally provided by Java. SCertificateDetails=Certificate Details # Security - certificate information SIssuer=Issuer SSerial=Serial SMD5Fingerprint=MD5 Fingerprint SSHA1Fingerprint=SHA1 Fingerprint SSignature=Signature SSignatureAlgorithm=Signature Algorithm SSubject=Subject SValidity=Validity # Certificate Viewer CVCertificateViewer=Certificates CVCertificateType=Certificate Type CVDetails=Details CVExport=Export CVExportPasswordMessage=Enter password to protect key file: CVImport=Import CVImportPasswordMessage=Enter password to access file: CVIssuedBy=Issued By CVIssuedTo=Issued To CVPasswordTitle=Authentication Required CVRemove=Remove CVRemoveConfirmMessage=Are you sure you want to remove the selected certificate? CVRemoveConfirmTitle=Confirmation - Remove Certificate? CVUser=User CVSystem=System # KeyStores: see KeyStores.java KS=KeyStore KSCerts=Trusted Certificates KSJsseCerts=Trusted JSSE Certificates KSCaCerts=Trusted Root CA Certificates KSJsseCaCerts=Trusted JSSE Root CA Certificates KSClientCerts=Client Authentication Certificates # KeyStores: set password KSresultUntilNow=Got {0} during keystore operation {1}. Attempts to unlock: {2} KSinvalidPassword=Invalid password? KSheadlesWarning=Headless mode currently does not support runtime-passwords KSnwPassHelp=Type new password and press ok. Give up by pressing anything else. # Deployment Configuration messages DCIncorrectValue=Property "{0}" has incorrect value "{1}". Possible values {2}. DCInternal=Internal error: {0} DCSourceInternal= DCUnknownSettingWithName=Property "{0}" is unknown. DCmaindircheckNotexists=After all attempts, your configuration directory {0} do not exists. DCmaindircheckNotdir=Your configuration directory {0} is not directory. DCmaindircheckRwproblem=Your configuration directory {0} cannot be read/written properly. # Value Validator messages. Messages should follow "Possible values ..." VVPossibleValues=Possible values {0} VVPossibleBooleanValues=are {0} or {1} VVPossibleFileValues=include an absolute path to a file or directory VVPossibleRangedIntegerValues=are in range {0} to {1} (inclusive) VVPossibleUrlValues=include any valid url (eg. http://icedtea.classpath.org/hg/) # Control Panel - Main CPMainDescriptionShort=Configure IcedTea-Web CPMainDescriptionLong=Configure how the browser plugin (IcedTeaNPPlugin) and javaws (NetX) work # Control Panel - Tab Descriptions CPAboutDescription=View version information about IcedTea Control Panel. CPNetworkSettingsDescription=Configure network settings, including how IcedTea-Web connects to the internet and whether to use any proxies. CPTempInternetFilesDescription=Java stores application data for faster execution the next time you run it. CPJRESettingsDescription=View and manage Java Runtime Environment versions and settings for Java applications and applets. CPCertificatesDescription=Use certificates to positively identify yourself, certifications, authorities, and publishers. CPSecurityDescription=Use this to configure security settings. CPDebuggingDescription=Enable options here to help with debugging CPDesktopIntegrationDescription=Set whether or not to allow creation of desktop shortcut. CPDesktopIntegrationShowIntegrations=Show desktop and menu integrations window CPDesktopIntegrationLinuxOnly=Desktop integration manager available only for Linux. Sorry CPJVMPluginArguments=Set JVM arguments for plugin. CPJVMitwExec=Set JVM for IcedTea-Web \u2014 working best with OpenJDK CPJVMitwExecValidation=Validate JVM for IcedTea-Web CPJVMPluginSelectExec=Browse for JVM for IcedTea-Web CPJVMnone=No validation result for CPJVMvalidated=Validation result for CPJVMvalueNotSet=Value is not set. Hardcoded JVM will be used. CPJVMnotLaunched=Error, process was not launched, see console output for more info. CPJVMnoSuccess=Error, process have not ended successfully, see output for details, but your java is not set correctly. CPJVMopenJdkFound=Excellent, OpenJDK detected CPJVMoracleFound=Great, Oracle java detected CPJVMibmFound=Good, IBM java detected CPJVMgijFound=Warning, gij detected CPJVMstrangeProcess=Your path had an executable process, but it was not recognized. Verify the Java version in the console output. CPJVMnotDir=Error, The path you chose is not a directory. CPJVMisDir=Ok, the path you chose is a directory. CPJVMnoJava=Error, the directory you chose does not contain bin/java. CPJVMjava=Ok, the directory you chose contains bin/java. CPJVMnoRtJar=Error, the directory you chose does not contain lib/rt.jar CPJVMrtJar=Ok, the directory you chose contains lib/rt.jar. CPJVMPluginAllowTTValidation=Validate JRE immediately CPJVMNotokMessage1=You have entered invalid JDK value:
    • {0}
    with following error message: CPJVMNotokMessage2=You might be seeing this message because:
    * Some validity tests have not been passed
    * Non-OpenJDK is detected
    With invalid JDK IcedTea-Web will probably not be able to start.
    If it will break, you have to modify or remove {0} property in your configuration file:
    • {1}
    You should trust yours admin or at least try to search for OpenJDK in your system or be sure you know what you are doing. CPJVMconfirmInvalidJdkTitle=Confirm invalid JDK CPJVMconfirmReset=Reset to default? CPPolicyDetail=View or edit your user-level Java Policy File. This allows you to grant or deny runtime permissions to applets regardless of the standard security sandboxing rules. CPPolicyTooltip=Open {0} in policy editor CPPolicyEditorNotFound=Could not find a system policy file editor. Check that policytool is on your PATH. # Control Panel - Buttons CPButAbout=About... CPButNetworkSettings=Network Settings... CPButSettings=Settings... CPButView=View... CPButCertificates=Certificates... CPButSimpleEditor=Simple editor CPButAdvancedEditor=Advanced editor # Control Panel - Headers CPHead=IcedTea-Web Control Panel CPHeadAbout=\u00a0About\u00a0IcedTea-Web\u00a0 CPHeadNetworkSettings=\u00a0Network\u00a0Proxy\u00a0Settings\u00a0 CPHeadTempInternetFiles=\u00a0Temporary\u00a0Internet\u00a0Files\u00a0 CPHeadJRESettings=\u00a0Java\u00a0Runtime\u00a0Environment\u00a0Settings\u00a0 CPHeadCertificates=\u00a0Certificates\u00a0 CPHeadDebugging=\u00a0Debugging\u00a0Settings\u00a0 CPHeadDesktopIntegration=\u00a0Desktop\u00a0Integrations\u00a0 CPHeadSecurity=\u00a0Security\u00a0Settings\u00a0 CPHeadJVMSettings=\u00a0JVM\u00a0Settings\u00a0 CPHeadPolicy=\u00a0Custom\u00a0Policy\u00a0Settings\u00a0 # Control Panel - Tabs CPTabAbout=About IcedTea-Web CPTabCache=Cache CPTabCertificate=Certificates CPTabClassLoader=Class Loaders CPTabDebugging=Debugging CPTabDesktopIntegration=Desktop Integration CPTabMenuShortcuts=Manage installed menu shortcuts CPTabNetwork=Network CPTabRuntimes=Runtimes CPTabSecurity=Security CPTabJVMSettings=JVM Settings CPTabPolicy=Policy Settings # Control Panel - AboutPanel CPAboutInfo=This is the control panel for setting deployments.properties.
    Not all options will take effect until implemented.
    The use of multiple JREs is currently limited to OpenJDK.
    # Control Panel - AdvancedProxySettings APSDialogTitle=Network Settings APSServersPanel=Servers APSProxyTypeLabel=Type APSProxyAddressLabel=Proxy Address APSProxyPortLabel=Proxy Port APSLabelHTTP=HTTP APSLabelSecure=Secure APSLabelFTP=FTP APSLabelSocks=Socks APSSameProxyForAllProtocols=Use the same proxy server for all protocols. APSExceptionsLabel=Exceptions APSExceptionsDescription=Do not use proxy server for addresses beginning with APSExceptionInstruction=Separate each entry with a semicolon. # Control Panel - DebugginPanel CPDebuggingPossibilites=Logging outputs DPEnableLogging=Enable debugging DPEnableLoggingHint=When this switch is on, then also debug messages are logged. Same as -verbose or ICEDTEAPLUGIN_DEBUG=true DPEnableHeaders=Enable headers DPEnableHeadersHint=When this switch is on, each logged message have header with additional information like user, place in code and time DPEnableFile=Enable logging to file DPEnableLegacyFileLog=Use java.util.logging instead of direct file writing DPEnableClientAppFileLogging=Fork client applications outputs also to file DPEnableLegacyFileLogHint=java.util.logging is know to deadlock rarely when used on applications with custom logging extensions DPEnableClientAppFileLoggingHint=Logging of client apps is known to sometimes not work with java.util.logging on CPFilesLogsDestDir=File logs directory CPFilesLogsDestDirResert=Reset to default DPEnableFileHint=output messages will be saved to file in your {0} directory DPEnableStds=Enable logging to standard outputs DPEnableStdsHint=messages will be printed to standard outputs DPEnableSyslog=Enable logging to system logs DPEnableSyslogHint=output messages will be saved to system logs DPDisable=Disable DPHide=Hide on startup DPShow=Show on startup DPShowPluginOnly=Show on plugin startup DPShowJavawsOnly=Show on javaws startup DPJavaConsole=Java Console DPJavaConsoleDisabledHint=Java console is disabled. Use itweb-settings to configure it out of disabled to any show or hide value. # PolicyEditor PETitle=PolicyEditor PETitleWithPath=PolicyEditor - {0} PETitleWithChangesMade={0} * PEReadProps=Read system properties PEReadPropsDetail=Allow applets to read system properties such as your username and home directory location PEWriteProps=Write system properties PEWritePropsDetail=Allow applets to (over)write system properties PEReadFiles=Read from local files PEReadFilesDetail=Allow applets to read from files in your home directory PEWriteFiles=Write to local files PEWriteFilesDetail=Allow applets to write to files in your home directory PEDeleteFiles=Delete local files PEDeleteFilesDetail=Allow applets to delete files in your home directory PEReadSystemFiles=Read all system files PEReadSystemFilesDetail=Allow applets read-only access to all locations on your computer PEWriteSystemFiles=Write all system files PEWriteSystemFilesDetail=Allow applets write-only access to all locations on your computer PEReadTempFiles=Read from temp files PEReadTempFilesDetail=Allow applets to read from your temporary files directory PEWriteTempFiles=Write to temp files PEWriteTempFilesDetail=Allow applets to write to your temporary files directory PEDeleteTempFiles=Delete temp files PEDeleteTempFilesDetail=Allow applets to delete files in your temporary files directory PEAWTPermission=Window System Access PEAWTPermissionDetail=Allow applets all AWT windowing system access PEClipboard=Access clipboard PEClipboardDetail=Allow applets to read from and write to your clipboard PENetwork=Access the network PENetworkDetail=Allow applets to establish any network connections PEPrint=Print documents PEPrintDetail=Allow applets to queue print jobs PEPlayAudio=Play sounds PEPlayAudioDetail=Allow applets to play sounds, but not record PERecordAudio=Record audio PERecordAudioDetail=Allow applets to record audio, but not play back PEReflection=Java reflection PEReflectionDetail=Allow applets to access the Java Reflection API PEClassLoader=Get ClassLoader PEClassLoaderDetail=Allow applets to access the system classloader (often used with Reflection) PEClassInPackage=Access other packages PEClassInPackageDetail=Allow applets to access classes from other applet packages (often used with Reflection) PEDeclaredMembers=Access private class data PEDeclaredMembersDetail=Allow applets to access normally hidden data from other Java classes (often used with Reflection) PEAccessThreads=Modify threads PEAccessThreadsDetail=Allow applets to start, stop, and otherwise manage threads PEAccessThreadGroups=Modify threadgroups PEAccessThreadGroupsDetail=Allow applets to start, stop, and otherwise manage thread groups PEExec=Execute commands PEExecDetail=Allow applets to execute system commands PEGetEnv=Get environment variables PEGetEnvDetail=Allow applets to read system environment variables PECouldNotOpen=Unable to open policy file PECouldNotSave=Unable to save policy file PEAddCodebase=Add new Codebase PERemoveCodebase=Remove PECodebasePrompt=Enter a new codebase PEGlobalSettings=All Applets PESaveChanges=Save changes before exiting? PEChangesSaved=Changes saved PECheckboxLabel=Permissions PECodebaseLabel=Codebases PEFileMenu=File PENewMenuItem=New PEOpenMenuItem=Open... PEOpenDefaultMenuItem=Open default policy file PESaveMenuItem=Save PESaveAsMenuItem=Save As... PEExitMenuItem=Exit PECodebaseMenu=Codebase PEAddCodebaseItem=Add New... PERemoveCodebaseItem=Remove PERenameCodebaseItem=Rename PECopyCodebaseItem=Copy PEPasteCodebaseItem=Paste... PERenameCodebase=Rename codebase to: PEPasteCodebase=Paste copied codebase as: PEViewMenu=View PECustomPermissionsItem=Custom Permissions... PEFileModified=File Modification Warning PEFileModifiedDetail=The policy file at {0} has been modified since it was opened. Reload and re-edit before saving? PEFileMissing=The policy file was missing from disk. A new file has been saved with the same name. PEGAccesUnowenedCode = Execute unowned code PEGMediaAccess = Media access PEGrightClick = right click to fold/unfold PEGReadFileSystem = Read from system PEGWriteFileSystem = Write to system PEClipboardError=Clipboard does not appear to contain properly formatted policy entries PEInvalidPolicy=Paste Failed: Could not read policy entry for codebase {0} from system clipboard PEClipboardAccessError=Could not read from clipboard PEDefaultFileFilePathSpecifiedError=Either -file (or simply a main argument) or -defaultfile may be specified, but not both PEMainArgAndFileSwitchSpecifiedError=Either -file may be specified or a main argument may be specified, but not both PEHelpMenu=Help PEAboutPolicyEditorItem=About PolicyEditor PEPolicyEditorHelpItem=PolicyEditor Help PEHelpDialogTitle=PolicyEditor Help PEHelpDialogContent=

    PolicyEditor Help

    \ PolicyEditor allows you to secure java applets or applications you want to run \ with the specified permissions you decide to give it. \

    Features

    \
      \
    • Accessible: through use of keyboard only, mouse only, or both\
    • Customize: by specifying any permissions you decide to choose\
    • Secure: your applets and applications to use only the permissions you specify\
    • Manage: codebases and their respective permissions you set\
    \ PolicyEditor works by specifying a codebase and checking the permissions you wish to grant to \ the current Java applet or application. To run the applet/application with only the specified permissions, \ use the sandbox button or specify sandbox mode in the manifest.\

    \ Within PolicyEditor there are many additional actions. Right-clicking or pressing \ enter (after tabbing to the group) on a permission group with a small arrow or chevron \ beside it will expand or collapse the given permission checkbox group. Other notable features are \ the ability to copy and paste a set of permissions into a new codebase, allowing for \ quick access to a user specified default permissions group. \ Also, you''re not limited to the predefined checkbox permissions. By accessing \ Custom Permissions through the view menu, you can add any customized permissions. \ # Policy Editor CustomPolicyViewer PECPTitle=Custom Policy Viewer PECPListLabel=Other policies for {0} PECPAddButton=Add PECPRemoveButton=Remove PECPCloseButton=Close PECPType=type PECPTarget=target PECPActions=actions PECPPrompt=Enter a custom permission. Do not include \"permission\" or punctuation marks. # PolicyEditor key mnemonics. See KeyEvent.VK_* PEFileMenuMnemonic=F PECodebaseMenuMnemonic=C PEViewMenuMnemonic=V PEHelpMenuMnemonic=H PEAddCodebaseMnemonic=N PEAddCodebaseItemMnemonic=N PERemoveCodebaseMnemonic=R PERemoveCodebaseItemMnemonic=R PENewMenuItemMnemonic=N PEOpenMenuItemMnemonic=O PEOpenDefaultMenuItemMnemonic=D PESaveMenuItemMnemonic=S PEExitMenuItemMnemonic=X PECustomPermissionsItemMnemonic=U PECopyCodebaseItemMnemonic=C PEPasteCodebaseItemMnemonic=P PECopyCodebaseToClipboardItemMnemonic=U PESaveAsMenuItemMnemonic=A PERenameCodebaseItemMnemonic=E PEAboutPolicyEditorItemMnemonic=A PEPolicyEditorHelpItemMnemonic=H # See javax.swing.KeyStroke.getKeyStroke(String) PEAddCodebaseItemAccelerator=control shift N PERemoveCodebaseItemAccelerator=DELETE PENewMenuItemAccelerator=control N PEOpenMenuItemAccelerator=control O PEOpenDefaultMenuItemAccelerator=control D PESaveMenuItemAccelerator=control S PESaveAsMenuItemAccelerator=control shift S PEExitMenuItemAccelerator=control Q PECustomPermissionsItemAccelerator=control U PECopyCodebaseItemAccelerator=control C PEPasteCodebaseItemAccelerator=control V PERenameCodebaseItemAccelerator=F2 PECopyCodebaseToClipboardItemAccelerator=control shift C PEAboutPolicyEditorCloseAccelerator=control Q #conole itself labels CONSOLErungc = Run GC CONSOLErunFinalizers = Run Finalizers CONSOLErunningFinalizers = Running finalization.... CONSOLEmemoryInfo = Memory Info CONSOLEsystemProperties = System Properties CONSOLEclassLoaders = Available Classloaders CONSOLEthreadList = Thread List CONSOLEthread = Thread CONSOLEnoClassLoaders = No Classloader info exists in system CONSOLEmemoryMax = Max Memory CONSOLEmemoryTotal = Total Memory CONSOLEmemoryFree = Free Memory CONSOLEClean=Clear # console output pane labels COPsortCopyAllDate=sort copy all by date COPshowHeaders=Show headers: COPuser=user COPorigin=origin COPlevel=level COPdate=date COPthread1=thread 1 COPthread2=thread 2 COPShowMessages=Show messages COPstdOut=std. Out COPstdErr=std. Err COPjava=java COPplugin=plugin COPpreInit=pre-init COPpluginOnly=plugin only COPSortBy=Sort by COPregex=Regular expression filter COPAsArrived=As arrived (no sort) COPcode=code COPmessage=message COPSearch=Search COPautoRefresh=auto refresh COPrefresh=refresh COPApply=Apply COPmark=mark COPCopyAllPlain=Copy all (plain) COPCopyAllRich=Copy all (rich) COPnext=next>>> COPprevious=<<WARNING: Uses more space than {0} MB available TIFPCacheSizeSpinnerLargeValueWarning=Available: {0} MB TIFPCacheSizeSetToNoCaching=Cached files will be deleted when IcedTea-Web terminates. TIFPCacheSizeSpinnerTooltip=Minimum: {0} Maximum: {1} # Control Panel - Cache Viewer CVCPDialogTitle=Cache Viewer CVCPButRefresh=Refresh CVCPButDelete=Delete CVCPCleanCache=Purge CVCPCleanCacheTip=Some errors may be caused by old files in your cache. Before submitting the bug, you may clear cache and try to run application again. \\\n You can clear cache by javaws -Xclearcache or via itw-settings Cache -> View files -> Purge CVCPColLastModified=Last Modified CVCPColSize=Size (Bytes) CVCPColDomain=Domain CVCPColType=Type CVCPColPath=Path CVCPColName=Name # Control Panel - desktop integration manager DIMtitle=IcedTea-Web Shortcut Manager DIMremoveSelected=Remove selected DIMselectRelativeRecordsFromOtherColumns=Select related records DIMreloadLists=Reload DIMselectAll=Select all DIMclearSelection=Deselect all DIMdescription=Manage the shorctuts and resources (cached images, etc) IcedTea-Web created for desktop integration DIMguessedDesktop=Desktop folder as well guessed as possible. DIMselectionPreview=Selection preview DIMaskBeforeDelete=Are you sure you want to delete {0} files? DIMgeneratedJnlps=Generated JNLPs DIMgeneratedJnlpsTooltip=All files in this list should be generated by IcedTea-Web! DIMicons=Icons DIMiconsTooltip=All files in this list should be icons cached by IcedTea-Web! DIMorphans=orphans DIMorphansTooltip=Will select all items which are not listed in any shortcut. DIMmenuItems=Menu Items DIMmenuItemsTooltip=All shortcuts in this list should be generated by IcedTea-Web! DIMdesktopItems=Desktop Items DIMdesktopItemsTooltipL1=Not all your shortcuts on your Desktop were generated by IcedTea-Web! DIMdesktopItemsTooltipL2=For your convenience: DIMdesktopItemsTooltipL3=red items were probably not generated by IcedTea-Web DIMdesktopItemsTooltipL4=dark green items are browser shortcuts, so they were probably generated by IcedTea-Web DIMdesktopItemsTooltipL5=green items are javaws shortcuts, so they were very likely generated by IcedTea-Web DIMdesktopItemsTooltipL6=In all cases, be careful what you delete, and verify connections with `select related records` mode DIMgeneratedButton=generated DIMgeneratedButtonTooltip=Will select related generated stuff. DIMiconsButton=icons DIMiconsButtonTooltip=Will select related cached icons. # Control Panel - Misc. CPJRESupport=IcedTea-Web currently does not support the use of multiple JREs. CPInvalidPort=Invalid port number given.\n[Valid port numbers are 1-65535] CPInvalidPortTitle=Error on input. # command line control panel CLNoInfo=No information available (is this a valid option?). CLValue=Value: {0} CLValueSource=Source: {0} CLDescription=Description: {0} CLUnknownCommand=Unknown command {0} CLUnknownProperty=Unknown property-name "{0}" CLWarningUnknownProperty=WARNING: Unknown property name "{0}" - creating new property CLNoIssuesFound=No issues found. CLIncorrectValue=Property "{0}" has incorrect value "{1}". Possible values {2}. CLListDescription=Shows a list of all property names and values that are in use by IcedTea-Web CLGetDescription=Shows the value for property-name CLSetDescription=Sets the property-name to value if possible. The value is checked for being valid. If the administrator has locked the property, this will have no effect CLResetDescription=Resets the value for property-name to it\''s default value.\nall resets all properties recognized by IcedTea-Web to their default value. CLInfoDescription=Shows more information about the given property CLCheckDescription=Shows any properties that have been defined but are not recognized by IcedTea-Web CLUnexpectedNumberOfCommands=Itweb-settings can only run one command at a time. # splash screen related SPLASHerror = Click here for details. An exception has occurred. SPLASH_ERROR = ERROR SPLASHtitle = Title SPLASHvendor = Vendor SPLASHhomepage = Homepage SPLASHdescription = Description SPLASHClose= Close SPLASHclosewAndCopyException = Close and copy the stack trace to clipboard SPLASHexOccured = An exception has occurred... SPLASHHome = Home SPLASHcantCopyEx = Cannot copy exception SPLASHnoExRecorded = No exception recorded SPLASHmainL1 = For even more information you can visit {0} and follow the steps described there on how to obtain necessary information to file bug SPLASHmainL3 = No further information available, try to launch the browser from the command line and examine the output. SPLASHcloseAndCopyShorter = Close and copy to clipboard SPLASHmainL4 = The following exception has occurred. For more information, try to launch the browser from the command line and examine the output. SPLASHmainL2 = Additional information may be available in the console or logs. Even more information is available if debugging is enabled. SPLASHexWas = Exception was: SPLASHcfl = Can''t follow link to SPLASHvendorsInfo = Information from vendor of your application SPLASHanotherInfo = Another available info SPLASHdefaultHomepage = Unspecified homepage, verify source rather SPLASHerrorInInformation = Error during loading of information element, verify source rather SPLASHmissingInformation = Information element is missing, verify source rather SPLASHchainWas = This is the list of exceptions that occurred launching your applet. Please note, those exceptions can originate from multiple applets. For a helpful bug report, be sure to run only one applet. CBCheckFile = The application is a local file. Codebase validation is disabled. See: http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/security/no_redeploy.html for details. CBCheckNoEntry = This application does not specify a Codebase in its manifest. Please verify with the applet''s vendor. Continuing. See: http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/security/no_redeploy.html for details. CBCheckUnsignedPass = Codebase matches codebase manifest attribute, but application is unsigned. Continuing. See: http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/security/no_redeploy.html for details. CBCheckUnsignedFail= The application''s codebase does NOT match the codebase specified in its manifest, but the application is unsigned. Continuing. See: http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/security/no_redeploy.html for details. CBCheckOkSignedOk = Codebase matches codebase manifest attribute, and application is signed. Continuing. See: http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/security/no_redeploy.html for details. CBCheckSignedAppletDontMatchException = Signed applets are not allowed to run when their actual Codebase does not match the Codebase specified in their manifest. Expected: {0}. Actual: {1}. See: http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/security/no_redeploy.html for details. CBCheckSignedFail = Application Codebase does NOT match the Codebase specified in the application''s manifest, and this application is signed. You are strongly discouraged from running this application. See: http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/security/no_redeploy.html for details. # itweb man base (note, spaces (especially the one around markup) are important due to man pages markup). Only bold tag is now recognized by ReplacingTextFormatter. ITWTBbugs=There aren''t any known bugs. If you come across one, please file it at ITWTBdebug=Please run in debug (-verbose switch or itw-settings setting or ICEDTEAPLUGIN_DEBUG variable set to true) \ mode and include that output (best is from java console) with URL to jnlp or html file (or the jnlp/html file or \ application itself) when filing out the bug report. ITWTBwritten=Written and maintained by the IcedTea contributors. ITWTBdirs=Where $XDG_CONFIG_DIR, $XDG_CACHE_DIR and $XDG_RUNTIME_DIR are set as ~/.config, ~/.cache and /tmp or /var/tmp if not set. # itweb-settings man (note, spaces (especially the one around markup) are important due to man pages markup). Only bold tag is now recognized by ReplacingTextFormatter. ITWSintro= - view and modify settings for javaws and the browser plugin ITWSsynops=command arguments IWSdescL1=is a command line and a GUI program to modify and edit settings used by the IcedTea-Web implementation \ of javaws and the browser plugin. IWSdescL2=If executed without any arguments, it starts up a GUI. Otherwise, it tries to do what is specified in the argument. IWSdescL3=The command-line allows quickly searching, making a copy of and modifying specific settings without having to hunt through a UI. IWSexampleL1=Show the GUI editor IWSexampleL2=Resets the value of `{0}` setting. ITWSdefault=default IWSexampleL3=Known properties IWSexampleL31=(key, value and default value (if different)): IWSexampleL32=(key and default value): IWSpossible=Possible: # itweb-plugin man (note, spaces (especially the one around markup) are important due to man pages markup). Only bold tag is now recognized by ReplacingTextFormatter. ITWPintro= - allow to run java applets in your favorite browser ITWPsynopsL1=is working in your browser, once your browser knows about this files. ITWPsynopsL2=The {0} must be placed, or linked inside specific directories. See {1} ITWPsynopsL3= Mozilla compatible browsers like Firefox, Midori, Epiphany, Chrome or Chromium use: ITWPsynopsL4= Opera family browsers like Opera use: ITWPtrademarks=All third-party trademarks are the property of their respective owners # files descriptions FILEpipe=Contains in and out pipe for native2java communication and (if enabled) debugging pipe. FILEmozillauser=Location of plugin library for user''s purposes on Mozilla compliant browser. FILEmozillaglobal64=Location of plugin library for global purposes on Mozilla compliant browser, 64-bit systems. FILEmozillaglobal32=Location of plugin library for global purposes on Mozilla compliant browser, 32-bit systems. FILEopera64=Location of plugin library for global purposes on opera compliant browser, 64-bit systems. FILEopera32=Location of plugin library for global purposes on opera compliant browser, 32-bit systems. TAGSOUPtail=You may have missing tagsoup installation or your ITW was not built against it. Check your installation and/or consult distribution. TAGSOUPnotUsed"You are not using Malformed parser. If you have set {0}, remove it. Or... TAGSOUPbroken=Broken Malformed parser. TAGSOUPhtmlNotUsed=Tagsoup''s html2xml cleaning is Disabled. Remove {0}. Parsing will probably fail. TAGSOUPhtmlBroken=Tagsoup''s html2xml cleaning not loaded. Install tagsoup (and build ITW against). Parsing will probably fail. FILEcache=Contains cached runtime entries. FILErecentlyUsed=Additional information about items in cache FILEappdata=Contains saved application data. FILElogs=contains file-log files (if enabled), itw-cplugin-date_time.log for native part of plugin, itw-javantx-date_time.log for everything else. FILEicons=Location where icons of javaws applications desktop/menu launchers icons are stored FILEjnlps=Location where jnlp files generated from html pages for javaws applications desktop/menu launchers icons are stored FILEmenus=Subdirectory in users menus space, for placing custom menu shortcuts. FILEextasuser=File responsible for various actions on applets and apps based on their codebase based on users actions. FILEextasadmin=File responsible for various actions on applets and apps based on their codebase based on admins actions. FILEglobaldp=Global deployment config file. FILEtmpappdata=Contains temporary runtime files. FILElocksdir=Location of netx locks. FILEmainlock=Location of netx main lock. FILEpolicy=Contains granted permissions for selected unsigned apps. FILEusercerts=Contains various users stored certificates. FILEjavacerts=Contains various system java-wide stored certificates. FILEjavadp=java-global deployment properties file. May be affected by {0}. FILEuserdp=Users main deployment properties file. APPEXTSECappletSecurityLevelExtraHighId=Disable running of all Java applets APPEXTSECappletSecurityLevelVeryHighId=Very High Security APPEXTSECappletSecurityLevelHighId=High Security APPEXTSECappletSecurityLevelLowId=Low Security APPEXTSECappletSecurityLevelExtraHighExplanation=No applet will be run APPEXTSECappletSecurityLevelVeryHighExplanation=No unsigned applets will be run APPEXTSECappletSecurityLevelHighExplanation=User will be prompted for each unsigned applet APPEXTSECappletSecurityLevelLowExplanation=All, even unsigned, applets will be run APPEXTSECunsignedAppletActionAlways=Always trust this (matching) applet(s) APPEXTSECunsignedAppletActionNever=Never trust this (matching) applet(s) APPEXTSECunsignedAppletActionYes=This applet was visited and allowed APPEXTSecunsignedAppletActionSandbox=This applet was visited and allowed to run with restricted privileges APPEXTSECunsignedAppletActionNo=This applet was visited and denied APPEXTSECunsetAppletAction=This applet has not yet asked for this action APPEXTSECControlPanelExtendedAppletSecurityTitle=Extended applet security APPEXTSECguiTableModelTableColumnActionUA=Unsigned applet Action APPEXTSECguiTableModelTableColumnActionMatchALACA=Library Action APPEXTSECguiTableModelTableColumnDateOfAction=Date of action APPEXTSECguiTableModelTableColumnDocumentBase=Document-base APPEXTSECguiTableModelTableColumnCodeBase=Code-base APPEXTSECguiTableModelTableColumnArchives=Archives APPEXTSECguiPanelAppletInfoHederPart1={0} {1} APPEXTSECguiPanelAppletInfoHederPart2={0} from {1} APPEXTSECguiPanelConfirmDeletionOf=Are you sure you want to delete following {0} items APPEXTSECguiPanelHelpButton=Help APPEXTSECguiPanelSecurityLevel=Security Level APPEXTSECguiPanelGlobalBehaviourCaption=Settings of global behavior for applets APPEXTSECguiPanelDeleteMenuSelected=selected APPEXTSECguiPanelDeleteMenuAllA=all allowed (A) APPEXTSECguiPanelDeleteMenuAllN=all forbidden (N) APPEXTSECguiPanelDeleteMenuAlly=all approved (y) APPEXTSECguiPanelDeleteMenuAlln=all rejected (n) APPEXTSECguiPanelDeleteMenuAllAll=absolute all APPEXTSECguiPanelDeleteButton=Delete APPEXTSECguiPanelDeleteButtonToolTip=You can press delete key during browsing the table. It will act as delete selected APPEXTSECguiPanelTestUrlButton=Test url APPEXTSECguiPanelAddRowButton=Add new row APPEXTSECguiPanelValidateTableButton=Validate table APPEXTSECguiPanelAskeforeActionBox=Ask me before action APPEXTSECguiPanelShowRegExesBox=Show full regular expressions APPEXTSECguiPanelInverSelection=Invert selection APPEXTSECguiPanelMoveRowUp=Move row up APPEXTSECguiPanelMoveRowDown=Move row down APPEXTSECguiPanelCustomDefs=User definitions APPEXTSECguiPanelGlobalDefs=System definitions APPEXTSECguiPanelDocTest=Type document base URL APPEXTSECguiPanelCodeTest=Type code base URL APPEXTSECguiPanelNoMatch=Nothing matched APPEXTSECguiPanelMatchingNote=Please note, that only first matched result will be considered as result. APPEXTSECguiPanelMatched=Matched APPEXTSECguiPanelMatchingError=Error during matching: {0} APPEXTSECguiPanelCanNotValidate=Cannot validate, cannot create tmp file - {0} APPEXTSECguiPanelEmptyDoc=All document-bases must be full APPEXTSECguiPanelEmptyCode=All code-bases must be full APPEXTSECguiPanelTableValid=Table looks valid APPEXTSECguiPanelTableInvalid=Invalid with following error: {0} APPEXTSECguiPanelShowOnlyPermanent=Show only permanent records APPEXTSECguiPanelShowOnlyTemporal=Show only previously temporarily decided records APPEXTSECguiPanelShowAll=Show all records APPEXTSECguiPanelShowOnlyPermanentA=Show only allowed permanent records APPEXTSECguiPanelShowOnlyPermanentN=Show only forbidden permanent records APPEXTSECguiPanelShowOnlyTemporalY=Show previously allowed applets records APPEXTSECguiPanelShowOnlyTemporalN=Show previously denied applets records APPEXTSEChelpHomeDialogue=Dialogue APPEXTSEChelp= \

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

    \

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

    \

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

    \

    Security Level

    \

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

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

    \ \ \

    Table with recorded actions

    \

    \

    Custom x Global table

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

    "Syntax"

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

    Controls of tables

    \

    \

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

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

    \

    \

    Dialogue

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

    Controls

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

    \

    \

    Regular expressions

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

    \

    Conclusion

    \

    \ Stay tuned to our homepage at {0}!
    \ If you encounter any bug, feel free to file it in our bugzilla ... According to policy
    \
    \ Safe browsing from your IcedTea-Web team... \

    \ \ icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/package-info.java0000644000000000000000000000013212654402377023666 xustar0030 mtime=1454507263.283431967 30 atime=1454507327.136580377 30 ctime=1454507658.740157877 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/package-info.java0000644000175000002070000000460412654402377024415 0ustar00jvanekmock00000000000000/* package-info.java Copyright (C) 2014 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.*/ /** * This package contains the classes that represent the parts of a Java Network * Launching Protocol (JNLP) file as objects, and a way to launch a JNLP file * as an application, applet, or installer. * *

    Package Specification

    * *

    Related Documentation

    * For overviews, tutorials, examples, guides, and tool documentation, please see: * @see JSR56: Java Network Launching Protocol and API * @see Netx JNLP Client * @see Java Web Start JNLP Client */ package net.sourceforge.jnlp; icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/event0000644000000000000000000000013212654402377021543 xustar0030 mtime=1454507263.283431967 30 atime=1454507658.779157357 30 ctime=1454507658.740157877 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/event/0000755000175000002070000000000012654402377022343 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/netx/net/sourceforge/jnlp/event/PaxHeaders.17941/DownloadListener.java0000644000000000000000000000013212654402377025740 xustar0030 mtime=1454507263.283431967 30 atime=1454507327.136580377 30 ctime=1454507658.740157877 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/event/DownloadListener.java0000644000175000002070000000360312654402377026465 0ustar00jvanekmock00000000000000// Copyright (C) 2002 Jon A. Maxwell (JAM) // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp.event; import java.util.*; /** * The listener that is notified of the state of resources being * downloaded by a ResourceTracker. Events may be delivered on a * background thread, and the event methods should complete * quickly so that they do not slow down other downloading in * progress by tying up a thread. * * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.3 $ */ public interface DownloadListener extends EventListener { /** * Called when a resource is checked for being up-to-date. * @param downloadEvent information about started update */ public void updateStarted(DownloadEvent downloadEvent); /** * Called when a download starts. * @param downloadEvent information about started download */ public void downloadStarted(DownloadEvent downloadEvent); /** * Called when a download completed or there was an error. * @param downloadEvent information about finished download */ public void downloadCompleted(DownloadEvent downloadEvent); } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/event/PaxHeaders.17941/DownloadEvent.java0000644000000000000000000000013112654402377025233 xustar0030 mtime=1454507263.283431967 29 atime=1454507327.13558039 30 ctime=1454507658.740157877 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/event/DownloadEvent.java0000644000175000002070000000363712654402377025770 0ustar00jvanekmock00000000000000// Copyright (C) 2002 Jon A. Maxwell (JAM) // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp.event; import java.net.*; import java.util.*; import net.sourceforge.jnlp.cache.*; /** * This event is sent during the launch of an * application. * * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.3 $ */ public class DownloadEvent extends EventObject { /** the tracker */ final transient private ResourceTracker tracker; /** the resource */ final transient private Resource resource; /** * Creates a launch event for the specified application * instance. * * @param source the resource tracker * @param resource the resource */ public DownloadEvent(ResourceTracker source, Resource resource) { super(source); this.tracker = source; this.resource = resource; } /** * @return the tracker that owns the resource. */ public ResourceTracker getTracker() { return tracker; } /** * @return the location of the resource being downloaded. */ public URL getResourceLocation() { return resource.getLocation(); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/event/PaxHeaders.17941/ApplicationListener.java0000644000000000000000000000013112654402377026433 xustar0030 mtime=1454507263.283431967 29 atime=1454507327.13558039 30 ctime=1454507658.740157877 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/event/ApplicationListener.java0000644000175000002070000000246112654402377027162 0ustar00jvanekmock00000000000000// Copyright (C) 2002 Jon A. Maxwell (JAM) // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp.event; import java.util.*; /** * The listener that is notified when an application instance is * terminated. * * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.5 $ */ public interface ApplicationListener extends EventListener { /** * Invoked when the application is destroyed. * @param applicationEvent information about destruction */ public void applicationDestroyed(ApplicationEvent applicationEvent); } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/event/PaxHeaders.17941/ApplicationEvent.java0000644000000000000000000000013112654402377025727 xustar0030 mtime=1454507263.282431981 29 atime=1454507327.13558039 30 ctime=1454507658.740157877 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/event/ApplicationEvent.java0000644000175000002070000000315712654402377026461 0ustar00jvanekmock00000000000000// Copyright (C) 2002 Jon A. Maxwell (JAM) // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp.event; import java.util.*; import net.sourceforge.jnlp.runtime.*; /** * This event is sent when an application is terminated. * * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.5 $ */ public class ApplicationEvent extends EventObject { /** the application instance */ final transient private ApplicationInstance application; /** * Creates a launch event for the specified application * instance. * * @param source the application instance */ public ApplicationEvent(ApplicationInstance source) { super(source); this.application = source; } /** * @return the application instance. */ public ApplicationInstance getApplication() { return application; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/controlpanel0000644000000000000000000000013212654402377023122 xustar0030 mtime=1454507263.281431994 30 atime=1454507658.779157357 30 ctime=1454507658.740157877 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/controlpanel/0000755000175000002070000000000012654402377023722 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/netx/net/sourceforge/jnlp/controlpanel/PaxHeaders.17941/desktopintegrationeditor0000644000000000000000000000013212654402377030246 xustar0030 mtime=1454507263.282431981 30 atime=1454507658.779157357 30 ctime=1454507658.740157877 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/controlpanel/desktopintegrationeditor/0000755000175000002070000000000012654402377031046 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/netx/net/sourceforge/jnlp/controlpanel/desktopintegrationeditor/PaxHeaders.17941/P0000644000000000000000000000032312654402377030447 xustar00122 path=icedtea-web-1.6.2/netx/net/sourceforge/jnlp/controlpanel/desktopintegrationeditor/PreviewSelectionJTextPane.java 30 mtime=1454507263.282431981 29 atime=1454507327.13558039 30 ctime=1454507658.740157877 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/controlpanel/desktopintegrationeditor/PreviewSelectionJT0000644000175000002070000001316312654402377034522 0ustar00jvanekmock00000000000000/* Copyright (C) 2015 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.controlpanel.desktopintegrationeditor; import java.io.File; import java.util.List; import javax.swing.JList; import javax.swing.JTextPane; import javax.swing.text.html.HTMLEditorKit; import net.sourceforge.jnlp.util.logging.OutputController; import static net.sourceforge.jnlp.runtime.Translator.R; public class PreviewSelectionJTextPane extends JTextPane { private final JList iconsList; private final JList menuList; private final JList desktopList; private final JList generatedList; public PreviewSelectionJTextPane(JList iconsList, JList menuList, JList desktopList, JList generatedList) { this.iconsList = iconsList; this.menuList = menuList; this.desktopList = desktopList; this.generatedList = generatedList; this.setEditorKit(new HTMLEditorKit()); this.setEditable(false); } private StringBuilder getMenus() { return getTextFiles(menuList.getSelectedValuesList()); } private StringBuilder getDesktops() { return getTextFiles(desktopList.getSelectedValuesList()); } private StringBuilder getGenerated() { return getTextFiles(generatedList.getSelectedValuesList()); } private StringBuilder getHeader(boolean i, boolean d, boolean m, boolean g) { StringBuilder sb = new StringBuilder(); if (i || d || m || g) { sb.append("
  • "); } if (i) { sb.append(""); } if (d) { sb.append(""); } if (m) { sb.append(""); } if (g) { sb.append(""); } if (i || d || m || g) { sb.append(""); } return sb; } public void generatePreview() { try { StringBuilder sb = new StringBuilder("
    Total tests run Passed Failed Errors
    " + (passed+failed+errored) + " " + passed + " " + failed + " " + errored + "
    ").append(R("DIMicons")).append(":").append(R("DIMdesktopItems")).append(":").append(R("DIMmenuItems")).append(":").append(R("DIMgeneratedJnlps")).append(":
    "); sb.append(getHeader(iconsList.getSelectedIndices().length > 0, menuList.getSelectedIndices().length > 0, desktopList.getSelectedIndices().length > 0, generatedList.getSelectedIndices().length > 0)).append(""); if (iconsList.getSelectedIndices().length > 0) { sb.append(""); } if (menuList.getSelectedIndices().length > 0) { sb.append(""); } if (desktopList.getSelectedIndices().length > 0) { sb.append(""); } if (generatedList.getSelectedIndices().length > 0) { sb.append(""); } sb.append("
    ").append(getIcons()).append("").append(getMenus()).append("").append(getDesktops()).append("").append(getGenerated()).append("
    "); this.setText(sb.toString()); } catch (Exception ex) { OutputController.getLogger().log(ex); } } private StringBuilder getIcons() { StringBuilder s = new StringBuilder(); try { List l = iconsList.getSelectedValuesList(); for (Object l1 : l) { File f = (File) l1; s.append("").append(f.getAbsolutePath()).append("
    "); s.append("
    "); } } catch (Exception ex) { OutputController.getLogger().log(ex); } return s; } private StringBuilder getTextFiles(List selectedValuesList) { StringBuilder s = new StringBuilder(); for (Object i : selectedValuesList) { File f = (File) i; s.append("").append(f.getAbsolutePath()).append("
    "); s.append("
    ").append(FreeDesktopIntegrationEditorFrame.fileToString(f, true)).append("

    "); } return s; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/controlpanel/desktopintegrationeditor/PaxHeaders.17941/P0000644000000000000000000000013112654402377030444 xustar0030 mtime=1454507263.282431981 29 atime=1454507327.13558039 30 ctime=1454507658.740157877 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/controlpanel/desktopintegrationeditor/Panels.java0000644000175000002070000001654712654402377033150 0ustar00jvanekmock00000000000000/* Copyright (C) 2015 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.controlpanel.desktopintegrationeditor; import java.awt.BorderLayout; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JLabel; import javax.swing.JList; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JSplitPane; import net.sourceforge.jnlp.security.dialogs.SecurityDialogPanel; import static net.sourceforge.jnlp.runtime.Translator.R; public class Panels { public static JPanel createGeneratedPanel(JList list, ActionListener findOrphans) { return createIconsOrGeneratedPanel(list, findOrphans, R("DIMgeneratedJnlps"), bold(R("DIMgeneratedJnlpsTooltip"))); } public static JPanel createIconsPanel(JList list, ActionListener findOrphans) { return createIconsOrGeneratedPanel(list, findOrphans, R("DIMicons"), bold(R("DIMiconsTooltip"))); } private static JPanel createIconsOrGeneratedPanel(JList list, ActionListener findOrphans, String title, String tooltip) { JPanel iconsPanel = new JPanel(new BorderLayout()); JLabel l = new JLabel(title); l.setToolTipText(createToolTip(tooltip, list)); iconsPanel.add(l, BorderLayout.PAGE_START); JScrollPane scrollIcons = new JScrollPane(); scrollIcons.setViewportView(list); iconsPanel.add(scrollIcons, BorderLayout.CENTER); JPanel iconsToolPanel = new JPanel(new BorderLayout()); JButton findOrphansButton = new JButton(R("DIMorphans")); findOrphansButton.addActionListener(findOrphans); findOrphansButton.setToolTipText(R("DIMorphansTooltip")); iconsToolPanel.add(findOrphansButton, BorderLayout.CENTER); iconsPanel.add(iconsToolPanel, BorderLayout.PAGE_END); return iconsPanel; } public static JPanel createMenuPanel(JList list, ActionListener findIcons, ActionListener findGenerated) { return createDesktopOrMenuPanel(list, findIcons, findGenerated, R("DIMmenuItems"), bold(R("DIMmenuItemsTooltip"))); } public static JPanel createDesktopPanel(JList list, ActionListener findIcons, ActionListener findGenerated) { StringBuilder sb = new StringBuilder(); sb.append(R("DIMdesktopItemsTooltipL1")).append("
    ") .append(R("DIMdesktopItemsTooltipL2")).append(":" + "
      " + "
    • ") .append(R("DIMdesktopItemsTooltipL3")).append("
    • " + "
    • ") .append(R("DIMdesktopItemsTooltipL4")).append("
    • " + "
    • ") .append(R("DIMdesktopItemsTooltipL5")).append("
    • " + "
    ") .append(bold(R("DIMdesktopItemsTooltipL6"))); return createDesktopOrMenuPanel(list, findIcons, findGenerated, R("DIMdesktopItems"), sb.toString()); } private static JPanel createDesktopOrMenuPanel(JList list, ActionListener findIcons, ActionListener findGenerated, String title, String tooltip) { JPanel desktopPanel = new JPanel(new BorderLayout()); JLabel l = new JLabel(title); l.setToolTipText(createToolTip(tooltip, list)); desktopPanel.add(l, BorderLayout.PAGE_START); JScrollPane scrollDesktop = new JScrollPane(); scrollDesktop.setViewportView(list); desktopPanel.add(scrollDesktop, BorderLayout.CENTER); JPanel desktopToolPanel = createDesktopOrMenuToolBox(findIcons, findGenerated); desktopPanel.add(desktopToolPanel, BorderLayout.PAGE_END); return desktopPanel; } private static String createToolTip(String tooltip, JList list) { if (tooltip != null) { JListUtils.FileListBasedJListModel model = (JListUtils.FileListBasedJListModel) (list.getModel()); StringBuilder sb = new StringBuilder(); sb.append("
    • ") .append(model.getFile()).append("

    • " + "
    • ") .append(model.toString()).append("

    • " + "
    • ") .append(tooltip).append("
    "); String tt = SecurityDialogPanel.htmlWrap(sb.toString()); return tt; } return null; } private static JPanel createDesktopOrMenuToolBox(ActionListener findIcons, ActionListener findGenerated) { JPanel desktopToolPanel = new JPanel(new BorderLayout()); JButton desktopFindGeneratedButton = new JButton(R("DIMgeneratedButton")); desktopFindGeneratedButton.setToolTipText(R("DIMgeneratedButtonTooltip")); desktopFindGeneratedButton.addActionListener(findGenerated); JButton desktopFindIconsButton = new JButton(R("DIMiconsButton")); desktopFindIconsButton.setToolTipText(R("DIMiconsButtonTooltip")); desktopFindIconsButton.addActionListener(findIcons); desktopToolPanel.add(desktopFindGeneratedButton, BorderLayout.LINE_END); desktopToolPanel.add(desktopFindIconsButton, BorderLayout.LINE_START); return desktopToolPanel; } static JSplitPane createQuadroSplit(int width, JPanel menusPanel, JPanel desktopsPanel, JPanel iconsPanel, JPanel generatedsPanel) { JSplitPane splitAllAndGenerated = new JSplitPane(); JSplitPane splitIconsAndLists = new JSplitPane(); JSplitPane splitLists = new JSplitPane(); splitLists.setLeftComponent(menusPanel); splitLists.setRightComponent(desktopsPanel); splitIconsAndLists.setRightComponent(splitLists); splitIconsAndLists.setLeftComponent(iconsPanel); splitAllAndGenerated.setLeftComponent(splitIconsAndLists); splitAllAndGenerated.setRightComponent(generatedsPanel); splitAllAndGenerated.setDividerLocation(width / 5 * 4); splitIconsAndLists.setDividerLocation(width / 4); splitLists.setDividerLocation(width / 4); return splitAllAndGenerated; } private static String bold(String s) { return "" + s + ""; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/controlpanel/desktopintegrationeditor/PaxHeaders.17941/J0000644000000000000000000000013112654402377030436 xustar0030 mtime=1454507263.282431981 29 atime=1454507327.13558039 30 ctime=1454507658.740157877 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/controlpanel/desktopintegrationeditor/JListUtils.java0000644000175000002070000003011012654402377033752 0ustar00jvanekmock00000000000000/* Copyright (C) 2015 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.controlpanel.desktopintegrationeditor; import java.awt.Color; import java.awt.Component; import java.awt.Image; import java.awt.image.BufferedImage; import java.io.File; import java.io.FileInputStream; import java.io.FilenameFilter; import java.util.HashMap; import java.util.Map; import java.util.regex.Pattern; import javax.imageio.ImageIO; import javax.imageio.stream.ImageInputStream; import javax.swing.DefaultListCellRenderer; import javax.swing.Icon; import javax.swing.ImageIcon; import javax.swing.JLabel; import javax.swing.JList; import javax.swing.ListModel; import javax.swing.event.ListDataListener; import net.sourceforge.jnlp.config.InfrastructureFileDescriptor; import net.sourceforge.jnlp.tools.ico.impl.ImageInputStreamIco; import net.sourceforge.jnlp.util.XDesktopEntry; public class JListUtils { private static Map iconCache = new HashMap<>(); private static Map textFilesCache = new HashMap<>(); private static Map stamps = new HashMap<>(); public static class InfrastructureFileDescriptorListingBasedJListModel extends FileListBasedJListModel { private final InfrastructureFileDescriptor source; public InfrastructureFileDescriptorListingBasedJListModel(InfrastructureFileDescriptor source, String mask) { super(source.getFile(), mask); this.source = source; } public InfrastructureFileDescriptorListingBasedJListModel(InfrastructureFileDescriptor source) { super(source.getFile()); this.source = source; } public InfrastructureFileDescriptor getSource() { return source; } @Override protected File getFile() { return source.getFile(); } @Override public String toString() { return source.toString(); } } public static class FileListBasedJListModel implements ListModel { private final File directory; private File[] list; private final Pattern mask; /** * Construct list containing all files from given directory * * @param dir */ public FileListBasedJListModel(File dir) { //calling constructor with regex matching every file this(dir, ".*"); } /** * Construct list containing files from given directory matching regex of given mask, * * @param dir directory to list * @param mask regex to match files to display */ public FileListBasedJListModel(File dir, final String mask) { directory = dir; this.mask = Pattern.compile(mask); } protected File getFile() { return directory; } @Override public String toString() { return getFile().getAbsolutePath(); } private File[] populateList() { list = getFile().listFiles(new FilenameFilter() { @Override public boolean accept(File dir, String name) { return mask.matcher(name).matches(); } }); return list; } @Override public int getSize() { if (list == null) { populateList(); } return list.length; } @Override public Object getElementAt(int index) { if (list == null) { populateList(); } return list[index]; } @Override public void addListDataListener(ListDataListener l) { } @Override public void removeListDataListener(ListDataListener l) { } } public static class CustomRendererJList extends JList { public CustomRendererJList() { this.setCellRenderer(new FileCellRenderer()); } } public static class CustomValidatingRendererJList extends JList { public CustomValidatingRendererJList() { this.setCellRenderer(new ValidatingFileCellRenderer()); } } public static class CustomRendererWithIconJList extends JList { public CustomRendererWithIconJList() { setCellRenderer(new IconisedCellRenderer()); } } private static class FileCellRenderer extends DefaultListCellRenderer { @Override public Component getListCellRendererComponent( JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { File f = (File) value; JLabel label = (JLabel) super.getListCellRendererComponent( list, value, index, isSelected, cellHasFocus); label.setText(f.getName()); return label; } } private static class ValidatingFileCellRenderer extends FileCellRenderer { @Override public Component getListCellRendererComponent( JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { JLabel l = (JLabel) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); File f = (File) value; String s = processTextFilesCache(f); if (!isSelected) { if (isJavaws(s)) { l.setBackground(new Color(0, 200, 0)); } else if (isBrowser(s)) { l.setBackground(new Color(100, 150, 0)); } else { l.setBackground(new Color(255, 200, 200)); } } else { if (isJavaws(s)) { l.setForeground(new Color(0, 200, 0)); } else if (isBrowser(s)) { l.setForeground(new Color(100, 150, 0)); } else { l.setForeground(new Color(255, 200, 200)); } } return l; } private boolean isJavaws(String s) { return haveString(s, "javaws"); } private boolean isBrowser(String s) { String[] browsers = XDesktopEntry.BROWSERS; for (String browser : browsers) { if (haveString(s, browser)) { return true; } } return false; } private boolean haveString(String s, String i) { return s.matches("(?sm).*^.*Exec.*=.*" + i + ".*$.*"); } } private static class IconisedCellRenderer extends DefaultListCellRenderer { @Override public Component getListCellRendererComponent( JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { File f = (File) value; JLabel label = (JLabel) super.getListCellRendererComponent( list, value, index, isSelected, cellHasFocus); label.setIcon(processIconCache(f)); label.setText(f.getName()); label.setHorizontalTextPosition(JLabel.RIGHT); return label; } } /** * This method looks to cache whether file F was already read as image. * If not, file is loaded, put to cache and returned * If so, it also check whether it was modified. If so, it is reloaded, replaced in cache and returned. * * @param f * @return */ private static Icon processIconCache(File f) { Icon i = iconCache.get(f); if (i == null) { i = updateIconCache(f, i); } else { if (f.lastModified() != stamps.get(f)) { i = updateIconCache(f, i); } } return i; } /** * This method load Icon from file. * Once file is loaded, it is stored also to cache * Also the time stamp of last modification is stored to cache to allow reloading when changed. * * @param f file to load, and to provide timestamp of last modification * @return loaded icon or null */ private static Icon updateIconCache(File f, Icon i) { i = createImageIcon(f, f.getAbsolutePath()); if (i != null) { iconCache.put(f, i); stamps.put(f, f.lastModified()); } return i; } /** * This method looks to cache whether file F was already read as text file. * If not, file is loaded, and its content is put to cache and returned as String * If so, it also check whether it was modified. If so, it is reloaded, replaced in cache and returned. * * @param f * @return */ private static String processTextFilesCache(File f) { String s = textFilesCache.get(f); if (s == null) { s = updateTextCache(f, s); } else { if (f.lastModified() != stamps.get(f)) { s = updateTextCache(f, s); } } return s; } /** * This method load Text from file. * Once file is loaded, it is stored also to cache * Also the time stamp of last modification is stored to cache to allow reloading when changed. * * @param f file to load, and to provide timestamp of last modification * @return loaded Text, error message or null */ private static String updateTextCache(File f, String s) { s = FreeDesktopIntegrationEditorFrame.fileToString(f, false); if (s != null) { textFilesCache.put(f, s); stamps.put(f, f.lastModified()); } return s; } /** * Load BufferedImage form file, scale it and converts to icon. * * @param f file to be loaded * @param description description to be provided * @return icon from file or null if something went wrong */ private static ImageIcon createImageIcon(File f, String description) { try { BufferedImage i; try(ImageInputStream is = ImageIO.createImageInputStream(new FileInputStream(f))) { ImageInputStreamIco ico = new ImageInputStreamIco(is); i = ico.getImage(0); } catch (Exception eex) { //not ico i = null; } if (i == null) { i = ImageIO.read(f); } return new ImageIcon(i.getScaledInstance(50, 50, Image.SCALE_SMOOTH)); } catch (Exception ex) { //not worthy to log it. No image is there and so be it. return null; } } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/controlpanel/desktopintegrationeditor/PaxHeaders.17941/F0000644000000000000000000000033312654402377030436 xustar00130 path=icedtea-web-1.6.2/netx/net/sourceforge/jnlp/controlpanel/desktopintegrationeditor/FreeDesktopIntegrationEditorFrame.java 30 mtime=1454507263.281431994 29 atime=1454507327.13558039 30 ctime=1454507658.740157877 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/controlpanel/desktopintegrationeditor/FreeDesktopIntegra0000644000175000002070000004403612654402377034525 0ustar00jvanekmock00000000000000/* Copyright (C) 2015 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.controlpanel.desktopintegrationeditor; import java.awt.BorderLayout; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.util.ArrayList; import java.util.List; import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JList; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JSplitPane; import javax.swing.JTextPane; import javax.swing.ListModel; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import net.sourceforge.jnlp.config.PathsAndFiles; import net.sourceforge.jnlp.security.dialogs.SecurityDialogPanel; import net.sourceforge.jnlp.util.XDesktopEntry; import net.sourceforge.jnlp.util.logging.ConsoleOutputPaneModel; import static net.sourceforge.jnlp.runtime.Translator.R; public class FreeDesktopIntegrationEditorFrame extends JFrame { //gui private final javax.swing.JLabel title = new JLabel(); private final javax.swing.JCheckBox selectRelativeRecordsFromOtherColumns = new JCheckBox(); private final javax.swing.JButton removeSelectedButton = new JButton(); private final javax.swing.JButton cleanAll = new JButton(); private final javax.swing.JButton closeButton = new JButton(); private final javax.swing.JButton reloadsListButton = new JButton(); private final javax.swing.JButton selectAll = new JButton(); //important ones private final javax.swing.JList menuList = new JListUtils.CustomRendererJList(); private final javax.swing.JList desktopList = new JListUtils.CustomValidatingRendererJList(); private final javax.swing.JList generatedList = new JListUtils.CustomRendererJList(); private final javax.swing.JList iconsList = new JListUtils.CustomRendererWithIconJList(); PreviewSelectionJTextPane previewPane = new PreviewSelectionJTextPane(iconsList, menuList, desktopList, generatedList); //gui end private final Blinker blinker; private void setListeners() { removeSelectedButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { FreeDesktopIntegrationEditorFrame.this.removeSelected(); } }); closeButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { dispose(); } }); reloadsListButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { populateLists(); } }); selectAll.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { selectAll(); } }); cleanAll.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { cleanAll(); } }); } private void setTexts() { this.setTitle(R("DIMtitle")); closeButton.setText(R("ButClose")); removeSelectedButton.setText(R("DIMremoveSelected")); selectRelativeRecordsFromOtherColumns.setText(R("DIMselectRelativeRecordsFromOtherColumns")); reloadsListButton.setText(R("DIMreloadLists")); selectAll.setText(R("DIMselectAll")); cleanAll.setText(R("DIMclearSelection")); title.setText(SecurityDialogPanel.htmlWrap("

    " + R("DIMdescription") + "

    ")); } private JPanel createMainControls() { JPanel mainControls = new JPanel(new GridLayout(1, 2)); mainControls.add(closeButton); mainControls.add(removeSelectedButton); return mainControls; } private JPanel createMiddleToolBox() { JPanel middleToolBox = new JPanel(new GridLayout(1, 2)); middleToolBox.add(selectRelativeRecordsFromOtherColumns); middleToolBox.add(reloadsListButton); middleToolBox.add(selectAll); middleToolBox.add(cleanAll); return middleToolBox; } private JPanel createPreviewPanel(JTextPane previewPane) { JPanel previewPanel = new JPanel(new BorderLayout()); JScrollPane jScrollPane2 = new JScrollPane(); jScrollPane2.setViewportView(previewPane); previewPanel.add(jScrollPane2, BorderLayout.CENTER); createMiddleToolBox(); previewPanel.add(createMiddleToolBox(), BorderLayout.PAGE_START); return previewPanel; } private JSplitPane createListsLayout() { JPanel menusPanel = Panels.createMenuPanel(menuList, new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { selectSomeRelatives(menuList.getSelectedValuesList(), iconsList); } }, new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { selectSomeRelatives(menuList.getSelectedValuesList(), generatedList); } } ); JPanel desktopsPanel = Panels.createDesktopPanel(desktopList, new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { selectSomeRelatives(desktopList.getSelectedValuesList(), iconsList); } }, new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { selectSomeRelatives(desktopList.getSelectedValuesList(), generatedList); } } ); JPanel iconsPanel = Panels.createIconsPanel(iconsList, new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { findOrphans(iconsList, allItemsAsFiles(menuList), allItemsAsFiles(desktopList)); } }); JPanel generatedsPanel = Panels.createGeneratedPanel(generatedList, new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { findOrphans(generatedList, allItemsAsFiles(menuList), allItemsAsFiles(desktopList)); } }); return Panels.createQuadroSplit(expectedWidth, menusPanel, desktopsPanel, iconsPanel, generatedsPanel); } private void setLayout() { createMainControls(); getContentPane().add(createMainControls(), BorderLayout.PAGE_END); JSplitPane splitListsAndPreview = new JSplitPane(JSplitPane.VERTICAL_SPLIT); splitListsAndPreview.setLeftComponent(createListsLayout()); splitListsAndPreview.setRightComponent(createPreviewPanel(previewPane)); getContentPane().add(splitListsAndPreview, BorderLayout.CENTER); getContentPane().add(title, BorderLayout.PAGE_START); splitListsAndPreview.setDividerLocation(expectedHeight / 2); } public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { @Override public void run() { new FreeDesktopIntegrationEditorFrame().setVisible(true); } }); } private boolean selecting = false; private final int expectedWidth = 800; private final int expectedHeight = 600; public FreeDesktopIntegrationEditorFrame() { setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); this.setSize(expectedWidth, expectedHeight); populateLists(); setTexts(); setListeners(); setLayout(); selectRelativeRecordsFromOtherColumns.setSelected(true); ListSelectionListener generatePreviewListener = new GeneratePreviewListener(); iconsList.addListSelectionListener(generatePreviewListener); desktopList.addListSelectionListener(generatePreviewListener); menuList.addListSelectionListener(generatePreviewListener); generatedList.addListSelectionListener(generatePreviewListener); blinker = new Blinker(selectRelativeRecordsFromOtherColumns); } private void populateLists() { menuList.setModel(new JListUtils.InfrastructureFileDescriptorListingBasedJListModel(PathsAndFiles.MENUS_DIR)); desktopList.setModel(new JListUtils.FileListBasedJListModel(new File(XDesktopEntry.findFreedesktopOrgDesktopPathCatch()), "(?i)^.*\\.desktop$") { @Override public String toString() { return R("DIMguessedDesktop"); } }); iconsList.setModel(new JListUtils.InfrastructureFileDescriptorListingBasedJListModel(PathsAndFiles.ICONS_DIR)); generatedList.setModel(new JListUtils.InfrastructureFileDescriptorListingBasedJListModel(PathsAndFiles.GEN_JNLPS_DIR)); } private void cleanAll() { selecting = true; try { clearAll(); } finally { selecting = false; } } private void clearAll() { desktopList.clearSelection(); menuList.clearSelection(); generatedList.clearSelection(); iconsList.clearSelection(); previewPane.setText(R("DIMselectionPreview")); } private void removeSelected() { int a = getTotal( objectListToFileList(iconsList.getSelectedValuesList()), objectListToFileList(menuList.getSelectedValuesList()), objectListToFileList(desktopList.getSelectedValuesList()), objectListToFileList(generatedList.getSelectedValuesList()) ); if (a <= 0) { return; } int x = JOptionPane.showConfirmDialog(this, R("DIMaskBeforeDelete", a)); if (x == JOptionPane.OK_OPTION || x == JOptionPane.YES_OPTION) { removeSelected( objectListToFileList(iconsList.getSelectedValuesList()), objectListToFileList(menuList.getSelectedValuesList()), objectListToFileList(desktopList.getSelectedValuesList()), objectListToFileList(generatedList.getSelectedValuesList()) ); populateLists(); } } private void selectAll() { selecting = true; try { selectAll(menuList); selectAll(desktopList); selectAll(iconsList); selectAll(generatedList); } finally { selecting = false; } previewPane.generatePreview(); } public List allItemsAsFiles(JList l) { return allItemsAsFiles(l.getModel()); } public List allItemsAsFiles(ListModel l) { List r = new ArrayList<>(l.getSize()); for (int i = 0; i < l.getSize(); i++) { r.add((File) l.getElementAt(i)); } return r; } private List objectListToFileList(List l) { List r = new ArrayList(l.size()); for (Object l1 : l) { r.add((File) l1); } return r; } private void removeSelected(List... a) { for (List list : a) { for (File file : list) { file.delete(); } } } private int getTotal(List... a) { int i = 0; for (List list : a) { i+=list.size(); } return i; } private void findOrphans(JList possibleOrphans, List... whereItCanBe) { selecting = true; if (selectRelativeRecordsFromOtherColumns.isSelected()) { clearAll(); blinker.blink(); } try { possibleOrphans.clearSelection(); List l = allItemsAsFiles(possibleOrphans); for (int i = 0; i < l.size(); i++) { File file = l.get(i); boolean found = false; for (List lf : whereItCanBe) { if (found) { break; } for (File f : lf) { String s = fileToString(f, false); if (s.contains(file.getAbsolutePath())) { found = true; break; } } } if (!found) { possibleOrphans.addSelectionInterval(i, i); } } } finally { selecting = false; } previewPane.generatePreview(); } private void selectSomeRelatives(List selected, JList target) { selecting = true; try { selectFileFromShortcuts(selected, target); } finally { selecting = false; } previewPane.generatePreview(); } private void selectAll(JList list) { int start = 0; int end = list.getModel().getSize() - 1; if (end >= 0) { list.setSelectionInterval(start, end); } } private class GeneratePreviewListener implements ListSelectionListener { public GeneratePreviewListener() { } @Override public void valueChanged(ListSelectionEvent e) { if (selecting) { return; } try { selecting = true; if (selectRelativeRecordsFromOtherColumns.isSelected()) { blinker.blink(); selectRelatives(e.getSource()); } } finally { selecting = false; } previewPane.generatePreview(); } } private void selectRelatives(Object source) { if (source instanceof JList) { int[] indexes = ((JList) (source)).getSelectedIndices(); clearAll(); ((JList) (source)).setSelectedIndices(indexes); } for (int x = 1; x <= 3; x++) { //we dont wont recurse, so sending copies in selectShortcutsByFiles( objectListToFileList(iconsList.getSelectedValuesList()), objectListToFileList(generatedList.getSelectedValuesList()) ); selectFilesByShortcuts( objectListToFileList(menuList.getSelectedValuesList()), objectListToFileList(desktopList.getSelectedValuesList()) ); } } static String fileToString(File f, boolean escape) { try (BufferedReader bufferedReader = new BufferedReader(new FileReader(f))) { StringBuilder sb = new StringBuilder(); while (true) { String line = bufferedReader.readLine(); if (line == null) { return sb.toString(); } if (escape) { line = ConsoleOutputPaneModel.escapeHtmlForJTextPane(line); } sb.append(line).append("\n"); } } catch (Exception ex) { return ex.toString(); } } private void selectShortcutsByFiles(List icons, List jnlps) { selectShortcutsWithFiles(icons, desktopList); selectShortcutsWithFiles(icons, menuList); selectShortcutsWithFiles(jnlps, desktopList); selectShortcutsWithFiles(jnlps, menuList); } private void selectFilesByShortcuts(List menu, List desktop) { selectFileFromShortcuts(desktop, iconsList); selectFileFromShortcuts(desktop, generatedList); selectFileFromShortcuts(menu, iconsList); selectFileFromShortcuts(menu, generatedList); } private void selectShortcutsWithFiles(List icons, JList list) { for (int i = 0; i < list.getModel().getSize(); i++) { File item = (File) list.getModel().getElementAt(i); String s = fileToString(item, false); for (File icon : icons) { if (s.contains(icon.getAbsolutePath())) { list.addSelectionInterval(i, i); } } } } private void selectFileFromShortcuts(List shortcuts, JList files) { for (File shortcut : shortcuts) { String s = fileToString(shortcut, false); for (int i = 0; i < files.getModel().getSize(); i++) { File item = (File) files.getModel().getElementAt(i); if (s.contains(item.getAbsolutePath())) { files.addSelectionInterval(i, i); } } } } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/controlpanel/desktopintegrationeditor/PaxHeaders.17941/B0000644000000000000000000000013212654402377030427 xustar0030 mtime=1454507263.281431994 30 atime=1454507327.134580403 30 ctime=1454507658.740157877 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/controlpanel/desktopintegrationeditor/Blinker.java0000644000175000002070000000672712654402377033313 0ustar00jvanekmock00000000000000/* Copyright (C) 2015 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.controlpanel.desktopintegrationeditor; import java.awt.Color; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JComponent; import javax.swing.SwingUtilities; import javax.swing.Timer; public class Blinker { private boolean blinking; private final JComponent compToBlink; public Blinker(JComponent compToBlink) { this.compToBlink = compToBlink; } public void blink() { if (blinking) { return; } blinking = true; Timer t = new Timer(100, new BlinkBody()); t.setInitialDelay(0); t.start(); } class BlinkBody implements ActionListener { int counter = 0; Color base; Color invert; @Override public void actionPerformed(ActionEvent e) { counter++; if (counter == 1) { base = compToBlink.getBackground(); invert = new Color(Math.min(255, base.getRed() * 2), Math.max(0, base.getGreen() / 2), 255 - base.getBlue()); } if (counter == 5) { ((Timer) e.getSource()).stop(); SwingUtilities.invokeLater(new Runnable() { @Override public void run() { compToBlink.setBackground(base); blinking = false; } }); return; } SwingUtilities.invokeLater(new Runnable() { @Override public void run() { if (compToBlink.getBackground().equals(base)) { compToBlink.setBackground(invert); } else { compToBlink.setBackground(base); } } }); } } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/controlpanel/PaxHeaders.17941/UnsignedAppletsTrustingLis0000644000000000000000000000013212654402377030437 xustar0030 mtime=1454507263.281431994 30 atime=1454507327.134580403 30 ctime=1454507658.740157877 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletsTrustingListPanel.java0000644000175000002070000013465712654402377033266 0ustar00jvanekmock00000000000000/* Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.controlpanel; import java.awt.BorderLayout; import java.awt.Component; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.io.BufferedWriter; import java.io.File; import java.io.FileOutputStream; import java.io.OutputStreamWriter; import java.text.DateFormat; import java.util.ArrayList; import java.util.Collections; import java.util.Date; import java.util.List; import java.util.regex.Pattern; import javax.swing.DefaultCellEditor; import javax.swing.DefaultComboBoxModel; import javax.swing.DefaultListCellRenderer; import javax.swing.GroupLayout; import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JComboBox; import javax.swing.JDialog; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JList; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTabbedPane; import javax.swing.JTable; import javax.swing.JTextField; import javax.swing.LayoutStyle; import javax.swing.ListCellRenderer; import javax.swing.RowFilter; import javax.swing.RowSorter.SortKey; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import javax.swing.table.DefaultTableCellRenderer; import javax.swing.table.DefaultTableModel; import javax.swing.table.TableCellEditor; import javax.swing.table.TableCellRenderer; import javax.swing.table.TableModel; import javax.swing.table.TableRowSorter; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.config.PathsAndFiles; import net.sourceforge.jnlp.runtime.Translator; import net.sourceforge.jnlp.security.appletextendedsecurity.AppletSecurityActions; import net.sourceforge.jnlp.security.appletextendedsecurity.AppletSecurityLevel; import net.sourceforge.jnlp.security.appletextendedsecurity.ExecuteAppletAction; import net.sourceforge.jnlp.security.appletextendedsecurity.ExtendedAppletSecurityHelp; import net.sourceforge.jnlp.security.appletextendedsecurity.UnsignedAppletActionEntry; import net.sourceforge.jnlp.security.appletextendedsecurity.UrlRegEx; import net.sourceforge.jnlp.security.appletextendedsecurity.impl.UnsignedAppletActionStorageExtendedImpl; import net.sourceforge.jnlp.util.ScreenFinder; import net.sourceforge.jnlp.util.logging.OutputController; public class UnsignedAppletsTrustingListPanel extends JPanel { private JButton helpButton; private JButton deleteButton; private JButton addRowButton; private JButton validateTableButton; private JButton testUrlButton; private JButton invertSelectionButton; private JButton moveRowUpButton; private JButton moveRowDownButton; private JCheckBox askBeforeActionCheckBox; private JCheckBox filterRegexesCheckBox; private JComboBox mainPolicyComboBox; private JComboBox deleteTypeComboBox; private JComboBox viewFilter; private JLabel globalBehaviourLabel; private JLabel securityLevelLabel; private JScrollPane userTableScrollPane; private JTabbedPane mainTabPanel; private JTable userTable; private JScrollPane globalTableScrollPane; private JTable globalTable; private final UnsignedAppletActionStorageExtendedImpl customBackEnd; private final UnsignedAppletActionStorageExtendedImpl globalBackEnd; private final UnsignedAppletActionTableModel customModel; private final UnsignedAppletActionTableModel globalModel; private final ByPermanencyFilter customFilter; private final ByPermanencyFilter globalFilter; private final DeploymentConfiguration conf; private JTable currentTable; private UnsignedAppletActionTableModel currentModel; private String lastDoc; private String lastCode; /* * for testing and playing */ public static void main(String args[]) { final String defaultDir = System.getProperty("user.home") + "/Desktop/"; final String defaultFileName1 = "terrorList1"; final String defaultFileName2 = "terrorList2"; final String defaultFile1 = defaultDir + defaultFileName1; final String defaultFile2 = defaultDir + defaultFileName2; java.awt.EventQueue.invokeLater(new Runnable() { @Override public void run() { try { JFrame f = new JFrame(); f.setLayout(new BorderLayout()); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); DeploymentConfiguration cc = new DeploymentConfiguration(); cc.load(); File ff1 = new File(defaultFile1); File ff2 = new File(defaultFile2); f.add(new UnsignedAppletsTrustingListPanel(ff2, ff1, cc)); f.pack(); f.setVisible(true); } catch (Exception ex) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, ex); } } }); } public UnsignedAppletsTrustingListPanel(File globalSettings, File customSettings, DeploymentConfiguration conf) { customBackEnd = new UnsignedAppletActionStorageExtendedImpl(customSettings); globalBackEnd = new UnsignedAppletActionStorageExtendedImpl(globalSettings); customModel = new UnsignedAppletActionTableModel(customBackEnd); globalModel = new UnsignedAppletActionTableModel(globalBackEnd); customFilter = new ByPermanencyFilter(customModel); globalFilter = new ByPermanencyFilter(globalModel); initComponents(); userTable.setRowSorter(customFilter); globalTable.setRowSorter(globalFilter); this.conf = conf; AppletSecurityLevel gs = AppletSecurityLevel.getDefault(); String s = conf.getProperty(DeploymentConfiguration.KEY_SECURITY_LEVEL); if (s != null) { gs = AppletSecurityLevel.fromString(s); } mainPolicyComboBox.setSelectedItem(gs); userTable.getSelectionModel().addListSelectionListener(new SingleSelectionListenerImpl(userTable)); globalTable.getSelectionModel().addListSelectionListener(new SingleSelectionListenerImpl(globalTable)); userTable.addKeyListener(new DeleteAdapter(userTable)); globalTable.addKeyListener(new DeleteAdapter(globalTable)); currentTable = userTable; currentModel = customModel; setButtons((!currentModel.back.isReadOnly())); } public static String appletItemsToCaption(List ii, String caption) { StringBuilder sb = new StringBuilder(); for (UnsignedAppletActionEntry i : ii) { sb.append(appletItemToCaption(i, caption)).append("\n"); } return sb.toString(); } public static String appletItemToCaption(UnsignedAppletActionEntry i, String caption) { return Translator.R("APPEXTSECguiPanelAppletInfoHederPart1", caption, i.getDocumentBase().getFilteredRegEx()) + "\n (" + Translator.R("APPEXTSECguiPanelAppletInfoHederPart2", i.getAppletSecurityActions().toString(), DateFormat.getInstance().format(i.getTimeStamp())) + "\n " + Translator.R("APPEXTSECguiTableModelTableColumnDocumentBase") + ": " + i.getDocumentBase().getFilteredRegEx() + "\n " + Translator.R("APPEXTSECguiTableModelTableColumnCodeBase") + ": " + i.getCodeBase().getFilteredRegEx() + "\n " + Translator.R("APPEXTSECguiTableModelTableColumnArchives") + ": " + UnsignedAppletActionEntry.createArchivesString(i.getArchives()); } public void removeSelectedFromTable(JTable table) { removeSelectedFromTable(table, askBeforeActionCheckBox.isSelected(), currentModel, this); } public static void removeSelectedFromTable(JTable table, boolean ask, UnsignedAppletActionTableModel data, Component forDialog) { int[] originalIndexes = table.getSelectedRows(); List newIndexes = new ArrayList<>(originalIndexes.length); for (int i = 0; i < originalIndexes.length; i++) { //we need to remap values first int modelRow = table.convertRowIndexToModel(originalIndexes[i]); newIndexes.add(modelRow); } //now to sort so we can incrementaly dec safely Collections.sort(newIndexes); if (ask) { String s = Translator.R("APPEXTSECguiPanelConfirmDeletionOf", newIndexes.size()) + ": \n"; UnsignedAppletActionEntry[] items = data.back.toArray(); for (int i = 0; i < newIndexes.size(); i++) { Integer integer = newIndexes.get(i); s += appletItemToCaption(items[integer], " ") + "\n"; } int a = JOptionPane.showConfirmDialog(forDialog, s); if (a != JOptionPane.OK_OPTION) { return; } } int sub = 0; for (int i = 0; i < newIndexes.size(); i++) { Integer integer = newIndexes.get(i); data.removeRow(integer.intValue() + sub); sub--; } } public void removeAllItemsFromTable(JTable table, UnsignedAppletActionTableModel model) { table.clearSelection(); if (askBeforeActionCheckBox.isSelected()) { UnsignedAppletActionEntry[] items = model.back.toArray(); String s = Translator.R("APPEXTSECguiPanelConfirmDeletionOf", items.length) + ": \n"; for (UnsignedAppletActionEntry item : items) { s += appletItemToCaption(item, " ") + "\n"; } int a = JOptionPane.showConfirmDialog(this, s); if (a != JOptionPane.OK_OPTION) { return; } } model.clear(); } ListCellRenderer comboRendererWithToolTips = new DefaultListCellRenderer() { @Override public final Component getListCellRendererComponent(final JList list, final Object value, final int index, final boolean isSelected, final boolean cellHasFocus) { if (value != null) { setToolTipText(value.toString()); } return super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); } }; private void initComponents() { userTableScrollPane = new JScrollPane(); globalTableScrollPane = new JScrollPane(); userTable = createTable(customModel); globalTable = createTable(globalModel); helpButton = new JButton(); mainPolicyComboBox = new JComboBox<>(new AppletSecurityLevel[] { AppletSecurityLevel.DENY_ALL, AppletSecurityLevel.DENY_UNSIGNED, AppletSecurityLevel.ASK_UNSIGNED, AppletSecurityLevel.ALLOW_UNSIGNED }); mainPolicyComboBox.setSelectedItem(AppletSecurityLevel.getDefault()); mainPolicyComboBox.setRenderer(comboRendererWithToolTips); securityLevelLabel = new JLabel(); globalBehaviourLabel = new JLabel(); deleteTypeComboBox = new JComboBox<>(); viewFilter = new JComboBox<>(); deleteButton = new JButton(); testUrlButton = new JButton(); addRowButton = new JButton(); validateTableButton = new JButton(); askBeforeActionCheckBox = new JCheckBox(); filterRegexesCheckBox = new JCheckBox(); invertSelectionButton = new JButton(); moveRowUpButton = new JButton(); moveRowDownButton = new JButton(); mainTabPanel = new JTabbedPane(); userTableScrollPane.setViewportView(userTable); globalTableScrollPane.setViewportView(globalTable); helpButton.setText(Translator.R("APPEXTSECguiPanelHelpButton")); helpButton.addActionListener(new java.awt.event.ActionListener() { @Override public void actionPerformed(java.awt.event.ActionEvent evt) { helpButtonActionPerformed(evt); } }); mainPolicyComboBox.addActionListener(new java.awt.event.ActionListener() { @Override public void actionPerformed(java.awt.event.ActionEvent evt) { mainPolicyComboBoxActionPerformed(evt); } }); viewFilter.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { userTable.getRowSorter().setSortKeys(null); userTable.getRowSorter().setSortKeys(null); int i = viewFilter.getSelectedIndex(); switch (i) { case 0: customFilter.setRowFilter(ByPermanencyFilter.showPermanents); globalFilter.setRowFilter(ByPermanencyFilter.showPermanents); break; case 1: customFilter.setRowFilter(ByPermanencyFilter.showTemporarilyDecisions); globalFilter.setRowFilter(ByPermanencyFilter.showTemporarilyDecisions); break; case 2: customFilter.setRowFilter(ByPermanencyFilter.showAll); globalFilter.setRowFilter(ByPermanencyFilter.showAll); break; case 3: customFilter.setRowFilter(ByPermanencyFilter.showPermanentA); globalFilter.setRowFilter(ByPermanencyFilter.showPermanentA); break; case 4: customFilter.setRowFilter(ByPermanencyFilter.showPermanentN); globalFilter.setRowFilter(ByPermanencyFilter.showPermanentN); break; case 5: customFilter.setRowFilter(ByPermanencyFilter.showHasChosenYes); globalFilter.setRowFilter(ByPermanencyFilter.showHasChosenYes); break; case 6: customFilter.setRowFilter(ByPermanencyFilter.showHasChosenNo); globalFilter.setRowFilter(ByPermanencyFilter.showHasChosenNo); break; } } }); securityLevelLabel.setText(Translator.R("APPEXTSECguiPanelSecurityLevel")); globalBehaviourLabel.setText(Translator.R("APPEXTSECguiPanelGlobalBehaviourCaption")); deleteTypeComboBox.setModel(new DefaultComboBoxModel<>(new String[] { Translator.R("APPEXTSECguiPanelDeleteMenuSelected"), Translator.R("APPEXTSECguiPanelDeleteMenuAllA"), Translator.R("APPEXTSECguiPanelDeleteMenuAllN"), Translator.R("APPEXTSECguiPanelDeleteMenuAlly"), Translator.R("APPEXTSECguiPanelDeleteMenuAlln"), Translator.R("APPEXTSECguiPanelDeleteMenuAllAll")})); deleteTypeComboBox.setRenderer(comboRendererWithToolTips); viewFilter.setModel(new DefaultComboBoxModel<>(new String[] { Translator.R("APPEXTSECguiPanelShowOnlyPermanent"), Translator.R("APPEXTSECguiPanelShowOnlyTemporal"), Translator.R("APPEXTSECguiPanelShowAll"), Translator.R("APPEXTSECguiPanelShowOnlyPermanentA"), Translator.R("APPEXTSECguiPanelShowOnlyPermanentN"), Translator.R("APPEXTSECguiPanelShowOnlyTemporalY"), Translator.R("APPEXTSECguiPanelShowOnlyTemporalN")})); viewFilter.setRenderer(comboRendererWithToolTips); deleteButton.setText(Translator.R("APPEXTSECguiPanelDeleteButton")); deleteButton.setToolTipText(Translator.R("APPEXTSECguiPanelDeleteButtonToolTip")); deleteButton.addActionListener(new java.awt.event.ActionListener() { @Override public void actionPerformed(java.awt.event.ActionEvent evt) { deleteButtonActionPerformed(evt); } }); testUrlButton.setText(Translator.R("APPEXTSECguiPanelTestUrlButton")); testUrlButton.addActionListener(new java.awt.event.ActionListener() { @Override public void actionPerformed(java.awt.event.ActionEvent evt) { testUrlButtonActionPerformed(evt); } }); addRowButton.setText(Translator.R("APPEXTSECguiPanelAddRowButton")); addRowButton.addActionListener(new java.awt.event.ActionListener() { @Override public void actionPerformed(java.awt.event.ActionEvent evt) { addRowButtonActionPerformed(evt); } }); validateTableButton.setText(Translator.R("APPEXTSECguiPanelValidateTableButton")); validateTableButton.addActionListener(new java.awt.event.ActionListener() { @Override public void actionPerformed(java.awt.event.ActionEvent evt) { validateTableButtonActionPerformed(evt); } }); askBeforeActionCheckBox.setSelected(true); askBeforeActionCheckBox.setText(Translator.R("APPEXTSECguiPanelAskeforeActionBox")); filterRegexesCheckBox.setText(Translator.R("APPEXTSECguiPanelShowRegExesBox")); filterRegexesCheckBox.addActionListener(new java.awt.event.ActionListener() { @Override public void actionPerformed(java.awt.event.ActionEvent evt) { filterRegexesCheckBoxActionPerformed(evt); } }); invertSelectionButton.setText(Translator.R("APPEXTSECguiPanelInverSelection")); invertSelectionButton.addActionListener(new java.awt.event.ActionListener() { @Override public void actionPerformed(java.awt.event.ActionEvent evt) { invertSelectionButtonActionPerformed(evt); } }); moveRowUpButton.setText(Translator.R("APPEXTSECguiPanelMoveRowUp")); moveRowUpButton.setEnabled(false); moveRowUpButton.addActionListener(new java.awt.event.ActionListener() { @Override public void actionPerformed(java.awt.event.ActionEvent evt) { moveRowUpButtonActionPerformed(evt); } }); moveRowDownButton.setText(Translator.R("APPEXTSECguiPanelMoveRowDown")); moveRowDownButton.setEnabled(false); moveRowDownButton.addActionListener(new java.awt.event.ActionListener() { @Override public void actionPerformed(java.awt.event.ActionEvent evt) { moveRowDownButtonActionPerformed(evt); } }); GroupLayout layout = new GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(GroupLayout.Alignment.TRAILING, layout.createSequentialGroup().addContainerGap() .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING) .addComponent(mainTabPanel, GroupLayout.Alignment.LEADING, 0, 583, Short.MAX_VALUE) .addComponent(globalBehaviourLabel, GroupLayout.Alignment.LEADING, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(GroupLayout.Alignment.LEADING, layout.createSequentialGroup() .addComponent(securityLevelLabel, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(mainPolicyComboBox, 0, 474, Short.MAX_VALUE)) .addGroup(GroupLayout.Alignment.LEADING, layout.createSequentialGroup() .addComponent(addRowButton, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(validateTableButton, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(testUrlButton, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 94, Short.MAX_VALUE) .addComponent(moveRowDownButton, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(moveRowUpButton, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(deleteButton, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(deleteTypeComboBox, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(invertSelectionButton, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(layout.createSequentialGroup() .addComponent(askBeforeActionCheckBox, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(filterRegexesCheckBox, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 93, Short.MAX_VALUE) .addComponent(viewFilter, 0, GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE))).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(helpButton, GroupLayout.PREFERRED_SIZE, 108, GroupLayout.PREFERRED_SIZE))).addContainerGap())); layout.setVerticalGroup( layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addContainerGap() .addComponent(globalBehaviourLabel).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addComponent(securityLevelLabel) .addComponent(mainPolicyComboBox, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING, false) .addComponent(deleteButton) .addComponent(deleteTypeComboBox) .addComponent(invertSelectionButton, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(askBeforeActionCheckBox) .addComponent(filterRegexesCheckBox) .addComponent(viewFilter))) .addComponent(helpButton, GroupLayout.PREFERRED_SIZE, 53, GroupLayout.PREFERRED_SIZE)).addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(mainTabPanel, GroupLayout.DEFAULT_SIZE, 161, Short.MAX_VALUE).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(addRowButton) .addComponent(validateTableButton) .addComponent(testUrlButton) .addComponent(moveRowUpButton) .addComponent(moveRowDownButton)).addContainerGap())); JPanel userPanel = new JPanel(new BorderLayout()); JPanel globalPanel = new JPanel(new BorderLayout()); userPanel.add(userTableScrollPane); globalPanel.add(globalTableScrollPane); mainTabPanel.add(userPanel); mainTabPanel.add(globalPanel); mainTabPanel.setTitleAt(0, Translator.R("APPEXTSECguiPanelCustomDefs")); mainTabPanel.setTitleAt(1, Translator.R("APPEXTSECguiPanelGlobalDefs")); mainTabPanel.setToolTipTextAt(0, PathsAndFiles.APPLET_TRUST_SETTINGS_USER.getFile().getAbsolutePath()); mainTabPanel.setToolTipTextAt(1, PathsAndFiles.APPLET_TRUST_SETTINGS_SYS.getFile().getAbsolutePath()); mainTabPanel.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { switch (mainTabPanel.getSelectedIndex()) { case 0: currentModel = customModel; currentTable = userTable; break; case 1: currentModel = globalModel; currentTable = globalTable; break; } setButtons((!currentModel.back.isReadOnly())); } }); } private void mainPolicyComboBoxActionPerformed(java.awt.event.ActionEvent evt) { try { conf.setProperty(DeploymentConfiguration.KEY_SECURITY_LEVEL, ((AppletSecurityLevel) mainPolicyComboBox.getSelectedItem()).toChars()); conf.save(); } catch (Exception ex) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, ex); JOptionPane.showMessageDialog(this, ex); } } private void deleteButtonActionPerformed(java.awt.event.ActionEvent evt) { if (deleteTypeComboBox.getSelectedIndex() == 0) { removeSelectedFromTable(currentTable); } if (deleteTypeComboBox.getSelectedIndex() == 1) { removeByBehaviour(ExecuteAppletAction.ALWAYS); } if (deleteTypeComboBox.getSelectedIndex() == 2) { removeByBehaviour(ExecuteAppletAction.NEVER); } if (deleteTypeComboBox.getSelectedIndex() == 3) { removeByBehaviour(ExecuteAppletAction.YES); } if (deleteTypeComboBox.getSelectedIndex() == 4) { removeByBehaviour(ExecuteAppletAction.NO); } if (deleteTypeComboBox.getSelectedIndex() == 5) { removeAllItemsFromTable(currentTable, customModel); } } private void testUrlButtonActionPerformed(java.awt.event.ActionEvent evt) { String s1 = JOptionPane.showInputDialog(Translator.R("APPEXTSECguiPanelDocTest"), lastDoc); String s2 = JOptionPane.showInputDialog(Translator.R("APPEXTSECguiPanelCodeTest"), lastCode); lastDoc = s1; lastCode = s2; try { List i = currentModel.back.getMatchingItems(s1, s2, null); if (i == null || i.isEmpty()) { JOptionPane.showMessageDialog(this, Translator.R("APPEXTSECguiPanelNoMatch")); } else { JOptionPane.showMessageDialog(this, Translator.R("APPEXTSECguiPanelMatchingNote") + "\n" + appletItemsToCaption(i, Translator.R("APPEXTSECguiPanelMatched") + ": ")); } } catch (Exception ex) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, ex); JOptionPane.showMessageDialog(this, Translator.R("APPEXTSECguiPanelMatchingError", ex)); } } private void addRowButtonActionPerformed(java.awt.event.ActionEvent evt) { currentModel.addRow(); } private void validateTableButtonActionPerformed(java.awt.event.ActionEvent evt) { File f = null; try { f = File.createTempFile("appletTable", "validation"); } catch (Exception ex) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, ex); JOptionPane.showMessageDialog(this, Translator.R("APPEXTSECguiPanelCanNOtValidate", ex.toString())); return; } try { currentModel.back.writeContentsLocked(); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(f), "UTF-8")); currentModel.back.writeContent(bw); bw.flush(); bw.close(); UnsignedAppletActionStorageExtendedImpl copy = new UnsignedAppletActionStorageExtendedImpl(f); UnsignedAppletActionEntry[] items = copy.toArray(); for (UnsignedAppletActionEntry unsignedAppletActionEntry : items) { if (unsignedAppletActionEntry.getDocumentBase() != null && !unsignedAppletActionEntry.getDocumentBase().getRegEx().trim().isEmpty()) { Pattern p = Pattern.compile(unsignedAppletActionEntry.getDocumentBase().getRegEx()); p.matcher("someInput").find(); } else { throw new RuntimeException(Translator.R("APPEXTSECguiPanelEmptyDoc")); } if (unsignedAppletActionEntry.getCodeBase() != null && !unsignedAppletActionEntry.getCodeBase().getRegEx().trim().isEmpty()) { Pattern p = Pattern.compile(unsignedAppletActionEntry.getCodeBase().getRegEx()); p.matcher("someInput").find(); } else { throw new RuntimeException(Translator.R("APPEXTSECguiPanelEmptyCode")); } UnsignedAppletActionEntry.createArchivesString(UnsignedAppletActionEntry.createArchivesList(UnsignedAppletActionEntry.createArchivesString(unsignedAppletActionEntry.getArchives()))); } JOptionPane.showMessageDialog(this, Translator.R("APPEXTSECguiPanelTableValid")); } catch (Exception ex) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, ex); JOptionPane.showMessageDialog(this, Translator.R("APPEXTSECguiPanelTableInvalid", ex.toString())); } finally { f.delete(); } } private void filterRegexesCheckBoxActionPerformed(java.awt.event.ActionEvent evt) { reloadTable(); } private void invertSelectionButtonActionPerformed(java.awt.event.ActionEvent evt) { int[] selectedIndexs = currentTable.getSelectedRows(); currentTable.selectAll(); for (int i = 0; i < currentTable.getRowCount(); i++) { for (int selectedIndex : selectedIndexs) { if (selectedIndex == i) { currentTable.removeRowSelectionInterval(i, i); break; } } } } private void moveRowUpButtonActionPerformed(java.awt.event.ActionEvent evt) { int orig = currentTable.getSelectedRow(); if (orig < 0 || orig >= currentTable.getRowCount()) { return; } int nw = 0; while (true) { int i = currentTable.convertRowIndexToModel(orig); int nwx = currentModel.moveUp(i); reloadTable(); nw = currentTable.convertRowIndexToView(nwx); if (i == nwx) { break; } if (nw != orig) { break; } } //ItwLogger.getLogger().log(OutputController.Level.ERROR_ALL, orig+" "+i+" "+nwx+" "+nw+" "); if (nw != orig) { if (orig >= 1) { currentTable.getSelectionModel().setSelectionInterval(orig - 1, orig - 1); } } else { currentTable.getSelectionModel().setSelectionInterval(orig, orig); } } private void moveRowDownButtonActionPerformed(java.awt.event.ActionEvent evt) { int orig = currentTable.getSelectedRow(); if (orig < 0 || orig >= currentTable.getRowCount()) { return; } int nw = 0; while (true) { int i = currentTable.convertRowIndexToModel(orig); int nwx = currentModel.moveDown(i); reloadTable(); nw = currentTable.convertRowIndexToView(nwx); if (i == nwx) { break; } if (nw != orig) { break; } } // OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, orig+" "+i+" "+nwx+" "+nw+" "); if (nw != orig) { if (orig < currentModel.getRowCount()) { currentTable.getSelectionModel().setSelectionInterval(orig + 1, orig + 1); } } else { currentTable.getSelectionModel().setSelectionInterval(orig, orig); } } private static void helpButtonActionPerformed(java.awt.event.ActionEvent evt) { JDialog d = new ExtendedAppletSecurityHelp(null, false); ScreenFinder.centerWindowsToCurrentScreen(d); d.setVisible(true); } private void setButtons(boolean b) { deleteButton.setEnabled(b); addRowButton.setEnabled(b); invertSelectionButton.setEnabled(b); moveRowUpButton.setEnabled(b); moveRowDownButton.setEnabled(b); } private JTable createTable(final TableModel model) { JTable jt = new JTable() { @Override public TableCellEditor getCellEditor(int row, int column) { int columnx = convertColumnIndexToModel(column); if (columnx == 0 || columnx == 1) { return new DefaultCellEditor(new JComboBox<>(new ExecuteAppletAction[] { ExecuteAppletAction.ALWAYS, ExecuteAppletAction.NEVER, ExecuteAppletAction.YES, ExecuteAppletAction.NO, ExecuteAppletAction.UNSET })); } if (columnx == 3) { column = convertColumnIndexToModel(column); row = convertRowIndexToModel(row); return new DefaultCellEditor(new MyTextField((UrlRegEx) (model.getValueAt(row, column)))); } if (columnx == 4) { column = convertColumnIndexToModel(column); row = convertRowIndexToModel(row); return new DefaultCellEditor(new MyTextField((UrlRegEx) (model.getValueAt(row, column)))); } return super.getCellEditor(row, column); } @Override public TableCellRenderer getCellRenderer(int row, int column) { int columnx = convertColumnIndexToModel(column); if (columnx == 2) { column = convertColumnIndexToModel(column); row = convertRowIndexToModel(row); return new UrlRegexCellRenderer.MyDateCellRenderer((Date) (model.getValueAt(row, column))); } if (columnx == 3) { if (!filterRegexesCheckBox.isSelected()) { column = convertColumnIndexToModel(column); row = convertRowIndexToModel(row); return new UrlRegexCellRenderer((UrlRegEx) (model.getValueAt(row, column))); } } if (columnx == 4) { if (!filterRegexesCheckBox.isSelected()) { column = convertColumnIndexToModel(column); row = convertRowIndexToModel(row); return new UrlRegexCellRenderer((UrlRegEx) (model.getValueAt(row, column))); } } return super.getCellRenderer(row, column); } }; jt.setRowHeight(jt.getRowHeight() + jt.getRowHeight() / 2); jt.setModel(model); return jt; } private void reloadTable() { List l = currentTable.getRowSorter().getSortKeys(); currentTable.setModel(new DefaultTableModel()); currentTable.setModel(currentModel); { currentTable.getRowSorter().setSortKeys(l); } } private void removeByBehaviour(ExecuteAppletAction unsignedAppletAction) { UnsignedAppletActionEntry[] items = currentModel.back.toArray(); if (askBeforeActionCheckBox.isSelected()) { List toBeDeleted = new ArrayList<>(); for (UnsignedAppletActionEntry unsignedAppletActionEntry : items) { AppletSecurityActions actions = unsignedAppletActionEntry.getAppletSecurityActions(); for (int j = 0; j < actions.getRealCount(); j++) { ExecuteAppletAction action = actions.getAction(j); if (action == unsignedAppletAction) { toBeDeleted.add(unsignedAppletActionEntry); } } } String s = Translator.R("APPEXTSECguiPanelConfirmDeletionOf", toBeDeleted.size()) + ": \n"; for (UnsignedAppletActionEntry toBeDeleted1 : toBeDeleted) { s += appletItemToCaption(toBeDeleted1, " ") + "\n"; } int a = JOptionPane.showConfirmDialog(this, s); if (a != JOptionPane.OK_OPTION) { return; } } currentModel.removeByBehaviour(unsignedAppletAction); } public static final class MyTextField extends JTextField { private final UrlRegEx keeper; private MyTextField(UrlRegEx urlRegEx) { if (urlRegEx == null) { keeper = UrlRegEx.exact(""); } else { this.keeper = urlRegEx; } setText(keeper.getFilteredRegEx()); } @Override public void setText(String t) { super.setText(keeper.getRegEx()); } } public static final class UrlRegexCellRenderer extends DefaultTableCellRenderer { private final UrlRegEx keeper; private UrlRegexCellRenderer(UrlRegEx urlRegEx) { if (urlRegEx == null) { keeper = UrlRegEx.exact(""); } else { this.keeper = urlRegEx; } setText(keeper.getFilteredRegEx()); } @Override public void setText(String t) { if (keeper == null) { super.setText(""); } else { super.setText(keeper.getFilteredRegEx()); } } public static final class MyDateCellRenderer extends DefaultTableCellRenderer { private final Date keeper; private MyDateCellRenderer(Date d) { this.keeper = d; setText(DateFormat.getInstance().format(d)); } @Override public void setText(String t) { if (keeper == null) { super.setText(""); } else { super.setText(DateFormat.getInstance().format(keeper)); } } } } private final class SingleSelectionListenerImpl implements ListSelectionListener { private final JTable table; public SingleSelectionListenerImpl(JTable table) { this.table = table; } @Override public void valueChanged(ListSelectionEvent e) { if (table.getSelectedRows().length == 1 && !currentModel.back.isReadOnly()) { moveRowUpButton.setEnabled(true); moveRowDownButton.setEnabled(true); } else { moveRowUpButton.setEnabled(false); moveRowDownButton.setEnabled(false); } } } private final class DeleteAdapter implements KeyListener { private final JTable table; public DeleteAdapter(JTable table) { this.table = table; } @Override public void keyTyped(KeyEvent e) { } @Override public void keyPressed(KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_DELETE && !currentModel.back.isReadOnly()) { removeSelectedFromTable(table, askBeforeActionCheckBox.isSelected(), (UnsignedAppletActionTableModel) table.getModel(), UnsignedAppletsTrustingListPanel.this); } } @Override public void keyReleased(KeyEvent e) { } } private abstract static class MyCommonSorter extends RowFilter { } private static final class ByPermanencyFilter extends TableRowSorter { private static final class ShowAll extends MyCommonSorter { @Override public boolean include(Entry entry) { return true; } } private static final class ShowPermanents extends MyCommonSorter { @Override public boolean include(Entry entry) { for (int i = 0; i < AppletSecurityActions.REMEMBER_COLUMNS_COUNT; i++) { ExecuteAppletAction o = (ExecuteAppletAction) entry.getModel().getValueAt(entry.getIdentifier(), i); if (o.equals(ExecuteAppletAction.ALWAYS) || o.equals(ExecuteAppletAction.NEVER)) { return true; } } return false; } } private static final class ShowPermanentA extends MyCommonSorter { @Override public boolean include(Entry entry) { for (int i = 0; i < AppletSecurityActions.REMEMBER_COLUMNS_COUNT; i++) { ExecuteAppletAction o = (ExecuteAppletAction) entry.getModel().getValueAt(entry.getIdentifier(), i); if (o.equals(ExecuteAppletAction.ALWAYS)) { return true; } } return false; } } private static final class ShowPermanentN extends MyCommonSorter { @Override public boolean include(Entry entry) { for (int i = 0; i < AppletSecurityActions.REMEMBER_COLUMNS_COUNT; i++) { ExecuteAppletAction o = (ExecuteAppletAction) entry.getModel().getValueAt(entry.getIdentifier(), i); if (o.equals(ExecuteAppletAction.NEVER)) { return true; } } return false; } } private static final class ShowTemporarilyDecisions extends MyCommonSorter { @Override public boolean include(Entry entry) { for (int i = 0; i < AppletSecurityActions.REMEMBER_COLUMNS_COUNT; i++) { ExecuteAppletAction o = (ExecuteAppletAction) entry.getModel().getValueAt(entry.getIdentifier(), i); if (o.equals(ExecuteAppletAction.YES) || o.equals(ExecuteAppletAction.NO)) { return true; } } return false; } } private static final class ShowHasChosenYes extends MyCommonSorter { @Override public boolean include(Entry entry) { for (int i = 0; i < AppletSecurityActions.REMEMBER_COLUMNS_COUNT; i++) { ExecuteAppletAction o = (ExecuteAppletAction) entry.getModel().getValueAt(entry.getIdentifier(), i); if (o.equals(ExecuteAppletAction.YES)) { return true; } } return false; } } private static final class ShowHasChosenNo extends MyCommonSorter { @Override public boolean include(Entry entry) { for (int i = 0; i < AppletSecurityActions.REMEMBER_COLUMNS_COUNT; i++) { ExecuteAppletAction o = (ExecuteAppletAction) entry.getModel().getValueAt(entry.getIdentifier(), i); if (o.equals(ExecuteAppletAction.NO)) { return true; } } return false; } } public static final ShowAll showAll = new ShowAll(); public static final ShowPermanents showPermanents = new ShowPermanents(); public static final ShowPermanentA showPermanentA = new ShowPermanentA(); public static final ShowPermanentN showPermanentN = new ShowPermanentN(); public static final ShowTemporarilyDecisions showTemporarilyDecisions = new ShowTemporarilyDecisions(); public static final ShowHasChosenYes showHasChosenYes = new ShowHasChosenYes(); public static final ShowHasChosenNo showHasChosenNo = new ShowHasChosenNo(); public ByPermanencyFilter(UnsignedAppletActionTableModel model) { super(model); setRowFilter(showPermanents); } } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/controlpanel/PaxHeaders.17941/UnsignedAppletActionTableM0000644000000000000000000000013212654402377030267 xustar0030 mtime=1454507263.280432008 30 atime=1454507327.134580403 30 ctime=1454507658.740157877 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletActionTableModel.java0000644000175000002070000001544712654402377032611 0ustar00jvanekmock00000000000000/* Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.controlpanel; import java.util.Date; import javax.swing.event.TableModelEvent; import javax.swing.table.AbstractTableModel; import net.sourceforge.jnlp.runtime.Translator; import net.sourceforge.jnlp.security.appletextendedsecurity.AppletSecurityActions; import net.sourceforge.jnlp.security.appletextendedsecurity.ExecuteAppletAction; import net.sourceforge.jnlp.security.appletextendedsecurity.UnsignedAppletActionEntry; import net.sourceforge.jnlp.security.appletextendedsecurity.UrlRegEx; import net.sourceforge.jnlp.security.appletextendedsecurity.impl.UnsignedAppletActionStorageExtendedImpl; public class UnsignedAppletActionTableModel extends AbstractTableModel { final UnsignedAppletActionStorageExtendedImpl back; private final String[] columns = new String[]{Translator.R("APPEXTSECguiTableModelTableColumnActionUA"), Translator.R("APPEXTSECguiTableModelTableColumnActionMatchALACA"), Translator.R("APPEXTSECguiTableModelTableColumnDateOfAction"), Translator.R("APPEXTSECguiTableModelTableColumnDocumentBase"), Translator.R("APPEXTSECguiTableModelTableColumnCodeBase"), Translator.R("APPEXTSECguiTableModelTableColumnArchives")}; public UnsignedAppletActionTableModel(UnsignedAppletActionStorageExtendedImpl back) { this.back = back; } @Override public int getRowCount() { return back.toArray().length; } @Override public int getColumnCount() { return columns.length; } @Override public String getColumnName(int columnIndex) { return columns[columnIndex]; } @Override public Class getColumnClass(int columnIndex) { if (columnIndex == 0) { return AppletSecurityActions.class; } if (columnIndex == 1) { return AppletSecurityActions.class; } if (columnIndex == 2) { return Date.class; } if (columnIndex == 3) { return UrlRegEx.class; } if (columnIndex == 4) { return UrlRegEx.class; } if (columnIndex == 5) { return String.class; } return Object.class; } @Override public boolean isCellEditable(int rowIndex, int columnIndex) { if (back.isReadOnly()) { return false; } if (columnIndex == 2) { return false; } if (columnIndex == 0) { return true; } if (getValueAt(rowIndex, columnIndex - 1) == null || getValueAt(rowIndex, columnIndex - 1).toString().trim().isEmpty()) { return false; } return true; } @Override public Object getValueAt(int rowIndex, int columnIndex) { UnsignedAppletActionEntry source = back.toArray()[rowIndex]; if (columnIndex == 0) { return source.getAppletSecurityActions().getUnsignedAppletAction(); } if (columnIndex == 1) { return source.getAppletSecurityActions().getMatchingAlacaAction(); } if (columnIndex == 2) { return source.getTimeStamp(); } if (columnIndex == 3) { return source.getDocumentBase(); } if (columnIndex == 4) { return source.getCodeBase(); } if (columnIndex == 5) { return UnsignedAppletActionEntry.createArchivesString(source.getArchives()); } return null; } @Override public void setValueAt(final Object aValue, final int rowIndex, final int columnIndex) { final UnsignedAppletActionEntry source = back.toArray()[rowIndex]; back.modify(source, columnIndex, aValue); } public void addRow() { int i = getRowCount()-1; String s = "http://localhost:80/"; back.add(new UnsignedAppletActionEntry( AppletSecurityActions.createDefault(), new Date(), UrlRegEx.quoteAndStar(s), UrlRegEx.quoteAndStar(s), null)); fireTableRowsInserted(i+1, i+1); } public void removeRow(int i) { int ii = getRowCount()-1; if (ii<0){ return; } if (i<0){ return; } back.remove(i); fireTableRowsDeleted(i, i); } public void clear() { int i = getRowCount()-1; if (i<0){ return; } back.clear(); fireTableRowsDeleted(0, i); } void removeByBehaviour(ExecuteAppletAction unsignedAppletAction) { int i = getRowCount()-1; if (i<0){ return; } back.removeByBehaviour(unsignedAppletAction); fireTableRowsDeleted(0, i); } int moveUp(int selectedRow) { int i = getRowCount()-1; if (i<0){ return selectedRow; } int x = back.moveUp(selectedRow); fireTableChanged(new TableModelEvent(this, 0, i)); return x; } int moveDown(int selectedRow) { int i = getRowCount()-1; if (i<0){ return selectedRow; } int x = back.moveDown(selectedRow); fireTableChanged(new TableModelEvent(this, 0, i)); return x; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/controlpanel/PaxHeaders.17941/TemporaryInternetFilesPane0000644000000000000000000000013212654402377030404 xustar0030 mtime=1454507263.280432008 30 atime=1454507327.134580403 30 ctime=1454507658.740157877 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/controlpanel/TemporaryInternetFilesPanel.java0000644000175000002070000004201112654402377032221 0ustar00jvanekmock00000000000000/* TemporaryInternetFilesPanel.java -- Display and sets cache settings. Copyright (C) 2010 Red Hat This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be 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 this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package net.sourceforge.jnlp.controlpanel; import static java.lang.Integer.parseInt; import static java.lang.Long.parseLong; import java.awt.BorderLayout; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.ComponentAdapter; import java.awt.event.ComponentEvent; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import java.io.File; import java.util.ArrayList; import java.util.List; import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JComboBox; import javax.swing.JFileChooser; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JSpinner; import javax.swing.JTextField; import javax.swing.SpinnerNumberModel; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.config.PathsAndFiles; import net.sourceforge.jnlp.runtime.Translator; /** * The actual panel that contains the fields that the user can edit accordingly. * This is provided as a pane for inside the Panel itself, can also be used to * display as a dialog. * TODO: Add functionality: * * @author Andrew Su (asu@redhat.com, andrew.su@utoronto.ca) * */ @SuppressWarnings("serial") public class TemporaryInternetFilesPanel extends NamedBorderPanel { private static final Long CACHE_UNLIMITED_SIZE = -1l; private static final Long CACHE_MIN_SIZE = 0l; private static final Long CACHE_MAX_SIZE = (long) Integer.MAX_VALUE; private static final Long SPINNER_STEP_SIZE = 10l; private final JSpinner cacheSizeSpinner; private static final long BYTES_TO_MEGABYTES = 1024l * 1024l; private final JCheckBox limitCacheSizeCheckBox; private final JLabel cacheSizeWarningLabel; private final DeploymentConfiguration config; private final JComboBox cbCompression; private final JButton bLocation; private final JButton resetLocation; private final JTextField location; private final JLabel locationDescription; private final JLabel lCompression; private final JLabel lCacheSize; private final JButton bViewFiles; private final JPanel diskSpacePanel; public TemporaryInternetFilesPanel(final DeploymentConfiguration config) { super(Translator.R("CPHeadTempInternetFiles")); this.config = config; setLayout(new BorderLayout()); cacheSizeSpinner = new JSpinner(); limitCacheSizeCheckBox = new JCheckBox(Translator.R("TIFPLimitCacheSize")); cacheSizeWarningLabel = new JLabel(); lCacheSize = new JLabel(Translator.R("TIFPCacheSize") + ":"); ComboItem[] compressionOptions = {new ComboItem(Translator.R("TIFPNone"), "0"), new ComboItem("1", "1"), new ComboItem("2", "2"), new ComboItem("3", "3"), new ComboItem("4", "4"), new ComboItem("5", "5"), new ComboItem("6", "6"), new ComboItem("7", "7"), new ComboItem("8", "8"), new ComboItem(Translator.R("TIFPMax"), "9"),}; cbCompression = new JComboBox<>(compressionOptions); lCompression = new JLabel(Translator.R("TIFPCompressionLevel") + ":"); // Sets compression level for jar files. bLocation = new JButton(Translator.R("TIFPChange") + "..."); resetLocation = new JButton(Translator.R("CPFilesLogsDestDirResert")); location = new JTextField(PathsAndFiles.CACHE_DIR.getFullPath(config)); locationDescription = new JLabel(Translator.R("TIFPLocationLabel") + ":"); bViewFiles = new JButton(Translator.R("TIFPViewFiles")); diskSpacePanel = new JPanel(); diskSpacePanel.setLayout(new GridBagLayout()); addComponents(); if (limitCacheSizeCheckBox.isSelected()) { showCacheSizeSpinnerGUIElements(true); if (parseLong(cacheSizeSpinner.getValue().toString()) == 0) { showCompressionAndLocationGUIElements(false); } else { showCompressionAndLocationGUIElements(true); } } else { showCacheSizeSpinnerGUIElements(false); showCompressionAndLocationGUIElements(true); } } /** * Add components to panel. */ private void addComponents() { GridBagConstraints c = new GridBagConstraints(); c.fill = GridBagConstraints.BOTH; JLabel description = new JLabel(Translator.R("CPTempInternetFilesDescription")); // This section deals with how to use the disk space. cbCompression.setSelectedIndex(parseInt(this.config.getProperty(DeploymentConfiguration.KEY_CACHE_COMPRESSION_ENABLED))); cbCompression.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { config.setProperty(DeploymentConfiguration.KEY_CACHE_COMPRESSION_ENABLED, ((ComboItem) e.getItem()).getValue()); } }); //Override getNextValue and getPreviousValue to make it jump to the closest increment/decrement of step size final Long configCacheSize = parseLong(this.config.getProperty(DeploymentConfiguration.KEY_CACHE_MAX_SIZE)); final Long initialCacheSize = configCacheSize < CACHE_MIN_SIZE ? CACHE_MIN_SIZE : configCacheSize; final SpinnerNumberModel snmCacheSize = new PowerOfSpinnerNumberModel(initialCacheSize, TemporaryInternetFilesPanel.CACHE_MIN_SIZE, TemporaryInternetFilesPanel.CACHE_MAX_SIZE, TemporaryInternetFilesPanel.SPINNER_STEP_SIZE); cacheSizeSpinner.setModel(snmCacheSize); final SpinnerChangeListener listener = new SpinnerChangeListener(); cacheSizeSpinner.addChangeListener(listener); cacheSizeSpinner.setToolTipText(Translator.R("TIFPCacheSizeSpinnerTooltip", CACHE_MIN_SIZE, CACHE_MAX_SIZE)); limitCacheSizeCheckBox.setSelected(configCacheSize >= CACHE_MIN_SIZE); limitCacheSizeCheckBox.addItemListener(new CheckboxItemListener()); c.gridx = 0; c.weightx = 1; c.gridy = 0; diskSpacePanel.add(limitCacheSizeCheckBox, c); c.gridy = 1; diskSpacePanel.add(lCacheSize, c); c.gridx = 1; c.weightx = 1; c.gridwidth = 2; diskSpacePanel.add(cacheSizeSpinner, c); c.gridwidth = 1; c.gridy = 2; c.gridx = 0; diskSpacePanel.add(cacheSizeWarningLabel, c); c.gridx = 0; c.gridy = 3; diskSpacePanel.add(lCompression, c); c.gridx = 1; c.gridwidth = 2; diskSpacePanel.add(cbCompression, c); resetLocation.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { location.setText(PathsAndFiles.CACHE_DIR.getDefaultFullPath()); //background engine is clever. Will reset for us if it will see default path here PathsAndFiles.CACHE_DIR.setValue(PathsAndFiles.CACHE_DIR.getDefaultFullPath(), config); showCacheSizeSpinnerGUIElements(limitCacheSizeCheckBox.isSelected()); } }); // This displays the option for changing location of cache // User can NOT edit the text field must do it through dialog. location.setEditable(false); // Can not c&p into the location field. bLocation.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { JFileChooser fileChooser = new JFileChooser(location.getText()); fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); fileChooser.setFileHidingEnabled(false); fileChooser.setAcceptAllFileFilterUsed(false); fileChooser.setDialogTitle(Translator.R("TIFPLocationLabel")); if (fileChooser.showDialog(null, Translator.R("TIFPFileChooserChooseButton")) == JFileChooser.APPROVE_OPTION) { // Check if we have permission to write to that location. String result = fileChooser.getSelectedFile().getAbsolutePath(); File dirLocation = new File(result); boolean canWrite = dirLocation.canWrite(); while (!canWrite && dirLocation != null) { // File does not exist, or no permission. if (dirLocation.exists()) { JOptionPane.showMessageDialog(null, "No permission to write to this location."); return; } dirLocation = dirLocation.getParentFile(); canWrite = dirLocation.canWrite(); } if (canWrite) { location.setText(result); PathsAndFiles.CACHE_DIR.setValue(result, config); showCacheSizeSpinnerGUIElements(limitCacheSizeCheckBox.isSelected()); } } } }); bViewFiles.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { CacheViewer.showCacheDialog(config); } }); c.gridy = 4; c.gridx = 0; c.weightx = 1; c.gridwidth = 1; diskSpacePanel.add(locationDescription, c); c.gridy = 5; c.gridwidth = 1; diskSpacePanel.add(location, c); c.gridx = 1; c.weightx = 0.5; diskSpacePanel.add(resetLocation, c); c.gridx = 2; c.weightx = 0.5; diskSpacePanel.add(bLocation, c); c.gridx = 3; diskSpacePanel.add(bViewFiles, c); JPanel panel = new JPanel(); panel.setLayout(new BorderLayout()); panel.add(description, BorderLayout.NORTH); panel.add(diskSpacePanel, BorderLayout.CENTER); add(panel, BorderLayout.CENTER); this.addComponentListener(new ComponentAdapter() { @Override public void componentShown(final ComponentEvent componentEvent) { listener.stateChanged(null); } }); } private long getCurrentUsableSpace() { long usableDiskSpace = new File(PathsAndFiles.CACHE_DIR.getFullPath(config)).getUsableSpace() / BYTES_TO_MEGABYTES; // getUsableSpace returns bytes return usableDiskSpace; } private static class PowerOfSpinnerNumberModel extends SpinnerNumberModel { private final List powersOf; public PowerOfSpinnerNumberModel(final Long initialCacheSize, final Long cacheMinSize, final Long cacheMaxSize, final Long spinnerStepSize) { super(initialCacheSize, cacheMinSize, cacheMaxSize, spinnerStepSize); powersOf = new ArrayList<>(); final int powersListSize = (int) Math.floor(Math.log(cacheMaxSize) / Math.log(spinnerStepSize) + 1); for (int i = 0; i < powersListSize; i++) { final long powerOfTen = (long) Math.pow(spinnerStepSize, i); powersOf.add(powerOfTen); } } @Override public Long getNextValue() { final Number raw = (Number) super.getValue(); if (super.getNextValue() == null) { return (Long) getMaximum(); } final Long original = raw.longValue(); final Long result = original - (original % powersOf.get(String.valueOf(original).length() - 1)) + powersOf.get(String.valueOf(original).length() - 1); if (result < (Long) getMaximum()) { return result; } return (Long) getMaximum(); } @Override public Long getPreviousValue() { final Number raw = (Number) super.getValue(); final Long original = raw.longValue(); if (super.getPreviousValue() == null) { if (original > 0) { return original - 1; } return (Long) getMinimum(); } final Long result; if (powersOf.contains(original)) { result = original - powersOf.get(String.valueOf(original).length() - 2); return result; } else { if (original % powersOf.get(String.valueOf(original).length() - 1) == 0) { result = original - powersOf.get(String.valueOf(original).length() - 1); } else { result = original - original % powersOf.get(String.valueOf(original).length() - 1); } if (result > Long.valueOf(0)) { return result; } } return Long.valueOf(0); } } private class SpinnerChangeListener implements ChangeListener { @Override public void stateChanged(final ChangeEvent e) { final long usableDiskSpace = getCurrentUsableSpace(); final long cacheSizeSpinnerValue = (long) cacheSizeSpinner.getValue(); if (limitCacheSizeCheckBox.isSelected()) { showCompressionAndLocationGUIElements(true); if (cacheSizeSpinnerValue > usableDiskSpace) { cacheSizeWarningLabel.setText(Translator.R("TIFPCacheSizeSpinnerValueTooLargeWarning", usableDiskSpace)); } else if (cacheSizeSpinnerValue == 0) { cacheSizeWarningLabel.setText(Translator.R("TIFPCacheSizeSetToNoCaching")); showCompressionAndLocationGUIElements(false); } else { cacheSizeWarningLabel.setText(Translator.R("TIFPCacheSizeSpinnerLargeValueWarning", usableDiskSpace)); } config.setProperty(DeploymentConfiguration.KEY_CACHE_MAX_SIZE, Long.valueOf(cacheSizeSpinnerValue).toString()); } else { showCacheSizeSpinnerGUIElements(false); showCompressionAndLocationGUIElements(true); } } } private class CheckboxItemListener implements ItemListener { @Override public void itemStateChanged(final ItemEvent e) { final boolean selected = e.getStateChange() == ItemEvent.SELECTED; showCacheSizeSpinnerGUIElements(selected); if (parseLong(cacheSizeSpinner.getValue().toString()) == 0 && selected) { showCompressionAndLocationGUIElements(false); } else { showCompressionAndLocationGUIElements(true); } if (selected) { config.setProperty(DeploymentConfiguration.KEY_CACHE_MAX_SIZE, cacheSizeSpinner.getValue().toString()); } else { config.setProperty(DeploymentConfiguration.KEY_CACHE_MAX_SIZE, Long.toString(CACHE_UNLIMITED_SIZE)); } config.setProperty(DeploymentConfiguration.KEY_CACHE_ENABLED, String.valueOf(!selected)); } } private void showCompressionAndLocationGUIElements(boolean bool) { cbCompression.setEnabled(bool); lCompression.setEnabled(bool); resetLocation.setEnabled(bool); bLocation.setEnabled(bool); location.setEnabled(bool); locationDescription.setEnabled(bool); bViewFiles.setEnabled(bool); } private void showCacheSizeSpinnerGUIElements(boolean bool){ lCacheSize.setEnabled(bool); cacheSizeSpinner.setEnabled(bool); cacheSizeWarningLabel.setEnabled(bool); long usableDiskSpace = getCurrentUsableSpace(); if(bool == false) { cacheSizeSpinner.setToolTipText(null); cacheSizeWarningLabel.setText(Translator.R("TIFPCacheSizeSpinnerLargeValueWarning", usableDiskSpace)); } else { cacheSizeSpinner.setToolTipText(Translator.R("TIFPCacheSizeSpinnerTooltip", CACHE_MIN_SIZE, CACHE_MAX_SIZE)); final long cacheSizeSpinnerValue = (long) cacheSizeSpinner.getValue(); if(cacheSizeSpinnerValue > usableDiskSpace) { cacheSizeWarningLabel.setText(Translator.R("TIFPCacheSizeSpinnerValueTooLargeWarning", usableDiskSpace)); } else if (cacheSizeSpinnerValue == 0) { cacheSizeWarningLabel.setText(Translator.R("TIFPCacheSizeSetToNoCaching")); } } } }icedtea-web-1.6.2/netx/net/sourceforge/jnlp/controlpanel/PaxHeaders.17941/SecuritySettingsPanel.java0000644000000000000000000000013212654402377030352 xustar0030 mtime=1454507263.279432021 30 atime=1454507327.134580403 30 ctime=1454507658.740157877 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/controlpanel/SecuritySettingsPanel.java0000644000175000002070000001341512654402377031101 0ustar00jvanekmock00000000000000/* SecuritySettingsPanel.java -- Display possible security settings. Copyright (C) 2010 Red Hat This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be 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 this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package net.sourceforge.jnlp.controlpanel; import java.awt.BorderLayout; import java.awt.Component; import java.awt.Dimension; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.Box; import javax.swing.JCheckBox; import javax.swing.JLabel; import javax.swing.JPanel; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.Translator; /** * This provides a way for the user to modify the security settings through a * GUI. * * @author Andrew Su (asu@redhat.com, andrew.su@utoronto.ca) * */ @SuppressWarnings("serial") public class SecuritySettingsPanel extends NamedBorderPanel implements ActionListener { private final DeploymentConfiguration config; // NOTE: All the ones listed with "Default" are in Oracle's implementation. // Not shown on deployments.properties webpage. Add support for these later! /** List of properties used by this panel */ public static String[] properties = { "deployment.security.askgrantdialog.show", "deployment.security.askgrantdialog.notinca", "deployment.security.browser.keystore.use", // default TRUE "deployment.security.clientauth.keystore.auto", // Default FALSE "deployment.security.jsse.hostmismatch.warning", "deployment.security.https.warning.show", // Default FALSE "deployment.security.sandbox.awtwarningwindow", "deployment.security.sandbox.jnlp.enhanced", "deployment.security.validation.crl", // Default TRUE "deployment.security.validation.ocsp", // Default FALSE "deployment.security.pretrust.list", // Default TRUE "deployment.security.blacklist.check", // Default TRUE "deployment.security.password.cache", // Default TRUE "deployment.security.SSLv2Hello", // Default FALSE "deployment.security.SSLv3", // Default TRUE "deployment.security.TLSv1", // Default TRUE // "deployment.security.mixcode", // Default TRUE }; /** * This creates a new instance of the security settings panel. * * @param config * Loaded DeploymentConfiguration file. */ public SecuritySettingsPanel(DeploymentConfiguration config) { super(Translator.R("CPHeadSecurity"), new BorderLayout()); this.config = config; addComponents(); } /** * Add the components to the panel. */ private void addComponents() { JPanel topPanel = new JPanel(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); JLabel description = new JLabel("" + Translator.R("CPSecurityDescription") + "
    "); JCheckBox[] securityGeneralOptions = { new JCheckBox(Translator.R("SGPAllowUserGrantSigned")), new JCheckBox(Translator.R("SGPAllowUserGrantUntrust")), new JCheckBox(Translator.R("SGPUseBrowserKeystore")), new JCheckBox(Translator.R("SGPUsePersonalCertOneMatch")), new JCheckBox(Translator.R("SGPWarnCertHostMismatch")), new JCheckBox(Translator.R("SGPShowValid")), new JCheckBox(Translator.R("SGPShowSandboxWarning")), new JCheckBox(Translator.R("SGPAllowUserAcceptJNLPSecurityRequests")), new JCheckBox(Translator.R("SGPCheckCertRevocationList")), new JCheckBox(Translator.R("SGPEnableOnlineCertValidate")), new JCheckBox(Translator.R("SGPEnableTrustedPublisherList")), new JCheckBox(Translator.R("SGPEnableBlacklistRevocation")), new JCheckBox(Translator.R("SGPEnableCachingPassword")), new JCheckBox(Translator.R("SGPUseSSL2")), new JCheckBox(Translator.R("SGPUseSSL3")), new JCheckBox(Translator.R("SGPUseTLS1")), }; c.fill = GridBagConstraints.BOTH; c.gridx = 0; c.weightx = 1; topPanel.add(description, c); // Only display the ones with properties that are valid or existent. for (int i = 0; i < properties.length; i++) { String s = config.getProperty(properties[i]); if (s == null) { securityGeneralOptions[i] = null; continue; } securityGeneralOptions[i].setSelected(Boolean.parseBoolean(s)); securityGeneralOptions[i].setActionCommand(properties[i]); securityGeneralOptions[i].addActionListener(this); c.gridy = i + 1; topPanel.add(securityGeneralOptions[i], c); } Component filler = Box.createRigidArea(new Dimension(1, 1)); c.weighty = 1; c.gridy++; topPanel.add(filler, c); add(topPanel, BorderLayout.CENTER); } @Override public void actionPerformed(ActionEvent e) { config.setProperty(e.getActionCommand(), String.valueOf(((JCheckBox) e.getSource()).isSelected())); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/controlpanel/PaxHeaders.17941/PolicyPanel.java0000644000000000000000000000013212654402377026261 xustar0030 mtime=1454507263.279432021 30 atime=1454507327.134580403 30 ctime=1454507658.740157877 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/controlpanel/PolicyPanel.java0000644000175000002070000003150512654402377027010 0ustar00jvanekmock00000000000000/* Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.controlpanel; import static net.sourceforge.jnlp.runtime.Translator.R; import java.awt.Component; import java.awt.Dimension; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.File; import java.io.IOException; import java.lang.reflect.Method; import java.net.MalformedURLException; import java.net.URL; import javax.swing.Box; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JTextField; import javax.swing.SwingUtilities; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.config.PathsAndFiles; import net.sourceforge.jnlp.security.policyeditor.PolicyEditor; import net.sourceforge.jnlp.security.policyeditor.PolicyEditor.PolicyEditorWindow; import net.sourceforge.jnlp.util.FileUtils; import net.sourceforge.jnlp.util.FileUtils.OpenFileResult; import net.sourceforge.jnlp.util.logging.OutputController; /** * Implements a Policy Settings panel for the itweb-settings control panel. * This gives the user information about custom user-level JNLP Policy files, * as well as offering a way to launch a policy file editor with the correct * file path to the user's personal policy file location presupplied. */ public class PolicyPanel extends NamedBorderPanel { private PolicyEditorWindow policyEditor = null; private final DeploymentConfiguration config; public PolicyPanel(final JFrame frame, final DeploymentConfiguration config) { super(R("CPHeadPolicy"), new GridBagLayout()); this.config = config; addComponents(frame); } private void addComponents(final JFrame frame) { JLabel aboutLabel = new JLabel("" + R("CPPolicyDetail") + ""); final String fileUrlString = PathsAndFiles.JAVA_POLICY.getFullPath(config); final JButton simpleEditorButton = new JButton(R("CPButSimpleEditor")); simpleEditorButton.addActionListener(new LaunchSimplePolicyEditorAction(frame, fileUrlString)); final JButton advancedEditorButton = new JButton(R("CPButAdvancedEditor")); advancedEditorButton.addActionListener(new LaunchPolicyToolAction(frame, fileUrlString)); final String pathPart = localFilePathFromUrlString(fileUrlString); simpleEditorButton.setToolTipText(R("CPPolicyTooltip", FileUtils.displayablePath(pathPart, 60))); final JTextField locationField = new JTextField(pathPart); locationField.setEditable(false); final GridBagConstraints c = new GridBagConstraints(); c.fill = GridBagConstraints.BOTH; c.gridx = 1; c.gridy = 0; c.weightx = 1; add(aboutLabel, c); c.weighty = 0; c.weightx = 0; c.gridy++; add(locationField, c); c.fill = GridBagConstraints.NONE; c.gridx++; add(simpleEditorButton, c); c.gridx++; add(advancedEditorButton, c); c.gridx--; /* Keep all the elements at the top of the panel (Extra padding) * Keep View/Edit button next to location field, with padding between * the right edge of the frame and the button */ c.fill = GridBagConstraints.BOTH; final Component filler1 = Box.createRigidArea(new Dimension(240, 1)); final Component filler2 = Box.createRigidArea(new Dimension(1, 1)); c.gridx++; add(filler1, c); c.gridx--; c.weighty = 1; c.gridy++; add(filler2, c); } /** * Launch the policytool for a specified file path * @param frame a {@link JFrame} to act as parent to warning dialogs which may appear * @param filePath a {@link String} representing the path to the file to be opened */ private static void launchPolicyTool(final JFrame frame, final String filePath) { try { final File policyFile = new File(filePath).getCanonicalFile(); final OpenFileResult result = FileUtils.testFilePermissions(policyFile); if (result == OpenFileResult.SUCCESS) { policyToolLaunchHelper(frame, filePath); } else if (result == OpenFileResult.CANT_WRITE) { OutputController.getLogger().log(OutputController.Level.WARNING_ALL, "Opening user JNLP policy read-only"); FileUtils.showReadOnlyDialog(frame); policyToolLaunchHelper(frame, filePath); } else { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, "Could not open user JNLP policy"); FileUtils.showCouldNotOpenFileDialog(frame, policyFile.getPath(), result); } } catch (IOException e) { OutputController.getLogger().log(e); OutputController.getLogger().log(OutputController.Level.ERROR_ALL, "Could not open user JNLP policy"); FileUtils.showCouldNotOpenFilepathDialog(frame, filePath); } } /** * Launch the simplified PolicyEditor for a specified file path * @param frame a {@link JFrame} to act as parent to warning dialogs which may appear * @param filePath a {@link String} representing the path to the file to be opened */ private void launchSimplePolicyEditor(final String filePath) { if (policyEditor == null || policyEditor.getPolicyEditor().isClosed()) { policyEditor = PolicyEditor.getPolicyEditorFrame(filePath); policyEditor.asWindow().setVisible(true); } else { policyEditor.asWindow().toFront(); policyEditor.asWindow().repaint(); } } /** * This executes a new process for policytool using ProcessBuilder, with the new process' * working directory set to the user's home directory. policytool then attempts to * open the provided policy file path, if policytool can be run. ProcessBuilder does * some verification to ensure that the built command can be executed - if not, it * throws an IOException. In this event, we try our reflective fallback launch. * We do this in a new {@link Thread} to ensure that the fallback launch does not * block the AWT thread, and neither does ProcessBuilder#start() in case it happens * to be synchronous on the current system. * @param frame a {@link JFrame} to act as parent to warning dialogs which may appear * @param filePath a {@link String} representing the path to the file to be opened */ private static void policyToolLaunchHelper(final JFrame frame, final String filePath) { new Thread(new Runnable() { @Override public void run() { final ProcessBuilder pb = new ProcessBuilder("policytool", "-file", filePath) .directory(new File(System.getProperty("user.home"))); try { pb.start(); } catch (IOException ioe) { OutputController.getLogger().log(ioe); try { reflectivePolicyToolLaunch(filePath); } catch (Exception e) { OutputController.getLogger().log(e); OutputController.getLogger().log(OutputController.Level.ERROR_ALL, "Could not open user JNLP policy"); FileUtils.showCouldNotOpenDialog(frame, R("CPPolicyEditorNotFound")); } } } }).start(); } /** * This is used as a fallback in case launching the policytool by executing a new process * fails. This probably happens because we are running on a system where the policytool * executable is not on the PATH, or because we are running on a non-POSIX compliant system. * We do this reflectively to avoid needing to add PolicyTool as build dependency simply for * this small edge case. * @param filePath a {@link String} representing the path of the file to attempt to open * @throws Exception if any sort of exception occurs during reflective launch of policytool */ private static void reflectivePolicyToolLaunch(final String filePath) throws Exception { Class policyTool; try { // Java 7 location policyTool = Class.forName("sun.security.tools.policytool.PolicyTool"); } catch (ClassNotFoundException cnfe) { // Java 6 location policyTool = Class.forName("sun.security.tools.PolicyTool"); } final Class[] signature = new Class[] { String[].class }; final Method main = policyTool.getMethod("main", signature); final String[] args = new String[] { "-file", filePath }; main.invoke(null, (Object) args); } /** * Loosely attempt to get the path part of a file URL string. If this fails, * simply return back the input. This is only intended to be used for displaying * GUI elements such as the CPPolicyTooltip. * @param url the {@link String} representing the URL whose path is desired * @return a {@link String} representing the local filepath of the given file:/ URL */ private static String localFilePathFromUrlString(final String url) { try { final URL u = new URL(url); return u.getPath(); } catch (MalformedURLException e) { return url; } } /** * Implements the action to be performed when the "Advanced" button is clicked */ private class LaunchPolicyToolAction implements ActionListener { private final JFrame frame; private final String fileUrlString; public LaunchPolicyToolAction(final JFrame frame, final String fileUrlString) { this.fileUrlString = fileUrlString; this.frame = frame; } @Override public void actionPerformed(final ActionEvent event) { try { final URL fileUrl = new URL(fileUrlString); SwingUtilities.invokeLater(new Runnable() { @Override public void run() { launchPolicyTool(frame, fileUrl.getPath()); } }); } catch (MalformedURLException ex) { OutputController.getLogger().log(ex); FileUtils.showCouldNotOpenFilepathDialog(frame, fileUrlString); } } } private class LaunchSimplePolicyEditorAction implements ActionListener { private final JFrame frame; private final String fileUrlString; public LaunchSimplePolicyEditorAction(final JFrame frame, final String fileUrlString) { this.fileUrlString = fileUrlString; this.frame = frame; } @Override public void actionPerformed(final ActionEvent event) { try { final URL fileUrl = new URL(fileUrlString); SwingUtilities.invokeLater(new Runnable() { @Override public void run() { launchSimplePolicyEditor(fileUrl.getPath()); } }); } catch (MalformedURLException ex) { OutputController.getLogger().log(ex); FileUtils.showCouldNotOpenFilepathDialog(frame, fileUrlString); } } } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/controlpanel/PaxHeaders.17941/NetworkSettingsPanel.java0000644000000000000000000000013212654402377030174 xustar0030 mtime=1454507263.278432034 30 atime=1454507327.133580417 30 ctime=1454507658.740157877 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/controlpanel/NetworkSettingsPanel.java0000644000175000002070000003020712654402377030721 0ustar00jvanekmock00000000000000/* NetworkSettingsPanel.java -- Sets proxy settings for network. Copyright (C) 2010 Red Hat This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be 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 this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package net.sourceforge.jnlp.controlpanel; import java.awt.BorderLayout; import java.awt.CardLayout; import java.awt.Component; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import java.util.ArrayList; import javax.swing.Box; import javax.swing.ButtonGroup; import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JRadioButton; import javax.swing.JTextField; import javax.swing.text.AttributeSet; import javax.swing.text.BadLocationException; import javax.swing.text.PlainDocument; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.Translator; /** * This is the pane used with creating a JDialog version. This allows changing * the network configuration: Proxy * * @author Andrew Su (asu@redhat.com, andrew.su@utoronto.ca) * */ @SuppressWarnings("serial") public class NetworkSettingsPanel extends JPanel implements ActionListener { private final DeploymentConfiguration config; private JPanel description; private final ArrayList proxyPanels = new ArrayList<>(); // The stuff with editable fields /** List of properties used by this panel */ public static String[] properties = { DeploymentConfiguration.KEY_PROXY_TYPE, DeploymentConfiguration.KEY_PROXY_HTTP_HOST, DeploymentConfiguration.KEY_PROXY_HTTP_PORT, DeploymentConfiguration.KEY_PROXY_BYPASS_LOCAL, DeploymentConfiguration.KEY_PROXY_AUTO_CONFIG_URL }; /** * Creates a new instance of the network settings panel. * * @param config * Loaded DeploymentConfiguration file. */ public NetworkSettingsPanel(DeploymentConfiguration config) { super(); this.config = config; setLayout(new BorderLayout()); addComponents(); } /** * This adds the components to the panel. */ protected void addComponents() { JPanel settingPanel = new NamedBorderPanel(Translator.R("CPHeadNetworkSettings")); settingPanel.setLayout(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); c.fill = GridBagConstraints.BOTH; c.weightx = 1; c.weighty = 1; c.gridx = 0; JLabel networkDesc = new JLabel("" + Translator.R("CPNetworkSettingsDescription") + "
    "); JLabel[] description = { new JLabel("" + Translator.R("NSDescription-1") + ""), new JLabel("" + Translator.R("NSDescription0") + ""), new JLabel("" + Translator.R("NSDescription1") + ""), new JLabel("" + Translator.R("NSDescription2") + ""), new JLabel("" + Translator.R("NSDescription3") + "") }; this.description = new JPanel(new CardLayout()); for (int i = 0; i < description.length; i++) this.description.add(description[i], String.valueOf(i - 1)); // Settings for selecting Proxy Server JPanel proxyServerPanel = new JPanel(new GridLayout(0, 1)); JPanel proxyLocationPanel = new JPanel(new GridBagLayout()); JPanel proxyBypassPanel = new JPanel(new FlowLayout(FlowLayout.LEADING)); JLabel addressLabel = new JLabel(Translator.R("NSAddress") + ":"); JLabel portLabel = new JLabel(Translator.R("NSPort") + ":"); final JTextField addressField = new JTextField(config.getProperty(properties[1]), 10); addressField.getDocument().addDocumentListener(new DocumentAdapter(config, properties[1])); final JTextField portField = new JTextField(5); portField.setDocument(NetworkSettingsPanel.getPortNumberDocument()); portField.getDocument().addDocumentListener(new DocumentAdapter(config, properties[2])); portField.setText(config.getProperty(properties[2])); // Create the button which allows setting of other types of proxy. JButton advancedProxyButton = new JButton(Translator.R("NSAdvanced") + "..."); advancedProxyButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { AdvancedProxySettingsDialog.showAdvancedProxySettingsDialog(config); addressField.setText(config.getProperty(properties[1])); portField.setText(config.getProperty(properties[2])); } }); JCheckBox bypassCheckBox = new JCheckBox(Translator.R("NSBypassLocal"), Boolean.parseBoolean(config.getProperty(properties[3]))); bypassCheckBox.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { config.setProperty(properties[3], String.valueOf(e.getStateChange() == ItemEvent.SELECTED)); } }); c.gridy = 0; c.gridx = GridBagConstraints.RELATIVE; c.weightx = 0; proxyLocationPanel.add(Box.createHorizontalStrut(20), c); proxyLocationPanel.add(addressLabel, c); c.weightx = 1; proxyLocationPanel.add(addressField, c); c.weightx = 0; proxyLocationPanel.add(portLabel, c); c.weightx = 1; proxyLocationPanel.add(portField, c); c.weightx = 0; proxyLocationPanel.add(advancedProxyButton, c); proxyBypassPanel.add(Box.createHorizontalStrut(5)); proxyBypassPanel.add(bypassCheckBox); proxyServerPanel.add(proxyLocationPanel); proxyServerPanel.add(proxyBypassPanel); JRadioButton directConnection = new JRadioButton(Translator.R("NSDirectConnection"), config.getProperty(properties[0]).equals("0")); directConnection.setActionCommand("0"); directConnection.addActionListener(this); JRadioButton useProxyServer = new JRadioButton(Translator.R("NSManualProxy"), config.getProperty(properties[0]).equals("1")); useProxyServer.setActionCommand("1"); useProxyServer.addActionListener(this); JRadioButton useAutoProxyConfigScript = new JRadioButton(Translator.R("NSAutoProxy"), config.getProperty(properties[0]).equals("2")); useAutoProxyConfigScript.setActionCommand("2"); useAutoProxyConfigScript.addActionListener(this); JRadioButton useBrowserSettings = new JRadioButton(Translator.R("NSBrowserProxy"), config.getProperty(properties[0]).equals("3")); useBrowserSettings.setActionCommand("3"); useBrowserSettings.addActionListener(this); ButtonGroup modeSelect = new ButtonGroup(); modeSelect.add(useBrowserSettings); modeSelect.add(useProxyServer); modeSelect.add(useAutoProxyConfigScript); modeSelect.add(directConnection); // Settings for Automatic Proxy Configuration Script JPanel proxyAutoPanel = new JPanel(new GridBagLayout()); JLabel locationLabel = new JLabel(Translator.R("NSScriptLocation") + ":"); final JTextField locationField = new JTextField(config.getProperty(properties[4]), 20); locationField.getDocument().addDocumentListener(new DocumentAdapter(config, properties[4])); c.gridx = 0; proxyAutoPanel.add(Box.createHorizontalStrut(20), c); c.gridx = GridBagConstraints.RELATIVE; proxyAutoPanel.add(locationLabel, c); c.weightx = 1; proxyAutoPanel.add(locationField, c); c.weighty = 0; c.gridx = 0; c.gridy = 0; settingPanel.add(networkDesc, c); c.gridy = 1; settingPanel.add(this.description, c); c.gridy = 2; settingPanel.add(directConnection, c); c.gridy = 3; settingPanel.add(useBrowserSettings, c); c.gridy = 4; settingPanel.add(useProxyServer, c); c.gridy = 5; settingPanel.add(proxyServerPanel, c); proxyPanels.add(proxyServerPanel); c.gridy = 6; settingPanel.add(useAutoProxyConfigScript, c); c.gridy = 7; settingPanel.add(proxyAutoPanel, c); proxyPanels.add(proxyAutoPanel); // Filler to pack the bottom of the panel. Component filler = Box.createRigidArea(new Dimension(1, 1)); c.gridy++; c.weighty = 1; settingPanel.add(filler, c); setState(); // depending on default setting we will enable or disable add(settingPanel, BorderLayout.CENTER); } /** * Enable/Disable the panel and all its children recursively. * * @param panel * JPanel which needs to be enabled or disabled. * @param enable * true if the panel and its children are to be enabled, false * otherwise. */ private void enablePanel(JPanel panel, boolean enable) { // This will be used to enable all components in this panel recursively. // Ridiculously slow if lots of nested panels. for (Component c : panel.getComponents()) { if (c instanceof JPanel) { enablePanel((JPanel) c, enable); } c.setEnabled(enable); } } @Override public void actionPerformed(ActionEvent e) { config.setProperty(properties[0], e.getActionCommand()); setState(); } /** * This enables and disables the appropriate panels. */ private void setState() { ((CardLayout) this.description.getLayout()).show(this.description, config.getProperty(properties[0])); switch (config.getProperty(properties[0])) { case "0": for (JPanel panel : proxyPanels) enablePanel(panel, false); break; case "1": enablePanel(proxyPanels.get(1), false); enablePanel(proxyPanels.get(0), true); break; case "2": enablePanel(proxyPanels.get(0), false); enablePanel(proxyPanels.get(1), true); break; case "3": for (JPanel panel : proxyPanels) enablePanel(panel, false); break; } } /** * Creates a PlainDocument that only take numbers if it will create a valid port number. * @return PlainDocument which will ensure numeric values only and is a valid port number. */ public static PlainDocument getPortNumberDocument(){ return new PlainDocument(){ @Override public void insertString(int offs, String str, AttributeSet a) throws BadLocationException { if (str != null) { try { Integer.valueOf(str); int val = Integer.valueOf(this.getText(0, this.getLength()) + str); if (val < 1 || val > 65535) { // Invalid port number if true throw new NumberFormatException("Invalid port number"); } super.insertString(offs, str, a); } catch (Exception e) { JOptionPane.showMessageDialog(null, Translator.R("CPInvalidPort"), Translator.R("CPInvalidPortTitle") , JOptionPane.WARNING_MESSAGE); } } } }; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/controlpanel/PaxHeaders.17941/NamedBorderPanel.java0000644000000000000000000000013212654402377027204 xustar0030 mtime=1454507263.278432034 30 atime=1454507327.133580417 30 ctime=1454507658.740157877 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/controlpanel/NamedBorderPanel.java0000644000175000002070000000350412654402377027731 0ustar00jvanekmock00000000000000/* NamedBorderPanel.java -- Makes a border which has a name. Copyright (C) 2010 Red Hat This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be 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 this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package net.sourceforge.jnlp.controlpanel; import java.awt.LayoutManager; import javax.swing.BorderFactory; import javax.swing.JPanel; /** * This class provides the a panel that has a border with the name specified. * * @author Andrew Su (asu@redhat.com, andrew.su@utoronto.ca) * */ public class NamedBorderPanel extends JPanel { /** * Creates a new instance of JPanel with a named border and specified * layout. * * @param title * Name to be displayed. * @param layout * Layout to use with this panel. */ public NamedBorderPanel(String title, LayoutManager layout) { this(title); setLayout(layout); } /** * Creates a new instance of JPanel with a named border. * * @param title * Name to be displayed. */ public NamedBorderPanel(String title) { super(); setBorder(BorderFactory.createCompoundBorder( BorderFactory.createTitledBorder(title), BorderFactory.createEmptyBorder(5, 5, 5, 5))); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/controlpanel/PaxHeaders.17941/JVMPanel.java0000644000000000000000000000013212654402377025456 xustar0030 mtime=1454507263.278432034 30 atime=1454507327.133580417 30 ctime=1454507658.740157877 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/controlpanel/JVMPanel.java0000644000175000002070000003446312654402377026213 0ustar00jvanekmock00000000000000/* PluginPanel.java Copyright (C) 2012, Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.controlpanel; import java.awt.Component; import java.awt.Dimension; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.Insets; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.File; import javax.swing.Box; import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JFileChooser; import javax.swing.JLabel; import javax.swing.JTextField; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; import javax.swing.text.Document; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.Translator; import net.sourceforge.jnlp.util.logging.OutputController; import net.sourceforge.jnlp.util.StreamUtils; @SuppressWarnings("serial") public class JVMPanel extends NamedBorderPanel { public static class JvmValidationResult { public static enum STATE { EMPTY, NOT_DIR, NOT_VALID_DIR, NOT_VALID_JDK, VALID_JDK; } public final String formattedText; public final STATE id; public JvmValidationResult(String formattedText, STATE id) { this.id = id; this.formattedText = formattedText; } } private final DeploymentConfiguration config; private File lastPath = new File("/usr/lib/jvm/java/jre/"); JTextField testFieldArgumentsExec; JVMPanel(DeploymentConfiguration config) { super(Translator.R("CPHeadJVMSettings"), new GridBagLayout()); this.config = config; addComponents(); } void resetTestFieldArgumentsExec(){ testFieldArgumentsExec.setText(""); } private void addComponents() { final JLabel description = new JLabel("" + Translator.R("CPJVMPluginArguments") + "
    "); final JTextField testFieldArguments = new JTextField(25); testFieldArguments.getDocument().addDocumentListener(new DocumentAdapter(config, DeploymentConfiguration.KEY_PLUGIN_JVM_ARGUMENTS)); testFieldArguments.setText(config.getProperty(DeploymentConfiguration.KEY_PLUGIN_JVM_ARGUMENTS)); final JLabel descriptionExec = new JLabel("" + Translator.R("CPJVMitwExec") + "
    "); testFieldArgumentsExec = new JTextField(100); final JLabel validationResult = new JLabel(resetValidationResult(testFieldArgumentsExec.getText(), "", "CPJVMnone")); final JCheckBox allowTypoTimeValidation = new JCheckBox(Translator.R("CPJVMPluginAllowTTValidation"), true); allowTypoTimeValidation.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { validationResult.setText(resetValidationResult(testFieldArgumentsExec.getText(), "", "CPJVMnone")); } }); testFieldArgumentsExec.getDocument().addDocumentListener(new DocumentListener() { @Override public void insertUpdate(DocumentEvent e) { if (allowTypoTimeValidation.isSelected()) { JvmValidationResult s = validateJvm(testFieldArgumentsExec.getText()); validationResult.setText(resetValidationResult(testFieldArgumentsExec.getText(), s.formattedText, "CPJVMvalidated")); } } @Override public void removeUpdate(DocumentEvent e) { if (allowTypoTimeValidation.isSelected()) { JvmValidationResult s = validateJvm(testFieldArgumentsExec.getText()); validationResult.setText(resetValidationResult(testFieldArgumentsExec.getText(), s.formattedText, "CPJVMvalidated")); } } @Override public void changedUpdate(DocumentEvent e) { if (allowTypoTimeValidation.isSelected()) { JvmValidationResult s = validateJvm(testFieldArgumentsExec.getText()); validationResult.setText(resetValidationResult(testFieldArgumentsExec.getText(), s.formattedText, "CPJVMvalidated")); } } }); testFieldArgumentsExec.getDocument().addDocumentListener(new DocumentAdapter(config, DeploymentConfiguration.KEY_JRE_DIR)); testFieldArgumentsExec.setText(config.getProperty(DeploymentConfiguration.KEY_JRE_DIR)); final JButton selectJvm = new JButton(Translator.R("CPJVMPluginSelectExec")); selectJvm.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { JFileChooser jfch; if (lastPath != null && lastPath.exists()) { jfch = new JFileChooser(lastPath); } else { jfch = new JFileChooser(); } jfch.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); int i = jfch.showOpenDialog(JVMPanel.this); if (i == JFileChooser.APPROVE_OPTION && jfch.getSelectedFile() != null) { lastPath = jfch.getSelectedFile().getParentFile(); String nws = jfch.getSelectedFile().getAbsolutePath(); String olds = testFieldArgumentsExec.getText(); if (!nws.equals(olds)) { validationResult.setText(resetValidationResult(testFieldArgumentsExec.getText(), "", "CPJVMnone")); } testFieldArgumentsExec.setText(nws); } } }); final JButton validateJvm = new JButton(Translator.R("CPJVMitwExecValidation")); validateJvm.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { JvmValidationResult s = validateJvm(testFieldArgumentsExec.getText()); validationResult.setText(resetValidationResult(testFieldArgumentsExec.getText(), s.formattedText, "CPJVMvalidated")); } }); // Filler to pack the bottom of the panel. GridBagConstraints c = new GridBagConstraints(); c.fill = GridBagConstraints.BOTH; c.weightx = 1; c.gridwidth = 4; c.gridx = 0; c.gridy = 0; c.insets = new Insets(2, 2, 4, 4); this.add(description, c); c.gridy++; this.add(testFieldArguments, c); c.gridy++; this.add(descriptionExec, c); c.gridy++; this.add(testFieldArgumentsExec, c); c.gridy++; GridBagConstraints cb1 = (GridBagConstraints) c.clone(); cb1.fill = GridBagConstraints.NONE; cb1.gridwidth = 1; this.add(selectJvm, cb1); GridBagConstraints cb3 = (GridBagConstraints) c.clone(); cb3.fill = GridBagConstraints.NONE; cb3.gridx = 2; cb3.gridwidth = 1; this.add(allowTypoTimeValidation, cb3); GridBagConstraints cb2 = (GridBagConstraints) c.clone(); cb2.fill = GridBagConstraints.NONE; cb2.gridx = 3; cb2.gridwidth = 1; this.add(validateJvm, cb2); c.gridy++; this.add(validationResult, c); // This is to keep it from expanding vertically if resized. Component filler = Box.createRigidArea(new Dimension(1, 1)); c.gridy++; c.weighty++; this.add(filler, c); } public static JvmValidationResult validateJvm(String cmd) { if (cmd == null || cmd.trim().equals("")) { return new JvmValidationResult("" + Translator.R("CPJVMvalueNotSet") + "", JvmValidationResult.STATE.EMPTY); } String validationResult = ""; File jreDirFile = new File(cmd); JvmValidationResult.STATE latestOne = JvmValidationResult.STATE.EMPTY; if (jreDirFile.isDirectory()) { validationResult += "" + Translator.R("CPJVMisDir") + "
    "; } else { validationResult += "" + Translator.R("CPJVMnotDir") + "
    "; latestOne = JvmValidationResult.STATE.NOT_DIR; } File javaFile = new File(cmd + File.separator + "bin" + File.separator + "java"); if (javaFile.isFile()) { validationResult += "" + Translator.R("CPJVMjava") + "
    "; } else { validationResult += "" + Translator.R("CPJVMnoJava") + "
    "; if (latestOne != JvmValidationResult.STATE.NOT_DIR) { latestOne = JvmValidationResult.STATE.NOT_VALID_JDK; } } File rtFile = new File(cmd + File.separator + "lib" + File.separator + "rt.jar"); if (rtFile.isFile()) { validationResult += "" + Translator.R("CPJVMrtJar") + "
    "; } else { validationResult += "" + Translator.R("CPJVMnoRtJar") + "
    "; if (latestOne != JvmValidationResult.STATE.NOT_DIR) { latestOne = JvmValidationResult.STATE.NOT_VALID_JDK; } } ProcessBuilder sb = new ProcessBuilder(javaFile.getAbsolutePath(), "-version"); Process p = null; String processErrorStream = ""; String processStdOutStream = ""; Integer r = null; try { p = sb.start(); p.waitFor(); processErrorStream = StreamUtils.readStreamAsString(p.getErrorStream()); processStdOutStream = StreamUtils.readStreamAsString(p.getInputStream()); r = p.exitValue(); OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, processErrorStream); OutputController.getLogger().log(processStdOutStream); processErrorStream = processErrorStream.toLowerCase(); processStdOutStream = processStdOutStream.toLowerCase(); } catch (Exception ex) {; OutputController.getLogger().log(OutputController.Level.ERROR_ALL, ex); } if (r == null) { validationResult += "" + Translator.R("CPJVMnotLaunched") + ""; if (latestOne != JvmValidationResult.STATE.NOT_DIR) { latestOne = JvmValidationResult.STATE.NOT_VALID_JDK; } return new JvmValidationResult(validationResult, latestOne); } if (r.intValue() != 0) { validationResult += "" + Translator.R("CPJVMnoSuccess") + ""; if (latestOne != JvmValidationResult.STATE.NOT_DIR) { latestOne = JvmValidationResult.STATE.NOT_VALID_JDK; } return new JvmValidationResult(validationResult, latestOne); } if (processErrorStream.contains("openjdk") || processStdOutStream.contains("openjdk")) { validationResult += "" + Translator.R("CPJVMopenJdkFound") + ""; return new JvmValidationResult(validationResult, JvmValidationResult.STATE.VALID_JDK); } if (processErrorStream.contains("ibm") || processStdOutStream.contains("ibm")) { validationResult += "" + Translator.R("CPJVMibmFound") + ""; if (latestOne != JvmValidationResult.STATE.NOT_DIR) { latestOne = JvmValidationResult.STATE.NOT_VALID_JDK; } return new JvmValidationResult(validationResult, latestOne); } if (processErrorStream.contains("gij") || processStdOutStream.contains("gij")) { validationResult += "" + Translator.R("CPJVMgijFound") + ""; if (latestOne != JvmValidationResult.STATE.NOT_DIR) { latestOne = JvmValidationResult.STATE.NOT_VALID_JDK; } return new JvmValidationResult(validationResult, latestOne); } if (processErrorStream.contains("oracle") || processStdOutStream.contains("oracle") || processErrorStream.contains("java(tm)") || processStdOutStream.contains("java(tm)")) { validationResult += "" + Translator.R("CPJVMoracleFound") + ""; if (latestOne != JvmValidationResult.STATE.NOT_DIR) { latestOne = JvmValidationResult.STATE.NOT_VALID_JDK; } return new JvmValidationResult(validationResult, latestOne); } validationResult += "" + Translator.R("CPJVMstrangeProcess") + ""; return new JvmValidationResult(validationResult, JvmValidationResult.STATE.NOT_VALID_JDK); } private String resetValidationResult(final String value, String result, String headerKey) { return "" + Translator.R(headerKey) + ":
    " + value + "
    " + result + "
    "; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/controlpanel/PaxHeaders.17941/JREPanel.java0000644000000000000000000000013212654402377025442 xustar0030 mtime=1454507263.277432047 30 atime=1454507327.133580417 30 ctime=1454507658.740157877 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/controlpanel/JREPanel.java0000644000175000002070000000275212654402377026173 0ustar00jvanekmock00000000000000/* JREPanel.java - Displays option for changing to another Java Runtime. Copyright (C) 2010 Red Hat This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be 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 this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package net.sourceforge.jnlp.controlpanel; import java.awt.BorderLayout; import javax.swing.JLabel; import net.sourceforge.jnlp.runtime.Translator; /** * This panel is to allow access to setting the JRE but we currently do not * support this. * * @author Andrew Su (asu@redhat.com, andrew.su@utoronto.ca) * */ public class JREPanel extends NamedBorderPanel { /** * Creates a new instance of the JRE settings panel. (Currently not * supported). */ public JREPanel() { super(Translator.R("CPHeadJRESettings")); setLayout(new BorderLayout()); JLabel jreLabel = new JLabel("" + Translator.R("CPJRESupport") + ""); add(jreLabel, BorderLayout.NORTH); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/controlpanel/PaxHeaders.17941/DocumentAdapter.java0000644000000000000000000000013212654402377027121 xustar0030 mtime=1454507263.277432047 30 atime=1454507327.133580417 30 ctime=1454507658.740157877 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/controlpanel/DocumentAdapter.java0000644000175000002070000000567712654402377027663 0ustar00jvanekmock00000000000000/* DocumentAdapter.java -- Updates properties. Copyright (C) 2010 Red Hat This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be 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 this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package net.sourceforge.jnlp.controlpanel; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; import javax.swing.text.BadLocationException; import javax.swing.text.Document; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.util.logging.OutputController; /** * Updates the property as it happens. * * @author Andrew Su (asu@redhat.com, andrew.su@utoronto.ca) * */ public class DocumentAdapter implements DocumentListener { String[] fields; int index; String property; DeploymentConfiguration config; int mode; /** * This creates a new instance of DocumentAdapter. * * @param fields The list of property. * @param index Location of property to modify. */ public DocumentAdapter(String[] fields, int index) { this.fields = fields; this.index = index; mode = 1; } /** * This creates a new instance of DocumentAdapter. This allows modifying * the configuration directly. * * @param config ConfigurationFile containing the properties. * @param property Name of property to modify. */ public DocumentAdapter(DeploymentConfiguration config, String property) { this.property = property; this.config = config; mode = 2; } @Override public void insertUpdate(DocumentEvent e) { update(e); } @Override public void removeUpdate(DocumentEvent e) { update(e); } @Override public void changedUpdate(DocumentEvent e) { } /** * Update the property as on the appropriate items. * * @param e The event that caused the call. */ private void update(DocumentEvent e) { Document d = e.getDocument(); try { String value = d.getText(0, d.getLength()).trim(); value = (value.length() == 0) ? null : value; if (mode == 1) { fields[index] = value; } else if (mode == 2) { config.setProperty(property, value); } } catch (BadLocationException e1) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e1); } } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/controlpanel/PaxHeaders.17941/DesktopShortcutPanel.java0000644000000000000000000000013212654402377030167 xustar0030 mtime=1454507263.277432047 30 atime=1454507327.133580417 30 ctime=1454507658.740157877 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/controlpanel/DesktopShortcutPanel.java0000644000175000002070000001223512654402377030715 0ustar00jvanekmock00000000000000/* DesktopShortcutPanel.java -- Display option for adding desktop shortcut. Copyright (C) 2015 Red Hat This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be 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 this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package net.sourceforge.jnlp.controlpanel; import java.awt.Component; import java.awt.Dimension; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import javax.swing.Box; import javax.swing.JButton; import javax.swing.JComboBox; import javax.swing.JLabel; import javax.swing.SwingUtilities; import net.sourceforge.jnlp.ShortcutDesc; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.controlpanel.desktopintegrationeditor.FreeDesktopIntegrationEditorFrame; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.runtime.Translator; /** * This class provides the panel that allows the user to set whether they want * to create a desktop shortcut for javaws. */ public class DesktopShortcutPanel extends NamedBorderPanel implements ItemListener { private final DeploymentConfiguration config; private FreeDesktopIntegrationEditorFrame integrationManagment; /** * Create a new instance of the desktop shortcut settings panel. * * @param config Loaded DeploymentConfiguration file. */ public DesktopShortcutPanel(DeploymentConfiguration config) { super(Translator.R("CPHeadDesktopIntegration"), new GridBagLayout()); this.config = config; addComponents(); } public static ComboItem deploymentJavawsShortcutToComboItem(String i) { return new ComboItem(ShortcutDesc.deploymentJavawsShortcutToString(i), i); } /** * Add components to panel. */ private void addComponents() { GridBagConstraints c = new GridBagConstraints(); JLabel description = new JLabel("" + Translator.R("CPDesktopIntegrationDescription") + "
    "); JComboBox shortcutComboOptions = new JComboBox<>(); JButton manageIntegrationsButton = new JButton(Translator.R("CPDesktopIntegrationShowIntegrations")); if (JNLPRuntime.isWindows()) { manageIntegrationsButton.setToolTipText(Translator.R("CPDesktopIntegrationLinuxOnly")); manageIntegrationsButton.setEnabled(false); } manageIntegrationsButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { if (integrationManagment == null) { integrationManagment = new FreeDesktopIntegrationEditorFrame(); } integrationManagment.setVisible(true); } }); } }); ComboItem[] items = {deploymentJavawsShortcutToComboItem(ShortcutDesc.CREATE_NEVER), deploymentJavawsShortcutToComboItem(ShortcutDesc.CREATE_ALWAYS), deploymentJavawsShortcutToComboItem(ShortcutDesc.CREATE_ASK_USER), deploymentJavawsShortcutToComboItem(ShortcutDesc.CREATE_ASK_USER_IF_HINTED), deploymentJavawsShortcutToComboItem(ShortcutDesc.CREATE_ALWAYS_IF_HINTED)}; shortcutComboOptions.setActionCommand(DeploymentConfiguration.KEY_CREATE_DESKTOP_SHORTCUT); // The configuration property this combobox affects. for (int j = 0; j < items.length; j++) { shortcutComboOptions.addItem(items[j]); if (config.getProperty(DeploymentConfiguration.KEY_CREATE_DESKTOP_SHORTCUT).equals(items[j].getValue())) { shortcutComboOptions.setSelectedIndex(j); } } shortcutComboOptions.addItemListener(this); c.fill = GridBagConstraints.BOTH; c.weightx = 1; c.gridx = 0; c.gridy = 0; add(description, c); c.gridy = 1; add(shortcutComboOptions, c); c.gridy = 2; add(manageIntegrationsButton, c); // This is to keep it from expanding vertically if resized. Component filler = Box.createRigidArea(new Dimension(1, 1)); c.gridy++; c.weighty = 1; add(filler, c); } @SuppressWarnings("unchecked") public void itemStateChanged(ItemEvent e) { ComboItem c = (ComboItem) e.getItem(); config.setProperty(((JComboBox) e.getSource()).getActionCommand(), c.getValue()); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/controlpanel/PaxHeaders.17941/DebuggingPanel.java0000644000000000000000000000013212654402377026715 xustar0030 mtime=1454507263.276432061 30 atime=1454507327.133580417 30 ctime=1454507658.740157877 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/controlpanel/DebuggingPanel.java0000644000175000002070000002311112654402377027436 0ustar00jvanekmock00000000000000/* DebuggingPanel.java -- Displays and sets options for debugging. Copyright (C) 2010 Red Hat This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be 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 this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package net.sourceforge.jnlp.controlpanel; import java.awt.BorderLayout; import java.awt.Component; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import javax.swing.Box; import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JComboBox; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTextField; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.config.PathsAndFiles; import net.sourceforge.jnlp.runtime.Translator; import net.sourceforge.jnlp.util.logging.LogConfig; /** * This displays the options related to debugging. * * @author Andrew Su (asu@redhat.com, andrew.su@utoronto.ca) * */ public class DebuggingPanel extends NamedBorderPanel implements ItemListener { /** List of properties used by checkboxes in this panel */ public static String[] properties = { DeploymentConfiguration.KEY_ENABLE_LOGGING, DeploymentConfiguration.KEY_ENABLE_LOGGING_HEADERS, DeploymentConfiguration.KEY_ENABLE_LOGGING_TOFILE, DeploymentConfiguration.KEY_ENABLE_LEGACY_LOGBASEDFILELOG, DeploymentConfiguration.KEY_ENABLE_APPLICATION_LOGGING_TOFILE, DeploymentConfiguration.KEY_ENABLE_LOGGING_TOSTREAMS, DeploymentConfiguration.KEY_ENABLE_LOGGING_TOSYSTEMLOG }; private final DeploymentConfiguration config; /** * Create a new instance of the debugging panel. * * @param config * loaded DeploymentConfiguration file. */ public DebuggingPanel(DeploymentConfiguration config) { super(Translator.R("CPHeadDebugging"), new GridBagLayout()); this.config = config; addComponents(); } private void fileLoggingAct(JCheckBox source, JCheckBox... targets) { if (source.isSelected()) { for (JCheckBox target : targets) { target.setEnabled(true); } } else { for (JCheckBox target : targets) { target.setEnabled(false); } } } /** * Add components to panel. */ private void addComponents() { GridBagConstraints c = new GridBagConstraints(); final JLabel debuggingDescription = new JLabel("" + Translator.R("CPDebuggingDescription") + "

    "); final JLabel logsDestinationTitle = new JLabel(Translator.R("CPFilesLogsDestDir")+": "); final JTextField logsDestination = new JTextField(PathsAndFiles.LOG_DIR.getFullPath(config)); logsDestination.getDocument().addDocumentListener(new DocumentListener() { @Override public void insertUpdate(DocumentEvent e) { save(); } @Override public void removeUpdate(DocumentEvent e) { save(); } @Override public void changedUpdate(DocumentEvent e) { save(); } private void save() { PathsAndFiles.LOG_DIR.setValue(logsDestination.getText(), config); } }); final JButton logsDestinationReset = new JButton(Translator.R("CPFilesLogsDestDirResert")); logsDestinationReset.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { logsDestination.setText(PathsAndFiles.LOG_DIR.getDefaultFullPath()); } }); final JCheckBox[] debuggingOptions = { new JCheckBox(Translator.R("DPEnableLogging")), new JCheckBox(Translator.R("DPEnableHeaders")), new JCheckBox(Translator.R("DPEnableFile")), new JCheckBox(Translator.R("DPEnableLegacyFileLog")), new JCheckBox(Translator.R("DPEnableClientAppFileLogging")), new JCheckBox(Translator.R("DPEnableStds")), new JCheckBox(Translator.R("DPEnableSyslog")) }; debuggingOptions[2].addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { fileLoggingAct(debuggingOptions[2], debuggingOptions[3], debuggingOptions[4]); } }); final String[] hints = { (Translator.R("DPEnableLoggingHint")), (Translator.R("DPEnableHeadersHint")), (Translator.R("DPEnableFileHint", LogConfig.getLogConfig().getIcedteaLogDir())), (Translator.R("DPEnableLegacyFileLogHint")), (Translator.R("DPEnableClientAppFileLoggingHint")), (Translator.R("DPEnableStdsHint")), (Translator.R("DPEnableSyslogHint")) }; final ComboItem[] javaConsoleItems = { new ComboItem(Translator.R("DPDisable"), DeploymentConfiguration.CONSOLE_DISABLE), new ComboItem(Translator.R("DPHide"), DeploymentConfiguration.CONSOLE_HIDE), new ComboItem(Translator.R("DPShow"), DeploymentConfiguration.CONSOLE_SHOW), new ComboItem(Translator.R("DPShowPluginOnly"), DeploymentConfiguration.CONSOLE_SHOW_PLUGIN), new ComboItem(Translator.R("DPShowJavawsOnly"), DeploymentConfiguration.CONSOLE_SHOW_JAVAWS) }; JLabel consoleLabel = new JLabel(Translator.R("DPJavaConsole")); JComboBox consoleComboBox = new JComboBox<>(); consoleComboBox.setActionCommand(DeploymentConfiguration.KEY_CONSOLE_STARTUP_MODE); // The property this comboBox affects. JPanel consolePanel = new JPanel(); consolePanel.setLayout(new FlowLayout(FlowLayout.LEADING)); consolePanel.add(consoleLabel); consolePanel.add(consoleComboBox); c.fill = GridBagConstraints.BOTH; c.weightx = 1; c.gridx = 0; c.gridy = 0; add(debuggingDescription, c); /* * Add the items to the panel unless we can not get the values for them. */ for (int i = 0; i < properties.length; i++) { String s = config.getProperty(properties[i]); c.gridy++; if (i == 2) { JLabel space = new JLabel("" + Translator.R("CPDebuggingPossibilites") + ":"); add(space, c); c.gridy++; } //move 5th and 6th checkbox below logsDestination if (i == 3 || i == 4) { c.gridx += 1; if (i == 4) { c.gridy--; } } else { c.gridx = 0; } debuggingOptions[i].setSelected(Boolean.parseBoolean(s)); debuggingOptions[i].setActionCommand(properties[i]); debuggingOptions[i].setToolTipText(hints[i]); debuggingOptions[i].addItemListener(this); add(debuggingOptions[i], c); if (i == 2) { c.gridx++; JPanel resetTitlePanel = new JPanel(new BorderLayout(10, 0)); resetTitlePanel.add(logsDestinationReset, BorderLayout.LINE_START); resetTitlePanel.add(logsDestinationTitle, BorderLayout.LINE_END); add(resetTitlePanel, c); c.gridx++; add(logsDestination, c); c.gridx -= 2; } } for (int j = 0; j < javaConsoleItems.length; j++) { consoleComboBox.addItem(javaConsoleItems[j]); if (config.getProperty(DeploymentConfiguration.KEY_CONSOLE_STARTUP_MODE).equals(javaConsoleItems[j].getValue())) { consoleComboBox.setSelectedIndex(j); } } c.gridy++; consoleComboBox.addItemListener(this); add(consolePanel, c); // pack the bottom so that it doesn't change size if resized. Component filler = Box.createRigidArea(new Dimension(1, 1)); c.gridy++; c.weighty = 1; add(filler, c); fileLoggingAct(debuggingOptions[2], debuggingOptions[3], debuggingOptions[4]); } @Override public void itemStateChanged(ItemEvent e) { Object o = e.getSource(); if (o instanceof JCheckBox) { JCheckBox jcb = (JCheckBox) o; config.setProperty(jcb.getActionCommand(), String.valueOf(jcb.isSelected())); } else if (o instanceof JComboBox) { @SuppressWarnings("unchecked") JComboBox jcb = (JComboBox) o; ComboItem c = (ComboItem) e.getItem(); config.setProperty(jcb.getActionCommand(), c.getValue()); } } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/controlpanel/PaxHeaders.17941/ControlPanel.java0000644000000000000000000000013212654402377026442 xustar0030 mtime=1454507263.276432061 30 atime=1454507327.133580417 30 ctime=1454507658.740157877 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java0000644000175000002070000004015612654402377027173 0ustar00jvanekmock00000000000000/* ControlPanel.java -- Display the control panel for modifying deployment settings. Copyright (C) 2011 Red Hat This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be 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 this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package net.sourceforge.jnlp.controlpanel; import static net.sourceforge.jnlp.runtime.Translator.R; import java.awt.BorderLayout; import java.awt.CardLayout; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.Font; import java.awt.GridLayout; import java.awt.Image; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.IOException; import java.net.URL; import java.util.ArrayList; import java.util.List; import javax.imageio.ImageIO; import javax.naming.ConfigurationException; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JList; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.SwingConstants; import javax.swing.SwingUtilities; import javax.swing.UIManager; import javax.swing.WindowConstants; import javax.swing.border.EmptyBorder; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.config.PathsAndFiles; import net.sourceforge.jnlp.controlpanel.JVMPanel.JvmValidationResult; import net.sourceforge.jnlp.runtime.Translator; import net.sourceforge.jnlp.security.viewer.CertificatePane; import net.sourceforge.jnlp.util.ImageResources; import net.sourceforge.jnlp.util.logging.OutputController; /** * This is the control panel for Java. It provides a GUI for modifying the * deployments.properties file. * * @author Andrew Su (asu@redhat.com, andrew.su@utoronto.ca) * */ public class ControlPanel extends JFrame { private JVMPanel jvmPanel; /** * Class for keeping track of the panels and their associated text. * * @author @author Andrew Su (asu@redhat.com, andrew.su@utoronto.ca) * */ private static class SettingsPanel { final String value; final JPanel panel; public SettingsPanel(String value, JPanel panel) { this.value = value; this.panel = panel; } public JPanel getPanel() { return panel; } @Override public String toString() { return value; } } private DeploymentConfiguration config = null; /** * Creates a new instance of the ControlPanel. * * @param config * Loaded DeploymentsConfiguration file. * */ public ControlPanel(DeploymentConfiguration config) { super(); setTitle(Translator.R("CPHead")); setIconImages(ImageResources.INSTANCE.getApplicationImages()); this.config = config; JPanel topPanel = createTopPanel(); JPanel mainPanel = createMainSettingsPanel(); JPanel buttonPanel = createButtonPanel(); add(topPanel, BorderLayout.PAGE_START); add(mainPanel, BorderLayout.CENTER); add(buttonPanel, BorderLayout.PAGE_END); setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); pack(); } private JPanel createTopPanel() { Font currentFont; JLabel about = new JLabel(R("CPMainDescriptionShort")); currentFont = about.getFont(); about.setFont(currentFont.deriveFont(currentFont.getSize2D() + 2)); currentFont = about.getFont(); about.setFont(currentFont.deriveFont(Font.BOLD)); JLabel description = new JLabel(R("CPMainDescriptionLong")); description.setBorder(new EmptyBorder(2, 0, 2, 0)); JPanel descriptionPanel = new JPanel(new GridLayout(0, 1)); descriptionPanel.setBackground(UIManager.getColor("TextPane.background")); descriptionPanel.add(about); descriptionPanel.add(description); JLabel image = new JLabel(); ClassLoader cl = getClass().getClassLoader(); if (cl == null) { cl = ClassLoader.getSystemClassLoader(); } try { URL imgUrl = cl.getResource("net/sourceforge/jnlp/resources/netx-icon.png"); image.setIcon(new ImageIcon(ImageIO.read(imgUrl))); } catch (IOException e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); } JPanel topPanel = new JPanel(new BorderLayout()); topPanel.setBackground(UIManager.getColor("TextPane.background")); topPanel.add(descriptionPanel, BorderLayout.LINE_START); topPanel.add(image, BorderLayout.LINE_END); topPanel.setBorder(new EmptyBorder(10, 10, 10, 10)); return topPanel; } private int validateJdk() { String s = ControlPanel.this.config.getProperty(DeploymentConfiguration.KEY_JRE_DIR); JvmValidationResult validationResult = JVMPanel.validateJvm(s); if (validationResult.id == JvmValidationResult.STATE.NOT_DIR || validationResult.id == JvmValidationResult.STATE.NOT_VALID_DIR || validationResult.id == JvmValidationResult.STATE.NOT_VALID_JDK) { return JOptionPane.showConfirmDialog(ControlPanel.this, ""+Translator.R("CPJVMNotokMessage1", s)+"
    " + validationResult.formattedText+"
    " + Translator.R("CPJVMNotokMessage2", DeploymentConfiguration.KEY_JRE_DIR, PathsAndFiles.USER_DEPLOYMENT_FILE.getFullPath(config))+"", Translator.R("CPJVMconfirmInvalidJdkTitle"),JOptionPane.OK_CANCEL_OPTION); } return JOptionPane.OK_OPTION; } /** * Creates the "ok" "apply" and "cancel" buttons. * * @return A panel with the "ok" "apply" and "cancel" button. */ private JPanel createButtonPanel() { JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.TRAILING)); List buttons = new ArrayList(); JButton okButton = new JButton(Translator.R("ButOk")); okButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { ControlPanel.this.saveConfiguration(); int validationResult = validateJdk(); if (validationResult!= JOptionPane.OK_OPTION){ return; } ControlPanel.this.dispose(); } }); buttons.add(okButton); JButton applyButton = new JButton(Translator.R("ButApply")); applyButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { ControlPanel.this.saveConfiguration(); int validationResult = validateJdk(); if (validationResult != JOptionPane.OK_OPTION) { int i = JOptionPane.showConfirmDialog(ControlPanel.this, Translator.R("CPJVMconfirmReset"), Translator.R("CPJVMconfirmReset"), JOptionPane.OK_CANCEL_OPTION); if (i == JOptionPane.OK_OPTION) { jvmPanel.resetTestFieldArgumentsExec(); } } } }); buttons.add(applyButton); JButton cancelButton = new JButton(Translator.R("ButCancel")); cancelButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { ControlPanel.this.dispose(); } }); buttons.add(cancelButton); int maxWidth = 0; int maxHeight = 0; for (JButton button : buttons) { maxWidth = Math.max(button.getMinimumSize().width, maxWidth); maxHeight = Math.max(button.getMinimumSize().height, maxHeight); } int wantedWidth = maxWidth + 10; int wantedHeight = maxHeight + 2; for (JButton button : buttons) { button.setPreferredSize(new Dimension(wantedWidth, wantedHeight)); buttonPanel.add(button); } return buttonPanel; } /** * Add the different settings panels to the GUI. * * @return A panel with all the components in place. */ private JPanel createMainSettingsPanel() { jvmPanel = (JVMPanel) createJVMSettingsPanel(); SettingsPanel[] panels = new SettingsPanel[] { new SettingsPanel(Translator.R("CPTabAbout"), createAboutPanel()), new SettingsPanel(Translator.R("CPTabCache"), createCacheSettingsPanel()), new SettingsPanel(Translator.R("CPTabCertificate"), createCertificatesSettingsPanel()), // TODO: This is commented out since this is not implemented yet // new SettingsPanel(Translator.R("CPTabClassLoader"), createClassLoaderSettingsPanel()), new SettingsPanel(Translator.R("CPTabDebugging"), createDebugSettingsPanel()), new SettingsPanel(Translator.R("CPTabDesktopIntegration"), createDesktopSettingsPanel()), new SettingsPanel(Translator.R("CPTabJVMSettings"),jvmPanel), new SettingsPanel(Translator.R("CPTabNetwork"), createNetworkSettingsPanel()), // TODO: This is commented out since this is not implemented yet // new SettingsPanel(Translator.R("CPTabRuntimes"), createRuntimesSettingsPanel()), new SettingsPanel(Translator.R("CPTabSecurity"), createSecuritySettingsPanel()), //todo refactor to work with tmp file and apply as asu designed it new SettingsPanel(Translator.R("CPTabPolicy"), createPolicySettingsPanel()), new SettingsPanel(Translator.R("APPEXTSECControlPanelExtendedAppletSecurityTitle"), new UnsignedAppletsTrustingListPanel(PathsAndFiles.APPLET_TRUST_SETTINGS_SYS.getFile(), PathsAndFiles.APPLET_TRUST_SETTINGS_USER.getFile(), this.config)) }; // Add panels. final JPanel settingsPanel = new JPanel(new CardLayout()); // Calculate largest minimum size we should use. int height = 0; int width = 0; for (SettingsPanel panel : panels) { JPanel p = panel.getPanel(); Dimension d = p.getMinimumSize(); if (d.height > height) { height = d.height; } if (d.width > width) { width = d.width; } } Dimension dim = new Dimension(width, height); for (SettingsPanel panel : panels) { JPanel p = panel.getPanel(); p.setPreferredSize(dim); settingsPanel.add(p, panel.toString()); } final JList settingsList = new JList<>(panels); settingsList.addListSelectionListener(new ListSelectionListener() { @Override public void valueChanged(ListSelectionEvent e) { @SuppressWarnings("unchecked") JList list = (JList) e.getSource(); SettingsPanel panel = list.getSelectedValue(); CardLayout cl = (CardLayout) settingsPanel.getLayout(); cl.show(settingsPanel, panel.toString()); } }); JScrollPane settingsListScrollPane = new JScrollPane(settingsList); settingsListScrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); final JPanel settingsDetailPanel = new JPanel(); settingsDetailPanel.setLayout(new BorderLayout()); settingsDetailPanel.add(settingsPanel, BorderLayout.CENTER); settingsDetailPanel.setBorder(new EmptyBorder(0, 5, -3, 0)); JPanel mainPanel = new JPanel(new BorderLayout()); mainPanel.add(settingsListScrollPane, BorderLayout.LINE_START); mainPanel.add(settingsDetailPanel, BorderLayout.CENTER); mainPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); settingsList.setSelectedIndex(0); return mainPanel; } private JPanel createAboutPanel() { return new AboutPanel(); } private JPanel createCacheSettingsPanel() { return new TemporaryInternetFilesPanel(this.config); } private JPanel createCertificatesSettingsPanel() { JPanel p = new NamedBorderPanel(Translator.R("CPHeadCertificates"), new BorderLayout()); p.add(new CertificatePane(null), BorderLayout.CENTER); return p; } private JPanel createClassLoaderSettingsPanel() { return createNotImplementedPanel(); } private JPanel createDebugSettingsPanel() { return new DebuggingPanel(this.config); } private JPanel createDesktopSettingsPanel() { return new DesktopShortcutPanel(this.config); } private JPanel createNetworkSettingsPanel() { return new NetworkSettingsPanel(this.config); } private JPanel createRuntimesSettingsPanel() { return new JREPanel(); } private JPanel createSecuritySettingsPanel() { return new SecuritySettingsPanel(this.config); } private JPanel createPolicySettingsPanel() { return new PolicyPanel(this, this.config); } private JPanel createJVMSettingsPanel() { return new JVMPanel(this.config); } /** * This is a placeholder panel. * * @return a placeholder panel * @see JPanel */ private JPanel createNotImplementedPanel() { JPanel notImplementedPanel = new NamedBorderPanel("Unimplemented"); notImplementedPanel.setLayout(new BorderLayout()); ClassLoader cl = getClass().getClassLoader(); if (cl == null) { cl = ClassLoader.getSystemClassLoader(); } URL imgUrl = cl.getResource("net/sourceforge/jnlp/resources/warning.png"); Image img; try { img = ImageIO.read(imgUrl); ImageIcon icon = new ImageIcon(img); JLabel label = new JLabel("Not Implemented", icon, SwingConstants.CENTER); notImplementedPanel.add(label); } catch (IOException e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); } return notImplementedPanel; } /** * Save the configuration changes. */ private void saveConfiguration() { try { config.save(); } catch (IOException e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); JOptionPane.showMessageDialog(this, e); } } public static void main(String[] args) throws Exception { DeploymentConfiguration.move14AndOlderFilesTo15StructureCatched(); final DeploymentConfiguration config = new DeploymentConfiguration(); try { config.load(); } catch (ConfigurationException e) { // FIXME inform user about this and exit properly // the only known condition under which this can happen is when a // required system configuration file is not found // if configuration is not loaded, we will get NullPointerExceptions // everywhere OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); } try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Exception e) { // ignore; not a big deal } SwingUtilities.invokeLater(new Runnable() { @Override public void run() { final ControlPanel editor = new ControlPanel(config); editor.setVisible(true); } }); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/controlpanel/PaxHeaders.17941/CommandLine.java0000644000000000000000000000013112654402377026227 xustar0030 mtime=1454507263.276432061 29 atime=1454507327.13258043 30 ctime=1454507658.740157877 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/controlpanel/CommandLine.java0000644000175000002070000004522512654402377026763 0ustar00jvanekmock00000000000000/* CommandLine.java -- command line interface to icedtea-web's deployment settings. Copyright (C) 2010 Red Hat This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be 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 this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package net.sourceforge.jnlp.controlpanel; import static net.sourceforge.jnlp.runtime.Translator.R; import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.Map; import javax.naming.ConfigurationException; import net.sourceforge.jnlp.config.ConfiguratonValidator; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.OptionsDefinitions; import net.sourceforge.jnlp.config.Setting; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.util.docprovider.ItwebSettingsTextsProvider; import net.sourceforge.jnlp.util.docprovider.TextsProvider; import net.sourceforge.jnlp.util.docprovider.formatters.formatters.PlainTextFormatter; import net.sourceforge.jnlp.util.logging.OutputController; import net.sourceforge.jnlp.util.optionparser.OptionParser; /** * Encapsulates a command line interface to the deployment configuration. *

    * The central method is {@link #handle()}, which calls one of the * various 'handle' methods. The commands listed in OptionsDefinitions.getItwsettingsCommands * are supported. For each supported command, a method handleCOMMANDCommand exists. * This method actually takes action based on the command. Generally, a * printCOMMANDHelp method also exists, and prints out the help message for * that specific command. For example, see {@link #handleListCommand()} * and {@link #printListHelp()}. *

    * Sample usage: *
    
     * CommandLine cli = new CommandLine();
     * // the string array represents input using the command line
     * int retVal = cli.handle(new String[] { "help" });
     * if (retVal == CommandLine.SUCCESS) {
     *    // good!
     * } else {
     *    // bad!
     * }
     * 
    * * @author Omair Majid */ public class CommandLine { public static final int ERROR = 1; public static final int SUCCESS = 0; public final String PROGRAM_NAME; private OptionParser optionParser; DeploymentConfiguration config = null; /** * Creates a new instance * @param optionParser used to parse applications arguments */ public CommandLine(OptionParser optionParser) { this.optionParser = optionParser; PROGRAM_NAME = System.getProperty("icedtea-web.bin.name"); config = new DeploymentConfiguration(); try { config.load(false); } catch (ConfigurationException e) { OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, R("RConfigurationFatal")); OutputController.getLogger().log(e); } } /** * Handle the 'help' command * * @return the result of handling the help command. SUCCESS if no errors occurred. */ public int handleHelpCommand() { final TextsProvider helpMessagesProvider = new ItwebSettingsTextsProvider("utf-8", new PlainTextFormatter(), true, true); String helpMessage = "\n"; if (JNLPRuntime.isDebug()) { helpMessage = helpMessage + helpMessagesProvider.writeToString(); } else { helpMessage = helpMessage + helpMessagesProvider.prepare().getSynopsis() + helpMessagesProvider.getFormatter().getNewLine() + helpMessagesProvider.prepare().getDescription() + helpMessagesProvider.getFormatter().getNewLine() + helpMessagesProvider.prepare().getCommands() + helpMessagesProvider.getFormatter().getNewLine(); } OutputController.getLogger().printOut(helpMessage); return SUCCESS; } /** * Prints help message for the list command */ public void printListHelp() { OutputController.getLogger().printOutLn(R("Usage")); OutputController.getLogger().printOutLn(" " + PROGRAM_NAME + " list [--details]"); OutputController.getLogger().printOutLn(R("CLListDescription")); } /** * Handles the 'list' command * * @return result of handling the command. SUCCESS if no errors occurred. */ public int handleListCommand() { if (optionParser.hasOption(OptionsDefinitions.OPTIONS.HELP2)) { printListHelp(); return SUCCESS; } if (optionParser.getMainArgs().contains("details") || optionParser.getMainArgs().contains("verbose")) { JNLPRuntime.setDebug(true); } Map> all = config.getRaw(); for (String key : all.keySet()) { Setting value = all.get(key); OutputController.getLogger().printOutLn(key + ": " + value.getValue()); if (JNLPRuntime.isDebug()) { OutputController.getLogger().printOutLn("\t" + R("CLDescription", value.getDescription())); } } return SUCCESS; } /** * Prints help message for the get command */ public void printGetHelp() { OutputController.getLogger().printOutLn(R("Usage")); OutputController.getLogger().printOutLn(" " + PROGRAM_NAME + " get property-name"); OutputController.getLogger().printOutLn(R("CLGetDescription")); } /** * Handles the 'get' command. * * @return an integer representing success (SUCCESS) or error handling the * get command. */ public int handleGetCommand() { if (optionParser.hasOption(OptionsDefinitions.OPTIONS.HELP2)) { printGetHelp(); return SUCCESS; } List args = optionParser.getParams(OptionsDefinitions.OPTIONS.GET); Map> all = config.getRaw(); List unknownProperties = new ArrayList<>(args); unknownProperties.removeAll(all.keySet()); if (unknownProperties.size() > 0) { for (String property : unknownProperties) { OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, R("CLUnknownProperty", property)); } return ERROR; } for (String key : args) { String value = all.get(key).getValue(); OutputController.getLogger().printOutLn(key+": "+value); } return SUCCESS; } /** * Prints the help message for the 'set' command */ public void printSetHelp() { OutputController.getLogger().printOutLn(R("Usage")); OutputController.getLogger().printOutLn(" " + PROGRAM_NAME + " set property-name value"); OutputController.getLogger().printOutLn(R("CLSetDescription")); } /** * Handles the 'set' command * * @return an integer indicating success (SUCCESS) or error in handling * the command */ public int handleSetCommand() { if (optionParser.hasOption(OptionsDefinitions.OPTIONS.HELP2)) { printSetHelp(); return SUCCESS; } List args = optionParser.getParams(OptionsDefinitions.OPTIONS.SET); String key = null; String value; boolean isArgKey = false; for (String arg : args) { isArgKey = !isArgKey; if (isArgKey) { key = arg; continue; } value = arg; if (configContains(key)) { if (validateValue(key, value) == ERROR) { return ERROR; } config.setProperty(key, value); } else { OutputController.getLogger().printOutLn(R("CLWarningUnknownProperty", key)); config.setProperty(key, value); } } try { config.save(); } catch (IOException e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); return ERROR; } return SUCCESS; } private boolean configContains(final String arg) { return config.getRaw().containsKey(arg); } private int validateValue(final String key, final String value) { Setting old = config.getRaw().get(key); if (old.getValidator() != null) { try { old.getValidator().validate(value); } catch (IllegalArgumentException e) { OutputController.getLogger().log(OutputController.Level.WARNING_ALL, R("CLIncorrectValue", old.getName(), value, old.getValidator().getPossibleValues())); OutputController.getLogger().log(e); return ERROR; } } return SUCCESS; } /** * Prints a help message for the reset command */ public void printResetHelp() { OutputController.getLogger().printOutLn(R("Usage")); OutputController.getLogger().printOutLn(" " + PROGRAM_NAME + " reset [all|property-name]"); OutputController.getLogger().printOutLn(R("CLResetDescription")); } /** * Handles the 'reset' command * * @return an integer indicating success (SUCCESS) or error in handling * the command */ public int handleResetCommand() { if (optionParser.hasOption(OptionsDefinitions.OPTIONS.HELP2)) { printResetHelp(); return SUCCESS; } List args = optionParser.getParams(OptionsDefinitions.OPTIONS.RESET); boolean resetAll = false; if (args.contains("all")) { resetAll = true; if (args.size() > 1) { for (String arg : args) { if (!arg.equals("all")) { OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, R("CLUnknownCommand", arg)); } } } } Map> all = config.getRaw(); if (resetAll) { for (String aKey: all.keySet()) { Setting setting = all.get(aKey); setting.setValue(setting.getDefaultValue()); } } else { for (String key : args) { if (!all.containsKey(key)) { OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, R("CLUnknownProperty", key)); return ERROR; } else { Setting setting = all.get(key); setting.setValue(setting.getDefaultValue()); } } } try { config.save(); } catch (IOException e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); return ERROR; } return SUCCESS; } /** * Print a help message for the 'info' command */ public void printInfoHelp() { OutputController.getLogger().printOutLn(R("Usage")); OutputController.getLogger().printOutLn(" " + PROGRAM_NAME + " info property-name"); OutputController.getLogger().printOutLn(R("CLInfoDescription")); } /** * Handles the 'info' command * * @return an integer indicating success (SUCCESS) or error in handling * the command */ public int handleInfoCommand() { if (optionParser.hasOption(OptionsDefinitions.OPTIONS.HELP2)) { printInfoHelp(); return SUCCESS; } List args = optionParser.getParams(OptionsDefinitions.OPTIONS.INFO); Map> all = config.getRaw(); for (String key : args) { Setting value = all.get(key); if (value == null) { OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, R("CLNoInfo")); } else { OutputController.getLogger().printOutLn(R("CLDescription", value.getDescription())); OutputController.getLogger().printOutLn(R("CLValue", value.getValue())); if (value.getValidator() != null) { OutputController.getLogger().printOutLn("\t" + R("VVPossibleValues", value.getValidator().getPossibleValues())); } OutputController.getLogger().printOutLn(R("CLValueSource", value.getSource())); } } return SUCCESS; } /** * Prints a help message for the 'check' command */ public void printCheckHelp() { OutputController.getLogger().printOutLn(R("Usage")); OutputController.getLogger().printOutLn(" " + PROGRAM_NAME + " check"); OutputController.getLogger().printOutLn(R("CLCheckDescription")); } /** * Handles the 'check' command * * @return an integer indicating success (SUCCESS) or error in handling * the command */ public int handleCheckCommand() { if (optionParser.hasOption(OptionsDefinitions.OPTIONS.HELP2)) { printCheckHelp(); return SUCCESS; } List args = optionParser.getParams(OptionsDefinitions.OPTIONS.CHECK); if (!args.isEmpty()) { printCheckHelp(); return ERROR; } Map> all = config.getRaw(); ConfiguratonValidator validator = new ConfiguratonValidator(all); validator.validate(); boolean allValid = true; for (Setting setting : validator.getIncorrectSetting()) { OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, R("CLIncorrectValue", setting.getName(), setting.getValue(), setting.getValidator().getPossibleValues())); allValid = false; } for (Setting setting : validator.getUnrecognizedSetting()) { OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, R("CLUnknownProperty", setting.getName())); allValid = false; } if (allValid) { OutputController.getLogger().printOutLn(R("CLNoIssuesFound")); return SUCCESS; } else { return ERROR; } } /** * Handles overall command line arguments. The argument array is split * into two pieces: the first element is assumend to be the command, and * everything after is taken to be the argument to the command. * * @return an integer representing an error code or SUCCESS if no problems * occurred. */ public int handle() { int val; if (hasUnrecognizedCommands()) { for (String unknown : optionParser.getMainArgs()) { OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, R("CLUnknownCommand", unknown)); } handleHelpCommand(); val = ERROR; } else if (getNumberOfOptions() > 1) { OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, R("CLUnexpectedNumberOfCommands")); val = handleHelpCommand(); } else if (optionParser.hasOption(OptionsDefinitions.OPTIONS.LIST)) { val = handleListCommand(); } else if (optionParser.hasOption(OptionsDefinitions.OPTIONS.SET)) { val = handleSetCommand(); } else if (optionParser.hasOption(OptionsDefinitions.OPTIONS.RESET)) { val = handleResetCommand(); } else if (optionParser.hasOption(OptionsDefinitions.OPTIONS.GET)) { val = handleGetCommand(); } else if (optionParser.hasOption(OptionsDefinitions.OPTIONS.INFO)) { val = handleInfoCommand(); } else if (optionParser.hasOption(OptionsDefinitions.OPTIONS.CHECK)) { val = handleCheckCommand(); } else if (optionParser.hasOption(OptionsDefinitions.OPTIONS.HELP2)) { val = handleHelpCommand(); } else { handleHelpCommand(); val = ERROR; } return val; } private boolean hasUnrecognizedCommands() { int size = optionParser.getMainArgs().size(); return !(isDetailsValid()) && size > 0; } private boolean isDetailsValid() { int size = optionParser.getMainArgs().size(); return (optionParser.getMainArgs().contains("details") && size == 1 && optionParser.hasOption(OptionsDefinitions.OPTIONS.LIST) && getNumberOfOptions() == 1); } private int getNumberOfOptions() { int number = optionParser.getNumberOfOptions(); if (optionParser.hasOption(OptionsDefinitions.OPTIONS.HELP2)) { number--; } if (optionParser.hasOption(OptionsDefinitions.OPTIONS.VERBOSE)) { number--; } if (optionParser.hasOption(OptionsDefinitions.OPTIONS.HEADLESS)) { number--; } return number; } /** * The starting point of the program * @param args the command line arguments to this program * @throws java.lang.Exception when it goes wrong */ public static void main(String[] args) throws Exception { try { OptionParser optionParser = new OptionParser(args, OptionsDefinitions.getItwsettingsCommands()); if (optionParser.hasOption(OptionsDefinitions.OPTIONS.DETAILS) || optionParser.hasOption(OptionsDefinitions.OPTIONS.VERBOSE)){ JNLPRuntime.setDebug(true); } if (optionParser.hasOption(OptionsDefinitions.OPTIONS.HEADLESS)) { JNLPRuntime.setHeadless(true); } DeploymentConfiguration.move14AndOlderFilesTo15StructureCatched(); if (args.length == 0) { ControlPanel.main(new String[] {}); } else { CommandLine cli = new CommandLine(optionParser); int result = cli.handle(); // instead of returning, use JNLPRuntime.exit() so we can pass back // error codes indicating success or failure. Otherwise using // this program for scripting will become much more challenging JNLPRuntime.exit(result); } } catch (Exception e) { OutputController.getLogger().log(OutputController.Level.WARNING_ALL, e); JNLPRuntime.exit(1); } } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/controlpanel/PaxHeaders.17941/ComboItem.java0000644000000000000000000000013012654402377025716 xustar0030 mtime=1454507263.275432074 29 atime=1454507327.13258043 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/controlpanel/ComboItem.java0000644000175000002070000000320712654402377026445 0ustar00jvanekmock00000000000000/* ComboItem.java -- Allow storage of an item whose name differs from its value. Copyright (C) 2010 Red Hat This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be 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 this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package net.sourceforge.jnlp.controlpanel; /** * This is to be used with combobox items. Allows storing a value which differs * from the key. * * @author Andrew Su (asu@redhat.com, andrew.su@utoronto.ca) * */ public class ComboItem { String text = null; private String value; // Value to be compared with. /** * Create a new instance of combobox items. * * @param text * Text to be displayed by JComboBox * @param value * Value associated with this item. */ public ComboItem(String text, String value) { this.text = text; this.value = value; } public String toString() { return this.text; } /** * Get the value associated with this item. * * @return Associated value. */ public String getValue() { return this.value; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/controlpanel/PaxHeaders.17941/CacheViewer.java0000644000000000000000000000013012654402377026225 xustar0030 mtime=1454507263.275432074 29 atime=1454507327.13258043 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/controlpanel/CacheViewer.java0000644000175000002070000001256712654402377026765 0ustar00jvanekmock00000000000000/* CacheViewer.java -- Display the GUI for viewing and deleting cache files. Copyright (C) 2013 Red Hat This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be 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 this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package net.sourceforge.jnlp.controlpanel; import java.awt.Container; import java.awt.Frame; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.KeyEventDispatcher; import java.awt.KeyboardFocusManager; import java.awt.Toolkit; import java.awt.event.KeyEvent; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import javax.swing.JDialog; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.Translator; import net.sourceforge.jnlp.util.ImageResources; import net.sourceforge.jnlp.util.ScreenFinder; /** * This class will provide a visual way of viewing cache. * * @author Andrew Su (asu@redhat.com, andrew.su@utoronto.ca) * */ public class CacheViewer extends JDialog { private boolean initialized = false; private static final String dialogTitle = Translator.R("CVCPDialogTitle"); private final DeploymentConfiguration config; // Configuration file which contains all the settings. CachePane topPanel; /** * Creates a new instance of the cache viewer. * * @param config Deployment configuration file. */ public CacheViewer(DeploymentConfiguration config) { super((Frame) null, dialogTitle, true); // Don't need a parent. this.config = config; if (config == null) { throw new IllegalArgumentException("config: " + config); } setIconImages(ImageResources.INSTANCE.getApplicationImages()); /* Prepare for adding components to dialog box */ Container contentPane = getContentPane(); contentPane.setLayout(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); c.fill = GridBagConstraints.BOTH; c.weightx = 1; c.weighty = 1; c.gridx = 0; c.gridy = 0; topPanel = new CachePane(this, this.config); contentPane.add(topPanel, c); pack(); this.topPanel.invokeLaterPopulateTable(); /* Set focus to default button when first activated */ WindowAdapter adapter = new WindowAdapter() { private boolean gotFocus = false; @Override public void windowGainedFocus(WindowEvent we) { // Once window gets focus, set initial focus if (!gotFocus) { topPanel.focusOnDefaultButton(); gotFocus = true; } } }; addWindowFocusListener(adapter); // Add a KeyEventDispatcher to dispatch events when this CacheViewer has focus final CacheViewer cacheViewer = this; KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher(new KeyEventDispatcher() { /** * Dispatches mainly the {@code KeyEvent.VK_ESCAPE} key event to * close the {@code CacheViewer} dialog. * @return {@code true} after an {@link KeyEvent#VK_ESCAPE * VK_ESCAPE} has been processed, otherwise {@code false} * @see KeyEventDispatcher */ public boolean dispatchKeyEvent(final KeyEvent keyEvent) { // Check if Esc key has been pressed if (keyEvent.getKeyCode() == KeyEvent.VK_ESCAPE && keyEvent.getID() == KeyEvent.KEY_PRESSED) { // Exclude this key event from further processing keyEvent.consume(); // Remove this low-level KeyEventDispatcher KeyboardFocusManager.getCurrentKeyboardFocusManager().removeKeyEventDispatcher(this); // Post close event to CacheViewer dialog Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent( new WindowEvent(cacheViewer, WindowEvent.WINDOW_CLOSING)); return true; } return false; } }); initialized = true; } /** * Display the cache viewer. * * @param config Configuration file. */ public static void showCacheDialog(final DeploymentConfiguration config) { CacheViewer psd = new CacheViewer(config); psd.setResizable(true); psd.centerDialog(); psd.setVisible(true); psd.dispose(); } /** * Check whether the dialog has finished being created. * * @return True if dialog is ready to be displayed. */ public boolean isInitialized() { return initialized; } /** * Center the dialog box. */ private void centerDialog() { ScreenFinder.centerWindowsToCurrentScreen(this); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/controlpanel/PaxHeaders.17941/CachePane.java0000644000000000000000000000013012654402377025647 xustar0030 mtime=1454507263.274432088 29 atime=1454507327.13258043 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/controlpanel/CachePane.java0000644000175000002070000004645112654402377026406 0ustar00jvanekmock00000000000000/* CachePane.java -- Displays the specified folder and allows modification to its content. Copyright (C) 2013 Red Hat This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be 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 this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package net.sourceforge.jnlp.controlpanel; import java.awt.BorderLayout; import java.awt.Component; import java.awt.Cursor; import java.awt.Dimension; import java.awt.EventQueue; import java.awt.FlowLayout; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.GridLayout; import java.awt.SystemColor; import java.awt.Toolkit; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.WindowEvent; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.nio.channels.FileLock; import java.text.DateFormat; import java.text.NumberFormat; import java.util.ArrayList; import java.util.Comparator; import java.util.Date; import java.util.Enumeration; import java.util.List; import javax.swing.JButton; import javax.swing.JComponent; import javax.swing.JDialog; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.ListSelectionModel; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import javax.swing.table.DefaultTableCellRenderer; import javax.swing.table.TableModel; import javax.swing.table.TableRowSorter; import net.sourceforge.jnlp.cache.CacheDirectory; import net.sourceforge.jnlp.cache.CacheUtil; import net.sourceforge.jnlp.cache.DirectoryNode; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.config.PathsAndFiles; import net.sourceforge.jnlp.runtime.Translator; import net.sourceforge.jnlp.util.FileUtils; import net.sourceforge.jnlp.util.PropertiesFile; import net.sourceforge.jnlp.util.logging.OutputController; import net.sourceforge.jnlp.util.ui.NonEditableTableModel; public class CachePane extends JPanel { final JDialog parent; final DeploymentConfiguration config; private final String location; private JComponent defaultFocusComponent; DirectoryNode root; String[] columns = { Translator.R("CVCPColName"), Translator.R("CVCPColPath"), Translator.R("CVCPColType"), Translator.R("CVCPColDomain"), Translator.R("CVCPColSize"), Translator.R("CVCPColLastModified") }; JTable cacheTable; private JButton deleteButton, refreshButton, doneButton, cleanAll; /** * Creates a new instance of the CachePane. * * @param parent The parent dialog that uses this pane. * @param config configuration tobe worked on */ public CachePane(JDialog parent, DeploymentConfiguration config) { super(new BorderLayout()); this.parent = parent; this.config = config; location = PathsAndFiles.CACHE_DIR.getFullPath(config); addComponents(); } /** * Add components to the pane. */ private void addComponents() { JPanel topPanel = new JPanel(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); c.fill = GridBagConstraints.BOTH; TableModel model = new NonEditableTableModel(columns, 0); cacheTable = new JTable(model); cacheTable.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION); cacheTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() { @Override final public void valueChanged(ListSelectionEvent listSelectionEvent) { // If no row has been selected, disable the delete button, else enable it if (cacheTable.getSelectionModel().isSelectionEmpty()) { deleteButton.setEnabled(false); } else { deleteButton.setEnabled(true); } } }); cacheTable.setAutoResizeMode(JTable.AUTO_RESIZE_NEXT_COLUMN); cacheTable.setPreferredScrollableViewportSize(new Dimension(600, 200)); cacheTable.setFillsViewportHeight(true); JScrollPane scrollPane = new JScrollPane(cacheTable); TableRowSorter tableSorter = new TableRowSorter<>(model); final Comparator> comparator = new Comparator>() { // General purpose Comparator @Override @SuppressWarnings("unchecked") public final int compare(final Comparable a, final Comparable b) { return a.compareTo(b); } }; tableSorter.setComparator(1, comparator); // Comparator for path column. tableSorter.setComparator(4, comparator); // Comparator for size column. tableSorter.setComparator(5, comparator); // Comparator for modified column. cacheTable.setRowSorter(tableSorter); final DefaultTableCellRenderer tableCellRenderer = new DefaultTableCellRenderer() { @Override public final Component getTableCellRendererComponent(final JTable table, final Object value, final boolean isSelected, final boolean hasFocus, final int row, final int column) { super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); switch (column) { case 1: // Path column // Render absolute path super.setText(((File)value).getAbsolutePath()); break; case 4: // Size column // Render size formatted to default locale's number format super.setText(NumberFormat.getInstance().format(value)); break; case 5: // last modified column // Render modify date formatted to default locale's date format super.setText(DateFormat.getDateInstance().format(value)); } return this; } }; // TableCellRenderer for path column cacheTable.getColumn(this.columns[1]).setCellRenderer(tableCellRenderer); // TableCellRenderer for size column cacheTable.getColumn(this.columns[4]).setCellRenderer(tableCellRenderer); // TableCellRenderer for last modified column cacheTable.getColumn(this.columns[5]).setCellRenderer(tableCellRenderer); c.weightx = 1; c.weighty = 1; c.gridx = 0; c.gridy = 0; topPanel.add(scrollPane, c); this.add(topPanel, BorderLayout.CENTER); this.add(createButtonPanel(), BorderLayout.SOUTH); } /** * Create the buttons panel. * * @return JPanel containing the buttons. */ private Component createButtonPanel() { JPanel buttonPanel = new JPanel(new GridLayout(1, 0)); JPanel leftPanel = new JPanel(new FlowLayout(FlowLayout.LEADING)); JPanel rightPanel = new JPanel(new FlowLayout(FlowLayout.TRAILING)); List buttons = new ArrayList<>(); this.deleteButton = new JButton(Translator.R("CVCPButDelete")); deleteButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { disableButtons(); // Delete on AWT thread after this action has been performed // in order to allow the cache viewer to update itself invokeLaterDelete(); } }); deleteButton.setEnabled(false); buttons.add(deleteButton); this.cleanAll = new JButton(Translator.R("CVCPCleanCache")); cleanAll.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { disableButtons(); // Delete on AWT thread after this action has been performed // in order to allow the cache viewer to update itself invokeLaterDeleteAll(); } }); buttons.add(cleanAll); this.refreshButton = new JButton(Translator.R("CVCPButRefresh")); refreshButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { disableButtons(); // Populate cacheTable on AWT thread after this action event has been performed invokeLaterPopulateTable(); } }); refreshButton.setEnabled(false); buttons.add(refreshButton); this.doneButton = new JButton(Translator.R("ButDone")); doneButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent( new WindowEvent(parent, WindowEvent.WINDOW_CLOSING)); } }); int maxWidth = 0; int maxHeight = 0; for (JButton button : buttons) { maxWidth = Math.max(button.getMinimumSize().width, maxWidth); maxHeight = Math.max(button.getMinimumSize().height, maxHeight); } int wantedWidth = maxWidth + 10; int wantedHeight = maxHeight; for (JButton button : buttons) { button.setPreferredSize(new Dimension(wantedWidth, wantedHeight)); leftPanel.add(button); } doneButton.setPreferredSize(new Dimension(wantedWidth, wantedHeight)); doneButton.setEnabled(false); rightPanel.add(doneButton); buttonPanel.add(leftPanel); buttonPanel.add(rightPanel); return buttonPanel; } /** * Posts an event to the event queue to delete the currently selected * resource in {@link CachePane#cacheTable} after the {@code CachePane} and * {@link CacheViewer} have been instantiated and painted. * @see CachePane#cacheTable */ private void invokeLaterDelete() { EventQueue.invokeLater(new Runnable() { @Override public void run() { try { FileLock fl = null; File netxRunningFile = new File(PathsAndFiles.MAIN_LOCK.getFullPath(config)); if (!netxRunningFile.exists()) { try { FileUtils.createParentDir(netxRunningFile); FileUtils.createRestrictedFile(netxRunningFile, true); } catch (IOException e1) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e1); } } try { fl = FileUtils.getFileLock(netxRunningFile.getPath(), false, false); } catch (FileNotFoundException e1) { } int row = cacheTable.getSelectedRow(); try { if (fl == null) { JOptionPane.showMessageDialog(parent, Translator.R("CCannotClearCache")); return; } int modelRow = cacheTable.convertRowIndexToModel(row); DirectoryNode fileNode = ((DirectoryNode) cacheTable.getModel().getValueAt(modelRow, 0)); if (fileNode.getFile().delete()) { updateRecentlyUsed(fileNode.getFile()); fileNode.getParent().removeChild(fileNode); FileUtils.deleteWithErrMesg(fileNode.getInfoFile()); ((NonEditableTableModel) cacheTable.getModel()).removeRow(modelRow); cacheTable.getSelectionModel().clearSelection(); CacheDirectory.cleanParent(fileNode); } } catch (Exception exception) { // ignore } if (fl != null) { try { fl.release(); fl.channel().close(); } catch (IOException e1) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e1); } } } catch (Exception exception) { OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, exception); } finally { restoreDisabled(); } } private void updateRecentlyUsed(File f) { File recentlyUsedFile = new File(PathsAndFiles.getRecentlyUsedFile().getFullPath(config)); PropertiesFile pf = new PropertiesFile(recentlyUsedFile); pf.load(); Enumeration en = pf.keys(); while (en.hasMoreElements()) { String key = (String) en.nextElement(); if (pf.get(key).equals(f.getAbsolutePath())) { pf.remove(key); } } pf.store(); } }); } private void invokeLaterDeleteAll() { EventQueue.invokeLater(new Runnable() { @Override public void run() { try { visualCleanCache(parent); populateTable(); } catch (Exception exception) { OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, exception); } finally { restoreDisabled(); } } }); } /** * Posts an event to the event queue to populate the * {@link CachePane#cacheTable} after the {@code CachePane} and * {@link CacheViewer} have been instantiated and painted. * @see CachePane#populateTable */ final void invokeLaterPopulateTable() { EventQueue.invokeLater(new Runnable() { @Override public void run() { try { populateTable(); // Disable cacheTable when no data to display, so no events are generated if (cacheTable.getModel().getRowCount() == 0) { cacheTable.setEnabled(false); cacheTable.setBackground(SystemColor.control); // No data in cacheTable, so nothing to delete deleteButton.setEnabled(false); } else { cacheTable.setEnabled(true); cacheTable.setBackground(SystemColor.text); } } catch (Exception exception) { OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, exception); } finally { refreshButton.setEnabled(true); doneButton.setEnabled(true); cleanAll.setEnabled(true); } } }); } /** * Populate the table with fresh data. Any manual updates to the cache * directory will be updated in the table. */ private void populateTable() { try { // Populating the cacheTable may take a while, so indicate busy by cursor parent.getContentPane().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); NonEditableTableModel tableModel; (tableModel = (NonEditableTableModel)cacheTable.getModel()).setRowCount(0); //Clears the table for (Object[] v : generateData(root)) { tableModel.addRow(v); } } catch (Exception exception) { OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, exception); } finally { // Reset cursor parent.getContentPane().setCursor(Cursor.getDefaultCursor()); } } /** * This creates the data for the table. * * @param root The location of cache data. * @return ArrayList containing an Object array of data for each row in the table. */ private ArrayList generateData(DirectoryNode root) { root = new DirectoryNode("Root", location, null); CacheDirectory.getDirStructure(root); ArrayList data = new ArrayList<>(); for (DirectoryNode identifier : root.getChildren()) { for (DirectoryNode type : identifier.getChildren()) { for (DirectoryNode domain : type.getChildren()) { for (DirectoryNode leaf : CacheDirectory.getLeafData(domain)) { final File f = leaf.getFile(); Object[] o = { leaf, f.getParentFile(), type, domain, f.length(), new Date(f.lastModified()) }; data.add(o); } } } } return data; } /** * Put focus onto default button. */ public void focusOnDefaultButton() { if (defaultFocusComponent != null) { defaultFocusComponent.requestFocusInWindow(); } } public void disableButtons() { // may take a while, so indicate busy by cursor parent.getContentPane().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); // Disable dialog and buttons while operating deleteButton.setEnabled(false); refreshButton.setEnabled(false); doneButton.setEnabled(false); cleanAll.setEnabled(false); } public void restoreDisabled() { cleanAll.setEnabled(true); // If nothing selected then keep deleteButton disabled if (!cacheTable.getSelectionModel().isSelectionEmpty()) { deleteButton.setEnabled(true); } // Enable buttons refreshButton.setEnabled(true); doneButton.setEnabled(true); // If cacheTable is empty disable it and set background // color to indicate being disabled if (cacheTable.getModel().getRowCount() == 0) { cacheTable.setEnabled(false); cacheTable.setBackground(SystemColor.control); } // Reset cursor parent.getContentPane().setCursor(Cursor.getDefaultCursor()); } public static void visualCleanCache(Component parent) { try { boolean success = CacheUtil.clearCache(); if (!success) { JOptionPane.showMessageDialog(parent, Translator.R("CCannotClearCache")); } } catch (Exception ex) { JOptionPane.showMessageDialog(parent, Translator.R("CCannotClearCache")); } } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/controlpanel/PaxHeaders.17941/AdvancedProxySettingsPane.0000644000000000000000000000013012654402377030272 xustar0030 mtime=1454507263.274432088 29 atime=1454507327.13258043 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/controlpanel/AdvancedProxySettingsPane.java0000644000175000002070000002531212654402377031664 0ustar00jvanekmock00000000000000/* AdvancedProxySettingsPane.java -- Provides the panel which can modify proxy settings. Copyright (C) 2010 Red Hat This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be 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 this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package net.sourceforge.jnlp.controlpanel; import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import java.util.ArrayList; import java.util.List; import javax.swing.BoxLayout; import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JComponent; import javax.swing.JDialog; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTextArea; import javax.swing.JTextField; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.Translator; /** * This is the pane that modifies the proxy settings in more detail. * * @author Andrew Su (asu@redhat.com, andrew.su@utoronto.ca) * */ public class AdvancedProxySettingsPane extends JPanel { private JDialog parent; private final DeploymentConfiguration config; /** List of properties used by this panel */ public static String[] properties = { "deployment.proxy.http.host", "deployment.proxy.http.port", "deployment.proxy.https.host", "deployment.proxy.https.port", "deployment.proxy.ftp.host", "deployment.proxy.ftp.port", "deployment.proxy.socks.host", "deployment.proxy.socks.port", "deployment.proxy.same", "deployment.proxy.override.hosts" }; private String[] fields = new String[properties.length]; private JComponent defaultFocusComponent = null; /** * Creates a new instance of the proxy settings panel. * * @param parent * JDialog this is associated with. * @param config * Loaded DeploymentConfiguration file. */ public AdvancedProxySettingsPane(JDialog parent, DeploymentConfiguration config) { super(new BorderLayout()); this.parent = parent; this.config = config; getProperties(); addComponents(); } /** * Place properties into an array, this is so when cancel is hit. We don't * overwrite the original values. */ private void getProperties() { for (int i = 0; i < fields.length; i++) { fields[i] = this.config.getProperty(properties[i]); } } /** * Add the components to the panel. */ private void addComponents() { JPanel topPanel = new JPanel(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); JPanel servers = new NamedBorderPanel(Translator.R("APSServersPanel")); servers.setLayout(new GridBagLayout()); JLabel type = new JLabel(Translator.R("APSProxyTypeLabel")); JLabel proxyAddress = new JLabel(Translator.R("APSProxyAddressLabel")); JLabel port = new JLabel(Translator.R("APSProxyPortLabel")); // This addresses the HTTP proxy settings. JLabel http = new JLabel(Translator.R("APSLabelHTTP") + ":"); final JTextField httpAddressField = new JTextField(fields[0]); final JTextField httpPortField = new JTextField(); httpPortField.setDocument(NetworkSettingsPanel.getPortNumberDocument()); httpAddressField.getDocument().addDocumentListener(new DocumentAdapter(fields, 0)); httpPortField.getDocument().addDocumentListener(new DocumentAdapter(fields, 1)); httpPortField.setText(fields[1]); // This addresses the HTTPS proxy settings. JLabel secure = new JLabel(Translator.R("APSLabelSecure") + ":"); final JTextField secureAddressField = new JTextField(fields[2]); final JTextField securePortField = new JTextField(); securePortField.setDocument(NetworkSettingsPanel.getPortNumberDocument()); secureAddressField.getDocument().addDocumentListener(new DocumentAdapter(fields, 2)); securePortField.getDocument().addDocumentListener(new DocumentAdapter(fields, 3)); securePortField.setText(fields[3]); // This addresses the FTP proxy settings. JLabel ftp = new JLabel(Translator.R("APSLabelFTP") + ":"); final JTextField ftpAddressField = new JTextField(fields[4]); final JTextField ftpPortField = new JTextField(); ftpPortField.setDocument(NetworkSettingsPanel.getPortNumberDocument()); ftpAddressField.getDocument().addDocumentListener(new DocumentAdapter(fields, 4)); ftpPortField.getDocument().addDocumentListener(new DocumentAdapter(fields, 5)); ftpPortField.setText(fields[5]); // This addresses the Socks proxy settings. JLabel socks = new JLabel(Translator.R("APSLabelSocks") + ":"); final JTextField socksAddressField = new JTextField(fields[6]); final JTextField socksPortField = new JTextField(); socksPortField.setDocument(NetworkSettingsPanel.getPortNumberDocument()); socksAddressField.getDocument().addDocumentListener(new DocumentAdapter(fields, 6)); socksPortField.getDocument().addDocumentListener(new DocumentAdapter(fields, 7)); socksPortField.setText(fields[7]); JCheckBox sameProxyForAll = new JCheckBox(Translator.R("APSSameProxyForAllProtocols"), Boolean.parseBoolean(fields[8])); sameProxyForAll.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { fields[8] = String.valueOf(e.getStateChange() == ItemEvent.SELECTED); } }); JPanel p = new JPanel(); BoxLayout bl = new BoxLayout(p, BoxLayout.Y_AXIS); p.setLayout(bl); p.add(sameProxyForAll); c.fill = GridBagConstraints.BOTH; c.gridheight = 1; c.gridy = 0; c.gridwidth = 1; c.weightx = 0; c.gridx = 0; servers.add(type, c); c.gridwidth = 2; c.weightx = 1; c.gridx = 1; servers.add(proxyAddress, c); c.gridwidth = 1; c.weightx = 1; c.gridx = 4; servers.add(port, c); plant(1, http, httpAddressField, httpPortField, servers, c); plant(2, secure, secureAddressField, securePortField, servers, c); plant(3, ftp, ftpAddressField, ftpPortField, servers, c); plant(4, socks, socksAddressField, socksPortField, servers, c); c.gridwidth = 5; c.gridx = 0; c.gridy = 5; servers.add(p, c); JPanel exceptions = new NamedBorderPanel(Translator.R("APSExceptionsLabel")); exceptions.setLayout(new BorderLayout()); JLabel exceptionDescription = new JLabel(Translator.R("APSExceptionsDescription")); final JTextArea exceptionListArea = new JTextArea(); exceptionListArea.setLineWrap(true); exceptionListArea.setText(fields[9]); exceptionListArea.getDocument().addDocumentListener(new DocumentAdapter(fields, 9)); JLabel exceptionFormat = new JLabel(Translator.R("APSExceptionInstruction")); JScrollPane exceptionScroll = new JScrollPane(exceptionListArea, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); exceptions.add(exceptionDescription, BorderLayout.NORTH); exceptions.add(exceptionScroll, BorderLayout.CENTER); exceptions.add(exceptionFormat, BorderLayout.SOUTH); c.gridx = 0; c.weightx = 1; c.weighty = 0; c.gridy = 0; topPanel.add(servers, c); c.weighty = 1; c.gridy = 1; topPanel.add(exceptions, c); this.add(topPanel); this.add(createButtonPanel(), BorderLayout.SOUTH); } /** * Helper method to help make adding component shorter. */ private void plant(int y, JLabel label, JTextField addr, JTextField port, JPanel addTo, GridBagConstraints c) { c.gridy = y; c.gridwidth = 1; c.weightx = 0; c.gridx = 0; addTo.add(label, c); c.gridwidth = 2; c.weightx = 1; c.gridx = 1; addTo.add(addr, c); c.gridwidth = 1; c.weightx = 0; c.gridx = 3; addTo.add(new JLabel(":"), c); c.gridwidth = 1; c.weightx = 0.3; c.gridx = 4; addTo.add(port, c); } /** * Make the button panel. * * @return the button panel created * @see JPanel */ private JPanel createButtonPanel() { JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.TRAILING)); List buttons = new ArrayList(); JButton okButton = new JButton(Translator.R("ButOk")); okButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { for (int i = 0; i < fields.length; i++) config.setProperty(properties[i], fields[i]); parent.dispose(); } }); buttons.add(okButton); JButton cancelButton = new JButton(Translator.R("ButCancel")); cancelButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { parent.dispose(); } }); buttons.add(cancelButton); int maxWidth = 0; int maxHeight = 0; for (JButton button : buttons) { maxWidth = Math.max(button.getMinimumSize().width, maxWidth); maxHeight = Math.max(button.getMinimumSize().height, maxHeight); } int wantedWidth = maxWidth + 10; int wantedHeight = maxHeight; for (JButton button : buttons) { button.setPreferredSize(new Dimension(wantedWidth, wantedHeight)); buttonPanel.add(button); } return buttonPanel; } /** * Put focus onto default button. */ public void focusOnDefaultButton() { if (defaultFocusComponent != null) { defaultFocusComponent.requestFocusInWindow(); } } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/controlpanel/PaxHeaders.17941/AdvancedProxySettingsDialo0000644000000000000000000000013012654402377030361 xustar0030 mtime=1454507263.273432101 29 atime=1454507327.13258043 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/controlpanel/AdvancedProxySettingsDialog.java0000644000175000002070000001001512654402377032172 0ustar00jvanekmock00000000000000/* AdvancedProxySettingsDialog.java -- Display the dialog for modifying proxy settings. Copyright (C) 2010 Red Hat This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be 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 this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package net.sourceforge.jnlp.controlpanel; import java.awt.Container; import java.awt.Dimension; import java.awt.Frame; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.Toolkit; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import javax.swing.JDialog; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.Translator; import net.sourceforge.jnlp.util.ImageResources; import net.sourceforge.jnlp.util.ScreenFinder; /** * This dialog provides a means for user to edit more of the proxy settings. * * @author Andrew Su <asu@redhat.com, andrew.su@utoronto.ca> * */ public class AdvancedProxySettingsDialog extends JDialog { private boolean initialized = false; private static final String dialogTitle = Translator.R("APSDialogTitle"); private final DeploymentConfiguration config; // Configuration file which contains all the settings. AdvancedProxySettingsPane topPanel; /** * Creates a new instance of the proxy settings dialog. * * @param config * Loaded DeploymentConfiguration file. */ public AdvancedProxySettingsDialog(DeploymentConfiguration config) { super((Frame) null, dialogTitle, true); // Don't need a parent. setIconImages(ImageResources.INSTANCE.getApplicationImages()); this.config = config; /* Prepare for adding components to dialog box */ Container contentPane = getContentPane(); contentPane.setLayout(new GridBagLayout()); setMinimumSize(new Dimension(456, 404)); setPreferredSize(new Dimension(456, 404)); GridBagConstraints c = new GridBagConstraints(); c.fill = GridBagConstraints.BOTH; c.weightx = 1; c.weighty = 1; c.gridx = 0; c.gridy = 0; topPanel = new AdvancedProxySettingsPane(this, this.config); contentPane.add(topPanel, c); pack(); /* Set focus to default button when first activated */ WindowAdapter adapter = new WindowAdapter() { private boolean gotFocus = false; public void windowGainedFocus(WindowEvent we) { // Once window gets focus, set initial focus if (!gotFocus) { topPanel.focusOnDefaultButton(); gotFocus = true; } } }; addWindowFocusListener(adapter); initialized = true; } /** * Check whether the dialog has finished being created. * * @return True if dialog is ready to be displayed. */ public boolean isInitialized() { return initialized; } /** * Center the dialog box. */ private void centerDialog() { ScreenFinder.centerWindowsToCurrentScreen(this); } /** * Display the Proxy Settings Dialog. * * @param config * A loaded DeploymentConfiguration file. */ public static void showAdvancedProxySettingsDialog(final DeploymentConfiguration config) { AdvancedProxySettingsDialog psd = new AdvancedProxySettingsDialog(config); psd.setResizable(false); psd.centerDialog(); psd.setVisible(true); psd.dispose(); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/controlpanel/PaxHeaders.17941/AboutPanel.java0000644000000000000000000000013012654402377026072 xustar0030 mtime=1454507263.273432101 29 atime=1454507327.13258043 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/controlpanel/AboutPanel.java0000644000175000002070000000527012654402377026623 0ustar00jvanekmock00000000000000/* AboutPanel.java -- Display information about the control panel and icedtea-web. Copyright (C) 2010 Red Hat This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be 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 this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package net.sourceforge.jnlp.controlpanel; import java.awt.Component; import java.awt.Dimension; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.Box; import javax.swing.JButton; import javax.swing.JLabel; import net.sourceforge.jnlp.about.AboutDialog; import net.sourceforge.jnlp.runtime.Translator; import net.sourceforge.jnlp.util.docprovider.TextsProvider; /** * This class provides a GUI interface which shows some basic information on * this project. * * @author Andrew Su (asu@redhat.com, andrew.su@utoronto.ca) * */ public class AboutPanel extends NamedBorderPanel { public AboutPanel() { super(Translator.R("CPHeadAbout"), new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); JLabel logo = new JLabel(); JLabel aboutLabel = new JLabel("" + Translator.R("CPAboutInfo") + ""); JButton aboutButton = new JButton(Translator.R("AboutDialogueTabAbout")); aboutButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { AboutDialog.display(TextsProvider.ITWEB_SETTINGS); } }); c.fill = GridBagConstraints.BOTH; c.gridy = 0; c.gridx = 0; c.weighty = 0; c.weightx = 0; add(logo, c); c.gridx = 1; c.weightx = 1; add(aboutLabel, c); c.fill = GridBagConstraints.NONE; c.weighty = 0; c.weightx = 0; c.gridy++; c.gridx=1; add(aboutButton, c); /* Keep all the elements at the top of the panel (Extra padding) */ c.fill = GridBagConstraints.BOTH; Component filler = Box.createRigidArea(new Dimension(1, 1)); c.weighty = 1; c.gridy++; add(filler, c); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/config0000644000000000000000000000013112654402377021666 xustar0030 mtime=1454507263.273432101 30 atime=1454507658.779157357 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/config/0000755000175000002070000000000012654402377022467 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/netx/net/sourceforge/jnlp/config/PaxHeaders.17941/ValueValidator.java0000644000000000000000000000013112654402377025530 xustar0030 mtime=1454507263.273432101 30 atime=1454507327.131580443 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/config/ValueValidator.java0000644000175000002070000000475012654402377026262 0ustar00jvanekmock00000000000000/* ValueChecker.java Copyright (C) 2010 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.config; /** * A class implements the ValueValidator interface to indicate that it can validate * values. * * @see BasicValueValidators */ public interface ValueValidator { /** * This method checks if the given object is a valid value for this * specific {@link ValueValidator}. Any arbitrary operation can be * performed to ensure that the value is valid. * * @param value The object to validate * @throws IllegalArgumentException if the value is invalid */ public void validate(Object value) throws IllegalArgumentException; /** * Returns a string describing possible values in human-readable form that * this {@link ValueValidator} accepts * * @return a string describing possible values that this * {@link ValueValidator} accepts */ public String getPossibleValues(); } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/config/PaxHeaders.17941/Setting.java0000644000000000000000000000013112654402377024223 xustar0030 mtime=1454507263.273432101 30 atime=1454507327.131580443 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/config/Setting.java0000644000175000002070000001323012654402377024746 0ustar00jvanekmock00000000000000/* Setting.java Copyright (C) 2010 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.config; /** * Represents a value for a configuration. Provides methods to get the value * as well as marking the value as locked. * * Each instance of this class has an associated ValueChecker. This checker * can be used to check if the current value is valid. The default value * _must_ be valid. Null values can not originate externally so are (mostly) * considered valid. */ public class Setting { private String name = null; private String description = null; private boolean locked = false; private ValueValidator validator = null; private T defaultValue = null; private T value = null; private String source = null; /** * Creates a new Settings object * * @param name the name of this setting * @param description a human readable description of this setting * @param locked whether this setting is currently locked * @param validator the {@link ValueValidator} that can be used to validate * the value * @param defaultValue the default value of this setting. If this is not a * recognized setting, use null. * @param value the initial value of this setting * @param source the origin of the value (a file, or perhaps "{@code }") */ public Setting(String name, String description, boolean locked, ValueValidator validator, T defaultValue, T value, String source) { this.name = name; this.description = description; this.locked = locked; this.validator = validator; this.source = source; this.defaultValue = defaultValue; this.value = value; } /** * Creates a new Settings object by cloning the values from another * Settings object * @param other a Settings object to initialize settings from */ public Setting(Setting other) { this(other.name, other.description, other.locked, other.validator, other.defaultValue, other.value, other.source); } /** * @return the {@link ValueValidator} that can be used to check if * the current value is valid */ public ValueValidator getValidator() { return validator; } /** * @return the default value for this setting. May be null if this is not * one of the supported settings */ public T getDefaultValue() { return defaultValue; } /** * @return a human readable description of this setting */ public String getDescription() { return description; } /** * @return the name (like foo.bar.baz) of this setting */ public String getName() { return name; } /** * @return the source of the current value of this setting. May be a string * like "internal" or it may be the location of the properties file */ public String getSource() { return source; } /** * @return the current value of this setting */ public T getValue() { return value; } /** * @return true if this setting is locked */ public boolean isLocked() { return locked; } /** * Marks this setting as locked or unlocked. Setting the value is not * enforced by this class. * * @param locked whether to mark this setting as locked or not locked. */ public void setLocked(boolean locked) { this.locked = locked; } /** * Sets the source of the current value of this Setting. Maybe a string * like "internal" or the location of the properties file * * @param source the source of the value */ public void setSource(String source) { this.source = source; } /** * Note that setting the value is not enforced - it is the caller's * responsibility to check if a value is locked or not before setting a * new value * * @param value the new value */ public void setValue(T value) { this.value = value; } @Override public String toString() { return value.toString(); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/config/PaxHeaders.17941/SecurityValueValidator.java0000644000000000000000000000013112654402377027260 xustar0030 mtime=1454507263.272432114 30 atime=1454507327.131580443 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/config/SecurityValueValidator.java0000644000175000002070000000557512654402377030020 0ustar00jvanekmock00000000000000/* Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.config; import net.sourceforge.jnlp.security.appletextendedsecurity.AppletSecurityLevel; class SecurityValueValidator implements ValueValidator { public SecurityValueValidator() { } @Override public void validate(Object value) throws IllegalArgumentException { if (value == null) { // null is correct, it means it is not user set // and so default shoudl be used whatever it is // returning to prevent NPE in fromString return; } if (value instanceof AppletSecurityLevel) { //?? return; } if (!(value instanceof String)) { throw new IllegalArgumentException("Expected was String, was " + value.getClass()); } try { AppletSecurityLevel validated = AppletSecurityLevel.fromString((String) value); if (validated == null) { throw new IllegalArgumentException("Result can't be null, was"); } //thrown by fromString } catch (RuntimeException ex) { throw new IllegalArgumentException(ex); } } @Override public String getPossibleValues() { return AppletSecurityLevel.allToString(); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/config/PaxHeaders.17941/PathsAndFiles.java0000644000000000000000000000013112654402377025273 xustar0030 mtime=1454507263.272432114 30 atime=1454507327.131580443 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/config/PathsAndFiles.java0000644000175000002070000005276712654402377026040 0ustar00jvanekmock00000000000000/* Copyright (C) 2008 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.config; import java.io.File; import java.lang.reflect.Field; import java.util.ArrayList; import java.util.List; import net.sourceforge.jnlp.util.logging.OutputController; import static net.sourceforge.jnlp.config.DeploymentConfiguration.APPLET_TRUST_SETTINGS; import static net.sourceforge.jnlp.config.DeploymentConfiguration.DEPLOYMENT_CONFIG_FILE; import static net.sourceforge.jnlp.config.DeploymentConfiguration.DEPLOYMENT_PROPERTIES; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.runtime.Translator; public class PathsAndFiles { public static final String DEPLOYMENT_SUBDIR_DIR = "icedtea-web"; private static final String CONFIG_HOME; private static final String CACHE_HOME; private static final String DATA_HOME; private static final String RUNTIME_HOME; public static final String USER_CONFIG_HOME; public static final String USER_CACHE_HOME; public static final String USER_DEFAULT_SECURITY_DIR; public static final String XDG_CONFIG_HOME_VAR = "XDG_CONFIG_HOME"; public static final String XDG_CACHE_HOME_VAR = "XDG_CACHE_HOME"; public static final String XDG_RUNTIME_DIR_VAR = "XDG_RUNTIME_DIR"; private static final String XDG_DATA_HOME = "XDG_DATA_HOME"; private static final String TMP_PROP = "java.io.tmpdir"; private static final String HOME_PROP = "user.home"; private static final String JAVA_PROP = "java.home"; private static final String USER_PROP = "user.name"; private static final String VARIABLE = JNLPRuntime.isWindows() ? "%" : "$"; private static final String securityWord = "security"; public static final String ICEDTEA_SO = "IcedTeaPlugin.so"; public static final String CACHE_INDEX_FILE_NAME = "recently_used"; static { String configHome = System.getProperty(HOME_PROP) + File.separator + ".config"; String cacheHome = System.getProperty(HOME_PROP) + File.separator + ".cache"; String dataHome = System.getProperty(HOME_PROP) + File.separator + ".local" + File.separator + "share"; String runtimeHome = System.getProperty(TMP_PROP); String xdg_config_home = System.getenv(XDG_CONFIG_HOME_VAR); String xdg_cache_home = System.getenv(XDG_CACHE_HOME_VAR); String xdg_runtime_home = System.getenv(XDG_RUNTIME_DIR_VAR); String xdg_data_home = System.getenv(XDG_DATA_HOME); if (xdg_config_home != null) { CONFIG_HOME = xdg_config_home; } else { CONFIG_HOME = configHome; } if (xdg_cache_home != null) { CACHE_HOME = xdg_cache_home; } else { CACHE_HOME = cacheHome; } if (xdg_runtime_home != null) { RUNTIME_HOME = xdg_runtime_home; } else { RUNTIME_HOME = runtimeHome; } if (xdg_data_home != null) { DATA_HOME = xdg_data_home; } else { DATA_HOME = dataHome; } USER_CONFIG_HOME = CONFIG_HOME + File.separator + DEPLOYMENT_SUBDIR_DIR; USER_CACHE_HOME = CACHE_HOME + File.separator + DEPLOYMENT_SUBDIR_DIR; USER_DEFAULT_SECURITY_DIR = USER_CONFIG_HOME + File.separator + securityWord; } /** * PIPES_DIR and both Plugin Dirs are not instatiated to be used. Do exists only for documentation purposes. * Maintained by native part of ITW. Or outside ITW. */ public static final InfrastructureFileDescriptor PIPES_DIR = new RuntimeFileDescriptor("icedteaplugin-user-*", "FILEpipe", Target.PLUGIN); public static final InfrastructureFileDescriptor MOZILA_USER = new HomeFileDescriptor(ICEDTEA_SO, ".mozilla/plugins", "FILEmozillauser", Target.PLUGIN); public static final InfrastructureFileDescriptor MOZILA_GLOBAL_64 = new InfrastructureFileDescriptor(ICEDTEA_SO, "/usr/lib64/mozilla/plugins/", "", "FILEmozillaglobal64", Target.PLUGIN); public static final InfrastructureFileDescriptor MOZILA_GLOBAL_32 = new InfrastructureFileDescriptor(ICEDTEA_SO, "/usr/lib/mozilla/plugins/", "", "FILEmozillaglobal32", Target.PLUGIN); public static final InfrastructureFileDescriptor OPERA_64 = new InfrastructureFileDescriptor(ICEDTEA_SO, "/usr/lib64/opera/plugins/", "", "FILEopera64", Target.PLUGIN); public static final InfrastructureFileDescriptor OPERA_32 = new InfrastructureFileDescriptor(ICEDTEA_SO, "/usr/lib/opera/plugins/", "", "FILEopera32", Target.PLUGIN); public static final InfrastructureFileDescriptor CACHE_DIR = new ItwCacheFileDescriptor("cache", "FILEcache", Target.JAVAWS, Target.ITWEB_SETTINGS) { @Override public String getPropertiesKey() { return DeploymentConfiguration.KEY_USER_CACHE_DIR; } }; // this one is depnding on CACHE_DIR, so initialize it lazily public static InfrastructureFileDescriptor getRecentlyUsedFile() { return RECENTLY_USED_FILE_HOLDER.RECENTLY_USED_FILE; } private static class RECENTLY_USED_FILE_HOLDER { static final InfrastructureFileDescriptor RECENTLY_USED_FILE = new ItwCacheFileDescriptor(CACHE_INDEX_FILE_NAME, CACHE_DIR.getFile().getName(), "FILErecentlyUsed", Target.JAVAWS, Target.ITWEB_SETTINGS){ @Override public String getFullPath() { return clean(CACHE_DIR.getFullPath()+File.separator+this.getFileName()); } }; } public static final InfrastructureFileDescriptor PCACHE_DIR = new ItwCacheFileDescriptor("pcache", "FILEappdata", Target.JAVAWS, Target.ITWEB_SETTINGS){ @Override public String getPropertiesKey() { return DeploymentConfiguration.KEY_USER_PERSISTENCE_CACHE_DIR; } }; public static final InfrastructureFileDescriptor LOG_DIR = new ItwConfigFileDescriptor("log", "FILElogs", Target.JAVAWS, Target.ITWEB_SETTINGS){ @Override public String getPropertiesKey() { return DeploymentConfiguration.KEY_USER_LOG_DIR; } }; //javaws is saving here, itweb-settings may modify them public static final InfrastructureFileDescriptor ICONS_DIR = new ItwConfigFileDescriptor("icons", "FILEicons", Target.JAVAWS, Target.ITWEB_SETTINGS); public static final InfrastructureFileDescriptor GEN_JNLPS_DIR = new ItwConfigFileDescriptor("generated_jnlps", "FILEjnlps", Target.PLUGIN, Target.ITWEB_SETTINGS); //javaws is saving here, itweb-settings may modify them public static final InfrastructureFileDescriptor MENUS_DIR = new MenuFileDescriptor("javaws", "FILEmenus", Target.JAVAWS, Target.ITWEB_SETTINGS); public static final InfrastructureFileDescriptor APPLET_TRUST_SETTINGS_USER = new ItwConfigFileDescriptor(APPLET_TRUST_SETTINGS, "FILEextasuser", Target.JAVAWS, Target.ITWEB_SETTINGS); public static final InfrastructureFileDescriptor APPLET_TRUST_SETTINGS_SYS = new SystemDeploymentCofigFileDescriptor(APPLET_TRUST_SETTINGS, "FILEextasadmin", Target.JAVAWS, Target.ITWEB_SETTINGS); public static final InfrastructureFileDescriptor ETC_DEPLOYMENT_CFG = new SystemDeploymentCofigFileDescriptor(DEPLOYMENT_CONFIG_FILE, "FILEglobaldp", Target.JAVAWS, Target.ITWEB_SETTINGS); public static final InfrastructureFileDescriptor TMP_DIR = new ItwCacheFileDescriptor("tmp", "FILEtmpappdata", Target.JAVAWS, Target.ITWEB_SETTINGS){ @Override public String getPropertiesKey() { return DeploymentConfiguration.KEY_USER_TMP_DIR; } }; public static final InfrastructureFileDescriptor LOCKS_DIR = new TmpUsrFileDescriptor("locks", "netx", "FILElocksdir", Target.JAVAWS) { @Override public String getPropertiesKey() { return DeploymentConfiguration.KEY_USER_LOCKS_DIR; } }; public static final InfrastructureFileDescriptor MAIN_LOCK = new TmpUsrFileDescriptor("netx_running", "netx" + File.separator + "locks", "FILEmainlock", Target.JAVAWS) { @Override public String getPropertiesKey() { return DeploymentConfiguration.KEY_USER_NETX_RUNNING_FILE; } }; public static final InfrastructureFileDescriptor JAVA_POLICY = new UserSecurityConfigFileDescriptor("java.policy", "FILEpolicy", Target.JAVAWS, Target.POLICY_EDITOR){ @Override public String getPropertiesKey() { return DeploymentConfiguration.KEY_USER_SECURITY_POLICY; } @Override public File getFile() { throw new IllegalStateException("Only getFullPath should be used. This is returning URL String."); } @Override public File getDefaultFile() { throw new IllegalStateException("Only getDefaultFullPath should be used. This is returning URL String."); } }; public static final InfrastructureFileDescriptor USER_CACERTS = new UserCacertsFileDescriptor("trusted.cacerts") { @Override public String getPropertiesKey() { return DeploymentConfiguration.KEY_USER_TRUSTED_CA_CERTS; } }; public static final InfrastructureFileDescriptor USER_JSSECAC = new UserCacertsFileDescriptor("trusted.jssecacerts") { @Override public String getPropertiesKey() { return DeploymentConfiguration.KEY_USER_TRUSTED_JSSE_CA_CERTS; } }; public static final InfrastructureFileDescriptor USER_CERTS = new UserCacertsFileDescriptor("trusted.certs") { @Override public String getPropertiesKey() { return DeploymentConfiguration.KEY_USER_TRUSTED_CERTS; } }; public static final InfrastructureFileDescriptor USER_JSSECER = new UserCacertsFileDescriptor("trusted.jssecerts") { @Override public String getPropertiesKey() { return DeploymentConfiguration.KEY_USER_TRUSTED_JSSE_CERTS; } }; public static final InfrastructureFileDescriptor USER_CLIENTCERT = new UserCacertsFileDescriptor("trusted.clientcerts") { @Override public String getPropertiesKey() { return DeploymentConfiguration.KEY_USER_TRUSTED_CLIENT_CERTS; } }; public static final InfrastructureFileDescriptor SYS_CACERT = new SystemJavaSecurityFileDescriptor("cacerts") { @Override public String getPropertiesKey() { return DeploymentConfiguration.KEY_SYSTEM_TRUSTED_CA_CERTS; } }; public static final InfrastructureFileDescriptor SYS_JSSECAC = new SystemJavaSecurityFileDescriptor("jssecacerts") { @Override public String getPropertiesKey() { return DeploymentConfiguration.KEY_SYSTEM_TRUSTED_JSSE_CA_CERTS; } }; public static final InfrastructureFileDescriptor SYS_CERT = new SystemJavaSecurityFileDescriptor("trusted.certs"){ @Override public String getPropertiesKey() { return DeploymentConfiguration.KEY_SYSTEM_TRUSTED_CERTS; } }; public static final InfrastructureFileDescriptor SYS_JSSECERT = new SystemJavaSecurityFileDescriptor("trusted.jssecerts") { @Override public String getPropertiesKey() { return DeploymentConfiguration.KEY_SYSTEM_TRUSTED_JSSE_CERTS; } }; public static final InfrastructureFileDescriptor SYS_CLIENTCERT = new SystemJavaSecurityFileDescriptor("trusted.clientcerts") { @Override public String getPropertiesKey() { return DeploymentConfiguration.KEY_SYSTEM_TRUSTED_CLIENT_CERTS; } }; public static final InfrastructureFileDescriptor JAVA_DEPLOYMENT_PROP_FILE = new SystemJavaLibFileDescriptor(DEPLOYMENT_CONFIG_FILE, "FILEjavadp", Target.JAVAWS, Target.ITWEB_SETTINGS) { @Override public String getDescription() { return Translator.R(getDescriptionKey(), DeploymentConfiguration.KEY_JRE_DIR); } }; public static final InfrastructureFileDescriptor USER_DEPLOYMENT_FILE = new ItwConfigFileDescriptor(DEPLOYMENT_PROPERTIES, "FILEuserdp", Target.JAVAWS, Target.ITWEB_SETTINGS); static enum Target { JAVAWS, PLUGIN, ITWEB_SETTINGS, POLICY_EDITOR; } public static List getAllFiles() { return getAllFiles(null); } public static List getAllSecurityFiles() { return getAllFiles(null, UserSecurityConfigFileDescriptor.class); } private static List getAllFiles(Target desired) { return getAllFiles(desired, InfrastructureFileDescriptor.class); } private static List getAllFiles(Target desired, Class c) { List r = new ArrayList<>(); Field[] all = PathsAndFiles.class.getDeclaredFields(); for (Field field : all) { try { Object o = field.get(null); if (c.isInstance(o)) { InfrastructureFileDescriptor i = (InfrastructureFileDescriptor) o; for (Target targe : i.target) { if (desired == null || targe == desired) { r.add(i); break; } } } } catch (IllegalArgumentException | IllegalAccessException ex) { OutputController.getLogger().log(ex); } } r.add(getRecentlyUsedFile()); return r; } public static List getAllJavaWsFiles() { return getAllFiles(Target.JAVAWS); } public static List getAllItWebSettingsFiles() { return getAllFiles(Target.ITWEB_SETTINGS); } public static List getAllPEFiles() { return getAllFiles(Target.POLICY_EDITOR); } public static List getAllPluginFiles() { return getAllFiles(Target.PLUGIN); } private static class HomeFileDescriptor extends InfrastructureFileDescriptor { private HomeFileDescriptor(String fileName, String pathSub, String description, Target... target) { super(fileName, pathSub, System.getProperty(HOME_PROP), description, target); } @Override public String getSystemPathStubAcronym() { return VARIABLE + "HOME"; } } private static class SystemCofigFileDescriptor extends InfrastructureFileDescriptor { private SystemCofigFileDescriptor(String fileName, String pathSub, String description, Target... target) { super(fileName, pathSub, File.separator + "etc" + File.separator + ".java", description, target); } } private static class SystemDeploymentCofigFileDescriptor extends SystemCofigFileDescriptor { private SystemDeploymentCofigFileDescriptor(String fileName, String description, Target... target) { super(fileName, "deployment", description, target); } } private static class SystemJavaFileDescriptor extends InfrastructureFileDescriptor { private SystemJavaFileDescriptor(String fileName, String pathSub, String description, Target... target) { super(fileName, pathSub, System.getProperty(JAVA_PROP), description, target); } @Override public String getSystemPathStubAcronym() { return VARIABLE + "JAVA_HOME"; } } private static class SystemJavaLibFileDescriptor extends SystemJavaFileDescriptor { private SystemJavaLibFileDescriptor(String fileName, String desc, Target... target) { super(fileName, "lib", desc, target); } private SystemJavaLibFileDescriptor(String fileName, String subpath, String description, Target... target) { super(fileName, "lib" + File.separator + subpath, description, target); } } private static class SystemJavaSecurityFileDescriptor extends SystemJavaLibFileDescriptor { private SystemJavaSecurityFileDescriptor(String fileName) { super(fileName, securityWord, "FILEjavacerts", Target.JAVAWS); } } private static class DataFileDescriptor extends InfrastructureFileDescriptor { private DataFileDescriptor(String fileName, String sp, String description, Target... target) { super(fileName, sp, DATA_HOME, description, target); } @Override public String getSystemPathStubAcronym() { return VARIABLE + "" + XDG_DATA_HOME; } } /** * http://standards.freedesktop.org/menu-spec/menu-spec-1.0.html#paths */ private static class MenuFileDescriptor extends DataFileDescriptor { private MenuFileDescriptor(String fileName, String description, Target... target) { super(fileName, "applications", description, target); } } private static class RuntimeFileDescriptor extends InfrastructureFileDescriptor { private RuntimeFileDescriptor(String fileName, String description, Target... target) { super(fileName, RUNTIME_HOME, "", description, target); } @Override public String getSystemPathStubAcronym() { return VARIABLE + "" + XDG_RUNTIME_DIR_VAR; } } private static class ConfigFileDescriptor extends InfrastructureFileDescriptor { private ConfigFileDescriptor(String fileName, String pathStub, String description, Target... target) { super(fileName, pathStub, CONFIG_HOME, description, target); } @Override public String getSystemPathStubAcronym() { return VARIABLE + "" + XDG_CONFIG_HOME_VAR; } } private static class CacheFileDescriptor extends InfrastructureFileDescriptor { private CacheFileDescriptor(String fileName, String pathStub, String description, Target... target) { super(fileName, pathStub, CACHE_HOME, description, target); } @Override public String getSystemPathStubAcronym() { return VARIABLE + "" + XDG_CACHE_HOME_VAR; } } private static class ItwConfigFileDescriptor extends ConfigFileDescriptor { private ItwConfigFileDescriptor(String fileName, String description, Target... target) { super(fileName, DEPLOYMENT_SUBDIR_DIR, description, target); } private ItwConfigFileDescriptor(String fileName, String folowingPath, String description, Target... target) { super(fileName, DEPLOYMENT_SUBDIR_DIR + File.separator + folowingPath, description, target); } } private static class UserSecurityConfigFileDescriptor extends ItwConfigFileDescriptor { private UserSecurityConfigFileDescriptor(String fileName, String description, Target... target) { super(fileName, securityWord, description, target); } } private static class UserCacertsFileDescriptor extends UserSecurityConfigFileDescriptor { private UserCacertsFileDescriptor(String fileName) { super(fileName, "FILEusercerts", Target.JAVAWS); } } private static class ItwCacheFileDescriptor extends CacheFileDescriptor { private ItwCacheFileDescriptor(String fileName, String description, Target... target) { super(fileName, DEPLOYMENT_SUBDIR_DIR, description, target); } private ItwCacheFileDescriptor(String fileName, String folowingPath, String description, Target... target) { super(fileName, DEPLOYMENT_SUBDIR_DIR + File.separator + folowingPath, description, target); } } private static class TmpUsrFileDescriptor extends InfrastructureFileDescriptor { private TmpUsrFileDescriptor(String fileName, String pathStub, String description, Target... target) { super(fileName, pathStub, System.getProperty(TMP_PROP) + File.separator + System.getProperty(USER_PROP), description, target); } @Override public String getSystemPathStubAcronym() { return VARIABLE + "TMP" + File.separator + VARIABLE + "USER"; } }; } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/config/PaxHeaders.17941/InfrastructureFileDescriptor.jav0000644000000000000000000000013112654402377030324 xustar0030 mtime=1454507263.272432114 30 atime=1454507327.131580443 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/config/InfrastructureFileDescriptor.java0000644000175000002070000001452112654402377031214 0ustar00jvanekmock00000000000000/* Copyright (C) 2012 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.config; import java.io.File; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.runtime.Translator; public class InfrastructureFileDescriptor { private final String fileName; private final String pathStub; private final String systemPathStub; private final String descriptionKey; final PathsAndFiles.Target[] target; //simple constructor to allow testing instances based on overrides protected InfrastructureFileDescriptor() { this("undef", "undef", "undef", "undef"); } InfrastructureFileDescriptor(String fileName, String pathStub, String systemPathStub, String descriptionKey, PathsAndFiles.Target... target) { this.fileName = fileName; this.pathStub = pathStub; this.systemPathStub = systemPathStub; this.descriptionKey = descriptionKey; this.target = target; } /** setup-able files have to override this * if they don't, they are read only, and set value will fail * if it is desired to write value of property, then override and use known key. * @return null by default. Should return key to configuration if overriden. */ protected String getPropertiesKey() { return null; } public File getFile() { return new File(getFullPath()); } public void setValue(String value) { setValue(value, JNLPRuntime.getConfiguration()); } public String getFullPath() { return getFullPath(JNLPRuntime.getConfiguration()); } /** * overload version for control panel, which is saving to internal copy. * @param value new path of file * @param config config where t write this value (note, usually JNLPRuntime.getConfiguration() * so you don't need it, but our config gui tool is using two sets to allow undo. */ public void setValue(String value, DeploymentConfiguration config) { String key = getPropertiesKey(); if (key == null) { throw new IllegalStateException("This file is read only"); } else { config.setProperty(key, value); } } /** * overload version for control panel, which is saving to internal copy. * @param config config from where to readthis value (note, usually JNLPRuntime.getConfiguration() * so you don't need it, but our config gui tool is using two sets to allow undo. * @return configured property or default */ public String getFullPath(DeploymentConfiguration config) { String key = getPropertiesKey(); if (key == null) { return getDefaultFullPath(); } else { return config.getProperty(key); } } public File getDefaultFile() { return new File(getDefaultFullPath()); } public String getDefaultDir() { return clean(systemPathStub + File.separator + pathStub); } public String getDefaultFullPath() { return clean(systemPathStub + File.separator + pathStub + File.separator + fileName); } //returns path acronym for default location protected String getSystemPathStubAcronym() { return systemPathStub; } protected String getFileName() { return fileName; } protected String getDescriptionKey() { return descriptionKey; } /** * This remaining part of file declaration, when acronym is removed. * See getDirViaAcronym. * * @return */ private String getStub() { return clean(pathStub + File.separator + fileName); } @Override public String toString() { return clean(getSystemPathStubAcronym() + File.separator + getStub()); } /** * For documentation purposes, the descriptor may be created as VARIABLE/custom/path. * * This is whole part, which is considered as setup-able. * @return directory acronym for nice docs */ public String getDirViaAcronym() { return clean(getSystemPathStubAcronym() + File.separator + pathStub); } /** * Remove garbage from paths. * * Currently this methods unify all multiple occurrences of separators * to single one. Eg /path/to//file will become /path/to/file. * * Those artifacts maybe spread during various s=path+deparator+subdir+separator * file=s+separator+filename * * @param s string to be cleaned * @return cleaned string */ protected String clean(String s) { while (s.contains(File.separator + File.separator)) { s = s.replace(File.separator + File.separator, File.separator); } return s; } /** * @return the translated description */ public String getDescription() { return Translator.R(descriptionKey); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/config/PaxHeaders.17941/DirectoryValidator.java0000644000000000000000000000013112654402377026420 xustar0030 mtime=1454507263.271432128 30 atime=1454507327.131580443 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/config/DirectoryValidator.java0000644000175000002070000003212012654402377027142 0ustar00jvanekmock00000000000000/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package net.sourceforge.jnlp.config; import static net.sourceforge.jnlp.runtime.Translator.R; import java.io.File; import java.util.ArrayList; import java.util.List; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.util.FileUtils; import net.sourceforge.jnlp.util.logging.OutputController; public class DirectoryValidator { /** * This class is holding results of directory validation. * Various errors like can not read, write create dir can apeear * For sumaries of results are here getPasses, getFailures methods *

    * Individual results can be read from results field, or converted to string *

    */ public static class DirectoryCheckResults { public final List results; /** * Wraps results so we can make some statistics or convert to message * @param results results to be checked */ public DirectoryCheckResults(List results) { this.results = results; } /** * @return sum of passed checks, 0-3 per result */ public int getPasses() { int passes = 0; for (DirectoryCheckResult directoryCheckResult : results) { passes += directoryCheckResult.getPasses(); } return passes; } /** * @return sum of failed checks, 0-3 per results */ public int getFailures() { int failures = 0; for (DirectoryCheckResult directoryCheckResult : results) { failures += directoryCheckResult.getFailures(); } return failures; } /** * The result have one reuslt per line, separated by \n * as is inherited from result.getMessage() method. * * @return all results connected. */ public String getMessage() { return resultsToString(results); } /** * using getMessage * @return a text representation of a {@code DirectoryValidator} object */ @Override public String toString() { return getMessage(); } public static String resultsToString(List results) { StringBuilder sb = new StringBuilder(); for (DirectoryCheckResult r : results) { if (r.getFailures() > 0) { sb.append(r.getMessage()); } } return sb.toString(); } } /** * Is storing result of directory validation. * * validated are existence of directory * whether it is directory * if it have read/write permissions */ public static class DirectoryCheckResult { //do exist? public boolean exists = true; //is dir? public boolean isDir = true; //can be read, written to? public boolean correctPermissions = true; //have correct subdir? - this implies soe rules, when subdirecotry of some //particular directory have weeker permissions public DirectoryCheckResult subDir = null; //actual tested directory private final File testedDir; public DirectoryCheckResult(File testedDir) { this.testedDir = testedDir; } public static String notExistsMessage(File f) { return R("DCmaindircheckNotexists", f.getAbsolutePath()); } public static String notDirMessage(File f) { return R("DCmaindircheckNotdir", f.getAbsolutePath()); } public static String wrongPermissionsMessage(File f) { return R("DCmaindircheckRwproblem", f.getAbsolutePath()); } private static int booleanToInt(boolean b) { if (b) { return 1; } else { return 0; } } /** * count passes of this result (0-3, both inclusive). * @return how many times it passed */ public int getPasses() { int subdirs = 0; if (subDir != null) { subdirs = subDir.getPasses(); } return booleanToInt(exists) + booleanToInt(isDir) + booleanToInt(correctPermissions) + subdirs; } /** * count failures of this result (0-3, both inclusive). * @return how many failures appeared */ public int getFailures() { int max = 3; if (subDir != null) { max = 2 * max; } return max - getPasses(); } /** * Convert results to string. * Each failure by line. PAsses are not mentioned * The subdirectory (and it subdirectories are included to ) * * @return string with \n, or/and ended by \n */ public String getMessage() { StringBuilder sb = new StringBuilder(); if (!exists) { sb.append(notExistsMessage(testedDir)).append("\n"); } if (!isDir) { sb.append(notDirMessage(testedDir)).append("\n"); } if (!correctPermissions) { sb.append(wrongPermissionsMessage(testedDir)).append("\n"); } if (subDir != null) { String s = subDir.getMessage(); if (!s.isEmpty()) { sb.append(s); } } return sb.toString(); } @Override public String toString() { return getMessage(); } } private final List dirsToCheck; /** * Creates DirectoryValidator to ensure given directories * * @param dirsToCheck dirs to check */ public DirectoryValidator(List dirsToCheck) { this.dirsToCheck = dirsToCheck; } /** * Creates DirectoryValidator to ensure directories read from * user (if any - default otherwise) settings via keys: *
      *
    • {@link DeploymentConfiguration#KEY_USER_CACHE_DIR}
    • *
    • {@link DeploymentConfiguration#KEY_USER_PERSISTENCE_CACHE_DIR}
    • *
    • {@link DeploymentConfiguration#KEY_SYSTEM_CACHE_DIR}
    • *
    • {@link DeploymentConfiguration#KEY_USER_LOG_DIR}
    • *
    • {@link DeploymentConfiguration#KEY_USER_TMP_DIR}
    • *
    • {@link DeploymentConfiguration#KEY_USER_LOCKS_DIR}
    • *
    */ public DirectoryValidator() { dirsToCheck = new ArrayList<>(6); DeploymentConfiguration dc = JNLPRuntime.getConfiguration(); String[] keys = new String[]{ DeploymentConfiguration.KEY_USER_CACHE_DIR, DeploymentConfiguration.KEY_USER_PERSISTENCE_CACHE_DIR, DeploymentConfiguration.KEY_SYSTEM_CACHE_DIR, DeploymentConfiguration.KEY_USER_LOG_DIR, DeploymentConfiguration.KEY_USER_TMP_DIR, DeploymentConfiguration.KEY_USER_LOCKS_DIR}; for (String key : keys) { String value = dc.getProperty(key); if (value == null) { OutputController.getLogger().log(OutputController.Level.MESSAGE_DEBUG, "WARNING: key " + key + " has no value, setting to default value"); value = Defaults.getDefaults().get(key).getValue(); } if (value == null) { if (JNLPRuntime.isDebug()) { OutputController.getLogger().log(OutputController.Level.MESSAGE_DEBUG, "WARNING: key " + key + " has no value, skipping"); } continue; } File f = new File(value); dirsToCheck.add(f); } } /** * This method is ensuring, that specified directories will exists after * call and will have enough permissions. *

    * This methods is trying to create the directories if they are not present * and is testing if can be written inside. All checks are done in bulk. If * one or more defect is found, user is warned via dialogue in gui mode * (again in bulk). In headless mode stdout/stderr is enough, as application * (both gui and headless) should not stop to work, but continue to run with * hope that corrupted dirs will not be necessary *

    * @return result of directory checks */ public DirectoryCheckResults ensureDirs() { return ensureDirs(dirsToCheck); } static DirectoryCheckResults ensureDirs(List dirs) { List result = new ArrayList<>(dirs.size()); for (File f : dirs) { if (f.exists()) { DirectoryCheckResult r = testDir(f, true, true); result.add(r); continue; } if (!f.mkdirs()) { OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "ERROR: Directory " + f.getAbsolutePath() + " does not exist and has not been created"); } else { OutputController.getLogger().log(OutputController.Level.MESSAGE_DEBUG, "OK: Directory " + f.getAbsolutePath() + " did not exist but has been created"); } DirectoryCheckResult r = testDir(f, true, true); result.add(r); } return new DirectoryCheckResults(result); } /** * This method is package private for testing purposes only. *

    * This method verify that directory exists, is directory, file and * directory can be created, file can be written into, and subdirectory can * be written into. *

    *

    * Some steps may looks like redundant, but some permission settings really * alow to create file but not directory and vice versa. Also some settings * can allow to create file or directory which can not be written into. (eg * ACL or network disks) *

    */ static DirectoryCheckResult testDir(File f, boolean verbose, boolean testSubdir) { DirectoryCheckResult result = new DirectoryCheckResult(f); if (!f.exists()) { if (verbose) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, DirectoryCheckResult.notExistsMessage(f)); } result.exists = false; } if (!f.isDirectory()) { if (verbose) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, DirectoryCheckResult.notDirMessage(f)); } result.isDir = false; } File testFile = null; boolean correctPermissions = true; try { testFile = File.createTempFile("maindir", "check", f); if (!testFile.exists()) { correctPermissions = false; } try { FileUtils.saveFile("ww", testFile); String s = FileUtils.loadFileAsString(testFile); if (!s.trim().equals("ww")) { correctPermissions = false; } } catch (Exception ex) { if (JNLPRuntime.isDebug()) { ex.printStackTrace(); } correctPermissions = false; } File[] canList = f.listFiles(); if (canList == null || canList.length == 0) { correctPermissions = false; } testFile.delete(); if (testFile.exists()) { correctPermissions = false; } else { boolean created = testFile.mkdir(); if (!created) { correctPermissions = false; } if (testFile.exists()) { if (testSubdir) { DirectoryCheckResult subdirResult = testDir(testFile, verbose, false); if (subdirResult.getFailures() != 0) { result.subDir = subdirResult; correctPermissions = false; } testFile.delete(); if (testFile.exists()) { correctPermissions = false; } } } else { correctPermissions = false; } } } catch (Exception ex) { if (JNLPRuntime.isDebug()) { ex.printStackTrace(); } correctPermissions = false; } finally { if (testFile != null && testFile.exists()) { testFile.delete(); } } if (!correctPermissions) { if (verbose) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, DirectoryCheckResult.wrongPermissionsMessage(f)); } result.correctPermissions = false; } return result; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/config/PaxHeaders.17941/DeploymentConfiguration.java0000644000000000000000000000013112654402377027456 xustar0030 mtime=1454507263.271432128 30 atime=1454507327.131580443 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java0000644000175000002070000011676212654402377030217 0ustar00jvanekmock00000000000000// Copyright (C) 2010 Red Hat, Inc. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp.config; import static net.sourceforge.jnlp.runtime.Translator.R; import java.io.BufferedOutputStream; import java.io.BufferedReader; import java.io.File; import java.io.FileOutputStream; import java.io.FileReader; import java.io.IOException; import java.io.OutputStream; import java.io.PrintStream; import java.io.Reader; import java.net.MalformedURLException; import java.net.URL; import java.nio.channels.FileLock; import java.text.SimpleDateFormat; import java.util.Date; import java.util.HashMap; import java.util.Map; import java.util.Properties; import java.util.Set; import javax.naming.ConfigurationException; import javax.swing.JOptionPane; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.util.FileUtils; import net.sourceforge.jnlp.util.logging.OutputController; /** * Manages the various properties and configuration related to deployment. * * See: * http://download.oracle.com/javase/1.5.0/docs/guide/deployment/deployment-guide/properties.html */ public final class DeploymentConfiguration { public static final String DEPLOYMENT_CONFIG_FILE = "deployment.config"; public static final String DEPLOYMENT_PROPERTIES = "deployment.properties"; public static final String APPLET_TRUST_SETTINGS = ".appletTrustSettings"; public static final String DEPLOYMENT_COMMENT = "Netx deployment configuration"; public String userComments; public String systemComments; public static final int JNLP_ASSOCIATION_NEVER = 0; public static final int JNLP_ASSOCIATION_NEW_ONLY = 1; public static final int JNLP_ASSOCIATION_ASK_USER = 2; public static final int JNLP_ASSOCIATION_REPLACE_ASK = 3; /** * when set to as value of KEY_CONSOLE_STARTUP_MODE = "deployment.console.startup.mode", * then console is not visible by default, but may be shown */ public static final String CONSOLE_HIDE = "HIDE"; /** * when set to as value of KEY_CONSOLE_STARTUP_MODE = "deployment.console.startup.mode", * then console show for both javaws and plugin */ public static final String CONSOLE_SHOW = "SHOW"; /** * when set to as value of KEY_CONSOLE_STARTUP_MODE = "deployment.console.startup.mode", * then console is not visible by default, nop data are passed to it (save memory and cpu) but can not be shown */ public static final String CONSOLE_DISABLE = "DISABLE"; /** * when set to as value of KEY_CONSOLE_STARTUP_MODE = "deployment.console.startup.mode", * then console show for plugin */ public static final String CONSOLE_SHOW_PLUGIN = "SHOW_PLUGIN_ONLY"; /** * when set to as value of KEY_CONSOLE_STARTUP_MODE = "deployment.console.startup.mode", * then console show for javaws */ public static final String CONSOLE_SHOW_JAVAWS = "SHOW_JAVAWS_ONLY"; public static final String KEY_USER_CACHE_DIR = "deployment.user.cachedir"; public static final String KEY_USER_PERSISTENCE_CACHE_DIR = "deployment.user.pcachedir"; public static final String KEY_SYSTEM_CACHE_DIR = "deployment.system.cachedir"; public static final String KEY_CACHE_MAX_SIZE = "deployment.cache.max.size"; public static final String KEY_CACHE_ENABLED = "deployment.javapi.cache.enabled"; public static final String KEY_CACHE_COMPRESSION_ENABLED = "deployment.cache.jarcompression"; public static final String KEY_USER_LOG_DIR = "deployment.user.logdir"; public static final String KEY_USER_TMP_DIR = "deployment.user.tmp"; /** the directory containing locks for single instance applications */ public static final String KEY_USER_LOCKS_DIR = "deployment.user.locksdir"; /** * The netx_running file is used to indicate if any instances of netx are * running (this file may exist even if no instances are running). All netx * instances acquire a shared lock on this file. If this file can be locked * (using a {@link FileLock}) in exclusive mode, then other netx instances * are not running */ public static final String KEY_USER_NETX_RUNNING_FILE = "deployment.user.runningfile"; public static final String KEY_USER_SECURITY_POLICY = "deployment.user.security.policy"; public static final String KEY_USER_TRUSTED_CA_CERTS = "deployment.user.security.trusted.cacerts"; public static final String KEY_USER_TRUSTED_JSSE_CA_CERTS = "deployment.user.security.trusted.jssecacerts"; public static final String KEY_USER_TRUSTED_CERTS = "deployment.user.security.trusted.certs"; public static final String KEY_USER_TRUSTED_JSSE_CERTS = "deployment.user.security.trusted.jssecerts"; public static final String KEY_USER_TRUSTED_CLIENT_CERTS = "deployment.user.security.trusted.clientauthcerts"; public static final String KEY_SYSTEM_SECURITY_POLICY = "deployment.system.security.policy"; public static final String KEY_SYSTEM_TRUSTED_CA_CERTS = "deployment.system.security.cacerts"; public static final String KEY_SYSTEM_TRUSTED_JSSE_CA_CERTS = "deployment.system.security.jssecacerts"; public static final String KEY_SYSTEM_TRUSTED_CERTS = "deployment.system.security.trusted.certs"; public static final String KEY_SYSTEM_TRUSTED_JSSE_CERTS = "deployment.system.security.trusted.jssecerts"; public static final String KEY_SYSTEM_TRUSTED_CLIENT_CERTS = "deployment.system.security.trusted.clientautcerts"; /* * Security and access control */ /** Boolean. Only show security prompts to user if true */ public static final String KEY_SECURITY_PROMPT_USER = "deployment.security.askgrantdialog.show"; //enum of AppletSecurityLevel in result public static final String KEY_SECURITY_LEVEL = "deployment.security.level"; public static final String KEY_SECURITY_TRUSTED_POLICY = "deployment.security.trusted.policy"; /** Boolean. Only give AWTPermission("showWindowWithoutWarningBanner") if true */ public static final String KEY_SECURITY_ALLOW_HIDE_WINDOW_WARNING = "deployment.security.sandbox.awtwarningwindow"; /** Boolean. Only prompt user for granting any JNLP permissions if true */ public static final String KEY_SECURITY_PROMPT_USER_FOR_JNLP = "deployment.security.sandbox.jnlp.enhanced"; /** Boolean. Only install the custom authenticator if true */ public static final String KEY_SECURITY_INSTALL_AUTHENTICATOR = "deployment.security.authenticator"; public static final String KEY_STRICT_JNLP_CLASSLOADER = "deployment.jnlpclassloader.strict"; /* * Networking */ /** the proxy type. possible values are {@code JNLPProxySelector.PROXY_TYPE_*} */ public static final String KEY_PROXY_TYPE = "deployment.proxy.type"; /** Boolean. If true, the http host/port should be used for https and ftp as well */ public static final String KEY_PROXY_SAME = "deployment.proxy.same"; public static final String KEY_PROXY_AUTO_CONFIG_URL = "deployment.proxy.auto.config.url"; public static final String KEY_PROXY_BYPASS_LIST = "deployment.proxy.bypass.list"; public static final String KEY_PROXY_BYPASS_LOCAL = "deployment.proxy.bypass.local"; public static final String KEY_PROXY_HTTP_HOST = "deployment.proxy.http.host"; public static final String KEY_PROXY_HTTP_PORT = "deployment.proxy.http.port"; public static final String KEY_PROXY_HTTPS_HOST = "deployment.proxy.https.host"; public static final String KEY_PROXY_HTTPS_PORT = "deployment.proxy.https.port"; public static final String KEY_PROXY_FTP_HOST = "deployment.proxy.ftp.host"; public static final String KEY_PROXY_FTP_PORT = "deployment.proxy.ftp.port"; public static final String KEY_PROXY_SOCKS4_HOST = "deployment.proxy.socks.host"; public static final String KEY_PROXY_SOCKS4_PORT = "deployment.proxy.socks.port"; public static final String KEY_PROXY_OVERRIDE_HOSTS = "deployment.proxy.override.hosts"; /* * Logging */ public static final String KEY_ENABLE_LOGGING = "deployment.log"; //same as verbose or ICEDTEAPLUGIN_DEBUG=true public static final String KEY_ENABLE_LOGGING_HEADERS = "deployment.log.headers"; //will add header OutputContorll.getHeader To all messages public static final String KEY_ENABLE_LOGGING_TOFILE = "deployment.log.file"; public static final String KEY_ENABLE_APPLICATION_LOGGING_TOFILE ="deployment.log.file.clientapp"; //also client app will log to its separate file public static final String KEY_ENABLE_LEGACY_LOGBASEDFILELOG = "deployment.log.file.legacylog"; public static final String KEY_ENABLE_LOGGING_TOSTREAMS = "deployment.log.stdstreams"; public static final String KEY_ENABLE_LOGGING_TOSYSTEMLOG = "deployment.log.system"; /* * manifest check */ public static final String KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK = "deployment.manifest.attributes.check"; /** * Console initial status. * One of CONSOLE_* values * See declaration above: * CONSOLE_HIDE = "HIDE"; * CONSOLE_SHOW = "SHOW"; * CONSOLE_DISABLE = "DISABLE"; * CONSOLE_SHOW_PLUGIN = "SHOW_PLUGIN_ONLY"; * CONSOLE_SHOW_JAVAWS = "SHOW_JAVAWS_ONLY"; */ public static final String KEY_CONSOLE_STARTUP_MODE = "deployment.console.startup.mode"; /* * Desktop Integration */ public static final String KEY_JNLP_ASSOCIATIONS = "deployment.javaws.associations"; public static final String KEY_CREATE_DESKTOP_SHORTCUT = "deployment.javaws.shortcut"; public static final String KEY_JRE_INTSTALL_URL = "deployment.javaws.installURL"; public static final String KEY_AUTO_DOWNLOAD_JRE = "deployment.javaws.autodownload"; public static final String KEY_BROWSER_PATH = "deployment.browser.path"; public static final String KEY_UPDATE_TIMEOUT = "deployment.javaws.update.timeout"; /* * JVM arguments for plugin */ public static final String KEY_PLUGIN_JVM_ARGUMENTS= "deployment.plugin.jvm.arguments"; public static final String KEY_JRE_DIR= "deployment.jre.dir"; public static final String TRANSFER_TITLE = "Legacy configuration and cache found. Those will be now transported to new locations"; private ConfigurationException loadingException = null; public void setLoadingException(ConfigurationException ex) { loadingException = ex; } public ConfigurationException getLoadingException() { return loadingException; } public void resetToDefaults() { currentConfiguration = Defaults.getDefaults(); } public enum ConfigType { System, User } /** is it mandatory to load the system properties? */ private boolean systemPropertiesMandatory = false; /** The system's subdirResult deployment.config file */ private File systemPropertiesFile = null; /** Source of always right and only path to file (even if underlying path changes) */ private final InfrastructureFileDescriptor userDeploymentFileDescriptor; /** The user's subdirResult deployment.config file */ private File userPropertiesFile = null; /** the current deployment properties */ private Map> currentConfiguration; /** the deployment properties that cannot be changed */ private Map> unchangeableConfiguration; public DeploymentConfiguration() { this(PathsAndFiles.USER_DEPLOYMENT_FILE); } public DeploymentConfiguration(InfrastructureFileDescriptor configFile) { userDeploymentFileDescriptor = configFile; currentConfiguration = new HashMap<>(); unchangeableConfiguration = new HashMap<>(); } /** * Initialize this deployment configuration by reading configuration files. * Generally, it will try to continue and ignore errors it finds (such as file not found). * * @throws ConfigurationException if it encounters a fatal error. */ public void load() throws ConfigurationException { load(true); } /** * Initialize this deployment configuration by reading configuration files. * Generally, it will try to continue and ignore errors it finds (such as file not found). * * @param fixIssues If true, fix issues that are discovered when reading configuration by * resorting to the default values * @throws ConfigurationException if it encounters a fatal error. */ public void load(boolean fixIssues) throws ConfigurationException { SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkRead(userDeploymentFileDescriptor.getFullPath()); } File systemConfigFile = findSystemConfigFile(); load(systemConfigFile, userDeploymentFileDescriptor.getFile(), fixIssues); } void load(File systemConfigFile, File userFile, boolean fixIssues) throws ConfigurationException { Map> initialProperties = Defaults.getDefaults(); Map> systemProperties = null; /* * First, try to read the system's subdirResult deployment.config file to find if * there is a system-level deployment.poperties file */ if (systemConfigFile != null) { if (loadSystemConfiguration(systemConfigFile)) { OutputController.getLogger().log("System level " + DEPLOYMENT_CONFIG_FILE + " is mandatory: " + systemPropertiesMandatory); /* Second, read the System level deployment.properties file */ systemProperties = loadProperties(ConfigType.System, systemPropertiesFile, systemPropertiesMandatory); systemComments=loadComments(systemPropertiesFile); } if (systemProperties != null) { mergeMaps(initialProperties, systemProperties); } } /* need a copy of the original when we have to save */ unchangeableConfiguration = new HashMap<>(); Set keys = initialProperties.keySet(); for (String key : keys) { unchangeableConfiguration.put(key, new Setting<>(initialProperties.get(key))); } /* * Third, read the user's subdirResult deployment.properties file */ userPropertiesFile = userFile; Map> userProperties = loadProperties(ConfigType.User, userPropertiesFile, false); userComments=loadComments(userPropertiesFile); if (userProperties != null) { mergeMaps(initialProperties, userProperties); } if (fixIssues) { checkAndFixConfiguration(initialProperties); } currentConfiguration = initialProperties; } /** * Copies the current configuration into the target * @param target properties where to copy actual ones */ public void copyTo(Properties target) { Set names = getAllPropertyNames(); for (String name : names) { String value = getProperty(name); // for Properties, missing and null are identical if (value != null) { target.setProperty(name, value); } } } /** * Get the value for the given key * * @param key the property key * @return the value for the key, or null if it can not be found */ public String getProperty(String key) { SecurityManager sm = System.getSecurityManager(); if (sm != null) { if (userPropertiesFile != null) { sm.checkRead(userPropertiesFile.toString()); } } String value = null; if (currentConfiguration.get(key) != null) { value = currentConfiguration.get(key).getValue(); } return value; } /** * @return a Set containing all the property names */ public Set getAllPropertyNames() { SecurityManager sm = System.getSecurityManager(); if (sm != null) { if (userPropertiesFile != null) { sm.checkRead(userPropertiesFile.toString()); } } return currentConfiguration.keySet(); } /** * @return a map containing property names and the corresponding settings */ public Map> getRaw() { SecurityManager sm = System.getSecurityManager(); if (sm != null) { if (userPropertiesFile != null) { sm.checkRead(userPropertiesFile.toString()); } } return currentConfiguration; } /** * Sets the value of corresponding to the key. If the value has been marked * as locked, it is not changed * * @param key the key * @param value the value to be associated with the key */ public void setProperty(String key, String value) { SecurityManager sm = System.getSecurityManager(); if (sm != null) { if (userPropertiesFile != null) { sm.checkWrite(userPropertiesFile.toString()); } } Setting currentValue = currentConfiguration.get(key); if (currentValue != null) { if (!currentValue.isLocked()) { currentValue.setValue(value); } } else { currentValue = new Setting<>(key, R("Unknown"), false, null, null, value, R("Unknown")); currentConfiguration.put(key, currentValue); } } /** * Check that the configuration is valid. If there are invalid values,set * those values to the default values. This is done by using check() * method of the ValueCheker for each setting on the actual value. Fixes * are made in-place. * * @param initial a map representing the initial configuration */ public void checkAndFixConfiguration(Map> initial) { Map> defaults = Defaults.getDefaults(); for (String key : initial.keySet()) { Setting s = initial.get(key); if (!(s.getName().equals(key))) { OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, R("DCInternal", "key " + key + " does not match setting name " + s.getName())); } else if (!defaults.containsKey(key)) { OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, R("DCUnknownSettingWithName", key)); } else { ValueValidator checker = defaults.get(key).getValidator(); if (checker == null) { continue; } try { checker.validate(s.getValue()); } catch (IllegalArgumentException e) { OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, R("DCIncorrectValue", key, s.getValue(), checker.getPossibleValues())); s.setValue(s.getDefaultValue()); OutputController.getLogger().log(e); } } } } /** * @return the location of system-level deployment.config file, or null if none can be found */ private File findSystemConfigFile() { if (PathsAndFiles.ETC_DEPLOYMENT_CFG.getFile().isFile()) { return PathsAndFiles.ETC_DEPLOYMENT_CFG.getFile(); } String jrePath = null; try { Map> tmpProperties = parsePropertiesFile(userDeploymentFileDescriptor.getFile()); Setting jreSetting = tmpProperties.get(KEY_JRE_DIR); if (jreSetting != null) { jrePath = jreSetting.getValue(); } } catch (Exception ex) { OutputController.getLogger().log(ex); } File jreFile; if (jrePath != null) { //based on property KEY_JRE_DIR jreFile = new File(jrePath + File.separator + "lib" + File.separator + DEPLOYMENT_CONFIG_FILE); } else { jreFile = PathsAndFiles.JAVA_DEPLOYMENT_PROP_FILE.getFile(); } if (jreFile.isFile()) { return jreFile; } return null; } /** * Reads the system configuration file and sets the relevant * system-properties related variables */ private boolean loadSystemConfiguration(File configFile) throws ConfigurationException { OutputController.getLogger().log("Loading system configuation from: " + configFile); Map> systemConfiguration = new HashMap<>(); try { systemConfiguration = parsePropertiesFile(configFile); } catch (IOException e) { OutputController.getLogger().log("No System level " + DEPLOYMENT_CONFIG_FILE + " found."); OutputController.getLogger().log(e); return false; } /* * at this point, we have read the system deployment.config file * completely */ String urlString = null; try { Setting urlSettings = systemConfiguration.get("deployment.system.config"); if (urlSettings == null || urlSettings.getValue() == null) { OutputController.getLogger().log("No System level " + DEPLOYMENT_PROPERTIES + " found in "+configFile.getAbsolutePath()); return false; } urlString = urlSettings.getValue(); Setting mandatory = systemConfiguration.get("deployment.system.config.mandatory"); systemPropertiesMandatory = Boolean.valueOf(mandatory == null ? null : mandatory.getValue()); //never null OutputController.getLogger().log("System level settings " + DEPLOYMENT_PROPERTIES + " are mandatory:" + systemPropertiesMandatory); URL url = new URL(urlString); if (url.getProtocol().equals("file")) { systemPropertiesFile = new File(url.getFile()); OutputController.getLogger().log("Using System level" + DEPLOYMENT_PROPERTIES + ": " + systemPropertiesFile); return true; } else { OutputController.getLogger().log("Remote + " + DEPLOYMENT_PROPERTIES + " not supported: " + urlString + "in " + configFile.getAbsolutePath()); return false; } } catch (MalformedURLException e) { OutputController.getLogger().log("Invalid url for " + DEPLOYMENT_PROPERTIES+ ": " + urlString + "in " + configFile.getAbsolutePath()); OutputController.getLogger().log(e); if (systemPropertiesMandatory){ ConfigurationException ce = new ConfigurationException("Invalid url to system properties, which are mandatory"); ce.initCause(e); throw ce; } else { return false; } } } /** * Loads the properties file, if one exists * * @param type the ConfigType to load * @param file the File to load Properties from * @param mandatory indicates if reading this file is mandatory * * @throws ConfigurationException if the file is mandatory but cannot be read */ private Map> loadProperties(ConfigType type, File file, boolean mandatory) throws ConfigurationException { if (file == null || !file.isFile()) { OutputController.getLogger().log("No " + type.toString() + " level " + DEPLOYMENT_PROPERTIES + " found."); if (!mandatory) { return null; } else { throw new ConfigurationException(); } } OutputController.getLogger().log("Loading " + type.toString() + " level properties from: " + file); try { return parsePropertiesFile(file); } catch (IOException e) { if (mandatory){ ConfigurationException ce = new ConfigurationException("Exception during loading of " + file + " which is mandatory to read"); ce.initCause(e); throw ce; } OutputController.getLogger().log(e); return null; } } /** * Saves all properties that are not part of default or system properties * * @throws IOException if unable to save the file * @throws IllegalStateException if save() is called before load() */ public void save() throws IOException { if (userPropertiesFile == null) { throw new IllegalStateException("must load() before save()"); } SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkWrite(userPropertiesFile.toString()); } OutputController.getLogger().log("Saving properties into " + userPropertiesFile.toString()); Properties toSave = new Properties(); for (String key : currentConfiguration.keySet()) { String oldValue = unchangeableConfiguration.get(key) == null ? null : unchangeableConfiguration.get(key).getValue(); String newValue = currentConfiguration.get(key) == null ? null : currentConfiguration .get(key).getValue(); if (oldValue == null && newValue == null) { continue; } else if (oldValue == null && newValue != null) { toSave.setProperty(key, newValue); } else if (oldValue != null && newValue == null) { toSave.setProperty(key, newValue); } else { // oldValue != null && newValue != null if (!oldValue.equals(newValue)) { toSave.setProperty(key, newValue); } } } File backupPropertiesFile = new File(userPropertiesFile.toString() + ".old"); if (userPropertiesFile.isFile()) { if (!userPropertiesFile.renameTo(backupPropertiesFile)) { throw new IOException("Error saving backup copy of " + userPropertiesFile); } } FileUtils.createParentDir(userPropertiesFile); try (OutputStream out = new BufferedOutputStream(new FileOutputStream(userPropertiesFile))) { String comments = DEPLOYMENT_COMMENT; if (userComments.length() > 0) { comments = comments + System.lineSeparator() + userComments; } toSave.store(out, comments); ; } } /** * Reads a properties file and returns a map representing the properties * * @param propertiesFile the file to read Properties from * @throws IOException if an IO problem occurs */ private Map> parsePropertiesFile(File propertiesFile) throws IOException { Map> result = new HashMap<>(); Properties properties = new Properties(); try (Reader reader = new BufferedReader(new FileReader(propertiesFile))) { properties.load(reader); } Set keys = properties.stringPropertyNames(); for (String key : keys) { if (key.endsWith(".locked")) { String realKey = key.substring(0, key.length() - ".locked".length()); Setting configValue = result.get(realKey); if (configValue == null) { configValue = new Setting<>(realKey, R("Unknown"), true, null, null, null, propertiesFile.toString()); result.put(realKey, configValue); } else { configValue.setLocked(true); } } else { /* when parsing a properties we set value without checking if it is locked or not */ String newValue = properties.getProperty(key); Setting configValue = result.get(key); if (configValue == null) { configValue = new Setting<>(key, R("Unknown"), false, null, null, newValue, propertiesFile.toString()); result.put(key, configValue); } else { configValue.setValue(newValue); configValue.setSource(propertiesFile.toString()); } } } return result; } /** * Merges two maps while respecting whether the values have been locked or * not. All values from srcMap are put into finalMap, replacing values in * finalMap if necessary, unless the value is present and marked as locked * in finalMap * * @param finalMap the destination for putting values * @param srcMap the source for reading key value pairs */ private void mergeMaps(Map> finalMap, Map> srcMap) { for (String key : srcMap.keySet()) { Setting destValue = finalMap.get(key); Setting srcValue = srcMap.get(key); if (destValue == null) { finalMap.put(key, srcValue); } else { if (!destValue.isLocked()) { destValue.setSource(srcValue.getSource()); destValue.setValue(srcValue.getValue()); } } } } /** * Dumps the configuration to the PrintStream * * @param config a map of key,value pairs representing the configuration to * dump * @param out the PrintStream to write data to */ @SuppressWarnings("unused") private static void dumpConfiguration(Map> config, PrintStream out) { OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, "KEY: VALUE [Locked]"); for (String key : config.keySet()) { Setting value = config.get(key); out.println("'" + key + "': '" + value.getValue() + "'" + (value.isLocked() ? " [LOCKED]" : "")); } } public static void move14AndOlderFilesTo15StructureCatched() { try { move14AndOlderFilesTo15Structure(); } catch (Throwable t) { OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "Critical error during converting old files to new. Continuing"); OutputController.getLogger().log(t); } } private static void move14AndOlderFilesTo15Structure() { int errors = 0; String PRE_15_DEPLOYMENT_DIR = ".icedtea"; String LEGACY_USER_HOME = System.getProperty("user.home") + File.separator + PRE_15_DEPLOYMENT_DIR; String legacyProperties = LEGACY_USER_HOME + File.separator + DEPLOYMENT_PROPERTIES; File configDir = new File(PathsAndFiles.USER_CONFIG_HOME); File cacheDir = new File(PathsAndFiles.USER_CACHE_HOME); File legacyUserDir = new File(LEGACY_USER_HOME); if (legacyUserDir.exists()) { OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, TRANSFER_TITLE); OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, PathsAndFiles.USER_CONFIG_HOME + " and " + PathsAndFiles.USER_CACHE_HOME); OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, "You should not see this message next time you run icedtea-web!"); OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, "Your custom dirs will not be touched and will work"); OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, "-----------------------------------------------"); OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, "Preparing new directories:"); OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, " " + PathsAndFiles.USER_CONFIG_HOME); errors += resultToStd(configDir.mkdirs()); OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, " " + PathsAndFiles.USER_CACHE_HOME); errors += resultToStd(cacheDir.mkdirs()); //move this first, the creation of config singleton may happen anytime... //but must not before USER_DEPLOYMENT_FILE is moved and should not in this block String currentProperties = PathsAndFiles.USER_DEPLOYMENT_FILE.getDefaultFullPath(); errors += moveLegacyToCurrent(legacyProperties, currentProperties); String legacyPropertiesOld = LEGACY_USER_HOME + File.separator + DEPLOYMENT_PROPERTIES + ".old"; String currentPropertiesOld = currentProperties + ".old"; errors += moveLegacyToCurrent(legacyPropertiesOld, currentPropertiesOld); String legacySecurity = LEGACY_USER_HOME + File.separator + "security"; String currentSecurity = PathsAndFiles.USER_DEFAULT_SECURITY_DIR; errors += moveLegacyToCurrent(legacySecurity, currentSecurity); String legacyAppletTrust = LEGACY_USER_HOME + File.separator + APPLET_TRUST_SETTINGS; String currentAppletTrust = PathsAndFiles.APPLET_TRUST_SETTINGS_USER.getDefaultFullPath(); errors += moveLegacyToCurrent(legacyAppletTrust, currentAppletTrust); //note - all here use default path. Any call to getFullPAth will invoke creation of config singleton // but: we DO copy only defaults. There is no need to copy nondefaults! // nond-efault will be used thanks to config singleton read from copied deployment.properties String legacyCache = LEGACY_USER_HOME + File.separator + "cache"; String currentCache = PathsAndFiles.CACHE_DIR.getDefaultFullPath(); errors += moveLegacyToCurrent(legacyCache, currentCache); OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, "Adapting " + PathsAndFiles.CACHE_INDEX_FILE_NAME + " to new destination"); //replace all legacyCache by currentCache in new recently_used try { File f = PathsAndFiles.getRecentlyUsedFile().getDefaultFile(); String s = FileUtils.loadFileAsString(f); s = s.replace(legacyCache, currentCache); FileUtils.saveFile(s, f); } catch (IOException ex) { OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, ex); errors++; } String legacyPcahceDir = LEGACY_USER_HOME + File.separator + "pcache"; String currentPcacheDir = PathsAndFiles.PCACHE_DIR.getDefaultFullPath(); errors += moveLegacyToCurrent(legacyPcahceDir, currentPcacheDir); String legacyLogDir = LEGACY_USER_HOME + File.separator + "log"; String currentLogDir = PathsAndFiles.LOG_DIR.getDefaultFullPath(); errors += moveLegacyToCurrent(legacyLogDir, currentLogDir); String legacyTmp = LEGACY_USER_HOME + File.separator + "tmp"; String currentTmp = PathsAndFiles.TMP_DIR.getDefaultFullPath(); errors += moveLegacyToCurrent(legacyTmp, currentTmp); OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, "Removing now empty " + LEGACY_USER_HOME); errors += resultToStd(legacyUserDir.delete()); if (errors != 0) { OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, "There occureed " + errors + " errors"); OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, "Please double check content of old data in " + LEGACY_USER_HOME + " with "); OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, "new " + PathsAndFiles.USER_CONFIG_HOME + " and " + PathsAndFiles.USER_CACHE_HOME); OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, "To disable this check again, please remove " + LEGACY_USER_HOME); } } else { OutputController.getLogger().log("System is already following XDG .cache and .config specifications"); try { OutputController.getLogger().log("config: " + PathsAndFiles.USER_CONFIG_HOME + " file exists: " + configDir.exists()); } catch (Exception ex) { OutputController.getLogger().log(ex); } try { OutputController.getLogger().log("cache: " + PathsAndFiles.USER_CACHE_HOME + " file exists:" + cacheDir.exists()); } catch (Exception ex) { OutputController.getLogger().log(ex); } } //this call should endure even if (ever) will migration code be removed DirectoryValidator.DirectoryCheckResults r = new DirectoryValidator().ensureDirs(); if (!JNLPRuntime.isHeadless()) { if (r.getFailures() > 0) { JOptionPane.showMessageDialog(null, r.getMessage()); } } } private static int moveLegacyToCurrent(String legacy, String current) { OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, "Moving " + legacy + " to " + current); File cf = new File(current); File old = new File(legacy); if (cf.exists()) { OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, "Warning! Destination " + current + " exists!"); } if (old.exists()) { boolean moved = old.renameTo(cf); return resultToStd(moved); } else { OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, "Source " + legacy + " do not exists, nothing to do"); return 0; } } private static int resultToStd(boolean securityMove) { if (securityMove) { OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, "OK"); return 0; } else { OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, "ERROR"); return 1; } } //standard date.toString format public static final SimpleDateFormat pattern = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy"); private static String loadComments(File path) { StringBuilder r = new StringBuilder(); try (BufferedReader br = new BufferedReader(new FileReader(path))) { while (true) { String s = br.readLine(); if (s == null) { break; } s = s.trim(); if (s.startsWith("#")) { String decommented = s.substring(1); if (decommented.isEmpty()){ continue; } if (decommented.equals(DEPLOYMENT_COMMENT)){ continue; } //there is always also date Date dd = null; try { dd = pattern.parse(decommented); } catch (Exception ex) { //we really dont care, failure is our decision point } if (dd == null){ r.append(decommented).append("\n"); } } } } catch (Exception ex) { OutputController.getLogger().log(ex); } return r.toString().trim(); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/config/PaxHeaders.17941/Defaults.java0000644000000000000000000000013112654402377024355 xustar0030 mtime=1454507263.270432141 30 atime=1454507327.131580443 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/config/Defaults.java0000644000175000002070000004506012654402377025106 0ustar00jvanekmock00000000000000/* Defaults.java Copyright (C) 2010 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.config; import java.util.HashMap; import java.util.Map; import net.sourceforge.jnlp.ShortcutDesc; import static net.sourceforge.jnlp.config.PathsAndFiles.*; import net.sourceforge.jnlp.runtime.JNLPProxySelector; import net.sourceforge.jnlp.runtime.ManifestAttributesChecker; import static net.sourceforge.jnlp.runtime.Translator.R; /** * This class stores the default configuration */ public class Defaults { /** * Get the default settings for deployment * @return the default settings for deployment */ public static Map> getDefaults() { SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkRead(USER_DEPLOYMENT_FILE.getDefaultFullPath()); sm.checkRead(USER_DEPLOYMENT_FILE.getFullPath()); } /* * This is more or less a straight copy from the deployment * configuration page, with occasional replacements of "" or no-defaults * with null * * The format of this is: * name * checker (can be null or a ValueChecker) * value (can be null or a String) */ Object[][] defaults = new Object[][] { /* infrastructure */ { DeploymentConfiguration.KEY_USER_CACHE_DIR, BasicValueValidators.getFilePathValidator(), CACHE_DIR.getDefaultFullPath() }, { DeploymentConfiguration.KEY_USER_PERSISTENCE_CACHE_DIR, BasicValueValidators.getFilePathValidator(), PCACHE_DIR.getDefaultFullPath() }, { DeploymentConfiguration.KEY_SYSTEM_CACHE_DIR, BasicValueValidators.getFilePathValidator(), null }, { DeploymentConfiguration.KEY_USER_LOG_DIR, BasicValueValidators.getFilePathValidator(), LOG_DIR.getDefaultFullPath() }, { DeploymentConfiguration.KEY_USER_TMP_DIR, BasicValueValidators.getFilePathValidator(), TMP_DIR.getDefaultFullPath() }, { DeploymentConfiguration.KEY_USER_LOCKS_DIR, BasicValueValidators.getFilePathValidator(), LOCKS_DIR.getDefaultFullPath() }, { DeploymentConfiguration.KEY_USER_NETX_RUNNING_FILE, BasicValueValidators.getFilePathValidator(), MAIN_LOCK.getDefaultFullPath() }, /* certificates and policy files */ { DeploymentConfiguration.KEY_USER_SECURITY_POLICY, BasicValueValidators.getUrlValidator(), "file://" + JAVA_POLICY.getDefaultFullPath() }, { DeploymentConfiguration.KEY_USER_TRUSTED_CA_CERTS, BasicValueValidators.getFilePathValidator(), USER_CACERTS.getDefaultFullPath() }, { DeploymentConfiguration.KEY_USER_TRUSTED_JSSE_CA_CERTS, BasicValueValidators.getFilePathValidator(), USER_JSSECAC.getDefaultFullPath() }, { DeploymentConfiguration.KEY_USER_TRUSTED_CERTS, BasicValueValidators.getFilePathValidator(), USER_CERTS.getDefaultFullPath() }, { DeploymentConfiguration.KEY_USER_TRUSTED_JSSE_CERTS, BasicValueValidators.getFilePathValidator(), USER_JSSECER.getDefaultFullPath() }, { DeploymentConfiguration.KEY_USER_TRUSTED_CLIENT_CERTS, BasicValueValidators.getFilePathValidator(), USER_CLIENTCERT.getDefaultFullPath() }, { DeploymentConfiguration.KEY_SYSTEM_SECURITY_POLICY, BasicValueValidators.getUrlValidator(), null }, { DeploymentConfiguration.KEY_SYSTEM_TRUSTED_CA_CERTS, BasicValueValidators.getFilePathValidator(), SYS_CACERT.getDefaultFullPath() }, { DeploymentConfiguration.KEY_SYSTEM_TRUSTED_JSSE_CA_CERTS, BasicValueValidators.getFilePathValidator(), SYS_JSSECAC.getDefaultFullPath() }, { DeploymentConfiguration.KEY_SYSTEM_TRUSTED_CERTS, BasicValueValidators.getFilePathValidator(), SYS_CERT.getDefaultFullPath() }, { DeploymentConfiguration.KEY_SYSTEM_TRUSTED_JSSE_CERTS, BasicValueValidators.getFilePathValidator(), SYS_JSSECERT.getDefaultFullPath() }, { DeploymentConfiguration.KEY_SYSTEM_TRUSTED_CLIENT_CERTS, BasicValueValidators.getFilePathValidator(), SYS_CLIENTCERT.getDefaultFullPath() }, /* security access and control */ { DeploymentConfiguration.KEY_SECURITY_PROMPT_USER, BasicValueValidators.getBooleanValidator(), String.valueOf(true) }, { "deployment.security.askgrantdialog.notinca", BasicValueValidators.getBooleanValidator(), String.valueOf(true) }, { "deployment.security.notinca.warning", BasicValueValidators.getBooleanValidator(), String.valueOf(true) }, { "deployment.security.expired.warning", BasicValueValidators.getBooleanValidator(), String.valueOf(true) }, { "deployment.security.jsse.hostmismatch.warning", BasicValueValidators.getBooleanValidator(), String.valueOf(true) }, { DeploymentConfiguration.KEY_SECURITY_TRUSTED_POLICY, BasicValueValidators.getFilePathValidator(), null }, { DeploymentConfiguration.KEY_SECURITY_ALLOW_HIDE_WINDOW_WARNING, BasicValueValidators.getBooleanValidator(), String.valueOf(true) }, { DeploymentConfiguration.KEY_SECURITY_PROMPT_USER_FOR_JNLP, BasicValueValidators.getBooleanValidator(), String.valueOf(true) }, { DeploymentConfiguration.KEY_STRICT_JNLP_CLASSLOADER, BasicValueValidators.getBooleanValidator(), String.valueOf(true) }, { DeploymentConfiguration.KEY_SECURITY_PROMPT_USER_FOR_JNLP, BasicValueValidators.getBooleanValidator(), String.valueOf(true) }, /* networking */ { DeploymentConfiguration.KEY_PROXY_TYPE, BasicValueValidators.getRangedIntegerValidator(JNLPProxySelector.PROXY_TYPE_UNKNOWN, JNLPProxySelector.PROXY_TYPE_BROWSER), String.valueOf(JNLPProxySelector.PROXY_TYPE_BROWSER) }, { DeploymentConfiguration.KEY_PROXY_SAME, BasicValueValidators.getBooleanValidator(), String.valueOf(false) }, { DeploymentConfiguration.KEY_PROXY_AUTO_CONFIG_URL, BasicValueValidators.getUrlValidator(), null }, { DeploymentConfiguration.KEY_PROXY_BYPASS_LIST, null, null }, { DeploymentConfiguration.KEY_PROXY_BYPASS_LOCAL, null, null }, { DeploymentConfiguration.KEY_PROXY_HTTP_HOST, null, null }, { DeploymentConfiguration.KEY_PROXY_HTTP_PORT, null, null }, { DeploymentConfiguration.KEY_PROXY_HTTPS_HOST, null, null }, { DeploymentConfiguration.KEY_PROXY_HTTPS_PORT, null, null }, { DeploymentConfiguration.KEY_PROXY_FTP_HOST, null, null }, { DeploymentConfiguration.KEY_PROXY_FTP_PORT, null, null }, { DeploymentConfiguration.KEY_PROXY_SOCKS4_HOST, null, null }, { DeploymentConfiguration.KEY_PROXY_SOCKS4_PORT, null, null }, { DeploymentConfiguration.KEY_PROXY_OVERRIDE_HOSTS, null, null }, /* cache and optional package repository */ { "deployment.cache.max.size", BasicValueValidators.getRangedIntegerValidator(-1, Integer.MAX_VALUE), String.valueOf("-1") }, { "deployment.cache.jarcompression", BasicValueValidators.getRangedIntegerValidator(0, 10), String.valueOf(0) }, { "deployment.javapi.cache.enabled", BasicValueValidators.getBooleanValidator(), String.valueOf(false) }, /* java console */ { DeploymentConfiguration.KEY_CONSOLE_STARTUP_MODE, BasicValueValidators.getStringValidator(new String[] { DeploymentConfiguration.CONSOLE_DISABLE, DeploymentConfiguration.CONSOLE_HIDE, DeploymentConfiguration.CONSOLE_SHOW, DeploymentConfiguration.CONSOLE_SHOW_PLUGIN, DeploymentConfiguration.CONSOLE_SHOW_JAVAWS }), DeploymentConfiguration.CONSOLE_HIDE }, { DeploymentConfiguration.KEY_ENABLE_LOGGING, BasicValueValidators.getBooleanValidator(), String.valueOf(false) }, { DeploymentConfiguration.KEY_ENABLE_LOGGING_HEADERS, BasicValueValidators.getBooleanValidator(), String.valueOf(false) }, { DeploymentConfiguration.KEY_ENABLE_LOGGING_TOFILE, BasicValueValidators.getBooleanValidator(), String.valueOf(false) }, { DeploymentConfiguration.KEY_ENABLE_APPLICATION_LOGGING_TOFILE, BasicValueValidators.getBooleanValidator(), String.valueOf(false) }, { DeploymentConfiguration.KEY_ENABLE_LEGACY_LOGBASEDFILELOG, BasicValueValidators.getBooleanValidator(), String.valueOf(true) }, { DeploymentConfiguration.KEY_ENABLE_LOGGING_TOSTREAMS, BasicValueValidators.getBooleanValidator(), String.valueOf(true) }, { DeploymentConfiguration.KEY_ENABLE_LOGGING_TOSYSTEMLOG, BasicValueValidators.getBooleanValidator(), String.valueOf(true) }, /* JNLP association */ { DeploymentConfiguration.KEY_JNLP_ASSOCIATIONS, BasicValueValidators.getRangedIntegerValidator(DeploymentConfiguration.JNLP_ASSOCIATION_NEVER, DeploymentConfiguration.JNLP_ASSOCIATION_REPLACE_ASK), String.valueOf(DeploymentConfiguration.JNLP_ASSOCIATION_ASK_USER) }, /* desktop integration */ { DeploymentConfiguration.KEY_CREATE_DESKTOP_SHORTCUT, BasicValueValidators.getStringValidator(new String[] { ShortcutDesc.CREATE_ALWAYS, ShortcutDesc.CREATE_ALWAYS_IF_HINTED, ShortcutDesc.CREATE_ASK_USER, ShortcutDesc.CREATE_ASK_USER_IF_HINTED, ShortcutDesc.CREATE_NEVER }), ShortcutDesc.CREATE_ASK_USER_IF_HINTED }, /* jre selection */ { DeploymentConfiguration.KEY_JRE_INTSTALL_URL, BasicValueValidators.getUrlValidator(), null }, /* jre management */ { DeploymentConfiguration.KEY_AUTO_DOWNLOAD_JRE, BasicValueValidators.getBooleanValidator(), String.valueOf(false) }, /* browser selection */ { DeploymentConfiguration.KEY_BROWSER_PATH, BasicValueValidators.getFilePathValidator(), null }, /* check for update timeout */ { DeploymentConfiguration.KEY_UPDATE_TIMEOUT, BasicValueValidators.getRangedIntegerValidator(0, 10000), String.valueOf(500) }, //JVM arguments for plugin { DeploymentConfiguration.KEY_PLUGIN_JVM_ARGUMENTS, null, null }, //unsigned applet security level { DeploymentConfiguration.KEY_SECURITY_LEVEL, new SecurityValueValidator(), null }, //JVM executable for itw { DeploymentConfiguration.KEY_JRE_DIR, null, null }, //enable manifest-attributes checks { DeploymentConfiguration.KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK, BasicValueValidators.getManifestAttributeCheckValidator(), String.valueOf(ManifestAttributesChecker.MANIFEST_ATTRIBUTES_CHECK.ALL) } }; HashMap> result = new HashMap<>(); for (Object[] default1 : defaults) { String name = (String) default1[0]; ValueValidator checker = (ValueValidator) default1[1]; String actualValue = (String) default1[2]; boolean locked = false; Setting value = new Setting<>(name, R("Unknown"), locked, checker, actualValue, actualValue, R("DCSourceInternal")); result.put(name, value); } return result; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/config/PaxHeaders.17941/ConfiguratonValidator.java0000644000000000000000000000013112654402377027112 xustar0030 mtime=1454507263.269432154 30 atime=1454507327.130580457 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/config/ConfiguratonValidator.java0000644000175000002070000001037012654402377027637 0ustar00jvanekmock00000000000000/* Validator.java Copyright (C) 2010 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.config; import java.util.ArrayList; import java.util.List; import java.util.Map; /** * Validates a DeploymentConfiguration by identifying settings with * unrecognized names or incorrect values. */ public class ConfiguratonValidator { private List> incorrectEntries; private List> unrecognizedEntries; private Map> toValidate = null; private boolean validated = false; /** * @param toValidate the settings to validate */ public ConfiguratonValidator(Map> toValidate) { this.toValidate = toValidate; } /** * Validates the settings used in the constructor. Use * {@link #getIncorrectSetting()} and {@link #getUnrecognizedSetting()} to * get the list of incorrect or unrecognized settings. */ public void validate() { incorrectEntries = new ArrayList>(); unrecognizedEntries = new ArrayList>(); Map> knownGood = Defaults.getDefaults(); for (String key : toValidate.keySet()) { // check for known incorrect settings if (knownGood.containsKey(key)) { Setting good = knownGood.get(key); Setting unknown = toValidate.get(key); ValueValidator checker = good.getValidator(); if (checker != null) { try { checker.validate(unknown.getValue()); } catch (IllegalArgumentException e) { Setting strange = new Setting(unknown); strange.setValue(unknown.getValue()); incorrectEntries.add(strange); } } } else { // check for unknown settings Setting strange = new Setting(toValidate.get(key)); unrecognizedEntries.add(strange); } } validated = true; } /** * @return a list of settings which have incorrect values */ public List> getIncorrectSetting() { if (!validated) { throw new IllegalStateException(); } return new ArrayList>(incorrectEntries); } /** * @return a list of settings which are not recognized */ public List> getUnrecognizedSetting() { if (!validated) { throw new IllegalStateException(); } return new ArrayList>(unrecognizedEntries); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/config/PaxHeaders.17941/BasicValueValidators.java0000644000000000000000000000013112654402377026655 xustar0030 mtime=1454507263.269432154 30 atime=1454507327.130580457 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/config/BasicValueValidators.java0000644000175000002070000003160312654402377027404 0ustar00jvanekmock00000000000000/* BasicValueCheckers.java Copyright (C) 2010 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.config; import net.sourceforge.jnlp.runtime.ManifestAttributesChecker; import java.io.File; import static net.sourceforge.jnlp.runtime.Translator.R; import java.net.URL; import java.util.Arrays; import java.util.Locale; /** * Provides {@link ValueValidator} implementations for some common value types * * @see #getBooleanValidator() * @see #getFilePathValidator() * @see #getRangedIntegerValidator(int, int) * @see #getStringValidator(String[]) * @see #getUrlValidator() */ public class BasicValueValidators { /** * Checks if a value is a valid boolean */ private static class BooleanValidator implements ValueValidator { @Override public void validate(Object value) throws IllegalArgumentException { Object possibleValue = value; if (possibleValue instanceof String) { String lower = ((String) possibleValue).toLowerCase(Locale.ENGLISH); if (lower.equals(Boolean.TRUE.toString()) || (lower.equals(Boolean.FALSE.toString()))) { possibleValue = Boolean.valueOf(lower); } } if (!(possibleValue instanceof Boolean)) { throw new IllegalArgumentException(); } } @Override public String getPossibleValues() { return R("VVPossibleBooleanValues", Boolean.TRUE.toString(), Boolean.FALSE.toString()); } }; /** * Checks if a value is a valid file path (not a valid file!). The actual * file may or may not exist */ //package private for testing purposes static class FilePathValidator implements ValueValidator { @Override public void validate(Object value) throws IllegalArgumentException { if (value == null) { return; } Object possibleValue = value; if (!(possibleValue instanceof String)) { throw new IllegalArgumentException("Value should be string!"); } String possibleFile = (String) possibleValue; boolean absolute = new File(possibleFile).isAbsolute(); if (!absolute) { throw new IllegalArgumentException("File must be absolute"); } } @Override public String getPossibleValues() { return R("VVPossibleFileValues"); } } /** * Checks that the value is an Integer or Long (or a String representation * of one) that is within a desired range). */ private static class RangedIntegerValidator implements ValueValidator { private int low = 0; private int high = 0; public RangedIntegerValidator(int low, int high) { this.low = low; this.high = high; } @Override public void validate(Object value) throws IllegalArgumentException { Object possibleValue = value; long actualValue = 0; try { if (possibleValue instanceof String) { actualValue = Long.valueOf((String) possibleValue); } else if (possibleValue instanceof Integer) { actualValue = (Integer) possibleValue; } else if (possibleValue instanceof Long) { actualValue = (Long) possibleValue; } else { throw new IllegalArgumentException("Must be an integer"); } } catch (NumberFormatException e) { throw new IllegalArgumentException("Must be an integer"); } if (actualValue < low || actualValue > high) { throw new IllegalArgumentException("Not in range from " + low + " to " + high); } } @Override public String getPossibleValues() { return R("VVPossibleRangedIntegerValues", low, high); } }; /** * Checks that the value is one of the acceptable String values */ private static class StringValueValidator implements ValueValidator { String[] options = null; public StringValueValidator(String[] acceptableOptions) { options = acceptableOptions; } @Override public void validate(Object value) throws IllegalArgumentException { Object possibleValue = value; if (!(possibleValue instanceof String)) { throw new IllegalArgumentException("Must be a string"); } String stringVal = (String) possibleValue; boolean found = false; for (String knownVal : options) { if (knownVal.equals(stringVal)) { found = true; break; } } if (!found) { throw new IllegalArgumentException(); } } @Override public String getPossibleValues() { return Arrays.toString(options); } } /** * Checks that the value is one of the acceptable single String values * or an acceptable combination of String values */ private static class MultipleStringValueValidator implements ValueValidator { private final String[] singleOptions; private final String[] comboOptions; public MultipleStringValueValidator(String[] singleOptions, String[] comboOptions) { this.singleOptions = singleOptions; this.comboOptions = comboOptions; } @Override public void validate(Object value) throws IllegalArgumentException { Object possibleValue = value; if (!(possibleValue instanceof String)) { throw new IllegalArgumentException("Must be a string"); } String stringVal = (String) possibleValue; boolean found = false; for (String knownVal : singleOptions) { if (knownVal.equals(stringVal)) { found = true; break; } } if (!found) { String[] possibleCombo = splitCombination(stringVal); for (String val : possibleCombo) { if (comboOptionsContains(val)) { found = true; } else { throw new IllegalArgumentException(); } } } if (!found) { throw new IllegalArgumentException(); } } private boolean comboOptionsContains(String possibleVal) { for (String value : comboOptions) { if (value.equals(possibleVal)) { return true; } } return false; } @Override public String getPossibleValues() { String message = "(Values that can be used alone only): " + Arrays.toString(singleOptions) + " (Values that can be used in combination separated by the delimiter \"" + DELIMITER + "\" with no space expected ): " + Arrays.toString(comboOptions); return message; } } private final static String DELIMITER = ","; public static String[] splitCombination(String val) { return val.split(DELIMITER); } private static class ManifestAttributeCheckValidator extends MultipleStringValueValidator { public ManifestAttributeCheckValidator() { super(new String[] { ManifestAttributesChecker.MANIFEST_ATTRIBUTES_CHECK.ALL.toString(), ManifestAttributesChecker.MANIFEST_ATTRIBUTES_CHECK.NONE.toString() }, new String[] { ManifestAttributesChecker.MANIFEST_ATTRIBUTES_CHECK.ALAC.toString(), ManifestAttributesChecker.MANIFEST_ATTRIBUTES_CHECK.CODEBASE.toString(), ManifestAttributesChecker.MANIFEST_ATTRIBUTES_CHECK.ENTRYPOINT.toString(), ManifestAttributesChecker.MANIFEST_ATTRIBUTES_CHECK.PERMISSIONS.toString(), ManifestAttributesChecker.MANIFEST_ATTRIBUTES_CHECK.TRUSTED.toString() }); } } /** * Checks that the value is a URL */ private static class UrlValidator implements ValueValidator { @Override public void validate(Object value) throws IllegalArgumentException { if (value == null) { return; } try { new URL((String) value); } catch (Exception e) { throw new IllegalArgumentException(); } } @Override public String getPossibleValues() { return R("VVPossibleUrlValues"); } } /** * @return a {@link ValueValidator} that can be used to check if an object is * a valid Boolean */ public static ValueValidator getBooleanValidator() { return new BooleanValidator(); } /** * @return a {@link ValueValidator} that can be used to check if an object is * a String containing a valid file path or not */ public static ValueValidator getFilePathValidator() { return new FilePathValidator(); } /** * Returns a {@link ValueValidator} that checks if an object represents a * valid integer (it is a Integer or Long or a String representation of * one), within the given range. The values are inclusive. * @param low the lowest valid value * @param high the highest valid value * @return value validator for given range */ public static ValueValidator getRangedIntegerValidator(int low, int high) { return new RangedIntegerValidator(low, high); } /** * Returns a {@link ValueValidator} that checks if an object is a string from * one of the provided Strings. * @param validValues an array of Strings which are considered valid * @return validator for given strings */ public static ValueValidator getStringValidator(String[] validValues) { return new StringValueValidator(validValues); } /** * Returns a {@link ValueValidator} that checks if an object is a string from * one of the provided single option Strings or a combination from * the provided combination Strings. * @param singleValues an array of Strings which are considered valid only by themselves * @param comboValues an array of Strings which are considered valid in any combination * with themselves * @return validator forgiven strings */ public static ValueValidator getMultipleStringValidator(String[] singleValues, String[] comboValues) { return new MultipleStringValueValidator(singleValues, comboValues); } /** * @return a {@link ValueValidator} that checks if an object is a string * from the possible single or combination ManifestAttributeCheck values */ public static ValueValidator getManifestAttributeCheckValidator() { return new ManifestAttributeCheckValidator(); } /** * @return a {@link ValueValidator} that checks if an object represents a * valid url */ public static ValueValidator getUrlValidator() { return new UrlValidator(); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/cache0000644000000000000000000000013112654402377021464 xustar0030 mtime=1454507263.269432154 30 atime=1454507658.779157357 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/cache/0000755000175000002070000000000012654402377022265 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/netx/net/sourceforge/jnlp/cache/PaxHeaders.17941/package-info.java0000644000000000000000000000013112654402377024730 xustar0030 mtime=1454507263.269432154 30 atime=1454507327.130580457 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/cache/package-info.java0000644000175000002070000000327112654402377025457 0ustar00jvanekmock00000000000000/* package-info.java Copyright (C) 2014 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.*/ /** * This package contains the JNLP cache. */ package net.sourceforge.jnlp.cache; icedtea-web-1.6.2/netx/net/sourceforge/jnlp/cache/PaxHeaders.17941/UpdatePolicy.java0000644000000000000000000000013112654402377025006 xustar0030 mtime=1454507263.269432154 30 atime=1454507327.130580457 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/cache/UpdatePolicy.java0000644000175000002070000000506312654402377025536 0ustar00jvanekmock00000000000000// Copyright (C) 2002 Jon A. Maxwell (JAM) // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp.cache; /** * A policy that determines when a resource should be checked for * an updated version. * * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.3 $ */ public class UpdatePolicy { // todo: implement session updating // todo: doesn't seem to work in the same JVM, probably because // Resource is being held by a tracker so it isn't collected; // then next time a tracker adds the resource even if // shouldUpdate==true it's state is already marked // CONNECTED|DOWNLOADED. Let the resource be collected or reset // to UNINITIALIZED. public static UpdatePolicy ALWAYS = new UpdatePolicy(0); public static UpdatePolicy SESSION = new UpdatePolicy(-1); public static UpdatePolicy FORCE = new UpdatePolicy(Long.MIN_VALUE); public static UpdatePolicy NEVER = new UpdatePolicy(Long.MAX_VALUE); private long timeDiff = -1; /** * Create a new update policy; this policy always updates the * entry unless the shouldUpdate method is overridden. */ public UpdatePolicy() { } /** * Create an update policy that only checks a file for being * updated if it has not been checked for longer than the * specified time. * * @param timeDiff how long in ms until update needed */ public UpdatePolicy(long timeDiff) { this.timeDiff = timeDiff; } /** * @return whether the resource should be checked for being * up-to-date. * @param entry entry which shoul;d be cared */ public boolean shouldUpdate(CacheEntry entry) { long updated = entry.getLastUpdated(); long current = System.currentTimeMillis(); return current - updated >= timeDiff; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/cache/PaxHeaders.17941/ResourceUrlCreator.java0000644000000000000000000000013112654402377026176 xustar0030 mtime=1454507263.268432167 30 atime=1454507327.130580457 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/cache/ResourceUrlCreator.java0000644000175000002070000001555312654402377026733 0ustar00jvanekmock00000000000000/* ResourceUrlCreator.java Copyright (C) 2011 Red Hat, Inc This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.cache; import java.net.MalformedURLException; import java.net.URL; import java.util.LinkedList; import java.util.List; import net.sourceforge.jnlp.DownloadOptions; public class ResourceUrlCreator { protected final Resource resource; protected final DownloadOptions downloadOptions; public ResourceUrlCreator(Resource resource, DownloadOptions downloadOptions) { this.resource = resource; this.downloadOptions = downloadOptions; } /** * Returns a list of URLs that the resources might be downloadable from. * The Resources may not be downloadable from any of them. The returned order is the order * the urls should be attempted in. * @return a list of URLs that the resources might be downloadable from */ public List getUrls() { List urls = new LinkedList<>(); URL url; if (downloadOptions.useExplicitPack() && downloadOptions.useExplicitVersion()) { url = getUrl(resource, true, true); if (url != null) { urls.add(url); } url = getUrl(resource, false, true); if (url != null) { urls.add(url); } url = getUrl(resource, true, false); if (url != null) { urls.add(url); } } else if (downloadOptions.useExplicitPack()) { url = getUrl(resource, true, false); if (url != null) { urls.add(url); } } else if (downloadOptions.useExplicitVersion()) { url = getUrl(resource, false, true); if (url != null) { urls.add(url); } } url = getVersionedUrl(); urls.add(url); urls.add(resource.getLocation()); return urls; } /** * Returns a url for the resource. * @param resource the resource * @param usePack whether the URL should point to the pack200 file * @param useVersion whether the URL should be modified to include the version * @return a URL for the resource or null if an appropriate URL can not be found */ static URL getUrl(Resource resource, boolean usePack, boolean useVersion) { if (!(usePack || useVersion)) { throw new IllegalArgumentException("either pack200 or version required"); } String location = resource.getLocation().toString(); int lastSlash = resource.getLocation().toString().lastIndexOf('/'); if (lastSlash == -1) { return resource.getLocation(); } String filename = location.substring(lastSlash + 1); if (useVersion && resource.getRequestVersion() != null) { // With 'useVersion', j2-commons-cli.jar becomes, for example, j2-commons-cli__V1.0.jar String parts[] = filename.split("\\.", -1 /* Keep blank strings*/); StringBuilder sb = new StringBuilder(); for (int i = 0; i < parts.length; i++) { sb.append(parts[i]); // Append __V before last '.' if (i == parts.length -2) { sb.append("__V").append(resource.getRequestVersion()); } sb.append('.'); } sb.setLength(sb.length() - 1); // remove last '.' filename = sb.toString(); } if (usePack) { filename = filename + ".pack.gz"; } location = location.substring(0, lastSlash + 1) + filename; try { URL newUrl = new URL(location); return newUrl; } catch (MalformedURLException e) { return null; } } /** * Returns the URL for this resource, including the resource's version number in the query string * @return url with version cared about */ protected URL getVersionedUrl() { URL resourceUrl = resource.getLocation(); String protocol = uriPartToString(resourceUrl.getProtocol()) + "://"; String userInfo = uriPartToString(resourceUrl.getUserInfo()); if (!userInfo.isEmpty()) { userInfo += "@"; } String host = uriPartToString(resourceUrl.getHost()); String port; if (resourceUrl.getPort() == -1) { port = ""; } else { port = ":" + String.valueOf(resourceUrl.getPort()); } String path = uriPartToString(resourceUrl.getPath()); String query = uriPartToString(resourceUrl.getQuery()); if (!query.isEmpty()) { query = "?" + query; } if (resource.getRequestVersion() != null && resource.getRequestVersion().isVersionId()) { if (!query.isEmpty()) { query += "&"; } else { query = "?" + query; } query += "version-id=" + resource.getRequestVersion(); } try { URL url = new URL(protocol + userInfo + host + port + path + query); return url; } catch (MalformedURLException e) { return resourceUrl; } } private static String uriPartToString(String part) { if (part == null) return ""; return part; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/cache/PaxHeaders.17941/ResourceTracker.java0000644000000000000000000000013112654402377025507 xustar0030 mtime=1454507263.268432167 30 atime=1454507327.130580457 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/cache/ResourceTracker.java0000644000175000002070000005603512654402377026244 0ustar00jvanekmock00000000000000// Copyright (C) 2001-2003 Jon A. Maxwell (JAM) // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp.cache; import static net.sourceforge.jnlp.cache.Resource.Status.CONNECTED; import static net.sourceforge.jnlp.cache.Resource.Status.CONNECTING; import static net.sourceforge.jnlp.cache.Resource.Status.DOWNLOADED; import static net.sourceforge.jnlp.cache.Resource.Status.DOWNLOADING; import static net.sourceforge.jnlp.cache.Resource.Status.ERROR; import static net.sourceforge.jnlp.cache.Resource.Status.PRECONNECT; import static net.sourceforge.jnlp.cache.Resource.Status.PREDOWNLOAD; import static net.sourceforge.jnlp.cache.Resource.Status.PROCESSING; import java.io.File; import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; import java.util.Collection; import java.util.EnumSet; import java.util.List; import net.sourceforge.jnlp.DownloadOptions; import net.sourceforge.jnlp.Version; import net.sourceforge.jnlp.event.DownloadEvent; import net.sourceforge.jnlp.event.DownloadListener; import net.sourceforge.jnlp.util.UrlUtils; import net.sourceforge.jnlp.util.logging.OutputController; /** * This class tracks the downloading of various resources of a * JNLP file to local files in the cache. It can be used to * download icons, jnlp and extension files, jars, and jardiff * files using the version based protocol or any file using the * basic download protocol (jardiff and version not implemented * yet). *

    * The resource tracker can be configured to prefetch resources, * which are downloaded in the order added to the media * tracker. *

    *

    * Multiple threads are used to download and cache resources that * are actively being waited for (blocking a caller) or those that * have been started downloading by calling the startDownload * method. Resources that are prefetched are downloaded one at a * time and only if no other trackers have requested downloads. * This allows the tracker to start downloading many items without * using many system resources, but still quickly download items * as needed. *

    * * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.22 $ */ public class ResourceTracker { // todo: use event listener arrays instead of lists // todo: see if there is a way to set the socket options just // for use by the tracker so checks for updates don't hang for // a long time. // todo: ability to restart/retry a hung download // todo: move resource downloading/processing code into Resource // class, threading stays in ResourceTracker // todo: get status method? and some way to convey error status // to the caller. // todo: might make a tracker be able to download more than one // version of a resource, but probably not very useful. // defines // ResourceTracker.Downloader (download threads) // separately locks on (in order of aquire order, ie, sync on prefetch never syncs on lock): // lock, prefetch, this.resources, each resource, listeners public static enum RequestMethods{ HEAD, GET, TESTING_UNDEF; private static final RequestMethods[] requestMethods = {RequestMethods.HEAD, RequestMethods.GET}; public static RequestMethods[] getValidRequestMethods() { return requestMethods; } } /** notified on initialization or download of a resource */ private static final Object lock = new Object(); // used to lock static structures /** the resources known about by this resource tracker */ private final List resources = new ArrayList<>(); /** download listeners for this tracker */ private final List listeners = new ArrayList<>(); /** whether to download parts before requested */ private final boolean prefetch; /** * Creates a resource tracker that does not prefetch resources. */ public ResourceTracker() { this(false); } /** * Creates a resource tracker. * * @param prefetch whether to download resources before requested. */ public ResourceTracker(boolean prefetch) { this.prefetch = prefetch; } /** * Add a resource identified by the specified location and * version. The tracker only downloads one version of a given * resource per instance (ie cannot download both versions 1 and * 2 of a resource in the same tracker). * * @param location the location of the resource * @param version the resource version * @param options options to control download * @param updatePolicy whether to check for updates if already in cache */ public void addResource(URL location, Version version, DownloadOptions options, UpdatePolicy updatePolicy) { if (location == null) throw new IllegalResourceDescriptorException("location==null"); try { location = UrlUtils.normalizeUrl(location); } catch (Exception ex) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, "Normalization of " + location.toString() + " have failed"); OutputController.getLogger().log(ex); } Resource resource = Resource.getResource(location, version, updatePolicy); synchronized (resources) { if (resources.contains(resource)) return; resource.addTracker(this); resources.add(resource); } if (options == null) { options = new DownloadOptions(false, false); } resource.setDownloadOptions(options); // checkCache may take a while (loads properties file). this // should really be synchronized on resources, but the worst // case should be that the resource will be updated once even // if unnecessary. boolean downloaded = checkCache(resource, updatePolicy); if (!downloaded) { if (prefetch) { startResource(resource); } } } /** * Removes a resource from the tracker. This method is useful * to allow memory to be reclaimed, but calling this method is * not required as resources are reclaimed when the tracker is * collected. * * @param location location of resource to be removed * @throws IllegalResourceDescriptorException if the resource is not being tracked */ public void removeResource(URL location) { synchronized (resources) { Resource resource = getResource(location); if (resource != null) { resources.remove(resource); resource.removeTracker(this); } // should remove from queue? probably doesn't matter } } /** * Check the cache for a resource, and initialize the resource * as already downloaded if found. * * @param updatePolicy whether to check for updates if already in cache * @return whether the resource are already downloaded */ private boolean checkCache(Resource resource, UpdatePolicy updatePolicy) { if (!CacheUtil.isCacheable(resource.getLocation(), resource.getDownloadVersion())) { // pretend that they are already downloaded; essentially // they will just 'pass through' the tracker as if they were // never added (for example, not affecting the total download size). synchronized (resource) { resource.changeStatus(EnumSet.noneOf(Resource.Status.class), EnumSet.of(DOWNLOADED, CONNECTED, PROCESSING)); } fireDownloadEvent(resource); return true; } if (updatePolicy != UpdatePolicy.ALWAYS && updatePolicy != UpdatePolicy.FORCE) { // save loading entry props file CacheEntry entry = new CacheEntry(resource.getLocation(), resource.getDownloadVersion()); if (entry.isCached() && !updatePolicy.shouldUpdate(entry)) { OutputController.getLogger().log("not updating: " + resource.getLocation()); synchronized (resource) { resource.setLocalFile(CacheUtil.getCacheFile(resource.getLocation(), resource.getDownloadVersion())); resource.setSize(resource.getLocalFile().length()); resource.setTransferred(resource.getLocalFile().length()); resource.changeStatus(EnumSet.noneOf(Resource.Status.class), EnumSet.of(DOWNLOADED, CONNECTED, PROCESSING)); } fireDownloadEvent(resource); return true; } } if (updatePolicy == UpdatePolicy.FORCE) { // ALWAYS update // When we are "always" updating, we update for each instance. Reset resource status. resource.resetStatus(); } // may or may not be cached, but check update when connection // is open to possibly save network communication time if it // has to be downloaded, and allow this call to return quickly return false; } /** * Adds the listener to the list of objects interested in * receivind DownloadEvents. * * @param listener the listener to add. */ public void addDownloadListener(DownloadListener listener) { synchronized (listeners) { if (!listeners.contains(listener)) listeners.add(listener); } } /** * Removes a download listener. * * @param listener the listener to remove. */ public void removeDownloadListener(DownloadListener listener) { synchronized (listeners) { listeners.remove(listener); } } /** * Fires the download event corresponding to the resource's * state. This method is typicall called by the Resource itself * on each tracker that is monitoring the resource. Do not call * this method with any locks because the listeners may call * back to this ResourceTracker. * @param resource resource on which event is fired */ protected void fireDownloadEvent(Resource resource) { DownloadListener l[]; synchronized (listeners) { l = listeners.toArray(new DownloadListener[0]); } Collection status; synchronized (resource) { status = resource.getCopyOfStatus(); } DownloadEvent event = new DownloadEvent(this, resource); for (DownloadListener dl : l) { if (status.contains(ERROR) || status.contains(DOWNLOADED)) dl.downloadCompleted(event); else if (status.contains(DOWNLOADING)) dl.downloadStarted(event); else if (status.contains(CONNECTING)) dl.updateStarted(event); } } /** * Returns a URL pointing to the cached location of the * resource, or the resource itself if it is a non-cacheable * resource. *

    * If the resource has not downloaded yet, the method will block * until it has been transferred to the cache. *

    * * @param location the resource location * @return the resource, or null if it could not be downloaded * @throws IllegalResourceDescriptorException if the resource is not being tracked * @see CacheUtil#isCacheable */ public URL getCacheURL(URL location) { try { File f = getCacheFile(location); if (f != null) // TODO: Should be toURI().toURL() return f.toURL(); } catch (MalformedURLException ex) { OutputController.getLogger().log(ex); } return location; } /** * Returns a file containing the downloaded resource. If the * resource is non-cacheable then null is returned unless the * resource is a local file (the original file is returned). *

    * If the resource has not downloaded yet, the method will block * until it has been transferred to the cache. *

    * * @param location the resource location * @return a local file containing the resource, or null * @throws IllegalResourceDescriptorException if the resource is not being tracked * @see CacheUtil#isCacheable */ public File getCacheFile(URL location) { try { Resource resource = getResource(location); if (!(resource.isSet(DOWNLOADED) || resource.isSet(ERROR))) waitForResource(location, 0); if (resource.isSet(ERROR)) return null; if (resource.getLocalFile() != null) return resource.getLocalFile(); if (location.getProtocol().equalsIgnoreCase("file")) { File file = UrlUtils.decodeUrlAsFile(location); if (file.exists()) { return file; } // try plain, not decoded file now // sometimes the jnlp app developers are encoding for us // so we end up encoding already encoded file. See RH1154177 file = new File(location.getPath()); if (file.exists()) { return file; } // have it sense to try also filename with whole query here? // => location.getFile() ? } return null; } catch (InterruptedException ex) { OutputController.getLogger().log(ex); return null; // need an error exception to throw } } /** * Wait for a group of resources to be downloaded and made * available locally. * * @param urls the resources to wait for * @param timeout the time in ms to wait before returning, 0 for no timeout * @return whether the resources downloaded before the timeout * @throws java.lang.InterruptedException if thread is interrupted * @throws IllegalResourceDescriptorException if the resource is not being tracked */ public boolean waitForResources(URL urls[], long timeout) throws InterruptedException { Resource lresources[] = new Resource[urls.length]; synchronized (lresources) { // keep the lock so getResource doesn't have to aquire it each time for (int i = 0; i < urls.length; i++) { lresources[i] = getResource(urls[i]); } } if (lresources.length > 0) return wait(lresources, timeout); return true; } /** * Wait for a particular resource to be downloaded and made * available. * * @param location the resource to wait for * @param timeout the timeout, or 0 to wait until completed * @return whether the resource downloaded before the timeout * @throws InterruptedException if another thread interrupted the wait * @throws IllegalResourceDescriptorException if the resource is not being tracked */ public boolean waitForResource(URL location, long timeout) throws InterruptedException { return wait(new Resource[]{getResource(location)}, timeout); } /** * Returns the number of bytes downloaded for a resource. * * @param location the resource location * @return the number of bytes transferred * @throws IllegalResourceDescriptorException if the resource is not being tracked */ public long getAmountRead(URL location) { // not atomic b/c transferred is a long, but so what (each // byte atomic? so probably won't affect anything...) return getResource(location).getTransferred(); } /** * Returns whether a resource is available for use (ie, can be * accessed with the getCacheFile method). * * @param location the resource location * @return resource availability * @throws IllegalResourceDescriptorException if the resource is not being tracked */ public boolean checkResource(URL location) { Resource resource = getResource(location); return resource.isSet(DOWNLOADED) || resource.isSet(ERROR); } /** * Starts loading the resource if it is not already being * downloaded or already cached. Resources started downloading * using this method may download faster than those prefetched * by the tracker because the tracker will only prefetch one * resource at a time to conserve system resources. * * @param location the resource location * @return true if the resource is already downloaded (or an error occurred) * @throws IllegalResourceDescriptorException if the resource is not being tracked */ public boolean startResource(URL location) { Resource resource = getResource(location); return startResource(resource); } /** * Sets the resource status to connect and download, and * enqueues the resource if not already started. * * @return true if the resource is already downloaded (or an error occurred) * @throws IllegalResourceDescriptorException if the resource is not being tracked */ private boolean startResource(Resource resource) { boolean enqueue; synchronized (resource) { if (resource.isSet(ERROR)) return true; enqueue = !resource.isSet(PROCESSING); if (!(resource.isSet(CONNECTED) || resource.isSet(CONNECTING))) resource.changeStatus(EnumSet.noneOf(Resource.Status.class), EnumSet.of(PRECONNECT, PROCESSING)); if (!(resource.isSet(DOWNLOADED) || resource.isSet(DOWNLOADING))) resource.changeStatus(EnumSet.noneOf(Resource.Status.class), EnumSet.of(PREDOWNLOAD, PROCESSING)); if (!(resource.isSet(PREDOWNLOAD) || resource.isSet(PRECONNECT))) enqueue = false; } if (enqueue) startDownloadThread(resource); return !enqueue; } /** * Returns the number of total size in bytes of a resource, or * -1 it the size is not known. * * @param location the resource location * @return the number of bytes, or -1 * @throws IllegalResourceDescriptorException if the resource is not being tracked */ public long getTotalSize(URL location) { return getResource(location).getSize(); // atomic } /** * Start a new download thread. *

    * Calls to this method should be synchronized on lock. *

    * @param resource resource to be download */ protected void startDownloadThread(Resource resource) { CachedDaemonThreadPoolProvider.DAEMON_THREAD_POOL.execute(new ResourceDownloader(resource, lock)); } static Resource selectByFilter(Collection source, Filter filter) { Resource result = null; for (Resource resource : source) { boolean selectable; synchronized (resource) { selectable = filter.test(resource); } if (selectable) { result = resource; } } return result; } static Resource selectByStatus(Collection source, Resource.Status include, Resource.Status exclude) { return selectByStatus(source, EnumSet.of(include), EnumSet.of(exclude)); } /** * Selects a resource from the source list that has the * specified flag set. *

    * Calls to this method should be synchronized on lock and * source list. *

    */ static Resource selectByStatus(Collection source, final Collection included, final Collection excluded) { return selectByFilter(source, new Filter() { @Override public boolean test(Resource t) { boolean hasIncluded = false; for (Resource.Status flag : included) { if (t.isSet(flag)) { hasIncluded = true; } } boolean hasExcluded = false; for (Resource.Status flag : excluded) { if (t.isSet(flag)) { hasExcluded = true; } } return hasIncluded && !hasExcluded; } }); } /** * Return the resource matching the specified URL. * * @throws IllegalResourceDescriptorException if the resource is not being tracked */ private Resource getResource(URL location) { synchronized (resources) { for (Resource resource : resources) { if (UrlUtils.urlEquals(resource.getLocation(), location)) return resource; } } throw new IllegalResourceDescriptorException("Location does not specify a resource being tracked."); } /** * Wait for some resources. * * @param resources the resources to wait for * @param timeout the timeout, or {@code 0} to wait until completed * @return {@code true} if the resources were downloaded or had errors, * {@code false} if the timeout was reached * @throws InterruptedException if another thread interrupted the wait */ private boolean wait(Resource[] resources, long timeout) throws InterruptedException { long startTime = System.currentTimeMillis(); // start them downloading / connecting in background for (Resource resource : resources) { startResource(resource); } // wait for completion while (true) { boolean finished = true; synchronized (lock) { // check for completion for (Resource resource : resources) { //NetX Deadlocking may be solved by removing this //synch block. synchronized (resource) { if (!(resource.isSet(DOWNLOADED) || resource.isSet(ERROR))) { finished = false; break; } } } if (finished) return true; // wait long waitTime = 0; if (timeout > 0) { waitTime = timeout - (System.currentTimeMillis() - startTime); if (waitTime <= 0) return false; } lock.wait(waitTime); } } } interface Filter { public boolean test(T t); } }icedtea-web-1.6.2/netx/net/sourceforge/jnlp/cache/PaxHeaders.17941/ResourceDownloader.java0000644000000000000000000000013112654402377026212 xustar0030 mtime=1454507263.267432181 30 atime=1454507327.130580457 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/cache/ResourceDownloader.java0000644000175000002070000005407712654402377026753 0ustar00jvanekmock00000000000000package net.sourceforge.jnlp.cache; import static net.sourceforge.jnlp.cache.Resource.Status.CONNECTED; import static net.sourceforge.jnlp.cache.Resource.Status.CONNECTING; import static net.sourceforge.jnlp.cache.Resource.Status.DOWNLOADED; import static net.sourceforge.jnlp.cache.Resource.Status.DOWNLOADING; import static net.sourceforge.jnlp.cache.Resource.Status.ERROR; import static net.sourceforge.jnlp.cache.Resource.Status.PRECONNECT; import static net.sourceforge.jnlp.cache.Resource.Status.PREDOWNLOAD; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.HttpURLConnection; import java.net.URL; import java.net.URLConnection; import java.util.EnumSet; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.jar.JarOutputStream; import java.util.jar.Pack200; import java.util.zip.GZIPInputStream; import net.sourceforge.jnlp.DownloadOptions; import net.sourceforge.jnlp.Version; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.security.ConnectionFactory; import net.sourceforge.jnlp.util.HttpUtils; import net.sourceforge.jnlp.util.logging.OutputController; public class ResourceDownloader implements Runnable { private final Resource resource; private final Object lock; public ResourceDownloader(Resource resource, Object lock) { this.resource = resource; this.lock = lock; } static int getUrlResponseCode(URL url, Map requestProperties, ResourceTracker.RequestMethods requestMethod) throws IOException { return getUrlResponseCodeWithRedirectonResult(url, requestProperties, requestMethod).result; } /** * Connects to the given URL, and grabs a response code and redirecton if * the URL uses the HTTP protocol, or returns an arbitrary valid HTTP * response code. * * @return the response code if HTTP connection and redirection value, or * HttpURLConnection.HTTP_OK and null if not. * @throws IOException */ 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()) { connection.addRequestProperty(property.getKey(), property.getValue()); } if (connection instanceof HttpURLConnection) { HttpURLConnection httpConnection = (HttpURLConnection) connection; httpConnection.setRequestMethod(requestMethod.toString()); int responseCode = httpConnection.getResponseCode(); /* Fully consuming current request helps with connection re-use * See http://docs.oracle.com/javase/1.5.0/docs/guide/net/http-keepalive.html */ HttpUtils.consumeAndCloseConnectionSilently(httpConnection); result.result = responseCode; } Map> header = connection.getHeaderFields(); for (Map.Entry> entry : header.entrySet()) { OutputController.getLogger().log("Key : " + entry.getKey() + " ,Value : " + entry.getValue()); } /* * Do this only on 301,302,303(?)307,308> * Now setting value for all, and lets upper stack to handle it */ String possibleRedirect = connection.getHeaderField("Location"); if (possibleRedirect != null && possibleRedirect.trim().length() > 0) { result.URL = new URL(possibleRedirect); } ConnectionFactory.getConnectionFactory().disconnect(connection); result.lastModified = connection.getLastModified(); result.length = connection.getContentLengthLong(); return result; } @Override public void run() { if (resource.isSet(PRECONNECT) && !resource.hasFlags(EnumSet.of(ERROR, CONNECTING, CONNECTED))) { resource.changeStatus(EnumSet.noneOf(Resource.Status.class), EnumSet.of(CONNECTING)); resource.fireDownloadEvent(); // fire CONNECTING initializeResource(); } if (resource.isSet(PREDOWNLOAD) && !resource.hasFlags(EnumSet.of(ERROR, DOWNLOADING, DOWNLOADED))) { resource.changeStatus(EnumSet.noneOf(Resource.Status.class), EnumSet.of(DOWNLOADING)); resource.fireDownloadEvent(); // fire CONNECTING downloadResource(); } } private void initializeResource() { if (!JNLPRuntime.isOfflineForced() && resource.isConnectable()) { initializeOnlineResource(); } else { initializeOfflineResource(); } } private void initializeOnlineResource() { try { UrlRequestResult finalLocation = findBestUrl(resource); if (finalLocation != null) { initializeFromURL(finalLocation); } else { initializeOfflineResource(); } } catch (Exception e) { OutputController.getLogger().log(e); resource.changeStatus(EnumSet.noneOf(Resource.Status.class), EnumSet.of(ERROR)); synchronized (lock) { lock.notifyAll(); // wake up wait's to check for completion } resource.fireDownloadEvent(); // fire ERROR } } private void initializeFromURL(UrlRequestResult location) throws IOException { CacheEntry entry = new CacheEntry(resource.getLocation(), resource.getRequestVersion()); entry.lock(); try { 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 = 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(), lm) && resource.getUpdatePolicy() != UpdatePolicy.FORCE; if (!current) { if (entry.isCached()) { entry.markForDelete(); entry.store(); // Old entry will still exist. (but removed at cleanup) localFile = CacheUtil.makeNewCacheFile(resource.getLocation(), resource.getDownloadVersion()); CacheEntry newEntry = new CacheEntry(resource.getLocation(), resource.getRequestVersion()); newEntry.lock(); entry.unlock(); entry = newEntry; } } synchronized (resource) { resource.setLocalFile(localFile); // resource.connection = connection; resource.setSize(size); resource.changeStatus(EnumSet.of(PRECONNECT, CONNECTING), EnumSet.of(CONNECTED, PREDOWNLOAD)); // check if up-to-date; if so set as downloaded if (current) { resource.changeStatus(EnumSet.of(PREDOWNLOAD, DOWNLOADING), EnumSet.of(DOWNLOADED)); } } // update cache entry if (!current) { entry.setRemoteContentLength(size); entry.setLastModified(lm); } entry.setLastUpdated(System.currentTimeMillis()); entry.store(); synchronized (lock) { lock.notifyAll(); // wake up wait's to check for completion } resource.fireDownloadEvent(); // fire CONNECTED // explicitly close the URLConnection. ConnectionFactory.getConnectionFactory().disconnect(connection); } finally { entry.unlock(); } } private void initializeOfflineResource() { CacheEntry entry = new CacheEntry(resource.getLocation(), resource.getRequestVersion()); entry.lock(); try { File localFile = CacheUtil.getCacheFile(resource.getLocation(), resource.getDownloadVersion()); if (localFile != null && localFile.exists()) { long size = localFile.length(); synchronized (resource) { resource.setLocalFile(localFile); resource.setSize(size); resource.changeStatus(EnumSet.of(PREDOWNLOAD, DOWNLOADING), EnumSet.of(DOWNLOADED)); } } else { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, "You are trying to get resource " + resource.getLocation().toExternalForm() + " but it is not in cache and could not be downloaded. Attempting to continue, but you may expect failure"); resource.changeStatus(EnumSet.noneOf(Resource.Status.class), EnumSet.of(ERROR)); } synchronized (lock) { lock.notifyAll(); // wake up wait's to check for completion } resource.fireDownloadEvent(); // fire CONNECTED or ERROR } finally { entry.unlock(); } } /** * 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 UrlRequestResult findBestUrl(Resource resource) { DownloadOptions options = resource.getDownloadOptions(); if (options == null) { options = new DownloadOptions(false, false); } List urls = new ResourceUrlCreator(resource, options).getUrls(); 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); try { Map requestProperties = new HashMap<>(); requestProperties.put("Accept-Encoding", "pack200-gzip, gzip"); 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()) { 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); } } else if (response.isInvalid()) { 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); if (response.URL == null) { response.URL = url; } return response; /* This is the best URL */ } } catch (IOException e) { // continue to next candidate OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "While processing " + url.toString() + " by " + requestMethod + " for resource " + resource.toString() + " got " + e + ": "); OutputController.getLogger().log(e); } } } /* No valid URL, return null */ return null; } private void downloadResource() { URLConnection connection = null; URL downloadFrom = resource.getDownloadLocation(); //Where to download from URL downloadTo = resource.getLocation(); //Where to download to try { connection = getDownloadConnection(downloadFrom); String contentEncoding = connection.getContentEncoding(); 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 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) { downloadGZipFile(resource, connection, new URL(downloadFrom + ".gz"), downloadTo); } else { downloadFile(resource, connection, downloadTo); } resource.changeStatus(EnumSet.of(DOWNLOADING), EnumSet.of(DOWNLOADED)); synchronized (lock) { lock.notifyAll(); // wake up wait's to check for completion } resource.fireDownloadEvent(); // fire DOWNLOADED } catch (Exception ex) { OutputController.getLogger().log(ex); resource.changeStatus(EnumSet.noneOf(Resource.Status.class), EnumSet.of(ERROR)); synchronized (lock) { lock.notifyAll(); } resource.fireDownloadEvent(); // fire ERROR } finally { if (connection != null) { ConnectionFactory.getConnectionFactory().disconnect(connection); } } } private URLConnection getDownloadConnection(URL location) throws IOException { URLConnection con = ConnectionFactory.getConnectionFactory().openConnection(location); con.addRequestProperty("Accept-Encoding", "pack200-gzip, gzip"); con.connect(); return con; } private void downloadPackGzFile(Resource resource, URLConnection connection, URL downloadFrom, URL downloadTo) throws IOException { downloadFile(resource, connection, downloadFrom); uncompressPackGz(downloadFrom, downloadTo, resource.getDownloadVersion()); storeEntryFields(new CacheEntry(downloadTo, resource.getDownloadVersion()), connection.getContentLength(), connection.getLastModified()); } private void downloadGZipFile(Resource resource, URLConnection connection, URL downloadFrom, URL downloadTo) throws IOException { downloadFile(resource, connection, downloadFrom); uncompressGzip(downloadFrom, downloadTo, resource.getDownloadVersion()); storeEntryFields(new CacheEntry(downloadTo, resource.getDownloadVersion()), connection.getContentLength(), connection.getLastModified()); } private void downloadFile(Resource resource, URLConnection connection, URL downloadLocation) throws IOException { CacheEntry downloadEntry = new CacheEntry(downloadLocation, resource.getDownloadVersion()); OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "Downloading file: " + downloadLocation + " into: " + downloadEntry.getCacheFile().getCanonicalPath()); if (!downloadEntry.isCurrent(connection.getLastModified())) { writeDownloadToFile(resource, downloadLocation, new BufferedInputStream(connection.getInputStream())); } else { resource.setTransferred(CacheUtil.getCacheFile(downloadLocation, resource.getDownloadVersion()).length()); } storeEntryFields(downloadEntry, connection.getContentLengthLong(), connection.getLastModified()); } private void storeEntryFields(CacheEntry entry, long contentLength, long lastModified) { entry.lock(); try { entry.setRemoteContentLength(contentLength); entry.setLastModified(lastModified); entry.store(); } finally { entry.unlock(); } } private void writeDownloadToFile(Resource resource, URL downloadLocation, InputStream in) throws IOException { byte buf[] = new byte[1024]; int rlen; try (OutputStream out = CacheUtil.getOutputStream(downloadLocation, resource.getDownloadVersion())) { while (-1 != (rlen = in.read(buf))) { resource.incrementTransferred(rlen); out.write(buf, 0, rlen); } in.close(); } } private void uncompressGzip(URL compressedLocation, URL uncompressedLocation, Version version) throws IOException { OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "Extracting gzip: " + compressedLocation + " to " + uncompressedLocation); byte buf[] = new byte[1024]; int rlen; 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(); } } private void uncompressPackGz(URL compressedLocation, URL uncompressedLocation, Version version) throws IOException { OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "Extracting packgz: " + compressedLocation + " to " + uncompressedLocation); 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 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 * */ 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 */ public boolean shouldRedirect() { return (result == 301 || result == 302 || result == 303/*?*/ || result == 307 || result == 308); } /** * @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 { public RedirectionException(String string) { super(string); } public RedirectionException(Throwable cause) { super(cause); } } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/cache/PaxHeaders.17941/Resource.java0000644000000000000000000000013012654402377024172 xustar0030 mtime=1454507263.266432194 29 atime=1454507327.12958047 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/cache/Resource.java0000644000175000002070000003175312654402377024730 0ustar00jvanekmock00000000000000// Copyright (C) 2001-2003 Jon A. Maxwell (JAM) // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp.cache; import java.io.File; import java.net.URL; import java.util.Collection; import java.util.EnumSet; import java.util.List; import java.util.Set; import net.sourceforge.jnlp.DownloadOptions; import net.sourceforge.jnlp.Version; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.util.UrlUtils; import net.sourceforge.jnlp.util.WeakList; /** *

    * Information about a single resource to download. * This class tracks the downloading of various resources of a * JNLP file to local files. It can be used to download icons, * jnlp and extension files, jars, and jardiff files using the * version based protocol or any file using the basic download * protocol. *

    *

    * Resources can be put into download groups by specifying a part * name for the resource. The resource tracker can also be * configured to prefetch resources, which are downloaded in the * order added to the media tracker. *

    * * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.9 $ */ public class Resource { // todo: fix resources to handle different versions // todo: IIRC, any resource is checked for being up-to-date // only once, regardless of UpdatePolicy. verify and fix. public enum Status { PRECONNECT, CONNECTING, CONNECTED, PREDOWNLOAD, DOWNLOADING, DOWNLOADED, ERROR, PROCESSING // in queue or being worked on } /** list of weak references of resources currently in use */ private static final WeakList resources = new WeakList<>(); /** weak list of trackers monitoring this resource */ private final WeakList trackers = new WeakList<>(); /** the remote location of the resource */ private final URL location; /** the location to use when downloading */ private URL downloadLocation; /** the local file downloaded to */ private File localFile; /** the requested version */ private final Version requestVersion; /** the version downloaded from server */ private Version downloadVersion; /** amount in bytes transferred */ private volatile long transferred = 0; /** total size of the resource, or -1 if unknown */ private volatile long size = -1; /** the status of the resource */ private final EnumSet status = EnumSet.noneOf(Status.class); /** Update policy for this resource */ private final UpdatePolicy updatePolicy; /** Download options for this resource */ private DownloadOptions downloadOptions; /** * Create a resource. */ private Resource(URL location, Version requestVersion, UpdatePolicy updatePolicy) { this.location = location; this.downloadLocation = location; this.requestVersion = requestVersion; this.updatePolicy = updatePolicy; } /** * Return a shared Resource object representing the given * location and version. * @param location final location of resource * @param requestVersion final version of resource * @param updatePolicy final policy for updating * @return new resource, which is already added in resources list */ public static Resource getResource(URL location, Version requestVersion, UpdatePolicy updatePolicy) { //TODO -rename to create resource? synchronized (resources) { Resource resource = new Resource(location, requestVersion, updatePolicy); //FIXME - url ignores port during its comparison //this may affect test-suites int index = resources.indexOf(resource); if (index >= 0) { // return existing object Resource result = resources.get(index); if (result != null) { return result; } } resources.add(resource); resources.trimToSize(); return resource; } } /** * Returns the remote location of the resource. * @return the same location as the one with which this resource was created */ public URL getLocation() { return location; } /** * Returns the URL to use for downloading the resource. This can be * different from the original location since it may use a different * file name to support versioning and compression * @return the url to use when downloading */ public URL getDownloadLocation() { return downloadLocation; } /** * Set the url to use for downloading the resource * @param downloadLocation url to be donloaded */ public void setDownloadLocation(URL downloadLocation) { this.downloadLocation = downloadLocation; } /** * Returns the tracker that first created or monitored the * resource, or null if no trackers are monitoring the resource. */ ResourceTracker getTracker() { synchronized (trackers) { List t = trackers.hardList(); if (t.size() > 0) { return t.get(0); } return null; } } /** * @return the local file currently being downloaded */ public File getLocalFile() { return localFile; } /** * Sets the local file to be downloaded * @param localFile location of stored resource */ public void setLocalFile(File localFile) { this.localFile = localFile; } /** * @return the requested version */ public Version getRequestVersion() { return requestVersion; } /** * @return the version downloaded from server */ public Version getDownloadVersion() { return downloadVersion; } /** * Sets the version downloaded from server * @param downloadVersion version of downloaded resource */ public void setDownloadVersion(Version downloadVersion) { this.downloadVersion = downloadVersion; } /** * @return the amount in bytes transferred */ public long getTransferred() { return transferred; } /** * Sets the amount transferred * @param transferred set the whole transfered amount to this value */ public void setTransferred(long transferred) { this.transferred = transferred; } /** * Increments the amount transferred (in bytes) * @param incTrans transfered amount in last transfer */ public void incrementTransferred(long incTrans) { transferred += incTrans; } /** * Returns the size of the resource * @return size of resource (-1 if unknown) */ public long getSize() { return size; } /** * Sets the size of the resource * @param size desired size of resource */ public void setSize(long size) { this.size = size; } /** * @return the status of the resource */ public Set getCopyOfStatus() { return EnumSet.copyOf(status); } /** * Check if the specified flag is set. * @param flag a status flag * @return true iff the flag is set */ public boolean isSet(Status flag) { synchronized (status) { return status.contains(flag); } } /** * Check if all the specified flags are set. * @param flags a collection of flags * @return true iff all the flags are set */ public boolean hasFlags(Collection flags) { synchronized (status) { return status.containsAll(flags); } } /** * @return the update policy for this resource */ public UpdatePolicy getUpdatePolicy() { return this.updatePolicy; } /** * Returns a human-readable status string. */ private String getStatusString() { StringBuilder result = new StringBuilder(); synchronized (status) { if (status.isEmpty()) { return "<>"; } for (Status stat : status) { result.append(stat.toString()).append(" "); } } return result.toString().trim(); } /** * Changes the status by clearing the flags in the first * parameter and setting the flags in the second. This method * is synchronized on this resource. * @param clear a collection of status flags to unset * @param add a collection of status flags to set */ public void changeStatus(Collection clear, Collection add) { synchronized (status) { if (clear != null) { status.removeAll(clear); } if (add != null) { status.addAll(add); } } } /** * Set status flag * @param flag a flag to set */ public void setStatusFlag(Status flag) { synchronized (status) { status.add(flag); } } /** * Set flags * @param flags a collection of flags to set */ public void setStatusFlags(Collection flags) { synchronized (status) { status.addAll(flags); } } /** * Unset flags * @param flags a collection of flags to unset */ public void unsetStatusFlag(Collection flags) { synchronized (status) { status.removeAll(flags); } } /** * Clear all flags */ public void resetStatus() { synchronized (status) { status.clear(); } } /** * Check if this resource has been initialized * @return true iff any flags have been set */ public boolean isInitialized() { synchronized (status) { return !status.isEmpty(); } } /** * Removes the tracker to the list of trackers monitoring this * resource. * * @param tracker tracker to be removed */ public void removeTracker(ResourceTracker tracker) { synchronized (trackers) { trackers.remove(tracker); trackers.trimToSize(); } } /** * Adds the tracker to the list of trackers monitoring this * resource. * @param tracker to observing resource */ public void addTracker(ResourceTracker tracker) { synchronized (trackers) { // prevent GC between contains and add List t = trackers.hardList(); if (!t.contains(tracker)) trackers.add(tracker); trackers.trimToSize(); } } /** * Instructs the trackers monitoring this resource to fire a * download event. */ protected void fireDownloadEvent() { List send; synchronized (trackers) { send = trackers.hardList(); } for (ResourceTracker rt : send) { rt.fireDownloadEvent(this); } } public void setDownloadOptions(DownloadOptions downloadOptions) { this.downloadOptions = downloadOptions; } public DownloadOptions getDownloadOptions() { return this.downloadOptions; } public boolean isConnectable() { return JNLPRuntime.isConnectable(this.location); } @Override public int hashCode() { // FIXME: should probably have a better hashcode than this, but considering // #equals(Object) was already defined first (without also overriding hashcode!), // this is just being implemented in line with that so we don't break HashMaps, // HashSets, etc return location.hashCode(); } @Override public boolean equals(Object other) { if (other instanceof Resource) { // this prevents the URL handler from looking up the IP // address and doing name resolution; much faster so less // time spent in synchronized addResource determining if // Resource is already in a tracker, and better for offline // mode on some OS. return UrlUtils.urlEquals(location, ((Resource) other).location); } return false; } @Override public String toString() { return "location=" + location.toString() + " state=" + getStatusString(); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/cache/PaxHeaders.17941/NativeLibraryStorage.java0000644000000000000000000000013012654402377026503 xustar0030 mtime=1454507263.266432194 29 atime=1454507327.12958047 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/cache/NativeLibraryStorage.java0000644000175000002070000001272612654402377027240 0ustar00jvanekmock00000000000000package net.sourceforge.jnlp.cache; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.net.URL; import java.util.ArrayList; import java.util.Enumeration; import java.util.List; import java.util.jar.JarEntry; import java.util.jar.JarFile; import net.sourceforge.jnlp.util.FileUtils; import net.sourceforge.jnlp.util.logging.OutputController; /** * Handles loading and access of native code loading through a JNLP application or applet. * Stores native code in a temporary folder. * Be sure to call cleanupTemporayFolder when finished with the object. */ public class NativeLibraryStorage { private final ResourceTracker tracker; private final List nativeSearchDirectories = new ArrayList<>(); /* Temporary directory to store native jar entries, added to our search path */ private File jarEntryDirectory = null; public NativeLibraryStorage(ResourceTracker tracker) { this.tracker = tracker; } /** * Clean up our temporary folder if we created one. */ public void cleanupTemporaryFolder() { if (jarEntryDirectory != null) { OutputController.getLogger().log("Cleaning up native directory" + jarEntryDirectory.getAbsolutePath()); try { FileUtils.recursiveDelete(jarEntryDirectory, new File(System.getProperty("java.io.tmpdir"))); jarEntryDirectory = null; } catch (IOException e) { /* * failed to delete a file in tmpdir, no big deal (as well the VM * might be shutting down at this point so no much we can do) */ } } } /** * Adds the {@link File} to the search path of this {@link NativeLibraryStorage} * when trying to find a native library * @param directory directory to be added */ public void addSearchDirectory(File directory) { nativeSearchDirectories.add(directory); } public List getSearchDirectories() { return nativeSearchDirectories; } /** * Looks in the search directories for 'fileName', * returning a path to the found file if it exists. * @param fileName name of library to be found * @return path to library if found, null otherwise. */ public File findLibrary(String fileName) { for (File dir : getSearchDirectories()) { File target = new File(dir, fileName); if (target.exists()) return target; } return null; } public static final String[] NATIVE_LIBRARY_EXTENSIONS = { ".so", ".dylib", ".jnilib", ".framework", ".dll" }; /** * Search for and enable any native code contained in a JAR by copying the * native files into the filesystem. Called in the security context of the * classloader. * @param jarLocation location of jar to be searched */ public void addSearchJar(URL jarLocation) { OutputController.getLogger().log("Activate native: " + jarLocation); File localFile = tracker.getCacheFile(jarLocation); if (localFile == null) return; try { try (JarFile jarFile = new JarFile(localFile, false)) { Enumeration entries = jarFile.entries(); while (entries.hasMoreElements()) { JarEntry e = entries.nextElement(); if (e.isDirectory()) { continue; } String name = new File(e.getName()).getName(); boolean isLibrary = false; for (String suffix : NATIVE_LIBRARY_EXTENSIONS) { if (name.endsWith(suffix)) { isLibrary = true; break; } } if (!isLibrary) { continue; } ensureNativeStoreDirectory(); File outFile = new File(jarEntryDirectory, name); if (!outFile.isFile()) { FileUtils.createRestrictedFile(outFile, true); } CacheUtil.streamCopy(jarFile.getInputStream(e), new FileOutputStream(outFile)); } } } catch (IOException ex) { OutputController.getLogger().log(ex); } } void ensureNativeStoreDirectory() { if (jarEntryDirectory == null) { jarEntryDirectory = createNativeStoreDirectory(); addSearchDirectory(jarEntryDirectory); } } /** * Create a random base directory to store native code files in. */ private static File createNativeStoreDirectory() { final int rand = (int)((Math.random()*2 - 1) * Integer.MAX_VALUE); File nativeDir = new File(System.getProperty("java.io.tmpdir") + File.separator + "netx-native-" + (rand & 0xFFFF)); File parent = nativeDir.getParentFile(); if (!parent.isDirectory() && !parent.mkdirs()) { return null; } try { FileUtils.createRestrictedDirectory(nativeDir); return nativeDir; } catch (IOException e) { return null; } } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/cache/PaxHeaders.17941/LruCacheException.java0000644000000000000000000000013012654402377025750 xustar0030 mtime=1454507263.265432208 29 atime=1454507327.12958047 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/cache/LruCacheException.java0000644000175000002070000000367512654402377026510 0ustar00jvanekmock00000000000000/* LruCacheException.java -- Thrown when cache is corrupted. Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.cache; class LruCacheException extends RuntimeException { public LruCacheException() { super(); } public LruCacheException(String string) { super(string); } public LruCacheException(Throwable cause) { super(cause); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/cache/PaxHeaders.17941/IllegalResourceDescriptorExceptio0000644000000000000000000000013012654402377030304 xustar0030 mtime=1454507263.265432208 29 atime=1454507327.12958047 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/cache/IllegalResourceDescriptorException.java0000644000175000002070000000401612654402377032130 0ustar00jvanekmock00000000000000/* IllegalResourceDescriptorException.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.cache; @SuppressWarnings("serial") public class IllegalResourceDescriptorException extends IllegalArgumentException { /** * Constructs a {@code IllegalResourceDescriptorException} with the * specified detail message. * @param msg the detail message. */ public IllegalResourceDescriptorException(String msg) { super(msg); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/cache/PaxHeaders.17941/DownloadIndicator.java0000644000000000000000000000013012654402377026007 xustar0030 mtime=1454507263.265432208 29 atime=1454507327.12958047 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/cache/DownloadIndicator.java0000644000175000002070000000644712654402377026547 0ustar00jvanekmock00000000000000// Copyright (C) 2001-2003 Jon A. Maxwell (JAM) // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp.cache; import java.net.*; import javax.jnlp.*; import net.sourceforge.jnlp.runtime.*; /** * A DownloadIndicator creates DownloadServiceListeners that are * notified of resources being transferred and their progress. * * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.8 $ */ public interface DownloadIndicator { /** * Return a download service listener that displays the progress * of downloading resources. Update messages may be reported * for URLs that are not included initially. *

    * Progress messages are sent as if the DownloadServiceListener * were listening to a DownloadService request. The listener * will receive progress messages from time to time during the * download. *

    * * @param app JNLP application downloading the files, or null if not applicable * @param downloadName name identifying the download to the user * @param resources initial urls to display, empty if none known at start * @return dedicated listener */ public DownloadServiceListener getListener(ApplicationInstance app, String downloadName, URL resources[]); /** * Indicates that a download service listener that was obtained * from the getDownloadListener method will no longer be used. * This method can be used to ensure that progress dialogs are * properly removed once a particular download is finished. * * @param listener the listener that is no longer in use */ public void disposeListener(DownloadServiceListener listener); /** * Return the desired time in milliseconds between updates. * Updates are not guarenteed to occur based on this value; for * example, they may occur based on the download percent or some * other factor. * * @return rate in milliseconds, must be >= 0 */ public int getUpdateRate(); /** * Return a time in milliseconds to wait for a download to * complete before obtaining a listener for the download. This * value can be used to skip lengthy operations, such as * initializing a GUI, for downloads that complete quickly. The * getListener method is not called if the download completes * in less time than the returned delay. * * @return delay in milliseconds, must be >= 0 */ public int getInitialDelay(); } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/cache/PaxHeaders.17941/DirectoryNode.java0000644000000000000000000000013012654402377025155 xustar0030 mtime=1454507263.265432208 29 atime=1454507327.12958047 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/cache/DirectoryNode.java0000644000175000002070000001216612654402377025710 0ustar00jvanekmock00000000000000/* DirectoryNode.java -- Structure for maintaining the cache directory tree. Copyright (C) 2010 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.cache; import java.io.File; import java.util.ArrayList; public class DirectoryNode { private String name; private File path; private ArrayList childNodes; private DirectoryNode parent = null; private File infoFile; /** * Create a new instance of DirectoryNode. * * @param name Name representing this node. * @param absPathToNode Absolute path to this node given as a String. * @param parent The parent node. */ public DirectoryNode(String name, String absPathToNode, DirectoryNode parent) { this(name, new File(absPathToNode), parent); } /** * Create a new instance of DirectoryNode. * * @param name Name representing this node. * @param absPathToNode Absolute path to this node as a File. * @param parent The parent node. */ public DirectoryNode(String name, File absPathToNode, DirectoryNode parent) { this(name, absPathToNode, null, parent); } /** * Create a new instance of DirectoryNode. * * @param name Name representing this node. * @param absPathToNode Absolute path to this node given as a File. * @param childNodes List of children nodes. * @param parent The parent node. */ public DirectoryNode(String name, File absPathToNode, ArrayList childNodes, DirectoryNode parent) { this.name = name; this.path = absPathToNode; this.childNodes = childNodes; if (this.childNodes == null) this.childNodes = new ArrayList(); this.parent = parent; if (!isDir()) this.infoFile = new File(this.getFile().getAbsolutePath().concat(".info")); } /** * Append the given node to the list of child nodes. * * @param node Node to be appended. */ public void addChild(DirectoryNode node) { try { childNodes.add(node); } catch (NullPointerException e) { this.childNodes = new ArrayList(); this.childNodes.add(node); } } /** * Removes the node specified. * * @param node Node to be removed from the list of children * @return true if this list of children contained the specified element */ public boolean removeChild(DirectoryNode node) { return this.childNodes.remove(node); } /** * Retrieve the name of this node. * * @return Name of this node. */ public String getName() { return this.name; } public String toString() { return this.name; } /** * Retrieve the file associated with this node. * * @return File that is associated with this node. */ public File getFile() { return path; } /** * Retrieve the parent node. * * @return DirectoryNode representing the parent of the current node. */ public DirectoryNode getParent() { return parent; } /** * Retrieves the list of child nodes. * * @return ArrayList of type DirectoryNode containing all the child nodes. */ public ArrayList getChildren() { return this.childNodes; } /** * Check if this node is a directory. * * @return True if node is directory. */ public boolean isDir() { return path.isDirectory(); } public File getInfoFile() { return this.infoFile; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/cache/PaxHeaders.17941/DefaultDownloadIndicator.java0000644000000000000000000000013112654402377027315 xustar0030 mtime=1454507263.264432221 30 atime=1454507327.128580484 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java0000644000175000002070000004125712654402377030052 0ustar00jvanekmock00000000000000// Copyright (C) 2001-2003 Jon A. Maxwell (JAM) // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp.cache; import static net.sourceforge.jnlp.runtime.Translator.R; import java.awt.*; import java.awt.event.*; import java.net.*; import java.util.*; import java.util.List; import javax.swing.*; import javax.swing.Timer; import javax.jnlp.*; import net.sourceforge.jnlp.runtime.*; import net.sourceforge.jnlp.util.ImageResources; import net.sourceforge.jnlp.util.ScreenFinder; /** * Show the progress of downloads. * * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.3 $ */ public class DefaultDownloadIndicator implements DownloadIndicator { // todo: rewrite this to cut down on size/complexity; smarter // panels (JList, renderer) understand resources instead of // nested panels and grid-bag mess. // todo: fix bug where user closes download box and it // never(?) reappears. // todo: UI for user to cancel/restart download // todo: this should be synchronized at some point but conflicts // aren't very likely. private static String downloading = R("CDownloading"); private static String complete = R("CComplete"); /** time to wait after completing but before window closes */ private static final int CLOSE_DELAY = 750; /** the display window */ private static JDialog dialog; private static final Object dialogMutex = new Object(); /** shared constraint */ static GridBagConstraints vertical; static GridBagConstraints verticalNoClean; static GridBagConstraints verticalIndent; static { vertical = new GridBagConstraints(); vertical.gridwidth = GridBagConstraints.REMAINDER; vertical.weightx = 1.0; vertical.fill = GridBagConstraints.HORIZONTAL; vertical.anchor = GridBagConstraints.WEST; verticalNoClean = new GridBagConstraints(); verticalNoClean.weightx = 1.0; verticalIndent = (GridBagConstraints) vertical.clone(); verticalIndent.insets = new Insets(0, 10, 3, 0); } /** * @return the update rate. */ @Override public int getUpdateRate() { return 150; //ms } /** * @return the initial delay before obtaining a listener. */ @Override public int getInitialDelay() { return 300; //ms } /** * Return a download service listener that displays the progress * in a shared download info window. * * @param app the downloading application, or null if N/A * @param downloadName name identifying the download to the user * @param resources initial urls to display (not required) * @return donload service listener attached to this app. instance */ @Override public DownloadServiceListener getListener(ApplicationInstance app, String downloadName, URL resources[]) { DownloadPanel result = new DownloadPanel(downloadName); synchronized (dialogMutex) { if (dialog == null) { dialog = createDownloadIndicatorWindow(true); } if (resources != null) { for (URL url : resources) { result.addProgressPanel(url, null); } } dialog.getContentPane().add(result, vertical); dialog.pack(); placeFrameToLowerRight(); result.addComponentListener(new ComponentAdapter() { @Override public void componentResized(ComponentEvent e) { placeFrameToLowerRight(); } }); dialog.setVisible(true); return result; } } public static JDialog createDownloadIndicatorWindow(boolean undecorated) throws HeadlessException { JDialog f = new JDialog((JFrame)null, downloading + "..."); f.setUndecorated(undecorated); f.setIconImages(ImageResources.INSTANCE.getApplicationImages()); f.getContentPane().setLayout(new GridBagLayout()); return f; } /** * This places indicator to lower right corner of active monitor. */ private static void placeFrameToLowerRight() throws HeadlessException { Rectangle bounds = ScreenFinder.getCurrentScreenSizeWithoutBounds(); dialog.setLocation(bounds.width+bounds.x - dialog.getWidth(), bounds.height+bounds.y - dialog.getHeight()); } /** * Remove a download service listener that was obtained by * calling the getDownloadListener method from the shared * download info window. */ @Override public void disposeListener(final DownloadServiceListener listener) { if (!(listener instanceof DownloadPanel)) return; ActionListener hider = new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { synchronized(dialogMutex) { dialog.getContentPane().remove((DownloadPanel) listener); dialog.pack(); if (dialog.getContentPane().getComponentCount() == 0) { dialog.setVisible(false); dialog.dispose(); dialog = null; } } } }; Timer timer = new Timer(CLOSE_DELAY, hider); timer.setRepeats(false); timer.start(); } /** * Groups the url progress in a panel. */ static class DownloadPanel extends JPanel implements DownloadServiceListener { private final DownloadPanel self; private static enum States{ ONE_JAR, COLLAPSED, DETAILED; } private static final String DETAILS=R("ButShowDetails"); private static final String HIDE_DETAILS=R("ButHideDetails"); /** the download name */ private String downloadName; /** Downloading part: */ private JLabel header = new JLabel(); /** Show/hide detailsButton button: */ private final JButton detailsButton; private static final URL magnifyGlassUrl = ClassLoader.getSystemResource("net/sourceforge/jnlp/resources/showDownloadDetails.png"); private static final URL redCrossUrl = ClassLoader.getSystemResource("net/sourceforge/jnlp/resources/hideDownloadDetails.png"); private static final Icon magnifyGlassIcon = new ImageIcon(magnifyGlassUrl); private static final Icon redCrossIcon = new ImageIcon(redCrossUrl); /** used instead of detailsButton button in case of one jar*/ private JLabel delimiter = new JLabel(""); /** all already created progress bars*/ private List progressPanels = new ArrayList<>(); private States state=States.ONE_JAR; private ProgressPanel mainProgressPanel; /** list of URLs being downloaded */ private List urls = new ArrayList<>(); /** list of ProgressPanels */ private List panels = new ArrayList<>(); /** * Create a new download panel for with the specified download * name. */ protected DownloadPanel(String downloadName) { self = this; setLayout(new GridBagLayout()); this.downloadName = downloadName; this.add(header, verticalNoClean); header.setFont(header.getFont().deriveFont(Font.BOLD)); this.add(delimiter, vertical); detailsButton = new JButton(magnifyGlassIcon); int w = magnifyGlassIcon.getIconWidth(); int h = magnifyGlassIcon.getIconHeight(); detailsButton.setPreferredSize(new Dimension(w + 2, h + 2)); detailsButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { if (state == States.DETAILED) { state = States.COLLAPSED; detailsButton.setToolTipText(DETAILS); detailsButton.setIcon(magnifyGlassIcon); for (ProgressPanel progressPanel : progressPanels) { remove(progressPanel); } add(mainProgressPanel, verticalIndent); recreateFrame(true); } else { state = States.DETAILED; detailsButton.setToolTipText(HIDE_DETAILS); detailsButton.setIcon(redCrossIcon); remove(mainProgressPanel); for (ProgressPanel progressPanel : progressPanels) { add(progressPanel, verticalIndent); } recreateFrame(false); } } public void recreateFrame(boolean undecorated) throws HeadlessException { JDialog oldFrame = dialog; dialog = createDownloadIndicatorWindow(undecorated); dialog.getContentPane().add(self, vertical); synchronized (dialogMutex) { dialog.pack(); placeFrameToLowerRight(); } dialog.setVisible(true); oldFrame.dispose(); } }); setOverallPercent(0); } /** * Add a ProgressPanel for a URL. */ protected void addProgressPanel(URL url, String version) { if (!urls.contains(url)) { ProgressPanel panel = new ProgressPanel(url, version); if (state != States.COLLAPSED) { add(panel, verticalIndent); } progressPanels.add(panel); urls.add(url); panels.add(panel); //download indicator does not know about added jars //When only one jar is added to downlaod queue then its progress is //shown, and there is no show detail button. //When second one is added, then it already knows that there will //be two or more jars, so it swap to collapsed state in count of two. //no later, no sooner if (panels.size() == 2){ remove(panels.get(0)); remove(panels.get(1)); remove(delimiter); add(detailsButton,vertical); mainProgressPanel=new ProgressPanel(); add(mainProgressPanel, verticalIndent); state=States.COLLAPSED; } synchronized (dialogMutex) { dialog.pack(); placeFrameToLowerRight(); } } } /** * Update the download progress of a url. */ protected void update(final URL url, final String version, final long readSoFar, final long total, final int overallPercent) { Runnable r = new Runnable() { @Override public void run() { if (!urls.contains(url)) addProgressPanel(url, version); setOverallPercent(overallPercent); ProgressPanel panel = panels.get(urls.indexOf(url)); panel.setProgress(readSoFar, total); panel.repaint(); } }; SwingUtilities.invokeLater(r); } /** * Sets the overall percent completed. * should be called via invokeLater */ public void setOverallPercent(int percent) { // don't get whole string from resource and sub in // values because it'll be doing a MessageFormat for // each update. header.setText(downloading + " " + downloadName + ": " + percent + "% " + complete + "."); Container c = header.getParent(); //we need to adapt both panels and also dialog to new length of header text while (c != null) { c.invalidate(); c.validate(); if (c instanceof Window){ ((Window) c).pack(); } c=c.getParent(); } if (mainProgressPanel != null) { mainProgressPanel.setProgress(percent, 100); mainProgressPanel.repaint(); } } /** * Called when a download failed. */ @Override public void downloadFailed(URL url, String version) { update(url, version, -1, -1, -1); } /** * Called when a download has progressed. */ @Override public void progress(URL url, String version, long readSoFar, long total, int overallPercent) { update(url, version, readSoFar, total, overallPercent); } /** * Called when an archive is patched. */ @Override public void upgradingArchive(URL url, String version, int patchPercent, int overallPercent) { update(url, version, patchPercent, 100, overallPercent); } /** * Called when a download is being validated. */ @Override public void validating(URL url, String version, long entry, long total, int overallPercent) { update(url, version, entry, total, overallPercent); } }; /** * A progress bar with the URL next to it. */ static class ProgressPanel extends JPanel { final private JPanel bar = new JPanel(); private long total; private long readSoFar; final private Dimension size = new Dimension(80, 15); ProgressPanel() { bar.setMinimumSize(size); bar.setPreferredSize(size); bar.setOpaque(false); setLayout(new GridBagLayout()); GridBagConstraints gbc = new GridBagConstraints(); styleGridBagConstraints(gbc); add(bar, gbc); } ProgressPanel(URL url, String version) { this(" " + url.getHost() + "/" + url.getFile(),version); } ProgressPanel(String caption, String version) { JLabel location = new JLabel(caption); bar.setMinimumSize(size); bar.setPreferredSize(size); bar.setOpaque(false); setLayout(new GridBagLayout()); GridBagConstraints gbc = new GridBagConstraints(); gbc.weightx = 0.0; gbc.fill = GridBagConstraints.NONE; gbc.gridwidth = GridBagConstraints.RELATIVE; add(bar, gbc); styleGridBagConstraints(gbc); add(location, gbc); } public void setProgress(long readSoFar, long total) { this.readSoFar = readSoFar; this.total = total; } @Override public void paintComponent(Graphics g) { super.paintComponent(g); int x = bar.getX(); int y = bar.getY(); int h = bar.getHeight(); int w = bar.getWidth(); if (readSoFar <= 0 || total <= 0) { // make barber pole } else { double progress = (double) readSoFar / (double) total; int divide = (int) (w * progress); g.setColor(Color.white); g.fillRect(x, y, w, h); g.setColor(Color.blue); g.fillRect(x + 1, y + 1, divide - 1, h - 1); } } private void styleGridBagConstraints(GridBagConstraints gbc) { gbc.insets = new Insets(0, 3, 0, 0); gbc.weightx = 1.0; gbc.fill = GridBagConstraints.HORIZONTAL; gbc.gridwidth = GridBagConstraints.REMAINDER; gbc.anchor = GridBagConstraints.WEST; } }; } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/cache/PaxHeaders.17941/CachedDaemonThreadPoolProvider.ja0000644000000000000000000000013112654402377030045 xustar0030 mtime=1454507263.264432221 30 atime=1454507327.128580484 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/cache/CachedDaemonThreadPoolProvider.java0000644000175000002070000000655212654402377031130 0ustar00jvanekmock00000000000000/* Copyright (C) 2011 Red Hat, Inc This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.cache; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.ThreadFactory; import java.util.concurrent.atomic.AtomicInteger; public class CachedDaemonThreadPoolProvider { /** * This is copypasted default factory from java.util.concurrent.Executors. * The only difference is, that it creates daemon threads. * * Except creating new threads, the rest of class is complicated creation of * name. */ private static class DaemonThreadFactory implements ThreadFactory { private static final AtomicInteger poolNumber = new AtomicInteger(1); private final ThreadGroup group; private final AtomicInteger threadNumber = new AtomicInteger(1); private final String namePrefix; DaemonThreadFactory() { SecurityManager s = System.getSecurityManager(); group = (s != null) ? s.getThreadGroup() : Thread.currentThread().getThreadGroup(); namePrefix = "itwpool-" + poolNumber.getAndIncrement() + "-itwthread-"; } @Override public Thread newThread(Runnable r) { Thread t = new Thread(group, r, namePrefix + threadNumber.getAndIncrement(), 0); if (!t.isDaemon()) { t.setDaemon(true); } if (t.getPriority() != Thread.NORM_PRIORITY) { t.setPriority(Thread.NORM_PRIORITY); } return t; } } public static final ExecutorService DAEMON_THREAD_POOL = Executors.newCachedThreadPool(new DaemonThreadFactory()); } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/cache/PaxHeaders.17941/CacheUtil.java0000644000000000000000000000013112654402377024245 xustar0030 mtime=1454507263.263432234 30 atime=1454507327.128580484 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/cache/CacheUtil.java0000644000175000002070000006065712654402377025007 0ustar00jvanekmock00000000000000// Copyright (C) 2001-2003 Jon A. Maxwell (JAM) // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp.cache; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.FilePermission; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.MalformedURLException; import java.net.URL; import java.net.URLConnection; import java.nio.channels.FileChannel; import java.nio.channels.FileLock; import java.security.Permission; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Map.Entry; import java.util.Set; import javax.jnlp.DownloadServiceListener; import net.sourceforge.jnlp.Version; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.config.PathsAndFiles; import net.sourceforge.jnlp.runtime.ApplicationInstance; import net.sourceforge.jnlp.runtime.JNLPRuntime; import static net.sourceforge.jnlp.runtime.Translator.R; import net.sourceforge.jnlp.security.ConnectionFactory; import net.sourceforge.jnlp.util.FileUtils; import net.sourceforge.jnlp.util.PropertiesFile; import net.sourceforge.jnlp.util.logging.OutputController; /** * Provides static methods to interact with the cache, download * indicator, and other utility methods. * * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.17 $ */ public class CacheUtil { /** * Caches a resource and returns a URL for it in the cache; * blocks until resource is cached. If the resource location is * not cacheable (points to a local file, etc) then the original * URL is returned. * * @param location location of the resource * @param version the version, or {@code null} * @param policy how to handle update * @return either the location in the cache or the original location */ public static URL getCachedResourceURL(URL location, Version version, UpdatePolicy policy) { try { File f = getCachedResourceFile(location, version, policy); //url was ponting to nowhere eg 404 if (f == null){ //originally f.toUrl was throwing NPE return null; //returning null seems to be better } // TODO: Should be toURI().toURL() return f.toURL(); } catch (MalformedURLException ex) { return location; } } /** * This is returning File object of cached resource originally from URL * @param location original location of blob * @param version version of resource * @param policy update policy of resource * @return location in ITW cache on filesystem */ public static File getCachedResourceFile(URL location, Version version, UpdatePolicy policy) { ResourceTracker rt = new ResourceTracker(); rt.addResource(location, version, null, policy); File f = rt.getCacheFile(location); return f; } /** * Returns the Permission object necessary to access the * resource, or {@code null} if no permission is needed. * @param location location of the resource * @param version the version, or {@code null} * @return permissions of the location */ public static Permission getReadPermission(URL location, Version version) { Permission result = null; if (CacheUtil.isCacheable(location, version)) { File file = CacheUtil.getCacheFile(location, version); result = new FilePermission(file.getPath(), "read"); } else { try { // this is what URLClassLoader does URLConnection conn = ConnectionFactory.getConnectionFactory().openConnection(location); result = conn.getPermission(); ConnectionFactory.getConnectionFactory().disconnect(conn); } catch (java.io.IOException ioe) { // should try to figure out the permission OutputController.getLogger().log(ioe); } } return result; } /** * Clears the cache by deleting all the Netx cache files * * Note: Because of how our caching system works, deleting jars of another javaws * process is using them can be quite disasterous. Hence why Launcher creates lock files * and we check for those by calling {@link #okToClearCache()} * @return true if the cache could be cleared and was cleared */ public static boolean clearCache() { if (!okToClearCache()) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, R("CCannotClearCache")); return false; } CacheLRUWrapper lruHandler = CacheLRUWrapper.getInstance(); File cacheDir = lruHandler.getCacheDir().getFile(); if (!(cacheDir.isDirectory())) { return false; } OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "Clearing cache directory: " + cacheDir); lruHandler.lock(); try { cacheDir = cacheDir.getCanonicalFile(); FileUtils.recursiveDelete(cacheDir, cacheDir); cacheDir.mkdir(); lruHandler.clearLRUSortedEntries(); lruHandler.store(); } catch (IOException e) { throw new RuntimeException(e); } finally { lruHandler.unlock(); } return true; } /** * Returns a boolean indicating if it ok to clear the netx application cache at this point * @return true if the cache can be cleared at this time without problems */ private static boolean okToClearCache() { File otherJavawsRunning = PathsAndFiles.MAIN_LOCK.getFile(); FileLock locking = null; try { if (otherJavawsRunning.isFile()) { FileOutputStream fis = new FileOutputStream(otherJavawsRunning); FileChannel channel = fis.getChannel(); locking = channel.tryLock(); if (locking == null) { OutputController.getLogger().log("Other instances of netx are running"); return false; } OutputController.getLogger().log("No other instances of netx are running"); return true; } else { OutputController.getLogger().log("No instance file found"); return true; } } catch (IOException e) { return false; } finally { if (locking != null) { try { locking.release(); } catch (IOException ex) { OutputController.getLogger().log(ex); } } } } /** * Returns whether there is a version of the URL contents in the * cache and it is up to date. This method may not return * immediately. * * @param source the source {@link URL} * @param version the versions to check for * @param lastModifed time in milis since epoch of last modfication * @return whether the cache contains the version * @throws IllegalArgumentException if the source is not cacheable */ public static boolean isCurrent(URL source, Version version, long lastModifed) { if (!isCacheable(source, version)) throw new IllegalArgumentException(R("CNotCacheable", source)); try { CacheEntry entry = new CacheEntry(source, version); // could pool this boolean result = entry.isCurrent(lastModifed); OutputController.getLogger().log("isCurrent: " + source + " = " + result); return result; } catch (Exception ex) { OutputController.getLogger().log(ex); return isCached(source, version); // if can't connect return whether already in cache } } /** * Returns true if the cache has a local copy of the contents of * the URL matching the specified version string. * * @param source the source URL * @param version the versions to check for * @return true if the source is in the cache * @throws IllegalArgumentException if the source is not cacheable */ public static boolean isCached(URL source, Version version) { if (!isCacheable(source, version)) throw new IllegalArgumentException(R("CNotCacheable", source)); CacheEntry entry = new CacheEntry(source, version); // could pool this boolean result = entry.isCached(); OutputController.getLogger().log("isCached: " + source + " = " + result); return result; } /** * Returns whether the resource can be cached as a local file; * if not, then URLConnection.openStream can be used to obtain * the contents. * @param source the url of resource * @param version version of resource * @return whether this resource can be cached */ public static boolean isCacheable(URL source, Version version) { if (source == null) return false; if (source.getProtocol().equals("file")){ return false; } if (source.getProtocol().equals("jar")){ return false; } return true; } /** * Returns the file for the locally cached contents of the * source. This method returns the file location only and does * not download the resource. The latest version of the * resource that matches the specified version will be returned. * * @param source the source {@link URL} * @param version the version id of the local file * @return the file location in the cache, or {@code null} if no versions cached * @throws IllegalArgumentException if the source is not cacheable */ public static File getCacheFile(URL source, Version version) { // ensure that version is an version id not version string if (!isCacheable(source, version)) throw new IllegalArgumentException(R("CNotCacheable", source)); File cacheFile = null; CacheLRUWrapper lruHandler = CacheLRUWrapper.getInstance(); synchronized (lruHandler) { try { lruHandler.lock(); // We need to reload the cacheOrder file each time // since another plugin/javaws instance may have updated it. lruHandler.load(); cacheFile = getCacheFileIfExist(urlToPath(source, "")); if (cacheFile == null) { // We did not find a copy of it. cacheFile = makeNewCacheFile(source, version); } else lruHandler.store(); } finally { lruHandler.unlock(); } } return cacheFile; } /** * This will return a File pointing to the location of cache item. * * @param urlPath Path of cache item within cache directory. * @return File if we have searched before, {@code null} otherwise. */ private static File getCacheFileIfExist(File urlPath) { CacheLRUWrapper lruHandler = CacheLRUWrapper.getInstance(); synchronized (lruHandler) { File cacheFile = null; List> entries = lruHandler.getLRUSortedEntries(); // Start searching from the most recent to least recent. for (Entry e : entries) { final String key = e.getKey(); final String path = e.getValue(); if (pathToURLPath(path).equals(urlPath.getPath())) { // Match found. cacheFile = new File(path); lruHandler.updateEntry(key); break; // Stop searching since we got newest one already. } } return cacheFile; } } /** * Get the path to file minus the cache directory and indexed folder. */ private static String pathToURLPath(String path) { int len = CacheLRUWrapper.getInstance().getCacheDir().getFullPath().length(); int index = path.indexOf(File.separatorChar, len + 1); return path.substring(index); } /** * Returns the parent directory of the cached resource. * @param filePath The path of the cached resource directory. * @return parent dir of cache */ public static String getCacheParentDirectory(String filePath) { String path = filePath; String tempPath; String cacheDir = CacheLRUWrapper.getInstance().getCacheDir().getFullPath(); while(path.startsWith(cacheDir) && !path.equals(cacheDir)){ tempPath = new File(path).getParent(); if (tempPath.equals(cacheDir)) break; path = tempPath; } return path; } /** * This will create a new entry for the cache item. It is however not * initialized but any future calls to getCacheFile with the source and * version given to here, will cause it to return this item. * * @param source the source URL * @param version the version id of the local file * @return the file location in the cache. */ public static File makeNewCacheFile(URL source, Version version) { CacheLRUWrapper lruHandler = CacheLRUWrapper.getInstance(); synchronized (lruHandler) { File cacheFile = null; try { lruHandler.lock(); lruHandler.load(); for (long i = 0; i < Long.MAX_VALUE; i++) { String path = lruHandler.getCacheDir().getFullPath()+ File.separator + i; File cDir = new File(path); if (!cDir.exists()) { // We can use this directory. try { cacheFile = urlToPath(source, path); FileUtils.createParentDir(cacheFile); File pf = new File(cacheFile.getPath() + ".info"); FileUtils.createRestrictedFile(pf, true); // Create the info file for marking later. lruHandler.addEntry(lruHandler.generateKey(cacheFile.getPath()), cacheFile.getPath()); } catch (IOException ioe) { OutputController.getLogger().log(ioe); } break; } } lruHandler.store(); } finally { lruHandler.unlock(); } return cacheFile; } } /** * Returns a buffered output stream open for writing to the * cache file. * * @param source the remote location * @param version the file version to write to * @return the stream to write to resource * @throws java.io.IOException if IO breaks */ public static OutputStream getOutputStream(URL source, Version version) throws IOException { File localFile = getCacheFile(source, version); OutputStream out = new FileOutputStream(localFile); return new BufferedOutputStream(out); } /** * Copies from an input stream to an output stream. On * completion, both streams will be closed. Streams are * buffered automatically. * @param is stream to read from * @param os stream to write to * @throws java.io.IOException if copy fails */ public static void streamCopy(InputStream is, OutputStream os) throws IOException { if (!(is instanceof BufferedInputStream)) is = new BufferedInputStream(is); if (!(os instanceof BufferedOutputStream)) os = new BufferedOutputStream(os); try { byte b[] = new byte[4096]; while (true) { int c = is.read(b, 0, b.length); if (c == -1) break; os.write(b, 0, c); } } finally { is.close(); os.close(); } } /** * Converts a URL into a local path string within the given directory. For * example a url with subdirectory /tmp/ will * result in a File that is located somewhere within /tmp/ * * @param location the url * @param subdir the subdirectory * @return the file */ public static File urlToPath(URL location, String subdir) { if (subdir == null) { throw new NullPointerException(); } StringBuilder path = new StringBuilder(); path.append(subdir); path.append(File.separatorChar); path.append(location.getProtocol()); path.append(File.separatorChar); path.append(location.getHost()); path.append(File.separatorChar); path.append(location.getPath().replace('/', File.separatorChar)); if (location.getQuery() != null && !location.getQuery().trim().isEmpty()) { path.append(".").append(location.getQuery()); } return new File(FileUtils.sanitizePath(path.toString())); } /** * Waits until the resources are downloaded, while showing a * progress indicator. * * @param app application instance with context for this resource * @param tracker the resource tracker * @param resources the resources to wait for * @param title name of the download */ public static void waitForResources(ApplicationInstance app, ResourceTracker tracker, URL resources[], String title) { DownloadIndicator indicator = JNLPRuntime.getDefaultDownloadIndicator(); DownloadServiceListener listener = null; try { if (indicator == null) { tracker.waitForResources(resources, 0); return; } // see if resources can be downloaded very quickly; avoids // overhead of creating display components for the resources if (tracker.waitForResources(resources, indicator.getInitialDelay())) return; // only resources not starting out downloaded are displayed List urlList = new ArrayList<>(); for (URL url : resources) { if (!tracker.checkResource(url)) urlList.add(url); } URL undownloaded[] = urlList.toArray(new URL[urlList.size()]); listener = indicator.getListener(app, title, undownloaded); do { long read = 0; long total = 0; for (URL url : undownloaded) { // add in any -1's; they're insignificant total += tracker.getTotalSize(url); read += tracker.getAmountRead(url); } int percent = (int) ((100 * read) / Math.max(1, total)); for (URL url : undownloaded) { listener.progress(url, "version", tracker.getAmountRead(url), tracker.getTotalSize(url), percent); } } while (!tracker.waitForResources(resources, indicator.getUpdateRate())); // make sure they read 100% until indicator closes for (URL url : undownloaded) { listener.progress(url, "version", tracker.getTotalSize(url), tracker.getTotalSize(url), 100); } } catch (InterruptedException ex) { OutputController.getLogger().log(ex); } finally { if (listener != null) indicator.disposeListener(listener); } } /** * This will remove all old cache items. */ public static void cleanCache() { CacheLRUWrapper lruHandler = CacheLRUWrapper.getInstance(); if (okToClearCache()) { // First we want to figure out which stuff we need to delete. HashSet keep = new HashSet<>(); HashSet remove = new HashSet<>(); try { lruHandler.lock(); lruHandler.load(); long maxSize = -1; // Default try { maxSize = Long.parseLong(JNLPRuntime.getConfiguration().getProperty(DeploymentConfiguration.KEY_CACHE_MAX_SIZE)); } catch (NumberFormatException nfe) { } maxSize = maxSize << 20; // Convert from megabyte to byte (Negative values will be considered unlimited.) long curSize = 0; for (Entry e : lruHandler.getLRUSortedEntries()) { // Check if the item is contained in cacheOrder. final String key = e.getKey(); final String path = e.getValue(); File file = new File(path); PropertiesFile pf = new PropertiesFile(new File(path + ".info")); boolean delete = Boolean.parseBoolean(pf.getProperty("delete")); /* * This will get me the root directory specific to this cache item. * Example: * cacheDir = /home/user1/.icedtea/cache * file.getPath() = /home/user1/.icedtea/cache/0/http/www.example.com/subdir/a.jar * rStr first becomes: /0/http/www.example.com/subdir/a.jar * then rstr becomes: /home/user1/.icedtea/cache/0 */ String rStr = file.getPath().substring(lruHandler.getCacheDir().getFullPath().length()); rStr = lruHandler.getCacheDir().getFullPath()+ rStr.substring(0, rStr.indexOf(File.separatorChar, 1)); long len = file.length(); if (keep.contains(file.getPath().substring(rStr.length()))) { lruHandler.removeEntry(key); continue; } /* * we remove entries from our lru if any of the following condition is met. * Conditions: * - delete: file has been marked for deletion. * - !file.isFile(): if someone tampered with the directory, file doesn't exist. * - maxSize >= 0 && curSize + len > maxSize: If a limit was set and the new size * on disk would exceed the maximum size. */ if (delete || !file.isFile() || (maxSize >= 0 && curSize + len > maxSize)) { lruHandler.removeEntry(key); remove.add(rStr); continue; } curSize += len; keep.add(file.getPath().substring(rStr.length())); for (File f : file.getParentFile().listFiles()) { if (!(f.equals(file) || f.equals(pf.getStoreFile()))) { try { FileUtils.recursiveDelete(f, f); } catch (IOException e1) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e1); } } } } lruHandler.store(); } finally { lruHandler.unlock(); } removeSetOfDirectories(remove); } } private static void removeSetOfDirectories(Set remove) { for (String s : remove) { File f = new File(s); try { FileUtils.recursiveDelete(f, f); } catch (IOException e) { } } } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/cache/PaxHeaders.17941/CacheLRUWrapper.java0000644000000000000000000000013112654402377025333 xustar0030 mtime=1454507263.263432234 30 atime=1454507327.128580484 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/cache/CacheLRUWrapper.java0000644000175000002070000002750012654402377026063 0ustar00jvanekmock00000000000000/* CacheLRUWrapper -- Handle LRU for cache files. Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.cache; import static net.sourceforge.jnlp.runtime.Translator.R; import java.io.File; import java.io.IOException; import java.util.AbstractMap; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.Iterator; import java.util.List; import java.util.Map.Entry; import java.util.Set; import net.sourceforge.jnlp.config.InfrastructureFileDescriptor; import net.sourceforge.jnlp.config.PathsAndFiles; import net.sourceforge.jnlp.util.FileUtils; import net.sourceforge.jnlp.util.PropertiesFile; import net.sourceforge.jnlp.util.logging.OutputController; /** * This class helps maintain the ordering of most recently use items across * multiple jvm instances. * */ public class CacheLRUWrapper { /* * back-end of how LRU is implemented This file is to keep track of the most * recently used items. The items are to be kept with key = (current time * accessed) followed by folder of item. value = path to file. */ private final InfrastructureFileDescriptor recentlyUsedPropertiesFile; private final InfrastructureFileDescriptor cacheDir; public CacheLRUWrapper() { this(PathsAndFiles.getRecentlyUsedFile(), PathsAndFiles.CACHE_DIR); } /** * testing constructor * @param recentlyUsed file to be used as recently_used file * @param cacheDir dir with cache */ public CacheLRUWrapper(final InfrastructureFileDescriptor recentlyUsed, final InfrastructureFileDescriptor cacheDir) { recentlyUsedPropertiesFile = recentlyUsed; this.cacheDir = cacheDir; if (!recentlyUsed.getFile().exists()) { try { FileUtils.createParentDir(recentlyUsed.getFile()); FileUtils.createRestrictedFile(recentlyUsed.getFile(), true); } catch (IOException e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); } } } /** * Returns an instance of the policy. * * @return an instance of the policy */ public static CacheLRUWrapper getInstance() { return CacheLRUWrapperHolder.INSTANCE; } private PropertiesFile cachedRecentlyUsedPropertiesFile = null ; /** * @return the recentlyUsedPropertiesFile */ synchronized PropertiesFile getRecentlyUsedPropertiesFile() { if (cachedRecentlyUsedPropertiesFile == null) { //no properties file yet, create it cachedRecentlyUsedPropertiesFile = new PropertiesFile(recentlyUsedPropertiesFile.getFile()); return cachedRecentlyUsedPropertiesFile; } if (recentlyUsedPropertiesFile.getFile().equals(cachedRecentlyUsedPropertiesFile.getStoreFile())){ //The underlying InfrastructureFileDescriptor is still pointing to the same file, use current properties file return cachedRecentlyUsedPropertiesFile; } else { //the InfrastructureFileDescriptor was set to different location, move to it if (cachedRecentlyUsedPropertiesFile.tryLock()) { cachedRecentlyUsedPropertiesFile.store(); cachedRecentlyUsedPropertiesFile.unlock(); } cachedRecentlyUsedPropertiesFile = new PropertiesFile(recentlyUsedPropertiesFile.getFile()); return cachedRecentlyUsedPropertiesFile; } } /** * @return the cacheDir */ public InfrastructureFileDescriptor getCacheDir() { return cacheDir; } /** * @return the recentlyUsedFile */ public InfrastructureFileDescriptor getRecentlyUsedFile() { return recentlyUsedPropertiesFile; } private static class CacheLRUWrapperHolder{ private static final CacheLRUWrapper INSTANCE = new CacheLRUWrapper(); } /** * Update map for keeping track of recently used items. */ public synchronized void load() { boolean loaded = getRecentlyUsedPropertiesFile().load(); /* * clean up possibly corrupted entries */ if (loaded && checkData()) { OutputController.getLogger().log(new LruCacheException()); OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, R("CFakeCache")); store(); OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, R("CFakedCache")); } } /** * check content of recentlyUsedPropertiesFile and remove invalid/corrupt entries * * @return true, if cache was corrupted and affected entry removed */ private boolean checkData () { boolean modified = false; Set> q = getRecentlyUsedPropertiesFile().entrySet(); for (Iterator> it = q.iterator(); it.hasNext();) { Entry currentEntry = it.next(); final String key = (String) currentEntry.getKey(); final String path = (String) currentEntry.getValue(); // 1. check key format: "milliseconds,number" try { String sa[] = key.split(","); Long l1 = Long.parseLong(sa[0]); Long l2 = Long.parseLong(sa[1]); } catch (Exception ex) { it.remove(); modified = true; continue; } // 2. check path format - does the path look correct? if (path != null) { if (!path.contains(getCacheDir().getFullPath())) { it.remove(); modified = true; } } else { it.remove(); modified = true; } } return modified; } /** * Write file to disk. * @return true if properties were successfully stored, false otherwise */ public synchronized boolean store() { if (getRecentlyUsedPropertiesFile().isHeldByCurrentThread()) { getRecentlyUsedPropertiesFile().store(); return true; } return false; } /** * This adds a new entry to file. * * @param key key we want path to be associated with. * @param path path to cache item. * @return true if we successfully added to map, false otherwise. */ public synchronized boolean addEntry(String key, String path) { PropertiesFile props = getRecentlyUsedPropertiesFile(); if (props.containsKey(key)) { return false; } props.setProperty(key, path); return true; } /** * This removed an entry from our map. * * @param key key we want to remove. * @return true if we successfully removed key from map, false otherwise. */ public synchronized boolean removeEntry(String key) { PropertiesFile props = getRecentlyUsedPropertiesFile(); if (!props.containsKey(key)) { return false; } props.remove(key); return true; } private String getIdForCacheFolder(String folder) { int len = getCacheDir().getFullPath().length(); int index = folder.indexOf(File.separatorChar, len + 1); return folder.substring(len + 1, index); } /** * This updates the given key to reflect it was recently accessed. * * @param oldKey Key we wish to update. * @return true if we successfully updated value, false otherwise. */ public synchronized boolean updateEntry(String oldKey) { PropertiesFile props = getRecentlyUsedPropertiesFile(); if (!props.containsKey(oldKey)) { return false; } String value = props.getProperty(oldKey); String folder = getIdForCacheFolder(value); props.remove(oldKey); props.setProperty(Long.toString(System.currentTimeMillis()) + "," + folder, value); return true; } /** * Return a copy of the keys available. * * @return List of Strings sorted by ascending order. */ @SuppressWarnings({"unchecked", "rawtypes"}) //although Properties are pretending to be they are always //bug in jdk? public synchronized List> getLRUSortedEntries() { List> entries = new ArrayList<>(); for (Entry e : getRecentlyUsedPropertiesFile().entrySet()) { entries.add(new AbstractMap.SimpleImmutableEntry(e)); } // sort by keys in descending order. Collections.sort(entries, new Comparator>() { @Override public int compare(Entry e1, Entry e2) { Long t1 = Long.parseLong(e1.getKey().split(",")[0]); Long t2 = Long.parseLong(e2.getKey().split(",")[0]); int c = t1.compareTo(t2); return c < 0 ? 1 : (c > 0 ? -1 : 0); } }); return entries; } /** * Lock the file to have exclusive access. */ public synchronized void lock() { getRecentlyUsedPropertiesFile().lock(); } /** * Unlock the file. */ public synchronized void unlock() { getRecentlyUsedPropertiesFile().unlock(); } /** * Return the value of given key. * * @param key key of property * @return value of given key, null otherwise. */ public synchronized String getValue(String key) { return getRecentlyUsedPropertiesFile().getProperty(key); } public synchronized boolean containsKey(String key) { return getRecentlyUsedPropertiesFile().containsKey(key); } public synchronized boolean containsValue(String value) { return getRecentlyUsedPropertiesFile().containsValue(value); } /** * Generate a key given the path to file. May or may not generate the same * key given same path. * * @param path Path to generate a key with. * @return String representing the a key. */ public String generateKey(String path) { return System.currentTimeMillis() + "," + getIdForCacheFolder(path); } void clearLRUSortedEntries() { getRecentlyUsedPropertiesFile().clear(); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/cache/PaxHeaders.17941/CacheEntry.java0000644000000000000000000000013112654402377024431 xustar0030 mtime=1454507263.262432247 30 atime=1454507327.128580484 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/cache/CacheEntry.java0000644000175000002070000001765112654402377025167 0ustar00jvanekmock00000000000000// Copyright (C) 2001-2003 Jon A. Maxwell (JAM) // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp.cache; import static net.sourceforge.jnlp.runtime.Translator.R; import java.io.File; import java.net.URL; import net.sourceforge.jnlp.Version; import net.sourceforge.jnlp.util.PropertiesFile; import net.sourceforge.jnlp.util.logging.OutputController; /** * Describes an entry in the cache. * * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.10 $ */ public class CacheEntry { public static final long LENGTH_UNKNOWN = -1; private static final String KEY_CONTENT_LENGTH = "content-length"; private static final String KEY_CONTENT_ORIGINAL_LENGTH = "content-original-length"; private static final String KEY_LAST_MODIFIED = "last-modified"; private static final String KEY_LAST_UPDATED = "last-updated"; /** the remote resource location */ private final URL location; /** the requested version */ private final Version version; /** info about the cached file */ private final PropertiesFile properties; /** * Create a CacheEntry for the resources specified as a remote * URL. * * @param location the remote resource location * @param version the version of the resource */ public CacheEntry(URL location, Version version) { this.location = location; this.version = version; this.properties = readCacheEntryInfo(); } /** * Seam for testing */ PropertiesFile readCacheEntryInfo() { File infoFile = CacheUtil.getCacheFile(location, version); infoFile = new File(infoFile.getPath() + ".info"); // replace with something that can't be clobbered return new PropertiesFile(infoFile, R("CAutoGen")); } /** * Returns the remote location this entry caches. * @return URL same as the one on which this entry was created */ public URL getLocation() { return location; } /** * Returns the time in the local system clock that the file was * most recently checked for an update. * @return when the item was updated (in ms) */ public long getLastUpdated() { return getLongKey(KEY_LAST_UPDATED); } /** * Sets the time in the local system clock that the file was * most recently checked for an update. * @param updatedTime the time (in ms) to be set as last updated time */ public void setLastUpdated(long updatedTime) { setLongKey(KEY_LAST_UPDATED, updatedTime); } public long getRemoteContentLength() { return getLongKey(KEY_CONTENT_LENGTH); } public void setRemoteContentLength(long length) { setLongKey(KEY_CONTENT_LENGTH, length); } /** * Return the length of the original content that was cached. May be different * from the actual cache entry size due to (de)compression. * * @return the content length or {@link #LENGTH_UNKNOWN} if unknown. */ public long getOriginalContentLength() { return getLongKey(KEY_CONTENT_ORIGINAL_LENGTH, LENGTH_UNKNOWN); } /** * Set the length of the original content that was cached. May be different * from the actual cache entry size due to (de)compression. * @param contentLength length of content */ public void setOriginalContentLength(long contentLength) { setLongKey(KEY_CONTENT_ORIGINAL_LENGTH, contentLength); } public long getLastModified() { return getLongKey(KEY_LAST_MODIFIED); } public void setLastModified(long modifyTime) { setLongKey(KEY_LAST_MODIFIED, modifyTime); } private long getLongKey(String key) { return getLongKey(key, 0); } private long getLongKey(String key, long defaultValue) { try { return Long.parseLong(properties.getProperty(key)); } catch (Exception ex) { OutputController.getLogger().log(ex); return defaultValue; } } private void setLongKey(String key, long value) { properties.setProperty(key, Long.toString(value)); } /** * Returns whether there is a version of the URL contents in * the cache and it is up to date. * * @param lastModified - current time as get from server (in ms). Mostly value of "Last-Modified" http header'? * @return whether the cache contains the version */ public boolean isCurrent(long lastModified) { boolean cached = isCached(); OutputController.getLogger().log("isCurrent:isCached " + cached); if (!cached) { return false; } try { long cachedModified = Long.parseLong(properties.getProperty(KEY_LAST_MODIFIED)); OutputController.getLogger().log("isCurrent:lastModified cache:" + cachedModified + " actual:" + lastModified); return lastModified > 0 && lastModified <= cachedModified; } catch (Exception ex){ OutputController.getLogger().log(ex); return cached; } } /** * Returns true if the cache has a local copy of the contents * of the URL matching the specified version string. * * @return true if the resource is in the cache */ public boolean isCached() { File localFile = getCacheFile(); if (!localFile.exists()) return false; try { long cachedLength = localFile.length(); String originalLength = properties.getProperty(KEY_CONTENT_ORIGINAL_LENGTH); if (originalLength != null) { cachedLength = Long.parseLong(originalLength); } long remoteLength = Long.parseLong(properties.getProperty(KEY_CONTENT_LENGTH, "-1")); OutputController.getLogger().log("isCached: remote:" + remoteLength + " cached:" + cachedLength); if (remoteLength >= 0 && cachedLength != remoteLength) return false; else return true; } catch (Exception ex) { OutputController.getLogger().log(ex); return false; // should throw? } } /** * Seam for testing */ File getCacheFile() { return CacheUtil.getCacheFile(location, version); } /** * Save the current information for the cache entry. * * @return True if successfuly stored into file, false otherwise */ protected boolean store() { if (properties.isHeldByCurrentThread()) { properties.store(); return true; } else { return false; } } /** * Mark this entry for deletion at shutdown. */ public void markForDelete() { // once marked it should not be unmarked. properties.setProperty("delete", Boolean.toString(true)); } /** * Lock cache item. */ protected void lock() { properties.lock(); } /** * Unlock cache item. Does not do anything if not holding the lock. */ protected void unlock() { properties.unlock(); } protected boolean tryLock() { return properties.tryLock(); } protected boolean isHeldByCurrentThread() { return properties.isHeldByCurrentThread(); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/cache/PaxHeaders.17941/CacheDirectory.java0000644000000000000000000000013112654402377025274 xustar0030 mtime=1454507263.261432261 30 atime=1454507327.128580484 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/cache/CacheDirectory.java0000644000175000002070000001036012654402377026020 0ustar00jvanekmock00000000000000/* CacheDirectory.java -- Traverse the given directory and return the leafs. Copyright (C) 2010 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.cache; import java.io.File; import java.util.ArrayList; import net.sourceforge.jnlp.util.FileUtils; import net.sourceforge.jnlp.util.logging.OutputController; public final class CacheDirectory { /* Don't allow instantiation of this class */ private CacheDirectory(){} /** * Get the structure of directory for keeping track of the protocol and * domain. * * @param root Location of cache directory. */ public static void getDirStructure(DirectoryNode root) { for (File f : root.getFile().listFiles()) { DirectoryNode node = new DirectoryNode(f.getName(), f, root); if (f.isDirectory() || (!f.isDirectory() && !f.getName().endsWith(".info"))) root.addChild(node); if (f.isDirectory()) getDirStructure(node); } } /** * Get all the leaf nodes. * * @param root The point where we want to start getting the leafs. * @return An ArrayList of DirectoryNode. */ public static ArrayList getLeafData(DirectoryNode root) { ArrayList temp = new ArrayList<>(); for (DirectoryNode f : root.getChildren()) { if (f.isDir()) temp.addAll(getLeafData(f)); else if (!f.getName().endsWith(".info")) temp.add(f); } return temp; } /** * Removes empty folders in the current directory. * * @param root File pointing at the beginning of directory. * @return True if something was deleted. */ public static boolean cleanDir(File root) { boolean delete = true; for (File f : root.listFiles()) { if (f.isDirectory()) cleanDir(f); else delete = false; } if (delete){ OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, "Delete -- " + root); } // root.delete(); return true; } /** * This will recursively remove the parent folders if they are empty. * * @param fileNode node of file which parent is going to be cleaned */ public static void cleanParent(DirectoryNode fileNode) { DirectoryNode parent = fileNode.getParent(); if (parent.getParent() == null) return; // Don't delete the root. if (parent.getChildren().isEmpty()) { FileUtils.deleteWithErrMesg(parent.getFile()); parent.getParent().removeChild(parent); cleanParent(parent); } } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/browser0000644000000000000000000000013112654402377022104 xustar0030 mtime=1454507263.261432261 30 atime=1454507658.779157357 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/browser/0000755000175000002070000000000012654402377022705 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/netx/net/sourceforge/jnlp/browser/PaxHeaders.17941/FirefoxPreferencesParser.java0000644000000000000000000000013112654402377027765 xustar0030 mtime=1454507263.261432261 30 atime=1454507327.128580484 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/browser/FirefoxPreferencesParser.java0000644000175000002070000001362012654402377030513 0ustar00jvanekmock00000000000000/* FirefoxPreferencesParser.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.browser; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; import java.util.HashMap; import java.util.Map; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.util.logging.OutputController; /** *

    * A parser for Firefox's preferences file. It can 'parse' Firefox's * preferences file and expose the prefrences in a simple to use format. *

    * Sample usage: *
    
     * FirefoxPreferencesParser p = new FirefoxPreferencesParser(prefsFile);
     * p.parse();
     * Map<String,String> prefs = p.getPreferences();
     * System.out.println("blink allowed: " + prefs.get("browser.blink_allowed"));
     * 
    */ public final class FirefoxPreferencesParser { File prefsFile = null; Map prefs = null; /** * Creates a new FirefoxPreferencesParser * @param preferencesFile */ public FirefoxPreferencesParser(File preferencesFile) { prefsFile = preferencesFile; } /** * Parse the prefernces file * @throws IOException if an exception ocurrs while reading the * preferences file. */ public void parse() throws IOException { /* * The Firefox preference file is actually in javascript. It does seem * to be nicely formatted, so it should be possible to hack reading it. * The correct way of course is to use a javascript library and extract * the user_pref object */ prefs = new HashMap(); BufferedReader reader = new BufferedReader(new FileReader(prefsFile)); try { while (true) { String line = reader.readLine(); // end of stream if (line == null) { break; } line = line.trim(); if (line.startsWith("user_pref")) { /* * each line is of the form: user_pref("key",value); where value * can be a string in double quotes or an integer or float or * boolean */ boolean foundKey = false; boolean foundValue = false; // extract everything inside user_pref( and ); String pref = line.substring("user_pref(".length(), line.length() - 2); // key and value are separated by a , int firstCommaPos = pref.indexOf(','); if (firstCommaPos >= 1) { String key = pref.substring(0, firstCommaPos).trim(); if (key.startsWith("\"") && key.endsWith("\"")) { key = key.substring(1, key.length() - 1); if (key.trim().length() > 0) { foundKey = true; } } if (pref.length() > firstCommaPos + 1) { String value = pref.substring(firstCommaPos + 1).trim(); if (value.startsWith("\"") && value.endsWith("\"")) { value = value.substring(1, value.length() - 1).trim(); } foundValue = true; if (foundKey && foundValue) { //ItwLogger.getLogger().printOutLn("added (\"" + key + "\", \"" + value + "\")"); prefs.put(key, value); } } } } } } finally { reader.close(); } OutputController.getLogger().log("Read " + prefs.size() + " entries from Firefox's preferences"); } /** * Get the firefox preferences as a map (key,value pair). Note that * all values (including integers and booleans) are stored as a string, so * conversion to an appropriate type may be required. * * @return a map containing firefox' preferences */ public Map getPreferences() { HashMap newMap = new HashMap(); newMap.putAll(prefs); return newMap; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/browser/PaxHeaders.17941/FirefoxPreferencesFinder.java0000644000000000000000000000013112654402377027740 xustar0030 mtime=1454507263.261432261 30 atime=1454507327.127580497 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/browser/FirefoxPreferencesFinder.java0000644000175000002070000001201312654402377030461 0ustar00jvanekmock00000000000000/* FirefoxPreferencesFinder.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.browser; import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; import java.util.List; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.util.logging.OutputController; /** * Finds the file corresponding to firefox's (default) preferences file */ public class FirefoxPreferencesFinder { /** * Returns a file object representing firefox's preferences file * * @return a File object representing the preferences file. * @throws FileNotFoundException if the preferences file could not be found * @throws IOException if an exception occurs while trying to identify the * location of the preferences file. */ public static File find() throws IOException { String configPath = System.getProperty("user.home") + File.separator + ".mozilla" + File.separator + "firefox" + File.separator; String profilesPath = configPath + "profiles.ini"; if (!(new File(profilesPath).isFile())) { throw new FileNotFoundException(profilesPath); } OutputController.getLogger().log("Using firefox's profiles file: " + profilesPath); BufferedReader reader = new BufferedReader(new FileReader(profilesPath)); List linesInSection = new ArrayList(); boolean foundDefaultSection = false; /* * The profiles.ini file is an ini file. This is a quick hack to read * it. It is very likely to break given anything strange. */ // find the section with an entry Default=1 try { while (true) { String line = reader.readLine(); if (line == null) { break; } line = line.trim(); if (line.startsWith("[Profile") && line.endsWith("]")) { if (foundDefaultSection) { break; } // new section linesInSection = new ArrayList(); } else { linesInSection.add(line); int equalSignPos = line.indexOf('='); if (equalSignPos > 0) { String key = line.substring(0, equalSignPos).trim(); String value = line.substring(equalSignPos+1).trim(); if (key.toLowerCase().equals("default") && value.equals("1")) { foundDefaultSection = true; } } } } } finally { reader.close(); } if (!foundDefaultSection && linesInSection.size() == 0) { throw new FileNotFoundException("preferences file"); } String path = null; for (String line : linesInSection) { if (line.startsWith("Path=")) { path = line.substring("Path=".length()); } } if (path == null) { throw new FileNotFoundException("preferences file"); } else { String fullPath = configPath + path + File.separator + "prefs.js"; OutputController.getLogger().log("Found preferences file: " + fullPath); return new File(fullPath); } } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/browser/PaxHeaders.17941/BrowserAwareProxySelector.java0000644000000000000000000000013112654402377030172 xustar0030 mtime=1454507263.261432261 30 atime=1454507327.127580497 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/browser/BrowserAwareProxySelector.java0000644000175000002070000002361612654402377030726 0ustar00jvanekmock00000000000000/* BrowserAwareProxySelector.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.browser; import static net.sourceforge.jnlp.runtime.Translator.R; import java.io.File; import java.io.IOException; import java.net.MalformedURLException; import java.net.Proxy; import java.net.URI; import java.net.URL; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.JNLPProxySelector; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.runtime.PacEvaluator; import net.sourceforge.jnlp.runtime.PacEvaluatorFactory; import net.sourceforge.jnlp.util.logging.OutputController; /** * A ProxySelector which can read proxy settings from a browser's * configuration and use that. * * @see JNLPProxySelector */ public class BrowserAwareProxySelector extends JNLPProxySelector { /* firefox's constants */ public static final int BROWSER_PROXY_TYPE_NONE = 0; public static final int BROWSER_PROXY_TYPE_MANUAL = 1; public static final int BROWSER_PROXY_TYPE_PAC = 2; public static final int BROWSER_PROXY_TYPE_NONE2 = 3; /** use gconf, WPAD and then env (and possibly others)*/ public static final int BROWSER_PROXY_TYPE_AUTO = 4; /** use env variables */ public static final int BROWSER_PROXY_TYPE_SYSTEM = 5; private int browserProxyType = BROWSER_PROXY_TYPE_NONE; private URL browserAutoConfigUrl; /** Whether the http proxy should be used for http, https, ftp and socket protocols */ private Boolean browserUseSameProxy; private String browserHttpProxyHost; private int browserHttpProxyPort; private String browserHttpsProxyHost; private int browserHttpsProxyPort; private String browserFtpProxyHost; private int browserFtpProxyPort; private String browserSocks4ProxyHost; private int browserSocks4ProxyPort; private PacEvaluator browserProxyAutoConfig = null; /** * Create a new instance of this class, reading configuration fropm the browser */ public BrowserAwareProxySelector(DeploymentConfiguration config) { super(config); } public void initialize() { try { initFromBrowserConfig(); } catch (IOException e) { OutputController.getLogger().log(e); OutputController.getLogger().log(OutputController.Level.ERROR_ALL, R("RProxyFirefoxNotFound")); browserProxyType = PROXY_TYPE_NONE; } } /** * Initialize configuration by reading preferences from the browser (firefox) */ private void initFromBrowserConfig() throws IOException { Map prefs = parseBrowserPreferences(); String type = prefs.get("network.proxy.type"); if (type != null) { browserProxyType = Integer.valueOf(type); } else { browserProxyType = BROWSER_PROXY_TYPE_AUTO; } try { String url = prefs.get("network.proxy.autoconfig_url"); if (url != null) { browserAutoConfigUrl = new URL(url); } } catch (MalformedURLException e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); } if (browserProxyType == BROWSER_PROXY_TYPE_PAC) { if (browserAutoConfigUrl != null) { browserProxyAutoConfig = PacEvaluatorFactory.getPacEvaluator(browserAutoConfigUrl); } } browserUseSameProxy = Boolean.valueOf(prefs.get("network.proxy.share_proxy_settings")); browserHttpProxyHost = prefs.get("network.proxy.http"); browserHttpProxyPort = stringToPort(prefs.get("network.proxy.http_port")); browserHttpsProxyHost = prefs.get("network.proxy.ssl"); browserHttpsProxyPort = stringToPort(prefs.get("network.proxy.ssl_port")); browserFtpProxyHost = prefs.get("network.proxy.ftp"); browserFtpProxyPort = stringToPort(prefs.get("network.proxy.ftp_port")); browserSocks4ProxyHost = prefs.get("network.proxy.socks"); browserSocks4ProxyPort = stringToPort(prefs.get("network.proxy.socks_port")); } Map parseBrowserPreferences() throws IOException { File preferencesFile = FirefoxPreferencesFinder.find(); FirefoxPreferencesParser parser = new FirefoxPreferencesParser(preferencesFile); parser.parse(); return parser.getPreferences(); } /** * Returns port inside a string. Unlike {@link Integer#valueOf(String)}, * it will not throw exceptions. * * @param string the string containing the integer to parse * @return the port inside the string, or Integer.MIN_VALUE */ private int stringToPort(String string) { try { return Integer.valueOf(string); } catch (NumberFormatException nfe) { return Integer.MIN_VALUE; } } /** *

    * The main entry point for {@link BrowserAwareProxySelector}. Based on * the browser settings, determines proxy information for a given URI. *

    *

    * The appropriate proxy may be determined by reading static information * from the browser's preferences file, or it may be computed dynamically, * by, for example, running javascript code. *

    */ @Override protected List getFromBrowser(URI uri) { List proxies = new ArrayList(); String optionDescription = null; switch (browserProxyType) { case BROWSER_PROXY_TYPE_PAC: proxies.addAll(getFromBrowserPAC(uri)); break; case BROWSER_PROXY_TYPE_MANUAL: proxies.addAll(getFromBrowserConfiguration(uri)); break; case BROWSER_PROXY_TYPE_NONE: proxies.add(Proxy.NO_PROXY); break; case BROWSER_PROXY_TYPE_AUTO: // firefox will do a whole lot of stuff to automagically // figure out the right settings. gconf, WPAD, and ENV are used. // https://bugzilla.mozilla.org/show_bug.cgi?id=66057#c32 // TODO this is probably not easy/quick to do. using libproxy might be // the simpler workaround if (optionDescription == null) { optionDescription = "Automatic"; } case BROWSER_PROXY_TYPE_SYSTEM: // means use $http_proxy, $ftp_proxy etc. // TODO implement env vars if possible if (optionDescription == null) { optionDescription = "System"; } default: if (optionDescription == null) { optionDescription = "Unknown"; } OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG,R("RProxyFirefoxOptionNotImplemented", browserProxyType, optionDescription)); proxies.add(Proxy.NO_PROXY); } OutputController.getLogger().log("Browser selected proxies: " + proxies.toString()); return proxies; } /** * Get an appropriate proxy for a given URI using a PAC specified in the * browser. */ private List getFromBrowserPAC(URI uri) { if (browserAutoConfigUrl == null || uri.getScheme().equals("socket")) { return Arrays.asList(new Proxy[] { Proxy.NO_PROXY }); } List proxies = new ArrayList(); try { String proxiesString = browserProxyAutoConfig.getProxies(uri.toURL()); proxies.addAll(getProxiesFromPacResult(proxiesString)); } catch (MalformedURLException e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); proxies.add(Proxy.NO_PROXY); } return proxies; } /** * Get an appropriate proxy for the given URI using static information from * the browser's preferences file. */ private List getFromBrowserConfiguration(URI uri) { return getFromArguments(uri, browserUseSameProxy, true, browserHttpsProxyHost, browserHttpsProxyPort, browserHttpProxyHost, browserHttpProxyPort, browserFtpProxyHost, browserFtpProxyPort, browserSocks4ProxyHost, browserSocks4ProxyPort); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/about0000644000000000000000000000013112654402377021533 xustar0030 mtime=1454507263.260432274 30 atime=1454507658.779157357 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/about/0000755000175000002070000000000012654402377022334 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/netx/net/sourceforge/jnlp/about/PaxHeaders.17941/InternalHTMLPanel.java0000644000000000000000000000013112654402377025674 xustar0030 mtime=1454507263.260432274 30 atime=1454507327.127580497 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/about/InternalHTMLPanel.java0000644000175000002070000000506712654402377026430 0ustar00jvanekmock00000000000000/* HTMLPanel.java Copyright (C) 2008 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.about; import java.io.IOException; import java.net.URL; import javax.swing.event.HyperlinkEvent; import javax.swing.event.HyperlinkListener; public class InternalHTMLPanel extends HTMLPanel { public InternalHTMLPanel(URL url) { super(url); HyperlinkListener[] hl = pane.getHyperlinkListeners(); for (HyperlinkListener hyperlinkListener : hl) { pane.removeHyperlinkListener(hyperlinkListener); } pane.addHyperlinkListener(new LocalUrlHyperlinkListener()); } private class LocalUrlHyperlinkListener implements HyperlinkListener { @Override public void hyperlinkUpdate(HyperlinkEvent event) { if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { try { pane.setPage(event.getURL()); } catch (IOException ex) { } } } } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/about/PaxHeaders.17941/HTMLPanel.java0000644000000000000000000000013112654402377024177 xustar0030 mtime=1454507263.260432274 30 atime=1454507327.127580497 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/about/HTMLPanel.java0000644000175000002070000000617512654402377024734 0ustar00jvanekmock00000000000000/* Copyright (C) 2008 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.about; import java.awt.BorderLayout; import java.awt.Desktop; import java.io.IOException; import java.net.URISyntaxException; import java.net.URL; import javax.swing.JEditorPane; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.event.HyperlinkEvent; import javax.swing.event.HyperlinkListener; import net.sourceforge.jnlp.util.logging.OutputController; public class HTMLPanel extends JPanel { protected JEditorPane pane = new JEditorPane(); public HTMLPanel(URL url) { super(new BorderLayout()); try { pane = new JEditorPane(url); } catch (IOException ex) { //no need to have invalid url fatal OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, ex); } pane.setContentType("text/html"); pane.setEditable(false); pane.addHyperlinkListener(new UrlHyperlinkListener()); JScrollPane scroller = new JScrollPane(pane); this.add(scroller, BorderLayout.CENTER); } private class UrlHyperlinkListener implements HyperlinkListener { @Override public void hyperlinkUpdate(HyperlinkEvent event) { if (Desktop.isDesktopSupported() && event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { try { Desktop.getDesktop().browse(event.getURL().toURI()); } catch (URISyntaxException ex) { } catch (IOException ex) { } } } } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/about/PaxHeaders.17941/AboutDialog.java0000644000000000000000000000013112654402377024645 xustar0030 mtime=1454507263.260432274 30 atime=1454507327.127580497 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/about/AboutDialog.java0000644000175000002070000002330212654402377025371 0ustar00jvanekmock00000000000000/* Main.java Copyright (C) 2008 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.about; import static net.sourceforge.jnlp.runtime.Translator.R; import java.awt.Dimension; import java.awt.Frame; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.File; import java.io.IOException; import java.net.URL; import java.util.Locale; import javax.swing.JButton; import javax.swing.JDialog; import javax.swing.JPanel; import javax.swing.SwingUtilities; import javax.swing.border.EmptyBorder; import net.sourceforge.jnlp.util.ScreenFinder; import net.sourceforge.jnlp.util.docprovider.TextsProvider; import net.sourceforge.jnlp.util.docprovider.formatters.formatters.HtmlFormatter; import net.sourceforge.jnlp.util.logging.OutputController; public final class AboutDialog extends JPanel implements Runnable, ActionListener { private static final String about_url_stub = "/net/sourceforge/jnlp/resources/about"; private static final String authors_url = "/net/sourceforge/jnlp/resources/AUTHORS.html"; private static final String changelog_url = "/net/sourceforge/jnlp/resources/ChangeLog.html"; private static final String copying_url = "/net/sourceforge/jnlp/resources/COPYING.html"; private static final String news_url = "/net/sourceforge/jnlp/resources/NEWS.html"; private final String app; private final JDialog frame; private JPanel contentPane; //singletons to not laod/generate them all around private static HTMLPanel aboutPanel, authorsPanel, newsPanel, changelogPanel, copyingPanel, helpPanel; private final JButton aboutButton, authorsButton, newsButton, changelogButton, copyingButton, helpButton; private final URL res_authors = getClass().getResource(authors_url); private final URL res_news = getClass().getResource(news_url); private final URL res_changelog = getClass().getResource(changelog_url); private final URL res_copying = getClass().getResource(copying_url); public static enum ShowPage{ ABOUT /*default*/, AUTHORS, NEWS, CHANGELOG, LICENSE, HELP } private AboutDialog(boolean modal, String app, ShowPage showPage) { super(new GridBagLayout()); this.app = app; frame = new JDialog((Frame) null, R("AboutDialogueTabAbout") + " IcedTea-Web", modal); frame.setContentPane(this); frame.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); aboutButton = new JButton( R("AboutDialogueTabAbout")); aboutButton.addActionListener(this); authorsButton = new JButton(R("AboutDialogueTabAuthors")); authorsButton.addActionListener(this); newsButton = new JButton( R("AboutDialogueTabNews")); newsButton.addActionListener(this); changelogButton = new JButton(R("AboutDialogueTabChangelog")); changelogButton.addActionListener(this); copyingButton = new JButton(R("AboutDialogueTabGPLv2")); copyingButton.addActionListener(this); helpButton = new JButton(R("APPEXTSECguiPanelHelpButton")); helpButton.addActionListener(this); switch (showPage) { case ABOUT: actionPerformed(new ActionEvent(aboutButton, 0, "")); break; case AUTHORS: actionPerformed(new ActionEvent(authorsButton, 0, "")); break; case CHANGELOG: actionPerformed(new ActionEvent(changelogButton, 0, "")); break; case HELP: actionPerformed(new ActionEvent(helpButton, 0, "")); break; case LICENSE: actionPerformed(new ActionEvent(copyingButton, 0, "")); break; case NEWS: actionPerformed(new ActionEvent(newsButton, 0, "")); break; default: actionPerformed(new ActionEvent(aboutButton, 0, "")); } } @Override public void actionPerformed(ActionEvent e) { Object action = e.getSource(); if (action.equals(aboutButton)) { if (aboutPanel == null) { String lang = Locale.getDefault().getLanguage(); URL about_lang; try { about_lang = getClass().getResource(about_url_stub + "_" + lang + ".html"); about_lang.openStream().close(); } catch (Exception ex) { OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, ex); //probably unknown locale, switch to english about_lang = getClass().getResource(about_url_stub + "_en.html"); } aboutPanel = new HTMLPanel(about_lang); } contentPane = aboutPanel; } else if (action.equals(authorsButton)) { if (authorsPanel == null) { authorsPanel = new HTMLPanel(res_authors); } contentPane = authorsPanel; } else if (action.equals(newsButton)) { if (newsPanel == null) { newsPanel = new HTMLPanel(res_news); } contentPane = newsPanel; } else if (action.equals(changelogButton)) { if (changelogPanel == null) { changelogPanel = new HTMLPanel(res_changelog); } contentPane = changelogPanel; } else if (action.equals(copyingButton)) { if (copyingPanel == null) { copyingPanel = new HTMLPanel(res_copying); } contentPane = copyingPanel; } else if (action.equals(helpButton)) { if (helpPanel == null) { //copy logo and generate resources to tmp dir try { File f = File.createTempFile("icedtea-web", "help"); f.delete(); f.mkdir(); f.deleteOnExit(); TextsProvider.generateRuntimeHtmlTexts(f); //detect running application File target = new File(f, TextsProvider.ITW + "." + HtmlFormatter.SUFFIX); if (app != null) { target = new File(f, app + "." + HtmlFormatter.SUFFIX); } helpPanel = new InternalHTMLPanel(target.toURI().toURL()); } catch (IOException ex) { OutputController.getLogger().log(ex); } } contentPane = helpPanel; } layoutWindow(); } private void layoutWindow() { this.removeAll(); GridBagConstraints gbc = new GridBagConstraints(); gbc.fill = GridBagConstraints.BOTH; gbc.gridy = 0; gbc.gridx = 0; gbc.gridwidth = 6; gbc.weightx = 1.0; gbc.weighty = 1.0; this.add(contentPane, gbc); gbc.gridy = 1; gbc.gridx = 0; gbc.gridwidth = 1; gbc.ipady = 16; this.add(aboutButton, gbc); gbc.gridx = 1; this.add(authorsButton, gbc); gbc.gridx = 2; this.add(newsButton, gbc); gbc.gridx = 3; this.add(changelogButton, gbc); gbc.gridx = 4; this.add(copyingButton, gbc); gbc.gridx = 5; this.add(helpButton, gbc); Dimension contentSize = new Dimension(640, 480); contentPane.setMinimumSize(contentSize); contentPane.setPreferredSize(contentSize); contentPane.setBorder(new EmptyBorder(0, 0, 8, 0)); this.setBorder(new EmptyBorder(8, 8, 8, 8)); frame.pack(); } @Override public void run() { layoutWindow(); ScreenFinder.centerWindowsToCurrentScreen(frame); frame.setVisible(true); } public static void display(String app) { display(false, app); } public static void display(boolean modal, String app) { display(modal, app, ShowPage.ABOUT); } public static void display(boolean modal, String app, ShowPage showPage) { SwingUtilities.invokeLater(new AboutDialog(modal, app, showPage)); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/XmlParser.java0000644000000000000000000000013112654402377023256 xustar0030 mtime=1454507263.259432288 30 atime=1454507327.127580497 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/XmlParser.java0000644000175000002070000001533612654402377024012 0ustar00jvanekmock00000000000000/* Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp; import static net.sourceforge.jnlp.runtime.Translator.R; import java.io.BufferedInputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PipedInputStream; import java.io.PipedOutputStream; import net.sourceforge.jnlp.util.logging.OutputController; import net.sourceforge.nanoxml.XMLElement; //import javax.xml.parsers.*; // commented to use right Node //import org.w3c.dom.*; // class for using Tiny XML | NanoXML //import org.xml.sax.*; //import gd.xml.tiny.*; /** * A gateway to the actual implementation of the parsers. * * Used by net.sourceforge.jnlp.Parser */ class XMLParser { /** * Parses input from an InputStream and returns a Node representing the * root of the parse tree. * * @param input the {@link InputStream} containing the XML * @return a {@link Node} representing the root of the parsed XML * @throws ParseException if parsing fails */ public Node getRootNode(InputStream input) throws ParseException { try { /* SAX DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setValidating(false); factory.setNamespaceAware(true); DocumentBuilder builder = factory.newDocumentBuilder(); builder.setErrorHandler(errorHandler); Document doc = builder.parse(input); return doc.getDocumentElement(); */ /* TINY Node document = new Node(TinyParser.parseXML(input)); Node jnlpNode = getChildNode(document, "jnlp"); // skip comments */ //A BufferedInputStream is used to allow marking and reseting //of a stream. BufferedInputStream bs = new BufferedInputStream(input); /* NANO */ final XMLElement xml = new XMLElement(); final PipedInputStream pin = new PipedInputStream(); final PipedOutputStream pout = new PipedOutputStream(pin); final InputStreamReader isr = new InputStreamReader(bs, getEncoding(bs)); // Clean the jnlp xml file of all comments before passing // it to the parser. new Thread( new Runnable() { @Override public void run() { (new XMLElement()).sanitizeInput(isr, pout); try { pout.close(); } catch (IOException ioe) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, ioe); } } }).start(); xml.parseFromReader(new InputStreamReader(pin)); Node jnlpNode = new Node(xml); return jnlpNode; } catch (Exception ex) { throw new ParseException(R("PBadXML"), ex); } } /** * Returns the name of the encoding used in this InputStream. * * @param input the InputStream * @return a String representation of encoding */ private static String getEncoding(InputStream input) throws IOException { //Fixme: This only recognizes UTF-8, UTF-16, and //UTF-32, which is enough to parse the prolog portion of xml to //find out the exact encoding (if it exists). The reason being //there could be other encodings, such as ISO 8859 which is 8-bits //but it supports latin characters. //So what needs to be done is to parse the prolog and retrieve //the exact encoding from it. int[] s = new int[4]; String encoding = "UTF-8"; //Determine what the first four bytes are and store //them into an int array. input.mark(4); for (int i = 0; i < 4; i++) { s[i] = input.read(); } input.reset(); //Set the encoding base on what the first four bytes of the //inputstream turn out to be (following the information from //www.w3.org/TR/REC-xml/#sec-guessing). if (s[0] == 255) { if (s[1] == 254) { if (s[2] != 0 || s[3] != 0) { encoding = "UnicodeLittle"; } else { encoding = "X-UTF-32LE-BOM"; } } } else if (s[0] == 254 && s[1] == 255 && (s[2] != 0 || s[3] != 0)) { encoding = "UTF-16"; } else if (s[0] == 0 && s[1] == 0 && s[2] == 254 && s[3] == 255) { encoding = "X-UTF-32BE-BOM"; } else if (s[0] == 0 && s[1] == 0 && s[2] == 0 && s[3] == 60) { encoding = "UTF-32BE"; } else if (s[0] == 60 && s[1] == 0 && s[2] == 0 && s[3] == 0) { encoding = "UTF-32LE"; } else if (s[0] == 0 && s[1] == 60 && s[2] == 0 && s[3] == 63) { encoding = "UTF-16BE"; } else if (s[0] == 60 && s[1] == 0 && s[2] == 63 && s[3] == 0) { encoding = "UTF-16LE"; } return encoding; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/Version.java0000644000000000000000000000013112654402377022766 xustar0030 mtime=1454507263.259432288 30 atime=1454507327.127580497 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/Version.java0000644000175000002070000003034412654402377023516 0ustar00jvanekmock00000000000000// Copyright (C) 2001-2003 Jon A. Maxwell (JAM) // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp; import java.util.*; import javax.swing.JOptionPane; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.runtime.Translator; import net.sourceforge.jnlp.util.logging.OutputController; /** *

    * A JNLP Version string in the form "1.2-3_abc" followed by an * optional + (includes all later versions) or * (matches any * suffixes on versions). More than one version can be included * in a string by separating them with spaces. *

    *

    * Version strings are divided by "._-" charecters into parts. * These parts are compared numerically if they can be parsed as * integers or lexographically as strings otherwise. If the * number of parts is different between two version strings then * the smaller one is padded with zero or the empty string. Note * that the padding in this version means that 1.2+ matches * 1.4.0-beta1, but may not in future versions. *

    * * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.5 $ */ public class Version { /** * This is special case of version, used only for checking jre version. If * jre do not match, in strict not-headless mode the dialog with * confirrmation appears If jre do not match, in strict headless mode the * exception is thrown If jre match, or non-strict mode is run, then only * message is printed * */ public static class JreVersion extends Version { public static boolean warned = false; public JreVersion(String v, boolean strict) { this(v, strict, JNLPRuntime.isHeadless()); } /* * for testing purposes */ JreVersion(String v, boolean strict, boolean headless) { super(v); boolean match = matchesJreVersion(); if (!match) { String s = Translator.R("JREversionDontMatch", getJreVersion(), v); String e = "Strict run is deffined, and your JRE - " + getJreVersion() + " - dont match requested JRE(s) - " + v; if (strict) { if (!headless) { if (!warned) { int r = JOptionPane.showConfirmDialog(null, s + "\n" + Translator.R("JREContinueDialogSentence2"), Translator.R("JREContinueDialogSentenceTitle"), JOptionPane.YES_NO_OPTION); if (r == JOptionPane.NO_OPTION) { throw new RuntimeException(e); } warned = true; } } else { throw new RuntimeException(e); } } else { OutputController.getLogger().log(OutputController.Level.WARNING_ALL, s); } } else { OutputController.getLogger().log("good - your JRE - " + getJreVersion() + " - match requested JRE - " + v); } } public boolean matchesJreVersion() { return matches(getJreVersion()); } private String getJreVersion() { return System.getProperty("java.version"); } } // to do: web start does not match versions with a "-" like // "1.4-beta1" using the + modifier, change to mimic that // behavior. // also refactor into Version and VersionID classes so that // individual version ids can be easily modified to add/remove // "*" and "+" modifiers. /** separates parts of a version string */ private static final String seperators = ".-_"; /** magic key for whether a version part was created due to normalization */ private static final String emptyString = new String(""); // not intern'ed /** contains all the versions matched */ private final String versionString; /** * Create a Version object based on a version string (ie, * "1.2.3+ 4.56*"). * @param versions string describing version */ public Version(String versions) { versionString = versions; } /** * @return true if the version represents a version-id (a * single version number such as 1.2) and false otherwise. */ public boolean isVersionId() { return -1 == versionString.indexOf(" "); } /** * @return true if all of this version's version-ids match one * or more of the specifed version's version-id. * * @param version a version string */ public boolean matches(String version) { return matches(new Version(version)); } /** * @return true if all of this version's version-ids match one * or more of the specifed version's version-id. * * @param version a Version object */ public boolean matches(Version version) { List versionStrings = version.getVersionStrings(); for (String versionString1 : versionStrings) { if (!this.matchesSingle(versionString1)) { return false; } } return true; } /** * @return true if any of this version's version-ids match one * or more of the specifed version's version-id. * * @param version a version string */ public boolean matchesAny(String version) { return matches(new Version(version)); } /** * @return true if any of this version's version-ids match one * or more of the specifed version's version-id. * * @param version a Version object */ public boolean matchesAny(Version version) { List versionStrings = version.getVersionStrings(); for (String versionString1 : versionStrings) { if (this.matchesSingle(versionString1)) { return true; } } return false; } /** * Returns whether a single version string is supported by this * Version. * * @param version a non-compound version of the form "1.2.3[+*]" */ private boolean matchesSingle(String version) { List versionStrings = this.getVersionStrings(); for (String versionString1 : versionStrings) { if (matches(version, versionString1)) { return true; } } return false; } /** * Returns whether a single version string is supported by * another single version string. * * @param subversion a non-compound version without "+" or "*" * @param version a non-compound version optionally with "+" or "*" */ private boolean matches(String subversion, String version) { List subparts = getParts(subversion); List parts = getParts(version); int maxLength = Math.max(subversion.length(), version.length()); if (version.endsWith("*")) // star means rest of parts irrelevant: truncate them maxLength = parts.size(); List> versions = new ArrayList<>(); versions.add(subparts); versions.add(parts); normalize(versions, maxLength); if (equal(subparts, parts)) return true; return version.endsWith("+") && greater(subparts, parts); } /** * @return whether the parts of one version are equal to the * parts of another version. * * @param parts1 normalized version parts * @param parts2 normalized version parts */ protected boolean equal(List parts1, List parts2) { for (int i = 0; i < parts1.size(); i++) { if (0 != compare(parts1.get(i), parts2.get(i))) return false; } return true; } /** * @return whether the parts of one version are greater than * the parts of another version. * * @param parts1 normalized version parts * @param parts2 normalized version parts */ protected boolean greater(List parts1, List parts2) { //if (true) return false; for (int i = 0; i < parts1.size(); i++) { // if part1 > part2 then it's a later version, so return true if (compare(parts1.get(i), parts2.get(i)) > 0) return true; // if part1 < part2 then it's a ealier version, so return false if (compare(parts1.get(i), parts2.get(i)) < 0) return false; // if equal go to next part } // all parts were equal return false; // not greater than } /** * Compares two parts of a version string, by value if both can * be interpreted as integers or lexically otherwise. If a part * is the result of normalization then it can be the Integer * zero or an empty string. * * Returns a value equivalent to part1.compareTo(part2); * * @param part1 a part of a version string * @param part2 a part of a version string * @return comparison of the two parts */ protected int compare(String part1, String part2) { Integer number1 = 0; Integer number2 = 0; // compare as integers // for normalization key, compare exact object, not using .equals try { if (!(part1 == emptyString)) // compare to magic normalization key number1 = Integer.valueOf(part1); if (!(part2 == emptyString)) // compare to magic normalization key number2 = Integer.valueOf(part2); return number1.compareTo(number2); } catch (NumberFormatException ex) { // means to compare as strings } if (part1 == emptyString) // compare to magic normalization key part1 = ""; if (part2 == emptyString) // compare to magic normalization key part2 = ""; return part1.compareTo(part2); } /** * Normalize version strings so that they contain the same * number of constituent parts. * * @param versions list array of parts of a version string * @param maxLength truncate lists to this maximum length */ protected void normalize(List> versions, int maxLength) { int length = 0; for (List vers : versions) length = Math.max(length, vers.size()); if (length > maxLength) length = maxLength; for (List vers : versions) { // remove excess elements while (vers.size() > length) vers.remove(vers.size() - 1); // add in empty pad elements while (vers.size() < length) vers.add(emptyString); } } /** * @return the individual version strings that make up a Version. */ protected List getVersionStrings() { ArrayList strings = new ArrayList<>(); StringTokenizer st = new StringTokenizer(versionString, " "); while (st.hasMoreTokens()) strings.add(st.nextToken()); return strings; } /** * @return the constituent parts of a version string. * * @param oneVersion a single version id string (not compound) */ protected List getParts(String oneVersion) { ArrayList strings = new ArrayList<>(); StringTokenizer st = new StringTokenizer(oneVersion, seperators + "+*"); while (st.hasMoreTokens()) { strings.add(st.nextToken()); } return strings; } @Override public String toString() { return versionString; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/UpdateDesc.java0000644000000000000000000000013112654402377023362 xustar0030 mtime=1454507263.259432288 30 atime=1454507327.127580497 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/UpdateDesc.java0000644000175000002070000000650512654402377024114 0ustar00jvanekmock00000000000000/* UpdateDesc.java Copyright (C) 2010 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp; /** * Represents an 'update' element in a JNLP file. This element describes when to * check for updates and what actions to take if updates are available * * @see Check * @see Policy */ public class UpdateDesc { /** * Describes when/how long to check for updates. */ public enum Check { /** Always check for updates before launching the application */ ALWAYS, /** * Default. Check for updates until a certain timeout. If the update * check is not completed by timeout, launch the cached application and * continue updating in the background */ TIMEOUT, /** Check for application updates in the background */ BACKGROUND } /** * Describes what to do when the Runtime knows there is an applicatFion * update before the application is launched. */ public enum Policy { /** * Default. Always download updates without any user prompt and then launch the * application */ ALWAYS, /** * Prompt the user asking whether the user wants to download and run the * updated application or run the version in the cache */ PROMPT_UPDATE, /** * Prompts the user asking to download and run the latest version of the * application or abort running */ PROMPT_RUN, } private Check check; private Policy policy; public UpdateDesc(Check check, Policy policy) { this.check = check; this.policy = policy; } public Check getCheck() { return this.check; } public Policy getPolicy() { return this.policy; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/StreamEater.java0000644000000000000000000000013012654402377023554 xustar0030 mtime=1454507263.258432301 29 atime=1454507327.12658051 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/StreamEater.java0000644000175000002070000000373612654402377024312 0ustar00jvanekmock00000000000000// Copyright (C) 2001-2003 Jon A. Maxwell (JAM) // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp; import java.io.BufferedInputStream; import java.io.IOException; import java.io.InputStream; import net.sourceforge.jnlp.util.logging.OutputController; /** * This class reads the output from a launched process and writes it to stdout. */ public class StreamEater extends Thread { private InputStream stream; public StreamEater(InputStream stream) { this.stream = new BufferedInputStream(stream); } public void run() { try { StringBuilder s = new StringBuilder(); while (true) { int c = stream.read(); if (c == -1){ OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, s.toString()); break; } else { char ch = (char) c; if (ch == '\n'){ OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, s.toString()); s = new StringBuilder(); }else { s.append((char) c); } } } } catch (IOException ex) { } } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/ShortcutDesc.java0000644000000000000000000000013012654402377023752 xustar0030 mtime=1454507263.258432301 29 atime=1454507327.12658051 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/ShortcutDesc.java0000644000175000002070000001071312654402377024501 0ustar00jvanekmock00000000000000// Copyright (C) 2009 Red Hat, Inc. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.Translator; public final class ShortcutDesc { /** Never create a shortcut */ public static final String CREATE_NEVER = "NEVER"; /** Always create a shortcut */ public static final String CREATE_ALWAYS = "ALWAYS"; /** Always ask user whether to create a shortcut */ public static final String CREATE_ASK_USER = "ASK_USER"; /** Ask user whether to create a shortcut but only if jnlp file asks for it */ public static final String CREATE_ASK_USER_IF_HINTED = "ASK_IF_HINTED"; /** Create a desktop shortcut without prompting if the jnlp asks for it */ public static final String CREATE_ALWAYS_IF_HINTED = "ALWAYS_IF_HINTED"; /** * the application wants to be placed on the desktop * based of existence/not existence of desktop tag */ private final boolean onDesktop; /** * the application needs to be launched online * happily ignored. itw is trying to run any app even if it is offline (some apps are enforcing it without sense) */ private final boolean requiresOnline; /** * the menu descriptor * based on existence of menu tag * if null, then no tag was presented * if there is some value, then menu tag was presented * depending on value inside MenuDesc, the attribute submenu was/was not presented */ private MenuDesc menu = null; /** * Create a new Shortcut descriptor * @param requiresOnline whether the shortcut requires connectivity * @param onDesktop whether the shortcut wants to be placed on the desktop */ public ShortcutDesc(boolean requiresOnline, boolean onDesktop) { this.requiresOnline = requiresOnline; this.onDesktop = onDesktop; } /** * @return whether the shortcut requires being online */ public boolean isOnline() { throw new RuntimeException("icedtea-web is not saving online-enforcing attribute. See Xoffline impelmentations if needed."); } /** * For testing purposes. Verify if it have been parsed out correctly. * @return whether the shortcut requires being online. */ boolean isOnlineValue() { return requiresOnline; } /** * @return whether the shortcut should be placed on the desktop */ public boolean onDesktop() { return onDesktop; } /** * @return whether the shortcut should be placed to the menus */ public boolean toMenu() { return getMenu() != null; } /** * Add a shortcut to the 'start menu' * (whatever that means on gnome/kde/other ...) * @param menu if/what menu this shortcut should be added to */ public void setMenu(MenuDesc menu) { this.menu = menu; } /** * @return the menu this shortcut should be added to */ public MenuDesc getMenu() { return menu; } public static String deploymentJavawsShortcutToString(String i) { switch (i) { case ShortcutDesc.CREATE_NEVER: return Translator.R("DSPNeverCreate"); case ShortcutDesc.CREATE_ALWAYS: return Translator.R("DSPAlwaysAllow"); case ShortcutDesc.CREATE_ASK_USER: return Translator.R("DSPAskUser"); case ShortcutDesc.CREATE_ASK_USER_IF_HINTED: return Translator.R("DSPAskIfHinted"); case ShortcutDesc.CREATE_ALWAYS_IF_HINTED: return Translator.R("DSPAlwaysIfHinted"); } throw new RuntimeException("Unknown value of " + DeploymentConfiguration.KEY_CREATE_DESKTOP_SHORTCUT + " for " + i); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/SecurityDesc.java0000644000000000000000000000013012654402377023746 xustar0030 mtime=1454507263.258432301 29 atime=1454507327.12658051 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/SecurityDesc.java0000644000175000002070000005215412654402377024502 0ustar00jvanekmock00000000000000// Copyright (C) 2001-2003 Jon A. Maxwell (JAM) // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp; import java.awt.AWTPermission; import java.io.FilePermission; import java.lang.reflect.Constructor; import java.net.SocketPermission; import java.net.URI; import java.net.URISyntaxException; import java.net.URL; import java.security.AllPermission; import java.security.CodeSource; import java.security.Permission; import java.security.PermissionCollection; import java.security.Permissions; import java.security.Policy; import java.security.URIParameter; import java.util.*; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.util.UrlUtils; import net.sourceforge.jnlp.util.logging.OutputController; /** * The security element. * * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.7 $ */ public class SecurityDesc { /** * Represents the security level requested by an applet/application, as specified in its JNLP or HTML. */ public enum RequestedPermissionLevel { NONE(null, null), DEFAULT(null, "default"), SANDBOX(null, "sandbox"), J2EE("j2ee-application-client-permissions", null), ALL("all-permissions", "all-permissions"); public static final String PERMISSIONS_NAME = "permissions"; private final String jnlpString, htmlString; private RequestedPermissionLevel(final String jnlpString, final String htmlString) { this.jnlpString = jnlpString; this.htmlString = htmlString; } /** * This permission level, as it would appear requested in a JNLP file. null if this level * is NONE (unspecified) or cannot be requested in a JNLP file. * @return the String level */ public String toJnlpString() { return this.jnlpString; } /** * This permission level, as it would appear requested in an HTML file. null if this level * is NONE (unspecified) or cannot be requested in an HTML file. * @return the String level */ public String toHtmlString() { return this.htmlString; } /** * The JNLP permission level corresponding to the given String. If null is given, null comes * back. If there is no permission level that can be granted in JNLP matching the given String, * null is also returned. * @param jnlpString the JNLP permission String * @return the matching RequestedPermissionLevel */ public RequestedPermissionLevel fromJnlpString(final String jnlpString) { for (final RequestedPermissionLevel level : RequestedPermissionLevel.values()) { if (level.jnlpString != null && level.jnlpString.equals(jnlpString)) { return level; } } return null; } /** * The HTML permission level corresponding to the given String. If null is given, null comes * back. If there is no permission level that can be granted in HTML matching the given String, * null is also returned. * @param htmlString the JNLP permission String * @return the matching RequestedPermissionLevel */ public RequestedPermissionLevel fromHtmlString(final String htmlString) { for (final RequestedPermissionLevel level : RequestedPermissionLevel.values()) { if (level.htmlString != null && level.htmlString.equals(htmlString)) { return level; } } return null; } } /* * We do not verify security here, the classloader deals with security */ /** All permissions. */ public static final Object ALL_PERMISSIONS = "All"; /** Applet permissions. */ public static final Object SANDBOX_PERMISSIONS = "Sandbox"; /** J2EE permissions. */ public static final Object J2EE_PERMISSIONS = "J2SE"; /** requested permissions type according to HTML or JNLP */ private final RequestedPermissionLevel requestedPermissionLevel; /** permissions type */ private Object type; /** the download host */ final private URL downloadHost; /** whether sandbox applications should get the show window without banner permission */ private final boolean grantAwtPermissions; /** the JNLP file */ private final JNLPFile file; private final Policy customTrustedPolicy; /** * URLPermission is new in Java 8, so we use reflection to check for it to keep compatibility * with Java 6/7. If we can't find the class or fail to construct it then we continue as usual * without. * * These are saved as fields so that the reflective lookup only needs to be performed once * when the SecurityDesc is constructed, rather than every time a call is made to * {@link SecurityDesc#getSandBoxPermissions()}, which is called frequently. */ private static Class urlPermissionClass = null; private static Constructor urlPermissionConstructor = null; static { try { urlPermissionClass = (Class) Class.forName("java.net.URLPermission"); urlPermissionConstructor = urlPermissionClass.getDeclaredConstructor(new Class[] { String.class }); } catch (final ReflectiveOperationException | SecurityException e) { OutputController.getLogger().log(OutputController.Level.WARNING_DEBUG, "Exception while reflectively finding URLPermission - host is probably not running Java 8+"); OutputController.getLogger().log(OutputController.Level.WARNING_DEBUG, e); urlPermissionClass = null; urlPermissionConstructor = null; } } // We go by the rules here: // http://java.sun.com/docs/books/tutorial/deployment/doingMoreWithRIA/properties.html // Since this is security sensitive, take a conservative approach: // Allow only what is specifically allowed, and deny everything else /** basic permissions for restricted mode */ private static Permission j2eePermissions[] = { new AWTPermission("accessClipboard"), // disabled because we can't at this time prevent an // application from accessing other applications' event // queues, or even prevent access to security dialog queues. // // new AWTPermission("accessEventQueue"), new RuntimePermission("exitVM"), new RuntimePermission("loadLibrary"), new RuntimePermission("queuePrintJob"), new SocketPermission("*", "connect"), new SocketPermission("localhost:1024-", "accept, listen"), new FilePermission("*", "read, write"), new PropertyPermission("*", "read"), }; /** basic permissions for restricted mode */ private static Permission sandboxPermissions[] = { new SocketPermission("localhost:1024-", "listen"), // new SocketPermission("", "connect, accept"), // added by code new PropertyPermission("java.util.Arrays.useLegacyMergeSort", "read,write"), new PropertyPermission("java.version", "read"), new PropertyPermission("java.vendor", "read"), new PropertyPermission("java.vendor.url", "read"), new PropertyPermission("java.class.version", "read"), new PropertyPermission("os.name", "read"), new PropertyPermission("os.version", "read"), new PropertyPermission("os.arch", "read"), new PropertyPermission("file.separator", "read"), new PropertyPermission("path.separator", "read"), new PropertyPermission("line.separator", "read"), new PropertyPermission("java.specification.version", "read"), new PropertyPermission("java.specification.vendor", "read"), new PropertyPermission("java.specification.name", "read"), new PropertyPermission("java.vm.specification.vendor", "read"), new PropertyPermission("java.vm.specification.name", "read"), new PropertyPermission("java.vm.version", "read"), new PropertyPermission("java.vm.vendor", "read"), new PropertyPermission("java.vm.name", "read"), new PropertyPermission("javawebstart.version", "read"), new PropertyPermission("javaplugin.*", "read"), new PropertyPermission("jnlp.*", "read,write"), new PropertyPermission("javaws.*", "read,write"), new PropertyPermission("browser", "read"), new PropertyPermission("browser.*", "read"), new RuntimePermission("exitVM"), new RuntimePermission("stopThread"), // disabled because we can't at this time prevent an // application from accessing other applications' event // queues, or even prevent access to security dialog queues. // // new AWTPermission("accessEventQueue"), }; /** basic permissions for restricted mode */ private static Permission jnlpRIAPermissions[] = { new PropertyPermission("awt.useSystemAAFontSettings", "read,write"), new PropertyPermission("http.agent", "read,write"), new PropertyPermission("http.keepAlive", "read,write"), new PropertyPermission("java.awt.syncLWRequests", "read,write"), new PropertyPermission("java.awt.Window.locationByPlatform", "read,write"), new PropertyPermission("javaws.cfg.jauthenticator", "read,write"), new PropertyPermission("javax.swing.defaultlf", "read,write"), new PropertyPermission("sun.awt.noerasebackground", "read,write"), new PropertyPermission("sun.awt.erasebackgroundonresize", "read,write"), new PropertyPermission("sun.java2d.d3d", "read,write"), new PropertyPermission("sun.java2d.dpiaware", "read,write"), new PropertyPermission("sun.java2d.noddraw", "read,write"), new PropertyPermission("sun.java2d.opengl", "read,write"), new PropertyPermission("swing.boldMetal", "read,write"), new PropertyPermission("swing.metalTheme", "read,write"), new PropertyPermission("swing.noxp", "read,write"), new PropertyPermission("swing.useSystemFontSettings", "read,write"), }; /** * Create a security descriptor. * * @param file the JNLP file * @param requestedPermissionLevel the permission level specified in the JNLP * @param type the type of security * @param downloadHost the download host (can always connect to) */ public SecurityDesc(JNLPFile file, RequestedPermissionLevel requestedPermissionLevel, Object type, URL downloadHost) { if (file == null) { throw new NullJnlpFileException(); } this.file = file; this.requestedPermissionLevel = requestedPermissionLevel; this.type = type; this.downloadHost = downloadHost; String key = DeploymentConfiguration.KEY_SECURITY_ALLOW_HIDE_WINDOW_WARNING; grantAwtPermissions = Boolean.valueOf(JNLPRuntime.getConfiguration().getProperty(key)); customTrustedPolicy = getCustomTrustedPolicy(); } /** * Create a security descriptor. * * @param file the JNLP file * @param type the type of security * @param downloadHost the download host (can always connect to) */ public SecurityDesc(JNLPFile file, Object type, URL downloadHost) { this(file, RequestedPermissionLevel.NONE, type, downloadHost); } /** * Returns a Policy object that represents a custom policy to use instead * of granting {@link AllPermission} to a {@link CodeSource} * * @return a {@link Policy} object to delegate to. May be null, which * indicates that no policy exists and AllPermissions should be granted * instead. */ private Policy getCustomTrustedPolicy() { String key = DeploymentConfiguration.KEY_SECURITY_TRUSTED_POLICY; String policyLocation = JNLPRuntime.getConfiguration().getProperty(key); Policy policy = null; if (policyLocation != null) { try { URI policyUri = new URI("file://" + policyLocation); policy = Policy.getInstance("JavaPolicy", new URIParameter(policyUri)); } catch (Exception e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); } } // return the appropriate policy, or null return policy; } /** * @return the permissions type, one of: ALL_PERMISSIONS, * SANDBOX_PERMISSIONS, J2EE_PERMISSIONS. */ public Object getSecurityType() { return type; } /** * @return a PermissionCollection containing the basic * permissions granted depending on the security type. * * @param cs the CodeSource to get permissions for */ public PermissionCollection getPermissions(CodeSource cs) { PermissionCollection permissions = getSandBoxPermissions(); // discard sandbox, give all if (ALL_PERMISSIONS.equals(type)) { permissions = new Permissions(); if (customTrustedPolicy == null) { permissions.add(new AllPermission()); return permissions; } else { return customTrustedPolicy.getPermissions(cs); } } // add j2ee to sandbox if needed if (J2EE_PERMISSIONS.equals(type)) for (Permission j2eePermission : j2eePermissions) { permissions.add(j2eePermission); } return permissions; } /** * @return the permission level requested in the JNLP */ public RequestedPermissionLevel getRequestedPermissionLevel() { return requestedPermissionLevel; } /** * @return a PermissionCollection containing the sandbox permissions */ public PermissionCollection getSandBoxPermissions() { final Permissions permissions = new Permissions(); for (Permission sandboxPermission : sandboxPermissions) { permissions.add(sandboxPermission); } if (grantAwtPermissions) { permissions.add(new AWTPermission("showWindowWithoutWarningBanner")); } if (JNLPRuntime.isWebstartApplication()) { if (file == null) { throw new NullJnlpFileException("Can not return sandbox permissions, file is null"); } if (file.isApplication()) { for (Permission jnlpRIAPermission : jnlpRIAPermissions) { permissions.add(jnlpRIAPermission); } } } if (downloadHost != null && downloadHost.getHost().length() > 0) { permissions.add(new SocketPermission(UrlUtils.getHostAndPort(downloadHost), "connect, accept")); } final Collection urlPermissions = getUrlPermissions(); for (final Permission permission : urlPermissions) { permissions.add(permission); } return permissions; } private Set getUrlPermissions() { if (urlPermissionClass == null || urlPermissionConstructor == null) { return Collections.emptySet(); } final Set permissions = new HashSet<>(); for (final JARDesc jar : file.getResources().getJARs()) { try { // Allow applets all HTTP methods (ex POST, GET) with any request headers // on resources anywhere recursively in or below the applet codebase, only on // default ports and ports explicitly specified in resource locations final URI resourceLocation = jar.getLocation().toURI().normalize(); final URI host = getHost(resourceLocation); final String hostUriString = host.toString(); final String urlPermissionUrlString = appendRecursiveSubdirToCodebaseHostString(hostUriString); final Permission p = urlPermissionConstructor.newInstance(urlPermissionUrlString); permissions.add(p); } catch (final ReflectiveOperationException e) { OutputController.getLogger().log(OutputController.Level.WARNING_DEBUG, "Exception while attempting to reflectively generate a URLPermission, probably not running on Java 8+?"); OutputController.getLogger().log(OutputController.Level.WARNING_DEBUG, e); } catch (final URISyntaxException e) { OutputController.getLogger().log(OutputController.Level.WARNING_DEBUG, "Could not determine codebase host for resource at " + jar.getLocation() + " while generating URLPermissions"); OutputController.getLogger().log(e); } } try { final URI codebase = file.getNotNullProbalbeCodeBase().toURI().normalize(); final URI host = getHost(codebase); final String codebaseHostUriString = host.toString(); final String urlPermissionUrlString = appendRecursiveSubdirToCodebaseHostString(codebaseHostUriString); final Permission p = urlPermissionConstructor.newInstance(urlPermissionUrlString); permissions.add(p); } catch (final ReflectiveOperationException e) { OutputController.getLogger().log(OutputController.Level.WARNING_DEBUG, "Exception while attempting to reflectively generate a URLPermission, probably not running on Java 8+?"); OutputController.getLogger().log(OutputController.Level.WARNING_DEBUG, e); } catch (final URISyntaxException e) { OutputController.getLogger().log(OutputController.Level.WARNING_DEBUG, "Could not determine codebase host for codebase " + file.getCodeBase() + " while generating URLPermissions"); OutputController.getLogger().log(e); } return permissions; } /** * Gets the host domain part of an applet's codebase. Removes path, query, and fragment, but preserves scheme, * user info, and host. The port used is overridden with the specified port. * @param codebase the applet codebase URL * @param port * @return the host domain of the codebase * @throws URISyntaxException */ static URI getHostWithSpecifiedPort(final URI codebase, final int port) throws URISyntaxException { Objects.requireNonNull(codebase); return new URI(codebase.getScheme(), codebase.getUserInfo(), codebase.getHost(), port, null, null, null); } /** * Gets the host domain part of an applet's codebase. Removes path, query, and fragment, but preserves scheme, * user info, host, and port. * @param codebase the applet codebase URL * @return the host domain of the codebase * @throws URISyntaxException */ static URI getHost(final URI codebase) throws URISyntaxException { Objects.requireNonNull(codebase); return getHostWithSpecifiedPort(codebase, codebase.getPort()); } /** * Appends a recursive access marker to a codebase host, for granting Java 8 URLPermissions which are no * more restrictive than the existing SocketPermissions * See http://docs.oracle.com/javase/8/docs/api/java/net/URLPermission.html * @param codebaseHost the applet's codebase's host domain URL as a String. Expected to be formatted as eg * "http://example.com:8080" or "http://example.com/" * @return the resulting String eg "http://example.com:8080/- */ static String appendRecursiveSubdirToCodebaseHostString(final String codebaseHost) { Objects.requireNonNull(codebaseHost); String result = codebaseHost; while (result.endsWith("/")) { result = result.substring(0, result.length() - 1); } // See http://docs.oracle.com/javase/8/docs/api/java/net/URLPermission.html result = result + "/-"; // allow access to any resources recursively on the host domain return result; } /** * @return all the names of the basic JNLP system properties accessible by RIAs */ public static String[] getJnlpRIAPermissions() { String[] jnlpPermissions = new String[jnlpRIAPermissions.length]; for (int i = 0; i < jnlpRIAPermissions.length; i++) jnlpPermissions[i] = jnlpRIAPermissions[i].getName(); return jnlpPermissions; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/ResourcesDesc.java0000644000000000000000000000013012654402377024111 xustar0030 mtime=1454507263.257432314 29 atime=1454507327.12658051 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/ResourcesDesc.java0000644000175000002070000001546312654402377024647 0ustar00jvanekmock00000000000000// Copyright (C) 2001-2003 Jon A. Maxwell (JAM) // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp; import java.util.*; /** * The resources element. * * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.7 $ */ public class ResourcesDesc { /** the locales of these resources */ private final Locale locales[]; /** the OS for these resources */ private final String os[]; /** the arch for these resources */ private final String arch[]; /** the JNLPFile this information is for */ private final JNLPFile jnlpFile; /** list of jars, packages, properties, and extensions */ private final List resources = new ArrayList<>(); // mixed list makes easier for lookup code /** * Create a representation of one information section of the * JNLP File. * * @param jnlpFile JNLP file the resources are for * @param locales the locales of these resources * @param os the os of these resources * @param arch the arch of these resources */ public ResourcesDesc(JNLPFile jnlpFile, Locale locales[], String os[], String arch[]) { this.jnlpFile = jnlpFile; this.locales = locales; this.os = os; this.arch = arch; } /** * @return the JVMs. */ public JREDesc[] getJREs() { List lresources = getResources(JREDesc.class); return lresources.toArray(new JREDesc[lresources.size()]); } public static JARDesc getMainJAR(JARDesc jars[] ) { return getMainJAR(Arrays.asList(jars)); } public static JARDesc getMainJAR(List jars) { for (JARDesc jar : jars) { if (jar.isMain()) { return jar; } } if (jars.size() > 0) { return jars.get(0); } else { return null; } } /** * @return the main JAR for these resources. There first JAR * is returned if no JARs are specified as the main JAR, and if * there are no JARs defined then null is returned. */ public JARDesc getMainJAR() { return getMainJAR(getJARs()); } /** * @return all of the JARs. */ public JARDesc[] getJARs() { List lresources = getResources(JARDesc.class); return lresources.toArray(new JARDesc[lresources.size()]); } /** * @return the JARs with the specified part name. * * @param partName the part name, null and "" equivalent */ public JARDesc[] getJARs(String partName) { List lresources = getResources(JARDesc.class); for (int i = lresources.size(); i-- > 0;) { JARDesc jar = lresources.get(i); if (!("" + jar.getPart()).equals("" + partName)) lresources.remove(i); } return lresources.toArray(new JARDesc[lresources.size()]); } /** * @return the Extensions. */ public ExtensionDesc[] getExtensions() { List lresources = getResources(ExtensionDesc.class); return lresources.toArray(new ExtensionDesc[lresources.size()]); } /** * @return the Packages. */ public PackageDesc[] getPackages() { List lresources = getResources(PackageDesc.class); return lresources.toArray(new PackageDesc[lresources.size()]); } /** * Returns the Packages that match the specified class name. * * @param className the fully qualified class name * @return the PackageDesc objects matching the class name */ public PackageDesc[] getPackages(String className) { List lresources = getResources(PackageDesc.class); for (int i = lresources.size(); i-- > 0;) { PackageDesc pk = lresources.get(i); if (!pk.matches(className)) lresources.remove(i); } return lresources.toArray(new PackageDesc[lresources.size()]); } /** * @return the Properties as a list. */ public PropertyDesc[] getProperties() { List lresources = getResources(PropertyDesc.class); return lresources.toArray(new PropertyDesc[lresources.size()]); } /** * @return the properties as a map. */ public Map getPropertiesMap() { Map properties = new HashMap<>(); List lresources = getResources(PropertyDesc.class); for (PropertyDesc prop : lresources) { properties.put(prop.getKey(), prop.getValue()); } return properties; } /** * @return the os required by these resources, or null if no * locale was specified in the JNLP file. */ public String[] getOS() { return os; } /** * @return the architecture required by these resources, or null * if no locale was specified in the JNLP file. */ public String[] getArch() { return arch; } /** * @return the locale required by these resources, or null if no * locale was specified in the JNLP file. */ public Locale[] getLocales() { return locales; } /** * @return the JNLPFile the resources are for. */ public JNLPFile getJNLPFile() { return jnlpFile; } /** * @param type of resource to be found * @param type resource to be found * @return all resources of the specified type. */ public List getResources(Class type) { List result = new ArrayList<>(); for (Object resource : resources) { if (type.isAssignableFrom(resource.getClass())) result.add(type.cast(resource)); } return result; } /** * Add a resource. * @param resource to be added */ public void addResource(Object resource) { // if this is going to stay public it should probably take an // interface instead of an Object if (resource == null) throw new IllegalArgumentException("null resource"); resources.add(resource); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/RequiredElementException.java0000644000000000000000000000013012654402377026311 xustar0030 mtime=1454507263.257432314 29 atime=1454507327.12658051 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/RequiredElementException.java0000644000175000002070000000265512654402377027046 0ustar00jvanekmock00000000000000// Copyright (C) 2012 Red Hat, Inc. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp; /** * Thrown when a field that is required from the information tag is not found * under the current JVM's locale or as a generalized element. */ public class RequiredElementException extends ParseException { private static final long serialVersionUID = 1L; /* (non-Javadoc) * @see net.sourceforge.jnlp.ParseException(String) */ public RequiredElementException(String message) { super(message); } /* (non-Javadoc) * @see net.sourceforge.jnlp.ParseException(String, Throwable) */ public RequiredElementException(String message, Throwable cause) { super(message, cause); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/RelatedContentDesc.java0000644000000000000000000000013012654402377025052 xustar0030 mtime=1454507263.257432314 29 atime=1454507327.12658051 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/RelatedContentDesc.java0000644000175000002070000000461512654402377025605 0ustar00jvanekmock00000000000000// Copyright (C) 2009 Red Hat, Inc. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp; import java.net.URL; public class RelatedContentDesc { /** title of the content */ private String title = null;; /** the description of the content */ private String description = null; /** the location of the content */ private URL location = null; /** the icon for this related content */ private IconDesc icon = null; /** * Create a related-content descriptor * @param href the url of the related content */ public RelatedContentDesc(URL href) { this.location = href; } /** * Set the title of this content * @param title the title of this content */ public void setTitle(String title) { this.title = title; } /** * @return the title of this content.. */ public String getTitle() { return title; } /** * Set the description of this related content * @param description to be set */ public void setDescription(String description) { this.description = description; } /** * @return the description of the related content */ public String getDescription() { return description; } /** * @return the location of the related content. Not null */ public URL getLocation() { return location; } /** * Set the icon for this related content * @param icon set to be used */ public void setIconDesc(IconDesc icon) { this.icon = icon; } /** * @return the icon descriptor for the realted content */ public IconDesc getIcon() { return icon; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/PropertyDesc.java0000644000000000000000000000013012654402377023763 xustar0030 mtime=1454507263.256432328 29 atime=1454507327.12658051 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PropertyDesc.java0000644000175000002070000000445312654402377024516 0ustar00jvanekmock00000000000000// Copyright (C) 2001-2003 Jon A. Maxwell (JAM) // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp; import static net.sourceforge.jnlp.runtime.Translator.R; /** * The property element. * * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.6 $ */ public class PropertyDesc { /** * * @param prop - the property to be parsed from format key=value * @return new PropertyDesc based on parsed key=value, though composed from key and value * @throws net.sourceforge.jnlp.LaunchException if creations fails */ public static PropertyDesc fromString(String prop) throws LaunchException { // allows empty property, not sure about validity of that. int equals = prop.indexOf("="); if (equals == -1) { throw new LaunchException(R("BBadProp", prop)); } String key = prop.substring(0, equals); String value = prop.substring(equals + 1, prop.length()); return new PropertyDesc(key, value); } /** the key name */ final private String key; /** the value */ final private String value; /** * Creates a property descriptor. * * @param key the key name * @param value the value */ public PropertyDesc(String key, String value) { this.key = key; this.value = value; } /** * @return the property's key */ public String getKey() { return key; } /** * @return the property's value */ public String getValue() { return value; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/PluginParameters.java0000644000000000000000000000013012654402377024622 xustar0030 mtime=1454507263.256432328 29 atime=1454507327.12658051 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PluginParameters.java0000644000175000002070000001753212654402377025357 0ustar00jvanekmock00000000000000/* PluginAppletAttributes -- Provides parsing for applet attributes Copyright (C) 2012 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp; import java.net.URL; import java.util.Collections; import java.util.HashMap; import java.util.Map; import static net.sourceforge.jnlp.runtime.Translator.R; /** * Represents plugin applet parameters, backed by a HashMap. */ public class PluginParameters { private final Map parameters; public PluginParameters(Map params) { this.parameters = createParameterTable(params); if (this.parameters.get("code") == null && this.parameters.get("object") == null //If code/object parameters are missing, we can still determine the main-class name from the jnlp file passed using jnlp_href && this.parameters.get("jnlp_href") == null) { throw new PluginParameterException(R("BNoCodeOrObjectApplet")); } } // Note, lower-case key expected public String get(String key) { return this.parameters.get(key); } public void put(String key, String value) { parameters.put(key.toLowerCase(), value); } public Map getUnmodifiableMap() { return Collections.unmodifiableMap(parameters); } public Map getUnderlyingMap() { return parameters; } public String getDefaulted(String key, String defaultStr) { String value = get(key); return (value != null) ? value : defaultStr; } public String getAppletTitle() { String name = get("name"); if (name == null) { return "Applet"; } else { return name + " applet"; } } public boolean useCodebaseLookup() { return Boolean.valueOf(getDefaulted("codebase_lookup", "true")); } public String getArchive() { return getDefaulted("archive", ""); } public String getJavaArchive() { return getDefaulted("java_archive", ""); } public String getJavaArguments() { return getDefaulted("java_arguments", ""); } public String getCacheArchive() { return getDefaulted("cache_archive", ""); } public String getCacheArchiveEx() { return getDefaulted("cache_archive_ex", ""); } public String getCacheOption() { return getDefaulted("cache_option", ""); } public String getCacheVersion() { return getDefaulted("cache_version", ""); } public String getCode() { return getDefaulted("code", ""); } public String getJNLPHref() { return get("jnlp_href"); } public String getJNLPEmbedded() { return get("jnlp_embedded"); } public String getJarFiles() { return getDefaulted("archive", ""); } public int getWidth() { String widthStr = getDefaulted("width", "0"); return Integer.valueOf(widthStr); } public int getHeight() { String heightStr = getDefaulted("height", "0"); return Integer.valueOf(heightStr); } public String getPermissions() { return get("permissions"); } public void updateSize(int width, int height) { parameters.put("width", Integer.toString(width)); parameters.put("height", Integer.toString(height)); } public String getUniqueKey(URL codebase) { /* According to http://download.oracle.com/javase/6/docs/technotes/guides/deployment/deployment-guide/applet-compatibility.html, * classloaders are shared iff these properties match: * codebase, cache_archive, java_archive, archive * * To achieve this, we create the uniquekey based on those 4 values, * always in the same order. The initial "=" parts ensure a * bad tag cannot trick the loader into getting shared with another. */ return "codebase=" + codebase.toExternalForm() + "cache_archive=" + getCacheArchive() + "java_archive=" + getJavaArchive() + "archive=" + getArchive(); } /** * Replace an attribute with its 'java_'-prefixed version. * Note that java_* aliases override older names: * http://java.sun.com/j2se/1.4.2/docs/guide/plugin/developer_guide/using_tags.html#in-nav */ static void ensureJavaPrefixTakesPrecedence(Map params, String attribute) { String javaPrefixAttribute = params.get("java_" + attribute); if (javaPrefixAttribute != null) { params.put(attribute, javaPrefixAttribute); } } /** * Creates the underlying hash table with the proper overrides. Ensure all * keys are lowercase consistently. * * @param rawParams the properties, before parameter aliasing rules. * @return the resulting parameter table */ static Map createParameterTable( Map rawParams) { Map params = new HashMap(); for (Map.Entry entry : rawParams.entrySet()) { String key = entry.getKey().toLowerCase(); String value = entry.getValue(); params.put(key, value); } String codeTag = params.get("code"); String classID = params.get("classid"); // If there is a classid and no code tag present, transform it to code tag if (codeTag == null && classID != null && !classID.startsWith("clsid:")) { codeTag = classID; params.put("code", codeTag); } // remove java: from code tag if (codeTag != null && codeTag.startsWith("java:")) { codeTag = codeTag.substring("java:".length()); params.put("code", codeTag); } // java_* aliases override older names: // http://java.sun.com/j2se/1.4.2/docs/guide/plugin/developer_guide/using_tags.html#in-nav ensureJavaPrefixTakesPrecedence(params, "code"); ensureJavaPrefixTakesPrecedence(params, "codebase"); ensureJavaPrefixTakesPrecedence(params, "archive"); ensureJavaPrefixTakesPrecedence(params, "object"); ensureJavaPrefixTakesPrecedence(params, "type"); return params; } public String toString() { return parameters.toString(); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/PluginParameterException.java0000644000000000000000000000013112654402377026317 xustar0030 mtime=1454507263.256432328 30 atime=1454507327.125580523 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PluginParameterException.java0000644000175000002070000000346312654402377027051 0ustar00jvanekmock00000000000000/* Copyright (C) 2012 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp; public class PluginParameterException extends RuntimeException { public PluginParameterException(String detail) { super(detail); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/PluginBridge.java0000644000000000000000000000013112654402377023714 xustar0030 mtime=1454507263.256432328 30 atime=1454507327.125580523 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PluginBridge.java0000644000175000002070000006120712654402377024446 0ustar00jvanekmock00000000000000/* * Copyright 2012 Red Hat, Inc. * This file is part of IcedTea, http://icedtea.classpath.org * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Sun designates this * particular file as subject to the "Classpath" exception as provided * by Sun in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */ package net.sourceforge.jnlp; import java.io.ByteArrayInputStream; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.Set; import net.sourceforge.jnlp.SecurityDesc.RequestedPermissionLevel; import net.sourceforge.jnlp.cache.UpdatePolicy; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.util.StreamUtils; import net.sourceforge.jnlp.util.UrlUtils; import net.sourceforge.jnlp.util.logging.OutputController; import net.sourceforge.jnlp.util.replacements.BASE64Decoder; /** * Allows reuse of code that expects a JNLPFile object, * while overriding behaviour specific to applets. */ public final class PluginBridge extends JNLPFile { private final PluginParameters params; final private Set jars = new HashSet<>(); private List extensionJars = new ArrayList<>(); //Folders can be added to the code-base through the archive tag final private List codeBaseFolders = new ArrayList<>(); private String[] cacheJars = new String[0]; private String[] cacheExJars = new String[0]; private boolean usePack = false; private boolean useVersion = false; private boolean useJNLPHref; private String debugJnlp; /** * Creates a new PluginBridge using a default JNLPCreator. * @param codebase as specified in attribute * @param documentBase as specified in attribute * @param jar jar attribute value * @param main main method attribute value * @param width width of appelt as specified in attribute * @param height height of applet as specified in attribute * @param params parameters as parsed from source html * @throws java.lang.Exception general exception as anything can happen */ public PluginBridge(URL codebase, URL documentBase, String jar, String main, int width, int height, PluginParameters params) throws Exception { this(codebase, documentBase, jar, main, width, height, params, new JNLPCreator()); } /** * Handles archive tag entries, which may be folders or jar files * @param archives the components of the archive tag */ private void addArchiveEntries(String[] archives) { for (String archiveEntry : archives){ // trim white spaces archiveEntry = archiveEntry.trim(); /*Only '/' on linux, '/' or '\\' on windows*/ if (archiveEntry.endsWith("/") || archiveEntry.endsWith(File.pathSeparator)) { this.codeBaseFolders.add(archiveEntry); } else { this.jars.add(archiveEntry); } } } public PluginBridge(URL codebase, URL documentBase, String archive, String main, int width, int height, final PluginParameters params, JNLPCreator jnlpCreator) throws Exception { specVersion = new Version("1.0"); fileVersion = new Version("1.1"); this.codeBase = codebase; this.sourceLocation = documentBase; this.params = params; this.parserSettings = ParserSettings.getGlobalParserSettings(); if (params.getJNLPHref() != null) { useJNLPHref = true; try { // Use codeBase as the context for the URL. If jnlp_href's // value is a complete URL, it will replace codeBase's context. final ParserSettings defaultSettings = new ParserSettings(); final URL jnlp = new URL(codeBase, params.getJNLPHref()); if (fileLocation == null){ fileLocation = jnlp; } JNLPFile jnlpFile; if (params.getJNLPEmbedded() != null) { InputStream jnlpInputStream = new ByteArrayInputStream(decodeBase64String(params.getJNLPEmbedded())); jnlpFile = new JNLPFile(jnlpInputStream, codeBase, defaultSettings); debugJnlp = new StreamProvider() { @Override InputStream getStream() throws Exception { return new ByteArrayInputStream(decodeBase64String(params.getJNLPEmbedded())); } }.readStream(); } else { // see http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=2746#c3 URL codebaseRewriter=UrlUtils.ensureSlashTail(UrlUtils.removeFileName(jnlp)); this.codeBase = codebaseRewriter; jnlpFile = jnlpCreator.create(jnlp, null, defaultSettings, JNLPRuntime.getDefaultUpdatePolicy(), codebaseRewriter); debugJnlp = new StreamProvider() { @Override InputStream getStream() throws Exception { return JNLPFile.openURL(jnlp, null, UpdatePolicy.ALWAYS); } }.readStream(); } OutputController.getLogger().log("Loaded JNLPhref:"); OutputController.getLogger().log((debugJnlp == null) ? "null" : debugJnlp); if (jnlpFile.isApplet()) main = jnlpFile.getApplet().getMainClass(); Map jnlpParams = jnlpFile.getApplet().getParameters(); info = jnlpFile.info; // Change the parameter name to lowercase to follow conventions. for (Map.Entry entry : jnlpParams.entrySet()) { this.params.put(entry.getKey().toLowerCase(), entry.getValue()); } JARDesc[] jarDescs = jnlpFile.getResources().getJARs(); for (JARDesc jarDesc : jarDescs) { String fileName = jarDesc.getLocation().toExternalForm(); this.jars.add(fileName); } usePack = jnlpFile.getDownloadOptions().useExplicitPack(); useVersion = jnlpFile.getDownloadOptions().useExplicitVersion(); // Store any extensions listed in the JNLP file to be returned later on, namely in getResources() extensionJars = Arrays.asList(jnlpFile.getResources().getExtensions()); } catch (MalformedURLException e) { // Don't fail because we cannot get the jnlp file. Parameters are optional not required. // it is the site developer who should ensure that file exist. OutputController.getLogger().log(OutputController.Level.ERROR_ALL, "Unable to get JNLP file at: " + params.getJNLPHref() + " with context of URL as: " + codeBase.toExternalForm()); } } else { // Should we populate this list with applet attribute tags? info = new ArrayList<>(); useJNLPHref = false; } // also, see if cache_archive is specified String cacheArchive = params.getCacheArchive(); if (!cacheArchive.isEmpty()) { String[] versions = new String[0]; // are there accompanying versions? String cacheVersion = params.getCacheVersion(); if (!cacheVersion.isEmpty()) { versions = cacheVersion.split(","); } String[] ljars = cacheArchive.split(","); cacheJars = new String[ljars.length]; for (int i = 0; i < ljars.length; i++) { cacheJars[i] = ljars[i].trim(); if (versions.length > 0) { cacheJars[i] += ";" + versions[i].trim(); } } } String cacheArchiveEx = params.getCacheArchiveEx(); if (!cacheArchiveEx.isEmpty()) { cacheExJars = cacheArchiveEx.split(","); } if (archive != null && archive.length() > 0) { String[] archives = archive.split(","); addArchiveEntries(archives); OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "Jar string: " + archive); OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "jars length: " + archives.length); } if (main.endsWith(".class")) main = main.substring(0, main.length() - 6); // the class name should be of the form foo.bar.Baz not foo/bar/Baz String mainClass = main.replace('/', '.'); launchType = new AppletDesc(getTitle(), mainClass, documentBase, width, height, params.getUnmodifiableMap()); if (main.endsWith(".class")) //single class file only security = new SecurityDesc(this, SecurityDesc.SANDBOX_PERMISSIONS, codebase); else security = null; this.uniqueKey = params.getUniqueKey(codebase); String jargs = params.getJavaArguments(); if (!jargs.isEmpty()) { for (String s : jargs.split(" ")) { String[] parts = s.trim().split("="); if (parts.length == 2 && Boolean.valueOf(parts[1])) { if (null != parts[0]) switch (parts[0]) { case "-Djnlp.packEnabled": usePack = true; break; case "-Djnlp.versionEnabled": useVersion = true; break; } } } } } public List getArchiveJars() { return new ArrayList<>(jars); } public boolean codeBaseLookup() { return params.useCodebaseLookup(); } public boolean useJNLPHref() { return useJNLPHref; } public PluginParameters getParams() { return params; } @Override public RequestedPermissionLevel getRequestedPermissionLevel() { final String level = params.getPermissions(); if (level == null) { return RequestedPermissionLevel.NONE; } else if (level.equals(SecurityDesc.RequestedPermissionLevel.DEFAULT.toHtmlString())) { return RequestedPermissionLevel.NONE; } else if (level.equals(SecurityDesc.RequestedPermissionLevel.SANDBOX.toHtmlString())) { return RequestedPermissionLevel.SANDBOX; } else if (level.equals(SecurityDesc.RequestedPermissionLevel.ALL.toHtmlString())) { return RequestedPermissionLevel.ALL; } else { return RequestedPermissionLevel.NONE; } } /** * {@inheritDoc } * @return options of download */ @Override public DownloadOptions getDownloadOptions() { return new DownloadOptions(usePack, useVersion); } @Override public String getTitle() { String inManifestTitle = super.getTitleFromManifest(); if (inManifestTitle != null) { return inManifestTitle; } //specification is recommending main class instead of html parameter //http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/manifest.html#app_name String mainClass = getManifestsAttributes().getMainClass(); if (mainClass != null) { return mainClass; } return params.getAppletTitle(); } @Override public ResourcesDesc getResources(final Locale locale, final String os, final String arch) { return new ResourcesDesc(this, new Locale[] { locale }, new String[] { os }, new String[] { arch }) { @Override public List getResources(Class launchType) { // Need to add the JAR manually... //should this be done to sharedResources on init? if (launchType.equals(JARDesc.class)) { try { List jarDescs = new ArrayList<>(); jarDescs.addAll(sharedResources.getResources(JARDesc.class)); for (String name : jars) { if (name.length() > 0) jarDescs.add(new JARDesc(new URL(codeBase, name), null, null, false, true, false, true)); } boolean cacheable = true; if (params.getCacheOption().equalsIgnoreCase("no")) cacheable = false; for (String cacheJar : cacheJars) { String[] jarAndVer = cacheJar.split(";"); String jar = jarAndVer[0]; Version version = null; if (jar.length() == 0) continue; if (jarAndVer.length > 1) { version = new Version(jarAndVer[1]); } jarDescs.add(new JARDesc(new URL(codeBase, jar), version, null, false, true, false, cacheable)); } for (String cacheExJar : cacheExJars) { if (cacheExJar.length() == 0) continue; String[] jarInfo = cacheExJar.split(";"); String jar = jarInfo[0].trim(); Version version = null; boolean lazy = true; if (jarInfo.length > 1) { // format is name[[;preload];version] if (jarInfo[1].equals("preload")) { lazy = false; } else { version = new Version(jarInfo[1].trim()); } if (jarInfo.length > 2) { lazy = false; version = new Version(jarInfo[2].trim()); } } jarDescs.add(new JARDesc(new URL(codeBase, jar), version, null, lazy, true, false, false)); } // We know this is a safe list of JarDesc objects @SuppressWarnings("unchecked") List result = (List) jarDescs; return result; } catch (MalformedURLException ex) { /* Ignored */ } } else if (launchType.equals(ExtensionDesc.class)) { // We hope this is a safe list of JarDesc objects @SuppressWarnings("unchecked") List castList = (List) extensionJars; // this list is populated when the PluginBridge is first constructed return castList; } return sharedResources.getResources(launchType); } @Override public JARDesc[] getJARs() { List jarDescs = getResources(JARDesc.class); return jarDescs.toArray(new JARDesc[jarDescs.size()]); } @Override public void addResource(Object resource) { // todo: honor the current locale, os, arch values sharedResources.addResource(resource); } }; } /** * @return the list of folders to be added to the codebase */ public List getCodeBaseFolders() { return new ArrayList<>(codeBaseFolders); } /** * @return the resources section of the JNLP file for the * specified locale, os, and arch. */ @Override public ResourcesDesc[] getResourcesDescs(final Locale locale, final String os, final String arch) { return new ResourcesDesc[] { getResources(locale, os, arch) }; } @Override public boolean isApplet() { return true; } @Override public boolean isApplication() { return false; } @Override public boolean isComponent() { return false; } @Override public boolean isInstaller() { return false; } /** * Returns the decoded BASE64 string */ static byte[] decodeBase64String(String encodedString) throws IOException { BASE64Decoder base64 = new BASE64Decoder(); return base64.decodeBuffer(encodedString); } public String getDebugJnlp() { return debugJnlp; } public boolean haveDebugJnlp() { return debugJnlp != null; } public String toJnlp(boolean needSecurity, boolean useHref, boolean fix) { if (useJNLPHref && debugJnlp != null && useHref) { OutputController.getLogger().log("Using debugjnlp as return value toJnlp"); if (fix) { return fixCommonIsuses(needSecurity, debugJnlp); } else { return debugJnlp; } } else { StringBuilder s = new StringBuilder(); s.append("\n" + "\n") .append(" \n" + " ").append(createJnlpTitle()).append("\n" + " ").append(createJnlpVendor()).append("\n" + " \n"); if (needSecurity) { s.append(getSecurityElement()); } s.append(" \n"); for (String i : getArchiveJars()) { s.append(" \n"); } s.append(" \n" + " \n"); if (!getApplet().getParameters().isEmpty()) { Set> prms = getApplet().getParameters().entrySet(); for (Map.Entry entry : prms) { s.append(" \n"); } } s.append(" \n" + "\n"); OutputController.getLogger().log("toJnlp generated:"); OutputController.getLogger().log(s.toString()); return s.toString(); } } private String getStrippedMain() { return strippClass(getApplet().getMainClass().trim()); } public static String strippClass(String s) { if (s.endsWith(".class")) { return s.substring(0, s.length() - ".class".length()); } else { return s; } } //Those constants are public, because they are tested in PluginBridgeTest static final String SANDBOX_REGEX = toBaseRegex("sandbox", false); static final String CLOSE_INFORMATION_REGEX = toBaseRegex("information", true); static final String SECURITY_REGEX = toBaseRegex("security", false); static final String RESOURCE_REGEX = toBaseRegex("resources", false); static final String TITLE_REGEX = toBaseRegex("title", false); static final String VENDOR_REGEX = toBaseRegex("vendor", false); static final String AP_REGEX = toBaseRegex("all-permissions", false); static final String CODEBASE_REGEX1 = "(?i).*\\s+codebase\\s*=\\s*"; static final String CODEBASE_REGEX2 = "(?i)\\s+codebase\\s*=\\s*.\\.{0,1}.((\\s+)|(\\s*>))";// "." '.' '' "" static String toMatcher(String regex) { return "(?s).*" + regex + ".*"; } static String toBaseRegex(String tagName, boolean closing) { return "(?i)<\\s*" + ((closing) ? "/\\s*" : "") + tagName + "\\s*>"; } private String fixCommonIsuses(boolean needSecurity, String orig) { String codebase = getNotNullProbalbeCodeBase().toString(); return fixCommonIsuses(needSecurity, orig, codebase, createJnlpTitle(), createJnlpVendor()); } //testing allowing method static String fixCommonIsuses(boolean needSecurity, String orig, String codebase, String title, String vendor) { //no information element at all if (!orig.matches(toMatcher(CLOSE_INFORMATION_REGEX))) { OutputController.getLogger().log("no information element Found. Trying to fix"); if (orig.matches(toMatcher(SECURITY_REGEX))) { orig = orig.replaceAll(SECURITY_REGEX, "\n\n\n\n"); } else { if (orig.matches(toMatcher(RESOURCE_REGEX))) { orig = orig.replaceAll(RESOURCE_REGEX, "\n\n\n\n"); } } } //some have missing codebase, thats fatal if (!orig.matches(toMatcher(CODEBASE_REGEX1))) { OutputController.getLogger().log("jnlphref did not had codebase. Fixing"); orig = orig.replaceAll("(?i)<\\s*jnlp\\s+", "" + title + "\n\n"); } if (!orig.matches(toMatcher(VENDOR_REGEX))) { OutputController.getLogger().log("Missing vendor. Fixing"); orig = orig.replaceAll(CLOSE_INFORMATION_REGEX, "\n" + vendor + "\n\n"); } //also all-security is not enforced via jnlpHref if (needSecurity && !orig.matches(toMatcher(AP_REGEX))) { OutputController.getLogger().log("all-permissions not found and app is signed."); if (orig.matches(SANDBOX_REGEX)) { OutputController.getLogger().log("Replacing sandbox by all-permissions"); orig = orig.replaceAll(SANDBOX_REGEX, getAllPermissionsElement()); } else { OutputController.getLogger().log("adding security element"); orig = orig.replaceAll(CLOSE_INFORMATION_REGEX, "\n" + getSecurityElement()); } } return orig; } private static String getSecurityElement() { return " \n" + getAllPermissionsElement() + " \n"; } private static String getAllPermissionsElement() { return " \n"; } private abstract class StreamProvider { abstract InputStream getStream() throws Exception; String readStream() { try { return StreamUtils.readStreamAsString(getStream()); } catch (Exception ex) { OutputController.getLogger().log(ex); } return null; } } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/ParserSettings.java0000644000000000000000000000013112654402377024316 xustar0030 mtime=1454507263.255432341 30 atime=1454507327.125580523 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/ParserSettings.java0000644000175000002070000001022712654402377025044 0ustar00jvanekmock00000000000000/* ParserSettings.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp; import net.sourceforge.jnlp.util.optionparser.OptionParser; /** * Contains settings to be used by the Parser while parsing JNLP files. * * Immutable and therefore thread-safe. */ public class ParserSettings { private static ParserSettings globalParserSettings = new ParserSettings(); private final boolean isStrict; private final boolean extensionAllowed; private final boolean malformedXmlAllowed; /** Create a new ParserSettings with the defautl parser settings */ public ParserSettings() { this(false, true, true); } /** Create a new ParserSettings object * @param strict true if parser should be stric * @param extensionAllowed true if extensions are allowed * @param malformedXmlAllowed true if xml sanitizer should be used */ public ParserSettings(boolean strict, boolean extensionAllowed, boolean malformedXmlAllowed) { this.isStrict = strict; this.extensionAllowed = extensionAllowed; this.malformedXmlAllowed = malformedXmlAllowed; } /** @return true if extensions to the spec are allowed */ public boolean isExtensionAllowed() { return extensionAllowed; } /** @return true if parsing malformed xml is allowed */ public boolean isMalformedXmlAllowed() { return malformedXmlAllowed; } /** @return true if strict parsing mode is to be used */ public boolean isStrict() { return isStrict; } /** * @return the global parser settings in use. */ public static ParserSettings getGlobalParserSettings() { return globalParserSettings; } /** * Set the global ParserSettings to match the given settings. * @param parserSettings to be used */ public static void setGlobalParserSettings(ParserSettings parserSettings) { globalParserSettings = parserSettings; } /** * @param optionParser to be read as source for globaPArserSettings * @return the ParserSettings to be used according to arguments specified * at boot on the command line. These settings are also stored so they * can be retrieved at a later time. */ public static ParserSettings setGlobalParserSettingsFromOptionParser(OptionParser optionParser) { ParserSettings settings = new ParserSettings(optionParser.hasOption(OptionsDefinitions.OPTIONS.STRICT), true, !optionParser.hasOption(OptionsDefinitions.OPTIONS.XML)); setGlobalParserSettings(settings); return globalParserSettings; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/Parser.java0000644000000000000000000000013112654402377022575 xustar0030 mtime=1454507263.254432354 30 atime=1454507327.125580523 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/Parser.java0000644000175000002070000014412012654402377023323 0ustar00jvanekmock00000000000000// Copyright (C) 2001-2003 Jon A. Maxwell (JAM) // Copyright (C) 2009-2013 Red Hat, Inc. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp; import static net.sourceforge.jnlp.runtime.Translator.R; import java.io.*; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.net.*; import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; import net.sourceforge.jnlp.SecurityDesc.RequestedPermissionLevel; import net.sourceforge.jnlp.UpdateDesc.Check; import net.sourceforge.jnlp.UpdateDesc.Policy; import net.sourceforge.jnlp.util.logging.OutputController; /** * Contains methods to parse an XML document into a JNLPFile. * Implements JNLP specification version 1.0. * * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.13 $ */ public final class Parser { private static String CODEBASE = "codebase"; private static String MAINCLASS = "main-class"; private static final Pattern anyWhiteSpace = Pattern.compile("\\s"); // defines netx.jnlp.Node class if using Tiny XML or Nano XML // Currently uses the Nano XML parse. Search for "SAX" or // "TINY" or "NANO" and uncomment those blocks and comment the // active ones (if any) to switch XML parsers. Also // (un)comment appropriate Node class at end of this file and // do a clean build. /** * Ensure consistent error handling. */ /* SAX static ErrorHandler errorHandler = new ErrorHandler() { public void error(SAXParseException exception) throws SAXParseException { //throw exception; } public void fatalError(SAXParseException exception) throws SAXParseException { //throw exception; } public void warning(SAXParseException exception) { OutputController.getLogger().log(OutputController.Level.WARNING_ALL, "XML parse warning:"); OutputController.getLogger().log(OutputController.Level.ERROR_ALL, exception); } }; */ // fix: some descriptors need to use the jnlp file at a later // date and having file ref lets us pass it to their // constructors // /** the file reference */ private final JNLPFile file; // do not use (uninitialized) /** the root node */ private final Node root; /** the specification version */ private final Version spec; /** the base URL that all hrefs are relative to */ private final URL base; /** the codebase URL */ private URL codebase; /** the file URL */ private final URL fileLocation; /** whether to throw errors on non-fatal errors. */ private final boolean strict; // if strict==true parses a file with no error then strict==false should also /** whether to allow extensions to the JNLP specification */ private final boolean allowExtensions; // true if extensions to JNLP spec are ok /** * Create a parser for the JNLP file. If the location * parameters is not null it is used as the default codebase * (does not override value of jnlp element's href * attribute). *

    * The root node may be normalized as a side effect of this * constructor. *

    * @param file the (uninitialized) file reference * @param base if codebase is not specified, a default base for relative URLs * @param root the root node * @param settings the parser settings to use when parsing the JNLP file * @throws ParseException if the JNLP file is invalid */ Parser(JNLPFile file, URL base, Node root, ParserSettings settings) throws ParseException { this(file, base, root, settings, null); } /** * Create a parser for the JNLP file. If the location * parameters is not null it is used as the default codebase * (does not override value of jnlp element's href * attribute). *

    * The root node may be normalized as a side effect of this * constructor. *

    * @param file the (uninitialized) file reference * @param base if codebase is not specified, a default base for relative URLs * @param root the root node * @param settings the parser settings to use when parsing the JNLP file * @param codebase codebase to use if we did not parse one from JNLP file. * @throws ParseException if the JNLP file is invalid */ Parser(JNLPFile file, URL base, Node root, ParserSettings settings, URL codebase) throws ParseException { this.file = file; this.root = root; this.strict = settings.isStrict(); this.allowExtensions = settings.isExtensionAllowed(); // ensure it's a JNLP node if (root == null || !root.getNodeName().equals("jnlp")) throw new ParseException(R("PInvalidRoot")); // JNLP tag information this.spec = getVersion(root, "spec", "1.0+"); try { this.codebase = addSlash(getURL(root, CODEBASE, base)); } catch (ParseException e) { //If parsing fails, continue by overriding the codebase with the one passed in } if (this.codebase == null) // Codebase is overwritten if codebase was not specified in file or if parsing of it failed this.codebase = codebase; this.base = (this.codebase != null) ? this.codebase : base; // if codebase not specified use default codebase fileLocation = getURL(root, "href", this.base); // normalize the text nodes root.normalize(); } /** * Returns the file version. * @return version of file */ public Version getFileVersion() { return getVersion(root, "version", null); } /** * Returns the file location. * @return url of source file */ public URL getFileLocation() { return fileLocation; } /** * @return the codebase. */ public URL getCodeBase() { return codebase; } /** * @return the specification version. * */ public Version getSpecVersion() { return spec; } UpdateDesc getUpdate(Node parent) throws ParseException { UpdateDesc updateDesc = null; Node child = parent.getFirstChild(); while (child != null) { if (child.getNodeName().equals("update")) { if (strict && updateDesc != null) { throw new ParseException(R("PTwoUpdates")); } Node node = child; Check check; String checkValue = getAttribute(node, "check", "timeout"); switch (checkValue) { case "always": check = Check.ALWAYS; break; case "timeout": check = Check.TIMEOUT; break; case "background": check = Check.BACKGROUND; break; default: check = Check.TIMEOUT; break; } String policyString = getAttribute(node, "policy", "always"); Policy policy; switch (policyString) { case "always": policy = Policy.ALWAYS; break; case "prompt-update": policy = Policy.PROMPT_UPDATE; break; case "prompt-run": policy = Policy.PROMPT_RUN; break; default: policy = Policy.ALWAYS; break; } updateDesc = new UpdateDesc(check, policy); } child = child.getNextSibling(); } if (updateDesc == null) { updateDesc = new UpdateDesc(Check.TIMEOUT, Policy.ALWAYS); } return updateDesc; } // // This section loads the resources elements // /** * @return all of the ResourcesDesc elements under the specified * node (jnlp or j2se). * * @param parent the parent node (either jnlp or j2se) * @param j2se true if the resources are located under a j2se or java node * @throws ParseException if the JNLP file is invalid */ List getResources(Node parent, boolean j2se) throws ParseException { List result = new ArrayList<>(); Node resources[] = getChildNodes(parent, "resources"); // ensure that there are at least one information section present if (resources.length == 0 && !j2se) { throw new ParseException(R("PNoResources")); } for (Node resource : resources) { result.add(getResourcesDesc(resource, j2se)); } return result; } /** * @return the ResourcesDesc element at the specified node. * * @param node the resources node * @param j2se true if the resources are located under a j2se or java node * @throws ParseException if the JNLP file is invalid */ private ResourcesDesc getResourcesDesc(Node node, boolean j2se) throws ParseException { boolean mainFlag = false; // if found a main tag // create resources ResourcesDesc resources = new ResourcesDesc(file, getLocales(node), splitString(getAttribute(node, "os", null)), splitString(getAttribute(node, "arch", null))); // step through the elements Node child = node.getFirstChild(); while (child != null) { String name = child.getNodeName(); // check for nativelib but no trusted environment if ("nativelib".equals(name)) if (!isTrustedEnvironment()) throw new ParseException(R("PUntrustedNative")); if ("j2se".equals(name) || "java".equals(name)) { if (getChildNode(root, "component-desc") != null) if (strict) throw new ParseException(R("PExtensionHasJ2SE")); if (!j2se) resources.addResource(getJRE(child)); else throw new ParseException(R("PInnerJ2SE")); } if ("jar".equals(name) || "nativelib".equals(name)) { JARDesc jar = getJAR(child); // check for duplicate main entries if (jar.isMain()) { if (mainFlag == true) { if (strict) { throw new ParseException(R("PTwoMains")); } } mainFlag = true; } resources.addResource(jar); } if ("extension".equals(name)) resources.addResource(getExtension(child)); if ("property".equals(name)) resources.addResource(getProperty(child)); if ("package".equals(name)) resources.addResource(getPackage(child)); child = child.getNextSibling(); } return resources; } /** * @return the JRE element at the specified node. * * @param node the j2se/java node * @throws ParseException if the JNLP file is invalid */ private JREDesc getJRE(Node node) throws ParseException { Version version = getVersion(node, "version", null); URL location = getURL(node, "href", base); String vmArgs = getAttribute(node, "java-vm-args", null); try { checkVMArgs(vmArgs); } catch (IllegalArgumentException argumentException) { vmArgs = null; } String initialHeap = getAttribute(node, "initial-heap-size", null); String maxHeap = getAttribute(node, "max-heap-size", null); List resources = getResources(node, true); // require version attribute getRequiredAttribute(node, "version", null); return new JREDesc(new Version.JreVersion(version.toString(), strict), location, vmArgs, initialHeap, maxHeap, resources); } /** * Returns the JAR element at the specified node. * * @param node the jar or nativelib node * @throws ParseException if the JNLP file is invalid */ private JARDesc getJAR(Node node) throws ParseException { boolean nativeJar = "nativelib".equals(node.getNodeName()); URL location = getRequiredURL(node, "href", base); Version version = getVersion(node, "version", null); String part = getAttribute(node, "part", null); boolean main = "true".equals(getAttribute(node, "main", "false")); boolean lazy = "lazy".equals(getAttribute(node, "download", "eager")); if (nativeJar && main) if (strict) throw new ParseException(R("PNativeHasMain")); return new JARDesc(location, version, part, lazy, main, nativeJar, true); } /** * @return the Extension element at the specified node. * * @param node the extension node * @throws ParseException if the JNLP file is invalid */ private ExtensionDesc getExtension(Node node) throws ParseException { String name = getAttribute(node, "name", null); Version version = getVersion(node, "version", null); URL location = getRequiredURL(node, "href", base); ExtensionDesc ext = new ExtensionDesc(name, version, location); Node dload[] = getChildNodes(node, "ext-download"); for (Node dload1 : dload) { boolean lazy = "lazy".equals(getAttribute(dload1, "download", "eager")); ext.addPart(getRequiredAttribute(dload1, "ext-part", null), getAttribute(dload1, "part", null), lazy); } return ext; } /** * @return the Property element at the specified node. * * @param node the property node * @throws ParseException if the JNLP file is invalid */ private PropertyDesc getProperty(Node node) throws ParseException { String name = getRequiredAttribute(node, "name", null); String value = getRequiredAttribute(node, "value", ""); return new PropertyDesc(name, value); } /** * @return the Package element at the specified node. * * @param node the package node * @throws ParseException if the JNLP file is invalid */ private PackageDesc getPackage(Node node) throws ParseException { String name = getRequiredAttribute(node, "name", null); String part = getRequiredAttribute(node, "part", ""); boolean recursive = getAttribute(node, "recursive", "false").equals("true"); return new PackageDesc(name, part, recursive); } // // This section loads the information elements // /** * Make sure a title and vendor are present and nonempty and localized as * best matching as possible for the JVM's current locale. Fallback to a * generalized title and vendor otherwise. If none is found, throw an exception. * * Additionally prints homepage, description, title and vendor to stdout * if in Debug mode. * @throws RequiredElementException */ void checkForInformation() throws RequiredElementException { OutputController.getLogger().log("Homepage: " + file.getInformation().getHomepage()); OutputController.getLogger().log("Description: " + file.getInformation().getDescription()); String title = file.getTitle(); String vendor = file.getVendor(); if (title == null || title.trim().isEmpty()) throw new MissingTitleException(); else OutputController.getLogger().log("Acceptable title tag found, contains: " + title); if (vendor == null || vendor.trim().isEmpty()) throw new MissingVendorException(); else OutputController.getLogger().log("Acceptable vendor tag found, contains: " + vendor); } /** * @return all of the information elements under the specified * node. * * @param parent the parent node (jnlp) * @throws ParseException if the JNLP file is invalid */ List getInfo(Node parent) throws ParseException { List result = new ArrayList<>(); Node info[] = getChildNodes(parent, "information"); // ensure that there are at least one information section present if (info.length == 0) throw new MissingInformationException(); // create objects from the info sections for (Node infoNode : info) { result.add(getInformationDesc(infoNode)); } return result; } /** * @return the information element at the specified node. * * @param node the information node * @throws ParseException if the JNLP file is invalid */ InformationDesc getInformationDesc(Node node) throws ParseException { List descriptionsUsed = new ArrayList<>(); // locale Locale locales[] = getLocales(node); // create information InformationDesc info = new InformationDesc(locales, strict); // step through the elements Node child = node.getFirstChild(); while (child != null) { String name = child.getNodeName(); if ("title".equals(name)) addInfo(info, child, null, getSpanText(child, false)); if ("vendor".equals(name)) addInfo(info, child, null, getSpanText(child, false)); if ("description".equals(name)) { String kind = getAttribute(child, "kind", "default"); if (descriptionsUsed.contains(kind)) if (strict) throw new ParseException(R("PTwoDescriptions", kind)); descriptionsUsed.add(kind); addInfo(info, child, kind, getSpanText(child, false)); } if ("homepage".equals(name)) addInfo(info, child, null, getRequiredURL(child, "href", base)); if ("icon".equals(name)) addInfo(info, child, getAttribute(child, "kind", "default"), getIcon(child)); if ("offline-allowed".equals(name)) addInfo(info, child, null, Boolean.TRUE); if ("sharing-allowed".equals(name)) { if (strict && !allowExtensions) throw new ParseException(R("PSharing")); addInfo(info, child, null, Boolean.TRUE); } if ("association".equals(name)) { addInfo(info, child, null, getAssociation(child)); } if ("shortcut".equals(name)) { addInfo(info, child, null, getShortcut(child)); } if ("related-content".equals(name)) { addInfo(info, child, null, getRelatedContent(child)); } child = child.getNextSibling(); } return info; } /** * Adds a key,value pair to the information object. * * @param info the information object * @param node node name to be used as the key * @param mod key name appended with "-"+mod if not null * @param value the info object to add (icon or string) */ protected void addInfo(InformationDesc info, Node node, String mod, Object value) { String modStr = (mod == null) ? "" : "-" + mod; if (node == null) return; info.addItem(node.getNodeName() + modStr, value); } /** * @return the icon element at the specified node. * * @param node the icon node * @throws ParseException if the JNLP file is invalid */ private IconDesc getIcon(Node node) throws ParseException { int width = Integer.parseInt(getAttribute(node, "width", "-1")); int height = Integer.parseInt(getAttribute(node, "height", "-1")); int size = Integer.parseInt(getAttribute(node, "size", "-1")); int depth = Integer.parseInt(getAttribute(node, "depth", "-1")); URL location = getRequiredURL(node, "href", base); Object kind = getAttribute(node, "kind", "default"); return new IconDesc(location, kind, width, height, depth, size); } // // This section loads the security descriptor element // /** * @return the security descriptor element. If no security * element was specified in the JNLP file then a SecurityDesc * with applet permissions is returned. * * @param parent the parent node * @throws ParseException if the JNLP file is invalid */ SecurityDesc getSecurity(Node parent) throws ParseException { Node nodes[] = getChildNodes(parent, "security"); // test for too many security elements if (nodes.length > 1) if (strict) throw new ParseException(R("PTwoSecurity")); Object type = SecurityDesc.SANDBOX_PERMISSIONS; RequestedPermissionLevel requestedPermissionLevel = RequestedPermissionLevel.NONE; if (nodes.length == 0) { type = SecurityDesc.SANDBOX_PERMISSIONS; requestedPermissionLevel = RequestedPermissionLevel.NONE; } else if (null != getChildNode(nodes[0], "all-permissions")) { type = SecurityDesc.ALL_PERMISSIONS; requestedPermissionLevel = RequestedPermissionLevel.ALL; } else if (null != getChildNode(nodes[0], "j2ee-application-client-permissions")) { type = SecurityDesc.J2EE_PERMISSIONS; requestedPermissionLevel = RequestedPermissionLevel.J2EE; } else if (strict) { throw new ParseException(R("PEmptySecurity")); } if (base != null) { return new SecurityDesc(file, requestedPermissionLevel, type, base); } else { return new SecurityDesc(file, requestedPermissionLevel, type, null); } } /** * Returns whether the JNLP file requests a trusted execution * environment. */ private boolean isTrustedEnvironment() { Node security = getChildNode(root, "security"); if (security != null) if (getChildNode(security, "all-permissions") != null || getChildNode(security, "j2ee-application-client-permissions") != null) return true; return false; } // // This section loads the launch descriptor element // /** * @return the launch descriptor element, either AppletDesc, * ApplicationDesc, or InstallerDesc. * * @param parent the parent node * @throws ParseException if the JNLP file is invalid */ LaunchDesc getLauncher(Node parent) throws ParseException { // check for other than one application type if (1 < getChildNodes(parent, "applet-desc").length + getChildNodes(parent, "application-desc").length + getChildNodes(parent, "installer-desc").length) throw new ParseException(R("PTwoDescriptors")); Node child = parent.getFirstChild(); while (child != null) { String name = child.getNodeName(); if ("applet-desc".equals(name)) return getApplet(child); if ("application-desc".equals(name)) return getApplication(child); if ("installer-desc".equals(name)) return getInstaller(child); child = child.getNextSibling(); } // not reached return null; } /** * @param node * @return the applet descriptor. * * @throws ParseException if the JNLP file is invalid */ private AppletDesc getApplet(Node node) throws ParseException { String name = getRequiredAttribute(node, "name", R("PUnknownApplet")); String main = getMainClass(node, true); URL docbase = getURL(node, "documentbase", base); Map paramMap = new HashMap<>(); int width = 0; int height = 0; try { width = Integer.parseInt(getRequiredAttribute(node, "width", "100")); height = Integer.parseInt(getRequiredAttribute(node, "height", "100")); } catch (NumberFormatException nfe) { if (width <= 0) throw new ParseException(R("PBadWidth")); throw new ParseException(R("PBadWidth")); } // read params Node params[] = getChildNodes(node, "param"); for (Node param : params) { paramMap.put(getRequiredAttribute(param, "name", null), getRequiredAttribute(param, "value", "")); } return new AppletDesc(name, main, docbase, width, height, paramMap); } /** * @return the application descriptor. * * @param node * @throws ParseException if the JNLP file is invalid */ private ApplicationDesc getApplication(Node node) throws ParseException { String main = getMainClass(node, false); List argsList = new ArrayList<>(); // if (main == null) // only ok if can be found in main jar file (can't check here but make a note) // read parameters Node args[] = getChildNodes(node, "argument"); for (Node arg : args) { //argsList.add( args[i].getNodeValue() ); //This approach was not finding the argument text argsList.add(getSpanText(arg)); } String argStrings[] = argsList.toArray(new String[argsList.size()]); return new ApplicationDesc(main, argStrings); } /** * @param parent * @return the component descriptor. * @throws net.sourceforge.jnlp.ParseException */ ComponentDesc getComponent(Node parent) throws ParseException { if (1 < getChildNodes(parent, "component-desc").length) { throw new ParseException(R("PTwoDescriptors")); } Node child = parent.getFirstChild(); while (child != null) { String name = child.getNodeName(); if ("component-desc".equals(name)) return new ComponentDesc(); child = child.getNextSibling(); } return null; } /** * @param node * @return the installer descriptor. */ private InstallerDesc getInstaller(Node node) { String main = getOptionalMainClass(node); return new InstallerDesc(main); } /** * @return the association descriptor. * @param node * @throws net.sourceforge.jnlp.ParseException */ private AssociationDesc getAssociation(Node node) throws ParseException { String[] extensions = getRequiredAttribute(node, "extensions", null).split(" "); String mimeType = getRequiredAttribute(node, "mime-type", null); return new AssociationDesc(mimeType, extensions); } /** * @return the shortcut descriptor. */ private ShortcutDesc getShortcut(Node node) throws ParseException { String online = getAttribute(node, "online", "true"); boolean shortcutIsOnline = Boolean.valueOf(online); boolean showOnDesktop = false; MenuDesc menu = null; // step through the elements Node child = node.getFirstChild(); while (child != null) { String name = child.getNodeName(); if (null != name) switch (name) { case "desktop": if (showOnDesktop && strict) { throw new ParseException(R("PTwoDesktops")); } showOnDesktop = true; break; case "menu": if (menu != null && strict) { throw new ParseException(R("PTwoMenus")); } menu = getMenu(child); break; } child = child.getNextSibling(); } ShortcutDesc shortcut = new ShortcutDesc(shortcutIsOnline, showOnDesktop); if (menu != null) { shortcut.setMenu(menu); } return shortcut; } /** * @return the menu descriptor. */ private MenuDesc getMenu(Node node) { String subMenu = getAttribute(node, "submenu", null); return new MenuDesc(subMenu); } /** * @return the related-content descriptor. */ private RelatedContentDesc getRelatedContent(Node node) throws ParseException { getRequiredAttribute(node, "href", null); URL location = getURL(node, "href", base); String title = null; String description = null; IconDesc icon = null; // step through the elements Node child = node.getFirstChild(); while (child != null) { String name = child.getNodeName(); if (null != name) switch (name) { case "title": if (title != null && strict) { throw new ParseException(R("PTwoTitles")); } title = getSpanText(child, false); break; case "description": if (description != null && strict) { throw new ParseException(R("PTwoDescriptions")); } description = getSpanText(child, false); break; case "icon": if (icon != null && strict) { throw new ParseException(R("PTwoIcons")); } icon = getIcon(child); break; } child = child.getNextSibling(); } RelatedContentDesc relatedContent = new RelatedContentDesc(location); relatedContent.setDescription(description); relatedContent.setIconDesc(icon); relatedContent.setTitle(title); return relatedContent; } // other methods /** * @return an array of substrings seperated by spaces (spaces * escaped with backslash do not separate strings). This method * splits strings as per the spec except that it does replace * escaped other characters with their own value. */ private String[] splitString(String source) { if (source == null) return new String[0]; List result = new ArrayList(); StringTokenizer st = new StringTokenizer(source, " "); StringBuilder part = new StringBuilder(); while (st.hasMoreTokens()) { part.setLength(0); // tack together tokens joined by backslash while (true) { part.append(st.nextToken()); if (st.hasMoreTokens() && part.charAt(part.length() - 1) == '\\') part.setCharAt(part.length() - 1, ' '); // join with the space else break; // bizarre while format gets \ at end of string right (no extra space added at end) } // delete \ quote chars for (int i = part.length(); i-- > 0;) // sweet syntax for reverse loop if (part.charAt(i) == '\\') part.deleteCharAt(i--); // and skip previous char so \\ becomes \ result.add(part.toString()); } return result.toArray(new String[result.size()]); } /** * @return the Locale object(s) from a node's locale attribute. * * @param node the node with a locale attribute */ private Locale[] getLocales(Node node) { List locales = new ArrayList<>(); String localeParts[] = splitString(getAttribute(node, "locale", "")); for (String localePart : localeParts) { Locale l = getLocale(localePart); if (l != null) locales.add(l); } return locales.toArray(new Locale[locales.size()]); } /** * Returns a {@link Locale} from a single locale. * * @param localeStr the locale string * @return locale of document */ public Locale getLocale(String localeStr) { if (localeStr.length() < 2) return null; String language = localeStr.substring(0, 2); String country = (localeStr.length() < 5) ? "" : localeStr.substring(3, 5); String variant = (localeStr.length() > 7) ? localeStr.substring(6) : ""; // null is not allowed n locale but "" is return new Locale(language, country, variant); } // XML junk /** * Returns the implied text under a node, for example "text" in * "<description>text</description>". * * @param node the node with text under it * @return * @throws ParseException if the JNLP file is invalid */ private String getSpanText(Node node) throws ParseException { return getSpanText(node, true); } /** * Returns the implied text under a node, for example "text" in * "<description>text</description>". If preserveSpacing is false, * sequences of whitespace characters are turned into a single * space character. * * @param node the node with text under it * @param preserveSpacing if true, preserve whitespace * @throws ParseException if the JNLP file is invalid */ private String getSpanText(Node node, boolean preserveSpacing) throws ParseException { if (node == null) return null; // NANO String val = node.getNodeValue(); if (preserveSpacing) { return val; } else { if (val == null) { return null; } else { return val.replaceAll("\\s+", " "); } } /* TINY Node child = node.getFirstChild(); if (child == null) { if (strict) // not sure if this is an error or whether "" is proper throw new ParseException("No text specified (node="+node.getNodeName()+")"); else return ""; } return child.getNodeValue(); */ } /** * Returns the first child node with the specified name. */ private static Node getChildNode(Node node, String name) { Node[] result = getChildNodes(node, name); if (result.length == 0) return null; else return result[0]; } /** * Returns all child nodes with the specified name. */ private static Node[] getChildNodes(Node node, String name) { List result = new ArrayList<>(); Node child = node.getFirstChild(); while (child != null) { if (child.getNodeName().equals(name)) result.add(child); child = child.getNextSibling(); } return result.toArray(new Node[result.size()]); } /** * Returns a URL with a trailing / appended to it if there is no * trailing slash on the specifed URL. */ private URL addSlash(URL source) { if (source == null) return null; if (!source.toString().endsWith("/")) { try { source = new URL(source.toString() + "/"); } catch (MalformedURLException ex) { } } return source; } /** * @return the same result as getURL except that a * ParseException is thrown if the attribute is null or empty. * * @param node the node * @param name the attribute containing an href * @param base the base URL * @throws ParseException if the JNLP file is invalid */ private URL getRequiredURL(Node node, String name, URL base) throws ParseException { // probably should change "" to null so that url is always // required even if !strict getRequiredAttribute(node, name, ""); return getURL(node, name, base); } /** * @return a URL object from a href string relative to the * code base. If the href denotes a relative URL, it must * reference a location that is a subdirectory of the * codebase. * * @param node the node * @param name the attribute containing an href * @param base the base URL * @throws ParseException if the JNLP file is invalid */ URL getURL(Node node, String name, URL base) throws ParseException { String href; if (CODEBASE.equals(name)) { href = getCleanAttribute(node, name); //in case of null code can throw an exception later //some bogus jnlps have codebase as "" and expect it behaving as "." if (href != null && href.trim().isEmpty()) { href = "."; } } else { href = getAttribute(node, name, null); } return getURL(href, node.getNodeName(), base, strict); } public static URL getURL(String href, String nodeName, URL base, boolean strict) throws ParseException { if (href == null) { return null; // so that code can throw an exception if attribute was required } try { if (base == null) return new URL(href); else { try { return new URL(href); } catch (MalformedURLException ex) { // is relative } URL result = new URL(base, href); // check for going above the codebase if (!result.toString().startsWith(base.toString()) && !base.toString().startsWith(result.toString())){ if (strict) { throw new ParseException(R("PUrlNotInCodebase", nodeName, href, base)); } } return result; } } catch (MalformedURLException ex) { if (base == null) throw new ParseException(R("PBadNonrelativeUrl", nodeName, href)); else throw new ParseException(R("PBadRelativeUrl", nodeName, href, base)); } } /** * @return a Version from the specified attribute and default * value. * * @param node the node * @param name the attribute * @param defaultValue default if no such attribute * @return a Version, or null if no such attribute and default is null */ private Version getVersion(Node node, String name, String defaultValue) { String version = getAttribute(node, name, defaultValue); if (version == null) return null; else return new Version(version); } /** * Check that the VM args are valid and safe * @param vmArgs a string containing the args * @throws ParseException if the VM arguments are invalid or dangerous */ private void checkVMArgs(String vmArgs) throws IllegalArgumentException { if (vmArgs == null) { return; } List validArguments = Arrays.asList(getValidVMArguments()); List validStartingArguments = Arrays.asList(getValidStartingVMArguments()); String[] arguments = vmArgs.split(" "); boolean argumentIsValid; for (String argument : arguments) { argumentIsValid = false; if (validArguments.contains(argument)) { argumentIsValid = true; } else { for (String validStartingArgument : validStartingArguments) { if (argument.startsWith(validStartingArgument)) { argumentIsValid = true; break; } } } if (!argumentIsValid) { throw new IllegalArgumentException(argument); } } } /** * Returns an array of valid (ie safe and supported) arguments for the JVM * * Based on http://java.sun.com/javase/6/docs/technotes/guides/javaws/developersguide/syntax.html */ private String[] getValidVMArguments() { return new String[] { "-d32", /* use a 32-bit data model if available */ "-client", /* to select the client VM */ "-server", /* to select the server VM */ "-verbose", /* enable verbose output */ "-version", /* print product version and exit */ "-showversion", /* print product version and continue */ "-help", /* print this help message */ "-X", /* print help on non-standard options */ "-ea", /* enable assertions */ "-enableassertions", /* enable assertions */ "-da", /* disable assertions */ "-disableassertions", /* disable assertions */ "-esa", /* enable system assertions */ "-enablesystemassertions", /* enable system assertions */ "-dsa", /* disable system assertione */ "-disablesystemassertions", /* disable system assertione */ "-Xmixed", /* mixed mode execution (default) */ "-Xint", /* interpreted mode execution only */ "-Xnoclassgc", /* disable class garbage collection */ "-Xincgc", /* enable incremental garbage collection */ "-Xbatch", /* disable background compilation */ "-Xprof", /* output cpu profiling data */ "-Xdebug", /* enable remote debugging */ "-Xfuture", /* enable strictest checks, anticipating future default */ "-Xrs", /* reduce use of OS signals by Java/VM (see documentation) */ "-XX:+ForceTimeHighResolution", /* use high resolution timer */ "-XX:-ForceTimeHighResolution", /* use low resolution (default) */ }; } /** * Returns an array containing the starts of valid (ie safe and supported) * arguments for the JVM * * Based on http://java.sun.com/javase/6/docs/technotes/guides/javaws/developersguide/syntax.html */ private String[] getValidStartingVMArguments() { return new String[] { "-ea", /* enable assertions for classes */ "-enableassertions", /* enable assertions for classes */ "-da", /* disable assertions for classes */ "-disableassertions", /* disable assertions for classes */ "-verbose", /* enable verbose output */ "-Xms", /* set initial Java heap size */ "-Xmx", /* set maximum Java heap size */ "-Xss", /* set java thread stack size */ "-XX:NewRatio", /* set Ratio of new/old gen sizes */ "-XX:NewSize", /* set initial size of new generation */ "-XX:MaxNewSize", /* set max size of new generation */ "-XX:PermSize", /* set initial size of permanent gen */ "-XX:MaxPermSize", /* set max size of permanent gen */ "-XX:MaxHeapFreeRatio", /* heap free percentage (default 70) */ "-XX:MinHeapFreeRatio", /* heap free percentage (default 40) */ "-XX:UseSerialGC", /* use serial garbage collection */ "-XX:ThreadStackSize", /* thread stack size (in KB) */ "-XX:MaxInlineSize", /* set max num of bytecodes to inline */ "-XX:ReservedCodeCacheSize", /* Reserved code cache size (bytes) */ "-XX:MaxDirectMemorySize", }; } /** * @return the same result as getAttribute except that if strict * mode is enabled or the default value is null a parse * exception is thrown instead of returning the default value. * * @param node the node * @param name the attribute * @param defaultValue default value * @throws ParseException if the attribute does not exist or is empty */ private String getRequiredAttribute(Node node, String name, String defaultValue) throws ParseException { String result = getAttribute(node, name, null); if (result == null || result.length() == 0) if (strict || defaultValue == null) throw new ParseException(R("PNeedsAttribute", node.getNodeName(), name)); if (result == null) return defaultValue; else return result; } /** * @return an attribute or the specified defaultValue if there is * no such attribute. * * @param node the node * @param name the attribute * @param defaultValue default if no such attribute */ private String getAttribute(Node node, String name, String defaultValue) { // SAX // String result = ((Element) node).getAttribute(name); String result = getCleanAttribute(node, name); if (result == null || result.length() == 0) { return defaultValue; } return result; } private String getCleanAttribute(Node node, String name) { String result = node.getAttribute(name); return result; } public static final String MALFORMED_PARSER_CLASS = "net.sourceforge.jnlp.MalformedXMLParser"; public static final String NORMAL_PARSER_CLASS = "net.sourceforge.jnlp.XMLParser"; /** * @return the root node from the XML document in the specified * input stream. * * @throws ParseException if the JNLP file is invalid */ static Node getRootNode(InputStream input, ParserSettings settings) throws ParseException { try { Object parser = getParserInstance(settings); Method m = parser.getClass().getMethod("getRootNode", InputStream.class); return (Node) m.invoke(parser, input); } catch (InvocationTargetException e) { if (e.getCause() instanceof ParseException) { throw (ParseException)(e.getCause()); } throw new ParseException(R("PBadXML"), e); } catch (Exception e) { throw new ParseException(R("PBadXML"), e); } } public static Object getParserInstance(ParserSettings settings) throws ClassNotFoundException, IllegalAccessException, InstantiationException { String className; if (settings.isMalformedXmlAllowed()) { className = MALFORMED_PARSER_CLASS; ParseException.setExpected(ParseException.UsedParsers.MALFORMED); } else { className = NORMAL_PARSER_CLASS; ParseException.setExpected(ParseException.UsedParsers.NORMAL); } Class klass; Object instance; try { klass = Class.forName(className); instance = klass.newInstance(); //catch both, for case that tagsoup was removed after build } catch (ClassNotFoundException | NoClassDefFoundError | InstantiationException e) { OutputController.getLogger().log(e); klass = Class.forName(NORMAL_PARSER_CLASS); instance = klass.newInstance(); } switch (instance.getClass().getName()) { case MALFORMED_PARSER_CLASS: ParseException.setUsed(ParseException.UsedParsers.MALFORMED); break; case NORMAL_PARSER_CLASS: ParseException.setUsed(ParseException.UsedParsers.NORMAL); break; } return instance; } private String getOptionalMainClass(Node node) { try { return getMainClass(node, false); } catch (ParseException ex) { //only getRequiredAttribute can throw this //and as there is call to getMainClass with required false //it is not going to be thrown OutputController.getLogger().log(ex); return null; } } private String getMainClass(Node node, boolean required) throws ParseException { String main; if (required) { main = getRequiredAttribute(node, MAINCLASS, null); } else { main = getAttribute(node, MAINCLASS, null); } return cleanMainClassAttribute(main); } private String cleanMainClassAttribute(String main) throws ParseException { if (main != null) { Matcher matcher = anyWhiteSpace.matcher(main); boolean found = matcher.find(); if (found && !strict) { OutputController.getLogger().log(OutputController.Level.WARNING_ALL, "Warning! main-class contains whitespace - '" + main + "'"); main = main.trim(); OutputController.getLogger().log(OutputController.Level.WARNING_ALL, "Trimmed - '" + main + "'"); } boolean valid = true; if (!Character.isJavaIdentifierStart(main.charAt(0))) { valid = false; OutputController.getLogger().log(OutputController.Level.MESSAGE_DEBUG, "Invlaid char in main-class: '" + main.charAt(0) + "'"); } for (int i = 1; i < main.length(); i++) { if (main.charAt(i)=='.'){ //dot connects identifiers continue; } if (!Character.isJavaIdentifierPart(main.charAt(i))) { valid = false; OutputController.getLogger().log(OutputController.Level.MESSAGE_DEBUG, "Invlaid char in main-class: '" + main.charAt(i) + "'"); } } if (!valid) { OutputController.getLogger().log(OutputController.Level.WARNING_ALL, "main-class contains invalid characters - '" + main + "'. Check with vendor."); if (strict) { throw new ParseException("main-class contains invalid characters - '" + main + "'. Check with vendor. You are in strict mode. This is fatal."); } } } return main; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/ParseException.java0000644000000000000000000000013112654402377024272 xustar0030 mtime=1454507263.253432368 30 atime=1454507327.125580523 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/ParseException.java0000644000175000002070000000560312654402377025022 0ustar00jvanekmock00000000000000// Copyright (C) 2001-2003 Jon A. Maxwell (JAM) // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.runtime.Translator; /** * Thrown to indicate that an error has occurred while parsing a * JNLP file. * * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.7 $ */ public class ParseException extends Exception { // todo: add meaningful information, such as the invalid // element, parse position, etc. /** * Create a parse exception with the specified message. * @param message to be shown in exception */ public ParseException(String message) { super(getParserSettingsMessage() + message); } /** * Create a parse exception with the specified message and * cause. * @param message to be used by exception * @param cause cause of exception */ public ParseException(String message, Throwable cause) { super(getParserSettingsMessage() + message, cause); } public ParseException(Throwable cause) { super(getParserSettingsMessage(), cause); } static enum UsedParsers { MALFORMED, NORMAL } private static UsedParsers expected; private static UsedParsers used; static void setExpected(UsedParsers ex) { expected = ex; } static void setUsed(UsedParsers us) { used = us; } private static String getParserSettingsMessage() { final String tail = "" + " " + Translator.R("TAGSOUPtail") + " "; if (expected == UsedParsers.NORMAL && used == UsedParsers.NORMAL) { //warn about xml mode return Translator.R("TAGSOUPnotUsed", OptionsDefinitions.OPTIONS.XML.option)+tail; } if (expected == UsedParsers.MALFORMED && used != UsedParsers.MALFORMED) { //warn about TagSoup return Translator.R("TAGSOUPbroken") + tail; } if (JNLPRuntime.isDebug()) { return expected + " " + used + "; "; } else { return ""; } } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/PackageDesc.java0000644000000000000000000000013112654402377023473 xustar0030 mtime=1454507263.253432368 30 atime=1454507327.125580523 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PackageDesc.java0000644000175000002070000000517112654402377024223 0ustar00jvanekmock00000000000000// Copyright (C) 2001-2003 Jon A. Maxwell (JAM) // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp; /** * The package element. * * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.6 $ */ public class PackageDesc { /** the package name */ private final String name; /** the part required by the package */ private final String part; /** whether the package includes subpackages */ private final boolean recursive; /** * Create a package descriptor. * * @param name the package name * @param part the part required by the package * @param recursive whether the package includes subpackages */ public PackageDesc(String name, String part, boolean recursive) { this.name = name; this.part = part; this.recursive = recursive; } /** * @return whether the specified class is part of this package. * * @param className the fully qualified class name */ public boolean matches(String className) { // form 1: exact class if (name.equals(className)) return true; // form 2: package.* if (name.endsWith(".*")) { String pkName = name.substring(0, name.length() - 1); if (className.startsWith(pkName)) { String postfix = className.substring(pkName.length() + 1); if (recursive || -1 == postfix.indexOf(".")) return true; } } return false; } /** * @return the package name. */ public String getName() { return name; } /** * @return the part name. */ public String getPart() { return part; } /** * @return whether subpackages should be matched by this * package. */ public boolean isRecursive() { return recursive; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/OptionsDefinitions.java0000644000000000000000000000013112654402377025170 xustar0030 mtime=1454507263.253432368 30 atime=1454507327.125580523 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/OptionsDefinitions.java0000644000175000002070000001756512654402377025732 0ustar00jvanekmock00000000000000/* Copyright (C) 2008 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import static net.sourceforge.jnlp.runtime.Translator.R; public class OptionsDefinitions { public static enum OPTIONS { //javaws undocummented swithces TRUSTALL("-Xtrustall","BOTrustall"), //javaws control-options ABOUT("-about", "BOAbout"), VIEWER("-viewer", "BOViewer"), CLEARCACHE("-Xclearcache", "BXclearcache"), LICENSE("-license", "BOLicense"), HELP1("-help", "BOHelp1"), //javaws run-options VERSION("-version", "BOVersion"), ARG("-arg", "arg", "BOArg", NumberOfArguments.ONE_OR_MORE), PARAM("-param", "name=value", "BOParam", NumberOfArguments.ONE_OR_MORE), PROPERTY("-property", "name=value", "BOProperty", NumberOfArguments.ONE_OR_MORE), UPDATE("-update", "seconds", "BOUpdate", NumberOfArguments.ONE), VERBOSE("-verbose", "BOVerbose"), DETAILS("-details", "BOVerbose"), //backward compatibility for itweb settings NOSEC("-nosecurity", "BONosecurity"), NOUPDATE("-noupdate", "BONoupdate"), HEADLESS("-headless", "BOHeadless"), STRICT("-strict", "BOStrict"), XML("-xml", "BOXml"), REDIRECT("-allowredirect", "BOredirect"), NOFORK("-Xnofork", "BXnofork"), NOHEADERS("-Xignoreheaders", "BXignoreheaders"), OFFLINE("-Xoffline", "BXoffline"), TRUSTNONE("-Xtrustnone","BOTrustnone"), JNLP("-jnlp","BOJnlp", NumberOfArguments.ONE), HTML("-html","BOHtml", NumberOfArguments.ONE_OR_MORE), //itweb settings LIST("-list", "IBOList"), GET("-get", "name", "IBOGet", NumberOfArguments.ONE_OR_MORE), INFO("-info", "name", "IBOInfo", NumberOfArguments.ONE_OR_MORE), SET("-set", "name value", "IBOSet", NumberOfArguments.EVEN_NUMBER_SUPPORTS_EQUALS_CHAR), RESETALL("-reset", "all", "IBOResetAll"), RESET("-reset", "name", "IBOReset", NumberOfArguments.ONE_OR_MORE), CHECK("-check", "name", "IBOCheck"), HELP2("-help", "BOHelp2"), //policyeditor //-help FILE("-file", "policy_file", "PBOFile", NumberOfArguments.ONE), DEFAULTFILE("-defaultfile", "PBODefaultFile"), CODEBASE("-codebase", "url", "PBOCodebase", NumberOfArguments.ONE_OR_MORE), ; public final String option; public final String helperString; public final String decriptionKey; private final NumberOfArguments numberOfArguments; OPTIONS(String option, String helperString, String decriptionKey, NumberOfArguments numberOfArguments) { this.decriptionKey = decriptionKey; this.option = option; this.helperString = helperString; this.numberOfArguments = numberOfArguments; } OPTIONS(String option, String helperString, String decriptionKey) { this(option, helperString, decriptionKey, NumberOfArguments.NONE); } OPTIONS(String option, String decriptionKey, NumberOfArguments numberOfArguments) { this(option, "", decriptionKey, numberOfArguments); } OPTIONS(String option, String decriptionKey) { this(option, "", decriptionKey); } public String getLocalizedDescription() { return R(decriptionKey); } public boolean hasNoArguments() { return numberOfArguments == NumberOfArguments.NONE; } public boolean hasEvenNumberSupportingEqualsChar() { return numberOfArguments == NumberOfArguments.EVEN_NUMBER_SUPPORTS_EQUALS_CHAR; } public boolean hasOneOrMoreArguments() { return numberOfArguments == NumberOfArguments.ONE_OR_MORE; } public boolean hasOneArgument() { return numberOfArguments == NumberOfArguments.ONE; } public String getArgumentExplanation() { return numberOfArguments.getMessage(); } } private enum NumberOfArguments { NONE("NOAnone"), ONE("NOAone"), ONE_OR_MORE("NOAonemore"), EVEN_NUMBER_SUPPORTS_EQUALS_CHAR("NOAevennumber"); String messageKey; NumberOfArguments(String messageKey) { this.messageKey = messageKey; } public String getMessage() { return R(messageKey); } } public static List getItwsettingsCommands() { return Arrays.asList(new OPTIONS[]{ OPTIONS.HELP2, OPTIONS.LIST, OPTIONS.GET, OPTIONS.INFO, OPTIONS.SET, OPTIONS.RESET, OPTIONS.RESETALL, OPTIONS.HEADLESS, OPTIONS.CHECK, OPTIONS.VERBOSE }); } public static List getPolicyEditorOptions() { return Arrays.asList(new OPTIONS[]{ OPTIONS.HELP1, OPTIONS.DEFAULTFILE, OPTIONS.FILE, OPTIONS.CODEBASE, OPTIONS.VERBOSE } ); } public static List getJavaWsControlOptions() { return Arrays.asList(new OPTIONS[]{ OPTIONS.ABOUT, OPTIONS.VIEWER, OPTIONS.CLEARCACHE, OPTIONS.LICENSE, OPTIONS.HELP1} ); } public static List getJavaWsRuntimeOptions() { return Arrays.asList(new OPTIONS[]{ OPTIONS.VERSION, OPTIONS.ARG, OPTIONS.PARAM, OPTIONS.PROPERTY, OPTIONS.UPDATE, OPTIONS.VERBOSE, OPTIONS.NOSEC, OPTIONS.NOUPDATE, OPTIONS.HEADLESS, OPTIONS.STRICT, OPTIONS.XML, OPTIONS.REDIRECT, OPTIONS.NOFORK, OPTIONS.NOHEADERS, OPTIONS.OFFLINE, OPTIONS.TRUSTNONE, OPTIONS.JNLP, OPTIONS.HTML }); } public static List getJavaWsOptions() { List l = new ArrayList<>(); l.addAll(getJavaWsRuntimeOptions()); l.addAll(getJavaWsControlOptions()); //trustall is not returned by getJavaWsRuntimeOptions //or getJavaWsControlOptions, as it is not desired in documentation l.add(OPTIONS.TRUSTALL); return l; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/NullJnlpFileException.java0000644000000000000000000000013112654402377025556 xustar0030 mtime=1454507263.253432368 30 atime=1454507327.124580537 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/NullJnlpFileException.java0000644000175000002070000000350012654402377026300 0ustar00jvanekmock00000000000000package net.sourceforge.jnlp; /* Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class NullJnlpFileException extends NullPointerException { public NullJnlpFileException() { super(); } public NullJnlpFileException(String s) { super(s); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/util0000644000000000000000000000013112654402377021376 xustar0030 mtime=1454507263.269432154 30 atime=1454507658.779157357 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/0000755000175000002070000000000012654402377022177 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/PaxHeaders.17941/ui0000644000000000000000000000013112654402377022013 xustar0030 mtime=1454507263.269432154 30 atime=1454507658.779157357 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/ui/0000755000175000002070000000000012654402377022614 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/ui/PaxHeaders.17941/package-info.java0000644000000000000000000000013012654402377025256 xustar0030 mtime=1454507263.269432154 29 atime=1454507327.16857995 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/ui/package-info.java0000644000175000002070000000362412654402377026010 0ustar00jvanekmock00000000000000/* package-info.java Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.*/ /** * Contains classes that deal with common and recurring UI tasks. *

    * NOTE: Before adding new self-sufficient {@code public static} methods * to this package please evaluate thier suitability for {@link UI} first.

    * @since IcedTea-Web 1.5 */ package net.sourceforge.jnlp.util.ui; icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/ui/PaxHeaders.17941/NonEditableTableModel.java0000644000000000000000000000013112654402377027050 xustar0030 mtime=1454507263.269432154 30 atime=1454507327.167579963 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/ui/NonEditableTableModel.java0000644000175000002070000001203612654402377027576 0ustar00jvanekmock00000000000000/* NonEditableTableModel.java Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util.ui; import java.util.Vector; import javax.swing.table.DefaultTableModel; /** * A table model that in effect is a {@link DefaultTableModel} except for no * cell being editable. * @see DefaultTableModel * @since IcedTea-Web 1.5 */ public class NonEditableTableModel extends DefaultTableModel { /** * Constructs a {@link javax.swing.table.TableModel} that serves only one * purpose: make cells of certificate tables not editable. * @see DefaultTableModel#DefaultTableModel() */ public NonEditableTableModel() { super(); } /** * Constructs a {@link javax.swing.table.TableModel} that serves only one * purpose: make cells of certificate tables not editable. * @param rowCount the number of rows the table holds * @param columnCount the number of columns the table holds * @see DefaultTableModel#DefaultTableModel(int,int) */ public NonEditableTableModel(final int rowCount, final int columnCount) { super(rowCount, columnCount); } /** * Constructs a {@link javax.swing.table.TableModel} that serves only one * purpose: make cells of certificate tables not editable. * @param data the data of the table * @param columnNames the names of the columns * @see DefaultTableModel#DefaultTableModel(Object[][],Object[]) */ public NonEditableTableModel(final Object[][] data, final Object[] columnNames) { super(data, columnNames); } /** * Constructs a {@link javax.swing.table.TableModel} that serves only one * purpose: make cells of certificate tables not editable. * @param columnNames {@code array} containing the names of the new columns; * if this is {@code null} then the model has no columns * @param rowCount the number of rows the table holds * @see DefaultTableModel#DefaultTableModel(Object[],int) */ public NonEditableTableModel(final Object[] columnNames, final int rowCount) { super(columnNames, rowCount); } /** * Constructs a {@link javax.swing.table.TableModel} that serves only one * purpose: make cells of certificate tables not editable. * @param columnNames {@code vector} containing the names of the new columns; * if this is {@code null} then the model has no columns * @param rowCount the number of rows the table holds * @see DefaultTableModel#DefaultTableModel(Vector,int) */ public NonEditableTableModel(final Vector columnNames, final int rowCount) { super(columnNames, rowCount); } /** * Constructs a {@link javax.swing.table.TableModel} that serves only one * purpose: make cells of certificate tables not editable. * @param data the data of the table, a {@code Vector} of {@code Vector}s * of {@code Object} values * @param columnNames {@code vector} containing the names of the new columns * @see DefaultTableModel#DefaultTableModel(Vector,Vector) */ public NonEditableTableModel(final Vector data, final Vector columnNames) { super(data, columnNames); } /** * This method always returns {@code false} to make the table's cells not * editable. * @param row the row whose value to be queried * @param column the column whose value to be queried * @return always {@code false} */ @Override public boolean isCellEditable(final int row, final int column) { return false; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/PaxHeaders.17941/replacements0000644000000000000000000000013112654402377024060 xustar0030 mtime=1454507263.269432154 30 atime=1454507658.779157357 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/replacements/0000755000175000002070000000000012654402377024661 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/replacements/PaxHeaders.17941/CharacterEncoder.java0000644000000000000000000000013112654402377030174 xustar0030 mtime=1454507263.269432154 30 atime=1454507327.167579963 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/replacements/CharacterEncoder.java0000644000175000002070000002773012654402377030731 0ustar00jvanekmock00000000000000/* * Copyright (c) 1995, 2005, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package net.sourceforge.jnlp.util.replacements; import java.io.InputStream; import java.io.ByteArrayInputStream; import java.io.OutputStream; import java.io.ByteArrayOutputStream; import java.io.PrintStream; import java.io.IOException; import java.nio.ByteBuffer; /** * This class defines the encoding half of character encoders. * A character encoder is an algorithim for transforming 8 bit binary * data into text (generally 7 bit ASCII or 8 bit ISO-Latin-1 text) * for transmition over text channels such as e-mail and network news. *

    * The character encoders have been structured around a central theme * that, in general, the encoded text has the form: *

    
     *      [Buffer Prefix]
     *      [Line Prefix][encoded data atoms][Line Suffix]
     *      [Buffer Suffix]
     * 
    *

    *

    * In the {@code CharacterEncoder} and {@link CharacterDecoder} * classes, one complete chunk of data is referred to as a * buffer. Encoded buffers are all text, and decoded buffers * (sometimes just referred to as buffers) are binary octets. *

    *

    * To create a custom encoder, you must, at a minimum, overide three * abstract methods in this class. *

    *
    bytesPerAtom which tells the encoder how many bytes to * send to encodeAtom *
    encodeAtom which encodes the bytes sent to it as text. *
    bytesPerLine which tells the encoder the maximum number of * bytes per line. *
    *

    *

    * Several useful encoders have already been written and are * referenced in the See Also list below. *

    * @author Chuck McManis * @see CharacterDecoder * @see BASE64Encoder */ public abstract class CharacterEncoder { /** Stream that understands "printing" */ protected PrintStream pStream; /** Return the number of bytes per atom of encoding */ abstract protected int bytesPerAtom(); /** Return the number of bytes that can be encoded per line */ abstract protected int bytesPerLine(); /** * Encode the prefix for the entire buffer. By default is simply * opens the PrintStream for use by the other functions. */ protected void encodeBufferPrefix(OutputStream aStream) throws IOException { pStream = new PrintStream(aStream); } /** * Encode the suffix for the entire buffer. */ protected void encodeBufferSuffix(OutputStream aStream) throws IOException { } /** * Encode the prefix that starts every output line. */ protected void encodeLinePrefix(OutputStream aStream, int aLength) throws IOException { } /** * Encode the suffix that ends every output line. By default * this method just prints a into the output stream. */ protected void encodeLineSuffix(OutputStream aStream) throws IOException { pStream.println(); } /** Encode one "atom" of information into characters. */ abstract protected void encodeAtom(OutputStream aStream, byte someBytes[], int anOffset, int aLength) throws IOException; /** * This method works around the bizarre semantics of BufferedInputStream's * read method. */ protected int readFully(InputStream in, byte buffer[]) throws java.io.IOException { for (int i = 0; i < buffer.length; i++) { int q = in.read(); if (q == -1) return i; buffer[i] = (byte)q; } return buffer.length; } /** * Encode bytes from the input stream, and write them as text characters * to the output stream. This method will run until it exhausts the * input stream, but does not print the line suffix for a final * line that is shorter than bytesPerLine(). */ public void encode(InputStream inStream, OutputStream outStream) throws IOException { int j; int numBytes; byte tmpbuffer[] = new byte[bytesPerLine()]; encodeBufferPrefix(outStream); while (true) { numBytes = readFully(inStream, tmpbuffer); if (numBytes == 0) { break; } encodeLinePrefix(outStream, numBytes); for (j = 0; j < numBytes; j += bytesPerAtom()) { if ((j + bytesPerAtom()) <= numBytes) { encodeAtom(outStream, tmpbuffer, j, bytesPerAtom()); } else { encodeAtom(outStream, tmpbuffer, j, (numBytes)- j); } } if (numBytes < bytesPerLine()) { break; } else { encodeLineSuffix(outStream); } } encodeBufferSuffix(outStream); } /** * Encode the buffer in aBuffer and write the encoded * result to the OutputStream aStream. */ public void encode(byte aBuffer[], OutputStream aStream) throws IOException { ByteArrayInputStream inStream = new ByteArrayInputStream(aBuffer); encode(inStream, aStream); } /** * A 'streamless' version of encode that simply takes a buffer of * bytes and returns a string containing the encoded buffer. */ public String encode(byte aBuffer[]) { ByteArrayOutputStream outStream = new ByteArrayOutputStream(); ByteArrayInputStream inStream = new ByteArrayInputStream(aBuffer); String retVal = null; try { encode(inStream, outStream); // explicit ascii->unicode conversion retVal = outStream.toString("8859_1"); } catch (Exception IOException) { // This should never happen. throw new Error("CharacterEncoder.encode internal error"); } return (retVal); } /** * Return a byte array from the remaining bytes in this ByteBuffer. *

    * The ByteBuffer's position will be advanced to ByteBuffer's limit. *

    *

    * To avoid an extra copy, the implementation will attempt to return the * byte array backing the ByteBuffer. If this is not possible, a * new byte array will be created. *

    */ private byte [] getBytes(ByteBuffer bb) { /* * This should never return a BufferOverflowException, as we're * careful to allocate just the right amount. */ byte [] buf = null; /* * If it has a usable backing byte buffer, use it. Use only * if the array exactly represents the current ByteBuffer. */ if (bb.hasArray()) { byte [] tmp = bb.array(); if ((tmp.length == bb.capacity()) && (tmp.length == bb.remaining())) { buf = tmp; bb.position(bb.limit()); } } if (buf == null) { /* * This class doesn't have a concept of encode(buf, len, off), * so if we have a partial buffer, we must reallocate * space. */ buf = new byte[bb.remaining()]; /* * position() automatically updated */ bb.get(buf); } return buf; } /** * Encode the aBuffer ByteBuffer and write the encoded * result to the OutputStream aStream. *

    * The ByteBuffer's position will be advanced to ByteBuffer's limit. *

    */ public void encode(ByteBuffer aBuffer, OutputStream aStream) throws IOException { byte [] buf = getBytes(aBuffer); encode(buf, aStream); } /** * A 'streamless' version of encode that simply takes a ByteBuffer * and returns a string containing the encoded buffer. *

    * The ByteBuffer's position will be advanced to ByteBuffer's limit. *

    */ public String encode(ByteBuffer aBuffer) { byte [] buf = getBytes(aBuffer); return encode(buf); } /** * Encode bytes from the input stream, and write them as text characters * to the output stream. This method will run until it exhausts the * input stream. It differs from encode in that it will add the * line at the end of a final line that is shorter than bytesPerLine(). */ public void encodeBuffer(InputStream inStream, OutputStream outStream) throws IOException { int j; int numBytes; byte tmpbuffer[] = new byte[bytesPerLine()]; encodeBufferPrefix(outStream); while (true) { numBytes = readFully(inStream, tmpbuffer); if (numBytes == 0) { break; } encodeLinePrefix(outStream, numBytes); for (j = 0; j < numBytes; j += bytesPerAtom()) { if ((j + bytesPerAtom()) <= numBytes) { encodeAtom(outStream, tmpbuffer, j, bytesPerAtom()); } else { encodeAtom(outStream, tmpbuffer, j, (numBytes)- j); } } encodeLineSuffix(outStream); if (numBytes < bytesPerLine()) { break; } } encodeBufferSuffix(outStream); } /** * Encode the buffer in aBuffer and write the encoded * result to the OutputStream aStream. */ public void encodeBuffer(byte aBuffer[], OutputStream aStream) throws IOException { ByteArrayInputStream inStream = new ByteArrayInputStream(aBuffer); encodeBuffer(inStream, aStream); } /** * A 'streamless' version of encode that simply takes a buffer of * bytes and returns a string containing the encoded buffer. */ public String encodeBuffer(byte aBuffer[]) { ByteArrayOutputStream outStream = new ByteArrayOutputStream(); ByteArrayInputStream inStream = new ByteArrayInputStream(aBuffer); try { encodeBuffer(inStream, outStream); } catch (Exception IOException) { // This should never happen. throw new Error("CharacterEncoder.encodeBuffer internal error"); } return (outStream.toString()); } /** * Encode the aBuffer ByteBuffer and write the encoded * result to the OutputStream aStream. *

    * The ByteBuffer's position will be advanced to ByteBuffer's limit. *

    */ public void encodeBuffer(ByteBuffer aBuffer, OutputStream aStream) throws IOException { byte [] buf = getBytes(aBuffer); encodeBuffer(buf, aStream); } /** * A 'streamless' version of encode that simply takes a ByteBuffer * and returns a string containing the encoded buffer. *

    * The ByteBuffer's position will be advanced to ByteBuffer's limit. *

    */ public String encodeBuffer(ByteBuffer aBuffer) { byte [] buf = getBytes(aBuffer); return encodeBuffer(buf); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/replacements/PaxHeaders.17941/CharacterDecoder.java0000644000000000000000000000013112654402377030162 xustar0030 mtime=1454507263.268432167 30 atime=1454507327.167579963 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/replacements/CharacterDecoder.java0000644000175000002070000002061512654402377030712 0ustar00jvanekmock00000000000000/* * Copyright (c) 1995, 2004, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package net.sourceforge.jnlp.util.replacements; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.PushbackInputStream; import java.nio.ByteBuffer; /** * This class defines the decoding half of character encoders. * A character decoder is an algorithim for transforming 8 bit * binary data that has been encoded into text by a character * encoder, back into original binary form. *

    * The character encoders, in general, have been structured * around a central theme that binary data can be encoded into * text that has the form: *

    
     *      [Buffer Prefix]
     *      [Line Prefix][encoded data atoms][Line Suffix]
     *      [Buffer Suffix]
     * 
    *

    *

    * Of course in the simplest encoding schemes, the buffer has no * distinct prefix of suffix, however all have some fixed relationship * between the text in an 'atom' and the binary data itself. *

    *

    * In the {@link CharacterEncoder} and {@code CharacterDecoder} * classes, one complete chunk of data is referred to as a * buffer. Encoded buffers are all text, and decoded buffers * (sometimes just referred to as buffers) are binary octets. *

    *

    * To create a custom decoder, you must, at a minimum, overide three * abstract methods in this class. *

    *
    *
    bytesPerAtom which tells the decoder how many bytes to * expect from decodeAtom *
    decodeAtom which decodes the bytes sent to it as text. *
    bytesPerLine which tells the encoder the maximum number of * bytes per line. *
    *

    * In general, the character decoders return error in the form of a * CEFormatException. The syntax of the detail string is *

    
     *      DecoderClassName: Error message.
     * 
    *

    * Several useful decoders have already been written and are * referenced in the See Also list below. *

    * @author Chuck McManis * @see CharacterEncoder * @see BASE64Decoder */ public abstract class CharacterDecoder { /** This exception is thrown when EOF is reached */ protected static class CEStreamExhausted extends IOException { }; /** Return the number of bytes per atom of decoding */ abstract protected int bytesPerAtom(); /** Return the maximum number of bytes that can be encoded per line */ abstract protected int bytesPerLine(); /** decode the beginning of the buffer, by default this is a NOP. */ protected void decodeBufferPrefix(PushbackInputStream aStream, OutputStream bStream) throws IOException { } /** decode the buffer suffix, again by default it is a NOP. */ protected void decodeBufferSuffix(PushbackInputStream aStream, OutputStream bStream) throws IOException { } /** * This method should return, if it knows, the number of bytes * that will be decoded. Many formats such as uuencoding provide * this information. By default we return the maximum bytes that * could have been encoded on the line. */ protected int decodeLinePrefix(PushbackInputStream aStream, OutputStream bStream) throws IOException { return (bytesPerLine()); } /** * This method post processes the line, if there are error detection * or correction codes in a line, they are generally processed by * this method. The simplest version of this method looks for the * (newline) character. */ protected void decodeLineSuffix(PushbackInputStream aStream, OutputStream bStream) throws IOException { } /** * This method does an actual decode. It takes the decoded bytes and * writes them to the OutputStream. The integer l tells the * method how many bytes are required. This is always <= bytesPerAtom(). */ protected void decodeAtom(PushbackInputStream aStream, OutputStream bStream, int l) throws IOException { throw new CEStreamExhausted(); } /** * This method works around the bizarre semantics of BufferedInputStream's * read method. */ protected int readFully(InputStream in, byte buffer[], int offset, int len) throws java.io.IOException { for (int i = 0; i < len; i++) { int q = in.read(); if (q == -1) { return ((i == 0) ? -1 : i); } buffer[i+offset] = (byte)q; } return len; } /** * Decode the text from the InputStream and write the decoded * octets to the OutputStream. This method runs until the stream * is exhausted. * @exception CEFormatException An error has occured while decoding * @exception CEStreamExhausted The input stream is unexpectedly out of data */ public void decodeBuffer(InputStream aStream, OutputStream bStream) throws IOException { int i; int totalBytes = 0; PushbackInputStream ps = new PushbackInputStream (aStream); decodeBufferPrefix(ps, bStream); while (true) { int length; try { length = decodeLinePrefix(ps, bStream); for (i = 0; (i+bytesPerAtom()) < length; i += bytesPerAtom()) { decodeAtom(ps, bStream, bytesPerAtom()); totalBytes += bytesPerAtom(); } if ((i + bytesPerAtom()) == length) { decodeAtom(ps, bStream, bytesPerAtom()); totalBytes += bytesPerAtom(); } else { decodeAtom(ps, bStream, length - i); totalBytes += (length - i); } decodeLineSuffix(ps, bStream); } catch (CEStreamExhausted e) { break; } } decodeBufferSuffix(ps, bStream); } /** * Alternate decode interface that takes a String containing the encoded * buffer and returns a byte array containing the data. * @exception CEFormatException An error has occured while decoding */ public byte decodeBuffer(String inputString)[] throws IOException { byte inputBuffer[] = new byte[inputString.length()]; ByteArrayInputStream inStream; ByteArrayOutputStream outStream; inputString.getBytes(0, inputString.length(), inputBuffer, 0); inStream = new ByteArrayInputStream(inputBuffer); outStream = new ByteArrayOutputStream(); decodeBuffer(inStream, outStream); return (outStream.toByteArray()); } /** * Decode the contents of the inputstream into a buffer. */ public byte decodeBuffer(InputStream in)[] throws IOException { ByteArrayOutputStream outStream = new ByteArrayOutputStream(); decodeBuffer(in, outStream); return (outStream.toByteArray()); } /** * Decode the contents of the String into a ByteBuffer. */ public ByteBuffer decodeBufferToByteBuffer(String inputString) throws IOException { return ByteBuffer.wrap(decodeBuffer(inputString)); } /** * Decode the contents of the inputStream into a ByteBuffer. */ public ByteBuffer decodeBufferToByteBuffer(InputStream in) throws IOException { return ByteBuffer.wrap(decodeBuffer(in)); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/replacements/PaxHeaders.17941/BASE64Encoder.java0000644000000000000000000000013112654402377027164 xustar0030 mtime=1454507263.268432167 30 atime=1454507327.167579963 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/replacements/BASE64Encoder.java0000644000175000002070000001034612654402377027714 0ustar00jvanekmock00000000000000/* * Copyright (c) 1995, 1997, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package net.sourceforge.jnlp.util.replacements; import java.io.OutputStream; import java.io.IOException; /** * This class implements a BASE64 Character encoder as specified in RFC1521. * This RFC is part of the MIME specification as published by the Internet * Engineering Task Force (IETF). Unlike some other encoding schemes there * is nothing in this encoding that indicates * where a buffer starts or ends. * * This means that the encoded text will simply start with the first line * of encoded text and end with the last line of encoded text. * * @author Chuck McManis * @see CharacterEncoder * @see BASE64Decoder */ public class BASE64Encoder extends CharacterEncoder { /** this class encodes three bytes per atom. */ protected int bytesPerAtom() { return (3); } /** * this class encodes 57 bytes per line. This results in a maximum * of 57/3 * 4 or 76 characters per output line. Not counting the * line termination. */ protected int bytesPerLine() { return (57); } /** This array maps the characters to their 6 bit values */ private final static char pem_array[] = { // 0 1 2 3 4 5 6 7 'A','B','C','D','E','F','G','H', // 0 'I','J','K','L','M','N','O','P', // 1 'Q','R','S','T','U','V','W','X', // 2 'Y','Z','a','b','c','d','e','f', // 3 'g','h','i','j','k','l','m','n', // 4 'o','p','q','r','s','t','u','v', // 5 'w','x','y','z','0','1','2','3', // 6 '4','5','6','7','8','9','+','/' // 7 }; /** * encodeAtom - Take three bytes of input and encode it as 4 * printable characters. Note that if the length in len is less * than three is encodes either one or two '=' signs to indicate * padding characters. */ protected void encodeAtom(OutputStream outStream, byte data[], int offset, int len) throws IOException { byte a, b, c; if (len == 1) { a = data[offset]; b = 0; c = 0; outStream.write(pem_array[(a >>> 2) & 0x3F]); outStream.write(pem_array[((a << 4) & 0x30) + ((b >>> 4) & 0xf)]); outStream.write('='); outStream.write('='); } else if (len == 2) { a = data[offset]; b = data[offset+1]; c = 0; outStream.write(pem_array[(a >>> 2) & 0x3F]); outStream.write(pem_array[((a << 4) & 0x30) + ((b >>> 4) & 0xf)]); outStream.write(pem_array[((b << 2) & 0x3c) + ((c >>> 6) & 0x3)]); outStream.write('='); } else { a = data[offset]; b = data[offset+1]; c = data[offset+2]; outStream.write(pem_array[(a >>> 2) & 0x3F]); outStream.write(pem_array[((a << 4) & 0x30) + ((b >>> 4) & 0xf)]); outStream.write(pem_array[((b << 2) & 0x3c) + ((c >>> 6) & 0x3)]); outStream.write(pem_array[c & 0x3F]); } } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/replacements/PaxHeaders.17941/BASE64Decoder.java0000644000000000000000000000013112654402377027152 xustar0030 mtime=1454507263.268432167 30 atime=1454507327.167579963 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/replacements/BASE64Decoder.java0000644000175000002070000001323712654402377027704 0ustar00jvanekmock00000000000000/* * Copyright (c) 1995, 2000, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package net.sourceforge.jnlp.util.replacements; import java.io.IOException; import java.io.OutputStream; import java.io.PushbackInputStream; /** * This class implements a BASE64 Character decoder as specified in RFC1521. * * This RFC is part of the MIME specification which is published by the * Internet Engineering Task Force (IETF). Unlike some other encoding * schemes there is nothing in this encoding that tells the decoder * where a buffer starts or stops, so to use it you will need to isolate * your encoded data into a single chunk and then feed them this decoder. * The simplest way to do that is to read all of the encoded data into a * string and then use: *
     *      byte    mydata[];
     *      BASE64Decoder base64 = new BASE64Decoder();
     *
     *      mydata = base64.decodeBuffer(bufferString);
     * 
    * This will decode the String in bufferString and give you an array * of bytes in the array myData. * * On errors, this class throws a CEFormatException with the following detail * strings: *
     *    "BASE64Decoder: Not enough bytes for an atom."
     * 
    * * @author Chuck McManis * @see CharacterEncoder * @see BASE64Decoder */ public class BASE64Decoder extends CharacterDecoder { private static class CEFormatException extends IOException { public CEFormatException(String s) { super(s); } } /** This class has 4 bytes per atom */ @Override protected int bytesPerAtom() { return (4); } /** Any multiple of 4 will do, 72 might be common */ @Override protected int bytesPerLine() { return (72); } /** * This character array provides the character to value map * based on RFC1521. */ private final static char pem_array[] = { // 0 1 2 3 4 5 6 7 'A','B','C','D','E','F','G','H', // 0 'I','J','K','L','M','N','O','P', // 1 'Q','R','S','T','U','V','W','X', // 2 'Y','Z','a','b','c','d','e','f', // 3 'g','h','i','j','k','l','m','n', // 4 'o','p','q','r','s','t','u','v', // 5 'w','x','y','z','0','1','2','3', // 6 '4','5','6','7','8','9','+','/' // 7 }; private final static byte pem_convert_array[] = new byte[256]; static { for (int i = 0; i < 255; i++) { pem_convert_array[i] = -1; } for (int i = 0; i < pem_array.length; i++) { pem_convert_array[pem_array[i]] = (byte) i; } } byte decode_buffer[] = new byte[4]; /** * Decode one BASE64 atom into 1, 2, or 3 bytes of data. */ @Override protected void decodeAtom(PushbackInputStream inStream, OutputStream outStream, int rem) throws java.io.IOException { int i; byte a = -1, b = -1, c = -1, d = -1; if (rem < 2) { throw new CEFormatException("BASE64Decoder: Not enough bytes for an atom."); } do { i = inStream.read(); if (i == -1) { throw new CEStreamExhausted(); } } while (i == '\n' || i == '\r'); decode_buffer[0] = (byte) i; i = readFully(inStream, decode_buffer, 1, rem-1); if (i == -1) { throw new CEStreamExhausted(); } if (rem > 3 && decode_buffer[3] == '=') { rem = 3; } if (rem > 2 && decode_buffer[2] == '=') { rem = 2; } switch (rem) { case 4: d = pem_convert_array[decode_buffer[3] & 0xff]; // NOBREAK case 3: c = pem_convert_array[decode_buffer[2] & 0xff]; // NOBREAK case 2: b = pem_convert_array[decode_buffer[1] & 0xff]; a = pem_convert_array[decode_buffer[0] & 0xff]; break; } switch (rem) { case 2: outStream.write( (byte)(((a << 2) & 0xfc) | ((b >>> 4) & 3)) ); break; case 3: outStream.write( (byte) (((a << 2) & 0xfc) | ((b >>> 4) & 3)) ); outStream.write( (byte) (((b << 4) & 0xf0) | ((c >>> 2) & 0xf)) ); break; case 4: outStream.write( (byte) (((a << 2) & 0xfc) | ((b >>> 4) & 3)) ); outStream.write( (byte) (((b << 4) & 0xf0) | ((c >>> 2) & 0xf)) ); outStream.write( (byte) (((c << 6) & 0xc0) | (d & 0x3f)) ); break; } } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/PaxHeaders.17941/optionparser0000644000000000000000000000013112654402377024123 xustar0030 mtime=1454507263.268432167 30 atime=1454507658.779157357 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/optionparser/0000755000175000002070000000000012654402377024724 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/optionparser/PaxHeaders.17941/UnevenParameterExcept0000644000000000000000000000013112654402377030375 xustar0030 mtime=1454507263.268432167 30 atime=1454507327.167579963 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/optionparser/UnevenParameterException.java0000644000175000002070000000343712654402377032556 0ustar00jvanekmock00000000000000/*Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util.optionparser; public class UnevenParameterException extends RuntimeException { public UnevenParameterException(String argument) { super(argument); } }icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/optionparser/PaxHeaders.17941/ParsedOption.java0000644000000000000000000000013112654402377027452 xustar0030 mtime=1454507263.268432167 30 atime=1454507327.166579977 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/optionparser/ParsedOption.java0000644000175000002070000000436512654402377030206 0ustar00jvanekmock00000000000000/*Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util.optionparser; import java.util.ArrayList; import java.util.List; import static net.sourceforge.jnlp.OptionsDefinitions.*; public class ParsedOption { private OPTIONS option; private List params = new ArrayList<>(); ParsedOption(OPTIONS option) { this.option = option; } public List getParams() { return new ArrayList<>(params); } public void addParam(String param) { params.add(param); } public void setParams(List params) { this.params = new ArrayList<>(params); } public OPTIONS getOption() { return option; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/optionparser/PaxHeaders.17941/OptionParser.java0000644000000000000000000000013112654402377027470 xustar0030 mtime=1454507263.268432167 30 atime=1454507327.166579977 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/optionparser/OptionParser.java0000644000175000002070000001655012654402377030223 0ustar00jvanekmock00000000000000/*Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util.optionparser; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import net.sourceforge.jnlp.OptionsDefinitions; import net.sourceforge.jnlp.util.logging.OutputController; import static net.sourceforge.jnlp.runtime.Translator.R; /** Parses for options (passed in as arguments) * To use add entries to OPTIONS enum in OptionsDefinitions * and make a static method return a list containing * what OPTIONS are to be parsed for. */ public class OptionParser { private final String[] args; private final List parsedOptions; private final List possibleOptions; //List of all possible main arguments private final List mainArgumentList = new ArrayList<>(); private boolean evenNumberFound; public OptionParser(String[] args, List options) throws UnevenParameterException { this.args = Arrays.copyOf(args, args.length); this.possibleOptions = options; evenNumberFound = false; parsedOptions = new ArrayList<>(); parseContents(); if (evenNumberFound) { checkOptionHasEvenNumber(); } } private void parseContents() { ParsedOption lastOption = null; for (String arg : args) { if (isOption(arg)) { lastOption = addOptionToList(arg); } else if (shouldAddParam(lastOption)) { lastOption.addParam(arg); } else if (isEvenNumberSupportingEqualsChars(lastOption)) { evenNumberFound = true; handleEvenNumberSupportingEqualsChar(lastOption, arg); } else { mainArgumentList.add(arg); } } } private void handleEvenNumberSupportingEqualsChar(final ParsedOption lastOption, String arg) { if (arg.contains("=")) { lastOption.addParam(arg.split("=")[0]); lastOption.addParam(arg.split("=", 2)[1]); } else { lastOption.addParam(arg); } } private boolean shouldAddParam(final ParsedOption lastOption) { return lastOption != null && (oneOrMoreArguments(lastOption) || isOneArgumentNotFull(lastOption)); } private boolean isOneArgumentNotFull(final ParsedOption lastOption) { return lastOption.getOption().hasOneArgument() && lastOption.getParams().size() == 0; } private boolean oneOrMoreArguments(final ParsedOption lastOption) { return lastOption.getOption().hasOneOrMoreArguments(); } private boolean isEvenNumberSupportingEqualsChars(final ParsedOption lastOption) { return lastOption != null && lastOption.getOption().hasEvenNumberSupportingEqualsChar(); } private ParsedOption addOptionToList(final String arg) { ParsedOption option = new ParsedOption(argumentToOption(arg)); if (arg.contains("=")) { option.addParam(arg.split("=", 2)[1]); } parsedOptions.add(option); return option; } private void checkOptionHasEvenNumber() throws UnevenParameterException { for (ParsedOption option : parsedOptions) { if (isEvenNumberSupportingEqualsChars(option)) { if (option.getParams().size() % 2 != 0){ throw new UnevenParameterException(R("OPUnevenParams", option.getOption().option)); } } } } private OptionsDefinitions.OPTIONS argumentToOption(final String arg) { for (OptionsDefinitions.OPTIONS opt : possibleOptions) { if (stringEqualsOption(arg, opt)) { return opt; } } return null; } private boolean isOption(String input) { if (argumentToOption(input) != null) { return true; } return false; } protected static boolean stringEqualsOption(String input, OptionsDefinitions.OPTIONS opt) { String option = removeLeadingHyphens(opt.option); input = removeLeadingHyphens(input).split("=")[0]; return input.equals(option); } private static String removeLeadingHyphens(final String input) { return input.replaceAll("^-*", ""); } public boolean hasOption(OptionsDefinitions.OPTIONS option) { for (ParsedOption parsed : parsedOptions) { if (option == parsed.getOption()) { return true; } } return false; } public boolean mainArgExists() { if (mainArgumentList.size() > 0) { return true; } return false; } public String getMainArg() { if (mainArgExists()) { return mainArgumentList.get(0); } return ""; } public List getMainArgs() { return new ArrayList<>(mainArgumentList); } public String getParam(OptionsDefinitions.OPTIONS option) { List params = getParams(option); if (params.size() > 0) { return getParams(option).get(0); } return ""; } public List getParams(OptionsDefinitions.OPTIONS option) { List result = new ArrayList<>(); for (ParsedOption parsed : parsedOptions) { if (parsed.getOption() == option) { for (String param : parsed.getParams()) { result.add(param); } } } return result; } public int getNumberOfOptions() { return parsedOptions.size(); } public void addOption(OptionsDefinitions.OPTIONS options, String... params) { ParsedOption x = new ParsedOption(options); for (String string : params) { x.addParam(string); } parsedOptions.add(x); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/optionparser/PaxHeaders.17941/InvalidArgumentExcept0000644000000000000000000000013112654402377030365 xustar0030 mtime=1454507263.267432181 30 atime=1454507327.166579977 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/optionparser/InvalidArgumentException.java0000644000175000002070000000343212654402377032541 0ustar00jvanekmock00000000000000/*Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util.optionparser; public class InvalidArgumentException extends Exception { public InvalidArgumentException(String argument) { super(argument); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/PaxHeaders.17941/logging0000644000000000000000000000013112654402377023024 xustar0030 mtime=1454507263.266432194 30 atime=1454507658.779157357 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/logging/0000755000175000002070000000000012654402377023625 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/logging/PaxHeaders.17941/headers0000644000000000000000000000013112654402377024437 xustar0030 mtime=1454507263.267432181 30 atime=1454507658.779157357 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/logging/headers/0000755000175000002070000000000012654402377025240 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/logging/headers/PaxHeaders.17941/PluginMessage.java0000644000000000000000000000013112654402377030122 xustar0030 mtime=1454507263.267432181 30 atime=1454507327.166579977 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/logging/headers/PluginMessage.java0000644000175000002070000000704612654402377030655 0ustar00jvanekmock00000000000000/* Copyright (C) 2009, 2013 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util.logging.headers; import java.util.Date; import net.sourceforge.jnlp.util.logging.OutputController; public class PluginMessage implements MessageWithHeader{ public PluginHeader header; public String restOfMessage; public boolean wasError = false; public PluginMessage(String orig) { restOfMessage = orig; header = new PluginHeader(); String s = orig.trim(); PluginHeader p = this.header; try { p.isC = true; p.application = false; if (s.startsWith("preinit_plugin")) { p.preinit = true; } if (s.startsWith(PluginHeader.PLUGIN_DEBUG) || s.startsWith(PluginHeader.PLUGIN_DEBUG_PREINIT)) { p.level = OutputController.Level.MESSAGE_DEBUG; } else if (s.startsWith(PluginHeader.PLUGIN_ERROR) || s.startsWith(PluginHeader.PLUGIN_ERROR_PREINIT)) { p.level = OutputController.Level.ERROR_ALL; } else { p.level = OutputController.Level.WARNING_ALL; } String[] init = PluginHeader.whiteSpaces.split(s); p.timestamp = new Date(Long.parseLong(init[1]) / 1000); String[] main = PluginHeader.bracketsPattern.split(s); p.user = main[1]; p.caller = main[5]; p.date = main[4]; String[] threads = PluginHeader.threadsPattern.split(main[6]); p.thread1 = threads[2]; p.thread2 = threads[4]; int i = orig.indexOf(p.thread2); restOfMessage = orig.substring(i + p.thread2.length() + 2); //+": " } catch (Exception ex) { OutputController.getLogger().log(ex); this.wasError = true; } } @Override public String getMessage() { return restOfMessage; } @Override public Header getHeader() { return header; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/logging/headers/PaxHeaders.17941/PluginHeader.java0000644000000000000000000000013112654402377027726 xustar0030 mtime=1454507263.267432181 30 atime=1454507327.166579977 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/logging/headers/PluginHeader.java0000644000175000002070000000576312654402377030465 0ustar00jvanekmock00000000000000/* Copyright (C) 2009, 2013 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. * */ package net.sourceforge.jnlp.util.logging.headers; import java.util.regex.Pattern; public class PluginHeader extends Header { public boolean preinit; static final String PLUGIN_DEBUG = "plugindebug "; static final String PLUGIN_DEBUG_PREINIT = "preinit_plugindebug "; static final String PLUGIN_ERROR = "pluginerror "; static final String PLUGIN_ERROR_PREINIT = "preinit_pluginerror "; static final Pattern bracketsPattern = Pattern.compile("(\\]\\s*\\[)|(\\s*\\[)|(\\]\\s*)"); static final Pattern whiteSpaces = Pattern.compile("\\s+"); static final Pattern threadsPattern = Pattern.compile("\\s+|,\\s*|:"); @Override public String toString() { return toString(true, true, true, true, true, true, true); } @Override public String toString(boolean userb, boolean originb, boolean levelb, boolean dateb, boolean callerb, boolean thread1b, boolean thread2b) { if (preinit) { return "!" + super.toString(userb, originb, levelb, dateb, callerb, thread1b, thread2b); } else { return super.toString(userb, originb, levelb, dateb, callerb, thread1b, thread2b); } } @Override public String thread1ToString() { return " ITNPP Thread# " + thread1; } @Override public String thread2ToString() { return "gthread " + thread2; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/logging/headers/PaxHeaders.17941/ObservableMessages0000644000000000000000000000013112654402377030213 xustar0030 mtime=1454507263.267432181 30 atime=1454507327.166579977 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/logging/headers/ObservableMessagesProvider.java0000644000175000002070000000357112654402377033400 0ustar00jvanekmock00000000000000/* Copyright (C) 2009, 2013 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util.logging.headers; import java.util.List; import java.util.Observable; public interface ObservableMessagesProvider { public List getData(); public Observable getObservable(); } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/logging/headers/PaxHeaders.17941/MessageWithHeader.0000644000000000000000000000013112654402377030046 xustar0030 mtime=1454507263.267432181 30 atime=1454507327.166579977 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/logging/headers/MessageWithHeader.java0000644000175000002070000000342512654402377031440 0ustar00jvanekmock00000000000000/* Copyright (C) 2009, 2013 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util.logging.headers; public interface MessageWithHeader { String getMessage(); Header getHeader(); } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/logging/headers/PaxHeaders.17941/JavaMessage.java0000644000000000000000000000013012654402377027544 xustar0030 mtime=1454507263.267432181 29 atime=1454507327.16557999 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/logging/headers/JavaMessage.java0000644000175000002070000000411112654402377030266 0ustar00jvanekmock00000000000000/* Copyright (C) 2009, 2013 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util.logging.headers; public class JavaMessage implements MessageWithHeader{ public Header header; public String message; public JavaMessage(Header header, String message) { this.header = header; this.message = message; } @Override public String getMessage() { return message; } @Override public Header getHeader() { return header; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/logging/headers/PaxHeaders.17941/Header.java0000644000000000000000000000013012654402377026546 xustar0030 mtime=1454507263.266432194 29 atime=1454507327.16557999 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/logging/headers/Header.java0000644000175000002070000001441012654402377027273 0ustar00jvanekmock00000000000000/* Copyright (C) 2009, 2013 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util.logging.headers; import java.util.Date; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.util.logging.OutputController; import net.sourceforge.jnlp.util.logging.OutputController.Level; import net.sourceforge.jnlp.util.logging.TeeOutputStream; public class Header { public static String default_user = System.getProperty("user.name"); public String user = default_user; public boolean application = true; public Level level = Level.WARNING_ALL; public Date timestamp = new Date(); public String date = timestamp.toString(); public boolean isC = false;//false=> java public boolean isClientApp = false;//false=> ITW public String caller = "unknown"; public String thread1 = "unknown"; public String thread2 = "unknown"; //to alow simple inheritance public Header() { } public Header(Level level, boolean isC) { this(level, Thread.currentThread().getStackTrace(), Thread.currentThread(), isC); } public Header(Level level, StackTraceElement[] stack, Thread thread, boolean isC) { this(level, stack, thread, new Date(), isC); } public Header(Level level, StackTraceElement[] stack, Thread thread, Date d, boolean isC) { this.application = JNLPRuntime.isWebstartApplication(); this.level = level; this.timestamp = d; this.date = timestamp.toString(); this.isC = isC; if (stack != null) { this.caller = getCallerClass(stack); } this.thread1 = Integer.toHexString(((Object) thread).hashCode()); this.thread2 = thread.getName(); } @Override public String toString() { return toString(true, true, true, true, true, true, true); } public String toString(boolean userb, boolean originb, boolean levelb, boolean dateb, boolean callerb, boolean thread1b, boolean thread2b) { StringBuilder sb = new StringBuilder(); try { if (userb){ sb.append("[").append(user).append("]"); } if(originb){ sb.append("[").append(getOrigin()).append("]"); } if (levelb && level != null) { sb.append('[').append(level.toString()).append(']'); } if (dateb){ sb.append('[').append(date.toString()).append(']'); } if (callerb && caller != null) { sb.append('[').append(caller).append(']'); } if (thread1b && thread2b){ sb.append(threadsToString()); }else if (thread1b) { sb.append(thread1ToString()); }else if (thread2b) { sb.append(thread2ToString()); } } catch (Exception ex) { OutputController.getLogger().log(ex); } return sb.toString(); } public String thread1ToString() { return " NETX Thread# " + thread1; } public String thread2ToString() { return "name " + thread2; } public String threadsToString() { return thread1ToString() + ", " + thread2ToString(); } private static final String CLIENT = "CLIENT"; public String getOrigin() { String s; if (application) { s = "ITW-JAVAWS"; } else { if (isC) { s = "ITW-C-PLUGIN"; } else { s = "ITW-APPLET"; } } if (isClientApp) { s = s + "-" + CLIENT; } return s; } static String getCallerClass(StackTraceElement[] stack) { try { //0 is always thread //1..? is OutputController itself //pick up first after. StackTraceElement result = stack[0]; int i = 1; for (; i < stack.length; i++) { result = stack[i];//at least moving up if (stack[i].getClassName().contains(OutputController.class.getName()) || //PluginDebug.class.getName() not avaiable during netx make stack[i].getClassName().contains("sun.applet.PluginDebug") || stack[i].getClassName().contains(Header.class.getName()) || stack[i].getClassName().contains(TeeOutputStream.class.getName())) { continue; } else { break; } } return result.toString(); } catch (Exception ex) { OutputController.getLogger().log(ex); return "Unknown caller"; } } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/logging/PaxHeaders.17941/filelogs0000644000000000000000000000013112654402377024630 xustar0030 mtime=1454507263.266432194 30 atime=1454507658.779157357 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/logging/filelogs/0000755000175000002070000000000012654402377025431 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/logging/filelogs/PaxHeaders.17941/WriterBasedFileLo0000644000000000000000000000013012654402377030135 xustar0030 mtime=1454507263.266432194 29 atime=1454507327.16557999 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/logging/filelogs/WriterBasedFileLog.java0000644000175000002070000000660712654402377031762 0ustar00jvanekmock00000000000000/* Copyright (C) 2011, 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util.logging.filelogs; import java.io.BufferedWriter; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStreamWriter; import net.sourceforge.jnlp.util.FileUtils; import net.sourceforge.jnlp.util.logging.FileLog; import net.sourceforge.jnlp.util.logging.SingleStreamLogger; /** * This class writes log information to file. */ public final class WriterBasedFileLog implements SingleStreamLogger { private final BufferedWriter bw; public WriterBasedFileLog(String fileName, boolean append) { this(fileName, fileName, append); } public WriterBasedFileLog(String loggerName, String fileName, boolean append) { try { File futureFile = new File(fileName); if (!futureFile.exists()) { FileUtils.createRestrictedFile(futureFile, true); } bw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(new File(fileName), append), "UTF-8")); log(FileLog.getHeadlineHeader().toString() + " writer-based impl."); } catch (IOException e) { throw new RuntimeException(e); } } /** * Log the String to file. * * @param s {@link Exception} that was thrown. */ @Override public synchronized void log(String s) { try { bw.write(s); if (!s.endsWith("\n")) { bw.newLine(); } bw.flush(); } catch (IOException e) { throw new RuntimeException(e); } } @Override public void close() throws IOException { try { bw.flush(); } finally { bw.close(); } } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/logging/filelogs/PaxHeaders.17941/LogBasedFileLog.j0000644000000000000000000000013012654402377030001 xustar0030 mtime=1454507263.266432194 29 atime=1454507327.16557999 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/logging/filelogs/LogBasedFileLog.java0000644000175000002070000000701112654402377031215 0ustar00jvanekmock00000000000000/* Copyright (C) 2011, 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util.logging.filelogs; import java.io.File; import java.io.IOException; import java.util.logging.FileHandler; import java.util.logging.Formatter; import java.util.logging.Level; import java.util.logging.LogRecord; import java.util.logging.Logger; import net.sourceforge.jnlp.util.FileUtils; import net.sourceforge.jnlp.util.logging.FileLog; import net.sourceforge.jnlp.util.logging.SingleStreamLogger; /** * This class writes log information to file. */ public final class LogBasedFileLog implements SingleStreamLogger { //really instance bounded private final Logger impl; private final FileHandler fh; // testing constructor public LogBasedFileLog(String fileName, boolean append) { this(fileName, fileName, append); } public LogBasedFileLog(String loggerName, String fileName, boolean append) { try { File futureFile = new File(fileName); if (!futureFile.exists()) { FileUtils.createRestrictedFile(futureFile, true); } fh = new FileHandler(fileName, append); fh.setFormatter(new Formatter() { @Override public String format(LogRecord record) { return record.getMessage() + "\n"; } }); impl = Logger.getLogger(loggerName); impl.setLevel(Level.ALL); impl.addHandler(fh); log(FileLog.getHeadlineHeader().toString() + " log-based impl."); } catch (IOException e) { throw new RuntimeException(e); } } /** * Log the String to file. * * @param s {@link Exception} that was thrown. */ @Override public synchronized void log(String s) { impl.log(Level.FINE, s); } @Override public void close() { fh.close(); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/logging/PaxHeaders.17941/WinSystemLog.java0000644000000000000000000000013012654402377026347 xustar0030 mtime=1454507263.266432194 29 atime=1454507327.16557999 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/logging/WinSystemLog.java0000644000175000002070000000364412654402377027103 0ustar00jvanekmock00000000000000/*Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util.logging; public class WinSystemLog implements SingleStreamLogger{ public WinSystemLog(){ } @Override public void log(String s) { //not yet implemented } @Override public void close() { //nope } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/logging/PaxHeaders.17941/UnixSystemLog.java0000644000000000000000000000013012654402377026535 xustar0030 mtime=1454507263.266432194 29 atime=1454507327.16557999 29 ctime=1454507658.73915789 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/logging/UnixSystemLog.java0000644000175000002070000000526412654402377027271 0ustar00jvanekmock00000000000000/*Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util.logging; import net.sourceforge.jnlp.util.docprovider.TextsProvider; public class UnixSystemLog implements SingleStreamLogger{ public UnixSystemLog(){ } @Override public void log(String message) { final String s = "IcedTea-Web java error - for more info see itweb-settings debug options or console. See " + TextsProvider.ITW_BUGS + " for help.\nIcedTea-Web java error manual log: \n" + message; try { String[] ss = s.split("\\n"); //exceptions have many lines for (String m : ss) { m = m.replaceAll("\t", " "); ProcessBuilder pb = new ProcessBuilder("logger", "-p","user.err", "--", m); Process p = pb.start(); p.waitFor(); OutputController.getLogger().log("System logger called with result of " + p.exitValue()); } } catch (Exception ex) { OutputController.getLogger().log(ex); } } @Override public void close() { //nope } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/logging/PaxHeaders.17941/TeeOutputStream.java0000644000000000000000000000013112654402377027056 xustar0030 mtime=1454507263.266432194 29 atime=1454507327.16557999 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/logging/TeeOutputStream.java0000644000175000002070000001072712654402377027611 0ustar00jvanekmock00000000000000/* TeeOutputStream.java Copyright (C) 2010 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util.logging; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.PrintStream; import net.sourceforge.jnlp.util.logging.OutputController.Level; import net.sourceforge.jnlp.util.logging.headers.Header; import net.sourceforge.jnlp.util.logging.headers.JavaMessage; /** * Behaves like the 'tee' command, sends output to both actual std stream and a * log */ public final class TeeOutputStream extends PrintStream implements SingleStreamLogger{ // Everthing written to TeeOutputStream is written to our log too private final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); private final boolean isError; private final String lineSeparator = System.getProperty("line.separator"); public TeeOutputStream(PrintStream stdStream, boolean isError) { super(stdStream); this.isError = isError; } @Override public void close() { flushLog(); super.close(); } @Override public void flush() { flushLog(); super.flush(); } /* * The big ones: these do the actual writing */ @Override public synchronized void write(byte[] b, int off, int len) { if (len == 0) { return; } appendByteArray(b, off, len); super.write(b, off, len); } @Override public synchronized void write(int b) { appendByte(b); super.write(b); } private void flushLog() { String s = byteArrayOutputStream.toString(); if (s.length() > 0) { log(s); byteArrayOutputStream.reset(); } } @Override public void log(String s) { JavaMessage jm = new JavaMessage(new Header(getlevel(), false), s); jm.getHeader().isClientApp = true; OutputController.getLogger().log(jm); } public boolean isError() { return isError; } private void appendByte(int b) { byteArrayOutputStream.write(b); String s = byteArrayOutputStream.toString(); if (s.endsWith(lineSeparator)) { flushLog(); } } private void appendByteArray(byte[] b, int off, int len) { byteArrayOutputStream.write(b, off, len); String s = new String(b, off, len); if (s.endsWith(lineSeparator)) { flushLog(); } } private Level getlevel() { if (isError()) { return OutputController.Level.ERROR_ALL; } else { return OutputController.Level.MESSAGE_ALL; } } //For unit testing protected ByteArrayOutputStream getByteArrayOutputStream() throws IOException { ByteArrayOutputStream copy = new ByteArrayOutputStream(); copy.write(this.byteArrayOutputStream.toByteArray()); return copy; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/logging/PaxHeaders.17941/SingleStreamLogger.java0000644000000000000000000000013212654402377027502 xustar0030 mtime=1454507263.265432208 30 atime=1454507327.164580003 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/logging/SingleStreamLogger.java0000644000175000002070000000346612654402377030236 0ustar00jvanekmock00000000000000/*Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util.logging; public interface SingleStreamLogger extends AutoCloseable { public void log(String s); @Override public void close() throws Exception; } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/logging/PaxHeaders.17941/PrintStreamLogger.java0000644000000000000000000000013212654402377027355 xustar0030 mtime=1454507263.265432208 30 atime=1454507327.164580003 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/logging/PrintStreamLogger.java0000644000175000002070000000425012654402377030101 0ustar00jvanekmock00000000000000/*Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util.logging; import java.io.PrintStream; public class PrintStreamLogger implements SingleStreamLogger{ private PrintStream stream; public PrintStreamLogger(PrintStream stream){ this.stream = stream; } @Override public void log(String s) { stream.println(s); } public PrintStream getStream() { return stream; } public void setStream(PrintStream stream) { this.stream = stream; } @Override public void close() { stream.flush(); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/logging/PaxHeaders.17941/OutputController.java0000644000000000000000000000013212654402377027311 xustar0030 mtime=1454507263.265432208 30 atime=1454507327.164580003 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/logging/OutputController.java0000644000175000002070000003227712654402377030047 0ustar00jvanekmock00000000000000/*Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util.logging; import java.io.PrintStream; import java.io.PrintWriter; import java.io.StringWriter; import java.util.LinkedList; import java.util.List; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.util.logging.headers.Header; import net.sourceforge.jnlp.util.logging.headers.JavaMessage; import net.sourceforge.jnlp.util.logging.headers.MessageWithHeader; /** * * OutputController class (thread) must NOT call JNLPRuntime.getConfiguraion() * */ public class OutputController { public static enum Level { MESSAGE_ALL, // - stdout/log in all cases MESSAGE_DEBUG, // - stdout/log in verbose/debug mode WARNING_ALL, // - stdout+stderr/log in all cases (default for WARNING_DEBUG, // - stdou+stde/logrr in verbose/debug mode ERROR_ALL, // - stderr/log in all cases (default for ERROR_DEBUG; // - stderr/log in verbose/debug mode //ERROR_DEBUG is default for Throwable //MESSAGE_DEBUG is default for String public boolean isOutput() { return this == Level.MESSAGE_ALL || this == Level.MESSAGE_DEBUG || this == Level.WARNING_ALL || this == Level.WARNING_DEBUG; } public boolean isError() { return this == Level.ERROR_ALL || this == Level.ERROR_DEBUG || this == Level.WARNING_ALL || this == Level.WARNING_DEBUG; } public boolean isWarning() { return this == Level.WARNING_ALL || this == Level.WARNING_DEBUG; } public boolean isDebug() { return this == Level.ERROR_DEBUG || this == Level.MESSAGE_DEBUG || this == Level.WARNING_DEBUG; } public boolean isInfo() { return this == Level.ERROR_ALL || this == Level.WARNING_ALL || this == Level.MESSAGE_ALL; } } /* * singleton instance */ private static final String NULL_OBJECT = "Trying to log null object"; private PrintStreamLogger outLog; private PrintStreamLogger errLog; private final List messageQue = new LinkedList<>(); private final MessageQueConsumer messageQueConsumer = new MessageQueConsumer(); Thread consumerThread; //bounded to instance private class MessageQueConsumer implements Runnable { @Override public void run() { while (true) { try { synchronized (OutputController.this) { OutputController.this.wait(1000); if (!(OutputController.this == null || messageQue.isEmpty())) { flush(); } } } catch (Throwable t) { OutputController.getLogger().log(t); } } } }; public synchronized void flush() { while (!messageQue.isEmpty()) { consume(); } } public void close() throws Exception { flush(); if (LogConfig.getLogConfig().isLogToFile()){ getFileLog().close(); } } private void consume() { MessageWithHeader s = messageQue.get(0); messageQue.remove(0); //filtering is done in console during runtime if (LogConfig.getLogConfig().isLogToConsole()) { JavaConsole.getConsole().addMessage(s); } //clients app's messages are reprinted only to console if (s.getHeader().isClientApp){ if (LogConfig.getLogConfig().isLogToFile() && LogConfig.getLogConfig().isLogToFileForClientApp()) { getAppFileLog().log(proceedHeader(s)); } return; } if (!JNLPRuntime.isDebug() && (s.getHeader().level == Level.MESSAGE_DEBUG || s.getHeader().level == Level.WARNING_DEBUG || s.getHeader().level == Level.ERROR_DEBUG)) { //filter out debug messages //must be here to prevent deadlock, casued by exception form jnlpruntime, loggers or configs themselves return; } String message = proceedHeader(s); if (LogConfig.getLogConfig().isLogToStreams()) { if (s.getHeader().level.isOutput()) { outLog.log(message); } if (s.getHeader().level.isError()) { errLog.log(message); } } if (LogConfig.getLogConfig().isLogToFile()) { getFileLog().log(message); } //only crucial stuff is going to system log //only java messages handled here, plugin is onhis own if (LogConfig.getLogConfig().isLogToSysLog() && (s.getHeader().level.equals(Level.ERROR_ALL) || s.getHeader().level.equals(Level.WARNING_ALL)) && s.getHeader().isC == false) { //no headers here getSystemLog().log(s.getMessage()); } } private String proceedHeader(MessageWithHeader s) { String message = s.getMessage(); if (LogConfig.getLogConfig().isEnableHeaders()) { if (message.contains("\n")) { message = s.getHeader().toString() + "\n" + message; } else { message = s.getHeader().toString() + " " + message; } } return message; } private OutputController() { this(System.out, System.err); } private static class OutputControllerHolder { //https://en.wikipedia.org/wiki/Initialization_on_demand_holder_idiom //https://en.wikipedia.org/wiki/Double-checked_locking#Usage_in_Java private static final OutputController INSTANCE = new OutputController(); } /** * This should be the only legal way to get logger for ITW * * @return logging singleton */ public static OutputController getLogger() { return OutputControllerHolder.INSTANCE; } /** * for testing purposes the logger with custom streams can be created * otherwise only getLogger()'s singleton can be called. */ public OutputController(PrintStream out, PrintStream err) { if (out == null || err == null) { throw new IllegalArgumentException("No stream can be null"); } outLog = new PrintStreamLogger(out); errLog = new PrintStreamLogger(err); //itw logger have to be fully initialised before start consumerThread = new Thread(messageQueConsumer, "Output controller consumer daemon"); consumerThread.setDaemon(true); //is started in JNLPRuntime.getConfig() after config is laoded Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() { @Override public void run() { flush(); } })); } public void startConsumer() { consumerThread.start(); //some messages were probably posted before start of consumer synchronized (this) { this.notifyAll(); } } /** * * @return current stream for std.out reprint */ public PrintStream getOut() { flush(); return outLog.getStream(); } /** * * @return current stream for std.err reprint */ public PrintStream getErr() { flush(); return errLog.getStream(); } /** * Some tests may require set the output stream and check the output. This * is the gate for it. */ public void setOut(PrintStream out) { flush(); this.outLog.setStream(out); } /** * Some tests may require set the output stream and check the output. This * is the gate for it. */ public void setErr(PrintStream err) { flush(); this.errLog.setStream(err); } public static String exceptionToString(Throwable t) { if (t == null) { return null; } String s = "Error during processing of exception"; try { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); t.printStackTrace(pw); s = sw.toString(); pw.close(); sw.close(); } catch (Exception ex) { throw new RuntimeException(ex); } return s; } public void log(Level level, String s) { log(level, (Object) s); } public void log(Level level, Throwable s) { log(level, (Object) s); } public void log(String s) { log(Level.MESSAGE_DEBUG, (Object) s); } public void log(Throwable s) { log(Level.ERROR_DEBUG, (Object) s); } private void log(Level level, Object o) { String s =""; if (o == null) { s = NULL_OBJECT; } else if (o instanceof Throwable) { s = exceptionToString((Throwable) o); } else { s=o.toString(); } log(new JavaMessage(new Header(level, false), s)); } synchronized void log(MessageWithHeader l){ messageQue.add(l); this.notifyAll(); } private static class FileLogHolder { //https://en.wikipedia.org/wiki/Double-checked_locking#Usage_in_Java //https://en.wikipedia.org/wiki/Initialization_on_demand_holder_idiom private static volatile SingleStreamLogger INSTANCE = FileLog.createFileLog(); } private SingleStreamLogger getFileLog() { return FileLogHolder.INSTANCE; } private static class AppFileLogHolder { //https://en.wikipedia.org/wiki/Double-checked_locking#Usage_in_Java //https://en.wikipedia.org/wiki/Initialization_on_demand_holder_idiom private static volatile SingleStreamLogger INSTANCE = FileLog.createAppFileLog(); } private SingleStreamLogger getAppFileLog() { return AppFileLogHolder.INSTANCE; } private static class SystemLogHolder { //https://en.wikipedia.org/wiki/Double-checked_locking#Usage_in_Java //https://en.wikipedia.org/wiki/Initialization_on_demand_holder_idiom private static volatile SingleStreamLogger INSTANCE = initSystemLogger(); private static SingleStreamLogger initSystemLogger() { if (JNLPRuntime.isWindows()) { return new WinSystemLog(); } else { return new UnixSystemLog(); } } } private SingleStreamLogger getSystemLog() { return SystemLogHolder.INSTANCE; } public void printErrorLn(String e) { getErr().println(e); } public void printOutLn(String e) { getOut().println(e); } public void printWarningLn(String e) { printOutLn(e); printErrorLn(e); } public void printError(String e) { getErr().print(e); } public void printOut(String e) { getOut().print(e); } public void printWarning(String e) { printOut(e); printError(e); } //package private setters for testing void setErrLog(PrintStreamLogger errLog) { this.errLog = errLog; } void setFileLog(SingleStreamLogger fileLog) { FileLogHolder.INSTANCE = fileLog; } void setAppFileLog(SingleStreamLogger fileLog) { AppFileLogHolder.INSTANCE = fileLog; } void setOutLog(PrintStreamLogger outLog) { this.outLog = outLog; } void setSysLog(SingleStreamLogger sysLog) { SystemLogHolder.INSTANCE = sysLog; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/logging/PaxHeaders.17941/LogConfig.java0000644000000000000000000000013212654402377025614 xustar0030 mtime=1454507263.265432208 30 atime=1454507327.164580003 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/logging/LogConfig.java0000644000175000002070000001347712654402377026353 0ustar00jvanekmock00000000000000/* LogConfig.java Copyright (C) 2011, 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util.logging; import java.io.File; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.config.PathsAndFiles; import net.sourceforge.jnlp.runtime.JNLPRuntime; /** * This file provides the information required to do logging. * */ public class LogConfig { // Directory where the logs are stored. private String icedteaLogDir; private boolean enableLogging; private boolean enableHeaders; private boolean logToFile; private boolean logClientAppToFile; private boolean logToStreams; private boolean logToSysLog; private boolean legacyLogaAsedFileLog; private LogConfig() { DeploymentConfiguration config = JNLPRuntime.getConfiguration(); // Check whether logging and tracing is enabled. enableLogging = Boolean.parseBoolean(config.getProperty(DeploymentConfiguration.KEY_ENABLE_LOGGING)); //enagle disable headers enableHeaders = Boolean.parseBoolean(config.getProperty(DeploymentConfiguration.KEY_ENABLE_LOGGING_HEADERS)); //enable/disable individual channels logToFile = Boolean.parseBoolean(config.getProperty(DeploymentConfiguration.KEY_ENABLE_LOGGING_TOFILE)); logToStreams = Boolean.parseBoolean(config.getProperty(DeploymentConfiguration.KEY_ENABLE_LOGGING_TOSTREAMS)); logToSysLog = Boolean.parseBoolean(config.getProperty(DeploymentConfiguration.KEY_ENABLE_LOGGING_TOSYSTEMLOG)); legacyLogaAsedFileLog = Boolean.parseBoolean(config.getProperty(DeploymentConfiguration.KEY_ENABLE_LEGACY_LOGBASEDFILELOG)); logClientAppToFile = Boolean.parseBoolean(config.getProperty(DeploymentConfiguration.KEY_ENABLE_APPLICATION_LOGGING_TOFILE)); // Get log directory, create it if it doesn't exist. If unable to create and doesn't exist, don't log. icedteaLogDir = PathsAndFiles.LOG_DIR.getFullPath(); if (icedteaLogDir != null) { File f = new File(icedteaLogDir); if (f.isDirectory() || f.mkdirs()) { icedteaLogDir += File.separator; } else { enableLogging = false; } } else { enableLogging = false; } } private static class LogConfigHolder { //https://en.wikipedia.org/wiki/Double-checked_locking#Usage_in_Java //https://en.wikipedia.org/wiki/Initialization_on_demand_holder_idiom private static volatile LogConfig INSTANCE = new LogConfig(); } public static LogConfig getLogConfig() { return LogConfigHolder.INSTANCE; } /** * For testing only: throw away the previous config */ static synchronized void resetLogConfig() { LogConfigHolder.INSTANCE = new LogConfig(); } public String getIcedteaLogDir() { return icedteaLogDir; } public boolean isEnableLogging() { return enableLogging; } public boolean isLogToFile() { return logToFile; } public boolean isLogToStreams() { return logToStreams; } public boolean isLogToSysLog() { return logToSysLog; } public boolean isEnableHeaders() { return enableHeaders; } //package private setters for testing void setEnableHeaders(boolean enableHeaders) { this.enableHeaders = enableHeaders; } void setEnableLogging(boolean enableLogging) { this.enableLogging = enableLogging; } void setIcedteaLogDir(String icedteaLogDir) { this.icedteaLogDir = icedteaLogDir; } void setLogToFile(boolean logToFile) { this.logToFile = logToFile; } void setLogToStreams(boolean logToStreams) { this.logToStreams = logToStreams; } void setLogToSysLog(boolean logToSysLog) { this.logToSysLog = logToSysLog; } boolean isLogToConsole() { return JavaConsole.isEnabled(); } boolean isLegacyLogBasedFileLog() { return legacyLogaAsedFileLog; } boolean setLegacyLogBasedFileLog(boolean b) { return legacyLogaAsedFileLog = b; } void serLogToFileForClientApp(boolean b) { logClientAppToFile = b; } boolean isLogToFileForClientApp() { return logClientAppToFile; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/logging/PaxHeaders.17941/JavaConsole.java0000644000000000000000000000013212654402377026151 xustar0030 mtime=1454507263.265432208 30 atime=1454507327.164580003 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/logging/JavaConsole.java0000644000175000002070000005102612654402377026700 0ustar00jvanekmock00000000000000/* JavaConsole -- A java console for the plugin Copyright (C) 2009, 2013 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util.logging; import static net.sourceforge.jnlp.runtime.Translator.R; import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.InputStreamReader; import java.nio.charset.Charset; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Observable; import java.util.Properties; import java.util.Set; import javax.swing.JButton; import javax.swing.JComponent; import javax.swing.JDialog; import javax.swing.JFormattedTextField; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JSpinner; import javax.swing.JSplitPane; import javax.swing.SpinnerNumberModel; import javax.swing.SwingUtilities; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import javax.swing.text.DefaultFormatter; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.util.ImageResources; import net.sourceforge.jnlp.util.logging.headers.MessageWithHeader; import net.sourceforge.jnlp.util.logging.headers.ObservableMessagesProvider; import net.sourceforge.jnlp.util.logging.headers.PluginMessage; /** * A simple Java console for IcedTeaPlugin and JavaWS * */ public class JavaConsole implements ObservableMessagesProvider { final private List rawData = Collections.synchronizedList(new ArrayList()); final private List outputs = new ArrayList(); public JavaConsole() { //add middleware, which catches client's application stdout/err //and will submit it into console System.setErr(new TeeOutputStream(System.err, true)); System.setOut(new TeeOutputStream(System.out, false)); //internal stdOut/Err are going throughs outLog/errLog //when console is off, those tees are not installed } private void refreshOutputs() { refreshOutputs(outputsPanel, (Integer)numberOfOutputs.getValue()); } private void refreshOutputs(JPanel pane, int count) { pane.removeAll(); while(outputs.size()>count){ getObservable().deleteObserver(outputs.get(outputs.size()-1)); outputs.remove(outputs.size()-1); } while(outputs.size()=0; i--){ JSplitPane outerPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, outputs.get(i), splitPane); outerPane.setDividerLocation(0.5); outerPane.setResizeWeight(0.5); splitPane = outerPane; } pane.add(splitPane); } pane.validate(); } private static class PublicObservable extends Observable { @Override public synchronized void setChanged() { super.setChanged(); } } public static interface ClassLoaderInfoProvider { public Map getLoaderInfo(); } private static JavaConsole console; private Dimension lastSize; private JDialog consoleWindow; private JPanel contentPanel; private JPanel outputsPanel; private ClassLoaderInfoProvider classLoaderInfoProvider; private JSpinner numberOfOutputs; private PublicObservable observable = new PublicObservable(); private boolean initialized = false; private static class JavaConsoleHolder { //https://en.wikipedia.org/wiki/Double-checked_locking#Usage_in_Java //https://en.wikipedia.org/wiki/Initialization_on_demand_holder_idiom private static final JavaConsole INSTANCE = new JavaConsole(); } public static JavaConsole getConsole() { return JavaConsoleHolder.INSTANCE; } public static boolean isEnabled() { return isEnabled(JNLPRuntime.getConfiguration()); } public static boolean isEnabled(DeploymentConfiguration config) { return !DeploymentConfiguration.CONSOLE_DISABLE.equals(config.getProperty(DeploymentConfiguration.KEY_CONSOLE_STARTUP_MODE)) && !JNLPRuntime.isHeadless(); } public static boolean canShowOnStartup(boolean isApplication) { return canShowOnStartup(isApplication, JNLPRuntime.getConfiguration()); } public static boolean canShowOnStartup(boolean isApplication, DeploymentConfiguration config) { if (!isEnabled(config)) { return false; } return DeploymentConfiguration.CONSOLE_SHOW.equals(config.getProperty(DeploymentConfiguration.KEY_CONSOLE_STARTUP_MODE)) || (DeploymentConfiguration.CONSOLE_SHOW_PLUGIN.equals(config.getProperty(DeploymentConfiguration.KEY_CONSOLE_STARTUP_MODE)) && !isApplication) || (DeploymentConfiguration.CONSOLE_SHOW_JAVAWS.equals(config.getProperty(DeploymentConfiguration.KEY_CONSOLE_STARTUP_MODE)) && isApplication); } private void initializeWindow() { if (!initialized){ initialize(); } initializeWindow(lastSize, contentPanel); } private void initializeWindow(Dimension size, JPanel content) { consoleWindow = new JDialog((JFrame) null, R("DPJavaConsole")); consoleWindow.addWindowListener(new WindowAdapter() { @Override public void windowClosed(WindowEvent e) { lastSize=consoleWindow.getSize(); } }); consoleWindow.setIconImages(ImageResources.INSTANCE.getApplicationImages()); //view is added after console is made visible so no performance impact when hidden/ refreshOutputs(); consoleWindow.add(content); consoleWindow.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); //HIDE_ON_CLOSE can cause shut down deadlock consoleWindow.pack(); if (size!=null){ consoleWindow.setSize(size); } else { consoleWindow.setSize(new Dimension(900, 600)); } consoleWindow.setMinimumSize(new Dimension(300, 300)); } /** * Initialize the console */ private void initialize() { contentPanel = new JPanel(); outputsPanel = new JPanel(); outputsPanel.setLayout(new BorderLayout()); contentPanel.setLayout(new GridBagLayout()); GridBagConstraints c; c = new GridBagConstraints(); c.fill = GridBagConstraints.BOTH; c.gridheight = 10; c.weighty = 1; contentPanel.add(outputsPanel, c); /* buttons */ c = new GridBagConstraints(); c.gridy = 10; c.gridheight = 1; c.weightx = 0.5; c.weighty = 0; JPanel buttonPanel = new JPanel(); buttonPanel.setLayout(new GridLayout(2, 0, 0, 0)); contentPanel.add(buttonPanel, c); JButton gcButton = new JButton(R("CONSOLErungc")); buttonPanel.add(gcButton); gcButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { printMemoryInfo(); OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, "Performing Garbage Collection...."); System.gc(); OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, R("ButDone")); printMemoryInfo(); updateModel(); } }); JButton finalizersButton = new JButton(R("CONSOLErunFinalizers")); buttonPanel.add(finalizersButton); finalizersButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { printMemoryInfo(); OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, R("CONSOLErunningFinalizers")); Runtime.getRuntime().runFinalization(); OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, R("ButDone")); printMemoryInfo(); updateModel(); } }); JButton memoryButton = new JButton(R("CONSOLEmemoryInfo")); buttonPanel.add(memoryButton); memoryButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { printMemoryInfo(); updateModel(); } }); JButton systemPropertiesButton = new JButton(R("CONSOLEsystemProperties")); buttonPanel.add(systemPropertiesButton); systemPropertiesButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { printSystemProperties(); updateModel(); } }); JButton classloadersButton = new JButton(R("CONSOLEclassLoaders")); buttonPanel.add(classloadersButton); classloadersButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { printClassLoaders(); updateModel(); } }); JButton threadListButton = new JButton(R("CONSOLEthreadList")); buttonPanel.add(threadListButton); threadListButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { printThreadInfo(); updateModel(); } }); JLabel numberOfOutputsL = new JLabel(" Number of outputs: "); buttonPanel.add(numberOfOutputsL); numberOfOutputs = new JSpinner(new SpinnerNumberModel(1, 0, 10, 1)); JComponent comp = numberOfOutputs.getEditor(); JFormattedTextField field = (JFormattedTextField) comp.getComponent(0); DefaultFormatter formatter = (DefaultFormatter) field.getFormatter(); formatter.setCommitsOnValidEdit(true); numberOfOutputs.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { refreshOutputs(); } }); buttonPanel.add(numberOfOutputs); JButton closeButton = new JButton(R("ButClose")); buttonPanel.add(closeButton); closeButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { hideConsole(); } }); } }); JButton cleanButton = new JButton(R("CONSOLEClean")); buttonPanel.add(cleanButton); cleanButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { synchronized (rawData){ rawData.clear(); updateModel(true); } } }); initialized = true; } public void showConsole() { showConsole(false); } public void showConsole(boolean modal) { if (consoleWindow == null || !consoleWindow.isVisible()){ initializeWindow(); consoleWindow.setModal(modal); consoleWindow.setVisible(true); } } public void hideConsole() { //no need to update when hidden outputsPanel.removeAll();//?? getObservable().deleteObservers(); consoleWindow.setModal(false); consoleWindow.setVisible(false); consoleWindow.dispose(); } public void showConsoleLater() { showConsoleLater(false); } public void showConsoleLater(final boolean modal) { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { JavaConsole.getConsole().showConsole(modal); } }); } public void hideConsoleLater() { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { JavaConsole.getConsole().hideConsole(); } }); } protected void printSystemProperties() { OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, " ----"); OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, R("CONSOLEsystemProperties") + ":"); OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, ""); Properties p = System.getProperties(); Set keys = p.keySet(); for (Object key : keys) { OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, key.toString() + ": " + p.get(key)); } OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, " ----"); } public void setClassLoaderInfoProvider(ClassLoaderInfoProvider clip) { classLoaderInfoProvider = clip; } private void printClassLoaders() { if (classLoaderInfoProvider == null) { OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, R("CONSOLEnoClassLoaders")); } else { OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, " ----"); OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, R("CONSOLEclassLoaders") + ": "); Set loaders = classLoaderInfoProvider.getLoaderInfo().keySet(); for (String loader : loaders) { OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, loader + "\n" + " codebase = " + classLoaderInfoProvider.getLoaderInfo().get(loader)); } OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, " ----"); } } private void printMemoryInfo() { OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, " ----- "); OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, " " + R("CONSOLEmemoryInfo") + ":"); OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, " " + R("CONSOLEmemoryMax") + ": " + String.format("%1$10d", Runtime.getRuntime().maxMemory())); OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, " " + R("CONSOLEmemoryTotal") + ": " + String.format("%1$10d", Runtime.getRuntime().totalMemory())); OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, " " + R("CONSOLEmemoryFree") + ": " + String.format("%1$10d", Runtime.getRuntime().freeMemory())); OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, " ----"); } private void printThreadInfo() { Map map = Thread.getAllStackTraces(); Set keys = map.keySet(); for (Thread key : keys) { OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, R("CONSOLEthread") + " " + key.getId() + ": " + key.getName()); for (StackTraceElement element : map.get(key)) { OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, " " + element); } } } public static void main(String[] args) { final JavaConsole cconsole = new JavaConsole(); boolean toShowConsole = true; for (String arg : args) { if ("--show-console".equals(arg)) { toShowConsole = true; } } if (toShowConsole) { cconsole.showConsoleLater(); } } synchronized void addMessage(MessageWithHeader m) { rawData.add(m); updateModel(); } private synchronized void updateModel() { updateModel(null); } private synchronized void updateModel(Boolean force) { observable.setChanged(); observable.notifyObservers(force); } /** * parse plugin message and add it as header+message to data * @param s string to be parsed */ private void processPluginMessage(String s) { PluginMessage pm = new PluginMessage(s); OutputController.getLogger().log(pm); } @Override public List getData() { return rawData; } @Override public Observable getObservable() { return observable; } public void createPluginReader(final File file) { OutputController.getLogger().log("Starting processing of plugin-debug-to-console " + file.getAbsolutePath()); Thread t = new Thread(new Runnable() { @Override public void run() { BufferedReader br = null; try { br = new BufferedReader(new InputStreamReader(new FileInputStream(file), Charset.forName("UTF-8"))); //never ending loop while (true) { try{ String s = br.readLine(); if (s == null) { break; } processPluginMessage(s); }catch(Exception ex){ OutputController.getLogger().log(ex); } } } catch (Exception ex) { OutputController.getLogger().log(ex); if (br != null) { try { br.close(); } catch (Exception exx) { OutputController.getLogger().log(exx); } } } OutputController.getLogger().log("Ended processing of plugin-debug-to-console " + file.getAbsolutePath()); } }, "plugin-debug-to-console reader thread"); t.setDaemon(true); t.start(); OutputController.getLogger().log("Started processing of plugin-debug-to-console " + file.getAbsolutePath()); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/logging/PaxHeaders.17941/FileLog.java0000644000000000000000000000013212654402377025266 xustar0030 mtime=1454507263.264432221 30 atime=1454507327.164580003 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/logging/FileLog.java0000644000175000002070000001043512654402377026014 0ustar00jvanekmock00000000000000/* FileLog.java Copyright (C) 2011, 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util.logging; import java.text.SimpleDateFormat; import java.util.Date; import net.sourceforge.jnlp.util.docprovider.TextsProvider; import net.sourceforge.jnlp.util.logging.filelogs.LogBasedFileLog; import net.sourceforge.jnlp.util.logging.filelogs.WriterBasedFileLog; import net.sourceforge.jnlp.util.logging.headers.Header; /** * This class is utility and factory around file logs. */ public final class FileLog { public static Header getHeadlineHeader() { return new Header(OutputController.Level.WARNING_ALL, Thread.currentThread().getStackTrace(), Thread.currentThread(), false); } private static final class SingleStreamLoggerImpl implements SingleStreamLogger { public SingleStreamLoggerImpl() { } @Override public void log(String s) { //dummy } @Override public void close() { //dummy } } public static final SimpleDateFormat fileLogNameFormatter = new SimpleDateFormat("yyyy-MM-dd_HH:mm:ss.S"); /**"Tue Nov 19 09:43:50 CET 2013"*/ public static final SimpleDateFormat pluginSharedFormatter = new SimpleDateFormat("EEE MMM dd HH:mm:ss ZZZ yyyy"); public static final String defaultloggerName = TextsProvider.ITW + " file-logger"; public static SingleStreamLogger createFileLog() { return createFileLog("javantx"); } public static SingleStreamLogger createAppFileLog() { return createFileLog("clienta"); } private static SingleStreamLogger createFileLog(String id) { SingleStreamLogger s; try { if (LogConfig.getLogConfig().isLegacyLogBasedFileLog()) { s = new LogBasedFileLog(defaultloggerName, getFileName(id), false); } else { s = new WriterBasedFileLog(defaultloggerName, getFileName(id), false); } } catch (Exception ex) { //we do not wont to block whole logging just because initialization error in "new FileLog()" OutputController.getLogger().log(ex); s = new SingleStreamLoggerImpl(); } return s; } private static String getFileName(String id) { return LogConfig.getLogConfig().getIcedteaLogDir() + "itw-"+id+"-" + getStamp() + ".log"; } public static String getStamp() { return fileLogNameFormatter.format(new Date()); } public static SimpleDateFormat getFileLogNameFormatter() { return fileLogNameFormatter; } public static SimpleDateFormat getPluginSharedFormatter() { return pluginSharedFormatter; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/logging/PaxHeaders.17941/ConsoleOutputPaneModel.jav0000644000000000000000000000013212654402377030214 xustar0030 mtime=1454507263.264432221 30 atime=1454507327.164580003 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/logging/ConsoleOutputPaneModel.java0000644000175000002070000004362212654402377031107 0ustar00jvanekmock00000000000000package net.sourceforge.jnlp.util.logging; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.List; import java.util.Observable; import java.util.Random; import java.util.regex.Pattern; import net.sourceforge.jnlp.util.logging.OutputController.Level; import net.sourceforge.jnlp.util.logging.headers.Header; import net.sourceforge.jnlp.util.logging.headers.JavaMessage; import net.sourceforge.jnlp.util.logging.headers.MessageWithHeader; import net.sourceforge.jnlp.util.logging.headers.ObservableMessagesProvider; import net.sourceforge.jnlp.util.logging.headers.PluginHeader; import net.sourceforge.jnlp.util.logging.headers.PluginMessage; public class ConsoleOutputPaneModel { ConsoleOutputPaneModel(ObservableMessagesProvider dataProvider) { this.dataProvider = dataProvider; } boolean shouldUpdate() { for (int i = lastUpdateIndex; i < dataProvider.getData().size(); i++) { if (!filtered(dataProvider.getData().get(i))) { return true; } } return false; } private abstract class CatchedMessageWithHeaderComparator implements Comparator { @Override public int compare(MessageWithHeader o1, MessageWithHeader o2) { try { final int order = revertSort ? 1 : -1; return order * body(o1, o2); } catch (NullPointerException npe) { //caused by corrupted c messages return 0; } } abstract int body(MessageWithHeader o1, MessageWithHeader o2); } //testign data provider static class TestMessagesProvider extends Observable implements ObservableMessagesProvider { List data = new ArrayList(); List origData = new ArrayList(); public List getData() { return data; } @Override public Observable getObservable() { return this; } public TestMessagesProvider() { createData(); new Thread(new Runnable() { @Override public void run() { while (true) { try { Thread.sleep(new Random().nextInt(2000)); data.add(origData.get(new Random().nextInt(origData.size()))); TestMessagesProvider.this.setChanged(); TestMessagesProvider.this.notifyObservers(); } catch (Exception ex) { ex.printStackTrace(); } } } }).start(); } void createData() { String[] plugin = { "plugindebug 1384850630162925 [jvanek][ITW-C-PLUGIN][MESSAGE_DEBUG][Tue Nov 19 09:43:50 CET 2013][/home/jvanek/Desktop/icedtea-web/plugin/icedteanp/IcedTeaNPPlugin.cc:1204] ITNPP Thread# 140513434003264, gthread 0x7fcbd531f8c0: PIPE: plugin read: plugin PluginProxyInfo reference 1 http://www.walter-fendt.de:80", "preinit_plugindebug 1384850630162920 [jvanek][ITW-C-PLUGIN][MESSAGE_DEBUG][Tue Nov 19 09:43:50 CET 2013][/home/jvanek/Desktop/icedtea-web/plugin/icedteanp/IcedTeaNPPlugin.cc:1204] ITNPP Thread# 140513434003264, gthread 0x7fcbd531f8c0: PIPE: plugin read: plugin PluginProxyInfo reference 1 http://www.walter-fendt.de:80", "plugindebugX 1384850630162954 [jvanek][ITW-Cplugindebug 1384850630163008 [jvanek][ITW-C-PLUGIN][MESSAGE_DEBUG][Tue Nov 19 09:43:50 CET 2013][/home/jvanek/Desktop/icedtea-web/plugin/icedteanp/IcedTeaNPPlugin.cc:1124] ITNPP Thread# 140513434003264, gthread 0x7fcbd531f8c0: parts[0]=plugin, parts[1]=PluginProxyInfo, reference, parts[3]=1, parts[4]=http://www.walter-fendt.de:80 -- decoded_url=http://www.walter-fendt.de:80", "preinit_pluginerror 1384850630163294 [jvanek][ITW-C-PLUGIN][MESSAGE_ERROR][Tue Nov 19 09:43:50 CET 2013][/home/jvanek/Desktop/icedtea-web/plugin/icedteanp/IcedTeaNPPlugin.cc:1134] ITNPP Thread# 140513434003264, gthread 0x7fcbd531f8c0: Proxy info: plugin PluginProxyInfo reference 1 DIRECT", "pluginerror 1384850630163291 [jvanek][ITW-C-PLUGIN][MESSAGE_ERROR][Tue Nov 19 09:43:50 CET 2013][/home/jvanek/Desktop/icedtea-web/plugin/icedteanp/IcedTeaNPPlugin.cc:1134] ITNPP Thread# 140513434003264, gthread 0x7fcbd531f8c0: Proxy info: plugin PluginProxyInfo reference 1 DIRECT" }; for (String string : plugin) { origData.add(new PluginMessage(string)); } origData.add(new JavaMessage(new Header(Level.ERROR_ALL, Thread.currentThread().getStackTrace(), Thread.currentThread(), false), "message 1")); origData.add(new JavaMessage(new Header(Level.ERROR_DEBUG, Thread.currentThread().getStackTrace(), Thread.currentThread(), false), "message 3")); origData.add(new JavaMessage(new Header(Level.WARNING_ALL, Thread.currentThread().getStackTrace(), Thread.currentThread(), false), "message 2")); origData.add(new JavaMessage(new Header(Level.WARNING_DEBUG, Thread.currentThread().getStackTrace(), Thread.currentThread(), false), "message 4")); origData.add(new JavaMessage(new Header(Level.MESSAGE_DEBUG, Thread.currentThread().getStackTrace(), Thread.currentThread(), false), "message 9")); JavaMessage m1 = new JavaMessage(new Header(Level.MESSAGE_ALL, Thread.currentThread().getStackTrace(), Thread.currentThread(), false), "app1"); JavaMessage m2 = new JavaMessage(new Header(Level.ERROR_ALL, Thread.currentThread().getStackTrace(), Thread.currentThread(), false), "app2"); m1.getHeader().isClientApp = true; m2.getHeader().isClientApp = true; origData.add(m1); origData.add(m2); origData.add(new JavaMessage(new Header(Level.MESSAGE_ALL, Thread.currentThread().getStackTrace(), Thread.currentThread(), false), "message 0 - multilined \n" + "since beggining\n" + " later\n" + "again from beggingin\n" + " even later")); data.addAll(origData); } } static final Pattern defaultPattern = Pattern.compile("(m?)(.*\n*)*"); ObservableMessagesProvider dataProvider; Pattern lastValidPattern = defaultPattern; Pattern usedPattern = lastValidPattern; int lastUpdateIndex; //to add just what was added newly int statisticsShown; private static final String HTMLCOLOR_DIMRED = "FF6666"; private static final String HTMLCOLOR_MIDGRAY = "666666"; private static final String HTMLCOLOR_SPARKRED = "FF0000"; private static final String HTMLCOLOR_LIGHTGRAY = "AAAAAA"; private static final String HTMLCOLOR_GREENYELLOW = "AAAA00"; private static final String HTMLCOLOR_PINKYREAD = "FF0055"; private static final String HTMLCOLOR_BLACK = "000000"; private static final String HTMLCOLOR_GREEN = "669966"; private static final String HTMLCOLOR_PURPLE = "990066"; String importList() { return importList(lastUpdateIndex); } String importList(int start) { return importList(highLight, start); } String importList(boolean mark, int start) { return importList(mark, start, sortBy); } String importList(boolean mark, int start, int sortByLocal) { int added = start; StringBuilder sb = new StringBuilder(); if (mark) { sb.append("
    "); } List sortedList; synchronized (dataProvider.getData()) { if (start == 0) { sortedList = preSort(dataProvider.getData(), sortByLocal); } else { sortedList = preSort(Collections.synchronizedList(dataProvider.getData().subList(start, dataProvider.getData().size())), sortByLocal); } } lastUpdateIndex = dataProvider.getData().size(); for (MessageWithHeader messageWithHeader : sortedList) { if (filtered(messageWithHeader)) { continue; } if (mark) { sb.append("
    "); //sb.append(""); sb.append("
    "); } //always wrap, looks better, works smoother sb.append("\n"); added++; } if (mark) { sb.append("
    "); } statisticsShown = added; return sb.toString(); } public static String escapeHtmlForJTextPane(String line) { line = line.replaceAll("<", "<") .replaceAll(">", ">") .replaceAll("\n", "
    \n") .replaceAll(" ", "  ")//small trick, html is reducting row of spaces to single space. This handles it and stimm allow line wrap .replaceAll("\t", "    "); return line; } String createLine(MessageWithHeader m) { StringBuilder sb = new StringBuilder(); if (showHeaders) { sb.append(m.getHeader().toString(showUser, showOrigin, showLevel, showDate, showCode, showThread1, showThread2)); } if (showMessage && showHeaders) { sb.append(": "); } if (showMessage) { sb.append(m.getMessage().toString()); } return sb.toString(); } List preSort(List data, int sortByLocal) { List sortedData; if (sortByLocal == 0) { if (revertSort) { sortedData = Collections.synchronizedList(new ArrayList(data)); Collections.reverse(sortedData); } else { sortedData = data; } } else { sortedData = Collections.synchronizedList(new ArrayList(data)); switch (sortByLocal) { case 1: Collections.sort(sortedData, new CatchedMessageWithHeaderComparator() { @Override public int body(MessageWithHeader o1, MessageWithHeader o2) { return o1.getHeader().user.compareTo(o2.getHeader().user); } }); break; case 2: Collections.sort(sortedData, new CatchedMessageWithHeaderComparator() { @Override public int body(MessageWithHeader o1, MessageWithHeader o2) { return o1.getHeader().getOrigin().compareTo(o2.getHeader().getOrigin()); } }); break; case 3: Collections.sort(sortedData, new CatchedMessageWithHeaderComparator() { @Override public int body(MessageWithHeader o1, MessageWithHeader o2) { return o1.getHeader().level.toString().compareTo(o2.getHeader().level.toString()); } }); break; case 4: Collections.sort(sortedData, new CatchedMessageWithHeaderComparator() { @Override public int body(MessageWithHeader o1, MessageWithHeader o2) { return o1.getHeader().timestamp.compareTo(o2.getHeader().timestamp); } }); break; case 5: Collections.sort(sortedData, new CatchedMessageWithHeaderComparator() { @Override public int body(MessageWithHeader o1, MessageWithHeader o2) { return o1.getHeader().caller.compareTo(o2.getHeader().caller); } }); break; case 6: Collections.sort(sortedData, new CatchedMessageWithHeaderComparator() { @Override public int body(MessageWithHeader o1, MessageWithHeader o2) { return o1.getHeader().thread1.compareTo(o2.getHeader().thread1); } }); break; case 7: Collections.sort(sortedData, new CatchedMessageWithHeaderComparator() { @Override public int body(MessageWithHeader o1, MessageWithHeader o2) { return o1.getMessage().compareTo(o2.getMessage()); } }); break; case 8: Collections.sort(sortedData, new CatchedMessageWithHeaderComparator() { @Override public int body(MessageWithHeader o1, MessageWithHeader o2) { return o1.getHeader().thread2.compareTo(o2.getHeader().thread2); } }); break; } } return sortedData; } boolean filtered(MessageWithHeader m) { if (!showOut && m.getHeader().level.isOutput() && !m.getHeader().level.isWarning()) { return true; } if (!showErr && m.getHeader().level.isError() && !m.getHeader().level.isWarning()) { return true; } if (!showDebug && m.getHeader().level.isDebug()) { return true; } if (!showInfo && m.getHeader().level.isInfo()) { return true; } if (!showItw && !m.getHeader().isClientApp) { return true; } if (!showApp && m.getHeader().isClientApp) { return true; } if (!showJava && !m.getHeader().isC) { return true; } if (!showPlugin && m.getHeader().isC) { return true; } if (m.getHeader() instanceof PluginHeader) { PluginHeader mm = (PluginHeader) m.getHeader(); if (!showPreInit && mm.preinit) { return true; } if (!showPostInit && !mm.preinit) { return true; } if (!showIncomplete && m instanceof PluginMessage && ((PluginMessage) (m)).wasError) { return true; } if (!showComplete && m instanceof PluginMessage && !((PluginMessage) (m)).wasError) { return true; } } if (regExLabel) { String s = createLine(m); if (matchPattern && !usedPattern.matcher(s).matches()) { return true; } if (!matchPattern && usedPattern.matcher(s).matches()) { return true; } } return false; } String createStatisticHint() { return statisticsShown + "/" + dataProvider.getData().size(); } boolean highLight; boolean matchPattern; boolean regExLabel; boolean revertSort; boolean showCode; boolean showComplete; boolean showDate; boolean showDebug; boolean showErr; boolean showHeaders; boolean showIncomplete; boolean showInfo; boolean showItw; boolean showApp; boolean showJava; boolean showLevel; boolean showMessage; boolean showOrigin; boolean showOut; boolean showPlugin; boolean showPostInit; boolean showPreInit; boolean showThread1; boolean showThread2; boolean showUser; int sortBy; boolean wordWrap; } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/logging/PaxHeaders.17941/ConsoleOutputPane.java0000644000000000000000000000013212654402377027374 xustar0030 mtime=1454507263.264432221 30 atime=1454507327.164580003 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/logging/ConsoleOutputPane.java0000644000175000002070000012420612654402377030124 0ustar00jvanekmock00000000000000package net.sourceforge.jnlp.util.logging; import java.awt.Color; import java.awt.BorderLayout; import java.awt.EventQueue; import java.awt.Toolkit; import java.awt.datatransfer.Clipboard; import java.awt.datatransfer.StringSelection; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.io.IOException; import java.util.Observable; import java.util.Observer; import java.util.concurrent.atomic.AtomicBoolean; import java.util.regex.Pattern; import javax.swing.ButtonGroup; import javax.swing.DefaultComboBoxModel; import javax.swing.GroupLayout; import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JComboBox; import javax.swing.JEditorPane; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JMenuItem; import javax.swing.JPanel; import javax.swing.JPopupMenu; import javax.swing.JRadioButton; import javax.swing.JScrollPane; import javax.swing.JTextField; import javax.swing.JTextPane; import javax.swing.LayoutStyle; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; import javax.swing.text.BadLocationException; import javax.swing.text.DefaultHighlighter; import javax.swing.text.Document; import javax.swing.text.PlainDocument; import javax.swing.text.html.HTMLDocument; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.runtime.Translator; import net.sourceforge.jnlp.util.logging.headers.ObservableMessagesProvider; public class ConsoleOutputPane extends JPanel implements Observer { private boolean canChange = true; @Override public synchronized void update(final Observable o, final Object arg) { boolean force = false; if (arg instanceof Boolean && ((Boolean)arg).booleanValue()) { force = true; } if (force) { refreshPane(); return; } if (!autorefresh.isSelected()) { statistics.setText(model.createStatisticHint()); return; } final boolean passed = model.shouldUpdate(); if (!passed) { statistics.setText(model.createStatisticHint()); return; } if (sortBy.getSelectedIndex() == 0) { //no sort, we can just update updatePane(false); } else { refreshPane(); } } private final ConsoleOutputPaneModel model; private int lastPostion; //index of search private final DefaultHighlighter.DefaultHighlightPainter searchHighligh = new DefaultHighlighter.DefaultHighlightPainter(Color.blue); private Object lastSearchTag; public ConsoleOutputPane(final ObservableMessagesProvider dataProvider) { model = new ConsoleOutputPaneModel(dataProvider); // Create final JComponents members jPanel2 = new JPanel(); jpanel2scrollpane = new JScrollPane(jPanel2); showHeaders = new JCheckBox(); showUser = new JCheckBox(); sortCopyAll = new JCheckBox(); showOrigin = new JCheckBox(); showLevel = new JCheckBox(); showDate = new JCheckBox(); showThread1 = new JCheckBox(); showThread2 = new JCheckBox(); showMessage = new JCheckBox(); showOut = new JCheckBox(); showErr = new JCheckBox(); showJava = new JCheckBox(); showPlugin = new JCheckBox(); showPreInit = new JCheckBox(); sortByLabel = new JLabel(); regExLabel = new JCheckBox(); sortBy = new JComboBox<>(); searchLabel = new JLabel(); autorefresh = new JCheckBox(); refresh = new JButton(); apply = new JButton(); regExFilter = new JTextField(); copyPlain = new JButton(); copyRich = new JButton(); next = new JButton(); previous = new JButton(); search = new JTextField(); caseSensitive = new JCheckBox(); showIncomplete = new JCheckBox(); highLight = new JCheckBox(); wordWrap = new JCheckBox(); showDebug = new JCheckBox(); showInfo = new JCheckBox(); showItw = new JCheckBox(); showApp = new JCheckBox(); showCode = new JCheckBox(); statistics = new JLabel(); showPostInit = new JCheckBox(); showComplete = new JCheckBox(); match = new JRadioButton(); notMatch = new JRadioButton(); revertSort = new JCheckBox(); mark = new JCheckBox(); jScrollPane1 = new JScrollPane(); jEditorPane1 = new JTextPane(); showHide = new JButton(); insertChars = new JPopupMenu(); initComponents(); regExFilter.setText(ConsoleOutputPaneModel.defaultPattern.pattern()); showHeaders.setSelected(LogConfig.getLogConfig().isEnableHeaders()); setHeadersCheckBoxesEnabled(showHeaders.isSelected()); setMessagesCheckBoxesEnabled(showMessage.isSelected()); refresh.setEnabled(!autorefresh.isSelected()); if (JNLPRuntime.isWebstartApplication()) { showPlugin.setSelected(false); showPreInit.setSelected(false); showPostInit.setSelected(false); showIncomplete.setSelected(false); showComplete.setSelected(false); showPlugin.setEnabled(false); showPreInit.setEnabled(false); showPostInit.setEnabled(false); showIncomplete.setEnabled(false); showComplete.setEnabled(false); } regExFilter.getDocument().addDocumentListener(new DocumentListener() { @Override public final void insertUpdate(final DocumentEvent e) { colorize(); } @Override public final void removeUpdate(final DocumentEvent e) { colorize(); } @Override public final void changedUpdate(final DocumentEvent e) { colorize(); } private final void colorize() { try { final String s = regExFilter.getText(); final Pattern p = Pattern.compile(s); model.lastValidPattern = p; regExLabel.setForeground(Color.green); } catch (Exception ex) { regExLabel.setForeground(Color.red); } } }); regExFilter.addMouseListener(new MouseAdapter() { @Override public final void mouseClicked(final MouseEvent e) { EventQueue.invokeLater(new Runnable() { @Override public final void run() { try { if (e.getButton() != MouseEvent.BUTTON3) { insertChars.setVisible(false); return; } insertChars.setLocation(e.getXOnScreen(), e.getYOnScreen()); insertChars.setVisible(!insertChars.isVisible()); } catch (Exception ex) { OutputController.getLogger().log(ex); } } }); } }); regExFilter.addKeyListener(new KeyAdapter() { @Override public final void keyPressed(final KeyEvent e) { if (e.getKeyCode() != KeyEvent.VK_CONTEXT_MENU) { return; } EventQueue.invokeLater(new Runnable() { @Override public final void run() { try { insertChars.setLocation(regExFilter.getLocationOnScreen()); insertChars.setVisible(!insertChars.isVisible()); } catch (Exception ex) { OutputController.getLogger().log(ex); } } }); } }); final ButtonGroup matches = new ButtonGroup(); matches.add(match); matches.add(notMatch); showHideActionPerformed(null); updateModel(); refreshPane(); } private final ActionListener createDefaultAction() { return new ActionListener() { @Override public final void actionPerformed(final ActionEvent evt) { if (evt == null) return; final Object source; if ((source = evt.getSource()) == showHeaders) { setHeadersCheckBoxesEnabled(showHeaders.isSelected()); } else if (source == showMessage) { setMessagesCheckBoxesEnabled(showMessage.isSelected()); } else if (source == autorefresh) { refresh.setEnabled(!autorefresh.isSelected()); } refreshAction(); } }; } final ActionListener defaultActionSingleton = createDefaultAction(); private final ActionListener getDefaultActionSingleton() { return defaultActionSingleton; } private synchronized final void refreshPane() { if (highLight.isSelected()) { jEditorPane1.setContentType("text/html"); } else { jEditorPane1.setContentType("text/plain"); } model.lastUpdateIndex = 0; updatePane(true); } /** * when various threads update (and it can be)underlying jeditorpane * simultaneously, then it can lead to unpredictable issues synchronization * is done in invoke later */ private final AtomicBoolean done = new AtomicBoolean(true); private synchronized final void updatePane(final boolean reset) { if (!done.get()) { return; } done.set(false); EventQueue.invokeLater(new Runnable() { @Override public final void run() { try { refreshPaneBody(reset); } catch (Exception ex) { OutputController.getLogger().log(ex); } finally { done.set(true); } } }); } private final void refreshPaneBody(final boolean reset) throws BadLocationException, IOException { if (reset) { jEditorPane1.setText(model.importList(0)); } else { final String s = model.importList(); if (highLight.isSelected()) { HTMLDocument orig = (HTMLDocument) jEditorPane1.getDocument(); if (revertSort.isSelected()) { orig.insertAfterEnd(orig.getRootElements()[0].getElement(0)/*body*/, s); } else { orig.insertBeforeEnd(orig.getRootElements()[0], s); } } else { if (revertSort.isSelected()) { jEditorPane1.setText(s + jEditorPane1.getText()); } else { jEditorPane1.setText(jEditorPane1.getText() + s); } } } jEditorPane1.setCaretPosition(0); //jEditorPane1.repaint(); if (mark.isSelected()) { markActionPerformed(null); } statistics.setText(model.createStatisticHint()); } private final void initComponents() { //this is crucial, otherwie PlainDocument implementatin is repalcing all \n by space ((PlainDocument)regExFilter.getDocument()).getDocumentProperties().remove("filterNewlines"); sortCopyAll.setSelected(true); sortCopyAll.setText(Translator.R("COPsortCopyAllDate")); sortCopyAll.setToolTipText("The sort by date is a bit more time consuming, but most natural for posting purposes"); showHeaders.setSelected(true); showHeaders.setText(Translator.R("COPshowHeaders")); showHeaders.addActionListener(getDefaultActionSingleton()); showUser.setSelected(true); showUser.setText(Translator.R("COPuser")); showUser.addActionListener(getDefaultActionSingleton()); showOrigin.setSelected(true); showOrigin.setText(Translator.R("COPorigin")); showOrigin.addActionListener(getDefaultActionSingleton()); showLevel.setSelected(true); showLevel.setText(Translator.R("COPlevel")); showLevel.addActionListener(getDefaultActionSingleton()); showDate.setSelected(true); showDate.setText(Translator.R("COPdate")); showDate.addActionListener(getDefaultActionSingleton()); showThread1.setSelected(true); showThread1.setText(Translator.R("COPthread1")); showThread1.addActionListener(getDefaultActionSingleton()); showThread2.setSelected(true); showThread2.setText(Translator.R("COPthread2")); showThread2.addActionListener(getDefaultActionSingleton()); showMessage.setSelected(true); showMessage.setText(Translator.R("COPShowMessages")); showMessage.addActionListener(getDefaultActionSingleton()); showOut.setSelected(true); showOut.setText(Translator.R("COPstdOut")); showOut.addActionListener(getDefaultActionSingleton()); showErr.setSelected(true); showErr.setText(Translator.R("COPstdErr")); showErr.addActionListener(getDefaultActionSingleton()); showJava.setSelected(true); showJava.setText(Translator.R("COPjava")); showJava.addActionListener(getDefaultActionSingleton()); showPlugin.setSelected(true); showPlugin.setText(Translator.R("COPplugin")); showPlugin.addActionListener(getDefaultActionSingleton()); showPreInit.setSelected(true); showPreInit.setText(Translator.R("COPpreInit")); showPreInit.setToolTipText(Translator.R("COPpluginOnly")); showPreInit.addActionListener(getDefaultActionSingleton()); sortByLabel.setText(Translator.R("COPSortBy") + ":"); regExLabel.setText(Translator.R("COPregex") + ":"); regExLabel.addActionListener(getDefaultActionSingleton()); sortBy.setModel(new DefaultComboBoxModel<>(new String[] { Translator.R("COPAsArrived"), Translator.R("COPuser"), Translator.R("COPorigin"), Translator.R("COPlevel"), Translator.R("COPdate"), Translator.R("COPcode"), Translator.R("COPthread1"), Translator.R("COPthread2"), Translator.R("COPmessage")})); sortBy.addActionListener(getDefaultActionSingleton()); searchLabel.setText(Translator.R("COPSearch") + ":"); autorefresh.setSelected(true); autorefresh.setText(Translator.R("COPautoRefresh")); autorefresh.addActionListener(getDefaultActionSingleton()); refresh.setText(Translator.R("COPrefresh")); refresh.addActionListener(getDefaultActionSingleton()); apply.setText(Translator.R("COPApply")); apply.addActionListener(new ActionListener() { @Override public final void actionPerformed(final ActionEvent evt) { model.usedPattern = model.lastValidPattern; refreshAction(); } }); regExFilter.setText(".*"); copyPlain.setText(Translator.R("COPCopyAllPlain")); copyPlain.addActionListener(new ActionListener() { @Override public final void actionPerformed(final ActionEvent evt) { copyPlainActionPerformed(evt); } }); copyRich.setText(Translator.R("COPCopyAllRich")); copyRich.addActionListener(new ActionListener() { @Override public final void actionPerformed(final ActionEvent evt) { copyRichActionPerformed(evt); } }); next.setText(Translator.R("COPnext")); next.addActionListener(new ActionListener() { @Override public final void actionPerformed(final ActionEvent evt) { nextActionPerformed(evt); } }); previous.setText(Translator.R("COPprevious")); previous.addActionListener(new ActionListener() { @Override public final void actionPerformed(final ActionEvent evt) { previousActionPerformed(evt); } }); caseSensitive.setText(Translator.R("COPcaseSensitive")); showIncomplete.setSelected(true); showIncomplete.setText(Translator.R("COPincomplete")); showIncomplete.setToolTipText(Translator.R("COPpluginOnly")); showIncomplete.addActionListener(getDefaultActionSingleton()); highLight.setSelected(true); highLight.setText(Translator.R("COPhighlight")); highLight.addActionListener(getDefaultActionSingleton()); wordWrap.setText(Translator.R("COPwordWrap")); wordWrap.addActionListener(getDefaultActionSingleton()); showDebug.setSelected(true); showDebug.setText(Translator.R("COPdebug")); showDebug.addActionListener(getDefaultActionSingleton()); showInfo.setSelected(true); showInfo.setText(Translator.R("COPinfo")); showInfo.addActionListener(getDefaultActionSingleton()); showItw.setSelected(true); showItw.setText(Translator.R("COPitw")); showItw.addActionListener(getDefaultActionSingleton()); showApp.setSelected(true); showApp.setText(Translator.R("COPclientApp")); showApp.addActionListener(getDefaultActionSingleton()); showCode.setSelected(true); showCode.setText(Translator.R("COPcode")); showCode.addActionListener(getDefaultActionSingleton()); statistics.setText("x/y"); showPostInit.setSelected(true); showPostInit.setText(Translator.R("COPpostInit")); showPostInit.setToolTipText(Translator.R("COPpluginOnly")); showPostInit.addActionListener(getDefaultActionSingleton()); showComplete.setSelected(true); showComplete.setText(Translator.R("COPcomplete")); showComplete.setToolTipText(Translator.R("COPpluginOnly")); showComplete.addActionListener(getDefaultActionSingleton()); match.setSelected(true); match.setText(Translator.R("COPmatch")); match.addActionListener(getDefaultActionSingleton()); notMatch.setText(Translator.R("COPnot")); notMatch.addActionListener(getDefaultActionSingleton()); revertSort.setSelected(true); revertSort.setText(Translator.R("COPrevert")); revertSort.addActionListener(getDefaultActionSingleton()); mark.setText(Translator.R("COPmark")); mark.addActionListener(new ActionListener() { @Override public final void actionPerformed(final ActionEvent evt) { markActionPerformed(evt); } }); final GroupLayout jPanel2Layout = new GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup( jPanel2Layout.createParallelGroup( GroupLayout.Alignment.LEADING). addGroup( jPanel2Layout.createSequentialGroup().addContainerGap().addGroup( jPanel2Layout.createParallelGroup(GroupLayout.Alignment.LEADING). addGroup( jPanel2Layout.createSequentialGroup(). addComponent(showHeaders).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED). addComponent(showUser).addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED). addComponent(showOrigin).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED). addComponent(showLevel).addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED). addComponent(showDate).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED). addComponent(showCode).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED). addComponent(showThread1).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(showThread2)). addGroup(jPanel2Layout.createSequentialGroup().addGroup( jPanel2Layout.createParallelGroup(GroupLayout.Alignment.TRAILING).addGroup( GroupLayout.Alignment.LEADING, jPanel2Layout.createSequentialGroup() .addComponent(previous).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED). addComponent(mark).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED). addComponent(next).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 15, Short.MAX_VALUE). addComponent(wordWrap).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED). addComponent(highLight).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED). addComponent(sortCopyAll).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED). addComponent(copyRich).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED). addComponent(copyPlain)).addGroup(GroupLayout.Alignment.LEADING, jPanel2Layout.createSequentialGroup(). addComponent(searchLabel).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED). addComponent(search, GroupLayout.DEFAULT_SIZE, 438, Short.MAX_VALUE).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED). addComponent(caseSensitive)).addGroup( GroupLayout.Alignment.LEADING, jPanel2Layout.createSequentialGroup(). addComponent(showMessage).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED). addComponent(showOut).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(showErr).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED). addComponent(showJava).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED). addComponent(showPlugin).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(showDebug).addGap(6, 6, 6). addComponent(showInfo).addGap(6, 6, 6). addComponent(showItw).addGap(6, 6, 6). addComponent(showApp) )).addGap(2, 2, 2). addComponent(statistics)).addGroup( GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup(). addComponent(showPreInit).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED). addComponent(showPostInit).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED). addComponent(showIncomplete).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED). addComponent(showComplete)). addGroup(jPanel2Layout.createSequentialGroup(). addComponent(autorefresh).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED). addComponent(refresh).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED). addComponent(sortByLabel).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED). addComponent(revertSort).addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED). addComponent(sortBy, 0, 327, Short.MAX_VALUE)). addGroup(jPanel2Layout.createSequentialGroup(). addComponent(regExLabel).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED). addComponent(match).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED). addComponent(notMatch).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED). addComponent(regExFilter, GroupLayout.DEFAULT_SIZE, 237, Short.MAX_VALUE).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED). addComponent(apply, GroupLayout.PREFERRED_SIZE, 106, GroupLayout.PREFERRED_SIZE))).addContainerGap())); jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup( GroupLayout.Alignment.LEADING). addGroup( jPanel2Layout.createSequentialGroup().addContainerGap().addGroup( jPanel2Layout.createParallelGroup(GroupLayout.Alignment.BASELINE). addComponent(showHeaders). addComponent(showUser). addComponent(showLevel). addComponent(showDate). addComponent(showOrigin). addComponent(showCode). addComponent(showThread1). addComponent(showThread2)).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addGroup( jPanel2Layout.createParallelGroup(GroupLayout.Alignment.BASELINE). addComponent(showMessage). addComponent(showOut). addComponent(showErr). addComponent(showJava). addComponent(showPlugin). addComponent(showDebug). addComponent(showInfo). addComponent(showItw). addComponent(showApp). addComponent(statistics)).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addGroup( jPanel2Layout.createParallelGroup(GroupLayout.Alignment.BASELINE). addComponent(showPreInit). addComponent(showIncomplete). addComponent(showPostInit). addComponent(showComplete)).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addGroup( jPanel2Layout.createParallelGroup(GroupLayout.Alignment.LEADING). addGroup( jPanel2Layout.createSequentialGroup().addGap(32, 32, 32).addGroup( jPanel2Layout.createParallelGroup(GroupLayout.Alignment.BASELINE). addComponent(regExLabel).addComponent(regExFilter, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE). addComponent(apply). addComponent(match). addComponent(notMatch))). addGroup( jPanel2Layout.createParallelGroup(GroupLayout.Alignment.BASELINE). addComponent(autorefresh). addComponent(refresh). addComponent(sortByLabel).addComponent(sortBy, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE). addComponent(revertSort))).addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED).addGroup( jPanel2Layout.createParallelGroup(GroupLayout.Alignment.LEADING). addGroup( jPanel2Layout.createParallelGroup(GroupLayout.Alignment.BASELINE). addComponent(searchLabel).addComponent(search, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)). addComponent(caseSensitive)).addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED).addGroup( jPanel2Layout.createParallelGroup(GroupLayout.Alignment.LEADING). addComponent(previous). addGroup(jPanel2Layout.createParallelGroup(GroupLayout.Alignment.BASELINE). addComponent(sortCopyAll). addComponent(copyPlain). addComponent(copyRich). addComponent(highLight). addComponent(wordWrap)). addGroup(jPanel2Layout.createParallelGroup(GroupLayout.Alignment.BASELINE). addComponent(mark). addComponent(next))).addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jEditorPane1.setEditable(false); jScrollPane1.setViewportView(jEditorPane1); showHide.setText(Translator.R("ButHideDetails")); showHide.addActionListener(new ActionListener() { @Override public final void actionPerformed(final ActionEvent evt) { showHideActionPerformed(evt); } }); final GroupLayout jPanel1Layout = new GroupLayout(this); super.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(GroupLayout.Alignment.LEADING). addGroup(jPanel1Layout.createSequentialGroup().addContainerGap(). addGroup(jPanel1Layout.createParallelGroup(GroupLayout.Alignment.LEADING). addComponent(jScrollPane1, GroupLayout.DEFAULT_SIZE, 684, Short.MAX_VALUE). addGroup(jPanel1Layout.createSequentialGroup().addGroup(jPanel1Layout.createParallelGroup(GroupLayout.Alignment.TRAILING). addComponent(showHide, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 672, Short.MAX_VALUE). addComponent(jpanel2scrollpane, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)).addContainerGap())))); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(GroupLayout.Alignment.LEADING). addGroup(GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup().addContainerGap(). addComponent(jScrollPane1, GroupLayout.DEFAULT_SIZE, 329, Short.MAX_VALUE).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED). addComponent(jpanel2scrollpane, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED). addComponent(showHide).addContainerGap())); final JMenuItem tab = new JMenuItem("insert \\t"); tab.addActionListener(new ActionListener() { @Override public final void actionPerformed(final ActionEvent e) { EventQueue.invokeLater(new Runnable() { @Override public final void run() { try { final int i = regExFilter.getCaretPosition(); final StringBuilder s = new StringBuilder(regExFilter.getText()); s.insert(i, "\t"); regExFilter.setText(s.toString()); regExFilter.setCaretPosition(i + 1); insertChars.setVisible(false); } catch (Exception ex) { OutputController.getLogger().log(ex); } } }); } }); final JMenuItem newLine = new JMenuItem("insert \\n"); newLine.addActionListener(new ActionListener() { @Override public final void actionPerformed(final ActionEvent e) { EventQueue.invokeLater(new Runnable() { @Override public final void run() { try { final int i = regExFilter.getCaretPosition(); final StringBuilder s = new StringBuilder(regExFilter.getText()); s.insert(i, "\n"); regExFilter.setText(s.toString()); regExFilter.setCaretPosition(i + 1); insertChars.setVisible(false); } catch (Exception ex) { OutputController.getLogger().log(ex); } } }); } }); final JMenuItem resetRegex = new JMenuItem("reset default"); resetRegex.addActionListener(new ActionListener() { @Override public final void actionPerformed(final ActionEvent e) { EventQueue.invokeLater(new Runnable() { @Override public final void run() { try { regExFilter.setText(ConsoleOutputPaneModel.defaultPattern.pattern()); model.lastValidPattern = ConsoleOutputPaneModel.defaultPattern; model.usedPattern = model.lastValidPattern; insertChars.setVisible(false); } catch (Exception ex) { OutputController.getLogger().log(ex); } } }); } }); insertChars.add(newLine); insertChars.add(tab); insertChars.add(resetRegex); validate(); } private final void setHeadersCheckBoxesEnabled(final boolean enable) { showUser.setEnabled(enable); showOrigin.setEnabled(enable); showLevel.setEnabled(enable); showDate.setEnabled(enable); showCode.setEnabled(enable); showThread1.setEnabled(enable); showThread2.setEnabled(enable); } private final void setMessagesCheckBoxesEnabled(final boolean enable) { showOut.setEnabled(enable); showErr.setEnabled(enable); showJava.setEnabled(enable); showPlugin.setEnabled(enable); showDebug.setEnabled(enable); showInfo.setEnabled(enable); showItw.setEnabled(enable); showApp.setEnabled(enable); } private final void refreshAction() { updateModel(); refreshPane(); } private final void markActionPerformed(final ActionEvent evt) { int matches = 0; if (!mark.isSelected()) { jEditorPane1.getHighlighter().removeAllHighlights(); return; } try { final Document document = jEditorPane1.getDocument(); final String find = search.getText(); if (find.length() == 0) { jEditorPane1.getHighlighter().removeAllHighlights(); return; } for (int index = 0; index + find.length() < document.getLength(); index++) { final String subMatch = document.getText(index, find.length()); if ((caseSensitive.isSelected() && find.equals(subMatch)) || (!caseSensitive.isSelected() && find.equalsIgnoreCase(subMatch))) { matches++; DefaultHighlighter.DefaultHighlightPainter highlightPainter = new DefaultHighlighter.DefaultHighlightPainter(Color.orange); jEditorPane1.getHighlighter().addHighlight(index, index + find.length(), highlightPainter); } } mark.setText(Translator.R("COPmark") + "(" + matches + ")"); } catch (BadLocationException ex) { OutputController.getLogger().log(ex); } } private final void previousActionPerformed(final ActionEvent evt) { try { final Document document = jEditorPane1.getDocument(); final String find = search.getText(); if (find.length() == 0) { lastPostion = document.getLength() - find.length() - 1; return; } for (int index = lastPostion; index >= 0; index--) { final String subMatch = document.getText(index, find.length()); if ((caseSensitive.isSelected() && find.equals(subMatch)) || (!caseSensitive.isSelected() && find.equalsIgnoreCase(subMatch))) { if (lastSearchTag != null) { jEditorPane1.getHighlighter().removeHighlight(lastSearchTag); } lastSearchTag = jEditorPane1.getHighlighter().addHighlight(index, index + find.length(), searchHighligh); jEditorPane1.setCaretPosition(index); lastPostion = index - find.length() - 1; return; } } lastPostion = document.getLength() - find.length() - 1; } catch (BadLocationException ex) { OutputController.getLogger().log(ex); } } private final void nextActionPerformed(final ActionEvent evt) { try { final Document document = jEditorPane1.getDocument(); final String find = search.getText(); if (find.length() == 0) { lastPostion = 0; return; } for (int index = lastPostion; index + find.length() < document.getLength(); index++) { final String subMatch = document.getText(index, find.length()); if ((caseSensitive.isSelected() && find.equals(subMatch)) || (!caseSensitive.isSelected() && find.equalsIgnoreCase(subMatch))) { if (lastSearchTag != null) { jEditorPane1.getHighlighter().removeHighlight(lastSearchTag); } lastSearchTag = jEditorPane1.getHighlighter().addHighlight(index, index + find.length(), searchHighligh); jEditorPane1.setCaretPosition(index); lastPostion = index + 1; return; } } lastPostion = 0; } catch (BadLocationException ex) { OutputController.getLogger().log(ex); } } private final void showHideActionPerformed(final ActionEvent evt) { if (jpanel2scrollpane.isVisible()) { jpanel2scrollpane.setVisible(false); showHide.setText(Translator.R("ButShowDetails")); } else { jpanel2scrollpane.setVisible(true); showHide.setText(Translator.R("ButHideDetails")); } } private final void copyPlainActionPerformed(final ActionEvent evt) { if (canChange) { showApp.setSelected(false); refreshAction(); canChange = false; } fillClipBoard(false, sortCopyAll.isSelected()); } private final void copyRichActionPerformed(final ActionEvent evt) { if (canChange) { showApp.setSelected(false); refreshAction(); canChange = false; } fillClipBoard(true, sortCopyAll.isSelected()); } private final void fillClipBoard(final boolean mark, final boolean forceSort){ final StringSelection stringSelection; if (forceSort){ stringSelection = new StringSelection(model.importList(mark, 0, 4/*date*/)); } else { stringSelection = new StringSelection(model.importList(mark, 0)); } final Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); clipboard.setContents(stringSelection, null); } public static final void main(final String args[]) { EventQueue.invokeLater(new Runnable() { @Override public final void run() { final JFrame dialog = new JFrame(); dialog.setSize(800, 600); dialog.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); final ObservableMessagesProvider producer = new ConsoleOutputPaneModel.TestMessagesProvider(); final ConsoleOutputPane jPanel1 = new ConsoleOutputPane(producer); producer.getObservable().addObserver(jPanel1); dialog.getContentPane().add(jPanel1, BorderLayout.CENTER); dialog.pack(); dialog.setVisible(true); } }); } private final void updateModel() { model.highLight = highLight.isSelected(); model.matchPattern = match.isSelected(); model.regExLabel = regExLabel.isSelected(); model.revertSort = revertSort.isSelected(); model.showCode = showCode.isSelected(); model.showComplete = showComplete.isSelected(); model.showDate = showDate.isSelected(); model.showDebug = showDebug.isSelected(); model.showErr = showErr.isSelected(); model.showHeaders = showHeaders.isSelected(); model.showIncomplete = showIncomplete.isSelected(); model.showInfo = showInfo.isSelected(); model.showItw = showItw.isSelected(); model.showApp = showApp.isSelected(); model.showJava = showJava.isSelected(); model.showLevel = showLevel.isSelected(); model.showMessage = showMessage.isSelected(); model.showOrigin = showOrigin.isSelected(); model.showOut = showOut.isSelected(); model.showPlugin = showPlugin.isSelected(); model.showPostInit = showPostInit.isSelected(); model.showPreInit = showPreInit.isSelected(); model.showThread1 = showThread1.isSelected(); model.showThread2 = showThread2.isSelected(); model.showUser = showUser.isSelected(); model.sortBy = sortBy.getSelectedIndex(); model.wordWrap = wordWrap.isSelected(); } private final JButton apply; private final JCheckBox autorefresh; private final JCheckBox caseSensitive; private final JButton copyPlain; private final JButton copyRich; private final JCheckBox highLight; private final JEditorPane jEditorPane1; private final JScrollPane jpanel2scrollpane; private final JPanel jPanel2; private final JScrollPane jScrollPane1; private final JCheckBox mark; private final JRadioButton match; private final JButton next; private final JRadioButton notMatch; private final JButton previous; private final JButton refresh; private final JTextField regExFilter; private final JCheckBox regExLabel; private final JCheckBox revertSort; private final JTextField search; private final JLabel searchLabel; private final JCheckBox showCode; private final JCheckBox showComplete; private final JCheckBox showDate; private final JCheckBox showDebug; private final JCheckBox showErr; private final JCheckBox showHeaders; private final JButton showHide; private final JCheckBox showIncomplete; private final JCheckBox showInfo; private final JCheckBox showItw; private final JCheckBox showApp; private final JCheckBox showJava; private final JCheckBox showLevel; private final JCheckBox showMessage; private final JCheckBox showOrigin; private final JCheckBox showOut; private final JCheckBox showPlugin; private final JCheckBox showPostInit; private final JCheckBox showPreInit; private final JCheckBox showThread1; private final JCheckBox showThread2; private final JCheckBox showUser; private final JCheckBox sortCopyAll; private final JComboBox sortBy; private final JLabel sortByLabel; private final JLabel statistics; private final JCheckBox wordWrap; private final JPopupMenu insertChars; } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/PaxHeaders.17941/lockingfile0000644000000000000000000000013212654402377023665 xustar0030 mtime=1454507263.261432261 30 atime=1454507658.779157357 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/lockingfile/0000755000175000002070000000000012654402377024465 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/lockingfile/PaxHeaders.17941/StorageIoException.jav0000644000000000000000000000013212654402377030217 xustar0030 mtime=1454507263.261432261 30 atime=1454507327.163580017 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/lockingfile/StorageIoException.java0000644000175000002070000000410012654402377031076 0ustar00jvanekmock00000000000000/* Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util.lockingfile; /** * Thrown when an exception occurs using the storage (namely IOException) */ public class StorageIoException extends RuntimeException { LockingReaderWriter outer; public StorageIoException(Exception e) { super(e); } public StorageIoException(String e) { super(e); } public StorageIoException(Exception e, LockingReaderWriter outer) { super(e); this.outer = outer; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/lockingfile/PaxHeaders.17941/LockingReaderWriter.ja0000644000000000000000000000013212654402377030164 xustar0030 mtime=1454507263.261432261 30 atime=1454507327.163580017 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/lockingfile/LockingReaderWriter.java0000644000175000002070000001317512654402377031245 0ustar00jvanekmock00000000000000/* Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util.lockingfile; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; /** * Process-locked string storage backed by a file. * Each string is stored on its own line. * Any new-lines must be encoded somehow if they are to be stored. */ public abstract class LockingReaderWriter { private LockedFile lockedFile; /** * Create locking file-backed storage. * @param file the storage file */ public LockingReaderWriter(File file) { this.lockedFile = LockedFile.getInstance(file); } /** * Get the underlying file. * Any access to this file should use lock() & unlock(). * * @return the file */ public File getBackingFile() { return this.lockedFile.getFile(); } public boolean isReadOnly() { return this.lockedFile.isReadOnly(); } /** * Lock the underlying storage. Lock is reentrant. */ public void lock() { try { lockedFile.lock(); } catch (IOException e) { throw new StorageIoException(e); } } /** * Unlock the underlying storage. Lock is reentrant. */ public void unlock() { try { lockedFile.unlock(); } catch (IOException e) { throw new StorageIoException(e); } } /** * Writes stored contents to file. Assumes lock is held. * @throws IOException */ protected void writeContents() throws IOException { if (!getBackingFile().isFile()){ return; } if (isReadOnly()){ return; } BufferedWriter writer = null; try { writer = new BufferedWriter(new OutputStreamWriter( new FileOutputStream(getBackingFile()), "UTF-8")); writeContent(writer); writer.flush(); } finally { if (writer != null) { writer.close(); } } } protected abstract void writeContent(BufferedWriter writer) throws IOException; /** * Reads contents from file. Assumes lock is held. * @throws IOException */ protected void readContents() throws IOException { if (!getBackingFile().isFile()){ return; } BufferedReader reader = null; try { reader = new BufferedReader(new InputStreamReader( new FileInputStream(getBackingFile()), "UTF-8")); while (true) { String line = reader.readLine(); if (line == null) { break; } readLine(line); } } finally { if (reader != null) { reader.close(); } } } /** * Reads contents from the file, first acquring a lock. * @throws IOException */ protected synchronized void readContentsLocked() throws IOException { doLocked(new Runnable() { @Override public void run() { try { readContents(); } catch (IOException ex) { throw new StorageIoException(ex); } } }); } /** * Write contents to the file, first acquring a lock. * @throws IOException */ protected synchronized void writeContentsLocked() throws IOException { doLocked(new Runnable() { public void run() { try { writeContents(); } catch (IOException ex) { throw new StorageIoException(ex); } } }); } protected void doLocked(Runnable r) { lock(); try { r.run(); } finally { unlock(); } } protected abstract void readLine(String line); } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/lockingfile/PaxHeaders.17941/LockedFile.java0000644000000000000000000000013212654402377026606 xustar0030 mtime=1454507263.260432274 30 atime=1454507327.163580017 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/lockingfile/LockedFile.java0000644000175000002070000001362312654402377027336 0ustar00jvanekmock00000000000000/* Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util.lockingfile; import java.io.File; import java.io.IOException; import java.io.RandomAccessFile; import java.nio.channels.FileChannel; import java.nio.channels.FileLock; import java.util.Map; import java.util.WeakHashMap; import java.util.concurrent.locks.ReentrantLock; import net.sourceforge.jnlp.runtime.JNLPRuntime; /* * Process & thread locked access to a file. Creates file if it does not already exist. */ public class LockedFile { // The file for access private RandomAccessFile randomAccessFile; private FileChannel fileChannel; private File file; // A file lock will protect against locks for multiple // processes, while a thread lock is still needed within a single JVM. private FileLock processLock = null; private ReentrantLock threadLock = new ReentrantLock(); private boolean readOnly; private LockedFile(File file) { this.file = file; try { //just try to create this.file.createNewFile(); } catch (Exception ex) { //intentionaly silent } if (!this.file.isFile() && file.getParentFile() != null && !file.getParentFile().canWrite()) { readOnly = true; } else { this.readOnly = !file.canWrite(); if (!readOnly && file.getParentFile() != null && !file.getParentFile().canWrite()) { readOnly = true; } } } public boolean isReadOnly() { return readOnly; } // Provide shared access to LockedFile's via weak map static private final Map instanceCache = new WeakHashMap(); /** * Get a LockedFile for a given File. Ensures that we share the same * instance for all threads * * @param file the file to lock * @return a LockedFile instance */ synchronized public static LockedFile getInstance(File file) { if (!instanceCache.containsKey(file)) { instanceCache.put(file, new LockedFile(file)); } return instanceCache.get(file); } /** * Get the file being locked. * * @return the file */ public File getFile() { return file; } /** * Lock access to the file. Lock is reentrant. */ public void lock() throws IOException { if (JNLPRuntime.isWindows()) { return; } // Create if does not already exist, cannot lock non-existing file if (!isReadOnly()) { this.file.createNewFile(); } this.threadLock.lock(); lockProcess(); } public boolean tryLock() throws IOException { if (this.threadLock.tryLock()) { lockProcess(); return true; } else { return false; } } private void lockProcess() throws IOException { if (this.processLock != null) { return; } if (this.file.exists()) { this.randomAccessFile = new RandomAccessFile(this.file, isReadOnly() ? "r" : "rws"); this.fileChannel = randomAccessFile.getChannel(); if (!isReadOnly()){ this.processLock = this.fileChannel.lock(); } } } /** * Unlock access to the file. Lock is reentrant. Does not do anything if not holding the lock. */ public void unlock() throws IOException { if (JNLPRuntime.isWindows() || !this.threadLock.isHeldByCurrentThread()) { return; } boolean releaseProcessLock = (this.threadLock.getHoldCount() == 1); try { if (releaseProcessLock) { if (this.processLock != null){ this.processLock.release(); } this.processLock = null; //necessary for read only file if (this.randomAccessFile != null){ this.randomAccessFile.close(); } //necessary for not existing parent direcotry if (this.fileChannel != null){ this.fileChannel.close(); } } } finally { this.threadLock.unlock(); } } public boolean isHeldByCurrentThread() { return this.threadLock.isHeldByCurrentThread(); } }icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/PaxHeaders.17941/docprovider0000644000000000000000000000013212654402377023717 xustar0030 mtime=1454507263.259432288 30 atime=1454507658.779157357 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/docprovider/0000755000175000002070000000000012654402377024517 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/docprovider/PaxHeaders.17941/formatters0000644000000000000000000000013212654402377026105 xustar0030 mtime=1454507263.259432288 30 atime=1454507658.779157357 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/docprovider/formatters/0000755000175000002070000000000012654402377026705 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/docprovider/formatters/PaxHeaders.17941/formatters0000644000000000000000000000013212654402377030273 xustar0030 mtime=1454507263.260432274 30 atime=1454507658.779157357 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/docprovider/formatters/formatters/0000755000175000002070000000000012654402377031073 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/docprovider/formatters/formatters/PaxHeaders.17941/0000644000000000000000000000032212654402377030353 xustar00120 path=icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/docprovider/formatters/formatters/ReplacingTextFormatter.java 30 mtime=1454507263.260432274 30 atime=1454507327.163580017 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/docprovider/formatters/formatters/ReplacingTextForm0000644000175000002070000000662412654402377034423 0ustar00jvanekmock00000000000000/* Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util.docprovider.formatters.formatters; import java.util.regex.Matcher; import java.util.regex.Pattern; import net.sourceforge.jnlp.runtime.Boot; import net.sourceforge.jnlp.runtime.Translator; public abstract class ReplacingTextFormatter implements Formatter { public static String backupVersion; public static final Pattern BOLD_OPEN_PATTERN = Pattern.compile("<\\s*[Bb]\\s*>"); public static final Pattern BOLD_CLOSE_PATTERN = Pattern.compile("<\\s*/\\s*[Bb]\\s*>"); @Override public String process(String s1) { Matcher m1 = BOLD_OPEN_PATTERN.matcher(s1); String s2 = m1.replaceAll(getBoldOpening()); Matcher m2 = BOLD_CLOSE_PATTERN.matcher(s2); return (m2.replaceAll(getBoldClosing())); } protected String localizeTitle(String s) { return Translator.R("man"+s); } @Override public String getBold(String s) { return getBoldOpening() + s + getBoldClosing(); } @Override public String getUrl(String url) { return getUrl(url, url); } @Override public String getUrl(String url, String look) { if (look == null || look.trim().length() == 0 || url.equals(look)) { return url; } else { return look + " (" + url + ")"; } } public String getVersion() { if (Boot.version == null) { if (backupVersion == null) { return "unknown version"; } return backupVersion; } else { return Boot.version; } } @Override public String getNewLine(int count) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < count; i++) { sb.append(getNewLine()); } return sb.toString(); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/docprovider/formatters/formatters/PaxHeaders.17941/0000644000000000000000000000031612654402377030356 xustar00116 path=icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/docprovider/formatters/formatters/PlainTextFormatter.java 30 mtime=1454507263.260432274 30 atime=1454507327.163580017 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/docprovider/formatters/formatters/PlainTextFormatte0000644000175000002070000001373312654402377034437 0ustar00jvanekmock00000000000000/* Copyright (C) 2008 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util.docprovider.formatters.formatters; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.TreeMap; import net.sourceforge.jnlp.util.docprovider.TextsProvider; public class PlainTextFormatter extends ReplacingTextFormatter { private static final String LINE_SEPARATOR = java.security.AccessController.doPrivileged( new sun.security.action.GetPropertyAction("line.separator")); private final Map LongestKeys = new TreeMap<>(); private String currentSection = "none"; public static final String SUFFIX = "txt"; public static String getLineSeparator() { return LINE_SEPARATOR; } private final String pargraohIndentation; private final int maxLineLength; public static final String DEFAULT_INDENT = " "; public PlainTextFormatter(String pargraohIndentation, int maxLineLength) { this.pargraohIndentation = pargraohIndentation; this.maxLineLength = maxLineLength; } public PlainTextFormatter(String pargraohIndentation) { this(pargraohIndentation, Integer.MAX_VALUE); } public PlainTextFormatter(int maxLineLength) { this(DEFAULT_INDENT, maxLineLength); } public PlainTextFormatter() { this.pargraohIndentation = DEFAULT_INDENT; this.maxLineLength = Integer.MAX_VALUE; } @Override public String getBoldOpening() { return ""; } @Override public String getBoldClosing() { return ""; } @Override public String getTitle(String s) { currentSection = s; return localizeTitle(s) + getNewLine(); } @Override public String getNewLine() { return LINE_SEPARATOR; } @Override public String getHeaders(String id, String encoding) { return " *** " + TextsProvider.ITW + " " + getVersion() + " *** "; } @Override public String getTail() { return ""; } @Override public String getSeeAlso(String s) { return " * " + s + getNewLine(); } @Override public String getFileSuffix() { return "."+SUFFIX; } @Override public String wrapParagraph(String s) { return wrapParagraph(s, maxLineLength, pargraohIndentation); } static String wrapParagraph(String input, int maxWidth, String indent) { List l = new ArrayList(Arrays.asList(input.split(getLineSeparator()))); for (int i = 0; i < l.size(); i++) { String s = indent + l.get(i).trim(); if (s.length() > maxWidth) { //no splitting in middle of words String split1 = s.substring(0, maxWidth); int split2 = split1.lastIndexOf(" "); int splitTest = split1.trim().lastIndexOf(" "); if (split2 < 1 || splitTest < 1) { //avoid words longer then maxWidth split2 = maxWidth; } l.set(i, s.substring(0, split2)); l.add(i + 1, s.substring(split2)); } else { l.set(i, s); } } return listToString(l); } static String listToString(List l) { StringBuilder sb = new StringBuilder(); for (String string : l) { sb.append(string).append(getLineSeparator()); } return sb.toString(); } @Override public String getBreakAndBold() { return getNewLine(); } @Override public String getCloseBoldAndBreak() { return getNewLine(); } @Override public String getBoldCloseNwlineBoldOpen() { return getNewLine(); } @Override public String getOption(String key, String value) { Integer longestKey = LongestKeys.get(currentSection); if (longestKey == null){ longestKey = 0; } if (key.length() > longestKey) { longestKey = key.length(); LongestKeys.put(currentSection, longestKey); } return key + getSpaces(longestKey + 3, key.length()) + process(value) + getNewLine(); } private String getSpaces(int l, int k) { if (l - k <= 3) { return " - "; } String s = ""; while (s.length() < l - k - 2) { s += " "; } return s + "- "; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/docprovider/formatters/formatters/PaxHeaders.17941/0000644000000000000000000000013212654402377030352 xustar0030 mtime=1454507263.259432288 30 atime=1454507327.163580017 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/docprovider/formatters/formatters/ManFormatter.java0000644000175000002070000001451612654402377034344 0ustar00jvanekmock00000000000000/* Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util.docprovider.formatters.formatters; import java.text.Format; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import net.sourceforge.jnlp.util.docprovider.TextsProvider; public class ManFormatter extends ReplacingTextFormatter { public static class KnownSections { public static final String NAME = "NAME"; public static final String SYNOPSIS = "SYNOPSIS"; public static final String DESCRIPTION = "DESCRIPTION"; public static final String OPTIONS = "OPTIONS"; public static final String COMMANDS = "COMMANDS"; public static final String EXAMPLES = "EXAMPLES"; public static final String FILES = "FILES"; public static final String BUGS = "BUGS"; public static final String AUTHOR = "AUTHOR"; public static final String SEE_ALSO = "SEE_ALSO"; } public static final String SUFFIX = "1"; @Override public String getNewLine() { return PlainTextFormatter.getLineSeparator() + ".br" + PlainTextFormatter.getLineSeparator(); } @Override public String getBoldOpening() { return PlainTextFormatter.getLineSeparator() + ".B "; } @Override public String getBoldClosing() { return PlainTextFormatter.getLineSeparator(); } /** * There is one line break less */ @Override public String getBreakAndBold() { return PlainTextFormatter.getLineSeparator() + ".br" + PlainTextFormatter.getLineSeparator() + ".B "; } /** * There is one line break less */ @Override public String getCloseBoldAndBreak() { return PlainTextFormatter.getLineSeparator() + ".B " + PlainTextFormatter.getLineSeparator() + ".br" + PlainTextFormatter.getLineSeparator(); } /** * There are two lines breaks less */ @Override public String getBoldCloseNwlineBoldOpen() { return PlainTextFormatter.getLineSeparator() + ".br" + PlainTextFormatter.getLineSeparator() + ".B "; } @Override public String getTitle(String name) { return ".SH " + localizeTitle(name) + PlainTextFormatter.getLineSeparator() + PlainTextFormatter.getLineSeparator(); } @Override public String getHeaders(String id, String encoding) { return ".TH " + id + " 1 \"" + getManPageDate(true) + "\"" + " \"" + TextsProvider.ITW + " " + getVersion() + "\"" + PlainTextFormatter.getLineSeparator(); } @Override public String getTail() { return ""; } private String getManPageDate(boolean localize) { Date now = new Date(); Calendar c = Calendar.getInstance(); c.setTime(now); int day = c.get(Calendar.DAY_OF_MONTH); int year = c.get(Calendar.YEAR); String month; if (localize) { Format formatter = new SimpleDateFormat("MMM"); month = formatter.format(now); } else { month = getUnlocallizedMonth(c.get(Calendar.MONTH));; } return day + " " + month + " " + year; } private String getUnlocallizedMonth(int get) { switch (get) { case Calendar.JANUARY: return "Jan"; case Calendar.FEBRUARY: return "Feb"; case Calendar.MARCH: return "Mar"; case Calendar.APRIL: return "Apr"; case Calendar.MAY: return "May"; case Calendar.JUNE: return "Jun"; case Calendar.JULY: return "Jul"; case Calendar.AUGUST: return "Aug"; case Calendar.SEPTEMBER: return "Sep"; case Calendar.OCTOBER: return "Oct"; case Calendar.NOVEMBER: return "Nov"; case Calendar.DECEMBER: return "Dec"; default: return "Unkw"; } } @Override public String getSeeAlso(String s) { return ".BR " + s + " (1)" + PlainTextFormatter.getLineSeparator(); } @Override public String getFileSuffix() { return "."+SUFFIX; } @Override public String wrapParagraph(String s) { return PlainTextFormatter.getLineSeparator() + ".PP" + PlainTextFormatter.getLineSeparator() + s; } @Override public String getOption(String key, String value) { if (key.startsWith("-")) { key = "\\" + key; } if (value.startsWith("-")) { value = "\\" + value; } return ".TP 12" + PlainTextFormatter.getLineSeparator() + key + PlainTextFormatter.getLineSeparator() + process(value) + PlainTextFormatter.getLineSeparator(); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/docprovider/formatters/formatters/PaxHeaders.17941/0000644000000000000000000000031112654402377030351 xustar00111 path=icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/docprovider/formatters/formatters/HtmlFormatter.java 30 mtime=1454507263.259432288 30 atime=1454507327.163580017 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/docprovider/formatters/formatters/HtmlFormatter.jav0000644000175000002070000001350312654402377034367 0ustar00jvanekmock00000000000000/* Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util.docprovider.formatters.formatters; import java.util.Date; import java.util.Map; import java.util.Set; import java.util.TreeMap; import net.sourceforge.jnlp.runtime.JNLPRuntime; public class HtmlFormatter extends ReplacingTextFormatter { private final Map content = new TreeMap<>(); private final boolean allowContext; private final boolean allowLogo; private final boolean includeXmlHeader; public static final String SUFFIX = "html"; @Override public String process(String s) { //the texts in properties are already using html markup return s; } public HtmlFormatter(boolean allowContext, boolean allowLogo, boolean includeXmlHeader) { this.allowContext = allowContext; this.allowLogo = allowLogo; this.includeXmlHeader = includeXmlHeader; } public HtmlFormatter() { this(true, true, false); } @Override public String getNewLine() { return "
    " + PlainTextFormatter.getLineSeparator(); } @Override public String getBoldOpening() { return ""; } @Override public String getBoldClosing() { return ""; } @Override public String getTitle(String s) { return "

    " + knownIdToString(s) + "

    \n"; } @Override public String getHeaders(String id, String encoding) { //jeditorpane dont like \n"; } return xml + "\n" + "\n" + " \n" + " " + id + ": " + getVersion() + "" + " \n" + " \n" + " \n" + "
    " + id + ": " + getVersion() + ", " + JNLPRuntime.getLocalisedTimeStamp(new Date()) + "
    "; } @Override public String getTail() { return " \n"; } @Override public String getUrl(String url, String visible) { return "
    " + visible + ""; } private String knownIdToString(String s) { String value = localizeTitle(s); String key = s; content.put(key, value); return value; } @Override public String getSeeAlso(String s) { return "
  • " + getUrl(s + getFileSuffix(), s) + "
  • \n"; } public StringBuilder generateIndex() { if (!allowContext) { return new StringBuilder(); } Set> set = content.entrySet(); if (set.isEmpty()) { return new StringBuilder(); } StringBuilder sb = new StringBuilder("

    " + "Context" + "

    "); for (Map.Entry entry : set) { sb.append("
  • ").append(entry.getValue()).append("
  • "); } return sb; } @Override public String getFileSuffix() { return "."+SUFFIX; } @Override public String wrapParagraph(String s) { return "

    " + s + "

    "; } @Override public String getBreakAndBold() { return getNewLine() + getBoldOpening(); } @Override public String getCloseBoldAndBreak() { return getBoldClosing() + getNewLine(); } @Override public String getBoldCloseNwlineBoldOpen() { return getBoldClosing() + getNewLine() + getBoldOpening(); } public String generateLogo() { if (allowLogo) { return "
    \"IcedTea-Web
    " + getNewLine(); } else { return ""; } } @Override public String getOption(String key, String value) { return "
  • " + key + " - " + process(value) + "
  • "; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/docprovider/formatters/formatters/PaxHeaders.17941/0000644000000000000000000000013112654402377030351 xustar0030 mtime=1454507263.259432288 29 atime=1454507327.16258003 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/docprovider/formatters/formatters/Formatter.java0000644000175000002070000000472312654402377033707 0ustar00jvanekmock00000000000000/* Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util.docprovider.formatters.formatters; public interface Formatter { public String process(String s); public String wrapParagraph(String s); public String getHeaders(String id, String encoding); public String getNewLine(); public String getNewLine(int count); public String getBold(String s); public String getBoldOpening(); public String getBoldClosing(); public String getBreakAndBold(); public String getCloseBoldAndBreak(); public String getBoldCloseNwlineBoldOpen(); public String getTitle(String name); public String getUrl(String url); public String getUrl(String url, String appearence); public String getOption(String key, String value); public String getSeeAlso(String s); public String getTail(); public String getFileSuffix(); } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/docprovider/PaxHeaders.17941/TextsProvider.java0000644000000000000000000000013112654402377027460 xustar0030 mtime=1454507263.258432301 29 atime=1454507327.16258003 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/docprovider/TextsProvider.java0000644000175000002070000006163412654402377030216 0ustar00jvanekmock00000000000000/* Copyright (C) 2008 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util.docprovider; import java.io.BufferedWriter; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.Writer; import java.util.Collections; import java.util.Comparator; import java.util.List; import java.util.Map; import java.util.Set; import net.sourceforge.jnlp.config.Defaults; import net.sourceforge.jnlp.OptionsDefinitions; import net.sourceforge.jnlp.config.InfrastructureFileDescriptor; import net.sourceforge.jnlp.config.Setting; import net.sourceforge.jnlp.runtime.Translator; import net.sourceforge.jnlp.util.docprovider.formatters.formatters.Formatter; import net.sourceforge.jnlp.util.docprovider.formatters.formatters.HtmlFormatter; import net.sourceforge.jnlp.util.docprovider.formatters.formatters.ManFormatter; import net.sourceforge.jnlp.util.docprovider.formatters.formatters.PlainTextFormatter; import net.sourceforge.jnlp.util.docprovider.formatters.formatters.ReplacingTextFormatter; public abstract class TextsProvider { private final String encoding; private final Formatter formatter; private final boolean forceTitles; protected final boolean expandVariables; private boolean prepared = false; private boolean introduction = true; private boolean synopsis = true; private boolean description = true; private boolean commands = true; private boolean options = true; private boolean examples = true; private boolean files = true; private boolean bugs = true; private boolean authors = true; private boolean seeAlso = true; public TextsProvider(String encoding, Formatter formatter, boolean forceTitles, boolean expandFiles) { this.encoding = encoding; this.formatter = formatter; this.forceTitles = forceTitles; this.expandVariables = expandFiles; } public abstract String getId(); public String getHeader() { return getFormatter().getHeaders(getId(), getEncoding()); } public String getTail() { return getFormatter().getTail(); } public String getIntroduction() { if (forceTitles) { return getFormatter().getTitle(ManFormatter.KnownSections.NAME); } else { return ""; } } public String getSynopsis() { if (forceTitles) { return getFormatter().getTitle(ManFormatter.KnownSections.SYNOPSIS); } else { return ""; } } public String getDescription() { if (forceTitles) { return getFormatter().getTitle(ManFormatter.KnownSections.DESCRIPTION); } else { return ""; } } public String getOptions() { if (forceTitles) { return getFormatter().getTitle(ManFormatter.KnownSections.OPTIONS); } else { return ""; } } public String getCommands() { if (forceTitles) { return getFormatter().getTitle(ManFormatter.KnownSections.COMMANDS); } else { return ""; } } public String getExamples() { if (forceTitles) { return getFormatter().getTitle(ManFormatter.KnownSections.EXAMPLES); } else { return ""; } } public String getFiles() { if (forceTitles) { return getFormatter().getTitle(ManFormatter.KnownSections.FILES); } else { return ""; } } protected String getFilesAppendix() { if (!expandVariables) { return getFormatter().wrapParagraph(Translator.R("ITWTBdirs")); } else { return ""; } } protected String getFiles(List files) { StringBuilder sb = new StringBuilder(); Set>> defs = Defaults.getDefaults().entrySet(); Collections.sort(files, new Comparator() { @Override public int compare(InfrastructureFileDescriptor o1, InfrastructureFileDescriptor o2) { return o1.toString().compareTo(o2.toString()); } }); for (InfrastructureFileDescriptor f : files) { String path = expandVariables ? f.getFullPath() : f.toString(); String modified = ""; String fGetFullPath=removeFileProtocol(f.getFullPath()); String fGetDefaultFullPath=removeFileProtocol(f.getDefaultFullPath()); if (!fGetFullPath.equals(fGetDefaultFullPath) && expandVariables){ modified=getFormatter().getBold("["+Translator.R("BUTmodified")+"] "); } String controlledBy = ""; for (Map.Entry> entry : defs) { if (matchSttingsValueWithInfrastrucutreFile(entry.getValue(), f)) { controlledBy = " " + Translator.R("BUTControlledBy", getFormatter().getBold(entry.getKey())); break; } } sb.append(getFormatter().getOption(path, modified+f.getDescription() + controlledBy)); } return formatter.wrapParagraph(sb.toString()); } protected boolean matchSttingsValueWithInfrastrucutreFile(Setting entry, InfrastructureFileDescriptor f) { if (entry == null || entry.getDefaultValue() == null) { return false; } return entry.getDefaultValue().equals(f.getDefaultFullPath()) || entry.getDefaultValue().equals("file://" + f.getDefaultFullPath()); } public Formatter getFormatter() { return formatter; } protected String getEncoding() { return encoding; } protected String optionsToString(List opts) { Collections.sort(opts, new Comparator() { @Override public int compare(OptionsDefinitions.OPTIONS o1, OptionsDefinitions.OPTIONS o2) { return o1.option.compareToIgnoreCase(o2.option); } }); StringBuilder sb = new StringBuilder(); for (OptionsDefinitions.OPTIONS o : opts) { sb.append(getFormatter().getOption(o.option + " " + o.helperString, o.getLocalizedDescription()+"("+o.getArgumentExplanation()+")")); } return sb.toString(); } public static final String IT_BASE = "http://icedtea.classpath.org/wiki"; public static final String ITW_HOME = IT_BASE + "/IcedTea-Web"; public static final String ITW_EAS = IT_BASE + "/Extended_Applets_Security"; public static final String ITW_STYLE = ITW_HOME + "#Code_style"; public static final String ITW_ECLIPSE = ITW_HOME + "/DevelopingWithEclipse"; public static final String ITW_REPO = "http://icedtea.classpath.org/hg/icedtea-web"; public static final String JAVAWS = "javaws"; public static final String ITWEB_SETTINGS = "itweb-settings"; public static final String ITW = "icedtea-web"; public static final String ITW_PLUGIN = "icedtea-web-plugin"; public static final String POLICY_EDITOR = "policyeditor"; public static final String DISTRO_PKG = "http://mail.openjdk.java.net/mailman/listinfo/distro-pkg-dev"; public static final String IT_MAIN = IT_BASE + "/Main_Page"; public static final String IT_QUICK = IT_BASE + "/DeveloperQuickStart"; public static final String ITW_ISSUES = ITW_HOME + "#Common_Issues"; public static final String ITW_REPRODUCERS = IT_BASE + "/Reproducers"; public static final String ITW_BUGS = ITW_HOME + "#Filing_bugs"; public static final String ITW_PLUGIN_URL = ITW_HOME + "#Plugin"; public static final String ITW_BUGZILLAHOME = "http://icedtea.classpath.org/bugzilla"; public String getBugs() { StringBuilder sb = new StringBuilder(); sb.append(getFormatter().process(Translator.R("ITWTBbugs")+":")); sb.append(getFormatter().getNewLine()); sb.append(getFormatter().getUrl(ITW_BUGS)); sb.append(getFormatter().getNewLine()); sb.append(getFormatter().getUrl(ITW_BUGZILLAHOME)); sb.append(getFormatter().getNewLine()); sb.append(getFormatter().getNewLine()); sb.append(getFormatter().process(Translator.R("ITWTBdebug"))); sb.append(getFormatter().getNewLine()); if (forceTitles) { return getFormatter().getTitle(ManFormatter.KnownSections.BUGS) + getFormatter().wrapParagraph(sb.toString()); } else { return getFormatter().wrapParagraph(sb.toString()); } } public String getAuthors() { if (forceTitles) { return getFormatter().getTitle(ManFormatter.KnownSections.AUTHOR) + getFormatter().wrapParagraph( getFormatter().process(Translator.R("ITWTBdebug")) + getFormatter().getNewLine()); } else { return getFormatter().wrapParagraph( getFormatter().process(Translator.R("ITWTBdebug")) + getFormatter().getNewLine()); } } public String getSeeAlso() { StringBuilder sb = new StringBuilder(); sb.append(getFormatter().getSeeAlso(ITW)); sb.append(getFormatter().getSeeAlso(JAVAWS)); sb.append(getFormatter().getSeeAlso(ITW_PLUGIN)); sb.append(getFormatter().getSeeAlso(ITWEB_SETTINGS)); sb.append(getFormatter().getSeeAlso(POLICY_EDITOR)); sb.append(getFormatter().getSeeAlso("policytool")); sb.append(getFormatter().getSeeAlso("java")); sb.append(getFormatter().getNewLine()); sb.append(getFormatter().getUrl(ITW_HOME)); sb.append(getFormatter().getNewLine()); sb.append(getFormatter().getUrl(ITW_REPO)); sb.append(getFormatter().getNewLine()); if (forceTitles) { return getFormatter().getTitle(ManFormatter.KnownSections.SEE_ALSO) + getFormatter().wrapParagraph(sb.toString()); } else { return getFormatter().wrapParagraph(sb.toString()); } } public TextsProvider prepare() { if (!prepared) { writeToStringReal(); prepared = true; } return this; } public String writeToString() { //first walktrhough builds index (html), set longest options(textt) return prepare().writeToStringReal(); } private String writeToStringReal() { StringBuilder sb = new StringBuilder(); sb.append(getHeader()); sb.append(PlainTextFormatter.getLineSeparator()); if (getFormatter() instanceof HtmlFormatter) { sb.append(((HtmlFormatter) getFormatter()).generateLogo()); sb.append(PlainTextFormatter.getLineSeparator()); sb.append(((HtmlFormatter) getFormatter()).generateIndex()); sb.append(PlainTextFormatter.getLineSeparator()); } if (isIntroduction()) { sb.append(getIntroduction()); sb.append(PlainTextFormatter.getLineSeparator()); } if (isSynopsis()) { sb.append(getSynopsis()); sb.append(PlainTextFormatter.getLineSeparator()); } if (isDescription()) { sb.append(getDescription()); sb.append(PlainTextFormatter.getLineSeparator()); } if (isCommands()) { sb.append(getCommands()); sb.append(PlainTextFormatter.getLineSeparator()); } if (isOptions()) { sb.append(getOptions()); sb.append(PlainTextFormatter.getLineSeparator()); } if (isExamples()) { sb.append(getExamples()); sb.append(PlainTextFormatter.getLineSeparator()); } if (isFiles()) { sb.append(getFiles()); sb.append(PlainTextFormatter.getLineSeparator()); } if (isBugs()) { sb.append(getBugs()); sb.append(PlainTextFormatter.getLineSeparator()); } if (isAuthors()) { sb.append(getAuthors()); sb.append(PlainTextFormatter.getLineSeparator()); } if (isSeeAlso()) { sb.append(getSeeAlso()); sb.append(PlainTextFormatter.getLineSeparator()); } sb.append(getTail()); return sb.toString(); } public void writeToWriter(Writer w) throws IOException { try (BufferedWriter bw = new BufferedWriter(w)) { bw.write(writeToString()); } } public void writeToStream(OutputStream os) throws IOException { try (OutputStreamWriter osw = new OutputStreamWriter(os, encoding)) { writeToWriter(osw); } } public void writeToFile(File f) throws IOException { try (FileOutputStream fos = new FileOutputStream(f)) { writeToStream(fos); } } public void writeToDir(File dir) throws IOException { writeToFile(new File(dir, getId() + getFormatter().getFileSuffix())); } public static void main(String[] args) throws IOException { if (args.length == 0) { System.out.println(" * IcedTea-Web self documentation tool list of arguments *"); System.out.println(" * arument version - last parameter of each command, is used when there is no internal versionknown *"); System.out.println(" * - is mandatory, but not used if real version do exists *"); System.out.println(" * argument expand - one before last argument, false/true - is used to not/expand variables *"); System.out.println(" * -------------------- *"); System.out.println("all expand version - will generate all reports in theirs defaults into current directory"); System.out.println("html targetDir expand version - will generate html documentation to target dir"); System.out.println("htmlIntro targetFile expand version - will generate html intro page to specified file"); System.out.println("man encoding targetDir expand version - will generate man documentation to target dir in desired encoding"); System.out.println("plain targetDir maxLineWidth expand version - will generate plain text documentation to target dir in desired encoding"); System.out.println(" - maxLineWidth is in <5," + Integer.MAX_VALUE + ">"); } else { ReplacingTextFormatter.backupVersion = args[args.length - 1]; boolean expand = Boolean.valueOf(args[args.length - 2]); switch (args[0]) { case "all": generateAll(new File(System.getProperty("user.dir")), expand); break; case "html": generateOnlineHtmlHelp(new File(args[1]), expand); break; case "htmlIntro": generateItwIntro(new File(args[1]), expand); break; case "man": generateManText(args[1], new File(args[2]), expand); break; case "plain": generatePlainTextDocs(new File(args[1]), Integer.valueOf(args[2]), expand); break; default: System.out.println("unknown param"); main(new String[0]); } } } public static void generateItwIntro(File f, boolean expand) throws IOException { IcedTeaWebTextsProvider itw = new IcedTeaWebTextsProvider("utf-8", new HtmlFormatter(false, true, false), false, expand); itw.setSeeAlso(false); itw.writeToFile(f); } public static void generateAll(File f, boolean expand) throws IOException { generateOnlineHtmlHelp(f, expand); generateManText("UTF-8", f, expand); generatePlainTextDocs(f, 160, expand); } private static final String logo_name = "itw_logo.png"; private static final String logo_url = "/net/sourceforge/jnlp/resources/" + logo_name; public static void generateRuntimeHtmlTexts(File f) throws IOException { generateHtmlTexts(f, false, true); } public static void generateOnlineHtmlHelp(File f, boolean expand) throws IOException { generateHtmlTexts(f, true, expand); } public static void generateHtmlTexts(File dir, boolean includeXmlHeader, boolean expand) throws IOException { generateHtmlTextsUtf8(dir, true, true, includeXmlHeader, true, expand); } public static void generateHtmlTextsUtf8(File dir, boolean allowContext, boolean allowLogo, boolean includeXmlHeader, boolean titles, boolean expand) throws IOException { generateHtmlTexts("UTF-8", dir, allowContext, allowLogo, includeXmlHeader, titles, expand); } public static void generateHtmlTexts(String encoding, File dir, boolean allowContext, boolean allowLogo, boolean includeXmlHeader, boolean titles, boolean expand) throws IOException { if (allowLogo) { File flogo = new File(dir, logo_name); try (InputStream is = TextsProvider.class.getResourceAsStream(logo_url); OutputStream os = new FileOutputStream(flogo);) { copy(is, os); os.flush(); } } JavaWsTextsProvider javaws = new JavaWsTextsProvider(encoding, new HtmlFormatter(allowContext, allowLogo, includeXmlHeader), titles, expand); javaws.writeToDir(dir); ItwebSettingsTextsProvider itws = new ItwebSettingsTextsProvider(encoding, new HtmlFormatter(allowContext, allowLogo, includeXmlHeader), titles, expand); itws.writeToDir(dir); PolicyEditorTextsProvider pe = new PolicyEditorTextsProvider(encoding, new HtmlFormatter(allowContext, allowLogo, includeXmlHeader), titles, expand); pe.writeToDir(dir); IcedTeaWebTextsProvider itw = new IcedTeaWebTextsProvider(encoding, new HtmlFormatter(allowContext, allowLogo, includeXmlHeader), titles, expand); itw.writeToDir(dir); ItwebPluginTextProvider pl = new ItwebPluginTextProvider(encoding, new HtmlFormatter(allowContext, allowLogo, includeXmlHeader), titles, expand); pl.writeToDir(dir); } public static void generateManText(String encoding, File dir, boolean expand) throws IOException { generateManText(encoding, dir, true, expand); } public static void generateManText(String encoding, File dir, boolean titles, boolean expand) throws IOException { JavaWsTextsProvider javaws = new JavaWsTextsProvider(encoding, new ManFormatter(), titles, expand); javaws.writeToDir(dir); ItwebSettingsTextsProvider itws = new ItwebSettingsTextsProvider(encoding, new ManFormatter(), titles, expand); itws.writeToDir(dir); PolicyEditorTextsProvider pe = new PolicyEditorTextsProvider(encoding, new ManFormatter(), titles, expand); pe.writeToDir(dir); IcedTeaWebTextsProvider itw = new IcedTeaWebTextsProvider(encoding, new ManFormatter(), titles, expand); itw.writeToDir(dir); ItwebPluginTextProvider pl = new ItwebPluginTextProvider(encoding, new ManFormatter(), titles, expand); pl.writeToDir(dir); } public static void generatePlainTextDocs(File dir, int lineWidth, boolean expand) throws IOException { generatePlainTextDocs("UTF-8", dir, PlainTextFormatter.DEFAULT_INDENT, lineWidth, true, expand); } public static void generatePlainTextDocs(String encoding, File dir, String indent, int lineWidth, boolean titles, boolean expand) throws IOException { JavaWsTextsProvider javaws = new JavaWsTextsProvider(encoding, new PlainTextFormatter(indent, lineWidth), titles, expand); javaws.writeToDir(dir); ItwebSettingsTextsProvider itws = new ItwebSettingsTextsProvider(encoding, new PlainTextFormatter(indent, lineWidth), titles, expand); itws.writeToDir(dir); PolicyEditorTextsProvider pe = new PolicyEditorTextsProvider(encoding, new PlainTextFormatter(indent, lineWidth), titles, expand); pe.writeToDir(dir); IcedTeaWebTextsProvider itw = new IcedTeaWebTextsProvider(encoding, new PlainTextFormatter(indent, lineWidth), titles, expand); itw.writeToDir(dir); ItwebPluginTextProvider pl = new ItwebPluginTextProvider(encoding, new PlainTextFormatter(indent, lineWidth), titles, expand); pl.writeToDir(dir); } private static final int BUF_SIZE = 0x1000; // 4K private static long copy(InputStream from, OutputStream to) throws IOException { byte[] buf = new byte[BUF_SIZE]; long total = 0; while (true) { int r = from.read(buf); if (r == -1) { break; } to.write(buf, 0, r); total += r; } return total; } /** * @return the introduction */ public boolean isIntroduction() { return introduction; } /** * @param introduction the introduction to set */ public void setIntroduction(boolean introduction) { this.introduction = introduction; } /** * @return the synopsis */ public boolean isSynopsis() { return synopsis; } /** * @param synopsis the synopsis to set */ public void setSynopsis(boolean synopsis) { this.synopsis = synopsis; } /** * @return the description */ public boolean isDescription() { return description; } /** * @param description the description to set */ public void setDescription(boolean description) { this.description = description; } /** * @return the commands */ public boolean isCommands() { return commands; } /** * @param commands the commands to set */ public void setCommands(boolean commands) { this.commands = commands; } /** * @return the options */ public boolean isOptions() { return options; } /** * @param options the options to set */ public void setOptions(boolean options) { this.options = options; } /** * @return the examples */ public boolean isExamples() { return examples; } /** * @param examples the examples to set */ public void setExamples(boolean examples) { this.examples = examples; } /** * @return the files */ public boolean isFiles() { return files; } /** * @param files the files to set */ public void setFiles(boolean files) { this.files = files; } /** * @return the bugs */ public boolean isBugs() { return bugs; } /** * @param bugs the bugs to set */ public void setBugs(boolean bugs) { this.bugs = bugs; } /** * @return the authors */ public boolean isAuthors() { return authors; } /** * @param authors the authors to set */ public void setAuthors(boolean authors) { this.authors = authors; } /** * @return the seeAlso */ public boolean isSeeAlso() { return seeAlso; } /** * @param seeAlso the seeAlso to set */ public void setSeeAlso(boolean seeAlso) { this.seeAlso = seeAlso; } private String removeFileProtocol(String s) { if (s == null){ return s; } if (s.startsWith("file://")){ s = s.substring(7); } return s; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/docprovider/PaxHeaders.17941/PolicyEditorTextsProvi0000644000000000000000000000013112654402377030374 xustar0030 mtime=1454507263.258432301 29 atime=1454507327.16258003 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/docprovider/PolicyEditorTextsProvider.java0000644000175000002070000001067512654402377032544 0ustar00jvanekmock00000000000000/* Copyright (C) 2008 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util.docprovider; import java.io.IOException; import net.sourceforge.jnlp.OptionsDefinitions; import net.sourceforge.jnlp.config.PathsAndFiles; import net.sourceforge.jnlp.runtime.Translator; import net.sourceforge.jnlp.util.docprovider.formatters.formatters.Formatter; /** * * @author jvanek */ public class PolicyEditorTextsProvider extends TextsProvider { public PolicyEditorTextsProvider(String encoding, Formatter formatter, boolean forceTitles, boolean expandFiles) { super(encoding, formatter, forceTitles, expandFiles); } @Override public String getId() { return POLICY_EDITOR; } @Override public String getIntroduction() { return super.getIntroduction() + getFormatter().wrapParagraph( getFormatter().process(getId() + " "+Translator.R("PEintro"))); } @Override public String getSynopsis() { return super.getSynopsis() + getFormatter().wrapParagraph(getFormatter().process(getFormatter().getBoldOpening() + " " + getId() + " " + getFormatter().getBoldCloseNwlineBoldOpen() + getId() + " [-file] " + getFormatter().getBoldClosing() + Translator.R("PEsynopseP1") + " "+getFormatter().getBold("[-codebase] ") + Translator.R("PEsynopseP2"))); } @Override public String getDescription() { return super.getDescription() + getFormatter().wrapParagraph(getFormatter().process(getFormatter().getBold(getId() + " ") + Translator.R("PEdescL1") + getFormatter().getNewLine() + getFormatter().getNewLine() + Translator.R("PEdescL2"))); } @Override public String getOptions() { return super.getOptions() + getFormatter().wrapParagraph(optionsToString(OptionsDefinitions.getPolicyEditorOptions())); } @Override public String getExamples() { String title = super.getExamples(); String s = ""; if (expandVariables) { s = s + getFormatter().getOption(getId() + " -file " + PathsAndFiles.JAVA_POLICY.getFullPath(), Translator.R("PEexampleL1")); } else { s = s + getFormatter().getOption(getId() + " -file " + PathsAndFiles.JAVA_POLICY.toString(), Translator.R("PEexampleL1")); } return title + getFormatter().wrapParagraph( getFormatter().getOption(getId(), Translator.R("PEexampleL2")) + s); } @Override public String getFiles() { return super.getFiles() + getFiles(PathsAndFiles.getAllPEFiles()) + getFilesAppendix(); } public static void main(String[] args) throws IOException { TextsProvider.main(new String[]{"all", "true", "3.51.a"}); } @Override public String getCommands() { return ""; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/docprovider/PaxHeaders.17941/JavaWsTextsProvider.ja0000644000000000000000000000013112654402377030245 xustar0030 mtime=1454507263.257432314 29 atime=1454507327.16258003 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/docprovider/JavaWsTextsProvider.java0000644000175000002070000001303012654402377031315 0ustar00jvanekmock00000000000000/* Copyright (C) 2008 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util.docprovider; import java.io.IOException; import net.sourceforge.jnlp.OptionsDefinitions; import net.sourceforge.jnlp.config.PathsAndFiles; import net.sourceforge.jnlp.runtime.Translator; import static net.sourceforge.jnlp.runtime.Translator.R; import net.sourceforge.jnlp.util.docprovider.formatters.formatters.Formatter; public class JavaWsTextsProvider extends TextsProvider { public JavaWsTextsProvider(String encoding, Formatter formatter, boolean forceTitles, boolean expandFiles) { super(encoding, formatter, forceTitles, expandFiles); } @Override public String getId() { return JAVAWS; } @Override public String getIntroduction() { return super.getIntroduction() + getFormatter().wrapParagraph(getFormatter().process(getId() + " " + Translator.R("JWSintro"))); } @Override public String getSynopsis() { return super.getSynopsis() + getFormatter().wrapParagraph(getFormatter().process(getFormatter().getBold(" " + getId() + " ") + R("BOUsage") + getFormatter().getBreakAndBold() + getId() + " " + getFormatter().getBoldClosing() + R("BOUsage2"))); } @Override public String getDescription() { return super.getDescription() + getFormatter().wrapParagraph(getFormatter().process( getFormatter().getBold(getId() + " ") + Translator.R("JWSdescL1", getFormatter().getBold(getId()+" ")) + getFormatter().getNewLine()+ getFormatter().getNewLine() + Translator.R("JWSdescL2"))); } @Override public String getOptions() { String title = super.getOptions(); String add1 = Translator.R("JWSoptionsL1"); String add2 = Translator.R("JWSoptionsL2"); String add3 = Translator.R("JWSoptionsL3"); String adds = getFormatter().wrapParagraph(add1 + getFormatter().getNewLine() + add2 + getFormatter().getNewLine() + add3); String runtime = getFormatter().getBold(Translator.R("JWSoptionsTitle1")) + getFormatter().getNewLine() + optionsToString(OptionsDefinitions.getJavaWsRuntimeOptions()); String control = getFormatter().getBold(Translator.R("JWSoptionsTitle2")) + getFormatter().getNewLine() + optionsToString(OptionsDefinitions.getJavaWsControlOptions()); return title + adds + getFormatter().wrapParagraph(control) + getFormatter().wrapParagraph(runtime); } @Override public String getExamples() { return super.getExamples() + getFormatter().wrapParagraph( getFormatter().getOption(getId() + " " + OptionsDefinitions.OPTIONS.ABOUT.option, Translator.R("JWSexampleL1")) + getFormatter().getOption(getId() + " " + OptionsDefinitions.OPTIONS.ABOUT.option + " " + OptionsDefinitions.OPTIONS.HEADLESS.option, Translator.R("JWSexampleL2")) + getFormatter().getOption(getId() + " " + OptionsDefinitions.OPTIONS.NOFORK.option + " " + OptionsDefinitions.OPTIONS.NOHEADERS.option + " " + OptionsDefinitions.OPTIONS.REDIRECT.option + " " + OptionsDefinitions.OPTIONS.OFFLINE.option + " http://mypage.web/dangerous.jnlp", Translator.R("JWSexampleL3", "dangerous.jnlp", "mypage.web"))); } @Override public String getFiles() { String s = super.getFiles() + getFiles(PathsAndFiles.getAllJavaWsFiles()); s = s + getFilesAppendix(); return s; } public static void main(String[] args) throws IOException { TextsProvider.main(new String[]{"all", "true", "3.51.a"}); } @Override public String getCommands() { return ""; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/docprovider/PaxHeaders.17941/ItwebSettingsTextsProv0000644000000000000000000000013112654402377030410 xustar0030 mtime=1454507263.257432314 29 atime=1454507327.16258003 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/docprovider/ItwebSettingsTextsProvider.java0000644000175000002070000001701712654402377032726 0ustar00jvanekmock00000000000000/* Copyright (C) 2008 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util.docprovider; import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.List; import java.util.Map; import net.sourceforge.jnlp.config.Defaults; import net.sourceforge.jnlp.OptionsDefinitions; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.config.InfrastructureFileDescriptor; import net.sourceforge.jnlp.config.PathsAndFiles; import net.sourceforge.jnlp.config.Setting; import net.sourceforge.jnlp.config.ValueValidator; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.runtime.Translator; import net.sourceforge.jnlp.util.docprovider.formatters.formatters.Formatter; public class ItwebSettingsTextsProvider extends TextsProvider { public ItwebSettingsTextsProvider(String encoding, Formatter formatter, boolean forceTitles, boolean expandFiles) { super(encoding, formatter, forceTitles, expandFiles); } @Override public String getId() { return ITWEB_SETTINGS; } @Override public String getIntroduction() { return super.getIntroduction() + getFormatter().wrapParagraph( getFormatter().process(getId() + " " + Translator.R("ITWSintro"))); } @Override public String getSynopsis() { return super.getSynopsis() + getFormatter().wrapParagraph( getFormatter().getBoldOpening() + getId() + " " + getFormatter().getBoldCloseNwlineBoldOpen() + getId() + " " + getFormatter().getBoldClosing() + Translator.R("ITWSsynops")); } @Override public String getDescription() { return super.getDescription() + getFormatter().wrapParagraph(getFormatter().getBold(getId() + " ") + getFormatter().process( Translator.R("IWSdescL1") + getFormatter().getNewLine() + getFormatter().getNewLine() + Translator.R("IWSdescL2") + getFormatter().getNewLine() + getFormatter().getNewLine() + Translator.R("IWSdescL3"))); } @Override public String getOptions() { return ""; } @Override public String getCommands() { return super.getDescription() + getFormatter().wrapParagraph(optionsToString(OptionsDefinitions.getItwsettingsCommands())); } @Override public String getExamples() { return super.getExamples() + getFormatter().wrapParagraph( getFormatter().getOption(getId(), Translator.R("IWSexampleL1")) + getFormatter().getOption(getId() + " " + OptionsDefinitions.OPTIONS.RESET.option + " " + DeploymentConfiguration.KEY_PROXY_TYPE, " " + Translator.R("IWSexampleL2", DeploymentConfiguration.KEY_PROXY_TYPE))) + getFormatter().getNewLine() + getFormatter().wrapParagraph(getKpMinorTitle() + getFormatter().getNewLine() + getFormatter().wrapParagraph(getProperties())); } @Override public String getFiles() { return super.getFiles() + getFiles(PathsAndFiles.getAllItWebSettingsFiles()) + getFilesAppendix(); } public static void main(String[] args) throws IOException { TextsProvider.main(new String[]{"all", "true", "3.51.a"}); } private String getProperties() { StringBuilder sb = new StringBuilder(); List>> defaults = new ArrayList<>(Defaults.getDefaults().entrySet()); Collections.sort(defaults, new Comparator>>() { @Override public int compare(Map.Entry> o1, Map.Entry> o2) { return o1.getKey().compareTo(o2.getKey()); } }); List files = PathsAndFiles.getAllFiles(); for (Map.Entry> entry : defaults) { String defaultValue = entry.getValue().getDefaultValue(); String fileAcronom = null; for (InfrastructureFileDescriptor f : files) { if (matchSttingsValueWithInfrastrucutreFile(entry.getValue(), f)) { fileAcronom = f.toString(); break; } } String setValue = JNLPRuntime.getConfiguration().getProperty(entry.getKey()); if (defaultValue == null) { defaultValue = "null"; } if (setValue == null) { setValue = "null"; } String value; if (expandVariables) { if (defaultValue.equals(setValue)) { value = defaultValue; } else { value = setValue + " (" + Translator.R("ITWSdefault") + ": " + defaultValue + ")"; } } else { if (fileAcronom == null) { value = defaultValue; } else { value = fileAcronom; } } ValueValidator v = entry.getValue().getValidator(); if (v != null && v.getPossibleValues() != null && !v.getPossibleValues().trim().isEmpty()) { value = value + " (" + Translator.R("IWSpossible") + " " + v.getPossibleValues() + ")"; } sb.append(getFormatter().getOption(entry.getKey(), value)); } return sb.toString(); } public String getKpMinorTitle() { if (expandVariables) { return getFormatter().getBold(Translator.R("IWSexampleL3") + " " + Translator.R("IWSexampleL31")); } else { return getFormatter().getBold(Translator.R("IWSexampleL3") + " " + Translator.R("IWSexampleL32")); } } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/docprovider/PaxHeaders.17941/ItwebPluginTextProvide0000644000000000000000000000013112654402377030345 xustar0030 mtime=1454507263.257432314 29 atime=1454507327.16258003 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/docprovider/ItwebPluginTextProvider.java0000644000175000002070000001415512654402377032201 0ustar00jvanekmock00000000000000/* Copyright (C) 2008 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util.docprovider; import java.io.IOException; import net.sourceforge.jnlp.config.PathsAndFiles; import net.sourceforge.jnlp.runtime.Translator; import net.sourceforge.jnlp.util.docprovider.formatters.formatters.Formatter; /** * * @author jvanek */ public class ItwebPluginTextProvider extends TextsProvider { public ItwebPluginTextProvider(String encoding, Formatter formatter, boolean forceTitles, boolean expandFiles) { super(encoding, formatter, forceTitles, expandFiles); } @Override public String getId() { return ITW_PLUGIN; } @Override public String getIntroduction() { return super.getIntroduction() + getFormatter().wrapParagraph( getFormatter().process(getId() + " " + Translator.R("ITWPintro"))); } @Override public String getSynopsis() { //yes, thsi really returns arch of jdk. So just nice nicly looking, mostly ok workaround. //fix needs native code String jdkArch = System.getProperty("os.arch") + "x"; String mozillas; if (expandVariables) { mozillas = getFormatter().getOption(PathsAndFiles.MOZILA_USER.getFile().getParent(), PathsAndFiles.MOZILA_USER.getDescription()); } else { mozillas = getFormatter().getOption(PathsAndFiles.MOZILA_USER.getDirViaAcronym(), PathsAndFiles.MOZILA_USER.getDescription()); } if (!expandVariables || jdkArch.endsWith("64")) { if (expandVariables) { mozillas += getFormatter().getOption(PathsAndFiles.MOZILA_GLOBAL_64.getDirViaAcronym(), PathsAndFiles.MOZILA_GLOBAL_64.getDescription()); } else { mozillas += getFormatter().getOption(PathsAndFiles.MOZILA_GLOBAL_64.getFile().getParent(), PathsAndFiles.MOZILA_GLOBAL_64.getDescription()); } } if (!expandVariables || !jdkArch.endsWith("64")) { if (expandVariables) { mozillas += getFormatter().getOption(PathsAndFiles.MOZILA_GLOBAL_32.getDirViaAcronym(), PathsAndFiles.MOZILA_GLOBAL_32.getDescription()); } else { mozillas += getFormatter().getOption(PathsAndFiles.MOZILA_GLOBAL_32.getFile().getParent(), PathsAndFiles.MOZILA_GLOBAL_32.getDescription()); } } String operas = ""; if (!expandVariables || jdkArch.endsWith("64")) { if (expandVariables) { operas += getFormatter().getOption(PathsAndFiles.OPERA_64.getDirViaAcronym(), PathsAndFiles.OPERA_64.getDescription()); } else { operas += getFormatter().getOption(PathsAndFiles.OPERA_64.getFile().getParent(), PathsAndFiles.OPERA_64.getDescription()); } } if (!expandVariables || !jdkArch.endsWith("64")) { if (expandVariables) { operas += getFormatter().getOption(PathsAndFiles.OPERA_32.getDirViaAcronym(), PathsAndFiles.OPERA_32.getDescription()); } else { operas += getFormatter().getOption(PathsAndFiles.OPERA_32.getFile().getParent(), PathsAndFiles.OPERA_32.getDescription()); } } return super.getSynopsis() + getFormatter().getBold(getId() + " ") + getFormatter().process(Translator.R("ITWPsynopsL1")) + getFormatter().getNewLine() + getFormatter().wrapParagraph( getFormatter().process(Translator.R("ITWPsynopsL2", PathsAndFiles.ICEDTEA_SO, getFormatter().getUrl(ITW_PLUGIN_URL))) + getFormatter().getNewLine() + getFormatter().process(Translator.R("ITWPsynopsL3")) + getFormatter().getNewLine() + mozillas) + getFormatter().wrapParagraph(getFormatter().process(Translator.R("ITWPsynopsL4")) + getFormatter().getNewLine() + operas) + getFormatter().wrapParagraph(Translator.R("ITWPtrademarks")); } @Override public String getDescription() { return ""; } @Override public String getOptions() { return ""; } @Override public String getExamples() { return ""; } @Override public String getFiles() { String s = super.getFiles() + getFiles(PathsAndFiles.getAllPluginFiles()); s = s + getFilesAppendix(); return s; } public static void main(String[] args) throws IOException { TextsProvider.main(new String[]{"all", "false", "3.51.a"}); } @Override public String getCommands() { return ""; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/docprovider/PaxHeaders.17941/IcedTeaWebTextsProvide0000644000000000000000000000013112654402377030233 xustar0030 mtime=1454507263.256432328 29 atime=1454507327.16258003 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/docprovider/IcedTeaWebTextsProvider.java0000644000175000002070000001275312654402377032071 0ustar00jvanekmock00000000000000/* Copyright (C) 2008 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util.docprovider; import java.io.IOException; import net.sourceforge.jnlp.runtime.Translator; import net.sourceforge.jnlp.util.docprovider.formatters.formatters.Formatter; public class IcedTeaWebTextsProvider extends TextsProvider { public IcedTeaWebTextsProvider(String encoding, Formatter formatter, boolean forceTitles, boolean expandFiles) { super(encoding, formatter, forceTitles, expandFiles); } @Override public String getIntroduction() { return super.getIntroduction() + getFormatter().wrapParagraph( Translator.R("ITWintroL1",getFormatter().getBold(getId() + " ")) + getFormatter().getNewLine(2) + Translator.R("ITWintroL2") + getFormatter().getNewLine() + Translator.R("ITWintroL3", getId(), getFormatter().getUrl("http://www.java.com/en/download/testjava.jsp", Translator.R("ITWintroUrlCaption"))) + getFormatter().getNewLine() + getFormatter().getOption("",Translator.R("BFileInfoAuthors")) + getFormatter().getOption("",Translator.R("BFileInfoCopying")) + getFormatter().getOption("",Translator.R("BFileInfoNews")) + getFormatter().getNewLine(2)); } @Override public String getSynopsis() { return ""; } @Override public String getDescription() { StringBuilder p1 = new StringBuilder(); //there is 7 pairs of keys ITWdescO X title/text. I was to lazy to enumerate them manually for (int x = 1; x <= 7; x++) { p1.append(getFormatter().getOption(Translator.R("ITWdescO" + x + "title"), Translator.R("ITWdescO" + x + "text"))); } p1.append(getFormatter().getNewLine()); StringBuilder p2 = new StringBuilder(); p2.append(Translator.R("ITWdescL1", getFormatter().getUrl(IT_MAIN, Translator.R("ITWdescWikiUrlTitle")), getFormatter().getUrl(ITW_HOME, Translator.R("ITWdescItwWikiUrlTitle")))); p2.append(getFormatter().getNewLine()); p2.append(Translator.R("ITWdescL2", getFormatter().getUrl(ITW_ISSUES, Translator.R("ITWdescIssuesUrlTitle")))); p2.append(getFormatter().getNewLine()); String header = getFormatter().getBold(Translator.R("ITWdescL3") + " ") + getFormatter().getNewLine(); return super.getDescription() + getFormatter().wrapParagraph(header) + getFormatter().wrapParagraph(p1.toString()) + getFormatter().getNewLine() + getFormatter().wrapParagraph(p2.toString()); } @Override public String getOptions() { String l1 = Translator.R("ITWoptionsL1",getFormatter().getUrl(IT_QUICK,Translator.R("ITWoptionsQuickStartUrlCaption"))); String l2 = Translator.R("ITWoptionsL2", getFormatter().getUrl(ITW_STYLE, Translator.R("ITWoptionsCodeUrlUrlCaption")), getFormatter().getUrl(ITW_ECLIPSE, Translator.R("ITWoptionsEclipseUrlCaption")), getFormatter().getUrl(ITW_REPRODUCERS,Translator.R( "ITWoptionsReproducersUrlCaption")), getFormatter().getUrl(DISTRO_PKG, Translator.R("ITWoptionsDistroUrlCaption"))); String header = getFormatter().getBold(Translator.R("ITWoptionsL3")) + getFormatter().getNewLine(); return getFormatter().wrapParagraph(header) + getFormatter().wrapParagraph(l1) + getFormatter().wrapParagraph(l2); } @Override public String getFiles() { return ""; } @Override public String getExamples() { return ""; } @Override public String getId() { return ITW; } public static void main(String[] args) throws IOException { TextsProvider.main(new String[]{"all", "true", "3.51.a"}); } @Override public String getCommands() { return ""; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/PaxHeaders.17941/XDesktopEntry.java0000644000000000000000000000013112654402377025101 xustar0030 mtime=1454507263.256432328 29 atime=1454507327.16258003 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/XDesktopEntry.java0000644000175000002070000006074512654402377025641 0ustar00jvanekmock00000000000000// Copyright (C) 2009 Red Hat, Inc. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp.util; import net.sourceforge.jnlp.util.logging.OutputController; import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.FileReader; import java.io.IOException; import java.io.OutputStreamWriter; import java.io.Reader; import java.io.StringReader; import java.net.URL; import java.nio.charset.Charset; import java.nio.file.Files; import java.nio.file.StandardCopyOption; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.List; import java.util.Map; import java.util.Map.Entry; import net.sourceforge.jnlp.IconDesc; import net.sourceforge.jnlp.JNLPFile; import net.sourceforge.jnlp.OptionsDefinitions; import net.sourceforge.jnlp.PluginBridge; import net.sourceforge.jnlp.StreamEater; import net.sourceforge.jnlp.cache.CacheUtil; import net.sourceforge.jnlp.cache.UpdatePolicy; import net.sourceforge.jnlp.config.PathsAndFiles; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.security.dialogs.AccessWarningPaneComplexReturn; /** * This class builds a (freedesktop.org) desktop entry out of a {@link JNLPFile} * . This entry can be used to install desktop shortcuts. See xdg-desktop-icon * (1) and http://standards.freedesktop.org/desktop-entry-spec/latest/ for more * information * * @author Omair Majid * * * This class builds also (freedesktop.org) menu entry out of a {@link JNLPFile} * Few notes valid November 2014: * Mate/gnome 2/xfce - no meter of exec or icon put icon to defined/"others" Category * - name is as expected Name's value * - if removed, xfce kept icon until login/logout * kde 4 - unknown Cathegory is sorted to Lost & Found -thats bad * - if icon is not found, nothing shows * - name is GENERIC NAME and then little name * Gnome 3 shell - exec must be valid program! * - also had issues with icon * * conclusion: * - backup icon to .config * - use "Network" category * - force valid launcher * @author (not so proudly) Jiri Vanek */ public class XDesktopEntry { public static final String JAVA_ICON_NAME = "javaws"; private JNLPFile file = null; private int iconSize = -1; private String iconLocation = null; //in pixels private static final int[] VALID_ICON_SIZES = new int[] { 16, 22, 32, 48, 64, 128 }; //browsers we try to find on path for html shortcut public static final String[] BROWSERS = new String[]{"firefox", "midori", "epiphany", "opera", "chromium", "chrome", "konqueror"}; public static final String FAVICON = "favicon.ico"; /** * Create a XDesktopEntry for the given JNLP file * * @param file a {@link JNLPFile} that indicates the application to launch */ public XDesktopEntry(JNLPFile file) { this.file = file; /* looks like a good initial value */ iconSize = VALID_ICON_SIZES[2]; } /** * Returns the contents of the {@link XDesktopEntry} through the * {@link Reader} interface. * @param menu whether to create this icon to menu * @param info result of user's interference * @param isSigned whether the app is signed * @return reader with desktop shortcut specification */ public Reader getContentsAsReader(boolean menu, AccessWarningPaneComplexReturn.ShortcutResult info, boolean isSigned) { File generatedJnlp = null; if (file instanceof PluginBridge && (info.getShortcutType() == AccessWarningPaneComplexReturn.ShortcutResult.Shortcut.GENERATED_JNLP || info.getShortcutType() == AccessWarningPaneComplexReturn.ShortcutResult.Shortcut.JNLP_HREF)) { try { String content = ((PluginBridge) file).toJnlp(isSigned, info.getShortcutType() == AccessWarningPaneComplexReturn.ShortcutResult.Shortcut.JNLP_HREF, info.isFixHref()); generatedJnlp = getGeneratedJnlpFileName(); FileUtils.saveFile(content, generatedJnlp); } catch (Exception ex) { OutputController.getLogger().log(ex); } } String fileContents = "[Desktop Entry]\n"; fileContents += "Version=1.0\n"; fileContents += "Name=" + getDesktopIconName() + "\n"; fileContents += "GenericName=Java Web Start Application\n"; fileContents += "Comment=" + sanitize(file.getInformation().getDescription()) + "\n"; if (menu) { //keeping the default category because of KDE String menuString = "Categories=Network;"; if (file.getInformation().getShortcut() != null && file.getInformation().getShortcut().getMenu() != null && file.getInformation().getShortcut().getMenu().getSubMenu() != null && !file.getInformation().getShortcut().getMenu().getSubMenu().trim().isEmpty()) { menuString += file.getInformation().getShortcut().getMenu().getSubMenu().trim() + ";"; } menuString += "Java;Javaws;"; fileContents += menuString + "\n"; } fileContents += "Type=Application\n"; if (iconLocation != null) { fileContents += "Icon=" + iconLocation + "\n"; } else { fileContents += "Icon=" + JAVA_ICON_NAME + "\n"; } if (file.getInformation().getVendor() != null) { fileContents += "X-Vendor=" + sanitize(file.getInformation().getVendor()) + "\n"; } if (JNLPRuntime.isWebstartApplication()) { String htmlSwitch = ""; if (JNLPRuntime.isHtml()){ htmlSwitch = " "+OptionsDefinitions.OPTIONS.HTML.option; } fileContents += "Exec=" + getJavaWsBin() + htmlSwitch + " \"" + file.getSourceLocation() + "\"\n"; OutputController.getLogger().log("Using " + getJavaWsBin() + htmlSwitch + " as binary for " + file.getSourceLocation()); } else { if (info.getShortcutType() == AccessWarningPaneComplexReturn.ShortcutResult.Shortcut.BROWSER) { String browser = info.getBrowser(); if (browser == null) { browser = getBrowserBin(); } fileContents += "Exec=" + browser + " \"" + file.getSourceLocation() + "\"\n"; OutputController.getLogger().log("Using " + browser + " as binary for " + file.getSourceLocation()); } else if ((info.getShortcutType() == AccessWarningPaneComplexReturn.ShortcutResult.Shortcut.GENERATED_JNLP || info.getShortcutType() == AccessWarningPaneComplexReturn.ShortcutResult.Shortcut.JNLP_HREF) && generatedJnlp != null) { fileContents += "Exec=" + getJavaWsBin() + " \"" + generatedJnlp.getAbsolutePath() + "\"\n"; OutputController.getLogger().log("Using " + getJavaWsBin() + " (generated) as binary for " + file.getSourceLocation() + " to " + generatedJnlp.getAbsolutePath()); } else if (info.getShortcutType() == AccessWarningPaneComplexReturn.ShortcutResult.Shortcut.JAVAWS_HTML) { fileContents += "Exec=" + getJavaWsBin() + " -html \"" + file.getSourceLocation() + "\"\n"; OutputController.getLogger().log("Using " + getJavaWsBin() + " -html as binary for " + file.getSourceLocation()); } else { fileContents += "Exec=" + getBrowserBin() + " \"" + file.getSourceLocation() + "\"\n"; OutputController.getLogger().log("Using " + getBrowserBin() + " as binary for " + file.getSourceLocation()); } } return new StringReader(fileContents); } public static String getBrowserBin() { String pathResult = findOnPath(BROWSERS); if (pathResult != null) { return pathResult; } else { return "browser_not_found"; } } private String getJavaWsBin() { //Shortcut executes the jnlp as it was with system preferred java. It should work fine offline //absolute - works in case of self built String exec = System.getProperty("icedtea-web.bin.location"); String pathResult = findOnPath(new String[]{"javaws", System.getProperty("icedtea-web.bin.name")}); if (pathResult != null) { return pathResult; } if (exec != null) { return exec; } return "javaws"; } private static String findOnPath(String[] bins) { String exec = null; //find if one of binaries is on path String path = System.getenv().get("PATH"); if (path == null || path.trim().isEmpty()) { path = System.getenv().get("path"); } if (path == null || path.trim().isEmpty()) { path = System.getenv().get("Path"); } if (path != null && !path.trim().isEmpty()) { //relative - works with alternatives String[] paths = path.split(File.pathSeparator); outerloop: for (String bin : bins) { //when property is not set if (bin == null) { continue; } for (String p : paths) { if (new File(p, bin).exists()) { exec = bin; break outerloop; } } } } return exec; } /** * Sanitizes a string so that it can be used safely in a key=value pair in a * desktop entry file. * * @param input a String to sanitize * @return a string safe to use as either the key or the value in the * key=value pair in a desktop entry file */ private static String sanitize(String input) { if (input == null) { return ""; } /* key=value pairs must be a single line */ input = FileUtils.sanitizeFileName(input, '-'); //return first line or replace new lines by space? return input.split("\n")[0]; } /** * @return the size of the icon (in pixels) for the desktop shortcut */ public int getIconSize() { return iconSize; } public File getShortcutTmpFile() { String userTmp = PathsAndFiles.TMP_DIR.getFullPath(); File shortcutFile = new File(userTmp + File.separator + getDesktopIconFileName()); return shortcutFile; } /** * Set the icon size to use for the desktop shortcut * * @param size the size (in pixels) of the icon to use. Commonly used sizes * are of 16, 22, 32, 48, 64 and 128 */ public void setIconSize(int size) { iconSize = size; } /** * Create a desktop shortcut for this desktop entry * @param menu how to create in menu * @param desktop how to create on desktop * @param isSigned if it is signed */ public void createDesktopShortcuts(AccessWarningPaneComplexReturn.ShortcutResult menu, AccessWarningPaneComplexReturn.ShortcutResult desktop, boolean isSigned) { boolean isDesktop = false; if (desktop != null && desktop.isCreate()) { isDesktop = true; } boolean isMenu = false; if (menu != null && menu.isCreate()) { isMenu = true; } try { if (isMenu || isDesktop) { try { cacheIcon(); } catch (NonFileProtocolException ex) { OutputController.getLogger().log(ex); //default icon will be used later } } if (isDesktop) { installDesktopLauncher(desktop, isSigned); } if (isMenu) { installMenuLauncher(menu, isSigned); } } catch (Exception e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); } } /** * Install this XDesktopEntry into the user's menu. */ private void installMenuLauncher(AccessWarningPaneComplexReturn.ShortcutResult info, boolean isSigned) { //TODO add itweb-settings tab which alows to remove inidividual items/icons try { File f = getLinuxMenuIconFile(); try (OutputStreamWriter writer = new OutputStreamWriter(new FileOutputStream(f), Charset.forName("UTF-8")); Reader reader = getContentsAsReader(true, info, isSigned)) { char[] buffer = new char[1024]; int ret = 0; while (-1 != (ret = reader.read(buffer))) { writer.write(buffer, 0, ret); } } OutputController.getLogger().log("Menu item created: " + f.getAbsolutePath()); } catch (FileNotFoundException e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); } catch (IOException e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); } } /** * Install this XDesktopEntry into the user's desktop as a launcher. */ private void installDesktopLauncher(AccessWarningPaneComplexReturn.ShortcutResult info, boolean isSigned) { File shortcutFile = getShortcutTmpFile(); try { if (!shortcutFile.getParentFile().isDirectory() && !shortcutFile.getParentFile().mkdirs()) { throw new IOException(shortcutFile.getParentFile().toString()); } FileUtils.createRestrictedFile(shortcutFile, true); try ( /* * Write out a Java String (UTF-16) as a UTF-8 file */ OutputStreamWriter writer = new OutputStreamWriter(new FileOutputStream(shortcutFile), Charset.forName("UTF-8")); Reader reader = getContentsAsReader(false, info, isSigned)) { char[] buffer = new char[1024]; int ret = 0; while (-1 != (ret = reader.read(buffer))) { writer.write(buffer, 0, ret); } } /* * Install the desktop entry */ String[] execString = new String[] { "xdg-desktop-icon", "install", "--novendor", shortcutFile.getCanonicalPath() }; OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "Execing: " + Arrays.toString(execString)); Process installer = Runtime.getRuntime().exec(execString); new StreamEater(installer.getInputStream()).start(); new StreamEater(installer.getErrorStream()).start(); try { installer.waitFor(); } catch (InterruptedException e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); } if (!shortcutFile.delete()) { throw new IOException("Unable to delete temporary file:" + shortcutFile); } } catch (FileNotFoundException e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); } catch (IOException e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); } } public void refreshExistingShortcuts(boolean desktop, boolean menu) { //TODO TODO TODO TODO TODO TODO TODO TODO //check existing jnlp files //check luncher //get where it poiints //try all supported shortcuts methods //choose the one which have most similar result to exisitng ones } public File getGeneratedJnlpFileName() { String name = FileUtils.sanitizeFileName(file.createJnlpTitle()); while (name.endsWith(".jnlp")) { name = name.substring(0, name.length() - 5); } name += ".jnlp"; return new File(findAndVerifyGeneratedJnlpDir(), name); } private class NonFileProtocolException extends Exception { private NonFileProtocolException(String unable_to_cache_icon) { super(unable_to_cache_icon); } } /** * Cache the icon for the desktop entry */ private void cacheIcon() throws IOException, NonFileProtocolException { URL uiconLocation = file.getInformation().getIconLocation(IconDesc.SHORTCUT, iconSize, iconSize); if (uiconLocation == null) { uiconLocation = file.getInformation().getIconLocation(IconDesc.DEFAULT, iconSize, iconSize); } String location = null; if (uiconLocation != null) { //this throws npe, if url (specified in jnlp) points to 404 URL urlLocation = CacheUtil.getCachedResourceURL(uiconLocation, null, UpdatePolicy.SESSION); if (urlLocation == null) { cantCache(); } location = urlLocation.toString(); if (!location.startsWith("file:")) { cantCache(); } } else { //try favicon.ico try { URL favico = new URL( file.getCodeBase().getProtocol(), file.getCodeBase().getHost(), file.getCodeBase().getPort(), "/" + FAVICON); JNLPFile.openURL(favico, null, UpdatePolicy.ALWAYS); //this MAY throw npe, if url (specified in jnlp) points to 404 URL urlLocation = CacheUtil.getCachedResourceURL(favico, null, UpdatePolicy.SESSION); if (urlLocation == null) { cantCache(); } location = urlLocation.toString(); if (!location.startsWith("file:")) { cantCache(); } } catch (IOException ex) { //favicon 404 or similar OutputController.getLogger().log(ex); } } if (location != null) { String origLocation = location.substring("file:".length()); this.iconLocation = origLocation; // icons are never unisntalled by itw. however, system clears them on its own.. soemtimes. // once the -Xcelarcache is run, system MAY clean it later, and so image wil be lost. // copy icon somewhere where -Xclearcache can not PathsAndFiles.ICONS_DIR.getFile().mkdirs(); File source = new File(origLocation); String targetName = source.getName(); if (targetName.equals(FAVICON)) { targetName = file.getCodeBase().getHost() + ".ico"; } File target = new File(PathsAndFiles.ICONS_DIR.getFile(), targetName); Files.copy(source.toPath(), target.toPath(), StandardCopyOption.REPLACE_EXISTING); this.iconLocation = target.getAbsolutePath(); OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "Cached desktop shortcut icon: " + target + " , With source from: " + origLocation); } } private void cantCache() throws NonFileProtocolException { throw new NonFileProtocolException("Unable to cache icon"); } private String getDesktopIconName() { return sanitize(file.createJnlpTitle()); } public File getLinuxDesktopIconFile() { return new File(findFreedesktopOrgDesktopPathCatch() + "/" + getDesktopIconFileName()); } public File getLinuxMenuIconFile() { return new File(findAndVerifyJavawsMenuDir() + "/" + getDesktopIconFileName()); } private String getDesktopIconFileName() { return getDesktopIconName() + ".desktop"; } private static String findAndVerifyGeneratedJnlpDir() { return findAndVerifyBasicDir(PathsAndFiles.GEN_JNLPS_DIR.getFile(), " directroy for stroing generated jnlps cannot be created. You may expect failure"); } private static String findAndVerifyJavawsMenuDir() { return findAndVerifyBasicDir(PathsAndFiles.MENUS_DIR.getFile(), " directroy for stroing menu entry cannot be created. You may expect failure"); } private static String findAndVerifyBasicDir(File f, String message) { String fPath = f.getAbsolutePath(); if (!f.exists()) { if (!f.mkdirs()) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, fPath + message); } } return fPath; } public static String findFreedesktopOrgDesktopPathCatch() { try { return findFreedesktopOrgDesktopPath(); } catch (Exception ex) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, ex); return System.getProperty("user.home") + "/Desktop"; } } /** * Instead of having all this parsing of user-dirs.dirs and replacing * variables we can execute `echo $(xdg-user-dir DESKTOP)` and it will do * all the job in case approaches below become failing * * @return variables (if declared) and quotation marks (unless escaped) free * path * @throws IOException if no file do not exists or key with desktop do not * exists */ private static String findFreedesktopOrgDesktopPath() throws IOException { File userDirs = new File(System.getProperty("user.home") + "/.config/user-dirs.dirs"); if (!userDirs.exists()) { return System.getProperty("user.home") + "/Desktop/"; } return getFreedesktopOrgDesktopPathFrom(userDirs); } private static String getFreedesktopOrgDesktopPathFrom(File userDirs) throws IOException { try (BufferedReader r = new BufferedReader(new FileReader(userDirs))) { return getFreedesktopOrgDesktopPathFrom(r); } } static final String XDG_DESKTOP_DIR = "XDG_DESKTOP_DIR"; static String getFreedesktopOrgDesktopPathFrom(BufferedReader r) throws IOException { while (true) { String s = r.readLine(); if (s == null) { throw new IOException("End of user-dirs found, but no " + XDG_DESKTOP_DIR + " key found"); } s = s.trim(); if (s.startsWith(XDG_DESKTOP_DIR)) { if (!s.contains("=")) { throw new IOException(XDG_DESKTOP_DIR + " has no value"); } String[] keyAndValue = s.split("="); keyAndValue[1] = keyAndValue[1].trim(); String filteredQuotes = filterQuotes(keyAndValue[1]); return evaluateLinuxVariables(filteredQuotes); } } } private static final String MIC = "MAGIC_QUOTIN_ITW_CONSTANT_FOR_DUMMIES"; private static String filterQuotes(String string) { //get rid of " but not of String s = string.replaceAll("\\\\\"", MIC); s = s.replaceAll("\"", ""); s = s.replaceAll(MIC, "\\\""); return s; } private static String evaluateLinuxVariables(String orig) { return evaluateLinuxVariables(orig, System.getenv()); } private static String evaluateLinuxVariables(String orig, Map variables) { List> envVariables = new ArrayList<>(variables.entrySet()); Collections.sort(envVariables, new Comparator>() { @Override public int compare(Entry o1, Entry o2) { return o2.getKey().length() - o1.getKey().length(); } }); while (true) { String before = orig; for (Entry entry : envVariables) { orig = orig.replaceAll("\\$" + entry.getKey(), entry.getValue()); } if (before.equals(orig)) { return orig; } } } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/PaxHeaders.17941/WeakList.java0000644000000000000000000000013212654402377024042 xustar0030 mtime=1454507263.255432341 30 atime=1454507327.161580043 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/WeakList.java0000644000175000002070000001002312654402377024561 0ustar00jvanekmock00000000000000// Copyright (C) 2002-2003 Jon A. Maxwell (JAM) // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp.util; import java.lang.ref.*; import java.util.*; /** * This list stores objects automatically using weak references. * Objects are added and removed from the list as normal, but may * turn to null at any point (ie, indexOf(x) followed by get(x) * may return null). The weak references are only removed when * the trimToSize method is called so that the indices remain * constant otherwise. * * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.3 $ * @param generic typeto be used in this list */ public class WeakList extends AbstractList { /* list of weak references */ private final ArrayList> refs = new ArrayList<>(); /** * Create a weak random-access list. */ public WeakList() { } /** * Extract the hard reference out of a weak reference. */ private E deref(WeakReference o) { if (o != null) return o.get(); else return null; } /** * @param index of field to get * @return the object at the specified index, or null if the * object has been collected. */ @Override public E get(int index) { return deref(refs.get(index)); } /** * @return the size of the list, including already collected * objects. */ @Override public int size() { return refs.size(); } /** * Sets the object at the specified position and returns the * previous object at that position or null if it was already * collected. * @param index position where to place element * @param element data which to put on position * @return previous object on that position */ @Override public E set(int index, E element) { return deref(refs.set(index, new WeakReference<>(element))); } /** * Inserts the object at the specified position in the list. * Automatically creates a weak reference to the object. * @param index position where to insert element * @param element data which to put on position */ @Override public void add(int index, E element) { refs.add(index, new WeakReference<>(element)); } /** * Removes the object at the specified position and returns it * or returns null if it was already collected. * @param index of element to be removed * @return previous object on that position */ @Override public E remove(int index) { return deref(refs.remove(index)); } /** * @return a list of hard references to the objects. The * returned list does not include the collected elements, so its * indices do not necessarily correlate with those of this list. */ public List hardList() { List result = new ArrayList<>(); for (int i = 0; i < size(); i++) { E tmp = get(i); if (tmp != null) result.add(tmp); } return result; } /** * Compacts the list by removing references to collected * objects. */ public void trimToSize() { for (int i = size(); i-- > 0;) if (get(i) == null) remove(i); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/PaxHeaders.17941/UrlUtils.java0000644000000000000000000000013212654402377024102 xustar0030 mtime=1454507263.255432341 30 atime=1454507327.161580043 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/UrlUtils.java0000644000175000002070000003452112654402377024632 0ustar00jvanekmock00000000000000/* UrlUtils.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util; import net.sourceforge.jnlp.util.logging.OutputController; import java.io.File; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.net.MalformedURLException; import java.net.URI; import java.net.URISyntaxException; import java.net.URL; import java.net.URLDecoder; import net.sourceforge.jnlp.JNLPFile; public class UrlUtils { private static final String UTF8 = "utf-8"; public static URL normalizeUrlAndStripParams(URL url, boolean encodeFileUrls) { if (url == null) { return null; } try { String[] urlParts = url.toString().split("\\?"); URL strippedUrl = new URL(urlParts[0]); return normalizeUrl(strippedUrl, encodeFileUrls); } catch (IOException | URISyntaxException e) { OutputController.getLogger().log(e); } return url; } public static URL normalizeUrlAndStripParams(URL url) { return normalizeUrlAndStripParams(url, false); } public static boolean isLocalFile(URL url) { if (url.getProtocol().equals("file") && (url.getAuthority() == null || url.getAuthority().equals("")) && (url.getHost() == null || url.getHost().equals(("")))) { return true; } return false; } /* Decode a percent-encoded URL. Catch checked exceptions and log. */ public static URL decodeUrlQuietly(URL url) { try { return new URL(URLDecoder.decode(url.toString(), UTF8)); } catch (IOException e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); return url; } } /* Use the URI syntax check of 'toURI' to see if it matches RFC2396. * See http://www.ietf.org/rfc/rfc2396.txt */ public static boolean isValidRFC2396Url(URL url) { try { url.toURI(); return true; } catch (URISyntaxException e) { return false; } } /* Ensure a URL is properly percent-encoded. * Certain usages require local-file URLs to be encoded, eg for code-base & document-base. */ public static URL normalizeUrl(URL url, boolean encodeFileUrls) throws MalformedURLException, UnsupportedEncodingException, URISyntaxException { if (url == null) { return null; } String protocol = url.getProtocol(); boolean shouldEncode = (encodeFileUrls || !"file".equals(protocol)); // PR1465: We should not call 'URLDecoder.decode' on RFC2396-compliant URLs if (protocol == null || !shouldEncode || url.getPath() == null || isValidRFC2396Url(url)) { return url; } //Decode the URL before encoding URL decodedURL = new URL(URLDecoder.decode(url.toString(), UTF8)); //Create URI with the decoded URL URI uri = new URI(decodedURL.getProtocol(), null, decodedURL.getHost(), decodedURL.getPort(), decodedURL.getPath(), decodedURL.getQuery(), null); //Returns the encoded URL URL encodedURL = new URL(uri.toASCIIString()); return encodedURL; } /* Ensure a URL is properly percent-encoded. Does not encode local-file URLs. */ public static URL normalizeUrl(URL url) throws MalformedURLException, UnsupportedEncodingException, URISyntaxException { return normalizeUrl(url, false); } /* Ensure a URL is properly percent-encoded. Catch checked exceptions and log. */ public static URL normalizeUrlQuietly(URL url, boolean encodeFileUrls) { try { return normalizeUrl(url, encodeFileUrls); } catch (MalformedURLException | UnsupportedEncodingException | URISyntaxException e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); } return url; } /* Ensure a URL is properly percent-encoded. Catch checked exceptions and log. */ public static URL normalizeUrlQuietly(URL url) { return normalizeUrlQuietly(url, false); } /* Decode a URL as a file, being tolerant of URLs with mixed encoded & decoded portions. */ public static File decodeUrlAsFile(URL url) { return new File(decodeUrlQuietly(url).getFile()); } /** * This function i striping part behind last path delimiter. * * Expected is input like protcol://som.url/some/path/file.suff * Then output will bee protcol://som.url/some/path * * Be aware of input like protcol://som.url/some/path/ * then input will be just protcol://som.url/some/path * * You can use sanitizeLastSlash and see also unittests * Both unix and windows salshes are supported * * @param src src to be stripped * @return src without file */ public static URL removeFileName(final URL src) { if (src == null) { return src; } URL nsrc = normalizeUrlAndStripParams(src); String s = nsrc.getPath(); int i1 = s.lastIndexOf("/"); int i2 = s.lastIndexOf("\\"); int i = Math.max(i1, i2); if (i < 0) { return src; } s = s.substring(0, i); try { return sanitizeLastSlash(new URL(src.getProtocol(), src.getHost(), src.getPort(), s)); } catch (MalformedURLException ex) { OutputController.getLogger().log(ex); return nsrc; } } /** * Small utility function creating li list from collection of urls * @param remoteUrls list of urls * @return String containing html item list of those urls */ public static String setOfUrlsToHtmlList(Iterable remoteUrls) { StringBuilder sb = new StringBuilder(); sb.append("
      "); for (URL url : remoteUrls) { sb.append("
    • ").append(url.toExternalForm()).append("
    • "); } sb.append("
    "); return sb.toString(); } /** * This function is removing all tailing slashes of url and * both unix and windows salshes are supported. * See tests for valid and invalid inputs/outputs * Shortly protcol://som.url/some/path/ or protcol://som.url/some/path//// * (and same for windows protcol://som.url/some\path\\) will become protcol://som.url/some/path * Even protcol://som.url/ is reduced to protcol://som.url * * * When input is like * @param in url t be sanitized * @return url without trailing slash (if any) * @throws MalformedURLException if original url was wrong */ public static URL sanitizeLastSlash(URL in) throws MalformedURLException { if (in == null) { return null; } String s = sanitizeLastSlash(in.toExternalForm()); return new URL(s); } public static String sanitizeLastSlash(final String in) { if (in == null) { return null; } String s = in; while (s.endsWith("/") || s.endsWith("\\")) { s = s.substring(0, s.length() - 1); } return s; } /** * both urls are processed by sanitizeLastSlash before actual equals. * So protcol://som.url/some/path/ is same as protcol://som.url/some/path. * Even protcol://som.url/some/path\ is same as protcol://som.url/some/path/ * * @param u1 first url to comapre * @param u2 second * @return true if urls are equals no matter of trailing slash */ public static boolean equalsIgnoreLastSlash(URL u1, URL u2) { try { if (u1 == null && u2 == null) { return true; } if (u1 == null && u2 != null) { return false; } if (u1 != null && u2 == null) { return false; } return sanitizeLastSlash(u1).equals(sanitizeLastSlash(u2)); } catch (MalformedURLException ex) { throw new RuntimeException(ex); } } public static URL guessCodeBase(JNLPFile file) { if (file.getCodeBase() != null) { return file.getCodeBase(); } else { //Fixme: codebase should be the codebase of the Main Jar not //the location. Although, it still works in the current state. return file.getResources().getMainJAR().getLocation(); } } /** * Compares a URL using string compareNullableStrings of its protocol, host, port, path, query, and anchor. This method avoids the host name lookup that * URL.equals does for http: protocol URLs. It may not return the same value * as the URL.equals method (different hostnames that resolve to the same IP * address, ie sourceforge.net and www.sourceforge.net). * * @param u1 first url to compareNullableStrings * @param u2 second url to compareNullableStrings * @return whether the u1 and u2 points to same resource or not */ public static boolean urlEquals(URL u1, URL u2) { if (u1 == u2) { return true; } if (u1 == null || u2 == null) { return false; } if (notNullUrlEquals(u1, u2)) { return true; } try { URL nu1 = UrlUtils.normalizeUrl(u1); URL nu2 = UrlUtils.normalizeUrl(u2); if (notNullUrlEquals(nu1, nu2)) { return true; } } catch (Exception ex) { OutputController.getLogger().log(ex); } return false; } static boolean notNullUrlEquals(URL u1, URL u2) { return compareNullableStrings(u1.getProtocol(), u2.getProtocol(), true) && compareNullableStrings(u1.getHost(), u2.getHost(), true) && compareNullableStrings(u1.getPath(), u2.getPath(), false) && compareNullableStrings(u1.getQuery(), u2.getQuery(), false) && compareNullableStrings(u1.getRef(), u2.getRef(), false); // && u1.getPort() == u2.getPort(); errornous? } /** * Compare strings that can be {@code null}. * @param s1 first string to compareNullableStrings with s2 * @param s2 second string to compareNullableStrings with s1 * @param ignore switch to ignore case */ static boolean compareNullableStrings(String s1, String s2, boolean ignore) { //this check is need to evaluate two nulls correctly if (s1 == s2) { return true; } if (s1 == null || s2 == null) { return false; } if (ignore) { return s1.equalsIgnoreCase(s2); } else { return s1.equals(s2); } } public static int getSanitizedPort(final URL u) { if (u.getPort() < 0) { return u.getDefaultPort(); } return u.getPort(); } public static int getPort(final URL url) { return getSanitizedPort(url); } public static String getHostAndPort(final URL url) { return url.getHost() + ":" + getSanitizedPort(url); } public static URL ensureSlashTail(URL u) { if (u == null) { return null; } String s = ensureSlashTail(u.toExternalForm()); try { return new URL(s); } catch (MalformedURLException ex) { OutputController.getLogger().log(ex); return u; } } public static String ensureSlashTail(String s) { if (s.endsWith("/")) { return s; } if (s.endsWith("\\")) { return s; } if (s.contains("/")) { return s + "/"; } if (s.contains("\\")) { return s + "\\"; } return s + "/"; } public static String stripFile(URL documentbase) { //whenused in generation of regec, the trailing slash is very important //see the result between http:/some.url/path.* and http:/some.url/path/.* return UrlUtils.ensureSlashTail(stripFileImp(documentbase)); } private static String stripFileImp(URL documentbase) { try { String normalized = UrlUtils.normalizeUrlAndStripParams(documentbase).toExternalForm().trim(); if (normalized.endsWith("/") || normalized.endsWith("\\")) { return normalized; } URL middleway = new URL(normalized); String file = middleway.getFile(); int i = Math.max(file.lastIndexOf('/'), file.lastIndexOf('\\')); if (i < 0) { return normalized; } String parent = file.substring(0, i + 1); String stripped = normalized.replace(file, parent); return stripped; } catch (Exception ex) { OutputController.getLogger().log(ex); return documentbase.toExternalForm(); } } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/PaxHeaders.17941/TimedHashMap.java0000644000000000000000000000013212654402377024623 xustar0030 mtime=1454507263.254432354 30 atime=1454507327.161580043 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/TimedHashMap.java0000644000175000002070000001566512654402377025363 0ustar00jvanekmock00000000000000/* TimedHashMap.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Objects; import java.util.Set; import java.util.concurrent.TimeUnit; import static java.util.Objects.requireNonNull; import net.sourceforge.jnlp.util.logging.OutputController; /** * Simple utility class that extends HashMap by adding an expiry to the entries. * * This map stores entries, and returns them only if the entries were last accessed within a specified timeout period. * Otherwise, null is returned. * * This map does not allow null keys but does allow null values. * * @param K The key type * @param V The Object type */ public class TimedHashMap implements Map { private static class TimedEntry { private final T value; private long timestamp; public TimedEntry(final T value) { this.value = value; updateTimestamp(); } public void updateTimestamp() { timestamp = System.nanoTime(); } } private static final long DEFAULT_TIMEOUT = TimeUnit.SECONDS.toNanos(10); private final HashMap> actualMap = new HashMap<>(); private long timeout = DEFAULT_TIMEOUT; public TimedHashMap() { this(DEFAULT_TIMEOUT, TimeUnit.NANOSECONDS); } /** * Create a new map with a non-default entry timeout period * @param unit the units of the timeout * @param timeout the length of the timeout */ public TimedHashMap(final long timeout, final TimeUnit unit) { setTimeout(timeout, unit); } /** * Specify how long (in nanoseconds) entries are valid for * @param unit the units of the timeout * @param timeout the length of the timeout */ public void setTimeout(final long timeout, final TimeUnit unit) { this.timeout = unit.toNanos(timeout); } /** * Store the item in the map and associate a timestamp with it. null is not accepted as a key. * * @param key The key * @param value The value to store */ @Override public V put(final K key, final V value) { requireNonNull(key); final TimedEntry oldEntry = actualMap.get(key); final V oldValue; if (oldEntry != null) { oldValue = oldEntry.value; } else { oldValue = null; } actualMap.put(key, new TimedEntry<>(value)); return oldValue; } /** * Return cached item if it has not already expired. * * Before returning, this method also resets the "last accessed" * time for this entry, so it is good for another 10 seconds * * @param key The key */ @Override public V get(final Object key) { final long now = System.nanoTime(); if (actualMap.containsKey(key)) { final TimedEntry timedEntry = actualMap.get(key); final long age = now - timedEntry.timestamp; // Item exists. If it has not expired, renew its access time and return it if (age <= timeout) { OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "Returning entry " + actualMap.get(key) + " from cache for " + key); timedEntry.updateTimestamp(); return timedEntry.value; } else { OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "Cached entry for " + key + " has expired (age=" + (age * 1e-9) + " seconds)"); } } return null; } @Override public boolean containsKey(final Object key) { return actualMap.containsKey(key); } @Override public int size() { return actualMap.size(); } @Override public boolean isEmpty() { return actualMap.isEmpty(); } @Override public boolean containsValue(final Object value) { for (final TimedEntry entry : actualMap.values()) { if (Objects.equals(entry.value, value)) { return true; } } return false; } @Override public V remove(final Object key) { if (actualMap.containsKey(key)) { return actualMap.remove(key).value; } return null; } @Override public void putAll(Map m) { for (final Map.Entry entry : m.entrySet()) { actualMap.put(entry.getKey(), new TimedEntry(entry.getValue())); } } @Override public void clear() { actualMap.clear(); } @Override public Set keySet() { return new HashSet<>(actualMap.keySet()); } @Override public Collection values() { final Collection values = new ArrayList<>(actualMap.size()); for (final TimedEntry value : actualMap.values()) { values.add(value.value); } return values; } @Override public Set> entrySet() { final Map strippedMap = new HashMap<>(actualMap.size()); for (final Map.Entry> entry : actualMap.entrySet()) { strippedMap.put(entry.getKey(), entry.getValue().value); } return strippedMap.entrySet(); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/PaxHeaders.17941/StreamUtils.java0000644000000000000000000000013212654402377024573 xustar0030 mtime=1454507263.254432354 30 atime=1454507327.161580043 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/StreamUtils.java0000644000175000002070000000772012654402377025324 0ustar00jvanekmock00000000000000/* Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util; import net.sourceforge.jnlp.util.logging.OutputController; import java.io.BufferedReader; import java.io.Closeable; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; public class StreamUtils { /** * Closes a stream, without throwing IOException. * In IOException is properly logged and consumed * * @param stream the stream that will be closed */ public static void closeSilently(Closeable stream) { if (stream != null) { try { stream.close(); } catch (IOException e) { OutputController.getLogger().log(e); } } } /** * Copy an input stream's contents into an output stream. * @param input input stream * @param output stream where to copy input * @throws java.io.IOException if IO fails */ public static void copyStream(InputStream input, OutputStream output) throws IOException { byte[] buffer = new byte[1024]; while (true) { int bytesRead = input.read(buffer); if (bytesRead == -1) { break; } output.write(buffer, 0, bytesRead); } } public static String readStreamAsString(InputStream stream) throws IOException { return readStreamAsString(stream, false); } public static String readStreamAsString(InputStream stream, String encoding) throws IOException { return readStreamAsString(stream, false, encoding); } public static String readStreamAsString(InputStream stream, boolean includeEndOfLines) throws IOException { return readStreamAsString(stream, includeEndOfLines, "UTF-8"); } public static String readStreamAsString(InputStream stream, boolean includeEndOfLines, String encoding) throws IOException { InputStreamReader is = new InputStreamReader(stream, encoding); StringBuilder sb = new StringBuilder(); BufferedReader br = new BufferedReader(is); while (true) { String read = br.readLine(); if (read == null) { break; } sb.append(read); if (includeEndOfLines){ sb.append('\n'); } } return sb.toString(); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/PaxHeaders.17941/ScreenFinder.java0000644000000000000000000000013212654402377024666 xustar0030 mtime=1454507263.254432354 30 atime=1454507327.161580043 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/ScreenFinder.java0000644000175000002070000001070412654402377025413 0ustar00jvanekmock00000000000000/* ScreenFinder.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util; import java.awt.GraphicsConfiguration; import java.awt.GraphicsDevice; import java.awt.GraphicsEnvironment; import java.awt.HeadlessException; import java.awt.Insets; import java.awt.MouseInfo; import java.awt.Point; import java.awt.Rectangle; import java.awt.Toolkit; import java.awt.Window; import net.sourceforge.jnlp.util.logging.OutputController; public class ScreenFinder { public static GraphicsDevice getCurrentScreen() { Point p = MouseInfo.getPointerInfo().getLocation(); return getScreenOnCoords(p); } public static Rectangle getCurrentScreenSizeWithoutBounds() { try { Point p = MouseInfo.getPointerInfo().getLocation(); return getScreenOnCoordsWithoutBounds(p); } catch (HeadlessException ex) { OutputController.getLogger().log(ex); return new Rectangle(800, 600); } } public static void centerWindowsToCurrentScreen(Window w) { Rectangle bounds = getCurrentScreenSizeWithoutBounds(); w.setLocation(bounds.x + (bounds.width - w.getWidth())/2, bounds.y + (bounds.height - w.getHeight())/2); } public static GraphicsDevice getScreenOnCoords(Point point) { GraphicsEnvironment e = GraphicsEnvironment.getLocalGraphicsEnvironment(); GraphicsDevice[] devices = e.getScreenDevices(); GraphicsDevice result = null; //now get the configuration(s) for each device for (GraphicsDevice device : devices) { //GraphicsConfiguration[] configurations = device.getConfigurations(); //or? GraphicsConfiguration[] configurations = new GraphicsConfiguration[]{device.getDefaultConfiguration()}; for (GraphicsConfiguration config : configurations) { Rectangle gcBounds = config.getBounds(); if (gcBounds.contains(point)) { result = device; } } } if (result == null) { //not found, get the default display result = e.getDefaultScreenDevice(); } return result; } public static Rectangle getScreenOnCoordsWithoutBounds(Point p) { try { GraphicsDevice device = getScreenOnCoords(p); Rectangle screenSize = device.getDefaultConfiguration().getBounds(); Insets insets = Toolkit.getDefaultToolkit().getScreenInsets(device.getDefaultConfiguration()); return new Rectangle((int) screenSize.getX() + insets.left, (int) screenSize.getY() + insets.top, (int) screenSize.getWidth() - insets.left, (int) screenSize.getHeight() - insets.bottom); } catch (HeadlessException ex) { OutputController.getLogger().log(ex); return new Rectangle(800, 600); } } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/PaxHeaders.17941/PropertiesFile.java0000644000000000000000000000013212654402377025253 xustar0030 mtime=1454507263.253432368 30 atime=1454507327.161580043 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/PropertiesFile.java0000644000175000002070000001457012654402377026005 0ustar00jvanekmock00000000000000// Copyright (C) 2001-2003 Jon A. Maxwell (JAM) // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp.util; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.util.Properties; import net.sourceforge.jnlp.util.lockingfile.LockedFile; import net.sourceforge.jnlp.util.logging.OutputController; /** * A properties object backed by a specified file without throwing * exceptions. The properties are automatically loaded from the * file when the first property is requested, but the save method * must be called before changes are saved to the file. * * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.4 $ */ public class PropertiesFile extends Properties { /** the file to save to */ LockedFile lockedFile; /** the header string */ String header = "netx file"; /** time of last modification, lazy loaded on getProperty */ long lastStore; /** * Create a properties object backed by the specified file. * * @param file the file to save and load to */ public PropertiesFile(File file) { this.lockedFile = LockedFile.getInstance(file); } /** * Create a properties object backed by the specified file. * * @param file the file to save and load to * @param header the file header */ public PropertiesFile(File file, String header) { this.lockedFile = LockedFile.getInstance(file); this.header = header; } /** * @return the value of the specified key, or null if the key * does not exist. */ @Override public String getProperty(String key) { if (lastStore == 0) load(); return super.getProperty(key); } /** * @return the value of the specified key, or the default value * if the key does not exist. */ @Override public String getProperty(String key, String defaultValue) { if (lastStore == 0) load(); return super.getProperty(key, defaultValue); } /** * Sets the value for the specified key. * * @return the previous value */ @Override public Object setProperty(String key, String value) { if (lastStore == 0) load(); return super.setProperty(key, value); } /** * @return the file backing this properties object. */ public File getStoreFile() { return lockedFile.getFile(); } /** * Ensures that the file backing these properties has been * loaded; call this method before calling any method defined by * a superclass. * * @return true, if file was (re-)loaded * false, if file was still current */ public boolean load() { File file = lockedFile.getFile(); if (!file.exists()) { return false; } long currentStore = file.lastModified(); long currentTime = System.currentTimeMillis(); /* (re)load file, if * - it wasn't loaded/stored, yet (lastStore == 0) * - current file modification timestamp has changed since last store (currentStore != lastStore) OR * - current file modification timestamp has not changed since last store AND current system time equals current file modification timestamp * This is necessary because some filesystems seems only to provide accuracy of the timestamp on the level of seconds! */ if(lastStore == 0 || currentStore != lastStore || (currentStore == lastStore && currentStore / 1000 == currentTime / 1000)) { InputStream s = null; try { try { s = new FileInputStream(file); load(s); } finally { if (s != null) { s.close(); lastStore=currentStore; return true; } } } catch (IOException ex) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, ex); } } return false; } /** * Saves the properties to the file. */ public void store() { File file = lockedFile.getFile(); FileOutputStream s = null; try { try { file.getParentFile().mkdirs(); s = new FileOutputStream(file); store(s, header); // fsync() s.getChannel().force(true); lastStore = file.lastModified(); } finally { if (s != null) s.close(); } } catch (IOException ex) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, ex); } } public void lock() { try { lockedFile.lock(); } catch (IOException e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); } } public boolean tryLock() { try { return lockedFile.tryLock(); } catch (IOException e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); } return false; } /** * Unlocks the file. Does not do anything if not holding the lock. */ public void unlock() { try { lockedFile.unlock(); } catch (IOException e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); } } public boolean isHeldByCurrentThread() { return lockedFile.isHeldByCurrentThread(); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/PaxHeaders.17941/MD5SumWatcher.java0000644000000000000000000000013212654402377024707 xustar0030 mtime=1454507263.253432368 30 atime=1454507327.161580043 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/MD5SumWatcher.java0000644000175000002070000000720612654402377025437 0ustar00jvanekmock00000000000000/*Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.security.NoSuchAlgorithmException; import java.util.Arrays; import net.sourceforge.jnlp.util.logging.OutputController; public class MD5SumWatcher { private final File watchedFile; private byte[] md5sum; /** * Create a new MD5SumWatcher instance * @param watchedFile the file to watch */ public MD5SumWatcher(final File watchedFile) { this.watchedFile = watchedFile; try { this.md5sum = getSum(); } catch (final IOException ioe) { OutputController.getLogger().log(ioe); this.md5sum = null; } } /** * Get the current MD5 sum of the watched file * @return a byte array of the MD5 sum * @throws FileNotFoundException if the watched file does not exist * @throws IOException if the file cannot be read */ public byte[] getSum() throws FileNotFoundException, IOException { update(); return md5sum; } /** * Detect if the file's MD5 has changed and track its new sum if so * @return if the file's MD5 has changed since the last update * @throws FileNotFoundException if the watched file does not exist * @throws IOException if the file cannot be read */ public boolean update() throws FileNotFoundException, IOException { byte[] newSum; try { newSum = FileUtils.getFileMD5Sum(watchedFile, "MD5"); } catch (final NoSuchAlgorithmException e) { // There definitely should be an MD5 algorithm, but if not, all we can do is fail. // This really, really is not expected to happen, so rethrow as RuntimeException // to avoid having to check for NoSuchAlgorithmExceptions all the time OutputController.getLogger().log(e); throw new RuntimeException(e); } final boolean changed = !Arrays.equals(newSum, md5sum); md5sum = newSum; return changed; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/PaxHeaders.17941/JarFile.java0000644000000000000000000000013212654402377023633 xustar0030 mtime=1454507263.253432368 30 atime=1454507327.161580043 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/JarFile.java0000644000175000002070000001274312654402377024365 0ustar00jvanekmock00000000000000/* Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util; import java.io.Closeable; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import net.sourceforge.jnlp.runtime.JNLPRuntime; /** * A wrapper over {@link java.util.jar.JarFile} that verifies zip headers to * protect against GIFAR attacks. * * @see Gifar */ public class JarFile extends java.util.jar.JarFile implements Closeable { public JarFile(String name) throws IOException { super(name); verifyZipHeader(new File(name)); } public JarFile(String name, boolean verify) throws IOException { super(name, verify); verifyZipHeader(new File(name)); } public JarFile(File file) throws IOException { super(file); verifyZipHeader(file); } public JarFile(File file, boolean verify) throws IOException { super(file, verify); verifyZipHeader(file); } public JarFile(File file, boolean verify, int mode) throws IOException { super(file, verify, mode); verifyZipHeader(file); } /** * The ZIP specification requires that the zip header for all entries in a * zip-compressed archive must start with a well known "PK" which is * defined as hex x50 x4b x03 x04. *

    * Note - this is not file-header, it is item-header. *

    * Actually most of compressing formats have some n-bytes headers. Eg: * http://www.gzip.org/zlib/rfc-gzip.html#header-trailer for ID1 and ID2 so * in case that some differently compressed jars will come to play, this is * the place where to fix it. * * @see ZIP Specification */ private static final byte[] ZIP_ENTRY_HEADER_SIGNATURE = new byte[] {0x50, 0x4b, 0x03, 0x04}; /** * Verify the header for the zip entry. *

    * Although zip specification allows to skip all corrupted entries, it is * not safe for jars since it allows a different format to fake itself as * a Jar. */ private void verifyZipHeader(File file) throws IOException { if (!JNLPRuntime.isIgnoreHeaders()) { InputStream s = new FileInputStream(file); /* * Theoretically, a valid ZIP file can begin with anything. We * ensure it begins with a valid entry header to confirm it only * contains zip entries. */ try { byte[] buffer = new byte[ZIP_ENTRY_HEADER_SIGNATURE.length]; /* * for case that new byte[] will accidently initialize same * sequence as zip header and during the read the buffer will not be filled */ for (int i = 0; i < buffer.length; i++) { buffer[i] = 0; } int toRead = ZIP_ENTRY_HEADER_SIGNATURE.length; int readSoFar = 0; int n = 0; /* * this is used instead of s.read(buffer) for case of block and * so returned not-fully-filled dbuffer */ while ((n = s.read(buffer, readSoFar, buffer.length - readSoFar)) != -1) { readSoFar += n; if (readSoFar == toRead) { break; } } for (int i = 0; i < buffer.length; i++) { if (buffer[i] != ZIP_ENTRY_HEADER_SIGNATURE[i]) { throw new InvalidJarHeaderException("Jar " + file.getName() + " do not heave valid header. You can skip this check by -Xignoreheaders"); } } } finally { s.close(); } } } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/PaxHeaders.17941/InvalidJarHeaderException.java0000644000000000000000000000013212654402377027332 xustar0030 mtime=1454507263.252432381 30 atime=1454507327.160580057 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/InvalidJarHeaderException.java0000644000175000002070000000364312654402377030063 0ustar00jvanekmock00000000000000/* Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util; /** * Thrown from net.sourceforge.jnlp.utilJArFile when verification of headers fails * */ public class InvalidJarHeaderException extends RuntimeException{ public InvalidJarHeaderException(String string) { super(string); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/PaxHeaders.17941/ImageResources.java0000644000000000000000000000013212654402377025234 xustar0030 mtime=1454507263.252432381 30 atime=1454507327.160580057 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/ImageResources.java0000644000175000002070000000661312654402377025765 0ustar00jvanekmock00000000000000/* ImageResources.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util; import net.sourceforge.jnlp.util.logging.OutputController; import java.awt.Image; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.imageio.ImageIO; public enum ImageResources { INSTANCE; private static final String APPLICATION_ICON_PATH = "net/sourceforge/jnlp/resources/netx-icon.png"; private final Map cache = new HashMap<>(); private ImageResources() {} /* this is for testing ONLY */ void clearCache() { cache.clear(); } /** * Returns an appropriate image, or null if there are errors loading the image. */ private Image getApplicationImage() { if (cache.containsKey(APPLICATION_ICON_PATH)) { return cache.get(APPLICATION_ICON_PATH); } ClassLoader cl = this.getClass().getClassLoader(); if (cl == null) { cl = ClassLoader.getSystemClassLoader(); } InputStream in = cl.getResourceAsStream(APPLICATION_ICON_PATH); try { Image image = ImageIO.read(in); cache.put(APPLICATION_ICON_PATH, image); return image; } catch (IOException ioe) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, ioe); return null; } } /** * @return an appropriate image, or null if there are errors loading the image. */ public List getApplicationImages() { List images = new ArrayList<>(); Image appImage = getApplicationImage(); if (appImage != null) { images.add(appImage); } return images; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/PaxHeaders.17941/HttpUtils.java0000644000000000000000000000013212654402377024257 xustar0030 mtime=1454507263.252432381 30 atime=1454507327.160580057 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/HttpUtils.java0000644000175000002070000000543312654402377025007 0ustar00jvanekmock00000000000000/* Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util; import net.sourceforge.jnlp.util.logging.OutputController; import java.io.IOException; import java.io.InputStream; import java.net.HttpURLConnection; public class HttpUtils { /** * Ensure a HttpURLConnection is fully read, required for correct behavior. * Captured IOException is consumed and printed * @param c the connection to be closed silently */ public static void consumeAndCloseConnectionSilently(HttpURLConnection c) { try { consumeAndCloseConnection(c); } catch (IOException ex) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, ex); } } /** * Ensure a HttpURLConnection is fully read, required for correct behavior * * @param c connection to be closed * @throws IOException if connection fade */ public static void consumeAndCloseConnection(HttpURLConnection c) throws IOException { try (InputStream in = c.getInputStream()) { byte[] throwAwayBuffer = new byte[256]; while (in.read(throwAwayBuffer) > 0) { /* ignore contents */ } } } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/PaxHeaders.17941/FileUtils.java0000644000000000000000000000013212654402377024217 xustar0030 mtime=1454507263.252432381 30 atime=1454507327.160580057 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/FileUtils.java0000644000175000002070000006002112654402377024741 0ustar00jvanekmock00000000000000// Copyright (C) 2009 Red Hat, Inc. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp.util; import java.awt.Component; import static net.sourceforge.jnlp.runtime.Translator.R; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.RandomAccessFile; import java.io.Reader; import java.io.Writer; import java.nio.channels.FileChannel; import java.nio.channels.FileLock; import java.security.DigestInputStream; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.ArrayList; import java.util.List; import javax.swing.JFrame; import javax.swing.JOptionPane; import javax.swing.SwingUtilities; import net.sourceforge.jnlp.config.DirectoryValidator; import net.sourceforge.jnlp.config.DirectoryValidator.DirectoryCheckResults; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.util.logging.OutputController; /** * This class contains a few file-related utility functions. * * @author Omair Majid */ public final class FileUtils { /** * Indicates whether a file was successfully opened. If not, provides specific reasons * along with a general failure case */ public enum OpenFileResult { /** The file was successfully opened */ SUCCESS, /** The file could not be opened, for non-specified reasons */ FAILURE, /** The file could not be opened because it did not exist and could not be created */ CANT_CREATE, /** The file can be opened but in read-only */ CANT_WRITE, /** The specified path pointed to a non-file filesystem object, ie a directory */ NOT_FILE; } /** * list of characters not allowed in filenames */ public static final char INVALID_CHARS[] = {'\\', '/', ':', '*', '?', '"', '<', '>', '|', '[', ']', '\'', ';', '=', ','}; private static final char SANITIZED_CHAR = '_'; /** * Clean up a string by removing characters that can't appear in a local * file name. * * @param path * the path to sanitize * @return a sanitized version of the input which is suitable for using as a * file path */ public static String sanitizePath(String path) { return sanitizePath(path, SANITIZED_CHAR); } public static String sanitizePath(String path, char substitute) { for (int i = 0; i < INVALID_CHARS.length; i++) { if (INVALID_CHARS[i] != File.separatorChar) { if (-1 != path.indexOf(INVALID_CHARS[i])) { path = path.replace(INVALID_CHARS[i], substitute); } } } return path; } /** * Given an input, return a sanitized form of the input suitable for use as * a file/directory name * * @param filename the filename to sanitize. * @return a sanitized version of the input */ public static String sanitizeFileName(String filename) { return sanitizeFileName(filename, SANITIZED_CHAR); } public static String sanitizeFileName(String filename, char substitute) { for (int i = 0; i < INVALID_CHARS.length; i++) { if (-1 != filename.indexOf(INVALID_CHARS[i])) { filename = filename.replace(INVALID_CHARS[i], substitute); } } return filename; } /** * Creates a new directory with minimum permissions. The directory is not * readable or writable by anyone other than the owner. The parent * directories are not created; they must exist before this is called. * * @param directory directory to be created * @throws IOException if IO fails */ public static void createRestrictedDirectory(File directory) throws IOException { createRestrictedFile(directory, true, true); } /** * Creates a new file with minimum permissions. The file is not readable or * writable by anyone other than the owner. If writeableByOnwer is false, * even the owner can not write to it. * * @param file path to file * @param writableByOwner true if can be writable by owner * @throws IOException if IO fails */ public static void createRestrictedFile(File file, boolean writableByOwner) throws IOException { createRestrictedFile(file, false, writableByOwner); } /** * Tries to create the ancestor directories of file f. Throws * an IOException if it can't be created (but not if it was * already there). * @param f file to provide parent directory * @param eMsg - the message to use for the exception. null * if the file name is to be used. * @throws IOException if the directory can't be created and doesn't exist. */ public static void createParentDir(File f, String eMsg) throws IOException { File parent = f.getParentFile(); if (!parent.isDirectory() && !parent.mkdirs()) { throw new IOException(R("RCantCreateDir", eMsg == null ? parent : eMsg)); } } /** * Tries to create the ancestor directories of file f. Throws * an IOException if it can't be created (but not if it was * already there). * @param f file which parent will be created * @throws IOException if the directory can't be created and doesn't exist. */ public static void createParentDir(File f) throws IOException { createParentDir(f, null); } /** * Tries to delete file f. If the file exists but couldn't be deleted, * print an error message to stderr with the file name, or eMsg if eMsg * is not null. * @param f the file to be deleted * @param eMsg the message to print on failure (or null to print the * the file name). */ public static void deleteWithErrMesg(File f, String eMsg) { if (f.exists()) { if (!f.delete()) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, R("RCantDeleteFile", eMsg == null ? f : eMsg)); } } } /** * Tries to delete file f. If the file exists but couldn't be deleted, * print an error message to stderr with the file name. * @param f the file to be deleted */ public static void deleteWithErrMesg(File f) { deleteWithErrMesg(f, null); } /** * Creates a new file or directory with minimum permissions. The file is not * readable or writable by anyone other than the owner. If writeableByOnwer * is false, even the owner can not write to it. If isDir is true, then the * directory can be executed by the owner * * @throws IOException */ private static void createRestrictedFile(File file, boolean isDir, boolean writableByOwner) throws IOException { File tempFile = new File(file.getCanonicalPath() + ".temp"); if (isDir) { if (!tempFile.mkdir()) { throw new IOException(R("RCantCreateDir", tempFile)); } } else { if (!tempFile.createNewFile()) { throw new IOException(R("RCantCreateFile", tempFile)); } } if (JNLPRuntime.isWindows()) { // remove all permissions if (!tempFile.setExecutable(false, false)) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, R("RRemoveXPermFailed", tempFile)); } if (!tempFile.setReadable(false, false)) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, R("RRemoveRPermFailed", tempFile)); } if (!tempFile.setWritable(false, false)) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, R("RRemoveWPermFailed", tempFile)); } // allow owner to read if (!tempFile.setReadable(true, true)) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, R("RGetRPermFailed", tempFile)); } // allow owner to write if (writableByOwner && !tempFile.setWritable(true, true)) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, R("RGetWPermFailed", tempFile)); } // allow owner to enter directories if (isDir && !tempFile.setExecutable(true, true)) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, R("RGetXPermFailed", tempFile)); } // rename this file. Unless the file is moved/renamed, any program that // opened the file right after it was created might still be able to // read the data. if (!tempFile.renameTo(file)) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, R("RCantRename", tempFile, file)); } } else { // remove all permissions if (!tempFile.setExecutable(false, false)) { throw new IOException(R("RRemoveXPermFailed", tempFile)); } if (!tempFile.setReadable(false, false)) { throw new IOException(R("RRemoveRPermFailed", tempFile)); } if (!tempFile.setWritable(false, false)) { throw new IOException(R("RRemoveWPermFailed", tempFile)); } // allow owner to read if (!tempFile.setReadable(true, true)) { throw new IOException(R("RGetRPermFailed", tempFile)); } // allow owner to write if (writableByOwner && !tempFile.setWritable(true, true)) { throw new IOException(R("RGetWPermFailed", tempFile)); } // allow owner to enter directories if (isDir && !tempFile.setExecutable(true, true)) { throw new IOException(R("RGetXPermFailed", tempFile)); } // rename this file. Unless the file is moved/renamed, any program that // opened the file right after it was created might still be able to // read the data. if (!tempFile.renameTo(file)) { throw new IOException(R("RCantRename", tempFile, file)); } } } /** * Ensure that the parent directory of the file exists and that we are * able to create and access files within this directory * @param file the {@link File} representing a Java Policy file to test * @return a {@link DirectoryCheckResults} object representing the results of the test */ public static DirectoryCheckResults testDirectoryPermissions(File file) { try { file = file.getCanonicalFile(); } catch (final IOException e) { OutputController.getLogger().log(e); return null; } if (file == null || file.getParentFile() == null || !file.getParentFile().exists()) { return null; } final List policyDirectory = new ArrayList<>(); policyDirectory.add(file.getParentFile()); final DirectoryValidator validator = new DirectoryValidator(policyDirectory); final DirectoryCheckResults result = validator.ensureDirs(); return result; } /** * Verify that a given file object points to a real, accessible plain file. * @param file the {@link File} to verify * @return an {@link OpenFileResult} representing the accessibility level of the file */ public static OpenFileResult testFilePermissions(File file) { if (file == null || !file.exists()) { return OpenFileResult.FAILURE; } try { file = file.getCanonicalFile(); } catch (final IOException e) { return OpenFileResult.FAILURE; } final DirectoryCheckResults dcr = FileUtils.testDirectoryPermissions(file); if (dcr != null && dcr.getFailures() == 0) { if (file.isDirectory()) return OpenFileResult.NOT_FILE; try { if (!file.exists() && !file.createNewFile()) { return OpenFileResult.CANT_CREATE; } } catch (IOException e) { return OpenFileResult.CANT_CREATE; } final boolean read = file.canRead(), write = file.canWrite(); if (read && write) return OpenFileResult.SUCCESS; else if (read) return OpenFileResult.CANT_WRITE; else return OpenFileResult.FAILURE; } return OpenFileResult.FAILURE; } /** * Show a dialog informing the user that the file is currently read-only * @param frame a {@link JFrame} to act as parent to this dialog */ public static void showReadOnlyDialog(final Component frame) { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { JOptionPane.showMessageDialog(frame, R("RFileReadOnly"), R("Warning"), JOptionPane.WARNING_MESSAGE); } }); } /** * Show a generic error dialog indicating the file could not be opened * @param frame a {@link JFrame} to act as parent to this dialog * @param filePath a {@link String} representing the path to the file we failed to open */ public static void showCouldNotOpenFilepathDialog(final Component frame, final String filePath) { showCouldNotOpenDialog(frame, R("RCantOpenFile", filePath)); } /** * Show an error dialog indicating the file could not be opened, with a particular reason * @param frame a {@link JFrame} to act as parent to this dialog * @param filePath a {@link String} representing the path to the file we failed to open * @param reason a {@link OpenFileResult} specifying more precisely why we failed to open the file */ public static void showCouldNotOpenFileDialog(final Component frame, final String filePath, final OpenFileResult reason) { final String message; switch (reason) { case CANT_CREATE: message = R("RCantCreateFile", filePath); break; case CANT_WRITE: message = R("RCantWriteFile", filePath); break; case NOT_FILE: message = R("RExpectedFile", filePath); break; default: message = R("RCantOpenFile", filePath); break; } showCouldNotOpenDialog(frame, message); } /** * Show a dialog informing the user that the file could not be opened * @param frame a {@link JFrame} to act as parent to this dialog * @param message a {@link String} giving the specific reason the file could not be opened */ public static void showCouldNotOpenDialog(final Component frame, final String message) { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { JOptionPane.showMessageDialog(frame, message, R("Error"), JOptionPane.ERROR_MESSAGE); } }); } /** * Returns a String that is suitable for using in GUI elements for * displaying (long) paths to users. * * @param path a path that should be shortened * @return a shortened path suitable for displaying to the user */ public static String displayablePath(String path) { final int DEFAULT_LENGTH = 40; return displayablePath(path, DEFAULT_LENGTH); } /** * Return a String that is suitable for using in GUI elements for displaying * paths to users. If the path is longer than visibleChars, it is truncated * in a display-friendly way * * @param path a path that should be shorted * @param visibleChars the maximum number of characters that path should fit * into. Also the length of the returned string * @return a shortened path that contains limited number of chars */ public static String displayablePath(String path, int visibleChars) { /* * use a very simple method: prefix + "..." + suffix * * where prefix is the beginning part of path (as much as we can squeeze in) * and suffix is the end path of path */ if (path == null || path.length() <= visibleChars) { return path; } final String OMITTED = "..."; final int OMITTED_LENGTH = OMITTED.length(); final int MIN_PREFIX_LENGTH = 4; final int MIN_SUFFIX_LENGTH = 4; /* * we want to show things other than OMITTED. if we have too few for * suffix and prefix, then just return as much as we can of the filename */ if (visibleChars < (OMITTED_LENGTH + MIN_PREFIX_LENGTH + MIN_SUFFIX_LENGTH)) { return path.substring(path.length() - visibleChars); } int affixLength = (visibleChars - OMITTED_LENGTH) / 2; String prefix = path.substring(0, affixLength); String suffix = path.substring(path.length() - affixLength); return prefix + OMITTED + suffix; } /** * Recursively delete everything under a directory. Works on either files or * directories * * @param file the file object representing what to delete. Can be either a * file or a directory. * @param base the directory under which the file and its subdirectories must be located * @throws IOException on an io exception or if trying to delete something * outside the base */ public static void recursiveDelete(File file, File base) throws IOException { OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "Deleting: " + file); if (!(file.getCanonicalPath().startsWith(base.getCanonicalPath()))) { throw new IOException("Trying to delete a file outside Netx's basedir: " + file.getCanonicalPath()); } if (file.isDirectory()) { File[] children = file.listFiles(); for (File children1 : children) { recursiveDelete(children1, base); } } if (!file.delete()) { throw new IOException("Unable to delete file: " + file); } } /** * This will return a lock to the file specified. * * @param path File path to file we want to lock. * @param shared Specify if the lock will be a shared lock. * @param allowBlock Specify if we should block when we can not get the * lock. Getting a shared lock will always block. * @return FileLock if we were successful in getting a lock, otherwise null. * @throws FileNotFoundException If the file does not exist. */ public static FileLock getFileLock(String path, boolean shared, boolean allowBlock) throws FileNotFoundException { RandomAccessFile rafFile = new RandomAccessFile(path, "rw"); FileChannel fc = rafFile.getChannel(); FileLock lock = null; try { if (!shared) { if (allowBlock) { lock = fc.lock(0, Long.MAX_VALUE, false); } else { lock = fc.tryLock(0, Long.MAX_VALUE, false); } } else { // We want shared lock. This will block regardless if allowBlock is true or not. // Test to see if we can get a shared lock. lock = fc.lock(0, 1, true); // Block if a non exclusive lock is being held. if (!lock.isShared()) { // This lock is an exclusive lock. Use alternate solution. FileLock tempLock = null; for (long pos = 1; tempLock == null && pos < Long.MAX_VALUE - 1; pos++) { tempLock = fc.tryLock(pos, 1, false); } lock.release(); lock = tempLock; // Get the unique exclusive lock. } } } catch (IOException e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); } return lock; } /** * Method to save String as file in UTF-8 encoding. * * @param content which will be saved as it is saved in this String * @param f file to be saved. No warnings provided * @throws IOException if save fails */ public static void saveFile(String content, File f) throws IOException { saveFile(content, f, "utf-8"); } /** * Method to save String as file in specified encoding/. * * @param content which will be saved as it is saved in this String * @param f file to be saved. No warnings provided * @param encoding of output byte representation * @throws IOException if save fails */ public static void saveFile(String content, File f, String encoding) throws IOException { try (Writer output = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(f), encoding))) { output.write(content); output.flush(); } } /** * utility method which can read from any stream as one long String * * @param is stream * @param encoding the encoding to use to convert the bytes from the stream * @return stream as string * @throws IOException if connection can't be established or resource does not exist */ public static String getContentOfStream(InputStream is, String encoding) throws IOException { try { return getContentOfReader(new InputStreamReader(is, encoding)); } finally { is.close(); } } public static String getContentOfReader(Reader r) throws IOException { try { BufferedReader br = new BufferedReader(r); StringBuilder sb = new StringBuilder(); while (true) { String s = br.readLine(); if (s == null) { break; } sb.append(s).append("\n"); } return sb.toString(); } finally { r.close(); } } /** * utility method which can read from any stream as one long String * * @param is stream * @return stream as string * @throws IOException if connection can't be established or resource does not exist */ public static String getContentOfStream(InputStream is) throws IOException { return getContentOfStream(is, "UTF-8"); } public static String loadFileAsString(File f) throws IOException { return getContentOfStream(new FileInputStream(f)); } public static String loadFileAsString(File f, String encoding) throws IOException { return getContentOfStream(new FileInputStream(f), encoding); } public static byte[] getFileMD5Sum(final File file, final String algorithm) throws NoSuchAlgorithmException, FileNotFoundException, IOException { final MessageDigest md5; InputStream is = null; DigestInputStream dis = null; try { md5 = MessageDigest.getInstance(algorithm); is = new FileInputStream(file); dis = new DigestInputStream(is, md5); md5.update(getContentOfStream(dis).getBytes()); } finally { if (is != null) { is.close(); } if (dis != null) { dis.close(); } } return md5.digest(); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/PaxHeaders.17941/ClasspathMatcher.java0000644000000000000000000000013212654402377025545 xustar0030 mtime=1454507263.251432394 30 atime=1454507327.160580057 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/ClasspathMatcher.java0000644000175000002070000002764112654402377026302 0ustar00jvanekmock00000000000000// Copyright (C) 2013 Red Hat, Inc. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp.util; import java.net.URL; import java.util.ArrayList; import java.util.regex.Pattern; public class ClasspathMatcher { public static class ClasspathMatchers { private final ArrayList matchers; private final boolean includePath; ArrayList getMatchers() { return matchers; } /** * space separated list of ClasspathMatcher source strings * * @param s string to be read * @return returns compiled matcher */ public static ClasspathMatchers compile(String s) { return compile(s, false); } public static ClasspathMatchers compile(String s, boolean includePath) { if (s == null) { return new ClasspathMatchers(new ArrayList(0), includePath); } String[] splitted = s.trim().split("\\s+"); ArrayList matchers = new ArrayList<>(splitted.length); for (String string : splitted) { matchers.add(ClasspathMatcher.compile(string.trim())); } return new ClasspathMatchers(matchers, includePath); } public ClasspathMatchers(ArrayList matchers, boolean includePath) { this.matchers = matchers; this.includePath = includePath; } public boolean matches(URL s) { return or(s); } private boolean or(URL s) { for (ClasspathMatcher classpathMatcher : matchers) { if (classpathMatcher.match(s, includePath)) { return true; } } return false; } private boolean and(URL s) { for (ClasspathMatcher classpathMatcher : matchers) { if (!classpathMatcher.match(s, includePath)) { return false; } } return true; } @Override public String toString() { StringBuilder sb = new StringBuilder(); for (ClasspathMatcher classpathMatcher : matchers) { sb.append(classpathMatcher.toString()).append(" "); } return sb.toString(); } } public static final String PROTOCOL_DELIMITER = "://"; public static final String PATH_DELIMITER = "/"; public static final String PORT_DELIMITER = ":"; private final String source; private Parts parts; static class Parts { String protocol; String domain; String port; String path; Pattern protocolRegEx; Pattern domainRegEx; Pattern portRegEx; Pattern pathRegEx; @Override public String toString() { return protocol + PROTOCOL_DELIMITER + domain + PORT_DELIMITER + port + PATH_DELIMITER + path; } public void compilePartsToPatterns() { protocolRegEx = ClasspathMatcher.sourceToRegEx(protocol); //the http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/manifest.html#codebase //clearly says: *.example.com matches both //https://example.com, http://example.com //it sounds like bug, but well, who am I... domainRegEx = domainToRegEx(domain); portRegEx = ClasspathMatcher.sourceToRegEx(port); pathRegEx = ClasspathMatcher.sourceToRegEx(path); } private boolean matchDomain(String source) { return generalMatch(source, domainRegEx); } private boolean matchProtocol(String source) { return generalMatch(source, protocolRegEx); } private boolean matchPath(String source) { if (source.startsWith(PATH_DELIMITER)) { source = source.substring(1); } return generalMatch(source, pathRegEx); } private boolean matchPort(int port) { return generalMatch(Integer.toString(port), portRegEx); } private static boolean generalMatch(String input, Pattern pattern) { return pattern.matcher(input).matches(); } private static Pattern domainToRegEx(String domain) { String pre = ""; String post = ""; if (domain.startsWith("*.")) { //this is handling case, when *.abc.xy //should match also abc.xy except whatever.abc.xz //but NOT whatewerabc.xy pre = "(" + convertWildcardToRegEx(domain.substring(2)) + ")|("; post = ")"; } return Pattern.compile(pre + ClasspathMatcher.sourceToRegExString(domain) + post); } } /** * http://www.w3.org/Addressing/URL/url-spec.txt */ private ClasspathMatcher(String source) { this.source = source; } Parts getParts() { return parts; } @Override public String toString() { return source; } public static ClasspathMatcher compile(String source) { ClasspathMatcher r = new ClasspathMatcher(source); r.parts = splitToParts(source); r.parts.compilePartsToPatterns(); return r; } private boolean match(URL url, boolean includePath) { String protocol = url.getProtocol(); int port = url.getPort(); //negative if not set String domain = url.getHost(); String path = url.getPath(); boolean always = parts.matchPort(port) && parts.matchProtocol(protocol) && parts.matchDomain(domain); if (includePath) { return always && (parts.matchPath(UrlUtils.sanitizeLastSlash(path)) || parts.matchPath(path)); } else { return always; } } /* * For testing purposes */ public boolean match(URL url) { return match(url, false); } public boolean matchWithPath(URL url) { return match(url, true); } public boolean matchWithoutPath(URL url) { return match(url, false); } static boolean hasProtocol(final String source) { int indexOfProtocolMark = source.indexOf(PROTOCOL_DELIMITER); if (indexOfProtocolMark < 0) { return false; } /* * Here is small trap * We do not know, if protocol is specifed * if so, the protocol://blah.blah/blah is already recognized * but we must ensure that we have not found eg: * blah.blah/blah://in/path - which is perfectly valid url... */ //the most easy part - dot in url int indexofFirstDot = source.indexOf("."); if (indexofFirstDot >= 0) { return indexOfProtocolMark < indexofFirstDot; } //more nasty part - path specified String degradedProtocol = source.replace(PROTOCOL_DELIMITER, "%%%"); int indexofFirstPath = degradedProtocol.indexOf(PATH_DELIMITER); if (indexofFirstPath >= 0) { return indexOfProtocolMark < indexofFirstPath; } //no path? no dot? it must be it! return true; } private static String[] extractProtocolImpl(String source) { //we must know it have protocoll; return splitOnFirst(source, PROTOCOL_DELIMITER); } static String extractProtocol(String source) { //we must know it have protocoll; return extractProtocolImpl(source)[0]; } static String removeProtocol(String source) { //we must know it have protocoll; return extractProtocolImpl(source)[1]; } static boolean hasPath(String source) { //protocol free source return source.contains(PATH_DELIMITER); } private static String[] extractPathImpl(String source) { //protocol free source return splitOnFirst(source, PATH_DELIMITER); } static String extractPath(String source) { //protocol free source return extractPathImpl(source)[1]; } static String removePath(String source) { //protocol free source return extractPathImpl(source)[0]; } static boolean hasPort(String source) { //protocol and path free source return source.contains(PORT_DELIMITER); } private static String[] extractPortImpl(String source) { //protocol and path free source return splitOnFirst(source, PORT_DELIMITER); } static String extractPort(String source) { //protocol and path free source return extractPortImpl(source)[1]; } static String removePort(String source) { //protocol and path free source return extractPortImpl(source)[0]; } public static String[] splitOnFirst(final String source, final String delimiter) { String s1 = source.substring(0, source.indexOf(delimiter)); String s2 = source.substring(source.indexOf(delimiter) + delimiter.length()); return new String[]{s1, s2}; } public static String sourceToRegExString(String s) { //http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/manifest.html#codebase if (s.equals("*")) { return ".*"; } return convertWildcardToRegEx(s); } private static String convertWildcardToRegEx(String s) { if (s.startsWith("*") && s.endsWith("*")) { return "^.*" + Pattern.quote(s.substring(1, s.length() - 1)) + ".*$"; } else if (s.endsWith("*")) { return "^" + Pattern.quote(s.substring(0, s.length() - 1)) + ".*$"; } else if (s.startsWith("*")) { return "^.*" + Pattern.quote(s.substring(1)) + "$"; } else { return "^" + Pattern.quote(s) + "$"; } } public static Pattern sourceToRegEx(String s) { return Pattern.compile(sourceToRegExString(s)); } static Parts splitToParts(String source) { Parts parts = new Parts(); String urlWithoutprotocol = source; boolean haveProtocol = hasProtocol(source); if (haveProtocol) { parts.protocol = extractProtocol(source); urlWithoutprotocol = removeProtocol(source); } else { parts.protocol = "*"; } boolean havePath = hasPath(urlWithoutprotocol); String remianedUrl = urlWithoutprotocol; if (havePath) { parts.path = extractPath(urlWithoutprotocol); remianedUrl = removePath(urlWithoutprotocol); } else { parts.path = "*"; } //case for url like "some.url/" if (parts.path.length() == 0) { //behaving like it do not exists parts.path = "*"; } boolean havePort = hasPort(remianedUrl); String domain = remianedUrl; if (havePort) { parts.port = extractPort(remianedUrl); domain = removePort(remianedUrl); } else { parts.port = "*"; } //case for port like "some.url:" if (parts.port.length() == 0) { //behaving like it do not exists parts.port = "*"; } parts.domain = domain; return parts; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/PaxHeaders.17941/BasicExceptionDialog.java0000644000000000000000000000013212654402377026337 xustar0030 mtime=1454507263.251432394 30 atime=1454507327.160580057 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/util/BasicExceptionDialog.java0000644000175000002070000002045612654402377027071 0ustar00jvanekmock00000000000000/* BasicExceptionDialog.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util; import net.sourceforge.jnlp.util.logging.OutputController; import static net.sourceforge.jnlp.runtime.Translator.R; import java.awt.BorderLayout; import java.awt.Component; import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.concurrent.atomic.AtomicInteger; import javax.swing.BorderFactory; import javax.swing.BoxLayout; import javax.swing.JButton; import javax.swing.JComponent; import javax.swing.JDialog; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTextArea; import javax.swing.SwingUtilities; import net.sourceforge.jnlp.controlpanel.CachePane; import net.sourceforge.jnlp.util.logging.JavaConsole; /** * A dialog that displays some basic information about an exception */ public class BasicExceptionDialog { private static final AtomicInteger dialogInstancess = new AtomicInteger(); /** * Must be invoked from the Swing EDT. * * @param exception the exception to indicate */ public static void show(Exception exception) { String detailsText = OutputController.exceptionToString(exception); final JPanel mainPanel = new JPanel(new BorderLayout()); mainPanel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5)); JOptionPane optionPane = new JOptionPane(mainPanel, JOptionPane.ERROR_MESSAGE); final JDialog errorDialog = optionPane.createDialog(R("Error")); errorDialog.setIconImages(ImageResources.INSTANCE.getApplicationImages()); final JPanel quickInfoPanelAll = new JPanel(); final JPanel quickInfoPanelMessage = new JPanel(); final JPanel quickInfoPanelButtons = new JPanel(); BoxLayout layoutAll = new BoxLayout(quickInfoPanelAll, BoxLayout.Y_AXIS); BoxLayout layoutMessage = new BoxLayout(quickInfoPanelMessage, BoxLayout.X_AXIS); BoxLayout layoutButtons = new BoxLayout(quickInfoPanelButtons, BoxLayout.X_AXIS); quickInfoPanelAll.setLayout(layoutAll); quickInfoPanelMessage.setLayout(layoutMessage); quickInfoPanelButtons.setLayout(layoutButtons); mainPanel.add(quickInfoPanelAll, BorderLayout.PAGE_START); quickInfoPanelAll.add(quickInfoPanelMessage); quickInfoPanelAll.add(quickInfoPanelButtons); JLabel errorLabel = new JLabel(exception.getMessage()); errorLabel.setAlignmentY(JComponent.LEFT_ALIGNMENT); quickInfoPanelMessage.add(errorLabel); final JButton viewDetails = new JButton(R("ButShowDetails")); viewDetails.setAlignmentY(JComponent.LEFT_ALIGNMENT); viewDetails.setActionCommand("show"); quickInfoPanelButtons.add(viewDetails); final JButton cacheButton = getClearCacheButton(errorDialog); cacheButton.setAlignmentY(JComponent.LEFT_ALIGNMENT); quickInfoPanelButtons.add(cacheButton); final JButton consoleButton = getShowButton(errorDialog); consoleButton.setAlignmentY(JComponent.LEFT_ALIGNMENT); quickInfoPanelButtons.add(consoleButton); final JPanel fillRest = new JPanel(); fillRest.setAlignmentY(JComponent.LEFT_ALIGNMENT); quickInfoPanelButtons.add(fillRest); JTextArea textArea = new JTextArea(); textArea.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); textArea.setEditable(false); textArea.setText(detailsText); final JScrollPane scrollPane = new JScrollPane(textArea); scrollPane.setPreferredSize(new Dimension(100, 200)); viewDetails.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { if (viewDetails.getActionCommand().equals("show")) { mainPanel.add(scrollPane, BorderLayout.CENTER); viewDetails.setActionCommand("hide"); viewDetails.setText(R("ButHideDetails")); errorDialog.pack(); } else { mainPanel.remove(scrollPane); viewDetails.setActionCommand("show"); viewDetails.setText(R("ButShowDetails")); errorDialog.pack(); } } }); errorDialog.pack(); errorDialog.setResizable(true); ScreenFinder.centerWindowsToCurrentScreen(errorDialog); errorDialog.setVisible(true); errorDialog.dispose(); BasicExceptionDialog.willBeHidden(); } public static JButton getShowButton(final Component parent) { JButton consoleButton = new JButton(); consoleButton.setText(R("DPJavaConsole")); consoleButton.addActionListener(new java.awt.event.ActionListener() { @Override public void actionPerformed(java.awt.event.ActionEvent evt) { try { JavaConsole.getConsole().showConsoleLater(true); } catch (Exception ex) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, ex); JOptionPane.showConfirmDialog(parent, ex); } } }); if (!JavaConsole.isEnabled()) { consoleButton.setEnabled(false); consoleButton.setToolTipText(R("DPJavaConsoleDisabledHint")); } return consoleButton; } public static JButton getClearCacheButton(final Component parent) { JButton clearAllButton = new JButton(); clearAllButton.setText(R("CVCPCleanCache")); clearAllButton.setToolTipText(R("CVCPCleanCacheTip")); clearAllButton.addActionListener(new java.awt.event.ActionListener() { @Override public void actionPerformed(java.awt.event.ActionEvent evt) { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { try { CachePane.visualCleanCache(parent); } catch (Exception ex) { OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, ex); } } }); } }); return clearAllButton; } private synchronized static int willBeHidden() { return dialogInstancess.decrementAndGet(); } //must be called out of EDT, otherise -- will happen before ++ public synchronized static int willBeShown() { return dialogInstancess.incrementAndGet(); } public synchronized static boolean areShown() { return dialogInstancess.intValue() > 0; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/tools0000644000000000000000000000013212654402377021562 xustar0030 mtime=1454507263.249432421 30 atime=1454507658.779157357 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/tools/0000755000175000002070000000000012654402377022362 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/netx/net/sourceforge/jnlp/tools/PaxHeaders.17941/ico0000644000000000000000000000013212654402377022334 xustar0030 mtime=1454507263.249432421 30 atime=1454507658.779157357 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/tools/ico/0000755000175000002070000000000012654402377023134 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/netx/net/sourceforge/jnlp/tools/ico/PaxHeaders.17941/impl0000644000000000000000000000013212654402377023275 xustar0030 mtime=1454507263.250432408 30 atime=1454507658.779157357 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/tools/ico/impl/0000755000175000002070000000000012654402377024075 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/netx/net/sourceforge/jnlp/tools/ico/impl/PaxHeaders.17941/ImageInputStreamIco.java0000644000000000000000000000013212654402377030066 xustar0030 mtime=1454507263.250432408 30 atime=1454507327.160580057 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/tools/ico/impl/ImageInputStreamIco.java0000644000175000002070000001463012654402377030615 0ustar00jvanekmock00000000000000/* Copyright (C) 2015 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.tools.ico.impl; import java.awt.image.BufferedImage; import java.io.ByteArrayInputStream; import java.io.EOFException; import java.io.IOException; import java.util.ArrayList; import java.util.List; import javax.imageio.ImageIO; import javax.imageio.stream.ImageInputStream; public class ImageInputStreamIco { private final IcoHeader header; private final List images; //size 16*countOfIcons bytes public IcoHeader getHeader() { return header; } public BufferedImage getImage(int i) { return images.get(i); } public ImageInputStreamIco(ImageInputStream src) throws IOException, IcoException { this.header = new IcoHeader(src); images = new ArrayList<>(header.countOfIcons); for (IcoHeaderEntry e : header.entries) { BufferedImage image = readImage(e, src); images.add(image); } } private static void readMask(IcoHeaderEntry e, ImageInputStream src1) throws IOException { //acording to spec, behind img bytes, should be another bytes, with AND bitmap.Hoewer, I had not found them. //however, that means, that transaprency is lost... But bit offsets mathces.. so... //IcoHeader.IcoHeaderEntry q = e.provideMonochromeHeader(); //src1.getStreamPosition(); //byte[] mask = new byte[q.sizeInBytes]; //src1.readFully(mask); } private static BufferedImage readImage(IcoHeaderEntry e, ImageInputStream src1) throws IOException { BufferedImage image; byte[] img = new byte[e.getSizeInBytes()]; if (src1.getStreamPosition() != e.getFileOffset()) { //I had never seen this thrown, Still, is it worthy to tempt it, or rather read and die later? //throw new IOException("Stream position do nto match expected position. Bmp(or png) will read wrongly"); } src1.readFully(img); try { image = parse(img, e); //readMask(e, src1); } catch (EOFException ex) { //some icons do not honour that 0 is 256. Retrying if (e.getColorCount() != 0) { e.setColorCount(0); image = parse(img, e); //readMask(e, src1); } else { throw ex; } } return image; } private static BufferedImage parse(byte[] img, IcoHeaderEntry e) throws IOException { ByteArrayInputStream bis = new ByteArrayInputStream(img); BufferedImage image = null; try { image = ImageIO.read(bis); } catch (Exception ex) { //not png } if (image != null) { fixSizesInHeader(e, image); return image; } //bmp img = prefixByFakeHeader(img, e); bis = new ByteArrayInputStream(img); //dont try catch this one. you will break it image = ImageIO.read(bis); return image; } private static void fixSizesInHeader(IcoHeaderEntry e, BufferedImage image) { //may happen for png if (e.getWidth() == 0) { e.setWidth(image.getWidth()); } if (e.getHeight() == 0) { e.setHeight(image.getHeight()); } } private static byte[] prefixByFakeHeader(final byte[] origArray, IcoHeaderEntry e) { int fakingArray = 14; byte[] img = new byte[fakingArray + e.getSizeInBytes()]; for (int i = 0; i < origArray.length; i++) { byte p = origArray[i]; img[i + 14] = p; } //fake header //http://www.daubnet.com/en/file-format-bmp int size = e.getSizeInBytes() + fakingArray; img[0] = 'B'; img[1] = 'M'; img[2] = (byte) (size & 0xFF); img[3] = (byte) ((size >> 8) & 0xFF); img[4] = (byte) ((size >> 16) & 0xFF); img[5] = (byte) ((size >> 24) & 0xFF); img[6] = 0; img[7] = 0; img[8] = 0; img[9] = 0; int ofset = fakingArray + 40 + 4 * e.getColorCount(); img[10] = (byte) (ofset & 0xFF); img[11] = (byte) ((ofset >> 8) & 0xFF); img[12] = (byte) ((ofset >> 16) & 0xFF); img[13] = (byte) ((ofset >> 24) & 0xFF); //ico is storing height as height of XOR + height of AND bitmaps //that is 2 x hight. Bitmap expects only height of single image int tmpHeight = e.getHeight(); img[fakingArray + 4/*size*/ + 4/*width*/] = (byte) (tmpHeight & 0xFF); img[fakingArray + 4/*size*/ + 4/*width*/ + 1] = (byte) ((tmpHeight >> 8) & 0xFF); img[fakingArray + 4/*size*/ + 4/*width*/ + 2] = (byte) ((tmpHeight >> 16) & 0xFF); img[fakingArray + 4/*size*/ + 4/*width*/ + 3] = (byte) ((tmpHeight >> 24) & 0xFF); return img; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/tools/ico/impl/PaxHeaders.17941/IcoHeaderEntry.java0000644000000000000000000000013112654402377027061 xustar0030 mtime=1454507263.250432408 29 atime=1454507327.15958007 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/tools/ico/impl/IcoHeaderEntry.java0000644000175000002070000001064712654402377027615 0ustar00jvanekmock00000000000000package net.sourceforge.jnlp.tools.ico.impl; /* Copyright (C) 2015 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.io.IOException; import javax.imageio.stream.ImageInputStream; public class IcoHeaderEntry { private int width; private int height; private int colorCount; private final int reserved; private final int planes; //should be 1 but I met quite a lot of 0 private final int bitCount; private final int sizeInBytes; // InfoHeader + ANDbitmap + XORbitmap private final int fileOffset; //FilePos, where InfoHeader starts public IcoHeaderEntry(ImageInputStream src) throws IOException, IcoException { width = src.read(); height = src.read(); colorCount = src.read(); // sentence "Number of Colors (2,16, 0=256) " is form doubnet //unluckily, both 0==0 and 0==256 does exists //going with doubnet by default if (colorCount == 0) { colorCount = 256; } reserved = src.read(); planes = src.readUnsignedShort(); isIcoHeader(); bitCount = src.readUnsignedShort(); sizeInBytes = src.readInt(); fileOffset = src.readInt(); } private IcoHeaderEntry(int width, int height, int colorCount, int planes, int bitCount, int sizeInBytes, int fileOffset) { this.width = width; this.height = height; this.colorCount = colorCount; this.reserved = 0; this.planes = planes; this.bitCount = bitCount; this.sizeInBytes = sizeInBytes; this.fileOffset = fileOffset; } private IcoHeaderEntry provideMonochromeHeader() { //each bit in byte stores 8 pixels values return new IcoHeaderEntry(width, height, 1, planes, 1, width * height / 8, fileOffset + sizeInBytes); } private void isIcoHeader() throws IcoException { if (reserved != 0 || (planes != 1 && planes != 0)) { throw new IcoException("Invalid header. Expected 0 and 1(0?), got " + reserved + " and " + planes); } } /** * @return the colorCount */ int getColorCount() { return colorCount; } /** * @param colorCount the colorCount to set */ void setColorCount(int colorCount) { this.colorCount = colorCount; } /** * @return the width */ public int getWidth() { return width; } /** * @param width the width to set */ void setWidth(int width) { this.width = width; } /** * @return the height */ public int getHeight() { return height; } /** * @param height the height to set */ void setHeight(int height) { this.height = height; } int getSizeInBytes() { return sizeInBytes; } int getFileOffset() { return fileOffset; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/tools/ico/impl/PaxHeaders.17941/IcoHeader.java0000644000000000000000000000013112654402377026037 xustar0030 mtime=1454507263.249432421 29 atime=1454507327.15958007 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/tools/ico/impl/IcoHeader.java0000644000175000002070000000616712654402377026575 0ustar00jvanekmock00000000000000/* Copyright (C) 2015 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.tools.ico.impl; import java.io.IOException; import java.nio.ByteOrder; import java.util.ArrayList; import java.util.List; import javax.imageio.stream.ImageInputStream; /** * http://www.daubnet.com/en/file-format-ico */ public class IcoHeader { private final int reserved; //0 private final int type; //should be 1 (0 is for cusrsor?) final int countOfIcons; final List entries; //size 16*countOfIcons bytes private final ByteOrder originalOrder; public IcoHeader(ImageInputStream src) throws IOException, IcoException { originalOrder = src.getByteOrder(); try { src.setByteOrder(ByteOrder.LITTLE_ENDIAN); reserved = src.readUnsignedShort(); type = src.readUnsignedShort(); isIco(); countOfIcons = src.readUnsignedShort(); entries = new ArrayList<>(countOfIcons); for (int x = 0; x < countOfIcons; x++) { entries.add(new IcoHeaderEntry(src)); } } finally { src.setByteOrder(originalOrder); } } private void isIco() throws IcoException { if (reserved != 0 || (type != 1)) { throw new IcoException("Invalid header. Expected 0 and 1, got " + reserved + " and " + type); } } public List getEntries() { return entries; } public int getCountOfIcons() { return countOfIcons; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/tools/ico/impl/PaxHeaders.17941/IcoException.java0000644000000000000000000000013112654402377026605 xustar0030 mtime=1454507263.249432421 29 atime=1454507327.15958007 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/tools/ico/impl/IcoException.java0000644000175000002070000000350112654402377027330 0ustar00jvanekmock00000000000000/* Copyright (C) 2015 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.tools.ico.impl; class IcoException extends Exception { public IcoException(String string) { super(string); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/tools/PaxHeaders.17941/KeyStoreUtil.java0000644000000000000000000000013112654402377025104 xustar0030 mtime=1454507263.249432421 29 atime=1454507327.15958007 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/tools/KeyStoreUtil.java0000644000175000002070000000511412654402377025631 0ustar00jvanekmock00000000000000/* * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Sun designates this * particular file as subject to the "Classpath" exception as provided * by Sun in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, * CA 95054 USA or visit www.sun.com if you need additional information or * have any questions. */ package net.sourceforge.jnlp.tools; /** * This class provides several utilities to {@link java.security.KeyStore}. * * @since 1.6.0 */ public class KeyStoreUtil { // Class and methods marked as public so that they can be // accessed by JarCertVerifier, which although lies in a package // with the same name, but bundled in tools.jar and loaded // by another class loader, hence in a different *runtime* // package. // // See JVM Spec, 5.3 and 5.4.4 private KeyStoreUtil() { // this class is not meant to be instantiated } /** * Returns true if KeyStore has a password. This is true except for * MSCAPI KeyStores * @param storetype type of store * @return true if it was windows one */ public static boolean isWindowsKeyStore(String storetype) { return storetype.equalsIgnoreCase("Windows-MY") || storetype.equalsIgnoreCase("Windows-ROOT"); } /** * Returns standard-looking names for storetype * @param storetype type of store * @return better name fro keystore */ public static String niceStoreTypeName(String storetype) { if (storetype.equalsIgnoreCase("Windows-MY")) { return "Windows-MY"; } else if (storetype.equalsIgnoreCase("Windows-ROOT")) { return "Windows-ROOT"; } else { return storetype.toUpperCase(); } } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/tools/PaxHeaders.17941/JarCertVerifier.java0000644000000000000000000000013112654402377025527 xustar0030 mtime=1454507263.249432421 29 atime=1454507327.15958007 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/tools/JarCertVerifier.java0000644000175000002070000005534612654402377026270 0ustar00jvanekmock00000000000000/* * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Sun designates this * particular file as subject to the "Classpath" exception as provided * by Sun in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, * CA 95054 USA or visit www.sun.com if you need additional information or * have any questions. */ package net.sourceforge.jnlp.tools; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.security.CodeSigner; import java.security.KeyStore; import java.security.cert.CertPath; import java.security.cert.Certificate; import java.security.cert.X509Certificate; import java.util.ArrayList; import java.util.Collections; import java.util.Enumeration; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Vector; import java.util.jar.JarEntry; import net.sourceforge.jnlp.JARDesc; import net.sourceforge.jnlp.JNLPFile; import net.sourceforge.jnlp.LaunchException; import net.sourceforge.jnlp.cache.ResourceTracker; import net.sourceforge.jnlp.runtime.JNLPClassLoader.SecurityDelegate; import net.sourceforge.jnlp.security.AppVerifier; import net.sourceforge.jnlp.security.CertVerifier; import net.sourceforge.jnlp.security.CertificateUtils; import net.sourceforge.jnlp.security.KeyStores; import net.sourceforge.jnlp.util.JarFile; import net.sourceforge.jnlp.util.logging.OutputController; import sun.security.util.DerInputStream; import sun.security.util.DerValue; import sun.security.x509.NetscapeCertTypeExtension; /** * The jar certificate verifier utility. * * @author Roland Schemers * @author Jan Luehe */ public class JarCertVerifier implements CertVerifier { private static final String META_INF = "META-INF/"; // prefix for new signature-related files in META-INF directory private static final String SIG_PREFIX = META_INF + "SIG-"; private static final long SIX_MONTHS = 180 * 24 * 60 * 60 * 1000L; // milliseconds static enum VerifyResult { UNSIGNED, SIGNED_OK, SIGNED_NOT_OK } /** All of the jar files that were verified for signing */ private final List verifiedJars = new ArrayList<>(); /** All of the jar files that were not verified */ private final List unverifiedJars = new ArrayList<>(); /** The certificates used for jar verification linked to their respective information */ private final Map certs = new HashMap<>(); /** Temporary cert path hack to be used to keep track of which one a UI dialog is using */ private CertPath currentlyUsed; /** Absolute location to jars and the number of entries which are possibly signable */ private final Map jarSignableEntries = new HashMap<>(); /** The application verifier to use by this instance */ private final AppVerifier appVerifier; /** * Create a new jar certificate verifier utility that uses the provided verifier for its strategy pattern. * * @param verifier * The application verifier to be used by the new instance. */ public JarCertVerifier(AppVerifier verifier) { appVerifier = verifier; } /** * @return true if there are no signable entries in the jar. * This will return false if any of verified jars have content more than just META-INF/. */ public boolean isTriviallySigned() { return getTotalJarEntries(jarSignableEntries) <= 0 && certs.size() <= 0; } @Override public boolean getAlreadyTrustPublisher() { boolean allPublishersTrusted = appVerifier.hasAlreadyTrustedPublisher( certs, jarSignableEntries); OutputController.getLogger().log("App already has trusted publisher: " + allPublishersTrusted); return allPublishersTrusted; } @Override public boolean getRootInCacerts() { boolean allRootCAsTrusted = appVerifier.hasRootInCacerts(certs, jarSignableEntries); OutputController.getLogger().log("App has trusted root CA: " + allRootCAsTrusted); return allRootCAsTrusted; } @Override public CertPath getCertPath(CertPath cPath) { // Parameter ignored. return currentlyUsed; } @Override public boolean hasSigningIssues(CertPath certPath) { return certs.get(certPath).hasSigningIssues(); } @Override public List getDetails(CertPath certPath) { if (certPath != null) { currentlyUsed = certPath; } return certs.get(currentlyUsed).getDetailsAsStrings(); } /** * Get a list of the cert paths of all signers across the app. * * @return List of CertPath vars representing each of the signers present on any jar. */ public List getCertsList() { return new ArrayList<>(certs.keySet()); } /** * Find the information the specified cert path has with respect to this application. * * @param cPath certificate to provide info * @return All the information the path has with this app. */ public CertInformation getCertInformation(CertPath cPath) { return certs.get(cPath); } /** * Returns whether or not the app is considered completely signed. * * An app using a JNLP is considered signed if all of the entries of its jars are signed by at least one common signer. * * An applet on the other hand only needs to have each individual jar be fully signed by a signer. The signers can differ between jars. * * @return Whether or not the app is considered signed. */ // FIXME: Change javadoc once applets do not need entire jars signed. public boolean isFullySigned() { if (isTriviallySigned()) return true; boolean fullySigned = appVerifier.isFullySigned(certs, jarSignableEntries); OutputController.getLogger().log("App already has trusted publisher: " + fullySigned); return fullySigned; } public static boolean isJarSigned(JARDesc jar, AppVerifier verifier, ResourceTracker tracker) throws Exception { JarCertVerifier certVerifier = new JarCertVerifier(verifier); List singleJarList = new ArrayList<>(); singleJarList.add(jar); certVerifier.add(singleJarList, tracker); return certVerifier.allJarsSigned(); } /** * Update the verifier to consider new jars when verifying. * * @param jars * List of new jars to be verified. * @param tracker * Resource tracker used to obtain the the jars from cache * @throws Exception * Caused by issues with obtaining the jars' entries or interacting with the tracker. */ public void add(List jars, ResourceTracker tracker) throws Exception { verifyJars(jars, tracker); } /** * Verify the jars provided and update the state of this instance to match the new information. * * @param jars * List of new jars to be verified. * @param tracker * Resource tracker used to obtain the the jars from cache * @throws Exception * Caused by issues with obtaining the jars' entries or interacting with the tracker. */ private void verifyJars(List jars, ResourceTracker tracker) throws Exception { for (JARDesc jar : jars) { try { File jarFile = tracker.getCacheFile(jar.getLocation()); // some sort of resource download/cache error. Nothing to add // in that case ... but don't fail here if (jarFile == null) { continue; } String localFile = jarFile.getAbsolutePath(); if (verifiedJars.contains(localFile) || unverifiedJars.contains(localFile)) { continue; } VerifyResult result = verifyJar(localFile); if (result == VerifyResult.UNSIGNED) { unverifiedJars.add(localFile); } else if (result == VerifyResult.SIGNED_NOT_OK) { verifiedJars.add(localFile); } else if (result == VerifyResult.SIGNED_OK) { verifiedJars.add(localFile); } } catch (Exception e) { // We may catch exceptions from using verifyJar() // or from checkTrustedCerts throw e; } } for (CertPath certPath : certs.keySet()) checkTrustedCerts(certPath); } /** * Checks through all the jar entries of jarName for signers, storing all the common ones in the certs hash map. * * @param jarName * The absolute path to the jar file. * @return The return of {@link JarCertVerifier#verifyJarEntryCerts} using the entries found in the jar located at jarName. * @throws Exception * Will be thrown if there are any problems with the jar. */ private VerifyResult verifyJar(String jarName) throws Exception { try (JarFile jarFile = new JarFile(jarName, true)) { Vector entriesVec = new Vector(); byte[] buffer = new byte[8192]; Enumeration entries = jarFile.entries(); while (entries.hasMoreElements()) { JarEntry je = entries.nextElement(); entriesVec.addElement(je); InputStream is = jarFile.getInputStream(je); try { while (is.read(buffer, 0, buffer.length) != -1) { // we just read. this will throw a SecurityException // if a signature/digest check fails. } } finally { if (is != null) { is.close(); } } } return verifyJarEntryCerts(jarName, jarFile.getManifest() != null, entriesVec); } catch (Exception e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); throw e; } } /** * Checks through all the jar entries for signers, storing all the common ones in the certs hash map. * * @param jarName * The absolute path to the jar file. * @param jarHasManifest * Whether or not the associated jar has a manifest. * @param entries * The list of entries in the associated jar. * @return If there is at least one signable entry that is not signed by a common signer, return UNSIGNED. Otherwise every signable entry is signed by at least one common signer. If the signer has no issues, return SIGNED_OK. If there are any signing issues, return SIGNED_NOT_OK. * @throws Exception * Will be thrown if there are issues with entries. */ VerifyResult verifyJarEntryCerts(String jarName, boolean jarHasManifest, Vector entries) throws Exception { // Contains number of entries the cert with this CertPath has signed. Map jarSignCount = new HashMap<>(); int numSignableEntriesInJar = 0; // Record current time just before checking the jar begins. long now = System.currentTimeMillis(); if (jarHasManifest) { for (JarEntry je : entries) { String name = je.getName(); CodeSigner[] signers = je.getCodeSigners(); boolean isSigned = (signers != null); boolean shouldHaveSignature = !je.isDirectory() && !isMetaInfFile(name); if (shouldHaveSignature) { numSignableEntriesInJar++; } if (shouldHaveSignature && isSigned) { for (CodeSigner signer : signers) { CertPath certPath = signer.getSignerCertPath(); if (!jarSignCount.containsKey(certPath)) jarSignCount.put(certPath, 1); else jarSignCount.put(certPath, jarSignCount.get(certPath) + 1); } } } // while e has more elements } else { // if manifest is null // Else increment total entries by 1 so that unsigned jars with // no manifests can't sneak in numSignableEntriesInJar++; } jarSignableEntries.put(jarName, numSignableEntriesInJar); // Find all signers that have signed every signable entry in this jar. boolean allEntriesSignedBySingleCert = false; for (CertPath certPath : jarSignCount.keySet()) { if (jarSignCount.get(certPath) == numSignableEntriesInJar) { allEntriesSignedBySingleCert = true; boolean wasPreviouslyVerified = certs.containsKey(certPath); if (!wasPreviouslyVerified) certs.put(certPath, new CertInformation()); CertInformation certInfo = certs.get(certPath); if (wasPreviouslyVerified) certInfo.resetForReverification(); certInfo.setNumJarEntriesSigned(jarName, numSignableEntriesInJar); Certificate cert = certPath.getCertificates().get(0); if (cert instanceof X509Certificate) { checkCertUsage(certPath, (X509Certificate) cert, null); long notBefore = ((X509Certificate) cert).getNotBefore().getTime(); long notAfter = ((X509Certificate) cert).getNotAfter().getTime(); if (now < notBefore) { certInfo.setNotYetValidCert(); } if (notAfter < now) { certInfo.setHasExpiredCert(); } else if (notAfter < now + SIX_MONTHS) { certInfo.setHasExpiringCert(); } } } } // Every signable entry of this jar needs to be signed by at least // one signer for the jar to be considered successfully signed. VerifyResult result = null; if (numSignableEntriesInJar == 0) { // Allow jars with no signable entries to simply be considered signed. // There should be no security risk in doing so. result = VerifyResult.SIGNED_OK; } else if (allEntriesSignedBySingleCert) { // We need to find at least one signer without any issues. for (CertPath entryCertPath : jarSignCount.keySet()) { if (certs.containsKey(entryCertPath) && !hasSigningIssues(entryCertPath)) { result = VerifyResult.SIGNED_OK; break; } } if (result == null) { // All signers had issues result = VerifyResult.SIGNED_NOT_OK; } } else { result = VerifyResult.UNSIGNED; } OutputController.getLogger().log("Jar found at " + jarName + "has been verified as " + result); return result; } /** * Checks the user's trusted.certs file and the cacerts file to see if a * publisher's and/or CA's certificate exists there. * * @param certPath * The cert path of the signer being checked for trust. */ private void checkTrustedCerts(CertPath certPath) throws Exception { CertInformation info = certs.get(certPath); try { X509Certificate publisher = (X509Certificate) getPublisher(certPath); KeyStore[] certKeyStores = KeyStores.getCertKeyStores(); if (CertificateUtils.inKeyStores(publisher, certKeyStores)) info.setAlreadyTrustPublisher(); KeyStore[] caKeyStores = KeyStores.getCAKeyStores(); // Check entire cert path for a trusted CA for (Certificate c : certPath.getCertificates()) { if (CertificateUtils.inKeyStores((X509Certificate) c, caKeyStores)) { info.setRootInCacerts(); return; } } } catch (Exception e) { // TODO: Warn user about not being able to // look through their cacerts/trusted.certs // file depending on exception. OutputController.getLogger().log("WARNING: Unable to read through cert store files."); throw e; } // Otherwise a parent cert was not found to be trusted. info.setUntrusted(); } public void setCurrentlyUsedCertPath(CertPath cPath) { currentlyUsed = cPath; } @Override public Certificate getPublisher(CertPath cPath) { if (cPath != null) { currentlyUsed = cPath; } if (currentlyUsed != null) { List certList = currentlyUsed .getCertificates(); if (certList.size() > 0) { return certList.get(0); } else { return null; } } else { return null; } } @Override public Certificate getRoot(CertPath cPath) { if (cPath != null) { currentlyUsed = cPath; } if (currentlyUsed != null) { List certList = currentlyUsed .getCertificates(); if (certList.size() > 0) { return certList.get(certList.size() - 1); } else { return null; } } else { return null; } } /** * Returns whether a file is in META-INF, and thus does not require signing. * * Signature-related files under META-INF include: . META-INF/MANIFEST.MF . META-INF/SIG-* . META-INF/*.SF . META-INF/*.DSA . META-INF/*.RSA */ static boolean isMetaInfFile(String name) { String ucName = name.toUpperCase(); return ucName.startsWith(META_INF); } /** * Check if userCert is designed to be a code signer * * @param userCert * the certificate to be examined * @param bad * 3 booleans to show if the KeyUsage, ExtendedKeyUsage, * NetscapeCertType has codeSigning flag turned on. If null, * the class field badKeyUsage, badExtendedKeyUsage, * badNetscapeCertType will be set. * * Required for verifyJar() */ void checkCertUsage(CertPath certPath, X509Certificate userCert, boolean[] bad) { // Can act as a signer? // 1. if KeyUsage, then [0] should be true // 2. if ExtendedKeyUsage, then should contains ANY or CODE_SIGNING // 3. if NetscapeCertType, then should contains OBJECT_SIGNING // 1,2,3 must be true if (bad != null) { bad[0] = bad[1] = bad[2] = false; } boolean[] keyUsage = userCert.getKeyUsage(); if (keyUsage != null) { if (keyUsage.length < 1 || !keyUsage[0]) { if (bad != null) { bad[0] = true; } else { certs.get(certPath).setBadKeyUsage(); } } } try { List xKeyUsage = userCert.getExtendedKeyUsage(); if (xKeyUsage != null) { if (!xKeyUsage.contains("2.5.29.37.0") // anyExtendedKeyUsage && !xKeyUsage.contains("1.3.6.1.5.5.7.3.3")) { // codeSigning if (bad != null) { bad[1] = true; } else { certs.get(certPath).setBadExtendedKeyUsage(); } } } } catch (java.security.cert.CertificateParsingException e) { // shouldn't happen } try { // OID_NETSCAPE_CERT_TYPE byte[] netscapeEx = userCert .getExtensionValue("2.16.840.1.113730.1.1"); if (netscapeEx != null) { DerInputStream in = new DerInputStream(netscapeEx); byte[] encoded = in.getOctetString(); encoded = new DerValue(encoded).getUnalignedBitString() .toByteArray(); NetscapeCertTypeExtension extn = new NetscapeCertTypeExtension( encoded); Boolean val = (Boolean) extn .get(NetscapeCertTypeExtension.OBJECT_SIGNING); if (!val) { if (bad != null) { bad[2] = true; } else { certs.get(certPath).setBadNetscapeCertType(); } } } } catch (IOException e) { // } } /** * Returns if all jars are signed. * * @return True if all jars are signed, false if there are one or more unsigned jars */ public boolean allJarsSigned() { return this.unverifiedJars.isEmpty(); } public void checkTrustWithUser(SecurityDelegate securityDelegate, JNLPFile file) throws LaunchException { appVerifier.checkTrustWithUser(securityDelegate, this, file); } public Map getJarSignableEntries() { return Collections.unmodifiableMap(jarSignableEntries); } /** * Get the total number of entries in the provided map. * * @param map map of all jars * @return The number of entries. */ public static int getTotalJarEntries(Map map) { int sum = 0; for (int value : map.values()) { sum += value; } return sum; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/tools/PaxHeaders.17941/CertInformation.java0000644000000000000000000000013112654402377025604 xustar0030 mtime=1454507263.248432434 29 atime=1454507327.15958007 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/tools/CertInformation.java0000644000175000002070000002255312654402377026337 0ustar00jvanekmock00000000000000/* CertInformation.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.tools; import static net.sourceforge.jnlp.runtime.Translator.R; import java.util.ArrayList; import java.util.EnumSet; import java.util.HashMap; import java.util.List; import java.util.Map; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.util.logging.OutputController; /** * Maintains information about a CertPath that has signed at least one of the * entries provided by a jar of the app. */ public class CertInformation { private boolean hasExpiredCert = false; private boolean hasExpiringCert = false; private boolean isNotYetValidCert = false; /* Code signer properties of the certificate. */ private boolean hasBadKeyUsage = false; private boolean hasBadExtendedKeyUsage = false; private boolean hasBadNetscapeCertType = false; private boolean alreadyTrustPublisher = false; private boolean rootInCacerts = false; static enum Detail { TRUSTED (R("STrustedCertificate")), UNTRUSTED (R("SUntrustedCertificate")), RUN_WITHOUT_RESTRICTIONS(R("SRunWithoutRestrictions")), EXPIRED (R("SHasExpiredCert")), EXPIRING (R("SHasExpiringCert")), NOT_YET_VALID (R("SNotYetValidCert")), BAD_KEY_USAGE (R("SBadKeyUsage")), BAT_EXTENDED_KEY_USAGE (R("SBadExtendedKeyUsage")), BAD_NETSCAPE_CERT_TYPE (R("SBadNetscapeCertType")); private final String message; Detail(String issue) { message = issue; } public String message() { return message; } } private EnumSet details = EnumSet.noneOf(Detail.class); /** The jars and their number of entries this cert has signed. */ private HashMap signedJars = new HashMap(); /** * Return if there are signing issues with this certificate. * @return {@code true} if there are any issues with expiry, validity or bad key usage. */ public boolean hasSigningIssues() { return hasExpiredCert || isNotYetValidCert || hasBadKeyUsage || hasBadExtendedKeyUsage || hasBadNetscapeCertType; } /** * Return whether or not the publisher is already trusted. * * @return {@code true} if the publisher is trusted already. */ public boolean isPublisherAlreadyTrusted() { return alreadyTrustPublisher; } /** * Set whether or not the publisher is already trusted. */ public void setAlreadyTrustPublisher() { alreadyTrustPublisher = true; } /** * Return whether or not the root is in the list of trusted CA certificates. * * @return {@code true} if the root is in the list of CA certificates. */ public boolean isRootInCacerts() { return rootInCacerts; } /** * Set that this cert's root CA is to be trusted. */ public void setRootInCacerts() { rootInCacerts = true; details.add(Detail.TRUSTED); } /** * Resets any trust of the root and publisher. Also removes unnecessary * details from the list of issues. */ public void resetForReverification() { alreadyTrustPublisher = false; rootInCacerts = false; removeFromDetails(Detail.UNTRUSTED); removeFromDetails(Detail.TRUSTED); } /** * Check if this cert is the signer of a jar. * @param jarName The absolute path of the jar this certificate has signed. * @return {@code true} if this cert has signed the jar found at {@code jarName}. */ public boolean isSignerOfJar(String jarName) { return signedJars.containsKey(jarName); } /** * Add a jar to the list of jars this certificate has signed along with the * number of entries it has signed in the jar. * * @param jarName The absolute path of the jar this certificate has signed. * @param signedEntriesCount The number of entries this cert has signed in {@code jarName}. */ public void setNumJarEntriesSigned(String jarName, int signedEntriesCount) { if (signedJars.containsKey(jarName)) { OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "WARNING: A jar that has already been " + "verified is being yet again verified: " + jarName); } else { signedJars.put(jarName, signedEntriesCount); } } /** * Find the number of entries this cert has signed in the specified jar. * @param jarName The absolute path of the jar this certificate has signed. * @return The number of entries this cert has signed in {@code jarName}. */ public int getNumJarEntriesSigned(String jarName) { return signedJars.get(jarName); } /** * Get all the jars this cert has signed along with the number of entries * in each jar. * @return a {link Map} of jars and their number of entries this cert has signed */ public Map getSignedJars() { return signedJars; } /** * Get the details regarding issue(s) with this certificate. * * @return A list of all the details/issues with this app. */ public List getDetailsAsStrings() { List detailsToStr = new ArrayList(); for (Detail issue : details) { detailsToStr.add(issue.message()); } return detailsToStr; } /** * Remove an issue from the list of details of issues with this certificate. * List is unchanged if detail was not present. * * @param detail The issue to be removed regarding this certificate. */ private void removeFromDetails(Detail detail) { details.remove(detail); } /** * Set that this cert is expired and add this issue to the list of details. */ public void setHasExpiredCert() { hasExpiredCert = true; details.add(Detail.RUN_WITHOUT_RESTRICTIONS); details.add(Detail.EXPIRED); } /** * Set that this cert is expiring within 6 months and add this issue to * the list of details. */ public void setHasExpiringCert() { hasExpiringCert = true; details.add(Detail.RUN_WITHOUT_RESTRICTIONS); details.add(Detail.EXPIRING); } /** * Get whether or not this cert will expire within 6 months. * @return {@code true} if the cert will be expired after 6 months. */ public boolean hasExpiringCert() { return hasExpiringCert; } /** * Set that this cert is not yet valid * and add this issue to the list of details. */ public void setNotYetValidCert() { isNotYetValidCert = true; details.add(Detail.RUN_WITHOUT_RESTRICTIONS); details.add(Detail.NOT_YET_VALID); } /** * Set that this cert has bad key usage * and add this issue to the list of details. */ public void setBadKeyUsage() { hasBadKeyUsage = true; details.add(Detail.RUN_WITHOUT_RESTRICTIONS); details.add(Detail.BAD_KEY_USAGE); } /** * Set that this cert has bad extended key usage * and add this issue to the list of details. */ public void setBadExtendedKeyUsage() { hasBadExtendedKeyUsage = true; details.add(Detail.RUN_WITHOUT_RESTRICTIONS); details.add(Detail.BAT_EXTENDED_KEY_USAGE); } /** * Set that this cert has a bad netscape cert type * and add this issue to the list of details. */ public void setBadNetscapeCertType() { hasBadNetscapeCertType = true; details.add(Detail.RUN_WITHOUT_RESTRICTIONS); details.add(Detail.BAD_NETSCAPE_CERT_TYPE); } /** * Set that this cert and all of its CAs are untrusted so far. */ public void setUntrusted() { details.add(Detail.UNTRUSTED); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/splashscreen0000644000000000000000000000013212654402377023114 xustar0030 mtime=1454507263.245432474 30 atime=1454507658.779157357 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/0000755000175000002070000000000012654402377023714 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/PaxHeaders.17941/parts0000644000000000000000000000013212654402377024245 xustar0030 mtime=1454507263.247432448 30 atime=1454507658.779157357 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/parts/0000755000175000002070000000000012654402377025045 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/parts/PaxHeaders.17941/extensions0000644000000000000000000000013212654402377026444 xustar0030 mtime=1454507263.248432434 30 atime=1454507658.779157357 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/parts/extensions/0000755000175000002070000000000012654402377027244 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/parts/extensions/PaxHeaders.17941/SplashExt0000644000000000000000000000013212654402377030357 xustar0030 mtime=1454507263.248432434 30 atime=1454507327.158580083 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/parts/extensions/SplashExtension.java0000644000175000002070000000417512654402377033245 0ustar00jvanekmock00000000000000/* Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.splashscreen.parts.extensions; import java.awt.Color; import java.awt.Graphics; import net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012.BasePainter; public interface SplashExtension { public Color getBackground() ; public Color getTextColor() ; public Color getPluginTextColor(); public void adjustForSize(int w, int h) ; public void paint(Graphics g, BasePainter origin) ; public void animate(); } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/parts/extensions/PaxHeaders.17941/NoExtensi0000644000000000000000000000013212654402377030360 xustar0030 mtime=1454507263.247432448 30 atime=1454507327.158580083 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/parts/extensions/NoExtension.java0000644000175000002070000000460412654402377032364 0ustar00jvanekmock00000000000000/* Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.splashscreen.parts.extensions; import java.awt.Color; import java.awt.Graphics; import net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012.BasePainter; public class NoExtension implements SplashExtension{ public NoExtension() { } @Override public Color getBackground() { return Color.white; } @Override public Color getTextColor() { return Color.black; } @Override public Color getPluginTextColor() { return Color.black; } @Override public void adjustForSize(int w, int h) { } @Override public void animate() { } @Override public void paint(Graphics g, BasePainter origin) { } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/parts/extensions/PaxHeaders.17941/Extension0000644000000000000000000000013212654402377030420 xustar0030 mtime=1454507263.247432448 30 atime=1454507327.158580083 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/parts/extensions/ExtensionManager.java0000644000175000002070000000460412654402377033362 0ustar00jvanekmock00000000000000/* Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.splashscreen.parts.extensions; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; public class ExtensionManager { private static SplashExtension currentExtension; public static SplashExtension getExtension() { if (currentExtension == null) { if (areChristmas()) { currentExtension = new ChristmasExtension(); } else { currentExtension = new NoExtension(); } } return currentExtension; } private static boolean areChristmas() { Calendar c = new GregorianCalendar(); c.setTime(new Date()); return c.get(Calendar.DAY_OF_YEAR) > 350; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/parts/extensions/PaxHeaders.17941/Christmas0000644000000000000000000000013212654402377030401 xustar0030 mtime=1454507263.247432448 30 atime=1454507327.158580083 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/parts/extensions/ChristmasExtension.java0000644000175000002070000002176212654402377033751 0ustar00jvanekmock00000000000000/* Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.splashscreen.parts.extensions; import java.awt.Color; import java.awt.Graphics; import java.awt.Polygon; import java.util.ArrayList; import java.util.List; import java.util.Random; import net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012.BasePainter; import net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012.ErrorPainter; public class ChristmasExtension implements SplashExtension { @Override public Color getBackground() { return Color.black; } @Override public Color getTextColor() { return Color.DARK_GRAY; } @Override public Color getPluginTextColor() { return new Color(30, 30, 30); } ChristmasExtension() { this(0, 0); } private static final Random seed = new Random(); private static final int avarege_star_width = 10; //stars will be 5-15 private final int avarege_fall_speed = 4; //2-6 private final int avarege_rotation_speed = 2; //1-3 private class Star { private int radiusX; private int radiusY; private int maxRadiusX; private int maxRadiusY; private int centerX; private int centerY; private final int fallSpeed; private final boolean orientation; private final int[] originalColor = new int[3]; private final int[] color = new int[originalColor.length]; private int direction; private final boolean haveEight; public Star() { createRadiuses(); haveEight = seed.nextBoolean(); this.centerX = seed.nextInt(w + 1); this.centerY = seed.nextInt(h + 1); this.fallSpeed = avarege_fall_speed / 2 + seed.nextInt(avarege_fall_speed / 2); this.orientation = seed.nextBoolean(); this.direction = -(avarege_rotation_speed / 2 + seed.nextInt(avarege_rotation_speed / 2)); if (seed.nextInt(4) == 0) { originalColor[0] = Color.yellow.getRed(); originalColor[1] = Color.yellow.getGreen(); originalColor[2] = Color.yellow.getBlue(); } else { originalColor[0] = BasePainter.WATER_LIVE_COLOR.getRed(); originalColor[1] = BasePainter.WATER_LIVE_COLOR.getGreen(); originalColor[2] = BasePainter.WATER_LIVE_COLOR.getBlue(); } } public void paint(Graphics g, Color forceColor1, Color forceColor2) { Color c = g.getColor(); if (forceColor1 == null || forceColor2 == null) { g.setColor(new Color(color[0], color[1], color[2])); } else { g.setColor(ErrorPainter.interpolateColor(h, centerY, forceColor1, forceColor2)); } Polygon p = createPolygon(); if (haveEight) { int min1 = Math.min(radiusX, radiusY); int min2 = min1 / 2; g.fillRect(centerX - min2, centerY - min2, min1, min1); } g.fillPolygon(p); g.setColor(c); } private void animate() { centerY += fallSpeed; if (orientation) { radiusX += direction; if (radiusX <= -direction) { direction = -direction; radiusX = direction; } if (radiusX >= maxRadiusX) { direction = -direction; radiusX = maxRadiusX; } interpolateColors(radiusX, maxRadiusX); } else { radiusY += direction; if (radiusY <= -direction) { direction = -direction; radiusY = direction; } if (radiusY >= maxRadiusY) { direction = -direction; radiusY = maxRadiusY; } interpolateColors(radiusY, maxRadiusY); } if (centerY > h + radiusX * 2 || centerY > h + radiusY * 2) { createRadiuses(); this.centerX = seed.nextInt(w + 1); this.centerY = -radiusY * 2; } } private int createRadius() { return avarege_star_width / 2 + seed.nextInt(avarege_star_width); } private Polygon createPolygon() { int min = Math.min(radiusX, radiusY) / 3; Polygon p = new Polygon(); p.addPoint(centerX - radiusX, centerY); p.addPoint(centerX - min, centerY - min); p.addPoint(centerX, centerY - radiusY); p.addPoint(centerX + min, centerY - min); p.addPoint(centerX + radiusX, centerY); p.addPoint(centerX + min, centerY + min); p.addPoint(centerX, centerY + radiusY); p.addPoint(centerX - min, centerY + min); return p; } private void interpolateColors(int is, int max) { for (int i = 0; i < originalColor.length; i++) { int fadeMin; if (centerY < 0) { fadeMin = 0; } else if (centerY > h) { fadeMin = 255; } else { fadeMin = (int) ErrorPainter.interpol(h, centerY, 255, 0); //from white to black } int fadeMax; if (centerY < 0) { fadeMax = 0; } else if (centerY > h) { fadeMax = originalColor[i]; } else { fadeMax = (int) ErrorPainter.interpol(h, centerY, originalColor[i], 0); //from color tho black } color[i] = (int) ErrorPainter.interpol(max, is, fadeMin, fadeMax); } } private void createRadiuses() { this.radiusX = createRadius(); this.radiusY = radiusX; switch (seed.nextInt(3)) { case (0): radiusX = radiusX + (2 * radiusX) / 3; break; case (1): radiusY = radiusY + (2 * radiusY) / 3; break; case (2): //noop break; } maxRadiusX = radiusX; maxRadiusY = radiusY; } } private int w; private int h; private List stars = new ArrayList(50); ChristmasExtension(int w, int h) { adjustForSize(w, h); } @Override public void paint(Graphics g, BasePainter b) { for (ChristmasExtension.Star star : stars) { Color forceColor1 = null; Color forceColor2 = null; if (b instanceof ErrorPainter){ forceColor1 = b.getBackgroundColor(); forceColor2 = b.getWaterColor(); } star.paint(g, forceColor1, forceColor2); } } @Override public void animate() { for (ChristmasExtension.Star star : stars) { star.animate(); } } @Override public final void adjustForSize(int w, int h) { this.w = w; this.h = h; int count = w / (2 * (avarege_star_width + 1)); while (stars.size() > count) { stars.remove(stars.size() - 1); } while (stars.size() < count) { stars.add(new Star()); } } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/parts/PaxHeaders.17941/JEditorPaneBasedExce0000644000000000000000000000013212654402377030155 xustar0030 mtime=1454507263.247432448 30 atime=1454507327.158580083 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/parts/JEditorPaneBasedExceptionDialog.java0000644000175000002070000004605512654402377034024 0ustar00jvanekmock00000000000000/* JeditorPaneBasedExceptionDialog.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.splashscreen.parts; import java.awt.Toolkit; import java.awt.datatransfer.Clipboard; import java.awt.datatransfer.StringSelection; import java.awt.event.WindowEvent; import java.text.DateFormat; import java.util.Date; import java.util.List; import javax.swing.BorderFactory; import javax.swing.GroupLayout; import javax.swing.Icon; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JDialog; import javax.swing.JEditorPane; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.LayoutStyle; import javax.swing.SwingConstants; import javax.swing.WindowConstants; import javax.swing.event.HyperlinkEvent; import javax.swing.event.HyperlinkListener; import net.sourceforge.jnlp.LaunchException; import net.sourceforge.jnlp.about.AboutDialog; import net.sourceforge.jnlp.runtime.Translator; import net.sourceforge.jnlp.util.BasicExceptionDialog; import net.sourceforge.jnlp.util.docprovider.TextsProvider; import net.sourceforge.jnlp.util.logging.OutputController; public class JEditorPaneBasedExceptionDialog extends JDialog implements HyperlinkListener { // components private JButton closeButton; private JButton closeAndCopyButton; private JButton homeButton; private JButton aboutButton; private JButton consoleButton; private JButton cacheButton; private JEditorPane htmlErrorAndHelpPanel; private JLabel exceptionLabel; private JLabel iconLabel; private JPanel mainPanel; private JPanel topPanel; private JPanel bottomPanel; private JScrollPane htmlPaneScroller; // End of components declaration private final String message; private final Throwable exception; private final Date shown; private final String anotherInfo; /** Creates new form JEditorPaneBasedExceptionDialog */ public JEditorPaneBasedExceptionDialog(java.awt.Frame parent, boolean modal, Throwable ex, InformationElement information, String anotherInfo) { super(parent, modal); shown = new Date(); initComponents(); htmlErrorAndHelpPanel.setContentType("text/html"); htmlErrorAndHelpPanel.setEditable(false); this.anotherInfo=anotherInfo; List l = infoElementToList(information); this.message = getText(ex, l, anotherInfo, shown); this.exception = ex; if (exception == null) { closeAndCopyButton.setVisible(false); } htmlErrorAndHelpPanel.setText(message); //htmlPaneScroller.getVerticalScrollBar().setValue(1); htmlErrorAndHelpPanel.setCaretPosition(0); try { Icon icon = new ImageIcon(this.getClass().getResource("/net/sourceforge/jnlp/resources/warning.png")); iconLabel.setIcon(icon); } catch (Exception lex) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, lex); } htmlErrorAndHelpPanel.addHyperlinkListener(this); homeButton.setVisible(false); this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); } static List infoElementToList(InformationElement information) { List l = null; if (information != null) { l = information.getHeader(); InfoItem ii = information.getLongestDescriptionForSplash(); if (ii != null) { l.add(ii.toNiceString()); } } return l; } private void initComponents() { topPanel = new JPanel(); closeButton = new JButton(); closeAndCopyButton = new JButton(); mainPanel = new JPanel(); exceptionLabel = new JLabel(); iconLabel = new JLabel(); bottomPanel = new JPanel(); htmlPaneScroller = new JScrollPane(); htmlErrorAndHelpPanel = new JEditorPane(); homeButton = new JButton(); aboutButton = new JButton(); consoleButton = BasicExceptionDialog.getShowButton(JEditorPaneBasedExceptionDialog.this); cacheButton = BasicExceptionDialog.getClearCacheButton(JEditorPaneBasedExceptionDialog.this); setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); closeButton.setText(Translator.R(InfoItem.SPLASH + "Close")); closeButton.addActionListener(new java.awt.event.ActionListener() { @Override public void actionPerformed(java.awt.event.ActionEvent evt) { closeWindowButtonActionPerformed(evt); } }); closeAndCopyButton.setText(Translator.R(InfoItem.SPLASH + "closewAndCopyException")); closeAndCopyButton.addActionListener(new java.awt.event.ActionListener() { @Override public void actionPerformed(java.awt.event.ActionEvent evt) { copyAndCloseButtonActionPerformed(evt); } }); GroupLayout jPanel2Layout = new GroupLayout(topPanel); topPanel.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup( jPanel2Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addContainerGap() .addComponent(closeButton) .addContainerGap() .addComponent(aboutButton) .addContainerGap() .addComponent(cacheButton) .addContainerGap() .addComponent(consoleButton) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 314, Short.MAX_VALUE) .addComponent(closeAndCopyButton) .addContainerGap())); jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup() .addContainerGap(24, Short.MAX_VALUE) .addGroup(jPanel2Layout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(closeButton) .addComponent(aboutButton) .addComponent(cacheButton) .addComponent(consoleButton) .addComponent(closeAndCopyButton)) .addContainerGap())); exceptionLabel.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N exceptionLabel.setHorizontalAlignment(SwingConstants.CENTER); exceptionLabel.setText(Translator.R(InfoItem.SPLASH + "exOccured")); bottomPanel.setBorder(BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); bottomPanel.setLayout(new java.awt.BorderLayout()); htmlPaneScroller.setViewportView(htmlErrorAndHelpPanel); bottomPanel.add(htmlPaneScroller, java.awt.BorderLayout.CENTER); homeButton.setText(Translator.R(InfoItem.SPLASH + "Home")); homeButton.addActionListener(new java.awt.event.ActionListener() { @Override public void actionPerformed(java.awt.event.ActionEvent evt) { homeButtonActionPerformed(evt); } }); aboutButton.setText(Translator.R("AboutDialogueTabAbout")); aboutButton.addActionListener(new java.awt.event.ActionListener() { @Override public void actionPerformed(java.awt.event.ActionEvent evt) { try{ AboutDialog.display(true, TextsProvider.ITW_PLUGIN); }catch(Exception ex){ OutputController.getLogger().log(OutputController.Level.ERROR_ALL, ex); JOptionPane.showConfirmDialog(JEditorPaneBasedExceptionDialog.this, ex); } } }); GroupLayout jPanel1Layout = new GroupLayout(mainPanel); mainPanel.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(jPanel1Layout.createSequentialGroup().addContainerGap().addComponent(iconLabel, GroupLayout.PREFERRED_SIZE, 71, GroupLayout.PREFERRED_SIZE).addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED).addComponent(exceptionLabel, GroupLayout.DEFAULT_SIZE, 503, Short.MAX_VALUE).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(homeButton, GroupLayout.PREFERRED_SIZE, 101, GroupLayout.PREFERRED_SIZE).addContainerGap()).addComponent(bottomPanel, GroupLayout.Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, 723, Short.MAX_VALUE)); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(jPanel1Layout.createSequentialGroup().addContainerGap().addGroup(jPanel1Layout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(iconLabel, GroupLayout.PREFERRED_SIZE, 70, GroupLayout.PREFERRED_SIZE).addGroup(jPanel1Layout.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(exceptionLabel, GroupLayout.PREFERRED_SIZE, 70, GroupLayout.PREFERRED_SIZE).addComponent(homeButton, GroupLayout.PREFERRED_SIZE, 64, GroupLayout.PREFERRED_SIZE))).addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED).addComponent(bottomPanel, GroupLayout.DEFAULT_SIZE, 158, Short.MAX_VALUE))); GroupLayout layout = new GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(GroupLayout.Alignment.TRAILING, layout.createSequentialGroup().addContainerGap().addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING).addComponent(mainPanel, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addComponent(topPanel, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)).addContainerGap())); layout.setVerticalGroup( layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(GroupLayout.Alignment.TRAILING, layout.createSequentialGroup().addContainerGap().addComponent(mainPanel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED).addComponent(topPanel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE).addContainerGap())); pack(); } private void copyAndCloseButtonActionPerformed(java.awt.event.ActionEvent evt) { if (exception != null) { try { StringSelection data = new StringSelection(anotherInfo+"\n"+shown.toString()+"\n"+getExceptionStackTraceAsString(exception)+addPlainChain()); Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); clipboard.setContents(data, data); } catch (Exception ex) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, ex); JOptionPane.showMessageDialog(this, Translator.R(InfoItem.SPLASH + "cantCopyEx")); } } else { JOptionPane.showMessageDialog(this, Translator.R(InfoItem.SPLASH + "noExRecorded")); } close(); } private void homeButtonActionPerformed(java.awt.event.ActionEvent evt) { htmlErrorAndHelpPanel.setText(message); homeButton.setVisible(false); } private void closeWindowButtonActionPerformed(java.awt.event.ActionEvent evt) { close(); } /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { Exception ex = new RuntimeException("dsgsfdg"); JEditorPaneBasedExceptionDialog dialog = new JEditorPaneBasedExceptionDialog(new JFrame(), true, ex, null, "uaaa: aaa\nwqdeweq:sdsds"); dialog.addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosing(java.awt.event.WindowEvent e) { System.exit(0); } }); dialog.setVisible(true); } }); } static String getText(Throwable ex, List l, String anotherInfo,Date shown) { StringBuilder s = new StringBuilder(""); String info = "

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

    \n" + "

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

    \n"; String t = "

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

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

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

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

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

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

    "); sb.append("

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

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

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

    "); sb.append("

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

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

    "); return sb.toString(); } Throwable getException() { return exception; } String getMessage() { return message; } private static String createLink() { return "" + TextsProvider.ITW_HOME + ""; } private static String addChain() { if (LaunchException.getLaunchExceptionChain().isEmpty()) { return ""; } return Translator.R(InfoItem.SPLASH + "chainWas") + "
    \n" + "
    " + getChainAsString(true) + "
    "; } private static String addPlainChain() { if (LaunchException.getLaunchExceptionChain().isEmpty()) { return ""; } return "\n Chain: \n" + getChainAsString(false); } private static String getChainAsString(boolean formatTime) { return getChainAsString(LaunchException.getLaunchExceptionChain(), formatTime); } private static String getChainAsString(List launchExceptionChain, boolean formatTime) { String s = ""; if (launchExceptionChain != null) { for (int i = 0; i < launchExceptionChain.size(); i++) { LaunchException.LaunchExceptionWithStamp launchException = launchExceptionChain.get(i); s = s + (i+1) + ") at " + formatTime(launchException.getStamp(), formatTime) + "\n" + getExceptionStackTraceAsString(launchException.getEx()); } } return s; } private static String formatTime(Date dateTime, boolean formatTime) { if (dateTime == null) { return "unknown time"; } if (formatTime) { return DateFormat.getInstance().format(dateTime); } else { return dateTime.toString(); } } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/parts/PaxHeaders.17941/InformationElement.j0000644000000000000000000000013212654402377030274 xustar0030 mtime=1454507263.246432461 30 atime=1454507327.157580097 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/parts/InformationElement.java0000644000175000002070000002053612654402377031515 0ustar00jvanekmock00000000000000/* InformationElement.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ /** http://docs.oracle.com/javase/6/docs/technotes/guides/javaws/developersguide/syntax.html */ package net.sourceforge.jnlp.splashscreen.parts; import java.util.ArrayList; import java.util.Collections; import java.util.List; import net.sourceforge.jnlp.InformationDesc; import net.sourceforge.jnlp.JNLPFile; import net.sourceforge.jnlp.runtime.Translator; import net.sourceforge.jnlp.util.logging.OutputController; /** * This class is wrapper arround tag which should * javaws provide from source jnlp file */ public class InformationElement { private InfoItem title; private InfoItem vendor; private InfoItem homepage; private List descriptions = new ArrayList(5); public void setTitle(String title) { if (title == null) { return; } this.title = new InfoItem(InfoItem.title, title); } public void setvendor(String vendor) { if (vendor == null) { return; } this.vendor = new InfoItem(InfoItem.vendor, vendor); } public void setHomepage(String homepage) { if (homepage == null) { return; } this.homepage = new InfoItem(InfoItem.homepage, homepage); } public void addDescription(String description) { addDescription(description, null); } /** * Just one description of each kind (4 including null) are allowed in information element. * This method should throw exception when trying to add second description of same kind * But I do not consider it as good idea to force this behaviour for somesing like psalsh screen, * so I jsut replace the previous one with new one. without any warning */ public void addDescription(String description, String kind) { if (description == null) { return; } DescriptionInfoItem d = new DescriptionInfoItem(description, kind); for (DescriptionInfoItem descriptionInfoItem : descriptions) { if (descriptionInfoItem.isOfSameKind(d)) { descriptions.remove(descriptionInfoItem); descriptions.add(d); return; } } descriptions.add(d); } public InfoItem getBestMatchingDescriptionForSplash() { for (DescriptionInfoItem d : descriptions) { if (InfoItem.descriptionKindOneLine.equals(d.getKind())) { return d; } } for (DescriptionInfoItem d : descriptions) { if (d.getKind() == null) { return d; } } return null; } public InfoItem getLongestDescriptionForSplash() { for (DescriptionInfoItem d : descriptions) { if (InfoItem.descriptionKindShort.equals(d.getKind())) { return d; } } for (DescriptionInfoItem d : descriptions) { if (d.getKind() == null) { return d; } } for (DescriptionInfoItem d : descriptions) { if (InfoItem.descriptionKindOneLine.equals(d.getKind())) { return d; } } for (DescriptionInfoItem d : descriptions) { if (InfoItem.descriptionKindToolTip.equals(d.getKind())) { return d; } } return null; } public String getTitle() { if (title == null) { return null; } return title.toNiceString(); } public String getVendor() { if (vendor == null) { return null; } return vendor.toNiceString(); } public String getHomepage() { if (homepage == null) { return null; } return homepage.toNiceString(); } List getDescriptions() { return Collections.unmodifiableList(descriptions); } public String getDescription() { InfoItem i = getBestMatchingDescriptionForSplash(); if (i == null) { return null; } return i.toNiceString(); } public List getHeader() { List r = new ArrayList(4); String t = getTitle(); String v = getVendor(); String h = getHomepage(); if (t != null) { r.add(t); } if (v != null) { r.add(v); } if (h != null) { r.add(h); } return r; } public static InformationElement createFromJNLP(JNLPFile file) { try { if (file == null) { String message = Translator.R(InfoItem.SPLASH + "errorInInformation"); InformationElement ie = new InformationElement(); ie.setHomepage(""); ie.setTitle(message); ie.setvendor(""); ie.addDescription(message); return ie; } if (file.getInformation() == null) { String message = Translator.R(InfoItem.SPLASH + "missingInformation"); InformationElement ie = new InformationElement(); ie.setHomepage(""); ie.setTitle(message); ie.setvendor(""); ie.addDescription(message); return ie; } InformationElement ie = new InformationElement(); String homePage = Translator.R(InfoItem.SPLASH + "defaultHomepage"); if (file.getInformation().getHomepage() != null) { homePage = file.getInformation().getHomepage().toString(); } ie.setHomepage(homePage); ie.setTitle(file.getInformation().getTitle()); ie.setvendor(file.getInformation().getVendor()); ie.addDescription(file.getInformation().getDescriptionStrict((String) (InformationDesc.DEFAULT))); ie.addDescription(file.getInformation().getDescriptionStrict(InfoItem.descriptionKindOneLine), InfoItem.descriptionKindOneLine); ie.addDescription(file.getInformation().getDescriptionStrict(InfoItem.descriptionKindShort), InfoItem.descriptionKindShort); ie.addDescription(file.getInformation().getDescriptionStrict(InfoItem.descriptionKindToolTip), InfoItem.descriptionKindToolTip); return ie; } catch (Exception ex) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, ex); String message = Translator.R(InfoItem.SPLASH + "errorInInformation"); InformationElement ie = new InformationElement(); ie.setHomepage(""); ie.setTitle(message); ie.setvendor(""); ie.addDescription(ex.getMessage()); return ie; } } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/parts/PaxHeaders.17941/InfoItem.java0000644000000000000000000000013212654402377026677 xustar0030 mtime=1454507263.246432461 30 atime=1454507327.157580097 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/parts/InfoItem.java0000644000175000002070000001106212654402377027422 0ustar00jvanekmock00000000000000/* InfoItem.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.splashscreen.parts; import net.sourceforge.jnlp.InformationDesc; import net.sourceforge.jnlp.runtime.Translator; /** * The optional kind="splash" attribute may be used in an icon element to * indicate that the image is to be used as a "splash" screen during the launch * of an application. If the JNLP file does not contain an icon element with * kind="splash" attribute, Java Web Start will construct a splash screen using * other items from the information Element. * If the JNLP file does not contain any icon images, the splash image will * consist of the application's title and vendor, as taken from the JNLP file. * * items not used inside */ public class InfoItem { public static final String SPLASH = "SPLASH"; public static final String title = "title"; public static final String vendor = "vendor"; public static final String homepage = "homepage"; public static final String homepageHref = "href"; public static final String description = "description"; public static final String descriptionKind = "kind"; public static final String descriptionKindOneLine = (String) InformationDesc.ONE_LINE; //when no kind is specified, then it should behave as short public static final String descriptionKindShort = (String) InformationDesc.SHORT; public static final String descriptionKindToolTip = (String) InformationDesc.TOOLTIP; protected String type; protected String value; public InfoItem(String type, String value) { this.type = type; this.value = value; } /** * @return the type */ public String getType() { return type; } /** * @param type the type to set */ public void setType(String type) { this.type = type; } /** * @return the value */ public String getValue() { return value; } /** * @param value the value to set */ public void setValue(String value) { this.value = value; } public boolean isofSameType(InfoItem o) { return ((getType().equals(o.getType()))); } @Override public boolean equals(Object obj) { if (!(obj instanceof InfoItem)) { return false; } InfoItem o = (InfoItem) obj; return isofSameType(o) && (getValue().equals(o.getValue())); } @Override public String toString() { return type + ": " + value; } public String toNiceString() { String key = SPLASH + type; return localise(key, value); } public static String localise(String key, String s) { return Translator.R(key) + ": " + s; } @Override public int hashCode() { int hash = 7; hash = 59 * hash + (this.getType() != null ? this.getType().hashCode() : 0); hash = 59 * hash + (this.getValue() != null ? this.getValue().hashCode() : 0); return hash; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/parts/PaxHeaders.17941/DescriptionInfoItem.0000644000000000000000000000013212654402377030241 xustar0030 mtime=1454507263.246432461 30 atime=1454507327.157580097 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/parts/DescriptionInfoItem.java0000644000175000002070000001053312654402377031630 0ustar00jvanekmock00000000000000/* DescriptionInfoItem.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.splashscreen.parts; /** *description element: A short statement about the application. Description * elements are optional. The kind attribute defines how the description should * be used. It can have one of the following values: * * * one-line: If a reference to the application is going to appear on one row * in a list or a table, this description will be used. * * short: If a reference to the application is going to be displayed in a * situation where there is room for a paragraph, this description is used. * * tooltip: If a reference to the application is going to appear in a * tooltip, this description is used. * * Only one description element of each kind can be specified. A description * element without a kind is used as a default value. Thus, if Java Web Start * needs a description of kind short, and it is not specified in the JNLP file, * then the text from the description without an attribute is used. * * All descriptions contain plain text. No formatting, such as with HTML tags, * is supported. */ public class DescriptionInfoItem extends InfoItem { protected String kind; public DescriptionInfoItem(String value, String kind) { super(InfoItem.description, value); this.kind = kind; } public String getKind() { return kind; } public void setKind(String kind) { this.kind = kind; } public boolean isOfSameKind(DescriptionInfoItem o) { if (o.getKind() == null && getKind() == null) { return true; } if (o.getKind() == null && getKind() != null) { return false; } if (o.getKind() != null && getKind() == null) { return false; } return (o.getKind().equals(getKind())); } public boolean isSame(DescriptionInfoItem o) { return isOfSameKind(o) && isofSameType(o); } @Override public boolean equals(Object obj) { if (!(obj instanceof DescriptionInfoItem)) { return false; } DescriptionInfoItem o = (DescriptionInfoItem) obj; return super.equals(o) && isOfSameKind(o); } @Override public int hashCode() { int hash = 7; hash = 59 * hash + (this.kind != null ? this.kind.hashCode() : 0); hash = 59 * hash + (this.getType() != null ? this.getType().hashCode() : 0); hash = 59 * hash + (this.getValue() != null ? this.getValue().hashCode() : 0); return hash; } @Override public String toString() { return super.toString() + " (" + getKind() + ")"; } @Override public String toNiceString() { return super.toNiceString(); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/parts/PaxHeaders.17941/BasicComponentSplash0000644000000000000000000000013212654402377030324 xustar0030 mtime=1454507263.245432474 30 atime=1454507327.157580097 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/parts/BasicComponentSplashScreen.java0000644000175000002070000001046012654402377033130 0ustar00jvanekmock00000000000000/* BasicComponentSplashScreen.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.splashscreen.parts; import javax.swing.JComponent; import net.sourceforge.jnlp.splashscreen.SplashPanel; import net.sourceforge.jnlp.splashscreen.SplashUtils.SplashReason; public abstract class BasicComponentSplashScreen extends JComponent implements SplashPanel { //scaling 100% public static final double ORIGINAL_W = 635; public static final double ORIGINAL_H = 480; /** Width of the plugin window */ protected int pluginWidth; /** Height of the plugin window */ protected int pluginHeight; /** The project name to display */ private SplashReason splashReason; private boolean animationRunning = false; private InformationElement content; private String version; @Override public JComponent getSplashComponent() { return this; } @Override public boolean isAnimationRunning() { return animationRunning; } public void setAnimationRunning(boolean b){ animationRunning=b; } @Override public void setInformationElement(InformationElement content) { this.content = content; } @Override public InformationElement getInformationElement() { return content; } /** * @return the pluginWidth */ @Override public int getSplashWidth() { return pluginWidth; } /** * @param pluginWidth the pluginWidth to set */ @Override public void setSplashWidth(int pluginWidth) { this.pluginWidth = pluginWidth; } /** * @return the pluginHeight */ @Override public int getSplashHeight() { return pluginHeight; } /** * @param pluginHeight the pluginHeight to set */ @Override public void setSplashHeight(int pluginHeight) { this.pluginHeight = pluginHeight; } /** * @return the splashReason */ @Override public SplashReason getSplashReason() { return splashReason; } /** * @param splashReason the splashReason to set */ @Override public void setSplashReason(SplashReason splashReason) { this.splashReason = splashReason; } /** * @return the version */ @Override public String getVersion() { return version; } /** * @param version the version to set */ @Override public void setVersion(String version) { this.version = version; } protected String createAditionalInfo() { if (getVersion() != null) { return getSplashReason().toString() + " version: " + getVersion(); } else { return null; } } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/parts/PaxHeaders.17941/BasicComponentErrorS0000644000000000000000000000013112654402377030305 xustar0030 mtime=1454507263.245432474 29 atime=1454507327.15658011 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/parts/BasicComponentErrorSplashScreen.java0000644000175000002070000000575212654402377034152 0ustar00jvanekmock00000000000000/* BasicComponentSplashScreen.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.splashscreen.parts; import net.sourceforge.jnlp.splashscreen.SplashErrorPanel; public abstract class BasicComponentErrorSplashScreen extends BasicComponentSplashScreen implements SplashErrorPanel { /** * When applet loading fails, then dying stacktrace can be stted, and is then shown to user on demand. */ private Throwable loadingException; /** * @return the loadingException */ @Override public Throwable getLoadingException() { return loadingException; } /** * @param loadingException the loadingException to set */ @Override public void setLoadingException(Throwable loadingException) { this.loadingException = loadingException; } protected void raiseExceptionDialogNOW() { JEditorPaneBasedExceptionDialog dialog = new JEditorPaneBasedExceptionDialog(null, true, getLoadingException(), getInformationElement(), createAditionalInfo()); dialog.setVisible(true); } protected void raiseExceptionDialogQUEUED() { java.awt.EventQueue.invokeLater(new Runnable() { @Override public void run() { raiseExceptionDialogNOW(); } }); } protected void raiseExceptionDialog() { raiseExceptionDialogQUEUED(); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/PaxHeaders.17941/impls0000644000000000000000000000013212654402377024240 xustar0030 mtime=1454507263.242432514 30 atime=1454507658.779157357 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/impls/0000755000175000002070000000000012654402377025040 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/impls/PaxHeaders.17941/defaultsplashscreen20000644000000000000000000000013212654402377030361 xustar0030 mtime=1454507263.245432474 30 atime=1454507658.779157357 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/0000755000175000002070000000000012654402377031404 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/PaxHeaders.170000644000000000000000000000032112654402377030346 xustar00120 path=icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/TextWithWaterLevel.java 30 mtime=1454507263.245432474 29 atime=1454507327.15658011 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/TextWithWater0000644000175000002070000001332112654402377034112 0ustar00jvanekmock00000000000000/* TextWithWaterLevel.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012; import java.awt.Polygon; import java.awt.Color; import java.awt.Font; import java.awt.FontMetrics; import java.awt.Graphics2D; import java.awt.Point; import java.awt.RenderingHints; import java.awt.image.BufferedImage; import java.util.Random; public class TextWithWaterLevel extends TextOutlineRenderer { private Color waterColor; private Color bgColor; private int percentageOfWater; private Random sea = new Random(); //set to null befor getBackground if waving is needed //or create new TWL ;) private Polygon cachedPolygon; public TextWithWaterLevel(String s, Font f) { super(f, s); waterColor = Color.BLUE; bgColor = Color.white; } protected Point getFutureSize() { BufferedImage bi = new BufferedImage(10, 10, BufferedImage.TYPE_INT_ARGB); FontMetrics fm = bi.createGraphics().getFontMetrics(getFont()); int w = fm.stringWidth(getText()); int h = fm.getHeight(); return new Point(w, h); } public BufferedImage getBackground() { Point p = getFutureSize(); int w = p.x; int h = p.y; if (w <= 0 || h <= 0) { return null; } BufferedImage bi = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB); Graphics2D g2d = bi.createGraphics(); g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2d.setColor(bgColor); g2d.fillRect(0, 0, w, h); if (cachedPolygon == null) { int level = (h * percentageOfWater) / 100; int waveHeight = 10; int waveLength = 20; if (level > waveHeight / 2 + 1) { NatCubic line = new NatCubic(); int x = 0; while (x < w + 2 * waveLength) { line.addPoint(x, h - level - waveHeight / 2 - sea.nextInt(waveHeight)); x = x + waveLength; } cachedPolygon = line.calcualteResult(); cachedPolygon.addPoint(w, h); cachedPolygon.addPoint(0, h); } } g2d.setColor(waterColor); if (cachedPolygon != null) { g2d.fillPolygon(cachedPolygon); } //line.paint(g2d); //FlodFill.floodFill(bi, waterColor, new Point(1, h - 1)); return bi; } public Polygon getCachedPolygon() { return cachedPolygon; } public void setCachedPolygon(Polygon cachedPolygon) { this.cachedPolygon = cachedPolygon; } @Override public void cutTo(Graphics2D g2, int x, int y) { if (this.getImg() == null) { this.setImg(getBackground()); } if (this.getImg() == null) { return; } g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2.setFont(getFont()); g2.setColor(getTextOutline()); g2.drawString(getText(), x, y - 2); g2.drawString(getText(), x, y + 2); g2.drawString(getText(), x - 2, y); g2.drawString(getText(), x + 2, y); //sorry, cuted text have disturbed borders super.cutTo(g2, x, y); } /** * @return the waterColor */ public Color getWaterColor() { return waterColor; } /** * @param waterColor the waterColor to set */ public void setWaterColor(Color waterColor) { this.waterColor = waterColor; } /** * @return the bgColor */ public Color getBgColor() { return bgColor; } /** * @param bgColor the bgColor to set */ public void setBgColor(Color bgColor) { this.bgColor = bgColor; } /** * @return the percentageOfWater */ public int getPercentageOfWater() { return percentageOfWater; } /** * @param percentageOfWater the percentageOfWater to set */ public void setPercentageOfWater(int percentageOfWater) { this.percentageOfWater = percentageOfWater; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/PaxHeaders.170000644000000000000000000000032212654402377030347 xustar00121 path=icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/TextOutlineRenderer.java 30 mtime=1454507263.244432488 29 atime=1454507327.15658011 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/TextOutlineRe0000644000175000002070000001042412654402377034103 0ustar00jvanekmock00000000000000/* TextOutlineRenderer.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012; import java.awt.Color; import java.awt.Font; import java.awt.Graphics2D; import java.awt.Image; import java.awt.Rectangle; import java.awt.RenderingHints; import java.awt.Shape; import java.awt.font.FontRenderContext; import java.awt.font.TextLayout; import java.awt.geom.AffineTransform; public class TextOutlineRenderer { private Image img; private Font font; private Color outlineColor; private final String text; public TextOutlineRenderer(Font f, String s) { this.font = f; outlineColor = Color.black; this.text = s; } public TextOutlineRenderer(Font f, String s, Color textOutline) { this(f, s); this.outlineColor = textOutline; } public int getWidth() { if (img == null) { return -1; } return img.getWidth(null); } public int getHeight() { if (img == null) { return -1; } return img.getHeight(null); } public void cutTo(Graphics2D g2, int x, int y) { g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY); FontRenderContext frc = g2.getFontRenderContext(); TextLayout tl = new TextLayout(getText(), getFont(), frc); float sw = (float) tl.getBounds().getWidth(); AffineTransform transform = new AffineTransform(); transform.setToTranslation(x, y); Shape shape = tl.getOutline(transform); Rectangle r = shape.getBounds(); g2.setColor(getTextOutline()); g2.draw(shape); g2.setClip(shape); g2.drawImage(getImg(), r.x, r.y, r.width, r.height, null); } /** * @return the img */ public Image getImg() { return img; } /** * @param img the img to set */ public void setImg(Image img) { this.img = img; } /** * @return the font */ public Font getFont() { return font; } /** * @param font the font to set */ public void setFont(Font font) { this.font = font; } /** * @return the color of outline */ public Color getTextOutline() { return outlineColor; } /** * @param textOutline the color of outline */ public void setTextOutline(Color textOutline) { this.outlineColor = textOutline; } /** * @return the text */ public String getText() { return text; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/PaxHeaders.170000644000000000000000000000031212654402377030346 xustar00113 path=icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/SplinesDefs.java 30 mtime=1454507263.244432488 29 atime=1454507327.15658011 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/SplinesDefs.j0000644000175000002070000001475712654402377034014 0ustar00jvanekmock00000000000000/* SplinesDefs.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012; import java.awt.Point; import java.awt.Polygon; public class SplinesDefs { private final static Point[] mainLeafArray = { new Point(268, 307), new Point(274, 326), new Point(289, 337), new Point(317, 349), new Point(362, 350), new Point(413, 334), new Point(428, 326), new Point(453, 309), new Point(469, 292), new Point(496, 264), new Point(516, 236), new Point(531, 215), new Point(550, 185), new Point(567, 155), new Point(580, 130), new Point(571, 139), new Point(555, 148), new Point(540, 157), new Point(521, 167), new Point(502, 174), new Point(477, 183), new Point(443, 193), new Point(413, 201), new Point(392, 209), new Point(376, 218), new Point(363, 228), new Point(356, 250), new Point(372, 231), new Point(398, 218), new Point(420, 209), new Point(446, 200), new Point(479, 192), new Point(505, 182), new Point(547, 168), new Point(539, 182), new Point(526, 204), new Point(509, 227), new Point(498, 244), new Point(486, 257), new Point(469, 272), new Point(460, 281), new Point(449, 293), new Point(436, 303), new Point(418, 315), new Point(400, 323), new Point(383, 332), new Point(367, 334), new Point(343, 338), new Point(322, 335), new Point(304, 330), new Point(288, 322) }; private final static Point[] mainLeafStalkArray = { new Point(353, 287), new Point(366, 295), new Point(376, 291), new Point(392, 283), new Point(428, 251), new Point(441, 233), new Point(462, 217), new Point(446, 225), new Point(434, 236), new Point(428, 242), new Point(408, 261), new Point(392, 275), new Point(373, 284), new Point(363, 289) }; private final static Point[] smallLeafArray = { new Point(342, 207), new Point(352, 213), new Point(360, 218), new Point(374, 217), new Point(389, 202), new Point(397, 175), new Point(396, 143), new Point(397, 113), new Point(380, 127), new Point(350, 145), new Point(327, 155), new Point(313, 166), new Point(297, 182), new Point(293, 196), new Point(308, 183), new Point(332, 167), new Point(364, 150), new Point(385, 137), new Point(384, 158), new Point(382, 187), new Point(371, 204) }; private final static Point[] smallLeafStalkArray = { new Point(320, 203), new Point(331, 191), new Point(345, 185), new Point(356, 183), new Point(365, 177), new Point(368, 171), new Point(368, 165), new Point(360, 173), new Point(354, 176), new Point(341, 180), new Point(334, 184), new Point(321, 194) }; public static Polygon getMainLeaf(Double scalex, double scaley) { return polygonizeControlPoints(mainLeafArray, scalex, scaley); } static Polygon polygonizeControlPoints(Point[] pp, double scalex, double scaley) { Polygon r = new Polygon(); for (int i = 0; i < pp.length; i++) { Point p = pp[i]; r.addPoint( (int) ((double) p.x * scalex), (int) ((double) p.y * scaley)); } return r; } public static Polygon getSecondLeaf(double scalex, double scaley) { return polygonizeControlPoints(smallLeafArray, scalex, scaley); } public static Polygon getSecondLeafStalk(double scalex, double scaley) { return polygonizeControlPoints(smallLeafStalkArray, scalex, scaley); } public static Polygon getMainLeafStalk(double scalex, double scaley) { return polygonizeControlPoints(mainLeafStalkArray, scalex, scaley); } public static Polygon getMainLeafCurve(Double scalex, double scaley) { return getNatCubicClosed(getMainLeaf(scalex, scaley)); } public static Polygon getMainLeafStalkCurve(Double scalex, double scaley) { return getNatCubicClosed(getMainLeafStalk(scalex, scaley)); } public static Polygon getSecondLeafCurve(Double scalex, double scaley) { return getNatCubicClosed(getSecondLeaf(scalex, scaley)); } public static Polygon getSecondLeafStalkCurve(Double scalex, double scaley) { return getNatCubicClosed(getSecondLeafStalk(scalex, scaley)); } static Polygon getNatCubicClosed(Polygon p) { NatCubicClosed c = new NatCubicClosed(); c.setSourcePolygon(p); return c.calcualteResult(); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/PaxHeaders.170000644000000000000000000000031612654402377030352 xustar00116 path=icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/NatCubicClosed.java 30 mtime=1454507263.244432488 30 atime=1454507327.155580123 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/NatCubicClose0000644000175000002070000001040112654402377034001 0ustar00jvanekmock00000000000000/* NatCubicClosed.java Copyright (C) 2012 Tim Lambert, Red Hat, Inc., This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012; public class NatCubicClosed extends NatCubic { /* * This class is part of the NatCubic implementation (http://www.cse.unsw.edu.au/~lambert/) * which does not have a license. The author (Tim Lambert) has agreed to * license this under GPL+Classpath by email * */ /* NatCubic calcualtion calculates the closed natural cubic spline that interpolates x[0], x[1], ... x[n] The first segment is returned as C[0].a + C[0].b*u + C[0].c*u^2 + C[0].d*u^3 0<=u <1 the other segments are in C[1], C[2], ... C[n] */ @Override Cubic[] calcNaturalCubic(int n, int[] x) { float[] w = new float[n + 1]; float[] v = new float[n + 1]; float[] y = new float[n + 1]; float[] D = new float[n + 1]; float z, F, G, H; int k; /* We solve the equation [4 1 1] [D[0]] [3(x[1] - x[n]) ] |1 4 1 | |D[1]| |3(x[2] - x[0]) | | 1 4 1 | | . | = | . | | ..... | | . | | . | | 1 4 1| | . | |3(x[n] - x[n-2])| [1 1 4] [D[n]] [3(x[0] - x[n-1])] by decomposing the matrix into upper triangular and lower matrices and then back sustitution. See Spath "Spline Algorithms for Curves and Surfaces" pp 19--21. The D[i] are the derivatives at the knots. */ w[1] = v[1] = z = 1.0f / 4.0f; y[0] = z * 3 * (x[1] - x[n]); H = 4; F = 3 * (x[0] - x[n - 1]); G = 1; for (k = 1; k < n; k++) { v[k + 1] = z = 1 / (4 - v[k]); w[k + 1] = -z * w[k]; y[k] = z * (3 * (x[k + 1] - x[k - 1]) - y[k - 1]); H = H - G * w[k]; F = F - G * y[k - 1]; G = -v[k] * G; } H = H - (G + 1) * (v[n] + w[n]); y[n] = F - (G + 1) * y[n - 1]; D[n] = y[n] / H; D[n - 1] = y[n - 1] - (v[n] + w[n]) * D[n]; /* This equation is WRONG! in my copy of Spath */ for (k = n - 2; k >= 0; k--) { D[k] = y[k] - v[k + 1] * D[k + 1] - w[k + 1] * D[n]; } /* now compute the coefficients of the cubics */ Cubic[] C = new Cubic[n + 1]; for (k = 0; k < n; k++) { C[k] = new Cubic((float) x[k], D[k], 3 * (x[k + 1] - x[k]) - 2 * D[k] - D[k + 1], 2 * (x[k] - x[k + 1]) + D[k] + D[k + 1]); } C[n] = new Cubic((float) x[n], D[n], 3 * (x[0] - x[n]) - 2 * D[n] - D[0], 2 * (x[n] - x[0]) + D[n] + D[0]); return C; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/PaxHeaders.170000644000000000000000000000013212654402377030346 xustar0030 mtime=1454507263.244432488 30 atime=1454507327.155580123 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/NatCubic.java0000644000175000002070000001140312654402377033736 0ustar00jvanekmock00000000000000/* NatCubic.java Copyright (C) 2012 Tim Lambert, Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012; import java.awt.*; public class NatCubic extends ControlCurve { /* * This class is part of the NatCubic implementation (http://www.cse.unsw.edu.au/~lambert/) * which does not have a license. The author (Tim Lambert) has agreed to * license this under GPL+Classpath by email * */ /* NatCubic calcualtion calculates the natural cubic spline that interpolates y[0], y[1], ... y[n] The first segment is returned as C[0].a + C[0].b*u + C[0].c*u^2 + C[0].d*u^3 0<=u <1 the other segments are in C[1], C[2], ... C[n-1] */ Cubic[] calcNaturalCubic(int n, int[] x) { float[] gamma = new float[n + 1]; float[] delta = new float[n + 1]; float[] D = new float[n + 1]; int i; /* We solve the equation [2 1 ] [D[0]] [3(x[1] - x[0]) ] |1 4 1 | |D[1]| |3(x[2] - x[0]) | | 1 4 1 | | . | = | . | | ..... | | . | | . | | 1 4 1| | . | |3(x[n] - x[n-2])| [ 1 2] [D[n]] [3(x[n] - x[n-1])] by using row operations to convert the matrix to upper triangular and then back sustitution. The D[i] are the derivatives at the knots. */ gamma[0] = 1.0f / 2.0f; for (i = 1; i < n; i++) { gamma[i] = 1 / (4 - gamma[i - 1]); } gamma[n] = 1 / (2 - gamma[n - 1]); delta[0] = 3 * (x[1] - x[0]) * gamma[0]; for (i = 1; i < n; i++) { delta[i] = (3 * (x[i + 1] - x[i - 1]) - delta[i - 1]) * gamma[i]; } delta[n] = (3 * (x[n] - x[n - 1]) - delta[n - 1]) * gamma[n]; D[n] = delta[n]; for (i = n - 1; i >= 0; i--) { D[i] = delta[i] - gamma[i] * D[i + 1]; } /* now compute the coefficients of the cubics */ Cubic[] C = new Cubic[n]; for (i = 0; i < n; i++) { C[i] = new Cubic((float) x[i], D[i], 3 * (x[i + 1] - x[i]) - 2 * D[i] - D[i + 1], 2 * (x[i] - x[i + 1]) + D[i] + D[i + 1]); } return C; } final int STEPS = 12; /* draw a cubic spline */ @Override public void paint(Graphics g) { super.paint(g); if (pts.npoints >= 2) { if (getResult() == null) { calcualteAndSaveResult(); } g.drawPolyline(result.xpoints, result.ypoints, result.npoints); } } @Override public Polygon calcualteResult() { Cubic[] X = calcNaturalCubic(pts.npoints - 1, pts.xpoints); Cubic[] Y = calcNaturalCubic(pts.npoints - 1, pts.ypoints); /* very crude technique - just break each segment up into steps lines */ Polygon p = new Polygon(); p.addPoint(Math.round(X[0].eval(0)), Math.round(Y[0].eval(0))); for (int i = 0; i < X.length; i++) { for (int j = 1; j <= STEPS; j++) { float u = j / (float) STEPS; p.addPoint(Math.round(X[i].eval(u)), Math.round(Y[i].eval(u))); } } return p; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/PaxHeaders.170000644000000000000000000000031212654402377030346 xustar00112 path=icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/MovingText.java 30 mtime=1454507263.243432501 30 atime=1454507327.155580123 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/MovingText.ja0000644000175000002070000000525312654402377034031 0ustar00jvanekmock00000000000000/* MovingText.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012; import java.awt.Color; import java.awt.Font; import java.awt.GradientPaint; import java.awt.Graphics2D; import java.awt.Point; import java.awt.image.BufferedImage; public class MovingText extends TextWithWaterLevel { public MovingText(String s, Font f) { super(s, f); } @Override public BufferedImage getBackground() { Point p = getFutureSize(); int w = p.x; int h = p.y; if (w <= 0 || h <= 0) { return null; } BufferedImage bi = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB); Graphics2D g2d = bi.createGraphics(); Color e1 = Color.gray; Color s1 = Color.white; int level = getPercentageOfWater() % (2 * w); GradientPaint gradient = new GradientPaint(level - w, h / 2, s1, level, h / 2, e1, true); g2d.setPaint(gradient); g2d.fillRect(100, 100, 200, 120); g2d.fillRect(0, 0, w, h); return bi; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/PaxHeaders.170000644000000000000000000000031412654402377030350 xustar00114 path=icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/ErrorPainter.java 30 mtime=1454507263.243432501 30 atime=1454507327.155580123 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/ErrorPainter.0000644000175000002070000002424612654402377034031 0ustar00jvanekmock00000000000000/* ErrorPainter.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012; import java.awt.Color; import java.awt.Font; import java.awt.FontMetrics; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Point; import java.awt.RenderingHints; import java.util.Observable; import net.sourceforge.jnlp.runtime.Translator; import net.sourceforge.jnlp.splashscreen.parts.BasicComponentSplashScreen; import net.sourceforge.jnlp.splashscreen.parts.InformationElement; import net.sourceforge.jnlp.splashscreen.parts.extensions.ExtensionManager; import net.sourceforge.jnlp.util.logging.OutputController; public final class ErrorPainter extends BasePainter { //colors private static final Color TEA_DEAD_COLOR = Color.darkGray; private static final Color BACKGROUND_DEAD_COLOR = Color.gray; private static final Color TEA_LEAFS_STALKS_DEAD_COLOR = new Color(100, 100, 100); private static final Color PLUGIN_DEAD_COLOR = Color.darkGray; private static final Color WATER_DEAD_COLOR = Color.darkGray; private static final Color PLAIN_TEXT_DEAD_COLOR = Color.white; private static final String ERROR_MESSAGE_KEY = "SPLASHerror"; private static final String ERROR_FLY_MESSAGE_KEY = "SPLASH_ERROR"; private static final Color ERROR_FLY_COLOR = Color.red; //for clicking ot error message private Point errorCorner = null; private boolean errorIsFlying = false; private int errorFlyPercentage = 100; /** * Interpolation is root ratior is r= (currentSize / origSize) * then value to-from is interpolaed from to to from accroding to ratio * * @param origSize * @param currentSize * @param from * @param to * @return interpolated value */ public static double interpol(double origSize, double currentSize, double from, double to) { return getRatio(origSize, currentSize) * (to - from) + from; } /** * is interpolating one color to another based on ration current/orig * Each (r,g,b,a) part of color is interpolated separately * resturned is new color composed form new r,g,b,a * @param origSize * @param currentSize * @param from * @param to * @return interpolated {@link Color} */ public static Color interpolateColor(double origSize, double currentSize, Color from, Color to) { double r = interpol(origSize, currentSize, to.getRed(), from.getRed()); double g = interpol(origSize, currentSize, to.getGreen(), from.getGreen()); double b = interpol(origSize, currentSize, to.getBlue(), from.getBlue()); double a = interpol(origSize, currentSize, to.getAlpha(), from.getAlpha()); return new Color((int) r, (int) g, (int) b, (int) a); } //scaling end public ErrorPainter(BasicComponentSplashScreen master) { this(master, false); } public ErrorPainter(BasicComponentSplashScreen master, boolean startScream) { super(master); if (startScream) { startErrorScream(); } } public void startErrorScream() { errorIsFlying = true; getFlyingRedErrorTextThread().start(); } @Override public void paint(Graphics g) { Graphics2D g2d = (Graphics2D) g; ensurePrerenderedStuff(); if (errorIsFlying) { paintStillTo(g2d, master.getInformationElement(), master.getVersion()); } else { if (prerenderedStuff != null) { g2d.drawImage(prerenderedStuff, 0, 0, null); } } if (super.showNiceTexts) { ExtensionManager.getExtension().paint(g, this); paintNiceTexts(g2d); } else { paintPlainTexts(g2d); } if (errorIsFlying) { g2d.setClip(0, 0, master.getSplashWidth(), master.getSplashHeight()); drawBigError(g2d); } } private void drawBigError(Graphics2D g2d) { Font f = new Font("Serif", Font.PLAIN, (int) scale(100, errorFlyPercentage, master.getSplashHeight())); g2d.setColor(ERROR_FLY_COLOR); g2d.setFont(f); drawTextAroundCenter(g2d, 0, geFlyingErrorMessage()); } public Point getErrorCorner() { return errorCorner; } private void setColors() { teaColor = TEA_DEAD_COLOR; backgroundColor = BACKGROUND_DEAD_COLOR; teaLeafsStalksColor = TEA_LEAFS_STALKS_DEAD_COLOR; pluginColor = PLUGIN_DEAD_COLOR; waterColor = WATER_DEAD_COLOR; } private void interpolateColor(int origSize, int currentSize) { teaColor = interpolateColor(origSize, currentSize, TEA_LIVE_COLOR, TEA_DEAD_COLOR); backgroundColor = interpolateColor(origSize, currentSize, BACKGROUND_LIVE_COLOR, BACKGROUND_DEAD_COLOR); teaLeafsStalksColor = interpolateColor(origSize, currentSize, TEA_LEAFS_STALKS_LIVE_COLOR, TEA_LEAFS_STALKS_DEAD_COLOR); pluginColor = interpolateColor(origSize, currentSize, PLUGIN_LIVE_COLOR, PLUGIN_DEAD_COLOR); waterColor = interpolateColor(origSize, currentSize, WATER_LIVE_COLOR, WATER_DEAD_COLOR); plainTextColor = interpolateColor(origSize, currentSize, PLAIN_TEXT_LIVE_COLOR, PLAIN_TEXT_DEAD_COLOR); } @Override protected void paintStillTo(Graphics2D g2d, InformationElement ic, String version) { RenderingHints r = g2d.getRenderingHints(); FontMetrics fm = drawBase(g2d, ic, version); drawError(g2d, ic, version, fm); g2d.setRenderingHints(r); } private String getErrorMessage() { String localised = Translator.R(ERROR_MESSAGE_KEY); //if (localised==null)return errorMessage; return localised; } private String geFlyingErrorMessage() { String localised = Translator.R(ERROR_FLY_MESSAGE_KEY); return localised; } private Thread getFlyingRedErrorTextThread() { // Create a new thread to draw big flying error in case of failure Thread t = new Thread(new FlyingRedErrorTextRunner(this)); //t.setDaemon(true); return t; } private final class FlyingRedErrorTextRunner extends Observable implements Runnable { private static final int FLYING_ERROR_PERCENTAGE_INCREMENT = -3; private static final int FLYING_ERROR_PERCENTAGE_MINIMUM = 5; private static final int FLYING_ERROR_PERCENTAGE_LOWER_BOUND = 80; private static final int FLYING_ERROR_PERCENTAGE_UPPER_BOUND = 90; private static final int FLYING_ERROR_DELAY = 75; private FlyingRedErrorTextRunner(ErrorPainter o) { this.addObserver(o); } @Override public void run() { try { while (errorIsFlying) { errorFlyPercentage += FLYING_ERROR_PERCENTAGE_INCREMENT; interpolateColor(100, errorFlyPercentage); if (errorFlyPercentage <= FLYING_ERROR_PERCENTAGE_MINIMUM) { errorIsFlying = false; setColors(); prerenderedStuff = null; } this.setChanged(); this.notifyObservers(); Thread.sleep(FLYING_ERROR_DELAY); if (errorFlyPercentage < FLYING_ERROR_PERCENTAGE_UPPER_BOUND && errorFlyPercentage > FLYING_ERROR_PERCENTAGE_LOWER_BOUND) { clearCachedWaterTextImage(); canWave = false; } } } catch (Exception e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); } finally { canWave = true; errorIsFlying = false; setColors(); prerenderedStuff = null; master.repaint(); } } }; private void drawError(Graphics2D g2d, InformationElement ic, String version, FontMetrics fm) { int minh = fm.getHeight(); int minw = fm.stringWidth(getErrorMessage()); int space = 5; g2d.setColor(backgroundColor); errorCorner = new Point(master.getSplashWidth() - space * 4 - minw, master.getSplashHeight() - space * 4 - minh); if (errorCorner.x < 0) { errorCorner.x = 0; } g2d.fillRect(errorCorner.x, errorCorner.y, space * 4 + minw, space * 4 + minh); g2d.setColor(plainTextColor); g2d.drawRect(errorCorner.x + space, errorCorner.y + space, space * 2 + minw, space * 2 + minh); g2d.drawString(getErrorMessage(), errorCorner.x + 2 * space, errorCorner.y + 5 * space); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/PaxHeaders.170000644000000000000000000000013212654402377030346 xustar0030 mtime=1454507263.243432501 30 atime=1454507327.155580123 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/Cubic.java0000644000175000002070000000450712654402377033302 0ustar00jvanekmock00000000000000/* Cubic.java Copyright (C) 2012 Tim Lambert, Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012; /** this class represents a cubic polynomial */ /* * This class is part of the NatCubic implementation (http://www.cse.unsw.edu.au/~lambert/) * which does not have a license. The author (Tim Lambert) has agreed to * license this under GPL+Classpath by email * */ public class Cubic { float a, b, c, d; /* a + b*u + c*u^2 +d*u^3 */ public Cubic(float a, float b, float c, float d) { this.a = a; this.b = b; this.c = c; this.d = d; } /** evaluate cubic */ public float eval(float u) { return (((d * u) + c) * u + b) * u + a; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/PaxHeaders.170000644000000000000000000000031412654402377030350 xustar00114 path=icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/ControlCurve.java 30 mtime=1454507263.243432501 30 atime=1454507327.154580137 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/ControlCurve.0000644000175000002070000001304312654402377034033 0ustar00jvanekmock00000000000000/* ControlCurve.java Copyright (C) 2012 Tim Lambert, Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012; /** This class represents a curve defined by a sequence of control points */ /* * This class is part of the NatCubic implementation (http://www.cse.unsw.edu.au/~lambert/) * which does not have a license. The author (Tim Lambert) has agreed to * license this under GPL+Classpath by email * */ import java.awt.*; public class ControlCurve { protected Polygon pts; protected Polygon result; protected boolean withPoints = true; protected int selection = -1; public ControlCurve() { pts = new Polygon(); } public ControlCurve(Polygon p) { pts = p; } public Polygon getSourcePolygon() { return pts; } public void setSourcePolygon(Polygon pts) { this.pts = pts; } static Font f = new Font("Courier", Font.PLAIN, 12); /** * to be overwriten */ public Polygon calcualteResult() { return null; } public void calcualteAndSaveResult() { result = calcualteResult(); } /** paint this curve into g.*/ public void paint(Graphics g) { if (isWithPoints()) { FontMetrics fm = g.getFontMetrics(f); g.setFont(f); int h = fm.getAscent() / 2; for (int i = 0; i < pts.npoints; i++) { String s = Integer.toString(i); int w = fm.stringWidth(s) / 2; g.drawString(Integer.toString(i), pts.xpoints[i] - w, pts.ypoints[i] + h); } } } static final int EPSILON = 36; /* square of distance for picking */ /** return index of control point near to (x,y) or -1 if nothing near */ public int selectPoint(int x, int y) { int mind = Integer.MAX_VALUE; selection = -1; for (int i = 0; i < pts.npoints; i++) { int d = sqr(pts.xpoints[i] - x) + sqr(pts.ypoints[i] - y); if (d < mind && d < EPSILON) { mind = d; selection = i; } } return selection; } // square of an int static int sqr(int x) { return x * x; } public Polygon getResult() { return result; } public void resetResult() { this.result = null; } /** add a control point, return index of new control point */ public int addPoint(int x, int y) { pts.addPoint(x, y); resetResult(); return selection = pts.npoints - 1; } /** set selected control point */ public void setPoint(int x, int y) { setPoint(selection, x, y); } /** set selected control point */ public void setPoint(int index, int x, int y) { if (index >= 0 && index < pts.npoints) { pts.xpoints[index] = x; pts.ypoints[index] = y; resetResult(); } } /** remove selected control point */ public void removePoint(int index) { if (index >= 0 && index < pts.npoints) { pts.npoints--; for (int i = index; i < pts.npoints; i++) { pts.xpoints[i] = pts.xpoints[i + 1]; pts.ypoints[i] = pts.ypoints[i + 1]; } resetResult(); } } /** remove selected control point */ public void removePoint() { removePoint(selection); } public boolean isWithPoints() { return withPoints; } public void setWithPoints(boolean withPoints) { this.withPoints = withPoints; } @Override public String toString() { StringBuilder r = new StringBuilder(); for (int i = 0; i < pts.npoints; i++) { r.append(" ").append(pts.xpoints[i]).append(" ").append(pts.ypoints[i]); } return r.toString(); } /** * for testing purposes * @param selection */ void setSelection(int selection) { this.selection = selection; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/PaxHeaders.170000644000000000000000000000031312654402377030347 xustar00113 path=icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/BasePainter.java 30 mtime=1454507263.242432514 30 atime=1454507327.154580137 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/BasePainter.j0000644000175000002070000005500612654402377033762 0ustar00jvanekmock00000000000000/* BasePainter.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012; import java.awt.BasicStroke; import net.sourceforge.jnlp.splashscreen.impls.*; import java.awt.Color; import java.awt.Font; import java.awt.FontMetrics; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Point; import java.awt.RenderingHints; import java.awt.Stroke; import java.awt.Toolkit; import java.awt.font.TextAttribute; import java.awt.image.BufferedImage; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Observable; import java.util.Observer; import javax.swing.SwingUtilities; import net.sourceforge.jnlp.runtime.Translator; import net.sourceforge.jnlp.splashscreen.SplashUtils.SplashReason; import net.sourceforge.jnlp.splashscreen.parts.BasicComponentSplashScreen; import net.sourceforge.jnlp.splashscreen.parts.InfoItem; import net.sourceforge.jnlp.splashscreen.parts.InformationElement; import net.sourceforge.jnlp.splashscreen.parts.extensions.ExtensionManager; import net.sourceforge.jnlp.util.logging.OutputController; import net.sourceforge.jnlp.util.ScreenFinder; public class BasePainter implements Observer { protected final BasicComponentSplashScreen master; //animations //waterLevel of water (0-100%) private int waterLevel = 0; //waving of water and position of shhadowed WEB private int animationsPosition = 0; private int greyTextIncrment = 15; //how quickly is greyed web moving //colors protected static final Color TEA_LIVE_COLOR = new Color(205, 1, 3); protected static final Color BACKGROUND_LIVE_COLOR = ExtensionManager.getExtension().getBackground(); protected static final Color TEA_LEAFS_STALKS_LIVE_COLOR = Color.black; protected static final Color PLUGIN_LIVE_COLOR = ExtensionManager.getExtension().getPluginTextColor(); public static final Color WATER_LIVE_COLOR = new Color(80, 131, 160); protected static final Color PLAIN_TEXT_LIVE_COLOR = ExtensionManager.getExtension().getTextColor(); protected Color teaColor; protected Color backgroundColor; protected Color teaLeafsStalksColor; protected Color pluginColor; protected Color waterColor; protected Color plainTextColor; //BufferedImage tmpBackround; //testingBackground for fitting protected BufferedImage prerenderedStuff; private Font teaFont; private Font icedFont; private Font webFont; private Font pluginFont; private Font plainTextsFont; private Font alternativeTextFont; //those spaces are meaningful for centering the text.. thats why alternative;) private static final String alternativeICED = "Iced "; private static final String alternativeWeb = "Web "; private static final String alternativeTtea = " Tea"; private static final String alternativePlugin = "plugin "; private static final String ICED = "Iced"; private static final String web = "web"; private static final String tea = "Tea"; private static final String plugin = "plugin "; //inidivdual sizes, all converging to ZERO!! /** * Experimentaly meassured best top position for painted parts of vectros */ private final int WEB_TOP_ALIGMENT = 324; /** * Experimentaly meassured best left position for painted parts of vectors */ private final int WEB_LEFT_ALIGMENT = 84; //enabling protected boolean showNiceTexts = true; private boolean showLeaf = true; private boolean showInfo = true; protected TextWithWaterLevel twl; protected TextWithWaterLevel oldTwl; protected boolean canWave = true; private Point aboutOfset = new Point(); private final static float dash1[] = {10.0f}; private final static BasicStroke dashed = new BasicStroke(1.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 10.0f, dash1, 0.0f); protected void paintNiceTexts(Graphics2D g2d) { //the only animated stuff oldTwl = twl; twl = new TextWithWaterLevel(ICED, icedFont); if (oldTwl != null && !canWave) { twl.setCachedPolygon(oldTwl.getCachedPolygon()); } twl.setPercentageOfWater(waterLevel); twl.setBgColor(backgroundColor); twl.setWaterColor(waterColor); twl.cutTo(g2d, scaleX(42), scaleY(278)); MovingText mt = new MovingText(web, webFont); mt.setPercentageOfWater(animationsPosition); mt.cutTo(g2d, scaleX(WEB_LEFT_ALIGMENT), scaleY(WEB_TOP_ALIGMENT)); } protected void paintPlainTexts(Graphics2D g2d) { g2d.setFont(alternativeTextFont); g2d.setColor(waterColor); drawTextAroundCenter(g2d, -0.6d, alternativeICED); g2d.setColor(teaColor); drawTextAroundCenter(g2d, -0.6d, alternativeTtea); g2d.setColor(pluginColor); String s = getAlternativeProductName(); int sub = animationsPosition / greyTextIncrment; sub = sub % s.length(); if (!master.isAnimationRunning()) { sub = s.length(); } drawTextAroundCenter(g2d, 0.3d, s.substring(0, sub)); } //enabling end private int scaleAvarage(double origValue) { return (int) (avarageRatio() * origValue); } private int scaleMax(double origValue) { return (int) (maxRatio() * origValue); } private int scaleMin(double origValue) { return (int) (minRatio() * origValue); } private double avarageRatio() { return (getRatioX() + getRatioY()) / 2d; } private double minRatio() { return Math.min(getRatioX(), getRatioY()); } private double maxRatio() { return Math.max(getRatioX(), getRatioY()); } private int scaleY(double origValue) { return (int) scaleY(master.getSplashHeight(), origValue); } private int scaleX(double origValue) { return (int) scaleX(master.getSplashWidth(), origValue); } private double getRatioY() { return getRatio(DefaultSplashScreen2012.ORIGINAL_H, master.getSplashHeight()); } private double getRatioX() { return getRatio(DefaultSplashScreen2012.ORIGINAL_W, master.getSplashWidth()); } private static double scaleY(double currentSize, double origValue) { return scale(DefaultSplashScreen2012.ORIGINAL_H, currentSize, origValue); } private static double scaleX(double currentSize, double origValue) { return scale(DefaultSplashScreen2012.ORIGINAL_W, currentSize, origValue); } private static double getRatioY(double currentSize) { return getRatio(DefaultSplashScreen2012.ORIGINAL_H, currentSize); } private static double getRatioX(double currentSize) { return getRatio(DefaultSplashScreen2012.ORIGINAL_W, currentSize); } public static double scale(double origSize, double currentSize, double origValue) { return getRatio(origSize, currentSize) * origValue; } public static double getRatio(double origSize, double currentSize) { return (currentSize / origSize); } //size is considered from 0-origsize as 0-1. //scaling end public BasePainter(BasicComponentSplashScreen master) { this(master, false); } public BasePainter(BasicComponentSplashScreen master, boolean startAnimation) { //to have this in inner classes this.master = master; setColors(); adjustForSize(master.getSplashWidth(), master.getSplashHeight()); ExtensionManager.getExtension().adjustForSize(master.getSplashWidth(), master.getSplashHeight()); if (startAnimation) { startAnimationThreads(); } } public void increaseAnimationPosition() { ExtensionManager.getExtension().animate(); animationsPosition += greyTextIncrment; } protected void ensurePrerenderedStuff() { if (this.prerenderedStuff == null) { this.prerenderedStuff = prerenderStill(); } } public void paint(Graphics g) { Graphics2D g2d = (Graphics2D) g; ensurePrerenderedStuff(); if (prerenderedStuff != null) { g2d.drawImage(prerenderedStuff, 0, 0, null); } if (showNiceTexts) { ExtensionManager.getExtension().paint(g, this); paintNiceTexts(g2d); } else { paintPlainTexts(g2d); } } public final void adjustForSize(int width, int height) { prepareFonts(width, height); //enablings depends on fonts setEnablings(width, height, master.getVersion(), master.getInformationElement(), (Graphics2D) (master.getGraphics())); prerenderedStuff = prerenderStill(); ExtensionManager.getExtension().adjustForSize(width, height); } private void setEnablings(int w, int h, String version, InformationElement ic, Graphics2D g2d) { showLeaf = true; if (w > 0 && h > 0) { //leaf stretch much better to wide then to high if (h / w > 2 || w / h > 6) { showLeaf = false; } } showInfo = true; if (version != null && g2d != null && ic != null && ic.getHeader() != null && ic.getHeader().size() > 0) { String s = ic.getHeader().get(0); FontMetrics fm = g2d.getFontMetrics(plainTextsFont); int versionLength = fm.stringWidth(version); int firsDescLineLengthg = fm.stringWidth(s); if (firsDescLineLengthg > w - versionLength - 10) { showInfo = false; } } if (Math.min(h, w) < ScreenFinder.getCurrentScreenSizeWithoutBounds().getHeight() / 10) { showNiceTexts = false; } else { showNiceTexts = true; } } public final void startAnimationThreads() { Thread tt = getMovingTextThread(); tt.start(); Thread t = getWaterLevelThread(); t.start(); } private void prepareFonts(int w, int h) { master.setSplashHeight(h); master.setSplashWidth(w); Map teaFontAttributes = new HashMap(); teaFontAttributes.put(TextAttribute.SIZE, new Integer(scaleMin(84))); teaFontAttributes.put(TextAttribute.WIDTH, new Double((0.95))); teaFontAttributes.put(TextAttribute.FAMILY, "Serif"); teaFont = new Font(teaFontAttributes); Map icedFontAttributes = new HashMap(); icedFontAttributes.put(TextAttribute.SIZE, new Integer(scaleMin(82))); icedFontAttributes.put(TextAttribute.WIDTH, new Double((0.80))); icedFontAttributes.put(TextAttribute.FAMILY, "Serif"); icedFont = new Font(icedFontAttributes); Map webFontAttributes = new HashMap(); webFontAttributes.put(TextAttribute.SIZE, new Integer(scaleMin(41))); webFontAttributes.put(TextAttribute.WIDTH, new Double((2))); webFontAttributes.put(TextAttribute.FAMILY, "Serif"); webFont = new Font(webFontAttributes); Map pluginFontAttributes = new HashMap(); pluginFontAttributes.put(TextAttribute.SIZE, new Integer(scaleMin(32))); pluginFontAttributes.put(TextAttribute.WEIGHT, new Double((5d))); pluginFontAttributes.put(TextAttribute.WIDTH, new Double((0.9))); pluginFontAttributes.put(TextAttribute.FAMILY, "Serif"); pluginFont = new Font(pluginFontAttributes); Map plainFontAttributes = new HashMap(); plainFontAttributes.put(TextAttribute.SIZE, new Integer(12)); plainFontAttributes.put(TextAttribute.FAMILY, "Monospaced"); plainTextsFont = new Font(plainFontAttributes); Map alternativeTextFontAttributes = new HashMap(); alternativeTextFontAttributes.put(TextAttribute.SIZE, Math.min(w, h) / 5); alternativeTextFontAttributes.put(TextAttribute.WIDTH, new Double((0.7))); alternativeTextFontAttributes.put(TextAttribute.FAMILY, "Monospaced"); alternativeTextFont = new Font(alternativeTextFontAttributes); } private void setColors() { teaColor = TEA_LIVE_COLOR; backgroundColor = BACKGROUND_LIVE_COLOR; teaLeafsStalksColor = TEA_LEAFS_STALKS_LIVE_COLOR; pluginColor = PLUGIN_LIVE_COLOR; waterColor = WATER_LIVE_COLOR; plainTextColor = PLAIN_TEXT_LIVE_COLOR; } protected BufferedImage prerenderStill() { if (master.getSplashWidth() <= 0 || master.getSplashHeight() <= 0) { return null; } BufferedImage bi = new BufferedImage(master.getSplashWidth(), master.getSplashHeight(), BufferedImage.TYPE_INT_ARGB); paintStillTo(bi.createGraphics(), master.getInformationElement(), master.getVersion()); return bi; } protected void paintStillTo(Graphics2D g2d, InformationElement ic, String version) { RenderingHints r = g2d.getRenderingHints(); drawBase(g2d, ic, version); g2d.setRenderingHints(r); } protected void drawTextAroundCenter(Graphics2D g2d, double heightOffset, String msg) { int y = (master.getSplashHeight() / 2) + (g2d.getFontMetrics().getHeight() / 2 + (int) (heightOffset * g2d.getFontMetrics().getHeight())); int x = (master.getSplashWidth() / 2) - (g2d.getFontMetrics().stringWidth(msg) / 2); g2d.drawString(msg, x, y); } private Thread getMovingTextThread() { Thread tt = new Thread(new MovingTextRunner(this)); //tt.setDaemon(true); return tt; } static String stripCommitFromVersion(String version) { if (version.contains("pre+")) { return version; } int i = version.indexOf("+"); if (i < 0) { return version; } return version.substring(0, version.indexOf("+")); } private final class MovingTextRunner extends Observable implements Runnable { private static final int MAX_ANIMATION_VALUE = 10000; private static final int ANIMATION_RESTART_VALUE = 1; private static final long MOOVING_TEXT_DELAY = 150; public MovingTextRunner(Observer o) { this.addObserver(o); } @Override public void run() { while (master.isAnimationRunning()) { try { animationsPosition += greyTextIncrment; if (animationsPosition > MAX_ANIMATION_VALUE) { animationsPosition = ANIMATION_RESTART_VALUE; } this.setChanged(); this.notifyObservers(); Thread.sleep(MOOVING_TEXT_DELAY); } catch (Exception e) { OutputController.getLogger().log(e); } } } }; private Thread getWaterLevelThread() { Thread t = new Thread(new WaterLevelThread(this)); //t.setDaemon(true); return t; } private final class WaterLevelThread extends Observable implements Runnable { private static final int MAX_WATERLEVEL_VALUE = 120; private static final int WATER_LEVEL_INCREMENT = 2; private WaterLevelThread(BasePainter o) { this.addObserver(o); } @Override public void run() { while (master.isAnimationRunning()) { if (waterLevel > MAX_WATERLEVEL_VALUE) { break; } try { waterLevel += WATER_LEVEL_INCREMENT; this.setChanged(); this.notifyObservers(); //it is risinfg slower and slower Thread.sleep((waterLevel / 4) * 30); } catch (Exception e) { OutputController.getLogger().log(e); } } } }; private String getAlternativeProductName() { if (SplashReason.JAVAWS.equals(master.getSplashReason())) { return alternativeWeb; } else if (SplashReason.APPLET.equals(master.getSplashReason())) { return alternativeWeb + alternativePlugin; } else { return "...."; } } protected FontMetrics drawBase(Graphics2D g2d, InformationElement ic, String version) { g2d.setColor(backgroundColor); g2d.fillRect(0, 0, master.getSplashWidth() + 5, master.getSplashHeight() + 5); if (showNiceTexts) { //g2d.drawImage(tmpBackround, 0, 0, null); g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY); g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); g2d.setFont(teaFont); g2d.setColor(teaColor); g2d.drawString(tea, scaleX(42) + g2d.getFontMetrics(icedFont).stringWidth(ICED), scaleY(278)); g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_OFF); if (showLeaf) { g2d.fillPolygon(SplinesDefs.getMainLeafCurve(getRatioX(), getRatioY())); } if (showLeaf) { g2d.fillPolygon(SplinesDefs.getSecondLeafCurve(getRatioX(), getRatioY())); } g2d.setColor(teaLeafsStalksColor); if (showLeaf) { g2d.fillPolygon(SplinesDefs.getMainLeafStalkCurve(getRatioX(), getRatioY())); } if (showLeaf) { g2d.fillPolygon(SplinesDefs.getSecondLeafStalkCurve(getRatioX(), getRatioY())); } g2d.setFont(pluginFont); g2d.setColor(pluginColor); if (SplashReason.APPLET.equals(master.getSplashReason())) { if (showLeaf) { g2d.drawString(plugin, scaleX(404), scaleY(145)); } else { FontMetrics wfm = g2d.getFontMetrics(webFont); g2d.drawString(plugin, wfm.stringWidth(web) + scaleX(WEB_LEFT_ALIGMENT) + 10, scaleY(WEB_TOP_ALIGMENT)); } } g2d.setFont(plainTextsFont); g2d.setColor(plainTextColor); FontMetrics fm = g2d.getFontMetrics(); if (ic != null) { InfoItem des = ic.getBestMatchingDescriptionForSplash(); List head = ic.getHeader(); if (head != null && showInfo) { for (int i = 0; i < head.size(); i++) { String string = head.get(i); g2d.drawString(string, 5, (i + 1) * fm.getHeight()); } } if (des != null && des.getValue() != null) { g2d.drawString(des.getValue(), 5, master.getSplashHeight() - fm.getHeight()); } } } g2d.setFont(plainTextsFont); g2d.setColor(plainTextColor); FontMetrics fm = g2d.getFontMetrics(); if (version != null) { String aboutPrefix = Translator.R("AboutDialogueTabAbout") + ": "; int aboutPrefixWidth = fm.stringWidth(aboutPrefix); String niceVersion = stripCommitFromVersion(version); int y = master.getSplashWidth() - fm.stringWidth(niceVersion + " "); if (y < 0) { y = 0; } if (y > aboutPrefixWidth) { niceVersion = aboutPrefix + niceVersion; y -= aboutPrefixWidth; } aboutOfset = new Point(y, fm.getHeight()); Stroke backup = g2d.getStroke(); g2d.setStroke(dashed); g2d.drawRect(aboutOfset.x-1,1, master.getSplashWidth()-aboutOfset.x-1, aboutOfset.y+1); g2d.setStroke(backup); g2d.drawString(niceVersion, y, fm.getHeight()); } return fm; } public int getWaterLevel() { return waterLevel; } public void setWaterLevel(int level) { this.waterLevel = level; } public int getAnimationsPosition() { return animationsPosition; } public void clearCachedWaterTextImage() { oldTwl = null; } @Override public void update(Observable o, Object arg) { try { SwingUtilities.invokeAndWait(new Runnable() { @Override public void run() { ExtensionManager.getExtension().animate(); master.repaint(); } }); } catch (Exception ex) { OutputController.getLogger().log(ex); } } public BasicComponentSplashScreen getMaster() { return master; } public Point getAboutOfset() { return aboutOfset; } public Color getWaterColor() { return waterColor; } public Color getBackgroundColor() { return backgroundColor; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/impls/PaxHeaders.17941/DefaultSplashScreens0000644000000000000000000000013212654402377030322 xustar0030 mtime=1454507263.242432514 30 atime=1454507327.154580137 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/impls/DefaultSplashScreens2012Commons.java0000644000175000002070000001064312654402377033632 0ustar00jvanekmock00000000000000/* DefaultSplashScreensCommons2012.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.splashscreen.impls; import java.awt.Graphics; import java.awt.event.ComponentAdapter; import java.awt.event.ComponentEvent; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import net.sourceforge.jnlp.about.AboutDialog; import net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012.BasePainter; import net.sourceforge.jnlp.splashscreen.parts.BasicComponentSplashScreen; import net.sourceforge.jnlp.util.docprovider.TextsProvider; public final class DefaultSplashScreens2012Commons { private final BasicComponentSplashScreen parent; private final BasePainter painter; public DefaultSplashScreens2012Commons(BasePainter painterr, BasicComponentSplashScreen parentt) { this.painter = painterr; this.parent = parentt; parent.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { painter.increaseAnimationPosition(); parent.repaint(); } }); parent.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { if (e.getY() < painter.getAboutOfset().y && e.getX() > (painter.getAboutOfset().x)) { AboutDialog.display(TextsProvider.ITW_PLUGIN); } } }); // Add a new listener for resizes parent.addComponentListener(new ComponentAdapter() { // Re-adjust variables based on size @Override public void componentResized(ComponentEvent e) { parent.setSplashWidth(parent.getWidth()); parent.setSplashHeight(parent.getHeight()); parent.adjustForSize(); parent.repaint(); } }); } public void paintTo(Graphics g) { painter.paint(g); } public void adjustForSize() { painter.adjustForSize(parent.getSplashWidth(), parent.getSplashHeight()); } public void stopAnimation() { parent.setAnimationRunning(false); } /** * Methods to start the animation in the splash panel. * * This method exits after starting a new thread to do the animation. It * is synchronized to prevent multiple startAnimation threads from being created. */ public synchronized void startAnimation() { if (parent.isAnimationRunning()) { return; } parent.setAnimationRunning(true); painter.startAnimationThreads(); } public void setPercentage(int done) { painter.clearCachedWaterTextImage(); painter.setWaterLevel(done); } public int getPercentage() { return painter.getWaterLevel(); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/impls/PaxHeaders.17941/DefaultSplashScreen20000644000000000000000000000013212654402377030221 xustar0030 mtime=1454507263.241432528 30 atime=1454507327.154580137 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/impls/DefaultSplashScreen2012.java0000644000175000002070000000674312654402377032121 0ustar00jvanekmock00000000000000/* DefaultSplashScreen12.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.splashscreen.impls; import java.awt.Graphics; import net.sourceforge.jnlp.splashscreen.SplashUtils.SplashReason; import net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012.BasePainter; import net.sourceforge.jnlp.splashscreen.parts.BasicComponentSplashScreen; public final class DefaultSplashScreen2012 extends BasicComponentSplashScreen { private final DefaultSplashScreen2012 self; private final BasePainter painter; private final DefaultSplashScreens2012Commons commons; public DefaultSplashScreen2012(int width, int height, SplashReason splashReason) { //setting width and height now is causing unnecessary blinking //setSplashHeight(height); //setSplashWidth(width); //to have this in inner classes self = this; setSplashReason(splashReason); painter = new BasePainter(this); commons = new DefaultSplashScreens2012Commons(painter, self); } @Override public void paintComponent(Graphics g) { paintTo(g); } @Override public void paintTo(Graphics g) { commons.paintTo(g); } @Override public void adjustForSize() { commons.adjustForSize(); } @Override public void stopAnimation() { commons.stopAnimation(); } /** * Methods to start the animation in the splash panel. * * This method exits after starting a new thread to do the animation. It * is synchronized to prevent multiple startAnimation threads from being created. */ @Override public void startAnimation() { commons.startAnimation(); } @Override public void setPercentage(int done) { commons.setPercentage(done); } @Override public int getPercentage() { return commons.getPercentage(); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/impls/PaxHeaders.17941/DefaultErrorSplashSc0000644000000000000000000000013112654402377030276 xustar0030 mtime=1454507263.241432528 29 atime=1454507327.15358015 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/impls/DefaultErrorSplashScreen2012.java0000644000175000002070000000770412654402377033131 0ustar00jvanekmock00000000000000/* DefaultErrorSplashScreen12.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.splashscreen.impls; import java.awt.Graphics; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import net.sourceforge.jnlp.splashscreen.SplashUtils.SplashReason; import net.sourceforge.jnlp.splashscreen.impls.defaultsplashscreen2012.ErrorPainter; import net.sourceforge.jnlp.splashscreen.parts.BasicComponentErrorSplashScreen; public final class DefaultErrorSplashScreen2012 extends BasicComponentErrorSplashScreen { private final ErrorPainter painter; private final DefaultSplashScreens2012Commons commons; public DefaultErrorSplashScreen2012(int width, int height, SplashReason splashReason, Throwable ex) { //setting width and height now is causing unnecessary blinking //setSplashHeight(height); //setSplashWidth(width); //to have this in inner classes setLoadingException(ex); setSplashReason(splashReason); painter = new ErrorPainter(this, true); addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { if ((painter).getErrorCorner() != null && e.getX() > (painter).getErrorCorner().x && e.getY() > (painter).getErrorCorner().y) { raiseExceptionDialog(); } } }); commons = new DefaultSplashScreens2012Commons(painter, this); } @Override public void paintComponent(Graphics g) { paintTo(g); } @Override public void paintTo(Graphics g) { commons.paintTo(g); } @Override public void adjustForSize() { commons.adjustForSize(); } @Override public void stopAnimation() { commons.stopAnimation(); } /** * Methods to start the animation in the splash panel. * * This method exits after starting a new thread to do the animation. It * is synchronized to prevent multiple startAnimation threads from being created. */ @Override public void startAnimation() { commons.startAnimation(); } @Override public void setPercentage(int done) { commons.setPercentage(done); } @Override public int getPercentage() { return commons.getPercentage(); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/PaxHeaders.17941/SplashUtils.java0000644000000000000000000000013112654402377026306 xustar0030 mtime=1454507263.241432528 29 atime=1454507327.15358015 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/SplashUtils.java0000644000175000002070000001771512654402377027045 0ustar00jvanekmock00000000000000/* SplashUtils.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.splashscreen; import net.sourceforge.jnlp.runtime.AppletEnvironment; import net.sourceforge.jnlp.runtime.AppletInstance; import net.sourceforge.jnlp.runtime.Boot; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.splashscreen.impls.DefaultSplashScreen2012; import net.sourceforge.jnlp.splashscreen.impls.DefaultErrorSplashScreen2012; import net.sourceforge.jnlp.util.logging.OutputController; public class SplashUtils { static final String ICEDTEA_WEB_PLUGIN_SPLASH = "ICEDTEA_WEB_PLUGIN_SPLASH"; static final String ICEDTEA_WEB_SPLASH = "ICEDTEA_WEB_SPLASH"; static final String NONE = "none"; static final String DEFAULT = "default"; /** * Indicator whether to show icedtea-web plugin or just icedtea-web * For "just icedtea-web" will be done an attempt to show content of * information element */ public static enum SplashReason { APPLET, JAVAWS; @Override public String toString() { switch (this) { case APPLET: return "IcedTea-Web Plugin"; case JAVAWS: return "IcedTea-Web"; } return "unknown"; } } public static void showErrorCaught(Throwable ex, AppletInstance appletInstance) { try { showError(ex, appletInstance); } catch (Throwable t) { // prinitng this exception is discutable. I have let it in for case that //some retyping will fail OutputController.getLogger().log(t); } } public static void showError(Throwable ex, AppletInstance appletInstance) { if (appletInstance == null) { return; } AppletEnvironment ae = appletInstance.getAppletEnvironment(); showError(ex, ae); } public static void showError(Throwable ex, AppletEnvironment ae) { if (ae == null) { return; } SplashController p = ae.getSplashController(); showError(ex, p); } public static void showError(Throwable ex, SplashController f) { if (f == null) { return; } f.replaceSplash(getErrorSplashScreen(f.getSplashWidth(), f.getSplashHeigth(), ex)); } private static SplashReason getReason() { if (JNLPRuntime.isWebstartApplication()) { return SplashReason.JAVAWS; } else { return SplashReason.APPLET; } } /** * Warning - splash should have recieve width and height without borders. * plugin's window have NO border, but javaws window HAVE border. This must * be calcualted prior calling this method * @param width * @param height */ public static SplashPanel getSplashScreen(int width, int height) { return getSplashScreen(width, height, getReason()); } /** * Warning - splash should have recieve width and height without borders. * plugin's window have NO border, but javaws window HAVE border. This must * be calcualted prior calling this method * @param width * @param height * @param ex exception to be shown if any */ public static SplashErrorPanel getErrorSplashScreen(int width, int height, Throwable ex) { return getErrorSplashScreen(width, height, getReason(), ex); } /** * Warning - splash should have recieve width and height without borders. * plugin's window have NO border, but javaws window HAVE border. This must * be calcualted prior calling this method * @param width * @param height * @param splashReason */ static SplashPanel getSplashScreen(int width, int height, SplashUtils.SplashReason splashReason) { return getSplashScreen(width, height, splashReason, null, false); } /** * Warning - splash should have recieve width and height without borders. * plugin's window have NO border, but javaws window HAVE border. This must * be calcualted prior calling this method * @param width * @param height * @param splashReason * @param ex exception to be shown if any */ static SplashErrorPanel getErrorSplashScreen(int width, int height, SplashUtils.SplashReason splashReason, Throwable ex) { return (SplashErrorPanel) getSplashScreen(width, height, splashReason, ex, true); } /** * @param width * @param height * @param splashReason * @param loadingException * @param isError */ public static SplashPanel getSplashScreen(int width, int height, SplashUtils.SplashReason splashReason, Throwable loadingException, boolean isError) { String splashEnvironmetVar = null; String pluginSplashEnvironmetVar = null; try { pluginSplashEnvironmetVar = System.getenv(ICEDTEA_WEB_PLUGIN_SPLASH); splashEnvironmetVar = System.getenv(ICEDTEA_WEB_SPLASH); } catch (Exception ex) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, ex); } SplashPanel sp = null; if (SplashReason.JAVAWS.equals(splashReason)) { if (NONE.equals(splashEnvironmetVar)) { return null; } if (DEFAULT.equals(splashEnvironmetVar)) { if (isError) { sp = new DefaultErrorSplashScreen2012(width, height, splashReason, loadingException); } else { sp = new DefaultSplashScreen2012(width, height, splashReason); } } } if (SplashReason.APPLET.equals(splashReason)) { if (NONE.equals(pluginSplashEnvironmetVar)) { return null; } if (DEFAULT.equals(pluginSplashEnvironmetVar)) { if (isError) { sp = new DefaultErrorSplashScreen2012(width, height, splashReason, loadingException); } else { sp = new DefaultSplashScreen2012(width, height, splashReason); } } } if (isError) { sp = new DefaultErrorSplashScreen2012(width, height, splashReason, loadingException); } else { sp = new DefaultSplashScreen2012(width, height, splashReason); } sp.setVersion(Boot.version); return sp; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/PaxHeaders.17941/SplashPanel.java0000644000000000000000000000013112654402377026245 xustar0030 mtime=1454507263.240432541 29 atime=1454507327.15358015 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/SplashPanel.java0000644000175000002070000000742512654402377027001 0ustar00jvanekmock00000000000000/* SplashPanel.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.splashscreen; import java.awt.Graphics; import java.awt.event.ComponentListener; import javax.swing.JComponent; import net.sourceforge.jnlp.splashscreen.SplashUtils.SplashReason; import net.sourceforge.jnlp.splashscreen.parts.InformationElement; public interface SplashPanel { /** * The plugin splashscreens must be placed into another containers, * So must return themselves as JComponent. * Mostly your SplashScreen will extend some JComponent, so this method will * just return "this" */ public JComponent getSplashComponent(); public void setInformationElement(InformationElement content); public InformationElement getInformationElement(); /** Width of the plugin window */ public void setSplashWidth(int pluginWidth); /** Height of the plugin window */ public void setSplashHeight(int pluginHeight); /** Width of the plugin window */ public int getSplashWidth(); /** Height of the plugin window */ public int getSplashHeight(); public void adjustForSize(); // Add a new listener for resizes public void addComponentListener(ComponentListener cl); public boolean isAnimationRunning(); /** * Methods to start the animation in the splash panel. * * This method exits after starting a new thread to do the animation. It * is synchronized to prevent multiple startAnimation threads from being created. */ public void startAnimation(); public void stopAnimation(); void paintTo(Graphics g); public void setSplashReason(SplashReason splashReason); public SplashReason getSplashReason(); /** * Version can be printed in splash window * @param version */ public void setVersion(String version); String getVersion(); /** * how mny percentage loaded is shown in progress bar (if any) * @param done - should be in 0-100 inclusinve */ public void setPercentage(int done); /** * returns state of loading progress bar * @return percentage showed in possible progress bar - should be in 0-100 */ int getPercentage(); } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/PaxHeaders.17941/SplashErrorPanel.java0000644000000000000000000000013112654402377027257 xustar0030 mtime=1454507263.240432541 29 atime=1454507327.15358015 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/SplashErrorPanel.java0000644000175000002070000000375012654402377030010 0ustar00jvanekmock00000000000000/* SplashErrorPanel.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.splashscreen; public interface SplashErrorPanel extends SplashPanel { /** * When applet loading fails, then dying stacktrace can be set, and is then shown to user on demand. */ public Throwable getLoadingException(); public void setLoadingException(Throwable loadingException); } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/PaxHeaders.17941/SplashController.java0000644000000000000000000000013112654402377027331 xustar0030 mtime=1454507263.240432541 29 atime=1454507327.15358015 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/splashscreen/SplashController.java0000644000175000002070000000360112654402377030055 0ustar00jvanekmock00000000000000/* SplashController.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.splashscreen; public interface SplashController { public void removeSplash(); public void replaceSplash(SplashPanel r); public int getSplashWidth(); public int getSplashHeigth(); } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/services0000644000000000000000000000013212654402377022245 xustar0030 mtime=1454507263.240432541 30 atime=1454507658.780157344 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/services/0000755000175000002070000000000012654402377023045 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/netx/net/sourceforge/jnlp/services/PaxHeaders.17941/package-info.java0000644000000000000000000000013212654402377025511 xustar0030 mtime=1454507263.240432541 30 atime=1454507327.152580163 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/services/package-info.java0000644000175000002070000000340412654402377026235 0ustar00jvanekmock00000000000000/* package-info.java Copyright (C) 2014 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.*/ /** * This package contains the classes that implement the standard services * defined by the JNLP specification. */ package net.sourceforge.jnlp.services; icedtea-web-1.6.2/netx/net/sourceforge/jnlp/services/PaxHeaders.17941/XSingleInstanceService.java0000644000000000000000000000013212654402377027544 xustar0030 mtime=1454507263.239432554 30 atime=1454507327.152580163 30 ctime=1454507658.738157903 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/services/XSingleInstanceService.java0000644000175000002070000002160512654402377030273 0ustar00jvanekmock00000000000000// Copyright (C) 2009 Red Hat, Inc. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp.services; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.net.ServerSocket; import java.net.Socket; import java.net.UnknownHostException; import java.util.LinkedList; import java.util.List; import java.util.Map.Entry; import java.util.Set; import javax.jnlp.SingleInstanceListener; import javax.management.InstanceAlreadyExistsException; import net.sourceforge.jnlp.JNLPFile; import net.sourceforge.jnlp.PluginBridge; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.util.logging.OutputController; /** * This class implements SingleInstanceService * * @author Omair Majid */ public class XSingleInstanceService implements ExtendedSingleInstanceService { boolean initialized = false; List listeners = new LinkedList(); /** * Implements a server that listens for arguments from new instances of this * application * */ class SingleInstanceServer implements Runnable { SingleInstanceLock lockFile = null; public SingleInstanceServer(SingleInstanceLock lockFile) { this.lockFile = lockFile; } public void run() { ServerSocket listeningSocket = null; try { listeningSocket = new ServerSocket(0); lockFile.createWithPort(listeningSocket.getLocalPort()); OutputController.getLogger().log("Starting SingleInstanceServer on port" + listeningSocket); while (true) { try { Socket communicationSocket = listeningSocket.accept(); ObjectInputStream ois = new ObjectInputStream(communicationSocket .getInputStream()); String[] arguments = (String[]) ois.readObject(); notifySingleInstanceListeners(arguments); } catch (Exception exception) { // not much to do here... OutputController.getLogger().log(OutputController.Level.ERROR_ALL, exception); } } } catch (IOException e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); } finally { if (listeningSocket != null) { try { listeningSocket.close(); } catch (IOException e) { // Give up. OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); } } } } } /** * Create a new XSingleInstanceService */ protected XSingleInstanceService() { } /** * Initialize the new SingleInstanceService * * @throws InstanceExistsException if the instance already exists */ public void initializeSingleInstance() { // this is called after the application has started. so safe to use // JNLPRuntime.getApplication() JNLPFile jnlpFile = JNLPRuntime.getApplication().getJNLPFile(); if (!initialized || jnlpFile instanceof PluginBridge) { // Either a new process or a new applet being handled by the plugin. checkSingleInstanceRunning(jnlpFile); initialized = true; SingleInstanceLock lockFile; lockFile = new SingleInstanceLock(jnlpFile); if (!lockFile.isValid()) { startListeningServer(lockFile); } } } /** * Check if another instance of this application is already running * * @param jnlpFile The {@link JNLPFile} that specifies the application * * @throws InstanceExistsException if an instance of this application * already exists */ @Override public void checkSingleInstanceRunning(JNLPFile jnlpFile) { SingleInstanceLock lockFile = new SingleInstanceLock(jnlpFile); if (lockFile.isValid()) { int port = lockFile.getPort(); OutputController.getLogger().log("Lock file is valid (port=" + port + "). Exiting."); String[] args = null; if (jnlpFile.isApplet()) { // FIXME Proprietary plug-in is unclear about how to handle // applets and their parameters. //Right now better to forward at least something Set> currentParams = jnlpFile.getApplet().getParameters().entrySet(); args = new String[currentParams.size() * 2]; int i = 0; for (Entry entry : currentParams) { args[i] = entry.getKey(); args[i+1] = entry.getValue(); i += 2; } } else if (jnlpFile.isInstaller()) { // TODO Implement this once installer service is available. } else { args = jnlpFile.getApplication().getArguments(); } try { sendProgramArgumentsToExistingApplication(port, args); throw new InstanceExistsException(String.valueOf(port)); } catch (IOException e) { throw new RuntimeException(e); } } } /** * Start the listening server to accept arguments from new instances of * applications * * @param lockFile * the {@link SingleInstanceLock} that the server should use */ private void startListeningServer(SingleInstanceLock lockFile) { SingleInstanceServer server = new SingleInstanceServer(lockFile); Thread serverThread = new Thread(server); /* * mark as daemon so the JVM can shutdown if the server is the only * thread running */ serverThread.setDaemon(true); serverThread.start(); } /** * Send the arguments for this application to the main instance * * @param port the port at which the SingleInstanceServer is listening at * @param arguments the new arguments * @throws IOException on any io exception */ private void sendProgramArgumentsToExistingApplication(int port, String[] arguments) throws IOException { try { Socket serverCommunicationSocket = new Socket((String) null, port); ObjectOutputStream argumentStream = new ObjectOutputStream(serverCommunicationSocket .getOutputStream()); argumentStream.writeObject(arguments); argumentStream.close(); serverCommunicationSocket.close(); } catch (UnknownHostException unknownHost) { OutputController.getLogger().log("Unable to find localhost"); throw new RuntimeException(unknownHost); } } /** * Notify any SingleInstanceListener with new arguments * * @param arguments the new arguments to the application */ private void notifySingleInstanceListeners(String[] arguments) { for (SingleInstanceListener listener : listeners) { // TODO this proxy is privileged. should i worry about security in // methods being called? listener.newActivation(arguments); } } /** * Add the specified SingleInstanceListener * * @throws InstanceExistsException which is likely to terminate the * application but not guaranteed to */ public void addSingleInstanceListener(SingleInstanceListener sil) { initializeSingleInstance(); if (sil == null) { return; } listeners.add(sil); } /** * Remove the specified SingleInstanceListener * * @throws InstanceExistsException if an instance of this single instance * application already exists * */ public void removeSingleInstanceListener(SingleInstanceListener sil) { initializeSingleInstance(); if (sil == null) { return; } listeners.remove(sil); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/services/PaxHeaders.17941/XServiceManagerStub.java0000644000000000000000000000013212654402377027046 xustar0030 mtime=1454507263.239432554 30 atime=1454507327.152580163 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/services/XServiceManagerStub.java0000644000175000002070000001001012654402377027561 0ustar00jvanekmock00000000000000// Copyright (C) 2001-2003 Jon A. Maxwell (JAM) // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp.services; import java.io.*; import java.net.*; import java.util.*; import java.lang.ref.*; import java.lang.reflect.*; import java.security.*; import javax.jnlp.*; import net.sourceforge.jnlp.*; /** * Lookup table for services. * * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.6 $ */ public class XServiceManagerStub implements ServiceManagerStub { // todo: only include ExtensionInstallerService if an installer // is getting the service, otherwise return null. // todo: fix services to do their own privileged actions that // run less code in the secure environment (or avoid privileged // actions by giving permission to the code source). private static String serviceNames[] = { "javax.jnlp.BasicService", // required "javax.jnlp.DownloadService", // required "javax.jnlp.ExtendedService", "javax.jnlp.ExtensionInstallerService", // required "javax.jnlp.PersistenceService", "javax.jnlp.FileOpenService", "javax.jnlp.FileSaveService", "javax.jnlp.ClipboardService", "javax.jnlp.PrintService", "javax.jnlp.SingleInstanceService" }; private static Object services[] = { ServiceUtil.createPrivilegedProxy(BasicService.class, new XBasicService()), ServiceUtil.createPrivilegedProxy(DownloadService.class, new XDownloadService()), ServiceUtil.createPrivilegedProxy(ExtendedService.class, new XExtendedService()), ServiceUtil.createPrivilegedProxy(ExtensionInstallerService.class, new XExtensionInstallerService()), ServiceUtil.createPrivilegedProxy(PersistenceService.class, new XPersistenceService()), ServiceUtil.createPrivilegedProxy(FileOpenService.class, new XFileOpenService()), ServiceUtil.createPrivilegedProxy(FileSaveService.class, new XFileSaveService()), ServiceUtil.createPrivilegedProxy(ClipboardService.class, new XClipboardService()), ServiceUtil.createPrivilegedProxy(PrintService.class, new XPrintService()), ServiceUtil.createPrivilegedProxy(ExtendedSingleInstanceService.class, new XSingleInstanceService()) }; public XServiceManagerStub() { } /** * Returns the service names. */ public String[] getServiceNames() { // make sure it is a copy because we might be returning to // code we don't own. String result[] = new String[serviceNames.length]; System.arraycopy(serviceNames, 0, result, 0, serviceNames.length); return result; } /** * Returns the service. * * @throws UnavailableServiceException if service is not available */ public Object lookup(String name) throws UnavailableServiceException { // exact match for (int i = 0; i < serviceNames.length; i++) if (serviceNames[i].equals(name)) return services[i]; // substring match for (int i = 0; i < serviceNames.length; i++) if (-1 != serviceNames[i].indexOf(name)) return services[i]; throw new UnavailableServiceException("" + name); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/services/PaxHeaders.17941/XPrintService.java0000644000000000000000000000013212654402377025732 xustar0030 mtime=1454507263.239432554 30 atime=1454507327.152580163 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/services/XPrintService.java0000644000175000002070000001035112654402377026455 0ustar00jvanekmock00000000000000/* XPrintService.java Copyright (C) 2008 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.services; import java.awt.print.PageFormat; import java.awt.print.Pageable; import java.awt.print.Printable; import java.awt.print.PrinterException; import java.awt.print.PrinterJob; import javax.jnlp.*; import javax.swing.JOptionPane; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.util.logging.OutputController; public class XPrintService implements PrintService { // If pj is null, then we do not have a printer to use. private PrinterJob pj; public XPrintService() { pj = PrinterJob.getPrinterJob(); } public PageFormat getDefaultPage() { if (pj != null) return pj.defaultPage(); else { showWarning(); return new PageFormat(); // might not have default settings. } } public PageFormat showPageFormatDialog(PageFormat page) { if (pj != null) return pj.pageDialog(page); else { showWarning(); return page; } } public boolean print(Pageable document) { if (pj != null) { pj.setPageable(document); if (pj.printDialog()) { try { pj.print(); return true; } catch (PrinterException pe) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, "Could not print: " + pe); OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, pe); return false; } } } else showWarning(); return false; } public boolean print(Printable painter) { if (pj != null) { pj.setPrintable(painter); if (pj.printDialog()) { try { pj.print(); return true; } catch (PrinterException pe) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, "Could not print: " + pe); OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, pe); return false; } } } else showWarning(); return false; } private void showWarning() { JOptionPane.showMessageDialog(null, "Unable to find a default printer.", "Warning", JOptionPane.WARNING_MESSAGE); OutputController.getLogger().log(OutputController.Level.ERROR_ALL, "Unable to print: Unable to find default printer."); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/services/PaxHeaders.17941/XPersistenceService.java0000644000000000000000000000013212654402377027122 xustar0030 mtime=1454507263.238432568 30 atime=1454507327.152580163 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/services/XPersistenceService.java0000644000175000002070000001453412654402377027654 0ustar00jvanekmock00000000000000// Copyright (C) 2001-2003 Jon A. Maxwell (JAM) // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp.services; import java.io.*; import java.net.*; import java.util.*; import javax.jnlp.*; import net.sourceforge.jnlp.cache.*; import net.sourceforge.jnlp.config.PathsAndFiles; import net.sourceforge.jnlp.runtime.*; import net.sourceforge.jnlp.util.FileUtils; import net.sourceforge.jnlp.util.logging.OutputController; /** * The BasicService JNLP service. * * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.7 $ */ class XPersistenceService implements PersistenceService { // todo: recheck delete, etc to make sure security is tight protected XPersistenceService() { } /** * Checks whether the application has access to URL area * requested. If the method returns normally then the specified * location can be accessed by the current application. * * @throws MalformedURLException if the application cannot access the location */ protected void checkLocation(URL location) throws MalformedURLException { ApplicationInstance app = JNLPRuntime.getApplication(); if (app == null) throw new MalformedURLException("Cannot determine the current application."); URL source = app.getJNLPFile().getCodeBase(); if (!source.getHost().equalsIgnoreCase(location.getHost()) && !ServiceUtil.isSigned(app)) // Allow trusted application to have access to data from a different host throw new MalformedURLException( "Untrusted application cannot access data from a different host."); // test for above codebase, not perfect but works for now String requestPath = location.getFile(); if (-1 != requestPath.lastIndexOf("/")) requestPath = requestPath.substring(0, requestPath.lastIndexOf("/")); else requestPath = ""; OutputController.getLogger().log("codebase path: " + source.getFile()); OutputController.getLogger().log("request path: " + requestPath); if (!source.getFile().startsWith(requestPath) && !ServiceUtil.isSigned(app)) // Allow trusted application to have access to data below source URL path throw new MalformedURLException( "Cannot access data below source URL path."); } /** * Converts a URL into a file in the persistence store. * * @return the file */ protected File toCacheFile(URL location) throws MalformedURLException { String pcache = PathsAndFiles.PCACHE_DIR.getFullPath(); return CacheUtil.urlToPath(location, pcache); } /** * * @return the maximum size of storage that got granted, in bytes * @throws MalformedURLException if the application cannot access the location */ public long create(URL location, long maxsize) throws MalformedURLException, IOException { checkLocation(location); File file = toCacheFile(location); FileUtils.createParentDir(file, "Persistence store for " + location.toString()); if (file.exists()) throw new IOException("File already exists."); FileUtils.createRestrictedFile(file, true); return maxsize; } /** * * @throws MalformedURLException if the application cannot access the location */ public void delete(URL location) throws MalformedURLException, IOException { checkLocation(location); FileUtils.deleteWithErrMesg(toCacheFile(location), " tocache"); } /** * * @throws MalformedURLException if the application cannot access the location */ public FileContents get(URL location) throws MalformedURLException, IOException, FileNotFoundException { checkLocation(location); File file = toCacheFile(location); if (!file.exists()) { throw new FileNotFoundException("Persistence store for " + location.toString() + " is not found."); } FileUtils.createParentDir(file, "Persistence store for " + location.toString()); return (FileContents) ServiceUtil.createPrivilegedProxy(FileContents.class, new XFileContents(file)); } /** * * @throws MalformedURLException if the application cannot access the location */ public String[] getNames(URL location) throws MalformedURLException, IOException { checkLocation(location); File file = toCacheFile(location); if (!file.isDirectory()) return new String[0]; List result = new ArrayList(); // check whether this is right: only add files and not directories. File entries[] = file.listFiles(); for (int i = 0; i < entries.length; i++) if (entries[i].isFile()) result.add(entries[i].getName()); return result.toArray(new String[result.size()]); } /** * * @throws MalformedURLException if the application cannot access the location */ public int getTag(URL location) throws MalformedURLException, IOException { checkLocation(location); // todo: actually implement tags if (toCacheFile(location).exists()) return PersistenceService.CACHED; return PersistenceService.CACHED; } /** * * @throws MalformedURLException if the application cannot access the location */ public void setTag(URL location, int tag) throws MalformedURLException, IOException { checkLocation(location); // todo: actually implement tags } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/services/PaxHeaders.17941/XJNLPRandomAccessFile.java0000644000000000000000000000013212654402377027143 xustar0030 mtime=1454507263.238432568 30 atime=1454507327.152580163 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/services/XJNLPRandomAccessFile.java0000644000175000002070000001246112654402377027672 0ustar00jvanekmock00000000000000/* XJNLPRandomAccessFile.java Copyright (C) 2008 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.services; import java.io.File; import java.io.IOException; import java.io.RandomAccessFile; import javax.jnlp.JNLPRandomAccessFile; public class XJNLPRandomAccessFile implements JNLPRandomAccessFile { private RandomAccessFile raf; public XJNLPRandomAccessFile(File file, String mode) throws IOException { raf = new RandomAccessFile(file, mode); } public void close() throws IOException { raf.close(); } public long getFilePointer() throws IOException { return raf.getFilePointer(); } public long length() throws IOException { return raf.length(); } public int read() throws IOException { return raf.read(); } public int read(byte[] b, int off, int len) throws IOException { return raf.read(b, off, len); } public int read(byte[] b) throws IOException { return raf.read(b); } public boolean readBoolean() throws IOException { return raf.readBoolean(); } public byte readByte() throws IOException { return raf.readByte(); } public char readChar() throws IOException { return raf.readChar(); } public double readDouble() throws IOException { return raf.readDouble(); } public float readFloat() throws IOException { return raf.readFloat(); } public void readFully(byte[] b) throws IOException { raf.readFully(b); } public void readFully(byte[] b, int off, int len) throws IOException { raf.readFully(b, off, len); } public int readInt() throws IOException { return raf.readInt(); } public String readLine() throws IOException { return raf.readLine(); } public long readLong() throws IOException { return raf.readLong(); } public short readShort() throws IOException { return raf.readShort(); } public String readUTF() throws IOException { return raf.readUTF(); } public int readUnsignedByte() throws IOException { return raf.readUnsignedByte(); } public int readUnsignedShort() throws IOException { return raf.readUnsignedShort(); } public void seek(long pos) throws IOException { raf.seek(pos); } public void setLength(long newLength) throws IOException { raf.setLength(newLength); } public int skipBytes(int n) throws IOException { return raf.skipBytes(n); } public void write(int b) throws IOException { raf.write(b); } public void write(byte[] b) throws IOException { raf.write(b); } public void write(byte[] b, int off, int len) throws IOException { raf.write(b, off, len); } public void writeBoolean(boolean v) throws IOException { raf.writeBoolean(v); } public void writeByte(int v) throws IOException { raf.writeByte(v); } public void writeBytes(String s) throws IOException { raf.writeBytes(s); } public void writeChar(int v) throws IOException { raf.writeChar(v); } public void writeChars(String s) throws IOException { raf.writeChars(s); } public void writeDouble(double v) throws IOException { raf.writeDouble(v); } public void writeFloat(float v) throws IOException { raf.writeFloat(v); } public void writeInt(int v) throws IOException { raf.writeInt(v); } public void writeLong(long v) throws IOException { raf.writeLong(v); } public void writeShort(int v) throws IOException { raf.writeShort(v); } public void writeUTF(String str) throws IOException { raf.writeUTF(str); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/services/PaxHeaders.17941/XFileSaveService.java0000644000000000000000000000013212654402377026334 xustar0030 mtime=1454507263.238432568 30 atime=1454507327.152580163 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/services/XFileSaveService.java0000644000175000002070000001157312654402377027066 0ustar00jvanekmock00000000000000/* XFileSaveService.java Copyright (C) 2008 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.services; import java.io.*; import javax.jnlp.*; import net.sourceforge.jnlp.security.SecurityDialogs.AccessType; import net.sourceforge.jnlp.util.FileUtils; import javax.swing.JFileChooser; import javax.swing.JOptionPane; /** * The FileSaveService JNLP service. * * @author Joshua Sumali */ class XFileSaveService implements FileSaveService { protected XFileSaveService() { } /** * Prompts the user to save a file. */ public FileContents saveFileDialog(java.lang.String pathHint, java.lang.String[] extensions, java.io.InputStream stream, java.lang.String name) throws java.io.IOException { if (ServiceUtil.checkAccess(AccessType.WRITE_FILE)) { JFileChooser chooser = new JFileChooser(); int chosen = chooser.showSaveDialog(null); if (chosen == JFileChooser.APPROVE_OPTION) { writeToFile(stream, chooser.getSelectedFile()); return (FileContents) ServiceUtil.createPrivilegedProxy( FileContents.class, new XFileContents(chooser.getSelectedFile())); } else { return null; } } else { return null; } } /** * Prompts the user to save a file, with an optional pre-set filename. */ public FileContents saveAsFileDialog(java.lang.String pathHint, java.lang.String[] extensions, FileContents contents) throws java.io.IOException { if (ServiceUtil.checkAccess(AccessType.WRITE_FILE)) { JFileChooser chooser = new JFileChooser(); chooser.setSelectedFile(new File(contents.getName())); int chosen = chooser.showSaveDialog(null); if (chosen == JFileChooser.APPROVE_OPTION) { writeToFile(contents.getInputStream(), chooser.getSelectedFile()); return (FileContents) ServiceUtil.createPrivilegedProxy( FileContents.class, new XFileContents(chooser.getSelectedFile())); } else { return null; } } else { return null; } } /** * Writes actual file to disk. */ private void writeToFile(InputStream stream, File file) throws IOException { if (!file.createNewFile()) { //file exists boolean replace = (JOptionPane.showConfirmDialog(null, file.getAbsolutePath() + " already exists.\n" + "Do you want to replace it?", "Warning - File Exists", JOptionPane.YES_NO_OPTION) == 0); if (!replace) return; } else { FileUtils.createRestrictedFile(file, true); } if (file.canWrite()) { FileOutputStream out = new FileOutputStream(file); byte[] b = new byte[256]; int read = 0; while ((read = stream.read(b)) > 0) out.write(b, 0, read); out.flush(); out.close(); } else { throw new IOException("Unable to open file for writing"); } } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/services/PaxHeaders.17941/XFileOpenService.java0000644000000000000000000000013212654402377026337 xustar0030 mtime=1454507263.238432568 30 atime=1454507327.152580163 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/services/XFileOpenService.java0000644000175000002070000000752412654402377027072 0ustar00jvanekmock00000000000000/* XFileOpenService.java Copyright (C) 2008 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.services; import java.io.*; import javax.jnlp.*; import net.sourceforge.jnlp.security.SecurityDialogs.AccessType; import javax.swing.JFileChooser; /** * The FileOpenService JNLP service. * * @author Joshua Sumali */ class XFileOpenService implements FileOpenService { protected XFileOpenService() { } /** * Prompts the user to select a single file. */ public FileContents openFileDialog(java.lang.String pathHint, java.lang.String[] extensions) throws java.io.IOException { if (ServiceUtil.checkAccess(AccessType.READ_FILE)) { //open a file dialog here, let the user choose the file. JFileChooser chooser = new JFileChooser(); int chosen = chooser.showOpenDialog(null); if (chosen == JFileChooser.APPROVE_OPTION) { return (FileContents) ServiceUtil.createPrivilegedProxy( FileContents.class, new XFileContents(chooser.getSelectedFile())); } else { return null; } } else { return null; } } /** * Prompts the user to select one or more files. */ public FileContents[] openMultiFileDialog(java.lang.String pathHint, java.lang.String[] extensions) throws java.io.IOException { if (ServiceUtil.checkAccess(AccessType.WRITE_FILE)) { JFileChooser chooser = new JFileChooser(); chooser.setMultiSelectionEnabled(true); int chosen = chooser.showOpenDialog(null); if (chosen == JFileChooser.APPROVE_OPTION) { File[] files = chooser.getSelectedFiles(); int length = files.length; FileContents[] result = new FileContents[length]; for (int i = 0; i < length; i++) { XFileContents xfile = new XFileContents(files[i]); result[i] = (FileContents) ServiceUtil.createPrivilegedProxy(FileContents.class, xfile); } return result; } else { return null; } } else { return null; } } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/services/PaxHeaders.17941/XFileContents.java0000644000000000000000000000013212654402377025712 xustar0030 mtime=1454507263.237432581 30 atime=1454507327.151580177 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/services/XFileContents.java0000644000175000002070000000572112654402377026442 0ustar00jvanekmock00000000000000// Copyright (C) 2001-2003 Jon A. Maxwell (JAM) // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp.services; import java.io.*; import javax.jnlp.*; /** * File contents. * * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.6 $ */ class XFileContents implements FileContents { /** the file */ private File file; /** * Create a file contents implementation for the file. */ protected XFileContents(File file) { // create a safe copy this.file = new File(file.getPath()); } /** * * @throws IOException if an I/O exception occurs. */ public boolean canRead() throws IOException { return file.canRead(); } /** * * @throws IOException if an I/O exception occurs. */ public boolean canWrite() throws IOException { return file.canWrite(); } /** * * @throws IOException if an I/O exception occurs. */ public InputStream getInputStream() throws IOException { return new FileInputStream(file); } /** * * @throws IOException if an I/O exception occurs. */ public long getLength() throws IOException { return file.length(); } /** * * @throws IOException if an I/O exception occurs. */ public long getMaxLength() throws IOException { return Long.MAX_VALUE; } /** * * @throws IOException if an I/O exception occurs. */ public String getName() throws IOException { return file.getName(); } /** * * @throws IOException if an I/O exception occurs. */ public OutputStream getOutputStream(boolean overwrite) throws IOException { // file.getPath compatible with pre-1.4 JREs return new FileOutputStream(file.getPath(), !overwrite); } /** * * @throws IOException if an I/O exception occurs. */ public JNLPRandomAccessFile getRandomAccessFile(String mode) throws IOException { return new XJNLPRandomAccessFile(file, mode); } /** * * @throws IOException if an I/O exception occurs. */ public long setMaxLength(long maxlength) throws IOException { return maxlength; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/services/PaxHeaders.17941/XExtensionInstallerService.jav0000644000000000000000000000013212654402377030327 xustar0030 mtime=1454507263.237432581 30 atime=1454507327.151580177 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/services/XExtensionInstallerService.java0000644000175000002070000000442612654402377031221 0ustar00jvanekmock00000000000000// Copyright (C) 2001-2003 Jon A. Maxwell (JAM) // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp.services; import java.net.*; import javax.jnlp.*; /** * The ExtensionInstallerService JNLP service. * * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.6 $ */ class XExtensionInstallerService implements ExtensionInstallerService { protected XExtensionInstallerService() { } /** * */ public URL getExtensionLocation() { return null; } /** * */ public String getExtensionVersion() { return null; } /** * */ public String getInstalledJRE(java.net.URL url, java.lang.String version) { return null; } /** * */ public String getInstallPath() { return null; } /** * */ public void hideProgressBar() { } /** * */ public void hideStatusWindow() { } /** * */ public void installFailed() { } /** * */ public void installSucceeded(boolean needsReboot) { } /** * */ public void setHeading(java.lang.String heading) { } /** * */ public void setJREInfo(java.lang.String platformVersion, java.lang.String jrePath) { } /** * */ public void setNativeLibraryInfo(java.lang.String path) { } /** * */ public void setStatus(java.lang.String status) { } /** * */ public void updateProgress(int value) { } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/services/PaxHeaders.17941/XExtendedService.java0000644000000000000000000000013212654402377026376 xustar0030 mtime=1454507263.237432581 30 atime=1454507327.151580177 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/services/XExtendedService.java0000644000175000002070000000365212654402377027127 0ustar00jvanekmock00000000000000// Copyright (C) 2009 Red Hat, Inc. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp.services; import java.io.File; import java.io.IOException; import javax.jnlp.ExtendedService; import javax.jnlp.FileContents; import net.sourceforge.jnlp.security.SecurityDialogs.AccessType; /** * Implementation of ExtendedService * * @author Omair Majid * */ public class XExtendedService implements ExtendedService { public FileContents openFile(File file) throws IOException { File secureFile = new File(file.getPath()); /* FIXME: this opens a file with read/write mode, not just read or write */ if (ServiceUtil.checkAccess(AccessType.READ_FILE, new Object[] { secureFile.getAbsolutePath() })) { return (FileContents) ServiceUtil.createPrivilegedProxy(FileContents.class, new XFileContents(secureFile)); } else { return null; } } public FileContents[] openFiles(File[] files) throws IOException { FileContents[] contents = new FileContents[files.length]; for (int i = 0; i < files.length; i++) { contents[i] = openFile(files[i]); } return contents; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/services/PaxHeaders.17941/XDownloadService.java0000644000000000000000000000013212654402377026405 xustar0030 mtime=1454507263.236432594 30 atime=1454507327.151580177 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/services/XDownloadService.java0000644000175000002070000001735112654402377027137 0ustar00jvanekmock00000000000000// Copyright (C) 2001-2003 Jon A. Maxwell (JAM) // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp.services; import java.io.*; import java.net.*; import javax.jnlp.*; import net.sourceforge.jnlp.JARDesc; import net.sourceforge.jnlp.Version; import net.sourceforge.jnlp.cache.CacheUtil; import net.sourceforge.jnlp.runtime.JNLPClassLoader; import net.sourceforge.jnlp.runtime.ManageJnlpResources; import net.sourceforge.jnlp.runtime.JNLPRuntime; /** * The DownloadService JNLP service. * * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.7 $ */ class XDownloadService implements DownloadService { /** * Returns the {@link JNLPClassLoader} of the application * @return the {@link JNLPClassLoader} of the application */ JNLPClassLoader getClassLoader() { return (JNLPClassLoader) JNLPRuntime.getApplication().getClassLoader(); } /** * Returns a listener that will automatically display download * progress to the user. * @return always {@code null} */ public DownloadServiceListener getDefaultProgressWindow() { return null; } /** * Returns whether the part in an extension (specified by the * url and version) is cached locally. */ public boolean isExtensionPartCached(URL ref, String version, String part) { boolean allCached = true; Version resourceVersion = (version == null) ? null : new Version(version); JARDesc[] jars = ManageJnlpResources.findJars(this.getClassLoader(), ref, part, resourceVersion); if (jars.length <= 0) return false; for (int i = 0; i < jars.length && allCached; i++) { allCached = CacheUtil.isCached(jars[i].getLocation(), resourceVersion); } return allCached; } /** * Returns whether the parts in an extension (specified by the * url and version) are cached locally. */ public boolean isExtensionPartCached(URL ref, String version, String[] parts) { boolean allCached = true; if (parts.length <= 0) return false; for (String eachPart : parts) allCached = this.isExtensionPartCached(ref, version, eachPart); return allCached; } /** * Returns whether the part of the calling application is cached * locally. If called by code specified by an extension * descriptor, the specified part refers to the extension not * the application. */ public boolean isPartCached(String part) { boolean allCached = true; JARDesc[] jars = ManageJnlpResources.findJars(this.getClassLoader(), null, part, null); if (jars.length <= 0) return false; for (int i = 0; i < jars.length && allCached; i++) { allCached = CacheUtil.isCached(jars[i].getLocation(), null); } return allCached; } /** * Returns whether all of the parts of the calling application * are cached locally. If called by code in an extension, the * part refers the the part of the extension not the * application. */ public boolean isPartCached(String[] parts) { boolean allCached = true; if (parts.length <= 0) return false; for (String eachPart : parts) allCached = this.isPartCached(eachPart); return allCached; } /** * Returns whether the resource is cached locally. This method * only returns true if the resource is specified by the calling * application or extension. */ public boolean isResourceCached(URL ref, String version) { return ManageJnlpResources.isExternalResourceCached(this.getClassLoader(), ref, version); } /** * Downloads the parts of an extension. * * @throws IOException */ public void loadExtensionPart(URL ref, String version, String[] parts, DownloadServiceListener progress) throws IOException { for (String eachPart : parts) this.loadExtensionPart(ref, version, eachPart, progress); } /** * Downloads a part of an extension. * * @throws IOException */ public void loadExtensionPart(URL ref, String version, String part, DownloadServiceListener progress) throws IOException { Version resourceVersion = (version == null) ? null : new Version(version); ManageJnlpResources.downloadJars(this.getClassLoader(), ref, part, resourceVersion); } /** * Downloads the parts. * * @throws IOException */ public void loadPart(String[] parts, DownloadServiceListener progress) throws IOException { for (String eachPart : parts) this.loadPart(eachPart, progress); } /** * Downloads the part. * * @throws IOException */ public void loadPart(String part, DownloadServiceListener progress) throws IOException { ManageJnlpResources.downloadJars(this.getClassLoader(), null, part, null); } /** * Downloads a resource. * * @throws IOException */ public void loadResource(URL ref, String version, DownloadServiceListener progress) throws IOException { ManageJnlpResources.loadExternalResouceToCache(this.getClassLoader(), ref, version); } /** * Notify the system that an extension's part is no longer * important to cache. * * @throws IOException */ public void removeExtensionPart(URL ref, String version, String part) throws IOException { Version resourceVersion = (version == null) ? null : new Version(version); JARDesc[] jars = ManageJnlpResources.findJars(this.getClassLoader(), ref, part, resourceVersion); ManageJnlpResources.removeCachedJars(this.getClassLoader(), ref, jars); } /** * Notify the system that an extension's parts are no longer * important to cache. * * @throws IOException */ public void removeExtensionPart(URL ref, String version, String[] parts) throws IOException { for (String eachPart : parts) this.removeExtensionPart(ref, version, eachPart); } /** * Notifies the system that a part is no longer important to * cache. * * @throws IOException */ public void removePart(String part) throws IOException { JARDesc[] jars = ManageJnlpResources.findJars(this.getClassLoader(), null, part, null); ManageJnlpResources.removeCachedJars(this.getClassLoader(), null, jars); } /** * Notifies the system that the parts is no longer important to * cache. * * @throws IOException */ public void removePart(String[] parts) throws IOException { for (String eachPart : parts) this.removePart(eachPart); } /** * Notifies the system that the resource is no longer important * to cache. * * @throws IOException */ public void removeResource(URL ref, String version) throws IOException { ManageJnlpResources.removeExternalCachedResource(this.getClassLoader(), ref, version); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/services/PaxHeaders.17941/XClipboardService.java0000644000000000000000000000013212654402377026535 xustar0030 mtime=1454507263.236432594 30 atime=1454507327.151580177 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/services/XClipboardService.java0000644000175000002070000000550712654402377027267 0ustar00jvanekmock00000000000000/* XClipboardService.java Copyright (C) 2008 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.services; import javax.jnlp.*; import net.sourceforge.jnlp.security.SecurityDialogs.AccessType; import java.awt.datatransfer.Transferable; import java.awt.Toolkit; /** * The ClipboardService JNLP service. * * @author Joshua Sumali */ class XClipboardService implements ClipboardService { protected XClipboardService() { } /** * Returns the contents of the system clipboard. */ public java.awt.datatransfer.Transferable getContents() { if (ServiceUtil.checkAccess(AccessType.CLIPBOARD_READ)) { Transferable t = Toolkit.getDefaultToolkit().getSystemClipboard().getContents(null); return (Transferable) ServiceUtil.createPrivilegedProxy( Transferable.class, t); } else { return null; } } /** * Sets the contents of the system clipboard. */ public void setContents(java.awt.datatransfer.Transferable contents) { if (ServiceUtil.checkAccess(AccessType.CLIPBOARD_WRITE)) { Toolkit.getDefaultToolkit().getSystemClipboard().setContents( contents, null); } } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/services/PaxHeaders.17941/XBasicService.java0000644000000000000000000000013212654402377025657 xustar0030 mtime=1454507263.236432594 30 atime=1454507327.151580177 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/services/XBasicService.java0000644000175000002070000002275412654402377026414 0ustar00jvanekmock00000000000000// Copyright (C) 2001 Jon A. Maxwell (JAM) // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp.services; import static net.sourceforge.jnlp.runtime.Translator.R; import java.io.IOException; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URL; import java.net.URLConnection; import javax.jnlp.BasicService; import javax.swing.JOptionPane; import javax.swing.JPanel; import net.sourceforge.jnlp.InformationDesc; import net.sourceforge.jnlp.JARDesc; import net.sourceforge.jnlp.JNLPFile; import net.sourceforge.jnlp.Launcher; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.ApplicationInstance; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.util.logging.OutputController; /** * The BasicService JNLP service. * * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.10 $ */ class XBasicService implements BasicService { /** command used to exec the native browser */ private String command = null; /** whether the command was loaded / prompted for */ private boolean initialized = false; protected XBasicService() { } /** * Returns the codebase of the application, applet, or * installer. If the codebase was not specified in the JNLP * element then the main JAR's location is returned. If no main * JAR was specified then the location of the JAR containing the * main class is returned. */ @Override public URL getCodeBase() { ApplicationInstance app = JNLPRuntime.getApplication(); if (app != null) { JNLPFile file = app.getJNLPFile(); // return the codebase. if (file.getCodeBase() != null) return file.getCodeBase(); // else return the main JAR's URL. JARDesc mainJar = file.getResources().getMainJAR(); if (mainJar != null) return mainJar.getLocation(); // else find JAR where main class was defined. // // JNLPFile file = app.getJNLPFile(); // String mainClass = file.getLaunchInfo().getMainClass()+".class"; // URL jarUrl = app.getClassLoader().getResource(mainClass); // go through list of JARDesc to find one matching jarUrl } return null; } /** * Return true if the Environment is Offline */ @Override public boolean isOffline() { URL url = findFirstURLFromJNLPFile(); JNLPRuntime.detectOnline(url); return !JNLPRuntime.isOnline(); } /** * Return the first URL from the jnlp file * Or a default URL if no url found in JNLP file */ private URL findFirstURLFromJNLPFile() { ApplicationInstance app = JNLPRuntime.getApplication(); if (app != null) { JNLPFile jnlpFile = app.getJNLPFile(); URL sourceURL = jnlpFile.getSourceLocation(); if (sourceURL != null) { return sourceURL; } URL codeBaseURL = jnlpFile.getCodeBase(); if (codeBaseURL != null) { return codeBaseURL; } InformationDesc informationDesc = jnlpFile.getInformation(); URL homePage = informationDesc.getHomepage(); if (homePage != null) { return homePage; } JARDesc[] jarDescs = jnlpFile.getResources().getJARs(); for (JARDesc jarDesc : jarDescs) { return jarDesc.getLocation(); } } // this section is only reached if the jnlp file has no jars. // that doesnt seem very likely. URL arbitraryURL; try { arbitraryURL = new URL("http://icedtea.classpath.org"); } catch (MalformedURLException malformedURL) { throw new RuntimeException(malformedURL); } return arbitraryURL; } /** * Return true if a Web Browser is Supported */ @Override public boolean isWebBrowserSupported() { initialize(); return command != null; } /** * Show a document. * * @return whether the document was opened */ @Override public boolean showDocument(URL url) { initialize(); if (url.toString().endsWith(".jnlp")) { try { new Launcher().launchExternal(url); return true; } catch (Exception ex) { return false; } } if (command != null) { try { // this is bogus because the command may require options; // should use a StreamTokenizer or similar to get tokens // outside of quotes. Runtime.getRuntime().exec(command + " " + url.toString()); //Runtime.getRuntime().exec(new String[]{command,url.toString()}); return true; } catch (IOException ex) { OutputController.getLogger().log(ex); } } return false; } private void initialize() { if (initialized) return; initialized = true; initializeBrowserCommand(); OutputController.getLogger().log("browser is " + command); } /** * Initializes {@link #command} to launch a browser */ private void initializeBrowserCommand() { if (JNLPRuntime.isWindows()) { command = "rundll32 url.dll,FileProtocolHandler "; } else if (JNLPRuntime.isUnix()) { DeploymentConfiguration config = JNLPRuntime.getConfiguration(); command = config.getProperty(DeploymentConfiguration.KEY_BROWSER_PATH); if (command != null) { return; } if (posixCommandExists("xdg-open")) { command = "xdg-open"; return; } if (posixCommandExists(System.getenv("BROWSER"))) { command = System.getenv("BROWSER"); return; } while (true) { command = promptForCommand(command); if (command != null && posixCommandExists(command)) { config.setProperty(DeploymentConfiguration.KEY_BROWSER_PATH, command); try { config.save(); } catch (IOException e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); } break; } } } else { DeploymentConfiguration config = JNLPRuntime.getConfiguration(); command = config.getProperty(DeploymentConfiguration.KEY_BROWSER_PATH); if (command == null) { // prompt & store command = promptForCommand(null); if (command != null) { config.setProperty(DeploymentConfiguration.KEY_BROWSER_PATH, command); try { config.save(); } catch (IOException e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); } } } } } /** * Check that a command exists on a posix-like system * @param command the command to check * @return true if the command exists */ private boolean posixCommandExists(String command) { if (command == null || command.trim().length() == 0) { return false; } command = command.trim(); if (command.contains("\n") || command.contains("\r")) { return false; } try { Process p = Runtime.getRuntime().exec(new String[] { "bash", "-c", "type " + command }); p.waitFor(); return (p.exitValue() == 0); } catch (IOException e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); return false; } catch (InterruptedException e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); return false; } } private String promptForCommand(String previousCommand) { String message = null; if (previousCommand == null) { message = R("RBrowserLocationPromptMessage"); } else { message = R("RBrowserLocationPromptMessageWithReason", previousCommand); } return JOptionPane.showInputDialog(new JPanel(), R("RBrowserLocationPromptTitle"), message, JOptionPane.PLAIN_MESSAGE ); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/services/PaxHeaders.17941/SingleInstanceLock.java0000644000000000000000000000013212654402377026704 xustar0030 mtime=1454507263.235432608 30 atime=1454507327.151580177 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/services/SingleInstanceLock.java0000644000175000002070000001326212654402377027433 0ustar00jvanekmock00000000000000// Copyright (C) 2009 Red Hat, Inc. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp.services; import static net.sourceforge.jnlp.runtime.Translator.R; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.net.BindException; import java.net.ServerSocket; import net.sourceforge.jnlp.JNLPFile; import net.sourceforge.jnlp.config.PathsAndFiles; import net.sourceforge.jnlp.util.FileUtils; /** * This class represents a Lock for single instance jnlp applications * * The lock is per-session, per user. * * @author Omair Majid */ class SingleInstanceLock { JNLPFile jnlpFile; File lockFile = null; public static final int INVALID_PORT = Integer.MIN_VALUE; int port = INVALID_PORT; /** * Create an object to manage the instance lock for the specified JNLP file. * * @param jnlpFile the jnlpfile to create the lock for */ public SingleInstanceLock(JNLPFile jnlpFile) { this.jnlpFile = jnlpFile; lockFile = getLockFile(); } /** * Create/overwrite the instance lock for the jnlp file. * * @param localPort the network port for the lock * @throws IOException on any io problems */ public void createWithPort(int localPort) throws IOException { FileUtils.createRestrictedFile(lockFile, true); BufferedWriter lockFileWriter = new BufferedWriter(new FileWriter(lockFile, false)); lockFileWriter.write(String.valueOf(localPort)); lockFileWriter.newLine(); lockFileWriter.flush(); lockFileWriter.close(); } /** * Returns true if the lock if valid. That is, the lock exists, and port it * points to is listening for incoming messages. */ public boolean isValid() { return (exists() && getPort() != INVALID_PORT && !isPortFree(getPort())); } /** * Returns the port in this lock file. */ public int getPort() { if (!exists()) { return INVALID_PORT; } try { parseFile(); } catch (NumberFormatException e) { port = INVALID_PORT; } catch (IOException e) { port = INVALID_PORT; } return port; } /** * Returns true if the lock file already exists. */ private boolean exists() { return lockFile.exists(); } /** * Returns true if the port is free. */ private boolean isPortFree(int port) { try { ServerSocket socket = new ServerSocket(port); socket.close(); return true; } catch (BindException e) { return false; } catch (IOException e) { throw new RuntimeException(e); } } /** * Return a file object that represents the lock file. The lock file itself * may or may not exist. */ private File getLockFile() { File baseDir = PathsAndFiles.LOCKS_DIR.getFile(); if (!baseDir.isDirectory()) { if (!baseDir.getParentFile().isDirectory() && !baseDir.getParentFile().mkdirs()) { throw new RuntimeException(R("RNoLockDir", baseDir)); } try { FileUtils.createRestrictedDirectory(baseDir); } catch (IOException e) { throw new RuntimeException(R("RNoLockDir", baseDir)); } } String lockFileName = getLockFileName(); File applicationLockFile = new File(baseDir, lockFileName); return applicationLockFile; } /** * Returns the name of the lock file. */ private String getLockFileName() { String initialName = ""; if (jnlpFile.getSourceLocation() != null) { initialName = initialName + jnlpFile.getSourceLocation(); } else { initialName = initialName + jnlpFile.getFileLocation(); } if (jnlpFile.getFileVersion() != null) { initialName = initialName + jnlpFile.getFileVersion().toString(); } initialName = initialName + getCurrentDisplay(); return FileUtils.sanitizeFileName(initialName); } /** * Parse the lock file. * * @throws NumberFormatException * @throws IOException */ private void parseFile() throws NumberFormatException, IOException { BufferedReader lockFileReader = new BufferedReader(new FileReader(lockFile)); int port = Integer.valueOf(lockFileReader.readLine()); lockFileReader.close(); this.port = port; } /** * Returns a string identifying this display. * * Implementation note: On systems with X support, this is the DISPLAY * variable * * @return a string that is guaranteed to be not null. */ private String getCurrentDisplay() { String display = System.getenv("DISPLAY"); return (display == null) ? "" : display; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/services/PaxHeaders.17941/ServiceUtil.java0000644000000000000000000000013212654402377025423 xustar0030 mtime=1454507263.235432608 30 atime=1454507327.151580177 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/services/ServiceUtil.java0000644000175000002070000002770412654402377026160 0ustar00jvanekmock00000000000000// Copyright (C) 2001-2003 Jon A. Maxwell (JAM) // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp.services; import java.lang.reflect.InvocationHandler; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.security.AccessController; import java.security.PrivilegedAction; import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; import javax.jnlp.BasicService; import javax.jnlp.ClipboardService; import javax.jnlp.DownloadService; import javax.jnlp.ExtensionInstallerService; import javax.jnlp.FileOpenService; import javax.jnlp.FileSaveService; import javax.jnlp.PersistenceService; import javax.jnlp.PrintService; import javax.jnlp.ServiceManager; import javax.jnlp.SingleInstanceService; import javax.jnlp.UnavailableServiceException; import net.sourceforge.jnlp.JNLPFile; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.ApplicationInstance; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.security.SecurityDialogs; import net.sourceforge.jnlp.security.SecurityDialogs.AccessType; import net.sourceforge.jnlp.util.logging.OutputController; /** * Provides static methods to interact useful for using the JNLP * services. * * @author Jon A. Maxwell (JAM) - initial author * @author Joshua Sumali * @version $Revision: 1.8 $ */ public class ServiceUtil { /** * @return the BasicService reference, or null if the service is * unavailable. */ public static BasicService getBasicService() { return (BasicService) getService("javax.jnlp.BasicService"); } /** * @return the ClipboardService reference, or null if the service is * unavailable. */ public static ClipboardService getClipboardService() { return (ClipboardService) getService("javax.jnlp.ClipboardService"); } /** * @return the DownloadService reference, or null if the service is * unavailable. */ public static DownloadService getDownloadService() { return (DownloadService) getService("javax.jnlp.DownloadService"); } /** * @return the ExtensionInstallerService reference, or null if the service is * unavailable. */ public static ExtensionInstallerService getExtensionInstallerService() { return (ExtensionInstallerService) getService("javax.jnlp.ExtensionInstallerService"); } /** * @return the FileOpenService reference, or null if the service is * unavailable. */ public static FileOpenService getFileOpenService() { return (FileOpenService) getService("javax.jnlp.FileOpenService"); } /** * @return the FileSaveService reference, or null if the service is * unavailable. */ public static FileSaveService getFileSaveService() { return (FileSaveService) getService("javax.jnlp.FileSaveService"); } /** * @return the PersistenceService reference, or null if the service is * unavailable. */ public static PersistenceService getPersistenceService() { return (PersistenceService) getService("javax.jnlp.PersistenceService"); } /** * @return the PrintService reference, or null if the service is * unavailable. */ public static PrintService getPrintService() { return (PrintService) getService("javax.jnlp.PrintService"); } /** * @return the SingleInstanceService reference, or null if the service is * unavailable. */ public static SingleInstanceService getSingleInstanceService() { return (SingleInstanceService) getService("javax.jnlp.SingleInstanceService"); } /** * Checks that this application (represented by the jnlp) isnt already running * @param jnlpFile the {@link JNLPFile} that specifies the application * * @throws InstanceExistsException if an instance of this application already exists */ public static void checkExistingSingleInstance(JNLPFile jnlpFile) { ExtendedSingleInstanceService esis = (ExtendedSingleInstanceService) getSingleInstanceService(); esis.checkSingleInstanceRunning(jnlpFile); } /** * Returns the service, or null instead of an UnavailableServiceException */ private static Object getService(String name) { try { return ServiceManager.lookup(name); } catch (UnavailableServiceException ex) { return null; } } /** * Creates a Proxy object implementing the specified interface * when makes all calls in the security context of the system * classes (ie, AllPermissions). This means that the services * must be more than extremely careful in the operations they * perform. */ static Object createPrivilegedProxy(Class iface, final Object receiver) { return java.lang.reflect.Proxy.newProxyInstance(XServiceManagerStub.class.getClassLoader(), new Class[] { iface }, new PrivilegedHandler(receiver)); } /** * calls the object's method using privileged access */ private static class PrivilegedHandler implements InvocationHandler { private final Object receiver; PrivilegedHandler(Object receiver) { this.receiver = receiver; } @Override public Object invoke(Object proxy, final Method method, final Object[] args) throws Throwable { if (JNLPRuntime.isDebug()) { OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "call privileged method: " + method.getName()); if (args != null) { for (Object arg : args) { OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, " arg: " + arg); } } } PrivilegedExceptionAction invoker = new PrivilegedExceptionAction() { @Override public Object run() throws Exception { return method.invoke(receiver, args); } }; try { Object result = AccessController.doPrivileged(invoker); OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, " result: " + result); return result; } catch (PrivilegedActionException e) { // Any exceptions thrown by the actual methods are wrapped by a // InvocationTargetException, which is further wrapped by the // PrivilegedActionException. Lets unwrap them to make the // proxy transparent to the callers if (e.getCause() instanceof InvocationTargetException) { throw e.getCause().getCause(); } else { throw e.getCause(); } } } }; /** * Returns whether the app requesting a JNLP service has the right permissions. * If it doesn't, user is prompted for permissions. This method should only be * used for JNLP API related permissions. * * @param type the type of access being requested * @param extras extra Strings (usually) that are passed to the dialog for * message formatting. * @return true if the access was granted, false otherwise. */ public static boolean checkAccess(AccessType type, Object... extras) { return checkAccess(null, type, extras); } /** * Returns whether the app requesting a JNLP service has the right permissions. * If it doesn't, user is prompted for permissions. This method should only be * used for JNLP API related permissions. * * @param app the application which is requesting the check. If null, the current * application is used. * @param type the type of access being requested * @param extras extra Strings (usually) that are passed to the dialog for * message formatting. * @return true if the access was granted, false otherwise. */ public static boolean checkAccess(ApplicationInstance app, AccessType type, Object... extras) { boolean trusted = isSigned(app); if (!trusted) { if (!shouldPromptUser()) { return false; } if (app == null) { app = JNLPRuntime.getApplication(); } final AccessType tmpType = type; final Object[] tmpExtras = extras; final ApplicationInstance tmpApp = app; //We need to do this to allow proper icon loading for unsigned //applets, otherwise permissions won't be granted to load icons //from resources.jar. Boolean b = AccessController.doPrivileged(new PrivilegedAction() { @Override public Boolean run() { boolean b = SecurityDialogs.showAccessWarningDialogB(tmpType, tmpApp.getJNLPFile(), tmpExtras); return b; } }); return b; } return true; //allow } /** * Returns whether the current runtime configuration allows prompting the * user for JNLP permissions. * * @return true if the user should be prompted for JNLP API related permissions. */ private static boolean shouldPromptUser() { return AccessController.doPrivileged(new PrivilegedAction() { @Override public Boolean run() { return Boolean.valueOf(JNLPRuntime.getConfiguration() .getProperty(DeploymentConfiguration.KEY_SECURITY_PROMPT_USER_FOR_JNLP)); } }); } /** * Returns whether the app requesting a JNLP service is a trusted * application * * @param app * the application which is requesting the check. If null, the * current application is used. * @return true, if the app is a trusted application; false otherwise */ public static boolean isSigned(ApplicationInstance app) { if (app == null) { app = JNLPRuntime.getApplication(); } StackTraceElement[] stack = Thread.currentThread().getStackTrace(); for (StackTraceElement stack1 : stack) { Class c = null; try { c = Class.forName(stack1.getClassName()); } catch (Exception e1) { OutputController.getLogger().log(e1); try { c = Class.forName(stack1.getClassName(), false, app.getClassLoader()); }catch (Exception e2) { OutputController.getLogger().log(e2); } } // Everything up to the desired class/method must be trusted if (c == null || // class not found (c.getProtectionDomain().getCodeSource() != null && // class is not in bootclasspath c.getProtectionDomain().getCodeSource().getCodeSigners() == null) // class is trusted ) { return false; } } return true; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/services/PaxHeaders.17941/InstanceExistsException.java0000644000000000000000000000013112654402377030007 xustar0030 mtime=1454507263.235432608 29 atime=1454507327.15058019 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/services/InstanceExistsException.java0000644000175000002070000000232312654402377030533 0ustar00jvanekmock00000000000000// Copyright (C) 2009 Red Hat, Inc. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp.services; /** * * This class represents an exception indicating that an application instance * already exists for this jnlp file * * @author Omair Majid * */ public class InstanceExistsException extends RuntimeException { private static final long serialVersionUID = 7950552292795498272L; public InstanceExistsException(String message) { super(message); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/services/PaxHeaders.17941/ExtendedSingleInstanceService.0000644000000000000000000000013112654402377030232 xustar0030 mtime=1454507263.234432621 29 atime=1454507327.15058019 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/services/ExtendedSingleInstanceService.java0000644000175000002070000000325012654402377031620 0ustar00jvanekmock00000000000000// Copyright (C) 2009 Red Hat, Inc. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp.services; import javax.jnlp.SingleInstanceService; import net.sourceforge.jnlp.JNLPFile; /** * Extends SingleInstanceService to provide a few additional methods that are * required to initialize SingleInstanceService and check things. These methods * are not exposed publicly * * @author Omair Majid * */ interface ExtendedSingleInstanceService extends SingleInstanceService { /** * Check if the instance identified by this jnlp file is already running * * @param jnlpFile The JNLPFile that specifies the application * * @throws InstanceExistsException if an instance of this application * already exists * */ void checkSingleInstanceRunning(JNLPFile jnlpFile); /** * Start a single instance service based on the current application */ void initializeSingleInstance(); } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/security0000644000000000000000000000013212654402377022271 xustar0030 mtime=1454507263.234432621 30 atime=1454507658.780157344 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/0000755000175000002070000000000012654402377023071 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/PaxHeaders.17941/viewer0000644000000000000000000000013212654402377023572 xustar0030 mtime=1454507263.234432621 30 atime=1454507658.780157344 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/viewer/0000755000175000002070000000000012654402377024372 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/viewer/PaxHeaders.17941/CertificateViewer.java0000644000000000000000000000013112654402377030115 xustar0030 mtime=1454507263.234432621 29 atime=1454507327.15058019 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/viewer/CertificateViewer.java0000644000175000002070000000721312654402377030644 0ustar00jvanekmock00000000000000/* CertificateViewer.java Copyright (C) 2008 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.viewer; import static net.sourceforge.jnlp.runtime.Translator.R; import java.awt.BorderLayout; import java.awt.Container; import java.awt.Dimension; import java.awt.Frame; import java.awt.Toolkit; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import javax.swing.JDialog; import javax.swing.UIManager; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.util.ImageResources; import net.sourceforge.jnlp.util.ScreenFinder; public class CertificateViewer extends JDialog { private boolean initialized = false; private static final String dialogTitle = R("CVCertificateViewer"); CertificatePane panel; public CertificateViewer() { super((Frame) null, dialogTitle, true); setIconImages(ImageResources.INSTANCE.getApplicationImages()); Container contentPane = getContentPane(); contentPane.setLayout(new BorderLayout()); panel = new CertificatePane(this); add(panel); pack(); WindowAdapter adapter = new WindowAdapter() { private boolean gotFocus = false; public void windowGainedFocus(WindowEvent we) { // Once window gets focus, set initial focus if (!gotFocus) { panel.focusOnDefaultButton(); gotFocus = true; } } }; addWindowFocusListener(adapter); initialized = true; } public boolean isInitialized() { return initialized; } private void centerDialog() { ScreenFinder.centerWindowsToCurrentScreen(this); } public static void showCertificateViewer() throws Exception { JNLPRuntime.initialize(true); CertificateViewer cv = new CertificateViewer(); cv.setResizable(true); cv.centerDialog(); cv.setVisible(true); cv.dispose(); } public static void main(String[] args) throws Exception { CertificateViewer.showCertificateViewer(); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/viewer/PaxHeaders.17941/CertificatePane.java0000644000000000000000000000013112654402377027537 xustar0030 mtime=1454507263.234432621 29 atime=1454507327.15058019 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/viewer/CertificatePane.java0000644000175000002070000004770112654402377030274 0ustar00jvanekmock00000000000000/* CertificatePane.java Copyright (C) 2008 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.viewer; import static net.sourceforge.jnlp.runtime.Translator.R; import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyEvent; import java.io.File; import java.io.PrintStream; import java.security.KeyStore; import java.security.cert.Certificate; import java.security.cert.X509Certificate; import java.util.ArrayList; import java.util.Enumeration; import java.util.List; import javax.swing.BorderFactory; import javax.swing.JButton; import javax.swing.JComboBox; import javax.swing.JComponent; import javax.swing.JDialog; import javax.swing.JFileChooser; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JPasswordField; import javax.swing.JScrollPane; import javax.swing.JTabbedPane; import javax.swing.JTable; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import javax.swing.table.DefaultTableModel; import net.sourceforge.jnlp.security.CertificateUtils; import net.sourceforge.jnlp.security.KeyStores; import net.sourceforge.jnlp.security.SecurityUtil; import net.sourceforge.jnlp.security.SecurityDialog; import net.sourceforge.jnlp.security.KeyStores.Level; import net.sourceforge.jnlp.util.FileUtils; import net.sourceforge.jnlp.util.logging.OutputController; public class CertificatePane extends JPanel { /** * The certificates stored in the certificates file. */ private ArrayList certs = null; private static final Dimension TABLE_DIMENSION = new Dimension(500, 200); /** * "Issued To" and "Issued By" string pairs for certs. */ private String[][] issuedToAndBy = null; private final String[] columnNames = { R("CVIssuedTo"), R("CVIssuedBy") }; private final CertificateType[] certificateTypes = new CertificateType[] { new CertificateType(KeyStores.Type.CA_CERTS), new CertificateType(KeyStores.Type.JSSE_CA_CERTS), new CertificateType(KeyStores.Type.CERTS), new CertificateType(KeyStores.Type.JSSE_CERTS), new CertificateType(KeyStores.Type.CLIENT_CERTS) }; JTabbedPane tabbedPane; private final JTable userTable; private final JTable systemTable; private JComboBox certificateTypeCombo; private KeyStores.Type currentKeyStoreType; private KeyStores.Level currentKeyStoreLevel; /** JComponents that should be disbled for system store */ private final List disableForSystem; private JDialog parent; private JComponent defaultFocusComponent = null; /** * The Current KeyStore. Only one table/tab is visible for interaction to * the user. This KeyStore corresponds to that. */ private KeyStore keyStore = null; public CertificatePane(JDialog parent) { super(); this.parent = parent; userTable = new JTable(null); systemTable = new JTable(null); disableForSystem = new ArrayList<>(); addComponents(); currentKeyStoreType = ((CertificateType) (certificateTypeCombo.getSelectedItem())).getType(); if (tabbedPane.getSelectedIndex() == 0) { currentKeyStoreLevel = Level.USER; } else { currentKeyStoreLevel = Level.SYSTEM; } repopulateTables(); } /** * Reads the user's trusted.cacerts keystore. */ private void initializeKeyStore() { try { keyStore = KeyStores.getKeyStore(currentKeyStoreLevel, currentKeyStoreType); } catch (Exception e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); } } //create the GUI here. private void addComponents() { JPanel main = new JPanel(new BorderLayout()); JPanel certificateTypePanel = new JPanel(new BorderLayout()); certificateTypePanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); JLabel certificateTypeLabel = new JLabel(R("CVCertificateType")); certificateTypeCombo = new JComboBox<>(certificateTypes); certificateTypeCombo.addActionListener(new CertificateTypeListener()); certificateTypePanel.add(certificateTypeLabel, BorderLayout.LINE_START); certificateTypePanel.add(certificateTypeCombo, BorderLayout.CENTER); JPanel tablePanel = new JPanel(new BorderLayout()); // User Table DefaultTableModel userTableModel = new DefaultTableModel(issuedToAndBy, columnNames); userTable.setModel(userTableModel); userTable.getTableHeader().setReorderingAllowed(false); userTable.setFillsViewportHeight(true); JScrollPane userTablePane = new JScrollPane(userTable); userTablePane.setPreferredSize(TABLE_DIMENSION); userTablePane.setSize(TABLE_DIMENSION); userTablePane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); // System Table DefaultTableModel systemTableModel = new DefaultTableModel(issuedToAndBy, columnNames); systemTable.setModel(systemTableModel); systemTable.getTableHeader().setReorderingAllowed(false); systemTable.setFillsViewportHeight(true); JScrollPane systemTablePane = new JScrollPane(systemTable); systemTablePane.setPreferredSize(TABLE_DIMENSION); systemTablePane.setSize(TABLE_DIMENSION); systemTablePane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); tabbedPane = new JTabbedPane(); tabbedPane.addTab(R("CVUser"), userTablePane); tabbedPane.addTab(R("CVSystem"), systemTablePane); tabbedPane.addChangeListener(new TabChangeListener()); JPanel buttonPanel = new JPanel(new FlowLayout()); String[] buttonNames = { R("CVImport"), R("CVExport"), R("CVRemove"), R("CVDetails") }; char[] buttonMnemonics = { KeyEvent.VK_I, KeyEvent.VK_E, KeyEvent.VK_M, KeyEvent.VK_D }; ActionListener[] listeners = { new ImportButtonListener(), new ExportButtonListener(), new RemoveButtonListener(), new DetailsButtonListener() }; JButton button; //get the max width int maxWidth = 0; for (int i = 0; i < buttonNames.length; i++) { button = new JButton(buttonNames[i]); maxWidth = Math.max(maxWidth, button.getMinimumSize().width); } for (int i = 0; i < buttonNames.length; i++) { button = new JButton(buttonNames[i]); button.setMnemonic(buttonMnemonics[i]); button.addActionListener(listeners[i]); button.setSize(maxWidth, button.getSize().height); // import and remove buttons if (i == 0 || i == 2) { disableForSystem.add(button); } buttonPanel.add(button); } tablePanel.add(tabbedPane, BorderLayout.CENTER); tablePanel.add(buttonPanel, BorderLayout.SOUTH); main.add(certificateTypePanel, BorderLayout.NORTH); main.add(tablePanel, BorderLayout.CENTER); if (parent != null) { JPanel closePanel = new JPanel(new BorderLayout()); closePanel.setBorder(BorderFactory.createEmptyBorder(7, 7, 7, 7)); JButton closeButton = new JButton(R("ButClose")); closeButton.addActionListener(new CloseButtonListener()); defaultFocusComponent = closeButton; closePanel.add(closeButton, BorderLayout.EAST); main.add(closePanel, BorderLayout.SOUTH); } setLayout(new GridLayout(0,1)); add(main); } /** * Read in the optionPane's keystore to issuedToAndBy. */ private void readKeyStore() { Enumeration aliases = null; certs = new ArrayList<>(); try { //Get all of the X509Certificates and put them into an ArrayList aliases = keyStore.aliases(); while (aliases.hasMoreElements()) { Certificate c = keyStore.getCertificate(aliases.nextElement()); if (c instanceof X509Certificate) { certs.add((X509Certificate) c); } } //get the publisher and root information issuedToAndBy = new String[certs.size()][2]; for (int i = 0; i < certs.size(); i++) { X509Certificate c = certs.get(i); issuedToAndBy[i][0] = SecurityUtil.getCN(c.getSubjectX500Principal().getName()); issuedToAndBy[i][1] = SecurityUtil.getCN(c.getIssuerX500Principal().getName()); } } catch (Exception e) { // TODO handle exception OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); } } /** * Re-reads the certs file and repopulates the JTable. This is typically * called after a certificate was deleted from the keystore. */ private void repopulateTables() { initializeKeyStore(); readKeyStore(); DefaultTableModel tableModel = new DefaultTableModel(issuedToAndBy, columnNames); userTable.setModel(tableModel); tableModel = new DefaultTableModel(issuedToAndBy, columnNames); systemTable.setModel(tableModel); } public void focusOnDefaultButton() { if (defaultFocusComponent != null) { defaultFocusComponent.requestFocusInWindow(); } } private char[] getPassword(final String label) { JPasswordField jpf = new JPasswordField(); int result = JOptionPane.showConfirmDialog(parent, new Object[]{label, jpf}, R("CVPasswordTitle"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.INFORMATION_MESSAGE); if (result == JOptionPane.OK_OPTION) { return jpf.getPassword(); } return null; } /** Allows storing KeyStores.Types in a JComponent */ private static class CertificateType { private final KeyStores.Type type; public CertificateType(KeyStores.Type type) { this.type = type; } public KeyStores.Type getType() { return type; } @Override public String toString() { return KeyStores.toDisplayableString(null, type); } } /** Invoked when a user selects a different certificate type */ private class CertificateTypeListener implements ActionListener { @Override @SuppressWarnings("unchecked")//this is just certificateTypeCombo, nothing else public void actionPerformed(ActionEvent e) { JComboBox source = (JComboBox) e.getSource(); CertificateType type = (CertificateType) source.getSelectedItem(); currentKeyStoreType = type.getType(); repopulateTables(); } } /** * Invoked when a user selects a different tab (switches from user to system * or vice versa). Changes the currentKeyStore Enables or disables buttons. */ private class TabChangeListener implements ChangeListener { @Override public void stateChanged(ChangeEvent e) { JTabbedPane source = (JTabbedPane) e.getSource(); switch (source.getSelectedIndex()) { case 0: currentKeyStoreLevel = Level.USER; for (JComponent component : disableForSystem) { component.setEnabled(true); } break; case 1: currentKeyStoreLevel = Level.SYSTEM; for (JComponent component : disableForSystem) { component.setEnabled(false); } break; } repopulateTables(); } } private class ImportButtonListener implements ActionListener { @Override public void actionPerformed(ActionEvent e) { JFileChooser chooser = new JFileChooser(); int returnVal = chooser.showOpenDialog(parent); if (returnVal == JFileChooser.APPROVE_OPTION) { try { KeyStore ks = keyStore; if (currentKeyStoreType == KeyStores.Type.CLIENT_CERTS) { char[] password = getPassword(R("CVImportPasswordMessage")); if (password != null) { CertificateUtils.addPKCS12ToKeyStore( chooser.getSelectedFile(), ks, password); } else { return; } } else { CertificateUtils.addToKeyStore(chooser.getSelectedFile(), ks); } File keyStoreFile = KeyStores.getKeyStoreLocation(currentKeyStoreLevel, currentKeyStoreType).getFile(); if (!keyStoreFile.isFile()) { FileUtils.createRestrictedFile(keyStoreFile, true); } SecurityUtil.storeKeyStore(ks, keyStoreFile); repopulateTables(); } catch (Exception ex) { // TODO: handle exception OutputController.getLogger().log(OutputController.Level.ERROR_ALL, ex); } } } } private class ExportButtonListener implements ActionListener { @Override public void actionPerformed(ActionEvent e) { final JTable table ; if (currentKeyStoreLevel == Level.USER) { table = userTable; } else { table = systemTable; } //For now, let's just export in -rfc mode as keytool does. //we'll write to a file the exported certificate. try { int selectedRow = table.getSelectedRow(); if (selectedRow != -1) { JFileChooser chooser = new JFileChooser(); int returnVal = chooser.showOpenDialog(parent); if (returnVal == JFileChooser.APPROVE_OPTION) { String alias = keyStore.getCertificateAlias(certs .get(selectedRow)); if (alias != null) { if (currentKeyStoreType == KeyStores.Type.CLIENT_CERTS) { char[] password = getPassword(R("CVExportPasswordMessage")); if (password != null) { CertificateUtils.dumpPKCS12(alias, chooser.getSelectedFile(), keyStore, password); } } else { Certificate c = keyStore.getCertificate(alias); PrintStream ps = new PrintStream(chooser.getSelectedFile().getAbsolutePath()); CertificateUtils.dump(c, ps); } repopulateTables(); } } } } catch (Exception ex) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, ex); } } } private class RemoveButtonListener implements ActionListener { /** * Removes a certificate from the keyStore and writes changes to disk. */ @Override public void actionPerformed(ActionEvent e) { final JTable table; if (currentKeyStoreLevel == Level.USER) { table = userTable; } else { table = systemTable; } try { int selectedRow = table.getSelectedRow(); if (selectedRow != -1) { String alias = keyStore.getCertificateAlias(certs.get(selectedRow)); if (alias != null) { int i = JOptionPane.showConfirmDialog(parent, R("CVRemoveConfirmMessage"), R("CVRemoveConfirmTitle"), JOptionPane.YES_NO_OPTION); if (i == 0) { keyStore.deleteEntry(alias); File keyStoreFile = KeyStores.getKeyStoreLocation(currentKeyStoreLevel, currentKeyStoreType).getFile(); if (!keyStoreFile.isFile()) { FileUtils.createRestrictedFile(keyStoreFile, true); } SecurityUtil.storeKeyStore(keyStore, keyStoreFile); } } repopulateTables(); } } catch (Exception ex) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, ex); } } } private class DetailsButtonListener implements ActionListener { /** * Shows the details of a trusted certificate. */ @Override public void actionPerformed(ActionEvent e) { final JTable table; if (currentKeyStoreLevel == Level.USER) { table = userTable; } else { table = systemTable; } int selectedRow = table.getSelectedRow(); if (selectedRow != -1 && selectedRow >= 0) { X509Certificate c = certs.get(selectedRow); SecurityDialog.showSingleCertInfoDialog(c, parent); } } } private class CloseButtonListener implements ActionListener { @Override public void actionPerformed(ActionEvent e) { parent.dispose(); } } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/PaxHeaders.17941/policyeditor0000644000000000000000000000013212654402377024777 xustar0030 mtime=1454507263.233432634 30 atime=1454507658.780157344 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/policyeditor/0000755000175000002070000000000012654402377025577 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/policyeditor/PaxHeaders.17941/PolicyFileModel.j0000644000000000000000000000013112654402377030246 xustar0030 mtime=1454507263.233432634 29 atime=1454507327.15058019 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/policyeditor/PolicyFileModel.java0000644000175000002070000002652212654402377031471 0ustar00jvanekmock00000000000000/*Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.policyeditor; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.nio.channels.FileLock; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Collection; import java.util.Collections; import java.util.concurrent.ConcurrentHashMap; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Objects; import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; import net.sourceforge.jnlp.util.FileUtils; import net.sourceforge.jnlp.util.MD5SumWatcher; import net.sourceforge.jnlp.util.logging.OutputController; public class PolicyFileModel { private static final String AUTOGENERATED_NOTICE = "/* DO NOT MODIFY! AUTO-GENERATED */"; private File file; /** * Maps Codebases to Maps of Permissions and whether that Permission is set or not. The Codebase keys correspond to * the Codebases in the list UI, and the Permission->Boolean maps correspond to the checkboxes associated with * each Codebase. */ public final Map> codebasePermissionsMap = Collections.synchronizedMap(new HashMap>()); private final Map> customPermissionsMap = Collections.synchronizedMap(new HashMap>()); private MD5SumWatcher fileWatcher; PolicyFileModel(final String filepath) { this(new File(filepath)); } PolicyFileModel(final File file) { setFile(file); } PolicyFileModel() { } synchronized void setFile(final File file) { this.file = file; } synchronized File getFile() { return file; } /** * Open the file pointed to by the filePath field. This is either provided by the * "-file" command line flag, or if none given, comes from DeploymentConfiguration. */ synchronized void openAndParsePolicyFile() throws IOException, InvalidPolicyException { fileWatcher = new MD5SumWatcher(file); fileWatcher.update(); codebasePermissionsMap.clear(); customPermissionsMap.clear(); final FileLock fileLock = FileUtils.getFileLock(file.getAbsolutePath(), false, true); try { // User-level policy files are expected to be short enough that loading them in as a String // should not actually be *too* bad, and it's easy to work with. final String contents = FileUtils.loadFileAsString(file); final Set entries = parsePolicyString(contents); synchronized (codebasePermissionsMap) { synchronized (customPermissionsMap) { for (final PolicyEntry entry : entries) { addCodebase(entry.getCodebase()); for (final PolicyEditorPermissions permission : entry.getPermissions()) { setPermission(entry.getCodebase(), permission, true); } addCustomPermissions(entry.getCodebase(), entry.getCustomPermissions()); } } } } finally { try { fileLock.release(); } catch (final IOException e) { OutputController.getLogger().log(e); } } } static Set parsePolicyString(final String contents) throws InvalidPolicyException { final Set policyEntries = new HashSet<>(); StringBuilder sb = new StringBuilder(); // Split on newlines, both \r\n and \n style, for platform-independence final String[] lines = contents.split("\\r?\\n+"); boolean openBlock = false, closeBlock = false; for (final String line : lines) { // Matches eg `grant {` as well as `grant codeBase "http://redhat.com" {` final Pattern openBlockPattern = Pattern.compile("grant\\s*\"?\\s*(?:codeBase)?\\s*\"?[^\"\\s]*\"?\\s*\\{"); final Matcher openBlockMatcher = openBlockPattern.matcher(line); if (openBlockMatcher.matches()) { openBlock = true; } // Matches '};', the closing block delimiter, with any amount of whitespace on either side if (line.matches("\\s*\\};\\s*")) { closeBlock = true; } if (openBlock) { sb.append(line); sb.append('\n'); } if (openBlock && closeBlock) { openBlock = closeBlock = false; policyEntries.add(PolicyEntry.fromString(sb.toString())); sb = new StringBuilder(); } } return policyEntries; } /** * Save the policy model into the file pointed to by the filePath field. */ synchronized void savePolicyFile() throws FileNotFoundException, IOException { final StringBuilder sb = new StringBuilder(); sb.append(AUTOGENERATED_NOTICE); final String currentDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(Calendar.getInstance().getTime()); sb.append("\n/* Generated by PolicyEditor at ").append(currentDate).append(" */"); sb.append(System.getProperty("line.separator")); FileLock fileLock = null; try { fileLock = FileUtils.getFileLock(file.getAbsolutePath(), false, true); synchronized (codebasePermissionsMap) { for (final String codebase : codebasePermissionsMap.keySet()) { final Set enabledPermissions = new HashSet<>(); for (final Map.Entry entry : codebasePermissionsMap.get(codebase).entrySet()) { if (entry.getValue()) { enabledPermissions.add(entry.getKey()); } } sb.append(new PolicyEntry(codebase, enabledPermissions, customPermissionsMap.get(codebase)).toString()); } } } catch (final IOException e) { OutputController.getLogger().log(e); } finally { if (fileLock != null) { try { fileLock.release(); } catch (final IOException e) { OutputController.getLogger().log(e); } } } FileUtils.saveFile(sb.toString(), file); fileWatcher = new MD5SumWatcher(file); fileWatcher.update(); } synchronized boolean hasChanged() throws FileNotFoundException, IOException { return fileWatcher != null && fileWatcher.update(); } synchronized Set getCodebases() { return new HashSet<>(codebasePermissionsMap.keySet()); } /** * Add a new codebase. No action is taken if the codebase has already been added. * @param codebase for which a permissions mapping is required * @return true iff there was already an entry for this codebase */ synchronized boolean addCodebase(final String codebase) { Objects.requireNonNull(codebase); boolean existingCodebase = true; if (!codebasePermissionsMap.containsKey(codebase)) { final Map map = new HashMap<>(); for (final PolicyEditorPermissions perm : PolicyEditorPermissions.values()) { map.put(perm, false); } codebasePermissionsMap.put(codebase, map); existingCodebase = false; } if (!customPermissionsMap.containsKey(codebase)) { final Set set = new HashSet<>(); customPermissionsMap.put(codebase, set); existingCodebase = false; } return existingCodebase; } synchronized void clearPermissions() { codebasePermissionsMap.clear(); clearCustomPermissions(); } synchronized void removeCodebase(final String codebase) { Objects.requireNonNull(codebase); codebasePermissionsMap.remove(codebase); customPermissionsMap.remove(codebase); } synchronized void setPermission(final String codebase, final PolicyEditorPermissions permission, final boolean state) { Objects.requireNonNull(codebase); Objects.requireNonNull(permission); addCodebase(codebase); codebasePermissionsMap.get(codebase).put(permission, state); } synchronized boolean getPermission(final String codebase, final PolicyEditorPermissions permission) { Objects.requireNonNull(codebase); Objects.requireNonNull(permission); if (!codebasePermissionsMap.containsKey(codebase)) { return false; } return codebasePermissionsMap.get(codebase).get(permission); } synchronized Map> getCopyOfPermissions() { return new HashMap<>(codebasePermissionsMap); } synchronized void clearCustomPermissions() { customPermissionsMap.clear(); } synchronized void clearCustomCodebase(final String codebase) { Objects.requireNonNull(codebase); if (!customPermissionsMap.containsKey(codebase)) { return; } customPermissionsMap.get(codebase).clear(); } synchronized void addCustomPermissions(final String codebase, final Collection permissions) { Objects.requireNonNull(codebase); Objects.requireNonNull(permissions); addCodebase(codebase); customPermissionsMap.get(codebase).addAll(permissions); } synchronized Map> getCopyOfCustomPermissions() { return new HashMap<>(customPermissionsMap); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/policyeditor/PaxHeaders.17941/PolicyEntry.java0000644000000000000000000000013112654402377030177 xustar0030 mtime=1454507263.233432634 29 atime=1454507327.15058019 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/policyeditor/PolicyEntry.java0000644000175000002070000001715112654402377030730 0ustar00jvanekmock00000000000000/*Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.policyeditor; import java.util.Arrays; import java.util.Collection; import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * This class represents a codebase entry in a policy file. This is defined as a policy entry block * which begins with they keyword "grant" and ends with the delimiter "};". If the entry * contains a "codeBase $CODEBASE" substring after the "grant" keyword, then this information * is also included in this entry. Other entry "metadata" such as Principal is not defined. * Within a codebase entry block, lines are recognized and modelled as either PolicyEditorPermissions * or CustomPermissions. */ public class PolicyEntry { private final String codebase; private final Set permissions = new HashSet<>(); private final Set customPermissions = new HashSet<>(); public PolicyEntry(final String codebase, final Collection permissions, final Collection customPermissions) { if (codebase == null) { this.codebase = ""; } else { this.codebase = codebase; } this.permissions.addAll(permissions); this.permissions.remove(null); this.customPermissions.addAll(customPermissions); this.customPermissions.remove(null); } public String getCodebase() { return codebase; } public Set getPermissions() { return permissions; } public Set getCustomPermissions() { return customPermissions; } public static PolicyEntry fromString(final String contents) throws InvalidPolicyException { final List lines = Arrays.asList(contents.split("\\r?\\n+")); if (!validatePolicy(lines)) { throw new InvalidPolicyException(); } String codebase = ""; final Set permissions = new HashSet<>(); final Set customPermissions = new HashSet<>(); boolean openBlock = false, commentBlock = false; for (final String line : lines) { // Matches eg `grant {` as well as `grant codeBase "http://redhat.com" {` final Pattern openBlockPattern = Pattern.compile("grant\\s*\"?\\s*(?:codeBase)?\\s*\"?([^\"\\s]*)\"?\\s*\\{"); final Matcher openBlockMatcher = openBlockPattern.matcher(line); if (openBlockMatcher.matches()) { // Codebase URL codebase = openBlockMatcher.group(1); openBlock = true; continue; } // Matches '};', the closing block delimiter, with any amount of whitespace on either side boolean commentLine = false; if (line.matches("\\s*\\};\\s*")) { openBlock = false; } // Matches '/*', the start of a block comment if (line.matches(".*/\\*.*")) { commentBlock = true; } // Matches '*/', the end of a block comment, and '//', a single-line comment if (line.matches(".*\\*/.*")) { commentBlock = false; } if (line.matches(".*/\\*.*") && line.matches(".*\\*/.*")) { commentLine = true; } if (line.matches("\\s*//.*")) { commentLine = true; } if (!openBlock || commentBlock || commentLine) { continue; } final PolicyEditorPermissions perm = PolicyEditorPermissions.fromString(line); if (perm != null) { permissions.add(perm); } else { final CustomPermission cPerm = CustomPermission.fromString(line.trim()); if (cPerm != null) { customPermissions.add(cPerm); } } } return new PolicyEntry(codebase, permissions, customPermissions); } public static boolean validatePolicy(final String content) { return validatePolicy(Arrays.asList(content.split("\\r?\\n"))); } public static boolean validatePolicy(final List lines) { int openerCount = 0, closerCount = 0; for (final String line : lines) { final Pattern openBlockPattern = Pattern.compile("grant\\s*\"?\\s*(?:codeBase)?\\s*\"?([^\"\\s]*)\"?\\s*\\{"); final Matcher openBlockMatcher = openBlockPattern.matcher(line); if (openBlockMatcher.matches()) { ++openerCount; } if (line.matches("\\s*\\};\\s*")) { ++closerCount; } } return (openerCount == 1) && (closerCount == 1); } @Override public String toString() { // Empty codebase is the default "All Applets" codebase. If there are no permissions // applied to it, then don't bother recording it in the policy file. if (codebase.isEmpty() && permissions.isEmpty() && customPermissions.isEmpty()) { return ""; } final String newline = System.getProperty("line.separator"); final StringBuilder result = new StringBuilder(); result.append(newline); result.append("grant"); if (!codebase.isEmpty()) { result.append(" codeBase \""); result.append(codebase); result.append("\""); } result.append(" {"); result.append(newline); for (final PolicyEditorPermissions perm : permissions) { result.append("\t"); result.append(perm.toPermissionString()); result.append(newline); } for (final CustomPermission customPerm : customPermissions) { result.append("\t"); result.append(customPerm.toString().trim()); result.append(newline); } result.append("};"); result.append(newline); return result.toString(); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/policyeditor/PaxHeaders.17941/PolicyEditorPermi0000644000000000000000000000013112654402377030401 xustar0030 mtime=1454507263.232432648 29 atime=1454507327.15058019 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditorPermissions.java0000644000175000002070000003041412654402377033306 0ustar00jvanekmock00000000000000/*Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.policyeditor; import java.util.Map; import javax.swing.JCheckBox; import static net.sourceforge.jnlp.runtime.Translator.R; /** * Defines the set of default permissions for PolicyEditor, ie the ones which are assigned * dedicated checkboxes */ public enum PolicyEditorPermissions { READ_LOCAL_FILES(R("PEReadFiles"), R("PEReadFilesDetail"), PermissionType.FILE_PERMISSION, PermissionTarget.USER_HOME, PermissionActions.READ), WRITE_LOCAL_FILES(R("PEWriteFiles"), R("PEWriteFilesDetail"), PermissionType.FILE_PERMISSION, PermissionTarget.USER_HOME, PermissionActions.WRITE), DELETE_LOCAL_FILES(R("PEDeleteFiles"), R("PEDeleteFilesDetail"), PermissionType.FILE_PERMISSION, PermissionTarget.USER_HOME, PermissionActions.DELETE), READ_PROPERTIES(R("PEReadProps"), R("PEReadPropsDetail"), PermissionType.PROPERTY_PERMISSION, PermissionTarget.ALL, PermissionActions.READ), WRITE_PROPERTIES(R("PEWriteProps"), R("PEWritePropsDetail"), PermissionType.PROPERTY_PERMISSION, PermissionTarget.ALL, PermissionActions.WRITE), READ_SYSTEM_FILES(R("PEReadSystemFiles"), R("PEReadSystemFilesDetail"), PermissionType.FILE_PERMISSION, PermissionTarget.ALL_FILES, PermissionActions.READ), WRITE_SYSTEM_FILES(R("PEWriteSystemFiles"), R("PEWriteSystemFilesDetail"), PermissionType.FILE_PERMISSION, PermissionTarget.ALL_FILES, PermissionActions.WRITE), READ_TMP_FILES(R("PEReadTempFiles"), R("PEReadTempFilesDetail"), PermissionType.FILE_PERMISSION, PermissionTarget.TMPDIR, PermissionActions.READ), WRITE_TMP_FILES(R("PEWriteTempFiles"), R("PEWriteTempFilesDetail"), PermissionType.FILE_PERMISSION, PermissionTarget.TMPDIR, PermissionActions.WRITE), DELETE_TMP_FILES(R("PEDeleteTempFiles"), R("PEDeleteTempFilesDetail"), PermissionType.FILE_PERMISSION, PermissionTarget.TMPDIR, PermissionActions.DELETE), JAVA_REFLECTION(R("PEReflection"), R("PEReflectionDetail"), PermissionType.REFLECT_PERMISSION, PermissionTarget.REFLECT, PermissionActions.NONE), GET_CLASSLOADER(R("PEClassLoader"), R("PEClassLoaderDetail"), PermissionType.RUNTIME_PERMISSION, PermissionTarget.CLASSLOADER, PermissionActions.NONE), ACCESS_CLASS_IN_PACKAGE(R("PEClassInPackage"), R("PEClassInPackageDetail"), PermissionType.RUNTIME_PERMISSION, PermissionTarget.ACCESS_CLASS_IN_PACKAGE, PermissionActions.NONE), ACCESS_DECLARED_MEMBERS(R("PEDeclaredMembers"), R("PEDeclaredMembersDetail"), PermissionType.RUNTIME_PERMISSION, PermissionTarget.DECLARED_MEMBERS, PermissionActions.NONE), ACCESS_THREADS(R("PEAccessThreads"), R("PEAccessThreadsDetail"), PermissionType.RUNTIME_PERMISSION, PermissionTarget.ACCESS_THREADS, PermissionActions.NONE), ACCESS_THREAD_GROUPS(R("PEAccessThreadGroups"), R("PEAccessThreadGroupsDetail"), PermissionType.RUNTIME_PERMISSION, PermissionTarget.ACCESS_THREAD_GROUPS, PermissionActions.NONE), NETWORK(R("PENetwork"), R("PENetworkDetail"), PermissionType.SOCKET_PERMISSION, PermissionTarget.ALL, PermissionActions.NETALL), EXEC_COMMANDS(R("PEExec"), R("PEExecDetail"), PermissionType.FILE_PERMISSION, PermissionTarget.ALL_FILES, PermissionActions.EXECUTE), GET_ENV(R("PEGetEnv"), R("PEGetEnvDetail"), PermissionType.RUNTIME_PERMISSION, PermissionTarget.GETENV, PermissionActions.NONE), ALL_AWT(R("PEAWTPermission"), R("PEAWTPermissionDetail"), PermissionType.AWT_PERMISSION, PermissionTarget.ALL, PermissionActions.NONE), CLIPBOARD(R("PEClipboard"), R("PEClipboardDetail"), PermissionType.AWT_PERMISSION, PermissionTarget.CLIPBOARD, PermissionActions.NONE), PLAY_AUDIO(R("PEPlayAudio"), R("PEPlayAudioDetail"), PermissionType.AUDIO_PERMISSION, PermissionTarget.PLAY, PermissionActions.NONE), RECORD_AUDIO(R("PERecordAudio"), R("PERecordAudioDetail"), PermissionType.AUDIO_PERMISSION, PermissionTarget.RECORD, PermissionActions.NONE), PRINT(R("PEPrint"), R("PEPrintDetail"), PermissionType.RUNTIME_PERMISSION, PermissionTarget.PRINT, PermissionActions.NONE); public static enum Group { ReadFileSystem(R("PEGReadFileSystem"), READ_LOCAL_FILES, READ_PROPERTIES, READ_SYSTEM_FILES, READ_TMP_FILES, GET_ENV), WriteFileSystem(R("PEGWriteFileSystem"), WRITE_LOCAL_FILES, DELETE_LOCAL_FILES, WRITE_PROPERTIES, WRITE_SYSTEM_FILES, WRITE_TMP_FILES, DELETE_TMP_FILES, EXEC_COMMANDS), AccessUnownedCode(R("PEGAccesUnowenedCode"), JAVA_REFLECTION, GET_CLASSLOADER, ACCESS_CLASS_IN_PACKAGE, ACCESS_DECLARED_MEMBERS, ACCESS_THREADS, ACCESS_THREAD_GROUPS), MediaAccess(R("PEGMediaAccess"), PLAY_AUDIO, RECORD_AUDIO, PRINT, CLIPBOARD); private final PolicyEditorPermissions[] permissions; private final String title; private Group(final String title, final PolicyEditorPermissions... permissions) { this.title = title; this.permissions = permissions; } public static boolean anyContains(final PolicyEditorPermissions permission) { for (final Group g : Group.values()) { if (g.contains(permission)) { return true; } } return false; } public static boolean anyContains(final JCheckBox view, final Map checkboxMap) { for (final Map.Entry pairs : checkboxMap.entrySet()) { if (pairs.getValue() == view) { for (final Group g : Group.values()) { if (g.contains(pairs.getKey())) { return true; } } } } return false; } /* * + all is selected * 0 invalid * - none is selected */ public int getState (final Map map) { boolean allTrue = true; boolean allFalse = true; for (final PolicyEditorPermissions pp : getPermissions()) { final Boolean b = map.get(pp); if (b == null){ return 0; } if (b.booleanValue()){ allFalse = false; } else { allTrue = false; } } if (allFalse) { return -1; } if (allTrue) { return 1; } return 0; } public boolean contains(final PolicyEditorPermissions permission) { for (final PolicyEditorPermissions policyEditorPermissions : permissions) { if (policyEditorPermissions == permission) { return true; } } return false; } /** * Return title for policy extended by drop-down mark. * * @return title with down-pointing arrow */ public String getTitle() { return title + " ˇ"; } public PolicyEditorPermissions[] getPermissions() { return permissions; } } private final String name, description; private final PermissionType type; private final PermissionTarget target; private final PermissionActions actions; private PolicyEditorPermissions(final String name, final String description, final PermissionType type, final PermissionTarget target, final PermissionActions actions) { this.name = name; this.description = description; this.type = type; this.target = target; this.actions = actions; } /** * A short human-readable name for this permission * @return the name of this permission */ public String getName() { return this.name; } /** * A longer human-readable description for this permission * @return the description of this permission */ public String getDescription() { return this.description; } /** * @return the type of this permission, eg java.io.FilePermission */ public PermissionType getType() { return this.type; } /** * @return the target of this permission, eg ${user.home}${/}* */ public PermissionTarget getTarget() { return this.target; } /** * @return the actions of this permission, eg read,write */ public PermissionActions getActions() { return this.actions; } /** * A full String representation of this permission as it should appear when * written into a policy file * @return a policy file-ready String representation of this permission */ public String toPermissionString() { final StringBuilder sb = new StringBuilder(); sb.append("permission "); sb.append(this.type.type); sb.append(" \""); sb.append(this.target.target); sb.append("\""); if (!this.actions.equals(PermissionActions.NONE)) { sb.append(", \""); sb.append(setToActionList(this.actions.getActions().toString())); sb.append("\""); } sb.append(";"); return sb.toString(); } private static String setToActionList(final String string) { return string.replaceAll("[\\[\\]\\s]", ""); } /** * Get a PolicyEditorPermissions instance matching the input string * @param string a full policy file permissions line, eg `permission java.io.FilePermission "${io.tmpdir}" "read;"` * @return the PolicyEditorPermissions value matching the input String, or null if no such match is found */ public static PolicyEditorPermissions fromString(final String string) { final CustomPermission tmpPerm = CustomPermission.fromString(string); if (tmpPerm == null) { return null; } final PermissionType type = PermissionType.fromString(tmpPerm.type); final PermissionTarget target = PermissionTarget.fromString(tmpPerm.target); final PermissionActions actions = PermissionActions.fromString(tmpPerm.actions); for (final PolicyEditorPermissions perm : PolicyEditorPermissions.values()) { final boolean sameType = perm.type.equals(type); final boolean sameTarget = perm.target.equals(target); final boolean sameActions = perm.actions.getActions().equals(actions.getActions()); if (sameType && sameTarget && sameActions) { return perm; } } return null; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/policyeditor/PaxHeaders.17941/PolicyEditorContr0000644000000000000000000000013212654402377030413 xustar0030 mtime=1454507263.232432648 30 atime=1454507327.149580203 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditorController.java0000644000175000002070000002145012654402377033116 0ustar00jvanekmock00000000000000/*Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.policyeditor; import java.awt.Toolkit; import java.awt.datatransfer.DataFlavor; import java.awt.datatransfer.StringSelection; import java.awt.datatransfer.Transferable; import java.awt.datatransfer.UnsupportedFlavorException; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.util.Arrays; import java.util.Collection; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; import net.sourceforge.jnlp.util.logging.OutputController; public class PolicyEditorController { public final PolicyFileModel policyFile = new PolicyFileModel(); private volatile boolean changesMade = false; private volatile boolean performingIO = false; boolean changesMade() { return changesMade; } void setChangesMade(final boolean b) { changesMade = b; } boolean performingIO() { return performingIO; } void setPerformingIO(final boolean b) { performingIO = b; } public void setFile(final File file) { setChangesMade(true); policyFile.setFile(file); } public File getFile() { return policyFile.getFile(); } public boolean fileHasChanged() throws FileNotFoundException, IOException { return policyFile.hasChanged(); } public boolean addCodebase(final String codebase) { final boolean existed = policyFile.addCodebase(codebase); if (!existed) { setChangesMade(true); } return existed; } public void removeCodebase(final String codebase) { setChangesMade(true); policyFile.removeCodebase(codebase); } public Set getCodebases() { return new HashSet<>(policyFile.getCodebases()); } public Map> getCopyOfPermissions() { return policyFile.getCopyOfPermissions(); } public void setPermission(final String codebase, final PolicyEditorPermissions permission, final boolean state) { if (getPermission(codebase, permission) != state) { setChangesMade(true); } policyFile.setPermission(codebase, permission, state); } public boolean getPermission(final String codebase, final PolicyEditorPermissions permission) { return policyFile.getPermission(codebase, permission); } public Map getPermissions(final String codebase) { policyFile.addCodebase(codebase); return new HashMap<>(policyFile.getCopyOfPermissions().get(codebase)); } public void clearPermissions() { setChangesMade(true); policyFile.clearPermissions(); } public void addCustomPermissions(final String codebase, final Collection permissions) { if (!policyFile.getCopyOfCustomPermissions().equals(permissions)) { setChangesMade(true); } policyFile.addCustomPermissions(codebase, permissions); } public void addCustomPermission(final String codebase, final CustomPermission permission) { final Map> customs = policyFile.getCopyOfCustomPermissions(); if (customs == null || !customs.containsKey(codebase) || (customs.containsKey(codebase) && !customs.get(codebase).contains(permission))) { setChangesMade(true); } addCustomPermissions(codebase, Arrays.asList(permission)); } public Set getCustomPermissions(final String codebase) { policyFile.addCodebase(codebase); return new HashSet<>(policyFile.getCopyOfCustomPermissions().get(codebase)); } public void addPolicyEntry(final PolicyEntry policyEntry) { addCodebase(policyEntry.getCodebase()); for (final PolicyEditorPermissions permission : policyEntry.getPermissions()) { setPermission(policyEntry.getCodebase(), permission, true); } addCustomPermissions(policyEntry.getCodebase(), policyEntry.getCustomPermissions()); } public void clearCustomPermissions() { setChangesMade(true); policyFile.clearCustomPermissions(); } public void clearCustomCodebase(final String codebase) { setChangesMade(true); policyFile.clearCustomCodebase(codebase); } public void openAndParsePolicyFile() throws IOException, InvalidPolicyException { try { policyFile.getFile().createNewFile(); } catch (final IOException e) { OutputController.getLogger().log(e); } setPerformingIO(true); policyFile.openAndParsePolicyFile(); setChangesMade(false); setPerformingIO(false); } public void savePolicyFile() throws FileNotFoundException, IOException { setPerformingIO(true); policyFile.savePolicyFile(); setChangesMade(false); setPerformingIO(false); } public void copyCodebaseToClipboard(final String codebase) { final Map standardPermissions = policyFile.getCopyOfPermissions().get(codebase); final Set customPermissions = policyFile.getCopyOfCustomPermissions().get(codebase); final Set enabledPermissions = new HashSet<>(); for (final Map.Entry entry : standardPermissions.entrySet()) { if (entry.getValue()) { enabledPermissions.add(entry.getKey()); } } final PolicyEntry entry = new PolicyEntry(codebase, enabledPermissions, customPermissions); final StringSelection clipboardSelection = new StringSelection(entry.toString()); Toolkit.getDefaultToolkit().getSystemClipboard().setContents(clipboardSelection, clipboardSelection); } private static String getClipboardContentsAsString() throws IOException, UnsupportedFlavorException { final Transferable transferable = Toolkit.getDefaultToolkit().getSystemClipboard().getContents(null); return (String) transferable.getTransferData(DataFlavor.stringFlavor); } public static PolicyEntry getPolicyEntryFromClipboard() throws IOException, UnsupportedFlavorException, InvalidPolicyException { return PolicyEntry.fromString(getClipboardContentsAsString()); } public String getCodebaseFromClipboard() throws IOException, UnsupportedFlavorException, InvalidPolicyException { return getPolicyEntryFromClipboard().getCodebase(); } public Map getPermissionsFromClipboard() throws IOException, UnsupportedFlavorException, InvalidPolicyException { final Map ret = new HashMap<>(); final Set enabledPermissions = getPolicyEntryFromClipboard().getPermissions(); for (final PolicyEditorPermissions permission : PolicyEditorPermissions.values()) { ret.put(permission, enabledPermissions.contains(permission)); } return ret; } public Set getCustomPermissionsFromClipboard() throws IOException, UnsupportedFlavorException, InvalidPolicyException { return getPolicyEntryFromClipboard().getCustomPermissions(); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/policyeditor/PaxHeaders.17941/PolicyEditorAbout0000644000000000000000000000013212654402377030400 xustar0030 mtime=1454507263.232432648 30 atime=1454507327.149580203 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditorAboutDialog.java0000644000175000002070000001204312654402377033163 0ustar00jvanekmock00000000000000package net.sourceforge.jnlp.security.policyeditor; import net.sourceforge.jnlp.util.logging.OutputController; import javax.swing.border.EmptyBorder; import javax.swing.event.HyperlinkEvent; import javax.swing.event.HyperlinkListener; import javax.swing.text.html.HTMLEditorKit; import javax.swing.JFrame; import javax.swing.JScrollPane; import javax.swing.JTextPane; import javax.swing.JPanel; import javax.swing.JButton; import javax.swing.ScrollPaneConstants; import javax.swing.KeyStroke; import java.awt.GridBagLayout; import java.awt.BorderLayout; import java.awt.GridBagConstraints; import java.awt.Insets; import java.awt.Dimension; import java.awt.Desktop; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.io.IOException; import java.net.URISyntaxException; import static net.sourceforge.jnlp.runtime.Translator.R; public class PolicyEditorAboutDialog extends JFrame { private final String content; private final JScrollPane scrollPane = new JScrollPane(); private final JTextPane textArea = new JTextPane(); private final JPanel noWrapPanel = new JPanel(); private final JButton closeButton = new JButton(R("ButClose")); private final ActionListener closeButtonAction; private final KeyListener closeKeyListener; public PolicyEditorAboutDialog(final String title, final String content) { super(title); this.content = content; setupLayout(); closeButtonAction = new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { close(); } }; closeButton.addActionListener(closeButtonAction); closeKeyListener = new CloseKeyListener(); scrollPane.addKeyListener(closeKeyListener); textArea.addKeyListener(closeKeyListener); noWrapPanel.addKeyListener(closeKeyListener); closeButton.addKeyListener(closeKeyListener); setDefaultCloseOperation(DISPOSE_ON_CLOSE); } private void close() { this.setVisible(false); this.dispose(); } private void setupLayout() { setLayout(new GridBagLayout()); textArea.setEditorKit(new HTMLEditorKit()); textArea.setContentType("text/html"); textArea.setText(content); textArea.setEditable(false); textArea.addHyperlinkListener(new UrlHyperlinkListener()); noWrapPanel.setLayout(new BorderLayout()); noWrapPanel.add(textArea, BorderLayout.CENTER); scrollPane.setViewportView(textArea); textArea.setCaretPosition(0); scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); final GridBagConstraints panelConstraints = new GridBagConstraints(); panelConstraints.gridwidth = 3; panelConstraints.weighty = 1.0; panelConstraints.fill = GridBagConstraints.BOTH; final EmptyBorder scrollPaneBorder = new EmptyBorder(5, 5, 5, 5); scrollPane.setBorder(scrollPaneBorder); final EmptyBorder textAreaBorder = new EmptyBorder(0, 10, 10, 10); textArea.setBorder(textAreaBorder); add(scrollPane, panelConstraints); final GridBagConstraints closeButtonConstraints = new GridBagConstraints(); closeButtonConstraints.weightx = 1.0; closeButtonConstraints.weighty = 0.0; closeButtonConstraints.gridx = 1; closeButtonConstraints.gridy = 1; closeButtonConstraints.insets = new Insets(0, 0, 5, 0); add(closeButton, closeButtonConstraints); setMinimumSize(new Dimension(500, 400)); setPreferredSize(getMinimumSize()); pack(); } private class CloseKeyListener implements KeyListener { @Override public void keyTyped(final KeyEvent e) { } @Override public void keyPressed(final KeyEvent e) { if (e.getExtendedKeyCode() == KeyStroke.getKeyStroke(R("PEAboutPolicyEditorCloseAccelerator")).getKeyCode() || e.getExtendedKeyCode() == KeyEvent.VK_ESCAPE) { close(); } } @Override public void keyReleased(final KeyEvent e) { } } private static class UrlHyperlinkListener implements HyperlinkListener { @Override public void hyperlinkUpdate(HyperlinkEvent event) { if (Desktop.isDesktopSupported() && event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { try { Desktop.getDesktop().browse(event.getURL().toURI()); } catch (final URISyntaxException | IOException ex) { OutputController.getLogger().log(ex); } } } } public static void main(final String[] args) { final PolicyEditorAboutDialog dialog = new PolicyEditorAboutDialog(R("PEHelpDialogTitle"), R("PEHelpDialogContent")); dialog.setVisible(true); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/policyeditor/PaxHeaders.17941/PolicyEditor.java0000644000000000000000000000013212654402377030325 xustar0030 mtime=1454507263.231432661 30 atime=1454507327.149580203 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditor.java0000644000175000002070000021000712654402377031050 0ustar00jvanekmock00000000000000/*Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.policyeditor; import static net.sourceforge.jnlp.runtime.Translator.R; import java.awt.Color; import java.awt.Container; import java.awt.Dialog.ModalityType; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.Window; import java.awt.datatransfer.UnsupportedFlavorException; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyEvent; import java.awt.event.KeyAdapter; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.lang.ref.WeakReference; import java.lang.reflect.InvocationTargetException; import java.net.MalformedURLException; import java.net.URISyntaxException; import java.net.URI; import java.net.URL; import java.util.ArrayList; import java.util.Collection; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Set; import java.util.TreeMap; import javax.swing.AbstractAction; import javax.swing.AbstractButton; import javax.swing.Action; import javax.swing.ActionMap; import javax.swing.DefaultListModel; import javax.swing.InputMap; import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JDialog; import javax.swing.JFileChooser; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JList; import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JMenuItem; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.KeyStroke; import javax.swing.ListSelectionModel; import javax.swing.ScrollPaneConstants; import javax.swing.SwingUtilities; import javax.swing.SwingWorker; import javax.swing.UIManager; import javax.swing.WindowConstants; import javax.swing.border.EmptyBorder; import javax.swing.border.LineBorder; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import net.sourceforge.jnlp.about.AboutDialog; import net.sourceforge.jnlp.OptionsDefinitions; import net.sourceforge.jnlp.config.PathsAndFiles; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.security.policyeditor.PolicyEditorPermissions.Group; import net.sourceforge.jnlp.util.FileUtils; import net.sourceforge.jnlp.util.FileUtils.OpenFileResult; import net.sourceforge.jnlp.util.docprovider.PolicyEditorTextsProvider; import net.sourceforge.jnlp.util.docprovider.TextsProvider; import net.sourceforge.jnlp.util.docprovider.formatters.formatters.PlainTextFormatter; import net.sourceforge.jnlp.util.logging.OutputController; import net.sourceforge.jnlp.util.optionparser.OptionParser; /** * This class provides a policy editing tool as a simpler alternate to * the JDK PolicyTool. It is much simpler than PolicyTool - only * a handful of pre-defined permissions can be enabled or disabled, * on a per-codebase basis. There are no considerations for Principals, * who signed the code, or custom permissions. * * This editor has a very simple idea of a policy file's contents. If any * entries are found which it does not recognize, eg 'grant' blocks which * have more than zero or one simple codeBase attributes, or 'Principal' * or other attributes assigned to the "grant block", or any other type * of complication to a "grant block" beyond a single codebase, * then all of these pieces of data are disregarded. When the editor saves * its work, all of this unrecognized data will be overwritten. Since * the editor has no way to display any of these contents anyway, it would * be potentially dangerous to allow this information to persist in the * policy file even after it has been edited and saved, as this would mean * the policy file contents may not be what the user thinks they are. * * Comments in policy files are loosely supported, using both block-style * comment delimiters and double slashes. Block comments may not, however, * be placed on a line with "functional" text on the same line. To be * safe, comments should not be adjacent to "functional" text in the file * unless those lines are intended to be disregarded, ie commented out. * Comments will *not* be preserved when PolicyEditor next saves to the * file. */ public class PolicyEditor extends JPanel { /** * Command line switch to print a help message. */ public static final String HELP_FLAG = OptionsDefinitions.OPTIONS.HELP1.option; /** * Command line switch to specify the location of the policy file. * If not given, then the default DeploymentConfiguration path is used. */ public static final String FILE_FLAG = OptionsDefinitions.OPTIONS.FILE.option; /** * Command line switch to specify a new codebase entry to be made. * Can only be used once, presently. */ public static final String CODEBASE_FLAG = OptionsDefinitions.OPTIONS.CODEBASE.option; private boolean closed = false; private final Map checkboxMap = new TreeMap<>(); private final List groupBoxList = new ArrayList<>(Group.values().length); private final JScrollPane scrollPane = new JScrollPane(); private final DefaultListModel listModel = new DefaultListModel<>(); private final JList list = new JList<>(listModel); private final JButton okButton = new JButton(), closeButton = new JButton(), addCodebaseButton = new JButton(), removeCodebaseButton = new JButton(); private final JFileChooser fileChooser; private CustomPolicyViewer cpViewer = null; /** * See showChangesSavedDialog/showCouldNotSaveDialog. This weak reference is needed because * there is a modal child dialog which can sometimes appear after the editor has been closed * and disposed. In this case, its parent should be set to 'null', but otherwise the parent * should be the editor so that the dialog is modal. */ private final WeakReference parentPolicyEditor = new WeakReference<>(this); public final PolicyEditorController policyEditorController = new PolicyEditorController(); private final ActionListener okButtonAction, addCodebaseButtonAction, removeCodebaseButtonAction, newButtonAction, openButtonAction, openDefaultButtonAction, saveAsButtonAction, viewCustomButtonAction, renameCodebaseButtonAction, copyCodebaseButtonAction, pasteCodebaseButtonAction, policyEditorHelpButtonAction, aboutPolicyEditorButtonAction, aboutItwButtonAction; private final ActionListener closeButtonAction; private static class JCheckBoxWithGroup extends JCheckBox { private final PolicyEditorPermissions.Group group; private JCheckBoxWithGroup(Group group) { super(group.getTitle()); this.group = group; } public Group getGroup() { return group; } private void setState(final Map map) { final List backup = new LinkedList<>(); for (final ActionListener l : this.getActionListeners()) { backup.add(l); this.removeActionListener(l); } final int i = group.getState(map); this.setBackground(getParent().getBackground()); if (i > 0) { this.setSelected(true); } if (i < 0) { this.setSelected(false); } if (i == 0) { this.setBackground(Color.yellow); this.setSelected(false); } for (final ActionListener al : backup) { this.addActionListener(al); } } } public PolicyEditor(final String filepath) { super(); setLayout(new GridBagLayout()); for (final PolicyEditorPermissions perm : PolicyEditorPermissions.values()) { final JCheckBox box = new JCheckBox(); box.setText(perm.getName()); box.setToolTipText(perm.getDescription()); checkboxMap.put(perm, box); } setFile(filepath); if (filepath != null) { try { policyEditorController.openAndParsePolicyFile(); } catch (final FileNotFoundException fnfe) { OutputController.getLogger().log(fnfe); FileUtils.showCouldNotOpenDialog(PolicyEditor.this, R("PECouldNotOpen")); } catch (final IOException | InvalidPolicyException e) { OutputController.getLogger().log(e); OutputController.getLogger().log(OutputController.Level.ERROR_ALL, R("RCantOpenFile", policyEditorController.getFile().getPath())); FileUtils.showCouldNotOpenDialog(PolicyEditor.this, R("PECouldNotOpen")); } try { invokeRunnableOrEnqueueAndWait(new Runnable() { @Override public void run() { for (final String codebase : policyEditorController.getCodebases()) { final String model; if (codebase.isEmpty()) { model = R("PEGlobalSettings"); } else { model = codebase; } if (!listModel.contains(model)) { listModel.addElement(model); } } addNewCodebase(""); } }); } catch (final InvocationTargetException | InterruptedException e) { OutputController.getLogger().log(e); } } setChangesMade(false); fileChooser = new JFileChooser(policyEditorController.getFile()); fileChooser.setFileHidingEnabled(false); okButtonAction = new ActionListener() { @Override public void actionPerformed(final ActionEvent event) { if (policyEditorController.getFile() == null) { final int choice = fileChooser.showOpenDialog(PolicyEditor.this); if (choice == JFileChooser.APPROVE_OPTION) { PolicyEditor.this.setFile(fileChooser.getSelectedFile().getAbsolutePath()); } } // May still be null if user cancelled the file chooser if (policyEditorController.getFile() != null) { savePolicyFile(); } } }; okButton.setText(R("ButApply")); okButton.addActionListener(okButtonAction); addCodebaseButtonAction = new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { addNewCodebaseInteractive(); } }; addCodebaseButton.setText(R("PEAddCodebase")); addCodebaseButton.addActionListener(addCodebaseButtonAction); removeCodebaseButtonAction = new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { removeCodebase(getSelectedCodebase()); } }; removeCodebaseButton.setText(R("PERemoveCodebase")); removeCodebaseButton.addActionListener(removeCodebaseButtonAction); newButtonAction = new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { if (!promptOnSaveChangesMade(false)) return; setFile(null); setChangesMade(false); } }; openButtonAction = new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { if (!promptOnSaveChangesMade(true)) return; final int choice = fileChooser.showOpenDialog(PolicyEditor.this); if (choice == JFileChooser.APPROVE_OPTION) { PolicyEditor.this.setFile(fileChooser.getSelectedFile().getAbsolutePath()); openAndParsePolicyFile(); } } }; openDefaultButtonAction = new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { if (!promptOnSaveChangesMade(true)) { return; } try { PolicyEditor.this.setFile(getDefaultPolicyFilePath()); PolicyEditor.this.getFile().createNewFile(); } catch (final IOException ex) { OutputController.getLogger().log(ex); } catch (final URISyntaxException ex) { OutputController.getLogger().log(ex); } openAndParsePolicyFile(); } }; saveAsButtonAction = new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { final int choice = fileChooser.showSaveDialog(PolicyEditor.this); if (choice == JFileChooser.APPROVE_OPTION) { PolicyEditor.this.setFile(fileChooser.getSelectedFile().getAbsolutePath()); setChangesMade(true); savePolicyFile(); } } }; renameCodebaseButtonAction = new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { final String oldCodebase = getSelectedCodebase(); if (oldCodebase.isEmpty()) { return; } String newCodebase = ""; while (!validateCodebase(newCodebase) || policyEditorController.getCopyOfPermissions().containsKey(newCodebase)) { newCodebase = JOptionPane.showInputDialog(PolicyEditor.this, R("PERenameCodebase"), oldCodebase); if (newCodebase == null) { return; } } renameCodebase(oldCodebase, newCodebase); } }; copyCodebaseButtonAction = new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { copyCodebase(getSelectedCodebase()); } }; pasteCodebaseButtonAction = new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { String clipboardCodebase = null; try { clipboardCodebase = policyEditorController.getCodebaseFromClipboard(); final String newCodebase; if (getCodebases().contains(clipboardCodebase)) { String cb = ""; while (!validateCodebase(cb) || policyEditorController.getCopyOfPermissions().containsKey(cb)) { cb = JOptionPane.showInputDialog(PolicyEditor.this, R("PEPasteCodebase"), "http://"); if (cb == null) { return; } } newCodebase = cb; } else { newCodebase = clipboardCodebase; } if (validateCodebase(newCodebase)) { pasteCodebase(newCodebase); } } catch (final UnsupportedFlavorException ufe) { OutputController.getLogger().log(ufe); showClipboardErrorDialog(); } catch (final InvalidPolicyException ipe) { OutputController.getLogger().log(ipe); showInvalidPolicyExceptionDialog(clipboardCodebase); } catch (final IOException ioe) { OutputController.getLogger().log(ioe); showCouldNotAccessClipboardDialog(); } } }; viewCustomButtonAction = new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { invokeRunnableOrEnqueueLater(new Runnable() { @Override public void run() { String codebase = getSelectedCodebase(); if (codebase == null) { return; } if (cpViewer == null) { cpViewer = new CustomPolicyViewer(PolicyEditor.this, codebase); cpViewer.setVisible(true); } else { cpViewer.toFront(); cpViewer.repaint(); } } }); } }; policyEditorHelpButtonAction = new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { new PolicyEditorAboutDialog(R("PEHelpDialogTitle"), R("PEHelpDialogContent")).setVisible(true); } }; aboutPolicyEditorButtonAction = new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { boolean modal = getModality(); AboutDialog.display(modal, TextsProvider.POLICY_EDITOR,AboutDialog.ShowPage.HELP); } }; aboutItwButtonAction = new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { boolean modal = getModality(); AboutDialog.display(modal, TextsProvider.POLICY_EDITOR); } }; closeButtonAction = new ActionListener() { @Override public void actionPerformed(final ActionEvent event) { final Window parentWindow = SwingUtilities.getWindowAncestor(PolicyEditor.this); if (parentWindow instanceof PolicyEditorWindow) { ((PolicyEditorWindow) parentWindow).quit(); } } }; closeButton.setText(R("ButClose")); closeButton.addActionListener(closeButtonAction); setupLayout(); } private static String getDefaultPolicyFilePath() throws URISyntaxException { return new File(new URI(PathsAndFiles.JAVA_POLICY.getFullPath())).getAbsolutePath(); } private boolean getModality() { boolean modal = false; Container parent = PolicyEditor.this; while (true) { if (parent == null) { break; } if (parent instanceof JDialog) { modal = ((JDialog) parent).isModal(); break; } parent = parent.getParent(); } return modal; } /** * * @param async use asynchronous saving, which displays a progress dialog, or use synchronous, which blocks the * EDT but allows for eg the on-disk file to be changed without resorting to a busy-wait loop * @return false iff the user wishes to cancel the operation and keep the current editor state */ private boolean promptOnSaveChangesMade(final boolean async) { if (policyEditorController.changesMade()) { final int save = JOptionPane.showConfirmDialog(this, R("PESaveChanges")); if (save == JOptionPane.YES_OPTION) { if (policyEditorController.getFile() == null) { final int choice = fileChooser.showSaveDialog(this); if (choice == JFileChooser.APPROVE_OPTION) { this.setFile(fileChooser.getSelectedFile().getAbsolutePath()); } else if (choice == JFileChooser.CANCEL_OPTION) { return false; } } if (async) { savePolicyFile(); } else { try { policyEditorController.savePolicyFile(); } catch (final IOException e) { showCouldNotSaveDialog(); } } } else if (save == JOptionPane.CANCEL_OPTION) { return false; } } return true; } public void setFile(final String filepath) { if (filepath != null) { policyEditorController.setFile(new File(filepath)); } else { policyEditorController.setFile(null); resetCodebases(); addNewCodebase(""); } setParentWindowTitle(getWindowTitleForStatus()); } private void setParentWindowTitle(final String title) { invokeRunnableOrEnqueueLater(new Runnable() { @Override public void run() { final Window parent = SwingUtilities.getWindowAncestor(PolicyEditor.this); if (!(parent instanceof PolicyEditorWindow)) { return; } final PolicyEditorWindow window = (PolicyEditorWindow) parent; window.setTitle(title); } }); } private String getWindowTitleForStatus() { final String filepath; final File file = getFile(); if (file != null) { filepath = file.getPath(); } else { filepath = null; } final String titleAndPath; if (filepath != null) { titleAndPath = R("PETitleWithPath", filepath); } else { titleAndPath = R("PETitle"); } final String result; if (policyEditorController.changesMade()) { result = R("PETitleWithChangesMade", titleAndPath); } else { result = titleAndPath; } return result; } private String getSelectedCodebase() { final String codebase = list.getSelectedValue(); if (codebase == null || codebase.isEmpty()) { return null; } if (codebase.equals(R("PEGlobalSettings"))) { return ""; } return codebase; } private static void preparePolicyEditorWindow(final PolicyEditorWindow w, final PolicyEditor e) { w.setModalityType(ModalityType.MODELESS); //at least some default w.setPolicyEditor(e); w.setTitle(R("PETitle")); w.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); w.setJMenuBar(createMenuBar(w.getPolicyEditor())); setupPolicyEditorWindow(w.asWindow(), w.getPolicyEditor()); } private static void setupPolicyEditorWindow(final Window window, final PolicyEditor editor) { window.add(editor); window.pack(); editor.setVisible(true); window.addWindowListener(new WindowAdapter() { @Override public void windowClosing(final WindowEvent e) { ((PolicyEditorWindow) window).quit(); } }); } public static interface PolicyEditorWindow { public void setTitle(String s); public void setDefaultCloseOperation(int i); public PolicyEditor getPolicyEditor(); public void setPolicyEditor(PolicyEditor e); public void setJMenuBar(JMenuBar menu); public Window asWindow(); public void setModalityType(ModalityType modalityType); public void quit(); } private static class PolicyEditorFrame extends JFrame implements PolicyEditorWindow { private PolicyEditor editor; private PolicyEditorFrame(final PolicyEditor editor) { super(); preparePolicyEditorWindow((PolicyEditorWindow) this, editor); } @Override public final void setTitle(String title) { super.setTitle(title); } @Override public final PolicyEditor getPolicyEditor() { return editor; } @Override public final void setPolicyEditor(final PolicyEditor e) { editor = e; } @Override public final void setDefaultCloseOperation(final int operation) { super.setDefaultCloseOperation(operation); } @Override public final void setJMenuBar(final JMenuBar menu) { super.setJMenuBar(menu); } @Override public final Window asWindow() { return this; } @Override public void setModalityType(final ModalityType type) { //no op for frame } @Override public void quit() { policyEditorWindowQuit(this); } } /* * Casting a Window to PolicyEditorWindow is not generally safe - be sure that * the argument passed to this method is actually a PolicyEditorDialog or PolicyEditorFrame. */ private static void policyEditorWindowQuit(final Window window) { final PolicyEditor editor = ((PolicyEditorWindow) window).getPolicyEditor(); editor.parentPolicyEditor.clear(); if (editor.policyEditorController.changesMade()) { final int save = JOptionPane.showConfirmDialog(window, R("PESaveChanges")); if (save == JOptionPane.YES_OPTION) { if (editor.policyEditorController.getFile() == null) { final int choice = editor.fileChooser.showSaveDialog(window); if (choice == JFileChooser.APPROVE_OPTION) { editor.setFile(editor.fileChooser.getSelectedFile().getAbsolutePath()); } else if (choice == JFileChooser.CANCEL_OPTION) { return; } } try { editor.policyEditorController.savePolicyFile(); } catch (final IOException e) { OutputController.getLogger().log(e); editor.showCouldNotSaveDialog(); return; } } else if (save == JOptionPane.CANCEL_OPTION) { return; } } editor.setClosed(); window.dispose(); } public static PolicyEditorWindow getPolicyEditorFrame(final String filepath) { return new PolicyEditorFrame(new PolicyEditor(filepath)); } private static class PolicyEditorDialog extends JDialog implements PolicyEditorWindow { private PolicyEditor editor; private PolicyEditorDialog(final PolicyEditor editor) { super(); preparePolicyEditorWindow((PolicyEditorWindow) this, editor); } @Override public final void setTitle(final String title) { super.setTitle(title); } @Override public final PolicyEditor getPolicyEditor() { return editor; } @Override public final void setPolicyEditor(final PolicyEditor e) { editor = e; } @Override public final void setDefaultCloseOperation(final int operation) { super.setDefaultCloseOperation(operation); } @Override public final void setJMenuBar(final JMenuBar menu) { super.setJMenuBar(menu); } @Override public final Window asWindow() { return this; } @Override public void setModalityType(final ModalityType type) { super.setModalityType(type); } @Override public void quit() { policyEditorWindowQuit(this); } } public static PolicyEditorWindow getPolicyEditorDialog(final String filepath) { return new PolicyEditorDialog(new PolicyEditor(filepath)); } private void setClosed() { closed = true; } /** * Check if the PolicyEditor instance has been visually closed * @return if the PolicyEditor instance has been closed */ public boolean isClosed() { return closed; } /** * Called by the Custom Policy Viewer on its parent Policy Editor when * the Custom Policy Viewer is closing */ void customPolicyViewerClosing() { cpViewer = null; } /** * Add a new codebase to the editor's model. If the codebase is not a valid URL, * the codebase is not added. * @param codebase to be added */ public void addNewCodebase(final String codebase) { if (!codebase.isEmpty() && !validateCodebase(codebase)) { OutputController.getLogger().log("Could not add codebase " + codebase); return; } final String model; if (codebase.isEmpty()) { model = R("PEGlobalSettings"); } else { model = codebase; } policyEditorController.addCodebase(codebase); invokeRunnableOrEnqueueLater(new Runnable() { @Override public void run() { if (!listModel.contains(model)) { listModel.addElement(model); setChangesMade(true); } list.setSelectedValue(model, true); updateCheckboxes(codebase); } }); } private static boolean validateCodebase(final String codebase) { try { new URL(codebase); } catch (final MalformedURLException mue) { return false; } return true; } public File getFile() { return policyEditorController.getFile(); } /** * Display an input dialog, which will disappear when the user enters a valid URL * or when the user presses cancel. If an invalid URL is entered, the dialog reappears. * When a valid URL is entered, it is used to create a new codebase entry in the editor's * policy file model. */ public void addNewCodebaseInteractive() { invokeRunnableOrEnqueueLater(new Runnable() { @Override public void run() { String codebase = ""; while (!validateCodebase(codebase)) { codebase = JOptionPane.showInputDialog(PolicyEditor.this, R("PECodebasePrompt"), "http://"); if (codebase == null) { return; } } addNewCodebase(codebase); } }); } /** * Remove a codebase from the editor's model * @param codebase to be removed */ public void removeCodebase(final String codebase) { if (codebase.equals(R("PEGlobalSettings")) || codebase.isEmpty()) { return; } int previousIndex = list.getSelectedIndex() - 1; if (previousIndex < 0) { previousIndex = 0; } policyEditorController.removeCodebase(codebase); final int fIndex = previousIndex; invokeRunnableOrEnqueueLater(new Runnable() { @Override public void run() { listModel.removeElement(codebase); list.setSelectedIndex(fIndex); } }); setChangesMade(true); } /** * Rename a codebase, preserving its permissions * @param oldCodebase the codebase to rename * @param newCodebase the new name for the codebase */ public void renameCodebase(final String oldCodebase, final String newCodebase) { final Map permissions = getPermissions(oldCodebase); final Collection customPermissions = getCustomPermissions(oldCodebase); removeCodebase(oldCodebase); addNewCodebase(newCodebase); for (final Map.Entry entry : permissions.entrySet()) { setPermission(newCodebase, entry.getKey(), entry.getValue()); } for (final CustomPermission permission : customPermissions) { addCustomPermission(newCodebase, permission); } updateCheckboxes(newCodebase); } /** * Copy a codebase to the system clipboard, preserving its permissions * @param codebase the codebase to copy */ public void copyCodebase(final String codebase) { if (!getCodebases().contains(codebase)) { return; } policyEditorController.copyCodebaseToClipboard(codebase); } /** * Paste a codebase entry from the system clipboard with a new codebase name */ public void pasteCodebase(final String newCodebase) throws UnsupportedFlavorException, InvalidPolicyException, IOException { final Map permissions = policyEditorController.getPermissionsFromClipboard(); final Set customPermissions = policyEditorController.getCustomPermissionsFromClipboard(); addNewCodebase(newCodebase); for (final Map.Entry entry : permissions.entrySet()) { policyEditorController.setPermission(newCodebase, entry.getKey(), entry.getValue()); } policyEditorController.addCustomPermissions(newCodebase, customPermissions); setChangesMade(true); updateCheckboxes(newCodebase); } public Set getCodebases() { return policyEditorController.getCodebases(); } public void setPermission(final String codebase, final PolicyEditorPermissions permission, final boolean state) { policyEditorController.setPermission(codebase, permission, state); } public Map getPermissions(final String codebase) { return policyEditorController.getPermissions(codebase); } public void addCustomPermission(final String codebase, final CustomPermission permission) { policyEditorController.addCustomPermission(codebase, permission); } public Collection getCustomPermissions(final String codebase) { return policyEditorController.getCustomPermissions(codebase); } public void clearCustomPermissions(final String codebase) { policyEditorController.clearCustomCodebase(codebase); } private void invokeRunnableOrEnqueueLater(final Runnable runnable) { if (SwingUtilities.isEventDispatchThread()) { runnable.run(); } else { SwingUtilities.invokeLater(runnable); } } private void invokeRunnableOrEnqueueAndWait(final Runnable runnable) throws InvocationTargetException, InterruptedException { if (SwingUtilities.isEventDispatchThread()) { runnable.run(); } else { SwingUtilities.invokeAndWait(runnable); } } /** * Update the checkboxes to show the permissions granted to the specified codebase * @param codebase whose permissions to display */ private void updateCheckboxes(final String codebase) { try { invokeRunnableOrEnqueueAndWait(new Runnable() { @Override public void run() { updateCheckboxesImpl(codebase); } }); } catch (InterruptedException ex) { OutputController.getLogger().log(ex); } catch (InvocationTargetException ex) { OutputController.getLogger().log(ex); } } private void updateCheckboxesImpl(final String codebase) { if (!getCodebases().contains(codebase)) { return; } final Map map = policyEditorController.getCopyOfPermissions().get(codebase); for (final PolicyEditorPermissions perm : PolicyEditorPermissions.values()) { final JCheckBox box = checkboxMap.get(perm); for (final ActionListener l : box.getActionListeners()) { box.removeActionListener(l); } final boolean state = policyEditorController.getPermission(codebase, perm); for (final JCheckBoxWithGroup jg : groupBoxList) { jg.setState(map); } box.setSelected(state); box.addActionListener(new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { setChangesMade(true); policyEditorController.setPermission(codebase, perm, box.isSelected()); for (JCheckBoxWithGroup jg : groupBoxList) { jg.setState(map); } } }); } } /** * Set a mnemonic key for a menu item or button * @param button the component for which to set a mnemonic * @param mnemonic the mnemonic to set */ private static void setButtonMnemonic(final AbstractButton button, final String mnemonic) { if (mnemonic.length() != 1) { OutputController.getLogger().log(OutputController.Level.WARNING_DEBUG, "Could not set mnemonic \"" + mnemonic + "\" for " + button); return; } final char ch = mnemonic.charAt(0); button.setMnemonic(ch); } private static void setMenuItemAccelerator(final JMenuItem menuItem, final String accelerator) { final KeyStroke ks = KeyStroke.getKeyStroke(accelerator); menuItem.setAccelerator(ks); } private static JMenuBar createMenuBar(final PolicyEditor editor) { final JMenuBar menuBar = new JMenuBar(); final JMenu fileMenu = new JMenu(R("PEFileMenu")); setButtonMnemonic(fileMenu, R("PEFileMenuMnemonic")); final JMenuItem newItem = new JMenuItem(R("PENewMenuItem")); setButtonMnemonic(newItem, R("PENewMenuItemMnemonic")); setMenuItemAccelerator(newItem, R("PENewMenuItemAccelerator")); newItem.addActionListener(editor.newButtonAction); fileMenu.add(newItem); final JMenuItem openItem = new JMenuItem(R("PEOpenMenuItem")); setButtonMnemonic(openItem, R("PEOpenMenuItemMnemonic")); setMenuItemAccelerator(openItem, R("PEOpenMenuItemAccelerator")); openItem.addActionListener(editor.openButtonAction); fileMenu.add(openItem); final JMenuItem openDefaultItem = new JMenuItem(R("PEOpenDefaultMenuItem")); setButtonMnemonic(openDefaultItem, R("PEOpenDefaultMenuItemMnemonic")); setMenuItemAccelerator(openDefaultItem, R("PEOpenDefaultMenuItemAccelerator")); openDefaultItem.addActionListener(editor.openDefaultButtonAction); fileMenu.add(openDefaultItem); final JMenuItem saveItem = new JMenuItem(R("PESaveMenuItem")); setButtonMnemonic(saveItem, R("PESaveMenuItemMnemonic")); setMenuItemAccelerator(saveItem, R("PESaveMenuItemAccelerator")); saveItem.addActionListener(editor.okButtonAction); fileMenu.add(saveItem); final JMenuItem saveAsItem = new JMenuItem(R("PESaveAsMenuItem")); setButtonMnemonic(saveAsItem, R("PESaveAsMenuItemMnemonic")); setMenuItemAccelerator(saveAsItem, R("PESaveAsMenuItemAccelerator")); saveAsItem.addActionListener(editor.saveAsButtonAction); fileMenu.add(saveAsItem); final JMenuItem exitItem = new JMenuItem(R("PEExitMenuItem")); setButtonMnemonic(exitItem, R("PEExitMenuItemMnemonic")); setMenuItemAccelerator(exitItem, R("PEExitMenuItemAccelerator")); exitItem.addActionListener(editor.closeButtonAction); fileMenu.add(exitItem); menuBar.add(fileMenu); final JMenu codebaseMenu = new JMenu(R("PECodebaseMenu")); setButtonMnemonic(codebaseMenu, R("PECodebaseMenuMnemonic")); final JMenuItem addNewCodebaseItem = new JMenuItem(R("PEAddCodebaseItem")); setButtonMnemonic(addNewCodebaseItem, R("PEAddCodebaseItemMnemonic")); setMenuItemAccelerator(addNewCodebaseItem, R("PEAddCodebaseItemAccelerator")); addNewCodebaseItem.addActionListener(editor.addCodebaseButtonAction); codebaseMenu.add(addNewCodebaseItem); final JMenuItem removeCodebaseItem = new JMenuItem(R("PERemoveCodebaseItem")); setButtonMnemonic(removeCodebaseItem, R("PERemoveCodebaseItemMnemonic")); setMenuItemAccelerator(removeCodebaseItem, R("PERemoveCodebaseItemAccelerator")); removeCodebaseItem.addActionListener(editor.removeCodebaseButtonAction); codebaseMenu.add(removeCodebaseItem); codebaseMenu.addSeparator(); final JMenuItem renameCodebaseItem = new JMenuItem(R("PERenameCodebaseItem")); setButtonMnemonic(renameCodebaseItem, R("PERenameCodebaseItemMnemonic")); setMenuItemAccelerator(renameCodebaseItem, R("PERenameCodebaseItemAccelerator")); renameCodebaseItem.addActionListener(editor.renameCodebaseButtonAction); codebaseMenu.add(renameCodebaseItem); final JMenuItem copyCodebaseItem = new JMenuItem(R("PECopyCodebaseItem")); setButtonMnemonic(copyCodebaseItem, R("PECopyCodebaseItemMnemonic")); setMenuItemAccelerator(copyCodebaseItem, R("PECopyCodebaseItemAccelerator")); copyCodebaseItem.addActionListener(editor.copyCodebaseButtonAction); codebaseMenu.add(copyCodebaseItem); menuBar.add(codebaseMenu); final JMenuItem pasteCodebaseItem = new JMenuItem(R("PEPasteCodebaseItem")); setButtonMnemonic(pasteCodebaseItem, R("PEPasteCodebaseItemMnemonic")); setMenuItemAccelerator(pasteCodebaseItem, R("PEPasteCodebaseItemAccelerator")); pasteCodebaseItem.addActionListener(editor.pasteCodebaseButtonAction); codebaseMenu.add(pasteCodebaseItem); final JMenu viewMenu = new JMenu(R("PEViewMenu")); setButtonMnemonic(viewMenu, R("PEViewMenuMnemonic")); final JMenuItem customPermissionsItem = new JMenuItem(R("PECustomPermissionsItem")); setButtonMnemonic(customPermissionsItem, R("PECustomPermissionsItemMnemonic")); setMenuItemAccelerator(customPermissionsItem, R("PECustomPermissionsItemAccelerator")); customPermissionsItem.addActionListener(editor.viewCustomButtonAction); viewMenu.add(customPermissionsItem); menuBar.add(viewMenu); final JMenu helpMenu = new JMenu(R("PEHelpMenu")); setButtonMnemonic(helpMenu, R("PEHelpMenuMnemonic")); final JMenuItem aboutPolicyEditorItem = new JMenuItem(R("PEAboutPolicyEditorItem")); setButtonMnemonic(aboutPolicyEditorItem, R("PEAboutPolicyEditorItemMnemonic")); aboutPolicyEditorItem.addActionListener(editor.aboutPolicyEditorButtonAction); helpMenu.add(aboutPolicyEditorItem); final JMenuItem aboutITW = new JMenuItem(R("CPTabAbout")); //setButtonMnemonic(aboutPolicyEditorItem, R("PEAboutPolicyEditorItemMnemonic")); aboutITW.addActionListener(editor.aboutItwButtonAction); helpMenu.add(aboutITW); final JMenuItem policyEditorHelpItem = new JMenuItem(R("PEPolicyEditorHelpItem")); setButtonMnemonic(policyEditorHelpItem, R("PEPolicyEditorHelpItemMnemonic")); policyEditorHelpItem.addActionListener(editor.policyEditorHelpButtonAction); helpMenu.addSeparator(); helpMenu.add(policyEditorHelpItem); menuBar.add(helpMenu); /* * JList has default Ctrl-C and Ctrl-V bindings, which we want to override with custom actions */ final InputMap listInputMap = editor.list.getInputMap(); final ActionMap listActionMap = editor.list.getActionMap(); final Action listCopyOverrideAction = new AbstractAction() { @Override public void actionPerformed(final ActionEvent e) { editor.copyCodebaseButtonAction.actionPerformed(e); } }; final Action listPasteOverrideAction = new AbstractAction() { @Override public void actionPerformed(final ActionEvent e) { editor.pasteCodebaseButtonAction.actionPerformed(e); } }; listInputMap.put(copyCodebaseItem.getAccelerator(), "CopyCodebaseOverride"); listActionMap.put("CopyCodebaseOverride", listCopyOverrideAction); listInputMap.put(pasteCodebaseItem.getAccelerator(), "PasteCodebaseOverride"); listActionMap.put("PasteCodebaseOverride", listPasteOverrideAction); return menuBar; } /** * Lay out all controls, tooltips, etc. */ private void setupLayout() { final JLabel checkboxLabel = new JLabel(); checkboxLabel.setText(R("PECheckboxLabel")); checkboxLabel.setBorder(new EmptyBorder(2, 2, 2, 2)); final GridBagConstraints checkboxLabelConstraints = new GridBagConstraints(); checkboxLabelConstraints.gridx = 2; checkboxLabelConstraints.gridy = 0; checkboxLabelConstraints.fill = GridBagConstraints.HORIZONTAL; add(checkboxLabel, checkboxLabelConstraints); final GridBagConstraints checkboxConstraints = new GridBagConstraints(); checkboxConstraints.anchor = GridBagConstraints.LINE_START; checkboxConstraints.fill = GridBagConstraints.HORIZONTAL; checkboxConstraints.weightx = 0; checkboxConstraints.weighty = 0; checkboxConstraints.gridx = 2; checkboxConstraints.gridy = 1; for (final JCheckBox box : checkboxMap.values()) { if (PolicyEditorPermissions.Group.anyContains(box, checkboxMap)) { //do not show boxes in any group continue; } add(box, checkboxConstraints); checkboxConstraints.gridx++; // Two columns of checkboxes if (checkboxConstraints.gridx > 3) { checkboxConstraints.gridx = 2; checkboxConstraints.gridy++; } } //add groups for (final PolicyEditorPermissions.Group g : PolicyEditorPermissions.Group.values()) { //no metter what, put group title on new line checkboxConstraints.gridy++; //all groups are in second column checkboxConstraints.gridx = 2; final JCheckBoxWithGroup groupCh = new JCheckBoxWithGroup(g); groupBoxList.add(groupCh); final JPanel groupPanel = new JPanel(new GridBagLayout()); groupPanel.setBorder(new LineBorder(Color.black)); groupCh.setToolTipText(R("PEGrightClick")); groupCh.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(final MouseEvent e) { if (e.getButton() == MouseEvent.BUTTON3) { toggleExpandedCheckboxGroupPanel(groupPanel); } } }); groupCh.addKeyListener(new KeyAdapter() { @Override public void keyPressed(final KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_ENTER || e.getKeyCode() == KeyEvent.VK_CONTEXT_MENU) { toggleExpandedCheckboxGroupPanel(groupPanel); } } }); groupCh.addActionListener(new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { final String codebase = getSelectedCodebase(); if (codebase == null) { return; } List backup = new LinkedList<>(); for (final ActionListener l : groupCh.getActionListeners()) { backup.add(l); groupCh.removeActionListener(l); } for (final PolicyEditorPermissions p : groupCh.getGroup().getPermissions()) { policyEditorController.setPermission(codebase, p, groupCh.isSelected()); } setChangesMade(true); updateCheckboxes(codebase); for (final ActionListener al : backup) { groupCh.addActionListener(al); } } }); add(groupCh, checkboxConstraints); // place panel with members below the title checkboxConstraints.gridy++; checkboxConstraints.gridx = 2; // spread group's panel over two columns checkboxConstraints.gridwidth = 2; checkboxConstraints.fill = GridBagConstraints.BOTH; add(groupPanel, checkboxConstraints); final GridBagConstraints groupCheckboxLabelConstraints = new GridBagConstraints(); groupCheckboxLabelConstraints.anchor = GridBagConstraints.LINE_START; groupCheckboxLabelConstraints.weightx = 0; groupCheckboxLabelConstraints.weighty = 0; groupCheckboxLabelConstraints.gridx = 1; groupCheckboxLabelConstraints.gridy = 1; for (final PolicyEditorPermissions p : g.getPermissions()) { groupPanel.add(checkboxMap.get(p), groupCheckboxLabelConstraints); // Two columns of checkboxes groupCheckboxLabelConstraints.gridx++; if (groupCheckboxLabelConstraints.gridx > 2) { groupCheckboxLabelConstraints.gridx = 1; groupCheckboxLabelConstraints.gridy++; } } groupPanel.setVisible(false); //reset checkboxConstraints.gridwidth = 1; } final JLabel codebaseListLabel = new JLabel(R("PECodebaseLabel")); codebaseListLabel.setBorder(new EmptyBorder(2, 2, 2, 2)); final GridBagConstraints listLabelConstraints = new GridBagConstraints(); listLabelConstraints.fill = GridBagConstraints.HORIZONTAL; listLabelConstraints.gridx = 0; listLabelConstraints.gridy = 0; add(codebaseListLabel, listLabelConstraints); list.addListSelectionListener(new ListSelectionListener() { @Override public void valueChanged(final ListSelectionEvent e) { if (e.getValueIsAdjusting()) { return; // ignore first click, act on release } final String codebase = getSelectedCodebase(); if (codebase == null) { return; } updateCheckboxes(codebase); } }); list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); scrollPane.setViewportView(list); final GridBagConstraints listConstraints = new GridBagConstraints(); listConstraints.fill = GridBagConstraints.BOTH; listConstraints.weightx = 1; listConstraints.weighty = 1; listConstraints.gridheight = checkboxConstraints.gridy + 1; listConstraints.gridwidth = 2; listConstraints.gridx = 0; listConstraints.gridy = 1; add(scrollPane, listConstraints); final GridBagConstraints addCodebaseButtonConstraints = new GridBagConstraints(); addCodebaseButtonConstraints.fill = GridBagConstraints.HORIZONTAL; addCodebaseButtonConstraints.gridx = 0; addCodebaseButtonConstraints.gridy = listConstraints.gridy + listConstraints.gridheight + 1; setButtonMnemonic(addCodebaseButton, R("PEAddCodebaseMnemonic")); add(addCodebaseButton, addCodebaseButtonConstraints); final GridBagConstraints removeCodebaseButtonConstraints = new GridBagConstraints(); removeCodebaseButtonConstraints.fill = GridBagConstraints.HORIZONTAL; removeCodebaseButtonConstraints.gridx = addCodebaseButtonConstraints.gridx + 1; removeCodebaseButtonConstraints.gridy = addCodebaseButtonConstraints.gridy; setButtonMnemonic(removeCodebaseButton, R("PERemoveCodebaseMnemonic")); removeCodebaseButton.setPreferredSize(addCodebaseButton.getPreferredSize()); add(removeCodebaseButton, removeCodebaseButtonConstraints); final GridBagConstraints okButtonConstraints = new GridBagConstraints(); okButtonConstraints.fill = GridBagConstraints.HORIZONTAL; okButtonConstraints.gridx = removeCodebaseButtonConstraints.gridx + 2; okButtonConstraints.gridy = removeCodebaseButtonConstraints.gridy; add(okButton, okButtonConstraints); final GridBagConstraints cancelButtonConstraints = new GridBagConstraints(); cancelButtonConstraints.fill = GridBagConstraints.HORIZONTAL; cancelButtonConstraints.gridx = okButtonConstraints.gridx + 1; cancelButtonConstraints.gridy = okButtonConstraints.gridy; add(closeButton, cancelButtonConstraints); setMinimumSize(getPreferredSize()); } void setChangesMade(final boolean b) { policyEditorController.setChangesMade(b); invokeRunnableOrEnqueueLater(new Runnable() { @Override public void run() { setParentWindowTitle(getWindowTitleForStatus()); } }); } private void resetCodebases() { listModel.clear(); policyEditorController.clearPermissions(); policyEditorController.clearCustomPermissions(); } /** * @return whether this PolicyEditor is currently opening or saving a policy file to disk */ public boolean isPerformingIO() { return policyEditorController.performingIO(); } private void openAndParsePolicyFile() { resetCodebases(); try { policyEditorController.getFile().createNewFile(); } catch (final IOException e) { OutputController.getLogger().log(e); } final OpenFileResult ofr = FileUtils.testFilePermissions(policyEditorController.getFile()); if (ofr == OpenFileResult.FAILURE || ofr == OpenFileResult.NOT_FILE) { FileUtils.showCouldNotOpenFilepathDialog(PolicyEditor.this, policyEditorController.getFile().getPath()); return; } if (ofr == OpenFileResult.CANT_WRITE) { FileUtils.showReadOnlyDialog(PolicyEditor.this); } final Window parentWindow = SwingUtilities.getWindowAncestor(this); final JDialog progressIndicator = new IndeterminateProgressDialog(parentWindow, "Loading..."); final SwingWorker openPolicyFileWorker = new SwingWorker() { @Override protected Void doInBackground() throws Exception { try { if (parentWindow != null) { invokeRunnableOrEnqueueLater(new Runnable() { @Override public void run() { progressIndicator.setLocationRelativeTo(parentWindow); progressIndicator.setVisible(true); } }); } policyEditorController.openAndParsePolicyFile(); } catch (final FileNotFoundException fnfe) { OutputController.getLogger().log(fnfe); FileUtils.showCouldNotOpenDialog(PolicyEditor.this, R("PECouldNotOpen")); } catch (final IOException | InvalidPolicyException e) { OutputController.getLogger().log(e); OutputController.getLogger().log(OutputController.Level.ERROR_ALL, R("RCantOpenFile", policyEditorController.getFile().getPath())); FileUtils.showCouldNotOpenDialog(PolicyEditor.this, R("PECouldNotOpen")); } return null; } @Override public void done() { for (final String codebase : policyEditorController.getCodebases()) { final String model; if (codebase.isEmpty()) { model = R("PEGlobalSettings"); } else { model = codebase; } if (!listModel.contains(model)) { listModel.addElement(model); } } addNewCodebase(""); progressIndicator.setVisible(false); progressIndicator.dispose(); setChangesMade(false); } }; openPolicyFileWorker.execute(); } /** * Save the policy model into the file pointed to by the filePath field. */ private void savePolicyFile() { final int overwriteChanges = checkPolicyChangesWithDialog(); switch (overwriteChanges) { case JOptionPane.YES_OPTION: openAndParsePolicyFile(); return; case JOptionPane.NO_OPTION: break; case JOptionPane.CANCEL_OPTION: return; default: break; } final Window parentWindow = SwingUtilities.getWindowAncestor(this); final JDialog progressIndicator = new IndeterminateProgressDialog(parentWindow, "Saving..."); final SwingWorker savePolicyFileWorker = new SwingWorker() { @Override public Void doInBackground() throws Exception { try { if (parentWindow != null) { invokeRunnableOrEnqueueLater(new Runnable() { @Override public void run() { progressIndicator.setLocationRelativeTo(parentWindow); progressIndicator.setVisible(true); } }); } policyEditorController.savePolicyFile(); } catch (final IOException e) { OutputController.getLogger().log(e); showCouldNotSaveDialog(); } return null; } @Override public void done() { showChangesSavedDialog(); progressIndicator.setVisible(false); progressIndicator.dispose(); setChangesMade(false); } }; savePolicyFileWorker.execute(); } /** * Show a dialog informing the user that their changes have been saved. */ private void showChangesSavedDialog() { // This dialog is often displayed when closing the editor, and so PolicyEditor // may already be disposed when this dialog appears. Give a weak reference so // that this dialog doesn't prevent the JVM from exiting invokeRunnableOrEnqueueLater(new Runnable() { @Override public void run() { JOptionPane.showMessageDialog(parentPolicyEditor.get(), R("PEChangesSaved")); } }); } /** * Show a dialog informing the user that their changes could not be saved. */ private void showCouldNotSaveDialog() { // This dialog is often displayed when closing the editor, and so PolicyEditor // may already be disposed when this dialog appears. Give a weak reference so // that this dialog doesn't prevent the JVM from exiting invokeRunnableOrEnqueueLater(new Runnable() { @Override public void run() { JOptionPane.showMessageDialog(parentPolicyEditor.get(), R("PECouldNotSave"), R("Error"), JOptionPane.ERROR_MESSAGE); } }); } private void showClipboardErrorDialog() { invokeRunnableOrEnqueueLater(new Runnable() { @Override public void run() { JOptionPane.showMessageDialog(parentPolicyEditor.get(), R("PEClipboardError"), R("Error"), JOptionPane.ERROR_MESSAGE); } }); } private void showInvalidPolicyExceptionDialog(final String codebase) { invokeRunnableOrEnqueueLater(new Runnable() { @Override public void run() { JOptionPane.showMessageDialog(parentPolicyEditor.get(), R("PEInvalidPolicy", codebase), R("Error"), JOptionPane.ERROR_MESSAGE); } }); } private void showCouldNotAccessClipboardDialog() { invokeRunnableOrEnqueueLater(new Runnable() { @Override public void run() { JOptionPane.showMessageDialog(parentPolicyEditor.get(), R("PEClipboardAccessError"), R("Error"), JOptionPane.ERROR_MESSAGE); } }); } /** * Detect if the policy settings have changed, either on-disk or in-app. * If an on-disk change has occurred, update the Md5. * @return The user's choice (Yes/No/Cancel - see JOptionPane constants). * "Cancel" if the file hasn't changed but the user has made modifications * to the settings. "No" otherwise * @throws IOException if the file cannot be read */ private int checkPolicyChangesWithDialog() { boolean changed; try { changed = policyEditorController.fileHasChanged(); } catch (FileNotFoundException e) { OutputController.getLogger().log(e); JOptionPane.showMessageDialog(PolicyEditor.this, R("PEFileMissing"), R("PEFileModified"), JOptionPane.WARNING_MESSAGE); return JOptionPane.NO_OPTION; } catch (IOException e) { OutputController.getLogger().log(e); changed = true; } if (changed) { String policyFilePath; try { policyFilePath = policyEditorController.getFile().getCanonicalPath(); } catch (final IOException e) { OutputController.getLogger().log(e); policyFilePath = policyEditorController.getFile().getPath(); } return JOptionPane.showConfirmDialog(PolicyEditor.this, R("PEFileModifiedDetail", policyFilePath, R("PEFileModified"), JOptionPane.YES_NO_CANCEL_OPTION)); } else if (!policyEditorController.changesMade()) { //Return without saving or reloading return JOptionPane.CANCEL_OPTION; } return JOptionPane.NO_OPTION; } private void toggleExpandedCheckboxGroupPanel(final JPanel groupPanel) { groupPanel.setVisible(!groupPanel.isVisible()); PolicyEditor.this.validate(); final Window w = SwingUtilities.getWindowAncestor(PolicyEditor.this); if (w != null) { w.pack(); } } /** * Start a Policy Editor instance. * @param args "-file $FILENAME" and/or "-codebase $CODEBASE" are accepted flag/value pairs. * -file specifies a file path to be opened by the editor. If none is provided, the default * policy file location for the user is opened. * -codebase specifies (a) codebase(s) to start the editor with. If the entry already exists, * it will be selected. If it does not exist, it will be created, then selected. Multiple * codebases can be used, separated by spaces. * -help will print a help message and immediately return (no editor instance opens) */ public static void main(final String[] args) { final OptionParser optionParser = new OptionParser(args, OptionsDefinitions.getPolicyEditorOptions()); if (optionParser.hasOption(OptionsDefinitions.OPTIONS.VERBOSE)) { JNLPRuntime.setDebug(true); } if (optionParser.hasOption(OptionsDefinitions.OPTIONS.HELP1)) { final TextsProvider helpMessagesProvider = new PolicyEditorTextsProvider("utf-8", new PlainTextFormatter(), true, true); String HELP_MESSAGE = "\n"; if (JNLPRuntime.isDebug()) { HELP_MESSAGE = HELP_MESSAGE + helpMessagesProvider.writeToString(); } else { HELP_MESSAGE = HELP_MESSAGE + helpMessagesProvider.prepare().getSynopsis() + helpMessagesProvider.getFormatter().getNewLine() + helpMessagesProvider.prepare().getOptions() + helpMessagesProvider.getFormatter().getNewLine(); } OutputController.getLogger().printOut(HELP_MESSAGE); return; } try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (final Exception e) { // not really important, so just ignore } SwingUtilities.invokeLater(new Runnable() { @Override public void run() { final String filepath = getFilePathArgument(optionParser); final PolicyEditorWindow frame = getPolicyEditorFrame(filepath); frame.asWindow().setVisible(true); final List codebases = optionParser.getParams(OptionsDefinitions.OPTIONS.CODEBASE); for (final String url : codebases) { frame.getPolicyEditor().addNewCodebase(url); } } }); } private static String getFilePathArgument(OptionParser optionParser) { final boolean openDefaultFile = optionParser.hasOption(OptionsDefinitions.OPTIONS.DEFAULTFILE); final boolean hasFileArgument = optionParser.hasOption(OptionsDefinitions.OPTIONS.FILE); final boolean hasMainArgument = optionParser.mainArgExists(); if ((hasFileArgument && openDefaultFile) || (hasMainArgument && openDefaultFile)) { throw new IllegalArgumentException(R("PEDefaultFileFilePathSpecifiedError")); } else if (hasFileArgument && hasMainArgument) { throw new IllegalArgumentException(R("PEMainArgAndFileSwitchSpecifiedError")); } String filepath = null; if (hasFileArgument) { filepath = cleanFilePathArgument(optionParser.getParam(OptionsDefinitions.OPTIONS.FILE)); } else if (hasMainArgument) { filepath = cleanFilePathArgument(optionParser.getMainArg()); } else if (openDefaultFile) { try { filepath = getDefaultPolicyFilePath(); } catch (URISyntaxException e) { OutputController.getLogger().log(e); throw new RuntimeException(e); } } return filepath; } private static String cleanFilePathArgument(String filepath) { if (filepath == null) { return null; } else if (filepath.isEmpty() || filepath.trim().isEmpty()) { return null; } else { return filepath; } } /** * Create a new PolicyEditor instance without passing argv. The returned instance is not * yet set visible. * @param filepath a policy file to open at start, or null if no file to load * @return a reference to a new PolicyEditor instance */ public static PolicyEditor createInstance(final String filepath) { return new PolicyEditor(filepath); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/policyeditor/PaxHeaders.17941/PermissionType.ja0000644000000000000000000000013212654402377030362 xustar0030 mtime=1454507263.229432688 30 atime=1454507327.149580203 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/policyeditor/PermissionType.java0000644000175000002070000000532612654402377031442 0ustar00jvanekmock00000000000000/*Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.policyeditor; /** * Defines the set of types required for the default permissions */ public enum PermissionType { NONE(""), FILE_PERMISSION("java.io.FilePermission"), PROPERTY_PERMISSION("java.util.PropertyPermission"), AWT_PERMISSION("java.awt.AWTPermission"), SOCKET_PERMISSION("java.net.SocketPermission"), RUNTIME_PERMISSION("java.lang.RuntimePermission"), AUDIO_PERMISSION("javax.sound.sampled.AudioPermission"), REFLECT_PERMISSION("java.lang.reflect.ReflectPermission"); public final String type; private PermissionType(final String type) { this.type = type; } /** * If there is any type that matches the string, return it. * If no matches, return NONE. * @param string a permission type value * @return the closest matching default permission type */ public static PermissionType fromString(final String string) { for (final PermissionType type : PermissionType.values()) { if (string.trim().equals(type.type)) { return type; } } return NONE; } }icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/policyeditor/PaxHeaders.17941/PermissionTarget.0000644000000000000000000000013212654402377030354 xustar0030 mtime=1454507263.229432688 30 atime=1454507327.149580203 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/policyeditor/PermissionTarget.java0000644000175000002070000000554512654402377031752 0ustar00jvanekmock00000000000000/*Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.policyeditor; /** * Defines the set of targets required for the default permissions */ public enum PermissionTarget { NONE(""), ALL("*"), ALL_FILES("<>"), USER_HOME("${user.home}"), TMPDIR("${java.io.tmpdir}"), CLIPBOARD("accessClipboard"), PRINT("queuePrintJob"), PLAY("play"), RECORD("record"), REFLECT("suppressAccessChecks"), GETENV("getenv.*"), ACCESS_THREADS("modifyThread"), ACCESS_THREAD_GROUPS("modifyThreadGroup"), ACCESS_CLASS_IN_PACKAGE("accessClassInPackage.*"), DECLARED_MEMBERS("accessDeclaredMembers"), CLASSLOADER("getClassLoader"); public final String target; private PermissionTarget(final String target) { this.target = target; } /** * If there is any target that matches the string, return it. * If no matches, return NONE; * @param string a permission target value * @return the closest matching default targets value */ public static PermissionTarget fromString(final String string) { for (final PermissionTarget target : PermissionTarget.values()) { if (string.trim().equals(target.target)) { return target; } } return NONE; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/policyeditor/PaxHeaders.17941/PermissionActions0000644000000000000000000000013212654402377030450 xustar0030 mtime=1454507263.229432688 30 atime=1454507327.149580203 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/policyeditor/PermissionActions.java0000644000175000002070000000647512654402377032127 0ustar00jvanekmock00000000000000/*Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.policyeditor; import java.util.Collection; import java.util.Collections; import java.util.HashSet; import java.util.Set; /** * Defines the set of actions required for the default permissions */ public enum PermissionActions { NONE(""), READ("read"), WRITE("write"), EXECUTE("execute"), DELETE("delete"), READLINK("readlink"), FILE_ALL("read,write,execute,delete,readlink"), ACCEPT("accept"), LISTEN("listen"), CONNECT("connect"), RESOLVE("resolve"), NETALL("accept,listen,connect,resolve"); private final String rawActions; private final Set actions; private PermissionActions(final String actions) { this.rawActions = actions; this.actions = setFromString(actions); } /** * If there is any default action set that matches the string, return it. * If no matches, return NONE. * @param string a comma-separated list of permission actions * @return the closest matching default actions value */ public static PermissionActions fromString(final String string) { final Collection actions = setFromString(string); for (final PermissionActions action : PermissionActions.values()) { if (actions.equals(action.actions)) { return action; } } return NONE; } public Collection getActions() { return new HashSet(this.actions); } private static Set setFromString(final String string) { final Set set = new HashSet<>(); Collections.addAll(set, string.split(",")); return set; } public String rawString() { return rawActions; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/policyeditor/PaxHeaders.17941/InvalidPolicyExce0000644000000000000000000000013212654402377030352 xustar0030 mtime=1454507263.229432688 30 atime=1454507327.149580203 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/policyeditor/InvalidPolicyException.java0000644000175000002070000000330612654402377033071 0ustar00jvanekmock00000000000000/*Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.policyeditor; public class InvalidPolicyException extends Exception { } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/policyeditor/PaxHeaders.17941/IndeterminateProg0000644000000000000000000000013212654402377030417 xustar0030 mtime=1454507263.228432701 30 atime=1454507327.149580203 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/policyeditor/IndeterminateProgressDialog.java0000644000175000002070000000421412654402377034100 0ustar00jvanekmock00000000000000/*Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.policyeditor; import java.awt.Window; import javax.swing.JDialog; import javax.swing.JProgressBar; public class IndeterminateProgressDialog extends JDialog { private final JProgressBar progressBar = new JProgressBar(); public IndeterminateProgressDialog(final Window parent, final String title) { super(parent); this.setTitle(title); this.setModalityType(ModalityType.DOCUMENT_MODAL); progressBar.setIndeterminate(true); this.add(progressBar); this.pack(); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/policyeditor/PaxHeaders.17941/CustomPolicyViewe0000644000000000000000000000013212654402377030431 xustar0030 mtime=1454507263.228432701 30 atime=1454507327.148580217 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/policyeditor/CustomPolicyViewer.java0000644000175000002070000002343712654402377032267 0ustar00jvanekmock00000000000000/*Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.policyeditor; import static net.sourceforge.jnlp.runtime.Translator.R; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.util.Collection; import java.util.Objects; import java.util.TreeSet; import javax.swing.DefaultListModel; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JList; import javax.swing.JOptionPane; import javax.swing.JScrollPane; import javax.swing.ListSelectionModel; import javax.swing.ScrollPaneConstants; import javax.swing.WindowConstants; import javax.swing.border.EmptyBorder; /** * This implements a simple list viewer for custom policies, ie policies * that do not have a dedicated checkbox in PolicyEditor. It also allows * for adding new custom permissions and removing permissions. */ public class CustomPolicyViewer extends JFrame { private final Collection customPermissions = new TreeSet<>(); private final JScrollPane scrollPane = new JScrollPane(); private final DefaultListModel listModel = new DefaultListModel<>(); private final JList list = new JList<>(listModel); private final JButton addButton = new JButton(), removeButton = new JButton(), closeButton = new JButton(); private final JLabel listLabel = new JLabel(); private final ActionListener addButtonAction, removeButtonAction, closeButtonAction; private final PolicyEditor parent; private final String codebase; /** * @param parent the parent PolicyEditor which created this CustomPolicyViewer * @param codebase the codebase for which these custom permissions are enabled * @param policyFile the PolicyFileModel */ public CustomPolicyViewer(final PolicyEditor parent, final String codebase) { super(); Objects.requireNonNull(parent); Objects.requireNonNull(codebase); this.parent = parent; this.codebase = codebase; setLayout(new GridBagLayout()); setTitle(R("PECPTitle")); customPermissions.addAll(parent.getCustomPermissions(codebase)); for (final CustomPermission perm : customPermissions) { listModel.addElement(perm); } addButtonAction = new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { final String prefill = R("PECPType") + " " + R("PECPTarget") + " [" + R("PECPActions") + "]"; String string = JOptionPane.showInputDialog(CustomPolicyViewer.this, R("PECPPrompt"), prefill); if (string == null || string.isEmpty()) { return; } string = string.replaceAll("\\s+", " ").trim(); final String[] parts = string.split(" "); if (parts.length < 2) { return; } final String type = parts[0], target = parts[1]; final String actions; if (parts.length > 2) { actions = parts[2]; } else { actions = ""; } final CustomPermission perm = new CustomPermission(type, target, actions); addCustomPermission(perm); } }; addButton.setText(R("PECPAddButton")); addButton.addActionListener(addButtonAction); removeButtonAction = new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { final CustomPermission selected = list.getSelectedValue(); if (selected == null) { return; } removeCustomPermission(selected); } }; removeButton.setText(R("PECPRemoveButton")); removeButton.addActionListener(removeButtonAction); closeButtonAction = new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { quit(); } }; closeButton.setText(R("PECPCloseButton")); closeButton.addActionListener(closeButtonAction); final String codebaseText; if (codebase.trim().isEmpty()) { codebaseText = R("PEGlobalSettings"); } else { codebaseText = codebase; } listLabel.setText(R("PECPListLabel", codebaseText)); scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); list.setSelectedIndex(0); setupLayout(); setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); addWindowListener(new WindowAdapter() { @Override public void windowClosing(final WindowEvent e) { quit(); } }); } private void setupLayout() { final GridBagConstraints labelConstraints = new GridBagConstraints(); labelConstraints.gridx = 0; labelConstraints.gridy = 0; final EmptyBorder border = new EmptyBorder(2, 2, 2, 2); listLabel.setBorder(border); add(listLabel, labelConstraints); final GridBagConstraints scrollPaneConstraints = new GridBagConstraints(); scrollPaneConstraints.gridx = 0; scrollPaneConstraints.gridy = 1; scrollPaneConstraints.weightx = 1; scrollPaneConstraints.weighty = 1; scrollPaneConstraints.gridwidth = 3; scrollPaneConstraints.fill = GridBagConstraints.BOTH; list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); scrollPane.setViewportView(list); add(scrollPane, scrollPaneConstraints); final GridBagConstraints addButtonConstraints = new GridBagConstraints(); addButtonConstraints.gridx = 0; addButtonConstraints.gridy = scrollPaneConstraints.gridy + 1; addButtonConstraints.fill = GridBagConstraints.HORIZONTAL; add(addButton, addButtonConstraints); final GridBagConstraints removeButtonConstraints = new GridBagConstraints(); removeButtonConstraints.gridx = addButtonConstraints.gridx + 1; removeButtonConstraints.gridy = addButtonConstraints.gridy; removeButtonConstraints.fill = GridBagConstraints.HORIZONTAL; add(removeButton, removeButtonConstraints); final GridBagConstraints closeButtonConstraints = new GridBagConstraints(); closeButtonConstraints.gridx = removeButtonConstraints.gridx + 1; closeButtonConstraints.gridy = removeButtonConstraints.gridy; closeButtonConstraints.fill = GridBagConstraints.HORIZONTAL; add(closeButton, closeButtonConstraints); pack(); setMinimumSize(getPreferredSize()); } private void quit() { parent.customPolicyViewerClosing(); dispose(); } /** * Update the custom permissions map. Used by the Custom Policy Viewer to update its parent * PolicyEditor to changes it has made * @param codebase the codebase for which changes were made * @param permissions the permissions granted to this codebase */ private void updateCustomPermissions() { parent.setChangesMade(true); parent.clearCustomPermissions(codebase); for (final CustomPermission permission : customPermissions) { parent.addCustomPermission(codebase, permission); } } void addCustomPermission(final CustomPermission permission) { Objects.requireNonNull(permission); if (customPermissions.add(permission)) { listModel.addElement(permission); updateCustomPermissions(); } list.setSelectedValue(permission, true); } void removeCustomPermission(final CustomPermission permission) { Objects.requireNonNull(permission); customPermissions.remove(permission); listModel.removeElement(permission); updateCustomPermissions(); } Collection getCopyOfCustomPermissions() { return new TreeSet<>(customPermissions); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/policyeditor/PaxHeaders.17941/CustomPermission.0000644000000000000000000000013212654402377030400 xustar0030 mtime=1454507263.228432701 30 atime=1454507327.148580217 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/policyeditor/CustomPermission.java0000644000175000002070000001461012654402377031767 0ustar00jvanekmock00000000000000/*Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.policyeditor; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * This class models a permission entry in a policy file which is not included * in the default set of permissions used by the PolicyEditor, ie, permissions * not defined in the enum PolicyEditorPermissions. */ public class CustomPermission implements Comparable { /* Matches eg 'permission java.io.FilePermission "${user.home}${/}*", "read";' * eg permissions that have a permission type, target, and actions set. */ public static final Pattern ACTIONS_PERMISSION = Pattern.compile("\\s*permission\\s+([\\w\\.]+)\\s+\"([^\"]+)\",\\s*\"([^\"]*)\";.*"); /* Matches eg 'permission java.lang.RuntimePermission "queuePrintJob";' * eg permissions that have a permission type and target, but no actions. */ public static final Pattern TARGET_PERMISSION = Pattern.compile("\\s*permission\\s+([\\w\\.]+)\\s+\"([^\"]+)\";.*"); public final String type, target, actions; /** * Constructor for custom basic permissions (ie those without actions). This is equivalent * to CustomPermission(type, target, "") * @param type eg java.io.FilePermission * @param target eg ${user.home}${/}* */ public CustomPermission(final String type, final String target) { this(type, target, ""); } /** * Constructor for custom permissions with actions * @param type eg java.io.FilePermission * @param target eg ${user.home}${/}* * @param actions eg read,write */ public CustomPermission(final String type, final String target, final String actions) { this.type = type; this.target = target; this.actions = actions; } public CustomPermission(final PermissionType type, final PermissionTarget target) { this(type, target, PermissionActions.NONE); } public CustomPermission(final PermissionType type, final PermissionTarget target, final PermissionActions actions) { this(type.type, target.target, actions.rawString()); } /** * Get a CustomPermission from a policy file permission entry string. This is the full * entry string, eg `permission java.io.FilePermission "${user.home}${/}* "read";` * @param string the permission entry string * @return a CustomPermission representing this string */ public static CustomPermission fromString(final String string) { final String typeStr, targetStr, actionsStr; final Matcher actionMatcher = ACTIONS_PERMISSION.matcher(string); if (actionMatcher.matches()) { typeStr = actionMatcher.group(1); targetStr = actionMatcher.group(2); actionsStr = actionMatcher.group(3); } else { final Matcher targetMatcher = TARGET_PERMISSION.matcher(string); if (!targetMatcher.matches()) { return null; } typeStr = targetMatcher.group(1); targetStr = targetMatcher.group(2); actionsStr = ""; } return new CustomPermission(typeStr, targetStr, actionsStr); } @Override public String toString() { final StringBuilder sb = new StringBuilder(); sb.append("permission "); sb.append(type); sb.append(" \""); sb.append(target); sb.append("\""); if (!this.actions.equals(PermissionActions.NONE.rawString())) { sb.append(", \""); sb.append(actions); sb.append("\""); } sb.append(";"); return sb.toString(); } @Override public boolean equals(final Object o) { if (this == o) return true; if (!(o instanceof CustomPermission)) return false; final CustomPermission that = (CustomPermission) o; if (!actions.equals(that.actions)) return false; if (!target.equals(that.target)) return false; if (!type.equals(that.type)) return false; return true; } @Override public int hashCode() { int result = type.hashCode(); result = 31 * result + target.hashCode(); result = 31 * result + actions.hashCode(); return result; } @Override public int compareTo(final CustomPermission o) { if (this == o) { return 0; } final int typeComparison = this.type.compareTo(o.type); if (typeComparison != 0) { return typeComparison; } final int targetComparison = this.target.compareTo(o.target); if (targetComparison != 0) { return targetComparison; } final int actionsComparison = this.actions.compareTo(o.actions); if (actionsComparison != 0) { return actionsComparison; } return 0; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/PaxHeaders.17941/package-info.java0000644000000000000000000000013212654402377025535 xustar0030 mtime=1454507263.227432714 30 atime=1454507327.148580217 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/package-info.java0000644000175000002070000002262512654402377026267 0ustar00jvanekmock00000000000000/* package-info.java Copyright (C) 2015 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.*/ /** *
    {@code
            ITW-thread(s)               | dialogs-thread                                                                                                                                  X
                                        |                                                                                                                                                 X
       presteps in SecurtyDialogs       |                                                                                                                                                 X
          # eg handle trustall/none     |                                                                                                                                                 X
          # eg handle or remeber itself |                                                                                                                                                 X
            actions                     |                                                                                                                                                 X
                |                       |                                                                                                                                                 X
        prepare message                 |                                                                                                                                                 X
                   # set JNLPfile       |                                                                                                                                                 X
                   # set type of dialog |                                                                                                                                                 X
                       see              |                                                                                                                                                 X
                   # extrass...         |                                                                                                                                                 X
                   # lock               |                                                                                                                                                 X
                |                       |                                                                                                                                                 X
        post message to queue           |                                                                                                                                                 X
                | >------------------------------------> | <----------------------------------------------------------------------------------------------------------------------------| X
        wait for result from            |            read message from queue                                                                                                            | X
              getUserResponse(lock lock)|                |                                                                                                                              | X
                                        |            create instance of dialogue                                                                                                        | X
                                        |                |                                                                                                                              | X
                                        |            acording to type of dialogue, create and place panel                                                                               | X
                                        |                |                                                                                                                              | X
                                        |                |                                                                                                                              | X
                                        |                |                                                                                                                              | X
                                        |                |                                                                                                                              | X
                                        |                |                                                                                                                              | X
                                        |            add closing and disposing listener(s) to button(s)                                                                                 | X
                                        |                |     * set return value to listner?                                                                                           | X
                                        |                |                                                                                                                              | X
                                        |                      accordingo to set value, set default selected button?                                                                    | X
                                        |                |                                                                                                                              | X
                                        |            if his applet+action was already stored in .appletSecurity include text approved/denyed and when                                   | X
                                        |                |                                                                                                                              | X
                                        |            wait for user to click buttton or close dialogue                                                                                   | X
                                        |                |                                                                                                                              | X
                                        |                --> set selected value (via listener?) to message, dispose dialog --|                                                          | X
                                        |                                                                                    |                                                          | X
                                        |                                                                                    |                                                          | X
                | <------------------------------------------------------------------------------------------< unlock lock of this messge  >--------------------------------------------| X
      read result from message          |                                                                                                                                                 X
                |                       |                                                                                                                                                 X
       continue accordingly             |                                                                                                                                                 X
                                                                                                                                                                                          X
    }
     *
    */ package net.sourceforge.jnlp.security; icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/PaxHeaders.17941/dialogs0000644000000000000000000000013212654402377023713 xustar0030 mtime=1454507263.226432728 30 atime=1454507658.780157344 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/dialogs/0000755000175000002070000000000012654402377024513 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/dialogs/PaxHeaders.17941/apptrustwarningpanel0000644000000000000000000000013212654402377030203 xustar0030 mtime=1454507263.227432714 30 atime=1454507658.780157344 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/0000755000175000002070000000000012654402377031003 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/PaxHeaders.17941/U0000644000000000000000000000033212654402377030411 xustar00128 path=icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/UnsignedAppletTrustWarningPanel.java 30 mtime=1454507263.227432714 30 atime=1454507327.148580217 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/UnsignedAppletTrus0000644000175000002070000001126712654402377034535 0ustar00jvanekmock00000000000000/* Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.dialogs.apptrustwarningpanel; import java.awt.BorderLayout; import java.awt.Dimension; import java.net.URL; import static net.sourceforge.jnlp.runtime.Translator.R; import javax.swing.ImageIcon; import javax.swing.JFrame; import net.sourceforge.jnlp.JNLPFile; import net.sourceforge.jnlp.security.SecurityDialog; import net.sourceforge.jnlp.security.appletextendedsecurity.AppletSecurityActions; import net.sourceforge.jnlp.security.appletextendedsecurity.ExecuteAppletAction; import net.sourceforge.jnlp.security.appletextendedsecurity.UnsignedAppletActionEntry; import net.sourceforge.jnlp.security.appletextendedsecurity.UnsignedAppletTrustConfirmation; public class UnsignedAppletTrustWarningPanel extends AppTrustWarningPanel { public UnsignedAppletTrustWarningPanel(SecurityDialog securityDialog, final JNLPFile file, final ActionChoiceListener listener) { super(file, listener); this.INFO_PANEL_HEIGHT = 250; addComponents(); if (securityDialog != null) { securityDialog.setMinimumSize(new Dimension(600, 400)); } } @Override protected ImageIcon getInfoImage() { final String location = "net/sourceforge/jnlp/resources/info-small.png"; return new ImageIcon(ClassLoader.getSystemClassLoader().getResource(location)); } protected static String getTopPanelTextKey() { return "SUnsignedSummary"; } protected static String getInfoPanelTextKey() { return "SUnsignedDetail"; } protected static String getQuestionPanelTextKey() { return "SUnsignedQuestion"; } @Override protected String getTopPanelText() { return htmlWrap(R(getTopPanelTextKey())); } @Override protected String getInfoPanelText() { String text = R(getInfoPanelTextKey(), file.getCodeBase(), file.getSourceLocation()); UnsignedAppletActionEntry rememberedEntry = UnsignedAppletTrustConfirmation.getStoredEntry(file, AppletSecurityActions.UNSIGNED_APPLET_ACTION); if (rememberedEntry != null) { ExecuteAppletAction rememberedAction = rememberedEntry.getAppletSecurityActions().getUnsignedAppletAction(); if (rememberedAction == ExecuteAppletAction.YES) { text += "
    " + R("SUnsignedAllowedBefore", rememberedEntry.getLocalisedTimeStamp()); } else if (rememberedAction == ExecuteAppletAction.NO) { text += "
    " + R("SUnsignedRejectedBefore", rememberedEntry.getLocalisedTimeStamp()); } } return htmlWrap(text); } @Override protected String getQuestionPanelText() { return htmlWrap(R(getQuestionPanelTextKey())); } public static void main(String[] args) throws Exception { UnsignedAppletTrustWarningPanel w = new UnsignedAppletTrustWarningPanel(null, new JNLPFile(new URL("http://www.geogebra.org/webstart/geogebra.jnlp")), null); JFrame f = new JFrame(); f.setSize(600, 400); f.add(w, BorderLayout.CENTER); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.setVisible(true); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/PaxHeaders.17941/P0000644000000000000000000000033612654402377030410 xustar00132 path=icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/PartiallySignedAppTrustWarningPanel.java 30 mtime=1454507263.227432714 30 atime=1454507327.148580217 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/PartiallySignedApp0000644000175000002070000001504312654402377034465 0ustar00jvanekmock00000000000000/* Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.dialogs.apptrustwarningpanel; import java.awt.Dimension; import static net.sourceforge.jnlp.runtime.Translator.R; import java.security.cert.Certificate; import java.security.cert.X509Certificate; import javax.swing.ImageIcon; import javax.swing.JButton; import net.sourceforge.jnlp.JNLPFile; import net.sourceforge.jnlp.PluginBridge; import net.sourceforge.jnlp.runtime.JNLPClassLoader.SecurityDelegate; import net.sourceforge.jnlp.security.SecurityDialog; import net.sourceforge.jnlp.security.SecurityUtil; import net.sourceforge.jnlp.security.appletextendedsecurity.AppletSecurityActions; import net.sourceforge.jnlp.security.appletextendedsecurity.ExecuteAppletAction; import net.sourceforge.jnlp.security.appletextendedsecurity.UnsignedAppletActionEntry; import net.sourceforge.jnlp.security.appletextendedsecurity.UnsignedAppletTrustConfirmation; import net.sourceforge.jnlp.security.dialogs.TemporaryPermissionsButton; import net.sourceforge.jnlp.tools.CertInformation; import net.sourceforge.jnlp.tools.JarCertVerifier; public class PartiallySignedAppTrustWarningPanel extends AppTrustWarningPanel { private final JarCertVerifier jcv; private final JButton sandboxButton; private final JButton advancedOptionsButton; public PartiallySignedAppTrustWarningPanel(JNLPFile file, ActionChoiceListener actionChoiceListener, SecurityDialog securityDialog, SecurityDelegate securityDelegate) { super(file, actionChoiceListener); this.jcv = (JarCertVerifier) securityDialog.getCertVerifier(); this.INFO_PANEL_HEIGHT = 250; sandboxButton = new JButton(); sandboxButton.setText(R("ButSandbox")); sandboxButton.addActionListener(chosenActionSetter(ExecuteAppletAction.SANDBOX)); advancedOptionsButton = new TemporaryPermissionsButton(file, securityDelegate, sandboxButton); buttons.add(1, sandboxButton); buttons.add(2, advancedOptionsButton); addComponents(); if (securityDialog != null) { securityDialog.setMinimumSize(new Dimension(600, 400)); } } private String getAppletInfo() { Certificate c = jcv.getPublisher(null); String publisher = ""; String from = ""; try { if (c instanceof X509Certificate) { publisher = SecurityUtil.getCN(((X509Certificate) c).getSubjectX500Principal().getName()); } } catch (Exception e) { } try { if (file instanceof PluginBridge) { from = file.getNotNullProbalbeCodeBase().toExternalForm(); } else { from = file.getInformation().getHomepage().toExternalForm(); } } catch (Exception e) { } return "
    " + R("Publisher") + ": " + publisher + "
    " + R("From") + ": " + from + ""; } private String getSigningInfo() { CertInformation info = jcv.getCertInformation(jcv.getCertPath(null)); if (info != null && info.isRootInCacerts() && !info.hasSigningIssues()) { return R("SSigVerified"); } else if (info != null && info.isRootInCacerts()) { return R("SSigUnverified"); } else { return R("SSignatureError"); } } @Override protected ImageIcon getInfoImage() { final String location = "net/sourceforge/jnlp/resources/warning.png"; return new ImageIcon(ClassLoader.getSystemClassLoader().getResource(location)); } protected static String getTopPanelTextKey() { return "SPartiallySignedSummary"; } protected static String getInfoPanelTextKey() { return "SPartiallySignedDetail"; } protected static String getQuestionPanelTextKey() { return "SPartiallySignedQuestion"; } @Override protected String getTopPanelText() { return htmlWrap(R(getTopPanelTextKey())); } @Override protected String getInfoPanelText() { String text = getAppletInfo(); text += "

    " + R(getInfoPanelTextKey(), file.getCodeBase(), file.getSourceLocation()); text += "

    " + getSigningInfo(); UnsignedAppletActionEntry rememberedEntry = UnsignedAppletTrustConfirmation.getStoredEntry(file, AppletSecurityActions.UNSIGNED_APPLET_ACTION); if (rememberedEntry != null) { ExecuteAppletAction rememberedAction = rememberedEntry.getAppletSecurityActions().getUnsignedAppletAction(); if (rememberedAction == ExecuteAppletAction.YES) { text += "
    " + R("SUnsignedAllowedBefore", rememberedEntry.getLocalisedTimeStamp()); } else if (rememberedAction == ExecuteAppletAction.NO) { text += "
    " + R("SUnsignedRejectedBefore", rememberedEntry.getLocalisedTimeStamp()); } } return htmlWrap(text); } @Override protected String getQuestionPanelText() { return htmlWrap(R(getQuestionPanelTextKey())); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/PaxHeaders.17941/M0000644000000000000000000000032512654402377030403 xustar00123 path=icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/MatchingALACAttributePanel.java 30 mtime=1454507263.226432728 30 atime=1454507327.148580217 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/MatchingALACAttrib0000644000175000002070000001263412654402377034255 0ustar00jvanekmock00000000000000/* Copyright (C) 2008 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.dialogs.apptrustwarningpanel; import java.awt.BorderLayout; import java.awt.Dimension; import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; import java.util.HashSet; import java.util.Set; import javax.swing.ImageIcon; import javax.swing.JFrame; import net.sourceforge.jnlp.JNLPFile; import net.sourceforge.jnlp.ParseException; import net.sourceforge.jnlp.runtime.Translator; import static net.sourceforge.jnlp.runtime.Translator.R; import net.sourceforge.jnlp.security.SecurityDialog; import net.sourceforge.jnlp.security.appletextendedsecurity.AppletSecurityActions; import net.sourceforge.jnlp.security.appletextendedsecurity.ExecuteAppletAction; import net.sourceforge.jnlp.security.appletextendedsecurity.UnsignedAppletActionEntry; import net.sourceforge.jnlp.security.appletextendedsecurity.UnsignedAppletTrustConfirmation; import net.sourceforge.jnlp.util.UrlUtils; /** * http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/security/manifest.html#app_library */ public class MatchingALACAttributePanel extends AppTrustWarningPanel { private final String title; private final String codebase; private final String remoteUrls; public MatchingALACAttributePanel(SecurityDialog x, JNLPFile file, String codebase, String remoteUrls, ActionChoiceListener actionChoiceListener) { super(file, actionChoiceListener); this.title = super.getAppletTitle(); this.codebase = codebase; this.remoteUrls = remoteUrls; TOP_PANEL_HEIGHT = 250; addComponents(); if (x != null) { x.setMinimumSize(new Dimension(600, 400)); } } @Override protected ImageIcon getInfoImage() { final String location = "net/sourceforge/jnlp/resources/question.png"; return new ImageIcon(ClassLoader.getSystemClassLoader().getResource(location)); } @Override protected String getTopPanelText() { return htmlWrap(Translator.R("ALACAMatchingMainTitle", title, codebase, remoteUrls)); } @Override protected String getInfoPanelText() { String r = Translator.R("ALACAMatchingInfo"); UnsignedAppletActionEntry rememberedEntry = UnsignedAppletTrustConfirmation.getStoredEntry(file, AppletSecurityActions.MATCHING_ALACA_ACTION); if (rememberedEntry != null) { ExecuteAppletAction rememberedAction = rememberedEntry.getAppletSecurityActions().getMatchingAlacaAction(); if (rememberedAction == ExecuteAppletAction.YES) { r += "
    " + R("SUnsignedAllowedBefore", rememberedEntry.getLocalisedTimeStamp()); } else if (rememberedAction == ExecuteAppletAction.NO) { r += "
    " + R("SUnsignedRejectedBefore", rememberedEntry.getLocalisedTimeStamp()); } } return r; } @Override protected String getQuestionPanelText() { return "";//htmlWrap(Translator.R("SRememberOption")); } @Override public String getAppletTitle() { return ""; } public static void main(String[] args) throws MalformedURLException, IOException, ParseException { Set s = new HashSet(); s.add(new URL("http:/blah.com/blah")); s.add(new URL("http:/blah.com/blah/blah")); MatchingALACAttributePanel w = new MatchingALACAttributePanel(null, new JNLPFile(new URL("http://www.geogebra.org/webstart/geogebra.jnlp")), "http://nbblah.url", UrlUtils.setOfUrlsToHtmlList(s), new ActionChoiceListener() { @Override public void actionChosen(AppSigningWarningAction action) { } }); JFrame f = new JFrame(); f.setSize(600, 400); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.add(w, BorderLayout.CENTER); f.setVisible(true); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/PaxHeaders.17941/A0000644000000000000000000000031712654402377030370 xustar00117 path=icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/AppTrustWarningPanel.java 30 mtime=1454507263.226432728 30 atime=1454507327.148580217 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/AppTrustWarningPan0000644000175000002070000003330312654402377034477 0ustar00jvanekmock00000000000000/* Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.dialogs.apptrustwarningpanel; import static net.sourceforge.jnlp.runtime.Translator.R; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Desktop; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.Font; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.IOException; import java.net.URISyntaxException; import java.util.ArrayList; import java.util.List; import javax.swing.BorderFactory; import javax.swing.BoxLayout; import javax.swing.ButtonGroup; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JDialog; import javax.swing.JEditorPane; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JRadioButton; import javax.swing.SwingConstants; import javax.swing.event.HyperlinkEvent; import javax.swing.event.HyperlinkListener; import net.sourceforge.jnlp.JNLPFile; import net.sourceforge.jnlp.PluginBridge; import static net.sourceforge.jnlp.runtime.Translator.R; import net.sourceforge.jnlp.security.appletextendedsecurity.ExecuteAppletAction; import net.sourceforge.jnlp.security.appletextendedsecurity.ExtendedAppletSecurityHelp; import net.sourceforge.jnlp.util.ScreenFinder; import net.sourceforge.jnlp.util.logging.OutputController; /* * This class is meant to provide a common layout and functionality for warning dialogs * that appear when the user needs to confirm the running of applets/applications. * Subclasses include UnsignedAppletTrustWarningPanel, for unsigned plugin applets, and * PartiallySignedAppTrustWarningPanel, for partially signed JNLP applications as well as * plugin applets. New implementations should be added to the unit test at * unit/net/sourceforge/jnlp/security/AppTrustWarningPanelTest */ public abstract class AppTrustWarningPanel extends JPanel { /* * Details of decided action. */ public static class AppSigningWarningAction { private ExecuteAppletAction action; private boolean applyToCodeBase; public AppSigningWarningAction(ExecuteAppletAction action, boolean applyToCodeBase) { this.action = action; this.applyToCodeBase = applyToCodeBase; } public ExecuteAppletAction getAction() { return action; } public boolean rememberForCodeBase() { return applyToCodeBase; } } /* * Callback for when action is decided. */ public static interface ActionChoiceListener { void actionChosen(AppSigningWarningAction action); } protected int PANE_WIDTH = 500; protected int TOP_PANEL_HEIGHT = 60; protected int INFO_PANEL_HEIGHT = 160; protected int INFO_PANEL_HINT_HEIGHT = 25; protected int QUESTION_PANEL_HEIGHT = 35; protected List buttons; protected JButton allowButton; protected JButton rejectButton; protected JButton helpButton; protected JCheckBox permanencyCheckBox; protected JRadioButton applyToAppletButton; protected JRadioButton applyToCodeBaseButton; protected JNLPFile file; protected ActionChoiceListener actionChoiceListener; /* * Subclasses should call addComponents() IMMEDIATELY after calling the super() constructor! */ public AppTrustWarningPanel(JNLPFile file, ActionChoiceListener actionChoiceListener) { this.file = file; this.actionChoiceListener = actionChoiceListener; this.buttons = new ArrayList(); allowButton = new JButton(R("ButProceed")); rejectButton = new JButton(R("ButCancel")); helpButton = new JButton(R("APPEXTSECguiPanelHelpButton")); allowButton.addActionListener(chosenActionSetter(ExecuteAppletAction.YES)); rejectButton.addActionListener(chosenActionSetter(ExecuteAppletAction.NO)); helpButton.addActionListener(getHelpButtonAction()); buttons.add(allowButton); buttons.add(rejectButton); buttons.add(helpButton); } /* * Provides an image to be displayed near the upper left corner of the dialog. */ protected abstract ImageIcon getInfoImage(); /* * Provides a short description of why the dialog is appearing. The message is expected to be HTML-formatted. */ protected abstract String getTopPanelText(); /* * Provides in-depth information on why the dialog is appearing. The message is expected to be HTML-formatted. */ protected abstract String getInfoPanelText(); /* * This provides the text for the final prompt to the user. The message is expected to be HTML formatted. * The user's action is a direct response to this question. */ protected abstract String getQuestionPanelText(); public final JButton getAllowButton() { return allowButton; } public final JButton getRejectButton() { return rejectButton; } protected ActionListener getHelpButtonAction() { return new ActionListener() { @Override public void actionPerformed(ActionEvent e) { JDialog d = new ExtendedAppletSecurityHelp(null, false, "dialogue"); ScreenFinder.centerWindowsToCurrentScreen(d); d.setVisible(true); } }; } protected static String htmlWrap(String text) { return "" + text + ""; } private void setupTopPanel() { final String topLabelText = getTopPanelText(); JLabel topLabel = new JLabel(topLabelText, getInfoImage(), SwingConstants.LEFT); topLabel.setFont(new Font(topLabel.getFont().toString(), Font.BOLD, 12)); JPanel topPanel = new JPanel(new BorderLayout()); topPanel.setBackground(Color.WHITE); topPanel.add(topLabel, BorderLayout.CENTER); topPanel.setPreferredSize(new Dimension(PANE_WIDTH, TOP_PANEL_HEIGHT)); topPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); add(topPanel); } protected String getAppletTitle() { String title; try { if (file instanceof PluginBridge) { title = file.getTitle(); } else { title = file.getInformation().getTitle(); } } catch (Exception e) { title = ""; } return title; } private void setupInfoPanel() { JPanel infoPanel = new JPanel(new BorderLayout()); String titleText = getAppletTitle(); JLabel titleLabel = new JLabel(titleText); titleLabel.setFont(new Font(titleLabel.getFont().getName(), Font.BOLD, 18)); String infoLabelText = getInfoPanelText(); JEditorPane infoLabel = new JEditorPane("text/html", htmlWrap(infoLabelText)); infoLabel.setBackground(infoPanel.getBackground()); infoLabel.setEditable(false); infoLabel.addHyperlinkListener(new HyperlinkListener() { @Override public void hyperlinkUpdate(HyperlinkEvent e) { try { if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { Desktop.getDesktop().browse(e.getURL().toURI()); } } catch (IOException ex) { OutputController.getLogger().log(ex); } catch (URISyntaxException ex) { OutputController.getLogger().log(ex); } } }); int panelHeight = titleLabel.getHeight() + INFO_PANEL_HEIGHT + INFO_PANEL_HINT_HEIGHT; infoPanel.add(titleLabel, BorderLayout.PAGE_START); infoPanel.add(infoLabel, BorderLayout.CENTER); infoPanel.setPreferredSize(new Dimension(PANE_WIDTH, panelHeight)); infoPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); add(infoPanel); } private void setupQuestionsPanel() { JPanel questionPanel = new JPanel(new BorderLayout()); final String questionPanelText = getQuestionPanelText(); questionPanel.add(new JLabel(questionPanelText), BorderLayout.EAST); questionPanel.setPreferredSize(new Dimension(PANE_WIDTH, QUESTION_PANEL_HEIGHT)); questionPanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 10)); add(questionPanel); } private JPanel createMatchOptionsPanel() { JPanel matchOptionsPanel = new JPanel(new FlowLayout(FlowLayout.LEFT)); ButtonGroup group = new ButtonGroup(); applyToAppletButton = new JRadioButton(R("SRememberAppletOnly")); applyToAppletButton.setSelected(true); applyToAppletButton.setEnabled(false); // Start disabled until 'Remember this option' is selected applyToCodeBaseButton = new JRadioButton(htmlWrap(R("SRememberCodebase", file.getCodeBase()))); applyToCodeBaseButton.setEnabled(false); group.add(applyToAppletButton); group.add(applyToCodeBaseButton); matchOptionsPanel.add(applyToAppletButton); matchOptionsPanel.add(applyToCodeBaseButton); return matchOptionsPanel; } private JPanel createCheckBoxPanel() { JPanel checkBoxPanel = new JPanel(new BorderLayout()); permanencyCheckBox = new JCheckBox(htmlWrap(R("SRememberOption"))); permanencyCheckBox.addActionListener(permanencyListener()); checkBoxPanel.setBorder(BorderFactory.createEmptyBorder(0, 15, 0, 0)); checkBoxPanel.add(permanencyCheckBox, BorderLayout.SOUTH); return checkBoxPanel; } private JPanel createButtonPanel() { JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); for (final JButton button : buttons) { buttonPanel.add(button); } buttonPanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 10, 10)); return buttonPanel; } // Set up 'Remember Option' checkbox & Proceed/Cancel buttons private void setupButtonAndCheckBoxPanel() { JPanel outerPanel = new JPanel(new BorderLayout()); JPanel rememberPanel = new JPanel(new GridLayout(2 /*rows*/, 1 /*column*/)); rememberPanel.add(createMatchOptionsPanel()); rememberPanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 10)); outerPanel.add(createCheckBoxPanel(), BorderLayout.WEST); outerPanel.add(rememberPanel, BorderLayout.SOUTH); outerPanel.add(createButtonPanel(), BorderLayout.EAST); add(outerPanel); } /** * Creates the actual GUI components, and adds it to this panel. This should be called by all subclasses * IMMEDIATELY after calling the super() constructor! */ protected final void addComponents() { setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); setupTopPanel(); setupInfoPanel(); setupQuestionsPanel(); setupButtonAndCheckBoxPanel(); } // Toggles whether 'match applet' or 'match codebase' options are greyed out protected ActionListener permanencyListener() { return new ActionListener() { @Override public void actionPerformed(ActionEvent e) { applyToAppletButton.setEnabled(permanencyCheckBox.isSelected()); applyToCodeBaseButton.setEnabled(permanencyCheckBox.isSelected()); } }; } protected ActionListener chosenActionSetter(final ExecuteAppletAction action) { return new ActionListener() { @Override public void actionPerformed(ActionEvent e) { ExecuteAppletAction realAction; if (action == ExecuteAppletAction.YES) { realAction = permanencyCheckBox.isSelected() ? ExecuteAppletAction.ALWAYS : ExecuteAppletAction.YES; } else if (action == ExecuteAppletAction.NO) { realAction = permanencyCheckBox.isSelected() ? ExecuteAppletAction.NEVER : ExecuteAppletAction.NO; } else { realAction = action; } boolean applyToCodeBase = applyToCodeBaseButton.isSelected(); actionChoiceListener.actionChosen(new AppSigningWarningAction(realAction, applyToCodeBase)); } }; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/PaxHeaders.17941/A0000644000000000000000000000031712654402377030370 xustar00118 path=icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/AppTrustWarningDialog.java 30 mtime=1454507263.226432728 29 atime=1454507327.14758023 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/AppTrustWarningDia0000644000175000002070000000774412654402377034470 0ustar00jvanekmock00000000000000/* Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.dialogs.apptrustwarningpanel; import net.sourceforge.jnlp.JNLPFile; import net.sourceforge.jnlp.runtime.JNLPClassLoader.SecurityDelegate; import net.sourceforge.jnlp.security.SecurityDialog; import net.sourceforge.jnlp.security.dialogs.SecurityDialogPanel; import net.sourceforge.jnlp.security.dialogs.apptrustwarningpanel.AppTrustWarningPanel.ActionChoiceListener; import net.sourceforge.jnlp.security.dialogs.apptrustwarningpanel.AppTrustWarningPanel.AppSigningWarningAction; /** * A panel that confirms that the user is OK with unsigned code running. */ public class AppTrustWarningDialog extends SecurityDialogPanel { private ActionChoiceListener listener; private AppTrustWarningDialog(final SecurityDialog dialog) { super(dialog); } public static AppTrustWarningDialog unsigned(final SecurityDialog dialog, final JNLPFile file) { final AppTrustWarningDialog warningDialog = new AppTrustWarningDialog(dialog); warningDialog.add(new UnsignedAppletTrustWarningPanel(dialog, file, warningDialog.getActionChoiceListener())); return warningDialog; } public static AppTrustWarningDialog partiallySigned(final SecurityDialog dialog, final JNLPFile file, final SecurityDelegate securityDelegate) { final AppTrustWarningDialog warningDialog = new AppTrustWarningDialog(dialog); warningDialog.add(new PartiallySignedAppTrustWarningPanel(file, warningDialog.getActionChoiceListener(), dialog, securityDelegate)); return warningDialog; } public static AppTrustWarningDialog matchingAlaca(SecurityDialog x, JNLPFile file, String codebase, String remoteUrls) { final AppTrustWarningDialog warningDialog = new AppTrustWarningDialog(x); warningDialog.add(new MatchingALACAttributePanel(x, file, codebase, remoteUrls, warningDialog.getActionChoiceListener())); return warningDialog; } private ActionChoiceListener getActionChoiceListener() { if (listener == null) { listener = createActionChoiceListener(); } return listener; } private ActionChoiceListener createActionChoiceListener() { return new ActionChoiceListener() { @Override public void actionChosen(final AppSigningWarningAction action) { parent.setValue(action); parent.dispose(); } }; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/dialogs/PaxHeaders.17941/TemporaryPermissionsBu0000644000000000000000000000013112654402377030417 xustar0030 mtime=1454507263.225432741 29 atime=1454507327.14758023 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/dialogs/TemporaryPermissionsButton.java0000644000175000002070000002111312654402377032766 0ustar00jvanekmock00000000000000/* Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.dialogs; import static net.sourceforge.jnlp.runtime.Translator.R; import java.awt.Component; import java.awt.Dialog.ModalityType; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.net.MalformedURLException; import java.net.URL; import java.security.Permission; import java.util.Collection; import java.util.HashSet; import javax.swing.AbstractButton; import javax.swing.JButton; import javax.swing.JCheckBoxMenuItem; import javax.swing.JMenuItem; import javax.swing.JPopupMenu; import net.sourceforge.jnlp.JNLPFile; import net.sourceforge.jnlp.config.PathsAndFiles; import net.sourceforge.jnlp.runtime.JNLPClassLoader.SecurityDelegate; import net.sourceforge.jnlp.security.policyeditor.PolicyEditor; import net.sourceforge.jnlp.security.policyeditor.PolicyEditor.PolicyEditorWindow; import net.sourceforge.jnlp.security.policyeditor.PolicyEditorPermissions; import net.sourceforge.jnlp.util.logging.OutputController; public class TemporaryPermissionsButton extends JButton { private final JPopupMenu menu; private final JButton linkedButton; private PolicyEditorWindow policyEditorWindow = null; private final JNLPFile file; private final SecurityDelegate securityDelegate; private final Collection temporaryPermissions = new HashSet<>(); public TemporaryPermissionsButton(final JNLPFile file, final SecurityDelegate securityDelegate, final JButton linkedButton) { /* If any of the above parameters are null, then the button cannot function - in particular, a null SecurityDelegate * would prevent temporary permissions from being able to be added; a null JNLPFile would prevent PolicyEditor from * being launched with a sensible codebase for the current applet; and a null JButton would prevent the Sandbox button * from being automatically invoked when a set of temporary permissions are selected by the user. */ super("\u2630"); this.menu = createPolicyPermissionsMenu(); this.linkedButton = linkedButton; this.file = file; this.securityDelegate = securityDelegate; if (file == null || securityDelegate == null || linkedButton == null) { this.setEnabled(false); OutputController.getLogger().log(OutputController.Level.MESSAGE_DEBUG, "Temporary Permissions Button disabled due to null fields." + " file: " + file + ", securityDelegate: " + securityDelegate + ", linkedButton: " + linkedButton); } else { linkedButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { securityDelegate.addPermissions(temporaryPermissions); } }); addMouseListener(new PolicyEditorPopupListener(this)); } } private JPopupMenu createPolicyPermissionsMenu() { final JPopupMenu policyMenu = new JPopupMenu(); final JMenuItem launchPolicyEditor = new JMenuItem(R("CertWarnPolicyEditorItem")); launchPolicyEditor.addActionListener(new PolicyEditorLaunchListener()); policyMenu.add(launchPolicyEditor); policyMenu.addSeparator(); final JCheckBoxMenuItem networkAccess = new JCheckBoxMenuItem(R("STempNetwork")); networkAccess.addActionListener(new TemporaryPermissionsListener(TemporaryPermissions.getPermissions(PolicyEditorPermissions.NETWORK))); policyMenu.add(networkAccess); final JCheckBoxMenuItem readLocalFilesAndProperties = new JCheckBoxMenuItem(R("STempReadFilesAndProperties")); readLocalFilesAndProperties.addActionListener(new TemporaryPermissionsListener(TemporaryPermissions.getPermissions(PolicyEditorPermissions.Group.ReadFileSystem))); policyMenu.add(readLocalFilesAndProperties); final JCheckBoxMenuItem writeLocalFilesAndProperties = new JCheckBoxMenuItem(R("STempWriteFilesAndProperties")); writeLocalFilesAndProperties.addActionListener(new TemporaryPermissionsListener(TemporaryPermissions.getPermissions(PolicyEditorPermissions.Group.WriteFileSystem))); policyMenu.add(writeLocalFilesAndProperties); final JCheckBoxMenuItem reflectionOnly = new JCheckBoxMenuItem(R("STempReflectionAndExternal")); reflectionOnly.addActionListener(new TemporaryPermissionsListener(TemporaryPermissions.getPermissions(PolicyEditorPermissions.Group.AccessUnownedCode))); policyMenu.add(reflectionOnly); final JCheckBoxMenuItem allMedia = new JCheckBoxMenuItem(R("STempAllMedia")); allMedia.addActionListener(new TemporaryPermissionsListener(TemporaryPermissions.getPermissions(PolicyEditorPermissions.Group.MediaAccess))); policyMenu.add(allMedia); return policyMenu; } private class TemporaryPermissionsListener implements ActionListener { private Collection permissions; public TemporaryPermissionsListener(final Collection permissions) { this.permissions = permissions; } @Override public void actionPerformed(final ActionEvent e) { if (!linkedButton.isEnabled()) { return; } AbstractButton checkBox = (AbstractButton) e.getSource(); if (checkBox.isSelected()) { temporaryPermissions.addAll(permissions); } else { temporaryPermissions.removeAll(permissions); } menu.setVisible(true); } } private class PolicyEditorLaunchListener implements ActionListener { @Override public void actionPerformed(final ActionEvent e) { final String rawFilepath = PathsAndFiles.JAVA_POLICY.getFullPath(); String filepath; try { filepath = new URL(rawFilepath).getPath(); } catch (final MalformedURLException mfue) { filepath = null; } if (policyEditorWindow == null || policyEditorWindow.getPolicyEditor().isClosed()) { policyEditorWindow = PolicyEditor.getPolicyEditorDialog(filepath); } else { policyEditorWindow.asWindow().toFront(); policyEditorWindow.asWindow().repaint(); } policyEditorWindow.setModalityType(ModalityType.DOCUMENT_MODAL); policyEditorWindow.getPolicyEditor().addNewCodebase(file.getNotNullProbalbeCodeBase().toString()); policyEditorWindow.asWindow().setVisible(true); menu.setVisible(false); } } private class PolicyEditorPopupListener extends MouseAdapter { private final Component parent; public PolicyEditorPopupListener(final Component parent) { this.parent = parent; } @Override public void mouseClicked(final MouseEvent e) { menu.show(parent, e.getX(), e.getY()); } } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/dialogs/PaxHeaders.17941/TemporaryPermissions.j0000644000000000000000000000013112654402377030360 xustar0030 mtime=1454507263.225432741 29 atime=1454507327.14758023 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/dialogs/TemporaryPermissions.java0000644000175000002070000001177112654402377031603 0ustar00jvanekmock00000000000000/* Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.dialogs; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.security.Permission; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.HashSet; import java.util.regex.Matcher; import java.util.regex.Pattern; import net.sourceforge.jnlp.security.policyeditor.PermissionActions; import net.sourceforge.jnlp.security.policyeditor.PolicyEditorPermissions; import net.sourceforge.jnlp.util.logging.OutputController; public class TemporaryPermissions { // Look for expandable properties in targets, eg ${user.home} or ${java.io.tmpdir} private static final Pattern expandablePattern = Pattern.compile("\\$\\{([a-zA-Z0-9\\.}]+)*\\}"); public static Collection getPermissions(final PolicyEditorPermissions... editorPermissions) { return getPermissions(Arrays.asList(editorPermissions)); } public static Collection getPermissions(final Collection editorPermissions) { final Collection col = new HashSet(); for (final PolicyEditorPermissions editorPerm : editorPermissions) { col.add(getPermission(editorPerm)); } return Collections.unmodifiableCollection(col); } public static Collection getPermissions(final PolicyEditorPermissions.Group permissionsGroup) { return getPermissions(permissionsGroup.getPermissions()); } public static Permission getPermission(final PolicyEditorPermissions editorPermission) { try { final Class clazz = Class.forName(editorPermission.getType().type); final Constructor ctor; final Permission perm; String target = editorPermission.getTarget().target; Matcher m = expandablePattern.matcher(target); while (m.find()) { // Expand any matches by reading from System properties, eg ${java.io.tmpdir} is /tmp on most systems target = m.replaceFirst(System.getProperty(m.group(1))); m = expandablePattern.matcher(target); } if (editorPermission.getActions().equals(PermissionActions.NONE)) { ctor = clazz.getDeclaredConstructor(new Class[] { String.class }); ctor.setAccessible(true); perm = (Permission) ctor.newInstance(target); } else { ctor = clazz.getDeclaredConstructor(new Class[] { String.class, String.class }); ctor.setAccessible(true); perm = (Permission) ctor.newInstance(target, collectionToString(editorPermission.getActions().getActions())); } return perm; } catch (final ClassNotFoundException | SecurityException | NoSuchMethodException | IllegalArgumentException | InstantiationException | IllegalAccessException | InvocationTargetException e) { OutputController.getLogger().log(e); return null; } } private static String collectionToString(final Collection col) { final StringBuilder sb = new StringBuilder(); int count = 0; for (final String str : col) { sb.append(str); if (count < col.size() - 1) { sb.append(","); } ++count; } return sb.toString(); } }icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/dialogs/PaxHeaders.17941/SingleCertInfoPane.jav0000644000000000000000000000013112654402377030150 xustar0030 mtime=1454507263.225432741 29 atime=1454507327.14758023 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/dialogs/SingleCertInfoPane.java0000644000175000002070000000632112654402377031037 0ustar00jvanekmock00000000000000/* SingleCertInfoPane.java Copyright (C) 2008 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.dialogs; import java.security.cert.X509Certificate; import java.util.ArrayList; import javax.swing.JTree; import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.TreeSelectionModel; import net.sourceforge.jnlp.security.CertVerifier; import net.sourceforge.jnlp.security.SecurityDialog; import net.sourceforge.jnlp.security.SecurityUtil; public class SingleCertInfoPane extends CertsInfoPane { public SingleCertInfoPane(SecurityDialog x, CertVerifier certVerifier) { super(x, certVerifier); } @Override protected void buildTree() { X509Certificate cert = parent.getCert(); String subjectString = SecurityUtil.getCN(cert.getSubjectX500Principal().getName()); String issuerString = SecurityUtil.getCN(cert.getIssuerX500Principal().getName()); DefaultMutableTreeNode top = new DefaultMutableTreeNode(subjectString + " (" + issuerString + ")"); tree = new JTree(top); tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); tree.addTreeSelectionListener(new TreeSelectionHandler()); } @Override protected void populateTable() { X509Certificate c = parent.getCert(); certNames = new String[1]; certsData = new ArrayList(); certsData.add(parseCert(c)); certNames[0] = SecurityUtil.getCN(c.getSubjectX500Principal().getName()) + " (" + SecurityUtil.getCN(c.getIssuerX500Principal().getName()) + ")"; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/dialogs/PaxHeaders.17941/SecurityDialogPanel.ja0000644000000000000000000000013112654402377030212 xustar0030 mtime=1454507263.224432754 29 atime=1454507327.14758023 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/dialogs/SecurityDialogPanel.java0000644000175000002070000001000712654402377031263 0ustar00jvanekmock00000000000000/* SecurityDialogPanel.java Copyright (C) 2008-2010 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.dialogs; import java.awt.BorderLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JComponent; import javax.swing.JPanel; import net.sourceforge.jnlp.security.CertVerifier; import net.sourceforge.jnlp.security.SecurityDialog; /** * Provides a JPanel for use in JNLP warning dialogs. */ public abstract class SecurityDialogPanel extends JPanel { protected SecurityDialog parent; protected JComponent initialFocusComponent = null; CertVerifier certVerifier = null; public SecurityDialogPanel(SecurityDialog dialog, CertVerifier certVerifier) { this.parent = dialog; this.certVerifier = certVerifier; this.setLayout(new BorderLayout()); } public SecurityDialogPanel(SecurityDialog dialog) { this.parent = dialog; this.setLayout(new BorderLayout()); } /** * Needed to get word wrap working in JLabels. */ public static String htmlWrap(String s) { return "" + s + ""; } /** * Create an ActionListener suitable for use with buttons. When this {@link ActionListener} * is invoked, it will set the value of the {@link SecurityDialog} and then dispossed. * * @param buttonIndex the index of the button. By convention 0 = Yes. 1 = No, 2 = Cancel * @return the ActionListener instance. */ protected ActionListener createSetValueListener(SecurityDialog dialog, int buttonIndex) { return new SetValueHandler(dialog, buttonIndex); } @Override public void setVisible(boolean aFlag) { super.setVisible(aFlag); requestFocusOnDefaultButton(); } public void requestFocusOnDefaultButton() { if (initialFocusComponent != null) { initialFocusComponent.requestFocusInWindow(); } } /** * Creates a handler that sets a dialog's value and then disposes it when activated * */ private static class SetValueHandler implements ActionListener { Integer buttonIndex; SecurityDialog dialog; public SetValueHandler(SecurityDialog dialog, int buttonIndex) { this.dialog = dialog; this.buttonIndex = buttonIndex; } @Override public void actionPerformed(ActionEvent e) { dialog.setValue(buttonIndex); dialog.dispose(); } } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/dialogs/PaxHeaders.17941/PasswordAuthentication0000644000000000000000000000013112654402377030414 xustar0030 mtime=1454507263.224432754 29 atime=1454507327.14758023 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/dialogs/PasswordAuthenticationPane.java0000644000175000002070000001375312654402377032675 0ustar00jvanekmock00000000000000/* PasswordAuthenticationPane -- requests authentication information from users Copyright (C) 2010 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.dialogs; import static net.sourceforge.jnlp.runtime.Translator.R; import java.awt.Dimension; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.Insets; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JLabel; import javax.swing.JPasswordField; import javax.swing.JTextField; import net.sourceforge.jnlp.security.SecurityDialog; /** * Modal non-minimizable dialog to request http authentication credentials */ public class PasswordAuthenticationPane extends SecurityDialogPanel { private final JTextField jtfUserName = new JTextField(); private final JPasswordField jpfPassword = new JPasswordField(); private final String host; private final int port; private final String prompt; private final String type; public PasswordAuthenticationPane(SecurityDialog parent, Object[] extras) { super(parent); host = (String) extras[0]; port = (Integer) extras[1]; prompt = (String) extras[2]; type = (String) extras[3]; addComponents(); } /** * Initialized the dialog components */ public void addComponents() { JLabel jlInfo = new JLabel(""); jlInfo.setText("" + R("SAuthenticationPrompt", type, host, prompt) + ""); setLayout(new GridBagLayout()); JLabel jlUserName = new JLabel(R("Username")); JLabel jlPassword = new JLabel(R("Password")); JButton jbOK = new JButton(R("ButOk")); JButton jbCancel = new JButton(R("ButCancel")); jtfUserName.setSize(20, 10); jpfPassword.setSize(20, 10); GridBagConstraints c; c = new GridBagConstraints(); c.fill = GridBagConstraints.HORIZONTAL; c.gridx = 0; c.gridy = 0; c.gridwidth = 2; c.insets = new Insets(10, 5, 3, 3); add(jlInfo, c); c = new GridBagConstraints(); c.gridx = 0; c.gridy = 1; c.insets = new Insets(10, 5, 3, 3); add(jlUserName, c); c = new GridBagConstraints(); c.fill = GridBagConstraints.HORIZONTAL; c.gridx = 1; c.gridy = 1; c.insets = new Insets(10, 5, 3, 3); c.weightx = 1.0; add(jtfUserName, c); c = new GridBagConstraints(); c.gridx = 0; c.gridy = 2; c.insets = new Insets(5, 5, 3, 3); add(jlPassword, c); c = new GridBagConstraints(); c.fill = GridBagConstraints.HORIZONTAL; c.gridx = 1; c.gridy = 2; c.insets = new Insets(5, 5, 3, 3); c.weightx = 1.0; add(jpfPassword, c); c = new GridBagConstraints(); c.anchor = GridBagConstraints.SOUTHEAST; c.gridx = 1; c.gridy = 3; c.insets = new Insets(5, 5, 3, 70); c.weightx = 0.0; add(jbCancel, c); c = new GridBagConstraints(); c.anchor = GridBagConstraints.SOUTHEAST; c.gridx = 1; c.gridy = 3; c.insets = new Insets(5, 5, 3, 3); c.weightx = 0.0; add(jbOK, c); setMinimumSize(new Dimension(400, 150)); setMaximumSize(new Dimension(1024, 150)); setSize(400, 150); parent.setLocationRelativeTo(null); initialFocusComponent = jtfUserName; ActionListener acceptActionListener = new ActionListener() { @Override public void actionPerformed(ActionEvent e) { parent.setValue(new Object[] { jtfUserName.getText(), jpfPassword.getPassword() }); parent.dispose(); } }; ActionListener cancelActionListener = new ActionListener() { @Override public void actionPerformed(ActionEvent e) { parent.setValue(null); parent.dispose(); } }; // OK => read supplied info and pass it on jbOK.addActionListener(acceptActionListener); // Cancel => discard supplied info and pass on an empty auth jbCancel.addActionListener(cancelActionListener); // "return" key in either user or password field => OK jtfUserName.addActionListener(acceptActionListener); jpfPassword.addActionListener(acceptActionListener); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/dialogs/PaxHeaders.17941/MoreInfoPane.java0000644000000000000000000000013112654402377027154 xustar0030 mtime=1454507263.224432754 29 atime=1454507327.14758023 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/dialogs/MoreInfoPane.java0000644000175000002070000001203112654402377027675 0ustar00jvanekmock00000000000000/* MoreInfoPane.java Copyright (C) 2008 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.dialogs; import static net.sourceforge.jnlp.runtime.Translator.R; import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.List; import javax.swing.BorderFactory; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.SwingConstants; import net.sourceforge.jnlp.security.CertVerifier; import net.sourceforge.jnlp.security.SecurityDialog; /** * Provides the panel for the More Info dialog. This dialog shows details about an * application's signing status. * * @author Joshua Sumali */ public class MoreInfoPane extends SecurityDialogPanel { private boolean showSignedJNLPWarning; public MoreInfoPane(SecurityDialog x, CertVerifier certVerifier) { super(x, certVerifier); showSignedJNLPWarning= x.requiresSignedJNLPWarning(); addComponents(); } /** * Constructs the GUI components of this panel */ private void addComponents() { List details = certVerifier.getDetails(null); // Show signed JNLP warning if the signed main jar does not have a // signed JNLP file and the launching JNLP file contains special properties if(showSignedJNLPWarning) details.add(R("SJNLPFileIsNotSigned")); int numLabels = details.size(); JPanel errorPanel = new JPanel(new GridLayout(numLabels, 1)); errorPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); errorPanel.setPreferredSize(new Dimension(400, 70 * (numLabels))); for (int i = 0; i < numLabels; i++) { ImageIcon icon = null; if (details.get(i).equals(R("STrustedCertificate"))) icon = new ImageIcon((new sun.misc.Launcher()) .getClassLoader().getResource("net/sourceforge/jnlp/resources/info-small.png")); else icon = new ImageIcon((new sun.misc.Launcher()) .getClassLoader().getResource("net/sourceforge/jnlp/resources/warning-small.png")); errorPanel.add(new JLabel(htmlWrap(details.get(i)), icon, SwingConstants.LEFT)); } // Removes signed JNLP warning after it has been used. This will avoid // any alteration to certVerifier. if(showSignedJNLPWarning) details.remove(details.size()-1); JPanel buttonsPanel = new JPanel(new BorderLayout()); JButton certDetails = new JButton(R("SCertificateDetails")); certDetails.addActionListener(new CertInfoButtonListener()); JButton close = new JButton(R("ButClose")); close.addActionListener(createSetValueListener(parent, 0)); buttonsPanel.add(certDetails, BorderLayout.WEST); buttonsPanel.add(close, BorderLayout.EAST); buttonsPanel.setBorder(BorderFactory.createEmptyBorder(15, 15, 15, 15)); add(errorPanel, BorderLayout.NORTH); add(buttonsPanel, BorderLayout.SOUTH); } private class CertInfoButtonListener implements ActionListener { @Override public void actionPerformed(ActionEvent e) { SecurityDialog.showCertInfoDialog(parent.getCertVerifier(), parent); } } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/dialogs/PaxHeaders.17941/MissingPermissionsAttr0000644000000000000000000000013212654402377030413 xustar0030 mtime=1454507263.224432754 30 atime=1454507327.146580243 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/dialogs/MissingPermissionsAttributePanel.java0000644000175000002070000001360312654402377034072 0ustar00jvanekmock00000000000000/* AppletWarningPane.java Copyright (C) 2008 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.dialogs; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Desktop; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.Font; import java.awt.Image; import java.io.IOException; import java.net.URISyntaxException; import java.net.URL; import javax.imageio.ImageIO; import javax.swing.BorderFactory; import javax.swing.BoxLayout; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JEditorPane; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.SwingConstants; import javax.swing.event.HyperlinkEvent; import javax.swing.event.HyperlinkListener; import net.sourceforge.jnlp.runtime.Translator; import net.sourceforge.jnlp.security.SecurityDialog; import net.sourceforge.jnlp.util.logging.OutputController; public class MissingPermissionsAttributePanel extends SecurityDialogPanel { public MissingPermissionsAttributePanel(SecurityDialog x, String title, String codebase) { super(x); try { addComponents(title, codebase); } catch (Exception ex) { throw new RuntimeException(ex); } if (x != null) { x.setMinimumSize(new Dimension(400, 300)); } } protected final void addComponents(String title, String codebase) throws IOException { URL imgUrl = this.getClass().getResource("/net/sourceforge/jnlp/resources/warning.png"); ImageIcon icon = null; Image img = ImageIO.read(imgUrl); icon = new ImageIcon(img); String topLabelText = Translator.R("MissingPermissionsMainTitle", title, codebase); String bottomLabelText = Translator.R("MissingPermissionsInfo"); JLabel topLabel = new JLabel(htmlWrap(topLabelText), icon, SwingConstants.CENTER); topLabel.setFont(new Font(topLabel.getFont().toString(), Font.BOLD, 12)); JPanel topPanel = new JPanel(new BorderLayout()); topPanel.setBackground(Color.WHITE); topPanel.add(topLabel, BorderLayout.CENTER); topPanel.setPreferredSize(new Dimension(400, 80)); topPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); JEditorPane bottomLabel = new JEditorPane("text/html", htmlWrap(bottomLabelText)); bottomLabel.setEditable(false); bottomLabel.addHyperlinkListener(new HyperlinkListener() { @Override public void hyperlinkUpdate(HyperlinkEvent e) { try { if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { Desktop.getDesktop().browse(e.getURL().toURI()); } } catch (IOException ex) { OutputController.getLogger().log(ex); } catch (URISyntaxException ex) { OutputController.getLogger().log(ex); } } }); JPanel infoPanel = new JPanel(new BorderLayout()); infoPanel.add(bottomLabel, BorderLayout.CENTER); infoPanel.setPreferredSize(new Dimension(400, 80)); infoPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); bottomLabel.setBackground(infoPanel.getBackground()); //run and cancel buttons JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); JButton yes = new JButton(Translator.R("ButYes")); JButton no = new JButton(Translator.R("ButNo")); yes.addActionListener(createSetValueListener(parent, 0)); no.addActionListener(createSetValueListener(parent, 1)); initialFocusComponent = no; buttonPanel.add(yes); buttonPanel.add(no); buttonPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); //all of the above setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); add(topPanel); add(infoPanel); add(buttonPanel); } public static void main(String[] args) { MissingPermissionsAttributePanel w = new MissingPermissionsAttributePanel(null, "HelloWorld", "http://nbblah.url"); JFrame f = new JFrame(); f.setSize(400, 300); f.add(w, BorderLayout.CENTER); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.setVisible(true); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/dialogs/PaxHeaders.17941/MissingALACAttributePa0000644000000000000000000000013212654402377030112 xustar0030 mtime=1454507263.223432768 30 atime=1454507327.146580243 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/dialogs/MissingALACAttributePanel.java0000644000175000002070000001446112654402377032262 0ustar00jvanekmock00000000000000/* Copyright (C) 2008 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.dialogs; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Desktop; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.Font; import java.awt.Image; import java.io.IOException; import java.net.MalformedURLException; import java.net.URISyntaxException; import java.net.URL; import java.util.HashSet; import java.util.Set; import javax.imageio.ImageIO; import javax.swing.BorderFactory; import javax.swing.BoxLayout; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JEditorPane; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.SwingConstants; import javax.swing.event.HyperlinkEvent; import javax.swing.event.HyperlinkListener; import net.sourceforge.jnlp.runtime.Translator; import net.sourceforge.jnlp.security.SecurityDialog; import net.sourceforge.jnlp.util.UrlUtils; import net.sourceforge.jnlp.util.logging.OutputController; /** * http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/security/manifest.html#app_library */ public class MissingALACAttributePanel extends SecurityDialogPanel { public MissingALACAttributePanel(SecurityDialog x, String title, String codebase, String remoteUrls) { super(x); try { addComponents(title, codebase, remoteUrls); } catch (Exception ex) { throw new RuntimeException(ex); } if (x != null) { x.setMinimumSize(new Dimension(600, 400)); } } protected final void addComponents(String title, String codebase, String remoteUrls) throws IOException { URL imgUrl = this.getClass().getResource("/net/sourceforge/jnlp/resources/warning.png"); ImageIcon icon; Image img = ImageIO.read(imgUrl); icon = new ImageIcon(img); String topLabelText = Translator.R("ALACAMissingMainTitle", title, codebase, remoteUrls); String bottomLabelText = Translator.R("ALACAMissingInfo"); JLabel topLabel = new JLabel(htmlWrap(topLabelText), icon, SwingConstants.CENTER); topLabel.setFont(new Font(topLabel.getFont().toString(), Font.BOLD, 12)); JPanel topPanel = new JPanel(new BorderLayout()); topPanel.setBackground(Color.WHITE); topPanel.add(topLabel, BorderLayout.CENTER); topPanel.setPreferredSize(new Dimension(400, 80)); topPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); JEditorPane bottomLabel = new JEditorPane("text/html", htmlWrap(bottomLabelText)); bottomLabel.setEditable(false); bottomLabel.addHyperlinkListener(new HyperlinkListener() { @Override public void hyperlinkUpdate(HyperlinkEvent e) { try { if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { Desktop.getDesktop().browse(e.getURL().toURI()); } } catch (IOException ex) { OutputController.getLogger().log(ex); } catch (URISyntaxException ex) { OutputController.getLogger().log(ex); } } }); JPanel infoPanel = new JPanel(new BorderLayout()); infoPanel.add(bottomLabel, BorderLayout.CENTER); infoPanel.setPreferredSize(new Dimension(400, 80)); infoPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); bottomLabel.setBackground(infoPanel.getBackground()); //run and cancel buttons JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); JButton yes = new JButton(Translator.R("ButYes")); JButton no = new JButton(Translator.R("ButNo")); yes.addActionListener(createSetValueListener(parent, 0)); no.addActionListener(createSetValueListener(parent, 1)); initialFocusComponent = no; buttonPanel.add(yes); buttonPanel.add(no); buttonPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); //all of the above setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); add(topPanel); add(infoPanel); add(buttonPanel); } public static void main(String[] args) throws MalformedURLException { Set s = new HashSet(); s.add(new URL("http:/blah.com/blah")); s.add(new URL("http:/blah.com/blah/blah")); MissingALACAttributePanel w = new MissingALACAttributePanel(null, "HelloWorld", "http://nbblah.url", UrlUtils.setOfUrlsToHtmlList(s)); JFrame f = new JFrame(); f.setSize(600, 400); f.add(w, BorderLayout.CENTER); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.setVisible(true); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/dialogs/PaxHeaders.17941/CertsInfoPane.java0000644000000000000000000000013212654402377027333 xustar0030 mtime=1454507263.223432768 30 atime=1454507327.146580243 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/dialogs/CertsInfoPane.java0000644000175000002070000003323312654402377030062 0ustar00jvanekmock00000000000000/* CertsInfoPane.java Copyright (C) 2008 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.dialogs; import static net.sourceforge.jnlp.runtime.Translator.R; import java.util.ArrayList; import java.security.cert.CertPath; import java.security.cert.X509Certificate; import java.security.MessageDigest; /** * Do not remove this two unused imports, nor expands its "*" call. * It is workaround to allow itw to run on jdk8 and older and also on jdk9 and newer */ // jdk8 is using sun.misc.HexDumpEncoder, import sun.misc.*; // jdk9 is using sun.security.util.HexDumpEncoder import sun.security.util.*; import sun.security.x509.*; import javax.swing.*; import javax.swing.event.*; import javax.swing.table.*; import java.awt.*; import java.awt.event.*; import java.awt.datatransfer.Clipboard; import java.awt.datatransfer.StringSelection; import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.TreeSelectionModel; import net.sourceforge.jnlp.security.CertVerifier; import net.sourceforge.jnlp.security.SecurityDialog; import net.sourceforge.jnlp.security.SecurityUtil; /** * Provides the panel for the Certificate Info dialog. This dialog displays data from * X509Certificate(s) used in jar signing. * * @author Joshua Sumali */ public class CertsInfoPane extends SecurityDialogPanel { private CertPath certPath; protected JTree tree; private JTable table; private JTextArea output; private ListSelectionModel listSelectionModel; private ListSelectionModel tableSelectionModel; protected String[] certNames; private String[] columnNames = { R("Field"), R("Value") }; protected ArrayList certsData; public CertsInfoPane(SecurityDialog x, CertVerifier certVerifier) { super(x, certVerifier); addComponents(); } /** * Builds the JTree out of CertPaths. */ void buildTree() { certPath = parent.getCertVerifier().getCertPath(null); X509Certificate firstCert = ((X509Certificate) certPath.getCertificates().get(0)); String subjectString = SecurityUtil.getCN(firstCert.getSubjectX500Principal().getName()); String issuerString = SecurityUtil.getCN(firstCert.getIssuerX500Principal().getName()); DefaultMutableTreeNode top = new DefaultMutableTreeNode(subjectString + " (" + issuerString + ")"); //not self signed if (!firstCert.getSubjectDN().equals(firstCert.getIssuerDN()) && (certPath.getCertificates().size() > 1)) { X509Certificate secondCert = ((X509Certificate) certPath.getCertificates().get(1)); subjectString = SecurityUtil.getCN(secondCert.getSubjectX500Principal().getName()); issuerString = SecurityUtil.getCN(secondCert.getIssuerX500Principal().getName()); top.add(new DefaultMutableTreeNode(subjectString + " (" + issuerString + ")")); } tree = new JTree(top); tree.getSelectionModel().setSelectionMode (TreeSelectionModel.SINGLE_TREE_SELECTION); tree.addTreeSelectionListener(new TreeSelectionHandler()); } /** * Fills in certsNames, certsData with data from the certificates. */ protected void populateTable() { certNames = new String[certPath.getCertificates().size()]; certsData = new ArrayList(); for (int i = 0; i < certPath.getCertificates().size(); i++) { X509Certificate c = (X509Certificate) certPath.getCertificates().get(i); certsData.add(parseCert(c)); certNames[i] = SecurityUtil.getCN(c.getSubjectX500Principal().getName()) + " (" + SecurityUtil.getCN(c.getIssuerX500Principal().getName()) + ")"; } } protected String[][] parseCert(X509Certificate c) { String version = "" + c.getVersion(); String serialNumber = c.getSerialNumber().toString(); String signatureAlg = c.getSigAlgName(); String issuer = c.getIssuerX500Principal().toString(); String validity = new CertificateValidity(c.getNotBefore(), c.getNotAfter()).toString(); String subject = c.getSubjectX500Principal().toString(); //convert our signature into a nice human-readable form. HexDumpEncoder encoder = new HexDumpEncoder(); String signature = encoder.encodeBuffer(c.getSignature()); String md5Hash = ""; String sha1Hash = ""; try { MessageDigest digest = MessageDigest.getInstance("MD5"); digest.update(c.getEncoded()); md5Hash = makeFingerprint(digest.digest()); digest = MessageDigest.getInstance("SHA-1"); digest.update(c.getEncoded()); sha1Hash = makeFingerprint(digest.digest()); } catch (Exception e) { //fail quietly } String[][] cert = { { R("Version"), version }, { R("SSerial"), serialNumber }, { R("SSignatureAlgorithm"), signatureAlg }, { R("SIssuer"), issuer }, { R("SValidity"), validity }, { R("SSubject"), subject }, { R("SSignature"), signature }, { R("SMD5Fingerprint"), md5Hash }, { R("SSHA1Fingerprint"), sha1Hash } }; return cert; } /** * Constructs the GUI components of this panel */ private void addComponents() { buildTree(); populateTable(); /** //List of Certs list = new JList(certNames); list.setSelectedIndex(0); //assuming there's at least 1 cert listSelectionModel = list.getSelectionModel(); listSelectionModel.addListSelectionListener(new ListSelectionHandler()); JScrollPane listPane = new JScrollPane(list); */ JScrollPane listPane = new JScrollPane(tree); //Table of field-value pairs DefaultTableModel tableModel = new DefaultTableModel(certsData.get(0), columnNames); table = new JTable(tableModel); table.getTableHeader().setReorderingAllowed(false); tableSelectionModel = table.getSelectionModel(); tableSelectionModel.addListSelectionListener(new TableSelectionHandler()); table.setFillsViewportHeight(true); JScrollPane tablePane = new JScrollPane(table); tablePane.setPreferredSize(new Dimension(500, 200)); //Text area to display the larger values output = new JTextArea(); output.setEditable(false); JScrollPane outputPane = new JScrollPane(output, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); outputPane.setPreferredSize(new Dimension(500, 200)); //split pane of the field-value pairs and textbox JSplitPane rightSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, tablePane, outputPane); rightSplitPane.setDividerLocation(0.50); rightSplitPane.setResizeWeight(0.50); JSplitPane mainPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, listPane, rightSplitPane); mainPane.setDividerLocation(0.30); mainPane.setResizeWeight(0.30); JPanel buttonPane = new JPanel(new BorderLayout()); JButton close = new JButton(R("ButClose")); JButton copyToClipboard = new JButton(R("ButCopy")); close.addActionListener(createSetValueListener(parent, 0)); copyToClipboard.addActionListener(new CopyToClipboardHandler()); buttonPane.add(close, BorderLayout.EAST); buttonPane.add(copyToClipboard, BorderLayout.WEST); buttonPane.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); add(mainPane, BorderLayout.CENTER); add(buttonPane, BorderLayout.SOUTH); } /** * Copies the currently selected certificate to the system Clipboard. */ private class CopyToClipboardHandler implements ActionListener { @Override public void actionPerformed(ActionEvent e) { Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); int certIndex = 0; DefaultMutableTreeNode node = (DefaultMutableTreeNode) tree.getLastSelectedPathComponent(); if (node == null) { return; } if (node.isRoot()) { certIndex = 0; } else if (node.isLeaf()) { certIndex = 1; } String[][] cert = certsData.get(certIndex); int rows = cert.length; int cols = cert[0].length; String certString = ""; for (int i = 0; i < rows; i++) { for (int j = 0; j < cols; j++) { certString += cert[i][j]; certString += " "; } certString += "\n"; } clipboard.setContents(new StringSelection(certString), null); } } /** * Updates the JTable when the JTree selection has changed. */ protected class TreeSelectionHandler implements TreeSelectionListener { @Override public void valueChanged(TreeSelectionEvent e) { DefaultMutableTreeNode node = (DefaultMutableTreeNode) tree.getLastSelectedPathComponent(); if (node == null) { return; } if (node.isRoot()) { table.setModel(new DefaultTableModel(certsData.get(0), columnNames)); } else if (node.isLeaf()) { table.setModel(new DefaultTableModel(certsData.get(1), columnNames)); } } } /** * Updates the JTable when the selection on the list has changed. */ private class ListSelectionHandler implements ListSelectionListener { @Override public void valueChanged(ListSelectionEvent e) { ListSelectionModel lsm = (ListSelectionModel) e.getSource(); int minIndex = lsm.getMinSelectionIndex(); int maxIndex = lsm.getMaxSelectionIndex(); for (int i = minIndex; i <= maxIndex; i++) { if (lsm.isSelectedIndex(i)) { table.setModel(new DefaultTableModel(certsData.get(i), columnNames)); } } } } /** * Updates the JTextArea output when the selection on the JTable * has changed. */ private class TableSelectionHandler implements ListSelectionListener { @Override public void valueChanged(ListSelectionEvent e) { ListSelectionModel lsm = (ListSelectionModel) e.getSource(); int minIndex = lsm.getMinSelectionIndex(); int maxIndex = lsm.getMaxSelectionIndex(); for (int i = minIndex; i <= maxIndex; i++) { if (lsm.isSelectedIndex(i)) { output.setText((String) table.getValueAt(i, 1)); } } } } /** * Makes a human readable hash fingerprint. * For example: 11:22:33:44:AA:BB:CC:DD:EE:FF. */ private String makeFingerprint(byte[] hash) { String fingerprint = ""; for (int i = 0; i < hash.length; i++) { if (!fingerprint.equals("")) { fingerprint += ":"; } fingerprint += Integer.toHexString( ((hash[i] & 0xFF) | 0x100)).substring(1, 3); } return fingerprint.toUpperCase(); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/dialogs/PaxHeaders.17941/CertWarningPane.java0000644000000000000000000000013212654402377027662 xustar0030 mtime=1454507263.223432768 30 atime=1454507327.146580243 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/dialogs/CertWarningPane.java0000644000175000002070000003347612654402377030422 0ustar00jvanekmock00000000000000/* CertWarningPane.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.dialogs; import static net.sourceforge.jnlp.runtime.Translator.R; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.Font; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.File; import java.security.KeyStore; import java.security.cert.Certificate; import java.security.cert.X509Certificate; import javax.swing.BorderFactory; import javax.swing.BoxLayout; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.SwingConstants; import net.sourceforge.jnlp.JNLPFile; import net.sourceforge.jnlp.PluginBridge; import net.sourceforge.jnlp.runtime.JNLPClassLoader.SecurityDelegate; import net.sourceforge.jnlp.security.CertVerifier; import net.sourceforge.jnlp.security.CertificateUtils; import net.sourceforge.jnlp.security.HttpsCertVerifier; import net.sourceforge.jnlp.security.KeyStores; import net.sourceforge.jnlp.security.KeyStores.Level; import net.sourceforge.jnlp.security.KeyStores.Type; import net.sourceforge.jnlp.security.SecurityDialog; import net.sourceforge.jnlp.security.SecurityDialogs.AccessType; import net.sourceforge.jnlp.security.SecurityUtil; import net.sourceforge.jnlp.util.FileUtils; import net.sourceforge.jnlp.util.logging.OutputController; /** * Provides the panel for using inside a SecurityDialog. These dialogs are * used to warn the user when either signed code (with or without signing * issues) is going to be run, or when service permission (file, clipboard, * printer, etc) is needed with unsigned code. * * @author Joshua Sumali */ public class CertWarningPane extends SecurityDialogPanel { private final JNLPFile file; private final AccessType accessType; private final Certificate cert; private JCheckBox alwaysTrust; private final CertVerifier certVerifier; private final SecurityDelegate securityDelegate; private JPanel topPanel, infoPanel, buttonPanel, bottomPanel; private JLabel topLabel, nameLabel, publisherLabel, fromLabel, bottomLabel; private JButton run, sandbox, advancedOptions, cancel, moreInfo; private boolean alwaysTrustSelected; private String bottomLabelWarningText; public CertWarningPane(SecurityDialog x, CertVerifier certVerifier, SecurityDelegate securityDelegate) { super(x, certVerifier); this.certVerifier = certVerifier; this.securityDelegate = securityDelegate; this.accessType = parent.getAccessType(); this.file = parent.getFile(); this.cert = parent.getCertVerifier().getPublisher(null); addComponents(); } /** * Creates the actual GUI components, and adds it to this panel */ private void addComponents() { setTextAndLabels(); addButtons(); } private void setTextAndLabels() { String name = ""; String publisher = ""; String from = ""; //We don't worry about exceptions when trying to fill in //these strings -- we just want to fill in as many as possible. try { if ((certVerifier instanceof HttpsCertVerifier) && (cert instanceof X509Certificate)) { name = SecurityUtil.getCN(((X509Certificate) cert) .getSubjectX500Principal().getName()); } else if (file instanceof PluginBridge) { name = file.getTitle(); } else { name = file.getInformation().getTitle(); } } catch (Exception e) { } try { if (cert instanceof X509Certificate) { publisher = SecurityUtil.getCN(((X509Certificate) cert) .getSubjectX500Principal().getName()); } } catch (Exception e) { } try { if (file instanceof PluginBridge) { from = file.getCodeBase().getHost(); } else { from = file.getInformation().getHomepage().toString(); } } catch (Exception e) { } // Labels String topLabelText = ""; bottomLabelWarningText = parent.getCertVerifier().getRootInCacerts() ? R("STrustedSource") : R("SUntrustedSource"); String iconLocation = "net/sourceforge/jnlp/resources/"; alwaysTrustSelected = false; if (certVerifier instanceof HttpsCertVerifier) { // HTTPS certs that are verified do not prompt for a dialog. // @see VariableX509TrustManager#checkServerTrusted topLabelText = R("SHttpsUnverified") + " " + R("Continue"); iconLocation += "warning.png"; } else { switch (accessType) { case VERIFIED: topLabelText = R("SSigVerified"); iconLocation += "question.png"; alwaysTrustSelected = true; break; case UNVERIFIED: topLabelText = R("SSigUnverified"); iconLocation += "warning.png"; bottomLabelWarningText += " " + R("SWarnFullPermissionsIgnorePolicy"); break; case SIGNING_ERROR: topLabelText = R("SSignatureError"); iconLocation += "warning.png"; bottomLabelWarningText += " " + R("SWarnFullPermissionsIgnorePolicy"); break; } } ImageIcon icon = getImageIcon(iconLocation); topLabel = new JLabel(htmlWrap(topLabelText), icon, SwingConstants.LEFT); topLabel.setFont(new Font(topLabel.getFont().toString(), Font.BOLD, 12)); topPanel = new JPanel(new BorderLayout()); topPanel.setBackground(Color.WHITE); topPanel.add(topLabel, BorderLayout.CENTER); topPanel.setPreferredSize(new Dimension(400, 75)); topPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); //application info nameLabel = new JLabel(R("Name") + ": " + name); nameLabel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); publisherLabel = new JLabel(R("Publisher") + ": " + publisher); publisherLabel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); fromLabel = new JLabel(R("From") + ": " + from); fromLabel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); } private ImageIcon getImageIcon(final String imageLocation) { return new ImageIcon((new sun.misc.Launcher()) .getClassLoader().getResource(imageLocation)); } private void addButtons() { alwaysTrust = new JCheckBox(R("SAlwaysTrustPublisher")); alwaysTrust.setEnabled(true); alwaysTrust.setSelected(alwaysTrustSelected); infoPanel = new JPanel(new GridLayout(4, 1)); infoPanel.add(nameLabel); infoPanel.add(publisherLabel); final boolean isHttpsCertTrustDialog = certVerifier instanceof HttpsCertVerifier; if (!isHttpsCertTrustDialog) { infoPanel.add(fromLabel); } infoPanel.add(alwaysTrust); infoPanel.setBorder(BorderFactory.createEmptyBorder(25, 25, 25, 25)); //run and cancel buttons buttonPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); run = new JButton(); if (isHttpsCertTrustDialog) { run.setText(R("ButYes")); } else { run.setText(R("ButRun")); } sandbox = new JButton(R("ButSandbox")); advancedOptions = new TemporaryPermissionsButton(file, securityDelegate, sandbox); cancel = new JButton(); if (isHttpsCertTrustDialog) { cancel.setText(R("ButNo")); } else { cancel.setText(R("ButCancel")); } if (isHttpsCertTrustDialog) { run.setToolTipText(R("CertWarnHTTPSAcceptTip")); } else { run.setToolTipText(R("CertWarnRunTip")); } sandbox.setToolTipText(R("CertWarnSandboxTip")); advancedOptions.setToolTipText(R("CertWarnPolicyTip")); if (isHttpsCertTrustDialog) { cancel.setToolTipText(R("CertWarnHTTPSRejectTip")); } else { cancel.setToolTipText(R("CertWarnCancelTip")); } alwaysTrust.addActionListener(new ButtonDisableListener(sandbox)); sandbox.setEnabled(!alwaysTrust.isSelected()); run.addActionListener(createSetValueListener(parent, 0)); run.addActionListener(new CheckBoxListener()); sandbox.addActionListener(createSetValueListener(parent, 1)); cancel.addActionListener(createSetValueListener(parent, 2)); initialFocusComponent = cancel; buttonPanel.add(run); // Only iff this dialog is being invoked by VariableX509TrustManager. // In this case, the "sandbox" button and temporary permissions do not make any sense, // as we are asking the user if they trust some certificate that is not being used to sign an app // (eg "do you trust this certificate presented for the HTTPS connection to the applet's host site") // Since this dialog isn't talking about an applet/application, there is nothing to run sandboxed. if (!isHttpsCertTrustDialog) { buttonPanel.add(sandbox); buttonPanel.add(advancedOptions); } buttonPanel.add(cancel); buttonPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); //all of the above setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); add(topPanel); add(infoPanel); add(buttonPanel); bottomLabel = new JLabel(htmlWrap(bottomLabelWarningText)); moreInfo = new JButton(R("ButMoreInformation")); moreInfo.addActionListener(new MoreInfoButtonListener()); bottomPanel = new JPanel(); bottomPanel.setLayout(new BoxLayout(bottomPanel, BoxLayout.X_AXIS)); bottomPanel.add(bottomLabel); bottomPanel.add(moreInfo); bottomPanel.setPreferredSize(new Dimension(600, 100)); bottomPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); add(bottomPanel); } private class MoreInfoButtonListener implements ActionListener { @Override public void actionPerformed(ActionEvent e) { SecurityDialog.showMoreInfoDialog(parent.getCertVerifier(), parent); } } /** * Disable the Sandbox button when the AlwaysTrust checkbox is checked */ private class ButtonDisableListener implements ActionListener { private JButton button; public ButtonDisableListener(JButton button) { this.button = button; } @Override public void actionPerformed(ActionEvent e) { button.setEnabled(!alwaysTrust.isSelected()); } } /** * Updates the user's KeyStore of trusted Certificates. */ private class CheckBoxListener implements ActionListener { @Override public void actionPerformed(ActionEvent e) { if (alwaysTrust != null && alwaysTrust.isSelected()) { try { KeyStore ks = KeyStores.getKeyStore(Level.USER, Type.CERTS); X509Certificate c = (X509Certificate) parent.getCertVerifier().getPublisher(null); CertificateUtils.addToKeyStore(c, ks); File keyStoreFile = KeyStores.getKeyStoreLocation(Level.USER, Type.CERTS).getFile(); if (!keyStoreFile.isFile()) { FileUtils.createRestrictedFile(keyStoreFile, true); } SecurityUtil.storeKeyStore(ks, keyStoreFile); OutputController.getLogger().log("certificate is now permanently trusted"); } catch (Exception ex) { // TODO: Let NetX show a dialog here notifying user // about being unable to add cert to keystore OutputController.getLogger().log(OutputController.Level.ERROR_ALL, ex); } } } } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/dialogs/PaxHeaders.17941/AppletWarningPane.java0000644000000000000000000000013212654402377030212 xustar0030 mtime=1454507263.222432781 30 atime=1454507327.146580243 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/dialogs/AppletWarningPane.java0000644000175000002070000001102612654402377030735 0ustar00jvanekmock00000000000000/* AppletWarningPane.java Copyright (C) 2008 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.dialogs; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.Font; import javax.swing.BorderFactory; import javax.swing.BoxLayout; import javax.swing.JButton; import javax.swing.JLabel; import javax.swing.JPanel; import net.sourceforge.jnlp.runtime.Translator; import net.sourceforge.jnlp.security.CertVerifier; import net.sourceforge.jnlp.security.SecurityDialog; public class AppletWarningPane extends SecurityDialogPanel { public AppletWarningPane(SecurityDialog x, CertVerifier certVerifier) { super(x, certVerifier); addComponents(); } protected void addComponents() { //Top label String topLabelText = "While support for verifying signed code" + " has not been implemented yet, some applets will not run " + "properly under the default restricted security level."; String bottomLabelText = "Do you want to run this applet under the " + "restricted security level? (clicking No will run this applet " + "without any security checking, and should only be done if you " + "trust the applet!)"; JLabel topLabel = new JLabel(htmlWrap(topLabelText)); topLabel.setFont(new Font(topLabel.getFont().toString(), Font.BOLD, 12)); JPanel topPanel = new JPanel(new BorderLayout()); topPanel.setBackground(Color.WHITE); topPanel.add(topLabel, BorderLayout.CENTER); topPanel.setPreferredSize(new Dimension(400, 80)); topPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); JLabel bottomLabel = new JLabel(htmlWrap(bottomLabelText)); JPanel infoPanel = new JPanel(new BorderLayout()); infoPanel.add(bottomLabel, BorderLayout.CENTER); infoPanel.setPreferredSize(new Dimension(400, 80)); infoPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); //run and cancel buttons JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); JButton yes = new JButton(Translator.R("ButYes")); JButton no = new JButton(Translator.R("ButNo")); JButton cancel = new JButton(Translator.R("ButCancel")); yes.addActionListener(createSetValueListener(parent, 0)); no.addActionListener(createSetValueListener(parent, 1)); cancel.addActionListener(createSetValueListener(parent, 2)); initialFocusComponent = cancel; buttonPanel.add(yes); buttonPanel.add(no); buttonPanel.add(cancel); buttonPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); //all of the above setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); add(topPanel); add(infoPanel); add(buttonPanel); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/dialogs/PaxHeaders.17941/AccessWarningPaneCompl0000644000000000000000000000013212654402377030241 xustar0030 mtime=1454507263.222432781 30 atime=1454507327.146580243 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/dialogs/AccessWarningPaneComplexReturn.java0000644000175000002070000000742612654402377033452 0ustar00jvanekmock00000000000000package net.sourceforge.jnlp.security.dialogs; /* Copyright (C) 2008 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ public class AccessWarningPaneComplexReturn { public static class ShortcutResult { public static enum Shortcut { BROWSER, GENERATED_JNLP, JNLP_HREF, JAVAWS_HTML; } private String browser = "not_found_browser"; private boolean fixHref = false; private Shortcut shortcutType = null; private final boolean create; public ShortcutResult(boolean create) { this.create = create; } public boolean isCreate() { return create; } public String getBrowser() { return browser; } public Shortcut getShortcutType() { return shortcutType; } public boolean isFixHref() { return fixHref; } public void setBrowser(String browser) { this.browser = browser; } public void setFixHref(boolean fixHref) { this.fixHref = fixHref; } public void setShortcutType(Shortcut shortcutType) { this.shortcutType = shortcutType; } } public static enum RemeberType { REMEMBER_BY_APP, REMEMBER_BY_DOMAIN, REMEMBER_DONT; } private final int regularReturn; private ShortcutResult dekstop; private ShortcutResult menu; private RemeberType rember; //0 = true; legacy...:-/ public AccessWarningPaneComplexReturn(int regularReturn) { this.regularReturn = regularReturn; } public void setDekstop(ShortcutResult dekstop) { this.dekstop = dekstop; } public ShortcutResult getDekstop() { return dekstop; } public void setMenu(ShortcutResult menu) { this.menu = menu; } public ShortcutResult getMenu() { return menu; } public void setRember(RemeberType rember) { this.rember = rember; } public RemeberType getRember() { return rember; } public int getRegularReturn() { return regularReturn; } public boolean getRegularReturnAsBoolean() { return regularReturn == 0 ? true : false; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/dialogs/PaxHeaders.17941/AccessWarningPane.java0000644000000000000000000000013212654402377030166 xustar0030 mtime=1454507263.222432781 30 atime=1454507327.146580243 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/dialogs/AccessWarningPane.java0000644000175000002070000004744012654402377030722 0ustar00jvanekmock00000000000000/* AccessWarningPane.java Copyright (C) 2008 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.dialogs; import static net.sourceforge.jnlp.runtime.Translator.R; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.Font; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.BorderFactory; import javax.swing.BoxLayout; import javax.swing.ButtonGroup; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JComboBox; import javax.swing.JComponent; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JRadioButton; import javax.swing.SwingConstants; import javax.swing.border.EmptyBorder; import net.sourceforge.jnlp.JNLPFile; import net.sourceforge.jnlp.PluginBridge; import net.sourceforge.jnlp.ShortcutDesc; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.security.CertVerifier; import net.sourceforge.jnlp.security.SecurityDialog; import net.sourceforge.jnlp.security.SecurityDialogs.AccessType; import net.sourceforge.jnlp.util.FileUtils; import net.sourceforge.jnlp.util.XDesktopEntry; /** * Provides a panel to show inside a SecurityDialog. These dialogs are * used to warn the user when either signed code (with or without signing * issues) is going to be run, or when service permission (file, clipboard, * printer, etc) is needed with unsigned code. * * @author Joshua Sumali */ public class AccessWarningPane extends SecurityDialogPanel { private Object[] extras; private JCheckBox desktopCheck; private JCheckBox menuCheck; HtmlShortcutPanel htmlPanelDesktop; HtmlShortcutPanel htmlPanelMenu; RememberPanel rememberPanel; public AccessWarningPane(SecurityDialog x, CertVerifier certVerifier) { super(x, certVerifier); addComponents(); } public AccessWarningPane(SecurityDialog x, Object[] extras, CertVerifier certVerifier) { super(x, certVerifier); this.extras = extras; addComponents(); } /** * Creates the actual GUI components, and adds it to this panel */ private void addComponents() { AccessType type = parent.getAccessType(); JNLPFile file = parent.getFile(); String name = ""; String publisher = ""; String from = ""; //We don't worry about exceptions when trying to fill in //these strings -- we just want to fill in as many as possible. try { name = file.getInformation().getTitle() != null ? file.getInformation().getTitle() : R("SNoAssociatedCertificate"); } catch (Exception e) { } try { publisher = file.getInformation().getVendor() != null ? file.getInformation().getVendor() + " " + R("SUnverified") : R("SNoAssociatedCertificate"); } catch (Exception e) { } try { from = !file.getInformation().getHomepage().toString().equals("") ? file.getInformation().getHomepage().toString() : file.getSourceLocation().getAuthority(); } catch (Exception e) { from = file.getSourceLocation().getAuthority(); } //Top label String topLabelText = ""; switch (type) { case READ_FILE: if (extras != null && extras.length > 0 && extras[0] instanceof String) { topLabelText = R("SFileReadAccess", FileUtils.displayablePath((String) extras[0])); } else { topLabelText = R("SFileReadAccess", R("AFileOnTheMachine")); } break; case WRITE_FILE: if (extras != null && extras.length > 0 && extras[0] instanceof String) { topLabelText = R("SFileWriteAccess", FileUtils.displayablePath((String) extras[0])); } else { topLabelText = R("SFileWriteAccess", R("AFileOnTheMachine")); } break; case CREATE_DESTKOP_SHORTCUT: topLabelText = R("SDesktopShortcut"); break; case CLIPBOARD_READ: topLabelText = R("SClipboardReadAccess"); break; case CLIPBOARD_WRITE: topLabelText = R("SClipboardWriteAccess"); break; case PRINTER: topLabelText = R("SPrinterAccess"); break; case NETWORK: if (extras != null && extras.length >= 0) topLabelText = R("SNetworkAccess", extras[0]); else topLabelText = R("SNetworkAccess", "(address here)"); } ImageIcon icon = new ImageIcon((new sun.misc.Launcher()).getClassLoader().getResource("net/sourceforge/jnlp/resources/question.png")); JLabel topLabel = new JLabel(htmlWrap(topLabelText), icon, SwingConstants.LEFT); topLabel.setFont(new Font(topLabel.getFont().toString(), Font.BOLD, 12)); JPanel topPanel = new JPanel(new BorderLayout()); topPanel.setBackground(Color.WHITE); topPanel.add(topLabel, BorderLayout.CENTER); topPanel.setPreferredSize(new Dimension(450, 100)); topPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); //application info JLabel nameLabel = new JLabel(R("Name") + ": " + name); nameLabel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); JLabel publisherLabel = new JLabel(R("Publisher") + ": " + publisher); publisherLabel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); JLabel fromLabel = new JLabel(R("From") + ": " + from); fromLabel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); final JButton run = new JButton(R("ButAllow")); final JButton cancel = new JButton(R("ButCancel")); JPanel infoPanel = new JPanel(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); c.gridx = 0; c.gridy = 0; c.anchor = GridBagConstraints.NORTHWEST; infoPanel.add(nameLabel, c); c.gridy++; infoPanel.add(publisherLabel, c); c.gridy++; infoPanel.add(fromLabel,c); c.gridy++; if (type == AccessType.CREATE_DESTKOP_SHORTCUT) { if (file.getInformation() != null && file.getInformation().getShortcut() != null && file.getInformation().getShortcut().onDesktop()) { desktopCheck = new JCheckBox(R("EXAWdesktopWants")); desktopCheck.setSelected(true); } else { desktopCheck = new JCheckBox(R("EXAWdesktopDontWants")); desktopCheck.setSelected(false); } if (file.getInformation() != null && file.getInformation().getShortcut() !=null && file.getInformation().getShortcut().toMenu()) { if (file.getInformation().getShortcut() != null && file.getInformation().getShortcut().getMenu() != null && file.getInformation().getShortcut().getMenu().getSubMenu() != null) { menuCheck = new JCheckBox(R("EXAWsubmenu",file.getInformation().getShortcut().getMenu().getSubMenu())); } else { menuCheck = new JCheckBox(R("EXAWmenuWants")); } menuCheck.setSelected(true); } else { menuCheck = new JCheckBox(R("EXAWmenuDontWants")); menuCheck.setSelected(false); } infoPanel.add(new JLabel("___________________________________________________"),c); c.gridy++; infoPanel.add(desktopCheck,c); c.gridy++; if (!JNLPRuntime.isWebstartApplication()) { htmlPanelDesktop = new HtmlShortcutPanel(); infoPanel.add(htmlPanelDesktop, c); htmlPanelDesktop.setVisible(false); c.gridy++; } ActionListener al = new ActionListener() { @Override public void actionPerformed(ActionEvent e) { if (desktopCheck.isSelected() || menuCheck.isSelected()){ run.setEnabled(true); cancel.setEnabled(false); } else { run.setEnabled(false); cancel.setEnabled(true); } } }; desktopCheck.addActionListener(al); menuCheck.addActionListener(al); al.actionPerformed(null); infoPanel.add(menuCheck,c); c.gridy++; if (!JNLPRuntime.isWebstartApplication()) { htmlPanelMenu = new HtmlShortcutPanel(); infoPanel.add(htmlPanelMenu, c); htmlPanelMenu.setVisible(false); c.gridy++; } infoPanel.add(new JLabel(R("EXAWsettingsInfo", ShortcutDesc.deploymentJavawsShortcutToString(JNLPRuntime.getConfiguration().getProperty(DeploymentConfiguration.KEY_CREATE_DESKTOP_SHORTCUT)), R("CPTabDesktopIntegration"))),c); c.gridy++; infoPanel.add(new JLabel(R("EXAWsettingsManage", R("CPTabMenuShortcuts"))),c); c.gridy++; infoPanel.validate(); } rememberPanel = new RememberPanel(); infoPanel.add(rememberPanel,c); c.gridy++; infoPanel.setBorder(BorderFactory.createEmptyBorder(25, 25, 25, 25)); //run and cancel buttons JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); JButton showAdvanced = new JButton(R("ButAdvancedOptions")); showAdvanced.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { negateVisibility(rememberPanel); negateVisibility(htmlPanelDesktop); negateVisibility(htmlPanelMenu); AccessWarningPane.this.parent.pack(); } private void negateVisibility(JComponent a) { if (a != null){ a.setVisible(!a.isVisible()); } } } ); //override the createSetValueListener mechanism //TODO get rid of createSetValueListener completely. run.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { parent.setValue(getModifier(0)); //according to createSetValueListener 0 is ok and 1 cancel parent.dispose(); } }); cancel.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { parent.setValue(getModifier(1)); //according to createSetValueListener 0 is ok and 1 cancel parent.dispose(); } }); initialFocusComponent = cancel; buttonPanel.add(run); buttonPanel.add(cancel); buttonPanel.add(showAdvanced); buttonPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); //all of the above setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); add(topPanel); add(infoPanel); add(buttonPanel); rememberPanel.setVisible(false); this.parent.pack(); } private AccessWarningPaneComplexReturn getModifier(int button) { AccessWarningPaneComplexReturn ar = new AccessWarningPaneComplexReturn(button); if (desktopCheck != null) { if (htmlPanelDesktop != null) { //html ar.setDekstop(htmlPanelDesktop.getShortcutResult(desktopCheck.isSelected())); } else { //jnlp ar.setDekstop(new AccessWarningPaneComplexReturn.ShortcutResult(desktopCheck.isSelected())); } } if (menuCheck != null) { if (htmlPanelMenu != null) { //html ar.setMenu(htmlPanelMenu.getShortcutResult(menuCheck.isSelected())); } else { //jnlp ar.setMenu(new AccessWarningPaneComplexReturn.ShortcutResult(menuCheck.isSelected())); } } if (rememberPanel != null) { ar.setRember(rememberPanel.getShortcutResult()); } return ar; } private class RememberPanel extends JPanel { // TODO: somehow tell the ApplicationInstance // to stop asking for permission // will be implemented likeALACAcanrember decission // must be encoded in similar way as AWP is doing final JRadioButton byApp = new JRadioButton(R("EXAWrememberByApp")); final JRadioButton byPage = new JRadioButton(R("EXAWrememberByPage")); final JRadioButton dont = new JRadioButton(R("EXAWdontRemember"), true); public RememberPanel() { super(new FlowLayout(FlowLayout.CENTER, 1, 5)); this.setBorder(new EmptyBorder(0, 0, 0, 0)); this.add(byApp); this.add(byPage); this.add(dont); byApp.setToolTipText(R("EXAWrememberByAppTooltip")); byPage.setToolTipText(R("EXAWrememberByPageTooltip")); dont.setToolTipText(R("EXAWdontRememberTooltip")); final ButtonGroup bg = new ButtonGroup(); bg.add(byApp); bg.add(byPage); bg.add(dont); this.validate(); } public AccessWarningPaneComplexReturn.RemeberType getShortcutResult() { if (byApp.isSelected()) { return AccessWarningPaneComplexReturn.RemeberType.REMEMBER_BY_APP; } else if (byPage.isSelected()) { return AccessWarningPaneComplexReturn.RemeberType.REMEMBER_BY_DOMAIN; } else if (dont.isSelected()) { return AccessWarningPaneComplexReturn.RemeberType.REMEMBER_DONT; } else { return AccessWarningPaneComplexReturn.RemeberType.REMEMBER_DONT; } } } private class HtmlShortcutPanel extends JPanel { final JRadioButton browser = new JRadioButton(R("EXAWbrowser"), true); final JComboBox browsers = new JComboBox<>(XDesktopEntry.BROWSERS); final JRadioButton jnlpGen = new JRadioButton(R("EXAWgenjnlp")); final JRadioButton jnlpHref = new JRadioButton(R("EXAWjnlphref")); final JRadioButton javawsHtml = new JRadioButton(R("EXAWhtml")); final JCheckBox fix = new JCheckBox(R("EXAWfixhref")); final ActionListener modifySecondaryControls = new ActionListener() { @Override public void actionPerformed(ActionEvent ae) { if (browser.isSelected()) { browsers.setEnabled(true); } else { browsers.setEnabled(false); } if (jnlpHref.isSelected()) { fix.setEnabled(true); fix.setSelected(true); } else { fix.setEnabled(false); fix.setSelected(false); } } }; public HtmlShortcutPanel() { super(new FlowLayout(FlowLayout.CENTER, 1, 5)); this.setBorder(new EmptyBorder(0, 0, 0, 0)); addMainComponents(); setTooltips(); ButtonGroup bg = createRadiosGroup(); // init checkbox modifySecondaryControls.actionPerformed(null); this.validate(); } public AccessWarningPaneComplexReturn.ShortcutResult getShortcutResult(boolean mainResolution) { AccessWarningPaneComplexReturn.ShortcutResult r = new AccessWarningPaneComplexReturn.ShortcutResult(mainResolution); r.setBrowser((String) browsers.getSelectedItem()); r.setFixHref(fix.isSelected()); if (browser.isSelected()) { r.setShortcutType(AccessWarningPaneComplexReturn.ShortcutResult.Shortcut.BROWSER); } else if (jnlpGen.isSelected()) { r.setShortcutType(AccessWarningPaneComplexReturn.ShortcutResult.Shortcut.GENERATED_JNLP); } else if (jnlpHref.isSelected()) { r.setShortcutType(AccessWarningPaneComplexReturn.ShortcutResult.Shortcut.JNLP_HREF); } else if (javawsHtml.isSelected()) { r.setShortcutType(AccessWarningPaneComplexReturn.ShortcutResult.Shortcut.JAVAWS_HTML); } return r; } private ButtonGroup createRadiosGroup() { ButtonGroup bg = new ButtonGroup(); bg.add(browser); bg.add(jnlpGen); bg.add(jnlpHref); bg.add(javawsHtml); setCheckboxModifierListener(); return bg; } private void setCheckboxModifierListener() { browser.addActionListener(modifySecondaryControls); jnlpGen.addActionListener(modifySecondaryControls); jnlpHref.addActionListener(modifySecondaryControls); javawsHtml.addActionListener(modifySecondaryControls); } private void addMainComponents() { this.add(browser); browsers.setEditable(true); browsers.setSelectedItem(XDesktopEntry.getBrowserBin()); this.add(browsers); this.add(jnlpGen); this.add(jnlpHref); this.add(javawsHtml); this.add(fix); if (parent.getFile() instanceof PluginBridge && ((PluginBridge)(parent.getFile())).haveDebugJnlp()){ jnlpHref.setEnabled(true); } else { jnlpHref.setEnabled(false); } } private void setTooltips() { browser.setToolTipText(R("EXAWbrowserTolltip")); browsers.setToolTipText(R("EXAWbrowsersTolltip")); jnlpGen.setToolTipText(R("EXAWgeneratedTolltip")); jnlpHref.setToolTipText(R("EXAWhrefTolltip")); javawsHtml.setToolTipText(R("EXAWhtmlTolltip")); fix.setToolTipText(R("EXAWfixTolltip")); } } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/PaxHeaders.17941/appletextendedsecurity0000644000000000000000000000013212654402377027067 xustar0030 mtime=1454507263.221432794 30 atime=1454507658.780157344 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/appletextendedsecurity/0000755000175000002070000000000012654402377027667 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/appletextendedsecurity/PaxHeaders.17941/impl0000644000000000000000000000013212654402377030030 xustar0030 mtime=1454507263.221432794 30 atime=1454507658.780157344 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/appletextendedsecurity/impl/0000755000175000002070000000000012654402377030630 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/appletextendedsecurity/impl/PaxHeaders.17941/Un0000644000000000000000000000033112654402377030413 xustar00127 path=icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/appletextendedsecurity/impl/UnsignedAppletActionStorageImpl.java 30 mtime=1454507263.221432794 30 atime=1454507327.145580257 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/appletextendedsecurity/impl/UnsignedAppletActio0000644000175000002070000003037112654402377034461 0ustar00jvanekmock00000000000000/* Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.appletextendedsecurity.impl; import java.io.BufferedWriter; import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.regex.PatternSyntaxException; import net.sourceforge.jnlp.security.appletextendedsecurity.InvalidLineException; import net.sourceforge.jnlp.security.appletextendedsecurity.ExecuteAppletAction; import net.sourceforge.jnlp.security.appletextendedsecurity.UnsignedAppletActionEntry; import net.sourceforge.jnlp.security.appletextendedsecurity.UnsignedAppletActionStorage; import net.sourceforge.jnlp.util.FileUtils; import net.sourceforge.jnlp.util.lockingfile.LockingReaderWriter; import net.sourceforge.jnlp.util.lockingfile.StorageIoException; import net.sourceforge.jnlp.util.logging.OutputController; public class UnsignedAppletActionStorageImpl extends LockingReaderWriter implements UnsignedAppletActionStorage { protected List items; private String readVersion = null; public static final String versionPreffix="#VERSION "; public static final String BACKUP_SUFFIX = "-backup"; public static final int currentVersion = 2; private int lineCounter = 0; private boolean loadingDisabled = false; public UnsignedAppletActionStorageImpl(File location) { super(location); } @Override public void writeContents() throws IOException { super.writeContents(); } @Override public synchronized void writeContentsLocked() throws IOException { super.writeContentsLocked(); } @Override protected void readContents() throws IOException { if (items == null) { items = new ArrayList<>(); } else { items.clear(); } super.readContents(); } @Override protected void readLine(String line) { if (line.trim().length() != 0) { lineCounter++; if (line.startsWith(versionPreffix) && line.trim().split("\\s+").length > 1) { if (readVersion == null) { readVersion = line.trim(); actOnVersionLoad(); } } else { if (lineCounter>0 && readVersion == null){ actOnNoVersionLoad(); } if (!loadingDisabled) { this.items.add(UnsignedAppletActionEntry.createFromString(line)); } } } } @Override public void writeContent(BufferedWriter bw) throws IOException { lineCounter = 0; readVersion = null; bw.write(versionPreffix + currentVersion + " - note, do not edit or modify this line. It may cause removal of this file."); bw.newLine(); for (UnsignedAppletActionEntry item : items) { try{ item.write(bw); bw.newLine(); }catch (InvalidLineException ex){ OutputController.getLogger().log(ex); } } } @Override public void add(final UnsignedAppletActionEntry item) { doLocked(new Runnable() { @Override public void run() { try { readContents(); items.add(item); writeContents(); } catch (IOException ex) { throw new StorageIoException(ex); } } }); } @Override public void update(final UnsignedAppletActionEntry item) { doLocked(new Runnable() { @Override public void run() { try { if (items == null) { throw new StorageIoException("Storage is not initialised, can not update"); } if (!items.contains(item)) { throw new StorageIoException("Storage does not contain item you are updating. can not update"); } writeContents(); } catch (IOException ex) { throw new StorageIoException(ex); } } }); } @Override public UnsignedAppletActionEntry getMatchingItem(String documentBase, String codeBase, List archives, Integer id) { List results = getMatchingItems(documentBase, codeBase, archives); if (results == null || results.isEmpty()) { return null; } //no comaprsion id provided if (id == null){ return results.get(0); } // Chose the first result, unless we find a 'stronger' result // Actions such as 'always accept' or 'always reject' are 'stronger' than // the hints 'was accepted' or 'was rejected'. for (UnsignedAppletActionEntry candidate : results) { if (candidate.getAppletSecurityActions().getAction(id) == ExecuteAppletAction.ALWAYS || candidate.getAppletSecurityActions().getAction(id) == ExecuteAppletAction.NEVER) { //return first found strong return candidate; } } //no strong found, return first return results.get(0); } public List getMatchingItems(String documentBase, String codeBase, List archives) { List result = new ArrayList(); lock(); try { readContents(); if (items == null) { return result; } for (UnsignedAppletActionEntry unsignedAppletActionEntry : items) { if (isMatching(unsignedAppletActionEntry, documentBase, codeBase, archives)) { result.add(unsignedAppletActionEntry); } } } catch (IOException e) { throw new StorageIoException(e); } finally { unlock(); } return result; } private boolean isMatching(UnsignedAppletActionEntry unsignedAppletActionEntry, String documentBase, String codeBase, List archives) { try { boolean result = true; if (documentBase != null && !documentBase.trim().isEmpty()) { result = result && documentBase.matches(unsignedAppletActionEntry.getDocumentBase().getRegEx()); } if (codeBase != null && !codeBase.trim().isEmpty()) { result = result && codeBase.matches(unsignedAppletActionEntry.getCodeBase().getRegEx()); } if (archives != null) { List saved = unsignedAppletActionEntry.getArchives(); if (saved == null || saved.isEmpty()) { return result; } result = result && compareArchives(archives, saved); } return result; } catch (PatternSyntaxException ex) { OutputController.getLogger().log(OutputController.Level.WARNING_ALL, ex); return false; } } @Override public String toString() { return getBackingFile() + " " + super.toString(); } private boolean compareArchives(List archives, List saved) { if (archives == null && saved !=null){ return false; } if (archives != null && saved ==null){ return false; } if (archives == null && saved ==null){ return true; } if (archives.size() != saved.size()) { return false; } Collections.sort(archives); Collections.sort(saved); for (int i = 0; i < saved.size(); i++) { String string1 = saved.get(i); String string2 = archives.get(i); //intentional reference compare if (string1 == string2) { continue; } if (string1 == null || string2 == null) { return false; } if (string1.trim().equals(string2.trim())) { continue; } return false; } return true; } @Override public UnsignedAppletActionEntry getMatchingItemByDocumentBase(String documentBase, Integer id) { return getMatchingItem(documentBase, null, null, id); } @Override public UnsignedAppletActionEntry getMatchingItemByCodeBase(String codeBase, Integer id) { return getMatchingItem(null, codeBase, null, id); } @Override public UnsignedAppletActionEntry getMatchingItemByBases(String documentBase, String codeBase, Integer id) { return getMatchingItem(documentBase, codeBase, null, id); } private void actOnVersionLoad() { String versionS = readVersion.split("\\s+")[1]; int version = 0; try{ version = Integer.valueOf(versionS); } catch (NumberFormatException e){ OutputController.getLogger().log(e); } if (version < 2){ OutputController.getLogger().log("Stoping laoding of vulnereable "+getBackingFile().getAbsolutePath()+". Will be replaced"); loadingDisabled = true; backupOldFile(version, getBackingFile()); } else { loadingDisabled = false; } } private void actOnNoVersionLoad() { readVersion=versionPreffix+"0"; actOnVersionLoad(); } private void backupOldFile(int version, File backingFile) { try { File backup = new File(backingFile.getAbsolutePath() + "." + version + BACKUP_SUFFIX); OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, "backuping " + getBackingFile().getAbsolutePath() + " as " + backup.getName()); String warning = "- !WARNING! this is automated copy of old " + backingFile.getName() + " which was removed/replaced. Before you blindly copy those items back, please note, that this file might be modified without your approval by evil attacker. It is advised to not return below lines, or verify them before returning"; String s = FileUtils.loadFileAsString(backingFile); s.replaceFirst("\\s*", ""); if (s.startsWith(versionPreffix)) { s = s.replaceFirst("\n", " " + warning + "\n"); } else { s = readVersion + " " + warning + "\n" + s; } FileUtils.saveFile(s, backup); } catch (Exception ex) { OutputController.getLogger().log(OutputController.Level.WARNING_ALL, "Error during backuping: " + ex.getMessage()); OutputController.getLogger().log(ex); } } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/appletextendedsecurity/impl/PaxHeaders.17941/Un0000644000000000000000000000034112654402377030414 xustar00135 path=icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/appletextendedsecurity/impl/UnsignedAppletActionStorageExtendedImpl.java 30 mtime=1454507263.221432794 30 atime=1454507327.145580257 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/appletextendedsecurity/impl/UnsignedAppletActio0000644000175000002070000001605512654402377034464 0ustar00jvanekmock00000000000000/* Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.appletextendedsecurity.impl; import java.io.File; import java.io.IOException; import java.util.Date; import net.sourceforge.jnlp.security.appletextendedsecurity.AppletSecurityActions; import net.sourceforge.jnlp.security.appletextendedsecurity.ExecuteAppletAction; import net.sourceforge.jnlp.security.appletextendedsecurity.UnsignedAppletActionEntry; import net.sourceforge.jnlp.security.appletextendedsecurity.UrlRegEx; import net.sourceforge.jnlp.util.lockingfile.StorageIoException; public class UnsignedAppletActionStorageExtendedImpl extends UnsignedAppletActionStorageImpl { public UnsignedAppletActionStorageExtendedImpl(String location) { this(new File(location)); } public UnsignedAppletActionStorageExtendedImpl(File location) { super(location); } public UnsignedAppletActionEntry[] toArray() { lock(); try { readContents(); return items.toArray(new UnsignedAppletActionEntry[items.size()]); } catch (IOException e) { throw new StorageIoException(e); } finally { unlock(); } } public void clear() { doLocked(new Runnable() { public void run() { try { items.clear(); writeContents(); } catch (IOException e) { throw new StorageIoException(e); } } }); } public void removeByBehaviour(final ExecuteAppletAction unsignedAppletAction) { doLocked(new Runnable() { public void run() { try { readContents(); for (int i = 0; i < items.size(); i++) { UnsignedAppletActionEntry unsignedAppletActionEntry = items.get(i); AppletSecurityActions actions = unsignedAppletActionEntry.getAppletSecurityActions(); for (int j = 0; j < actions.getRealCount(); j++) { ExecuteAppletAction action = actions.getAction(j); if (action == unsignedAppletAction) { items.remove(i); i--; break; //actions loop } } } writeContents(); } catch (IOException e) { throw new StorageIoException(e); } } }); } private void swap(final int i, final int ii) { doLocked(new Runnable() { public void run() { try { readContents(); UnsignedAppletActionEntry backup = items.get(i); items.set(i, items.get(ii)); items.set(ii, backup); writeContents(); } catch (IOException e) { throw new StorageIoException(e); } } }); } public int moveUp(int selectedRow) { if (selectedRow <= 0) { return selectedRow; } swap(selectedRow, selectedRow - 1); return selectedRow-1; } public int moveDown(int selectedRow) { if (selectedRow >= items.size() - 1) { return selectedRow; } swap(selectedRow, selectedRow + 1); return selectedRow+1; } public void remove(final int item) { doLocked(new Runnable() { public void run() { try { readContents(); items.remove(item); writeContents(); } catch (IOException ex) { throw new StorageIoException(ex); } } }); } public void modify(final UnsignedAppletActionEntry source, final int columnIndex, final Object aValue) { Runnable r = new Runnable() { public void run() { try { if (!items.contains(source)) { throw new StorageIoException("Item to be modified not found in storage"); } if (columnIndex == 0) { source.getAppletSecurityActions().setUnsignedAppletAction((ExecuteAppletAction) aValue); } if (columnIndex == 1) { source.getAppletSecurityActions().setMatchingAlacaAction((ExecuteAppletAction) aValue); } if (columnIndex == 2) { source.setTimeStamp((Date) aValue); } if (columnIndex == 3) { source.setDocumentBase(UrlRegEx.exact((String) aValue)); } if (columnIndex == 4) { source.setCodeBase(UrlRegEx.exact((String) aValue)); } if (columnIndex == 5) { source.setArchives(UnsignedAppletActionEntry.createArchivesList((String) aValue)); } writeContents(); } catch (IOException ex) { throw new StorageIoException(ex); } } }; doLocked(r); } @Override public synchronized void writeContentsLocked() throws IOException { super.writeContentsLocked(); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/appletextendedsecurity/PaxHeaders.17941/UrlRegE0000644000000000000000000000013212654402377030374 xustar0030 mtime=1454507263.220432808 30 atime=1454507327.145580257 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/appletextendedsecurity/UrlRegEx.java0000644000175000002070000001016512654402377032232 0ustar00jvanekmock00000000000000/* Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.appletextendedsecurity; import java.util.regex.Pattern; public class UrlRegEx { private static String quoteString(String s) { return Pattern.quote(s); } private final String regEx; public static UrlRegEx quote(String s) { return new UrlRegEx(quoteString(s)); } public static UrlRegEx quoteAndStar(String s) { return new UrlRegEx(quoteString(s)+".*"); } public static UrlRegEx exact(String s) { return new UrlRegEx(s); } private UrlRegEx(String s) { regEx = s; } @Override public String toString() { return getRegEx(); } public String getRegEx() { return regEx; } /** * Just cosmetic method to show nicer tables, as \Qsomething\Emaybe is most * common record when cell is edited, the regex is shown fully * * @return unquted pattern or original string */ public String getFilteredRegEx() { try { return simpleUnquote(regEx); } catch (Exception ex) { return regEx; } } //needs testing static String replaceLast(String where, String what, String by) { if (!where.contains(what)) { return where; } StringBuilder b = new StringBuilder(where); b.replace(where.lastIndexOf(what), where.lastIndexOf(what)+what.length(), by); return b.toString(); } //needs testing static String simpleUnquote(String s) { //escaped run needs at least \E\Q, but only single char actually hurts if (s.length()<=1){ return s; } boolean in = false; for(int i = 1 ; i < s.length() ; i++){ if ( i == 0) { continue; } if (!in && s.charAt(i) == 'Q' && s.charAt(i-1) == '\\'){ in = true; String s1=s.substring(0, i - 1); String s2=s.substring(i + 1); s= s1+s2; i = i - 2; continue; } if (in && s.charAt(i) == 'E' && s.charAt(i-1) == '\\'){ String s1=s.substring(0, i - 1); String s2=s.substring(i + 1); s= s1+s2; i = i - 2; in = false; continue; } } //all text\Etext were replaced \Qtext\E\\E\Qtext\E //after above text\\Etext should remain return s.replace("\\\\E", "\\E"); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/appletextendedsecurity/PaxHeaders.17941/Unsigne0000644000000000000000000000032412654402377030502 xustar00122 path=icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletTrustConfirmation.java 30 mtime=1454507263.220432808 30 atime=1454507327.145580257 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletTrustConfi0000644000175000002070000003233412654402377034562 0ustar00jvanekmock00000000000000/* Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.appletextendedsecurity; import static net.sourceforge.jnlp.runtime.Translator.R; import java.net.URL; import java.util.ArrayList; import java.util.Arrays; import java.util.Date; import java.util.List; import net.sourceforge.jnlp.JARDesc; import net.sourceforge.jnlp.JNLPFile; import net.sourceforge.jnlp.LaunchException; import net.sourceforge.jnlp.PluginBridge; import net.sourceforge.jnlp.runtime.JNLPClassLoader.SecurityDelegate; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.security.dialogs.apptrustwarningpanel.AppTrustWarningPanel.AppSigningWarningAction; import net.sourceforge.jnlp.security.CertVerifier; import net.sourceforge.jnlp.security.SecurityDialogs; import net.sourceforge.jnlp.util.UrlUtils; import net.sourceforge.jnlp.util.logging.OutputController; public class UnsignedAppletTrustConfirmation { private static final AppletStartupSecuritySettings securitySettings = AppletStartupSecuritySettings.getInstance(); private static boolean unsignedConfirmationIsRequired() { // If we are using the 'high' security setting or higher, we must confirm // if the user wishes to run unsigned applets (not applicable to JNLP-launched apps) return !(AppletSecurityLevel.ALLOW_UNSIGNED == securitySettings.getSecurityLevel()); } private static boolean unsignedAppletsAreForbidden() { // If we are using the 'very high' security setting or higher, we do not // run unsigned applets return AppletSecurityLevel.DENY_UNSIGNED == securitySettings.getSecurityLevel() || AppletSecurityLevel.DENY_ALL == securitySettings.getSecurityLevel(); } /** * Gets the remembered decision, first checking the user policy for an ALWAYS/NEVER, * and then the global policy. * * @param file the plugin file * @param id of wonted action * @return the remembered decision */ public static UnsignedAppletActionEntry getStoredEntry(JNLPFile file, int id) { UnsignedAppletActionStorage userActionStorage = securitySettings.getUnsignedAppletActionCustomStorage(); UnsignedAppletActionStorage globalActionStorage = securitySettings.getUnsignedAppletActionGlobalStorage(); UnsignedAppletActionEntry globalEntry = getMatchingItem(globalActionStorage, file, id); UnsignedAppletActionEntry userEntry = getMatchingItem(userActionStorage, file, id); ExecuteAppletAction globalAction = globalEntry == null ? null : globalEntry.getAppletSecurityActions().getAction(id); ExecuteAppletAction userAction = userEntry == null ? null : userEntry.getAppletSecurityActions().getAction(id); if (userAction == ExecuteAppletAction.ALWAYS || userAction == ExecuteAppletAction.NEVER) { return userEntry; } else if (globalAction == ExecuteAppletAction.ALWAYS || globalAction == ExecuteAppletAction.NEVER) { return globalEntry; } else { return userEntry; } } public static ExecuteAppletAction getStoredAction(JNLPFile file, int id) { UnsignedAppletActionEntry x = getStoredEntry(file, id); if (x != null) { return x.getAppletSecurityActions().getAction(id); } return null; } private static UnsignedAppletActionEntry getMatchingItem(UnsignedAppletActionStorage actionStorage, JNLPFile file, int id) { return actionStorage.getMatchingItem( UrlUtils.normalizeUrlAndStripParams(file.getSourceLocation(), true /* encode local files */).toString(), UrlUtils.normalizeUrlAndStripParams(file.getNotNullProbalbeCodeBase(), true /* encode local files */).toString(), toRelativePaths(getJars(file), file.getNotNullProbalbeCodeBase().toExternalForm()), id); } /* Extract the archives as relative paths */ static List toRelativePaths(List paths, String rootPath) { List fileNames = new ArrayList<>(); for (String path : paths) { if (path.startsWith(rootPath)) { fileNames.add(path.substring(rootPath.length())); } else { fileNames.add(path); } } return fileNames; } public static void updateAppletAction(JNLPFile file, ExecuteAppletAction behaviour, boolean rememberForCodeBase, int id) { UnsignedAppletActionStorage userActionStorage = securitySettings.getUnsignedAppletActionCustomStorage(); userActionStorage.lock(); // We should ensure this operation is atomic try { UnsignedAppletActionEntry oldEntry = getMatchingItem(userActionStorage, file, id); URL codebase = UrlUtils.normalizeUrlAndStripParams(file.getNotNullProbalbeCodeBase(), true /* encode local files */); URL documentbase = UrlUtils.normalizeUrlAndStripParams(file.getSourceLocation(), true /* encode local files */); /* Else, create a new entry */ UrlRegEx codebaseRegex = UrlRegEx.quote(codebase.toExternalForm()); UrlRegEx documentbaseRegex = UrlRegEx.quoteAndStar(UrlUtils.stripFile(documentbase)); // Match any from codebase and sourceFile "base" List archiveMatches = null; // Match any from codebase if (!rememberForCodeBase) { documentbaseRegex = UrlRegEx.quote(documentbase.toExternalForm()); // Match only this applet archiveMatches = toRelativePaths(getJars(file), file.getNotNullProbalbeCodeBase().toString()); // Match only this applet } /* Update, if entry exists */ if (oldEntry != null) { oldEntry.getAppletSecurityActions().setAction(id, behaviour); oldEntry.setTimeStamp(new Date()); oldEntry.setDocumentBase(documentbaseRegex); oldEntry.setCodeBase(codebaseRegex); oldEntry.setArchives(archiveMatches); userActionStorage.update(oldEntry); return; } UnsignedAppletActionEntry entry = new UnsignedAppletActionEntry( AppletSecurityActions.fromAction(id, behaviour), new Date(), documentbaseRegex, codebaseRegex, archiveMatches ); userActionStorage.add(entry); } finally { userActionStorage.unlock(); } } private static List getJars(JNLPFile file) { if (file instanceof PluginBridge) return ((PluginBridge) file).getArchiveJars(); List jars = Arrays.asList(file.getResources().getJARs()); List result = new ArrayList(); for (JARDesc jar : jars) { result.add(jar.getLocation().toString()); } return result; } public static void checkUnsignedWithUserIfRequired(JNLPFile file) throws LaunchException { if (unsignedAppletsAreForbidden() || JNLPRuntime.isTrustNone()) { OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "Not running unsigned applet at " + file.getCodeBase() +" because unsigned applets are disallowed by security policy."); throw new LaunchException(file, null, R("LSFatal"), R("LCClient"), R("LUnsignedApplet"), R("LUnsignedAppletPolicyDenied")); } if (!unsignedConfirmationIsRequired() || JNLPRuntime.isTrustAll()) { OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "Running unsigned applet at " + file.getCodeBase() +" does not require confirmation according to security policy."); return; } ExecuteAppletAction storedAction = getStoredAction(file, AppletSecurityActions.UNSIGNED_APPLET_ACTION); OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "Stored action for unsigned applet at " + file.getCodeBase() +" was " + storedAction); boolean appletOK; if (storedAction == ExecuteAppletAction.ALWAYS) { appletOK = true; } else if (storedAction == ExecuteAppletAction.NEVER) { appletOK = false; } else { // No remembered decision, prompt the user AppSigningWarningAction warningResponse = SecurityDialogs.showUnsignedWarningDialog(file); ExecuteAppletAction executeAction = warningResponse.getAction(); appletOK = (executeAction == ExecuteAppletAction.YES || executeAction == ExecuteAppletAction.ALWAYS); if (executeAction != null) { updateAppletAction(file, executeAction, warningResponse.rememberForCodeBase(), AppletSecurityActions.UNSIGNED_APPLET_ACTION); } OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "Decided action for unsigned applet at " + file.getCodeBase() +" was " + executeAction); } if (!appletOK) { throw new LaunchException(file, null, R("LSFatal"), R("LCClient"), R("LUnsignedApplet"), R("LUnsignedAppletUserDenied")); } } public static void checkPartiallySignedWithUserIfRequired(SecurityDelegate securityDelegate, JNLPFile file, CertVerifier certVerifier) throws LaunchException { if (JNLPRuntime.isTrustNone()) { OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "Running partially signed applet at " + file.getCodeBase() + " with only Sandbox permissions due to -Xtrustnone flag"); securityDelegate.setRunInSandbox(); return; } if (JNLPRuntime.isTrustAll()) { OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "Running partially signed applet at " + file.getCodeBase() + " due to -Xtrustall flag"); return; } if (!unsignedConfirmationIsRequired()) { OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "Running partially signed applet at " + file.getCodeBase() + " does not require confirmation according to security policy."); return; } ExecuteAppletAction storedAction = getStoredAction(file, AppletSecurityActions.UNSIGNED_APPLET_ACTION); OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "Stored action for partially signed applet at " + file.getCodeBase() + " was " + storedAction); boolean appletOK; if (storedAction == ExecuteAppletAction.ALWAYS) { appletOK = true; } else if (storedAction == ExecuteAppletAction.NEVER) { appletOK = false; } else { // No remembered decision, prompt the user AppSigningWarningAction warningResponse = SecurityDialogs.showPartiallySignedWarningDialog(file, certVerifier, securityDelegate); ExecuteAppletAction executeAction = warningResponse.getAction(); if (executeAction == ExecuteAppletAction.SANDBOX) { securityDelegate.setRunInSandbox(); } appletOK = (executeAction == ExecuteAppletAction.YES || executeAction == ExecuteAppletAction.ALWAYS || executeAction == ExecuteAppletAction.SANDBOX); if (executeAction != null) { updateAppletAction(file, executeAction, warningResponse.rememberForCodeBase(),AppletSecurityActions.UNSIGNED_APPLET_ACTION); } OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "Decided action for unsigned applet at " + file.getCodeBase() + " was " + executeAction); } if (!appletOK) { throw new LaunchException(file, null, R("LSFatal"), R("LCClient"), R("LPartiallySignedApplet"), R("LPartiallySignedAppletUserDenied")); } } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/appletextendedsecurity/PaxHeaders.17941/Unsigne0000644000000000000000000000032012654402377030476 xustar00118 path=icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletActionStorage.java 30 mtime=1454507263.219432821 30 atime=1454507327.145580257 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletActionStor0000644000175000002070000001410012654402377034536 0ustar00jvanekmock00000000000000/* Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.appletextendedsecurity; import java.util.List; /** * This is abstract access to white/blacklist created from some permanent storage. *

    * It is daclaring adding, updating and searching. Intentionally not removing as * during plugin runtime no deletations should be done. *

    *

    * Implementations of this interface (unless dummy ones:) should ensure correct * communication with permanent storage and be prepared for multiple instances * read/write the same storage at time. *

    */ public interface UnsignedAppletActionStorage { /** * This methods iterates through records in * {@link net.sourceforge.jnlp.config.DeploymentConfiguration#getAppletTrustUserSettingsPath} or * {@link net.sourceforge.jnlp.config.DeploymentConfiguration#getAppletTrustGlobalSettingsPath}, and is matching * regexes saved here against params. So parameters here are NOT regexes, * but are matched against saved regexes. *

    * {@code null} or empty values are dangerously ignored, user, be aware of it. eg: * match only {@code codeBase} will be {@code null} someCodeBase {@code null} {@code null} match only * {@code documentBase} will be someDocBase {@code null} {@code null} {@code null} match only applet not * regarding code or document base will be {@code null} {@code null} mainClass archives. *

    * @param documentBase * @param codeBase * @param archives * @param id of AppletSecurityAction's ExecuteAppletAction to be used for "strong" search * @return a matching unsigned applet action entry */ public UnsignedAppletActionEntry getMatchingItem(String documentBase, String codeBase, List archives, Integer id); /** * Shortcut {@code getMatchingItem(documentBase, null, null, null)} * * @param documentBase * @param id of AppletSecurityAction's ExecuteAppletAction to be used for "strong" search * @return a matching unsigned applet action entry */ public UnsignedAppletActionEntry getMatchingItemByDocumentBase(String documentBase, Integer id); /** * Shortcut {@code getMatchingItem(null, codeBase, null, null)} * * @param codeBase * @param id of AppletSecurityAction's ExecuteAppletAction to be used for "strong" search * @return a matching unsigned applet action entry */ public UnsignedAppletActionEntry getMatchingItemByCodeBase(String codeBase, Integer id); /** * Shortcut {@code getMatchingItem(documentBase, codeBase, null, null)} * * @param documentBase * @param codeBase * @param id of AppletSecurityAction's ExecuteAppletAction to be used for "strong" search * @return a matching unsigned applet action entry */ public UnsignedAppletActionEntry getMatchingItemByBases(String documentBase, String codeBase, Integer id); /** * Will add new record. Note that regexes are stored for bases matching. *

    * eg {@link UnsignedAppletActionEntry} which will deny some applet no matter of * page will be {@code new }{@link UnsignedAppletActionEntry#UnsignedAppletActionEntry UnsignedAppletActionEntry}{@code (}{@link ExecuteUnsignedApplet#NEVER}{@code , new }{@link java.util.Date#Date() Date()}{@code , null, null, someMain, someArchives)} *

    *

    * eg {@link UnsignedAppletActionEntry} which will * allow all applets on page with same codebase will be {@code new }{@link UnsignedAppletActionEntry#UnsignedAppletActionEntry UnsignedAppletActionEntry}{@code (}{@link ExecuteUnsignedApplet#NEVER}{@code , new }{@link java.util.Date#Date() Date()}{@code , ".*", ".*", null, null);} *

    * @param item */ public void add(final UnsignedAppletActionEntry item); /** * Will replace (current impl is matching by object's hashcode. This is not * reloading the list (but still saving after), so * {@link net.sourceforge.jnlp.util.lockingfile.StorageIoException} can be * thrown if it was not loaded before. *

    * Imho this should be used only to actualise timestamps or change * {@link UnsignedAppletActionEntry} *

    * @param item */ public void update(final UnsignedAppletActionEntry item); /** * Lock the storage, if necessary. If no ownership issues arise, can be a no-op. */ public void lock(); /** * Unlock the storage, if necessary. If no ownership issues arise, can be a no-op. */ public void unlock(); } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/appletextendedsecurity/PaxHeaders.17941/Unsigne0000644000000000000000000000031612654402377030503 xustar00116 path=icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletActionEntry.java 30 mtime=1454507263.219432821 30 atime=1454507327.145580257 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletActionEntr0000644000175000002070000001413712654402377034531 0ustar00jvanekmock00000000000000/* Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.appletextendedsecurity; import java.io.IOException; import java.io.Writer; import java.util.ArrayList; import java.util.Date; import java.util.List; import net.sourceforge.jnlp.runtime.JNLPRuntime; /** * * The name of this class is legacy. * Now it is used to keep state of all remembered security decisions * */ public class UnsignedAppletActionEntry { private final AppletSecurityActions appletSecurityActions; private Date timeStamp; private UrlRegEx documentBase; private UrlRegEx codeBase; private List archives; public static UnsignedAppletActionEntry createFromString(String s) { String[] split = s.split("\\s+"); UnsignedAppletActionEntry nw = new UnsignedAppletActionEntry( AppletSecurityActions.fromString(split[0]), new Date(new Long(split[1])), UrlRegEx.exact(split[2]), null, null); if (split.length > 3) { nw.setCodeBase(UrlRegEx.exact(split[3])); } if (split.length > 4) { nw.setArchives(createArchivesList(s.substring(s.lastIndexOf(split[3]) + split[3].length()).trim())); } return nw; } public UnsignedAppletActionEntry(AppletSecurityActions unsignedAppletAction, Date timeStamp, UrlRegEx documentBase, UrlRegEx codeBase, List archives) { this.appletSecurityActions = unsignedAppletAction; this.timeStamp = timeStamp; this.documentBase = documentBase; this.codeBase = codeBase; this.archives = archives; } @Override public String toString() { return this.serializeToReadableAndParseableString(); } public void write(Writer bw) throws IOException { bw.write(this.serializeToReadableAndParseableString()); } private String serializeToReadableAndParseableString() throws InvalidLineException { String s = appletSecurityActions.toString() + " " + ((timeStamp == null) ? "1" : timeStamp.getTime()) + " " + ((documentBase == null) ? "" : documentBase.getRegEx()) + " " + ((codeBase == null) ? "" : codeBase.getRegEx()) + " " + createArchivesString(archives); if (s.contains("\n") || s.contains("\r") || s.contains("\f")){ throw new InvalidLineException("Cant write line with \\n, \\r or \\f"); } return s; } public Date getTimeStamp() { return timeStamp; } public String getLocalisedTimeStamp() { return JNLPRuntime.getLocalisedTimeStamp(timeStamp); } public UrlRegEx getDocumentBase() { return documentBase; } public void setTimeStamp(Date timeStamp) { this.timeStamp = timeStamp; } public void setDocumentBase(UrlRegEx documentBase) { this.documentBase = documentBase; } /** * should be testing only * * @return */ public AppletSecurityActions getAppletSecurityActions() { return appletSecurityActions; } public UrlRegEx getCodeBase() { return codeBase; } public void setCodeBase(UrlRegEx codeBase) { this.codeBase = codeBase; } public List getArchives() { return archives; } public void setArchives(List archives) { this.archives = archives; } public static String createArchivesString(List listOfArchives) { if (listOfArchives == null) { return ""; } StringBuilder sb = new StringBuilder(); for (int i = 0; i < listOfArchives.size(); i++) { String string = listOfArchives.get(i); if (string.trim().isEmpty()) { continue; } sb.append(string); if (i != listOfArchives.size() - 1) { sb.append(","); } } return sb.toString(); } public static List createArchivesList(String commedArchives) { if (commedArchives == null) { return null; } if (commedArchives.trim().isEmpty()) { return null; } String[] items = commedArchives.trim().split(","); List r = new ArrayList(items.length); for (int i = 0; i < items.length; i++) { String string = items[i]; if (string.trim().isEmpty()) { continue; } r.add(string); } return r; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/appletextendedsecurity/PaxHeaders.17941/Invalid0000644000000000000000000000031112654402377030454 xustar00111 path=icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/appletextendedsecurity/InvalidLineException.java 30 mtime=1454507263.219432821 30 atime=1454507327.145580257 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/appletextendedsecurity/InvalidLineException.jav0000644000175000002070000000347612654402377034460 0ustar00jvanekmock00000000000000/* Copyright (C) 2015 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.appletextendedsecurity; public class InvalidLineException extends RuntimeException { public InvalidLineException(String s) { super(s); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/appletextendedsecurity/PaxHeaders.17941/Extende0000644000000000000000000000031612654402377030467 xustar00117 path=icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/appletextendedsecurity/ExtendedAppletSecurityHelp.java 30 mtime=1454507263.219432821 29 atime=1454507327.14458027 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/appletextendedsecurity/ExtendedAppletSecurityHe0000644000175000002070000002011612654402377034525 0ustar00jvanekmock00000000000000/* Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.appletextendedsecurity; import java.awt.Dimension; import java.io.IOException; import javax.swing.JButton; import javax.swing.JEditorPane; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JSeparator; import javax.swing.event.HyperlinkEvent; import javax.swing.event.HyperlinkListener; import net.sourceforge.jnlp.runtime.Translator; import net.sourceforge.jnlp.util.docprovider.TextsProvider; import net.sourceforge.jnlp.util.logging.OutputController; public class ExtendedAppletSecurityHelp extends javax.swing.JDialog implements HyperlinkListener { public ExtendedAppletSecurityHelp(java.awt.Frame parent, boolean modal, String reference) { this(parent, modal); mainHtmlPane.scrollToReference(reference); } public ExtendedAppletSecurityHelp(java.awt.Frame parent, boolean modal) { super(parent, modal); Dimension d = new Dimension(600, 400); setPreferredSize(d); setSize(d); initComponents(); mainHtmlPane.setText(getDialogueText()); mainHtmlPane.addHyperlinkListener(ExtendedAppletSecurityHelp.this); mainHtmlPane.setCaretPosition(1); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); } @Override public void hyperlinkUpdate(HyperlinkEvent event) { if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { try { if (event.getURL() == null) { String s = event.getDescription().replace("#", ""); mainHtmlPane.scrollToReference(s); } else { mainHtmlPane.setPage(event.getURL()); } } catch (IOException ioe) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, ioe); } } } private void initComponents() { scrollPane = new javax.swing.JScrollPane(); mainHtmlPane = new javax.swing.JEditorPane(); mainPanel = new javax.swing.JPanel(); niceSeparator = new javax.swing.JSeparator(); mainButtonsPanel = new javax.swing.JPanel(); navigationPanel = new javax.swing.JPanel(); homeButton = new javax.swing.JButton(); homeAndDialogueButton = new javax.swing.JButton(); closePanel = new javax.swing.JPanel(); closeButton = new javax.swing.JButton(); getContentPane().setLayout(new javax.swing.BoxLayout(getContentPane(), javax.swing.BoxLayout.Y_AXIS)); mainHtmlPane.setContentType("text/html"); mainHtmlPane.setEditable(false); scrollPane.setViewportView(mainHtmlPane); getContentPane().add(scrollPane); javax.swing.GroupLayout mainLayout = new javax.swing.GroupLayout(mainPanel); mainPanel.setLayout(mainLayout); mainLayout.setHorizontalGroup( mainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 485, Short.MAX_VALUE) .addGroup(mainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(mainLayout.createSequentialGroup() .addGap(0, 217, Short.MAX_VALUE) .addComponent(niceSeparator, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 218, Short.MAX_VALUE)))); mainLayout.setVerticalGroup( mainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 10, Short.MAX_VALUE) .addGroup(mainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(mainLayout.createSequentialGroup() .addGap(0, 0, Short.MAX_VALUE) .addComponent(niceSeparator, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE)))); getContentPane().add(mainPanel); mainButtonsPanel.setLayout(new javax.swing.BoxLayout(mainButtonsPanel, javax.swing.BoxLayout.LINE_AXIS)); navigationPanel.setLayout(new javax.swing.BoxLayout(navigationPanel, javax.swing.BoxLayout.LINE_AXIS)); homeButton.setText(Translator.R("SPLASHHome")); homeButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { goToIntroSection(evt); } }); navigationPanel.add(homeButton); homeAndDialogueButton.setText(Translator.R("APPEXTSEChelpHomeDialogue")); homeAndDialogueButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { goToDialogueSection(evt); } }); closeButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { ExtendedAppletSecurityHelp.this.dispose(); } }); navigationPanel.add(homeAndDialogueButton); mainButtonsPanel.add(navigationPanel); closeButton.setText(Translator.R("ButClose")); closePanel.add(closeButton); mainButtonsPanel.add(closePanel); getContentPane().add(mainButtonsPanel); pack(); } private void goToIntroSection(java.awt.event.ActionEvent evt) { mainHtmlPane.setText(getDialogueText()); mainHtmlPane.setCaretPosition(1); } private void goToDialogueSection(java.awt.event.ActionEvent evt) { mainHtmlPane.setText(getDialogueText()); mainHtmlPane.scrollToReference("dialogue"); } public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { ExtendedAppletSecurityHelp dialog = new ExtendedAppletSecurityHelp(null, false); dialog.setVisible(true); } }); } private JButton homeAndDialogueButton; private JButton homeButton; private JButton closeButton; private JEditorPane mainHtmlPane; private JPanel mainButtonsPanel; private JPanel navigationPanel; private JPanel closePanel; private JPanel mainPanel; private JScrollPane scrollPane; private JSeparator niceSeparator; private String getDialogueText() { return Translator.R("APPEXTSEChelp", TextsProvider.ITW_HOME, TextsProvider.ITW_BUGZILLAHOME, TextsProvider.ITW_BUGS, TextsProvider.ITW_EAS); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/appletextendedsecurity/PaxHeaders.17941/Execute0000644000000000000000000000013112654402377030470 xustar0030 mtime=1454507263.218432834 29 atime=1454507327.14458027 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/appletextendedsecurity/ExecuteAppletAction.java0000644000175000002070000000763412654402377034452 0ustar00jvanekmock00000000000000/* Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.appletextendedsecurity; import net.sourceforge.jnlp.runtime.Translator; public enum ExecuteAppletAction { ALWAYS, NEVER, YES, SANDBOX, NO, UNSET; public String toChar() { switch (this) { case ALWAYS: return "A"; case NEVER: return "N"; case YES: return "y"; case SANDBOX: return "s"; case NO: return "n"; case UNSET: return "X"; } throw new RuntimeException("Unknown ExecuteUnsignedApplet"); } public String toExplanation() { switch (this) { case ALWAYS: return Translator.R("APPEXTSECunsignedAppletActionAlways"); case NEVER: return Translator.R("APPEXTSECunsignedAppletActionNever"); case YES: return Translator.R("APPEXTSECunsignedAppletActionYes"); case SANDBOX: return Translator.R("APPEXTSECunsignedAppletActionSandbox"); case NO: return Translator.R("APPEXTSECunsignedAppletActionNo"); case UNSET: return Translator.R("APPEXTSECunsetAppletAction"); } throw new RuntimeException("Unknown UnsignedAppletAction"); } public static ExecuteAppletAction fromString(String s) { if (s.length() == 0){ throw new RuntimeException("Undefined zero-length ExecuteAppletAction String representatio"); } return fromChar(s.charAt(0)); } public static ExecuteAppletAction fromChar(char s) { switch (s) { case 'A': return ExecuteAppletAction.ALWAYS; case 'N': return ExecuteAppletAction.NEVER; case 'y': return ExecuteAppletAction.YES; case 's': return ExecuteAppletAction.SANDBOX; case 'n': return ExecuteAppletAction.NO; case 'X': return ExecuteAppletAction.UNSET; } throw new RuntimeException("Unknown ExecuteUnsignedApplet for " + s); } @Override public String toString() { return toChar() + " - " + toExplanation(); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/appletextendedsecurity/PaxHeaders.17941/AppletS0000644000000000000000000000032112654402377030437 xustar00120 path=icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/appletextendedsecurity/AppletStartupSecuritySettings.java 30 mtime=1454507263.218432834 29 atime=1454507327.14458027 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/appletextendedsecurity/AppletStartupSecuritySet0000644000175000002070000000741712654402377034637 0ustar00jvanekmock00000000000000/* Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.appletextendedsecurity; import net.sourceforge.jnlp.security.appletextendedsecurity.impl.UnsignedAppletActionStorageImpl; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.config.PathsAndFiles; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.util.lockingfile.StorageIoException; public class AppletStartupSecuritySettings { private static final AppletStartupSecuritySettings instance = new AppletStartupSecuritySettings(); private UnsignedAppletActionStorageImpl globalInstance; private UnsignedAppletActionStorageImpl customInstance; public static AppletStartupSecuritySettings getInstance() { return instance; } public static AppletSecurityLevel getHardcodedDefaultSecurityLevel() { return AppletSecurityLevel.getDefault(); } /** * * @return storage with global items from /etc/ */ public UnsignedAppletActionStorage getUnsignedAppletActionGlobalStorage() { if (globalInstance == null) { globalInstance = new UnsignedAppletActionStorageImpl(PathsAndFiles.APPLET_TRUST_SETTINGS_SYS.getFile()); } return globalInstance; } /** * * @return storage with custom items from /home/ */ public UnsignedAppletActionStorage getUnsignedAppletActionCustomStorage() { if (customInstance == null) { customInstance = new UnsignedAppletActionStorageImpl(PathsAndFiles.APPLET_TRUST_SETTINGS_USER.getFile()); } return customInstance; } /** * * @return user-set security level or default one if user-set do not exists */ public AppletSecurityLevel getSecurityLevel() { DeploymentConfiguration conf = JNLPRuntime.getConfiguration(); if (conf == null) { throw new StorageIoException("JNLPRuntime configuration is null. Try to reinstall IcedTea-Web"); } String s = conf.getProperty(DeploymentConfiguration.KEY_SECURITY_LEVEL); if (s == null) { return getHardcodedDefaultSecurityLevel(); } return AppletSecurityLevel.fromString(s); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/appletextendedsecurity/PaxHeaders.17941/AppletS0000644000000000000000000000013112654402377030436 xustar0030 mtime=1454507263.218432834 29 atime=1454507327.14458027 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/appletextendedsecurity/AppletSecurityLevel.java0000644000175000002070000000630412654402377034502 0ustar00jvanekmock00000000000000/* Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.appletextendedsecurity; import net.sourceforge.jnlp.runtime.Translator; public enum AppletSecurityLevel { DENY_ALL, DENY_UNSIGNED, ASK_UNSIGNED, ALLOW_UNSIGNED; public static String allToString() { return DENY_ALL.toChars() + " " + DENY_UNSIGNED.toChars() + " " + ASK_UNSIGNED.toChars() + " " + ALLOW_UNSIGNED.toChars(); } public String toChars() { return this.name(); } public String toExplanation() { switch (this) { case DENY_ALL: return Translator.R("APPEXTSECappletSecurityLevelExtraHighId") + " - " + Translator.R("APPEXTSECappletSecurityLevelExtraHighExplanation"); case DENY_UNSIGNED: return Translator.R("APPEXTSECappletSecurityLevelVeryHighId") + " - " + Translator.R("APPEXTSECappletSecurityLevelVeryHighExplanation"); case ASK_UNSIGNED: return Translator.R("APPEXTSECappletSecurityLevelHighId") + " - " + Translator.R("APPEXTSECappletSecurityLevelHighExplanation"); case ALLOW_UNSIGNED: return Translator.R("APPEXTSECappletSecurityLevelLowId") + " - " + Translator.R("APPEXTSECappletSecurityLevelLowExplanation"); } throw new RuntimeException("Unknown AppletSecurityLevel"); } public static AppletSecurityLevel fromString(String s) { return AppletSecurityLevel.valueOf(s.toUpperCase()); } @Override public String toString() { return toExplanation(); } public static AppletSecurityLevel getDefault() { return ASK_UNSIGNED; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/appletextendedsecurity/PaxHeaders.17941/AppletS0000644000000000000000000000031112654402377030436 xustar00112 path=icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/appletextendedsecurity/AppletSecurityActions.java 30 mtime=1454507263.217432848 29 atime=1454507327.14458027 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/appletextendedsecurity/AppletSecurityActions.ja0000644000175000002070000001265212654402377034507 0ustar00jvanekmock00000000000000/* Copyright (C) 2014 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.appletextendedsecurity; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Iterator; import java.util.List; public class AppletSecurityActions implements Iterable{ private final List actions = new ArrayList<>(); public static final int UNSIGNED_APPLET_ACTION = 0; public static final int MATCHING_ALACA_ACTION = 1; /** well this si not nice. We can iterate through all the records to find * longest remembered item, but it is unnecessary overhead. The new record is * added willingly with some effort. Should be easy to inc also this */ public static final int REMEMBER_COLUMNS_COUNT = /*2*/ Collections.max(Arrays.asList(UNSIGNED_APPLET_ACTION, MATCHING_ALACA_ACTION))+1; public static AppletSecurityActions createDefault() { AppletSecurityActions asas = new AppletSecurityActions(); asas.setUnsignedAppletAction(ExecuteAppletAction.UNSET); asas.setMatchingAlacaAction(ExecuteAppletAction.UNSET); return asas; } /* * quick setup method when new item , with one action, is added */ public static AppletSecurityActions fromAction(int id, ExecuteAppletAction s) { if (s == null){ s = ExecuteAppletAction.UNSET; } AppletSecurityActions asas = new AppletSecurityActions(); asas.setAction(id, s); return asas; } static AppletSecurityActions fromString(String s) { if (s == null) { s = ""; } s = s.trim(); //to not return on leading space, may be dangerous, //but the s shouldbe already trimmed before bubbling here. //does " A" means UNSET(1)+ALWAYS(2) or ALWAYS(1)+UNSET(2) //or UNSET(1)+UNSET(2)? AppletSecurityActions asas = new AppletSecurityActions(); for (char x : s.toCharArray()){ if (Character.isWhitespace(x)){ break; } asas.actions.add(ExecuteAppletAction.fromChar(x)); } return asas; } public ExecuteAppletAction getAction(int i) { if (i>= actions.size()){ return ExecuteAppletAction.UNSET; } return actions.get(i); } public void setAction(int i, ExecuteAppletAction a) { while (actions.size() <= i){ actions.add(ExecuteAppletAction.UNSET); } actions.set(i,a); } public ExecuteAppletAction getUnsignedAppletAction() { return getAction(UNSIGNED_APPLET_ACTION); } public void setUnsignedAppletAction(ExecuteAppletAction a) { setAction(UNSIGNED_APPLET_ACTION,a); } public ExecuteAppletAction getMatchingAlacaAction() { return getAction(MATCHING_ALACA_ACTION); } public void setMatchingAlacaAction(ExecuteAppletAction a) { setAction(MATCHING_ALACA_ACTION, a); } @Override public String toString() { return toShortString(); } public String toLongString() { StringBuilder sb = new StringBuilder(); for (ExecuteAppletAction executeAppletAction : actions) { sb.append(executeAppletAction.toString()).append("; "); } return sb.toString(); } public String toShortString() { StringBuilder sb = new StringBuilder(); for (ExecuteAppletAction executeAppletAction : actions) { sb.append(executeAppletAction.toChar()); } return sb.toString(); } public int getRealCount() { return actions.size(); } /** * stub for testing * @return */ List getActions() { return actions; } @Override public Iterator iterator() { return actions.iterator(); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/PaxHeaders.17941/VariableX509TrustManagerJDK7.j0000644000000000000000000000013112654402377027610 xustar0030 mtime=1454507263.217432848 29 atime=1454507327.14458027 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/VariableX509TrustManagerJDK7.java0000644000175000002070000001201212654402377031020 0ustar00jvanekmock00000000000000/* VariableX509TrustManagerJDK7.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.net.Socket; import java.security.cert.CertificateException; import java.security.cert.X509Certificate; import javax.net.ssl.SSLEngine; import javax.net.ssl.SSLSession; import javax.net.ssl.SSLSocket; import javax.net.ssl.X509ExtendedTrustManager; public class VariableX509TrustManagerJDK7 extends X509ExtendedTrustManager { private VariableX509TrustManager vX509TM = VariableX509TrustManager.getInstance(); @Override public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException { vX509TM.checkTrustClient(chain, authType, null /* hostname*/); } @Override public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException { vX509TM.checkTrustServer(chain, authType, null /* hostname*/, null /* socket */, null /* engine */); } @Override public X509Certificate[] getAcceptedIssuers() { return vX509TM.getAcceptedIssuers(); } @Override public void checkClientTrusted(X509Certificate[] chain, String authType, Socket socket) throws CertificateException { checkTrustClient(chain, authType, socket, null); } @Override public void checkServerTrusted(X509Certificate[] chain, String authType, Socket socket) throws CertificateException { checkTrustServer(chain, authType, socket, null); } @Override public void checkClientTrusted(X509Certificate[] chain, String authType, SSLEngine engine) throws CertificateException { checkTrustClient(chain, authType, null, engine); } @Override public void checkServerTrusted(X509Certificate[] chain, String authType, SSLEngine engine) throws CertificateException { checkTrustServer(chain, authType, null, engine); } /** * Check if the server is trusted * * @param chain The cert chain * @param authType The auth type algorithm * @param socket the SSLSocket, may be null * @param engine the SSLEngine, may be null */ private void checkTrustServer(X509Certificate[] chain, String authType, Socket socket, SSLEngine engine) throws CertificateException { String hostName = null; if (socket != null) { hostName = ((SSLSocket) socket).getHandshakeSession().getPeerHost(); } else if (engine != null) { hostName = engine.getHandshakeSession().getPeerHost(); } vX509TM.checkTrustServer(chain, authType, hostName, (SSLSocket) socket, engine); } /** * Check if the client is trusted * * @param chain The cert chain * @param authType The auth type algorithm * @param socket the SSLSocket, if provided * @param engine the SSLEngine, if provided */ private void checkTrustClient(X509Certificate[] chain, String authType, Socket socket, SSLEngine engine) throws CertificateException { String hostName = null; if (socket != null) { hostName = ((SSLSocket) socket).getHandshakeSession().getPeerHost(); } else if (engine != null) { hostName = engine.getHandshakeSession().getPeerHost(); } vX509TM.checkTrustClient(chain, authType, hostName); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/PaxHeaders.17941/VariableX509TrustManager.java0000644000000000000000000000013112654402377027660 xustar0030 mtime=1454507263.217432848 29 atime=1454507327.14458027 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java0000644000175000002070000004036312654402377030412 0ustar00jvanekmock00000000000000/* VariableX509TrustManager.java Copyright (C) 2009 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.net.Socket; import java.security.AccessController; import java.security.KeyStore; import java.security.PrivilegedAction; import java.security.cert.Certificate; import java.security.cert.CertificateException; import java.security.cert.X509Certificate; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import javax.net.ssl.SSLEngine; import javax.net.ssl.SSLSocket; import javax.net.ssl.TrustManager; import javax.net.ssl.TrustManagerFactory; import javax.net.ssl.X509TrustManager; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.security.SecurityDialogs.AccessType; import net.sourceforge.jnlp.security.SecurityDialogs.AppletAction; import net.sourceforge.jnlp.util.logging.OutputController; import sun.security.util.HostnameChecker; import sun.security.validator.ValidatorException; /** * This class implements an X509 Trust Manager. The certificates it trusts are * "variable", in the sense that it can dynamically, and temporarily support * different certificates that are not in the keystore. */ final public class VariableX509TrustManager { /** TrustManagers containing trusted CAs */ private X509TrustManager[] caTrustManagers = null; /** TrustManagers containing trusted certificates */ private X509TrustManager[] certTrustManagers = null; /** TrustManagers containing trusted client certificates */ private X509TrustManager[] clientTrustManagers = null; private ArrayList temporarilyTrusted = new ArrayList<>(); private ArrayList temporarilyUntrusted = new ArrayList<>(); private static VariableX509TrustManager instance = null; /** * Constructor initializes the system, user and custom stores */ public VariableX509TrustManager() { /* * Load TrustManagers for trusted certificates */ try { /** KeyStores containing trusted certificates */ KeyStore[] trustedCertKeyStores = KeyStores.getCertKeyStores(); certTrustManagers = new X509TrustManager[trustedCertKeyStores.length]; for (int j = 0; j < trustedCertKeyStores.length; j++) { TrustManagerFactory tmFactory = TrustManagerFactory.getInstance("SunX509", "SunJSSE"); tmFactory.init(trustedCertKeyStores[j]); // tm factory initialized, now get the managers so we can assign the X509 one TrustManager[] trustManagers = tmFactory.getTrustManagers(); for (TrustManager trustManager : trustManagers) { if (trustManager instanceof X509TrustManager) { certTrustManagers[j] = (X509TrustManager) trustManager; } } } } catch (Exception e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); } /* * Load TrustManagers for trusted CAs */ try { /** KeyStores containing trusted CAs */ KeyStore[] trustedCAKeyStores = KeyStores.getCAKeyStores(); caTrustManagers = new X509TrustManager[trustedCAKeyStores.length]; for (int j = 0; j < caTrustManagers.length; j++) { TrustManagerFactory tmFactory = TrustManagerFactory.getInstance("SunX509", "SunJSSE"); tmFactory.init(trustedCAKeyStores[j]); // tm factory initialized, now get the managers so we can extract the X509 one TrustManager[] trustManagers = tmFactory.getTrustManagers(); for (TrustManager trustManager : trustManagers) { if (trustManager instanceof X509TrustManager) { caTrustManagers[j] = (X509TrustManager) trustManager; } } } } catch (Exception e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); } /* * Load TrustManagers for trusted clients certificates */ try { KeyStore[] clientKeyStores = KeyStores.getClientKeyStores(); clientTrustManagers = new X509TrustManager[clientKeyStores.length]; for (int j = 0; j < clientTrustManagers.length; j++) { TrustManagerFactory tmFactory = TrustManagerFactory.getInstance("SunX509", "SunJSSE"); tmFactory.init(clientKeyStores[j]); // tm factory initialized, now get the managers so we can extract the X509 one TrustManager[] trustManagers = tmFactory.getTrustManagers(); for (TrustManager trustManager : trustManagers) { if (trustManager instanceof X509TrustManager) { clientTrustManagers[j] = (X509TrustManager) trustManager; } } } } catch (Exception e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); } } /** * Check if client is trusted (no support for custom here, only system/user) * @param chain certificate chain * @param authType type of authentification * @param hostName hostnem * @throws java.security.cert.CertificateException if certificate is wrong */ public void checkTrustClient(X509Certificate[] chain, String authType, String hostName) throws CertificateException { boolean trusted = false; ValidatorException savedException = null; for (X509TrustManager clientTrustManager : clientTrustManagers) { try { clientTrustManager.checkClientTrusted(chain, authType); trusted = true; break; }catch (ValidatorException caex) { savedException = caex; } } if (trusted) { return; } throw savedException; } /** * Check if the server is trusted. * * First, existing stores are checked to see if the certificate is trusted. * Next, if the certificate is not explicitly trusted by the user, a host * name check is performed. The user is them prompted as needed. * * @param chain The cert chain * @param authType The auth type algorithm * @param hostName The expected hostName that the server should have * @param socket The SSLSocket in use (may be null) * @param engine The SSLEngine in use (may be null) * @throws java.security.cert.CertificateException if certificate is wrong */ public synchronized void checkTrustServer(X509Certificate[] chain, String authType, String hostName, SSLSocket socket, SSLEngine engine) throws CertificateException { CertificateException ce = null; boolean trusted = true; boolean CNMatched = false; // Check trust stores try { checkAllManagers(chain, authType, socket, engine); } catch (CertificateException e) { trusted = false; ce = e; } // If the certificate is not explicitly trusted, we // check host match if (!isExplicitlyTrusted(chain, authType)) { if (hostName != null) { try { HostnameChecker checker = HostnameChecker .getInstance(HostnameChecker.TYPE_TLS); checker.match(hostName, chain[0]); // only need to match @ 0 for CN CNMatched = true; } catch (CertificateException e) { ce = e; } } } else { // If it is explicitly trusted, just return right away. return; } // If it is (not explicitly trusted) AND // ((it is not in store) OR (there is a host mismatch)) if (!trusted || !CNMatched) { if (!isTemporarilyUntrusted(chain[0])) { boolean b = askUser(chain, authType, trusted, CNMatched, hostName); if (b) { temporarilyTrust(chain[0]); return; } else { temporarilyUntrust(chain[0]); } } throw ce; } } /** * Check system, user and custom trust manager. * * This method is intended to work with both, JRE6 and JRE7. If socket * and engine are null, it assumes that the call is for JRE6 (i.e. not * javax.net.ssl.X509ExtendedTrustManager which is Java 7 specific). If * either of those are not null, it will assume that the caTrustManagers * are javax.net.ssl.X509ExtendedTrustManager instances and will * invoke their check methods. * * @param chain The certificate chain * @param authType The authentication type * @param socket the SSLSocket being used for the connection * @param engine the SSLEngine being used for the connection */ private void checkAllManagers(X509Certificate[] chain, String authType, Socket socket, SSLEngine engine) throws CertificateException { // first try CA TrustManagers boolean trusted = false; ValidatorException savedException = null; for (X509TrustManager caTrustManager : caTrustManagers) { try { if (socket == null && engine == null) { caTrustManager.checkServerTrusted(chain, authType); } else { try { Class x509ETMClass = Class.forName("javax.net.ssl.X509ExtendedTrustManager"); if (engine == null) { Method mcheckServerTrusted = x509ETMClass.getDeclaredMethod("checkServerTrusted", X509Certificate[].class, String.class, Socket.class); mcheckServerTrusted.invoke(caTrustManager, chain, authType, socket); } else { Method mcheckServerTrusted = x509ETMClass.getDeclaredMethod("checkServerTrusted", X509Certificate[].class, String.class, SSLEngine.class); mcheckServerTrusted.invoke(caTrustManager, chain, authType, engine); } }catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException | ClassNotFoundException nsme) { throw new ValidatorException(nsme.getMessage()); } } trusted = true; break; }catch (ValidatorException caex) { savedException = caex; } } if (trusted) { return; } for (X509TrustManager certTrustManager : certTrustManagers) { try { certTrustManager.checkServerTrusted(chain, authType); trusted = true; break; }catch (ValidatorException caex) { savedException = caex; } } if (trusted) { return; } // finally check temp trusted certs if (!temporarilyTrusted.contains(chain[0])) { if (savedException == null) { // OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, "IMPOSSIBLE!"); throw new ValidatorException(ValidatorException.T_SIGNATURE_ERROR, chain[0]); } throw savedException; } } /** * Return if the user explicitly trusted this i.e. in userTrustManager or temporarilyTrusted */ private boolean isExplicitlyTrusted(X509Certificate[] chain, String authType) { boolean explicitlyTrusted = false; for (X509TrustManager certTrustManager : certTrustManagers) { try { certTrustManager.checkServerTrusted(chain, authType); explicitlyTrusted = true; break; }catch (ValidatorException uex) { if (temporarilyTrusted.contains(chain[0])) { explicitlyTrusted = true; break; } }catch (CertificateException ce) { // not explicitly trusted } } return explicitlyTrusted; } protected X509Certificate[] getAcceptedIssuers() { List issuers = new ArrayList<>(); for (X509TrustManager caTrustManager : caTrustManagers) { issuers.addAll(Arrays.asList(caTrustManager.getAcceptedIssuers())); } return issuers.toArray(new X509Certificate[issuers.size()]); } /** * Temporarily untrust the given cert - do not ask the user to trust this * certificate again * * @param c The certificate to trust */ private void temporarilyUntrust(Certificate c) { temporarilyUntrusted.add(c); } /** * Was this certificate explicitly untrusted by user? * * @param c the certificate * @return true if the user was presented with this certificate and chose * not to trust it */ private boolean isTemporarilyUntrusted(Certificate c) { return temporarilyUntrusted.contains(c); } /** * Temporarily trust the given cert (runtime) * * @param c The certificate to trust */ private void temporarilyTrust(Certificate c) { temporarilyTrusted.add(c); } /** * Ask user if the certificate should be trusted * * @param chain The certificate chain * @param authType The authentication algorithm * @return user's response */ private boolean askUser(final X509Certificate[] chain, final String authType, final boolean isTrusted, final boolean hostMatched, final String hostName) { if (JNLPRuntime.isTrustAll()){ return true; } return AccessController.doPrivileged(new PrivilegedAction() { @Override public Boolean run() { return SecurityDialogs.showCertWarningDialog( AccessType.UNVERIFIED, null, new HttpsCertVerifier(chain, authType, isTrusted, hostMatched, hostName), null) == AppletAction.RUN; } }); } /** * Return an instance of this singleton * * @return The instance */ public static VariableX509TrustManager getInstance() { if (instance == null) instance = new VariableX509TrustManager(); return instance; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/PaxHeaders.17941/SecurityUtil.java0000644000000000000000000000013112654402377025655 xustar0030 mtime=1454507263.216432861 29 atime=1454507327.14458027 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/SecurityUtil.java0000644000175000002070000003511712654402377026410 0ustar00jvanekmock00000000000000/* SecurityUtil.java Copyright (C) 2008 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.security.Key; import java.security.KeyStore; import java.security.KeyStoreException; import java.security.NoSuchAlgorithmException; import java.security.UnrecoverableKeyException; import java.security.cert.Certificate; import java.security.cert.CertificateException; import javax.net.ssl.KeyManagerFactory; import net.sourceforge.jnlp.security.KeyStores.Level; import net.sourceforge.jnlp.security.KeyStores.Type; import net.sourceforge.jnlp.util.logging.OutputController; public class SecurityUtil { public static String getTrustedCertsFilename() throws Exception { return KeyStores.getKeyStoreLocation(Level.USER, Type.CERTS).getFullPath(); } /** * Extracts the CN field from a Certificate principal string. Or, if it * can't find that, return the principal unmodified. * * This is a simple (and hence 'wrong') version. See * http://www.ietf.org/rfc/rfc2253.txt for all the gory details. * @param principal string, CN to be extracted from * @return extracted CN */ public static String getCN(String principal) { /* * FIXME Incomplete * * This does not implement RFC 2253 completely * * Issues: * - rfc2253 talks about utf8, java uses utf16. * - theoretically, java should have dealt with all byte encodings * so we shouldnt even see cases like \FF * - if the above is wrong, then we need to deal with cases like * \FF\FF */ int start = principal.indexOf("CN="); if (start == -1) { return principal; } StringBuilder commonName = new StringBuilder(); boolean inQuotes = false; boolean escaped = false; /* * bit 0 = high order bit. bit 1 = low order bit */ char[] hexBits = null; for (int i = start + 3; i < principal.length(); i++) { char ch = principal.charAt(i); switch (ch) { case '"': if (escaped) { commonName.append(ch); escaped = false; } else { inQuotes = !inQuotes; } break; case '\\': if (escaped) { commonName.append(ch); escaped = false; } else { escaped = true; } break; case ',': /* fall through */ case ';': /* fall through */ case '+': if (escaped || inQuotes) { commonName.append(ch); if (escaped) { escaped = false; } } else { return commonName.toString(); } break; default: if (escaped && isHexDigit(ch)) { hexBits = new char[2]; hexBits[0] = ch; } else if (hexBits != null) { if (!isHexDigit(ch)) { /* error parsing */ return ""; } hexBits[1] = ch; commonName.append((char) Integer.parseInt(new String(hexBits), 16)); hexBits = null; } else { commonName.append(ch); } escaped = false; } } return commonName.toString(); } private static boolean isHexDigit(char ch) { return ((ch >= '0' && ch <= '9') || (ch >= 'A' && ch <= 'F') || (ch >= 'a' && ch <= 'f')); } /** * Checks the user's home directory to see if the trusted.certs file exists. * If it does not exist, it tries to create an empty keystore. * @return true if the trusted.certs file exists or a new trusted.certs * was created successfully, otherwise false. * @throws java.lang.Exception if check goes wrong */ public static boolean checkTrustedCertsFile() throws Exception { File certFile = new File(getTrustedCertsFilename()); //file does not exist if (!certFile.isFile()) { File dir = certFile.getAbsoluteFile().getParentFile(); boolean madeDir = false; if (!dir.isDirectory()) { madeDir = dir.mkdirs(); } //made directory, or directory exists if (madeDir || dir.isDirectory()) { KeyStore ks = KeyStore.getInstance("JKS"); loadKeyStore(ks, null); storeKeyStore(ks, certFile); return true; } else { return false; } } else { return true; } } /** * @return the keystore associated with the user's trusted.certs file, * or null otherwise. * @throws java.lang.Exception if getting fails */ public static KeyStore getUserKeyStore() throws Exception { KeyStore ks = null; FileInputStream fis = null; if (checkTrustedCertsFile()) { try { File file = new File(getTrustedCertsFilename()); if (file.exists()) { ks = KeyStore.getInstance("JKS"); loadKeyStore(ks, file); } } catch (Exception e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); throw e; } finally { if (fis != null) fis.close(); } } return ks; } /** * @return the keystore associated with the JDK cacerts file, * or null otherwise. * @throws java.lang.Exception if get fails */ public static KeyStore getCacertsKeyStore() throws Exception { KeyStore caks = null; FileInputStream fis = null; try { File file = new File(System.getProperty("java.home") + "/lib/security/cacerts"); if (file.exists()) { fis = new FileInputStream(file); caks = KeyStore.getInstance("JKS"); caks.load(fis, null); } } catch (Exception e) { caks = null; } finally { if (fis != null) fis.close(); } return caks; } /** * @return the keystore associated with the system certs file, * or null otherwise. * @throws java.lang.Exception if get goes wrong */ public static KeyStore getSystemCertStore() throws Exception { KeyStore caks = null; FileInputStream fis = null; try { File file = new File(System.getProperty("javax.net.ssl.trustStore")); String type = System.getProperty("javax.net.ssl.trustStoreType"); //String provider = "SUN"; char[] password = System.getProperty( "javax.net.ssl.trustStorePassword").toCharArray(); if (file.exists()) { fis = new FileInputStream(file); caks = KeyStore.getInstance(type); caks.load(fis, password); } } catch (Exception e) { caks = null; } finally { if (fis != null) fis.close(); } return caks; } public static void initKeyManagerFactory(KeyManagerFactory kmf, KeyStore ks) throws KeyStoreException, NoSuchAlgorithmException, UnrecoverableKeyException { try { KeystorePasswordAttempter.INSTANCE.unlockKeystore( new KeystorePasswordAttempter.KeystoreOperation(kmf, ks) { @Override String getId() { return "'init keymanager-factory'"; } @Override Key operateKeystore(char[] pass) throws KeyStoreException, NoSuchAlgorithmException, UnrecoverableKeyException, IOException, CertificateException { kmf.init(ks, pass); return null; } }); } catch (IOException | CertificateException ex) { throw unexpectedException(ex); } } public static void setKeyEntry(KeyStore ks, String alias, Key key, Certificate[] certChain) throws KeyStoreException { try { KeystorePasswordAttempter.INSTANCE.unlockKeystore( new KeystorePasswordAttempter.KeystoreOperation(ks, alias, key, certChain) { @Override String getId() { return "'set key entry'"; } @Override Key operateKeystore(char[] pass) throws KeyStoreException, NoSuchAlgorithmException, UnrecoverableKeyException, IOException, CertificateException { ks.setKeyEntry(alias, key, pass, certChain); return null; } }); } catch (NoSuchAlgorithmException | UnrecoverableKeyException | IOException | CertificateException ex) { throw unexpectedException(ex); } } public static Key getKey(KeyStore ks, String alias) throws KeyStoreException, NoSuchAlgorithmException, UnrecoverableKeyException { try { return KeystorePasswordAttempter.INSTANCE.unlockKeystore( new KeystorePasswordAttempter.KeystoreOperation(ks, alias, null, null) { @Override String getId() { return "'get key'"; } @Override Key operateKeystore(char[] pass) throws KeyStoreException, NoSuchAlgorithmException, UnrecoverableKeyException, IOException, CertificateException { return ks.getKey(alias, pass); } }); } catch (IOException | CertificateException ex) { throw unexpectedException(ex); } } public static void loadKeyStore(KeyStore ks, File f) throws IOException, NoSuchAlgorithmException, CertificateException { try { KeystorePasswordAttempter.INSTANCE.unlockKeystore( new KeystorePasswordAttempter.KeystoreOperation(ks, f) { @Override String getId() { return "'load keystore'"; } @Override Key operateKeystore(char[] pass) throws KeyStoreException, NoSuchAlgorithmException, UnrecoverableKeyException, IOException, CertificateException { if (f == null) { ks.load(null, pass); } else { try (FileInputStream fis = new FileInputStream(f)) { ks.load(fis, pass); } } return null; } }); } catch (KeyStoreException | UnrecoverableKeyException ex) { throw unexpectedException(ex); } } public static void storeKeyStore(KeyStore ks, File f) throws KeyStoreException, IOException, NoSuchAlgorithmException, CertificateException { try { KeystorePasswordAttempter.INSTANCE.unlockKeystore( new KeystorePasswordAttempter.KeystoreOperation(ks, f) { @Override String getId() { return "'store keystore'"; } @Override Key operateKeystore(char[] pass) throws KeyStoreException, NoSuchAlgorithmException, UnrecoverableKeyException, IOException, CertificateException { if (f == null) { ks.store(null, pass); } else { try (FileOutputStream fos = new FileOutputStream(f)) { ks.store(fos, pass); } } return null; } }); } catch (UnrecoverableKeyException ex) { throw unexpectedException(ex); } } private static RuntimeException unexpectedException(Exception ex) { return new RuntimeException("This usage of KeystorePasswordAttempter shopuld not throw this kind of exception", ex); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/PaxHeaders.17941/SecurityDialogs.java0000644000000000000000000000013212654402377026323 xustar0030 mtime=1454507263.216432861 30 atime=1454507327.143580283 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/SecurityDialogs.java0000644000175000002070000005411512654402377027054 0ustar00jvanekmock00000000000000/* SecurityDialogs.java Copyright (C) 2010 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security; import java.awt.Dialog.ModalityType; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.net.NetPermission; import java.net.URL; import java.security.AccessController; import java.security.PrivilegedAction; import java.util.Set; import java.util.concurrent.Semaphore; import javax.swing.JDialog; import javax.swing.SwingUtilities; import net.sourceforge.jnlp.JNLPFile; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.JNLPClassLoader.SecurityDelegate; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.security.appletextendedsecurity.AppletSecurityActions; import net.sourceforge.jnlp.security.appletextendedsecurity.ExecuteAppletAction; import net.sourceforge.jnlp.security.appletextendedsecurity.UnsignedAppletTrustConfirmation; import static net.sourceforge.jnlp.security.appletextendedsecurity.UnsignedAppletTrustConfirmation.getStoredAction; import net.sourceforge.jnlp.security.dialogs.AccessWarningPaneComplexReturn; import net.sourceforge.jnlp.security.dialogs.apptrustwarningpanel.AppTrustWarningPanel.AppSigningWarningAction; import net.sourceforge.jnlp.util.UrlUtils; import net.sourceforge.jnlp.util.logging.OutputController; /** *

    * A factory for showing many possible types of security warning to the user. *

    *

    * This contains all the public methods that classes outside this package should * use instead of using {@link SecurityDialog} directly. *

    *

    * All of these methods post a message to the * {@link SecurityDialogMessageHandler} and block waiting for a response. *

    */ public class SecurityDialogs { /** Types of dialogs we can create */ public static enum DialogType { CERT_WARNING, MORE_INFO, CERT_INFO, SINGLE_CERT_INFO, ACCESS_WARNING, PARTIALLYSIGNED_WARNING, UNSIGNED_WARNING, /* requires confirmation with 'high-security' setting */ APPLET_WARNING, AUTHENTICATION, UNSIGNED_EAS_NO_PERMISSIONS_WARNING, /* when Extended applet security is at High Security and no permission attribute is find, */ MISSING_ALACA, /*alaca - Application-Library-Allowable-Codebase Attribute*/ MATCHING_ALACA } /** The types of access which may need user permission. */ public static enum AccessType { READ_FILE, WRITE_FILE, CREATE_DESTKOP_SHORTCUT, CLIPBOARD_READ, CLIPBOARD_WRITE, PRINTER, NETWORK, VERIFIED, UNVERIFIED, PARTIALLYSIGNED, UNSIGNED, /* requires confirmation with 'high-security' setting */ SIGNING_ERROR } public static enum AppletAction { RUN, SANDBOX, CANCEL; public static AppletAction fromInteger(int i) { switch (i) { case 0: return RUN; case 1: return SANDBOX; case 2: return CANCEL; default: return CANCEL; } } } /** * Shows a warning dialog for different types of system access (i.e. file * open/save, clipboard read/write, printing, etc). * * @param accessType the type of system access requested. * @param file the jnlp file associated with the requesting application. * @return true if permission was granted by the user, false otherwise. */ public static boolean showAccessWarningDialogB(AccessType accessType, JNLPFile file) { return showAccessWarningDialogB(accessType, file, null); } public static boolean showAccessWarningDialogB(AccessType accessType, JNLPFile file, final Object[] extras) { Object o = showAccessWarningDialog(accessType, file, extras); if (o instanceof Boolean){ return (Boolean) o; } if (o instanceof Integer){ return getIntegerResponseAsBoolean(o); } if (o instanceof AccessWarningPaneComplexReturn){ return getIntegerResponseAsBoolean(((AccessWarningPaneComplexReturn)o).getRegularReturn()); } return false; } /** * unlike showAccessWarningDialogB this is returning raw int code * @param accessType type of dialogue * @param file file for which thsi dialogue is built for * @return return from dialogue */ public static int showAccessWarningDialogI(AccessType accessType, JNLPFile file) { Object o = showAccessWarningDialog(accessType, file, null); if (o instanceof Boolean){ boolean b =(Boolean) o; if (b){ return 0; } else { return 1; } } if (o instanceof Integer){ return (Integer)o; } if (o instanceof AccessWarningPaneComplexReturn){ return ((AccessWarningPaneComplexReturn)o).getRegularReturn(); } return 1; } public static AccessWarningPaneComplexReturn showAccessWarningDialogComplexReturn(AccessType accessType, JNLPFile file) { Object o = showAccessWarningDialog(accessType, file, null); if (o instanceof AccessWarningPaneComplexReturn){ return (AccessWarningPaneComplexReturn)o; } if (o instanceof Boolean) { boolean b = (Boolean) o; if (b) { return new AccessWarningPaneComplexReturn(0); } else { return new AccessWarningPaneComplexReturn(1); } } if (o instanceof Integer) { return new AccessWarningPaneComplexReturn((int) o); } return new AccessWarningPaneComplexReturn(1); } /** * unlike showAccessWarningDialogB this is returning raw int code * @param accessType type of dialogue * @param file file for which thsi dialogue is built for * @param extras aditional parameters to dialogue * @return return from dialogue */ public static Object showAccessWarningDialog(final AccessType accessType, final JNLPFile file, final Object[] extras) { if (!shouldPromptUser()) { if (JNLPRuntime.isTrustAll()) { return 0; } else { return 1; } } final SecurityDialogMessage message = new SecurityDialogMessage(); message.dialogType = DialogType.ACCESS_WARNING; message.accessType = accessType; message.file = file; message.extras = extras; return getUserResponse(message); } /** * Shows a warning dialog for when a plugin applet is unsigned. * This is used with 'high-security' setting. * * @param file the file to be base as information source for this dialogue * @return true if permission was granted by the user, false otherwise. */ public static AppSigningWarningAction showUnsignedWarningDialog(JNLPFile file) { if (!shouldPromptUser()) { if (JNLPRuntime.isTrustAll()) { return new AppSigningWarningAction(ExecuteAppletAction.YES, false); } else { return new AppSigningWarningAction(ExecuteAppletAction.NO, false); } } final SecurityDialogMessage message = new SecurityDialogMessage(); message.dialogType = DialogType.UNSIGNED_WARNING; message.accessType = AccessType.UNSIGNED; message.file = file; return (AppSigningWarningAction) getUserResponse(message); } /** * Shows a security warning dialog according to the specified type of * access. If {@code accessType} is one of {@link AccessType#VERIFIED} or * {@link AccessType#UNVERIFIED}, extra details will be available with * regards to code signing and signing certificates. * * @param accessType the type of warning dialog to show * @param file the JNLPFile associated with this warning * @param certVerifier the JarCertVerifier used to verify this application * @param securityDelegate the delegate for security atts. * * @return RUN if the user accepted the certificate, SANDBOX if the user * wants the applet to run with only sandbox permissions, or CANCEL if the * user did not accept running the applet */ public static AppletAction showCertWarningDialog(AccessType accessType, JNLPFile file, CertVerifier certVerifier, SecurityDelegate securityDelegate) { if (!shouldPromptUser()) { if (JNLPRuntime.isTrustAll()) { return AppletAction.RUN; } else { return AppletAction.CANCEL; } } final SecurityDialogMessage message = new SecurityDialogMessage(); message.dialogType = DialogType.CERT_WARNING; message.accessType = accessType; message.file = file; message.certVerifier = certVerifier; message.extras = new Object[] { securityDelegate }; Object selectedValue = getUserResponse(message); return getIntegerResponseAsAppletAction(selectedValue); } /** * Shows a warning dialog for when an applet or application is partially signed. * * @param file the JNLPFile associated with this warning * @param certVerifier the JarCertVerifier used to verify this application * @param securityDelegate the delegate for security atts. * @return true if permission was granted by the user, false otherwise. */ public static AppSigningWarningAction showPartiallySignedWarningDialog(JNLPFile file, CertVerifier certVerifier, SecurityDelegate securityDelegate) { if (!shouldPromptUser()) { if (JNLPRuntime.isTrustAll()) { return new AppSigningWarningAction(ExecuteAppletAction.YES, false); } else { return new AppSigningWarningAction(ExecuteAppletAction.NO, false); } } final SecurityDialogMessage message = new SecurityDialogMessage(); message.dialogType = DialogType.PARTIALLYSIGNED_WARNING; message.accessType = AccessType.PARTIALLYSIGNED; message.file = file; message.certVerifier = certVerifier; message.extras = new Object[] { securityDelegate }; return (AppSigningWarningAction) getUserResponse(message); } /** * Present a dialog to the user asking them for authentication information, * and returns the user's response. The caller must have * NetPermission("requestPasswordAuthentication") for this to work. * * @param host The host for with authentication is needed * @param port The port being accessed * @param prompt The prompt (realm) as presented by the server * @param type The type of server (proxy/web) * @return an array of objects representing user's authentication tokens * @throws SecurityException if the caller does not have the appropriate permissions. */ public static Object[] showAuthenicationPrompt(String host, int port, String prompt, String type) { if (!shouldPromptUser()){ return null; } SecurityManager sm = System.getSecurityManager(); if (sm != null) { NetPermission requestPermission = new NetPermission("requestPasswordAuthentication"); sm.checkPermission(requestPermission); } final SecurityDialogMessage message = new SecurityDialogMessage(); message.dialogType = DialogType.AUTHENTICATION; message.extras = new Object[] { host, port, prompt, type }; Object response = getUserResponse(message); return (Object[]) response; } public static boolean showMissingALACAttributePanel(String title, URL codeBase, Set remoteUrls) { if (!shouldPromptUser()) { if (JNLPRuntime.isTrustAll()) { return true; } else { return false; } } SecurityDialogMessage message = new SecurityDialogMessage(); message.dialogType = DialogType.MISSING_ALACA; String urlToShow = "unknown url"; if (codeBase != null) { urlToShow = codeBase.toString(); } else { OutputController.getLogger().log("Warning, null codebase wants to show in ALACA!"); } message.extras = new Object[]{title, urlToShow, UrlUtils.setOfUrlsToHtmlList(remoteUrls)}; Object selectedValue = getUserResponse(message); return getIntegerResponseAsBoolean(selectedValue); } public static boolean showMatchingALACAttributePanel(JNLPFile file, URL codeBase, Set remoteUrls) { ExecuteAppletAction storedAction = getStoredAction(file, AppletSecurityActions.MATCHING_ALACA_ACTION); OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "Stored action for matching alaca at " + file.getCodeBase() +" was " + storedAction); if (storedAction != null){ if (storedAction == ExecuteAppletAction.ALWAYS){ return true; } if (storedAction == ExecuteAppletAction.NEVER){ return false; } } if (!shouldPromptUser()) { if (JNLPRuntime.isTrustAll()) { return true; } else { return false; } } SecurityDialogMessage message = new SecurityDialogMessage(); message.dialogType = DialogType.MATCHING_ALACA; message.extras = new Object[]{file, codeBase.toString(), UrlUtils.setOfUrlsToHtmlList(remoteUrls)}; AppSigningWarningAction selectedValue = (AppSigningWarningAction) getUserResponse(message); if (selectedValue != null) { OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "Decided action for matching alaca at " + file.getCodeBase() + " was " + selectedValue.getAction()); UnsignedAppletTrustConfirmation.updateAppletAction(file, selectedValue.getAction(), selectedValue.rememberForCodeBase(), AppletSecurityActions.MATCHING_ALACA_ACTION); return selectedValue.getAction() == ExecuteAppletAction.ALWAYS || selectedValue.getAction() == ExecuteAppletAction.YES; } OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "Decided action for matching alaca at " + file.getCodeBase() + " was " + null); return false; } /** * FIXME This is unused. Remove it? * @return (0, 1, 2) => (Yes, No, Cancel) */ public static int showAppletWarning() { if (!shouldPromptUser()) { return 2; } SecurityDialogMessage message = new SecurityDialogMessage(); message.dialogType = DialogType.APPLET_WARNING; Object selectedValue = getUserResponse(message); // result 0 = Yes, 1 = No, 2 = Cancel if (selectedValue instanceof Integer) { // If the selected value can be cast to Integer, use that value return ((Integer) selectedValue); } else { // Otherwise default to "cancel" return 2; } } public static boolean showMissingPermissionsAttributeDialogue(String title, String codeBase) { if (!shouldPromptUser()) { if (JNLPRuntime.isTrustAll()) { return true; } else { return false; } } SecurityDialogMessage message = new SecurityDialogMessage(); message.dialogType = DialogType.UNSIGNED_EAS_NO_PERMISSIONS_WARNING; message.extras = new Object[]{title, codeBase}; Object selectedValue = getUserResponse(message); return SecurityDialogs.getIntegerResponseAsBoolean(selectedValue); } /** * Posts the message to the SecurityThread and gets the response. Blocks * until a response has been recieved. It's safe to call this from an * EventDispatchThread. * * @param message the SecuritDialogMessage indicating what type of dialog to * display * @return The user's response. Can be null. The exact answer depends on the * type of message, but generally an Integer corresponding to the value 0 * indicates success/proceed, and everything else indicates failure */ private static Object getUserResponse(final SecurityDialogMessage message) { /* * Want to show a security warning, while blocking the client * application. This would be easy except there is a bug in showing * modal JDialogs in a different AppContext. The source EventQueue - * that sends the message to the (destination) EventQueue which is * supposed to actually show the dialog - must not block. If the source * EventQueue blocks, the destination EventQueue stops responding. So we * have a hack here to work around it. */ /* * If this is the event dispatch thread the use the hack */ if (SwingUtilities.isEventDispatchThread()) { /* * Create a tiny modal dialog (which creates a new EventQueue for * this AppContext, but blocks the original client EventQueue) and * then post the message - this makes the source EventQueue continue * running - but dot not allow the actual applet/application to * continue processing */ final JDialog fakeDialog = new JDialog(); fakeDialog.setSize(0, 0); fakeDialog.setResizable(false); fakeDialog.setModalityType(ModalityType.APPLICATION_MODAL); fakeDialog.addWindowListener(new WindowAdapter() { @Override public void windowOpened(WindowEvent e) { message.toDispose = fakeDialog; message.lock = null; AccessController.doPrivileged(new PrivilegedAction() { @Override public Void run() { JNLPRuntime.getSecurityDialogHandler().postMessage(message); return null; } }); } }); /* this dialog will be disposed/hidden when the user closes the security prompt */ fakeDialog.setVisible(true); } else { /* * Otherwise do it the normal way. Post a message to the security * thread to make it show the security dialog. Wait until it tells us * to proceed. */ message.toDispose = null; message.lock = new Semaphore(0); JNLPRuntime.getSecurityDialogHandler().postMessage(message); boolean done = false; while (!done) { try { message.lock.acquire(); done = true; } catch (InterruptedException e) { // ignore; retry } } } return message.userResponse; } /** * Returns true iff the given Object reference can be cast to Integer and that Integer's * intValue is 0. * @param ref the Integer (hopefully) reference * @return whether the given reference is both an Integer type and has intValue of 0 */ public static boolean getIntegerResponseAsBoolean(Object ref) { boolean isInteger = ref instanceof Integer; if (isInteger) { Integer i = (Integer) ref; return i == 0; } return false; } public static AppletAction getIntegerResponseAsAppletAction(Object ref) { if (ref instanceof Integer) { return AppletAction.fromInteger((Integer) ref); } return AppletAction.CANCEL; } /** * Returns whether the current runtime configuration allows prompting user * for security warnings. * * @return true if security warnings should be shown to the user. false of * otherwise or runtime is headless */ private static boolean shouldPromptUser() { return AccessController.doPrivileged(new PrivilegedAction() { @Override public Boolean run() { if (JNLPRuntime.isHeadless()){ return false; } return Boolean.valueOf(JNLPRuntime.getConfiguration() .getProperty(DeploymentConfiguration.KEY_SECURITY_PROMPT_USER)); } }); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/PaxHeaders.17941/SecurityDialogMessageHandler.j0000644000000000000000000000013212654402377030253 xustar0030 mtime=1454507263.215432874 30 atime=1454507327.143580283 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/SecurityDialogMessageHandler.java0000644000175000002070000001235312654402377031472 0ustar00jvanekmock00000000000000/* SecurityDialogMessageHandler.java Copyright (C) 2010 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; import sun.awt.AppContext; import net.sourceforge.jnlp.util.logging.OutputController; /** * Handles {@link SecurityDialogMessage}s and shows appropriate security * dialogs. *

    * In the current architecture, {@link SecurityDialog}s are shown from a * different {@link AppContext} than the {@link AppContext} that asks for a * security prompt. This ensures that all security prompts are isolated and * their Look and Feel is not affected by the Look and Feel of the * applet/application. *

    *

    * This class contains allows a client application to post a * {@link SecurityDialogMessage}. When this class finds a security message in * the queue, it shows a security warning to the user, and sets * {@link SecurityDialogMessage#userResponse} to the appropriate value. *

    */ public final class SecurityDialogMessageHandler implements Runnable { /** the queue of incoming messages to show security dialogs */ private BlockingQueue queue = new LinkedBlockingQueue(); /** * Runs the message handler loop. This waits for incoming security messages * and shows a security dialog. */ @Override public void run() { OutputController.getLogger().log("Starting security dialog thread"); while (true) { try { SecurityDialogMessage msg = queue.take(); handleMessage(msg); } catch (InterruptedException e) { } } } /** * Handles a single {@link SecurityDialogMessage} by showing a * {@link SecurityDialog}. *

    * Once the user has made a choice the * {@link SecurityDialogMessage#toDispose} (if not null) is disposed and * {@link SecurityDialogMessage#lock} (in not null) is released. *

    * * @param message the message indicating what type of security dialog to * show */ private void handleMessage(SecurityDialogMessage message) { final SecurityDialogMessage msg = message; final SecurityDialog dialog = new SecurityDialog(message.dialogType, message.accessType, message.file, message.certVerifier, message.certificate, message.extras); dialog.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { msg.userResponse = dialog.getValue(); /* Allow the client to continue on the other side */ if (msg.toDispose != null) { msg.toDispose.dispose(); } if (msg.lock != null) { msg.lock.release(); } } }); dialog.setVisible(true); } /** * Post a message to the security event queue. This message will be picked * up by the security thread and used to show the appropriate security * dialog. *

    * Once the user has made a choice the * {@link SecurityDialogMessage#toDispose} (if not null) is disposed and * {@link SecurityDialogMessage#lock} (in not null) is released. *

    * * @param message indicates the type of security dialog to show */ public void postMessage(SecurityDialogMessage message) { try { queue.put(message); } catch (InterruptedException e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); } } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/PaxHeaders.17941/SecurityDialogMessage.java0000644000000000000000000000013212654402377027445 xustar0030 mtime=1454507263.215432874 30 atime=1454507327.143580283 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/SecurityDialogMessage.java0000644000175000002070000000545512654402377030201 0ustar00jvanekmock00000000000000/* SecurityDialogMessage.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security; import java.security.cert.X509Certificate; import java.util.concurrent.Semaphore; import javax.swing.JDialog; import net.sourceforge.jnlp.JNLPFile; import net.sourceforge.jnlp.security.SecurityDialogs.AccessType; import net.sourceforge.jnlp.security.SecurityDialogs.DialogType; /** * Represents a message to the security framework to show a specific security * dialog */ final class SecurityDialogMessage { /* * These fields contain information need to display the correct dialog type */ public DialogType dialogType; public AccessType accessType; public JNLPFile file; public CertVerifier certVerifier; public X509Certificate certificate; public Object[] extras; /* * Volatile because this is shared between threads and we dont want threads * to use a cached value of this. */ public volatile Object userResponse; /* * These two fields are used to block/unblock the application or the applet. * If either of them is not null, call release() or dispose() on it to allow * the application/applet to continue. */ public Semaphore lock; public JDialog toDispose; } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/PaxHeaders.17941/SecurityDialog.java0000644000000000000000000000013212654402377026140 xustar0030 mtime=1454507263.214432888 30 atime=1454507327.143580283 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/SecurityDialog.java0000644000175000002070000003425212654402377026671 0ustar00jvanekmock00000000000000/* SecurityDialog.java Copyright (C) 2010 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security; import java.awt.BorderLayout; import java.awt.event.ActionListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.security.cert.X509Certificate; import java.util.List; import java.util.concurrent.CopyOnWriteArrayList; import javax.swing.JDialog; import net.sourceforge.jnlp.JNLPFile; import net.sourceforge.jnlp.runtime.JNLPClassLoader.SecurityDelegate; import net.sourceforge.jnlp.security.SecurityDialogs.AccessType; import net.sourceforge.jnlp.security.SecurityDialogs.DialogType; import net.sourceforge.jnlp.security.dialogs.AccessWarningPane; import net.sourceforge.jnlp.security.dialogs.AppletWarningPane; import net.sourceforge.jnlp.security.dialogs.CertWarningPane; import net.sourceforge.jnlp.security.dialogs.CertsInfoPane; import net.sourceforge.jnlp.security.dialogs.MissingALACAttributePanel; import net.sourceforge.jnlp.security.dialogs.MissingPermissionsAttributePanel; import net.sourceforge.jnlp.security.dialogs.MoreInfoPane; import net.sourceforge.jnlp.security.dialogs.PasswordAuthenticationPane; import net.sourceforge.jnlp.security.dialogs.SecurityDialogPanel; import net.sourceforge.jnlp.security.dialogs.SingleCertInfoPane; import net.sourceforge.jnlp.security.dialogs.apptrustwarningpanel.AppTrustWarningDialog; import net.sourceforge.jnlp.util.ImageResources; import net.sourceforge.jnlp.util.ScreenFinder; import net.sourceforge.jnlp.util.logging.OutputController; /** * Provides methods for showing security warning dialogs for a wide range of * JNLP security issues. Note that the security dialogs should be running in the * secure AppContext - this class should not be used directly from an applet or * application. See {@link SecurityDialogs} for a way to show security dialogs. * * @author Joshua Sumali */ public class SecurityDialog extends JDialog { /** The type of dialog we want to show */ private final DialogType dialogType; /** The type of access that this dialog is for */ private final AccessType accessType; private SecurityDialogPanel panel; /** The application file associated with this security warning */ private final JNLPFile file; private final CertVerifier certVerifier; private final X509Certificate cert; /** An optional String array that's only necessary when a dialog * label requires some parameters (e.g. showing which address an application * is trying to connect to). */ private final Object[] extras; /** Whether or not this object has been fully initialized */ private boolean initialized = false; /** * the return value of this dialog. result: 0 = Yes, 1 = No, 2 = Cancel, * null = Window closed. */ private Object value; /** Should show signed JNLP file warning */ private boolean requiresSignedJNLPWarning; SecurityDialog(DialogType dialogType, AccessType accessType, JNLPFile file, CertVerifier JarCertVerifier, X509Certificate cert, Object[] extras) { super(); setIconImages(ImageResources.INSTANCE.getApplicationImages()); this.dialogType = dialogType; this.accessType = accessType; this.file = file; this.certVerifier = JarCertVerifier; this.cert = cert; this.extras = extras; initialized = true; if(file != null) requiresSignedJNLPWarning= file.requiresSignedJNLPWarning(); initDialog(); } /** * Construct a SecurityDialog to display some sort of access warning */ SecurityDialog(DialogType dialogType, AccessType accessType, JNLPFile file) { this(dialogType, accessType, file, null, null, null); } /** * Create a SecurityDialog to display a certificate-related warning */ SecurityDialog(DialogType dialogType, AccessType accessType, JNLPFile file, CertVerifier certVerifier) { this(dialogType, accessType, file, certVerifier, null, null); } /** * Create a SecurityDialog to display a certificate-related warning */ SecurityDialog(DialogType dialogType, AccessType accessType, CertVerifier certVerifier) { this(dialogType, accessType, null, certVerifier, null, null); } /** * Create a SecurityDialog to display some sort of access warning * with more information */ SecurityDialog(DialogType dialogType, AccessType accessType, JNLPFile file, Object[] extras) { this(dialogType, accessType, file, null, null, extras); } /** * Create a SecurityWarningDailog to display information about a single * certificate */ SecurityDialog(DialogType dialogType, X509Certificate c) { this(dialogType, null, null, null, c, null); } /** * Returns if this dialog has been fully initialized yet. * @return true if this dialog has been initialized, and false otherwise. */ public boolean isInitialized() { return initialized; } /** * Shows more information regarding jar code signing * * @param certVerifier the JarCertVerifier used to verify this application * @param parent the parent option pane */ public static void showMoreInfoDialog( CertVerifier certVerifier, SecurityDialog parent) { JNLPFile file= parent.getFile(); SecurityDialog dialog = new SecurityDialog(DialogType.MORE_INFO, null, file, certVerifier); dialog.setModalityType(ModalityType.APPLICATION_MODAL); dialog.setVisible(true); dialog.dispose(); } /** * Displays CertPath information in a readable table format. * * @param certVerifier the JarCertVerifier used to verify this application * @param parent the parent option pane */ public static void showCertInfoDialog(CertVerifier certVerifier, SecurityDialog parent) { SecurityDialog dialog = new SecurityDialog(DialogType.CERT_INFO, null, null, certVerifier); dialog.setLocationRelativeTo(parent); dialog.setModalityType(ModalityType.APPLICATION_MODAL); dialog.setVisible(true); dialog.dispose(); } /** * Displays a single certificate's information. * * @param c the X509 certificate. * @param parent the parent pane. */ public static void showSingleCertInfoDialog(X509Certificate c, JDialog parent) { SecurityDialog dialog = new SecurityDialog(DialogType.SINGLE_CERT_INFO, c); dialog.setLocationRelativeTo(parent); dialog.setModalityType(ModalityType.APPLICATION_MODAL); dialog.setVisible(true); dialog.dispose(); } private void initDialog() { String dialogTitle = ""; if (dialogType == DialogType.CERT_WARNING) { if (accessType == AccessType.VERIFIED) dialogTitle = "Security Approval Required"; else dialogTitle = "Security Warning"; } else if (dialogType == DialogType.MORE_INFO) dialogTitle = "More Information"; else if (dialogType == DialogType.CERT_INFO) dialogTitle = "Details - Certificate"; else if (dialogType == DialogType.ACCESS_WARNING) dialogTitle = "Security Warning"; else if (dialogType == DialogType.APPLET_WARNING) dialogTitle = "Applet Warning"; else if (dialogType == DialogType.PARTIALLYSIGNED_WARNING) dialogTitle = "Security Warning"; else if (dialogType == DialogType.AUTHENTICATION) dialogTitle = "Authentication Required"; setTitle(dialogTitle); setModalityType(ModalityType.MODELESS); setDefaultCloseOperation(DISPOSE_ON_CLOSE); installPanel(); pack(); centerDialog(this); WindowAdapter adapter = new WindowAdapter() { private boolean gotFocus = false; @Override public void windowGainedFocus(WindowEvent we) { // Once window gets focus, set initial focus if (!gotFocus) { selectDefaultButton(); gotFocus = true; } } @Override public void windowOpened(WindowEvent e) { if (e.getSource() instanceof SecurityDialog) { SecurityDialog dialog = (SecurityDialog) e.getSource(); dialog.setResizable(true); dialog.setValue(null); } } }; addWindowListener(adapter); addWindowFocusListener(adapter); } public AccessType getAccessType() { return accessType; } public JNLPFile getFile() { return file; } public CertVerifier getCertVerifier() { return certVerifier; } public X509Certificate getCert() { return cert; } /** * Adds the appropriate JPanel to this Dialog, based on {@link DialogType}. */ private void installPanel() { if (dialogType == DialogType.CERT_WARNING) panel = new CertWarningPane(this, this.certVerifier, (SecurityDelegate) extras[0]); else if (dialogType == DialogType.MORE_INFO) panel = new MoreInfoPane(this, this.certVerifier); else if (dialogType == DialogType.CERT_INFO) panel = new CertsInfoPane(this, this.certVerifier); else if (dialogType == DialogType.SINGLE_CERT_INFO) panel = new SingleCertInfoPane(this, this.certVerifier); else if (dialogType == DialogType.ACCESS_WARNING) panel = new AccessWarningPane(this, extras, this.certVerifier); else if (dialogType == DialogType.APPLET_WARNING) panel = new AppletWarningPane(this, this.certVerifier); else if (dialogType == DialogType.PARTIALLYSIGNED_WARNING) panel = AppTrustWarningDialog.partiallySigned(this, file, (SecurityDelegate) extras[0]); else if (dialogType == DialogType.UNSIGNED_WARNING) // Only necessary for applets on 'high security' or above panel = AppTrustWarningDialog.unsigned(this, file); else if (dialogType == DialogType.AUTHENTICATION) panel = new PasswordAuthenticationPane(this, extras); else if (dialogType == DialogType.UNSIGNED_EAS_NO_PERMISSIONS_WARNING) panel = new MissingPermissionsAttributePanel(this, (String) extras[0], (String) extras[1]); else if (dialogType == DialogType.MISSING_ALACA) panel = new MissingALACAttributePanel(this, (String) extras[0], (String) extras[1], (String) extras[2]); else if (dialogType == DialogType.MATCHING_ALACA) panel = AppTrustWarningDialog.matchingAlaca(this, (JNLPFile) extras[0], (String) extras[1], (String) extras[2]); add(panel, BorderLayout.CENTER); } private static void centerDialog(JDialog dialog) { ScreenFinder.centerWindowsToCurrentScreen(dialog); } private void selectDefaultButton() { if (panel == null) { OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, "initial value panel is null"); } panel.requestFocusOnDefaultButton(); } public void setValue(Object value) { OutputController.getLogger().log("Setting value:" + value); this.value = value; } public Object getValue() { OutputController.getLogger().log("Returning value:" + value); return value; } /** * Called when the SecurityDialog is hidden - either because the user * made a choice (Ok, Cancel, etc) or closed the window */ @Override public void dispose() { notifySelectionMade(); super.dispose(); } private final List listeners = new CopyOnWriteArrayList<>(); /** * Notify all the listeners that the user has made a decision using this * security dialog. */ public void notifySelectionMade() { for (ActionListener listener : listeners) { listener.actionPerformed(null); } } /** * Adds an {@link ActionListener} which will be notified if the user makes a * choice using this SecurityDialog. The listener should use {@link #getValue()} * to actually get the user's response. * @param listener another action listener to be listen to */ public void addActionListener(ActionListener listener) { listeners.add(listener); } public boolean requiresSignedJNLPWarning() { return requiresSignedJNLPWarning; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/PaxHeaders.17941/PluginAppVerifier.java0000644000000000000000000000013212654402377026604 xustar0030 mtime=1454507263.214432888 30 atime=1454507327.143580283 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/PluginAppVerifier.java0000644000175000002070000002125112654402377027330 0ustar00jvanekmock00000000000000/* PluginAppVerifier.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security; import static net.sourceforge.jnlp.runtime.Translator.R; import java.security.cert.CertPath; import java.util.ArrayList; import java.util.List; import java.util.Map; import net.sourceforge.jnlp.JNLPFile; import net.sourceforge.jnlp.LaunchException; import net.sourceforge.jnlp.runtime.JNLPClassLoader.SecurityDelegate; import net.sourceforge.jnlp.security.SecurityDialogs.AccessType; import net.sourceforge.jnlp.security.SecurityDialogs.AppletAction; import net.sourceforge.jnlp.tools.CertInformation; import net.sourceforge.jnlp.tools.JarCertVerifier; public class PluginAppVerifier implements AppVerifier { @Override public boolean hasAlreadyTrustedPublisher( Map certs, Map signedJars) { boolean allPublishersTrusted = true; for(String jarName : signedJars.keySet()) { int numbSignableEntries = signedJars.get(jarName); boolean publisherTrusted = false; for (CertInformation certInfo : certs.values()) { if(certInfo.isSignerOfJar(jarName) && numbSignableEntries == certInfo.getNumJarEntriesSigned(jarName) && certInfo.isPublisherAlreadyTrusted()) { publisherTrusted = true; break; } } allPublishersTrusted &= publisherTrusted; } return allPublishersTrusted; } @Override public boolean hasRootInCacerts(Map certs, Map signedJars) { boolean allRootCAsTrusted = true; for(String jarName : signedJars.keySet()) { int numbSignableEntries = signedJars.get(jarName); boolean rootCATrusted = false; for (CertInformation certInfo : certs.values()) { if(certInfo.isSignerOfJar(jarName) && numbSignableEntries == certInfo.getNumJarEntriesSigned(jarName) && certInfo.isRootInCacerts()) { rootCATrusted = true; break; } } allRootCAsTrusted &= rootCATrusted; } return allRootCAsTrusted; } @Override public boolean isFullySigned(Map certs, Map signedJars) { boolean isFullySigned = true; for(String jarName : signedJars.keySet()) { int numbSignableEntries = signedJars.get(jarName); boolean isSigned = false; for (CertInformation certInfo : certs.values()) { if(certInfo.isSignerOfJar(jarName) && numbSignableEntries == certInfo.getNumJarEntriesSigned(jarName)) { isSigned = true; break; } } isFullySigned &= isSigned; } return isFullySigned; } @Override public void checkTrustWithUser(SecurityDelegate securityDelegate, JarCertVerifier jcv, JNLPFile file) throws LaunchException { List certPaths = buildCertPathsList(jcv); List alreadyApprovedByUser = new ArrayList(); for (String jarName : jcv.getJarSignableEntries().keySet()) { boolean trustFoundOrApproved = false; for (CertPath cPathApproved : alreadyApprovedByUser) { jcv.setCurrentlyUsedCertPath(cPathApproved); CertInformation info = jcv.getCertInformation(cPathApproved); if (info.isSignerOfJar(jarName) && alreadyApprovedByUser.contains(cPathApproved)) { trustFoundOrApproved = true; break; } } if (trustFoundOrApproved) { continue; } for (CertPath cPath : certPaths) { jcv.setCurrentlyUsedCertPath(cPath); CertInformation info = jcv.getCertInformation(cPath); if (info.isSignerOfJar(jarName)) { if (info.isPublisherAlreadyTrusted()) { trustFoundOrApproved = true; alreadyApprovedByUser.add(cPath); break; } AccessType dialogType; if (info.isRootInCacerts() && !info.hasSigningIssues()) { dialogType = AccessType.VERIFIED; } else if (info.isRootInCacerts()) { dialogType = AccessType.SIGNING_ERROR; } else { dialogType = AccessType.UNVERIFIED; } AppletAction action = SecurityDialogs.showCertWarningDialog( dialogType, file, jcv, securityDelegate); if (action != AppletAction.CANCEL) { if (action == AppletAction.SANDBOX) { securityDelegate.setRunInSandbox(); } alreadyApprovedByUser.add(cPath); trustFoundOrApproved = true; break; } } } if (!trustFoundOrApproved) { throw new LaunchException(null, null, R("LSFatal"), R("LCLaunching"), R("LCancelOnUserRequest"), ""); } } } /** * Build a list of all the CertPaths that were detected in the provided * JCV, placing them in the most trusted possible order. * @param jcv The verifier containing the CertPaths to examine. * @return A list of CertPaths sorted in the following order: Signers with * 1. Already trusted publishers * 2. Roots in the CA store and have no signing issues * 3. Roots in the CA store but have signing issues * 4. Everything else */ public List buildCertPathsList(JarCertVerifier jcv) { List certPathsList = jcv.getCertsList(); List returnList = new ArrayList(); for (CertPath cPath : certPathsList) { if (!returnList.contains(cPath) && jcv.getCertInformation(cPath).isPublisherAlreadyTrusted()) returnList.add(cPath); } for (CertPath cPath : certPathsList) { if (!returnList.contains(cPath) && jcv.getCertInformation(cPath).isRootInCacerts() && !jcv.getCertInformation(cPath).hasSigningIssues()) returnList.add(cPath); } for (CertPath cPath : certPathsList) { if (!returnList.contains(cPath) && jcv.getCertInformation(cPath).isRootInCacerts() && jcv.getCertInformation(cPath).hasSigningIssues()) returnList.add(cPath); } for (CertPath cPath : certPathsList) { if (!returnList.contains(cPath)) returnList.add(cPath); } return returnList; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/PaxHeaders.17941/KeystorePasswordAttempter.java0000644000000000000000000000013212654402377030427 xustar0030 mtime=1454507263.213432901 30 atime=1454507327.143580283 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/KeystorePasswordAttempter.java0000644000175000002070000002106512654402377031156 0ustar00jvanekmock00000000000000/* CertificatePane.java Copyright (C) 2015 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security; import java.io.File; import java.io.IOException; import java.security.Key; import java.security.KeyStore; import java.security.KeyStoreException; import java.security.NoSuchAlgorithmException; import java.security.UnrecoverableKeyException; import java.security.cert.Certificate; import java.security.cert.CertificateException; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.net.ssl.KeyManagerFactory; import javax.swing.JOptionPane; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.runtime.Translator; import net.sourceforge.jnlp.util.logging.OutputController; class KeystorePasswordAttempter { private static final char[] DEFAULT_PASSWORD = "changeit".toCharArray(); private static char[] getTrustedCertsPassword() { return DEFAULT_PASSWORD; } static class SavedPassword { private final char[] pass; public SavedPassword(char[] pass) { this.pass = pass; } } /** * This password can read any keystore. But if you save with him, integrity * of keystore will be lsot for ever. */ static class AllmightyPassword extends SavedPassword { public AllmightyPassword() { super(null); } } static abstract class KeystoreOperation { protected final KeyManagerFactory kmf; protected final KeyStore ks; protected final String alias; protected final Key key; protected final Certificate[] certChain; protected final File f; public KeystoreOperation(KeyStore ks, File f) { this(null, ks, null, null, null, f); } public KeystoreOperation(KeyStore ks, String alias, Key key, Certificate[] certChain) { this(null, ks, alias, key, certChain, null); } public KeystoreOperation(KeyStore ks, String alias, Key key, Certificate[] certChain, File f) { this(null, ks, alias, key, certChain, f); } public KeystoreOperation(KeyManagerFactory kmf, KeyStore ks) { this(kmf, ks, null, null, null, null); } public KeystoreOperation(KeyManagerFactory kmf, KeyStore ks, String alias, Key key, Certificate[] certChain, File f) { this.kmf = kmf; this.ks = ks; this.alias = alias; this.key = key; this.certChain = certChain; this.f = f; } abstract Key operateKeystore(char[] pass) throws KeyStoreException, NoSuchAlgorithmException, UnrecoverableKeyException, IOException, CertificateException; abstract String getId(); } //static final KeystorePasswordAttempter INSTANCE = new KeystorePasswordAttempter(new SavedPassword(getTrustedCertsPassword()), new AllmightyPassword()); static final KeystorePasswordAttempter INSTANCE = new KeystorePasswordAttempter(new SavedPassword(getTrustedCertsPassword())); private final List passes; private final Map sucesfullPerKeystore = new HashMap<>(); private KeystorePasswordAttempter(SavedPassword... initialPasswords) { passes = new ArrayList<>(initialPasswords.length); passes.addAll(Arrays.asList(initialPasswords)); } Key unlockKeystore(KeystoreOperation operation) throws KeyStoreException, NoSuchAlgorithmException, UnrecoverableKeyException, IOException, CertificateException { SavedPassword sucessfullKey = sucesfullPerKeystore.get(operation.ks); Exception firstEx = null; String messages = ""; List localPases = new ArrayList<>(); if (sucessfullKey != null){ //sucessfull must be firts. If it is not, then writing to keystore by illegal password, will kill kesytore's integrity localPases.add(sucessfullKey); } localPases.addAll(passes); for (int i = 0; i < localPases.size(); i++) { SavedPassword pass = localPases.get(i); try { //we expect, that any keystore is loaded before readed. //so we are wrting by correct password //if no sucessfull passwrod was provided during rading, then finish(firstEx); will save us from overwrite Key result = operation.operateKeystore(pass.pass); //ok we were sucessfull //save the loading password for storing purposes (and another reading too) sucesfullPerKeystore.put(operation.ks, pass); return result; } catch (KeyStoreException | NoSuchAlgorithmException | UnrecoverableKeyException | IOException | CertificateException ex) { if (firstEx == null) { firstEx = ex; } messages += "'" + ex.getMessage() + "' "; OutputController.getLogger().log(ex); //tried all known, ask for new or finally die if (i + 1 == localPases.size()) { String s1 = Translator.R("KSresultUntilNow", messages, operation.getId(), (i + 1)); OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, s1); OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, Translator.R("KSinvalidPassword")); if (JNLPRuntime.isHeadless()) { OutputController.getLogger().log(Translator.R("KSheadlesWarning")); finish(firstEx); } else { String s = JOptionPane.showInputDialog(s1 + "\n" + Translator.R("KSnwPassHelp")); if (s == null) { finish(firstEx); } //if input is null, exception is thrown from finish method SavedPassword users = new SavedPassword(s.toCharArray()); passes.add(users); localPases.add(users); } //user already read all messages, now show only last one messages = ""; } } } return null; } private void finish(Exception ex) throws KeyStoreException, NoSuchAlgorithmException, UnrecoverableKeyException, IOException, CertificateException { if (ex instanceof KeyStoreException) { throw (KeyStoreException) ex; } else if (ex instanceof NoSuchAlgorithmException) { throw (NoSuchAlgorithmException) ex; } else if (ex instanceof UnrecoverableKeyException) { throw (UnrecoverableKeyException) ex; } else if (ex instanceof IOException) { throw (IOException) ex; } else if (ex instanceof CertificateException) { throw (CertificateException) ex; } else { throw new RuntimeException("Unexpected exception", ex); } } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/PaxHeaders.17941/KeyStores.java0000644000000000000000000000013212654402377025141 xustar0030 mtime=1454507263.213432901 30 atime=1454507327.143580283 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/KeyStores.java0000644000175000002070000003020412654402377025663 0ustar00jvanekmock00000000000000/* KeyStores.java Copyright (C) 2010 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.security.AllPermission; import java.security.KeyStore; import java.security.KeyStoreException; import java.security.NoSuchAlgorithmException; import java.security.cert.CertificateException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.StringTokenizer; import net.sourceforge.jnlp.config.InfrastructureFileDescriptor; import net.sourceforge.jnlp.config.PathsAndFiles; import net.sourceforge.jnlp.runtime.Translator; import net.sourceforge.jnlp.util.FileUtils; import net.sourceforge.jnlp.util.logging.OutputController; /** * The {@code KeyStores} class allows easily accessing the various KeyStores * used. */ public final class KeyStores { /* this gets turned into user-readable strings, see toUserReadableString */ public enum Level { USER, SYSTEM, } public enum Type { CERTS, JSSE_CERTS, CA_CERTS, JSSE_CA_CERTS, CLIENT_CERTS, } public static final Map keystoresPaths=new HashMap<>(); private static final String KEYSTORE_TYPE = "JKS"; /** * Returns a KeyStore corresponding to the appropriate level level (user or * system) and type. * * @param level whether the KeyStore desired is a user-level or system-level * KeyStore * @param type the type of KeyStore desired * @return a KeyStore containing certificates from the appropriate */ public static final KeyStore getKeyStore(Level level, Type type) { boolean create; if (level == Level.USER) { create = true; } else { create = false; } return getKeyStore(level, type, create); } /** * Returns a KeyStore corresponding to the appropriate level level (user or * system) and type. * * @param level whether the KeyStore desired is a user-level or system-level * KeyStore * @param type the type of KeyStore desired * @param create true if keystore can be created * @return a KeyStore containing certificates from the appropriate */ public static final KeyStore getKeyStore(Level level, Type type, boolean create) { SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(new AllPermission()); } String location = getKeyStoreLocation(level, type).getFullPath(); KeyStore ks = null; try { ks = createKeyStoreFromFile(new File(location), create); //hashcode is used instead of instance so when no references are left //to keystore, then this will not be blocker for garbage collection keystoresPaths.put(ks.hashCode(),location); } catch (Exception e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); } return ks; } public static String getPathToKeystore(int k) { String s = keystoresPaths.get(k); if (s == null) { return "unknown keystore location"; } return s; } /** * Returns an array of KeyStore that contain certificates that are trusted. * The KeyStores contain certificates from different sources. * * @return an array of KeyStore containing trusted Certificates */ public static final KeyStore[] getCertKeyStores() { List result = new ArrayList<>(10); /* System-level JSSE certificates */ KeyStore ks = getKeyStore(Level.SYSTEM, Type.JSSE_CERTS); if (ks != null) { result.add(ks); } /* System-level certificates */ ks = getKeyStore(Level.SYSTEM, Type.CERTS); if (ks != null) { result.add(ks); } /* User-level JSSE certificates */ ks = getKeyStore(Level.USER, Type.JSSE_CERTS); if (ks != null) { result.add(ks); } /* User-level certificates */ ks = getKeyStore(Level.USER, Type.CERTS); if (ks != null) { result.add(ks); } return result.toArray(new KeyStore[result.size()]); } /** * Returns an array of KeyStore that contain trusted CA certificates. * * @return an array of KeyStore containing trusted CA certificates */ public static final KeyStore[] getCAKeyStores() { List result = new ArrayList<>(10); /* System-level JSSE CA certificates */ KeyStore ks = getKeyStore(Level.SYSTEM, Type.JSSE_CA_CERTS); if (ks != null) { result.add(ks); } /* System-level CA certificates */ ks = getKeyStore(Level.SYSTEM, Type.CA_CERTS); if (ks != null) { result.add(ks); } /* User-level JSSE CA certificates */ ks = getKeyStore(Level.USER, Type.JSSE_CA_CERTS); if (ks != null) { result.add(ks); } /* User-level CA certificates */ ks = getKeyStore(Level.USER, Type.CA_CERTS); if (ks != null) { result.add(ks); } return result.toArray(new KeyStore[result.size()]); } /** * Returns KeyStores containing trusted client certificates * * @return an array of KeyStore objects that can be used to check client * authentication certificates */ public static KeyStore[] getClientKeyStores() { List result = new ArrayList<>(); KeyStore ks = getKeyStore(Level.SYSTEM, Type.CLIENT_CERTS); if (ks != null) { result.add(ks); } ks = getKeyStore(Level.USER, Type.CLIENT_CERTS); if (ks != null) { result.add(ks); } return result.toArray(new KeyStore[result.size()]); } /** * Returns the location of a KeyStore corresponding to the given level and type. * * @param level the specified level of the key store to be returned. * @param type the specified type of the key store to be returned. * @return the location of the key store. */ public static final InfrastructureFileDescriptor getKeyStoreLocation(Level level, Type type) { switch (level) { case SYSTEM: switch (type) { case JSSE_CA_CERTS: return PathsAndFiles.SYS_JSSECAC; case CA_CERTS: return PathsAndFiles.SYS_CACERT; case JSSE_CERTS: return PathsAndFiles.SYS_JSSECERT; case CERTS: return PathsAndFiles.SYS_CERT; case CLIENT_CERTS: return PathsAndFiles.SYS_CLIENTCERT; } break; case USER: switch (type) { case JSSE_CA_CERTS: return PathsAndFiles.USER_JSSECAC; case CA_CERTS: return PathsAndFiles.USER_CACERTS; case JSSE_CERTS: return PathsAndFiles.USER_JSSECER; case CERTS: return PathsAndFiles.USER_CERTS; case CLIENT_CERTS: return PathsAndFiles.USER_CLIENTCERT; } break; } throw new RuntimeException("Unspported"); } /** * Returns a String that can be used as a translation key to create a * user-visible representation of this KeyStore. Creates a string by * concatenating a level and type, converting everything to Title Case and * removing the _'s. (USER,CA_CERTS) becomes UserCaCerts. * * @param level the level of the key store. * @param type the type of the key store. * @return the translation key. */ public static final String toTranslatableString(Level level, Type type) { StringBuilder response = new StringBuilder(); response.append("KS"); if (level != null) { String levelString = level.toString(); response.append(levelString.substring(0, 1).toUpperCase()); response.append(levelString.substring(1).toLowerCase()); } if (type != null) { String typeString = type.toString(); StringTokenizer tokenizer = new StringTokenizer(typeString, "_"); while (tokenizer.hasMoreTokens()) { String token = tokenizer.nextToken(); response.append(token.substring(0, 1).toUpperCase()); response.append(token.substring(1).toLowerCase()); } } return response.toString(); } /** * Returns a human readable name for this KeyStore * * @param level the level of the KeyStore * @param type the type of KeyStore * @return a localized name for this KeyStore */ public static String toDisplayableString(Level level, Type type) { return Translator.R(toTranslatableString(level, type)); } /** * Reads the file (using the password) and uses it to create a new * {@link KeyStore}. If the file does not exist and should not be created, * it returns an empty but initialized KeyStore * * @param file the file to load information from * @return a KeyStore containing data from the file */ private static final KeyStore createKeyStoreFromFile(File file, boolean createIfNotFound) throws IOException, KeyStoreException, NoSuchAlgorithmException, CertificateException { FileInputStream fis = null; KeyStore ks = null; try { if (createIfNotFound && !file.exists()) { File parent = file.getParentFile(); if (!parent.isDirectory() && !parent.mkdirs()) { throw new IOException("unable to create " + parent); } FileUtils.createRestrictedFile(file, true); ks = KeyStore.getInstance(KEYSTORE_TYPE); SecurityUtil.loadKeyStore(ks, null); SecurityUtil.storeKeyStore(ks, file); } if (file.exists()) { ks = KeyStore.getInstance(KEYSTORE_TYPE); SecurityUtil.loadKeyStore(ks, file); } else { ks = KeyStore.getInstance(KEYSTORE_TYPE); SecurityUtil.loadKeyStore(ks, null); } } finally { if (fis != null) { fis.close(); } } return ks; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/PaxHeaders.17941/JNLPAuthenticator.java0000644000000000000000000000013212654402377026507 xustar0030 mtime=1454507263.213432901 30 atime=1454507327.142580297 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/JNLPAuthenticator.java0000644000175000002070000000512012654402377027230 0ustar00jvanekmock00000000000000/* JNLPAuthenticator Copyright (C) 2008 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security; import java.net.Authenticator; import java.net.PasswordAuthentication; public class JNLPAuthenticator extends Authenticator { @Override public PasswordAuthentication getPasswordAuthentication() { // No security check is required here, because the only way to set // parameters for which auth info is needed // (Authenticator:requestPasswordAuthentication()), has a security check String type = this.getRequestorType() == RequestorType.PROXY ? "proxy" : "web"; String host = getRequestingHost(); int port = getRequestingPort(); String prompt = getRequestingPrompt(); Object[] response = SecurityDialogs.showAuthenicationPrompt(host, port, prompt, type); if (response == null) { return null; } else { return new PasswordAuthentication((String) response[0], (char[]) response[1]); } } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/PaxHeaders.17941/JNLPAppVerifier.java0000644000000000000000000000013212654402377026111 xustar0030 mtime=1454507263.212432914 30 atime=1454507327.142580297 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/JNLPAppVerifier.java0000644000175000002070000001360112654402377026635 0ustar00jvanekmock00000000000000/* JNLPAppVerifier.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security; import static net.sourceforge.jnlp.runtime.Translator.R; import java.security.cert.CertPath; import java.util.Map; import net.sourceforge.jnlp.JNLPFile; import net.sourceforge.jnlp.LaunchException; import net.sourceforge.jnlp.runtime.JNLPClassLoader.SecurityDelegate; import net.sourceforge.jnlp.security.SecurityDialogs.AccessType; import net.sourceforge.jnlp.security.SecurityDialogs.AppletAction; import net.sourceforge.jnlp.tools.CertInformation; import net.sourceforge.jnlp.tools.JarCertVerifier; public class JNLPAppVerifier implements AppVerifier { @Override public boolean hasAlreadyTrustedPublisher( Map certs, Map signedJars) { int sumOfSignableEntries = JarCertVerifier.getTotalJarEntries(signedJars); for (CertInformation certInfo : certs.values()) { Map certSignedJars = certInfo.getSignedJars(); if (JarCertVerifier.getTotalJarEntries(certSignedJars) == sumOfSignableEntries && certInfo.isPublisherAlreadyTrusted()) { return true; } } return false; } @Override public boolean hasRootInCacerts(Map certs, Map signedJars) { int sumOfSignableEntries = JarCertVerifier.getTotalJarEntries(signedJars); for (CertInformation certInfo : certs.values()) { Map certSignedJars = certInfo.getSignedJars(); if (JarCertVerifier.getTotalJarEntries(certSignedJars) == sumOfSignableEntries && certInfo.isRootInCacerts()) { return true; } } return false; } @Override public boolean isFullySigned(Map certs, Map signedJars) { int sumOfSignableEntries = JarCertVerifier.getTotalJarEntries(signedJars); for (CertPath cPath : certs.keySet()) { // If this cert has signed everything, return true if (hasCompletelySignedApp(certs.get(cPath), sumOfSignableEntries)) { return true; } } // No cert found that signed all entries. Return false. return false; } @Override public void checkTrustWithUser(SecurityDelegate securityDelegate, JarCertVerifier jcv, JNLPFile file) throws LaunchException { int sumOfSignableEntries = JarCertVerifier.getTotalJarEntries(jcv.getJarSignableEntries()); for (CertPath cPath : jcv.getCertsList()) { jcv.setCurrentlyUsedCertPath(cPath); CertInformation info = jcv.getCertInformation(cPath); if (hasCompletelySignedApp(info, sumOfSignableEntries)) { if (info.isPublisherAlreadyTrusted()) { return; } AccessType dialogType; if (info.isRootInCacerts() && !info.hasSigningIssues()) { dialogType = AccessType.VERIFIED; } else if (info.isRootInCacerts()) { dialogType = AccessType.SIGNING_ERROR; } else { dialogType = AccessType.UNVERIFIED; } AppletAction action = SecurityDialogs.showCertWarningDialog( dialogType, file, jcv, securityDelegate); if (action != AppletAction.CANCEL) { if (action == AppletAction.SANDBOX) { securityDelegate.setRunInSandbox(); } return; } } } throw new LaunchException(null, null, R("LSFatal"), R("LCLaunching"), R("LCancelOnUserRequest"), ""); } /** * Find out if the CertPath with the given info has fully signed the app. * @param info The information regarding the CertPath in question * @param sumOfSignableEntries The total number of signable entries in the app. * @return True if the signer has fully signed this app. */ public boolean hasCompletelySignedApp(CertInformation info, int sumOfSignableEntries) { return JarCertVerifier.getTotalJarEntries(info.getSignedJars()) == sumOfSignableEntries; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/PaxHeaders.17941/HttpsCertVerifier.java0000644000000000000000000000013212654402377026625 xustar0030 mtime=1454507263.212432914 30 atime=1454507327.142580297 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/HttpsCertVerifier.java0000644000175000002070000001771312654402377027361 0ustar00jvanekmock00000000000000/* HttpsCertVerifier.java Copyright (C) 2009 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security; import static net.sourceforge.jnlp.runtime.Translator.R; import java.io.IOException; import java.security.KeyStore; import java.security.cert.CertPath; import java.security.cert.Certificate; import java.security.cert.CertificateException; import java.security.cert.CertificateExpiredException; import java.security.cert.CertificateFactory; import java.security.cert.CertificateNotYetValidException; import java.security.cert.CertificateParsingException; import java.security.cert.X509Certificate; import java.util.ArrayList; import java.util.Collection; import java.util.List; import net.sourceforge.jnlp.util.logging.OutputController; import sun.security.util.DerValue; import sun.security.util.HostnameChecker; import sun.security.x509.X500Name; public class HttpsCertVerifier implements CertVerifier { private X509Certificate[] chain; private String authType; private String hostName; private boolean isTrusted; private boolean hostMatched; private ArrayList details = new ArrayList(); public HttpsCertVerifier(X509Certificate[] chain, String authType, boolean isTrusted, boolean hostMatched, String hostName) { this.chain = chain; this.authType = authType; this.hostName = hostName; this.isTrusted = isTrusted; this.hostMatched = hostMatched; } @Override public boolean getAlreadyTrustPublisher() { return isTrusted; } /* XXX: Most of these methods have a CertPath param that should be passed * from the UI dialogs. However, this is not implemented yet so most of * the params are ignored. */ @Override public CertPath getCertPath(CertPath certPath) { // Parameter ignored. ArrayList list = new ArrayList(); for (int i = 0; i < chain.length; i++) list.add(chain[i]); ArrayList certPaths = new ArrayList(); try { certPaths.add(CertificateFactory.getInstance("X.509").generateCertPath(list)); } catch (CertificateException ce) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, ce); // carry on } return certPaths.get(0); } @Override public List getDetails(CertPath certPath) { // Parameter ignored. boolean hasExpiredCert = false; boolean hasExpiringCert = false; boolean notYetValidCert = false; boolean isUntrusted = false; boolean CNMisMatch = !hostMatched; if (!getAlreadyTrustPublisher()) isUntrusted = true; for (int i = 0; i < chain.length; i++) { X509Certificate cert = chain[i]; long now = System.currentTimeMillis(); long SIX_MONTHS = 180 * 24 * 60 * 60 * 1000L; long notAfter = cert.getNotAfter().getTime(); if (notAfter < now) { hasExpiredCert = true; } else if (notAfter < now + SIX_MONTHS) { hasExpiringCert = true; } try { cert.checkValidity(); } catch (CertificateNotYetValidException cnyve) { notYetValidCert = true; } catch (CertificateExpiredException cee) { hasExpiredCert = true; } } String altNames = getNamesForCert(chain[0]); if (isUntrusted || hasExpiredCert || hasExpiringCert || notYetValidCert || CNMisMatch) { if (isUntrusted) addToDetails(R("SUntrustedCertificate")); if (hasExpiredCert) addToDetails(R("SHasExpiredCert")); if (hasExpiringCert) addToDetails(R("SHasExpiringCert")); if (notYetValidCert) addToDetails(R("SNotYetValidCert")); if (CNMisMatch) addToDetails(R("SCNMisMatch", altNames, this.hostName)); } return details; } private String getNamesForCert(X509Certificate c) { String names = ""; // We use the specification from // http://java.sun.com/j2se/1.5.0/docs/api/java/security/cert/X509Certificate.html#getSubjectAlternativeNames() // to determine the type of address int ALTNAME_DNS = 2; int ALTNAME_IP = 7; try { Collection> subjAltNames = c.getSubjectAlternativeNames(); X500Name subjectName = HostnameChecker.getSubjectX500Name(c); DerValue derValue = subjectName.findMostSpecificAttribute (X500Name.commonName_oid); names += derValue.getAsString(); if (subjAltNames != null) { for (List next : subjAltNames) { if (((Integer) next.get(0)).intValue() == ALTNAME_IP || ((Integer) next.get(0)).intValue() == ALTNAME_DNS) { names += ", " + (String) next.get(1); } } } if (subjAltNames != null) names = names.substring(2); // remove proceeding ", " } catch (CertificateParsingException cpe) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, cpe); } catch (IOException ioe) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, ioe); } return names; } private void addToDetails(String detail) { if (!details.contains(detail)) details.add(detail); } @Override public Certificate getPublisher(CertPath certPath) { // Paramater ignored. if (chain.length > 0) return (Certificate) chain[0]; return null; } @Override public Certificate getRoot(CertPath certPath) { // Parameter ignored. if (chain.length > 0) return (Certificate) chain[chain.length - 1]; return null; } public boolean getRootInCacerts() { try { KeyStore[] caCertsKeyStores = KeyStores.getCAKeyStores(); return CertificateUtils.inKeyStores((X509Certificate) getRoot(null), caCertsKeyStores); } catch (Exception e) { } return false; } @Override public boolean hasSigningIssues(CertPath certPath) { return false; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/PaxHeaders.17941/ConnectionFactory.java0000644000000000000000000000013212654402377026640 xustar0030 mtime=1454507263.212432914 30 atime=1454507327.142580297 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/ConnectionFactory.java0000644000175000002070000001153512654402377027370 0ustar00jvanekmock00000000000000/* Copyright (C) 2014 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security; import java.io.IOException; import java.net.HttpURLConnection; import java.net.URL; import java.net.URLConnection; import java.util.ArrayList; import java.util.List; import javax.net.ssl.HttpsURLConnection; import net.sourceforge.jnlp.util.logging.OutputController; public class ConnectionFactory { private final List httpsConnections = new ArrayList<>(); private boolean isSyncForced() { return false; } public static ConnectionFactory getConnectionFactory() { return ConnectionFactoryHolder.INSTANCE; } private static class ConnectionFactoryHolder { //https://en.wikipedia.org/wiki/Double-checked_locking#Usage_in_Java //https://en.wikipedia.org/wiki/Initialization_on_demand_holder_idiom private static volatile ConnectionFactory INSTANCE = new ConnectionFactory(); } public URLConnection openConnection(URL url) throws IOException { OutputController.getLogger().log("Connecting " + url.toExternalForm()); if (url.getProtocol().equalsIgnoreCase("https")) { if (isSyncForced()) { OutputController.getLogger().log("Waiting for " + httpsConnections.size() + " connections to finish"); while (!httpsConnections.isEmpty()) { try { Thread.sleep(100); } catch (InterruptedException ex) { throw new IOException(ex); } } } return openHttpsConnection(url); } else { URLConnection conn = url.openConnection(); OutputController.getLogger().log("done " + url.toExternalForm()); return conn; } } private synchronized URLConnection openHttpsConnection(URL url) throws IOException { URLConnection conn = null; conn = url.openConnection(); OutputController.getLogger().log("Adding " + conn.toString()); httpsConnections.add(conn); OutputController.getLogger().log("done " + url.toExternalForm()); return conn; } public void disconnect(URLConnection conn) { if (conn != null) { OutputController.getLogger().log("Disconnecting " + conn.toString()); if (conn instanceof HttpsURLConnection) { closeHttpsConnection((HttpsURLConnection) conn); } else { if (conn instanceof HttpURLConnection) { ((HttpURLConnection) conn).disconnect(); } } } else { OutputController.getLogger().log("\"Disconnecting\" null connection. This is ok if you are offline."); } } private synchronized void closeHttpsConnection(HttpsURLConnection conn) { conn.disconnect(); //this s intentional search by object value. equals do not work for (int i = 0; i < httpsConnections.size(); i++) { URLConnection urlConnection = httpsConnections.get(i); if (urlConnection == conn) { httpsConnections.remove(i); OutputController.getLogger().log("Removed " + urlConnection.toString()); i--; } } } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/PaxHeaders.17941/CertificateUtils.java0000644000000000000000000000013212654402377026454 xustar0030 mtime=1454507263.211432928 30 atime=1454507327.142580297 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/CertificateUtils.java0000644000175000002070000002037312654402377027204 0ustar00jvanekmock00000000000000/* CertificateUtils.java Copyright (C) 2010 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.PrintStream; import java.math.BigInteger; import java.security.Key; import java.security.KeyStore; import java.security.KeyStoreException; import java.security.cert.Certificate; import java.security.cert.CertificateException; import java.security.cert.CertificateFactory; import java.security.cert.X509Certificate; import java.util.Enumeration; import java.util.Random; import net.sourceforge.jnlp.runtime.Translator; import net.sourceforge.jnlp.util.logging.OutputController; import net.sourceforge.jnlp.util.replacements.BASE64Encoder; import sun.security.provider.X509Factory; /** * Common utilities to manipulate certificates. Provides methods to add * Certificates to a KeyStores, check if certificates already exist in a * KeyStore and printing certificates. */ public class CertificateUtils { /** * Adds the X509Certficate in the file to the KeyStore. Note that it does * not update the copy of the KeyStore on disk. * @param file file with certificate * @param ks keystore to save to * @throws java.security.cert.CertificateException if certificate is wrong * @throws java.io.IOException if IO fails * @throws java.security.KeyStoreException if keystore fails */ public static final void addToKeyStore(File file, KeyStore ks) throws CertificateException, IOException, KeyStoreException { OutputController.getLogger().log("Importing certificate from " + file + " into " + ks); BufferedInputStream bis = new BufferedInputStream(new FileInputStream(file)); CertificateFactory cf = CertificateFactory.getInstance("X509"); X509Certificate cert = null; try { cert = (X509Certificate) cf.generateCertificate(bis); } catch (ClassCastException cce) { throw new CertificateException("Input file is not an X509 Certificate", cce); } addToKeyStore(cert, ks); } /** * Adds an X509Certificate to the KeyStore. Note that it does not update the * copy of the KeyStore on disk. * @param cert certificate to import * @param ks keystore to save to * @throws java.security.KeyStoreException if keystore fails */ public static final void addToKeyStore(X509Certificate cert, KeyStore ks) throws KeyStoreException { OutputController.getLogger().log("Importing " + cert.getSubjectX500Principal().getName()); // does this certificate already exist? String alias = ks.getCertificateAlias(cert); if (alias != null) { return; } // create a unique alias for this new certificate Random random = new Random(); do { alias = new BigInteger(20, random).toString(); } while (ks.getCertificate(alias) != null); ks.setCertificateEntry(alias, cert); } public static void addPKCS12ToKeyStore(File file, KeyStore ks, char[] password) throws Exception { BufferedInputStream bis = new BufferedInputStream(new FileInputStream(file)); KeyStore keyStore = KeyStore.getInstance("PKCS12"); keyStore.load(bis, password); Enumeration aliasList = keyStore.aliases(); while (aliasList.hasMoreElements()) { String alias = aliasList.nextElement(); Certificate[] certChain = keyStore.getCertificateChain(alias); Key key = keyStore.getKey(alias, password); addPKCS12ToKeyStore(certChain, key, ks); } } public static void addPKCS12ToKeyStore(Certificate[] certChain, Key key, KeyStore ks) throws KeyStoreException { // does this certificate already exist? String alias = ks.getCertificateAlias(certChain[0]); if (alias != null) { return; } // create a unique alias for this new certificate Random random = new Random(); do { alias = new BigInteger(20, random).toString(); } while (ks.getCertificate(alias) != null); SecurityUtil.setKeyEntry(ks, alias, key, certChain); } /** * Checks whether an X509Certificate is already in one of the keystores * @param c the certificate * @param keyStores the KeyStores to check in * @return true if the certificate is present in one of the keystores, false otherwise */ public static final boolean inKeyStores(X509Certificate c, KeyStore[] keyStores) { for (KeyStore keyStore : keyStores) { try { // Check against all certs Enumeration aliases = keyStore.aliases(); while (aliases.hasMoreElements()) { // Verify against this entry String alias = aliases.nextElement(); if (c.equals(keyStore.getCertificate(alias))) { OutputController.getLogger().log(Translator.R("LCertFoundIn", c.getSubjectX500Principal().getName(), KeyStores.getPathToKeystore(keyStore.hashCode()))); return true; } // else continue } }catch (KeyStoreException e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); // continue } } return false; } /** * Writes the certificate in base64 encoded from to the print stream. * See http://tools.ietf.org/html/rfc4945#section-6.1 for more information * @param cert sertifcate to export * @param out stream to print it to * @throws java.io.IOException if io fails * @throws java.security.cert.CertificateException if certificate fails */ public static void dump(Certificate cert, PrintStream out) throws IOException, CertificateException { BASE64Encoder encoder = new BASE64Encoder(); out.println(X509Factory.BEGIN_CERT); encoder.encodeBuffer(cert.getEncoded(), out); out.println(X509Factory.END_CERT); } public static void dumpPKCS12(String alias, File file, KeyStore ks, char[] password) throws Exception { Certificate[] certChain = ks.getCertificateChain(alias); Key key = SecurityUtil.getKey(ks, alias); BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(file)); KeyStore keyStore = KeyStore.getInstance("PKCS12"); keyStore.load(null, null); keyStore.setKeyEntry(alias, key, password, certChain); keyStore.store(bos, password); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/PaxHeaders.17941/CertVerifier.java0000644000000000000000000000013212654402377025602 xustar0030 mtime=1454507263.211432928 30 atime=1454507327.142580297 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/CertVerifier.java0000644000175000002070000000613012654402377026325 0ustar00jvanekmock00000000000000/* CertVerifier.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security; import java.security.cert.CertPath; import java.security.cert.Certificate; import java.util.List; /** * An interface that provides various details about certificates of an app. */ public interface CertVerifier { /** * @return if the publisher is already trusted */ public boolean getAlreadyTrustPublisher(); /** * @return if the root is in CA certs */ public boolean getRootInCacerts(); /** * @return if there are signing issues with the certificate being verified * @param certPath to be validated */ public boolean hasSigningIssues(CertPath certPath); /** * @return the details regarding issue with this certificate * @param certPath certificate */ public List getDetails(CertPath certPath); /** * @return a valid certificate path to this certificate being verified * @param certPath to be read */ public CertPath getCertPath(CertPath certPath); /** * @return the application's publisher's certificate. * @param certPath to be read for publisher */ public abstract Certificate getPublisher(CertPath certPath); /** * @return the application's root's certificate. This * may return the same certificate as getPublisher(CertPath certPath) in * the event that the application is self signed. * @param certPath certificate * */ public abstract Certificate getRoot(CertPath certPath); } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/PaxHeaders.17941/AppVerifier.java0000644000000000000000000000013212654402377025425 xustar0030 mtime=1454507263.211432928 30 atime=1454507327.142580297 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/security/AppVerifier.java0000644000175000002070000000762712654402377026164 0ustar00jvanekmock00000000000000/* AppVerifier.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security; import java.security.cert.CertPath; import java.util.Map; import net.sourceforge.jnlp.JNLPFile; import net.sourceforge.jnlp.LaunchException; import net.sourceforge.jnlp.runtime.JNLPClassLoader.SecurityDelegate; import net.sourceforge.jnlp.tools.CertInformation; import net.sourceforge.jnlp.tools.JarCertVerifier; /** * An interface that provides various details about an app's signers. */ public interface AppVerifier { /** * Checks if the app has already found trust in its publisher(s). * @param certs The certs to search through and their cert information * @param signedJars A map of all the jars of this app and the number of * signed entries each one has. * @return True if the app trusts its publishers. */ public boolean hasAlreadyTrustedPublisher( Map certs, Map signedJars); /** * Checks if the app has signer(s) whose certs along their chains are in CA certs. * @param certs The certs to search through and their cert information * @param signedJars A map of all the jars of this app and the number of * signed entries each one has. * @return True if the app has a root in the CA certs store. */ public boolean hasRootInCacerts(Map certs, Map signedJars); /** * Checks if the app's jars are covered by the provided certificates, enough * to consider the app fully signed. * @param certs Any possible signer and their respective information regarding this app. * @param signedJars A map of all the jars of this app and the number of * signed entries each one has. * @return true if jar is fully signed */ public boolean isFullySigned(Map certs, Map signedJars); /** * Prompt the user with requests for trusting the certificates used by this app * @param securityDelegate parental security * @param jcv jar verifier * @param file jnlp fiel to provide information * @throws LaunchException if it fails to verify */ public void checkTrustWithUser(SecurityDelegate securityDelegate, JarCertVerifier jcv, JNLPFile file) throws LaunchException; } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/runtime0000644000000000000000000000013212654402377022105 xustar0030 mtime=1454507263.299431754 30 atime=1454507658.780157344 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/runtime/0000755000175000002070000000000012654402377022705 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/netx/net/sourceforge/jnlp/runtime/PaxHeaders.17941/LocateJnlpClassLoader.java0000644000000000000000000000013212654402377027175 xustar0030 mtime=1454507263.299431754 30 atime=1454507327.140580323 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/runtime/LocateJnlpClassLoader.java0000644000175000002070000001051712654402377027724 0ustar00jvanekmock00000000000000/* LocateJNLPClassLoader.java Copyright (C) 2012, Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.runtime; import java.net.URL; import net.sourceforge.jnlp.JARDesc; import net.sourceforge.jnlp.JNLPFile; import net.sourceforge.jnlp.ResourcesDesc; import net.sourceforge.jnlp.Version; class LocateJnlpClassLoader { /** * Locates the JNLPClassLoader of the JNLP file. * @param rootClassLoader Root JNLPClassLoader of the application. * @param urlToJnlpFile Path of the JNLP file. If {@code null}, main JNLP file's location * be used instead * @return the JNLPClassLoader of the JNLP file. */ static JNLPClassLoader getLoaderByJnlpFile(final JNLPClassLoader rootClassLoader, URL urlToJnlpFile) { if (rootClassLoader == null) return null; JNLPFile file = rootClassLoader.getJNLPFile(); if (urlToJnlpFile == null) urlToJnlpFile = rootClassLoader.getJNLPFile().getFileLocation(); if (file.getFileLocation().equals(urlToJnlpFile)) return rootClassLoader; for (JNLPClassLoader loader : rootClassLoader.getLoaders()) { if (rootClassLoader != loader) { JNLPClassLoader foundLoader = LocateJnlpClassLoader.getLoaderByJnlpFile(loader, urlToJnlpFile); if (foundLoader != null) return foundLoader; } } return null; } /** * Locates the JNLPClassLoader of the JNLP file's resource. * @param rootClassLoader Root JNLPClassLoader of the application. * @param ref Path of the launch or extension JNLP File. If {@code null}, * main JNLP file's location will be used instead. * @param version The version of resource. Is null if no version is specified * @return the JNLPClassLoader of the JNLP file's resource. */ static JNLPClassLoader getLoaderByResourceUrl(final JNLPClassLoader rootClassLoader, final URL ref, final String version) { Version resourceVersion = (version == null) ? null : new Version(version); for (JNLPClassLoader loader : rootClassLoader.getLoaders()) { ResourcesDesc resources = loader.getJNLPFile().getResources(); for (JARDesc eachJar : resources.getJARs()) { if (ref.equals(eachJar.getLocation()) && (resourceVersion == null || resourceVersion.equals(eachJar.getVersion()))) return loader; } } for (JNLPClassLoader loader : rootClassLoader.getLoaders()) { if (rootClassLoader != loader) { JNLPClassLoader foundLoader = LocateJnlpClassLoader.getLoaderByResourceUrl(loader, ref, version); if (foundLoader != null) return foundLoader; } } return null; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/runtime/PaxHeaders.17941/JnlpBoot.java0000644000000000000000000000013212654402377024554 xustar0030 mtime=1454507263.299431754 30 atime=1454507327.140580323 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/runtime/JnlpBoot.java0000644000175000002070000000565312654402377025310 0ustar00jvanekmock00000000000000/* 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 */ package net.sourceforge.jnlp.runtime; import java.util.List; import java.util.Map; import net.sourceforge.jnlp.LaunchException; import net.sourceforge.jnlp.Launcher; import net.sourceforge.jnlp.ParserSettings; import static net.sourceforge.jnlp.runtime.Boot.init; import static net.sourceforge.jnlp.runtime.Translator.R; import net.sourceforge.jnlp.util.logging.OutputController; import net.sourceforge.jnlp.util.optionparser.OptionParser; public final class JnlpBoot { private final OptionParser optionParser; public JnlpBoot(OptionParser optionParser) { this.optionParser = optionParser; } boolean run(Map> extra) { ParserSettings settings = init(extra); if (settings == null) { return false; } try { OutputController.getLogger().log("Proceeding with jnlp"); Launcher launcher = new Launcher(false); launcher.setParserSettings(settings); launcher.setInformationToMerge(extra); launcher.launch(Boot.getFileLocation()); } catch (LaunchException ex) { // default handler prints this } catch (Exception ex) { OutputController.getLogger().log(ex); Boot.fatalError(R("RUnexpected", ex.toString(), ex.getStackTrace()[0])); } return true; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/runtime/PaxHeaders.17941/JNLPSecurityManager.java0000644000000000000000000000013212654402377026613 xustar0030 mtime=1454507263.299431754 30 atime=1454507327.140580323 30 ctime=1454507658.737157917 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java0000644000175000002070000004161412654402377027344 0ustar00jvanekmock00000000000000// Copyright (C) 2001-2003 Jon A. Maxwell (JAM) // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp.runtime; import static net.sourceforge.jnlp.runtime.Translator.R; import java.awt.Window; import java.net.SocketPermission; import java.security.AccessControlException; import java.security.Permission; import javax.swing.JWindow; import net.sourceforge.jnlp.security.SecurityDialogs.AccessType; import net.sourceforge.jnlp.services.ServiceUtil; import net.sourceforge.jnlp.util.logging.OutputController; import net.sourceforge.jnlp.util.WeakList; import sun.awt.AWTSecurityManager; import sun.awt.AppContext; /** * Security manager for JNLP environment. This security manager * cannot be replaced as it always denies attempts to replace the * security manager or policy. *

    * The JNLP security manager tracks windows created by an * application, allowing those windows to be disposed when the * application exits but the JVM does not. If security is not * enabled then the first application to call System.exit will * halt the JVM. *

    * * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.17 $ */ class JNLPSecurityManager extends AWTSecurityManager { // todo: some apps like JDiskReport can close the VM even when // an exit class is set - fix! // todo: create an event dispatch thread for each application, // so that the context classloader doesn't have to be switched // to the foreground application (the currently the approach // since some apps need their classloader as event dispatch // thread's context classloader). // todo: use a custom Permission object to identify the current // application in an AccessControlContext by setting a side // effect in its implies method. Use a custom // AllPermissions-like permission to do this for apps granted // all permissions (but investigate whether this will nuke // the all-permission optimizations in the JRE). // todo: does not exit app if close button pressed on JFrame // with CLOSE_ON_EXIT (or whatever) set; if doesn't exit, use an // WindowListener to catch WindowClosing event, then if exit is // called immediately afterwards from AWT thread. // todo: deny all permissions to applications that should have // already been 'shut down' by closing their resources and // interrupt the threads if operating in a shared-VM (exit class // set). Deny will probably will slow checks down a lot though. // todo: weak remember last getProperty application and // re-install properties if another application calls, or find // another way for different apps to have different properties // in java.lang.Sytem with the same names. /** only class that can exit the JVM, if set */ private Object exitClass = null; /** this exception prevents exiting the JVM */ private SecurityException closeAppEx = // making here prevents huge stack traces new SecurityException(R("RShutdown")); /** weak list of windows created */ private WeakList weakWindows = new WeakList(); /** weak list of applications corresponding to window list */ private WeakList weakApplications = new WeakList(); /** Sets whether or not exit is allowed (in the context of the plugin, this is always false) */ private boolean exitAllowed = true; /** * The AppContext of the main application (netx). We need to store this here * so we can return this when no code from an external application is * running on the thread */ private AppContext mainAppContext; /** * Creates a JNLP SecurityManager. */ JNLPSecurityManager() { // this has the side-effect of creating the Swing shared Frame // owner. Since no application is running at this time, it is // not added to any window list when checkTopLevelWindow is // called for it (and not disposed). if (!JNLPRuntime.isHeadless()) { new JWindow().getOwner(); } mainAppContext = AppContext.getAppContext(); } /** * Returns whether the exit class is present on the stack, or * true if no exit class is set. */ public boolean isExitClass() { return isExitClass(getClassContext()); } /** * Returns whether the exit class is present on the stack, or * true if no exit class is set. */ private boolean isExitClass(Class stack[]) { if (exitClass == null) { return true; } for (int i = 0; i < stack.length; i++) { if (stack[i] == exitClass) { return true; } } return false; } /** * Set the exit class, which is the only class that can exit the * JVM; if not set then any class can exit the JVM. * * @param exitClass the exit class * @throws IllegalStateException if the exit class is already set */ public void setExitClass(Class exitClass) throws IllegalStateException { if (this.exitClass != null) { throw new IllegalStateException(R("RExitTaken")); } this.exitClass = exitClass; } /** * Return the current Application, or null if none can be * determined. */ protected ApplicationInstance getApplication() { return getApplication(Thread.currentThread(), getClassContext(), 0); } /** * Return the application the opened the specified window (only * call from event dispatch thread). */ protected ApplicationInstance getApplication(Window window) { for (int i = weakWindows.size(); i-- > 0;) { Window w = weakWindows.get(i); if (w == null) { weakWindows.remove(i); weakApplications.remove(i); } if (w == window) { return weakApplications.get(i); } } return null; } /** * Return the current Application, or null. */ protected ApplicationInstance getApplication(Thread thread, Class stack[], int maxDepth) { ClassLoader cl; JNLPClassLoader jnlpCl; cl = thread.getContextClassLoader(); while (cl != null) { jnlpCl = getJnlpClassLoader(cl); if (jnlpCl != null && jnlpCl.getApplication() != null) { return jnlpCl.getApplication(); } cl = cl.getParent(); } if (maxDepth <= 0) { maxDepth = stack.length; } // this needs to be tightened up for (int i = 0; i < stack.length && i < maxDepth; i++) { cl = stack[i].getClassLoader(); while (cl != null) { jnlpCl = getJnlpClassLoader(cl); if (jnlpCl != null && jnlpCl.getApplication() != null) { return jnlpCl.getApplication(); } cl = cl.getParent(); } } return null; } /** * Returns the JNLPClassLoader associated with the given ClassLoader, or * null. * @param cl a ClassLoader * @return JNLPClassLoader or null */ private JNLPClassLoader getJnlpClassLoader(ClassLoader cl) { // Since we want to deal with JNLPClassLoader, extract it if this // is a codebase loader if (cl instanceof JNLPClassLoader.CodeBaseClassLoader) { cl = ((JNLPClassLoader.CodeBaseClassLoader) cl).getParentJNLPClassLoader(); } if (cl instanceof JNLPClassLoader) { JNLPClassLoader loader = (JNLPClassLoader) cl; return loader; } return null; } /** * Returns the application's thread group if the application can * be determined; otherwise returns super.getThreadGroup() */ @Override public ThreadGroup getThreadGroup() { ApplicationInstance app = getApplication(); if (app == null) { return super.getThreadGroup(); } return app.getThreadGroup(); } /** * Throws a SecurityException if the permission is denied, * otherwise return normally. This method always denies * permission to change the security manager or policy. */ @Override public void checkPermission(Permission perm) { String name = perm.getName(); // Enable this manually -- it'll produce too much output for -verbose // otherwise. // if (true) // OutputController.getLogger().log("Checking permission: " + perm.toString()); if (!JNLPRuntime.isWebstartApplication() && ("setPolicy".equals(name) || "setSecurityManager".equals(name))) { throw new SecurityException(R("RCantReplaceSM")); } try { // deny all permissions to stopped applications // The call to getApplication() below might not work if an // application hasn't been fully initialized yet. // if (JNLPRuntime.isDebug()) { // if (!"getClassLoader".equals(name)) { // ApplicationInstance app = getApplication(); // if (app != null && !app.isRunning()) // throw new SecurityException(R("RDenyStopped")); // } // } super.checkPermission(perm); } catch (SecurityException ex) { OutputController.getLogger().log("Denying permission: " + perm); throw ex; } } /** * Asks the user whether or not to grant permission. * @param perm the permission to be granted * @return true if the permission was granted, false otherwise. */ private boolean askPermission(Permission perm) { ApplicationInstance app = getApplication(); if (app != null && !app.isSigned()) { if (perm instanceof SocketPermission && ServiceUtil.checkAccess(AccessType.NETWORK, perm.getName())) { return true; } } return false; } /** * Adds a permission to the JNLPClassLoader. * @param perm the permission to add to the JNLPClassLoader */ private void addPermission(Permission perm) { if (JNLPRuntime.getApplication().getClassLoader() instanceof JNLPClassLoader) { JNLPClassLoader cl = (JNLPClassLoader) JNLPRuntime.getApplication().getClassLoader(); cl.addPermission(perm); if (JNLPRuntime.isDebug()) { if (cl.getSecurity() == null) { if (cl.getPermissions(null).implies(perm)){ OutputController.getLogger().log(OutputController.Level.ERROR_ALL, "Added permission: " + perm.toString()); } else { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, "Unable to add permission: " + perm.toString()); } } else { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, "Cannot get permissions for null codesource when classloader security is not null"); } } } else { OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "Unable to add permission: " + perm + ", classloader not JNLP."); } } /** * Checks whether the window can be displayed without an applet * warning banner, and adds the window to the list of windows to * be disposed when the calling application exits. */ @Override public boolean checkTopLevelWindow(Object window) { ApplicationInstance app = getApplication(); // remember window -> application mapping for focus, close on exit if (app != null && window instanceof Window) { Window w = (Window) window; OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "SM: app: " + app.getTitle() + " is adding a window: " + window + " with appContext " + AppContext.getAppContext()); weakWindows.add(w); // for mapping window -> app weakApplications.add(app); app.addWindow(w); } // todo: set awt.appletWarning to custom message // todo: logo on with glass pane on JFrame/JWindow? return super.checkTopLevelWindow(window); } /** * Checks whether the caller can exit the system. This method * identifies whether the caller is a real call to Runtime.exec * and has special behavior when returning from this method * would exit the JVM and an exit class is set: if the caller is * not the exit class then the calling application will be * stopped and its resources destroyed (when possible), and an * exception will be thrown to prevent the JVM from shutting * down. *

    * Calls not from Runtime.exit or with no exit class set will * behave normally, and the exit class can always exit the JVM. *

    */ @Override public void checkExit(int status) { // applets are not allowed to exit, but the plugin main class (primordial loader) is Class stack[] = getClassContext(); if (!exitAllowed) { for (int i = 0; i < stack.length; i++) { if (stack[i].getClassLoader() != null) { throw new AccessControlException("Applets may not call System.exit()"); } } } super.checkExit(status); boolean realCall = (stack[1] == Runtime.class); if (isExitClass(stack)) { return; } // to Runtime.exit or fake call to see if app has permission // not called from Runtime.exit() if (!realCall) { // apps that can't exit should think they can exit normally super.checkExit(status); return; } // but when they really call, stop only the app instead of the JVM ApplicationInstance app = getApplication(Thread.currentThread(), stack, 0); if (app == null) { throw new SecurityException(R("RExitNoApp")); } app.destroy(); throw closeAppEx; } protected void disableExit() { exitAllowed = false; } /** * This returns the appropriate {@link AppContext}. Hooks in AppContext * check if the current {@link SecurityManager} is an instance of * AWTSecurityManager and if so, call this method to give it a chance to * return the appropriate appContext based on the application that is * running. *

    * This can be called from any thread (possibly a swing thread) to find out * the AppContext for the thread (which may correspond to a particular * applet). *

    */ @Override public AppContext getAppContext() { ApplicationInstance app = getApplication(); if (app == null) { /* * if we cannot find an application based on the code on the stack, * then assume it is the main application */ return mainAppContext; } else { return app.getAppContext(); } } /** * Tests if a client can get access to the AWT event queue. This version allows * complete access to the EventQueue for its own AppContext-specific EventQueue. * * FIXME there are probably huge security implications for this. Eg: * http://hg.openjdk.java.net/jdk7/awt/jdk/rev/8022709a306d * * @exception SecurityException if the caller does not have * permission to accesss the AWT event queue. */ @Override public void checkAwtEventQueueAccess() { /* * this is the templace of the code that should allow applets access to * eventqueues */ // AppContext appContext = AppContext.getAppContext(); // ApplicationInstance instance = getApplication(); // if ((appContext == mainAppContext) && (instance != null)) { // If we're about to allow access to the main EventQueue, // and anything untrusted is on the class context stack, // disallow access. super.checkAwtEventQueueAccess(); // } } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/runtime/PaxHeaders.17941/JNLPRuntime.java0000644000000000000000000000013112654402377025133 xustar0030 mtime=1454507263.298431767 30 atime=1454507327.140580323 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java0000644000175000002070000007723512654402377025675 0ustar00jvanekmock00000000000000// Copyright (C) 2001-2003 Jon A. Maxwell (JAM) // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp.runtime; import static net.sourceforge.jnlp.runtime.Translator.R; import java.awt.EventQueue; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.net.Authenticator; import java.net.InetAddress; import java.net.ProxySelector; import java.net.URL; import java.net.UnknownHostException; import java.nio.channels.FileChannel; import java.nio.channels.FileLock; import java.security.AllPermission; import java.security.KeyStore; import java.security.Policy; import java.security.Security; import java.text.DateFormat; import java.util.Date; import java.util.List; import javax.jnlp.ServiceManager; import javax.naming.ConfigurationException; import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.KeyManagerFactory; import javax.net.ssl.SSLContext; import javax.net.ssl.SSLSocketFactory; import javax.net.ssl.TrustManager; import javax.swing.JOptionPane; import javax.swing.UIManager; import javax.swing.text.html.parser.ParserDelegator; import net.sourceforge.jnlp.DefaultLaunchHandler; import net.sourceforge.jnlp.GuiLaunchHandler; import net.sourceforge.jnlp.LaunchHandler; import net.sourceforge.jnlp.Launcher; import net.sourceforge.jnlp.browser.BrowserAwareProxySelector; import net.sourceforge.jnlp.cache.CacheUtil; import net.sourceforge.jnlp.cache.DefaultDownloadIndicator; import net.sourceforge.jnlp.cache.DownloadIndicator; import net.sourceforge.jnlp.cache.UpdatePolicy; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.config.PathsAndFiles; import net.sourceforge.jnlp.security.JNLPAuthenticator; import net.sourceforge.jnlp.security.KeyStores; import net.sourceforge.jnlp.security.SecurityDialogMessageHandler; import net.sourceforge.jnlp.security.SecurityUtil; import net.sourceforge.jnlp.services.XServiceManagerStub; import net.sourceforge.jnlp.util.BasicExceptionDialog; import net.sourceforge.jnlp.util.FileUtils; import net.sourceforge.jnlp.util.logging.JavaConsole; import net.sourceforge.jnlp.util.logging.LogConfig; import net.sourceforge.jnlp.util.logging.OutputController; import sun.net.www.protocol.jar.URLJarFile; /** *

    * Configure and access the runtime environment. This class * stores global jnlp properties such as default download * indicators, the install/base directory, the default resource * update policy, etc. Some settings, such as the base directory, * cannot be changed once the runtime has been initialized. *

    *

    * The JNLP runtime can be locked to prevent further changes to * the runtime environment except by a specified class. If set, * only instances of the exit class can exit the JVM or * change the JNLP runtime settings once the runtime has been * initialized. *

    * * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.19 $ */ public class JNLPRuntime { /** * java-abrt-connector can print out specific application String method, it is good to save visited urls for reproduce purposes. * For javaws we can read the destination jnlp from commandline * However for plugin (url arrive via pipes). Also for plugin we can not be sure which opened tab/window * have caused the crash. Thats why the individual urls are added, not replaced. */ private static String history = ""; /** the security manager */ private static JNLPSecurityManager security; /** the security policy */ private static JNLPPolicy policy; /** handles all security message to show appropriate security dialogs */ private static SecurityDialogMessageHandler securityDialogMessageHandler; /** a default launch handler */ private static LaunchHandler handler = null; /** default download indicator */ private static DownloadIndicator indicator = null; /** update policy that controls when to check for updates */ private static UpdatePolicy updatePolicy = UpdatePolicy.ALWAYS; /** whether initialized */ private static boolean initialized = false; /** whether netx is in command-line mode (headless) */ private static boolean headless = false; /** whether we'll be checking for jar signing */ private static boolean verify = true; /** whether the runtime uses security */ private static boolean securityEnabled = true; /** whether debug mode is on */ private static boolean debug = false; /** * whether plugin debug mode is on */ private static Boolean pluginDebug = null; /** mutex to wait on, for initialization */ public static Object initMutex = new Object(); /** set to true if this is a webstart application. */ private static boolean isWebstartApplication; /** set to false to indicate another JVM should not be spawned, even if necessary */ private static boolean forksAllowed = true; /** all security dialogs will be consumed and pretented as being verified by user and allowed.*/ private static boolean trustAll=false; /** flag keeping rest of jnlpruntime live that javaws was lunched as -html */ private static boolean html=false; /** all security dialogs will be consumed and we will pretend the Sandbox option was chosen */ private static boolean trustNone = false; /** allows 301.302.303.307.308 redirects to be followed when downloading resources*/ private static boolean allowRedirect = false;; /** when this is true, ITW will not attempt any inet connections and will work only with what is in cache*/ private static boolean offlineForced = false; private static Boolean onlineDetected = null; /** * Header is not checked and so eg * gifar exploit is * possible.
    * However if jar file is a bit corrupted, then it sometimes can work so * this switch can disable the header check. * @see Gifar attack */ private static boolean ignoreHeaders=false; /** contains the arguments passed to the jnlp runtime */ private static List initialArguments; /** a lock which is held to indicate that an instance of netx is running */ private static FileLock fileLock; /** * Returns whether the JNLP runtime environment has been * initialized. Once initialized, some properties such as the * base directory cannot be changed. Before * @return whether this runtime was already initialilsed */ public static boolean isInitialized() { return initialized; } /** * Initialize the JNLP runtime environment by installing the * security manager and security policy, initializing the JNLP * standard services, etc. *

    * This method should be called from the main AppContext/Thread. *

    *

    * This method cannot be called more than once. Once * initialized, methods that alter the runtime can only be * called by the exit class. *

    * * @param isApplication is {@code true} if a webstart application is being * initialized * @throws IllegalStateException if the runtime was previously initialized */ public static void initialize(boolean isApplication) throws IllegalStateException { checkInitialized(); try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Exception e) { OutputController.getLogger().log("Unable to set system look and feel"); } if (JavaConsole.canShowOnStartup(isApplication)) { JavaConsole.getConsole().showConsoleLater(); } /* exit if there is a fatal exception loading the configuration */ if (getConfiguration().getLoadingException() != null) { if (getConfiguration().getLoadingException() instanceof ConfigurationException){ // ConfigurationException is thrown only if deployment.config's field // deployment.system.config.mandatory is true, and the destination //where deployment.system.config points is not readable throw new RuntimeException(getConfiguration().getLoadingException()); } OutputController.getLogger().log(OutputController.Level.WARNING_ALL, R("RConfigurationError")+": "+getConfiguration().getLoadingException().getMessage()); } isWebstartApplication = isApplication; //Setting the system property for javawebstart's version. //The version stored will be the same as java's version. System.setProperty("javawebstart.version", "javaws-" + System.getProperty("java.version")); if (headless == false) checkHeadless(); if (!headless && indicator == null) indicator = new DefaultDownloadIndicator(); if (handler == null) { if (headless) { handler = new DefaultLaunchHandler(OutputController.getLogger()); } else { handler = new GuiLaunchHandler(OutputController.getLogger()); } } ServiceManager.setServiceManagerStub(new XServiceManagerStub()); // ignored if we're running under Web Start policy = new JNLPPolicy(); security = new JNLPSecurityManager(); // side effect: create JWindow doMainAppContextHacks(); if (securityEnabled) { Policy.setPolicy(policy); // do first b/c our SM blocks setPolicy System.setSecurityManager(security); } securityDialogMessageHandler = startSecurityThreads(); // wire in custom authenticator for SSL connections try { SSLSocketFactory sslSocketFactory; SSLContext context = SSLContext.getInstance("SSL"); KeyStore ks = KeyStores.getKeyStore(KeyStores.Level.USER, KeyStores.Type.CLIENT_CERTS); KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509"); SecurityUtil.initKeyManagerFactory(kmf, ks); TrustManager[] trust = new TrustManager[] { getSSLSocketTrustManager() }; context.init(kmf.getKeyManagers(), trust, null); sslSocketFactory = context.getSocketFactory(); HttpsURLConnection.setDefaultSSLSocketFactory(sslSocketFactory); } catch (Exception e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, "Unable to set SSLSocketfactory (may _prevent_ access to sites that should be trusted)! Continuing anyway..."); OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); } // plug in a custom authenticator and proxy selector Authenticator.setDefault(new JNLPAuthenticator()); BrowserAwareProxySelector proxySelector = new BrowserAwareProxySelector(getConfiguration()); proxySelector.initialize(); ProxySelector.setDefault(proxySelector); // Restrict access to netx classes Security.setProperty("package.access", Security.getProperty("package.access")+",net.sourceforge.jnlp"); URLJarFile.setCallBack(CachedJarFileCallback.getInstance()); initialized = true; } public static void reloadPolicy() { policy.refresh(); } /** * Returns a TrustManager ideal for the running VM. * * @return TrustManager the trust manager to use for verifying https certificates */ private static TrustManager getSSLSocketTrustManager() throws ClassNotFoundException, IllegalAccessException, InstantiationException, InvocationTargetException { try { Class trustManagerClass; Constructor tmCtor; if (System.getProperty("java.version").startsWith("1.6")) { // Java 6 try { trustManagerClass = Class.forName("net.sourceforge.jnlp.security.VariableX509TrustManagerJDK6"); } catch (ClassNotFoundException cnfe) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, "Unable to find class net.sourceforge.jnlp.security.VariableX509TrustManagerJDK6"); return null; } } else { // Java 7 or more (technically could be <= 1.5 but <= 1.5 is unsupported) try { trustManagerClass = Class.forName("net.sourceforge.jnlp.security.VariableX509TrustManagerJDK7"); } catch (ClassNotFoundException cnfe) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, "Unable to find class net.sourceforge.jnlp.security.VariableX509TrustManagerJDK7"); return null; } } Constructor[] tmCtors = trustManagerClass.getDeclaredConstructors(); tmCtor = tmCtors[0]; for (Constructor ctor : tmCtors) { if (tmCtor.getGenericParameterTypes().length == 0) { tmCtor = ctor; break; } } return (TrustManager) tmCtor.newInstance(); } catch (RuntimeException e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, "Unable to load JDK-specific TrustManager. Was this version of IcedTea-Web compiled with JDK 6 or 7?"); OutputController.getLogger().log(e); throw e; } } /** * This must NOT be called form the application ThreadGroup. An application * can inject events into its {@link EventQueue} and bypass the security * dialogs. * * @return a {@link SecurityDialogMessageHandler} that can be used to post * security messages */ private static SecurityDialogMessageHandler startSecurityThreads() { ThreadGroup securityThreadGroup = new ThreadGroup("NetxSecurityThreadGroup"); SecurityDialogMessageHandler runner = new SecurityDialogMessageHandler(); Thread securityThread = new Thread(securityThreadGroup, runner, "NetxSecurityThread"); securityThread.setDaemon(true); securityThread.start(); return runner; } /** * Performs a few hacks that are needed for the main AppContext * * @see Launcher#doPerApplicationAppContextHacks */ private static void doMainAppContextHacks() { /* * With OpenJDK6 (but not with 7) a per-AppContext dtd is maintained. * This dtd is created by the ParserDelgate. However, the code in * HTMLEditorKit (used to render HTML in labels and textpanes) creates * the ParserDelegate only if there are no existing ParserDelegates. The * result is that all other AppContexts see a null dtd. */ new ParserDelegator(); } public static void setOfflineForced(boolean b) { offlineForced = b; OutputController.getLogger().log(OutputController.Level.MESSAGE_DEBUG, "Forcing of offline set to: " + offlineForced); } public static boolean isOfflineForced() { return offlineForced; } public static void setOnlineDetected(boolean online) { onlineDetected = online; OutputController.getLogger().log(OutputController.Level.MESSAGE_DEBUG, "Detected online set to: " + onlineDetected); } public static boolean isOnlineDetected() { if (onlineDetected == null) { //"file" protocol do not do online check //sugest online for this case return true; } return onlineDetected; } public static boolean isOnline() { if (isOfflineForced()) { return false; } return isOnlineDetected(); } public static void detectOnline(URL location) { if (onlineDetected != null) { return; } JNLPRuntime.setOnlineDetected(isConnectable(location)); } public static boolean isConnectable(URL location) { if (location.getProtocol().equals("file")) { return true; } try { InetAddress.getByName(location.getHost()); } catch (UnknownHostException e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, "The host of " + location.toExternalForm() + " file seems down, or you are simply offline."); return false; } return true; } /** * see Double-checked locking in Java * for cases how not to do lazy initialization * and Initialization on demand holder idiom * for ITW approach */ private static class DeploymentConfigurationHolder { private static final DeploymentConfiguration INSTANCE = initConfiguration(); private static DeploymentConfiguration initConfiguration() { DeploymentConfiguration config = new DeploymentConfiguration(); try { config.load(); config.copyTo(System.getProperties()); } catch (ConfigurationException ex) { OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, R("RConfigurationError")); //mark this exceptionas we can die on it later config.setLoadingException(ex); //to be sure - we MUST die - http://docs.oracle.com/javase/6/docs/technotes/guides/deployment/deployment-guide/properties.html }catch(Exception t){ //all exceptions are causing InstantiatizationError so this do it much more readble OutputController.getLogger().log(OutputController.Level.ERROR_ALL, t); OutputController.getLogger().log(OutputController.Level.WARNING_ALL, R("RFailingToDefault")); if (!JNLPRuntime.isHeadless()){ JOptionPane.showMessageDialog(null, R("RFailingToDefault")+"\n"+t.toString()); } //try to survive this unlikely exception config.resetToDefaults(); } finally { OutputController.getLogger().startConsumer(); } return config; } } /** * Gets the Configuration associated with this runtime * * @return a {@link DeploymentConfiguration} object that can be queried to * find relevant configuration settings */ public static DeploymentConfiguration getConfiguration() { return DeploymentConfigurationHolder.INSTANCE; } /** * @return true if a webstart application has been initialized, and false * for a plugin applet. */ public static boolean isWebstartApplication() { return isWebstartApplication; } /** * @return whether the JNLP client will use any AWT/Swing * components. */ public static boolean isHeadless() { return headless; } /** * @return whether we are verifying code signing. */ public static boolean isVerifying() { return verify; } /** * Sets whether the JNLP client will use any AWT/Swing * components. In headless mode, client features that use the * AWT are disabled such that the client can be used in * headless mode ({@code java.awt.headless=true}). * * @param enabled true if application do not wont/need gui or X at all * @throws IllegalStateException if the runtime was previously initialized */ public static void setHeadless(boolean enabled) { checkInitialized(); headless = enabled; } public static void setAllowRedirect(boolean enabled) { checkInitialized(); allowRedirect = enabled; } public static boolean isAllowRedirect() { return allowRedirect; } /** * Sets whether we will verify code signing. * * @param enabled true if app should verify signatures * @throws IllegalStateException if the runtime was previously initialized */ public static void setVerify(boolean enabled) { checkInitialized(); verify = enabled; } /** * Returns whether the secure runtime environment is enabled. * @return true if security manager is created */ public static boolean isSecurityEnabled() { return securityEnabled; } /** * Sets whether to enable the secure runtime environment. * Disabling security can increase performance for some * applications, and can be used to use netx with other code * that uses its own security manager or policy. *

    * Disabling security is not recommended and should only be * used if the JNLP files opened are trusted. This method can * only be called before initalizing the runtime. *

    * * @param enabled whether security should be enabled * @throws IllegalStateException if the runtime is already initialized */ public static void setSecurityEnabled(boolean enabled) { checkInitialized(); securityEnabled = enabled; } /** * * @return the {@link SecurityDialogMessageHandler} that should be used to * post security dialog messages */ public static SecurityDialogMessageHandler getSecurityDialogHandler() { SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(new AllPermission()); } return securityDialogMessageHandler; } /** * Set a class that can exit the JVM; if not set then any class * can exit the JVM. * * @param exitClass a class that can exit the JVM * @throws IllegalStateException if caller is not the exit class */ public static void setExitClass(Class exitClass) { checkExitClass(); security.setExitClass(exitClass); } /** * Disables applets from calling exit. * * Once disabled, exit cannot be re-enabled for the duration of the JVM instance */ public static void disableExit() { security.disableExit(); } /** * @return the current Application, or null if none can be * determined. */ public static ApplicationInstance getApplication() { return security.getApplication(); } /** * @return whether debug statements for the JNLP client code * should be printed. */ public static boolean isDebug() { return isSetDebug() || isPluginDebug() || LogConfig.getLogConfig().isEnableLogging(); } public static boolean isSetDebug() { return debug; } /** * Sets whether debug statements for the JNLP client code * should be printed to the standard output. * * @param enabled set to true if you need full debug output * @throws IllegalStateException if caller is not the exit class */ public static void setDebug(boolean enabled) { checkExitClass(); debug = enabled; } /** * Sets the default update policy. * * @param policy global update policy of environment * @throws IllegalStateException if caller is not the exit class */ public static void setDefaultUpdatePolicy(UpdatePolicy policy) { checkExitClass(); updatePolicy = policy; } /** * @return the default update policy. */ public static UpdatePolicy getDefaultUpdatePolicy() { return updatePolicy; } /** * Sets the default launch handler. * @param handler default handler */ public static void setDefaultLaunchHandler(LaunchHandler handler) { checkExitClass(); JNLPRuntime.handler = handler; } /** * Returns the default launch handler. * @return default handler */ public static LaunchHandler getDefaultLaunchHandler() { return handler; } /** * Sets the default download indicator. * * @param indicator where to show progress * @throws IllegalStateException if caller is not the exit class */ public static void setDefaultDownloadIndicator(DownloadIndicator indicator) { checkExitClass(); JNLPRuntime.indicator = indicator; } /** * @return the default download indicator. */ public static DownloadIndicator getDefaultDownloadIndicator() { return indicator; } public static String getLocalisedTimeStamp(Date timestamp) { return DateFormat.getInstance().format(timestamp); } /** * @return {@code true} if the current runtime will fork */ public static boolean getForksAllowed() { return forksAllowed; } public static void setForksAllowed(boolean value) { checkInitialized(); forksAllowed = value; } /** * Throws an exception if called when the runtime is already initialized. */ private static void checkInitialized() { if (initialized) throw new IllegalStateException("JNLPRuntime already initialized."); } /** * Throws an exception if called with security enabled but a caller is not * the exit class and the runtime has been initialized. */ private static void checkExitClass() { if (securityEnabled && initialized) if (!security.isExitClass()) throw new IllegalStateException("Caller is not the exit class"); } /** * Check whether the VM is in headless mode. */ private static void checkHeadless() { //if (GraphicsEnvironment.isHeadless()) // jdk1.4+ only // headless = true; try { if ("true".equalsIgnoreCase(System.getProperty("java.awt.headless"))) headless = true; } catch (SecurityException ex) { } } /** * @return {@code true} if running on Windows */ public static boolean isWindows() { String os = System.getProperty("os.name"); return (os != null && os.startsWith("Windows")); } /** * @return {@code true} if running on a Unix or Unix-like system (including * Linux and *BSD) */ public static boolean isUnix() { String sep = System.getProperty("file.separator"); return (sep != null && sep.equals("/")); } public static void setInitialArgments(List args) { checkInitialized(); SecurityManager securityManager = System.getSecurityManager(); if (securityManager != null) securityManager.checkPermission(new AllPermission()); initialArguments = args; } public static List getInitialArguments() { return initialArguments; } /** * Indicate that netx is running by creating the * {@link DeploymentConfiguration#KEY_USER_NETX_RUNNING_FILE} and * acquiring a shared lock on it */ public synchronized static void markNetxRunning() { if (fileLock != null) return; try { String message = "This file is used to check if netx is running"; File netxRunningFile = PathsAndFiles.MAIN_LOCK.getFile(); if (!netxRunningFile.exists()) { FileUtils.createParentDir(netxRunningFile); FileUtils.createRestrictedFile(netxRunningFile, true); try (FileOutputStream fos = new FileOutputStream(netxRunningFile)) { fos.write(message.getBytes()); } } FileInputStream is = new FileInputStream(netxRunningFile); FileChannel channel = is.getChannel(); fileLock = channel.lock(0, 1, true); if (!fileLock.isShared()){ // We know shared locks aren't offered on this system. FileLock temp = null; for (long pos = 1; temp == null && pos < Long.MAX_VALUE - 1; pos++){ temp = channel.tryLock(pos, 1, false); // No point in requesting for shared lock. } fileLock.release(); // We can release now, since we hold another lock. fileLock = temp; // Keep the new lock so we can release later. } if (fileLock != null && fileLock.isShared()) { OutputController.getLogger().log("Acquired shared lock on " + netxRunningFile.toString() + " to indicate javaws is running"); } } catch (IOException e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); } Runtime.getRuntime().addShutdownHook(new Thread("JNLPRuntimeShutdownHookThread") { @Override public void run() { markNetxStopped(); CacheUtil.cleanCache(); } }); } /** * Indicate that netx is stopped by releasing the shared lock on * {@link DeploymentConfiguration#KEY_USER_NETX_RUNNING_FILE}. */ private static void markNetxStopped() { if (fileLock == null) { return; } try { fileLock.release(); fileLock.channel().close(); fileLock = null; OutputController.getLogger().log("Release shared lock on " + PathsAndFiles.MAIN_LOCK.getFullPath()); } catch (IOException e) { OutputController.getLogger().log(e); } } public static void setHtml(boolean html) { JNLPRuntime.html = html; } public static boolean isHtml() { return html; } public static void setTrustAll(boolean b) { trustAll=b; } public static boolean isTrustAll() { return trustAll; } public static void setTrustNone(final boolean b) { trustNone = b; } public static boolean isTrustNone() { return trustNone; } public static boolean isIgnoreHeaders() { return ignoreHeaders; } public static void setIgnoreHeaders(boolean ignoreHeaders) { JNLPRuntime.ignoreHeaders = ignoreHeaders; } private static boolean isPluginDebug() { if (pluginDebug == null) { try { //there are cases when this itself is not allowed by security manager, and so //throws exception. Under some conditions it can couse deadlock pluginDebug = System.getenv().containsKey("ICEDTEAPLUGIN_DEBUG"); } catch (Exception ex) { pluginDebug = false; OutputController.getLogger().log(ex); } } return pluginDebug; } public static void exit(int i) { try { OutputController.getLogger().close(); while (BasicExceptionDialog.areShown()){ Thread.sleep(100); } } catch (Exception ex) { //to late } System.exit(i); } public static void saveHistory(String documentBase) { JNLPRuntime.history += " " + documentBase + " "; } /** * Used by java-abrt-connector via reflection * @return history */ private static String getHistory() { return history; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/runtime/PaxHeaders.17941/JNLPProxySelector.java0000644000000000000000000000013112654402377026332 xustar0030 mtime=1454507263.297431781 30 atime=1454507327.139580337 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/runtime/JNLPProxySelector.java0000644000175000002070000003726212654402377027070 0ustar00jvanekmock00000000000000// Copyright (C) 2010 Red Hat, Inc. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp.runtime; import java.io.IOException; import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.MalformedURLException; import java.net.Proxy; import java.net.ProxySelector; import java.net.SocketAddress; import java.net.URI; import java.net.URL; import java.net.UnknownHostException; import java.net.Proxy.Type; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.StringTokenizer; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.util.logging.OutputController; /** * A ProxySelector specific to JNLPs. This proxy uses the deployment * configuration to determine what to do. * * @see java.net.ProxySelector */ public abstract class JNLPProxySelector extends ProxySelector { public static final int PROXY_TYPE_UNKNOWN = -1; public static final int PROXY_TYPE_NONE = 0; public static final int PROXY_TYPE_MANUAL = 1; public static final int PROXY_TYPE_AUTO = 2; public static final int PROXY_TYPE_BROWSER = 3; /** The default port to use as a fallback. Currently squid's default port */ public static final int FALLBACK_PROXY_PORT = 3128; private PacEvaluator pacEvaluator = null; /** The proxy type. See PROXY_TYPE_* constants */ private int proxyType = PROXY_TYPE_UNKNOWN; /** the URL to the PAC file */ private URL autoConfigUrl = null; /** a list of URLs that should be bypassed for proxy purposes */ private List bypassList = null; /** whether localhost should be bypassed for proxy purposes */ private boolean bypassLocal = false; /** * whether the http proxy should be used for https and ftp protocols as well */ private boolean sameProxy = false; private String proxyHttpHost; private int proxyHttpPort; private String proxyHttpsHost; private int proxyHttpsPort; private String proxyFtpHost; private int proxyFtpPort; private String proxySocks4Host; private int proxySocks4Port; // FIXME what is this? where should it be used? private String overrideHosts = null; public JNLPProxySelector(DeploymentConfiguration config) { parseConfiguration(config); } /** * Initialize this ProxySelector by reading the configuration */ private void parseConfiguration(DeploymentConfiguration config) { proxyType = Integer.valueOf(config.getProperty(DeploymentConfiguration.KEY_PROXY_TYPE)); String autoConfigString = config.getProperty(DeploymentConfiguration.KEY_PROXY_AUTO_CONFIG_URL); if (autoConfigString != null) { try { autoConfigUrl = new URL(autoConfigString); } catch (MalformedURLException e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); } } if (autoConfigUrl != null) { pacEvaluator = PacEvaluatorFactory.getPacEvaluator(autoConfigUrl); } bypassList = new ArrayList<>(); String proxyBypass = config.getProperty(DeploymentConfiguration.KEY_PROXY_BYPASS_LIST); if (proxyBypass != null) { StringTokenizer tokenizer = new StringTokenizer(proxyBypass, ","); while (tokenizer.hasMoreTokens()) { String host = tokenizer.nextToken(); if (host != null && host.trim().length() != 0) { bypassList.add(host); } } } bypassLocal = Boolean.valueOf(config .getProperty(DeploymentConfiguration.KEY_PROXY_BYPASS_LOCAL)); sameProxy = Boolean.valueOf(config.getProperty(DeploymentConfiguration.KEY_PROXY_SAME)); proxyHttpHost = getHost(config, DeploymentConfiguration.KEY_PROXY_HTTP_HOST); proxyHttpPort = getPort(config, DeploymentConfiguration.KEY_PROXY_HTTP_PORT); proxyHttpsHost = getHost(config, DeploymentConfiguration.KEY_PROXY_HTTPS_HOST); proxyHttpsPort = getPort(config, DeploymentConfiguration.KEY_PROXY_HTTPS_PORT); proxyFtpHost = getHost(config, DeploymentConfiguration.KEY_PROXY_FTP_HOST); proxyFtpPort = getPort(config, DeploymentConfiguration.KEY_PROXY_FTP_PORT); proxySocks4Host = getHost(config, DeploymentConfiguration.KEY_PROXY_SOCKS4_HOST); proxySocks4Port = getPort(config, DeploymentConfiguration.KEY_PROXY_SOCKS4_PORT); overrideHosts = config.getProperty(DeploymentConfiguration.KEY_PROXY_OVERRIDE_HOSTS); } /** * Uses the given key to get a host from the configuraion */ private String getHost(DeploymentConfiguration config, String key) { String proxyHost = config.getProperty(key); if (proxyHost != null) { proxyHost = proxyHost.trim(); } return proxyHost; } /** * Uses the given key to get a port from the configuration */ private int getPort(DeploymentConfiguration config, String key) { int proxyPort = FALLBACK_PROXY_PORT; String port; port = config.getProperty(key); if (port != null && port.trim().length() != 0) { try { proxyPort = Integer.valueOf(port); } catch (NumberFormatException e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); } } return proxyPort; } /** * {@inheritDoc} */ @Override public void connectFailed(URI uri, SocketAddress sa, IOException ioe) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, ioe); } /** * {@inheritDoc} * @return list of proxies on URI */ @Override public List select(URI uri) { OutputController.getLogger().log("Selecting proxy for: " + uri); if (inBypassList(uri)) { List proxies = Arrays.asList(new Proxy[] { Proxy.NO_PROXY }); OutputController.getLogger().log("Selected proxies: " + Arrays.toString(proxies.toArray())); return proxies; } List proxies = new ArrayList<>(); switch (proxyType) { case PROXY_TYPE_MANUAL: proxies.addAll(getFromConfiguration(uri)); break; case PROXY_TYPE_AUTO: proxies.addAll(getFromPAC(uri)); break; case PROXY_TYPE_BROWSER: proxies.addAll(getFromBrowser(uri)); break; case PROXY_TYPE_UNKNOWN: // fall through case PROXY_TYPE_NONE: // fall through default: proxies.add(Proxy.NO_PROXY); break; } OutputController.getLogger().log("Selected proxies: " + Arrays.toString(proxies.toArray())); return proxies; } /** * Returns true if the uri should be bypassed for proxy purposes */ private boolean inBypassList(URI uri) { try { String scheme = uri.getScheme(); /* scheme can be http/https/ftp/socket */ switch (scheme) { case "http": case "https": case "ftp": URL url = uri.toURL(); if (bypassLocal && isLocalHost(url.getHost())) { return true; } if (bypassList.contains(url.getHost())) { return true; } break; case "socket": String host = uri.getHost(); if (bypassLocal && isLocalHost(host)) { return true; } if (bypassList.contains(host)) { return true; } break; } } catch (MalformedURLException e) { return false; } return false; } /** * @return true if the host is the hostname or the IP address of the * localhost * @param host host to verify */ private boolean isLocalHost(String host) { try { if (InetAddress.getByName(host).isLoopbackAddress()) { return true; } } catch (UnknownHostException e1) { // continue } try { if (host.equals(InetAddress.getLocalHost().getHostName())) { return true; } } catch (UnknownHostException e) { // continue } try { if (host.equals(InetAddress.getLocalHost().getHostAddress())) { return true; } } catch (UnknownHostException e) { // continue } return false; } /** * Returns a list of proxies by using the information in the deployment * configuration * * @param uri uri to read * @return a List of Proxy objects */ private List getFromConfiguration(URI uri) { return getFromArguments(uri, sameProxy, false, proxyHttpsHost, proxyHttpsPort, proxyHttpHost, proxyHttpPort, proxyFtpHost, proxyFtpPort, proxySocks4Host, proxySocks4Port); } /** * Returns a list of proxies by using the arguments * * @param uri name and code says it all * @param sameProxy name and code says it all * @param sameProxyIncludesSocket name and code says it all * @param proxyHttpsHost name and code says it all * @param proxyHttpsPort name and code says it all * @param proxyHttpHost name and code says it all * @param proxyHttpPort name and code says it all * @param proxyFtpHost name and code says it all * @param proxyFtpPort name and code says it all * @param proxySocks4Host name and code says it all * @param proxySocks4Port name and code says it all * @return a List of Proxy objects */ protected static List getFromArguments(URI uri, boolean sameProxy, boolean sameProxyIncludesSocket, String proxyHttpsHost, int proxyHttpsPort, String proxyHttpHost, int proxyHttpPort, String proxyFtpHost, int proxyFtpPort, String proxySocks4Host, int proxySocks4Port) { List proxies = new ArrayList<>(); String scheme = uri.getScheme(); boolean socksProxyAdded = false; if (sameProxy) { if (proxyHttpHost != null) { SocketAddress sa = new InetSocketAddress(proxyHttpHost, proxyHttpPort); if ((scheme.equals("https") || scheme.equals("http") || scheme.equals("ftp"))) { Proxy proxy = new Proxy(Type.HTTP, sa); proxies.add(proxy); } else if (scheme.equals("socket") && sameProxyIncludesSocket) { Proxy proxy = new Proxy(Type.SOCKS, sa); proxies.add(proxy); socksProxyAdded = true; } } } else if (scheme.equals("http") && proxyHttpHost != null) { SocketAddress sa = new InetSocketAddress(proxyHttpHost, proxyHttpPort); proxies.add(new Proxy(Type.HTTP, sa)); } else if (scheme.equals("https") && proxyHttpsHost != null) { SocketAddress sa = new InetSocketAddress(proxyHttpsHost, proxyHttpsPort); proxies.add(new Proxy(Type.HTTP, sa)); } else if (scheme.equals("ftp") && proxyFtpHost != null) { SocketAddress sa = new InetSocketAddress(proxyFtpHost, proxyFtpPort); proxies.add(new Proxy(Type.HTTP, sa)); } if (!socksProxyAdded && (proxySocks4Host != null)) { SocketAddress sa = new InetSocketAddress(proxySocks4Host, proxySocks4Port); proxies.add(new Proxy(Type.SOCKS, sa)); socksProxyAdded = true; } if (proxies.isEmpty()) { proxies.add(Proxy.NO_PROXY); } return proxies; } /** * Returns a list of proxies by using the Proxy Auto Config (PAC) file. See * http://en.wikipedia.org/wiki/Proxy_auto-config#The_PAC_file for more * information. * * @param uri uri to PAC * @return a List of valid Proxy objects */ protected List getFromPAC(URI uri) { if (autoConfigUrl == null || uri.getScheme().equals("socket")) { return Arrays.asList(new Proxy[] { Proxy.NO_PROXY }); } List proxies = new ArrayList<>(); try { String proxiesString = pacEvaluator.getProxies(uri.toURL()); proxies.addAll(getProxiesFromPacResult(proxiesString)); } catch (MalformedURLException e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); proxies.add(Proxy.NO_PROXY); } return proxies; } /** * Returns a list of proxies by querying the browser * * @param uri the uri to get proxies for * @return a list of proxies */ protected abstract List getFromBrowser(URI uri); /** * Converts a proxy string from a browser into a List of Proxy objects * suitable for java. * @param pacString a string indicating proxies. For example * "PROXY foo.bar:3128; DIRECT" * @return a list of Proxy objects representing the parsed string. In * case of malformed input, an empty list may be returned */ public static List getProxiesFromPacResult(String pacString) { List proxies = new ArrayList<>(); String[] tokens = pacString.split(";"); for (String token: tokens) { if (token.startsWith("PROXY")) { String hostPortPair = token.substring("PROXY".length()).trim(); if (!hostPortPair.contains(":")) { continue; } String host = hostPortPair.split(":")[0]; int port; try { port = Integer.valueOf(hostPortPair.split(":")[1]); } catch (NumberFormatException nfe) { continue; } SocketAddress sa = new InetSocketAddress(host, port); proxies.add(new Proxy(Type.HTTP, sa)); } else if (token.startsWith("SOCKS")) { String hostPortPair = token.substring("SOCKS".length()).trim(); if (!hostPortPair.contains(":")) { continue; } String host = hostPortPair.split(":")[0]; int port; try { port = Integer.valueOf(hostPortPair.split(":")[1]); } catch (NumberFormatException nfe) { continue; } SocketAddress sa = new InetSocketAddress(host, port); proxies.add(new Proxy(Type.SOCKS, sa)); } else if (token.startsWith("DIRECT")) { proxies.add(Proxy.NO_PROXY); } else { OutputController.getLogger().log("Unrecognized proxy token: " + token); } } return proxies; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/runtime/PaxHeaders.17941/JNLPPolicy.java0000644000000000000000000000013112654402377024747 xustar0030 mtime=1454507263.297431781 30 atime=1454507327.139580337 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/runtime/JNLPPolicy.java0000644000175000002070000001706112654402377025500 0ustar00jvanekmock00000000000000// Copyright (C) 2001-2003 Jon A. Maxwell (JAM) // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp.runtime; import java.io.File; import java.net.URI; import java.net.URISyntaxException; import java.security.*; import java.util.Enumeration; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.config.PathsAndFiles; import net.sourceforge.jnlp.util.logging.OutputController; /** * Policy for JNLP environment. This class delegates to the * system policy but always grants permissions to the JNLP code * and system CodeSources (no separate policy file needed). This * class may also grant permissions to applications at runtime if * approved by the user. * * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.7 $ */ public class JNLPPolicy extends Policy { /** classes from this source have all permissions */ private static CodeSource shellSource; /** classes from this source have all permissions */ private static CodeSource systemSource; /** the previous policy */ private static Policy systemPolicy; private final String jreExtDir; /** the system level policy for jnlps */ private Policy systemJnlpPolicy = null; /** the user-level policy for jnlps */ private Policy userJnlpPolicy = null; protected JNLPPolicy() { shellSource = JNLPPolicy.class.getProtectionDomain().getCodeSource(); systemSource = Policy.class.getProtectionDomain().getCodeSource(); systemPolicy = Policy.getPolicy(); systemJnlpPolicy = getPolicyFromConfig(DeploymentConfiguration.KEY_SYSTEM_SECURITY_POLICY); userJnlpPolicy = getPolicyFromUrl(PathsAndFiles.JAVA_POLICY.getFullPath()); String jre = System.getProperty("java.home"); jreExtDir = jre + File.separator + "lib" + File.separator + "ext"; } /** * Return a mutable, heterogeneous-capable permission collection * for the source. */ public PermissionCollection getPermissions(CodeSource source) { if (source.equals(systemSource) || source.equals(shellSource)) return getAllPermissions(); if (isSystemJar(source)) { return getAllPermissions(); } // if we check the SecurityDesc here then keep in mind that // code can add properties at runtime to the ResourcesDesc! if (JNLPRuntime.getApplication() != null) { if (JNLPRuntime.getApplication().getClassLoader() instanceof JNLPClassLoader) { JNLPClassLoader cl = (JNLPClassLoader) JNLPRuntime.getApplication().getClassLoader(); PermissionCollection clPermissions = cl.getPermissions(source); Enumeration e; CodeSource appletCS = new CodeSource(JNLPRuntime.getApplication().getJNLPFile().getSourceLocation(), (java.security.cert.Certificate[]) null); // systempolicy permissions need to be accounted for as well e = systemPolicy.getPermissions(appletCS).elements(); while (e.hasMoreElements()) { clPermissions.add(e.nextElement()); } // and so do permissions from the jnlp-specific system policy if (systemJnlpPolicy != null) { e = systemJnlpPolicy.getPermissions(appletCS).elements(); while (e.hasMoreElements()) { clPermissions.add(e.nextElement()); } } // and permissiosn from jnlp-specific user policy too if (userJnlpPolicy != null) { e = userJnlpPolicy.getPermissions(appletCS).elements(); while (e.hasMoreElements()) { clPermissions.add(e.nextElement()); } CodeSource appletCodebaseSource = new CodeSource(JNLPRuntime.getApplication().getJNLPFile().getCodeBase(), (java.security.cert.Certificate[]) null); e = userJnlpPolicy.getPermissions(appletCodebaseSource).elements(); while (e.hasMoreElements()) { clPermissions.add(e.nextElement()); } } return clPermissions; } } // delegate to original Policy object; required to run under WebStart return systemPolicy.getPermissions(source); } /** * Refresh. */ public void refresh() { if (userJnlpPolicy != null) { userJnlpPolicy.refresh(); } } /** * Return an all-permissions collection. */ private Permissions getAllPermissions() { Permissions result = new Permissions(); result.add(new AllPermission()); return result; } /** * Returns true if the CodeSource corresponds to a system jar. That is, * it's part of the JRE. */ private boolean isSystemJar(CodeSource source) { if (source == null || source.getLocation() == null) { return false; } // anything in JRE/lib/ext is a system jar and has full permissions String sourceProtocol = source.getLocation().getProtocol(); String sourcePath = source.getLocation().getPath(); if (sourceProtocol.toUpperCase().equals("FILE") && sourcePath.startsWith(jreExtDir)) { return true; } return false; } /** * Constructs a delegate policy based on a config setting * @param key a KEY_* in DeploymentConfiguration * @return a policy based on the configuration set by the user */ private Policy getPolicyFromConfig(String key) { DeploymentConfiguration config = JNLPRuntime.getConfiguration(); String policyLocation = config.getProperty(key); return getPolicyFromUrl(policyLocation); } /** * Constructs a delegate policy based on a config setting * @param key a KEY_* in DeploymentConfiguration * @return a policy based on the configuration set by the user */ private Policy getPolicyFromUrl(String policyLocation) { Policy policy = null; if (policyLocation != null) { try { URI policyUri = new URI(policyLocation); policy = getInstance("JavaPolicy", new URIParameter(policyUri)); } catch (IllegalArgumentException | NoSuchAlgorithmException | URISyntaxException e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); } } return policy; } public boolean implies(ProtectionDomain domain, Permission permission) { //Include the permissions that may be added during runtime. PermissionCollection pc = getPermissions(domain.getCodeSource()); return super.implies(domain, permission) || pc.implies(permission); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/runtime/PaxHeaders.17941/JNLPClassLoader.java0000644000000000000000000000013112654402377025704 xustar0030 mtime=1454507263.297431781 30 atime=1454507327.139580337 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java0000644000175000002070000031431212654402377026434 0ustar00jvanekmock00000000000000// // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp.runtime; import static net.sourceforge.jnlp.runtime.Translator.R; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.net.MalformedURLException; import java.net.SocketPermission; import java.net.URL; import java.net.URLClassLoader; import java.security.AccessControlContext; import java.security.AccessControlException; import java.security.AccessController; import java.security.AllPermission; import java.security.CodeSource; import java.security.Permission; import java.security.PermissionCollection; import java.security.Permissions; import java.security.PrivilegedAction; import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; import java.security.ProtectionDomain; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.Enumeration; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Set; import java.util.TreeSet; import java.util.Vector; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.locks.ReentrantLock; import java.util.jar.Attributes; import java.util.jar.JarEntry; import java.util.jar.Manifest; import net.sourceforge.jnlp.AppletDesc; import net.sourceforge.jnlp.ApplicationDesc; import net.sourceforge.jnlp.ExtensionDesc; import net.sourceforge.jnlp.JARDesc; import net.sourceforge.jnlp.JNLPFile; import net.sourceforge.jnlp.JNLPMatcher; import net.sourceforge.jnlp.JNLPMatcherException; import net.sourceforge.jnlp.LaunchDesc; import net.sourceforge.jnlp.LaunchException; import net.sourceforge.jnlp.NullJnlpFileException; import net.sourceforge.jnlp.ParseException; import net.sourceforge.jnlp.ParserSettings; import net.sourceforge.jnlp.PluginBridge; import net.sourceforge.jnlp.ResourcesDesc; import net.sourceforge.jnlp.SecurityDesc; import net.sourceforge.jnlp.Version; import net.sourceforge.jnlp.cache.CacheUtil; import net.sourceforge.jnlp.cache.IllegalResourceDescriptorException; import net.sourceforge.jnlp.cache.NativeLibraryStorage; import net.sourceforge.jnlp.cache.ResourceTracker; import net.sourceforge.jnlp.cache.UpdatePolicy; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.security.AppVerifier; import net.sourceforge.jnlp.security.JNLPAppVerifier; import net.sourceforge.jnlp.security.PluginAppVerifier; import net.sourceforge.jnlp.security.appletextendedsecurity.UnsignedAppletTrustConfirmation; import net.sourceforge.jnlp.tools.JarCertVerifier; import net.sourceforge.jnlp.util.JarFile; import net.sourceforge.jnlp.util.StreamUtils; import net.sourceforge.jnlp.util.UrlUtils; import net.sourceforge.jnlp.util.logging.OutputController; import sun.misc.JarIndex; /** * Classloader that takes it's resources from a JNLP file. If the * JNLP file defines extensions, separate classloaders for these * will be created automatically. Classes are loaded with the * security context when the classloader was created. * * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.20 $ */ public class JNLPClassLoader extends URLClassLoader { // todo: initializePermissions should get the permissions from // extension classes too so that main file classes can load // resources in an extension. /** Signed JNLP File and Template */ final public static String TEMPLATE = "JNLP-INF/APPLICATION_TEMPLATE.JNLP"; final public static String APPLICATION = "JNLP-INF/APPLICATION.JNLP"; /** Actions to specify how cache is to be managed **/ public static enum DownloadAction { DOWNLOAD_TO_CACHE, REMOVE_FROM_CACHE, CHECK_CACHE } public static enum SigningState { FULL, PARTIAL, NONE } /** True if the application has a signed JNLP File */ private boolean isSignedJNLP = false; /** map from JNLPFile unique key to shared classloader */ private static Map uniqueKeyToLoader = new ConcurrentHashMap<>(); /** map from JNLPFile unique key to lock, the lock is needed to enforce correct * initialization of applets that share a unique key*/ private static Map uniqueKeyToLock = new HashMap<>(); /** Provides a search path & temporary storage for native code */ private NativeLibraryStorage nativeLibraryStorage; /** security context */ private final AccessControlContext acc = AccessController.getContext(); /** the permissions for the cached jar files */ private List resourcePermissions; /** the app */ private ApplicationInstance app = null; // here for faster lookup in security manager /** list of this, local and global loaders this loader uses */ private JNLPClassLoader loaders[] = null; // ..[0]==this /** whether to strictly adhere to the spec or not */ private final boolean strict; /** loads the resources */ private final ResourceTracker tracker = new ResourceTracker(true); // prefetch /** the update policy for resources */ private UpdatePolicy updatePolicy; /** the JNLP file */ private JNLPFile file; /** the resources section */ private ResourcesDesc resources; /** the security section */ private SecurityDesc security; /** Permissions granted by the user during runtime. */ private final ArrayList runtimePermissions = new ArrayList<>(); /** all jars not yet part of classloader or active * Synchronized since this field may become shared data between multiple classloading threads. * See loadClass(String) and CodebaseClassLoader.findClassNonRecursive(String). */ private final List available = Collections.synchronizedList(new ArrayList()); /** the jar cert verifier tool to verify our jars */ private final JarCertVerifier jcv; private SigningState signing = SigningState.NONE; /** ArrayList containing jar indexes for various jars available to this classloader * Synchronized since this field may become shared data between multiple classloading threads/ * See loadClass(String) and CodebaseClassLoader.findClassNonRecursive(String). */ private final List jarIndexes = Collections.synchronizedList(new ArrayList()); /** Set of classpath strings declared in the manifest.mf files * Synchronized since this field may become shared data between multiple classloading threads. * See loadClass(String) and CodebaseClassLoader.findClassNonRecursive(String). */ private final Set classpaths = Collections.synchronizedSet(new HashSet()); /** File entries in the jar files available to this classloader * Synchronized sinc this field may become shared data between multiple classloading threads. * See loadClass(String) and CodebaseClassLoader.findClassNonRecursive(String). */ private final Set jarEntries = Collections.synchronizedSet(new TreeSet()); /** Map of specific original (remote) CodeSource Urls to securitydesc * Synchronized since this field may become shared data between multiple classloading threads. * See loadClass(String) and CodebaseClassLoader.findClassNonRecursive(String). */ private final Map jarLocationSecurityMap = Collections.synchronizedMap(new HashMap()); /*Set to prevent once tried-to-get resources to be tried again*/ private final Set alreadyTried = Collections.synchronizedSet(new HashSet()); /** Loader for codebase (which is a path, rather than a file) */ private CodeBaseClassLoader codeBaseLoader; /** True if the jar with the main class has been found * */ private boolean foundMainJar= false; /** Name of the application's main class */ private String mainClass = null; /** * Variable to track how many times this loader is in use */ private int useCount = 0; private boolean enableCodeBase = false; private final SecurityDelegate securityDelegate; private ManifestAttributesChecker mac; /** * Create a new JNLPClassLoader from the specified file. * * @param file the JNLP file * @param policy update policy of loader * @throws net.sourceforge.jnlp.LaunchException if app can not be loaded */ protected JNLPClassLoader(JNLPFile file, UpdatePolicy policy) throws LaunchException { this(file, policy, null, false); } /** * Create a new JNLPClassLoader from the specified file. * * @param file the JNLP file * @param policy the UpdatePolicy for this class loader * @param mainName name of the application's main class * @param enableCodeBase switch whether this classloader can search in codebase or not * @throws net.sourceforge.jnlp.LaunchException when need to kill an app comes. * */ protected JNLPClassLoader(JNLPFile file, UpdatePolicy policy, String mainName, boolean enableCodeBase) throws LaunchException { super(new URL[0], JNLPClassLoader.class.getClassLoader()); OutputController.getLogger().log("New classloader: " + file.getFileLocation()); strict = Boolean.valueOf(JNLPRuntime.getConfiguration().getProperty(DeploymentConfiguration.KEY_STRICT_JNLP_CLASSLOADER)); this.file = file; this.updatePolicy = policy; this.resources = file.getResources(); this.nativeLibraryStorage = new NativeLibraryStorage(tracker); this.mainClass = mainName; this.enableCodeBase = enableCodeBase; AppVerifier verifier; if (file instanceof PluginBridge && !((PluginBridge)file).useJNLPHref()) { verifier = new PluginAppVerifier(); } else { verifier = new JNLPAppVerifier(); } jcv = new JarCertVerifier(verifier); if (this.enableCodeBase) { addToCodeBaseLoader(this.file.getCodeBase()); } this.securityDelegate = new SecurityDelegateImpl(this); // initialize extensions initializeExtensions(); initializeResources(); // initialize permissions initializeReadJarPermissions(); installShutdownHooks(); } public boolean isStrict() { return strict; } /** * Install JVM shutdown hooks to clean up resources allocated by this * ClassLoader. */ private void installShutdownHooks() { Runtime.getRuntime().addShutdownHook(new Thread() { @Override public void run() { /* * Delete only the native dir created by this classloader (if * there is one). Other classloaders (parent, peers) will all * cleanup things they created */ nativeLibraryStorage.cleanupTemporaryFolder(); } }); } private void setSecurity() throws LaunchException { URL codebase = UrlUtils.guessCodeBase(file); this.security = securityDelegate.getClassLoaderSecurity(codebase); } /** * Gets the lock for a given unique key, creating one if it does not yet exist. * This operation is atomic & thread-safe. * * @param uniqueKey the file whose unique key should be used * @return the lock */ private static ReentrantLock getUniqueKeyLock(String uniqueKey) { synchronized (uniqueKeyToLock) { ReentrantLock storedLock = uniqueKeyToLock.get(uniqueKey); if (storedLock == null) { storedLock = new ReentrantLock(); uniqueKeyToLock.put(uniqueKey, storedLock); } return storedLock; } } /** * Creates a fully initialized JNLP classloader for the specified JNLPFile, * to be used as an applet/application's classloader. * In contrast, JNLP classloaders can also be constructed simply to merge * its resources into another classloader. * * @param file the file to load classes for * @param policy the update policy to use when downloading resources * @param mainName Overrides the main class name of the application */ private static JNLPClassLoader createInstance(JNLPFile file, UpdatePolicy policy, String mainName, boolean enableCodeBase) throws LaunchException { String uniqueKey = file.getUniqueKey(); JNLPClassLoader baseLoader = uniqueKeyToLoader.get(uniqueKey); JNLPClassLoader loader = new JNLPClassLoader(file, policy, mainName, enableCodeBase); // If security level is 'high' or greater, we must check if the user allows unsigned applets // when the JNLPClassLoader is created. We do so here, because doing so in the constructor // causes unwanted side-effects for some applets. However, if the loader has been tagged // with "runInSandbox", then we do not show this dialog - since this tag indicates that // the user was already shown a CertWarning dialog and has chosen to run the applet sandboxed. // This means they've already agreed to running the applet and have specified with which // permission level to do it! if (loader.getSigningState() == SigningState.PARTIAL) { loader.securityDelegate.promptUserOnPartialSigning(); } else if (!loader.getSigning() && !loader.securityDelegate.userPromptedForSandbox() && file instanceof PluginBridge) { UnsignedAppletTrustConfirmation.checkUnsignedWithUserIfRequired((PluginBridge)file); } // New loader init may have caused extentions to create a // loader for this unique key. Check. JNLPClassLoader extLoader = uniqueKeyToLoader.get(uniqueKey); if (extLoader != null && extLoader != loader) { if (loader.getSigning() != extLoader.getSigning()) { loader.securityDelegate.promptUserOnPartialSigning(); } loader.merge(extLoader); extLoader.decrementLoaderUseCount(); // loader urls have been merged, ext loader is no longer used } // loader is now current + ext. But we also need to think of // the baseLoader if (baseLoader != null && baseLoader != loader) { loader.merge(baseLoader); } return loader; } /** * Returns a JNLP classloader for the specified JNLP file. * * @param file the file to load classes for * @param policy the update policy to use when downloading resources * @param enableCodeBase true if codebase can be searched (ok for applets,false for apps) * @return existing classloader. creates new if none reliable exists * @throws net.sourceforge.jnlp.LaunchException when launch is doomed */ public static JNLPClassLoader getInstance(JNLPFile file, UpdatePolicy policy, boolean enableCodeBase) throws LaunchException { return getInstance(file, policy, null, enableCodeBase); } /** * Returns a JNLP classloader for the specified JNLP file. * * @param file the file to load classes for * @param policy the update policy to use when downloading resources * @param mainName Overrides the main class name of the application * @param enableCodeBase ue if codebase can be searched (ok for applets,false for apps) * @return existing classloader. creates new if none reliable exists * @throws net.sourceforge.jnlp.LaunchException when launch is doomed */ public static JNLPClassLoader getInstance(JNLPFile file, UpdatePolicy policy, String mainName, boolean enableCodeBase) throws LaunchException { JNLPClassLoader loader; String uniqueKey = file.getUniqueKey(); synchronized ( getUniqueKeyLock(uniqueKey) ) { JNLPClassLoader baseLoader = uniqueKeyToLoader.get(uniqueKey); // A null baseloader implies that no loader has been created // for this codebase/jnlp yet. Create one. if (baseLoader == null || (file.isApplication() && !baseLoader.getJNLPFile().getFileLocation().equals(file.getFileLocation()))) { loader = createInstance(file, policy, mainName, enableCodeBase); } else { // if key is same and locations match, this is the loader we want if (!file.isApplication()) { // If this is an applet, we do need to consider its loader loader = new JNLPClassLoader(file, policy, mainName, enableCodeBase); if (baseLoader != null) baseLoader.merge(loader); } loader = baseLoader; } // loaders are mapped to a unique key. Only extensions and parent // share a key, so it is safe to always share based on it loader.incrementLoaderUseCount(); uniqueKeyToLoader.put(uniqueKey, loader); } return loader; } /** * Returns a JNLP classloader for the JNLP file at the specified * location. * * @param location the file's location * @param uniqueKey key to manage applets/applications in shared vm * @param version the file's version * @param settings settings of parser * @param policy the update policy to use when downloading resources * @param mainName Overrides the main class name of the application * @param enableCodeBase whether to enable codebase search or not * @return classlaoder of this appp * @throws java.io.IOException when IO fails * @throws net.sourceforge.jnlp.ParseException when parsing fails * @throws net.sourceforge.jnlp.LaunchException when launch is doomed */ public static JNLPClassLoader getInstance(URL location, String uniqueKey, Version version, ParserSettings settings, UpdatePolicy policy, String mainName, boolean enableCodeBase) throws IOException, ParseException, LaunchException { JNLPClassLoader loader; synchronized ( getUniqueKeyLock(uniqueKey) ) { loader = uniqueKeyToLoader.get(uniqueKey); if (loader == null || !location.equals(loader.getJNLPFile().getFileLocation())) { JNLPFile jnlpFile = new JNLPFile(location, uniqueKey, version, settings, policy); loader = getInstance(jnlpFile, policy, mainName, enableCodeBase); } } return loader; } /** * Load the extensions specified in the JNLP file. */ void initializeExtensions() { ExtensionDesc[] extDescs = resources.getExtensions(); List loaderList = new ArrayList<>(); loaderList.add(this); if (mainClass == null) { Object obj = file.getLaunchInfo(); if (obj instanceof ApplicationDesc) { ApplicationDesc ad = (ApplicationDesc) file.getLaunchInfo(); mainClass = ad.getMainClass(); } else if (obj instanceof AppletDesc) { AppletDesc ad = (AppletDesc) file.getLaunchInfo(); mainClass = ad.getMainClass(); } } //if (ext != null) { for (ExtensionDesc ext : extDescs) { try { String uniqueKey = this.getJNLPFile().getUniqueKey(); JNLPClassLoader loader = getInstance(ext.getLocation(), uniqueKey, ext.getVersion(), file.getParserSettings(), updatePolicy, mainClass, this.enableCodeBase); loaderList.add(loader); } catch (Exception ex) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, ex); } } //} loaders = loaderList.toArray(new JNLPClassLoader[loaderList.size()]); } /** * Make permission objects for the classpath. */ void initializeReadJarPermissions() { resourcePermissions = new ArrayList<>(); JARDesc jars[] = resources.getJARs(); for (JARDesc jar : jars) { Permission p = CacheUtil.getReadPermission(jar.getLocation(), jar.getVersion()); if (p == null) { OutputController.getLogger().log("Unable to add permission for " + jar.getLocation()); } else { resourcePermissions.add(p); OutputController.getLogger().log("Permission added: " + p.toString()); } } } /** * Check if a described jar file is invalid * @param jar the jar to check * @return true if file exists AND is an invalid jar, false otherwise */ boolean isInvalidJar(JARDesc jar){ File cacheFile = tracker.getCacheFile(jar.getLocation()); if (cacheFile == null) return false;//File cannot be retrieved, do not claim it is an invalid jar boolean isInvalid = false; try { JarFile jarFile = new JarFile(cacheFile.getAbsolutePath()); jarFile.close(); } catch (IOException ioe){ //Catch a ZipException or any other read failure isInvalid = true; } return isInvalid; } /** * Determine how invalid jars should be handled * @return whether to filter invalid jars, or error later on */ private boolean shouldFilterInvalidJars(){ if (file instanceof PluginBridge){ PluginBridge pluginBridge = (PluginBridge)file; /*Ignore on applet, ie !useJNLPHref*/ return !pluginBridge.useJNLPHref(); } return false;//Error is default behaviour } /** * Load all of the JARs used in this JNLP file into the * ResourceTracker for downloading. */ void initializeResources() throws LaunchException { if (file instanceof PluginBridge){ PluginBridge bridge = (PluginBridge)file; for (String codeBaseFolder : bridge.getCodeBaseFolders()){ try { addToCodeBaseLoader(new URL(file.getCodeBase(), codeBaseFolder)); } catch (MalformedURLException mfe) { OutputController.getLogger().log(OutputController.Level.WARNING_ALL, "Problem trying to add folder to code base:"); OutputController.getLogger().log(OutputController.Level.ERROR_ALL, mfe); } } } JARDesc jars[] = resources.getJARs(); if (jars.length == 0) { boolean allSigned = (loaders.length > 1) /* has extensions */; for (int i = 1; i < loaders.length; i++) { if (!loaders[i].getSigning()) { allSigned = false; break; } } if (allSigned) { signing = SigningState.FULL; } else { signing = SigningState.NONE; } //Check if main jar is found within extensions foundMainJar = foundMainJar || hasMainInExtensions(); setSecurity(); initializeManifestAttributesChecker(); mac.checkAll(); return; } List initialJars = new ArrayList<>(); for (JARDesc jar : jars) { available.add(jar); if (jar.isEager()) initialJars.add(jar); // regardless of part tracker.addResource(jar.getLocation(), jar.getVersion(), file.getDownloadOptions(), jar.isCacheable() ? JNLPRuntime.getDefaultUpdatePolicy() : UpdatePolicy.FORCE); } //If there are no eager jars, initialize the first jar if(initialJars.isEmpty()) { initialJars.add(jars[0]); } if (strict) { fillInPartJars(initialJars); // add in each initial part's lazy jars } waitForJars(initialJars); //download the jars first. //A ZipException will propagate later on if the jar is invalid and not checked here if (shouldFilterInvalidJars()){ //We filter any invalid jars Iterator iterator = initialJars.iterator(); while (iterator.hasNext()){ JARDesc jar = iterator.next(); if (isInvalidJar(jar)) { //Remove this jar as an available jar iterator.remove(); tracker.removeResource(jar.getLocation()); available.remove(jar); } } } if (JNLPRuntime.isVerifying()) { try { jcv.add(initialJars, tracker); } catch (Exception e) { //we caught an Exception from the JarCertVerifier class. //Note: one of these exceptions could be from not being able //to read the cacerts or trusted.certs files. OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); throw new LaunchException(null, null, R("LSFatal"), R("LCInit"), R("LFatalVerification"), R("LFatalVerificationInfo") + ": " +e.getMessage()); } //Case when at least one jar has some signing if (jcv.isFullySigned()) { signing = SigningState.FULL; // Check for main class in the downloaded jars, and check/verify signed JNLP fill checkForMain(initialJars); // If jar with main class was not found, check available resources while (!foundMainJar && available != null && !available.isEmpty()) addNextResource(); // If the jar with main class was not found, check extension // jnlp's resources foundMainJar = foundMainJar || hasMainInExtensions(); boolean externalAppletMainClass = (file.getLaunchInfo() != null && !foundMainJar && (available == null || available.isEmpty())); // We do this check here simply to ensure that if there are no JARs at all, // and also no main-class in the codebase (ie the applet doesn't really exist), we // fail ASAP rather than continuing (and showing the NotAllSigned dialog for no applet) if (externalAppletMainClass) { if (codeBaseLoader != null) { try { codeBaseLoader.findClass(mainClass); } catch (ClassNotFoundException extCnfe) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, extCnfe); throw new LaunchException(file, extCnfe, R("LSFatal"), R("LCInit"), R("LCantDetermineMainClass"), R("LCantDetermineMainClassInfo")); } } else { throw new LaunchException(file, null, R("LSFatal"), R("LCInit"), R("LCantDetermineMainClass"), R("LCantDetermineMainClassInfo")); } } // If externalAppletMainClass is true and a LaunchException was not thrown above, // then the main-class can be loaded from the applet codebase, but is obviously not signed if (externalAppletMainClass) { checkPartialSigningWithUser(); } // If main jar was found, but a signed JNLP file was not located if (!isSignedJNLP && foundMainJar) file.setSignedJNLPAsMissing(); //user does not trust this publisher if (!jcv.isTriviallySigned()) { checkTrustWithUser(); } else { /** * If the user trusts this publisher (i.e. the publisher's certificate * is in the user's trusted.certs file), we do not show any dialogs. */ } } else { // Otherwise this jar is simply unsigned -- make sure to ask // for permission on certain actions signing = SigningState.NONE; } } setSecurity(); final Set validJars = new HashSet<>(); boolean containsSignedJar = false, containsUnsignedJar = false; for (JARDesc jarDesc : file.getResources().getJARs()) { File cachedFile; try { cachedFile = tracker.getCacheFile(jarDesc.getLocation()); } catch (IllegalResourceDescriptorException irde) { //Caused by ignored resource being removed due to not being valid OutputController.getLogger().log(OutputController.Level.ERROR_ALL, "JAR " + jarDesc.getLocation() + " is not a valid jar file. Continuing."); continue; } if (cachedFile == null) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, "JAR " + jarDesc.getLocation() + " not found. Continuing."); continue; // JAR not found. Keep going. } validJars.add(jarDesc); final URL codebase = getJnlpFileCodebase(); final SecurityDesc jarSecurity = securityDelegate.getCodebaseSecurityDesc(jarDesc, codebase); if (jarSecurity.getSecurityType().equals(SecurityDesc.SANDBOX_PERMISSIONS)) { containsUnsignedJar = true; } else { containsSignedJar = true; } if (containsUnsignedJar && containsSignedJar) { signing = SigningState.PARTIAL; break; } } if (containsSignedJar && containsUnsignedJar) { checkPartialSigningWithUser(); } setSecurity(); initializeManifestAttributesChecker(); mac.checkAll(); for (JARDesc jarDesc : validJars) { final URL codebase = getJnlpFileCodebase(); final SecurityDesc jarSecurity = securityDelegate.getCodebaseSecurityDesc(jarDesc, codebase); jarLocationSecurityMap.put(jarDesc.getLocation(), jarSecurity); } activateJars(initialJars); } private void initializeManifestAttributesChecker() throws LaunchException { if (mac == null) { file.getManifestsAttributes().setLoader(this); mac = new ManifestAttributesChecker(security, file, signing, securityDelegate); } } private URL getJnlpFileCodebase() { final URL codebase; if (file.getCodeBase() != null) { codebase = file.getCodeBase(); } else { // FIXME: codebase should be the codebase of the Main Jar not // the location. Although, it still works in the current state. codebase = file.getResources().getMainJAR().getLocation(); } return codebase; } /*** * Checks for the jar that contains the attribute. * * @param jars Jars that are checked to see if they contain the main class * @param name attribute to be found * @return value of attribute if found */ public String checkForAttributeInJars(List jars, Attributes.Name name) { if (jars.isEmpty()) { return null; } // Check main jar JARDesc mainJarDesc = ResourcesDesc.getMainJAR(jars); String result = getManifestAttribute(mainJarDesc.getLocation(), name); if (result != null) { return result; } // Check first jar JARDesc firstJarDesc = jars.get(0); result = getManifestAttribute(firstJarDesc.getLocation(),name); if (result != null) { return result; } // Still not found? Iterate and set if only 1 was found for (JARDesc jarDesc: jars) { String attributeInThisJar = getManifestAttribute(jarDesc.getLocation(), name); if (attributeInThisJar != null) { if (result == null) { // first main class result = attributeInThisJar; } else { // There is more than one main class. Set to null and break. result = null; break; } } } return result; } /*** * Checks for the jar that contains the main class. If the main class was * found, it checks to see if the jar is signed and whether it contains a * signed JNLP file * * @param jars Jars that are checked to see if they contain the main class * @throws LaunchException Thrown if the signed JNLP file, within the main jar, fails to be verified or does not match */ void checkForMain(List jars) throws LaunchException { // Check launch info if (mainClass == null) { LaunchDesc launchDesc = file.getLaunchInfo(); if (launchDesc != null) { mainClass = launchDesc.getMainClass(); } } // The main class may be specified in the manifest if (mainClass == null) { mainClass = checkForAttributeInJars(jars, Attributes.Name.MAIN_CLASS); } String desiredJarEntryName = mainClass + ".class"; for (JARDesc jar : jars) { try { File localFile = tracker .getCacheFile(jar.getLocation()); if (localFile == null) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, "JAR " + jar.getLocation() + " not found. Continuing."); continue; // JAR not found. Keep going. } JarFile jarFile = new JarFile(localFile); for (JarEntry entry : Collections.list(jarFile.entries())) { String jeName = entry.getName().replaceAll("/", "."); if (jeName.equals(desiredJarEntryName)) { foundMainJar = true; verifySignedJNLP(jar, jarFile); break; } } jarFile.close(); } catch (IOException e) { /* * After this exception is caught, it is escaped. This will skip * the jarFile that may have thrown this exception and move on * to the next jarFile (if there are any) */ } } } /** * Gets the name of the main method if specified in the manifest * * @param location The JAR location * @return the main class name, null if there isn't one of if there was an error */ String getMainClassName(URL location) { return getManifestAttribute(location, Attributes.Name.MAIN_CLASS); } /** * Gets the name of the main method if specified in the manifest * * @param location The JAR location * @param attribute name of the attribute to find * @return the attribute value, null if there isn't one of if there was an error */ public String getManifestAttribute(URL location, Attributes.Name attribute) { String attributeValue = null; File f = tracker.getCacheFile(location); if( f != null) { JarFile mainJar = null; try { mainJar = new JarFile(f); Manifest manifest = mainJar.getManifest(); if (manifest == null || manifest.getMainAttributes() == null){ //yes, jars without manifest exists return null; } attributeValue = manifest.getMainAttributes().getValue(attribute); } catch (IOException ioe) { attributeValue = null; } finally { StreamUtils.closeSilently(mainJar); } } return attributeValue; } /** * @return true if this loader has the main jar */ public boolean hasMainJar() { return this.foundMainJar; } /** * Returns true if extension loaders have the main jar */ private boolean hasMainInExtensions() { boolean foundMain = false; for (int i = 1; i < loaders.length && !foundMain; i++) { foundMain = loaders[i].hasMainJar(); } return foundMain; } /** * Is called by checkForMain() to check if the jar file is signed and if it * contains a signed JNLP file. * * @param jarDesc JARDesc of jar * @param jarFile the jar file * @throws LaunchException thrown if the signed JNLP file, within the main jar, fails to be verified or does not match */ private void verifySignedJNLP(JARDesc jarDesc, JarFile jarFile) throws LaunchException { List desc = new ArrayList<>(); desc.add(jarDesc); try { // NOTE: verification should have happened by now. In other words, // calling jcv.verifyJars(desc, tracker) here should have no affect. if (jcv.isFullySigned()) { for (JarEntry je : Collections.list(jarFile.entries())) { String jeName = je.getName().toUpperCase(); if (jeName.equals(TEMPLATE) || jeName.equals(APPLICATION)) { OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "Creating Jar InputStream from JarEntry"); InputStream inStream = jarFile.getInputStream(je); OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "Creating File InputStream from lauching JNLP file"); JNLPFile jnlp = this.getJNLPFile(); File jn; // If the file is on the local file system, use original path, otherwise find cached file if (jnlp.getFileLocation().getProtocol().toLowerCase().equals("file")) { jn = new File(jnlp.getFileLocation().getPath()); } else { jn = CacheUtil.getCacheFile(jnlp.getFileLocation(), null); } InputStream jnlpStream = new FileInputStream(jn); JNLPMatcher matcher; if (jeName.equals(APPLICATION)) { // If signed application was found OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "APPLICATION.JNLP has been located within signed JAR. Starting verfication..."); matcher = new JNLPMatcher(inStream, jnlpStream, false, jnlp.getParserSettings()); } else { // Otherwise template was found OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "APPLICATION_TEMPLATE.JNLP has been located within signed JAR. Starting verfication..."); matcher = new JNLPMatcher(inStream, jnlpStream, true, jnlp.getParserSettings()); } // If signed JNLP file does not matches launching JNLP file, throw JNLPMatcherException if (!matcher.isMatch()) throw new JNLPMatcherException("Signed Application did not match launching JNLP File"); this.isSignedJNLP = true; OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "Signed Application Verification Successful"); break; } } } } catch (JNLPMatcherException e) { /* * Throws LaunchException if signed JNLP file fails to be verified * or fails to match the launching JNLP file */ throw new LaunchException(file, null, R("LSFatal"), R("LCClient"), R("LSignedJNLPFileDidNotMatch"), R(e.getMessage())); /* * Throwing this exception will fail to initialize the application * resulting in the termination of the application */ } catch (Exception e) { OutputController.getLogger().log(e); /* * After this exception is caught, it is escaped. If an exception is * thrown while handling the jar file, (mainly for * JarCertVerifier.add) it assumes the jar file is unsigned and * skip the check for a signed JNLP file */ } OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "Ending check for signed JNLP file..."); } /** * Prompt the user for trust on all the signers that require approval. * @throws LaunchException if the user does not approve every dialog prompt. */ private void checkTrustWithUser() throws LaunchException { if (JNLPRuntime.isTrustNone()) { if (!securityDelegate.getRunInSandbox()) { setRunInSandbox(); } return; } if (JNLPRuntime.isTrustAll() || securityDelegate.getRunInSandbox()) { return; } if (getSigningState() == SigningState.FULL && jcv.isFullySigned() && !jcv.getAlreadyTrustPublisher()) { jcv.checkTrustWithUser(securityDelegate, file); } } /* * Sets whether applets are to be run sandboxed, regardless of JAR * signing. This MUST be called before any call to initializeResources, * setSecurity, activateJars, or any other method that sets the value * of this.security or adds entries into this.jarLocationSecurityMap. * @throws LaunchException if security settings have been initialized before * this method is called */ public void setRunInSandbox() throws LaunchException { securityDelegate.setRunInSandbox(); } public boolean userPromptedForSandbox() { return securityDelegate.getRunInSandbox(); } /** * Add applet's codebase URL. This allows compatibility with * applets that load resources from their codebase instead of * through JARs, but can slow down resource loading. Resources * loaded from the codebase are not cached. */ public void enableCodeBase() { addToCodeBaseLoader(file.getCodeBase()); } /** * Sets the JNLP app this group is for; can only be called once. * @param app application to be ser to this group */ public void setApplication(ApplicationInstance app) { if (this.app != null) { OutputController.getLogger().log(new IllegalStateException("Application can only be set once")); return; } this.app = app; } /** * @return the JNLP app for this classloader */ public ApplicationInstance getApplication() { return app; } /** * @return the JNLP file the classloader was created from. */ public JNLPFile getJNLPFile() { return file; } /** * Returns the permissions for the CodeSource. */ @Override protected PermissionCollection getPermissions(CodeSource cs) { try { Permissions result = new Permissions(); // should check for extensions or boot, automatically give all // access w/o security dialog once we actually check certificates. // copy security permissions from SecurityDesc element if (security != null) { // Security desc. is used only to track security settings for the // application. However, an application may comprise of multiple // jars, and as such, security must be evaluated on a per jar basis. // set default perms PermissionCollection permissions = security.getSandBoxPermissions(); // If more than default is needed: // 1. Code must be signed // 2. ALL or J2EE permissions must be requested (note: plugin requests ALL automatically) if (cs == null) { throw new NullPointerException("Code source was null"); } if (cs.getCodeSigners() != null) { if (cs.getLocation() == null) { throw new NullPointerException("Code source location was null"); } if (getCodeSourceSecurity(cs.getLocation()) == null) { throw new NullPointerException("Code source security was null"); } if (getCodeSourceSecurity(cs.getLocation()).getSecurityType() == null) { OutputController.getLogger().log(new NullPointerException("Warning! Code source security type was null")); } Object securityType = getCodeSourceSecurity(cs.getLocation()).getSecurityType(); if (SecurityDesc.ALL_PERMISSIONS.equals(securityType) || SecurityDesc.J2EE_PERMISSIONS.equals(securityType)) { permissions = getCodeSourceSecurity(cs.getLocation()).getPermissions(cs); } } for (Permission perm : Collections.list(permissions.elements())) { result.add(perm); } } // add in permission to read the cached JAR files for (Permission perm : resourcePermissions) { result.add(perm); } // add in the permissions that the user granted. for (Permission perm : runtimePermissions) { result.add(perm); } // Class from host X should be allowed to connect to host X if (cs.getLocation() != null && cs.getLocation().getHost().length() > 0) result.add(new SocketPermission(UrlUtils.getHostAndPort(cs.getLocation()), "connect, accept")); return result; } catch (RuntimeException ex) { OutputController.getLogger().log(ex); throw ex; } } protected void addPermission(Permission p) { runtimePermissions.add(p); } /** * Adds to the specified list of JARS any other JARs that need * to be loaded at the same time as the JARs specified (ie, are * in the same part). * @param jars jar archives to be added */ protected void fillInPartJars(List jars) { //can not use iterator, will rise ConcurrentModificationException on jars.add(jar); for (int x = 0 ; x< jars.size() ; x++) { String part = jars.get(x).getPart(); // "available" field can be affected by two different threads // working in loadClass(String) synchronized (available) { for (JARDesc jar : available) { if (part != null && part.equals(jar.getPart())) if (!jars.contains(jar)) jars.add(jar); } } } } /** * Ensures that the list of jars have all been transferred, and * makes them available to the classloader. If a jar contains * native code, the libraries will be extracted and placed in * the path. * * @param jars the list of jars to load */ protected void activateJars(final List jars) { PrivilegedAction activate = new PrivilegedAction() { @SuppressWarnings("deprecation") @Override public Void run() { // transfer the Jars waitForJars(jars); for (JARDesc jar : jars) { available.remove(jar); // add jar File localFile = tracker.getCacheFile(jar.getLocation()); try { URL location = jar.getLocation(); // non-cacheable, use source location if (localFile != null) { // TODO: Should be toURI().toURL() location = localFile.toURL(); // cached file // This is really not the best way.. but we need some way for // PluginAppletViewer::getCachedImageRef() to check if the image // is available locally, and it cannot use getResources() because // that prefetches the resource, which confuses MediaTracker.waitForAll() // which does a wait(), waiting for notification (presumably // thrown after a resource is fetched). This bug manifests itself // particularly when using The FileManager applet from Webmin. try (JarFile jarFile = new JarFile(localFile)) { for (JarEntry je : Collections.list(jarFile.entries())) { // another jar in my jar? it is more likely than you think if (je.getName().endsWith(".jar")) { // We need to extract that jar so that it can be loaded // (inline loading with "jar:..!/..." path will not work // with standard classloader methods) String extractedJarLocation = localFile.getParent() + "/" + je.getName(); File parentDir = new File(extractedJarLocation).getParentFile(); if (!parentDir.isDirectory() && !parentDir.mkdirs()) { throw new RuntimeException(R("RNestedJarExtration")); } FileOutputStream extractedJar = new FileOutputStream(extractedJarLocation); InputStream is = jarFile.getInputStream(je); byte[] bytes = new byte[1024]; int read = is.read(bytes); int fileSize = read; while (read > 0) { extractedJar.write(bytes, 0, read); read = is.read(bytes); fileSize += read; } is.close(); extractedJar.close(); // 0 byte file? skip if (fileSize <= 0) { continue; } tracker.addResource(new File(extractedJarLocation).toURL(), null, null, null); URL codebase = file.getCodeBase(); if (codebase == null) { //FIXME: codebase should be the codebase of the Main Jar not //the location. Although, it still works in the current state. codebase = file.getResources().getMainJAR().getLocation(); } final SecurityDesc jarSecurity = securityDelegate.getJarPermissions(codebase); try { URL fileURL = new URL("file://" + extractedJarLocation); // there is no remote URL for this, so lets fake one URL fakeRemote = new URL(jar.getLocation().toString() + "!" + je.getName()); CachedJarFileCallback.getInstance().addMapping(fakeRemote, fileURL); addURL(fakeRemote); jarLocationSecurityMap.put(fakeRemote, jarSecurity); } catch (MalformedURLException mfue) { OutputController.getLogger().log(OutputController.Level.WARNING_DEBUG, "Unable to add extracted nested jar to classpath"); OutputController.getLogger().log(OutputController.Level.ERROR_ALL, mfue); } } jarEntries.add(je.getName()); } } } addURL(jar.getLocation()); // there is currently no mechanism to cache files per // instance.. so only index cached files if (localFile != null) { CachedJarFileCallback.getInstance().addMapping(jar.getLocation(), localFile.toURL()); try (JarFile jarFile = new JarFile(localFile.getAbsolutePath())) { Manifest mf = jarFile.getManifest(); // Only check classpath if this is the plugin and there is no jnlp_href usage. // Note that this is different from proprietary plugin behaviour. // If jnlp_href is used, the app should be treated similarly to when // it is run from javaws as a webstart. if (file instanceof PluginBridge && !((PluginBridge) file).useJNLPHref()) { classpaths.addAll(getClassPathsFromManifest(mf, jar.getLocation().getPath())); } JarIndex index = JarIndex.getJarIndex(jarFile, null); if (index != null) jarIndexes.add(index); } } else { CachedJarFileCallback.getInstance().addMapping(jar.getLocation(), jar.getLocation()); } OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "Activate jar: " + location); } catch (Exception ex) { OutputController.getLogger().log(ex); } // some programs place a native library in any jar nativeLibraryStorage.addSearchJar(jar.getLocation()); } return null; } }; AccessController.doPrivileged(activate, acc); } /** * Return the absolute path to the native library. */ protected String findLibrary(String lib) { String syslib = System.mapLibraryName(lib); File libFile = nativeLibraryStorage.findLibrary(syslib); if (libFile != null) { return libFile.toString(); } String result = super.findLibrary(lib); if (result != null) return result; return findLibraryExt(lib); } /** * Try to find the library path from another peer classloader. * @param lib library to be found * @return location of library */ protected String findLibraryExt(String lib) { for (JNLPClassLoader loader : loaders) { String result = null; if (loader != this) result = loader.findLibrary(lib); if (result != null) return result; } return null; } /** * Wait for a group of JARs, and send download events if there * is a download listener or display a progress window otherwise. * * @param jars the jars */ private void waitForJars(List jars) { URL urls[] = new URL[jars.size()]; for (int i = 0; i < jars.size(); i++) { JARDesc jar = jars.get(i); urls[i] = jar.getLocation(); } CacheUtil.waitForResources(app, tracker, urls, file.getTitle()); } /** * Find the loaded class in this loader or any of its extension loaders. * @param name name of class * @return the class found by name */ protected Class findLoadedClassAll(String name) { for (JNLPClassLoader loader : loaders) { Class result; if (loader == this) { result = JNLPClassLoader.super.findLoadedClass(name); } else { result = loader.findLoadedClassAll(name); } if (result != null) return result; } // Result is still null. Return what the codebaseloader // has (which returns null if it is not loaded there either) if (codeBaseLoader != null) return codeBaseLoader.findLoadedClassFromParent(name); else return null; } /** * Find a JAR in the shared 'extension' classloaders, this * classloader, or one of the classloaders for the JNLP file's * extensions. * This method used to be qualified "synchronized." This was done solely for the * purpose of ensuring only one thread entered the method at a time. This was not * strictly necessary - ensuring that all affected fields are thread-safe is * sufficient. Locking on the JNLPClassLoader instance when this method is called * can result in deadlock if another thread is dealing with the CodebaseClassLoader * at the same time. This solution is very heavy-handed as the instance lock is not * truly required, and taking the lock on the classloader instance when not needed is * not in general a good idea because it can and will lead to deadlock when multithreaded * classloading is in effect. The solution is to keep the fields thread safe on their own. * This is accomplished by wrapping them in Collections.synchronized* to provide * atomic add/remove operations, and synchronizing on them when iterating or performing * multiple mutations. * See bug report RH976833. On some systems this bug will manifest itself as deadlock on * every webpage with more than one Java applet, potentially also causing the browser * process to hang. * More information in the mailing list archives: * http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2013-September/024536.html * * Affected fields: available, classpaths, jarIndexes, jarEntries, jarLocationSecurityMap */ @Override public Class loadClass(String name) throws ClassNotFoundException { Class result = findLoadedClassAll(name); // try parent classloader if (result == null) { try { ClassLoader parent = getParent(); if (parent == null) parent = ClassLoader.getSystemClassLoader(); return parent.loadClass(name); } catch (ClassNotFoundException ex) { } } // filter out 'bad' package names like java, javax // validPackage(name); // search this and the extension loaders if (result == null) { try { result = loadClassExt(name); } catch (ClassNotFoundException cnfe) { // Not found in external loader either // Look in 'Class-Path' as specified in the manifest file try { // This field synchronized before iterating over it since it may // be shared data between threads synchronized (classpaths) { for (String classpath : classpaths) { JARDesc desc; try { URL jarUrl = new URL(file.getCodeBase(), classpath); desc = new JARDesc(jarUrl, null, null, false, true, false, true); } catch (MalformedURLException mfe) { throw new ClassNotFoundException(name, mfe); } addNewJar(desc); } } result = loadClassExt(name); return result; } catch (ClassNotFoundException cnfe1) { OutputController.getLogger().log(cnfe1); } // As a last resort, look in any available indexes // Currently this loads jars directly from the site. We cannot cache it because this // call is initiated from within the applet, which does not have disk read/write permissions // This field synchronized before iterating over it since it may // be shared data between threads synchronized (jarIndexes) { for (JarIndex index : jarIndexes) { // Non-generic code in sun.misc.JarIndex @SuppressWarnings("unchecked") LinkedList jarList = index.get(name.replace('.', '/')); if (jarList != null) { for (String jarName : jarList) { JARDesc desc; try { desc = new JARDesc(new URL(file.getCodeBase(), jarName), null, null, false, true, false, true); } catch (MalformedURLException mfe) { throw new ClassNotFoundException(name); } try { addNewJar(desc); } catch (Exception e) { OutputController.getLogger().log(e); } } // If it still fails, let it error out result = loadClassExt(name); } } } } } if (result == null) { throw new ClassNotFoundException(name); } return result; } /** * Adds a new JARDesc into this classloader. *

    * This will add the JARDesc into the resourceTracker and block until it * is downloaded. *

    * @param desc the JARDesc for the new jar */ private void addNewJar(final JARDesc desc) { this.addNewJar(desc, JNLPRuntime.getDefaultUpdatePolicy()); } /** * Adds a new JARDesc into this classloader. * @param desc the JARDesc for the new jar * @param updatePolicy the UpdatePolicy for the resource */ private void addNewJar(final JARDesc desc, UpdatePolicy updatePolicy) { available.add(desc); tracker.addResource(desc.getLocation(), desc.getVersion(), null, updatePolicy ); // Give read permissions to the cached jar file AccessController.doPrivileged(new PrivilegedAction() { @Override public Void run() { Permission p = CacheUtil.getReadPermission(desc.getLocation(), desc.getVersion()); resourcePermissions.add(p); return null; } }); final URL remoteURL = desc.getLocation(); final URL cachedUrl = tracker.getCacheURL(remoteURL); // blocks till download available.remove(desc); // Resource downloaded. Remove from available list. try { // Verify if needed final List jars = new ArrayList<>(); jars.add(desc); // Decide what level of security this jar should have // The verification and security setting functions rely on // having AllPermissions as those actions normally happen // during initialization. We therefore need to do those // actions as privileged. AccessController.doPrivileged(new PrivilegedExceptionAction() { @Override public Void run() throws Exception { jcv.add(jars, tracker); checkTrustWithUser(); final SecurityDesc security = securityDelegate.getJarPermissions(file.getCodeBase()); jarLocationSecurityMap.put(remoteURL, security); return null; } }); addURL(remoteURL); CachedJarFileCallback.getInstance().addMapping(remoteURL, cachedUrl); } catch (Exception e) { // Do nothing. This code is called by loadClass which cannot // throw additional exceptions. So instead, just ignore it. // Exception => jar will not get added to classpath, which will // result in CNFE from loadClass. OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); } } /** * Find the class in this loader or any of its extension loaders. */ @Override protected Class findClass(String name) throws ClassNotFoundException { for (JNLPClassLoader loader : loaders) { try { if (loader == this) { final String fName = name; return AccessController.doPrivileged( new PrivilegedExceptionAction>() { @Override public Class run() throws ClassNotFoundException { return JNLPClassLoader.super.findClass(fName); } }, getAccessControlContextForClassLoading()); } else { return loader.findClass(name); } } catch (ClassNotFoundException | PrivilegedActionException ex) { } catch (ClassFormatError cfe) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, cfe); } catch (NullJnlpFileException ex) { throw new ClassNotFoundException(this.mainClass + " in main classloader ", ex); } } // Try codebase loader if (codeBaseLoader != null) return codeBaseLoader.findClassNonRecursive(name); // All else failed. Throw CNFE throw new ClassNotFoundException(name); } /** * Search for the class by incrementally adding resources to the * classloader and its extension classloaders until the resource * is found. */ private Class loadClassExt(String name) throws ClassNotFoundException { // make recursive addAvailable(); // find it try { return findClass(name); } catch (ClassNotFoundException ex) { } // add resources until found while (true) { JNLPClassLoader addedTo = null; try { addedTo = addNextResource(); } catch (LaunchException e) { /* * This method will never handle any search for the main class * [It is handled in initializeResources()]. Therefore, this * exception will never be thrown here and is escaped */ throw new IllegalStateException(e); } if (addedTo == null) throw new ClassNotFoundException(name); try { return addedTo.findClass(name); } catch (ClassNotFoundException ex) { } } } /** * Finds the resource in this, the parent, or the extension * class loaders. * * @return a {@link URL} for the resource, or {@code null} * if the resource could not be found. */ @Override public URL findResource(String name) { URL result = null; try { Enumeration e = findResources(name); if (e.hasMoreElements()) { result = e.nextElement(); } } catch (IOException e) { OutputController.getLogger().log(e); } // If result is still null, look in the codebase loader if (result == null && codeBaseLoader != null) result = codeBaseLoader.findResource(name); return result; } /** * Find the resources in this, the parent, or the extension * class loaders. Load lazy resources if not found in current resources. */ @Override public Enumeration findResources(String name) throws IOException { Enumeration lresources = findResourcesBySearching(name); try { // if not found, load all lazy resources; repeat search while (!lresources.hasMoreElements() && addNextResource() != null) { lresources = findResourcesBySearching(name); } } catch (LaunchException le) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, le); } return lresources; } /** * Find the resources in this, the parent, or the extension * class loaders. */ private Enumeration findResourcesBySearching(String name) throws IOException { List lresources = new ArrayList<>(); Enumeration e = null; for (JNLPClassLoader loader : loaders) { // TODO check if this will blow up or not // if loaders[1].getResource() is called, wont it call getResource() on // the original caller? infinite recursion? if (loader == this) { final String fName = name; try { e = AccessController.doPrivileged( new PrivilegedExceptionAction>() { @Override public Enumeration run() throws IOException { return JNLPClassLoader.super.findResources(fName); } }, getAccessControlContextForClassLoading()); } catch (PrivilegedActionException pae) { } } else { e = loader.findResources(name); } final Enumeration fURLEnum = e; try { lresources.addAll(AccessController.doPrivileged( new PrivilegedExceptionAction>() { @Override public Collection run() { List resources = new ArrayList<>(); while (fURLEnum != null && fURLEnum.hasMoreElements()) { resources.add(fURLEnum.nextElement()); } return resources; } }, getAccessControlContextForClassLoading())); } catch (PrivilegedActionException pae) { } } // Add resources from codebase (only if nothing was found above, // otherwise the server will get hammered) if (lresources.isEmpty() && codeBaseLoader != null) { e = codeBaseLoader.findResources(name); while (e.hasMoreElements()) lresources.add(e.nextElement()); } return Collections.enumeration(lresources); } /** * Returns if the specified resource is available locally from a cached jar * * @param s The name of the resource * @return Whether or not the resource is available locally */ public boolean resourceAvailableLocally(String s) { return jarEntries.contains(s); } /** * Adds whatever resources have already been downloaded in the * background. */ protected void addAvailable() { // go through available, check tracker for it and all of its // part brothers being available immediately, add them. for (int i = 1; i < loaders.length; i++) { loaders[i].addAvailable(); } } /** * Adds the next unused resource to the classloader. That * resource and all those in the same part will be downloaded * and added to the classloader before returning. If there are * no more resources to add, the method returns immediately. * * @return the classloader that resources were added to, or null * @throws LaunchException Thrown if the signed JNLP file, within the main jar, fails to be verified or does not match */ protected JNLPClassLoader addNextResource() throws LaunchException { if (available.isEmpty()) { for (int i = 1; i < loaders.length; i++) { JNLPClassLoader result = loaders[i].addNextResource(); if (result != null) return result; } return null; } // add jar List jars = new ArrayList<>(); jars.add(available.get(0)); fillInPartJars(jars); checkForMain(jars); activateJars(jars); return this; } // this part compatibility with previous classloader /** * @return title if available. Substitutions if not. * @deprecated */ @Deprecated public String getExtensionName() { String result = file.getInformation().getTitle(); if (result == null) result = file.getInformation().getDescription(); if (result == null && file.getFileLocation() != null) result = file.getFileLocation().toString(); if (result == null && file.getCodeBase() != null) result = file.getCodeBase().toString(); return result; } /** * @return location if jnlp * @deprecated */ @Deprecated public String getExtensionHREF() { return file.getFileLocation().toString(); } public boolean getSigning() { return signing == SigningState.FULL; } /** * Call this when it's suspected that an applet's permission level may have * just changed from Full Signing to Partial Signing. * This will display a one-time prompt asking the user to confirm running * the partially signed applet. * Partially Signed applets always start off as appearing to be Fully * Signed, and then during the initialization or loading process, we find * that we actually need to demote the applet to Partial, either due to * finding that not all of its JARs are actually signed, or because it * needs to load something unsigned out of the codebase. */ private void checkPartialSigningWithUser() { if (signing == SigningState.FULL && JNLPRuntime.isVerifying()) { signing = SigningState.PARTIAL; try { securityDelegate.promptUserOnPartialSigning(); } catch (LaunchException e) { throw new RuntimeException("The signed applet required loading of unsigned code from the codebase, " + "which the user refused", e); } } } public SigningState getSigningState() { return signing; } protected SecurityDesc getSecurity() { return security; } /** * Returns the security descriptor for given code source URL * * @param source the origin (remote) url of the code * @return The SecurityDescriptor for that source */ protected SecurityDesc getCodeSourceSecurity(URL source) { SecurityDesc sec=jarLocationSecurityMap.get(source); synchronized (alreadyTried) { if (sec == null && !alreadyTried.contains(source)) { alreadyTried.add(source); //try to load the jar which is requesting the permissions, but was NOT downloaded by standard way OutputController.getLogger().log("Application is trying to get permissions for " + source.toString() + ", which was not added by standard way. Trying to download and verify!"); try { JARDesc des = new JARDesc(source, null, null, false, false, false, false); addNewJar(des); sec = jarLocationSecurityMap.get(source); } catch (Throwable t) { OutputController.getLogger().log(t); sec = null; } } } if (sec == null){ OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, Translator.R("LNoSecInstance",source.toString())); } return sec; } /** * Merges the code source/security descriptor mapping from another loader * * @param extLoader The loader form which to merge * @throws SecurityException if the code is called from an untrusted source */ private void merge(JNLPClassLoader extLoader) { try { System.getSecurityManager().checkPermission(new AllPermission()); } catch (SecurityException se) { throw new SecurityException("JNLPClassLoader() may only be called from trusted sources!"); } // jars for (URL u : extLoader.getURLs()) addURL(u); // Codebase addToCodeBaseLoader(extLoader.file.getCodeBase()); // native search paths for (File nativeDirectory : extLoader.nativeLibraryStorage.getSearchDirectories()) { nativeLibraryStorage.addSearchDirectory(nativeDirectory); } // security descriptors synchronized (jarLocationSecurityMap) { for (URL key : extLoader.jarLocationSecurityMap.keySet()) { jarLocationSecurityMap.put(key, extLoader.jarLocationSecurityMap.get(key)); } } } /** * Adds the given path to the path loader * * @param u the path to add * @throws IllegalArgumentException If the given url is not a path */ private void addToCodeBaseLoader(URL u) { if (u == null) { return; } // Only paths may be added if (!u.getFile().endsWith("/")) { throw new IllegalArgumentException("addToPathLoader only accepts path based URLs"); } // If there is no loader yet, create one, else add it to the // existing one (happens when called from merge()) if (codeBaseLoader == null) { codeBaseLoader = new CodeBaseClassLoader(new URL[] { u }, this); } else { codeBaseLoader.addURL(u); } } /** * Returns a set of paths that indicate the Class-Path entries in the * manifest file. The paths are rooted in the same directory as the * originalJarPath. * @param mf the manifest * @param originalJarPath the remote/original path of the jar containing * the manifest * @return a Set of String where each string is a path to the jar on * the original jar's classpath. */ private Set getClassPathsFromManifest(Manifest mf, String originalJarPath) { Set result = new HashSet<>(); if (mf != null) { // extract the Class-Path entries from the manifest and split them String classpath = mf.getMainAttributes().getValue("Class-Path"); if (classpath == null || classpath.trim().length() == 0) { return result; } String[] paths = classpath.split(" +"); for (String path : paths) { if (path.trim().length() == 0) { continue; } // we want to search for jars in the same subdir on the server // as the original jar that contains the manifest file, so find // out its subdirectory and use that as the dir String dir = ""; int lastSlash = originalJarPath.lastIndexOf("/"); if (lastSlash != -1) { dir = originalJarPath.substring(0, lastSlash + 1); } String fullPath = dir + path; result.add(fullPath); } } return result; } /** * Increments loader use count by 1 * * @throws SecurityException if caller is not trusted */ private void incrementLoaderUseCount() { // For use by trusted code only if (System.getSecurityManager() != null) System.getSecurityManager().checkPermission(new AllPermission()); // NB: There will only ever be one class-loader per unique-key synchronized ( getUniqueKeyLock(file.getUniqueKey()) ){ useCount++; } } /** * Returns all loaders that this loader uses, including itself */ JNLPClassLoader[] getLoaders() { return loaders; } /** * Remove jars from the file system. * * @param jars Jars marked for removal. */ void removeJars(JARDesc[] jars) { for (JARDesc eachJar : jars) { try { tracker.removeResource(eachJar.getLocation()); } catch (Exception e) { OutputController.getLogger().log(e); OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "Failed to remove resource from tracker, continuing.."); } File cachedFile = CacheUtil.getCacheFile(eachJar.getLocation(), null); String directoryUrl = CacheUtil.getCacheParentDirectory(cachedFile.getAbsolutePath()); File directory = new File(directoryUrl); OutputController.getLogger().log("Deleting cached file: " + cachedFile.getAbsolutePath()); cachedFile.delete(); OutputController.getLogger().log("Deleting cached directory: " + directory.getAbsolutePath()); directory.delete(); } } /** * Downloads and initializes jars into this loader. * * @param ref Path of the launch or extension JNLP File containing the * resource. If null, main JNLP's file location will be used instead. * @param part The name of the path. * @throws LaunchException */ void initializeNewJarDownload(URL ref, String part, Version version) { JARDesc[] jars = ManageJnlpResources.findJars(this, ref, part, version); for (JARDesc eachJar : jars) { OutputController.getLogger().log("Downloading and initializing jar: " + eachJar.getLocation().toString()); this.addNewJar(eachJar, UpdatePolicy.FORCE); } } /** * Manages DownloadService jars which are not mentioned in the JNLP file * @param ref Path to the resource. * @param version The version of resource. If null, no version is specified. * @param action The action to perform with the resource. Either DOWNLOADTOCACHE, REMOVEFROMCACHE, or CHECKCACHE. * @return true if CHECKCACHE and the resource is cached. */ boolean manageExternalJars(URL ref, String version, DownloadAction action) { boolean approved = false; JNLPClassLoader foundLoader = LocateJnlpClassLoader.getLoaderByResourceUrl(this, ref, version); Version resourceVersion = (version == null) ? null : new Version(version); if (foundLoader != null) approved = true; else if (ref.toString().startsWith(file.getNotNullProbalbeCodeBase().toString())) approved = true; else if (SecurityDesc.ALL_PERMISSIONS.equals(security.getSecurityType())) approved = true; if (approved) { if (foundLoader == null) foundLoader = this; if (action == DownloadAction.DOWNLOAD_TO_CACHE) { JARDesc jarToCache = new JARDesc(ref, resourceVersion, null, false, true, false, true); OutputController.getLogger().log("Downloading and initializing jar: " + ref.toString()); foundLoader.addNewJar(jarToCache, UpdatePolicy.FORCE); } else if (action == DownloadAction.REMOVE_FROM_CACHE) { JARDesc[] jarToRemove = { new JARDesc(ref, resourceVersion, null, false, true, false, true) }; foundLoader.removeJars(jarToRemove); } else if (action == DownloadAction.CHECK_CACHE) { return CacheUtil.isCached(ref, resourceVersion); } } return false; } /** * Decrements loader use count by 1 * * If count reaches 0, loader is removed from list of available loaders * * @throws SecurityException if caller is not trusted */ public void decrementLoaderUseCount() { // For use by trusted code only if (System.getSecurityManager() != null) System.getSecurityManager().checkPermission(new AllPermission()); String uniqueKey = file.getUniqueKey(); // NB: There will only ever be one class-loader per unique-key synchronized ( getUniqueKeyLock(uniqueKey) ) { useCount--; if (useCount <= 0) { uniqueKeyToLoader.remove(uniqueKey); } } } /** * Returns an appropriate AccessControlContext for loading classes in * the running instance. * * The default context during class-loading only allows connection to * codebase. However applets are allowed to load jars from arbitrary * locations and the codebase only access falls short if a class from * one location needs a class from another. * * Given protected access since CodeBaseClassloader uses this function too. * * @return The appropriate AccessControlContext for loading classes for this instance */ public AccessControlContext getAccessControlContextForClassLoading() { AccessControlContext context = AccessController.getContext(); try { context.checkPermission(new AllPermission()); return context; // If context already has all permissions, don't bother } catch (AccessControlException ace) { // continue below } // Since this is for class-loading, technically any class from one jar // should be able to access a class from another, therefore making the // original context code source irrelevant PermissionCollection permissions = this.security.getSandBoxPermissions(); // Local cache access permissions for (Permission resourcePermission : resourcePermissions) { permissions.add(resourcePermission); } // Permissions for all remote hosting urls synchronized (jarLocationSecurityMap) { for (URL u : jarLocationSecurityMap.keySet()) { permissions.add(new SocketPermission(UrlUtils.getHostAndPort(u), "connect, accept")); } } // Permissions for codebase urls (if there is a loader) if (codeBaseLoader != null) { for (URL u : codeBaseLoader.getURLs()) { permissions.add(new SocketPermission(UrlUtils.getHostAndPort(u), "connect, accept")); } } ProtectionDomain pd = new ProtectionDomain(null, permissions); return new AccessControlContext(new ProtectionDomain[] { pd }); } public String getMainClass() { return mainClass; } /** * SecurityDelegate, in real usage, relies on having a "parent" JNLPClassLoader instance. * However, JNLPClassLoaders are very large, heavyweight, difficult-to-mock objects, which * means that unit testing on anything that uses a SecurityDelegate can become very difficult. * For example, JarCertVerifier is designed separated from the ClassLoader so it can be tested * in isolation. However, JCV needs some sort of access back to JNLPClassLoader instances to * be able to invoke setRunInSandbox(). The SecurityDelegate handles this, allowing JCV to be * tested without instantiating JNLPClassLoaders, by creating a fake SecurityDelegate that does * not require one. */ public static interface SecurityDelegate { public boolean isPluginApplet(); public boolean userPromptedForPartialSigning(); public boolean userPromptedForSandbox(); public SecurityDesc getCodebaseSecurityDesc(final JARDesc jarDesc, final URL codebaseHost); public SecurityDesc getClassLoaderSecurity(final URL codebaseHost) throws LaunchException; public SecurityDesc getJarPermissions(final URL codebaseHost); public void promptUserOnPartialSigning() throws LaunchException; public void setRunInSandbox() throws LaunchException; public boolean getRunInSandbox(); public void addPermission(final Permission perm); public void addPermissions(final PermissionCollection perms); public void addPermissions(final Collection perms); } /** * Handles security decision logic for the JNLPClassLoader, eg which permission level to assign * to JARs. */ public static class SecurityDelegateImpl implements SecurityDelegate { private final JNLPClassLoader classLoader; private boolean runInSandbox; private boolean promptedForPartialSigning; private boolean promptedForSandbox; public SecurityDelegateImpl(final JNLPClassLoader classLoader) { this.classLoader = classLoader; runInSandbox = false; promptedForSandbox = false; } @Override public boolean isPluginApplet() { return classLoader.file instanceof PluginBridge; } @Override public SecurityDesc getCodebaseSecurityDesc(final JARDesc jarDesc, final URL codebaseHost) { if (runInSandbox) { return new SecurityDesc(classLoader.file, SecurityDesc.SANDBOX_PERMISSIONS, codebaseHost); } else { if (isPluginApplet()) { try { if (JarCertVerifier.isJarSigned(jarDesc, new PluginAppVerifier(), classLoader.tracker)) { return new SecurityDesc(classLoader.file, SecurityDesc.ALL_PERMISSIONS, codebaseHost); } else { return new SecurityDesc(classLoader.file, SecurityDesc.SANDBOX_PERMISSIONS, codebaseHost); } } catch (final Exception e) { OutputController.getLogger().log(e); return new SecurityDesc(classLoader.file, SecurityDesc.SANDBOX_PERMISSIONS, codebaseHost); } } else { return classLoader.file.getSecurity(); } } } @Override public SecurityDesc getClassLoaderSecurity(final URL codebaseHost) throws LaunchException { if (isPluginApplet()) { if (!runInSandbox && classLoader.getSigning()) { return new SecurityDesc(classLoader.file, SecurityDesc.ALL_PERMISSIONS, codebaseHost); } else { return new SecurityDesc(classLoader.file, SecurityDesc.SANDBOX_PERMISSIONS, codebaseHost); } } else { /* * Various combinations of the jars being signed and tags being * present are possible. They are treated as follows * * Jars JNLP File Result * * Signed Appropriate Permissions * Signed no Sandbox * Unsigned Error * Unsigned no Sandbox * */ if (!runInSandbox && !classLoader.getSigning() && !classLoader.file.getSecurity().getSecurityType().equals(SecurityDesc.SANDBOX_PERMISSIONS)) { if (classLoader.jcv.allJarsSigned()) { throw new LaunchException(classLoader.file, null, R("LSFatal"), R("LCClient"), R("LSignedJNLPAppDifferentCerts"), R("LSignedJNLPAppDifferentCertsInfo")); } else { throw new LaunchException(classLoader.file, null, R("LSFatal"), R("LCClient"), R("LUnsignedJarWithSecurity"), R("LUnsignedJarWithSecurityInfo")); } } else if (!runInSandbox && classLoader.getSigning()) { return classLoader.file.getSecurity(); } else { return new SecurityDesc(classLoader.file, SecurityDesc.SANDBOX_PERMISSIONS, codebaseHost); } } } @Override public SecurityDesc getJarPermissions(final URL codebaseHost) { if (!runInSandbox && classLoader.jcv.isFullySigned()) { // Already trust application, nested jar should be given return new SecurityDesc(classLoader.file, SecurityDesc.ALL_PERMISSIONS, codebaseHost); } else { return new SecurityDesc(classLoader.file, SecurityDesc.SANDBOX_PERMISSIONS, codebaseHost); } } @Override public void setRunInSandbox() throws LaunchException { if (runInSandbox && classLoader.security != null && !classLoader.jarLocationSecurityMap.isEmpty()) { throw new LaunchException(classLoader.file, null, R("LSFatal"), R("LCInit"), R("LRunInSandboxError"), R("LRunInSandboxErrorInfo")); } JNLPRuntime.reloadPolicy(); // ensure that we have the most up-to-date custom policy loaded since the user may have just launched PolicyEditor // to create a custom policy for the applet they are about to run this.promptedForSandbox = true; this.runInSandbox = true; } @Override public void promptUserOnPartialSigning() throws LaunchException { if (promptedForPartialSigning || JNLPRuntime.isTrustAll()) { return; } promptedForPartialSigning = true; UnsignedAppletTrustConfirmation.checkPartiallySignedWithUserIfRequired(this, classLoader.file, classLoader.jcv); } @Override public boolean getRunInSandbox() { return this.runInSandbox; } @Override public boolean userPromptedForPartialSigning() { return this.promptedForPartialSigning; } @Override public boolean userPromptedForSandbox() { return this.promptedForSandbox; } @Override public void addPermission(final Permission perm) { classLoader.addPermission(perm); } @Override public void addPermissions(final PermissionCollection perms) { Enumeration e = perms.elements(); while (e.hasMoreElements()) { addPermission(e.nextElement()); } } @Override public void addPermissions(final Collection perms) { for (final Permission perm : perms) { addPermission(perm); } } } /* * Helper class to expose protected URLClassLoader methods. * Classes loaded from the codebase are absolutely NOT signed, by definition! * If the CodeBaseClassLoader is used to load any classes in JNLPClassLoader, * then you *MUST* check if the JNLPClassLoader is set to FULL signing. If so, * then it must be set instead to PARTIAL, and the user prompted if it is okay * to proceed. If the JNLPClassLoader is already PARTIAL or NONE signing, then * nothing must be done. This is required so that we can support partial signing * of applets but also ensure that using codebase loading in conjunction with * signed JARs still results in the user having to confirm that this is * acceptable. */ public static class CodeBaseClassLoader extends URLClassLoader { JNLPClassLoader parentJNLPClassLoader; /** * Classes that are not found, so that findClass can skip them next time */ ConcurrentHashMap notFoundResources = new ConcurrentHashMap(); public CodeBaseClassLoader(URL[] urls, JNLPClassLoader cl) { super(urls, cl); parentJNLPClassLoader = cl; } @Override public void addURL(URL url) { super.addURL(url); } /* * Use with care! Check the class-level Javadoc before calling this. */ Class findClassNonRecursive(final String name) throws ClassNotFoundException { // If we have searched this path before, don't try again if (Arrays.equals(super.getURLs(), notFoundResources.get(name))) throw new ClassNotFoundException(name); try { return AccessController.doPrivileged( new PrivilegedExceptionAction>() { public Class run() throws ClassNotFoundException { Class c = CodeBaseClassLoader.super.findClass(name); parentJNLPClassLoader.checkPartialSigningWithUser(); return c; } }, parentJNLPClassLoader.getAccessControlContextForClassLoading()); } catch (PrivilegedActionException pae) { notFoundResources.put(name, super.getURLs()); throw new ClassNotFoundException("Could not find class " + name, pae); } catch (NullJnlpFileException njf) { notFoundResources.put(name, super.getURLs()); throw new ClassNotFoundException("Could not find class " + name, njf); } } /* * Use with care! Check the class-level Javadoc before calling this. */ @Override public Class findClass(String name) throws ClassNotFoundException { // Calls JNLPClassLoader#findClass which may call into this.findClassNonRecursive Class c = getParentJNLPClassLoader().findClass(name); parentJNLPClassLoader.checkPartialSigningWithUser(); return c; } /** * Returns the output of super.findLoadedClass(). * * The method is renamed because ClassLoader.findLoadedClass() is final * * @param name The name of the class to find * @return Output of ClassLoader.findLoadedClass() which is the class if found, null otherwise * @see java.lang.ClassLoader#findLoadedClass(String) */ public Class findLoadedClassFromParent(String name) { return findLoadedClass(name); } /** * Returns JNLPClassLoader that encompasses this loader * * @return parent JNLPClassLoader */ public JNLPClassLoader getParentJNLPClassLoader() { return parentJNLPClassLoader; } @Override public Enumeration findResources(String name) throws IOException { // If we have searched this path before, don't try again if (Arrays.equals(super.getURLs(), notFoundResources.get(name))) return (new Vector(0)).elements(); if (!name.startsWith("META-INF")) { Enumeration urls = super.findResources(name); if (!urls.hasMoreElements()) { notFoundResources.put(name, super.getURLs()); } return urls; } return (new Vector(0)).elements(); } @Override public URL findResource(String name) { // If we have searched this path before, don't try again if (Arrays.equals(super.getURLs(), notFoundResources.get(name))) return null; URL url = null; if (!name.startsWith("META-INF")) { try { final String fName = name; url = AccessController.doPrivileged( new PrivilegedExceptionAction() { public URL run() { return CodeBaseClassLoader.super.findResource(fName); } }, parentJNLPClassLoader.getAccessControlContextForClassLoading()); } catch (PrivilegedActionException pae) { } if (url == null) { notFoundResources.put(name, super.getURLs()); } return url; } return null; } } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/runtime/PaxHeaders.17941/HtmlBoot.java0000644000000000000000000000013112654402377024554 xustar0030 mtime=1454507263.294431821 30 atime=1454507327.139580337 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/runtime/HtmlBoot.java0000644000175000002070000001734512654402377025312 0ustar00jvanekmock00000000000000/* 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 */ package net.sourceforge.jnlp.runtime; import java.awt.Point; import java.awt.Rectangle; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.net.URL; import java.util.List; import java.util.Map; import javax.swing.JFrame; import javax.swing.SwingUtilities; import net.sourceforge.jnlp.JNLPSplashScreen; import net.sourceforge.jnlp.OptionsDefinitions; import net.sourceforge.jnlp.ParserSettings; import net.sourceforge.jnlp.PluginBridge; import net.sourceforge.jnlp.runtime.html.AppletExtractor; import net.sourceforge.jnlp.runtime.html.AppletParser; import net.sourceforge.jnlp.runtime.html.AppletsFilter; import net.sourceforge.jnlp.util.ScreenFinder; import net.sourceforge.jnlp.util.logging.OutputController; import static net.sourceforge.jnlp.runtime.Translator.R; import net.sourceforge.jnlp.util.optionparser.OptionParser; public final class HtmlBoot { private final OptionParser optionParser; public HtmlBoot(OptionParser optionParser) { this.optionParser = optionParser; } private JFrame invokePluginMain(PluginBridge pb, URL html) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { Class c = Class.forName("sun.applet.PluginMain"); Method m = c.getMethod("javawsHtmlMain", PluginBridge.class, URL.class); return (JFrame) m.invoke(null, pb, html); } private static void changeMovement(int[] move) { if (move[0] > 0) { if (move[0] % 2 == 0) { move[1] += 100; } else { move[2] += 100; } } } private Point changeMovementSigns(int[] move) { int x = move[1]; int y = move[2]; switch (move[0] % 4) { case 0: x = -x; y = y; break; case 1: x = x; y = y; break; case 2: x = x; y = -y; break; case 3: x = -x; y = -y; break; } return new Point(x, y); } private JNLPSplashScreen splashScreen; boolean run(Map> extra) { if (!optionParser.hasOption(OptionsDefinitions.OPTIONS.HEADLESS)) { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { splashScreen = new JNLPSplashScreen(null, null); splashScreen.setSplashImageURL(null); splashScreen.setVisible(true); } ; } ); } List vars = optionParser.getParams(OptionsDefinitions.OPTIONS.HTML); JNLPRuntime.setForksAllowed(false);//needed? ParserSettings settings = Boot.init(extra); if (settings == null) { return false; } try { OutputController.getLogger().log("Proceeding with html"); final URL html = Boot.getFileLocation(); AppletExtractor axe = new AppletExtractor(html, settings); AppletsFilter filtered = new AppletsFilter(axe.findAppletsOnPage(), html, vars.subList(1, vars.size())); List applets = filtered.getApplets(); // this hack was needed in early phases of the patch. Now it sees to be not neede. Keeping inside to remove after much more testing // will be replaced by regular JNLPRuntime is initialised // System.setSecurityManager(new SecurityManager() { // // @Override // public void checkPermission(Permission perm) { // // // } // // }); final int[] move = new int[]{0, 0, 0}; for (AppletParser appletParser : applets) { //place the applets correctly over screen changeMovement(move); final PluginBridge pb = appletParser.toPluginBridge(); if (splashScreen != null) { splashScreen.setFile(pb); } final JFrame f = invokePluginMain(pb, html); //close all applets in time f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //f.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); SwingUtilities.invokeLater(new Runnable() { @Override public void run() { Point movement = changeMovementSigns(move); f.pack(); ScreenFinder.centerWindowsToCurrentScreen(f); Rectangle r = f.getBounds(); r.x += movement.x; r.y += movement.y; f.setBounds(r); f.setVisible(true); } }); move[0]++; } if (splashScreen != null) { splashScreen.stopAnimation(); splashScreen.setVisible(false); splashScreen.dispose(); } } catch (final Exception ex) { OutputController.getLogger().log(ex); if (splashScreen != null) { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { splashScreen.setErrorSplash(ex); splashScreen.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); splashScreen.addWindowListener(new WindowAdapter() { @Override public void windowClosed(WindowEvent e) { Boot.fatalError(R("RUnexpected", ex.toString(), ex.getStackTrace()[0])); } }); } }); } else { Boot.fatalError(R("RUnexpected", ex.toString(), ex.getStackTrace()[0])); } } return true; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/runtime/PaxHeaders.17941/FakePacEvaluator.java0000644000000000000000000000013112654402377026201 xustar0030 mtime=1454507263.294431821 30 atime=1454507327.139580337 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/runtime/FakePacEvaluator.java0000644000175000002070000000412512654402377026727 0ustar00jvanekmock00000000000000/* FakePacEvaluator.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.runtime; import static net.sourceforge.jnlp.runtime.Translator.R; import java.net.URL; import net.sourceforge.jnlp.util.logging.OutputController; /** * A dummy PacEvaluator that always returns "DIRECT" */ public class FakePacEvaluator implements PacEvaluator { @Override public String getProxies(URL url) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, R("RPRoxyPacNotSupported")); return "DIRECT"; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/runtime/PaxHeaders.17941/CachedJarFileCallback.java0000644000000000000000000000013112654402377027045 xustar0030 mtime=1454507263.294431821 30 atime=1454507327.139580337 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/runtime/CachedJarFileCallback.java0000644000175000002070000001533412654402377027577 0ustar00jvanekmock00000000000000/* CachedJarFileCallback.java Copyright (C) 2011 Red Hat, Inc. Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.runtime; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.URL; import java.net.URLConnection; import java.security.AccessController; import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import net.sourceforge.jnlp.security.ConnectionFactory; import net.sourceforge.jnlp.util.logging.OutputController; import net.sourceforge.jnlp.util.JarFile; import net.sourceforge.jnlp.util.UrlUtils; import sun.net.www.protocol.jar.URLJarFile; import sun.net.www.protocol.jar.URLJarFileCallBack; /** * Invoked by URLJarFile to get a JarFile corresponding to a URL. * * Large parts of this class are based on JarFileFactory and URLJarFile. */ final class CachedJarFileCallback implements URLJarFileCallBack { private static final CachedJarFileCallback INSTANCE = new CachedJarFileCallback(); public synchronized static CachedJarFileCallback getInstance() { return INSTANCE; } /* our managed cache */ private final Map mapping; private CachedJarFileCallback() { mapping = new ConcurrentHashMap(); } protected void addMapping(URL remoteUrl, URL localUrl) { mapping.put(remoteUrl, localUrl); } @Override public java.util.jar.JarFile retrieve(URL url) throws IOException { URL localUrl = mapping.get(url); if (localUrl == null) { /* * If the jar url is not known, treat it as it would be treated in * general by URLJarFile. */ return cacheJarFile(url); } if (UrlUtils.isLocalFile(localUrl)) { // if it is known to us, just return the cached file JarFile returnFile = new JarFile(localUrl.getPath()); try { // Blank out the class-path because: // 1) Web Start does not support it // 2) For the plug-in, we want to cache files from class-path so we do it manually returnFile.getManifest().getMainAttributes().putValue("Class-Path", ""); OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "Class-Path attribute cleared for " + returnFile.getName()); } catch (NullPointerException npe) { // Discard NPE here. Maybe there was no manifest, maybe there were no attributes, etc. } return returnFile; } else { // throw new IllegalStateException("a non-local file in cache"); return null; } } /* * This method is a copy of URLJarFile.retrieve() without the callback check. */ private java.util.jar.JarFile cacheJarFile(URL url) throws IOException { java.util.jar.JarFile result = null; final int BUF_SIZE = 2048; URLConnection conn = ConnectionFactory.getConnectionFactory().openConnection(url); /* get the stream before asserting privileges */ final InputStream in = conn.getInputStream(); try { result = AccessController.doPrivileged(new PrivilegedExceptionAction() { @Override public java.util.jar.JarFile run() throws IOException { OutputStream out = null; File tmpFile = null; try { tmpFile = File.createTempFile("jar_cache", null); tmpFile.deleteOnExit(); out = new FileOutputStream(tmpFile); int read = 0; byte[] buf = new byte[BUF_SIZE]; while ((read = in.read(buf)) != -1) { out.write(buf, 0, read); } out.close(); out = null; return new URLJarFile(tmpFile, null); } catch (IOException e) { if (tmpFile != null) { tmpFile.delete(); } throw e; } finally { if (in != null) { in.close(); } if (out != null) { out.close(); } } } }); } catch (PrivilegedActionException pae) { throw (IOException) pae.getException(); } finally{ ConnectionFactory.getConnectionFactory().disconnect(conn); } return result; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/runtime/PaxHeaders.17941/Boot.java0000644000000000000000000000013112654402377023727 xustar0030 mtime=1454507263.294431821 30 atime=1454507327.139580337 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/runtime/Boot.java0000644000175000002070000003345012654402377024460 0ustar00jvanekmock00000000000000// Copyright (C) 2001-2003 Jon A. Maxwell (JAM) // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp.runtime; import java.io.File; import java.net.URL; import java.security.AccessController; import java.security.PrivilegedAction; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.swing.UIManager; import net.sourceforge.jnlp.LaunchException; import net.sourceforge.jnlp.OptionsDefinitions; import net.sourceforge.jnlp.ParserSettings; import net.sourceforge.jnlp.PropertyDesc; import net.sourceforge.jnlp.about.AboutDialog; import net.sourceforge.jnlp.cache.CacheUtil; import net.sourceforge.jnlp.cache.UpdatePolicy; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.security.viewer.CertificateViewer; import net.sourceforge.jnlp.services.ServiceUtil; import net.sourceforge.jnlp.util.docprovider.IcedTeaWebTextsProvider; import net.sourceforge.jnlp.util.docprovider.JavaWsTextsProvider; import net.sourceforge.jnlp.util.docprovider.TextsProvider; import net.sourceforge.jnlp.util.docprovider.formatters.formatters.PlainTextFormatter; import net.sourceforge.jnlp.util.logging.OutputController; import net.sourceforge.jnlp.util.optionparser.InvalidArgumentException; import net.sourceforge.jnlp.util.optionparser.OptionParser; import net.sourceforge.jnlp.util.optionparser.UnevenParameterException; import sun.awt.AppContext; import sun.awt.SunToolkit; import static net.sourceforge.jnlp.runtime.Translator.R; /** * This is the main entry point for the JNLP client. The main * method parses the command line parameters and loads a JNLP * file into the secure runtime environment. This class is meant * to be called from the command line or file association; to * initialize the netx engine from other code invoke the * {@link JNLPRuntime#initialize} method after configuring * the runtime. * * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.21 $ */ public final class Boot implements PrivilegedAction { // todo: decide whether a spawned netx (external launch) // should inherit the same options as this instance (store argv?) public static final String name = Boot.class.getPackage().getImplementationTitle(); public static final String version = Boot.class.getPackage().getImplementationVersion(); private static final String nameAndVersion = name + " " + version; private static final String miniLicense = "\n" + " netx - an open-source JNLP client.\n" + " Copyright (C) 2001-2003 Jon A. Maxwell (JAM)\n" + "\n" + " // This library is free software; you can redistribute it and/or\n" + " modify it under the terms of the GNU Lesser General Public\n" + " License as published by the Free Software Foundation; either\n" + " version 2.1 of the License, or (at your option) any later version.\n" + "\n" + " This library is distributed in the hope that it will be useful,\n" + " but WITHOUT ANY WARRANTY; without even the implied warranty of\n" + " MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n" + " Lesser General Public License for more details.\n" + "\n" + " You should have received a copy of the GNU Lesser General Public\n" + " License along with this library; if not, write to the Free Software\n" + " Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n" + "\n"; private static OptionParser optionParser; /** * Launch the JNLP file specified by the command-line arguments. * @param argsIn launching arguments */ public static void main(String[] argsIn) throws UnevenParameterException { optionParser = new OptionParser(argsIn, OptionsDefinitions.getJavaWsOptions()); if (optionParser.hasOption(OptionsDefinitions.OPTIONS.VERBOSE)) { JNLPRuntime.setDebug(true); } if (AppContext.getAppContext() == null) { SunToolkit.createNewAppContext(); } if (optionParser.hasOption(OptionsDefinitions.OPTIONS.HEADLESS)) { JNLPRuntime.setHeadless(true); } DeploymentConfiguration.move14AndOlderFilesTo15StructureCatched(); if (optionParser.hasOption(OptionsDefinitions.OPTIONS.VIEWER)) { try { CertificateViewer.main(null); JNLPRuntime.exit(0); } catch (Exception e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); } } if (optionParser.hasOption(OptionsDefinitions.OPTIONS.VERSION)) { OutputController.getLogger().printOutLn(nameAndVersion); JNLPRuntime.exit(0); } if (optionParser.hasOption(OptionsDefinitions.OPTIONS.LICENSE)) { OutputController.getLogger().printOutLn(miniLicense); JNLPRuntime.exit(0); } if (optionParser.hasOption(OptionsDefinitions.OPTIONS.HELP1)) { handleMessage(); JNLPRuntime.exit(0); } List properties = optionParser.getParams(OptionsDefinitions.OPTIONS.PROPERTY); if (properties != null) { for (String prop : properties) { try { PropertyDesc propDesc = PropertyDesc.fromString(prop); JNLPRuntime.getConfiguration().setProperty(propDesc.getKey(), propDesc.getValue()); } catch (LaunchException ex) { OutputController.getLogger().log(ex); } } } if (optionParser.hasOption(OptionsDefinitions.OPTIONS.ABOUT)) { handleAbout(); if (optionParser.hasOption(OptionsDefinitions.OPTIONS.HEADLESS)) { JNLPRuntime.exit(0); } else { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Exception e) { OutputController.getLogger().log("Unable to set system look and feel"); } OutputController.getLogger().printOutLn(R("BLaunchAbout")); AboutDialog.display(TextsProvider.JAVAWS); return; } } if (optionParser.hasOption(OptionsDefinitions.OPTIONS.UPDATE)) { int value = Integer.parseInt(optionParser.getParam(OptionsDefinitions.OPTIONS.UPDATE)); JNLPRuntime.setDefaultUpdatePolicy(new UpdatePolicy(value * 1000l)); } if (optionParser.hasOption(OptionsDefinitions.OPTIONS.NOUPDATE)) JNLPRuntime.setDefaultUpdatePolicy(UpdatePolicy.NEVER); if (optionParser.hasOption(OptionsDefinitions.OPTIONS.NOFORK)) { JNLPRuntime.setForksAllowed(false); } if (optionParser.hasOption(OptionsDefinitions.OPTIONS.TRUSTALL)) { JNLPRuntime.setTrustAll(true); } if (optionParser.hasOption(OptionsDefinitions.OPTIONS.HTML)) { JNLPRuntime.setHtml(true); } if (optionParser.hasOption(OptionsDefinitions.OPTIONS.TRUSTNONE)) { JNLPRuntime.setTrustNone(true); } if (optionParser.hasOption(OptionsDefinitions.OPTIONS.NOHEADERS)) { JNLPRuntime.setIgnoreHeaders(true); } if (optionParser.hasOption(OptionsDefinitions.OPTIONS.REDIRECT)) { JNLPRuntime.setAllowRedirect(true); } JNLPRuntime.setInitialArgments(Arrays.asList(argsIn)); AccessController.doPrivileged(new Boot()); } private static void handleMessage() { final TextsProvider helpMessagesProvider = new JavaWsTextsProvider("utf-8", new PlainTextFormatter(), true, true); String helpMessage = "\n"; if (JNLPRuntime.isDebug()){ helpMessage += helpMessagesProvider.writeToString(); } else { helpMessage = helpMessage + helpMessagesProvider.prepare().getSynopsis() + helpMessagesProvider.getFormatter().getNewLine() + helpMessagesProvider.prepare().getOptions() + helpMessagesProvider.getFormatter().getNewLine(); } OutputController.getLogger().printOut(helpMessage); } private static void handleAbout() { final TextsProvider aboutMessagesProvider = new IcedTeaWebTextsProvider("utf-8", new PlainTextFormatter(), false, true); String itwInfoMessage = "" + nameAndVersion + "\n\n"; if (JNLPRuntime.isDebug()) { itwInfoMessage += aboutMessagesProvider.writeToString(); } else { itwInfoMessage = itwInfoMessage + aboutMessagesProvider.prepare().getIntroduction(); } OutputController.getLogger().printOut(itwInfoMessage); } /** * The privileged part (jdk1.3 compatibility). */ @Override public Void run() { Map> extra = new HashMap<>(); if (optionParser.hasOption(OptionsDefinitions.OPTIONS.HTML)) { boolean run = new HtmlBoot(optionParser).run(extra); if (!run) { return null; } } else { boolean run = new JnlpBoot(optionParser).run(extra); if (!run) { return null; } } return null; } static void fatalError(String message) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, "netx: " + message); JNLPRuntime.exit(1); } /** * Returns the url of file to open; does not return if no file was * specified, or if the file location was invalid. */ static URL getFileLocation() { String location = null; try { location = getMainFile(); } catch (InvalidArgumentException e) { OutputController.getLogger().log(e); fatalError("Invalid argument: "+e); } if (location == null) { handleMessage(); JNLPRuntime.exit(1); } OutputController.getLogger().log(R("BFileLoc") + ": " + location); URL url = null; try { if (new File(location).exists()) // TODO: Should be toURI().toURL() url = new File(location).toURL(); // Why use file.getCanonicalFile? else if (ServiceUtil.getBasicService() != null){ OutputController.getLogger().log("Warning, null basicService"); url = new URL(ServiceUtil.getBasicService().getCodeBase(), location); } else { url = new URL(location); } } catch (Exception e) { OutputController.getLogger().log(e); fatalError("Invalid jnlp file " + location); } return url; } /** * Gets the JNLP file from the command line arguments, or exits upon error. */ private static String getMainFile() throws InvalidArgumentException { if (optionParser.getMainArgs().size() > 1 || (optionParser.mainArgExists() && optionParser.hasOption(OptionsDefinitions.OPTIONS.JNLP)) || (optionParser.mainArgExists() && optionParser.hasOption(OptionsDefinitions.OPTIONS.HTML)) || (optionParser.hasOption(OptionsDefinitions.OPTIONS.JNLP) && optionParser.hasOption(OptionsDefinitions.OPTIONS.HTML)) ) { throw new InvalidArgumentException(optionParser.getMainArgs().toString()); } else if (optionParser.hasOption(OptionsDefinitions.OPTIONS.JNLP)) { return optionParser.getParam(OptionsDefinitions.OPTIONS.JNLP); } else if (optionParser.hasOption(OptionsDefinitions.OPTIONS.HTML)) { return optionParser.getParam(OptionsDefinitions.OPTIONS.HTML); } else if (optionParser.mainArgExists()) { return optionParser.getMainArg(); } handleMessage(); JNLPRuntime.exit(0); return null; } static ParserSettings init(Map> extra) { JNLPRuntime.setSecurityEnabled(!optionParser.hasOption(OptionsDefinitions.OPTIONS.NOSEC)); JNLPRuntime.setOfflineForced(optionParser.hasOption(OptionsDefinitions.OPTIONS.OFFLINE)); JNLPRuntime.initialize(true); /* * FIXME * This should have been done with the rest of the argument parsing * code. But we need to know what the cache and base directories are, * and baseDir is initialized here */ if (optionParser.hasOption(OptionsDefinitions.OPTIONS.CLEARCACHE)) { CacheUtil.clearCache(); return null; } extra.put("arguments", optionParser.getParams(OptionsDefinitions.OPTIONS.ARG)); extra.put("parameters", optionParser.getParams(OptionsDefinitions.OPTIONS.PARAM)); extra.put("properties", optionParser.getParams(OptionsDefinitions.OPTIONS.PROPERTY)); return ParserSettings.setGlobalParserSettingsFromOptionParser(optionParser); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/runtime/PaxHeaders.17941/ApplicationInstance.java0000644000000000000000000000013012654402377026753 xustar0030 mtime=1454507263.293431834 29 atime=1454507327.13858035 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java0000644000175000002070000003360612654402377027510 0ustar00jvanekmock00000000000000// Copyright (C) 2001-2003 Jon A. Maxwell (JAM) // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp.runtime; import java.awt.Window; import java.io.File; import java.net.URL; import java.security.AccessControlContext; import java.security.AccessController; import java.security.CodeSource; import java.security.PrivilegedAction; import java.security.ProtectionDomain; import javax.swing.event.EventListenerList; import sun.awt.AppContext; import net.sourceforge.jnlp.JNLPFile; import net.sourceforge.jnlp.PropertyDesc; import net.sourceforge.jnlp.SecurityDesc; import net.sourceforge.jnlp.ShortcutDesc; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.event.ApplicationEvent; import net.sourceforge.jnlp.event.ApplicationListener; import net.sourceforge.jnlp.security.SecurityDialogs; import net.sourceforge.jnlp.security.SecurityDialogs.AccessType; import net.sourceforge.jnlp.security.dialogs.AccessWarningPaneComplexReturn; import net.sourceforge.jnlp.util.logging.OutputController; import net.sourceforge.jnlp.util.WeakList; import net.sourceforge.jnlp.util.XDesktopEntry; /** * Represents a running instance of an application described in a * JNLPFile. This class provides a way to track the application's * resources and destroy the application. * * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.15 $ */ public class ApplicationInstance { // todo: should attempt to unload the environment variables // installed by the application. /** the file */ private final JNLPFile file; /** the thread group */ private final ThreadGroup group; /** the classloader */ private final ClassLoader loader; /** *

    * Every application/applet gets its own AppContext. This allows us to do * things like have two different look and feels for two different applets * (running in the same VM), allows untrusted programs to manipulate the * event queue (safely) and (possibly) more. *

    *

    * It is set to the AppContext which created this ApplicationInstance *

    */ private final AppContext appContext; /** whether the application has stopped running */ private boolean stopped = false; /** weak list of windows opened by the application */ private final WeakList weakWindows = new WeakList<>(); /** list of application listeners */ private final EventListenerList listeners = new EventListenerList(); /** whether or not this application is signed */ private boolean isSigned = false; /** * Create an application instance for the file. This should be done in the * appropriate {@link ThreadGroup} only. * @param file jnlpfile for which the instance do exists * @param group thread group to which it belongs * @param loader loader for this application */ public ApplicationInstance(JNLPFile file, ThreadGroup group, ClassLoader loader) { this.file = file; this.group = group; this.loader = loader; this.isSigned = ((JNLPClassLoader) loader).getSigning(); this.appContext = AppContext.getAppContext(); } /** * Add an Application listener * @param listener listener to be added */ public void addApplicationListener(ApplicationListener listener) { listeners.add(ApplicationListener.class, listener); } /** * Remove an Application Listener * @param listener to be removed */ public void removeApplicationListener(ApplicationListener listener) { listeners.remove(ApplicationListener.class, listener); } /** * Notify listeners that the application has been terminated. */ protected void fireDestroyed() { Object list[] = listeners.getListenerList(); ApplicationEvent event = null; for (int i = list.length - 1; i > 0; i -= 2) { // last to first required if (event == null) event = new ApplicationEvent(this); ((ApplicationListener) list[i]).applicationDestroyed(event); } } /** * Initialize the application's environment (installs * environment variables, etc). */ public void initialize() { installEnvironment(); addMenuAndDesktopEntries(); } /** * Creates menu and desktop entries if required by the jnlp file or settings */ private void addMenuAndDesktopEntries() { XDesktopEntry entry = new XDesktopEntry(file); ShortcutDesc sd = file.getInformation().getShortcut(); File possibleDesktopFile = entry.getLinuxDesktopIconFile(); File possibleMenuFile = entry.getLinuxMenuIconFile(); File generatedJnlp = entry.getGeneratedJnlpFileName(); //if one of menu or desktop exists, do not bother user boolean exists = false; if (possibleDesktopFile.exists()) { OutputController.getLogger().log("ApplicationInstance.addMenuAndDesktopEntries(): file - " + possibleDesktopFile.getAbsolutePath() + " already exists. Refreshing and not proceeding with desktop additions"); exists = true; if (JNLPRuntime.isOnline()) { entry.refreshExistingShortcuts(false, true); //update } } if (possibleMenuFile.exists()) { OutputController.getLogger().log("ApplicationInstance.addMenuAndDesktopEntries(): file - " + possibleMenuFile.getAbsolutePath() + " already exists. Refreshing and not proceeding with desktop additions"); exists = true; if (JNLPRuntime.isOnline()) { entry.refreshExistingShortcuts(true, false); //update } } if (generatedJnlp.exists()) { OutputController.getLogger().log("ApplicationInstance.addMenuAndDesktopEntries(): generated file - " + generatedJnlp.getAbsolutePath() + " already exists. Refreshing and not proceeding with desktop additions"); exists = true; if (JNLPRuntime.isOnline()) { entry.refreshExistingShortcuts(true, true); //update } } if (exists){ return; } AccessWarningPaneComplexReturn ics = getComplexReturn(sd); if (ics.getRegularReturnAsBoolean()) { entry.createDesktopShortcuts(ics.getMenu(), ics.getDekstop(), isSigned()); } } /** * Indicates whether a desktop launcher/shortcut should be created for this * application instance * * @param sd the ShortcutDesc element from the JNLP file * @return true if a desktop shortcut should be created */ private AccessWarningPaneComplexReturn getComplexReturn(ShortcutDesc sd) { if (JNLPRuntime.isTrustAll()) { boolean mainResult = (sd != null && (sd.onDesktop() || sd.getMenu() != null)); AccessWarningPaneComplexReturn r = new AccessWarningPaneComplexReturn(mainResult?0:1); if (mainResult){ if (sd.onDesktop()){ r.setDekstop(new AccessWarningPaneComplexReturn.ShortcutResult(true)); r.getDekstop().setBrowser(XDesktopEntry.getBrowserBin()); r.getDekstop().setShortcutType(AccessWarningPaneComplexReturn.ShortcutResult.Shortcut.BROWSER); } if (sd.getMenu() != null){ r.setMenu(new AccessWarningPaneComplexReturn.ShortcutResult(true)); r.getMenu().setBrowser(XDesktopEntry.getBrowserBin()); r.getMenu().setShortcutType(AccessWarningPaneComplexReturn.ShortcutResult.Shortcut.BROWSER); } } return r; } String currentSetting = JNLPRuntime.getConfiguration() .getProperty(DeploymentConfiguration.KEY_CREATE_DESKTOP_SHORTCUT); /* * check configuration and possibly prompt user to find out if a * shortcut should be created or not */ switch (currentSetting) { case ShortcutDesc.CREATE_NEVER: return new AccessWarningPaneComplexReturn(1); case ShortcutDesc.CREATE_ALWAYS: return new AccessWarningPaneComplexReturn(0); case ShortcutDesc.CREATE_ASK_USER: return SecurityDialogs.showAccessWarningDialogComplexReturn(AccessType.CREATE_DESTKOP_SHORTCUT, file); case ShortcutDesc.CREATE_ASK_USER_IF_HINTED: if (sd != null && (sd.onDesktop() || sd.toMenu())) { return SecurityDialogs.showAccessWarningDialogComplexReturn(AccessType.CREATE_DESTKOP_SHORTCUT, file); } case ShortcutDesc.CREATE_ALWAYS_IF_HINTED: if (sd != null && (sd.onDesktop() || sd.toMenu())) { return new AccessWarningPaneComplexReturn(0); } } return new AccessWarningPaneComplexReturn(1); } /** * Releases the application's resources before it is collected. * Only collectable if classloader and thread group are * also collectable so basically is almost never called (an * application would have to close its windows and exit its * threads but not call JNLPRuntime.exit). */ @Override public void finalize() { destroy(); } /** * Install the environment variables. */ void installEnvironment() { final PropertyDesc props[] = file.getResources().getProperties(); CodeSource cs = new CodeSource((URL) null, (java.security.cert.Certificate[]) null); JNLPClassLoader loader = (JNLPClassLoader) this.loader; SecurityDesc s = loader.getSecurity(); ProtectionDomain pd = new ProtectionDomain(cs, s.getPermissions(cs), null, null); // Add to hashmap AccessControlContext acc = new AccessControlContext(new ProtectionDomain[] { pd }); PrivilegedAction installProps = new PrivilegedAction() { @Override public Object run() { for (PropertyDesc propDesc : props) { System.setProperty(propDesc.getKey(), propDesc.getValue()); } return null; } }; AccessController.doPrivileged(installProps, acc); } /** * Returns the jnlpfile on which is this application based * @return JNLP file for this task. */ public JNLPFile getJNLPFile() { return file; } /** * Returns the application title. * @return the title of this application */ public String getTitle() { return file.getTitle(); } /** * Returns whether the application is running. * @return state of application */ public boolean isRunning() { return !stopped; } /** * Stop the application and destroy its resources. */ @SuppressWarnings("deprecation") public void destroy() { if (stopped) return; try { // destroy resources for (Window w : weakWindows) { if (w != null) w.dispose(); } weakWindows.clear(); // interrupt threads Thread threads[] = new Thread[group.activeCount() * 2]; int nthreads = group.enumerate(threads); for (int i = 0; i < nthreads; i++) { OutputController.getLogger().log("Interrupt thread: " + threads[i]); threads[i].interrupt(); } // then stop Thread.yield(); nthreads = group.enumerate(threads); for (int i = 0; i < nthreads; i++) { OutputController.getLogger().log("Stop thread: " + threads[i]); threads[i].stop(); } // then destroy - except Thread.destroy() not implemented in jdk } finally { stopped = true; fireDestroyed(); } } /** * Returns the thread group. * * @return thread group of this application, unless it is stopped * @throws IllegalStateException if the app is not running */ public ThreadGroup getThreadGroup() throws IllegalStateException { if (stopped) throw new IllegalStateException(); return group; } /** * Returns the classloader. * * @return the classloader of this application, unless it is stopped * @throws IllegalStateException if the app is not running */ public ClassLoader getClassLoader() throws IllegalStateException { if (stopped) throw new IllegalStateException(); return loader; } /** * Adds a window that this application opened. When the * application is disposed, these windows will also be disposed. * @param window to be added */ protected void addWindow(Window window) { weakWindows.add(window); weakWindows.trimToSize(); } /** * @return whether or not this application is signed. */ public boolean isSigned() { return isSigned; } /** * * @return application context of this instance */ public AppContext getAppContext() { return appContext; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/runtime/PaxHeaders.17941/AppletInstance.java0000644000000000000000000000013012654402377025735 xustar0030 mtime=1454507263.292431847 29 atime=1454507327.13858035 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/runtime/AppletInstance.java0000644000175000002070000001063512654402377026467 0ustar00jvanekmock00000000000000// Copyright (C) 2001-2003 Jon A. Maxwell (JAM) // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp.runtime; import java.applet.*; import java.awt.*; import net.sourceforge.jnlp.*; import net.sourceforge.jnlp.util.logging.OutputController; /** * Represents a launched application instance created from a JNLP * file. This class does not control the operation of the applet, * use the AppletEnvironment class to start and stop the applet. * * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.9 $ */ public class AppletInstance extends ApplicationInstance { /** whether the applet's stop and destroy methods have been called */ private boolean appletStopped = false; /** the applet */ private Applet applet; /** the applet environment */ final private AppletEnvironment environment; /** * Create a New Task based on the Specified URL * @param file pluginbrifge to build instance on * @param group thread group of this instance * @param loader classlaoder for this instance * @param applet applet of this instance */ public AppletInstance(JNLPFile file, ThreadGroup group, ClassLoader loader, Applet applet) { super(file, group, loader); this.applet = applet; this.environment = new AppletEnvironment(file, this); } /** * Set the applet of this launched application; can only be called once. * @param applet to be set */ public void setApplet(Applet applet) { if (this.applet != null) { OutputController.getLogger().log(new IllegalStateException("Applet can only be set once.")); return; } this.applet = applet; } /** * Create a New Task based on the Specified URL * @param file pluginbrifge to build instance on * @param group thread group of this instance * @param loader classlaoder for this instance * @param applet applet of this instance * @param cont Container where to place applet */ public AppletInstance(JNLPFile file, ThreadGroup group, ClassLoader loader, Applet applet, Container cont) { super(file, group, loader); this.applet = applet; this.environment = new AppletEnvironment(file, this, cont); } /** * Sets whether the applet is resizable or not. Applets default * to being not resizable. * @param resizable boolean to allwo resizing */ public void setResizable(boolean resizable) { Container c = environment.getAppletFrame(); if (c instanceof Frame) ((Frame) c).setResizable(resizable); } /** * @return whether the applet is resizable. */ public boolean isResizable() { Container c = environment.getAppletFrame(); if (c instanceof Frame) return ((Frame) c).isResizable(); return false; } /** * @return the application title. */ @Override public String getTitle() { return getJNLPFile().getApplet().getName(); } /** * @return the applet environment. */ public AppletEnvironment getAppletEnvironment() { return environment; } /** * @return the applet. */ public Applet getApplet() { return applet; } /** * Stop the application and destroy its resources. */ @Override public void destroy() { if (appletStopped) return; appletStopped = true; try { applet.stop(); applet.destroy(); } catch (Exception ex) { OutputController.getLogger().log(ex); } environment.destroy(); super.destroy(); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/runtime/PaxHeaders.17941/AppletEnvironment.java0000644000000000000000000000013012654402377026475 xustar0030 mtime=1454507263.292431847 29 atime=1454507327.13858035 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/runtime/AppletEnvironment.java0000644000175000002070000002566312654402377027236 0ustar00jvanekmock00000000000000// Copyright (C) 2001-2003 Jon A. Maxwell (JAM) // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp.runtime; import net.sourceforge.jnlp.util.logging.OutputController; import java.applet.*; import java.awt.*; import java.awt.event.*; import java.util.*; import java.util.List; import java.lang.reflect.InvocationTargetException; import java.net.*; import java.io.*; import javax.swing.*; import net.sourceforge.jnlp.*; import net.sourceforge.jnlp.splashscreen.SplashController; import net.sourceforge.jnlp.util.*; /** * The applet environment including stub, context, and frame. The * default environment puts the applet in a non-resiable frame; * this can be changed by obtaining the frame and setting it * resizable. * * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.12 $ */ public class AppletEnvironment implements AppletContext, AppletStub { /** the JNLP file */ private JNLPFile file; /** the applet */ private Applet applet; /** the parameters */ private Map parameters; /** the applet container */ private Container cont; /** weak references to the audio clips */ private final WeakList weakClips = new WeakList<>(); /** whether the applet has been started / displayed */ private boolean appletStarted = false; /** whether the applet has been destroyed */ private boolean destroyed = false; /** * Create a new applet environment for the applet specified by * the JNLP file. * @param file jnlp file base to construct environment * @param appletInstance applet for this environment * @param cont container to place this applet to */ public AppletEnvironment(JNLPFile file, final AppletInstance appletInstance, Container cont) { this.file = file; this.applet = appletInstance.getApplet(); parameters = file.getApplet().getParameters(); this.cont = cont; } /** * Create a new applet environment for the applet specified by * the JNLP file, in a new frame. * @param file jnlp file base to construct environment * @param appletInstance applet for this environment */ public AppletEnvironment(JNLPFile file, final AppletInstance appletInstance) { this(file, appletInstance, null); Frame frame = new Frame(file.getApplet().getName() + " - Applet"); frame.setResizable(false); appletInstance.addWindow(frame); // may not need this once security manager can close windows // that do not have app code on the stack WindowListener closer = new WindowAdapter() { @Override public void windowClosing(WindowEvent event) { appletInstance.destroy(); JNLPRuntime.exit(0); } }; frame.addWindowListener(closer); this.cont = frame; } /** * Checks whether the applet has been destroyed, and throws an * IllegalStateException if the applet has been destroyed of. * * @throws IllegalStateException */ private void checkDestroyed() { if (destroyed) { throw new IllegalStateException("Illegal applet stub/context access: applet destroyed."); } } /** * Disposes the applet's resources and disables the applet * environment from further use; after calling this method the * applet stub and context methods throw IllegalStateExceptions. */ public void destroy() { destroyed = true; List clips = weakClips.hardList(); for (AppletAudioClip clip : clips) { clip.dispose(); } } /** * @return the frame that contains the applet. Disposing this * frame will destroy the applet. */ public Container getAppletFrame() { // TODO: rename this method to getAppletContainer ? return cont; } /** * container must be SplashContoler. * @return container */ public SplashController getSplashController() { if (cont instanceof SplashController) { return (SplashController) cont; } else { return null; } } /** * Initialize, start, and show the applet. */ public void startApplet() { checkDestroyed(); if (appletStarted) { return; } appletStarted = true; try { AppletDesc appletDesc = file.getApplet(); if (cont instanceof AppletStub) { applet.setStub((AppletStub) cont); } else { applet.setStub(this); } cont.setLayout(new BorderLayout()); cont.add("Center", applet); cont.validate(); // This is only needed if the applet is in its own frame. if (cont instanceof Frame) { Frame frame = (Frame) cont; frame.pack(); // cause insets to be calculated Insets insets = frame.getInsets(); frame.setSize(appletDesc.getWidth() + insets.left + insets.right, appletDesc.getHeight() + insets.top + insets.bottom); } try { SwingUtilities.invokeAndWait(new Runnable() { @Override public void run() { // do first because some applets need to be displayed before // starting (they use Component.getImage or something) cont.setVisible(true); applet.init(); applet.start(); cont.invalidate(); // this should force the applet to cont.validate(); // the correct size and to repaint cont.repaint(); } }); } catch (InterruptedException | InvocationTargetException ie) { OutputController.getLogger().log(ie); } } catch (Exception ex) { OutputController.getLogger().log(ex); // should also kill the applet? } } // applet context methods /** * Returns the applet if the applet's name is specified, * otherwise return null. */ @Override public Applet getApplet(String name) { checkDestroyed(); if (name != null && name.equals(file.getApplet().getName())) { return applet; } else { return null; } } /** * Set the applet of this environment; can only be called once. * @param applet source of this environment */ public void setApplet(Applet applet) { if (this.applet != null) { OutputController.getLogger().log(new IllegalStateException("Applet can only be set once.")); return; } this.applet = applet; } /** * Returns an enumeration that contains only the applet * from the JNLP file. */ @Override public Enumeration getApplets() { checkDestroyed(); return Collections.enumeration(Arrays.asList(new Applet[] { applet })); } /** * @param location source of clip * @return an audio clip. */ @Override public AudioClip getAudioClip(URL location) { checkDestroyed(); AppletAudioClip clip = new AppletAudioClip(location); weakClips.add(clip); weakClips.trimToSize(); return clip; } /** * @return an image loaded from the specified location. * @param location location of image */ @Override public Image getImage(URL location) { checkDestroyed(); //return Toolkit.getDefaultToolkit().createImage(location); Image image = (new ImageIcon(location)).getImage(); return image; } /** * Not implemented yet. * @param uRL url of document */ @Override public void showDocument(java.net.URL uRL) { checkDestroyed(); } /** * Not implemented yet. * @param uRL source of document * @param str who know what */ @Override public void showDocument(java.net.URL uRL, java.lang.String str) { checkDestroyed(); } /** * Not implemented yet. * @param str id of applet */ @Override public void showStatus(java.lang.String str) { checkDestroyed(); } /** * Required for JRE1.4, but not implemented yet. */ @Override public void setStream(String key, InputStream stream) { checkDestroyed(); } /** * Required for JRE1.4, but not implemented yet. */ @Override public InputStream getStream(String key) { checkDestroyed(); return null; } /** * Required for JRE1.4, but not implemented yet. */ @Override public Iterator getStreamKeys() { checkDestroyed(); return null; } // stub methods @Override public void appletResize(int width, int height) { checkDestroyed(); if (cont instanceof Frame) { Frame frame = (Frame) cont; Insets insets = frame.getInsets(); frame.setSize(width + insets.left + insets.right, height + insets.top + insets.bottom); } } @Override public AppletContext getAppletContext() { checkDestroyed(); return this; } @Override public URL getCodeBase() { checkDestroyed(); return file.getCodeBase(); } @Override public URL getDocumentBase() { checkDestroyed(); return file.getApplet().getDocumentBase(); } // FIXME: Sun's applet code forces all parameters to lower case. // Does Netx's JNLP code do the same, so we can remove the first lookup? @Override public String getParameter(String name) { checkDestroyed(); String s = parameters.get(name); if (s != null) { return s; } return parameters.get(name.toLowerCase()); } @Override public boolean isActive() { checkDestroyed(); // it won't be started or stopped, so if it can call it's running return true; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/runtime/PaxHeaders.17941/AppletAudioClip.java0000644000000000000000000000013012654402377026042 xustar0030 mtime=1454507263.292431847 29 atime=1454507327.13858035 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/runtime/AppletAudioClip.java0000644000175000002070000000562312654402377026575 0ustar00jvanekmock00000000000000// Copyright (C) 2001-2003 Jon A. Maxwell (JAM) // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp.runtime; import java.net.*; import java.applet.*; import javax.sound.sampled.*; import net.sourceforge.jnlp.util.logging.OutputController; // based on Deane Richan's AppletAudioClip /** * An applet audio clip using the javax.sound API. * * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.8 $ */ public class AppletAudioClip implements AudioClip { /** the clip */ private Clip clip; /** * Creates new AudioClip. If the clip cannot be opened no * exception is thrown, instead the methods of the AudioClip * return without performing any operations. * * @param location the clip location */ public AppletAudioClip(URL location) { try { AudioInputStream stream = AudioSystem.getAudioInputStream(location); clip = (Clip) AudioSystem.getLine(new Line.Info(Clip.class)); clip.open(stream); } catch (Exception ex) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, "Error loading sound:" + location.toString()); OutputController.getLogger().log(ex); clip = null; } } /** * Plays the clip in a continuous loop until the stop method is * called. */ public void loop() { if (clip == null) return; clip.loop(Clip.LOOP_CONTINUOUSLY); } /** * Plays the clip from the beginning. */ public void play() { if (clip == null) return; // applet audio clip resets to beginning when played again clip.stop(); clip.setFramePosition(0); clip.start(); } /** * Stops playing the clip. */ public void stop() { if (clip == null) return; clip.stop(); } /** * Stops playing the clip and disposes it; the clip cannot be * played after being disposed. */ void dispose() { if (clip != null) { clip.stop(); clip.flush(); clip.close(); } clip = null; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/runtime/PaxHeaders.17941/package-info.java0000644000000000000000000000013112654402377025350 xustar0030 mtime=1454507263.210432941 30 atime=1454507327.142580297 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/runtime/package-info.java0000644000175000002070000000336412654402377026102 0ustar00jvanekmock00000000000000/* package-info.java Copyright (C) 2014 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.*/ /** * This package contains the classes that manage the secure runtime environment * for JNLP apps. */ package net.sourceforge.jnlp.runtime; icedtea-web-1.6.2/netx/net/sourceforge/jnlp/runtime/PaxHeaders.17941/pac-funcs.js0000644000000000000000000000013012654402377024375 xustar0030 mtime=1454507263.210432941 29 atime=1454507327.14158031 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/runtime/pac-funcs.js0000644000175000002070000006223512654402377025132 0ustar00jvanekmock00000000000000/* pac-funcs.js 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. */ /* * These helper functions are required to be able to parse Proxy Auto Config * (PAC) files. PAC files will use these helper functions to decide the best * proxy for connecting to a host. * * This implementation is based on the description of the functions at: * http://web.archive.org/web/20060424005037/wp.netscape.com/eng/mozilla/2.0/relnotes/demo/proxy-live.html */ /** * Returns true if the host does not contain a domain (there are no dots) */ function isPlainHostName(host) { if (host.indexOf(".") === -1) { return true; } else { return false; } } /** * Returns true if the host is part of the domain (the host ends with domain) */ function dnsDomainIs(host, domain) { var loc = host.lastIndexOf(domain); if (loc === -1) { return false; } if (loc + domain.length === host.length) { // host ends with domain return true; } return false; } /** * Returns true if the host is an exact match of hostdom or if host is not a * fully qualified name but has the same hostname as hostdom */ function localHostOrDomainIs(host, hostdom) { if (host === hostdom) { // exact match return true; } var firstdot = hostdom.indexOf("."); if (firstdot === -1) { // hostdom has no dots return false; } if (host === hostdom.substring(0, firstdot)) { // hostname matches return true; } return false; } /** * Returns true if the host name can be resolved. */ function isResolvable(host) { try { java.net.InetAddress.getByName(host); return true; } catch (e) { //if (e.javaException instanceof java.net.UnknownHostException) { return false; //} else { // throw e; //} } } /** * Return true if the ip address of the host matches the pattern given the mask. */ function isInNet(host, pattern, mask) { if (!isResolvable(host)) { return false; } var hostIp = dnsResolve(host); var hostParts = hostIp.split("."); var patternParts = pattern.split("."); var maskParts = mask.split("."); if (hostParts.length !== 4 || patternParts.length !== hostParts.length || maskParts.length !== hostParts.length) { return false; } var matched = true; for (var i = 0; i < hostParts.length; i++) { var partMatches = (hostParts[i] & maskParts[i]) === (patternParts[i] & maskParts[i]); matched = matched && partMatches; } return matched; } /** * Returns the IP address of the host as a string */ function dnsResolve(host) { return java.net.InetAddress.getByName(host).getHostAddress() + ""; } /** * Returns the local IP address */ function myIpAddress() { return java.net.InetAddress.getLocalHost().getHostAddress() + ""; } /** * Returns the number of domains in a hostname */ function dnsDomainLevels(host) { var levels = 0; for (var i = 0; i < host.length; i++) { if (host[i] === '.') { levels++; } } return levels; } /** * Returns true if the shell expression matches the given input string */ function shExpMatch(str, shExp) { // TODO support all special characters // right now we support only * and ? try { // turn shExp into a regular expression var work = ""; // escape characters for (var i = 0; i < shExp.length; i++) { var ch = shExp[i]; switch (ch) { case "\\": work = work + "\\\\"; break; case "^": work = work + "\\^"; break; case "$": work = work + "\\$"; break; case "+": work = work + "\\+"; break; case ".": work = work + "\\."; break; case "(": work = work + "\\("; break; case ")": work = work + "\\)"; break; case "{": work = work + "\\{"; break; case "}": work = work + "\\}"; break; case "[": work = work + "\\["; break; case "]": work = work + "\\]"; break; case "?": work = work + ".{1}"; break; case "*": work = work + ".*"; break; default: work = work + ch; } } var regExp = "^" + work + "$"; // match //java.lang.System.out.println("") //java.lang.System.out.println("Input String : " + str); //java.lang.System.out.println("Input Pattern : " + shExp); //java.lang.System.out.println("RegExp : " + regExp.toString()); var match = str.match(regExp); if (match === null) { return false; } else { return true; } } catch (e) { return false; } } /** * Returns true if the current weekday matches the desired weekday(s) * * Possible ways of calling: * weekdayRange(wd1); * weekdayRange(wd1, "GMT"); * weekdayRange(wd1, wd2); * weekdayRange(wd1, wd2, "GMT"); * * Where wd1 and wd2 are one of "SUN", "MON", "TUE", "WED", "THU", "FRI" and * "SAT" * * The argument "GMT", if present, is always the last argument */ function weekdayRange() { var wd1; var wd2; var gmt = false; function isWeekDay(day) { if (day === "SUN" || day === "MON" || day === "TUE" || day === "WED" || day === "THU" || day === "FRI" || day === "SAT") { return true; } return false; } function strToWeekDay(str) { switch (str) { case "SUN": return 0; case "MON": return 1; case "TUE": return 2; case "WED": return 3; case "THU": return 4; case "FRI": return 5; case "SAT": return 6; default: return 0; } } if (arguments.length > 1) { if (arguments[arguments.length-1] === "GMT") { gmt = true; arguments.splice(0,arguments.length-1); } } if (arguments.length === 0) { return false; } wd1 = arguments[0]; if (!isWeekDay(wd1)) { return false; } var today = new Date().getDay(); if (arguments.length >= 2) { // return true if current weekday is between wd1 and wd2 (inclusive) wd2 = arguments[1]; if (!isWeekDay(wd2)) { return false; } var day1 = strToWeekDay(wd1); var day2 = strToWeekDay(wd2); if (day1 <= day2) { if ( day1 <= today && today <= day2) { return true; } return false; } else { if (day1 <= today || today <= day2) { return true; } return false; } } else { // return true if the current weekday is wd1 if (strToWeekDay(wd1) === today) { return true; } return false; } } /** * Returns true if the current date matches the given date(s) * * Possible ways of calling: * dateRange(day) * dateRange(day1, day2) * dateRange(month) * dateRange(month1, month2) * dateRange(year) * dateRange(year1, year2) * dateRange(day1, month1, day2, month2) * dateRange(month1, year1, month2, year2) * dateRange(day1, month1, year1, day2, month2, year2) * * The parameter "GMT" may additionally be passed as the last argument in any * of the above ways of calling. */ function dateRange() { switch (arguments.length) { case 1: return isDateInRange_internallForIcedTeaWebTesting(new Date(),arguments[0]); case 2: return isDateInRange_internallForIcedTeaWebTesting(new Date(),arguments[0],arguments[1]); case 3: return isDateInRange_internallForIcedTeaWebTesting(new Date(),arguments[0],arguments[1],arguments[2]); case 4: return isDateInRange_internallForIcedTeaWebTesting(new Date(),arguments[0],arguments[1],arguments[2],arguments[3]); case 5: return isDateInRange_internallForIcedTeaWebTesting(new Date(),arguments[0],arguments[1],arguments[2],arguments[3],arguments[4]); case 6: return isDateInRange_internallForIcedTeaWebTesting(new Date(),arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]); case 7: return isDateInRange_internallForIcedTeaWebTesting(new Date(),arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5],arguments[6]); //GMT default: return false; } } function isDateInRange_internallForIcedTeaWebTesting() { function isDate(date) { if (typeof(date) === 'number' && (date <= 31 && date >= 1)) { return true; } return false; } function strToMonth(month) { switch (month) { case "JAN": return 0; case "FEB": return 1; case "MAR": return 2; case "APR": return 3; case "MAY": return 4; case "JUN": return 5; case "JUL": return 6; case "AUG": return 7; case "SEP": return 8; case "OCT": return 9; case "NOV": return 10; case "DEC": return 11; default: return 0; } } function isMonth(month) { if (month === "JAN" || month === "FEB" || month === "MAR" || month === "APR" || month === "MAY" || month === "JUN" || month === "JUL" || month === "AUG" || month === "SEP" || month === "OCT" || month === "NOV" || month === "DEC") { return true; } return false; } function isYear(year) { if (typeof(year) === 'number') { return true; } return false; } function inDateRange(today, date1, date2) { if (date1 <= date2) { if (date1 <= today.getDate() && today.getDate() <= date2) { return true; } else { return false; } } else { if (date1 <= today.getDate() || today.getDate() <= date2) { return true; } else { return false; } } } function inMonthRange(today, month1, month2) { if (month1 <= month2) { if (month1 <= today.getMonth() && today.getMonth() <= month2) { return true; } else { return false; } } else { if (month1 <= today.getMonth() || today.getMonth() <= month2) { return true; } else { return false; } } } function inYearRange(today, year1, year2) { if (year1 <= today.getFullYear() && today.getFullYear() <= year2) { return true; } else { return false; } } function inMonthDateRange(today, date1, month1, date2, month2) { if (month1 === month2) { if (today.getMonth() === month1) { if (date1 <= today.getDate() && today.getDate() <= date2) { return true; } else { return false; } } else { if (date1 <= date2) { return false; } else { return true; } } } else if (month1 < month2) { if (month1 <= today.getMonth() && today.getMonth() <= month2) { if (today.getMonth() === month1) { if (today.getDate() >= date1) { return true; } else { return false; } } else if (today.getMonth() === month2) { if (today.getDate() <= date2) { return true; } else { return false; } } else { return true; } } else { return false; } } else { if (month1 <= today.getMonth() || today.getMonth() <= month2) { if (today.getMonth() === month1) { if (today.getDate() >= date1) { return true; } else { return false; } } else if (today.getMonth() === month2) { if (today.getDate() <= date2) { return true; } else { return false; } } else { return true; } } else { return false; } } } function inYearMonthRange(today, month1, year1, month2, year2) { if (year1 === year2) { if (today.getFullYear() === year1) { if (month1 <= today.getMonth() && today.getMonth() <= month2) { return true; } else { return false; } } else { return false; } } if (year1 < year2) { if (year1 <= today.getFullYear() && today.getFullYear() <= year2) { if (today.getFullYear() === year1) { if (today.getMonth() >= month1) { return true; } else { return false; } } else if (today.getFullYear() === year2) { if (today.getMonth() <= month2) { return true; } else { return false; } } else { return true; } } else { return false; } } else { return false; } } function inYearMonthDateRange(today, date1, month1, year1, date2, month2, year2) { if (year1 === year2) { if (year1 === today.getFullYear()) { if ((month1 <= today.getMonth()) && (today.getMonth() <= month2)) { if (month1 === month2) { if (date1 <= today.getDate() && today.getDate() <= date2) { return true; } else { return false; } } else if (today.getMonth() === month1) { if (today.getDate() >= date1) { return true; } else { return false; } } else if (today.getMonth() === month2) { if (today.getDate() <= date2) { return true; } else { return false; } } else { return true; } } else { return false; } } else { return false; } } else if (year1 < year2) { if (year1 <= today.getFullYear() && today.getFullYear() <= year2) { if (today.getFullYear() === year1) { if (today.getMonth() === month1) { if (today.getDate() >= date1) { return true; } else { return false; } } else if (today.getMonth() > month1) { return true; } else { return false; } } else if (today.getFullYear() === year2) { if (today.getMonth() === month2) { if (today.getDate() <= date1) { return true; } else { return false; } } else if (today.getMonth() < month2) { return true; } else { return false; } } else { return true; } } else { return false; } } else { return false; } } // note: watch out for wrapping around of dates. date ranges, like // month=9 to month=8, wrap around and cover the entire year. this // makes everything more interesting var gmt; if (arguments.length > 2) { if (arguments[arguments.length-1] === "GMT") { gmt = true; arguments.splice(0,arguments.length-1); } } // TODO: change date to gmt, whatever var today = arguments[0] var arg1; var arg2; var arg3; var arg4; var arg5; var arg6; switch (arguments.length-1) { case 1: var arg = arguments[1]; if (isDate(arg)) { if (today.getDate() === arg) { return true; } else { return false; } } else if (isMonth(arg)) { if (strToMonth(arg) === today.getMonth()) { return true; } else { return false; } } else { // year if (today.getFullYear() === arg) { return true; } else { return false; } } case 2: arg1 = arguments[1]; arg2 = arguments[2]; if (isDate(arg1) && isDate(arg2)) { var date1 = arg1; var date2 = arg2; return inDateRange(today, date1, date2); } else if (isMonth(arg1) && isMonth(arg2)) { var month1 = strToMonth(arg1); var month2 = strToMonth(arg2); return inMonthRange(today, month1, month2); } else if (isYear(arg1) && isYear(arg2)) { var year1 = arg1; var year2 = arg2; return inYearRange(today, year1, year2); } else { return false; } case 4: arg1 = arguments[1]; arg2 = arguments[2]; arg3 = arguments[3]; arg4 = arguments[4]; if (isDate(arg1) && isMonth(arg2) && isDate(arg3) && isMonth(arg4)) { var date1 = arg1; var month1 = strToMonth(arg2); var date2 = arg3; var month2 = strToMonth(arg4); return inMonthDateRange(today, date1, month1, date2, month2); } else if (isMonth(arg1) && isYear(arg2) && isMonth(arg3) && isYear(arg4)) { var month1 = strToMonth(arg1); var year1 = arg2; var month2 = strToMonth(arg3); var year2 = arg4; return inYearMonthRange(today, month1, year1, month2, year2); } else { return false; } case 6: arg1 = arguments[1]; arg2 = arguments[2]; arg3 = arguments[3]; arg4 = arguments[4]; arg5 = arguments[5]; arg6 = arguments[6]; if (isDate(arg1) && isMonth(arg2) && isYear(arg3) && isDate(arg4) && isMonth(arg5) && isYear(arg6)) { var day1 = arg1; var month1 = strToMonth(arg2); var year1 = arg3; var day2 = arg4; var month2 = strToMonth(arg5); var year2 = arg6; return inYearMonthDateRange(today, day1, month1, year1, day2, month2, year2); } else { return false; } default: return false; } } /** * Returns true if the current time matches the range given * * timeRange(hour) * timeRange(hour1, hour2) * timeRange(hour1, min1, hour2, min2) * timeRange(hour1, min1, sec1, hour2, min2, sec2) * * The string "GMT" can be used as the last additional parameter in addition to * the methods listed above. */ function timeRange() { // watch out for wrap around of times var gmt; if (arguments.length > 1) { if (arguments[arguments.length-1] === "GMT") { gmt = true; arguments.splice(0,arguments.length-1); } } function isHour(hour) { if (typeof(hour) === "number" && ( 0 <= hour && hour <= 23)) { return true; } else { return false; } } function isMin(minute) { if (typeof(minute) === "number" && (0 <= minute && minute <= 59)) { return true; } else { return false; } } function inHourRange(now, hour1, hour2) { if (hour1 === hour2) { if (now.getHours() === hour1) { return true; } else { return false; } } else if (hour1 < hour2) { if (hour1 <= now.getHours() && now.getHours() <= hour2) { return true; } else { return false; } } else { if (hour1 <= now.getHours() || now.getHours() <= hour2) { return true; } else { return false; } } } function inHourMinuteRange(now, hour1, min1, hour2, min2) { if (hour1 == hour2) { if (now.getHours() == hour1) { if (min1 <= min2) { if (min1 <= now.getMinutes() && now.getMinutes() <= min2) { return true; } else { return false; } } else { if (min1 <= now.getMinutes() || now.getMinutes() <= min2) { return true; } else { return false; } } } else { if (min1 <= min2) { return false; } else { return true; } } } else if (hour1 < hour2) { if (hour1 <= now.getHours() && now.getHours() <= hour2) { return true; } else { return false; } } else { if (hour1 <= now.getHours() || now.getHours() <= hour2) { return true; } else { return false; } } } var today = new Date(); switch (arguments.length) { case 1: var hour = arguments[0]; if (today.getHours() === hour) { return true; } else { return false; } case 2: var hour1 = arguments[0]; var hour2 = arguments[1]; if (isHour(hour1) && isHour(hour2)) { return inHourRange(today, hour1, hour2); } else { return false; } case 4: var hour1 = arguments[0]; var min1 = arguments[1]; var hour2 = arguments[2]; var min2 = arguments[3]; if (isHour(hour1) && isMin(min1) && isHour(hour2) && isMin(min2)) { return inHourMinuteRange(today, hour1, min1, hour2, min2); } else { return false; } case 6: var hour1 = arguments[0]; var min1 = arguments[1]; var sec1 = arguments[2]; var hour2 = arguments[3]; var min2 = arguments[4]; var sec2 = arguments[5]; // TODO handle seconds properly return inHourMinuteRange(today, hour1, min1, hour2, min2); default: return false; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/runtime/PaxHeaders.17941/html0000644000000000000000000000013112654402377023050 xustar0030 mtime=1454507263.210432941 30 atime=1454507658.780157344 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/runtime/html/0000755000175000002070000000000012654402377023651 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/netx/net/sourceforge/jnlp/runtime/html/PaxHeaders.17941/ElementValidator.java0000644000000000000000000000013012654402377027226 xustar0030 mtime=1454507263.210432941 29 atime=1454507327.14158031 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/runtime/html/ElementValidator.java0000644000175000002070000000342012654402377027752 0ustar00jvanekmock00000000000000/* Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.runtime.html; import org.w3c.dom.Element; interface ElementValidator { public boolean isElementValid(Element e); } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/runtime/html/PaxHeaders.17941/AppletsFilter.java0000644000000000000000000000013012654402377026545 xustar0030 mtime=1454507263.209432954 29 atime=1454507327.14158031 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/runtime/html/AppletsFilter.java0000644000175000002070000000746212654402377027303 0ustar00jvanekmock00000000000000/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package net.sourceforge.jnlp.runtime.html; import java.io.IOException; import java.net.URL; import java.util.ArrayList; import java.util.List; import javax.xml.parsers.ParserConfigurationException; import net.sourceforge.jnlp.runtime.Translator; import net.sourceforge.jnlp.util.logging.OutputController; import org.w3c.dom.Element; import org.xml.sax.SAXException; /** * * @author jvanek */ public class AppletsFilter { private final List found; private final URL docBase; private final List ids; public AppletsFilter(List found, URL docBase, List ids) { this.found = found; this.docBase = docBase; this.ids = ids; } public List getApplets() throws ParserConfigurationException, SAXException, IOException { List appletElement = getAppletElements(); List aps = new ArrayList<>(appletElement.size()); for (int i = 0; i < appletElement.size(); i++) { Element element = appletElement.get(i); AppletParser ap = new AppletParser(element, docBase); aps.add(ap); OutputController.getLogger().log("added: "+(aps.size()-1)); OutputController.getLogger().log(ap.toString()); } return aps; } private List getAppletElements() throws ParserConfigurationException, SAXException, IOException { if (found.isEmpty()) { throw new RuntimeException(Translator.R("HTMLnoneFound")); } List id = sanitizeFilter(); List r = new ArrayList<>(found.size()); for (int i = 0; i < found.size(); i++) { Element element = found.get(i); if (id.contains(i)) { r.add(element); OutputController.getLogger().log("adding applet id: " + i + " as: " + (r.size() - 1)); } } return r; } private List sanitizeFilter() { List r = new ArrayList<>(found.size()); if (ids.isEmpty()) { if (found.size() > 1) { OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, Translator.R("HTMLmoreThenOne", found.size())); } r.add(0); return r; } if (ids.size() == 1 && ids.get(0).equalsIgnoreCase("all")) { for (int i = 0; i < found.size(); i++) { r.add(i); } return r; } for (int i = 0; i < ids.size(); i++) { Integer id = null; try { id = Integer.parseInt(ids.get(i)); } catch (NumberFormatException ex) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, ex); continue; } if (id < 0) { OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, "You have selected lesser then 0th applet. Using first"); if (!r.contains(0)) { r.add(0); } continue; } if (id >= found.size()) { OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, "You have selected higher then " + (found.size() - 1) + "th applet. Using last"); if (!r.contains(found.size() - 1)) { r.add(found.size() - 1); } continue; } OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, "Using " + id + "th applet from total of count " + (found.size() - 1)); r.add(id); } return r; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/runtime/html/PaxHeaders.17941/AppletParser.java0000644000000000000000000000013012654402377026371 xustar0030 mtime=1454507263.209432954 29 atime=1454507327.14158031 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/runtime/html/AppletParser.java0000644000175000002070000001540312654402377027121 0ustar00jvanekmock00000000000000/* Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.runtime.html; import java.net.MalformedURLException; import java.net.URL; import java.util.HashMap; import java.util.List; import java.util.Map; import net.sourceforge.jnlp.ParseException; import net.sourceforge.jnlp.Parser; import net.sourceforge.jnlp.PluginBridge; import net.sourceforge.jnlp.PluginParameters; import org.w3c.dom.Element; import org.w3c.dom.NamedNodeMap; public class AppletParser { private static final String[] PARAMS = new String[]{ "param", "PARAM", "Param" }; private final Element source; private final URL docBase; public AppletParser(Element applet, URL docbase) { this.source = applet; this.docBase = docbase; } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("width: ").append(source.getAttribute("width")).append("\n"); sb.append("height: ").append(source.getAttribute("height")).append("\n"); sb.append("codebase: ").append(source.getAttribute("codebase")).append("\n"); sb.append("code: ").append(source.getAttribute("code")).append("\n"); sb.append("archive: ").append(source.getAttribute("archive")).append("\n"); sb.append("data: ").append(source.getAttribute("data")).append("\n"); List found = findParams(); sb.append("params: ").append(found.size()).append("\n"); for (Element element : found) { sb.append("param: ").append(element.getAttribute("name")).append("=").append(element.getAttribute("value")).append("\n"); } return sb.toString(); } public PluginBridge toPluginBridge() throws Exception { return new PluginBridge( createCodebase(), docBase, getArchives(), getMain(), //removing all chars from number - like whitespace, px and so on... new Integer(sanitizeSize(source.getAttribute("width"))), new Integer(sanitizeSize(source.getAttribute("height"))), createParams()); } private URL createCodebase() throws ParseException, MalformedURLException { String inHtmlCodebase = source.getAttribute("codebase"); if (inHtmlCodebase != null && inHtmlCodebase.trim().isEmpty()) { inHtmlCodebase = "."; } URL u = Parser.getURL(inHtmlCodebase, "In html " + source.getNodeName() + "'s codebase", docBase, false); if (!u.toExternalForm().endsWith("/")) { u = new URL(u.toExternalForm() + "/"); } return u; } private PluginParameters createParams() { Map data = new HashMap<>(); List found = findParams(); for (Element element : found) { data.put(element.getAttribute("name"), element.getAttribute("value")); } //strange compatibility issue if (data.get("jnlp_href") == null) { if (data.get("code") == null && data.get("object") == null) { data.put("code", source.getAttribute("code")); } } //push all attributes to map NamedNodeMap atts = source.getAttributes(); for (int i = 0; i < atts.getLength(); i++) { String name = atts.item(i).getNodeName(); String value = atts.item(i).getTextContent(); if (name.trim().equalsIgnoreCase("width") || name.trim().equalsIgnoreCase("height")) { value = sanitizeSize(value); } data.put(name, value); } return new PluginParameters(data); } private List findParams() { return AppletExtractor.findElements(PARAMS, source, new ElementValidator() { @Override public boolean isElementValid(Element e) { return true; } }); } private String getMain() { String s = source.getAttribute("code"); if (s == null || s.trim().length() == 0) { List found = findParams(); for (Element element : found) { if (element.getAttribute("name").equalsIgnoreCase("code")) { s = element.getAttribute("value"); break; } } } if (s == null || s.trim().length() == 0) { s = source.getAttribute("classid"); if (s != null && s.contains(":")) { s = s.split(":")[1]; } } return s; } private String getArchives() { String s = source.getAttribute("archive"); if (s == null || s.trim().length() == 0) { List found = findParams(); for (Element element : found) { if (element.getAttribute("name").equalsIgnoreCase("archive")) { s = element.getAttribute("value"); break; } } } return s; } static String sanitizeSize(String attribute) { if (attribute == null) { return "1"; } //remove all nondigits return attribute.replaceAll("[^0-9]+", ""); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/runtime/html/PaxHeaders.17941/AppletExtractor.java0000644000000000000000000000013012654402377027110 xustar0030 mtime=1454507263.209432954 29 atime=1454507327.14158031 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/runtime/html/AppletExtractor.java0000644000175000002070000001635512654402377027647 0ustar00jvanekmock00000000000000/* Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.runtime.html; import java.io.IOException; import java.io.InputStream; import java.lang.reflect.Method; import java.net.URL; import java.util.LinkedList; import java.util.List; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import net.sourceforge.jnlp.JNLPFile; import net.sourceforge.jnlp.OptionsDefinitions; import net.sourceforge.jnlp.ParseException; import net.sourceforge.jnlp.Parser; import net.sourceforge.jnlp.ParserSettings; import net.sourceforge.jnlp.cache.UpdatePolicy; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.runtime.Translator; import net.sourceforge.jnlp.util.logging.OutputController; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; import org.xml.sax.SAXException; /** * This class is taking HTML document url as input, try to sanitize with * tagsoup, if availale - and then finds and applet declarations here. Then it * returns first, selected or last one as PluginBridge instance. See parse * method. */ public class AppletExtractor { private final URL html; private static final String[] APPLETS = new String[]{ "applet", "APPLET", "Applet", "object", "OBJECT", "Object", "embed", "EMBED", "Embed"}; private final ParserSettings ps; public AppletExtractor(URL html) { this(html, null); } public AppletExtractor(URL html, ParserSettings ps) { JNLPRuntime.saveHistory(html.toExternalForm()); this.html = html; this.ps = ps; } public URL getHtml() { return html; } private InputStream cleanStreamIfPossible(InputStream is) { try { if (ps != null && ps.isMalformedXmlAllowed()){ Object parser = Parser.getParserInstance(ps); Method m = parser.getClass().getMethod("xmlizeInputStream", InputStream.class); return (InputStream) m.invoke(null, is); } else { OutputController.getLogger().log(OutputController.Level.WARNING_ALL, Translator.R("TAGSOUPhtmlNotUsed", OptionsDefinitions.OPTIONS.XML.option)); } } catch (Exception ex) { OutputController.getLogger().log(OutputController.Level.WARNING_ALL, Translator.R("TAGSOUPhtmlBroken")); OutputController.getLogger().log(ex); } return is; } public List findAppletsOnPage() { try{ return findAppletsOnPageImpl(openDocument(cleanStreamIfPossible(JNLPFile.openURL(html, null, UpdatePolicy.ALWAYS)))); } catch (SAXException sex) { throw new RuntimeException(new ParseException(sex)); } catch (IOException | ParserConfigurationException ex) { throw new RuntimeException(ex); } } private List findAppletsOnPageImpl(Document doc) throws ParserConfigurationException, SAXException, IOException { OutputController.getLogger().log("Root element :" + doc.getDocumentElement().getNodeName()); //search for applets //search for embed/object // findElements(String[] elements, Element doc, ElementValidator elementValidator) { List found = new LinkedList(); for (String key : elements) { NodeList nList = doc.getElementsByTagName(key); for (int temp = 0; temp < nList.getLength(); temp++) { Node nNode = nList.item(temp); OutputController.getLogger().log("Found in html: " + nNode.getNodeName()); if (nNode.getNodeType() == Node.ELEMENT_NODE) { Element eElement = (Element) nNode; if (elementValidator.isElementValid(eElement)) { found.add(eElement); } } } } return found; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/runtime/PaxHeaders.17941/Translator.java0000644000000000000000000000013012654402377025154 xustar0030 mtime=1454507263.209432954 29 atime=1454507327.14158031 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/runtime/Translator.java0000644000175000002070000000741612654402377025711 0ustar00jvanekmock00000000000000// Copyright (C) 2010 Red Hat, Inc. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp.runtime; import java.text.MessageFormat; import java.util.Locale; import java.util.MissingResourceException; import java.util.ResourceBundle; /** * Utility class to provide simple methods to help localize messages */ public class Translator { private static class TranslatorHolder { //https://en.wikipedia.org/wiki/Double-checked_locking#Usage_in_Java //https://en.wikipedia.org/wiki/Initialization_on_demand_holder_idiom private static final Translator INSTANCE = new Translator(); private static Translator getTransaltor() { return TranslatorHolder.INSTANCE; } } /** * the localized resource strings */ private final ResourceBundle resources; Translator() { this("net.sourceforge.jnlp.resources.Messages"); } Translator(String s) { try { resources = ResourceBundle.getBundle(s); } catch (Exception ex) { throw new IllegalStateException("No bundles found for Locale: " + Locale.getDefault().toString() + "and missing base resource bundle in netx.jar:net/sourceforge/jnlp/resource/Messages.properties"); } } Translator(ResourceBundle resources) { this.resources = resources; } public static Translator getInstance() { return TranslatorHolder.getTransaltor(); } /** * Return a translated (localized) version of the message * @param message the message to translate * @return a string representing the localized message */ public static String R(String message) { return R(message, new Object[0]); } /** * @param message key to be found in properties * @param params params to be expanded to message * @return the localized string for the message */ public static String R(String message, Object... params) { return getInstance().getMessage(message, params); } /** * @return the localized resource string using the specified arguments. * @param key key to be found in properties * @param args params to be expanded to message */ protected String getMessage(String key, Object... args) { return MessageFormat.format(getMessage(key), args); } /** * Returns the localized resource string identified by the * specified key. If the message is empty, a null is * returned. */ private String getMessage(String key) { try { String result = resources.getString(key); if (result.length() == 0) return ""; else return result; } catch (NullPointerException e) { return getMessage("RNoResource", new Object[]{key}); } catch (MissingResourceException | ClassCastException e) { if (key == "RNoResource") { return "No localized text found"; } else { return getMessage("RNoResource", new Object[]{key}); } } } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/runtime/PaxHeaders.17941/RhinoBasedPacEvaluator.java0000644000000000000000000000013012654402377027350 xustar0030 mtime=1454507263.208432968 29 atime=1454507327.14158031 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/runtime/RhinoBasedPacEvaluator.java0000644000175000002070000002430112654402377030075 0ustar00jvanekmock00000000000000/* RhinoBasedPacEvaluator.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.runtime; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.net.SocketPermission; import java.net.URL; import java.security.AccessControlContext; import java.security.AccessController; import java.security.Permissions; import java.security.PrivilegedAction; import java.security.ProtectionDomain; import java.util.PropertyPermission; import net.sourceforge.jnlp.util.logging.OutputController; import net.sourceforge.jnlp.util.TimedHashMap; import org.mozilla.javascript.Context; import org.mozilla.javascript.Function; import org.mozilla.javascript.Scriptable; /** * Represents a Proxy Auto Config file. This object can be used to evaluate the * proxy file to find the proxy for a given url. * * @see The PAC File */ public class RhinoBasedPacEvaluator implements PacEvaluator { private final String pacHelperFunctionContents; private final String pacContents; private final URL pacUrl; private final TimedHashMap cache; /** * Initialize a new object by using the PAC file located at the given URL. * * @param pacUrl the url of the PAC file to use */ public RhinoBasedPacEvaluator(URL pacUrl) { OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "Using the Rhino based PAC evaluator for url " + pacUrl); pacHelperFunctionContents = getHelperFunctionContents(); this.pacUrl = pacUrl; pacContents = getPacContents(pacUrl); cache = new TimedHashMap(); } /** * Get the proxies for accessing a given URL. The result is obtained by * evaluating the PAC file with the given url (and the host) as input. * * This method performs caching of the result. * * @param url the url for which a proxy is desired * @return a list of proxies in a string like *
    "PROXY foo.example.com:8080; PROXY bar.example.com:8080; DIRECT"
    * * @see #getProxiesWithoutCaching(URL) */ public String getProxies(URL url) { String cachedResult = getFromCache(url); if (cachedResult != null) { return cachedResult; } String result = getProxiesWithoutCaching(url); addToCache(url, result); return result; } /** * Get the proxies for accessing a given URL. The result is obtained by * evaluating the PAC file with the given url (and the host) as input. * * @param url the url for which a proxy is desired * @return a list of proxies in a string like *
    "PROXY example.com:3128; DIRECT"
    * * @see #getProxies(URL) */ private String getProxiesWithoutCaching(URL url) { if (pacHelperFunctionContents == null) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, "Error loading pac functions"); return "DIRECT"; } EvaluatePacAction evaluatePacAction = new EvaluatePacAction(pacContents, pacUrl.toString(), pacHelperFunctionContents, url); // Purposefully giving only these permissions rather than using java.policy. The "evaluatePacAction" // isn't supposed to do very much and so doesn't require all the default permissions given by // java.policy Permissions p = new Permissions(); p.add(new RuntimePermission("accessClassInPackage.org.mozilla.javascript")); p.add(new SocketPermission("*", "resolve")); p.add(new PropertyPermission("java.vm.name", "read")); ProtectionDomain pd = new ProtectionDomain(null, p); AccessControlContext context = new AccessControlContext(new ProtectionDomain[] { pd }); return AccessController.doPrivileged(evaluatePacAction, context); } /** * Returns the contents of file at pacUrl as a String. */ private String getPacContents(URL pacUrl) { StringBuilder contents = null; try { String line = null; contents = new StringBuilder(); BufferedReader pacReader = new BufferedReader(new InputStreamReader(pacUrl.openStream())); try { while ((line = pacReader.readLine()) != null) { // OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, line); contents = contents.append(line).append("\n"); } } finally { pacReader.close(); } } catch (IOException e) { contents = null; } return (contents != null) ? contents.toString() : null; } /** * Returns the pac helper functions as a String. The functions are read * from net/sourceforge/jnlp/resources/pac-funcs.js */ private String getHelperFunctionContents() { StringBuilder contents = null; try { String line; ClassLoader cl = this.getClass().getClassLoader(); if (cl == null) { cl = ClassLoader.getSystemClassLoader(); } InputStream in = cl.getResourceAsStream("net/sourceforge/jnlp/runtime/pac-funcs.js"); BufferedReader pacFuncsReader = new BufferedReader(new InputStreamReader(in)); try { contents = new StringBuilder(); while ((line = pacFuncsReader.readLine()) != null) { // OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL,line); contents = contents.append(line).append("\n"); } } finally { pacFuncsReader.close(); } } catch (IOException e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); contents = null; } return (contents != null) ? contents.toString() : null; } /** * Gets an entry from the cache */ private String getFromCache(URL url) { String lookupString = url.getProtocol() + "://" + url.getHost(); String result = cache.get(lookupString); return result; } /** * Adds an entry to the cache */ private void addToCache(URL url, String proxyResult) { String lookupString = url.getAuthority() + "://" + url.getHost(); cache.put(lookupString, proxyResult); } /** * Helper classs to run remote javascript code (specified by the user as * PAC URL) inside a sandbox. */ private static class EvaluatePacAction implements PrivilegedAction { private String pacContents; private String pacUrl; private String pacFuncsContents; private URL url; public EvaluatePacAction(String pacContents, String pacUrl, String pacFuncsContents, URL url) { this.pacContents = pacContents; this.pacUrl = pacUrl; this.pacFuncsContents = pacFuncsContents; this.url = url; } public String run() { Context cx = Context.enter(); try { /* * TODO defense in depth. * * This is already running within a sandbox, but we can (and we * should) lock it down further. Look into ClassShutter. */ Scriptable scope = cx.initStandardObjects(); // any optimization level greater than -1 will trigger code generation // and this block will then need classloader permissions cx.setOptimizationLevel(-1); Object result = null; result = cx.evaluateString(scope, pacFuncsContents, "internal", 1, null); result = cx.evaluateString(scope, pacContents, pacUrl, 1, null); Object functionObj = scope.get("FindProxyForURL", scope); if (!(functionObj instanceof Function)) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, "FindProxyForURL not found"); return null; } else { Function findProxyFunction = (Function) functionObj; Object[] args = { url.toString(), url.getHost() }; result = findProxyFunction.call(cx, scope, scope, args); return (String) result; } } catch (Exception e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); return "DIRECT"; } finally { Context.exit(); } } } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/runtime/PaxHeaders.17941/PacEvaluatorFactory.java0000644000000000000000000000013012654402377026741 xustar0030 mtime=1454507263.208432968 29 atime=1454507327.14158031 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/runtime/PacEvaluatorFactory.java0000644000175000002070000001001412654402377027462 0ustar00jvanekmock00000000000000/* PacEvaluatorFactory.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.runtime; import java.io.InputStream; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.net.URL; import java.util.Properties; import net.sourceforge.jnlp.util.logging.OutputController; public class PacEvaluatorFactory { public static PacEvaluator getPacEvaluator(URL pacUrl) { boolean useRhino = false; ClassLoader cl = PacEvaluatorFactory.class.getClassLoader(); if (cl == null) { cl = ClassLoader.getSystemClassLoader(); } Properties properties = null; try (InputStream in = cl.getResourceAsStream("net/sourceforge/jnlp/build.properties")) { properties = new Properties(); properties.load(in); } catch (Exception e) { OutputController.getLogger().log(OutputController.Level.WARNING_ALL, "PAC provider is broken or don't exists. This is ok unless your applicatin is using JavaScript."); OutputController.getLogger().log(e); } if (properties == null) { return new FakePacEvaluator(); } String available = properties.getProperty("rhino.available"); useRhino = Boolean.valueOf(available); if (useRhino) { try { Class evaluator = Class.forName("net.sourceforge.jnlp.runtime.RhinoBasedPacEvaluator"); Constructor constructor = evaluator.getConstructor(URL.class); return (PacEvaluator) constructor.newInstance(pacUrl); } catch (ClassNotFoundException e) { // ignore } catch (InstantiationException e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); } catch (IllegalAccessException e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); } catch (NoSuchMethodException e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); } catch (IllegalArgumentException e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); } catch (InvocationTargetException e) { if (e.getCause() != null) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e.getCause()); } } } return new FakePacEvaluator(); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/runtime/PaxHeaders.17941/PacEvaluator.java0000644000000000000000000000013112654402377025412 xustar0030 mtime=1454507263.208432968 30 atime=1454507327.140580323 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/runtime/PacEvaluator.java0000644000175000002070000000427212654402377026143 0ustar00jvanekmock00000000000000/* PacEvaluator.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.runtime; import java.net.URL; /** * This interface represents an object which can evaluate Proxy Auto Config * files. */ public interface PacEvaluator { /** * Get the proxies for accessing a given URL. The result is obtained by * evaluating the PAC file with the given url (and the host) as input. * * @param url the url for which a proxy is desired * @return a list of proxies in a string like *
    "PROXY foo.example.com:8080; PROXY bar.example.com:8080; DIRECT"
    */ public String getProxies(URL url); } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/runtime/PaxHeaders.17941/ManifestAttributesChecker.java0000644000000000000000000000013112654402377030126 xustar0030 mtime=1454507263.207432981 30 atime=1454507327.140580323 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/runtime/ManifestAttributesChecker.java0000644000175000002070000005544512654402377030667 0ustar00jvanekmock00000000000000/* Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.runtime; import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; import net.sourceforge.jnlp.ExtensionDesc; import net.sourceforge.jnlp.JARDesc; import net.sourceforge.jnlp.JNLPFile; import net.sourceforge.jnlp.JNLPFile.ManifestBoolean; import net.sourceforge.jnlp.SecurityDesc.RequestedPermissionLevel; import net.sourceforge.jnlp.LaunchException; import net.sourceforge.jnlp.PluginBridge; import net.sourceforge.jnlp.ResourcesDesc; import net.sourceforge.jnlp.SecurityDesc; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.JNLPClassLoader.SecurityDelegate; import net.sourceforge.jnlp.runtime.JNLPClassLoader.SigningState; import net.sourceforge.jnlp.security.SecurityDialogs; import net.sourceforge.jnlp.security.appletextendedsecurity.AppletSecurityLevel; import net.sourceforge.jnlp.security.appletextendedsecurity.AppletStartupSecuritySettings; import net.sourceforge.jnlp.util.ClasspathMatcher.ClasspathMatchers; import net.sourceforge.jnlp.util.UrlUtils; import net.sourceforge.jnlp.util.logging.OutputController; import static net.sourceforge.jnlp.config.BasicValueValidators.splitCombination; import static net.sourceforge.jnlp.runtime.Translator.R; public class ManifestAttributesChecker { private final SecurityDesc security; private final JNLPFile file; private final SigningState signing; private final SecurityDelegate securityDelegate; public ManifestAttributesChecker(final SecurityDesc security, final JNLPFile file, final SigningState signing, final SecurityDelegate securityDelegate) throws LaunchException { this.security = security; this.file = file; this.signing = signing; this.securityDelegate = securityDelegate; } public enum MANIFEST_ATTRIBUTES_CHECK { ALL, NONE, PERMISSIONS, CODEBASE, TRUSTED, ALAC, ENTRYPOINT } void checkAll() throws LaunchException { List attributesCheck = getAttributesCheck(); if (attributesCheck.contains(MANIFEST_ATTRIBUTES_CHECK.NONE)) { OutputController.getLogger().log(OutputController.Level.WARNING_ALL, R("MACDisabledMessage")); } else { if (attributesCheck.contains(MANIFEST_ATTRIBUTES_CHECK.TRUSTED) || attributesCheck.contains(MANIFEST_ATTRIBUTES_CHECK.ALL)) { checkTrustedOnlyAttribute(); } else { OutputController.getLogger().log(OutputController.Level.WARNING_ALL, R("MACCheckSkipped", "Trusted-Only", "TRUSTED")); } if (attributesCheck.contains(MANIFEST_ATTRIBUTES_CHECK.CODEBASE) || attributesCheck.contains(MANIFEST_ATTRIBUTES_CHECK.ALL)) { checkCodebaseAttribute(); } else { OutputController.getLogger().log(OutputController.Level.WARNING_ALL, R("MACCheckSkipped", "Codebase", "CODEBASE")); } if (attributesCheck.contains(MANIFEST_ATTRIBUTES_CHECK.PERMISSIONS) || attributesCheck.contains(MANIFEST_ATTRIBUTES_CHECK.ALL)) { checkPermissionsAttribute(); } else { OutputController.getLogger().log(OutputController.Level.WARNING_ALL, R("MACCheckSkipped", "Permissions", "PERMISSIONS")); } if (attributesCheck.contains(MANIFEST_ATTRIBUTES_CHECK.ALAC) || attributesCheck.contains(MANIFEST_ATTRIBUTES_CHECK.ALL)) { checkApplicationLibraryAllowableCodebaseAttribute(); } else { OutputController.getLogger().log(OutputController.Level.WARNING_ALL, R("MACCheckSkipped", "Application Library Allowable Codebase", "ALAC")); } if (attributesCheck.contains(MANIFEST_ATTRIBUTES_CHECK.ENTRYPOINT) || attributesCheck.contains(MANIFEST_ATTRIBUTES_CHECK.ALL)) { checkEntryPoint(); } else { OutputController.getLogger().log(OutputController.Level.WARNING_ALL, R("MACCheckSkipped", "Entry-Point", "ENTRYPOINT")); } } } public static List getAttributesCheck() { final String deploymentProperty = JNLPRuntime.getConfiguration().getProperty(DeploymentConfiguration.KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK); String[] attributesCheck = splitCombination(deploymentProperty); List manifestAttributesCheckList = new ArrayList<>(); for (String attribute : attributesCheck) { for (MANIFEST_ATTRIBUTES_CHECK manifestAttribute : MANIFEST_ATTRIBUTES_CHECK.values()) { if (manifestAttribute.toString().equals(attribute)) { manifestAttributesCheckList.add(manifestAttribute); } } } return manifestAttributesCheckList; } /* * http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/security/manifest.html#entry_pt */ private void checkEntryPoint() throws LaunchException { if (signing == SigningState.NONE) { return; /*when app is not signed at all, then skip this check*/ } if (file.getLaunchInfo() == null) { OutputController.getLogger().log(OutputController.Level.MESSAGE_DEBUG, "Entry-Point can not be checked now, because of not existing launch info."); return; } if (file.getLaunchInfo().getMainClass() == null) { OutputController.getLogger().log(OutputController.Level.MESSAGE_DEBUG, "Entry-Point can not be checked now, because of unknown main class."); return; } final String[] eps = file.getManifestsAttributes().getEntryPoints(); String mainClass = file.getLaunchInfo().getMainClass(); if (eps == null) { OutputController.getLogger().log(OutputController.Level.MESSAGE_DEBUG, "Entry-Point manifest attribute for yours '" + mainClass + "'not found. Continuing."); return; } for (String ep : eps) { if (ep.equals(mainClass)) { OutputController.getLogger().log(OutputController.Level.MESSAGE_DEBUG, "Entry-Point of " + ep + " mathches " + mainClass + " continuing."); return; } } throw new LaunchException("None of the entry points specified: '" + file.getManifestsAttributes().getEntryPointString() + "' matched the main class " + mainClass + " and apelt is signed. This is a security error and the app will not be launched."); } /** * http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/security/manifest.html#trusted_only */ private void checkTrustedOnlyAttribute() throws LaunchException { final ManifestBoolean trustedOnly = file.getManifestsAttributes().isTrustedOnly(); if (trustedOnly == ManifestBoolean.UNDEFINED) { OutputController.getLogger().log(OutputController.Level.MESSAGE_DEBUG, "Trusted Only manifest attribute not found. Continuing."); return; } if (trustedOnly == ManifestBoolean.FALSE) { OutputController.getLogger().log(OutputController.Level.MESSAGE_DEBUG, "Trusted Only manifest attribute is false. Continuing."); return; } final Object desc = security.getSecurityType(); final String securityType; if (desc == null) { securityType = "Not Specified"; } else if (desc.equals(SecurityDesc.ALL_PERMISSIONS)) { securityType = "All-Permission"; } else if (desc.equals(SecurityDesc.SANDBOX_PERMISSIONS)) { securityType = "Sandbox"; } else if (desc.equals(SecurityDesc.J2EE_PERMISSIONS)) { securityType = "J2EE"; } else { securityType = "Unknown"; } final boolean isFullySigned = signing == SigningState.FULL; final boolean isSandboxed = securityDelegate.getRunInSandbox(); final boolean requestsCorrectPermissions = (isFullySigned && SecurityDesc.ALL_PERMISSIONS.equals(desc)) || (isSandboxed && SecurityDesc.SANDBOX_PERMISSIONS.equals(desc)); final String signedMsg; if (isFullySigned && !isSandboxed) { signedMsg = R("STOAsignedMsgFully"); } else if (isFullySigned && isSandboxed) { signedMsg = R("STOAsignedMsgAndSandbox"); } else { signedMsg = R("STOAsignedMsgPartiall"); } OutputController.getLogger().log(OutputController.Level.MESSAGE_DEBUG, "Trusted Only manifest attribute is \"true\". " + signedMsg + " and requests permission level: " + securityType); if (!(isFullySigned && requestsCorrectPermissions)) { throw new LaunchException(R("STrustedOnlyAttributeFailure", signedMsg, securityType)); } } /** * http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/manifest.html#codebase */ private void checkCodebaseAttribute() throws LaunchException { if (file.getCodeBase() == null || file.getCodeBase().getProtocol().equals("file")) { OutputController.getLogger().log(OutputController.Level.WARNING_ALL, R("CBCheckFile")); return; } final Object securityType = security.getSecurityType(); final URL codebase = UrlUtils.guessCodeBase(file); final ClasspathMatchers codebaseAtt = file.getManifestsAttributes().getCodebase(); if (codebaseAtt == null) { OutputController.getLogger().log(OutputController.Level.WARNING_ALL, R("CBCheckNoEntry")); return; } if (securityType.equals(SecurityDesc.SANDBOX_PERMISSIONS)) { if (codebaseAtt.matches(codebase)) { OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, R("CBCheckUnsignedPass")); } else { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, R("CBCheckUnsignedFail")); } } else { if (codebaseAtt.matches(codebase)) { OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, R("CBCheckOkSignedOk")); } else { if (file instanceof PluginBridge) { throw new LaunchException(R("CBCheckSignedAppletDontMatchException", file.getManifestsAttributes().getCodebase().toString(), codebase)); } else { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, R("CBCheckSignedFail")); } } } } /** * http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/security/manifest.html#permissions */ private void checkPermissionsAttribute() throws LaunchException { if (securityDelegate.getRunInSandbox()) { OutputController.getLogger().log(OutputController.Level.WARNING_ALL, "The 'Permissions' attribute of this application is '" + file.getManifestsAttributes().permissionsToString() + "'. You have chosen the Sandbox run option, which overrides the Permissions manifest attribute, or the applet has already been automatically sandboxed."); return; } final ManifestBoolean sandboxForced = file.getManifestsAttributes().isSandboxForced(); // If the attribute is not specified in the manifest, prompt the user. Oracle's spec says that the // attribute is required, but this breaks a lot of existing applets. Therefore, when on the highest // security level, we refuse to run these applets. On the standard security level, we ask. And on the // lowest security level, we simply proceed without asking. if (sandboxForced == ManifestBoolean.UNDEFINED) { final AppletSecurityLevel itwSecurityLevel = AppletStartupSecuritySettings.getInstance().getSecurityLevel(); if (itwSecurityLevel == AppletSecurityLevel.DENY_UNSIGNED) { throw new LaunchException("Your Extended applets security is at 'Very high', and this application is missing the 'permissions' attribute in manifest. This is fatal"); } if (itwSecurityLevel == AppletSecurityLevel.ASK_UNSIGNED) { final boolean userApproved = SecurityDialogs.showMissingPermissionsAttributeDialogue(file.getTitle(), file.getNotNullProbalbeCodeBase().toExternalForm()); if (!userApproved) { throw new LaunchException("Your Extended applets security is at 'high' and this application is missing the 'permissions' attribute in manifest. And you have refused to run it."); } else { OutputController.getLogger().log("Your Extended applets security is at 'high' and this application is missing the 'permissions' attribute in manifest. And you have allowed to run it."); } } return; } final RequestedPermissionLevel requestedPermissions = file.getRequestedPermissionLevel(); validateRequestedPermissionLevelMatchesManifestPermissions(requestedPermissions, sandboxForced); if (file instanceof PluginBridge) { // HTML applet if (isNoneOrDefault(requestedPermissions)) { if (sandboxForced == ManifestBoolean.TRUE && signing != SigningState.NONE) { securityDelegate.setRunInSandbox(); } } } else { // JNLP if (isNoneOrDefault(requestedPermissions)) { if (sandboxForced == ManifestBoolean.TRUE && signing != SigningState.NONE) { OutputController.getLogger().log(OutputController.Level.WARNING_ALL, "The 'permissions' attribute is '" + file.getManifestsAttributes().permissionsToString() + "' and the applet is signed. Forcing sandbox."); securityDelegate.setRunInSandbox(); } if (sandboxForced == ManifestBoolean.FALSE && signing == SigningState.NONE) { OutputController.getLogger().log(OutputController.Level.WARNING_ALL, "The 'permissions' attribute is '" + file.getManifestsAttributes().permissionsToString() + "' and the applet is unsigned. Forcing sandbox."); securityDelegate.setRunInSandbox(); } } } } private static boolean isLowSecurity() { return AppletStartupSecuritySettings.getInstance().getSecurityLevel().equals(AppletSecurityLevel.ALLOW_UNSIGNED); } private static boolean isNoneOrDefault(final RequestedPermissionLevel requested) { return requested == RequestedPermissionLevel.NONE || requested == RequestedPermissionLevel.DEFAULT; } private void validateRequestedPermissionLevelMatchesManifestPermissions(final RequestedPermissionLevel requested, final ManifestBoolean sandboxForced) throws LaunchException { if (requested == RequestedPermissionLevel.ALL && sandboxForced != ManifestBoolean.FALSE) { throw new LaunchException("The 'permissions' attribute is '" + file.getManifestsAttributes().permissionsToString() + "' but the applet requested " + requested + ". This is fatal"); } if (requested == RequestedPermissionLevel.SANDBOX && sandboxForced != ManifestBoolean.TRUE) { throw new LaunchException("The 'permissions' attribute is '" + file.getManifestsAttributes().permissionsToString() + "' but the applet requested " + requested + ". This is fatal"); } } private void checkApplicationLibraryAllowableCodebaseAttribute() throws LaunchException { //conditions URL codebase = file.getCodeBase(); URL documentBase = null; if (file instanceof PluginBridge) { documentBase = ((PluginBridge) file).getSourceLocation(); } if (documentBase == null) { documentBase = file.getCodeBase(); } //cases Set usedUrls = new HashSet(); URL sourceLocation = file.getSourceLocation(); ResourcesDesc[] resourcesDescs = file.getResourcesDescs(); if (sourceLocation != null) { usedUrls.add(UrlUtils.removeFileName(sourceLocation)); } for (ResourcesDesc resourcesDesc : resourcesDescs) { ExtensionDesc[] ex = resourcesDesc.getExtensions(); if (ex != null) { for (ExtensionDesc extensionDesc : ex) { if (extensionDesc != null) { usedUrls.add(UrlUtils.removeFileName(extensionDesc.getLocation())); } } } JARDesc[] jars = resourcesDesc.getJARs(); if (jars != null) { for (JARDesc jarDesc : jars) { if (jarDesc != null) { usedUrls.add(UrlUtils.removeFileName(jarDesc.getLocation())); } } } JNLPFile jnlp = resourcesDesc.getJNLPFile(); if (jnlp != null) { usedUrls.add(UrlUtils.removeFileName(jnlp.getSourceLocation())); } } OutputController.getLogger().log("Found alaca URLs to be verified"); for (URL url : usedUrls) { OutputController.getLogger().log(" - " + url.toExternalForm()); } if (usedUrls.isEmpty()) { //I hope this is the case, when the resources is/are //only codebase classes. Then it should be safe to return. OutputController.getLogger().log("The application is not using any url resources, skipping Application-Library-Allowable-Codebase Attribute check."); return; } boolean allOk = true; for (URL u : usedUrls) { if (UrlUtils.equalsIgnoreLastSlash(u, codebase) && UrlUtils.equalsIgnoreLastSlash(u, stripDocbase(documentBase))) { OutputController.getLogger().log("OK - "+u.toExternalForm()+" is from codebase/docbase."); } else { allOk = false; OutputController.getLogger().log("Warning! "+u.toExternalForm()+" is NOT from codebase/docbase."); } } if (allOk) { //all resoources are from codebase or document base. it is ok to proceeed. OutputController.getLogger().log("All applications resources (" + usedUrls.toArray(new URL[0])[0] + ") are from codebas/documentbase " + codebase + "/" + documentBase + ", skipping Application-Library-Allowable-Codebase Attribute check."); return; } ClasspathMatchers att = null; if (signing == SigningState.NONE) { //for unsigned app we are ignoring value in manifesdt (may be faked) } else { att = file.getManifestsAttributes().getApplicationLibraryAllowableCodebase(); } if (att == null) { final boolean userApproved = SecurityDialogs.showMissingALACAttributePanel(file.getTitle(), file.getNotNullProbalbeCodeBase(), usedUrls); if (!userApproved) { throw new LaunchException("The application uses non-codebase resources, has no Application-Library-Allowable-Codebase Attribute, and was blocked from running by the user"); } else { OutputController.getLogger().log("The application uses non-codebase resources, has no Application-Library-Allowable-Codebase Attribute, and was allowed to run by the user or user's security settings"); return; } } else { for (URL foundUrl : usedUrls) { if (!att.matches(foundUrl)) { throw new LaunchException("The resource from " + foundUrl + " does not match the location in Application-Library-Allowable-Codebase Attribute " + att + ". Blocking the application from running."); } else { OutputController.getLogger().log("The resource from " + foundUrl + " does match the location in Application-Library-Allowable-Codebase Attribute " + att + ". Continuing."); } } } final boolean userApproved = isLowSecurity() || SecurityDialogs.showMatchingALACAttributePanel(file, documentBase, usedUrls); if (!userApproved) { throw new LaunchException("The application uses non-codebase resources, which do match its Application-Library-Allowable-Codebase Attribute, but was blocked from running by the user."); } else { OutputController.getLogger().log("The application uses non-codebase resources, which do match its Application-Library-Allowable-Codebase Attribute, and was allowed to run by the user or user's security settings."); } } //package private for testing //not perfect but ok for usecase static URL stripDocbase(URL documentBase) { String s = documentBase.toExternalForm(); if (s.endsWith("/") || s.endsWith("\\")) { return documentBase; } int i1 = s.lastIndexOf("/"); int i2 = s.lastIndexOf("\\"); int i = Math.max(i1, i2); if (i <= 8 || i >= s.length()) { return documentBase; } s = s.substring(0, i+1); try { documentBase = new URL(s); } catch (MalformedURLException ex) { OutputController.getLogger().log(ex); } return documentBase; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/runtime/PaxHeaders.17941/ManageJnlpResources.java0000644000000000000000000000013112654402377026733 xustar0030 mtime=1454507263.207432981 30 atime=1454507327.140580323 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/runtime/ManageJnlpResources.java0000644000175000002070000001420312654402377027457 0ustar00jvanekmock00000000000000/* ManageJnlpResources.java Copyright (C) 2012, Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.runtime; import java.net.URL; import java.util.ArrayList; import java.util.List; import net.sourceforge.jnlp.JARDesc; import net.sourceforge.jnlp.ResourcesDesc; import net.sourceforge.jnlp.Version; import net.sourceforge.jnlp.runtime.JNLPClassLoader.DownloadAction; public class ManageJnlpResources { /** * Returns jars from the JNLP file with the part name provided. * @param rootClassLoader Root JNLPClassLoader of the application. * @param ref Path of the launch or extension JNLP File containing the * resource. If null, main JNLP's file location will be used instead. * @param part The name of the part. * @param version version of jar * @return jars found. */ public static JARDesc[] findJars(final JNLPClassLoader rootClassLoader, final URL ref, final String part, final Version version) { JNLPClassLoader foundLoader = LocateJnlpClassLoader.getLoaderByJnlpFile(rootClassLoader, ref); if (foundLoader != null) { List foundJars = new ArrayList<>(); ResourcesDesc resources = foundLoader.getJNLPFile().getResources(); for (JARDesc eachJar : resources.getJARs(part)) { if (version == null || version.equals(eachJar.getVersion())) foundJars.add(eachJar); } return foundJars.toArray(new JARDesc[foundJars.size()]); } return new JARDesc[] {}; } /** * Removes jars from cache. * @param classLoader JNLPClassLoader of the application that is associated to the resource. * @param ref Path of the launch or extension JNLP File containing the * resource. If null, main JNLP's file location will be used instead. * @param jars Jars marked for removal. */ public static void removeCachedJars(final JNLPClassLoader classLoader, final URL ref, final JARDesc[] jars) { JNLPClassLoader foundLoader = LocateJnlpClassLoader.getLoaderByJnlpFile(classLoader, ref); if (foundLoader != null) foundLoader.removeJars(jars); } /** * Downloads jars identified by part name. * @param classLoader JNLPClassLoader of the application that is associated to the resource. * @param ref Path of the launch or extension JNLP File containing the * resource. If null, main JNLP's file location will be used instead. * @param part The name of the path. * @param version version of jar to be downlaoded */ public static void downloadJars(final JNLPClassLoader classLoader, final URL ref, final String part, final Version version) { JNLPClassLoader foundLoader = LocateJnlpClassLoader.getLoaderByJnlpFile(classLoader, ref); if (foundLoader != null) foundLoader.initializeNewJarDownload(ref, part, version); } /** * Downloads and initializes resources which are not mentioned in the jnlp file. * Used by DownloadService. * @param rootClassLoader Root JNLPClassLoader of the application. * @param ref Path to the resource. * @param version The version of resource. If null, no version is specified. */ public static void loadExternalResouceToCache(final JNLPClassLoader rootClassLoader, final URL ref, final String version) { rootClassLoader.manageExternalJars(ref, version, DownloadAction.DOWNLOAD_TO_CACHE); } /** * Removes resource which are not mentioned in the jnlp file. * Used by DownloadService. * @param rootClassLoader Root JNLPClassLoader of the application. * @param ref Path to the resource. * @param version The version of resource. If null, no version is specified. */ public static void removeExternalCachedResource(final JNLPClassLoader rootClassLoader, final URL ref, final String version) { rootClassLoader.manageExternalJars(ref, version, DownloadAction.REMOVE_FROM_CACHE); } /** * Returns {@code true} if the resource (not mentioned in the jnlp file) is cached, otherwise {@code false} * Used by DownloadService. * @param rootClassLoader Root {@link JNLPClassLoader} of the application. * @param ref Path to the resource. * @param version The version of resource. If {@code null}, no version is specified. * @return {@code true} if the external resource is cached, otherwise {@code false} */ public static boolean isExternalResourceCached(final JNLPClassLoader rootClassLoader, final URL ref, final String version) { return rootClassLoader.manageExternalJars(ref, version, DownloadAction.CHECK_CACHE); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/Node.java0000644000000000000000000000013112654402377022226 xustar0030 mtime=1454507263.252432381 30 atime=1454507327.124580537 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/Node.java0000644000175000002070000001263512654402377022761 0ustar00jvanekmock00000000000000/* Node.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp; import java.util.ArrayList; import java.util.Enumeration; import java.util.List; import net.sourceforge.nanoxml.XMLElement; // this class makes assumptions on how parser calls methods (such // as getFirstChild->getNextChild only called by a single loop at // a time, so no need for an iterator). /** * This class converts the NanoXML's XMLElement nodes into the * regular XML Node interface (for the methods used by Parser). */ /* NANO */ class Node { private XMLElement xml; private Node next; private Node children[]; private List attributeNames= null; Node(XMLElement xml) { this.xml = xml; } Node getFirstChild() { if (children == null) { getChildNodes(); } if (children.length == 0) { return null; } else { return children[0]; } } Node getNextSibling() { return next; } void normalize() { } String getNodeValue() { return xml.getContent(); } Node[] getChildNodes() { if (children == null) { List list = new ArrayList(); for (Enumeration e = xml.enumerateChildren(); e.hasMoreElements();) { list.add(new Node(e.nextElement())); } children = list.toArray(new Node[list.size()]); for (int i = 0; i < children.length - 1; i++) { children[i].next = children[i + 1]; } } return children; } /** * To retrieve all attribute names * @return all attribute names of the Node in ArrayList */ List getAttributeNames() { if (attributeNames == null) { attributeNames= new ArrayList(); for (Enumeration e = xml.enumerateAttributeNames(); e.hasMoreElements();) { attributeNames.add(new String(e.nextElement())); } } return attributeNames; } String getAttribute(String name) { return (String) xml.getAttribute(name); } String getNodeName() { if (xml.getName() == null) { return ""; } else { return xml.getName(); } } @Override public String toString() { return getNodeName(); } } /** * This class converts the TinyXML's ParsedXML nodes into the * regular XML Node interface (for the methods used by Parser). */ /* TINY class Node { private ParsedXML tinyNode; private Node next; private Node children[]; private String attributeNames[]; Node(ParsedXML tinyNode) { this.tinyNode = tinyNode; } Node getFirstChild() { if (children == null) getChildNodes(); if (children.length == 0) return null; else return children[0]; } Node getNextSibling() { return next; } void normalize() { } String getNodeValue() { return tinyNode.getContent(); } Node[] getChildNodes() { if (children == null) { List list = new ArrayList(); for (Enumeration e = tinyNode.elements(); e.hasMoreElements();) { list.add( new Node((ParsedXML)e.nextElement()) ); } children = (Node[]) list.toArray( new Node[list.size()] ); for (int i=0; i < children.length-1; i++) children[i].next = children[i+1]; } return children; } String getAttribute(String name) { return tinyNode.getAttribute(name); } String getNodeName() { if (tinyNode.getName() == null) return ""; else return tinyNode.getName(); } public String toString() { return getNodeName(); } } */ icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/NetxPanel.java0000644000000000000000000000013112654402377023237 xustar0030 mtime=1454507263.252432381 30 atime=1454507327.124580537 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/NetxPanel.java0000644000175000002070000002004112654402377023760 0ustar00jvanekmock00000000000000/* * Copyright 2012 Red Hat, Inc. * This file is part of IcedTea, http://icedtea.classpath.org * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Sun designates this * particular file as subject to the "Classpath" exception as provided * by Sun in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */ package net.sourceforge.jnlp; import net.sourceforge.jnlp.runtime.AppletInstance; import net.sourceforge.jnlp.runtime.JNLPRuntime; import java.net.URL; import java.util.HashMap; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import net.sourceforge.jnlp.splashscreen.SplashController; import net.sourceforge.jnlp.splashscreen.SplashPanel; import net.sourceforge.jnlp.splashscreen.SplashUtils; import net.sourceforge.jnlp.util.logging.OutputController; import sun.applet.AppletViewerPanelAccess; import sun.awt.SunToolkit; /** * This panel calls into netx to run an applet, and pipes the display * into a panel from the icedtea-web browser plugin. * * @author Francis Kung <fkung@redhat.com> */ public class NetxPanel extends AppletViewerPanelAccess implements SplashController { private final PluginParameters parameters; private PluginBridge bridge = null; private AppletInstance appInst = null; private SplashController splashController; private volatile boolean initialized; // We use this so that we can create exactly one thread group // for all panels with the same uKey. private static final Map uKeyToTG = new HashMap<>(); private static final Object TGMapMutex = new Object(); // This map is actually a set (unfortunately there is no ConcurrentSet // in java.util.concurrent). If KEY is in this map, then we know that // an app context has been created for the panel that has uKey.equals(KEY), // so we avoid creating it a second time for panels with the same uKey. // Because it's a set, only the keys matter. However, we can't insert // null values in because if we did, we couldn't use null checks to see // if a key was absent before a putIfAbsent. private static final ConcurrentMap appContextCreated = new ConcurrentHashMap<>(); public NetxPanel(URL documentURL, PluginParameters params, PluginBridge bridge) { super(documentURL, params.getUnderlyingMap()); this.bridge = bridge; this.parameters = params; this.initialized = false; String uniqueKey = params.getUniqueKey(getCodeBase()); synchronized(TGMapMutex) { if (!uKeyToTG.containsKey(uniqueKey)) { ThreadGroup tg = new ThreadGroup(Launcher.mainGroup, this.getDocumentURL().toString()); uKeyToTG.put(uniqueKey, tg); } } } public AppletInstance getAppInst() { return appInst; } @Override protected void showAppletException(Throwable t) { /* * Log any exceptions thrown while loading, initializing, starting, * and stopping the applet. */ OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, t); //new logger super.showAppletException(t); } //Overriding to use Netx classloader. You might need to relax visibility //in sun.applet.AppletPanel for runLoader(). @Override protected void ourRunLoader() { try { if (bridge == null) { bridge = new PluginBridge(getBaseURL(), getDocumentBase(), getJarFiles(), getCode(), getWidth(), getHeight(), parameters); } init(bridge); } catch (Exception e) { status = APPLET_ERROR; OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); replaceSplash(SplashUtils.getErrorSplashScreen(getWidth(), getHeight(), e)); } finally { // PR1157: This needs to occur even in the case of an exception // so that the applet's event listeners are signaled. // Once PluginAppletViewer.AppletEventListener is signaled PluginAppletViewer can properly stop waiting // in PluginAppletViewer.waitForAppletInit this.initialized = true; dispatchAppletEvent(APPLET_LOADING_COMPLETED, null); } } /** * Creates a new Thread (in a new applet-specific ThreadGroup) for running * the applet */ // Reminder: Relax visibility in sun.applet.AppletPanel @Override protected synchronized void createAppletThread() { // initialize JNLPRuntime in the main threadgroup synchronized (JNLPRuntime.initMutex) { //The custom NetX Policy and SecurityManager are set here. if (!JNLPRuntime.isInitialized()) { OutputController.getLogger().log("initializing JNLPRuntime..."); JNLPRuntime.initialize(false); } else { OutputController.getLogger().log("JNLPRuntime already initialized"); } } handler = new Thread(getThreadGroup(), this, "NetxPanelThread@" + this.getDocumentURL()); handler.start(); } public void updateSizeInAtts(int height, int width) { parameters.updateSize(width, height); } public ClassLoader getAppletClassLoader() { return appInst.getClassLoader(); } public boolean isInitialized() { return initialized; } public ThreadGroup getThreadGroup() { synchronized(TGMapMutex) { return uKeyToTG.get(parameters.getUniqueKey(getCodeBase())); } } public void createNewAppContext() { if (Thread.currentThread().getThreadGroup() != getThreadGroup()) { throw new RuntimeException("createNewAppContext called from the wrong thread."); } // only create a new context if one hasn't already been created for the // applets with this unique key. if (null == appContextCreated.putIfAbsent(parameters.getUniqueKey(getCodeBase()), Boolean.TRUE)) { SunToolkit.createNewAppContext(); } } public void setAppletViewerFrame(SplashController framePanel) { splashController=framePanel; } @Override public void removeSplash() { splashController.removeSplash(); } @Override public void replaceSplash(SplashPanel r) { splashController.replaceSplash(r); } @Override public int getSplashWidth() { return splashController.getSplashWidth(); } @Override public int getSplashHeigth() { return splashController.getSplashHeigth(); } public void init(PluginBridge bridge) throws LaunchException { setDoInitIfExists(true); dispatchAppletEvent(APPLET_LOADING, null); status = APPLET_LOAD; Launcher l = new Launcher(false); // May throw LaunchException: appInst = (AppletInstance) l.launch(bridge, this); setApplet(appInst.getApplet()); if (getApplet() != null) { // Stick it in the frame getApplet().setStub(this); getApplet().setVisible(false); add("Center", getApplet()); showAppletStatus("loaded"); validate(); } } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/MissingVendorException.java0000644000000000000000000000013112654402377026007 xustar0030 mtime=1454507263.251432394 30 atime=1454507327.124580537 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/MissingVendorException.java0000644000175000002070000000304312654402377026533 0ustar00jvanekmock00000000000000// Copyright (C) 2012 Red Hat, Inc. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp; import static net.sourceforge.jnlp.runtime.Translator.R; /** * Thrown when a vendor that is required from the information tag is not found * under the current JVM's locale or as a generalized element. */ public class MissingVendorException extends RequiredElementException { private static final long serialVersionUID = 1L; private static final String message = R("PMissingElement", R("PMissingVendor")); /* (non-Javadoc) * @see net.sourceforge.jnlp.ParseException(String) */ public MissingVendorException() { super(message); } /* (non-Javadoc) * @see net.sourceforge.jnlp.ParseException(String, Throwable) */ public MissingVendorException(Throwable cause) { super(message, cause); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/MissingTitleException.java0000644000000000000000000000013112654402377025633 xustar0030 mtime=1454507263.251432394 30 atime=1454507327.124580537 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/MissingTitleException.java0000644000175000002070000000303712654402377026362 0ustar00jvanekmock00000000000000// Copyright (C) 2012 Red Hat, Inc. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp; import static net.sourceforge.jnlp.runtime.Translator.R; /** * Thrown when a title that is required from the information tag is not found * under the current JVM's locale or as a generalized element. */ public class MissingTitleException extends RequiredElementException { private static final long serialVersionUID = 1L; private static final String message = R("PMissingElement", R("PMissingTitle")); /* (non-Javadoc) * @see net.sourceforge.jnlp.ParseException(String) */ public MissingTitleException() { super(message); } /* (non-Javadoc) * @see net.sourceforge.jnlp.ParseException(String, Throwable) */ public MissingTitleException(Throwable cause) { super(message, cause); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/MissingInformationException.java0000644000000000000000000000013112654402377027037 xustar0030 mtime=1454507263.251432394 30 atime=1454507327.124580537 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/MissingInformationException.java0000644000175000002070000000300612654402377027562 0ustar00jvanekmock00000000000000// Copyright (C) 2012 Red Hat, Inc. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp; import static net.sourceforge.jnlp.runtime.Translator.R; /** * Thrown when the required information tag is not found * under the current JVM's locale or as a generalized element. */ public class MissingInformationException extends RequiredElementException { private static final long serialVersionUID = 1L; private static final String message = R("PNoInfoElement"); /* (non-Javadoc) * @see net.sourceforge.jnlp.ParseException(String) */ public MissingInformationException() { super(message); } /* (non-Javadoc) * @see net.sourceforge.jnlp.ParseException(String, Throwable) */ public MissingInformationException(Throwable cause) { super(message, cause); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/MenuDesc.java0000644000000000000000000000013112654402377023044 xustar0030 mtime=1454507263.251432394 30 atime=1454507327.124580537 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/MenuDesc.java0000644000175000002070000000231712654402377023573 0ustar00jvanekmock00000000000000// Copyright (C) 2009 Red Hat, Inc. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp; public class MenuDesc { /** the submenu for this menu entry */ private final String subMenu; /** * Create a new menu descriptor * @param subMenu sub-menu of this menu if any or null. */ public MenuDesc(String subMenu) { this.subMenu = subMenu; } /** * @return the submenu for this menu entry. */ public String getSubMenu() { return subMenu; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/MalformedXMLParser.java0000644000000000000000000000013112654402377025005 xustar0030 mtime=1454507263.251432394 30 atime=1454507327.124580537 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/MalformedXMLParser.java0000644000175000002070000001112012654402377025524 0ustar00jvanekmock00000000000000/* Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp; import static net.sourceforge.jnlp.runtime.Translator.R; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStreamWriter; import java.io.Writer; import net.sourceforge.jnlp.util.logging.OutputController; import org.ccil.cowan.tagsoup.HTMLSchema; import org.ccil.cowan.tagsoup.Parser; import org.ccil.cowan.tagsoup.XMLWriter; import org.xml.sax.InputSource; import org.xml.sax.SAXException; import org.xml.sax.XMLReader; /** * An specialized {@link XMLParser} that uses TagSoup[1] to parse * malformed XML * * Used by net.sourceforge.jnlp.Parser * * [1] http://home.ccil.org/~cowan/XML/tagsoup/ */ public class MalformedXMLParser extends XMLParser { /** * Parses the data from an {@link java.io.InputStream} to create a XML tree. * Returns a {@link Node} representing the root of the tree. * * @param input the {@link java.io.InputStream} to read data from * @return root node of document * @throws ParseException if an exception occurs while parsing the input */ @Override public Node getRootNode(InputStream input) throws ParseException { OutputController.getLogger().log("Using MalformedXMLParser"); InputStream xmlInput = xmlizeInputStream(input); return super.getRootNode(xmlInput); } /** * Reads malformed XML from the InputStream original and returns a new * InputStream which can be used to read a well-formed version of the input * * @param original original input * @return an {@link InputStream} which can be used to read a well-formed * version of the input XML * @throws ParseException if an exception occurs while parsing the input */ public static InputStream xmlizeInputStream(InputStream original) throws ParseException { try { ByteArrayOutputStream out = new ByteArrayOutputStream(); HTMLSchema schema = new HTMLSchema(); XMLReader reader = new Parser(); //TODO walk through the javadoc and tune more settings //see tagsoup javadoc for details reader.setProperty(Parser.schemaProperty, schema); reader.setFeature(Parser.bogonsEmptyFeature, false); reader.setFeature(Parser.ignorableWhitespaceFeature, true); reader.setFeature(Parser.ignoreBogonsFeature, false); Writer writeger = new OutputStreamWriter(out); XMLWriter x = new XMLWriter(writeger); reader.setContentHandler(x); InputSource s = new InputSource(original); reader.parse(s); return new ByteArrayInputStream(out.toByteArray()); } catch (SAXException | IOException e1) { throw new ParseException(R("PBadXML"), e1); } catch (NoClassDefFoundError e2) { OutputController.getLogger().log(e2); ParseException.setUsed(null); return original; } } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/Launcher.java0000644000000000000000000000013012654402377023101 xustar0030 mtime=1454507263.250432408 29 atime=1454507327.12358055 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/Launcher.java0000644000175000002070000011155712654402377023640 0ustar00jvanekmock00000000000000// Copyright (C) 2001-2003 Jon A. Maxwell (JAM) // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp; import static net.sourceforge.jnlp.runtime.Translator.R; import java.applet.Applet; import java.applet.AppletStub; import java.awt.Container; import java.awt.SplashScreen; import java.io.File; import java.lang.reflect.Method; import java.net.URL; import java.util.Arrays; import java.util.LinkedList; import java.util.List; import java.util.Map; import net.sourceforge.jnlp.util.JarFile; import net.sourceforge.jnlp.cache.CacheUtil; import net.sourceforge.jnlp.cache.UpdatePolicy; import net.sourceforge.jnlp.runtime.AppletInstance; import net.sourceforge.jnlp.runtime.ApplicationInstance; import net.sourceforge.jnlp.runtime.JNLPClassLoader; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.services.InstanceExistsException; import net.sourceforge.jnlp.services.ServiceUtil; import javax.swing.SwingUtilities; import javax.swing.text.html.parser.ParserDelegator; import net.sourceforge.jnlp.splashscreen.SplashUtils; import net.sourceforge.jnlp.util.logging.OutputController; import sun.awt.SunToolkit; /** * Launches JNLPFiles either in the foreground or background. *

    * An optional LaunchHandler can be specified that is notified of * warning and error condition while launching and that indicates * whether a launch may proceed after a warning has occurred. If * specified, the LaunchHandler is notified regardless of whether * the file is launched in the foreground or background. *

    * * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.22 $ */ public class Launcher { // defines class Launcher.BgRunner, Launcher.TgThread /** shared thread group */ /*package*/static final ThreadGroup mainGroup = new ThreadGroup(R("LAllThreadGroup")); /** the handler */ private LaunchHandler handler = null; /** the update policy */ private UpdatePolicy updatePolicy = JNLPRuntime.getDefaultUpdatePolicy(); /** whether to create an AppContext (if possible) */ private boolean context = true; /** If the application should call JNLPRuntime.exit on fatal errors */ private boolean exitOnFailure = true; private ParserSettings parserSettings = new ParserSettings(); private Map> extra = null; /** * Create a launcher with the runtime's default update policy * and launch handler. */ public Launcher() { this(null, null); if (handler == null) { handler = JNLPRuntime.getDefaultLaunchHandler(); } } /** * Create a launcher with the runtime's default update policy * and launch handler. * * @param exitOnFailure Exit if there is an error (usually default, but false when being used from the plugin) */ public Launcher(boolean exitOnFailure) { this(null, null); if (handler == null) { handler = JNLPRuntime.getDefaultLaunchHandler(); } this.exitOnFailure = exitOnFailure; } /** * Create a launcher with the specified handler and the * runtime's default update policy. * * @param handler the handler to use or null for no handler. */ public Launcher(LaunchHandler handler) { this(handler, null); } /** * Create a launcher with an optional handler using the * specified update policy and launch handler. * * @param handler the handler to use or null for no handler. * @param policy the update policy to use or null for default policy. */ public Launcher(LaunchHandler handler, UpdatePolicy policy) { if (policy == null) policy = JNLPRuntime.getDefaultUpdatePolicy(); this.handler = handler; this.updatePolicy = policy; } /** * Sets the update policy used by launched applications. * @param policy to be used for resources */ public void setUpdatePolicy(UpdatePolicy policy) { if (policy == null) { throw new IllegalArgumentException(R("LNullUpdatePolicy")); } this.updatePolicy = policy; } /** * @return the update policy used when launching applications. */ public UpdatePolicy getUpdatePolicy() { return updatePolicy; } /** * Sets whether to launch the application in a new AppContext * (a separate event queue, look and feel, etc). If the * sun.awt.SunToolkit class is not present then this method * has no effect. The default value is true. * @param context appcontext to be set */ public void setCreateAppContext(boolean context) { this.context = context; } /** * @return whether applications are launched in their own * AppContext. */ public boolean isCreateAppContext() { return this.context; } /** * @param settings the parser settings to use when the Launcher initiates parsing of * a JNLP file. */ public void setParserSettings(ParserSettings settings) { parserSettings = settings; } /** * Set a map to use when trying to extract extra information, including * arguments, properties and parameters, to be merged into the main JNLP * @param input a map containing extra information to add to the main JNLP. * the values for keys "arguments", "parameters", and "properties" are * used. */ public void setInformationToMerge(Map> input) { this.extra = input; } /** * Launches a JNLP file by calling the launch method for the * appropriate file type. The application will be started in * a new window. * * @param file the JNLP file to launch * @return the application instance * @throws LaunchException if an error occurred while launching (also sent to handler) */ public ApplicationInstance launch(JNLPFile file) throws LaunchException { return launch(file, null); } /** * Launches a JNLP file inside the given container if it is an applet. Specifying a * container has no effect for Applcations and Installers. * * @param file the JNLP file to launch * @param cont the container in which to place the application, if it is an applet * @return the application instance * @throws LaunchException if an error occurred while launching (also sent to handler) */ public ApplicationInstance launch(JNLPFile file, Container cont) throws LaunchException { TgThread tg; mergeExtraInformation(file, extra); JNLPRuntime.markNetxRunning(); if (!JNLPRuntime.isOfflineForced()) { //Xoffline NOT specified //First checks whether offline-allowed tag is specified inside the jnlp file. if (!file.getInformation().isOfflineAllowed() && !JNLPRuntime.isOnlineDetected()) { { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, "Remote systems unreachable, and client application is not able to run offline. Exiting."); return null; } } } else { //Xoffline IS specified if (!file.getInformation().isOfflineAllowed() && !JNLPRuntime.isOnlineDetected()) { { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, "Remote systems unreachable, and client application is not able to run offline. However, you specified -Xoffline argument. Attmpting to run."); } } } if (file instanceof PluginBridge && cont != null) { tg = new TgThread(file, cont, true); } else if (cont == null) { tg = new TgThread(file); } else { tg = new TgThread(file, cont); } tg.start(); try { tg.join(); } catch (InterruptedException ex) { //By default, null is thrown here, and the message dialog is shown. throw launchWarning(new LaunchException(file, ex, R("LSMinor"), R("LCSystem"), R("LThreadInterrupted"), R("LThreadInterruptedInfo"))); } if (tg.getException() != null) { throw tg.getException(); } // passed to handler when first created if (handler != null) { handler.launchCompleted(tg.getApplication()); } return tg.getApplication(); } /** * Launches a JNLP file by calling the launch method for the * appropriate file type. * * @param location the URL of the JNLP file to launch * location to get the pristine version * @throws LaunchException if there was an exception * @return the application instance */ public ApplicationInstance launch(URL location) throws LaunchException { JNLPRuntime.saveHistory(location.toExternalForm()); return launch(fromUrl(location)); } /** * Merges extra information into the jnlp file * * @param file the JNLPFile * @param extra extra information to merge into the JNLP file * @throws LaunchException if an exception occurs while extracting * extra information */ private void mergeExtraInformation(JNLPFile file, Map> extra) throws LaunchException { if (extra == null) { return; } List properties = extra.get("properties"); if (properties != null) { addProperties(file, properties); } List arguments = extra.get("arguments"); if (arguments != null && file.isApplication()) { addArguments(file, arguments); } List parameters = extra.get("parameters"); if (parameters != null && file.isApplet()) { addParameters(file, parameters); } } /** * Add the properties to the JNLP file. * @throws LaunchException if an exception occurs while extracting * extra information */ private void addProperties(JNLPFile file, List props) throws LaunchException { ResourcesDesc resources = file.getResources(); for (String input : props) { try{ resources.addResource(PropertyDesc.fromString(input)); }catch (LaunchException ex){ throw launchError(ex); } } } /** * Add the params to the JNLP file; only call if file is * actually an applet file. * @throws LaunchException if an exception occurs while extracting * extra information */ private void addParameters(JNLPFile file, List params) throws LaunchException { AppletDesc applet = file.getApplet(); for (String input : params) { // allows empty param, not sure about validity of that. int equals = input.indexOf("="); if (equals == -1) { throw launchError(new LaunchException(R("BBadParam", input))); } String name = input.substring(0, equals); String value = input.substring(equals + 1, input.length()); applet.addParameter(name, value); } } /** * Add the arguments to the JNLP file; only call if file is * actually an application (not installer). */ private void addArguments(JNLPFile file, List args) { ApplicationDesc app = file.getApplication(); for (String input : args ) { app.addArgument(input); } } /** * Launches the JNLP file in a new JVM instance. The launched * application's output is sent to the system out and it's * standard input channel is closed. * * @param vmArgs the arguments to pass to the new JVM. Can be empty but * must not be null. * @param file the JNLP file to launch * @param javawsArgs the arguments to pass to the javaws command. Can be * an empty list but must not be null. * @throws LaunchException if there was an exception */ public void launchExternal(List vmArgs, JNLPFile file, List javawsArgs) throws LaunchException { List updatedArgs = new LinkedList(javawsArgs); if (file.getFileLocation() != null) { updatedArgs.add(file.getFileLocation().toString()); } else if (file.getSourceLocation() != null) { updatedArgs.add(file.getFileLocation().toString()); } else { launchError(new LaunchException(file, null, R("LSFatal"), R("LCExternalLaunch"), R("LNullLocation"), R("LNullLocationInfo"))); } launchExternal(vmArgs, updatedArgs); } /** * Launches the JNLP file in a new JVM instance. The launched * application's output is sent to the system out and it's * standard input channel is closed. * * @param url the URL of the JNLP file to launch * @throws LaunchException if there was an exception */ public void launchExternal(URL url) throws LaunchException { List javawsArgs = new LinkedList(); javawsArgs.add(url.toString()); launchExternal(new LinkedList(), javawsArgs); } /** * Launches the JNLP file at the specified location in a new JVM * instance. The launched application's output is sent to the * system out and it's standard input channel is closed. * @param vmArgs the arguments to pass to the jvm * @param javawsArgs the arguments to pass to javaws (aka Netx) * @throws LaunchException if there was an exception */ public void launchExternal(List vmArgs, List javawsArgs) throws LaunchException { try { List commands = new LinkedList(); // this property is set by the javaws launcher to point to the javaws binary String pathToWebstartBinary = System.getProperty("icedtea-web.bin.location"); commands.add(pathToWebstartBinary); // use -Jargument format to pass arguments to the JVM through the launcher for (String arg : vmArgs) { commands.add("-J" + arg); } commands.addAll(javawsArgs); String[] command = commands.toArray(new String[] {}); Process p = Runtime.getRuntime().exec(command); new StreamEater(p.getErrorStream()).start(); new StreamEater(p.getInputStream()).start(); p.getOutputStream().close(); } catch (NullPointerException ex) { throw launchError(new LaunchException(null, null, R("LSFatal"), R("LCExternalLaunch"), R("LNetxJarMissing"), R("LNetxJarMissingInfo"))); } catch (Exception ex) { throw launchError(new LaunchException(null, ex, R("LSFatal"), R("LCExternalLaunch"), R("LCouldNotLaunch"), R("LCouldNotLaunchInfo"))); } } /** * Returns the JNLPFile for the URL, with error handling. */ private JNLPFile fromUrl(URL location) throws LaunchException { try { JNLPFile file = new JNLPFile(location, parserSettings); boolean isLocal = false; boolean haveHref = false; if ("file".equalsIgnoreCase(location.getProtocol()) && new File(location.getFile()).exists()) { isLocal = true; } if (file.getSourceLocation() != null) { haveHref = true; } if (!isLocal && haveHref){ //this is case when remote file have href to different file if (!location.equals(file.getSourceLocation())){ //mark local true, so the folowing condition will be true and //new jnlp file will be downlaoded isLocal = true; //maybe this check is to strict, and will force redownlaod to often //another check can be just on jnlp name. But it will not work //if the href will be the file of same name, but on diferent path (or even domain) } } if (isLocal && haveHref) { JNLPFile fileFromHref = new JNLPFile(file.getSourceLocation(), parserSettings); if (fileFromHref.getCodeBase() == null) { fileFromHref.codeBase = file.getCodeBase(); } file = fileFromHref; } return file; } catch (Exception ex) { if (ex instanceof LaunchException) { throw (LaunchException) ex; // already sent to handler when first thrown } else { // IO and Parse throw launchError(new LaunchException(null, ex, R("LSFatal"), R("LCReadError"), R("LCantRead"), R("LCantReadInfo"))); } } } /** * Launches a JNLP application. This method should be called * from a thread in the application's thread group. * @param file jnlpfile - source of application * @return application to be launched * @throws net.sourceforge.jnlp.LaunchException if launch fails on unrecoverable exception */ protected ApplicationInstance launchApplication(JNLPFile file) throws LaunchException { if (!file.isApplication()) { throw launchError(new LaunchException(file, null, R("LSFatal"), R("LCClient"), R("LNotApplication"), R("LNotApplicationInfo"))); } try { try { ServiceUtil.checkExistingSingleInstance(file); } catch (InstanceExistsException e) { OutputController.getLogger().log("Single instance application is already running."); return null; } if (JNLPRuntime.getForksAllowed() && file.needsNewVM()) { if (!JNLPRuntime.isHeadless()){ SplashScreen sp = SplashScreen.getSplashScreen(); if (sp!=null) { sp.close(); } } List netxArguments = new LinkedList(); netxArguments.add("-Xnofork"); netxArguments.addAll(JNLPRuntime.getInitialArguments()); launchExternal(file.getNewVMArgs(), netxArguments); return null; } handler.launchInitialized(file); ApplicationInstance app = createApplication(file); app.initialize(); String mainName = file.getApplication().getMainClass(); // When the application-desc field is empty, we should take a // look at the main jar for the main class. if (mainName == null) { JARDesc mainJarDesc = file.getResources().getMainJAR(); File f = CacheUtil.getCacheFile(mainJarDesc.getLocation(), null); if (f != null) { JarFile mainJar = new JarFile(f); mainName = mainJar.getManifest(). getMainAttributes().getValue("Main-Class"); } } if (mainName == null) { throw launchError(new LaunchException(file, null, R("LSFatal"), R("LCClient"), R("LCantDetermineMainClass"), R("LCantDetermineMainClassInfo"))); } Class mainClass = app.getClassLoader().loadClass(mainName); Method main = mainClass.getMethod("main", new Class[] { String[].class }); String args[] = file.getApplication().getArguments(); SwingUtilities.invokeAndWait(new Runnable() { // dummy method to force Event Dispatch Thread creation @Override public void run() { } }); setContextClassLoaderForAllThreads(app.getThreadGroup(), app.getClassLoader()); handler.launchStarting(app); main.setAccessible(true); OutputController.getLogger().log("Invoking main() with args: " + Arrays.toString(args)); main.invoke(null, new Object[] { args }); return app; } catch (LaunchException lex) { throw launchError(lex); } catch (Exception ex) { throw launchError(new LaunchException(file, ex, R("LSFatal"), R("LCLaunching"), R("LCouldNotLaunch"), R("LCouldNotLaunchInfo"))); } } /** * Set the classloader as the context classloader for all threads in * the given threadgroup. This is required to make some applications * work. For example, an application that provides a custom Swing LnF * may ask the swing thread to load resources from their JNLP, which * would only work if the Swing thread knows about the JNLPClassLoader. * * @param tg The threadgroup for which the context classloader should be set * @param classLoader the classloader to set as the context classloader */ private void setContextClassLoaderForAllThreads(ThreadGroup tg, ClassLoader classLoader) { /* be prepared for change in thread size */ int threadCountGuess = tg.activeCount(); Thread[] threads; do { threadCountGuess = threadCountGuess * 2; threads = new Thread[threadCountGuess]; tg.enumerate(threads, true); } while (threads[threadCountGuess - 1] != null); for (Thread thread : threads) { if (thread != null) { OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "Setting " + classLoader + " as the classloader for thread " + thread.getName()); thread.setContextClassLoader(classLoader); } } } /** * Launches a JNLP applet. This method should be called from a * thread in the application's thread group. *

    * The enableCodeBase parameter adds the applet's codebase to * the locations searched for resources and classes. This can * slow down the applet loading but allows browser-style applets * that don't use JAR files exclusively to be run from a applet * JNLP file. If the applet JNLP file does not specify any * resources then the code base will be enabled regardless of * the specified value. *

    * * @param file the JNLP file * @param enableCodeBase whether to add the codebase URL to the classloader * @param cont container where to put application * @return application * @throws net.sourceforge.jnlp.LaunchException if deploy unrecoverably die */ protected ApplicationInstance launchApplet(JNLPFile file, boolean enableCodeBase, Container cont) throws LaunchException { if (!file.isApplet()) { throw launchError(new LaunchException(file, null, R("LSFatal"), R("LCClient"), R("LNotApplet"), R("LNotAppletInfo"))); } if (JNLPRuntime.getForksAllowed() && file.needsNewVM()) { if (!JNLPRuntime.isHeadless()) { SplashScreen sp = SplashScreen.getSplashScreen(); if (sp != null) { sp.close(); } } } if (handler != null) { handler.launchInitialized(file); } AppletInstance applet = null; try { ServiceUtil.checkExistingSingleInstance(file); applet = createApplet(file, enableCodeBase, cont); applet.initialize(); applet.getAppletEnvironment().startApplet(); // this should be a direct call to applet instance return applet; } catch (InstanceExistsException ieex) { OutputController.getLogger().log("Single instance applet is already running."); throw launchError(new LaunchException(file, ieex, R("LSFatal"), R("LCLaunching"), R("LCouldNotLaunch"), R("LSingleInstanceExists")), applet); } catch (LaunchException lex) { throw launchError(lex, applet); } catch (Exception ex) { throw launchError(new LaunchException(file, ex, R("LSFatal"), R("LCLaunching"), R("LCouldNotLaunch"), R("LCouldNotLaunchInfo")), applet); }finally{ if (handler != null) { handler.launchStarting(applet); } } } /** * Gets an ApplicationInstance, but does not launch the applet. * @param file the JNLP file * @param enableCodeBase whether to add the codebase URL to the classloader * @param cont container where to put applet * @return applet * @throws net.sourceforge.jnlp.LaunchException if deploy unrecoverably die */ protected ApplicationInstance getApplet(JNLPFile file, boolean enableCodeBase, Container cont) throws LaunchException { if (!file.isApplet()) { throw launchError(new LaunchException(file, null, R("LSFatal"), R("LCClient"), R("LNotApplet"), R("LNotAppletInfo"))); } AppletInstance applet = null; try { ServiceUtil.checkExistingSingleInstance(file); applet = createApplet(file, enableCodeBase, cont); applet.initialize(); return applet; } catch (InstanceExistsException ieex) { OutputController.getLogger().log("Single instance applet is already running."); throw launchError(new LaunchException(file, ieex, R("LSFatal"), R("LCLaunching"), R("LCouldNotLaunch"), R("LSingleInstanceExists")), applet); } catch (LaunchException lex) { throw launchError(lex, applet); } catch (Exception ex) { throw launchError(new LaunchException(file, ex, R("LSFatal"), R("LCLaunching"), R("LCouldNotLaunch"), R("LCouldNotLaunchInfo")), applet); } } /** * Launches a JNLP installer. This method should be called from * a thread in the application's thread group. * @param file jnlp file to read installer from * @return application * @throws net.sourceforge.jnlp.LaunchException if deploy unrecoverably die */ protected ApplicationInstance launchInstaller(JNLPFile file) throws LaunchException { // TODO Check for an existing single instance once implemented. // ServiceUtil.checkExistingSingleInstance(file); throw launchError(new LaunchException(file, null, R("LSFatal"), R("LCNotSupported"), R("LNoInstallers"), R("LNoInstallersInfo"))); } /** * Create an AppletInstance. * * @param file the JNLP file * @param enableCodeBase whether to add the codebase URL to the classloader * @param cont container where to put applet * @return applet * @throws net.sourceforge.jnlp.LaunchException if deploy unrecoverably die */ //FIXME - when multiple applets are on one page, this method is visited simultaneously //and then appelts creates in little bit strange manner. This issue is visible with //randomly showing/notshowing spalshscreens. //See also PluginAppletViewer.framePanel protected AppletInstance createApplet(JNLPFile file, boolean enableCodeBase, Container cont) throws LaunchException { AppletInstance appletInstance = null; try { JNLPClassLoader loader = JNLPClassLoader.getInstance(file, updatePolicy, enableCodeBase); if (enableCodeBase) { loader.enableCodeBase(); } else if (file.getResources().getJARs().length == 0) { throw new ClassNotFoundException("Can't do a codebase look up and there are no jars. Failing sooner rather than later"); } ThreadGroup group = Thread.currentThread().getThreadGroup(); // appletInstance is needed by ServiceManager when looking up // services. This could potentially be done in applet constructor // so initialize appletInstance before creating applet. if (cont == null) { appletInstance = new AppletInstance(file, group, loader, null); } else { appletInstance = new AppletInstance(file, group, loader, null, cont); } loader.setApplication(appletInstance); // Initialize applet now that ServiceManager has access to its // appletInstance. String appletName = file.getApplet().getMainClass(); Class appletClass = loader.loadClass(appletName); Applet applet = (Applet) appletClass.newInstance(); applet.setStub((AppletStub)cont); // Finish setting up appletInstance. appletInstance.setApplet(applet); appletInstance.getAppletEnvironment().setApplet(applet); setContextClassLoaderForAllThreads(appletInstance.getThreadGroup(), appletInstance.getClassLoader()); return appletInstance; } catch (Exception ex) { throw launchError(new LaunchException(file, ex, R("LSFatal"), R("LCInit"), R("LInitApplet"), R("LInitAppletInfo")), appletInstance); } } /** * Creates an Applet object from a JNLPFile. This is mainly to be used with * gcjwebplugin. * @param file the PluginBridge to be used. * @param enableCodeBase whether to add the code base URL to the classloader. * @param cont container where to put applet * @return applet * @throws net.sourceforge.jnlp.LaunchException if deploy unrecoverably dien */ protected Applet createAppletObject(JNLPFile file, boolean enableCodeBase, Container cont) throws LaunchException { try { JNLPClassLoader loader = JNLPClassLoader.getInstance(file, updatePolicy, enableCodeBase); if (enableCodeBase) { loader.enableCodeBase(); } else if (file.getResources().getJARs().length == 0) { throw new ClassNotFoundException("Can't do a codebase look up and there are no jars. Failing sooner rather than later"); } String appletName = file.getApplet().getMainClass(); Class appletClass = loader.loadClass(appletName); Applet applet = (Applet) appletClass.newInstance(); return applet; } catch (Exception ex) { throw launchError(new LaunchException(file, ex, R("LSFatal"), R("LCInit"), R("LInitApplet"), R("LInitAppletInfo"))); } } /** * Creates an Application. * @param file the JNLP file * @return application * @throws net.sourceforge.jnlp.LaunchException if deploy unrecoverably die */ protected ApplicationInstance createApplication(JNLPFile file) throws LaunchException { try { JNLPClassLoader loader = JNLPClassLoader.getInstance(file, updatePolicy, false); ThreadGroup group = Thread.currentThread().getThreadGroup(); ApplicationInstance app = new ApplicationInstance(file, group, loader); loader.setApplication(app); return app; } catch (Exception ex) { throw new LaunchException(file, ex, R("LSFatal"), R("LCInit"), R("LInitApplication"), R("LInitApplicationInfo")); } } /** * Create a thread group for the JNLP file. * @param file the JNLP file * Note: if the JNLPFile is an applet (ie it is a subclass of PluginBridge) * then this method simply returns the existing ThreadGroup. The applet * ThreadGroup has to be created at an earlier point in the applet code. * @return ThreadGroup for this app/applet */ protected ThreadGroup createThreadGroup(JNLPFile file) { final ThreadGroup tg; if (file instanceof PluginBridge) { tg = Thread.currentThread().getThreadGroup(); } else { tg = new ThreadGroup(mainGroup, file.getTitle()); } return tg; } /** * Send n launch error to the handler, if set, and also to the * caller. */ private LaunchException launchError(LaunchException ex) { return launchError(ex, null); } private LaunchException launchError(LaunchException ex, AppletInstance applet) { if (applet != null) { SplashUtils.showErrorCaught(ex, applet); } if (handler != null) { handler.launchError(ex); } return ex; } /** * Send a launch error to the handler, if set, and to the * caller only if the handler indicated that the launch should * continue despite the warning. * * @return an exception to throw if the launch should be aborted, or null otherwise */ private LaunchException launchWarning(LaunchException ex) { if (handler != null) { if (!handler.launchWarning(ex)) // no need to destroy the app b/c it hasn't started return ex; } // chose to abort return null; // chose to continue, or no handler } /** * Do hacks on per-application level to allow different AppContexts to work * * @see JNLPRuntime#doMainAppContextHacks */ private static void doPerApplicationAppContextHacks() { /* * With OpenJDK6 (but not with 7) a per-AppContext dtd is maintained. * This dtd is created by the ParserDelgate. However, the code in * HTMLEditorKit (used to render HTML in labels and textpanes) creates * the ParserDelegate only if there are no existing ParserDelegates. The * result is that all other AppContexts see a null dtd. */ new ParserDelegator(); } /** * This runnable is used to call the appropriate launch method * for the application, applet, or installer in its thread group. */ private class TgThread extends Thread { // ThreadGroupThread private JNLPFile file; private ApplicationInstance application; private LaunchException exception; private Container cont; private boolean isPlugin = false; TgThread(JNLPFile file) { this(file, null); } TgThread(JNLPFile file, Container cont) { super(createThreadGroup(file), file.getTitle()); this.file = file; this.cont = cont; } TgThread(JNLPFile file, Container cont, boolean isPlugin) { super(createThreadGroup(file), file.getTitle()); this.file = file; this.cont = cont; this.isPlugin = isPlugin; } @Override public void run() { try { // Do not create new AppContext if we're using NetX and icedteaplugin. // The plugin needs an AppContext too, but it has to be created earlier. if (context && !isPlugin) { SunToolkit.createNewAppContext(); } doPerApplicationAppContextHacks(); if (isPlugin) { // Do not display download indicators if we're using gcjwebplugin. JNLPRuntime.setDefaultDownloadIndicator(null); application = getApplet(file, ((PluginBridge)file).codeBaseLookup(), cont); } else { if (file.isApplication()) { application = launchApplication(file); } else if (file.isApplet()) { application = launchApplet(file, true, cont); } // enable applet code base else if (file.isInstaller()) { application = launchInstaller(file); } else { throw launchError(new LaunchException(file, null, R("LSFatal"), R("LCClient"), R("LNotLaunchable"), R("LNotLaunchableInfo"))); } } } catch (LaunchException ex) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, ex); exception = ex; // Exit if we can't launch the application. if (exitOnFailure) { JNLPRuntime.exit(1); } } catch (Throwable ex) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, ex); throw new RuntimeException(ex); } } public LaunchException getException() { return exception; } public ApplicationInstance getApplication() { return application; } }; } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/LaunchHandler.java0000644000000000000000000000013012654402377024050 xustar0030 mtime=1454507263.249432421 29 atime=1454507327.12358055 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/LaunchHandler.java0000644000175000002070000000635312654402377024604 0ustar00jvanekmock00000000000000// Copyright (C) 2001-2003 Jon A. Maxwell (JAM) // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp; import net.sourceforge.jnlp.runtime.*; /** * This optional interface is used to handle conditions that occur * while launching JNLP applications, applets, and installers. * * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.9 $ */ public interface LaunchHandler { /** * Called when the application could not be launched due to a * fatal error, such as the inability to find the main class or * non-parseable XML. * @param exception to be re-thrown as launch error */ public void launchError(LaunchException exception); /** * Called when launching the application can not be launched due * to an error that is not fatal. For example a JNLP file that * is not strictly correct yet does not necessarily prohibit the * system from attempting to launch the application. * * @param warning exception to be consummed as warning * @return true if the launch should continue, false to abort */ public boolean launchWarning(LaunchException warning); /** * Called when a security validation error occurs while * launching the application. * * @param error to be rethrown as launch error * @return true to allow the application to continue, false to stop it. */ public boolean validationError(LaunchException error); // this method will probably be replaced when real security // controller is in place. /** * Called when an application, applet or installer has been determined. * We have some very basic information about the application at this point, * but do not have everything required. This is a nice point to show the * splash screen. * * @param file the JNLP file of the instance that is starting */ public void launchInitialized(JNLPFile file); /** * Called when an application, applet or installer is ready to start. * Good point to hide the splash screen. * * @param application the application instance that is ready */ public void launchStarting(ApplicationInstance application); /** * Called when an application, applet, or installer has been * launched successfully (the main method or applet start method * returned normally). * * @param application the launched application instance */ public void launchCompleted(ApplicationInstance application); } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/LaunchException.java0000644000000000000000000000013012654402377024431 xustar0030 mtime=1454507263.249432421 29 atime=1454507327.12358055 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/LaunchException.java0000644000175000002070000001234512654402377025163 0ustar00jvanekmock00000000000000// Copyright (C) 2001-2003 Jon A. Maxwell (JAM) // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp; import java.util.Collections; import java.util.Date; import java.util.LinkedList; import java.util.List; /** * Thrown when a JNLP application, applet, or installer could not * be created. * * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.9 $ */ public class LaunchException extends Exception { public static class LaunchExceptionWithStamp{ private final LaunchException ex; private final Date stamp; private LaunchExceptionWithStamp(LaunchException ex) { this.ex=ex; this.stamp=new Date(); } public LaunchException getEx() { return ex; } public Date getStamp() { return stamp; } } private static final List launchExceptionChain = Collections.synchronizedList(new LinkedList()); private static final long serialVersionUID = 7283827853612357423L; /** the file being launched */ private final JNLPFile file; /** the category of the exception */ final private String category; /** summary */ final private String summary; /** description of the action that was taking place */ final private String description; /** severity of the warning/error */ final private String severity; /** * Creates a LaunchException without detail message. * @param file jnlp-file which caused exception * @param cause cause of exception * @param severity severity of exception * @param category category of exception * @param summary short summary of exception * @param description full description of exception */ public LaunchException(JNLPFile file, Exception cause, String severity, String category, String summary, String description) { super(severity + ": " + category + ": " + summary + " " + (description == null ? "" : description), cause); this.file = file; this.category = category; this.summary = summary; this.description = description; this.severity = severity; saveLaunchException(this); } /** * Creates a LaunchException with a cause. * @param cause cause of exception */ public LaunchException(Throwable cause) { super(cause); this.file = null; this.category = null; this.summary = null; this.description = null; this.severity = null; saveLaunchException(this); } /** * Creates a LaunchException with a cause and detail message * @param message text of exception * @param cause cause of exception */ public LaunchException(String message, Throwable cause) { super(message, cause); this.file = null; this.category = null; this.summary = null; this.description = null; this.severity = null; saveLaunchException(this); } /** * Constructs a LaunchException with the specified detail * message. * * @param message the detail message */ public LaunchException(String message) { super(message); this.file = null; this.category = null; this.summary = null; this.description = null; this.severity = null; saveLaunchException(this); } /** * @return the JNLPFile being launched. */ public JNLPFile getFile() { return file; } /** * @return the category string, a short description of the * exception suitable for displaying in a window title. */ public String getCategory() { return category; } /** * @return a one-sentence summary of the problem. */ public String getSummary() { return summary; } /** * @return a description of the exception and the action being * performed when the exception occurred. */ public String getDescription() { return description; } /** * @return a short description of the severity of the problem. */ public String getSeverity() { return severity; } private synchronized void saveLaunchException(LaunchException ex) { launchExceptionChain.add(new LaunchExceptionWithStamp(ex)); } public synchronized static List getLaunchExceptionChain() { return launchExceptionChain; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/LaunchDesc.java0000644000000000000000000000013012654402377023351 xustar0030 mtime=1454507263.249432421 29 atime=1454507327.12358055 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/LaunchDesc.java0000644000175000002070000000342112654402377024076 0ustar00jvanekmock00000000000000/* LaunchDesc -- Represents a launch description Copyright (C) 2012 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp; public interface LaunchDesc { public String getMainClass(); } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/JREDesc.java0000644000000000000000000000013012654402377022557 xustar0030 mtime=1454507263.248432434 29 atime=1454507327.12358055 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/JREDesc.java0000644000175000002070000001117112654402377023305 0ustar00jvanekmock00000000000000// Copyright (C) 2001-2003 Jon A. Maxwell (JAM) // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp; import java.net.URL; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; import static net.sourceforge.jnlp.runtime.Translator.R; /** * The J2SE/Java element. * * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.5 $ */ public class JREDesc { private static final Pattern heapPattern= Pattern.compile("\\d+[kmg]?"); /** the platform version or the product version if location is not null */ final private Version.JreVersion version; /** the location of a JRE product or null */ final private URL location; /** inital heap size */ final private String initialHeapSize; /** maximum head size */ final private String maximumHeapSize; /** args to pass to the vm */ final private String vmArgs; /** list of ResourceDesc objects */ final private List resources; /** * Create a JRE descriptor. * * @param version the platform version or the product version * if location is not null * @param location the location of a JRE product or null * @param vmArgs arguments to VM * @param initialHeapSize initial heap size * @param maximumHeapSize maximum head size * @param resources list of ResourceDesc objects * @throws net.sourceforge.jnlp.ParseException is something goes wrong */ public JREDesc(Version.JreVersion version, URL location, String vmArgs, String initialHeapSize, String maximumHeapSize, List resources) throws ParseException { this.version = version; this.location = location; this.vmArgs = vmArgs; this.initialHeapSize = checkHeapSize(initialHeapSize); this.maximumHeapSize = checkHeapSize(maximumHeapSize); this.resources = resources; } /** * @return the JRE version. Use isPlatformVersion to * determine if this version corresponds to a platform or * product version. */ public Version.JreVersion getVersion() { return version; } /** * @return true if the JRE version is a Java platform version * (java.specification.version property) or false if it is a * product version (java.version property). */ public boolean isPlatformVersion() { return getLocation() == null; } /** * @return the JRE version string. */ public URL getLocation() { return location; } /** * @return the maximum heap size in bytes. */ public String getMaximumHeapSize() { return maximumHeapSize; } /** * @return the initial heap size in bytes. */ public String getInitialHeapSize() { return initialHeapSize; } /** * @return the resources defined for this JRE. */ public List getResourcesDesc() { return resources; } /** * @return the additional arguments to pass to the Java VM * Can be null */ public String getVMArgs() { return vmArgs; } /** * Check for valid heap size string * @return trimmed heapSize if correct * @throws ParseException if heapSize is invalid */ static String checkHeapSize(String heapSize) throws ParseException { // need to implement for completeness even though not used in netx if (heapSize == null) { return null; } heapSize = heapSize.trim(); // the last character must be 0-9 or k/K/m/M/g/G //0 or 0k/m/g is also accepted value String heapSizeLower = heapSize.toLowerCase(); Matcher heapMatcher = heapPattern.matcher(heapSizeLower); if (!heapMatcher.matches()) { throw new ParseException(R("PBadHeapSize", heapSize)); } return heapSize; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/JNLPSplashScreen.java0000644000000000000000000000013012654402377024416 xustar0030 mtime=1454507263.248432434 29 atime=1454507327.12358055 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/JNLPSplashScreen.java0000644000175000002070000001512512654402377025147 0ustar00jvanekmock00000000000000/* JNLPSplashScreen.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp; import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Image; import java.awt.Insets; import java.io.IOException; import java.net.URL; import javax.imageio.ImageIO; import javax.swing.JDialog; import net.sourceforge.jnlp.cache.ResourceTracker; import net.sourceforge.jnlp.splashscreen.SplashPanel; import net.sourceforge.jnlp.splashscreen.SplashUtils; import net.sourceforge.jnlp.splashscreen.parts.InformationElement; import net.sourceforge.jnlp.util.ImageResources; import net.sourceforge.jnlp.util.logging.OutputController; import net.sourceforge.jnlp.util.ScreenFinder; public class JNLPSplashScreen extends JDialog { ResourceTracker resourceTracker; URL splashImageUrl; Image splashImage; private JNLPFile file; public static final int DEF_WIDTH=635; public static final int DEF_HEIGHT=480; private SplashPanel componetSplash; private boolean splashImageLoaded=false; private SplashPanel splash; public JNLPSplashScreen(ResourceTracker resourceTracker, final JNLPFile file) { setIconImages(ImageResources.INSTANCE.getApplicationImages()); // If the JNLP file does not contain any icon images, the splash image // will consist of the application's title and vendor, as taken from the // JNLP file. this.resourceTracker = resourceTracker; this.file=file; } public void setSplashImageURL(URL url) { splashImageLoaded = false; try { if (url != null) { splashImageUrl = url; splashImage = null; try { splashImage = ImageIO.read(resourceTracker.getCacheFile(splashImageUrl)); if (splashImage == null) { OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "Error loading splash image: " + url); } } catch (IOException e) { OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "Error loading splash image: " + url); splashImage = null; } catch (IllegalArgumentException argumentException) { OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "Error loading splash image: " + url); splashImage = null; } } if (splashImage == null) { this.setLayout(new BorderLayout()); splash = SplashUtils.getSplashScreen(DEF_WIDTH, DEF_HEIGHT); if (splash != null) { splash.startAnimation(); splash.setInformationElement(InformationElement.createFromJNLP(file)); this.add(splash.getSplashComponent()); this.componetSplash = splash; } } correctSize(); } finally { splashImageLoaded = true; } } public void setFile(JNLPFile file) { this.file = file; if (splash != null) { splash.setInformationElement(InformationElement.createFromJNLP(file)); } } public boolean isSplashImageLoaded() { return splashImageLoaded; } public boolean isSplashScreenValid() { return (splashImage != null) || (componetSplash != null); } private void correctSize() { int minimumWidth = DEF_WIDTH; int minimumHeight = DEF_HEIGHT; if (splashImage != null) { Insets insets = getInsets(); minimumWidth = splashImage.getWidth(null) + insets.left + insets.right; minimumHeight = splashImage.getHeight(null) + insets.top + insets.bottom; } setMinimumSize(new Dimension(0, 0)); setMaximumSize(new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE)); setSize(new Dimension(minimumWidth, minimumHeight)); setPreferredSize(new Dimension(minimumWidth, minimumHeight)); ScreenFinder.centerWindowsToCurrentScreen(this); } @Override public void paint(Graphics g) { if (splashImage == null) { super.paint(g); return; } correctSize(); Graphics2D g2 = (Graphics2D) g; g2.drawImage(splashImage, getInsets().left, getInsets().top, null); } public boolean isCustomSplashscreen() { return (componetSplash!=null); } public void stopAnimation() { if (isCustomSplashscreen()) componetSplash.stopAnimation(); } public void setErrorSplash(Throwable ex) { if (splash != null){ this.remove(splash.getSplashComponent()); splash = SplashUtils.getErrorSplashScreen(splash.getSplashWidth(), splash.getSplashHeight(), ex); this.add(splash.getSplashComponent()); this.componetSplash = splash; this.validate(); } } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/JNLPMatcherException.java0000644000000000000000000000013012654402377025266 xustar0030 mtime=1454507263.248432434 29 atime=1454507327.12358055 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/JNLPMatcherException.java0000644000175000002070000000370712654402377026022 0ustar00jvanekmock00000000000000/* JNLPMatcherException.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp; public class JNLPMatcherException extends Exception { private static final long serialVersionUID = 1L; public JNLPMatcherException(String message) { super(message); } public JNLPMatcherException(String message, Throwable cause) { super(message, cause); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/JNLPMatcher.java0000644000000000000000000000013012654402377023407 xustar0030 mtime=1454507263.247432448 29 atime=1454507327.12358055 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/JNLPMatcher.java0000644000175000002070000002305312654402377024137 0ustar00jvanekmock00000000000000/* JNLPMatcher.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp; import java.util.List; import java.io.ByteArrayOutputStream; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.Reader; import java.io.StringReader; import java.util.Arrays; import java.util.Collections; import java.util.LinkedList; import net.sourceforge.jnlp.util.logging.OutputController; import net.sourceforge.nanoxml.XMLElement; /** * To compare launching JNLP file with signed APPLICATION.JNLP or * APPLICATION_TEMPLATE.jnlp. * * Used by net.sourceforge.jnlp.runtime.JNLPCLassLoader */ public final class JNLPMatcher { private final Node appTemplateNode; private final Node launchJNLPNode; private final boolean isTemplate; /** * Public constructor * * @param appTemplate * the reader stream of the signed APPLICATION.jnlp or * APPLICATION_TEMPLATE.jnlp * @param launchJNLP * the reader stream of the launching JNLP file * @param isTemplate * a boolean that specifies if appTemplateFile is a template * @param p settings of parser * @throws JNLPMatcherException * if IOException, XMLParseException is thrown during parsing; * Or launchJNLP/appTemplate is null */ public JNLPMatcher(InputStream appTemplate, InputStream launchJNLP, boolean isTemplate, ParserSettings p) throws JNLPMatcherException { if (appTemplate == null && launchJNLP == null) throw new JNLPMatcherException("Template JNLP file and Launching JNLP file are both null."); else if (appTemplate == null) throw new JNLPMatcherException("Template JNLP file is null."); else if (launchJNLP == null) throw new JNLPMatcherException("Launching JNLP file is null."); try { this.appTemplateNode = Parser.getRootNode(appTemplate, p); this.launchJNLPNode = Parser.getRootNode(launchJNLP, p); this.isTemplate = isTemplate; } catch (Exception e) { throw new JNLPMatcherException("Failed to create an instance of JNLPVerify with specified InputStreamReader", e); } finally { closeInputStream(appTemplate); closeInputStream(launchJNLP); } } /** * Compares both JNLP files * * @return true if both JNLP files are 'matched', otherwise false */ public boolean isMatch() { return matchNodes(appTemplateNode, launchJNLPNode); } /** * Compares two Nodes regardless of the order of their children/attributes * * @param appTemplate * signed application or template's Node * @param launchJNLP * launching JNLP file's Node * * @return true if both Nodes are 'matched', otherwise false */ private boolean matchNodes(Node appTemplate, Node launchJNLP) { if (appTemplate != null && launchJNLP != null) { Node templateNode = appTemplate; Node launchNode = launchJNLP; // Store children of Node List appTemplateChild = new LinkedList<>(Arrays.asList(templateNode.getChildNodes())); List launchJNLPChild = new LinkedList<>(Arrays.asList(launchNode.getChildNodes())); // Compare only if both Nodes have the same name, else return false if (templateNode.getNodeName().equals(launchNode.getNodeName())) { if (appTemplateChild.size() == launchJNLPChild.size()) { // Compare // children int childLength = appTemplateChild.size(); for (int i = 0; i < childLength;) { for (int j = 0; j < childLength; j++) { boolean isSame = matchNodes(appTemplateChild.get(i), launchJNLPChild.get(j)); if (!isSame && j == childLength - 1) { return false; } else if (isSame) { // If both child matches, remove them from the list of children appTemplateChild.remove(i); launchJNLPChild.remove(j); --childLength; break; } } } if (!templateNode.getNodeValue().equals(launchNode.getNodeValue())) { // If it's a template and the template's value is NOT '*' if (isTemplate && !templateNode.getNodeValue().equals("*")) { return false; } // Else if it's not a template, then return false else if (!isTemplate) { return false; } } // Compare attributes of both Nodes return matchAttributes(templateNode, launchNode); } } } return false; } /** * Compares attributes of two {@link Node Nodes} regardless of order * * @param templateNode signed application or template's {@link Node} with attributes * @param launchNode launching JNLP file's {@link Node} with attributes * * @return {@code true} if both {@link Node Nodes} have 'matched' attributes, otherwise {@code false} */ private boolean matchAttributes(Node templateNode, Node launchNode) { if (templateNode != null && launchNode != null) { List appTemplateAttributes = templateNode.getAttributeNames(); List launchJNLPAttributes = launchNode.getAttributeNames(); Collections.sort(appTemplateAttributes); Collections.sort(launchJNLPAttributes); if (appTemplateAttributes.size() == launchJNLPAttributes.size()) { int size = appTemplateAttributes.size(); // Number of attributes for (int i = 0; i < size; i++) { if (launchJNLPAttributes.get(i).equals(appTemplateAttributes.get(i))) { // If both Node's attribute name are the // same then compare the values String attribute = launchJNLPAttributes.get(i); boolean isSame = templateNode.getAttribute(attribute).equals( // Check if the Attribute values match launchNode.getAttribute(attribute)); if (!isTemplate && !isSame) { return false; } else if (isTemplate && !isSame && !templateNode.getAttribute(attribute).equals("*")) { return false; } } else { // If attributes names do not match, return false return false; } } return true; } } return false; } /*** * Closes an input stream * * @param stream * The input stream that will be closed */ private void closeInputStream(InputStream stream) { if (stream != null) try { stream.close(); } catch (Exception e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); } } /*** * Closes an output stream * * @param stream * The output stream that will be closed */ private void closeOutputStream(OutputStream stream) { if (stream != null) try { stream.close(); } catch (Exception e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); } } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/JNLPFile.java0000644000000000000000000000013112654402377022704 xustar0030 mtime=1454507263.247432448 30 atime=1454507327.122580564 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/JNLPFile.java0000644000175000002070000012063612654402377023440 0ustar00jvanekmock00000000000000// Copyright (C) 2001-2003 Jon A. Maxwell (JAM) // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp; import java.io.File; import java.io.FileInputStream; import static net.sourceforge.jnlp.runtime.Translator.R; import java.io.IOException; import java.io.InputStream; import java.net.URL; import java.util.ArrayList; import java.util.Arrays; import java.util.Calendar; import java.util.LinkedList; import java.util.List; import java.util.Locale; import java.util.jar.Attributes; import net.sourceforge.jnlp.SecurityDesc.RequestedPermissionLevel; import net.sourceforge.jnlp.cache.ResourceTracker; import net.sourceforge.jnlp.cache.UpdatePolicy; import net.sourceforge.jnlp.runtime.JNLPClassLoader; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.util.ClasspathMatcher; import net.sourceforge.jnlp.util.UrlUtils; import net.sourceforge.jnlp.util.logging.OutputController; /** *

    * Provides methods to access the information in a Java Network * Launching Protocol (JNLP) file. The Java Network Launching * Protocol specifies in an XML file the information needed to * load, cache, and run Java code over the network and in a secure * environment. *

    *

    * This class represents the overall information about a JNLP file * from the jnlp element. Other information is accessed through * objects that represent the elements of a JNLP file * (information, resources, application-desc, etc). References to * these objects are obtained by calling the getInformation, * getResources, getSecurity, etc methods. *

    * * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.21 $ */ public class JNLPFile { public static enum ManifestBoolean { TRUE, FALSE, UNDEFINED; } // todo: save the update policy, then if file was not updated // then do not check resources for being updated. // // todo: make getLaunchInfo return a superclass that all the // launch types implement (can get codebase from it). // // todo: currently does not filter resources by jvm version. // /** the location this JNLP file was created from */ protected URL sourceLocation = null; /** the network location of this JNLP file */ protected URL fileLocation; /** the ParserSettings which were used to parse this file */ protected ParserSettings parserSettings = null; /** A key that uniquely identifies connected instances (main jnlp+ext) */ protected String uniqueKey = null; /** the URL used to resolve relative URLs in the file */ protected URL codeBase; /** file version */ protected Version fileVersion; /** spec version */ protected Version specVersion; /** information */ protected List info; protected UpdateDesc update; /** resources */ protected List resources; /** additional resources not in JNLP file (from command line) */ protected ResourcesDesc sharedResources = new ResourcesDesc(this, null, null, null); /** the application description */ protected LaunchDesc launchType; /** the component description */ protected ComponentDesc component; /** the security descriptor */ protected SecurityDesc security; /** the default JVM locale */ protected Locale defaultLocale = null; /** the default OS */ protected String defaultOS = null; /** the default arch */ protected String defaultArch = null; /** A signed JNLP file is missing from the main jar */ private boolean missingSignedJNLP = false; /** JNLP file contains special properties */ private boolean containsSpecialProperties = false; /** * List of acceptable properties (not-special) */ final private String[] generalProperties = SecurityDesc.getJnlpRIAPermissions(); /** important manifests' attributes */ private final ManifestsAttributes manifestsAttributes = new ManifestsAttributes(); public static final String TITLE_NOT_FOUND = "Application title was not found in manifest. Check with application vendor"; { // initialize defaults if security allows try { defaultLocale = Locale.getDefault(); defaultOS = System.getProperty("os.name"); defaultArch = System.getProperty("os.arch"); } catch (SecurityException ex) { // null values will still work, and app can set defaults later } } static enum Match { LANG_COUNTRY_VARIANT, LANG_COUNTRY, LANG, GENERALIZED } /** * Empty stub, allowing child classes to override the constructor */ protected JNLPFile() { } /** * Create a JNLPFile from a URL. * * @param location the location of the JNLP file * @throws IOException if an IO exception occurred * @throws ParseException if the JNLP file was invalid */ public JNLPFile(URL location) throws IOException, ParseException { this(location, new ParserSettings()); } /** * Create a JNLPFile from a URL checking for updates using the * default policy. * * @param location the location of the JNLP file * @param settings the parser settings to use while parsing the file * @throws IOException if an IO exception occurred * @throws ParseException if the JNLP file was invalid */ public JNLPFile(URL location, ParserSettings settings) throws IOException, ParseException { this(location, (Version) null, settings); } /** * Create a JNLPFile from a URL and a Version checking for updates using * the default policy. * * @param location the location of the JNLP file * @param version the version of the JNLP file * @param settings the parser settings to use while parsing the file * @throws IOException if an IO exception occurred * @throws ParseException if the JNLP file was invalid */ public JNLPFile(URL location, Version version, ParserSettings settings) throws IOException, ParseException { this(location, version, settings, JNLPRuntime.getDefaultUpdatePolicy()); } /** * Create a JNLPFile from a URL and a version, checking for updates * using the specified policy. * * @param location the location of the JNLP file * @param version the version of the JNLP file * @param settings the {@link ParserSettings} to use when parsing the {@code location} * @param policy the update policy * @throws IOException if an IO exception occurred * @throws ParseException if the JNLP file was invalid */ public JNLPFile(URL location, Version version, ParserSettings settings, UpdatePolicy policy) throws IOException, ParseException { this(location, version, settings, policy, null); } /** * Create a JNLPFile from a URL and a version, checking for updates * using the specified policy. * * @param location the location of the JNLP file * @param version the version of the JNLP file * @param settings the parser settings to use while parsing the file * @param policy the update policy * @param forceCodebase codebase to use if not specified in JNLP file. * @throws IOException if an IO exception occurred * @throws ParseException if the JNLP file was invalid */ protected JNLPFile(URL location, Version version, ParserSettings settings, UpdatePolicy policy, URL forceCodebase) throws IOException, ParseException { InputStream input = openURL(location, version, policy); this.parserSettings = settings; parse(input, location, forceCodebase); //Downloads the original jnlp file into the cache if possible //(i.e. If the jnlp file being launched exist locally, but it //originated from a website, then download the one from the website //into the cache). if (sourceLocation != null && "file".equals(location.getProtocol())) { openURL(sourceLocation, version, policy); } this.fileLocation = location; this.uniqueKey = Calendar.getInstance().getTimeInMillis() + "-" + ((int)(Math.random()*Integer.MAX_VALUE)) + "-" + location; OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "UNIQUEKEY=" + this.uniqueKey); } /** * Create a JNLPFile from a URL, parent URLm a version and checking for * updates using the specified policy. * * @param location the location of the JNLP file * @param uniqueKey A string that uniquely identifies connected instances * @param version the version of the JNLP file * @param settings the parser settings to use while parsing the file * @param policy the update policy * @throws IOException if an IO exception occurred * @throws ParseException if the JNLP file was invalid */ public JNLPFile(URL location, String uniqueKey, Version version, ParserSettings settings, UpdatePolicy policy) throws IOException, ParseException { this(location, version, settings, policy); this.uniqueKey = uniqueKey; OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "UNIQUEKEY (override) =" + this.uniqueKey); } /** * Create a JNLPFile from an input stream. * * @param input input stream from which create jnlp file * @param settings settings of parser * @throws ParseException if the JNLP file was invalid */ public JNLPFile(InputStream input, ParserSettings settings) throws ParseException { this.parserSettings = settings; parse(input, null, null); } /** * Create a JNLPFile from an input stream. * * @param input input stream of JNLP file. * @param codebase codebase to use if not specified in JNLP file.. * @param settings the {@link ParserSettings} to use when parsing * @throws ParseException if the JNLP file was invalid */ public JNLPFile(InputStream input, URL codebase, ParserSettings settings) throws ParseException { this.parserSettings = settings; parse(input, null, codebase); } /** * Open the jnlp file URL from the cache if there, otherwise * download to the cache. * Unless file is find in cache, this method blocks until it is downloaded. * This is the best way in itw how to download and cache file * @param location of resource to open * @param version of resource * @param policy update policy of resource * @return opened streamfrom given url * @throws java.io.IOException if something goes wrong */ public static InputStream openURL(URL location, Version version, UpdatePolicy policy) throws IOException { if (location == null || policy == null) throw new IllegalArgumentException(R("NullParameter")); try { ResourceTracker tracker = new ResourceTracker(false); // no prefetch tracker.addResource(location, version, null, policy); File f = tracker.getCacheFile(location); return new FileInputStream(f); } catch (Exception ex) { throw new IOException(ex); } } /** * @return the JNLP file's best localized title. This method returns the same * value as InformationDesc.getTitle(). * * Since jdk7 u45, also manifest title, and mainclass are taken to consideration; * See PluginBridge */ public String getTitle() { String jnlpTitle = getTitleFromJnlp(); String manifestTitle = getTitleFromManifest(); if (jnlpTitle != null && manifestTitle != null) { if (jnlpTitle.equals(manifestTitle)) { return jnlpTitle; } return jnlpTitle+" ("+manifestTitle+")"; } if (jnlpTitle != null && manifestTitle == null) { return jnlpTitle; } if (jnlpTitle == null && manifestTitle != null) { return manifestTitle; } String mainClass = getManifestsAttributes().getMainClass(); return mainClass; } /** * @return the JNLP file's best localized title. This method returns the same * value as InformationDesc.getTitle(). */ public String getTitleFromJnlp() { return getInformation().getTitle(); } public String getTitleFromManifest() { String inManifestTitle = getManifestsAttributes().getApplicationName(); if (inManifestTitle == null && getManifestsAttributes().isLoader()){ OutputController.getLogger().log(OutputController.Level.WARNING_ALL, TITLE_NOT_FOUND); } return inManifestTitle; } /** * @return the JNLP file's best localized vendor. This method returns the same * value as InformationDesc.getVendor(). */ public String getVendor() { return getInformation().getVendor(); } /** * @return the JNLP file's network location as specified in the * JNLP file. */ public URL getSourceLocation() { return sourceLocation; } /** * @return the location of the file parsed to create the JNLP * file, or null if it was not created from a URL. */ public URL getFileLocation() { return fileLocation; } /** * @return the location of the parent file if it exists, null otherwise */ public String getUniqueKey() { return uniqueKey; } /** * @return the ParserSettings that was used to parse this file */ public ParserSettings getParserSettings() { return parserSettings; } /** * @return the JNLP file's version. */ public Version getFileVersion() { return fileVersion; } /** * @return the specification version required by the file. */ public Version getSpecVersion() { return specVersion; } /** * @return the codebase URL for the JNLP file. */ public URL getCodeBase() { return codeBase; } /** * It is not recommended to use this method for internals of itw - use normal getCodeBase rather, as null is expected always except toString calls. * * If you are not sure, use getCodeBase and chek null as you need. See that this method is used mostly for xtendedAppletSecuriyty dialogs. * * @return the codebase URL for the JNLP file or url of location of calling file (jnlp, hreffed jnlp, or directly html) */ public URL getNotNullProbalbeCodeBase() { if (getCodeBase()!=null){ return getCodeBase(); } try { return UrlUtils.removeFileName(getSourceLocation()); } catch (Exception ex) { OutputController.getLogger().log(ex); } return getSourceLocation(); } /** * @return the information section of the JNLP file as viewed * through the default locale. */ public InformationDesc getInformation() { return getInformation(defaultLocale); } /** * @param locale preferred locale of informations * @return the information section of the JNLP file as viewed * through the specified locale. */ public InformationDesc getInformation(final Locale locale) { boolean strict = false; if (this.info != null) { for (InformationDesc infoDesc : this.info) { if (infoDesc.strict) { strict = true; break; } } } return new InformationDesc(new Locale[] { locale }, strict) { @Override protected List getItems(Object key) { List result = new ArrayList<>(); for (Match precision : Match.values()) { for (InformationDesc infoDesc : JNLPFile.this.info) { if (localeMatches(locale, infoDesc.getLocales(), precision)) { result.addAll(infoDesc.getItems(key)); } } if (result.size() > 0) { return result; } } return result; } @Override public String getTitle() { for (Match precision : Match.values()) { for (InformationDesc infoDesc : JNLPFile.this.info) { String title = infoDesc.getTitle(); if (localeMatches(locale, infoDesc.getLocales(), precision) && title != null && !"".equals(title)) { return title; } } } return null; } @Override public String getVendor() { for (Match precision : Match.values()) { for (InformationDesc infoDesc : JNLPFile.this.info) { String vendor = infoDesc.getVendor(); if (localeMatches(locale, infoDesc.getLocales(), precision) && vendor != null && !"".equals(vendor)) { return vendor; } } } return null; } }; } /** * @return the update section of the JNLP file. */ public UpdateDesc getUpdate() { return update; } /** * @return the security section of the JNLP file. */ public SecurityDesc getSecurity() { return security; } public RequestedPermissionLevel getRequestedPermissionLevel() { return this.security.getRequestedPermissionLevel(); } /** * @return the resources section of the JNLP file as viewed * through the default locale and the os.name and os.arch * properties. */ public ResourcesDesc getResources() { return getResources(defaultLocale, defaultOS, defaultArch); } /** * @param locale preferred locale of resource * @param os preferred os of resource * @param arch preferred arch of resource * @return the resources section of the JNLP file for the * specified locale, os, and arch. */ public ResourcesDesc getResources(final Locale locale, final String os, final String arch) { return new ResourcesDesc(this, new Locale[] { locale }, new String[] { os }, new String[] { arch }) { @Override public List getResources(Class launchType) { List result = new ArrayList<>(); for (ResourcesDesc rescDesc : resources) { boolean hasUsableLocale = false; for (Match match : Match.values()) { hasUsableLocale |= localeMatches(locale, rescDesc.getLocales(), match); } if (hasUsableLocale && stringMatches(os, rescDesc.getOS()) && stringMatches(arch, rescDesc.getArch())) result.addAll(rescDesc.getResources(launchType)); } result.addAll(sharedResources.getResources(launchType)); return result; } @Override public void addResource(Object resource) { // todo: honor the current locale, os, arch values sharedResources.addResource(resource); } }; } /** * @return the resources section of the JNLP file as viewed * through the default locale and the os.name and os.arch * properties. * XXX: Before overriding this method or changing its implementation, * read the comment in JNLPFile.getDownloadOptionsForJar(JARDesc). */ public ResourcesDesc[] getResourcesDescs() { return getResourcesDescs(defaultLocale, defaultOS, defaultArch); } /** * @param locale preferred locale of resource * @param os preferred os of resource * @param arch preferred arch of resource * @return the resources section of the JNLP file for the * specified locale, os, and arch. */ public ResourcesDesc[] getResourcesDescs(final Locale locale, final String os, final String arch) { List matchingResources = new ArrayList<>(); for (ResourcesDesc rescDesc: resources) { boolean hasUsableLocale = false; for (Match match : Match.values()) { hasUsableLocale |= localeMatches(locale, rescDesc.getLocales(), match); } if (hasUsableLocale && stringMatches(os, rescDesc.getOS()) && stringMatches(arch, rescDesc.getArch())) { matchingResources.add(rescDesc); } } return matchingResources.toArray(new ResourcesDesc[0]); } /** * @return an object of one of the following types: AppletDesc, * ApplicationDesc and InstallerDesc */ public LaunchDesc getLaunchInfo() { return launchType; } /** * @return the launch information for an applet. * * @throws UnsupportedOperationException if there is no applet information */ public AppletDesc getApplet() { if (!isApplet()) throw new UnsupportedOperationException(R("JNotApplet")); return (AppletDesc) launchType; } /** * @return the launch information for an application. * * @throws UnsupportedOperationException if there is no application information */ public ApplicationDesc getApplication() { if (!isApplication()) throw new UnsupportedOperationException(R("JNotApplication")); return (ApplicationDesc) launchType; } /** * @return the launch information for a component. * * @throws UnsupportedOperationException if there is no component information */ public ComponentDesc getComponent() { if (!isComponent()) throw new UnsupportedOperationException(R("JNotComponent")); return component; } /** * @return the launch information for an installer. * * @throws UnsupportedOperationException if there is no installer information */ public InstallerDesc getInstaller() { if (!isInstaller()) throw new UnsupportedOperationException(R("NotInstaller")); return (InstallerDesc) launchType; } /** * @return whether the lauch descriptor describes an Applet. */ public boolean isApplet() { return launchType instanceof AppletDesc; } /** * @return whether the lauch descriptor describes an Application. */ public boolean isApplication() { return launchType instanceof ApplicationDesc; } /** * @return whether the lauch descriptor describes a Component. */ public boolean isComponent() { return component != null; } /** * @return whether the lauch descriptor describes an Installer. */ public boolean isInstaller() { return launchType instanceof InstallerDesc; } /** * Sets the default view of the JNLP file returned by * getInformation, getResources, etc. If unset, the defaults * are the properties os.name, os.arch, and the locale returned * by Locale.getDefault(). * @param os preferred os of resource * @param arch preferred arch of resource * @param locale preferred locale of resource */ public void setDefaults(String os, String arch, Locale locale) { defaultOS = os; defaultArch = arch; defaultLocale = locale; } /** * Returns whether a locale is matched by one of more other * locales. Only the non-empty language, country, and variant * codes are compared; for example, a requested locale of * Locale("","","") would always return true. * * @param requested the requested locale * @param available the available locales * @param matchLevel the depth with which to match locales. * @return {@code true} if {@code requested} matches any of {@code available}, or if * {@code available} is empty or {@code null}. * @see Locale * @see Match */ public boolean localeMatches(Locale requested, Locale[] available, Match matchLevel) { if (matchLevel == Match.GENERALIZED) return available == null || available.length == 0; String language = requested.getLanguage(); // "" but never null String country = requested.getCountry(); String variant = requested.getVariant(); for (Locale locale : available) { switch (matchLevel) { case LANG: if (!language.isEmpty() && language.equals(locale.getLanguage()) && locale.getCountry().isEmpty() && locale.getVariant().isEmpty()) return true; break; case LANG_COUNTRY: if (!language.isEmpty() && language.equals(locale.getLanguage()) && !country.isEmpty() && country.equals(locale.getCountry()) && locale.getVariant().isEmpty()) return true; break; case LANG_COUNTRY_VARIANT: if (language.equals(locale.getLanguage()) && country.equals(locale.getCountry()) && variant.equals(locale.getVariant())) return true; break; default: break; } } return false; } /** * @return whether the string is a prefix for any of the strings * in the specified array. * * @param prefixStr the prefix string * @param available the strings to test * @return true if prefixStr is a prefix of any strings in * available, or if available is empty or null. */ private boolean stringMatches(String prefixStr, String available[]) { if (available == null || available.length == 0) return true; for (String available1 : available) { if (available1 != null && available1.startsWith(prefixStr)) { return true; } } return false; } /** * Initialize the JNLPFile fields. Private because it's called * from the constructor. * * @param location the file location or {@code null} */ private void parse(InputStream input, URL location, URL forceCodebase) throws ParseException { try { //if (location != null) // location = new URL(location, "."); // remove filename Node root = Parser.getRootNode(input, parserSettings); Parser parser = new Parser(this, location, root, parserSettings, forceCodebase); // true == allow extensions // JNLP tag information specVersion = parser.getSpecVersion(); fileVersion = parser.getFileVersion(); codeBase = parser.getCodeBase(); sourceLocation = parser.getFileLocation() != null ? parser.getFileLocation() : location; info = parser.getInfo(root); parser.checkForInformation(); update = parser.getUpdate(root); resources = parser.getResources(root, false); // false == not a j2se/java resources section launchType = parser.getLauncher(root); component = parser.getComponent(root); security = parser.getSecurity(root); checkForSpecialProperties(); } catch (ParseException ex) { throw ex; } catch (Exception ex) { OutputController.getLogger().log(ex); throw new RuntimeException(ex.toString()); } } /** * Inspects the JNLP file to check if it contains any special properties */ private void checkForSpecialProperties() { for (ResourcesDesc res : resources) { for (PropertyDesc propertyDesc : res.getProperties()) { for (int i = 0; i < generalProperties.length; i++) { String property = propertyDesc.getKey(); if (property.equals(generalProperties[i])) { break; } else if (!property.equals(generalProperties[i]) && i == generalProperties.length - 1) { containsSpecialProperties = true; return; } } } } } /** * * @return true if the JNLP file specifies things that can only be * applied on a new vm (eg: different max heap memory) */ public boolean needsNewVM() { return !getNewVMArgs().isEmpty(); } /** * @return a list of args to pass to the new * JVM based on this JNLP file */ public List getNewVMArgs() { List newVMArgs = new LinkedList<>(); JREDesc[] jres = getResources().getJREs(); for (JREDesc jre : jres) { String initialHeapSize = jre.getInitialHeapSize(); if (initialHeapSize != null) { newVMArgs.add("-Xms" + initialHeapSize); } String maxHeapSize = jre.getMaximumHeapSize(); if (maxHeapSize != null) { newVMArgs.add("-Xmx" + maxHeapSize); } String vmArgsFromJre = jre.getVMArgs(); if (vmArgsFromJre != null) { String[] args = vmArgsFromJre.split(" "); newVMArgs.addAll(Arrays.asList(args)); } } return newVMArgs; } /** * @return the download options to use for downloading jars listed in this jnlp file. */ public DownloadOptions getDownloadOptions() { boolean usePack = false; boolean useVersion = false; ResourcesDesc desc = getResources(); if (Boolean.valueOf(desc.getPropertiesMap().get("jnlp.packEnabled"))) { usePack = true; } if (Boolean.valueOf(desc.getPropertiesMap().get("jnlp.versionEnabled"))) { useVersion = true; } return new DownloadOptions(usePack, useVersion); } /** * Returns a boolean after determining if a signed JNLP warning should be * displayed in the 'More Information' panel. * * @return true if a warning should be displayed; otherwise false */ public boolean requiresSignedJNLPWarning() { return (missingSignedJNLP && containsSpecialProperties); } /** * Informs that a signed JNLP file is missing in the main jar */ public void setSignedJNLPAsMissing() { missingSignedJNLP = true; } public ManifestsAttributes getManifestsAttributes() { return manifestsAttributes; } public class ManifestsAttributes { public static final String APP_NAME = "Application-Name"; public static final String CALLER_ALLOWABLE = "Caller-Allowable-Codebase"; public static final String APP_LIBRARY_ALLOWABLE = "Application-Library-Allowable-Codebase"; public static final String PERMISSIONS = "Permissions"; public static final String CODEBASE = "Codebase"; public static final String TRUSTED_ONLY = "Trusted-Only"; public static final String TRUSTED_LIBRARY = "Trusted-Library"; public static final String ENTRY_POINT="Entry-Point"; private JNLPClassLoader loader; public void setLoader(JNLPClassLoader loader) { this.loader = loader; } public boolean isLoader() { return loader != null; } /** * main class can be defined outside of manifest. * This method is mostly for completeness * @return main-class as it is specified in application */ public String getMainClass(){ if (loader == null) { OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "Jars not ready to provide main class"); return null; } return loader.getMainClass(); } /** * * http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/security/manifest.html#entry_pt * @return values of Entry-Points attribute */ public String[] getEntryPoints() { return splitEntryPoints(getEntryPointString()); } public String getEntryPointString() { return getAttribute(ENTRY_POINT); } /** * http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/manifest.html#app_name * @return value of Application-Name manifest attribute */ public String getApplicationName(){ return getAttribute(APP_NAME); } /** * http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/manifest.html#caller_allowable * @return values of Caller-Allowable-Codebase manifest attribute */ public ClasspathMatcher.ClasspathMatchers getCallerAllowableCodebase() { return getCodeBaseMatchersAttribute(CALLER_ALLOWABLE, false); } /** * http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/manifest.html#app_library * @return values of Application-Library-Allowable-Codebase manifest attribute */ public ClasspathMatcher.ClasspathMatchers getApplicationLibraryAllowableCodebase() { return getCodeBaseMatchersAttribute(APP_LIBRARY_ALLOWABLE, true); } /** * http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/manifest.html#codebase * @return values of Codebase manifest attribute */ public ClasspathMatcher.ClasspathMatchers getCodebase() { return getCodeBaseMatchersAttribute(CODEBASE, false); } /** * http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/manifest.html#trusted_only * @return value of Trusted-Only manifest attribute */ public ManifestBoolean isTrustedOnly() { return processBooleanAttribute(TRUSTED_ONLY); } /** * http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/manifest.html#trusted_library * @return value of Trusted-Library manifest attribute */ public ManifestBoolean isTrustedLibrary() { return processBooleanAttribute(TRUSTED_LIBRARY); } /** * http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/manifest.html#permissions * @return value of Permissions manifest attribute */ public ManifestBoolean isSandboxForced() { String s = getAttribute(PERMISSIONS); if (s == null) { return ManifestBoolean.UNDEFINED; } else if (s.trim().equalsIgnoreCase(SecurityDesc.RequestedPermissionLevel.SANDBOX.toHtmlString())) { return ManifestBoolean.TRUE; } else if (s.trim().equalsIgnoreCase(SecurityDesc.RequestedPermissionLevel.ALL.toHtmlString())) { return ManifestBoolean.FALSE; } else { throw new IllegalArgumentException("Unknown value of " + PERMISSIONS + " attribute " + s + ". Expected "+SecurityDesc.RequestedPermissionLevel.SANDBOX.toHtmlString()+" or "+SecurityDesc.RequestedPermissionLevel.ALL.toHtmlString()); } } /** * http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/manifest.html#permissions * @return plain string values of Permissions manifest attribute */ public String permissionsToString() { String s = getAttribute(PERMISSIONS); if (s == null) { return "Not defined"; } else if (s.trim().equalsIgnoreCase(SecurityDesc.RequestedPermissionLevel.SANDBOX.toHtmlString())) { return s.trim(); } else if (s.trim().equalsIgnoreCase(SecurityDesc.RequestedPermissionLevel.ALL.toHtmlString())) { return s.trim(); } else { return "illegal"; } } /** * get custom attribute. */ String getAttribute(String name) { return getAttribute(new Attributes.Name(name)); } /** * get standard attribute * @param name name of the manifest attribute to find in application * @return plain attribute value */ public String getAttribute(Attributes.Name name) { if (loader == null) { OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "Jars not ready to provide attribute " + name); return null; } return loader.checkForAttributeInJars(Arrays.asList(getResources().getJARs()), name); } public ClasspathMatcher.ClasspathMatchers getCodeBaseMatchersAttribute(String s, boolean includePath) { return getCodeBaseMatchersAttribute(new Attributes.Name(s), includePath); } public ClasspathMatcher.ClasspathMatchers getCodeBaseMatchersAttribute(Attributes.Name name, boolean includePath) { String s = getAttribute(name); if (s == null) { return null; } return ClasspathMatcher.ClasspathMatchers.compile(s, includePath); } private ManifestBoolean processBooleanAttribute(String id) throws IllegalArgumentException { String s = getAttribute(id); if (s == null) { return ManifestBoolean.UNDEFINED; } else { s = s.toLowerCase().trim(); switch (s) { case "true": return ManifestBoolean.TRUE; case "false": return ManifestBoolean.FALSE; default: throw new IllegalArgumentException("Unknown value of " + id + " attribute " + s + ". Expected true or false"); } } } } public String createJnlpVendorValue() { final String location; if (getSourceLocation() != null) { location = getSourceLocation().toString(); } else if (getCodeBase() != null) { location = getCodeBase().toString(); } else { location = "unknown"; } return location; } public String createJnlpVendor() { return "Generated from applet from " + createJnlpVendorValue(); } public String createJnlpTitleValue() { final String location; if (getSourceLocation() != null) { location = new File(getSourceLocation().getFile()).getName(); } else if (getCodeBase() != null) { location = new File(getCodeBase().getFile()).getName(); } else { location = "unknown"; } return location; } public String createJnlpTitle() { //case when creating name from already created name String shortenedTitle = getTitle(); int i = shortenedTitle.lastIndexOf("("); if (i >= 2) { // not cutting immidiately... shortenedTitle = shortenedTitle.substring(0, i - 1); } if (createJnlpTitleValue().startsWith(shortenedTitle)) { return createJnlpTitleValue(); } return getTitle() + " from " + createJnlpTitleValue(); } //not private for testing purposes static String[] splitEntryPoints(String entryPointString) { if (entryPointString == null || entryPointString.trim().isEmpty()) { return null; } String[] result = entryPointString.trim().split("\\s+"); if (result.length == 0) { return null; } return result; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/JNLPCreator.java0000644000000000000000000000013112654402377023424 xustar0030 mtime=1454507263.246432461 30 atime=1454507327.122580564 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/JNLPCreator.java0000644000175000002070000000270212654402377024151 0ustar00jvanekmock00000000000000/* * Copyright 2012 Red Hat, Inc. * This file is part of IcedTea, http://icedtea.classpath.org * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Sun designates this * particular file as subject to the "Classpath" exception as provided * by Sun in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */ package net.sourceforge.jnlp; import java.io.IOException; import java.net.URL; import net.sourceforge.jnlp.cache.UpdatePolicy; public class JNLPCreator { public JNLPFile create(URL location, Version version, ParserSettings settings, UpdatePolicy policy, URL forceCodebase) throws IOException, ParseException { return new JNLPFile(location, version, settings, policy, forceCodebase); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/JARDesc.java0000644000000000000000000000013112654402377022554 xustar0030 mtime=1454507263.246432461 30 atime=1454507327.122580564 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/JARDesc.java0000644000175000002070000000750512654402377023307 0ustar00jvanekmock00000000000000// Copyright (C) 2001-2003 Jon A. Maxwell (JAM) // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp; import java.net.URL; /** * The JAR element. * * This class is immutable and thread safe * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.6 $ */ public class JARDesc { /** the location of the JAR file */ private final URL location; /** the required JAR versions, or null */ private final Version version; /** the part name */ private final String part; /** whether to load the JAR on demand */ private final boolean lazy; /** whether the JAR contains the main class */ private final boolean main; /** whether the JAR contains native libraries */ private final boolean nativeJar; /** whether the JAR can be cached */ private final boolean cacheable; /** * Create a JAR descriptor. * * @param location the location of the JAR file * @param version the required JAR versions, or null * @param part the part name, or null * @param lazy whether to load the JAR on demand * @param main whether the JAR contains the main class * @param nativeJar whether the JAR contains native libraries * @param cacheable whether the JAR can be cached or not */ public JARDesc(URL location, Version version, String part, boolean lazy, boolean main, boolean nativeJar, boolean cacheable) { this.location = location; this.version = version; this.part = part; this.lazy = lazy; this.main = main; this.nativeJar = nativeJar; this.cacheable = cacheable; } /** * @return the URL of the JAR file. */ public URL getLocation() { return location; } /** * @return the required version of the JAR file. */ public Version getVersion() { return version; } /** * @return the part name, or null if not specified in the JNLP * file. */ public String getPart() { return part; } /** * @return true if the JAR file contains native code * libraries. */ public boolean isNative() { return nativeJar; } // these both are included in case the spec adds a new value, // where !lazy would no longer imply eager. /** * @return true if the JAR file should be downloaded before * starting the application. */ public boolean isEager() { return !lazy; } /** * @return true if the JAR file should be downloaded on demand. */ public boolean isLazy() { return lazy; } /** * @return true if the JNLP file defined this JAR as containing * the main class. If no JARs were defined as the main JAR then * the first JAR should be used to locate the main class. * * @see ResourcesDesc#getMainJAR */ public boolean isMain() { return main; } /** * Returns if this jar is cacheable * * @return Whether or not this jar is cacheable */ public boolean isCacheable() { return cacheable; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/InstallerDesc.java0000644000000000000000000000013112654402377024075 xustar0030 mtime=1454507263.245432474 30 atime=1454507327.122580564 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/InstallerDesc.java0000644000175000002070000000267612654402377024634 0ustar00jvanekmock00000000000000// Copyright (C) 2001-2003 Jon A. Maxwell (JAM) // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp; /** * The installer-desc element. * * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.6 $ */ public class InstallerDesc implements LaunchDesc { /** the main class name and package. */ private String mainClass; /** * Creates a installer descriptor. * * @param mainClass main class name and package */ public InstallerDesc(String mainClass) { this.mainClass = mainClass; } /** * Returns the main class name and package. */ @Override public String getMainClass() { return mainClass; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/InformationDesc.java0000644000000000000000000000013112654402377024425 xustar0030 mtime=1454507263.245432474 30 atime=1454507327.122580564 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/InformationDesc.java0000644000175000002070000002023712654402377025155 0ustar00jvanekmock00000000000000// Copyright (C) 2001-2003 Jon A. Maxwell (JAM) // Copyright (C) 2009 Red Hat, Inc. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp; import java.net.*; import java.util.*; /** * The information element. * * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.9 $ */ public class InformationDesc { // There is an understanding between this class and the parser // that description and icon types are keyed by "icon-"+kind and // "description-"+kind, and that other types are keyed by their // specification name. /** one-line description */ /**http://docs.oracle.com/javase/6/docs/technotes/guides/javaws/developersguide/syntax.html**/ public static final Object ONE_LINE = "one-line"; /** short description */ public static final Object SHORT = "short"; /** tooltip description */ public static final Object TOOLTIP = "tooltip"; /** default description */ public static final Object DEFAULT = "default"; /** the locales for the information */ final private Locale locales[]; /** the data as list of key,value pairs */ private List info; final boolean strict; /** * Create an information element object. * * @param locales the locales the information is for * @param strict whether parser was strict */ public InformationDesc(Locale locales[], boolean strict) { this.locales = locales; this.strict = strict; } InformationDesc(Locale locales[]) { this(locales, false); } /** * @return the application's title. */ public String getTitle() { return (String) getItem("title"); } /** * @return the application's vendor. */ public String getVendor() { return (String) getItem("vendor"); } /** * @return the application's homepage. */ public URL getHomepage() { return (URL) getItem("homepage"); } /** * @return the default description for the application. */ public String getDescription() { String result = getDescription(DEFAULT); // try to find any description if default is null if (result == null) result = getDescription(ONE_LINE); if (result == null) result = getDescription(SHORT); if (result == null) result = getDescription(TOOLTIP); return result; } /** * @return the application's description of the specified type. * * @param kind one of Information.SHORT, Information.ONE_LINE, * Information.TOOLTIP, Information.DEFAULT */ public String getDescription(Object kind) { String result = getDescriptionStrict(kind); if (result == null) return (String) getItem("description-" + DEFAULT); else return result; } /** * @return the application's description of the specified type. * * @param kind one of Information.SHORT, Information.ONE_LINE, * Information.TOOLTIP, Information.DEFAULT */ public String getDescriptionStrict(Object kind) { return (String) getItem("description-" + kind); } /** * Returns the icons specified by the JNLP file. * * @param kind one of IconDesc.SELECTED, IconDesc.DISABLED, * IconDesc.ROLLOVER, IconDesc.SPLASH, IconDesc.DEFAULT * @return an array of zero of more IconDescs of the specified icon type */ public IconDesc[] getIcons(Object kind) { List icons = getItems("icon-" + kind); return icons.toArray(new IconDesc[icons.size()]); }; /** * Returns the URL of the icon closest to the specified size and * kind. This method will not return an icon smaller than the * specified width and height unless there are no other icons * available. * * @param kind the kind of icon to get * @param width desired width of icon * @param height desired height of icon * @return the closest icon by size or null if no icons declared */ public URL getIconLocation(Object kind, int width, int height) { IconDesc icons[] = getIcons(kind); if (icons.length == 0) return null; IconDesc best = null; for (IconDesc icon : icons) { if (icon.getWidth() >= width && icon.getHeight() >= height) { if (best == null) { best = icon; } if (icon.getWidth() <= best.getWidth() && icon.getHeight() <= best.getHeight()) { best = icon; } } } // FIXME if there's no larger icon, choose the closest smaller icon // instead of the first if (best == null) best = icons[0]; return best.getLocation(); } /** * @return the locales for the information. */ public Locale[] getLocales() { return locales; } /** * @return whether offline execution allowed. */ public boolean isOfflineAllowed() { if (strict) { return null != getItem("offline-allowed"); } else { // by deault itw ignore this switch. Most applications are missusing it return true; } } /** * @return whether the resources specified in the JNLP file may * be shared by more than one instance in the same JVM * (JNLP extension). This is an extension to the JNLP spec and * will always return false for standard JNLP files. */ public boolean isSharingAllowed() { return null != getItem("sharing-allowed"); } /** * @return the associations specified in the JNLP file */ public AssociationDesc[] getAssociations() { List associations = getItems("association"); return associations.toArray(new AssociationDesc[associations.size()]); } /** * @return the shortcut specified by this JNLP file */ public ShortcutDesc getShortcut() { return (ShortcutDesc) getItem("shortcut"); } /** * @return the related-contents specified by this JNLP file */ public RelatedContentDesc[] getRelatedContents() { List relatedContents = getItems("related-content"); return relatedContents.toArray(new RelatedContentDesc[relatedContents.size()]); } /** * @param key key to find item * @return the last item matching the specified key. */ protected Object getItem(Object key) { List items = getItems(key); if (items.isEmpty()) return null; else return items.get(items.size() - 1); } /** * @param key key to find item * @return all items matching the specified key. */ protected List getItems(Object key) { if (info == null) return Collections.emptyList(); List result = new ArrayList<>(); for (int i = 0; i < info.size(); i += 2) if (info.get(i).equals(key)) result.add(info.get(i + 1)); return result; } /** * Add an information item (description, icon, etc) under a * specified key name. * @param key key to place value to * @param value value to be placed to key */ protected void addItem(String key, Object value) { if (info == null) info = new ArrayList<>(); info.add(key); info.add(value); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/IconDesc.java0000644000000000000000000000013112654402377023030 xustar0030 mtime=1454507263.245432474 30 atime=1454507327.122580564 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/IconDesc.java0000644000175000002070000000643312654402377023562 0ustar00jvanekmock00000000000000// Copyright (C) 2001-2003 Jon A. Maxwell (JAM) // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp; import java.net.*; /** * The icon element. * * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.8 $ */ public class IconDesc { /** default icon */ public static final Object DEFAULT = "default"; /** selected icon */ public static final Object SELECTED = "selected"; /** disabled icon */ public static final Object DISABLED = "disabled"; /** rollover icon */ public static final Object ROLLOVER = "rollover"; /** splash icon */ public static final Object SPLASH = "splash"; /** destop shortcut icon */ public static final Object SHORTCUT = "shortcut"; /** the location of the icon */ private final URL location; /** the type of icon*/ private final Object kind; /** the width, or -1 if unknown*/ private final int width; /** the height, or -1 if unknown*/ private final int height; /** the depth, or -1 if unknown*/ private final int depth; /** the size, or -1 if unknown*/ private final int size; /** * Creates an icon descriptor with the specified information. * * @param location the location of the icon * @param kind the type of icon * @param width the width, or -1 if unknown * @param height the height, or -1 if unknown * @param depth the depth, or -1 if unknown * @param size the size, or -1 if unknown */ IconDesc(URL location, Object kind, int width, int height, int depth, int size) { this.location = location; this.kind = kind; this.width = width; this.height = height; this.depth = depth; this.size = size; } /** * @return the location of the icon. */ public URL getLocation() { return location; } /** * @return the icon type. */ public Object getKind() { return kind; } /** * @return the icon width or -1 if not specified in the * JNLPFile. */ public int getWidth() { return width; } /** * @return the icon height or -1 if not specified in the * JNLPFile. */ public int getHeight() { return height; } /** * @return the icon size or -1 if not specified in the JNLPFile. */ public int getSize() { return size; } /** * @return the icon depth or -1 if not specified in the * JNLPFile. */ public int getDepth() { return depth; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/GuiLaunchHandler.java0000644000000000000000000000013112654402377024516 xustar0030 mtime=1454507263.244432488 30 atime=1454507327.122580564 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/GuiLaunchHandler.java0000644000175000002070000001377412654402377025256 0ustar00jvanekmock00000000000000/* GuiLaunchHandler.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp; import java.lang.reflect.InvocationTargetException; import java.net.URL; import javax.swing.SwingUtilities; import net.sourceforge.jnlp.cache.ResourceTracker; import net.sourceforge.jnlp.cache.UpdatePolicy; import net.sourceforge.jnlp.runtime.ApplicationInstance; import net.sourceforge.jnlp.util.BasicExceptionDialog; import net.sourceforge.jnlp.util.logging.OutputController; /** * A {@link LaunchHandler} that gives feedback to the user using GUI elements * including splash screens and exception dialogs. */ public class GuiLaunchHandler extends AbstractLaunchHandler { private volatile JNLPSplashScreen splashScreen = null; private final Object mutex = new Object(); private UpdatePolicy policy = UpdatePolicy.ALWAYS; public GuiLaunchHandler(OutputController outputStream) { super(outputStream); } @Override public void launchCompleted(ApplicationInstance application) { // do nothing } @Override public void launchError(final LaunchException exception) { BasicExceptionDialog.willBeShown(); SwingUtilities.invokeLater(new Runnable() { @Override public void run() { closeSplashScreen(); BasicExceptionDialog.show(exception); } }); printMessage(exception); } private void closeSplashScreen() { synchronized (mutex) { if (splashScreen != null) { if (splashScreen.isSplashScreenValid()) { splashScreen.setVisible(false); splashScreen.stopAnimation(); } splashScreen.dispose(); } } } @Override public void launchStarting(ApplicationInstance application) { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { closeSplashScreen(); } }); } @Override @SuppressWarnings("empty-statement") public void launchInitialized(final JNLPFile file) { int preferredWidth = 500; int preferredHeight = 400; final URL splashImageURL = file.getInformation().getIconLocation( IconDesc.SPLASH, preferredWidth, preferredHeight); final ResourceTracker resourceTracker = new ResourceTracker(true); if (splashImageURL != null) { resourceTracker.addResource(splashImageURL, file.getFileVersion(), null, policy); } synchronized (mutex) { try { SwingUtilities.invokeAndWait(new Runnable() { @Override public void run() { splashScreen = new JNLPSplashScreen(resourceTracker, file); } }); } catch (InterruptedException ie) { // Wait till splash screen is created while (splashScreen == null); } catch (InvocationTargetException ite) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, ite); } try { SwingUtilities.invokeAndWait(new Runnable() { @Override public void run() { splashScreen.setSplashImageURL(splashImageURL); } }); } catch (InterruptedException ie) { // Wait till splash screen is created while (!splashScreen.isSplashImageLoaded()); } catch (InvocationTargetException ite) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, ite); } } SwingUtilities.invokeLater(new Runnable() { @Override public void run() { if (splashScreen != null) { synchronized (mutex) { if (splashScreen.isSplashScreenValid()) { splashScreen.setVisible(true); } } } } }); } @Override public boolean launchWarning(LaunchException warning) { printMessage(warning); return true; } @Override public boolean validationError(LaunchException error) { closeSplashScreen(); printMessage(error); return true; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/ExtensionDesc.java0000644000000000000000000000013112654402377024114 xustar0030 mtime=1454507263.244432488 30 atime=1454507327.122580564 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/ExtensionDesc.java0000644000175000002070000001044212654402377024641 0ustar00jvanekmock00000000000000// Copyright (C) 2001-2003 Jon A. Maxwell (JAM) // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp; import static net.sourceforge.jnlp.runtime.Translator.R; import java.io.*; import java.net.*; import java.util.*; import net.sourceforge.jnlp.util.logging.OutputController; /** * The extension element. * * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.8 $ */ public class ExtensionDesc { /** the extension name */ private final String name; /** the required extension version */ private final Version version; /** the location of the extension JNLP file */ private final URL location; /** the JNLPFile the extension refers to */ private JNLPFile file; /** map from ext-part to local part */ private final Map extToPart = new HashMap<>(); /** eager ext parts */ private final List eagerExtParts = new ArrayList<>(); /** * Create an extention descriptor. * * @param name the extension name * @param version the required version of the extention JNLPFile * @param location the location of the extention JNLP file */ public ExtensionDesc(String name, Version version, URL location) { this.name = name; this.version = version; this.location = location; } /** * Adds an extension part to be downloaded when the specified * part of the main JNLP file is loaded. The extension part * will be downloaded before the application is launched if the * lazy value is false or the part is empty or null. * * @param extPart the part name in the extension file * @param part the part name in the main file * @param lazy whether to load the part before launching */ protected void addPart(String extPart, String part, boolean lazy) { extToPart.put(extPart, part); if (!lazy || part == null || part.length() == 0) eagerExtParts.add(extPart); } /** * @param thisPart unimplemented * @return the parts in the extension JNLP file mapped to the * part of the main file. */ public String[] getExtensionParts(String thisPart) { return null; } /** * @return the name of the extension. */ public String getName() { return name; } /** * @return the required version of the extension JNLP file. */ public Version getVersion() { return version; } /** * @return the location of the extension JNLP file. */ public URL getLocation() { return location; } /** * Resolves the extension by creating a JNLPFile from the file * specified by the extension's location property. * * @throws IOException if the extension JNLPFile could not be resolved. * @throws ParseException if the extension JNLPFile could not be * parsed or was not a component or installer descriptor. */ public void resolve() throws ParseException, IOException { if (file == null) { file = new JNLPFile(location); OutputController.getLogger().log("Resolve: " + file.getInformation().getTitle()); // check for it being an extension descriptor if (!file.isComponent() && !file.isInstaller()) throw new ParseException(R("JInvalidExtensionDescriptor", name, location)); } } /** * @return a JNLPFile for the extension, or null if the JNLP * file has not been resolved. */ public JNLPFile getJNLPFile() { return file; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/DownloadOptions.java0000644000000000000000000000013112654402377024464 xustar0030 mtime=1454507263.244432488 30 atime=1454507327.122580564 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/DownloadOptions.java0000644000175000002070000000436212654402377025215 0ustar00jvanekmock00000000000000/* DownloadOptions.java Copyright (C) 2011 Red Hat, Inc This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp; public class DownloadOptions { private final boolean usePack200; private final boolean useVersion; public DownloadOptions(boolean usePack, boolean useVersion) { this.usePack200 = usePack; this.useVersion = useVersion; } public boolean useExplicitPack() { return usePack200; } public boolean useExplicitVersion() { return useVersion; } @Override public String toString() { return "DownloadOptions[use pack: " + usePack200 + "; use version: " + useVersion + "]"; } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/DefaultLaunchHandler.java0000644000000000000000000000013112654402377025356 xustar0030 mtime=1454507263.244432488 30 atime=1454507327.121580577 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/DefaultLaunchHandler.java0000644000175000002070000000575012654402377026111 0ustar00jvanekmock00000000000000// Copyright (C) 2001-2003 Jon A. Maxwell (JAM) // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp; import net.sourceforge.jnlp.runtime.*; import net.sourceforge.jnlp.util.logging.OutputController; /** * This default implementation shows prints the exception to * stdout and if not in headless mode displays the exception in a * dialog. * * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.1 $ */ public class DefaultLaunchHandler extends AbstractLaunchHandler { public DefaultLaunchHandler(OutputController out) { super(out); } /** * Called when the application could not be launched due to a * fatal error, such as the inability to find the main class * or non-parseable XML. */ public void launchError(LaunchException exception) { printMessage(exception); } /** * Called when launching the application can not be launched * due to an error that is not fatal. For example a JNLP file * that is not strictly correct yet does not necessarily * prohibit the system from attempting to launch the * application. * * @return true if the launch should continue, false to abort */ public boolean launchWarning(LaunchException warning) { printMessage(warning); return true; } /** * Called when a security validation error occurs while * launching the application. * * @return true to allow the application to continue, false to stop it. */ public boolean validationError(LaunchException error) { printMessage(error); return true; } /** * Called when an application, applet, or installer has been * launched successfully (the main method or applet start method * returned normally). * * @param application the launched application instance */ public void launchCompleted(ApplicationInstance application) { // } /** * Do nothing on when initializing */ @Override public void launchInitialized(JNLPFile file) { // do nothing } /** * Do nothing when starting */ @Override public void launchStarting(ApplicationInstance application) { // do nothing } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/ComponentDesc.java0000644000000000000000000000013112654402377024102 xustar0030 mtime=1454507263.243432501 30 atime=1454507327.121580577 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/ComponentDesc.java0000644000175000002070000000225312654402377024630 0ustar00jvanekmock00000000000000// Copyright (C) 2001-2003 Jon A. Maxwell (JAM) // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp; /** * The component-desc element. * * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.6 $ */ public class ComponentDesc { // this is for completeness and in case of changes to spec for components. /** * Create a component descriptor. */ public ComponentDesc() { } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/AssociationDesc.java0000644000000000000000000000013112654402377024414 xustar0030 mtime=1454507263.243432501 30 atime=1454507327.121580577 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/AssociationDesc.java0000644000175000002070000000336512654402377025147 0ustar00jvanekmock00000000000000// Copyright (C) 2009 Red Hat, Inc. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp; public final class AssociationDesc { /** the extensions this application wants to register with */ private final String[] extensions; /** the mime type for the association */ private final String mimeType; public AssociationDesc(String mimeType, String[] extensions) throws ParseException { checkMimeType(mimeType); this.mimeType = mimeType; this.extensions = extensions; } /** * @return the extensions for this association */ public String[] getExtensions() { return extensions; } /** * @return the mimetype for this association */ public String getMimeType() { return mimeType; } /** * Check for valid mimeType * @param mimeType a mime type * @throws ParseException if mimeType is an invalid MIME type */ private void checkMimeType(String mimeType) throws ParseException { // TODO check that mime type is valid } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/ApplicationDesc.java0000644000000000000000000000013112654402377024403 xustar0030 mtime=1454507263.243432501 30 atime=1454507327.121580577 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/ApplicationDesc.java0000644000175000002070000000401012654402377025122 0ustar00jvanekmock00000000000000// Copyright (C) 2001-2003 Jon A. Maxwell (JAM) // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp; import java.util.*; /** * The application-desc element. * * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.7 $ */ public class ApplicationDesc implements LaunchDesc { /** the main class name and package */ private final String mainClass; /** the arguments */ private String arguments[]; /** * Create an Application descriptor. * * @param mainClass the main class name and package * @param arguments the arguments */ public ApplicationDesc(String mainClass, String arguments[]) { this.mainClass = mainClass; this.arguments = arguments; } /** * @return the main class name */ @Override public String getMainClass() { return mainClass; } /** * @return the arguments */ public String[] getArguments() { return arguments.clone(); } /** * Add an argument to the end of the arguments. * @param arg argument of command */ public void addArgument(String arg) { List l = new ArrayList<>(Arrays.asList(arguments)); l.add(arg); arguments = l.toArray(arguments); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/AppletDesc.java0000644000000000000000000000013112654402377023365 xustar0030 mtime=1454507263.243432501 30 atime=1454507327.121580577 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/AppletDesc.java0000644000175000002070000000635612654402377024123 0ustar00jvanekmock00000000000000// Copyright (C) 2001-2003 Jon A. Maxwell (JAM) // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package net.sourceforge.jnlp; import java.net.*; import java.util.*; /** * The applet-desc element. * * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.8 $ */ public class AppletDesc implements LaunchDesc { /** the applet name */ private final String name; /** the main class name and package */ private final String mainClass; /** the document base */ private final URL documentBase; /** the width */ private final int width; /** the height */ private final int height; /** the parameters */ private final Map parameters; /** * Create an Applet descriptor. * * @param name the applet name * @param mainClass the main class name and package * @param documentBase the document base * @param width the width * @param height the height * @param parameters the parameters */ public AppletDesc(String name, String mainClass, URL documentBase, int width, int height, Map parameters) { this.name = name; this.mainClass = mainClass; this.documentBase = documentBase; this.width = width; this.height = height; this.parameters = new HashMap<>(parameters); } /** * @return the applet name */ public String getName() { return name; } /** * @return the main class name in the dot-separated form (eg: foo.bar.Baz) */ @Override public String getMainClass() { return mainClass; } /** * @return the document base */ public URL getDocumentBase() { return documentBase; } /** * @return the width */ public int getWidth() { return width; } /** * @return the height */ public int getHeight() { return height; } /** * @return the applet parameters */ public Map getParameters() { return new HashMap<>(parameters); } /** * Adds a parameter to the applet. If the parameter already * exists then it is overwritten with the new value. Adding a * parameter will have no effect on already-running applets * launched from this JNLP file. * @param name key of value * @param value value to be added */ public void addParameter(String name, String value) { parameters.put(name, value); } } icedtea-web-1.6.2/netx/net/sourceforge/jnlp/PaxHeaders.17941/AbstractLaunchHandler.java0000644000000000000000000000013112654402377025535 xustar0030 mtime=1454507263.242432514 30 atime=1454507327.121580577 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/net/sourceforge/jnlp/AbstractLaunchHandler.java0000644000175000002070000000575612654402377026276 0ustar00jvanekmock00000000000000/* AbstractLaunchHandler.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp; import net.sourceforge.jnlp.util.logging.OutputController; public abstract class AbstractLaunchHandler implements LaunchHandler { protected final OutputController logger; public AbstractLaunchHandler(OutputController logger) { this.logger = logger; } /** * Print a message * @param ex exception to be printed out */ protected void printMessage(LaunchException ex) { StringBuilder result = new StringBuilder(); result.append("netx: "); result.append(ex.getCategory()); if (ex.getSummary() != null) { result.append(": "); result.append(ex.getSummary()); } if (ex.getCause() != null) { result.append(recursiveDescription(ex.getCause())); } logger.log(OutputController.Level.MESSAGE_ALL, result.toString()); logger.log(ex); } private String recursiveDescription(Throwable throwable) { StringBuilder builder = new StringBuilder(); builder.append(" ("); builder.append(throwable.getMessage() == null ? "" : throwable.getMessage()); if (throwable.getCause() != null) { builder.append(recursiveDescription(throwable.getCause())); } builder.append(")"); return builder.toString(); } } icedtea-web-1.6.2/netx/PaxHeaders.17941/javax0000644000000000000000000000013112654402377015456 xustar0030 mtime=1454507263.238432568 30 atime=1454507658.780157344 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/javax/0000755000175000002070000000000012654402377016257 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/netx/javax/PaxHeaders.17941/jnlp0000644000000000000000000000013112654402377016421 xustar0030 mtime=1454507263.242432514 30 atime=1454507658.780157344 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/javax/jnlp/0000755000175000002070000000000012654402377017222 5ustar00jvanekmock00000000000000icedtea-web-1.6.2/netx/javax/jnlp/PaxHeaders.17941/UnavailableServiceException.java0000644000000000000000000000013112654402377024764 xustar0030 mtime=1454507263.242432514 30 atime=1454507327.121580577 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/javax/jnlp/UnavailableServiceException.java0000644000175000002070000000037212654402377025512 0ustar00jvanekmock00000000000000package javax.jnlp; public class UnavailableServiceException extends Exception { public UnavailableServiceException() { super(); } public UnavailableServiceException(java.lang.String message) { super(message); } } icedtea-web-1.6.2/netx/javax/jnlp/PaxHeaders.17941/SingleInstanceService.java0000644000000000000000000000013012654402377023567 xustar0030 mtime=1454507263.242432514 29 atime=1454507327.12058059 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/javax/jnlp/SingleInstanceService.java0000644000175000002070000000343312654402377024317 0ustar00jvanekmock00000000000000// Copyright (C) 2009 Red Hat, Inc. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package javax.jnlp; /** * The SingleInstanceService provides a way to ensure that only one instance of * the application is ever running - singleton behavior at the application * level. * */ public interface SingleInstanceService { /** * Adds the specified SingleInstanceListener to the notification list. This * listener is notified when a new instance of the application is started. * * * @param listener the single instance listener to be added. No action is * performed if it is null. */ void addSingleInstanceListener(SingleInstanceListener listener); /** * Removes the specified SingleInstanceListener from the notification list. * This listener will not be notified if a new instance of the application * is started. * * @param listener the single instance listener to be removed. No action is * performed if it is null or not in the notification list. */ void removeSingleInstanceListener(SingleInstanceListener listener); } icedtea-web-1.6.2/netx/javax/jnlp/PaxHeaders.17941/SingleInstanceListener.java0000644000000000000000000000013012654402377023754 xustar0030 mtime=1454507263.241432528 29 atime=1454507327.12058059 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/javax/jnlp/SingleInstanceListener.java0000644000175000002070000000243112654402377024501 0ustar00jvanekmock00000000000000// Copyright (C) 2009 Red Hat, Inc. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package javax.jnlp; /** * This interface specifies a listener which is notified whenever a new instance * of the web start application is launched. * */ public interface SingleInstanceListener { /** * This method is called when a new instance of the application is launched. * The arguments passed to the new instance are passed into this method. * * @param arguments the arguments passed to the new instance of the * application */ void newActivation(String[] arguments); } icedtea-web-1.6.2/netx/javax/jnlp/PaxHeaders.17941/ServiceManagerStub.java0000644000000000000000000000013012654402377023071 xustar0030 mtime=1454507263.241432528 29 atime=1454507327.12058059 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/javax/jnlp/ServiceManagerStub.java0000644000175000002070000000031712654402377023617 0ustar00jvanekmock00000000000000package javax.jnlp; public interface ServiceManagerStub { public java.lang.Object lookup(java.lang.String name) throws UnavailableServiceException; public java.lang.String[] getServiceNames(); } icedtea-web-1.6.2/netx/javax/jnlp/PaxHeaders.17941/ServiceManager.java0000644000000000000000000000013012654402377022233 xustar0030 mtime=1454507263.241432528 29 atime=1454507327.12058059 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/javax/jnlp/ServiceManager.java0000644000175000002070000000253712654402377022767 0ustar00jvanekmock00000000000000package javax.jnlp; import java.util.*; public final class ServiceManager { private static ServiceManagerStub stub = null; private static Map lookupTable = new HashMap(); // ensure lookup is idempotent private ServiceManager() { // says it can't be instantiated } public static java.lang.Object lookup(java.lang.String name) throws UnavailableServiceException { if (stub == null) throw new UnavailableServiceException("service stub not set."); synchronized (lookupTable) { Object result = lookupTable.get(name); if (result == null) { result = stub.lookup(name); if (result != null) lookupTable.put(name, result); } if (result == null) throw new UnavailableServiceException("service not available (stub returned null)."); return result; } } public static java.lang.String[] getServiceNames() { // should this return the required ones even though no stub?? if (stub == null) return new String[0]; return stub.getServiceNames(); } public static void setServiceManagerStub(ServiceManagerStub stub) { if (ServiceManager.stub == null) ServiceManager.stub = stub; } } icedtea-web-1.6.2/netx/javax/jnlp/PaxHeaders.17941/PrintService.java0000644000000000000000000000013012654402377021755 xustar0030 mtime=1454507263.241432528 29 atime=1454507327.12058059 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/javax/jnlp/PrintService.java0000644000175000002070000000050612654402377022503 0ustar00jvanekmock00000000000000package javax.jnlp; public interface PrintService { public java.awt.print.PageFormat getDefaultPage(); public java.awt.print.PageFormat showPageFormatDialog(java.awt.print.PageFormat page); public boolean print(java.awt.print.Pageable document); public boolean print(java.awt.print.Printable painter); } icedtea-web-1.6.2/netx/javax/jnlp/PaxHeaders.17941/PersistenceService.java0000644000000000000000000000013112654402377023146 xustar0030 mtime=1454507263.241432528 30 atime=1454507327.119580604 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/javax/jnlp/PersistenceService.java0000644000175000002070000000154712654402377023701 0ustar00jvanekmock00000000000000package javax.jnlp; public interface PersistenceService { public static final int CACHED = 0; public static final int TEMPORARY = 1; public static final int DIRTY = 2; public long create(java.net.URL url, long maxsize) throws java.net.MalformedURLException, java.io.IOException; public FileContents get(java.net.URL url) throws java.net.MalformedURLException, java.io.IOException, java.io.FileNotFoundException; public void delete(java.net.URL url) throws java.net.MalformedURLException, java.io.IOException; public java.lang.String[] getNames(java.net.URL url) throws java.net.MalformedURLException, java.io.IOException; public int getTag(java.net.URL url) throws java.net.MalformedURLException, java.io.IOException; public void setTag(java.net.URL url, int tag) throws java.net.MalformedURLException, java.io.IOException; } icedtea-web-1.6.2/netx/javax/jnlp/PaxHeaders.17941/JNLPRandomAccessFile.java0000644000000000000000000000013112654402377023167 xustar0030 mtime=1454507263.240432541 30 atime=1454507327.119580604 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/javax/jnlp/JNLPRandomAccessFile.java0000644000175000002070000000464212654402377023721 0ustar00jvanekmock00000000000000package javax.jnlp; public interface JNLPRandomAccessFile extends java.io.DataInput, java.io.DataOutput { public void close() throws java.io.IOException; public long length() throws java.io.IOException; public long getFilePointer() throws java.io.IOException; public int read() throws java.io.IOException; public int read(byte[] b, int off, int len) throws java.io.IOException; public int read(byte[] b) throws java.io.IOException; public void readFully(byte[] b) throws java.io.IOException; public void readFully(byte[] b, int off, int len) throws java.io.IOException; public int skipBytes(int n) throws java.io.IOException; public boolean readBoolean() throws java.io.IOException; public byte readByte() throws java.io.IOException; public int readUnsignedByte() throws java.io.IOException; public short readShort() throws java.io.IOException; public int readUnsignedShort() throws java.io.IOException; public char readChar() throws java.io.IOException; public int readInt() throws java.io.IOException; public long readLong() throws java.io.IOException; public float readFloat() throws java.io.IOException; public double readDouble() throws java.io.IOException; public java.lang.String readLine() throws java.io.IOException; public java.lang.String readUTF() throws java.io.IOException; public void seek(long pos) throws java.io.IOException; public void setLength(long newLength) throws java.io.IOException; public void write(int b) throws java.io.IOException; public void write(byte[] b) throws java.io.IOException; public void write(byte[] b, int off, int len) throws java.io.IOException; public void writeBoolean(boolean v) throws java.io.IOException; public void writeByte(int v) throws java.io.IOException; public void writeShort(int v) throws java.io.IOException; public void writeChar(int v) throws java.io.IOException; public void writeInt(int v) throws java.io.IOException; public void writeLong(long v) throws java.io.IOException; public void writeFloat(float v) throws java.io.IOException; public void writeDouble(double v) throws java.io.IOException; public void writeBytes(java.lang.String s) throws java.io.IOException; public void writeChars(java.lang.String s) throws java.io.IOException; public void writeUTF(java.lang.String str) throws java.io.IOException; } icedtea-web-1.6.2/netx/javax/jnlp/PaxHeaders.17941/IntegrationService.java0000644000000000000000000000013112654402377023145 xustar0030 mtime=1454507263.240432541 30 atime=1454507327.119580604 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/javax/jnlp/IntegrationService.java0000644000175000002070000000107112654402377023670 0ustar00jvanekmock00000000000000package javax.jnlp; public interface IntegrationService { public boolean hasAssociation(java.lang.String mimeType, java.lang.String[] extensions); public boolean hasDesktopShortcut(); public boolean hasMenuShortcut(); public boolean removeAssociation(java.lang.String mimeType, java.lang.String[] extensions); public boolean removeShortcuts(); public boolean requestAssociation(java.lang.String mimeType, java.lang.String[] extensions); public boolean requestShortcut(boolean onDesktop, boolean inMenu, java.lang.String subMenu); } icedtea-web-1.6.2/netx/javax/jnlp/PaxHeaders.17941/FileSaveService.java0000644000000000000000000000013112654402377022360 xustar0030 mtime=1454507263.240432541 30 atime=1454507327.119580604 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/javax/jnlp/FileSaveService.java0000644000175000002070000000060312654402377023103 0ustar00jvanekmock00000000000000package javax.jnlp; public interface FileSaveService { public FileContents saveFileDialog(java.lang.String pathHint, java.lang.String[] extensions, java.io.InputStream stream, java.lang.String name) throws java.io.IOException; public FileContents saveAsFileDialog(java.lang.String pathHint, java.lang.String[] extensions, FileContents contents) throws java.io.IOException; } icedtea-web-1.6.2/netx/javax/jnlp/PaxHeaders.17941/FileOpenService.java0000644000000000000000000000013112654402377022363 xustar0030 mtime=1454507263.240432541 30 atime=1454507327.119580604 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/javax/jnlp/FileOpenService.java0000644000175000002070000000047612654402377023116 0ustar00jvanekmock00000000000000package javax.jnlp; public interface FileOpenService { public FileContents openFileDialog(java.lang.String pathHint, java.lang.String[] extensions) throws java.io.IOException; public FileContents[] openMultiFileDialog(java.lang.String pathHint, java.lang.String[] extensions) throws java.io.IOException; } icedtea-web-1.6.2/netx/javax/jnlp/PaxHeaders.17941/FileContents.java0000644000000000000000000000013112654402377021736 xustar0030 mtime=1454507263.239432554 30 atime=1454507327.119580604 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/javax/jnlp/FileContents.java0000644000175000002070000000130412654402377022460 0ustar00jvanekmock00000000000000package javax.jnlp; public interface FileContents { public java.lang.String getName() throws java.io.IOException; public java.io.InputStream getInputStream() throws java.io.IOException; public java.io.OutputStream getOutputStream(boolean overwrite) throws java.io.IOException; public long getLength() throws java.io.IOException; public boolean canRead() throws java.io.IOException; public boolean canWrite() throws java.io.IOException; public JNLPRandomAccessFile getRandomAccessFile(java.lang.String mode) throws java.io.IOException; public long getMaxLength() throws java.io.IOException; public long setMaxLength(long maxlength) throws java.io.IOException; } icedtea-web-1.6.2/netx/javax/jnlp/PaxHeaders.17941/ExtensionInstallerService.java0000644000000000000000000000013112654402377024514 xustar0030 mtime=1454507263.239432554 30 atime=1454507327.119580604 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/javax/jnlp/ExtensionInstallerService.java0000644000175000002070000000140512654402377025240 0ustar00jvanekmock00000000000000package javax.jnlp; public interface ExtensionInstallerService { public java.lang.String getInstallPath(); public java.lang.String getExtensionVersion(); public java.net.URL getExtensionLocation(); public void hideProgressBar(); public void hideStatusWindow(); public void setHeading(java.lang.String heading); public void setStatus(java.lang.String status); public void updateProgress(int value); public void installSucceeded(boolean needsReboot); public void installFailed(); public void setJREInfo(java.lang.String platformVersion, java.lang.String jrePath); public void setNativeLibraryInfo(java.lang.String path); public java.lang.String getInstalledJRE(java.net.URL url, java.lang.String version); } icedtea-web-1.6.2/netx/javax/jnlp/PaxHeaders.17941/ExtendedService.java0000644000000000000000000000013112654402377022422 xustar0030 mtime=1454507263.239432554 30 atime=1454507327.118580617 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/javax/jnlp/ExtendedService.java0000644000175000002070000000345112654402377023151 0ustar00jvanekmock00000000000000// Copyright (C) 2009 Red Hat, Inc. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. package javax.jnlp; import java.io.File; import java.io.IOException; /** * This interface provides a way for the JNLP application to open specific files * in the client's system. It asks permission from the user before opening any * files. * * @author Omair Majid * */ public interface ExtendedService { /** * Open a file on the client' system and return its contents. The user must * grant permission to the application for this to work. * * @param file the file to open * @return the opened file as a {@link FileContents} object * @throws IOException on any io problems */ FileContents openFile(File file) throws IOException; /** * Opens multiple files on the user's sytem and returns their contents as a * {@link FileContents} array * * @param files the files to open * @return an array of FileContents objects * @throws IOException on any io problems */ FileContents[] openFiles(File[] files) throws IOException; } icedtea-web-1.6.2/netx/javax/jnlp/PaxHeaders.17941/DownloadServiceListener.java0000644000000000000000000000013112654402377024137 xustar0030 mtime=1454507263.239432554 30 atime=1454507327.118580617 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/javax/jnlp/DownloadServiceListener.java0000644000175000002070000000076112654402377024667 0ustar00jvanekmock00000000000000package javax.jnlp; public interface DownloadServiceListener { public void progress(java.net.URL url, java.lang.String version, long readSoFar, long total, int overallPercent); public void validating(java.net.URL url, java.lang.String version, long entry, long total, int overallPercent); public void upgradingArchive(java.net.URL url, java.lang.String version, int patchPercent, int overallPercent); public void downloadFailed(java.net.URL url, java.lang.String version); } icedtea-web-1.6.2/netx/javax/jnlp/PaxHeaders.17941/DownloadService2.java0000644000000000000000000000013112654402377022513 xustar0030 mtime=1454507263.238432568 30 atime=1454507327.118580617 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/javax/jnlp/DownloadService2.java0000644000175000002070000000267212654402377023246 0ustar00jvanekmock00000000000000package javax.jnlp; public interface DownloadService2 { public static class ResourceSpec { public static final long UNKNOWN = Long.MIN_VALUE; protected String url; protected String version; protected int type; public ResourceSpec(java.lang.String url, java.lang.String version, int type) { this.url = url; this.version = version; this.type = type; } public long getExpirationDate() { return UNKNOWN; } public long getLastModified() { return UNKNOWN; } public long getSize() { return UNKNOWN; } public int getType() { return type; } public java.lang.String getUrl() { return url; } public java.lang.String getVersion() { return version; } } public static final int ALL = 0; public static final int APPLET = 2; public static final int APPLICATION = 1; public static final int CLASS = 6; public static final int EXTENSION = 3; public static final int IMAGE = 5; public static final int JAR = 4; public DownloadService2.ResourceSpec[] getCachedResources( javax.jnlp.DownloadService2.ResourceSpec resourceSpec); public DownloadService2.ResourceSpec[] getUpdateAvaiableReosurces( javax.jnlp.DownloadService2.ResourceSpec resourceSpec); } icedtea-web-1.6.2/netx/javax/jnlp/PaxHeaders.17941/DownloadService.java0000644000000000000000000000013112654402377022431 xustar0030 mtime=1454507263.238432568 30 atime=1454507327.118580617 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/javax/jnlp/DownloadService.java0000644000175000002070000000335112654402377023157 0ustar00jvanekmock00000000000000package javax.jnlp; public interface DownloadService { public boolean isResourceCached(java.net.URL ref, java.lang.String version); public boolean isPartCached(java.lang.String part); public boolean isPartCached(java.lang.String[] parts); public boolean isExtensionPartCached(java.net.URL ref, java.lang.String version, java.lang.String part); public boolean isExtensionPartCached(java.net.URL ref, java.lang.String version, java.lang.String[] parts); public void loadResource(java.net.URL ref, java.lang.String version, DownloadServiceListener progress) throws java.io.IOException; public void loadPart(java.lang.String part, DownloadServiceListener progress) throws java.io.IOException; public void loadPart(java.lang.String[] parts, DownloadServiceListener progress) throws java.io.IOException; public void loadExtensionPart(java.net.URL ref, java.lang.String version, java.lang.String part, DownloadServiceListener progress) throws java.io.IOException; public void loadExtensionPart(java.net.URL ref, java.lang.String version, java.lang.String[] parts, DownloadServiceListener progress) throws java.io.IOException; public void removeResource(java.net.URL ref, java.lang.String version) throws java.io.IOException; public void removePart(java.lang.String part) throws java.io.IOException; public void removePart(java.lang.String[] parts) throws java.io.IOException; public void removeExtensionPart(java.net.URL ref, java.lang.String version, java.lang.String part) throws java.io.IOException; public void removeExtensionPart(java.net.URL ref, java.lang.String version, java.lang.String[] parts) throws java.io.IOException; public DownloadServiceListener getDefaultProgressWindow(); } icedtea-web-1.6.2/netx/javax/jnlp/PaxHeaders.17941/ClipboardService.java0000644000000000000000000000013112654402377022561 xustar0030 mtime=1454507263.238432568 30 atime=1454507327.118580617 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/javax/jnlp/ClipboardService.java0000644000175000002070000000030512654402377023303 0ustar00jvanekmock00000000000000package javax.jnlp; public interface ClipboardService { public java.awt.datatransfer.Transferable getContents(); public void setContents(java.awt.datatransfer.Transferable contents); } icedtea-web-1.6.2/netx/javax/jnlp/PaxHeaders.17941/BasicService.java0000644000000000000000000000013012654402377021702 xustar0030 mtime=1454507263.238432568 29 atime=1454507327.11758063 29 ctime=1454507658.73615793 icedtea-web-1.6.2/netx/javax/jnlp/BasicService.java0000644000175000002070000000034212654402377022426 0ustar00jvanekmock00000000000000package javax.jnlp; public interface BasicService { public java.net.URL getCodeBase(); public boolean isOffline(); public boolean showDocument(java.net.URL url); public boolean isWebBrowserSupported(); } icedtea-web-1.6.2/netx/PaxHeaders.17941/javaws_splash.png0000644000000000000000000000013112654402377017775 xustar0030 mtime=1454507263.237432581 29 atime=1454507327.11758063 30 ctime=1454507658.735157944 icedtea-web-1.6.2/netx/javaws_splash.png0000644000175000002070000002755612654402377020540 0ustar00jvanekmock00000000000000PNG  IHDR{}/5IDATxw%Uq s "A%* ,(HTAq}`}.AdDrT2J$FC&0966=}֭[7O!N߮ݷϩsO@ {=@ {=b@ {=b@ {=b {=b{=b{=b@=b@=b@ b@ {b@ {b@ {=@ {=){=b{=b@=b@=b@ ۗ: =47 hqs#;}gtm`ƓOybm`={[bs!@@@^\=0emzpAơ'@ơ'@ơ'@ơ'@DMFBOIL{0p- =GjmFFvx'hW27ͭSb'h{{uϴh7z첫'{݈=?gI;wLwh1 |3?W]C/ { =B&z=:A1:ЋM^[i8+hlMW=:)^cώ{@)rc,%=:uOEn6m+hwi=s@1r z0C4X-Qɳأdf=&~S崭أd]>⨯us$Z8VnN$(^xQmuuأsrL4xԡ#.䈑7>Ug׭xhȫ<+jש=Zݸ]NWOHu]?L|bfSH^@{"ctdBю'@Sj?ޠoh+:j='C{ 1"ԺJcg$ۧ#N ==G[_ܻsK']qe!S~-5 =,z;s{ { ;-|-;ZË/(5=:) { {FĞأCO?:eʶڟ!{^7{tr艼e#O虾{b'h7N_tyzyXzbO!ޤ^UzQ[{b'&JuBj` C=Ğأ ߤ].yw{=GI{דO>)͊{=GdTOEg'hثz+먞{?C~Ğ+?{v[q/:a5 [mUԧ>o/|x8kzK&l+ OJ0[nL+' PK/^]'jcaҕWQ+ o0dǝ€ 6 }WY- ln J')}X8eJc?1?0k& z0`Msaছ!;^èo&0_dѢƼyI쉽,Y.첰ju[k3yct0¨cV!ci8Ȱ79U-bOüy¶n[hTQGUh|L^ĿgVo/8;Ԩ0gYտ~=,z睺^c{aׅO%9s愹@x'Grac-bo[ڛQ 6OFG Jvۭ7[&o?了WUMF?^?c$ӭ%i͵o(@K$QA ]w 'Oi?? ƍXg cӺeެ) 4V"rG&+_J(؋ɟ'+zJϧߜtI=_} +BEw{ũӘmV<.z%3.Un+T*Jw0l/^:a!M,mT/@kq'{c/PqK^}d 4us=7vaϳ\?^x0a„da}ݗk<,gzΝ6tӪ#j]] Y}._$J=v\[؛tU=?g[4ͷ N7R&E\uzoUVY +x>hox=_yƏo~=wqc,A_pGYgpg> q{'xW_b]SCy}1w"c/X86W( KrϚ==Wz8U R%oL_o\9_Fnlj X_LW.\0t嗯hP셰pdis#Dq1C57,B O?STGvxSajK=SO{bFYB/KWw߽-{q$.ײ;d>iq]3|ۣM8uYg ;sxo<5-"ⵅEb_Lގӽ{gL%'i{tCU{>Y[n\wGdZuito%M-7kj1pMKJv˳,"FbŋC6hʩ3:Mk3WVzk@쉽n꫗xO T|oVű7mڴ>)").{?{ 9Ӳ*q(r B?_m5hT2V⾀%#3v^gx>$ӳBK=l#^o1Өޗۗ?lo5X9䐊%aMiv1y{=k |i׿c5sLS/s̼aÔ{]],|RYϩZk-FudP.4[nmװaڽyĞkг WAva|k_}kF^.^fO[9[}QWͶHg6xAfbO =^^k;k<3Ӟ{YNtnA+cSuJO~zmd z(ӿ_}5>iM+ӹ aѢE> 7 ʈۑipk?W d guؤI:o}_qdcf:[.]YS]#<}2?_Gu>?^},\oMӾ/H;ۍ6(9 2t-|9[͞=GVYeLv}8#^OOoqœ\B?_{B!?LݚE{Yo}DԹ;37ߜ,8_֍:NeڞM=O&7wŕr=cQu=y{BV]aWptM5^s9wue:j6/>כR#|gyf.R9ZY؛[RgP;{|S;/93.X\{BhE晾E{3c 7 /?^?3MΣo߾y}sc_}>K3;=,XnYGjyӲѴIe#ytuȑ3'TBna7C{7L#Jqn% TvTc];O?]xꩧ=}%KŽ;(*K<qD% K\3ZB1W^ye>GE,ZM7!LY*^KWic=k ޴hWLV*C0O2%yy睙Ww-<9 h4dǝB1]ȯ}0)5ފs~Y.lqWzC~:)rb ^ c/*wd_hCM)Yg0o޼%d:~Gm.bsl6a…W^yL7~/&^B>ۿQZc}$KFkcTuKuWw裏N~'tbXثSiqkV=ƍ_zivqrꪫ_=4i\!v^ˇ_{6$n_o9s$ EYgboYo|<+f<?^+es_}5c;e=#<*[Zbƣyu}7vsTdYAGn/,1~z+U=l1cUา'?IXmʎf͚U~ӟf:LGuTxH76Ygvuײaq/ya-Hf J~&=∴)kf\=gJNOry#nLA\O|q4rĉ?q.uvjE Ə|_KҰlȜ)#8Es.$Yc3]dkw5׆mFb/Ӷ~G +xDXn/N1鉬'F`%f̘Xcb8]/WfZ}u'?U/G=,2%gGV[#"}H\2o^29„ .LBʫ|'~#~t*%έyC&5-YGЂ \r!LO]ZI'zB׮k+:dsdRqxV(V\xrw;sfN+NѰZ| qV/&~l$-ʷ墋.{ -NvᏛUZK{<..81% J*:W w.bQ/y= R_~y؋bosW56FƞV5g-b^z%7^Oj,[T^k1dȐ^-ŋ qCQ/6O!Z^)iwM7e\=٫?,Z,W7NG5'{4<\vec+J7\6^g^ TWFb_;h{{EHV Wn*J]h="-J_*-J_ۥ 4^>Yrьo#hػK{z+(Z}5n{4~!a"=*-.ݯebRiw-,{Ektgr >xlA5ػKzb}W+Fs|*|ӵ`k؋Gb/^b+qoܨ?~|]b >'@{ժ$+EHzZYhtބ |g.{gtO Z72^Q^gRY+Bո]o'G%fΜf͚^ث{fiOH"Fʕ:th6lX>|x1bDr925WboĉaҤIa1eʔ0u6mZ>}z1cFrF;'{Q3^wE^^U3gjWYi bhՎk-.h=3'TQ{4uyF@ Vik<bh VoFh=fy g@F@4u |\b hUz2g{@iH_],!'@OU\+=nel/{v@k!Lӂh+*-D=> 'x b@<@Qӣߚk?Wvo s b@y('n潂- ׹a13| =fǐw.(,4=i}g6 ?w@Q;@T)Q8ZG̈́ XFMb{=b@=b@ b@ b@ {b@ {b@ {=@ {=@ {=@ {=b@ {=b {=b {=b{=b{=b@=b@ b@ b@ {b@ {b@ {[g} IENDB`icedtea-web-1.6.2/PaxHeaders.17941/missing0000644000000000000000000000013112654402526015034 xustar0030 mtime=1454507350.358270676 30 atime=1454507513.048100929 29 ctime=1454507658.73315797 icedtea-web-1.6.2/missing0000755000175000002070000001533012654402526015565 0ustar00jvanekmock00000000000000#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2013-10-28.13; # UTC # Copyright (C) 1996-2014 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be 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 this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=http://www.perl.org/ flex_URL=http://flex.sourceforge.net/ gnu_software_URL=http://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: icedtea-web-1.6.2/PaxHeaders.17941/install-sh0000644000000000000000000000013112654402526015441 xustar0030 mtime=1454507350.357270689 30 atime=1454507350.357270689 29 ctime=1454507658.73315797 icedtea-web-1.6.2/install-sh0000755000175000002070000003452312654402526016177 0ustar00jvanekmock00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2013-12-25.23; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. tab=' ' nl=' ' IFS=" $tab$nl" # Set DOITPROG to "echo" to test this script. doit=${DOITPROG-} doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) is_target_a_directory=always dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done # We allow the use of options -d and -T together, by making -d # take the precedence; this is for compatibility with GNU install. if test -n "$dir_arg"; then if test -n "$dst_arg"; then echo "$0: target directory not allowed when installing a directory." >&2 exit 1 fi fi if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then if test $# -gt 1 || test "$is_target_a_directory" = always; then if test ! -d "$dst_arg"; then echo "$0: $dst_arg: Is not a directory." >&2 exit 1 fi fi fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac oIFS=$IFS IFS=/ set -f set fnord $dstdir shift set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: icedtea-web-1.6.2/PaxHeaders.17941/config.sub0000644000000000000000000000013212654402526015421 xustar0030 mtime=1454507350.356270702 30 atime=1454507513.119099982 30 ctime=1454507658.732157984 icedtea-web-1.6.2/config.sub0000755000175000002070000010624612654402526016160 0ustar00jvanekmock00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2015 Free Software Foundation, Inc. timestamp='2015-01-01' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be 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 this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze*) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 | or1k | or1knd | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | riscv32 | riscv64 \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | visium \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; leon|leon[3-9]) basic_machine=sparc-$basic_machine ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | visium-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; leon-*|leon[3-9]-*) basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze*) basic_machine=microblaze-xilinx ;; mingw64) basic_machine=x86_64-pc os=-mingw64 ;; mingw32) basic_machine=i686-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; moxiebox) basic_machine=moxie-unknown os=-moxiebox ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i686-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-* | ppc64p7-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos | rdos64) basic_machine=x86_64-pc os=-rdos ;; rdos32) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -bitrig* | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; c8051-*) os=-elf ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: icedtea-web-1.6.2/PaxHeaders.17941/config.guess0000644000000000000000000000013212654402526015756 xustar0030 mtime=1454507350.354270729 30 atime=1454507513.108100129 30 ctime=1454507658.731157997 icedtea-web-1.6.2/config.guess0000755000175000002070000012367212654402526016517 0ustar00jvanekmock00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2015 Free Software Foundation, Inc. timestamp='2015-01-01' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be 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 this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD # # Please send patches to . me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "${UNAME_SYSTEM}" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu eval $set_cc_for_build cat <<-EOF > $dummy.c #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #else LIBC=gnu #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` ;; esac # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/lslpp ] ; then IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW64*:*) echo ${UNAME_MACHINE}-pc-mingw64 exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; *:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="gnulibc1" ; fi echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arc:Linux:*:* | arceb:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-${LIBC} else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi else echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; openrisc*:Linux:*:*) echo or1k-unknown-linux-${LIBC} exit ;; or32:Linux:*:* | or1k*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) echo sparc-unknown-linux-${LIBC} exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-${LIBC} exit ;; ppc64le:Linux:*:*) echo powerpc64le-unknown-linux-${LIBC} exit ;; ppcle:Linux:*:*) echo powerpcle-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; x86_64:Haiku:*:*) echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown eval $set_cc_for_build if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi fi elif test "$UNAME_PROCESSOR" = i386 ; then # Avoid executing cc on OS X 10.9, as it ships with a stub # that puts up a graphical alert prompting to install # developer tools. Any system running Mac OS X 10.7 or # later (Darwin 11 and later) is required to have a 64-bit # processor. This is not true of the ARM version of Darwin # that Apple uses in portable devices. UNAME_PROCESSOR=x86_64 fi echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; esac cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: icedtea-web-1.6.2/PaxHeaders.17941/compile0000644000000000000000000000013112654402526015013 xustar0030 mtime=1454507350.353270743 30 atime=1454507350.353270743 29 ctime=1454507658.73015801 icedtea-web-1.6.2/compile0000755000175000002070000001624512654402526015552 0ustar00jvanekmock00000000000000#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2012-10-14.11; # UTC # Copyright (C) 1999-2014 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be 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 this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: icedtea-web-1.6.2/PaxHeaders.17941/README0000644000000000000000000000013012654402377014323 xustar0030 mtime=1454507263.232432648 29 atime=1454507327.11458067 29 ctime=1454507658.73015801 icedtea-web-1.6.2/README0000644000175000002070000001523512654402377015056 0ustar00jvanekmock00000000000000IcedTea-Web =========== The IcedTea-Web project provides a Free Software web browser plugin for running applets written in the Java programming language and an implementation of Java Web Start, originally based on the NetX project. Homepage (wiki): http://icedtea.classpath.org/wiki/IcedTea-Web Bugs (bugzilla): http://icedtea.classpath.org/bugzilla Mailing List: distro-pkg-dev@openjdk.java.net http://mail.openjdk.java.net/mailman/listinfo/distro-pkg-dev FAQ: http://icedtea.classpath.org/wiki/FrequentlyAskedQuestions Anonymous Mercurial checkout: hg clone http://icedtea.classpath.org/hg/icedtea-web NetX ==== NetX provides a drop-in replacement for javaws (Java Web Start). Since upstream NetX is dead, we forked the code into the netx/net/sourceforge/jnlp package, whole implementation is still in this package, NetX is kept referenced However, as icedtea-web has evolved to complex set of tools, extensions and tests, it has now only a few lines of code shared with the original implementation. IcedTea's NetX currently supports verification of signed jars, trusted certificate storing, system certificate store checking, and provides the services specified by the jnlp API. In addition it also provides: * full desktop integration * offline run * own appletviewer * many extended security features * own policy editor and much more. For full list read NEWS and Changelog The Browser Plugin ================== IcedTea-Web contains a Free Software browser plugin based on NPRuntime called NPPlugin. By default, this will be built, and it can be turned off using the -disable-plugin option. Building IcedTea-Web ==================== IcedTea-Web is built using the standard: $ ./autogen.sh (if building from Mercurial rather than a tarball) $ ./configure $ make $ make install incantation. The build requirements are as follows: * A bootstrap JDK. You can use any java JDK7 or higher compatible. * A C compiler (for the launchers). * libX11 * zlib-devel Additionally, the plugin requires: * A C++ compiler * npapi headers - depending on your distribution: firefox-devel or xulrunner-devel or NPAPI-SDK ... Some distributions do not provide correct NPAPI headers so you can use those: https://bitbucket.org/mgorny/npapi-sdk/downloads. The plugin can be disabled by passing --disable-plugin. The following optional dependencies enable additional features * rhino (enables support for using proxy auto config files evaluating javascript) * tagsoup (enables cleanup of not well formed JNLP files) * junit4 (enables unit tests) * jacoco (enables codecoverage) See ./configure --help if you need to override the defaults. Check IT_CHECK_FOR_JDK in acinclude.m4 to see the default search paths for JDKs. At present, some of these options fail due to sun.* classes required by IcedTea-Web. Most targets in IcedTea-Web create stamp files in the stamps directory to determine what and when dependencies were compiled. Each target has a corresponding clean-x target which removes the output and the stamp file, allowing it to be rebuilt. Build Modification Options ========================== The build process may be modified by passing the following options to configure: To configure jdk used for build and runtime, * --with-jdk-home and --with-jre-home are your best friends. If you are using jdk without jre, it may force you to use both those switches to point to same location. * --disable-docs: Don't build the Javadoc documentation. * --with-gcj: Compile ecj to native code with gcj prior to building. (deprecated) * --with-ecj: Specify the location of a 'ecj' binary. By default, the path is checked for ecj, ecj-3.1, ecj-3.2 and ecj-3.3. (deprecated) * --with-javac: Specify the location of a 'javac' binary. By default, the path is checked for javac. (deprecated) * --with-jar: Specify the location of a 'jar' binary. By default, the path is checked for gjar and jar. (deprecated) --with-ecj-jar: Specify the location of an ecj JAR file. (deprecated) Other options may be supplied which enable or disable new features. These are documented fully in the relevant section below. * --disable-plugin: Don't build the browser plugin. * --with-rhino: Specify the location of rhino jar * --with-tagsoup: Specify the location of the tagsoup jar * --with-jacoco: Specify the location of the jacoco jar Rhino and Tagsoup Support ========================= IcedTea-Web needs rhino for using Proxy Auto Config (PAC) files. If rhino is not found, or explicitly disabled, then support for PAC files will be disabled. If a rhino jar is not found, rhino support is disabled. The --with-rhino build option can be used to specify the location of the jar file. To explicitly disable rhino use --with-rhino=no. Tagsoup is used in similar way, and it is library used to fix malformed JNLP files. Check acinclude.m4 to see the default search paths. JUnit and Jacoco Support ======================== JUnit is needed for running some tests. It has no run-time impact. By default, the following paths are checked: - /usr/share/java/junit4.jar If JUnit is not found, JUnit support is disabled. The --with-junit option can be used to specify the location of the JUnit 4 jar. To disable JUnit support explicitly, use --with-junit=no. A custom JUnit ouput formatter is supplied. This makes the output of JUnit tests match the output of other tests. A simple 'Passed:' or 'FAILED:' is printed out, followed by .. This is also the format used by JTreg. Jacoco is used in similar way and can be used to measure code-coverage both for junit tests and for reproducer. For plugin a fake binary is created and used. Check acinclude.m4 and Makefile.am to see the default behavior. Testing ======= A set of automated tests is supplied for IcedTea-Web. They can be run by using 'make check' or "make run-netx-dist-tests" 'make check' runs a set of unit tests are that always supposed to pass. 'make run-next-dist-tets' runs the reproducer test suite which requires you to install IcedTea-Web first. (if you want to use it in your personal space, use --prefix to specify final path) The number and type of tests run by 'make check' may be affected by the build options, including JUnit support and rhino support. A test suite is supplied for the browser plugin. It can be built using 'make plugin-tests' and run by loading the HTML page specified into a browser with the plugin installed. See http://icedtea.classpath.org/wiki/Reproducers for more. For debugging, the environment variable ICEDTEAPLUGIN_DEBUG should be set to 'true'. It also starts the debug server on port 8787. If you set it to suspend java will wait for debugger to join before launching main class. You can set verbosity and logging levels via itweb-settings icedtea-web-1.6.2/PaxHeaders.17941/NEWS0000644000000000000000000000013112654402377014143 xustar0030 mtime=1454507263.231432661 29 atime=1454507327.11458067 30 ctime=1454507658.729158024 icedtea-web-1.6.2/NEWS0000644000175000002070000003543212654402377014676 0ustar00jvanekmock00000000000000Key: SX - http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=X PRX - http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=X RHX - https://bugzilla.redhat.com/show_bug.cgi?id=X DX - http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=X GX - http://bugs.gentoo.org/show_bug.cgi?id=X CVE-XXXX-YYYY: http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=XXXX-YYYY New in release 1.6.2 (2016-02-03): * 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 * PR2690 - Can't run BOM into JNLP file * PR2669 - remove bash-specific syntax from top level Makefile.am * PR2489 - various NPEs when codebase is null * NetX - main-class attribute trimmed by default - in strict mode, main-class attribute checked for invalid characters * Plugin - RH1273691 - Escaped equals signs in deployment.properties not un-escaped when used - PR2746 - IcedTea-Web Plugin 1.6.1: net.sourceforge.jnlp.LaunchException - PR2714 - IcedTea-Web plugin sends uninitialized memory garbage across a pipe when NPN_GetValueForURL call fails New in release 1.6.1 (2015-09-11): * 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 * comments in deployment.properties now should persists load/save * fixed bug in caching of files with query * fixed issues with recreating of existing shortcut * trustAll/trustNone now processed correctly * headless no longer shows dialogues * RH1231441 Unable to read the text of the buttons of the security dialogue * Fixed RH1233697 icedtea-web: applet origin spoofing * Fixed RH1233667 icedtea-web: unexpected permanent authorization of unsigned applets * fixed fatal impact of initialization error of FileLog * MissingALACAdialog made available also for unsigned applications (but ignoring actual manifest value) and fixed * NetX - fixed issues with -html shortcuts - fixed issue with -html receiving garbage in width and height * PolicyEditor - file flag made to work when used standalone - file flag and main argument cannot be used in combination New in release 1.6 (2015-04-29): * Massively improved offline abilities. Added Xoffline switch to force work without inet connection. * Improved to be able to run with any JDK * JDK 6 and older no longer supported * JDK 8 support added (URLPermission granted if applicable) * JDK 9 supported * Added support for Entry-Point manifest attribute * Added KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK deployment property to control scan of Manifest file * starting arguments now accept also -- abbreviations * Added new documentation * Added support for menu shortcuts - both javaws applications/applets and html applets are supported * added support for -html switch for javaws. Now you can run most of the applets without browser at all * Control Panel - PR1856: ControlPanel UI improvement for lower resolutions (800*600) * NetX - PR1858: Java Console accepts multi-byte encodings - PR1859: Java Console UI improvement for lower resolutions (800*600) - RH1091563: [abrt] icedtea-web-1.5-2.fc20: Uncaught exception java.lang.ClassCastException in method sun.applet.PluginAppletViewer$8.run() - Dropped support for long unmaintained -basedir argument - Returned support for -jnlp argument - RH1095311, PR574 - References class sun.misc.Ref removed in OpenJDK 9 - fixed, and so buildable on JDK9 * Plugin - PR1743 - Intermittant deadlock in PluginRequestProcessor - PR1298 - LiveConnect - problem setting array elements (applet variables) from JS - RH1121549: coverity defects - Resolves method overloading correctly with superclass heirarchy distance * PolicyEditor - codebases can be renamed in-place, copied, and pasted - codebase URLs can be copied to system clipboard - displays a progress dialog while opening or saving files - codebases without permissions assigned save to file anyway (and re-appear on next open) - PR1776: NullPointer on save-and-exit - PR1850: duplicate codebases when launching from security dialogs - Fixed bug where clicking "Cancel" on the "Save before Exiting" dialog could result in the editor exiting without saving changes - Keyboard accelerators and mnemonics greatly improved - "File - New" allows editing a new policy without first selecting the file to save to * Common - PR1769: support signed applets which specify Sandbox permissions in their manifests * Temporary Permissions in security dialog now multi-selectable and based on PolicyEditor permissions New in release 1.5 (2014-XX-XX): * IcedTea-Web now using tagsoup as default (tagsoup dependence) sanitizer for input * JDK older then 1.5 no longer supported * IcedTea-Web is now following XDG .config and .cache specification(RH947647) * A console for debugging plugin and javaws * Dialogs center on screen before becoming visible * Support for u45 and u51 new manifest attributes (Application-Name, Codebase, Permissions, Trusted-only) * Custom applet permission policies panel in itweb-settings control panel * javaws -version flag * New PolicyEditor for easily adding/removing permissions to individual applets * Cache Viewer - Can be closed by ESC key - Enabling and disabling of operational buttons is handled properly - Time consuming operations are indicated by a mouse busy cursor - "Size" and "Last Modified" columns display localized data * NetX - PR1465 - java.io.FileNotFoundException while trying to download a JAR file - Netx can now parse malformed jnlp files using tagsoup - PR1026 - Apps fail to run because of the nanoxml parser's strict XML validation - PR1473 - javaws should not depend on name of local file - Redesigned About dialogue layout and contents - Console made aware of plugin messages - PR1856: ControlPanel UI improvement for lower resolutions (800*600) - PR1858: Java Console accepts multi-byte encodings - PR1859: Java Console UI improvement for lower resolutions (800*600) * Plugin - PR854: Resizing an applet several times causes 100% CPU load - PR1271: icedtea-web does not handle 'javascript:'-protocol URLs - RH976833: Multiple applets on one page cause deadlock - Pipes moved into XDG_RUNTIME_DIR - Added debug to file - RH1010958: insecure temporary file use flaw in LiveConnect implementation - Resolves method overloading correctly with superclass heirarchy distance * Common - PR1474: Can't get javaws to use SOCKS proxy - Man page for itweb-settings * Security Updates - CVE-2012-4540, RH869040: Heap-based buffer overflow after triggering event attached to applet New in release 1.4 (2013-XX-XX): * Added cs localization * Added de localization * Added pl localization * Splash screen for javaws and plugin * Better error reporting for plugin via Error-splash-screen * All IcedTea-Web dialogues are centered to middle of active screen * Download indicator made compact for more then one jar * User can select its own JVM via itw-settings and deploy.properties. * Added extended applets security settings and dialogue * Security updates - CVE-2013-1926, RH916774: Class-loader incorrectly shared for applets with same relative-path. - CVE-2013-1927, RH884705: fixed gifar vulnerabilit - CVE-2012-3422, RH840592: Potential read from an uninitialized memory location - CVE-2012-3423, RH841345: Incorrect handling of not 0-terminated strings * NetX - PR1027: DownloadService is not supported by IcedTea-Web - PR725: JNLP applications will prompt for creating desktop shortcuts every time they are run - PR1292: Javaws does not resolve versioned jar names with periods correctly * Plugin - PR1106: Buffer overflow in plugin table- - PR1166: Embedded JNLP File is not supported in applet tag - PR1217: Add command line arguments for plugins - PR1189: Icedtea-plugin requires code attribute when using jnlp_href - PR1198: JSObject is not passed to javascript correctly - PR1260: IcedTea-Web should not rely on GTK - PR1157: Applets can hang browser after fatal exception - PR580: http://www.horaoficial.cl/ loads improperly * Common - PR1049: Extension jnlp's signed jar with the content of only META-INF/* is considered - PR955: regression: SweetHome3D fails to run - PR1145: IcedTea-Web can cause ClassCircularityError - PR1161: X509VariableTrustManager does not work correctly with OpenJDK7 - PR822: Applets fail to load if jars have different signers - PR1186: System.getProperty("deployment.user.security.trusted.cacerts") is null - PR909: The Java applet at http://de.gosupermodel.com/games/wardrobegame.jsp fails - PR1299: WebStart doesn't read socket proxy settings from firefox correctly New in release 1.3 (2012-XX-XX): * NetX - PR898: signed applications with big jnlp-file doesn't start (webstart affect like "frozen") - PR811: javaws is not handling urls with spaces (and other characters needing encoding) correctly * Plugin - PR820: IcedTea-Web 1.1.3 crashing Firefox when loading Citrix XenApp - PR863: Error passing strings to applet methods in Chromium - PR895: IcedTea-Web searches for missing classes on each loadClass or findClass - PR861: Allow loading from non codebase hosts. Allow code to connect to hosting server - PR518: NPString.utf8characters not guaranteed to be nul-terminated - PR722: META-INF/ unsigned entries should be ignored in signing - PR855: AppletStub getDocumentBase() doesn't return full URL - PR1011: Folders treated as jar files in archive tag - PR588: Cookies not written from cookie jar to browser cookies - PR920: Classes attempted to load twice when class extends from outside jar * Common - PR918: java applet windows uses a low resulution black/white icon - RH838417: Disambiguate signed applet security prompt from certificate warning - RH838559: Disambiguate signed applet security prompt from certificate warning - RH720836: project can be compiled against GTK+ 2 or 3 librarie New in release 1.2 (2011-XX-XX): * Security updates: - RH718164, CVE-2011-2513: Home directory path disclosure to untrusted applications - RH718170, CVE-2011-2514: Java Web Start security warning dialog manipulation - RH742515, CVE-2011-3377: IcedTea-Web: second-level domain subdomains and suffix domain SOP bypass * NetX - PR618: Can't install OpenDJ, JavaWebStart fails with Input stream is null error - PR765: JNLP file with all resource jars marked as 'lazy' fails to validate signature and stops the launch of application - PR788: Elluminate Live! is not working - PR804: javaws launcher incorrectly handles file names with spaces * Plugin - PR749: sun.applet.PluginStreamHandler#handleMessage(String) really slow - PR782: Support building against npapi-sdk as well - PR838: IcedTea plugin crashes with chrome browser when javascript is executed - PR852: Classloader not being flushed after last applet from a site is closed - RH586194: Unable to connect to connect with Juniper VPN client - RH718693: MindTerm SSH Applet doesn't work Common - PR768: Signed applets/Web Start apps don't work with OpenJDK7 and up - PR771: IcedTea-Web certificate verification code does not use the right API - PR742: IcedTea-Web checks certs only upto 1 level deep before declaring them untrusted. - PR769: IcedTea-Web does not work with some ssl sites with OpenJDK7 - PR778: Jar download and server certificate verification deadlock - PR789: typo in jrunscript.sh - PR794: IcedTea-Web does not work if a Web Start app jar has a Class-Path element in the manifest - PR808: javaws is unable to start, when missing jars are enumerated before main jar - RH734081: Javaws cannot use proxy settings from Firefox - RH738814: Access denied at ssl handshake - Support for authenticating using client certificates New in release 1.1 (2011-XX-XX): * Security updates - S6983554, CVE-2010-4450: Launcher incorrect processing of empty library path entries - RH677332, CVE-2011-0706: IcedTea multiple signers privilege escalation * New Features - IcedTea-Web now installs to a FHS-compliant location - IcedTea-Web can now handle Proxy Auto Config files - Binary launchers replaced with simple shell scripts - Can now use codebase_lookup=false with applets. * Common Fixes and Improvements - PR497: Mercurial revision detection not very reliable - PR638: JNLPClassLoader.loadClass(String name) can return null - RH677772: NoSuchAlgorithmException using SSL/TLS in javaws - PR724: Possible NullPointerException in JNLPClassLoader.getClassPathsFromManifest * NetX - Use Firefox's proxy settings if possible - The user's default browser (determined from xdg-open or $BROWSER) is used - RH669942: javaws fails to download version/packed files (missing support for jnlp.packEnabled and jnlp.versionEnabled) - PR464: plugin can now load parameters from jnlp files. - PR658: now jnlp.packEnabled works with applets. - PR726: closing javaws -about no longer throws exceptions. - PR727: cache now properly removes files. * Plugin - PR475, RH604061: Allow applets from the same page to use the same classloader - PR612: NetDania application ends on java.security.AccessControlException: access denied (java.util.PropertyPermission browser read) - PR664: Sound doesn't play on runescape.com. - PR721: IcedTeaPlugin.so cannot run g_main_context_iteration on a different thread unless a different GMainContext *context is used - PR735: Firefox 4 sometimes freezes if the applet calls showDocument() New in release 1.0 (2010-XX-XX): * Initial release of IcedTea-Web * Security updates - RH645843, CVE-2010-3860: IcedTea System property information leak via public static - RH672262, CVE-2011-0025: IcedTea jarfile signature verification bypass * Plugin - PR542: Plugin fails with NPE on http://www.openprocessing.org/visuals/iframe.php?visualID=2615 - PR552: Support for FreeBSD's pthread implementation - PR554: System.err writes content two times - PR556: Applet initialization code is prone to race conditions - PR557: Applet opens in a separate window if tab is closed when the applet loads - PR565: UIDefaults.getUI fails with jgoodies:looks 2.3.1 - PR593: Increment of invalidated iterator in IcedTeaPluginUtils (patch from barbara.xxx1975@libero.it) - PR597: Entities are parsed incorrectly in PARAM tag in applet plugin - PR619: Improper finalization by the plugin can crash the browser - Applets are now double-buffered to eliminate flicker in ones that do heavy drawing - RH665104: OpenJDK Firefox Java plugin loses a cookie * NetX - Add a new option -Xclearcache - Interfaces javax.jnlp.IntegrationService and javax.jnlp.DownloadService2 are now available - PR592: NetX can create invalid desktop entry files - RH663680, CVE-2010-4351: IcedTea JNLP SecurityManager bypass * Control Panel - Modifications to deployments.properties file can now be done through a GUI icedtea-web-1.6.2/PaxHeaders.17941/INSTALL0000644000000000000000000000013212654402377014476 xustar0030 mtime=1454507263.227432714 30 atime=1454507327.113580684 30 ctime=1454507658.728158037 icedtea-web-1.6.2/INSTALL0000644000175000002070000003633212654402377015230 0ustar00jvanekmock00000000000000Installation Instructions ************************* Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without warranty of any kind. Basic Installation ================== Briefly, the shell commands `./configure; make; make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the `README' file for instructions specific to this package. Some packages provide this `INSTALL' file but do not implement all of the features documented below. The lack of an optional feature in a given package is not necessarily a bug. More recommendations for GNU packages can be found in *note Makefile Conventions: (standards)Makefile Conventions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. Running `configure' might take a while. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package, generally using the just-built uninstalled binaries. 4. Type `make install' to install the programs and any data files and documentation. When installing into a prefix owned by root, it is recommended that the package be configured and built as a regular user, and only the `make install' phase executed with root privileges. 5. Optionally, type `make installcheck' to repeat any self-tests, but this time using the binaries in their final installed location. This target does not install anything. Running this target as a regular user, particularly if the prior `make install' required root privileges, verifies that the installation completed correctly. 6. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. 7. Often, you can also type `make uninstall' to remove the installed files again. In practice, not all packages have tested that uninstallation works correctly, even though it is required by the GNU Coding Standards. 8. Some packages, particularly those that use Automake, provide `make distcheck', which can by used by developers to test that all other targets like `make install' and `make uninstall' work correctly. This target is generally not run by end users. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you can use GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. This is known as a "VPATH" build. With a non-GNU `make', it is safer to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. On MacOS X 10.5 and later systems, you can create libraries and executables that work on multiple system types--known as "fat" or "universal" binaries--by specifying multiple `-arch' options to the compiler but only a single `-arch' option to the preprocessor. Like this: ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CPP="gcc -E" CXXCPP="g++ -E" This is not guaranteed to produce working output in all cases, you may have to build one architecture at a time and combine the results using the `lipo' tool if you have problems. Installation Names ================== By default, `make install' installs the package's commands under `/usr/local/bin', include files under `/usr/local/include', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PREFIX', where PREFIX must be an absolute file name. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option `--exec-prefix=PREFIX' to `configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=DIR' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. In general, the default for these options is expressed in terms of `${prefix}', so that specifying just `--prefix' will affect all of the other directory specifications that were not explicitly provided. The most portable way to affect installation locations is to pass the correct locations to `configure'; however, many packages provide one or both of the following shortcuts of passing variable assignments to the `make install' command line to change installation locations without having to reconfigure or recompile. The first method involves providing an override variable for each affected directory. For example, `make install prefix=/alternate/directory' will choose an alternate location for all directory configuration variables that were expressed in terms of `${prefix}'. Any directories that were specified during `configure', but not in terms of `${prefix}', must each be overridden at install time for the entire installation to be relocated. The approach of makefile variable overrides for each directory variable is required by the GNU Coding Standards, and ideally causes no recompilation. However, some platforms have known limitations with the semantics of shared libraries that end up requiring recompilation when using this method, particularly noticeable in packages that use GNU Libtool. The second method involves providing the `DESTDIR' variable. For example, `make install DESTDIR=/alternate/directory' will prepend `/alternate/directory' before all installation names. The approach of `DESTDIR' overrides is not required by the GNU Coding Standards, and does not work on platforms that have drive letters. On the other hand, it does better at avoiding recompilation issues, and works well even when some directory options were not specified in terms of `${prefix}' at `configure' time. Optional Features ================= If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Some packages offer the ability to configure how verbose the execution of `make' will be. For these packages, running `./configure --enable-silent-rules' sets the default to minimal output, which can be overridden with `make V=1'; while running `./configure --disable-silent-rules' sets the default to verbose, which can be overridden with `make V=0'. Particular systems ================== On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC is not installed, it is recommended to use the following options in order to use an ANSI C compiler: ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" and if that doesn't work, install pre-built binaries of GCC for HP-UX. On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its `' header file. The option `-nodtk' can be used as a workaround. If GNU CC is not installed, it is therefore recommended to try ./configure CC="cc" and if that doesn't work, try ./configure CC="cc -nodtk" On Solaris, don't put `/usr/ucb' early in your `PATH'. This directory contains several dysfunctional programs; working variants of these programs are available in `/usr/bin'. So, if you need `/usr/ucb' in your `PATH', put it _after_ `/usr/bin'. On Haiku, software installed for all users goes in `/boot/common', not `/usr/local'. It is recommended to use the following options: ./configure --prefix=/boot/common Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option `--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified `gcc' to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for `CONFIG_SHELL' due to an Autoconf bug. Until the bug is fixed you can use this workaround: CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of all of the options to `configure', and exit. `--help=short' `--help=recursive' Print a summary of the options unique to this package's `configure', and exit. The `short' variant lists options used only in the top level, while the `recursive' variant lists options also present in any nested packages. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--prefix=DIR' Use DIR as the installation prefix. *note Installation Names:: for more details, including other options available for fine-tuning the installation locations. `--no-create' `-n' Run the configure checks, but stop before creating any output files. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. icedtea-web-1.6.2/PaxHeaders.17941/ChangeLog0000644000000000000000000000013112654402377015216 xustar0030 mtime=1454507263.227432714 30 atime=1454507327.112580697 29 ctime=1454507658.72715805 icedtea-web-1.6.2/ChangeLog0000644000175000002070000273624412654402377015764 0ustar00jvanekmock000000000000002016-02-02 Jiri Vanek Pre-release tuning * Makefile.am: (netx-html-gen.stamp) set number of changests to 33 (since 1.6.1) * NEWS: date of 1.6.2 set * configure.ac: (AC_INIT) set to use 1.6.2 2016-02-02 Jiri Vanek maven artifacts version substituted to contains only major version * .Makefile: ($(abs_top_builddir)/metadata) version stripped by everything behind second number 2016-01-28 Matthias Klose Jiri Vanek * Makefile: (stamps/generate-docs.stamp) added quotes around HTML_DOCS_INDEX 2016-01-26 Jiri Vanek Messages for Invalid JDK dialog improved a bit. * netx/net/sourceforge/jnlp/resources/Messages.properties: * netx/net/sourceforge/jnlp/resources/Messages_cs.properties: * netx/net/sourceforge/jnlp/resources/Messages_de.properties: * netx/net/sourceforge/jnlp/resources/Messages_pl.properties: 2016-01-26 Jiri Vanek Revisited some jnlp_href tests. * tests/reproducers/signed/ClasspathManifestTest/testcases/ClasspathManifestTest.java: explained why localtests on "." are passing (removed KnownToFail) and added (correctly failing) tests in various dirs * tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/testcases/CodeBaseManifestEntrySignedMatching.java: used diamond * tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/testcases/CodeBaseManifestEntrySignedNotMatching.java: same * tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/testcases/CodeBaseManifestEntryUnsignedMatching.java: same * tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/testcases/CodeBaseManifestEntryUnsignedNotMatching.java: same * tests/reproducers/simple/SingleInstanceServiceTest/testcases/SingleInstanceTest.java: fixed midori incompatible tests 2016-01-25 Jiri Vanek Fixed various cosmetic NPEs when codebase is null (+tests) * NEWS: mentioned PR2489 * netx/net/sourceforge/jnlp/JNLPFile.java: added method getNotNullProbalbeCodeBase workaround cases when codebase is null (for various output reasons) * netx/net/sourceforge/jnlp/PluginBridge.java: using getNotNullProbalbeCodeBase when fixing codebase during generation of jnlp stub. * netx/net/sourceforge/jnlp/SecurityDesc.java: same for generating uri for policies record * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: (manageExternalJars) same for ref string comparsion * netx/net/sourceforge/jnlp/security/SecurityDialog.java: same for visible form of codebase * netx/net/sourceforge/jnlp/security/SecurityDialogs.java: same * netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletTrustConfirmation.java: same * netx/net/sourceforge/jnlp/security/dialogs/TemporaryPermissionsButton.java: same * netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/PartiallySignedAppTrustWarningPanel.java: same * netx/net/sourceforge/jnlp/util/UrlUtils.java: (normalizeUrlAndStripParams) and (removeFileName) when input is null, return null. * tests/junit-runner/JunitLikeXmlOutputListener.java: now supports hg commits * tests/reproducers/signed/CodebasesAttsSigned/srcs/CodebasesAttsSigned.java: test printing "hardocded" id and paramet to know jar and calling jnlp/html source * tests/reproducers/signed/CodebasesAttsSigned/resources/CodebasesAttsSigned.html.in: resouirce capable of substitue id param, codebase, jar and htmlHref * tests/reproducers/signed/CodebasesAttsSigned/resources/CodebasesAttsSignedApp.jnlp.in: same * tests/reproducers/signed/CodebasesAttsSigned/resources/CodebasesAttsSignedApplet.jnlp.in: same * tests/reproducers/signed/CodebasesAttsSigned/resources/CodebasesAttsSignedJnlpHref.html.in: same * tests/reproducers/signed/CodebasesAttsSigned/testcases/CodebasesAttsSignedDialogsTest1.java: Test testing various dialogues of signed app. Including tests for corrupted signature * tests/reproducers/simple/CodebasesAtts/srcs/CodebasesAtts.java: same as CodebasesAttsSigned but not signed * tests/reproducers/simple/CodebasesAtts/resources/CodebasesAtts.html.in: same as signed ones * tests/reproducers/simple/CodebasesAtts/resources/CodebasesAttsApp.jnlp.in: same * tests/reproducers/simple/CodebasesAtts/resources/CodebasesAttsApplet.jnlp.in: same * tests/reproducers/simple/CodebasesAtts/resources/CodebasesAttsJnlpHref.html.in: same * tests/reproducers/simple/CodebasesAtts/testcases/CodebasesAttsDialogsTest1.java: same * tests/reproducers/simple/CodebasesAtts/testcases/CodebasesAttsNoDialogsTest1.java: * tests/reproducers/simple/CodebasesAtts/testcases/CodebasesAttsNoDialogsTest2.java: * tests/reproducers/simple/CodebasesAtts/testcases/CodebasesAttsNoDialogsTest3.java: Again tests for various substituted values * tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java: added stubs to create independent instance upon tmp folder and execute browser upon url. * tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/firefox/FirefoxProfilesOperator.java: (copyFile) moved to autocloseable * tests/test-extensions/net/sourceforge/jnlp/closinglisteners/AutoErrorClosingListener.java: fixed to not to close on rhino exception * tests/test-extensions/net/sourceforge/jnlp/closinglisteners/StringBasedClosingListener.java: condition made protected 2016-01-19 Jiri Vanek When tagsoup is missing, parsing errors are more informative * acinclude.m4: when building without tagsoup, more verbose warning is printed * netx/net/sourceforge/jnlp/GuiLaunchHandler.java: (launchError) is now noting that BasicExceptionDialog will be shown. * netx/net/sourceforge/jnlp/MalformedXMLParser.java: Now react on NoClassDefFoundError by returning original stream. * netx/net/sourceforge/jnlp/ParseException.java: Stores information about parsers loading, and add this info to ParseException message. * netx/net/sourceforge/jnlp/Parser.java: (getRootNode) logic retrieving parser class extracted to separate method getParserInstance * netx/net/sourceforge/jnlp/resources/Messages.properties: added family of TAGSOUP for messages about its state * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java: (exit) now waits for BasicExceptionDialog. * netx/net/sourceforge/jnlp/runtime/html/AppletExtractor.java: (cleanStreamIfPossible) now uses Parser.getParserInstance ratehr then its own. * netx/net/sourceforge/jnlp/util/BasicExceptionDialog.java: Is now capable of publishing number of shown instances. 2016-01-14 Jiri Vanek Fridrich Strba Adapted to change in package of HexDumpEncoder (1.8 sun.misc.HexDumpEncoder, 1.9 sun.security.util.HexDumpEncoder) * acinclude.m4: added new macro IT_CHECK_FOR_HEXDUMPENCODER, which tries both locations of HexDumpEncoder * configure.ac: now uses IT_CHECK_FOR_HEXDUMPENCODER instead of IT_CHECK_FOR_CLASS(SUN_MISC_HEXDUMPENCODER, [sun.misc.HexDumpEncoder]) * netx/net/sourceforge/jnlp/security/dialogs/CertsInfoPane.java: added imports to both import sun.misc.*; and import sun.security.util.*; 2016-01-14 Jiri Vanek Added GenericName to desktop files * itweb-settings.desktop.in: * javaws.desktop.in: * policyeditor.desktop.in: 2016-01-14 Jiri Vanek Included maven artifacts and appstream metadata * .Makefile: (clean-local) and (.PHONY) now depends on clean-metadata. ($(abs_top_builddir)/metadata) new target, copy metadata-in to metadata and replace name, vendor and version check-meatdata, new stand alone target, checks correctness of poms and xmls in metadata folder. (stamps/netx-dist.stamp) now depends on $(abs_top_builddir)/metadata. clean-metadata, new target, removes built metadata folder * metadata.in/icedtea-web-javaws.appdata.xml: appstream metadata for javaws * metadata.in/icedtea-web.metainfo.xml: appstream metadata for plugin * metadata.in/icedtea-web-plugin.pom: pom for plugin.jar * metadata.in/icedtea-web.pom: pom for netx jar 2016-01-14 Jiri Vanek Vendor desktop entry replaced by X-Vendor * ChangeLog: fixed date * netx/net/sourceforge/jnlp/util/XDesktopEntry.java: if vendor is present in jnlp instead of Vendor X-Vendor entry is generated to desktop file 2016-01-14 Jiri Vanek Added reprodcuer for NoClassDeffFoundError behavior * tests/reproducers/custom/NoClassDeff/srcs/NoClassDeff.java: small app including inner class, which is missing in deployed jar. Then calling this class on demand * tests/reproducers/custom/NoClassDeff/srcs/.Makefile: responsible for removing the compiled inner class before jarring * tests/reproducers/custom/NoClassDeff/testcases/NoClassDeffTest.java: testing behavior when ClassNotFound/NoClassDefFound is thrown in various stages * tests/reproducers/custom/NoClassDeff/resources/NoClassDeff.html.in: * tests/reproducers/custom/NoClassDeff/resources/NoClassDeffApp.jnlp.in: * tests/reproducers/custom/NoClassDeff/resources/NoClassDeffApplet.jnlp.in: * tests/reproducers/custom/NoClassDeff/resources/NoClassDeffJnlpHref.html.in: templates to launch app with instruction when to call LostClass and how to deal with it 2016-01-07 David Cantrell Jiri Vanek Andrew John Hughes Remove bash-specifics from top level Makefile.a * Makefile.am: (generate-docs.stamp) double == in test function replaced by single = (stamps/netx-html-gen.stamp) call to plain bash replaced by ${SHELL} * NEWS: mentioned PR2669 2016-01-07 Tiago Stürmer Daitx Jiri Vanek Resolves an issue where, if IcedTea's call to NPN_GetValueForURL fails, IcedTea-Web attempts to send uninitialized memory garbage across a pipe, which (usually) results in an error. At this point, IcedTea gives up, but does not inform Firefox that it has done so, and unless dom.ipc.plugins.asyncInit is true, this causes Firefox's UI to lock up in addition to the Java component failing to load. * plugin/icedteanp/IcedTeaNPPlugin.cc: (onsume_plugin_message) initialize len and proxy_info. (get_proxy_info) returns correct message if browser_functions.getvalueforurl returns error * NEWS: mentioned PR2714 2016-01-07 Jiri Vanek Codebase resolution of jnlp-href is now aligned with oracle plugin * netx/net/sourceforge/jnlp/PluginBridge.java: When jnlp href is used, codebase is forced to become codebase of jnlp * netx/net/sourceforge/jnlp/SecurityDesc.java: When file.getCodeBase() is null then instead of NPE, codebase of file.fileLocation is used * netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletTrustConfirmation.java: stripFile and ensureSlashTail moved to UrlUtils * netx/net/sourceforge/jnlp/util/UrlUtils.java: stripFile and ensureSlashTail moved from UnsignedAppletTrustConfirmation * tests/netx/unit/net/sourceforge/jnlp/PluginBridgeTest.java: removed empty lines * tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletTrustConfirmationTest.java: adapted to moved methods * tests/netx/unit/net/sourceforge/jnlp/util/UrlUtilsTest.java: added more tests to removeFileName and enabled accidentlay disabled getHostAndPortTest and getPortTest * tests/netx/unit/net/sourceforge/jnlp/runtime/CodeBaseClassLoaderTest.java: ensured manifest attributes are off for this test * tests/netx/unit/net/sourceforge/jnlp/ParserMalformedXml.java: fixed bom tests to use proper classloader 2016-01-07 Jiri Vanek BOM character now dont cause error * netx/net/sourceforge/nanoxml/XMLElement.java: duplicated whitespace recognition code moved to isRegularWhiteSpace. First call to scanWhitespace repalced by call to scanLeadingWhitespace. New field BOM introduced. (scanWhitespace) made private, and uses isRegularWhiteSpace. (scanLeadingWhitespace) new method, same as scanWhitespacebut also skipps BOM and marks it. * tests/netx/unit/net/sourceforge/jnlp/ParserMalformedXml.java: Added tests to issue * tests/netx/unit/net/sourceforge/jnlp/templates/EFBBBF.jnlp: new file. jnlp file starting with bom. * NEWS: mentioned PR2690 2016-01-06 James Le Cuirot Fixed typo in javadoc generation * Makefile.am: (stamps/netx-docs.stamp) ( _OPTS)->(JAVADOC_OPTS) 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 * 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 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 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 * plugin/icedteanp/IcedTeaParseProperties.cc: (get_property_value) now unescape known escape sequences by calling IcedTeaPluginUtilities::unescape * plugin/icedteanp/IcedTeaPluginUtils.cc: implemented (unescape) which unescape known properties escape sequences * plugin/icedteanp/IcedTeaPluginUtils.h: declared (unescape) * tests/cpp-unit-tests/IcedTeaParsePropertiesTest.cc: ((get_property_value)) added testcase which verifies unnescape of escaped sequences from get_property_value * tests/cpp-unit-tests/IcedTeaPluginUtilsTest.cc: added family of (unescape) tests * /tests/reproducers/signed/CheckPluginParams: reproducer to verify if params from -D in deployment.plugin.jvm.arguments get correctly unescaped during its way up to users program. 2015-11-26 Jiri Vanek Main-class attribute get trimmed by default * netx/net/sourceforge/jnlp/Parser.java: declared MAINCLASS to keep main-class constant, declared anyWhiteSpace regex to determine whitespaces. All possible fields made final, hardcoded main-class replaced bu constant. New method getOptionalMainClass wrapper around getMainClass but consuming exception. getMainClass, new method reading MAINCLASS from node and handling it. cleanMainClassAttribute, new method trim value and do checks to die or warn if necessary. * tests/netx/unit/net/sourceforge/jnlp/ParserTest.java: added tests for top level behavior on various spaced main-classes. Now extends NoStdOutErrTest * NEWS: mentioned main-class handling change 2015-11-12 Jiri Vanek Added parser to read ico images * netx/net/sourceforge/jnlp/controlpanel/desktopintegrationeditor/JListUtils.java: When reading images, also ico is attempted to parse. * netx/net/sourceforge/jnlp/tools/ico/impl/IcoException.java: new class, exception for special cases in ico parsing * netx/net/sourceforge/jnlp/tools/ico/impl/IcoHeader.java: new class, parser and holder of parsed information of header of ico file * netx/net/sourceforge/jnlp/tools/ico/impl/IcoHeaderEntry.java: new class, parser and holder of parsed information of headers of individual images stored in header of ico file * netx/net/sourceforge/jnlp/tools/ico/impl/ImageInputStreamIco.java: parser of icon files from ImageInputStream 2015-11-12 Jiri Vanek Added desktop integration dialog * netx/net/sourceforge/jnlp/controlpanel/DesktopShortcutPanel.java: added linux-only button to sow FreeDesktopIntegrationEditorFrame * netx/net/sourceforge/jnlp/controlpanel/desktopintegrationeditor/Blinker.java: new class, blink colors on selected component * netx/net/sourceforge/jnlp/controlpanel/desktopintegrationeditor/FreeDesktopIntegrationEditorFrame.java: new class, window to allow managing generated icons, jnlpfiles and shortcuts * netx/net/sourceforge/jnlp/controlpanel/desktopintegrationeditor/JListUtils.java: new class, provides models, extensions, renderers and listeners for FreeDesktopIntegrationEditorFrame * netx/net/sourceforge/jnlp/controlpanel/desktopintegrationeditor/Panels.java: new class, provides various encapsulated parts of FreeDesktopIntegrationEditorFrame * netx/net/sourceforge/jnlp/controlpanel/desktopintegrationeditor/PreviewSelectionJTextPane.java: new class, impelmetation of preview for FreeDesktopIntegrationEditorFrame * netx/net/sourceforge/jnlp/resources/Messages.properties: added Control Panel - desktop integration manager DIM family * netx/net/sourceforge/jnlp/security/dialogs/SecurityDialogPanel.java: htmlWrap made public * netx/net/sourceforge/jnlp/util/XDesktopEntry.java: findFreedesktopOrgDesktopPathCatch made public * netx/net/sourceforge/jnlp/util/logging/ConsoleOutputPaneModel.java: replacing of chars by html entities extracted to new method escapeHtmlForJTextPane * tests/netx/unit/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/AppTrustWarningPanelTest.java: htmlwrap moved to use SecurityDialogPanel's implementation 2015-11-12 Jiri Vanek fixed build and runtime with jdk9 * netx/net/sourceforge/jnlp/NetxPanel.java: (init) setting doInit to true replaced by call to setDoInitIfExists * netx/sun/applet/AppletViewerPanelAccess.java: added new function of (setDoInitIfExists) which sets doInit if exists 2015-10-27 Jiri Vanek itweb-settings, debugging panel made aware about legacy log and client apps log * netx/net/sourceforge/jnlp/controlpanel/DebuggingPanel.java: added checboxes for KEY_ENABLE_APPLICATION_LOGGING_TOFILE and KEY_ENABLE_LEGACY_LOGBASEDFILELOG Cusotm config directory place was a bit repacked to be more compact and more useful. * netx/net/sourceforge/jnlp/resources/Messages.properties: added labels and tooltips for new checkboxes 2015-10-27 Jiri Vanek Added and by default disabled logging to files for client applications. * netx/net/sourceforge/jnlp/config/Defaults.java: KEY_ENABLE_APPLICATION_LOGGING_TOFILE added and set by default to false * netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java: declared KEY_ENABLE_APPLICATION_LOGGING_TOFILE * netx/net/sourceforge/jnlp/util/logging/FileLog.java: next to createFileLog can now does also createAppFileLog * netx/net/sourceforge/jnlp/util/logging/LogConfig.java: made aware of KEY_ENABLE_APPLICATION_LOGGING_TOFILE * netx/net/sourceforge/jnlp/util/logging/OutputController.java: if logging to file is enabled and logging to file for client applications is enabled then output of client app is sent also to special file. Added new singleton of AppFileLogHolder to keep instance of file log for client app. proceedHeader extracted as separate method to be reused. 2015-10-15 Jiri Vanek Added to enable and write logs directly to file without java.util.logging * netx/net/sourceforge/jnlp/config/Defaults.java: (defaults) added new key KEY_ENABLE_LEGACY_LOGBASEDFILELOG, by default true * netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java: defined KEY_ENABLE_LEGACY_LOGBASEDFILELOG for deployment.log.file.legacylog * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java: (exit) catch new exception * netx/net/sourceforge/jnlp/util/logging/FileLog.java: removed all logic. Now serve onl as factory provider of FileLog implementation * netx/net/sourceforge/jnlp/util/logging/LogConfig.java: fixed indentation, made aware about LOGBASEDFILELOG * netx/net/sourceforge/jnlp/util/logging/OutputController.java: adapted to autocloseable SingleStreamLogger * netx/net/sourceforge/jnlp/util/logging/SingleStreamLogger.java: this interface now extends AutoCloseable * netx/net/sourceforge/jnlp/util/logging/filelogs/LogBasedFileLog.java: copy of original FileLog. Writing to file is done via java.util.loggiing engine * netx/net/sourceforge/jnlp/util/logging/filelogs/WriterBasedFileLog.java: writing to file is done by simple buffered writer * tests/netx/unit/net/sourceforge/jnlp/util/logging/FileLogTest.java: now tests LogBasedFileLog * tests/netx/unit/net/sourceforge/jnlp/util/logging/OutputControllerTest.java: now tests WriterBasedFileLog instead of FileLog * tests/netx/unit/net/sourceforge/jnlp/util/logging/WriterBasedFileLogTest.java: Similar set of tests as are in FileLogTest but for WriterBasedFileLog 2015-10-15 Jiri Vanek Broken file logging now dont crash itw * NEWS: mentioned * netx/net/sourceforge/jnlp/util/logging/FileLog.java: Instance now acquired from factory method (createFileLog) which defaults new SingleStreamLoggerImpl if normal initialization fails. * netx/net/sourceforge/jnlp/util/logging/OutputController.java: (getFileLog) uses new factory method rather then constructor. * netx/net/sourceforge/jnlp/util/logging/SingleStreamLogger.java: enforces now also close method * netx/net/sourceforge/jnlp/util/logging/PrintStreamLogger.java: impl close * netx/net/sourceforge/jnlp/util/logging/UnixSystemLog.java: impl close * netx/net/sourceforge/jnlp/util/logging/WinSystemLog.java: impl close * netx/net/sourceforge/jnlp/util/logging/headers/PluginMessage.java: removed unused import 2015-10-07 Jiri Vanek All connection restrictions now consider also port * NEWS: mentioned restriction about ports * netx/net/sourceforge/jnlp/SecurityDesc.java: downloadHost redeclared to URL and made final. All set/gets adapted * netx/net/sourceforge/jnlp/Parser.java: (base) passes url to SecurityDesc * netx/net/sourceforge/jnlp/PluginBridge.java: (PluginBridge) same * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: same * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java: (getApplet) (getApplets) same * netx/net/sourceforge/jnlp/util/UrlUtils.java: added methods sanitizePort and getPort, which always returns port. If no port goes in, default port is going out. Added getHostAndPort which returns host also with port. * tests/netx/unit/net/sourceforge/jnlp/SecurityDescTest.java: adapted to new api * tests/netx/unit/net/sourceforge/jnlp/util/UrlUtilsTest.java: tested new methods 2015-10-02 Jiri Vanek Fixed possible segfault during files on and debug on * plugin/icedteanp/IcedTeaNPPlugin.cc: added file_logs_initiated initiated as false. plugin_file_log initiated to NULL. * plugin/icedteanp/IcedTeaNPPlugin.h: made aware about extern file_logs_initiated * plugin/icedteanp/IcedTeaPluginUtils.h: (initialize_debug) set file_logs_initiated to true after initFileLog finishes. (PLUGIN_DEBUG) and (PLUGIN_ERROR) logs to file only when enabled and initiated. 2015-09-22 Jiri Vanek fixed two doclint errors * netx/net/sourceforge/jnlp/security/package-info.java: diagram put inside code annotation * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditorPermissions.java: (getTitle) added javadoc to prevent auto-generated return with (doclint) invalid character 2015-09-11 Jiri Vanek Post-release changes * NEWS: added 1.6.2 section * configure.ac: (AC_INIT) bumped to 1.6.2pre 2015-09-10 Jiri Vanek Pre-release tuning * Makefile.am: (netx-html-gen.stamp) set number of changests to 40 (since 1.6.0) * NEWS: date of 1.6.1 set * configure.ac: (AC_INIT) set to use 1.6.1 2015-09-10 Jiri Vanek * tests/netx/unit/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/AppTrustWarningPanelTest.java: Backuped, reset and restored .appletTrustSettings so its content can not affect test 2015-09-10 Jiri Vanek * netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletTrustConfirmation.java: (stripFileImp) fixed typo on variable of normlaized to normalized 2015-09-09 Jacob Wisor * .hgignore: Fix regex patterns of files ignored by Mercurial 2015-09-09 Jacob Wisor * ChangeLog: Fix spelling and formatting 2015-09-03 Jiri Vanek Jacob Wisor Stefan Ring Gathered and applied shards of DE translation * netx/net/sourceforge/jnlp/resources/Messages_de.properties: added throng of keys * AUTHORS: added Stefan Ring, stefan@complang.tuwien.ac.at 2015-09-03 Jiri Vanek * NEWS: mentioned fixes for RH1233697, RH1233667 and reuse of MissingALACAdialog for unsigned applications 2015-09-03 Jiri Vanek Fixed ArrayIndexOutOfBound in version corner case issue * netx/net/sourceforge/jnlp/security/appletextendedsecurity/impl/UnsignedAppletActionStorageImpl.java: length of array is checked, * tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/impl/VersionRestrictionTest.java: added tests for this case * tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/impl/UnsignedAppletActionStorageImplTest.java: (updateAppletActionTest1) adapted to version string 2015-09-03 Jiri Vanek Added identifier to .appletTrustSettings to specify version of file * netx/net/sourceforge/jnlp/security/appletextendedsecurity/impl/UnsignedAppletActionStorageImpl.java: added handling of version - readVersion, versionPreffix, backup, currentVersion. (readLine) when first line is read, it is checked for version and acted. If loaded version is missing or older then current 2, then file is not loaded. otherwise normal loading. (writeContent) now inserts header with version. (actOnVersionLoad) new method, handling consequences of recognized x current version (backupOldFile) new method, backing up old file as .appletTrustSettings.version-backup * netx/net/sourceforge/jnlp/util/UrlUtils.java: consumed exception during normalization is logged only to console/verbose * tests/netx/unit/net/sourceforge/jnlp/security/SecurityDialogsTest.java: added considering of version * tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/impl/LegacyUnsignedAppletActionStorageImplTest.java: same * tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/impl/UnsignedAppletActionStorageImplTest.java: same * tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/impl/VersionRestrictionTest.java: new test file testing version recognition and processing 2015-09-02 Jiri Vanek All UrlRegEx-es got unified and correct quoting * netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletActionTableModel.java: (addRow) now uses factory methods of quoteAndStar form UrlRegEx * netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletsTrustingListPanel.java: same, but of exact. Removed redundant space in APPEXTSECguiPanelTableInvalid key * netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletActionEntry.java: same of exact. * netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletTrustConfirmation.java: same * netx/net/sourceforge/jnlp/security/appletextendedsecurity/impl/UnsignedAppletActionStorageExtendedImpl.java: same * netx/net/sourceforge/jnlp/security/appletextendedsecurity/impl/UnsignedAppletActionStorageImpl.java: same * netx/net/sourceforge/jnlp/security/appletextendedsecurity/UrlRegEx.java: constructor made private, field final. Creation allowed over factory methods of quote. quoteAndStar, exact. Added and iprved mehtods for visualisation * tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/UrlRegExTest.java: new test file with tests to new methods in UrlRegex 2015-09-02 Jiri Vanek Newline characters are banned from saving to .appletTrustSettings * netx/net/sourceforge/jnlp/security/appletextendedsecurity/InvalidLineException.java: New file. Exception to be specially handled if error appear in saved line. * netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletActionEntry.java: (serializeToReadableAndParseableString) if new-line appear in line, InvalidLineException is thrown * netx/net/sourceforge/jnlp/security/appletextendedsecurity/impl/UnsignedAppletActionStorageImpl.java: (writeContent) InvalidLineException is expected and logged. * tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletTrustConfirmationTest.java: adapted and quite a lot of tests added. * tests/reproducers/simple/UnicodeLineBreak/resources/UnicodeLineBreak.java: * tests/reproducers/simple/UnicodeLineBreak/srcs/UnicodeLineBreak.java: * tests/reproducers/simple/UnicodeLineBreak/testcases/UnicodeLineBreakTests.java: half automated reproducer of this behavior * netx/net/sourceforge/jnlp/runtime/HtmlBoot.java: based on existence of -xml, now can turn off tagsoup * netx/net/sourceforge/jnlp/runtime/html/AppletExtractor.java: is passing parsersettings to HtmlBoot 2015-09-01 Jiri Vanek Saving of status of dialogs for "whole codebase" now includes also document base * netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletTrustConfirmation.java: (updateAppletAction) now saves base of docbase instead of .* "for remember for codebase" stripFile - new method, ensuring docbase do not contains file * tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletTrustConfirmationTest.java: added testSripFile unit test for new method * tests/reproducers/simple/FakeCodebase/resources/FakeCodebase.html.in: * tests/reproducers/simple/FakeCodebase/resources/FakeCodebase.jnlp.in: * tests/reproducers/simple/FakeCodebase/resources/OriginalCodebase.html: * tests/reproducers/simple/FakeCodebase/resources/OriginalCodebase.jnlp: * tests/reproducers/simple/FakeCodebase/srcs/FakeCodebase.java: * tests/reproducers/simple/FakeCodebase/testcases/FakeCodebaseTests.java: Reproducer of this behavior 2015-09-01 Jiri Vanek application-library-allowable-codebase dialog made available for unsigned apps * netx/net/sourceforge/jnlp/resources/Messages.properties: (ALACAMissingMainTitle) added warning about possible consequences of resources out of docbase. (ALACAMatchingMainTitle) the red higlights changed to green and added calming words about it. * netx/net/sourceforge/jnlp/resources/Messages_cs.properties: same * netx/net/sourceforge/jnlp/resources/Messages_de.properties: same * netx/net/sourceforge/jnlp/resources/Messages_pl.properties: adapted to red to green recoloring * netx/net/sourceforge/jnlp/runtime/ManifestAttributesChecker.java: (checkApplicationLibraryAllowableCodebaseAttribute) removed return for in case of unsigned app. Fixed check for all matching resources against codebase and docbase If app is unsigned, then value in manifest is ignored. Missing alaca required also in low security mode * tests/netx/unit/net/sourceforge/jnlp/runtime/ManifestAttributesCheckerTest.java: new file to test stripDocbase. 2015-09-01 Andrew Azores Add -defaultfile switch to PolicyEditor * netx/net/sourceforge/jnlp/resources/Messages.properties (PBODefaultFileFilePathSpecifiedError): new message * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditor.java (openDefaultButtonAction): refactor to use getDefaultPolicyFilePath (getDefaultPolicyFilePath): new method (getFilePathArgument): add -defaultfile switch support 2015-09-01 Andrew Azores Add texts for PolicyEditor's -defaultfile switch * icedteaweb-completion: added -defaultfile to policyeditor options * netx/net/sourceforge/jnlp/OptionsDefinitions.java: added DEFAULTFILE to PolicyEditor options * netx/net/sourceforge/jnlp/resources/Messages.properties (PBODefaultFile): new message 2015-07-30 Andrew Azores PolicyEditor -file switch and main argument cannot be used in conjunction * NEWS: add note * netx/net/sourceforge/jnlp/resources/Messages.properties (PEMainArgAndFileSwitchSpecifiedError): new message * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditor.java (main): die when both main arg and -file are given (getFilePathArgument): new method (cleanFilePathArgument): new method 2015-07-27 Jiri Vanek Removed last remains of BOOT_DIR * Makefile.am: declared and exported EXPORTED_JAR EXPORTED_KEYTOOL EXPORTED_JARSIGNER EXPORTED_PACK200 * tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/srcs/Makefile: all of (BOOT_DIR)/bin/keytool (BOOT_DIR)/bin/jarsigner (BOOT_DIR)/bin/javac (BOOT_DIR)/bin/jar (BOOT_DIR)/bin/pack200 replaced by (EXPORTED_KEYTOOL) (EXPORTED_JARSIGNER) (EXPORTED_JAVAC) (EXPORTED_JAR) (EXPORTED_PACK200) * tests/reproducers/custom/AppletExtendsFromOutsideJar/srcs/Makefile: same * tests/reproducers/custom/ExtensionJnlpsInApplet/srcs/Makefile: same * tests/reproducers/custom/JNLPClassLoaderDeadlock/srcs/Makefile: same * tests/reproducers/custom/MixedSigningApplet/srcs/Makefile: same * tests/reproducers/custom/MultipleSignaturesPerJar/srcs/Makefile: same * tests/reproducers/custom/PackGZip/srcs/Makefile: same * tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/srcs/Makefile: same * tests/reproducers/custom/SignedAppletCodebaseLoading/srcs/Makefile: same * tests/reproducers/custom/SignedAppletExternalMainClass/srcs/Makefile: same * tests/reproducers/custom/TrustedOnlyAttribute/srcs/Makefile: same * tests/reproducers/custom/UnsignedContentInMETAINF/srcs/Makefile: same 2015-07-30 Jiri Vanek replaced Trusted-only by Trusted-Only, cosmetic change in TrustedOnlyAttribute reproducer * tests/reproducers/custom/TrustedOnlyAttribute/resources/TrustedOnlyAttribute-signed-nosecurity.jnlp: * tests/reproducers/custom/TrustedOnlyAttribute/resources/TrustedOnlyAttribute-signed-security.jnlp: * tests/reproducers/custom/TrustedOnlyAttribute/resources/TrustedOnlyAttribute-unsigned-nosecurity.jnlp: * tests/reproducers/custom/TrustedOnlyAttribute/resources/TrustedOnlyAttribute-unsigned-security.jnlp: * tests/reproducers/custom/TrustedOnlyAttribute/srcs/MANIFEST.MF: 2015-07-29 Jiri Vanek Enabled and properly tested Entry-Point attribute check * NEWS: mentioned enabling * netx/net/sourceforge/jnlp/runtime/ManifestAttributesChecker.java: enabled call to checkEntryPoint if enabled * tests/reproducers/signed/EntryPointSignedSingleBothInvalid/resources/EntryPointSignedSingleBothInvalid.java: * tests/reproducers/signed/EntryPointSignedSingleBothInvalid/resources/EntryPointSignedSingleBothInvalid.java: * tests/reproducers/signed/EntryPointSignedSingleBothInvalid/resources/EntryPointSignedSingleBothInvalid_applet.java: * tests/reproducers/signed/EntryPointSignedSingleBothInvalid/resources/EntryPointSignedSingleBothInvalid_applet_security.java: * tests/reproducers/signed/EntryPointSignedSingleBothInvalid/resources/EntryPointSignedSingleBothInvalid_security.java: * tests/reproducers/signed/EntryPointSignedSingleBothInvalid/srcs/EntryPointSignedSingleBothInvalid.java: * tests/reproducers/signed/EntryPointSignedSingleBothInvalid/srcs/META-INF/MANIFEST.java: * tests/reproducers/signed/EntryPointSignedSingleBothInvalid/testcases/EntryPointSignedSingleBothInvalidTest.java: tests for Entry-Point with two values, both invalid * tests/reproducers/signed/EntryPointSignedSingleBothOk/resources/EntryPointSignedSingleBothOk1.java: * tests/reproducers/signed/EntryPointSignedSingleBothOk/resources/EntryPointSignedSingleBothOk1.java: * tests/reproducers/signed/EntryPointSignedSingleBothOk/resources/EntryPointSignedSingleBothOk2.java: * tests/reproducers/signed/EntryPointSignedSingleBothOk/resources/EntryPointSignedSingleBothOk2.java: * tests/reproducers/signed/EntryPointSignedSingleBothOk/resources/EntryPointSignedSingleBothOk_applet1.java: * tests/reproducers/signed/EntryPointSignedSingleBothOk/resources/EntryPointSignedSingleBothOk_applet2.java: * tests/reproducers/signed/EntryPointSignedSingleBothOk/resources/EntryPointSignedSingleBothOk_applet_security1.java: * tests/reproducers/signed/EntryPointSignedSingleBothOk/resources/EntryPointSignedSingleBothOk_applet_security2.java: * tests/reproducers/signed/EntryPointSignedSingleBothOk/resources/EntryPointSignedSingleBothOk_security1.java: * tests/reproducers/signed/EntryPointSignedSingleBothOk/resources/EntryPointSignedSingleBothOk_security2.java: * tests/reproducers/signed/EntryPointSignedSingleBothOk/srcs/EntryPointSignedSingleBothOk1.java: * tests/reproducers/signed/EntryPointSignedSingleBothOk/srcs/EntryPointSignedSingleBothOk2.java: * tests/reproducers/signed/EntryPointSignedSingleBothOk/srcs/META-INF/MANIFEST.java: * tests/reproducers/signed/EntryPointSignedSingleBothOk/testcases/EntryPointSignedSingleBothOkTest1.java: * tests/reproducers/signed/EntryPointSignedSingleBothOk/testcases/EntryPointSignedSingleBothOkTest2.java: tests for Entry-Point with two values, both valid * tests/reproducers/signed/EntryPointSignedSingleFirstInvalidSecondOk/resources/EntryPointSignedSingleFirstInvalidSecondOk.java: * tests/reproducers/signed/EntryPointSignedSingleFirstInvalidSecondOk/resources/EntryPointSignedSingleFirstInvalidSecondOk.java: * tests/reproducers/signed/EntryPointSignedSingleFirstInvalidSecondOk/resources/EntryPointSignedSingleFirstInvalidSecondOk_applet.java: * tests/reproducers/signed/EntryPointSignedSingleFirstInvalidSecondOk/resources/EntryPointSignedSingleFirstInvalidSecondOk_applet_security.java: * tests/reproducers/signed/EntryPointSignedSingleFirstInvalidSecondOk/resources/EntryPointSignedSingleFirstInvalidSecondOk_security.java: * tests/reproducers/signed/EntryPointSignedSingleFirstInvalidSecondOk/srcs/EntryPointSignedSingleFirstInvalidSecondOk.java: * tests/reproducers/signed/EntryPointSignedSingleFirstInvalidSecondOk/srcs/META-INF/MANIFEST.java: * tests/reproducers/signed/EntryPointSignedSingleFirstInvalidSecondOk/testcases/EntryPointSignedSingleFirstInvalidSecondOkTest.java: tests for Entry-Point with two values, first invalid, second ok * tests/reproducers/signed/EntryPointSignedSingleInvalid/resources/EntryPointSignedSingleInvalid.java: * tests/reproducers/signed/EntryPointSignedSingleInvalid/resources/EntryPointSignedSingleInvalid.java: * tests/reproducers/signed/EntryPointSignedSingleInvalid/resources/EntryPointSignedSingleInvalid_applet.java: * tests/reproducers/signed/EntryPointSignedSingleInvalid/resources/EntryPointSignedSingleInvalid_applet_security.java: * tests/reproducers/signed/EntryPointSignedSingleInvalid/resources/EntryPointSignedSingleInvalid_security.java: * tests/reproducers/signed/EntryPointSignedSingleInvalid/srcs/EntryPointSignedSingleInvalid.java: * tests/reproducers/signed/EntryPointSignedSingleInvalid/srcs/META-INF/MANIFEST.java: * tests/reproducers/signed/EntryPointSignedSingleInvalid/testcases/EntryPointSignedSingleInvalidTest.java: tests for Entry-Point with one invalid value * tests/reproducers/signed/EntryPointSignedSingleOk/resources/EntryPointSignedSingleOk.java: * tests/reproducers/signed/EntryPointSignedSingleOk/resources/EntryPointSignedSingleOk.java: * tests/reproducers/signed/EntryPointSignedSingleOk/resources/EntryPointSignedSingleOk_applet.java: * tests/reproducers/signed/EntryPointSignedSingleOk/resources/EntryPointSignedSingleOk_applet_security.java: * tests/reproducers/signed/EntryPointSignedSingleOk/resources/EntryPointSignedSingleOk_security.java: * tests/reproducers/signed/EntryPointSignedSingleOk/srcs/EntryPointSignedSingleOk.java: * tests/reproducers/signed/EntryPointSignedSingleOk/srcs/META-INF/MANIFEST.java: * tests/reproducers/signed/EntryPointSignedSingleOk/testcases/EntryPointSignedSingleOkTest.java: tests for Entry-Point with one ok value * tests/reproducers/signed/EntryPointSignedSingleSecondInvalidFirstOk/resources/EntryPointSignedSingleSecondInvalidFirstOk.java: * tests/reproducers/signed/EntryPointSignedSingleSecondInvalidFirstOk/resources/EntryPointSignedSingleSecondInvalidFirstOk.java: * tests/reproducers/signed/EntryPointSignedSingleSecondInvalidFirstOk/resources/EntryPointSignedSingleSecondInvalidFirstOk_applet.java: * tests/reproducers/signed/EntryPointSignedSingleSecondInvalidFirstOk/resources/EntryPointSignedSingleSecondInvalidFirstOk_applet_security.java: * tests/reproducers/signed/EntryPointSignedSingleSecondInvalidFirstOk/resources/EntryPointSignedSingleSecondInvalidFirstOk_security.java: * tests/reproducers/signed/EntryPointSignedSingleSecondInvalidFirstOk/srcs/EntryPointSignedSingleSecondInvalidFirstOk.java: * tests/reproducers/signed/EntryPointSignedSingleSecondInvalidFirstOk/srcs/META-INF/MANIFEST.java: * tests/reproducers/signed/EntryPointSignedSingleSecondInvalidFirstOk/testcases/EntryPointSignedSingleSecondInvalidFirstOkTest.java: tests for Entry-Point with two values, first ok, second invalid * tests/reproducers/simple/EntryPointUnsignedSingleInvalid/resources/EntryPointUnsignedSingleInvalid.java: * tests/reproducers/simple/EntryPointUnsignedSingleInvalid/resources/EntryPointUnsignedSingleInvalid.java: * tests/reproducers/simple/EntryPointUnsignedSingleInvalid/resources/EntryPointUnsignedSingleInvalid_applet.java: * tests/reproducers/simple/EntryPointUnsignedSingleInvalid/resources/EntryPointUnsignedSingleInvalid_applet_security.java: * tests/reproducers/simple/EntryPointUnsignedSingleInvalid/resources/EntryPointUnsignedSingleInvalid_security.java: * tests/reproducers/simple/EntryPointUnsignedSingleInvalid/srcs/EntryPointUnsignedSingleInvalid.java: * tests/reproducers/simple/EntryPointUnsignedSingleInvalid/srcs/META-INF/MANIFEST.java: * tests/reproducers/simple/EntryPointUnsignedSingleInvalid/testcases/EntryPointUnsignedSingleInvalidTest.java: tests for Entry-Point with one invalid value in unsigned jar (ignoring this value) 2015-07-22 Fridrich Strba * Makefile.am: (generate-docs.stamp) added '-' to tail of tail command as some implementations of tail parse the file information as the last argument 2015-07-20 Jiri Vanek Tuned permissions attribute behavior for unsigned jnlps * NEWS: change of permissions attribute mentioned in news * netx/net/sourceforge/jnlp/runtime/ManifestAttributesChecker.java: permissions sandbox and signed app and unsigned app with permissions all-permissions now run in sandbox instead of not at all. * tests/reproducers/signed/SandboxSignedSandbox/testcases/SandboxSignedSandboxTest.java: Failing tests of (javawsAllPermNoSecurity) (javawsAppletAllPermNoSecurity) with bug comment got removed this comment and are now passing * tests/reproducers/simple/SandboxUnsignedAllPerm/testcases/SandboxUnsignedAllPermTest.java Failing tests of (javawsAllPermNoSecurity) (javawsAppletAllPermNoSecurity) with bug comment got removed this comment and are now passing 2015-07-20 Jiri Vanek Added tests for signed applet/app using Permission attribute and for unsigned applet/app using Permission attribute * tests/reproducers/signed/SandboxSignedAllPerm/resources/SandboxSignedAllPerm.html * tests/reproducers/signed/SandboxSignedAllPerm/resources/SandboxSignedAllPerm.jnlp * tests/reproducers/signed/SandboxSignedAllPerm/resources/SandboxSignedAllPerm_applet.jnlp * tests/reproducers/signed/SandboxSignedAllPerm/resources/SandboxSignedAllPerm_applet_security.jnlp * tests/reproducers/signed/SandboxSignedAllPerm/resources/SandboxSignedAllPerm_security.jnlp * tests/reproducers/signed/SandboxSignedAllPerm/srcs/META-INF/MANIFEST.MF contains Permissions: all-permissions * tests/reproducers/signed/SandboxSignedAllPerm/srcs/SandboxSignedAllPerm.java * tests/reproducers/signed/SandboxSignedAllPerm/testcases/SandboxSignedAllPermTest.java test cases with permissions in manifest check on * tests/reproducers/signed/SandboxSignedInvalid/resources/SandboxSignedInvalid.html * tests/reproducers/signed/SandboxSignedInvalid/resources/SandboxSignedInvalid.jnlp * tests/reproducers/signed/SandboxSignedInvalid/resources/SandboxSignedInvalid_applet.jnlp * tests/reproducers/signed/SandboxSignedInvalid/resources/SandboxSignedInvalid_applet_security.jnlp * tests/reproducers/signed/SandboxSignedInvalid/resources/SandboxSignedInvalid_security.jnlp * tests/reproducers/signed/SandboxSignedInvalid/srcs/META-INF/MANIFEST.MF contains Permissions: invalidValue * tests/reproducers/signed/SandboxSignedInvalid/srcs/SandboxSignedInvalid.java * tests/reproducers/signed/SandboxSignedInvalid/testcases/SandboxSignedInvalidTest.java test cases with permissions in manifest check on * tests/reproducers/signed/SandboxSignedMissing/resources/SandboxSignedMissing.html * tests/reproducers/signed/SandboxSignedMissing/resources/SandboxSignedMissing.jnlp * tests/reproducers/signed/SandboxSignedMissing/resources/SandboxSignedMissing_applet.jnlp * tests/reproducers/signed/SandboxSignedMissing/resources/SandboxSignedMissing_applet_security.jnlp * tests/reproducers/signed/SandboxSignedMissing/resources/SandboxSignedMissing_security.jnlp * tests/reproducers/signed/SandboxSignedMissing/srcs/META-INF/MANIFEST.MF does not contains Permissions * tests/reproducers/signed/SandboxSignedMissing/srcs/SandboxSignedMissing.java * tests/reproducers/signed/SandboxSignedMissing/testcases/SandboxSignedMissingTest.java test cases with permissions in manifest check on * tests/reproducers/signed/SandboxSignedMissing/testcases/SandboxSignedMissingTestHighSecurity.java test cases with permissions in manifest check on and on high security => interactive tests with auto-reply * tests/reproducers/signed/SandboxSignedSandbox/resources/SandboxSignedSandbox.html * tests/reproducers/signed/SandboxSignedSandbox/resources/SandboxSignedSandbox.jnlp * tests/reproducers/signed/SandboxSignedSandbox/resources/SandboxSignedSandbox_applet.jnlp * tests/reproducers/signed/SandboxSignedSandbox/resources/SandboxSignedSandbox_applet_security.jnlp * tests/reproducers/signed/SandboxSignedSandbox/resources/SandboxSignedSandbox_security.jnlp * tests/reproducers/signed/SandboxSignedSandbox/srcs/META-INF/MANIFEST.MF contains Permissions: sandbox * tests/reproducers/signed/SandboxSignedSandbox/srcs/SandboxSignedSandbox.java * tests/reproducers/signed/SandboxSignedSandbox/testcases/SandboxSignedSandboxTest.java test cases with permissions in manifest check on. Contains two failing tests currently itw with sandbox in manifest and jnlp not requesting permissions fails. Bug to be fixed * tests/reproducers/unsigned/SandboxUnsignedAllPerm/resources/SandboxUnsignedAllPerm.html * tests/reproducers/unsigned/SandboxUnsignedAllPerm/resources/SandboxUnsignedAllPerm.jnlp * tests/reproducers/unsigned/SandboxUnsignedAllPerm/resources/SandboxUnsignedAllPerm_applet.jnlp * tests/reproducers/unsigned/SandboxUnsignedAllPerm/resources/SandboxUnsignedAllPerm_applet_security.jnlp * tests/reproducers/unsigned/SandboxUnsignedAllPerm/resources/SandboxUnsignedAllPerm_security.jnlp * tests/reproducers/unsigned/SandboxUnsignedAllPerm/srcs/META-INF/MANIFEST.MF contains Permissions: all-permissions * tests/reproducers/unsigned/SandboxUnsignedAllPerm/srcs/SandboxUnsignedAllPerm.java * tests/reproducers/unsigned/SandboxUnsignedAllPerm/testcases/SandboxUnsignedAllPermTest.java test cases with permissions in manifest check on. There is probably an bug in impl. The applet should not run at all, or javaws without permissions should run in sandbox too. * tests/reproducers/unsigned/SandboxUnsignedInvalid/resources/SandboxUnsignedInvalid.html * tests/reproducers/unsigned/SandboxUnsignedInvalid/resources/SandboxUnsignedInvalid.jnlp * tests/reproducers/unsigned/SandboxUnsignedInvalid/resources/SandboxUnsignedInvalid_applet.jnlp * tests/reproducers/unsigned/SandboxUnsignedInvalid/resources/SandboxUnsignedInvalid_applet_security.jnlp * tests/reproducers/unsigned/SandboxUnsignedInvalid/resources/SandboxUnsignedInvalid_security.jnlp * tests/reproducers/unsigned/SandboxUnsignedInvalid/srcs/META-INF/MANIFEST.MF contains Permissions: invalidValue * tests/reproducers/unsigned/SandboxUnsignedInvalid/srcs/SandboxUnsignedInvalid.java * tests/reproducers/unsigned/SandboxUnsignedInvalid/testcases/SandboxUnsignedInvalidTest.java test cases with permissions in manifest check on * tests/reproducers/unsigned/SandboxUnsignedMissing/resources/SandboxUnsignedMissing.html * tests/reproducers/unsigned/SandboxUnsignedMissing/resources/SandboxUnsignedMissing.jnlp * tests/reproducers/unsigned/SandboxUnsignedMissing/resources/SandboxUnsignedMissing_applet.jnlp * tests/reproducers/unsigned/SandboxUnsignedMissing/resources/SandboxUnsignedMissing_applet_security.jnlp * tests/reproducers/unsigned/SandboxUnsignedMissing/resources/SandboxUnsignedMissing_security.jnlp * tests/reproducers/unsigned/SandboxUnsignedMissing/srcs/META-INF/MANIFEST.MF does not contains Permissions * tests/reproducers/unsigned/SandboxUnsignedMissing/srcs/SandboxUnsignedMissing.java * tests/reproducers/unsigned/SandboxUnsignedMissing/testcases/SandboxUnsignedMissingTest.java test cases with permissions in manifest check on * tests/reproducers/unsigned/SandboxUnsignedMissing/testcases/SandboxUnsignedMissingTestHighSecurity.java test cases with permissions in manifest check on and on high security => interactive tests with auto-reply * tests/reproducers/unsigned/SandboxUnsignedSandbox/resources/SandboxUnsignedSandbox.html * tests/reproducers/unsigned/SandboxUnsignedSandbox/resources/SandboxUnsignedSandbox.jnlp * tests/reproducers/unsigned/SandboxUnsignedSandbox/resources/SandboxUnsignedSandbox_applet.jnlp * tests/reproducers/unsigned/SandboxUnsignedSandbox/resources/SandboxUnsignedSandbox_applet_security.jnlp * tests/reproducers/unsigned/SandboxUnsignedSandbox/resources/SandboxUnsignedSandbox_security.jnlp * tests/reproducers/unsigned/SandboxUnsignedSandbox/srcs/META-INF/MANIFEST.MF contains Permissions: sandbox * tests/reproducers/unsigned/SandboxUnsignedSandbox/srcs/SandboxUnsignedSandbox.java * tests/reproducers/unsigned/SandboxUnsignedSandbox/testcases/SandboxUnsignedSandboxTest.java test cases with permissions in manifest check on. 2015-07-20 Jiri Vanek Fixed download service * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: (fillInPartJars) for-each loop replaced by indexed loop to prevent ConcurrentModificationException * tests/reproducers/signed/DownloadService/testcases/DownloadServiceTest.java: small refactoring in favour of diamond operator 2015-06-25 Jiri Vanek Fixed to short buttons for localized text - RH1231441 * NEWS: mentioned RH1231441 * netx/net/sourceforge/jnlp/security/dialogs/AppletWarningPane.java: removed set of preferred sizes to minimal size * netx/net/sourceforge/jnlp/security/dialogs/PasswordAuthenticationPane.java same * netx/net/sourceforge/jnlp/security/dialogs/CertWarningPane.java: same * netx/net/sourceforge/jnlp/security/dialogs/MissingALACAttributePanel.java: same * netx/net/sourceforge/jnlp/security/dialogs/MissingPermissionsAttributePanel.java: same 2015-06-15 Jiri Vanek Updated NEWS, added javadoc fo security package * NEWS: mentioned major work in last month and half * netx/net/sourceforge/jnlp/security/package-info.java: new file, describing flow of SecurityDialogMessage 2015-06-10 Jiri Vanek Security dialogs got, moreover, unified dealing with trustNone/All and headless * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java: setTrustAll setTrustNone made public so it can be used in testing. * netx/net/sourceforge/jnlp/security/SecurityDialogs.java: all calls to show security dialog now have correct introduction based on shouldPromptUser with resolution based on trustAll. (shouldPromptUser) now takes also headless to accounting. * netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletTrustConfirmation.java: (checkUnsignedWithUserIfRequired) now react trustAll and trustNone (checkPartiallySignedWithUserIfRequired) now react also trustAll * tests/netx/unit/net/sourceforge/jnlp/security/SecurityDialogsTest.java: added tests verifying adapted logic 2015-06-09 Jiri Vanek Fixed issue, when desktop/menu shortcut created during -html mode, was not created like it * netx/net/sourceforge/jnlp/runtime/Boot.java: setHtml(true) used when command line contains html switch * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java: added html field and setter and getter * netx/net/sourceforge/jnlp/util/XDesktopEntry.java: (getContentsAsReader) now add -html if jnlpruntime.isHtml. * tests/netx/unit/net/sourceforge/jnlp/util/XDesktopEntryTest.java: added tests for new functionality * Changelog: occurence of tab asterix slash replaced by tab asterix space in file declarations 2015-06-09 Jiri Vanek Fixed bug when generated desktop icon was not matched and user was asked for recreation * netx/net/sourceforge/jnlp/util/XDesktopEntry.java: (getShortcutTmpFile) (getLinuxDesktopIconFile) (getLinuxMenuIconFile) now generate file name by same way. By new method getDesktopIconFileName which is using sanitizing getDesktopIconName. 2015-05-27 Jiri Vanek Improved caching of files obtained via query * netx/net/sourceforge/jnlp/cache/CacheUtil.java: now consider also query(if any) when creating file-name for item to be cached * tests/netx/unit/net/sourceforge/jnlp/cache/CacheUtilTest.java: fixed old tests due to change and added two new tests to test change. * tests/netx/unit/net/sourceforge/jnlp/cache/ResourceDownloaderTest.java: removed unused import. 2015-05-22 Jiri Vanek Comments in deployment.properties now persists saving via itweb-settings * netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java: (loadComments) new method. Saves every line starting with # char except date and DEPLOYMENT_COMMENT. (load) This method is called before every load, and read lines are stored. (save) Saved comments are inserted to other comments before call to store. * tests/netx/unit/net/sourceforge/jnlp/PluginBridgeTest.java: (countOccurences) made public so it can be reused * tests/netx/unit/net/sourceforge/jnlp/config/DeploymentConfigurationTest.java: added tests to verify preserving of comments and non-multiplying date and DEPLOYMENT_COMMENT 2015-05-22 Jiri Vanek Removed garbage from htmls' width and height * netx/net/sourceforge/jnlp/runtime/html/AppletParser.java: new method (sanitizeSize) which remove all non digit content from string * tests/netx/unit/net/sourceforge/jnlp/runtime/html/AppletParserTest.java: new file, test for (sanitizeSize) 2015-05-04 Jie Kang Fix policyeditor file flag to work when used standalone * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditor.java: (main): filepath no longer set to null when file flag has parameter and there is no main argument 2015-04-29 Jiri Vanek 1.6 post-release operations * configure.ac: bumped (AC_INIT) to 1.6pre * NEWS: Added 1.6.1 section, 2015-04-28 Jiri Vanek Fixed incorrect usage of apostrophes in intro generation * Makefile.am: (stamps/generate-docs.stamp) fixed redundant false in version appearing in doc intro 2015-04-28 Jiri Vanek Pre-release tuning * Makefile.am: (netx-html-gen.stamp) set number of changests to 235 (since 1.5) * NEWS: date of 1.6 set to 2015-04-29 * configure.ac: (AC_INIT) set to use 1.6 2015-04-28 Jiri Vanek * README: updated to match current state. 2015-04-28 Jiri Vanek Improved JDK9 detection * acinclude.m4: (IT_CHECK_FOR_JDK) if found jdk is link, then it is printed out also as resolved. (IT_CHECK_FOR_JRE) same, plus except classical JDK/jre verification, also modular JRE is checked. 2015-04-27 Lukasz Dracz Removed Executable Permissions from bash completion * icedteaweb-completion 2015-04-24 Jiri Vanek Fixed resource test to pass for CZ localization * tests/netx/unit/net/sourceforge/jnlp/resources/MessagesPropertiesTest.java: added four more items to whitelist. 2015-04-24 Alexandr Kolouch Added Czech translation for 1.6. * netx/net/sourceforge/jnlp/resources/Messages_cs.propertie: added missing properties, adapted changed ones. 2015-04-24 Jiri Vanek Messages from TextsProvider moved to properties * netx/net/sourceforge/jnlp/resources/Messages.properties: added family ITWTB with fourproeprties. * netx/net/sourceforge/jnlp/util/docprovider/TextsProvider.java: is now using those properties instead of hardcoded values * netx/net/sourceforge/jnlp/util/docprovider/ItwebSettingsTextsProvider.java: * netx/net/sourceforge/jnlp/util/docprovider/PolicyEditorTextsProvider.java: now includes getFilesAppendix in (getFiles) 2015-04-24 Alexandr Kolouch * netx/net/sourceforge/jnlp/resources/Messages.properties: various improvements to default set. 2015-04-23 Jiri Vanek * tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/testcases/PartiallySignedAppletManifestSpecifiesSandboxTests.java: used new MultipleDeploymentPropertiesModifier * tests/test-extensions-tests/net/sourceforge/jnlp/tools/DeploymentPropertiesModifierTest.java: add new inner class, MultipleDeploymentPropertiesModifier able to gather and apply/revert in bulk normal DeploymentPropertiesModifier * tests/test-extensions/net/sourceforge/jnlp/tools/DeploymentPropertiesModifier.java: Added testMultipleDeploymentPropertiesModifier, test to new MultipleDeploymentPropertiesModifier class 2015-04-23 Jiri Vanek * javac.in: removed. Its usage gone out with removal of bootstrap. * configure.ac: removed dependence on it 2015-04-23 Jiri Vanek Fixed loading of deployment.properties during 1.4 migration to 1.5 fs. * netx/net/sourceforge/jnlp/config/Defaults.java: hardcoded value of ALL fixed * netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java: reused first line of transfer moved to (TRANSFER_TITLE). Added possibility to specify destination of source file. (move14AndOlderFilesTo15Structure) order of moving files reorder, so deployment.properties go first and sensitive files after, setupable files first. Used getDefaultFullPAth insted of getFullPath where suitable (everywhere in this method) * netx/net/sourceforge/jnlp/config/PathsAndFiles.java: encapsulated security string, generalized getAllFiles,a dd getAllSwcurityFiles * netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java: Removed redundant calls to DeplymentConfiguration. Used PathsAndFiles rather. * netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletsTrustingListPanel.java: same * netx/net/sourceforge/jnlp/security/appletextendedsecurity/AppletStartupSecuritySettings.java: * tests/reproducers/simple/simpletest1/testcases/XDGspecificationTests.java: (fakeExtendedSecurity) adapted to new deployment.manifest.attributes.check schema 2015-04-20 Lukasz Dracz Add Tab Completion for icedtea-web * Makefile.am: Added to tarball generated * icedteaweb-completion: Added bash completion file 2015-04-20 Lukasz Dracz add Boolean Cast for JarCertVerifier * netx/net/sourceforge/jnlp/tools/JarCertVerifier.java: Added a Boolean cast that was needed for Java 7 to work 2015-04-20 Jiri Vanek Added support for jdk7 and javafx * launcher/launchers.in: noted lib/jfxrt.jar 2015-04-15 Jiri Vanek Fixed javadoc warnings and errors to pass doclint * /netx: nearly all files in main package get rid of doclint errors 2015-04-15 Jiri Vanek jnlp-signing mechanism now uses general parser (and so also tagsoup if enabled) * netx/net/sourceforge/jnlp/JNLPMatcher.java: removed redundant code to laod xmls and used Parser.getRootNode rather. Added same brackets to if statements. Added parameter of ParserSettings to * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: same. * tests/netx/unit/net/sourceforge/jnlp/JNLPMatcherTest.java: refactored to autoclseable and to never use tagsoup. * tests/netx/unit/net/sourceforge/jnlp/JNLPMatcherTestMallformedAllowed.java: new file, copy of JNLPMatcherTest. But always using tagsoup (if available) 2015-04-15 Jiri Vanek KeystorePasswordAttempter moved to outer class. Added comments and prevention about possible null password writing to keystore. KeystorePasswordAttempter made much more object-like. * netx/net/sourceforge/jnlp/resources/Messages.properties: added KSresultUntilNow KSinvalidPassword KSheadlesWarning KSnwPassHelp keys for keystore prompt * netx/net/sourceforge/jnlp/security/KeyStores.java: operation on keystores moved from stream to file * netx/net/sourceforge/jnlp/security/dialogs/CertWarningPane.java: same + removal of unused fields and imports * netx/net/sourceforge/jnlp/security/viewer/CertificatePane.java: same * netx/net/sourceforge/jnlp/security/SecurityUtil.java: same. Also get rid of default password - moved to KeystorePasswordAttempter. (initKeyManagerFactory) (setKeyEntry) (getKey) (loadKeyStore) (storeKeyStore) moved from enum and switch to runnable like approach. * netx/net/sourceforge/jnlp/security/KeystorePasswordAttempter.java: moved from inner 2015-04-15 Jiri Vanek User is now prompted on unknown password to keystore * netx/net/sourceforge/jnlp/security/KeyStores.java: Operations above keystores moved to calls to SecurityUtil.storeKeyStore/loadKeyStore * netx/net/sourceforge/jnlp/security/dialogs/CertWarningPane.java: same * netx/net/sourceforge/jnlp/security/viewer/CertificatePane.java: same * netx/net/sourceforge/jnlp/security/SecurityUtil.java: (initKeyManagerFactory) (setKeyEntry) (getKey) (loadKeyStore) (setKeyEntry/storeKeyStore) refactored to use unified call to unlockKeystore. Added inner class KeystorePasswordAttempter which is responsible for attempting several passwords and to ask user if fail. 2015-04-13 Jie Kang Increase server timeout for remote reproducers * tests/reproducers/custom/remote/testcases/RemoteApplicationTests.java: Timeout changed to 20s instead of default 10s 2015-04-13 Jie Kang Kill processes in Integration Tests more cleanly; revised * Makefile.am: remove all instances of softkiller (softkiller no longer works) * tests/test-extensions/net/sourceforge/jnlp/ProcessAssasin.java: use SIGTERM instead of SIGINT, don't destroy process after sending signal * tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java: reduce timeout from 20 seconds to 10 * tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/Firefox.java: remove usage of softkiller to close tabs * tests/softkiller/Makefile: * tests/softkiller/softkiller.c: remove softkiller 2015-04-13 Jie Kang Add reproducers for jnlp_href attribute * tests/reproducers/simple/JnlpHrefAttribute/resources/JnlpHrefAttribute.html: * tests/reproducers/simple/JnlpHrefAttribute/resources/JnlpHrefAttribute.jnlp: * tests/reproducers/simple/JnlpHrefAttribute/srcs/JnlpHrefAttribute.java: * tests/reproducers/simple/JnlpHrefAttribute/testcases/JnlpHrefAttributeTest.java: Added test for firefox/opera that succeeds with attribute and test for midori/epiphany that fails with attribute 2015-04-13 Jiri Vanek set single place for keystore operations * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java: usage of keystore moved to utility method * netx/net/sourceforge/jnlp/security/CertificateUtils.java: same * netx/net/sourceforge/jnlp/security/KeyStores.java: same * netx/net/sourceforge/jnlp/security/dialogs/CertWarningPane.java: same * netx/net/sourceforge/jnlp/security/viewer/CertificatePane.java: same * netx/net/sourceforge/jnlp/security/SecurityUtil.java: added five new methods wrapping work on keystores 2015-04-13 Jiri Vanek Removed redundant occurrence of default keystore password * netx/net/sourceforge/jnlp/security/KeyStores.java: removed redundant DEFAULT_PASSWORD * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java: call to KeyStores.getPassword replaced by SecurityUtil.getTrustedCertsPassword * netx/net/sourceforge/jnlp/security/CertificateUtils.java: same * netx/net/sourceforge/jnlp/security/SecurityUtil.java: same * netx/net/sourceforge/jnlp/security/dialogs/CertWarningPane.java: same * netx/net/sourceforge/jnlp/security/viewer/CertificatePane.java: same 2015-04-13 Jiri Vanek reverted "Kill processes in Integration Tests more cleanly" It needs to be revisited. 2015-04-10 Lukasz Dracz add DeploymentPropertiesModifierTests * tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/testcases/PartiallySignedAppletManifestSpecifiesSandboxTests.java: Changed spelling of DeploymentPropertiesModifier * tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/testcases/CodeBaseManifestEntrySignedMatching.java Changed spelling of DeploymentPropertiesModifier * tests/reproducers/signed/SignedAppletManifestSpecifiesSandbox/testcases/SignedAppletManifestSpecifiesSandboxTests.java Changed spelling of DeploymentPropertiesModifier * tests/test-extensions-tests/net/sourceforge/jnlp/tools/DeploymentPropertiesModifierTest.java: Added tests for DeploymentPropertiesModifier * tests/test-extensions/net/sourceforge/jnlp/tools/DeploymentPropertiesModifier.java: added proper spelling of this file * tests/test-extensions/net/sourceforge/jnlp/tools/DeploymentPropetiesModifier.java: removed due to spelling error and added proper spelling of the same file 2015-04-10 Jie Kang Kill processes in Integration Tests more cleanly * tests/test-extensions/net/sourceforge/jnlp/ProcessAssasin.java: use SIGUSR1 instead of SIGINT, don't destroy process after sending signal * tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java: reduce timeout from 20 seconds to 10 * tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/Firefox.java: remove usage of softkiller to close tabs (softkiller no longer works) 2015-04-10 Jiri Vanek ok/apply/cancel mechanism in itweb-settings fixed to work again. Added rest button for cache path. * netx/net/sourceforge/jnlp/config/InfrastructureFileDescriptor.java: added setValue and getFullPaths overloads with DeploymentConfiguration param to allow itweb-settings work with two copies of properties. * netx/net/sourceforge/jnlp/controlpanel/CachePane.java: returned config. Calls to PathsAndFiles made with this config. * netx/net/sourceforge/jnlp/controlpanel/CacheViewer.java: same * netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java: same * netx/net/sourceforge/jnlp/controlpanel/PolicyPanel.java: same * netx/net/sourceforge/jnlp/controlpanel/DebuggingPanel.java: Calls to PathsAndFiles made with config. * netx/net/sourceforge/jnlp/controlpanel/TemporaryInternetFilesPanel.java: usableDiskSpace removed, and replaced by dynamic getter to react on change of cache dir. Added button resting cache to default. 2015-04-10 Jiri Vanek Cache now uses PathsAndFiles instances instead of various duplicates * netx/net/sourceforge/jnlp/cache/CacheLRUWrapper.java: using InfrastructureFileDescriptor instead of copied Files. Same with recentlyUsedPropertiesFile. Both made final private and accessible only via getter. (getRecentlyUsedPropertiesFile) redesigned, to use cached PropertiesFile. If underlying InfrastructureFileDescriptor changes, the cached PropertiesFile is closed and new created and returned. * netx/net/sourceforge/jnlp/cache/CacheUtil.java: Are using getters from CacheLRUWrapper singleton to atomic approach. Not storing those values anymore. * netx/net/sourceforge/jnlp/config/InfrastructureFileDescriptor.java: Moved out from inner class in PathsAndFiles * netx/net/sourceforge/jnlp/config/PathsAndFiles.java:Lost InfrastructureFileDescriptor in favour of outer one. * netx/net/sourceforge/jnlp/controlpanel/AdvancedProxySettingsDialog.java: config made final * netx/net/sourceforge/jnlp/controlpanel/AdvancedProxySettingsPane.java: same * netx/net/sourceforge/jnlp/controlpanel/DesktopShortcutPanel.java: same * netx/net/sourceforge/jnlp/controlpanel/JVMPanel.java: same * netx/net/sourceforge/jnlp/controlpanel/SecuritySettingsPanel.java: same * netx/net/sourceforge/jnlp/controlpanel/CacheViewer.java: removed config * netx/net/sourceforge/jnlp/controlpanel/TemporaryInternetFilesPanel.java: adapted to above * netx/net/sourceforge/jnlp/runtime/JNLPProxySelector.java: moved to diamond * netx/net/sourceforge/jnlp/security/KeyStores.java: adapted to InfrastructureFileDescriptor * netx/net/sourceforge/jnlp/util/docprovider/ItwebSettingsTextsProvider.java: same * netx/net/sourceforge/jnlp/util/docprovider/TextsProvider.java: same * sun/applet/PluginProxySelector.java: same * tests/netx/unit/net/sourceforge/jnlp/security/KeyStoresTest.java: same * tests/test-extensions/net/sourceforge/jnlp/tools/DeploymentPropetiesModifier.java: same * tests/netx/unit/net/sourceforge/jnlp/cache/CacheLRUWrapperTest.java: is now using dummy InfrastructureFileDescriptor to allow fake CacheLRUWrapper tests * tests/netx/unit/net/sourceforge/jnlp/controlpanel/CommandLineTest.java: small fixes to unclear strings 2015-04-09 Lukasz Dracz fix lines displayed in javaws help * netx/net/sourceforge/jnlp/resources/Messages.properties: (JWSoptionsL1): modified (JWSoptionsL3): added * netx/net/sourceforge/jnlp/util/docprovider/JavaWsTextsProvider.java: added a third line for javaws help 2015-04-03 Lukasz Dracz Added tool for manipulating deployment-properties during tests run * tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/testcases/PartiallySignedAppletManifestSpecifiesSandboxTests.java: is now using DeploymentPropetiesModifier * tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/testcases/CodeBaseManifestEntrySignedMatching.java: same * tests/reproducers/signed/SignedAppletManifestSpecifiesSandbox/testcases/SignedAppletManifestSpecifiesSandboxTests.java: same * tests/test-extensions/net/sourceforge/jnlp/tools/DeploymentPropetiesModifier.java: new tool to manipulate deployment properties in runtime. 2015-04-02 Jiri Vanek InfrastructureFileDescriptor got setter * netx/net/sourceforge/jnlp/cache/CacheLRUWrapper.java: minor formatting * netx/net/sourceforge/jnlp/config/PathsAndFiles.java: all getFullPath replaced by getPropertiesKey, and instead of config, value, returns key. Added setValue, solution. Adapted getFullPath. (gcpd) removed. (getDir) removed - is now confusing. * netx/net/sourceforge/jnlp/controlpanel/DebuggingPanel.java: setter into property KEY_USER_LOG_DIR replaced by setter into LOG_DIR. * netx/net/sourceforge/jnlp/controlpanel/TemporaryInternetFilesPanel.java: same for KEY_USER_CACHE_DIR -> CACHE_DIR * netx/net/sourceforge/jnlp/util/docprovider/ItwebPluginTextProvider.java: All browser directories adapted to missing getDir. * tests/netx/unit/net/sourceforge/jnlp/PluginBridgeTest.java: KEY_USER_CACHE_DIR -> CACHE_DIR * tests/netx/unit/net/sourceforge/jnlp/cache/ResourceDownloaderTest.java: KEY_USER_CACHE_DIR -> CACHE_DIR * tests/netx/unit/net/sourceforge/jnlp/cache/ResourceTrackerTest.java: KEY_USER_CACHE_DIR -> CACHE_DIR 2015-04-02 Jiri Vanek All reading from file properties replaced by getter from PathsAndFiles * netx/net/sourceforge/jnlp/cache/CacheUtil.java: read from KEY_USER_NETX_RUNNING_FILE property replaced by get from MAIN_LOCK. * netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java: similarly for KEY_USER_PERSISTENCE_CACHE_DIR -> PCACHE_DIR and KEY_USER_LOG_DIR -> LOG_DIR and KEY_USER_TMP_DIR -> TMP_DIR * netx/net/sourceforge/jnlp/config/PathsAndFiles.java: added overrides of getFullPath to RECENTLY_USED_FILE, SYS_CER and all USER keystores. All fields in InfrastructureFileDescriptor made private final, and reasonable ones got protected setters. * netx/net/sourceforge/jnlp/controlpanel/CachePane.java: KEY_USER_CACHE_DIR -> CACHE_DIR, KEY_USER_NETX_RUNNING_FILE -> MAIN_LOCK. Config param removed. * netx/net/sourceforge/jnlp/controlpanel/CacheViewer.java: adapted to configless constructor * netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java: same * netx/net/sourceforge/jnlp/controlpanel/PolicyPanel.java: same * netx/net/sourceforge/jnlp/controlpanel/DebuggingPanel.java: KEY_USER_LOG_DIR -> LOG_DIR, config made final. * netx/net/sourceforge/jnlp/controlpanel/TemporaryInternetFilesPanel.java: removed redundant boxing, KEY_USER_CACHE_DIR -> CACHE_DIR * netx/net/sourceforge/jnlp/runtime/JNLPPolicy.java: KEY_USER_SECURITY_POLICY -> JAVA_POLICY. getPolicyFromConfig splited into getPolicyFromConfig and getPolicyFromUrl * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java: read from KEY_USER_NETX_RUNNING_FILE property replaced by get from MAIN_LOCK. * netx/net/sourceforge/jnlp/security/KeyStores.java: removed config field and its filling. (getKeyStoreLocation) all keystores properties replaced by correct PahtsAndFiles. * netx/net/sourceforge/jnlp/security/SecurityUtil.java: adapted to getKeyStoreLocation changed return type * netx/net/sourceforge/jnlp/security/dialogs/CertWarningPane.java: same * netx/net/sourceforge/jnlp/security/dialogs/TemporaryPermissionsButton.java: same * netx/net/sourceforge/jnlp/security/viewer/CertificatePane.java: same * netx/net/sourceforge/jnlp/services/SingleInstanceLock.java: KEY_USER_LOCKS_DIR -> LOCKS_DIR * netx/net/sourceforge/jnlp/services/XPersistenceService.java: KEY_USER_PERSISTENCE_CACHE_DIR -> PCACHE_DIR * netx/net/sourceforge/jnlp/util/XDesktopEntry.java: KEY_USER_TMP_DIR -> TMP_DIR * netx/net/sourceforge/jnlp/util/docprovider/TextsProvider.java: adapted to existence of file protocol by new method removeFileProtocol * netx/net/sourceforge/jnlp/util/logging/LogConfig.java: KEY_USER_LOG_DIR -> LOG_DIR * tests/netx/unit/net/sourceforge/jnlp/PluginBridgeTest.java: KEY_USER_CACHE_DIR -> CACHE_DIR * tests/netx/unit/net/sourceforge/jnlp/cache/ResourceDownloaderTest.java: same * tests/netx/unit/net/sourceforge/jnlp/cache/ResourceTrackerTest.java: same * tests/netx/unit/net/sourceforge/jnlp/security/KeyStoresTest.java: adapted to getKeyStoreLocation 2015-04-02 Jiri Vanek * tests/netx/unit/net/sourceforge/jnlp/security/KeyStoresTest.java: new file, added tests for getKeyStoreLocation API. * tests/netx/unit/net/sourceforge/jnlp/security/SecurityDialogsTest.java: minor cleanup on redundant autoboxing. 2015-04-01 Jiri Vanek PathsAndFiles definitions made aware of deployment.properties which can change them * netx/net/sourceforge/jnlp/cache/CacheLRUWrapper.java: (CacheLRUWrapper) used gette rinstead of field for RECENTLY_USED_FILE * netx/net/sourceforge/jnlp/config/Defaults.java: all getFullPath replaced by getDefaultFullPath. * netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java: removed read from properties and repalced by getters from PathsAndFiles. * netx/net/sourceforge/jnlp/controlpanel/CachePane.java: same * tests/reproducers/signed/CacheReproducer/testcases/CacheReproducerTest.java: same * netx/net/sourceforge/jnlp/config/PathsAndFiles.java: Or setup-able InfrastructureFileDescriptor now can return their non-default value by overriden getFullPath and reading from properties. * netx/net/sourceforge/jnlp/resources/Messages.properties: added BUTControlledBy of Controlled by and BUTmodified of modified * netx/net/sourceforge/jnlp/util/docprovider/TextsProvider.java: now uses new Messages.properties keys 2015-03-31 Jiri Vanek PolicyEditor now honor verbose switch * netx/net/sourceforge/jnlp/OptionsDefinitions.java: OPTIONS.VERBOSE added to list of PolicyEditor's commands * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditor: (main) set debug to true, if verbose is presented. 2015-03-31 Jiri Vanek * Messages.properties: (FILElogs) adapted to more suit current docs. 2015-03-25 Lukasz Dracz * tests/reproducers/custom/TrustedOnlyAttribute/testcases/TrustedOnlyAttributeTest.java: added BeforeClass and AfterClass hunks which adapt USER_DEPLOYMENT_FILE for test's needs. 2015-03-27 Jiri Vanek * Makefile.am: (stamps/generate-docs.stamp) fixed redundant false in version appearing in docs 2015-03-26 Lukasz Dracz fix clean to replace new Manifest Attributes messages * tests/reproducers/custom/remote/testcases/RemoteApplicationSettings.java: Changed clean to replace the two new Manifest Attributes Checker messages instead of the old deleted Manifest Attributes Checker message 2015-03-25 Lukasz Dracz Change Manifest Attributes Checker to check combinations of attributes * netx/net/sourceforge/jnlp/config/BasicValueValidators.java: Added MultipleStringValueValidator that validates single and combination of string values. Added ManifestAttributesCheckValidator uses MultipleStringValueValidator with the appropriate Manifest Attributes options * netx/net/sourceforge/jnlp/config/Defaults.java: Changed manifest attributes check validator to ManifestAttributesCheckValidator and made have default value of ALL * netx/net/sourceforge/jnlp/resources/Messages.properties: (MACDisabledMessage, MACCheckSkipped): added * netx/net/sourceforge/jnlp/runtime/ManifestAttributesChecker.java: MANIFEST_ATTRIBUTES_CHECK enum added, changed logic to allow combinations of attributes to be checked, Translator.R made into static import * tests/netx/unit/net/sourceforge/jnlp/config/BasicValueValidatorsTests.java: (testMultipleStringValueValidator, testMultipleStringValueValidatorCantMixSingleAndComboValues, testManifestAttributesCheckValidator): added * tests/netx/unit/net/sourceforge/jnlp/runtime/JNLPFileTest.java: Changed to work with new ManifestAttributesChecker, set to ALL which is equivalent to the old value of true * tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/testcases/PartiallySignedAppletManifestSpecifiesSandboxTests.java: Added BeforeClass and AfterClass handling of deployment.properties file to ensure PERMISSIONS and ALLOW_UNSIGNED are active for tests to pass then reverted to previous values for next tests * tests/reproducers/signed/SignedAppletManifestSpecifiesSandbox/testcases/SignedAppletManifestSpecifiesSandboxTests.java: Added BeforeClass and AfterClass handling of deployment.properties file to ensure PERMISSIONS is set for tests to pass then reverted to previous values for next tests 2015-03-23 Lukasz Dracz Fix itweb-settings set command to allow duplicate strings * netx/net/sourceforge/jnlp/controlpanel/CommandLine.java: Fixed a bug where the set command would only use the first of duplicate strings due to the use of index for sorting into keys and values * tests/netx/unit/net/sourceforge/jnlp/controlpanel/CommandLineTest.java: Added tests for set command 2015-03-18 Andrew Azores * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditor.java: (main) Fixed a bug where a local string variable was compared to the empty string using ==. 2015-03-18 Jiri Vanek * NEWS: mentioned documentation. -html and menu shortcuts moved to general. 2015-03-18 Jiri Vanek Added support for Entry-Point manifest * netx/net/sourceforge/jnlp/JNLPFile.java: defined ENTRY_POINT. Added methods to get raw manifest, or list of possible entry points. * netx/net/sourceforge/jnlp/runtime/ManifestAttributesChecker.java: Added logic to check real main class against manifest attribute. * tests/netx/unit/net/sourceforge/jnlp/JNLPFileTest.java: Existing tests made aware about Entry-Point. Added tests for splitEntryPoints. All occurences of claslaoder repalced by classloader. 2015-03-17 Jie Kang Escape apostrophes in Messages.properties * netx/net/sourceforge/jnlp/resources/Messages.properties: * netx/net/sourceforge/jnlp/resources/Messages_cs.properties: * netx/net/sourceforge/jnlp/resources/Messages_de.properties: Apostrophes escaped using two apostrophes as specified in MessageFormat java class. Used in Translator class to format values * tests/netx/unit/net/sourceforge/jnlp/runtime/TranslatorTest.java: Test added making sure escaped apostrophes work properly * tests/reprocers/signed/CodeBaseManifestEntrySignedMatching/testcases/CodeBaseManifestEntrySignedMatching.java: (getMessage) Uses MessageFormat to format values from Messages.properties 2015-03-17 Jiri Vanek Removed forgotten occurrence of netx-dist-tests-whitelist and so fixing make dist * Makefile.am: (EXTRA_DIST) lost netx-dist-tests-whitelist. 2015-03-17 Jie Kang Fix resource loading in CodebaseManifestEntry reproducers * tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/testcases/CodeBaseManifestEntrySignedMatching.java: Now uses Class.getResourceAsStream which will use system class loader if necessary 2015-03-13 Jiri Vanek Fixing xdg tests * netx/net/sourceforge/jnlp/config/PathsAndFiles.java: some elements made public - DEPLOYMENT_SUBDIR_DIR and XDG*VAR * tests/reproducers/simple/simpletest1/testcases/XDGspecificationTests.java: fixed issues with permissions attribute dialogue (faked deployment.properties everywhere), fixed issues with same key in set copmmand everywhere, added test for duplicated key in set, fixed issue with remianing icons and generated jnlps 2015-03-13 Jiri Vanek Docs now include possible options for each property * netx/net/sourceforge/jnlp/resources/Messages.properties: added key of IWSpossible * netx/net/sourceforge/jnlp/util/docprovider/ItwebSettingsTextsProvider.java: added hunk adding posibilites behainf each property 2015-03-13 Jiri Vanek * tests/reproducers/signed/GifarBase/resources/gifar_application.jnlp: removed dangling element * tests/reproducers/signed/GifarBase/srcs/GifarMain.java: formating * tests/reproducers/signed/GifarBase/testcases/GifarTestcases.java: used constants instead of hardcoded values * tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java: same 2015-03-10 Jiri Vanek Fixed locale tests * tests/reproducers/simple/LocalesTest/testcases/LocalesTestTest.java : not existing BOHelp replaced by BOHelp1. (getProperties) if used classlaoder is null then system one is used. 2015-03-10 Jiri Vanek Removed invalid URLs, empty codebases and enabled js tests for opera * tests/reproducers/simple/JSToJFuncParam/resources/jstoj-funcparam.jnlp * tests/reproducers/simple/JSToJFuncParam/testcases/JSToJFuncParamTest.java * tests/reproducers/simple/JSToJFuncResol/resources/jstoj-funcresol.jnlp * tests/reproducers/simple/JSToJFuncReturn/resources/jstoj-funcreturn.jnlp * tests/reproducers/simple/JSToJGet/resources/jstoj-get.jnlp * tests/reproducers/simple/JSToJGet/testcases/JSToJGetTest.java * tests/reproducers/simple/JSToJSet/resources/jstoj-set.jnlp * tests/reproducers/simple/JSToJSet/testcases/JSToJSetTest.java * tests/reproducers/simple/JSToJTypeConv/resources/jstoj-typeconv.jnlp * tests/reproducers/simple/JSToJTypeConv/testcases/JSToJTypeConvTest.java * tests/reproducers/simple/JToJSString/testcases/JToJSStringTest.java * tests/reproducers/simple/JavascriptFuncParam/resources/javascript-funcparam.jnlp * tests/reproducers/simple/JavascriptFuncParam/testcases/JavascriptFuncParamTest.java * tests/reproducers/simple/JavascriptFuncReturn/resources/JavascriptFuncReturn.jnlp * tests/reproducers/simple/JavascriptFuncReturn/testcases/JavascriptFuncReturnTest.java * tests/reproducers/simple/JavascriptGet/resources/javascript-get.jnlp * tests/reproducers/simple/JavascriptGet/testcases/JavascriptGetTest.java * tests/reproducers/simple/JavascriptSet/resources/javascript-set.jnlp * tests/reproducers/simple/JavascriptSet/testcases/JavascriptSetTest.java * tests/reproducers/simple/JavawsAWTRobotFindsButton/resources/javaws-awtrobot-finds-button.jnlp * tests/reproducers/simple/JavawsAWTRobotUsageSample/resources/javaws-awtrobot-usage-sample.jnlp 2015-03-05 Jie Kang Use jnlp_href parameter instead of attribute in applet tag for reproducers. This is to maintain compatibility with midori and epiphany browsers that don't support jnlp_href as an applet tag's attribute * tests/reproducer/simple/JSToJGet/resources/JSToJGet.html: * tests/reproducer/simple/JSToJSet/resources/JSToJSet.html: * tests/reproducer/simple/JavascriptFuncParam/resources/JavascriptFuncParam.html: * tests/reproducer/simple/JavascriptGet/resources/JavascriptGet.html: * tests/reproducer/simple/JavascriptSet/resources/JavascriptSet.html: All tests now use parameter tag for jnlp_href 2015-03-04 Jiri Vanek Fixed broken CacheUtil. * netx/net/sourceforge/jnlp/cache/CacheLRUWrapper.java: removed misleading one parameter constructor. * netx/net/sourceforge/jnlp/cache/CacheUtil.java: adapted to new CacheLRUWrapper * tests/netx/unit/net/sourceforge/jnlp/cache/CacheLRUWrapperTest.java: adapted to new constructor. 2015-03-03 Jiri Vanek Changing enum CacheLRUWrapper singleton to instantiatible one. recently_used moved to PathsAndFiles. * netx/net/sourceforge/jnlp/cache/CacheLRUWrapper.java: changed form enum to class. Added testing constructors. Fields encapsualted and made final. * netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java:is now using PathsAndFiles.CACHE_DIR * netx/net/sourceforge/jnlp/config/PathsAndFiles.java: defined CACHE_INDEX_FILE_NAME as recently_used and declared InfrastructureFileDescriptor RECENTLY_USED_FILE * netx/net/sourceforge/jnlp/controlpanel/CachePane.java: moved to PathsAndFiles * netx/net/sourceforge/jnlp/resources/Messages.properties: added description of RECENTLY_USED_FILE, FILErecentlyUsed * tests/netx/unit/net/sourceforge/jnlp/cache/CacheLRUWrapperTest.java: now using fake instance * tests/reproducers/signed/CacheReproducer/testcases/CacheReproducerTest.java: same + fixed 2015-03-03 Jiri Vanek Fixed CacheReproducerTest and VersionedJarTest tests * tests/reproducers/signed/CacheReproducer/testcases/CacheReproducerTest.java: fixed * tests/reproducers/simple/VersionedJar__V1/testcases/VersionedJarTest.java: fixed * tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java: introduced executeJavawsClearCache shortcut method to executeJavawsHeadless 2015-03-03 Jie Kang Fix DeadLockTest reproducers * tests/reproducers/simple/deadlocktest/testcases/DeadLockTestTest.java: (testSimpletest1lunchFork), (testSimpletest1lunchNoFork) removed division by two in final assert 2015-03-02 Jie Kang Use temporary cache in PluginBridge unit tests * tests/netx/unit/net/sourceforge/jnlp/PluginBridgeTest.java: sets temporary cache in @BeforeClass and unsets in @AfterClass 2015-02-27 Jiri Vanek Silenced to verbose unittests * netx/net/sourceforge/jnlp/cache/ResourceDownloader.java: refactored to use try-with-resources * tests/netx/unit/net/sourceforge/jnlp/PluginBridgeTest.java: become NoStdOutErrTest * tests/netx/unit/net/sourceforge/jnlp/cache/ResourceDownloaderTest.java: same * tests/netx/unit/net/sourceforge/jnlp/cache/ResourceTrackerTest.java: same * tests/netx/unit/net/sourceforge/jnlp/cache/ResourceUrlCreatorTest.java: same 2015-02-27 Jiri Vanek All manifests in reproducers' jars have now Application-Name attribute * Makefile.am: (stamps/netx-dist-tests-prepare-reproducers.stamp) added logic to include Application-Name: $reproducerName key: value to each non-custom manifest file * tests/reproducers/*/MANIFEST.MF*: all custom manifests enhanced by the same key: value. They do not relay on it. 2015-02-27 Jiri Vanek Fixed third party tests. * netx/net/sourceforge/jnlp/resources/Messages.properties: (JREversionDontMatch) don't changed to does not. The apostrophe was causing last variable to not expanding. * netx/net/sourceforge/jnlp/runtime/ManifestAttributesChecker.java: shared string moved to constant of MANIFEST_CHECK_DISABLED_MESSAGE * tests/reproducers/custom/remote/testcases/RemoteApplicationSettings.java: adapted to current state * tests/reproducers/custom/remote/testcases/RemoteApplicationTests.java: same 2015-02-25 Jiri Vanek * Makefile.am: netx-dist-tests-whitelist mad mandatory and will be removed 2015-02-24 Jiri Vanek Marking threads in ResourceTracker's threadPool as daemons, so the dont prevent shutdown. * netx/net/sourceforge/jnlp/cache/CachedDaemonThreadPoolProvider.java: new file, implementation of ExecutorService singleton, whose threads are daemons. * netx/net/sourceforge/jnlp/cache/ResourceTracker.java: (startDownloadThread) now calls CachedDaemonThreadPoolProvider 2015-02-18 Jiri Vanek Added menuentry to PolicyEditor to allow quicky open default java.policy * netx/net/sourceforge/jnlp/resources/Messages.properties: added keys of PEOpenDefaultMenuItem, PEOpenDefaultMenuItemMnemonic, PEOpenDefaultMenuItemAccelerator * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditor.java: added openDefaultButtonAction to open PathsAndFiles.JAVA_POLICY. Added openDefaultItem menu entry calling openDefaultButtonAction. 2015-02-17 Jie Kang Refactor initializeResources in ResourceDownloader. * netx/net/sourceforge/jnlp/cache/Resource.java: (isConnectable) new method checking if we can connect to the resources URL * netx/net/sourceforge/jnlp/cache/ResourceDownloader.java: (initializeResources), (initializeOnlineResource), (initializeFromURL), (initializeOfflineResource) refactored methods to handle offline and online cases separately * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java: (isConnectable) new method checking if we can connect to URL argument * tests/netx/unit/net/sourceforge/jnlp/cache/ResourceDownloaderTest.java: (testDownloadLocalResourceFails): test modified to expect error status on failure instead of uncaught exception 2015-02-13 Jiri Vanek Fixed few small errors in jacoco processing after removal of bootstrap. * Makefile.am: (JACOCO_CLASSPATH) changed to be space delimited, to be used via joinsegments. (JACOCO_OPERATOR_EXEC) using joinsegments on JACOCO_CLASSPATH. (UNIFIED_CLASSPATH) split to new *_SEGMENTS and call of joinsegments on it. Similarly with UNIFIED_JACOCO_CLASSPATH/(_SEGMENTS). Adapted PLUGIN_COVERAGE_BOOTCLASSPATH. (stamps/compile-jacoco-operator.stamp) uses composeclasspath on JACOCO_CLASSPATH. (stamps/compile-jacoco-operator.stamp) nw_bootclasspath adapted. (stamps/run-reproducers-test-code-coverage-jacoco.stamp) added missing comma in CLASSPATH=$(call joinsegment, ... ) call. 2015-02-13 Jie Kang * .hgignore: added netx-dist-tests-whitelist to prevent unintentional commits 2015-02-13 Jiri Vanek Added better support for not-matching detected jdk when version forced. * netx/net/sourceforge/jnlp/JREDesc.java: is using JreVersion instead of pure Version * netx/net/sourceforge/jnlp/Parser.java: (getJRE) JREDesc is constructed with JreVersion * netx/net/sourceforge/jnlp/Version.java: made immutable, added specialized inner class, tho handle JRE version. * /tests/netx/unit/net/sourceforge/jnlp/VersionTest.java: added tests for main cases cornerCases, testMatchesMinus, multiplePossibilities and tests for new class jreVersionTestOk, jreVersionTestFails1, jreVersionTestFails2. * netx/net/sourceforge/jnlp/resources/Messages.properties: added JRE family of warnings for JreVersion 2015-02-11 Jiri Vanek Saving/Loading of icon made resistant against URLs with invalid/without target * netx/net/sourceforge/jnlp/cache/CacheUtil.java: getCachedResource split into getCachedResourceFile and getCachedResourceURL (which is jsut transforming file from getCachedResourceFile to URL) * netx/net/sourceforge/jnlp/util/XDesktopEntry.java: (cacheIcon) calls to getCachedResource replaced by calls to getCachedResourceURL and added null checks. New method of cantCache to unify NonFileProtocolException throw. 2015-02-09 Jie Kang Fix javascript url error in JSToJSet reproducer. * tests/reproducers/simple/JSToJSet/resources/JSToJSet.html: added quotes around scriptable paramter. * tests/reproducers/simple/JSToJSet/resources/JSToJava_Set.js: decode url before using it * tests/reproducers/simple/JSToJSet/testcases/JSToJSetTest.java: KnownToFail annotations removed from tests that now pass correctly. 2015-02-06 Fridrich Strba Removed bootstrap, made buildable with modular JDK * AUTHORS: Fridrich added * Makefile.am: defined composeclasspath to create always valid classpath elements EMMA_JAVA_ARGS and EMMA_MODIFIED_FILES renamed to COVERAGE_JAVA_ARG and COVERAGE_MODIFIED_FILES. Removed RHINO_RUNTIME, BOOT_DIR. PLUGIN_RUNTIME renamed to PLUGIN_JAR. All manual constructions of classpath replaced by composeclasspath. All BOOT_ definition replaced by SYSTEM_JRE_DIR and SYSTEM_JDK_DIR. Removed all legacy emma targets. Removed all bootstrap targets. * acinclude.m4: added check for jdk9 * configure.ac: removed check for emma * plugin/icedteanp/IcedTeaNPPlugin.cc: added support for jdk9 mimetypes * tests/test-extensions/net/sourceforge/jnlp/tools/CodeSignerCreator.java: made aware of jdk9 2015-02-06 Jiri Vanek Also javaws.png icon is being installed in make install. * Makefile.am: declared ICONS_DEST_DIR with value pointing to icons dir (install-exec-local) ICONS_DEST_DIR added to list of created directories javaws.png installed into ICONS_DEST_DIR. (uninstall-local) javaws.png removed from ICONS_DEST_DIR. 2015-02-02 Omair Majid * configure.ac: Search for hamcrest jar. * Makefile.am: Initialize JUNIT_RUNTIME with JUNIT_JAR and/or HAMCREST_JAR. Adjust all code using JUNIT_JAR to use JUNIT_RUNTIME or HAMCREST_JAR explicitly. 2015-01-30 Jie Kang Remove KnownToFail annotation from JToJSString reproducer tests. * tests/reproducers/simple/JToJSString/testcases/JToJSStringTest.java: (StringArrayTest)(jnlpStringArrayAppletTest): annotations removed 2015-01-29 Jie Kang Fix accessing Java array elements from Javascript. PR1298. Fix provided by Marcin Cieslak * AUTHORS: Add Marcin Cieslak to authors. * NEWS: Add fix to news * plugin/icedteanp/IcedTeaPluginUtils.cc: (javaObjectResultToNPVariant) add jclass_name parameter to javaObjectResultToNPVariant function and use to determine type of object. 2015-01-28 Jie Kang Refactor initialize/download runnable out of ResourceTracker and add tests * netx/net/sourceforge/jnlp/cache/ResourceTracker.java: moved Downloader runnable into ResourceDownloader along with initialize and download functions and their sub-functions. Removed prefetchTracker system and queue. Moved downloadOptions into Resource.java. * netx/net/sourceforge/jnlp/cache/Resource.java: added downloadOptions field and getter/setter * netx/net/sourceforge/jnlp/cache/ResourceDownloader.java: (getUrlResponseCode), (getUrlResponseCodeWithRedirectonResult) (initializeResource), (findBestUrl), (downloadResource), (getDownloadConnection), (downloadPackGzFile), (downloadGZipFile), (downloadFile), (storeEntryFields), (writeDownloadToFile)(uncompressGzip), (uncompressPackGz): new Runnable class for initializing and downloading resources. Code from ResourceTracker.java * tests/netx/unit/net/sourceforge/jnlp/cache/ResourceTrackerTest.java: tests for downloading/initializing functions and their subfunctions moved to ResourceDownloaderTest.java * tests/netx/unit/net/sourceforge/jnlp/cache/ResourceDownloaderTest.java: relevant tests from ResourceTrackerTest.java moved here. (testDownloadResource), (testDownloadPackGzResource) (testDownloadVersionedResource), (testDownloadVersionedPackGzResource) (testDownloadLocalResourceFails), (testDownloadNotExistingResourceFails): New tests added 2014-01-23 Jiri Vanek Returned accidentally removed creation of shortcuts for jnlp applications. * netx/net/sourceforge/jnlp/security/dialogs/AccessWarningPane.java: filling of AccessWarningPaneComplexReturn no longer depnds on existence of htmlPanels. * netx/net/sourceforge/jnlp/util/XDesktopEntry.java: (BROWSERS) opera added to list of recognized browsers 2014-01-22 Jie Kang Add quotes to Docs paths in Makefile.am * Makefile.am:(install-data-local)(stamps/generate-docs.stamp) paths have quotes "" around them 2014-01-21 Lukasz Dracz Change PolicyEditor to use OptionParser * netx/net/sourceforge/jnlp/OptionsDefinitions.java * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditor.java: (argsToMap): removed * tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PolicyEditorTest.java: (testArgsToMap): removed 2014-12-20 Jiri Vanek Added -html switch for javaws to run applets out of browser in applets sandbox * Makefile.am: if plugin is enabled, then plugin.jar is placed to (both)classpaths * NEWS: mentioned -html switch * netx/net/sourceforge/jnlp/Launcher.java: removed unused imports * netx/net/sourceforge/jnlp/MalformedXMLParser.java: same, also (xmlizeInputStream) made public static * netx/net/sourceforge/jnlp/NetxPanel.java: used diamonds, constructor is accepting plugin bridge, appletInstance got geter, (ourRunLoader) initialize PuginBridge if it is not set in advance. Logic to init it. moved to separate method (init). * netx/net/sourceforge/jnlp/OptionsDefinitions.java: implemented -html. Now takes one or more args. * netx/net/sourceforge/jnlp/Parser.java: made public, static getUrl separated from internal getUrl. reused MalformedXMLParser and XMLParser classes moved to String constants. * netx/net/sourceforge/jnlp/PluginBridge.java: params made final and getter added. * netx/net/sourceforge/jnlp/PluginParameters.java: Removed hashtable * netx/net/sourceforge/jnlp/resources/Messages.properties: BNoCodeOrObjectApplet fixed (mentioned jnlp_href), added HTMLnoneFound, HTMLmoreThenOne. Adapted BOHtml * netx/net/sourceforge/jnlp/runtime/Boot.java: (getMainFile) now supports html init moved out of (run). Logic to lunch javaws moved to separate class * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: minor formating * netx/net/sourceforge/jnlp/util/optionparser/OptionParser.java: added fnuction to allow element addition to allow minor cheating if needed. * netx/net/sourceforge/nanoxml/XMLElement.java: removed hashtable, used diamonds, final and try-with-resources * netx/sun/applet/AppletViewerPanelAccess.java: Copied map to hashtable in super, added special hack to access AppletContext for out-of-browser applets. * plugin/icedteanp/java/sun/applet/PluginAppletPanelFactory.java: can pass PluginBridge inside. * plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java: removed hashtable, used string in switches, used diamonds * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java: some logic extracted to initialize. Removed hashtable. * plugin/icedteanp/java/sun/applet/PluginMain.java: Removed hashtable. Init logic moved to more methods (initSecurityContext). New method javawsHtmlMain to encapsulate all plugin.jar calls. * plugin/icedteanp/java/sun/applet/PluginStreamHandler.java: Added inner DummyHandler doing nothing for -html run. * tests/netx/unit/net/sourceforge/jnlp/PluginBridgeTest.java: final possible fields made final; * tests/netx/unit/net/sourceforge/jnlp/PluginParametersTest.java: hashtable removal. * netx/net/sourceforge/jnlp/JNLPSplashScreen.java: enabled hot swap of file, enabled switch to error screen. * netx/net/sourceforge/jnlp/runtime/HtmlBoot.java: new class, contains logic to lunch from html * netx/net/sourceforge/jnlp/runtime/JnlpBoot.java: new class, into which original logic from boot.run was moved. * netx/net/sourceforge/jnlp/runtime/html/AppletExtractor.java: new class, responsible for parsing of html page and search for applets * netx/net/sourceforge/jnlp/runtime/html/AppletParser.java: new class, responsible for construction of PluginBridge from parsed xml (applet-like) element * netx/net/sourceforge/jnlp/runtime/html/AppletsFilter.java: new class, responsible for providing correct applets from page * netx/net/sourceforge/jnlp/runtime/html/ElementValidator.java: new simple interface used for searching in html document, to fire if element is/is not appelt * netx/net/sourceforge/jnlp/util/Reflect.java: this class is long unused. removed. 2014-12-19 Jiri Vanek * NEWS: mentioned menus 2014-12-19 Lukasz Dracz IcedTea-Web settings made to use OptionParser * netx/net/sourceforge/jnlp/OptionsDefinitions: HELP split to HELP1 and HELP2 HELP1 for javaws and policyediotr, HELP2 for itweb settings. SET changed to EVEN_NUMBER_SUPPORTS_EQUALS_CHAR type. ItwebSettings added VERBOSE * netx/net/sourceforge/jnlp/controlpanel/CommandLine: Rewritten touse OptionParser Fixed usage of verbose. * netx/net/sourceforge/jnlp/resources/Messages.properties: adapted IBOList, IBOGet IBOInfo, IBOSet, IBOReset, IBOCheck. Added OPUnevenParams, CLUnexpectedNumberOfCommands. BOHelp removed, and replaced by its copy BOHelp1. Added BOHelp2. * netx/net/sourceforge/jnlp/resources/Messages_cs.properties: BOHelp removed, and replaced by its copy BOHelp1. * netx/net/sourceforge/jnlp/resources/Messages_de.properties: BOHelp removed, and replaced by its copy BOHelp1. * netx/net/sourceforge/jnlp/resources/Messages_pl.properties: BOHelp removed, and replaced by its copy BOHelp1. * netx/net/sourceforge/jnlp/runtime/Boot: Used HELP1, and UnevenParameterException * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditor: Used HELP1 * netx/net/sourceforge/jnlp/util/optionparser/OptionParser: Added handling of handleEvenNumberSupportingEqualsChar * netx/net/sourceforge/jnlp/util/optionparser/UnevenParameterException: new exception to be thrown in case of parsing of EVEN_NUMBER_SUPPORTS_EQUALS_CHAR * tests/netx/unit/net/sourceforge/jnlp/util/optionparser/OptionParserTest: Added tests for new functions 2014-12-19 Jie Kang * tests/test-extensions-tests/net/sourceforge/jnlp/TinyHttpdImplTest.java: added testLastModifiedHeader and testLastModifiedHeaderNotIncluded tests to test the LAs-Modified functionality in internal test server. 2014-12-18 Jiri Vanek Added support for generating shortcuts also for applets. * Makefile.am: javaws_bin and javaws_name passed to plugin * netx/net/sourceforge/jnlp/JNLPFile: (openURL) made public and added javadoc. Added unifying methods to generate title and vendor to be reused in jnlp and shortcuts: createJnlpVendorValue, createJnlpVendor, createJnlpTitleValue, createJnlpTitle. * netx/net/sourceforge/jnlp/OptionsDefinitions: Added unimplemented -html param * netx/net/sourceforge/jnlp/PluginBridge: able to be final fields made final. Jnlp href file is stored for debugging purposes. Added override annotations. Added possibility to generate jnlp xml file from itself (toJnlp). Added function (fixCommonIsuses) to enable usage of jnlpHref as mian jnlp file if used in shortcut. * netx/net/sourceforge/jnlp/config/PathsAndFiles: Declared GEN_JNLPS_DIR for saving generated jnlp shortcut. * netx/net/sourceforge/jnlp/resources/Messages.properties: declared ButAdvancedOptions, AlwaysForbidAction, BOHtml, FILEjnlps keys and whole family of EXAW keys. * netx/net/sourceforge/jnlp/runtime/ApplicationInstance: now use AccessWarningPaneComplexReturn instead of removed IconsCreationDescriptor. * netx/net/sourceforge/jnlp/security/SecurityDialogs: AccessWarningDialog family of methods adapted to handle boolean, integer and AccessWarningPaneComplexReturn * netx/net/sourceforge/jnlp/security/dialogs/AccessWarningPane: reworked to support controls of shortcut creation and saving buttons. * netx/net/sourceforge/jnlp/security/dialogs/AccessWarningPaneComplexReturn: New class to store information about shortcuts and saving of result. Used from AccessWarningPane instead of integer. * netx/net/sourceforge/jnlp/util/StreamUtils: added possibility to control encoding. * netx/net/sourceforge/jnlp/util/XDesktopEntry: Included possibility to create shrotcut from applet, based on the AccessWarningPaneComplexReturn. Is trying to use also favico if no more suitable icons found. * netx/net/sourceforge/jnlp/util/optionparser/OptionParser: added to-be-removed hack to die if -html is found. * plugin/icedteanp/IcedTeaNPPlugin.cc: made aware of JAVAWS_BIN and JAVAWS_NAME * tests/netx/unit/net/sourceforge/jnlp/PluginBridgeTest: tested class stripping and fixing of common issues. * tests/netx/unit/net/sourceforge/jnlp/cache/ResourceTrackerTest: backedUpStream made final. * tests/netx/unit/net/sourceforge/jnlp/util/logging/JavaConsoleTest: Fixed timezone depending test to be timezone independent. 2014-12-17 Jie Kang Fixed typo in Makefile.am for test-extensions-tests compilation * Makefile.am: 2014-12-12 Jiri Vanek JDK7 like refactroing of JNLPClassLoader * netx/net/sourceforge/jnlp/config/Defaults.java: KEY_STRICT_JNLP_CLASSLOADER added * netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java: deployment.jnlpclassloader.strict declared * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: minor refactoring, and usage of KEY_STRICT_JNLP_CLASSLOADER instead of hardcoded strict=true. 2014-12-08 Jie Kang Added last-modified information to TinyHttpdImpl * tests/test-extensions/net/sourceforge/jnlp/TinyHttpdImpl.java: (setSupportLastModified): used to set whether or not to return last-modified in header (isSupportingLastModified): whether or not currently returning last-modified (run): adds last-modified to header if enabled 2014-12-05 Jiri Vanek Added support for menu shortcuts. * netx/net/sourceforge/jnlp/Parser.java: used setMenu instead of addMenu * netx/net/sourceforge/jnlp/ShortcutDesc.java: removed isOnline support, added onDesktop and toMenu support. addMenu renamed to setMenu. Added deploymentJavawsShortcutToString, just for comfortableness. * netx/net/sourceforge/jnlp/config/PathsAndFiles.java: Added support for XDG_DATA_HOME, declared ICONS_DIR and MENUS_DIR * netx/net/sourceforge/jnlp/controlpanel/DesktopShortcutPanel.java: removed duplicated logic of deploymentJavawsShortcutToString/comboboxItem and hardcoded calls to deployment. * netx/net/sourceforge/jnlp/resources/Messages.properties: added CPTabMenuShortcuts, FILEicons, FILEmenus. adapted SDesktopShortcut * netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java: removed retired fixme, now it do not ask for shortcut creation if menu or desktop entry exists. Added menu support and removed not-implemented call. Added temporary IconsCreationDescriptor quick fix for dialog->logic information transfer. Used where needed. * netx/net/sourceforge/jnlp/security/SecurityDialogs.java: Added boolean and integer workarounds around showAccessWarningDialog * netx/net/sourceforge/jnlp/security/dialogs/AccessWarningPane.java: Added menu support. Is now coding more sophisticated return value if are about desktop creations. * netx/net/sourceforge/jnlp/services/ServiceUtil.java: Adapted to showAccessWarningDialog changes * netx/net/sourceforge/jnlp/util/FileUtils.java: INVALID_CHARS extended for more linux one and most windows ones. * netx/net/sourceforge/jnlp/util/XDesktopEntry.java: added logic to place menu shortcut. * tests/netx/unit/net/sourceforge/jnlp/ParserBasic.java: Is now testing only presence of isOnline instead if it is used. 2014-11-28 Jie Kang * tests/netx/unit/net/sourceforge/jnlp/cache/ResourceTrackerTest.java (testDownloadResource): new test for downloading basic resource 2014-11-25 Jiri Vanek * netx/net/sourceforge/jnlp/runtime/ManifestAttributesChecker.java: (checkAll) permissions attribute is now also skipped when attribute checks are disabled 2014-11-25 Jiri Vanek * netx/net/sourceforge/jnlp/Launcher.java: (fromUrl) file from href get substituted codebase from previous one if it is missing in new one. 2014-11-25 Jie Kang Fixed newly failing unit test: JavaConsoleTest:CreatePluginHeaderTestNotOK * tests/netx/unit/net/sourceforge/jnlp/util/logging/JavaConsoleTest.java (CreatePluginHeaderTestNotOK): Added a new failing string (CreatePluginHeaderTestOK): Old string from NotOk moved to this test 2014-11-19 Jiri Vanek Logging jnlp file into console * netx/net/sourceforge/jnlp/util/logging/ConsoleOutputPaneModel.java: is now html-like escaping lesser then and greater then chars * netx/net/sourceforge/nanoxml/XMLElement.java: instead of reprinting jnlp file to stdout, the line is gathered and logged via standard logger 2014-11-19 Jie Kang Fixed PluginMessage dates to use localized date from icedteanp-side. See PR2063 * netx/net/sourceforge/jnlp/util/logging/ConsoleOutputPaneModel.java: Sort-by-date compares using timestamp * netx/net/sourceforge/jnlp/util/logging/headers/Header.java: 'date' is a string for the localized date and 'timestamp' is a Date for sort-by-date comparison * netx/net/sourceforge/jnlp/util/logging/headers/PluginHeader.java: no longer has timestamp field, uses Header's timestamp field * netx/net/sourceforge/jnlp/util/logging/headers/PluginMessage.java: 'date' acquired directly from icedteanp-side (strftime) without formatting 2014-11-18 Jie Kang Added reproducer for packgz compressed applets. * acinclude.m4: Added check for pack200 in jdk bin * configure.ac: Added check of pack200 during configure * Makefile.am: Added use of pack200 if existing * netx/net/sourceforge/jnlp/PluginBridge: Added use of pack/version from jnlp file when launched through browser * tests/reproducers/custom/PackGZip/resources/PackGZip.jnlp: packgz reproducer * tests/reproducers/custom/PackGZip/resources/PackGZipApplet.html: * tests/reproducers/custom/PackGZip/resources/PackGZipJNLP.html: * tests/reproducers/custom/PackGZip/srcs/Makefile: * tests/reproducers/custom/PackGZip/srcs/PackGZip.java: * tests/reproducers/custom/PackGZip/testcases/PackGzipTest.java: 2014-11-14 Jiri Vanek http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2014-June/028399.html (long thread) * netx/net/sourceforge/jnlp/Launcher.java: using PropertyDesc.fromString to add resources. * netx/net/sourceforge/jnlp/PropertyDesc.java: New method fromString to handle parsing * netx/net/sourceforge/jnlp/runtime/Boot.java: is now merging the properties to main configuration. * tests/netx/unit/net/sourceforge/jnlp/PropertyDescTest.java: new file. Added tests for fromString. 2014-11-14 Jiri Vanek Making loading of PAC provider more lenient * netx/net/sourceforge/jnlp/runtime/PacEvaluatorFactory.java: (getPacEvaluator) changed to autocloseable, general Exception (instead IOException only) is catch. 2014-11-14 Jiri Vanek Connection factory fixed for offline usage * netx/net/sourceforge/jnlp/security/ConnectionFactory.java: (disconnect) got null check 2014-11-10 Jie Kang Refactored downloading of resources * netx/net/sourceforge/jnlp/cache/CacheEntry.java: added logging messages * netx/net/sourceforge/jnlp/cache/ResourceTracker.java (downloadResource): refactored into multiple methods (getDownloadConnection): new method to get and setup URLConnection (downloadPackGzFile): new method to download .pack.gz files (downloadGZipFile): new method to download .gz files (uncompressPackGz): new method to uncompress .pack.gz files (uncompressGZip): new method to uncompress .gz files (downloadFile): new method to download files (writeDownloadToFile): new method to write download into file, byte-by-byte (storeEntryFields): new method to store cache entry fields after download 2014-11-05 Lukasz Dracz Option parser refactored to use Parsed Option * netx/net/sourceforge/jnlp/OptionsDefinitions.java: enum EQUALS_CHAR removed, EVEN_NUMBER_OR_WITHEQUALCHAR renamed to EVEN_NUMBER_SUPPORTS_EQUALS_CHAR * netx/net/sourceforge/jnlp/resources/Messages.properties: * netx/net/sourceforge/jnlp/runtime/Boot.java: removed first check of JNLP option being not present * netx/net/sourceforge/jnlp/util/optionparser/OptionParser.java: refactored to use a List of ParsedOption instead of map, refactored parseContents to be split into smaller methods and made parsing more strict but easier to read/maintain (shouldAddParam, isOneArgumentNotFull, oneOrMoreArguments, addOptionToList, argumentToOption): added (getValue, getValues): renamed to (getParam, getParams) (findMainArg):removed, main args only looked for in parseContents * tests/netx/unit/net/sourceforge/jnlp/util/optionparser/OptionParserTest.java: removed tests that were no longer valid and added new ones based on the change in option parser functionality * netx/net/sourceforge/jnlp/util/optionparser/ParsedOption.java: added 2014-11-03 Jiri Vanek Get rid of @BOLD_OPEN@ and @BOLD_CLOSE@ in favor of and * netx/net/sourceforge/jnlp/resources/Messages.properties: ssia * netx/net/sourceforge/jnlp/util/docprovider/formatters/formatters/HtmlFormatter.java: now overrides process, as input is expected to be html (aka text with B tags). * netx/net/sourceforge/jnlp/util/docprovider/formatters/formatters/ReplacingTextFormatter.java: (process) using regexes to replace B tags * tests/netx/unit/net/sourceforge/jnlp/util/docprovider/formatters/formatters/ReplacingTextFormatterTest.java: adapted to new logic,added tests 2014-10-29 Jie Kang Configure switch for whitelist processing added. 'configure --enable-whitelist-processing': Process white-listed reproducers based on directory name and run all processed reproducers. 'configure': Process all reproducers and run reproducers white-listed on test-case name. * Makefile.am: support for --enable-whitelist-processing switch * configure.ac: added switch --enable-whitelist-processing 2014-10-24 Jiri Vanek Opening of connections moved into factory * netx/net/sourceforge/jnlp/cache/CacheUtil.java: * netx/net/sourceforge/jnlp/cache/ResourceTracker.java: * netx/net/sourceforge/jnlp/runtime/CachedJarFileCallback.java: * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java: all calls to url.openConnection(), replaced by ConnectionFactory.getConnectionFactory().openConnection(url) and all calls to if (conn instanceof HttpURLConnection){((HttpURLConnection)conn).disconnect();} by ConnectionFactory.getConnectionFactory().disconnect(conn); * netx/net/sourceforge/jnlp/security/ConnectionFactory.java: new class singleton responsible for opening and closing of connections. Have debugging feature to download https connections one by one (needs tweeking) 2014-10-21 Jiri Vanek Fixed case when already decoded file is wonted from cache (RH1154177) * netx/net/sourceforge/jnlp/cache/ResourceTracker.java: (getCacheFile) if all previous attempts to get cached file, plain url.getPath is tried. 2014-10-21 Jiri Vanek Unittests coverage adapted to latest jacoco * Makefile.am: (JACOCO_AGENT_SWITCH) is now using both JACOCO_ADVANCED_EXCLUDE) and inclbootstrapclasses=true too. (JACOCO_AGENT_JAVAWS_SWITCH) and (JACOCO_AGENT_PLUGIN_SWITCH) are using JACOCO_AGENT_SWITCH instead of copypasting values. 2014-10-21 Lukasz Dracz PolicyFileModel null file tests added * tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PolicyFileModelTest.java 2014-10-20 Jiri Vanek Added support for chromium binary (along with older chromium-browser one) * tests/test-extensions/net/sourceforge/jnlp/browsertesting/Browsers.java: (static) check if legacy chromium-browser do exists. If so use it, otherwise use newer chromium only 2014-10-20 Jiri Vanek Support only @BOLD_OPEN@ and @BOLD_CLOSE@ in documentation * netx/net/sourceforge/jnlp/util/docprovider/PolicyEditorTextsProvider.java: Replace @@ usage by calls to methods * netx/net/sourceforge/jnlp/util/docprovider/TextsProvider.java: same * netx/net/sourceforge/jnlp/util/docprovider/formatters/formatters/Formatter.java: added license * netx/net/sourceforge/jnlp/util/docprovider/formatters/formatters/HtmlFormatter.java: same * netx/net/sourceforge/jnlp/util/docprovider/formatters/formatters/ManFormatter.java: same * netx/net/sourceforge/jnlp/util/docprovider/formatters/formatters/ReplacingTextFormatter.java: Added license. (process) All but @BOLD_OPEN@ and @BOLD_CLOSE@ support removed * tests/netx/unit/net/sourceforge/jnlp/util/docprovider/formatters/formatters/ReplacingTextFormatterTest.java Added test for process method 2014-10-17 Jiri Vanek Jacoco boot class loading moved from custom built to upstreamed form * Makefile.am: (JACOCO_AGENT_JAVAWS_SWITCH) and (JACOCO_AGENT_PLUGIN_SWITCH) moved from xboot=true to inclbootstrapclasses=true which is now supported by upstream. 2014-10-17 Jiri Vanek Plain and main text formatters have more human readable urls * netx/net/sourceforge/jnlp/util/docprovider/formatters/formatters/Formatter.java: only added formatting line * netx/net/sourceforge/jnlp/util/docprovider/formatters/formatters/ManFormatter.java: removed overriding getUrl * netx/net/sourceforge/jnlp/util/docprovider/formatters/formatters/PlainTextFormatter.java: same * netx/net/sourceforge/jnlp/util/docprovider/formatters/formatters/ReplacingTextFormatter.java Implemented general getUrl for plaintexts in format readable (url), except cases where readable do not exists or is same as url. 2014-10-17 Jiri Vanek Fixed jdk8 javadoc generation error * netx/net/sourceforge/jnlp/controlpanel/CommandLine.java: invalid link #allCommands replaced by plain optionsDefinitions.getItwsettingsCommands 2014-10-13 Fridrich Strba Removed all references to deprecated sun.misc.Ref * configure.ac: removed check for a sun.misc.Ref * netx/net/sourceforge/jnlp/util/ui/NonEditableTableModel.java: all occurrences of Vector replaced by Vector. JDK9 compliant style. * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java: (getCachedImageRef) type of return value changed from Ref to AppletImageRef. Adapted imports. 2014-10-09 Jiri Vanek Empty "" codebase now behaves as "." codebase * file netx/net/sourceforge/jnlp/Parser.java: introduced CODEBASE constant to avoid duplicated String getAttribute split to getCleanAttribute, which get the pure attribute, and remaining getAttribute keep adding null in case of empty * file netx/net/sourceforge/jnlp/security/SecurityDialogs.java: added workaround about possible null codebase * file tests/netx/unit/net/sourceforge/jnlp/ParserTest.java: added test for empty codebase 2014-10-08 Lukasz Dracz Standardize all options to use hyphens * netx/net/sourceforge/jnlp/OptionsDefinitions.java: itweb-settings options changed to have hyphens in front, added new enum to NumberOfArguments (getItwsettingsCommands): added headless, changed nodashhelp to help * netx/net/sourceforge/jnlp/controlpanel/CommandLine.java * netx/net/sourceforge/jnlp/resources/Messages.properties: (BOHelp, IBOCheck): modified (NOAevennumberorequalschar): added 2014-10-08 Jiri Vanek itw-plugin and itweb-settings documentation made localizable * Makefile.am: documentation root (DOCS_DIR) is now icedtea-web-docs/$(FULL_VERSION) (install-data-local) now can copy all man pages more simply and from new DOCS_DIR (stamps/generate-docs.stamp) is adapted to new DOCS_DIR * netx/net/sourceforge/jnlp/controlpanel/NetworkSettingsPanel.java: minor fixes like removal of redeclared deployment properties and switch on strings * netx/net/sourceforge/jnlp/resources/Messages.properties: added missing brackets behind @@ hints, all icedtea-web replaced by IcedTea-Web, (CBCheckOkSignedOk) removed double space, added families of ITWS and ITWP * netx/net/sourceforge/jnlp/util/docprovider/ItwebPluginTextProvider.java: and * netx/net/sourceforge/jnlp/util/docprovider/ItwebSettingsTextsProvider.java: all texts moved to properties 2014-10-07 Jie Kang Modified unit tests for CacheEntry and CacheLRUWrapper to prevent blocking. * netx/net/sourceforge/jnlp/cache/CacheEntry.java: comments for unlocking * netx/net/sourceforge/jnlp/util/PropertiesFile.java: same * netx/net/sourceforge/jnlp/util/lockingfile/LockedFile.java: same * tests/netx/unit/net/sourceforge/jnlp/cache/CacheEntryTest.java: fixed multi-threaded tests to prevent blocking, and added timeout to threaded tests to prevent tests from blocking test runs * tests/netx/unit/net/sourceforge/jnlp/cache/CacheLRUWrapperTest.java: same * tests/netx/unit/net/sourceforge/jnlp/cache/CacheTestUtils.java: utilities for cache tests 2014-10-07 Jie Kang Changed ResourceTracker to use cached thread pool as opposed to manual thread management * netx/net/sourceforge/jnlp/cache/ResourceTracker.java: 2014-10-07 Jiri Vanek Files, arguments types and icedtea-web man page made localizable * netx/net/sourceforge/jnlp/OptionsDefinitions.java: (NumberOfArguments) sentences moved to properties * netx/net/sourceforge/jnlp/config/PathsAndFiles.java: same * netx/net/sourceforge/jnlp/util/docprovider/IcedTeaWebTextsProvider.java: same * netx/net/sourceforge/jnlp/resources/Messages.properties: added families of ITW, NOA and FILE * netx/net/sourceforge/jnlp/util/docprovider/formatters/formatters/Formatter.java: added getNewLine override with argument, number of new lines to be generated * netx/net/sourceforge/jnlp/util/docprovider/formatters/formatters/ReplacingTextFormatter.java getNewLine(int i) implemented * tests/netx/unit/net/sourceforge/jnlp/util/docprovider/formatters/formatters/FormatterTest.java getNewLine(int i) tested for all formatters 2014-10-07 Jiri Vanek Option parser now accept 0-n hyphens * launcher/launchers.in: regex matching for headless changed to * instead of 0-1 * netx/net/sourceforge/jnlp/util/optionparser/OptionParser.java: added new method to removeLeadingHyphens. (stringEqualsOption) now sanitize both inputs by it. * tests/netx/unit/net/sourceforge/jnlp/util/optionparser/OptionParserTest.java: Added tests to verify none or more leading hyphens are correctly recognized. Added tests to verify hyphens elsewhere will not confuse parser. 2014-10-03 Lukasz Dracz IcedTea-Web Splashscreen allows zero or one hyphens preceding headless option * launcher/launchers.in: regex matching for headless 2014-09-22 Jiri Vanek Preventing rare class cast exception in erroneous detached applets * netx/net/sourceforge/jnlp/runtime/AppletEnvironment.java: getSplashControler renamed to getSplashController. (getSplashController) added check for SplashController instance. Returning null if not so. * netx/net/sourceforge/jnlp/splashscreen/SplashUtils.java: adapted to renaming * tests/netx/unit/net/sourceforge/jnlp/splashscreen/SplashUtilsTest.java: added (assertNulsAreOkInShow) test to check null values for showError methods 2014-09-19 Jie Kang Modified Makefile.am to use whitelist when processing reproducers. * Makefile.am: Now filters reproducers using netx-dist-tests-whitelist 2014-09-19 Jie Kang Added three keys to DeploymentConfiguration. Max cache size, cache enable, and cache compression enable. * netx/net/sourceforge/jnlp/CacheUtil.java: now uses keys * netx/net/sourceforge/jnlp/controlpanel/TemporaryInternetFilesPanel.java: now uses keys * netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java: 2014-09-19 Jiri Vanek Translator made immutable * netx/net/sourceforge/jnlp/runtime/Translator.java: changed form enum to class, initialization handled by holder pattern, resources made final, removed loadResourceBundle, getMessage made protected. * tests/netx/unit/net/sourceforge/jnlp/runtime/TranslatorTest.java: (setup) (and all tests) now uses special instance based on fake resources. Added two tests to test singleton instance itself. 2014-09-18 Lukasz Dracz Added New Option Parser and used in boot of javaws * netx/net/sourceforge/jnlp/Launcher.java: (addProperties, addArguments, addParameters) refactored to take in a List instead of String[] * netx/net/sourceforge/jnlp/OptionsDefinitions.java: added JNLP to enum OPTIONS * netx/net/sourceforge/jnlp/ParserSettings.java (setGlobalParserSettingsFromOptionParser): refactored to take in an OptionParser instead of args * netx/net/sourceforge/jnlp/runtime/Boot.java: Uses OptionParser to parse arguments for options and check whether an option is present. (getJNLPFile): changed to use OptionParser, and look for one main argument or one value from the JNLP option, if not present then throws an InvalidArgumentException * netx/net/sourceforge/jnlp/util/optionparser/InvalidArgumentException.java: added * netx/net/sourceforge/jnlp/util/optionparser/OptionParser.java: new file, a common parser for options and their values (parseContents): called in OptionParser constructor, parses and populates values in a map based on their option (findMainArg): Takes arguments and parses them backwards to find the first value that is eligible to be a main arg (not an option or a value for an option with one value) (addMainArg): adds the specified arg to main and removes it from its current placement in the map (stringEqualsOption): used to determine whether a string fits an option keyword irrespective if it has a leading dash or is followed by a equals char * tests/netx/unit/net/sourceforge/jnlp/ParserSettingsTest.java: (testSetGlobalParserSettingsFromOptionParser, testSetGlobalParserSettingsFromOptionParserHasSameOptionsAsOptionParser): added * tests/netx/unit/net/sourceforge/jnlp/util/optionparser/OptionParserTest.java: new file to test parser works as intended 2014-09-17 Jiri Vanek Javaws and PolicyEditor made localizable * Makefile.am: usage of $TP_TAIL fixed to be correctly $$TP_TAIL * netx/net/sourceforge/jnlp/resources/Messages.properties: added PE and JWS families * netx/net/sourceforge/jnlp/util/docprovider/JavaWsTextsProvider.java: and * netx/net/sourceforge/jnlp/util/docprovider/PolicyEditorTextsProvider.java: all strings moved to properties. Minor reformatting. 2014-09-15 Lukasz Dracz Fix itweb-settings Cache Panel Tooltip * netx/net/sourceforge/jnlp/controlpanel/TemporaryInternetFilesPanel.java: Tooltip appears when spinner is enabled and hovered over * netx/net/sourceforge/jnlp/resources/Messages.properties: Removed not needed html tags 2014-09-15 Jie Kang Moved translator responsibility from JNLPRuntime to Translator * netx/net/sourceforge/jnlp/runtime/Translator.java: * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java: (getMessage): moved from JNLPRuntime to Translator * netx/net/sourceforge/jnlp/runtime/TranslatorTest.java: added tests for translating using a ResourceBundle 2014-09-15 Jie Kang * netx/net/sourceforge/jnlp/cache/CacheLRUWrapper.java (getLRUSortedEntries): now creates a deeper copy of cacheOrder list 2014-09-13 Andrew Azores * netx/net/sourceforge/jnlp/resources/Messages.properties (CertWarnHTTPSAcceptTip, CertWarnHTTPSRejectTip): new messages more applicable for HTTPS cert warning dialogs * netx/net/sourceforge/jnlp/security/dialogs/CertWarningPane.java: distinguish between HTTPS cert warnings and signed applet cert warnings. Display appropriate text labels and buttons corresponding to either case. * netx/net/sourceforge/jnlp/security/dialogs/TemporaryPermissionsButton.java: remove assertions for non-null file, securityDelegate, and linkedButton. Instead, if any are null, simply disable this component and do not add component listeners dependent upon these fields. 2014-09-10 Lukasz Dracz Refactor of the cache panel GUI in itweb-settings * netx/net/sourceforge/jnlp/controlpanel/TemporaryInternetFilesPanel.java: Changed slider into a spinner for cache size, changed order of elements in the panel, added a checkbox to limit the cache size, added disabling of components based on whether they are needed * netx/net/sourceforge/jnlp/resources/Messages.properties 2014-09-10 Jie Kang Changed CacheLRUWrapper to use PropertiesFile's provided locking system Added unit tests for CacheLRUWrapper * netx/net/sourceforge/jnlp/cache/CacheLRUWrapper.java * tests/netx/unit/net/sourceforge/jnlp/cache/CacheLRUWrapperTest.java 2014-09-10 Jie Kang Added unit tests to PropertiesFile.java and refactored existing unit tests to not use external code. * tests/netx/unit/net/sourceforge/jnlp/util/PopertiesFileTest.java 2014-09-09 Jiri Vanek Outdated documentation replaced by documentation generation * Makefile.am: added (DOCS_DIR) pointing to target directory for generated docs (clean-local) and (.PHONY) now cleaning also clean-generated-docs (install-data-local) removed usage of old man pages, copied all generated man pages (uninstall-local) added removal of javaws_splash.png, all known man pages cleaned (stamps/generate-docs.stamp) new target, generates all known language mutations of all known man pages to correct directories. (stamps/netx-dist.stamp) depends on stamps/generate-docs.stamp (clean-generated-docs) new target, removes DOCS_DIR and stamp * netx/itweb-settings.1: removed * netx/javaws.1: removed * netx/policyeditor.1: removed * netx/net/sourceforge/jnlp/OptionsDefinitions.java: new class, contains definitions of all command-line arguments * netx/net/sourceforge/jnlp/about/AboutDialog.java:improved to contains window with generated localized help. Default welcome screen points to localized mutation (if available). Loading of pages made lazy, and only once per app. run. Added possibility to chose start page. * netx/net/sourceforge/jnlp/about/HTMLPanel.java: get rid of useless id * netx/net/sourceforge/jnlp/about/InternalHTMLPanel.java: extension of HTMLPanel, links are pointing to internal window (in HTMLPanel points to external browser) * netx/net/sourceforge/jnlp/config/Defaults.java: All files declarations moved to PathsAndFiles. Defaults array now uses those. Iteration in defaults now done by iterator. * netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java: All files declarations moved to PathsAndFiles. Configuration now uses those. * netx/net/sourceforge/jnlp/config/PathsAndFiles.java: New file. Gathers all files declared in ITW. * netx/net/sourceforge/jnlp/config/Setting.java: added human readable toString * netx/net/sourceforge/jnlp/controlpanel/AboutPanel.java: set origin - itweb-settings. * netx/net/sourceforge/jnlp/controlpanel/CommandLine.java: options now uses OptionsDefinitions and runtime help now uses TextsProvider's instances. * netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java: uses PathsAndFiles * netx/net/sourceforge/jnlp/resources/Messages.properties: BOUsage and BOUsage2 stripped for javaws keyword. Added (BOTrustnone), added IBO and PBO and man families. Removed PEUsage PEHelpFlag PEFileFlag PECodebaseFlag, PEAboutDialogTitle PEAboutDialogContent CLHelpDescription SPLASHurl SPLASHurlLooks. All urls replaced by variables. * netx/net/sourceforge/jnlp/resources/Messages_cs.properties: fixed BAboutITW,rmeove * netx/net/sourceforge/jnlp/resources/Messages_de.properties: same * netx/net/sourceforge/jnlp/resources/Messages_pl.properties: same * netx/net/sourceforge/jnlp/resources/about.html: removed. replaced by generated, and localized one. * netx/net/sourceforge/jnlp/runtime/Boot.java: Handling of verbose moved to be one of first switches. All runtime helps moved to TextsProvider's instances. * netx/net/sourceforge/jnlp/security/appletextendedsecurity/ExtendedAppletSecurityHelp.java: added parameter so (R). * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditor.java: All runtime helps moved to TextsProvider's instances. About policy editor replaced by About.help Modality of About dialog recognized on state of underlying dialogue. Added About icedtea-web menu entry. * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditorAboutDialog.java: removed unused (title) * netx/net/sourceforge/jnlp/splashscreen/impls/DefaultSplashScreens2012Commons.java: AboutDialog displayed with reason * netx/net/sourceforge/jnlp/splashscreen/parts/JEditorPaneBasedExceptionDialog.java: Links here replaced by TextsProviders constants. * netx/net/sourceforge/jnlp/util/docprovider/IcedTeaWebTextsProvider.java: implementation of TextsProvider for icedtea-web package * netx/net/sourceforge/jnlp/util/docprovider/ItwebPluginTextProvider.java: implementation of TextsProvider for plugin * netx/net/sourceforge/jnlp/util/docprovider/ItwebSettingsTextsProvider.java implementation of TextsProvider for itweb-settings * netx/net/sourceforge/jnlp/util/docprovider/JavaWsTextsProvider.java implementation of TextsProvider for javaws * netx/net/sourceforge/jnlp/util/docprovider/PolicyEditorTextsProvider.java implementation of TextsProvider for policy editor * netx/net/sourceforge/jnlp/util/docprovider/TextsProvider.java: New abstract class to handle basic operations on texts and defining abstract methods. * netx/net/sourceforge/jnlp/util/docprovider/formatters/formatters/Formatter.java Definition interface for any Formatter used by TextsProvider * netx/net/sourceforge/jnlp/util/docprovider/formatters/formatters/HtmlFormatter.java html markup adding Formatter * netx/net/sourceforge/jnlp/util/docprovider/formatters/formatters/ManFormatter.java man pages markup adding Formatter * netx/net/sourceforge/jnlp/util/docprovider/formatters/formatters/PlainTextFormatter.java no markup adding Formatter * netx/net/sourceforge/jnlp/util/docprovider/formatters/formatters/ReplacingTextFormatter.java Stub for all formatters needing text substituitons. * netx/net/sourceforge/jnlp/util/logging/UnixSystemLog.java: Links here replaced by TextsProviders constants. 2014-09-02 Jie Kang Fixed CacheUtils clearCache method to also clear the Least Recently Used entries. * netx/net/sourceforge/jnlp/cache/CacheUtil.java: 2014-08-20 Jie Kang Improved CacheEntry locking system to respect threads and processes. * netx/net/sourceforge/jnlp/cache/CacheEntry.java (lock), (unlock): now uses PropertiesFile lock instead of CacheUtil (tryLock), (isHeldByCurrentThread): added functions * netx/net/sourceforge/jnlp/cache/CacheLRUWrapper.java: moved unlock calls into finally blocks * netx/net/sourceforge/jnlp/cache/CacheUtil.java: lock and unlock no longer needed and are removed * netx/net/sourceforge/jnlp/util/PropertiesFile.java: now uses LockedFile and has methods to lock/trylock/unlock. * netx/net/sourceforge/jnlp/util/LockedFile.java (tryLock), (isHeldByCurrentThread): added functions (unlock): no longer attempts unlock unless lock is held by current thread and process * tests/netx/unit/net/sourceforge/jnlp/cache/CacheEntryTest.java: 6 new tests for the locking mechanism (testLock), (testUnlock), (testStoreFailsWithoutLock), (testStoreWorksWithLock), (testMultithreadLockPreventsWrite), (testMultithreadLockAllowsRead) * tests/netx/unit/net/sourceforge/jnlp/cache/CacheLRUWrapperTest.java: moved unlock calls into finally blocks 2014-08-20 Jie Kang Renamed Resource Status Enum fields to better describe their meaning. CONNECT is now PRECONNECT, DOWNLOAD is now PREDOWNLOAD and STARTED is now PROCESSING. * netx/net/sourceforge/jnlp/cache/Resource.java: rename enum usages * netx/net/sourceforge/jnlp/cache/ResourceTracker.java: same * tests/netx/unit/net/sourceforge/jnlp/cache/ResourceTest.java: same * tests/netx/unit/net/sourceforge/jnlp/cache/ResourceTrackerTest.java: same 2014-08-05 Jiri Vanek Massively improved offline abilities. Added Xoffline switch to force work without inet connection. * NEWS: updated * netx/net/sourceforge/jnlp/JNLPFile.java: (openURL) is now using properly cached file instead of direct online one. * netx/net/sourceforge/jnlp/Launcher.java: launcher now can run offline-only jnlp files if Xoffline specified. * netx/net/sourceforge/jnlp/cache/CacheUtil.java: removed suspicious removal of http/https dirs in cache * netx/net/sourceforge/jnlp/cache/ResourceTracker.java: misleading (getInputStream) method removed (initializeResource) check for connection before downlaodin (unless Xforceoffline specified). If environment is offline it do not attempt any url connections or writing to cache * netx/net/sourceforge/jnlp/resources/Messages.properties: added (BXoffline) description * netx/net/sourceforge/jnlp/runtime/Boot.java: added help and read for Xoffline * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java: added flags of (offlineForced) and (onlineDetected) with getters and setters. Added utility method (detectOnline) to recognize whether environment is onliune by resovling inet addres of host of not file url. * netx/net/sourceforge/jnlp/services/XBasicService.java: (isOffline) now uses above implemented mechanism. * netx/net/sourceforge/jnlp/util/XDesktopEntry.java: now writes real url into desktop icon 2014-08-05 Andrew Azores Lukasz Dracz Refactored copy paste to use System Clipboard in PolicyEditor. Parsing refactored to use Strings instead of requiring a file. * netx/net/sourceforge/jnlp/resources/Messages.properties (PEClipboardError, PEInvalidPolicy, PEClipboardAccessError): added * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditor.java (renameCodebaseButtonAction, copyCodebaseButtonAction, pasteCodebaseButtonAction): changed functionality to call methods from PolicyEditorController that use system clipboard * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditorController.java (addPolicyEntry): added (openAndParsePolicyFile): throws new exception InvalidPolicyException (copyCodebaseToClipboard, getClipboardContentAsString, getPolicyEntryFromClipboard, getCodebaseFromClipboard, getPermissionsFromClipboard, getCustomPermissionsFromClipboard): new methods * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEntry.java (getCodebase, getPermissions, getCustomPermissions, fromString, validatePolicy): new overloaded methods * netx/net/sourceforge/jnlp/security/policyeditor/PolicyFileModel.java all methods made synchronized (openAndParsePolicyFile): extracted and modified parsing logic (parsePolicyString): new method (clearPermissions): also clears Custom Permissions now * netx/net/sourceforge/jnlp/security/policyeditor/InvalidPolicyException.java: added new exception * netx/net/sourceforge/jnlp/security/policyeditor/CustomPermission.java (equals, hashCode): Override these methods to be able to compare custom permissions. New constructors for custom permission, one of the constructors takes only PermissionType, PermissionTarget and the other takes an additional PermissionActions * tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/CustomPermissionTest.java, * tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PolicyEditorParsingTest.java, * tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PolicyEditorTest.java, * tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PolicyEditorControllerTest.java, * tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PolicyEntryTest.java, * tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PolicyFileModelTest.java: added new unit tests 2014-08-05 Andrew Azores Small bug fix (security hole) for previous PR1769 patch. This patch closes a hole where very specifically formulated partially signed applets could maintain fully signed privileges (all-permissions), even for their unsigned components. * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java (initializeResources): ensure that the 'signing' field is properly set for partially signed applets and that applets with an external main class are properly detected. 2014-08-01 Andrew Azores Fixed support for signed applets which specify the Permissions attribute as "sandbox" in their manifests. These applets are now properly run sandboxed automatically, rather than requiring the user to click the "Sandbox" run button. * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java (JNLPClassLoader): manifest attributes checking and security settings moved inside initializeResources (initializePermissions): renamed (initializeReadJarPermissions). Redundant null-check removed (initializeResources): do not set entries in jarLocationSecurityMap until after prompting the user on whether to run the applet as well as performing manifest attribute checks. A new Collection (validJars) is used to hold available and valid JARs between discovering the JARs and applying any security settings to the them (initializeManifestAttributesChecker): new method (getJnlpFileCodebase): new method, extracted from initializeResources (SecurityDelegateImpl.setRunInSandbox): throw exception if already forced to run in sandbox, rather than if already prompted * netx/net/sourceforge/jnlp/runtime/ManifestAttributesChecker.java (isLowSecurity): new method (checkAll): Extended Applet Security on Low disables all manifest checks except for Permissions (checkPermissionsAttribute): do not skip checking if Extended Applet Security is Low. Remove try/catch on setRunInSandbox call as this is now supported. (checkApplicationLibraryAllowableCodebaseAttribute): do not display dialog prompts on low security, allow the applet to run without prompt * tests/netx/unit/net/sourceforge/jnlp/runtime/JNLPFileTest.java (newSecurityAttributesTest): set JAR manifest to have Permissions: all-permissions, since this is a JNLP and JAR is signed and so 'sandbox' is not actually allowed * tests/test-extensions/net/sourceforge/jnlp/mock/DummyJNLPFile.java: properly initialize 'security' field rather than overriding getSecurity * tests/test-extensions/net/sourceforge/jnlp/mock/DummyJNLPFileWithJar.java: same * tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/PartiallySignedAppletManifestSpecifiesAllPermissionSigned.html: new tests * tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/PartiallySignedAppletManifestSpecifiesAllPermissionSigned.jnlp * tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/PartiallySignedAppletManifestSpecifiesAllPermissionSignedJNLPhref.html * tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/PartiallySignedAppletManifestSpecifiesAllPermissionUnsigned.html * tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/PartiallySignedAppletManifestSpecifiesAllPermissionUnsigned.jnlp * tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/PartiallySignedAppletManifestSpecifiesAllPermissionUnsignedJNLPhref.html * tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/PartiallySignedAppletManifestSpecifiesSandboxSigned.html * tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/PartiallySignedAppletManifestSpecifiesSandboxSigned.jnlp * tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/PartiallySignedAppletManifestSpecifiesSandboxSignedJNLPhref.html * tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/PartiallySignedAppletManifestSpecifiesSandboxUnsigned.html * tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/PartiallySignedAppletManifestSpecifiesSandboxUnsigned.jnlp * tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/PartiallySignedAppletManifestSpecifiesSandboxUnsignedJNLPhref.html * tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/PartiallySignedApplicationManifestSpecifiesAllPermissionSigned.jnlp * tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/PartiallySignedApplicationManifestSpecifiesAllPermissionUnsigned.jnlp * tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/PartiallySignedApplicationManifestSpecifiesSandboxSigned.jnlp * tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/resources/PartiallySignedApplicationManifestSpecifiesSandboxUnsigned.jnlp * tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/srcs/MANIFEST.MF.1 * tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/srcs/MANIFEST.MF.2 * tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/srcs/Makefile * tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/srcs/PartiallySignedAppletManifestSpecifiesSandboxSigned.java * tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/srcs/PartiallySignedAppletManifestSpecifiesSandboxUnsigned.java * tests/reproducers/custom/PartiallySignedAppletManifestSpecifiesSandbox/testcases/PartiallySignedAppletManifestSpecifiesSandboxTests.java * tests/reproducers/signed/SignedAppletManifestSpecifiesSandbox/resources/SignedAppletManifestSpecifiesSandbox.html * tests/reproducers/signed/SignedAppletManifestSpecifiesSandbox/resources/SignedAppletManifestSpecifiesSandboxApplet.jnlp * tests/reproducers/signed/SignedAppletManifestSpecifiesSandbox/resources/SignedAppletManifestSpecifiesSandboxApplication.jnlp * tests/reproducers/signed/SignedAppletManifestSpecifiesSandbox/resources/SignedAppletManifestSpecifiesSandboxJnlpHref.html * tests/reproducers/signed/SignedAppletManifestSpecifiesSandbox/srcs/META-INF/MANIFEST.MF * tests/reproducers/signed/SignedAppletManifestSpecifiesSandbox/srcs/SignedAppletManifestSpecifiesSandbox.java * tests/reproducers/signed/SignedAppletManifestSpecifiesSandbox/testcases/SignedAppletManifestSpecifiesSandboxTests.java 2014-08-01 Jiri Vanek * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java: casts to (JNLPClassLoader) DID guarded by instanceof 2014-07-31 Andrew Azores Add URLPermission support to SecurityDesc. This is essentially Java 8 support, as URLPermission is new to Java 8 and required for many applets to continue working when a Java 8-compatible JVM is in use. * netx/net/sourceforge/jnlp/SecurityDesc.java (urlPermissionClass, urlPermissionConstructor): new static variables for storing references to URLPermission, if available, for reflective construction at runtime (getSandboxPermissions): adds URLPermissions to sandbox permissions set, if available (Java 8+) (getUrlPermissions): new method for getting URLPermissions for the current SecurityDesc (getHostWithSpecifiedPort, appendRecursiveSubdirToCodebaseHostString): new static helper methods for generating URLPermissions' constructor args * tests/netx/unit/net/sourceforge/jnlp/SecurityDescTest.java (testNotNullJnlpFile): cleanup refactor, no semantic change (testNullJnlpFile, testAppendRecursiveSubdirToCodebaseHostString, testAppendRecursiveSubdirToCodebaseHostString2, testAppendRecursiveSubdirToCodebaseHostString3, testAppendRecursiveSubdirToCodebaseHostStringWithPort, testAppendRecursiveSubdirToCodebaseHostStringWithNull, testGetHostWithSpecifiedPort, testGetHostWithSpecifiedPortWithFtpScheme, testGetHostWithSpecifiedPortWithUserInfo, testGetHostWithSpecifiedPOrtWithPort, testGetHostWithSpecifiedPortWithPath, testGetHostWithSpecifiedPortWithAll, testGetHostWithSpecifiedPortWithNull, testGetHost, testGetHostWithFtpScheme, testGetHostWithUserInfo, testGetHostWithPort, testGetHostWithPath, testGetHostWithAll, testGetHostNull, testGetHostWithAppendRecursiveSubdirToCodebaseHostString, testGetHostWithSpecifiedPortWithAppendRecursiveSubdirToCodebaseHostString): new test methods 2014-07-31 Andrew Azores Added "File - New" action to PolicyEditor * netx/net/sourceforge/jnlp/resources/Messages.properties (PETitle): PolicyEditor, not Policy Editor. (PETitleWithPath): new message used for PolicyEditor window title bar (PETitleWithChangesMade): same (PENewMenuItem): new message (PEAddCodebaseItem): added ellipsis (PEPasteCodebaseItem): same (PENewMenuItemMnemonic): new message (PEAddCodebaseItemAccelerator): C-S-n rather than just C-n (PENewMenuItemAccelerator): new message, C-n * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditor.java: added "New" item to "File" menu. (setFile): new method. (newButtonAction): new field (openButtonAction): "save changes made" dialog extracted into new method (promptOnSaveChangesMade): new method (setParentWindowTitle): new method (getWindowTitleForStatus): new method (getFile): new method (createMenuBar): added New item to File menu (removeCodebase): add setChangesMade call * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditorController.java (openAndParsePolicyFile): use setPerformingIO rather than direct access (savePolicyFile): same * netx/net/sourceforge/jnlp/security/policyeditor/PolicyFileModel.java (setFile): allow null file to facilitate "new file" without a location set (saveFile): set new fileWatcher every time, not only if file was previously null 2014-07-30 Andrew Azores Lukasz Dracz * netx/net/sourceforge/jnlp/resources/Messages.properties (PEHelpMenu, PEAboutPolicyEditorItem, PEPolicyEditorHelpItem, PEAboutDialogTitle, PEAboutDialogContent, PEHelpDialogTitle, PEHelpDialogContent, PEHelpMenuMnemonic, PEAboutPolicyEditorItemMnemonic, PEPolicyEditorHelpItemMnemonic, PEAboutPolicyEditorCloseAccelerator):added * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditor.java (policyEditorHelpButtonAction, aboutPolicyEditorButtonAction): added and used to open dialogs (helpMenu, aboutPolicyEditorItem, policyEditorHelpItem): added * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditorAboutDialog.java Implements a frame that uses a textpane which takes html within a scrollpane to show dialogs in. (close, setupLayout): added (CloseKeyListener): added class 2014-07-30 Jie Kang * NEWS: added mention of fixes to Java Console and itweb-settings UI as well as fix to method overloading resolution 2014-07-30 Andrew Azores * NEWS: added mention of PolicyEditor mnemonics and accelerators overhaul, PolicyEditor bug fix where "cancel" on the "save before exit" dialog would exit without saving changes 2014-07-30 Andrew Azores * NEWS: added mention of RH1121549 fix 2014-07-30 Andrew Azores Fixes for coverity issues discovered in RH1121549 * plugin/icedteanp/IcedTeaNPPlugin.cc (ITNP_New): print error message and return error if JVM fails to start. (NP_Initialize): fix missing argument to PLUGIN_ERROR when unable to create data directory * plugin/icedteanp/IcedTeaParseProperties.cc (get_log_dir): refactored to reduce duplicate code, use IcedTeaPluginUtils.create_dir, and enhanced warning messages * plugin/icedteanp/IcedTeaPluginUtils.cc (create_dir, is_directory): new functions * plugin/icedteanp/IcedTeaPluginUtils.h: same * plugin/icedteanp/IcedTeaScriptablePluginObject.cc (setProperty): do not erroneously redeclare java_result * tests/cpp-unit-tests/IcedTeaPluginUtilsTest.cc (is_directory, create_dir): new tests. (file_exists): added assertion that directories satisfy file_exists 2014-07-28 Jie Kang Fixed TeeOutputStream to accept multi-byte encodings. * netx/net/sourceforge/jnlp/util/logging/TeeOutputStream.java: Now uses ByteArrayOutputStream instead of StringBuffer * tests/netx/unit/net/sourceforge/jnlp/util/logging/TeeOutputStreamTest.java: 2014-07-28 Jie Kang Made adjustments to the MethodOverloadResolver to follow LiveConnect specification when dealing with superclasses. * tests/reproducers/simple/JSToJFuncResol/testcases/JSToJFuncResolTest.java: Removed Known to Fail annotation on test case that is now fixed. * plugin/icedteanp/java/sun/applet/MethodOverloadResolver.java Added distance calculation for comparing superclass resolutions. 2014-07-28 Jie Kang Fix to Java ConsoleOutputPane for lower resolutions. Addresses bug PR1859 where part of the pane is hidden and unnaccessible when clicking "Show Details". * netx/net/sourceforge/jnlp/util/logging/ConsoleOutputPane.java: 2014-07-28 Jie Kang Fix to Control Panel UI for lower resolutions. Addresses bug PR1856 where part of the dialog is hidden and unaccessible on lower resolutions such as 800 x 600. * netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java: * netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletsTrustingListPanel.java: 2014-07-22 Fridrich Strba * plugin/icedteanp/IcedTeaPluginUtils.cc (flush_pre_init_messages): Return NULL explicitly. 2014-07-14 Andrew Azores PolicyEditor mnemonics and accelerators overhaul * netx/net/sourceforge/jnlp/resources/Messages.properties (PECodebaseMenu, PERenameCodebaseItem, PECopyCodebaseItem, PEPasteCodebaseItem, PECopyCodebaseToClipboardItem, PEFileMenuMnemonic, PECodebaseMenuMnemonic PEViewMenuMnemonic, PEAddCodebaseItem, PERemoveCodebaseItem): removed "codebase" from item labels, "Edit" menu renamed "codebase" (PEAddCodebaseMnemonic, PEAddCodebaseItemMnemonic, PERemoveCodebaseMnemonic, PERemoveCodebaseItemMnemonic, PEOpenMenuItemMnemonic, PESaveMenuItemMnemonic, PEExitMenuItemMnemonic, PECustomPermissionsItemMnemonic, PECopyCodebaseItemMnemonic, PEPasteCodebaseItemMnemonic, PECopyCodebaseToClipboardItemMnemonic, PESaveAsMenuItemMnemonic, PERenameCodebaseItemMnemonic): updated mnemonics (PEAddCodebaseItemAccelerator, PERemoveCodebaseItemAccelerator, PEOpenMenuItemAccelerator, PESaveMenuItemAccelerator, PESaveAsMenuItemAccelerator, PEExitMenuItemAccelerator, PECustomPermissionsItemAccelerator, PECopyCodebaseItemAccelerator, PEPasteCodebaseItemAccelerator, PERenameCodebaseItemAccelerator, PECopyCodebaseToClipboardItemAccelerator): added accelerators * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditor.java (closeButtonAction): set in PolicyEditor constructor rather than setupPolicyEditorWindow (setupPolicyEditorWindow): do not set save/quit/esc actions (setAccelerators, setAccelerator, setAddCodebaseAccelerator, setRemoveCodebaseAccelerator): removed (setButtonMnemonic): simplified, takes a String expected to be a single character representing the mnemonic key directly, rather than a String parseable to an integer which represented the value of the mnemonic key (setMenuItemAccelerator): new method (createMenuBar): use new mnemonics and accelerators, add new Add/Remove items to Codebase menu, override JList default Control-C/Control-V copy/paste actions (setupLayout): groupCh MouseListener#mouseClicked logic extracted to toggleExpandedCheckboxGroupPanel, KeyListener added to allow expanding checkbox groups via keyboard with Enter or "Context Menu" (toggleExpandedCheckboxGroupPanel): new method 2014-07-11 Andrew Azores Fixed bug where the "Cancel" option on the "save changes before exiting" dialog would be ignored and the window close without saving * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditor.java (preparePolicyEditorWindow): default close operation NONE rather than dispose (setupPolicyEditorWindow): do not automatically dispose on window close 2014-07-08 Emmanuel Bourg * netx/policyeditor.1: Escaped the minus signs in the policyeditor manpage 2014-07-03 Jacob Wisor * netx/net/sourceforge/jnlp/util/logging/ConsoleOutputPane.java: Fix handling of UI controls (ConsoleOutputPane) Add set enabled state of headers JCheckBoxes with new setHeadersCheckBoxesEnabled() method depending on showHeaders' saved configuration selected state Add set enabled state of messages JCheckBox with new setMessagesCheckBoxesEnabled method depending on showMessage's selected state on initialization Add set enabled state of refresh JButton reciprocally to autorefresh JCheckBox's selected state on initialization (createDefaultAction) Add null check on argument of public method Add call to new setHeadersCheckBoxesEnabled() method with showHeaders' selected state when clicked Add call to new setMessagesCheckBoxesEnabled() method with showMessage's selected state when clicked Add set enabled state of refresh JButton reciprocally to autorefresh JCheckBox's selected state (initComponents) Add default ActionListener to autorefresh JCheckBox (setHeadersCheckBoxesEnabled) Add new method Sets enabled state of showUser, showOrigin, showLevel, showDate, showCode, showThread1, and showThread2 depending on parameter passed in (setMessagesCheckBoxesEnabled) Add new method Sets enabled state of showOut, showErr, showJava, showPlugin, showDebug, showInfo, showItw, and showApp depending on parameter passed in 2014-07-03 Jiri Vanek * tests/netx/unit/net/sourceforge/jnlp/resources/MessagesPropertiesTest.java removed useless iterations of all resources against all. Kept only all against default. Preferred diamonds and for each against full declarations and old-style fors. 2014-06-30 Andrew Azores Runnables to be invoked on the EDT are invoked immediately if the current thread is already the EDT, rather than being queued for invocation later. invokeRunnableOrEnqueueLater replaces SwingUtilities.invokeLater to achieve this. * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditor.java (updateCheckboxes): uses invokeRunnableOrEnqueueAndWait (updateCheckboxesInvokeAndWait): removed (invokeRunnableOrEnqueueAndWait, invokeRunnableOrEnqueueLater): new methods 2014-06-26 Jacob Wisor * netx/net/sourceforge/jnlp/util/logging/ConsoleOutputPane.java: Formatting fixes & cleanup Made final classes, members, and variables final 2014-06-26 Jacob Wisor * netx/net/sourceforge/jnlp/resources/Messages_pl.properties: Add new PL localized messages 2014-06-25 Andrew Azores * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditor.java: (setupLayout): use SwingUtilities.getWindowAncestor() rather than manually searching 2014-06-24 Andrew Azores * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: removed hunk of old commented out code, updated comment on reason for JNLPRuntime.reloadPolicy() 2014-06-19 Jie Kang Refactored Live-Connect (java-js) test cases to fix race condition between JS and J-applet. Checked each test and marked tests known to fail correctly. Removed and replaced deprecated code usage. * tests/reproducers/simple/JSObjectFromEval/resources/JSObjectFromEval.html * tests/reproducers/simple/JSObjectFromEval/resources/JSObjectFromEval.js * tests/reproducers/simple/JSObjectWithoutToString/resources/JSObjectWithoutToString.html * tests/reproducers/simple/JSObjectWithoutToString/resources/JSObjectWithoutToString.js * tests/reproducers/simple/JSToJFuncParam/resources/JSToJFuncParam.html * tests/reproducers/simple/JSToJFuncParam/resources/JSToJava_FuncParam.js * tests/reproducers/simple/JSToJFuncParam/srcs/JSToJFuncParam.java * tests/reproducers/simple/JSToJFuncParam/testcases/JSToJFuncParamTest.java * tests/reproducers/simple/JSToJFuncResol/resources/JSToJFuncResol.html * tests/reproducers/simple/JSToJFuncResol/resources/JSToJava_FuncResol.js * tests/reproducers/simple/JSToJFuncResol/srcs/JSToJFuncResol.java * tests/reproducers/simple/JSToJFuncResol/testcases/JSToJFuncResolTest.java * tests/reproducers/simple/JSToJFuncReturn/resources/JSToJFuncReturn.html * tests/reproducers/simple/JSToJFuncReturn/resources/JSToJava_FuncReturn.js * tests/reproducers/simple/JSToJFuncReturn/srcs/JSToJFuncReturn.java * tests/reproducers/simple/JSToJFuncReturn/testcases/JSToJFuncReturnTest.java * tests/reproducers/simple/JSToJGet/resources/JSToJGet.html * tests/reproducers/simple/JSToJGet/resources/JSToJ_auxiliary.js * tests/reproducers/simple/JSToJGet/resources/JSToJava_Get.js * tests/reproducers/simple/JSToJGet/srcs/JSToJGet.java * tests/reproducers/simple/JSToJGet/testcases/JSToJGetTest.java * tests/reproducers/simple/JSToJSet/resources/JSToJSet.html * tests/reproducers/simple/JSToJSet/resources/JSToJava_Set.js * tests/reproducers/simple/JSToJSet/srcs/JSToJSet.java * tests/reproducers/simple/JSToJSet/testcases/JSToJSetTest.java * tests/reproducers/simple/JSToJTypeConv/resources/JSToJTypeConv.html * tests/reproducers/simple/JSToJTypeConv/resources/JSToJava_TypeConv.js * tests/reproducers/simple/JToJSString/resources/JToJSString.html * tests/reproducers/simple/JToJSString/resources/JToJSString.js * tests/reproducers/simple/JToJSString/resources/JToJSStringJnlpApplet.html * tests/reproducers/simple/JToJSString/resources/JSTest.js * tests/reproducers/simple/JavascriptFuncParam/resources/JavascriptFuncParam.html * tests/reproducers/simple/JavascriptFuncParam/srcs/JavascriptFuncParam.java * tests/reproducers/simple/JavascriptFuncParam/testcases/JavascriptFuncParamTest.java * tests/reproducers/simple/JavascriptFuncReturn/resources/JavascriptFuncReturn.html * tests/reproducers/simple/JavascriptFuncReturn/srcs/JavascriptFuncReturn.java * tests/reproducers/simple/JavascriptGet/resources/JavascriptGet.html * tests/reproducers/simple/JavascriptGet/resources/Javascript_Get.js * tests/reproducers/simple/JavascriptGet/srcs/JavascriptGet.java * tests/reproducers/simple/JavascriptSet/resources/JavascriptSet.html * tests/reproducers/simple/JavascriptSet/resources/Javascript_Set.js * tests/reproducers/simple/JavascriptSet/srcs/JavascriptSet.java * tests/reproducers/simple/JavascriptSet/testcases/JavascriptSetTest.java * tests/reproducers/simple/JavascriptURLProtocol/resources/JavascriptProtocol.html * tests/reproducers/simple/JavascriptURLProtocol/resources/JavascriptProtocol.js * tests/reproducers/simple/JavascriptFuncReturn/resources/Javascript_FuncReturn.js 2014-06-19 Jiri Vanek * NEWS: mentioned All JDKs ability, DE localization, JDK6 incompatibility and KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK 2014-06-19 Andrew Azores * NEWS: added PolicyEditor and TemporaryPermissions 1.6 news 2014-06-19 Andrew Azores * netx/net/sourceforge/jnlp/security/policyeditor/CustomPermission.java: added 2-arg constructor for permissions without actions * tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/CustomPermissionTest.java (testToStringWithoutActions) renamed testToStringWithEmptyActions (testToStringWithNoActions) new test * tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/CustomPolicyViewerTest.java (PERMISSION) uses 2-arg constructor * tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PolicyEditorTest.java (testAddCustomPermission) renamed testAddCustomPermissionEmptyActions (testClearCustomPermissions) renamed testClearCustomPermissionsEmptyActions (testAddCustomPermissionNoActions) new test (testClearCustomPermissionsNoActions) new test 2014-06-19 Kurt Miller Fixed PR1743 - Intermittant deadlock in PluginRequestProcessor * NEWS: added PR1743 * plugin/icedteanp/IcedTeaNPPlugin.cc: declaration of cond_message_available moved to PluginRequestProcessor class * plugin/icedteanp/IcedTeaNPPlugin.h: removed external cond_message_available search * plugin/icedteanp/IcedTeaPluginRequestProcessor.h: message_queue_mutex, syn_write_mutex and message_queue moved to PluginRequestProcessor clas. Constructor, destructor and newMessageOnBus declarationmoved to end of class. declared queueProcessorThread method. * plugin/icedteanp/IcedTeaPluginRequestProcessor.cc: Removed declaration of static message_queue_mutex, syn_write_mutex, message_queue. (PluginRequestProcessor) constructor and destructor and (newMessageOnBus) are now using the fields from PluginRequestProcessor class. new method of (queue_wait_cleanup) to unlock mutex added. (queue_processor) is now calling queueProcessorThread. Implemented (queueProcessorThread), which uses setMember, call , eval and loadUrl rather then processor->, versions. If no message_parts are available, the cleanup is done only if message_queue is empty. 2014-06-18 Jacob Wisor * netx/net/sourceforge/jnlp/resources/Messages.properties (BOredirect) (CCannotClearCache, CFakedCache, CONSOLEClean, CVCPCleanCache) (CVCPCleanCacheTip): Fixed language in some messages * netx/net/sourceforge/jnlp/resources/Messages_de.properties: Add new DE localized messages 2014-06-17 Andrew Azores * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditor.java (openAndParsePolicyFile): check if listModel already contains an element before adding a potential duplicate (addNewCodebase): perform the check for if the codebase is a duplicate when actually adding the codebase to the listModel, rather than beforehand and updating the UI in an invokeLater, which can cause a race 2014-06-17 Andrew Azores Some PolicyEditor logic extracted into new class PolicyEditorController to allow different UIs to be built without invoking any main PolicyEditor UI * netx/net/sourceforge/jnlp/security/policyeditor/CustomPolicyViewer.java (updateCustomPermissions): give "true" as param for setChangesMade * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditor.java (policyFile, changesMade, performingIO): moved into PolicyEditorController. All policyFile references changed to use policyEditorController instead (policyEditorController): new field * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditorController.java: new class to provide implementation of and programmatic interface for major PolicyEditor actions, to allow other UIs to be built in the future * tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PolicyEditorTest.java (setNewTempfile): while-loop for waiting for PolicyEditor IO to complete changed to do-while (testAddMultipleCodebases, testCodebaseTrailingSlashesDoNotMatch): editor.addNewCodebases has been removed, using editor.addNewCodebase and a loop instead (testAddCustomPermission, testClearCustomPermission): added assert messages 2014-06-13 Andrew Azores TemporaryPermissions generated via reflection rather than hard coded * netx/net/sourceforge/jnlp/resources/Messages.properties (STempPermNoFile, STempPermNoNetwork, STempPermNoExec, STempNoFileOrNetwork, STempNoExecOrNetwork, STempNoFileOrExec, STempNoFileOrNetworkOrExec, STempAllMedia, STempSoundOnly, STempClipboardOnly, STempPrintOnly, STempAllFileAndPropertyAccess, STempReadLocalFilesAndProperties, STempReflectionOnly): removed (STempNetwork, STempReadFilesAndProperties, STempWriteFilesAndProperties, STempReflectionAndExternal, STempAllMedia): new messages * netx/net/sourceforge/jnlp/resources/Messages_cs.properties (STempPermNoFile, STempPermNoNetwork, STempPermNoExec, STempNoFileOrNetwork, STempNoExecOrNetwork, STempNoFileOrExec, STempNoFileOrNetworkOrExec, STempAllMedia, STempSoundOnly, STempClipboardOnly, STempPrintOnly, STempAllFileAndPropertyAccess, STempReadLocalFilesAndProperties, STempReflectionOnly): removed * netx/net/sourceforge/jnlp/security/dialogs/TemporaryPermissions.java: rewrite to use reflection to generate permissions from PolicyEditorPermissions rather than exposing statically defined values * netx/net/sourceforge/jnlp/security/dialogs/TemporaryPermissionsButton.java: refactor to use new TemporaryPermissions change * tests/netx/unit/net/sourceforge/jnlp/security/dialogs/TemporaryPermissionsTest.java: new tests for TemporaryPermissions 2014-06-12 Andrew Azores * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditor.java (showChangesSavedDialog, showCouldNotSaveDialog): fixed comment to explain an issue with JVM exiting, rather than GC 2014-06-12 Andrew Azores Reduced usage of weak references in PolicyEditor * netx/net/sourceforge/jnlp/security/policyeditor/CustomPolicyViewer.java (weakThis): removed in favour of CustomPolicyViewer.this * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditor.java (weakThis): used only in showChangesSavedDialog and showCouldNotSaveDialog, other uses changed to PolicyEditor.this 2014-06-11 Andrew Azores CustomPolicyViewer refactored - methods extracted for unit testing and no longer holds PolicyFileModel reference, instead using parent PolicyEditor's interface for interacting with the file model * netx/net/sourceforge/jnlp/security/policyeditor/CustomPolicyViewer.java: no longer holds PolicyFileModel reference, interacts through PolicyEditor parent instead (addButtonAction, removeButtonAction, closeButtonAction): use extracted methods (addCustomPermission): extracted method, no longer adds visual duplicates (removeCustomPermission, quit): extracted methods (getCopyOfCustomPermissions): new method (updateCustomPermissions): use parent rather than PolicyFileModel * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditor.java (clearCustomPermissions): new method * tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PolicyEditorTest.java (testAddCustomPermission, testClearCustomPermissions): new tests * tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/CustomPolicyViewerTest.java: new test class 2014-06-06 Andrew Azores * netx/net/sourceforge/jnlp/security/policyeditor/CustomPermission.java (toString): fixed empty actions string appearing on basic permissions, which do not have actions * tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/CustomPermissionTest.java: (testToStringWithoutActions): new test 2014-06-06 Andrew Azores PolicyEditor copy/paste/rename methods extracted and unit tests added * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditor.java (codebaseClipboard): renamed to editorPermissionsClipboard (customPermissionsClipboard): new field for copy/pasting custom permissions (copyCodebaseButtonAction, pasteCodebaseButtonAction, renameCodebaseButtonAction): refactor to use newly extracted methods (copyCodebase, pasteCodebase, renameCodebase): methods extracted from corresponding button action ActionListeners (setPermission, addCustomPermission): new methods * tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PolicyEditorTest.java (testRenameCodebase): new test for renaming codebase action (testCopyPasteCodebase): new test for copying and pasting codebases 2014-06-05 Andrew Azores Added "Copy codebase to clipboard" action to PolicyEditor * netx/net/sourceforge/jnlp/resources/Messages.properties (PECopyCodebaseToClipboardItem): new message * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditor.java (copyCodebaseToClipboardButtonAction): new action for "Copy codebase to clipboard" button (createMenuBar): added "Copy codebase to clipboard" button to Edit menu (renameCodebaseButtionAction): prefill dialog with old codebase 2014-06-05 Andrew Azores Added Rename, Copy, and Paste actions for codebases in PolicyEditor * netx/net/sourceforge/jnlp/resources/Messages.properties (PEEditMenu, PERenameCodebaseItem, PECopyCodebaseItem, PEPasteCodebaseItem, PERenameCodebase, PEPasteCodebase, PEEditMenuMnemonic): new messages * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditor.java (codebaseClipboard): new field to facilitate copy/pasting codebases. (renameCodebaseButtonAction, copyCodebaseButtonAction, pasteCodebaseButtonAction): new ActionListener fields for new actions. (interactivelyAddCodebase): renamed to addNewCodebaseInteractive. (validateCodebase): new utility method for validating codebases. (addNewCodebase, addNewCodebaseInteractive): use validateCodebase. (createMenuBar): add Edit menu and items. 2014-06-04 Lukasz Dracz Fixed Time Zone difference failure in unit test CreatePluginHeaderTestOk * unit/net/sourceforge/jnlp/util/logging/JavaConsoleTest.java: Test suite would check for the time in CET against the user's time value converted into their local timezone. Created a Date variable that ensures time passed into PluginMessage and the one being checked are of the same time zone. 2014-06-03 Andrew Azores Added indicator method for if PolicyEditor is currently performing file IO. Unit tests wait for IO to complete before testing editor contents. * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditor.java (performingIO, isPerformingIO): new field and getter to indicate if file IO is currently being performed. (changesMade): made volatile * tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PolicyEditorTest.java (setNewTempFile): call Thread.sleep while editor.isPerformingIO 2014-06-03 Andrew Azores PolicyEditor persists empty non-default codebase entries * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEntry.java (toString): return empty string only if the codebase both has no permissions assigned and is also the default "All Applets" codebase * netx/net/sourceforge/jnlp/security/policyeditor/PolicyFileModel.java (savePolicyFile): release fileLock with try/finally 2014-06-03 Lukasz Dracz This test expects a Null pointer exception however does not have a flag specifying that the NullPointer Exception is expected * unit/net/sourceforge/jnlp/util/UrlUtilsTest.java (verifyNotNullUrlEqualsThrowsExceptionWhenSecondArgumentIsNull): added 'expected = NullPointerException.class' to Test annotation 2014-06-03 Andrew Azores Fix for PR1776, PolicyEditor attempting to save to null file location when exiting editor and answering Yes to save changes first. * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditor.java (quit): select file to save to using fileChooser if file is null (policyEditorWindowQuit): new helper method for PolicyEditorWindow and PolicyEditorFrame quit() 2014-06-03 Lukasz Dracz Changed Temporary Permissions from menu items to check box menu items * netx/net/sourceforge/jnlp/security/dialogs/TemporaryPermissionsButton.java (TemporaryPermissionsListener.actionPerformed): Added behaviour to add or remove permissions from a new collection of permissions based on whether the item is checked or not (TemporaryPermissionsButton.TemporaryPermissionsButton): Added action listener and applied the new collection of permissions for when the sandbox button is pressed 2014-06-02 Andrew Azores PolicyEditor file I/O made asynchronous with a progress indicator * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditor.java (savePolicyFile, openAndParsePolicyFile): use SwingWorker to make IO asynchronous, also show a progress bar. (checkPolicyChangesWithDialog): handle Exceptions thrown by policyFile.hasChanged() and policyFile.getFile().getCanonicalPath(), rather than letting them bubble up * netx/net/sourceforge/jnlp/security/policyeditor/IndeterminateProgressDialog.java: new class 2014-06-02 Andrew Azores PolicyEditor file I/O and model logic extracted into a new class * netx/net/sourceforge/jnlp/security/policyeditor/CustomPolicyViewer.java: store PolicyFileModel as field. (updateCustomPermissions): new method * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditor.java (codebasePermissionsMap, customPermissionsMap, file, fileWatcher, savePolicyFile, openAndParsePolicyFile): Policy file model logic extracted into new PolicyFileModel class. (policyFile) new PolicyFileModel field. (addNewCodebase, getCodebases, getPermissions, getCustomPermissions, updateCheckboxes, updateCheckboxesImpl, updateCustomPermissions, resetCodebases, openAndParsePolicyFile, savePolicyFile, initializeMapForCodebase, checkPolicyChangesWithDialog): refactored to use PolicyFileModel * netx/net/sourceforge/jnlp/security/policyeditor/PolicyFileModel.java: new class for modelling Policy files * tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PolicyEditorParsingTest.java: update to use PolicyEditor's policyFile field * tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PolicyEditorTest.java (testReturnedCustomPermissionsSetIsCopy): initial assertion of empty set added, final assertion of empty set rephrased (testReturnedCodebasesAreCopy) renamed testReturnedCodebasesIsCopy, rephrased and using assertEquals rather than assertTrue 2014-05-29 Jie Kang Added reproducer for PR1794: Bug where Java variables are not accessed correctly through Javascript. Attempt to access a string array results in undefined result. However, attempt to access a string results in receiving correct value of string. Tests html applet and jnlp-href applet * tests/reproducers/simple/JToJSString/testcases/JToJSStringTest.java: New reproducer for PR1794 * tests/reproducers/simple/JToJSString/resources/JToJSString.html: same * tests/reproducers/simple/JToJSString/resources/JToJSJnlpApplet.html: same * tests/reproducers/simple/JToJSString/resources/JToJSString.js: same * tests/reproducers/simple/JToJSString/resources/JToJSApplet.jnlp: same * tests/reproducers/simple/JToJSString/srcs/JToJSString.java: same 2014-05-23 Jiri Vanek Fixed cache tests * tests/reproducers/signed/CacheReproducer/testcases/CacheReproducerTest.java: changed condition on checking cache dir from not existing to being empty, 2014-05-23 Jiri Vanek Minor code enhancements: Enum for HEAD and GET, urlutils classes moved to UrlUtils * netx/net/sourceforge/jnlp/cache/CacheEntry.java: "*" imports replaced by full ones location, version and properties made final. (isCurrent) rewritten * netx/net/sourceforge/jnlp/cache/CacheUtil.java: (urlEquals) and (notNullUrlEquals) and (compare) moved to UrlUtils. (getReadPermission) got javadoc. urlList, keep, remove colelctions redeclared to diamond * netx/net/sourceforge/jnlp/cache/Resource.java: adapted imports and calls to CacheUtil UrlUtils change. * netx/net/sourceforge/jnlp/cache/ResourceTracker.java: (requestMethods) hidden into public inner enum of RequestMethods. prefetchTrackers, queue, downloadOptions, active, resources, listeners marked final and redeclared with diamond. (getUrlResponseCode) adapted to new enum, removed javadoc. (getUrlResponseCodeWithRedirectonResult) adapted to new enum * netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java: file group loader appContext weakWindows weakWindows made final and redeclared with diamond. Added override annotations. (shouldCreateShortcut) changed to switch. * netx/net/sourceforge/jnlp/util/UrlUtils.java: used multi catch where possible. urlEquals, notNullUrlEquals, compareNullableStrings moved from CacheUtils * tests/netx/unit/net/sourceforge/jnlp/cache/CacheUtilTest.java: adapted to CacheUtils->UrlUtils method movement. * tests/netx/unit/net/sourceforge/jnlp/cache/ResourceTest.java: assertNotEquals replaced by assertFalse and equals. Specific versions of JUnit have problems with notEquals. * tests/netx/unit/net/sourceforge/jnlp/cache/ResourceTrackerTest.java: Adapted to new enum. * tests/netx/unit/net/sourceforge/jnlp/util/UrlUtilsTest.java: added testUrlEquals verifyNotNullUrlEqualsThrowsExceptionWhenBothArgumentsAreNull nverifyNotNullUrlEqualsThrowsExceptionWhenFirstArgumentIsNull verifyNotNullUrlEqualsThrowsExceptionWhenSecondArgumentIsNull notNullUrlValuesEqualsCaseSensitiveIssuesTest notNullUrlComapreWithPorts (known to fail), testCompareNullableStrings and testCompareNullableStrings tests * tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java: removed unused imports, used diamonds, removed dead code. * tests/test-extensions/net/sourceforge/jnlp/TinyHttpdImpl.java: Adapted to new enum. 2014-05-23 Jiri Vanek Minor javadoc enhancements * netx/net/sourceforge/jnlp/cache/CacheEntry.java: added or filled some javadocs * netx/net/sourceforge/jnlp/cache/CacheUtil.java: same * netx/net/sourceforge/jnlp/cache/Resource.java: same * netx/net/sourceforge/jnlp/cache/ResourceTracker.java: same * netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java: same * netx/net/sourceforge/jnlp/util/FileUtils.java: same * tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java: same 2014-05-22 Jie Kang * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditor.java (saveAsButtonAction): set changesMade to true to allow savePolicyFile to save (savePolicyFile): no longer immediately returns if changesMade is false (updateMd5WithDialog): use changesMade along with file MD5 sum changes to determine whether to continue saving to disk, added check for FileNotFound and displays warning message telling user what has happened, also privatized method and renamed method to checkPolicyChangesWithDialog * netx/net/sourceforge/jnlp/util/MD5SumWatcher.java: Removed unused imports. * netx/net/sourceforge/jnlp/resources/Message.properties (PEFileMissing): Added new warning message for PolicyEditor 2014-05-21 Jiri Vanek Fixed slipped test classlaoder fix * sts/reproducers/simple/JavawsAWTRobotFindsButton/testcases/JavawsAWTRobotFindsButtonTest.java (static init) used system classlaoder to laod image 2014-05-21 Jiri Vanek * netx/sun/applet/AppletViewerPanelAccess.java: addedd accidentally skipped createAppletThread method 2014-05-21 Jiri Vanek Making the previous chnage actualy take an effect. * Makefile.am: All tests runs using CLASSPATH varibale on line, separated by semicolon. I have no idea wy this was needing. 2014-05-21 Jiri Vanek All tests adapted to run from XBootclaspath (forced by extending package private rt.jar class) * Makefile.am: all sets of call of -Xbootclasspath in tests and coverage are now adding $CLASSPATH to boot classapth. Where CLASSPATH was not deffined, was added. * tests/netx/unit/net/sourceforge/jnlp/JNLPMatcherTest.java: and * tests/test-extensions/net/sourceforge/jnlp/awt/imagesearch/ComponentFinder.java: resources loaded from boot classloader 2014-05-21 Jiri Vanek Made it works (basicaly) on any JDK * Makefile.am: (NETX_PKGS) sun.applet added to recognized netx packages (netx-dist.stamp) sun directory included into packed list * acinclude.m4: removed (IT_CHECK_FOR_APPLETVIEWERPANEL_HOLE) check. Added IT_CHECK_FOR_SUN_APPLET_ACCESSIBILITY, which test existence of classes sun.applet.AppletPanel, sun.applet.AppletViewerPanel fields applet, documentURL, baseURL and methods run and runLoader. Addapted messge * configure.ac: call to IT_CHECK_FOR_APPLETVIEWERPANEL_HOLE replaced by call to IT_CHECK_FOR_SUN_APPLET_ACCESSIBILITY * /netx/net/sourceforge/jnlp/NetxPanel.java: now extends AppletViewerPanelAccess instead of AppletViewerPanel directly. Access to baseURL, applet and documentURL replaced by dedicated getters/setters * netx/sun/applet/AppletViewerPanelAccess.java: new class extending AppletViewerPanel and enabling access to applet, documentURL and baseURL. Backed by reflection. Also overriding run by usage of short copypasted code. * netx/sun/applet/package-info.java: new file with worning about usage of this package in itw * plugin/icedteanp/java/sun/applet/PluginAppletPanelFactory.java: only call to super debug repalced by ITW's debugging call * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java: used getters as in NetxPanel 2014-05-21 Andrew Azores * AUTHORS: added Lukasz Dracz and Jie Kang 2014-05-21 Jie Kang * netx/net/sourceforge/jnlp/resources/Messages.properties (PEGReadFileSystem): Changed from "Read to" to "Read from" 2014-05-20 Lukasz Dracz Jie Kang * netx/net/sourceforge/jnlp/cache/Resource.java: (location, localFile, requestVersion, downloadVersion, transferred, size, status) made fields private and added setters and getters, and all calling sites refactored * netx/net/sourceforge/jnlp/cache/ResourceTracker.java: Calling sites refactored * netx/net/sourceforge/jnlp/cache/ResourceUrlCreator.java: Calling sites refactored * tests/netx/unit/net/sourceforge/jnlp/cache/ResourceTest.java: (testGetLocation, testGetRequestVersion, testGetDownloadVersion, testTransferredIsZero, testIncrementTransferred, testSizeIsNegativeOne, testSetSize, testStatusIsCopied) added tests 2014-05-14 Andrew Azores * tests/netx/unit/net/sourceforge/jnlp/cache/ResourceTrackerTest.java: (testSelectByStatus) split into (testSelectByStatusOneMatchingResource, testSelectByStatusNoMatchingResource, testSelectByStatusExcludedResources, testSelectByStatusMixedResources, testSelectByFilterUninitialized) 2014-05-14 Omair Majid * netx/net/sourceforge/jnlp/util/JarFile.java: Rename ZIP_LOCAL_FILE_HEADER_SIGNATURE to ZIP_ENTRY_HEADER_SIGNATURE. Fix comments. 2014-05-14 Omair Majid * tests/test-extensions/net/sourceforge/jnlp/tools/CodeSignerCreator.java (KeyPair): New class. (createCert): Use KeyPair. 2014-05-14 Omair Majid * netx/net/sourceforge/jnlp/JNLPFile.java (JNLPFile(InputStream,ParserSettings)) (JNLPFile(InputStream,URL,ParserSettings)): Remove incorrect @throws IOException in javadoc. * netx/net/sourceforge/jnlp/SecurityDesc.java (fromHtmlString): Fix param name in javadoc. * netx/net/sourceforge/jnlp/util/FileUtils.java (showCouldNotOpenDialog): Remove incorrect @param filePath from javadoc. * netx/net/sourceforge/nanoxml/XMLParseException.java, * netx/net/sourceforge/nanoxml/XMLElement.java: Replace
    with

    . 2014-05-14 Andrew Azores * netx/net/sourceforge/jnlp/cache/Resource.java: (Status) new enum replacing int bitfield statuses. (transferred, size) made volatile for atomic read/write. (isSet, getStatusString, changeStatus) refactored for Status enum. (hasFlags, setStatusFlag, setStatusFlags, unsetStatusFlag, resetStatus, isInitialized) new methods. (hashCode) newly overridden since equals was already overridden. * netx/net/sourceforge/jnlp/cache/ResourceTracker.java: all references to Resource int bitfield status refactored. (selectByFilter) new method since UNINITIALIZED is no longer an actual flag in Resource Status, allows for filtering by uninitialized resources anyway. * tests/netx/unit/net/sourceforge/jnlp/cache/ResourceTest.java: refactored for Status enum * tests/netx/unit/net/sourceforge/jnlp/cache/ResourceTrackerTest.java: refactored for Status enum and selectByFilter 2014-05-13 Omair Majid * netx/net/sourceforge/jnlp/cache/CacheEntry.java (readCacheEntryInfo): New method. (CacheEntry): Call readCacheEntryInfo to get properties. * tests/netx/unit/net/sourceforge/jnlp/cache/CacheEntryTest.java (readCacheEntryInfo): New method. (createCacheFile): Rename to ... (createFile): New method. Adjust all callers. (verifyOriginalContentLengthIsSetCorrectly): Create instances of TestCacheEntry, not CacheEntry. 2014-05-12 Omair Majid * netx/net/sourceforge/jnlp/cache/CacheEntry.java: Add KEY_CONTENT_ORIGINAL_LENGTH and LENGTH_UNKNOWN. (getOriginalContentLength, setOriginalContentLength) (getLongKey(String,long)): New methods. (isCached): Check if the original content length is recorded and use it, if available, as the content length. * netx/net/sourceforge/jnlp/cache/ResourceTracker.java (downloadResource): If the content was compressed, store original content length in the cache entry. * tests/netx/unit/net/sourceforge/jnlp/cache/CacheEntryTest.java (testOriginalContentLengthIsSetCorrectly) (verifyCachedIfOriginalContentLengthsAreSame): New method. 2014-05-12 Omair Majid * netx/net/sourceforge/jnlp/cache/CacheEntry.java: Use constants for strings. (initialize): Remove. (getRemoteContentLength, setRemoteContentLength, getLastModified) (setLastModified, getLongKey, setLongKey): New method. * tests/netx/unit/net/sourceforge/jnlp/cache/CacheEntryTest.java: New file. * netx/net/sourceforge/jnlp/cache/ResourceTracker.java (initializeResource, downloadResource): Use CacheEntry.setRemoteContentLength and CacheEntry.setLastModified instead of CacheEntry.initialize. 2014-05-12 Jiri Vanek ALACA is now able to remember decisions. * netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletActionTableModel.java: moved columns in table. Inserted alaca between 0 and 1 * netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletsTrustingListPanel.java: Added handling of UNSET, fixed calls to (now) getAppletSecurityActions. Shifted columns * netx/net/sourceforge/jnlp/resources/Messages.properties: (SUnsignedAllowedBefore) and (SUnsignedRejectedBefore) now handles date (SAppletTitle) removed, was legacy (APPEXTSECguiTableModelTableColumnActionUA) and (APPEXTSECguiTableModelTableColumnActionMatchALACA) added. * netx/net/sourceforge/jnlp/resources/Messages_cs.properties:(SAppletTitle) removed, was legacy * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java: Added (getLocalisedTimeStamp) helper method. * netx/net/sourceforge/jnlp/runtime/ManifestAttributesChecker.java: Call to showMatchingALACAttributePanel dialogue now forwards whole file, not just title. * netx/net/sourceforge/jnlp/security/SecurityDialog.java: First extras to matchingAlaca retyped to JNLPFile * netx/net/sourceforge/jnlp/security/SecurityDialogs.java: MInor javadoc fixes. (showMatchingALACAttributePanel) now have whole JNLP instead of just title. Added handling of saved/saving value * netx/net/sourceforge/jnlp/security/appletextendedsecurity/AppletSecurityActions.java: made to recognize second record as alaca one. * netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletActionEntry.java: unsignedAppletAction changed to appletSecurityActions * netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletActionStorage.java: Whole getMatchingItem family of methods get Integer id parameter, to recognize which record is the one they care about. If id is null, then they return first match, no meter of whether is "strong"(pernament) or week (just hint) * netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletTrustConfirmation.java: adapted to id in interface. Fixed bug with saving the entry. * netx/net/sourceforge/jnlp/security/appletextendedsecurity/impl/UnsignedAppletActionStorageExtendedImpl.java: Added handling of multiple actions, added column. * netx/net/sourceforge/jnlp/security/appletextendedsecurity/impl/UnsignedAppletActionStorageImpl.java: implemented the id change. * netx/net/sourceforge/jnlp/security/dialogs/MatchingALACAttributePanel.java: removed to apptrustwarningpanel * netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/AppTrustWarningDialog.java: made ALCA dialog aware * netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/AppTrustWarningPanel.java: added generalized impl for title handling. * /netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/MatchingALACAttributePanel.java: new class, derived from dialogs, now extending AppTrustWarningPanel * netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/PartiallySignedAppTrustWarningPanel.java: removed custom handling of title. Added minSize. Added usage of stored date in text * netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/UnsignedAppletTrustWarningDialog.java: removed, should be removed long ago when this dialogue was generalized. * netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/UnsignedAppletTrustWarningPanel.java: removed custom handling of title. Added minSize. Added usage of stored date in text * tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/AppletSecurityActionsTest.java: added test for iteration (testIterator) * tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/impl/UnsignedAppletActionStorageImplTest.java: adapted for need of id of attribute * tests/netx/unit/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/AppTrustWarningPanelTest.java: Adapted to dialog in constructor of UnsignedAppletTrustWarningPanel 2014-05-12 Andrew Azores * tests/netx/unit/net/sourceforge/jnlp/util/FileUtilsTest.java: new test class for FileUtils 2014-05-12 Andrew Azores * netx/net/sourceforge/jnlp/cache/CacheUtil.java: (urlToPath) use StringBuilder, not StringBuffer * tests/netx/unit/net/sourceforge/jnlp/cache/CacheUtilTest.java: (testUrlEquals, testUrlToPath) new tests 2014-05-09 Andrew Azores * netx/net/sourceforge/jnlp/util/TimedHashMap.java: implements Map interface, added all missing methods. (timeStamps) removed, refactored to only be composed of one backing map rather than two. * tests/netx/unit/net/sourceforge/jnlp/util/TimedHashMapTest.java: new test methods added 2014-05-09 Andrew Azores * netx/net/sourceforge/jnlp/cache/ResourceTracker.java: (selectByFlag) made package-private * tests/netx/unit/net/sourceforge/jnlp/cache/ResourceTrackerTest.java: (testSelectByFlag) new test method * tests/netx/unit/net/sourceforge/jnlp/cache/ResourceTest.java: new test class 2014-05-09 Andrew Azores * netx/net/sourceforge/jnlp/util/TimedHashMap.java: (setExpiry) new method * tests/netx/unit/net/sourceforge/jnlp/util/TimedHashMapTest.java: new test class for TimedHashMap 2014-05-09 Jiri Vanek Internal implementation of ExecuteAppletAction now support multiple items * netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletActionTableModel.java: Returning AppletSecurityActions instead of ExecuteAppletAction class * netx/net/sourceforge/jnlp/resources/Messages.properties: added APPEXTSECunsetAppletAction key. * netx/net/sourceforge/jnlp/security/appletextendedsecurity/AppletSecurityActions.java: New file, to handle multiple actions hidden in one record. * netx/net/sourceforge/jnlp/security/appletextendedsecurity/ExecuteAppletAction.java: Added UNSET option, handled in (fromString) and (fromChar) and (toChar) and (toExpalnation) * netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletActionEntry.java: instead of ExecuteAppletAction type in fromString and constructor, using AppletSecurityActions * netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletTrustConfirmation.java: behaviour wrapped by AppletSecurityActions.fromAction(behaviour) * tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/AppletSecurityActionsTest.java: New test for new file * tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletTrustConfirmationTest.java: added license header * tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/impl/UnsignedAppletActionStorageImplTest.java: Test adapted to new features, and to preserving old behavior. 2014-05-05 Jiri Vanek Links in AppTrustWarningPanel are now clickable. * netx/net/sourceforge/jnlp/resources/Messages.properties: (SUnsignedDetail) codebase and url changed to href. * netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/AppTrustWarningPanel.java: infoLabel redeclared from JLabel to JEditorPane. Added hyperlinkListener. * netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/PartiallySignedAppTrustWarningPanel.java: publisher string allowed to use href. 2014-05-05 Jiri Vanek Properly disconnect all connected http connections * netx/net/sourceforge/jnlp/cache/CacheEntry.java: (isCurrent) is using lastModified of long rather then whole url connection. Callers adapted. * netx/net/sourceforge/jnlp/cache/CacheUtil.java: (getReadPermission) closed http connection. (isCurrent) retyped to use lastModified of long rather then whole connection. Removed workaround of it. Callers adapted. * netx/net/sourceforge/jnlp/cache/ResourceTracker.java: (downloadResource) Closed http connection. * netx/net/sourceforge/jnlp/runtime/CachedJarFileCallback.java: Closed http connection. * netx/net/sourceforge/jnlp/services/XBasicService.java: (isOffline) Closed http connection. * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java: Closed http connections. * tests/test-extensions-tests/net/sourceforge/jnlp/ServerAccessTest.java: Adapted to URLconnection -> long signature changes. * tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java: Closed http connections. 2014-05-02 Omair Majid * netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java: Switch to JDialog from JFrame. Rename frame to dialog and frameMutex to dialogMutex. Adjust all Callers. 2014-05-02 Omair Majid * netx/net/sourceforge/jnlp/cache/package-info.java, * netx/net/sourceforge/jnlp/runtime/package-info.java, * netx/net/sourceforge/jnlp/services/package-info.java: Fix package name by replacing 'netx' with 'net'. 2014-04-15 Jiri Vanek Reflect possibility of disabled manifest check to unit-test * tests/netx/unit/net/sourceforge/jnlp/runtime/JNLPFileTest.java: new field (attCheckValue) to store original value. (setPermissions) is enabling check and (resetPermissions) returning back to original 2014-04-14 Andrew Azores * netx/net/sourceforge/jnlp/resources/Messages.properties: (PEAccessThreads, PEAccessThreadsDetail, PEAccessThreadGroups, PEAccessThreadGroupsDetail) new messages * netx/net/sourceforge/jnlp/security/dialogs/TemporaryPermissions.java: (ACCESS_THREADS_PERMISSION, ACCESS_THREAD_GROUPS_PERMISSION) new permissions, added to reflection group. Use diamond operator. * netx/net/sourceforge/jnlp/security/policyeditor/PermissionTarget.java: (ACCESS_THREADS, ACCESS_THREAD_GROUPS) new targets * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditorPermissions.java: (ACCESS_THREADS, ACCESS_THREAD_GROUPS) new permissions, added to reflection group. Minor formatting fixes. 2014-04-14 Jiri Vanek All manifest attributes can be disabled * netx/net/sourceforge/jnlp/config/Defaults.java: added new KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK configuration. * netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java: Added KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK key * netx/net/sourceforge/jnlp/runtime/ManifestAttributesChecker.java: (isCheckEnabled) new method to check value of KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK (checkAll) is testing isCheckEnabled before checking individual attributes. 2014-04-14 Andrew Azores Use Swing generics, cleanup with diamond operator * netx/net/sourceforge/jnlp/controlpanel/CachePane.java * netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java * netx/net/sourceforge/jnlp/controlpanel/DebuggingPanel.java * netx/net/sourceforge/jnlp/controlpanel/DesktopShortcutPanel.java * netx/net/sourceforge/jnlp/controlpanel/TemporaryInternetFilesPanel.java * netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletsTrustingListPanel.java * netx/net/sourceforge/jnlp/security/viewer/CertificatePane.java * netx/net/sourceforge/jnlp/util/logging/ConsoleOutputPane.java 2014-04-10 Andrew Azores Update PolicyEditor classes for Java 7 - Swing Generics, Diamond operator. Also some formatting fixes. * netx/net/sourceforge/jnlp/security/policyeditor/CustomPolicyViewer.java * netx/net/sourceforge/jnlp/security/policyeditor/PermissionActions.java * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditor.java * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditorPermissions.java * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEntry.java 2014-04-10 Andrew Azores * Makefile.am: (HAVE_JAVA7) removed * acinclude.m4: (IT_CHECK_JAVA_VERSION) new check for JDK version. (IT_CHECK_FOR_JDK) changed directories to search for JDK, notably adding alternatives-defined JDK location * configure.ac: (IT_CHECK_JAVA_VERSION) new check for JDK version * plugin/icedteanp/IcedTeaNPPlugin.cc: (HAVE_JAVA7) renamed and modified to HAVE_JAVA8 * netx/net/sourceforge/jnlp/security/VariableX509TrustManagerJDK6.java: removed 2014-04-07 Andrew Azores * Makefile.am: (IT_LANGUAGE_SOURCE_VERSION, IT_CLASS_TARGET_VERSION) bumped to 7, dropping JDK6 compatibility 2014-04-07 Andrew Azores * netx/net/sourceforge/jnlp/security/SecurityDialogs.java: (showPartiallySignedWarningDialog) add missing shouldPromptUser check 2014-04-02 Omair Majid * netx/net/sourceforge/jnlp/util/ClasspathMatcher.java (quote): Rename to .. (convertWildcardToRegEx): New method. Adjust all callers. 2014-04-02 Jiri Vanek * NEWS: Added 1.6 section 2014-04-02 Jiri Vanek * configure.ac: bumped (AC_INIT) to 1.6pre 2014-04-02 Jiri Vanek * NEWS: Bumped date of 1.5 release to 2014 2014-04-01 Andrew Azores Fix Permissions manifest attribute check * netx/net/sourceforge/jnlp/runtime/ManifestAttributesChecker.java: (isNoneOrDefault) new method. (validateRequestedPermissionLevelMatchesManifestPermissions) new method. (checkPermissionsAttribute) rework to closer match spec and fix bug in not allowing signed applets to request sandbox permissions. 2014-04-01 Jiri Vanek * netx/net/sourceforge/jnlp/JNLPFile.java: hardcoded strings replaced by SecurityDesc.RequestedPermissionLevel values. * netx/net/sourceforge/jnlp/PluginBridge.java: likewise * tests/netx/unit/net/sourceforge/jnlp/runtime/JNLPFileTest.java: likewise * tests/netx/unit/net/sourceforge/jnlp/JNLPFileTest.java: added new tests (testGetRequestedPermissionLevel1) - (testGetRequestedPermissionLevel7). Added (minimalJnlp) field. * tests/netx/unit/net/sourceforge/jnlp/PluginBridgeTest.java: added new (testGetRequestedPermissionLevel) test. * netx/net/sourceforge/jnlp/SecurityDesc.java: added (DEFAULT) into (RequestedPermissionLevel) and fixed typo in (J2EE) jnlpValue 2014-04-01 Andrew Azores * netx/net/sourceforge/jnlp/SecurityDesc.java: (RequestedPermissionLevel) new enum to describe the permission level requested in an applet's JNLP/HTML. (requestedPermissionLevel) new field. (SecurityDesc) new constructor with RequestedPermissionLevel added. (getRequestedPermissionLevel) new method. * netx/net/sourceforge/jnlp/JNLPFile.java: (getRequestedPermissionLevel) new method * netx/net/sourceforge/jnlp/Parser.java: (getSecurity) construct SecurityDescs with correct RequestedPermissionLevel * netx/net/sourceforge/jnlp/PluginBridge.java: (getRequestedPermissionLevel) new overridden method * netx/net/sourceforge/jnlp/PluginParameters.java: (getPermissions) new method 2014-04-01 Jiri Vanek * netx/net/sourceforge/jnlp/resources/Messages_cs.properties: adapted to match newest state. (MissingPermissionsMainTitle) (MissingPermissionsInfo) (ALACAMissingMainTitle) (ALACAMissingInfo) (ALACAMatchingMainTitle) (ALACAMatchingInfo) removed codebase word, used text in all hrefs. 2014-04-01 Jiri Vanek Manual quotation in ClasspathMatcher regex replaced by Pattern.quote * netx/net/sourceforge/jnlp/util/ClasspathMatcher.java: (quote) is now using Pattern.quote instead manual \Q + original + \E 2014-04-01 Jiri Vanek Restricted CodebaseMatcher to not match aaexample.com by *.example.com expression but still match example.com - as in specification. * netx/net/sourceforge/jnlp/util/ClasspathMatcher.java: (domainToRegEx) consists of original regex connected by or with second one in case of *. start. (sourceToRegExString) part of the logic extracted to quote method. * tests/netx/unit/net/sourceforge/jnlp/util/ClasspathMatcherTest.java: (matchTest5) adapted. (wildCardSubdomainDoesNotMatchParentDomainPaths) new test, focusing on aaexample.com/example.com/aaa.example.com in *.example.com both path and domain. 2014-03-31 Omair Majid * netx/net/sourceforge/jnlp/resources/Messages.properties (MissingPermissionsMainTitle): Remove 'codebase' (MissingPermissionsInfo): Use simple link title. 2014-03-31 Omair Majid * netx/net/sourceforge/jnlp/resources/Messages.properties (ALACAMissingMainTitle, ALACAMissingInfo ALACAMatchingMainTitle) (ALACAMatchingInfo): Rephrase strings and replace full links with page names. * netx/net/sourceforge/jnlp/util/UrlUtils.java (setOfUrlsToHtmlList): Enclose list in 'ul' element. 2014-03-31 Jiri Vanek Allowed wrong match of the aaaexample.com by *.example.com expression as in specification. * netx/net/sourceforge/jnlp/util/ClasspathMatcher.java: uncommented handling of dot in (domainToRegEx). * tests/netx/unit/net/sourceforge/jnlp/util/ClasspathMatcherTest.java: (matchTest) uncommented and added tests of/for dot issue. 2014-03-31 Jiri Vanek Alexandr Kolouch Fixed cz_CS locales and adapted tests * netx/net/sourceforge/jnlp/resources/Messages_cs_CZ.properties: added missing values * tests/reproducers/simple/LocalesTest/testcases/LocalesTestTest.java: Added few untranslatable items to white-list. (allResourcesAreReallyDifferent) now skip test on values of "std. err" "std. out" "Policy Editor" and "Java Reflection" 2014-03-31 Omair Majid * acinclude.m4 (IT_CHECK_XULRUNNER_MIMEDESCRIPTION_CONSTCHAR), (IT_CHECK_XULRUNNER_REQUIRES_C11): Use AC_LANG_SOURCE with code. 2014-03-31 Jiri Vanek Refactored check of heap space. Now recognize g/G and is based on regex * netx/net/sourceforge/jnlp/JREDesc.java: Added (heapPattern) constant. (checkHeapSize) now returns trimmed string and its logic is matching the heapPattern instead compelx structure. (init) set result of checkHeapSize as initialHeapSize and maximumHeapSize. * tests/netx/unit/net/sourceforge/jnlp/JREDescTest.java: tests for (checkHeapSize) and (init) of JREDesc. 2014-03-27 Andrew Azores Fix NPE when trying to open a new file, with changes made, and wanting to save these changes to a file * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditor.java: (openButtonAction) display Save As file chooser if there is no file object yet and user wishes to save changes 2014-03-27 Andrew Azores Fix bug with checkboxes not correctly updating on open and with repeats of a codebase appearing when opening a file multiple times * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditor.java: (resetCodebases) new method. (openAndParsePolicyFile) call resetCodebases at start. (PolicyEditor) call resetCodebases in constructor 2014-03-27 Andrew Azores Applets can be temporarily granted permission levels above fully sandboxed but below all-permission * netx/net/sourceforge/jnlp/resources/Messages.properties: (STempPermNoFile, STempPermNoNetwork, STempPermNoExec, STempPermNoFileOrNetwork, STempPermNoExecOrNetwork, STempPermNoFileOrExec, STempPermNoFileOrNetworkOrExec, STempAllMedia, STempSoundOnly, STempClipboardOnly, STempPrintOnly, STempAllFileAndPropertyAccess, STempReadLocalFilesAndProperties, STempReflectionOnly): new messages * netx/net/sourceforge/jnlp/security/SecurityDialog.java: (installPanel) pass SecurityDelegate to partially signed dialog * netx/net/sourceforge/jnlp/security/SecurityDialogs.java: (showPartiallySignedWarningDialog) added SecutityDelegate param for message extras * netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletTrustConfirmation.java: (checkPartiallySignedWithUserIfRequired) added SecurityDelegate param * netx/net/sourceforge/jnlp/security/dialogs/CertWarningPane.java: (createPolicyPermissionsMenu, PolicyEditorLaunchListener, PolicyEditorPopupListener) removed in favour of TemporaryPermissionsButton * netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/PartiallySignedAppTrustWarningPanel.java: same * netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/AppTrustWarningDialog.java: (partiallySigned) SecurityDelegate param * netx/net/sourceforge/jnlp/security/policyeditor/PermissionActions.java: (DELETE, READLINK, FILE_ALL) new actions. (rawActions, rawString) can retrieve raw String representation of the action * netx/net/sourceforge/jnlp/security/policyeditor/PermissionTarget.java: (USER_HOME, TMPDIR) grant permissions to entire directory, not only children * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditorPermissions.java: (DELETE_LOCAL_FILES, DELETE_TMP_FILES) new permissions. (Group.WriteFileSystem) added DELETE* permissions * nests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PolicyEditorParsingTest.java: update for change in PermissionTarget * netx/net/sourceforge/jnlp/security/dialogs/TemporaryPermissions.java: new class * netx/net/sourceforge/jnlp/security/dialogs/TemporaryPermissionsButton.java: new class 2014-03-27 Jiri Vanek Clenaup in PolicyEditor tests and MVC * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditor.java: MVC mixing method (updatecheckboxes) splited to invokelater and plain impls. * tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/* : removed warnings and fixed wrong package declaration. * tests/test-extensions/net/sourceforge/jnlp/util/FileTestUtils.java: when filelaks are negative, take it as success. 2014-03-26 Andrew Azores Fix JOptionPane modality problems after making PolicyEditor itself modal * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditor.java: JOptionPane dialog parents set correctly to JDialog or JFrame rather than JPanel 2014-03-26 Jiri Vanek * netx/net/sourceforge/jnlp/resources/Messages.propertie: new keys (STOAsignedMsgFully) (STOAsignedMsgAndSandbox) (STOAsignedMsgPartiall) added * netx/net/sourceforge/jnlp/runtime/ManifestAttributesChecker.java: extracted hardocded values of (signedMsg) 2014-03-26 Jiri Vanek Added possibility to group permissions in PolicyEditor * netx/net/sourceforge/jnlp/resources/Messages.properties: added groups names * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditor.java: (setLayout) added grouping panels and checkboxes. (JcheckBoxWithGroup) New inner class to work with groups. netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditorPermissions.java: Added inner class (Groups) and deffinied (ReadFileSystem) (WriteFileSystem) (AccesUnowenedCode) (MediaAccess) 2014-03-26 Andrew Azores * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditor.java: (savePolicyFile, openAndParsePolicyFile) made synchronous so that programmatically adding a new codebase has a well-defined order when performed immediately after starting a new PolicyEditor instance 2014-03-26 Andrew Azores Jiri Vanek PolicyEditor can be made modal. * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditor.java: (PolicyEditorWindow) new interface to facilitate PolicyEditor as a Window rather than Panel. (PolicyEditorFrame, PolicyEditorDialog) PolicyEditorWindow implementations. (getPolicyEditorFrame, getPolicyEditorWindow) new methods to get frame or dialog implementations. (setComponentMnemonic) made static. (preparePolicyEditorWindow) common setup for frame and dialog implementations. * netx/net/sourceforge/jnlp/controlpanel/PolicyPanel.java: refactor to use PolicyEditorWindow * netx/net/sourceforge/jnlp/security/dialogs/CertWarningPane.java: same * netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/PartiallySignedAppTrustWarningPanel.java same * netx/net/sourceforge/jnlp/util/FileUtils.java: (showReadOnlyDialog, showCouldNotOpenFileDialog, showCouldNotOpenFilePathDialog, showCouldNotOpenDialog) use Component rather than JFrame 2014-03-26 Andrew Azores Added many new permissions for PolicyEditor * netx/net/sourceforge/jnlp/resources/Messages.properties: (PEWriteProps, PEWritePropsDetail, PEWriteSystemFiles, PEWriteSystemFilesDetail, PEAWTPermission, PEAWTPermissionDetail, PERecordAudio, PERecordAudioDetail, PEReflection, PEReflectionDetail, PEClassLoader, PEClassLoaderDetail, PEClassInPackage, PEClassInPackageDetail, PEDeclaredMembers, PEDeclaredMembersDetail, PEExec, PEExecDetail, PEGetEnv, PEGetEnvDetail): new messages. (PEAudio, PEAudioDetail) renamed to PEPlayAudio{,Detail}. * netx/net/sourceforge/jnlp/security/policyeditor/PermissionActions.java: (EXECUTE) new action * netx/net/sourceforge/jnlp/security/policyeditor/PermissionTarget.java: (ALL_FILES, RECORD, REFLECT, GETENV, ACCESS_CLASS_IN_PACKAGE, DECLARED_MEMBERS, CLASSLOADER) new targets * netx/net/sourceforge/jnlp/security/policyeditor/PermissionType.java: (REFLECT_PERMISSION) new type * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditorPermissions.java: (WRITE_PROPERTIES, WRITE_SYSTEM_FILES, JAVA_REFLECTION, GET_CLASSLOADER, ACCESS_CLASS_IN_PACKAGE, ACCESS_DECLARED_MEMBERS, EXEC_COMMANDS, GET_ENV, ALL_AWT, RECORD_AUDIO) new permissions. (AUDIO) renamed PLAY_AUDIO. 2014-03-24 Andrew Azores * netx/net/sourceforge/jnlp/runtime/ManifestsAttributesValidator.java: renamed to ManifestAttributesChecker. * netx/net/sourceforge/jnlp/runtime/ManifestAttributesChecker.java: (checkTrustedOnlyAttribute, checkCodebaseAttribute, checkPermissionsAttribute, checkApplicationLibraryAllowableCodebaseAttribute) made private. (checkAll) new method. * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: reflect above changes 2014-03-24 Andrew Azores * netx/net/sourceforge/jnlp/runtime/ManifestsAttributesValidator.java: (checkTrustedOnlyAttrubute) works properly with sandboxing 2014-03-24 Jiri Vanek Client applications now log into new console. * netx/net/sourceforge/jnlp/resources/Messages.properties: added keys (COPitw) and (COPclientApp) for new checkboxes in console * netx/net/sourceforge/jnlp/runtime/Boot.java: added brackets to headless if * netx/net/sourceforge/jnlp/util/TeeOutputStream.java: moved to * netx/net/sourceforge/jnlp/util/logging/TeeOutputStream.java: and improved to log into new console. * netx/net/sourceforge/jnlp/util/logging/ConsoleOutputPane.java: added new checkboxes to filter out/in custom app/itw logs. copyAll buttons do not include custom app's logs in case of first click. * netx/net/sourceforge/jnlp/util/logging/ConsoleOutputPaneModel.java: Added testing data with custom app. (HTMLCOLOR_PURPLE) and (HTMLCOLOR_GREEN) as new colors for custom app. (filter) now handle client app. * netx/net/sourceforge/jnlp/util/logging/JavaConsole.java: (init) redirect stdout/err over teeOutputStream * /netx/net/sourceforge/jnlp/util/logging/OutputController.java: (consume) do not reprint if header is marked by isClientApp * netx/net/sourceforge/jnlp/util/logging/headers/Header.java: added field (isClientApp) 2014-03-24 Jiri Vanek * netx/net/sourceforge/jnlp/controlpanel/CachePane.java: (visualCleanCache) consider exception in cache operation as not-scuess. * netx/net/sourceforge/jnlp/resources/Messages.properties: (CCannotClearCache) (CFakedCache) (CVCPCleanCacheTip) improved by fix it tips. 2014-03-24 Andrew Azores * NEWS: added mention of Trusted-only manifest attribute 2014-03-24 Andrew Azores Added ability to launch PolicyEditor from security prompts, with the current applet's codebase pre-selected in the editor. * netx/net/sourceforge/jnlp/resources/Messages.properties: (CertWarnPolicyTip, CertWarnPolicyEditor): new messages * netx/net/sourceforge/jnlp/security/dialogs/CertWarningPane.java: can launch PolicyEditor from new options overflow button * netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/PartiallySignedAppTrustWarningPanel.java: same 2014-03-24 Andrew Azores * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: pass SecurityDelegate to ManifestsAttributesValidator * netx/net/sourceforge/jnlp/runtime/ManifestsAttributesValidator.java: (securityDelegate) new field, added to constructor. (checkTrustedOnlyAttribute, checkPermissionsAttribute) works with RunInSandbox. 2014-03-20 Andrew Azores Trusted-only manifest attribute implementation * netx/net/sourceforge/jnlp/resources/Messages.properties: (STrustedOnlyAttributeFailure) new message * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: added ManifestsAttributesValidator#checkTrustedOnlyAttribute() to constructor * netx/net/sourceforge/jnlp/runtime/ManifestsAttributesValidator.java: (checkTrustedOnlyAttribute) new method * tests/reproducers/custom/TrustedOnlyAttribute/resources/TrustedOnlyAttribute-signed-nosecurity.jnlp: new tests for Trusted-only attribute * tests/reproducers/custom/TrustedOnlyAttribute/resources/TrustedOnlyAttribute-signed-security.jnlp * tests/reproducers/custom/TrustedOnlyAttribute/resources/TrustedOnlyAttribute-signed.html * tests/reproducers/custom/TrustedOnlyAttribute/resources/TrustedOnlyAttribute-unsigned-nosecurity.jnlp * tests/reproducers/custom/TrustedOnlyAttribute/resources/TrustedOnlyAttribute-unsigned-security.jnlp * tests/reproducers/custom/TrustedOnlyAttribute/resources/TrustedOnlyAttribute-unsigned.html * tests/reproducers/custom/TrustedOnlyAttribute/srcs/MANIFEST.MF * tests/reproducers/custom/TrustedOnlyAttribute/srcs/Makefile * tests/reproducers/custom/TrustedOnlyAttribute/srcs/TrustedOnlyAttribute.java * tests/reproducers/custom/TrustedOnlyAttribute/testcases/TrustedOnlyAttributeTest.java 2014-03-20 Andrew Azores Passing a reference to SecurityDelegate to CertWarningPane, so that UI elements can be added later to allow the applet to be run Sandboxed + some temporary permissions * netx/net/sourceforge/jnlp/security/JNLPAppVerifier.java: (checkTrustWithUser) pass SecurityDelegate reference to SecurityDialogs.showCertWarningDialog * netx/net/sourceforge/jnlp/security/PluginAppVerifier.java: same * netx/net/sourceforge/jnlp/security/SecurityDialog.java: pass SecurityDelegate reference from extras into CertWarningPane constructor * netx/net/sourceforge/jnlp/security/SecurityDialogs.java: (showCertWarningDialog) added SecurityDelegate parameter, add to extras array. * netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java: (askUser) pass null for SecurityDelegate reference * netx/net/sourceforge/jnlp/security/dialogs/CertWarningPane.java: (CertWarningPane) added SecurityDelegate constructor parameter and (securityDelegate) field 2014-03-20 Andrew Azores SecurityDelegate can be used to add permissions to JNLPClassLoader during run. This is useful for adding temporary extra permissions to an applet. * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: (SecurityDelegate addPermission, addPermissions) new methods. (SecurityDelegateImpl addPermission, addPermissions) implement previous. 2014-03-20 Jiri Vanek Clear cache function made more visible. * netx/net/sourceforge/jnlp/cache/CacheUtil.java: (okToClearCache) released never released lock. (clearCache) now recriated directory after cleaning. * netx/net/sourceforge/jnlp/controlpanel/CachePane.java: Added delete all button. (restoreDisabled) and (disableButtons) are containing duplicated code. (invokeLaterDeleteAll) and (visualCleanCache) utility methods accessing CacheUtil.clearCache. * netx/net/sourceforge/jnlp/resources/Messages.properties: added (CVCPCleanCache) and (CVCPCleanCacheTip) keys * netx/net/sourceforge/jnlp/splashscreen/parts/JEditorPaneBasedExceptionDialog.java: added (cacheButton) * netx/net/sourceforge/jnlp/util/BasicExceptionDialog.java: also added (cacheButton) but also included some layout refactoring to have buttons in row. 2014-03-20 Jiri Vanek Methods validating manifests' attributes moved to separate class. * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: Cleaned imports. At (init) methods (checkCodebaseAttribute), (checkPermissionsAttribute) and (checkApplicationLibraryAllowableCodebaseAttribute) moved to ManifestsAttributesValidator. (guessCodeBase) generalized in UrlUtils. * netx/net/sourceforge/jnlp/runtime/ManifestsAttributesValidator.java: new class. Contains logic to validate manifests'attributes. * netx/net/sourceforge/jnlp/util/UrlUtils.java: added method (guessCodeBase) as generalization of JNLPClassLoader's guessCodeBase method. 2014-03-14 Andrew Azores Added new PartiallySigned Dialog to replace NotAllSignedWarningPane. Also includes a Sandbox button. * netx/net/sourceforge/jnlp/resources/Messages.properties: (APPEXTSecunsignedAppletActionSandbox, LPartiallySignedApplet, LPartiallySignedAppletUserDenied) new messages. (SNotAllSignedSummary, SNotAllSignedDetail, SNotAllSignedQuestion) keys renamed to SPartially* * netx/net/sourceforge/jnlp/resources/Messages_cs.properties: (SNotAllSignedSummary, SNotAllSignedDetail, SNotAllSignedQuestion) keys renamed to SPartially* * netx/net/sourceforge/jnlp/resources/Messages_de.properties: same * netx/net/sourceforge/jnlp/resources/Messages_pl.properties: same * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: Logic added for displaying new PartiallySigned dialog. (showNotAllSignedDialog) removed. (getSigningState) new method. (promptUserOnPartialSigning, userPromptedForPartialSigning) new methods for SecurityDelegate. * netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/AppTrustWarningDialog.java: (partiallySigned) new method * netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/AppTrustWarningPanel.java: (chosenActionSetter) refactored to allow Sandbox action. (setupInfoPanel) applet title made overrideable by subclasses * netx/net/sourceforge/jnlp/security/SecurityDialog.java: (NOTALLSIGNED_WARNING) renamed PARTIALLYSIGNED_WARNING, display new dialog rather than old * netx/net/sourceforge/jnlp/security/SecurityDialogs.java: (NOTALLSIGNED_WARNING) renamed PARTIALLYSIGNED_WARNING. (showNotAllSignedWarningDialog) removed. (showPartiallySignedWarningDialog) new method * netx/net/sourceforge/jnlp/security/appletextendedsecurity/ExecuteAppletAction.java: Added Sandbox action * netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletTrustConfirmation.java: (checkPartiallySignedWithUserIfRequired) new method * tests/reproducers/custom/SignedAppletCodebaseLoading/testcases/SignedAppletCodebaseLoadingTests.java: test now passes since dialog will not appear if applet security is set to Low. KnownToFail removed. * tests/reproducers/custom/SignedAppletExternalMainClass/testcases/SignedAppletExternalMainClassTest.java: same * netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/PartiallySignedAppTrustWarningPanel.java: new class * netx/net/sourceforge/jnlp/security/dialogs/NotAllSignedWarningPane.java: deleted in favour of PartiallySignedAppTrustWarningPanel 2014-03-14 Andrew Azores * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditor.java: (addNewCodebase) ensure that checkboxes update. (removeCodebase, updateCheckboxes) ensure UI updates are done on EDT. 2014-03-14 Jiri Vanek Base implementation of Application-Library-Allowable-Codebase. Remember button not yet working. * netx/net/sourceforge/jnlp/JNLPFile.java: (ClasspathMatchers) (getApplicationLibraryAllowableCodebase) (getCodebase) (getCodeBaseMatchersAttribute) (getCodeBaseMatchersAttribute) (getCodeBaseMatchersAttribute) changed signature to include/not include path in returned matcher. * netx/net/sourceforge/jnlp/resources/Messages.properties: Added keys (ALACAMissingMainTitle) (ALACAMissingInfo) (ALACAMatchingMainTitle) (ALACAMatchingInfo) for new dialogs. * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: Implemented (checkApplicationLibraryAllowableCodebaseAttribute). Used in (init) * netx/net/sourceforge/jnlp/security/SecurityDialog.java: made aware of new constants (MISSING_ALACA) and (MATCHING_ALACA) * netx/net/sourceforge/jnlp/security/SecurityDialogs.java: new constants (MISSING_ALACA) and (MATCHING_ALACA). Implemented (showMissingALACAttributePanel) and (showMatchingALACAttributePanel) * netx/net/sourceforge/jnlp/security/dialogs/MatchingALACAttributePanel.java new dialog for Matching attribute * netx/net/sourceforge/jnlp/security/dialogs/MissingALACAttributePanel.java: new dialog for Missing attribute. * netx/net/sourceforge/jnlp/util/ClasspathMatcher.java: allowing user to choose whether to include paths in matching or not. * netx/net/sourceforge/jnlp/util/UrlUtils.java: new util methods (removeFileName) (setOfUrlsToHtmlList) (sanitizeLastSlash) and (equalsIgnoreLastSlash) to strip filename from url, toString for iterable of urls to string, and for operations with URLs independently on last slash * tests/netx/unit/net/sourceforge/jnlp/util/ClasspathMatcherTest.java: added tests for paths * tests/netx/unit/net/sourceforge/jnlp/util/UrlUtilsTest.java: added tests for new methods 2014-03-13 Andrew Azores * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditor.java: (savePolicyFile, updateMd5WithDialog) avoid NPE when saving to a new file 2014-03-13 Jiri Vanek * tests/netx/unit/net/sourceforge/jnlp/runtime/JNLPClassLoaderTest.java: adapted to permissions attribute 2014-03-13 Jiri Vanek Fixing rear deadlock issue * netx/net/sourceforge/jnlp/util/logging/ConsoleOutputPane.java: removed (probably) unnecessary synchronization of (refreshPaneBody). 2014-03-13 Jiri Vanek Fixed appearance of download indicator * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: (init) attributes are allowed to access jars only once all resources are downloaded 2014-03-12 Jiri Vanek * configure.ac: added check for /bin/bash 2014-03-12 Andrew Azores * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditor.java: (initializeMapForCodebase) returns boolean indicating if the given codebase already existed. (addNewCodebase) do not add codebases if they already exist 2014-03-12 Andrew Azores * netx/net/sourceforge/jnlp/resources/Messages.properties: (PEFileModified, PEFileModifiedDetail) new messages * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditor.java: (fileWatcher, openAndParsePolicyFile, savePolicyFile) update to use MD5SumWatcher to check if the file has changed externally since being opened * tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PolicyEditorTest.java: URLs changed to example.com 2014-03-12 Andrew Azores * netx/net/sourceforge/jnlp/resources/Messages.properties: (PECodebaseFlag) new message for policyeditor -help * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditor.java: (HELP_MESSAGE) added -codebase flag * netx/policyeditor.1: updated -file and added -codebase and -help 2014-03-11 Andrew Azores * netx/net/sourceforge/jnlp/security/policyeditor/PermissionTarget.java: (TMPDIR) is java.io.tmpdir, not io.tmpdir 2014-03-11 Jiri Vanek New java console made localizable. * netx/net/sourceforge/jnlp/resources/Messages.properties: added new family of keys (COP) for new console * netx/net/sourceforge/jnlp/util/logging/ConsoleOutputPane.java: where reasonable, strings replaced by records in properties. * netx/net/sourceforge/jnlp/util/logging/JavaConsole.java: (rawData) and (outputs) made final. 2014-03-11 Jiri Vanek * netx/net/sourceforge/jnlp/resources/Messages.properties: added (CONSOLEClean) key for new button * netx/net/sourceforge/jnlp/util/logging/ConsoleOutputPane.java: (update) method enhanced for possibility to force refresh * netx/net/sourceforge/jnlp/util/logging/JavaConsole.java: added ButClean button. (updateModel) overlaoded with force attribute. 2014-03-11 Jiri Vanek * netx/policyeditor.1: Mentioned that it is more GUI then commandline tool 2014-03-11 Jiri Vanek Implemented Permissions manifest entry handling. * NEWS: mentioned Permissions attribute * netx/net/sourceforge/jnlp/JNLPFile.java: new enum (ManifestBoolean) introduced to replace true/false/null by TRUE/FALSE/UNDEFFINED. (isTrustedOnly), (isTrustedLibrary), (isSandboxForced) and (processBooleanAttribute) moved to use ManifestBoolean. * netx/net/sourceforge/jnlp/resources/Messages.properties: Added (ButYes) (ButNo) (MissingPermissionsMainTitle) and (MissingPermissionsInfo) keys * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: is now checking (checkPermissionsAttribute) in (init). Implemented new (checkPermissionsAttribute) method to handle Permissions attribute * netx/net/sourceforge/jnlp/security/SecurityDialog.java: can handle (UNSIGNED_EAS_NO_PERMISSIONS_WARNING) * netx/net/sourceforge/jnlp/security/SecurityDialogs.java: defined (UNSIGNED_EAS_NO_PERMISSIONS_WARNING ) and (showMissingPermissionsAttributeDialogue) * netx/net/sourceforge/jnlp/security/dialogs/MissingPermissionsAttributePanel.java: new class, implementation of missing permissions attribute panel. * netx/net/sourceforge/jnlp/security/dialogs/SecurityDialogPanel.java: changed (initialFocusComponent) from package private to descendant visible * tests/netx/unit/net/sourceforge/jnlp/runtime/CodeBaseClassLoaderTest.java: and * tests/netx/unit/net/sourceforge/jnlp/runtime/JNLPFileTest.java: adapted to (ManifestBoolean) and to Permissions attribute handling at all. 2014-03-10 Omair Majid * netx/javaws.1, * netx/itweb-settings.1: Change "SYNOPSYS" to "SYNOPSIS". * NEWS: Add itweb-setings man page. 2014-03-10 Andrew Azores Added MD5SumWatcher utility class to detect when a file's contents have been changed on disk. * netx/net/sourceforge/jnlp/util/FileUtils.java: (getFileMD5Sum) new function * netx/net/sourceforge/jnlp/util/MD5SumWatcher.java: new class * tests/netx/unit/net/sourceforge/jnlp/util/MD5SumWatcherTest.java: new tests for MD5SumWatcher 2014-03-10 Andrew Azores * tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PolicyEditorPermissionsTest.java: (testActionsRegex, testTargetRegex, testRegexesAgainstBadPermissionNames): update after moving regexes from PolicyEditorPermissions into CustomPermission 2014-03-10 Andrew Azores PolicyEditor parsing enhancements, new tests, and bugfixes * NEWS: added entry for PolicyEditor * netx/net/sourceforge/jnlp/resources/Messages.properties: (PESaveAsMenuItemMnemonic, PEExitMenuItemMnemonic) changed mnemonic keys due to masking with ctrl rather than alt * netx/net/sourceforge/jnlp/security/policyeditor/CustomPermission.java: (ACTIONS_PERMISSION, TARGET_PERMISSION, fromString) use regexes to parse * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditor.java: (file) keep reference to File rather than String filePath. (getPermissions) returns empty map rather than null. (setComponentMnemonic) new method. (getCustomPermissions) new function. (openAndParsePolicyFile) check for OpenFileResult FAILURE and NOT_FILE rather than null. (setupLayout) File, Save, SaveAs, and Exit items modifier mask changed to Ctrl rather than Alt * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditorPermissions.java: (fromString) use regexes to parse, using CustomPermission as intermediate representation * netx/net/sourceforge/jnlp/util/FileUtils.java: (testDirectoryPermissions) add check for getCanonicalFile and null safeguarding. (testFilePermissions) add check for getCanonicalFile and return FAILURE rather than null * tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/CustomPermissionTest.java: (testMissingQuotationMarks) new test * tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PolicyEditorTest.java: (testReturnedCustomPermissionsSetIsCopy, testCodebaseTrailingSlashesDoNotMatch) new tests * tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PolicyEditorParsingTest.java: new tests 2014-03-10 Omair Majid * Makefile.am (install-data-local): Install itweb-settings.1. * netx/itweb-settings.1: New file. 2014-03-10 Jiri Vanek Added getter for java-abrt-connector on demand whitelist of fields. * netx/net/sourceforge/jnlp/Launcher.java: (launch) saving (location.toExternalForm()) via JNLPRuntime.saveHistory * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java: (history) new static field with getter (getHistory) and "setter" (saveHistory) * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java: (handleInitializationMessage) saving (documentBase) via JNLPRuntime.saveHistory 2014-03-10 Jiri Vanek Actualized man page for javaws * netx/javaws.1: made sync with current state 2014-03-10 Jiri Vanek Fixed rhbz#1072013 * netx/net/sourceforge/jnlp/PluginBridge.java: The (fileLocation) of JNLPFile is now properly set in constructor if not existing. 2014-03-06 Andrew Azores * NEWS: added -version flag entry * netx/net/sourceforge/jnlp/resources/Messages.properties: (BOVersion) new message for command line -version flag * netx/net/sourceforge/jnlp/runtime/Boot.java: (main) added "-version" flag 2014-03-05 Jiri Vanek All security dialogs moved to appropriate package * netx/net/sourceforge/jnlp/security/AccessWarningPane.java: to * netx/net/sourceforge/jnlp/security/dialogs/AccessWarningPane.java: * netx/net/sourceforge/jnlp/security/AppletWarningPane.java: to * netx/net/sourceforge/jnlp/security/dialogs/AppletWarningPane.java: * netx/net/sourceforge/jnlp/security/CertWarningPane.java: to * netx/net/sourceforge/jnlp/security/dialogs/CertWarningPane.java * netx/net/sourceforge/jnlp/security/CertsInfoPane.java: to * netx/net/sourceforge/jnlp/security/dialogs/CertsInfoPane.java: * netx/net/sourceforge/jnlp/security/MoreInfoPane.java: to * netx/net/sourceforge/jnlp/security/dialogs/MoreInfoPane.java: * netx/net/sourceforge/jnlp/security/NotAllSignedWarningPane.java: to * netx/net/sourceforge/jnlp/security/dialogs/NotAllSignedWarningPane.java: * netx/net/sourceforge/jnlp/security/PasswordAuthenticationPane.java: to * netx/net/sourceforge/jnlp/security/dialogs/PasswordAuthenticationPane.java: * netx/net/sourceforge/jnlp/security/SecurityDialogPanel.java: to * netx/net/sourceforge/jnlp/security/dialogs/SecurityDialogPanel.java: * netx/net/sourceforge/jnlp/security/SingleCertInfoPane.java: to * netx/net/sourceforge/jnlp/security/dialogs/SingleCertInfoPane.java: * netx/net/sourceforge/jnlp/security/AppTrustWarningDialog.java: to * netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/AppTrustWarningDialog.java: * netx/net/sourceforge/jnlp/security/AppTrustWarningPanel.java: to * netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/AppTrustWarningPanel.java: * netx/net/sourceforge/jnlp/security/UnsignedAppletTrustWarningDialog.java: to * netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/UnsignedAppletTrustWarningDialog.java: * netx/net/sourceforge/jnlp/security/UnsignedAppletTrustWarningPanel.java: to * netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/UnsignedAppletTrustWarningPanel.java: * tests/netx/unit/net/sourceforge/jnlp/security/AppTrustWarningPanelTest.java: to * tests/netx/unit/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/AppTrustWarningPanelTest.java: * tests/netx/unit/net/sourceforge/jnlp/util/ClasspathMatcherTest.java: necessary changes * netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletTrustConfirmation.java: necessary changes * netx/net/sourceforge/jnlp/security/SecurityDialogs.java: necessary changes * netx/net/sourceforge/jnlp/security/SecurityDialogMessageHandler.java: necessary changes * netx/net/sourceforge/jnlp/security/SecurityDialog.java: necessary changes * netx/net/sourceforge/jnlp/security/KeyStores.java: necessary changes * netx/net/sourceforge/jnlp/security/HttpsCertVerifier.java: necessary changes * netx/net/sourceforge/jnlp/security/CertificateUtils.java: necessary changes 2014-03-05 Jiri Vanek * netx/net/sourceforge/jnlp/security/AppTrustWarningPanel.java: fixed layout so buttons do not disappear under radioboxes. * netx/net/sourceforge/jnlp/security/UnsignedAppletTrustWarningPanel.java: added testable main method. 2014-03-05 Jiri Vanek * tests/netx/unit/net/sourceforge/jnlp/security/AppTrustWarningPanelTest.java: removed unused imports * tests/netx/unit/net/sourceforge/jnlp/util/ClasspathMatcherTest.java: added test for plain * in ClasspathMatcher.ClasspathMatchers.compile() 2014-03-05 Matthias Klose * launcher/launchers.in: Use bash as shebang. 2014-03-04 Andrew Azores * netx/net/sourceforge/jnlp/resources/Messages.properties: (SAppletTitle) new message * netx/net/sourceforge/jnlp/security/AppTrustWarningPanel.java: (buttons) new list of UI buttons. (getAllowButton, getRejectButton, addComponents) made final. (createButtonPanel) uses list of buttons rather than hardcoded. (helpButton) action made configurable. 2014-03-03 Omair Majid PR857 * netx/net/sourceforge/jnlp/about/AboutDialog.java (run): Do not set look and feel. * netx/net/sourceforge/jnlp/runtime/Boot.java (main) : Set look and feel before displaying dialog. * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java (initialize): Set look and feel before any UI is created. * netx/net/sourceforge/jnlp/security/SecurityDialog.java (init): Do not set look and feel. (setSystemLookAndFeel): Removed. * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditor.java (createInstance): Do not set look and feel. * netx/net/sourceforge/jnlp/security/viewer/CertificateViewer.java (showCertificateViewer): Do not set look and feel. (setSystemLookAndFeel): Removed. 2014-03-03 Omair Majid PR1676 * netx/net/sourceforge/jnlp/SecurityDesc.java: Add permission to read/write useLegacyMergeSort. 2014-03-03 Andrew Azores UnsignedAppletTrustWarningPanel logic moved into new abstract parent class AppTrustWarningPanel for reusability. * netx/net/sourceforge/jnlp/security/AppTrustWarningDialog.java: new class * netx/net/sourceforge/jnlp/security/AppTrustWarningPanel.java: new class * netx/net/sourceforge/jnlp/security/UnsignedAppletTrustWarningPanel.java: major refactor into subclass of AppTrustWarningPanel * netx/net/sourceforge/jnlp/security/SecurityDialogs.java: (UnsignedWarningAction) references changed to AppSigningWarningAction * netx/net/sourceforge/jnlp/security/UnsignedAppletTrustWarningDialog.java: same * tests/netx/unit/net/sourceforge/jnlp/security/AppTrustWarningPanelTest.java: new tests for AppTrustWarningPanel * netx/net/sourceforge/jnlp/security/appletextendedsecurity/ExecuteUnsignedApplet.java: renamed, changed all references * netx/net/sourceforge/jnlp/security/appletextendedsecurity/ExecuteAppletAction.java: (ExecuteUnsignedApplet) renamed to this * netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletActionTableModel.java: (ExecuteAppletAction) changed references * netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletsTrustingListPanel.java: (ExecuteAppletAction) changed references * netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletActionEntry.java: (ExecuteAppletAction) changed references * netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletTrustConfirmation.java: (ExecuteAppletAction) changed references * netx/net/sourceforge/jnlp/security/appletextendedsecurity/impl/UnsignedAppletActionStorageExtendedImpl.java: (ExecuteAppletAction) changed references * netx/net/sourceforge/jnlp/security/appletextendedsecurity/impl/UnsignedAppletActionStorageImpl.java: (ExecuteAppletAction) changed references 2014-02-28 Andrew Azores Added "Sandbox" button to CertWarning dialogs, allowing signed applets to be run with restricted permissions * netx/net/sourceforge/jnlp/resources/Messages.properties: (ButSandbox, LRunInSandboxError, LRunInSandboxErrorInfo, CertWarnRunTip, CertWarnSandboxTip, CertWarnCancelTip): new messages * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: (createInstance) added check to not display unsigned warning dialog if the cert warning dialog has been presented and the applet is sandboxed. (checkTrustWithUser) updated for Run In Sandbox functionality. (setRunInSandbox, userPromptedForSandbox) new functions * netx/net/sourceforge/jnlp/security/AppVerifier.java: (checkTrustWithUser) added SecurityDelegate param * netx/net/sourceforge/jnlp/security/CertWarningPane.java: added Sandbox button * netx/net/sourceforge/jnlp/security/JNLPAppVerifier.java: (checkTrustWithUser) uses AppletAction enum type, calls JNLPClassLoader#setRunInSandbox if AppletAction is SANDBOX * netx/net/sourceforge/jnlp/security/PluginAppVerifier.java: same * netx/net/sourceforge/jnlp/security/SecurityDialogs.java: added (AppletAction) enum type. (showCertWarning) returns AppletAction rather than boolean * netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java: (askUser) refactor to use AppletAction rather than boolean * netx/net/sourceforge/jnlp/tools/JarCertVerifier.java: (checkTrustWithUser) added SecurityDelegate param * tests/netx/unit/net/sourceforge/jnlp/security/SecurityDialogsTest.java: (testGetIntegerResponseAsAppletAction) new tests for converting Object references into AppletActions 2014-02-28 Andrew Azores * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: (SecurityDelegate, SecurityDelegateImpl) new interface and implementation. Includes logic for Run In Sandbox, which is not yet used (initializeResources, setSecurity, activateJars, addNewJar) refactored to use SecurityDelegate 2014-02-27 Andrew Azores * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: treat signed applets which load from the codebase as partially signed, and fix regression with signed applets loading main-classes from codebase * tests/reproducers/custom/SignedAppletCodebaseLoading/resources/SignedAppletCodebaseLoading.html: new test to ensure that signed applets with codebase loading can run * tests/reproducers/custom/SignedAppletCodebaseLoading/srcs/Makefile * tests/reproducers/custom/SignedAppletCodebaseLoading/srcs/SignedAppletCodebaseLoading.java * tests/reproducers/custom/SignedAppletCodebaseLoading/srcs/SignedAppletCodebaseLoadingHelper.java * tests/reproducers/custom/SignedAppletCodebaseLoading/testcases/SignedAppletCodebaseLoadingTests.java * tests/reproducers/custom/SignedAppletExternalMainClass/resources/SignedAppletExternalMainClass.html: new test to ensure that signed applets with codebase-loaded main-classes can run * tests/reproducers/custom/SignedAppletExternalMainClass/srcs/Makefile * tests/reproducers/custom/SignedAppletExternalMainClass/srcs/SignedAppletExternalMainClass.java * tests/reproducers/custom/SignedAppletExternalMainClass/srcs/SignedAppletExternalMainClassHelper.java * tests/reproducers/custom/SignedAppletExternalMainClass/testcases/SignedAppletExternalMainClassTest.java 2014-02-21 Jiri Vanek * acinclude.m4: added (IT_CHECK_XULRUNNER_API_VERSION_CONSTCHAR) macro, Added (IT_CHECK_XULRUNNER_API_VERSION_C11) * configure.ac: added call of IT_CHECK_XULRUNNER_API_CONSTCHAR and IT_CHECK_XULRUNNER_API_VERSION_C11 * plugin/icedteanp/IcedTeaNPPlugin.cc: (NP_GetMIMEDescription) return type set-up by dependency on defined LEGACY_XULRUNNERAPI. This one is set by IT_CHECK_XULRUNNER_API_VERSION during configure. if defined, then old char* is used. New const char* is used otherwise. 2014-02-20 Andrew Azores New simplified PolicyEditor for editing Java policy files, particularly user-level JNLP policies. * Makefile.am: added policyeditor launcher targets * netx/net/sourceforge/jnlp/controlpanel/PolicyPanel.java: (OpenFileResult, canOpenPolicyFile, testPolicyFileDirectory, showCouldNotOpenFileDialog, showReadOnlyDialog) moved into FileUtils. (PolicyPanel) added button for PolicyEditor. (launchSimplePolicyEditor) new function. (LaunchSimplePolicyEditorAction) new class, action for new button. * netx/net/sourceforge/jnlp/resources/Messages.properties: new messages for PolicyEditor * netx/net/sourceforge/jnlp/util/FileUtils.java: (OpenFileResult, testDirectoryPermissions, testFilePermissions, showReadOnlyDialog, showCouldNotOpenFileDialog) new functions * netx/net/sourceforge/jnlp/security/policyeditor/CustomPermission.java: new class * netx/net/sourceforge/jnlp/security/policyeditor/CustomPolicyViewer.java: new class * netx/net/sourceforge/jnlp/security/policyeditor/PermissionActions.java: new class * netx/net/sourceforge/jnlp/security/policyeditor/PermissionTarget.java: new class * netx/net/sourceforge/jnlp/security/policyeditor/PermissionType.java: new class * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditor.java: new class * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditorPermissions.java: new class * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEntry.java: new class * policyeditor.desktop.in: new launcher desktop file * tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/CustomPermissionTest.java: new class * tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PermissionActionsTest.java: new class * tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PermissionTargetTest.java: new class * tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PermissionTypeTest.java: new class * tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PolicyEditorPermissionsTest.java: new class * tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PolicyEditorTest.java: new class 2014-02-19 Michal Vyskocil Put link flags to the end of gcc command line to prevent link failures Make sure that path to PUBLIC_KEYSTORE exists to prevent keytool fail * tests/softkiller/Makefile: put -lX11 to the end of command line * Makefile.am: if path to PUBLIC_KEYSTORE does not exists, make it 2014-02-13 Jiri Vanek Get rid of ConcurrentModificationException in Console output. * netx/net/sourceforge/jnlp/util/logging/ConsoleOutputPaneModel.java: (importList) now synchronise over original data, instead of (somtimes by) copy as, wrongly, before. 2014-02-13 Jiri Vanek Added possibility to follow redirects for javaws in demand by -allowredirect switch. * netx/net/sourceforge/jnlp/cache/ResourceTracker.java: added inner class (CodeWithRedirect), which stores server result and possible redirection target (getUrlResponseCode) is only wrapper around new (getUrlResponseCodeWithRedirectonResult) which returns (CodeWithRedirect). It fills url form Location header field if any. (findBestUrl) now follow 301,302,303,307,308 redirects if enabled and valid - otherwise new (RedirectionException) is thrown. * netx/net/sourceforge/jnlp/resources/Messages.properties: described -allowredirect by (BOredirect) key. * netx/net/sourceforge/jnlp/runtime/Boot.java: and * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java: added handling of -allowredirect. New (allowRedirect) field. 2014-02-12 Jiri Vanek Fixed behaviour of href in jnlp file to correctly download another it if it is remote * netx/net/sourceforge/jnlp/Launcher.java: (fromUrl) if file is not local, and have href and href point elsewhere, then it is used as future jnlpfile * tests/reproducers/simple/GeneratedId/testcases/GeneratedIdTest.java: (launchRemoteChangedFileWithHref) adapted to new behaviour 2014-02-12 Jiri Vanek Implemented Codebase manifest entry handling. * netx/net/sourceforge/jnlp/JNLPFile.java: manifests names constants moved into ManifestsAttributes inner class.(getCallerAllowableCodebase) (getApplicationLibraryAllowableCodebase) (getCodebase) (getCodeBaseMatchersAttribute) (getCodeBaseMatchersAttribute) are now returning (ClasspathMatcher.ClasspathMatchers). added boolean access to (isTrustedOnly) (isTrustedLibrary). * netx/net/sourceforge/jnlp/resources/Messages.properties: added (CBCheckFile) (CBCheckNoEntry) (CBCheckUnsignedPass) (CBCheckUnsignedPass) (CBCheckOkSignedOk) (CBCheckOkSignedOk) (CBCheckOkSignedOk) keys to inform about Classpath validation * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: in Init call new method (checkCodebaseAttribute) which check the codebase manifest entry. * netx/net/sourceforge/jnlp/util/ClasspathMatcher.java: New class, responsible for matching Classpath like pattern with URL * tests/netx/unit/net/sourceforge/jnlp/runtime/JNLPFileTest.java: added tests to cover all newly accessible attributes from JNLPFile.ManifestsAttributes * tests/netx/unit/net/sourceforge/jnlp/util/ClasspathMatcherTest.java: mostly corner and must-fullfill cases tests. * tests/test-extensions/net/sourceforge/jnlp/util/FileTestUtils.java: (assertNoFileLeak) have timeout before actual countings. JVM needs time to propagate cleanup. * tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/: * tests/reproducers/signed/CodeBaseManifestEntrySignedNotMatching/: * tests/reproducers/simple/CodeBaseManifestEntryUnsignedMatching/: *tests/reproducers/simple/CodeBaseManifestEntryUnsignedNotMatching/: New set of reproducers to test Codebases processing. All testcas are in (CodeBaseManifestEntrySignedMatching) so they can share code. 2014-02-11 Andrew Azores Partial revert of 7933143a1286, refactoring to move codebase-loading-enabling logic out of Launcher and into JNLPClassLoader. * netx/net/sourceforge/jnlp/Launcher.java: (createApplet, createAppletObject): handle enableCodebase again * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: (enableCodebase): re-added, codebase enabling logic moved back out into Launcher 2014-02-05 Jiri Vanek Added salt to plugin-java pipes' directory (fixing RH1010958) * plugin/icedteanp/IcedTeaNPPlugin.cc: (cleanUpDir) new utility method to clean up pipes directory. (start_jvm_if_needed) is now returning error status and creating salt in directory name. (initialize_data_directory) now add salt to the name. * plugin/icedteanp/IcedTeaNPPlugin.h: changed declaration of (start_jvm_if_needed) 2014-02-04 Jacob Wisor Added missing PL localized messages * netx/net/sourceforge/jnlp/resources/Messages_pl.properties: added RCantOpenFile RCantWriteFile RFileReadOnly RExpectedFile CPPolicyDetail CPPolicyTooltip CPPolicyEditorNotFound CPButPolicy CPHeadPolicy CPTabPolicy. Modified SSigUnverified SSigVerified SSignatureError 2014-02-04 Jacob Wisor Added missing DE localized messages * netx/net/sourceforge/jnlp/resources/Messages_de.properties: added RCantOpenFile RCantWriteFile RFileReadOnly RExpectedFile CPPolicyDetail CPPolicyTooltip CPPolicyEditorNotFound CPButPolicy CPHeadPolicy CPTabPolicy. Modified SSigUnverified SSigVerified SSignatureError 2014-01-31 Jacob Wisor * netx/net/sourceforge/jnlp/util/logging/ConsoleOutputPaneModel.java: (importList) Separate XHTML fix due to revision 884 2014-01-30 Jacob Wisor * Javadoc, XHTML conformance, and formatting cleanup 2014-01-30 Andrew Azores * NEWS: added entry for PolicyPanel * netx/net/sourceforge/jnlp/controlpanel/PolicyPanel.java: added class-level Javadoc comment, made some local variables final, added reflective fallback case for JRE 6 PolicyTool location 2014-01-29 Andrew Azores Fix for regression due to PR1513 fix. ClassLoader was too optimistic about finding codebase main-classes and so the not-all-signed dialog would appear even for applets that were entirely broken and could not be loaded at all. * netx/net/sourceforge/jnlp/Launcher.java: (createApplet, createAppletObject) pass enableCodeBase to JNLPClassLoader * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: (enableCodeBase) removed, now done by constructor argument. (checkNotAllSignedWithUser) minor refactor. (initializeResources) actually check if main-class is loadable from codebase when this is suspected, rather than assuming it will be there 2014-01-27 Andrew Azores MixedSigningApplet reproducer (PR1592) moved into custom reproducer. JNLP files generated per-test rather than premade. Many new tests added. * tests/reproducers/custom/MixedSigningApplet/resources/MixedSigningApplet.html: moved to custom reproducer * tests/reproducers/custom/MixedSigningApplet/resources/MixedSigningApplet.jnlp: moved to custom reproducer and now used as template by testcases file * tests/reproducers/custom/MixedSigningApplet/srcs/Makefile: new Makefile for custom reproducer * tests/reproducers/custom/MixedSigningApplet/srcs/MixedSigningAppletHelper.java * tests/reproducers/custom/MixedSigningApplet/srcs/MixedSigningAppletSigned.java * tests/reproducers/custom/MixedSigningApplet/testcases/MixedSigningAppletSignedTests.java: new tests added, JNLP files generated per-test rather than all prepackaged * tests/reproducers/signed/MixedSigningAppletSigned/srcs/MixedSigningAppletSigned.java: moved to custom reproducer * tests/reproducers/signed/MixedSigningAppletSigned/testcases/MixedSigningAppletSignedTests.java * tests/reproducers/simple/MixedSigningApplet/resources/MixedSigningApplet-1.jnlp * tests/reproducers/simple/MixedSigningApplet/resources/MixedSigningApplet-2.jnlp * tests/reproducers/simple/MixedSigningApplet/resources/MixedSigningApplet-3.jnlp * tests/reproducers/simple/MixedSigningApplet/resources/MixedSigningApplet-4.jnlp * tests/reproducers/simple/MixedSigningApplet/resources/MixedSigningApplet-5.jnlp * tests/reproducers/simple/MixedSigningApplet/resources/MixedSigningApplet-6.jnlp * tests/reproducers/simple/MixedSigningApplet/resources/MixedSigningApplet.html * tests/reproducers/simple/MixedSigningApplet/srcs/MixedSigningAppletHelper.java 2014-01-27 Jiri Vanek Tuning of properties loading. * netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java: added (resetToDefaults) methods to set default values to map. (loadSystemConfiguration) now throws ConfigurationException. Added more verbose error messages. The ioexception is now also cause of ConfigurationException if mandatory is on. * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java: now correctly fails to initiate if ConfigurationException appeared. Init of (configuration) now catch general exception, and fall back to default (instead of die fatally with NoClassDefFoundError). User is warned. * netx/net/sourceforge/jnlp/resources/Messages.properties: new key of (RFailingToDefault) added. 2014-01-24 Andrew Azores http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2014-January/025971.html * netx/net/sourceforge/jnlp/controlpanel/PolicyPanel.java: added license header and javadocs. Launch PolicyTool by ProcessBuilder rather than calling PolicyTool.main directly, with reflective launch fallback method. * netx/net/sourceforge/jnlp/resources/Messages.properties: added message (CPPolicyEditorNotFound) 2014-01-23 Omair Majid * Makefile.am [ENABLE_DOCS] [JAVADOC_SUPPORTS_J_OPTIONS]: Don't specify perm gen size. 2014-01-23 Omair Majid * netx/net/sourceforge/jnlp/JNLPFile.java, * netx/net/sourceforge/jnlp/NetxPanel.java, * netx/net/sourceforge/jnlp/cache/CacheLRUWrapper.java, * netx/net/sourceforge/jnlp/cache/CacheUtil.java, * netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java, * netx/net/sourceforge/jnlp/config/DirectoryValidator.java, * netx/net/sourceforge/jnlp/config/Setting.java, * netx/net/sourceforge/jnlp/controlpanel/AdvancedProxySettingsDialog.java, * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java, * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java, * netx/net/sourceforge/jnlp/runtime/RhinoBasedPacEvaluator.java, * netx/net/sourceforge/jnlp/security/SecurityDialogs.java, * netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java, * netx/net/sourceforge/jnlp/services/XSingleInstanceService.java, * netx/net/sourceforge/jnlp/util/FileUtils.java, * netx/net/sourceforge/jnlp/util/JarFile.java, * netx/net/sourceforge/nanoxml/XMLElement.java, * netx/net/sourceforge/nanoxml/XMLParseException.java, * plugin/icedteanp/java/sun/applet/PluginStreamHandler.java: Fix incorrect parameter names, throws declerations and malformed html in javadocs. 2014-01-20 Jiri Vanek Added Christmas splashscreen extension. * netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/BasePainter.java: base colors are derived from active extension. And extension is painted (if any) * netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/ErrorPainter.java: same * netx/net/sourceforge/jnlp/splashscreen/parts/extensions/ChristmasExtension.java: extension valid in Christmas time, painting falling stars and dimming colors. * netx/net/sourceforge/jnlp/splashscreen/parts/extensions/ExtensionManager.java provider of extension. Know only the Christmas one right now. * netx/net/sourceforge/jnlp/splashscreen/parts/extensions/NoExtension.java: no op extension for no extension times * netx/net/sourceforge/jnlp/splashscreen/parts/extensions/SplashExtension.java: unfinished extension interface * tests/netx/unit/net/sourceforge/jnlp/splashscreen/ErrorSplashScreenTest.java: and * tests/netx/unit/net/sourceforge/jnlp/splashscreen/SplashScreenTest.java: adapted to current purposes 2014-01-20 Jiri Vanek Added support for system level linux logging * netx/net/sourceforge/jnlp/util/logging/OutputController.java: exclusive handling for system critical *java* messages when system logging is on. * netx/net/sourceforge/jnlp/util/logging/UnixSystemLog.java: implemented call to logger * plugin/icedteanp/IcedTeaPluginUtils.h: error messages logged to syslog * plugin/icedteanp/java/sun/applet/PluginDebug.java: default messages are now MESSAGE_DEBUG instead of ERROR_ALL * tests/cpp-unit-tests/IcedTeaPluginUtilsTest.c: adapted to system logging 2014-01-17 Andrew Azores Added itweb-settings panel to explain custom policy files and allow launching a policy editor for user's policy file. * netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java: (createMainSettingsPanel, createPolicySettingsPanel) added PolicyPanel * netx/net/sourceforge/jnlp/resources/Messages.properties: new messages for PolicyPanel * netx/net/sourceforge/jnlp/controlpanel/PolicyPanel.java: new panel to allow launching of external policy editor * tests/reproducers/simple/CustomPolicies/resources/CustomPolicies.html: new test to ensure custom user policy files work correctly * tests/reproducers/simple/CustomPolicies/resources/CustomPoliciesApplet.jnlp * tests/reproducers/simple/CustomPolicies/resources/CustomPoliciesApplication.jnlp * tests/reproducers/simple/CustomPolicies/resources/CustomPoliciesJnlpHref.html * tests/reproducers/simple/CustomPolicies/srcs/CustomPolicies.java * tests/reproducers/simple/CustomPolicies/testcases/CustomPoliciesTest.java 2014-01-17 Andrew Azores Fixes JS reproducer regression. http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2014-January/025764.html * plugin/icedteanp/IcedTeaScriptablePluginObject.cc: (hasMethod) fixed regression from rev 757:ee92f55c69a3 2014-01-16 Jiri Vanek Reproducers stabilization by removing check for not presented general Exception or error. * netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java: removed legacy debug call * netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java: as in subject, and same in others * tests/reproducers/signed/AppletTestSigned/testcases/AppletTestSignedTests.java: * tests/reproducers/signed/ClasspathManifestTest/testcases/ClasspathManifestTest.java: * tests/reproducers/signed/ClipboardContentSigned/testcases/ClipboardContentSignedTests.java: * tests/reproducers/signed/InternalClassloaderWithDownloadedResource/testcases/InternalClassloaderWithDownloadedResourceTest.java: * tests/reproducers/signed/Spaces can be everywhere signed/testcases/SpacesCanBeEverywhereTestsSigned.java: * tests/reproducers/signed2/MultipleSignaturesTest/testcases/MultipleSignaturesTestTests.java: * tests/reproducers/simple/AppletTest/testcases/AppletTestTests.java: * tests/reproducers/simple/JSToJSet/testcases/JSToJSetTest.java: * tests/reproducers/simple/LocalisedInformationElement/testcases/LocalisedInformationElementTest.java: * tests/reproducers/simple/ParametrizedJarUrl/testcases/ParametrizedJarUrlTests.java: * tests/reproducers/simple/Spaces can be everywhere/testcases/SpacesCanBeEverywhereTests.java: * tests/reproducers/simple/deadlocktest/testcases/DeadLockTestTest.java: * tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/testcases/EncodingTestTest.java: * tests/reproducers/simple/simpletest1/testcases/SimpleTest1Test.java: 2014-01-15 Jiri Vanek Fixed memory leak detector to correctly handle pre_init_messages queue. * plugin/icedteanp/IcedTeaPluginUtils.cc: implemented (reset_pre_init_messages) method. * plugin/icedteanp/IcedTeaPluginUtils.h: declared (reset_pre_init_messages). * tests/cpp-unit-tests/MemoryLeakDetector.h: (reset_global_state) called (reset_pre_init_messages). 2014-01-09 Andrew Azores * html-gen.sh: made more idiomatic and removed some bashisms 2014-01-06 Jiri Vanek Copy all button in console controls sorts by date by default. * netx/net/sourceforge/jnlp/util/logging/ConsoleOutputPane.java: added (sortCopyAll) checkbox. Logic from (copyPlainActionPerformed) and (copyRichActionPerformed) extracted to new (fillClipBoard) which also used correct call of ConsoleOutputPaneModel.importList based on (sortCopyAll) value. * netx/net/sourceforge/jnlp/util/logging/ConsoleOutputPaneModel.java: added abstraction for (importList) to allow sorting via parameter 2014-01-06 Jiri Vanek Removed dependence on sun.misc.BASE64Decoder * configure.ac: removed check for sun.misc.BASE64Decoder * netx/net/sourceforge/jnlp/PluginBridge.java : sun.misc.BASE64Decoder import replaced by net.sourceforge.jnlp.util.replacements.BASE64Decoder * netx/net/sourceforge/jnlp/util/replacements/BASE64Decoder.java: new file, in-tree copy from jdk7 * netx/net/sourceforge/jnlp/util/replacements/CharacterDecoder.java: likewise * tests/netx/unit/net/sourceforge/jnlp/util/replacements/BASE64DecoderTest.java: new tests for new files * tests/netx/unit/net/sourceforge/jnlp/util/replacements/BASE64EncoderTest.java: (getAndInvokeMethod), (encoded) and (sSrc) made public final. Corrected usage of (encoded2), added new test (testEmbededBase64EncoderAgainstEbededDecoder) to test with internal decoder. 2014-01-02 Andrew Azores Added ChangeLog revision hyperlinking to html-gen.sh * html-gen.sh: ChangeLog dates made hyperlinks to corresponding commits 2013-12-27 Andrew Azores Resolve deadlock issue in JNLPClassLoader. See http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2013-December/025546.html * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: (loadClassLock) removed. (available, jarIndexes, classpaths, jarEntries, jarLocationSecurityMap) fields wrapped in Collections.synchronized*() to provide atomic read/write. Synchronized on while iterating over these collections. (loadClass) no longer uses implicit JNLPClassLoader instance lock nor dedicated loadClassLock object. 2013-12-20 Jiri Vanek Rewritten java console * netx/net/sourceforge/jnlp/Launcher.java: fatal error from lunch can reach console * netx/net/sourceforge/jnlp/util/logging/ConsoleOutputPane.java: new console, controls * netx/net/sourceforge/jnlp/util/logging/ConsoleOutputPaneModel.java: data manager of new console. * netx/net/sourceforge/jnlp/util/logging/JavaConsole.java: removed old gui, now using multiple 1-n instances of ConsoleOutputPane with theirs models. (addMessage) now receive MessageWithHeader object instead body and header. * netx/net/sourceforge/jnlp/util/logging/headers/Header.java: have not null defaults * netx/net/sourceforge/jnlp/util/logging/headers/ObservableMessagesProvider.java: abstraction of datasource for new console * tests/netx/unit/net/sourceforge/jnlp/util/logging/JavaConsoleTest.java: adapted. 2013-12-20 Jiri Vanek fixed CacheLRUWrapperTest * netx/net/sourceforge/jnlp/cache/CacheLRUWrapper.java: (cacheDir) and (cacheOrder) made package private for testing purposes. * tests/netx/unit/net/sourceforge/jnlp/cache/CacheLRUWrapperTest.java: True testing cache file is now prepared, tested, and removed. the CacheLRUWrapper is using this testing repo. 2013-12-20 Jiri Vanek finished removal of legacy xulrunner api * acinclude.m4: (IT_CHECK_XULRUNNER_API_VERSION) removed * configure.ac: likewise 2013-12-20 Jiri Vanek singletons logic, logs and test cleanup/fixes * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java: config singleton made properly synchronized via Holder pattern (DeploymentConfigurationHolder). * netx/net/sourceforge/jnlp/util/logging/JavaConsole.java: same, (JavaConsoleHolder). Console gui initialized on show, not on creation. Removed look and feel. (addMessage) gui update adapted. * netx/net/sourceforge/jnlp/util/logging/LogConfig.java: made private, singleton handled via LogConfigHolder. * netx/net/sourceforge/jnlp/util/logging/OutputController.java: mentioned issue with (getConfiguration), removed obsoleted (MessageWithLevel), (messageQue) retyped to , (consume) adapted. (consumerThread) made global variable, ist start moved to (startConsumer) which is called after initialisation of config singleton. Logs queing moved to (log) of (MessageWithHeader) signature. (FileLogHolder) and (SystemLogHolder) created for holder pattern synchronization. * netx/net/sourceforge/jnlp/util/logging/headers/Header.java: constructor and (getCaller) adaptation. * netx/net/sourceforge/jnlp/util/logging/headers/PluginHeader.java: fixed (toString) for preinit messages. * tests/netx/unit/net/sourceforge/jnlp/util/logging/JavaConsoleTest.java: removed erroneous stdout. * tests/test-extensions/net/sourceforge/jnlp/util/logging/NoStdOutErrTest.java: is no longer throwing exceptions (was causing errors in junit) and synchronized. 2013-12-17 Jiri Vanek JNLPRuntime.config changed to proper singleton. * netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java: added field with getter rand setter to save loading exception. * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java: (config) field is no longer initialized in static block, but on demand in (getConfig). (initialize) no longer load (config) nor exit on loading exception, but warn in case that it have loading exception. (initialize) call to KeyStores.setConfiguration is using (getConfig) instead (config). (initialize) call to BrowserAwareProxySelector constructor likewise. (getConfig) is initializing and loading (config), marking exception and sterr it in case of debug on. Made synchronized. * netx/net/sourceforge/jnlp/resources/Messages.properties: (RConfigurationError) enhanced to fit. * netx/net/sourceforge/jnlp/util/logging/LogConfig.java: no longer use own copy of (config) but using (JNLPRuntime.getConfig). 2013-12-15 Jiri Vanek Console made aware of plugin messages * NEWS : mentioned * netx/net/sourceforge/jnlp/util/logging/FileLog.java: call to log adapted to new Header. * netx/net/sourceforge/jnlp/util/logging/JavaConsole.java: (logOutput) and (logError) replaced by (addMessage). Added (createPluginReader) to process plugin debug pipe * netx/net/sourceforge/jnlp/util/logging/LogConfig.java: (getConfig) do config available untill JNLPRuntime config is proper singleton * netx/net/sourceforge/jnlp/util/logging/OutputController.java: (Level) static methods converted to members and enhanced. (getHeader) and (getCallerClass) moved to Headers. * netx/net/sourceforge/jnlp/util/logging/headers/Header.java: Structure to keep header as object instead of string. * netx/net/sourceforge/jnlp/util/logging/headers/JavaMessage.java: Structure to hold message and its header. * netx/net/sourceforge/jnlp/util/logging/headers/MessageWithHeader.java: Interface for JavaMessage and PluginMessage * netx/net/sourceforge/jnlp/util/logging/headers/PluginHeader.java: extended header to handle plugin's preinit and threads. * netx/net/sourceforge/jnlp/util/logging/headers/PluginMessage.java: implementation of MessageWithHeader which parse from String from plugin debug pipe. * plugin/icedteanp/IcedTeaNPPlugin.cc: added debug pipe (debug_pipe_name), synced via (debug_pipe_lock), controlled by (debug_to_appletviewer) and used by method (plugin_send_message_to_appletviewer_console). * plugin/icedteanp/IcedTeaNPPlugin.h: (debug_pipe_name) and (jvvm_up) declared extern. Utility methods (plugin_send_message_to_appletviewer_console) and (flush_plugin_send_message_to_appletviewer_console) declared and impelmented * plugin/icedteanp/IcedTeaPluginUtils.cc: print debug info enhanced for debug pipe * plugin/icedteanp/IcedTeaPluginUtils.h: (PLUGIN_MESSAGE) and (PLIGIN_ERROR) now log to debug pipe if enabled. * plugin/icedteanp/java/sun/applet/PluginMain.java: args reprinted, checked third parameter debug pipe if should. Started debug_pipe reader if should * tests/netx/unit/net/sourceforge/jnlp/util/logging/JavaConsoleTest.java: added tests for parsing the plugin message. 2013-12-13 Jiri Vanek Made again compatible with JDK6.All JLists, JComboBoxs, and DefaultComboBoxModels moved back to be not generics-like * netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java * netx/net/sourceforge/jnlp/controlpanel/DebuggingPanel.java * netx/net/sourceforge/jnlp/controlpanel/DesktopShortcutPanel.java * netx/net/sourceforge/jnlp/controlpanel/TemporaryInternetFilesPanel.java * netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletsTrustingListPanel.java * netx/net/sourceforge/jnlp/security/viewer/CertificatePane.java 2013-12-13 Jiri Vanek itw itself warning cleanup: fixed rawtypes and unchecks, added braces and Override * netx/net/sourceforge/jnlp/JREDesc.java * netx/net/sourceforge/jnlp/Launcher.java * netx/net/sourceforge/jnlp/Node.java * netx/net/sourceforge/jnlp/Parser.java * netx/net/sourceforge/jnlp/PluginBridge.java * netx/net/sourceforge/jnlp/cache/CacheLRUWrapper.java * netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java * netx/net/sourceforge/jnlp/controlpanel/CachePane.java * netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java * netx/net/sourceforge/jnlp/controlpanel/DebuggingPanel.java * netx/net/sourceforge/jnlp/controlpanel/DesktopShortcutPanel.java * netx/net/sourceforge/jnlp/controlpanel/TemporaryInternetFilesPanel.java * netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletsTrustingListPanel.java * netx/net/sourceforge/jnlp/runtime/AppletEnvironment.java * netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java * netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java * netx/net/sourceforge/jnlp/security/CertWarningPane.java * netx/net/sourceforge/jnlp/security/CertsInfoPane.java * netx/net/sourceforge/jnlp/security/appletextendedsecurity/impl/UnsignedAppletActionStorageImpl.java * netx/net/sourceforge/jnlp/security/viewer/CertificatePane.java * netx/net/sourceforge/jnlp/services/ServiceUtil.java * netx/net/sourceforge/jnlp/splashscreen/impls/DefaultErrorSplashScreen2012.java * netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/NatCubic.java * netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/SplinesDefs.java * netx/net/sourceforge/jnlp/util/Reflect.java * netx/net/sourceforge/jnlp/util/ui/NonEditableTableModel.java * netx/net/sourceforge/nanoxml/XMLElement.java * plugin/icedteanp/java/sun/applet/MethodOverloadResolver.java * plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java * tests/netx/unit/net/sourceforge/jnlp/ParserCornerCases.java 2013-12-13 Jiri Vanek unittests warning cleanup: fixed typechecks, rawtypes, redundant casts... * tests/junit-runner/CommandLine.java * tests/junit-runner/JunitLikeXmlOutputListener.java * tests/junit-runner/LessVerboseTextListener.java * tests/netx/unit/net/sourceforge/jnlp/PluginBridgeTest.java * tests/netx/unit/net/sourceforge/jnlp/resources/MessagesPropertiesTest.java * tests/netx/unit/net/sourceforge/jnlp/splashscreen/ErrorSplashUtilsTest.java * tests/netx/unit/net/sourceforge/jnlp/splashscreen/SplashUtilsTest.java * tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/DescriptionInfoItemTest.java * tests/netx/unit/net/sourceforge/jnlp/util/UrlUtilsTest.java * tests/netx/unit/net/sourceforge/jnlp/util/XDesktopEntryTest.java * tests/netx/unit/net/sourceforge/jnlp/util/replacements/BASE64EncoderTest.java * tests/netx/unit/sun/applet/PluginAppletViewerTest.java * tests/test-extensions/net/sourceforge/jnlp/LoggingBottleneck.java * tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java * tests/test-extensions/net/sourceforge/jnlp/ThreadedProcess.java * tests/test-extensions/net/sourceforge/jnlp/awt/AWTHelper.java * tests/test-extensions/net/sourceforge/jnlp/awt/awtactions/KeyboardActions.java * tests/test-extensions/net/sourceforge/jnlp/closinglisteners/RulesFolowingClosingListener.java * netx/net/sourceforge/jnlp/util/ScreenFinder.java: centering of screen fixed to work also in headless mode by returrning some defaults 2013-12-09 Jiri Vanek * Messages.properties: added "It will be granted unrestricted access to your computer." to (SSigUnverified) (SSigVerified) (SSignatureError) messages. 2013-12-05 Andrew Azores * netx/net/sourceforge/jnlp/resources/Messages.properties: add units to (TIFPCacheSize) 2013-12-03 Andrew Azores Tests for PR1592. * tests/reproducers/signed/MixedSigningAppletSigned/srcs/MixedSigningAppletSigned.java: new tests for per-JAR applet security * tests/reproducers/signed/MixedSigningAppletSigned/testcases/MixedSigningAppletSignedTests.java: same * tests/reproducers/simple/MixedSigningApplet/resources/MixedSigningApplet-1.jnlp: same * tests/reproducers/simple/MixedSigningApplet/resources/MixedSigningApplet-2.jnlp: same * tests/reproducers/simple/MixedSigningApplet/resources/MixedSigningApplet-3.jnlp: same * tests/reproducers/simple/MixedSigningApplet/resources/MixedSigningApplet-4.jnlp: same * tests/reproducers/simple/MixedSigningApplet/resources/MixedSigningApplet-5.jnlp: same * tests/reproducers/simple/MixedSigningApplet/resources/MixedSigningApplet-6.jnlp: same * tests/reproducers/simple/MixedSigningApplet/resources/MixedSigningApplet.html: same * tests/reproducers/simple/MixedSigningApplet/srcs/MixedSigningAppletHelper.java: same 2013-12-03 Andrew Azores Fix/new feature for PR1592. Each JAR in partially signed applets is assigned its own security level, rather than forcing the entire applet to run sandboxed. * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: (initializeResources) each JAR in partially signed applets is assigned its own security descriptor. (signing) changed to three-valued enum. (checkNotAllSignedWithUser) new method * netx/net/sourceforge/jnlp/tools/JarCertVerifier.java: (isJarSigned) new method 2013-11-29 Jiri Vanek Better validation of crytical dirs with proper message on startup * netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java: small refactoring to match the new directory validator pattern. * netx/net/sourceforge/jnlp/config/DirectoryValidator.java: new class to verify if directory have necessary permissions (like creating subdirectories, read and write files created in). * netx/net/sourceforge/jnlp/resources/Messages.properties: patterns for validation results * netx/net/sourceforge/jnlp/runtime/Boot.java: headless determination moved as up as possible in (main) * tests/netx/unit/net/sourceforge/jnlp/config/DeploymentConfigurationTest.java: Few test testing what DirtectoryValidator should validate. 2013-11-29 Jiri Vanek Pipes moved into XDG_RUNTIME_DIR * plugin/icedteanp/IcedTeaNPPlugin.cc: (initialize_data_directory) logic responsible for tmp dir path moved into (getTmpPath) and (data_directory) initialized from (getRuntimePath) rather. * plugin/icedteanp/IcedTeaPluginUtils.cc: (getTmpPath) new function, provides path to tmp dir. (getRuntimePath) new function resolving XDG_RUNTIME_DIR value, returning (getTmpPath) as fallback. * plugin/icedteanp/IcedTeaPluginUtils.h: declared new two methods. 2013-11-29 Jiri Vanek Enabled file logging in plugin, user enabled to choose logs dir. * netx/net/sourceforge/jnlp/controlpanel/DebuggingPanel.java: added text-field to show/edit logs' destination. Added reset to default button. * netx/net/sourceforge/jnlp/resources/Messages.propertie: added proper keys for new controls (CPFilesLogsDestDir) and (CPFilesLogsDestDirResert). (DPEnableLogging) changed to "Enable debugging", as it is better. * netx/net/sourceforge/jnlp/util/logging/FileLog.java: Filename of logs changed to be human readable and to distinguish between c/java * plugin/icedteanp/IcedTeaNPPlugin.cc: made aware of console (plugin_debug_to_console) added stream to log into file (plugin_file_log) and holder of name (plugin_file_log_name) Added various new lines to end of erorr/debug messages. Stream flushed, not closed on plugin shutdown. * plugin/icedteanp/IcedTeaNPPlugin.h: extern above three fields. * plugin/icedteanp/IcedTeaParseProperties.cc: added functionality to provide set or default log dir (get_log_dir), added (is_java_console_enabled) to determine logging to console * plugin/icedteanp/IcedTeaParseProperties.h: used glib.h, declared above functions * plugin/icedteanp/IcedTeaPluginUtils.cc: added (initFileLog) function to open correctly named, in proper palce and with correct permissions file for logging (generateLogFileName) generate human readable file name, as java do. (printDebugStatus) to debug status of logging * plugin/icedteanp/IcedTeaPluginUtils.h: headers generated once, and reused declared above functions. * plugin/icedteanp/java/sun/applet/PluginMessageHandlerWorker.java: commented out useless "woken" debug message * tests/cpp-unit-tests/IcedTeaPluginUtilsTest.cc: made plugin_debug_to_console aware. 2013-11-27 Andrew Azores Made JNLPClassLoaderDeadlock reproducer more reliable * tests/reproducers/custom/JNLPClassLoaderDeadlock/srcs/JNLPClassLoaderDeadlock_1.java: Removed "AutoOkClosingListener" magic string * tests/reproducers/custom/JNLPClassLoaderDeadlock/srcs/JNLPClassLoaderDeadlock_2.java: same * tests/reproducers/custom/JNLPClassLoaderDeadlock/testcases/JNLPClassLoaderDeadlockTest.java: Changed AutoOkClosingListener to RulesFolowingClosingListener 2013-11-26 Jiri Vanek Reverted "fix to ManifestedJar1Test cases", better manifestedjar tests, added srtict test * netx/net/sourceforge/jnlp/Parser.java: added indentation, fixes condition in strict base check * netx/net/sourceforge/jnlp/ResourcesDesc.java: revertedt recently added throw * tests/reproducers/simple/ManifestedJar1/testcases/ManifestedJar1Test.java: (manifestedJar1main2mainNoAppDesc) adapted and (manifestedJar1main2mainNoAppDescStrict) added 2013-11-26 Jiri Vanek * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: (getManifestAttribute) added check for null manifest to prevent npe. * tests/netx/unit/net/sourceforge/jnlp/runtime/JNLPClassLoaderTest.java: added test for npe from getManifestAttribute * tests/test-extensions/net/sourceforge/jnlp/util/FileTestUtils.java: (createJarWithContents) enhanced to be able to create jar without manifest. 2013-11-25 Jiri Vanek * netx/net/sourceforge/jnlp/JNLPFile.java: (TITLE_NOT_FOUND) new constant holding the no title found string to be reused. (getTitleFromManifest) Now using that constant. * netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java: adding window erro message moved to be debug only. * ests/reproducers/custom/remote/testcases/RemoteApplicationSettings.java: Added (clean) mechanism to filter out TITLE_NOT_FOUND * tests/reproducers/signed/ReadPropertiesBySignedHack/testcases/ReadPropertiesBySignedHackTest.java: * tests/reproducers/signed/ReadPropertiesSigned/testcases/ReadPropertiesSignedTest.java: * tests/reproducers/simple/AddShutdownHook/testcases/AddShutdownHookTest.java: * tests/reproducers/simple/AllStackTraces/testcases/AllStackTracesTest.java * tests/reproducers/simple/CreateClassLoader/testcases/CreateClassLoaderTest.java * tests/reproducers/simple/ReadEnvironment/testcases/ReadEnvironmentTest.java * tests/reproducers/simple/ReadProperties/testcases/ReadPropertiesTest.java * tests/reproducers/simple/RedirectStreams/testcases/RedirectStreamsTest.java * tests/reproducers/simple/ReplaceSecurityManager/testcases/ReplaceSecurityManagerTest.java * tests/reproducers/simple/SetContextClassLoader/testcases/SetContextClassLoaderTest.java * tests/reproducers/simple/simpletest2/testcases/SimpleTest2Test.java Removed checks for emty outputs 2013-11-25 Jiri Vanek * netx/net/sourceforge/jnlp/ResourcesDesc.java: (getMainJAR) throw an RuntimeException when more then one main jar is specified. Preventing app to start. * tests/reproducers/simple/ManifestedJar1/testcases/ManifestedJar1Test.java: (manifestedJar1main2mainNoAppDesc), (manifestedJar1nothing2nothingAppDesc) fixed and adapted to change. 2013-11-22 Jiri Vanek * tests/netx/unit/net/sourceforge/jnlp/DefaultLaunchHandlerTest.java: (init) enable logging to streams if disabled. 2013-11-13 Andrew Azores * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: add parameterized type information to several return types and local variables. Refactor for-loops and Enumeration iterations into for-each-loops. 2013-11-13 Andrew Azores * netx/net/sourceforge/jnlp/util/BasicExceptionDialog.java: centers on-screen before appearing 2013-11-13 Jiri Vanek Added test-extension to silence stdout/err of itw when run from junit * tests/netx/unit/net/sourceforge/jnlp/JNLPFileTest.java: now extends NoStdOutErrTest * tests/netx/unit/net/sourceforge/jnlp/ParserBasic.java: same * tests/netx/unit/net/sourceforge/jnlp/runtime/JNLPClassLoaderTest.java: same * tests/test-extensions/net/sourceforge/jnlp/util/logging/NoStdOutErrTest.java: new class with (disableStds) BeforeClass method and (restoreStds) AfterClass method which are responsible for silence all itw messages from extending test. 2013-11-13 Jiri Vanek Enabled access to manifests' attributes from JNLPFile class Implemented http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/manifest.html#app_name * netx/net/sourceforge/jnlp/JNLPFile.java: Added (manifestsAttributes) field. Added (ManifestsAttributes) inner class, to encapsulate access to attributes. (getTitle) can handle manifests too. * netx/net/sourceforge/jnlp/PluginBridge.java: is following app_name recommendations. * netx/net/sourceforge/jnlp/ResourcesDesc.java: (getMainJAR) made more granular * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: (init) inject itself to file's ManifestsAttributes. (checkForAttributeInJars) renamed field mainClassInThisJar to attributeInThisJar. Added getter for mainClass. * netx/net/sourceforge/jnlp/security/CertWarningPane.java: bracketing cleanup. * tests/netx/unit/net/sourceforge/jnlp/runtime/JNLPFileTest.java: new test to check new functionalites * tests/netx/unit/net/sourceforge/jnlp/runtime/ResourcesDescTest.java: same * tests/test-extensions/net/sourceforge/jnlp/mock/DummyJNLPFileWithJar.java: can set info * NEWS: mentioned first u45 attribute 2013-11-10 Jiri Vanek Fixed lock in awt threads. JavaConsole window is now disposed instead of hidden. * netx/net/sourceforge/jnlp/util/logging/JavaConsole.java: (lastSize) new global variable to remember last size of window.(contentPanel) moved from local to global scope. (initializeWindow) extracted from (initialize), is handling creation and filling of window. (showConsole) is now initializing window, and (hideConsole) is disposing it. Added override annotations and removed duplicate code. * netx/net/sourceforge/jnlp/util/logging/OutputController.java: messageQueConsumer thread is now named, and its wait, have timeout. 2013-11-10 Jiri Vanek * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: removed suspicious return when (searchForMain) had null launchDesc 2013-11-07 Andrew Azores Reproducer test cleanup. Replaced ServerAccess.ProcessResult in favour of ProcessResult, and junit.framework.Assert in favour of org.junit.Assert. Other notable changes below. * tests/reproducers/simple/simpletest1/testcases/XDGspecificationTests.java: (removeXdgValues, setXdgValues) list 'rr' uses parameterized type. (getContentOfDirectory) list 'result' uses parameterized type * tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java: (ProcessResult) inner class removed. (getBrowserParams) list 'l' uses parameterized type * tests/reproducers/simple/LocalesTest/testcases/LocalesTestTest.java: (getChangedLocalesForSubproces) list 'rr' uses parameterized type * tests/reproducers/simple/LocalisedInformationElement/testcases/LocalisedInformationElementTest.java: same * tests/test-extensions/net/sourceforge/jnlp/ProcessWrapper.java: constructor for (String, List, String) lists 'urledArgs' and 'otherArgs' use parameterized type. (stdoutl, stderrl) use parameterized type. * tests/test-extensions/net/sourceforge/jnlp/ContentReader.java: (listeners) use parameterized type 2013-11-05 Jiri Vanek Java console resurrected and connected to new logging. * NEWS: mentioned console for plugin and javaws * Changelog: removed one wrong tab * netx/net/sourceforge/jnlp/config/Defaults.java: added DeploymentConfiguration.CONSOLE_SHOW_PLUGIN, and DeploymentConfiguration.CONSOLE_SHOW_JAVAWS. * netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java: added and javadoc-ed CONSOLE_SHOW_PLUGIN,CONSOLE_SHOW_JAVAWS, DISABLE, SHOW, HIDE, KEY_CONSOLE_STARTUP_MODE. * netx/net/sourceforge/jnlp/resources/Messages.properties: localized console * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java : removed legacy STD*_FILE * netx/net/sourceforge/jnlp/util/BasicExceptionDialog.java: Added button to show console on demand. Added (getShowButton) method to share code with * netx/net/sourceforge/jnlp/splashscreen/parts/JEditorPaneBasedExceptionDialog.java: Added button to show console on demand and explaining line. * netx/net/sourceforge/jnlp/util/logging/JavaConsole.java: moved from plugin, and reworked. Especially get rid of perpetual loading of file. Made singleton. * netx/net/sourceforge/jnlp/util/logging/LogConfig.java: added (isLogToConsole) returning (JavaConsole.isEnabled) status. * netx/net/sourceforge/jnlp/util/logging/OutputController.java: added (Level.isError) and (Level.isOutput) methods to determine original channel, and can log to console. * plugin/icedteanp/java/sun/applet/JavaConsole.java: moved to netx * plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java: (streamhandler) made private with setter * plugin/icedteanp/java/sun/applet/PluginMain.java : removed legacy STD*_FILE, added set of classloaders information provider to console. (handlePluginMessage) show and hide of console is checking it's status. (showConsole) and (hideConsole) moved to JavaConsole. 2013-11-05 Andrew Azores * netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java: (addPermission) avoid NPE in JNLPClassLoader#getPermissions with debug enabled 2013-11-01 Jiri Vanek Synced headers between PLUGIN_DEBUG, PLUGIN_ERROR and javaside * netx/net/sourceforge/jnlp/util/logging/OutputController.java: (getHeader) added thread id and name to log header. * plugin/icedteanp/IcedTeaPluginUtils.h: (PLUGIN_DEBUG) (PLUGIN_ERROR) headers generation code moved to macro (CREATE_HEADER0). Both headers now contains pthread_self and g_thread_self. Fixed indentation. 2013-11-01 Jiri Vanek * tests/netx/unit/net/sourceforge/jnlp/runtime/JNLPClassLoaderTest.java: added tests for custom attributes (getCustomAtributes), (getCustomAtributesEmpty) and test to ensure order during searching for attributes in manifests (checkOrderWhenReadingAttributes). * tests/test-extensions/net/sourceforge/jnlp/mock/DummyJNLPFileWithJar.java: can now handle multiple source jars, and set main jar (new constructors), (jarFiles) and (jarDescs) redeclared to arrays. 2013-10-30 Jiri Vanek * netx/net/sourceforge/jnlp/JARDesc.java: made immutable (location)(version)(part)(lazy)(main)(nativeJar)(cacheable) made final 2013-10-29 Andrew Azores Fix PR1513, signed applets with external main-class support * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: (initializeResources) ask for user approval rather than throwing LaunchException for signed applets with external main-class 2013-10-25 Jiri Vanek Plugin debug can now be controlled from itw_settings, in same way java side. For now ICEDTEAPLUGIN_DEBUG on the debug in same way as deployment.log itw-settings property. Individual logging streams are controlled by deployment.log.{headers,file,stdstreams,system} System and file are not yet fully done (same as java side in this moment). Streams are true, all others false by default. * plugin/icedteanp/IcedTeaNPPlugin.cc: initialized variables new bool variables (debug_initiated), (plugin_debug_headers), (plugin_debug_to_file), (plugin_debug_to_system) as false and (plugin_debug_to_streams) as true. * plugin/icedteanp/IcedTeaNPPlugin.h: above variables declared as extern * plugin/icedteanp/IcedTeaParseProperties.cc: initialization of (default_file_ITW_deploy_props_name) and (custom_jre_key) moved here from IcedTeaNPPlugin.h. New method (read_bool_property) and its more concrete shortcuts (is_debug_on) (is_debug_header_on) (is_logging_to_file) (is_logging_to_stds) (is_logging_to_system) implemented to access properties. * plugin/icedteanp/IcedTeaParseProperties.h: above methods declared. * plugin/icedteanp/IcedTeaPluginUtils.h: (PLUGIN_{ERROR,DEBUG}) methods adapted headers/debug/streams logic as described in title. Headers made more informative (like java side) * tests/cpp-unit-tests/IcedTeaPluginUtilsTest.cc: TEST(PLUGIN_DEBUG_ERROR_PROFILING_debug_on) extended to TEST(PLUGIN_DEBUG_ERROR_PROFILING_debug_on_headers_off). TEST(PLUGIN_DEBUG_ERROR_PROFILING_debug_off) extended to TEST(PLUGIN_DEBUG_ERROR_PROFILING_debug_off_headers_off), and new tests TEST(PLUGIN_DEBUG_ERROR_PROFILING_debug_on_headers_on) TEST(PLUGIN_DEBUG_ERROR_PROFILING_debug_off_headers_on) (100x slower then without headers) 2013-10-25 Jiri Vanek all output messages redirected to PLUGIN_{DEBUG,ERROR} macros * plugin/icedteanp/IcedTeaJavaRequestProcessor.cc: affected * plugin/icedteanp/IcedTeaNPPlugin.cc: affected * plugin/icedteanp/IcedTeaPluginRequestProcessor.cc: affected * plugin/icedteanp/IcedTeaPluginUtils.cc: affected * plugin/icedteanp/IcedTeaPluginUtils.h: affected * plugin/icedteanp/IcedTeaRunnable.cc: affected * plugin/icedteanp/IcedTeaScriptablePluginObject.cc: affected * tests/cpp-unit-tests/IcedTeaPluginUtilsTest.cc: added (TEST(PLUGIN_DEBUG_ERROR_PROFILING_debug_on)) and (TEST(PLUGIN_DEBUG_ERROR_PROFILING_debug_off)) which call new (doDebugErrorRun) and are measuring refactoring impacts. 2013-10-25 Jiri Vanek * netx/net/sourceforge/jnlp/util/logging/OutputController.java: (getCallerClass) now gets out also from sun.applet.PluginDebug class. 2013-10-24 Andrew Azores Fix array index out of bounds due to malformed plugin message (PR539) * plugin/icedteanp/IcedTeaPluginRequestProcessor.cc: (_getMember, _getString) append "null" to result when call is unsuccessful * tests/reproducers/simple/JSObjectWithoutToString/resources/JSObjectWithoutToString.html: new test to ensure failed calls to getMember and getString on JSObject do not produce malformed results * tests/reproducers/simple/JSObjectWithoutToString/resources/JSObjectWithoutToString.js: same * tests/reproducers/simple/JSObjectWithoutToString/srcs/JSObjectWithoutToString.java: same * tests/reproducers/simple/JSObjectWithoutToString/testcases/JSObjectWithoutToStringTest.java: same 2013-10-23 Jiri Vanek C-part of plugin is now also trying to follow XDG * plugin/icedteanp/IcedTeaParseProperties.cc: (user_properties_file) is now using XDG cached dir or its default variant in case that old file do not (should not!) exists 2013-10-22 Omair Majid * netx/net/sourceforge/jnlp/util/logging/LogConfig.java (resetLogConfig): New method. * tests/netx/unit/net/sourceforge/jnlp/util/logging/OutputControllerTest.java (setUp, tearDown): New method. 2013-10-22 Jiri Vanek More synchronized error/debug methods * plugin/icedteanp/IcedTeaNPPlugin.cc: all occurrences of PLUGIN_ERROR_TWO and PLUGIN_ERROR_THREE replaced by PLUGIN_ERROR. PLUGIN_ERROR itself moved to * plugin/icedteanp/IcedTeaPluginUtils.h: (PLUGIN_ERROR) new fuction, now uses ... arguments and printf with __VA_ARGS__ instead of g_printerr (PLUGIN_DEBUG) now prints to stdout, instead of stderr which is used by (PLUGIN_ERROR). 2013-10-21 Jiri Vanek Logic to extract main class attribute generalized to common methods. * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: (getMainClassName) is now calling (getManifestAttribute) (getManifestAttribute) new method, extract named attribute from url specified jar. Called by (checkForAttributeInJars) (checkForMain) is now calling (checkForAttributeInJars). Also logic of (checkForAttributeInJars) was taken from here. (checkForAttributeInJars) new method, read specific attribute from application jar(s) in specific order. 2013-10-20 Jiri Vanek * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java: (isPluginDebug) made private to prevent confusion. * plugin/icedteanp/java/sun/applet/PluginDebug.java: (DEBUG) initialized from JNLPRuntime.isDebug instead of incorrect JNLPRuntime.isPluginDebug. 2013-10-17 Andrew Azores Back out changeset 420d72e5cee7 due to breaking LiveConnect feature. http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2013-October/024919.html * plugin/icedteanp/IcedTeaNPPlugin.cc: undo 420d72e5cee7 * plugin/icedteanp/IcedTeaPluginUtils.cc: undo 420d72e5cee7 * plugin/icedteanp/IcedTeaPluginUtils.h: undo 420d72e5cee7 * plugin/icedteanp/IcedTeaScriptablePluginObject.cc: undo 420d72e5cee7 * plugin/icedteanp/IcedTeaScriptablePluginObject.h: undo 420d72e5cee7 * tests/cpp-unit-tests/IcedTeaScriptablePluginObjectTest.cc: undo 420d72e5cee7 2013-10-16 Andrew Azores Resolve deadlock issue when multiple applets are loaded simultaneously (RH976833) * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: (loadClassLock) private member for locking of loadClass method. (loadClass) synchronizes using new lock rather than instance intrinsic lock to avoid RH976833 deadlock * tests/reproducers/custom/JNLPClassLoaderDeadlock/testcases/JNLPClassLoaderDeadlockTest.java: new test for multiple applet deadlock condition * tests/reproducers/custom/JNLPClassLoaderDeadlock/resources/JNLPClassLoaderDeadlock.html: same * tests/reproducers/custom/JNLPClassLoaderDeadlock/srcs/JNLPClassLoaderDeadlock_1.java: same * tests/reproducers/custom/JNLPClassLoaderDeadlock/srcs/JNLPClassLoaderDeadlock_2.java: same * tests/reproducers/custom/JNLPClassLoaderDeadlock/srcs/Makefile: same 2013-10-11 Andrew Azores * netx/net/sourceforge/jnlp/security/SecurityDialog.java: (initDialog) centerDialog called in init rather than on windowOpened event 2013-10-09 Omair Majid * plugin/icedteanp/java/sun/applet/PluginProxySelector.java (computeKey): New method. (getFromBrowser, checkCache): Call computeKey. 2013-10-09 Omair Majid * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java (requestPluginProxyInfo): Accept a String instead of URI. (convertUriSchemeForProxyQuery): Move to ... * plugin/icedteanp/java/sun/applet/PluginProxySelector.java (convertUriSchemeForProxyQuery): Here. (getFromBrowser): Call convertUriSchemeForProxyQuery. * tests/netx/unit/sun/applet/PluginAppletViewerTest.java (testConvertUriSchemeForProxyQuery), (assertQueryForBrowserProxyUsesHttpFallback), (assertQueryForBrowserProxyContainsNoDoubleSlashes), (assertQueryForBrowserProxyDoesNotChangeQuery): Move to ... * tests/netx/unit/sun/applet/PluginProxySelectorTest.java: Here. 2013-10-07 Andrew Azores DeploymentConfiguration properties reproducer fix * tests/reproducers/signed/DeploymentPropertiesAreExposed/testcases/DeploymentPropertiesAreExposedTest.java: update test to reflect changed log directory 2013-10-03 Andrew Azores PR1204 patch regression fix * netx/net/sourceforge/jnlp/cache/ResourceUrlCreator.java: (getVersionedUrl) fix regression in previous PR1204 patch. Refactor to not take Resource parameter, use instance's field instead. (uriPartToString) new method * tests/netx/unit/net/sourceforge/jnlp/cache/ResourceUrlCreatorTest.java: new tests for ResourceUrlCreator.getVersionedUrl 2013-10-03 Jacob Wisor * netx/net/sourceforge/jnlp/controlpanel/CachePane.java: Moved JButtons to members. (addComponents): Modified to make use of new NonEditableTableModel. Added ListSelectionListener to propertly handle enabling and disabling of operational JButtons when selecting a resource from the cache table. Moved inital populating of the cache table to CacheViewer's constructor until after the CachePane has been instatiated. Added a general purpose Comparator for all non-String columns in the table model. Added a TableCellRenderer with proper localized rendering of "Size" and "Last Modified" columns as well as the content of "Name" and "Path" columns. (createButtonPanel): Moved delete operation into new method invokeDeleteLater(), added mouse cursor busy indicator, and proper handling of enabling and disabling of operational JButtons when pushing the delete button. Moved refresh operation when pushing the refresh button into new method invokePopulateLater() and added proper handling of enabling and disabling of operational JButtons while refreshing. Replaced closing the cache viewer dialog via JDialog.dispose() when pushing the delete button by a post of the WindowEvent.WINDOW_CLOSING event to the CacheViewer dialog in order to effectively remove the newly introduced KeyEventDispatcher. (invokeDeleteLater): New method: Posts an event to the event queue deleting the currently selected resource. (invokePopulateLater): New method: Posts an event to the event queue repopulating the cache table. (populateTable): Added mouse cursor busy indicator. (generateData): Modified cache table's per row data model for proper rendering and sorting to: DirectoryNode, File, String, String, Long, Date. * netx/net/sourceforge/jnlp/controlpanel/CacheViewer.java: (CacheViewer): Added null parameter check. Added a KeyEventDispatcher to enable closing the CacheViewer dialog on a KeyEvent.VK_ESCAPE key event. Replaced closing the cache viewer dialog via JDialog.dispose() by a post of the WindowEvent.WINDOW_CLOSING event to the CacheViewer dialog in order to effectively remove the newly introduced KeyEventDispatcher. * netx/net/sourceforge/jnlp/util/ui/NonEditableTableModel.java: Added a new table model that in effect is a javax.swing.table.DefaultTableModel except for no cell being editable. * netx/net/sourceforge/jnlp/util/ui/package-info.java: Added new package for UI common and recurrung UI tasks with documentation 2013-10-01 Omair Majid * netx/net/sourceforge/jnlp/browser/BrowserAwareProxySelector.java (BrowserAwareProxySelector): Split off browser-specific work into .. (initialize): New method. (initFromBrowserConfig): Delegate reading browser preferences to .. (parseBrowserPreferences): New method. (getFromBrowserConfiguration): Delegate to JNLPProxySelector.getFromArguments. * netx/net/sourceforge/jnlp/runtime/JNLPProxySelector.java (getFromConfiguration): Move logic into getFromArguments; delegate to it. (getFromArguments): Renamed from getFromConfiguration. Handle optionally using the http host/port for socket addresses. * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java (initialize): Call BrowserAwareProxySelector.initialize. * tests/netx/unit/net/sourceforge/jnlp/browser/BrowserAwareProxySelectorTest.java: New file. 2013-10-01 Omair Majid * plugin/icedteanp/java/sun/applet/PluginProxySelector.java (getFromBrowser): Move call to PluginAppletViewer.requestPluginProxyInfo into new method. (getProxyFromRemoteCallToBrowser): New method. * tests/netx/unit/sun/applet/PluginProxySelectorTest.java: New file. 2013-09-26 Andrew Azores Fix for PR1204. Absolute paths in resource URLs are correctly handled when appended to host URLs and URL query strings are not removed. * netx/net/sourceforge/jnlp/cache/ResourceUrlCreator.java: (getVersionedUrlUsingQuery) renamed to getVersionedUrl, refactored construction of URL * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java: (requestPluginProxyInfo) extracted proxy URI logic. (processProxyUri) new method for finding proxy URIs, handles absolute resource paths correctly * tests/netx/unit/net/sourceforge/jnlp/cache/ResourceUrlCreatorTest.java: added tests for ResourceUrlCreator#getVersionedUrl * tests/netx/unit/sun/applet/PluginAppletViewerTest.java: added tests for PluginAppletViewer.processProxyUri * tests/reproducers/simple/AbsolutePathsAndQueryStrings/resources/AbsolutePathsAndQueryStrings.html: new reproducer checks that absolute paths and query strings in resource URLs are properly handled, and caching still works * tests/reproducers/simple/AbsolutePathsAndQueryStrings/resources/AbsolutePathsAndQueryStrings.jnlp: same * tests/reproducers/simple/AbsolutePathsAndQueryStrings/testcases/AbsolutePathsAndQueryStrings.java: same 2013-09-25 Andrew Azores * Makefile.am: clean up summary_unit.txt and summary_reproducers.txt for "clean" goal 2013-09-25 Jiri Vanek Added logging bottleneck * netx/net/sourceforge/jnlp/AbstractLaunchHandler.java: extracted system.out/err and printStackTrace in favour of outputController.log methods. Same all below * netx/net/sourceforge/jnlp/DefaultLaunchHandler.java * netx/net/sourceforge/jnlp/ExtensionDesc.java * netx/net/sourceforge/jnlp/GuiLaunchHandler.java * netx/net/sourceforge/jnlp/JNLPFile.java * netx/net/sourceforge/jnlp/JNLPMatcher.java * netx/net/sourceforge/jnlp/JNLPSplashScreen.java * netx/net/sourceforge/jnlp/Launcher.java * netx/net/sourceforge/jnlp/MalformedXMLParser.java * netx/net/sourceforge/jnlp/NetxPanel.java * netx/net/sourceforge/jnlp/Parser.java * netx/net/sourceforge/jnlp/PluginBridge.java * netx/net/sourceforge/jnlp/SecurityDesc.java * netx/net/sourceforge/jnlp/StreamEater.java * netx/net/sourceforge/jnlp/XmlParser.java * netx/net/sourceforge/jnlp/about/HTMLPanel.java * netx/net/sourceforge/jnlp/browser/BrowserAwareProxySelector.java * netx/net/sourceforge/jnlp/browser/FirefoxPreferencesFinder.java * netx/net/sourceforge/jnlp/browser/FirefoxPreferencesParser.java * netx/net/sourceforge/jnlp/cache/CacheDirectory.java * netx/net/sourceforge/jnlp/cache/CacheEntry.java * netx/net/sourceforge/jnlp/cache/CacheLRUWrapper.java * netx/net/sourceforge/jnlp/cache/CacheUtil.java * netx/net/sourceforge/jnlp/cache/NativeLibraryStorage.java * netx/net/sourceforge/jnlp/cache/Resource.java * netx/net/sourceforge/jnlp/cache/ResourceTracker.java * netx/net/sourceforge/jnlp/config/Defaults.java * netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java * netx/net/sourceforge/jnlp/controlpanel/CachePane.java * netx/net/sourceforge/jnlp/controlpanel/CommandLine.java * netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java * netx/net/sourceforge/jnlp/controlpanel/DebuggingPanel.java * netx/net/sourceforge/jnlp/controlpanel/DocumentAdapter.java * netx/net/sourceforge/jnlp/controlpanel/JVMPanel.java * netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletsTrustingListPanel.java * netx/net/sourceforge/jnlp/resources/Messages.properties * netx/net/sourceforge/jnlp/resources/Messages_cs.properties * netx/net/sourceforge/jnlp/resources/Messages_de.properties * netx/net/sourceforge/jnlp/resources/Messages_pl.properties * netx/net/sourceforge/jnlp/runtime/AppletAudioClip.java * netx/net/sourceforge/jnlp/runtime/AppletEnvironment.java * netx/net/sourceforge/jnlp/runtime/AppletInstance.java * netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java * netx/net/sourceforge/jnlp/runtime/Boot.java * netx/net/sourceforge/jnlp/runtime/CachedJarFileCallback.java * netx/net/sourceforge/jnlp/runtime/FakePacEvaluator.java * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java * netx/net/sourceforge/jnlp/runtime/JNLPPolicy.java * netx/net/sourceforge/jnlp/runtime/JNLPProxySelector.java * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java * netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java * netx/net/sourceforge/jnlp/runtime/PacEvaluatorFactory.java * netx/net/sourceforge/jnlp/runtime/RhinoBasedPacEvaluator.java * netx/net/sourceforge/jnlp/security/CertWarningPane.java * netx/net/sourceforge/jnlp/security/CertificateUtils.java * netx/net/sourceforge/jnlp/security/HttpsCertVerifier.java * netx/net/sourceforge/jnlp/security/KeyStores.java * netx/net/sourceforge/jnlp/security/SecurityDialog.java * netx/net/sourceforge/jnlp/security/SecurityDialogMessageHandler.java * netx/net/sourceforge/jnlp/security/SecurityUtil.java * netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java * netx/net/sourceforge/jnlp/security/appletextendedsecurity/ExtendedAppletSecurityHelp.java * netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletTrustConfirmation.java * netx/net/sourceforge/jnlp/security/viewer/CertificatePane.java * netx/net/sourceforge/jnlp/services/ServiceUtil.java * netx/net/sourceforge/jnlp/services/XBasicService.java * netx/net/sourceforge/jnlp/services/XPersistenceService.java * netx/net/sourceforge/jnlp/services/XPrintService.java * netx/net/sourceforge/jnlp/services/XSingleInstanceService.java * netx/net/sourceforge/jnlp/splashscreen/SplashUtils.java * netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/BasePainter.java * netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/ErrorPainter.java * netx/net/sourceforge/jnlp/splashscreen/parts/InformationElement.java * netx/net/sourceforge/jnlp/splashscreen/parts/JEditorPaneBasedExceptionDialog.java * netx/net/sourceforge/jnlp/tools/CertInformation.java * netx/net/sourceforge/jnlp/tools/JarCertVerifier.java * netx/net/sourceforge/jnlp/util/BasicExceptionDialog.java * netx/net/sourceforge/jnlp/util/FileUtils.java * netx/net/sourceforge/jnlp/util/HttpUtils.java * netx/net/sourceforge/jnlp/util/ImageResources.java * netx/net/sourceforge/jnlp/util/PropertiesFile.java * netx/net/sourceforge/jnlp/util/Reflect.java * netx/net/sourceforge/jnlp/util/StreamUtils.java * netx/net/sourceforge/jnlp/util/TimedHashMap.java * netx/net/sourceforge/jnlp/util/UrlUtils.java * netx/net/sourceforge/jnlp/util/XDesktopEntry.java * netx/net/sourceforge/nanoxml/XMLElement.java * plugin/icedteanp/java/netscape/javascript/JSRunnable.java * plugin/icedteanp/java/sun/applet/JavaConsole.java * plugin/icedteanp/java/sun/applet/PluginAppletPanelFactory.java * plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java * plugin/icedteanp/java/sun/applet/PluginDebug.java * plugin/icedteanp/java/sun/applet/PluginException.java * plugin/icedteanp/java/sun/applet/PluginMain.java * plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java * plugin/icedteanp/java/sun/applet/PluginMessageHandlerWorker.java * plugin/icedteanp/java/sun/applet/PluginProxyInfoRequest.java * plugin/icedteanp/java/sun/applet/PluginProxySelector.java * plugin/icedteanp/java/sun/applet/PluginStreamHandler.java * tests/netx/unit/net/sourceforge/jnlp/DefaultLaunchHandlerTest.java * tests/netx/unit/net/sourceforge/jnlp/cache/ResourceTrackerTest.java * tests/netx/unit/net/sourceforge/jnlp/util/HttpUtilsTest.java * tests/netx/unit/net/sourceforge/jnlp/util/XDesktopEntryTest.java * tests/reproducers/simple/simpletest1/testcases/XDGspecificationTests.java * tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java * netx/net/sourceforge/jnlp/util/logging/FileLog.java: new file, derived from AppletLog. Now have responsibility to log to custom file. * netx/net/sourceforge/jnlp/util/logging/LogConfig.java: new file derived from Log * netx/net/sourceforge/jnlp/util/logging/OutputController.java: new bottleneck for logging * netx/net/sourceforge/jnlp/util/logging/PrintStreamLogger.java: logger to std.streams * netx/net/sourceforge/jnlp/util/logging/SingleStreamLogger.java: interface common to all new loggers * netx/net/sourceforge/jnlp/util/logging/UnixSystemLog.java: not yet implemented susytem log * netx/net/sourceforge/jnlp/util/logging/WinSystemLog.java: not yet implemented susytem log * tests/netx/unit/net/sourceforge/jnlp/util/logging/FileLogTest.java: new set of tests * tests/netx/unit/net/sourceforge/jnlp/util/logging/OutputControllerTest.java: new set of tests * tests/netx/unit/net/sourceforge/jnlp/util/logging/PrintStreamLoggerTest.java: new set of tests * netx/net/sourceforge/jnlp/AppletLog.java: removed * netx/net/sourceforge/jnlp/Log.java: rmeoved 2013-09-24 Omair Majid PR1474 * NEWS: Update with bug. * netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java: Document KEY_PROXY_SAME. * netx/net/sourceforge/jnlp/runtime/JNLPProxySelector.java (getFromConfiguration): Same proxy is not applicable to SOCKS. Always include SOCKS proxy if available. * tests/netx/unit/net/sourceforge/jnlp/runtime/JNLPProxySelectorTest.java (testHttpFallsBackToManualSocksProxy): New method. (testManualSameProxy): Remove test for socket protocol. 2013-09-23 Omair Majid * netx/net/sourceforge/jnlp/browser/BrowserAwareProxySelector.java (BrowserAwareProxySelector): Rename to... (BrowserAwareProxySelector(DeploymentConfiguration)): New method. * netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java: Clarify possible values for KEY_PROXY_TYPE. * netx/net/sourceforge/jnlp/runtime/JNLPProxySelector.java (JNLPProxySelector): Rename to... (JNLPProxySelector(DeploymentConfiguration)): New method. (parseConfiguration): Rename to... (parseConfiguration(DeploymentConfiguration)): New method. (inBypassList): Get host from URI instead of manual hacks. (getProxiesFromPacResult): Clarify return value. * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java (initialize): Adjust for new BrowserAwareProxySelector constructor. * plugin/icedteanp/java/sun/applet/PluginMain.java (init): Adjust for new PluginProxySelector constructor. * plugin/icedteanp/java/sun/applet/PluginProxySelector.java (PluginProxySelector): New constructor. * tests/netx/unit/net/sourceforge/jnlp/runtime/JNLPProxySelectorTest.java: New file. 2013-09-20 Omair Majid * netx/net/sourceforge/jnlp/InformationDesc.java (InformationDesc): Remove JNLPFile argument. (getJNLPFile): Remove. * netx/net/sourceforge/jnlp/JNLPFile.java (getInformation): Adjust to new InformationDesc constructor. * netx/net/sourceforge/jnlp/Parser.java (getInformation): Likewise. * tests/netx/unit/net/sourceforge/jnlp/InformationDescTest.java: New file. 2013-09-19 Jana Fabrikova Added text only reports from reproducers and unit tests run * tests/report-styles/textreport.xls: style for generating summary output in summary_reproducers.txt and summary_unit.txt * Makefile.am: added generating the text reports in run-netx-dist-tests goal 2013-09-18 Jiri Vanek Removed java 1.3 comaptible (redundant) code from ParseException * netx/net/sourceforge/jnlp/ParseException.java: (ParseException) modified to support super call only, (getCause) and both (printStackTrace) removed 2013-09-16 Andrew Azores Fix ResourcesTest reproducer. * tests/test-extensions-tests/net/sourceforge/jnlp/ResourcesTest.java: fixed formatting, removed commented lines. (testBrowser): assertion that ~/.mozilla/plugins directory exists removed. Renamed (userPluginDir, defaultPluginDir, userPlugins, defaultPlugins) 2013-09-16 Omair Majid * tests/netx/unit/net/sourceforge/jnlp/runtime/JNLPClassLoaderTest.java (toList): Remove. (checkForMainFileLeakTest): Use Arrays.asList. * tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletTrustConfirmationTest.java (toList): Remove. (testToRelativePaths): Use Arrays.asList. 2013-09-16 Jiri Vanek * Makefile.am: returned modified (EXTRA_DIST) variable. It is enriched for netx-dist-tests-whitelist and NEW_LINE_IFS to enable reproducers tests in dist tarball. 2013-09-16 Deepak Bhole CVE-2012-4540, RH869040: Heap-based buffer overflow after triggering event attached to applet * plugin/icedteanp/IcedTeaScriptablePluginObject.cc: Removed unnecessary heap allocations. 2013-09-13 Andrew Azores * tests/test-extensions/net/sourceforge/jnlp/tools/MessageProperties.java: new utility class to handle retrieving localized messages for reproducers * tests/reproducers/signed/CacheReproducer/testcases/CacheReproducerTest.java: refactored to use new MessageProperties class * tests/test-extensions-tests/net/sourceforge/jnlp/MessagePropertiesTest.java: tests for new MessageProperties class 2013-09-11 Jacob Wisor * netx/net/sourceforge/jnlp/controlpanel/TemporaryInternetFilesPanel.java Made temporary files location JFileChooser open at the currently specified location Made temporary files location JFileChooser display a helpful title Removed misleading "All Files" file filter from JFileChooser * netx/net/sourceforge/jnlp/resources/Messages.properties Added new message to resources for JFileChooser's choose button * netx/net/sourceforge/jnlp/resources/Messages_cs.properties Added new message to resources for JFileChooser's choose button Fixed a few inconsistent messages in resource files * netx/net/sourceforge/jnlp/resources/Messages_de.properties Added new message to resources for JFileChooser's choose button Fixed a few inconsistent messages in resource files * netx/net/sourceforge/jnlp/resources/Messages_pl.properties Added new message to resources for JFileChooser's choose button Fixed a few inconsistent messages in resource files 2013-09-09 Omair Majid * netx/net/sourceforge/jnlp/JNLPFile.java (getDownloadOptionsForJar): Rename to ... (getDownloadOptions): New method. Look up jnlp.packEnabled and jnlp.versionEnabled in any resources element. * netx/net/sourceforge/jnlp/PluginBridge.java (getDownloadOptionsForJar): Rename to ... (getDownloadOptions): New method. * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java (initializeResources): Invoke file.getDownloadResources. (getDownloadOptionsForJar): Remove. * tests/netx/unit/net/sourceforge/jnlp/JNLPFileTest.java (testDownloadOptionsAppliedEverywhere): New method. (testDownloadOptionsFilteredOut): New method. 2013-09-04 Andrew Azores * netx/net/sourceforge/jnlp/config/Defaults.java: (USER_CACHE_HOME) made public for use in CacheReproducer * tests/reproducers/signed/CacheReproducer/testcases/CacheReproducerTest: updated "could not clear cache" message and cache location. Other minor cleanup 2013-09-04 Andrew Azores * netx/net/sourceforge/jnlp/security/SecurityDialogs.java: (getIntegerResponseAsBoolean) extracted integer response casting/handling logic into new method * tests/netx/unit/net/sourceforge/jnlp/security/SecurityDialogsTest.java: new unit test for SecurityDialogs#getIntegerReponseAsBoolean() 2013-09-04 Adam Domurad * netx/net/sourceforge/jnlp/Launcher.java: Fix applet context being null during applet init & start. 2013-08-29 Omair Majid * tests/netx/unit/net/sourceforge/jnlp/JNLPFileTest.java (testPropertyRestrictions): New method. Check that properties in resources are are combined and filtered as appropriate. 2013-08-29 Omair Majid PR1058 * netx/net/sourceforge/jnlp/services/XFileOpenService.java (openMultiFileDialog): Create a privileged proxy for each FileContents instance and return an array of them. 2013-08-27 Adam Domurad Do not wait for applet initialization when binding Java applets for NPAPI. * plugin/icedteanp/IcedTeaNPPlugin.cc: Refactor to use lazy-initialized javascript applet binding. * plugin/icedteanp/IcedTeaPluginUtils.cc: Make use of new helper class, introduce (stringPrintf), introduce NPObjectRef. * plugin/icedteanp/IcedTeaPluginUtils.h: Same. * plugin/icedteanp/IcedTeaScriptablePluginObject.cc: Allow IcedTeaScriptableJavaObject to be lazy-initialized, introduce lazy-initializing (get_scriptable_applet_object). * plugin/icedteanp/IcedTeaScriptablePluginObject.h: Same. * tests/cpp-unit-tests/IcedTeaScriptablePluginObjectTest.cc: Adapt test to new helper class. 2013-08-23 Adam Domurad Spawn Java side during C++ unit tests. Many new tests. * plugin/icedteanp/IcedTeaJavaRequestProcessor.cc (hasPackage): Minor cleanup. * plugin/icedteanp/IcedTeaNPPlugin.cc (initialize_data_directory): New, extracted function. (NP_Initialize): Calls extracted function. * plugin/icedteanp/IcedTeaNPPlugin.h: Expose more functions for testing purposes. * tests/cpp-unit-tests/IcedTeaNPPluginTest.cc (get_scriptable_package_object): Test binding of java package (get_scriptable_java_object): Test binding of java object * tests/cpp-unit-tests/IcedTeaPluginUtilsTest.cc (NPIdentifierAsString): Update to create npidentifier properly. * tests/cpp-unit-tests/IcedTeaScriptablePluginObjectTest.cc (getProperty): Test loading java.lang.Integer.MAX_VALUE from C++. * tests/cpp-unit-tests/MemoryLeakDetector.h (reset_global_state): Made public * tests/cpp-unit-tests/checked_allocations.h (SafeAllocator): New, typedef for allocator that avoids leak detection. * tests/cpp-unit-tests/browser_mock.cc (browsermock_setup_functions): Renamed to (browsermock_create_table). (browsermock_create_table): Now returns browser table, additional object release and identifier methods added. * tests/cpp-unit-tests/browser_mock.h: Update for rename. * tests/cpp-unit-tests/main.cc: Now clears state via (reset_global_state) * tests/cpp-unit-tests/IcedTeaJavaRequestProcessorTest.cc: New, contains unit tests that cover all of JavaRequestProcessor's methods. * tests/cpp-unit-tests/browser_mock_npidentifier.cc: Allocation-safe npidentifier mocking, adheres to NPAPI spec. * tests/cpp-unit-tests/browser_mock_npidentifier.h: Same. 2013-08-23 Adam Domurad * plugin/icedteanp/IcedTeaNPPlugin.cc: Refactor plugin data creation. * plugin/icedteanp/IcedTeaNPPlugin.h: Same. 2013-08-19 Adam Domurad * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java: Evaluate javascript when it shows up in a 'showDocument' call. * plugin/icedteanp/java/sun/applet/PluginMain.java: Install arbitrary 'javascript:' protocol handler. * tests/rproducers/simple/JavascriptURLProtocol/resources/JavascriptProtocol.html: Tests if javascript is run from a test applet using showDocument. * tests/reproducers/simple/JavascriptURLProtocol/resources/JavascriptProtocol.js: Same. * tests/reproducers/simple/JavascriptURLProtocol/srcs/JavascriptProtocol.java: Same. * tests/reproducers/simple/JavascriptURLProtocol/testcases/JavascriptProtocolTest.java: Same. 2013-08-15 Andrew Azores * netx/net/sourceforge/jnlp/ParserSettings.java: (globalParserSettings) static ParserSettings instance to store settings. (setGlobalParserSettingsFromArgs) Determine, store, and return globalParserSettings. (getGlobalParserSettings) return stored ParserSettings * netx/net/sourceforge/jnlp/PluginBridge.java: (extensionJars) stores list of JNLP extensions. (getResources) returns this list * netx/net/sourceforge/jnlp/runtime/Boot.java: minor refactor to use ParserSettings.setGlobalParserSettingsFromArgs() * tests/netx/unit/net/sourceforge/jnlp/ParserSettingsTest.java: ensure that ParserSettings.setGlobalParserSettingsFromArgs() works as intended * tests/reproducers/custom/ExtensionJnlpsInApplet/testcases/ExtensionJnlpsInAppletTest.java: tests browser launch of HTML file with embedded JNLP applet referencing extension JNLP * tests/reproducers/custom/ExtensionJnlpsInApplet/resources/ExtensionJnlpHelper.jnlp: same * tests/reproducers/custom/ExtensionJnlpsInApplet/resources/ExtensionJnlpTest.html: same * tests/reproducers/custom/ExtensionJnlpsInApplet/resources/ExtensionJnlpTestApplet.jnlp: same * tests/reproducers/custom/ExtensionJnlpsInApplet/srcs/ExtensionJnlpHelper.java: same * tests/reproducers/custom/ExtensionJnlpsInApplet/srcs/ExtensionJnlpTestApplet.java: same * tests/reproducers/custom/ExtensionJnlpsInApplet/srcs/Makefile: same 2013-08-13 Andrew Azores * tests/test-extensions/net/sourceforge/jnlp/TinyHttpdImpl.java: no longer sends HTTP 400 BAD REQUEST messages * test/test-extensions-tests/net/sourceforge/jnlp/TinyHttpdImplTest.java: removed "bad request" test 2013-08-12 Andrew Azores * tests/test-extensions/net/sourceforge/jnlp/TinyHttpdImpl.java: refactored * tests/test-extensions/net/sourceforge/jnlp/ServerLauncher.java: TinyHttpdImpl constructor changed, reflecting this here * tests/test-extensions-tests/net/sourceforge/jnlp/ServerAccessTest.java: removed TinyHttpdImpl tests * tests/test-extensions-tests/net/sourceforge/jnlp/TinyHttpdImplTest.java: new unit tests for TinyHttpdImpl and moved old tests out of ServerAccessTest 2013-08-01 Andrew Azores * .hgignore: ignore generated HTML files (from AboutDialog) 2013-07-30 Adam Domurad * plugin/icedteanp/IcedTeaPluginUtils.cc (NPIdentifierAsString): Leak-free utf8fromidentifier wrapper. * plugin/icedteanp/IcedTeaPluginUtils.h: Same. * plugin/icedteanp/IcedTeaJavaRequestProcessor.cc: Update calls * plugin/icedteanp/IcedTeaPluginRequestProcessor.cc: Same. * plugin/icedteanp/IcedTeaScriptablePluginObject.cc: Same. * plugin/icedteanp/IcedTeaScriptablePluginObject.h: Same. * tests/cpp-unit-tests/IcedTeaPluginUtilsTest.cc (NPIdentifierAsString): New, tests utility function * tests/cpp-unit-tests/browser_mock.cc (mock_utf8fromidentifier): New, mocks NPAPI function 2013-07-30 Jiri Vanek * tests/reproducers/simple/simpletest1/resources/favicon.ico: new file should be served by test server in reproducers run and so prevent FNF exception * ChangeLog: fixed few entries below (added emty line between author and body) 2013-07-25 Andrew Azores * netx/net/sourceforge/jnlp/about/AboutDialog.java (AboutDialog, display): removed "throws IOException" * netx/net/sourceforge/jnlp/about/HTMLPanel.java (HTMLPanel): removed "throws IOException" and changed try/catch to catch IOException rather than Exception * netx/net/sourceforge/jnlp/controlpanel/AboutPanel.java: removed try/catch around AboutDialog.display() call * netx/net/sourceforge/jnlp/runtime/Boot.java (main): same * netx/net/sourceforge/jnlp/splashscreen/impls/DefaultSplashScreens2012Commons.java: same 2013-07-22 Andrew Azores * netx/net/sourceforge/jnlp/runtime/RhinoBasedPacEvaluator.java: (getProxiesWithoutCaching) added java.vm.name read permission to fix Rhino parsing and PAC proxy configuration 2013-07-18 Jiri Vanek IcedTea-Web is now following XDG .config and .cache specification(RH947647) * tests/reproducers/simple/simpletest1/testcases/XDGspecificationTests.java new file, test if XDG specification and trasnfer to it are followed correctly, * NEWS: mentioned new feature * Makefile.am: (PUBLIC_KEYSTORE) repalced by (PUBLIC_KEYSTORE_STUB) which is now holding only internal part of path.(exported-test-certs) (netx-dist-tests-import-cert-to-public) (netx-dist-tests-remove-cert-from-public) are now resolving XDG variable and setting real path of PUBLIC_KEYSTORE by resolved value and (PUBLIC_KEYSTORE) * netx/net/sourceforge/jnlp/cache/CacheLRUWrapper.java: changed to be public and recently_used strign extracted to (CACHE_INDEX_FILE_NAME) constant * netx/net/sourceforge/jnlp/config/Defaults.java: is now resovling and propagating XDG_CONFIG/CACHE_HOME specification. (USER_HOME) repalced by (USER_CACHE_HOME) and (USER_CONFIG_HOME). (move14AndOlderFilesTo15Structure) new method responsible for moving of old data to new locations. (move14AndOlderFilesTo15StructureCatched) the same but with catch block * netx/net/sourceforge/jnlp/controlpanel/CachePane.java: * tests/netx/unit/net/sourceforge/jnlp/cache/CacheLRUWrapperTest.java: * tests/netx/unit/net/sourceforge/jnlp/util/PropertiesFileTest.java: are now using (CACHE_INDEX_FILE_NAME) * netx/net/sourceforge/jnlp/controlpanel/CommandLine.java: (main) * netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java: (main) * netx/net/sourceforge/jnlp/runtime/Boot.java: (main) * plugin/icedteanp/java/sun/applet/PluginMain.java: (main) are now calling DeploymentConfiguration.move14AndOlderFilesTo15StructureCatched asap. * netx/net/sourceforge/jnlp/util/FileUtils.java: various file manipulation methods moved inside here from test-extensions - (saveFile) (getContentOfStream) (loadFileAsString) - to avoid duplications * tests/test-extensions/net/sourceforge/jnlp/ProcessWrapper.java: for puposes of new test added constructor with string instead of URL * tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java: see FileUtils.java 2013-07-17 Jiri Vanek About dialogue made accessible from plugin * netx/net/sourceforge/jnlp/about/AboutDialog.java: (frame) re-declared to be Dialogue instead of JFrame and allowed to be modal if necessary. Caption internationalized. * netx/net/sourceforge/jnlp/splashscreen/impls/DefaultSplashScreens2012Commons.java: Added listener for upper right caption to show AboutDialog * netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/BasePainter.java: (drawBase) if enough space, adding about "button" * netx/net/sourceforge/jnlp/splashscreen/parts/JEditorPaneBasedExceptionDialog.java: added about button * tests/netx/unit/net/sourceforge/jnlp/splashscreen/SplashScreenTest.java: minor modifications related to this change 2013-07-17 Jiri Vanek about dialogue now available from itw-settings * netx/net/sourceforge/jnlp/controlpanel/AboutPanel.java: added button to launch about dialogue * netx/net/sourceforge/jnlp/resources/Messages.propertie: (CPAboutInfo) Adapted to be more accurate to select-able JVM 2013-07-17 Jiri Vanek Jacob Wisor added some missing de and pl strings * netx/net/sourceforge/jnlp/resources/Messages.properties: fixed about dialogue comment * netx/net/sourceforge/jnlp/resources/Messages_cs.properties: removed keystore comment * netx/net/sourceforge/jnlp/resources/Messages_de.properties: * netx/net/sourceforge/jnlp/resources/Messages_pl.properties: added AboutDialogueTabAbout AboutDialogueTabAuthors AboutDialogueTabChangelog AboutDialogueTabNews AboutDialogueTabGPLv2 localizations 2013-07-11 Andrew Azores * NEWS: added entry regarding new About Dialogue * netx/net/sourceforge/jnlp/about/AboutDialog.java: fixed localization of label on News tab 2013-07-11 Andrew Azores * Makefile.am (stamps/html-gen): moved plaintext-to-HTML logic into new shell script * html-gen.sh: contains plaintext-to-HTML logic previously found in Makefile.am. Added a sed expression to cause ChangeLog file listing entries to be underlined. 2013-07-06 Jiri Vanek Andrew Azores New about dialogue * Makefile.am (stamps/netx-html-gen): removed logic for extras.jar, added new stamp to create HTML for AboutDialog * netx/net/sourceforge/jnlp/about/AboutDialog.java: Moved out of extras into netx and renamed from Main. New Swing layout and uses HTML files generated in Makefile. * netx/net/sourceforge/jnlp/about/HTMLPanel.java: Moved out of extras into netx. Added ability to click hyperlinks. * netx/net/sourceforge/jnlp/runtime/Boot.java (main, getAboutFile, getJNLPFile, itwInfoMessage): changed way of launching About dialog to using new static display method rather than JNLP launch. Removed methods relating to JNLP launch. More informative and nicely formatted -headless information. * netx/net/sourceforge/jnlp/resources/Messages.properties (BAboutITW, BFileInfoAuthors, BFileInfoCopying, BFileInfoNews): added new messages for javaws -about -headless launch * netx/net/sourceforge/jnlp/resources/about.html: moved out of extras into netx. Added more content, changed formatting. * netx/net/sourceforge/jnlp/resources/about.jnlp: removed, no longer needed * netx/net/sourceforge/jnlp/resources/itw_logo.png: new image for About dialog. Modified version of javaws_splash.png * netx/net/sourceforge/jnlp/resources/jamIcon.jpg: moved out of extras into netx * extra/net/sourceforge/javaws/about/HTMLPanel.java: moved into netx * extra/net/sourceforge/javaws/about/Main.java: same * extra/net/sourceforge/javaws/about/resources/about.html: same * extra/net/sourceforge/javaws/about/resources/jamIcon.jpg: same * extra/net/sourceforge/javaws/about/resources/applications.html: removed * extra/net/sourceforge/javaws/about/resources/notes.html: removed 2013-06-28 Adam Domurad * plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java (handleMessage): Fix potential NPE on 'GetValue' 2013-06-25 Jiri Vanek * acinclude.m4: (IT_CHECK_FOR_TAGSOUP) is now correctly setting HAVE_TAGSOUP when it is not found 2013-06-24 Jiri Vanek JNLP file is now re-downloading only if is local and have href * /netx/net/sourceforge/jnlp/Launcher.java: (launch) api cleared from (fromSource). (fromUrl) removed always re-downloading code and replaced by conditional. (launchBackground), (toFile), (BgRunner) removed. * netx/net/sourceforge/jnlp/runtime/Boot.java: following new (launch) * tests/reproducers/simple/GeneratedId/srcs/GeneratedId.java: just arguments reprinting application * tests/reproducers/simple/GeneratedId/testcases/GeneratedIdTest.java various tests based on href/no href x local/remote jnlp files * tests/reproducers/simple/GeneratedId/resources/GeneratedId.jnlp: base simple jnlp with someId argument * tests/test-extensions/net/sourceforge/jnlp/TinyHttpdImpl.java: reprinting the get/head correctly and with echo * NEWS: mentioned PR1473 2013-06-21 Adam Domurad * plugin/icedteanp/IcedTeaScriptablePluginObject.cc: Simplify IcedTeaScriptableJavaObject * plugin/icedteanp/IcedTeaScriptablePluginObject.h: Same 2013-06-21 Adam Domurad * plugin/icedteanp/IcedTeaScriptablePluginObject.cc: Move 'get_scriptable_java_package_object' and 'get_scriptable_java_object' into their correct respective classes. * plugin/icedteanp/IcedTeaScriptablePluginObject.h: Same. * plugin/icedteanp/IcedTeaNPPlugin.cc: Update references. * plugin/icedteanp/IcedTeaPluginUtils.cc: Same. * tests/cpp-unit-tests/IcedTeaScriptablePluginObjectTest.cc: Same. 2013-06-21 Adam Domurad * plugin/icedteanp/IcedTeaScriptablePluginObject.cc (IcedTeaScriptablePluginObject::get_scriptable_java_package_object): Fix memory leak due to allocated NPClass. (IcedTeaScriptableJavaPackageObject::get_scriptable_java_object): Same. 2013-06-21 Adam Domurad * plugin/icedteanp/IcedTeaPluginUtils.cc: Add global state clearing utility functions. * plugin/icedteanp/IcedTeaPluginUtils.h: Same. * tests/cpp-unit-tests/IcedTeaScriptablePluginObjectTest.cc: Test scriptable object creation and destruction. * tests/cpp-unit-tests/browser_mock.cc (mock_createobject): New, mocks NPAPI 'createobject'. * tests/cpp-unit-tests/MemoryLeakDetector.h: New, memory leak detection utility class. * tests/cpp-unit-tests/main.cc (ReportTestFinish): Print which tests resulted in memory leaks. 2013-06-21 Jiri Vanek Adam Domurad Omair Majid Added tagsup (optional dependence) as sanitizer for (possibly) invalid xml files * Makefile.am: (LAUNCHER_BOOTCLASSPATH) (PLUGIN_BOOTCLASSPATH) (NETX_CLASSPATH_ARG) (PLUGIN_COVERAGE_BOOTCLASSPATH) enriched for TAGSOUP_JAR * acinclude.m4: (IT_CHECK_FOR_TAGSOUP) new macro * configure.ac: used this new macro * tests/netx/unit/net/sourceforge/jnlp/ParserBasic.java: * netx/net/sourceforge/jnlp/JNLPCreator.java: (create) * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: * /netx/net/sourceforge/jnlp/JNLPFile.java: (JNLPFile) construcotrs * netx/net/sourceforge/jnlp/PluginBridge.java * netx/net/sourceforge/jnlp/Launcher.java: (main) all adapted to take ParserSettings instead of individual parameters * netx/net/sourceforge/jnlp/MalformedXMLParser.java: new file, bridge between tagsoup and our parser * netx/net/sourceforge/jnlp/XmlParser.java: new file, bridge to old parser * netx/net/sourceforge/jnlp/Parser.java: refactored to be able both with * netx/net/sourceforge/jnlp/ParserSettings.java: reworked to serve as gatherer for various individual parser flags * netx/net/sourceforge/jnlp/resources/Messages.propertie: (BOXml) new key describing -xml switch * tests/netx/unit/net/sourceforge/jnlp/ParserCornerCases.java: * tests/netx/unit/net/sourceforge/jnlp/ParserMalformedXml.java: * tests/netx/unit/net/sourceforge/jnlp/ParserTest.java: Tests adapted to newest state (both for included/excluded tagsoup) and new (testTagNotClosedNoTagSoup) (testUnquotedAttributesNoTagSoup) 2013-06-20 Jiri Vanek Removed out-of date support for jdk 1.5 and older * netx/net/sourceforge/jnlp/runtime/Boot.java: removed memories to Boot13 * netx/net/sourceforge/jnlp/runtime/Boot13.java: removed 2013-06-20 Jiri Vanek Made it work with OpenJDK build 25 * netx/net/sourceforge/jnlp/runtime/Boot.java: (main) Application context created as soon as possible * plugin/icedteanp/java/sun/applet/PluginMain.java:(main) Application context created as soon as possible * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java: Do not consume exception after setLookAndFeel. 2013-06-18 Andrew Azores * tests/test-extensions/net/sourceforge/jnlp/TinyHttpdImpl.java: extracted some lines out of run() into new method urlToFilePath() * tests/test-extensions-tests/net/sourceforge/jnlp/ServerAccessTest.java: unit tests added for new urlToFilePath() 2013-06-06 Jiri Vanek Andrew Azores Handled semicolon in internal server * tests/test-extensions/net/sourceforge/jnlp/TinyHttpdImpl.java: added stripHttpPathParams method to remove semicolon-delimited "tags" from end of JAR URLs * tests/test-extensions-tests/net/sourceforge/jnlp/ServerAccessTest.java: added test case for new method in TinyHttpdImpl * tests/reproducers/simple/StripHttpPathParams/resources/StripHttpPathParams.html: browser-launched applet test case for reproducer * tests/reproducers/simple/StripHttpPathParams/resources/StripHttpPathParams.jnlp: JNLP test case for reproducer * tests/reproducers/simple/StripHttpPathParams/srcs/StripHttpPathParams.java: reproducer * tests/reproducers/simple/StripHttpPathParams/testcases/StripHttpPathParamsTest.java: Testcase to above reproducer 2013-06-06 Jiri Vanek Made all tests running wit junit4.10 and higher * tests/junit-runner/CommandLine.java: (runMain) is no longer overriding and (runMainAndExit) is now calling System.exit rather then system.exit 2013-06-06 Jiri Vanek Silenced deployment.properties and zero size applet exceptions with tests * netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java: (findSystemConfigFile) and (loadProperties) now prints already cough exception only in debug mode * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java: (paint) now paints into 1 x 1 applet instead of 0 x 0 in case of 0 x 0 applet * tests/reproducers/simple/AppletTest/resources/appletZeroH.html: new file * tests/reproducers/simple/AppletTest/resources/appletZeroW.html: new file * tests/reproducers/simple/AppletTest/resources/appletZeroWH.html: new file - testing launchers with zero as width, height or both * tests/reproducers/simple/AppletTest/testcases/AppletTestTests.java: added launchers and evaluations for three new htmls - (appletZeroWH) (appletZeroW) (appletZeroH) 2013-06-06 Jiri Vanek Jacob Wisor Enhanced manifest * netx.manifest.in: added Implementation-URL, Implementation-Vendor, Specification-Title, Specification-URL, Specification-Vendor and Specification-Version entries 2013-06-05 Adam Domurad Fix PR1465 * NEWS: Bug fix note * netx/net/sourceforge/jnlp/util/UrlUtils.java (isValidRFC2396Url): New, tests if valid URL by RFC2396 rules (normalizeUrl): Don't normalize if valid by RFC2396 * tests/netx/unit/net/sourceforge/jnlp/cache/ResourceTrackerTest.java: Adapt which URLs we expect to change when normalizing URLs * tests/netx/unit/net/sourceforge/jnlp/util/UrlUtilsTest.java: (testIsValidRFC2396Url): New, tests isValidRFC2396Url (testNormalizeUrl): Add new test with valid RFC2396 URL 2013-06-04 Jiri Vanek * netx/net/sourceforge/jnlp/resources/Messages.properties: more detailed hint for CCannotClearCache 2013-06-04 Adam Domurad Remove unused files. * plugin/icedteanp/IcedTeaRunnable.cc: Removed. * plugin/icedteanp/IcedTeaRunnable.h: Removed. 2013-06-03 Adam Domurad * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java: Handle resizing more robustly by not blocking worker thread 2013-06-03 Adam Domurad * netx/net/sourceforge/jnlp/util/StreamUtils.java (copyStream): New, copies input stream to output stream * tests/netx/unit/net/sourceforge/jnlp/cache/NativeLibraryStorageTest.java: New, tests lookup of native libraries from folders and jars. * tests/test-extensions/net/sourceforge/jnlp/util/FileTestUtils.java: New, contains utilities for testing open file descriptors, creating temporary directories, and creating jars. * tests/netx/unit/net/sourceforge/jnlp/runtime/JNLPClassLoaderTest.java: Replace jar creation methods with ones from FileTestUtils. 2013-06-03 Adam Domurad * netx/net/sourceforge/jnlp/cache/NativeLibraryStorage.java: New, stores and searches for native library files that are loaded from jars. * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: Move code that handled native jar caching to NativeLibraryStorage. 2013-05-29 Adam Domurad * tests/netx/unit/net/sourceforge/jnlp/runtime/JNLPClassLoaderTest.java: Moved & renamed inner MockedOneJarJNLPFile to top-level DummyJNLPFileWithJar class. * tests/test-extensions/net/sourceforge/jnlp/mock/DummyJNLPFileWithJar.java: Moved & renamed from JNLPClassLoaderTest.MockedOneJarJNLPFile. 2013-05-29 Adam Domurad * netx/net/sourceforge/jnlp/resources/Messages.properties: "A serious exception occurred" -> "An exception occurred" 2013-05-20 Jiri Vanek Synchronized launchers to be from one source * Makefile.am: (edit_launcher_script) is now accepting variables (launcher.build/$(javaws)) no depends on launcher/launchers.in instead of launcher/javaws.in and is filling the variables for javaws (launcher.build/$(itweb_settings)) no depends on launcher/launchers.in instead of launcher/itweb_settings.in and is filling the variables for itweb_settings * launcher/itweb-settings.in: removed * launcher/javaws.in: removed * launcher/launchers.in: new file, substitution of removed (itweb-settings.in) and javaws.in. Mostly based on javaws.in, just (CLASSNAME) and (PROGRAM_NAME) and (BINARY_LOCATION) were made more general. 2013-05-20 Jiri Vanek Fixed possible deadlock for applet->js->applet call * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java: (REQUEST_TIMEOUT) new constant, 60s, to define timeout of applet->js call (waitForRequestCompletion) new method waiting to request to be done with timeout of REQUEST_TIMEOUT. (javascriptToString) using the waitForRequestCompletion instead of plain wait() * tests/reproducers/simple/AppletJsAppletDeadlock/resources/AppletJsAppletDeadlock.html and * tests/reproducers/simple/AppletJsAppletDeadlock/srcs/AppletJsAppletDeadlock.java reproducer * tests/reproducers/simple/AppletJsAppletDeadlock/testcases/AppletJsAppletDeadlockTest.java testcase 2013-05-17 Adam Domurad Fix PR854: Resizing an applet several times causes 100% CPU load * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java (handleMessage): Replace buggy initialization wait. 2013-05-14 Jiri Vanek Jacob Wisor * netx/net/sourceforge/jnlp/resources/Messages.properties: (CPJVMitwExec) fixed invalid unicode character 2013-05-02 Jana Fabrikova * tests/reproducers/simple/JavawsAWTRobotUsageSample/resources/AppletAWTRobotUsageSample.html: new resource, html page for displaying the applet in browser * tests/reproducers/simple/JavawsAWTRobotUsageSample/testcases/AppletAWTRobotUsageSampleTest.java: new testcase with 6 browser tests 2013-05-02 Jana Fabrikova * Makefile.am: Change in processing the goal (stamps/compile-reproducers-testcases.stamp) All .java files from reproducers testcases directory are compiled, all non-java files are copied into the TEST_EXTENSIONS_TESTS_DIR, i.e. tests.build/test-extensions-tests directory * tests/reproducers/simple/JavawsAWTRobotFindsButton/resources/javaws-awtrobot-finds-button.jnlp: jnlp file for displaying the applet * tests/reproducers/simple/JavawsAWTRobotFindsButton/srcs/JavawsAWTRobotFindsButton.java: the applet used in the reproducer * tests/reproducers/simple/JavawsAWTRobotFindsButton/testcases/JavawsAWTRobotFindsButtonTest.java: adding 2 tests: that an icon is loaded, and that the button is identified from the given icon and clicked by awt robot * tests/reproducers/simple/JavawsAWTRobotFindsButton/testcases/buttonA.png: the icon of the wanted button 2013-04-26 Jiri Vanek Jacob Wisor Added default, DE and PL localization's tweeks * netx/net/sourceforge/jnlp/resources/Messages.properties: * netx/net/sourceforge/jnlp/resources/Messages_de.properties: * netx/net/sourceforge/jnlp/resources/Messages_pl.properties 2013-05-02 Adam Domurad Ensure that PluginAppletviewer is resized in case of error. This fixes most of the cases of the error splash screen not appearing. * plugin/icedteanp/java/sun/applet/PluginAppletPanelFactory.java (createPanel): Resize earlier, before erroring out. * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java (PluginAppletViewer): Set size, remove fixme. 2013-05-02 Adam Domurad * plugin/icedteanp/IcedTeaNPPlugin.cc: Remove only occurence of LEGACY_XULRUNNERAPI 2013-05-02 Adam Domurad Introduce PluginPipeMock utility methods. * tests/test-extensions/sun/applet/PluginPipeMockUtil.java: New, enapsulates PluginPipeMock initialization, cleanup. As well, contains utility methods. * tests/netx/unit/sun/applet/PluginAppletViewerTest.java: Use newly introduced utility methods. 2013-05-02 Adam Domurad * plugin/icedteanp/java/sun/applet/MethodOverloadResolver.java (getBestOverloadMatch): Return null if a valid method was not found. * tests/netx/unit/sun/applet/MethodOverloadResolverTest.java (getResolvedMethod): New, gets ResolvedMethod from array of bundled class, string, and parameters (assertExpectedOverload): New variant that tests exact received values (testArrayToStringResolve): Tests array conversion to String (testArrayToArrayResolve): Tests array conversion to other arrays 2013-05-02 Adam Domurad * plugin/icedteanp/java/sun/applet/MethodOverloadResolver.java (getCostAndCastedObject): Remove code that had no effect before refactoring. (getBestOverloadMatch): Move debug-only code to debug if-block. 2013-05-02 Jiri Vanek Added various tests related to portalbank.no fixes * netx/net/sourceforge/jnlp/cache/Resource.java: added fixme to warn before wrong url comparator * netx/net/sourceforge/jnlp/Version.java: removed useless main. Its purpose moved to new * tests/netx/unit/net/sourceforge/jnlp/VersionTest: some small tests to version class * tests/netx/unit/net/sourceforge/jnlp/cache/ResourceTrackerTest.java: added tests to (getUrlResponseCode) and (findBestUrl) * tests/netx/unit/net/sourceforge/jnlp/util/HttpUtilsTest.java: added tests for (consumeAndCloseConnectionSilently) and (consumeAndCloseConnection) * tests/netx/unit/net/sourceforge/jnlp/util/UrlUtilsTest: added license header * tests/test-extensions/net/sourceforge/jnlp/ServerLauncher.java: and * tests/test-extensions/net/sourceforge/jnlp/TinyHttpdImpl.java: added support for simulation of not working HEAD request. 2013-05-02 Jiri Vanek Fix for portalbank.no (trying get after failed head requests) * net/sourceforge/jnlp/cache/ResourceTracker : (findBestUrl) now trying GET after each error request of HEAD type. Changed and added debug messages. (getUrlResponseCode) closing of stream moved to separate method HttpUtils.consumeAndCloseConnectionSilently * net/sourceforge/jnlp/util/HttpUtils.java: new file designed for http utils. Now contains (consumeAndCloseConnection) and (consumeAndCloseConnectionSilently) which calls consumeAndCloseConnection but do not rethrow exception * netx/net/sourceforge/jnlp/util/StreamUtils.java: removed (consumeAndCloseInputStream) now improved and moved to HttpUtils 2013-05-02 Jana Fabrikova * tests/test-extensions/net/sourceforge/jnlp/awt/AWTHelper.java: refactoring - removing initStrGiven variable - now it only matters if the initStr is null or not. Modifying the following two methods: (charReaded) - if initStr is null the run method can not be started from charReaded and the presence of initStr is not checked in stdout. Method (getInitStrAsRule) returns rule that is always true if initStr is null. 2013-05-02 Jiri Vanek Renamed cz locales to be more general * netx/net/sourceforge/jnlp/resources/Messages_cs_CZ.properties: renamed to * netx/net/sourceforge/jnlp/resources/Messages_cs.properties: new file * tests/netx/unit/net/sourceforge/jnlp/resources/MessagesPropertiesTest.java: * tests/reproducers/simple/LocalesTest/testcases/LocalesTestTest.java Adapted to new cz locales filename. 2013-05-02 Jana Fabrikova * Makefile.am: the directory $(TEST_EXTENSIONS_SRCDIR) (i.e. test/test-extensions) added on classpath for running reproducers, unit tests, and test code coverage for reproducers and unittests using emma and jacoco, that is for the following 6 targets: (stamps/run-netx-dist-tests.stamp) (stamps/run-netx-unit-tests.stamp) (stamps/run-unit-test-code-coverage.stamp) with EMMA (stamps/run-unit-test-code-coverage-jacoco.stamp) (stamps/run-reproducers-test-code-coverage.stamp) with EMMA (stamps/run-reproducers-test-code-coverage-jacoco.stamp) * tests/test-extensions/net/sourceforge/jnlp/awt/AWTHelper.java: modifying the constructor, the default icon is taken from ComponentFinder instead of loading from file * tests/test-extensions/net/sourceforge/jnlp/awt/imagesearch/ComponentFinder.java: added a block of initialization code - the default icon * tests/netx/unit/net/sourceforge/jnlp/awt/imagesearch/ComponentFinderTest.java: unit test for the initialization code in ComponentFinder * tests/reproducers/simple/AWTCommonResourcesOnly/resources/marker.png: second copy of the default icon in a reproducer with resources only * tests/reproducers/simple/JavawsAWTRobotUsageSample/resources/javaws-awtrobot-usage-sample.jnlp: jnlp file for displaying the applet * tests/reproducers/simple/JavawsAWTRobotUsageSample/srcs/JavawsAWTRobotUsageSample.java: the applet * tests/reproducers/simple/JavawsAWTRobotUsageSample/testcases/JavawsAWTRobotUsageSampleTest.java: adding 6 testcases testing clicking with different mouse buttons on the applet * tests/test-extensions-tests/net/sourceforge/jnlp/awt/imagesearch/ComponentFinderTest.java: unit test for the initialization code in ComponentFinder * tests/test-extensions/net/sourceforge/jnlp/awt/imagesearch/marker.png: first copy of the default icon, will be on classpath 2013-04-30 Adam Domurad * tests/netx/unit/sun/applet/MethodOverloadResolverTest.java: Add missing copyright header. * tests/netx/unit/sun/applet/PluginAppletSecurityContextTest.java: Same. * tests/netx/unit/sun/applet/PluginParameterParserTest.java: Same. 2013-04-29 Jiri Vanek More granular initialization of AwtHelper * tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java: added (executeBrowser) which can work upon fully constructed url * tests/test-extensions/net/sourceforge/jnlp/awt/AWTHelper.java: (captureScreenAndFindAppletByIconTryKTimes) split to three: (captureScreenAndFindAppletByIconTryKTimes) - unchanged, now using following (initialiseOnScreenshot) initialize from given buffered image, creating area (initialiseOnScreenshotAndArea) initialize from two given buffered images 2013-04-29 Jiri Vanek Improved performance of scanning images, added masking of images * tests/test-extensions/net/sourceforge/jnlp/awt/imagesearch/ImageSeeker.java: (findExactImage) now using masks and is iterating over rows (getMaskImage) new method to visualize mask (getMask) new method to create mask (getPixels) method to extract pixels from image to int array 2013-04-29 Jana Fabrikova * tests/test-extensions/net/sourceforge/jnlp/awt/AWTHelper.java: refactoring Point instead of Rectangle as icon position as markerPosition * tests/test-extensions/net/sourceforge/jnlp/awt/imagesearch/ComponentFinder.java: refactoring Point instead of Rectangle as icon position in several search methods 2013-04-29 Jana Fabrikova * tests/test-extensions/net/sourceforge/jnlp/awt/AWTHelper.java: fixing method (captureScreenAndFindAppletByIconTryKTimes), which should not throw AWTFrameworkException * tests/test-extensions/net/sourceforge/jnlp/awt/imagesearch/ComponentFinder.java: fixing the return values of several search methods * tests/test-extensions/net/sourceforge/jnlp/awt/imagesearch/ImageSeeker.java: fixing the return values of several search methods 2013-04-26 Jana Fabrikova * /tests/test-extensions/net/sourceforge/jnlp/closinglisteners/RulesFolowingClosingListener.java: added a getter method getRules * tests/test-extensions/net/sourceforge/jnlp/awt/AWTHelper.java: the most important class of AWTFramework, combines closing listener and possibility to use mouse and keyboard for input to tests * tests/test-extensions/net/sourceforge/jnlp/awt/AWTFrameworkException.java: exception that is raised in the framework whenever programmer did not provide enough information * tests/test-extensions/net/sourceforge/jnlp/awt/awtactions/KeyboardActions.java: class with utility keyboard methods * tests/test-extensions/net/sourceforge/jnlp/awt/awtactions/MouseActions.java: class with utility mouse methods * tests/test-extensions/net/sourceforge/jnlp/awt/imagesearch/ComponentFinder.java: class for finding components in a screenshot * tests/test-extensions/net/sourceforge/jnlp/awt/imagesearch/ComponentNotFoundException.java: exception that can be raised if an important component could not be found * tests/test-extensions/net/sourceforge/jnlp/awt/imagesearch/ImageSeeker.java: class for general image searching * tests/reproducers/simple/AWTCommonResourcesOnly/resources/marker.png: reproducer with resources only, contains the default icon marking applets 2013-04-26 Adam Domurad * netx/net/sourceforge/jnlp/cache/ResourceTracker.java (getCacheFile): Use decodeUrlAsFile instead of toURI().getPath(). * netx/net/sourceforge/jnlp/util/UrlUtils.java (decodeUrlAsFile): New, tolerates ill-formed URLs. * tests/netx/unit/net/sourceforge/jnlp/util/UrlUtilsTest.java: (testDecodeUrlAsFile): Test for (decodeUrlAsFile) 2013-04-26 Jiri Vanek Jacob Wisor Added polish localisation * netx/net/sourceforge/jnlp/resources/Messages_de.properties * netx/net/sourceforge/jnlp/resources/Messages.properties: minor fixes * netx/net/sourceforge/jnlp/resources/Messages_pl.properties: new localization nearly complete list of PL values * tests/netx/unit/net/sourceforge/jnlp/resources/MessagesPropertiesTest.java Added PL as known translation * tests/reproducers/simple/LocalesTest/testcases/LocalesTestTest.java: Added tests to PL integration 2013-04-26 Jiri Vanek Alexandr Kolouch Improved and completed CZ localisation * netx/net/sourceforge/jnlp/resources/Messages_cs_CZ.properties: Added missing items, some fixes 2013-04-26 Jiri Vanek Alexandr Kolouch Added CZ localization of itw-settings Xdesktop configuration file * itweb-settings.desktop.in: added Name[cs] and Name[cs] keys with values. 2013-04-26 Jiri Vanek Jacob Wisor Added DE and PL localization of itw-settings Xdesktop configuration file * itweb-settings.desktop.in: added Name[de], Name[pl], Comment[de], Comment[pl] keys with values. Added Keywords key with values. 2013-04-26 Jiri Vanek Silenced unittests * tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/impl/UnsignedAppletActionStorageImplTest.java: and * tests/netx/unit/sun/applet/PluginAppletViewerTest.java: System.out.println replaced by ServerAccess.logOutputReprint 2013-04-26 Jiri Vanek Fixed compilation under jdk6 * netx/net/sourceforge/jnlp/util/JarFile.java: is now implementing Closeable 2013-04-26 Jiri Vanek Fixed regressed unittest and "cause" * /netx/net/sourceforge/jnlp/NullJnlpFileException.java: fixed header * netx/net/sourceforge/jnlp/SecurityDesc.java: (SecurityDesc) is now throwing NullJnlpFileException in case of null jnlp file. * tests/netx/unit/net/sourceforge/jnlp/ParserBasic.java: is now using correct DummyJnlpFile * tests/netx/unit/net/sourceforge/jnlp/SecurityDescTest.java: new testfile. (testNotNullJnlpFile) (testNullJnlpFile) testing the behavior for null jnlp file and for existing jnlpfile. * tests/netx/unit/net/sourceforge/jnlp/runtime/CodeBaseClassLoaderTest.java: (DummyJnlpFile) extracted to test-extensions and have removed incorrect have security (testNullFileSecurityDescApplet) and (testNullFileSecurityDesc) is now expecting NullJnlpFileException instead of results * tests/test-extensions/net/sourceforge/jnlp/mock/DummyJNLPFile.java: new reusable dummy jnlp file 2013-04-25 Adam Domurad Add accidentally not included files from "Tests & test extensions for mocking the plugin input & output pipes." 2013-04-25 Adam Domurad Fix a dead-lock that can cause (namely) Firefox to hang. * netx/net/sourceforge/jnlp/NetxPanel.java (appletAlive): Remove flag. (isAlive): Remove getter. (initialized): New, explicit initialization flag. (isInitialized): New, getter. (runLoader): Set initialization flag when done (whether errored or not). * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java (waitForAppletInit): Wait on initialization flag from NetxPanel. (handleMessage): Remove redundant waiting for init. Respond properly to GetJavaObject in case of error/time-out. 2013-04-25 Adam Domurad * tests/netx/unit/net/sourceforge/jnlp/AsyncCallTest.java: Unit tests for AsyncCall test extension. 2013-04-25 Adam Domurad Tests & test extensions for mocking the plugin input & output pipes. * Makefile.am (stamps/test-extensions-compile.stamp): Make plugin classes available to test extensions * tests/test-extensions/net/sourceforge/jnlp/AsyncCall.java: New, helper for doing asynchronous calls with an optional timeout. * tests/netx/unit/sun/applet/PluginAppletViewerTest.java: New, uses PluginPipeMock to test the javascript requests to the plugin. * tests/test-extensions/sun/applet/mock/PluginPipeMock.java: New, helper for getting the plugin requests and mocking the replies. 2013-04-25 Jiri Vanek Locking disabled on windows machines * netx/net/sourceforge/jnlp/util/lockingfile/LockedFile.java: (lock) and (unlock) are no-op on windows. 2013-04-25 Jiri Vanek Splashscreen now strip commit id from released versions * netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/BasePainter.java: (stripCommitFromVersion) new method responsible for cutting (drawBase) now using stripCommitFromVersion before printing drawing version to splashscreen * tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/BasePainterTest.java: (stripCommitFromVersion) new test for 2013-04-24 Adam Domurad * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java: Remove unnecessary line that can result in NPE 2013-04-23 Adam Domurad * tests/netx/unit/net/sourceforge/jnlp/util/UrlUtilsTest.java: Added tests for decodeUrlQuietly, normalizeUrl, normalizeUrlQuietly. 2013-04-23 Adam Domurad * netx/net/sourceforge/jnlp/cache/ResourceTracker.java: Remove no longer used constants. Remove (normalizeUrl). Update calls. * netx/net/sourceforge/jnlp/cache/CacheUtil.java: Expand imports. Update calls. * netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletTrustConfirmation.java: Ensure file://-protocol URLs are encoded. * netx/net/sourceforge/jnlp/util/UrlUtils.java: Add (normalizeUrl), and related utility methods. Allow for optionally encoding file:// URLs. 2013-04-23 Adam Domurad Ensure document-base is properly encoded. * netx/net/sourceforge/jnlp/cache/ResourceTracker.java (getCacheFile): Use URL#toUri().getPath() instead of URL#getFile(). * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java (handleInitializationMessage): Don't decode document-base. 2013-04-23 Adam Domurad Reproducer for URL parameters (eg ?a=b) in document-base. * tests/reproducers/simple/URLParametersInDocumentBase/resources/URLParametersInDocumentBase.html: Page that loads applet. * tests/reproducers/simple/URLParametersInDocumentBase/srcs/URLParametersInDocumentBase.java: Applet that prints code-base & document-base. * tests/reproducers/simple/URLParametersInDocumentBase/testcases/URLParametersInDocumentBaseTests.java: Test-driver. 2013-04-23 Adam Domurad * netx/net/sourceforge/jnlp/NetxPanel.java (exitOnFailure): Remove always-false field. (NetxPanel): Remove overloaded constructor (runLoader): Do not swallow LaunchException's. Remove dead exitOnFailure code-path. Set applet status to APPLET_ERROR on exception. * plugin/icedteanp/java/sun/applet/PluginAppletPanelFactory.java (createPanel): Update call to NetxPanel constructor. 2013-04-23 Adam Domurad * tests/reproducers/signed/AppContextHasJNLPClassLoader/resources/AppContextHasJNLPClassLoader.html: Test AppContext context classloader from HTML applet * tests/reproducers/signed/AppContextHasJNLPClassLoader/resources/AppContextHasJNLPClassLoader.jnlp: Test AppContext context classloader from JNLP application * tests/reproducers/signed/AppContextHasJNLPClassLoader/resources/AppContextHasJNLPClassLoaderForJNLPApplet.jnlp: Test AppContext context classloader from JNLP applet * tests/reproducers/signed/AppContextHasJNLPClassLoader/srcs/AppContextHasJNLPClassLoader.java: Print out context classloader for thread & AppContext, for current thread & Swing thread. * tests/reproducers/signed/AppContextHasJNLPClassLoader/testcases/AppContextHasJNLPClassLoaderTest.java: Test runner for AppContextHasJNLPClassLoader 2013-04-23 Adam Domurad Ensure JarFile handles do not leak. * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: Ensure close is called for each JarFile. 2013-04-23 Adam Domurad * tests/netx/unit/net/sourceforge/jnlp/runtime/JNLPClassLoaderTest.java: New, JNLPClassLoader unit tests for (checkForMain), (getMainClassName), (activateNativeJar), and (isInvalidJar). Checks for file descriptor leaks. * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java (isInvalidJar): Change to default visibility for testing purposes. (checkForMain): Same. (getMainClassName): Same. 2013-04-23 Adam Domurad Rewrite of MethodOverloadResolver with detailed unittests. * plugin/icedteanp/java/sun/applet/MethodOverloadResolver.java: Rewritten to reduce duplicated code, fix very subtle bugs in never-tested codepaths, obey spec properly. Introduced new helper types where Object[] arrays with special-meaning positions were passed around. * plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java: Updated to work with newly introduced types / refactored overload resolver. * tests/netx/unit/sun/applet/MethodOverloadResolverTest.java: In-depth unit tests of hairy details of method overloading in JS<->Java. 2013-04-23 Omair Majid PR1299 * NEWS: Update with fix * netx/net/sourceforge/jnlp/browser/BrowserAwareProxySelector.java (initFromBrowserConfig): Fix typo in socks proxy setting key. 2013-04-19 Jiri Vanek testing server allowed from makefile * Makefile.am: (stamps/netx-dist-tests-prepare-reproducers.stamp) added stamps/netx-dist.stamp stamps/plugin.stamp dependence (stamps/test-extensions-compile.stamp) added stamps/netx-dist.stamp stamps/plugin.stamp dependence (stamps/compile-reproducers-testcases.stamp) added stamps/plugin.stamp dependence (run-test-server-on-44321) new target, starts server in deploy dir, on port 44321 (run-test-server-on-random-port) new target, starts server in deploy dir, on random port * tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java: (main) added better access to random port 2013-04-17 Jiri Vanek Added various self-describing tests for codebase * tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoaderApplet-reader1-writer1.html * tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoaderApplet-reader1-writer2.html * tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoaderApplet-reader1.html * tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoaderApplet-reader2.html * tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoaderApplet-writer1.html * tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoaderApplet-writer2.html * tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoaderApplet2-reader1-writer1.html * tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoaderApplet2-reader1-writer2.html * tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoaderApplet2-reader1.html * tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoaderApplet2-reader2.html * tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoaderApplet2-writer1.html * tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoaderApplet2-writer2.html * tests/reproducers/simple/AppletSharedClassLoader/srcs/SharedClassLoaderApplet1.java * tests/reproducers/simple/AppletSharedClassLoader/srcs/SharedClassLoaderApplet2.java * tests/reproducers/simple/AppletSharedClassLoader/srcs/SharedSecret.java * tests/reproducers/simple/AppletSharedClassLoader/testcases/SharedClassLoaderApplet_WrittenCompleteCodeBaseTest.java * tests/reproducers/simple/AppletSharedClassLoader/testcases/SharedClassLoaderApplet_WrittenPartialStubCodeBaseTest.java * tests/reproducers/simple/AppletSharedClassLoader/testcases/SharedClassLoaderApplet_dotCodeBaseTest.java 2013-04-17 Adam Domurad Jiri Vanek CVE-2013-1926, RH916774: Class-loader incorrectly shared for applets with same relative-path. * netx/net/sourceforge/jnlp/PluginParameters.java (getCodeBase): Removed (getUniqueKey): Now takes absolute codebase * netx/net/sourceforge/jnlp/NetxPanel.java: Pass absolute codebase in getUniqueKey calls. * netx/net/sourceforge/jnlp/PluginBridge.java: Same. 2013-04-17 Jiri Vanek Fixed gifar vulnereability with automated testcase * netx/net/sourceforge/jnlp/util/JarFile.java: IcedTea-Web replacement for java.util.jar.JarFile.java with capability to verify if the jar starts as jar and not as something else (eg gif) * netx/net/sourceforge/jnlp/Launcher.java: migrated to new JarFile * netx/net/sourceforge/jnlp/resources/Messages.properties: added BXignoreheaders key with description to new -Xignoreheaders switch * netx/net/sourceforge/jnlp/runtime/Boot.java: added switch Xignoreheaders to allow to disable the header verification. * netx/net/sourceforge/jnlp/runtime/CachedJarFileCallback.java: migrated to new JarFile * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: improved reporting of new JarFile exceptions * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java: new field ignoreHeaders, informing about new JarFile whether to verify or not verify headers. By default verifying, so have value of false. * netx/net/sourceforge/jnlp/tools/JarCertVerifier.java: migrated to new JarFile * netx/net/sourceforge/jnlp/util/InvalidJarHeaderException.java: new not-checked exception to signify that jar is corrupted on headers level. * tests/reproducers/custom/GifarCreator/srcs/Makefile: makefile to join gif and jar to create gifar * tests/reproducers/signed/GifarBase/resources/gifarView_hacked.html: html with hacked gifar * tests/reproducers/signed/GifarBase/resources/gifarView_ok.html: html with valid gifs and jars * tests/reproducers/signed/GifarBase/resources/gifar_applet.jnlp: jnlp applet constructed from hacked gifar * tests/reproducers/signed/GifarBase/resources/gifar_application.jnlp: jnlp application constructed from hacked gifar * tests/reproducers/signed/GifarBase/srcs/GifarMain.java: Main method of reproducer * tests/reproducers/signed/GifarBase/testcases/GifarTestcases.java: Testing methods * tests/reproducers/signed/GifarBase/resources/happyNonAnimated.gif: binary file, image, gif, used to create hacked gifars 2013-04-17 Jiri Vanek removed java call to obtain jvm args for plugin * /plugin/icedteanp/IcedTeaNPPlugin.cc: (get_jvm_args) Java call replaced by call to recently added read_deploy_property_value function. 2013-04-12 Adam Domurad * netx/net/sourceforge/jnlp/security/appletextendedsecurity/ExtendedAppletSecurityHelp.java: Clean-up generated code. 2013-04-12 Adam Domurad Present more information in unsigned applet confirmation. * netx/net/sourceforge/jnlp/resources/Messages.properties (SRememberCodebase): Add codebase parameter. (SUnsignedDetail): Change layout, add documentbase parameter. * netx/net/sourceforge/jnlp/security/UnsignedAppletTrustWarningPanel.java (setupInfoPanel): Pass documentbase to SUnsignedDetail. (createCheckBoxPanel): Ensure left-alignment. (createButtonPanel): Less spacing above button. 2013-04-12 Jiri Vanek Added help for extended applets security and settings * netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletsTrustingListPanel: (helpButtonActionPerformed) added code to open dialogue with help * netx/net/sourceforge/jnlp/resources/Messages.propertie: Included html help message * netx/net/sourceforge/jnlp/security/UnsignedAppletTrustWarningPanel.java: added help button and logic to open help dialogue * netx/net/sourceforge/jnlp/security/appletextendedsecurity/ExtendedAppletSecurityHelp.java: Simple dialogue with JEditorPane with html help from properties and few navigation buttons * NEWS: mentioned extended appelts security 2013-04-12 Jiri Vanek Added dialogue to allow setting of custom JRE * launcher/itweb-settings.in: and * launcher/javaws.in: check for custom jre less strict * netx/net/sourceforge/jnlp/config/Defaults.java:made aware of deployment.jre.dir constant * netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java: added\ KEY_JRE_DIR= "deployment.jre.dir" constant, user file occurrences extracted to USER_DEPLOYMENT_PROPERTIES_FILE. * netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java: used validation of jdk when saving properties * netx/net/sourceforge/jnlp/controlpanel/JVMPanel.java: added text-field to set JVM directory, friendly with logic and validation. * netx/net/sourceforge/jnlp/resources/Messages.properties: added messages to JVM selection and validation. * netx/net/sourceforge/jnlp/util/StreamUtils.java: (readStreamAsString) new utility method. * NEWS: mentioned select-able JVM 2013-04-11 Adam Domurad Remove legacy support for the old version of NPAPI. * plugin/icedteanp/IcedTeaNPPlugin.cc: Remove if directives for old version of NPAPI. * plugin/icedteanp/IcedTeaNPPlugin.h: Same * plugin/icedteanp/IcedTeaPluginRequestProcessor.cc: Same * plugin/icedteanp/IcedTeaPluginRequestProcessor.h: Same * plugin/icedteanp/IcedTeaPluginUtils.cc: Same * plugin/icedteanp/IcedTeaPluginUtils.h: Same * plugin/icedteanp/IcedTeaRunnable.h: Same * plugin/icedteanp/IcedTeaScriptablePluginObject.h: Same 2013-04-11 Adam Domurad Allow remembering applet confirmation for whole codebase. * netx/net/sourceforge/jnlp/resources/Messages.properties: Added SRememberAppletOnly, SRememberCodebase messages * netx/net/sourceforge/jnlp/security/SecurityDialogs.java (showUnsignedWarningDialog): Use UnsignedWarningAction * netx/net/sourceforge/jnlp/security/UnsignedAppletTrustWarningDialog.java (UnsignedAppletTrustWarningDialog): Use UnsignedWarningAction * net/sourceforge/jnlp/security/UnsignedAppletTrustWarningPanel.java: Introduce UnsignedWarningAction, add additional confirmation choices * netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletTrustConfirmation.java: Support remembering action for entire codebase. 2013-04-10 Jana Fabrikova * /tests/reproducers/simple/JSToJFuncResol/testcases/JSToJFuncResolTest.java: adding 11 testcases based on the interactive Liveconnect JS->Java overloaded function resolution tests, tests with JSObject were already included * /tests/reproducers/simple/JSToJFuncResol/srcs/JSToJFuncResol.java: the applet whose methods are invoked from JS during the tests * /tests/reproducers/simple/JSToJFuncResol/resources/JSToJava_FuncResol.js: the JavaScript code for calling the applet methods from JS * /tests/reproducers/simple/JSToJFuncResol/resources/jstoj-funcresol.jnlp: java network launch protocol file for displaying applet in the html page * /tests/reproducers/simple/JSToJFuncResol/resources/JSToJFuncResol.html: the html page with java applet embedded, displayed in browser during the tests 2013-04-10 Jana Fabrikova * /tests/reproducers/simple/JToJSFuncReturn/testcases/JToJSFuncReturnTest.java: adding 5 testcases based on the interactive Liveconnect JS->Java function return type tests * /tests/reproducers/simple/JToJSFuncReturn/srcs/JToJSFuncReturn.java: the applet that calls JS functions * tests/reproducers/simple/JToJSFuncReturn/resources/JToJS_FuncReturn.js: auxiliary JavaScript code * /tests/reproducers/simple/JToJSFuncReturn/resources/jtojs-funcreturn.jnlp: jnlp file for displaying applet in the html page * /tests/reproducers/simple/JToJSFuncReturn/resources/JToJSFuncReturn.html: the html page where the applet calling JS functions is embedded 2013-04-08 Jiri Vanek * tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/Epiphany.java: Removed good --sm-client-disable switch. No longer supported by epiphany 2013-04-04 Jiri Vanek Plugin is now honoring the custom jre * launcher/itweb-settings.in : * launcher/javaws.in: In case that custom jre do not exists, complains, and use default rather * plugin/icedteanp/IcedTeaNPPlugin.cc: (get_plugin_executable) and (get_plugin_rt_jar) now tries to return custom values before returning the default one. 2013-04-03 Jana Fabrikova * /test/reproducers/simple/JavascriptFuncParam/testcases/JavascriptFuncParamTest.java: added annotation KnownToFail in googleChrome and chromiumBrowser to the method (AppletJToJSFuncParam_JSObject_Test) * /test/reproducers/simple/JavascriptGet/testcases/JavascriptGetTest.java: added annotation KnownToFail in midori, epiphany, googleChrome and chromiumBrowser to the methods (AppletJToJSGet_1DArray_Test) and (AppletJToJSGet_2DArray_Test) 2013-04-03 Jana Fabrikova * /tests/test-extensions/net/sourceforge/jnlp/annotations/KnownToFailInBrowsers.java: the implementation of new annotation, which has an array of browsers of type Browsers[] named failsIn * /tests/junit-runner/JunitLikeXmlOutputListener.java: in method (testDone) the testcases that are known to fail in current browser are detected in addition to the tests that are k2f in all browsers * /tests/junit-runner/LessVerboseTextListener.java: added method (getK2FinB) reading the annotation, in method (printK2F) the testcases that are known to fail in current browser are detected in addition to the tests that are k2f in all browsers 2013-03-28 Adam Domurad * netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletTrustConfirmation.java (normalizeUrlAndStripParams): Moved. * netx/net/sourceforge/jnlp/util/UrlUtils.java (normalizeUrlAndStripParams): New, moved from UnsignedAppletTrustConfirmation. * tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletTrustConfirmationTest.java (testNormalizeUrlAndStripParams): Moved. * tests/netx/unit/net/sourceforge/jnlp/util/UrlUtilsTest.java: New, has (testNormalizeUrlAndStripParams) from UnsignedAppletTrustConfirmationTest. 2013-03-22 Jiri Vanek Added code to parse properties and to find correct configuration files from c++ part of plugin * Makefile.am: IcedTeaParseProperties.cc added to be compiled with rest of plugin * plugin/icedteanp/IcedTeaParseProperties.cc: new file, contains implementation for searching for config files and to read value from them * plugin/icedteanp/IcedTeaParseProperties.h: public api for "library" * plugin/icedteanp/IcedTeaPluginUtils.cc: * plugin/icedteanp/IcedTeaPluginUtils.h: added new methods (trim) and (file_exists) * tests/cpp-unit-tests/IcedTeaParsePropertiesTest.cc: tests for library methods * tests/cpp-unit-tests/IcedTeaPluginUtilsTest.cc: added tests for new methods 2013-03-28 Adam Domurad Don't interrupt worker/consumer threads (can prevent shutdown code from executing); instead use Object wait/notify methods. * plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java (notifyHasWork): Replacement for thread interruption (waitForWork): Replacement for thread sleeping (run): Use waitForWork instead of Thread.sleep (notifyWorkerIsFree): Removed -- misleading method. * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java (message): Make volatile, as it should have always been. (notifyHasWork): Replacement for thread interruption (waitForWork): Replacement for thread sleeping (run): Use waitForWork instead of Thread.sleep (getPermissions): avoid potential NPE if code source location is missing (free): Remove reference to notifyWorkerIsFree. 2013-03-26 Adam Domurad Integration of unsigned applet confirmation dialogue. * netx/net/sourceforge/jnlp/PluginBridge.java (getArchiveJars): New, returns archive jars as list * netx/net/sourceforge/jnlp/resources/Messages.properties: Confirmation messages added to properties file * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java (getInstance): Initialization refactored into createInstance (createInstance): New, checks if unsigned applet is allowed, initializes classloader. (initializeResources): Don't consider no-jar applets signed. * netx/net/sourceforge/jnlp/security/SecurityDialogs.java (showUnsignedWarningDialog): Creates message with DialogType.UNSIGNED_WARNING * netx/net/sourceforge/jnlp/security/SecurityDialog.java (installPanel): Add case for DialogType.UNSIGNED_WARNING * netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletActionStorage.java: Expose locking members from interface * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java (handleInitializationMessage): Do nothing if applets have been disabled. * netx/net/sourceforge/jnlp/security/UnsignedAppletTrustWarningDialog.java: New, security dialog that asks for unsigned applet confirmation. * netx/net/sourceforge/jnlp/security/UnsignedAppletTrustWarningPanel.java: Implements the dialog contents for unsigned applet confirmation. * netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletTrustConfirmation.java: Updates and checks applet confirmation storage, creates warning dialog if required. * tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletTrustConfirmationTest.java: New, tests relative & normalized path creation helpers. 2013-03-26 Jiri Vanek Path validator fixed to be correctly multiplatform * netx/net/sourceforge/jnlp/config/BasicValueValidators.java : (FilePathValidator) now check absolute file by File.isAbsolute() instead of by plain "/". * tests/netx/unit/net/sourceforge/jnlp/config/BasicValueValidatorsTests.java : New file to test new functionality. 2013-03-25 Jana Fabrikova * tests/reproducers/simple/JavascriptFuncReturn/testcases/JavascriptFuncReturnTest.java adding 5 testcases for testing calling javascript functions with various return types from java * tests/reproducers/simple/JavascriptFuncReturn/resources/JavascriptFuncReturn.html the html page for displaying browser tests * tests/reproducers/simple/JavascriptFuncReturn/resources/Javascript_FuncReturn.js auxiliary javascript functions * tests/reproducers/simple/JavascriptFuncReturn/resources/javascript-funcreturn.jnlp jnlp file for embedding applet in the html page * tests/reproducers/simple/JavascriptFuncReturn/srcs/JavascriptFuncReturn.java the applet that calls javascript functions 2013-03-25 Jana Fabrikova * tests/reproducers/simple/JavascriptSet/testcases/JavascriptSetTest.java adding 21 testcases for testing setting javascript variables from java * tests/reproducers/simple/JavascriptSet/resources/JavascriptSet.html the html page for displaying browser tests * tests/reproducers/simple/JavascriptSet/resources/Javascript_Set.js auxiliary javascript functions * tests/reproducers/simple/JavascriptSet/resources/javascript-set.jnlp jnlp file for embedding applet in the html page * tests/reproducers/simple/JavascriptSet/srcs/JavascriptSet.java the applet that sets javascript variables 2013-03-25 Jana Fabrikova * tests/reproducers/simple/JavascriptGet/testcases/JavascriptGetTest.java adding 7 new testcases for reading JS values from Java * tests/reproducers/simple/JavascriptGet/resources/JavascriptGet.html the html page for displaying browser tests * tests/reproducers/simple/JavascriptGet/resources/Javascript_Get.js auxiliary javascript functions * tests/reproducers/simple/JavascriptGet/resources/javascript-get.jnlp jnlp file for embedding the applet in the html page * tests/reproducers/simple/JavascriptGet/srcs/JavascriptGet.java the applet that reads values from javascript 2013-03-25 Jana Fabrikova * tests/reproducers/simple/JavascriptFuncParam/testcases/JavascriptFuncParamTest.java adding 19 testcases for calling javascript functions from java with parameters of various types * tests/reproducers/simple/JavascriptFuncParam/resources/JavascriptFuncParam.html the html page for displaying browser tests * tests/reproducers/simple/JavascriptFuncParam/resources/javascript-funcparam.jnlp jnlp file for embedding the applet in html page * tests/reproducers/simple/JavascriptFuncParam/srcs/JavascriptFuncParam.java the applet that calls functions from javascript 2013-03-22 Adam Domurad * plugin/icedteanp/java/sun/applet/PluginParameterParser.java (isInt): Revert behaviour to catching NumberFormatException 2013-03-22 Adam Domurad * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java (findClass): Print stacktrace for ClassFormatError 2013-03-22 Jiri Vanek * netx/net/sourceforge/jnlp/security/appletextendedsecurity/impl/UnsignedAppletActionStorageImpl.java: (isMatching) is now ignring archives if empty. * tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/impl/UnsignedAppletActionStorageImplTest.java: tests adapted and enriched for new archives processing. 2013-03-21 Jiri Vanek Launchers made aware of custom set JRE * launcher/itweb-settings.in: * launcher/javaws.in: are now scanning ~/.icedtea/deployment.properties and /etc/.java/.deploy/deployment.properties for deployment.jre.dir property. If found, then its java and rt.jar are used to launch applications. 2013-03-20 Jana Fabrikova * tests/reproducers/simple/JSToJGet/testcases/JSToJGetTest.java: adding few lines for not running test in Opera * tests/reproducers/simple/JSToJSet/testcases/JSToJSetTest.java: adding few lines for not running test in Opera * tests/reproducers/simple/JSToJFuncParam/testcases/JSToJFuncParamTest.java: adding few lines for not running test in Opera * tests/reproducers/simple/JSToJTypeConv/testcases/JSToJTypeConvTest.java: adding few lines for not running test in Opera 2013-03-20 Jiri Vanek All occurences of hardcoded paths to java repalced by call of functions * plugin/icedteanp/IcedTeaNPPlugin.cc: (appletviewer_executable) renamed to (appletviewer_default_executable). (appletviewer_default_rtjar) new variable to keep default rt.jar path. (get_plugin_executable) and (string get_plugin_rt_jar) new functions, returniong the default variables for now. 2013-03-19 Adam Domurad * Makefile.am (CPP_UNITTEST_EXECUTABLE): Add -lrt & -lpthread flags, which do not seem to be brought in on all systems. 2013-03-13 Jiri Vanek * NEWS: mentioned de translation * AUTHORS: added Jacob Wisor 2013-03-13 Jiri Vanek Jacob Wisor Fixed strange sentences in default locales bundle. * netx/net/sourceforge/jnlp/resources/Messages.properties: 2013-03-13 Jiri Vanek Added tests for German i18n * tests/reproducers/simple/LocalesTest/testcases/LocalesTestTest.java: Enhanced to test also German localization . * tests/netx/unit/net/sourceforge/jnlp/resources/MessagesPropertiesTest.java: Enhanced to handle de messages and be prepared for locales with one language but different nations. 2013-03-13 Jiri Vanek Jacob Wisor Added initial German localization * netx/net/sourceforge/jnlp/resources/Messages_de.properties: New file with German properties 2013-03-05 Adam Domurad * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java (closeStream): Remove. (verifySignedJNLP): Make use of StreamUtils instead. * netx/net/sourceforge/jnlp/utils/StreamUtils.java (closeSilently): New method. 2013-02-28 Jiri Vanek * netx/net/sourceforge/jnlp/config/SecurityValueValidator.java: modifed null check - no considered as correct value as being valid value in runtime. 2013-02-27 Jiri Vanek Added backend and settings for extended applet security * netx/net/sourceforge/jnlp/config/Defaults.java: deployment.security.level added to defaults with its validator * netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java: Added deployment.security.level (KEY_SECURITY_LEVEL)key and .appletTrustSettings (APPLET_TRUST_SETTINGS)filename with getters * netx/net/sourceforge/jnlp/config/SecurityValueValidator.java: Simple validator for value of deployment.security.level based on parsing in AppletSecurityLevel.fromString * netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java: Incorporated UnsignedAppletsTrustingListPanel panel * netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletActionTableModel.java: Backend for main tables in UnsignedAppletsTrustingListPanel * netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletsTrustingListPanel.java: GUI for manipulate the deployment.security.level values and content of .appletTrustSettings files * netx/net/sourceforge/jnlp/resources/Messages.properties: Added keys and values for new; user visible, strings * netx/net/sourceforge/jnlp/security/appletextendedsecurity/AppletSecurityLevel.java: Object representation of deployment.security.level value * netx/net/sourceforge/jnlp/security/appletextendedsecurity/AppletStartupSecuritySettings.java: Entrance singleton for current deployment.security.level policy and records. * netx/net/sourceforge/jnlp/security/appletextendedsecurity/ExecuteUnsignedApplet.java: Object representation of action upon record in .appletTrustSettings * netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletActionEntry.java: Object representation of one item in .appletTrustSettings .appletTrustSettings by itw (except settings part) * netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletActionStorage.java Minimal set of functionality requested for accessing the * netx/net/sourceforge/jnlp/security/appletextendedsecurity/UrlRegEx.java Simple class which should help to distinguish between plain String and String keeping UrlRegex * netx/net/sourceforge/jnlp/security/appletextendedsecurity/impl/UnsignedAppletActionStorageExtendedImpl.java: Extended implementation of UnsignedAppletActionStorageImpl which have additional "for settings" functionality * netx/net/sourceforge/jnlp/security/appletextendedsecurity/impl/UnsignedAppletActionStorageImpl.java: Object representation of.appletTrustSettings file. It Should be multi-thread/app safe and should be always actual. Based on LockingReaderWriter. * netx/net/sourceforge/jnlp/util/lockingfile/LockedFile.java: Utility class with functionality to lock file in muti-app/thread environment * netx/net/sourceforge/jnlp/util/lockingfile/LockingReaderWriter.java: Utility class with functionality to lock file during reading/writing in muti-app/thread environment * netx/net/sourceforge/jnlp/util/lockingfile/StorageIoException.java: Wrapper for common, but rare IOException extending RuntimeExceptionaround for LockingReaderWriter to avoid numerous declarations. * tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/impl/UnsignedAppletActionStorageImplTest.java: Tests of main methods in UnsignedAppletActionStorageImplTest focused on matching * tests/netx/unit/net/sourceforge/jnlp/util/lockingfile/LockingReaderWriterTest.java: Tests of multithread read/write to LockingReaderWriter 2013-02-25 Adam Domurad * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: (createInstance): Extract initialization logic from 'getInstance' into new 'createInstace' method. (getInstance): Call newly introduced createInstance method. 2013-02-25 Jiri Vanek Removed unused legacy-launcher sources * launcher/java.c: * launcher/java.h: * launcher/java_md.c: * launcher/java_md.h: * launcher/jli_util.c: * launcher/jli_util.h: * launcher/jni.h: * launcher/jni_md.h: * launcher/jvm.h: * launcher/jvm_md.h: * launcher/manifest_info.h: * launcher/parse_manifest.c: * launcher/splashscreen.h: * launcher/splashscreen_stubs.c: * launcher/version_comp.c: * launcher/version_comp.h: * launcher/wildcard.c: * launcher/wildcard.h: Happily removed 2013-02-21 Adam Domurad * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java (getPermissions): avoid potential NPE if code source location is missing 2013-02-14 Adam Domurad PR835: javaws leaks connections Uses HEAD requests if possible for testing URLs. Adds name to download threads. * netx/net/sourceforge/jnlp/cache/ResourceTracker.java: (startThread): Add name to download thread (getResourceUrlResponseCode): Get or fake an HTTP response code. (findBestUrl): Use getResourceUrlResponseCode to first try a HEAD request. Fall-back to GET rquest. * netx/net/sourceforge/jnlp/utils/StreamUtils.java: New file, contains utility for consuming input stream. 2013-02-14 Adam Domurad * tests/test-extensions/net/sourceforge/jnlp/TinyHttpdImpl.java: Support HEAD requests. 2013-02-13 Adam Domurad Fix PR580: http://www.horaoficial.cl/ loads improperly. Applets that must share a class-loader now load sequentially. * NEWS: Mention the fix. * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java (getUniqueKeyLock): New, atomically grabs or creates a lock for the unique key. (getInstance): Ensure classloader initialization is locked by unique key. (decrementLoaderUseCount): Ensure classloader deinitialization is locked by unique key, get rid of no-longer used locks. 2013-02-13 Jiri Vanek Added test for hanging firefox by LaunchException and Improved AddShutdownHookTest * tests/reproducers/simple/AddShutdownHook/resources/AddShutdownHook.html: new file to launch applet with RuntimeException as result. * tests/reproducers/simple/AddShutdownHook/resources/AddShutdownHook_wrong.html: new file to launch applet with LaunchException as result. * tests/reproducers/simple/AddShutdownHook/srcs/AddShutdownHook.java: is now also applet. * tests/reproducers/simple/AddShutdownHook/testcases/AddShutdownHookTest.java: Added test (AddShutdownHookApplet)for applet, removed duplicate code by rules. * tests/reproducers/simple/AddShutdownHook/testcases/HangFirefoxTests.java: New test set which is launching exception throwing applet, and after exception is thrown then it tries jsut stdou-ing applet. Second applet have to be launched. 2013-02-12 Jana Fabrikova * /tests/reproducers/simple/JSToJFuncParam/testcases/JSToJFuncParamTest.java: adding 19 testcases - 18 based on the interactive Liveconnect JS->Java function parameter tests, 1 additional testcase for passing parameters of type JSObject (from JS to Java) * /tests/reproducers/simple/JSToJFuncParam/srcs/JSToJFuncParam.java: the applet whose methods are invoked from JS during the tests * /tests/reproducers/simple/JSToJFuncParam/resources/JSToJava_FuncParam.js: the JavaScript code for calling the applet methods from JS * /tests/reproducers/simple/JSToJFuncParam/resources/jstoj-funcparam.jnlp: JNLP file for displaying applet in the HTML page * /tests/reproducers/simple/JSToJFuncParam/resources/JSToJFuncParam.html: the html page with java applet embedded, displayed in browser during the tests 2013-02-12 Jana Fabrikova * /tests/reproducers/simple/JSToJTypeConv/testcases/JSToJTypeConvTest.java: adding 50 testcases based on the interactive Liveconnect JS->Java type conversion tests and 4 testcases for setting java boolean and Boolean variables to nonempty strings * /tests/reproducers/simple/JSToJTypeConv/srcs/JSToJTypeConv.java: the applet whose variables are set from JS during the tests * /tests/reproducers/simple/JSToJTypeConv/resources/JSToJava_TypeConv.js: the JavaScript code for setting the applet variables from JS * /tests/reproducers/simple/JSToJTypeConv/resources/jstoj-typeconv.jnlp: JNLP file for displaying applet in the html page * /tests/reproducers/simple/JSToJTypeConv/resources/JSToJTypeConv.html: the html page with java applet embedded, displayed in browser during the tests 2013-02-07 Adam Domurad Ensure applet destruction cannot in the middle of initialization. * netx/net/sourceforge/jnlp/NetxPanel.java (destroyApplet): wait for applet initialization missing 2013-02-06 Jana Fabrikova * /tests/reproducers/simple/JSToJSet/testcases/JSToJSetTest.java: adding 1 testcase setting applets variable of type JSObject from JS, adding KnownToFail anotation and @Bug annotation with id=PR1298 to (AppletJSToJSet_intArrayElement_Test) and (AppletJSToJSet_DoubleArrayElement_Test) methods * /tests/reproducers/simple/JSToJSet/resources/JSToJava_Set.js: adding the JSObject case to (doSetTests) function * /tests/reproducers/simple/JSToJSet/srcs/JSToJSet.java: adding the JSObject variable to the applet and modifying (printNewValueAndFinish) method in order to output new values of JSObject variable 2013-02-06 Jana Fabrikova * /tests/reproducers/simple/JSToJGet/resources/JSToJGet.html: adding 1 testcase reading applets variable of type JSObject from JS * /tests/reproducers/simple/JSToJGet/testcases/JSToJGetTest.java: adding 1 testcase reading applets variable of type JSObject from JS, small changes to evaluation of the applet's stdout methods, removing KnownToFail anotation from (AppletJSToJGet_DoubleFullArray_Test) method * /tests/reproducers/simple/JSToJGet/resources/JSToJ_auxiliary.js: removing parts of comment that are no longer true * /tests/reproducers/simple/JSToJGet/resources/JSToJava_Get.js: adding (test_get_JSObject) function also to the JS part of test * /tests/reproducers/simple/JSToJGet/srcs/JSToJGet.java: adding the JSObject variable to the applet 2013-02-06 Adam Domurad Name threads for easier debugging/tooling. Remove 2 erroneous VoidPluginCallRequest header comments. * netx/net/sourceforge/jnlp/NetxPanel.java: Provide name for thread that calls (run). * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java: Provide name for shutdown hook thread. * plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java: Remove erroneous VoidPluginCallRequest comment. Provide name for ConsumerThread thread. * plugin/icedteanp/java/sun/applet/PluginMessageHandlerWorker.java: Provide name for worker thread. * plugin/icedteanp/java/sun/applet/PluginStreamHandler.java: Remove erroneous VoidPluginCallRequest comment. Provide name for stream listener thread. 2013-02-03 Jiri Vanek Another renamed conflict file for case insensitive systems * tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1E_x_2s.html Renamed to ParallelAppletsTest_1_x_2EE.html * tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1EE_x_2s.html new file. * tests/reproducers/simple/CountingApplet1/testcases/ParallelAppletsTest.java: (testParallelAppletsTest1Ex2s) adapted to renaming 2013-01-31 Jiri Vanek Renamed conflict file for case insensitive systems * tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_2E.html: Renamed to ParallelAppletsTest_1_x_2EE.html * tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_2EE.html: new file. * tests/reproducers/simple/CountingApplet1/testcases/ParallelAppletsTest.java: (testParallelAppletsTest1x2E) adapted to renaming 2013-01-30 Jiri Vanek Add unit tests for locales and locales fixed * netx/net/sourceforge/jnlp/resources/Messages.properties: * netx/net/sourceforge/jnlp/resources/Messages_cs_CZ.properties: Added missing, filled empty and removed dangling items * tests/netx/unit/net/sourceforge/jnlp/resources/MessagesPropertiesTest.java: New unittest for missing, empty, duplicate or dangling locales. 2013-01-30 Adam Domurad Fix for PR1292: Javaws does not resolve versioned jar names with periods correctly * netx/net/sourceforge/jnlp/cache/ResourceUrlCreator.java (getUrl): Fix versioning of jar names that have periods, eg 'foo.bar.jar'. Make method static for testing. * tests/netx/unit/net/sourceforge/jnlp/cache/ResourceUrlCreatorTest.java: New, test version & pack URL encoding. * tests/reproducers/simple/VersionedJar__V1/resources/VersionedJarDisabled.jnlp: New, tries to use versioned jar with versioning not turned on. * tests/reproducers/simple/VersionedJar__V1/resources/VersionedJarEnabled.jnlp: New, tries to use versioned jar with versioning turned on. * tests/reproducers/simple/VersionedJar__V1/srcs/VersionedJar.java: New, prints simple message. * tests/reproducers/simple/VersionedJar__V1/testcases/VersionedJarTest.java: New, tests if VersionedJar has ran only with versioning turned on. 2013-01-30 Jiri Vanek * netx/net/sourceforge/jnlp/splashscreen/parts/JEditorPaneBasedExceptionDialog.java: Iteration over launchExceptionChain done by pointer/get instead by iterator to prevent ConcurrentModificationException. 2013-01-30 Jiri Vanek Splashscreen error report made more detailed by stored LaunchErrors * netx/net/sourceforge/jnlp/LaunchException.java: (LaunchExceptionWithStamp) new inner class for storing timestamp togetehr with error. (launchExceptionChain) new static list to capture LaunchErrors during runtime. * /netx/net/sourceforge/jnlp/resources/Messages.properties: * netx/net/sourceforge/jnlp/resources/Messages_cs_CZ.properties: Added explanation string * netx/net/sourceforge/jnlp/splashscreen/parts/JEditorPaneBasedExceptionDialog.java: Is now displaying launchExceptionChain in its error report and is copying it to clipboard. * tests/unit/net/sourceforge/jnlp/splashscreen/parts/JEditorPaneBasedExceptionDialogTest.java: (getTextTest) adapted calls of getText for new Date. 2013-01-28 Adam Domurad Fix PR1157: Applets can hang browser after fatal exception * NEWS: Add entry for PR1157 * netx/net/sourceforge/jnlp/NetxPanel.java (runLoader): Move dispatchAppletEvent into a 'finally' block. 2013-01-16 Deepak Bhole PR1260: IcedTea-Web should not rely on GTK * Makefile.am: Remove GTK includes and links * acinclude.m4: Remove check for GTK libs * plugin/icedteanp/IcedTeaJavaRequestProcessor.h: Removed gtk.h include and added unistd include (for usleep) which gtk.h brought in before * plugin/icedteanp/IcedTeaNPPlugin.cc: Remove GTK dialog shown when java is not found * plugin/icedteanp/IcedTeaNPPlugin.h: Removed gtk.h include 2013-01-16 Jiri Vanek Fixed set of paths to asm * configure.ac: (IT_FIND_OPTIONAL_JAR([asm], ASM,) path enhanced by objectweb-asm4/asm-all.jar. 2013-01-15 Adam Domurad Unit test for PluginAppletSecurityContext#toObjectIDString. Make PluginAppletSecurityContext more unit-testable. * plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java: Don't initialize security manager in constructor. Fix a few Java->JS corner cases. * plugin/icedteanp/java/sun/applet/PluginMain.java: Create testing-only constructor for bypassing initialization of SecurityManager. * tests/netx/unit/sun/applet/PluginAppletSecurityContextTest.java: Unit test for all the corner cases of converting a Java object to a string that can be precisely identified. 2013-01-15 Adam Domurad Fix PR1198: JSObject passed incorrectly to Javascript * plugin/icedteanp/IcedTeaJavaRequestProcessor.cc: Pass extra data for 'jsobject' object result messages. * plugin/icedteanp/IcedTeaPluginRequestProcessor.cc: Same. * plugin/icedteanp/IcedTeaPluginUtils.cc: Add special casing of javascript references passed from java. * plugin/icedteanp/java/netscape/javascript/JSObjectUnboxPermission.java: New permission for unboxing a JSObject's internal reference. * plugin/icedteanp/java/netscape/javascript/JSObject.java (getInternalReference): New, package-private, retrieves internal reference (Must have proper permission). * plugin/icedteanp/java/netscape/javascript/JSUtil.java (getJSObjectInternalReference) New, utility for accessing JSObject#getInternalReference from outside the package. * plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java: (toObjectIDString): New, creates a string that precisely identifies a Java object. (handleMessage): Replace a lot of duplicated functionality with 'toObjectIDString'. * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java: Replace duplicated functionality with 'toObjectIDString'. * tests/reproducers/simple/JSObjectFromEval/srcs/JSObjectFromEval.java: Don't print out type passed (differs from browser to browser). * tests/reproducers/simple/JSObjectFromEval/testcases/JSObjectFromEvalTest.java: Don't check type passed (differs from browser to browser). Remove known-to-fail. Reformat. 2013-01-10 Jiri Vanek Download indicator made compact for more then one jar * NEWS: mentioned this feature * netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java: (DownloadPanel) inner class were rewritten to support collapsed/detailed for more then one jar in queue. (frame) window is recreated each time state is changed (preventing errors on some X configurations) and is positioned to lower left corner of active screen. * netx/net/sourceforge/jnlp/resources/hideDownloadDetails.png * adding netx/net/sourceforge/jnlp/resources/showDownloadDetails.pn h Icons for "to collapsed state" and "to detailed state" 2013-01-10 Jiri Vanek All IcedTea-Web dialogues are centered to middle of active screen * NEWS: mentioned this feature * netx/net/sourceforge/jnlp/JNLPSplashScreen.java: * netx/net/sourceforge/jnlp/controlpanel/AdvancedProxySettingsDialog.java: * netx/net/sourceforge/jnlp/controlpanel/CacheViewer.java: * netx/net/sourceforge/jnlp/security/SecurityDialog.java: * netx/net/sourceforge/jnlp/security/viewer/CertificateViewer.java: * netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/BasePainter.java: Dialogues in above classes made centering to active screen * netx/net/sourceforge/jnlp/util/ScreenFinder.java: New file, utility class which can find active monitor and center dialogue into it. 2013-01-09 Jiri Vanek First part of fix of recreating desktop icon * NEWS: mentioned PR725 * netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java: (addMenuAndDesktopEntries)added check for already existing icon * netx/net/sourceforge/jnlp/util/XDesktopEntry.java: Added methods for digging the already existing icon from system (getShortcutTmpFile) tmpfile fo generating the desktop icon (getDesktopIconName) for getting filename from application title (findFreedesktopOrgDesktopPathCatch) public method to find final desktop file (findFreedesktopOrgDesktopPath) to get into ~/.config/user-dirs.dirs (getFreedesktopOrgDesktopPathFrom) to find XDG_DESKTOP_DIR value (filterQuotes) to handle simple quotations (evaluateLinuxVariables) to handle possible variables in XDG_DESKTOP_DIR value * tests/netx/unit/net/sourceforge/jnlp/util/XDesktopEntryTest.java: New tests focused on parsing of desktop location from stream (variables and quotations) 2013-01-09 Jiri Vanek Logging methods made synchronized * tests/test-extensions/net/sourceforge/jnlp/LoggingBottleneck.java: (processLogs) (getDefaultLoggingBottleneck) (writeXmlLog) (addToXmlLog) (modifyMethodWithForBrowser) (setLoggedBrowser) (logIntoPlaintextLog) made synchronised 2013-01-07 Deepak Bhole * netx/net/sourceforge/jnlp/resources/Messages.properties: Converted to Unix format. 2013-01-04 Adam Domurad * plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java: Code-formatting fixes and cosmetic changes. * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java: Same. * tests/reproducers/simple/JSObjectFromEval/srcs/JSObjectFromEval.java: Same. * tests/reproducers/simple/JSObjectFromEval/testcases/JSObjectFromEvalTest.java: Same. 2013-01-03 Adam Domurad Fix breakage in unit test CodeBaseClassLoaderTest.testParentClassLoaderIsAskedForClassesApplication * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java (CodeBaseClassLoader#findClassNonRecursive): New, call into URLClassLoader#findClass (CodeBaseClassLoader#findClass): Delegate JNLPClassLoader#findClass (JNLPClassLoader#findClass): Call CodeBaseClassLoader#findClassNonRecursive * tests/reproducers/custom/AppletExtendsFromOutsideJar/srcs/AppletReferenceOutOfJar.java (init): Add applet finish message. * tests/reproducers/custom/AppletExtendsFromOutsideJar/testcases/AppletExtendsFromOutsideJarTests.java (testClassInAppletFolder): Close quickly on applet finish message. 2013-01-02 Jiri Vanek Fixed unittest for InformationElement. * tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/InformationElementTest.java: (createFromJNLP) now asserts NotNull instead of IsNull as result of "Minor fix for possible NPE (non fatal) during splashscreen creation" 2012-12-21 Adam Domurad * plugin/icedteanp/IcedTeaNPPlugin.cc: Remove need for 'goto' in (NP_Initialize). Check TMPDIR environment variable for possible data directory. Expose some previously static variables/functions for unit testing purposes. Reduce need for explicit allocations for strings 'data_directory' and 'appletviewer_executable'. * tests/cpp-unit-tests/IcedTeaNPPluginTest.cc: Add some basic tests for functions in IcedTeaNPPlugin.cc. 2012-12-21 Jiri Vanek * netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java (shouldCreateShortcut) added handling of xtrustall during asking for desktop icon creation 2012-12-21 Jiri Vanek Minor fix for possible NPE (non fatal) during splashscreen creation * netx/net/sourceforge/jnlp/resources/Messages.properties: * netx/net/sourceforge/jnlp/resources/Messages_cs_CZ.properties: Added messages for user (SPLASHdefaultHomepage) (SPLASHerrorInInformation)(SPLASHmissingInformation). * netx/net/sourceforge/jnlp/splashscreen/parts/InformationElement.java (createFromJNLP) catch of NPE replaced by conditions with proper messages. 2012-12-21 Jiri Vanek Forgotten condition for AviationWeather first run: * tests/reproducers/custom/remote/testcases/RemoteApplicationSettings.java: (AviationWeather) added condition for first run when creation of FileManager is written to stderr. 2012-12-20 Saad Mohammad * tests/netx/unit/net/sourceforge/jnlp/cache/ResourceTrackerTest.java: Added test and changes to work better with PR909 fix. 2012-12-20 Saad Mohammad Fix PR909 - URL is invalid after normalization. * netx/net/sourceforge/jnlp/cache/ResourceTracker.java (normalizeUrl): Converts the URL to an URI object which handles all percent encodings. 2012-12-20 Adam Domurad * plugin/icedteanp/IcedTeaScriptablePluginObject.cc (IcedTeaScriptableJavaObject::deAllocate): Fix memory leak (IcedTeaScriptableJavaPackageObject::deAllocate): Fix memory leak 2012-12-20 Adam Domurad * tests/cpp-unit-tests/browser_mock.cc (mock_retainobject): New, mocks behaviour of NPAPI retainobject (mock_releaseobject): New, mocks behaviour of NPAPI releaseobject * tests/cpp-unit-tests/main.cc: Add warning of memory leak based on operator-new. * tests/cpp-unit-tests/IcedTeaScriptablePluginObjectTest.cc: New, tests for memory leak in (IcedTeaScriptableJavaObject::deAllocate) and (IcedTeaScriptableJavaPackageObject::deAllocate) * tests/cpp-unit-tests/checked_allocations.h: Defines set that does not use operator-new, to prevent recursion in overloaded operator-new * tests/cpp-unit-tests/checked_allocations.cc: Operator new overload that has allocation-set for querying live allocations. 2012-12-20 Jiri Vanek Added and applied Remote annotation, added Remote tests: * tests/report-styles/jreport.xsl: and * tests/junit-runner/JunitLikeXmlOutputListener: and * tests/junit-runner/LessVerboseTextListener.java: added handling of Remote annotation * tests/netx/unit/net/sourceforge/jnlp/runtime/CodeBaseClassLoaderTest.java: Tests downloading from classpath.org marked. * tests/reproducers/custom/remote/testcases/RemoteApplicationSettings.java: new file, handling url and evaluations of remote reproducers * tests/reproducers/custom/remote/testcases/RemoteApplicationTests.java: launcher for remote tests. * tests/test-extensions/net/sourceforge/jnlp/annotations/Remote.java: Implementation of Remote annotation 2012-12-18 Jiri Vanek Cleaned unit-tests: * tests/netx/unit/net/sourceforge/jnlp/runtime/CodeBaseClassLoaderTest.java: (DummyJNLPFile) class extracted from its anonymous members to private named member. Get rid of repeated methods (testResourceLoad*Caching) and replace it by (testResourceCaching) with parameter of full name and boolean keeping its expected existence and branching null assert on it. Added tests (testClassResourceLoadSuccessCachingApplication) and (testClassResourceLoadSuccessCachingApplet). (testResourceCaching) made less vulnerable by found classes and more precise. All resources paths fixed and clarified (to be found or not) 2012-12-18 Jana Fabrikova * /tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java: Added several new versions of method (executeBrowser) with lists of ContentReaderListeners as arguments. * /tests/test-extensions/net/sourceforge/jnlp/ProcessWrapper.java: Added new versions of the (constructor of ProcessWrapper) and methods (addStdOutListeners) and (addStdErrListeners) for adding ContentReaderListeners using List instead of one ContentReaderListener as argument. Added a new version of (constructor of ProcessWrapper) with less arguments that is used instead of calling the constructor with several arguments passed as null, thus causing ambiguity. * /tests/reproducers/simple/SingeInstanceServiceTest/testcases/SingleInstanceTest.java: Modified the call of (executeBrowser) method with null arguments into a call of new method without the null arguments -getting rid of an ambiguous call. 2012-12-11 Jiri Vanek Added jacoco code coverage support * Makefile.am: (JACOCO_*) bunch of new variables encapsulating jacoco files. (PLUGIN_COVERAGE_BOOTCLASSPATH) classpath to be used in plugin instead of normal one in coverage mode. (COVERABLE_PLUGIN_DIR) for compiling plugin with agent on. (jacoco-operator-source-files.txt) for storing files of reporting tool. All XSLTPROC command were done as non-fatal (stamps/compile-jacoco-operator.stamp) for compiling report operator. (stamps/run-unit-test-code-coverage-jacoco.stam) for cover unittests Set of (COVERABLE_PLUGIN_*) targets to compile plugin with agent on. (stamps/build-fake-plugin.stamp) top level target for fake plugin. (stamps/run-reproducers-test-code-coverage-jacoco.stamp) target for cover reproducers. (run-test-code-coverage-jacoco) for merged coverage (clean-unit-test-code-coverage-jacoco) and (clean-reproducers-test-code-coverage-jacoco) and (clean-test-code-coverage-jacoco) and (clean-test-code-coverage-tools-jacoco) cleaning targets. (run-reproducers-test-code-coverage-jacoco) and (run-unit-test-code-coverage-jacoco) as top level aliases. * configure.ac: added check for jacoco library and asm library * plugin/icedteanp/IcedTeaNPPlugin.cc removed duplicate code (plugin_start_appletviewe) removed duplicated code and added handling of java agent if defined. * tests/jacoco-operator/org/jacoco/operator/Main.java : New class, comamndline tool for merging results and for generating reports. * tests/jacoco-operator/org/jacoco/operator/MergeTask.java: New class. Utility class responsible for merging exec results to one exec file. * tests/jacoco-operator/org/jacoco/operator/ReportGenerator: New class. Utility method for gathering sources and builds and outputing xml and html reports. 2012-12-11 Adam Domurad * plugin/icedteanp/java/sun/applet/PluginParameterParser.java: Remove left-in System.out 2012-12-10 Saad Mohammad Add unit tests for PR1189. * tests/netx/unit/net/sourceforge/jnlp/PluginParametersTest.java: (testConstructorWithNoCodeAndObjectParam): Initialize PluginParameters without code/object parameters. (testConstructorWithOnlyJnlpHrefParam): Initialize PluginParameters with jnlp_href but no code/object parameters. 2012-12-10 Saad Mohammad Add reproducer for PR1189. * tests/reproducers/simple/AppletTagWithMissingCodeAttribute/resources/AppletTagWithMissingCodeAttribute.html: Simple webpage which contains an applet tag with no code attribute. * tests/reproducers/simple/AppletTagWithMissingCodeAttribute/resources/AppletTagWithMissingCodeAttribute.jnlp: Jnlp file that is used by the webpages using jnlp_href. * tests/reproducers/simple/AppletTagWithMissingCodeAttribute/testcases/AppletTagWithMissingCodeAttribute.java: Testcase that tests applets without code attribute in html pages. * tests/reproducers/simple/SimpleApplet/srcs/SimpleApplet.java: Simple applet class that outputs a string. 2012-12-10 Saad Mohammad Fix PR1189: Icedtea-plugin requires code attribute when using jnlp_href. * netx/net/sourceforge/jnlp/PluginParameters.java (PluginParameters): Updated if condition to prevent PluginParameterException from being thrown if applet tag contains jnlp_href but is missing code/object parameters. 2012-12-06 Adam Domurad * Makefile.am: Fix targets stamps/netx-unit-tests-compile.stamp and stamps/run-netx-unit-tests.stamp to not rely on installed directory. 2012-12-05 Saad Mohammad Added new option in itw-settings which allows users to set JVM arguments when plugin is initialized. * netx/net/sourceforge/jnlp/config/Defaults.java (getDefaults): Added defaults for DeploymentConfiguration.KEY_PLUGIN_JVM_ARGUMENTS. * netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java: Added new property (KEY_PLUGIN_JVM_ARGUMENTS) which stores the value of JVM plugin arguments. * netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java: (createMainSettingsPanel): Added JVM settings to the list of tabs. (createJVMSettingsPanel): Returns a new JVMPanel object. * netx/net/sourceforge/jnlp/controlpanel/JVMPanel.java: JVM settings panel. * netx/net/sourceforge/jnlp/resources/Messages.properties: Added a new items (CPJVMPluginArguments, CPHeadJVMSettings, CPTabJVMSettings). * plugin/icedteanp/IcedTeaNPPlugin.cc: (plugin_start_appletviewer): Adds JVM arguments to the commands line list. (get_jvm_args): Returns JVM arguments set in itw-settings. * plugin/icedteanp/IcedTeaPluginUtils.cc: (IcedTeaPluginUtilities::vectorStringToVectorGchar): New helper method which returns a vector of gchar* from the vector of strings passed. * plugin/icedteanp/IcedTeaPluginUtils.h: Declaration of IcedTeaPluginUtilities::vectorStringToVectorGchar. 2012-12-05 Pavel Tisnovsky * Makefile.am: Avoid warning message printed in clean target if softkiller is not compiled. 2012-12-04 Adam Domurad * netx/net/sourceforge/jnlp/resources/Messages.properties: "An serious exception have occured" -> "A serious exception occurred" 2012-12-04 Adam Domurad PluginAppletViewer refactoring. * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java (handleInitializationMessage): New, extracts initialization logic from PluginAppletViewer.handleMessage. * plugin/icedteanp/java/sun/applet/PluginAppletPanelFactory.java: Moved into own file. 2012-12-04 Adam Domurad Remove the applet/embed/object tag parser from ITW. Send the applet parameters directly from the C++. * Makefile.am: Allow unit-testing for classes in plugin.jar. * netx/net/sourceforge/jnlp/NetxPanel.java: Use PluginParameters for attribute lookup * netx/net/sourceforge/jnlp/PluginBridge.java: Use PluginParameters for attribute lookup * netx/net/sourceforge/jnlp/resources/Messages.properties: Add message for missing code/object attributes. * netx/net/sourceforge/jnlp/resources/Messages_cs_CZ.properties: Same. * plugin/icedteanp/IcedTeaNPPlugin.cc: Send escaped parameter name/values instead of applet tag. Remove some dead code. * plugin/icedteanp/IcedTeaNPPlugin.h: Rename applet_tag -> parameters_string. * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java: Extract parsing code into its own class. * tests/cpp-unit-tests/IcedTeaPluginUtilsTest.cc: Use CHECK_EQUALS instead of CHECK. * tests/netx/unit/net/sourceforge/jnlp/PluginBridgeTest.java: Update unit tests due to constructor changes. * netx/net/sourceforge/jnlp/PluginParameterException.java: New, thrown when code/object attributes are missing. * netx/net/sourceforge/jnlp/PluginParameters.java: New, Hashtable wrapper that handles plugin attribute/parameter lookups. * plugin/icedteanp/java/sun/applet/PluginParameterParser.java: New, creates PluginParameters from escaped name/values. * tests/cpp-unit-tests/PluginParametersTest.cc: New, C++ Unit tests for plugin parameter related functions * tests/netx/unit/net/sourceforge/jnlp/PluginParametersTest.java: New, unit tests for PluginParameters class. * tests/netx/unit/sun/applet/PluginParameterParserTest.java: New, unit tests for PluginParameterParser class. 2012-11-03 Jiri Vanek Fixed logging bottleneck * tests/test-extensions/net/sourceforge/jnlp/LoggingBottleneck.java: added and used function (clearChars) which filter characters going to xml from invalid ones. * tests/test-extensions/net/sourceforge/jnlp/ServerAccess: getting test method id by (getTestMethod) now relay on physical way to the class as the only real thing differing test class and framework class. 2012-12-03 Pavel Tisnovsky * Makefile.am: Added new target for compiling softkiller. * tests/softkiller/softkiller.c: Added browser softkiller. * tests/softkiller/Makefile: Added makefile used to build and clean browser softkiller. * tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/Firefox.java: Uncommented code used to close windows. 2012-11-30 Adam Domurad Breaks up IcedTeaPluginUtilities::javaResultToNPVariant into multiple, more manageable parts. * plugin/icedteanp/IcedTeaPluginUtils.cc: Make three helper functions for the different cases. Two new helper functions for converting from std::string to NPString and NPVariant. * plugin/icedteanp/IcedTeaPluginUtils.h: Two new helper functions. * tests/cpp-unit-tests/IcedTeaPluginUtilsTest.cc: Tests for the new NPString and NPVariant from std::string functions. 2012-11-30 Adam Domurad Added a simple mechanism for mocking functions in the browser function table. Can be expanded as needed. * tests/cpp-unit-tests/main.cc: Call setup function, warn on browser function based memory leak. * tests/cpp-unit-tests/browser_mock.cc: New, implements simple error-checking mocks of browser callbacks. * tests/cpp-unit-tests/browser_mock.h: New, interface to mocking functions. 2012-11-27 Jiri Vanek Better error reporting from applets * netx/net/sourceforge/jnlp/NetxPanel.java: (init) ErrorSplash is shown if fatal exception is cough * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java: (replaceSpalsh) is rather removing all then just its previous version * tests/reproducers/simple/AppletTest/srcs/AppletErrorTest.java: * tests/reproducers/simple/AppletTest/resources/errorAppletAutoTests.html Testcase for manual testing of various exceptions from applet 2012-11-27 Jiri Vanek * AUTHORS: added Jan Kmetko as current SplashScreen artwork author 2012-11-27 Jiri Vanek Fixed epiphany switch * tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/Epiphany.java: -new-tab fixed to --new-tab 2012-11-23 Jiri Vanek Firefox session-backup and stubs for softkiller, multiple listeners, processes handling moved to separate class. * tests/reproducers/simple/AppletTest/testcases/AppletTestTests.java: Removed unwanted assert on termination * tests/test-extensions/net/sourceforge/jnlp/ContentReader.java: Added support for multiple listeners. * tests/test-extensions/net/sourceforge/jnlp/ProcessAssasin.java: (destroyProcess()), non static wrapper around former (destroyProcess (process)), introducing marks that process is being killed, added setter for reactigProcess. * tests/test-extensions/net/sourceforge/jnlp/ProcessWrapper.java: Wrapper around former ServerAccess.executeProcess set of methods. * tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java: all executeProcess/Javaws/Browser are now just api compatibility methods around ProcessWrapper. (executeProcess) main method moved to ProcessWrapper.execute. * tests/test-extensions/net/sourceforge/jnlp/ThreadedProcess.java: made public and synchronized with ProcessAssasin's (destroyProcess) * tests/test-extensions/net/sourceforge/jnlp/browsertesting/Browser.java is now implementing ReactingProcess * tests/test-extensions/net/sourceforge/jnlp/browsertesting/ReactingProcess.java: new interface for communication with main events of ThreadedProcess lifecycle. * tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/Firefox.java: is containing singleton of FirefoxProfilesOperator (FPO) and is responding to (beforeProcess) by FPO's (backupingProfiles), to (beforeKill) by calling ProcessAssasin's (closeWindows), and to (afterKill) by FPO's (restoreProfiles) * tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/firefox/FirefoxProfilesOperator.java: New class to backup and restore firefox profiles. 2012-11-21 Adam Domurad * Makefile.am: Fix new clean targets not cleaning properly 2012-11-21 Adam Domurad Support for C++ unit testing with UnitTest++ for IcedTeaWeb. * tests/cpp-unit-tests/IcedTeaPluginUtilsTest.cc: New, contains tests for utility functions. * tests/cpp-unit-tests/main.cc: New, contains unit test runner. * plugin/icedteanp/IcedTeaPluginUtils.h: Remove incorrect circular include dependency * plugin/icedteanp/IcedTeaRunnable.h: Add includes necessary for self-sustaining header. * Makefile.am: Add targets for unit test compilation and running, eg 'make run-cpp-unit-tests'. 2012-11-21 Adam Domurad Add the source code to UnitTest++ into the project. * tests/UnitTest++/COPYING: Part of UnitTest++ * tests/UnitTest++/Makefile: Part of UnitTest++ * tests/UnitTest++/README: Part of UnitTest++ * tests/UnitTest++/src/AssertException.cpp: Part of UnitTest++ * tests/UnitTest++/src/AssertException.h: Part of UnitTest++ * tests/UnitTest++/src/CheckMacros.h: Part of UnitTest++ * tests/UnitTest++/src/Checks.cpp: Part of UnitTest++ * tests/UnitTest++/src/Checks.h: Part of UnitTest++ * tests/UnitTest++/src/Config.h: Part of UnitTest++ * tests/UnitTest++/src/CurrentTest.cpp: Part of UnitTest++ * tests/UnitTest++/src/CurrentTest.h: Part of UnitTest++ * tests/UnitTest++/src/DeferredTestReporter.cpp: Part of UnitTest++ * tests/UnitTest++/src/DeferredTestReporter.h: Part of UnitTest++ * tests/UnitTest++/src/DeferredTestResult.cpp: Part of UnitTest++ * tests/UnitTest++/src/DeferredTestResult.h: Part of UnitTest++ * tests/UnitTest++/src/ExecuteTest.h: Part of UnitTest++ * tests/UnitTest++/src/MemoryOutStream.cpp: Part of UnitTest++ * tests/UnitTest++/src/MemoryOutStream.h: Part of UnitTest++ * tests/UnitTest++/src/Posix/SignalTranslator.cpp: Part of UnitTest++ * tests/UnitTest++/src/Posix/SignalTranslator.h: Part of UnitTest++ * tests/UnitTest++/src/Posix/TimeHelpers.cpp: Part of UnitTest++ * tests/UnitTest++/src/Posix/TimeHelpers.h: Part of UnitTest++ * tests/UnitTest++/src/ReportAssert.cpp: Part of UnitTest++ * tests/UnitTest++/src/ReportAssert.h: Part of UnitTest++ * tests/UnitTest++/src/Test.cpp: Part of UnitTest++ * tests/UnitTest++/src/Test.h: Part of UnitTest++ * tests/UnitTest++/src/TestDetails.cpp: Part of UnitTest++ * tests/UnitTest++/src/TestDetails.h: Part of UnitTest++ * tests/UnitTest++/src/TestList.cpp: Part of UnitTest++ * tests/UnitTest++/src/TestList.h: Part of UnitTest++ * tests/UnitTest++/src/TestMacros.h: Part of UnitTest++ * tests/UnitTest++/src/TestReporter.cpp: Part of UnitTest++ * tests/UnitTest++/src/TestReporter.h: Part of UnitTest++ * tests/UnitTest++/src/TestReporterStdout.cpp: Part of UnitTest++ * tests/UnitTest++/src/TestReporterStdout.h: Part of UnitTest++ * tests/UnitTest++/src/TestResults.cpp: Part of UnitTest++ * tests/UnitTest++/src/TestResults.h: Part of UnitTest++ * tests/UnitTest++/src/TestRunner.cpp: Part of UnitTest++ * tests/UnitTest++/src/TestRunner.h: Part of UnitTest++ * tests/UnitTest++/src/TestSuite.h: Part of UnitTest++ * tests/UnitTest++/src/TimeConstraint.cpp: Part of UnitTest++ * tests/UnitTest++/src/TimeConstraint.h: Part of UnitTest++ * tests/UnitTest++/src/TimeHelpers.h: Part of UnitTest++ * tests/UnitTest++/src/UnitTest++.h: Part of UnitTest++ * tests/UnitTest++/src/XmlTestReporter.cpp: Part of UnitTest++ * tests/UnitTest++/src/XmlTestReporter.h: Part of UnitTest++ 2012-11-21 Adam Domurad * plugin/icedteanp/IcedTeaNPPlugin.cc (consume_plugin_message): Free two buffers returned from NPN_GetValueForURL function. 2012-11-20 Jiri Vanek * Makefile.am: (stamps/run-netx-dist-tests.stamp) and (stamps/run-netx-unit-tests.stamp) Swapped logs and report xslt operations 2012-11-20 Jana Fabrikova * tests/reproducers/simple/JSToJGet/testcases/JSToJGetTest.java: added @KnownToFail annotations to the tests, which are showing unimplemented/broken features of js-plugin communication. 2012-11-13 Adam Domurad Reproducer for PR1198, JSObject#eval creates invalid JS object. * tests/reproducers/simple/JSObjectFromEval/resources/JSObjectFromEval.html: Loads applet + JS for test * tests/reproducers/simple/JSObjectFromEval/resources/JSObjectFromEval.js: Calls java code to test JSObject#eval * tests/reproducers/simple/JSObjectFromEval/srcs/JSObjectFromEval.java: Provides java<->JS wrappers for JSObject methods * tests/reproducers/simple/JSObjectFromEval/testcases/JSObjectFromEvalTest.java: Tests if JSObject#eval creates valid JSObject. 2012-11-13 Saad Mohammad Fix PR1166: Embedded JNLP File is not supported in applet tag. * configure.ac: Checks for sun.misc.BASE64Decoder. * NEWS: Added entry for PR1166. * netx/net/sourceforge/jnlp/JNLPFile.java (JNLPFile): New constructor which accepts inputstream of jnlp file and a specified codebase. * netx/net/sourceforge/jnlp/Parser.java (Parser): If parsing of codebase fails, it will overwrite the codebase with the one passed in through parameters. * netx/net/sourceforge/jnlp/PluginBridge.java: (PluginBridge) Supports embedded jnlp file. (decodeBase64String) Decodes Base64 strings to byte array. 2012-11-13 Saad Mohammad Added unit tests for PR1166. * tests/netx/unit/net/sourceforge/jnlp/JNLPFileTest.java: Tests the JNLPFile constructor that accepts an InputStream and an alternative codebase. * tests/netx/unit/net/sourceforge/jnlp/ParserTest.java: Tests if the constructor handles the alternative codebase parameter correctly. * tests/netx/unit/net/sourceforge/jnlp/PluginBridgeTest.java: Tests if BASE64 strings are decoded correctly and if PluginBridge is constructed with an embedded jnlp. 2012-11-13 Saad Mohammad Added reproducer for PR1166. * tests/reproducers/simple/EmbeddedJnlpInApplet/resources/EmbeddedJnlp.jnlp: Launching jnlp file that is used by jnlp_href in applet tag * tests/reproducers/simple/EmbeddedJnlpInApplet/resources/EmbeddedJnlpInAppletNoCodebase.html: Applet with an embedded jnlp file with no codebase specified * tests/reproducers/simple/EmbeddedJnlpInApplet/resources/EmbeddedJnlpInAppletWithDotCodebase.html: Applet with an embedded jnlp file with codebase set as a 'dot' * tests/reproducers/simple/EmbeddedJnlpInApplet/resources/JnlpInApplet.html: Applet with jnlp_href file. * tests/reproducers/simple/EmbeddedJnlpInApplet/srcs/EmbeddedJnlp.java: Simple class that outputs strings. * tests/reproducers/simple/EmbeddedJnlpInApplet/testcases/EmbeddedJnlpInAppletTest.java: Testcase that tests embedded jnlps in html pages. 2012-11-08 Saad Mohammad * NEWS: Added entry for PR1027 - DownloadService is not supported by IcedTea-Web. 2012-11-08 Saad Mohammad Added reproducer for DownloadService. * tests/reproducers/signed/DownloadService/resources/DownloadService.jnlp: Launching jnlp file that contains extension jnlp and jars marked with part names. * tests/reproducers/signed/DownloadService/resources/DownloadServiceExtension.jnlp: DownloadService extension jnlp file with jars marked with part names. * tests/reproducers/signed/DownloadService/srcs/DownloadServiceRunner.java: A simple class that uses DownloadService to complete tasks and outputs the results. * tests/reproducers/signed/DownloadService/testcases/DownloadServiceTest.java: Testcase for DownloadService. 2012-11-08 Saad Mohammad Core implementation of DownloadService. * netx/net/sourceforge/jnlp/cache/CacheUtil.java (getCacheParentDirectory): Returns the parent directory of the cached resource. * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: (getLoaders): Returns all loaders that this loader uses, including itself (addNewJar): Adds a new jar to the classloader with specified UpdatePolicy. (removeJars): Remove jars from the filesystem. (initializeNewJarDownload): Downloads and initializes jars into the current loader. (manageExternalJars): Manages jars which are not mentioned in the JNLP file. * netx/net/sourceforge/jnlp/runtime/LocateJnlpClassLoader.java: (getLoaderByJnlpFile): Returns the classloader of the jnlp file specified. (getLoaderByResourceUrl): Returns the classloader that contains the specified jar. * netx/net/sourceforge/jnlp/runtime/ManageJnlpResources.java: (findJars): Returns jars from the JNLP file with the specified partname. (removeCachedJars): Removes jar from cache. (downloadJars): Downloads jars identified by part name. (loadExternalResouceToCache): Download and initalize resources which are not mentioned in the jnlp file. (removeExternalCachedResource): Removes resources from cache which are not mentioned in the jnlp file. (isExternalResourceCached): Determines if the resource that is not mentioned in the jnlp file is cached and returns a boolean with the result. * netx/net/sourceforge/jnlp/services/XDownloadService.java: Core implementation of DownloadService. 2012-11-02 Jiri Vanek Alexandr Kolouch Added cz_CS locales with test * AUTHORS: added translator, mr. Kolouch * NEWS: mentioned localization * netx/net/sourceforge/jnlp/resources/Messages_cs_CZ.properties: file itself with translation * tests/reproducers/simple/LocalesTest/testcases/LocalesTestTest.java: Test which is testing whether and how locales are applied. 2012-11-02 Jiri Vanek Splashscreen integrated to javaws and plugin * Makefile.am: (edit_launcher_script) added JAVAWS_SPLASH_LOCATION substitution for installed javaws_splash.png. (install-exec-loca) added installation of javaws_splash.png. * NEWS: mentioned splashscreen * launcher/javaws.in: added SPLASH_LOCATION, as path to image with "java" splash which s then shown until internal vector one appear. * netx/net/sourceforge/jnlp/GuiLaunchHandler.java: splashScreen made volatile, (launchInitialized) splashscreen is created and shown * netx/net/sourceforge/jnlp/JNLPSplashScreen.java: (setSplashImageURL) splash bg image is loaded from given url or default is used if not found or not specified by jnlp/applet. (correctSize) width is calculated from bg image or default is used when no image set. Splash is centered to primary monitor. * netx/net/sourceforge/jnlp/Launcher.java: (launchApplet) and (launchApplication) enriched by handling of splashs. (launchError) overloaded and is now handling forwarding of errors to splash. All relevant calls of launchError enriched by appletInstance. * netx/net/sourceforge/jnlp/NetxPanel.java: is now implementing SplashController.This is done by setting and wrapping of splashController variable. * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java: is now handling splashscreen for applets in browsers. (framePanel) is now providing panel to be processed (PluginAppletViewer) is now invoking SplashCreator. (replaceSplash) new method which replace splashscreen with error splashscreen. (removeSplash) new method to remove splash when loading is done. (update) is added to call paint directly (SplashCreator) new internal runnable to create splash * tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_2.html: second jar made XslowX to track two FIXME introduced in this patch - Launcher's createApplet and PluginAppletViewer's framePanel. * netx/javaws_splash.png: Binary image to be shown before java is launched * tests/reproducers/simple/simpletest1/resources/netxPlugin.png: Binary image to ne used for testing custom splashscreens 2012-10-31 Jana Fabrikova * tests/reproducers/simple/JSToJGet/testcases/JSToJGetTest.java: Modifying the testcase output to a simpler text. * tests/reproducers/simple/JSToJSet/testcases/JSToJSetTest.java: Modifying the testcase output to a simpler text. 2012-10-29 Omair Majid * tests/reproducers/signed/DeploymentPropertiesAreExposed/resources/DeploymentPropertiesAreExposed.jnlp, * tests/reproducers/signed/DeploymentPropertiesAreExposed/srcs/Test.java, * tests/reproducers/signed/DeploymentPropertiesAreExposed/testcases/DeploymentPropertiesAreExposedTest.java: New files. 2012-10-29 Omair Majid PR1186 * netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java: (load(boolean)): Delegate to load(File,File,boolean). (load(File,File,boolean)): New method. (copyTo): New method. * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java: (initialize): Copy configuration to system properties. * tests/netx/unit/net/sourceforge/jnlp/config/DeploymentConfigurationTest.java: New File. 2012-10-29 Jana Fabrikova * tests/reproducers/simple/JSToJSet Added reproducer for testing LiveConnect - setting Java members from JavaScript side 2012-10-26 Jiri Vanek Added clipboard reproducers (PR708) * tests/reproducers/signed/ClipboardContentSigned/resources/ClipboardContentSignedCopy1.jnlp: Jnlp to invoke manual copying to clipboard on signed app, please note the delayed death of application * tests/reproducers/signed/ClipboardContentSigned/resources/ClipboardContentSignedCopy2.jnlp: Jnlp to invoke jtextfield like copying signed app, please note the delayed death of application * tests/reproducers/signed/ClipboardContentSigned/resources/ClipboardContentSignedPaste1.jnlp: Jnlp to invoke manual pasting on signed application * tests/reproducers/signed/ClipboardContentSigned/resources/ClipboardContentSignedPaste2.jnlp: Jnlp to invoke jtextfield like pasting on signed application * tests/reproducers/signed/ClipboardContentSigned/srcs/ClipboardContentSigned.java: Application which is trying to access clipboard by various ways. * tests/reproducers/signed/ClipboardContentSigned/testcases/ClipboardContentSignedTests.java: Automated tests for four above jnlps. * tests/reproducers/simple/ClipboardContent/resources/ClipboardContentCopy1.jnlp: Jnlp to invoke manual copying to clipboard on unsigned app, please note the delayed death of application * tests/reproducers/simple/ClipboardContent/resources/ClipboardContentCopy2.jnlp: Jnlp to invoke jtextfield like copying unsigned app, please note the delayed death of application * tests/reproducers/simple/ClipboardContent/resources/ClipboardContentPaste1.jnlp: Jnlp to invoke manual pasting on unsigned application * tests/reproducers/simple/ClipboardContent/resources/ClipboardContentPaste2.jnlp: Jnlp to invoke jtextfield like pasting on unsigned application * tests/reproducers/simple/ClipboardContent/srcs/ClipboardContent.java: Application which is trying to access clipboard by various ways. * tests/reproducers/simple/ClipboardContent/testcases/ClipboardContentTests.java: Automated tests for first and third of above four jnlps. The tests of second and fourth is disabled due to necessary manual interaction * tests/test-extensions/net/sourceforge/jnlp/tools/WaitingForStringProcess.java: Utility class for process waiting for some string for another string * tests/test-extensions/net/sourceforge/jnlp/tools/ClipboardHelpers.java Utility class for copying/pasting text to/from clipboard * tests/test-extensions/net/sourceforge/jnlp/tools/AsyncJavaws.java Utility class for launching javaws in separate thread. 2012-10-23 Jiri Vanek KnownToFail texts are now bold in html report * tests/report-styles/jreport.xsl: all text outputs of test="@known-to-fail=true" conditions are marked with . 2012-10-19 Adam Domurad * tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/testcases/AdditionalJarsInMetaInfIndexListTests.java (SignedMetaInfIndexListTest): Add @KnownToFail annotation 2012-10-19 Jiri Vanek Renamed reproducers-related variables and targets * Makefile.am: NETX_TEST_DIR - new parent directory variable for tests NETX_UNIT_TEST_DIR - is now using this variable JNLP_TESTS_ENGINE_SRCDIR -> TEST_EXTENSIONS_SRCDIR JNLP_TESTS_ENGINE_TESTS_SRCDIR -> TEST_EXTENSIONS_TESTS_SRCDIR JNLP_TESTS_SRCDIR -> REPRODUCERS_TESTS_SRCDIR JNLP_TESTS_ENGINE_DIR -> TEST_EXTENSIONS_DIR JNLP_TESTS_ENGINE_TESTS_DIR -> TEST_EXTENSIONS_TESTS_DIR new variable TEST_EXTENSIONS_COMPATIBILITY_SYMLINK still pointing to $(TESTS_DIR)/netx/jnlp_testsengine $(TESTS_DIR)/jnlp_testsengine now points to $(TESTS_DIR)/test-extensions JNLP_TESTS_SERVER_DEPLOYDIR -> REPRODUCERS_TESTS_SERVER_DEPLOYDIR JNLP_TESTS_DIR -> REPRODUCERS_BUILD_DIR netx-dist-tests-source-files.txt -> test-extensions-source-files.txt stamps/netx-dist-tests-compile.stamp -> stamps/test-extensions-compile.stamp stamps/netx-dist-tests-tests-compile.stamp -> stamps/test-extensions-tests-compile.stamp stamps/netx-dist-tests-compile-testcases.stamp -> stamps/compile-reproducers-testcases.stamp stamps/netx-dist-tests-copy-resources.stamp -> stamps/copy-reproducers-resources.stamp * tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/srcs/Makefile: and * tests/reproducers/custom/AppletExtendsFromOutsideJar/srcs/Makefile: and * tests/reproducers/custom/AppletFolderInArchiveTag/srcs/Makefile: and * tests/reproducers/custom/UnsignedContentInMETAINF/srcs/Makefile: following above renaming 2012-10-19 Adam Domurad Revised multiple signatures test to check for new message. Added more accurate reproducer for PR822. * tests/reproducers/signed2/MultipleSignaturesTest/srcs/somecrazytestpackage/MultipleSignaturesTest.java: Made class take a classname parameter so different out-of-package classes could be executed. * tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest.html: Added main-class parameter. * tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest1.jnlp: Same. * tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest1_requesting.jnlp: Same. * tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest2.jnlp: Same. * tests/reproducers/signed2/MultipleSignaturesTest/testcases/MultipleSignaturesTestTests.java (multipleSignaturesTestHtmlAppletUsesPermissions): New, tests if fully signed HTML applets with varied signers can (as they should) execute with full permissions. Reproduces PR822. (multipleSignaturesTestJnlpApplicationRequesting): Check for mismatching signers JNLP failure message. Remove known-to-fail & inaccurate bug annotation. * tests/reproducers/signed2/MultipleSignaturesTestSamePackage/testcases/MultipleSignaturesTestTestsSamePackage.java (multipleSignaturesTestSamePackageJnlpApplicationRequesting): Check for mismatching signers JNLP failure message. Remove known-to-fail & inaccurate bug annotation. 2012-10-19 Adam Domurad Reproduces PR822: Applets fail to load if jars have different signers. Tests for applets & JNLPs with multiple signers per jar. * tests/reproducers/signed/ReadPropertiesSigned/srcs/ReadPropertiesSigned.java: Modified to end with standard applet finish message. * tests/reproducers/simple/ReadProperties/srcs/ReadProperties.java: * tests/reproducers/custom/MultipleSignaturesPerJar/README: Explains dependence on ReadPropertiesSigned. * tests/reproducers/custom/MultipleSignaturesPerJar/resources/MultipleSignaturesPerJarMatching.html: HTML applet test with a common signer. * tests/reproducers/custom/MultipleSignaturesPerJar/resources/MultipleSignaturesPerJarMatching.jnlp: JNLP test with a common signer. * tests/reproducers/custom/MultipleSignaturesPerJar/resources/MultipleSignaturesPerJarMismatching.html: HTML applet test without a common signer. * tests/reproducers/custom/MultipleSignaturesPerJar/resources/MultipleSignaturesPerJarMismatching.jnlp: JNLP test without a common signer. * tests/reproducers/custom/MultipleSignaturesPerJar/srcs/Makefile: Custom makefile used to sign a jar with multiple signers. * tests/reproducers/custom/MultipleSignaturesPerJar/srcs/somecrazytestpackage/MultipleSignaturesPerJarMain.java: Accesses ReadPropertiesSigned from another package with different signers. * tests/reproducers/custom/MultipleSignaturesPerJar/testcases/MultipleSignaturesPerJarTests.java: Test driver. 2012-10-19 Adam Domurad New message for signer mismatch in JNLP applications. * netx/net/sourceforge/jnlp/resources/Messages.properties: Added message 'The JNLP application is not fully signed by a single cert.' * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: Message thrown when JNLP's jcv.allJarsSigned() is true but not jcv.isFullySigned(); 2012-10-19 Adam Domurad Fixes JCV#isTriviallySigned(). Reproducer 'EmptySignedJar' passes again. * netx/net/sourceforge/jnlp/tools/JarCertVerifier.java: Remove problematic 'triviallySigned' variable and instead determine whether triviallySigned on the fly. Consider jars with 0 signable entries as SIGNED_OK. * tests/netx/unit/net/sourceforge/jnlp/tools/JarCertVerifierTest.java: Update no-signers unit test. 2012-10-19 Adam Domurad * netx/net/sourceforge/jnlp/security/AppVerifier.java: Use interface types for declared types where applicable. * netx/net/sourceforge/jnlp/security/PluginAppVerifier.java: Same. * netx/net/sourceforge/jnlp/tools/JarCertVerifier.java: Same. 2012-10-19 Adam Domurad * netx/net/sourceforge/jnlp/security/AppVerifier.java: Use interface types for declared types where applicable. * netx/net/sourceforge/jnlp/security/PluginAppVerifier.java: Same. * netx/net/sourceforge/jnlp/tools/JarCertVerifier.java: Same. 2012-10-19 Danesh Dadachanji Rework JarCertVerifier certificate management to handle multiple certificates and use different algorithms to verify JNLPs and Applets. * netx/net/sourceforge/jnlp/resources/Messages.properties: Removed SHasUnsignedEntry. * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: Set JCV instance to final but uninitialized. (JNLPClassLoader): Initialized JCV with runtime dependent verifier. (addNewJar), (initializeResources), (verifySignedJNLP): Replaced use of local JarCertVerifier variable with the instance variable. Added calls to isFullySigned wherever signer verification is done. (activateJars): No longer verifies nested jars. These receive the same security permissions as their parent jar, regardless of the nested jar's signing. (checkTrustWithUser): Removed JCV param, reimplemented to wrap around JCV's checkTrustWithUser method. (verifyJars): Removed. * netx/net/sourceforge/jnlp/security/AppVerifier.java: New strategy pattern interface that specifies verification methods required regardless of the runtime. * netx/net/sourceforge/jnlp/security/JNLPAppVerifier.java: * netx/net/sourceforge/jnlp/security/PluginAppVerifier.java: New strategy pattern classes used to determine which algorithms to use depending on the runtime. * netx/net/sourceforge/jnlp/security/CertVerifier.java: Added CertPath param to all the methods. (noSigningIssues): Removed. * netx/net/sourceforge/jnlp/security/CertWarningPane.java: * netx/net/sourceforge/jnlp/security/CertsInfoPane.java: * netx/net/sourceforge/jnlp/security/MoreInfoPane.java: Updated calls to the verifier's methods with the new CertPath param. All are set to null so far. * netx/net/sourceforge/jnlp/security/HttpsCertVerifier.java: Added CertPath param to all the methods. It's mostly ignored though. * netx/net/sourceforge/jnlp/tools/CertInformation.java: New class to represent all the information about a signer with with respect to all of the entries it has signed for the app. * netx/net/sourceforge/jnlp/tools/JarCertVerifier.java: Completely reworked to use CertInformation and AppVerifier functionality. (getCertPath), (getCertInformation), (checkTrustWithUser), (getJarSignableEntries), (getTotalJarEntries): New method. (noSigningIssues), (anyJarsSigned): Removed. (verifyResult): Renamed enum to VerifyResult (JarCertVerifier): New constructor used to set AppVerifier instance. (getAlreadyTrustPublisher), (getRootInCacerts): Now uses strategy pattern. (hasSigningIssues), (getDetails), (checkTrustedCerts), (checkCertUsage): Now uses cert info class. (getCerts): Renamed to getCertsList. (isFullySignedByASingleCert): renamed to isFullySigned and to use the strategy pattern. (add): New public method that resets some instance vars and calls verifyJars. (verifyJars): Modifier changed to private, above method should be used. Also skips jars that have been verified before. (verifyJar): Removed actual verification code, only reads jars into the JVM. (verifyJarEntryCerts): New method. Does actual verification of jars. (getPublisher), (getRoot): Use hacky currentlyUsed variable as the signer. * tests/netx/unit/net/sourceforge/jnlp/tools/JarCertVerifierTest.java: Unit test JCV's verifyJarEntryCerts method. * tests/test-extensions/net/sourceforge/jnlp/tools/CodeSignerCreator.java: Unit test helper that creates CodeSigner instances. 2012-10-16 Adam Domurad * tests/reproducers/simple/AppletTakesLastParam/srcs/AppletTakesLastParam.java: Add 'standard' applet closing message. * tests/reproducers/simple/AppletTakesLastParam/testcases/AppletTakesLastParamTests.java: Clean-up code and add automatic applet closing on finish. 2012-10-15 Jana Fabrikova * tests/reproducers/simple/JSToJGet/testcases/JSToJGetTest.java: Modified the testcases - more readable method calls. 2012-10-05 Omair Majid PR1145 * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java (getAccessControlContextForClassLoading): Do not catch ClassCircularityError. (findLoadedClassAll): Call findLoadedClass without any special permissions. 2012-10-03 Jana Fabrikova * tests/reproducers/simple/JSToJGet: Added a new reproducer for the first LiveConnect test - getting members from Java side. 2012-10-02 Martin Olsson * plugin/icedteanp/IcedTeaNPPlugin.cc: Typo fix. * plugin/icedteanp/IcedTeaPluginRequestProcessor.cc: Typo fix. 2012-09-26 Jana Fabrikova * tests/test-extensions/net/sourceforge/jnlp/closinglisteners/StringMatchClosingListener.java: Added forgotten package name. 2012-09-25 Jiri Vanek Added rules listeners * tests/test-extensions/net/sourceforge/jnlp/closinglisteners/CountingClosingListener.java: Base class for closing listeners which is containing complete output in each time. * tests/test-extensions/net/sourceforge/jnlp/closinglisteners/Rule.java: Class with rule definition for RulesFolowingClosingListener * tests/test-extensions/net/sourceforge/jnlp/closinglisteners/RulesFolowingClosingListener.java: ClosingListener consisted from rules which all have to match for close action * tests/test-extensions/net/sourceforge/jnlp/closinglisteners/StringRule.java: Implementation of rule based on string * tests/reproducers/signed/AppletTestSigned/testcases/AppletTestSignedTests.java: * tests/reproducers/simple/AppletTest/testcases/AppletTestTests.java: Refactored to use Above iisteners. 2012-09-24 Jiri Vanek Added basic closing listener implementation * tests/reproducers/signed/AppletTestSigned/resources/AppletTestSigned.html: removed unnecessary XslowX * tests/reproducers/signed/AppletTestSigned/resources/AppletTestSigned2.html: added missing XslowX * tests/reproducers/signed/AppletTestSigned/srcs/AppletTestSigned.java: added standard closing sentence * tests/reproducers/signed/AppletTestSigned/testcases/AppletTestSignedTests.java: used auto*closing listeners * tests/test-extensions/net/sourceforge/jnlp/ClosingListener.java: interface for identifying closing listeners * tests/test-extensions/net/sourceforge/jnlp/ProcessAssasin.java: added possibility to set timeout n the fly * tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java: (executeBrowser) added shortcut for autoclosing listeners, (setUpClosingListener) method for setting properties of ClosingListener (executeBrowser) add logic to handle ClosingListeners * tests/test-extensions/net/sourceforge/jnlp/closinglisteners/AutoAllClosingListener.java: listener closing on "APPLET FINISHED" string * tests/test-extensions/net/sourceforge/jnlp/closinglisteners/AutoErrorClosingListener.java: listener closing on "xception" match * tests/test-extensions/net/sourceforge/jnlp/closinglisteners/AutoOkClosingListener.java: listener closing on both xception and finished string. * tests/test-extensions/net/sourceforge/jnlp/closinglisteners/StringBasedClosingListener.java: Base forefather for Auto*ClosingListener 2012-09-24 Jiri Vanek Jana Fabrikova Reproducers are now correctly compiled against liveconect(plugin.jar) * Makefile.am: (stamps/netx-dist-tests-prepare-reproducers.stamp) added one more dependency: stamps/liveconnect-dist.stamp added one more directory on cp: $(abs_top_builddir)/liveconnect 2012-09-17 Deepak Bhole PR1161: X509VariableTrustManager does not work correctly with OpenJDK7 * Makefile.am: If building with JDK 6, don't build VariableX509TrustManagerJDK7. * NEWS: Updated. * acinclude.m4: In addition to setting VERSION_DEFS, also set HAVE_JAVA7 if building with JDK7. * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java (initialize): Use new getSSLSocketTrustManager() method to get the trust manager. (getSSLSocketTrustManager): New method. Depending on runtime JRE version, returns the appropriate trust manager. * netx/net/sourceforge/jnlp/security/HttpsCertVerifier.java: Removed unused tm variable. * netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java: No longer extends com.sun.net.ssl.internal.ssl.X509ExtendedTrustManager. (checkClientTrusted): Renamed to checkTrustClient and removed overloaded implementations. (checkServerTrusted): Renamed to checkTrustServer. Also, modified to accept socket and engine (may be null). Assume that CN is mismatched by default, rather than matched. If explicitly trusted, bypass other checks, including CN mismatch. (checkAllManagers): Modified to accept socket and engine. Modified to work for both JDK6 and JDK7. (getAcceptedIssuers): Make protected (called by others in package). * netx/net/sourceforge/jnlp/security/VariableX509TrustManagerJDK6.java: New class -- X509TrustManager for JDK6. * netx/net/sourceforge/jnlp/security/VariableX509TrustManagerJDK7.java: New class -- X509TrustManager for JDK7. 2012-09-07 Saad Mohammad Added signed jnlp tests for applications with multiple jar resources. * tests/reproducers/signed/MultiJar-NoSignedJnlp/resources/MainJarWithoutSignedJnlp.jnlp: Launching jnlp file that's main jar does not have a signed jnlp file, but other jar resources do. * tests/reproducers/signed/MultiJar-NoSignedJnlp/srcs/SimpleApplication.java: A class that uses reflection to access resources from different jars. * tests/reproducers/signed/MultiJar-SignedJnlpApplication/resources/MainJarWithMatchingSignedJnlpApplication.jnlp: Launching jnlp file that's main jar matches the signed jnlp application file. * tests/reproducers/signed/MultiJar-SignedJnlpApplication/resources/MainJarWithUnmatchingSignedJnlpApplication.jnlp: Launching jnlp file that's main jar does not match the signed jnlp application file. * tests/reproducers/signed/MultiJar-SignedJnlpApplication/srcs/JNLP-INF/APPLICATION.jnlp: Signed JNLP application file for MultiJar-SignedJnlpApplication. * tests/reproducers/signed/MultiJar-SignedJnlpApplication/srcs/SignedJnlpApplication.java: A class that uses reflection to access resources from different jars. * tests/reproducers/signed/MultiJar-SignedJnlpApplication/testcases/MultiJarSignedJnlpTest.java: Testcase that tests the launch and validation of signed jnlp files for application that have multiple jar resources. * tests/reproducers/signed/MultiJar-SignedJnlpTemplate/resources/MainJarWithMatchingSignedJnlpTemplate.jnlp: Launching jnlp file that's main jar matches the signed jnlp application template file. * tests/reproducers/signed/MultiJar-SignedJnlpTemplate/resources/MainJarWithUnmatchingSignedJnlpTemplate.jnlp: Launching jnlp file that's main jar does not match the signed jnlp application template file. * tests/reproducers/signed/MultiJar-SignedJnlpTemplate/srcs/JNLP-INF/APPLICATION_TEMPLATE.jnlp: Signed JNLP application template file for MultiJar-SignedJnlpTemplate.jar * tests/reproducers/signed/MultiJar-SignedJnlpTemplate/srcs/SignedJnlpTemplate.java: A class that uses reflection to access resources from different jars. 2012-09-07 Jiri Vanek Added strict test * tests/reproducers/simple/simpletest1/testcases/SimpleTest1Test.java: Removed deprecated ServerAccess.ProcessResult (testSimpletest1lunchOk) extracted asserting code (checkLaunched) family of methods to evaluate output of application (createStrictFile) method to prepare file which will pass strict checking (testSimpletest1lunchOkStrictJnlp) new test, ensuring that even strict file can be read without strict option (testSimpletest1lunchNotOkJnlpStrict) new test ensuring that strictly read no-strict file will fail (testSimpletest1lunchOkStrictJnlpStrict) new test ensuring that strictly read strict file will pass 2012-09-06 Jiri Vanek Fixing several typos from previous push * tests/test-extensions/net/sourceforge/jnlp/ServerLauncher.java: (getUrlUponThisInstance) Javadoc, replaced Ctreate with Create. * tests/test-extensions/net/sourceforge/jnlp/TinyHttpdImpl.java: (run) Fixed indentation. * tests/reproducers/simple/ParametrizedJarUrl/testcases/ParametrizedJarUrlTests.java: Refactored createCodeBAse to createCodeBase. 2012-09-05 Jiri Vanek Fixing several errors which were causing incorrect behaviour causing correct reproduction of PR905 * tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarUrlSigned.htm Using different jar for reproducing * tests/reproducers/simple/ParametrizedJarUrl/testcases/ParametrizedJarUrlTests.java Added tests for hardcoded codebase (same and different) enhanced original PR905 reproducers * tests/test-extensions/net/sourceforge/jnlp/LoggingBottleneck.java: added flush for logs * tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java: cleaned and enhanced getUrl* methods. * tests/test-extensions/net/sourceforge/jnlp/ServerLauncher.java: delegated socket * tests/test-extensions/net/sourceforge/jnlp/TinyHttpdImpl.java: fixed processing of question mark. 2012-09-05 Jiri Vanek * tests/reproducers/signed/CountingAppletSigned/srcs/CountingAppletSigned.java: Signed applet painting to canvas and periodically printing out counted messages * tests/reproducers/signed2/AppletTestSigned2/srcs/AppletTestSigned2: Second simple signed applet for testing two different simple ones parallel * tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1E_x_2s.html: * tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_1.html: * tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_2.html: * tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_2E.html: * tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_2e.html: * tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_2sk.html: * tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1e_x_2s.html: * tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1k_x_2.html: * tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1s_x_2.html: * tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1s_x_2s.html: * tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1s_x_2ss.html: Various combinations of plain, signed, crashing, exception throwing and exiting applets on single web-page * tests/reproducers/simple/CountingApplet1/srcs/CountingApplet1.java: Simple applet painting to canvas and periodically printing out counted messages * tests/reproducers/simple/CountingApplet1/testcases/ParallelAppletsTest.java: testcases launching above html files. * tests/reproducers/simple/CountingApplet2/srcs/CountingApplet2.java: Second simple applet painting to canvas and periodically printing out counted messages * tests/reproducers/simple/simpletest2/srcs/SimpleTest2.java: Enhanced exception throwing reproducer. 2012-09-04 Jiri Vanek Danesh Dadachanji Single instance support for jnlp-href and tests * netx/net/sourceforge/jnlp/services/XSingleInstanceService.java: (initializeSingleInstance) fixed code for catching running instance (checkSingleInstanceRunning) Added handling of parameters. * netx/net/sourceforge/jnlp/Launcher.java: (launchApplication), (launchApplet) Added debug output that instance is already running. (getApplet) added check for services and debug output * netx/net/sourceforge/jnlp/resources/Messages.properties: added (LSingleInstanceExists) entry for exception. tests/reproducers/simple/SingleInstanceServiceTest/resources/SingleInstanceTest.jnlp * tests/reproducers/simple/SingleInstanceServiceTest/resources/SingleInstanceTestWS.jnlp: * tests/reproducers/simple/SingleInstanceServiceTest/resources/SingleInstanceTest_clasical.html: * tests/reproducers/simple/SingleInstanceServiceTest/resources/SingleInstanceTest_jnlpHref.html: Applet and application in jnlp or html launching files. * tests/reproducers/simple/SingleInstanceServiceTest/srcs/SingleInstanceChecker.java SingleInstance implementing applet/application * tests/reproducers/simple/SingleInstanceServiceTest/testcases/SingleInstanceTest.java Testfile for launching for above jnlps/htmls as testcases. 2012-08-27 Adam Domurad Fixes PR920, duplicate loading of classes in certain cases * NEWS: Added entry: Fixes PR920 * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: Remove recursive/non-recursive distinction. Add parent JNLPClassLoader to parent chain. 2012-08-27 Adam Domurad Reproduces problem behind PR920, class is in a jar is loaded twice when used by both a class within the jar, and also used by a class outside the jar extending that class. * tests/reproducers/custom/AppletExtendsFromOutsideJar/README: Describes test * tests/reproducers/custom/AppletExtendsFromOutsideJar/resources/AppletExtendsFromOutsideJar.html: Runs applet with main class outside jar * A tests/reproducers/custom/AppletExtendsFromOutsideJar/srcs/AppletReferenceInSameJar.java: References class Referenced inside same jar * tests/reproducers/custom/AppletExtendsFromOutsideJar/srcs/AppletReferenceOutOfJar.java: References class Referenced outside the jar * tests/reproducers/custom/AppletExtendsFromOutsideJar/srcs/Makefile: Packages Reference, AppletReferenceInSameJar into a jar, AppletReferenceOutOfJar outside it * tests/reproducers/custom/AppletExtendsFromOutsideJar/srcs/Referenced.java: Class that is referenced twice, loaded twice in failing behaviour * tests/reproducers/custom/AppletExtendsFromOutsideJar/testcases/AppletExtendsFromOutsideJarTests.java: Drives AppletExtendsFromOutsideJar.html 2012-08-27 Adam Domurad Tests whether a main class can be found in a jar specified in META-INF/INDEX.LIST. This test is done with both signed and unsigned jars. The failure with signed jars encapsulates PR1112. * tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/resources/AdditionalJarsInMetaInfIndexListSigned.jnlp: * tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/resources/AdditionalJarsInMetaInfIndexListUnsigned.jnlp: JNLP files for the signed and unsigned varions of the test * tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/srcs/LoadedViaMetaInfIndexList.java: Main class that is within a jar loaded via * tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/srcs/Makefile: Prepares a jar with INDEX.LIST pointing to another jar that has the main-class. Copies of these jars and made and signed. * tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/testcases/AdditionalJarsInMetaInfIndexListTests.java: Test driver, tests if main-class has run. 2012-08-27 Adam Domurad Tests custom policy definition in such a way that has been known to cause ClassCircularityError's. Reproducer for PR1145. * tests/reproducers/signed/CustomPolicy/resources/CustomPolicy.jnlp: * tests/reproducers/signed/CustomPolicy/srcs/CustomPolicy.java: Sets custom policy and performs a privileged operation with no given privileges. * tests/reproducers/signed/CustomPolicy/testcases/CustomPolicyTests.java: Tests that an access control exception was caught, and that the program exits correctly. 2012-08-27 Deepak Bhole * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java (getAccessControlContextForClassLoading): Catch ClassCircularityErrors and ignore them (thus denying permission to caller). 2012-08-27 Jiri Vanek Added tests for PR822 - multiple signatures on classpath * Makefile.am: listed signed2 directory * tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest.html: * tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest1.jnlp: * tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest1_requesting.jnlp: * tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest2.jnlp: * tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/MultipleSignaturesTest1_SamePackage.jnlp: * tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/MultipleSignaturesTest1_SamePackage_requesting.jnlp: * tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/MultipleSignaturesTest2_SamePackage.jnlp: * tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/MultipleSignaturesTest_SamePackage.html: various variations of multiple signtarues jnlp/html, in/out package, same/different/ signature * tests/reproducers/signed2/MultipleSignaturesTestSamePackage/srcs/MultipleSignaturesTestSamePackage.java: simple class just with call to second jar * tests/reproducers/signed2/MultipleSignaturesTest/srcs/somecrazytestpackage/MultipleSignaturesTest.java: simple class just with call to second jar, but in package * tests/reproducers/signed2/MultipleSignaturesTest/testcases/MultipleSignaturesTestTests.java: * tests/reproducers/signed2/MultipleSignaturesTestSamePackage/testcases/MultipleSignaturesTestTestsSamePackage.java various testcases tro above resources * tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java: "-verbose " fixed to "-verbose" 2012-08-27 Jiri Vanek Fixed long term failing unit-test, fixed NPE from ClassLoader * netx/net/sourceforge/jnlp/NullJnlpFileException.java: new class to distinguish plain NPE from null jnlp file. * netx/net/sourceforge/jnlp/SecurityDesc.java: (getSandBoxPermissions) added throw of NullJnlpFileException in case of null jnlp file. * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: (findClass) added Override annotation, add catch of NullJnlpFileException and re-throw of CNF exception. * tests/netx/unit/net/sourceforge/jnlp/runtime/CodeBaseClassLoaderTest.java: (testResourceLoadSuccessCaching) (testResourceLoadFailureCaching) (testParentClassLoaderIsAskedForClasses) - internal JNLPFile's (getSecurity) null in SecurityDesc constructorrepalced by this. (testNullFileSecurityDesc) new test to ensure NPE in null JNLPFile case. 2012-08-22 Jiri Vanek Added tests for PR905 - parameters in jnlp/html application/applet resources * tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarUrl.html: html file to launch applet, requested archive jar have parameter * tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarUrl1.jnlp: jnlp file to launch application, requested archive jar have parameter * tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarUrl2.jnlp: jnlp file to launch application, requested jnlp have parameter * tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarUrlSigned.html: html file to launch signed applet, requested archive jar have parameter * tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarUrlSigned1.jnlp: jnlp file to launch signed application, requested archive jar have parameter * tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarUrlSigned2.jnlp: jnlp file to launch signed application, requested jnlp have parameter * tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarAppletUrl2.jnlp * tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarAppletUrl.jnlp * tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarAppletUrlSigned2.jnlp * tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarAppletUrlSigned.jnlp variations launching applets from jnlp * tests/reproducers/simple/ParametrizedJarUrl/testcases/ParametrizedJarUrlTests.java: testaceses of above ParametrizedJarUrl/jnlps+htmls namely - (parametrizedAppletTestSignedTest) , (testParametrizedJarUrl2), (testParametrizedJarUrlSigned2): passing calls /partially/ with parameter. Those test are passing. (parametrizedAppletTestSignedFirefoxTest) call with parameter upon signed applet in browser, failing and so is representing PR905 2012-08-21 Jiri Vanek * tests/test-extensions/net/sourceforge/jnlp/ProcessAssasin.java: (sigInt), (sigKill), (sigTerm) new methods for various killing of processes by kill. (kill) new method, launching kill process. (destroyProcess ) is now calling sigInt instead of unwrapped sigTerm. 2012-08-21 Jiri Vanek * launcher/javaws.in: java is now launched by exec 2012-08-19 Thomas Meyer * netx/net/sourceforge/jnlp/JNLPFile.java: * netx/net/sourceforge/jnlp/LaunchHandler.java: * netx/net/sourceforge/jnlp/PluginBridge.java: * netx/net/sourceforge/jnlp/cache/ResourceUrlCreator.java: * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: * netx/net/sourceforge/jnlp/runtime/RhinoBasedPacEvaluator.java: Fix javadoc warnings. * plugin/icedteanp/java/sun/applet/PluginObjectStore.java (contains): Fix a small bug that prevents the only user of this method (PluginAppletSecurity line 1064) to work correctly. 2012-08-18 Jiri Vanek added encodings reproducer (PR1108) * tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ: new reproducer * tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/srcs/encodingTest.java: main class/main applet class and method of new encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ.jar * tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/testcases/encodingTestTest.java: testcases for jnlps of this reproducers * tests/reproducers/simple/encodingTestsĚŠČŘŽÝÁÍÉĚÉŘŤÝÚŮÍÓÁŠĎŽŹŇ/resources: four utf-8 and four iso-8859-2 jnlp files and one utf-8 and one iso-8859-2 html files * tests/reproducers/simple/simpletest1/srcs/simpletest1.java: now prints its args out * tests/test-extensions-tests/net/sourceforge/jnlp/ResourcesTest.java: correctly swaped error and output listener in its test 2012-08-17 Adam Domurad Fixes PR588, cookies set in the java cookie jar are now stored properly * plugin/icedteanp/IcedTeaNPPlugin.cc (set_cookie_info): New, uses setvalueforurl (consume_plugin_message): Additional message added allowing set_cookie_info to be used from the java side. * plugin/icedteanp/java/sun/applet/PluginCookieManager.java: Now overrides put method, results in set_cookie_info calls in C++ * plugin/icedteanp/java/sun/applet/PluginMain.java: Passes PluginStreamHandler to PluginCookieManager to allow C++ side communication 2012-08-17 Adam Domurad Reproducers for PR588, sets persistent and session cookies in the cookie jar and tries to read them with various means. * tests/reproducers/signed/SavingCookies/resources/CheckCookie.html: Print the cookie store contents * tests/reproducers/signed/SavingCookies/resources/CheckCookieAndGotoClear.html: Print the cookie store contents, and then go to ClearPersistentCookie.html with showDocument * tests/reproducers/signed/SavingCookies/resources/ClearPersistentCookie.html: Clear the test cookie so it does not interfere with further tests * tests/reproducers/signed/SavingCookies/resources/SavePersistentCookie.html: Create a persistent cookie * tests/reproducers/signed/SavingCookies/resources/SavePersistentCookieAndGotoCheck.html: Create a persistent cookie and check it with showDocument * tests/reproducers/signed/SavingCookies/resources/SaveSessionCookie.html: Create a session cookie * tests/reproducers/signed/SavingCookies/resources/SaveSessionCookieAndGotoCheck.html: Create a session cookie and check it with showDocument * tests/reproducers/signed/SavingCookies/srcs/CheckingCookies.java: Checks the contents of the cookie store. Depending on the test, this may go to another page upon completion. * tests/reproducers/signed/SavingCookies/srcs/SavingCookies.java: Store cookies in the java cookie store. Depending on the test, this may go to another page upon completion. * tests/reproducers/signed/SavingCookies/testcases/SavingCookiesTests.java Test driver for testing persistent and session cookies in different ways 2012-08-18 Jiri Vanek * tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java: added VERBOSE_OPTION constant with -verbose value for javaws launching. 2012-08-17 Jiri Vanek * tests/reproducers/simple/deadlocktest/testcases/DeadLockTestTest.java: (testDeadLockTestTerminatedBody) removed tests for killed-process and termination of remaining javas put on correct place. * tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java: (executeBrowser) stout and stderr listeners forwarded to next method in correct order. 2012-08-14 Danesh Dadachanji Classpaths in jars' manifests are only considered when the applet is run without using jnlp_href and a JNLP file. * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java (activateJars): Add conditional check for use of jnlp_href. * tests/reproducers/signed/Classpath.Manifest.Test.Helper/srcs/CheckForClasspath.java: Applet whose jar is stored in a subdir under the test engine server. * tests/reproducers/signed/ClasspathManifestTest/resources/ClasspathManifestAppletTest.html: * tests/reproducers/signed/ClasspathManifestTest/resources/ClasspathManifestAppletTest.jnlp: * tests/reproducers/signed/ClasspathManifestTest/resources/ClasspathManifestApplicationTest.jnlp: * tests/reproducers/signed/ClasspathManifestTest/resources/ClasspathManifestJNLPHrefTest.html: * tests/reproducers/signed/ClasspathManifestTest/srcs/ClasspathManifest.java: * tests/reproducers/signed/ClasspathManifestTest/srcs/META-INF/MANIFEST.MF: * tests/reproducers/signed/ClasspathManifestTest/testcases/ClasspathManifestTest.java: Test if manifest entry is searched for classpath only when in the plugin is run without using jnlp_href. 2012-08-14 Adam Domurad Reproducer for allowing unsigned content in META-INF/ folder. Derives from ReadPropertiesSigned test's signed jar. * tests/reproducers/custom/UnsignedContentInMETAINF/resources/UnsignedContentInMETAINF.jnlp: New, runs a modified version of ReadPropertiesSigned.jar (UnsignedContentInMETAINF.jar) * tests/reproducers/custom/UnsignedContentInMETAINF/srcs/META-INF/unsigned_file_in_metainf: New, placed into a modified version of ReadPropertiesSigned.jar (UnsignedContentInMETAINF.jar) so that there is unsigned content in the META-INF/ folder. * tests/reproducers/custom/UnsignedContentInMETAINF/srcs/Makefile: New, creates a modified version of ReadPropertiesSigned.jar, named UnsignedContentInMETAINF.jar, and places unsigned content inside its META-INF/ folder * tests/reproducers/custom/UnsignedContentInMETAINF/testcases/UnsignedContentInMETAINF.java: Test driver for jnlp file 2012-08-14 Adam Domurad Unit test for method in JCV, isMetaInfFile() * netx/net/sourceforge/jnlp/tools/JarCertVerifier.java: Made isMetaInfFile package-private for testing purposes. * tests/netx/unit/net/sourceforge/jnlp/tools/JarCertVerifierTest.java: New, tests isMetaInfFile 2012-08-06 Jiri Vanek Added splashscreen implementation * netx/net/sourceforge/jnlp/GuiLaunchHandler.java: calling JNLPSplashScreen constructor with file ratehr then null. * netx/net/sourceforge/jnlp/InformationDesc.java: ONE_LINE changed from "oneline" to "one-line", added citation why. (getDescriptionStrict) new method returning exact value or null without fall-back. * netx/net/sourceforge/jnlp/JNLPSplashScreen.java: Added header, default values and useless string replaced by JnlpFile. * netx/net/sourceforge/jnlp/resources/Messages.properties: Added SPLASH family of keys. * netx/net/sourceforge/jnlp/runtime/AppletEnvironment.java: (getSplashControler) new method returning its SplashControler. * netx/net/sourceforge/jnlp/runtime/Boot.java: Constants (name) and (version) made public. * netx/net/sourceforge/jnlp/splashscreen/SplashController.java: New interface for each class which wants its splasshcreen controlled by SplashUtils. * netx/net/sourceforge/jnlp/splashscreen/SplashErrorPanel.java: New interface for each class which wants to serve as error-showing splashscreen. * netx/net/sourceforge/jnlp/splashscreen/SplashPanel.java: New interface for each class which wants to serve as splashscreen. * netx/net/sourceforge/jnlp/splashscreen/SplashUtils.java: Factory methods for simplified splashscreens creation. * netx/net/sourceforge/jnlp/splashscreen/impls/DefaultErrorSplashScreen2012.java: Full implementation of SplashErrorPanel to be used as default error splashscreen. * netx/net/sourceforge/jnlp/splashscreen/impls/DefaultSplashScreen2012.java: Full implementation of SplashPanel to be used as default splashscreen. * netx/net/sourceforge/jnlp/splashscreen/impls/DefaultSplashScreens2012Commons.java: Class for gathering same logic in DefaultErrorSplashScreen2012 and DefaultSplashScreen2012. * netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/BasePainter.java: Class responsible for paint main graphic in DefaultSplashScreen2012. * netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/ControlCurve.java: Painting forefather for primitives drawing curves. * netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/Cubic.java: Class with cubic calculation. * netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/ErrorPainter.java: Class responsible for paint main graphic in DefaultErrorSplashScreen2012. * netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/MovingText.java: Class responsible for metal-shining web label. * netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/NatCubic.java: Painting primitive for drawing cubic-splines. * netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/NatCubicClosed.java: Painting primitive for drawing self-closed cubic-splines. * netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/TextOutlineRenderer.java: Class for rendering text from given texture, * netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/TextWithWaterLevel.java: Class for rendering Iced label slowly filled with watter * netx/net/sourceforge/jnlp/splashscreen/parts/BasicComponentErrorSplashScreen.java: Common forefather for all error splashscreens which would like to be an component too. * netx/net/sourceforge/jnlp/splashscreen/parts/BasicComponentSplashScreen.java: Common forefather for all splashscreens which would like to be an component too. * netx/net/sourceforge/jnlp/splashscreen/parts/DescriptionInfoItem.java: Description item of InformationElement * netx/net/sourceforge/jnlp/splashscreen/parts/InfoItem.java: Individual items in InformationElement * netx/net/sourceforge/jnlp/splashscreen/parts/InformationElement.java: Wrapper around jnlp's information element. * netx/net/sourceforge/jnlp/splashscreen/parts/JEditorPaneBasedExceptionDialog.java: Custom error dialogue with direct access to exception and icedtea-web page * tests/netx/unit/net/sourceforge/jnlp/splashscreen/ErrorSplashScreenTest.java: Test for final composition of ErrorSplashScreen2012, including main method for manual testing * tests/netx/unit/net/sourceforge/jnlp/splashscreen/SplashScreenTest.java: Test for final composition of SplashScreen2012, including main method for manual testing * tests/netx/unit/net/sourceforge/jnlp/splashscreen/ErrorSplashUtilsTest.java: * tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/BasePainterTest.java: * tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/ControlCurveTest.java: * tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/CubicTest.java: * tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/ErrorPainterTest.java: * tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/MovingTextTest.java: * tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/NatCubicClosedTest.java: * tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/NatCubicTest.java: * tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/SplinesDefsTest.java: * tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/TextOutlineRendererTest.java: * tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/TextWithWaterLevelTest.java: * tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/BasicComponentErrorSplashScreenTest.java: * tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/BasicComponentSplashScreenTest.java: * tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/DescriptionInfoItemTest.java: * tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/InfoItemTest.java: * tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/InformationElementTest.java: * tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/JEditorPaneBasedExceptionDialogTest.java: Unit-test classes always testing the class with corresponding name 2012-08-13 Jiri Vanek * tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java: (executeProcessUponURL)Fixed wrong call in previous commit which was causing null process name. * tests/reproducers/simple/AppletTest/testcases/AppletTestTests.java: Removed unused import. 2012-08-13 Jiri Vanek Reproducers of PR955 * tests/reproducers/simple/LocalisedInformationElement/resources/LocalisedInformationElement1.jnlp: * tests/reproducers/simple/LocalisedInformationElement/resources/LocalisedInformationElement2.jnlp: * tests/reproducers/simple/LocalisedInformationElement/resources/LocalisedInformationElement3.jnlp: * tests/reproducers/simple/LocalisedInformationElement/resources/LocalisedInformationElement4.jnlp: Test jnlp files with various combinations of locales, reproducers of PR955. * tests/reproducers/simple/LocalisedInformationElement/resources/LocalisedInformationElement_noLoc.jnlp Jnlp file with which is not affected by PR955 and is helping to catch error in LOCALE changing hack * tests/reproducers/simple/LocalisedInformationElement/srcs/LocalisedInformationElement.java: Reproducer main class, after loading prints out default locale. * tests/reproducers/simple/LocalisedInformationElement/testcases/LocalisedInformationElementTest.java: Testcases launching above jnlps under various locales. * tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java: Added set of methods allowing passing of custom variables to ThreadedProcess. * tests/test-extensions/net/sourceforge/jnlp/ThreadedProcess.java: Added processing of custom variables. 2012-08-10 Adam Domurad * plugin/icedteanp/IcedTeaNPPlugin.cc (consume_plugin_message): New, called by consume_message, handles cookie and proxy info retrieval, and setting cookie info (consume_message): Call consume_plugin_message for "plugin ..." messages 2012-08-08 Danesh Dadachanji Fix PR955: regression: SweetHome3D fails to run * NEWS: Added entry for PR955 * netx/net/sourceforge/jnlp/JNLPFile.java: New enum Match that represents the level of precision to use when matching locales. (localMatches): Renamed to localeMatches, added matchLevel paramater and updated conditionals to handle the level of precision specified by it. (getVendor): New method that returns an information's vendor text. (getInformation): Added override methods for getTitle and getVendor that are used by the anonymous class to filter by locale. All three methods now go through all levels of precision to search for the best fitted locale. (getResources), (getResourcesDescs): Updated to check if any level of precision matches when searching for locales. (parse): Added call to checkForTitleVendor. * netx/net/sourceforge/jnlp/Parser.java (checkForTitleVendor): New method to check for availability of localized title and vendor from the information tags. Throws ParseException. (getInfo): Replace loop with foreach loop. (getInformationDesc): Remove check for present title and vendor. (getLocale): Variant returned can now use everything after the eigth element of the locale's string. * netx/net/sourceforge/jnlp/resources/Messages.properties: Update missing title and vendor messages to mention localization. * tests/reproducers/simple/InformationTitleVendorParser/testcases/InformationTitleVendorParserTest.java: Update output string as per new changes to Messages internationalizations. * tests/netx/unit/net/sourceforge/jnlp/JNLPFileTest.java: New unit test that checks the localesMatches method in JNLPFile. * tests/netx/unit/net/sourceforge/jnlp/MockJNLPFile.java: New class used to create a mock JNLPFile object. * tests/netx/unit/net/sourceforge/jnlp/ParserTest.java: New unit test that checks that the return of getTitle and getVendor have localized information. 2012-08-07 Thomas Meyer * plugin/icedteanp/IcedTeaNPPlugin.cc: only export NP_GetMIMEDescription, NP_GetValue, NP_Initialize and NP_Shutdown. This should fix PR472. 2012-08-07 Saad Mohammad Added license header to files without one. * netx/net/sourceforge/jnlp/AppletLog.java: * netx/net/sourceforge/jnlp/JNLPMatcherException.java: * netx/net/sourceforge/jnlp/Log.java: * netx/net/sourceforge/jnlp/Node.java: * netx/net/sourceforge/jnlp/UpdateDesc.java: * netx/net/sourceforge/jnlp/cache/IllegalResourceDescriptorException.java: * netx/net/sourceforge/jnlp/security/SecurityDialogMessage.java: Added license header. 2012-08-07 Adam Domurad Fixes PR1106, plugin crashing with firefox + archlinux/gentoo * plugin/icedteanp/IcedTeaNPPlugin.cc (initialize_browser_functions): Account for the fact that browserTable->size can be larger than sizeof(NPNetscapeFuncs) 2012-08-01 Saad Mohammad Fix PR1049: Extension jnlp's signed jar with the content of only META-INF/* is considered unsigned. * NEWS: Added entry for PR1049. * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java (initializeResources): Removes the display of the security dialog for loaders with only empty jars. * netx/net/sourceforge/jnlp/tools/JarCertVerifier.java: (JarCertVerifier): Tracks whether all jars verified are empty jars. (hasAllEmptyJars): Returns true if all jars verified are empty jars. (verifyJars): Checks whether signable entries and certificates are found and decides if all jars are empty jars. (isFullySignedByASingleCert): If all jars are emptyJars, returns true. * tests/reproducers/signed/EmptySignedJar/resources/EmptySignedJarInLaunchingJnlp.jnlp: Launching jnlp with the resource of an empty jar and an extension jnlp containing the main jar. * tests/reproducers/signed/EmptySignedJar/resources/EmptySignedJarInExtensionJnlp.jnlp: Launching jnlp with the resource of the main jar and an extension jnlp containing the empty jar. * tests/reproducers/signed/EmptySignedJar/resources/EmptySignedJarExtension.jnlp: Extension jnlp containing only an empty jar. * tests/reproducers/signed/EmptySignedJar/srcs/META-INF/empty_file: Empty file within META-INF; required to create EmptySignedJar.jar by the test engine. * tests/reproducers/signed/EmptySignedJar/testcases/EmptySignedJarTest.java: Testcase that tests jnlp files with empty jars. * tests/reproducers/signed/SignedJarResource/resources/SignedJarResource.jnlp: Launches SignedJarResource class directly. 2012-07-31 Danesh Dadachanji Minor fix to overly restrictive unit test. * tests/netx/unit/net/sourceforge/jnlp/JNLPMatcherTest.java (testIsMatchDoesNotHangOnLargeData): Increase timeout to 5 seconds. 2012-07-24 Adam Domurad CVE-2012-3422, RH840592: Potential read from an uninitialized memory location. * plugin/icedteanp/IcedTeaNPPlugin.cc (get_cookie_info): Only attempt to perform this operation if there is a valid plugin instance (get_proxy_info): Only attempt to perform this operation if there is a valid plugin instance 2012-07-31 Danesh Dadachanji * Makefile.am: Fix call to keytool that is missing its absolute path. 2012-07-31 Jiri Vanek Peter Hatina Introduced configure option --with-gtk=2|3|default to be able to compile against different version of GTK+ (2.x or 3.x). * NEWS: mentioned bug fix * acinclude.m4: (ITW_GTK_CHECK_VERSION) macro for getting GTK+ version (ITW_GTK_CHECK) macro for checking GTK+ version 2012-07-24 Adam Domurad * plugin/icedteanp/IcedTeaPluginUtils.cc (IcedTeaPluginUtilities::strSplit): Replace usage of " " with proper delimiter 2012-07-18 Danesh Dadachanji Fix RH838417, Fix RH838559: Disambiguate signed applet security prompt from certificate warning. * NEWS: Added entries for RH838417 and RH838559. * netx/net/sourceforge/jnlp/resources/Messages.properties: Added SWarnFullPermissionsIgnorePolicy and updated SHttpsUnverified. * netx/net/sourceforge/jnlp/security/CertWarningPane.java: Display SWarnFullPermissionsIgnorePolicy if the cert is from a jar and is either unverified or has a signing error. Also added warning.png to HTTPS dialogs. 2012-07-18 Thomas Meyer * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java (handleMessage): Fix possible endless loop while waiting for the applet object instance to get created. 2012-07-11 Jiri Vanek try to close browser before kill it * tests/reproducers/signed/AppletTestSigned/testcases/AppletTestSignedTests.java: * tests/reproducers/simple/AppletTest/testcases/AppletTestTests.java: * tests/reproducers/simple/CheckServices/testcases/CheckServicesTests.java (evaluateSignedApplet) addapted to properly closed browser * tests/reproducers/simple/CheckServices/srcs/CheckServices.java: removed fixme section as it shuld work now * tests/test-extensions/net/sourceforge/jnlp/ProcessAssasin.java (destroyProcess) new method, launching kill with SIGTERM before clasical process.destroy() * tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java: removed Set terminated, should be removed long ago 2012-07-10 Adam Domurad Refactor JNLPFile#launchType into its own interface type (as opposed to Object), LaunchDesc. * netx/net/sourceforge/jnlp/AppletDesc.java: Add override annotation to getMainClass(). * netx/net/sourceforge/jnlp/ApplicationDesc.java: Same as above * netx/net/sourceforge/jnlp/InstallerDesc.java: Same as above * netx/net/sourceforge/jnlp/JNLPFile.java: Make launchType a LaunchDesc object. Update getLaunchInfo() accordingly. * netx/net/sourceforge/jnlp/LaunchDesc.java: New launch description. * netx/net/sourceforge/jnlp/Parser.java (getLauncher): Return type changed to LaunchDesc * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: Replace occurences of instanceof with respect to launchType. 2012-07-09 Deepak Bhole * configure.ac: Bumped release number to 1.4pre 2012-07-09 Saad Mohammad * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java (initializeExtensions): Checks and assigns the main-class name prior to the for loop. 2012-07-09 Martin Olsson * plugin/icedteanp/IcedTeaPluginUtils.cc: Change calls from g_free to free when allocated with calloc. * plugin/icedteanp/IcedTeaPluginRequestProcessor.cc (PluginRequestProcessor::call): Make sure args_array doesnt hold garbage when freed. (_loadURL): Change calls from g_free to free when allocated with calloc. 2012-07-09 Adam Domurad Ignore invalid jar files in applets, like the oracle plugin does. * netx/net/sourceforge/jnlp/cache/IllegalResourceDescriptorException.java: New exception type for ResourceTracker to throw instead of IllegalArgumentException * netx/net/sourceforge/jnlp/cache/IllegalResourceDescriptorException.java: Throws IllegalArgumentDescriptorException instead of IllegalArgumentException. * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: (isInvalidJar): New, checks for ZipException in new JarFile(...) (shouldFilterInvalidJars): New, checks if we are in an applet (initializeResources): if 'shouldFilterInvalidJars()' is true and a jar is not a valid jar file, the jar is filtered out and normal execution continues. 2012-07-03 Saad Mohammad * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: (JNLPClassLoader): New constructor that accepts an additional parameter containing the main class name. (getInstance): Accepts mainName as parameter to override application's main class name (initializeExtensions): Passes in the name of the application's main class when creating a new JNLPClassLoader instance. (initializeResources): If the loader owns no jars, it will consider itself as signed if all of the extension loaders are signed. Also, if the extension jars have the main class, it will set foundMainJar to true. (initializeResources): If the main class was not found, check if it was found within the extension jars. (checkForMain): Uses the overwritten main class name (if set) when searching for the main within the jars. (hasMainJar): Returns true if this loader holds the main jar. (hasMainInExtensions): Returns true if extension loaders have the main jar * tests/jnlp_tests/signed/ExtensionJnlp/resources/UsesSignedJarExtension.jnlp: * tests/jnlp_tests/signed/ExtensionJnlp/resources/UsesSignedJnlpExtension.jnlp: * tests/jnlp_tests/signed/ExtensionJnlp/resources/UsesSignedJnlpJarAndSignedJarExtension.jnlp: Launching jnlps that use extension jnlp as its resource. * tests/jnlp_tests/signed/ExtensionJnlp/resources/UsesSignedJar.jnlp: Launching jnlp that directly launches SignedJarResource class. * tests/jnlp_tests/signed/ExtensionJnlp/resources/UsesSignedJnlp.jnlp: Launching jnlp that directly launches SignedJnlpResource class. * tests/jnlp_tests/signed/ExtensionJnlp/testcases/ExtensionJnlpTest.java: Testcase that tests the launching of jnlp files containing extension jnlps as resource. * tests/jnlp_tests/signed/SignedJarResource/resources/SignedJarExtension.jnlp: Component jnlp file that is used as an extension resource. * tests/jnlp_tests/signed/SignedJarResource/srcs/SignedJarResource.java: A simple java class that outputs a string. * tests/jnlp_tests/signed/SignedJnlpResource/resources/UnmatchingSignedJnlpExtension.jnlp: Component jnlp file that is used as an extension resource and does not match the signed jnlp file. * tests/jnlp_tests/signed/SignedJnlpResource/resources/MatchingSignedJnlpExtension.jnlp: Component jnlp file that is used as an extension resource and matches the signed jnlp file. * tests/jnlp_tests/signed/SignedJnlpResource/srcs/JNLP-INF/APPLICATION_TEMPLATE.jnlp: Signed jnlp file. * tests/jnlp_tests/signed/SignedJnlpResource/srcs/SignedJnlpResource.java: A simple java class that outputs a string. 2012-07-02 Jiri Vanek Added missing headers * tests/reproducers/simple/CreateClassLoader/resources/CreateClassLoader.jnlp: * tests/reproducers/simple/ReadEnvironment/resources/ReadEnvironment.jnlp: * tests/reproducers/simple/ReadProperties/resources/ReadProperties1.jnlp: * tests/reproducers/simple/ReadProperties/resources/ReadProperties2.jnlp: * tests/reproducers/simple/RedirectStreams/resources/RedirectStreams.jnlp: * tests/reproducers/simple/ReplaceSecurityManager/resources/ReplaceSecurityManager.jnlp: * tests/reproducers/simple/SetContextClassLoader/resources/SetContextClassLoader.jnlp: * tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java: * tests/test-extensions/net/sourceforge/jnlp/annotations/Bug.java: * tests/test-extensions/net/sourceforge/jnlp/annotations/KnownToFail.java: * tests/test-extensions/net/sourceforge/jnlp/annotations/NeedsDisplay.java: * tests/test-extensions/net/sourceforge/jnlp/annotations/TestInBrowsers.java: * tests/test-extensions/net/sourceforge/jnlp/browsertesting/Browser.java: * tests/test-extensions/net/sourceforge/jnlp/browsertesting/BrowserFactory.java: * tests/test-extensions/net/sourceforge/jnlp/browsertesting/BrowserTest.java: * tests/test-extensions/net/sourceforge/jnlp/browsertesting/BrowserTestRunner.java: * tests/test-extensions/net/sourceforge/jnlp/browsertesting/Browsers.java: * tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/Chrome.java: * tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/Chromium.java: * tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/Epiphany.java: * tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/Firefox.java: * tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/LinuxBrowser.java: * tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/Midory.java: * tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/MozillaFamilyLinuxBrowser.java: * tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/Opera.java: added license headers 2012-07-02 Jiri Vanek Makefile adapted to recent (three changelog items) refactoring * Makefile.am: (JNLP_TESTS_ENGINE_SRCDIR) now points correctly to test-extensions. (JNLP_TESTS_ENGINE_TESTS_SRCDIR) new variable for test-extensions-tests. (JNLP_TESTS_SRCDIR) now points to reproducers. (JNLP_TESTS_ENGINE_TESTS_DIR) new variable for built JNLP_TESTS_ENGINE_TESTS_SRCDIR (netx-dist-tests-tests-source-files.txt) new target for list of content of JNLP_TESTS_ENGINE_TESTS_SRCDIR. (stamps/netx-dist-tests-tests-compile.stamp) new target for compiling netx-dist-tests-tests-source-files.txt (netx-dist-tests-source-files.tx) now depends on stamps/netx-dist-tests-tests-compile.stamp ($(REPRODUCERS_CLASS_NAMES)) target is now working in JNLP_TESTS_ENGINE_TESTS_DIR instead of JNLP_TESTS_ENGINE_DIR (stamps/run-netx-dist-tests.stamp): added JNLP_TESTS_ENGINE_TESTS_DIR to classpath (stamps/run-unit-test-code-coverage.stamp), (stamps/run-reproducers-test-code-coverage.stamp) added JNLP_TESTS_ENGINE_TESTS_DIR to classpath and JNLP_TESTS_ENGINE_TESTS_SRCDIR to sources path 2012-07-02 Jiri Vanek All tests from test-extensions extracted to test-extensions-tests. All inner classes in test-extensions extracted as outer classes * tests/test-extensions/net/sourceforge/jnlp/ResourcesTest.java: moved to test-extensions-tests * tests/test-extensions-tests/net/sourceforge/jnlp/ResourcesTest.java: new file, copied from test-extensions * tests/test-extensions-tests/net/sourceforge/jnlp/ServerAccessTest.java: all tests from original ServerAccess.java * tests/test-extensions/net/sourceforge/jnlp/ContentReader.java: * tests/test-extensions/net/sourceforge/jnlp/LogItem.java: * tests/test-extensions/net/sourceforge/jnlp/LoggingBottleneck.java: * tests/test-extensions/net/sourceforge/jnlp/ProcessAssasin.java: * tests/test-extensions/net/sourceforge/jnlp/ProcessResult.java: * tests/test-extensions/net/sourceforge/jnlp/ServerLauncher.java: * tests/test-extensions/net/sourceforge/jnlp/TestsLogs.java: * tests/test-extensions/net/sourceforge/jnlp/ThreadedProcess.java: * tests/test-extensions/net/sourceforge/jnlp/TinyHttpdImpl.java: new files, extracted classes from ServerAccess * tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java: extracted tests and inner classes 2012-07-02 Jiri Vanek hg move tests/netx/jnlp_testsengine/ tests/test-extensions 2012-07-02 Jiri Vanek hg move tests/jnlp_tests/ tests/reproducers 2012-06-29 Jiri Vanek Fixed resource tests and Browsers.none behavior * tests/netx/jnlp_testsengine/net/sourceforge/jnlp/ResourcesTest.java: Added slash into all executeBrowsers urls. Added midori and epiphany to simple proxies test. * tests/netx/jnlp_testsengine/net/sourceforge/jnlp/browsertesting/BrowserTestRunner.java: Corrected handling of Browsers.none together with -Dmodified.browsers.run switch 2012-06-28 Omair Majid * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java (findClass): Invoke CodeBaseClassLoader.findClass with a flag to avoid infinite recursion. (CodeBaseClassLoader.findClass(String)): Delegate to ... (CodeBaseClassLoader.findClass(String,boolean)): New method. * tests/netx/unit/net/sourceforge/jnlp/runtime/CodeBaseClassLoaderTest.java (testParentClassLoaderIsAskedForClasses): New method. 2012-06-28 Jiri Vanek Correctly backup all log files re-writable by emma during code-coverage * Makefile.am: (EMMA_MODIFIED_FILES) new variable with list of files to backup/restore. (stamps/run-unit-test-code-coverage.stamp) and (stamps/run-reproducers-test-code-coverage.stamp) are now iterating over EMMA_MODIFIED_FILES instead of enumerating them 2012-06-28 Jiri Vanek Removed repeated re-runing of tests during coverage, stamped pac tests * Makefile.am: (check-pac-functions) moved to target aliases and replaced by stamps/check-pac-functions.stamp. (clean-netx-unit-tests) added removing of stamps/check-pac-functions.stamp (stamps/exported-test-certs.stamp): no longer depends on netx-dist-tests-remove-cert-from-public, logic of it have to be copy-pasted from here. (stamps/run-unit-test-code-coverage.stamp): no longer depends on check, but was added direct dependences 2012-06-28 Adam Domurad Allow for folders in archive tag. * netx/net/sourceforge/jnlp/PluginBridge.java: (PluginBridge) Changes jar -> archive, parse contents with addArchiveEntries. (addArchiveEntries) New method. Adds entries ending with / to the list of folders. (getCodeBaseFolders) Returns the folders collected by addArchiveEntries * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: (initializeResources) If ran as plugin, add archive tag folders to the code base loader. 2012-06-27 Adam Domurad Tests folders in archive tag * tests/jnlp_tests/custom/AppletFolderInArchiveTag/testcases/AppletFolderInArchiveTagTests.java: Runs html file in browser * tests/jnlp_tests/custom/AppletFolderInArchiveTag/srcs/Makefile: packages compiled source files in folder * tests/jnlp_tests/custom/AppletFolderInArchiveTag/srcs/AppletFolderInArchiveTag.java: Simple output to confirm it is running * tests/jnlp_tests/custom/AppletFolderInArchiveTag/resources/AppletFolderInArchiveTag.html: Has folder in its archive tag that contains a class file 2012-06-26 Jiri Vanek Added slipped midori and epiphany to recognized browsers. * tests/netx/jnlp_testsengine/net/sourceforge/jnlp/browsertesting/BrowserFactory.java: (BrowserFactory) added slipped cases for creating Epiphany and Midori singletons 2012-06-26 Jiri Vanek * Makefile.am: Most crucial variables exported to be used by custom Makefiles (CUSTOM_REPRODUCERS): new variable to hold custom name (ALL_NONCUSTOM_REPRODUCERS): new variable for gathering all except custom reproducers (ALL_REPRODUCERS): now contains also custom ones (stamps/junit-jnlp-dist-dirs): now depends also on junit-jnlp-dist-custom.txt (junit-jnlp-dist-custom.txt): new target scanning for directories in jnlp_tests/custom and saving them as list for future purposes. (stamps/netx-dist-tests-prepare-reproducers.stamp): and ( stamps/change-dots-to-paths.stamp):iterate through ALL_NONCUSTOM_REPRODUCERS instead of ALL__REPRODUCERS (stamps/process-custom-reproducers.stamp) : new target for iterating by junit-jnlp-dist-custom.txt through jnlp_tests/custom/srcs* and launching make prepare-reproducer in each. (clean-custom-reproducers): same as above but launching make clean-reproducer (run-netx-dist-tests) now depends on stamps/process-custom-reproducers.stamp (clean-netx-dist-tests): now depends on clean-custom-reproducers and is removing stamps/netx-dist-tests-copy-resources.stamp (stamps/netx-dist-tests-copy-resources.stamp): new target extracting copying of resources from stamps/netx-dist-tests-compile-testcases.stamp * tests/jnlp_tests/README: described this mechanism a bit 2012-06-26 Jiri Vanek Reproducer for classes which should be loaded before verification but are not * tests/jnlp_tests/signed/InternalClassloaderWithDownloadedResource/resources/InternalClassloaderWithDownloadedResource-applet-hack.jnlp jnlp launcher of applet variant with injecting new url to classlaoder * tests/jnlp_tests/signed/InternalClassloaderWithDownloadedResource/resources/InternalClassloaderWithDownloadedResource-applet-new.jnlp jnlp launcher of applet variant with custom classlaoder * tests/jnlp_tests/signed/InternalClassloaderWithDownloadedResource/resources/InternalClassloaderWithDownloadedResource-hack.html html launcher of applet variant with injecting new url to classlaoder * tests/jnlp_tests/signed/InternalClassloaderWithDownloadedResource/resources/InternalClassloaderWithDownloadedResource-hack.jnlp jnlp launcher of application variant with injecting new url to classlaoder * tests/jnlp_tests/signed/InternalClassloaderWithDownloadedResource/resources/InternalClassloaderWithDownloadedResource-new.html html launcher of applet variant with custom classlaoder * tests/jnlp_tests/signed/InternalClassloaderWithDownloadedResource/resources/InternalClassloaderWithDownloadedResource-new.jnlp jnlp launcher of application variant with custom classlaoder * tests/jnlp_tests/signed/InternalClassloaderWithDownloadedResource/srcs/InternalClassloaderWithDownloadedResource.java: Both application and applet reproducing behavior of this bug * tests/jnlp_tests/signed/InternalClassloaderWithDownloadedResource/testcases/InternalClassloaderWithDownloadedResourceTest.java: Testcase launching jnlp application, jnlp applet and html applet 2012-06-26 Jiri Vanek Last hope for not downloaded resources to be verified * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: (getCodeSourceSecurity): will now try to download and verify resource which was downloaded outside of netx. (alreadyTried) set for memory of once tried resources to not try again 2012-06-25 Adam Domurad Small comment cleanup to classes with missing or wrong descriptions. * plugin/icedteanp/java/sun/applet/PluginMessageHandlerWorker.java: Comment at top fixed * plugin/icedteanp/java/sun/applet/AppletSecurityContextManager.java: Same * plugin/icedteanp/java/sun/applet/PluginException.java: Same * plugin/icedteanp/java/sun/applet/PluginCallRequestFactory.java: Same * netx/net/sourceforge/jnlp/PluginBridge.java: Add class description. * plugin/icedteanp/java/sun/applet/PluginCallRequest.java: Removed FIXME that had already been fixed. 2012-06-25 Adam Domurad Allow passing of plugin tables and browser tables in NP_Initialize that are not the expected length but still large enough for our purposes. * plugin/icedteanp/IcedTeaNPPlugin.cc (initialize_browser_functions): New function to check size of passed browser function table, and initialize 'browser_functions' global variable. (initialize_plugin_table): New function to check size of passed plugin function table, and initialize proper plugin callbacks. (NP_Initialize): Make use of initialization helper functions, get rid of old size tests and error if the helper functions fail. 2012-06-20 Adam Domurad * netx/net/sourceforge/jnlp/tools/JarCertVerifier.java (verifyJar): two for loops made into for-each loops 2012-06-19 Jiri Vanek various test for browser engine * tests/jnlp_tests/simple/AppletTest/resources/appletAutoTests.html: fixed missing parenthesis * tests/jnlp_tests/simple/AppletTest/resources/appletAutoTests2.html: new test excluding XslowX for applets * tests/jnlp_tests/simple/AppletTest/testcases/AppletTestTests: (doubleChrome) test for ensuring that two chrome browsers launched behind themselves will not cause errors as they were without criticalFixes patch (AppletInBrowserTest) and (AppletInBrowserTestXslowX) testing methods for all browser * tests/jnlp_tests/simple/AppletTest/testcases/AppletBaseURLTest: * tests/jnlp_tests/simple/AppletTest/testcases/CheckServicesTests: * tests/jnlp_tests/simple/AppletTest/testcases/AppletReadsInvalidJarTests: Included @TestInBrowser instead of plain executeBrowser * tests/jnlp_tests/simple/deadlocktest/srcs/DeadlockTest.java: improved to print sometimes something out * tests/jnlp_tests/simple/deadlocktest/testcases/DeadLockTestTest.java: (testDeadLockTestTerminatedBody) enhanced to ensure that not so much is lost when process is terminated, but showing that something can be lost (which is correct) * tests/netx/jnlp_testsengine/net/sourceforge/jnlp/ResourcesTest.java: (testNonExisitngBrowserWillNotDeadlock) testing taht when no browser is set, then no deadlock happens as happen before criticalFixes's deadlyException (testUnexistingProcessWillFailRecognizedly) is actually testing deadlyException (testNonExisitngBrowserWillNotCauseMess) some but with annotation which was also harming output of tool little bit without TestInBrowsersAnnotation fixed. (testBrowsers2) is testing all browsers configuration without annotation and (testBrowser3) do the same configuration tests annotation driven (testBrowser) body of above two methods. Is testing whether used browsers are correctly linked with latest build (testBrowsers1) is testing parsing of -D variable (testListeners) annotated that needs display * tests/netx/unit/net/sourceforge/jnlp/runtime/CodeBaseClassLoaderTest.java: annotated with Bug annotation 2012-06-19 Jiri Vanek introduced possibility to run comfortably applets+html reproducers * Makefile.am: used BROWSER_TESTS_MODIFICATION variable to pass global switch from configure * acinclude.m4: (IT_SET_GLOBAL_BROWSERTESTS_BHAVIOUR) new method handling --with-browser-tests * configure.ac: used IT_SET_GLOBAL_BROWSERTESTS_BHAVIOUR switch and passing BROWSER_TESTS_MODIFICATION variable to Makefile. * tests/netx/jnlp_testsengine/net/sourceforge/jnlp/ServerAccess.java: (currentBrowser) variable holding injected browser for ServerAccess instance (loggedBrowser) static variable keeping id of (currentBrowser) for static logging purposes (modifyMethodWithForBrowser) new function changing the name of method to "method - browser" for logging purposes (getBrowserLocation) - returning path to process to be launched when browser requested (getBrowserParams) - gathering set default's browser settings (set/getCurrentBrowsers) - set browser by id/return id of set browser (set/getCurrentBrowser) - set browser instance /returns instance of current browser (executeBrowser) family of methods now cooperate with above methods for default set browser (executeBrowser(Browser) family to work with implicit browser * tests/netx/jnlp_testsengine/net/sourceforge/jnlp/annotations/TestInBrowsers.java: annotation for determining which browser(s) to use with annotated method * tests/netx/jnlp_testsengine/net/sourceforge/jnlp/browsertesting/Browser.java: interface for dealing with various browsers * tests/netx/jnlp_testsengine/net/sourceforge/jnlp/browsertesting/BrowserFactory.java: singleton for mapping configured browsers x requested browser x browsers proxies * tests/netx/jnlp_testsengine/net/sourceforge/jnlp/browsertesting/BrowserTest.java: Forefather of all testcases which have methods to do tests iniside browser. Is allowing correct annotation -> proxy trasnver to VirtualServer for selected method and is requesting custom runner from junit framework * tests/netx/jnlp_testsengine/net/sourceforge/jnlp/browsertesting/BrowserTestRunner.java: custom test Ruuner which is responsible for translating annotation and run the method mutlipletimes for each requested browser and to name it properly * tests/netx/jnlp_testsengine/net/sourceforge/jnlp/browsertesting/Browsers.java: enumeration of abstract browsers and theirs sets or subsets. * tests/netx/jnlp_testsengine/net/sourceforge/jnlp/browsertesting/browsers/*: individual browsers proxies and theirs abstractions,namely: * tests/netx/jnlp_testsengine/net/sourceforge/jnlp/browsertesting/browsers/Opera.java: * tests/netx/jnlp_testsengine/net/sourceforge/jnlp/browsertesting/browsers/Firefox.java: * tests/netx/jnlp_testsengine/net/sourceforge/jnlp/browsertesting/browsers/Chrome.java: * tests/netx/jnlp_testsengine/net/sourceforge/jnlp/browsertesting/browsers/Chromium.java: * tests/netx/jnlp_testsengine/net/sourceforge/jnlp/browsertesting/browsers/Midori.java: * tests/netx/jnlp_testsengine/net/sourceforge/jnlp/browsertesting/browsers/Epiphany.java: proxies for browsers as name suggests * tests/netx/jnlp_testsengine/net/sourceforge/jnlp/browsertesting/browsers/LinuxBrowser.java: abstract forefather for all browsers implementing Browser interface. Is setting /usr/bin as bin path, libjavaplugin.so as default plugin library name, intorducing stubs for methods (eg 32/64 bit libs) * tests/netx/jnlp_testsengine/net/sourceforge/jnlp/browsertesting/browsers/MozillaFamilyLinuxBrowser: forefather for all browsers except Opera. Is unifying .mozilla/plugins directories 2012-06-15 Jiri Vanek * tests/jnlp_tests/simple/AppletTest/resources/appletAutoTests.html: Added quotes around parameters of html applet tag. * tests/jnlp_tests/simple/deadlocktest/testcases/DeadLockTestTest.java: Output verification is counting with repeated and probably unfinished outputs. * tests/jnlp_tests/simple/deadlocktest/srcs/DeadlockTest.java Is now printing out sentence in intervals to avoid destroy-consume as much as possible * tests/netx/unit/net/sourceforge/jnlp/runtime/CodeBaseClassLoaderTest.java: Added bug annotation with threads on distro-pkg-dev 2012-06-15 Adam Domurad Fixed two memory leaks * plugin/icedteanp/IcedTeaNPPlugin.cc (consume_message): Call to g_strsplit matched with call to g_strfreev. * plugin/icedteanp/IcedTeaPluginUtils.cc (post): Removed copy of string, which assumed consumer freed string (which was not true and not always possible) 2012-06-11 Danesh Dadachanji PR855: AppletStub getDocumentBase() doesn't return full URL * NEWS: Added PR855 entry. * plugin/icedteanp/IcedTeaNPPlugin.cc (plugin_get_documentbase): Assign documentbase_copy directly to href's value instead of iterating through the segments to remove the file from the path. * tests/jnlp_tests/simple/AppletBaseURLTest/srcs/AppletBaseURL.java: * tests/jnlp_tests/simple/AppletBaseURLTest/testcases/AppletBaseURLTest.java: * tests/jnlp_tests/simple/AppletBaseURLTest/resources/AppletBaseURLTest.html: * tests/jnlp_tests/simple/AppletBaseURLTest/resources/AppletBaseURLTest.jnlp: * tests/jnlp_tests/simple/AppletBaseURLTest/resources/AppletJNLPHrefBaseURLTest.html: New reproducer that checks the URLS that document and codebase point are correct. 2012-06-13 Danesh Dadachanji Update CheckServices reproducer to handle browser testcase. * tests/jnlp_tests/simple/CheckServices/testcases/CheckServicesTests.java: Added browser test and annotation, refactored asserts into helper method. * tests/jnlp_tests/simple/CheckServices/resources/CheckPluginServices.html: New browser test file that runs applet using jnlp_href. 2012-06-13 Jiri Vanek * tests/junit-runner/JunitLikeXmlOutputListener.java: Introduced TEST_IGNORED_ATTRIBUTE to mark test as ignored if should be. * tests/report-styles/jreport.xsl: Applied correct text and style for tests with attribute ignored. 2012-06-12 Adam Domurad Fixes PR722, javaws failing to run with unsigned content in META-INF/ * NEWS: Added entry: Fixes PR722 * netx/net/sourceforge/jnlp/tools/JarCertVerifier.java: Changed isSignatureRelated => isMetaInfFile. Now all files under META-INF/ are disregarded in checking the jar signage. 2012-06-11 Jiri Vanek Implemented xml logging backend * Makefile.am: (stamps/run-netx-unit-tests.stamp) and (stamps/run-netx-dist-tests.stamp) removed redirection of streams as logging is now done in ServerAccess tests extensions added xsltproc execution above generated xml log xsltproc generating results html files is now receiving result of above as parameter * tests/report-styles/jreport.xsl: log parameter is now accepted, and if set, then all tests are linking into specified file to show the log * tests/report-styles/report.css: added styles for new links * tests/report-styles/index.js: new functions to work for result of below sheet * tests/report-styles/logs.xsl: new file, sheet to convert xml log to html file * tests/report-styles/output.css: new file, styles of above html file * tests/jnlp_tests/simple/deadlocktest/testcases/DeadLockTestTest.java: * tests/netx/jnlp_testsengine/net/sourceforge/jnlp/ResourcesTest.java: * tests/netx/jnlp_testsengine/net/sourceforge/jnlp/ServerAccess.java: Tests', server's and ProcessAssasin's logs are now redirected to bottleneck * tests/netx/jnlp_testsengine/net/sourceforge/jnlp/ServerAccess.java: (LOGS_REPRINT) flag for debugging purposes, will enable reprinting to stdout/err again (DEFAULT_LOG_FILE ) default name of xml output (DEFAULT_STDERR_FILE)(DEFAULT_STDOUT_FILE)(DEFAULT_STDLOGS_FILE) default values of plain text output files (*ELEMENT) and( (*ATTRIBUTE) variables keeping repeated names of xml output parts (writeXmlLog) method called from Sytsem.hook to save xml log (addToXmlLog) method to record item to xml structure (TestsLogs) and (LogItem) inner classes to keep logging information (log) is now reprinting message with id to std out/err dependently on (LOGS_REPRINT) but always to internal streams, possilbe exception is thrown (logException) new method, shortcut to log exception in same way as message (getTestMethod) now can handle methods inside ServerAccess class too 2012-06-11 Adam Domurad * NEWS: Added mention of fixing PR518 2012-06-07 Saad Mohammad Allows the user to configure browser paths and/or disable browsers. * acinclude.m4 (IT_FIND_BROWSER): Checks if the browser is set to be disabled, or if the path provided is valid. Otherwise, it locates the default path to the browser if found on the system. * configure.ac: Uses IT_FIND_BROWSER to find/configure browsers. 2012-06-06 Deepak Bhole * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java (getAccessControlContextForClassLoading): Iterate over codebase URLs only if codeBaseLoader is not null. 2012-06-05 Deepak Bhole PR861: Allow loading from non codebase hosts. Allow code to connect to hosting server. * netx/net/sourceforge/jnlp/SecurityDesc.java (getSandBoxPermissions): Only add host if it is not empty. * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java (getPermissions): Add SocketPermission for code source host. (findLoadedClassAll): Call super methods privileged so that connection to non codebase hosts can be made. (findClass): Same. (findResourcesBySearching): Same. Also use privileged context for enum operations because the enum is defined on the fly by URLClassLoader and checks for hosting server connectivity via next(). (getAccessControlContextForClassLoading): New method. Returns a control context for classloader operations like find/load/etc. (CodeBaseClassLoader::findClass): Call super methods privileged so that connection to non codebase hosts can be made. (CodeBaseClassLoader::findResource): Same. 2012-06-05 Jiri Vanek * tests/netx/jnlp_testsengine/net/sourceforge/jnlp/annotations/KnownToFail.java New file. Annotation for marking failing tests. * tests/report-styles/jreport.xsl: * tests/junit-runner/LessVerboseTextListener.java: * tests/junit-runner/JunitLikeXmlOutputListener.java: Added counting and printing of @KnownToFail annotations if presented. * tests/jnlp_tests/simple/Spaces can be everywhere/testcases/SpacesCanBeEverywhereTests.java: (SpacesCanBeEverywhereRemoteTests1) (SpacesCanBeEverywhereRemoteTests2) (SpacesCanBeEverywhereRemoteTests3) * tests/netx/unit/net/sourceforge/jnlp/JNLPMatcherTest.java: (testTemplateCDATA) (testApplicationCDATA) * tests/netx/unit/net/sourceforge/jnlp/ParserCornerCases.java: (testCDataFirstChild) (testCDataSecondChild) (testCommentInAttributes) * tests/netx/unit/net/sourceforge/jnlp/ParserMalformedXml.java: (testMalformedArguments) (testTagNotClosed) (testUnquotedAttributes) marked as KnownToFail 2012-06-05 Jiri Vanek isDateInRange renamed to isDateInRange_internallForIcedTeaWebTesting * netx/net/sourceforge/jnlp/runtime/pac-funcs.js: and * tests/netx/pac/pac-funcs-test.js: (isDateInRange): Renamed to isDateInRange_internallForIcedTeaWebTesting. (isDateInRange_internallForIcedTeaWebTesting): New function 2012-06-04 Saad Mohammad Added signed jnlp file tests. * tests/jnlp_tests/signed/SignedJnlpApplication/resources/SignedJnlpApplication1.jnlp: Launching jnlp file that matches the signed jnlp application file. * tests/jnlp_tests/signed/SignedJnlpApplication/resources/SignedJnlpApplication2.jnlp: * tests/jnlp_tests/signed/SignedJnlpApplication/resources/SignedJnlpApplication3.jnlp: Launching jnlp file that does not match the signed jnlp application file. * tests/jnlp_tests/signed/SignedJnlpApplication/srcs/JNLP-INF/APPLICATION.jnlp: Signed jnlp application file. * tests/jnlp_tests/signed/SignedJnlpApplication/srcs/SignedJnlpApplication.java: A simple java class that outputs a string. * tests/jnlp_tests/signed/SignedJnlpApplication/testcases/SignedJnlpApplicationTest.java: Testcase that tests the launching of applications with a signed jnlp application file. * tests/jnlp_tests/signed/SignedJnlpTemplate/resources/SignedJnlpTemplate1.jnlp: Launching jnlp file that matches the signed jnlp application template file. * tests/jnlp_tests/signed/SignedJnlpTemplate/resources/SignedJnlpTemplate2.jnlp: * tests/jnlp_tests/signed/SignedJnlpTemplate/resources/SignedJnlpTemplate3.jnlp: Launching jnlp file that does not match the signed jnlp application template file. * tests/jnlp_tests/signed/SignedJnlpTemplate/srcs/JNLP-INF/APPLICATION_TEMPLATE.jnlp: Signed jnlp application template file. * tests/jnlp_tests/signed/SignedJnlpTemplate/srcs/SignedJnlpTemplate.java: A simple java class that outputs a string. * tests/jnlp_tests/signed/SignedJnlpTemplate/testcases/SignedJnlpTemplateTest.java: Testcase that tests the launching of applications with a signed jnlp application template file. * tests/jnlp_tests/simple/UnsignedJnlpApplication/resources/UnsignedJnlpApplication1.jnlp: Launching jnlp file that matches the unsigned jnlp application file. * tests/jnlp_tests/simple/UnsignedJnlpApplication/resources/UnsignedJnlpApplication2.jnlp: * tests/jnlp_tests/simple/UnsignedJnlpApplication/resources/UnsignedJnlpApplication3.jnlp: Launching jnlp file that does not match the unsigned jnlp application file. * tests/jnlp_tests/simple/UnsignedJnlpApplication/srcs/JNLP-INF/APPLICATION.jnlp: Unsigned jnlp application file. * tests/jnlp_tests/simple/UnsignedJnlpApplication/srcs/UnsignedJnlpApplication.java: A simple java class that outputs a string. * tests/jnlp_tests/simple/UnsignedJnlpApplication/testcases/UnsignedJnlpApplicationTest.java: Testcase that tests the launching of applications with an unsigned jnlp application file. * tests/jnlp_tests/simple/UnsignedJnlpTemplate/resources/UnsignedJnlpTemplate1.jnlp: Launching jnlp file that matches the unsigned jnlp application template file. * tests/jnlp_tests/simple/UnsignedJnlpTemplate/resources/UnsignedJnlpTemplate2.jnlp: * tests/jnlp_tests/simple/UnsignedJnlpTemplate/resources/UnsignedJnlpTemplate3.jnlp: Launching jnlp file that does not match the unsigned jnlp application template file. * tests/jnlp_tests/simple/UnsignedJnlpTemplate/srcs/JNLP-INF/APPLICATION_TEMPLATE.jnlp: Unsigned jnlp application template file. * tests/jnlp_tests/simple/UnsignedJnlpTemplate/srcs/UnsignedJnlpTemplate.java: A simple java class that outputs a string. * tests/jnlp_tests/simple/UnsignedJnlpTemplate/testcases/UnsignedJnlpTemplateTest.java: Testcase that tests the launching of applications with an unsigned jnlp application template file. * tests/jnlp_tests/signed/SignedJnlpCaseTestOne/resources/SignedJnlpCaseTestOne1.jnlp: Launching jnlp file that matches the signed jnlp application file. * tests/jnlp_tests/signed/SignedJnlpCaseTestOne/resources/SignedJnlpCaseTestOne2.jnlp: Launching jnlp file that does not match the signed jnlp application file. * tests/jnlp_tests/signed/SignedJnlpCaseTestOne/srcs/JNLP-INF/aPpLiCaTioN.jnlp: Signed jnlp application file. * tests/jnlp_tests/signed/SignedJnlpCaseTestOne/srcs/SignedJnlpCase.java: A simple java class that outputs a string. * tests/jnlp_tests/signed/SignedJnlpCaseTestOne/testcases/SignedJnlpCaseOneTest.java: Testcase that tests the case-sensitivity of the signed jnlp application's filename. * tests/jnlp_tests/signed/SignedJnlpCaseTestTwo/resources/SignedJnlpCaseTestTwo1.jnlp: Launching jnlp file that matches the signed jnlp application template file. * tests/jnlp_tests/signed/SignedJnlpCaseTestTwo/resources/SignedJnlpCaseTestTwo2.jnlp: Launching jnlp file that does not match the signed jnlp application template file. * tests/jnlp_tests/signed/SignedJnlpCaseTestTwo/srcs/JNLP-INF/aPpLiCaTiOn_tEmPlAte.jnlp: Signed jnlp application template file. * tests/jnlp_tests/signed/SignedJnlpCaseTestTwo/srcs/SignedJnlpCase.java: A simple java class that outputs a string. * tests/jnlp_tests/signed/SignedJnlpCaseTestTwo/testcases/SignedJnlpCaseTwoTest.java: Testcase that tests the case-sensitivity of the signed jnlp application template's filename. 2012-06-04 Danesh Dadachanji Fix to handle absolute paths passed into jnlp_href's value. * netx/net/sourceforge/jnlp/PluginBridge.java (PluginBridge): Uses context of codebase to evaluate jnlp_href's value. Uses JNLPCreator's create method to make new JNLPFile variables. New constructor that wraps around the original one, creating a new JNLPCreator to use. * netx/net/sourceforge/jnlp/JNLPCreator.java: New strategy pattern class to be used to wrap around the creation of a JNLPFile. Replace this creator when unit testing to skip running parsing code. * tests/netx/unit/net/sourceforge/jnlp/PluginBridgeTest.java: New class to unit test getEvaluatedJNLPHref. 2012-06-04 Adam Domurad Added self to AUTHORS. This patch fixes PR518, ensures null termination of strings based off of NPVariant results. * plugin/icedteanp/IcedTeaPluginUtils.h: Added declaration of NPVariantAsString * plugin/icedteanp/IcedTeaPluginUtils.cc (NPVariantAsString): New. Converts an NPVariant to a std::string, assumes it is a valid NPString. (isObjectJSArray): Now uses NPVariantAsString, minor cleanup. * plugin/icedteanp/IcedTeaJavaRequestProcessor.cc (plugin_get_documentbase): Now uses NPVariantAsString. * plugin/icedteanp/IcedTeaNPPlugin.cc (NPVariantToString): Now uses NPVariantAsString, minor cleanup. 2012-06-01 Deepak Bhole PR863: Error passing strings to applet methods in Chromium * plugin/icedteanp/IcedTeaJavaRequestProcessor.cc (createJavaObjectFromVariant): Account for length of the characters. * plugin/icedteanp/IcedTeaNPPlugin.cc (plugin_get_documentbase): Same. * plugin/icedteanp/IcedTeaPluginRequestProcessor.cc (_eval): Print the string's c_str rather than utf8characters. * plugin/icedteanp/IcedTeaPluginUtils.cc (printNPVariant): Account for length of the characters. (NPVariantToString): Same. (isObjectJSArray): Same. 2012-05-30 Jiri Vanek Enabled multiple certificates and extracted variables * Makefile.am: EXPORTED_TEST_CERT by EXPORTED_TEST_CERT_PREFIX and EXPORTED_TEST_CERT_SUFFIX for further composition SIGNED_REPRODUCERS new variable for iterating through signed reproducers SIMPLE_REPRODUCERS new variable for iterating through simple reproducers ALL_REPRODUCER new variable for iterating through all reproducers (junit-jnlp-dist-signed.txt) replaced by (stamps/junit-jnlp-dist-signed.stamp) which generates junit-jnlp-dist-signedX.txt for each directory with signed reproducers (stamps/netx-dist-tests-prepare-reproducers.stamp) (stamps/change-dots-to-paths.stamp) (stamps/netx-dist-tests-compile-testcases.stamp) (run-netx-dist-codecoverage): extracted variables (clean-netx-dist-tests): iterates through all the list and removes them (stamps/netx-dist-tests-sign-some-reproducers.stamp): now iterate through SIGNED_REPRODUCERS and creates special certificate for each member. Each jar from this directory is then signed by corresponding certificate (netx-dist-tests-remove-cert-from-public): iterates through all certificates (stamps/netx-dist-tests-import-cert-to-public): exports each certificate created during tests preparations ($(EXPORTED_TEST_CERT)) replaced by stamps/exported-test-certs.stamp which create for each of SIGNED_REPRODUCERS individual certificate (tests/jnlp_tests/README): mentioned possibility of multiple certificate 2012-05-29 Jiri Vanek * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: (getPermissions): New rethrow of exceptions and following condition make more accurate. 2012-05-29 Jiri Vanek Get rid of repeated sout/serr in reproducers testcases/unit tests and introduce bottleneck for loging. * tests/netx/jnlp_testsengine/net/sourceforge/jnlp/ServerAccess.java: (PROCESS_LOG) static flag for enabling/disabling automatic logging of statically executed processes. (logErrorReprint) (logOutputReprint) (logNoReprint) new methods, to call logging bottleneck. (log) main logging bottleneck, reprint message to according stream with calling test-class and test-method as suffix. (getTestMethod) new method to analyze calling test-method. (executeProcess) enhanced for conditional automatic logging of start of process and outputs of process. * tests/jnlp_tests/signed/AppletTestSigned/testcases/AppletTestSignedTests.java: * tests/jnlp_tests/signed/CacheReproducer/testcases/CacheReproducerTest.java: * tests/jnlp_tests/signed/MissingJar/testcases/MissingJarTest.java: * tests/jnlp_tests/signed/ReadPropertiesSigned/testcases/ReadPropertiesSignedTest.java: * tests/jnlp_tests/signed/Spaces can be everywhere signed/testcases/SpacesCanBeEverywhereTestsSigned.java: * tests/jnlp_tests/simple/AccessClassInPackage/testcases/AccessClassInPackageTest.java: * tests/jnlp_tests/simple/AddShutdownHook/testcases/AddShutdownHookTest.java: * tests/jnlp_tests/simple/AllStackTraces/testcases/AllStackTracesTest.java: * tests/jnlp_tests/simple/AppletTest/testcases/AppletTestTests.java: * tests/jnlp_tests/simple/CheckServices/testcases/CheckServicesTests.java: * tests/jnlp_tests/simple/CreateClassLoader/testcases/CreateClassLoaderTest.java: * tests/jnlp_tests/simple/InformationTitleVendorParser/testcases/InformationTitleVendorParserTest.java: * tests/jnlp_tests/simple/ManifestedJar1/testcases/ManifestedJar1Test.java: * tests/jnlp_tests/simple/ReadEnvironment/testcases/ReadEnvironmentTest.java: * tests/jnlp_tests/simple/ReadProperties/testcases/ReadPropertiesTest.java: * tests/jnlp_tests/simple/RedirectStreams/testcases/RedirectStreamsTest.java: * tests/jnlp_tests/simple/ReplaceSecurityManager/testcases/ReplaceSecurityManagerTest.java: * tests/jnlp_tests/simple/SetContextClassLoader/testcases/SetContextClassLoaderTest.java: * tests/jnlp_tests/simple/Spaces can be everywhere/testcases/SpacesCanBeEverywhereTests.java: * tests/jnlp_tests/simple/deadlocktest/testcases/DeadLockTestTest.java: * tests/jnlp_tests/simple/simpletest1/testcases/SimpleTest1Test.java: * tests/jnlp_tests/simple/simpletest2/testcases/SimpleTest2Test.java: * tests/netx/unit/net/sourceforge/jnlp/cache/CacheLRUWrapperTest.java: * tests/netx/unit/net/sourceforge/jnlp/runtime/CodeBaseClassLoaderTest.java: * tests/netx/unit/net/sourceforge/jnlp/util/replacements/BASE64EncoderTest.java: all System.out replaced by ServerAccess.logOutputReprint and System.err replaced by ServerAccess.logErrorReprint 2012-05-25 Adam Domurad Changed for-loops over iterators and indices to for-each loops if they were sufficient and clearer. * netx/net/sourceforge/jnlp/JNLPFile.java: Changed for-loops that could be expressed more clearly as for-each loops. * netx/net/sourceforge/jnlp/PluginBridge.java: Same * netx/net/sourceforge/jnlp/ResourcesDesc.java: Same * netx/net/sourceforge/jnlp/cache/CacheUtil.java: Same * netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java: Same * netx/net/sourceforge/jnlp/cache/Resource.java: Same * netx/net/sourceforge/jnlp/cache/ResourceTracker.java: Same * netx/net/sourceforge/jnlp/runtime/AppletEnvironment.java: Same * netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java: Same * plugin/icedteanp/java/netscape/javascript/JSObject.java: Same * plugin/icedteanp/java/sun/applet/JavaConsole.java: Same * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java: Same 2012-05-23 Adam Domurad Removed instances of snprintf where buffer size was not known. Added buffer size constant for allocating buffers for numeric conversions. * plugin/icedteanp/IcedTeaNPPlugin.cc: Removed usage of snprintf for simple blanking of strings. Buffer size was misguided previously. Used NUM_STR_BUFFER_SIZE constant to replace magic numbers/ * plugin/icedteanp/IcedTeaPluginUtils.cc: Made NPVariantToString(NPVariant variant, std::string* result) use two space indentation. Used NUM_STR_BUFFER_SIZE constant to replace magic numbers. * plugin/icedteanp/IcedTeaPluginUtils.h: Added constant, NUM_STR_BUFFER_SIZE. 2012-05-24 Danesh Dadachanji Fix use of src dir instead of build dir when whitelisting. * Makefile.am (REPRODUCERS_CLASS_WHITELIST): Use abs_top_srcdir instead of abs_top_builddir. 2012-05-23 Martin Olsson * plugin/icedteanp/IcedTeaPluginUtils.cc: Tiny fixup for changeset 383; don't do free(stack_variable). 2012-05-20 Jiri Vanek Reproducers engine enhanced for jars in subdirectories by "." naming convention * Makefile.am: (stamps/change-dots-to-paths.stamp) new target to copy jars with dots (.jar omitted) to the java-like package/directory structure in jnlp_test_server (EXPORTED_TEST_CERT) now depends on stamps/change-dots-to-paths.stamp (clean-netx-dist-tests) removes stamps/change-dots-to-paths.stamp too. 2012-05-24 Jiri Vanek Introduced whitelist for reproducers * netx-dist-tests-whitelist: new file, contains regular expressions (separated by space) for expr to select testcases which only will be run. By default set to all by expression .* * Makefile.am: (REPRODUCERS_CLASS_NAMES) When class with testcases is going to be included in list, it is at first check for match in whitelist. If there is no match, will not be included. 2012-05-24 Martin Olsson * plugin/icedteanp/IcedTeaPluginUtils.cc: Fix two typos. 2012-05-23 Deepak Bhole * AUTHORS: Added Martin Olsson to list. 2012-05-23 Martin Olsson * plugin/icedteanp/IcedTeaNPPlugin.cc: Use g_mutex_free instead of g_free to free appletviewer_mutex (fixes crash). 2012-05-23 Deepak Bhole * ChangeLog: Converted spaces to tabs in an older entry 2012-05-23 Jiri Vanek * netx/net/sourceforge/jnlp/resources/Messages.properties: fixed error in PBadNonrelativeUrl 2012-05-23 Jiri Vanek Added more debugging outputs * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: (getCodeSourceSecurity): added output message when no SecurityDesc is found for some url/resource * netx/net/sourceforge/jnlp/resources/Messages.properties: added LNoSecInstance and LCertFoundIn values * netx/net/sourceforge/jnlp/security/KeyStores.java: (getPathToKeystore): new method, able to search for file used for creating of KeyStore if possible * netx/net/sourceforge/jnlp/security/CertificateUtils.java: (inKeyStores) using getPathToKeystore for debug output 2012-05-23 Jiri Vanek * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: (getPermissions): Any exception from this method is consumed somewhere. I have cough exception, reprint it in debug mode and re-throw (to be lost). Main condition in this method had several possible NullPointer exceptions. Separated and thrown before this condition. 2012-05-23 Jiri Vanek Enhanced about dialog * extra/net/sourceforge/javaws/about/Main.java: Main frame and Main tab renamed from "About NetX" to "About IcedTea-Web and NetX". * extra/net/sourceforge/javaws/about/resources/about.html: mentioned IcedTea-Web. * extra/net/sourceforge/javaws/about/resources/notes.html: List of authors synchronized with AUTHORS, mentioned classpath's IcedTea-Web as homepage of IcedTea-web. 2012-05-23 Jiri Vanek Fixed error in reproducers source preparation * Makefile.am: (stamps/netx-dist-tests-prepare-reproducers.stamp) removed inappropriately used quotes when copying notSrcFiles. Source files now copied only if src dir exists in reproducer 2012-05-22 Adam Domurad Changed allocation of small, fixed-size buffers to stack-based allocations. Changed occurences of sprintf to the safer function snprintf, added buffer information. While unlikely to change functionality, snprintf adds an extra check to prevent buffer overflows. * plugin/icedteanp/IcedTeaNPPlugin.cc: Allocation of small buffers using malloc changed to stack allocation & changed sprintf calls to buffer-size aware snprintf calls. * plugin/icedteanp/IcedTeaPluginUtils.cc: Same as above. 2012-05-22 Jiri Vanek * tests/jnlp_tests/signed/ReadPropertiesSigned/testcases/ReadPropertiesSignedTest.java: * tests/jnlp_tests/simple/AddShutdownHook/testcases/AddShutdownHookTest.java: * tests/jnlp_tests/simple/AllStackTraces/testcases/AllStackTracesTest.java: * tests/jnlp_tests/simple/CreateClassLoader/testcases/CreateClassLoaderTest.java: * tests/jnlp_tests/simple/ReadEnvironment/testcases/ReadEnvironmentTest.java: * tests/jnlp_tests/simple/ReadProperties/testcases/ReadPropertiesTest.java: * tests/jnlp_tests/simple/RedirectStreams/testcases/RedirectStreamsTest.java: * tests/jnlp_tests/simple/ReplaceSecurityManager/testcases/ReplaceSecurityManagerTest.java: * tests/jnlp_tests/simple/SetContextClassLoader/testcases/SetContextClassLoaderTest.java: All exact matches upon AccessControlException replaced by regular expression matching both jdk7 and jdk6 syntax 2012-05-21 Jiri Vanek * Makefile.am: mzilla-filesystem linking targets now counts also with midori and epiphany. Extracted duplicated entries to variables * configure.ac: added check for midori and epiphany 2012-05-21 Jiri Vanek Added detection of installed browsers and added targets to create symbolic links from install dir to browsers' plugin directories. Primarily for testing purposes * Makefile.am: (stamps/user-links.stamp) with alias (links) - new target for creating symlinks for all users. One must be root to execute this target. (stamps/global-links.stamp) with alias (user-links) - new target for creating symlinks for logged user only. Because opera is missing this feature, quite useless for testing or dependence targets, but good for live user. (restore-global-links): target for restoring original global links. One must be root again (restore-user-links): target for restoring user's links * configure.ac: added basic check whether and which browsers are installed 2012-05-18 Jiri Vanek Fixed behavior when encoded/characters needed encoding included in url * NEWS: mentioned PR811 * netx/net/sourceforge/jnlp/cache/CacheUtil.java: (urlEquals) Enhanced to be able compare encoded/decoded urls correctly. (notNullUrlEquals) new method to separate comparing of individual parts of url from null checks * netx/net/sourceforge/jnlp/cache/ResourceTracker.java: (addResource) is now encoding url if needed. (normalizeUrl) new method to encode path in url of all except file protocol. (normalizeChunk) New method for encoding of atomic piece. 2012-05-18 Jiri Vanek More tests for Spaces and characters in urls * netx/net/sourceforge/jnlp/cache/CacheLRUWrapper.java: and * netx/net/sourceforge/jnlp/cache/CacheUtil.java: for unit-tests purposes (cacheDir) make to point to tmp dir when no DeploymentConfiguration exists. * tests/jnlp_tests/signed/Spaces can be everywhere signed/: couple of new test doing the same as simple "Spaces can be everywhere" but are signed * tests/jnlp_tests/simple/Spaces can be everywhere/: added new test-cases and html/jnlp test files to try more combinations of encodable characters x launches * tests/netx/unit/net/sourceforge/jnlp/cache/ResourceTrackerTest.java: unittest for url encoder behavior * tests/netx/unit/net/sourceforge/jnlp/cache/CacheUtilTest.java: unittest for urlEquals function 2012-05-17 Adam Domurad Fixed uses of == to compare String objects to .equals where appropriate. Noted a non-obvious use of == to compare a 'magic' String reference. * netx/net/sourceforge/jnlp/JNLPFile.java: Changed calls that compare String contents from == to .equals * plugin/icedteanp/java/sun/applet/GetMemberPluginCallRequest.java: Same * plugin/icedteanp/java/sun/applet/PluginCallRequestFactory.java: Same * netx/net/sourceforge/jnlp/Version.java: Added comment explaining why == was used vs .equals 2012-05-14 Jiri Vanek * tests/netx/unit/net/sourceforge/jnlp/runtime/CodeBaseClassLoaderTest.java: * tests/netx/unit/net/sourceforge/jnlp/cache/CacheLRUWrapperTest.java: System.out replaced with System.err 2012-05-14 Jiri Vanek * tests/junit-runner/JunitLikeXmlOutputListener.java: fixed indentation and spacing 2012-05-11 Thomas Meyer * tests/netx/unit/net/sourceforge/jnlp/util/PropertiesFileTest.java: Add some unit tests for the PropertiesFile class * tests/netx/unit/net/sourceforge/jnlp/cache/CacheLRUWrapperTest.java: Add some unit tests for the CacheLRUWrapper class * netx/net/sourceforge/jnlp/util/PropertiesFile.java: Use last modification timestamp of the underlying file to lazy load properties. (load): Only reload file, if the file modification timestamp has changed. (store): Actually fsync() the file to disk. * netx/net/sourceforge/jnlp/services/XPersistenceService.java (create): Fix coding style * netx/net/sourceforge/jnlp/cache/CacheLRUWrapper.java (load): Only check data when the recently_used file was reloaded. 2012-05-02 Jiri Vanek Introduced new annotations Bug (to connect test/reproducer with documentation) and NeedsDisplay which tells the launching engine that this particular test needs Display. Based on ptisnovs's ideas and jtreg experiences * Makefile.am: (JUNIT_RUNNER_JAR), (stamps/run-netx-unit-tests.stamp) and (stamps/run-unit-test-code-coverage.stamp) are now dependent on (stamps/netx-dist-tests-compile) and classpaths inside them have been enriched for JNLP_TESTS_ENGINE_DIR which contains definitions of those annotations * tests/jnlp_tests/simple/CheckServices/testcases/CheckServicesTests.java: and * tests/jnlp_tests/simple/ManifestedJar1/testcases/ManifestedJar1Test.java: and * tests/jnlp_tests/simple/Spaces can be everywhere/testcase/SpacesCanBeEverywhereTests.java: filled Bug annotations * tests/junit-runner/JunitLikeXmlOutputListener.java: made to understand Bug annotation * tests/netx/jnlp_testsengine/net/sourceforge/jnlp/annotations/NeedsDisplay.java: and * tests/netx/jnlp_testsengine/net/sourceforge/jnlp/annotations/Bug.java: annotations definitions * tests/report-styles/jreport.xsl: made nice links from bug annotation prepared by JunitLikeXmlOutputListener 2012-04-24 Omair Majid * Makefile.am (RUNTIME): Add resources.jar. (stamps/run-unit-test-code-coverage.stamp) [WITH_EMMA]: Add resouces.jar to classpath. (stamps/run-reproducers-test-code-coverage.stamp) [WITH_EMMA]: Include resources.jar in classpath. (stamps/bootstrap-directory.stamp): Create a link to resources.jar in BOOT_DIR. 2012-04-19 Omair Majid PR918: java applet windows uses a low resulution black/white icon * NEWS: Update with fix. * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java: Remove windowIcon. (initialize): Do not call loadWindowIcon. (getWindowIcon): Remove. (setWindowIcon): Remove. (loadWindowIcon): Remove. * netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java (checkTopLevelWindow): Do not set the icon for all top level windows. Use the default java icon instead. * netx/net/sourceforge/jnlp/util/ImageResources.java: New file. Provides access to icons. * netx/net/sourceforge/jnlp/JNLPSplashScreen.java (JNLPSplashScreen), * netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java (getListener), * netx/net/sourceforge/jnlp/controlpanel/AdvancedProxySettingsDialog.java (AdvancedProxySettingsDialog), * netx/net/sourceforge/jnlp/controlpanel/CacheViewer.java (CacheViewer), * netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java (ControlPanel), * netx/net/sourceforge/jnlp/security/SecurityDialog.java (SecurityDialog), * netx/net/sourceforge/jnlp/security/viewer/CertificateViewer.java (CertificateViewer), * netx/net/sourceforge/jnlp/util/BasicExceptionDialog.java (show), * plugin/icedteanp/java/sun/applet/JavaConsole.java (initialize): Explicitly load icons. * tests/netx/unit/net/sourceforge/jnlp/util/ImageResourcesTest.java: Test for ImageResources class. 2012-04-18 Jiri Vanek Allowed signed applets in automatic reproducers tests * tests/jnlp_tests/signed/AppletTestSigned/resources/AppletTestSigned.html: html file for launching signed applet. Its style is different from the one for calling unsigned applets - red. * tests/jnlp_tests/signed/AppletTestSigned/resources/AppletTestSigned.jnlp: jnlp file for launched signed applet * tests/jnlp_tests/signed/AppletTestSigned/srcs/AppletTestSigned.java body of signed applet * tests/jnlp_tests/signed/AppletTestSigned/testcases/AppletTestSignedTests.java: (AppletTestSignedTest): testing method to launch signed applet in javaws (AppletTestSignedFirefoxTest): testing method to launch signed applet in browser * Makefile.am: PUBLIC_KEYSTORE_PASS, EXPORTED_TEST_CERT, TEST_CERT_ALIAS, PUBLIC_KEYSTORE PUBLIC_KEYSTORE_PASS: new global variables holding keystores' credentials (clean-local): clean-bootstrap-directory moved to be last one, as keytool is necessary for removing certificate (EXPORTED_TEST_CERT): new target exporting certificate from testing keystore (stamps/netx-dist-tests-import-cert-to-public): new target to import certificate to PUBLIC_KEYSTORE (netx-dist-tests-remove-cert-from-public): new target removing testing certificate from PUBLIC_KEYSTORE (clean-netx-dist-tests): now depends on netx-dist-tests-remove-cert-from-public and is removing EXPORTED_TEST_CERT file 2012-04-17 Jiri Vanek Rewritten DeadLockTestTest to stop failing in more then 1/2 of cases All assassinated processes were hanging as zombies, killed forcibly by kill -9 now. * /tests/jnlp_tests/simple/deadlocktest/testcases/DeadLockTestTest.java: (countJavaInstances) now return pids of found javas. (killDiff) new method killing zombie javas forcibly. 2012-04-11 Jiri Vanek * Makefile.am: EMMA_JAVA_ARGS, new variable for adjusting emma runs. Currently set to -Xmx2G. (stamps/run-unit-test-code-coverage.stamp), (stamps/run-reproducers-test-code-coverage.stamp), (run-test-code-coverage): Use EMMA_JAVA_ARGS in theirs emma runs. 2012-06-04 Jiri Vanek Thomas Meyer * makefile.am: (stamps/run-netx-dist-tests.stamp) and (run-reproducers-test-code-coverage.stamp) now using $(javaws) variable instead of plaintext javaws * netx/net/sourceforge/jnlp/cache/CacheLRUWrapper.java: (checkData) new method checking for sanity of cache entries (load) now checks for data sanity after loading, and stores without corrupted items if necessary (Comparator.compare) for sorting lru items. Now redundant checking for sanity removed * netx/net/sourceforge/jnlp/cache/CacheUtil.java: (getCacheFile) don't call lruHandler.store twice for new cache entries (getCacheFileIfExist) removed iteration and cleaning mechanism * netx/net/sourceforge/jnlp/resources/Messages.properties: modified cache messages * tests/jnlp_tests/signed/CacheReproducer/testcases/CacheReproducerTest.java Added test for checking corrupted path in entry and all tests adapted for exception thrown only in debug mode 2012-04-04 Danesh Dadachanji Change the name of JarSigner to JarCertVerifier to make it more relevant to the purpose of the file. * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java * netx/net/sourceforge/jnlp/tools/KeyStoreUtil.java: Replace all instances, paramaters and references of JarSigner by JarCertVerifier. * netx/net/sourceforge/jnlp/security/CertWarningPane.java * netx/net/sourceforge/jnlp/security/CertsInfoPane.java * netx/net/sourceforge/jnlp/security/MoreInfoPane.java * netx/net/sourceforge/jnlp/security/SecurityDialogs.java: Replaced all paramaters, references and variable names of JarSigner to CertVerifier to match the variable object type. * netx/net/sourceforge/jnlp/security/SecurityDialog.java (getJarSigner): Renamed to getCertVerifier as it returns the certVerfier instance. * netx/net/sourceforge/jnlp/tools/JarSigner.java: Renamed to JarCertVerifier. * netx/net/sourceforge/jnlp/tools/JarCertVerifier.java: The rename of JarSigner. 2012-04-05 Jiri Vanek Fixing issue when process was not launched at all and when was killed but left behind living/hanging, fixing mime-types * tests/netx/jnlp_testsengine/net/sourceforge/jnlp/ServerAccess.java: (getContentOfStream) this method overloaded with possibility to specify encoding (I needed to set it to ASCII in one test) (deadlyException) field introduced in ThreadedProcess to record exception caused by impassibility of launching the process. And so process have been null without any sign why. (TinyHttpdImpl) now correctly returns known mime types (ProcessAssasin) can now skip or smoothly (and finally correctly) destroy its process, and all his logging messages were done null-proof (as deadlyException now allows) Asynchronous (ContentReader) have been silenced when complaining about closed streams by Assassin. 2012-04-03 Danesh Dadachanji Change all vendors in JNLP test suite to IcedTea and homepage href's to a link to IcedTea-Web's wiki page. * tests/jnlp_tests/signed/AccessClassInPackageSigned/resources/AccessClassInPackageSignedJAVAXJNLP.jnlp * tests/jnlp_tests/signed/AccessClassInPackageSigned/resources/AccessClassInPackageSignedNETSF.jnlp * tests/jnlp_tests/signed/AccessClassInPackageSigned/resources/AccessClassInPackageSignedSELF.jnlp * tests/jnlp_tests/signed/AccessClassInPackageSigned/resources/AccessClassInPackageSignedSUNSEC.jnlp * tests/jnlp_tests/signed/CacheReproducer/resources/CacheReproducer1.jnlp * tests/jnlp_tests/signed/CacheReproducer/resources/CacheReproducer1_1.jnlp * tests/jnlp_tests/signed/CacheReproducer/resources/CacheReproducer2.jnlp * tests/jnlp_tests/signed/CacheReproducer/resources/CacheReproducer2_1.jnlp * tests/jnlp_tests/signed/MissingJar/resources/MissingJar.jnlp * tests/jnlp_tests/signed/MissingJar/resources/MissingJar2.jnlp * tests/jnlp_tests/signed/MissingJar/resources/MissingJar3.jnlp * tests/jnlp_tests/signed/MissingJar/resources/MissingJar4.jnlp * tests/jnlp_tests/signed/ReadPropertiesBySignedHack/resources/ReadPropertiesBySignedHack.jnlp * tests/jnlp_tests/signed/ReadPropertiesSigned/resources/ReadPropertiesSigned1.jnlp * tests/jnlp_tests/signed/ReadPropertiesSigned/resources/ReadPropertiesSigned2.jnlp * tests/jnlp_tests/signed/SimpletestSigned1/resources/SimpletestSigned1.jnlp * tests/jnlp_tests/simple/AccessClassInPackage/resources/AccessClassInPackageJAVAXJNLP.jnlp * tests/jnlp_tests/simple/AccessClassInPackage/resources/AccessClassInPackageNETSF.jnlp * tests/jnlp_tests/simple/AccessClassInPackage/resources/AccessClassInPackageSELF.jnlp * tests/jnlp_tests/simple/AccessClassInPackage/resources/AccessClassInPackageSUNSEC.jnlp * tests/jnlp_tests/simple/AddShutdownHook/resources/AddShutdownHook.jnlp * tests/jnlp_tests/simple/AllStackTraces/resources/AllStackTraces.jnlp * tests/jnlp_tests/simple/AppletTest/resources/AppletTest.jnlp * tests/jnlp_tests/simple/CheckServices/resources/CheckServices.jnlp * tests/jnlp_tests/simple/CreateClassLoader/resources/CreateClassLoader.jnlp * tests/jnlp_tests/simple/InformationTitleVendorParser/resources/TitleParser.jnlp * tests/jnlp_tests/simple/InformationTitleVendorParser/resources/TitleVendorParser.jnlp * tests/jnlp_tests/simple/InformationTitleVendorParser/resources/VendorParser.jnlp * tests/jnlp_tests/simple/ManifestedJar1/resources/ManifestedJar-1main2mainAppDesc.jnlp * tests/jnlp_tests/simple/ManifestedJar1/resources/ManifestedJar-1main2mainNoAppDesc.jnlp * tests/jnlp_tests/simple/ManifestedJar1/resources/ManifestedJar-1main2nothingNoAppDesc.jnlp * tests/jnlp_tests/simple/ManifestedJar1/resources/ManifestedJar-1mainHaveAppDesc.jnlp * tests/jnlp_tests/simple/ManifestedJar1/resources/ManifestedJar-1mainNoAppDesc.jnlp * tests/jnlp_tests/simple/ManifestedJar1/resources/ManifestedJar-1noAppDesc.jnlp * tests/jnlp_tests/simple/ManifestedJar1/resources/ManifestedJar-1noAppDescAtAll.jnlp * tests/jnlp_tests/simple/ManifestedJar1/resources/ManifestedJar-1nothing2nothingAppDesc.jnlp * tests/jnlp_tests/simple/ManifestedJar1/resources/ManifestedJar-1nothing2nothingNoAppDesc.jnlp * tests/jnlp_tests/simple/ReadEnvironment/resources/ReadEnvironment.jnlp * tests/jnlp_tests/simple/ReadProperties/resources/ReadProperties1.jnlp * tests/jnlp_tests/simple/ReadProperties/resources/ReadProperties2.jnlp * tests/jnlp_tests/simple/RedirectStreams/resources/RedirectStreams.jnlp * tests/jnlp_tests/simple/ReplaceSecurityManager/resources/ReplaceSecurityManager.jnlp * tests/jnlp_tests/simple/SetContextClassLoader/resources/SetContextClassLoader.jnlp * tests/jnlp_tests/simple/Spaces can be everywhere/resources/Spaces can be everywhere1.jnlp * tests/jnlp_tests/simple/Spaces can be everywhere/resources/Spaces can be everywhere2.jnlp * tests/jnlp_tests/simple/Spaces can be everywhere/resources/SpacesCanBeEverywhere1.jnlp * tests/jnlp_tests/simple/deadlocktest/resources/deadlocktest.jnlp * tests/jnlp_tests/simple/deadlocktest/resources/deadlocktest_1.jnlp * tests/jnlp_tests/simple/simpletest1/resources/simpletest1.jnlp * tests/jnlp_tests/simple/simpletest1/resources/simpletestCustomSplash.jnlp * tests/jnlp_tests/simple/simpletest1/resources/simpletestMegaSlow.jnlp * tests/jnlp_tests/simple/simpletest1/resources/simpletestSlow.jnlp * tests/jnlp_tests/simple/simpletest1/resources/simpletestSlowBrokenCustomSplash.jnlp * tests/jnlp_tests/simple/simpletest1/resources/simpletestSlowSlowCustomSplash.jnlp * tests/jnlp_tests/simple/simpletest2/resources/simpletest2.jnlp: Replaced the specified vendor with IcedTea and homepage with a link to IcedTea-Web's wiki. 2012-04-03 Omair Majid * netx/net/sourceforge/jnlp/runtime/pac-funcs.js: Replace incorrect use of getYear() with getFullYear(). (inYearMonthDateRange): Add missing conditional case. * tests/netx/pac/pac-funcs-test.js (runTest): New function. (runTests): Call runTest. (incDate): Deal with month/year wrapping around. (decDate): Removed. (testDateRange, testDateRange2, testDateRange3): Handle wrapping of month and days. 2012-04-03 Jiri Vanek Tests virtual server thread marked as daemon by default * tests/netx/jnlp_testsengine/net/sourceforge/jnlp/ServerAccess.java: All (ServerLauncher) instances returned by methods were marked as daemon by default. Possibility to change and api were kept. 2012-03-30 Danesh Dadachanji Certificate start dates are not being checked, they are still verified even if the date has yet not been reached. * netx/net/sourceforge/jnlp/tools/JarSigner.java (verifyJar): If the start date is in the future, set notYetValidCert to true. 2012-03-21 Omair Majid * tests/netx/unit/net/sourceforge/jnlp/JNLPMatcherTest.java (testIsMatchDoesNotHangOnLargeData): New method. 2012-03-21 Lars Herschke PR898: signed applications with big jnlp-file doesn't start * netx/net/sourceforge/jnlp/JNLPMatcher.java (JNLPMatcher): Handle large files correctly. 2012-03-19 Danesh Dadachanji Fix failing unit test missing title/vendor tags in the JNLP stream. * tests/netx/unit/net/sourceforge/jnlp/ParserCornerCases.java (testNestedComments): Added title and vendor tags to malformedJnlp. 2012-03-19 Jiri Vanek * tests/jnlp_tests/signed/CacheReproducer/testcases/CacheReproducerTest.java: as javaws have now integrated splash, I have changed this test to lunch javaws -Xclearcache with -headless to skip this logo (although it is not fatal fr testrun itself) * tests/jnlp_tests/simple/AppletTest/resources/appletAutoTests.html: this html file is lunched during tests run in browser and stdout of lunched applet is examined. Is lunched with slow resources to test spalshscreen * tests/jnlp_tests/simple/AppletTest/resources/appletViewTest.html: this test html file is dedicated to manual lunch and let user to look how the applet (with slow loading) is loaded and how looks splashscreen in small mode and in large mode * tests/jnlp_tests/simple/AppletTest/testcases/AppletTestTests.java: test is enriched for lunching the html file with applet in browser and is examining output of this file. Browser must be always terminated as there is no way how to close from inside * tests/jnlp_tests/simple/simpletest1/resources/netxPlugin.png: image to let user observe that user-defined splashscreen is still working even when internal splashscreen is enabled * tests/jnlp_tests/simple/simpletest1/resources/simpletestCustomSplash.jnlp: this and all jnlp files below are just for manual lunching and for watching various lunches of splash screen - slow loading of resources and with custom splash * tests/jnlp_tests/simple/simpletest1/resources/simpletestMegaSlow.jnlp: slow loading of resource and (XslowX)jnlp also * tests/jnlp_tests/simple/simpletest1/resources/simpletestSlow.jnlp: slow loading of resource * tests/jnlp_tests/simple/simpletest1/resources/simpletestSlowBrokenCustomSplash.jnlp: slow loading of resource with broken user's splash (our internal will be used) * tests/jnlp_tests/simple/simpletest1/resources/simpletestSlowSlowCustomSplash.jnlp: slow loading of custom splash screen and resource * tests/netx/jnlp_testsengine/net/sourceforge/jnlp/ServerAccess.java: Main server launcher was modified to support lunching of browser, stdout listteners and for slowing download of resources to provide time for watching splash screen (main) was rewritten to provide free port OR run server in-D specified directory on custom or default port - very useful for debuging reproducers (getIndependentInstance) can now run also on specified port and (or) directory (USED_BROWSER_COMMAND) new constant handling value of -D property to set browser = "used.browser.command"; (getBrowserLocation) new method to provide specified (by used.browser.command -D property) or default browser location (firefox) (ensureServer) test is testing weather XslowXmodifier is working (executeBrowser) set of overloaded functions to lunch browser (TinyHttpdImpl) was enriched for XslowX modifier. When resource starts with this, is returned slowly - splited to 10 parts with 1s delay betwen sending each of them. Although it is throwing BrokenPipe exception, is working fine. (splitArray) new function to split array of byte to n arrays of bytes, which when concated do the same array (splitArrayTestN) set of tests for splitArray (ContentReader) now can also have lsteners for catching outputs n runtime. * tests/netx/jnlp_testsengine/net/sourceforge/jnlp/ContentReaderListener.java: Listener for catching chars and lines form processes outputs * tests/netx/jnlp_testsengine/net/sourceforge/jnlp/ResourcesTest.java: added (testListeners) to test listeners behaviour 2012-03-16 Danesh Dadachanji Applications using JNLP files without a title or vendor section still run, despite them being required elements. * netx/net/sourceforge/jnlp/Parser.java: (getInformationDesc): If title or vendor are not found in info, a new ParseException is thrown. * netx/net/sourceforge/jnlp/resources/Messages.properties: Added PNoTitleElement and PNoVendorElement * tests/jnlp_tests/simple/InformationTitleVendorParser/resources/InformationParser.jnlp, * tests/jnlp_tests/simple/InformationTitleVendorParser/resources/TitleParser.jnlp, * tests/jnlp_tests/simple/InformationTitleVendorParser/resources/TitleVendorParser.jnlp, * tests/jnlp_tests/simple/InformationTitleVendorParser/resources/VendorParser.jnlp, * tests/jnlp_tests/simple/InformationTitleVendorParser/testcases/TitleVendorParserTest.java: New test that runs JNLPs in a combination of missing information, title and vendor tags, checking for the appropriate exceptions. 2012-03-14 Deepak Bhole Omair Majid PR895: IcedTea-Web searches for missing classes on each loadClass or findClass * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java (CodeBaseClassLoader): Added new map to track resources that are not found. (findClass): If resource was not found before, return immediately. If resource was not found for the first time, record it in the new map. (findResouces): Same. (findResource): Same. * tests/netx/unit/net/sourceforge/jnlp/runtime/CodeBaseClassLoaderTest.java: Test case for PR895 from Omair Majid. 2012-03-14 Omair Majid Print exceptions to terminal when running in gui mode too. * netx/net/sourceforge/jnlp/AbstractLaunchHandler.java: New file. * netx/net/sourceforge/jnlp/DefaultLaunchHandler.java: Extend AbstractLaunchHandler. (DefaultLaunchHandler): New method. (printMessage): Moved to parent class. * netx/net/sourceforge/jnlp/GuiLaunchHandler.java: Extend AbstractLaunchHandler. (GuiLauchHandler): New method. (launchError): Print the error too. (launchWarning,validationError): Call parent's printMessage. * netx/net/sourceforge/jnlp/LaunchException.java: Use standard java exception chaining. This removes compatibility with pre-java 1.3 class libraries. (LaunchException(JNLPFile,Exception,String,String,String,String)): Pass cause to parent so exceptions are chanined properly. (LaunchException(String,Throwable),LaunchException(Throwable)): Call parent's constructor. (printStackTrace(PrintStream),printStackTrace(PrintWriter),getCause): Removed. Use parent's implementation instead. (getCauses): Removed. * netx/net/sourceforge/jnlp/LaunchHandler.java (validationError): Rename argument to clarify meaing. * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java (initialize): Redirect output of all handlers to System.err. * plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java (PluginAppletSecurityContext): Likewise. * tests/netx/unit/net/sourceforge/jnlp/DefaultLaunchHandlerTest.java, * tests/netx/unit/net/sourceforge/jnlp/LaunchExceptionTest.java: New file. Contains tests. 2012-03-12 Danesh Dadachanji Adding test for regression of JNLP API accessibility in constructor methods of applets. * Makefile.am: Added classes.jar to classpath when compiling jnlp_tests. * tests/jnlp_tests/simple/CheckServices/resources/CheckServices.jnlp: * tests/jnlp_tests/simple/CheckServices/srcs/CheckServices.java: * tests/jnlp_tests/simple/CheckServices/testcases/CheckServicesTests.java: New test file added. Tests ServiceManager is setup correctly when called from applet constructors. 2012-03-12 Danesh Dadachanji Update tests that are missing title/vendor tag in their JNLPs. * tests/jnlp_tests/signed/CacheReproducer/resources/CacheReproducer1.jnlp, * tests/jnlp_tests/signed/CacheReproducer/resources/CacheReproducer1_1.jnlp, * tests/jnlp_tests/signed/CacheReproducer/resources/CacheReproducer2.jnlp, * tests/jnlp_tests/signed/CacheReproducer/resources/CacheReproducer2_1.jnlp, * tests/jnlp_tests/signed/MissingJar/resources/MissingJar.jnlp, * tests/jnlp_tests/signed/MissingJar/resources/MissingJar2.jnlp, * tests/jnlp_tests/signed/MissingJar/resources/MissingJar3.jnlp, * tests/jnlp_tests/signed/MissingJar/resources/MissingJar4.jnlp, * tests/jnlp_tests/signed/ReadPropertiesBySignedHack/resources/ReadPropertiesBySignedHack.jnlp, * tests/jnlp_tests/signed/ReadPropertiesSigned/resources/ReadPropertiesSigned1.jnlp, * tests/jnlp_tests/signed/ReadPropertiesSigned/resources/ReadPropertiesSigned2.jnlp, * tests/jnlp_tests/simple/AddShutdownHook/resources/AddShutdownHook.jnlp, * tests/jnlp_tests/simple/AllStackTraces/resources/AllStackTraces.jnlp * tests/jnlp_tests/simple/CreateClassLoader/resources/CreateClassLoader.jnlp, * tests/jnlp_tests/simple/ReadEnvironment/resources/ReadEnvironment.jnlp, * tests/jnlp_tests/simple/ReadProperties/resources/ReadProperties1.jnlp, * tests/jnlp_tests/simple/ReadProperties/resources/ReadProperties2.jnlp, * tests/jnlp_tests/simple/RedirectStreams/resources/RedirectStreams.jnlp, * tests/jnlp_tests/simple/ReplaceSecurityManager/resources/ReplaceSecurityManager.jnlp, * tests/jnlp_tests/simple/SetContextClassLoader/resources/SetContextClassLoader.jnlp, * tests/netx/unit/net/sourceforge/jnlp/templates/template8.jnlp: Added missing title/vendor tags that make them fail with this changeset. 2012-03-05 Jiri Vanek Added test for main-class in manifest for jnlp * Makefile.am: (prepare-reproducers.stamp) fixed manifest handling. Till now was manifest copied as any other non java file, and so was rewritten by jar tool * tests/jnlp_tests/simple/ManifestedJar2/srcs: secondary jar file which should have manifest and so should help ManifestedJar1 with testing * tests/jnlp_tests/simple/ManifestedJar2/resources/META-INF/MANIFEST.MF: manifest for ManifestedJar2.jar * tests/jnlp_tests/simple/ManifestedJar1/srcs: main testing jar * tests/jnlp_tests/simple/ManifestedJar2/resources/META-INF/MANIFEST.MF: manifest for ManifestedJar1.jar * tests/jnlp_tests/simple/ManifestedJar1/testcases/ManifestedJar1Test.java: testing class for this reproducers * tests/jnlp_tests/simple/ManifestedJar1/resources/: nine reproducers jnlps 2012-03-06 Jiri Vanek Improved reflection test: * tests/jnlp_tests/simple/AccessClassInPackage/testcases/AccessClassInPackageTest.java: This testcase was extended for three more unsigned reflection tries and four signed * tests/jnlp_tests/simple/AccessClassInPackage/srcs/AccessClassInPackage.java: now accepting class to be findByName as argument. Four new jnlp files in signed a four in simple are then passing those argument * tests/jnlp_tests/simple/AccessClassInPackage/resources/AccessClassInPackageSUNSEC.jnlp: * tests/jnlp_tests/simple/AccessClassInPackage/resources/AccessClassInPackageNETSF.jnlp: * tests/jnlp_tests/simple/AccessClassInPackage/resources/AccessClassInPackageJAVAXJNLP.jnlp: * tests/jnlp_tests/simple/AccessClassInPackage/resources/AccessClassInPackageSELF.jnlp: * tests/jnlp_tests/simple/AccessClassInPackage/resources/AccessClassInPackage.jnlp: removed * tests/jnlp_tests/signed/AccessClassInPackageSigned/srcs/AccessClassInPackageSigned.java signed variation of AccessClassInPackage, tescase is also in AccessClassInPackage * tests/jnlp_tests/signed/AccessClassInPackageSigned/resources/AccessClassInPackageSignedSELF.jnlp * tests/jnlp_tests/signed/AccessClassInPackageSigned/resources/AccessClassInPackageSignedNETSF.jnlp * tests/jnlp_tests/signed/AccessClassInPackageSigned/resources/AccessClassInPackageSignedSUNSEC.jnlp * tests/jnlp_tests/signed/AccessClassInPackageSigned/resources/AccessClassInPackageSignedJAVAXJNLP.jnlp 2012-02-29 Deepak Bhole * configure.ac: Bumped version to 1.3pre 2012-02-29 Deepak Bhole * netx/net/sourceforge/jnlp/security/CertificateUtils.java (inKeyStores): Only check for certificate equality. 2012-02-28 Deepak Bhole * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java (checkForMain): Also check manifest file of main jar. (getMainClassName): New method. Looks in a jar manifest to see if there is a Main-Class specified. 2012-02-28 Deepak Bhole * plugin/icedteanp/IcedTeaPluginRequestProcessor.cc (_eval): Return 0 id to Java side if eval fails. (_call): Return 0 id to Java side if call fails. 2012-02-27 Matthias Klose * acinclude.m4 (IT_CHECK_PLUGIN_DEPENDENCIES): Use the mozilla-plugin pkgconfig module if the libxul module is not available. 2012-02-27 Matthias Klose * acinclude.m4 (IT_FIND_JAVA): Set VERSION_DEFS. * Makefile.am ($(PLUGIN_DIR)/%.o): Pass $(VERSION_DEFS) * IcedTeaNPPlugin.cc (PLUGIN_MIME_DESC): Define in terms of HAVE_JAVA7. 2012-02-27 Thomas Meyer Deepak Bhole PR820: IcedTea-Web 1.1.3 crashing Firefox when loading Citrix XenApp * plugin/icedteanp/IcedTeaJavaRequestProcessor.cc (createJavaObjectFromVariant): If variant is a generic object array, create a JSObject on Java side instead of JSObject array. * plugin/icedteanp/IcedTeaPluginRequestProcessor.cc (newMessageOnBus): Run finalize on main thread. (eval): Create Java object in _eval (call): Create Java object in _call. (setMember): Create Java object in _setMember. (sendMember): Create Java object in _getMember. (sendString): Create Java object in _getString. (_setMember): Process result and create Java object if needed. (_getMember): Same. (_eval): Same. (_call): Same. (_getString): Same. 2012-02-22 Danesh Dadachanji Add ability to check for jnlp_href use outside of PluginBridge. * netx/net/sourceforge/jnlp/PluginBridge.java (PluginBridge): New boolean useJNLPHref is set if jnlp_href is used. (useJNLPHref): New getter method, returns boolean useJNLPHref. 2012-02-10 Danesh Dadachanji Fix path to NEW_LINE_IFS for when one builds outside of src directory. * Makefile.am: Use top src directory instead of top build directory for NEW_LINE_IFS 2012-02-06 Danesh Dadachanji Fixed regression in running webstart applets from JNLP files. * netx/net/sourceforge/jnlp/Launcher.java (createApplet): Added call to set applet variable in the AppletInstance's AppletEnvironment. * netx/net/sourceforge/jnlp/runtime/AppletEnvironment.java (setApplet): New method, set AppletEnvironment's applet variable only once. 2012-02-02 Danesh Dadachanji * netx/net/sourceforge/jnlp/LaunchException.java: Fix message to handle null description 2012-02-01 Danesh Dadachanji * netx/net/sourceforge/jnlp/LaunchException.java: Add description parameter to the message the exception stores. 2012-02-01 Jiri Vanek Fix for PR844 * netx/net/sourceforge/jnlp/cache/CacheLRUWrapper.java: (getLRUSortedEntries) instead of error throwing own LRU exception. Also catches more then NumberFormatException (clearLRUSortedEntries) new method - making soft clearing of cache public (clearCache) now return true if cache was cleared, false otherwise (or exception) * netx/net/sourceforge/jnlp/cache/CacheUtil.java: (getCacheFileIfExist) does three tires to load cache. If ifrst fails, then recently_used file is emptied both in memory and on disc. When second attemmpt fails, then LRU cache is forcibly cleared. if clearing fails, then error is thrown. If it pass, then one more try to load entries is allowed. When third attempt fails, then error is thrown. * /netx/net/sourceforge/jnlp/cache/LruCacheException.java: new file, for purpose of catching this particular exception * netx/net/sourceforge/jnlp/util/PropertiesFile.java: (store) tries to mkdirs to its path. It is better then to fail when no cache directory exists. * tests/jnlp_tests/signed/CacheReproducer: new reproducr trying severals way of corupted cache on several types of jnlp files. Is signed because of reflection used. * tests/jnlp_tests/signed/SimpletestSigned1: signed hello world to be used in CacheReproducer tests. * tests/netx/jnlp_testsengine/net/sourceforge/jnlp/ServerAccess.java: timeout for processes doubled, as clear cache methods sometimes took more then original allowed. 2012-01-27 Deepak Bhole PR852: Classloader not being flushed after last applet from a site is closed * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: Added variable to count usage for a given ClassLoader instance. (getInstance): Decrement use count for a loader after it is merged with another. Increment loader use count before returning. (incrementLoaderUseCount): New method. Increments loader use count. (decrementLoaderUseCount): New method. Decrements loader use count. * java/sun/applet/PluginAppletViewer.java (appletClose): Decrement loader use count when applet is closed. 2012-01-25 Jiri Vanek Added test for -Xnofork option and for applet launching by jnlp * tests/jnlp_tests/simple/deadlocktest/resources/deadlocktest_1.jnlp: new file By specifying new max heap size, should invoke jvm to fork when launched * tests/jnlp_tests/simple/deadlocktest/srcs/DeadlockTest.java: improved indentation, added debug output that main method was lunched * tests/jnlp_tests/simple/deadlocktest/testcases/DeadLockTestTest.java: small refactoring, add lunching of deadlocktest_1.jnlp with and without -Xnofork, and counting java instances during runtime * tests/netx/jnlp_testsengine/net/sourceforge/jnlp/ServerAccess.java (ThreadedProcess.run) fixed situation, when process ended, but not all the output was read by its stdout/stderr readers (ContentReader.run) enabled exception printing to stderr. * tests/jnlp_tests/simple/AppletTest/ : test for loading applets by jnlp file 2012-01-06 Danesh Dadachanji Use the JNLP file's information section for the Name and Publisher labels of access dialogs, if available. * netx/net/sourceforge/jnlp/PluginBridge.java: (PluginBridge): Assigned info variable to JNLP file's information section (if one is used), otherwise to a new, empty ArrayList. (getInformation): Removed method, superclass method should be used instead. * netx/net/sourceforge/jnlp/resources/Messages.properties: Adding SUnverified. * a/netx/net/sourceforge/jnlp/security/AccessWarningPane.java: (addComponents): Append unverified note to the publisher label. 2012-01-09 Deepak Bhole PR838: IcedTea plugin crashes with chrome browser when javascript is executed * plugin/icedteanp/IcedTeaPluginRequestProcessor.cc (eval): Added a check to ensure that the result pointer is valid before attempting to create an NPVariant from it. 2012-01-05 Omair Majid * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java (initializeResources): Only throw exceptions about the main class not being found when the jnlp file can have a main class. (addToCodeBaseLoader): Dont try to process null URLs. 2011-12-15 Jiri Vanek * configure.ac: added search for xsltproc program and setting WITH_XSLTPROC variable * Makefile.am: xsltproc result is no longer ignored, command itself is in conditional block 2011-12-22 Thomas Meyer * plugin/icedteanp/IcedTeaPluginRequestProcessor.cc(sendMember): Use correct response parameter when returning array member vs member itself. 2011-12-21 Thomas Meyer RH586194: Unable to connect to connect with Juniper VPN client * plugin/icedteanp/IcedTeaPluginRequestProcessor.cc(sendMember): Use createJavaObjectFromVariant to create the resulting object on Java side, rather than always creating a JSObject. 2011-12-21 Jiri Vanek * acinclude.m4: added definition of IT_CHECK_XULRUNNER_API_VERSION, which tries to compile small program against new xulrunner api * configure.ac: added call of IT_CHECK_XULRUNNER_API_VERSION * plugin/icedteanp/IcedTeaNPPlugin.cc: (NP_GetMIMEDescription) return type set-up by dependency on defined LEGACY_XULRUNNERAPI. This one is set by IT_CHECK_XULRUNNER_API_VERSION during configure. if defined, then old char* is used. New const char* is used otherwise. 2011-12-19 Danesh Dadachanji Fix for BasicService being used in applet constructors but not having access to ApplicationInstance variable. * netx/net/sourceforge/jnlp/Launcher.java: (createApplet): Moved applet initialization below loader.setApplication, appletInstance is now initialized with applet param as null. * netx/net/sourceforge/jnlp/runtime/AppletInstance.java: (setApplet): New method, allows setting of AppletInstance's applet only once. 2011-12-16 Deepak Bhole Patch from Thomas Meyer * plugin/icedteanp/IcedTeaPluginRequestProcessor.cc: Fixed function name in comment for sendMember. 2011-12-08 Omair Majid * netx/net/sourceforge/jnlp/Launcher.java (launchApplication): Print arguments being passed to the application's main method in debug mode. 2011-12-05 Danesh Dadachanji Update UI for AccessWarningPane * netx/net/sourceforge/jnlp/security/AccessWarningPane.java: Use question.png instead of warning.png for access dialogs. 2011-11-28 Jiri Vanek Added code-coverage generation targets * configure.ac: added search for optional emma.jar * makefile.am: added UNIT_CLASS_NAMES and REPRODUCERS_CLASS_NAMES variables to store tests clases for reuse in emmarun. Both also moved to separate target (run-netx-unit-tests): made dependent on reused stamped version (run-netx-dist-tests): made dependent on reused stamped version (stamps/run-netx-dist-tests): stamped rusable version of run-netx-dist-tests (run-unit-test-code-coverage) targets to generate report from unit-tests. Result binary and xml file and html report in tests.build/netx/unit (run-reproducers-test-code-coverage) targets to generate report from reproducers-test. Result binary file, xml and html report in tests.build/netx/jnlp_testsengine (run-test-code-coverage): merges binary results from unit and reproducers (clean-unit-test-code-coverage) conditionaly removes html,xml report and es and ec files from tests.build/netx/unit (clean-reproducers-test-code-coverage) condtionlay removes html and xml report and es file from tests.build/netx/jnlp_testsengine (clean-test-code-coverage) conditionlay removes merged html, xml es and em files from tests.build (clean-netx-tests) now depends also on clean-test-code-coverage 2011-11-11 Jiri Vanek Added reproducer for PR804 and PR8011 * tests/jnlp_tests/simple/Spaces can be everywhere/resources/Spaces can be everywhere1.jnlp: new jnlp file with space in name and with jar in resources which name does not contain spaces * tests/jnlp_tests/simple/Spaces can be everywhere/resources/Spaces can be everywhere2.jnlp: new jnlp file with space in name and with jar in resources which name contains spaces * tests/jnlp_tests/simple/Spaces can be everywhere/resources/SpacesCanBeEverywhere1.jnlp: jnlp file without space in name but with jar in resources which name contains spaces * tests/jnlp_tests/simple/Spaces can be everywhere/srcs/SpacesCanBeEverywhere.java: new file containig simple main method of "Spaces can be everywhere.jar" jar * tests/jnlp_tests/simple/Spaces can be everywhere/testcases/SpacesCanBeEverywhereTests.java testcase for this reproducer. It is lunching each of this jnlp once locally from filesystem and once remotely from server. Please note that except it's own jar, this reproducer is also using simpletest1.jar 2011-11-11 Jiri Vanek Fixed reproducers engine to handle spaces in files and in urls * Makefile.am: (stamps/netx-dist-tests-prepare-reproducers.stamp) (stamps/netx-dist-tests-sign-some-reproducers.stamp) (stamps/netx-dist-tests-compile-testcases.stamp): added call to NEW_LINE_IFS to use line breake temporarily as parameter separator while loading files from list and correct quoting * NEW_LINE_IFS: new file, small separate script used in makefile as inline script which backup original IFS variable and then set it to pure new line. It is in separate file because it is reused and I do not know another way how to save a new line variable in makefile. Restore to original vlaue is handled in Makefile * tests/netx/jnlp_testsengine/net/sourceforge/jnlp/ResourcesTest.java: (testResourcesExists) filename is encoded to correct URL before requested from server * tests/netx/jnlp_testsengine/net/sourceforge/jnlp/ServerAccess.java: "-headless" string extracted to variable HEADLES_OPTION (executeProcess) and (ThreadedProcess) enhanced for variable dir to specify working directory. Backward compatibility kept (TinyHttpdImpl) now expects url on requests, so all requests are now decoded by java.net.URLDecoder 2011-11-10 Jiri Vanek Added tests which covers corner cases or rhino support function dateRange Enabled testWeekdayRange test * tests/netx/pac/pac-funcs-test.js: (testWeekdayRange) - added mising runTests call (incDate) (decDate) (monthToStr) moved level up from function scope to be shareable (testDateRange2) new method, tests last days of months. (testDateRange3) new method, tests first days of months * netx/net/sourceforge/jnlp/runtime/pac-funcs.js: (dateRange) logic of this method moved to isDateInRange. This one now serve just as api using current date (isDateInRange) logic of dateRange, can calculate ranges against any date 2011-10-31 Omair Majid PR808: javaws is unable to start when missing jars are enumerated before main jar * NEWS: Update. * netx/net/sourceforge/jnlp/tools/JarSigner.java (verifyJars): Continue with other jars if the first jar can't be used. 2011-10-28 Deepak Bhole RH742515, CVE-2011-3377: IcedTea-Web: second-level domain subdomains and suffix domain SOP bypass * NEWS: Updated * netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java (checkPermission): Remove special case for SocketPermission. 2011-10-27 Deepak Bhole PR778: Jar download and server certificate verification deadlock * ChangeLog: Removed extra whitespace from previous entries * NEWS: Updated * netx/net/sourceforge/jnlp/GuiLaunchHandler.java (launchInitialized): Moved as much code as possible out of the invokeLater block. 2011-10-25 Omair Majid PR804: javaws launcher incorrectly handles file names with spaces * NEWS: Update. * launcher/javaws.in: Use bash arrays to store arguments to handle filenames with spaces correctly. 2011-10-24 Jiri Vanek Added reproducer for - PR788: Elluminate Live! is not working * tests/jnlp_tests/signed/MissingJar/resources/MissingJar.jnlp * tests/jnlp_tests/signed/MissingJar/resources/MissingJar2.jnlp * tests/jnlp_tests/signed/MissingJar/resources/MissingJar3.jnlp * tests/jnlp_tests/signed/MissingJar/resources/MissingJar4.jnlp four testcases's jnlp files. Differs by order and by used resoure tags * tests/jnlp_tests/signed/MissingJar/srcs/MissingJar.java very simple main jar, just printing message when initialized * tests/jnlp_tests/signed/MissingJar/testcases/MissingJarTest.java testing file of reproducer, launchiing above four jnlp files, each in individual test 2011-10-17 Jiri Vanek PR564: NetX depends on sun.misc.BASE64Encoder * configure.ac: removed IT564 comment, removed check for sun.misc.BASE64Encoder * netx/net/sourceforge/jnlp/security/CertificateUtils.java : sun.misc.BASE64Encoder; replaced (just changed import) by internal implementation from net.sourceforge.jnlp.util.replacements.BASE64Encoder; * netx/net/sourceforge/jnlp/util/replacements/BASE64Encoder.java: * netx/net/sourceforge/jnlp/util/replacements/CharacterEncoder.java: New files, internal implementation of BASE64Encoder, copied from OpenJDK * tests/netx/unit/net/sourceforge/jnlp/util/replacements/BASE64EncoderTest.java New file, to test internal base64encoder implementation 2011-10-03 Jiri Vanek * tests/jnlp_tests/signed/ReadPropertiesBySignedHack/resources/ReadPropertiesBySignedHack.jnlp * tests/jnlp_tests/signed/ReadPropertiesBySignedHack/srcs/ReadPropertiesBySignedHack.java * tests/jnlp_tests/signed/ReadPropertiesBySignedHack/testcases/ReadPropertiesBySignedHackTest.java * tests/jnlp_tests/signed/ReadPropertiesSigned/resources/ReadPropertiesSigned1.jnlp * tests/jnlp_tests/signed/ReadPropertiesSigned/resources/ReadPropertiesSigned2.jnlp * tests/jnlp_tests/signed/ReadPropertiesSigned/srcs/ReadPropertiesSigned.java * tests/jnlp_tests/signed/ReadPropertiesSigned/testcases/ReadPropertiesSignedTest.java Direcory signed was somehow missing from my commit from 2011-09-22. Now it have been added with all its original files 2011-09-29 Omair Majid PR618: Can't install OpenDJ, JavaWebStart fails with Input stream is null error. * NEWS: Update. * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java (getResource): Rename to ... (findResource): New method. (findResources): If resource can not be found, search in lazy resources. (findResourcesBySearching): New method. 2011-09-28 Omair Majid * netx/net/sourceforge/jnlp/AppletDesc.java (getMainClass): Clarify the return value in javadoc. * netx/net/sourceforge/jnlp/Launcher.java (createApplet, createAppletObject): Do not replace '/' with '.'. * netx/net/sourceforge/jnlp/PluginBridge.java (PluginBridge): Ensure that the class name is in the dot-separated from. * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java (checkForMain): Ensure that the name is an exact match. 2011-09-28 Deepak Bhole PR794: IcedTea-Web does not work if a Web Start app jar has a Class-Path element in the manifest. * netx/net/sourceforge/jnlp/runtime/CachedJarFileCallback.java (retrieve): Blank out the Class-Path elements in manifest. * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java (activateJars): Only load Class-Path elements if this is an applet. (addNewJar): Add the right permissions for the cached jar file and verify signatures. 2011-09-26 Lars Herschke * netx/net/sourceforge/jnlp/resources/Messages.properties: Add CVExportPasswordMessage, CVImportPasswordMessage and CVPasswordTitle. * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java (initialize): Initialize SSLContext with the user's client certificates. * netx/net/sourceforge/jnlp/security/CertificateUtils.java (addPKCS12ToKeyStore, addPKCS12ToKeyStore, dumpPKCS12): New methods. * netx/net/sourceforge/jnlp/security/viewer/CertificatePane.java (getPasswords): New method. (ImportButtonListener.actionPerformed): Import client certificates in PKCS12 format. (ExportButtonListener.actionPerformed): Export client certificates in PKCS12 format. 2011-09-23 Omair Majid RH738814: Access denied at ssl handshake * netx/net/sourceforge/jnlp/security/SecurityDialogs.java (showCertWarningDialog): Add a javadoc comment. * netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java (askUser): Wrap the call to showCertWarningDialog in a doPrivileged block. 2011-09-22 Omair Majid PR788: Elluminate Live! is not working * NEWS: Update. * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java (checkForMain): If localFile is null (JAR couldn't be downloaded), try to continue, rather than allowing the exception to cause an abort. 2011-09-21 Omair Majid PR766: javaws fails to parse an node that contains CDATA * netx/net/sourceforge/nanoxml/XMLElement.java (sanitizeInput): Do not remove CDATA sections along with comments. 2011-09-20 Omair Majid * tests/netx/unit/net/sourceforge/jnlp/ParserCornerCases.java (testCdata, testCdataNested, testCDataFirstChild, testCDataSecondChild) (testCommentInElements2, testDoubleDashesInComments): New methods * tests/netx/unit/net/sourceforge/jnlp/application/application0.jnlp, * tests/netx/unit/net/sourceforge/jnlp/templates/template0.jnlp: Change PR789: typo in jrunscript.sh * jrunscript.in: Use = instead of ==. 2011-09-22 Jiri Vanek * tests/jnlp_tests/signed/ReadPropertiesBySignedHack/resources/ReadPropertiesBySignedHack.jnlp: jnlp file to lunch ReadPropertiesBySignedHack, notice please dependenci on ReadProperties.jar from simple reproducers * tests/jnlp_tests/signed/ReadPropertiesBySignedHack/srcs/ReadPropertiesBySignedHack.java: this reproducers verify, that even reflection-by enabled XtrustAll will not allow to lunch unsigned code * tests/jnlp_tests/signed/ReadPropertiesBySignedHack/testcases/ReadPropertiesBySignedHackTest.java: testcase for this reproducer 2011-09-22 Jiri Vanek * tests/jnlp_tests/signed/ReadPropertiesSigned/resources/ReadPropertiesSigned1.jnlp: * tests/jnlp_tests/signed/ReadPropertiesSigned/resources/ReadPropertiesSigned2.jnlp: * tests/jnlp_tests/signed/ReadPropertiesSigned/testcases/ReadPropertiesSignedTest.java: * tests/jnlp_tests/signed/ReadPropertiesSigned/srcs/ReadPropertiesSigned.java: those four files are example of signed reproducer * tests/jnlp_tests/simple/ReadProperties/srcs/ReadProperties.java: now prints out got variable for comparsion with above created signed example 2011-09-22 Jiri Vanek Added signed reproducers engine * Makefile.am: added variable KEYSTORE_NAME (stamps/junit-jnlp-dist-dirs): creates stamp and depend on next two targets (junit-jnlp-dist-simple.txt): creates list of simple reproducers, extracted from stamps/junit-jnlp-dist-dirs (junit-jnlp-dist-signed.txt): creates list of signed reproducers (stamps/netx-dist-tests-prepare-reproducers.stamp): now traverse over signed and simple (stamps/netx-dist-tests-sign-some-reproducers.stamp): depends on netx-dist-tests-prepare-reproducers, traverse through signed reproducers and sign them (stamps/netx-dist-tests-compile-testcases.stamp): now traverse over signed and simple (stamps/bootstrap-directory.stamp): creates symlinks/stubs to jarsigner and keytool (clean-netx-dist-tests):remove new stamps, signed and simple list and keysstore * acinclude.m4: declared to proceed IT_FIND_KEYTOOL and IT_FIND_JARSIGNER macro * configure.ac: declared macros to check for keytool and jarsigner * tests/jnlp_tests/README: mentioned signed directory 2011-09-22 Jiri Vanek * netx/net/sourceforge/jnlp/runtime/Boot.java: (main): added logic to handle -Xtrustall option * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java: declared private static boolean trustAll=false; with public getter and pkg.private setter * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: (checkTrustWithUser): modified, when XtrustAll declared, then user is not asked and certificate is trusted * netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java: (askUser): modified, when XtrustAll declared, then user is not asked and certificate is trusted 2011-09-15 Jiri Vanek * tests/jnlp_tests/: all current reproducers (AccessClassInPackage AddShutdownHook AllStackTraces CreateClassLoader deadlocktest ReadEnvironment ReadProperties RedirectStreams ReplaceSecurityManager SetContextClassLoader simpletest1 simpletest2) junit's asserts are enchanted for reason, so junit assertion exception message is much clearer. 2011-09-13 Deepak Bhole PR782: Support building against npapi-sdk as well Patch from Michał Górny < mgorny at gentoo dot org > * acinclude.m4: Build against npapi-sdk. 2011-09-13 Deepak Bhole * ChangeLog: Fixed formatting issues in previous entry. 2011-09-01 Jiri Vanek Added functionality to allow icedtea web to be buildable with rhel5 libraries. * configure.ac: added IT_CHECK_GLIB_VERSION check. * acinclude.m4: added IT_CHECK_GLIB_VERSION definition block to test. version of glib installed and add LEGACY_GLIB define macro into variable DEFS if version is <2.16. * plugin/icedteanp/IcedTeaNPPlugin.cc: added replacements for incompatible functions (g_strcmp0 and find_first_item_in_hash_table)if LEGACY_GLIB is defined. Added define sections for use this function instead of glib ones. Duplicated code moved into function getFirstInTableInstance(GHashTble* table). * Makefile.am: ($(PLUGIN_DIR)/%.o): using DEFS setted by configure for compilation 2011-08-29 Deepak Bhole RH734081: Javaws cannot use proxy settings from Firefox Based on patch from Lukas Zachar * netx/net/sourceforge/jnlp/browser/FirefoxPreferencesFinder.java (find): Only process Profile sections. Do not throw an exception if a Default= line is not found since it is not guaranteed to exist. 2011-08-24 Deepak Bhole RH718693: MindTerm SSH Applet doesn't work * plugin/icedteanp/java/netscape/security/PrivilegeManager.java: New file. Stub class, not needed with IcedTea-Web. 2011-08-23 Deepak Bhole PR769: IcedTea-Web plugin does not work with some ssl sites with OpenJDK7 * netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java (checkServerTrusted): Account for a null hostname that the overloaded implementation may pass. 2011-08-23 Omair Majid * configure.ac: Add check for new non-standard classes sun.net.www.protocol.jar.URLJarFile and sun.net.www.protocol.jar.URLJarFileCallBack. 2011-08-23 Omair Majid * Makefile.am: Remove JRE. Replace uses with SYSTEM_JRE_DIR instead. Also replace uses of SYSTEM_JDK_DIR/jre with SYSTEM_JRE_DIR. * acinclude.m4 (IT_CHECK_FOR_JRE): New macro. (IT_FIND_JAVA): Require IT_CHECK_FOR_JRE. Use java binary from within the JRE. 2011-08-22 Saad Mohammad * netx/net/sourceforge/jnlp/JNLPFile.java: (parse): After the file has been parsed, it calls checkForSpecialProperties() to check if the resources contain any special properties. (checkForSpecialProperties): Scans through resources and checks if it contains any special properties. (requiresSignedJNLPWarning): Returns a boolean after determining if a signed JNLP warning should be displayed. (setSignedJNLPAsMissing): Informs JNLPFile that a signed JNLP file is missing in the main jar. * netx/net/sourceforge/jnlp/SecurityDesc.java: (getJnlpRIAPermissions): Returns all the names of the basic JNLP system properties accessible by RIAs. * netx/net/sourceforge/jnlp/resources/Messages.properties: Added LSignedJNLPFileDidNotMatch and SJNLPFileIsNotSigned. * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: (initializeResources): Locates the jar file that contains the main class and verifies if a signed JNLP file is also located in that jar. This also checks 'lazy' jars if the the main class was not found in 'eager' jars. If the main jar was not found, a LaunchException is thrown which terminates the launch of the application. (checkForMain): A method that goes through each jar and checks to see if it has the main class. If the main class is found, it calls verifySignedJNLP() to verify if a valid signed JNLP file is also found in the jar. (verifySignedJNLP): A method that checks if the jar file contains a valid signed JNLP file. (closeStream): Closes a stream. (loadClassExt): Added a try/catch block when addNextResource() is called. (addNextResource): If the main jar has not been found, checkForMain() is called to check if the jar contains the main class, and verifies if a signed JNLP file is also located. * netx/net/sourceforge/jnlp/security/MoreInfoPane.java: (addComponents): Displays the signed JNLP warning message if necessary. * netx/net/sourceforge/jnlp/security/SecurityDialog.java: (SecurityDialog): Stores the value of whether a signed JNLP warning should be displayed. (showMoreInfoDialog): Passes in the associated JNLP file when creating a SecurityDialog object. (requiresSignedJNLPWarning): Returns a boolean after determining if a signed JNLP warning should be displayed. 2011-08-17 Danesh Dadachanji Update UI for SecurityDialog * netx/net/sourceforge/jnlp/resources/question.png: New icon added. * netx/net/sourceforge/jnlp/security/CertWarningPane.java: (addComponents): When certs are verified, question.png is used as the icon and SAlwaysTrustPublisher is automatically selected. * netx/net/sourceforge/jnlp/security/SecurityDialog.java: (initDialog): Changed the title of a CERT_WARNING dialog. 2011-08-17 Danesh Dadachanji AUTHORS: Adding myself and Denis Lila. Removing the extra email from Andrew Hughes. 2011-08-11 Danesh Dadachanji PR742: IcedTea-Web checks certs only upto 1 level deep before declaring them untrusted. * NEWS: Updated. * netx/net/sourceforge/jnlp/tools/JarSigner.java: (checkTrustedCerts): All certs along certPath are now checked for trust. 2011-08-09 Deepak Bhole PR771: IcedTea-Web certificate verification code does not use the right API * netx/net/sourceforge/jnlp/security/CertificateUtils.java (inKeyStores): Use Certificate.verify to correctly verify a certificate against a public key in the store. 2011-08-09 Saad Mohammad PR765: JNLP file with all resource jars marked as 'lazy' fails to validate signature and stops the launch of application * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: (initializeResources): Initializes the first jar file if all resources are marked as lazy jars 2011-08-03 Saad Mohammad * netx/net/sourceforge/jnlp/JNLPMatcher.java: (JNLPMatcher): Removed NullPointerException from being thrown, caught and then thrown again via JNLPMatcherException. This was replaced by throwing a checked exception [JNLPMatcherException] directly. (JNLPMatcher): Removed unused code [getters] (JNLPMatcher): Closed Input/Output streams that were opened. (isMatch): Removed caching of return value (closeInputStream): Added this method to close input streams (closeOutputStream): Added this method to close output streams * netx/net/sourceforge/jnlp/Node.java: Removed getAttributeNames() method from the commented section 2011-08-03 Deepak Bhole PR768: Signed applets/Web Start apps don't work with OpenJDK7 and up * netx/net/sourceforge/jnlp/tools/JarSigner.java (verifyJar): Put entry in cert hashtable only if the entry is expected to be signed. 2011-08-02 Jiri Vanek * Makefile.am: (stamps/netx-dist-tests-prepare-reproducers.stamp): now are compiled files correctly compiled from directory structure. Also not java files are copied with expected directory structure and jarred together with classes. 2011-07-26 Jiri Vanek * tests/netx/jnlp_testsengine/net/sourceforge/jnlp/ServerAccess.java: String containing "localhost" have been declared as final constant. (SERVER_NAME) have been moved instant Server instance so each server can have it name without affecting others (getUrl()) added - can return URL of server singleton. Implementation of this method is inside server, so each server can return its own useful URL. (saveFile()) is now public. Added identification for ThreadedProcess based on commandlineArgs and its run is now slowed by Thread.sleep (ServerLuncher) inner class is now public (it was bug to not be as we have getIndependentInstance of it method ) and renamed to ServerLauncher Enchanted wrapping of executeProcess 2011-07-21 Deepak Bhole PR749: sun.applet.PluginStreamHandler#handleMessage(String) really slow Original patch from: Ricardo Martín Camarero * plugin/icedteanp/java/sun/applet/PluginStreamHandler.java (readPair): New function. (handleMessage): Use readPair to incrementally tokenize message, rather than using String.split(). 2011-07-19 Saad Mohammad * netx/net/sourceforge/jnlp/JNLPMatcher.java: Created this class to compare signed JNLP file with the launching JNLP file. When comparing, it has support for both method of signing of a JNLP file: APPLICATION_TEMPLATE.JNLP and APPLICATION.JNLP. * netx/net/sourceforge/jnlp/JNLPMatcherException.java: Added a custom exception: JNLPMatcherException. Thrown if verifying signed JNLP files fails. * netx/net/sourceforge/jnlp/Node.java: Created a method that retrieves the attribute names of the Node and stores it in private string [] member. The method returns the attribute names. * tests/netx/unit/net/sourceforge/jnlp/JNLPMatcherTest.java: This is a test case that tests the functionality of JNLPMatcher. It tests the algorithm with a variety of template and application JNLP files. * tests/netx/unit/net/sourceforge/jnlp/launchApp.jnlp: Launching JNLP file: This is the launching JNLP file used to compare with templates and application JNLP files in JNLPMatcherTest.java * tests/netx/unit/net/sourceforge/jnlp/templates/template0.jnlp: Test Template JNLP file: Contains CDATA. * tests/netx/unit/net/sourceforge/jnlp/templates/template1.jnlp: Test Template JNLP file: An exact duplicate of the launching JNLP file. * tests/netx/unit/net/sourceforge/jnlp/templates/template2.jnlp: Test Template JNLP file: Contains wildchars as attribute/element values. * tests/netx/unit/net/sourceforge/jnlp/templates/template3.jnlp: Test Template JNLP file: Different order of elements/attributes (same value) * tests/netx/unit/net/sourceforge/jnlp/templates/template4.jnlp: Test Template JNLP file: Contains wildchars as values of ALL elements and attribute. * tests/netx/unit/net/sourceforge/jnlp/templates/template5.jnlp: Test Template JNLP file: Contains comments. * tests/netx/unit/net/sourceforge/jnlp/templates/template6.jnlp: Test Template JNLP file: Contains different attribute and element values. * tests/netx/unit/net/sourceforge/jnlp/templates/template7.jnlp: Test Template JNLP file: Contains additional children in element. * tests/netx/unit/net/sourceforge/jnlp/templates/template8.jnlp: Test Template JNLP file: Contains fewer children in element. * tests/netx/unit/net/sourceforge/jnlp/templates/template9.jnlp: Test Template JNLP file: All values are different from the launching JNLP file. * tests/netx/unit/net/sourceforge/jnlp/application/application0.jnlp: Test Application JNLP file: Contains CDATA. * tests/netx/unit/net/sourceforge/jnlp/application/application1.jnlp: Test Application JNLP file: An exact duplicate of the launching JNLP file. * tests/netx/unit/net/sourceforge/jnlp/application/application2.jnlp: Test Application JNLP file: Different order of element/attributes (same value). * tests/netx/unit/net/sourceforge/jnlp/application/application3.jnlp: Test Application JNLP file: Contains comments. * tests/netx/unit/net/sourceforge/jnlp/application/application4.jnlp: Test Application JNLP file: Contains wildchars as attribute/element values. * tests/netx/unit/net/sourceforge/jnlp/application/application5.jnlp: Test Application JNLP file: Contains a different attribute (codebase) value. * tests/netx/unit/net/sourceforge/jnlp/application/application6.jnlp: Test Application JNLP file: Contains additional children in element. * tests/netx/unit/net/sourceforge/jnlp/application/application7.jnlp: Test Application JNLP file: Contains fewer children in element. * tests/netx/unit/net/sourceforge/jnlp/application/application8.jnlp: Test Application JNLP file: All values are different from the launching JNLP file. * Makefile.am: (run-netx-unit-tests): Copies resources(non java files) to test.build before running the unit tests. 2011-06-22 Jiri Vanek * tests/report-styles/jreport.xsl: part with classes statistics is now collapsible 2011-06-21 Jiri Vanek * tests/jnlp_tests/simple: AccessClassInPackage, ReplaceSecurityManager, AddShutdownHook, ReadEnvironment, SetContextClassLoader, AllStackTraces, ReadProperties, CreateClassLoader, RedirectStreams tests 2011-06-21 Jiri Vanek * Makefile.am: (run-netx-dist-tests): no depends on copying of styles (clean-netx-dist-tests): depends also on removing of styles 2011-06-17 Jiri Vanek * tests/jnlp_tests: directory for reproducers * tests/jnlp_tests/advanced: reproducers which must care about deploying and compiling thmselves * tests/jnlp_tests/simple: reproducers compiled, jared and deployed automatically * tests/jnlp_tests/simple/name/srcs|testcases|resources/: sourcefiles, resources and testaces for simple reproducers * tests/jnlp_tests/simple/deadlocktest: test for tracing not-killable javaws * tests/jnlp_tests/simple/simpletest1: tutorial test * tests/jnlp_tests/simple/simpletest2: tutorial test with exception * tests/netx/jnlp_testsengine/net/sourceforge/jnlp/ResourcesTest.java: tests for server basic functionality * tests/netx/jnlp_testsengine/net/sourceforge/jnlp/ServerAccess.java: implementation of server to produce jnlps and resources. Implementation of helpers to run javaws process. * Makefile.am: new variables pointing to structure above; (junit-jnlp-dist-dirs.txt): prepare destination directory structure (stamps/netx-dist-tests-prepare-reproducers.stamp):compile tescascases of simple reproducers (netx-dist-tests-source-files.txt): lookup for server and helping classes (stamps/netx-dist-tests-compile.stamp): compile server and helping classes (stamps/netx-dist-tests-compile-testcases.stamp): compile, jar and deploy all simple testcases and their resources (run-netx-dist-tests): after make install run junit testsuite upon reproducers on virtual server (clean-netx-tests): added dependence on clean-netx-dist-tests (clean-netx-dist-tests): deleting of reproducers 2011-06-16 Jiri Vanek * tests/report-styles/index.js: fast navigation functions * tests/report-styles/report.css: styles for transformed result * tests/report-styles/jreport.xsl: template for human-readable xml->html transformation. * Makefile.am: New variable for report-styles directory; ($(TESTS_DIR)/$(REPORT_STYLES_DIRNAME)): goal for copying styles and javascripts; (run-netx-unit-tests): added nonfaling xsltproc transformation of sheet and unit-tests' xml report to index_unit.html; (clean-netx-unit-tests): now depends also on clean_tests_reports; (clean_tests_reports): new goal to remove report styles directory and indexs html files. 2011-07-14 Omair Majid RH718170, CVE-2011-2514: Java Web Start security warning dialog manipulation * netx/net/sourceforge/jnlp/services/XExtendedService.java (openFile): Create XContents based on a copy of the File object to prevent overloaded File classes from mangling the name. (XFileContents): Create a separate copy of File object for local use. 2011-07-14 Omair Majid RH718164, CVE-2011-2513: Home directory path disclosure to untrusted applications * netx/net/sourceforge/jnlp/runtime/CachedJarFileCallback.java: New file. * netx/net/sourceforge/jnlp/util/UrlUtils.java: New file. * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: jarLocationSecurityMap now contains originating urls, not cache urls. (initializeResources): Add remote url to map instead of local url. (activateJars): Add remote url to the classloader's urls. Add mapping for remote to local url. Put remote url in jarLocationSecurityMap. (loadClass): Add remote url to the classloader's urls. Add mapping for remote to local url. (getCodeSourceSecurity): Update javadoc to note that the url must be remote. * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java (initialize): Set the callback for URLJarFile. 2011-06-14 Andrew Su * netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java: (ControlPanel): Removed line that prevents resizing. (createMainSettingsPanel): Detect the minimum size of panels instead of fixed size. * netx/net/sourceforge/jnlp/controlpanel/NetworkSettingsPanel.java: (addComponents): Changed to update size when tool is being resized. * netx/net/sourceforge/jnlp/security/viewer/CertificatePane.java addComponents): Changed to a layout that will resize itself. 2011-06-10 Denis Lila * netx/net/sourceforge/jnlp/GuiLaunchHandler.java: (mutex): New mutex for synchronizing splashScreen. (closeSplashScreen): New method to hide and dispose splashScreen. (launchStarting): Call closeSplashScreen instead of doing it inline. (launchInitialized): Sync splashScreen creation. (validationError, launchError): Call closeSplashScreen. 2011-06-10 Denis Lila * netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java: (frameMutex): New mutex to synchronize accesses to "frame". (getListener): Make almost all of it synchronized on frameMutex. (disposeListener): Sync hider's body around frameMutex and call dispose on the frame so that the awt threads die when they should. (addProgressPanel): Sync "frame" usage. 2011-06-08 Saad Mohammad * AUTHORS: Updated * netx/net/sourceforge/jnlp/services/ServiceUtil.java (checkAccess): Moved the process of checking if the application is a trusted application to a new method called isSigned(). * netx/net/sourceforge/jnlp/services/XPersistenceService.java (checkLocation): Allows trusted application to have access to PersistenceService data from different hosts. It uses ServiceUtil.isSigned() to determine if the current application is a trusted application. 2011-06-08 Andrew Su * NEWS: Updated. * netx/net/sourceforge/jnlp/JNLPFile.java: (JNLPFile): Calls new constructor. (JNLPFile): New constructor to take an option for forcing a codebase. (JNLPFile): Call parse with extra parameter. (parse): Use the given codebase passed in if we did not find one. * netx/net/sourceforge/jnlp/Parser.java: (Parser): Calls new constructor. (Parser): New constructor which takes in a codebase as a last option. * netx/net/sourceforge/jnlp/PluginBridge.java: (PluginBridge): Calls new JNLPFile's constructor with current codebase 2011-06-08 Andrew Su * netx/net/sourceforge/jnlp/PluginBridge.java: (jars): Changed to use HashSet instead of String[]. (PluginBridge): Updated to work with HashSet instead of String[] (getResources): Likewise. 2011-06-08 Deepak Bhole PR721: IcedTeaPlugin.so cannot run g_main_context_iteration on a different thread unless a different GMainContext *context is used * plugin/icedteanp/IcedTeaJavaRequestProcessor.cc (postAndWaitForResponse): Added logic for tracking when the processor is running from a plugin main thread, and logic to process main thread specific messages queued thereafter until function exit. * plugin/icedteanp/IcedTeaNPPlugin.cc: (itnp_plugin_thread_id): New variable. Tracks plugin main thread ID. (pluginAsyncCallMutex): New variable. Mutex to lock async call queue. (NP_Initialize): Initialize the itnp_plugin_thread_id variable and make ithe make pluginAsyncCallMutex recursive. (NP_Shutdown): Destroy pluginAsyncCallMutex. * plugin/icedteanp/IcedTeaNPPlugin.h: (CHROMIUM_WORKAROUND): Remove macro. (itnp_plugin_thread_id): New variable. Tracks plugin main thread ID. (pluginAsyncCallMutex): New variable. Mutex to lock async call queue. * plugin/icedteanp/IcedTeaPluginRequestProcessor.cc (eval): Remove chromium workaround. (call): Same. (sendString): Same. (setMember): Same. (sendMember): Same. (loadURL): Same. * plugin/icedteanp/IcedTeaPluginRequestProcessor.h: Moved async_call_thread_data to IcedTeaPluginUtils.h. * plugin/icedteanp/IcedTeaPluginUtils.cc (pendingPluginThreadRequests): New variable. Queue to track events waiting for async execution on plug-in thread. (callAndWaitForResult): New function. Calls a method on plug-in thread and waits for the execution to complete. (postPluginThreadAsyncCall): New function. Posts a method call to the async execution queue and calls NPN_PluginThreadAsynCall. (processAsyncCallQueue): New function. Called from the plug-in thread, this function empties the event queue of functions waiting for plug-in thread execution. * plugin/icedteanp/IcedTeaPluginUtils.h (plugin_thread_call): New struct to hold async call data. (async_call_thread_data): Struct moved from IcedTeaPluginRequestProcessor. (processAsyncCallQueue): New function. (postPluginThreadAsyncCall): Same. (callAndWaitForResult): Same. * plugin/icedteanp/IcedTeaScriptablePluginObject.cc (get_scriptable_java_object): Use IcedTeaPluginUtilities::callAndWaitForResult to post async callback for _createAndRetainJavaObject. 2011-05-31 Omair Majid * netx/net/sourceforge/jnlp/JNLPSplashScreen.java: Subclass JDialog, not JFrame. 2011-05-30 Andrew Su * netx/net/sourceforge/jnlp/controlpanel/TemporaryInternetFilesPanel.java: (addComponent): Add check to see if specified cache directory is writable. 2011-05-30 Andrew Su * netx/net/sourceforge/jnlp/cache/ResourceTracker.java: (downloadResource): Check whether file to be downloaded is current. 2011-05-30 Andrew Su * netx/net/sourceforge/jnlp/controlpanel/DebuggingPanel.java: (properties): Removed property. (addComponents): Removed checkbox. * netx/net/sourceforge/jnlp/resources/Messages.properties: Removed translation string for DPLifeCycleExceptions. 2011-05-27 Deepak Bhole PR723: AccessControlException while downloading resource * netx/net/sourceforge/jnlp/cache/ResourceTracker.java (Downloader): Make class private. (Downloader::run): Call processResource via doPrivileged since resources may get added at run time from application code via JNLPClassLoader::addNewJar(). 2011-05-27 Deepak Bhole PR735: Firefox 4 sometimes freezes if the applet calls showDocument() * plugin/icedteanp/IcedTeaNPPlugin.cc (consume_message): Defer handling to url load request to the queue processor. * plugin/icedteanp/IcedTeaPluginRequestProcessor.cc (PluginRequestProcessor::newMessageOnBus): Handle new LoadURL command. (PluginRequestProcessor::loadURL): New method. Loads the specified url in the given target. (queue_processor): Process the LoadURL command. (_loadURL): New async callback function to handle LoadURL commands. * plugin/icedteanp/IcedTeaPluginRequestProcessor.h: Add _loadURL and loadURL method declerations. * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java (showDocument): Send the url load command in the standard "instance X reference Y " format. 2011-05-27 Deepak Bhole * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java (appletClose): Call dispose from the swing thread. Also, don't try to stop the threadgroup. 2011-05-27 Deepak Bhole * Backed out 0256de6a4bf6 2011-05-27 Omair Majid * NEWS: Update. * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java (getClassPathsFromManifest): Check for possible nulls and empty strings. 2011-05-26 Andrew Su * NEWS: Update. * netx/net/sourceforge/jnlp/cache/CacheUtil.java: (cleanCache): Split conditional for delete. 2011-05-20 Andrew Su * NEWS: Update. 2011-05-20 Andrew Su * netx/net/sourceforge/jnlp/cache/CacheLRUWrapper.java: (CacheLRUWrapper): New constructor to create file. (lock): Removed creation of file here. 2011-05-17 Jiri Vanek * tests/junit-runner/JunitLikeXmlOutputListener: This listener exports results of junit in xml which "follows junit-output schema". Extended for date, duration and some statististics for future purpose * Makefile.am (run-netx-unit-tests): backuping stdout/stderr of tests * tests/junit-runner/CommandLine.java: registered JunitLikeXmlOutputListener 2011-05-10 Andrew Su * netx/net/sourceforge/jnlp/controlpanel/CachePane.java: (addComponents):Created a new comparator for sorting by file size and date. 2011-05-09 Jiri Vanek * tests/junit-runner/CommandLine.java:r added skipping of inner classes and one jnlp file from sources package. 2011-05-03 Denis Lila * netx/net/sourceforge/jnlp/NetxPanel.java: Add imports. (uKeyToTG): Change to HashMap. (TGMapMutex): New mutex to synchronize uKeyToTG. (getThreadGroup): Synchronize on TGMapMutex. (NetxPanel): Only create a new thread group if one doesn't already exist for the computed uKey. 2011-05-02 Deepak Bhole * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java (appletClose): Do not try to stop threads, now that the loader is shared and the thread group for applets on a page is identical. Call dispose from invokeAndWait. (appletSystemExit): Exit the VM when called. 2011-04-28 Denis Lila * netx/net/sourceforge/jnlp/NetxPanel.java: Remove unused import; add imports. (uKey, uKeyToTG, appContextCreated): New members. (getThreadGroup, createNewAppContext): New methods. (runLoader): Pass uKey to PluginBridge's constructor. (run): Remove. No longer needed. (NetxPanel): Initialize uKey. If it is a new key, make a new thread group for it and save it in the hash map. (createAppletThread): Use getFutureTG instead of creating a thread group on the spot. * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java: (createPanel): Initialize and frame the panel in a separate thread. * netx/net/sourceforge/jnlp/Launcher.java: Remove unused import. (createApplet, createApplication, createThreadGroup): Replace AppThreadGroup with ThreadGroup. Remove all calls to setApplication. * netx/net/sourceforge/jnlp/PluginBridge.java: (PluginBridge): Remove the uniqueKey initialization logic. Set uniqueKey to the uKey parameter. * netx/net/sourceforge/jnlp/runtime/AppThreadGroup.java: Remove file. 2011-04-28 Omair Majid * Makefile.am (javaws, itweb_settings): New variables. (edit_launcher_script, all-local, install-exe-local) (uninstall-local, clean-launchers, javaws.desktop) (itweb-settings.desktop): Replace all uses of javaws and itweb-settings with the new variables. (launcher.build/javaws): Replace with ... (launcher.build/$(javaws)): New target. (launcher.build/itweb-settings): Replace with... (launcher.build/$(itweb-settings)): New target. 2011-04-21 Deepak Bhole * configure.ac: Bumped version to 1.2pre 2011-04-21 Deepak Bhole * plugin/icedteanp/IcedTeaNPPlugin.cc (consume_message): Use NPN_GetURLNotify (non-blocking) instead of NPN_GetURL (blocking) so that the plugin is free to process additional requests. * ChangeLog: Fixed spacing issues in previous entry. 2011-04-20 Andrew Su * netx/net/sourceforge/jnlp/controlpanel/CachePane.java: (createButtonPanel): Changed to update the recently_used file to reflect the deletion. Added method updateRecentlyUsed to anonymous ActionListener class which will do the actual updating. 2011-04-20 Omair Majid * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: Add new private variable classpathsInManifest. (activateJars): When adding jar index, also add Class-Path entries from the Manifest file in the jar. (loadClass): Search for jars specified in classpaths before looking for entries in jar index. (addNewJar): New method refactored from loadClass. 2011-04-20 Omair Majid * netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java (getApplication(Class[],int)): Renamed to ... (getApplication(Thread,Class[],int)): New method. Check the thread's context ClassLoader as well as parents of the classloader. (getJnlpClassLoader): New method. (getApplication, checkExit): Update to work with new method signatures. 2011-04-20 Omair Majid * plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java (PluginAppletSecurityContext): Set the launch handler to the stdout/stderr based one. 2011-04-20 Andrew Su * netx/net/sourceforge/jnlp/controlpanel/CachePane.java: (generateData): Skip through the identifier for cached item. 2011-04-20 Andrew Su * netx/net/sourceforge/jnlp/controlpanel/CachePane.java: (createButtonPanel): Added check to delete button for whether plugin or javaws is not running before proceeding with delete. 2011-04-20 Andrew Su * netx/net/sourceforge/jnlp/cache/CacheUtil.java: (cleanCache): Added check for removing files that are over set max limit. (removeUntrackedDirectories): Removed method. Replaced by removeSetOfDirectories. (removeSetOfDirectories): New method. Removes a given set of directories. 2011-04-20 Andrew Su * netx/net/sourceforge/jnlp/controlpanel/TemporaryInternetFilesPanel.java: (addComponents): Uncommented lines of code to reintroduce components to handle setting cache size limit. 2011-04-20 Andrew Su * netx/net/sourceforge/jnlp/cache/CacheUtil.java: (getCacheFile): Store lru after modifying. 2011-04-18 Andrew Su * netx/net/sourceforge/jnlp/cache/CacheEntry.java: (markForDelete): New method. Adds an entry to info file specifying that this file should be delete. (lock): New method. Locks the info file. (unlock): New method. Unlocks the info file. * netx/net/sourceforge/jnlp/cache/CacheUtil.java: (cacheDir, lruHandler, propertiesLockPool): New private static fields. (clearCache): Changed to use static field. (getCacheFile): Changed to call getCacheFileIfExist and makeNewCacheFile where appropriate. (getCacheFileIfExist): New method. Get the file of requested item. (makeNewCacheFile): New method. Create a new location to store cache file. (pathToURLPath): New method. Convert the file path to the url path. (cleanCache): New method. Search for redundant entries and remove them. (removeUntrackedDirectories): New method. Remove all untracked directories. (lockFile): New method. Locks the given property file. (unlockFile): New method. Unlocks the property file if we locked before. * netx/net/sourceforge/jnlp/cache/CacheLRUWrapper.java: New class. Provides wrappers for handling cache's LRU. * netx/net/sourceforge/jnlp/cache/ResourceTracker.java: (downloadResource): Ensure that we only allow downloading the specified file once. (initializeResource): Added creation of new location to store an updated or new file. * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: (JNLPClassLoader): Reordered the calls since we should check permission after we have the files ready. * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java: (markNetxRunning): Added call to CacheUtil.cleanCache() when adding shutdown hooks. * netx/net/sourceforge/jnlp/util/FileUtils.java: (getFileLock): New method. * netx/net/sourceforge/jnlp/util/XDesktopEntry.java: (getContentsAsReader): Changed call from using urlToPath to getCacheFile, since the directories are no longer in that location. 2011-04-18 Denis Lila * netx/net/sourceforge/jnlp/Launcher.java: Remove unused import. * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: Add annotation to suppress warning. (loadClass): Make synchronized. 2010-04-14 Andrew John Hughes * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java, (PluginAppletPanelFactory.createPanel(PluginStreamHandler, int,long,int,int,URL,Hashtable)): Remove duplication of wait for panel.isAlive(). (PluginAppletViewer.panelLock): New lock used to track panel creation. (PluginAppletViewer.panelLive): Condition queue for panel creation. (PluginAppletViewer.appletsLock): New lock used to track additions to the applets map. (PluginAppletViewer.appletAdded): Condition queue for applet addition. (PluginAppletViewer.statusLock): New lock for status changes. (PluginAppletViewer.initComplete): Condition queue for initialisation completion. (PluginAppletViewer.framePanel(int,long,NetxPanel)): Replace synchronized block with use of appletsLock and notification on appletAdded condition queue. (AppletEventListener.appletStateChanged(AppletEvent)): Signal the panelLive condition queue that the panel is live. (PluginAppletViewer.handleMessage(int,int,String)): Wait on appletAdded condition queue for applet to be added to the applets map. (PluginAppletViewer.updateStatus(Int,PAV_INIT_STATUS)): Signal when a status change occurs using the initComplete condition queue. (PluginAppletViewer.waitForAppletInit(NetxPanel)): Wait on the panelLive condition queue until the panel is created. (PluginAppletViewer.handleMessage(int,String)): Wait on the initComplete condition queue until initialisation is complete. Wait on the panelLive signal until panel is created. (waitTillTimeout(ReentrantLock,Condition,long)): Convert to use ReentrantLock and Condition. Add assertion to check the lock is held. Avoid conversion between milliseconds and nanoseconds. 2011-04-18 Deepak Bhole * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java (PluginAppletPanelFactory::createPanel): Make the NetxPanel variable final. Resize frame to work around problem whereby AppletViewerPanel doesn't always set the right size initially. 2011-04-18 Deepak Bhole RH691259: Midori sends a SIGSEGV with the IcedTea NP Plugin * plugin/icedteanp/IcedTeaNPPlugin.cc (NP_Initialize): Rather than returning immediately if already initialized, return after function tables are reset. 2010-04-11 Andrew John Hughes * configure.ac: Check Gentoo install location for JUnit 4. 2011-04-13 Deepak Bhole * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java (createPanel): use Object.wait() to wait, rather than pariodic sleep. (APPLET_TIMEOUT): Updated to be in nanoseconds. (framePanel): Synchronize put and notify threads waiting on the applets map instance. (appletStateChanged): Notify all threads waiting on the panel that just changed state. (handleMessage): Use the new waitTillTimeout function to wait, rather than periodically waking up. Improved timeout error string sent back. (updateStatus): Synchronize put and notify all threads waiting on status map. (waitForAppletInit): Use the new waitTillTimeout function to wait, rather than periodically waking up. (waitTillTimeout): New function. For a given non-null object, waits until the specified timeout, or, if an interrupt was thrown during wait, returns immediately. 2011-04-14 Denis Lila * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java Remove unused imports, added various SuppressWarnings annotations. (createPanel): Return NetxPanel from doPriviledged. Remove dead code. (PluginParseRequest): Remove - unused. (defaultSaveFile, label, statusMsgStream, requests, handle): Remove unused. (panel): Make NetxPanel. (identifier, appletPanels): Privatize. (appletPanels): Change type to NetxPanel. (applets, status): Use ConcurrentHashMaps. (framePanel, PluginAppletViewer): Remove unused PrintStream argument. (forceredraw): Remove - unused. (getApplets): Use generics. (appletClose): Fix style to match our convention. (destroyApplet): Use pav instead of calling get many times. (splitSeparator): Remove. Replace uses by String.split(). 2011-04-13 Andrew Su * netx/net/sourceforge/jnlp/cache/CacheDirectory.java: Added final modifier to class declaration. (CacheDirectory): New private constructor. 2011-04-12 Denis Lila * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java (applets, status): Make concurrent. (PluginAppletViewer): Synchronize appletPanels addElement. (destroyApplet): Remove applets.containsKey because it and the get that followed it were not atomic. (appletPanels): Privatize. (getApplet, getApplets): Synchronize iteration. 2011-04-08 Omair Majid * README: Update to add notes on rhino and junit. 2011-04-07 Deepak Bhole * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java (constructor): Make window close event call destroy applet which can be safely called multiple times, unlike appletClose. 2011-04-06 Andrew Su * netx/net/sourceforge/jnlp/controlpanel/AdvancedProxySettingsPane.java: (addComponents): Changed all port fields to use document which prevents input of non-valid port numbers. * netx/net/sourceforge/jnlp/controlpanel/NetworkSettingsPanel.java: (addComponents): likewise. (getPortNumberDocument): New method. * netx/net/sourceforge/jnlp/resources/Messages.properties: Added CPInvalidPort and CPInvalidPortTitle. 2011-04-05 Denis Lila * plugin/icedteanp/java/netscape/javascript/JSObject.java: Replaced every instance of PluginDebug.debug(a + b + c...) with PluginDebug.debug(a, b, c...). 2011-04-05 Denis Lila * netx/net/sourceforge/jnlp/cache/ResourceTracker.java: Remove unused imports, add import. (downloadOptions): Make ConcurrentHashMap. 2011-04-05 Denis Lila * plugin/icedteanp/IcedTeaNPPlugin.cc (plugin_start_appletviewer): Replace hardcoded indices with a variable; roll up free calls in a loop; fix whitespace; set classpath to ICEDTEA_WEB_JRE/lib/rt.jar. * launcher/javaws.in: Set class path to JRE/lib/rt.jar. * Makefile.am: Replace @JRE@ with $(JRE) in edit_launcher_script. 2011-04-01 Denis Lila * plugin/icedteanp/java/sun/applet/PluginDebug.java: (debug): Use StringBuilder to build the string. 2011-03-31 Omair Majid * netx/net/sourceforge/jnlp/Launcher.java: Add parserSettings and extra. (setParserSettings): New method. (setInformationToMerge): New method. (launch(JNLPFile,Container)): Call mergeExtraInformation. (launch(URL,boolean)): New method. (mergeExtraInformation): New method. (addProperties, addParameters, addArguments): Moved here from Boot.java (fromUrl): New method. * netx/net/sourceforge/jnlp/ParserSettings.java: New file. * netx/net/sourceforge/jnlp/resources/Messages.properties: Remove BArgNA, BParamNA. * netx/net/sourceforge/jnlp/runtime/Boot.java (run): Do not parse JNLP file. Pass ParserSettings and other command line additions to launcher. (getFile): Rename to... (getFileLocation): New method. (addProperties, addParameters, addArguments): Move to Launcher.java. 2011-03-31 Denis Lila * plugin/icedteanp/java/netscape/javascript/JSObject.java: Fix comments, remove unused imports. (equals): Remove. It was breaking the reflexivity in the equals contract. 2011-03-31 Denis Lila * plugin/icedteanp/java/sun/applet/PluginObjectStore.java: Add citation of Effective Java, 2nd edition. 2011-03-31 Denis Lila * plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java (store): Make private and remove fixme to make private. * plugin/icedteanp/java/sun/applet/PluginObjectStore.java (PluginObjectStore): Make it a singleton using enum. (objects, counts, identifiers, lock, wrapped, nextUniqueIdentifier, checkNeg): Made instance methods/members. (getInstance): New static method. 2011-03-31 Denis Lila * plugin/icedteanp/java/sun/applet/AppletSecurityContextManager.java * plugin/icedteanp/java/sun/applet/GetMemberPluginCallRequest.java * plugin/icedteanp/java/sun/applet/GetWindowPluginCallRequest.java * plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java * plugin/icedteanp/java/sun/applet/PluginCookieInfoRequest.java * plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java * plugin/icedteanp/java/sun/applet/PluginMessageHandlerWorker.java * plugin/icedteanp/java/sun/applet/PluginObjectStore.java * plugin/icedteanp/java/sun/applet/PluginProxyInfoRequest.java * plugin/icedteanp/java/sun/applet/PluginProxySelector.java * plugin/icedteanp/java/sun/applet/PluginStreamHandler.java * plugin/icedteanp/java/sun/applet/RequestQueue.java * plugin/icedteanp/java/sun/applet/VoidPluginCallRequest.java: Change all instances of PluginDebug.debug(arg1 + arg2 + ...) to PluginDebug.debug(arg1, arg2, ...). * plugin/icedteanp/java/sun/applet/PluginDebug.java: Change debug from "void debug(String)" to "void debug(Object...)". 2011-03-31 Denis Lila * plugin/icedteanp/java/sun/applet/PluginObjectStore.java (wrapped, lock): New static variables. (getNextID, checkNeg): New functions. (reference): Using getNextID and synchronized. (dump): Improve iteration and synchronized. (unreference, getObject, getIdentifier, contains(Object), contains(int)): Synchronized. 2011-03-31 Omair Majid Add unit tests for the parser * Makefile.am: Add TESTS_DIR,TESTS_SRCDIR, NETX_UNIT_TEST_DIR, and NETX_UNIT_TEST_SRCDIR, JUNIT_RUNNER_DIR, JUNIT_RUNNER_SRCDIR, and JUNIT_RUNNER_JAR. Conditionally define RHINO_TESTS and UNIT_TESTS. (clean-local): Use RHINO_TESTS and UNIT_TESTS. (clean-tests): Depend on clean-netx-tests. Delete directory. (junit-runner-source-files.txt, $(JUNIT_RUNNER_JAR)), (next-unit-tests-sources-files.txt stamps/netx-unit-tests-compile.stamp), (run-netx-unit-tests, clean-netx-tests, clean-junit-runner) (clean-netx-unit-tests): New targets. * configure.ac: Add new optional dependency on junit. * tests/junit-runner/CommandLine.java, * tests/junit-runner/LessVerboseTextListener.java, * tests/junit-runner/README, * tests/netx/unit/net/sourceforge/jnlp/ParserBasicTests.java, * tests/netx/unit/net/sourceforge/jnlp/ParserCornerCaseTests.java, * tests/netx/unit/net/sourceforge/jnlp/ParserMalformedXmlTests.java, * tests/netx/unit/net/sourceforge/jnlp/basic.jnlp: New files. 2011-03-30 Omair Majid * Makefile.am: Fix comment explaining reasons for setting JDK_UPDATE_VERSION. 2011-03-30 Omair Majid * netx/net/sourceforge/jnlp/resources/Messages.properties: Fix typo in RCantRename. 2011-03-30 Omair Majid * Makefile.am: Document reason for using bootclasspath. 2011-03-30 Omair Majid * netx/javaws.1: Fix FILES section to point to ~/.icedtea/deployment.properties. 2011-03-30 Omair Majid * netx/net/sourceforge/jnlp/LaunchHandler.java (launchInitialized, launchStarting): New methods. * netx/net/sourceforge/jnlp/DefaultLaunchHandler.java (launchInitialized, launchStarting): New methods. No-op implementation. (printMessage): Make it static. * netx/net/sourceforge/jnlp/GuiLaunchHandler.java: New file. (launchCompleted, launchError, launchStarting, launchInitialized), (launchWarning, validationError): New methods. * netx/net/sourceforge/jnlp/Launcher.java (launchApplication): Invoke handler.launchInitialized and handler.launchStarting instead of showing a splash screen directly. * netx/net/sourceforge/jnlp/resources/Messages.properties: Add ButShowDetails, ButHideDetails and Error. * netx/net/sourceforge/jnlp/runtime/Boot.java (run): Do not exit on error. * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java (initialize): Set handler to GuiLaunchHandler if not running in headless mode. * netx/net/sourceforge/jnlp/util/BasicExceptionDialog.java: New file. (exceptionToString, show): New methods. 2011-03-29 Denis Lila * netx/net/sourceforge/jnlp/JNLPFile.java (getInformation): Remove redundant if. 2010-03-29 Andrew John Hughes * plugin/docs/npplugin_liveconnect_design.html: Replace binary PDF documentation with editable HTML. * plugin/docs/npplugin_liveconnect_design.pdf: Removed. 2011-03-28 Omair Majid * launcher/javaws.in: Split out -J arguments and pass it to the JVM. 2011-03-28 Deepak Bhole * netx/net/sourceforge/jnlp/PluginBridge.java (PluginBridge): Construct unique key based on a combination of codebase, cache_archive, java_archive, and archive. This automatically ensures are loaders are shared only when appropriate. 2011-03-25 Denis Lila * netx/net/sourceforge/jnlp/PluginBridge.java (codeBaseLookup): new member and getter for it. (PluginBridge): set codeBaseLookup. * netx/net/sourceforge/jnlp/Launcher.java: (createApplet, createAppletObject): call enableCodeBase() if and only if the enableCodeBase argument is true. 2011-03-24 Omair Majid * Makefile.am (EXTRA_DIST): Add $(top_srcdir)/tests. 2011-03-24 Omair Majid * netx/net/sourceforge/jnlp/resources/Messages.properties: Add RBrowserLocationPromptTitle, RBrowserLocationPromptMessage and RBrowserLocationPromptMessageWithReason. * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java (isWindows): New method. Moved from XBasicService. (isUnix): New method. * netx/net/sourceforge/jnlp/services/XBasicService (initialize): Call initializeBrowserCommand. (initializeBrowserCommand): New method. (posixCommandExists): New method. (isWindows): Moved to JNLPRuntime. 2011-03-23 Denis Lila * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java (findResource, findResources): New functions. Return nothing if name.startsWith("META-INF"). Otherwise delegate to superclass. 2011-03-21 Matthias Klose * launcher/itweb-settings.in: Use /bin/sh as interpreter. * launcher/javaws.in: Likewise. 2011-03-14 Andrew Su * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java: (markNetxRunning): Handle case for when shared locks are not allowed on the system. 2011-03-14 Andrew Su * netx/net/sourceforge/jnlp/Launcher.java: (fileLock): Removed private static field. (launch): Mark NetX as running before launching apps. (launchApplication): Removed call to markNetxRunning() and removed shutdown hook for calling markNetxStopped(). (markNetxRunning): Removed method. (markNetxStopped): Removed method. * netx/net/sourceforge/jnlp/cache/CacheUtil.java: (okToClearCache): Removed closing of channel. * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java: (fileLock): New private static field. (markNetxRunning): New method to indicate NetX is running. (markNetxStopped): New method to indicate NetX has stopped. 2011-03-16 Jiri Vanek * extras/net/sourceforge/jnlp/about/Main.java: removed hyperlinkUpdate and HyperlinkListener, as it can not work without all-permissions. Also all createAndShowGUI was shorten for call from net.sourceforge.jnlp package. Html resources were redirected to javaws * netx/net/sourceforge/jnlp/resources/about.jnlp: removed 2011-03-16 Jiri Vanek * netx/net/sourceforge/jnlp/runtime/Boot.java: getAboutFile changed to return path to local about.jnlp instead to inner-from-jar * extras/net/sourceforge/jnlp/: refactored to extras/net/sourceforge/javaws/, as /net/sourceforge/jnlp/ package must be run with all-permissions. * netx/net/sourceforge/jnlp/resources/about.jnlp: codebase changed to "." 2011-03-15 Denis Lila * netx/net/sourceforge/jnlp/Launcher.java (markNetxRunning): Throw exception if directories can't be created. * netx/net/sourceforge/jnlp/cache/CacheDirectory.java (cleanParent): Print error message if file can't be deleted. * netx/net/sourceforge/jnlp/cache/CacheUtil.java (getCacheFile): Throw exception if directories can't be created. * netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java (save): Throw exception if directories can't be created. * netx/net/sourceforge/jnlp/controlpanel/CachePane.java (createButtonPanel): Print error message if file can't be deleted. * netx/net/sourceforge/jnlp/resources/Messages.properties Added messages. * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java (initializeStreams): Throw exception if directories can't be created. * netx/net/sourceforge/jnlp/services/XPersistenceService.java (create, get): Throw exception if directories can't be created. (delete): Print error message if file can't be deleted. * netx/net/sourceforge/jnlp/util/FileUtils.java (createRestrictedFile): Throw exception if file permissions can't be changed. (createParentDir, deleteWithErrMesg): new functions. 2011-03-15 Omair Majid * Makefile.am (LAUNCHER_BOOTCLASSPATH, PLUGIN_BOOTCLASSPATH) (javaws.desktop, itweb-settings.desktop): Remove DESTDIR. 2011-03-10 Mark Wielaard * tests/netx/pac/pac-funcs-test.js (testIsResolvable): Change single host name icedtea to NotIcedTeaHost to make sure it really isn't resolvable. 2011-03-10 Omair Majid Replace native launchers with shell scripts * NEWS: Update. * Makefile.am (LAUNCHER_BOOTCLASSPATH): Remove leading -J. (LAUNCHER_SRCDIR), (LAUNCHER_OBJECTS), (NETX_LAUNCHER_OBJECTS), (CONTROLPANEL_LAUNCHER_OBJECTS), (LAUNCHER_FLAGS), (LAUNCHER_LINK): Remove. (edit_launcher_script): New function. (all-local): Depend on new launcher targets. (clean-local): Depend on clean-launchers. (.PHONY): Add clean-launchers. (install-exec-local): Use new launcher paths. (clean-launchers): New target. ($(NETX_DIR)/launcher/%.o), ($(NETX_DIR)/launcher/controlpanel/%.o), ($(NETX_DIR)/launcher/javaws), ($(NETX_DIR)/launcher/controlpanel/itweb-settings): Remove. (launcher.build/javaws): New launcher. (launcher.build/itweb-settings): Likewise. * launcher/itweb-settings.in, * launcher/javaws.in: New file. * netx/net/sourceforge/jnlp/Launcher.java (launchExternal), * netx/net/sourceforge/jnlp/controlpanel/CommandLine.java (CommandLine): Use new system properties to find paths and program names. 2011-03-10 Omair Majid * acinclude.m4 (IT_FIND_RHINO_JAR): Remove. 2011-03-10 Omair Majid * tests/netx/pac/pac-funcs-test.js (main): Make test summary output more jtreg-like. (runTests): Change test output format to be more jtreg-like. 2011-03-09 Denis Lila * netx/net/sourceforge/jnlp/Parser.java (getJAR): Remove unused variable. * netx/net/sourceforge/jnlp/cache/Resource.java (connection): Remove unused member. * netx/net/sourceforge/jnlp/cache/ResourceTracker.java (lock): Initialize to Object() instead of Integer(0). Also, make final. * netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java (SettingsPanel): Make static class. * netx/net/sourceforge/jnlp/event/ApplicationEvent.java (application): Make member transient. * netx/net/sourceforge/jnlp/event/DownloadEvent.java (tracker, resource): Make members transient. * netx/net/sourceforge/jnlp/runtime/AppletEnvironment.java (appletInstance): Remove unused member. (parameters): Add parameters to its type (a map). * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Remove unused import. (getNativeDir): Improve random int computation. (CodeBaseClassLoader): Make it a static class. * netx/net/sourceforge/jnlp/JNLPFile.java (JNLPFile): Improve random positive int computation. * netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java (activeApplication): Remove unused member. (checkExit): Remove dead code resulting from activeApplication always being null. * netx/net/sourceforge/jnlp/security/NotAllSignedWarningPane.java Remove unused import. (addComponents): Remove unused variable. * netx/net/sourceforge/jnlp/security/SecurityDialogPanel.java (SetValueHandler): Make it a static class. * netx/net/sourceforge/jnlp/security/viewer/CertificatePane.java (CertificateType): Make it a static class. * netx/net/sourceforge/jnlp/services/ServiceUtil.java (checkAccess): Replace new Boolean with Boolean.valueOf. * netx/net/sourceforge/jnlp/tools/JarSigner.java (storeHash): Remove unused member. * netx/net/sourceforge/jnlp/util/XDesktopEntry.java (getContentsAsReader): Remove unused variable pathToJavaws. 2011-03-09 Andrew Su * netx/net/sourceforge/jnlp/controlpanel/SecuritySettingsPanel.java: (addComponents): Fix typo. 2011-03-08 Omair Majid * acinclude.m4 (IT_FIND_OPTIONAL_JAR): New macro. * configure.ac: Do not call IT_FIND_RHINO. Use IT_FIND_OPTIONAL_JAR instead. 2011-03-08 Denis Lila * netx/net/sourceforge/jnlp/runtime/RhinoBasedPacEvaluator.java (getProxies): Add result to cache, not cachedResult. 2011-03-08 Denis Lila * netx/net/sourceforge/jnlp/browser/FirefoxPreferencesFinder.java (find): Close input stream. * netx/net/sourceforge/jnlp/browser/FirefoxPreferencesParser.java (parse): Close input stream. * netx/net/sourceforge/jnlp/runtime/RhinoBasedPacEvaluator.java (getPacContents, getHelperFunctionContents): Close input stream. * netx/net/sourceforge/jnlp/security/CertWarningPane.java (CheckBoxListener.actionPerformed): Close output stream. * netx/net/sourceforge/jnlp/security/viewer/CertificatePane.java (ImportButtonListener.actionPerformed): Close output stream. 2011-03-08 Andrew Su * netx/net/sourceforge/jnlp/util/PropertiesFile.java: (load): Closed streams after opening them. (store): Likewise. 2011-03-08 Denis Lila * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java (getRequestIdentifier): Fix race condition by synchronizing on mutex. (requestIdentityCounter): Now a long. 2011-03-07 Omair Majid * acinclude.m4 (IT_FIND_RHINO_JAR): Set RHINO_AVAILABLE to true or false appropriately. * build.properties.in: New file. * jrunscript.in: New file. * configure.ac: Add build.properties and jrunscript to AC_CONFIG_FILES. * Makefile.am (.PHONY): Remove clean-jrunscript. (build.properties): Remove target. (stamps/netx.stamp): Remove dependency on build.properties. (clean-netx): Do not delete build.properties. (jrunscript): Remove target. (check-pac-functions): Remove dependency on jrunscript. (clean-tests): Remove dependency on clean-jrunscript. (clean-jrunscript): Remove target. 2011-03-07 Omair Majid * NEWS: Update. * acinclude.m4 (IT_OBTAIN_HG_REVISIONS): Use hg id instead of hg tip. 2011-03-07 Omair Majid * plugin/icedteanp/IcedTeaNPPlugin.cc: Add plugin_debug_suspend. (plugin_start_appletviewer): If plugin_debug_suspend is true, start jvm in suspend mode. 2011-03-07 Omair Majid * NEWS: Update. * Makefile.am (RHINO_RUNTIME): Define to point to rhino jars, or empty. (RUNTIME, LAUNCHER_BOOTCLASSPATH, PLUGIN_BOOTCLASSPATH): Include RHINO_RUNTIME. (PHONY): Add check-pac-functions, clean-jrunscript and clean-tests. (check-local): New target. Depends on check-pac-functions. (check-pac-functions): New target. (jrunscript): New target. (clean-tests): New target. (clean-jrunscript): New target. (netx-source-files.txt): Remove rhino related files if not building with rhino. (build.properties): New target. (stamps/netx.stamp): Depend on build.properties and copy new files to build location. (clean-netx): Remove build.properties. (stamps/bootstrap-directory.stamp): Add java to bootstrap programs. * acinclude.m4 (IT_FIND_RHINO_JAR): New macro. * configure.ac: Invoke IT_FIND_RHINO_JAR. * netx/net/sourceforge/jnlp/browser/BrowserAwareProxySelector.java: Add browserProxyAutoConfig. (initFromBrowserConfig): Initialize browserProxyAutoConfig if needed. (getFromBrowserPAC): Use browserProxyAutoConfig to find proxies. * netx/net/sourceforge/jnlp/resources/Messages.properties: Replace RPRoxyPacNotImplemented with RPRoxyPacNotSupported. * netx/net/sourceforge/jnlp/runtime/JNLPProxySelector.java: Add pacEvaluator. (parseConfiguration): Initialize pacEvaluator if needed. (getFromPAC): Use pacEvaulator to find proxies. (getProxiesFromPacResult): New method. Converts a proxy string to a list or proxies. * netx/net/sourceforge/jnlp/runtime/PacEvaluator.java: New file. Defines a Java interface for a PAC evaluator. * netx/net/sourceforge/jnlp/runtime/FakePacEvaluator.java: New file. Dummy implementation of a PAC evaluator. * netx/net/sourceforge/jnlp/runtime/RhinoBasedPacEvaluator.java: New file. A rhino-based PAC evaluator. * netx/net/sourceforge/jnlp/runtime/PacEvaluatorFactory.java: New file. A factory for creating the right PAC evaulator. * netx/net/sourceforge/jnlp/runtime/pac-funcs.js: New file. Defines helper functions needed while evaluating PAC files. * tests/netx/pac/pac-funcs-test.js: New file. Tests the PAC helper functions. 2011-03-07 Denis Lila * plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java: (prepopulateMethod) removed unused object o. * plugin/icedteanp/java/sun/applet/PluginCallRequest.java: Made all the members private. * plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java: Removed unused imports. (MAX_PARALLEL_INITS, MAX_WORKERS, PRIORITY_WORKERS, readQueue, workers, streamHandler, consumerThread, registerPriorityWait(String), unRegisterPriorityWait(String)): made private. (initWorkers, as, processedIds, unRegisterPriorityWait(Long), addToInitWorkers): removed - unused. (getPriorityStrIfPriority): made static; replaced while with for-each. (notifyWorkerIsFree): removed synchronized section - useless. (ConsumerThread.run): removed call to addToInitWorkers. * plugin/icedteanp/java/sun/applet/PluginMessageHandlerWorker.java: Removed explicit member initializations to the default values; fixed typo. (PluginMessageHandlerWorker): Removed SecurityManager argument - unused. * plugin/icedteanp/java/sun/applet/PluginStreamHandler.java: Removed unused imports. (consumer, shuttingDown): made private. (pav, writeQueue, getMessage, messageAvailable): removed - unused. (PluginStreamHandler): removed pav initialization. * plugin/icedteanp/java/sun/applet/AppletSecurityContextManager.java: Removed FIXME comment. 2011-03-07 Denis Lila * netx/net/sourceforge/jnlp/JNLPFile.java: (getResourcesDescs): added comment. (getDownloadOptionsForJar): removed commented out code. * netx/net/sourceforge/jnlp/PluginBridge.java (getResourcesDescs): added comment. * netx/net/sourceforge/jnlp/cache/ResourceTracker.java (downloadResource): added comment. 2011-03-04 Denis Lila * netx/net/sourceforge/jnlp/JNLPFile.java: (getDownloadOptionsForJar): Moved here from JNLPClassLoader.java. * netx/net/sourceforge/jnlp/PluginBridge.java (usePack, useVersion): added. (PluginBridge): initializing usePack and useVersion. (getDownloadOptionsForJar): return the download options. * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java (getDownloadOptionsForJar): logic moved to JNLPFile.java and its subclasses. Now just calling file.getDownloadOptionsForJar. * NEWS: Updated with fix of PR658. 2011-03-04 Denis Lila * netx/net/sourceforge/jnlp/cache/ResourceTracker.java (downloadResource): changed the order in which pack200+gz compression and gzip compression are checked. * netx/net/sourceforge/jnlp/cache/ResourceUrlCreator.java (getUrl): if usePack is true, append ".pack.gz" to the file name, instead of replacing ".jar" with ".pack.gz". 2011-03-04 Deepak Bhole * NEWS: Updated. * netx/net/sourceforge/jnlp/PluginBridge.java (PluginBridge): Use documentbase as a uniquekey so that the classloader may be shared by applets from the same page. * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: Added new CodeBaseClassLoader class to load codebase (from path instead of a file) classes. (getInstance): Try to match file locations only for Web Start apps. For plugin, merge the new loader into current one. (enableCodeBase): Use the new addToCodeBaseLoader method. (findLoadedClassAll): Search the codebase loader if the class was not found in the file loaders. (findClass): Likewise. (getResource): Likewise. (findResources): Likewise. (merge): Merge codebase loaders. (addToCodeBaseLoader): New method. Adds a given url to the codebase loader if it is a path. (CodeBaseClassLoader): New inner class. Extends URLClassLoader to expose its protected methods like addURL. * netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java (getApplication): Accomodate the fact that the classloader for a class may be a CodeBaseClassLoader. * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java (run): Likewise. 2011-03-03 Deepak Bhole * plugin/icedteanp/IcedTeaNPPlugin.cc (plugin_send_initialization_message): New method. Sends initialization information to the Java side. (ITNP_SetWindow): Call the new plugin_send_initialization_message function. (get_scriptable_object): Same. 2011-03-03 Deepak Bhole * plugin/icedteanp/IcedTeaPluginRequestProcessor.cc (eval): Proceed with _eval only if instance is valid. (call): Proceed with _call only if instance is valid. Moved declaration of result_variant_jniid, result_variant args_array and thread_data to the top. (sendString): Proceed with _getString only if instance is valid. Remove thread count incrementer. (setMember): Proceed with _setMember only if instance is valid. Remove thread count incrementer. (sendMember): Proceed with _getMember only if instance is valid. 2011-03-03 Deepak Bhole * plugin/icedteanp/IcedTeaPluginRequestProcessor.cc (PluginRequestProcessor): Remove initialization of tc_mutex (~PluginRequestProcessor): Remove destruction of tc_mutex (sendString): Removed thread count incrementer code. (setMember): Same. (sendMember): Same. * plugin/icedteanp/IcedTeaPluginRequestProcessor.h: Removed tc_mutex and thread_count variables. 2011-03-02 Omair Majid Fix PR612. * NEWS: Update with fix. * netx/net/sourceforge/jnlp/SecurityDesc.java: Add PropertyPermissions for browser and browser.* to sandboxPermissions. 2011-03-02 Omair Majid * netx/net/sourceforge/jnlp/controlpanel/CommandLine.java (handleSetCommand): Fix warning message. * netx/net/sourceforge/jnlp/resources/Messages.properties: Add CLWarningUnknownProperty. 2011-03-01 Omair Majid * netx/net/sourceforge/jnlp/runtime/JNLPPolicy.java (isSystemJar): Check for nulls. 2011-03-01 Andrew Su * netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java (createMainSettingsPanel): Commented out unimplemented feature. * netx/net/sourceforge/jnlp/controlpanel/TemporaryInternetFilesPanel.java (addComponents): Commented out unimplemented feature. 2011-02-28 Omair Majid * netx/net/sourceforge/jnlp/controlpanel/CommandLine.java (printResetHelp): Indicate that "all" is a valid argument. (handleResetCommand): Deal with "all" instead of a property name by reseting all properties. 2011-02-28 Denis Lila * plugin/icedteanp/java/sun/applet/PluginMain.java (redirectStreams, streamHandler, securityContext) make them local. (theVersion): make it private. (PluginMain): make it private. Empty the body. (main): Do all the work that used to be in PluginMain. (connect): make it static, and now it returns a PluginStreamHandler instead of setting a static variable. (messageAvailable, getMessage): Remove. 2011-02-28 Omair Majid * netx/net/sourceforge/jnlp/resources/Messages.properties: Add Password, Username and SAuthenticationPrompt. * netx/net/sourceforge/jnlp/security/JNLPAuthenticator.java (getPasswordAuthentication): Show password prompt using the secure thread. * netx/net/sourceforge/jnlp/security/PasswordAuthenticationPane.java (PasswordAuthenticationPane): Initialize variables. (initialize): For consistency, rename to.. (addComponents): New method. Set the appropriate return value when user takes an action. (askUser): Remove. (main): Remove. * netx/net/sourceforge/jnlp/security/SecurityDialog.java (initDialog): Add extra case for AUTHENTICATION dialog type. (installPanel): Likewise. * netx/net/sourceforge/jnlp/security/SecurityDialogs.java (DialogType): Add AUTHENTICATION. (showAuthenicationPrompt): New method. Shows a password authentication prompt. 2011-02-28 Omair Majid Rename files * netx/net/sourceforge/jnlp/security/PasswordAuthenticationDialog.java: Rename to ... * netx/net/sourceforge/jnlp/security/PasswordAuthenticationPane.java: New file. * netx/net/sourceforge/jnlp/security/SecurityWarningDialog.java: Rename to... * netx/net/sourceforge/jnlp/security/SecurityDialog.java: New file. * netx/net/sourceforge/jnlp/security/SecurityWarning.java: Rename to... * netx/net/sourceforge/jnlp/security/SecurityDialogs.java: New file. * netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java, * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java, * netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java, * netx/net/sourceforge/jnlp/security/AccessWarningPane.java, * netx/net/sourceforge/jnlp/security/AppletWarningPane.java, * netx/net/sourceforge/jnlp/security/CertWarningPane.java, * netx/net/sourceforge/jnlp/security/CertsInfoPane.java, * netx/net/sourceforge/jnlp/security/JNLPAuthenticator.java, * netx/net/sourceforge/jnlp/security/MoreInfoPane.java, * netx/net/sourceforge/jnlp/security/NotAllSignedWarningPane.java, * netx/net/sourceforge/jnlp/security/SecurityDialogMessage.java, * netx/net/sourceforge/jnlp/security/SecurityDialogMessageHandler.java, * netx/net/sourceforge/jnlp/security/SecurityDialogPanel.java, * netx/net/sourceforge/jnlp/security/SingleCertInfoPane.java, * netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java, * netx/net/sourceforge/jnlp/security/viewer/CertificatePane.java, * netx/net/sourceforge/jnlp/services/ServiceUtil.java, * netx/net/sourceforge/jnlp/services/XClipboardService.java, * netx/net/sourceforge/jnlp/services/XExtendedService.java, * netx/net/sourceforge/jnlp/services/XFileOpenService.java, * netx/net/sourceforge/jnlp/services/XFileSaveService.java: Update class names to the new classes. 2011-02-25 Omair Majid * Makefile.am (stamps/netx-dist.stamp): Do not add extra files to classes.jar. 2011-02-25 Omair Majid * netx/net/sourceforge/jnlp/resources/Manifest.mf: Remove unused file. 2011-02-23 Omair Majid * Makefile.am: Add missing slash to JRE. 2011-02-23 Omair Majid RH677772: NoSuchAlgorithmException using SSL/TLS in javaws * NEWS: Update with bugfix. * netx/net/sourceforge/jnlp/runtime/JNLPPolicy.java: Add new field jreExtDir. (JNLPPolicy): Initialize jreExtDir. (getPermissions): Grant AllPermissions if the CodeSourse is a system jar. (isSystemJar): New method. * netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java (checkPermission): Remove special casing of SecurityPermission("putProviderProperty.SunJCE") and SecurityPermission("accessClassInPackage.sun.security.internal.spec"). (inTrustedCallChain): Remove. 2011-02-22 Omair Majid Mark Greenwood Fix PR638 * NEWS: Update with fix. * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java (loadClass): Throw ClassNotFoundException instead of returning null. * AUTHORS: Update. 2011-02-22 Omair Majid * Makefile.am (uninstall-local): Fix typo in PACKAGE_NAME. 2011-02-22 Omair Majid * netx/net/sourceforge/jnlp/resources/Messages.properties: Add RNoAboutJnlp. * netx/net/sourceforge/jnlp/runtime/Boot.java: Remove NETX_ABOUT_FILE. (getAboutFile): Look for about.jnlp using the classloader. (getFile): Use localized error message string. 2011-02-22 Omair Majid DJ Lucas * Makefile.am (install-data-local): Use $(mandir) for man page dir. (uninstall-local): Use $(mandir) for man page dir. * AUTHORS: Update. 2011-02-22 Omair Majid Install icedtea-web into a FHS-compliant location * Makefile.am: Add new vars JRE, LAUNCHER_BOOTCLASSPATH and PLUGIN_BOOTCLASSPATH. (install-exec-local): Install files to FHS-compliant location; do not create links. (install-data-local): Likewise. (uninstall-local): Update file paths to delete. ($(PLUGIN_DIR)/%.o): Pass PLUGIN_BOOTCLASSPATH and ICEDTEA_WEB_JRE. ($(NETX_DIR)/launcher/%.o): Pass LAUNCHER_BOOTCLASSPATH and ICEDTEA_WEB_JRE. ($(NETX_DIR)/launcher/controlpanel/%.o): Likewise. * launcher/java_md.c (GetIcedTeaWebJREPath): New method. (CreateExecutionEnvironment): Call GetIcedTeaWebJREPath. * plugin/icedteanp/IcedTeaNPPlugin.cc (plugin_start_appletviewer): Add PLUGIN_BOOTCLASSPATH to the command. (NP_Initialize): Use ICEDTEA_WEB_JRE to initialize filename. 2011-02-18 Omair Majid Remove pluginappletviewer binary * Makefile.am (ICEDTEAPLUGIN_TARGET): Remove dependency on pluginappletviewer. (PLUGIN_LAUNCHER_OBJECTS): Remove. (install-exec-local): Do not install pluginappletviewer. (uninstall-local): Do not remove pluginappletviewer. ($(PLUGIN_DIR)/launcher/%.o): Remove. ($(PLUGIN_DIR)/launcher/pluginappletviewer): Remove. (clean-IcedTeaPlugin): Dont clean plugin launcher files. 2011-02-15 Omair Majid * netx/net/sourceforge/jnlp/util/TimedHashMap.java: Do not extend HashMap to provide a more type-safe and consistent interface. Use System.nanoTime for a more monotonic clock. 2011-02-15 Omair Majid * plugin/icedteanp/java/sun/applet/PluginProxySelector.java (TimedHashMap): Moved to... * netx/net/sourceforge/jnlp/util/TimedHashMap.java: New file. 2011-02-11 Omair Majid RH677332, CVE-2011-0706: IcedTea multiple signers privilege escalation * NEWS: Updated. * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java (initializeResources): Assign appropriate security descriptor based on code signing. 2011-02-11 Deepak Bhole Fix S6983554, CVE-2010-4450: Launcher incorrect processing of empty library path entries * NEWS: Updated. * launcher/java_md.c: Ignore empty LD_LIBRARY_PATH. 2011-02-11 Omair Majid * netx/net/sourceforge/jnlp/PluginBridge.java (getResourcesDescs): New method implemented to override behaviour in JNLPFile class. 2011-02-11 Omair Majid * netx/net/sourceforge/jnlp/JNLPFile.java (getResourceDescs): Renamed to... (getResourcesDescs): New method. (getResourceDescs): Renamed to... (getResourcesDescs): New method. * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java (getDownloadOptionsForJar): Call renamed method. 2011-02-10 Omair Majid Fix RH669942; Add support for packEnabled and versionEnabled. * NEWS: Update with bugfix. * netx/net/sourceforge/jnlp/DownloadOptions.java: New file. * netx/net/sourceforge/jnlp/JNLPFile.java (openURL): Use null for DownloadOptions. (getResourceDescs): New method. (getResourceDescs(Locale,String,String)): New method. * netx/net/sourceforge/jnlp/Launcher.java (launchApplication): Add image to downloader with null DownloadOptions. * netx/net/sourceforge/jnlp/cache/CacheUtil.java (getCachedResource): Add resource with null DownloadOptions. * netx/net/sourceforge/jnlp/cache/Resource.java: Add new field downloadLocation. (Resource): Initialize downloadLocation. (getDownloadLocation): New method. (setDownloadLocation): New method. * netx/net/sourceforge/jnlp/cache/ResourceTracker.java: Add new field downloadOptions. (addResource(URL,Version,UpdatePolicy)): Renamed to... (addResource(URL,Version,DownloadOptions,UpdatePolicy)): New method. (downloadResource): Add support for explicit downloading of packed jars as well as content-encoded packed jars. (initializeResource): Invokde findBestUrl to find the best url. Set that as the download location for the resource. (getVersionedResourceURL): Remove. (findBestUrl): New method. Use ResourceUrlCreator to get a list of all possible urls that can be used to download this resource. Try them one by one until one works and return that. * netx/net/sourceforge/jnlp/cache/ResourceUrlCreator.java: New file. * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java (initializeResources): Add resource with appropriate download options. (activateJars): Likewise. (loadClass): Likewise. (getDownloadOptionsForJar): New method. 2011-02-10 Deepak Bhole * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java (initialize): Restrict access to net.sourceforge.jnlp.* classes by untrusted classes. 2011-02-09 Omair Majid * netx/net/sourceforge/jnlp/controlpanel/NetworkSettingsPanel.java (addComponents): Fix the listener attached to the port field to update the right config option. 2011-02-08 Omair Majid * netx/net/sourceforge/jnlp/browser/BrowserAwareProxySelector.java (initFromBrowserConfig): Do not try to create a URL from null. (getFromBrowser): Only print informational messages in debug mode. 2011-02-01 Omair Majid * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java (activateJars): Add the nested jar to ResourceTracker. Use JarSigner.verifyJars instead of JarSigner.verifyJar. * netx/net/sourceforge/jnlp/tools/JarSigner.java (verifyJar): Make private to indicate nothing should be using this directly. 2011-01-24 Deepak Bhole RH672262, CVE-2011-0025: IcedTea jarfile signature verification bypass * rt/net/sourceforge/jnlp/runtime/JNLPClassLoader.java (initializeResources): Prompt user only if there is a single certificate that signs all jars in the jnlp file, otherwise treat as unsigned. * rt/net/sourceforge/jnlp/security/CertVerifier.java: Rename getCerts to getCertPath and make it return a CertPath. * rt/net/sourceforge/jnlp/security/CertsInfoPane.java: Rename certs variable to certPath and change its type to CertPath. (buildTree): Use new certPath variable. (populateTable): Same. * rt/net/sourceforge/jnlp/security/HttpsCertVerifier.java: Rename getCerts to getCertPath and make it return a CertPath. * rt/net/sourceforge/jnlp/tools/JarSigner.java: Change type for certs variable to be a hashmap that stores certs and the number of entries they have signed. (totalSignableEntries): New variable to track how many signable entries have been encountered. (getCerts): Updated method to return certs from new hashmap. (isFullySignedByASingleCert): New method. Returns if there is a single cert that signs all the entries in the jars specified in the jnlp file. (verifyJars): Move verifiedJars and unverifiedJars out of the for loop so that the data is not lost when the next jar is processed. After verifying each jar, see if there is a single signer, and prompt the user if there is such an untrusted signer. (verifyJar): Increment totalSignableEntries for each signable entry encountered and the count for each cert when it signs an entry. Move checkTrustedCerts() out of the function into verifyJars(). 2011-01-28 Omair Majid * Makefile.am: Move ICEDTEA_REV, ICEDTEA_PKG to acinclude.m4. Use FULL_VERSION. (stamps/netx-dist.stamp): Depend on netx.manifest. Use this file as the jar file manifest. * acinclude.m4 (IT_SET_VERSION): New macro. Defines FULL_VERSION. * configure.ac: Add netx.manifest to AC_CONFIG_FILES. Invoke IT_SET_VERSION. * netx.manifest.in: New file. * netx/net/sourceforge/jnlp/runtime/Boot.java: Set name and version using information from the manifest file. 2011-01-27 Omair Majid * netx/net/sourceforge/jnlp/resources/Messages.properties: Add RPRoxyPacNotImplemented, RProxyFirefoxNotFound, and RProxyFirefoxOptionNotImplemented. * netx/net/sourceforge/jnlp/runtime/JNLPProxySelector.java: Make abstract. (getFromBrowser): Remove implementation; make abstract. * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java (initialize): Set BrowserAwareProxySelector as the proxy selector. * netx/net/sourceforge/jnlp/browser/BrowserAwareProxySelector.java: New file. This class extends JNLPProxySelector and searches the browser's configuration to load additional proxy settings from. * netx/net/sourceforge/jnlp/browser/FirefoxPreferencesFinder.java: New file. This class looks into the browser configration to find the preferences file for the default firefox profile. * netx/net/sourceforge/jnlp/browser/FirefoxPreferencesParser.java: New file. Parses the browser's preferences and makes it available through a simpler interface. 2011-01-27 Omair Majid * AUTHORS: Update to include Jon A Maxwell. * extra/net/sourceforge/jnlp/about/resources/notes.html: Include everyone from AUTHORS. 2011-01-25 Omair Majid * netx/net/sourceforge/jnlp/resources/default.jnlp: Remove. 2011-01-24 Omair Majid * netx/net/sourceforge/jnlp/Launcher.java: Exit with error code * netx/net/sourceforge/jnlp/NetxPanel.java: Likewise. 2011-01-20 Andrew Su * netx/net/sourceforge/jnlp/AppletLog.java: Restrict log files to owner accessible only. 2011-01-20 Andrew Su Removing dead/commented/unused code. * plugin/icedteanp/java/sun/applet/GetWindowPluginCallRequest.java: Removed unused imports. * plugin/icedteanp/java/sun/applet/MethodOverloadResolver.java: (getMatchingMethod): Removed unused variable. (getMatchingConstructor): Removed unused variable. * plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java: Removed unused imports. (Signature): Removed commented code. (handleMessage): Removed commented code. (getAccessControlContext): Remove commented code. * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java: (getCachedImage): Removed commented code. (makeReader): Removed unused method. (parse): Removed unused variables. Removed dead code. * plugin/icedteanp/java/sun/applet/PluginCallRequest.java: Removed unused imports. * plugin/icedteanp/java/sun/applet/PluginDebug.java: Removed unused imports. * plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java: Removed unused imports. (getReference): Removed unused method. (isInInit): Removed unused method. (dumpWorkerStatus): Removed unused method. * plugin/icedteanp/java/sun/applet/PluginMessageHandlerWorker.java: Removed unused variable. (PluginMessageHandlerWorker): Removed unused variable. (plugin/icedteanp/java/sun/applet/PluginObjectStore.java): Removed unused imports. (reference): Removed commented code. (unreference): Removed commented code. * plugin/icedteanp/java/sun/applet/PluginProxyInfoRequest.java: Removed unused import. * plugin/icedteanp/java/sun/applet/PluginStreamHandler.java: Removed unused imports. Removed unused variable. (PluginStreamHandler): Removed unnecessary comments. Removed commented code. (startProcessing): Removed unused variables. Removed commented code. (write): Removed commented code. 2011-01-20 Deepak Bhole PR619: Improper finalization by the plugin can crash the browser * plugin/icedteanp/java/netscape/javascript/JSObject.java (finalize): Proceed with finalization only if JSObject is valid. 2011-01-17 Andrew Su * netx/net/sourceforge/jnlp/NetxPanel.java: (showAppletException): Override, adds logging to file then proceed with showAppletException in sun.applet.AppletPanel. * netx/net/sourceforge/jnlp/AppletLog.java: New class. * netx/net/sourceforge/jnlp/Log.java: New class. 2011-01-14 Andrew Su * Makefile.am: Added net.sourceforge.jnlp.config and net.sourceforge.jnlp.runtime to NETX_PKGS. 2011-01-12 Omair Majid * netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java (main): Set look and feel. Set config object to use with KeyStores. * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java (initialize): Set config object to use with KeyStores. * netx/net/sourceforge/jnlp/security/KeyStores.java: Add new member config. (setConfiguration): New method. Sets the value of config after security check. (getKeyStoreLocation): Use config object instead of querying JNLPRuntime. 2011-01-12 Omair Majid * netx/net/sourceforge/jnlp/JNLPFile: Add missing generic type to info. (getInformation): Remove redundant cast. 2011-01-12 Omair Majid * netx/javax/jnlp/UnavailableServiceException.java: Remove unused imports. * netx/net/sourceforge/jnlp/AppletDesc.java: Likewise. * netx/net/sourceforge/jnlp/ApplicationDesc.java: Likewise. * netx/net/sourceforge/jnlp/ComponentDesc.java: Likewise. * netx/net/sourceforge/jnlp/DefaultLaunchHandler.java: Likewise. * netx/net/sourceforge/jnlp/IconDesc.java: Likewise. * netx/net/sourceforge/jnlp/InformationDesc.java: Likewise. * netx/net/sourceforge/jnlp/InstallerDesc.java: Likewise. * netx/net/sourceforge/jnlp/JARDesc.java: Likewise. * netx/net/sourceforge/jnlp/JREDesc.java: Likewise. * netx/net/sourceforge/jnlp/Launcher.java: Likewise. * netx/net/sourceforge/jnlp/PackageDesc.java: Likewise. * netx/net/sourceforge/jnlp/ParseException.java: Likewise. * netx/net/sourceforge/jnlp/PluginBridge.java: Likewise. * netx/net/sourceforge/jnlp/PropertyDesc.java: Likewise. * netx/net/sourceforge/jnlp/ResourcesDesc.java: Likewise. * netx/net/sourceforge/jnlp/Version.java: Likewise. * netx/net/sourceforge/jnlp/cache/CacheEntry.java: Likewise. * netx/net/sourceforge/jnlp/cache/CacheUtil.java: Likewise. * netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java: Likewise. * netx/net/sourceforge/jnlp/cache/DownloadIndicator.java: Likewise. * netx/net/sourceforge/jnlp/cache/UpdatePolicy.java: Likewise. * netx/net/sourceforge/jnlp/controlpanel /AdvancedProxySettingsDialog.java: Likewise. * netx/net/sourceforge/jnlp/controlpanel /AdvancedProxySettingsPane.java: Likewise. * netx/net/sourceforge/jnlp/controlpanel/NetworkSettingsPanel.java: Likewise. * netx/net/sourceforge/jnlp/controlpanel /TemporaryInternetFilesPanel.java: Likewise. * netx/net/sourceforge/jnlp/event/ApplicationEvent.java: Likewise. * netx/net/sourceforge/jnlp/event/DownloadEvent.java: Likewise. * netx/net/sourceforge/jnlp/runtime/AppThreadGroup.java: Likewise. * netx/net/sourceforge/jnlp/runtime/AppletAudioClip.java: Likewise. * netx/net/sourceforge/jnlp/runtime/AppletInstance.java: Likewise. * netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java: Likewise. * netx/net/sourceforge/jnlp/runtime/Boot13.java: Likewise. * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java: Likewise. * netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java: Likewise. * netx/net/sourceforge/jnlp/security/CertsInfoPane.java: Likewise. * netx/net/sourceforge/jnlp/security/SecurityUtil.java: Likewise. * netx/net/sourceforge/jnlp/services/XBasicService.java: Likewise. * netx/net/sourceforge/jnlp/services/XDownloadService.java: Likewise. * netx/net/sourceforge/jnlp/services/XExtensionInstallerService.java: Likewise. * netx/net/sourceforge/jnlp/services/XFileContents.java: Likewise. * netx/net/sourceforge/jnlp/services/XFileOpenService.java: Likewise. * netx/net/sourceforge/jnlp/services/XFileSaveService.java: Likewise. * netx/net/sourceforge/jnlp/services/XPersistenceService.java: Likewise. * netx/net/sourceforge/jnlp/util/PropertiesFile.java: Likewise. * netx/net/sourceforge/jnlp/util/Reflect.java: Likewise. 2011-01-04 Omair Majid * netx/net/sourceforge/jnlp/security/KeyStores.java (getKeyStoreLocation): Fix typo. Return the user-level certificate store correctly. 2011-01-04 Omair Majid * netx/net/sourceforge/jnlp/runtime/JNLPPolicy.java: Add systemJnlpPolicy and userJnlpPolicy. (JNLPPolicy): Initialize the new policies. (getPermissions): Consult the extra policies as well to determine the resulting permissions to be granted. (getPolicyFromConfig): New method. Create a new Policy instance to delegate to for system- and user-level policies. 2011-01-04 Omair Majid * netx/net/sourceforge/jnlp/SecurityDesc.java: Add customTrustedPolicy. (SecurityDesc): Initialize customTrustedPolicy. (getCustomTrustedPolicy): New method. Get custom policy file from configuration and use it to initialize a custom configuration. (getPermissions): If trusted application and customTrustedPolicy is not null, delegate to otherwise return AllPermissions. * netx/net/sourceforge/jnlp/config/Defaults.java (getDefaults): Use constant for property. * netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java: Add new constant KEY_SECURITY_TRUSTED_POLICY. * netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java (installEnvironment): Pass cs as a parameter to SecurityDesc.getPermissions. * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java (getPermissions): Likewise. 2011-01-04 Omair Majid * netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java: Remove JNLPRuntime import. Remove configBrowserCommand. (createMainSettingsPanel): Remove call to loadConfiguration. (loadConfiguration): Remove method. Setting the browser command should be handled by the appropriate panel. (main): Remove call to JNLPRuntime.initialize and just create a new DeploymentConfiguration object. Clarify TODO comment. 2011-01-04 Omair Majid * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java (installShutdownHooks): Only print when not null. 2011-01-04 Andrew Su * netx/net/sourceforge/jnlp/controlpanel/SecuritySettingsPanel.java: (addComponents): Hide unsupported options. 2010-12-23 Andrew Su * netx/net/sourceforge/jnlp/controlpanel/AdvancedProxySettingsDialog.java: (showAdvancedProxySettingsDialog): Removed call to setSystemLookAndFeel(). (setSystemLookAndFeel): Method removed. 2010-12-23 Andrew Su * netx/net/sourceforge/jnlp/controlpanel/AdvancedProxySettingsDialog.java: (showAdvancedProxySettingsDialog): Removed creation of swing thread. * netx/net/sourceforge/jnlp/controlpanel/CacheViewer.java: (showCacheDialog): Removed throwing of exception. * netx/net/sourceforge/jnlp/controlpanel/NetworkSettingsPanel.java: (addComponents): Removed try catch block. * /netx/net/sourceforge/jnlp/controlpanel/TemporaryInternetFilesPanel.java: (addComponents): Removed creation of swing thread and try catch block. 2010-12-22 Deepak Bhole RH665104: OpenJDK Firefox Java plugin loses a cookie * plugin/icedteanp/java/sun/applet/PluginCookieInfoRequest.java (parseReturn): Skip one less space so that the first cookie is not skipped. * NEWS: Updated. 2010-12-21 Andrew Su * netx/net/sourceforge/jnlp/controlpanel/AdvancedProxySettingsPane.java, netx/net/sourceforge/jnlp/controlpanel/NetworkSettingsPanel.java: (addComponents): Replaced key listeners and mouse listeners for text fields with document adapter. * netx/net/sourceforge/jnlp/controlpanel/DocumentAdapter.java: New class. * netx/net/sourceforge/jnlp/controlpanel/MiddleClickListener.java: Removed. 2010-12-20 Andrew Su Added a cache viewer for the control panel. * netx/net/sourceforge/jnlp/controlpanel/TemporaryInternetFilesPanel.java: (addComponents): Changed buttons to open cache viewer. * netx/net/sourceforge/jnlp/resources/Messages.properties: Added text used by the cache viewer. * netx/net/sourceforge/jnlp/cache/CacheDirectory.java, netx/net/sourceforge/jnlp/cache/DirectoryNode.java, netx/net/sourceforge/jnlp/controlpanel/CachePane.java, netx/net/sourceforge/jnlp/controlpanel/CacheViewer.java: New classes. 2010-12-20 Omair Majid * Makefile.am ($(NETX_DIR)/launcher/controlpanel/%.o): Set program name, and launch net.sourceforge.jnlp.controlpanel.CommandLine. * netx/net/sourceforge/jnlp/config/Defaults.java (getDefaults): Set descriptions to Unknown rather than the name. Set source to localized form of internal. * netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java (getProperty): Check for nulls. (setProperty): Add unknown as description and source for new properties. (checkAndFixConfiguration): Fix translation constants. (parsePropertiesFile): Use unknown as description. * netx/net/sourceforge/jnlp/controlpanel/CommandLine.java: New file (CommandLine): New method. (handleHelpCommand): Likewise. (printListHelp): Likewise. (handleListCommand): Likewise. (printGetHelp): Likewise. (handleGetCommand): Likewise. (printSetHelp): Likewise. (handleSetCommand): Likewise. (printResetHelp): Likewise. (handleResetCommand): Likewise. (printInfoHelp): Likewise. (handleInfoCommand): Likewise. (printCheckHelp): Likewise. (handleCheckCommand): Likewise. (handle): Likewise. (main): Likewise. * netx/net/sourceforge/jnlp/resources/Messages.properties: Add Usage, Unknown, RConfigurationFatal, DCIncorrectValue, DCSourceInternal, DCUnknownSettingWithName, VVPossibleValues, CLNoInfo, CLValue, CLValueSource, CLDescription, CLUnknownCommand CLUnknownProperty, CLNoIssuesFound, CLIncorrectValue, CLListDescription, CLGetDescription, CLSetDescription, CLResetDescription, CLInfoDescription, CLCheckDescription and CLHelpDescription. Remove DCErrorInSetting and DCUnknownSettingWithVal. 2010-12-17 Omair Majid * netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java (ControlPanel): Create and add the topPanel. (createTopPanel): New method. Creates a JPanel to display the description on top of the Control Panel. (createNotImplementedPanel): Use the same way to load resource as createTopPanel to avoid null pointer exceptions. * netx/net/sourceforge/jnlp/resources/Messages.properties: Add CPMainDescriptionShort and CPMainDescriptionLong. 2010-12-17 Omair Majid * netx/net/sourceforge/jnlp/security/SecurityWarning.java (shouldPromptUser): Use full privileges when checking configuration. This value is not security-sensitive and the method is private. * netx/net/sourceforge/jnlp/services/ServiceUtil.java (shouldPromptUser): Likewise. 2010-12-16 Omair Majid RH663680, CVE-2010-4351: * NEWS: List issue. * netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java: Make sure SecurityException is thrown if necessary. 2010-12-15 Omair Majid * Makefile.am (install-exec-local): Install plugin.jar as data. If $(prefix)/jre/bin exists, then install symlinks to real javaws and itweb-settings binaries under it. ($(NETX_DIR)/launcher/%.o): Set system property java.icedtea-web.bin to point to the installed location of the javaws binary. * netx/net/sourceforge/jnlp/Launcher.java (launchExternal): Use the system property java.icedtea-web.bin to locate javaws binary. 2010-12-15 Andrew Su * /netx/net/sourceforge/jnlp/resources/Messages.properties: Changed messages for about and JRE. 2010-12-14 Andrew John Hughes * Makefile.am: (LAUNCHER_OBJECTS): Add jli_util.o, parse_manifest.o, version_comp.o, wildcard.o. (LAUNCEHR_FLAGS): Add -DEXPAND_CLASSPATH_WILDCARDS as used in build of libjli in OpenJDK. (LAUNCHER_LINK): Don't link to libjli. * launcher/jli_util.c, * launcher/parse_manifest.c, * launcher/version_comp.c, * launcher/wildcard.c: Add source files from OpenJDK6 to match header files already used. 2010-12-13 Omair Majid * netx/net/sourceforge/jnlp/config/ValueValidator.java: New file. * netx/net/sourceforge/jnlp/config/BasicValueValidators.java: New file. Provides methods to get some common validators. * netx/net/sourceforge/jnlp/config/ConfiguratonValidator.java: New file. Provides methods to validate a configuration. * netx/net/sourceforge/jnlp/runtime/DeploymentConfiguration.java: Moved to config subpackage instead and split off into Setting.java, DeploymentConfiguration.java and Defaults.java. * netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java: Renamed version of original DeploymentConfiguration. (load): Delegate to load. (load(boolean)): Load configuration and optionally fix any issues found. (checkAndFixConfiguration): New method. Validate all settings and set them to default values if problems found. * netx/net/sourceforge/jnlp/config/Setting.java: New file. Based on ConfigValue which was originally a part of DeploymentConfiguration. * netx/net/sourceforge/jnlp/config/Defaults.java: New file. Contains the default configuration settings. Originally from DeploymentConfiguration.java's loadDefaultProperties. * netx/net/sourceforge/jnlp/resources/Messages.properties: Add new messages. * netx/net/sourceforge/jnlp/Launcher.java: Fix imports. * netx/net/sourceforge/jnlp/SecurityDesc.java: Likewise. * netx/net/sourceforge/jnlp/cache/CacheUtil.java: Likewise. * netx/net/sourceforge/jnlp/controlpanel /AdvancedProxySettingsDialog.java: Likewise * netx/net/sourceforge/jnlp/controlpanel /AdvancedProxySettingsPane.java: Likewise. * netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java: Likewise * netx/net/sourceforge/jnlp/controlpanel/DebuggingPanel.java: Likewise. * netx/net/sourceforge/jnlp/controlpanel/DesktopShortcutPanel.java: Likewise. * netx/net/sourceforge/jnlp/controlpanel/MiddleClickListener.java: Likewise * netx/net/sourceforge/jnlp/controlpanel/NetworkSettingsPanel.java: Likewise. * netx/net/sourceforge/jnlp/controlpanel/SecuritySettingsPanel.java: Likewise. * netx/net/sourceforge/jnlp/controlpanel /TemporaryInternetFilesPanel.java:Likewise. * netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java: Likewise. * netx/net/sourceforge/jnlp/runtime/JNLPProxySelector.java: Likewise. * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java: Likewise. * netx/net/sourceforge/jnlp/security/KeyStores.java: Likewise. * netx/net/sourceforge/jnlp/security/SecurityWarning.java: Likewise. * netx/net/sourceforge/jnlp/services/ServiceUtil.java: Likewise. * netx/net/sourceforge/jnlp/services/SingleInstanceLock.java: Likewise. * netx/net/sourceforge/jnlp/services/XBasicService.java: Likewise * netx/net/sourceforge/jnlp/services/XPersistenceService.java: Likewise. * netx/net/sourceforge/jnlp/util/XDesktopEntry.java: Likewise. * plugin/icedteanp/java/sun/applet/JavaConsole.java: Likewise. * plugin/icedteanp/java/sun/applet/PluginMain.java: Likewise. 2010-12-13 Omair Majid * netx/net/sourceforge/jnlp/Parser.java (getInformationDesc): Fix whitespace in title, vendor and description elements. (getRelatedContent): Fix whitespace in title and description elements. (getSpanText(Node)): Delegate to ... (getSpanText(Node,boolean)): New method. Return the text in an element, optionally fixing whitespace. 2010-12-10 Omair Majid * netx/net/sourceforge/jnlp/tools/JarSigner.java: Remove unused variables collator, VERSION, IN_KEYSTORE, IN_SCOPE, privateKey, store, keystore, nullStream, token, jarfile, alias, storepass, protectedPath, storetype, providerName, providers, providerArgs, keypass, sigfile, sigalg, digestalg, signedjar, tsaUrl, tsaAlias, verify, debug, signManifest and externalSF. (getPublisher): Remove unnecessary cast. (getRoot): Likewise. 2010-12-08 Deepak Bhole PR597: Entities are parsed incorrectly in PARAM tag in applet plugin * plugin/icedteanp/IcedTeaNPPlugin.cc (encode_string): New function. Takes a string and replaces certain special characters with html escapes. (plugin_create_applet_tag): Use the new encode_string function to encode argn and argv right away, rather than encoding the whole tag. * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java (handleMessage): Move decoding out so that it is done after parsing. (decodeString): New function. Decodes the given string such that html escapes are replaced by the original special characters. (scanTag): Decode parameter name and value before adding it to attribute array. * NEWS: Updated. 2010-12-08 Omair Majid * configure.ac: Add check for sun.misc.HexDumpEncoder * netx/net/sourceforge/jnlp/security/CertsInfoPane.java: Import sun.misc.HexDumpEncoder. Remove import of net.sourceforge.jnlp.tools.* * netx/net/sourceforge/jnlp/tools/CharacterEncoder.java: Remove file. * netx/net/sourceforge/jnlp/tools/HexDumpEncoder.java: Remove file. 2010-12-08 Omair Majid * netx/net/sourceforge/jnlp/JNLPFile.java (getSupportedVersions): Remove method. * netx/net/sourceforge/jnlp/Parser.java: Remove supportedVersions. (Parser(JNLPFile,URL,Node,boolean,boolean)): Remove check for supported version. (getSupportedVersions): Remove method. * netx/net/sourceforge/jnlp/resources/Messages.properties: Remove PSpecUnsupported. 2010-12-08 Omair Majid * netx/net/sourceforge/jnlp/tools/JarRunner.java: Remove unused class. * netx/net/sourceforge/jnlp/tools/JarSignerResources.java: Remove unused class. 2010-12-07 Andrew John Hughes * netx/net/sourceforge/jnlp/InformationDesc.java, (InformationDesc(JNLPFile,Locale)): Correct @param tag. * netx/net/sourceforge/jnlp/JARDesc.java: (JARDesc(URL,Version,String,boolean,boolean,boolean,boolean)): Correct typo and add missing @param tag for cacheable. * netx/net/sourceforge/jnlp/JREDesc.java: (JREDesc(Version,URL,String,String,String,List)): Correct typo in @param tag. * netx/net/sourceforge/jnlp/Launcher.java: (Launcher(boolean)): Correct broken @param tag. * netx/net/sourceforge/jnlp/cache/ResourceTracker.java: (addDownloadListener(DownloadListener)): Remove broken @param tags. Add correct one. (removeDownloadListener(DownloadListener)): Add missing @param tag. * netx/net/sourceforge/jnlp/security/KeyStores.java: (getKeyStoreLocation(Level,Type)): Add content to @param and @return tags. (toTranslatableString(Level,Type)): Likewise. * netx/net/sourceforge/jnlp/security/PasswordAuthenticationDialog.java: (askUser(String,int,String,String)): Correct typo in @param tag. * netx/net/sourceforge/jnlp/security/SecurityDialogPanel.java: (createSetValueListener(SecurityWarningDialog,int)): Add content to @return tag. * netx/net/sourceforge/jnlp/security/SecurityWarningDialog.java: (showCertInfoDialog(CertVerifier,SecurityWarningDialog)): Remove broken @param tag and add correct ones. (showSingleCertInfoDialog(X509Certificate,JDialog)): Add content to @param tags. * netx/net/sourceforge/jnlp/tools/CharacterEncoder.java: Remove broken @see tags from import from OpenJDK. * netx/net/sourceforge/jnlp/util/FileUtils.java: Fix bad whitespace. (sanitizeFileName(String)): Fix @param tag. * netx/net/sourceforge/nanoxml/XMLElement.java: Fix example in class documentation. * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java, (waitForAppletInit(NetxPanel)): Fix @param tag. 2010-12-08 Omair Majid * netx/net/sourceforge/jnlp/tools/KeyTool.java: Remove unused class. 2010-12-07 Andrew Su * MiddleClickListener.java: Added copyright header. Corrected typo in javadoc. 2010-12-07 Omair Majid * Makefile.am (PLUGIN_VERSION): Change to IcedTea-Web ($(PLUGIN_DIR)/%.o): Define PLUGIN_NAME and PACKAGE_URL. * configure.ac (AC_INTIT): Add url. * plugin/icedteanp/IcedTeaNPPlugin.cc (PLUGIN_NAME): Removed. (PLUGIN_FULL_NAME): New definition. (PLUGIN_DESC): Add link to IcedTea-Web wiki page. (NP_GetValue): Return PLUGIN_FULL_NAME instead of PLUGIN_NAME. 2010-12-06 Deepak Bhole Fixed indentation and spacing for all .java files * .settings/org.eclipse.jdt.core.prefs: New file. Contains code style preference settings for Eclipse. * .settings/org.eclipse.jdt.ui.prefs: Same. 2010-12-03 Andrew John Hughes * netx/net/sourceforge/jnlp/cache/CacheUtil.java, (getCachedResource(URL,Version,UpdatePolicy)): Revert change to use toURI() for now. See http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2010-December/011270.html * netx/net/sourceforge/jnlp/cache/ResourceTracker.java, (getCacheURL(URL)): Likewise. * netx/net/sourceforge/jnlp/runtime/Boot.java, (getFile()): Use toURI.toURL() to avoid broken escaping. * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: (initializeResources()): Likewise. 2010-12-01 Andrew John Hughes * netx/net/sourceforge/jnlp/cache/CacheUtil.java: (getCachedResource(URL,Version,UpdatePolicy)): Use toURI().toURL() to avoid broken escaping. * netx/net/sourceforge/jnlp/cache/ResourceTracker.java: (getCacheURL(URL)): Likewise. * netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java: (destroy()): Suppress deprecated warning from use of thread.stop(). Only use when interrupt() has already been tried. * netx/net/sourceforge/jnlp/runtime/Boot.java: (getFile()): Use toURI.toURL() to avoid broken escaping. * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: (initializeResources()): Likewise. * netx/net/sourceforge/jnlp/security/PasswordAuthenticationDialog.java: (askUser(String,int,String,String)): Use getPassword() to retrieve a character array directly. Fix overrunning line. * netx/net/sourceforge/jnlp/tools/JarSigner.java: Remove unused IdentityScope variable, scope. * netx/net/sourceforge/nanoxml/XMLElement.java: (scanWhitespace(StringBuffer)): Don't fallthrough. * plugin/icedteanp/IcedTeaPluginRequestProcessor.cc: Fix warnings where std::string is used in printf rather than char* by invoking c_str on these strings. * plugin/icedteanp/java/netscape/javascript/JSException.java: (JSException()): Mark with @Deprecated annotation. (JSException(String)): Likewise. (JSException(String,String,int,String,int)): Likewise. * plugin/icedteanp/java/netscape/javascript/JSObject.java: (JSObject(String)): Remove redundant cast. (getWindow(Applet)): Likewise. * plugin/icedteanp/java/sun/applet/AppletSecurityContextManager.java: (contexts): Initialise properly with generic typing. * plugin/icedteanp/java/sun/applet/MethodOverloadResolver.java: (getMatchingMethod(Object[]): Add missing generic type to Class instances. (getMatchingConstructor(Object[])): Likewise. (getCostAndCastedObject(Object,Class)): Likewise. (getMatchingMethods(Class,String,int)): Likewise. (getMatchingConstructors(Class,int)): Likewise. (getNum(String,Class)): Likewise. * plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java: (parseCall(String,ClassLoader,Class)): Use c.cast rather than (V). (handleMessage(int,String,AccessControlContext,String)): Add missing generic type to Class instances. Remove redundant casts. (prepopulateField(int,String)): Add missing generic type to Class instance. * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java: (createPanel(PluginStreamHandler,int,long,URL,Hashtable)): Add missing generic types on Hashtable and PrivilegedAction. (initEventQueue(AppletPanel)): Add missing generic type to PrivilegedAction. (splitSeparator(String,String)): Use an ArrayList rather than Vector to avoid locking and use generic types. (requests): Initialise properly with generic typing. (applets): Likewise. (appletStateChanged(AppletEvent)): Use setSize and getPreferredSize. (handleMessage(int,String)): Remove redundant casts. (audioClips): Add generic types. (getAudioClip): Remove redundant cast. (imageRefs): Add generic types. (getCachedImageRef(URL)): Remove redundant cast. (appletPanels): Add generic types. (getApplets()): Likewise. (getStream(String)): Mark with @Override. (getStreamKeys()): Likewise. (systemParam): Add generic types. (printTag(PrintStream,Hashtable)): Likewise. Remove redundant casts. (updateAtts()): Use getSize() and getInsets(). Use Integer.valueOf(). (appletReload()): Add generic types to PrivilegedAction. (scanIdentifier(int[],Reader)): Use StringBuilder to avoid unnecessary locking. (skipComment(int[],Reader)): Likewise. (scanTag(int[],Reader)): Likewise. Add generic types. (parse(int,long,String,String,Reader,URL)): Use PrivilegedExceptionAction to avoid catching and rethrowing the exception manually. Add generic types. (parse(int,long,String,String,Reader,URL,PrintStream,PluginAppletPanelFactory)): Add generic types. Remove unnecessary casts. Fix overlong lines. * plugin/icedteanp/java/sun/applet/PluginMain.java: (init()): Add generic types. Remove unnecessary cast. * plugin/icedteanp/java/sun/applet/PluginObjectStore.java: (objects): Initialise properly with generic typing. (counts): Likewise. (identifiers): Likewise. * plugin/icedteanp/java/sun/applet/PluginProxySelector.java: (get(Object)): Suppress unchecked warning arising from cast to K. 2010-12-02 Omair Majid * Makefile.am (EXTRA_DIST): Add itweb-settings.desktop.in. (all-local): Add itweb-settings.desktop. (clean-desktop-files): Remove itweb-settings.desktop. (itweb-settings.desktop): New target. * itweb-settings.desktop.in: New file. 2010-12-01 Andrew John Hughes * acinclude.m4: (IT_CHECK_FOR_APPLETVIEWERPANEL_HOLE): New check to ensure sun.applet.AppletViewerPanel is public (via the patch in IcedTea, applet_hole.patch). * configure.ac: Invoke the above macro. Don't call IT_CHECK_FOR_CLASS for the same class (the above macro handles this too). * README: Mention this limitation. 2010-12-01 Andrew Su * NEWS: Added controlpanel for modifying deployments.properties * Makefile.am: (CONTROLPANEL_LAUNCHER_OBJECTS): Objects used to compile binary control panel. (all-local): Add $(NETX_DIR)/launcher/controlpanel/itw-settings. (install-exec-local): Install the control panel binary. (uninstall-local): Removes the compiled control panel binary. ($(NETX_DIR)/launcher/controlpanel/%.o): Create the launcher objects. ($(NETX_DIR)/launcher/controlpanel/itw-settings): Link the objects to make the launcher. * netx/net/sourceforge/jnlp/controlpanel/AboutPanel.java, * netx/net/sourceforge/jnlp/controlpanel/ComboItem.java, * netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java, * netx/net/sourceforge/jnlp/controlpanel/DebuggingPanel.java, * netx/net/sourceforge/jnlp/controlpanel/DesktopShortcutPanel.java, * netx/net/sourceforge/jnlp/controlpanel/JREPanel.java, * netx/net/sourceforge/jnlp/controlpanel/NamedBorderPanel.java, * netx/net/sourceforge/jnlp/controlpanel/MiddleClickListener.java, * netx/net/sourceforge/jnlp/controlpanel/SecuritySettingsPanel.java, * netx/net/sourceforge/jnlp/controlpanel/TemporaryInternetFilesPanel.java, * netx/net/sourceforge/jnlp/controlpanel/AdvancedProxySettingsDialog.java, * netx/net/sourceforge/jnlp/controlpanel/AdvancedProxySettingsPane.java, * netx/net/sourceforge/jnlp/controlpanel/NetworkSettingsPanel.java,: New classes. All methods are new as well. * netx/net/sourceforge/jnlp/resources/Messages.properties: Added messages used by control panel. * netx/net/sourceforge/jnlp/security/viewer/CertificatePane.java: Changed to not display a close button if null parent frame. 2010-11-30 Andrew John Hughes * Makefile.am: (liveconnect): Add NETX_DIR first on the bootclasspath so the plugin can be built against 1.7 and 1.8 branch releases of IcedTea6. 2010-11-26 Andrew John Hughes Make distcheck work. * Makefile.am: (EXTRA_DIST): Use relative paths for netx and the plugin. (clean-local): Remove empty stamps directory. (install-exec-local): Use install to install programs and data with the correct permissions. (install-data-local): Likewise. (uninstall-local): Remove documentation. (netx): Use ${INSTALL_DATA} to add resources so that read-only files aren't copied. (extra-files): Likewise. ($(NETX_DIR)/launcher/javaws): Don't create empty launcher directory. (clean-docs): Remove empty docs directory. (clean-bootstrap-directory): Remove empty bootstrap directory. 2010-11-29 Deepak Bhole * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java (createPanel): Call the new framePanel() method with the proper handle. (framePanel): New method, renamed from reFrame. Changed to now do one-time framing of panel into the plugin. (handleMessage): Don't re-frame the panel. Panel is now framed only once. (destroyApplet): Dispose the frame right away, and try to remove the panel if possible. If not, handleMessage() will do it when the panel is ready/removable. 2010-11-25 Andrew John Hughes * Makefile.am: (JDK_UPDATE_VERSION): Document. (NETX_PKGS): NetX packages for documentation. (PLUGIN_PKGS): Same for the plugin. (JAVADOC_OPTS): Common options passed to javadoc. (JAVADOC_MEM_OPTS): Memory options passed to JVM if possible (taken from the previous OpenJDK build). (all-local): Depend on docs.stamp. (clean-local): Add clean-docs. (.PHONY): Add clean-docs, clean-plugin-docs, clean-netx-docs. (install-exec-local): Install the documentation if enabled. (docs): Meta-dependency for netx-docs and plugin-docs. (clean-docs): Likewise but for clean targets. (netx-docs): Build documentation for the NetX API. (clean-netx-docs): Remove the NetX docs. (plugin-docs): Build documentation for the plugin API. (clean-plugin-docs): Likewise. (bootstrap-directory): Link to javadoc binary. * acinclude.m4: (IT_FIND_JAVADOC): Find a javadoc binary, first checking user input, then the JDK and the path for 'javadoc' and 'gjdoc'. Also sets JAVADOC_SUPPORTS_J_OPTIONS if it does. * configure.ac: Call IT_FIND_JAVADOC. 2010-11-25 Omair Majid * Makefile.am (stamps/liveconnect.stamp): Set a bootclasspath to avoid using an older netx.jar during compilation. 2010-11-24 Omair Majid * netx/net/sourceforge/jnlp/util/FileUtils.java (createRestrictedDirectory): New method. Creates a directory with reduced permissions. (createRestrictedFile(File,boolean)): New method. Creates a file with reduced permissions. (createRestrictedFile(File,boolean,boolean): New method. Creates a file or a directory with reduced permissions. * netx/net/sourceforge/jnlp/Launcher.java (markNetxRunning): Do not grant unnecessary file permissions. * netx/net/sourceforge/jnlp/runtime/Boot.java: Remove umask from help message. * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java (activateNative): Create file with proper permissions. (getNativeDir): Create directory with proper permissions. * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java (initializeStreams): Create files with proper permissions. * netx/net/sourceforge/jnlp/security/CertWarningPane.java (CheckBoxListener.actionPerformed): Likewise. * netx/net/sourceforge/jnlp/security/KeyStores.java (createKeyStoreFromFile): Likewise. * netx/net/sourceforge/jnlp/security/viewer/CertificatePane.java (ImportButtonListener.actionPerformed): Likewise. (RemoveButtonListener.actionPerformed): Likewise. * netx/net/sourceforge/jnlp/services/SingleInstanceLock.java (createWithPort): Likewise. (getLockFile): Likewise. * netx/net/sourceforge/jnlp/services/XExtendedService.java (openFile): Likewise. * netx/net/sourceforge/jnlp/services/XPersistenceService.java (create): Likewise. * netx/net/sourceforge/jnlp/util/XDesktopEntry.java (installDesktopLauncher): Likewise. * netx/net/sourceforge/jnlp/resources/Messages.properties: Add CantCreateFile, RCantCreateDir and RCantRename. Remove BNoBase and BOUmask. 2010-11-24 Deepak Bhole Fix PR593: Increment of invalidated iterator in IcedTeaPluginUtils (patch from barbara.xxx1975@libero.it) * plugin/icedteanp/IcedTeaPluginUtils.cc (invalidateInstance): Act on the pointer directly, rather than via members. * NEWS: Updated. 2010-11-24 Deepak Bhole Fix PR552: Support for FreeBSD's pthread implementation (patch from jkim@freebsd.org) * plugin/icedteanp/IcedTeaNPPlugin.cc (NP_Shutdown): Do pthread_join after cancel to avoid destroying mutexes or condition variables in use. * plugin/icedteanp/IcedTeaPluginRequestProcessor.cc (PluginRequestProcessor): Initialize mutexes dynamically. (queue_cleanup): New method. Destroy dynamically created mytexes. (queue_processor): Initialize wait_mutex and push cleanup on exit. Clean up after processing stops. 2010-11-24 Andrew John Hughes * NEWS: Bring in changes from IcedTea6 1.10 NEWS (now redundant there) and apply same structure as in IcedTea6. 2010-11-24 Omair Majid CVE-2010-3860 IcedTea System property information leak via public static * netx/net/sourceforge/jnlp/runtime/Boot.java: Remove basedir option. Add NETX_ABOUT_FILE. (run): Remove call to JNLPRuntime.setBaseDir. (getAboutFile): Use the constant in this file, not JNLPRuntime. (getBaseDir): Remove obsolete method. * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java: Remove baseDir, USER, HOME_DIR, NETXRC_FILE, NETX_DIR, SECURITY_DIR, CERTFICIATES_FILE, JAVA_HOME_DIR, NETX_ABOUT_FILE. (initialize): Do not set baseDir. (getBaseDir): Remove method. (setBaseDir): Likewise. (getDefaultBaseDir): Likewise. (getProperties): Likewise. * netx/net/sourceforge/jnlp/security/SecurityUtil.java (getTrustedCertsFilename): Delegate to KeyStores.getKeyStoreLocation. * plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java (PluginAppletSecurityContext): Remove call to obsolete method. 2010-11-24 Omair Majid Fix PR592. * netx/net/sourceforge/jnlp/util/XDesktopEntry.java (getContentsAsReader): Sanitize information before adding to desktop file. (sanitize): New method. Ensure that there are no newlines in input. 2010-11-24 Omair Majid * netx/net/sourceforge/jnlp/resources/Messages.properties: Add CVCertificateType. * netx/net/sourceforge/jnlp/security/viewer/CertificatePane.java: Use CVCertificateType instead of hardcoded string. 2010-11-24 Omair Majid * netx/net/sourceforge/jnlp/SecurityDesc.java: Add grantAwtPermissions. (SecurityDesc): Set grantAwtPermissions. (getSandboxPermissions): Use grantAwtPermissions to determine whether to grant permissions. 2010-11-24 Matthias Klose * Makefile.am (javaws.desktop): Search javaws.desktop.in in $(srcdir). 2010-11-24 Matthias Klose * Makefile.am (LAUNCHER_LINK): Don't explicitely link with -lc, link with -pthread instead of -lpthread. (LAUNCHER_FLAGS): Add -pthread. 2010-11-24 Chris Coulson * Makefile.am (pluginappletviewer, javaws): Fix linking with --as-needed. 2010-11-23 Omair Majid * netx/net/sourceforge/jnlp/runtime/DeploymentConfiguration.java: Add KEY_PROXY_TYPE, KEY_PROXY_SAME, KEY_PROXY_AUTO_CONFIG_URL, KEY_PROXY_BYPASS_LIST, KEY_PROXY_BYPASS_LOCAL, KEY_PROXY_HTTP_HOST, KEY_PROXY_HTTP_PORT, KEY_PROXY_HTTPS_HOST, KEY_PROXY_HTTPS_PORT, KEY_PROXY_FTP_HOST, KEY_PROXY_FTP_PORT, KEY_PROXY_SOCKS4_HOST, KEY_PROXY_SOCKS4_PORT, and KEY_PROXY_OVERRIDE_HOSTS. (loadDefaultProperties): Use the new constants. * netx/net/sourceforge/jnlp/runtime/JNLPProxySelector.java: New class. (JNLPProxySelector): New method. (parseConfiguration): New method. Initializes this object by querying the configuration. (getHost): New method. (getPort): New method. (connectFailed): New method. (select): New method. Returns a list of appropriate proxies to use for a given uri. (inBypassList): New method. Return true if the host in the URI should be bypassed for proxy purposes. (isLocalHost): New method. (getFromConfiguration): New method. Finds a proxy based on configuration. (getFromPAC): New method. (getFromBrowser): New method. * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java (initialize): Install proxy selector and authenticator. * plugin/icedteanp/java/sun/applet/PluginMain.java (init): Do not install authenticator. (CustomAuthenticator): Moved to... * netx/net/sourceforge/jnlp/security/JNLPAuthenticator.java: Here. * plugin/icedteanp/java/sun/applet/PasswordAuthenticationDialog.java Moved to... * netx/net/sourceforge/jnlp/security /PasswordAuthenticationDialog.java: Here. * plugin/icedteanp/java/sun/applet/PluginProxySelector.java: Extend JNLPProxySelector. (select): Renamed to... (getFromBrowser): New method. 2010-11-19 Omair Majid * Makefile.am (EXTRA_DIST): Replace javaws.desktop with javaws.desktop.in. (all-local): Add javaws.desktop. (clean-local): Add dependency on clean-desktop-files. (.PHONY): Add clean-desktop- files. (clean-desktop-files): New target. (javaws.desktop): New target. Use the absolute path to javaws binary in the Exec= line to create the javaws.desktop file. * javaws.desktop: Renamed to... * javaws.desktop.in: New file. Does not contain Encoding key. Value for Icon does not contain extension. * netx/net/sourceforge/jnlp/util/XDesktopEntry.java (JAVA_ICON_NAME): Set to icon name without the extension. 2010-11-18 Omair Majid * netx/net/sourceforge/jnlp/SecurityDesc.java: Remove window banner permissions from sandboxPermissions and j2eePermissions. (getSandBoxPermissions): Dynamically add window banner permissions if allowed by configuration. * netx/net/sourceforge/jnlp/runtime/DeploymentConfiguration.java: Add KEY_SECURITY_PROMPT_USER, KEY_SECURITY_ALLOW_HIDE_WINDOW_WARNING, KEY_SECURITY_PROMPT_USER_FOR_JNLP, and KEY_SECURITY_INSTALL_AUTHENTICATOR. (loadDefaultProperties): Use the new constants. * netx/net/sourceforge/jnlp/security/SecurityWarning.java (showAccessWarningDialog): Check if the user should be prompted before prompting the user. (showNotAllSignedWarningDialog): Likewise. (showCertWarningDialog): Likewise. (showAppletWarning): Likewise. (shouldPromptUser): New method. Check if configuration allows showing user prompts. * netx/net/sourceforge/jnlp/services/ServiceUtil.java (checkAccess(AccessType,Object...)): Clarify javadocs. (checkAccess(ApplicationInstance,AccessType,Object...)): Clarify javadocs. Only prompt the user if showing JNLP prompts is ok. (shouldPromptUser): New method. Returns true if configuration allows for showing JNLP api prompts. * plugin/icedteanp/java/sun/applet/PluginMain.java (init): Only install custom authenticator if allowed by configuration. 2010-11-18 Omair Majid * netx/net/sourceforge/jnlp/runtime/DeploymentConfiguration.java: Add KEY_ENABLE_LOGGING. (loadDefaultProperties): Use KEY_ENABLE_LOGGING. * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java: Add redirectStreams, STDERR_FILE and STDOUT_FILE. (initialize): Call initializeStreams. (initializeStreams): New method. Redirects or duplicates stdout and stderr to the logging files as required. (setRedirectStreams): New method. Sets whether stdout/stderr streams should be redirected. * plugin/icedteanp/java/sun/applet/PluginMain.java: (PluginMain): Move code for creating logging files into JNLPRuntime. Call JNLPRuntime.setRedirectStreams to redirect streams. (TeeOutputStream): Move to its own class. * netx/net/sourceforge/jnlp/util/TeeOutputStream.java: Moved from PluginMain into this new class. 2010-11-18 Omair Majid * NEWS: Update with new interfaces * netx/javax/jnlp/DownloadService2.java: New interface. (ResourceSpec): New class. (ResourceSpec.ResourceSpec): New method. (ResourceSpec.getExpirationDate): New method. (ResourceSpec.getLastModified): New method. (ResourceSpec.getSize): New method. (ResourceSpec.getType): New method. (ResourceSpec.getUrl): New method. (ResourceSpec.getVersion): New method. (getCachedResources): New method. (getUpdateAvaiableReosurces): New method. * netx/javax/jnlp/IntegrationService.java: New interface. (hasAssociation): New method. (hasDesktopShortcut): New method. (hasMenuShortcut): New method. (removeAssociation): New method. (removeShortcuts): New method. (requestAssociation): New method. (requestShortcut): New method. 2010-11-16 Andrew Su * netx/net/sourceforge/jnlp/runtime/DeploymentConfiguration.java: Corrected typo in one of the default values. 2010-11-11 Omair Majid * netx/net/sourceforge/jnlp/runtime/Boot.java (main): Move trust manager initialization code into JNLPRuntime.initialize. * plugin/icedteanp/java/sun/applet/PluginMain.java (init): Likewise. * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java (initialize): Set the default SSL TrustManager here. * netx/net/sourceforge/jnlp/security/CertWarningPane.java (CheckBoxListener.actionPerformed): Add this certificate into user's trusted certificate store. * netx/net/sourceforge/jnlp/tools/KeyTool.java (addToKeyStore(File,KeyStore)): Move to CertificateUtils. (addToKeyStore(X509Certificate,KeyStore)): Likewise. (dumpCert): Likewise. * netx/net/sourceforge/jnlp/security/CertificateUtils.java: New class. (addToKeyStore(File,KeyStore)): Moved from KeyTool. (addToKeyStore(X509Certificate,KeyStore)): Likewise. (dumpCert): Likewise. (inKeyStores): New method. * netx/net/sourceforge/jnlp/security/HttpsCertVerifier.java (getRootInCacerts): Check all available CA store to check if root is in CA certificates. * netx/net/sourceforge/jnlp/security/KeyStores.java (getKeyStore(Level,Type,boolean)): Add security check. (getClientKeyStores): New method. * netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java (VariableX509TrustManager): Initialize multiple CA, certificate and client trust managers. (checkClientTrusted): Check all the client TrustManagers if certificate is trusted. (checkAllManagers): Check multiple CA certificates and trusted certificates to determine if the certificate chain can be trusted. (isExplicitlyTrusted): Check with multiple TrustManagers. (getAcceptedIssuers): Gather results from multiple TrustManagers. * netx/net/sourceforge/jnlp/security/viewer/CertificatePane.java (ImportButtonListener): Use CertificateUtils instead of KeyTool. * netx/net/sourceforge/jnlp/tools/JarSigner.java (checkTrustedCerts): Use multiple key stores to check if certificate is directly trusted and if the root is trusted. 2010-11-09 Omair Majid * netx/net/sourceforge/jnlp/resources/Messages.properties: Add ButAllow, ButClose, ButCopy, ButMoreInformation, ButProceed, ButRun, AlwaysAllowAction, Continue, Field, From, Name, Publisher, Value, Version, SNoAssociatedCertificate, SAlwaysTrustPublisher, SHttpsUnverified, SNotAllSignedSummary, SNotAllSignedDetail, SNotAllSignedQuestion, SCertificateDetails, SIssuer, SSerial, SMD5Fingerprint, SSHA1Fingerprint, SSignature, SSignatureAlgorithm, SSubject, SValidity, CVCertificateViewer, CVDetails, CVIssuedTo, CVExport, CVImport, CVIssuedBy, IssuedTo, CVRemove, CVRemoveConfirmMessage,CVRemoveConfirmTitle, CVUser, CVSystem, KS, KSCerts, KSJsseCerts, KSCaCerts, KSJsseCaCerts, and KSClientCerts. * netx/net/sourceforge/jnlp/security/AccessWarningPane.java (addComponents): Use localized strings. * netx/net/sourceforge/jnlp/security/CertWarningPane.java (addComponents): Likewise. * netx/net/sourceforge/jnlp/security/CertsInfoPane.java (parseCert): Likewise. (addComponents): Likewise. * netx/net/sourceforge/jnlp/security/MoreInfoPane.java (addComponents): Likewise. * netx/net/sourceforge/jnlp/security/NotAllSignedWarningPane.java (addComponents): Likewise. * netx/net/sourceforge/jnlp/security/viewer/CertificatePane.java: Likewise. (addComponents): Likewise. (CertificateType.toString): Likewise. (RemoveButtonListener.actionPerformed): Likewise. 2010-11-05 Omair Majid * netx/net/sourceforge/jnlp/runtime/DeploymentConfiguration.java: Add KEY_BROWSER_PATH. (loadDefaultProperties): Use KEY_BROWSER_PATH. * netx/net/sourceforge/jnlp/services/XBasicService.java (initialize): Use the browser command from the configuration. Save updates to configuration as well. 2010-11-05 Omair Majid * netx/net/sourceforge/jnlp/ShortcutDesc.java: Change prefixes from SHORTCUT_ to CREATE_. * netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java (addMenuAndDesktopEntries): Call shouldCreateShortcut to find out if shortcut should be created. Remove call to checkAccess which does nothing as the entire stack contains trusted classes. (shouldCreateShortcut): New method. Use the configuration to find out if a shorcut should be created, and possibly prompt the user. * netx/net/sourceforge/jnlp/runtime/DeploymentConfiguration.java: Add KEY_CREATE_DESKTOP_SHORTCUT. (loadDefaultProperties): Use KEY_CREATE_DESKTOP_SHORTCUT. 2010-11-08 Omair Majid * Makefile.am (JDK_UPDATE_VERSION): Define variable. 2010-11-04 Omair Majid * netx/net/sourceforge/jnlp/runtime/DeploymentConfiguration.java: Add KEY_USER_TRUSTED_CA_CERTS, KEY_USER_TRUSTED_JSSE_CA_CERTS, KEY_USER_TRUSTED_CERTS, KEY_USER_TRUSTED_JSSE_CERTS, KEY_USER_TRUSTED_CLIENT_CERTS, KEY_SYSTEM_TRUSTED_CA_CERTS, KEY_SYSTEM_TRUSTED_JSSE_CA_CERTS, KEY_SYSTEM_TRUSTED_CERTS, KEY_SYSTEM_TRUSTED_JSSE_CERTS, KEY_SYSTEM_TRUSTED_CLIENT_CERTS (loadDefaultProperties): Use the defined constants. * netx/net/sourceforge/jnlp/security/KeyStores.java: New class. (getPassword): New method. Return the default password used for KeyStores. (getKeyStore(Level,Type)): New method. Returns the appropriate KeyStore. (getKeyStore(Level,Type,String)): Likewise. (getCertKeyStores): New method. Return all the trusted certificate KeyStores. (getCAKeyStores): New method. Return all the trusted CA certificate KeyStores. (getKeyStoreLocation): New method. Return the location of the appropriate KeyStore. (toTranslatableString): New method. Return a string that can be used to create a human-readable name for the KeyStore. (toDisplayableString): New method. Return a human-readable name for the KeyStore. (createKeyStoreFromFile): New method. Creates a new KeyStore object, initializing it from the given file if possible. * netx/net/sourceforge/jnlp/security/viewer/CertificatePane.java (CertificatePane): Create two JTables. Populate the tables when done creating the user interface. (initializeKeyStore): Use the correct keystore. (addComponents): Do not read KeyStore. Create more interface elements to show the new possible KeyStores. Mark some buttons to be disabled when needed. (repopulateTable): Renamed to... (repopulateTables): New method. Read KeyStore and use the contents to create the user and system tables. (CertificateType): New class. (CertificateTypeListener): New class. Listens to JComboBox change events. (TabChangeListener): New class. Listens to new tab selections. (ImportButtonListener): Import certificates to the appropriate KeyStore. (ExportButtonListener): Find the certificate from the right table. (RemoveButtonListener): Find the certificate from the right table and right the KeyStore. (DetailsButtonListener): Find the certificate from the right table. * netx/net/sourceforge/jnlp/security/viewer/CertificateViewer.java (showCertficaiteViewer): Initialize the JNLPRuntime so the configuration gets loaded. * netx/net/sourceforge/jnlp/tools/KeyTool.java (addToKeyStore(File,KeyStore)): New method. Adds certificate from the file to the KeyStore. (addToKeyStore(X509Certificate,KeyStore)): New method. Adds a certificate to a KeyStore. 2010-11-04 Deepak Bhole * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java (update): Override method and implement double-buffering. 2010-10-28 Andrew John Hughes * Makefile.am: (NETX_BOOTSTRAP_CLASSES): Removed. (PLUGIN_BOOTSTRAP_CLASSES): Likewise. (NETX_SUN_CLASSES): Likewise. (PLUGIN_SUN_CLASSES): Likewise. * acinclude.m4: (IT_CHECK_FOR_CLASS): Require detection of javac and java. Put test class in sun.applet to get access to some internal classes. Change test to use forName for the same reason. I expect to be able to revert this when usage of sun.applet is fixed. (IT_FIND_JAVA): Ported from IcedTea6. Change to prioritise 'java' over 'gij'. * configure.ac: Add IT_CHECK_FOR_CLASS checks for classes which are required but not found in JDKs other than Oracle-based ones. Also check for java.* classes missing from current versions of gcj but which may appear there in future. 2010-11-03 Omair Majid * netx/net/sourceforge/jnlp/Launcher.java (markNetxRunning): Get file name from configuration. (markNetxStopped): Likewise. * netx/net/sourceforge/jnlp/cache/CacheUtil.java (clearCache): Get cache directory from configuration. (okToClearCache): Get netx_running file from configuration. (getCacheFile): Get cache directory from configuration. (urlToPath): Change semantics to take in the full path of the directory instead of a directory under runtime. * netx/net/sourceforge/jnlp/runtime/DeploymentConfiguration.java: Change DEPLOYMENT_DIR to ".icedtea". Add constants KEY_USER_CACHE_DIR, KEY_USER_PERSISTENCE_CACHE_DIR, KEY_SYSTEM_CACHE_DIR, KEY_USER_LOG_DIR, KEY_USER_TMP_DIR, KEY_USER_LOCKS_DIR, and KEY_USER_NETX_RUNNING_FILE. (load): Use DEPLOYMENT_DIR instead of hardcoded string. (loadDefaultProperties): Add LOCKS_DIR. Replace strings with constants. Add new default values for persistence cache directory, single instance locks directory and the netx_running file. * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java: Remove unneeded TMP_DIR, LOCKS_DIR and NETX_RUNNING_FILE * netx/net/sourceforge/jnlp/services/SingleInstanceLock.java (getLockFile): Get locks directory from configuration. * netx/net/sourceforge/jnlp/services/XPersistenceService.java (toCacheFile): Get persistence cache directory from configuration. * netx/net/sourceforge/jnlp/util/XDesktopEntry.java (getContentsAsReader): Get cache directory from configuration. (installDesktopLauncher): Get temporary directory from configuration. Make parent directories if required. * plugin/icedteanp/java/sun/applet/JavaConsole.java (initialize): Get log directory from configuration and create the error and output files under it. * plugin/icedteanp/java/sun/applet/PluginMain.java: PLUGIN_STDERR_FILE and PLUGIN_STDOUT_FILE are now just filesnames. (PluginMain): Use configuration for finding the log directory. Initialize JNLPRuntime before creating the stderr and stdout logs. 2010-11-01 Omair Majid * Makefile.am (clean-IcedTeaPlugin): Only delete launcher directory if it exists. 2010-11-01 Deepak Bhole PR542: Plugin fails with NPE on http://www.openprocessing.org/visuals/iframe.php?visualID=2615 * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java (initializeResources): If cacheFile is null (JAR couldn't be downloaded), try to continue, rather than allowing the exception to cause an abort. * NEWS: Updated. 2010-11-01 Deepak Bhole * plugin/docs: Added new docs folder that contains plugin documentation. * plugin/docs/MessageBusArchitecture.png: Diagram of the JS <-> Java message handling architectrure. * plugin/docs/OverallArchitecture.png: Diagram of the overall plugin architecture. * plugin/docs/java-js-wf.png: Sequence diagram showing an example LiveConnect call from an applet to JavaScript/Browser. * plugin/docs/js-java-wf.png: Sequence diagram showing an example LiveConnect call from JavaScript/Browser to an applet. * plugin/docs/npplugin_liveconnect_design.pdf: Slides with notes on the above diagrams. 2010-10-29 Omair Majid * netx/net/sourceforge/jnlp/JNLPFile.java: Add component. (getLaunchInfo): Modify javadoc to indicate that it does not return the ComponentDesc. (getComponent): Return component instead of launchType. (isComponent): Check if component is not null. (parse): Find and set component descriptor. * netx/net/sourceforge/jnlp/Parser.java (getLauncher): Remove all checks for component-desc. Allow having none of application-desc, applet-desc and installer-desc. (getComponent): Check for more than one component-desc element. Read and parse the component-desc. 2010-10-28 Omair Majid * netx/net/sourceforge/jnlp/security/SecurityWarningDialog.java (showMoreInfoDialog): Make dialog modal. (showCertInfoDialog): Likewise. (showSingleCertInfoDialog): Likewise. (initDialog): Use setModality instead of setModal. 2010-10-27 Deepak Bhole * plugin/icedteanp/IcedTeaNPPlugin.cc (plugin_create_applet_tag): Escape the entire applet tag, not just the params. 2010-10-27 Omair Majid * netx/net/sourceforge/jnlp/runtime/DeploymentConfiguration.java (load): Do a security check at start. A security exception later on may accidentally reveal a filename or a system property. (save): Likewise. 2010-10-26 Omair Majid * netx/net/sourceforge/jnlp/Launcher.java (doPerApplicationAppContextHacks): New method. Create a new ParserDelegate to intialize the per AppContext dtd used by Swing HTML controls. (TgThread.run): Call doPerApplicationAppContextHacks. * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java (initialize): Call doMainAppContextHacks. (doMainAppContextHacks): New method. Create a new ParserDelegate to initialize the per AppContext dtd used by Swing HTML controls. 2010-10-26 Omair Majid * netx/net/sourceforge/jnlp/Launcher.java (launchApplication): Mark main method as accessible before invoking it. 2010-10-26 Omair Majid * netx/net/sourceforge/jnlp/Parser.java: Add 1.1, 1.2, 1.3 and 1.4 to supportedVersions. 2010-10-26 Omair Majid * netx/net/sourceforge/jnlp/runtime/Translator.java (R(String)): New method. 2010-10-26 Deepak Bhole * netx/net/sourceforge/jnlp/PluginBridge.java: Trim whitespace from jar names in the constructor. 2010-10-26 Deepak Bhole * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java: Replace all status.put calls with calls to updateStatus(). (createPanel): Create a frame with a 0 handle. Use the new waitForAppletInit function to wait until applet is ready. (reFrame): Re-order code so that the panel is never parentless. (handleMessage): Re-wrote message processing to handle destroy calls correctly, checking for them more often to prevent a frame from popping up if the tab/page is closed before loading finishes. Decode special characters in the message. (updateStatus): New function. Updates the status for the given instance if applicable. (destroyApplet): New function. Destroys a given applet and frees related resources. (waitForAppletInit): New function. Blocks until applet is initialized. (parse): Remove part that decoded the params. Decoding is now done earlier in handleMessage(). * plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java: (getPriorityStrIfPriority): Mark destroy messages as priority. (bringPriorityMessagesToFront): Scans the queue for priority messages and brings them to the front. (run): If the queue is not empty and there are no workers left, run bringPriorityMessagesToFront() and retry. 2010-10-26 Andrew Su * Makefile.am: Split rm -rf into rm -f and rmdir for launcher directory. 2010-10-25 Omair Majid * netx/net/sourceforge/jnlp/ShortcutDesc.java: Add SHORTCUT_NEVER, SHORTCUT_ALWAYS, SHORTCUT_ASK_USER, SHORTCUT_ASK_USER_IF_HINTED, SHORTCUT_ALWAYS_IF_HINTED, SHORTCUT_DEFAULT. * netx/net/sourceforge/jnlp/resources/Messages.properties: Add RConfigurationError. * netx/net/sourceforge/jnlp/runtime/DeploymentConfiguration.java: New file. (ConfigValue): New class. Holds a configuration value. (DeploymentConfiguration): New method. (load): New method. (getProperty): Likewise. (getAllPropertyNames): Likewise. (setProperty): Likewise. (loadDefaultProperties): Likewise. (findSystemConfigFile): Likewise. (loadSystemConfiguration): Likewise. (loadProperties): Likewise. (save): Likewise. (parsePropertiesFile): Likewise. (mergeMaps): Likewise. (dumpConfiguration): Likewise. * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java: (initialize): Load configuration. (getConfiguration): Return the configuration. 2010-10-25 Omair Majid * net/sourceforge/jnlp/ExtensionDesc.java: Import Translator.R and use that. * net/sourceforge/jnlp/JNLPFile.java: Import Translator.R. (R): Remove. * net/sourceforge/jnlp/JREDesc.java: Import Translator.R. (checkHeapSize): Use R instead of JNLPRuntime.getMessage. * net/sourceforge/jnlp/Launcher.java: Import Translator.R. (R): Remove. * net/sourceforge/jnlp/Parser.java: Import Translator.R (R(String)): Remove. (R(String,Object)): Remove. (R(String,Object,Object)): Remove. (R(String,Object,Object,Object)): Remove. * net/sourceforge/jnlp/cache/CacheEntry.java: Import Translator.R (CacheEntry): Use R instead of JNLPRuntime.getMessage. * net/sourceforge/jnlp/cache/CacheUtil.java: Import Translator.R (R(String)): Remove. (R(String,Object)): Remove. * net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java: Import Translator.R and use that instead of JNLPRuntime.getMessage. * net/sourceforge/jnlp/runtime/Boot.java: Import Translator.R. (R(String)): Remove. (R(String, Object)): Remove. (run): Use R instead of JNLPRuntime.getMessage. * net/sourceforge/jnlp/runtime/JNLPClassLoader.java: Import Translator.R. (R): Remove. * net/sourceforge/jnlp/runtime/JNLPSecurityManager.java: Import Translator.R. Use it instead of JNLPRuntime.getMeesage. (R): Remove. * net/sourceforge/jnlp/security/AccessWarningPane.java: Import Translator.R. * net/sourceforge/jnlp/security/CertWarningPane.java: Likewise. * net/sourceforge/jnlp/security/HttpsCertVerifier.java: Import Translator.R. (R(String)): Remove. (R(String,String,String)): Remove. * net/sourceforge/jnlp/security/MoreInfoPane.java: Import Translator.R. * net/sourceforge/jnlp/security/SecurityDialogPanel.java (R(String)): Remove. (R(String,Object)): Remove. * net/sourceforge/jnlp/services/ServiceUtil.java (R): Remove. * net/sourceforge/jnlp/services/SingleInstanceLock.java: Import Translator.R (R(String)): Remove. (R(String,Object)): Remove. * net/sourceforge/jnlp/tools/JarSigner.java: Import Translator.R. (R): Remove. * net/sourceforge/jnlp/runtime/Translator.java: New file (R(String,Object...)): New method. 2010-10-25 Andrew Su * Makefile.am: (clean-IcedTeaPlugin): Remove launcher folder first. (clean-plugin): Removed called to remove launcher folder 2010-10-22 Omair Majid * netx/net/sourceforge/jnlp/NetxPanel.java (runLoader): Do not initialize JNLPRuntime here. (createAppletThreads): Initialize JNLPRuntim here. * netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java: Switch from SecurityWarningDialog.AccessType to SecurityWarning.AccessType. * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java (getInstance(JNLPFile,UpdatePolicy)): Switch to SecurityWarning. (initializeResources): Likewise. (checkTrustWithUser): Likewise. * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java: Add securityDialogMesasgeHandler. (initialize): Set System look and feel. Start security thread. (startSecurityThread): New method. Starts a thread to show security dialogs. (getSecurityDialogHandler): Returns the securityDialogMessageHandler. * netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java: Switch from SecurityWarningDialog.AccessType to SecurityWarning.AccessType. (checkAwtEventQueueAccess): New method. Skeleton code for allowing EventQueue acccess to applets. * netx/net/sourceforge/jnlp/security/AccessWarningPane.java: Switch from SecurityWarningDialog.AccessType to SecurityWarning.AccessType. * netx/net/sourceforge/jnlp/security/CertWarningPane.java: Likewise. * netx/net/sourceforge/jnlp/security/SecurityWarningDialog.java: Move DialogType and AccessType to SecurityWarning. (SecurityWarningDialog(DialogType,AccessType,JNLPFile,CertVerifier, X509Certificate,Object[])): New method. The catch-all construction. (SecurityWarningDialog(DialogType,AccessType,JNLPFile): Delegate to the new constructor. (SecurityWarningDialog(DialogType,AccessType,JNLPFile,CertVerifier)): Likewise. (SecurityWarningDialog(DialogType,AccessType,CertVerifier)): Likewise. (SecurityWarningDialog(DialogType,AccessType,JNLPFile,Object[])): Likewise. (SecurityWarningDialog(DialogType,X509Certificate)): Likewise. (showAccessWarningDialog(AccessType,JNLPFile)): Move to SecurityWarning class. (showAccessWarningDialog(AccessType,JNLPFile,Object[])): Likewise. (showNotAllSignedWarningDialog(JNLPFile)): Likewise. (showCertWarningDialog(AccessType,JNLPFile,CertVerifier)): Likewise. (showAppletWarning): Likewise. (initDialog): Make dialog non modal and remove window closing listener. (getValue): Make public. (dispose): New method. Notify listeners. (notifySelectionMade): New method. Notify listeners that user has made a decision. (addActionListener): New method. Add a listener to be notified when user makes a decision about this security warning. * netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java: Switch from SecurityWarningDialog.AccessType to SecurityWarning.AccessType. * netx/net/sourceforge/jnlp/services/ServiceUtil.java: Likewise. * netx/net/sourceforge/jnlp/services/XClipboardService.java: Likewise. * netx/net/sourceforge/jnlp/services/XExtendedService.java: Likewise. * netx/net/sourceforge/jnlp/services/XFileOpenService.java: Likewise. * netx/net/sourceforge/jnlp/services/XFileSaveService.java: Likewise. * netx/net/sourceforge/jnlp/security/SecurityDialogMessage.java: New class. * netx/net/sourceforge/jnlp/security/SecurityDialogMessageHandler.java: New class. (run): New method. Runs the security message loop. (handleMessage): New method. Handles a SecurityDialogMessage to show a security warning. (postMessage): New method. Posts a message to sthe security message queue. * netx/net/sourceforge/jnlp/security/SecurityWarning.java: New class. Move AccessType and DialogType from SecurityWarningDialog to here. (showAccessWarningDialog): Moved from SecurityWarningDialog to here. (showAccessWarningDialog): Moved from SecurityWarningDialog to here. Modified to post messages to the security queue instead of showing a SecurityWarningDialog directly. (showNotAllSignedWarningDialog): Likewise. (showCertWarningDialog): Likewise. (showAppletWarning): Likewise. (getUserReponse): New method. Posts a message to the security thread and blocks until it gets a response from the user. 2010-10-20 Andrew John Hughes * netx/javax/jnlp/ServiceManager.java: (lookupTable): Add generic types. * netx/net/sourceforge/jnlp/AppletDesc.java: (parameters): Likewise. (AppletDesc(String,String,URL,int,int,Map)): Likewise. (getParameters()): Likewise. * netx/net/sourceforge/jnlp/ApplicationDesc.java: (getArguments()): Remove redundant cast. (addArgument(String)): Add generic typing. * netx/net/sourceforge/jnlp/ExtensionDesc.java: (extToPart): Add generic types. (eagerExtParts): Likewise. * netx/net/sourceforge/jnlp/InformationDesc.java: (info): Likewise. (getIcons(Object)): Add generic typing. (getAssociations()): Likewise. (getRelatedContents()): Likewise. (getItem(Object)): Likewise. (getItems(Object)): Likewise. (addItem(String,Object)): Likewise. * netx/net/sourceforge/jnlp/JNLPFile.java: (resources): Likewise. (InformationDesc.getItems(Object)): Likewise. (getResources(Class)): Likewise. * netx/net/sourceforge/jnlp/LaunchException.java: (getCauses()): Likewise. * netx/net/sourceforge/jnlp/Launcher.java: (launchApplication(JNLPFile)): Likewise. * netx/net/sourceforge/jnlp/NetxPanel.java: (NetxPanel(URL,Hashtable)): Likewise. (NetxPanel(URL,Hashtable,boolean)): Likewise. * netx/net/sourceforge/jnlp/Node.java: (getChildNodes()): Likewise. * netx/net/sourceforge/jnlp/Parser.java: (getResources(Node,boolean)): Likewise. (getInfo(Node)): Likewise. (getInformationDesc(Node)): Likewise. (getApplet(Node)): Likewise. (getApplication(Node)): Likewise. (splitString(String)): Likewise. (getLocales(Node)): Likewise. (getChildNodes(Node,String)): Likewise. * netx/net/sourceforge/jnlp/PluginBridge.java: Fix variable naming and add generic types. (cacheJars): Changed from cache_jars. (cacheExJars): Changed from cache_ex-jars. (atts): Add generic typing. (PluginBridge(URL,URL,String,String,int,int,Hashtable)): Likewise. (getInformation(Locale)): Likewise. (getResources(Locale,String,String)): Likewise. (getJARs()): Avoid excessive copying; filtering already performed by getResources in JNLPFile. * netx/net/sourceforge/jnlp/ResourcesDesc.java: (resources): Add generic typing. (getJREs()): Likewise. (getJARs()): Likewise. (getJARs(String)): Likewise. (getExtensions()): Likewise. (getPackages()): Likewise. (getPackages(String)): Likewise. (getProperties()): Likewise. (getPropertiesMap()): Likewise. (getResources(Class)): Make generic. * netx/net/sourceforge/jnlp/Version.java: (matches(Version)): Add generic types. (matchesAny(Version)): Likewise. (matchesSingle(String)): Likewise. (matches(String,String)): Likewise. (equal(List,List)): Likewise. (greater(List,List)): Likewise. (compare(String,String)): Use Integer.valueOf. (normalize(List,int)): Add generic types, using a List of lists rather than an array of lists. (getVersionStrings()): Add generic types. (getParts()): Likewise. * netx/net/sourceforge/jnlp/cache/CacheUtil.java: (waitForResources(ApplicationInstance,ResourceTracker, URL,String)): Likewise. * netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java: (getListener(ApplicatonInstance,String,URL)): Use setVisible instead of show(). (disposeListener(DownloadServiceListener)): Use setVisible instead of hide(). (DownloadPanel.urls): Add generic typing. (DownloadPanel.panels): Likewise. (DownloadPanel.update(URL,String,long,long,int)): Fix formatting. Add generic types. * netx/net/sourceforge/jnlp/cache/Resource.java: (resources): Add generic typing. (trackers): Likewise. (getResource(URL,Version,UpdatePolicy)): Use generic types. (getTracker()): Likewise. (addTracker(ResourceTracker)): Likewise. (fireDownloadEvent()): Likewise. * netx/net/sourceforge/jnlp/cache/ResourceTracker.java: (prefetchTrackers): Add generic typing. (queue): Likewise. (active): Likewise. (resources): Likewise. (listeners): Likewise. (fireDownloadEvent(Resource)): Remove unneeded cast. (getPrefetch()): Use generic typing. (selectByFlag(List,int,int)): Likewise. (getResource(URL)): Likewise. * netx/net/sourceforge/jnlp/runtime/AppletEnvironment.java: (weakClips): Add generic types. (destroy()): Use generic typing. (getApplets()): Likewise. (getStreamKeys()): Likewise. * netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java: (weakWindows): Add generic types. (installEnvironment()): Likewise. (destroy()): Remove redundant cast. * netx/net/sourceforge/jnlp/runtime/Boot.java: Extend PrivilegedAction. (run()): Add generic typing. (getOptions(String)): Likewise. * netx/net/sourceforge/jnlp/runtime/Boot13.java: (main(String[]): Likewise. * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: Fix formatting. (urlToLoader): Add generic types. (resourcePermissions): Likewise. (available): Likewise. (jarEntries): Likewise. (getInstance(JNLPFile,UpdatePolicy)): Remove redundant cast. (getInstance(URL,String,Version,UpdatePolicy)): Likewise. (initializeExtensions()): Add generic types. (initializePermissions()): Likewise. (initializeResources()): Likewise. (getPermissions(CodeSource)): Likewise. (fillInPartJars(List)): Likewise. (activateJars(List)): Likewise. (loadClass(String)): Likewise. Suppress warnings due to sun.misc.JarIndex usage. (findResources(String)): Mark as overriding. Add generic types. (getExtensionName()): Add @Deprecated annotation. (getExtensionHREF()): Likewise. * netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java: (weakWindows): Add generic typing. (weakApplications): Likewise. (getApplication(Window)): Remove redundant casts. Add w, which is window cast to Window. * netx/net/sourceforge/jnlp/services/ServiceUtil.java: (invoke(Object,Method,Object[])): Use generic types. * netx/net/sourceforge/jnlp/services/XPersistenceService.java: (getNames(URL)): Likewise. * netx/net/sourceforge/jnlp/tools/JarSigner.java: (verifyJars(List,ResourceTracker)): Remove redundant cast. * netx/net/sourceforge/jnlp/util/WeakList.java: Redesign as a generic type. (refs): Add generic types. (deref(WeakReference)): Likewise. (get(int)): Likewise. (set(int,Object)): Likewise. (add(int,E)): Likewise. (remove()): Likewise. (hardList()): Likewise. * netx/net/sourceforge/nanoxml/XMLElement.java: (attributes): Add generic typing. (children): Likewise. (entities): Likewise. (XMLElement()): Use generic types. (XMLElement(Hashtable): Likewise. (resolveEntity(StringBuffer)): Remove redundant cast. 2010-10-20 Omair Majid * AUTHORS: Add Francis Kung, Andrew Su, Joshua Sumali, Mark Wielaard and Man Lung Wong. Add link to forked Netx project. 2010-10-20 Matthias Klose * AUTHORS: Add myself. 2010-10-20 Andrew Su * PluginBridge.java: (PluginBridge): Added parsing for jnlp_href, and reading the jnlp file for applet parameters. 2010-10-20 Matthias Klose * Makefile.am (stamps/extra-class-files.stamp): Fix -sourcepath. 2010-10-20 Omair Majid * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java (initializeResources): Do not perform url encoding on the file url. Stay consistent with the unencoded urls used in getPermissions. 2010-10-20 Omair Majid * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java (JNLPClassLoader): Call installShutdownHooks. (installShutdownHooks): New method. Installs a shutdown hook to recursively delete the contents of nativeDir. (activateNative): Only create a nativeDir if there are native libraries. 2010-10-19 Deepak Bhole * Makefile.am: ($(NETX_DIR)/launcher/javaws): Use $(NETX_DIR). 2010-10-19 Deepak Bhole * Makefile.am: (NETX_DIR): New variable representing the NetX build dir. (NETX_LAUNCHER_OBJECTS): Prefix with $(NETX_DIR). (LAUNCHER_LINK): Fixed escaping of ORIGIN to the rpath argument. (all-local): Fix javaws launcher path. (install-exec-local): Likewise, and use $(NETX_DIR) for NetX classes.jar. (clean-plugin): Remove launcher. (liveconnect): Use NETX_DIR in classpath. (netx): Use NETX_DIR throughout. (netx-dist): Likewise. (clean-netx): Likewise. ($(NETX_DIR)/launcher/%.o)): Likewise. * launcher/jni_md.h: Imported from OpenJDK. 2010-10-20 Matthias Klose * Makefile.am: Fix build with builddir != srcdir. 2010-10-19 Andrew John Hughes * Makefile.am: (PLUGIN_LAUNCHER_OBJECTS): Do prefixing once. (NETX_LAUNCHER_OBJECTS): Likewise for NetX. (pluginappletviewer): Use PLUGIN_LAUNCHER_OBJECTS. (javaws): Use NETX_LAUNCHER_OBJECTS. * configure.ac: Re-enable foreign (I want to use GNU make!) * README: Use gmake not make. 2010-10-19 Andrew John Hughes * .hgignore, * Makefile.am, * acinclude.m4, * autogen.sh, * configure.ac, * extra/net/sourceforge/jnlp/about/HTMLPanel.java, * extra/net/sourceforge/jnlp/about/Main.java, * extra/net/sourceforge/jnlp/about/resources/about.html, * extra/net/sourceforge/jnlp/about/resources/applications.html, * extra/net/sourceforge/jnlp/about/resources/notes.html, * javac.in, * javaws.desktop: Imported from IcedTea6. * launcher/java.c, * launcher/java.h, * launcher/java_md.c, * launcher/java_md.h, * launcher/jli_util.h, * launcher/jni.h, * launcher/jvm.h, * launcher/jvm_md.h, * launcher/manifest_info.h, * launcher/splashscreen.h, * launcher/splashscreen_stubs.c, * launcher/version_comp.h, * launcher/wildcard.h: Imported from OpenJDK. * netx/javaws.1, * netx/javax/jnlp/BasicService.java, * netx/javax/jnlp/ClipboardService.java, * netx/javax/jnlp/DownloadService.java, * netx/javax/jnlp/DownloadServiceListener.java, * netx/javax/jnlp/ExtendedService.java, * netx/javax/jnlp/ExtensionInstallerService.java, * netx/javax/jnlp/FileContents.java, * netx/javax/jnlp/FileOpenService.java, * netx/javax/jnlp/FileSaveService.java, * netx/javax/jnlp/JNLPRandomAccessFile.java, * netx/javax/jnlp/PersistenceService.java, * netx/javax/jnlp/PrintService.java, * netx/javax/jnlp/ServiceManager.java, * netx/javax/jnlp/ServiceManagerStub.java, * netx/javax/jnlp/SingleInstanceListener.java, * netx/javax/jnlp/SingleInstanceService.java, * netx/javax/jnlp/UnavailableServiceException.java, * netx/net/sourceforge/jnlp/AppletDesc.java, * netx/net/sourceforge/jnlp/ApplicationDesc.java, * netx/net/sourceforge/jnlp/AssociationDesc.java, * netx/net/sourceforge/jnlp/ComponentDesc.java, * netx/net/sourceforge/jnlp/DefaultLaunchHandler.java, * netx/net/sourceforge/jnlp/ExtensionDesc.java, * netx/net/sourceforge/jnlp/IconDesc.java, * netx/net/sourceforge/jnlp/InformationDesc.java, * netx/net/sourceforge/jnlp/InstallerDesc.java, * netx/net/sourceforge/jnlp/JARDesc.java, * netx/net/sourceforge/jnlp/JNLPFile.java, * netx/net/sourceforge/jnlp/JNLPSplashScreen.java, * netx/net/sourceforge/jnlp/JREDesc.java, * netx/net/sourceforge/jnlp/LaunchException.java, * netx/net/sourceforge/jnlp/LaunchHandler.java, * netx/net/sourceforge/jnlp/Launcher.java, * netx/net/sourceforge/jnlp/MenuDesc.java, * netx/net/sourceforge/jnlp/NetxPanel.java, * netx/net/sourceforge/jnlp/Node.java, * netx/net/sourceforge/jnlp/PackageDesc.java, * netx/net/sourceforge/jnlp/ParseException.java, * netx/net/sourceforge/jnlp/Parser.java, * netx/net/sourceforge/jnlp/PluginBridge.java, * netx/net/sourceforge/jnlp/PropertyDesc.java, * netx/net/sourceforge/jnlp/RelatedContentDesc.java, * netx/net/sourceforge/jnlp/ResourcesDesc.java, * netx/net/sourceforge/jnlp/SecurityDesc.java, * netx/net/sourceforge/jnlp/ShortcutDesc.java, * netx/net/sourceforge/jnlp/StreamEater.java, * netx/net/sourceforge/jnlp/UpdateDesc.java, * netx/net/sourceforge/jnlp/Version.java, * netx/net/sourceforge/jnlp/cache/CacheEntry.java, * netx/net/sourceforge/jnlp/cache/CacheUtil.java, * netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java, * netx/net/sourceforge/jnlp/cache/DownloadIndicator.java, * netx/net/sourceforge/jnlp/cache/Resource.java, * netx/net/sourceforge/jnlp/cache/ResourceTracker.java, * netx/net/sourceforge/jnlp/cache/UpdatePolicy.java, * netx/net/sourceforge/jnlp/cache/package.html, * netx/net/sourceforge/jnlp/event/ApplicationEvent.java, * netx/net/sourceforge/jnlp/event/ApplicationListener.java, * netx/net/sourceforge/jnlp/event/DownloadEvent.java, * netx/net/sourceforge/jnlp/event/DownloadListener.java, * netx/net/sourceforge/jnlp/event/package.html, * netx/net/sourceforge/jnlp/package.html, * netx/net/sourceforge/jnlp/resources/Manifest.mf, * netx/net/sourceforge/jnlp/resources/Messages.properties, * netx/net/sourceforge/jnlp/resources/about.jnlp, * netx/net/sourceforge/jnlp/resources/default.jnlp, * netx/net/sourceforge/jnlp/runtime/AppThreadGroup.java, * netx/net/sourceforge/jnlp/runtime/AppletAudioClip.java, * netx/net/sourceforge/jnlp/runtime/AppletEnvironment.java, * netx/net/sourceforge/jnlp/runtime/AppletInstance.java, * netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java, * netx/net/sourceforge/jnlp/runtime/Boot.java, * netx/net/sourceforge/jnlp/runtime/Boot13.java, * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java, * netx/net/sourceforge/jnlp/runtime/JNLPPolicy.java, * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java, * netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java, * netx/net/sourceforge/jnlp/runtime/package.html, * netx/net/sourceforge/jnlp/security/AccessWarningPane.java, * netx/net/sourceforge/jnlp/security/AppletWarningPane.java, * netx/net/sourceforge/jnlp/security/CertVerifier.java, * netx/net/sourceforge/jnlp/security/CertWarningPane.java, * netx/net/sourceforge/jnlp/security/CertsInfoPane.java, * netx/net/sourceforge/jnlp/security/HttpsCertVerifier.java, * netx/net/sourceforge/jnlp/security/MoreInfoPane.java, * netx/net/sourceforge/jnlp/security/NotAllSignedWarningPane.java, * netx/net/sourceforge/jnlp/security/SecurityDialogPanel.java, * netx/net/sourceforge/jnlp/security/SecurityUtil.java, * netx/net/sourceforge/jnlp/security/SecurityWarningDialog.java, * netx/net/sourceforge/jnlp/security/SingleCertInfoPane.java, * netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java, * netx/net/sourceforge/jnlp/security/viewer/CertificatePane.java, * netx/net/sourceforge/jnlp/security/viewer/CertificateViewer.java, * netx/net/sourceforge/jnlp/services/ExtendedSingleInstanceService.java, * netx/net/sourceforge/jnlp/services/InstanceExistsException.java, * netx/net/sourceforge/jnlp/services/ServiceUtil.java, * netx/net/sourceforge/jnlp/services/SingleInstanceLock.java, * netx/net/sourceforge/jnlp/services/XBasicService.java, * netx/net/sourceforge/jnlp/services/XClipboardService.java, * netx/net/sourceforge/jnlp/services/XDownloadService.java, * netx/net/sourceforge/jnlp/services/XExtendedService.java, * netx/net/sourceforge/jnlp/services/XExtensionInstallerService.java, * netx/net/sourceforge/jnlp/services/XFileContents.java, * netx/net/sourceforge/jnlp/services/XFileOpenService.java, * netx/net/sourceforge/jnlp/services/XFileSaveService.java, * netx/net/sourceforge/jnlp/services/XJNLPRandomAccessFile.java, * netx/net/sourceforge/jnlp/services/XPersistenceService.java, * netx/net/sourceforge/jnlp/services/XPrintService.java, * netx/net/sourceforge/jnlp/services/XServiceManagerStub.java, * netx/net/sourceforge/jnlp/services/XSingleInstanceService.java, * netx/net/sourceforge/jnlp/services/package.html, * netx/net/sourceforge/jnlp/tools/CharacterEncoder.java, * netx/net/sourceforge/jnlp/tools/HexDumpEncoder.java, * netx/net/sourceforge/jnlp/tools/JarRunner.java, * netx/net/sourceforge/jnlp/tools/JarSigner.java, * netx/net/sourceforge/jnlp/tools/JarSignerResources.java, * netx/net/sourceforge/jnlp/tools/KeyStoreUtil.java, * netx/net/sourceforge/jnlp/tools/KeyTool.java, * netx/net/sourceforge/jnlp/util/FileUtils.java, * netx/net/sourceforge/jnlp/util/PropertiesFile.java, * netx/net/sourceforge/jnlp/util/Reflect.java, * netx/net/sourceforge/jnlp/util/WeakList.java, * netx/net/sourceforge/jnlp/util/XDesktopEntry.java, * netx/net/sourceforge/nanoxml/XMLElement.java, * netx/net/sourceforge/nanoxml/XMLParseException.java, * plugin/icedteanp/IcedTeaJavaRequestProcessor.cc, * plugin/icedteanp/IcedTeaJavaRequestProcessor.h, * plugin/icedteanp/IcedTeaNPPlugin.cc, * plugin/icedteanp/IcedTeaNPPlugin.h, * plugin/icedteanp/IcedTeaPluginRequestProcessor.cc, * plugin/icedteanp/IcedTeaPluginRequestProcessor.h, * plugin/icedteanp/IcedTeaPluginUtils.cc, * plugin/icedteanp/IcedTeaPluginUtils.h, * plugin/icedteanp/IcedTeaRunnable.cc, * plugin/icedteanp/IcedTeaRunnable.h, * plugin/icedteanp/IcedTeaScriptablePluginObject.cc, * plugin/icedteanp/IcedTeaScriptablePluginObject.h, * plugin/icedteanp/java/netscape/javascript/JSException.java, * plugin/icedteanp/java/netscape/javascript/JSObject.java, * plugin/icedteanp/java/netscape/javascript/JSObjectCreatePermission.java, * plugin/icedteanp/java/netscape/javascript/JSProxy.java, * plugin/icedteanp/java/netscape/javascript/JSRunnable.java, * plugin/icedteanp/java/netscape/javascript/JSUtil.java, * plugin/icedteanp/java/netscape/security/ForbiddenTargetException.java, * plugin/icedteanp/java/sun/applet/AppletSecurityContextManager.java, * plugin/icedteanp/java/sun/applet/GetMemberPluginCallRequest.java, * plugin/icedteanp/java/sun/applet/GetWindowPluginCallRequest.java, * plugin/icedteanp/java/sun/applet/JavaConsole.java, * plugin/icedteanp/java/sun/applet/MethodOverloadResolver.java, * plugin/icedteanp/java/sun/applet/PasswordAuthenticationDialog.java, * plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java, * plugin/icedteanp/java/sun/applet/PluginAppletViewer.java, * plugin/icedteanp/java/sun/applet/PluginCallRequest.java, * plugin/icedteanp/java/sun/applet/PluginCallRequestFactory.java, * plugin/icedteanp/java/sun/applet/PluginClassLoader.java, * plugin/icedteanp/java/sun/applet/PluginCookieInfoRequest.java, * plugin/icedteanp/java/sun/applet/PluginCookieManager.java, * plugin/icedteanp/java/sun/applet/PluginDebug.java, * plugin/icedteanp/java/sun/applet/PluginException.java, * plugin/icedteanp/java/sun/applet/PluginMain.java, * plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java, * plugin/icedteanp/java/sun/applet/PluginMessageHandlerWorker.java, * plugin/icedteanp/java/sun/applet/PluginObjectStore.java, * plugin/icedteanp/java/sun/applet/PluginProxyInfoRequest.java, * plugin/icedteanp/java/sun/applet/PluginProxySelector.java, * plugin/icedteanp/java/sun/applet/PluginStreamHandler.java, * plugin/icedteanp/java/sun/applet/RequestQueue.java, * plugin/icedteanp/java/sun/applet/TestEnv.java, * plugin/icedteanp/java/sun/applet/VoidPluginCallRequest.java, * plugin/tests/LiveConnect/DummyObject.java, * plugin/tests/LiveConnect/OverloadTestHelper1.java, * plugin/tests/LiveConnect/OverloadTestHelper2.java, * plugin/tests/LiveConnect/OverloadTestHelper3.java, * plugin/tests/LiveConnect/PluginTest.java, * plugin/tests/LiveConnect/build, * plugin/tests/LiveConnect/common.js, * plugin/tests/LiveConnect/index.html, * plugin/tests/LiveConnect/jjs_eval_test.js, * plugin/tests/LiveConnect/jjs_func_parameters_tests.js, * plugin/tests/LiveConnect/jjs_func_rettype_tests.js, * plugin/tests/LiveConnect/jjs_get_tests.js, * plugin/tests/LiveConnect/jjs_set_tests.js, * plugin/tests/LiveConnect/jsj_func_overload_tests.js, * plugin/tests/LiveConnect/jsj_func_parameters_tests.js, * plugin/tests/LiveConnect/jsj_func_rettype_tests.js, * plugin/tests/LiveConnect/jsj_get_tests.js, * plugin/tests/LiveConnect/jsj_set_tests.js, * plugin/tests/LiveConnect/jsj_type_casting_tests.js, * plugin/tests/LiveConnect/jsj_type_conversion_tests.js: Initial import from IcedTea6. * AUTHORS, * COPYING * INSTALL, * NEWS, * README: New documentation. icedtea-web-1.6.2/PaxHeaders.17941/COPYING0000644000000000000000000000013212654402377014500 xustar0030 mtime=1454507263.207432981 30 atime=1454507327.112580697 30 ctime=1454507658.726158064 icedtea-web-1.6.2/COPYING0000644000175000002070000004312212654402377015225 0ustar00jvanekmock00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be 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 this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. icedtea-web-1.6.2/PaxHeaders.17941/AUTHORS0000644000000000000000000000013212654402377014515 xustar0030 mtime=1454507263.207432981 30 atime=1454507327.112580697 30 ctime=1454507658.725158077 icedtea-web-1.6.2/AUTHORS0000644000175000002070000000266212654402377015246 0ustar00jvanekmock00000000000000The following people have made contibutions to this project. Please keep this list in alphabetical order. Lillian Angel Andrew Azores Deepak Bhole Ricardo Martín Camarero Marcin Cieslak Danesh Dadachanji Adam Domurad Lukasz Dracz Thomas Fitzsimmons Michał Górny < mgorny@gentoo.org > Mark Greenwood Peter Hatina Andrew John Hughes Jie Kang Matthias Klose Alexandr Kolouch Jan Kmetko Francis Kung Denis Lila DJ Lucas Omair Majid Jon A. Maxwell Thomas Meyer Kurt Miller Saad Mohammad Martin Olsson Stefan Ring Fridrich Strba Andrew Su Joshua Sumali Jiri Vanek Mark Wielaard Jacob Wisor Man Lung Wong This project also includes code from the following projects: OpenJDK Netx icedtea-web-1.6.2/PaxHeaders.17941/netx.manifest.in0000644000000000000000000000013112654402377016557 xustar0030 mtime=1454507263.237432581 30 atime=1454507520.885996397 29 ctime=1454507658.72415809 icedtea-web-1.6.2/netx.manifest.in0000644000175000002070000000054212654402377017304 0ustar00jvanekmock00000000000000Implementation-Title: @PACKAGE_NAME@ Implementation-Version: @FULL_VERSION@ Implementation-URL: @PACKAGE_URL@ Implementation-Vendor: IcedTea Specification-Title: JSR56: Java Network Launching Protocol and API Specification-URL: http://jcp.org/aboutJava/communityprocess/mrel/jsr056 Specification-Vendor: Java Community Process Specification-Version: 6.0 icedtea-web-1.6.2/PaxHeaders.17941/jrunscript.in0000644000000000000000000000013112654402377016177 xustar0030 mtime=1454507263.235432608 30 atime=1454507520.891996317 29 ctime=1454507658.72415809 icedtea-web-1.6.2/jrunscript.in0000644000175000002070000000025212654402377016722 0ustar00jvanekmock00000000000000#!/bin/bash if [ x"@RHINO_JAR@" = x ] ; then echo "jrunscript requires rhino support" exit 1 fi @JAVA@ -cp "@RHINO_JAR@" org.mozilla.javascript.tools.shell.Main $@ icedtea-web-1.6.2/PaxHeaders.17941/build.properties.in0000644000000000000000000000013212654402377017267 xustar0030 mtime=1454507263.233432634 30 atime=1454507520.897996238 30 ctime=1454507658.723158104 icedtea-web-1.6.2/build.properties.in0000644000175000002070000000007012654402377020007 0ustar00jvanekmock00000000000000# build-time settings rhino.available=@RHINO_AVAILABLE@ icedtea-web-1.6.2/PaxHeaders.17941/Makefile.in0000644000000000000000000000013212654402526015506 xustar0030 mtime=1454507350.399270129 30 atime=1454507520.880996464 30 ctime=1454507658.722158117 icedtea-web-1.6.2/Makefile.in0000644000175000002070000026733112654402526016245 0ustar00jvanekmock00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Functions to compose path/classpath VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ $(am__configure_deps) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = netx.manifest jrunscript build.properties CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/build.properties.in \ $(srcdir)/jrunscript.in $(srcdir)/netx.manifest.in AUTHORS \ COPYING ChangeLog INSTALL NEWS README compile config.guess \ config.sub install-sh missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ ARCHFLAG = @ARCHFLAG@ ARCH_PREFIX = @ARCH_PREFIX@ ASM_AVAILABLE = @ASM_AVAILABLE@ ASM_JAR = @ASM_JAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BIN_BASH = @BIN_BASH@ BROWSER_TESTS_MODIFICATION = @BROWSER_TESTS_MODIFICATION@ BUILD_ARCH_DIR = @BUILD_ARCH_DIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHROME = @CHROME@ CHROMIUM = @CHROMIUM@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ ECJ = @ECJ@ ECJ_JAR = @ECJ_JAR@ EPIPHANY = @EPIPHANY@ EXEEXT = @EXEEXT@ FIREFOX = @FIREFOX@ FULL_VERSION = @FULL_VERSION@ GCJ = @GCJ@ GLIB2_V_216_CFLAGS = @GLIB2_V_216_CFLAGS@ GLIB2_V_216_LIBS = @GLIB2_V_216_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ HAMCREST_AVAILABLE = @HAMCREST_AVAILABLE@ HAMCREST_JAR = @HAMCREST_JAR@ HG = @HG@ ICEDTEA_REVISION = @ICEDTEA_REVISION@ INSTALL = @INSTALL@ INSTALL_ARCH_DIR = @INSTALL_ARCH_DIR@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JACOCO_AVAILABLE = @JACOCO_AVAILABLE@ JACOCO_JAR = @JACOCO_JAR@ JAR = @JAR@ JARSIGNER = @JARSIGNER@ JAR_ACCEPTS_STDIN_LIST = @JAR_ACCEPTS_STDIN_LIST@ JAR_KNOWS_ATFILE = @JAR_KNOWS_ATFILE@ JAR_KNOWS_J_OPTIONS = @JAR_KNOWS_J_OPTIONS@ JAVA = @JAVA@ JAVAC = @JAVAC@ JAVADOC = @JAVADOC@ JAVADOC_KNOWS_J_OPTIONS = @JAVADOC_KNOWS_J_OPTIONS@ JRE_ARCH_DIR = @JRE_ARCH_DIR@ JUNIT_AVAILABLE = @JUNIT_AVAILABLE@ JUNIT_JAR = @JUNIT_JAR@ KEYTOOL = @KEYTOOL@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MIDORI = @MIDORI@ MKDIR_P = @MKDIR_P@ MOZILLA_CFLAGS = @MOZILLA_CFLAGS@ MOZILLA_LIBS = @MOZILLA_LIBS@ MOZILLA_VERSION_COLLAPSED = @MOZILLA_VERSION_COLLAPSED@ OBJEXT = @OBJEXT@ OPERA = @OPERA@ PACK200 = @PACK200@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKGVERSION = @PKGVERSION@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RHINO_AVAILABLE = @RHINO_AVAILABLE@ RHINO_JAR = @RHINO_JAR@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SYSTEM_JDK_DIR = @SYSTEM_JDK_DIR@ SYSTEM_JRE_DIR = @SYSTEM_JRE_DIR@ TAGSOUP_JAR = @TAGSOUP_JAR@ USING_ECJ = @USING_ECJ@ VERSION = @VERSION@ VERSION_DEFS = @VERSION_DEFS@ X11_CFLAGS = @X11_CFLAGS@ X11_LIBS = @X11_LIBS@ XSLTPROC = @XSLTPROC@ ZIP = @ZIP@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EMPTY := SPACE := $(EMPTY) $(EMPTY) # end of linking variables # Build directories # note this is *space* separated list, as composeclasspath is called on them in classpath usage JUNIT_RUNTIME := $(JUNIT_JAR) $(HAMCREST_JAR) # support for javaws -html needs plugin.jar on classpath. rest of javaws works of course without it. @ENABLE_PLUGIN_TRUE@PLUGIN_JAR = $(datadir)/$(PACKAGE_NAME)/plugin.jar @HAVE_TAGSOUP_FALSE@NETX_EXCLUDE_SRCS = net.sourceforge.jnlp.MalformedXMLParser.java # Conditional defintions @HAVE_TAGSOUP_TRUE@NETX_EXCLUDE_SRCS = @CP_SUPPORTS_REFLINK_TRUE@REFLINK = --reflink=auto @SRC_DIR_HARDLINKABLE_FALSE@SRC_DIR_LINK = $(REFLINK) @SRC_DIR_HARDLINKABLE_TRUE@SRC_DIR_LINK = -l @ENABLE_DOCS_TRUE@JAVADOC_OPTS = -use -keywords -encoding UTF-8 -splitIndex \ @ENABLE_DOCS_TRUE@ -bottom ' Submit a bug or feature' @ENABLE_DOCS_TRUE@@JAVADOC_SUPPORTS_J_OPTIONS_TRUE@JAVADOC_MEM_OPTS = -J-Xmx1024m -J-Xms128m # if you create netx-dist-tests-whitelist in top directory, and place "expr match" regexes # (separate by one of IFS's values (most commonly space)) into it, you can control reproducers which compile or/xor run. # if you need declare space in your regex, use \s as described in "expr match" documentation ECHO_WHITELIST = if [ -f $(REPRODUCERS_CLASS_WHITELIST) ] ; then cat $(REPRODUCERS_CLASS_WHITELIST) ; else echo ".*" ; fi @ENABLE_WHITELIST_FALSE@COMPILE_WHITELIST_FILTER = .* @ENABLE_WHITELIST_TRUE@COMPILE_WHITELIST_FILTER = `$(ECHO_WHITELIST)` @ENABLE_WHITELIST_FALSE@RUN_WHITELIST_FILTER = `$(ECHO_WHITELIST)` @ENABLE_WHITELIST_TRUE@RUN_WHITELIST_FILTER = .* @WITH_RHINO_FALSE@RHINO_TESTS = @WITH_RHINO_TRUE@RHINO_TESTS = stamps/check-pac-functions.stamp @WITH_JUNIT_FALSE@JUNIT_TESTS = @WITH_JUNIT_TRUE@JUNIT_TESTS = stamps/run-netx-unit-tests.stamp #end of exported autoconf copies # binary names javaws := $(shell echo javaws | sed '@program_transform_name@') itweb_settings := $(shell echo itweb-settings | sed '@program_transform_name@') policyeditor := $(shell echo policyeditor | sed '@program_transform_name@') # the launcher needs to know $(bindir) and $(datadir) which can be different at # make-time from configure-time edit_launcher_script = sed \ -e "s|[@]LAUNCHER_BOOTCLASSPATH[@]|$(LAUNCHER_BOOTCLASSPATH)|g" \ -e "s|[@]JAVAWS_SPLASH_LOCATION[@]|$(datadir)/$(PACKAGE_NAME)/javaws_splash.png|g" \ -e "s|[@]JAVA[@]|$(JAVA)|g" \ -e "s|[@]JRE[@]|$(SYSTEM_JRE_DIR)|g" \ -e "s|[@]MAIN_CLASS[@]|$${MAIN_CLASS}|g" \ -e "s|[@]BIN_LOCATION[@]|$${BIN_LOCATION}|g" \ -e "s|[@]PROGRAM_NAME[@]|$${PROGRAM_NAME}|g" # Plugin # IcedTeaPlugin.so. # Separate compile and link invocations to ensure intermediate object # is listed before -l options. See: # http://developer.mozilla.org/en/docs/XPCOM_Glue @ENABLE_PLUGIN_TRUE@PLUGIN_SRC = IcedTeaNPPlugin.cc IcedTeaScriptablePluginObject.cc \ @ENABLE_PLUGIN_TRUE@ IcedTeaJavaRequestProcessor.cc IcedTeaPluginRequestProcessor.cc \ @ENABLE_PLUGIN_TRUE@ IcedTeaPluginUtils.cc IcedTeaParseProperties.cc @ENABLE_PLUGIN_TRUE@PLUGIN_OBJECTS = IcedTeaNPPlugin.o IcedTeaScriptablePluginObject.o \ @ENABLE_PLUGIN_TRUE@ IcedTeaJavaRequestProcessor.o IcedTeaPluginRequestProcessor.o \ @ENABLE_PLUGIN_TRUE@ IcedTeaPluginUtils.o IcedTeaParseProperties.o all: all-am .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): netx.manifest: $(top_builddir)/config.status $(srcdir)/netx.manifest.in cd $(top_builddir) && $(SHELL) ./config.status $@ jrunscript: $(top_builddir)/config.status $(srcdir)/jrunscript.in cd $(top_builddir) && $(SHELL) ./config.status $@ build.properties: $(top_builddir)/config.status $(srcdir)/build.properties.in cd $(top_builddir) && $(SHELL) ./config.status $@ tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build/sub \ && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-local check: check-am all-am: Makefile all-local installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-local mostlyclean-am distclean: distclean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-data-local install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-exec-local install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-local .MAKE: check-am install-am install-strip .PHONY: all all-am all-local am--refresh check check-am check-local \ clean clean-generic clean-local cscopelist-am ctags-am dist \ dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \ dist-xz dist-zip distcheck distclean distclean-generic \ distcleancheck distdir distuninstallcheck dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-data-local install-dvi install-dvi-am \ install-exec install-exec-am install-exec-local install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-local .PRECIOUS: Makefile define joinsegments $(subst $(SPACE),:,$(strip $1)) endef define composeclasspath $(if $(call joinsegments,$1),-classpath $(call joinsegments,$1),) endef # Source directories export TOP_BUILD_DIR = $(abs_top_builddir) export NETX_DIR = $(abs_top_builddir)/netx.build export DOCS_DIR=$(TOP_BUILD_DIR)/icedtea-web-docs/$(FULL_VERSION) export NETX_SRCDIR = $(abs_top_srcdir)/netx export NETX_RESOURCE_DIR=$(NETX_SRCDIR)/net/sourceforge/jnlp/resources export ICONS_DEST_DIR=$(DESTDIR)$(datadir)/pixmaps export REPORT_STYLES_DIRNAME=report-styles export TESTS_SRCDIR=$(abs_top_srcdir)/tests export TESTS_DIR=$(abs_top_builddir)/tests.build export NETX_UNIT_TEST_SRCDIR=$(TESTS_SRCDIR)/netx/unit export NETX_TEST_DIR=$(TESTS_DIR)/netx export NETX_UNIT_TEST_DIR=$(NETX_TEST_DIR)/unit export JUNIT_RUNNER_DIR=$(TESTS_DIR)/junit-runner export JUNIT_RUNNER_SRCDIR=$(TESTS_SRCDIR)/junit-runner export JACOCO_OPERATOR_DIR=$(TESTS_DIR)/jacoco-operator export JACOCO_OPERATOR_SRCDIR=$(TESTS_SRCDIR)/jacoco-operator export TEST_EXTENSIONS_SRCDIR=$(TESTS_SRCDIR)/test-extensions export TEST_EXTENSIONS_TESTS_SRCDIR=$(TESTS_SRCDIR)/test-extensions-tests export REPRODUCERS_TESTS_SRCDIR=$(TESTS_SRCDIR)/reproducers export TEST_EXTENSIONS_DIR=$(TESTS_DIR)/test-extensions export CPP_UNITTEST_FRAMEWORK_SRCDIR=$(TESTS_SRCDIR)/UnitTest++ export CPP_UNITTEST_SRCDIR=$(TESTS_SRCDIR)/cpp-unit-tests export CPP_UNITTEST_DIR=$(TESTS_DIR)/cpp-unit-tests export TEST_EXTENSIONS_COMPATIBILITY_SYMLINK=$(TESTS_DIR)/netx/jnlp_testsengine export TEST_EXTENSIONS_TESTS_DIR=$(TESTS_DIR)/test-extensions-tests export REPRODUCERS_TESTS_SERVER_DEPLOYDIR=$(TESTS_DIR)/reproducers_test_server_deploydir export REPRODUCERS_BUILD_DIR=$(TESTS_DIR)/reproducers.classes export PRIVATE_KEYSTORE_NAME=teststore.ks export PRIVATE_KEYSTORE_PASS=123456789 export EXPORTED_TEST_CERT_PREFIX=icedteatests export EXPORTED_TEST_CERT_SUFFIX=crt export TEST_CERT_ALIAS=icedteaweb export PUBLIC_KEYSTORE_STUB=icedtea-web/security/trusted.certs export PUBLIC_KEYSTORE_PASS=changeit export JUNIT_RUNNER_JAR=$(abs_top_builddir)/junit-runner.jar export UNIT_CLASS_NAMES = $(abs_top_builddir)/unit_class_names export REPRODUCERS_CLASS_NAMES = $(abs_top_builddir)/reproducers_class_names export REPRODUCERS_CLASS_WHITELIST = $(abs_top_srcdir)/netx-dist-tests-whitelist export COVERAGE_JAVA_ARGS=-Xmx2G export COVERAGE_MODIFIED_FILES=tests-output.xml ServerAccess-logs.xml stdout.log stderr.log all.log export EMMA_BACKUP_SUFFIX=_noEmma export EMMA_SUFFIX=_withEmma export META_MANIFEST = META-INF/MANIFEST.MF export SIGNED_REPRODUCERS=signed signed2 export SIMPLE_REPRODUCERS=simple export CUSTOM_REPRODUCERS=custom export ALL_NONCUSTOM_REPRODUCERS=$(SIMPLE_REPRODUCERS) $(SIGNED_REPRODUCERS) export ALL_REPRODUCERS=$(ALL_NONCUSTOM_REPRODUCERS) $(CUSTOM_REPRODUCERS) export JACOCO_PATH:=$(shell dirname "$(JACOCO_JAR)") export JACOCO_AGENT=org.jacoco.agent.jar export JACOCO_ANT=org.jacoco.ant.jar export JACOCO_REPORT=org.jacoco.report.jar export JACOCO_AGENTRT=org.jacoco.agent.rt.jar export JACOCO_CORE=org.jacoco.core.jar export JACOCO_JAVAWS_RESULTS=$(TEST_EXTENSIONS_DIR)/jacoco_javaws.exec export JACOCO_PLUGIN_RESULTS=$(TEST_EXTENSIONS_DIR)/jacoco_plugin.exec # space separated fragments for composeclasspath export JACOCO_CLASSPATH=$(JACOCO_PATH)/$(JACOCO_CORE) $(JACOCO_PATH)/$(JACOCO_AGENT) $(JACOCO_PATH)/$(JACOCO_REPORT) $(JACOCO_PATH)/$(JACOCO_AGENTRT) $(JACOCO_PATH)/$(JACOCO_ANT) $(ASM_JAR) export JACOCO_AGENT_SWITCH_BODY=-javaagent:$(JACOCO_PATH)/$(JACOCO_AGENTRT) export JACOCO_BASE_EXCLUDE=org.junit.*:junit.* export JACOCO_ADVANCED_EXCLUDE=:*jacoco*:java.lang.*:java.reflect.*:java.util.*:sun.reflect.* export JACOCO_AGENT_SWITCH="$(JACOCO_AGENT_SWITCH_BODY)=excludes=$(JACOCO_BASE_EXCLUDE)$(JACOCO_ADVANCED_EXCLUDE),inclbootstrapclasses=true" export JACOCO_AGENT_JAVAWS_SWITCH=\"$(JACOCO_AGENT_SWITCH),destfile=$(JACOCO_JAVAWS_RESULTS)\" export JACOCO_AGENT_PLUGIN_SWITCH=\"$(JACOCO_AGENT_SWITCH),destfile=$(JACOCO_PLUGIN_RESULTS)\" export JACOCO_OPERATOR_EXEC=$(SYSTEM_JRE_DIR)/bin/java $(COVERAGE_JAVA_ARGS) -cp $(call joinsegments, $(JACOCO_OPERATOR_DIR) $(JACOCO_CLASSPATH) .) org.jacoco.operator.Main # linking variables export PLUGIN_LINK_NAME=libjavaplugin.so export MOZILLA_LOCAL_PLUGINDIR=${HOME}/.mozilla/plugins export MOZILLA_GLOBAL64_PLUGINDIR=/usr/lib64/mozilla/plugins export MOZILLA_GLOBAL32_PLUGINDIR=/usr/lib/mozilla/plugins export OPERA_GLOBAL64_PLUGINDIR=/usr/lib64/opera/plugins export OPERA_GLOBAL32_PLUGINDIR=/usr/lib/opera/plugins export BUILT_PLUGIN_LIBRARY=IcedTeaPlugin.so export CPP_UNITTEST_FRAMEWORK_BUILDDIR=$(CPP_UNITTEST_DIR)/UnitTest++ export CPP_UNITTEST_FRAMEWORK_LIB_NAME=libUnitTest++.a export CPP_UNITTEST_FRAMEWORK_LIB=$(CPP_UNITTEST_FRAMEWORK_BUILDDIR)/$(CPP_UNITTEST_FRAMEWORK_LIB_NAME) export CPP_UNITTEST_EXECUTABLE=$(CPP_UNITTEST_DIR)/IcedTeaPluginUnitTests export MOZILLA_LOCAL_BACKUP_FILE=${HOME}/$(PLUGIN_LINK_NAME).origU export MOZILLA_GLOBAL_BACKUP_FILE=${HOME}/$(PLUGIN_LINK_NAME).origMG export OPERA_GLOBAL_BACKUP_FILE=${HOME}/$(PLUGIN_LINK_NAME).origOG export MOZILLA_FAMILY_TEST= "$(FIREFOX)" != "" -o "$(CHROMIUM)" != "" -o "$(CHROME)" != "" -o "$(MIDORI)" != "" -o "$(EPIPHANY)" != "" # Flags export IT_CFLAGS=$(CFLAGS) $(ARCHFLAG) export IT_JAVAC_SETTINGS=-g -encoding utf-8 $(JAVACFLAGS) $(MEMORY_LIMIT) $(PREFER_SOURCE) export IT_LANGUAGE_SOURCE_VERSION=7 export IT_CLASS_TARGET_VERSION=7 export IT_JAVACFLAGS=$(IT_JAVAC_SETTINGS) -source $(IT_LANGUAGE_SOURCE_VERSION) -target $(IT_CLASS_TARGET_VERSION) # # We need the jars in bootclasspath for a couple of reasons # - we use classes (in the sun.applet package) loaded by the bootclassloader # using another classloader to load classes from the same package causes an # IllegalAccessException # - we want full privileges # export UNIFIED_CLASSPATH_SEGMENTS=$(datadir)/$(PACKAGE_NAME)/netx.jar $(PLUGIN_JAR) $(RHINO_JAR) $(TAGSOUP_JAR) export UNIFIED_JACOCO_CLASSPATH_SEGMENTS=$(UNIFIED_CLASSPATH_SEGMENTS) $(JACOCO_CLASSPATH) export UNIFIED_CLASSPATH=$(call joinsegments, $(UNIFIED_CLASSPATH_SEGMENTS)) export UNIFIED_JACOCO_CLASSPATH=$(call joinsegments, $(UNIFIED_JACOCO_CLASSPATH_SEGMENTS)) export UNIFIED_BOOTCLASSPATH=-Xbootclasspath/a:$(UNIFIED_CLASSPATH) # note javaws, itwebsettings and policyeditor (== LAUNCHER_BOOTCLASSPATH) must be always able to compile and run *without* plugin export LAUNCHER_BOOTCLASSPATH="$(UNIFIED_BOOTCLASSPATH)" export PLUGIN_BOOTCLASSPATH='"$(UNIFIED_BOOTCLASSPATH)"' export PLUGIN_COVERAGE_BOOTCLASSPATH='"-Xbootclasspath/a:$(UNIFIED_JACOCO_CLASSPATH)"' # Fake update version to work with the Deployment Toolkit script used by Oracle # http://download.oracle.com/javase/tutorial/deployment/deploymentInDepth/depltoolkit_index.html export JDK_UPDATE_VERSION=50 # Sources list export PLUGIN_TEST_SRCS = $(abs_top_srcdir)/plugin/tests/LiveConnect/*.java export NETX_PKGS = javax.jnlp net.sourceforge.nanoxml net.sourceforge.jnlp \ net.sourceforge.jnlp.about \ net.sourceforge.jnlp.cache net.sourceforge.jnlp.config \ net.sourceforge.jnlp.controlpanel net.sourceforge.jnlp.event \ net.sourceforge.jnlp.runtime net.sourceforge.jnlp.security \ net.sourceforge.jnlp.security.viewer net.sourceforge.jnlp.services \ net.sourceforge.jnlp.tools net.sourceforge.jnlp.util \ sun.applet @ENABLE_PLUGIN_TRUE@export ICEDTEAPLUGIN_CLEAN = clean-IcedTeaPlugin @ENABLE_PLUGIN_TRUE@export LIVECONNECT_DIR = netscape sun/applet @ENABLE_PLUGIN_TRUE@export PLUGIN_DIR=$(abs_top_builddir)/plugin/icedteanp @ENABLE_PLUGIN_TRUE@export PLUGIN_SRCDIR=$(abs_top_srcdir)/plugin/icedteanp @ENABLE_PLUGIN_TRUE@export LIVECONNECT_SRCS = $(PLUGIN_SRCDIR)/java @ENABLE_PLUGIN_TRUE@export ICEDTEAPLUGIN_TARGET = $(PLUGIN_DIR)/$(BUILT_PLUGIN_LIBRARY) stamps/liveconnect-dist.stamp @ENABLE_PLUGIN_TRUE@export PLUGIN_PKGS = sun.applet netscape.security netscape.javascript #this is for plugin testcoverage @ENABLE_PLUGIN_TRUE@export COVERABLE_PLUGIN_DIR=$(TESTS_DIR)/icedteanp-build-with-jacoco export PLUGIN_VERSION = IcedTea-Web $(FULL_VERSION) export EXTRA_DIST = $(top_srcdir)/netx $(top_srcdir)/plugin javaws.png javaws.desktop.in policyeditor.desktop.in icedteaweb-completion \ itweb-settings.desktop.in launcher $(top_srcdir)/tests html-gen.sh NEW_LINE_IFS $(top_srcdir)/metadata.in # reproducers `D`shortcuts export DTEST_SERVER=-Dtest.server.dir=$(REPRODUCERS_TESTS_SERVER_DEPLOYDIR) export DJAVAWS_BUILD=-Djavaws.build.bin=$(DESTDIR)$(bindir)/$(javaws) export DBROWSERS=-Dused.browsers=$(FIREFOX):$(CHROMIUM):$(CHROME):$(OPERA):$(MIDORI):$(EPIPHANY) export REPRODUCERS_DPARAMETERS= $(DTEST_SERVER) $(DJAVAWS_BUILD) $(DBROWSERS) $(BROWSER_TESTS_MODIFICATION) # end of `D`shortcuts #exported autoconf copies export EXPORTED_JAVAC=$(SYSTEM_JDK_DIR)/bin/javac export EXPORTED_JAR=$(SYSTEM_JDK_DIR)/bin/jar export EXPORTED_KEYTOOL=$(SYSTEM_JDK_DIR)/bin/keytool export EXPORTED_JARSIGNER=$(SYSTEM_JDK_DIR)/bin/jarsigner export EXPORTED_PACK200=$(SYSTEM_JDK_DIR)/bin/pack200 # Top-Level Targets # ================= all-local: stamps/netx-dist.stamp stamps/plugin.stamp launcher.build/$(javaws) \ javaws.desktop stamps/docs.stamp launcher.build/$(itweb_settings) itweb-settings.desktop \ launcher.build/$(policyeditor) policyeditor.desktop check-local: $(RHINO_TESTS) $(JUNIT_TESTS) clean-local: clean-netx clean-plugin clean-liveconnect \ clean-native-ecj clean-launchers clean-desktop-files clean-docs clean-generated-docs clean-metadata clean-tests clean-bootstrap-directory if [ -e stamps ] ; then \ rmdir stamps ; \ fi .PHONY: clean-IcedTeaPlugin clean-add-netx clean-add-netx-debug clean-add-plugin clean-add-plugin-debug \ clean-bootstrap-directory clean-native-ecj clean-desktop-files clean-netx-docs clean-docs clean-plugin-docs clean-generated-docs \ clean-tests check-local clean-launchers stamps/check-pac-functions.stamp stamps/run-netx-unit-tests.stamp clean-netx-tests \ clean-junit-runner clean-netx-unit-tests clean-metadata install-exec-local: ${mkinstalldirs} $(DESTDIR)$(bindir) $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/ $(DESTDIR)$(libdir) $(ICONS_DEST_DIR) @ENABLE_PLUGIN_TRUE@ ${INSTALL_PROGRAM} $(PLUGIN_DIR)/$(BUILT_PLUGIN_LIBRARY) $(DESTDIR)$(libdir) @ENABLE_PLUGIN_TRUE@ ${INSTALL_DATA} $(abs_top_builddir)/liveconnect/lib/classes.jar $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/plugin.jar ${INSTALL_DATA} $(NETX_DIR)/lib/classes.jar $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/netx.jar ${INSTALL_DATA} $(NETX_SRCDIR)/javaws_splash.png $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/javaws_splash.png ${INSTALL_DATA} $(abs_top_srcdir)/javaws.png $(ICONS_DEST_DIR)/ ${INSTALL_PROGRAM} launcher.build/$(javaws) $(DESTDIR)$(bindir) ${INSTALL_PROGRAM} launcher.build/$(itweb_settings) $(DESTDIR)$(bindir) ${INSTALL_PROGRAM} launcher.build/$(policyeditor) $(DESTDIR)$(bindir) # all generated manpages are installed in swarm install-data-local: ${mkinstalldirs} -d $(DESTDIR)$(mandir) cp -r "$(DOCS_DIR)/man/"* $(DESTDIR)$(mandir)/ @ENABLE_DOCS_TRUE@ ${mkinstalldirs} $(DESTDIR)$(htmldir) @ENABLE_DOCS_TRUE@ (cd ${abs_top_builddir}/docs/netx; \ @ENABLE_DOCS_TRUE@ for files in $$(find . -type f); \ @ENABLE_DOCS_TRUE@ do \ @ENABLE_DOCS_TRUE@ ${INSTALL_DATA} -D $${files} $(DESTDIR)$(htmldir)/netx/$${files}; \ @ENABLE_DOCS_TRUE@ done) @ENABLE_DOCS_TRUE@@ENABLE_PLUGIN_TRUE@ (cd ${abs_top_builddir}/docs/plugin; \ @ENABLE_DOCS_TRUE@@ENABLE_PLUGIN_TRUE@ for files in $$(find . -type f); \ @ENABLE_DOCS_TRUE@@ENABLE_PLUGIN_TRUE@ do \ @ENABLE_DOCS_TRUE@@ENABLE_PLUGIN_TRUE@ ${INSTALL_DATA} -D $${files} $(DESTDIR)$(htmldir)/plugin/$${files}; \ @ENABLE_DOCS_TRUE@@ENABLE_PLUGIN_TRUE@ done) # all generated manpages must be removed one by one uninstall-local: rm -f $(DESTDIR)$(libdir)/$(BUILT_PLUGIN_LIBRARY) rm -f $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/plugin.jar rm -f $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/netx.jar rm -r $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/javaws_splash.png rm -r $(ICONS_DEST_DIR)/javaws.png KNOWN_MANS="icedtea-web.1 icedtea-web-plugin.1 itweb-settings.1 javaws.1 policyeditor.1" ; \ KNOWN_DIRS="man1 de/man1 pl/man1 cs/man1" ; \ for file in $$KNOWN_MANS ; do \ for dir in $$KNOWN_DIRS ; do \ rm -f $(DESTDIR)$(mandir)/$$dir/$$file ; \ done ; \ done rm -f $(DESTDIR)$(bindir)/$(javaws) rm -f $(DESTDIR)$(bindir)/$(itweb_settings) rm -f $(DESTDIR)$(bindir)/$(policyeditor) rm -rf $(DESTDIR)$(htmldir) @ENABLE_PLUGIN_TRUE@$(PLUGIN_DIR)/%.o: $(PLUGIN_SRCDIR)/%.cc @ENABLE_PLUGIN_TRUE@ mkdir -p $(PLUGIN_DIR) && \ @ENABLE_PLUGIN_TRUE@ cd $(PLUGIN_DIR) && \ @ENABLE_PLUGIN_TRUE@ $(CXX) $(CXXFLAGS) \ @ENABLE_PLUGIN_TRUE@ $(DEFS) $(VERSION_DEFS) \ @ENABLE_PLUGIN_TRUE@ -DJDK_UPDATE_VERSION="\"$(JDK_UPDATE_VERSION)\"" \ @ENABLE_PLUGIN_TRUE@ -DPLUGIN_NAME="\"IcedTea-Web Plugin\"" \ @ENABLE_PLUGIN_TRUE@ -DJAVAWS_BIN="\"$(bindir)/$(javaws)\"" \ @ENABLE_PLUGIN_TRUE@ -DJAVAWS_NAME="\"$(javaws)\"" \ @ENABLE_PLUGIN_TRUE@ -DPLUGIN_VERSION="\"$(PLUGIN_VERSION)\"" \ @ENABLE_PLUGIN_TRUE@ -DPACKAGE_URL="\"$(PACKAGE_URL)\"" \ @ENABLE_PLUGIN_TRUE@ -DMOZILLA_VERSION_COLLAPSED="$(MOZILLA_VERSION_COLLAPSED)" \ @ENABLE_PLUGIN_TRUE@ -DICEDTEA_WEB_JRE="\"$(SYSTEM_JRE_DIR)\"" \ @ENABLE_PLUGIN_TRUE@ -DPLUGIN_BOOTCLASSPATH=$(PLUGIN_BOOTCLASSPATH) \ @ENABLE_PLUGIN_TRUE@ $(GLIB_CFLAGS) \ @ENABLE_PLUGIN_TRUE@ $(MOZILLA_CFLAGS) \ @ENABLE_PLUGIN_TRUE@ -fvisibility=hidden \ @ENABLE_PLUGIN_TRUE@ -fPIC -o $@ -c $< @ENABLE_PLUGIN_TRUE@$(PLUGIN_DIR)/$(BUILT_PLUGIN_LIBRARY): $(addprefix $(PLUGIN_DIR)/,$(PLUGIN_OBJECTS)) @ENABLE_PLUGIN_TRUE@ cd $(PLUGIN_DIR) && \ @ENABLE_PLUGIN_TRUE@ $(CXX) $(CXXFLAGS) \ @ENABLE_PLUGIN_TRUE@ $(PLUGIN_OBJECTS) \ @ENABLE_PLUGIN_TRUE@ $(GLIB_LIBS) \ @ENABLE_PLUGIN_TRUE@ $(MOZILLA_LIBS) \ @ENABLE_PLUGIN_TRUE@ -shared -o $@ # Start of CPP Unit test targets # Note that UnitTest++ has its own makefile, however this is avoided because it creates an in-source build. @ENABLE_PLUGIN_TRUE@$(CPP_UNITTEST_FRAMEWORK_LIB): $(CPP_UNITTEST_FRAMEWORK_SRCDIR) @ENABLE_PLUGIN_TRUE@ mkdir -p $(CPP_UNITTEST_FRAMEWORK_BUILDDIR) && \ @ENABLE_PLUGIN_TRUE@ pushd $(CPP_UNITTEST_FRAMEWORK_SRCDIR) && \ @ENABLE_PLUGIN_TRUE@ for cppfile in $$(find $(CPP_UNITTEST_FRAMEWORK_SRCDIR) -name '*.cpp') ; \ @ENABLE_PLUGIN_TRUE@ do \ @ENABLE_PLUGIN_TRUE@ objfile="$(CPP_UNITTEST_FRAMEWORK_BUILDDIR)/$$(basename $${cppfile%.cpp}).o" ; \ @ENABLE_PLUGIN_TRUE@ $(CXX) $(CXXFLAGS) -c $$cppfile -o $$objfile || exit 1 ; \ @ENABLE_PLUGIN_TRUE@ done ; \ @ENABLE_PLUGIN_TRUE@ ar cr $(CPP_UNITTEST_FRAMEWORK_LIB) $(CPP_UNITTEST_FRAMEWORK_BUILDDIR)/*.o ; \ @ENABLE_PLUGIN_TRUE@ popd @ENABLE_PLUGIN_TRUE@clean-unittest++: @ENABLE_PLUGIN_TRUE@ rm -f $(CPP_UNITTEST_FRAMEWORK_BUILDDIR)/*.o @ENABLE_PLUGIN_TRUE@ rm -f $(CPP_UNITTEST_FRAMEWORK_LIB) @ENABLE_PLUGIN_TRUE@ if [ -e $(CPP_UNITTEST_FRAMEWORK_BUILDDIR) ] ; then \ @ENABLE_PLUGIN_TRUE@ rmdir $(CPP_UNITTEST_FRAMEWORK_BUILDDIR) ; \ @ENABLE_PLUGIN_TRUE@ fi @ENABLE_PLUGIN_TRUE@stamps/cpp-unit-tests-compile.stamp: $(CPP_UNITTEST_FRAMEWORK_LIB) $(CPP_UNITTEST_SRCDIR) $(addprefix $(PLUGIN_DIR)/,$(PLUGIN_OBJECTS)) @ENABLE_PLUGIN_TRUE@ mkdir -p $(CPP_UNITTEST_DIR) && \ @ENABLE_PLUGIN_TRUE@ pushd $(CPP_UNITTEST_SRCDIR) && \ @ENABLE_PLUGIN_TRUE@ for cppfile in $$(find $(CPP_UNITTEST_SRCDIR) -name '*.cc') ; \ @ENABLE_PLUGIN_TRUE@ do \ @ENABLE_PLUGIN_TRUE@ objfile="$(CPP_UNITTEST_DIR)/$$(basename $${cppfile%.cc}).o" ; \ @ENABLE_PLUGIN_TRUE@ echo "Compiling $$cppfile to $$objfile"; \ @ENABLE_PLUGIN_TRUE@ $(CXX) $(CXXFLAGS) \ @ENABLE_PLUGIN_TRUE@ $(DEFS) $(VERSION_DEFS) \ @ENABLE_PLUGIN_TRUE@ -DJDK_UPDATE_VERSION="\"$(JDK_UPDATE_VERSION)\"" \ @ENABLE_PLUGIN_TRUE@ -DPLUGIN_NAME="\"IcedTea-Web Plugin\"" \ @ENABLE_PLUGIN_TRUE@ -DJAVAWS_BIN="\"$(bindir)/$(javaws)\"" \ @ENABLE_PLUGIN_TRUE@ -DJAVAWS_NAME="\"$(javaws)\"" \ @ENABLE_PLUGIN_TRUE@ -DPLUGIN_VERSION="\"$(PLUGIN_VERSION)\"" \ @ENABLE_PLUGIN_TRUE@ -DPACKAGE_URL="\"$(PACKAGE_URL)\"" \ @ENABLE_PLUGIN_TRUE@ -DMOZILLA_VERSION_COLLAPSED="$(MOZILLA_VERSION_COLLAPSED)" \ @ENABLE_PLUGIN_TRUE@ -DICEDTEA_WEB_JRE="\"$(SYSTEM_JRE_DIR)\"" \ @ENABLE_PLUGIN_TRUE@ -DPLUGIN_BOOTCLASSPATH=$(PLUGIN_BOOTCLASSPATH) \ @ENABLE_PLUGIN_TRUE@ $(GLIB_CFLAGS) \ @ENABLE_PLUGIN_TRUE@ $(MOZILLA_CFLAGS) \ @ENABLE_PLUGIN_TRUE@ "-I$(CPP_UNITTEST_FRAMEWORK_SRCDIR)/src" \ @ENABLE_PLUGIN_TRUE@ "-I$(PLUGIN_SRCDIR)" \ @ENABLE_PLUGIN_TRUE@ -o $$objfile -c $$cppfile || exit 1 ; \ @ENABLE_PLUGIN_TRUE@ done ; \ @ENABLE_PLUGIN_TRUE@ popd ; \ @ENABLE_PLUGIN_TRUE@ mkdir -p stamps ; \ @ENABLE_PLUGIN_TRUE@ touch $@ @ENABLE_PLUGIN_TRUE@$(CPP_UNITTEST_EXECUTABLE): $(CPP_UNITTEST_FRAMEWORK_LIB) stamps/cpp-unit-tests-compile.stamp @ENABLE_PLUGIN_TRUE@ cd $(CPP_UNITTEST_DIR) && \ @ENABLE_PLUGIN_TRUE@ $(CXX) $(CXXFLAGS) \ @ENABLE_PLUGIN_TRUE@ $(addprefix $(PLUGIN_DIR)/,$(PLUGIN_OBJECTS)) \ @ENABLE_PLUGIN_TRUE@ $(CPP_UNITTEST_DIR)/*.o \ @ENABLE_PLUGIN_TRUE@ -lrt \ @ENABLE_PLUGIN_TRUE@ -lpthread \ @ENABLE_PLUGIN_TRUE@ $(GLIB_LIBS) \ @ENABLE_PLUGIN_TRUE@ $(MOZILLA_LIBS) \ @ENABLE_PLUGIN_TRUE@ $(CPP_UNITTEST_FRAMEWORK_LIB)\ @ENABLE_PLUGIN_TRUE@ $(BUILT_CPP_UNIT_TEST_FRAMEWORK) -o $@ @ENABLE_PLUGIN_TRUE@clean-cpp-unit-tests: @ENABLE_PLUGIN_TRUE@ rm -f stamps/cpp-unit-tests-compile.stamp @ENABLE_PLUGIN_TRUE@ rm -f $(CPP_UNITTEST_EXECUTABLE) @ENABLE_PLUGIN_TRUE@ rm -f $(CPP_UNITTEST_DIR)/*.o @ENABLE_PLUGIN_TRUE@run-cpp-unit-tests: $(CPP_UNITTEST_EXECUTABLE) @ENABLE_PLUGIN_TRUE@ $(CPP_UNITTEST_EXECUTABLE) # End of CPP Unit test targets @ENABLE_PLUGIN_TRUE@clean-IcedTeaPlugin: @ENABLE_PLUGIN_TRUE@ rm -f $(PLUGIN_DIR)/*.o @ENABLE_PLUGIN_TRUE@ rm -f $(PLUGIN_DIR)/$(BUILT_PLUGIN_LIBRARY) @ENABLE_PLUGIN_TRUE@ if [ $(abs_top_srcdir) != $(abs_top_builddir) ]; then \ @ENABLE_PLUGIN_TRUE@ if [ -e $(abs_top_builddir)/plugin/icedteanp ] ; then \ @ENABLE_PLUGIN_TRUE@ rmdir $(abs_top_builddir)/plugin/icedteanp ; \ @ENABLE_PLUGIN_TRUE@ rmdir $(abs_top_builddir)/plugin ; \ @ENABLE_PLUGIN_TRUE@ fi ; \ @ENABLE_PLUGIN_TRUE@ fi stamps/plugin.stamp: $(ICEDTEAPLUGIN_TARGET) mkdir -p stamps touch stamps/plugin.stamp clean-plugin: $(ICEDTEAPLUGIN_CLEAN) rm -f stamps/plugin.stamp liveconnect-source-files.txt: if test "x${LIVECONNECT_DIR}" != x; then \ find $(LIVECONNECT_SRCS) -name '*.java' | sort > $@ ; \ fi touch $@ stamps/liveconnect.stamp: liveconnect-source-files.txt stamps/netx.stamp if test "x${LIVECONNECT_DIR}" != x; then \ mkdir -p $(abs_top_builddir)/liveconnect && \ $(SYSTEM_JDK_DIR)/bin/javac $(IT_JAVACFLAGS) \ -d $(abs_top_builddir)/liveconnect \ $(call composeclasspath,$(NETX_DIR) $(TAGSOUP_JAR) $(RHINO_JAR)) \ -sourcepath $(LIVECONNECT_SRCS) \ @liveconnect-source-files.txt ; \ fi mkdir -p stamps touch $@ stamps/liveconnect-dist.stamp: stamps/liveconnect.stamp if test "x${LIVECONNECT_DIR}" != x; then \ (cd $(abs_top_builddir)/liveconnect ; \ mkdir -p lib ; \ $(SYSTEM_JDK_DIR)/bin/jar cf lib/classes.jar $(LIVECONNECT_DIR) ; \ cp -pPR $(SRC_DIR_LINK) $(LIVECONNECT_SRCS) src; \ find src -type f -exec chmod 640 '{}' ';' -o -type d -exec chmod 750 '{}' ';'; \ cd src ; \ $(ZIP) -qr $(abs_top_builddir)/liveconnect/lib/src.zip $(LIVECONNECT_DIR) ) ; \ fi mkdir -p stamps touch $@ clean-liveconnect: rm -rf $(abs_top_builddir)/liveconnect rm -f stamps/liveconnect-dist.stamp rm -f liveconnect-source-files.txt rm -f stamps/liveconnect.stamp # NetX # requires availability of OpenJDK source code including # a patch applied to sun.plugin.AppletViewerPanel and generated sources netx-source-files.txt: find $(NETX_SRCDIR) -name '*.java' | sort > $@ ; \ for src in $(NETX_EXCLUDE_SRCS) ; \ do \ sed -i "/$${src}/ d" $@ ; \ done @WITH_RHINO_FALSE@ sed -i '/RhinoBasedPacEvaluator/ d' $@ # if 'sed' will be missing on machine, use old IFS hack as on other places # the 'sed' cycles is changing some custom version like 1.6.2 fedora23.4 to simple 1.6 # if changed, keep in mind that also 1.7 should bubble to 1.7 # also 1.7pre or 1.7preHASH should end up like 1.7 $(abs_top_builddir)/metadata: $(top_srcdir)/metadata.in mkdir -p $(abs_top_builddir)/metadata-work ; \ METAFILES=`ls $(top_srcdir)/metadata.in` ; \ SEDDED_VERSION=`echo "$(FULL_VERSION)" | sed 's/[^0-9]\+/ /g'` ; \ x=0; for i in $$SEDDED_VERSION ; do \ let x++; \ if [ $$x -eq 1 ] ; then V1=$$i; fi; \ if [ $$x -eq 2 ] ; then V2=$$i; fi; \ done; \ XVERSION=$$V1.$$V2; \ for F in $$METAFILES ; do \ cat $(top_srcdir)/metadata.in/$$F | sed "s;%{name};$(PACKAGE_NAME);g" | sed "s;%{version};$$XVERSION;g" > $(abs_top_builddir)/metadata-work/$$F ; \ done ; \ mv $(abs_top_builddir)/metadata-work $(abs_top_builddir)/metadata ; check-metadata: $(abs_top_builddir)/metadata xmllint --noout $(abs_top_builddir)/metadata/* ; \ if [ $$? -eq 0 ] ; then \ echo "Passed: well formed" ; \ else \ echo "FAILED: well formed" ; \ fi ; \ xmllint --noout --schema http://maven.apache.org/xsd/maven-4.0.0.xsd $(abs_top_builddir)/metadata/*.pom ; \ if [ $$? -eq 0 ] ; then \ echo "Passed: valid poms" ; \ else \ echo "FAILED: valid poms" ; \ fi ; \ appstream-util validate $(abs_top_builddir)/metadata/*.appdata.xml $(abs_top_builddir)/metadata/*.metainfo.xml ; \ if [ $$? -eq 0 ] ; then \ echo "Passed: valid software descriptors" ; \ else \ echo "FAILED: valid software descriptors" ; \ fi ; # very strange results: # appstreamcli validate $(abs_top_builddir)/metadata/*.appdata.xml $(abs_top_builddir)/metadata/*.metainfo.xml stamps/generate-docs.stamp: stamps/netx.stamp mkdir -p "$(DOCS_DIR)" ; \ HTML_DOCS_TARGET_DIR="$(DOCS_DIR)/html" ; \ PLAIN_DOCS_TARGET_DIR="$(DOCS_DIR)/plain" ; \ MAN_DOCS_TARGET_DIR="$(DOCS_DIR)/man" ; \ mkdir "$$HTML_DOCS_TARGET_DIR" ; \ mkdir "$$PLAIN_DOCS_TARGET_DIR" ; \ mkdir "$$MAN_DOCS_TARGET_DIR" ; \ HTML_DOCS_INDEX="$$HTML_DOCS_TARGET_DIR/index.html" ; \ TP_COMMAND="$(SYSTEM_JRE_DIR)/bin/java -cp $(NETX_DIR) net.sourceforge.jnlp.util.docprovider.TextsProvider" ; \ TP_TAIL="false $(FULL_VERSION)" ; \ LANG_BACKUP=$$LANG ; \ echo "$(PLUGIN_VERSION)" > "$$HTML_DOCS_INDEX" ; \ echo "

    $(PLUGIN_VERSION) docs:

    " >> "$$HTML_DOCS_INDEX" ; \ for LANG_ID in en_US.UTF-8 cs_CZ.UTF-8 pl_PL.UTF-8 de_DE.UTF-8 ; do \ ID=`echo "$$LANG_ID" | head -c 2` ; \ ENCOD=`echo "$$LANG_ID" | tail -c 6 -` ; \ export LANG=$$LANG_ID; \ mkdir "$$HTML_DOCS_TARGET_DIR/$$ID" ; \ echo "
  • $$LANG_ID
  • " >> "$$HTML_DOCS_INDEX" ; \ $$TP_COMMAND html "$$HTML_DOCS_TARGET_DIR/$$ID" $$TP_TAIL ; \ mkdir "$$PLAIN_DOCS_TARGET_DIR/$$ID" ; \ $$TP_COMMAND plain "$$PLAIN_DOCS_TARGET_DIR/$$ID" 160 $$TP_TAIL; \ if [ $$ID = "en" ] ; then \ MAN_DESC="$$MAN_DOCS_TARGET_DIR/man1" ; \ else \ MAN_DESC="$$MAN_DOCS_TARGET_DIR/$$ID/man1" ; \ fi ; \ mkdir -p "$$MAN_DESC" ; \ $$TP_COMMAND man $$ENCOD "$$MAN_DESC" $$TP_TAIL ; \ $$TP_COMMAND htmlIntro "$(NETX_DIR)/net/sourceforge/jnlp/resources/about_$$ID.html" $$TP_TAIL; \ done ; \ export LANG=$$LANG_BACKUP ; \ echo "" >> $$HTML_DOCS_INDEX ; \ touch $@ stamps/netx-html-gen.stamp: (cd $$NETX_SRCDIR/..; \ mkdir -p html-gen; \ cp AUTHORS NEWS COPYING ChangeLog html-gen/; \ export HTML_GEN_DEBUG=true; \ ${SHELL} html-gen.sh 33; \ unset HTML_GEN_DEBUG) ${INSTALL_DATA} $(NETX_SRCDIR)/../html-gen/*.html $(NETX_RESOURCE_DIR) rm -r $(NETX_SRCDIR)/../html-gen/ mkdir -p stamps touch $@ stamps/netx.stamp: netx-source-files.txt stamps/netx-html-gen.stamp mkdir -p $(NETX_DIR) $(SYSTEM_JDK_DIR)/bin/javac $(IT_JAVACFLAGS) \ -d $(NETX_DIR) \ -sourcepath $(NETX_SRCDIR) \ $(call composeclasspath, $(TAGSOUP_JAR) $(RHINO_JAR)) \ @netx-source-files.txt (cd $(NETX_RESOURCE_DIR); \ for files in $$(find . -type f); \ do \ ${INSTALL_DATA} -D $${files} \ $(NETX_DIR)/net/sourceforge/jnlp/resources/$${files}; \ done) cp -a $(NETX_SRCDIR)/net/sourceforge/jnlp/runtime/pac-funcs.js \ $(NETX_DIR)/net/sourceforge/jnlp/runtime cp -a build.properties $(NETX_DIR)/net/sourceforge/jnlp/ mkdir -p stamps touch $@ stamps/netx-dist.stamp: stamps/netx.stamp $(abs_top_builddir)/netx.manifest stamps/generate-docs.stamp $(abs_top_builddir)/metadata (cd $(NETX_DIR) ; \ mkdir -p lib ; \ $(SYSTEM_JDK_DIR)/bin/jar cfm lib/classes.jar \ $(abs_top_builddir)/netx.manifest javax/jnlp net sun; \ cp -pPR $(SRC_DIR_LINK) $(NETX_SRCDIR) src; \ find src -type f -exec chmod 640 '{}' ';' -o -type d -exec chmod 750 '{}' ';'; \ cd src ; \ $(ZIP) -qr $(NETX_DIR)/lib/src.zip javax net sun) mkdir -p stamps touch $@ clean-netx: rm -rf $(NETX_DIR) rm -f stamps/netx-dist.stamp rm -f netx-source-files.txt rm -f stamps/netx.stamp rm -f stamps/netx-html-gen.stamp rm -f $(NETX_RESOURCE_DIR)/{NEWS,AUTHORS,COPYING,ChangeLog}.html clean-desktop-files: rm -f javaws.desktop rm -f itweb-settings.desktop launcher.build/$(javaws): launcher/launchers.in mkdir -p launcher.build MAIN_CLASS=net.sourceforge.jnlp.runtime.Boot ;\ BIN_LOCATION=$(bindir)/$(javaws) ;\ PROGRAM_NAME=$(javaws) ;\ $(edit_launcher_script) < $< > $@ launcher.build/$(itweb_settings): launcher/launchers.in mkdir -p launcher.build MAIN_CLASS=net.sourceforge.jnlp.controlpanel.CommandLine ;\ BIN_LOCATION=$(bindir)/$(itweb_settings) ;\ PROGRAM_NAME=$(itweb_settings) ;\ $(edit_launcher_script) < $< > $@ launcher.build/$(policyeditor): launcher/launchers.in mkdir -p launcher.build MAIN_CLASS=net.sourceforge.jnlp.security.policyeditor.PolicyEditor ;\ BIN_LOCATION=$(bindir)/$(policyeditor) ;\ PROGRAM_NAME=$(policyeditor) ;\ $(edit_launcher_script) < $< > $@ clean-launchers: rm -f launcher.build/$(javaws) rm -f launcher.build/$(itweb_settings) rm -f launcher.build/$(policyeditor) if [ -e launcher.build ] ; then \ rmdir launcher.build ; \ fi javaws.desktop: javaws.desktop.in sed "s#PATH_TO_JAVAWS#$(bindir)/$(javaws)#" < $(srcdir)/javaws.desktop.in > javaws.desktop itweb-settings.desktop: $(srcdir)/itweb-settings.desktop.in sed "s#PATH_TO_ITWEB_SETTINGS#$(bindir)/$(itweb_settings)#" \ < $(srcdir)/itweb-settings.desktop.in > itweb-settings.desktop policyeditor.desktop: $(srcdir)/policyeditor.desktop.in sed 's#PATH_TO_POLICYEDITOR#$(bindir)/$(policyeditor)#' \ < $(srcdir)/policyeditor.desktop.in > policyeditor.desktop # documentation stamps/docs.stamp: stamps/netx-docs.stamp stamps/plugin-docs.stamp touch stamps/docs.stamp clean-docs: clean-netx-docs clean-plugin-docs if [ -e ${abs_top_builddir}/docs ] ; then \ rmdir ${abs_top_builddir}/docs ; \ fi rm -f stamps/docs.stamp stamps/netx-docs.stamp: @ENABLE_DOCS_TRUE@ $(SYSTEM_JDK_DIR)/bin/javadoc $(JAVADOC_MEM_OPTS) $(JAVADOC_OPTS) \ @ENABLE_DOCS_TRUE@ -d ${abs_top_builddir}/docs/netx -sourcepath $(NETX_SRCDIR) \ @ENABLE_DOCS_TRUE@ -doctitle 'IcedTea-Web: NetX API Specification' \ @ENABLE_DOCS_TRUE@ -windowtitle 'IcedTea-Web: NetX ' \ @ENABLE_DOCS_TRUE@ -header 'IcedTea-Web
    NetX
    ' \ @ENABLE_DOCS_TRUE@ $(call composeclasspath, $(TAGSOUP_JAR) $(RHINO_JAR)) \ @ENABLE_DOCS_TRUE@ $(NETX_PKGS) mkdir -p stamps touch stamps/netx-docs.stamp clean-netx-docs: rm -rf ${abs_top_builddir}/docs/netx rm -f stamps/netx-docs.stamp stamps/plugin-docs.stamp: @ENABLE_DOCS_TRUE@@ENABLE_PLUGIN_TRUE@ $(SYSTEM_JDK_DIR)/bin/javadoc $(JAVADOC_MEM_OPTS) $(JAVADOC_OPTS) \ @ENABLE_DOCS_TRUE@@ENABLE_PLUGIN_TRUE@ -d ${abs_top_builddir}/docs/plugin -sourcepath $(NETX_SRCDIR):$(LIVECONNECT_SRCS) \ @ENABLE_DOCS_TRUE@@ENABLE_PLUGIN_TRUE@ -doctitle 'IcedTea-Web: Plugin API Specification' \ @ENABLE_DOCS_TRUE@@ENABLE_PLUGIN_TRUE@ -windowtitle 'IcedTea-Web: Plugin ' \ @ENABLE_DOCS_TRUE@@ENABLE_PLUGIN_TRUE@ -header 'IcedTea-Web
    Plugin
    ' \ @ENABLE_DOCS_TRUE@@ENABLE_PLUGIN_TRUE@ $(call composeclasspath, $(TAGSOUP_JAR) $(RHINO_JAR)) \ @ENABLE_DOCS_TRUE@@ENABLE_PLUGIN_TRUE@ $(PLUGIN_PKGS) mkdir -p stamps touch stamps/plugin-docs.stamp clean-plugin-docs: rm -rf ${abs_top_builddir}/docs/plugin rm -f stamps/plugin-docs.stamp clean-generated-docs: rm -rf "$(DOCS_DIR)" rm -f stamps/generate-docs.stamp clean-metadata: rm -rf $(abs_top_builddir)/metadata # check # ========================== clean-tests: clean-netx-tests clean-cpp-unit-tests clean-unittest++ if [ -e $(CPP_UNITTEST_DIR) ] ; then \ rmdir $(CPP_UNITTEST_DIR) ; \ fi if [ -e $(TESTS_DIR) ]; then \ rmdir $(TESTS_DIR) ; \ fi stamps/check-pac-functions.stamp: ./jrunscript $(abs_top_srcdir)/tests/netx/pac/pac-funcs-test.js \ $$(readlink -f $(abs_top_srcdir)/netx/net/sourceforge/jnlp/runtime/pac-funcs.js) ; \ mkdir -p stamps && \ touch $@ junit-runner-source-files.txt: find $(JUNIT_RUNNER_SRCDIR) -name '*.java' | sort > $@ jacoco-operator-source-files.txt: find $(JACOCO_OPERATOR_SRCDIR) -name '*.java' | sort > $@ $(JUNIT_RUNNER_JAR): junit-runner-source-files.txt stamps/test-extensions-compile.stamp mkdir -p $(JUNIT_RUNNER_DIR) && \ $(SYSTEM_JDK_DIR)/bin/javac $(IT_JAVACFLAGS) \ -d $(JUNIT_RUNNER_DIR) \ $(call composeclasspath, $(JUNIT_RUNTIME) $(TEST_EXTENSIONS_DIR)) \ @junit-runner-source-files.txt && \ $(SYSTEM_JDK_DIR)/bin/jar cf $@ -C $(JUNIT_RUNNER_DIR) . stamps/junit-jnlp-dist-dirs: junit-jnlp-dist-simple.txt stamps/junit-jnlp-dist-signed.stamp junit-jnlp-dist-custom.txt mkdir -p $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR) mkdir -p $(REPRODUCERS_BUILD_DIR) touch $@ junit-jnlp-dist-custom.txt: cd $(REPRODUCERS_TESTS_SRCDIR)/$(CUSTOM_REPRODUCERS)/ ; \ for x in $(COMPILE_WHITELIST_FILTER) ; do \ find . -maxdepth 1 -mindepth 1 | sed "s/.\/*//" | grep $$x > $(abs_top_builddir)/$@ || true ; \ done junit-jnlp-dist-simple.txt: cd $(REPRODUCERS_TESTS_SRCDIR)/simple/ ; \ for x in $(COMPILE_WHITELIST_FILTER) ; do \ find . -maxdepth 1 -mindepth 1 | sed "s/.\/*//" | grep $$x > $(abs_top_builddir)/$@ || true ; \ done stamps/junit-jnlp-dist-signed.stamp: types=($(SIGNED_REPRODUCERS)) ; \ for which in "$${types[@]}" ; do \ pushd $(REPRODUCERS_TESTS_SRCDIR)/$$which/ ; \ for x in $(COMPILE_WHITELIST_FILTER) ; do \ find . -maxdepth 1 -mindepth 1 | sed "s/.\/*//" | grep $$x > $(abs_top_builddir)/junit-jnlp-dist-$$which.txt ; \ done ; \ popd ; \ done ; \ mkdir -p stamps && \ touch $@ stamps/netx-dist-tests-prepare-reproducers.stamp: stamps/junit-jnlp-dist-dirs stamps/liveconnect-dist.stamp stamps/netx-dist.stamp stamps/plugin.stamp types=($(ALL_NONCUSTOM_REPRODUCERS)); \ for which in "$${types[@]}" ; do \ . $(abs_top_srcdir)/NEW_LINE_IFS ; \ simpleReproducers=(`cat $(abs_top_builddir)/junit-jnlp-dist-$$which.txt `); \ IFS="$$IFS_BACKUP" ; \ for dir in "$${simpleReproducers[@]}" ; do \ echo "processing: $$dir" ; \ mkdir -p "$(REPRODUCERS_BUILD_DIR)/$$dir" ; \ if [ -e "$(REPRODUCERS_TESTS_SRCDIR)/$$which/$$dir/srcs/" ]; then \ d=`pwd` ; \ cd "$(REPRODUCERS_TESTS_SRCDIR)/$$which/$$dir/srcs/" ; \ srcFiles=`find . -mindepth 1 -type f -name "*.java" | sed "s/.\/*//"` ; \ notSrcFiles=`find . -mindepth 1 -type f \! -name "*.java" | sed "s/.\/*//"` ; \ $(SYSTEM_JDK_DIR)/bin/javac -cp $(NETX_DIR)/lib/classes.jar:$(abs_top_builddir)/liveconnect -d "$(REPRODUCERS_BUILD_DIR)/$$dir/" $$srcFiles ; \ if [ -n "$$notSrcFiles" ] ; then \ cp -R --parents $$notSrcFiles "$(REPRODUCERS_BUILD_DIR)/$$dir/" ; \ fi ; \ cd "$(REPRODUCERS_BUILD_DIR)/$$dir/" ; \ if [ -f $(META_MANIFEST) ]; \ then \ $(SYSTEM_JDK_DIR)/bin/jar cfm "$(REPRODUCERS_TESTS_SERVER_DEPLOYDIR)/$$dir.jar" $(META_MANIFEST) * ; \ else \ $(SYSTEM_JDK_DIR)/bin/jar cf "$(REPRODUCERS_TESTS_SERVER_DEPLOYDIR)/$$dir.jar" * ; \ fi; \ AN="Application-Name:" ; \ grep $$AN $(META_MANIFEST) 2>/dev/null >/dev/null ; \ GREP_R=$$?; \ if [ ! -f $(META_MANIFEST) -o $$GREP_R -ne 0 ]; \ then \ TMP_MANIFEST=`mktemp` ; \ echo "$$AN $$dir" > $$TMP_MANIFEST ; \ $(SYSTEM_JDK_DIR)/bin/jar ufm "$(REPRODUCERS_TESTS_SERVER_DEPLOYDIR)/$$dir.jar" $$TMP_MANIFEST ; \ rm -f $$TMP_MANIFEST ; \ fi ; \ cd "$$d" ; \ fi; \ done ; \ done ; \ mkdir -p stamps && \ touch $@ stamps/netx-dist-tests-sign-some-reproducers.stamp: stamps/netx-dist-tests-prepare-reproducers.stamp keystore=$(abs_top_builddir)/$(PRIVATE_KEYSTORE_NAME); \ types=($(SIGNED_REPRODUCERS)) ; \ for which in "$${types[@]}" ; do \ tcaw=$(TEST_CERT_ALIAS)_$$which ; \ $(SYSTEM_JRE_DIR)/bin/keytool -genkey -alias $$tcaw -keystore $$keystore -keypass $(PRIVATE_KEYSTORE_PASS) -storepass $(PRIVATE_KEYSTORE_PASS) -dname "cn=$$tcaw, ou=$$tcaw, o=$$tcaw, c=$$tcaw" ; \ . $(abs_top_srcdir)/NEW_LINE_IFS ; \ signedReproducers=(`cat $(abs_top_builddir)/junit-jnlp-dist-$$which.txt `); \ IFS="$$IFS_BACKUP" ; \ for dir in "$${signedReproducers[@]}" ; do \ $(SYSTEM_JDK_DIR)/bin/jarsigner -keystore $$keystore -storepass $(PRIVATE_KEYSTORE_PASS) -keypass $(PRIVATE_KEYSTORE_PASS) "$(REPRODUCERS_TESTS_SERVER_DEPLOYDIR)/$$dir.jar" $$tcaw ; \ done ; \ done ; \ mkdir -p stamps && \ touch $@ stamps/change-dots-to-paths.stamp: stamps/netx-dist-tests-sign-some-reproducers.stamp pushd $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR); \ types=($(ALL_NONCUSTOM_REPRODUCERS)); \ for which in "$${types[@]}" ; do \ . $(abs_top_srcdir)/NEW_LINE_IFS ; \ simpleReproducers=(`cat $(abs_top_builddir)/junit-jnlp-dist-$$which.txt `); \ IFS="$$IFS_BACKUP" ; \ for dir in "$${simpleReproducers[@]}" ; do \ if test "$${dir:0:1}" = "." ; then \ echo "reproducer $$dir starts with dot. It is forbidden" ; \ exit 5; \ fi; \ if test "$${dir:(-1)}" = "." ; then \ echo "reproducer $$dir ends with dot. It is forbidden" ; \ exit 5; \ fi; \ q=`expr index "$$dir" .`; \ r=$$? ; \ if [ $$r = 0 ]; then \ slashed_dir="./$${dir//.//}" ; \ path="`dirname $$slashed_dir`" ; \ file="`basename $$slashed_dir`.jar" ; \ echo "copying $$dir.jar to $$path as $$file" ; \ mkdir --parents $$path ; \ cp $$dir".jar" "$$path"/"$$file" ; \ fi ; \ done ; \ done ; \ popd ; \ mkdir -p stamps && \ touch $@ #this always tries to remove previous testcert #the code is copypasted from netx-dist-tests-remove-cert-from-public, because #with depending to not stamped target we always have to rerun reproducers targets stamps/exported-test-certs.stamp: stamps/change-dots-to-paths.stamp -types=($(SIGNED_REPRODUCERS)) ; \ PUBLIC_KEYSTORE=$$XDG_CONFIG_HOME ; \ if test "x$$PUBLIC_KEYSTORE" = x; then \ PUBLIC_KEYSTORE=${HOME}/.config ; \ fi ;\ PUBLIC_KEYSTORE=$$PUBLIC_KEYSTORE/$(PUBLIC_KEYSTORE_STUB); \ keystoredir=`dirname $(PUBLIC_KEYSTORE)`; \ [ ! -d $(keystoredir) ] && mkdir -p $(keystoredir); \ for which in "$${types[@]}" ; do \ $(SYSTEM_JDK_DIR)/bin/keytool -delete -alias $(TEST_CERT_ALIAS)_$$which -keystore $$PUBLIC_KEYSTORE -storepass $(PUBLIC_KEYSTORE_PASS) ; \ done ; types=($(SIGNED_REPRODUCERS)) ; \ for which in "$${types[@]}" ; do \ $(SYSTEM_JDK_DIR)/bin/keytool -export -alias $(TEST_CERT_ALIAS)_$$which -file $(EXPORTED_TEST_CERT_PREFIX)_$$which.$(EXPORTED_TEST_CERT_SUFFIX) -storepass $(PRIVATE_KEYSTORE_PASS) -keystore $(PRIVATE_KEYSTORE_NAME) ; \ done ; mkdir -p stamps && \ touch $@ stamps/netx-dist-tests-import-cert-to-public: stamps/exported-test-certs.stamp types=($(SIGNED_REPRODUCERS)) ; \ PUBLIC_KEYSTORE=$$XDG_CONFIG_HOME ; \ if test "x$$PUBLIC_KEYSTORE" = x; then \ PUBLIC_KEYSTORE=${HOME}/.config ; \ fi ;\ PUBLIC_KEYSTORE=$$PUBLIC_KEYSTORE/$(PUBLIC_KEYSTORE_STUB); \ keystoredir=`dirname $(PUBLIC_KEYSTORE)`; \ [ ! -d $(keystoredir) ] && mkdir -p $(keystoredir); \ for which in "$${types[@]}" ; do \ yes | $(SYSTEM_JDK_DIR)/bin/keytool -import -alias $(TEST_CERT_ALIAS)_$$which -keystore $$PUBLIC_KEYSTORE -storepass $(PUBLIC_KEYSTORE_PASS) -file $(EXPORTED_TEST_CERT_PREFIX)_$$which.$(EXPORTED_TEST_CERT_SUFFIX) ;\ done ; mkdir -p stamps && \ touch $@ netx-dist-tests-remove-cert-from-public: -types=($(SIGNED_REPRODUCERS)) ; \ PUBLIC_KEYSTORE=$$XDG_CONFIG_HOME ; \ if test "x$$PUBLIC_KEYSTORE" = x; then \ PUBLIC_KEYSTORE=${HOME}/.config ; \ fi ;\ PUBLIC_KEYSTORE=$$PUBLIC_KEYSTORE/$(PUBLIC_KEYSTORE_STUB); \ keystoredir=`dirname $(PUBLIC_KEYSTORE)`; \ [ ! -d $(keystoredir) ] && mkdir -p $(keystoredir); \ for which in "$${types[@]}" ; do \ $(SYSTEM_JDK_DIR)/bin/keytool -delete -alias $(TEST_CERT_ALIAS)_$$which -keystore $$PUBLIC_KEYSTORE -storepass $(PUBLIC_KEYSTORE_PASS) ; \ done ; -rm -rf stamps/netx-dist-tests-import-cert-to-public test-extensions-source-files.txt: find $(TEST_EXTENSIONS_SRCDIR) -name '*.java' | sort > $@ stamps/test-extensions-compile.stamp: stamps/netx-dist.stamp stamps/plugin.stamp stamps/junit-jnlp-dist-dirs test-extensions-source-files.txt mkdir -p $(TEST_EXTENSIONS_DIR); mkdir -p $(NETX_TEST_DIR); ln -s $(TEST_EXTENSIONS_DIR) $(TEST_EXTENSIONS_COMPATIBILITY_SYMLINK); $(SYSTEM_JDK_DIR)/bin/javac $(IT_JAVACFLAGS) \ -d $(TEST_EXTENSIONS_DIR) \ $(call composeclasspath, $(JUNIT_RUNTIME) $(NETX_DIR)/lib/classes.jar $(abs_top_builddir)/liveconnect/lib/classes.jar) \ @test-extensions-source-files.txt && \ mkdir -p stamps && \ touch $@ test-extensions-tests-source-files.txt: for x in $(COMPILE_WHITELIST_FILTER) ; do \ find $(TEST_EXTENSIONS_TESTS_SRCDIR) -name '*.java' | grep $$x | sort > $@ ; \ done stamps/test-extensions-tests-compile.stamp: stamps/junit-jnlp-dist-dirs test-extensions-tests-source-files.txt stamps/test-extensions-compile.stamp mkdir -p $(TEST_EXTENSIONS_TESTS_DIR); for x in `cat $(abs_top_builddir)/test-extensions-tests-source-files.txt` ; do \ $(SYSTEM_JDK_DIR)/bin/javac $(IT_JAVACFLAGS) \ -d $(TEST_EXTENSIONS_TESTS_DIR) \ $(call composeclasspath, $(JUNIT_RUNTIME) $(NETX_DIR)/lib/classes.jar $(TEST_EXTENSIONS_DIR)) \ $$x ; \ done ; \ mkdir -p stamps && \ touch $@ stamps/compile-reproducers-testcases.stamp: stamps/netx-dist.stamp stamps/plugin.stamp stamps/junit-jnlp-dist-dirs \ test-extensions-source-files.txt stamps/test-extensions-compile.stamp stamps/test-extensions-tests-compile.stamp types=($(ALL_REPRODUCERS)); \ for which in "$${types[@]}" ; do \ . $(abs_top_srcdir)/NEW_LINE_IFS ; \ simpleReproducers=(`cat $(abs_top_builddir)/junit-jnlp-dist-$$which.txt `); \ IFS="$$IFS_BACKUP" ; \ for dir in "$${simpleReproducers[@]}" ; do \ echo "compiling" $$dir ; \ $(SYSTEM_JDK_DIR)/bin/javac $(IT_JAVACFLAGS) \ -d $(TEST_EXTENSIONS_TESTS_DIR) \ $(call composeclasspath, $(JUNIT_RUNTIME) $(NETX_DIR)/lib/classes.jar $(TEST_EXTENSIONS_DIR)) \ "$(REPRODUCERS_TESTS_SRCDIR)/$$which/$$dir/testcases/"*.java ; \ if [ -d "$(REPRODUCERS_TESTS_SRCDIR)/$$which/$$dir/testcases" ]; then \ pushd "$(REPRODUCERS_TESTS_SRCDIR)/$$which/$$dir/testcases" ; \ NONJAVA_RESOURCES=`ls | grep -v ".*\\.java$$"` ; \ if [ -n "$$NONJAVA_RESOURCES" ]; then \ cp $$NONJAVA_RESOURCES $(TEST_EXTENSIONS_TESTS_DIR)/ ; \ fi ; \ popd ; \ fi ; \ done ; \ done ; \ mkdir -p stamps && \ touch $@ stamps/copy-reproducers-resources.stamp: stamps/junit-jnlp-dist-dirs types=($(ALL_REPRODUCERS)); \ for which in "$${types[@]}" ; do \ . $(abs_top_srcdir)/NEW_LINE_IFS ; \ simpleReproducers=(`cat $(abs_top_builddir)/junit-jnlp-dist-$$which.txt `); \ IFS="$$IFS_BACKUP" ; \ for dir in "$${simpleReproducers[@]}" ; do \ cp -R "$(REPRODUCERS_TESTS_SRCDIR)/$$which/$$dir/resources/"* $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR)/ ; \ done ; \ done ; \ mkdir -p stamps && \ touch $@ $(REPRODUCERS_CLASS_NAMES): whiteListed=$(RUN_WHITELIST_FILTER); \ cd $(TEST_EXTENSIONS_TESTS_DIR) ; \ class_names= ; \ for test in `find -type f` ; do \ class_name=`echo $$test | sed -e 's|\.class$$||' -e 's|^\./||'` ; \ class_name=`echo $$class_name | sed -e 's|/|.|g' ` ; \ INCLUDE="NO" ; \ for x in $$whiteListed ; do \ q=`expr match "$$class_name" "$$x"`; \ r=$$? ; \ if [ $$r = 0 ]; then \ echo "$$class_name will be included in reproducers testcases because of $$x pattern in $(REPRODUCERS_CLASS_WHITELIST). Matching was $$q"; \ INCLUDE="YES" ; \ fi; \ done; \ if [ "$$INCLUDE" = "YES" ]; then \ class_names="$$class_names $$class_name" ; \ else \ echo "$$class_name had no match in $(REPRODUCERS_CLASS_WHITELIST). Excluding"; \ fi; \ done ; \ echo $$class_names > $(REPRODUCERS_CLASS_NAMES) stamps/run-netx-dist-tests.stamp: stamps/netx-dist.stamp stamps/plugin.stamp launcher.build/$(javaws) \ javaws.desktop stamps/docs.stamp launcher.build/$(itweb_settings) itweb-settings.desktop launcher.build/$(policyeditor) policyeditor.desktop \ stamps/netx.stamp stamps/junit-jnlp-dist-dirs stamps/netx-dist-tests-import-cert-to-public \ stamps/test-extensions-compile.stamp stamps/compile-reproducers-testcases.stamp $(JUNIT_RUNNER_JAR) stamps/copy-reproducers-resources.stamp\ $(TESTS_DIR)/$(REPORT_STYLES_DIRNAME) $(REPRODUCERS_CLASS_NAMES) stamps/process-custom-reproducers.stamp cd $(TEST_EXTENSIONS_DIR) ; \ class_names=`cat $(REPRODUCERS_CLASS_NAMES)` ; \ CLASSPATH=$(call joinsegments, $(NETX_DIR)/lib/classes.jar $(JUNIT_RUNTIME) $(JUNIT_RUNNER_JAR) . $(TEST_EXTENSIONS_TESTS_DIR) $(TEST_EXTENSIONS_SRCDIR)) ; \ $(SYSTEM_JRE_DIR)/bin/java $(REPRODUCERS_DPARAMETERS) \ -Xbootclasspath/a:$$CLASSPATH CommandLine $$class_names @WITH_XSLTPROC_TRUE@ -$(XSLTPROC) --stringparam logs logs_reproducers.html $(TESTS_SRCDIR)/$(REPORT_STYLES_DIRNAME)/jreport.xsl $(TEST_EXTENSIONS_DIR)/tests-output.xml > $(TESTS_DIR)/index_reproducers.html @WITH_XSLTPROC_TRUE@ -$(XSLTPROC) $(TESTS_SRCDIR)/$(REPORT_STYLES_DIRNAME)/logs.xsl $(TEST_EXTENSIONS_DIR)/ServerAccess-logs.xml > $(TESTS_DIR)/logs_reproducers.html @WITH_XSLTPROC_TRUE@ -$(XSLTPROC) $(TESTS_SRCDIR)/$(REPORT_STYLES_DIRNAME)/textreport.xsl $(TEST_EXTENSIONS_DIR)/tests-output.xml > $(TESTS_DIR)/summary_reproducers.txt touch $@ stamps/process-custom-reproducers.stamp: stamps/junit-jnlp-dist-dirs stamps/netx-dist-tests-import-cert-to-public \ stamps/test-extensions-compile.stamp stamps/compile-reproducers-testcases.stamp $(JUNIT_RUNNER_JAR) stamps/copy-reproducers-resources.stamp\ $(TESTS_DIR)/$(REPORT_STYLES_DIRNAME) $(REPRODUCERS_CLASS_NAMES) . $(abs_top_srcdir)/NEW_LINE_IFS ; \ customReproducers=(`cat $(abs_top_builddir)/junit-jnlp-dist-custom.txt `); \ IFS="$$IFS_BACKUP" ; \ for dir in "$${customReproducers[@]}" ; do \ pushd $(REPRODUCERS_TESTS_SRCDIR)/$(CUSTOM_REPRODUCERS)/$$dir/srcs; \ $(MAKE) prepare-reproducer ; \ popd ; \ done ; \ mkdir -p stamps && \ touch $@ clean-custom-reproducers: junit-jnlp-dist-custom.txt . $(abs_top_srcdir)/NEW_LINE_IFS ; \ customReproducers=(`cat $(abs_top_builddir)/junit-jnlp-dist-custom.txt `); \ IFS="$$IFS_BACKUP" ; \ for dir in "$${customReproducers[@]}" ; do \ pushd $(REPRODUCERS_TESTS_SRCDIR)/custom/$$dir/srcs; \ $(MAKE) clean-reproducer ; \ popd ; \ done ; \ rm -f stamps/process-custom-reproducers.stamp #for global-links you must be root, for opera there do not exists user-links #although this targets will indeed create symbolic links to enable #icedtea-web plugin inside browser it is intended for testing purposes @ENABLE_PLUGIN_TRUE@stamps/user-links.stamp: stamps/netx-dist.stamp stamps/plugin.stamp \ @ENABLE_PLUGIN_TRUE@ launcher.build/$(javaws) stamps/netx.stamp $(DESTDIR)$(libdir)/$(BUILT_PLUGIN_LIBRARY) @ENABLE_PLUGIN_TRUE@ if [ $(MOZILLA_FAMILY_TEST) ] ; then \ @ENABLE_PLUGIN_TRUE@ if [ -e $(MOZILLA_LOCAL_PLUGINDIR)/$(PLUGIN_LINK_NAME) ] ; then \ @ENABLE_PLUGIN_TRUE@ mv -f $(MOZILLA_LOCAL_PLUGINDIR)/$(PLUGIN_LINK_NAME) $(MOZILLA_LOCAL_BACKUP_FILE) ; \ @ENABLE_PLUGIN_TRUE@ echo "$(MOZILLA_LOCAL_PLUGINDIR)/$(PLUGIN_LINK_NAME) backed up as $(MOZILLA_LOCAL_BACKUP_FILE)" ; \ @ENABLE_PLUGIN_TRUE@ else \ @ENABLE_PLUGIN_TRUE@ echo "$(MOZILLA_LOCAL_PLUGINDIR)/$(PLUGIN_LINK_NAME) doesn't exists, nothing to be backed up to $(MOZILLA_LOCAL_BACKUP_FILE)" ; \ @ENABLE_PLUGIN_TRUE@ fi ; \ @ENABLE_PLUGIN_TRUE@ pushd $(MOZILLA_LOCAL_PLUGINDIR) ; \ @ENABLE_PLUGIN_TRUE@ ln -s $(DESTDIR)$(libdir)/$(BUILT_PLUGIN_LIBRARY) $(PLUGIN_LINK_NAME) ; \ @ENABLE_PLUGIN_TRUE@ echo "$(DESTDIR)$(libdir)/$(BUILT_PLUGIN_LIBRARY) linked as $$PWD/$(PLUGIN_LINK_NAME)" ; \ @ENABLE_PLUGIN_TRUE@ popd ; \ @ENABLE_PLUGIN_TRUE@ fi ; \ @ENABLE_PLUGIN_TRUE@ touch $@ @ENABLE_PLUGIN_TRUE@restore-user-links: @ENABLE_PLUGIN_TRUE@ if [ $(MOZILLA_FAMILY_TEST) ] ; then \ @ENABLE_PLUGIN_TRUE@ if [ -e $(MOZILLA_LOCAL_BACKUP_FILE) ] ; then \ @ENABLE_PLUGIN_TRUE@ mv -f $(MOZILLA_LOCAL_BACKUP_FILE) $(MOZILLA_LOCAL_PLUGINDIR)/$(PLUGIN_LINK_NAME) ; \ @ENABLE_PLUGIN_TRUE@ echo "$(MOZILLA_LOCAL_BACKUP_FILE) restored as $(MOZILLA_LOCAL_PLUGINDIR)/$(PLUGIN_LINK_NAME)" ; \ @ENABLE_PLUGIN_TRUE@ else \ @ENABLE_PLUGIN_TRUE@ rm -f $(MOZILLA_LOCAL_PLUGINDIR)/$(PLUGIN_LINK_NAME) ; \ @ENABLE_PLUGIN_TRUE@ echo "$(MOZILLA_LOCAL_BACKUP_FILE) do not exists, nothing to be restored. $(MOZILLA_LOCAL_PLUGINDIR)/$(PLUGIN_LINK_NAME) removed" ; \ @ENABLE_PLUGIN_TRUE@ fi ; \ @ENABLE_PLUGIN_TRUE@ fi ; @ENABLE_PLUGIN_TRUE@ if [ -e stamps/user-links.stamp ] ; then \ @ENABLE_PLUGIN_TRUE@ rm -f stamps/user-links.stamp ; \ @ENABLE_PLUGIN_TRUE@ fi @ENABLE_PLUGIN_TRUE@stamps/global-links.stamp: stamps/netx-dist.stamp stamps/plugin.stamp launcher.build/$(javaws) \ @ENABLE_PLUGIN_TRUE@ stamps/netx.stamp $(DESTDIR)$(libdir)/$(BUILT_PLUGIN_LIBRARY) @ENABLE_PLUGIN_TRUE@ if [ $(MOZILLA_FAMILY_TEST) ] ; then \ @ENABLE_PLUGIN_TRUE@ dir="$(MOZILLA_GLOBAL32_PLUGINDIR)" ; \ @ENABLE_PLUGIN_TRUE@ arch=`arch` ; \ @ENABLE_PLUGIN_TRUE@ if [ "$$arch" = "x86_64" ] ; then \ @ENABLE_PLUGIN_TRUE@ dir="$(MOZILLA_GLOBAL64_PLUGINDIR)" ; \ @ENABLE_PLUGIN_TRUE@ fi ; \ @ENABLE_PLUGIN_TRUE@ if [ -e "$$dir"/$(PLUGIN_LINK_NAME) ] ; then \ @ENABLE_PLUGIN_TRUE@ mv -f "$$dir"/$(PLUGIN_LINK_NAME) $(MOZILLA_GLOBAL_BACKUP_FILE) ; \ @ENABLE_PLUGIN_TRUE@ echo "$$dir/$(PLUGIN_LINK_NAME) backed up as $(MOZILLA_GLOBAL_BACKUP_FILE)" ; \ @ENABLE_PLUGIN_TRUE@ else \ @ENABLE_PLUGIN_TRUE@ echo "$$dir/$(PLUGIN_LINK_NAME) do not exists, nothing to be backed up to $(MOZILLA_GLOBAL_BACKUP_FILE)" ; \ @ENABLE_PLUGIN_TRUE@ fi ; \ @ENABLE_PLUGIN_TRUE@ pushd "$$dir" ; \ @ENABLE_PLUGIN_TRUE@ ln -s $(DESTDIR)$(libdir)/$(BUILT_PLUGIN_LIBRARY) $(PLUGIN_LINK_NAME) ; \ @ENABLE_PLUGIN_TRUE@ echo "$(DESTDIR)$(libdir)/$(BUILT_PLUGIN_LIBRARY) linked as $$PWD/$(PLUGIN_LINK_NAME)" ; \ @ENABLE_PLUGIN_TRUE@ popd ; \ @ENABLE_PLUGIN_TRUE@ fi ; @ENABLE_PLUGIN_TRUE@ if [ "$(OPERA)" != "" ] ; then \ @ENABLE_PLUGIN_TRUE@ dir="$(OPERA_GLOBAL32_PLUGINDIR)" ; \ @ENABLE_PLUGIN_TRUE@ arch=`arch` ; \ @ENABLE_PLUGIN_TRUE@ if [ "$$arch" = "x86_64" ] ; then \ @ENABLE_PLUGIN_TRUE@ dir="$(OPERA_GLOBAL64_PLUGINDIR)" ; \ @ENABLE_PLUGIN_TRUE@ fi ; \ @ENABLE_PLUGIN_TRUE@ if [ -e "$$dir"/$(PLUGIN_LINK_NAME) ] ; then \ @ENABLE_PLUGIN_TRUE@ mv -f "$$dir"/$(PLUGIN_LINK_NAME) $(OPERA_GLOBAL_BACKUP_FILE) ; \ @ENABLE_PLUGIN_TRUE@ echo "$$dir/$(PLUGIN_LINK_NAME) backed up as $(OPERA_GLOBAL_BACKUP_FILE) "; \ @ENABLE_PLUGIN_TRUE@ else \ @ENABLE_PLUGIN_TRUE@ echo "$$dir/$(PLUGIN_LINK_NAME) do not exists, nothing to be backed up to $(OPERA_GLOBAL_BACKUP_FILE) "; \ @ENABLE_PLUGIN_TRUE@ fi ; \ @ENABLE_PLUGIN_TRUE@ pushd "$$dir" ; \ @ENABLE_PLUGIN_TRUE@ ln -s $(DESTDIR)$(libdir)/$(BUILT_PLUGIN_LIBRARY) $(PLUGIN_LINK_NAME) ; \ @ENABLE_PLUGIN_TRUE@ echo "$(DESTDIR)$(libdir)/$(BUILT_PLUGIN_LIBRARY) linked as $$PWD/$(PLUGIN_LINK_NAME)" ; \ @ENABLE_PLUGIN_TRUE@ popd ; \ @ENABLE_PLUGIN_TRUE@ fi ; \ @ENABLE_PLUGIN_TRUE@ touch $@ @ENABLE_PLUGIN_TRUE@restore-global-links: @ENABLE_PLUGIN_TRUE@ if [ $(MOZILLA_FAMILY_TEST) ] ; then \ @ENABLE_PLUGIN_TRUE@ dir="$(MOZILLA_GLOBAL32_PLUGINDIR)" ; \ @ENABLE_PLUGIN_TRUE@ arch=`arch` ; \ @ENABLE_PLUGIN_TRUE@ if [ "$$arch" = "x86_64" ] ; then \ @ENABLE_PLUGIN_TRUE@ dir="$(MOZILLA_GLOBAL64_PLUGINDIR)" ; \ @ENABLE_PLUGIN_TRUE@ fi ; \ @ENABLE_PLUGIN_TRUE@ if [ -e $(MOZILLA_GLOBAL_BACKUP_FILE) ] ; then \ @ENABLE_PLUGIN_TRUE@ mv -f $(MOZILLA_GLOBAL_BACKUP_FILE) "$$dir"/$(PLUGIN_LINK_NAME) ; \ @ENABLE_PLUGIN_TRUE@ echo "$(MOZILLA_GLOBAL_BACKUP_FILE) restored as $$dir/$(PLUGIN_LINK_NAME)" ; \ @ENABLE_PLUGIN_TRUE@ else \ @ENABLE_PLUGIN_TRUE@ rm -f "$$dir"/$(PLUGIN_LINK_NAME) ; \ @ENABLE_PLUGIN_TRUE@ echo "$(MOZILLA_GLOBAL_BACKUP_FILE) do not exists, nothing to be restored. $$dir/$(PLUGIN_LINK_NAME) removed" ; \ @ENABLE_PLUGIN_TRUE@ fi ; \ @ENABLE_PLUGIN_TRUE@ fi ; @ENABLE_PLUGIN_TRUE@ if [ "$(OPERA)" != "" ] ; then \ @ENABLE_PLUGIN_TRUE@ dir="$(OPERA_GLOBAL32_PLUGINDIR)" ; \ @ENABLE_PLUGIN_TRUE@ arch=`arch` ; \ @ENABLE_PLUGIN_TRUE@ if [ "$$arch" = "x86_64" ] ; then \ @ENABLE_PLUGIN_TRUE@ dir="$(OPERA_GLOBAL64_PLUGINDIR)" ; \ @ENABLE_PLUGIN_TRUE@ fi ; \ @ENABLE_PLUGIN_TRUE@ if [ -e $(OPERA_GLOBAL_BACKUP_FILE) ] ; then \ @ENABLE_PLUGIN_TRUE@ mv -f $(OPERA_GLOBAL_BACKUP_FILE) "$$dir"/$(PLUGIN_LINK_NAME) ; \ @ENABLE_PLUGIN_TRUE@ echo "$(OPERA_GLOBAL_BACKUP_FILE) restored as $$dir/$(PLUGIN_LINK_NAME)" ; \ @ENABLE_PLUGIN_TRUE@ else \ @ENABLE_PLUGIN_TRUE@ rm -f "$$dir"/$(PLUGIN_LINK_NAME) ; \ @ENABLE_PLUGIN_TRUE@ echo "$(OPERA_GLOBAL_BACKUP_FILE) do not exist, nothing to be restored. $$dir/$(PLUGIN_LINK_NAME) removed" ; \ @ENABLE_PLUGIN_TRUE@ fi ; \ @ENABLE_PLUGIN_TRUE@ fi ; @ENABLE_PLUGIN_TRUE@ if [ -e stamps/global-links.stamp ] ; then \ @ENABLE_PLUGIN_TRUE@ rm -f stamps/global-links.stamp ; \ @ENABLE_PLUGIN_TRUE@ fi netx-unit-tests-source-files.txt: find $(NETX_UNIT_TEST_SRCDIR) -name '*.java' | sort > $@ stamps/netx-unit-tests-compile.stamp: stamps/netx.stamp \ netx-unit-tests-source-files.txt stamps/test-extensions-compile.stamp mkdir -p $(NETX_UNIT_TEST_DIR) && \ $(SYSTEM_JDK_DIR)/bin/javac $(IT_JAVACFLAGS) \ -d $(NETX_UNIT_TEST_DIR) \ $(call composeclasspath, $(JUNIT_RUNTIME) $(abs_top_builddir)/liveconnect/lib/classes.jar $(NETX_DIR)/lib/classes.jar $(TEST_EXTENSIONS_DIR) $(TAGSOUP_JAR)) \ @netx-unit-tests-source-files.txt && \ mkdir -p stamps && \ touch $@ $(TESTS_DIR)/$(REPORT_STYLES_DIRNAME): mkdir $(TESTS_DIR)/$(REPORT_STYLES_DIRNAME) cp $(TESTS_SRCDIR)/$(REPORT_STYLES_DIRNAME)/*.css $(TESTS_DIR)/$(REPORT_STYLES_DIRNAME)/ cp $(TESTS_SRCDIR)/$(REPORT_STYLES_DIRNAME)/*.js $(TESTS_DIR)/$(REPORT_STYLES_DIRNAME)/ $(UNIT_CLASS_NAMES): cd $(NETX_UNIT_TEST_DIR) ; \ class_names= ; \ for test in `find -type f` ; do \ class_name=`echo $$test | sed -e 's|\.class$$||' -e 's|^\./||'` ; \ class_name=`echo $$class_name | sed -e 's|/|.|g' ` ; \ class_names="$$class_names $$class_name" ; \ done ; \ echo $$class_names > $(UNIT_CLASS_NAMES); stamps/run-netx-unit-tests.stamp: stamps/netx-unit-tests-compile.stamp $(JUNIT_RUNNER_JAR) \ $(TESTS_DIR)/$(REPORT_STYLES_DIRNAME) $(UNIT_CLASS_NAMES) filename=" " ; \ cd $(NETX_UNIT_TEST_SRCDIR) ; \ for file in `find . -type f \! -iname "*.java"`; do\ filename=`echo $$file `; \ cp --parents $$filename $(NETX_UNIT_TEST_DIR) ; \ done ; \ cd $(NETX_UNIT_TEST_DIR) ; \ class_names=`cat $(UNIT_CLASS_NAMES)` ; \ CLASSPATH=$(call joinsegments, $(NETX_DIR)/lib/classes.jar $(abs_top_builddir)/liveconnect/lib/classes.jar $(JUNIT_RUNTIME) $(JUNIT_RUNNER_JAR) $(TEST_EXTENSIONS_DIR) . $(TEST_EXTENSIONS_SRCDIR) $(TAGSOUP_JAR)) ; \ $(SYSTEM_JRE_DIR)/bin/java -Xbootclasspath/a:$$CLASSPATH CommandLine $$class_names @WITH_XSLTPROC_TRUE@ -$(XSLTPROC) --stringparam logs logs_unit.html $(TESTS_SRCDIR)/$(REPORT_STYLES_DIRNAME)/jreport.xsl $(NETX_UNIT_TEST_DIR)/tests-output.xml > $(TESTS_DIR)/index_unit.html @WITH_XSLTPROC_TRUE@ -$(XSLTPROC) $(TESTS_SRCDIR)/$(REPORT_STYLES_DIRNAME)/logs.xsl $(NETX_UNIT_TEST_DIR)/ServerAccess-logs.xml > $(TESTS_DIR)/logs_unit.html @WITH_XSLTPROC_TRUE@ -$(XSLTPROC) $(TESTS_SRCDIR)/$(REPORT_STYLES_DIRNAME)/textreport.xsl $(NETX_UNIT_TEST_DIR)/tests-output.xml > $(TESTS_DIR)/summary_unit.txt mkdir -p stamps && \ touch $@ stamps/compile-jacoco-operator.stamp: jacoco-operator-source-files.txt @WITH_JACOCO_TRUE@ mkdir -p $(JACOCO_OPERATOR_DIR) && \ @WITH_JACOCO_TRUE@ $(SYSTEM_JDK_DIR)/bin/javac $(IT_JAVACFLAGS) \ @WITH_JACOCO_TRUE@ -d $(JACOCO_OPERATOR_DIR) \ @WITH_JACOCO_TRUE@ $(call composeclasspath, $(JACOCO_CLASSPATH)) \ @WITH_JACOCO_TRUE@ @jacoco-operator-source-files.txt ; @WITH_JACOCO_FALSE@ echo "Sorry, jacoco coverage report generator cant be compiled without jacoco installed. Try installing jacoco or specify with-jacoco value" ; @WITH_JACOCO_FALSE@ exit 5 touch $@ #warning, during this target tests.build/netx/unit/tests-output.xml is backup and rewriten (but not coresponding html file) #xml results run with jacoco agent however, can be wrong, co the new tests-output.xml is then renamed and orginal one restored stamps/run-unit-test-code-coverage-jacoco.stamp: stamps/netx-unit-tests-compile.stamp $(JUNIT_RUNNER_JAR) \ $(TESTS_DIR)/$(REPORT_STYLES_DIRNAME) $(UNIT_CLASS_NAMES) stamps/compile-jacoco-operator.stamp @WITH_JACOCO_TRUE@ filename=" " ; \ @WITH_JACOCO_TRUE@ cd $(NETX_UNIT_TEST_SRCDIR) ; \ @WITH_JACOCO_TRUE@ for file in `find . -type f \! -iname "*.java"`; do\ @WITH_JACOCO_TRUE@ filename=`echo $$file `; \ @WITH_JACOCO_TRUE@ cp --parents $$filename $(NETX_UNIT_TEST_DIR) ; \ @WITH_JACOCO_TRUE@ done ; \ @WITH_JACOCO_TRUE@ cd $(NETX_UNIT_TEST_DIR) ; \ @WITH_JACOCO_TRUE@ for file in $(COVERAGE_MODIFIED_FILES) ; do \ @WITH_JACOCO_TRUE@ mv $(NETX_UNIT_TEST_DIR)/$$file $(NETX_UNIT_TEST_DIR)/"$$file""$(EMMA_BACKUP_SUFFIX)" ; \ @WITH_JACOCO_TRUE@ done ;\ @WITH_JACOCO_TRUE@ class_names=`cat $(UNIT_CLASS_NAMES)` ; \ @WITH_JACOCO_TRUE@ CLASSPATH=$(call joinsegments, $(NETX_DIR)/lib/classes.jar $(abs_top_builddir)/liveconnect/lib/classes.jar $(JUNIT_RUNTIME) $(JUNIT_RUNNER_JAR) $(TEST_EXTENSIONS_DIR) $(JACOCO_CLASSPATH) . $(TEST_EXTENSIONS_SRCDIR) $(TAGSOUP_JAR)) ; \ @WITH_JACOCO_TRUE@ $(SYSTEM_JRE_DIR)/bin/java $(JACOCO_AGENT_SWITCH) -Xbootclasspath/a:$$CLASSPATH CommandLine $$class_names ; \ @WITH_JACOCO_TRUE@ for file in $(COVERAGE_MODIFIED_FILES) ; do \ @WITH_JACOCO_TRUE@ mv $(NETX_UNIT_TEST_DIR)/$$file $(NETX_UNIT_TEST_DIR)/"$$file""$(EMMA_SUFFIX)" ; \ @WITH_JACOCO_TRUE@ mv $(NETX_UNIT_TEST_DIR)/"$$file""$(EMMA_BACKUP_SUFFIX)" $(NETX_UNIT_TEST_DIR)/$$file ; \ @WITH_JACOCO_TRUE@ done ; \ @WITH_JACOCO_TRUE@ $(JACOCO_OPERATOR_EXEC) \ @WITH_JACOCO_TRUE@ report --die-soon --html-output coverage --xml-output coverage.xml --input-file jacoco.exec \ @WITH_JACOCO_TRUE@ --input-srcs $(NETX_SRCDIR) $(PLUGIN_SRCDIR)/java $(NETX_UNIT_TEST_SRCDIR) $(JUNIT_RUNNER_SRCDIR) $(TEST_EXTENSIONS_SRCDIR) \ @WITH_JACOCO_TRUE@ --input-builds $(NETX_DIR)/lib/classes.jar $(abs_top_builddir)/liveconnect/lib/classes.jar $(NETX_UNIT_TEST_DIR) $(JUNIT_RUNNER_JAR) $(TEST_EXTENSIONS_DIR) \ @WITH_JACOCO_TRUE@ --title "IcedTea-Web unit-tests codecoverage" ; @WITH_JACOCO_FALSE@ echo "Sorry, coverage report cant be run without jacoco installed. Try installing jacoco or specify with-jacoco value" ; @WITH_JACOCO_FALSE@ exit 5 touch $@ $(COVERABLE_PLUGIN_DIR): mkdir -p $(COVERABLE_PLUGIN_DIR); $(COVERABLE_PLUGIN_DIR)/%.o: $(PLUGIN_SRCDIR)/%.cc cd $(COVERABLE_PLUGIN_DIR) && \ $(CXX) $(CXXFLAGS) \ $(DEFS) $(VERSION_DEFS) \ -DJDK_UPDATE_VERSION="\"$(JDK_UPDATE_VERSION)\"" \ -DPLUGIN_NAME="\"IcedTea-Web Plugin with jacoco coverage agent\"" \ -DJAVAWS_BIN="\"$(bindir)/$(javaws)\"" \ -DJAVAWS_NAME="\"$(javaws)\"" \ -DPLUGIN_VERSION="\"$(PLUGIN_VERSION)\"" \ -DPACKAGE_URL="\"$(PACKAGE_URL)\"" \ -DMOZILLA_VERSION_COLLAPSED="$(MOZILLA_VERSION_COLLAPSED)" \ -DICEDTEA_WEB_JRE="\"$(SYSTEM_JRE_DIR)\"" \ -DPLUGIN_BOOTCLASSPATH=$(PLUGIN_COVERAGE_BOOTCLASSPATH) \ -DCOVERAGE_AGENT=$(JACOCO_AGENT_PLUGIN_SWITCH) \ $(GLIB_CFLAGS) \ $(MOZILLA_CFLAGS) \ -fvisibility=hidden \ -fPIC -o $@ -c $< $(COVERABLE_PLUGIN_DIR)/$(BUILT_PLUGIN_LIBRARY): $(addprefix $(COVERABLE_PLUGIN_DIR)/,$(PLUGIN_OBJECTS)) cd $(COVERABLE_PLUGIN_DIR) && \ $(CXX) $(CXXFLAGS) \ $(PLUGIN_OBJECTS) \ $(GLIB_LIBS) \ $(MOZILLA_LIBS) \ -shared -o $@ stamps/build-fake-plugin.stamp: $(COVERABLE_PLUGIN_DIR) $(addprefix $(PLUGIN_SRCDIR)/,$(PLUGIN_SRC)) $(addprefix $(COVERABLE_PLUGIN_DIR)/,$(PLUGIN_OBJECTS)) stamps/liveconnect-dist.stamp $(COVERABLE_PLUGIN_DIR)/$(BUILT_PLUGIN_LIBRARY) touch $@ #warning, during this target tests.build/netx/jnlp_testsengine/tests-output.xml is backup and rewriten (but not coresponding html file) #xml results run with jacoco agent, however, can be wrong, co the new tests-output.xml is then renamed and orginal one restored stamps/run-reproducers-test-code-coverage-jacoco.stamp: stamps/run-netx-dist-tests.stamp $(REPRODUCERS_CLASS_NAMES) \ stamps/compile-jacoco-operator.stamp stamps/build-fake-plugin.stamp @WITH_JACOCO_TRUE@ cd $(TESTS_DIR) ; \ @WITH_JACOCO_TRUE@ for file in $(COVERAGE_MODIFIED_FILES) ; do \ @WITH_JACOCO_TRUE@ mv $(TEST_EXTENSIONS_DIR)/$$file $(TEST_EXTENSIONS_DIR)/"$$file""$(EMMA_BACKUP_SUFFIX)" ; \ @WITH_JACOCO_TRUE@ done ;\ @WITH_JACOCO_TRUE@ echo "backuping javaws in $(DESTDIR)$(bindir)" ; \ @WITH_JACOCO_TRUE@ javaws_backup=$(DESTDIR)$(bindir)/javaws_backup ; \ @WITH_JACOCO_TRUE@ mv $(DESTDIR)$(bindir)/javaws $$javaws_backup ; \ @WITH_JACOCO_TRUE@ echo "patching $(javaws)" ; \ @WITH_JACOCO_TRUE@ nw_bootclasspath="-Xbootclasspath/a:$(UNIFIED_JACOCO_CLASSPATH)" ; \ @WITH_JACOCO_TRUE@ cat $$javaws_backup | sed "s|COMMAND.k.=\"..JAVA.\"|COMMAND[k]=\"\\$$\\{JAVA\\}\" ; k=1 ; COMMAND[k]=$(JACOCO_AGENT_JAVAWS_SWITCH)|" | sed "s,$(LAUNCHER_BOOTCLASSPATH),$$nw_bootclasspath," > $(DESTDIR)$(bindir)/$(javaws) ; \ @WITH_JACOCO_TRUE@ chmod 777 $(DESTDIR)$(bindir)/$(javaws) ; \ @WITH_JACOCO_TRUE@ echo "backuping plugin in $(DESTDIR)/$(libdir)$(BUILT_PLUGIN_LIBRARY)" ; \ @WITH_JACOCO_TRUE@ plugin_backup=$(DESTDIR)$(libdir)/$(BUILT_PLUGIN_LIBRARY)_backup ; \ @WITH_JACOCO_TRUE@ mv $(DESTDIR)$(libdir)/$(BUILT_PLUGIN_LIBRARY) $$plugin_backup ; \ @WITH_JACOCO_TRUE@ echo "fakeing plugin" ; \ @WITH_JACOCO_TRUE@ cp $(COVERABLE_PLUGIN_DIR)/$(BUILT_PLUGIN_LIBRARY) $(DESTDIR)$(libdir)/$(BUILT_PLUGIN_LIBRARY) ; \ @WITH_JACOCO_TRUE@ testcases_srcs=( ) ; \ @WITH_JACOCO_TRUE@ k=0 ; \ @WITH_JACOCO_TRUE@ types=($(ALL_REPRODUCERS)); \ @WITH_JACOCO_TRUE@ for which in "$${types[@]}" ; do \ @WITH_JACOCO_TRUE@ . $(abs_top_srcdir)/NEW_LINE_IFS ; \ @WITH_JACOCO_TRUE@ simpleReproducers=(`cat $(abs_top_builddir)/junit-jnlp-dist-$$which.txt `); \ @WITH_JACOCO_TRUE@ IFS="$$IFS_BACKUP" ; \ @WITH_JACOCO_TRUE@ for dir in "$${simpleReproducers[@]}" ; do \ @WITH_JACOCO_TRUE@ testcases_srcs[k]="$(REPRODUCERS_TESTS_SRCDIR)/$$which/$$dir/testcases/" ; \ @WITH_JACOCO_TRUE@ k=$$((k+1)) ; \ @WITH_JACOCO_TRUE@ done ; \ @WITH_JACOCO_TRUE@ done ; \ @WITH_JACOCO_TRUE@ cd $(TEST_EXTENSIONS_DIR) ; \ @WITH_JACOCO_TRUE@ class_names=`cat $(REPRODUCERS_CLASS_NAMES)` ; \ @WITH_JACOCO_TRUE@ CLASSPATH=$(call joinsegments, $(NETX_DIR)/lib/classes.jar $(JUNIT_RUNTIME) $(JUNIT_RUNNER_JAR) . $(TEST_EXTENSIONS_DIR) $(JACOCO_CLASSPATH) $(TEST_EXTENSIONS_TESTS_DIR) $(TEST_EXTENSIONS_SRCDIR)) ; \ @WITH_JACOCO_TRUE@ $(SYSTEM_JRE_DIR)/bin/java $(JACOCO_AGENT_SWITCH) $(REPRODUCERS_DPARAMETERS) \ @WITH_JACOCO_TRUE@ -Xbootclasspath/a:$$CLASSPATH CommandLine $$class_names ; \ @WITH_JACOCO_TRUE@ if [ -f $(JACOCO_JAVAWS_RESULTS) ] ; then \ @WITH_JACOCO_TRUE@ jacoco_javaws_results=$(JACOCO_JAVAWS_RESULTS) ; \ @WITH_JACOCO_TRUE@ $(JACOCO_OPERATOR_EXEC) \ @WITH_JACOCO_TRUE@ report --die-soon --html-output coverage-javaws --xml-output coverage-javaws.xml --input-file $(JACOCO_JAVAWS_RESULTS) \ @WITH_JACOCO_TRUE@ --input-srcs $(NETX_SRCDIR) \ @WITH_JACOCO_TRUE@ --input-builds $(NETX_DIR)/lib/classes.jar \ @WITH_JACOCO_TRUE@ --title "IcedTea-Web javaws reproducers codecoverage" ; \ @WITH_JACOCO_TRUE@ fi; \ @WITH_JACOCO_TRUE@ if [ -f $(JACOCO_PLUGIN_RESULTS) ] ; then \ @WITH_JACOCO_TRUE@ jacoco_plugin_results=$(JACOCO_PLUGIN_RESULTS) ; \ @WITH_JACOCO_TRUE@ $(JACOCO_OPERATOR_EXEC) \ @WITH_JACOCO_TRUE@ report --die-soon --html-output coverage-plugin --xml-output coverage-plugin.xml --input-file $(JACOCO_PLUGIN_RESULTS) \ @WITH_JACOCO_TRUE@ --input-srcs $(NETX_SRCDIR) $(PLUGIN_SRCDIR)/java \ @WITH_JACOCO_TRUE@ --input-builds $(NETX_DIR)/lib/classes.jar $(abs_top_builddir)/liveconnect/lib/classes.jar \ @WITH_JACOCO_TRUE@ --title "IcedTea-Web plugin reproducers codecoverage" ; \ @WITH_JACOCO_TRUE@ fi; \ @WITH_JACOCO_TRUE@ $(JACOCO_OPERATOR_EXEC) \ @WITH_JACOCO_TRUE@ merge --die-soon --input-files jacoco.exec $$jacoco_javaws_results $$jacoco_plugin_results --output-file jacoco-merged-reproducers.exec ; \ @WITH_JACOCO_TRUE@ $(JACOCO_OPERATOR_EXEC) \ @WITH_JACOCO_TRUE@ report --html-output coverage --xml-output coverage.xml --input-file jacoco-merged-reproducers.exec \ @WITH_JACOCO_TRUE@ --input-srcs $(NETX_SRCDIR) $(PLUGIN_SRCDIR)/java $(JUNIT_RUNNER_SRCDIR) $(TEST_EXTENSIONS_SRCDIR) $(TEST_EXTENSIONS_TESTS_SRCDIR) "$${testcases_srcs[@]}" \ @WITH_JACOCO_TRUE@ --input-builds $(NETX_DIR)/lib/classes.jar $(abs_top_builddir)/liveconnect/lib/classes.jar $(JUNIT_RUNNER_JAR) $(TEST_EXTENSIONS_DIR) $(TEST_EXTENSIONS_TESTS_DIR) \ @WITH_JACOCO_TRUE@ --title "IcedTea-Web reproducers-tests codecoverage" ; \ @WITH_JACOCO_TRUE@ echo "restoring javaws in $(DESTDIR)$(bindir)" ; \ @WITH_JACOCO_TRUE@ rm -f $(DESTDIR)$(bindir)/$(javaws); \ @WITH_JACOCO_TRUE@ mv $$javaws_backup $(DESTDIR)$(bindir)/$(javaws); \ @WITH_JACOCO_TRUE@ echo "restoring plugin in $(DESTDIR)/$(libdir)$(BUILT_PLUGIN_LIBRARY)" ; \ @WITH_JACOCO_TRUE@ mv $$plugin_backup $(DESTDIR)$(libdir)/$(BUILT_PLUGIN_LIBRARY) ; \ @WITH_JACOCO_TRUE@ for file in $(COVERAGE_MODIFIED_FILES) ; do \ @WITH_JACOCO_TRUE@ mv $(TEST_EXTENSIONS_DIR)/$$file $(TEST_EXTENSIONS_DIR)/"$$file""$(EMMA_SUFFIX)" ; \ @WITH_JACOCO_TRUE@ mv $(TEST_EXTENSIONS_DIR)/"$$file""$(EMMA_BACKUP_SUFFIX)" $(TEST_EXTENSIONS_DIR)/$$file ; \ @WITH_JACOCO_TRUE@ done ; @WITH_JACOCO_FALSE@ echo "Sorry, coverage report cant be run without jacoco installed. Try installing jacoco or specify with-jacoco value" ; @WITH_JACOCO_FALSE@ exit 5 touch $@ run-test-code-coverage-jacoco: stamps/run-unit-test-code-coverage-jacoco.stamp stamps/run-reproducers-test-code-coverage-jacoco.stamp @WITH_JACOCO_TRUE@ cd $(TESTS_DIR) ; \ @WITH_JACOCO_TRUE@ k=0 ; \ @WITH_JACOCO_TRUE@ types=($(ALL_REPRODUCERS)); \ @WITH_JACOCO_TRUE@ for which in "$${types[@]}" ; do \ @WITH_JACOCO_TRUE@ . $(abs_top_srcdir)/NEW_LINE_IFS ; \ @WITH_JACOCO_TRUE@ simpleReproducers=(`cat $(abs_top_builddir)/junit-jnlp-dist-$$which.txt `); \ @WITH_JACOCO_TRUE@ IFS="$$IFS_BACKUP" ; \ @WITH_JACOCO_TRUE@ for dir in "$${simpleReproducers[@]}" ; do \ @WITH_JACOCO_TRUE@ testcases_srcs[k]="$(REPRODUCERS_TESTS_SRCDIR)/$$which/$$dir/testcases/" ; \ @WITH_JACOCO_TRUE@ k=$$((k+1)) ; \ @WITH_JACOCO_TRUE@ done ; \ @WITH_JACOCO_TRUE@ done ; \ @WITH_JACOCO_TRUE@ class_names=`cat $(REPRODUCERS_CLASS_NAMES)` ; \ @WITH_JACOCO_TRUE@ $(JACOCO_OPERATOR_EXEC) \ @WITH_JACOCO_TRUE@ merge --die-soon --input-files $(TEST_EXTENSIONS_DIR)/jacoco-merged-reproducers.exec $(NETX_UNIT_TEST_DIR)/jacoco.exec --output-file jacoco-merged.exec; \ @WITH_JACOCO_TRUE@ $(JACOCO_OPERATOR_EXEC) \ @WITH_JACOCO_TRUE@ report --html-output coverage --xml-output coverage.xml --input-file jacoco-merged.exec \ @WITH_JACOCO_TRUE@ --input-srcs $(NETX_SRCDIR) $(PLUGIN_SRCDIR)/java $(JUNIT_RUNNER_SRCDIR) $(TEST_EXTENSIONS_SRCDIR) $(TEST_EXTENSIONS_TESTS_SRCDIR) "$${testcases_srcs[@]}" \ @WITH_JACOCO_TRUE@ --input-builds $(NETX_DIR)/lib/classes.jar $(abs_top_builddir)/liveconnect/lib/classes.jar $(JUNIT_RUNNER_JAR) $(TEST_EXTENSIONS_DIR) $(TEST_EXTENSIONS_TESTS_DIR) \ @WITH_JACOCO_TRUE@ --input-srcs $(NETX_UNIT_TEST_SRCDIR) \ @WITH_JACOCO_TRUE@ --input-builds $(NETX_UNIT_TEST_DIR) \ @WITH_JACOCO_TRUE@ --title "IcedTea-Web complete codecoverage" ; @WITH_JACOCO_FALSE@ echo "Sorry, coverage report cant be run without jacoco installed. Try installing jacoco or specify with-jacoco value" ; @WITH_JACOCO_FALSE@ exit 5 run-test-server-on-44321: stamps/netx.stamp stamps/junit-jnlp-dist-dirs stamps/netx-dist-tests-import-cert-to-public \ stamps/test-extensions-compile.stamp stamps/compile-reproducers-testcases.stamp $(JUNIT_RUNNER_JAR) stamps/copy-reproducers-resources.stamp cd $(TEST_EXTENSIONS_DIR) ; \ CLASSPATH=$(call joinsegments, $(NETX_DIR)/lib/classes.jar $(JUNIT_RUNTIME) $(JUNIT_RUNNER_JAR) . $(TEST_EXTENSIONS_TESTS_DIR)) ; \ $(SYSTEM_JRE_DIR)/bin/java $(REPRODUCERS_DPARAMETERS) \ -Xbootclasspath/a:$$CLASSPATH net.sourceforge.jnlp.ServerAccess run-test-server-on-random-port: stamps/netx.stamp stamps/junit-jnlp-dist-dirs stamps/netx-dist-tests-import-cert-to-public \ stamps/test-extensions-compile.stamp stamps/compile-reproducers-testcases.stamp $(JUNIT_RUNNER_JAR) stamps/copy-reproducers-resources.stamp cd $(TEST_EXTENSIONS_DIR) ; \ CLASSPATH=$(call joinsegments, $(NETX_DIR)/lib/classes.jar $(JUNIT_RUNTIME) $(JUNIT_RUNNER_JAR) . $(TEST_EXTENSIONS_TESTS_DIR)) ; \ $(SYSTEM_JRE_DIR)/bin/java $(REPRODUCERS_DPARAMETERS) \ -Xbootclasspath/a:$$CLASSPATH net.sourceforge.jnlp.ServerAccess randomport clean-netx-tests: clean-netx-unit-tests clean-junit-runner clean-netx-dist-tests clean-test-code-coverage-jacoco if [ -e $(TESTS_DIR)/netx ]; then \ rmdir $(TESTS_DIR)/netx ; \ fi clean-junit-runner: rm -f junit-runner-source-files.txt rm -rf $(JUNIT_RUNNER_DIR) rm -f $(JUNIT_RUNNER_JAR) clean-netx-unit-tests: clean_tests_reports rm -f netx-unit-tests-source-files.txt rm -rf $(NETX_UNIT_TEST_DIR) rm -f $(UNIT_CLASS_NAMES) rm -f stamps/check-pac-functions.stamp rm -f stamps/run-netx-unit-tests.stamp rm -f stamps/netx-unit-tests-compile.stamp clean_tests_reports: rm -rf $(TESTS_DIR)/$(REPORT_STYLES_DIRNAME)/ rm -f $(TESTS_DIR)/*.html rm -f $(TESTS_DIR)/summary_unit.txt rm -f $(TESTS_DIR)/summary_reproducers.txt clean-netx-dist-tests: clean_tests_reports netx-dist-tests-remove-cert-from-public clean-custom-reproducers rm -f test-extensions-source-files.txt rm -f test-extensions-tests-source-files.txt rm -f $(TEST_EXTENSIONS_COMPATIBILITY_SYMLINK) rm -rf $(TEST_EXTENSIONS_TESTS_DIR) rm -rf $(REPRODUCERS_BUILD_DIR) rm -rf $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR) rm -rf $(TEST_EXTENSIONS_DIR) rm -f stamps/junit-jnlp-dist-dirs rm -f stamps/test-extensions-compile.stamp rm -f stamps/test-extensions-tests-compile.stamp rm -f stamps/netx-dist-tests-prepare-reproducers.stamp rm -f stamps/compile-reproducers-testcases.stamp rm -f stamps/copy-reproducers-resources.stamp rm -f stamps/netx-dist-tests-sign-some-reproducers.stamp rm -f stamps/change-dots-to-paths.stamp rm -f junit-jnlp-dist-simple.txt rm -f junit-jnlp-dist-custom.txt rm -f netx-dist-tests-tests-source-files.txt types=($(SIGNED_REPRODUCERS)) ; \ for which in "$${types[@]}" ; do \ rm -f junit-jnlp-dist-$$which.txt ; \ rm -f $(EXPORTED_TEST_CERT_PREFIX)_$$which.$(EXPORTED_TEST_CERT_SUFFIX) ; \ done ; rm -f stamps/exported-test-certs.stamp rm -f stamps/junit-jnlp-dist-signed.stamp rm -f $(REPRODUCERS_CLASS_NAMES) rm -f $(abs_top_builddir)/$(PRIVATE_KEYSTORE_NAME) rm -f stamps/run-netx-dist-tests.stamp clean-unit-test-code-coverage-jacoco: if [ -e stamps/run-unit-test-code-coverage-jacoco.stamp ]; then \ rm -rf $(NETX_UNIT_TEST_DIR)/coverage ; \ rm -f $(NETX_UNIT_TEST_DIR)/coverage.xml ; \ rm -f $(NETX_UNIT_TEST_DIR)/jacoco.exec ; \ rm -f $(NETX_UNIT_TEST_DIR)/tests-output_withEmma.xml ; \ rm -f stamps/run-unit-test-code-coverage-jacoco.stamp ; \ fi clean-reproducers-test-code-coverage-jacoco: if [ -e stamps/run-reproducers-test-code-coverage-jacoco.stamp ]; then \ rm -rf $(TEST_EXTENSIONS_DIR)/coverage-javaws ; \ rm -f $(TEST_EXTENSIONS_DIR)/coverage-javaws.xml ; \ rm -f $(TEST_EXTENSIONS_DIR)/jacoco_javaws.exec ; \ rm -rf $(TEST_EXTENSIONS_DIR)/coverage-plugin ; \ rm -f $(TEST_EXTENSIONS_DIR)/coverage-plugin.xml ; \ rm -f $(TEST_EXTENSIONS_DIR)/jacoco_plugin.exec ; \ rm -rf $(TEST_EXTENSIONS_DIR)/coverage ; \ rm -f $(TEST_EXTENSIONS_DIR)/coverage.xml ; \ rm -f $(TEST_EXTENSIONS_DIR)/jacoco-merged-reproducers.exec ; \ rm -f $(TEST_EXTENSIONS_DIR)/tests-output_withEmma.xml ; \ rm -f stamps/run-reproducers-test-code-coverage-jacoco.stamp ; \ fi clean-test-code-coverage-jacoco: clean-unit-test-code-coverage-jacoco clean-reproducers-test-code-coverage-jacoco clean-test-code-coverage-tools-jacoco if [ -e $(TESTS_DIR)/coverage.xml ]; then \ rm -rf $(TESTS_DIR)/coverage ; \ rm -f $(TESTS_DIR)/jacoco-merged.exec; \ fi clean-test-code-coverage-tools-jacoco: rm -rf $(JACOCO_OPERATOR_DIR) rm -rf $(COVERABLE_PLUGIN_DIR) rm -f stamps/compile-jacoco-operator.stamp; rm -f jacoco-operator-source-files.txt rm -f stamps/build-fake-plugin.stamp # plugin tests @ENABLE_PLUGIN_TRUE@stamps/plugin-tests.stamp: $(PLUGIN_TEST_SRCS) stamps/plugin.stamp @ENABLE_PLUGIN_TRUE@ mkdir -p plugin/tests/LiveConnect @ENABLE_PLUGIN_TRUE@ $(SYSTEM_JDK_DIR)/bin/javac $(IT_JAVACFLAGS) \ @ENABLE_PLUGIN_TRUE@ -d plugin/tests/LiveConnect \ @ENABLE_PLUGIN_TRUE@ -classpath liveconnect/lib/classes.jar \ @ENABLE_PLUGIN_TRUE@ $(PLUGIN_TEST_SRCS) ; @ENABLE_PLUGIN_TRUE@ $(SYSTEM_JDK_DIR)/bin/jar cf plugin/tests/LiveConnect/PluginTest.jar \ @ENABLE_PLUGIN_TRUE@ plugin/tests/LiveConnect/*.class ; @ENABLE_PLUGIN_TRUE@ cp -pPR $(SRC_DIR_LINK) $(abs_top_srcdir)/plugin/tests/LiveConnect/*.{js,html} \ @ENABLE_PLUGIN_TRUE@ plugin/tests/LiveConnect ; @ENABLE_PLUGIN_TRUE@ echo "Done. Now launch \"firefox file://`pwd`/index.html\"" ; @ENABLE_PLUGIN_TRUE@ mkdir -p stamps @ENABLE_PLUGIN_TRUE@ touch stamps/plugin-tests.stamp # Target Aliases # =============== add-netx: stamps/add-netx.stamp add-netx-debug: stamps/add-netx-debug.stamp netx: stamps/netx.stamp netx-dist: stamps/netx-dist.stamp plugin: stamps/plugin.stamp plugin-tests: stamps/plugin-tests.stamp check-pac-functions: stamps/check-pac-functions.stamp run-netx-unit-tests: stamps/run-netx-unit-tests.stamp links: stamps/global-links.stamp user-links: stamps/user-links.stamp run-netx-dist-tests: stamps/run-netx-dist-tests.stamp run-unit-test-code-coverage-jacoco: stamps/run-unit-test-code-coverage-jacoco.stamp run-reproducers-test-code-coverage-jacoco: stamps/run-reproducers-test-code-coverage-jacoco.stamp # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: icedtea-web-1.6.2/PaxHeaders.17941/aclocal.m40000644000000000000000000000013112654402525015277 xustar0030 mtime=1454507349.461282639 30 atime=1454507350.382270356 29 ctime=1454507658.72115813 icedtea-web-1.6.2/aclocal.m40000644000175000002070000014465112654402525016036 0ustar00jvanekmock00000000000000# generated automatically by aclocal 1.15 -*- Autoconf -*- # Copyright (C) 1996-2014 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # serial 1 (pkg-config-0.24) # # Copyright © 2004 Scott James Remnant . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be 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 this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # PKG_PROG_PKG_CONFIG([MIN-VERSION]) # ---------------------------------- AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])# PKG_PROG_PKG_CONFIG # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # # Check to see whether a particular set of modules exists. Similar # to PKG_CHECK_MODULES(), but does not set variables or print errors. # # Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) # only at the first occurence in configure.ac, so if the first place # it's called might be skipped (such as if it is within an "if", you # have to call PKG_CHECK_EXISTS manually # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) # --------------------------------------------- m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes ], [pkg_failed=yes]) else pkg_failed=untried fi[]dnl ])# _PKG_CONFIG # _PKG_SHORT_ERRORS_SUPPORTED # ----------------------------- AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])# _PKG_SHORT_ERRORS_SUPPORTED # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], # [ACTION-IF-NOT-FOUND]) # # # Note that if there is a possibility the first call to # PKG_CHECK_MODULES might not happen, you should be sure to include an # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac # # # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])[]dnl ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) $3 fi[]dnl ])# PKG_CHECK_MODULES # PKG_INSTALLDIR(DIRECTORY) # ------------------------- # Substitutes the variable pkgconfigdir as the location where a module # should install pkg-config .pc files. By default the directory is # $libdir/pkgconfig, but the default can be changed by passing # DIRECTORY. The user can override through the --with-pkgconfigdir # parameter. AC_DEFUN([PKG_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([pkgconfigdir], [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, [with_pkgconfigdir=]pkg_default) AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ]) dnl PKG_INSTALLDIR # PKG_NOARCH_INSTALLDIR(DIRECTORY) # ------------------------- # Substitutes the variable noarch_pkgconfigdir as the location where a # module should install arch-independent pkg-config .pc files. By # default the directory is $datadir/pkgconfig, but the default can be # changed by passing DIRECTORY. The user can override through the # --with-noarch-pkgconfigdir parameter. AC_DEFUN([PKG_NOARCH_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([noarch-pkgconfigdir], [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, [with_noarch_pkgconfigdir=]pkg_default) AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ]) dnl PKG_NOARCH_INSTALLDIR # PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, # [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # ------------------------------------------- # Retrieves the value of the pkg-config variable for the given module. AC_DEFUN([PKG_CHECK_VAR], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl _PKG_CONFIG([$1], [variable="][$3]["], [$2]) AS_VAR_COPY([$1], [pkg_cv_][$1]) AS_VAR_IF([$1], [""], [$5], [$4])dnl ])# PKG_CHECK_VAR # Copyright (C) 2002-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.15' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.15], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.15])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to # '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each '.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi dnl The trailing newline in this macro's definition is deliberate, for dnl backward compatibility and to allow trailing 'dnl'-style comments dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering # Copyright (C) 1996-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAINTAINER_MODE([DEFAULT-MODE]) # ---------------------------------- # Control maintainer-specific portions of Makefiles. # Default is to disable them, unless 'enable' is passed literally. # For symmetry, 'disable' may be passed as well. Anyway, the user # can override the default with the --enable/--disable switch. AC_DEFUN([AM_MAINTAINER_MODE], [m4_case(m4_default([$1], [disable]), [enable], [m4_define([am_maintainer_other], [disable])], [disable], [m4_define([am_maintainer_other], [enable])], [m4_define([am_maintainer_other], [enable]) m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode's default is 'disable' unless 'enable' is passed AC_ARG_ENABLE([maintainer-mode], [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode], am_maintainer_other[ make rules and dependencies not useful (and sometimes confusing) to the casual installer])], [USE_MAINTAINER_MODE=$enableval], [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST([MAINT])dnl ] ) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_CC_C_O # --------------- # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([acinclude.m4]) icedtea-web-1.6.2/PaxHeaders.17941/configure.ac0000644000000000000000000000013212654402377015733 xustar0030 mtime=1454507263.234432621 30 atime=1454507350.328271076 30 ctime=1454507658.720158144 icedtea-web-1.6.2/configure.ac0000644000175000002070000001264712654402377016470 0ustar00jvanekmock00000000000000AC_INIT([icedtea-web],[1.6.2],[distro-pkg-dev@openjdk.java.net], [icedtea-web], [http://icedtea.classpath.org/wiki/IcedTea-Web]) AM_INIT_AUTOMAKE([1.9 tar-pax foreign]) AC_CONFIG_FILES([Makefile netx.manifest]) AM_MAINTAINER_MODE([enable]) # Older automake doesn't generate these correctly abs_top_builddir=`pwd -P` AC_SUBST(abs_top_builddir) abs_top_srcdir=`dirname $0` cd $abs_top_srcdir abs_top_srcdir=`pwd` cd $abs_top_builddir AC_SUBST(abs_top_srcdir) AC_CANONICAL_HOST AC_PROG_CC AC_PROG_CXX IT_SET_ARCH_SETTINGS IT_CP_SUPPORTS_REFLINK IT_CAN_HARDLINK_TO_SOURCE_TREE AC_MSG_CHECKING([whether to build documentation]) AC_ARG_ENABLE([docs], [AS_HELP_STRING([--disable-docs], [Disable generation of documentation])], [ENABLE_DOCS="${enableval}"], [ENABLE_DOCS='yes']) AM_CONDITIONAL([ENABLE_DOCS], [test x$ENABLE_DOCS = xyes]) AC_MSG_RESULT(${ENABLE_DOCS}) AC_MSG_CHECKING([whether to filter by whitelisting on directory name when processing, compiling and running reproducers]) AC_ARG_ENABLE([whitelist-processing], [AS_HELP_STRING([--enable-whitelist-processing], [Enable whitelist filter on directory name when processing, compiling and running reproducers. Otherwise filter on testcase name when running reproducers])], [ENABLE_WHITELIST="${enableval}"], [ENABLE_WHITELIST='no']) AM_CONDITIONAL([ENABLE_WHITELIST], [test x$ENABLE_WHITELIST = xyes]) AC_MSG_RESULT(${ENABLE_WHITELIST}) AC_PATH_PROG([BIN_BASH], [bash],, [/bin]) if test x"$BIN_BASH" = x ; then AC_MSG_ERROR([/bin/bash is used in runtime and for about generation. Dying sooner rather then later]) fi IT_CHECK_WITH_GCJ FIND_TOOL([ZIP], [zip]) FIND_JAVAC FIND_JAR FIND_ECJ_JAR IT_CHECK_JAVA_VERSION IT_FIND_JAVADOC IT_FIND_KEYTOOL IT_FIND_JARSIGNER IT_FIND_PACK200 IT_SET_VERSION IT_CHECK_XULRUNNER_VERSION AC_CHECK_LIB(z, main,, [AC_MSG_ERROR("zlib not found - try installing zlib-devel")]) dnl Check for libX11 headers and libraries. PKG_CHECK_MODULES(X11, x11,[X11_FOUND=yes],[X11_FOUND=no]) if test "x${X11_FOUND}" = xno then AC_MSG_ERROR([Could not find x11 - \ Try installing libX11-devel.]) fi AC_SUBST(X11_CFLAGS) AC_SUBST(X11_LIBS) dnl PR46074 (gcc) - Missing java.net cookie code required by IcedTea plugin dnl IT563 - NetX uses sun.security code dnl IT605 - NetX depends on sun.misc HexDumpEncoder or sun.security.util.HexDumpEncoder dnl IT570 - NetX depends on sun.applet.AppletViewPanel dnl IT571 - NetX depends on com.sun.net.ssl.internal.ssl.X509ExtendedTrustManager.java dnl IT573 - Plugin depends on sun.awt,X11.XEmbeddedFrame.java dnl IT575 - Plugin depends on com.sun/jndi.toolkit.url.UrlUtil dnl IT576 - Plugin depends on sun.applet.AppletImageRef dnl IT578 - Remove need for patching AppletPanel for Plugin/Webstart IT_CHECK_FOR_CLASS(JAVA_UTIL_JAR_PACK200, [java.util.jar.Pack200]) IT_CHECK_FOR_CLASS(JAVA_NET_COOKIEMANAGER, [java.net.CookieManager]) IT_CHECK_FOR_CLASS(JAVA_NET_HTTPCOOKIE, [java.net.HttpCookie]) IT_CHECK_FOR_CLASS(JAVA_NET_COOKIEHANDLER, [java.net.CookieHandler]) IT_CHECK_FOR_CLASS(SUN_SECURITY_PROVIDER_X509FACTORY, [sun.security.provider.X509Factory]) IT_CHECK_FOR_CLASS(SUN_SECURITY_UTIL_SECURITYCONSTANTS, [sun.security.util.SecurityConstants]) IT_CHECK_FOR_CLASS(SUN_SECURITY_UTIL_HOSTNAMECHECKER, [sun.security.util.HostnameChecker]) IT_CHECK_FOR_CLASS(SUN_SECURITY_X509_X500NAME, [sun.security.x509.X500Name]) IT_CHECK_FOR_HEXDUMPENCODER IT_CHECK_FOR_CLASS(SUN_SECURITY_VALIDATOR_VALIDATOREXCEPTION, [sun.security.validator.ValidatorException]) IT_CHECK_FOR_CLASS(COM_SUN_NET_SSL_INTERNAL_SSL_X509EXTENDEDTRUSTMANAGER, [com.sun.net.ssl.internal.ssl.X509ExtendedTrustManager]) IT_CHECK_FOR_CLASS(SUN_NET_WWW_PROTOCOL_JAR_URLJARFILE, [sun.net.www.protocol.jar.URLJarFile]) IT_CHECK_FOR_CLASS(SUN_NET_WWW_PROTOCOL_JAR_URLJARFILECALLBACK, [sun.net.www.protocol.jar.URLJarFileCallBack]) IT_CHECK_FOR_CLASS(SUN_AWT_X11_XEMBEDDEDFRAME, [sun.awt.X11.XEmbeddedFrame]) IT_CHECK_FOR_CLASS(COM_SUN_JNDI_TOOLKIT_URL_URLUTIL, [com.sun.jndi.toolkit.url.UrlUtil]) IT_CHECK_FOR_CLASS(SUN_APPLET_APPLETIMAGEREF, [sun.applet.AppletImageRef]) IT_CHECK_FOR_SUN_APPLET_ACCESSIBILITY IT_CHECK_GLIB_VERSION IT_CHECK_XULRUNNER_MIMEDESCRIPTION_CONSTCHAR IT_CHECK_XULRUNNER_REQUIRES_C11 # # Find optional depedencies # AC_CHECK_PROGS([XSLTPROC],[xsltproc],[], []) # browser to be linked/tested # Example: IT_FIND_BROWSER([browser-name],[variable-to-store-path],[default-run-command-if-different-from-the-browser-name]) IT_FIND_BROWSER([firefox],[FIREFOX]) IT_FIND_BROWSER([chrome],[CHROME],[google-chrome]) IT_FIND_BROWSER([chromium],[CHROMIUM],[chromium-browser]) IT_FIND_BROWSER([opera],[OPERA]) IT_FIND_BROWSER([midori],[MIDORI]) IT_FIND_BROWSER([epiphany],[EPIPHANY]) IT_SET_GLOBAL_BROWSERTESTS_BEHAVIOUR AM_CONDITIONAL([WITH_XSLTPROC], [test x"$XSLTPROC" != x ]) IT_FIND_OPTIONAL_JAR([rhino], RHINO, [/usr/share/java/js.jar /usr/share/rhino-1.6/lib/js.jar]) IT_FIND_OPTIONAL_JAR([junit], JUNIT, [/usr/share/java/junit4.jar /usr/share/junit-4/lib/junit.jar]) IT_FIND_OPTIONAL_JAR([hamcrest], HAMCREST, [/usr/share/java/hamcrest/all.jar /usr/share/java/hamcrest-core.jar]) IT_FIND_OPTIONAL_JAR([jacoco], JACOCO, [/usr/share/java/jacoco/org.jacoco.core.jar]) IT_FIND_OPTIONAL_JAR([asm], ASM, [/usr/share/java/objectweb-asm4/asm-all.jar /usr/share/java/objectweb-asm4/asm-all-4.0.jar /usr/share/java/objectweb-asm/asm-all.jar]) IT_CHECK_FOR_TAGSOUP AC_CONFIG_FILES([jrunscript], [chmod u+x jrunscript]) AC_CONFIG_FILES([build.properties]) AC_OUTPUT icedtea-web-1.6.2/PaxHeaders.17941/acinclude.m40000644000000000000000000000013212654402377015636 xustar0030 mtime=1454507263.233432634 30 atime=1454507350.203272743 30 ctime=1454507658.719158157 icedtea-web-1.6.2/acinclude.m40000644000175000002070000007071412654402377016372 0ustar00jvanekmock00000000000000AC_DEFUN_ONCE([IT_CAN_HARDLINK_TO_SOURCE_TREE], [ AC_CACHE_CHECK([if we can hard link rather than copy from ${abs_top_srcdir}], it_cv_hardlink_src, [ if cp -l ${abs_top_srcdir}/README tmp.$$ >&AS_MESSAGE_LOG_FD 2>&1; then it_cv_hardlink_src=yes; else it_cv_hardlink_src=no; fi rm -f tmp.$$ ]) AM_CONDITIONAL([SRC_DIR_HARDLINKABLE], test x"${it_cv_hardlink_src}" = "xyes") ]) AC_DEFUN_ONCE([IT_CP_SUPPORTS_REFLINK], [ AC_CACHE_CHECK([if cp supports --reflink], it_cv_reflink, [ touch tmp.$$ if cp --reflink=auto tmp.$$ tmp2.$$ >&AS_MESSAGE_LOG_FD 2>&1; then it_cv_reflink=yes; else it_cv_reflink=no; fi rm -f tmp.$$ tmp2.$$ ]) AM_CONDITIONAL([CP_SUPPORTS_REFLINK], test x"${it_cv_reflink}" = "xyes") ]) AC_DEFUN_ONCE([IT_CHECK_FOR_JDK], [ AC_MSG_CHECKING([for a JDK home directory]) AC_ARG_WITH([jdk-home], [AS_HELP_STRING([--with-jdk-home], [jdk home directory \ (default is first predefined JDK found)])], [ if test "x${withval}" = xyes then SYSTEM_JDK_DIR= elif test "x${withval}" = xno then SYSTEM_JDK_DIR= else SYSTEM_JDK_DIR=${withval} fi ], [ SYSTEM_JDK_DIR= ]) if test -z "${SYSTEM_JDK_DIR}"; then for dir in /etc/alternatives/java_sdk \ /usr/lib/jvm/java-1.7.0-openjdk \ /usr/lib/jvm/icedtea7 \ /usr/lib/jvm/java-7-openjdk \ /usr/lib/jvm/java-1.8.0-openjdk \ /usr/lib/jvm/icedtea8 \ /usr/lib/jvm/java-8-openjdk \ /usr/lib/jvm/java-icedtea \ /usr/lib/jvm/java-openjdk \ /usr/lib/jvm/openjdk \ /usr/lib/jvm/cacao \ /usr/lib/jvm/jamvm ; do if test -d $dir; then SYSTEM_JDK_DIR=$dir break fi done fi if ! test -d "${SYSTEM_JDK_DIR}"; then AC_MSG_ERROR("A JDK home directory could not be found. ${SYSTEM_JDK_DIR}") else READ=`readlink -f ${SYSTEM_JDK_DIR}` AC_MSG_RESULT(${SYSTEM_JDK_DIR} (link to ${READ})) fi AC_SUBST(SYSTEM_JDK_DIR) ]) AC_DEFUN_ONCE([IT_CHECK_FOR_JRE], [ AC_REQUIRE([IT_CHECK_FOR_JDK]) AC_MSG_CHECKING([for a JRE home directory]) AC_ARG_WITH([jre-home], [AS_HELP_STRING([--with-jre-home], [jre home directory \ (default is the JRE under the JDK)])], [ SYSTEM_JRE_DIR=${withval} ], [ SYSTEM_JRE_DIR= ]) if test -z "${SYSTEM_JRE_DIR}" ; then SYSTEM_JRE_DIR_EIGHT_AND_LESS="${SYSTEM_JDK_DIR}/jre" SYSTEM_JRE_DIR_MODULAR="${SYSTEM_JDK_DIR}" # try jdk8 or older compliant if test -d "${SYSTEM_JRE_DIR_EIGHT_AND_LESS}" -a -e "${SYSTEM_JRE_DIR_EIGHT_AND_LESS}/bin/java" -a -e "${SYSTEM_JRE_DIR_EIGHT_AND_LESS}/lib/rt.jar" ; then SYSTEM_JRE_DIR="${SYSTEM_JRE_DIR_EIGHT_AND_LESS}" fi # still not found? if test -z "${SYSTEM_JRE_DIR}" ; then # try modular, jdk9 or higher compliant if test -d "${SYSTEM_JRE_DIR_MODULAR}" -a -f "${SYSTEM_JRE_DIR_MODULAR}/bin/java" -a -d "${SYSTEM_JRE_DIR_MODULAR}/lib/modules" ; then SYSTEM_JRE_DIR="${SYSTEM_JRE_DIR_MODULAR}" fi fi fi if ! test -d "${SYSTEM_JRE_DIR}"; then AC_MSG_ERROR("A JRE home directory could not be found. ${SYSTEM_JRE_DIR}") else READ=`readlink -f ${SYSTEM_JRE_DIR}` AC_MSG_RESULT(${SYSTEM_JRE_DIR} (link to ${READ})) fi AC_SUBST(SYSTEM_JRE_DIR) ]) AC_DEFUN_ONCE([FIND_JAVAC], [ AC_REQUIRE([IT_CHECK_FOR_JDK]) JAVAC=${SYSTEM_JDK_DIR}/bin/javac IT_FIND_JAVAC IT_FIND_ECJ IT_USING_ECJ AC_SUBST(JAVAC) ]) AC_DEFUN([IT_FIND_ECJ], [ AC_ARG_WITH([ecj], [AS_HELP_STRING(--with-ecj,bytecode compilation with ecj)], [ if test "x${withval}" != x && test "x${withval}" != xyes && test "x${withval}" != xno; then IT_CHECK_ECJ(${withval}) else if test "x${withval}" != xno; then IT_CHECK_ECJ fi fi ], [ IT_CHECK_ECJ ]) if test "x${JAVAC}" = "x"; then if test "x{ECJ}" != "x"; then JAVAC="${ECJ} -nowarn" fi fi ]) AC_DEFUN([IT_CHECK_ECJ], [ if test "x$1" != x; then if test -f "$1"; then AC_MSG_CHECKING(for ecj) ECJ="$1" AC_MSG_RESULT(${ECJ}) else AC_PATH_PROG(ECJ, "$1") fi else AC_PATH_PROG(ECJ, "ecj") if test -z "${ECJ}"; then AC_PATH_PROG(ECJ, "ecj-3.1") fi if test -z "${ECJ}"; then AC_PATH_PROG(ECJ, "ecj-3.2") fi if test -z "${ECJ}"; then AC_PATH_PROG(ECJ, "ecj-3.3") fi fi ]) AC_DEFUN([IT_FIND_JAVAC], [ AC_ARG_WITH([javac], [AS_HELP_STRING(--with-javac,bytecode compilation with javac)], [ if test "x${withval}" != x && test "x${withval}" != xyes && test "x${withval}" != xno; then IT_CHECK_JAVAC(${withval}) else if test "x${withval}" != xno; then IT_CHECK_JAVAC fi fi ], [ IT_CHECK_JAVAC ]) ]) AC_DEFUN([IT_CHECK_JAVAC], [ if test "x$1" != x; then if test -f "$1"; then AC_MSG_CHECKING(for javac) JAVAC="$1" AC_MSG_RESULT(${JAVAC}) else AC_PATH_PROG(JAVAC, "$1") fi else AC_PATH_PROG(JAVAC, "javac") fi ]) AC_DEFUN([FIND_JAR], [ AC_REQUIRE([IT_CHECK_FOR_JDK]) AC_MSG_CHECKING([for jar]) AC_ARG_WITH([jar], [AS_HELP_STRING(--with-jar,specify location of Java archive tool (jar))], [ JAR="${withval}" ], [ JAR=${SYSTEM_JDK_DIR}/bin/jar ]) if ! test -f "${JAR}"; then AC_PATH_PROG(JAR, "${JAR}") fi if test -z "${JAR}"; then AC_PATH_PROG(JAR, "gjar") fi if test -z "${JAR}"; then AC_PATH_PROG(JAR, "jar") fi if test -z "${JAR}"; then AC_MSG_ERROR("No Java archive tool was found.") fi AC_MSG_RESULT(${JAR}) AC_MSG_CHECKING([whether jar supports @ argument]) touch _config.txt cat >_config.list <&AS_MESSAGE_LOG_FD 2>&1; then JAR_KNOWS_ATFILE=1 AC_MSG_RESULT(yes) else JAR_KNOWS_ATFILE= AC_MSG_RESULT(no) fi AC_MSG_CHECKING([whether jar supports stdin file arguments]) if cat _config.list | $JAR cf@ _config.jar >&AS_MESSAGE_LOG_FD 2>&1; then JAR_ACCEPTS_STDIN_LIST=1 AC_MSG_RESULT(yes) else JAR_ACCEPTS_STDIN_LIST= AC_MSG_RESULT(no) fi rm -f _config.list _config.jar AC_MSG_CHECKING([whether jar supports -J options at the end]) if $JAR cf _config.jar _config.txt -J-Xmx896m >&AS_MESSAGE_LOG_FD 2>&1; then JAR_KNOWS_J_OPTIONS=1 AC_MSG_RESULT(yes) else JAR_KNOWS_J_OPTIONS= AC_MSG_RESULT(no) fi rm -f _config.txt _config.jar AC_SUBST(JAR) AC_SUBST(JAR_KNOWS_ATFILE) AC_SUBST(JAR_ACCEPTS_STDIN_LIST) AC_SUBST(JAR_KNOWS_J_OPTIONS) ]) AC_DEFUN([FIND_ECJ_JAR], [ AC_REQUIRE([FIND_JAVAC]) AC_MSG_CHECKING([for an ecj JAR file]) AC_ARG_WITH([ecj-jar], [AS_HELP_STRING(--with-ecj-jar,specify location of the ECJ jar)], [ if test -f "${withval}"; then ECJ_JAR="${withval}" fi ], [ ECJ_JAR= ]) if test -z "${ECJ_JAR}"; then for jar in /usr/share/java/eclipse-ecj.jar \ /usr/share/java/ecj.jar \ /usr/share/eclipse-ecj-3.{2,3,4,5}/lib/ecj.jar; do if test -e $jar; then ECJ_JAR=$jar break fi done if test -z "${ECJ_JAR}"; then ECJ_JAR=no fi fi AC_MSG_RESULT(${ECJ_JAR}) if test "x${JAVAC}" = x && test "x${ECJ_JAR}" = "xno" ; then AC_MSG_ERROR([cannot find a Java compiler or ecj JAR file, try --with-javac, --with-ecj or --with-ecj-jar]) fi AC_SUBST(ECJ_JAR) ]) # # IT_FIND_OPTIONAL_JAR # -------------------- # Find an optional jar required for building and running # # $1 : jar/feature name # $2 : used to set $2_JAR and WITH_$2 # $3 (optional) : used to specify additional file paths for searching # # Sets $2_JAR to the jar location (or blank if not found) # Defines WITH_$2 if jar is found # Sets $2_AVAILABLE to "true" if jar is found (or "false" if not) # AC_DEFUN([IT_FIND_OPTIONAL_JAR], [ AC_MSG_CHECKING([for $1 jar]) AC_ARG_WITH([$1], [AS_HELP_STRING(--with-$1,specify location of the $1 jar)], [ case "${withval}" in yes) $2_JAR=yes ;; no) $2_JAR=no ;; *) if test -f "${withval}"; then $2_JAR="${withval}" elif test -z "${withval}"; then $2_JAR=yes else AC_MSG_RESULT([not found]) AC_MSG_ERROR("The $1 jar ${withval} was not found.") fi ;; esac ], [ $2_JAR=yes ]) it_extra_paths_$1="$3" if test "x${$2_JAR}" = "xyes"; then for path in ${it_extra_paths_$1}; do if test -f ${path}; then $2_JAR=${path} break fi done fi if test x"${$2_JAR}" = "xyes"; then if test -f "/usr/share/java/$1.jar"; then $2_JAR=/usr/share/java/$1.jar fi fi if test x"${$2_JAR}" = "xyes"; then $2_JAR=no fi AC_MSG_RESULT(${$2_JAR}) AM_CONDITIONAL(WITH_$2, test x"${$2_JAR}" != "xno") # Clear $2_JAR if it doesn't contain a valid filename if test x"${$2_JAR}" = "xno"; then $2_JAR= fi if test -n "${$2_JAR}" ; then $2_AVAILABLE=true else $2_AVAILABLE=false fi AC_SUBST($2_JAR) AC_SUBST($2_AVAILABLE) ]) AC_DEFUN_ONCE([IT_CHECK_PLUGIN], [ AC_MSG_CHECKING([whether to build the browser plugin]) AC_ARG_ENABLE([plugin], [AS_HELP_STRING([--disable-plugin], [Disable compilation of browser plugin])], [enable_plugin="${enableval}"], [enable_plugin="yes"]) AC_MSG_RESULT(${enable_plugin}) ]) AC_DEFUN_ONCE([IT_CHECK_PLUGIN_DEPENDENCIES], [ dnl Check for plugin support headers and libraries. dnl FIXME: use unstable AC_REQUIRE([IT_CHECK_PLUGIN]) if test "x${enable_plugin}" = "xyes" ; then PKG_CHECK_MODULES(GLIB, glib-2.0) AC_SUBST(GLIB_CFLAGS) AC_SUBST(GLIB_LIBS) PKG_CHECK_MODULES(MOZILLA, npapi-sdk, [ AC_CACHE_CHECK([for xulrunner version], [xulrunner_cv_collapsed_version],[ # XXX: use NPAPI versions instead xulrunner_cv_collapsed_version=20000000 ]) ], [ PKG_CHECK_MODULES(MOZILLA, mozilla-plugin) ]) AC_SUBST(MOZILLA_CFLAGS) AC_SUBST(MOZILLA_LIBS) fi AM_CONDITIONAL(ENABLE_PLUGIN, test "x${enable_plugin}" = "xyes") ]) AC_DEFUN_ONCE([IT_CHECK_XULRUNNER_VERSION], [ AC_REQUIRE([IT_CHECK_PLUGIN_DEPENDENCIES]) if test "x${enable_plugin}" = "xyes" then AC_CACHE_CHECK([for xulrunner version], [xulrunner_cv_collapsed_version],[ if pkg-config --modversion libxul >/dev/null 2>&1 then xulrunner_cv_collapsed_version=`pkg-config --modversion libxul | awk -F. '{power=6; v=0; for (i=1; i <= NF; i++) {v += $i * 10 ^ power; power -=2}; print v}'` elif pkg-config --modversion mozilla-plugin >/dev/null 2>&1 then xulrunner_cv_collapsed_version=`pkg-config --modversion mozilla-plugin | awk -F. '{power=6; v=0; for (i=1; i <= NF; i++) {v += $i * 10 ^ power; power -=2}; print v}'` else AC_MSG_FAILURE([cannot determine xulrunner version]) fi]) AC_SUBST(MOZILLA_VERSION_COLLAPSED, $xulrunner_cv_collapsed_version) fi ]) AC_DEFUN_ONCE([IT_CHECK_FOR_TAGSOUP], [ AC_MSG_CHECKING([for tagsoup]) AC_ARG_WITH([tagsoup], [AS_HELP_STRING([--with-tagsoup], [tagsoup.jar])], [ TAGSOUP_JAR=${withval} ], [ TAGSOUP_JAR= ]) if test -z "${TAGSOUP_JAR}"; then for dir in /usr/share/java /usr/local/share/java ; do if test -f $dir/tagsoup.jar; then TAGSOUP_JAR=$dir/tagsoup.jar break fi done fi AC_MSG_RESULT(${TAGSOUP_JAR}) if test -z "${TAGSOUP_JAR}"; then AC_MSG_RESULT(***********************************************) AC_MSG_RESULT(* Warning you are building without tagsoup *) AC_MSG_RESULT(* Some jnlps and most htmls will be malformed *) AC_MSG_RESULT(***********************************************) fi AC_SUBST(TAGSOUP_JAR) AM_CONDITIONAL([HAVE_TAGSOUP], [test x$TAGSOUP_JAR != xno -a x$TAGSOUP_JAR != x ]) ]) dnl Generic macro to check for a Java class dnl Takes the name of the class as an argument. The macro name dnl is usually the name of the class with '.' dnl replaced by '_' and all letters capitalised. dnl e.g. IT_CHECK_FOR_CLASS([JAVA_UTIL_SCANNER],[java.util.Scanner]) dnl Test class has to be in sun.applet for some internal classes AC_DEFUN([IT_CHECK_FOR_CLASS],[ AC_REQUIRE([IT_FIND_JAVAC]) AC_REQUIRE([IT_FIND_JAVA]) AC_CACHE_CHECK([if $2 is available], it_cv_$1, [ CLASS=sun/applet/Test.java BYTECODE=$(echo $CLASS|sed 's#\.java##') mkdir -p tmp.$$/$(dirname $CLASS) cd tmp.$$ cat << \EOF > $CLASS [/* [#]line __oline__ "configure" */ package sun.applet; import $2; public class Test { public static void main(String[] args) throws Exception { System.out.println(Class.forName("$2")); } } ] EOF if $JAVAC -cp . $JAVACFLAGS -nowarn $CLASS >&AS_MESSAGE_LOG_FD 2>&1; then if $JAVA -classpath . $BYTECODE >&AS_MESSAGE_LOG_FD 2>&1; then it_cv_$1=yes; else it_cv_$1=no; fi else it_cv_$1=no; fi ]) rm -f $CLASS *.class cd .. # should be rmdir but has to be rm -rf due to sun.applet usage rm -rf tmp.$$ if test x"${it_cv_$1}" = "xno"; then AC_MSG_ERROR([$2 not found.]) fi AC_PROVIDE([$0])dnl ]) dnl Macro to check for a Java class HexDumpEncoder AC_DEFUN([IT_CHECK_FOR_HEXDUMPENCODER],[ AC_REQUIRE([IT_FIND_JAVAC]) AC_REQUIRE([IT_FIND_JAVA]) AC_CACHE_CHECK([if HexDumpEncoder is available], it_cv_HEXDUMPENCODER, [ CLASS=sun/applet/Test.java BYTECODE=$(echo $CLASS|sed 's#\.java##') mkdir -p tmp.$$/$(dirname $CLASS) cd tmp.$$ cat << \EOF > $CLASS [/* [#]line __oline__ "configure" */ package sun.applet; import sun.misc.*; import sun.security.util.*; public class Test { public static void main(String[] args) throws Exception { try { System.out.println(Class.forName("sun.misc.HexDumpEncoder")); } catch (ClassNotFoundException e) { System.out.println(Class.forName("sun.security.util.HexDumpEncoder")); } } } ] EOF if $JAVAC -cp . $JAVACFLAGS -nowarn $CLASS >&AS_MESSAGE_LOG_FD 2>&1; then if $JAVA -classpath . $BYTECODE >&AS_MESSAGE_LOG_FD 2>&1; then it_cv_HEXDUMPENCODER=yes; else it_cv_HEXDUMPENCODER=no; fi else it_cv_HEXDUMPENCODER=no; fi ]) rm -f $CLASS *.class cd .. # should be rmdir but has to be rm -rf due to sun.applet usage rm -rf tmp.$$ if test x"${it_cv_HEXDUMPENCODER}" = "xno"; then AC_MSG_ERROR([HexDumpEncoder not found.]) fi ]) AC_DEFUN_ONCE([IT_CHECK_FOR_MERCURIAL], [ AC_PATH_TOOL([HG],[hg]) AC_SUBST([HG]) ]) AC_DEFUN_ONCE([IT_OBTAIN_HG_REVISIONS], [ AC_REQUIRE([IT_CHECK_FOR_MERCURIAL]) ICEDTEA_REVISION="none"; if which ${HG} >&AS_MESSAGE_LOG_FD 2>&1; then AC_MSG_CHECKING([for IcedTea Mercurial revision ID]) if test -e ${abs_top_srcdir}/.hg ; then ICEDTEA_REVISION="r`(cd ${abs_top_srcdir}; ${HG} id -i)`" ; fi ; AC_MSG_RESULT([${ICEDTEA_REVISION}]) AC_SUBST([ICEDTEA_REVISION]) fi; AM_CONDITIONAL([HAS_ICEDTEA_REVISION], test "x${ICEDTEA_REVISION}" != xnone) ]) AC_DEFUN_ONCE([IT_GET_PKGVERSION], [ AC_MSG_CHECKING([for distribution package version]) AC_ARG_WITH([pkgversion], [AS_HELP_STRING([--with-pkgversion=PKG], [Use PKG in the version string in addition to "IcedTea"])], [case "$withval" in yes) AC_MSG_ERROR([package version not specified]) ;; no) PKGVERSION=none ;; *) PKGVERSION="$withval" ;; esac], [PKGVERSION=none]) AC_MSG_RESULT([${PKGVERSION}]) AM_CONDITIONAL(HAS_PKGVERSION, test "x${PKGVERSION}" != "xnone") AC_SUBST(PKGVERSION) ]) AC_DEFUN_ONCE([IT_CHECK_GLIB_VERSION],[ PKG_CHECK_MODULES([GLIB2_V_216],[glib-2.0 >= 2.16],[],[AC_DEFINE([LEGACY_GLIB])]) ]) AC_DEFUN_ONCE([IT_CHECK_XULRUNNER_MIMEDESCRIPTION_CONSTCHAR], [ AC_MSG_CHECKING([for legacy xulrunner api]) AC_LANG_PUSH(C++) CXXFLAGS_BACKUP="$CXXFLAGS" CXXFLAGS="$CXXFLAGS"" ""$MOZILLA_CFLAGS" AC_COMPILE_IFELSE([ AC_LANG_SOURCE([[#include const char* NP_GetMIMEDescription () {return (char*) "yap!";}]]) ],[ AC_MSG_RESULT(no) ],[ AC_MSG_RESULT(yes) AC_DEFINE([LEGACY_XULRUNNERAPI]) ]) CXXFLAGS="$CXXFLAGS_BACKUP" AC_LANG_POP(C++) ]) AC_DEFUN_ONCE([IT_CHECK_XULRUNNER_REQUIRES_C11], [ AC_MSG_CHECKING([for xulrunner enforcing C++11 standard]) AC_LANG_PUSH(C++) CXXFLAGS_BACKUP="$CXXFLAGS" CXXFLAGS="$CXXFLAGS"" ""$MOZILLA_CFLAGS" AC_COMPILE_IFELSE([ AC_LANG_SOURCE([[#include #include void setnpptr (NPVariant *result) { VOID_TO_NPVARIANT(*result);}]]) ],[ AC_MSG_RESULT(no) CXXFLAGS="$CXXFLAGS_BACKUP" ],[ AC_MSG_RESULT(yes) CXXFLAGS="$CXXFLAGS_BACKUP -std=c++11" ]) AC_LANG_POP(C++) ]) AC_DEFUN([IT_CHECK_WITH_GCJ], [ AC_MSG_CHECKING([whether to compile ecj natively]) AC_ARG_WITH([gcj], [AS_HELP_STRING(--with-gcj,location of gcj for natively compiling ecj)], [ GCJ="${withval}" ], [ GCJ="no" ]) AC_MSG_RESULT([${GCJ}]) if test "x${GCJ}" = xyes; then AC_PATH_TOOL([GCJ],[gcj]) fi AC_SUBST([GCJ]) ]) AC_DEFUN([IT_USING_ECJ],[ AC_CACHE_CHECK([if we are using ecj as javac], it_cv_ecj, [ if $JAVAC -version 2>&1| grep '^Eclipse' >&AS_MESSAGE_LOG_FD ; then it_cv_ecj=yes; else it_cv_ecj=no; fi ]) USING_ECJ=$it_cv_ecj AC_SUBST(USING_ECJ) AC_PROVIDE([$0])dnl ]) AC_DEFUN([FIND_TOOL], [AC_PATH_TOOL([$1],[$2]) if test x"$$1" = x ; then AC_MSG_ERROR([$2 program not found in PATH]) fi AC_SUBST([$1]) ]) AC_DEFUN([IT_SET_ARCH_SETTINGS], [ case "${host_cpu}" in x86_64) BUILD_ARCH_DIR=amd64 INSTALL_ARCH_DIR=amd64 JRE_ARCH_DIR=amd64 ARCHFLAG="-m64" ;; i?86) BUILD_ARCH_DIR=i586 INSTALL_ARCH_DIR=i386 JRE_ARCH_DIR=i386 ARCH_PREFIX=${LINUX32} ARCHFLAG="-m32" ;; alpha*) BUILD_ARCH_DIR=alpha INSTALL_ARCH_DIR=alpha JRE_ARCH_DIR=alpha ;; arm*) BUILD_ARCH_DIR=arm INSTALL_ARCH_DIR=arm JRE_ARCH_DIR=arm ;; mips) BUILD_ARCH_DIR=mips INSTALL_ARCH_DIR=mips JRE_ARCH_DIR=mips ;; mipsel) BUILD_ARCH_DIR=mipsel INSTALL_ARCH_DIR=mipsel JRE_ARCH_DIR=mipsel ;; powerpc) BUILD_ARCH_DIR=ppc INSTALL_ARCH_DIR=ppc JRE_ARCH_DIR=ppc ARCH_PREFIX=${LINUX32} ARCHFLAG="-m32" ;; powerpc64) BUILD_ARCH_DIR=ppc64 INSTALL_ARCH_DIR=ppc64 JRE_ARCH_DIR=ppc64 ARCHFLAG="-m64" ;; sparc) BUILD_ARCH_DIR=sparc INSTALL_ARCH_DIR=sparc JRE_ARCH_DIR=sparc ARCH_PREFIX=${LINUX32} ARCHFLAG="-m32" ;; sparc64) BUILD_ARCH_DIR=sparcv9 INSTALL_ARCH_DIR=sparcv9 JRE_ARCH_DIR=sparc64 ARCHFLAG="-m64" ;; s390) BUILD_ARCH_DIR=s390 INSTALL_ARCH_DIR=s390 JRE_ARCH_DIR=s390 ARCH_PREFIX=${LINUX32} ARCHFLAG="-m31" ;; s390x) BUILD_ARCH_DIR=s390x INSTALL_ARCH_DIR=s390x JRE_ARCH_DIR=s390x ARCHFLAG="-m64" ;; sh*) BUILD_ARCH_DIR=sh INSTALL_ARCH_DIR=sh JRE_ARCH_DIR=sh ;; *) BUILD_ARCH_DIR=`uname -m` INSTALL_ARCH_DIR=$BUILD_ARCH_DIR JRE_ARCH_DIR=$INSTALL_ARCH_DIR ;; esac AC_SUBST(BUILD_ARCH_DIR) AC_SUBST(INSTALL_ARCH_DIR) AC_SUBST(JRE_ARCH_DIR) AC_SUBST(ARCH_PREFIX) AC_SUBST(ARCHFLAG) ]) AC_DEFUN_ONCE([IT_FIND_JAVA], [ AC_REQUIRE([IT_CHECK_FOR_JRE]) AC_MSG_CHECKING([for a Java virtual machine]) AC_ARG_WITH([java], [AS_HELP_STRING(--with-java, specify location of the Java 1.7 VM)], [ JAVA="${withval}" ], [ JAVA="${SYSTEM_JRE_DIR}/bin/java" ]) if ! test -f "${JAVA}"; then AC_PATH_PROG(JAVA, "${JAVA}") fi if test -z "${JAVA}"; then AC_PATH_PROG(JAVA, "java") fi if test -z "${JAVA}"; then AC_MSG_ERROR("A 1.7+-compatible Java VM is required.") fi AC_MSG_RESULT(${JAVA}) AC_SUBST(JAVA) ]) AC_DEFUN_ONCE([IT_CHECK_JAVA_VERSION], [ AC_REQUIRE([IT_FIND_JAVA]) AC_MSG_CHECKING([JDK version]) JAVA_VERSION=`$JAVA -version 2>&1 | sed -n '1s/@<:@^"@:>@*"\(.*\)"$/\1/p'` AC_MSG_RESULT($JAVA_VERSION) HAVE_JAVA7=`echo $JAVA_VERSION | awk '{if ($(0) >= 1.7) print "yes"}'` HAVE_JAVA8=`echo $JAVA_VERSION | awk '{if ($(0) >= 1.8) print "yes"}'` HAVE_JAVA9=`echo $JAVA_VERSION | awk '{if ($(0) >= 1.9) print "yes"}'` if test -z "$HAVE_JAVA7"; then AC_MSG_ERROR([JDK7 or newer is required, detected was: $JAVA_VERSION]) fi if ! test -z "$HAVE_JAVA8"; then VERSION_DEFS="-DHAVE_JAVA8" fi if ! test -z "$HAVE_JAVA9"; then VERSION_DEFS="-DHAVE_JAVA9" fi AC_SUBST(VERSION_DEFS) AM_CONDITIONAL([HAVE_JAVA7], test x"${HAVE_JAVA7}" = "xyes") AM_CONDITIONAL([HAVE_JAVA8], test x"${HAVE_JAVA8}" = "xyes") AM_CONDITIONAL([HAVE_JAVA9], test x"${HAVE_JAVA9}" = "xyes") ]) AC_DEFUN_ONCE([IT_FIND_KEYTOOL], [ AC_REQUIRE([IT_CHECK_FOR_JDK]) AC_MSG_CHECKING([for keytool]) AC_ARG_WITH([keytool], [AS_HELP_STRING(--with-keytool,specify location of keytool for signed part of run-netx-dist)], [ if test "${withval}" = "yes" ; then KEYTOOL=${SYSTEM_JDK_DIR}/bin/keytool else KEYTOOL="${withval}" fi ], [ KEYTOOL=${SYSTEM_JDK_DIR}/bin/keytool ]) if ! test -f "${KEYTOOL}"; then AC_PATH_PROG(KEYTOOL, keytool) fi if ! test -f "${KEYTOOL}"; then KEYTOOL="" fi if test -z "${KEYTOOL}" ; then AC_MSG_WARN("keytool not found so signed part of run-netx-dist will fail") fi AC_MSG_RESULT(${KEYTOOL}) AC_SUBST(KEYTOOL) ]) AC_DEFUN_ONCE([IT_FIND_PACK200], [ AC_REQUIRE([IT_CHECK_FOR_JDK]) AC_MSG_CHECKING([for pack200]) AC_ARG_WITH([pack200], [AS_HELP_STRING(--with-pack200,specify location of pack200 for custom part of run-netx-dist)], [ if test "${withval}" = "yes" ; then PACK200=${SYSTEM_JDK_DIR}/bin/pack200 else PACK200="${withval}" fi ], [ PACK200=${SYSTEM_JDK_DIR}/bin/pack200 ]) if ! test -f "${PACK200}"; then AC_PATH_PROG(PACK200, pack200) fi if ! test -f "${PACK200}"; then PACK200="" fi if test -z "${PACK200}" ; then AC_MSG_WARN("pack200 not found so custom part of run-netx-dist will fail") fi AC_MSG_RESULT(${PACK200}) AC_SUBST(PACK200) ]) AC_DEFUN_ONCE([IT_FIND_JARSIGNER], [ AC_REQUIRE([IT_CHECK_FOR_JDK]) AC_MSG_CHECKING([for jarsigner]) AC_ARG_WITH([jarsigner], [AS_HELP_STRING(--with-jarsigner,specify location of jarsigner for signed part od run-netx-dist)], [ if test "${withval}" = "yes" ; then JARSIGNER=${SYSTEM_JDK_DIR}/bin/jarsigner else JARSIGNER="${withval}" fi ], [ JARSIGNER=${SYSTEM_JDK_DIR}/bin/jarsigner ]) if ! test -f "${JARSIGNER}"; then AC_PATH_PROG(JARSIGNER, jarsigner,"") fi if ! test -f "${JARSIGNER}"; then JARSIGNER="" fi if test -z "${JARSIGNER}"; then AC_MSG_WARN("jarsigner not found so signed part of run-netx-dist will fail") fi AC_MSG_RESULT(${JARSIGNER}) AC_SUBST(JARSIGNER) ]) AC_DEFUN([IT_FIND_JAVADOC], [ AC_REQUIRE([IT_CHECK_FOR_JDK]) AC_MSG_CHECKING([for javadoc]) AC_ARG_WITH([javadoc], [AS_HELP_STRING(--with-javadoc,specify location of Java documentation tool (javadoc))], [ JAVADOC="${withval}" ], [ JAVADOC=${SYSTEM_JDK_DIR}/bin/javadoc ]) if ! test -f "${JAVADOC}"; then AC_PATH_PROG(JAVADOC, "${JAVADOC}") fi if test -z "${JAVADOC}"; then AC_PATH_PROG(JAVADOC, "javadoc") fi if test -z "${JAVADOC}"; then AC_PATH_PROG(JAVADOC, "gjdoc") fi if test -z "${JAVADOC}" && test "x$ENABLE_DOCS" = "xyes"; then AC_MSG_ERROR("No Java documentation tool was found.") fi AC_MSG_RESULT(${JAVADOC}) AC_MSG_CHECKING([whether javadoc supports -J options]) CLASS=pkg/Test.java mkdir tmp.$$ cd tmp.$$ mkdir pkg cat << \EOF > $CLASS [/* [#]line __oline__ "configure" */ package pkg; public class Test { /** * Does stuff. * * * @param args arguments from cli. */ public static void main(String[] args) { System.out.println("Hello World!"); } } ] EOF if $JAVADOC -J-Xmx896m pkg >&AS_MESSAGE_LOG_FD 2>&1; then JAVADOC_KNOWS_J_OPTIONS=yes else JAVADOC_KNOWS_J_OPTIONS=no fi cd .. rm -rf tmp.$$ AC_MSG_RESULT([${JAVADOC_KNOWS_J_OPTIONS}]) AC_SUBST(JAVADOC) AC_SUBST(JAVADOC_KNOWS_J_OPTIONS) AM_CONDITIONAL([JAVADOC_SUPPORTS_J_OPTIONS], test x"${JAVADOC_KNOWS_J_OPTIONS}" = "xyes") ]) dnl Checks that sun.applet.AppletViewerPanel is available dnl and public (via the patch in IcedTea6, applet_hole.patch) dnl Can be removed when that is upstream or unneeded AC_DEFUN([IT_CHECK_FOR_SUN_APPLET_ACCESSIBILITY],[ AC_REQUIRE([IT_FIND_JAVAC]) AC_REQUIRE([IT_FIND_JAVA]) AC_CACHE_CHECK([if selected classes, fields and methods from sun.applet are accessible via reflection], it_cv_applet_hole, [ CLASS=TestAppletViewer.java BYTECODE=$(echo $CLASS|sed 's#\.java##') mkdir -p tmp.$$ cd tmp.$$ cat << \EOF > $CLASS [/* [#]line __oline__ "configure" */ import java.lang.reflect.*; public class TestAppletViewer { public static void main(String[] args) throws Exception { Class ap = Class.forName("sun.applet.AppletPanel"); Class avp = Class.forName("sun.applet.AppletViewerPanel"); Field f1 = ap.getDeclaredField("applet"); Field f2 = avp.getDeclaredField("documentURL"); Method m1 = ap.getDeclaredMethod("run"); Method m2 = ap.getDeclaredMethod("runLoader"); Field f3 = avp.getDeclaredField("baseURL"); } } ] EOF if $JAVAC -cp . $JAVACFLAGS -nowarn $CLASS >&AS_MESSAGE_LOG_FD 2>&1; then if $JAVA -classpath . $BYTECODE >&AS_MESSAGE_LOG_FD 2>&1; then it_cv_applet_hole=yes; else it_cv_applet_hole=no; fi else it_cv_applet_hole=no; fi ]) rm -f $CLASS *.class cd .. rmdir tmp.$$ if test x"${it_cv_applet_hole}" = "xno"; then AC_MSG_ERROR([Some of the checked items is not avaiable. Check logs.]) fi AC_PROVIDE([$0])dnl ]) AC_DEFUN_ONCE([IT_SET_VERSION], [ AC_REQUIRE([IT_OBTAIN_HG_REVISIONS]) AC_REQUIRE([IT_GET_PKGVERSION]) AC_MSG_CHECKING([what version string to use]) if test "x${ICEDTEA_REVISION}" != xnone; then ICEDTEA_REV="+${ICEDTEA_REVISION}" fi if test "x${PKGVERSION}" != "xnone"; then ICEDTEA_PKG=" (${PKGVERSION})" fi FULL_VERSION="${PACKAGE_VERSION}${ICEDTEA_REV}${ICEDTEA_PKG}" AC_MSG_RESULT([${FULL_VERSION}]) AC_SUBST([FULL_VERSION]) ]) dnl Allows you to configure (enable/disable/set path to) the browser dnl REQUIRED Parameters: dnl [browser name, variable to store path, default command to run browser (if not provided, assume it's the same as the browser name] AC_DEFUN([IT_FIND_BROWSER], [ AC_ARG_WITH([$1], [AS_HELP_STRING(--with-$1,specify the location of $1)], [ if test "${withval}" = "no" || test "${withval}" = "yes" || test "${withval}" = "" ; then $2="" elif test -f "${withval}" ; then $2="${withval}" else AC_MSG_CHECKING([for $1]) AC_MSG_RESULT([not found]) AC_MSG_FAILURE([invalid location specified to $1: ${withval}]) fi ], [ withval="yes" ]) if test -f "${$2}"; then AC_MSG_CHECKING([for $1]) AC_MSG_RESULT([${$2}]) elif test "${withval}" != "no"; then if test $# -gt 2; then AC_PATH_TOOL([$2], [$3], [], []) else AC_PATH_TOOL([$2], [$1], [], []) fi else AC_MSG_CHECKING([for $1]) AC_MSG_RESULT([no]) fi ]) AC_DEFUN_ONCE([IT_SET_GLOBAL_BROWSERTESTS_BEHAVIOUR], [ AC_MSG_CHECKING([how browser test will be run]) AC_ARG_WITH([browser-tests], [AS_HELP_STRING([--with-browser-tests], [yes - as defined (default), no - all browser tests will be skipped, one - all "mutiple browsers" test will behave as "one" test, all - all browser tests will be run for all set browsers])], [ BROWSER_SWITCH=${withval} ], [ BROWSER_SWITCH="yes" ]) D_PARAM_PART="-Dmodified.browsers.run" case "$BROWSER_SWITCH" in "yes" ) BROWSER_TESTS_MODIFICATION="" ;; "no" ) BROWSER_TESTS_MODIFICATION="$D_PARAM_PART=ignore" ;; "one" ) BROWSER_TESTS_MODIFICATION="$D_PARAM_PART=one" ;; "all" ) BROWSER_TESTS_MODIFICATION="$D_PARAM_PART=all" ;; *) AC_MSG_ERROR([unknown valkue of with-browser-tests ($BROWSER_SWITCH), so not use (yes) or set yes|no|one|all]) esac AC_MSG_RESULT(${BROWSER_SWITCH}) AC_SUBST(BROWSER_TESTS_MODIFICATION) ]) icedtea-web-1.6.2/PaxHeaders.17941/configure0000644000000000000000000000013112654402525015343 xustar0029 mtime=1454507349.99127557 30 atime=1454507520.915995997 30 ctime=1454507658.719158157 icedtea-web-1.6.2/configure0000755000175000002070000122763512654402525016112 0ustar00jvanekmock00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for icedtea-web 1.6.2. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and $0: distro-pkg-dev@openjdk.java.net about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='icedtea-web' PACKAGE_TARNAME='icedtea-web' PACKAGE_VERSION='1.6.2' PACKAGE_STRING='icedtea-web 1.6.2' PACKAGE_BUGREPORT='distro-pkg-dev@openjdk.java.net' PACKAGE_URL='http://icedtea.classpath.org/wiki/IcedTea-Web' ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS HAVE_TAGSOUP_FALSE HAVE_TAGSOUP_TRUE TAGSOUP_JAR ASM_AVAILABLE ASM_JAR WITH_ASM_FALSE WITH_ASM_TRUE JACOCO_AVAILABLE JACOCO_JAR WITH_JACOCO_FALSE WITH_JACOCO_TRUE HAMCREST_AVAILABLE HAMCREST_JAR WITH_HAMCREST_FALSE WITH_HAMCREST_TRUE JUNIT_AVAILABLE JUNIT_JAR WITH_JUNIT_FALSE WITH_JUNIT_TRUE RHINO_AVAILABLE RHINO_JAR WITH_RHINO_FALSE WITH_RHINO_TRUE WITH_XSLTPROC_FALSE WITH_XSLTPROC_TRUE BROWSER_TESTS_MODIFICATION EPIPHANY MIDORI OPERA CHROMIUM CHROME FIREFOX XSLTPROC GLIB2_V_216_LIBS GLIB2_V_216_CFLAGS X11_LIBS X11_CFLAGS MOZILLA_VERSION_COLLAPSED ENABLE_PLUGIN_FALSE ENABLE_PLUGIN_TRUE MOZILLA_LIBS MOZILLA_CFLAGS GLIB_LIBS GLIB_CFLAGS PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG FULL_VERSION PKGVERSION HAS_PKGVERSION_FALSE HAS_PKGVERSION_TRUE HAS_ICEDTEA_REVISION_FALSE HAS_ICEDTEA_REVISION_TRUE ICEDTEA_REVISION HG PACK200 JARSIGNER KEYTOOL JAVADOC_SUPPORTS_J_OPTIONS_FALSE JAVADOC_SUPPORTS_J_OPTIONS_TRUE JAVADOC_KNOWS_J_OPTIONS JAVADOC HAVE_JAVA9_FALSE HAVE_JAVA9_TRUE HAVE_JAVA8_FALSE HAVE_JAVA8_TRUE HAVE_JAVA7_FALSE HAVE_JAVA7_TRUE VERSION_DEFS JAVA SYSTEM_JRE_DIR ECJ_JAR JAR_KNOWS_J_OPTIONS JAR_ACCEPTS_STDIN_LIST JAR_KNOWS_ATFILE JAR USING_ECJ ECJ JAVAC SYSTEM_JDK_DIR ZIP GCJ BIN_BASH ENABLE_WHITELIST_FALSE ENABLE_WHITELIST_TRUE ENABLE_DOCS_FALSE ENABLE_DOCS_TRUE SRC_DIR_HARDLINKABLE_FALSE SRC_DIR_HARDLINKABLE_TRUE CP_SUPPORTS_REFLINK_FALSE CP_SUPPORTS_REFLINK_TRUE ARCHFLAG ARCH_PREFIX JRE_ARCH_DIR INSTALL_ARCH_DIR BUILD_ARCH_DIR am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE ac_ct_CXX CXXFLAGS CXX am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC host_os host_vendor host_cpu host build_os build_vendor build_cpu build abs_top_srcdir abs_top_builddir MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_maintainer_mode enable_dependency_tracking enable_docs enable_whitelist_processing with_gcj with_jdk_home with_javac with_ecj with_jar with_ecj_jar with_jre_home with_java with_javadoc with_keytool with_jarsigner with_pack200 with_pkgversion enable_plugin with_firefox with_chrome with_chromium with_opera with_midori with_epiphany with_browser_tests with_rhino with_junit with_hamcrest with_jacoco with_asm with_tagsoup ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CXX CXXFLAGS CCC PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR GLIB_CFLAGS GLIB_LIBS MOZILLA_CFLAGS MOZILLA_LIBS X11_CFLAGS X11_LIBS GLIB2_V_216_CFLAGS GLIB2_V_216_LIBS' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures icedtea-web 1.6.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/icedtea-web] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of icedtea-web 1.6.2:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --disable-maintainer-mode disable make rules and dependencies not useful (and sometimes confusing) to the casual installer --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --disable-docs Disable generation of documentation --enable-whitelist-processing Enable whitelist filter on directory name when processing, compiling and running reproducers. Otherwise filter on testcase name when running reproducers --disable-plugin Disable compilation of browser plugin Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-gcj location of gcj for natively compiling ecj --with-jdk-home jdk home directory (default is first predefined JDK found) --with-javac bytecode compilation with javac --with-ecj bytecode compilation with ecj --with-jar specify location of Java archive tool (jar) --with-ecj-jar specify location of the ECJ jar --with-jre-home jre home directory (default is the JRE under the JDK) --with-java specify location of the Java 1.7 VM --with-javadoc specify location of Java documentation tool (javadoc) --with-keytool specify location of keytool for signed part of run-netx-dist --with-jarsigner specify location of jarsigner for signed part od run-netx-dist --with-pack200 specify location of pack200 for custom part of run-netx-dist --with-pkgversion=PKG Use PKG in the version string in addition to "IcedTea" --with-firefox specify the location of firefox --with-chrome specify the location of chrome --with-chromium specify the location of chromium --with-opera specify the location of opera --with-midori specify the location of midori --with-epiphany specify the location of epiphany --with-browser-tests yes - as defined (default), no - all browser tests will be skipped, one - all "mutiple browsers" test will behave as "one" test, all - all browser tests will be run for all set browsers --with-rhino specify location of the rhino jar --with-junit specify location of the junit jar --with-hamcrest specify location of the hamcrest jar --with-jacoco specify location of the jacoco jar --with-asm specify location of the asm jar --with-tagsoup tagsoup.jar Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CXX C++ compiler command CXXFLAGS C++ compiler flags PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path GLIB_CFLAGS C compiler flags for GLIB, overriding pkg-config GLIB_LIBS linker flags for GLIB, overriding pkg-config MOZILLA_CFLAGS C compiler flags for MOZILLA, overriding pkg-config MOZILLA_LIBS linker flags for MOZILLA, overriding pkg-config X11_CFLAGS C compiler flags for X11, overriding pkg-config X11_LIBS linker flags for X11, overriding pkg-config GLIB2_V_216_CFLAGS C compiler flags for GLIB2_V_216, overriding pkg-config GLIB2_V_216_LIBS linker flags for GLIB2_V_216, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . icedtea-web home page: . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF icedtea-web configure 1.6.2 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_cxx_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by icedtea-web $as_me 1.6.2, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu am__api_version='1.15' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='icedtea-web' VERSION='1.6.2' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to create a pax tar archive" >&5 $as_echo_n "checking how to create a pax tar archive... " >&6; } # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_pax-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do { echo "$as_me:$LINENO: $_am_tar --version" >&5 ($_am_tar --version) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && break done am__tar="$_am_tar --format=posix -chf - "'"$$tardir"' am__tar_="$_am_tar --format=posix -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x pax -w "$$tardir"' am__tar_='pax -L -x pax -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H pax -L' am__tar_='find "$tardir" -print | cpio -o -H pax -L' am__untar='cpio -i -H pax -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_pax}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file { echo "$as_me:$LINENO: tardir=conftest.dir && eval $am__tar_ >conftest.tar" >&5 (tardir=conftest.dir && eval $am__tar_ >conftest.tar) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } rm -rf conftest.dir if test -s conftest.tar; then { echo "$as_me:$LINENO: $am__untar &5 ($am__untar &5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { echo "$as_me:$LINENO: cat conftest.dir/file" >&5 (cat conftest.dir/file) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } grep GrepMe conftest.dir/file >/dev/null 2>&1 && break fi done rm -rf conftest.dir if ${am_cv_prog_tar_pax+:} false; then : $as_echo_n "(cached) " >&6 else am_cv_prog_tar_pax=$_am_tool fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_pax" >&5 $as_echo "$am_cv_prog_tar_pax" >&6; } # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi ac_config_files="$ac_config_files Makefile netx.manifest" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } # Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then : enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=yes fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 $as_echo "$USE_MAINTAINER_MODE" >&6; } if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE # Older automake doesn't generate these correctly abs_top_builddir=`pwd -P` abs_top_srcdir=`dirname $0` cd $abs_top_srcdir abs_top_srcdir=`pwd` cd $abs_top_builddir # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } if ${ac_cv_cxx_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } if ${ac_cv_prog_cxx_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes else CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 $as_echo "$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CXX" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CXX_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 $as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi case "${host_cpu}" in x86_64) BUILD_ARCH_DIR=amd64 INSTALL_ARCH_DIR=amd64 JRE_ARCH_DIR=amd64 ARCHFLAG="-m64" ;; i?86) BUILD_ARCH_DIR=i586 INSTALL_ARCH_DIR=i386 JRE_ARCH_DIR=i386 ARCH_PREFIX=${LINUX32} ARCHFLAG="-m32" ;; alpha*) BUILD_ARCH_DIR=alpha INSTALL_ARCH_DIR=alpha JRE_ARCH_DIR=alpha ;; arm*) BUILD_ARCH_DIR=arm INSTALL_ARCH_DIR=arm JRE_ARCH_DIR=arm ;; mips) BUILD_ARCH_DIR=mips INSTALL_ARCH_DIR=mips JRE_ARCH_DIR=mips ;; mipsel) BUILD_ARCH_DIR=mipsel INSTALL_ARCH_DIR=mipsel JRE_ARCH_DIR=mipsel ;; powerpc) BUILD_ARCH_DIR=ppc INSTALL_ARCH_DIR=ppc JRE_ARCH_DIR=ppc ARCH_PREFIX=${LINUX32} ARCHFLAG="-m32" ;; powerpc64) BUILD_ARCH_DIR=ppc64 INSTALL_ARCH_DIR=ppc64 JRE_ARCH_DIR=ppc64 ARCHFLAG="-m64" ;; sparc) BUILD_ARCH_DIR=sparc INSTALL_ARCH_DIR=sparc JRE_ARCH_DIR=sparc ARCH_PREFIX=${LINUX32} ARCHFLAG="-m32" ;; sparc64) BUILD_ARCH_DIR=sparcv9 INSTALL_ARCH_DIR=sparcv9 JRE_ARCH_DIR=sparc64 ARCHFLAG="-m64" ;; s390) BUILD_ARCH_DIR=s390 INSTALL_ARCH_DIR=s390 JRE_ARCH_DIR=s390 ARCH_PREFIX=${LINUX32} ARCHFLAG="-m31" ;; s390x) BUILD_ARCH_DIR=s390x INSTALL_ARCH_DIR=s390x JRE_ARCH_DIR=s390x ARCHFLAG="-m64" ;; sh*) BUILD_ARCH_DIR=sh INSTALL_ARCH_DIR=sh JRE_ARCH_DIR=sh ;; *) BUILD_ARCH_DIR=`uname -m` INSTALL_ARCH_DIR=$BUILD_ARCH_DIR JRE_ARCH_DIR=$INSTALL_ARCH_DIR ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if cp supports --reflink" >&5 $as_echo_n "checking if cp supports --reflink... " >&6; } if ${it_cv_reflink+:} false; then : $as_echo_n "(cached) " >&6 else touch tmp.$$ if cp --reflink=auto tmp.$$ tmp2.$$ >&5 2>&1; then it_cv_reflink=yes; else it_cv_reflink=no; fi rm -f tmp.$$ tmp2.$$ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $it_cv_reflink" >&5 $as_echo "$it_cv_reflink" >&6; } if test x"${it_cv_reflink}" = "xyes"; then CP_SUPPORTS_REFLINK_TRUE= CP_SUPPORTS_REFLINK_FALSE='#' else CP_SUPPORTS_REFLINK_TRUE='#' CP_SUPPORTS_REFLINK_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can hard link rather than copy from ${abs_top_srcdir}" >&5 $as_echo_n "checking if we can hard link rather than copy from ${abs_top_srcdir}... " >&6; } if ${it_cv_hardlink_src+:} false; then : $as_echo_n "(cached) " >&6 else if cp -l ${abs_top_srcdir}/README tmp.$$ >&5 2>&1; then it_cv_hardlink_src=yes; else it_cv_hardlink_src=no; fi rm -f tmp.$$ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $it_cv_hardlink_src" >&5 $as_echo "$it_cv_hardlink_src" >&6; } if test x"${it_cv_hardlink_src}" = "xyes"; then SRC_DIR_HARDLINKABLE_TRUE= SRC_DIR_HARDLINKABLE_FALSE='#' else SRC_DIR_HARDLINKABLE_TRUE='#' SRC_DIR_HARDLINKABLE_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build documentation" >&5 $as_echo_n "checking whether to build documentation... " >&6; } # Check whether --enable-docs was given. if test "${enable_docs+set}" = set; then : enableval=$enable_docs; ENABLE_DOCS="${enableval}" else ENABLE_DOCS='yes' fi if test x$ENABLE_DOCS = xyes; then ENABLE_DOCS_TRUE= ENABLE_DOCS_FALSE='#' else ENABLE_DOCS_TRUE='#' ENABLE_DOCS_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ENABLE_DOCS}" >&5 $as_echo "${ENABLE_DOCS}" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to filter by whitelisting on directory name when processing, compiling and running reproducers" >&5 $as_echo_n "checking whether to filter by whitelisting on directory name when processing, compiling and running reproducers... " >&6; } # Check whether --enable-whitelist-processing was given. if test "${enable_whitelist_processing+set}" = set; then : enableval=$enable_whitelist_processing; ENABLE_WHITELIST="${enableval}" else ENABLE_WHITELIST='no' fi if test x$ENABLE_WHITELIST = xyes; then ENABLE_WHITELIST_TRUE= ENABLE_WHITELIST_FALSE='#' else ENABLE_WHITELIST_TRUE='#' ENABLE_WHITELIST_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ENABLE_WHITELIST}" >&5 $as_echo "${ENABLE_WHITELIST}" >&6; } # Extract the first word of "bash", so it can be a program name with args. set dummy bash; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_BIN_BASH+:} false; then : $as_echo_n "(cached) " >&6 else case $BIN_BASH in [\\/]* | ?:[\\/]*) ac_cv_path_BIN_BASH="$BIN_BASH" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_BIN_BASH="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi BIN_BASH=$ac_cv_path_BIN_BASH if test -n "$BIN_BASH"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BIN_BASH" >&5 $as_echo "$BIN_BASH" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test x"$BIN_BASH" = x ; then as_fn_error $? "/bin/bash is used in runtime and for about generation. Dying sooner rather then later" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to compile ecj natively" >&5 $as_echo_n "checking whether to compile ecj natively... " >&6; } # Check whether --with-gcj was given. if test "${with_gcj+set}" = set; then : withval=$with_gcj; GCJ="${withval}" else GCJ="no" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${GCJ}" >&5 $as_echo "${GCJ}" >&6; } if test "x${GCJ}" = xyes; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcj", so it can be a program name with args. set dummy ${ac_tool_prefix}gcj; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GCJ+:} false; then : $as_echo_n "(cached) " >&6 else case $GCJ in [\\/]* | ?:[\\/]*) ac_cv_path_GCJ="$GCJ" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GCJ="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi GCJ=$ac_cv_path_GCJ if test -n "$GCJ"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GCJ" >&5 $as_echo "$GCJ" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_GCJ"; then ac_pt_GCJ=$GCJ # Extract the first word of "gcj", so it can be a program name with args. set dummy gcj; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_GCJ+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_GCJ in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_GCJ="$ac_pt_GCJ" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_GCJ="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_GCJ=$ac_cv_path_ac_pt_GCJ if test -n "$ac_pt_GCJ"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_GCJ" >&5 $as_echo "$ac_pt_GCJ" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_GCJ" = x; then GCJ="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac GCJ=$ac_pt_GCJ fi else GCJ="$ac_cv_path_GCJ" fi fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}zip", so it can be a program name with args. set dummy ${ac_tool_prefix}zip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ZIP+:} false; then : $as_echo_n "(cached) " >&6 else case $ZIP in [\\/]* | ?:[\\/]*) ac_cv_path_ZIP="$ZIP" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ZIP="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ZIP=$ac_cv_path_ZIP if test -n "$ZIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ZIP" >&5 $as_echo "$ZIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_ZIP"; then ac_pt_ZIP=$ZIP # Extract the first word of "zip", so it can be a program name with args. set dummy zip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_ZIP+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_ZIP in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_ZIP="$ac_pt_ZIP" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_ZIP="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_ZIP=$ac_cv_path_ac_pt_ZIP if test -n "$ac_pt_ZIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_ZIP" >&5 $as_echo "$ac_pt_ZIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_ZIP" = x; then ZIP="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac ZIP=$ac_pt_ZIP fi else ZIP="$ac_cv_path_ZIP" fi if test x"$ZIP" = x ; then as_fn_error $? "zip program not found in PATH" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a JDK home directory" >&5 $as_echo_n "checking for a JDK home directory... " >&6; } # Check whether --with-jdk-home was given. if test "${with_jdk_home+set}" = set; then : withval=$with_jdk_home; if test "x${withval}" = xyes then SYSTEM_JDK_DIR= elif test "x${withval}" = xno then SYSTEM_JDK_DIR= else SYSTEM_JDK_DIR=${withval} fi else SYSTEM_JDK_DIR= fi if test -z "${SYSTEM_JDK_DIR}"; then for dir in /etc/alternatives/java_sdk \ /usr/lib/jvm/java-1.7.0-openjdk \ /usr/lib/jvm/icedtea7 \ /usr/lib/jvm/java-7-openjdk \ /usr/lib/jvm/java-1.8.0-openjdk \ /usr/lib/jvm/icedtea8 \ /usr/lib/jvm/java-8-openjdk \ /usr/lib/jvm/java-icedtea \ /usr/lib/jvm/java-openjdk \ /usr/lib/jvm/openjdk \ /usr/lib/jvm/cacao \ /usr/lib/jvm/jamvm ; do if test -d $dir; then SYSTEM_JDK_DIR=$dir break fi done fi if ! test -d "${SYSTEM_JDK_DIR}"; then as_fn_error $? "\"A JDK home directory could not be found. ${SYSTEM_JDK_DIR}\"" "$LINENO" 5 else READ=`readlink -f ${SYSTEM_JDK_DIR}` { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${SYSTEM_JDK_DIR} (link to ${READ})" >&5 $as_echo "${SYSTEM_JDK_DIR} (link to ${READ})" >&6; } fi JAVAC=${SYSTEM_JDK_DIR}/bin/javac # Check whether --with-javac was given. if test "${with_javac+set}" = set; then : withval=$with_javac; if test "x${withval}" != x && test "x${withval}" != xyes && test "x${withval}" != xno; then if test "x${withval}" != x; then if test -f "${withval}"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for javac" >&5 $as_echo_n "checking for javac... " >&6; } JAVAC="${withval}" { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${JAVAC}" >&5 $as_echo "${JAVAC}" >&6; } else # Extract the first word of ""${withval}"", so it can be a program name with args. set dummy "${withval}"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_JAVAC+:} false; then : $as_echo_n "(cached) " >&6 else case $JAVAC in [\\/]* | ?:[\\/]*) ac_cv_path_JAVAC="$JAVAC" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_JAVAC="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi JAVAC=$ac_cv_path_JAVAC if test -n "$JAVAC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVAC" >&5 $as_echo "$JAVAC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi else # Extract the first word of ""javac"", so it can be a program name with args. set dummy "javac"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_JAVAC+:} false; then : $as_echo_n "(cached) " >&6 else case $JAVAC in [\\/]* | ?:[\\/]*) ac_cv_path_JAVAC="$JAVAC" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_JAVAC="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi JAVAC=$ac_cv_path_JAVAC if test -n "$JAVAC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVAC" >&5 $as_echo "$JAVAC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi else if test "x${withval}" != xno; then if test "x" != x; then if test -f ""; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for javac" >&5 $as_echo_n "checking for javac... " >&6; } JAVAC="" { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${JAVAC}" >&5 $as_echo "${JAVAC}" >&6; } else # Extract the first word of """", so it can be a program name with args. set dummy ""; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_JAVAC+:} false; then : $as_echo_n "(cached) " >&6 else case $JAVAC in [\\/]* | ?:[\\/]*) ac_cv_path_JAVAC="$JAVAC" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_JAVAC="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi JAVAC=$ac_cv_path_JAVAC if test -n "$JAVAC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVAC" >&5 $as_echo "$JAVAC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi else # Extract the first word of ""javac"", so it can be a program name with args. set dummy "javac"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_JAVAC+:} false; then : $as_echo_n "(cached) " >&6 else case $JAVAC in [\\/]* | ?:[\\/]*) ac_cv_path_JAVAC="$JAVAC" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_JAVAC="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi JAVAC=$ac_cv_path_JAVAC if test -n "$JAVAC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVAC" >&5 $as_echo "$JAVAC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi fi else if test "x" != x; then if test -f ""; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for javac" >&5 $as_echo_n "checking for javac... " >&6; } JAVAC="" { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${JAVAC}" >&5 $as_echo "${JAVAC}" >&6; } else # Extract the first word of """", so it can be a program name with args. set dummy ""; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_JAVAC+:} false; then : $as_echo_n "(cached) " >&6 else case $JAVAC in [\\/]* | ?:[\\/]*) ac_cv_path_JAVAC="$JAVAC" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_JAVAC="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi JAVAC=$ac_cv_path_JAVAC if test -n "$JAVAC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVAC" >&5 $as_echo "$JAVAC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi else # Extract the first word of ""javac"", so it can be a program name with args. set dummy "javac"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_JAVAC+:} false; then : $as_echo_n "(cached) " >&6 else case $JAVAC in [\\/]* | ?:[\\/]*) ac_cv_path_JAVAC="$JAVAC" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_JAVAC="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi JAVAC=$ac_cv_path_JAVAC if test -n "$JAVAC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVAC" >&5 $as_echo "$JAVAC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi # Check whether --with-ecj was given. if test "${with_ecj+set}" = set; then : withval=$with_ecj; if test "x${withval}" != x && test "x${withval}" != xyes && test "x${withval}" != xno; then if test "x${withval}" != x; then if test -f "${withval}"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ecj" >&5 $as_echo_n "checking for ecj... " >&6; } ECJ="${withval}" { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ECJ}" >&5 $as_echo "${ECJ}" >&6; } else # Extract the first word of ""${withval}"", so it can be a program name with args. set dummy "${withval}"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ECJ+:} false; then : $as_echo_n "(cached) " >&6 else case $ECJ in [\\/]* | ?:[\\/]*) ac_cv_path_ECJ="$ECJ" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ECJ="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ECJ=$ac_cv_path_ECJ if test -n "$ECJ"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ECJ" >&5 $as_echo "$ECJ" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi else # Extract the first word of ""ecj"", so it can be a program name with args. set dummy "ecj"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ECJ+:} false; then : $as_echo_n "(cached) " >&6 else case $ECJ in [\\/]* | ?:[\\/]*) ac_cv_path_ECJ="$ECJ" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ECJ="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ECJ=$ac_cv_path_ECJ if test -n "$ECJ"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ECJ" >&5 $as_echo "$ECJ" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "${ECJ}"; then # Extract the first word of ""ecj-3.1"", so it can be a program name with args. set dummy "ecj-3.1"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ECJ+:} false; then : $as_echo_n "(cached) " >&6 else case $ECJ in [\\/]* | ?:[\\/]*) ac_cv_path_ECJ="$ECJ" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ECJ="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ECJ=$ac_cv_path_ECJ if test -n "$ECJ"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ECJ" >&5 $as_echo "$ECJ" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "${ECJ}"; then # Extract the first word of ""ecj-3.2"", so it can be a program name with args. set dummy "ecj-3.2"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ECJ+:} false; then : $as_echo_n "(cached) " >&6 else case $ECJ in [\\/]* | ?:[\\/]*) ac_cv_path_ECJ="$ECJ" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ECJ="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ECJ=$ac_cv_path_ECJ if test -n "$ECJ"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ECJ" >&5 $as_echo "$ECJ" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "${ECJ}"; then # Extract the first word of ""ecj-3.3"", so it can be a program name with args. set dummy "ecj-3.3"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ECJ+:} false; then : $as_echo_n "(cached) " >&6 else case $ECJ in [\\/]* | ?:[\\/]*) ac_cv_path_ECJ="$ECJ" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ECJ="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ECJ=$ac_cv_path_ECJ if test -n "$ECJ"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ECJ" >&5 $as_echo "$ECJ" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi else if test "x${withval}" != xno; then if test "x" != x; then if test -f ""; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ecj" >&5 $as_echo_n "checking for ecj... " >&6; } ECJ="" { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ECJ}" >&5 $as_echo "${ECJ}" >&6; } else # Extract the first word of """", so it can be a program name with args. set dummy ""; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ECJ+:} false; then : $as_echo_n "(cached) " >&6 else case $ECJ in [\\/]* | ?:[\\/]*) ac_cv_path_ECJ="$ECJ" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ECJ="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ECJ=$ac_cv_path_ECJ if test -n "$ECJ"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ECJ" >&5 $as_echo "$ECJ" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi else # Extract the first word of ""ecj"", so it can be a program name with args. set dummy "ecj"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ECJ+:} false; then : $as_echo_n "(cached) " >&6 else case $ECJ in [\\/]* | ?:[\\/]*) ac_cv_path_ECJ="$ECJ" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ECJ="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ECJ=$ac_cv_path_ECJ if test -n "$ECJ"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ECJ" >&5 $as_echo "$ECJ" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "${ECJ}"; then # Extract the first word of ""ecj-3.1"", so it can be a program name with args. set dummy "ecj-3.1"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ECJ+:} false; then : $as_echo_n "(cached) " >&6 else case $ECJ in [\\/]* | ?:[\\/]*) ac_cv_path_ECJ="$ECJ" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ECJ="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ECJ=$ac_cv_path_ECJ if test -n "$ECJ"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ECJ" >&5 $as_echo "$ECJ" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "${ECJ}"; then # Extract the first word of ""ecj-3.2"", so it can be a program name with args. set dummy "ecj-3.2"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ECJ+:} false; then : $as_echo_n "(cached) " >&6 else case $ECJ in [\\/]* | ?:[\\/]*) ac_cv_path_ECJ="$ECJ" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ECJ="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ECJ=$ac_cv_path_ECJ if test -n "$ECJ"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ECJ" >&5 $as_echo "$ECJ" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "${ECJ}"; then # Extract the first word of ""ecj-3.3"", so it can be a program name with args. set dummy "ecj-3.3"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ECJ+:} false; then : $as_echo_n "(cached) " >&6 else case $ECJ in [\\/]* | ?:[\\/]*) ac_cv_path_ECJ="$ECJ" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ECJ="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ECJ=$ac_cv_path_ECJ if test -n "$ECJ"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ECJ" >&5 $as_echo "$ECJ" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi fi fi else if test "x" != x; then if test -f ""; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ecj" >&5 $as_echo_n "checking for ecj... " >&6; } ECJ="" { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ECJ}" >&5 $as_echo "${ECJ}" >&6; } else # Extract the first word of """", so it can be a program name with args. set dummy ""; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ECJ+:} false; then : $as_echo_n "(cached) " >&6 else case $ECJ in [\\/]* | ?:[\\/]*) ac_cv_path_ECJ="$ECJ" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ECJ="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ECJ=$ac_cv_path_ECJ if test -n "$ECJ"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ECJ" >&5 $as_echo "$ECJ" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi else # Extract the first word of ""ecj"", so it can be a program name with args. set dummy "ecj"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ECJ+:} false; then : $as_echo_n "(cached) " >&6 else case $ECJ in [\\/]* | ?:[\\/]*) ac_cv_path_ECJ="$ECJ" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ECJ="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ECJ=$ac_cv_path_ECJ if test -n "$ECJ"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ECJ" >&5 $as_echo "$ECJ" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "${ECJ}"; then # Extract the first word of ""ecj-3.1"", so it can be a program name with args. set dummy "ecj-3.1"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ECJ+:} false; then : $as_echo_n "(cached) " >&6 else case $ECJ in [\\/]* | ?:[\\/]*) ac_cv_path_ECJ="$ECJ" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ECJ="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ECJ=$ac_cv_path_ECJ if test -n "$ECJ"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ECJ" >&5 $as_echo "$ECJ" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "${ECJ}"; then # Extract the first word of ""ecj-3.2"", so it can be a program name with args. set dummy "ecj-3.2"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ECJ+:} false; then : $as_echo_n "(cached) " >&6 else case $ECJ in [\\/]* | ?:[\\/]*) ac_cv_path_ECJ="$ECJ" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ECJ="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ECJ=$ac_cv_path_ECJ if test -n "$ECJ"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ECJ" >&5 $as_echo "$ECJ" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "${ECJ}"; then # Extract the first word of ""ecj-3.3"", so it can be a program name with args. set dummy "ecj-3.3"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ECJ+:} false; then : $as_echo_n "(cached) " >&6 else case $ECJ in [\\/]* | ?:[\\/]*) ac_cv_path_ECJ="$ECJ" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ECJ="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ECJ=$ac_cv_path_ECJ if test -n "$ECJ"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ECJ" >&5 $as_echo "$ECJ" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi fi if test "x${JAVAC}" = "x"; then if test "x{ECJ}" != "x"; then JAVAC="${ECJ} -nowarn" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we are using ecj as javac" >&5 $as_echo_n "checking if we are using ecj as javac... " >&6; } if ${it_cv_ecj+:} false; then : $as_echo_n "(cached) " >&6 else if $JAVAC -version 2>&1| grep '^Eclipse' >&5 ; then it_cv_ecj=yes; else it_cv_ecj=no; fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $it_cv_ecj" >&5 $as_echo "$it_cv_ecj" >&6; } USING_ECJ=$it_cv_ecj { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jar" >&5 $as_echo_n "checking for jar... " >&6; } # Check whether --with-jar was given. if test "${with_jar+set}" = set; then : withval=$with_jar; JAR="${withval}" else JAR=${SYSTEM_JDK_DIR}/bin/jar fi if ! test -f "${JAR}"; then # Extract the first word of ""${JAR}"", so it can be a program name with args. set dummy "${JAR}"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_JAR+:} false; then : $as_echo_n "(cached) " >&6 else case $JAR in [\\/]* | ?:[\\/]*) ac_cv_path_JAR="$JAR" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_JAR="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi JAR=$ac_cv_path_JAR if test -n "$JAR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAR" >&5 $as_echo "$JAR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "${JAR}"; then # Extract the first word of ""gjar"", so it can be a program name with args. set dummy "gjar"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_JAR+:} false; then : $as_echo_n "(cached) " >&6 else case $JAR in [\\/]* | ?:[\\/]*) ac_cv_path_JAR="$JAR" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_JAR="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi JAR=$ac_cv_path_JAR if test -n "$JAR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAR" >&5 $as_echo "$JAR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "${JAR}"; then # Extract the first word of ""jar"", so it can be a program name with args. set dummy "jar"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_JAR+:} false; then : $as_echo_n "(cached) " >&6 else case $JAR in [\\/]* | ?:[\\/]*) ac_cv_path_JAR="$JAR" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_JAR="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi JAR=$ac_cv_path_JAR if test -n "$JAR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAR" >&5 $as_echo "$JAR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "${JAR}"; then as_fn_error $? "\"No Java archive tool was found.\"" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${JAR}" >&5 $as_echo "${JAR}" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether jar supports @ argument" >&5 $as_echo_n "checking whether jar supports @ argument... " >&6; } touch _config.txt cat >_config.list <&5 2>&1; then JAR_KNOWS_ATFILE=1 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else JAR_KNOWS_ATFILE= { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether jar supports stdin file arguments" >&5 $as_echo_n "checking whether jar supports stdin file arguments... " >&6; } if cat _config.list | $JAR cf@ _config.jar >&5 2>&1; then JAR_ACCEPTS_STDIN_LIST=1 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else JAR_ACCEPTS_STDIN_LIST= { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f _config.list _config.jar { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether jar supports -J options at the end" >&5 $as_echo_n "checking whether jar supports -J options at the end... " >&6; } if $JAR cf _config.jar _config.txt -J-Xmx896m >&5 2>&1; then JAR_KNOWS_J_OPTIONS=1 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else JAR_KNOWS_J_OPTIONS= { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f _config.txt _config.jar { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ecj JAR file" >&5 $as_echo_n "checking for an ecj JAR file... " >&6; } # Check whether --with-ecj-jar was given. if test "${with_ecj_jar+set}" = set; then : withval=$with_ecj_jar; if test -f "${withval}"; then ECJ_JAR="${withval}" fi else ECJ_JAR= fi if test -z "${ECJ_JAR}"; then for jar in /usr/share/java/eclipse-ecj.jar \ /usr/share/java/ecj.jar \ /usr/share/eclipse-ecj-3.{2,3,4,5}/lib/ecj.jar; do if test -e $jar; then ECJ_JAR=$jar break fi done if test -z "${ECJ_JAR}"; then ECJ_JAR=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ECJ_JAR}" >&5 $as_echo "${ECJ_JAR}" >&6; } if test "x${JAVAC}" = x && test "x${ECJ_JAR}" = "xno" ; then as_fn_error $? "cannot find a Java compiler or ecj JAR file, try --with-javac, --with-ecj or --with-ecj-jar" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a JRE home directory" >&5 $as_echo_n "checking for a JRE home directory... " >&6; } # Check whether --with-jre-home was given. if test "${with_jre_home+set}" = set; then : withval=$with_jre_home; SYSTEM_JRE_DIR=${withval} else SYSTEM_JRE_DIR= fi if test -z "${SYSTEM_JRE_DIR}" ; then SYSTEM_JRE_DIR_EIGHT_AND_LESS="${SYSTEM_JDK_DIR}/jre" SYSTEM_JRE_DIR_MODULAR="${SYSTEM_JDK_DIR}" # try jdk8 or older compliant if test -d "${SYSTEM_JRE_DIR_EIGHT_AND_LESS}" -a -e "${SYSTEM_JRE_DIR_EIGHT_AND_LESS}/bin/java" -a -e "${SYSTEM_JRE_DIR_EIGHT_AND_LESS}/lib/rt.jar" ; then SYSTEM_JRE_DIR="${SYSTEM_JRE_DIR_EIGHT_AND_LESS}" fi # still not found? if test -z "${SYSTEM_JRE_DIR}" ; then # try modular, jdk9 or higher compliant if test -d "${SYSTEM_JRE_DIR_MODULAR}" -a -f "${SYSTEM_JRE_DIR_MODULAR}/bin/java" -a -d "${SYSTEM_JRE_DIR_MODULAR}/lib/modules" ; then SYSTEM_JRE_DIR="${SYSTEM_JRE_DIR_MODULAR}" fi fi fi if ! test -d "${SYSTEM_JRE_DIR}"; then as_fn_error $? "\"A JRE home directory could not be found. ${SYSTEM_JRE_DIR}\"" "$LINENO" 5 else READ=`readlink -f ${SYSTEM_JRE_DIR}` { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${SYSTEM_JRE_DIR} (link to ${READ})" >&5 $as_echo "${SYSTEM_JRE_DIR} (link to ${READ})" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a Java virtual machine" >&5 $as_echo_n "checking for a Java virtual machine... " >&6; } # Check whether --with-java was given. if test "${with_java+set}" = set; then : withval=$with_java; JAVA="${withval}" else JAVA="${SYSTEM_JRE_DIR}/bin/java" fi if ! test -f "${JAVA}"; then # Extract the first word of ""${JAVA}"", so it can be a program name with args. set dummy "${JAVA}"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_JAVA+:} false; then : $as_echo_n "(cached) " >&6 else case $JAVA in [\\/]* | ?:[\\/]*) ac_cv_path_JAVA="$JAVA" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_JAVA="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi JAVA=$ac_cv_path_JAVA if test -n "$JAVA"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVA" >&5 $as_echo "$JAVA" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "${JAVA}"; then # Extract the first word of ""java"", so it can be a program name with args. set dummy "java"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_JAVA+:} false; then : $as_echo_n "(cached) " >&6 else case $JAVA in [\\/]* | ?:[\\/]*) ac_cv_path_JAVA="$JAVA" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_JAVA="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi JAVA=$ac_cv_path_JAVA if test -n "$JAVA"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVA" >&5 $as_echo "$JAVA" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "${JAVA}"; then as_fn_error $? "\"A 1.7+-compatible Java VM is required.\"" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${JAVA}" >&5 $as_echo "${JAVA}" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking JDK version" >&5 $as_echo_n "checking JDK version... " >&6; } JAVA_VERSION=`$JAVA -version 2>&1 | sed -n '1s/[^"]*"\(.*\)"$/\1/p'` { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVA_VERSION" >&5 $as_echo "$JAVA_VERSION" >&6; } HAVE_JAVA7=`echo $JAVA_VERSION | awk '{if ($(0) >= 1.7) print "yes"}'` HAVE_JAVA8=`echo $JAVA_VERSION | awk '{if ($(0) >= 1.8) print "yes"}'` HAVE_JAVA9=`echo $JAVA_VERSION | awk '{if ($(0) >= 1.9) print "yes"}'` if test -z "$HAVE_JAVA7"; then as_fn_error $? "JDK7 or newer is required, detected was: $JAVA_VERSION" "$LINENO" 5 fi if ! test -z "$HAVE_JAVA8"; then VERSION_DEFS="-DHAVE_JAVA8" fi if ! test -z "$HAVE_JAVA9"; then VERSION_DEFS="-DHAVE_JAVA9" fi if test x"${HAVE_JAVA7}" = "xyes"; then HAVE_JAVA7_TRUE= HAVE_JAVA7_FALSE='#' else HAVE_JAVA7_TRUE='#' HAVE_JAVA7_FALSE= fi if test x"${HAVE_JAVA8}" = "xyes"; then HAVE_JAVA8_TRUE= HAVE_JAVA8_FALSE='#' else HAVE_JAVA8_TRUE='#' HAVE_JAVA8_FALSE= fi if test x"${HAVE_JAVA9}" = "xyes"; then HAVE_JAVA9_TRUE= HAVE_JAVA9_FALSE='#' else HAVE_JAVA9_TRUE='#' HAVE_JAVA9_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for javadoc" >&5 $as_echo_n "checking for javadoc... " >&6; } # Check whether --with-javadoc was given. if test "${with_javadoc+set}" = set; then : withval=$with_javadoc; JAVADOC="${withval}" else JAVADOC=${SYSTEM_JDK_DIR}/bin/javadoc fi if ! test -f "${JAVADOC}"; then # Extract the first word of ""${JAVADOC}"", so it can be a program name with args. set dummy "${JAVADOC}"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_JAVADOC+:} false; then : $as_echo_n "(cached) " >&6 else case $JAVADOC in [\\/]* | ?:[\\/]*) ac_cv_path_JAVADOC="$JAVADOC" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_JAVADOC="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi JAVADOC=$ac_cv_path_JAVADOC if test -n "$JAVADOC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVADOC" >&5 $as_echo "$JAVADOC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "${JAVADOC}"; then # Extract the first word of ""javadoc"", so it can be a program name with args. set dummy "javadoc"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_JAVADOC+:} false; then : $as_echo_n "(cached) " >&6 else case $JAVADOC in [\\/]* | ?:[\\/]*) ac_cv_path_JAVADOC="$JAVADOC" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_JAVADOC="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi JAVADOC=$ac_cv_path_JAVADOC if test -n "$JAVADOC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVADOC" >&5 $as_echo "$JAVADOC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "${JAVADOC}"; then # Extract the first word of ""gjdoc"", so it can be a program name with args. set dummy "gjdoc"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_JAVADOC+:} false; then : $as_echo_n "(cached) " >&6 else case $JAVADOC in [\\/]* | ?:[\\/]*) ac_cv_path_JAVADOC="$JAVADOC" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_JAVADOC="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi JAVADOC=$ac_cv_path_JAVADOC if test -n "$JAVADOC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVADOC" >&5 $as_echo "$JAVADOC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "${JAVADOC}" && test "x$ENABLE_DOCS" = "xyes"; then as_fn_error $? "\"No Java documentation tool was found.\"" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${JAVADOC}" >&5 $as_echo "${JAVADOC}" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether javadoc supports -J options" >&5 $as_echo_n "checking whether javadoc supports -J options... " >&6; } CLASS=pkg/Test.java mkdir tmp.$$ cd tmp.$$ mkdir pkg cat << \EOF > $CLASS /* [#]line 6404 "configure" */ package pkg; public class Test { /** * Does stuff. * * * @param args arguments from cli. */ public static void main(String[] args) { System.out.println("Hello World!"); } } EOF if $JAVADOC -J-Xmx896m pkg >&5 2>&1; then JAVADOC_KNOWS_J_OPTIONS=yes else JAVADOC_KNOWS_J_OPTIONS=no fi cd .. rm -rf tmp.$$ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${JAVADOC_KNOWS_J_OPTIONS}" >&5 $as_echo "${JAVADOC_KNOWS_J_OPTIONS}" >&6; } if test x"${JAVADOC_KNOWS_J_OPTIONS}" = "xyes"; then JAVADOC_SUPPORTS_J_OPTIONS_TRUE= JAVADOC_SUPPORTS_J_OPTIONS_FALSE='#' else JAVADOC_SUPPORTS_J_OPTIONS_TRUE='#' JAVADOC_SUPPORTS_J_OPTIONS_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for keytool" >&5 $as_echo_n "checking for keytool... " >&6; } # Check whether --with-keytool was given. if test "${with_keytool+set}" = set; then : withval=$with_keytool; if test "${withval}" = "yes" ; then KEYTOOL=${SYSTEM_JDK_DIR}/bin/keytool else KEYTOOL="${withval}" fi else KEYTOOL=${SYSTEM_JDK_DIR}/bin/keytool fi if ! test -f "${KEYTOOL}"; then # Extract the first word of "keytool", so it can be a program name with args. set dummy keytool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_KEYTOOL+:} false; then : $as_echo_n "(cached) " >&6 else case $KEYTOOL in [\\/]* | ?:[\\/]*) ac_cv_path_KEYTOOL="$KEYTOOL" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_KEYTOOL="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi KEYTOOL=$ac_cv_path_KEYTOOL if test -n "$KEYTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $KEYTOOL" >&5 $as_echo "$KEYTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if ! test -f "${KEYTOOL}"; then KEYTOOL="" fi if test -z "${KEYTOOL}" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"keytool not found so signed part of run-netx-dist will fail\"" >&5 $as_echo "$as_me: WARNING: \"keytool not found so signed part of run-netx-dist will fail\"" >&2;} fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${KEYTOOL}" >&5 $as_echo "${KEYTOOL}" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jarsigner" >&5 $as_echo_n "checking for jarsigner... " >&6; } # Check whether --with-jarsigner was given. if test "${with_jarsigner+set}" = set; then : withval=$with_jarsigner; if test "${withval}" = "yes" ; then JARSIGNER=${SYSTEM_JDK_DIR}/bin/jarsigner else JARSIGNER="${withval}" fi else JARSIGNER=${SYSTEM_JDK_DIR}/bin/jarsigner fi if ! test -f "${JARSIGNER}"; then # Extract the first word of "jarsigner", so it can be a program name with args. set dummy jarsigner; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_JARSIGNER+:} false; then : $as_echo_n "(cached) " >&6 else case $JARSIGNER in [\\/]* | ?:[\\/]*) ac_cv_path_JARSIGNER="$JARSIGNER" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_JARSIGNER="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_JARSIGNER" && ac_cv_path_JARSIGNER="""" ;; esac fi JARSIGNER=$ac_cv_path_JARSIGNER if test -n "$JARSIGNER"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JARSIGNER" >&5 $as_echo "$JARSIGNER" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if ! test -f "${JARSIGNER}"; then JARSIGNER="" fi if test -z "${JARSIGNER}"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"jarsigner not found so signed part of run-netx-dist will fail\"" >&5 $as_echo "$as_me: WARNING: \"jarsigner not found so signed part of run-netx-dist will fail\"" >&2;} fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${JARSIGNER}" >&5 $as_echo "${JARSIGNER}" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pack200" >&5 $as_echo_n "checking for pack200... " >&6; } # Check whether --with-pack200 was given. if test "${with_pack200+set}" = set; then : withval=$with_pack200; if test "${withval}" = "yes" ; then PACK200=${SYSTEM_JDK_DIR}/bin/pack200 else PACK200="${withval}" fi else PACK200=${SYSTEM_JDK_DIR}/bin/pack200 fi if ! test -f "${PACK200}"; then # Extract the first word of "pack200", so it can be a program name with args. set dummy pack200; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PACK200+:} false; then : $as_echo_n "(cached) " >&6 else case $PACK200 in [\\/]* | ?:[\\/]*) ac_cv_path_PACK200="$PACK200" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PACK200="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PACK200=$ac_cv_path_PACK200 if test -n "$PACK200"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PACK200" >&5 $as_echo "$PACK200" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if ! test -f "${PACK200}"; then PACK200="" fi if test -z "${PACK200}" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"pack200 not found so custom part of run-netx-dist will fail\"" >&5 $as_echo "$as_me: WARNING: \"pack200 not found so custom part of run-netx-dist will fail\"" >&2;} fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${PACK200}" >&5 $as_echo "${PACK200}" >&6; } if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}hg", so it can be a program name with args. set dummy ${ac_tool_prefix}hg; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_HG+:} false; then : $as_echo_n "(cached) " >&6 else case $HG in [\\/]* | ?:[\\/]*) ac_cv_path_HG="$HG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_HG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi HG=$ac_cv_path_HG if test -n "$HG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HG" >&5 $as_echo "$HG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_HG"; then ac_pt_HG=$HG # Extract the first word of "hg", so it can be a program name with args. set dummy hg; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_HG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_HG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_HG="$ac_pt_HG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_HG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_HG=$ac_cv_path_ac_pt_HG if test -n "$ac_pt_HG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_HG" >&5 $as_echo "$ac_pt_HG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_HG" = x; then HG="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac HG=$ac_pt_HG fi else HG="$ac_cv_path_HG" fi ICEDTEA_REVISION="none"; if which ${HG} >&5 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IcedTea Mercurial revision ID" >&5 $as_echo_n "checking for IcedTea Mercurial revision ID... " >&6; } if test -e ${abs_top_srcdir}/.hg ; then ICEDTEA_REVISION="r`(cd ${abs_top_srcdir}; ${HG} id -i)`" ; fi ; { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ICEDTEA_REVISION}" >&5 $as_echo "${ICEDTEA_REVISION}" >&6; } fi; if test "x${ICEDTEA_REVISION}" != xnone; then HAS_ICEDTEA_REVISION_TRUE= HAS_ICEDTEA_REVISION_FALSE='#' else HAS_ICEDTEA_REVISION_TRUE='#' HAS_ICEDTEA_REVISION_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for distribution package version" >&5 $as_echo_n "checking for distribution package version... " >&6; } # Check whether --with-pkgversion was given. if test "${with_pkgversion+set}" = set; then : withval=$with_pkgversion; case "$withval" in yes) as_fn_error $? "package version not specified" "$LINENO" 5 ;; no) PKGVERSION=none ;; *) PKGVERSION="$withval" ;; esac else PKGVERSION=none fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${PKGVERSION}" >&5 $as_echo "${PKGVERSION}" >&6; } if test "x${PKGVERSION}" != "xnone"; then HAS_PKGVERSION_TRUE= HAS_PKGVERSION_FALSE='#' else HAS_PKGVERSION_TRUE='#' HAS_PKGVERSION_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking what version string to use" >&5 $as_echo_n "checking what version string to use... " >&6; } if test "x${ICEDTEA_REVISION}" != xnone; then ICEDTEA_REV="+${ICEDTEA_REVISION}" fi if test "x${PKGVERSION}" != "xnone"; then ICEDTEA_PKG=" (${PKGVERSION})" fi FULL_VERSION="${PACKAGE_VERSION}${ICEDTEA_REV}${ICEDTEA_PKG}" { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${FULL_VERSION}" >&5 $as_echo "${FULL_VERSION}" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build the browser plugin" >&5 $as_echo_n "checking whether to build the browser plugin... " >&6; } # Check whether --enable-plugin was given. if test "${enable_plugin+set}" = set; then : enableval=$enable_plugin; enable_plugin="${enableval}" else enable_plugin="yes" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${enable_plugin}" >&5 $as_echo "${enable_plugin}" >&6; } if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 $as_echo "$ac_pt_PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } PKG_CONFIG="" fi fi if test "x${enable_plugin}" = "xyes" ; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLIB" >&5 $as_echo_n "checking for GLIB... " >&6; } if test -n "$GLIB_CFLAGS"; then pkg_cv_GLIB_CFLAGS="$GLIB_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "glib-2.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GLIB_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$GLIB_LIBS"; then pkg_cv_GLIB_LIBS="$GLIB_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "glib-2.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GLIB_LIBS=`$PKG_CONFIG --libs "glib-2.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then GLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glib-2.0" 2>&1` else GLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glib-2.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GLIB_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (glib-2.0) were not met: $GLIB_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables GLIB_CFLAGS and GLIB_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables GLIB_CFLAGS and GLIB_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else GLIB_CFLAGS=$pkg_cv_GLIB_CFLAGS GLIB_LIBS=$pkg_cv_GLIB_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MOZILLA" >&5 $as_echo_n "checking for MOZILLA... " >&6; } if test -n "$MOZILLA_CFLAGS"; then pkg_cv_MOZILLA_CFLAGS="$MOZILLA_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"npapi-sdk\""; } >&5 ($PKG_CONFIG --exists --print-errors "npapi-sdk") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_MOZILLA_CFLAGS=`$PKG_CONFIG --cflags "npapi-sdk" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$MOZILLA_LIBS"; then pkg_cv_MOZILLA_LIBS="$MOZILLA_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"npapi-sdk\""; } >&5 ($PKG_CONFIG --exists --print-errors "npapi-sdk") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_MOZILLA_LIBS=`$PKG_CONFIG --libs "npapi-sdk" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then MOZILLA_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "npapi-sdk" 2>&1` else MOZILLA_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "npapi-sdk" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$MOZILLA_PKG_ERRORS" >&5 pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MOZILLA" >&5 $as_echo_n "checking for MOZILLA... " >&6; } if test -n "$MOZILLA_CFLAGS"; then pkg_cv_MOZILLA_CFLAGS="$MOZILLA_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"mozilla-plugin\""; } >&5 ($PKG_CONFIG --exists --print-errors "mozilla-plugin") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_MOZILLA_CFLAGS=`$PKG_CONFIG --cflags "mozilla-plugin" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$MOZILLA_LIBS"; then pkg_cv_MOZILLA_LIBS="$MOZILLA_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"mozilla-plugin\""; } >&5 ($PKG_CONFIG --exists --print-errors "mozilla-plugin") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_MOZILLA_LIBS=`$PKG_CONFIG --libs "mozilla-plugin" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then MOZILLA_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "mozilla-plugin" 2>&1` else MOZILLA_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "mozilla-plugin" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$MOZILLA_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (mozilla-plugin) were not met: $MOZILLA_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables MOZILLA_CFLAGS and MOZILLA_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables MOZILLA_CFLAGS and MOZILLA_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else MOZILLA_CFLAGS=$pkg_cv_MOZILLA_CFLAGS MOZILLA_LIBS=$pkg_cv_MOZILLA_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MOZILLA" >&5 $as_echo_n "checking for MOZILLA... " >&6; } if test -n "$MOZILLA_CFLAGS"; then pkg_cv_MOZILLA_CFLAGS="$MOZILLA_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"mozilla-plugin\""; } >&5 ($PKG_CONFIG --exists --print-errors "mozilla-plugin") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_MOZILLA_CFLAGS=`$PKG_CONFIG --cflags "mozilla-plugin" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$MOZILLA_LIBS"; then pkg_cv_MOZILLA_LIBS="$MOZILLA_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"mozilla-plugin\""; } >&5 ($PKG_CONFIG --exists --print-errors "mozilla-plugin") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_MOZILLA_LIBS=`$PKG_CONFIG --libs "mozilla-plugin" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then MOZILLA_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "mozilla-plugin" 2>&1` else MOZILLA_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "mozilla-plugin" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$MOZILLA_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (mozilla-plugin) were not met: $MOZILLA_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables MOZILLA_CFLAGS and MOZILLA_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables MOZILLA_CFLAGS and MOZILLA_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else MOZILLA_CFLAGS=$pkg_cv_MOZILLA_CFLAGS MOZILLA_LIBS=$pkg_cv_MOZILLA_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi else MOZILLA_CFLAGS=$pkg_cv_MOZILLA_CFLAGS MOZILLA_LIBS=$pkg_cv_MOZILLA_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xulrunner version" >&5 $as_echo_n "checking for xulrunner version... " >&6; } if ${xulrunner_cv_collapsed_version+:} false; then : $as_echo_n "(cached) " >&6 else # XXX: use NPAPI versions instead xulrunner_cv_collapsed_version=20000000 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xulrunner_cv_collapsed_version" >&5 $as_echo "$xulrunner_cv_collapsed_version" >&6; } fi fi if test "x${enable_plugin}" = "xyes"; then ENABLE_PLUGIN_TRUE= ENABLE_PLUGIN_FALSE='#' else ENABLE_PLUGIN_TRUE='#' ENABLE_PLUGIN_FALSE= fi if test "x${enable_plugin}" = "xyes" then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xulrunner version" >&5 $as_echo_n "checking for xulrunner version... " >&6; } if ${xulrunner_cv_collapsed_version+:} false; then : $as_echo_n "(cached) " >&6 else if pkg-config --modversion libxul >/dev/null 2>&1 then xulrunner_cv_collapsed_version=`pkg-config --modversion libxul | awk -F. '{power=6; v=0; for (i=1; i <= NF; i++) {v += $i * 10 ^ power; power -=2}; print v}'` elif pkg-config --modversion mozilla-plugin >/dev/null 2>&1 then xulrunner_cv_collapsed_version=`pkg-config --modversion mozilla-plugin | awk -F. '{power=6; v=0; for (i=1; i <= NF; i++) {v += $i * 10 ^ power; power -=2}; print v}'` else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot determine xulrunner version See \`config.log' for more details" "$LINENO" 5; } fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xulrunner_cv_collapsed_version" >&5 $as_echo "$xulrunner_cv_collapsed_version" >&6; } MOZILLA_VERSION_COLLAPSED=$xulrunner_cv_collapsed_version fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lz" >&5 $as_echo_n "checking for main in -lz... " >&6; } if ${ac_cv_lib_z_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lz $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_z_main=yes else ac_cv_lib_z_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_main" >&5 $as_echo "$ac_cv_lib_z_main" >&6; } if test "x$ac_cv_lib_z_main" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBZ 1 _ACEOF LIBS="-lz $LIBS" else as_fn_error $? "\"zlib not found - try installing zlib-devel\"" "$LINENO" 5 fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X11" >&5 $as_echo_n "checking for X11... " >&6; } if test -n "$X11_CFLAGS"; then pkg_cv_X11_CFLAGS="$X11_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11\""; } >&5 ($PKG_CONFIG --exists --print-errors "x11") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_X11_CFLAGS=`$PKG_CONFIG --cflags "x11" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$X11_LIBS"; then pkg_cv_X11_LIBS="$X11_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11\""; } >&5 ($PKG_CONFIG --exists --print-errors "x11") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_X11_LIBS=`$PKG_CONFIG --libs "x11" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then X11_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "x11" 2>&1` else X11_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "x11" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$X11_PKG_ERRORS" >&5 X11_FOUND=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } X11_FOUND=no else X11_CFLAGS=$pkg_cv_X11_CFLAGS X11_LIBS=$pkg_cv_X11_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } X11_FOUND=yes fi if test "x${X11_FOUND}" = xno then as_fn_error $? "Could not find x11 - \ Try installing libX11-devel." "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if java.util.jar.Pack200 is available" >&5 $as_echo_n "checking if java.util.jar.Pack200 is available... " >&6; } if ${it_cv_JAVA_UTIL_JAR_PACK200+:} false; then : $as_echo_n "(cached) " >&6 else CLASS=sun/applet/Test.java BYTECODE=$(echo $CLASS|sed 's#\.java##') mkdir -p tmp.$$/$(dirname $CLASS) cd tmp.$$ cat << \EOF > $CLASS /* [#]line 7505 "configure" */ package sun.applet; import java.util.jar.Pack200; public class Test { public static void main(String[] args) throws Exception { System.out.println(Class.forName("java.util.jar.Pack200")); } } EOF if $JAVAC -cp . $JAVACFLAGS -nowarn $CLASS >&5 2>&1; then if $JAVA -classpath . $BYTECODE >&5 2>&1; then it_cv_JAVA_UTIL_JAR_PACK200=yes; else it_cv_JAVA_UTIL_JAR_PACK200=no; fi else it_cv_JAVA_UTIL_JAR_PACK200=no; fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $it_cv_JAVA_UTIL_JAR_PACK200" >&5 $as_echo "$it_cv_JAVA_UTIL_JAR_PACK200" >&6; } rm -f $CLASS *.class cd .. # should be rmdir but has to be rm -rf due to sun.applet usage rm -rf tmp.$$ if test x"${it_cv_JAVA_UTIL_JAR_PACK200}" = "xno"; then as_fn_error $? "java.util.jar.Pack200 not found." "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if java.net.CookieManager is available" >&5 $as_echo_n "checking if java.net.CookieManager is available... " >&6; } if ${it_cv_JAVA_NET_COOKIEMANAGER+:} false; then : $as_echo_n "(cached) " >&6 else CLASS=sun/applet/Test.java BYTECODE=$(echo $CLASS|sed 's#\.java##') mkdir -p tmp.$$/$(dirname $CLASS) cd tmp.$$ cat << \EOF > $CLASS /* [#]line 7555 "configure" */ package sun.applet; import java.net.CookieManager; public class Test { public static void main(String[] args) throws Exception { System.out.println(Class.forName("java.net.CookieManager")); } } EOF if $JAVAC -cp . $JAVACFLAGS -nowarn $CLASS >&5 2>&1; then if $JAVA -classpath . $BYTECODE >&5 2>&1; then it_cv_JAVA_NET_COOKIEMANAGER=yes; else it_cv_JAVA_NET_COOKIEMANAGER=no; fi else it_cv_JAVA_NET_COOKIEMANAGER=no; fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $it_cv_JAVA_NET_COOKIEMANAGER" >&5 $as_echo "$it_cv_JAVA_NET_COOKIEMANAGER" >&6; } rm -f $CLASS *.class cd .. # should be rmdir but has to be rm -rf due to sun.applet usage rm -rf tmp.$$ if test x"${it_cv_JAVA_NET_COOKIEMANAGER}" = "xno"; then as_fn_error $? "java.net.CookieManager not found." "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if java.net.HttpCookie is available" >&5 $as_echo_n "checking if java.net.HttpCookie is available... " >&6; } if ${it_cv_JAVA_NET_HTTPCOOKIE+:} false; then : $as_echo_n "(cached) " >&6 else CLASS=sun/applet/Test.java BYTECODE=$(echo $CLASS|sed 's#\.java##') mkdir -p tmp.$$/$(dirname $CLASS) cd tmp.$$ cat << \EOF > $CLASS /* [#]line 7605 "configure" */ package sun.applet; import java.net.HttpCookie; public class Test { public static void main(String[] args) throws Exception { System.out.println(Class.forName("java.net.HttpCookie")); } } EOF if $JAVAC -cp . $JAVACFLAGS -nowarn $CLASS >&5 2>&1; then if $JAVA -classpath . $BYTECODE >&5 2>&1; then it_cv_JAVA_NET_HTTPCOOKIE=yes; else it_cv_JAVA_NET_HTTPCOOKIE=no; fi else it_cv_JAVA_NET_HTTPCOOKIE=no; fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $it_cv_JAVA_NET_HTTPCOOKIE" >&5 $as_echo "$it_cv_JAVA_NET_HTTPCOOKIE" >&6; } rm -f $CLASS *.class cd .. # should be rmdir but has to be rm -rf due to sun.applet usage rm -rf tmp.$$ if test x"${it_cv_JAVA_NET_HTTPCOOKIE}" = "xno"; then as_fn_error $? "java.net.HttpCookie not found." "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if java.net.CookieHandler is available" >&5 $as_echo_n "checking if java.net.CookieHandler is available... " >&6; } if ${it_cv_JAVA_NET_COOKIEHANDLER+:} false; then : $as_echo_n "(cached) " >&6 else CLASS=sun/applet/Test.java BYTECODE=$(echo $CLASS|sed 's#\.java##') mkdir -p tmp.$$/$(dirname $CLASS) cd tmp.$$ cat << \EOF > $CLASS /* [#]line 7655 "configure" */ package sun.applet; import java.net.CookieHandler; public class Test { public static void main(String[] args) throws Exception { System.out.println(Class.forName("java.net.CookieHandler")); } } EOF if $JAVAC -cp . $JAVACFLAGS -nowarn $CLASS >&5 2>&1; then if $JAVA -classpath . $BYTECODE >&5 2>&1; then it_cv_JAVA_NET_COOKIEHANDLER=yes; else it_cv_JAVA_NET_COOKIEHANDLER=no; fi else it_cv_JAVA_NET_COOKIEHANDLER=no; fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $it_cv_JAVA_NET_COOKIEHANDLER" >&5 $as_echo "$it_cv_JAVA_NET_COOKIEHANDLER" >&6; } rm -f $CLASS *.class cd .. # should be rmdir but has to be rm -rf due to sun.applet usage rm -rf tmp.$$ if test x"${it_cv_JAVA_NET_COOKIEHANDLER}" = "xno"; then as_fn_error $? "java.net.CookieHandler not found." "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if sun.security.provider.X509Factory is available" >&5 $as_echo_n "checking if sun.security.provider.X509Factory is available... " >&6; } if ${it_cv_SUN_SECURITY_PROVIDER_X509FACTORY+:} false; then : $as_echo_n "(cached) " >&6 else CLASS=sun/applet/Test.java BYTECODE=$(echo $CLASS|sed 's#\.java##') mkdir -p tmp.$$/$(dirname $CLASS) cd tmp.$$ cat << \EOF > $CLASS /* [#]line 7705 "configure" */ package sun.applet; import sun.security.provider.X509Factory; public class Test { public static void main(String[] args) throws Exception { System.out.println(Class.forName("sun.security.provider.X509Factory")); } } EOF if $JAVAC -cp . $JAVACFLAGS -nowarn $CLASS >&5 2>&1; then if $JAVA -classpath . $BYTECODE >&5 2>&1; then it_cv_SUN_SECURITY_PROVIDER_X509FACTORY=yes; else it_cv_SUN_SECURITY_PROVIDER_X509FACTORY=no; fi else it_cv_SUN_SECURITY_PROVIDER_X509FACTORY=no; fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $it_cv_SUN_SECURITY_PROVIDER_X509FACTORY" >&5 $as_echo "$it_cv_SUN_SECURITY_PROVIDER_X509FACTORY" >&6; } rm -f $CLASS *.class cd .. # should be rmdir but has to be rm -rf due to sun.applet usage rm -rf tmp.$$ if test x"${it_cv_SUN_SECURITY_PROVIDER_X509FACTORY}" = "xno"; then as_fn_error $? "sun.security.provider.X509Factory not found." "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if sun.security.util.SecurityConstants is available" >&5 $as_echo_n "checking if sun.security.util.SecurityConstants is available... " >&6; } if ${it_cv_SUN_SECURITY_UTIL_SECURITYCONSTANTS+:} false; then : $as_echo_n "(cached) " >&6 else CLASS=sun/applet/Test.java BYTECODE=$(echo $CLASS|sed 's#\.java##') mkdir -p tmp.$$/$(dirname $CLASS) cd tmp.$$ cat << \EOF > $CLASS /* [#]line 7755 "configure" */ package sun.applet; import sun.security.util.SecurityConstants; public class Test { public static void main(String[] args) throws Exception { System.out.println(Class.forName("sun.security.util.SecurityConstants")); } } EOF if $JAVAC -cp . $JAVACFLAGS -nowarn $CLASS >&5 2>&1; then if $JAVA -classpath . $BYTECODE >&5 2>&1; then it_cv_SUN_SECURITY_UTIL_SECURITYCONSTANTS=yes; else it_cv_SUN_SECURITY_UTIL_SECURITYCONSTANTS=no; fi else it_cv_SUN_SECURITY_UTIL_SECURITYCONSTANTS=no; fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $it_cv_SUN_SECURITY_UTIL_SECURITYCONSTANTS" >&5 $as_echo "$it_cv_SUN_SECURITY_UTIL_SECURITYCONSTANTS" >&6; } rm -f $CLASS *.class cd .. # should be rmdir but has to be rm -rf due to sun.applet usage rm -rf tmp.$$ if test x"${it_cv_SUN_SECURITY_UTIL_SECURITYCONSTANTS}" = "xno"; then as_fn_error $? "sun.security.util.SecurityConstants not found." "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if sun.security.util.HostnameChecker is available" >&5 $as_echo_n "checking if sun.security.util.HostnameChecker is available... " >&6; } if ${it_cv_SUN_SECURITY_UTIL_HOSTNAMECHECKER+:} false; then : $as_echo_n "(cached) " >&6 else CLASS=sun/applet/Test.java BYTECODE=$(echo $CLASS|sed 's#\.java##') mkdir -p tmp.$$/$(dirname $CLASS) cd tmp.$$ cat << \EOF > $CLASS /* [#]line 7805 "configure" */ package sun.applet; import sun.security.util.HostnameChecker; public class Test { public static void main(String[] args) throws Exception { System.out.println(Class.forName("sun.security.util.HostnameChecker")); } } EOF if $JAVAC -cp . $JAVACFLAGS -nowarn $CLASS >&5 2>&1; then if $JAVA -classpath . $BYTECODE >&5 2>&1; then it_cv_SUN_SECURITY_UTIL_HOSTNAMECHECKER=yes; else it_cv_SUN_SECURITY_UTIL_HOSTNAMECHECKER=no; fi else it_cv_SUN_SECURITY_UTIL_HOSTNAMECHECKER=no; fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $it_cv_SUN_SECURITY_UTIL_HOSTNAMECHECKER" >&5 $as_echo "$it_cv_SUN_SECURITY_UTIL_HOSTNAMECHECKER" >&6; } rm -f $CLASS *.class cd .. # should be rmdir but has to be rm -rf due to sun.applet usage rm -rf tmp.$$ if test x"${it_cv_SUN_SECURITY_UTIL_HOSTNAMECHECKER}" = "xno"; then as_fn_error $? "sun.security.util.HostnameChecker not found." "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if sun.security.x509.X500Name is available" >&5 $as_echo_n "checking if sun.security.x509.X500Name is available... " >&6; } if ${it_cv_SUN_SECURITY_X509_X500NAME+:} false; then : $as_echo_n "(cached) " >&6 else CLASS=sun/applet/Test.java BYTECODE=$(echo $CLASS|sed 's#\.java##') mkdir -p tmp.$$/$(dirname $CLASS) cd tmp.$$ cat << \EOF > $CLASS /* [#]line 7855 "configure" */ package sun.applet; import sun.security.x509.X500Name; public class Test { public static void main(String[] args) throws Exception { System.out.println(Class.forName("sun.security.x509.X500Name")); } } EOF if $JAVAC -cp . $JAVACFLAGS -nowarn $CLASS >&5 2>&1; then if $JAVA -classpath . $BYTECODE >&5 2>&1; then it_cv_SUN_SECURITY_X509_X500NAME=yes; else it_cv_SUN_SECURITY_X509_X500NAME=no; fi else it_cv_SUN_SECURITY_X509_X500NAME=no; fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $it_cv_SUN_SECURITY_X509_X500NAME" >&5 $as_echo "$it_cv_SUN_SECURITY_X509_X500NAME" >&6; } rm -f $CLASS *.class cd .. # should be rmdir but has to be rm -rf due to sun.applet usage rm -rf tmp.$$ if test x"${it_cv_SUN_SECURITY_X509_X500NAME}" = "xno"; then as_fn_error $? "sun.security.x509.X500Name not found." "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if HexDumpEncoder is available" >&5 $as_echo_n "checking if HexDumpEncoder is available... " >&6; } if ${it_cv_HEXDUMPENCODER+:} false; then : $as_echo_n "(cached) " >&6 else CLASS=sun/applet/Test.java BYTECODE=$(echo $CLASS|sed 's#\.java##') mkdir -p tmp.$$/$(dirname $CLASS) cd tmp.$$ cat << \EOF > $CLASS /* [#]line 7905 "configure" */ package sun.applet; import sun.misc.*; import sun.security.util.*; public class Test { public static void main(String[] args) throws Exception { try { System.out.println(Class.forName("sun.misc.HexDumpEncoder")); } catch (ClassNotFoundException e) { System.out.println(Class.forName("sun.security.util.HexDumpEncoder")); } } } EOF if $JAVAC -cp . $JAVACFLAGS -nowarn $CLASS >&5 2>&1; then if $JAVA -classpath . $BYTECODE >&5 2>&1; then it_cv_HEXDUMPENCODER=yes; else it_cv_HEXDUMPENCODER=no; fi else it_cv_HEXDUMPENCODER=no; fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $it_cv_HEXDUMPENCODER" >&5 $as_echo "$it_cv_HEXDUMPENCODER" >&6; } rm -f $CLASS *.class cd .. # should be rmdir but has to be rm -rf due to sun.applet usage rm -rf tmp.$$ if test x"${it_cv_HEXDUMPENCODER}" = "xno"; then as_fn_error $? "HexDumpEncoder not found." "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if sun.security.validator.ValidatorException is available" >&5 $as_echo_n "checking if sun.security.validator.ValidatorException is available... " >&6; } if ${it_cv_SUN_SECURITY_VALIDATOR_VALIDATOREXCEPTION+:} false; then : $as_echo_n "(cached) " >&6 else CLASS=sun/applet/Test.java BYTECODE=$(echo $CLASS|sed 's#\.java##') mkdir -p tmp.$$/$(dirname $CLASS) cd tmp.$$ cat << \EOF > $CLASS /* [#]line 7960 "configure" */ package sun.applet; import sun.security.validator.ValidatorException; public class Test { public static void main(String[] args) throws Exception { System.out.println(Class.forName("sun.security.validator.ValidatorException")); } } EOF if $JAVAC -cp . $JAVACFLAGS -nowarn $CLASS >&5 2>&1; then if $JAVA -classpath . $BYTECODE >&5 2>&1; then it_cv_SUN_SECURITY_VALIDATOR_VALIDATOREXCEPTION=yes; else it_cv_SUN_SECURITY_VALIDATOR_VALIDATOREXCEPTION=no; fi else it_cv_SUN_SECURITY_VALIDATOR_VALIDATOREXCEPTION=no; fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $it_cv_SUN_SECURITY_VALIDATOR_VALIDATOREXCEPTION" >&5 $as_echo "$it_cv_SUN_SECURITY_VALIDATOR_VALIDATOREXCEPTION" >&6; } rm -f $CLASS *.class cd .. # should be rmdir but has to be rm -rf due to sun.applet usage rm -rf tmp.$$ if test x"${it_cv_SUN_SECURITY_VALIDATOR_VALIDATOREXCEPTION}" = "xno"; then as_fn_error $? "sun.security.validator.ValidatorException not found." "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if com.sun.net.ssl.internal.ssl.X509ExtendedTrustManager is available" >&5 $as_echo_n "checking if com.sun.net.ssl.internal.ssl.X509ExtendedTrustManager is available... " >&6; } if ${it_cv_COM_SUN_NET_SSL_INTERNAL_SSL_X509EXTENDEDTRUSTMANAGER+:} false; then : $as_echo_n "(cached) " >&6 else CLASS=sun/applet/Test.java BYTECODE=$(echo $CLASS|sed 's#\.java##') mkdir -p tmp.$$/$(dirname $CLASS) cd tmp.$$ cat << \EOF > $CLASS /* [#]line 8010 "configure" */ package sun.applet; import com.sun.net.ssl.internal.ssl.X509ExtendedTrustManager; public class Test { public static void main(String[] args) throws Exception { System.out.println(Class.forName("com.sun.net.ssl.internal.ssl.X509ExtendedTrustManager")); } } EOF if $JAVAC -cp . $JAVACFLAGS -nowarn $CLASS >&5 2>&1; then if $JAVA -classpath . $BYTECODE >&5 2>&1; then it_cv_COM_SUN_NET_SSL_INTERNAL_SSL_X509EXTENDEDTRUSTMANAGER=yes; else it_cv_COM_SUN_NET_SSL_INTERNAL_SSL_X509EXTENDEDTRUSTMANAGER=no; fi else it_cv_COM_SUN_NET_SSL_INTERNAL_SSL_X509EXTENDEDTRUSTMANAGER=no; fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $it_cv_COM_SUN_NET_SSL_INTERNAL_SSL_X509EXTENDEDTRUSTMANAGER" >&5 $as_echo "$it_cv_COM_SUN_NET_SSL_INTERNAL_SSL_X509EXTENDEDTRUSTMANAGER" >&6; } rm -f $CLASS *.class cd .. # should be rmdir but has to be rm -rf due to sun.applet usage rm -rf tmp.$$ if test x"${it_cv_COM_SUN_NET_SSL_INTERNAL_SSL_X509EXTENDEDTRUSTMANAGER}" = "xno"; then as_fn_error $? "com.sun.net.ssl.internal.ssl.X509ExtendedTrustManager not found." "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if sun.net.www.protocol.jar.URLJarFile is available" >&5 $as_echo_n "checking if sun.net.www.protocol.jar.URLJarFile is available... " >&6; } if ${it_cv_SUN_NET_WWW_PROTOCOL_JAR_URLJARFILE+:} false; then : $as_echo_n "(cached) " >&6 else CLASS=sun/applet/Test.java BYTECODE=$(echo $CLASS|sed 's#\.java##') mkdir -p tmp.$$/$(dirname $CLASS) cd tmp.$$ cat << \EOF > $CLASS /* [#]line 8060 "configure" */ package sun.applet; import sun.net.www.protocol.jar.URLJarFile; public class Test { public static void main(String[] args) throws Exception { System.out.println(Class.forName("sun.net.www.protocol.jar.URLJarFile")); } } EOF if $JAVAC -cp . $JAVACFLAGS -nowarn $CLASS >&5 2>&1; then if $JAVA -classpath . $BYTECODE >&5 2>&1; then it_cv_SUN_NET_WWW_PROTOCOL_JAR_URLJARFILE=yes; else it_cv_SUN_NET_WWW_PROTOCOL_JAR_URLJARFILE=no; fi else it_cv_SUN_NET_WWW_PROTOCOL_JAR_URLJARFILE=no; fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $it_cv_SUN_NET_WWW_PROTOCOL_JAR_URLJARFILE" >&5 $as_echo "$it_cv_SUN_NET_WWW_PROTOCOL_JAR_URLJARFILE" >&6; } rm -f $CLASS *.class cd .. # should be rmdir but has to be rm -rf due to sun.applet usage rm -rf tmp.$$ if test x"${it_cv_SUN_NET_WWW_PROTOCOL_JAR_URLJARFILE}" = "xno"; then as_fn_error $? "sun.net.www.protocol.jar.URLJarFile not found." "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if sun.net.www.protocol.jar.URLJarFileCallBack is available" >&5 $as_echo_n "checking if sun.net.www.protocol.jar.URLJarFileCallBack is available... " >&6; } if ${it_cv_SUN_NET_WWW_PROTOCOL_JAR_URLJARFILECALLBACK+:} false; then : $as_echo_n "(cached) " >&6 else CLASS=sun/applet/Test.java BYTECODE=$(echo $CLASS|sed 's#\.java##') mkdir -p tmp.$$/$(dirname $CLASS) cd tmp.$$ cat << \EOF > $CLASS /* [#]line 8110 "configure" */ package sun.applet; import sun.net.www.protocol.jar.URLJarFileCallBack; public class Test { public static void main(String[] args) throws Exception { System.out.println(Class.forName("sun.net.www.protocol.jar.URLJarFileCallBack")); } } EOF if $JAVAC -cp . $JAVACFLAGS -nowarn $CLASS >&5 2>&1; then if $JAVA -classpath . $BYTECODE >&5 2>&1; then it_cv_SUN_NET_WWW_PROTOCOL_JAR_URLJARFILECALLBACK=yes; else it_cv_SUN_NET_WWW_PROTOCOL_JAR_URLJARFILECALLBACK=no; fi else it_cv_SUN_NET_WWW_PROTOCOL_JAR_URLJARFILECALLBACK=no; fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $it_cv_SUN_NET_WWW_PROTOCOL_JAR_URLJARFILECALLBACK" >&5 $as_echo "$it_cv_SUN_NET_WWW_PROTOCOL_JAR_URLJARFILECALLBACK" >&6; } rm -f $CLASS *.class cd .. # should be rmdir but has to be rm -rf due to sun.applet usage rm -rf tmp.$$ if test x"${it_cv_SUN_NET_WWW_PROTOCOL_JAR_URLJARFILECALLBACK}" = "xno"; then as_fn_error $? "sun.net.www.protocol.jar.URLJarFileCallBack not found." "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if sun.awt.X11.XEmbeddedFrame is available" >&5 $as_echo_n "checking if sun.awt.X11.XEmbeddedFrame is available... " >&6; } if ${it_cv_SUN_AWT_X11_XEMBEDDEDFRAME+:} false; then : $as_echo_n "(cached) " >&6 else CLASS=sun/applet/Test.java BYTECODE=$(echo $CLASS|sed 's#\.java##') mkdir -p tmp.$$/$(dirname $CLASS) cd tmp.$$ cat << \EOF > $CLASS /* [#]line 8160 "configure" */ package sun.applet; import sun.awt.X11.XEmbeddedFrame; public class Test { public static void main(String[] args) throws Exception { System.out.println(Class.forName("sun.awt.X11.XEmbeddedFrame")); } } EOF if $JAVAC -cp . $JAVACFLAGS -nowarn $CLASS >&5 2>&1; then if $JAVA -classpath . $BYTECODE >&5 2>&1; then it_cv_SUN_AWT_X11_XEMBEDDEDFRAME=yes; else it_cv_SUN_AWT_X11_XEMBEDDEDFRAME=no; fi else it_cv_SUN_AWT_X11_XEMBEDDEDFRAME=no; fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $it_cv_SUN_AWT_X11_XEMBEDDEDFRAME" >&5 $as_echo "$it_cv_SUN_AWT_X11_XEMBEDDEDFRAME" >&6; } rm -f $CLASS *.class cd .. # should be rmdir but has to be rm -rf due to sun.applet usage rm -rf tmp.$$ if test x"${it_cv_SUN_AWT_X11_XEMBEDDEDFRAME}" = "xno"; then as_fn_error $? "sun.awt.X11.XEmbeddedFrame not found." "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if com.sun.jndi.toolkit.url.UrlUtil is available" >&5 $as_echo_n "checking if com.sun.jndi.toolkit.url.UrlUtil is available... " >&6; } if ${it_cv_COM_SUN_JNDI_TOOLKIT_URL_URLUTIL+:} false; then : $as_echo_n "(cached) " >&6 else CLASS=sun/applet/Test.java BYTECODE=$(echo $CLASS|sed 's#\.java##') mkdir -p tmp.$$/$(dirname $CLASS) cd tmp.$$ cat << \EOF > $CLASS /* [#]line 8210 "configure" */ package sun.applet; import com.sun.jndi.toolkit.url.UrlUtil; public class Test { public static void main(String[] args) throws Exception { System.out.println(Class.forName("com.sun.jndi.toolkit.url.UrlUtil")); } } EOF if $JAVAC -cp . $JAVACFLAGS -nowarn $CLASS >&5 2>&1; then if $JAVA -classpath . $BYTECODE >&5 2>&1; then it_cv_COM_SUN_JNDI_TOOLKIT_URL_URLUTIL=yes; else it_cv_COM_SUN_JNDI_TOOLKIT_URL_URLUTIL=no; fi else it_cv_COM_SUN_JNDI_TOOLKIT_URL_URLUTIL=no; fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $it_cv_COM_SUN_JNDI_TOOLKIT_URL_URLUTIL" >&5 $as_echo "$it_cv_COM_SUN_JNDI_TOOLKIT_URL_URLUTIL" >&6; } rm -f $CLASS *.class cd .. # should be rmdir but has to be rm -rf due to sun.applet usage rm -rf tmp.$$ if test x"${it_cv_COM_SUN_JNDI_TOOLKIT_URL_URLUTIL}" = "xno"; then as_fn_error $? "com.sun.jndi.toolkit.url.UrlUtil not found." "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if sun.applet.AppletImageRef is available" >&5 $as_echo_n "checking if sun.applet.AppletImageRef is available... " >&6; } if ${it_cv_SUN_APPLET_APPLETIMAGEREF+:} false; then : $as_echo_n "(cached) " >&6 else CLASS=sun/applet/Test.java BYTECODE=$(echo $CLASS|sed 's#\.java##') mkdir -p tmp.$$/$(dirname $CLASS) cd tmp.$$ cat << \EOF > $CLASS /* [#]line 8260 "configure" */ package sun.applet; import sun.applet.AppletImageRef; public class Test { public static void main(String[] args) throws Exception { System.out.println(Class.forName("sun.applet.AppletImageRef")); } } EOF if $JAVAC -cp . $JAVACFLAGS -nowarn $CLASS >&5 2>&1; then if $JAVA -classpath . $BYTECODE >&5 2>&1; then it_cv_SUN_APPLET_APPLETIMAGEREF=yes; else it_cv_SUN_APPLET_APPLETIMAGEREF=no; fi else it_cv_SUN_APPLET_APPLETIMAGEREF=no; fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $it_cv_SUN_APPLET_APPLETIMAGEREF" >&5 $as_echo "$it_cv_SUN_APPLET_APPLETIMAGEREF" >&6; } rm -f $CLASS *.class cd .. # should be rmdir but has to be rm -rf due to sun.applet usage rm -rf tmp.$$ if test x"${it_cv_SUN_APPLET_APPLETIMAGEREF}" = "xno"; then as_fn_error $? "sun.applet.AppletImageRef not found." "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if selected classes, fields and methods from sun.applet are accessible via reflection" >&5 $as_echo_n "checking if selected classes, fields and methods from sun.applet are accessible via reflection... " >&6; } if ${it_cv_applet_hole+:} false; then : $as_echo_n "(cached) " >&6 else CLASS=TestAppletViewer.java BYTECODE=$(echo $CLASS|sed 's#\.java##') mkdir -p tmp.$$ cd tmp.$$ cat << \EOF > $CLASS /* [#]line 8310 "configure" */ import java.lang.reflect.*; public class TestAppletViewer { public static void main(String[] args) throws Exception { Class ap = Class.forName("sun.applet.AppletPanel"); Class avp = Class.forName("sun.applet.AppletViewerPanel"); Field f1 = ap.getDeclaredField("applet"); Field f2 = avp.getDeclaredField("documentURL"); Method m1 = ap.getDeclaredMethod("run"); Method m2 = ap.getDeclaredMethod("runLoader"); Field f3 = avp.getDeclaredField("baseURL"); } } EOF if $JAVAC -cp . $JAVACFLAGS -nowarn $CLASS >&5 2>&1; then if $JAVA -classpath . $BYTECODE >&5 2>&1; then it_cv_applet_hole=yes; else it_cv_applet_hole=no; fi else it_cv_applet_hole=no; fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $it_cv_applet_hole" >&5 $as_echo "$it_cv_applet_hole" >&6; } rm -f $CLASS *.class cd .. rmdir tmp.$$ if test x"${it_cv_applet_hole}" = "xno"; then as_fn_error $? "Some of the checked items is not avaiable. Check logs." "$LINENO" 5 fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLIB2_V_216" >&5 $as_echo_n "checking for GLIB2_V_216... " >&6; } if test -n "$GLIB2_V_216_CFLAGS"; then pkg_cv_GLIB2_V_216_CFLAGS="$GLIB2_V_216_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.16\""; } >&5 ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.16") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GLIB2_V_216_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0 >= 2.16" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$GLIB2_V_216_LIBS"; then pkg_cv_GLIB2_V_216_LIBS="$GLIB2_V_216_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.16\""; } >&5 ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.16") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GLIB2_V_216_LIBS=`$PKG_CONFIG --libs "glib-2.0 >= 2.16" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then GLIB2_V_216_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glib-2.0 >= 2.16" 2>&1` else GLIB2_V_216_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glib-2.0 >= 2.16" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GLIB2_V_216_PKG_ERRORS" >&5 $as_echo "#define LEGACY_GLIB 1" >>confdefs.h elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "#define LEGACY_GLIB 1" >>confdefs.h else GLIB2_V_216_CFLAGS=$pkg_cv_GLIB2_V_216_CFLAGS GLIB2_V_216_LIBS=$pkg_cv_GLIB2_V_216_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for legacy xulrunner api" >&5 $as_echo_n "checking for legacy xulrunner api... " >&6; } ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu CXXFLAGS_BACKUP="$CXXFLAGS" CXXFLAGS="$CXXFLAGS"" ""$MOZILLA_CFLAGS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include const char* NP_GetMIMEDescription () {return (char*) "yap!";} _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define LEGACY_XULRUNNERAPI 1" >>confdefs.h fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CXXFLAGS="$CXXFLAGS_BACKUP" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xulrunner enforcing C++11 standard" >&5 $as_echo_n "checking for xulrunner enforcing C++11 standard... " >&6; } ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu CXXFLAGS_BACKUP="$CXXFLAGS" CXXFLAGS="$CXXFLAGS"" ""$MOZILLA_CFLAGS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include void setnpptr (NPVariant *result) { VOID_TO_NPVARIANT(*result);} _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } CXXFLAGS="$CXXFLAGS_BACKUP" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } CXXFLAGS="$CXXFLAGS_BACKUP -std=c++11" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # # Find optional depedencies # for ac_prog in xsltproc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_XSLTPROC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$XSLTPROC"; then ac_cv_prog_XSLTPROC="$XSLTPROC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_XSLTPROC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi XSLTPROC=$ac_cv_prog_XSLTPROC if test -n "$XSLTPROC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XSLTPROC" >&5 $as_echo "$XSLTPROC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$XSLTPROC" && break done # browser to be linked/tested # Example: IT_FIND_BROWSER([browser-name],[variable-to-store-path],[default-run-command-if-different-from-the-browser-name]) # Check whether --with-firefox was given. if test "${with_firefox+set}" = set; then : withval=$with_firefox; if test "${withval}" = "no" || test "${withval}" = "yes" || test "${withval}" = "" ; then FIREFOX="" elif test -f "${withval}" ; then FIREFOX="${withval}" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for firefox" >&5 $as_echo_n "checking for firefox... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "invalid location specified to firefox: ${withval} See \`config.log' for more details" "$LINENO" 5; } fi else withval="yes" fi if test -f "${FIREFOX}"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for firefox" >&5 $as_echo_n "checking for firefox... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${FIREFOX}" >&5 $as_echo "${FIREFOX}" >&6; } elif test "${withval}" != "no"; then if test 2 -gt 2; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}", so it can be a program name with args. set dummy ${ac_tool_prefix}; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_FIREFOX+:} false; then : $as_echo_n "(cached) " >&6 else case $FIREFOX in [\\/]* | ?:[\\/]*) ac_cv_path_FIREFOX="$FIREFOX" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_FIREFOX="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi FIREFOX=$ac_cv_path_FIREFOX if test -n "$FIREFOX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FIREFOX" >&5 $as_echo "$FIREFOX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_FIREFOX"; then ac_pt_FIREFOX=$FIREFOX # Extract the first word of "", so it can be a program name with args. set dummy ; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_FIREFOX+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_FIREFOX in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_FIREFOX="$ac_pt_FIREFOX" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_FIREFOX="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_FIREFOX=$ac_cv_path_ac_pt_FIREFOX if test -n "$ac_pt_FIREFOX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_FIREFOX" >&5 $as_echo "$ac_pt_FIREFOX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_FIREFOX" = x; then FIREFOX="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac FIREFOX=$ac_pt_FIREFOX fi else FIREFOX="$ac_cv_path_FIREFOX" fi else if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}firefox", so it can be a program name with args. set dummy ${ac_tool_prefix}firefox; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_FIREFOX+:} false; then : $as_echo_n "(cached) " >&6 else case $FIREFOX in [\\/]* | ?:[\\/]*) ac_cv_path_FIREFOX="$FIREFOX" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_FIREFOX="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi FIREFOX=$ac_cv_path_FIREFOX if test -n "$FIREFOX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FIREFOX" >&5 $as_echo "$FIREFOX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_FIREFOX"; then ac_pt_FIREFOX=$FIREFOX # Extract the first word of "firefox", so it can be a program name with args. set dummy firefox; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_FIREFOX+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_FIREFOX in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_FIREFOX="$ac_pt_FIREFOX" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_FIREFOX="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_FIREFOX=$ac_cv_path_ac_pt_FIREFOX if test -n "$ac_pt_FIREFOX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_FIREFOX" >&5 $as_echo "$ac_pt_FIREFOX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_FIREFOX" = x; then FIREFOX="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac FIREFOX=$ac_pt_FIREFOX fi else FIREFOX="$ac_cv_path_FIREFOX" fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for firefox" >&5 $as_echo_n "checking for firefox... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Check whether --with-chrome was given. if test "${with_chrome+set}" = set; then : withval=$with_chrome; if test "${withval}" = "no" || test "${withval}" = "yes" || test "${withval}" = "" ; then CHROME="" elif test -f "${withval}" ; then CHROME="${withval}" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for chrome" >&5 $as_echo_n "checking for chrome... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "invalid location specified to chrome: ${withval} See \`config.log' for more details" "$LINENO" 5; } fi else withval="yes" fi if test -f "${CHROME}"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for chrome" >&5 $as_echo_n "checking for chrome... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${CHROME}" >&5 $as_echo "${CHROME}" >&6; } elif test "${withval}" != "no"; then if test 3 -gt 2; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}google-chrome", so it can be a program name with args. set dummy ${ac_tool_prefix}google-chrome; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_CHROME+:} false; then : $as_echo_n "(cached) " >&6 else case $CHROME in [\\/]* | ?:[\\/]*) ac_cv_path_CHROME="$CHROME" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_CHROME="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi CHROME=$ac_cv_path_CHROME if test -n "$CHROME"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CHROME" >&5 $as_echo "$CHROME" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_CHROME"; then ac_pt_CHROME=$CHROME # Extract the first word of "google-chrome", so it can be a program name with args. set dummy google-chrome; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_CHROME+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_CHROME in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_CHROME="$ac_pt_CHROME" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_CHROME="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_CHROME=$ac_cv_path_ac_pt_CHROME if test -n "$ac_pt_CHROME"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_CHROME" >&5 $as_echo "$ac_pt_CHROME" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_CHROME" = x; then CHROME="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CHROME=$ac_pt_CHROME fi else CHROME="$ac_cv_path_CHROME" fi else if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}chrome", so it can be a program name with args. set dummy ${ac_tool_prefix}chrome; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_CHROME+:} false; then : $as_echo_n "(cached) " >&6 else case $CHROME in [\\/]* | ?:[\\/]*) ac_cv_path_CHROME="$CHROME" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_CHROME="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi CHROME=$ac_cv_path_CHROME if test -n "$CHROME"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CHROME" >&5 $as_echo "$CHROME" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_CHROME"; then ac_pt_CHROME=$CHROME # Extract the first word of "chrome", so it can be a program name with args. set dummy chrome; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_CHROME+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_CHROME in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_CHROME="$ac_pt_CHROME" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_CHROME="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_CHROME=$ac_cv_path_ac_pt_CHROME if test -n "$ac_pt_CHROME"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_CHROME" >&5 $as_echo "$ac_pt_CHROME" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_CHROME" = x; then CHROME="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CHROME=$ac_pt_CHROME fi else CHROME="$ac_cv_path_CHROME" fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for chrome" >&5 $as_echo_n "checking for chrome... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Check whether --with-chromium was given. if test "${with_chromium+set}" = set; then : withval=$with_chromium; if test "${withval}" = "no" || test "${withval}" = "yes" || test "${withval}" = "" ; then CHROMIUM="" elif test -f "${withval}" ; then CHROMIUM="${withval}" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for chromium" >&5 $as_echo_n "checking for chromium... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "invalid location specified to chromium: ${withval} See \`config.log' for more details" "$LINENO" 5; } fi else withval="yes" fi if test -f "${CHROMIUM}"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for chromium" >&5 $as_echo_n "checking for chromium... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${CHROMIUM}" >&5 $as_echo "${CHROMIUM}" >&6; } elif test "${withval}" != "no"; then if test 3 -gt 2; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}chromium-browser", so it can be a program name with args. set dummy ${ac_tool_prefix}chromium-browser; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_CHROMIUM+:} false; then : $as_echo_n "(cached) " >&6 else case $CHROMIUM in [\\/]* | ?:[\\/]*) ac_cv_path_CHROMIUM="$CHROMIUM" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_CHROMIUM="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi CHROMIUM=$ac_cv_path_CHROMIUM if test -n "$CHROMIUM"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CHROMIUM" >&5 $as_echo "$CHROMIUM" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_CHROMIUM"; then ac_pt_CHROMIUM=$CHROMIUM # Extract the first word of "chromium-browser", so it can be a program name with args. set dummy chromium-browser; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_CHROMIUM+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_CHROMIUM in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_CHROMIUM="$ac_pt_CHROMIUM" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_CHROMIUM="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_CHROMIUM=$ac_cv_path_ac_pt_CHROMIUM if test -n "$ac_pt_CHROMIUM"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_CHROMIUM" >&5 $as_echo "$ac_pt_CHROMIUM" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_CHROMIUM" = x; then CHROMIUM="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CHROMIUM=$ac_pt_CHROMIUM fi else CHROMIUM="$ac_cv_path_CHROMIUM" fi else if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}chromium", so it can be a program name with args. set dummy ${ac_tool_prefix}chromium; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_CHROMIUM+:} false; then : $as_echo_n "(cached) " >&6 else case $CHROMIUM in [\\/]* | ?:[\\/]*) ac_cv_path_CHROMIUM="$CHROMIUM" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_CHROMIUM="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi CHROMIUM=$ac_cv_path_CHROMIUM if test -n "$CHROMIUM"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CHROMIUM" >&5 $as_echo "$CHROMIUM" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_CHROMIUM"; then ac_pt_CHROMIUM=$CHROMIUM # Extract the first word of "chromium", so it can be a program name with args. set dummy chromium; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_CHROMIUM+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_CHROMIUM in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_CHROMIUM="$ac_pt_CHROMIUM" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_CHROMIUM="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_CHROMIUM=$ac_cv_path_ac_pt_CHROMIUM if test -n "$ac_pt_CHROMIUM"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_CHROMIUM" >&5 $as_echo "$ac_pt_CHROMIUM" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_CHROMIUM" = x; then CHROMIUM="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CHROMIUM=$ac_pt_CHROMIUM fi else CHROMIUM="$ac_cv_path_CHROMIUM" fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for chromium" >&5 $as_echo_n "checking for chromium... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Check whether --with-opera was given. if test "${with_opera+set}" = set; then : withval=$with_opera; if test "${withval}" = "no" || test "${withval}" = "yes" || test "${withval}" = "" ; then OPERA="" elif test -f "${withval}" ; then OPERA="${withval}" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for opera" >&5 $as_echo_n "checking for opera... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "invalid location specified to opera: ${withval} See \`config.log' for more details" "$LINENO" 5; } fi else withval="yes" fi if test -f "${OPERA}"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for opera" >&5 $as_echo_n "checking for opera... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${OPERA}" >&5 $as_echo "${OPERA}" >&6; } elif test "${withval}" != "no"; then if test 2 -gt 2; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}", so it can be a program name with args. set dummy ${ac_tool_prefix}; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_OPERA+:} false; then : $as_echo_n "(cached) " >&6 else case $OPERA in [\\/]* | ?:[\\/]*) ac_cv_path_OPERA="$OPERA" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_OPERA="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi OPERA=$ac_cv_path_OPERA if test -n "$OPERA"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OPERA" >&5 $as_echo "$OPERA" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_OPERA"; then ac_pt_OPERA=$OPERA # Extract the first word of "", so it can be a program name with args. set dummy ; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_OPERA+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_OPERA in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_OPERA="$ac_pt_OPERA" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_OPERA="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_OPERA=$ac_cv_path_ac_pt_OPERA if test -n "$ac_pt_OPERA"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OPERA" >&5 $as_echo "$ac_pt_OPERA" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_OPERA" = x; then OPERA="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OPERA=$ac_pt_OPERA fi else OPERA="$ac_cv_path_OPERA" fi else if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}opera", so it can be a program name with args. set dummy ${ac_tool_prefix}opera; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_OPERA+:} false; then : $as_echo_n "(cached) " >&6 else case $OPERA in [\\/]* | ?:[\\/]*) ac_cv_path_OPERA="$OPERA" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_OPERA="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi OPERA=$ac_cv_path_OPERA if test -n "$OPERA"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OPERA" >&5 $as_echo "$OPERA" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_OPERA"; then ac_pt_OPERA=$OPERA # Extract the first word of "opera", so it can be a program name with args. set dummy opera; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_OPERA+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_OPERA in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_OPERA="$ac_pt_OPERA" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_OPERA="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_OPERA=$ac_cv_path_ac_pt_OPERA if test -n "$ac_pt_OPERA"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OPERA" >&5 $as_echo "$ac_pt_OPERA" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_OPERA" = x; then OPERA="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OPERA=$ac_pt_OPERA fi else OPERA="$ac_cv_path_OPERA" fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for opera" >&5 $as_echo_n "checking for opera... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Check whether --with-midori was given. if test "${with_midori+set}" = set; then : withval=$with_midori; if test "${withval}" = "no" || test "${withval}" = "yes" || test "${withval}" = "" ; then MIDORI="" elif test -f "${withval}" ; then MIDORI="${withval}" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for midori" >&5 $as_echo_n "checking for midori... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "invalid location specified to midori: ${withval} See \`config.log' for more details" "$LINENO" 5; } fi else withval="yes" fi if test -f "${MIDORI}"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for midori" >&5 $as_echo_n "checking for midori... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${MIDORI}" >&5 $as_echo "${MIDORI}" >&6; } elif test "${withval}" != "no"; then if test 2 -gt 2; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}", so it can be a program name with args. set dummy ${ac_tool_prefix}; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_MIDORI+:} false; then : $as_echo_n "(cached) " >&6 else case $MIDORI in [\\/]* | ?:[\\/]*) ac_cv_path_MIDORI="$MIDORI" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_MIDORI="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi MIDORI=$ac_cv_path_MIDORI if test -n "$MIDORI"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MIDORI" >&5 $as_echo "$MIDORI" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_MIDORI"; then ac_pt_MIDORI=$MIDORI # Extract the first word of "", so it can be a program name with args. set dummy ; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_MIDORI+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_MIDORI in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_MIDORI="$ac_pt_MIDORI" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_MIDORI="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_MIDORI=$ac_cv_path_ac_pt_MIDORI if test -n "$ac_pt_MIDORI"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_MIDORI" >&5 $as_echo "$ac_pt_MIDORI" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_MIDORI" = x; then MIDORI="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MIDORI=$ac_pt_MIDORI fi else MIDORI="$ac_cv_path_MIDORI" fi else if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}midori", so it can be a program name with args. set dummy ${ac_tool_prefix}midori; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_MIDORI+:} false; then : $as_echo_n "(cached) " >&6 else case $MIDORI in [\\/]* | ?:[\\/]*) ac_cv_path_MIDORI="$MIDORI" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_MIDORI="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi MIDORI=$ac_cv_path_MIDORI if test -n "$MIDORI"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MIDORI" >&5 $as_echo "$MIDORI" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_MIDORI"; then ac_pt_MIDORI=$MIDORI # Extract the first word of "midori", so it can be a program name with args. set dummy midori; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_MIDORI+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_MIDORI in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_MIDORI="$ac_pt_MIDORI" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_MIDORI="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_MIDORI=$ac_cv_path_ac_pt_MIDORI if test -n "$ac_pt_MIDORI"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_MIDORI" >&5 $as_echo "$ac_pt_MIDORI" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_MIDORI" = x; then MIDORI="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MIDORI=$ac_pt_MIDORI fi else MIDORI="$ac_cv_path_MIDORI" fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for midori" >&5 $as_echo_n "checking for midori... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Check whether --with-epiphany was given. if test "${with_epiphany+set}" = set; then : withval=$with_epiphany; if test "${withval}" = "no" || test "${withval}" = "yes" || test "${withval}" = "" ; then EPIPHANY="" elif test -f "${withval}" ; then EPIPHANY="${withval}" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for epiphany" >&5 $as_echo_n "checking for epiphany... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "invalid location specified to epiphany: ${withval} See \`config.log' for more details" "$LINENO" 5; } fi else withval="yes" fi if test -f "${EPIPHANY}"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for epiphany" >&5 $as_echo_n "checking for epiphany... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${EPIPHANY}" >&5 $as_echo "${EPIPHANY}" >&6; } elif test "${withval}" != "no"; then if test 2 -gt 2; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}", so it can be a program name with args. set dummy ${ac_tool_prefix}; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_EPIPHANY+:} false; then : $as_echo_n "(cached) " >&6 else case $EPIPHANY in [\\/]* | ?:[\\/]*) ac_cv_path_EPIPHANY="$EPIPHANY" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_EPIPHANY="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi EPIPHANY=$ac_cv_path_EPIPHANY if test -n "$EPIPHANY"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $EPIPHANY" >&5 $as_echo "$EPIPHANY" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_EPIPHANY"; then ac_pt_EPIPHANY=$EPIPHANY # Extract the first word of "", so it can be a program name with args. set dummy ; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_EPIPHANY+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_EPIPHANY in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_EPIPHANY="$ac_pt_EPIPHANY" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_EPIPHANY="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_EPIPHANY=$ac_cv_path_ac_pt_EPIPHANY if test -n "$ac_pt_EPIPHANY"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_EPIPHANY" >&5 $as_echo "$ac_pt_EPIPHANY" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_EPIPHANY" = x; then EPIPHANY="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac EPIPHANY=$ac_pt_EPIPHANY fi else EPIPHANY="$ac_cv_path_EPIPHANY" fi else if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}epiphany", so it can be a program name with args. set dummy ${ac_tool_prefix}epiphany; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_EPIPHANY+:} false; then : $as_echo_n "(cached) " >&6 else case $EPIPHANY in [\\/]* | ?:[\\/]*) ac_cv_path_EPIPHANY="$EPIPHANY" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_EPIPHANY="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi EPIPHANY=$ac_cv_path_EPIPHANY if test -n "$EPIPHANY"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $EPIPHANY" >&5 $as_echo "$EPIPHANY" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_EPIPHANY"; then ac_pt_EPIPHANY=$EPIPHANY # Extract the first word of "epiphany", so it can be a program name with args. set dummy epiphany; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_EPIPHANY+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_EPIPHANY in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_EPIPHANY="$ac_pt_EPIPHANY" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_EPIPHANY="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_EPIPHANY=$ac_cv_path_ac_pt_EPIPHANY if test -n "$ac_pt_EPIPHANY"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_EPIPHANY" >&5 $as_echo "$ac_pt_EPIPHANY" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_EPIPHANY" = x; then EPIPHANY="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac EPIPHANY=$ac_pt_EPIPHANY fi else EPIPHANY="$ac_cv_path_EPIPHANY" fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for epiphany" >&5 $as_echo_n "checking for epiphany... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how browser test will be run" >&5 $as_echo_n "checking how browser test will be run... " >&6; } # Check whether --with-browser-tests was given. if test "${with_browser_tests+set}" = set; then : withval=$with_browser_tests; BROWSER_SWITCH=${withval} else BROWSER_SWITCH="yes" fi D_PARAM_PART="-Dmodified.browsers.run" case "$BROWSER_SWITCH" in "yes" ) BROWSER_TESTS_MODIFICATION="" ;; "no" ) BROWSER_TESTS_MODIFICATION="$D_PARAM_PART=ignore" ;; "one" ) BROWSER_TESTS_MODIFICATION="$D_PARAM_PART=one" ;; "all" ) BROWSER_TESTS_MODIFICATION="$D_PARAM_PART=all" ;; *) as_fn_error $? "unknown valkue of with-browser-tests ($BROWSER_SWITCH), so not use (yes) or set yes|no|one|all" "$LINENO" 5 esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${BROWSER_SWITCH}" >&5 $as_echo "${BROWSER_SWITCH}" >&6; } if test x"$XSLTPROC" != x ; then WITH_XSLTPROC_TRUE= WITH_XSLTPROC_FALSE='#' else WITH_XSLTPROC_TRUE='#' WITH_XSLTPROC_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rhino jar" >&5 $as_echo_n "checking for rhino jar... " >&6; } # Check whether --with-rhino was given. if test "${with_rhino+set}" = set; then : withval=$with_rhino; case "${withval}" in yes) RHINO_JAR=yes ;; no) RHINO_JAR=no ;; *) if test -f "${withval}"; then RHINO_JAR="${withval}" elif test -z "${withval}"; then RHINO_JAR=yes else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } as_fn_error $? "\"The rhino jar ${withval} was not found.\"" "$LINENO" 5 fi ;; esac else RHINO_JAR=yes fi it_extra_paths_rhino="/usr/share/java/js.jar /usr/share/rhino-1.6/lib/js.jar" if test "x${RHINO_JAR}" = "xyes"; then for path in ${it_extra_paths_rhino}; do if test -f ${path}; then RHINO_JAR=${path} break fi done fi if test x"${RHINO_JAR}" = "xyes"; then if test -f "/usr/share/java/rhino.jar"; then RHINO_JAR=/usr/share/java/rhino.jar fi fi if test x"${RHINO_JAR}" = "xyes"; then RHINO_JAR=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${RHINO_JAR}" >&5 $as_echo "${RHINO_JAR}" >&6; } if test x"${RHINO_JAR}" != "xno"; then WITH_RHINO_TRUE= WITH_RHINO_FALSE='#' else WITH_RHINO_TRUE='#' WITH_RHINO_FALSE= fi # Clear RHINO_JAR if it doesn't contain a valid filename if test x"${RHINO_JAR}" = "xno"; then RHINO_JAR= fi if test -n "${RHINO_JAR}" ; then RHINO_AVAILABLE=true else RHINO_AVAILABLE=false fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for junit jar" >&5 $as_echo_n "checking for junit jar... " >&6; } # Check whether --with-junit was given. if test "${with_junit+set}" = set; then : withval=$with_junit; case "${withval}" in yes) JUNIT_JAR=yes ;; no) JUNIT_JAR=no ;; *) if test -f "${withval}"; then JUNIT_JAR="${withval}" elif test -z "${withval}"; then JUNIT_JAR=yes else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } as_fn_error $? "\"The junit jar ${withval} was not found.\"" "$LINENO" 5 fi ;; esac else JUNIT_JAR=yes fi it_extra_paths_junit="/usr/share/java/junit4.jar /usr/share/junit-4/lib/junit.jar" if test "x${JUNIT_JAR}" = "xyes"; then for path in ${it_extra_paths_junit}; do if test -f ${path}; then JUNIT_JAR=${path} break fi done fi if test x"${JUNIT_JAR}" = "xyes"; then if test -f "/usr/share/java/junit.jar"; then JUNIT_JAR=/usr/share/java/junit.jar fi fi if test x"${JUNIT_JAR}" = "xyes"; then JUNIT_JAR=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${JUNIT_JAR}" >&5 $as_echo "${JUNIT_JAR}" >&6; } if test x"${JUNIT_JAR}" != "xno"; then WITH_JUNIT_TRUE= WITH_JUNIT_FALSE='#' else WITH_JUNIT_TRUE='#' WITH_JUNIT_FALSE= fi # Clear JUNIT_JAR if it doesn't contain a valid filename if test x"${JUNIT_JAR}" = "xno"; then JUNIT_JAR= fi if test -n "${JUNIT_JAR}" ; then JUNIT_AVAILABLE=true else JUNIT_AVAILABLE=false fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for hamcrest jar" >&5 $as_echo_n "checking for hamcrest jar... " >&6; } # Check whether --with-hamcrest was given. if test "${with_hamcrest+set}" = set; then : withval=$with_hamcrest; case "${withval}" in yes) HAMCREST_JAR=yes ;; no) HAMCREST_JAR=no ;; *) if test -f "${withval}"; then HAMCREST_JAR="${withval}" elif test -z "${withval}"; then HAMCREST_JAR=yes else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } as_fn_error $? "\"The hamcrest jar ${withval} was not found.\"" "$LINENO" 5 fi ;; esac else HAMCREST_JAR=yes fi it_extra_paths_hamcrest="/usr/share/java/hamcrest/all.jar /usr/share/java/hamcrest-core.jar" if test "x${HAMCREST_JAR}" = "xyes"; then for path in ${it_extra_paths_hamcrest}; do if test -f ${path}; then HAMCREST_JAR=${path} break fi done fi if test x"${HAMCREST_JAR}" = "xyes"; then if test -f "/usr/share/java/hamcrest.jar"; then HAMCREST_JAR=/usr/share/java/hamcrest.jar fi fi if test x"${HAMCREST_JAR}" = "xyes"; then HAMCREST_JAR=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${HAMCREST_JAR}" >&5 $as_echo "${HAMCREST_JAR}" >&6; } if test x"${HAMCREST_JAR}" != "xno"; then WITH_HAMCREST_TRUE= WITH_HAMCREST_FALSE='#' else WITH_HAMCREST_TRUE='#' WITH_HAMCREST_FALSE= fi # Clear HAMCREST_JAR if it doesn't contain a valid filename if test x"${HAMCREST_JAR}" = "xno"; then HAMCREST_JAR= fi if test -n "${HAMCREST_JAR}" ; then HAMCREST_AVAILABLE=true else HAMCREST_AVAILABLE=false fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jacoco jar" >&5 $as_echo_n "checking for jacoco jar... " >&6; } # Check whether --with-jacoco was given. if test "${with_jacoco+set}" = set; then : withval=$with_jacoco; case "${withval}" in yes) JACOCO_JAR=yes ;; no) JACOCO_JAR=no ;; *) if test -f "${withval}"; then JACOCO_JAR="${withval}" elif test -z "${withval}"; then JACOCO_JAR=yes else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } as_fn_error $? "\"The jacoco jar ${withval} was not found.\"" "$LINENO" 5 fi ;; esac else JACOCO_JAR=yes fi it_extra_paths_jacoco="/usr/share/java/jacoco/org.jacoco.core.jar" if test "x${JACOCO_JAR}" = "xyes"; then for path in ${it_extra_paths_jacoco}; do if test -f ${path}; then JACOCO_JAR=${path} break fi done fi if test x"${JACOCO_JAR}" = "xyes"; then if test -f "/usr/share/java/jacoco.jar"; then JACOCO_JAR=/usr/share/java/jacoco.jar fi fi if test x"${JACOCO_JAR}" = "xyes"; then JACOCO_JAR=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${JACOCO_JAR}" >&5 $as_echo "${JACOCO_JAR}" >&6; } if test x"${JACOCO_JAR}" != "xno"; then WITH_JACOCO_TRUE= WITH_JACOCO_FALSE='#' else WITH_JACOCO_TRUE='#' WITH_JACOCO_FALSE= fi # Clear JACOCO_JAR if it doesn't contain a valid filename if test x"${JACOCO_JAR}" = "xno"; then JACOCO_JAR= fi if test -n "${JACOCO_JAR}" ; then JACOCO_AVAILABLE=true else JACOCO_AVAILABLE=false fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for asm jar" >&5 $as_echo_n "checking for asm jar... " >&6; } # Check whether --with-asm was given. if test "${with_asm+set}" = set; then : withval=$with_asm; case "${withval}" in yes) ASM_JAR=yes ;; no) ASM_JAR=no ;; *) if test -f "${withval}"; then ASM_JAR="${withval}" elif test -z "${withval}"; then ASM_JAR=yes else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } as_fn_error $? "\"The asm jar ${withval} was not found.\"" "$LINENO" 5 fi ;; esac else ASM_JAR=yes fi it_extra_paths_asm="/usr/share/java/objectweb-asm4/asm-all.jar /usr/share/java/objectweb-asm4/asm-all-4.0.jar /usr/share/java/objectweb-asm/asm-all.jar" if test "x${ASM_JAR}" = "xyes"; then for path in ${it_extra_paths_asm}; do if test -f ${path}; then ASM_JAR=${path} break fi done fi if test x"${ASM_JAR}" = "xyes"; then if test -f "/usr/share/java/asm.jar"; then ASM_JAR=/usr/share/java/asm.jar fi fi if test x"${ASM_JAR}" = "xyes"; then ASM_JAR=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ASM_JAR}" >&5 $as_echo "${ASM_JAR}" >&6; } if test x"${ASM_JAR}" != "xno"; then WITH_ASM_TRUE= WITH_ASM_FALSE='#' else WITH_ASM_TRUE='#' WITH_ASM_FALSE= fi # Clear ASM_JAR if it doesn't contain a valid filename if test x"${ASM_JAR}" = "xno"; then ASM_JAR= fi if test -n "${ASM_JAR}" ; then ASM_AVAILABLE=true else ASM_AVAILABLE=false fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tagsoup" >&5 $as_echo_n "checking for tagsoup... " >&6; } # Check whether --with-tagsoup was given. if test "${with_tagsoup+set}" = set; then : withval=$with_tagsoup; TAGSOUP_JAR=${withval} else TAGSOUP_JAR= fi if test -z "${TAGSOUP_JAR}"; then for dir in /usr/share/java /usr/local/share/java ; do if test -f $dir/tagsoup.jar; then TAGSOUP_JAR=$dir/tagsoup.jar break fi done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${TAGSOUP_JAR}" >&5 $as_echo "${TAGSOUP_JAR}" >&6; } if test -z "${TAGSOUP_JAR}"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: ***********************************************" >&5 $as_echo "***********************************************" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: * Warning you are building without tagsoup *" >&5 $as_echo "* Warning you are building without tagsoup *" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: * Some jnlps and most htmls will be malformed *" >&5 $as_echo "* Some jnlps and most htmls will be malformed *" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: ***********************************************" >&5 $as_echo "***********************************************" >&6; } fi if test x$TAGSOUP_JAR != xno -a x$TAGSOUP_JAR != x ; then HAVE_TAGSOUP_TRUE= HAVE_TAGSOUP_FALSE='#' else HAVE_TAGSOUP_TRUE='#' HAVE_TAGSOUP_FALSE= fi ac_config_files="$ac_config_files jrunscript" ac_config_files="$ac_config_files build.properties" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' :mline /\\$/{ N s,\\\n,, b mline } t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${CP_SUPPORTS_REFLINK_TRUE}" && test -z "${CP_SUPPORTS_REFLINK_FALSE}"; then as_fn_error $? "conditional \"CP_SUPPORTS_REFLINK\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${SRC_DIR_HARDLINKABLE_TRUE}" && test -z "${SRC_DIR_HARDLINKABLE_FALSE}"; then as_fn_error $? "conditional \"SRC_DIR_HARDLINKABLE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_DOCS_TRUE}" && test -z "${ENABLE_DOCS_FALSE}"; then as_fn_error $? "conditional \"ENABLE_DOCS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_WHITELIST_TRUE}" && test -z "${ENABLE_WHITELIST_FALSE}"; then as_fn_error $? "conditional \"ENABLE_WHITELIST\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_JAVA7_TRUE}" && test -z "${HAVE_JAVA7_FALSE}"; then as_fn_error $? "conditional \"HAVE_JAVA7\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_JAVA8_TRUE}" && test -z "${HAVE_JAVA8_FALSE}"; then as_fn_error $? "conditional \"HAVE_JAVA8\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_JAVA9_TRUE}" && test -z "${HAVE_JAVA9_FALSE}"; then as_fn_error $? "conditional \"HAVE_JAVA9\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${JAVADOC_SUPPORTS_J_OPTIONS_TRUE}" && test -z "${JAVADOC_SUPPORTS_J_OPTIONS_FALSE}"; then as_fn_error $? "conditional \"JAVADOC_SUPPORTS_J_OPTIONS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAS_ICEDTEA_REVISION_TRUE}" && test -z "${HAS_ICEDTEA_REVISION_FALSE}"; then as_fn_error $? "conditional \"HAS_ICEDTEA_REVISION\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAS_PKGVERSION_TRUE}" && test -z "${HAS_PKGVERSION_FALSE}"; then as_fn_error $? "conditional \"HAS_PKGVERSION\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_PLUGIN_TRUE}" && test -z "${ENABLE_PLUGIN_FALSE}"; then as_fn_error $? "conditional \"ENABLE_PLUGIN\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_XSLTPROC_TRUE}" && test -z "${WITH_XSLTPROC_FALSE}"; then as_fn_error $? "conditional \"WITH_XSLTPROC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_RHINO_TRUE}" && test -z "${WITH_RHINO_FALSE}"; then as_fn_error $? "conditional \"WITH_RHINO\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_JUNIT_TRUE}" && test -z "${WITH_JUNIT_FALSE}"; then as_fn_error $? "conditional \"WITH_JUNIT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_HAMCREST_TRUE}" && test -z "${WITH_HAMCREST_FALSE}"; then as_fn_error $? "conditional \"WITH_HAMCREST\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_JACOCO_TRUE}" && test -z "${WITH_JACOCO_FALSE}"; then as_fn_error $? "conditional \"WITH_JACOCO\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_ASM_TRUE}" && test -z "${WITH_ASM_FALSE}"; then as_fn_error $? "conditional \"WITH_ASM\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_TAGSOUP_TRUE}" && test -z "${HAVE_TAGSOUP_FALSE}"; then as_fn_error $? "conditional \"HAVE_TAGSOUP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by icedtea-web $as_me 1.6.2, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Configuration commands: $config_commands Report bugs to . icedtea-web home page: ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ icedtea-web config.status 1.6.2 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "netx.manifest") CONFIG_FILES="$CONFIG_FILES netx.manifest" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "jrunscript") CONFIG_FILES="$CONFIG_FILES jrunscript" ;; "build.properties") CONFIG_FILES="$CONFIG_FILES build.properties" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" eval set X " :F $CONFIG_FILES :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "jrunscript":F) chmod u+x jrunscript ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi icedtea-web-1.6.2/PaxHeaders.17941/Makefile.am0000644000000000000000000000013112654402377015500 xustar0030 mtime=1454507263.230432674 30 atime=1454507350.382270356 29 ctime=1454507658.71815817 icedtea-web-1.6.2/Makefile.am0000644000175000002070000020262012654402377016226 0ustar00jvanekmock00000000000000# Functions to compose path/classpath EMPTY := SPACE := $(EMPTY) $(EMPTY) define joinsegments $(subst $(SPACE),:,$(strip $1)) endef define composeclasspath $(if $(call joinsegments,$1),-classpath $(call joinsegments,$1),) endef # Source directories export TOP_BUILD_DIR = $(abs_top_builddir) export NETX_DIR = $(abs_top_builddir)/netx.build export DOCS_DIR=$(TOP_BUILD_DIR)/icedtea-web-docs/$(FULL_VERSION) export NETX_SRCDIR = $(abs_top_srcdir)/netx export NETX_RESOURCE_DIR=$(NETX_SRCDIR)/net/sourceforge/jnlp/resources export ICONS_DEST_DIR=$(DESTDIR)$(datadir)/pixmaps export REPORT_STYLES_DIRNAME=report-styles export TESTS_SRCDIR=$(abs_top_srcdir)/tests export TESTS_DIR=$(abs_top_builddir)/tests.build export NETX_UNIT_TEST_SRCDIR=$(TESTS_SRCDIR)/netx/unit export NETX_TEST_DIR=$(TESTS_DIR)/netx export NETX_UNIT_TEST_DIR=$(NETX_TEST_DIR)/unit export JUNIT_RUNNER_DIR=$(TESTS_DIR)/junit-runner export JUNIT_RUNNER_SRCDIR=$(TESTS_SRCDIR)/junit-runner export JACOCO_OPERATOR_DIR=$(TESTS_DIR)/jacoco-operator export JACOCO_OPERATOR_SRCDIR=$(TESTS_SRCDIR)/jacoco-operator export TEST_EXTENSIONS_SRCDIR=$(TESTS_SRCDIR)/test-extensions export TEST_EXTENSIONS_TESTS_SRCDIR=$(TESTS_SRCDIR)/test-extensions-tests export REPRODUCERS_TESTS_SRCDIR=$(TESTS_SRCDIR)/reproducers export TEST_EXTENSIONS_DIR=$(TESTS_DIR)/test-extensions export CPP_UNITTEST_FRAMEWORK_SRCDIR=$(TESTS_SRCDIR)/UnitTest++ export CPP_UNITTEST_SRCDIR=$(TESTS_SRCDIR)/cpp-unit-tests export CPP_UNITTEST_DIR=$(TESTS_DIR)/cpp-unit-tests export TEST_EXTENSIONS_COMPATIBILITY_SYMLINK=$(TESTS_DIR)/netx/jnlp_testsengine export TEST_EXTENSIONS_TESTS_DIR=$(TESTS_DIR)/test-extensions-tests export REPRODUCERS_TESTS_SERVER_DEPLOYDIR=$(TESTS_DIR)/reproducers_test_server_deploydir export REPRODUCERS_BUILD_DIR=$(TESTS_DIR)/reproducers.classes export PRIVATE_KEYSTORE_NAME=teststore.ks export PRIVATE_KEYSTORE_PASS=123456789 export EXPORTED_TEST_CERT_PREFIX=icedteatests export EXPORTED_TEST_CERT_SUFFIX=crt export TEST_CERT_ALIAS=icedteaweb export PUBLIC_KEYSTORE_STUB=icedtea-web/security/trusted.certs export PUBLIC_KEYSTORE_PASS=changeit export JUNIT_RUNNER_JAR=$(abs_top_builddir)/junit-runner.jar export UNIT_CLASS_NAMES = $(abs_top_builddir)/unit_class_names export REPRODUCERS_CLASS_NAMES = $(abs_top_builddir)/reproducers_class_names export REPRODUCERS_CLASS_WHITELIST = $(abs_top_srcdir)/netx-dist-tests-whitelist export COVERAGE_JAVA_ARGS=-Xmx2G export COVERAGE_MODIFIED_FILES=tests-output.xml ServerAccess-logs.xml stdout.log stderr.log all.log export EMMA_BACKUP_SUFFIX=_noEmma export EMMA_SUFFIX=_withEmma export META_MANIFEST = META-INF/MANIFEST.MF export SIGNED_REPRODUCERS=signed signed2 export SIMPLE_REPRODUCERS=simple export CUSTOM_REPRODUCERS=custom export ALL_NONCUSTOM_REPRODUCERS=$(SIMPLE_REPRODUCERS) $(SIGNED_REPRODUCERS) export ALL_REPRODUCERS=$(ALL_NONCUSTOM_REPRODUCERS) $(CUSTOM_REPRODUCERS) export JACOCO_PATH:=$(shell dirname "$(JACOCO_JAR)") export JACOCO_AGENT=org.jacoco.agent.jar export JACOCO_ANT=org.jacoco.ant.jar export JACOCO_REPORT=org.jacoco.report.jar export JACOCO_AGENTRT=org.jacoco.agent.rt.jar export JACOCO_CORE=org.jacoco.core.jar export JACOCO_JAVAWS_RESULTS=$(TEST_EXTENSIONS_DIR)/jacoco_javaws.exec export JACOCO_PLUGIN_RESULTS=$(TEST_EXTENSIONS_DIR)/jacoco_plugin.exec # space separated fragments for composeclasspath export JACOCO_CLASSPATH=$(JACOCO_PATH)/$(JACOCO_CORE) $(JACOCO_PATH)/$(JACOCO_AGENT) $(JACOCO_PATH)/$(JACOCO_REPORT) $(JACOCO_PATH)/$(JACOCO_AGENTRT) $(JACOCO_PATH)/$(JACOCO_ANT) $(ASM_JAR) export JACOCO_AGENT_SWITCH_BODY=-javaagent:$(JACOCO_PATH)/$(JACOCO_AGENTRT) export JACOCO_BASE_EXCLUDE=org.junit.*:junit.* export JACOCO_ADVANCED_EXCLUDE=:*jacoco*:java.lang.*:java.reflect.*:java.util.*:sun.reflect.* export JACOCO_AGENT_SWITCH="$(JACOCO_AGENT_SWITCH_BODY)=excludes=$(JACOCO_BASE_EXCLUDE)$(JACOCO_ADVANCED_EXCLUDE),inclbootstrapclasses=true" export JACOCO_AGENT_JAVAWS_SWITCH=\"$(JACOCO_AGENT_SWITCH),destfile=$(JACOCO_JAVAWS_RESULTS)\" export JACOCO_AGENT_PLUGIN_SWITCH=\"$(JACOCO_AGENT_SWITCH),destfile=$(JACOCO_PLUGIN_RESULTS)\" export JACOCO_OPERATOR_EXEC=$(SYSTEM_JRE_DIR)/bin/java $(COVERAGE_JAVA_ARGS) -cp $(call joinsegments, $(JACOCO_OPERATOR_DIR) $(JACOCO_CLASSPATH) .) org.jacoco.operator.Main # linking variables export PLUGIN_LINK_NAME=libjavaplugin.so export MOZILLA_LOCAL_PLUGINDIR=${HOME}/.mozilla/plugins export MOZILLA_GLOBAL64_PLUGINDIR=/usr/lib64/mozilla/plugins export MOZILLA_GLOBAL32_PLUGINDIR=/usr/lib/mozilla/plugins export OPERA_GLOBAL64_PLUGINDIR=/usr/lib64/opera/plugins export OPERA_GLOBAL32_PLUGINDIR=/usr/lib/opera/plugins export BUILT_PLUGIN_LIBRARY=IcedTeaPlugin.so export CPP_UNITTEST_FRAMEWORK_BUILDDIR=$(CPP_UNITTEST_DIR)/UnitTest++ export CPP_UNITTEST_FRAMEWORK_LIB_NAME=libUnitTest++.a export CPP_UNITTEST_FRAMEWORK_LIB=$(CPP_UNITTEST_FRAMEWORK_BUILDDIR)/$(CPP_UNITTEST_FRAMEWORK_LIB_NAME) export CPP_UNITTEST_EXECUTABLE=$(CPP_UNITTEST_DIR)/IcedTeaPluginUnitTests export MOZILLA_LOCAL_BACKUP_FILE=${HOME}/$(PLUGIN_LINK_NAME).origU export MOZILLA_GLOBAL_BACKUP_FILE=${HOME}/$(PLUGIN_LINK_NAME).origMG export OPERA_GLOBAL_BACKUP_FILE=${HOME}/$(PLUGIN_LINK_NAME).origOG export MOZILLA_FAMILY_TEST= "$(FIREFOX)" != "" -o "$(CHROMIUM)" != "" -o "$(CHROME)" != "" -o "$(MIDORI)" != "" -o "$(EPIPHANY)" != "" # end of linking variables # Build directories # note this is *space* separated list, as composeclasspath is called on them in classpath usage JUNIT_RUNTIME:=$(JUNIT_JAR) $(HAMCREST_JAR) # support for javaws -html needs plugin.jar on classpath. rest of javaws works of course without it. if ENABLE_PLUGIN PLUGIN_JAR=$(datadir)/$(PACKAGE_NAME)/plugin.jar endif # Conditional defintions if HAVE_TAGSOUP NETX_EXCLUDE_SRCS= else NETX_EXCLUDE_SRCS=net.sourceforge.jnlp.MalformedXMLParser.java endif # Flags export IT_CFLAGS=$(CFLAGS) $(ARCHFLAG) export IT_JAVAC_SETTINGS=-g -encoding utf-8 $(JAVACFLAGS) $(MEMORY_LIMIT) $(PREFER_SOURCE) export IT_LANGUAGE_SOURCE_VERSION=7 export IT_CLASS_TARGET_VERSION=7 export IT_JAVACFLAGS=$(IT_JAVAC_SETTINGS) -source $(IT_LANGUAGE_SOURCE_VERSION) -target $(IT_CLASS_TARGET_VERSION) # # We need the jars in bootclasspath for a couple of reasons # - we use classes (in the sun.applet package) loaded by the bootclassloader # using another classloader to load classes from the same package causes an # IllegalAccessException # - we want full privileges # export UNIFIED_CLASSPATH_SEGMENTS=$(datadir)/$(PACKAGE_NAME)/netx.jar $(PLUGIN_JAR) $(RHINO_JAR) $(TAGSOUP_JAR) export UNIFIED_JACOCO_CLASSPATH_SEGMENTS=$(UNIFIED_CLASSPATH_SEGMENTS) $(JACOCO_CLASSPATH) export UNIFIED_CLASSPATH=$(call joinsegments, $(UNIFIED_CLASSPATH_SEGMENTS)) export UNIFIED_JACOCO_CLASSPATH=$(call joinsegments, $(UNIFIED_JACOCO_CLASSPATH_SEGMENTS)) export UNIFIED_BOOTCLASSPATH=-Xbootclasspath/a:$(UNIFIED_CLASSPATH) # note javaws, itwebsettings and policyeditor (== LAUNCHER_BOOTCLASSPATH) must be always able to compile and run *without* plugin export LAUNCHER_BOOTCLASSPATH="$(UNIFIED_BOOTCLASSPATH)" export PLUGIN_BOOTCLASSPATH='"$(UNIFIED_BOOTCLASSPATH)"' export PLUGIN_COVERAGE_BOOTCLASSPATH='"-Xbootclasspath/a:$(UNIFIED_JACOCO_CLASSPATH)"' # Fake update version to work with the Deployment Toolkit script used by Oracle # http://download.oracle.com/javase/tutorial/deployment/deploymentInDepth/depltoolkit_index.html export JDK_UPDATE_VERSION=50 # Sources list export PLUGIN_TEST_SRCS = $(abs_top_srcdir)/plugin/tests/LiveConnect/*.java export NETX_PKGS = javax.jnlp net.sourceforge.nanoxml net.sourceforge.jnlp \ net.sourceforge.jnlp.about \ net.sourceforge.jnlp.cache net.sourceforge.jnlp.config \ net.sourceforge.jnlp.controlpanel net.sourceforge.jnlp.event \ net.sourceforge.jnlp.runtime net.sourceforge.jnlp.security \ net.sourceforge.jnlp.security.viewer net.sourceforge.jnlp.services \ net.sourceforge.jnlp.tools net.sourceforge.jnlp.util \ sun.applet if ENABLE_PLUGIN export ICEDTEAPLUGIN_CLEAN = clean-IcedTeaPlugin export LIVECONNECT_DIR = netscape sun/applet export PLUGIN_DIR=$(abs_top_builddir)/plugin/icedteanp export PLUGIN_SRCDIR=$(abs_top_srcdir)/plugin/icedteanp export LIVECONNECT_SRCS = $(PLUGIN_SRCDIR)/java export ICEDTEAPLUGIN_TARGET = $(PLUGIN_DIR)/$(BUILT_PLUGIN_LIBRARY) stamps/liveconnect-dist.stamp export PLUGIN_PKGS = sun.applet netscape.security netscape.javascript #this is for plugin testcoverage export COVERABLE_PLUGIN_DIR=$(TESTS_DIR)/icedteanp-build-with-jacoco endif if CP_SUPPORTS_REFLINK REFLINK = --reflink=auto endif if SRC_DIR_HARDLINKABLE SRC_DIR_LINK = -l else SRC_DIR_LINK = $(REFLINK) endif if ENABLE_DOCS JAVADOC_OPTS=-use -keywords -encoding UTF-8 -splitIndex \ -bottom ' Submit a bug or feature' if JAVADOC_SUPPORTS_J_OPTIONS JAVADOC_MEM_OPTS=-J-Xmx1024m -J-Xms128m endif endif # if you create netx-dist-tests-whitelist in top directory, and place "expr match" regexes # (separate by one of IFS's values (most commonly space)) into it, you can control reproducers which compile or/xor run. # if you need declare space in your regex, use \s as described in "expr match" documentation ECHO_WHITELIST=if [ -f $(REPRODUCERS_CLASS_WHITELIST) ] ; then cat $(REPRODUCERS_CLASS_WHITELIST) ; else echo ".*" ; fi if ENABLE_WHITELIST COMPILE_WHITELIST_FILTER=`$(ECHO_WHITELIST)` RUN_WHITELIST_FILTER=.* else COMPILE_WHITELIST_FILTER=.* RUN_WHITELIST_FILTER=`$(ECHO_WHITELIST)` endif if WITH_RHINO RHINO_TESTS=stamps/check-pac-functions.stamp else RHINO_TESTS= endif if WITH_JUNIT JUNIT_TESTS=stamps/run-netx-unit-tests.stamp else JUNIT_TESTS= endif export PLUGIN_VERSION = IcedTea-Web $(FULL_VERSION) export EXTRA_DIST = $(top_srcdir)/netx $(top_srcdir)/plugin javaws.png javaws.desktop.in policyeditor.desktop.in icedteaweb-completion \ itweb-settings.desktop.in launcher $(top_srcdir)/tests html-gen.sh NEW_LINE_IFS $(top_srcdir)/metadata.in # reproducers `D`shortcuts export DTEST_SERVER=-Dtest.server.dir=$(REPRODUCERS_TESTS_SERVER_DEPLOYDIR) export DJAVAWS_BUILD=-Djavaws.build.bin=$(DESTDIR)$(bindir)/$(javaws) export DBROWSERS=-Dused.browsers=$(FIREFOX):$(CHROMIUM):$(CHROME):$(OPERA):$(MIDORI):$(EPIPHANY) export REPRODUCERS_DPARAMETERS= $(DTEST_SERVER) $(DJAVAWS_BUILD) $(DBROWSERS) $(BROWSER_TESTS_MODIFICATION) # end of `D`shortcuts #exported autoconf copies export EXPORTED_JAVAC=$(SYSTEM_JDK_DIR)/bin/javac export EXPORTED_JAR=$(SYSTEM_JDK_DIR)/bin/jar export EXPORTED_KEYTOOL=$(SYSTEM_JDK_DIR)/bin/keytool export EXPORTED_JARSIGNER=$(SYSTEM_JDK_DIR)/bin/jarsigner export EXPORTED_PACK200=$(SYSTEM_JDK_DIR)/bin/pack200 #end of exported autoconf copies # binary names javaws:= $(shell echo javaws | sed '@program_transform_name@') itweb_settings:= $(shell echo itweb-settings | sed '@program_transform_name@') policyeditor:= $(shell echo policyeditor | sed '@program_transform_name@') # the launcher needs to know $(bindir) and $(datadir) which can be different at # make-time from configure-time edit_launcher_script = sed \ -e "s|[@]LAUNCHER_BOOTCLASSPATH[@]|$(LAUNCHER_BOOTCLASSPATH)|g" \ -e "s|[@]JAVAWS_SPLASH_LOCATION[@]|$(datadir)/$(PACKAGE_NAME)/javaws_splash.png|g" \ -e "s|[@]JAVA[@]|$(JAVA)|g" \ -e "s|[@]JRE[@]|$(SYSTEM_JRE_DIR)|g" \ -e "s|[@]MAIN_CLASS[@]|$${MAIN_CLASS}|g" \ -e "s|[@]BIN_LOCATION[@]|$${BIN_LOCATION}|g" \ -e "s|[@]PROGRAM_NAME[@]|$${PROGRAM_NAME}|g" # Top-Level Targets # ================= all-local: stamps/netx-dist.stamp stamps/plugin.stamp launcher.build/$(javaws) \ javaws.desktop stamps/docs.stamp launcher.build/$(itweb_settings) itweb-settings.desktop \ launcher.build/$(policyeditor) policyeditor.desktop check-local: $(RHINO_TESTS) $(JUNIT_TESTS) clean-local: clean-netx clean-plugin clean-liveconnect \ clean-native-ecj clean-launchers clean-desktop-files clean-docs clean-generated-docs clean-metadata clean-tests clean-bootstrap-directory if [ -e stamps ] ; then \ rmdir stamps ; \ fi .PHONY: clean-IcedTeaPlugin clean-add-netx clean-add-netx-debug clean-add-plugin clean-add-plugin-debug \ clean-bootstrap-directory clean-native-ecj clean-desktop-files clean-netx-docs clean-docs clean-plugin-docs clean-generated-docs \ clean-tests check-local clean-launchers stamps/check-pac-functions.stamp stamps/run-netx-unit-tests.stamp clean-netx-tests \ clean-junit-runner clean-netx-unit-tests clean-metadata install-exec-local: ${mkinstalldirs} $(DESTDIR)$(bindir) $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/ $(DESTDIR)$(libdir) $(ICONS_DEST_DIR) if ENABLE_PLUGIN ${INSTALL_PROGRAM} $(PLUGIN_DIR)/$(BUILT_PLUGIN_LIBRARY) $(DESTDIR)$(libdir) ${INSTALL_DATA} $(abs_top_builddir)/liveconnect/lib/classes.jar $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/plugin.jar endif ${INSTALL_DATA} $(NETX_DIR)/lib/classes.jar $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/netx.jar ${INSTALL_DATA} $(NETX_SRCDIR)/javaws_splash.png $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/javaws_splash.png ${INSTALL_DATA} $(abs_top_srcdir)/javaws.png $(ICONS_DEST_DIR)/ ${INSTALL_PROGRAM} launcher.build/$(javaws) $(DESTDIR)$(bindir) ${INSTALL_PROGRAM} launcher.build/$(itweb_settings) $(DESTDIR)$(bindir) ${INSTALL_PROGRAM} launcher.build/$(policyeditor) $(DESTDIR)$(bindir) # all generated manpages are installed in swarm install-data-local: ${mkinstalldirs} -d $(DESTDIR)$(mandir) cp -r "$(DOCS_DIR)/man/"* $(DESTDIR)$(mandir)/ if ENABLE_DOCS ${mkinstalldirs} $(DESTDIR)$(htmldir) (cd ${abs_top_builddir}/docs/netx; \ for files in $$(find . -type f); \ do \ ${INSTALL_DATA} -D $${files} $(DESTDIR)$(htmldir)/netx/$${files}; \ done) if ENABLE_PLUGIN (cd ${abs_top_builddir}/docs/plugin; \ for files in $$(find . -type f); \ do \ ${INSTALL_DATA} -D $${files} $(DESTDIR)$(htmldir)/plugin/$${files}; \ done) endif endif # all generated manpages must be removed one by one uninstall-local: rm -f $(DESTDIR)$(libdir)/$(BUILT_PLUGIN_LIBRARY) rm -f $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/plugin.jar rm -f $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/netx.jar rm -r $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/javaws_splash.png rm -r $(ICONS_DEST_DIR)/javaws.png KNOWN_MANS="icedtea-web.1 icedtea-web-plugin.1 itweb-settings.1 javaws.1 policyeditor.1" ; \ KNOWN_DIRS="man1 de/man1 pl/man1 cs/man1" ; \ for file in $$KNOWN_MANS ; do \ for dir in $$KNOWN_DIRS ; do \ rm -f $(DESTDIR)$(mandir)/$$dir/$$file ; \ done ; \ done rm -f $(DESTDIR)$(bindir)/$(javaws) rm -f $(DESTDIR)$(bindir)/$(itweb_settings) rm -f $(DESTDIR)$(bindir)/$(policyeditor) rm -rf $(DESTDIR)$(htmldir) # Plugin if ENABLE_PLUGIN # IcedTeaPlugin.so. # Separate compile and link invocations to ensure intermediate object # is listed before -l options. See: # http://developer.mozilla.org/en/docs/XPCOM_Glue PLUGIN_SRC=IcedTeaNPPlugin.cc IcedTeaScriptablePluginObject.cc \ IcedTeaJavaRequestProcessor.cc IcedTeaPluginRequestProcessor.cc \ IcedTeaPluginUtils.cc IcedTeaParseProperties.cc PLUGIN_OBJECTS=IcedTeaNPPlugin.o IcedTeaScriptablePluginObject.o \ IcedTeaJavaRequestProcessor.o IcedTeaPluginRequestProcessor.o \ IcedTeaPluginUtils.o IcedTeaParseProperties.o $(PLUGIN_DIR)/%.o: $(PLUGIN_SRCDIR)/%.cc mkdir -p $(PLUGIN_DIR) && \ cd $(PLUGIN_DIR) && \ $(CXX) $(CXXFLAGS) \ $(DEFS) $(VERSION_DEFS) \ -DJDK_UPDATE_VERSION="\"$(JDK_UPDATE_VERSION)\"" \ -DPLUGIN_NAME="\"IcedTea-Web Plugin\"" \ -DJAVAWS_BIN="\"$(bindir)/$(javaws)\"" \ -DJAVAWS_NAME="\"$(javaws)\"" \ -DPLUGIN_VERSION="\"$(PLUGIN_VERSION)\"" \ -DPACKAGE_URL="\"$(PACKAGE_URL)\"" \ -DMOZILLA_VERSION_COLLAPSED="$(MOZILLA_VERSION_COLLAPSED)" \ -DICEDTEA_WEB_JRE="\"$(SYSTEM_JRE_DIR)\"" \ -DPLUGIN_BOOTCLASSPATH=$(PLUGIN_BOOTCLASSPATH) \ $(GLIB_CFLAGS) \ $(MOZILLA_CFLAGS) \ -fvisibility=hidden \ -fPIC -o $@ -c $< $(PLUGIN_DIR)/$(BUILT_PLUGIN_LIBRARY): $(addprefix $(PLUGIN_DIR)/,$(PLUGIN_OBJECTS)) cd $(PLUGIN_DIR) && \ $(CXX) $(CXXFLAGS) \ $(PLUGIN_OBJECTS) \ $(GLIB_LIBS) \ $(MOZILLA_LIBS) \ -shared -o $@ # Start of CPP Unit test targets # Note that UnitTest++ has its own makefile, however this is avoided because it creates an in-source build. $(CPP_UNITTEST_FRAMEWORK_LIB): $(CPP_UNITTEST_FRAMEWORK_SRCDIR) mkdir -p $(CPP_UNITTEST_FRAMEWORK_BUILDDIR) && \ pushd $(CPP_UNITTEST_FRAMEWORK_SRCDIR) && \ for cppfile in $$(find $(CPP_UNITTEST_FRAMEWORK_SRCDIR) -name '*.cpp') ; \ do \ objfile="$(CPP_UNITTEST_FRAMEWORK_BUILDDIR)/$$(basename $${cppfile%.cpp}).o" ; \ $(CXX) $(CXXFLAGS) -c $$cppfile -o $$objfile || exit 1 ; \ done ; \ ar cr $(CPP_UNITTEST_FRAMEWORK_LIB) $(CPP_UNITTEST_FRAMEWORK_BUILDDIR)/*.o ; \ popd clean-unittest++: rm -f $(CPP_UNITTEST_FRAMEWORK_BUILDDIR)/*.o rm -f $(CPP_UNITTEST_FRAMEWORK_LIB) if [ -e $(CPP_UNITTEST_FRAMEWORK_BUILDDIR) ] ; then \ rmdir $(CPP_UNITTEST_FRAMEWORK_BUILDDIR) ; \ fi stamps/cpp-unit-tests-compile.stamp: $(CPP_UNITTEST_FRAMEWORK_LIB) $(CPP_UNITTEST_SRCDIR) $(addprefix $(PLUGIN_DIR)/,$(PLUGIN_OBJECTS)) mkdir -p $(CPP_UNITTEST_DIR) && \ pushd $(CPP_UNITTEST_SRCDIR) && \ for cppfile in $$(find $(CPP_UNITTEST_SRCDIR) -name '*.cc') ; \ do \ objfile="$(CPP_UNITTEST_DIR)/$$(basename $${cppfile%.cc}).o" ; \ echo "Compiling $$cppfile to $$objfile"; \ $(CXX) $(CXXFLAGS) \ $(DEFS) $(VERSION_DEFS) \ -DJDK_UPDATE_VERSION="\"$(JDK_UPDATE_VERSION)\"" \ -DPLUGIN_NAME="\"IcedTea-Web Plugin\"" \ -DJAVAWS_BIN="\"$(bindir)/$(javaws)\"" \ -DJAVAWS_NAME="\"$(javaws)\"" \ -DPLUGIN_VERSION="\"$(PLUGIN_VERSION)\"" \ -DPACKAGE_URL="\"$(PACKAGE_URL)\"" \ -DMOZILLA_VERSION_COLLAPSED="$(MOZILLA_VERSION_COLLAPSED)" \ -DICEDTEA_WEB_JRE="\"$(SYSTEM_JRE_DIR)\"" \ -DPLUGIN_BOOTCLASSPATH=$(PLUGIN_BOOTCLASSPATH) \ $(GLIB_CFLAGS) \ $(MOZILLA_CFLAGS) \ "-I$(CPP_UNITTEST_FRAMEWORK_SRCDIR)/src" \ "-I$(PLUGIN_SRCDIR)" \ -o $$objfile -c $$cppfile || exit 1 ; \ done ; \ popd ; \ mkdir -p stamps ; \ touch $@ $(CPP_UNITTEST_EXECUTABLE): $(CPP_UNITTEST_FRAMEWORK_LIB) stamps/cpp-unit-tests-compile.stamp cd $(CPP_UNITTEST_DIR) && \ $(CXX) $(CXXFLAGS) \ $(addprefix $(PLUGIN_DIR)/,$(PLUGIN_OBJECTS)) \ $(CPP_UNITTEST_DIR)/*.o \ -lrt \ -lpthread \ $(GLIB_LIBS) \ $(MOZILLA_LIBS) \ $(CPP_UNITTEST_FRAMEWORK_LIB)\ $(BUILT_CPP_UNIT_TEST_FRAMEWORK) -o $@ clean-cpp-unit-tests: rm -f stamps/cpp-unit-tests-compile.stamp rm -f $(CPP_UNITTEST_EXECUTABLE) rm -f $(CPP_UNITTEST_DIR)/*.o run-cpp-unit-tests: $(CPP_UNITTEST_EXECUTABLE) $(CPP_UNITTEST_EXECUTABLE) # End of CPP Unit test targets clean-IcedTeaPlugin: rm -f $(PLUGIN_DIR)/*.o rm -f $(PLUGIN_DIR)/$(BUILT_PLUGIN_LIBRARY) if [ $(abs_top_srcdir) != $(abs_top_builddir) ]; then \ if [ -e $(abs_top_builddir)/plugin/icedteanp ] ; then \ rmdir $(abs_top_builddir)/plugin/icedteanp ; \ rmdir $(abs_top_builddir)/plugin ; \ fi ; \ fi endif stamps/plugin.stamp: $(ICEDTEAPLUGIN_TARGET) mkdir -p stamps touch stamps/plugin.stamp clean-plugin: $(ICEDTEAPLUGIN_CLEAN) rm -f stamps/plugin.stamp liveconnect-source-files.txt: if test "x${LIVECONNECT_DIR}" != x; then \ find $(LIVECONNECT_SRCS) -name '*.java' | sort > $@ ; \ fi touch $@ stamps/liveconnect.stamp: liveconnect-source-files.txt stamps/netx.stamp if test "x${LIVECONNECT_DIR}" != x; then \ mkdir -p $(abs_top_builddir)/liveconnect && \ $(SYSTEM_JDK_DIR)/bin/javac $(IT_JAVACFLAGS) \ -d $(abs_top_builddir)/liveconnect \ $(call composeclasspath,$(NETX_DIR) $(TAGSOUP_JAR) $(RHINO_JAR)) \ -sourcepath $(LIVECONNECT_SRCS) \ @liveconnect-source-files.txt ; \ fi mkdir -p stamps touch $@ stamps/liveconnect-dist.stamp: stamps/liveconnect.stamp if test "x${LIVECONNECT_DIR}" != x; then \ (cd $(abs_top_builddir)/liveconnect ; \ mkdir -p lib ; \ $(SYSTEM_JDK_DIR)/bin/jar cf lib/classes.jar $(LIVECONNECT_DIR) ; \ cp -pPR $(SRC_DIR_LINK) $(LIVECONNECT_SRCS) src; \ find src -type f -exec chmod 640 '{}' ';' -o -type d -exec chmod 750 '{}' ';'; \ cd src ; \ $(ZIP) -qr $(abs_top_builddir)/liveconnect/lib/src.zip $(LIVECONNECT_DIR) ) ; \ fi mkdir -p stamps touch $@ clean-liveconnect: rm -rf $(abs_top_builddir)/liveconnect rm -f stamps/liveconnect-dist.stamp rm -f liveconnect-source-files.txt rm -f stamps/liveconnect.stamp # NetX # requires availability of OpenJDK source code including # a patch applied to sun.plugin.AppletViewerPanel and generated sources netx-source-files.txt: find $(NETX_SRCDIR) -name '*.java' | sort > $@ ; \ for src in $(NETX_EXCLUDE_SRCS) ; \ do \ sed -i "/$${src}/ d" $@ ; \ done if !WITH_RHINO sed -i '/RhinoBasedPacEvaluator/ d' $@ endif # if 'sed' will be missing on machine, use old IFS hack as on other places # the 'sed' cycles is changing some custom version like 1.6.2 fedora23.4 to simple 1.6 # if changed, keep in mind that also 1.7 should bubble to 1.7 # also 1.7pre or 1.7preHASH should end up like 1.7 $(abs_top_builddir)/metadata: $(top_srcdir)/metadata.in mkdir -p $(abs_top_builddir)/metadata-work ; \ METAFILES=`ls $(top_srcdir)/metadata.in` ; \ SEDDED_VERSION=`echo "$(FULL_VERSION)" | sed 's/[^0-9]\+/ /g'` ; \ x=0; for i in $$SEDDED_VERSION ; do \ let x++; \ if [ $$x -eq 1 ] ; then V1=$$i; fi; \ if [ $$x -eq 2 ] ; then V2=$$i; fi; \ done; \ XVERSION=$$V1.$$V2; \ for F in $$METAFILES ; do \ cat $(top_srcdir)/metadata.in/$$F | sed "s;%{name};$(PACKAGE_NAME);g" | sed "s;%{version};$$XVERSION;g" > $(abs_top_builddir)/metadata-work/$$F ; \ done ; \ mv $(abs_top_builddir)/metadata-work $(abs_top_builddir)/metadata ; check-metadata: $(abs_top_builddir)/metadata xmllint --noout $(abs_top_builddir)/metadata/* ; \ if [ $$? -eq 0 ] ; then \ echo "Passed: well formed" ; \ else \ echo "FAILED: well formed" ; \ fi ; \ xmllint --noout --schema http://maven.apache.org/xsd/maven-4.0.0.xsd $(abs_top_builddir)/metadata/*.pom ; \ if [ $$? -eq 0 ] ; then \ echo "Passed: valid poms" ; \ else \ echo "FAILED: valid poms" ; \ fi ; \ appstream-util validate $(abs_top_builddir)/metadata/*.appdata.xml $(abs_top_builddir)/metadata/*.metainfo.xml ; \ if [ $$? -eq 0 ] ; then \ echo "Passed: valid software descriptors" ; \ else \ echo "FAILED: valid software descriptors" ; \ fi ; # very strange results: # appstreamcli validate $(abs_top_builddir)/metadata/*.appdata.xml $(abs_top_builddir)/metadata/*.metainfo.xml stamps/generate-docs.stamp: stamps/netx.stamp mkdir -p "$(DOCS_DIR)" ; \ HTML_DOCS_TARGET_DIR="$(DOCS_DIR)/html" ; \ PLAIN_DOCS_TARGET_DIR="$(DOCS_DIR)/plain" ; \ MAN_DOCS_TARGET_DIR="$(DOCS_DIR)/man" ; \ mkdir "$$HTML_DOCS_TARGET_DIR" ; \ mkdir "$$PLAIN_DOCS_TARGET_DIR" ; \ mkdir "$$MAN_DOCS_TARGET_DIR" ; \ HTML_DOCS_INDEX="$$HTML_DOCS_TARGET_DIR/index.html" ; \ TP_COMMAND="$(SYSTEM_JRE_DIR)/bin/java -cp $(NETX_DIR) net.sourceforge.jnlp.util.docprovider.TextsProvider" ; \ TP_TAIL="false $(FULL_VERSION)" ; \ LANG_BACKUP=$$LANG ; \ echo "$(PLUGIN_VERSION)" > "$$HTML_DOCS_INDEX" ; \ echo "

    $(PLUGIN_VERSION) docs:

    " >> "$$HTML_DOCS_INDEX" ; \ for LANG_ID in en_US.UTF-8 cs_CZ.UTF-8 pl_PL.UTF-8 de_DE.UTF-8 ; do \ ID=`echo "$$LANG_ID" | head -c 2` ; \ ENCOD=`echo "$$LANG_ID" | tail -c 6 -` ; \ export LANG=$$LANG_ID; \ mkdir "$$HTML_DOCS_TARGET_DIR/$$ID" ; \ echo "
  • $$LANG_ID
  • " >> "$$HTML_DOCS_INDEX" ; \ $$TP_COMMAND html "$$HTML_DOCS_TARGET_DIR/$$ID" $$TP_TAIL ; \ mkdir "$$PLAIN_DOCS_TARGET_DIR/$$ID" ; \ $$TP_COMMAND plain "$$PLAIN_DOCS_TARGET_DIR/$$ID" 160 $$TP_TAIL; \ if [ $$ID = "en" ] ; then \ MAN_DESC="$$MAN_DOCS_TARGET_DIR/man1" ; \ else \ MAN_DESC="$$MAN_DOCS_TARGET_DIR/$$ID/man1" ; \ fi ; \ mkdir -p "$$MAN_DESC" ; \ $$TP_COMMAND man $$ENCOD "$$MAN_DESC" $$TP_TAIL ; \ $$TP_COMMAND htmlIntro "$(NETX_DIR)/net/sourceforge/jnlp/resources/about_$$ID.html" $$TP_TAIL; \ done ; \ export LANG=$$LANG_BACKUP ; \ echo "" >> $$HTML_DOCS_INDEX ; \ touch $@ stamps/netx-html-gen.stamp: (cd $$NETX_SRCDIR/..; \ mkdir -p html-gen; \ cp AUTHORS NEWS COPYING ChangeLog html-gen/; \ export HTML_GEN_DEBUG=true; \ ${SHELL} html-gen.sh 33; \ unset HTML_GEN_DEBUG) ${INSTALL_DATA} $(NETX_SRCDIR)/../html-gen/*.html $(NETX_RESOURCE_DIR) rm -r $(NETX_SRCDIR)/../html-gen/ mkdir -p stamps touch $@ stamps/netx.stamp: netx-source-files.txt stamps/netx-html-gen.stamp mkdir -p $(NETX_DIR) $(SYSTEM_JDK_DIR)/bin/javac $(IT_JAVACFLAGS) \ -d $(NETX_DIR) \ -sourcepath $(NETX_SRCDIR) \ $(call composeclasspath, $(TAGSOUP_JAR) $(RHINO_JAR)) \ @netx-source-files.txt (cd $(NETX_RESOURCE_DIR); \ for files in $$(find . -type f); \ do \ ${INSTALL_DATA} -D $${files} \ $(NETX_DIR)/net/sourceforge/jnlp/resources/$${files}; \ done) cp -a $(NETX_SRCDIR)/net/sourceforge/jnlp/runtime/pac-funcs.js \ $(NETX_DIR)/net/sourceforge/jnlp/runtime cp -a build.properties $(NETX_DIR)/net/sourceforge/jnlp/ mkdir -p stamps touch $@ stamps/netx-dist.stamp: stamps/netx.stamp $(abs_top_builddir)/netx.manifest stamps/generate-docs.stamp $(abs_top_builddir)/metadata (cd $(NETX_DIR) ; \ mkdir -p lib ; \ $(SYSTEM_JDK_DIR)/bin/jar cfm lib/classes.jar \ $(abs_top_builddir)/netx.manifest javax/jnlp net sun; \ cp -pPR $(SRC_DIR_LINK) $(NETX_SRCDIR) src; \ find src -type f -exec chmod 640 '{}' ';' -o -type d -exec chmod 750 '{}' ';'; \ cd src ; \ $(ZIP) -qr $(NETX_DIR)/lib/src.zip javax net sun) mkdir -p stamps touch $@ clean-netx: rm -rf $(NETX_DIR) rm -f stamps/netx-dist.stamp rm -f netx-source-files.txt rm -f stamps/netx.stamp rm -f stamps/netx-html-gen.stamp rm -f $(NETX_RESOURCE_DIR)/{NEWS,AUTHORS,COPYING,ChangeLog}.html clean-desktop-files: rm -f javaws.desktop rm -f itweb-settings.desktop launcher.build/$(javaws): launcher/launchers.in mkdir -p launcher.build MAIN_CLASS=net.sourceforge.jnlp.runtime.Boot ;\ BIN_LOCATION=$(bindir)/$(javaws) ;\ PROGRAM_NAME=$(javaws) ;\ $(edit_launcher_script) < $< > $@ launcher.build/$(itweb_settings): launcher/launchers.in mkdir -p launcher.build MAIN_CLASS=net.sourceforge.jnlp.controlpanel.CommandLine ;\ BIN_LOCATION=$(bindir)/$(itweb_settings) ;\ PROGRAM_NAME=$(itweb_settings) ;\ $(edit_launcher_script) < $< > $@ launcher.build/$(policyeditor): launcher/launchers.in mkdir -p launcher.build MAIN_CLASS=net.sourceforge.jnlp.security.policyeditor.PolicyEditor ;\ BIN_LOCATION=$(bindir)/$(policyeditor) ;\ PROGRAM_NAME=$(policyeditor) ;\ $(edit_launcher_script) < $< > $@ clean-launchers: rm -f launcher.build/$(javaws) rm -f launcher.build/$(itweb_settings) rm -f launcher.build/$(policyeditor) if [ -e launcher.build ] ; then \ rmdir launcher.build ; \ fi javaws.desktop: javaws.desktop.in sed "s#PATH_TO_JAVAWS#$(bindir)/$(javaws)#" < $(srcdir)/javaws.desktop.in > javaws.desktop itweb-settings.desktop: $(srcdir)/itweb-settings.desktop.in sed "s#PATH_TO_ITWEB_SETTINGS#$(bindir)/$(itweb_settings)#" \ < $(srcdir)/itweb-settings.desktop.in > itweb-settings.desktop policyeditor.desktop: $(srcdir)/policyeditor.desktop.in sed 's#PATH_TO_POLICYEDITOR#$(bindir)/$(policyeditor)#' \ < $(srcdir)/policyeditor.desktop.in > policyeditor.desktop # documentation stamps/docs.stamp: stamps/netx-docs.stamp stamps/plugin-docs.stamp touch stamps/docs.stamp clean-docs: clean-netx-docs clean-plugin-docs if [ -e ${abs_top_builddir}/docs ] ; then \ rmdir ${abs_top_builddir}/docs ; \ fi rm -f stamps/docs.stamp stamps/netx-docs.stamp: if ENABLE_DOCS $(SYSTEM_JDK_DIR)/bin/javadoc $(JAVADOC_MEM_OPTS) $(JAVADOC_OPTS) \ -d ${abs_top_builddir}/docs/netx -sourcepath $(NETX_SRCDIR) \ -doctitle 'IcedTea-Web: NetX API Specification' \ -windowtitle 'IcedTea-Web: NetX ' \ -header 'IcedTea-Web
    NetX
    ' \ $(call composeclasspath, $(TAGSOUP_JAR) $(RHINO_JAR)) \ $(NETX_PKGS) endif mkdir -p stamps touch stamps/netx-docs.stamp clean-netx-docs: rm -rf ${abs_top_builddir}/docs/netx rm -f stamps/netx-docs.stamp stamps/plugin-docs.stamp: if ENABLE_DOCS if ENABLE_PLUGIN $(SYSTEM_JDK_DIR)/bin/javadoc $(JAVADOC_MEM_OPTS) $(JAVADOC_OPTS) \ -d ${abs_top_builddir}/docs/plugin -sourcepath $(NETX_SRCDIR):$(LIVECONNECT_SRCS) \ -doctitle 'IcedTea-Web: Plugin API Specification' \ -windowtitle 'IcedTea-Web: Plugin ' \ -header 'IcedTea-Web
    Plugin
    ' \ $(call composeclasspath, $(TAGSOUP_JAR) $(RHINO_JAR)) \ $(PLUGIN_PKGS) endif endif mkdir -p stamps touch stamps/plugin-docs.stamp clean-plugin-docs: rm -rf ${abs_top_builddir}/docs/plugin rm -f stamps/plugin-docs.stamp clean-generated-docs: rm -rf "$(DOCS_DIR)" rm -f stamps/generate-docs.stamp clean-metadata: rm -rf $(abs_top_builddir)/metadata # check # ========================== clean-tests: clean-netx-tests clean-cpp-unit-tests clean-unittest++ if [ -e $(CPP_UNITTEST_DIR) ] ; then \ rmdir $(CPP_UNITTEST_DIR) ; \ fi if [ -e $(TESTS_DIR) ]; then \ rmdir $(TESTS_DIR) ; \ fi stamps/check-pac-functions.stamp: ./jrunscript $(abs_top_srcdir)/tests/netx/pac/pac-funcs-test.js \ $$(readlink -f $(abs_top_srcdir)/netx/net/sourceforge/jnlp/runtime/pac-funcs.js) ; \ mkdir -p stamps && \ touch $@ junit-runner-source-files.txt: find $(JUNIT_RUNNER_SRCDIR) -name '*.java' | sort > $@ jacoco-operator-source-files.txt: find $(JACOCO_OPERATOR_SRCDIR) -name '*.java' | sort > $@ $(JUNIT_RUNNER_JAR): junit-runner-source-files.txt stamps/test-extensions-compile.stamp mkdir -p $(JUNIT_RUNNER_DIR) && \ $(SYSTEM_JDK_DIR)/bin/javac $(IT_JAVACFLAGS) \ -d $(JUNIT_RUNNER_DIR) \ $(call composeclasspath, $(JUNIT_RUNTIME) $(TEST_EXTENSIONS_DIR)) \ @junit-runner-source-files.txt && \ $(SYSTEM_JDK_DIR)/bin/jar cf $@ -C $(JUNIT_RUNNER_DIR) . stamps/junit-jnlp-dist-dirs: junit-jnlp-dist-simple.txt stamps/junit-jnlp-dist-signed.stamp junit-jnlp-dist-custom.txt mkdir -p $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR) mkdir -p $(REPRODUCERS_BUILD_DIR) touch $@ junit-jnlp-dist-custom.txt: cd $(REPRODUCERS_TESTS_SRCDIR)/$(CUSTOM_REPRODUCERS)/ ; \ for x in $(COMPILE_WHITELIST_FILTER) ; do \ find . -maxdepth 1 -mindepth 1 | sed "s/.\/*//" | grep $$x > $(abs_top_builddir)/$@ || true ; \ done junit-jnlp-dist-simple.txt: cd $(REPRODUCERS_TESTS_SRCDIR)/simple/ ; \ for x in $(COMPILE_WHITELIST_FILTER) ; do \ find . -maxdepth 1 -mindepth 1 | sed "s/.\/*//" | grep $$x > $(abs_top_builddir)/$@ || true ; \ done stamps/junit-jnlp-dist-signed.stamp: types=($(SIGNED_REPRODUCERS)) ; \ for which in "$${types[@]}" ; do \ pushd $(REPRODUCERS_TESTS_SRCDIR)/$$which/ ; \ for x in $(COMPILE_WHITELIST_FILTER) ; do \ find . -maxdepth 1 -mindepth 1 | sed "s/.\/*//" | grep $$x > $(abs_top_builddir)/junit-jnlp-dist-$$which.txt ; \ done ; \ popd ; \ done ; \ mkdir -p stamps && \ touch $@ stamps/netx-dist-tests-prepare-reproducers.stamp: stamps/junit-jnlp-dist-dirs stamps/liveconnect-dist.stamp stamps/netx-dist.stamp stamps/plugin.stamp types=($(ALL_NONCUSTOM_REPRODUCERS)); \ for which in "$${types[@]}" ; do \ . $(abs_top_srcdir)/NEW_LINE_IFS ; \ simpleReproducers=(`cat $(abs_top_builddir)/junit-jnlp-dist-$$which.txt `); \ IFS="$$IFS_BACKUP" ; \ for dir in "$${simpleReproducers[@]}" ; do \ echo "processing: $$dir" ; \ mkdir -p "$(REPRODUCERS_BUILD_DIR)/$$dir" ; \ if [ -e "$(REPRODUCERS_TESTS_SRCDIR)/$$which/$$dir/srcs/" ]; then \ d=`pwd` ; \ cd "$(REPRODUCERS_TESTS_SRCDIR)/$$which/$$dir/srcs/" ; \ srcFiles=`find . -mindepth 1 -type f -name "*.java" | sed "s/.\/*//"` ; \ notSrcFiles=`find . -mindepth 1 -type f \! -name "*.java" | sed "s/.\/*//"` ; \ $(SYSTEM_JDK_DIR)/bin/javac -cp $(NETX_DIR)/lib/classes.jar:$(abs_top_builddir)/liveconnect -d "$(REPRODUCERS_BUILD_DIR)/$$dir/" $$srcFiles ; \ if [ -n "$$notSrcFiles" ] ; then \ cp -R --parents $$notSrcFiles "$(REPRODUCERS_BUILD_DIR)/$$dir/" ; \ fi ; \ cd "$(REPRODUCERS_BUILD_DIR)/$$dir/" ; \ if [ -f $(META_MANIFEST) ]; \ then \ $(SYSTEM_JDK_DIR)/bin/jar cfm "$(REPRODUCERS_TESTS_SERVER_DEPLOYDIR)/$$dir.jar" $(META_MANIFEST) * ; \ else \ $(SYSTEM_JDK_DIR)/bin/jar cf "$(REPRODUCERS_TESTS_SERVER_DEPLOYDIR)/$$dir.jar" * ; \ fi; \ AN="Application-Name:" ; \ grep $$AN $(META_MANIFEST) 2>/dev/null >/dev/null ; \ GREP_R=$$?; \ if [ ! -f $(META_MANIFEST) -o $$GREP_R -ne 0 ]; \ then \ TMP_MANIFEST=`mktemp` ; \ echo "$$AN $$dir" > $$TMP_MANIFEST ; \ $(SYSTEM_JDK_DIR)/bin/jar ufm "$(REPRODUCERS_TESTS_SERVER_DEPLOYDIR)/$$dir.jar" $$TMP_MANIFEST ; \ rm -f $$TMP_MANIFEST ; \ fi ; \ cd "$$d" ; \ fi; \ done ; \ done ; \ mkdir -p stamps && \ touch $@ stamps/netx-dist-tests-sign-some-reproducers.stamp: stamps/netx-dist-tests-prepare-reproducers.stamp keystore=$(abs_top_builddir)/$(PRIVATE_KEYSTORE_NAME); \ types=($(SIGNED_REPRODUCERS)) ; \ for which in "$${types[@]}" ; do \ tcaw=$(TEST_CERT_ALIAS)_$$which ; \ $(SYSTEM_JRE_DIR)/bin/keytool -genkey -alias $$tcaw -keystore $$keystore -keypass $(PRIVATE_KEYSTORE_PASS) -storepass $(PRIVATE_KEYSTORE_PASS) -dname "cn=$$tcaw, ou=$$tcaw, o=$$tcaw, c=$$tcaw" ; \ . $(abs_top_srcdir)/NEW_LINE_IFS ; \ signedReproducers=(`cat $(abs_top_builddir)/junit-jnlp-dist-$$which.txt `); \ IFS="$$IFS_BACKUP" ; \ for dir in "$${signedReproducers[@]}" ; do \ $(SYSTEM_JDK_DIR)/bin/jarsigner -keystore $$keystore -storepass $(PRIVATE_KEYSTORE_PASS) -keypass $(PRIVATE_KEYSTORE_PASS) "$(REPRODUCERS_TESTS_SERVER_DEPLOYDIR)/$$dir.jar" $$tcaw ; \ done ; \ done ; \ mkdir -p stamps && \ touch $@ stamps/change-dots-to-paths.stamp: stamps/netx-dist-tests-sign-some-reproducers.stamp pushd $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR); \ types=($(ALL_NONCUSTOM_REPRODUCERS)); \ for which in "$${types[@]}" ; do \ . $(abs_top_srcdir)/NEW_LINE_IFS ; \ simpleReproducers=(`cat $(abs_top_builddir)/junit-jnlp-dist-$$which.txt `); \ IFS="$$IFS_BACKUP" ; \ for dir in "$${simpleReproducers[@]}" ; do \ if test "$${dir:0:1}" = "." ; then \ echo "reproducer $$dir starts with dot. It is forbidden" ; \ exit 5; \ fi; \ if test "$${dir:(-1)}" = "." ; then \ echo "reproducer $$dir ends with dot. It is forbidden" ; \ exit 5; \ fi; \ q=`expr index "$$dir" .`; \ r=$$? ; \ if [ $$r = 0 ]; then \ slashed_dir="./$${dir//.//}" ; \ path="`dirname $$slashed_dir`" ; \ file="`basename $$slashed_dir`.jar" ; \ echo "copying $$dir.jar to $$path as $$file" ; \ mkdir --parents $$path ; \ cp $$dir".jar" "$$path"/"$$file" ; \ fi ; \ done ; \ done ; \ popd ; \ mkdir -p stamps && \ touch $@ #this always tries to remove previous testcert #the code is copypasted from netx-dist-tests-remove-cert-from-public, because #with depending to not stamped target we always have to rerun reproducers targets stamps/exported-test-certs.stamp: stamps/change-dots-to-paths.stamp -types=($(SIGNED_REPRODUCERS)) ; \ PUBLIC_KEYSTORE=$$XDG_CONFIG_HOME ; \ if test "x$$PUBLIC_KEYSTORE" = x; then \ PUBLIC_KEYSTORE=${HOME}/.config ; \ fi ;\ PUBLIC_KEYSTORE=$$PUBLIC_KEYSTORE/$(PUBLIC_KEYSTORE_STUB); \ keystoredir=`dirname $(PUBLIC_KEYSTORE)`; \ [ ! -d $(keystoredir) ] && mkdir -p $(keystoredir); \ for which in "$${types[@]}" ; do \ $(SYSTEM_JDK_DIR)/bin/keytool -delete -alias $(TEST_CERT_ALIAS)_$$which -keystore $$PUBLIC_KEYSTORE -storepass $(PUBLIC_KEYSTORE_PASS) ; \ done ; types=($(SIGNED_REPRODUCERS)) ; \ for which in "$${types[@]}" ; do \ $(SYSTEM_JDK_DIR)/bin/keytool -export -alias $(TEST_CERT_ALIAS)_$$which -file $(EXPORTED_TEST_CERT_PREFIX)_$$which.$(EXPORTED_TEST_CERT_SUFFIX) -storepass $(PRIVATE_KEYSTORE_PASS) -keystore $(PRIVATE_KEYSTORE_NAME) ; \ done ; mkdir -p stamps && \ touch $@ stamps/netx-dist-tests-import-cert-to-public: stamps/exported-test-certs.stamp types=($(SIGNED_REPRODUCERS)) ; \ PUBLIC_KEYSTORE=$$XDG_CONFIG_HOME ; \ if test "x$$PUBLIC_KEYSTORE" = x; then \ PUBLIC_KEYSTORE=${HOME}/.config ; \ fi ;\ PUBLIC_KEYSTORE=$$PUBLIC_KEYSTORE/$(PUBLIC_KEYSTORE_STUB); \ keystoredir=`dirname $(PUBLIC_KEYSTORE)`; \ [ ! -d $(keystoredir) ] && mkdir -p $(keystoredir); \ for which in "$${types[@]}" ; do \ yes | $(SYSTEM_JDK_DIR)/bin/keytool -import -alias $(TEST_CERT_ALIAS)_$$which -keystore $$PUBLIC_KEYSTORE -storepass $(PUBLIC_KEYSTORE_PASS) -file $(EXPORTED_TEST_CERT_PREFIX)_$$which.$(EXPORTED_TEST_CERT_SUFFIX) ;\ done ; mkdir -p stamps && \ touch $@ netx-dist-tests-remove-cert-from-public: -types=($(SIGNED_REPRODUCERS)) ; \ PUBLIC_KEYSTORE=$$XDG_CONFIG_HOME ; \ if test "x$$PUBLIC_KEYSTORE" = x; then \ PUBLIC_KEYSTORE=${HOME}/.config ; \ fi ;\ PUBLIC_KEYSTORE=$$PUBLIC_KEYSTORE/$(PUBLIC_KEYSTORE_STUB); \ keystoredir=`dirname $(PUBLIC_KEYSTORE)`; \ [ ! -d $(keystoredir) ] && mkdir -p $(keystoredir); \ for which in "$${types[@]}" ; do \ $(SYSTEM_JDK_DIR)/bin/keytool -delete -alias $(TEST_CERT_ALIAS)_$$which -keystore $$PUBLIC_KEYSTORE -storepass $(PUBLIC_KEYSTORE_PASS) ; \ done ; -rm -rf stamps/netx-dist-tests-import-cert-to-public test-extensions-source-files.txt: find $(TEST_EXTENSIONS_SRCDIR) -name '*.java' | sort > $@ stamps/test-extensions-compile.stamp: stamps/netx-dist.stamp stamps/plugin.stamp stamps/junit-jnlp-dist-dirs test-extensions-source-files.txt mkdir -p $(TEST_EXTENSIONS_DIR); mkdir -p $(NETX_TEST_DIR); ln -s $(TEST_EXTENSIONS_DIR) $(TEST_EXTENSIONS_COMPATIBILITY_SYMLINK); $(SYSTEM_JDK_DIR)/bin/javac $(IT_JAVACFLAGS) \ -d $(TEST_EXTENSIONS_DIR) \ $(call composeclasspath, $(JUNIT_RUNTIME) $(NETX_DIR)/lib/classes.jar $(abs_top_builddir)/liveconnect/lib/classes.jar) \ @test-extensions-source-files.txt && \ mkdir -p stamps && \ touch $@ test-extensions-tests-source-files.txt: for x in $(COMPILE_WHITELIST_FILTER) ; do \ find $(TEST_EXTENSIONS_TESTS_SRCDIR) -name '*.java' | grep $$x | sort > $@ ; \ done stamps/test-extensions-tests-compile.stamp: stamps/junit-jnlp-dist-dirs test-extensions-tests-source-files.txt stamps/test-extensions-compile.stamp mkdir -p $(TEST_EXTENSIONS_TESTS_DIR); for x in `cat $(abs_top_builddir)/test-extensions-tests-source-files.txt` ; do \ $(SYSTEM_JDK_DIR)/bin/javac $(IT_JAVACFLAGS) \ -d $(TEST_EXTENSIONS_TESTS_DIR) \ $(call composeclasspath, $(JUNIT_RUNTIME) $(NETX_DIR)/lib/classes.jar $(TEST_EXTENSIONS_DIR)) \ $$x ; \ done ; \ mkdir -p stamps && \ touch $@ stamps/compile-reproducers-testcases.stamp: stamps/netx-dist.stamp stamps/plugin.stamp stamps/junit-jnlp-dist-dirs \ test-extensions-source-files.txt stamps/test-extensions-compile.stamp stamps/test-extensions-tests-compile.stamp types=($(ALL_REPRODUCERS)); \ for which in "$${types[@]}" ; do \ . $(abs_top_srcdir)/NEW_LINE_IFS ; \ simpleReproducers=(`cat $(abs_top_builddir)/junit-jnlp-dist-$$which.txt `); \ IFS="$$IFS_BACKUP" ; \ for dir in "$${simpleReproducers[@]}" ; do \ echo "compiling" $$dir ; \ $(SYSTEM_JDK_DIR)/bin/javac $(IT_JAVACFLAGS) \ -d $(TEST_EXTENSIONS_TESTS_DIR) \ $(call composeclasspath, $(JUNIT_RUNTIME) $(NETX_DIR)/lib/classes.jar $(TEST_EXTENSIONS_DIR)) \ "$(REPRODUCERS_TESTS_SRCDIR)/$$which/$$dir/testcases/"*.java ; \ if [ -d "$(REPRODUCERS_TESTS_SRCDIR)/$$which/$$dir/testcases" ]; then \ pushd "$(REPRODUCERS_TESTS_SRCDIR)/$$which/$$dir/testcases" ; \ NONJAVA_RESOURCES=`ls | grep -v ".*\\.java$$"` ; \ if [ -n "$$NONJAVA_RESOURCES" ]; then \ cp $$NONJAVA_RESOURCES $(TEST_EXTENSIONS_TESTS_DIR)/ ; \ fi ; \ popd ; \ fi ; \ done ; \ done ; \ mkdir -p stamps && \ touch $@ stamps/copy-reproducers-resources.stamp: stamps/junit-jnlp-dist-dirs types=($(ALL_REPRODUCERS)); \ for which in "$${types[@]}" ; do \ . $(abs_top_srcdir)/NEW_LINE_IFS ; \ simpleReproducers=(`cat $(abs_top_builddir)/junit-jnlp-dist-$$which.txt `); \ IFS="$$IFS_BACKUP" ; \ for dir in "$${simpleReproducers[@]}" ; do \ cp -R "$(REPRODUCERS_TESTS_SRCDIR)/$$which/$$dir/resources/"* $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR)/ ; \ done ; \ done ; \ mkdir -p stamps && \ touch $@ $(REPRODUCERS_CLASS_NAMES): whiteListed=$(RUN_WHITELIST_FILTER); \ cd $(TEST_EXTENSIONS_TESTS_DIR) ; \ class_names= ; \ for test in `find -type f` ; do \ class_name=`echo $$test | sed -e 's|\.class$$||' -e 's|^\./||'` ; \ class_name=`echo $$class_name | sed -e 's|/|.|g' ` ; \ INCLUDE="NO" ; \ for x in $$whiteListed ; do \ q=`expr match "$$class_name" "$$x"`; \ r=$$? ; \ if [ $$r = 0 ]; then \ echo "$$class_name will be included in reproducers testcases because of $$x pattern in $(REPRODUCERS_CLASS_WHITELIST). Matching was $$q"; \ INCLUDE="YES" ; \ fi; \ done; \ if [ "$$INCLUDE" = "YES" ]; then \ class_names="$$class_names $$class_name" ; \ else \ echo "$$class_name had no match in $(REPRODUCERS_CLASS_WHITELIST). Excluding"; \ fi; \ done ; \ echo $$class_names > $(REPRODUCERS_CLASS_NAMES) stamps/run-netx-dist-tests.stamp: stamps/netx-dist.stamp stamps/plugin.stamp launcher.build/$(javaws) \ javaws.desktop stamps/docs.stamp launcher.build/$(itweb_settings) itweb-settings.desktop launcher.build/$(policyeditor) policyeditor.desktop \ stamps/netx.stamp stamps/junit-jnlp-dist-dirs stamps/netx-dist-tests-import-cert-to-public \ stamps/test-extensions-compile.stamp stamps/compile-reproducers-testcases.stamp $(JUNIT_RUNNER_JAR) stamps/copy-reproducers-resources.stamp\ $(TESTS_DIR)/$(REPORT_STYLES_DIRNAME) $(REPRODUCERS_CLASS_NAMES) stamps/process-custom-reproducers.stamp cd $(TEST_EXTENSIONS_DIR) ; \ class_names=`cat $(REPRODUCERS_CLASS_NAMES)` ; \ CLASSPATH=$(call joinsegments, $(NETX_DIR)/lib/classes.jar $(JUNIT_RUNTIME) $(JUNIT_RUNNER_JAR) . $(TEST_EXTENSIONS_TESTS_DIR) $(TEST_EXTENSIONS_SRCDIR)) ; \ $(SYSTEM_JRE_DIR)/bin/java $(REPRODUCERS_DPARAMETERS) \ -Xbootclasspath/a:$$CLASSPATH CommandLine $$class_names if WITH_XSLTPROC -$(XSLTPROC) --stringparam logs logs_reproducers.html $(TESTS_SRCDIR)/$(REPORT_STYLES_DIRNAME)/jreport.xsl $(TEST_EXTENSIONS_DIR)/tests-output.xml > $(TESTS_DIR)/index_reproducers.html -$(XSLTPROC) $(TESTS_SRCDIR)/$(REPORT_STYLES_DIRNAME)/logs.xsl $(TEST_EXTENSIONS_DIR)/ServerAccess-logs.xml > $(TESTS_DIR)/logs_reproducers.html -$(XSLTPROC) $(TESTS_SRCDIR)/$(REPORT_STYLES_DIRNAME)/textreport.xsl $(TEST_EXTENSIONS_DIR)/tests-output.xml > $(TESTS_DIR)/summary_reproducers.txt endif touch $@ stamps/process-custom-reproducers.stamp: stamps/junit-jnlp-dist-dirs stamps/netx-dist-tests-import-cert-to-public \ stamps/test-extensions-compile.stamp stamps/compile-reproducers-testcases.stamp $(JUNIT_RUNNER_JAR) stamps/copy-reproducers-resources.stamp\ $(TESTS_DIR)/$(REPORT_STYLES_DIRNAME) $(REPRODUCERS_CLASS_NAMES) . $(abs_top_srcdir)/NEW_LINE_IFS ; \ customReproducers=(`cat $(abs_top_builddir)/junit-jnlp-dist-custom.txt `); \ IFS="$$IFS_BACKUP" ; \ for dir in "$${customReproducers[@]}" ; do \ pushd $(REPRODUCERS_TESTS_SRCDIR)/$(CUSTOM_REPRODUCERS)/$$dir/srcs; \ $(MAKE) prepare-reproducer ; \ popd ; \ done ; \ mkdir -p stamps && \ touch $@ clean-custom-reproducers: junit-jnlp-dist-custom.txt . $(abs_top_srcdir)/NEW_LINE_IFS ; \ customReproducers=(`cat $(abs_top_builddir)/junit-jnlp-dist-custom.txt `); \ IFS="$$IFS_BACKUP" ; \ for dir in "$${customReproducers[@]}" ; do \ pushd $(REPRODUCERS_TESTS_SRCDIR)/custom/$$dir/srcs; \ $(MAKE) clean-reproducer ; \ popd ; \ done ; \ rm -f stamps/process-custom-reproducers.stamp #for global-links you must be root, for opera there do not exists user-links #although this targets will indeed create symbolic links to enable #icedtea-web plugin inside browser it is intended for testing purposes if ENABLE_PLUGIN stamps/user-links.stamp: stamps/netx-dist.stamp stamps/plugin.stamp \ launcher.build/$(javaws) stamps/netx.stamp $(DESTDIR)$(libdir)/$(BUILT_PLUGIN_LIBRARY) if [ $(MOZILLA_FAMILY_TEST) ] ; then \ if [ -e $(MOZILLA_LOCAL_PLUGINDIR)/$(PLUGIN_LINK_NAME) ] ; then \ mv -f $(MOZILLA_LOCAL_PLUGINDIR)/$(PLUGIN_LINK_NAME) $(MOZILLA_LOCAL_BACKUP_FILE) ; \ echo "$(MOZILLA_LOCAL_PLUGINDIR)/$(PLUGIN_LINK_NAME) backed up as $(MOZILLA_LOCAL_BACKUP_FILE)" ; \ else \ echo "$(MOZILLA_LOCAL_PLUGINDIR)/$(PLUGIN_LINK_NAME) doesn't exists, nothing to be backed up to $(MOZILLA_LOCAL_BACKUP_FILE)" ; \ fi ; \ pushd $(MOZILLA_LOCAL_PLUGINDIR) ; \ ln -s $(DESTDIR)$(libdir)/$(BUILT_PLUGIN_LIBRARY) $(PLUGIN_LINK_NAME) ; \ echo "$(DESTDIR)$(libdir)/$(BUILT_PLUGIN_LIBRARY) linked as $$PWD/$(PLUGIN_LINK_NAME)" ; \ popd ; \ fi ; \ touch $@ restore-user-links: if [ $(MOZILLA_FAMILY_TEST) ] ; then \ if [ -e $(MOZILLA_LOCAL_BACKUP_FILE) ] ; then \ mv -f $(MOZILLA_LOCAL_BACKUP_FILE) $(MOZILLA_LOCAL_PLUGINDIR)/$(PLUGIN_LINK_NAME) ; \ echo "$(MOZILLA_LOCAL_BACKUP_FILE) restored as $(MOZILLA_LOCAL_PLUGINDIR)/$(PLUGIN_LINK_NAME)" ; \ else \ rm -f $(MOZILLA_LOCAL_PLUGINDIR)/$(PLUGIN_LINK_NAME) ; \ echo "$(MOZILLA_LOCAL_BACKUP_FILE) do not exists, nothing to be restored. $(MOZILLA_LOCAL_PLUGINDIR)/$(PLUGIN_LINK_NAME) removed" ; \ fi ; \ fi ; if [ -e stamps/user-links.stamp ] ; then \ rm -f stamps/user-links.stamp ; \ fi stamps/global-links.stamp: stamps/netx-dist.stamp stamps/plugin.stamp launcher.build/$(javaws) \ stamps/netx.stamp $(DESTDIR)$(libdir)/$(BUILT_PLUGIN_LIBRARY) if [ $(MOZILLA_FAMILY_TEST) ] ; then \ dir="$(MOZILLA_GLOBAL32_PLUGINDIR)" ; \ arch=`arch` ; \ if [ "$$arch" = "x86_64" ] ; then \ dir="$(MOZILLA_GLOBAL64_PLUGINDIR)" ; \ fi ; \ if [ -e "$$dir"/$(PLUGIN_LINK_NAME) ] ; then \ mv -f "$$dir"/$(PLUGIN_LINK_NAME) $(MOZILLA_GLOBAL_BACKUP_FILE) ; \ echo "$$dir/$(PLUGIN_LINK_NAME) backed up as $(MOZILLA_GLOBAL_BACKUP_FILE)" ; \ else \ echo "$$dir/$(PLUGIN_LINK_NAME) do not exists, nothing to be backed up to $(MOZILLA_GLOBAL_BACKUP_FILE)" ; \ fi ; \ pushd "$$dir" ; \ ln -s $(DESTDIR)$(libdir)/$(BUILT_PLUGIN_LIBRARY) $(PLUGIN_LINK_NAME) ; \ echo "$(DESTDIR)$(libdir)/$(BUILT_PLUGIN_LIBRARY) linked as $$PWD/$(PLUGIN_LINK_NAME)" ; \ popd ; \ fi ; if [ "$(OPERA)" != "" ] ; then \ dir="$(OPERA_GLOBAL32_PLUGINDIR)" ; \ arch=`arch` ; \ if [ "$$arch" = "x86_64" ] ; then \ dir="$(OPERA_GLOBAL64_PLUGINDIR)" ; \ fi ; \ if [ -e "$$dir"/$(PLUGIN_LINK_NAME) ] ; then \ mv -f "$$dir"/$(PLUGIN_LINK_NAME) $(OPERA_GLOBAL_BACKUP_FILE) ; \ echo "$$dir/$(PLUGIN_LINK_NAME) backed up as $(OPERA_GLOBAL_BACKUP_FILE) "; \ else \ echo "$$dir/$(PLUGIN_LINK_NAME) do not exists, nothing to be backed up to $(OPERA_GLOBAL_BACKUP_FILE) "; \ fi ; \ pushd "$$dir" ; \ ln -s $(DESTDIR)$(libdir)/$(BUILT_PLUGIN_LIBRARY) $(PLUGIN_LINK_NAME) ; \ echo "$(DESTDIR)$(libdir)/$(BUILT_PLUGIN_LIBRARY) linked as $$PWD/$(PLUGIN_LINK_NAME)" ; \ popd ; \ fi ; \ touch $@ restore-global-links: if [ $(MOZILLA_FAMILY_TEST) ] ; then \ dir="$(MOZILLA_GLOBAL32_PLUGINDIR)" ; \ arch=`arch` ; \ if [ "$$arch" = "x86_64" ] ; then \ dir="$(MOZILLA_GLOBAL64_PLUGINDIR)" ; \ fi ; \ if [ -e $(MOZILLA_GLOBAL_BACKUP_FILE) ] ; then \ mv -f $(MOZILLA_GLOBAL_BACKUP_FILE) "$$dir"/$(PLUGIN_LINK_NAME) ; \ echo "$(MOZILLA_GLOBAL_BACKUP_FILE) restored as $$dir/$(PLUGIN_LINK_NAME)" ; \ else \ rm -f "$$dir"/$(PLUGIN_LINK_NAME) ; \ echo "$(MOZILLA_GLOBAL_BACKUP_FILE) do not exists, nothing to be restored. $$dir/$(PLUGIN_LINK_NAME) removed" ; \ fi ; \ fi ; if [ "$(OPERA)" != "" ] ; then \ dir="$(OPERA_GLOBAL32_PLUGINDIR)" ; \ arch=`arch` ; \ if [ "$$arch" = "x86_64" ] ; then \ dir="$(OPERA_GLOBAL64_PLUGINDIR)" ; \ fi ; \ if [ -e $(OPERA_GLOBAL_BACKUP_FILE) ] ; then \ mv -f $(OPERA_GLOBAL_BACKUP_FILE) "$$dir"/$(PLUGIN_LINK_NAME) ; \ echo "$(OPERA_GLOBAL_BACKUP_FILE) restored as $$dir/$(PLUGIN_LINK_NAME)" ; \ else \ rm -f "$$dir"/$(PLUGIN_LINK_NAME) ; \ echo "$(OPERA_GLOBAL_BACKUP_FILE) do not exist, nothing to be restored. $$dir/$(PLUGIN_LINK_NAME) removed" ; \ fi ; \ fi ; if [ -e stamps/global-links.stamp ] ; then \ rm -f stamps/global-links.stamp ; \ fi endif netx-unit-tests-source-files.txt: find $(NETX_UNIT_TEST_SRCDIR) -name '*.java' | sort > $@ stamps/netx-unit-tests-compile.stamp: stamps/netx.stamp \ netx-unit-tests-source-files.txt stamps/test-extensions-compile.stamp mkdir -p $(NETX_UNIT_TEST_DIR) && \ $(SYSTEM_JDK_DIR)/bin/javac $(IT_JAVACFLAGS) \ -d $(NETX_UNIT_TEST_DIR) \ $(call composeclasspath, $(JUNIT_RUNTIME) $(abs_top_builddir)/liveconnect/lib/classes.jar $(NETX_DIR)/lib/classes.jar $(TEST_EXTENSIONS_DIR) $(TAGSOUP_JAR)) \ @netx-unit-tests-source-files.txt && \ mkdir -p stamps && \ touch $@ $(TESTS_DIR)/$(REPORT_STYLES_DIRNAME): mkdir $(TESTS_DIR)/$(REPORT_STYLES_DIRNAME) cp $(TESTS_SRCDIR)/$(REPORT_STYLES_DIRNAME)/*.css $(TESTS_DIR)/$(REPORT_STYLES_DIRNAME)/ cp $(TESTS_SRCDIR)/$(REPORT_STYLES_DIRNAME)/*.js $(TESTS_DIR)/$(REPORT_STYLES_DIRNAME)/ $(UNIT_CLASS_NAMES): cd $(NETX_UNIT_TEST_DIR) ; \ class_names= ; \ for test in `find -type f` ; do \ class_name=`echo $$test | sed -e 's|\.class$$||' -e 's|^\./||'` ; \ class_name=`echo $$class_name | sed -e 's|/|.|g' ` ; \ class_names="$$class_names $$class_name" ; \ done ; \ echo $$class_names > $(UNIT_CLASS_NAMES); stamps/run-netx-unit-tests.stamp: stamps/netx-unit-tests-compile.stamp $(JUNIT_RUNNER_JAR) \ $(TESTS_DIR)/$(REPORT_STYLES_DIRNAME) $(UNIT_CLASS_NAMES) filename=" " ; \ cd $(NETX_UNIT_TEST_SRCDIR) ; \ for file in `find . -type f \! -iname "*.java"`; do\ filename=`echo $$file `; \ cp --parents $$filename $(NETX_UNIT_TEST_DIR) ; \ done ; \ cd $(NETX_UNIT_TEST_DIR) ; \ class_names=`cat $(UNIT_CLASS_NAMES)` ; \ CLASSPATH=$(call joinsegments, $(NETX_DIR)/lib/classes.jar $(abs_top_builddir)/liveconnect/lib/classes.jar $(JUNIT_RUNTIME) $(JUNIT_RUNNER_JAR) $(TEST_EXTENSIONS_DIR) . $(TEST_EXTENSIONS_SRCDIR) $(TAGSOUP_JAR)) ; \ $(SYSTEM_JRE_DIR)/bin/java -Xbootclasspath/a:$$CLASSPATH CommandLine $$class_names if WITH_XSLTPROC -$(XSLTPROC) --stringparam logs logs_unit.html $(TESTS_SRCDIR)/$(REPORT_STYLES_DIRNAME)/jreport.xsl $(NETX_UNIT_TEST_DIR)/tests-output.xml > $(TESTS_DIR)/index_unit.html -$(XSLTPROC) $(TESTS_SRCDIR)/$(REPORT_STYLES_DIRNAME)/logs.xsl $(NETX_UNIT_TEST_DIR)/ServerAccess-logs.xml > $(TESTS_DIR)/logs_unit.html -$(XSLTPROC) $(TESTS_SRCDIR)/$(REPORT_STYLES_DIRNAME)/textreport.xsl $(NETX_UNIT_TEST_DIR)/tests-output.xml > $(TESTS_DIR)/summary_unit.txt endif mkdir -p stamps && \ touch $@ stamps/compile-jacoco-operator.stamp: jacoco-operator-source-files.txt if WITH_JACOCO mkdir -p $(JACOCO_OPERATOR_DIR) && \ $(SYSTEM_JDK_DIR)/bin/javac $(IT_JAVACFLAGS) \ -d $(JACOCO_OPERATOR_DIR) \ $(call composeclasspath, $(JACOCO_CLASSPATH)) \ @jacoco-operator-source-files.txt ; else echo "Sorry, jacoco coverage report generator cant be compiled without jacoco installed. Try installing jacoco or specify with-jacoco value" ; exit 5 endif touch $@ #warning, during this target tests.build/netx/unit/tests-output.xml is backup and rewriten (but not coresponding html file) #xml results run with jacoco agent however, can be wrong, co the new tests-output.xml is then renamed and orginal one restored stamps/run-unit-test-code-coverage-jacoco.stamp: stamps/netx-unit-tests-compile.stamp $(JUNIT_RUNNER_JAR) \ $(TESTS_DIR)/$(REPORT_STYLES_DIRNAME) $(UNIT_CLASS_NAMES) stamps/compile-jacoco-operator.stamp if WITH_JACOCO filename=" " ; \ cd $(NETX_UNIT_TEST_SRCDIR) ; \ for file in `find . -type f \! -iname "*.java"`; do\ filename=`echo $$file `; \ cp --parents $$filename $(NETX_UNIT_TEST_DIR) ; \ done ; \ cd $(NETX_UNIT_TEST_DIR) ; \ for file in $(COVERAGE_MODIFIED_FILES) ; do \ mv $(NETX_UNIT_TEST_DIR)/$$file $(NETX_UNIT_TEST_DIR)/"$$file""$(EMMA_BACKUP_SUFFIX)" ; \ done ;\ class_names=`cat $(UNIT_CLASS_NAMES)` ; \ CLASSPATH=$(call joinsegments, $(NETX_DIR)/lib/classes.jar $(abs_top_builddir)/liveconnect/lib/classes.jar $(JUNIT_RUNTIME) $(JUNIT_RUNNER_JAR) $(TEST_EXTENSIONS_DIR) $(JACOCO_CLASSPATH) . $(TEST_EXTENSIONS_SRCDIR) $(TAGSOUP_JAR)) ; \ $(SYSTEM_JRE_DIR)/bin/java $(JACOCO_AGENT_SWITCH) -Xbootclasspath/a:$$CLASSPATH CommandLine $$class_names ; \ for file in $(COVERAGE_MODIFIED_FILES) ; do \ mv $(NETX_UNIT_TEST_DIR)/$$file $(NETX_UNIT_TEST_DIR)/"$$file""$(EMMA_SUFFIX)" ; \ mv $(NETX_UNIT_TEST_DIR)/"$$file""$(EMMA_BACKUP_SUFFIX)" $(NETX_UNIT_TEST_DIR)/$$file ; \ done ; \ $(JACOCO_OPERATOR_EXEC) \ report --die-soon --html-output coverage --xml-output coverage.xml --input-file jacoco.exec \ --input-srcs $(NETX_SRCDIR) $(PLUGIN_SRCDIR)/java $(NETX_UNIT_TEST_SRCDIR) $(JUNIT_RUNNER_SRCDIR) $(TEST_EXTENSIONS_SRCDIR) \ --input-builds $(NETX_DIR)/lib/classes.jar $(abs_top_builddir)/liveconnect/lib/classes.jar $(NETX_UNIT_TEST_DIR) $(JUNIT_RUNNER_JAR) $(TEST_EXTENSIONS_DIR) \ --title "IcedTea-Web unit-tests codecoverage" ; else echo "Sorry, coverage report cant be run without jacoco installed. Try installing jacoco or specify with-jacoco value" ; exit 5 endif touch $@ $(COVERABLE_PLUGIN_DIR): mkdir -p $(COVERABLE_PLUGIN_DIR); $(COVERABLE_PLUGIN_DIR)/%.o: $(PLUGIN_SRCDIR)/%.cc cd $(COVERABLE_PLUGIN_DIR) && \ $(CXX) $(CXXFLAGS) \ $(DEFS) $(VERSION_DEFS) \ -DJDK_UPDATE_VERSION="\"$(JDK_UPDATE_VERSION)\"" \ -DPLUGIN_NAME="\"IcedTea-Web Plugin with jacoco coverage agent\"" \ -DJAVAWS_BIN="\"$(bindir)/$(javaws)\"" \ -DJAVAWS_NAME="\"$(javaws)\"" \ -DPLUGIN_VERSION="\"$(PLUGIN_VERSION)\"" \ -DPACKAGE_URL="\"$(PACKAGE_URL)\"" \ -DMOZILLA_VERSION_COLLAPSED="$(MOZILLA_VERSION_COLLAPSED)" \ -DICEDTEA_WEB_JRE="\"$(SYSTEM_JRE_DIR)\"" \ -DPLUGIN_BOOTCLASSPATH=$(PLUGIN_COVERAGE_BOOTCLASSPATH) \ -DCOVERAGE_AGENT=$(JACOCO_AGENT_PLUGIN_SWITCH) \ $(GLIB_CFLAGS) \ $(MOZILLA_CFLAGS) \ -fvisibility=hidden \ -fPIC -o $@ -c $< $(COVERABLE_PLUGIN_DIR)/$(BUILT_PLUGIN_LIBRARY): $(addprefix $(COVERABLE_PLUGIN_DIR)/,$(PLUGIN_OBJECTS)) cd $(COVERABLE_PLUGIN_DIR) && \ $(CXX) $(CXXFLAGS) \ $(PLUGIN_OBJECTS) \ $(GLIB_LIBS) \ $(MOZILLA_LIBS) \ -shared -o $@ stamps/build-fake-plugin.stamp: $(COVERABLE_PLUGIN_DIR) $(addprefix $(PLUGIN_SRCDIR)/,$(PLUGIN_SRC)) $(addprefix $(COVERABLE_PLUGIN_DIR)/,$(PLUGIN_OBJECTS)) stamps/liveconnect-dist.stamp $(COVERABLE_PLUGIN_DIR)/$(BUILT_PLUGIN_LIBRARY) touch $@ #warning, during this target tests.build/netx/jnlp_testsengine/tests-output.xml is backup and rewriten (but not coresponding html file) #xml results run with jacoco agent, however, can be wrong, co the new tests-output.xml is then renamed and orginal one restored stamps/run-reproducers-test-code-coverage-jacoco.stamp: stamps/run-netx-dist-tests.stamp $(REPRODUCERS_CLASS_NAMES) \ stamps/compile-jacoco-operator.stamp stamps/build-fake-plugin.stamp if WITH_JACOCO cd $(TESTS_DIR) ; \ for file in $(COVERAGE_MODIFIED_FILES) ; do \ mv $(TEST_EXTENSIONS_DIR)/$$file $(TEST_EXTENSIONS_DIR)/"$$file""$(EMMA_BACKUP_SUFFIX)" ; \ done ;\ echo "backuping javaws in $(DESTDIR)$(bindir)" ; \ javaws_backup=$(DESTDIR)$(bindir)/javaws_backup ; \ mv $(DESTDIR)$(bindir)/javaws $$javaws_backup ; \ echo "patching $(javaws)" ; \ nw_bootclasspath="-Xbootclasspath/a:$(UNIFIED_JACOCO_CLASSPATH)" ; \ cat $$javaws_backup | sed "s|COMMAND.k.=\"..JAVA.\"|COMMAND[k]=\"\\$$\\{JAVA\\}\" ; k=1 ; COMMAND[k]=$(JACOCO_AGENT_JAVAWS_SWITCH)|" | sed "s,$(LAUNCHER_BOOTCLASSPATH),$$nw_bootclasspath," > $(DESTDIR)$(bindir)/$(javaws) ; \ chmod 777 $(DESTDIR)$(bindir)/$(javaws) ; \ echo "backuping plugin in $(DESTDIR)/$(libdir)$(BUILT_PLUGIN_LIBRARY)" ; \ plugin_backup=$(DESTDIR)$(libdir)/$(BUILT_PLUGIN_LIBRARY)_backup ; \ mv $(DESTDIR)$(libdir)/$(BUILT_PLUGIN_LIBRARY) $$plugin_backup ; \ echo "fakeing plugin" ; \ cp $(COVERABLE_PLUGIN_DIR)/$(BUILT_PLUGIN_LIBRARY) $(DESTDIR)$(libdir)/$(BUILT_PLUGIN_LIBRARY) ; \ testcases_srcs=( ) ; \ k=0 ; \ types=($(ALL_REPRODUCERS)); \ for which in "$${types[@]}" ; do \ . $(abs_top_srcdir)/NEW_LINE_IFS ; \ simpleReproducers=(`cat $(abs_top_builddir)/junit-jnlp-dist-$$which.txt `); \ IFS="$$IFS_BACKUP" ; \ for dir in "$${simpleReproducers[@]}" ; do \ testcases_srcs[k]="$(REPRODUCERS_TESTS_SRCDIR)/$$which/$$dir/testcases/" ; \ k=$$((k+1)) ; \ done ; \ done ; \ cd $(TEST_EXTENSIONS_DIR) ; \ class_names=`cat $(REPRODUCERS_CLASS_NAMES)` ; \ CLASSPATH=$(call joinsegments, $(NETX_DIR)/lib/classes.jar $(JUNIT_RUNTIME) $(JUNIT_RUNNER_JAR) . $(TEST_EXTENSIONS_DIR) $(JACOCO_CLASSPATH) $(TEST_EXTENSIONS_TESTS_DIR) $(TEST_EXTENSIONS_SRCDIR)) ; \ $(SYSTEM_JRE_DIR)/bin/java $(JACOCO_AGENT_SWITCH) $(REPRODUCERS_DPARAMETERS) \ -Xbootclasspath/a:$$CLASSPATH CommandLine $$class_names ; \ if [ -f $(JACOCO_JAVAWS_RESULTS) ] ; then \ jacoco_javaws_results=$(JACOCO_JAVAWS_RESULTS) ; \ $(JACOCO_OPERATOR_EXEC) \ report --die-soon --html-output coverage-javaws --xml-output coverage-javaws.xml --input-file $(JACOCO_JAVAWS_RESULTS) \ --input-srcs $(NETX_SRCDIR) \ --input-builds $(NETX_DIR)/lib/classes.jar \ --title "IcedTea-Web javaws reproducers codecoverage" ; \ fi; \ if [ -f $(JACOCO_PLUGIN_RESULTS) ] ; then \ jacoco_plugin_results=$(JACOCO_PLUGIN_RESULTS) ; \ $(JACOCO_OPERATOR_EXEC) \ report --die-soon --html-output coverage-plugin --xml-output coverage-plugin.xml --input-file $(JACOCO_PLUGIN_RESULTS) \ --input-srcs $(NETX_SRCDIR) $(PLUGIN_SRCDIR)/java \ --input-builds $(NETX_DIR)/lib/classes.jar $(abs_top_builddir)/liveconnect/lib/classes.jar \ --title "IcedTea-Web plugin reproducers codecoverage" ; \ fi; \ $(JACOCO_OPERATOR_EXEC) \ merge --die-soon --input-files jacoco.exec $$jacoco_javaws_results $$jacoco_plugin_results --output-file jacoco-merged-reproducers.exec ; \ $(JACOCO_OPERATOR_EXEC) \ report --html-output coverage --xml-output coverage.xml --input-file jacoco-merged-reproducers.exec \ --input-srcs $(NETX_SRCDIR) $(PLUGIN_SRCDIR)/java $(JUNIT_RUNNER_SRCDIR) $(TEST_EXTENSIONS_SRCDIR) $(TEST_EXTENSIONS_TESTS_SRCDIR) "$${testcases_srcs[@]}" \ --input-builds $(NETX_DIR)/lib/classes.jar $(abs_top_builddir)/liveconnect/lib/classes.jar $(JUNIT_RUNNER_JAR) $(TEST_EXTENSIONS_DIR) $(TEST_EXTENSIONS_TESTS_DIR) \ --title "IcedTea-Web reproducers-tests codecoverage" ; \ echo "restoring javaws in $(DESTDIR)$(bindir)" ; \ rm -f $(DESTDIR)$(bindir)/$(javaws); \ mv $$javaws_backup $(DESTDIR)$(bindir)/$(javaws); \ echo "restoring plugin in $(DESTDIR)/$(libdir)$(BUILT_PLUGIN_LIBRARY)" ; \ mv $$plugin_backup $(DESTDIR)$(libdir)/$(BUILT_PLUGIN_LIBRARY) ; \ for file in $(COVERAGE_MODIFIED_FILES) ; do \ mv $(TEST_EXTENSIONS_DIR)/$$file $(TEST_EXTENSIONS_DIR)/"$$file""$(EMMA_SUFFIX)" ; \ mv $(TEST_EXTENSIONS_DIR)/"$$file""$(EMMA_BACKUP_SUFFIX)" $(TEST_EXTENSIONS_DIR)/$$file ; \ done ; else echo "Sorry, coverage report cant be run without jacoco installed. Try installing jacoco or specify with-jacoco value" ; exit 5 endif touch $@ run-test-code-coverage-jacoco: stamps/run-unit-test-code-coverage-jacoco.stamp stamps/run-reproducers-test-code-coverage-jacoco.stamp if WITH_JACOCO cd $(TESTS_DIR) ; \ k=0 ; \ types=($(ALL_REPRODUCERS)); \ for which in "$${types[@]}" ; do \ . $(abs_top_srcdir)/NEW_LINE_IFS ; \ simpleReproducers=(`cat $(abs_top_builddir)/junit-jnlp-dist-$$which.txt `); \ IFS="$$IFS_BACKUP" ; \ for dir in "$${simpleReproducers[@]}" ; do \ testcases_srcs[k]="$(REPRODUCERS_TESTS_SRCDIR)/$$which/$$dir/testcases/" ; \ k=$$((k+1)) ; \ done ; \ done ; \ class_names=`cat $(REPRODUCERS_CLASS_NAMES)` ; \ $(JACOCO_OPERATOR_EXEC) \ merge --die-soon --input-files $(TEST_EXTENSIONS_DIR)/jacoco-merged-reproducers.exec $(NETX_UNIT_TEST_DIR)/jacoco.exec --output-file jacoco-merged.exec; \ $(JACOCO_OPERATOR_EXEC) \ report --html-output coverage --xml-output coverage.xml --input-file jacoco-merged.exec \ --input-srcs $(NETX_SRCDIR) $(PLUGIN_SRCDIR)/java $(JUNIT_RUNNER_SRCDIR) $(TEST_EXTENSIONS_SRCDIR) $(TEST_EXTENSIONS_TESTS_SRCDIR) "$${testcases_srcs[@]}" \ --input-builds $(NETX_DIR)/lib/classes.jar $(abs_top_builddir)/liveconnect/lib/classes.jar $(JUNIT_RUNNER_JAR) $(TEST_EXTENSIONS_DIR) $(TEST_EXTENSIONS_TESTS_DIR) \ --input-srcs $(NETX_UNIT_TEST_SRCDIR) \ --input-builds $(NETX_UNIT_TEST_DIR) \ --title "IcedTea-Web complete codecoverage" ; else echo "Sorry, coverage report cant be run without jacoco installed. Try installing jacoco or specify with-jacoco value" ; exit 5 endif run-test-server-on-44321: stamps/netx.stamp stamps/junit-jnlp-dist-dirs stamps/netx-dist-tests-import-cert-to-public \ stamps/test-extensions-compile.stamp stamps/compile-reproducers-testcases.stamp $(JUNIT_RUNNER_JAR) stamps/copy-reproducers-resources.stamp cd $(TEST_EXTENSIONS_DIR) ; \ CLASSPATH=$(call joinsegments, $(NETX_DIR)/lib/classes.jar $(JUNIT_RUNTIME) $(JUNIT_RUNNER_JAR) . $(TEST_EXTENSIONS_TESTS_DIR)) ; \ $(SYSTEM_JRE_DIR)/bin/java $(REPRODUCERS_DPARAMETERS) \ -Xbootclasspath/a:$$CLASSPATH net.sourceforge.jnlp.ServerAccess run-test-server-on-random-port: stamps/netx.stamp stamps/junit-jnlp-dist-dirs stamps/netx-dist-tests-import-cert-to-public \ stamps/test-extensions-compile.stamp stamps/compile-reproducers-testcases.stamp $(JUNIT_RUNNER_JAR) stamps/copy-reproducers-resources.stamp cd $(TEST_EXTENSIONS_DIR) ; \ CLASSPATH=$(call joinsegments, $(NETX_DIR)/lib/classes.jar $(JUNIT_RUNTIME) $(JUNIT_RUNNER_JAR) . $(TEST_EXTENSIONS_TESTS_DIR)) ; \ $(SYSTEM_JRE_DIR)/bin/java $(REPRODUCERS_DPARAMETERS) \ -Xbootclasspath/a:$$CLASSPATH net.sourceforge.jnlp.ServerAccess randomport clean-netx-tests: clean-netx-unit-tests clean-junit-runner clean-netx-dist-tests clean-test-code-coverage-jacoco if [ -e $(TESTS_DIR)/netx ]; then \ rmdir $(TESTS_DIR)/netx ; \ fi clean-junit-runner: rm -f junit-runner-source-files.txt rm -rf $(JUNIT_RUNNER_DIR) rm -f $(JUNIT_RUNNER_JAR) clean-netx-unit-tests: clean_tests_reports rm -f netx-unit-tests-source-files.txt rm -rf $(NETX_UNIT_TEST_DIR) rm -f $(UNIT_CLASS_NAMES) rm -f stamps/check-pac-functions.stamp rm -f stamps/run-netx-unit-tests.stamp rm -f stamps/netx-unit-tests-compile.stamp clean_tests_reports: rm -rf $(TESTS_DIR)/$(REPORT_STYLES_DIRNAME)/ rm -f $(TESTS_DIR)/*.html rm -f $(TESTS_DIR)/summary_unit.txt rm -f $(TESTS_DIR)/summary_reproducers.txt clean-netx-dist-tests: clean_tests_reports netx-dist-tests-remove-cert-from-public clean-custom-reproducers rm -f test-extensions-source-files.txt rm -f test-extensions-tests-source-files.txt rm -f $(TEST_EXTENSIONS_COMPATIBILITY_SYMLINK) rm -rf $(TEST_EXTENSIONS_TESTS_DIR) rm -rf $(REPRODUCERS_BUILD_DIR) rm -rf $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR) rm -rf $(TEST_EXTENSIONS_DIR) rm -f stamps/junit-jnlp-dist-dirs rm -f stamps/test-extensions-compile.stamp rm -f stamps/test-extensions-tests-compile.stamp rm -f stamps/netx-dist-tests-prepare-reproducers.stamp rm -f stamps/compile-reproducers-testcases.stamp rm -f stamps/copy-reproducers-resources.stamp rm -f stamps/netx-dist-tests-sign-some-reproducers.stamp rm -f stamps/change-dots-to-paths.stamp rm -f junit-jnlp-dist-simple.txt rm -f junit-jnlp-dist-custom.txt rm -f netx-dist-tests-tests-source-files.txt types=($(SIGNED_REPRODUCERS)) ; \ for which in "$${types[@]}" ; do \ rm -f junit-jnlp-dist-$$which.txt ; \ rm -f $(EXPORTED_TEST_CERT_PREFIX)_$$which.$(EXPORTED_TEST_CERT_SUFFIX) ; \ done ; rm -f stamps/exported-test-certs.stamp rm -f stamps/junit-jnlp-dist-signed.stamp rm -f $(REPRODUCERS_CLASS_NAMES) rm -f $(abs_top_builddir)/$(PRIVATE_KEYSTORE_NAME) rm -f stamps/run-netx-dist-tests.stamp clean-unit-test-code-coverage-jacoco: if [ -e stamps/run-unit-test-code-coverage-jacoco.stamp ]; then \ rm -rf $(NETX_UNIT_TEST_DIR)/coverage ; \ rm -f $(NETX_UNIT_TEST_DIR)/coverage.xml ; \ rm -f $(NETX_UNIT_TEST_DIR)/jacoco.exec ; \ rm -f $(NETX_UNIT_TEST_DIR)/tests-output_withEmma.xml ; \ rm -f stamps/run-unit-test-code-coverage-jacoco.stamp ; \ fi clean-reproducers-test-code-coverage-jacoco: if [ -e stamps/run-reproducers-test-code-coverage-jacoco.stamp ]; then \ rm -rf $(TEST_EXTENSIONS_DIR)/coverage-javaws ; \ rm -f $(TEST_EXTENSIONS_DIR)/coverage-javaws.xml ; \ rm -f $(TEST_EXTENSIONS_DIR)/jacoco_javaws.exec ; \ rm -rf $(TEST_EXTENSIONS_DIR)/coverage-plugin ; \ rm -f $(TEST_EXTENSIONS_DIR)/coverage-plugin.xml ; \ rm -f $(TEST_EXTENSIONS_DIR)/jacoco_plugin.exec ; \ rm -rf $(TEST_EXTENSIONS_DIR)/coverage ; \ rm -f $(TEST_EXTENSIONS_DIR)/coverage.xml ; \ rm -f $(TEST_EXTENSIONS_DIR)/jacoco-merged-reproducers.exec ; \ rm -f $(TEST_EXTENSIONS_DIR)/tests-output_withEmma.xml ; \ rm -f stamps/run-reproducers-test-code-coverage-jacoco.stamp ; \ fi clean-test-code-coverage-jacoco: clean-unit-test-code-coverage-jacoco clean-reproducers-test-code-coverage-jacoco clean-test-code-coverage-tools-jacoco if [ -e $(TESTS_DIR)/coverage.xml ]; then \ rm -rf $(TESTS_DIR)/coverage ; \ rm -f $(TESTS_DIR)/jacoco-merged.exec; \ fi clean-test-code-coverage-tools-jacoco: rm -rf $(JACOCO_OPERATOR_DIR) rm -rf $(COVERABLE_PLUGIN_DIR) rm -f stamps/compile-jacoco-operator.stamp; rm -f jacoco-operator-source-files.txt rm -f stamps/build-fake-plugin.stamp # plugin tests if ENABLE_PLUGIN stamps/plugin-tests.stamp: $(PLUGIN_TEST_SRCS) stamps/plugin.stamp mkdir -p plugin/tests/LiveConnect $(SYSTEM_JDK_DIR)/bin/javac $(IT_JAVACFLAGS) \ -d plugin/tests/LiveConnect \ -classpath liveconnect/lib/classes.jar \ $(PLUGIN_TEST_SRCS) ; $(SYSTEM_JDK_DIR)/bin/jar cf plugin/tests/LiveConnect/PluginTest.jar \ plugin/tests/LiveConnect/*.class ; cp -pPR $(SRC_DIR_LINK) $(abs_top_srcdir)/plugin/tests/LiveConnect/*.{js,html} \ plugin/tests/LiveConnect ; echo "Done. Now launch \"firefox file://`pwd`/index.html\"" ; mkdir -p stamps touch stamps/plugin-tests.stamp endif # Target Aliases # =============== add-netx: stamps/add-netx.stamp add-netx-debug: stamps/add-netx-debug.stamp netx: stamps/netx.stamp netx-dist: stamps/netx-dist.stamp plugin: stamps/plugin.stamp plugin-tests: stamps/plugin-tests.stamp check-pac-functions: stamps/check-pac-functions.stamp run-netx-unit-tests: stamps/run-netx-unit-tests.stamp links: stamps/global-links.stamp user-links: stamps/user-links.stamp run-netx-dist-tests: stamps/run-netx-dist-tests.stamp run-unit-test-code-coverage-jacoco: stamps/run-unit-test-code-coverage-jacoco.stamp run-reproducers-test-code-coverage-jacoco: stamps/run-reproducers-test-code-coverage-jacoco.stamp