./PaxHeaders.24993/icedtea-web-1.5.30000644000000000000000000000013212574544616013536 xustar0030 mtime=1441974670.143024909 30 atime=1441974670.149024979 30 ctime=1441974670.143024909 icedtea-web-1.5.3/0000775000076400007640000000000012574544616014537 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/PaxHeaders.24993/NEW_LINE_IFS0000644000000000000000000000013112574544466015344 xustar0030 mtime=1441974582.516016221 29 atime=1441974656.35386618 30 ctime=1441974670.143024909 icedtea-web-1.5.3/NEW_LINE_IFS0000664000076400007640000000017112574544466016425 0ustar00jvanekjvanek00000000000000#!/bin/sh NEW_LINE_IFS=" " IFS_BACKUP="$IFS"; #echo "1xx""$IFS""xx" ; IFS="$NEW_LINE_IFS" ; #echo "2xx""$IFS""xx" ; icedtea-web-1.5.3/PaxHeaders.24993/netx-dist-tests-whitelist0000644000000000000000000000013212574544466020475 xustar0030 mtime=1441974582.521016278 30 atime=1441974656.355866203 30 ctime=1441974670.142024898 icedtea-web-1.5.3/netx-dist-tests-whitelist0000664000076400007640000000000312574544466021547 0ustar00jvanekjvanek00000000000000.* icedtea-web-1.5.3/PaxHeaders.24993/html-gen.sh0000644000000000000000000000013212574544466015530 xustar0030 mtime=1441974582.519016255 30 atime=1441974656.354866192 30 ctime=1441974670.141024887 icedtea-web-1.5.3/html-gen.sh0000775000076400007640000001520512574544466016617 0ustar00jvanekjvanek00000000000000#!/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 REPO_URL="$(hg paths default | sed -r 's/.*icedtea.classpath.org\/(.*)/\1/')" start_time="$(date +%s.%N)" cd html-gen print_debug "Generating HTML content for javaws -about 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 REVS=(`hg log -l"$CHANGESETS" | grep 'changeset:' | cut -d: -f3 | tr '\n' ' '`) 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="\ \ " 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|") 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.5.3/PaxHeaders.24993/tests0000644000000000000000000000013212574544466014546 xustar0030 mtime=1441974582.593017107 30 atime=1441974670.149024979 30 ctime=1441974670.140024875 icedtea-web-1.5.3/tests/0000775000076400007640000000000012574544466015704 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/PaxHeaders.24993/report-styles0000644000000000000000000000013212574544466017402 xustar0030 mtime=1441974582.594017119 30 atime=1441974670.149024979 30 ctime=1441974670.140024875 icedtea-web-1.5.3/tests/report-styles/0000775000076400007640000000000012574544466020540 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/report-styles/PaxHeaders.24993/textreport.xsl0000644000000000000000000000013212574544466022427 xustar0030 mtime=1441974582.594017119 30 atime=1441974656.469867516 30 ctime=1441974670.140024875 icedtea-web-1.5.3/tests/report-styles/textreport.xsl0000664000076400007640000000774412574544466023524 0ustar00jvanekjvanek00000000000000 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.5.3/tests/report-styles/PaxHeaders.24993/report.css0000644000000000000000000000013212574544466021504 xustar0030 mtime=1441974582.594017119 30 atime=1441974656.469867516 30 ctime=1441974670.139024864 icedtea-web-1.5.3/tests/report-styles/report.css0000664000076400007640000000165612574544466022575 0ustar00jvanekjvanek00000000000000div.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.5.3/tests/report-styles/PaxHeaders.24993/output.css0000644000000000000000000000013212574544466021531 xustar0030 mtime=1441974582.594017119 30 atime=1441974656.469867516 30 ctime=1441974670.139024864 icedtea-web-1.5.3/tests/report-styles/output.css0000664000076400007640000000123012574544466022606 0ustar00jvanekjvanek00000000000000div.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.5.3/tests/report-styles/PaxHeaders.24993/logs.xsl0000644000000000000000000000013212574544466021153 xustar0030 mtime=1441974582.593017107 30 atime=1441974656.468867504 30 ctime=1441974670.139024864 icedtea-web-1.5.3/tests/report-styles/logs.xsl0000664000076400007640000001541012574544466022235 0ustar00jvanekjvanek00000000000000

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.5.3/tests/report-styles/PaxHeaders.24993/index.js0000644000000000000000000000013212574544466021124 xustar0030 mtime=1441974582.593017107 30 atime=1441974656.468867504 30 ctime=1441974670.139024864 icedtea-web-1.5.3/tests/report-styles/index.js0000664000076400007640000000460612574544466022213 0ustar00jvanekjvanek00000000000000function 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.5.3/tests/PaxHeaders.24993/test-extensions0000644000000000000000000000013212574544466017722 xustar0030 mtime=1441974582.593017107 30 atime=1441974670.149024979 30 ctime=1441974670.139024864 icedtea-web-1.5.3/tests/test-extensions/0000775000076400007640000000000012574544466021060 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/test-extensions/PaxHeaders.24993/sun0000644000000000000000000000013212574544466020527 xustar0030 mtime=1441974582.593017107 30 atime=1441974670.149024979 30 ctime=1441974670.139024864 icedtea-web-1.5.3/tests/test-extensions/sun/0000775000076400007640000000000012574544466021665 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/test-extensions/sun/PaxHeaders.24993/applet0000644000000000000000000000013212574544466022014 xustar0030 mtime=1441974582.593017107 30 atime=1441974670.149024979 30 ctime=1441974670.139024864 icedtea-web-1.5.3/tests/test-extensions/sun/applet/0000775000076400007640000000000012574544466023152 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/test-extensions/sun/applet/PaxHeaders.24993/mock0000644000000000000000000000013212574544466022745 xustar0030 mtime=1441974582.593017107 30 atime=1441974670.149024979 30 ctime=1441974670.139024864 icedtea-web-1.5.3/tests/test-extensions/sun/applet/mock/0000775000076400007640000000000012574544466024103 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/test-extensions/sun/applet/mock/PaxHeaders.24993/PluginPipeMock.java0000644000000000000000000000013012574544466026551 xustar0030 mtime=1441974582.593017107 28 atime=1441974656.6248693 30 ctime=1441974670.139024864 icedtea-web-1.5.3/tests/test-extensions/sun/applet/mock/PluginPipeMock.java0000664000076400007640000000724412574544466027643 0ustar00jvanekjvanek00000000000000package 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.5.3/tests/test-extensions/sun/applet/PaxHeaders.24993/PluginPipeMockUtil.java0000644000000000000000000000013212574544466026460 xustar0030 mtime=1441974582.593017107 30 atime=1441974656.623869288 30 ctime=1441974670.139024864 icedtea-web-1.5.3/tests/test-extensions/sun/applet/PluginPipeMockUtil.java0000664000076400007640000001320012574544466027535 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/test-extensions/PaxHeaders.24993/net0000644000000000000000000000013212574544466020510 xustar0030 mtime=1441974582.572016865 30 atime=1441974670.149024979 30 ctime=1441974670.139024864 icedtea-web-1.5.3/tests/test-extensions/net/0000775000076400007640000000000012574544466021646 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/test-extensions/net/PaxHeaders.24993/sourceforge0000644000000000000000000000013212574544466023033 xustar0030 mtime=1441974582.572016865 30 atime=1441974670.149024979 30 ctime=1441974670.139024864 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/0000775000076400007640000000000012574544466024171 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/PaxHeaders.24993/jnlp0000644000000000000000000000013212574544466023776 xustar0030 mtime=1441974582.592017095 30 atime=1441974670.149024979 30 ctime=1441974670.139024864 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/0000775000076400007640000000000012574544466025134 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/PaxHeaders.24993/util0000644000000000000000000000013212574544466024753 xustar0030 mtime=1441974582.592017095 30 atime=1441974670.149024979 30 ctime=1441974670.139024864 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/util/0000775000076400007640000000000012574544466026111 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/util/PaxHeaders.24993/logging0000644000000000000000000000013212574544466026401 xustar0030 mtime=1441974582.592017095 30 atime=1441974670.149024979 30 ctime=1441974670.139024864 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/util/logging/0000775000076400007640000000000012574544466027537 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/util/logging/PaxHeaders.24993/NoStdOutE0000644000000000000000000000013212574544466030225 xustar0030 mtime=1441974582.592017095 30 atime=1441974656.623869288 30 ctime=1441974670.139024864 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/util/logging/NoStdOutErrTest.java0000664000076400007640000001003712574544466033433 0ustar00jvanekjvanek00000000000000/* 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 classlaoder for itw (or better itw is creating its own one). The itw * classlaoder is then branch...or leaf of junit classlaoder. So any class loaded * by junit classlaoder 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.5.3/tests/test-extensions/net/sourceforge/jnlp/util/PaxHeaders.24993/FileTestUtils.jav0000644000000000000000000000013212574544466030272 xustar0030 mtime=1441974582.592017095 30 atime=1441974656.623869288 30 ctime=1441974670.139024864 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/util/FileTestUtils.java0000664000076400007640000001345612574544466031525 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/test-extensions/net/sourceforge/jnlp/PaxHeaders.24993/tools0000644000000000000000000000013212574544466025136 xustar0030 mtime=1441974582.592017095 30 atime=1441974670.149024979 30 ctime=1441974670.139024864 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/tools/0000775000076400007640000000000012574544466026274 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/tools/PaxHeaders.24993/WaitingForString0000644000000000000000000000013212574544466030376 xustar0030 mtime=1441974582.592017095 30 atime=1441974656.623869288 30 ctime=1441974670.139024864 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/tools/WaitingForStringProcess.java0000664000076400007640000000507212574544466033742 0ustar00jvanekjvanek00000000000000package 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.5.3/tests/test-extensions/net/sourceforge/jnlp/tools/PaxHeaders.24993/MessagePropertie0000644000000000000000000000013212574544466030414 xustar0030 mtime=1441974582.591017084 30 atime=1441974656.623869288 30 ctime=1441974670.139024864 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/tools/MessageProperties.java0000664000076400007640000000565212574544466032610 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/test-extensions/net/sourceforge/jnlp/tools/PaxHeaders.24993/CodeSignerCreato0000644000000000000000000000013212574544466030316 xustar0030 mtime=1441974582.591017084 30 atime=1441974656.622869277 30 ctime=1441974670.139024864 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/tools/CodeSignerCreator.java0000664000076400007640000002575012574544466032512 0ustar00jvanekjvanek00000000000000/* * 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 e) { throw (AssertionError) new AssertionError("Unable to use CertAndKeyGen class").initCause(e); } catch (NoSuchMethodException e) { throw (AssertionError) new AssertionError("Unable to use CertAndKeyGen class").initCause(e); } catch (SecurityException e) { throw (AssertionError) new AssertionError("Unable to use CertAndKeyGen class").initCause(e); } catch (InstantiationException e) { throw (AssertionError) new AssertionError("Unable to use CertAndKeyGen class").initCause(e); } catch (IllegalAccessException e) { throw (AssertionError) new AssertionError("Unable to use CertAndKeyGen class").initCause(e); } catch (IllegalArgumentException e) { throw (AssertionError) new AssertionError("Unable to use CertAndKeyGen class").initCause(e); } catch (InvocationTargetException e) { throw (AssertionError) new AssertionError("Unable to use CertAndKeyGen class").initCause(e); } } public PrivateKey getPrivateKey() { try { // return keyPair.getPrivateKey(); Class klass = keyPair.getClass(); Method method = klass.getMethod("getPrivateKey"); return (PrivateKey) method.invoke(keyPair); } catch (NoSuchMethodException error) { throw new AssertionError(error); } catch (IllegalAccessException error) { throw new AssertionError(error); } catch (IllegalArgumentException error) { throw new AssertionError(error); } catch (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 error) { throw new AssertionError(error); } catch (IllegalAccessException error) { throw new AssertionError(error); } catch (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")) { className = "sun.security.tools.keytool.CertAndKeyGen"; } else { throw new AssertionError("Unrecognized Java Version"); } return className; } } } icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/tools/PaxHeaders.24993/ClipboardHelpers0000644000000000000000000000013212574544466030360 xustar0030 mtime=1441974582.591017084 30 atime=1441974656.622869277 30 ctime=1441974670.139024864 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/tools/ClipboardHelpers.java0000664000076400007640000000521712574544466032366 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/test-extensions/net/sourceforge/jnlp/tools/PaxHeaders.24993/AsyncJavaws.java0000644000000000000000000000013212574544466030307 xustar0030 mtime=1441974582.590017073 30 atime=1441974656.622869277 30 ctime=1441974670.139024864 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/tools/AsyncJavaws.java0000664000076400007640000000651012574544466031372 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/test-extensions/net/sourceforge/jnlp/PaxHeaders.24993/mock0000644000000000000000000000013212574544466024727 xustar0030 mtime=1441974582.590017073 30 atime=1441974670.149024979 30 ctime=1441974670.139024864 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/mock/0000775000076400007640000000000012574544466026065 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/mock/PaxHeaders.24993/MockJNLPFile.java0000644000000000000000000000013212574544466030024 xustar0030 mtime=1441974582.590017073 30 atime=1441974656.622869277 30 ctime=1441974670.139024864 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/mock/MockJNLPFile.java0000664000076400007640000000375712574544466031121 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/test-extensions/net/sourceforge/jnlp/mock/PaxHeaders.24993/DummyJNLPFileWith0000644000000000000000000000013212574544466030142 xustar0030 mtime=1441974582.590017073 30 atime=1441974656.621869265 30 ctime=1441974670.139024864 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/mock/DummyJNLPFileWithJar.java0000664000076400007640000000622212574544466032602 0ustar00jvanekjvanek00000000000000package 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; } @Override public SecurityDesc getSecurity() { return new SecurityDesc(this, SecurityDesc.SANDBOX_PERMISSIONS, null); } public void setInfo(List info) { this.info = info; } }icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/mock/PaxHeaders.24993/DummyJNLPFile.jav0000644000000000000000000000013212574544466030065 xustar0030 mtime=1441974582.589017061 30 atime=1441974656.621869265 30 ctime=1441974670.139024864 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/mock/DummyJNLPFile.java0000664000076400007640000000507012574544466031311 0ustar00jvanekjvanek00000000000000/* Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.mock; import java.net.URL; import java.util.Locale; import net.sourceforge.jnlp.JNLPFile; import net.sourceforge.jnlp.ResourcesDesc; import net.sourceforge.jnlp.SecurityDesc; public class DummyJNLPFile extends JNLPFile { public static final URL JAR_URL; public static final URL CODEBASE_URL; static { try { JAR_URL = new URL("http://icedtea.classpath.org/netx/about.jar"); CODEBASE_URL = new URL("http://icedtea.classpath.org/netx/"); } catch (Exception ex) { throw new RuntimeException(ex); } } @Override public ResourcesDesc getResources() { return new ResourcesDesc(null, new Locale[0], new String[0], new String[0]); } @Override public URL getCodeBase() { return CODEBASE_URL; } @Override public SecurityDesc getSecurity() { return new SecurityDesc(this, SecurityDesc.SANDBOX_PERMISSIONS, null); } } icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/PaxHeaders.24993/closinglisteners0000644000000000000000000000013212574544466027365 xustar0030 mtime=1441974582.589017061 30 atime=1441974670.149024979 30 ctime=1441974670.139024864 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/0000775000076400007640000000000012574544466030523 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/PaxHeaders.24993/Strin0000644000000000000000000000013212574544466030464 xustar0030 mtime=1441974582.589017061 30 atime=1441974656.621869265 30 ctime=1441974670.139024864 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/StringRule.java0000664000076400007640000000375112574544466033472 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/PaxHeaders.24993/Strin0000644000000000000000000000032112574544466030464 xustar00119 path=icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/StringMatchClosingListener.java 30 mtime=1441974582.589017061 30 atime=1441974656.621869265 30 ctime=1441974670.139024864 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/StringMatchClosingList0000664000076400007640000000402312574544466035043 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/PaxHeaders.24993/Strin0000644000000000000000000000032112574544466030464 xustar00119 path=icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/StringBasedClosingListener.java 30 mtime=1441974582.589017061 30 atime=1441974656.621869265 30 ctime=1441974670.139024864 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/StringBasedClosingList0000664000076400007640000000425412574544466035033 0ustar00jvanekjvanek00000000000000/* StringBasedClosingListener.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.closinglisteners; import net.sourceforge.jnlp.ClosingListener; public class StringBasedClosingListener extends ClosingListener { private final String condition; public StringBasedClosingListener(String condition) { this.condition = condition; } @Override public void charReaded(char ch) { } @Override public void lineReaded(String s) { if (s.contains(condition)){ terminate(); } } public String getCondition() { return condition; } } icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/PaxHeaders.24993/Rules0000644000000000000000000000032212574544466030460 xustar00121 path=icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/RulesFolowingClosingListener.java 29 mtime=1441974582.58801705 30 atime=1441974656.620869254 30 ctime=1441974670.139024864 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/RulesFolowingClosingLi0000664000076400007640000001502112574544466035050 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/PaxHeaders.24993/Rule.0000644000000000000000000000013112574544466030351 xustar0029 mtime=1441974582.58801705 30 atime=1441974656.620869254 30 ctime=1441974670.139024864 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/Rule.java0000664000076400007640000000350112574544466032274 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/PaxHeaders.24993/Count0000644000000000000000000000031512574544466030460 xustar00116 path=icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/CountingClosingListener.java 29 mtime=1441974582.58801705 30 atime=1441974656.620869254 30 ctime=1441974670.139024864 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/CountingClosingListene0000664000076400007640000000421612574544466035102 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/PaxHeaders.24993/AutoO0000644000000000000000000000031412574544466030416 xustar00114 path=icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/AutoOkClosingListener.java 30 mtime=1441974582.587017038 30 atime=1441974656.620869254 30 ctime=1441974670.139024864 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/AutoOkClosingListener.0000664000076400007640000000364012574544466034756 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/PaxHeaders.24993/AutoE0000644000000000000000000000031712574544466030407 xustar00117 path=icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/AutoErrorClosingListener.java 30 mtime=1441974582.587017038 30 atime=1441974656.620869254 30 ctime=1441974670.139024864 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/AutoErrorClosingListen0000664000076400007640000000363112574544466035071 0ustar00jvanekjvanek00000000000000/* 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); } } icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/PaxHeaders.24993/AutoA0000644000000000000000000000031512574544466030401 xustar00115 path=icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/AutoAllClosingListener.java 30 mtime=1441974582.587017038 30 atime=1441974656.619869242 30 ctime=1441974670.139024864 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/AutoAllClosingListener0000664000076400007640000000410312574544466035032 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/test-extensions/net/sourceforge/jnlp/PaxHeaders.24993/browsertesting0000644000000000000000000000013212574544466027057 xustar0030 mtime=1441974582.584017003 30 atime=1441974670.149024979 30 ctime=1441974670.139024864 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/browsertesting/0000775000076400007640000000000012574544466030215 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/browsertesting/PaxHeaders.24993/browser0000644000000000000000000000013212574544466030542 xustar0030 mtime=1441974582.587017038 30 atime=1441974670.149024979 30 ctime=1441974670.139024864 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/0000775000076400007640000000000012574544466032063 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/PaxHeaders.24990000644000000000000000000000013212574544466030642 xustar0030 mtime=1441974582.587017038 30 atime=1441974670.149024979 30 ctime=1441974670.139024864 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/firefox/0000775000076400007640000000000012574544466033525 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/firefox/PaxHead0000644000000000000000000000033512574544466031171 xustar00131 path=icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/firefox/FirefoxProfilesOperator.java 30 mtime=1441974582.587017038 30 atime=1441974656.619869242 30 ctime=1441974670.139024864 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/firefox/Firefox0000664000076400007640000001366312574544466035063 0ustar00jvanekjvanek00000000000000/* FirefoxProfilesOperator.java Copyright (C) 2011,2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.browsertesting.browsers.firefox; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.FilenameFilter; import java.io.IOException; import java.nio.channels.FileChannel; import net.sourceforge.jnlp.ServerAccess; /** * This class is able to backup and restore firefox profiles. * */ public class FirefoxProfilesOperator { private File backupDir; private File sourceDir; private boolean backuped = false; private FilenameFilter firefoxProfilesFilter = new FilenameFilter() { @Override public boolean accept(File dir, String name) { return name.endsWith(".default") || name.equals("profiles.ini"); } }; public void backupProfiles() throws IOException { if (backuped) { return; } sourceDir = new File(System.getProperty("user.home") + "/.mozilla/firefox/"); File f = File.createTempFile("backupedFirefox_", "_profiles.default"); f.delete(); f.mkdir(); backupDir = f; String message = "Backuping firefox profiles from " + sourceDir.getAbsolutePath() + " to " + backupDir.getAbsolutePath(); ServerAccess.logOutputReprint(message); copyDirs(sourceDir, backupDir, firefoxProfilesFilter); backuped = true; Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() { @Override public void run() { try { restoreProfiles(); } catch (Exception ex) { ServerAccess.logException(ex); } } })); } public void restoreProfiles() throws IOException { if (!backuped) { return; } try { removeProfiles(); } catch (Exception ex) { ServerAccess.logException(ex); } String message = ("Restoring all firefox profiles in " + sourceDir.getAbsolutePath() + " from in " + backupDir.getAbsolutePath()); ServerAccess.logOutputReprint(message); copyDirs(backupDir, sourceDir, firefoxProfilesFilter); } public void removeProfiles() throws IOException { if (!backuped) { return; } String message = ("Removing all firefox profiles from " + sourceDir.getAbsolutePath() + " backup avaiable in " + backupDir.getAbsolutePath()); ServerAccess.logOutputReprint(message); File[] oldProfiles = sourceDir.listFiles(firefoxProfilesFilter); for (File file : oldProfiles) { deleteRecursively(file); } } private void copyDirs(File sourceDir, File backupDir, FilenameFilter firefoxProfilesFilter) throws IOException { File[] profiles = sourceDir.listFiles(firefoxProfilesFilter); for (File file : profiles) { copyRecursively(file, backupDir); } } public static void copyFile(File from, File to) throws IOException { FileInputStream is = new FileInputStream(from); FileOutputStream fos = new FileOutputStream(to); FileChannel f = is.getChannel(); FileChannel f2 = fos.getChannel(); try { f.transferTo(0, f.size(), f2); } finally { f2.close(); f.close(); } } public static void deleteRecursively(File f) throws IOException { if (f.isDirectory()) { for (File c : f.listFiles()) { deleteRecursively(c); } } boolean d = true; d = f.delete(); if (!d) { throw new IOException("Failed to delete file: " + f); } } public static void copyRecursively(File srcFileDir, File destDir) throws IOException { if (srcFileDir.isDirectory()) { File nwDest = new File(destDir, srcFileDir.getName()); nwDest.mkdir(); for (File c : srcFileDir.listFiles()) { copyRecursively(c, nwDest); } } else { copyFile(srcFileDir, new File(destDir, srcFileDir.getName())); } } public static void main(String[] args) throws IOException { FirefoxProfilesOperator ff = new FirefoxProfilesOperator(); ff.restoreProfiles(); ff.backupProfiles(); ff.restoreProfiles(); ff.backupProfiles(); } } icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/PaxHeaders.24990000644000000000000000000000013212574544466030642 xustar0030 mtime=1441974582.586017026 30 atime=1441974656.619869242 30 ctime=1441974670.139024864 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/Opera.java0000664000076400007640000000447412574544466034005 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/PaxHeaders.24990000644000000000000000000000032712574544466030650 xustar00125 path=icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/MozillaFamilyLinuxBrowser.java 30 mtime=1441974582.586017026 30 atime=1441974656.619869242 30 ctime=1441974670.139024864 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/MozillaFamilyLi0000664000076400007640000000431412574544466035046 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/PaxHeaders.24990000644000000000000000000000013212574544466030642 xustar0030 mtime=1441974582.586017026 30 atime=1441974656.619869242 30 ctime=1441974670.139024864 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/Midory.java0000664000076400007640000000364512574544466034201 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/PaxHeaders.24990000644000000000000000000000031212574544466030642 xustar00112 path=icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/LinuxBrowser.java 30 mtime=1441974582.585017015 30 atime=1441974656.618869231 30 ctime=1441974670.139024864 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/LinuxBrowser.ja0000664000076400007640000000627212574544466035051 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/PaxHeaders.24990000644000000000000000000000013212574544466030642 xustar0030 mtime=1441974582.585017015 30 atime=1441974656.618869231 30 ctime=1441974670.139024864 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/Firefox.java0000664000076400007640000000627412574544466034341 0ustar00jvanekjvanek00000000000000/* 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) { try { ProcessAssasin.closeWindows(s); } catch (Exception ex) { throw new RuntimeException(ex); } } @Override public void afterKill(String s) { try { firefoxProfilesOperatorSingleton.restoreProfiles(); } catch (Exception ex) { throw new RuntimeException("Firefox profile restoration failed", ex); } } } icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/PaxHeaders.24990000644000000000000000000000013212574544466030642 xustar0030 mtime=1441974582.585017015 30 atime=1441974656.618869231 30 ctime=1441974670.139024864 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/Epiphany.java0000664000076400007640000000413012574544466034501 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/PaxHeaders.24990000644000000000000000000000013212574544466030642 xustar0030 mtime=1441974582.584017003 30 atime=1441974656.618869231 30 ctime=1441974670.139024864 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/Chromium.java0000664000076400007640000000365012574544466034515 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/PaxHeaders.24990000644000000000000000000000013212574544466030642 xustar0030 mtime=1441974582.584017003 30 atime=1441974656.618869231 30 ctime=1441974670.138024852 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/Chrome.java0000664000076400007640000000363712574544466034154 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/test-extensions/net/sourceforge/jnlp/browsertesting/PaxHeaders.24993/Reactin0000644000000000000000000000013212574544466030444 xustar0030 mtime=1441974582.584017003 30 atime=1441974656.618869231 30 ctime=1441974670.138024852 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/browsertesting/ReactingProcess.java0000664000076400007640000000431712574544466034160 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/test-extensions/net/sourceforge/jnlp/browsertesting/PaxHeaders.24993/Browser0000644000000000000000000000013212574544466030502 xustar0030 mtime=1441974582.583016992 30 atime=1441974656.617869219 30 ctime=1441974670.138024852 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/browsertesting/Browsers.java0000664000076400007640000000615712574544466032677 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/test-extensions/net/sourceforge/jnlp/browsertesting/PaxHeaders.24993/Browser0000644000000000000000000000013212574544466030502 xustar0030 mtime=1441974582.583016992 30 atime=1441974656.617869219 30 ctime=1441974670.138024852 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/browsertesting/BrowserTestRunner.java0000664000076400007640000001766712574544466034556 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/test-extensions/net/sourceforge/jnlp/browsertesting/PaxHeaders.24993/Browser0000644000000000000000000000013212574544466030502 xustar0030 mtime=1441974582.583016992 30 atime=1441974656.617869219 30 ctime=1441974670.138024852 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/browsertesting/BrowserTest.java0000664000076400007640000000414212574544466033344 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/test-extensions/net/sourceforge/jnlp/browsertesting/PaxHeaders.24993/Browser0000644000000000000000000000013212574544466030502 xustar0030 mtime=1441974582.582016981 30 atime=1441974656.617869219 30 ctime=1441974670.138024852 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/browsertesting/BrowserFactory.java0000664000076400007640000001776312574544466034051 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/test-extensions/net/sourceforge/jnlp/browsertesting/PaxHeaders.24993/Browser0000644000000000000000000000013212574544466030502 xustar0030 mtime=1441974582.582016981 30 atime=1441974656.617869219 30 ctime=1441974670.138024852 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/browsertesting/Browser.java0000664000076400007640000000415612574544466032511 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/test-extensions/net/sourceforge/jnlp/PaxHeaders.24993/awt0000644000000000000000000000013212574544466024571 xustar0030 mtime=1441974582.581016969 30 atime=1441974670.149024979 30 ctime=1441974670.138024852 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/awt/0000775000076400007640000000000012574544466025727 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/awt/PaxHeaders.24993/imagesearch0000644000000000000000000000013212574544466027041 xustar0030 mtime=1441974582.582016981 30 atime=1441974670.149024979 30 ctime=1441974670.138024852 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/awt/imagesearch/0000775000076400007640000000000012574544466030177 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/awt/imagesearch/PaxHeaders.24993/marker0000644000000000000000000000013212574544466030322 xustar0030 mtime=1441974582.582016981 30 atime=1441974656.617869219 30 ctime=1441974670.138024852 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/awt/imagesearch/marker.png0000664000076400007640000000026412574544466032170 0ustar00jvanekjvanek00000000000000‰PNG  IHDR D¤ŠÆPLTE$$$ÿmmm¶¶¶ÿÿÿÿÿÿÿjΰjTIDAT8Ëå“1À B]þÿâ.©Z¤³sóŃ#bŠæ~šñgÀ •²™54=à 6lQÙ3šF¡e¸¾BÍq ¼BùCkÓsã5Ü”i +RµãIEND®B`‚icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/awt/imagesearch/PaxHeaders.24993/ImageS0000644000000000000000000000013212574544466030206 xustar0030 mtime=1441974582.582016981 30 atime=1441974656.616869208 30 ctime=1441974670.138024852 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/awt/imagesearch/ImageSeeker.java0000664000076400007640000003364212574544466033233 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/test-extensions/net/sourceforge/jnlp/awt/imagesearch/PaxHeaders.24993/Compon0000644000000000000000000000032012574544466030273 xustar00118 path=icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/awt/imagesearch/ComponentNotFoundException.java 30 mtime=1441974582.581016969 30 atime=1441974656.616869208 30 ctime=1441974670.138024852 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/awt/imagesearch/ComponentNotFoundExcept0000664000076400007640000000472712574544466034724 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/test-extensions/net/sourceforge/jnlp/awt/imagesearch/PaxHeaders.24993/Compon0000644000000000000000000000013212574544466030274 xustar0030 mtime=1441974582.581016969 30 atime=1441974656.616869208 30 ctime=1441974670.138024852 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/awt/imagesearch/ComponentFinder.java0000664000076400007640000001222012574544466034131 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/test-extensions/net/sourceforge/jnlp/awt/PaxHeaders.24993/awtactions0000644000000000000000000000013212574544466026745 xustar0030 mtime=1441974582.580016957 30 atime=1441974670.149024979 30 ctime=1441974670.138024852 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/awt/awtactions/0000775000076400007640000000000012574544466030103 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/awt/awtactions/PaxHeaders.24993/MouseAc0000644000000000000000000000013212574544466030301 xustar0030 mtime=1441974582.580016957 30 atime=1441974656.616869208 30 ctime=1441974670.138024852 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/awt/awtactions/MouseActions.java0000664000076400007640000001624412574544466033366 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/test-extensions/net/sourceforge/jnlp/awt/awtactions/PaxHeaders.24993/Keyboar0000644000000000000000000000013212574544466030341 xustar0030 mtime=1441974582.580016957 30 atime=1441974656.616869208 30 ctime=1441974670.138024852 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/awt/awtactions/KeyboardActions.java0000664000076400007640000000666512574544466034044 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/test-extensions/net/sourceforge/jnlp/awt/PaxHeaders.24993/AWTHelper.java0000644000000000000000000000013212574544466027304 xustar0030 mtime=1441974582.580016957 30 atime=1441974656.615869196 30 ctime=1441974670.138024852 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/awt/AWTHelper.java0000664000076400007640000005052212574544466030371 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/test-extensions/net/sourceforge/jnlp/awt/PaxHeaders.24993/AWTFrameworkExcept0000644000000000000000000000013212574544466030253 xustar0030 mtime=1441974582.579016946 30 atime=1441974656.615869196 30 ctime=1441974670.138024852 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/awt/AWTFrameworkException.java0000664000076400007640000000453112574544466032765 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/test-extensions/net/sourceforge/jnlp/PaxHeaders.24993/annotations0000644000000000000000000000013212574544466026333 xustar0030 mtime=1441974582.579016946 30 atime=1441974670.149024979 30 ctime=1441974670.138024852 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/annotations/0000775000076400007640000000000012574544466027471 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/annotations/PaxHeaders.24993/TestInBrow0000644000000000000000000000013212574544466030373 xustar0030 mtime=1441974582.579016946 30 atime=1441974656.615869196 30 ctime=1441974670.138024852 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/annotations/TestInBrowsers.java0000664000076400007640000000376312574544466033302 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/test-extensions/net/sourceforge/jnlp/annotations/PaxHeaders.24993/Remote.jav0000644000000000000000000000013212574544466030345 xustar0030 mtime=1441974582.579016946 30 atime=1441974656.615869196 30 ctime=1441974670.138024852 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/annotations/Remote.java0000664000076400007640000000373312574544466031575 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/test-extensions/net/sourceforge/jnlp/annotations/PaxHeaders.24993/NeedsDispl0000644000000000000000000000013212574544466030365 xustar0030 mtime=1441974582.578016934 30 atime=1441974656.614869185 30 ctime=1441974670.138024852 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/annotations/NeedsDisplay.java0000664000076400007640000000407012574544466032721 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/test-extensions/net/sourceforge/jnlp/annotations/PaxHeaders.24993/KnownToFai0000644000000000000000000000013212574544466030352 xustar0030 mtime=1441974582.578016934 30 atime=1441974656.614869185 30 ctime=1441974670.138024852 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/annotations/KnownToFail.java0000664000076400007640000000512712574544466032534 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/test-extensions/net/sourceforge/jnlp/annotations/PaxHeaders.24993/Bug.java0000644000000000000000000000013212574544466027770 xustar0030 mtime=1441974582.578016934 30 atime=1441974656.614869185 30 ctime=1441974670.138024852 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/annotations/Bug.java0000664000076400007640000000560112574544466031053 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/test-extensions/net/sourceforge/jnlp/PaxHeaders.24993/TinyHttpdImpl.java0000644000000000000000000000013212574544466027467 xustar0030 mtime=1441974582.577016923 30 atime=1441974656.614869185 30 ctime=1441974670.138024852 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/TinyHttpdImpl.java0000664000076400007640000002431012574544466030550 0ustar00jvanekjvanek00000000000000/* 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.StringTokenizer; /** * 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; 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 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("HEAD"); boolean isGetRequest = request.equals("GET"); 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 (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"; } writer.writeBytes(HTTP_OK + "Content-Length:" + resourceLength + CRLF + 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; } } icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/PaxHeaders.24993/ThreadedProcess.java0000644000000000000000000000013212574544466027775 xustar0030 mtime=1441974582.577016923 30 atime=1441974656.614869185 30 ctime=1441974670.138024852 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/ThreadedProcess.java0000664000076400007640000001241112574544466031055 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/test-extensions/net/sourceforge/jnlp/PaxHeaders.24993/TestsLogs.java0000644000000000000000000000013212574544466026645 xustar0030 mtime=1441974582.576016911 30 atime=1441974656.614869185 30 ctime=1441974670.138024852 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/TestsLogs.java0000664000076400007640000000574012574544466027734 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/test-extensions/net/sourceforge/jnlp/PaxHeaders.24993/ServerLauncher.java0000644000000000000000000000013212574544466027646 xustar0030 mtime=1441974582.576016911 30 atime=1441974656.613869173 30 ctime=1441974670.138024852 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/ServerLauncher.java0000664000076400007640000001076312574544466030736 0ustar00jvanekjvanek00000000000000/* 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; /** * 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"))); } public void run() { running = true; try { serverSocket = new ServerSocket(port); while (running) { TinyHttpdImpl server = new TinyHttpdImpl(serverSocket.accept(), dir, false); 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.5.3/tests/test-extensions/net/sourceforge/jnlp/PaxHeaders.24993/ServerAccess.java0000644000000000000000000000013212574544466027306 xustar0030 mtime=1441974582.576016911 30 atime=1441974656.613869173 30 ctime=1441974670.138024852 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java0000664000076400007640000010214012574544466030365 0ustar00jvanekjvanek00000000000000/* 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.BufferedReader; import java.io.BufferedWriter; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.io.StringWriter; import java.io.Writer; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.ServerSocket; import java.net.URL; import java.util.ArrayList; import java.util.List; import net.sourceforge.jnlp.ProcessResult; 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; import org.junit.Assert; /** * * 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 = 20 * 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 */ 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="-headless"; public static final String VERBOSE_OPTION="-verbose"; /** * 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); } } /** * * @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); } /** * * @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, 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(); } /** * * @return url pointing to cached 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. */ 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 input 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 input 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 input 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 FileUtils.getContentOfStream(is); } /** * utility method which can read bytes of resource from any url * * @param resource to be located on any url * @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 { HttpURLConnection connection = (HttpURLConnection) u.openConnection(); connection = (HttpURLConnection) u.openConnection(); connection.setRequestMethod("GET"); connection.setDoOutput(true); connection.setReadTimeout(READ_TIMEOUT); connection.connect(); return getBytesFromStream(connection.getInputStream()); } /** * utility method which can read string of resource from any url * * @param resource to be located on any url * @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 { HttpURLConnection connection = (HttpURLConnection) u.openConnection(); connection = (HttpURLConnection) u.openConnection(); connection.setRequestMethod("GET"); connection.setDoOutput(true); connection.setReadTimeout(READ_TIMEOUT); connection.connect(); return getContentOfStream(connection.getInputStream()); } /** * helping dummy method to save String as file * * @param content * @param f * @throws IOException */ public static void saveFile(String content, File f) throws IOException { FileUtils.saveFile(content, f); } 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); } /** * 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); } public ProcessResult executeBrowser(String resource) throws Exception { return executeBrowser(getBrowserParams(), resource); } public ProcessResult executeBrowser(String resource,ContentReaderListener stdoutl,ContentReaderListener stderrl) throws Exception { return executeBrowser(getBrowserParams(), resource, stdoutl, stderrl); } public ProcessResult executeBrowser(String resource, List stdoutl, List stderrl) throws Exception { return executeBrowser(getBrowserParams(), resource, stdoutl, stderrl); } /** * wrapping method to executeProcess (eg: javaws arg arg http://localhost:port/resource) * will execute default javaws (@see JAVAWS_BUILD_BIN) upon default url upon cached server (@see SERVER_NAME @see getPort(), @see getInstance())) * @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, 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); } /** * Ctreate resource on http, on 'localhost' on port on which this instance is running * @param resource * @return * @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 u url of resource upon any server * @param javaws arguments * @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 u url of resource upon any server * @param javaws arguments * @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 bacground: * 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 readed 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 = ste.getClassName() + "." + ste.getMethodName(); 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.5.3/tests/test-extensions/net/sourceforge/jnlp/PaxHeaders.24993/ProcessWrapper.java0000644000000000000000000000013012574544466027673 xustar0028 mtime=1441974582.5750169 30 atime=1441974656.613869173 30 ctime=1441974670.138024852 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/ProcessWrapper.java0000664000076400007640000002064612574544466030766 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/test-extensions/net/sourceforge/jnlp/PaxHeaders.24993/ProcessResult.java0000644000000000000000000000013012574544466027531 xustar0028 mtime=1441974582.5750169 30 atime=1441974656.613869173 30 ctime=1441974670.138024852 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/ProcessResult.java0000664000076400007640000000510512574544466030615 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/test-extensions/net/sourceforge/jnlp/PaxHeaders.24993/ProcessAssasin.java0000644000000000000000000000013212574544466027656 xustar0030 mtime=1441974582.574016888 30 atime=1441974656.613869173 30 ctime=1441974670.138024852 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/ProcessAssasin.java0000664000076400007640000002315212574544466030742 0ustar00jvanekjvanek00000000000000/* 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 { p.destroy(); 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; } public static void closeWindow(String pid) throws Exception { List ll = new ArrayList(2); ll.add(ServerAccess.getInstance().getDir().getParent() + "/softkiller"); ll.add(pid); ServerAccess.executeProcess(ll); //sync, but acctually release //before affected application "close" Thread.sleep(100); } public static void closeWindows(String s) throws Exception { closeWindows(s, 10); } public static void closeWindows(String s, int count) throws Exception { //each close closes just one tab... for (int i = 0; i < count; i++) { ProcessAssasin.closeWindow(s); } } } icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/PaxHeaders.24993/LoggingBottleneck.java0000644000000000000000000000013212574544466030317 xustar0030 mtime=1441974582.574016888 30 atime=1441974656.612869162 30 ctime=1441974670.138024852 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/LoggingBottleneck.java0000664000076400007640000002355712574544466031414 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/test-extensions/net/sourceforge/jnlp/PaxHeaders.24993/LogItem.java0000644000000000000000000000013212574544466026256 xustar0030 mtime=1441974582.574016888 30 atime=1441974656.612869162 30 ctime=1441974670.138024852 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/LogItem.java0000664000076400007640000000601012574544466027334 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/test-extensions/net/sourceforge/jnlp/PaxHeaders.24993/ContentReaderListener.0000644000000000000000000000013212574544466030317 xustar0030 mtime=1441974582.573016877 30 atime=1441974656.612869162 30 ctime=1441974670.138024852 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/ContentReaderListener.java0000664000076400007640000000341512574544466032245 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/test-extensions/net/sourceforge/jnlp/PaxHeaders.24993/ContentReader.java0000644000000000000000000000013212574544466027453 xustar0030 mtime=1441974582.573016877 30 atime=1441974656.612869162 30 ctime=1441974670.138024852 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/ContentReader.java0000664000076400007640000001260312574544466030536 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/test-extensions/net/sourceforge/jnlp/PaxHeaders.24993/ClosingListener.java0000644000000000000000000000013212574544466030022 xustar0030 mtime=1441974582.573016877 30 atime=1441974656.612869162 30 ctime=1441974670.138024852 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/ClosingListener.java0000664000076400007640000000402012574544466031077 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/test-extensions/net/sourceforge/jnlp/PaxHeaders.24993/AsyncCall.java0000644000000000000000000000013112574544466026566 xustar0030 mtime=1441974582.572016865 29 atime=1441974656.61186915 30 ctime=1441974670.138024852 icedtea-web-1.5.3/tests/test-extensions/net/sourceforge/jnlp/AsyncCall.java0000664000076400007640000000612112574544466027650 0ustar00jvanekjvanek00000000000000package 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.5.3/tests/PaxHeaders.24993/test-extensions-tests0000644000000000000000000000013212574544466021062 xustar0030 mtime=1441974582.570016842 30 atime=1441974670.149024979 30 ctime=1441974670.138024852 icedtea-web-1.5.3/tests/test-extensions-tests/0000775000076400007640000000000012574544466022220 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/test-extensions-tests/PaxHeaders.24993/net0000644000000000000000000000013212574544466021650 xustar0030 mtime=1441974582.570016842 30 atime=1441974670.149024979 30 ctime=1441974670.138024852 icedtea-web-1.5.3/tests/test-extensions-tests/net/0000775000076400007640000000000012574544466023006 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/test-extensions-tests/net/PaxHeaders.24993/sourceforge0000644000000000000000000000013212574544466024173 xustar0030 mtime=1441974582.570016842 30 atime=1441974670.149024979 30 ctime=1441974670.138024852 icedtea-web-1.5.3/tests/test-extensions-tests/net/sourceforge/0000775000076400007640000000000012574544466025331 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/test-extensions-tests/net/sourceforge/PaxHeaders.24993/jnlp0000644000000000000000000000013212574544466025136 xustar0030 mtime=1441974582.572016865 30 atime=1441974670.149024979 30 ctime=1441974670.138024852 icedtea-web-1.5.3/tests/test-extensions-tests/net/sourceforge/jnlp/0000775000076400007640000000000012574544466026274 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/test-extensions-tests/net/sourceforge/jnlp/PaxHeaders.24993/awt0000644000000000000000000000013212574544466025731 xustar0030 mtime=1441974582.572016865 30 atime=1441974670.149024979 30 ctime=1441974670.138024852 icedtea-web-1.5.3/tests/test-extensions-tests/net/sourceforge/jnlp/awt/0000775000076400007640000000000012574544466027067 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/test-extensions-tests/net/sourceforge/jnlp/awt/PaxHeaders.24993/imagesearch0000644000000000000000000000013212574544466030201 xustar0030 mtime=1441974582.572016865 30 atime=1441974670.149024979 30 ctime=1441974670.138024852 icedtea-web-1.5.3/tests/test-extensions-tests/net/sourceforge/jnlp/awt/imagesearch/0000775000076400007640000000000012574544466031337 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/test-extensions-tests/net/sourceforge/jnlp/awt/imagesearch/PaxHeaders.24993/0000644000000000000000000000031612574544466030264 xustar00117 path=icedtea-web-1.5.3/tests/test-extensions-tests/net/sourceforge/jnlp/awt/imagesearch/ComponentFinderTest.java 30 mtime=1441974582.572016865 29 atime=1441974656.61186915 30 ctime=1441974670.138024852 icedtea-web-1.5.3/tests/test-extensions-tests/net/sourceforge/jnlp/awt/imagesearch/ComponentFinderTe0000664000076400007640000000412412574544466034646 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/test-extensions-tests/net/sourceforge/jnlp/PaxHeaders.24993/TinyHttpdImplTes0000644000000000000000000000013012574544466030361 xustar0030 mtime=1441974582.572016865 29 atime=1441974656.61186915 29 ctime=1441974670.13702484 icedtea-web-1.5.3/tests/test-extensions-tests/net/sourceforge/jnlp/TinyHttpdImplTest.java0000664000076400007640000002224212574544466032552 0ustar00jvanekjvanek00000000000000package 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.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 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.5.3/tests/test-extensions-tests/net/sourceforge/jnlp/PaxHeaders.24993/ServerAccessTest0000644000000000000000000000013012574544466030364 xustar0030 mtime=1441974582.571016854 29 atime=1441974656.61186915 29 ctime=1441974670.13702484 icedtea-web-1.5.3/tests/test-extensions-tests/net/sourceforge/jnlp/ServerAccessTest.java0000664000076400007640000002400112574544466032364 0ustar00jvanekjvanek00000000000000/* 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.URL; 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"); URL dirUrl = new URL("http", "localhost", server.getPort(), "/server.dir"); String portUrlContent = ServerAccess.getContentOfStream(portUrl.openConnection().getInputStream()); String dirUrlContent = ServerAccess.getContentOfStream(dirUrl.openConnection().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"); URL slowUrl = new URL("http", "localhost", server.getPort(), "/XslowXsimpletest1.jnlp"); String fastUrlcontent = ServerAccess.getContentOfStream(fastUrl.openConnection().getInputStream()); String slowUrlContent = ServerAccess.getContentOfStream(slowUrl.openConnection().getInputStream()); Assert.assertEquals(fastUrlcontent, slowUrlContent); } @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.5.3/tests/test-extensions-tests/net/sourceforge/jnlp/PaxHeaders.24993/ResourcesTest.ja0000644000000000000000000000013112574544466030340 xustar0030 mtime=1441974582.571016854 30 atime=1441974656.610869139 29 ctime=1441974670.13702484 icedtea-web-1.5.3/tests/test-extensions-tests/net/sourceforge/jnlp/ResourcesTest.java0000664000076400007640000004222512574544466031756 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/test-extensions-tests/net/sourceforge/jnlp/PaxHeaders.24993/MessagePropertie0000644000000000000000000000013112574544466030413 xustar0030 mtime=1441974582.570016842 30 atime=1441974656.610869139 29 ctime=1441974670.13702484 icedtea-web-1.5.3/tests/test-extensions-tests/net/sourceforge/jnlp/MessagePropertiesTest.java0000664000076400007640000000773612574544466033455 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/PaxHeaders.24993/softkiller0000644000000000000000000000013112574544466016723 xustar0030 mtime=1441974582.570016842 30 atime=1441974670.149024979 29 ctime=1441974670.13702484 icedtea-web-1.5.3/tests/softkiller/0000775000076400007640000000000012574544466020062 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/softkiller/PaxHeaders.24993/softkiller.c0000644000000000000000000000013112574544466021322 xustar0030 mtime=1441974582.570016842 30 atime=1441974656.610869139 29 ctime=1441974670.13702484 icedtea-web-1.5.3/tests/softkiller/softkiller.c0000664000076400007640000002176512574544466022417 0ustar00jvanekjvanek00000000000000/* X Window app killer * * Author: Pavel Tisnovsky * * Compile: * gcc -Wall -pedantic -std=c99 -o softkiller softkiller.c -lX11 * (please note that -std=c99 is needed because we use snprintf * function which does not exist in C89/ANSI C) * * Run: * ./softkiller PID */ #include #include #include #include #include #include #include #include /* * Number of long decimal digits + 1 (for ASCIIZ storage) */ #define MAX_LONG_DECIMAL_DIGITS 21 /* * Max line length in /proc/stat files */ #define MAX_LINE 8192 /* * Max filename length for /proc/... files */ #define MAX_FILENAME 32 /* * Return values */ #define EXIT_CODE_OK 0 #define EXIT_CODE_ERROR 1 /* * Different softkilling strategies */ #define TRY_TO_CLOSE_WINDOW 1 #define TRY_TO_KILL_WINDOW 1 /* * Delay between application of different softkilling strategies. */ #define SLEEP_AMOUNT 2 /* * Not in c89/c99... */ #define file_no(FP) ((FP)->_fileno) /* * Basic information about given process */ typedef struct ProcStruct { long uid, pid, ppid; char cmd[MAX_LINE]; } ProcStruct; ProcStruct *P = NULL; int N = 0; Display *display; Window root_window; Atom atom_pid; /* * Read basic process info from the file /proc/${PID}/stat * where ${PID} is process ID. */ int read_process_info(char *file_name_part, ProcStruct *P) { FILE *fin; char filename[MAX_FILENAME]; struct stat stat; /* try to open file /proc/${PID}/stat for reading */ snprintf(filename, sizeof(filename), "%s%s", file_name_part, "/stat"); fin = fopen(filename, "r"); if (fin == NULL) { return 0; /* process vanished since glob() */ } /* read basic process info */ if (3 != fscanf(fin, "%ld %s %*c %ld", &(P->pid), P->cmd, &(P->ppid))) { fclose(fin); return 0; /* Problem with file format, AFAIK should not happen */ } if (fstat(file_no(fin), &stat)) { fclose(fin); return 0; } P->uid = stat.st_uid; /* fin can't be NULL here */ fclose(fin); return 1; } /* * Read command line parameters for given ${PID} */ int read_cmd_line(char *file_name_part, char *cmd) { FILE *fin; char filename[MAX_FILENAME]; int c; int k = 0; /* try to open file /proc/${PID}/cmdline for reading */ snprintf(filename, sizeof(filename), "%s%s", file_name_part, "/cmdline"); fin = fopen(filename, "r"); if (fin == NULL) { return 0; /* process vanished since glob() */ } /* replace \0 by spaces */ while (k < MAX_LINE - 1 && EOF != (c = fgetc(fin))) { cmd[k++] = c == '\0' ? ' ' : c; } if (k > 0) { cmd[k] = '\0'; } /* fin can't be NULL here */ fclose(fin); return 1; } /* * Fill in an array pointed by P. */ int get_processes(void) { glob_t globbuf; unsigned int i, j; glob("/proc/[0-9]*", GLOB_NOSORT, NULL, &globbuf); P = calloc(globbuf.gl_pathc, sizeof(struct ProcStruct)); if (P == NULL) { fprintf(stderr, "Problems with malloc, it should not happen...\n"); exit(1); } for (i = j = 0; i < globbuf.gl_pathc; i++) { char * name_part = globbuf.gl_pathv[globbuf.gl_pathc - i - 1]; if (read_process_info(name_part, &(P[j])) == 0) { continue; } if (read_cmd_line(name_part, P[j].cmd) == 0) { continue; } /* Debug output */ /* printf("uid=%5ld, pid=%5ld, ppid=%5ld, cmd='%s'\n", P[j].uid, P[j].pid, P[j].ppid, P[j].cmd); */ j++; } globfree(&globbuf); return j; } /* * Try to open X Display */ Display * open_display(void) { Display *display = XOpenDisplay(0); if (display == NULL) { puts("Cannot open display"); exit(EXIT_CODE_ERROR); } return display; } /* * Return the atom identifier for the atom name "_NET_WM_PID" */ Atom get_atom_pid(Display *display) { Atom atom_pid = XInternAtom(display, "_NET_WM_PID", True); if (atom_pid == None) { printf("No such atom _NET_WM_PID"); exit(EXIT_CODE_ERROR); } return atom_pid; } /* * Try to focus the window and send Ctrl+W to it. */ void close_window(Window window, long processId) { char windowIDstr[MAX_LONG_DECIMAL_DIGITS]; pid_t pid; snprintf(windowIDstr, MAX_LONG_DECIMAL_DIGITS, "%ld", window); char *args[] = { "/usr/bin/xdotool", "windowfocus", windowIDstr, "windowactivate", windowIDstr, "key", "--window", windowIDstr, "--clearmodifiers", "Ctrl+W", (char *) NULL }; if ((pid = fork()) == -1) { perror("some fork error"); } else if (pid == 0) { /* child process */ printf("Trying to close window ID %ld for process ID %ld\n", (long)window, processId); execv("/usr/bin/xdotool", args); } else { /* parent process */ sleep(SLEEP_AMOUNT); } } /* * Run xkill to kill window with specified window ID */ void kill_window(Window window, long processId) { char windowIDstr[MAX_LONG_DECIMAL_DIGITS]; pid_t pid; /* we need to convert window id (long) into a string to call xkill */ snprintf(windowIDstr, MAX_LONG_DECIMAL_DIGITS, "%ld", window); char *args[] = { "/usr/bin/xkill", "-id", windowIDstr, (char *) NULL }; if ((pid = fork()) == -1) { perror("some fork error"); } else if (pid == 0) { printf("Trying to kill window ID %ld for process ID %ld\n", (long)window, processId); execv("/usr/bin/xkill", args); } else { // parent sleep(SLEEP_AMOUNT); } } /* * Recursivelly search for a window(s) associated with given process ID */ void search_and_destroy(Display *display, Window window, Atom atomPID, long processId) { Atom type; int format; unsigned long nItems; unsigned long bytesAfter; unsigned char *propertyPID = NULL; /* read _NET_WM_PID property, if exists */ if (Success == XGetWindowProperty(display, window, atomPID, 0, 1, False, XA_CARDINAL, &type, &format, &nItems, &bytesAfter, &propertyPID)) { if (propertyPID != NULL) { if (processId == *((unsigned long *)propertyPID)) { printf("Found window ID %ld for process ID %ld\n", (long)window, processId); XFree(propertyPID); #if TRY_TO_CLOSE_WINDOW == 1 close_window(window, processId); #endif #if TRY_TO_KILL_WINDOW == 1 kill_window(window, processId); #endif } } } /* recurse into child windows */ Window rootWindow; Window parentWindow; Window *childWindows; unsigned nChildren; if (0 != XQueryTree(display, window, &rootWindow, &parentWindow, &childWindows, &nChildren)) { unsigned int i; for(i = 0; i < nChildren; i++) { search_and_destroy(display, childWindows[i], atomPID, processId); } } } /* * Kill process with given ancestor PID. */ void kill_process(int pid) { Atom atom_pid = get_atom_pid(display); printf("Searching for windows associated with PID %d\n", pid); search_and_destroy(display, root_window, atom_pid, pid); } /* * Kill all processes with given ppid (ancestor PID) */ void kill_processes_with_ppid(int ppid) { int i; int done = 1; for (i = 0; i < N; i++) { if (ppid == P[i].ppid) { int pid = P[i].pid; printf("uid=%5ld, pid=%5ld, ppid=%5ld, cmd='%s'\n", P[i].uid, P[i].pid, P[i].ppid, P[i].cmd); kill_processes_with_ppid(pid); /* at least one child process exists */ done = 0; kill_process(pid); } } kill_process(ppid); /* if none child processes have been found we are at bottom of the process tree */ if (done) { return; } } /* TODO: better check for user input */ int read_pid(int argc, char **argv) { int pid; if (argc != 2) { puts("Usage softkiller PID"); exit(EXIT_CODE_ERROR); } pid = atoi(argv[1]); if (sscanf(argv[1], "%d", &pid) != 1) { printf("Wrong PID entered: %s\n", argv[1]); exit(EXIT_CODE_ERROR); } /* basic check (nobody should try to kill PID 0 :) */ if (pid <= 0) { printf("Wrong process ID %d\n", pid); exit(EXIT_CODE_ERROR); } return pid; } /* * Entry point to this tool. */ int main(int argc, char **argv) { int pid = read_pid(argc, argv); printf("ancestor PID to kill: %d\n", pid); N = get_processes(); printf("N = %d\n", N); display = open_display(); root_window = XDefaultRootWindow(display); atom_pid = get_atom_pid(display); kill_processes_with_ppid(pid); puts("*** Done! ***"); return 0; } icedtea-web-1.5.3/tests/softkiller/PaxHeaders.24993/Makefile0000644000000000000000000000013112574544466020440 xustar0030 mtime=1441974582.569016831 30 atime=1441974656.610869139 29 ctime=1441974670.13702484 icedtea-web-1.5.3/tests/softkiller/Makefile0000664000076400007640000000027412574544466021525 0ustar00jvanekjvanek00000000000000# we need c99 because of snprintf function! # (this function does not exist in C89/ANSI C) softkiller: softkiller.c $(CC) -Wall -pedantic -std=c99 -o $@ $< -lX11 clean: rm softkiller icedtea-web-1.5.3/tests/PaxHeaders.24993/netx0000644000000000000000000000013012574544466015522 xustar0029 mtime=1441974582.55501667 30 atime=1441974670.149024979 29 ctime=1441974670.13702484 icedtea-web-1.5.3/tests/netx/0000775000076400007640000000000012574544466016662 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/netx/PaxHeaders.24993/unit0000644000000000000000000000013112574544466016502 xustar0030 mtime=1441974582.591017084 30 atime=1441974670.149024979 29 ctime=1441974670.13702484 icedtea-web-1.5.3/tests/netx/unit/0000775000076400007640000000000012574544466017641 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/netx/unit/PaxHeaders.24993/sun0000644000000000000000000000013112574544466017307 xustar0030 mtime=1441974582.591017084 30 atime=1441974670.149024979 29 ctime=1441974670.13702484 icedtea-web-1.5.3/tests/netx/unit/sun/0000775000076400007640000000000012574544466020446 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/netx/unit/sun/PaxHeaders.24993/applet0000644000000000000000000000013112574544466020574 xustar0030 mtime=1441974582.592017095 30 atime=1441974670.149024979 29 ctime=1441974670.13702484 icedtea-web-1.5.3/tests/netx/unit/sun/applet/0000775000076400007640000000000012574544466021733 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/netx/unit/sun/applet/PaxHeaders.24993/PluginProxySelectorTest.java0000644000000000000000000000013112574544466026355 xustar0030 mtime=1441974582.592017095 30 atime=1441974656.468867504 29 ctime=1441974670.13702484 icedtea-web-1.5.3/tests/netx/unit/sun/applet/PluginProxySelectorTest.java0000664000076400007640000002112312574544466027436 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/netx/unit/sun/applet/PaxHeaders.24993/PluginParameterParserTest.java0000644000000000000000000000013112574544466026630 xustar0030 mtime=1441974582.592017095 30 atime=1441974656.468867504 29 ctime=1441974670.13702484 icedtea-web-1.5.3/tests/netx/unit/sun/applet/PluginParameterParserTest.java0000664000076400007640000001036112574544466027713 0ustar00jvanekjvanek00000000000000/* Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, 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.5.3/tests/netx/unit/sun/applet/PaxHeaders.24993/PluginAppletViewerTest.java0000644000000000000000000000013112574544466026142 xustar0030 mtime=1441974582.592017095 30 atime=1441974656.467867493 29 ctime=1441974670.13702484 icedtea-web-1.5.3/tests/netx/unit/sun/applet/PluginAppletViewerTest.java0000664000076400007640000002167512574544466027237 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/netx/unit/sun/applet/PaxHeaders.24993/PluginAppletSecurityContextTest.java0000644000000000000000000000013112574544466030055 xustar0030 mtime=1441974582.591017084 30 atime=1441974656.467867493 29 ctime=1441974670.13702484 icedtea-web-1.5.3/tests/netx/unit/sun/applet/PluginAppletSecurityContextTest.java0000664000076400007640000002100212574544466031132 0ustar00jvanekjvanek00000000000000/* Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, 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.5.3/tests/netx/unit/sun/applet/PaxHeaders.24993/MethodOverloadResolverTest.java0000644000000000000000000000013112574544466027012 xustar0030 mtime=1441974582.591017084 30 atime=1441974656.467867493 29 ctime=1441974670.13702484 icedtea-web-1.5.3/tests/netx/unit/sun/applet/MethodOverloadResolverTest.java0000664000076400007640000004420012574544466030074 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/netx/unit/PaxHeaders.24993/net0000644000000000000000000000013012574544466017267 xustar0029 mtime=1441974582.55501667 30 atime=1441974670.149024979 29 ctime=1441974670.13702484 icedtea-web-1.5.3/tests/netx/unit/net/0000775000076400007640000000000012574544466020427 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/netx/unit/net/PaxHeaders.24993/sourceforge0000644000000000000000000000013012574544466021612 xustar0029 mtime=1441974582.55501667 30 atime=1441974670.149024979 29 ctime=1441974670.13702484 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/0000775000076400007640000000000012574544466022752 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/PaxHeaders.24993/jnlp0000644000000000000000000000013112574544466022556 xustar0030 mtime=1441974582.585017015 30 atime=1441974670.149024979 29 ctime=1441974670.13702484 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/0000775000076400007640000000000012574544466023715 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.24993/util0000644000000000000000000000013112574544466023533 xustar0030 mtime=1441974582.590017073 30 atime=1441974670.149024979 29 ctime=1441974670.13702484 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/util/0000775000076400007640000000000012574544466024672 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/util/PaxHeaders.24993/replacements0000644000000000000000000000013112574544466026215 xustar0030 mtime=1441974582.590017073 30 atime=1441974670.149024979 29 ctime=1441974670.13702484 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/util/replacements/0000775000076400007640000000000012574544466027354 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/util/replacements/PaxHeaders.24993/BASE64Enco0000644000000000000000000000013112574544466027706 xustar0030 mtime=1441974582.590017073 30 atime=1441974656.467867493 29 ctime=1441974670.13702484 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/util/replacements/BASE64EncoderTest.java0000664000076400007640000001372712574544466033255 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/netx/unit/net/sourceforge/jnlp/util/replacements/PaxHeaders.24993/BASE64Deco0000644000000000000000000000013112574544466027674 xustar0030 mtime=1441974582.590017073 30 atime=1441974656.467867493 29 ctime=1441974670.13702484 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/util/replacements/BASE64DecoderTest.java0000664000076400007640000000774512574544466033246 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/netx/unit/net/sourceforge/jnlp/util/PaxHeaders.24993/logging0000644000000000000000000000013112574544466025161 xustar0030 mtime=1441974582.590017073 30 atime=1441974670.149024979 29 ctime=1441974670.13702484 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/util/logging/0000775000076400007640000000000012574544466026320 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/util/logging/PaxHeaders.24993/TeeOutputStream0000644000000000000000000000013112574544466030273 xustar0030 mtime=1441974582.590017073 30 atime=1441974656.466867481 29 ctime=1441974670.13702484 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/util/logging/TeeOutputStreamTest.java0000664000076400007640000000364712574544466033147 0ustar00jvanekjvanek00000000000000package 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; /** * Created by jkang on 15/07/14. */ 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 chaÍ€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.5.3/tests/netx/unit/net/sourceforge/jnlp/util/logging/PaxHeaders.24993/PrintStreamLogg0000644000000000000000000000013112574544466030242 xustar0030 mtime=1441974582.589017061 30 atime=1441974656.466867481 29 ctime=1441974670.13702484 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/util/logging/PrintStreamLoggerTest.java0000664000076400007640000001141012574544466033430 0ustar00jvanekjvanek00000000000000/*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.5.3/tests/netx/unit/net/sourceforge/jnlp/util/logging/PaxHeaders.24993/OutputControlle0000644000000000000000000000013112574544466030343 xustar0030 mtime=1441974582.589017061 30 atime=1441974656.466867481 29 ctime=1441974670.13702484 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/util/logging/OutputControllerTest.java0000664000076400007640000003764312574544466033404 0ustar00jvanekjvanek00000000000000/*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 org.junit.Assert; import org.junit.After; import org.junit.Before; import org.junit.Test; public class OutputControllerTest { private static String line1 = "I'm logged line one"; private static String line2 = "I'm logged line two"; private static String line3 = "I'm logged line three"; private static String line4 = "I'm logged line four"; private static String line5 = "I'm logged line five"; private static String line6 = "I'm logged line six"; private static RulesFolowingClosingListener.ContainsRule r1 = new RulesFolowingClosingListener.ContainsRule(line1); private static RulesFolowingClosingListener.ContainsRule r2 = new RulesFolowingClosingListener.ContainsRule(line2); private static RulesFolowingClosingListener.ContainsRule r3 = new RulesFolowingClosingListener.ContainsRule(line3); private static RulesFolowingClosingListener.ContainsRule r4 = new RulesFolowingClosingListener.ContainsRule(line4); private static RulesFolowingClosingListener.ContainsRule r5 = new RulesFolowingClosingListener.ContainsRule(line5); private static 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 FileLog(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 FileLog(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 FileLog(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.5.3/tests/netx/unit/net/sourceforge/jnlp/util/logging/PaxHeaders.24993/JavaConsoleTest0000644000000000000000000000013112574544466030225 xustar0030 mtime=1441974582.589017061 30 atime=1441974656.466867481 29 ctime=1441974670.13702484 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/util/logging/JavaConsoleTest.java0000664000076400007640000001122212574544466032225 0ustar00jvanekjvanek00000000000000/* * 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 net.sourceforge.jnlp.util.logging.headers.PluginMessage; import org.junit.Assert; import org.junit.Test; public class JavaConsoleTest { String s1 = "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"; String s2 = "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"; String s3 = "preinit_pluginerror 1384850630163298 [jvanek][ITW-C-PLUGIN][MESSAGE_DEBUG][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"; String s4 = "plugindebugX blob [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"; @Test public void CreatePluginHeaderTestOK() throws Exception{ PluginMessage p1 = new PluginMessage(s1); PluginMessage p3 = new PluginMessage(s3); PluginMessage p4 = new PluginMessage(s2); Assert.assertFalse(p1.wasError); Assert.assertFalse(p3.wasError); Assert.assertFalse(p4.wasError); Assert.assertTrue(p1.header.isC); Assert.assertTrue(p3.header.isC); Assert.assertTrue(p4.header.isC); Assert.assertEquals(OutputController.Level.MESSAGE_DEBUG, p1.header.level); Assert.assertEquals(OutputController.Level.ERROR_ALL,p3.header.level); Assert.assertEquals(OutputController.Level.WARNING_ALL, p4.header.level); Assert.assertTrue(p1.header.date.toString().contains("Tue Nov 19 09:43:50") && p1.header.date.toString().contains("2013")); Assert.assertTrue(p3.header.date.toString().contains("Tue Nov 19 09:43:50") && p3.header.date.toString().contains("2013")); Assert.assertTrue(p4.header.date.toString().contains("ITW-C-PLUGIN")); 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(p3.header.user.equals("jvanek")); Assert.assertTrue(p1.header.thread1.equals("140513434003264")); Assert.assertTrue(p1.header.thread2.equals("0x7fcbd531f8c0")); Assert.assertTrue(p3.header.thread1.equals("140513434003264")); Assert.assertTrue(p3.header.thread2.equals("0x7fcbd531f8c0")); Assert.assertTrue(p4.header.thread1.equals("19")); Assert.assertTrue(p4.header.thread2.equals("43")); Assert.assertTrue(p1.restOfMessage.equals(" PIPE: plugin read: plugin PluginProxyInfo reference 1 http://www.walter-fendt.de:80")); Assert.assertTrue(p3.restOfMessage.equals("Proxy info: plugin PluginProxyInfo reference 1 DIRECT")); Assert.assertTrue(p4.restOfMessage.equals("0 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")); } @Test public void CreatePluginHeaderTestNotOK()throws Exception{ PluginMessage p2 = new PluginMessage(s4); Assert.assertTrue(p2.wasError); Assert.assertTrue(p2.header.isC); Assert.assertEquals(OutputController.Level.WARNING_ALL, p2.header.level); Assert.assertTrue(p2.header.date.toString().contains(new Date().toString().substring(0, 16))); //means no Tue Nov 19 09:43:50 :) Assert.assertTrue(p2.header.thread1.equals("unknown")); Assert.assertTrue(p2.header.thread2.equals("unknown")); } } icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/util/logging/PaxHeaders.24993/FileLogTest.jav0000644000000000000000000000013012574544466030120 xustar0029 mtime=1441974582.58801705 30 atime=1441974656.466867481 29 ctime=1441974670.13702484 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/util/logging/FileLogTest.java0000664000076400007640000001631412574544466031351 0ustar00jvanekjvanek00000000000000/*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 org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; public class FileLogTest { private static File[] loggingTargets = new File[12]; private static String line1 = "I'm logged line one"; private static String line2 = "I'm logged line two"; private static String line3 = "I'm logged line three"; private static RulesFolowingClosingListener.ContainsRule r1 = new RulesFolowingClosingListener.ContainsRule(line1); private static RulesFolowingClosingListener.ContainsRule r2 = new RulesFolowingClosingListener.ContainsRule(line2); private static 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; FileLog l = new FileLog(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; FileLog l = new FileLog(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; FileLog l1 = new FileLog(loggingTargets[i].getAbsolutePath(), false); l1.log(line2); String s1 = StreamUtils.readStreamAsString(new FileInputStream(loggingTargets[i]), true); Assert.assertTrue(r2.evaluate(s1)); l1.close(); FileLog l2 = new FileLog(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; FileLog l1 = new FileLog(loggingTargets[i].getAbsolutePath(), true); l1.log(line2); String s1 = StreamUtils.readStreamAsString(new FileInputStream(loggingTargets[i]), true); Assert.assertTrue(r2.evaluate(s1)); l1.close(); FileLog l2 = new FileLog(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; FileLog l = new FileLog(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; FileLog l = new FileLog(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; FileLog l1 = new FileLog(loggingTargets[i].getAbsolutePath(), false); l1.log(line2); String s1 = StreamUtils.readStreamAsString(new FileInputStream(loggingTargets[i]), true); Assert.assertTrue(r2.evaluate(s1)); l1.close(); FileLog l2 = new FileLog(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; FileLog l1 = new FileLog(loggingTargets[i].getAbsolutePath(), true); l1.log(line2); String s1 = StreamUtils.readStreamAsString(new FileInputStream(loggingTargets[i]), true); Assert.assertTrue(r2.evaluate(s1)); l1.close(); FileLog l2 = new FileLog(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.5.3/tests/netx/unit/net/sourceforge/jnlp/util/PaxHeaders.24993/lockingfile0000644000000000000000000000013012574544466026020 xustar0029 mtime=1441974582.58801705 30 atime=1441974670.149024979 29 ctime=1441974670.13702484 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/util/lockingfile/0000775000076400007640000000000012574544466027160 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/util/lockingfile/PaxHeaders.24993/LockingRead0000644000000000000000000000012712574544466030210 xustar0029 mtime=1441974582.58801705 29 atime=1441974656.46586747 29 ctime=1441974670.13702484 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/util/lockingfile/LockingReaderWriterTest.java0000664000076400007640000001634612574544466034603 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/netx/unit/net/sourceforge/jnlp/util/PaxHeaders.24993/XDesktopEntryTest.java0000644000000000000000000000012712574544466030103 xustar0029 mtime=1441974582.58801705 29 atime=1441974656.46586747 29 ctime=1441974670.13702484 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/util/XDesktopEntryTest.java0000664000076400007640000002100212574544466031153 0ustar00jvanekjvanek00000000000000/* Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are 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.IOException; import java.io.StringReader; import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.util.HashMap; import java.util.Map; import java.util.Set; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.annotations.KnownToFail; 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; @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(s, des1); } @Test public void getFreedesktopOrgDesktopPathFromtestSpaced() throws IOException { String s = XDesktopEntry.getFreedesktopOrgDesktopPathFrom(new BufferedReader(new StringReader(src2))); Assert.assertEquals(s, des1); } @Test(expected = IOException.class) public void getFreedesktopOrgDesktopPathFromtestCommented() throws IOException { String s = XDesktopEntry.getFreedesktopOrgDesktopPathFrom(new BufferedReader(new StringReader(src3))); } @Test public void getFreedesktopOrgDesktopPathFromtestSimpleWithHome() throws IOException { String s = XDesktopEntry.getFreedesktopOrgDesktopPathFrom(new BufferedReader(new StringReader(src4))); Assert.assertEquals(s, des2Res); } @Test public void getFreedesktopOrgDesktopPathFromtestSpacedWithHome() throws IOException { String s = XDesktopEntry.getFreedesktopOrgDesktopPathFrom(new BufferedReader(new StringReader(src5))); Assert.assertEquals(s, des2Res); } @Test 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()); } } }icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/util/PaxHeaders.24993/UrlUtilsTest.java0000644000000000000000000000013012574544466027075 xustar0030 mtime=1441974582.587017038 29 atime=1441974656.46586747 29 ctime=1441974670.13702484 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/util/UrlUtilsTest.java0000664000076400007640000002617512574544466030173 0ustar00jvanekjvanek00000000000000/* Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; 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.URL; 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")); } } icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/util/PaxHeaders.24993/PropertiesFileTest.java0000644000000000000000000000013012574544466030246 xustar0030 mtime=1441974582.587017038 29 atime=1441974656.46586747 29 ctime=1441974670.13702484 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/util/PropertiesFileTest.java0000664000076400007640000001160712574544466031336 0ustar00jvanekjvanek00000000000000/* 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.assertTrue; import java.io.File; import java.io.IOException; import java.nio.channels.FileLock; import java.nio.channels.OverlappingFileLockException; import net.sourceforge.jnlp.cache.CacheLRUWrapper; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.JNLPRuntime; import org.junit.BeforeClass; import org.junit.Test; public class PropertiesFileTest { private int lockCount = 0; /* lock for the file RecentlyUsed */ private FileLock fl = null; private final String cacheDir = new File(JNLPRuntime.getConfiguration() .getProperty(DeploymentConfiguration.KEY_USER_CACHE_DIR)).getPath(); // does no DeploymentConfiguration exist for this file name? private final String cacheIndexFileName = CacheLRUWrapper.CACHE_INDEX_FILE_NAME; private final PropertiesFile cacheIndexFile = new PropertiesFile(new File(cacheDir + File.separatorChar + cacheIndexFileName)); private final int noEntriesCacheFile = 1000; @BeforeClass static public void setupJNLPRuntimeConfig() { JNLPRuntime.getConfiguration().setProperty(DeploymentConfiguration.KEY_USER_CACHE_DIR, System.getProperty("java.io.tmpdir")); } private void fillCacheIndexFile(int noEntries) { // fill cache index file for(int i = 0; i < noEntries; i++) { String path = cacheDir + File.separatorChar + i + File.separatorChar + "test" + i + ".jar"; String key = String.valueOf(System.currentTimeMillis()); cacheIndexFile.setProperty(key, path); } } @Test public void testReloadAfterStore() { lock(); boolean reloaded = false; // 1. clear cache entries + store clearCacheIndexFile(); // 2. load cache file reloaded = cacheIndexFile.load(); assertTrue("File was not reloaded!", reloaded); // 3. add some cache entries and store fillCacheIndexFile(noEntriesCacheFile); cacheIndexFile.store(); reloaded = cacheIndexFile.load(); assertTrue("File was not reloaded!", reloaded); unlock(); } private void clearCacheIndexFile() { lock(); // clear cache + store file cacheIndexFile.clear(); cacheIndexFile.store(); unlock(); } // add locking, because maybe some JNLP runtime user is running. copy/paste from CacheLRUWrapper /** * Lock the file to have exclusive access. */ private void lock() { try { fl = FileUtils.getFileLock(cacheIndexFile.getStoreFile().getPath(), false, true); } catch (OverlappingFileLockException e) { // if overlap we just increase the count. } catch (Exception e) { // We didn't get a lock.. e.printStackTrace(); } if (fl != null) lockCount++; } /** * Unlock the file. */ private void unlock() { if (fl != null) { lockCount--; try { if (lockCount == 0) { fl.release(); fl.channel().close(); fl = null; } } catch (IOException e) { e.printStackTrace(); } } } } icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/util/PaxHeaders.24993/MD5SumWatcherTest.java0000644000000000000000000000013012574544466027702 xustar0030 mtime=1441974582.586017026 29 atime=1441974656.46586747 29 ctime=1441974670.13702484 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/util/MD5SumWatcherTest.java0000664000076400007640000000754212574544466030775 0ustar00jvanekjvanek00000000000000/*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.5.3/tests/netx/unit/net/sourceforge/jnlp/util/PaxHeaders.24993/ImageResourcesTest.java0000644000000000000000000000013112574544466030230 xustar0030 mtime=1441974582.586017026 30 atime=1441974656.464867458 29 ctime=1441974670.13702484 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/util/ImageResourcesTest.java0000664000076400007640000000462112574544466031315 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/netx/unit/net/sourceforge/jnlp/util/PaxHeaders.24993/HttpUtilsTest.java0000644000000000000000000000013112574544466027253 xustar0030 mtime=1441974582.586017026 30 atime=1441974656.464867458 29 ctime=1441974670.13702484 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/util/HttpUtilsTest.java0000664000076400007640000002316312574544466030342 0ustar00jvanekjvanek00000000000000/* Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; 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.5.3/tests/netx/unit/net/sourceforge/jnlp/util/PaxHeaders.24993/ClasspathMatcherTest.ja0000644000000000000000000000013112574544466030212 xustar0030 mtime=1441974582.586017026 30 atime=1441974656.464867458 29 ctime=1441974670.13702484 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/util/ClasspathMatcherTest.java0000664000076400007640000010014612574544466031625 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.24993/tools0000644000000000000000000000013112574544466023716 xustar0030 mtime=1441974582.585017015 30 atime=1441974670.149024979 29 ctime=1441974670.13702484 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/tools/0000775000076400007640000000000012574544466025055 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/tools/PaxHeaders.24993/JarCertVerifierTest.ja0000644000000000000000000000013112574544466030175 xustar0030 mtime=1441974582.585017015 30 atime=1441974656.464867458 29 ctime=1441974670.13702484 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/tools/JarCertVerifierTest.java0000664000076400007640000007134312574544466031616 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.24993/templates0000644000000000000000000000013112574544466024554 xustar0030 mtime=1441974582.584017003 30 atime=1441974670.149024979 29 ctime=1441974670.13702484 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/templates/0000775000076400007640000000000012574544466025713 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/templates/PaxHeaders.24993/template9.jnlp0000644000000000000000000000013112574544466027422 xustar0030 mtime=1441974582.584017003 30 atime=1441974656.463867447 29 ctime=1441974670.13702484 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/templates/template9.jnlp0000664000076400007640000000071612574544466030510 0ustar00jvanekjvanek00000000000000 Sample RedHat This is a sample to test a bug icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/templates/PaxHeaders.24993/template8.jnlp0000644000000000000000000000013112574544466027421 xustar0030 mtime=1441974582.584017003 30 atime=1441974656.463867447 29 ctime=1441974670.13702484 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/templates/template8.jnlp0000664000076400007640000000050312574544466030501 0ustar00jvanekjvanek00000000000000 Sample Test RedHat icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/templates/PaxHeaders.24993/template7.jnlp0000644000000000000000000000013112574544466027420 xustar0030 mtime=1441974582.584017003 30 atime=1441974656.463867447 29 ctime=1441974670.13702484 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/templates/template7.jnlp0000664000076400007640000000057712574544466030513 0ustar00jvanekjvanek00000000000000 Sample Test RedHat icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/templates/PaxHeaders.24993/template6.jnlp0000644000000000000000000000013212574544466027420 xustar0030 mtime=1441974582.584017003 30 atime=1441974656.463867447 30 ctime=1441974670.136024829 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/templates/template6.jnlp0000664000076400007640000000053012574544466030477 0ustar00jvanekjvanek00000000000000 Test Sample RedHat icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/templates/PaxHeaders.24993/template5.jnlp0000644000000000000000000000013212574544466027417 xustar0030 mtime=1441974582.583016992 30 atime=1441974656.463867447 30 ctime=1441974670.136024829 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/templates/template5.jnlp0000664000076400007640000000061612574544466030503 0ustar00jvanekjvanek00000000000000 * * main-class='*' /> icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/templates/PaxHeaders.24993/template4.jnlp0000644000000000000000000000013212574544466027416 xustar0030 mtime=1441974582.583016992 30 atime=1441974656.463867447 30 ctime=1441974670.136024829 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/templates/template4.jnlp0000664000076400007640000000044112574544466030476 0ustar00jvanekjvanek00000000000000 * * icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/templates/PaxHeaders.24993/template3.jnlp0000644000000000000000000000013212574544466027415 xustar0030 mtime=1441974582.583016992 30 atime=1441974656.462867435 30 ctime=1441974670.136024829 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/templates/template3.jnlp0000664000076400007640000000051612574544466030500 0ustar00jvanekjvanek00000000000000 RedHat Sample Test icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/templates/PaxHeaders.24993/template2.jnlp0000644000000000000000000000013212574544466027414 xustar0030 mtime=1441974582.583016992 30 atime=1441974656.462867435 30 ctime=1441974670.136024829 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/templates/template2.jnlp0000664000076400007640000000051112574544466030472 0ustar00jvanekjvanek00000000000000 Sample Test * icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/templates/PaxHeaders.24993/template1.jnlp0000644000000000000000000000013212574544466027413 xustar0030 mtime=1441974582.582016981 30 atime=1441974656.462867435 30 ctime=1441974670.136024829 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/templates/template1.jnlp0000664000076400007640000000051612574544466030476 0ustar00jvanekjvanek00000000000000 Sample Test RedHat icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/templates/PaxHeaders.24993/template0.jnlp0000644000000000000000000000013212574544466027412 xustar0030 mtime=1441974582.582016981 30 atime=1441974656.462867435 30 ctime=1441974670.136024829 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/templates/template0.jnlp0000664000076400007640000000072012574544466030472 0ustar00jvanekjvanek00000000000000 Sample Test RedHat random tag test ]]> icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.24993/splashscreen0000644000000000000000000000013212574544466025251 xustar0030 mtime=1441974582.580016957 30 atime=1441974670.149024979 30 ctime=1441974670.136024829 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/0000775000076400007640000000000012574544466026407 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/PaxHeaders.24993/parts0000644000000000000000000000013212574544466026402 xustar0030 mtime=1441974582.582016981 30 atime=1441974670.149024979 30 ctime=1441974670.136024829 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/0000775000076400007640000000000012574544466027540 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/PaxHeaders.24993/JEditorPa0000644000000000000000000000032612574544466030230 xustar00124 path=icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/JEditorPaneBasedExceptionDialogTest.java 30 mtime=1441974582.582016981 30 atime=1441974656.462867435 30 ctime=1441974670.136024829 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/JEditorPaneBasedExceptionD0000664000076400007640000002044312574544466034554 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/PaxHeaders.24993/Informati0000644000000000000000000000031112574544466030331 xustar00111 path=icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/InformationElementTest.java 30 mtime=1441974582.581016969 30 atime=1441974656.461867424 30 ctime=1441974670.136024829 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/InformationElementTest.jav0000664000076400007640000003331612574544466034707 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/PaxHeaders.24993/InfoItemT0000644000000000000000000000013212574544466030240 xustar0030 mtime=1441974582.581016969 30 atime=1441974656.461867424 30 ctime=1441974670.136024829 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/InfoItemTest.java0000664000076400007640000001060012574544466032752 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/PaxHeaders.24993/Descripti0000644000000000000000000000031212574544466030330 xustar00112 path=icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/DescriptionInfoItemTest.java 30 mtime=1441974582.581016969 30 atime=1441974656.461867424 30 ctime=1441974670.136024829 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/DescriptionInfoItemTest.ja0000664000076400007640000001344412574544466034640 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/PaxHeaders.24993/BasicComp0000644000000000000000000000032112574544466030242 xustar00119 path=icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/BasicComponentSplashScreenTest.java 30 mtime=1441974582.580016957 30 atime=1441974656.461867424 30 ctime=1441974670.136024829 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/BasicComponentSplashScreen0000664000076400007640000001052212574544466034702 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/PaxHeaders.24993/BasicComp0000644000000000000000000000032612574544466030247 xustar00124 path=icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/BasicComponentErrorSplashScreenTest.java 30 mtime=1441974582.580016957 30 atime=1441974656.461867424 30 ctime=1441974670.136024829 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/parts/BasicComponentErrorSplashS0000664000076400007640000001117112574544466034700 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/PaxHeaders.24993/impls0000644000000000000000000000013212574544466026375 xustar0030 mtime=1441974582.577016923 30 atime=1441974670.149024979 30 ctime=1441974670.136024829 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/0000775000076400007640000000000012574544466027533 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/PaxHeaders.24993/defaultsp0000644000000000000000000000013212574544466030364 xustar0030 mtime=1441974582.580016957 30 atime=1441974670.149024979 30 ctime=1441974670.136024829 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/0000775000076400007640000000000012574544466034077 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/Pa0000644000000000000000000000034112574544466030566 xustar00135 path=icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/TextWithWaterLevelTest.java 30 mtime=1441974582.580016957 30 atime=1441974656.460867412 30 ctime=1441974670.136024829 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/Te0000664000076400007640000001257312574544466034402 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/Pa0000644000000000000000000000034212574544466030567 xustar00136 path=icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/TextOutlineRendererTest.java 30 mtime=1441974582.580016957 30 atime=1441974656.460867412 30 ctime=1441974670.136024829 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/Te0000664000076400007640000001201412574544466034370 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/Pa0000644000000000000000000000033212574544466030566 xustar00128 path=icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/SplinesDefsTest.java 30 mtime=1441974582.579016946 30 atime=1441974656.460867412 30 ctime=1441974670.136024829 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/Sp0000664000076400007640000000662112574544466034411 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/Pa0000644000000000000000000000032712574544466030572 xustar00125 path=icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/NatCubicTest.java 30 mtime=1441974582.579016946 30 atime=1441974656.460867412 30 ctime=1441974670.136024829 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/Na0000664000076400007640000002401512574544466034362 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/Pa0000644000000000000000000000033512574544466030571 xustar00131 path=icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/NatCubicClosedTest.java 30 mtime=1441974582.579016946 30 atime=1441974656.459867401 30 ctime=1441974670.136024829 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/Na0000664000076400007640000002414512574544466034366 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/Pa0000644000000000000000000000033112574544466030565 xustar00127 path=icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/MovingTextTest.java 30 mtime=1441974582.578016934 30 atime=1441974656.459867401 30 ctime=1441974670.136024829 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/Mo0000664000076400007640000001412512574544466034400 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/Pa0000644000000000000000000000033312574544466030567 xustar00129 path=icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/ErrorPainterTest.java 30 mtime=1441974582.578016934 30 atime=1441974656.459867401 30 ctime=1441974670.136024829 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/Er0000664000076400007640000001116412574544466034373 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/Pa0000644000000000000000000000032412574544466030567 xustar00122 path=icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/CubicTest.java 30 mtime=1441974582.578016934 30 atime=1441974656.459867401 30 ctime=1441974670.136024829 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/Cu0000664000076400007640000000455612574544466034403 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/Pa0000644000000000000000000000033312574544466030567 xustar00129 path=icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/ControlCurveTest.java 30 mtime=1441974582.577016923 30 atime=1441974656.458867389 30 ctime=1441974670.136024829 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/Co0000664000076400007640000003017412574544466034370 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/Pa0000644000000000000000000000033212574544466030566 xustar00128 path=icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/BasePainterTest.java 30 mtime=1441974582.577016923 30 atime=1441974656.458867389 30 ctime=1441974670.136024829 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/Ba0000664000076400007640000001271412574544466034351 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/PaxHeaders.24993/SplashUtilsTest0000644000000000000000000000013212574544466030364 xustar0030 mtime=1441974582.577016923 30 atime=1441974656.458867389 30 ctime=1441974670.136024829 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/SplashUtilsTest.java0000664000076400007640000002530612574544466032373 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/PaxHeaders.24993/SplashScreenTes0000644000000000000000000000013212574544466030317 xustar0030 mtime=1441974582.576016911 30 atime=1441974656.458867389 30 ctime=1441974670.136024829 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/SplashScreenTest.java0000664000076400007640000001610112574544466032503 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/PaxHeaders.24993/ErrorSplashUtil0000644000000000000000000000013212574544466030353 xustar0030 mtime=1441974582.576016911 30 atime=1441974656.458867389 30 ctime=1441974670.136024829 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/ErrorSplashUtilsTest.java0000664000076400007640000002235612574544466033407 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/PaxHeaders.24993/ErrorSplashScre0000644000000000000000000000013212574544466030332 xustar0030 mtime=1441974582.576016911 30 atime=1441974656.457867378 30 ctime=1441974670.136024829 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/splashscreen/ErrorSplashScreenTest.java0000664000076400007640000001444012574544466033521 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.24993/security0000644000000000000000000000013112574544466024425 xustar0030 mtime=1441974582.573016877 29 atime=1441974670.15002499 30 ctime=1441974670.136024829 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/security/0000775000076400007640000000000012574544466025564 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/security/PaxHeaders.24993/policyeditor0000644000000000000000000000012712574544466027140 xustar0028 mtime=1441974582.5750169 29 atime=1441974670.15002499 30 ctime=1441974670.136024829 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/0000775000076400007640000000000012574544466030272 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PaxHeaders.24993/Policy0000644000000000000000000000013012574544466030371 xustar0028 mtime=1441974582.5750169 30 atime=1441974656.457867378 30 ctime=1441974670.136024829 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PolicyEditorTest.java0000664000076400007640000002176712574544466034420 0ustar00jvanekjvanek00000000000000/*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.Collection; import java.util.HashSet; import java.util.Map; import java.util.Set; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; 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"); editor.addNewCodebases(toAdd); 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 testReturnedCodebasesAreCopy() 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("")); assertTrue("Editor should only have default codebase", second.size() == 1); } @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(""); original.add(new CustomPermission("java.io.FilePermission", "*", "write")); final Collection second = editor.getCustomPermissions(""); assertTrue("There should not be any custom permissions", 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/"); editor.addNewCodebases(toAdd); 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 testArgsToMap() throws Exception { final String[] args = new String[] { "-codebase", "http://example.com http://icedtea.classpath.org", "-file", "/tmp/some-policy-file.tmp", "-help" }; Map map = PolicyEditor.argsToMap(args); assertTrue("Args map should contain help flag", map.containsKey("-help")); assertTrue("Value for -help should be null but was " + map.get("-help"), map.get("-help") == null); assertTrue("Args map should contain file flag", map.containsKey("-file")); assertTrue("Value for -file should be /tmp/some-policy-file.tmp but was " + map.get("-file"), map.get("-file").equals("/tmp/some-policy-file.tmp")); assertTrue("Args map should contain codebase flag", map.containsKey("-codebase")); assertTrue("Value for codebase flag should be \"http://example.com http://icedtea.classpath.org\" but was " + map.get("-codebase"), map.get("-codebase").equals("http://example.com http://icedtea.classpath.org")); } }icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PaxHeaders.24993/Policy0000644000000000000000000000031712574544466030400 xustar00119 path=icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PolicyEditorPermissionsTest.java 28 mtime=1441974582.5750169 30 atime=1441974656.457867378 30 ctime=1441974670.136024829 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PolicyEditorPermissions0000664000076400007640000001134712574544466035065 0ustar00jvanekjvanek00000000000000/*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.5.3/tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PaxHeaders.24993/Policy0000644000000000000000000000031312574544466030374 xustar00115 path=icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PolicyEditorParsingTest.java 28 mtime=1441974582.5750169 30 atime=1441974656.457867378 30 ctime=1441974670.136024829 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PolicyEditorParsingTest0000664000076400007640000003073712574544466035021 0ustar00jvanekjvanek00000000000000/*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 PolicyEditor editor; 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); editor = PolicyEditor.createInstance(file.getCanonicalPath()); Thread.sleep(100); // policy editor loads asynch, give it some time to populate permissions = editor.getPermissions(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.5.3/tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PaxHeaders.24993/Permis0000644000000000000000000000013212574544466030373 xustar0030 mtime=1441974582.574016888 30 atime=1441974656.457867378 30 ctime=1441974670.136024829 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PermissionTypeTest.java0000664000076400007640000000453012574544466034771 0ustar00jvanekjvanek00000000000000/*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.5.3/tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PaxHeaders.24993/Permis0000644000000000000000000000031212574544466030373 xustar00112 path=icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PermissionTargetTest.java 30 mtime=1441974582.574016888 30 atime=1441974656.457867378 30 ctime=1441974670.136024829 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PermissionTargetTest.ja0000664000076400007640000000477112574544466034756 0ustar00jvanekjvanek00000000000000/*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.5.3/tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PaxHeaders.24993/Permis0000644000000000000000000000031312574544466030374 xustar00113 path=icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PermissionActionsTest.java 30 mtime=1441974582.574016888 30 atime=1441974656.456867366 30 ctime=1441974670.136024829 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PermissionActionsTest.j0000664000076400007640000000556012574544466034764 0ustar00jvanekjvanek00000000000000/*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.5.3/tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/PaxHeaders.24993/Custom0000644000000000000000000000031212574544466030406 xustar00112 path=icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/CustomPermissionTest.java 30 mtime=1441974582.573016877 30 atime=1441974656.456867366 30 ctime=1441974670.136024829 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/security/policyeditor/CustomPermissionTest.ja0000664000076400007640000001503712574544466034777 0ustar00jvanekjvanek00000000000000/*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.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 testToStringWithoutActions() 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 testCompareTo() 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); } } icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/security/PaxHeaders.24993/dialogs0000644000000000000000000000013112574544466026047 xustar0030 mtime=1441974582.573016877 29 atime=1441974670.15002499 30 ctime=1441974670.136024829 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/security/dialogs/0000775000076400007640000000000012574544466027206 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/security/dialogs/PaxHeaders.24993/apptrustwar0000644000000000000000000000013112574544466030443 xustar0030 mtime=1441974582.573016877 29 atime=1441974670.15002499 30 ctime=1441974670.136024829 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/0000775000076400007640000000000012574544466033476 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/PaxHead0000644000000000000000000000033612574544466031143 xustar00132 path=icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/AppTrustWarningPanelTest.java 30 mtime=1441974582.573016877 30 atime=1441974656.456867366 30 ctime=1441974670.136024829 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/AppTrus0000664000076400007640000001503212574544466035020 0ustar00jvanekjvanek00000000000000package 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 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; private static final File trustFile = new File(System.getProperty("user.home") + "/.config/icedtea-web/.appletTrustSettings"); public static void backupAppletSecurity() throws IOException { appletSecurityBackup = File.createTempFile("appletSecurity", "itwTestBAckup"); FirefoxProfilesOperator.copyFile(trustFile, appletSecurityBackup); } public static void removeAppletSecurityImpl() throws IOException { if (appletSecurityBackup.exists()) { trustFile.delete(); } } @AfterClass public static void restoreAppletSecurity() throws IOException { if (appletSecurityBackup.exists()) { removeAppletSecurityImpl(); FirefoxProfilesOperator.copyFile(appletSecurityBackup, trustFile); 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(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 = UnsignedAppletTrustWarningPanel.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.5.3/tests/netx/unit/net/sourceforge/jnlp/security/PaxHeaders.24993/appletextendedsecur0000644000000000000000000000013112574544466030475 xustar0030 mtime=1441974582.572016865 29 atime=1441974670.15002499 30 ctime=1441974670.136024829 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/0000775000076400007640000000000012574544466032362 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/PaxHeaders.240000644000000000000000000000013112574544466030756 xustar0030 mtime=1441974582.572016865 29 atime=1441974670.15002499 30 ctime=1441974670.135024818 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/impl/0000775000076400007640000000000012574544466033323 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/impl/PaxHeade0000644000000000000000000000033312574544466031132 xustar00129 path=icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/impl/VersionRestrictionTest.java 30 mtime=1441974582.572016865 30 atime=1441974656.456867366 30 ctime=1441974670.135024818 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/impl/VersionR0000664000076400007640000003200312574544466035013 0ustar00jvanekjvanek00000000000000/* 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.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 ExecuteAppletAction asa = 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.5.3/tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/impl/PaxHeade0000644000000000000000000000035012574544466031131 xustar00142 path=icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/impl/UnsignedAppletActionStorageImplTest.java 30 mtime=1441974582.572016865 30 atime=1441974656.455867354 30 ctime=1441974670.135024818 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/impl/Unsigned0000664000076400007640000001541012574544466035023 0ustar00jvanekjvanek00000000000000/* 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.impl.UnsignedAppletActionStorageImpl; 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 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 f4; @BeforeClass public static void preapreTestFiles() throws IOException { f1 = File.createTempFile("itwMatching", "testFile1"); f2 = File.createTempFile("itwMatching", "testFile2"); f3 = File.createTempFile("itwMatching", "testFile3"); f4 = File.createTempFile("itwMatching", "testFile4"); 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" + "A 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" + "", f3); } @AfterClass public static void removeTestFiles() throws IOException { f1.delete(); f2.delete(); f3.delete(); } @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"})); ServerAccess.logOutputReprint(r1.toString()); } @Test public void allMatchingDocAndCode() { UnsignedAppletActionStorageImpl i1 = new UnsignedAppletActionStorageImpl(f1); UnsignedAppletActionEntry r1 = i1.getMatchingItem("bla", "blaBla", Arrays.asList(new String[]{"jar1", "jar2"})); Assert.assertNotNull("r1 should be found", r1); UnsignedAppletActionEntry r3 = i1.getMatchingItem("blah", "blaBla", Arrays.asList(new String[]{"jar2", "jar1"})); Assert.assertNotNull("r3 should be found", r1); UnsignedAppletActionEntry r4 = i1.getMatchingItem("blha", "blaBlam", Arrays.asList(new String[]{"jar2", "wrong_jar"})); Assert.assertNull("r4 should NOT be found", r4); UnsignedAppletActionEntry r5 = i1.getMatchingItem("blaBla", "blaBlaBla", Arrays.asList(new String[]{"jar2"})); 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"})); Assert.assertNotNull("r1 should be found", r1); UnsignedAppletActionEntry r3 = i1.getMatchingItem("whatever", null, Arrays.asList(new String[]{"jar2", "jar1"})); Assert.assertNotNull("r3 should be found", r1); UnsignedAppletActionEntry r2 = i1.getMatchingItem("bla", "blaBlam", Arrays.asList(new String[]{"jar1", "jar2"})); Assert.assertNull("r2 should NOT be found", r2); UnsignedAppletActionEntry r4 = i1.getMatchingItem(null, "blaBlam", null); Assert.assertNull("r4 should NOT be found", r4); } @Test public void allMatchingDocAndCodeWithNulls() { UnsignedAppletActionStorageImpl i1 = new UnsignedAppletActionStorageImpl(f1); UnsignedAppletActionEntry r1 = i1.getMatchingItem("bla", "blaBla", null); Assert.assertNotNull("r1 should be found", r1); UnsignedAppletActionEntry r3 = i1.getMatchingItem("bla", "whatever", null); Assert.assertNotNull("r3 should be found", r1); UnsignedAppletActionEntry r2 = i1.getMatchingItem("bla", "blaBla", Arrays.asList(new String[]{"jar2", "jar1"})); Assert.assertNotNull("r2 should be found", r2); UnsignedAppletActionEntry r4 = i1.getMatchingItem("bla", "blaBla", null); Assert.assertNotNull("r4 should be found", r4); UnsignedAppletActionEntry r5 = i1.getMatchingItem("", "blaBla", Arrays.asList(new String[]{"jar2", "jar1"})); Assert.assertNotNull("r5 should be found", r5); UnsignedAppletActionEntry r6 = i1.getMatchingItem(null, null, Arrays.asList(new String[]{"jar2", "jar1"})); Assert.assertNotNull("r6 should be found", r6); UnsignedAppletActionEntry r7 = i1.getMatchingItem(null, null, Arrays.asList(new String[]{"jar2", "jar11"})); Assert.assertNull("r7 should NOT be found", r7); } } icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/PaxHeaders.240000644000000000000000000000031412574544466030761 xustar00114 path=icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/UrlRegExTest.java 30 mtime=1441974582.572016865 30 atime=1441974656.455867354 30 ctime=1441974670.135024818 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/UrlRegExTest.0000664000076400007640000002174312574544466034727 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/PaxHeaders.240000644000000000000000000000034312574544466030763 xustar00137 path=icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletTrustConfirmationTest.java 30 mtime=1441974582.571016854 30 atime=1441974656.455867354 30 ctime=1441974670.135024818 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedApple0000664000076400007640000003074312574544466035052 0ustar00jvanekjvanek00000000000000package 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.net.URL; import java.util.ArrayList; 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.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 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 final File trustFile = new File(System.getProperty("user.home") + "/.config/icedtea-web/.appletTrustSettings"); private static class DummyJnlpWithTitleAndUrls extends DummyJNLPFileWithJar { public DummyJnlpWithTitleAndUrls(URL u) throws MalformedURLException { super(url, u); } @Override public InformationDesc getInformation() { return new InformationDesc(null) { @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(trustFile, backup); } @AfterClass public static void restoreAppTrust() throws IOException{ FirefoxProfilesOperator.copyFile(backup, trustFile); } @Test public void updateAppletActionTest1() throws Exception { trustFile.delete(); //clean file to examine later UnsignedAppletTrustConfirmation.updateAppletAction( new DummyJnlpWithTitleAndUrls(url4), ExecuteAppletAction.ALWAYS, Boolean.FALSE); String s = FileUtils.loadFileAsString(trustFile); 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); s = FileUtils.loadFileAsString(trustFile); 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 = UnsignedAppletTrustConfirmation.stripFile(new URL(sample)); assertEquals(sample, result); sample = "http://aa.bb"; result = UnsignedAppletTrustConfirmation.stripFile(new URL(sample)); assertEquals(sample + "/", result); sample = "http://aa.bb/"; result = UnsignedAppletTrustConfirmation.stripFile(new URL(sample + "cc")); assertEquals(sample, result); sample = "http://aa.bb/cc/"; result = UnsignedAppletTrustConfirmation.stripFile(new URL(sample)); assertEquals(sample, result); sample = "http://aa.bb/some/complicated/"; result = UnsignedAppletTrustConfirmation.stripFile(new URL(sample + "some")); assertEquals(sample, result); sample = "http://aa.bb/some/complicated/some/"; result = UnsignedAppletTrustConfirmation.stripFile(new URL(sample)); assertEquals(sample, result); sample = "http://aa.bb/some/"; result = UnsignedAppletTrustConfirmation.stripFile(new URL(sample + "strange?a=b")); assertEquals(sample, result); sample = "http://aa.bb/some/strange/"; result = UnsignedAppletTrustConfirmation.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 { trustFile.delete(); //clean file to examine later UnsignedAppletTrustConfirmation.updateAppletAction( new DummyJnlpWithTitleAndUrlsWithOverwrite(urlY1), ExecuteAppletAction.ALWAYS, Boolean.FALSE); UnsignedAppletTrustConfirmation.updateAppletAction( new DummyJnlpWithTitleAndUrlsWithOverwrite(urlY2), ExecuteAppletAction.ALWAYS, Boolean.FALSE); UnsignedAppletTrustConfirmation.updateAppletAction( new DummyJnlpWithTitleAndUrlsWithOverwrite(urlY3), ExecuteAppletAction.ALWAYS, Boolean.FALSE); UnsignedAppletTrustConfirmation.updateAppletAction( new DummyJnlpWithTitleAndUrlsWithOverwrite(urlY4), ExecuteAppletAction.ALWAYS, Boolean.FALSE); 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 { trustFile.delete(); //clean file to examine later UnsignedAppletTrustConfirmation.updateAppletAction( new DummyJnlpWithTitleAndUrlsWithOverwrite(urlY5), ExecuteAppletAction.ALWAYS, Boolean.FALSE); UnsignedAppletTrustConfirmation.updateAppletAction( new DummyJnlpWithTitleAndUrlsWithOverwrite(urlY6), ExecuteAppletAction.ALWAYS, Boolean.FALSE); UnsignedAppletTrustConfirmation.updateAppletAction( new DummyJnlpWithTitleAndUrlsWithOverwrite(urlY7), ExecuteAppletAction.ALWAYS, Boolean.FALSE); UnsignedAppletTrustConfirmation.updateAppletAction( new DummyJnlpWithTitleAndUrlsWithOverwrite(urlY8), ExecuteAppletAction.ALWAYS, Boolean.FALSE); 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 { trustFile.delete(); //clean file to examine later try{ UnsignedAppletTrustConfirmation.updateAppletAction( new DummyJnlpWithTitleAndUrls(urlX3), ExecuteAppletAction.ALWAYS, Boolean.FALSE); //may throw RuntimeExeption which is correct, however, wee need to check result } catch (Exception ex){ ServerAccess.logException(ex); } String s = FileUtils.loadFileAsString(trustFile); Assert.assertFalse(s.contains("harmfull")); } @Test public void updateAppletActionTestX2() throws Exception { trustFile.delete(); //clean file to examine later try{ UnsignedAppletTrustConfirmation.updateAppletAction( new DummyJnlpWithTitleAndUrls(urlX2), ExecuteAppletAction.ALWAYS, Boolean.FALSE); //may throw RuntimeExeption which is correct, however, wee need to check result } catch (Exception ex){ ServerAccess.logException(ex); } String s = FileUtils.loadFileAsString(trustFile); 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 trustFile.delete(); //clean file to examine later Exception eex = null; try{ UnsignedAppletTrustConfirmation.updateAppletAction( new DummyJnlpWithTitleAndUrls(urlX1), ExecuteAppletAction.ALWAYS, Boolean.FALSE); //may throw RuntimeExeption which is correct, however, wee need to check result } catch (Exception ex){ eex = ex; ServerAccess.logException(ex); } String s = FileUtils.loadFileAsString(trustFile); 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.5.3/tests/netx/unit/net/sourceforge/jnlp/security/PaxHeaders.24993/SecurityDialogsTest0000644000000000000000000000013212574544466030400 xustar0030 mtime=1441974582.571016854 30 atime=1441974656.455867354 30 ctime=1441974670.135024818 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/security/SecurityDialogsTest.java0000664000076400007640000001316512574544466032407 0ustar00jvanekjvanek00000000000000/*Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security; import static net.sourceforge.jnlp.security.SecurityDialogs.getIntegerResponseAsAppletAction; import static net.sourceforge.jnlp.security.SecurityDialogs.getIntegerResponseAsBoolean; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import static net.sourceforge.jnlp.security.SecurityDialogs.AppletAction.*; import org.junit.Test; public class SecurityDialogsTest { @Test public void testGetIntegerResponseAsBoolean() throws Exception { Object nullRef = null; Object objRef = new Object(); Float floatRef = new Float(0.0f); Double doubleRef = new Double(0.0d); Long longRef = new Long(0); Byte byteRef = new Byte((byte)0); Short shortRef = new Short((short)0); String strRef = "0"; Integer intRef1 = new Integer(5); Integer intRef2 = new Integer(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 = new Float(0.0f); Double doubleRef = new Double(0.0d); Long longRef = new Long(0); Byte byteRef = new Byte((byte) 0); Short shortRef = new Short((short) 0); String strRef = "0"; Integer intRef1 = new Integer(0); Integer intRef2 = new Integer(1); Integer intRef3 = new Integer(2); Integer intRef4 = new Integer(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); } } icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.24993/runtime0000644000000000000000000000013112574544466024241 xustar0030 mtime=1441974582.570016842 29 atime=1441974670.15002499 30 ctime=1441974670.135024818 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/runtime/0000775000076400007640000000000012574544466025400 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/runtime/PaxHeaders.24993/ResourcesDescTest.ja0000644000000000000000000000013212574544466030244 xustar0030 mtime=1441974582.570016842 30 atime=1441974656.454867343 30 ctime=1441974670.135024818 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/runtime/ResourcesDescTest.java0000664000076400007640000001112412574544466031653 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/netx/unit/net/sourceforge/jnlp/runtime/PaxHeaders.24993/ManifestAttributesCh0000644000000000000000000000013212574544466030332 xustar0030 mtime=1441974582.570016842 30 atime=1441974656.454867343 30 ctime=1441974670.135024818 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/runtime/ManifestAttributesCheckerTest.java0000664000076400007640000000524612574544466034214 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/netx/unit/net/sourceforge/jnlp/runtime/PaxHeaders.24993/JNLPProxySelectorTes0000644000000000000000000000013212574544466030224 xustar0030 mtime=1441974582.570016842 30 atime=1441974656.454867343 30 ctime=1441974670.135024818 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/runtime/JNLPProxySelectorTest.java0000664000076400007640000003344412574544466032421 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/netx/unit/net/sourceforge/jnlp/runtime/PaxHeaders.24993/JNLPFileTest.java0000644000000000000000000000013212574544466027365 xustar0030 mtime=1441974582.570016842 30 atime=1441974656.454867343 30 ctime=1441974670.135024818 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/runtime/JNLPFileTest.java0000664000076400007640000006023712574544466030456 0ustar00jvanekjvanek00000000000000/* 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.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 boolean attCheckValue; @BeforeClass public static void setPermissions() { level = AppletStartupSecuritySettings.getInstance().getSecurityLevel(); attCheckValue = ManifestAttributesChecker.isCheckEnabled(); JNLPRuntime.getConfiguration().setProperty(DeploymentConfiguration.KEY_SECURITY_LEVEL, AppletSecurityLevel.ALLOW_UNSIGNED.toChars()); JNLPRuntime.getConfiguration().setProperty(DeploymentConfiguration.KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK, String.valueOf(true)); } @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 classlaoders constructor //jnlpFile.getManifestsAttributes().setLoader(classLoader); //classloader set, but no att specified Assert.assertNull("classlaoder attached, but should be null", jnlpFile.getManifestsAttributes().getAttribute(new Attributes.Name(JNLPFile.ManifestsAttributes.APP_NAME))); Assert.assertNull("classlaoder attached, but should be null", jnlpFile.getManifestsAttributes().getAttribute(new Attributes.Name(JNLPFile.ManifestsAttributes.APP_LIBRARY_ALLOWABLE))); Assert.assertNull("classlaoder attached, but should be null", jnlpFile.getManifestsAttributes().getAttribute(new Attributes.Name(JNLPFile.ManifestsAttributes.CALLER_ALLOWABLE))); Assert.assertNull("classlaoder attached, but should be null", jnlpFile.getManifestsAttributes().getAttribute(new Attributes.Name(JNLPFile.ManifestsAttributes.CODEBASE))); Assert.assertNull("classlaoder attached, but should be null", jnlpFile.getManifestsAttributes().getAttribute(new Attributes.Name(JNLPFile.ManifestsAttributes.PERMISSIONS))); Assert.assertNull("classlaoder attached, but should be null", jnlpFile.getManifestsAttributes().getAttribute(new Attributes.Name(JNLPFile.ManifestsAttributes.TRUSTED_LIBRARY))); Assert.assertNull("classlaoder attached, but should be null", jnlpFile.getManifestsAttributes().getAttribute(new Attributes.Name(JNLPFile.ManifestsAttributes.TRUSTED_ONLY))); Assert.assertNull("classlaoder attached, but should be null", jnlpFile.getManifestsAttributes().getMainClass()); Assert.assertNull("classlaoder attached, but should be null", jnlpFile.getManifestsAttributes().getApplicationName()); Assert.assertNull("classlaoder attached, but should be null", jnlpFile.getManifestsAttributes().getApplicationLibraryAllowableCodebase()); Assert.assertNull("classlaoder attached, but should be null", jnlpFile.getManifestsAttributes().getCallerAllowableCodebase()); Assert.assertNull("classlaoder attached, but should be null", jnlpFile.getManifestsAttributes().getCodebase()); Assert.assertEquals("no classlaoder attached, should be null", JNLPFile.ManifestBoolean.UNDEFINED, jnlpFile.getManifestsAttributes().isSandboxForced()); Assert.assertEquals("no classlaoder attached, should be null", JNLPFile.ManifestBoolean.UNDEFINED, jnlpFile.getManifestsAttributes().isTrustedLibrary()); Assert.assertEquals("no classlaoder 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.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" */ manifest6.getMainAttributes().put(new Attributes.Name(JNLPFile.ManifestsAttributes.PERMISSIONS), "sandbox"); 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 classlaoder attached, should be null", jnlpFile.getManifestsAttributes().getAttribute(new Attributes.Name(JNLPFile.ManifestsAttributes.APP_NAME))); Assert.assertNull("no classlaoder attached, should be null", jnlpFile.getManifestsAttributes().getAttribute(new Attributes.Name(JNLPFile.ManifestsAttributes.APP_LIBRARY_ALLOWABLE))); Assert.assertNull("no classlaoder attached, should be null", jnlpFile.getManifestsAttributes().getAttribute(new Attributes.Name(JNLPFile.ManifestsAttributes.CALLER_ALLOWABLE))); Assert.assertNull("no classlaoder attached, should be null", jnlpFile.getManifestsAttributes().getAttribute(new Attributes.Name(JNLPFile.ManifestsAttributes.CODEBASE))); Assert.assertNull("no classlaoder attached, should be null", jnlpFile.getManifestsAttributes().getAttribute(new Attributes.Name(JNLPFile.ManifestsAttributes.PERMISSIONS))); Assert.assertNull("no classlaoder attached, should be null", jnlpFile.getManifestsAttributes().getAttribute(new Attributes.Name(JNLPFile.ManifestsAttributes.TRUSTED_LIBRARY))); Assert.assertNull("no classlaoder attached, should be null", jnlpFile.getManifestsAttributes().getAttribute(new Attributes.Name(JNLPFile.ManifestsAttributes.TRUSTED_ONLY))); Assert.assertNull("no classlaoder attached, should be null", jnlpFile.getManifestsAttributes().getApplicationName()); Assert.assertNull("no classlaoder attached, should be null", jnlpFile.getManifestsAttributes().getApplicationLibraryAllowableCodebase()); Assert.assertNull("no classlaoder attached, should be null", jnlpFile.getManifestsAttributes().getCallerAllowableCodebase()); Assert.assertNull("no classlaoder attached, should be null", jnlpFile.getManifestsAttributes().getCodebase()); Assert.assertEquals("no classlaoder attached, should be null", JNLPFile.ManifestBoolean.UNDEFINED, jnlpFile.getManifestsAttributes().isSandboxForced()); Assert.assertEquals("no classlaoder attached, should be null", JNLPFile.ManifestBoolean.UNDEFINED, jnlpFile.getManifestsAttributes().isTrustedLibrary()); Assert.assertEquals("no classlaoder attached, should be null", JNLPFile.ManifestBoolean.UNDEFINED, jnlpFile.getManifestsAttributes().isTrustedOnly()); final JNLPClassLoader classLoader = new JNLPClassLoader(jnlpFile, UpdatePolicy.ALWAYS); //jnlp file got its instance in classlaoders constructor //jnlpFile.getManifestsAttributes().setLoader(classLoader); Exception ex = null; try { final JNLPClassLoader errorClassLoader = new JNLPClassLoader(errorJnlpFile, UpdatePolicy.ALWAYS);//jnlp file got its instance in classlaoders 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("*.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))); 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.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()); 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 classlaoder attached, should be null", jnlpFile.getManifestsAttributes().getMainClass()); Assert.assertNull("no classlaoder attached, should be null", jnlpFile.getManifestsAttributes().getAttribute(Attributes.Name.IMPLEMENTATION_VENDOR)); Assert.assertNull("no classlaoder attached, should be null", jnlpFile.getManifestsAttributes().getAttribute(Attributes.Name.IMPLEMENTATION_TITLE)); Assert.assertNull("no classlaoder attached, should be null", jnlpFile.getManifestsAttributes().getAttribute(Attributes.Name.MAIN_CLASS)); Assert.assertNull("no classlaoder attached, should be null", jnlpFile.getManifestsAttributes().getAttribute(Attributes.Name.IMPLEMENTATION_VENDOR_ID)); Assert.assertNull("no classlaoder attached, should be null", jnlpFile.getManifestsAttributes().getAttribute(Attributes.Name.IMPLEMENTATION_URL)); Assert.assertNull("no classlaoder 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 classlaoders constructor //jnlpFile.getManifestsAttributes().setLoader(classLoader); Assert.assertNotNull("classlaoder attached, should be not null", jnlpFile.getManifestsAttributes().getMainClass()); Assert.assertNull("defined twice, shoud be null", jnlpFile.getManifestsAttributes().getAttribute(Attributes.Name.IMPLEMENTATION_VENDOR)); Assert.assertNotNull("classlaoder attached, should be not null", jnlpFile.getManifestsAttributes().getAttribute(Attributes.Name.IMPLEMENTATION_TITLE)); Assert.assertNotNull("classlaoder 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("classlaoder attached, should be not null", jnlpFile.getManifestsAttributes().getAttribute(Attributes.Name.IMPLEMENTATION_URL)); Assert.assertNotNull("classlaoder attached, should be not null", jnlpFile.getManifestsAttributes().getAttribute(new Attributes.Name(JNLPFile.ManifestsAttributes.APP_NAME))); //correct values are also tested in JnlpClassloaderTest Assert.assertEquals("classlaoder attached, should be not null", "it", jnlpFile.getManifestsAttributes().getAttribute(Attributes.Name.IMPLEMENTATION_TITLE)); Assert.assertEquals("classlaoder attached, should be not null", "DummyClass1", jnlpFile.getManifestsAttributes().getAttribute(Attributes.Name.MAIN_CLASS)); Assert.assertEquals("classlaoder attached, should be not null", "some url1", jnlpFile.getManifestsAttributes().getAttribute(Attributes.Name.IMPLEMENTATION_URL)); Assert.assertEquals("classlaoder 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[]{}) { @Override public String getTitle() { return title; } } })); } private void removeTitle(final DummyJNLPFileWithJar jnlpFile) { jnlpFile.setInfo(Arrays.asList(new InformationDesc[]{})); } } icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/runtime/PaxHeaders.24993/JNLPClassLoaderTest.0000644000000000000000000000013212574544466030040 xustar0030 mtime=1441974582.569016831 30 atime=1441974656.454867343 30 ctime=1441974670.135024818 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/runtime/JNLPClassLoaderTest.java0000664000076400007640000003550412574544466031772 0ustar00jvanekjvanek00000000000000/*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.5.3/tests/netx/unit/net/sourceforge/jnlp/runtime/PaxHeaders.24993/CodeBaseClassLoaderT0000644000000000000000000000013212574544466030150 xustar0030 mtime=1441974582.568016819 30 atime=1441974656.453867332 30 ctime=1441974670.135024818 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/runtime/CodeBaseClassLoaderTest.java0000664000076400007640000002313712574544466032673 0ustar00jvanekjvanek00000000000000/* 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 java.util.Locale; import net.sourceforge.jnlp.JNLPFile; import net.sourceforge.jnlp.NullJnlpFileException; import net.sourceforge.jnlp.ResourcesDesc; import net.sourceforge.jnlp.SecurityDesc; import net.sourceforge.jnlp.SecurityDescTest; 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; @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()); } 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.5.3/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.24993/resources0000644000000000000000000000013112574544466024570 xustar0030 mtime=1441974582.568016819 29 atime=1441974670.15002499 30 ctime=1441974670.135024818 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/resources/0000775000076400007640000000000012574544466025727 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/resources/PaxHeaders.24993/MessagesProperties0000644000000000000000000000013212574544466030415 xustar0030 mtime=1441974582.568016819 30 atime=1441974656.453867332 30 ctime=1441974670.135024818 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/resources/MessagesPropertiesTest.java0000664000076400007640000003274012574544466033264 0ustar00jvanekjvanek00000000000000/* Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; 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(); } } public static LocalesIdentifier main; public 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 (int i = 0; i < secondary.length; i++) { assertNotNull(secondary[i]); } } @Test public void allResourcesAreReallyDifferent() { List bundles = new ArrayList(secondary.length + 1); String detailResults=""; int errors = 0; bundles.addAll(Arrays.asList(secondary)); for (int i = 0; i < bundles.size(); i++) { LocalesIdentifier resourceBundle1 = bundles.get(i); Enumeration keys1 = resourceBundle1.getBundle().getKeys(); LocalesIdentifier resourceBundle2 = main; if (resourceBundle1.getLanguage().equals(resourceBundle2.getLanguage())) { //do not compare same language groups allLog("Skipping same language " + resourceBundle1.getLocale() + " x " + resourceBundle2.getLocale() + " (should be " + resourceBundle1.getIdentifier() + " x " + resourceBundle2.getIdentifier() + ")"); break; } 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"))) { 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 (int i = 0; i < secondary.length; i++) { int localErrors = 0; ResourceBundle sec = secondary[i].getBundle(); String id = secondary[i].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 (int i = 0; i < bundles.size(); i++) { ResourceBundle resourceBundle = bundles.get(i).getBundle(); String id = bundles.get(i).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 (int i = 0; i < secondary.length; i++) { int localErrors = 0; ResourceBundle sec = secondary[i].getBundle(); Enumeration keys = sec.getKeys(); String id = secondary[i].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.5.3/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.24993/launchApp.jnlp0000644000000000000000000000013212574544466025434 xustar0030 mtime=1441974582.567016808 30 atime=1441974656.453867332 30 ctime=1441974670.135024818 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/launchApp.jnlp0000664000076400007640000000057212574544466026521 0ustar00jvanekjvanek00000000000000 Sample Test RedHat icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.24993/config0000644000000000000000000000013112574544466024023 xustar0030 mtime=1441974582.567016808 29 atime=1441974670.15002499 30 ctime=1441974670.135024818 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/config/0000775000076400007640000000000012574544466025162 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/config/PaxHeaders.24993/DirectoryValidatorTes0000644000000000000000000000013212574544466030312 xustar0030 mtime=1441974582.567016808 30 atime=1441974656.453867332 30 ctime=1441974670.135024818 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/config/DirectoryValidatorTest.java0000664000076400007640000002526412574544466032510 0ustar00jvanekjvanek00000000000000/* Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are 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.5.3/tests/netx/unit/net/sourceforge/jnlp/config/PaxHeaders.24993/DeploymentConfigurati0000644000000000000000000000013212574544466030337 xustar0030 mtime=1441974582.567016808 30 atime=1441974656.453867332 30 ctime=1441974670.135024818 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/config/DeploymentConfigurationTest.java0000664000076400007640000000465112574544466033543 0ustar00jvanekjvanek00000000000000/* 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 static org.junit.Assert.assertTrue; import java.util.Properties; import javax.naming.ConfigurationException; import org.junit.Test; public class DeploymentConfigurationTest { @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); } } icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/config/PaxHeaders.24993/BasicValueValidatorsT0000644000000000000000000000013112574544466030216 xustar0030 mtime=1441974582.566016796 29 atime=1441974656.45286732 30 ctime=1441974670.135024818 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/config/BasicValueValidatorsTests.java0000664000076400007640000001065412574544466033125 0ustar00jvanekjvanek00000000000000/* 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); } } } icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.24993/cache0000644000000000000000000000013112574544466023621 xustar0030 mtime=1441974582.566016796 29 atime=1441974670.15002499 30 ctime=1441974670.135024818 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/cache/0000775000076400007640000000000012574544466024760 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/cache/PaxHeaders.24993/ResourceUrlCreatorTest0000644000000000000000000000013112574544466030253 xustar0030 mtime=1441974582.566016796 29 atime=1441974656.45286732 30 ctime=1441974670.135024818 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/cache/ResourceUrlCreatorTest.java0000664000076400007640000001655112574544466032265 0ustar00jvanekjvanek00000000000000package net.sourceforge.jnlp.cache; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertFalse; import java.net.MalformedURLException; import java.net.URL; import net.sourceforge.jnlp.DownloadOptions; import net.sourceforge.jnlp.Version; import org.junit.Test; public class ResourceUrlCreatorTest { 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.5.3/tests/netx/unit/net/sourceforge/jnlp/cache/PaxHeaders.24993/ResourceTrackerTest.ja0000644000000000000000000000013112574544466030155 xustar0030 mtime=1441974582.566016796 29 atime=1441974656.45286732 30 ctime=1441974670.135024818 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/cache/ResourceTrackerTest.java0000664000076400007640000003567212574544466031603 0ustar00jvanekjvanek00000000000000/* 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 java.io.ByteArrayOutputStream; import java.io.File; import java.io.IOException; import java.io.PrintStream; import java.io.UnsupportedEncodingException; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URISyntaxException; import java.net.URL; import java.util.HashMap; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.ServerLauncher; import net.sourceforge.jnlp.Version; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.util.logging.OutputController; import net.sourceforge.jnlp.util.UrlUtils; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; public class ResourceTrackerTest { public static ServerLauncher testServer; public static ServerLauncher testServerWithBrokenHead; private static PrintStream[] backedUpStream = new PrintStream[4]; private static ByteArrayOutputStream currentErrorStream; private static final String nameStub1 = "itw-server"; private static final String nameStub2 = "test-file"; @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); } @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 = ResourceTracker.getUrlResponseCode(testServer.getUrl(f.getName()), new HashMap(), "HEAD"); Assert.assertEquals(HttpURLConnection.HTTP_OK, i); f.delete(); i = ResourceTracker.getUrlResponseCode(testServer.getUrl(f.getName()), new HashMap(), "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 = ResourceTracker.getUrlResponseCode(testServerWithBrokenHead.getUrl(f.getName()), new HashMap(), "HEAD"); Assert.assertEquals(HttpURLConnection.HTTP_NOT_IMPLEMENTED, i); f.delete(); i = ResourceTracker.getUrlResponseCode(testServerWithBrokenHead.getUrl(f.getName()), new HashMap(), "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 = ResourceTracker.getUrlResponseCode(testServerWithBrokenHead.getUrl(f.getName()), new HashMap(), "GET"); Assert.assertEquals(HttpURLConnection.HTTP_OK, i); f.delete(); i = ResourceTracker.getUrlResponseCode(testServerWithBrokenHead.getUrl(f.getName()), new HashMap(), "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 = ResourceTracker.getUrlResponseCode(testServer.getUrl(f.getName()), new HashMap(), "GET"); Assert.assertEquals(HttpURLConnection.HTTP_OK, i); f.delete(); i = ResourceTracker.getUrlResponseCode(testServer.getUrl(f.getName()), new HashMap(), "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 { ResourceTracker.getUrlResponseCode(testServer.getUrl(f.getName()), new HashMap(), "SomethingWrong"); } catch (Exception ex) { exception = ex; } Assert.assertNotNull(exception); exception = null; f.delete(); try { ResourceTracker.getUrlResponseCode(testServer.getUrl(f.getName()), new HashMap(), "SomethingWrong"); } 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(); ResourceTracker rt = new ResourceTracker(); 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(rt.findBestUrl(r1)); assertVersionedOneOnServerWithHeader(rt.findBestUrl(r3)); assertOnServerWithoutHeader(rt.findBestUrl(r2)); assertVersionedOneOnServerWithoutHeader(rt.findBestUrl(r4)); fileForServerWithHeader.delete(); Assert.assertNull(rt.findBestUrl(r1)); assertVersionedOneOnServerWithHeader(rt.findBestUrl(r3)); assertOnServerWithoutHeader(rt.findBestUrl(r2)); assertVersionedOneOnServerWithoutHeader(rt.findBestUrl(r4)); versionedFileForServerWithHeader.delete(); Assert.assertNull(rt.findBestUrl(r1)); Assert.assertNull(rt.findBestUrl(r3)); assertOnServerWithoutHeader(rt.findBestUrl(r2)); assertVersionedOneOnServerWithoutHeader(rt.findBestUrl(r4)); versionedFileForServerWithoutHeader.delete(); Assert.assertNull(rt.findBestUrl(r1)); Assert.assertNull(rt.findBestUrl(r3)); assertOnServerWithoutHeader(rt.findBestUrl(r2)); Assert.assertNull(rt.findBestUrl(r4)); fileForServerWithoutHeader.delete(); Assert.assertNull(rt.findBestUrl(r1)); Assert.assertNull(rt.findBestUrl(r3)); Assert.assertNull(rt.findBestUrl(r2)); Assert.assertNull(rt.findBestUrl(r4)); } finally { redirectErrBack(); } } 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 assertOnServerWithoutHeader(URL u) { assertCommonComponentsOfUrl(u); assertPort(u, testServerWithBrokenHead.getPort()); } private void assertVersionedOneOnServerWithoutHeader(URL u) { assertCommonComponentsOfUrl(u); assertPort(u, testServerWithBrokenHead.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")); } } icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/cache/PaxHeaders.24993/NativeLibraryStorageTe0000644000000000000000000000013112574544466030212 xustar0030 mtime=1441974582.565016785 29 atime=1441974656.45286732 30 ctime=1441974670.135024818 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/cache/NativeLibraryStorageTest.java0000664000076400007640000001577712574544466032604 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/netx/unit/net/sourceforge/jnlp/cache/PaxHeaders.24993/CacheUtilTest.java0000644000000000000000000000013212574544466027243 xustar0030 mtime=1441974582.565016785 30 atime=1441974656.451867309 30 ctime=1441974670.135024818 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/cache/CacheUtilTest.java0000664000076400007640000000445112574544466030330 0ustar00jvanekjvanek00000000000000/* 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.net.URL; import org.junit.Assert; import org.junit.Test; /** Test various corner cases of the parser */ 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, CacheUtil.urlEquals(u[i], n[i])); Assert.assertTrue("normalized form " + i + " must CacheUtil.urlEquals to its original " + i, CacheUtil.urlEquals(n[i], u[i])); } } } icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/cache/PaxHeaders.24993/CacheLRUWrapperTest.ja0000644000000000000000000000013212574544466030002 xustar0030 mtime=1441974582.565016785 30 atime=1441974656.451867309 30 ctime=1441974670.135024818 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/cache/CacheLRUWrapperTest.java0000664000076400007640000001413512574544466031416 0ustar00jvanekjvanek00000000000000/* 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.assertTrue; import java.io.File; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.util.PropertiesFile; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; public class CacheLRUWrapperTest { private static final CacheLRUWrapper clw = CacheLRUWrapper.getInstance(); private static String cacheDirBackup; private static PropertiesFile cacheOrderBackup; // does no DeploymentConfiguration exist for this file name? private static final String cacheIndexFileName = CacheLRUWrapper.CACHE_INDEX_FILE_NAME + "_testing"; private final int noEntriesCacheFile = 1000; @BeforeClass static public void setupJNLPRuntimeConfig() { cacheDirBackup = clw.cacheDir; cacheOrderBackup = clw.cacheOrder; clw.cacheDir=System.getProperty("java.io.tmpdir"); clw.cacheOrder = new PropertiesFile( new File(clw.cacheDir + File.separator + cacheIndexFileName)); } @AfterClass static public void restoreJNLPRuntimeConfig() { clw.cacheDir = cacheDirBackup; clw.cacheOrder = cacheOrderBackup; } @Test public void testLoadStoreTiming() throws InterruptedException { final File cacheIndexFile = new File(clw.cacheDir + File.separator + cacheIndexFileName); cacheIndexFile.delete(); //ensure it exists, so we can lock clw.store(); 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.cacheDir + 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 = new File(clw.cacheDir + File.separator + cacheIndexFileName); cacheIndexFile.delete(); //ensure it exists, so we can lock clw.store(); 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(); // clear cache + store file clw.clearLRUSortedEntries(); clw.store(); clw.unlock(); } } icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.24993/browser0000644000000000000000000000013112574544466024241 xustar0030 mtime=1441974582.564016773 29 atime=1441974670.15002499 30 ctime=1441974670.135024818 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/browser/0000775000076400007640000000000012574544466025400 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/browser/PaxHeaders.24993/BrowserAwareProxySel0000644000000000000000000000013212574544466030353 xustar0030 mtime=1441974582.564016773 30 atime=1441974656.451867309 30 ctime=1441974670.135024818 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/browser/BrowserAwareProxySelectorTest.java0000664000076400007640000002072712574544466034261 0ustar00jvanekjvanek00000000000000/* BrowserAwareProxySelectorTest.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.browser; import static org.junit.Assert.assertEquals; import java.io.IOException; import java.net.InetSocketAddress; import java.net.Proxy; import java.net.Proxy.Type; import java.net.URI; import java.net.URISyntaxException; import java.util.HashMap; import java.util.List; import java.util.Map; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.JNLPProxySelector; import org.junit.Before; import org.junit.Test; public class BrowserAwareProxySelectorTest { static class TestBrowserAwareProxySelector extends BrowserAwareProxySelector { private final Map 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.5.3/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.24993/basic.jnlp0000644000000000000000000000013212574544466024602 xustar0030 mtime=1441974582.564016773 30 atime=1441974656.451867309 30 ctime=1441974670.135024818 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/basic.jnlp0000664000076400007640000000312612574544466025665 0ustar00jvanekjvanek00000000000000 Large JNLP The IcedTea Project one-line short tooltip related-content <!-- or something -->title decription of related-content arg1 arg2 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.24993/awt0000644000000000000000000000013112574544466023351 xustar0030 mtime=1441974582.564016773 29 atime=1441974670.15002499 30 ctime=1441974670.135024818 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/awt/0000775000076400007640000000000012574544466024510 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/awt/PaxHeaders.24993/imagesearch0000644000000000000000000000013112574544466025621 xustar0030 mtime=1441974582.564016773 29 atime=1441974670.15002499 30 ctime=1441974670.135024818 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/awt/imagesearch/0000775000076400007640000000000012574544466026760 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/awt/imagesearch/PaxHeaders.24993/ComponentFin0000644000000000000000000000013212574544466030221 xustar0030 mtime=1441974582.564016773 30 atime=1441974656.451867309 30 ctime=1441974670.135024818 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/awt/imagesearch/ComponentFinderTest.java0000664000076400007640000000412412574544466033556 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.24993/application0000644000000000000000000000013112574544466025061 xustar0030 mtime=1441974582.563016762 29 atime=1441974670.15002499 30 ctime=1441974670.135024818 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/application/0000775000076400007640000000000012574544466026220 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/application/PaxHeaders.24993/application8.jnl0000644000000000000000000000013212574544466030237 xustar0030 mtime=1441974582.563016762 30 atime=1441974656.450867297 30 ctime=1441974670.135024818 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/application/application8.jnlp0000664000076400007640000000071612574544466031504 0ustar00jvanekjvanek00000000000000 Sample RedHat This is a sample to test a bug icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/application/PaxHeaders.24993/application7.jnl0000644000000000000000000000013212574544466030236 xustar0030 mtime=1441974582.563016762 30 atime=1441974656.450867297 30 ctime=1441974670.135024818 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/application/application7.jnlp0000664000076400007640000000042512574544466031500 0ustar00jvanekjvanek00000000000000 Sample Test RedHat icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/application/PaxHeaders.24993/application6.jnl0000644000000000000000000000013212574544466030235 xustar0030 mtime=1441974582.563016762 30 atime=1441974656.450867297 30 ctime=1441974670.135024818 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/application/application6.jnlp0000664000076400007640000000061412574544466031477 0ustar00jvanekjvanek00000000000000 Sample Test RedHat icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/application/PaxHeaders.24993/application5.jnl0000644000000000000000000000013112574544466030233 xustar0029 mtime=1441974582.56201675 30 atime=1441974656.450867297 30 ctime=1441974670.135024818 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/application/application5.jnlp0000664000076400007640000000053712574544466031502 0ustar00jvanekjvanek00000000000000 Sample Test RedHat icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/application/PaxHeaders.24993/application4.jnl0000644000000000000000000000013112574544466030232 xustar0029 mtime=1441974582.56201675 30 atime=1441974656.450867297 30 ctime=1441974670.135024818 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/application/application4.jnlp0000664000076400007640000000051112574544466031471 0ustar00jvanekjvanek00000000000000 Sample Test * icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/application/PaxHeaders.24993/application3.jnl0000644000000000000000000000013112574544466030231 xustar0029 mtime=1441974582.56201675 30 atime=1441974656.449867285 30 ctime=1441974670.135024818 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/application/application3.jnlp0000664000076400007640000000075612574544466031503 0ustar00jvanekjvanek00000000000000 Sample Test RedHat icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/application/PaxHeaders.24993/application2.jnl0000644000000000000000000000013112574544466030230 xustar0029 mtime=1441974582.56201675 30 atime=1441974656.449867285 30 ctime=1441974670.135024818 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/application/application2.jnlp0000664000076400007640000000053312574544466031473 0ustar00jvanekjvanek00000000000000 RedHat Sample Test icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/application/PaxHeaders.24993/application1.jnl0000644000000000000000000000013212574544466030230 xustar0030 mtime=1441974582.561016739 30 atime=1441974656.449867285 30 ctime=1441974670.135024818 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/application/application1.jnlp0000664000076400007640000000053312574544466031472 0ustar00jvanekjvanek00000000000000 Sample Test RedHat icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/application/PaxHeaders.24993/application0.jnl0000644000000000000000000000013212574544466030227 xustar0030 mtime=1441974582.561016739 30 atime=1441974656.449867285 30 ctime=1441974670.135024818 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/application/application0.jnlp0000664000076400007640000000073312574544466031473 0ustar00jvanekjvanek00000000000000 random tag test ]]> Sample Test RedHat icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.24993/VersionTest.java0000644000000000000000000000013212574544466025764 xustar0030 mtime=1441974582.561016739 30 atime=1441974656.449867285 30 ctime=1441974670.135024818 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/VersionTest.java0000664000076400007640000000611212574544466027045 0ustar00jvanekjvanek00000000000000/* 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])); } } } } icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.24993/SecurityDescTest.java0000644000000000000000000000013212574544466026745 xustar0030 mtime=1441974582.561016739 30 atime=1441974656.448867274 30 ctime=1441974670.135024818 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/SecurityDescTest.java0000664000076400007640000002075512574544466030037 0ustar00jvanekjvanek00000000000000/* Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are 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, "hey!"); } 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, "hey!"); } @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 testGetHostWithSpecifiedPortWithUserInfoWi() 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.5.3/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.24993/PropertyDescTest.java0000644000000000000000000000013212574544466026762 xustar0030 mtime=1441974582.560016727 30 atime=1441974656.448867274 30 ctime=1441974670.134024806 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/PropertyDescTest.java0000664000076400007640000000757312574544466030057 0ustar00jvanekjvanek00000000000000/* 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", "none"); Assert.assertEquals("key", p.getKey()); Assert.assertEquals("value", p.getValue()); } @Test public void correctEmptyValue() throws LaunchException{ PropertyDesc p = PropertyDesc.fromString("key=", "none"); Assert.assertEquals("key", p.getKey()); Assert.assertEquals("", p.getValue()); } @Test public void strangeEmptyValue() throws LaunchException{ PropertyDesc p = PropertyDesc.fromString("key= ", "none"); Assert.assertEquals("key", p.getKey()); Assert.assertEquals(" ", p.getValue()); } @Test public void emptyKey() throws LaunchException{ PropertyDesc p = PropertyDesc.fromString("=value", "none"); Assert.assertEquals("", p.getKey()); Assert.assertEquals("value", p.getValue()); } @Test public void strangeEmptyKey() throws LaunchException{ PropertyDesc p = PropertyDesc.fromString(" =value", "none"); Assert.assertEquals(" ", p.getKey()); Assert.assertEquals("value", p.getValue()); } @Test public void allEmpty() throws LaunchException{ PropertyDesc p = PropertyDesc.fromString("=", "none"); Assert.assertEquals("", p.getKey()); Assert.assertEquals("", p.getValue()); } @Test public void allStarngeEmpty() throws LaunchException{ PropertyDesc p = PropertyDesc.fromString(" = ", "none"); Assert.assertEquals(" ", p.getKey()); Assert.assertEquals(" ", p.getValue()); } @Test(expected = LaunchException.class) public void irregularValue() throws LaunchException{ PropertyDesc p = PropertyDesc.fromString("key", "none"); } @Test(expected = LaunchException.class) public void empty() throws LaunchException{ PropertyDesc p = PropertyDesc.fromString("", "none"); } @Test(expected = NullPointerException.class) public void nullValue() throws LaunchException{ PropertyDesc p = PropertyDesc.fromString(null, "none"); } } icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.24993/PluginParametersTest.java0000644000000000000000000000013212574544466027621 xustar0030 mtime=1441974582.560016727 30 atime=1441974656.448867274 30 ctime=1441974670.134024806 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/PluginParametersTest.java0000664000076400007640000001201612574544466030702 0ustar00jvanekjvanek00000000000000package net.sourceforge.jnlp; import static org.junit.Assert.*; import java.util.HashMap; import java.util.Hashtable; 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; Hashtable 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; Hashtable 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.5.3/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.24993/PluginBridgeTest.java0000644000000000000000000000013212574544466026712 xustar0030 mtime=1441974582.560016727 30 atime=1441974656.448867274 30 ctime=1441974670.134024806 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/PluginBridgeTest.java0000664000076400007640000003520212574544466027775 0ustar00jvanekjvanek00000000000000/* * 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.IOException; import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; import java.util.HashMap; import java.util.Map; import java.util.Hashtable; import java.util.List; import net.sourceforge.jnlp.cache.UpdatePolicy; import net.sourceforge.jnlp.util.replacements.BASE64Encoder; import org.junit.Assert; import org.junit.Test; public class PluginBridgeTest { 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 { public AppletDesc getApplet() { return new AppletDesc(null, null, null, 0, 0, new HashMap()); } 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); } @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"); } } icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.24993/ParserTest.java0000644000000000000000000000013212574544466025573 xustar0030 mtime=1441974582.559016716 30 atime=1441974656.448867274 30 ctime=1441974670.134024806 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/ParserTest.java0000664000076400007640000020160612574544466026661 0ustar00jvanekjvanek00000000000000/* 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 org.junit.Assert; import org.junit.Test; /** Test various corner cases of the parser */ public class ParserTest { 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(); @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); } } icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.24993/ParserSettingsTest.java0000644000000000000000000000013212574544466027314 xustar0030 mtime=1441974582.559016716 30 atime=1441974656.447867263 30 ctime=1441974670.134024806 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/ParserSettingsTest.java0000664000076400007640000000610712574544466030401 0ustar00jvanekjvanek00000000000000/* 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 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 testNoArgsSameAsDefault() { ParserSettings defaultSettings, noArgs; defaultSettings = new ParserSettings(); noArgs = ParserSettings.setGlobalParserSettingsFromArgs(new String[0]); Assert.assertTrue("isExtensionAllowed should have been equal", defaultSettings.isExtensionAllowed() == noArgs.isExtensionAllowed()); Assert.assertTrue("isStrict should have been equal", defaultSettings.isStrict() == noArgs.isStrict()); Assert.assertTrue("isMalformedXmlAllowed should have been equal", defaultSettings.isMalformedXmlAllowed() == noArgs.isMalformedXmlAllowed()); } @Test public void testWithArgs() { ParserSettings settings = ParserSettings.setGlobalParserSettingsFromArgs(new String[] { "-strict", "-xml", }); Assert.assertTrue("isStrict should have been true", settings.isStrict() == true); Assert.assertTrue("isMalformedXmlAllowed should have been false", settings.isMalformedXmlAllowed() == false); Assert.assertTrue("isExtensionAllowed should have been true", settings.isExtensionAllowed() == true); } } icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.24993/ParserMalformedXml.java0000644000000000000000000000013212574544466027243 xustar0030 mtime=1441974582.558016704 30 atime=1441974656.447867263 30 ctime=1441974670.134024806 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/ParserMalformedXml.java0000664000076400007640000001066712574544466030336 0ustar00jvanekjvanek00000000000000/* 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.KnownToFail; 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)); } } icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.24993/ParserCornerCases.java0000644000000000000000000000013212574544466027063 xustar0030 mtime=1441974582.558016704 30 atime=1441974656.447867263 30 ctime=1441974670.134024806 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/ParserCornerCases.java0000664000076400007640000002362012574544466030147 0ustar00jvanekjvanek00000000000000/* 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.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()); } } icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.24993/ParserBasic.java0000644000000000000000000000013212574544466025675 xustar0030 mtime=1441974582.557016693 30 atime=1441974656.447867263 30 ctime=1441974670.134024806 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/ParserBasic.java0000664000076400007640000002577712574544466027000 0ustar00jvanekjvanek00000000000000/* 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.isOnline()); 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.5.3/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.24993/LaunchExceptionTest.java0000644000000000000000000000013212574544466027430 xustar0030 mtime=1441974582.557016693 30 atime=1441974656.447867263 30 ctime=1441974670.134024806 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/LaunchExceptionTest.java0000664000076400007640000000546112574544466030517 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.24993/JREDescTest.java0000644000000000000000000000013212574544466025556 xustar0030 mtime=1441974582.557016693 30 atime=1441974656.446867251 30 ctime=1441974670.134024806 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/JREDescTest.java0000664000076400007640000001323212574544466026640 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.24993/JNLPMatcherTest.java0000644000000000000000000000013212574544466026406 xustar0030 mtime=1441974582.557016693 30 atime=1441974656.446867251 30 ctime=1441974670.134024806 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/JNLPMatcherTest.java0000664000076400007640000004500612574544466027474 0ustar00jvanekjvanek00000000000000/* 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.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.StringReader; import java.util.Random; import net.sourceforge.jnlp.annotations.KnownToFail; import org.junit.Assert; import org.junit.Test; public class JNLPMatcherTest { 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" }; final ClassLoader cl = ClassLoader.getSystemClassLoader(); private InputStreamReader getLaunchReader() { InputStream launchStream = cl .getResourceAsStream("net/sourceforge/jnlp/launchApp.jnlp"); return new InputStreamReader(launchStream); } @Test @KnownToFail public void testTemplateCDATA() throws JNLPMatcherException, IOException { InputStreamReader launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/templates/template0.jnlp"); InputStreamReader fileReader = new InputStreamReader(fileStream); JNLPMatcher test = new JNLPMatcher(fileReader, launchReader, true); Assert.assertEquals(tests[0], true, test.isMatch()); fileReader.close(); launchReader.close(); } @Test public void testTemplateDuplicate() throws JNLPMatcherException, IOException { InputStreamReader launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/templates/template1.jnlp"); InputStreamReader fileReader = new InputStreamReader(fileStream); JNLPMatcher test = new JNLPMatcher(fileReader, launchReader, true); Assert.assertEquals(tests[1], true, test.isMatch()); fileReader.close(); launchReader.close(); } @Test public void testTemplateWildCharsRandom() throws JNLPMatcherException, IOException { InputStreamReader launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/templates/template2.jnlp"); InputStreamReader fileReader = new InputStreamReader(fileStream); JNLPMatcher test = new JNLPMatcher(fileReader, launchReader, true); Assert.assertEquals(tests[2], true, test.isMatch()); fileReader.close(); launchReader.close(); } @Test public void testTemplateDifferentOrder() throws JNLPMatcherException, IOException { InputStreamReader launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/templates/template3.jnlp"); InputStreamReader fileReader = new InputStreamReader(fileStream); JNLPMatcher test = new JNLPMatcher(fileReader, launchReader, true); Assert.assertEquals(tests[3], true, test.isMatch()); fileReader.close(); launchReader.close(); } @Test public void testTemplateWildCharsAsAllValues() throws JNLPMatcherException, IOException { InputStreamReader launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/templates/template4.jnlp"); InputStreamReader fileReader = new InputStreamReader(fileStream); JNLPMatcher test = new JNLPMatcher(fileReader, launchReader, true); Assert.assertEquals(tests[4], true, test.isMatch()); fileReader.close(); launchReader.close(); } @Test public void testTemplateComments() throws JNLPMatcherException, IOException { InputStreamReader launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/templates/template5.jnlp"); InputStreamReader fileReader = new InputStreamReader(fileStream); JNLPMatcher test = new JNLPMatcher(fileReader, launchReader, true); Assert.assertEquals(tests[5], true, test.isMatch()); fileReader.close(); launchReader.close(); } @Test public void testTemplateDifferentValues() throws JNLPMatcherException, IOException { InputStreamReader launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/templates/template6.jnlp"); InputStreamReader fileReader = new InputStreamReader(fileStream); JNLPMatcher test = new JNLPMatcher(fileReader, launchReader, true); Assert.assertEquals(tests[6], false, test.isMatch()); fileReader.close(); launchReader.close(); } @Test public void testTemplateExtraChild() throws JNLPMatcherException, IOException { InputStreamReader launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/templates/template7.jnlp"); InputStreamReader fileReader = new InputStreamReader(fileStream); JNLPMatcher test = new JNLPMatcher(fileReader, launchReader, true); Assert.assertEquals(tests[7], false, test.isMatch()); fileReader.close(); launchReader.close(); } @Test public void testTemplateFewerChild() throws JNLPMatcherException, IOException { InputStreamReader launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/templates/template8.jnlp"); InputStreamReader fileReader = new InputStreamReader(fileStream); JNLPMatcher test = new JNLPMatcher(fileReader, launchReader, true); Assert.assertEquals(tests[8], false, test.isMatch()); fileReader.close(); launchReader.close(); } @Test public void testTemplateDifferentFile() throws JNLPMatcherException, IOException { InputStreamReader launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/templates/template9.jnlp"); InputStreamReader fileReader = new InputStreamReader(fileStream); JNLPMatcher test = new JNLPMatcher(fileReader, launchReader, true); Assert.assertEquals(tests[9], false, test.isMatch()); fileReader.close(); launchReader.close(); } @Test @KnownToFail public void testApplicationCDATA() throws JNLPMatcherException, IOException { InputStreamReader launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/application/application0.jnlp"); InputStreamReader fileReader = new InputStreamReader(fileStream); JNLPMatcher test = new JNLPMatcher(fileReader, launchReader, false); Assert.assertEquals(tests[10], true, test.isMatch()); fileReader.close(); launchReader.close(); } @Test public void testApplicationDuplicate() throws JNLPMatcherException, IOException { InputStreamReader launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/application/application1.jnlp"); InputStreamReader fileReader = new InputStreamReader(fileStream); JNLPMatcher test = new JNLPMatcher(fileReader, launchReader, false); Assert.assertEquals(tests[11], true, test.isMatch()); fileReader.close(); launchReader.close(); } @Test public void testApplicationDifferentOrder() throws JNLPMatcherException, IOException { InputStreamReader launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/application/application2.jnlp"); InputStreamReader fileReader = new InputStreamReader(fileStream); JNLPMatcher test = new JNLPMatcher(fileReader, launchReader, false); Assert.assertEquals(tests[12], true, test.isMatch()); fileReader.close(); launchReader.close(); } @Test public void testApplicationComments() throws JNLPMatcherException, IOException { InputStreamReader launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/application/application3.jnlp"); InputStreamReader fileReader = new InputStreamReader(fileStream); JNLPMatcher test = new JNLPMatcher(fileReader, launchReader, false); Assert.assertEquals(tests[13], true, test.isMatch()); fileReader.close(); launchReader.close(); } @Test public void testApplicationWildCharsRandom() throws JNLPMatcherException, IOException { InputStreamReader launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/application/application4.jnlp"); InputStreamReader fileReader = new InputStreamReader(fileStream); JNLPMatcher test = new JNLPMatcher(fileReader, launchReader, false); Assert.assertEquals(tests[14], false, test.isMatch()); fileReader.close(); launchReader.close(); } @Test public void testApplicationDifferentCodebaseValue() throws JNLPMatcherException, IOException { InputStreamReader launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/application/application5.jnlp"); InputStreamReader fileReader = new InputStreamReader(fileStream); JNLPMatcher test = new JNLPMatcher(fileReader, launchReader, false); Assert.assertEquals(tests[15], false, test.isMatch()); fileReader.close(); launchReader.close(); } @Test public void testApplicationExtraChild() throws JNLPMatcherException, IOException { InputStreamReader launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/application/application6.jnlp"); InputStreamReader fileReader = new InputStreamReader(fileStream); JNLPMatcher test = new JNLPMatcher(fileReader, launchReader, false); Assert.assertEquals(tests[16], false, test.isMatch()); fileReader.close(); launchReader.close(); } @Test public void testApplicationFewerChild() throws JNLPMatcherException, IOException { InputStreamReader launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/application/application7.jnlp"); InputStreamReader fileReader = new InputStreamReader(fileStream); JNLPMatcher test = new JNLPMatcher(fileReader, launchReader, false); Assert.assertEquals(tests[17], false, test.isMatch()); fileReader.close(); launchReader.close(); } @Test public void testApplicationDifferentFile() throws JNLPMatcherException, IOException { InputStreamReader launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/application/application8.jnlp"); InputStreamReader fileReader = new InputStreamReader(fileStream); JNLPMatcher test = new JNLPMatcher(fileReader, launchReader, false); Assert.assertEquals(tests[18], false, test.isMatch()); fileReader.close(); launchReader.close(); } @SuppressWarnings("unused") @Test public void testNullJNLPFiles() throws IOException { Exception expectedException = null; InputStreamReader launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/application/application8.jnlp"); InputStreamReader fileReader = new InputStreamReader(fileStream); try { JNLPMatcher test = new JNLPMatcher(null, launchReader, false); } 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(fileReader, null, false); } 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); } 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"); launchReader.close(); fileReader.close(); } @Test public void testCallingMatchMultiple() throws JNLPMatcherException, IOException { // Check with application InputStreamReader launchReader = this.getLaunchReader(); InputStream fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/application/application8.jnlp"); InputStreamReader fileReader = new InputStreamReader(fileStream); JNLPMatcher test = new JNLPMatcher(fileReader, launchReader, false); Assert.assertEquals(tests[19], false, test.isMatch()); Assert.assertEquals(tests[19], false, test.isMatch()); fileReader.close(); launchReader.close(); // Check with template launchReader = this.getLaunchReader(); fileStream = cl .getResourceAsStream("net/sourceforge/jnlp/templates/template6.jnlp"); fileReader = new InputStreamReader(fileStream); test = new JNLPMatcher(fileReader, launchReader, true); Assert.assertEquals(tests[19], false, test.isMatch()); Assert.assertEquals(tests[19], false, test.isMatch()); fileReader.close(); launchReader.close(); } @Test (timeout=5000 /*ms*/) public void testIsMatchDoesNotHangOnLargeData() throws JNLPMatcherException { /* 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"; StringReader reader1 = new StringReader(file); StringReader reader2 = new StringReader(file); JNLPMatcher matcher = new JNLPMatcher(reader1, reader2, false); Assert.assertTrue(matcher.isMatch()); } } icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.24993/JNLPFileTest.java0000644000000000000000000000013212574544466025702 xustar0030 mtime=1441974582.556016681 30 atime=1441974656.446867251 30 ctime=1441974670.134024806 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/JNLPFileTest.java0000664000076400007640000004167712574544466027002 0ustar00jvanekjvanek00000000000000/* 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()); } } icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.24993/InformationDescTest.java0000644000000000000000000000013212574544466027423 xustar0030 mtime=1441974582.556016681 30 atime=1441974656.446867251 30 ctime=1441974670.134024806 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/InformationDescTest.java0000664000076400007640000002040512574544466030505 0ustar00jvanekjvanek00000000000000/* 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]); assertFalse(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.5.3/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.24993/DefaultLaunchHandlerTest.jav0000644000000000000000000000013112574544466030212 xustar0029 mtime=1441974582.55501667 30 atime=1441974656.446867251 30 ctime=1441974670.134024806 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/DefaultLaunchHandlerTest.java0000664000076400007640000001404712574544466031443 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/netx/unit/net/sourceforge/jnlp/PaxHeaders.24993/AsyncCallTest.java0000644000000000000000000000013112574544466026207 xustar0029 mtime=1441974582.55501667 30 atime=1441974656.445867239 30 ctime=1441974670.134024806 icedtea-web-1.5.3/tests/netx/unit/net/sourceforge/jnlp/AsyncCallTest.java0000664000076400007640000000462512574544466027300 0ustar00jvanekjvanek00000000000000package 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.5.3/tests/netx/PaxHeaders.24993/pac0000644000000000000000000000013112574544466016266 xustar0030 mtime=1441974582.554016658 29 atime=1441974670.15002499 30 ctime=1441974670.134024806 icedtea-web-1.5.3/tests/netx/pac/0000775000076400007640000000000012574544466017425 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/netx/pac/PaxHeaders.24993/pac-funcs-test.js0000644000000000000000000000013212574544466021536 xustar0030 mtime=1441974582.554016658 30 atime=1441974656.445867239 30 ctime=1441974670.134024806 icedtea-web-1.5.3/tests/netx/pac/pac-funcs-test.js0000664000076400007640000005703512574544466022631 0ustar00jvanekjvanek00000000000000 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.5.3/tests/PaxHeaders.24993/junit-runner0000644000000000000000000000013112574544466017205 xustar0030 mtime=1441974582.554016658 29 atime=1441974670.15002499 30 ctime=1441974670.134024806 icedtea-web-1.5.3/tests/junit-runner/0000775000076400007640000000000012574544466020344 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/junit-runner/PaxHeaders.24993/README0000644000000000000000000000013212574544466020143 xustar0030 mtime=1441974582.554016658 30 atime=1441974656.445867239 30 ctime=1441974670.134024806 icedtea-web-1.5.3/tests/junit-runner/README0000664000076400007640000000027212574544466021225 0ustar00jvanekjvanek00000000000000junit-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.5.3/tests/junit-runner/PaxHeaders.24993/LessVerboseTextListener.java0000644000000000000000000000013212574544466024735 xustar0030 mtime=1441974582.554016658 30 atime=1441974656.445867239 30 ctime=1441974670.134024806 icedtea-web-1.5.3/tests/junit-runner/LessVerboseTextListener.java0000664000076400007640000001304312574544466026017 0ustar00jvanekjvanek00000000000000/* * 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.5.3/tests/junit-runner/PaxHeaders.24993/JunitLikeXmlOutputListener.java0000644000000000000000000000013212574544466025434 xustar0030 mtime=1441974582.553016647 30 atime=1441974656.444867228 30 ctime=1441974670.134024806 icedtea-web-1.5.3/tests/junit-runner/JunitLikeXmlOutputListener.java0000664000076400007640000004344412574544466026526 0ustar00jvanekjvanek00000000000000/* * 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/"; if (string.startsWith(distro)) { r[0] = "distro-pkg"; return r; } if (string.startsWith(openjdk)) { r[0] = "openjdk"; 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]); } } icedtea-web-1.5.3/tests/junit-runner/PaxHeaders.24993/CommandLine.java0000644000000000000000000000013212574544466022314 xustar0030 mtime=1441974582.553016647 30 atime=1441974656.444867228 30 ctime=1441974670.134024806 icedtea-web-1.5.3/tests/junit-runner/CommandLine.java0000664000076400007640000000351112574544466023375 0ustar00jvanekjvanek00000000000000/* * 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.5.3/tests/PaxHeaders.24993/jacoco-operator0000644000000000000000000000013112574544466017634 xustar0030 mtime=1441974582.552016635 29 atime=1441974670.15002499 30 ctime=1441974670.134024806 icedtea-web-1.5.3/tests/jacoco-operator/0000775000076400007640000000000012574544466020773 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/jacoco-operator/PaxHeaders.24993/org0000644000000000000000000000013112574544466020423 xustar0030 mtime=1441974582.552016635 29 atime=1441974670.15002499 30 ctime=1441974670.134024806 icedtea-web-1.5.3/tests/jacoco-operator/org/0000775000076400007640000000000012574544466021562 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/jacoco-operator/org/PaxHeaders.24993/jacoco0000644000000000000000000000013112574544466021661 xustar0030 mtime=1441974582.552016635 29 atime=1441974670.15002499 30 ctime=1441974670.134024806 icedtea-web-1.5.3/tests/jacoco-operator/org/jacoco/0000775000076400007640000000000012574544466023020 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/jacoco-operator/org/jacoco/PaxHeaders.24993/operator0000644000000000000000000000013112574544466023514 xustar0030 mtime=1441974582.552016635 29 atime=1441974670.15002499 30 ctime=1441974670.134024806 icedtea-web-1.5.3/tests/jacoco-operator/org/jacoco/operator/0000775000076400007640000000000012574544466024653 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/jacoco-operator/org/jacoco/operator/PaxHeaders.24993/ReportGenerator.java0000644000000000000000000000013212574544466027557 xustar0030 mtime=1441974582.552016635 30 atime=1441974656.444867228 30 ctime=1441974670.134024806 icedtea-web-1.5.3/tests/jacoco-operator/org/jacoco/operator/ReportGenerator.java0000664000076400007640000002454612574544466030653 0ustar00jvanekjvanek00000000000000/* Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, 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.5.3/tests/jacoco-operator/org/jacoco/operator/PaxHeaders.24993/MergeTask.java0000644000000000000000000000013212574544466026317 xustar0030 mtime=1441974582.552016635 30 atime=1441974656.444867228 30 ctime=1441974670.134024806 icedtea-web-1.5.3/tests/jacoco-operator/org/jacoco/operator/MergeTask.java0000664000076400007640000001217312574544466027404 0ustar00jvanekjvanek00000000000000/* Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, 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.5.3/tests/jacoco-operator/org/jacoco/operator/PaxHeaders.24993/Main.java0000644000000000000000000000013212574544466025321 xustar0030 mtime=1441974582.552016635 30 atime=1441974656.444867228 30 ctime=1441974670.134024806 icedtea-web-1.5.3/tests/jacoco-operator/org/jacoco/operator/Main.java0000664000076400007640000002762612574544466026417 0ustar00jvanekjvanek00000000000000/* Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, 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.5.3/tests/PaxHeaders.24993/cpp-unit-tests0000644000000000000000000000013112574544466017444 xustar0030 mtime=1441974582.551016624 29 atime=1441974670.15002499 30 ctime=1441974670.134024806 icedtea-web-1.5.3/tests/cpp-unit-tests/0000775000076400007640000000000012574544466020603 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/cpp-unit-tests/PaxHeaders.24993/main.cc0000644000000000000000000000013212574544466020755 xustar0030 mtime=1441974582.551016624 30 atime=1441974656.443867216 30 ctime=1441974670.134024806 icedtea-web-1.5.3/tests/cpp-unit-tests/main.cc0000664000076400007640000001254212574544466022042 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/cpp-unit-tests/PaxHeaders.24993/checked_allocations.h0000644000000000000000000000013212574544466023651 xustar0030 mtime=1441974582.551016624 30 atime=1441974656.443867216 30 ctime=1441974670.134024806 icedtea-web-1.5.3/tests/cpp-unit-tests/checked_allocations.h0000664000076400007640000000433612574544466024740 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/cpp-unit-tests/PaxHeaders.24993/checked_allocations.cc0000644000000000000000000000013212574544466024007 xustar0030 mtime=1441974582.550016612 30 atime=1441974656.443867216 30 ctime=1441974670.134024806 icedtea-web-1.5.3/tests/cpp-unit-tests/checked_allocations.cc0000664000076400007640000000566012574544466025077 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/cpp-unit-tests/PaxHeaders.24993/browser_mock_npidentifier.h0000644000000000000000000000013212574544466025127 xustar0030 mtime=1441974582.550016612 30 atime=1441974656.443867216 30 ctime=1441974670.134024806 icedtea-web-1.5.3/tests/cpp-unit-tests/browser_mock_npidentifier.h0000664000076400007640000000453412574544466026216 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/cpp-unit-tests/PaxHeaders.24993/browser_mock_npidentifier.cc0000644000000000000000000000013212574544466025265 xustar0030 mtime=1441974582.550016612 30 atime=1441974656.442867205 30 ctime=1441974670.134024806 icedtea-web-1.5.3/tests/cpp-unit-tests/browser_mock_npidentifier.cc0000664000076400007640000001123212574544466026345 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/cpp-unit-tests/PaxHeaders.24993/browser_mock.h0000644000000000000000000000013212574544466022367 xustar0030 mtime=1441974582.550016612 30 atime=1441974656.442867205 30 ctime=1441974670.134024806 icedtea-web-1.5.3/tests/cpp-unit-tests/browser_mock.h0000664000076400007640000000423412574544466023453 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/cpp-unit-tests/PaxHeaders.24993/browser_mock.cc0000644000000000000000000000013012574544466022523 xustar0028 mtime=1441974582.5490166 30 atime=1441974656.442867205 30 ctime=1441974670.134024806 icedtea-web-1.5.3/tests/cpp-unit-tests/browser_mock.cc0000664000076400007640000001164312574544466023613 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/cpp-unit-tests/PaxHeaders.24993/PluginParametersTest.cc0000644000000000000000000000013012574544466024151 xustar0028 mtime=1441974582.5490166 30 atime=1441974656.442867205 30 ctime=1441974670.134024806 icedtea-web-1.5.3/tests/cpp-unit-tests/PluginParametersTest.cc0000664000076400007640000000660212574544466025240 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/cpp-unit-tests/PaxHeaders.24993/MemoryLeakDetector.h0000644000000000000000000000013012574544466023430 xustar0028 mtime=1441974582.5490166 30 atime=1441974656.442867205 30 ctime=1441974670.134024806 icedtea-web-1.5.3/tests/cpp-unit-tests/MemoryLeakDetector.h0000664000076400007640000000643412574544466024522 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/cpp-unit-tests/PaxHeaders.24993/IcedTeaScriptablePluginObjectTest.cc0000644000000000000000000000013212574544466026506 xustar0030 mtime=1441974582.548016589 30 atime=1441974656.441867193 30 ctime=1441974670.134024806 icedtea-web-1.5.3/tests/cpp-unit-tests/IcedTeaScriptablePluginObjectTest.cc0000664000076400007640000001250112574544466027566 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/cpp-unit-tests/PaxHeaders.24993/IcedTeaPluginUtilsTest.cc0000644000000000000000000000013212574544466024367 xustar0030 mtime=1441974582.548016589 30 atime=1441974656.441867193 30 ctime=1441974670.134024806 icedtea-web-1.5.3/tests/cpp-unit-tests/IcedTeaPluginUtilsTest.cc0000664000076400007640000002245112574544466025454 0ustar00jvanekjvanek00000000000000/* 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); } /* 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); } 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.5.3/tests/cpp-unit-tests/PaxHeaders.24993/IcedTeaParsePropertiesTest.cc0000644000000000000000000000013212574544466025237 xustar0030 mtime=1441974582.547016577 30 atime=1441974656.441867193 30 ctime=1441974670.133024795 icedtea-web-1.5.3/tests/cpp-unit-tests/IcedTeaParsePropertiesTest.cc0000664000076400007640000004017112574544466026323 0ustar00jvanekjvanek00000000000000/* 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); } 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.5.3/tests/cpp-unit-tests/PaxHeaders.24993/IcedTeaNPPluginTest.cc0000644000000000000000000000013212574544466023604 xustar0030 mtime=1441974582.547016577 30 atime=1441974656.441867193 30 ctime=1441974670.133024795 icedtea-web-1.5.3/tests/cpp-unit-tests/IcedTeaNPPluginTest.cc0000664000076400007640000000772312574544466024676 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/cpp-unit-tests/PaxHeaders.24993/IcedTeaJavaRequestProcessorTest.cc0000644000000000000000000000013212574544466026242 xustar0030 mtime=1441974582.547016577 30 atime=1441974656.440867182 30 ctime=1441974670.133024795 icedtea-web-1.5.3/tests/cpp-unit-tests/IcedTeaJavaRequestProcessorTest.cc0000664000076400007640000003526212574544466027333 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/PaxHeaders.24993/UnitTest++0000644000000000000000000000013112574544466016452 xustar0030 mtime=1441974582.536016451 29 atime=1441974670.15002499 30 ctime=1441974670.133024795 icedtea-web-1.5.3/tests/UnitTest++/0000775000076400007640000000000012574544466017611 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/UnitTest++/PaxHeaders.24993/src0000644000000000000000000000013112574544466017241 xustar0030 mtime=1441974582.546016566 29 atime=1441974670.15002499 30 ctime=1441974670.133024795 icedtea-web-1.5.3/tests/UnitTest++/src/0000775000076400007640000000000012574544466020400 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/UnitTest++/src/PaxHeaders.24993/XmlTestReporter.h0000644000000000000000000000013212574544466022613 xustar0030 mtime=1441974582.546016566 30 atime=1441974656.440867182 30 ctime=1441974670.133024795 icedtea-web-1.5.3/tests/UnitTest++/src/XmlTestReporter.h0000664000076400007640000000171412574544466023677 0ustar00jvanekjvanek00000000000000#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.5.3/tests/UnitTest++/src/PaxHeaders.24993/XmlTestReporter.cpp0000644000000000000000000000013212574544466023146 xustar0030 mtime=1441974582.546016566 30 atime=1441974656.440867182 30 ctime=1441974670.133024795 icedtea-web-1.5.3/tests/UnitTest++/src/XmlTestReporter.cpp0000664000076400007640000000630312574544466024231 0ustar00jvanekjvanek00000000000000#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.5.3/tests/UnitTest++/src/PaxHeaders.24993/UnitTest++.h0000644000000000000000000000013212574544466021375 xustar0030 mtime=1441974582.546016566 30 atime=1441974656.440867182 30 ctime=1441974670.133024795 icedtea-web-1.5.3/tests/UnitTest++/src/UnitTest++.h0000664000076400007640000000044512574544466022461 0ustar00jvanekjvanek00000000000000#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.5.3/tests/UnitTest++/src/PaxHeaders.24993/TimeHelpers.h0000644000000000000000000000013212574544466021711 xustar0030 mtime=1441974582.546016566 30 atime=1441974656.440867182 30 ctime=1441974670.133024795 icedtea-web-1.5.3/tests/UnitTest++/src/TimeHelpers.h0000664000076400007640000000020312574544466022765 0ustar00jvanekjvanek00000000000000#include "Config.h" #if defined UNITTEST_POSIX #include "Posix/TimeHelpers.h" #else #include "Win32/TimeHelpers.h" #endif icedtea-web-1.5.3/tests/UnitTest++/src/PaxHeaders.24993/TimeConstraint.h0000644000000000000000000000013112574544466022432 xustar0030 mtime=1441974582.545016555 29 atime=1441974656.43986717 30 ctime=1441974670.133024795 icedtea-web-1.5.3/tests/UnitTest++/src/TimeConstraint.h0000664000076400007640000000124512574544466023516 0ustar00jvanekjvanek00000000000000#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.5.3/tests/UnitTest++/src/PaxHeaders.24993/TimeConstraint.cpp0000644000000000000000000000013112574544466022765 xustar0030 mtime=1441974582.545016555 29 atime=1441974656.43986717 30 ctime=1441974670.133024795 icedtea-web-1.5.3/tests/UnitTest++/src/TimeConstraint.cpp0000664000076400007640000000122612574544466024050 0ustar00jvanekjvanek00000000000000#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.5.3/tests/UnitTest++/src/PaxHeaders.24993/TestSuite.h0000644000000000000000000000013112574544466021420 xustar0030 mtime=1441974582.545016555 29 atime=1441974656.43986717 30 ctime=1441974670.133024795 icedtea-web-1.5.3/tests/UnitTest++/src/TestSuite.h0000664000076400007640000000026412574544466022504 0ustar00jvanekjvanek00000000000000#ifndef UNITTEST_TESTSUITE_H #define UNITTEST_TESTSUITE_H namespace UnitTestSuite { inline char const* GetSuiteName () { return "DefaultSuite"; } } #endif icedtea-web-1.5.3/tests/UnitTest++/src/PaxHeaders.24993/TestRunner.h0000644000000000000000000000013112574544466021600 xustar0030 mtime=1441974582.545016555 29 atime=1441974656.43986717 30 ctime=1441974670.133024795 icedtea-web-1.5.3/tests/UnitTest++/src/TestRunner.h0000664000076400007640000000210712574544466022662 0ustar00jvanekjvanek00000000000000#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.5.3/tests/UnitTest++/src/PaxHeaders.24993/TestRunner.cpp0000644000000000000000000000013112574544466022133 xustar0030 mtime=1441974582.544016543 29 atime=1441974656.43986717 30 ctime=1441974670.133024795 icedtea-web-1.5.3/tests/UnitTest++/src/TestRunner.cpp0000664000076400007640000000337612574544466023226 0ustar00jvanekjvanek00000000000000#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.5.3/tests/UnitTest++/src/PaxHeaders.24993/TestResults.h0000644000000000000000000000013212574544466021771 xustar0030 mtime=1441974582.544016543 30 atime=1441974656.438867159 30 ctime=1441974670.133024795 icedtea-web-1.5.3/tests/UnitTest++/src/TestResults.h0000664000076400007640000000136112574544466023053 0ustar00jvanekjvanek00000000000000#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.5.3/tests/UnitTest++/src/PaxHeaders.24993/TestResults.cpp0000644000000000000000000000013212574544466022324 xustar0030 mtime=1441974582.544016543 30 atime=1441974656.438867159 30 ctime=1441974670.133024795 icedtea-web-1.5.3/tests/UnitTest++/src/TestResults.cpp0000664000076400007640000000224112574544466023404 0ustar00jvanekjvanek00000000000000#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.5.3/tests/UnitTest++/src/PaxHeaders.24993/TestReporterStdout.h0000644000000000000000000000013212574544466023335 xustar0030 mtime=1441974582.544016543 30 atime=1441974656.438867159 30 ctime=1441974670.133024795 icedtea-web-1.5.3/tests/UnitTest++/src/TestReporterStdout.h0000664000076400007640000000102312574544466024412 0ustar00jvanekjvanek00000000000000#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.5.3/tests/UnitTest++/src/PaxHeaders.24993/TestReporterStdout.cpp0000644000000000000000000000013212574544466023670 xustar0030 mtime=1441974582.543016532 30 atime=1441974656.438867159 30 ctime=1441974670.133024795 icedtea-web-1.5.3/tests/UnitTest++/src/TestReporterStdout.cpp0000664000076400007640000000217512574544466024756 0ustar00jvanekjvanek00000000000000#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.5.3/tests/UnitTest++/src/PaxHeaders.24993/TestReporter.h0000644000000000000000000000013212574544466022132 xustar0030 mtime=1441974582.543016532 30 atime=1441974656.438867159 30 ctime=1441974670.133024795 icedtea-web-1.5.3/tests/UnitTest++/src/TestReporter.h0000664000076400007640000000101712574544466023212 0ustar00jvanekjvanek00000000000000#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.5.3/tests/UnitTest++/src/PaxHeaders.24993/TestReporter.cpp0000644000000000000000000000013212574544466022465 xustar0030 mtime=1441974582.543016532 30 atime=1441974656.437867147 30 ctime=1441974670.133024795 icedtea-web-1.5.3/tests/UnitTest++/src/TestReporter.cpp0000664000076400007640000000012712574544466023546 0ustar00jvanekjvanek00000000000000#include "TestReporter.h" namespace UnitTest { TestReporter::~TestReporter() { } } icedtea-web-1.5.3/tests/UnitTest++/src/PaxHeaders.24993/TestMacros.h0000644000000000000000000000013212574544466021554 xustar0030 mtime=1441974582.543016532 30 atime=1441974656.437867147 30 ctime=1441974670.133024795 icedtea-web-1.5.3/tests/UnitTest++/src/TestMacros.h0000664000076400007640000001207712574544466022644 0ustar00jvanekjvanek00000000000000#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.5.3/tests/UnitTest++/src/PaxHeaders.24993/TestList.h0000644000000000000000000000013112574544466021242 xustar0029 mtime=1441974582.54201652 30 atime=1441974656.437867147 30 ctime=1441974670.133024795 icedtea-web-1.5.3/tests/UnitTest++/src/TestList.h0000664000076400007640000000050412574544466022323 0ustar00jvanekjvanek00000000000000#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.5.3/tests/UnitTest++/src/PaxHeaders.24993/TestList.cpp0000644000000000000000000000013112574544466021575 xustar0029 mtime=1441974582.54201652 30 atime=1441974656.437867147 30 ctime=1441974670.133024795 icedtea-web-1.5.3/tests/UnitTest++/src/TestList.cpp0000664000076400007640000000075312574544466022664 0ustar00jvanekjvanek00000000000000#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.5.3/tests/UnitTest++/src/PaxHeaders.24993/TestDetails.h0000644000000000000000000000013112574544466021714 xustar0029 mtime=1441974582.54201652 30 atime=1441974656.437867147 30 ctime=1441974670.133024795 icedtea-web-1.5.3/tests/UnitTest++/src/TestDetails.h0000664000076400007640000000107612574544466023002 0ustar00jvanekjvanek00000000000000#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.5.3/tests/UnitTest++/src/PaxHeaders.24993/TestDetails.cpp0000644000000000000000000000013112574544466022247 xustar0029 mtime=1441974582.54201652 30 atime=1441974656.436867136 30 ctime=1441974670.133024795 icedtea-web-1.5.3/tests/UnitTest++/src/TestDetails.cpp0000664000076400007640000000074412574544466023336 0ustar00jvanekjvanek00000000000000#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.5.3/tests/UnitTest++/src/PaxHeaders.24993/Test.h0000644000000000000000000000013212574544466020407 xustar0030 mtime=1441974582.541016508 30 atime=1441974656.436867136 30 ctime=1441974670.133024795 icedtea-web-1.5.3/tests/UnitTest++/src/Test.h0000664000076400007640000000106212574544466021467 0ustar00jvanekjvanek00000000000000#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.5.3/tests/UnitTest++/src/PaxHeaders.24993/Test.cpp0000644000000000000000000000013212574544466020742 xustar0030 mtime=1441974582.541016508 30 atime=1441974656.436867136 30 ctime=1441974670.133024795 icedtea-web-1.5.3/tests/UnitTest++/src/Test.cpp0000664000076400007640000000122212574544466022020 0ustar00jvanekjvanek00000000000000#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.5.3/tests/UnitTest++/src/PaxHeaders.24993/ReportAssert.h0000644000000000000000000000013212574544466022125 xustar0030 mtime=1441974582.541016508 30 atime=1441974656.436867136 30 ctime=1441974670.133024795 icedtea-web-1.5.3/tests/UnitTest++/src/ReportAssert.h0000664000076400007640000000025412574544466023207 0ustar00jvanekjvanek00000000000000#ifndef UNITTEST_ASSERT_H #define UNITTEST_ASSERT_H namespace UnitTest { void ReportAssert(char const* description, char const* filename, int lineNumber); } #endif icedtea-web-1.5.3/tests/UnitTest++/src/PaxHeaders.24993/ReportAssert.cpp0000644000000000000000000000013212574544466022460 xustar0030 mtime=1441974582.541016508 30 atime=1441974656.436867136 30 ctime=1441974670.133024795 icedtea-web-1.5.3/tests/UnitTest++/src/ReportAssert.cpp0000664000076400007640000000031212574544466023535 0ustar00jvanekjvanek00000000000000#include "AssertException.h" namespace UnitTest { void ReportAssert(char const* description, char const* filename, int lineNumber) { throw AssertException(description, filename, lineNumber); } } icedtea-web-1.5.3/tests/UnitTest++/src/PaxHeaders.24993/Posix0000644000000000000000000000013112574544466020343 xustar0030 mtime=1441974582.540016497 29 atime=1441974670.15002499 30 ctime=1441974670.133024795 icedtea-web-1.5.3/tests/UnitTest++/src/Posix/0000775000076400007640000000000012574544466021502 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/UnitTest++/src/Posix/PaxHeaders.24993/TimeHelpers.h0000644000000000000000000000013212574544466023013 xustar0030 mtime=1441974582.540016497 30 atime=1441974656.436867136 30 ctime=1441974670.133024795 icedtea-web-1.5.3/tests/UnitTest++/src/Posix/TimeHelpers.h0000664000076400007640000000046212574544466024076 0ustar00jvanekjvanek00000000000000#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.5.3/tests/UnitTest++/src/Posix/PaxHeaders.24993/TimeHelpers.cpp0000644000000000000000000000013212574544466023346 xustar0030 mtime=1441974582.540016497 30 atime=1441974656.435867124 30 ctime=1441974670.133024795 icedtea-web-1.5.3/tests/UnitTest++/src/Posix/TimeHelpers.cpp0000664000076400007640000000102712574544466024427 0ustar00jvanekjvanek00000000000000#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.5.3/tests/UnitTest++/src/Posix/PaxHeaders.24993/SignalTranslator.h0000644000000000000000000000013212574544466024061 xustar0030 mtime=1441974582.540016497 30 atime=1441974656.435867124 30 ctime=1441974670.133024795 icedtea-web-1.5.3/tests/UnitTest++/src/Posix/SignalTranslator.h0000664000076400007640000000163412574544466025146 0ustar00jvanekjvanek00000000000000#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.5.3/tests/UnitTest++/src/Posix/PaxHeaders.24993/SignalTranslator.cpp0000644000000000000000000000013212574544466024414 xustar0030 mtime=1441974582.540016497 30 atime=1441974656.435867124 30 ctime=1441974670.133024795 icedtea-web-1.5.3/tests/UnitTest++/src/Posix/SignalTranslator.cpp0000664000076400007640000000210212574544466025470 0ustar00jvanekjvanek00000000000000#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.5.3/tests/UnitTest++/src/PaxHeaders.24993/MemoryOutStream.h0000644000000000000000000000013212574544466022604 xustar0030 mtime=1441974582.539016486 30 atime=1441974656.435867124 30 ctime=1441974670.133024795 icedtea-web-1.5.3/tests/UnitTest++/src/MemoryOutStream.h0000664000076400007640000000230212574544466023662 0ustar00jvanekjvanek00000000000000#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.5.3/tests/UnitTest++/src/PaxHeaders.24993/MemoryOutStream.cpp0000644000000000000000000000013212574544466023137 xustar0030 mtime=1441974582.539016486 30 atime=1441974656.435867124 30 ctime=1441974670.133024795 icedtea-web-1.5.3/tests/UnitTest++/src/MemoryOutStream.cpp0000664000076400007640000000510112574544466024215 0ustar00jvanekjvanek00000000000000#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.5.3/tests/UnitTest++/src/PaxHeaders.24993/ExecuteTest.h0000644000000000000000000000013212574544466021732 xustar0030 mtime=1441974582.539016486 30 atime=1441974656.434867113 30 ctime=1441974670.133024795 icedtea-web-1.5.3/tests/UnitTest++/src/ExecuteTest.h0000664000076400007640000000166012574544466023016 0ustar00jvanekjvanek00000000000000#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.5.3/tests/UnitTest++/src/PaxHeaders.24993/DeferredTestResult.h0000644000000000000000000000013212574544466023247 xustar0030 mtime=1441974582.539016486 30 atime=1441974656.434867113 30 ctime=1441974670.133024795 icedtea-web-1.5.3/tests/UnitTest++/src/DeferredTestResult.h0000664000076400007640000000104312574544466024326 0ustar00jvanekjvanek00000000000000#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.5.3/tests/UnitTest++/src/PaxHeaders.24993/DeferredTestResult.cpp0000644000000000000000000000013212574544466023602 xustar0030 mtime=1441974582.538016474 30 atime=1441974656.434867113 30 ctime=1441974670.133024795 icedtea-web-1.5.3/tests/UnitTest++/src/DeferredTestResult.cpp0000664000076400007640000000060512574544466024664 0ustar00jvanekjvanek00000000000000#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.5.3/tests/UnitTest++/src/PaxHeaders.24993/DeferredTestReporter.h0000644000000000000000000000013212574544466023573 xustar0030 mtime=1441974582.538016474 30 atime=1441974656.434867113 30 ctime=1441974670.133024795 icedtea-web-1.5.3/tests/UnitTest++/src/DeferredTestReporter.h0000664000076400007640000000120312574544466024650 0ustar00jvanekjvanek00000000000000#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.5.3/tests/UnitTest++/src/PaxHeaders.24993/DeferredTestReporter.cpp0000644000000000000000000000013212574544466024126 xustar0030 mtime=1441974582.538016474 30 atime=1441974656.434867113 30 ctime=1441974670.133024795 icedtea-web-1.5.3/tests/UnitTest++/src/DeferredTestReporter.cpp0000664000076400007640000000147512574544466025216 0ustar00jvanekjvanek00000000000000#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.5.3/tests/UnitTest++/src/PaxHeaders.24993/CurrentTest.h0000644000000000000000000000013212574544466021752 xustar0030 mtime=1441974582.538016474 30 atime=1441974656.433867101 30 ctime=1441974670.133024795 icedtea-web-1.5.3/tests/UnitTest++/src/CurrentTest.h0000664000076400007640000000035112574544466023032 0ustar00jvanekjvanek00000000000000#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.5.3/tests/UnitTest++/src/PaxHeaders.24993/CurrentTest.cpp0000644000000000000000000000013212574544466022305 xustar0030 mtime=1441974582.537016463 30 atime=1441974656.433867101 30 ctime=1441974670.133024795 icedtea-web-1.5.3/tests/UnitTest++/src/CurrentTest.cpp0000664000076400007640000000044112574544466023365 0ustar00jvanekjvanek00000000000000#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.5.3/tests/UnitTest++/src/PaxHeaders.24993/Config.h0000644000000000000000000000013212574544466020675 xustar0030 mtime=1441974582.537016463 30 atime=1441974656.433867101 30 ctime=1441974670.133024795 icedtea-web-1.5.3/tests/UnitTest++/src/Config.h0000664000076400007640000000172212574544466021760 0ustar00jvanekjvanek00000000000000#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.5.3/tests/UnitTest++/src/PaxHeaders.24993/Checks.h0000644000000000000000000000013212574544466020670 xustar0030 mtime=1441974582.537016463 30 atime=1441974656.433867101 30 ctime=1441974670.133024795 icedtea-web-1.5.3/tests/UnitTest++/src/Checks.h0000664000076400007640000001150712574544466021755 0ustar00jvanekjvanek00000000000000#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.5.3/tests/UnitTest++/src/PaxHeaders.24993/Checks.cpp0000644000000000000000000000013212574544466021223 xustar0030 mtime=1441974582.537016463 30 atime=1441974656.433867101 30 ctime=1441974670.133024795 icedtea-web-1.5.3/tests/UnitTest++/src/Checks.cpp0000664000076400007640000000225012574544466022303 0ustar00jvanekjvanek00000000000000#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.5.3/tests/UnitTest++/src/PaxHeaders.24993/CheckMacros.h0000644000000000000000000000013112574544466021651 xustar0030 mtime=1441974582.536016451 29 atime=1441974656.43286709 30 ctime=1441974670.133024795 icedtea-web-1.5.3/tests/UnitTest++/src/CheckMacros.h0000664000076400007640000001054112574544466022734 0ustar00jvanekjvanek00000000000000#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.5.3/tests/UnitTest++/src/PaxHeaders.24993/AssertException.h0000644000000000000000000000013112574544466022607 xustar0030 mtime=1441974582.536016451 29 atime=1441974656.43286709 30 ctime=1441974670.133024795 icedtea-web-1.5.3/tests/UnitTest++/src/AssertException.h0000664000076400007640000000077312574544466023700 0ustar00jvanekjvanek00000000000000#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.5.3/tests/UnitTest++/src/PaxHeaders.24993/AssertException.cpp0000644000000000000000000000013112574544466023142 xustar0030 mtime=1441974582.536016451 29 atime=1441974656.43286709 30 ctime=1441974670.133024795 icedtea-web-1.5.3/tests/UnitTest++/src/AssertException.cpp0000664000076400007640000000110012574544466024214 0ustar00jvanekjvanek00000000000000#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.5.3/tests/UnitTest++/PaxHeaders.24993/README0000644000000000000000000000013112574544466017407 xustar0030 mtime=1441974582.535016439 29 atime=1441974656.43286709 30 ctime=1441974670.133024795 icedtea-web-1.5.3/tests/UnitTest++/README0000664000076400007640000000407612574544466020500 0ustar00jvanekjvanek00000000000000UnitTest++ 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.5.3/tests/UnitTest++/PaxHeaders.24993/Makefile0000644000000000000000000000013112574544466020167 xustar0030 mtime=1441974582.535016439 29 atime=1441974656.43286709 30 ctime=1441974670.133024795 icedtea-web-1.5.3/tests/UnitTest++/Makefile0000664000076400007640000000433612574544466021257 0ustar00jvanekjvanek00000000000000CXX = 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.5.3/tests/UnitTest++/PaxHeaders.24993/COPYING0000644000000000000000000000013212574544466017563 xustar0030 mtime=1441974582.535016439 30 atime=1441974656.431867078 30 ctime=1441974670.133024795 icedtea-web-1.5.3/tests/UnitTest++/COPYING0000664000076400007640000000206512574544466020647 0ustar00jvanekjvanek00000000000000Copyright (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.5.3/tests/PaxHeaders.24993/reproducers0000644000000000000000000000013112574544466017102 xustar0030 mtime=1441974582.594017119 29 atime=1441974670.15002499 30 ctime=1441974670.132024783 icedtea-web-1.5.3/tests/reproducers/0000775000076400007640000000000012574544466020241 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/PaxHeaders.24993/README0000644000000000000000000000013212574544466020040 xustar0030 mtime=1441974582.594017119 30 atime=1441974656.469867516 30 ctime=1441974670.132024783 icedtea-web-1.5.3/tests/reproducers/README0000664000076400007640000000442612574544466021127 0ustar00jvanekjvanek00000000000000Each 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.5.3/tests/reproducers/PaxHeaders.24993/simple0000644000000000000000000000013112574544466020373 xustar0030 mtime=1441974582.587017038 29 atime=1441974670.15002499 30 ctime=1441974670.132024783 icedtea-web-1.5.3/tests/reproducers/simple/0000775000076400007640000000000012574544466021532 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/PaxHeaders.24993/simpletest20000644000000000000000000000013112574544466022646 xustar0030 mtime=1441974582.569016831 29 atime=1441974670.15002499 30 ctime=1441974670.132024783 icedtea-web-1.5.3/tests/reproducers/simple/simpletest2/0000775000076400007640000000000012574544466024005 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/simpletest2/PaxHeaders.24993/testcases0000644000000000000000000000013112574544466024644 xustar0030 mtime=1441974582.569016831 29 atime=1441974670.15002499 30 ctime=1441974670.132024783 icedtea-web-1.5.3/tests/reproducers/simple/simpletest2/testcases/0000775000076400007640000000000012574544466026003 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/simpletest2/testcases/PaxHeaders.24993/SimpleTest2Test.ja0000644000000000000000000000013212574544466030251 xustar0030 mtime=1441974582.569016831 30 atime=1441974656.609869127 30 ctime=1441974670.132024783 icedtea-web-1.5.3/tests/reproducers/simple/simpletest2/testcases/SimpleTest2Test.java0000664000076400007640000000456012574544466031666 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/simpletest2/PaxHeaders.24993/srcs0000644000000000000000000000013112574544466023620 xustar0030 mtime=1441974582.569016831 29 atime=1441974670.15002499 30 ctime=1441974670.132024783 icedtea-web-1.5.3/tests/reproducers/simple/simpletest2/srcs/0000775000076400007640000000000012574544466024757 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/simpletest2/srcs/PaxHeaders.24993/SimpleTest2.java0000644000000000000000000000013212574544466026714 xustar0030 mtime=1441974582.569016831 30 atime=1441974656.609869127 30 ctime=1441974670.132024783 icedtea-web-1.5.3/tests/reproducers/simple/simpletest2/srcs/SimpleTest2.java0000664000076400007640000000430012574544466027772 0ustar00jvanekjvanek00000000000000 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.5.3/tests/reproducers/simple/simpletest2/PaxHeaders.24993/resources0000644000000000000000000000013112574544466024660 xustar0030 mtime=1441974582.568016819 29 atime=1441974670.15002499 30 ctime=1441974670.132024783 icedtea-web-1.5.3/tests/reproducers/simple/simpletest2/resources/0000775000076400007640000000000012574544466026017 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/simpletest2/resources/PaxHeaders.24993/simpletest2.jnlp0000644000000000000000000000013212574544466030076 xustar0030 mtime=1441974582.568016819 30 atime=1441974656.609869127 30 ctime=1441974670.132024783 icedtea-web-1.5.3/tests/reproducers/simple/simpletest2/resources/simpletest2.jnlp0000664000076400007640000000413412574544466031161 0ustar00jvanekjvanek00000000000000 simpletest2 IcedTea simpletest2 icedtea-web-1.5.3/tests/reproducers/simple/PaxHeaders.24993/simpletest10000644000000000000000000000013112574544466022645 xustar0030 mtime=1441974582.567016808 29 atime=1441974670.15002499 30 ctime=1441974670.132024783 icedtea-web-1.5.3/tests/reproducers/simple/simpletest1/0000775000076400007640000000000012574544466024004 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/simpletest1/PaxHeaders.24993/testcases0000644000000000000000000000013112574544466024643 xustar0030 mtime=1441974582.568016819 29 atime=1441974670.15002499 30 ctime=1441974670.132024783 icedtea-web-1.5.3/tests/reproducers/simple/simpletest1/testcases/0000775000076400007640000000000012574544466026002 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/simpletest1/testcases/PaxHeaders.24993/XDGspecificationTe0000644000000000000000000000013212574544466030320 xustar0030 mtime=1441974582.568016819 30 atime=1441974656.609869127 30 ctime=1441974670.132024783 icedtea-web-1.5.3/tests/reproducers/simple/simpletest1/testcases/XDGspecificationTests.java0000664000076400007640000015117212574544466033062 0ustar00jvanekjvanek00000000000000/* 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 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 { public static final String XDG_CONFIG_HOME = "XDG_CONFIG_HOME"; public static final String XDG_CACHE_HOME = "XDG_CACHE_HOME"; 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(XDG_CONFIG_HOME); String XDG_CACHE_HOME_value = System.getenv(XDG_CACHE_HOME); 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"); } @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, config, l); mv(realConfig, cache, 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(XDG_CACHE_HOME) || entry.getKey().equals(XDG_CONFIG_HOME)) { 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; if (entry.getKey().equals(XDG_CACHE_HOME)) { ServerAccess.logOutputReprint(entry.getKey() + " was " + v); v = cacheF.getAbsolutePath(); ServerAccess.logOutputReprint("set " + v); cache = true; } else if (entry.getKey().equals(XDG_CONFIG_HOME)) { ServerAccess.logOutputReprint(entry.getKey() + " was " + v); v = configF.getAbsolutePath(); ServerAccess.logOutputReprint("set " + v); config = true; } s = entry.getKey() + "=" + v; l.add(s); } if (!cache) { ServerAccess.logOutputReprint("was no cache"); String v = cacheF.getAbsolutePath(); ServerAccess.logOutputReprint("set " + v); String s = XDG_CACHE_HOME + "=" + v; l.add(s); } if (!config) { ServerAccess.logOutputReprint("was no config"); String v = configF.getAbsolutePath(); ServerAccess.logOutputReprint("set " + v); String s = XDG_CONFIG_HOME + "=" + v; l.add(s); } return l.toArray(new String[l.size()]); } private static void createFakeOldHomeCache() throws Exception { File tmp = tmpDir(); 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, "icedtea-web"); 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(), "set", "oldBaf", "oldBaf" })); 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, "icedtea-web"); 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 (int i = 0; i < files.length; i++) { File file = files[i]; if (file.isDirectory()) { result.addAll(getContentOfDirectory(file)); } else { result.add(file); } } return result; } private static String listToString(List... l) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < l.length; i++) { List list = l[i]; 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 + "icedtea-web"; String cacheHome = System.getProperty("user.home") + File.separator + ".cache" + File.separator + "icedtea-web"; 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 + "icedtea-web"; String cacheHome = System.getProperty("user.home") + File.separator + ".cache" + File.separator + "icedtea-web"; 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 + "icedtea-web"; String cacheHome = System.getProperty("user.home") + File.separator + ".cache" + File.separator + "icedtea-web"; 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 + "icedtea-web"; String cacheHome = System.getProperty("user.home") + File.separator + ".cache" + File.separator + "icedtea-web"; 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("Legacy configuration and cache found. Those will be now transported to new location"); private static final RulesFolowingClosingListener.NotContainsRule notMoving = new RulesFolowingClosingListener.NotContainsRule("Legacy configuration and cache found. Those will be now transported to new location"); 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); 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)); assertMainFilesInHome(true, false, false); assertOldNotMainFilesInHome(true, true, true); } @Test public void runJavawsInCleanSystemWithXdg() throws Exception { File f = tmpDir(); try { assertNotMainFiles(listToString(getContentOfDirectory(f)), true, true, true); assertOldNotMainFilesInHome(true, true, true); 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(notMoving.toPassingString(), notMoving.evaluate(pr.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(); 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(notMoving.toPassingString(), notMoving.evaluate(pr.stdout)); assertMainFiles(listToString(getContentOfDirectory(f)), true, false, false); assertOldNotMainFilesInHome(true, true, true); } finally { deleteRecursively(f); } } 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 { assertNotMainFilesInHome(true, true, true); assertOldNotMainFilesInHome(true, true, true); createFakeOldHomeCache(); 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); 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); } @Test public void runJavawsWithXdg_oldIcedTeaConfigExisted() throws Exception { File f = tmpDir(); try { assertNotMainFiles(listToString(getContentOfDirectory(f)), true, true, true); assertOldNotMainFilesInHome(true, true, true); createFakeOldHomeCache(); 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); 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); } } @Test public void runJavawsWithXdgAndNoParent_oldIcedTeaConfigExisted() throws Exception { File f = tmpDir(); try { assertNotMainFiles(listToString(getContentOfDirectory(f)), true, true, true); assertOldNotMainFilesInHome(true, true, true); createFakeOldHomeCache(); f.delete(); 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); 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); } } /* *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(), "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; } } @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(), "set", "blah", "blah" })); 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(), "set", "blah", "blah" })); 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(), "set", "baf", "baf" })); 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(), "set", "blah", "blah" })); 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(), "set", "baf", "baf" })); 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, "deployment.properties"); ServerAccess.saveFile("deployment.security.level = ALLOW_UNSIGNED", f); } /* *PLUGIN - NO OLD CONFIG */ @Test @TestInBrowsers(testIn = Browsers.one) public void runAppletInCleanSystemWithNoXdg() throws Exception { assertNotMainFilesInHome(true, true, true); assertOldNotMainFilesInHome(true, true, true); fakeExtendedSecurity(new File(System.getProperty("user.home") + File.separator + ".config" + File.separator + "icedtea-web")); 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 + "icedtea-web")); 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); } } } icedtea-web-1.5.3/tests/reproducers/simple/simpletest1/testcases/PaxHeaders.24993/SimpleTest1Test.ja0000644000000000000000000000013212574544466030247 xustar0030 mtime=1441974582.567016808 30 atime=1441974656.608869116 30 ctime=1441974670.132024783 icedtea-web-1.5.3/tests/reproducers/simple/simpletest1/testcases/SimpleTest1Test.java0000664000076400007640000001161212574544466031660 0ustar00jvanekjvanek00000000000000/* 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 ServerAccess server = new ServerAccess(); private static final List strict = Arrays.asList(new String[]{"-strict", ServerAccess.VERBOSE_OPTION}); private void checkLaunched(ProcessResult pr) { checkLaunched(pr, false); } private void checkLaunched(ProcessResult pr, boolean negate) { String s = "Good simple javaws exapmle"; if (negate) { Assert.assertFalse("testSimpletest1lunchOk stdout should NOT contains " + s + " bud did", pr.stdout.contains(s)); } else { Assert.assertTrue("testSimpletest1lunchOk stdout should contains " + s + " bud didn't", pr.stdout.contains(s)); } String ss = "xception"; if (negate) { Assert.assertTrue("testSimpletest1lunchOk stderr should contains " + ss + " but didn't", pr.stderr.contains(ss)); } else { //disabled, unnecessary exceptions may occure //Assert.assertFalse("testSimpletest1lunchOk stderr should not contains " + ss + " but did", pr.stderr.contains(ss)); } Assert.assertFalse(pr.wasTerminated); Assert.assertEquals((Integer) 0, pr.returnValue); } @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.5.3/tests/reproducers/simple/simpletest1/PaxHeaders.24993/srcs0000644000000000000000000000013112574544466023617 xustar0030 mtime=1441974582.567016808 29 atime=1441974670.15002499 30 ctime=1441974670.132024783 icedtea-web-1.5.3/tests/reproducers/simple/simpletest1/srcs/0000775000076400007640000000000012574544466024756 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/simpletest1/srcs/PaxHeaders.24993/SimpleTest1.java0000644000000000000000000000013212574544466026712 xustar0030 mtime=1441974582.567016808 30 atime=1441974656.608869116 30 ctime=1441974670.132024783 icedtea-web-1.5.3/tests/reproducers/simple/simpletest1/srcs/SimpleTest1.java0000664000076400007640000000357212574544466030002 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/simpletest1/PaxHeaders.24993/resources0000644000000000000000000000013112574544466024657 xustar0030 mtime=1441974582.567016808 29 atime=1441974670.15002499 30 ctime=1441974670.132024783 icedtea-web-1.5.3/tests/reproducers/simple/simpletest1/resources/0000775000076400007640000000000012574544466026016 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/simpletest1/resources/PaxHeaders.24993/simpletestSlowSlow0000644000000000000000000000013212574544466030563 xustar0030 mtime=1441974582.567016808 30 atime=1441974656.608869116 30 ctime=1441974670.132024783 icedtea-web-1.5.3/tests/reproducers/simple/simpletest1/resources/simpletestSlowSlowCustomSplash.jnlp0000664000076400007640000000425312574544466035160 0ustar00jvanekjvanek00000000000000 simpletest1 IcedTea simpletest1 icedtea-web-1.5.3/tests/reproducers/simple/simpletest1/resources/PaxHeaders.24993/simpletestSlowBrok0000644000000000000000000000031212574544466030534 xustar00112 path=icedtea-web-1.5.3/tests/reproducers/simple/simpletest1/resources/simpletestSlowBrokenCustomSplash.jnlp 30 mtime=1441974582.566016796 30 atime=1441974656.608869116 30 ctime=1441974670.132024783 icedtea-web-1.5.3/tests/reproducers/simple/simpletest1/resources/simpletestSlowBrokenCustomSplash.jn0000664000076400007640000000425212574544466035117 0ustar00jvanekjvanek00000000000000 simpletest1 IcedTea simpletest1 icedtea-web-1.5.3/tests/reproducers/simple/simpletest1/resources/PaxHeaders.24993/simpletestSlow.jnl0000644000000000000000000000013212574544466030500 xustar0030 mtime=1441974582.566016796 30 atime=1441974656.608869116 30 ctime=1441974670.132024783 icedtea-web-1.5.3/tests/reproducers/simple/simpletest1/resources/simpletestSlow.jnlp0000664000076400007640000000414512574544466031745 0ustar00jvanekjvanek00000000000000 simpletest1 IcedTea simpletest1 icedtea-web-1.5.3/tests/reproducers/simple/simpletest1/resources/PaxHeaders.24993/simpletestMegaSlow0000644000000000000000000000013212574544466030510 xustar0030 mtime=1441974582.566016796 30 atime=1441974656.607869104 30 ctime=1441974670.132024783 icedtea-web-1.5.3/tests/reproducers/simple/simpletest1/resources/simpletestMegaSlow.jnlp0000664000076400007640000000415712574544466032542 0ustar00jvanekjvanek00000000000000 simpletest1 IcedTea simpletest1 icedtea-web-1.5.3/tests/reproducers/simple/simpletest1/resources/PaxHeaders.24993/simpletestCustomSp0000644000000000000000000000013212574544466030547 xustar0030 mtime=1441974582.566016796 30 atime=1441974656.607869104 30 ctime=1441974670.132024783 icedtea-web-1.5.3/tests/reproducers/simple/simpletest1/resources/simpletestCustomSplash.jnlp0000664000076400007640000000431412574544466033444 0ustar00jvanekjvanek00000000000000 simpletest1 IcedTea simpletest1 icedtea-web-1.5.3/tests/reproducers/simple/simpletest1/resources/PaxHeaders.24993/simpletest1.jnlp0000644000000000000000000000013212574544466030074 xustar0030 mtime=1441974582.565016785 30 atime=1441974656.607869104 30 ctime=1441974670.132024783 icedtea-web-1.5.3/tests/reproducers/simple/simpletest1/resources/simpletest1.jnlp0000664000076400007640000000413412574544466031157 0ustar00jvanekjvanek00000000000000 simpletest1 IcedTea simpletest1 icedtea-web-1.5.3/tests/reproducers/simple/simpletest1/resources/PaxHeaders.24993/netxPlugin.png0000644000000000000000000000013212574544466027600 xustar0030 mtime=1441974582.565016785 30 atime=1441974656.606869093 30 ctime=1441974670.132024783 icedtea-web-1.5.3/tests/reproducers/simple/simpletest1/resources/netxPlugin.png0000664000076400007640000013531212574544466030666 0ustar00jvanekjvanek00000000000000‰PNG  IHDR@È™8«sRGB®ÎébKGDÿÿÿ ½§“ pHYs  šœtIMEÜ  $cÌ^tEXtCommentCreated with GIMPW IDATxÚ„½}ðvkYv­ÍÃi8Pˆ„"MRÅI4jMfR“Œõ«ŽNý#b"&ƒçÀ b ¢£b#h*’ÔÄØ(«Öi¦*M“:ƦI̘Ô$Z3ˆñ(ø¬þñì½ïµÖu='Ìèûž÷ý½ÏÇÞû¾ïëZ×ú@U±âÀV…*  ûopý‹óÏ®^`ÿ7X¿ßÿ®ŽŸEjÛÿL^kÿuÛÿ|ÿ—×?Û]¯±Þ§Ž×´÷.û÷翱÷¬ÚÖ;~zÿ¹ó[Um(¯×áüh°Ÿ_×cý>¿ÛñÝíýôûÄõµ÷Áùnë»Åw¾^»¸æòž@˜×a¯MîuíßwÛoÚùq¾Žþ΋‰åsÇgÑû¢ÏÈõç¸îåõÆÈkWUmò\”]¯õ °=ŸÓ3j÷l[ï y6üùï³ÿžUë¹,Îçä¸nÇŸ ©Pèß#î©Þ[œ{}×ó»åç¼umPvŸ®¿nþßûšÄy‰äžÕõ9n}f½¾ëìY]ïƒö\öÏÛkÖÞ±ÖÐz6ôÚ {O¬éóóòú{Êz=^÷®o~ëË´¿Ó_1üÅñ{êÃíÿRž…u³ U\VÿÉñqí瑯è›ßñG<KýÝþŠôŸõït]Õç_zƒ÷×õ¢]ÿŽqãÎu¡ßr©dÁÃ/"ä3A„¬óý£Ò¿ú¼¾½¾þù ý+¶ÿ9÷O?ßtÏçH6àõ™×5+LOì~ÓÓXò­â=ï-eáëárüÐæ÷*\?ÿqÛ/ï{.ðýjð[j߇ò,É&„êÏj=³qëc}®ˆþ<¡&uÞ÷¸gy?ã™»¾~¼kl¤zÛg¤îò}åú£íEç›Ëæ*Å|ZTü»ëö²¯e¿Ïw¹ùé&à'ŠnNÈmÁ× öe#'Ÿ~a{aÖþpÚÞÀ£:óªñ¤ÙæfŸ¡üÏlS;ûæ[P>KRÑ2 xùõ‡äZ X·ç2œ|¯8ô>ì«âøKˆâÁbTG×KG±WUÏÚ7JœÕb}ãBÙx8–WºÕ6yÄY€ycŒ…Wö¸÷Œr¯|¡ S•dÕY-TT禹ù÷¯•ðê£ÖfT“,Ê!¨‡lcñO»(üÕMøxŽ Õ(î{yé=‚ÝGÔt&!Ö®›IœJíÀ–)ª<&8W¸­5Û¤2ª¸¢‹l›füÙÚÑüù¹³Íï¨b¶8Q¬4­hså„Ü*ê-´u@®¶Í$ݰØO^ù‹ûfa$G<ãÚy¥£>åäiÞ¶V¹yÕ‡µÁï› òáf­MP/Ã&ŸY«—¡X‚?©öÄ×½f—g®bcõûb/VEDi¡žu]ïNà‡}­Ãö8\{Áæ‹(¤>'ˆ®U=ÛÖªd]/%-f±âàY?tV3íœÚ¬ à±r¥pÀÙpA^íàÏw顤U©nÄÕº´èùVQÞ64_vÜa*ýŽÊQz¿JÄ~KI¿ãÝÔÚÂ*-¯ÏcD/WÅ‚¡'okâxŸ!Š›TBè'ûù`?/¯·í.O,@Û_k!£7êZªž_ªoëëßÙÓÚN¯µYÒ·­c=p¢¡¼~߬ûâ@n(Ú¦ÚÎÛh½z‹Å£p†a5vë`D´Nù÷úl²A¬B òœ¬6¼¼ÙwŠm¿6Ü+9 ®Wtì“…V¡T¶Ø -yÜ£´ªpÛ(×NVt›^³£RSL:7bh¹~êÜ<ðj]ñhÝ´æèUÙñ«–ºh %b\\;”².ã3„ —>ZÍóððA×:x·xq.ø-W¾=­Þ*+Z¡› u#:ø‚ ê1ªBŠh´Ì€ã;n[MG²a‹¹>Ðp^}´:´DúÚjÏê¾_ÿu‡°†¡C?ˆj'Ê‹l׉zN'íÐjøbûúH€<ÛCÝœ¶ߪÕ6ïµU>=Z¼¶©jM x^Žý `K>«e°Á²˜p£eƒÎh¸æºW½ò‰; ŸžëÃ~ £†÷»Q)(füȸ¼ªOKפ×Áþu W5f5=†…–ÐOƒÏ ¸Œ6å÷Ûñ,àTà\´©t2,´ÏC%&:WRÙÁ+94x®—£5mÓ)–›jf‡0û`˜†ÀîiG¶¦lµˆ&q¯ÙÑÔãgî@£?£cµÓ¿Ú$MèÄ0õ©­•Ä SFï!Ö†ZÛ¾ô)ebbú mÁyÁdb}~VÆx_ê/è¢åÍk‰ã¼dâ:rrÇFºÅFÞ][,:¹Q-&}žhÔxûÿô€‹J5Ì@#jÓÆ¸êÓ÷>[ iB Ç®T®*9^sm4ZLþÕ§Ò½RêíôÚkœÞÇÙpV*X•¡.;\é᥂JÃ"©,ÖïÝDi…ªp#ä Ydª2[Û…“¯mè°mÓ5½à\û³½`S ó¸Pw­LŒñ2÷Hly¢ú„¦XR† cˆjÅ7Åi±%î½¢W/\…¼ãÓ”*Nt`ÂsfLÑOs ˆPo }"éí˜QgaÒêjË©¢Åô÷Òk‹Ž½ªfòÎjx=öÃÏy—Œ¢Ú& +ÙTÚ.p`^r…ïσKjøÉÈ:yx:…«ªO åßù³ÉÊøCF§ŠaKôÐ+ÚsîÁq@Ÿ‡·à³”jö\kp“×JlѦ¥Iêkµr#jƒ’N~«qÂï-iƒ°¸Èªg§…-ªò~#ÛAI‚ww­È¢“~Rs-`Ùˆ²d-øQ½”WlŒ½†âgYܯ>hmÒií§ßPza4´¥ÁÂ|“Ç*¹Q?rÂΆ3ž?§”ž‰b|Içùѯ½bð11Ce 0ªóÂ¥@;:è8ÕØ•UɶÀnÐ7híuØ Æ¥¬N\Ÿü¬¢NÅi°oL°°¢w˜VÑÙ¯Òúf—P“nÁ4âµô{ )x›>Hƒ98,·9ÂÕ¦ÙA ·Ç„'áúÖ¢”2=̦±Fc¬»ºÒ`âM•a_““Ê@¤¦æcM×Xô•Lñ¯“ŽÒ*Q!}¶ìh¨ €á~ \[î³—òÁê¶ÓìÄî”^";däÞî²¹§âÆÕ©ô`SÜ@?W@mZ9ðë²ïÔ?©Tb¡ ±Ò ßKµONŠ•¶Sy9ðQ«µ¬ gï8(0fæú'k?¥Ï;¡„èÍi[V4 ðÅ»i»>TP(_;­·€óG|Û 1çoÀe‘œA™â2T^ìJªf”7áî 6iì„…²cð÷¹[e2ð[ª¾ôÃ÷†q{‹ˆ“¥fzk»¨«òâÀŸëšcºÊ”´Õ0 „oX…®˜PºÏu£‘©ƒŽñ[ÉFWØÓæê‘b7íö!De­8ÙÞª8…?WÁëíx´óΆwŒÝR˜(FVM?*N-C¡¬ «ZKg23¡q4uŠðáÖsqWcè°þ©lhDÃÅŠ„Ž3„  W@­P© ’ ‰ÎŸÔ‰q5dRÐðÐÔ݇¥Ž%#Ùèó] [5 Ñ‘u.­^·6°;Zàë¹5Ý©jW'euš‹@ MŠÖoŒŸ6h¦ýaqÀœ‰¦œüAýª•Àüô]ɤWFx†ÑUO gî¨×c‹†Õ™û“J{l¸ÕÌô÷®޳iÅUÚ3²¾kÀëS!*PÌA~¦áY™6‘6ѧ¶ØIÖn“¦¡õ ˆdsÜiýÙ0U>hÕ¾ñ œÁJZÒ "|Uçé•‹:Q]–&«æ¬sž†›ôÕþ9'¬zÒÔ"÷VŒì†vûÇIò‰^1]sDÕþßÅÌØ©ØÊ¤<_ŸÃdW&L¨d“øƒÓ¯ô d·B(“ðbÀ…`«Â15Ó¾¢á†ÎÒ«›ÊV‚4q¼nBCnôÃôÅÅS 9W~/›–§DJ(Tª úäòØä[]‰Z£»¤iÇ×€d•”ªžØÎZ^iÉÄ“2(؈nÈásE“|SSç6lšÅ¡J°ÑÈ’§—}£>¸·ì‡w#n³W^„ãq¡aöð)•»šlvïlþQMV™\Ê-Ö<êÆš–*qiRrhÖñؤÉÜ5Zÿ|ïäåjÄéÆ .gE³} –»=T¨ŒS¨Í7ŽÚ*!LtÜŠ6ÚgW£´VRQ0ªÅê®9qóý"qÐÈ¢m6 óI·˜äwÕ­a‚,Á°6Ñ0oæ°2WIÊaS!mUjÜXj˜J®¾mNhÖTá†óPlÌNµuêÒ´{Ã(*‰“Ãiq1-×­zKŽ`t(î,Ä‘-±N§lQ;«T»¤ÒM+¦înPIU‡XæXÉ©¶§p˜ÆÔ§,¯ŽëÂÖ0íÊpA·\çÿ\ ŒA:Ù€Úùáýz!Oùv6%œôˆ›dÄcçw­™yTÏ7NÚ ²nØTõMÄnƒšO¿›Zi µšÖ¶‡¨ãŸ:(1裔~=„¬p©ö`.YNù‡`Ü:̧¥ÇÞÖ‘ÖH5Ñ\†¡j²“â<™ÈËÛÞ>jû9T ? .¶[?/SLÃlþ¨ž&Ì–êægÊO“ȉNaÝ'mˆÕ«¬ña*¶ê½OÝýëXXÚõIurªæáÐ8-oŽ0¾ ˜|-'Ðzбc—·õ³qˆ&'œîÑñs(r‹Sšø¼d ’½“]À&°ïs¶¤ûæ/…ÑçÝV¯ÏàîeÖµ¸÷€CªÝv€W­¸é(›÷]¾Ë‡§ ²‚ÂÈòGš˜-U°·J’Á˯ŸR2¥–´Iýš›P•oV`Kf6“ ÝXÒ¿WÊŠ™9¤ÔaÊ#Tç_6å:Ü‚¡råà“[" Là¿m¼«?Âd‹­!%܆Ay ´½ ËUÍëoÚQI—É´fôýê2ãŠ%·[}^e#o ƒØ_JçÊaYîd­O1_\ßol`˜ÈÆÍ—-«x¡scom› y%¢f'V(q¹à­É;¦Ã‹<ßÝWŒÏÓûî(Ñ=»kLyNöO\즫s7¶±JúênæÈÁ`Е%Ý;1án®(¢÷McÏŒRÊÙ|îf/G_/#›ã4äÁÀTKYeJhÌA3ÃÍâJ*#ÜâÜL:Ù[ßuÒ>–™!”Ø u®N=;æ‡T—µ‡¢¦s7²z_¡[†7¦$3Âcª†B¿püýÂi9øé3ÊÑÿ¼ñLG7Ô¬z$>Zð §ftÑ¡Ø?½¨UÿÞDP6âNï¼Éj¹(ö]6‡@0,2¦*³‚ØÎžÕ A§ƒVÀCæ‰-h‡éà-Ùyœ—´zF©ÈsÁ,Ûà„Ý ¥C †~˜èYŽ·éIœÇæ!E<ße0¶Iú­aÒæmËâ»ì¡%¾±k>ÙÞšØY±¿½´mxÔv|šüíi+EÅ e8…ÊÚ=J°Iç%bÇJ 4•Óá¾_†õ˜ícšDÿÕrìp°>øP°WŒŦN¾Õ‰%Ù5BV0öM°±<ñqÓàÍñ¤¬ežáèF²Z¯È+³]Ø¢0ÉDª©_IصTLFéBÝŠÊ”Í^à›bøW`uãٲėM§W¤ G»^¼é–~r¹î £Ì%îY$0YÊ›E8»È«q*  ¦2ôKlqÇ—‰õZÚù@$–„OÌWÆ@“b)ó˜ï§¡GlnÜ UÁm~—ã7ÀêƒôüB$ÚH¼ÍÒª¦ÃÔOó2Pa?PÙ§ñâ­9Áä:ÁŒ 5;( jš†·<õNÑIË`ŸÈc¨XjtéÐÙnÒuºÜqHƆ´Yå5ÑWÐI´rh•å~lUƒêàúLc|ýª‰¾sc PÕ@§ÌÈÂä!®Ötáålƒ:õÖ4?àTn _Çr«7ë¾ö~:ŒäÀªÀÀ3Eõ}ÌÍ‹•‡Ð‘ZŽGèž¦Ž ©go¨zÜhC©Iý!´(43¸=Zàvªsñi*Œ¹ulÕÛª(Õí¡¨Z­ãÃo[žøXœÌcîž!8ߺXQOéKF¼,Š7Ûa´î@pÉjhi°@þîJ0N”¯áEkSBÜ*{O„kf”¡otééG6L-)fL6ž5JæiW¯\ÏS8´Ê¥‡f8¦·õÚ$}p“Û.Õ™¯x§&sÎÄÌT”1nâô¼9&…Jç; }þd†‰É{n,±Ý@€rs²u(îÐÌ)צ -v’J¥ø­ŸrxrÓ‚=Ájï³åCÈNˆ6;u5AH« ËÃP£a¦Ñü €;éÐh(zeŽ0îtÙ{ šŽ7NRºÛœBR×ÞžG ëÃa”¥?]@9²zž6ˆô.ä@ÅqŽŠß«4+VgíÁ»êVµ_S»~»ÉnJ‹É‰Ú ƒ³c"m¬¶Þ&õG¶¹Ã”25ÕþAf¤ Êá˰¤`åoFÖ1äo&{Ãè¢RÁ B„Ç`H²KV_ºµTØÙéTœ”}è0¦ÄNÒ#À "1í“Û_cÀSòA&·š 0¯lÎHÖäÈ<Ô7•F˜9©6‘‹M 1%lW¯åÅ Æ ¼F~²n<{j^›UFÒw†û€1ê4ÍFx®kd‘SmÁ¡–æB+%kwè]ØÀ¼QÉnÛ±çàf¨¥~ÜÜ1Çwl0¯½„Œî¨ - =º…‘Vƒ±VfLo6¼*>í˜ øªÑØ€;Ooç@Mí©êtÏ¿æ,6È ÍN”ãæÔ¶¦!™²•ò)Ïjv­0"tEet¢è„…Nu(šØúõwÒÔ¶$­}Ÿ @fbÙ Ô&Ê«•SüÈ5Ë·SäN& ÁÜÕ™ôLºÕð:(¯B²Ç[ŸSÛ@6\TßÔ³únöúX­jÚd5!@+c˰ZØökéÕjPÅj-¶68+&’¸ý³°Ï “®Mw‹´©^UÓÙ½†‹ZT!û Ž­4Ìæî¨á™.ó„QšqõK…#Q•æW <Âø^'«~1·}Cè4QYaÚàjnÛ!ZËnë_ý02ŒGeÇ0W<ñA»pé͸2w;•¹óÓä´!dˆÕ¥}Ù.dõSƒ6ò Яצ &5Ù­´îªÔ†Ìi9noèj°C—°8 ¿nF`£ÿ0öÇ *·Ê,Uɳ…›ã6Ø¥Π`ô,ƒ|†)QËxn¢]d|Þ|Æ1 Iî…à‘lÁéŽIæÛ1ÁyÔÌHYÑP f‹aðÚù½Z˜T·­‰šö3‚¢Ûƒ Š Ò$§bÈnC¦ê×~ÈkéÏ•Ój²]‡IÇ&@ž-@Ê÷¬‚ÅgÙpNÓÆ½'-Ñ Ëû$‘7ê—Æ¦æ¨°Ú0•]I<›sÓÚaï¥Æ£ „ÃÌ>œ’I#”ר¬‰…chtNV™F¶èQ FÉJ…K…ßeL Í7`‰'Å\MĈ[<Ó9 5 ‡öKÄáÛv?À;c¤Gß5Ì­†W”ºÁDÊ•µNÓ¹e¿íX¤ÆwÿÁ 㘨¾Q6ü6@n †-Œj¬b5(:'Y¬PImƒ¡c­JÄB™Ô ¾ãyúsà…óA„î [DYX%Ê;³)ª¡J3ËÕN·IäXaË‘['ÎbëétSY_ÁL0x˜ŸrÀyÇô¸ÉTx2=ú¼]ƒª†x©‘àürUj]1qlÓúšõW‰©ÝÄTƒNr©2óá5ØHëÕ,øs@ªx¦¸ †ÊÝ¥f˲<¯î®åt¶Êó¦…Š3@@ŒÞ¯!Z+·ð0qfÑp¦­Ú†÷_Õ£Ãn'6½$«Jü° §lg’Yïœ2tž£ í{§“y\0ÐL4wܪN[*éŽO¾­‰yÃ$¶œ„³yD*îÔG¡ó$9³­ZÌõÏ )L kóʱ=hô}ø°i±?@*×ì Ðäžm+›\½ÍË“ô7®M7@ÈSú4ÃPâÁFßœÑ_ƒƒõ8W2Eãå¸ùlã.ñ6ÝMÙ´w!35µÈ×Ê4K9¥pDßãða/¯8%´©cð&ëf³ZJo©pŒR~äF„4ïÐ,™Á¨ç1Dðïâ]ã‰tTW+ǵõ¡BReé0ÝK-ò˜ÙŠiÁŸ1ÛvžÓıSc  ב¼s Ãj9´Vk•Tªj‘¹`jÀ™0Ð;*=˜™qe<ÏT†0é¦ï*ܲ¦hIÄÕÔN“e¿þ7¹ ¸úØÅ œÝf~*›¦åÖ@R¶°h£AJð²Æa§A÷P9©Ï¢AˆÐ[L÷Ü* o IDATÄcÐMŒˆÚn[:ÜÑhîf›u'0c0Jmù§å ¼q”¶Í8JÝTy ÈQ˜dn®R"¬ÏpÃ8Ͳ0LŸtâ—&ÛëÆÃp©Aüm†ÁÙ£áJ}¬ß΀®Ò)ÒÃp¯ÎÀñÄD9©i²½:}®ßnàŒ§?ÞtêâØh(HÏœˆº£©lÀØÕ¢@¦²RÓg€ÊãnD"¸%Ú¢ïÐpÖZÒÝËOŸÌ N\eÙ²Òuæ£ ™a©?šõAŸ ò™¦¨N'2[)È+ÚœàìC—Sœsí€îò´¨!d'‹ÌÞµdÐìÓ¤À3ЫåšôIÚæ»¯…x@ôàfÜfI¨@ÏÉ'nò—èv²Bp ‹˜œ‰å'îXnŽP™‚‡äIån|Øß_ß;Áçm"¨§¹æÿzõÞîYcõçeBã°‘¢aDûÍYç”0Ì/+¬s ¬¥CˆËYjš¦IÉÄÄTøóæ!ô«ƒ˜]ÆÏgaÛÆ =5²óœìÞ¦¦Ø³€Äìè÷ûÖ31*|zŽx:¸x q7aHæGㆦЉ|›‡ª¬ÿÜÕd3…à¼OøC° þŸÖõ.ÏRldÂ,nàÍaKFÕ Íœp¹¡ Ÿ8k”Ö`>ø^u+v=¬ÁÃ6ò ‘eèþÐn5óÏŽáF>LSkëÐýATOé?Z[všQ«ºöÿØ\Ï›ìçˆç¡7Ø©;ÕC;,Û<7Ö_Œ´P2ߤêœLAªK±„^âíWª5 ^nˆ‡ÀP…Rž“$C`¢µ “WDW„4ží¤C+BñÌCYš<Çw8ðS DP3tm)ßvµÃÊÞ¹6&“Û† ìºkãï›á VÍÝpk‘† $tÁg…(›šŒjȆ!œ1ƒÝÜü2¦Ùh%ÏpÔIà’¹Q= y¢,8E-ÌǬuC1P±‘.-èêKÖzÊǜۭå)Wp(éê–¡¹VDŒ–’7ÝûiéÄä3ió¬›à±¢,­š¡ÂDÐßì%Ñ'Û&š´˜UH–Í<Õ6StÃÖæÞ09Y ”vͧ$žtGTè'3ÁÕÌœiRŸùÇ5 kЛø &¾ ÊB àqƒi 8KÐÏíõ¼¤[¬v30M(G#jQ‰¹°ÃÕ+‹‘D·ÚüÁiwµ8ÊDx÷°ø¦´-w’‘ÊÈž×€•f©”ÞŒ,#‡èÔÔ@«D+× T'$ÿ8àT~ r˜j¦Ò§º«ëãêVÕS͸¡F7¢‰¢3¨}0)äý°tÜ¿»ÆtzQª-²)GŒÌq%Aê­’kÉ Îf3À)­aC47æ±*ÂOÅ@Ërô6ʾDË•w¡[f›œÔÎý0¡PË0òò°yLŽíÔ„Wùô¥º ÛC3mÆ¡Î'íiÝžëF”@a$þü}ãl!M@jÏN‹ûÄXI42xL{i$õê®&sZ*{ªŠ$ónÔ²ã`ÿþ,·j™²bEmæWh‡A8ŠÏ™Þ¦÷¡Ó w³?óÿŽjßdˆIOòøµNÿô= Š2P£ˆ(-êŒb• 2O­c–ÁP_ϰNT’¾ì#ÿý÷|ÏÿJyö?{É×~íÐÊ»²‰èË© Yª±ÃÊÑ?ɵHÿü¨¶@âË2N‚¶i²ZžnÏõVX3]c3Ÿ«ËÀæ¦N¶a}YI­¦?*Ú¿ÁO‡ØZmbûãùÚ7¿Ò0Í ›8ËõMÀ«aä¤N` CŠÈrA:¸È”¸Ð¡VóFÖH;ËÂˆÃæI\•Ñj†:cA†4ÍU8-” çŠ\ ÑŸNf¯“Ì ×£Ñ¨à̯ñîu¯C§œ¨=ü·0Ǭû¶µAÊ“Wq)…Û½Q£–¾ÄìµækC^“—ã?ŽìsE°…„¿žh|kB߇¸Û‰xÜ÷¯p“B’ÒN9Y§¿Ñ&Ï<ƒ0dz4Ñ1ÆIœ»il-QiÒ~£…>çgéEo5²·›.Û£X«u=ÏmO6Å ]Ó˜Žìëî¸&5'[_?éfÜ;Ö¡ç6Ð|Z´¾¹;Ë„Mp ùù“[z•MQÇlˆ!hBOàš-Üf áMc¶Arø\Á`Õzæ­¦Ð-kùÍooXta¶;*džå›dÙ̽þË_ñÇ~Y,îÿ~ß<©¯w©*ÔåÂóõh­öÞrÈßq}ˆýµqV£?ó3o*æØ°˜Ó{uüîÕŸÂȤ¶¦Cõ ‘ãÝÊ12b$ÐöV±æêž²±nÃ&u¿ýÐo¯£‹<Û¸:ïMÕÓžö´®fI§ïªú—¿ôK;rÜœëîxÍOüÄO"AÑRêþþÿù÷ås\ïéEà–Ïú¬ÿÒK-T“T©¼mrÕÖŒX޼ÊFUÏk§Ø!®ˆ5Új!#Ð)Wuš#—/8›!luçÆ›ðÌV®rôø=e^6µª-Ç#zNÆè¤ôpçqÇÏC«õ¦â”­f¿·ÞæwéàµÍ|7Úµ"ý÷Øø–ó!f£Z+Êæy>ìr’RZ ÊáuþZìC~³ZqöW>µÂo[UÂ6²KšºÕ®]7užÌt«å¶¸øc‘c«æà‡2Ñi>Žî/(¦ y ±­&݇jæ Âeh Ã=])eÙÒÖ°ÄÍžÒÆÀ…§{À¾Ñ„ F< !î.¸ÑÅH|nÌ´'˜UópO›o¥»pën6 ]w×\.VÆžô ¬Z¸Õ$Y»mg ÷N)à6¸rLÆ NQ|m¡Ô ×|-O¬ÚnD¡)nÖÚtaÍJˆÐ_Ô‹œ/þ øØ¿ô‰úO#OÚSÂÞXPº!…Yx¢,Yýɦ|ü·nZ’ûô‚óZ°ª6£·æaÓ„ÑeM³,Î@ÅF0Ÿ`šõQ¹7Z8Æ /eWíµõ2˦B»?ëÊSÔluŽ÷€´%‡ý?ÀefÊÊ6t ê—ÿJÛüjWîî7Œ‘”WÂÕĬ^J(é,4¤™†w ûŽlÂqpŠ®¹%;ÄPáHuKrGÉ^SoÚôð¼¹Ñ¢ÝeŠÝ+Ÿ°JE³a¨’S<±46ªÌìZ§mß:Éøüú°EØÐ`yÄUl-î:R6óÖE\mÖ¡xš9B û¨þNÌäØP½ a,„㉪ºÀ«zYxçkìŸk“Â6ù~ ¤Çâw.?:·@«‰Ö X±„fŸ‡Md¬–h­:_´eÙâ#)›`'(-EÒI!a5iã±SÞ!-8£ÌtaÍXym ¹¶e뺆*6ó&…Ÿ•”bžvx-‡i ¢׎ÃhMç\V‹ÜΖ¤©ó™+‡tPÁ¸Ø7r—ÔwÃXÖàýHȹåÏêUK$•©—õ”ª#1>úI”´ ô’N°­ÆëKv †×ê-ËñYÜpa¶PrÉÌ´¡"Áj¢¸!<Ñ)>˜®“5­¶¨-*™$“uO¨ôeaK†Eù{@^“åíöJïâ}’w‘W‹z¤ÃFêSv|¬B¹UÛÔ8&V¹…W`8F: b‘+êà²5ðj«®:øÙ¸QêÂÔ_íËÐð°³â:D› +–ªîÌ2`c±x‰ F°M¬‹©¬–é=:CU·oSó •îMТ9Ô›S‹•m§…¹ ¹BæÍÈ7ÜyüÃp1í—£M’Ê":ôUön')¶Ž.—é³ I¿¥{"ѲqoNºÀ ªÌM]ç#LY•†X¤˜vôÜ£Yή"ÜÁcć˜Å£ŠƒAâ… ÛÓ¿ÓM±d†•z.—goãƒßë:ñx ¢oòÅ^út}gÞ£[÷1lѲZ úMCÝaT¢uP€4,U&N5$˜:ÿU¿ø‹ÿ"6žC••æI±zÚÝÐ÷ÿxÛϬa F˜2ç4Œ.6æ(בi7k6@§Îž‘<>ËEŸÃËõí.}¶lÝV«~î:ЖÙjúz@Xûg¹Ãhóê§šë |h®ˆø=Þfõ3åŸÚ„’ã‹£z$ˆb~Ÿloæ6Wtì`­”•`È:Z¤â¥rH¡€°.ÏçÝw*9íÞwÒÏÖVKÉ㞢ô3©Nª±`dÔÉMgŒÝ`íÙ÷, ”F…žÈ«›CÁ‚ 3)vJ2ºE䪯Sytù‰¶ö¾UÞŒæö“µr È΋1 Ùª·Eй0IÒ”L~kQŒ›4â¶IBR½lêœjmW15JÐñ9 ÎQNKM~ž5[dÝ8]À´³“Ê~ÿ»;Âû­-äÑÇï›´Ý(a;Ui e×ÏݪI_½ù²»ªŒ(Q×9… mxÒ«†’î**ˆÌdF*Z3]°i^ RegÞªäŸ,ËÂŒŽzΑw u$™ƒ©ì¬O[_œ!«jšˆ«¥ÔÖ7ʸËL H'„ n<¤ÑµÂÜu´0—ç[ Ö%wd(>RRÑê1âX )ª ©µή.ñç^ 6I¦ò=k.‹db¿ùú0,Ô¬Ù—Ì¢~໎±¤Õ¨e}¢ÏkñtT±—>î&³¢6B‰|èÙÒ¨æ<ÞNCjÃ;HUÔíc;'¤Éûv•¶ÂŒã8#!kC{}øæžÊÙëÛ56¼wWG Xï05(=†J¼çA¨^D´ G Ìrsž¬²Iéæ)œ/œ<¾èzõÿ ­nÙ‹œSGgˆÛsK9Ó–°›1a6ø›„W$–c;¤vA¥A»©†,~¿l¸<þûÙXÃ×É“?ò)Vù-"‡üŸâêáR>­¤M˜Õ%Õ³Q«+WO¹ˆJžÏŽz!Ú¼a·„šÙ1qpÕb&Ã`¨âè͈âÒ:åÞºSxë*ÎõGË97«® ;ì° È†8yœ,F£%L[I…ÛC§„0²SU'h±€Šo˜IS7õ“ ^ÆñiS®Êjà÷:¶¨h5õ ->#?kÅ:(®í"¾®6'°DÖMºÅIœµó“RUïxÒ…¾™r(d‚I%¶2èåÁFcìe¹]~MŠ£ÁÔö×u&ÇÆ˜Ì1.õXt: 쨸kå­õ˜;k*6h¶vVëÀî ”®D:Ü Vá¢pºìWûr‹cUùà\ístYƒ“/«ç@›Ëz¤ÜH å€-^¢æ¹^)¼G'°Á#»%_™C“k÷Äf’·H‹s¬ò–"ÙÖ`†Tt©Ó˜ê)iCÌ© zëém…Íú©R­¾Î×O4ßÕÓ7Ðùl4«-‘nKÊP#µÞ ãj›ƒж!T™_%sÓ#$WØ1?Újíª2B¢Àbý“òO*7]ëZ_¬ùÍCòWþ¿_ଶÖùkëK’#Þ®±9 Á‰ÌèvýKÆØ; Ç2šá3©ùåÙ°FÙ—‰,Ôîéßè.FîÌ}ð«„a #l:+·šÆ±r3*µ¬Êdxóê9ĶoKHèVŽWôáŒD)Î³Ô FH© ¨³ÝËùÇQ1©ÒcâdåôQU#¸Á„¡µ;Ú4Âb£¹•ÍóRÊѦÉT9ÛŦo‹… ÿ´uÔ®÷4D"n¶Jˆª§a*:Y­¿Í)Ó.8[õ0«è¦¢AÐÝÄòú}{ì¦mVì‡kðgD?ñ¬Á$Áœ”WI­òŠ*M4`öX+A!\Óy g‡&£†¦æ¤N2 ÌrNƒÑ:¶åAãìrBcÉë\?w[þS+Jk¿, XùQá´ÖÙìÁ#å {m1ƒ½ÏÖ¬ µ.¯æPÑe2Š Â½Ü=`;”Ói>N cȉ¸tÀ\œèBxæ¹!_Ίê"$‚¦>Û²‹bí×weÒbhÄÔ-Íäºiû„ “»ñ4·Xï’GK@Zq ŽÛ"(«nnÄ[,ø)«¢‰ ’O)…‚qìô!ÙŽÍ«ý;! œC*0†±IöÄî Å×-þSÿÅŸòkËx¾ [`÷ilFÆb¡•Vì%Q ­l*Y NdÖ©!@–[YµêC`Š(éfnE2Ø ƒáì_¼8¢«ºk‹ÁMbðÉàèÜæåœVv„iXÔH¬£û®²ÛÐ’UejR4Þ’Ä­g„lß¹xËÛ,¨âÁ̺1¬(m™h­½‹£´•ë†2œ<¬˜„ yˆÕôï™mÐHÃqª,:D4'vNdfvÔÄÃü ·ÛB©%›B•´ÃÁåíüLS¡e5cÙµÎï:qp½±Ù)Uy~cB–¸krkžüû²tË„xîvËw3.W#èj¿æñ®/ÕÓeaï'½5Ùe1Çc°ºA¯š{Kšˆ<ÈlŠÎî/î8ä-ÛäH wõN:L÷cCpuè¬ü”«‘;ýˆÕæÕ{iOÊŠ89 W.³“ƒ¤Õ-£ÛŒÓ2Î} ´ATÉ4´0‡ õ{—ß3…¢Vù< 3h°T×k\êž{î uQh”Y#u SªÜ!Õ —Ïë9]·&Új”©‹w*t> o}¦)DõÍp vç™ œ>›Ü\'+¸‚SZ§Ü†Èñ½‘Þä;³š©¦µxX+)+†.…YïÛK­Äú\ñjø“§ˆ< ó½ZlèþX&//¹Î»b¯ôÎ6 ­¼îe—Ñx€.6:µr:!gŒÆÚ1JÒ0´KÑj¢›³¬ª·`DDЦƒ:hMÃíPF4ÿÆ…Sß>~˜oÁqüg¿ðÏ¢â /Ç«´çl¦Í î ùì-ÃOüÏ?ÐÅ y%ØRõ¶º1”œyuÖ±ë¼ÕĶÂETR ;Mlí8¼1ä=÷¸ÇÀÞÀõBrÇ©¢Ù¯Û…C‘¿[é0O‹àZ¹½>d²–6VÓTKò‡eÚëäo³ŸS™>–óÐ%ç•ï¡ ™Ò*÷¸?£æìÕÁ%Œ{ο¼éMoiDäU©nV%}Îç~î@‰^¶·½ímæ˜1Á þßùx€²Õof”œ‡Yi]¿ ^'Íüz²x†öuC‡¾}¢FÿΖ”ˆá½Ù+fKOŽ» Áþ9Áô .Ì_’Z¥ XµAE×Í6‡ãúÓ #6 r ;pQZ–p¦Ð™j/ ¤1¬|·!ü®ö{¹^Öm-šqRq¹ΓîœqØœ26pMÙ›é$¦¼‹aóËÓ?ߊ ›q訟â@;l¤[ÕÀ2ì –'l^åÂ/v]M®Ëdñ.q+ÈÜËšVAi¸Mƒ™ÎÉ"ÚÃÑî_NňH /ÀØeŠ¡! 5Ny!30 ô›j@:›m–šfznì'ý+ÛíãQÜ’å°>ؽ÷Þ+TGÈ5†K¶ºj1 5Xð´J£§üÕàqI1H€ß÷X´ŸKÓ£}rp„Τǃ"†`L0í» ‘Ÿ¥>€¡„iFì}ÕQºL3†×AìätÍJ–>/+*üÞ×+8bFŒLpÝa¡•ãl«¾ÔU¢È·ÝÁÅ T CV ^˜jT³¶ AIÒtœ"P·€¦Å´É­êtmÄSRL›G·ê:—ÐtWÙTÕ-ô`ÝRc¢M³òJÉ`h‹ ÀºAÇÀ„ë •¨P1`ЄÞܰS>ŒW±Õyèc*Í õ”§<õ¬^.Z$ˆŠ¦·)RÍæÚ£Vû©ã…\,ˆ¦úºð0·(º„õÔïŸdsÈH“ïÜx;±aVßdn;t3E«¶»ÜØpíÁÍ(h*/DÂ#np‚«ªîJ]uæ;Íî9‡¾ÝÀËé*•¨¼~å¿ô—¾¼Š¬öÏ¡þéÿóO‡ &A—V55‡T¨ÿñ¬>öc?¶þÁ?ø‡õîw¿« ¤ÒÍÚ ïµÃø¦áÇ5øÃ÷qõÿÀ¨ÿíïý=ÓŒ.Ö$VèP“ªÑ¤NÂé-°Wm³íµ±€ \öp‹ ÑXOÿ¨ªÇ?þñõŽw¼£ÞóÞ÷tìTðÜíJ‚ó„¶ò ¬L-»òG¯ú¸ÇßWOxü|í´µÕ{ßûÞzßûÞWhî‰ù™6Ìá­ðª | “¡ö0½`"ë6¦Y—á ŠaÙ($P–ÍÊý-å¶Š xº‡ÇD:8e_T"ȳöèGßÕoþæoÖý÷ß_þð‡£è©J·›!JbÆæ¯8tÕì­¹¯Ñ_ý·¿ZOúÓëîîQ ç³<ñÄŽ3ýtJ‘ Ъ]Ü}ðÖÎ<î°ªäîÉŽ½|Ò'}R}Ã×ýYþ“¬ÏþœÏ)’õu_÷uõ®w¾«ùÉõž÷¼§þàÃõëï~·}?õè{î©èCò~î\ ب0ÏÈ ÞjyÌ- 1L*Ò‹±Àú…_øçõñÿÇŒ2µ…ÃOV|Fn—Ýá§~ê§ê3>ã3„Âh§Y!÷…qª ¹2\.©(ÖÞø᪮¡Ú _ø`}øÃ¿g\Nä!:LÖ5"ÖÕÂtà¥&§«Ÿû¹T?ú¦1ˆà»¿û»mXº%z‹ÚŸm][”¨\£xJfÃ$ ìô;o­Y×ïïþ _ÿõ»V•íF}û·{èN× Â”¶3)­™ŽÖU/zÑ‹z÷&­¬i¸ÅÜ5ÃjñÂ>(óõZ=ùÉO^õ˜{ÆÌktÞ94³ge‹àªÕqª»ô¥W–"‹[‹€1øôÔ¤ð–üÐÂf…ùÄßÿDó Ä#êc•ª¤iïyï{«nP(«Xðƒ…rìq ׳ãX”‹î“J!xÅÙ§Ê ç¡zZîΈ\ŒÈ"S,Љa§àVø”õ[¹![| ¢‚`”PþnòD÷{þÚïú.ùy¶9<<+f?ŒÓÖ»?ú¦]ïýy~ðÁ¥ªÅY-ìÖ;ÒãzÝy¯4 $‹‚eÎ)ËÉWƒ„:mUõÖ·¾E’¯.æ7ÇÀ~ððœ ýå¯øÊšÌ[µ×æ5ßùÚs¢¦‹S¹ dÕ7ÿµo.VÕûŠWDôЛޙ IDATŸg¢²z à4‹>øByèž÷Üç«êoxÃY+®Êazwà4n‹îš\«õ™{|fÛ8”\TÕùTš¹ñ¬?ò¬õžT.o‹Uàéÿi±XoûÛí9âLƒcyÜwß}bÀA‡dÙõ#÷"‹a_?ÕXJ±ósz{i†“d}Ó7½2º¢óßä)¢P/zá .IÇP Fê|¼Ð ؘ¨“äyêÌ.5²bPÏÜÄÀlÚZƒŒÏ ݼ†ƒ7[J›ÂCý«ê±÷=ΫJ”ç`¯œÁNùðpïp‹AÙ`d’Ði,hs)††t¤Ä•¡ó¦(CÞr]b#¥[Ñ+&zèa•¶¿àÿ¹/މûjs¯æÃ2¼qOÏ» ÏŽyík_¶xUÍ*úÙ#äÔ/‡ùƒ2:Ìþ-¹’û¯/xÁ_YE=&ØÙ×p3yœ\K²Â•XÆ2‡6=ˆMQ±ý7;ÞÇäÂÉã„QeÃ_{Õ7¯‡-Üh–ìíúû×|çköêUu”þŒÖàlàÀ!‡Ï$êPËc÷†g©°ª>åO|Šœ 4:ÈšÝ-œ ¦[BJ»Ê°%‹,¨1…HìÁ\—lÆ¥†¾ó"›šc9¨*¡ªüŒa]ž¨ÇUù~­þd8¨Nãr&¾™ÝA%%ܲ®´;ƒO«ÉÅã{ßûÞ'Ç)m†Kò¤“Ñéþ ,î´mŠÅ6¶õô,/—Ñ|à&£áh}ÿÇ·Ö§üçŸâ' }÷fT™'«~ßÌj ÅŽjè5¯yM?½^7 ° 毾âŽù.X ÿ»®ÖÕú®Ù€œýûüÑ?úG#T½‹ÕmÓÞéa´tŽ ór ›¼í]çlK:“!z泞yŠÔçÒÊàT¤(þŠª§<å©á ]ƒS‡h-dð†pç=Y £¬• þî﾿QG òÁ Žã!|;3_O:áX*µ¨(çbwpfÃ%¼#ZÕ`LTEm%ÎŽq(­Ê´méVúøÁ.‘Ì™ýû®GÔ&aWâhgÈ´ËîòÊW¾ÒœÁlhüª¾ê«ž?°jÔ@o¦sµé¹>xb?ͽ‰Vmc£/ ªÄÂJÈ›[X$¹'ØÂ\¹b©SÖ·6Õüá‚J© ‘!ÔS«ÝȪÏÿ‚Ï_ ÕÜË®mGD”ó0½$)eêƒWÛ+mWûf$„àf˜| ég•›=|c$ +ãºëÁõ: {yДf¤™fçf|‘Ū0«˜äpkRa:=óšÎ®Ô‚Ôxø³?û³òlÈ÷ŠÆóiãñ¿ÿ‰ŸX•Ó±éîèV]9ÚÛ¿éG<ñ#lrÈ‚Çr‚ï­®Úß3m˰Ôg]ÙY}¨$èÿÌg>ÓCÕdaõ©v9²>ò#ïwb²¶–›–®´5t©X¸Ý¨ÊÅD¸û=¸ÿþ'3 eNï»2B¼Ö­èn(@~yZ°Ú9Š1«»}3­«´'‚’ÅÛøŠ0¤ãàȃ/¿ÇQâ~ÿ÷ÿÀë~ Ðr÷ðªªïxõwx>t`©–½¬…ý`èªzÓ›~Ôî3#L;©cÝ>÷¹Ïmò½æ›³*ÀLI ÂO~›&AuM]¢dÛ©ç¢Ä n^¨KåaÉ_Œ²“8޵2=zÒ6ÈõÝ>õS?µmÉkB;Á\6Hzt¥V?<¡ÌÅPFùô¯ù+)zÊ¡j'Ui ÏÑÀí³2‚“:˜y$%!Ü¥ÔÆ/3ö÷¿ÿƒèvî©SH«ÑÑ!„eÊ3—A‡Ûüû³ûË¿üoÜ-R< Ý:F¡Ì6ìC‡Ó(]´á‰A†‰§>ýÓ>Ý`({%0ÀDIq(WÂpU¯Îhò€d [‡* ›Pz¿#‡Ò>ð·IôéÀ ©*Û8ƒî„LÉÆµ«»P*QÜn¨ª¦z0§äméuw¥SóZÁ-wõyŸ÷ù×I29,¥­nN™é‚’áîk¾ó5v"Ø4îáÁÌa ëø?ý§ÿôØö™?a´À-Ûƒ¹Ý–åRþ…/}Ne*5[–—È®0!p©Ì+QòÒNØæ>²ÙMÄB²v3Ög>ó™aD¿6rÅŒÍÚÿáûþýûV…`š ÄdèAe#Í¥ä‘A.÷4"G‡@³÷è3*R‚”®#À¬ízÖ³ž% ‰¼âqm6ó?ìîL.8@⚥ØÚÞ†Ça 1Sü(“ÕÊèÑ5ø  HŠˆªðhY+&O»È +™•SÕ­Ø çeÕ×~í׆»Î ´è^å6Ò4)NÚW8 Óæq•Ô•¥¥9?ðÔÉ}ÅW|yn‚!2ÂZx†ðp:rì¢\<ÝZÏ*Ê©çͽ0Wq´ Œj ƒD‹õÀƒžAÉàçdrªæ@ÌFL8Sq¢ÂrD•kTS:DÃáŽáˆ°Õ íS¼¨tÏýŽý)Χ ªYrØlM5¤¼7v–Õ€  ´eÁK‘¨'=éþu}˜S~u9Á­Ä2Ñ7']1`Ê:%ꕱ(.áw‘u¹ð,:6ÓÄW@I½‡cˆ ¸XVÍHê §i2'Xh$b Õ-gh½&­%Y!)l¼îËš¾Ûl¢X_þå_.8:Mªw\ÕÍà}èŽ âEOšgYzÞmg ææÚÄãt»°:µ:‚ò󨙫¬œ•£ék½É4,Ût•b-ùPqR4¼H0Òßaf7Ãû0`A~Õjñ]K*‰Ohõ³ž­î…:ˆõÏN^ác¥wᤎ^õêp‡1m‡Y¨êy.Nw7f`Œf>: Í2üøÍ¿þ×ÿjÈ¢F“™o`>sáïùóK¥Vž‹‹ÊªûûX£r!rN׎®6g¨ëŸýG÷ÞÛ0{Z¨PfO#mG|Ái7ò9ùLÐAbÕéßvaUõ¸®ªIê¸U˜LŠž”†Ãu¸¡N)‹À\pP[K]ÚM 3%jl"°ðô™~ó›ßl£ +›íÏõF_˜4œ.«©B}çwþu™(Ã¥H¶°8FÙ¹ÆÉöÒ—~]s-9MJ7ÉŠ ‡1ž¶3à&7E‘,±…iÓ¤n*Mó$´—5Ê0æ² ×‚Ù¬GJTdíí/u‚K—jéggŒ u$OÛŸð„³}šµ…EiB'šA+ê¼¹ÀEÅÉmDÕ)膰`¸š£üº2¢ªê§ú§eb/•žñãÖwÙöD3Ú„øúVoyË›»©¦v3`ß$J%ž´{ÿ†7¾!(Xl˜ââ^®ë ß)Ôõ-ßò->ùedz#ø›ÖÊv÷¢µF.¢’¡©]ˆDÖUl«€º3·"üÅ(=~u¼¬jK!õA21ŠÉ]b`Í™ØÛ3êDµÒ½ä¢è Un¡θ-<%—ãf ¥‡À_;}Ì<‡ƒÁ_ÓÊïƒ&©O‚+‡8îÇfCA9Ç;nl17«àõD¬j‘ˆN¥ñª‹K5 ˆ¬·ÉºÈP¶D4™·+mUƒ‡âˆýq"ø[;›‘'°ê•€•‘ÅÑîèª= ¯ìAŽ:sñ–±–»q`¹ÖÒáø.t]/åh™3‹`å`ÑŠ¤ºl¹nÃhá2pWs„¹pßÄá sß݈Ely¶æÙÖVÐjAÍ~½bø1Ë) NC‰^³¸mrÝ&IŒHH4.š·áÂß^‘;ÃL U/xÁ ¬:E#/ ’¨b³8bKÈD¨*AGü MJƒYt­¬“X©ª`¢  ]‚lôA½²ÈTÆ© zòkÀ15GŒ¡Èb™*KxÝŒÎC(}{½àSe•yh!bþ|ÃóÉ ß¡ã÷ê3?ó3g#1ÅàŽÌ¸!6SÝK`¸Ë¯qY™2U¢[ýç8³c?>4ݯÛfÞ™uzZÞ¸£cp²Y%Ö†®<ÚrvÛsžó¥´³îÏ6å5Ø •Žæì÷e*»Ò†œ C¶C¶~ýÒN¬¤¨ s‚,Qþúë§}ú§¥f%•ÛèrÈP3Òãc~ÍK^ìãêñDèÜÀc?ŽG“˪ËÉ×¢IÒÊ€î#Ïa;&–©US™Þ¼‚Mók7°Z+ÚWÖ3žñ ‡¥Ãbɬäe)ïrvÇý¸û×K¢ÈÞè܏Р!ž<†\M¹d¤úŒRpâ4np§9Ÿæ¥ÑeËz¡Ý“SÝ"&ÓÕEû{´iÁP«Å¾Þûç|Ù—…Ž~?ð/Ñ«S¾Ë0¨œ0kV,|¨^ùªWÆ«Pò¹Bn¬hÃÄ}'r¶…þˆ`®Šù!óÎn˜¥?Zúp‚!%‹„µý Þô¦7u7“à¶Øì8VEw ‘Má¿ú¼Ï“©{4&/¹`>‡>Ñ6¶´ûrÞ¢žÞº-xhQùD˜­ë…̪@W"ÌœòAfœ®‚ÄVFkynðjð*ßä™ Z Kó3crÇjƒh«Âµ ßsÿäX¢ÑeØ>VþJÜåbüÆoü†ÿº03ùO xÀýJuË¥*$ÒzMœ}ó<ݘÊå}%Ï™w%ðm~ʆ6uÐZ»oxãLk½Øÿë°’E§ íðì–sbß•¯Í€,ïl©*ÄþÊè8a:ö»Wïw¯6 ÙƒÛ©_êˆzNBèúRCøX›tÔ…“&áŽÓ­ì=1: Wª†ó•q§¼Å•`c yg{ŸŠà £÷J0 Tø\elV[¨¹ûÔ/s’‡ö¨ROìÎ@½ƒ2Ô )£ö •!º³ßÛ„¶šg”˜À–ë€ÉóÞrÒØRÞÜðØ0çÈ—Ô)KÛSš%;¹”¨Ùáh z’CQYÌ)o®öR•ÆË­Æ(¨È^††Ák·Nç–ÚPŽss¼IzQó ì¶jöTŒ2/Ž0‚ guˆfâ!žÕœ kˆv=†!—a¨ZCVµâw•1wê,;„2“Ñò*ŽÂ¤6”a JÄL‚'«êùÏ{~¡ª¾÷õßÛN–¶|Šá¸äÈL\msc½ê¯½ªÔK_úuuÏ£Ýe.10©¨¼,ÐÉBsÙýûþá¿SêK¾äÙ'2°*†Ù‹³Ý•`Wæ¯Ç!¿VqG®|Y¥úͺ#p¦ã½âyMºHÖ;ßõ®ªžöÔ§Õ‡>ü¡¦‰¶Š?y+'羽ãºçžG—º ýîïü®Ï\™Öú,€žî‰ž6¦â!ˆ¼è÷ã$6Gr©ÕJ2«ÉªzÛϼm¨X—çrš¦£gµ(Fo~Ë›Ëì£uxHº/Þ&Æ¡tÃYúú¿—¼ä%…ªzÃßXýæC³}Û(áÕó /Ff9Ð8ÖËë¿÷õT=ïyÏ;ÿ=‚6äd«Eñ;S#¥Ýè{Y˜“QV;¾‘H E™æ•æçFoÇȪç?ï¹ç†úW^ð‚uR³¦Ñ‰à\™xÕ턊Uoyó[ÏÏûÿÝwtÒ(d }iue7`¿Øÿòÿý—çÂú¥_úW‹ˆ|Ð:²© ½§¦î!4” ¨÷M𜬌÷Ãd¹—ªC®¿lkã“k{Q-õY=¬X…w¼óvpÚ0 N=ÉÐŒ´¶6²¹^çãàÒƒö±}l=æ19¯Ý… ­t¥›”EJö ÚÞöò¬ºe‘¥áF$ÝRŒW¦®ŒNà˜õ¶Çû÷8­LJœE¯ \Q”F#Æb88yêº@´Æ c±^úÒ—ž¯ôܯüJoϳ:ÓÍkrËœ™ÁURzÓò"e}Û·~ëIÌÝë^×ðçT%Œ€õ Gš- ¾Ú#xZ`;fÆ$N¾${÷Ç>^îW>·žÿüç‰B=ðÀõÕ~uýØÿôc²ÞU> Å¡ÜV\|eýâ¿øÅ:Ô¨ªoýÖo=Ûp›Zч5÷ßÿ²æÞ†çÕW5V.Øyh?ôC?\?ÿó?^¬üÿqýè›~TĪYƒYûÝhzÝ_þŒXÄVÒU0¶!@#)˜–id58káú÷ï|ç;ëïz§`¨÷ï~ÓÓÍ*¬Îögãq{¼QBä¾¢Û†zÔö¨zÔ£U~ô3ùŲìÑ÷ÜSüãE¯ê¾Œ1‡j®â4:Œ®ðÃ)‘c8ž7q¿ÇG8 Êb9t/±Nö×û3æÏƒ†åÅÔœ½é¤Jªá›8`DÑó}™trV½äÅ_S—ËÅ¢¾á¾~UmâjЫ¶m«È«Ü?;³Uí Žø½ßû½õÄ'<áÄÄ}Ï=õÆ7¾1ò—¥úé䳟ýl•Ø.¼¹†4lr+œbÚ—ÔãßüÝù»žSš+G0¤åfÛYÛ(ÔOýÔÿî29µ_ýí¯6|Èñ)–¸¦¨ÑÔ·}û«[¬"r¢êÙ_üì5XØ"[ä_—æÇð^ó€5†¥ñX\›Ó6V|pÁ¶ðÖ:é.šY ÔÇ|ô3ª‰ˆ/Ü+Øj:ÄÔC=4ðÌ|¸øð‡öˆÔS[îñ¬€úTz¶ !\TÝìñìh+*˜Ý`°a4¢–xÀii’úäOþäŽUÙ`K6åîQ ¤íÇ03äEº÷Ì }iÐ8½þ9x¿¯ýë‹fsÕá-ò"Q/{Ù7úÏõ‚é½ìe/3¸0”ë³7³öÁe¨‘tJï¤ê§`v:€J ´­¥!$*j %S;Â)å8OL`µÚyîsŸn0‚?t´QvAšºd ^õªWvY™A8§hË.X 4Í;,ßOf…8º´ôØÄ[ô{!ÉHB10£rIÏA*÷LZAŒÕD8ŸŒsÛÞùÎw­Š°Ï‰¡8÷NâZ£ÂØõÐAc«&7ÂÐ"Ëú‰O|B¿ªa}æÏšO~+YèóŸíŽ$*ZøO[ŒÕdk`rôÊÜÉuPB›l±gUÀ%—D†ÀDV6œdŽšé%/ù牊• ƒF¶”(pž-Ì^§+vL½Å3Ïz%º-lðs »G!X©}諸Cú(;‡J­Ü»x(¤Ù|ñœ”ëy±'éWÌ^ü⑉”IW–Þe˜K UݶH§ZeN·êÍBs¥ L³ÀªþáÿAr&TSÌzë[ßZ_ôE_T™°'äpê% 7¼ÝÎ)°Kî*Cy°§ÛL›ø†¢Å› «†ôpH¦;}ÅiŠä$ïë"ºï¾ûêž{s YŠjÅšmÆ EÛiºÚÀ_ùå_ñXF†iÿñOøãûbß,p36íÿß÷;ÿ¾ÿ¸ûJ“Öüþ³¡UsϽ÷Ü[|øá†ïN4/FÚ„sŽÞ*7Ø[WJ0CZƒ‰cL(nކIz§¼¿ùú¿¹®.6{>ðÿVý¥¿øgJŒth-ô §#4‚]–)aλt€mz¦Œ`³2&ùA±C§ ¿µm-I2Œ …#xFÉq’=üð‡#Ÿ3KŒ†r‰¶YI¤Ž#ËA•²‘Õ€Ù„¡mšûó÷€ s–œn2u‹s5¥‡Eóhc×y½j:1¨º»»ëJ¡61ò-*ôÏJúÀ>P¿ñ¿Q¿öko˜ —t0ÛLÊ‘þ?F®/½»©ZƉuftløÄt«þïŸÿyiÿh×eím®ò`˜ƒ;ØýŠ¡ý.8Hý4=ý±..Ûfšj•Ϊžøûÿ4íñêƒØ˜]Ú-Zb^ºÎ›(SnLXïqw~èN¶òò £] ¶P$µŠo5)]˜ö¼ç?¯)rÃóÔ®¡EG|ò™q™§¥Á>yüîïþ®JW_ôlr?•b)yÙ€ã4- œ••ðpŒxK‚€ypO¯2‰ïüsÚ¦b›hNêȈiŒ¯Ê’ìÖ¸Îû{è·êX0CN…9€Ia~ðƒ}È•Øé…]3*'¶EImбºÅÛi¼P¨ùêF&’¥ë6¨ ãN ¥Úño¾è¿þ¢EV7ìƒ$BïÉ,`¼1"ê””B‡Wb|{X†%oúpR³ˆÆC%ê¯þêÆÇ-³î§YÈ&L\kœn7„tÙ9ÍÆ@y\C]jÙ¸­äªÜøp_ ¹Ò=ÿÏàRÎ & FàL;$ç!è@Nǧ“œ°Cv5Er ¿ñ¿ÑùI:™<¤‹‡Ís< q¶¹ÝÜ5—:kû\D^Ô2¸¶ôAꞪ3Ôhƒ_h&C=ÏAîDq µdh ÷ è#Ÿ|Ó>ŸY­¯ò‘•GˆTÏž~—ÕÆèØü,G™]e$(+d—BZ§[ŸmP6Æú|¨ðé;¦©{~objÍÜÍ"Œ¢׬é†G êƒ?|ÕÇl¡# ägòN¦'¡?_†«Ìî|Í‹AWÇ+¿úÕßQ#Á°ÇjT¹rn.òTÃrRò ¶ú4hÒÄɰƒ{Ìz‹£–Þ®¶}%Áèé–a+I{0OÀFÝVóI_Ê=ãÁ̉M/C”!®¸Á:×`qÞ`­7~@°È-S•á”ÍëƒÌÙ«*3U[5¤ƒÇ1„öþr:í®69‚Œ†<ÝÛôÙŽ¨dZÙŠ;q­dóo‹l†š"ŸV=üð‡l(saPæ^\A_jÔ—òþ—@mD8)ëæ²F— ä+±xºfòöÝ ÝµF;Ý!„âôfÛ‚/¹„Xü•GFFK»Ó! Ú¿N‹z†e¾þ]ª†tÊ=F³¡‚;‰*\Æ|à}¢Y#ÍŽ¾šp.ïñÜ߅§%7U´šßq.ÌÍ_œMÊÖ”ñÒAc 7÷pêšZ=“¹¥¹»˜6Â/©”ãe6Û2¾ôIæAúF5÷߈UìíûNоÄÀëÔtòhd÷YûåøÆÂñ˜H„`ŒƒPI+=M×¥p`êEy\žÕD¯h¦¬]és¶’—©•vúÁ²•ºX+¸Â¡tµ6»  ½­Aä å8œÔå8;Ÿ¬†Í¡gWî@¯åe¤\PöPÌ öXÏóEÛPû¼A¥’•}Ö“UÜA~ÇP}6Ÿ¶Ó~ïR}ôêõÞvjÅ7;O‘JËÞöýå*…›ê¯ý^„ÙØB¼LB‡¡ªz¬Ÿ¹Ci´ Lð [¼›U¢KµÖ“@h9=.åù ^®>u ·Ê6 [µ¾ÂU5Ú&¸ç03-³ôbá”®É Þôz›Öƒ´gÇ•áR9ÑÖ«º Þ糕‰–Y4¶úŒ…ûÙà=Þ4'÷×?ÞÝgŽv\­¹LÚ¦ؾÉŒ‹ @ŒÒkŽêîØ±±•Öcî½·Ò‘({ j%>à¸Äõûµ·¿=è.eæ Ûü•]«¯&'Fµ×ª™P@Yï„c{êºEÈ€0á˜æ¶ù_¦;óxô©€„‡Lè;è``¢;R½½xšÒ<ö;ˆÍ°1ª¬ëôf¬Ì÷Ðæ52¯vzµj³›_¬ŸAfW3n$Ý<à\Q[UŒŒVXû¥5×±a÷ðíäÇq0_DשŠÜŒ0ì2¶2~³RVjJ<˜©ã†Ä(²M8Ñb8ZTMi}}Õ[$:²Ö¸ê/>Wè{kóC¢Åòö …™ß[ázš U`"Òë}É$¸øª~âÇÜðKhKoÖ (% \Ò±P?ý3?¹ŽÇñœûHGödgÁ âÊd®áº²oÊI©XetÞ yF­m§gõ”Gj‡Ñ\¤ªùNŠ)+\)yŠ-á1[pê:ŠN,)U[™êJ‡h-ÊÍ&K«†G¨ájHÍzR…Û}™E›èU w3I“Îß»üÞ˜æ¦×·%– ±’…U=Å<õˆÁ“L]¨U ØEÜŒbbVMžÓ‚Ññ8öMµI"àý÷ß/3L;±ŒÉlßw¼õöLØ­­}róï^·9ÏM(³ð@wy¹ÆpX¬,ÖŸÿ Þþ²!ºZk8ÌNÍRé}ž¡d þ¡ºpŸ%™Hg€S@M°ÐÕEð^Æ!~h{ßýOº¿wPcb£<à°9Ù82Aà´…œ.Á¸’GÞ(‚¿…®"×ppz®ý;Þñk50¨\Ÿ',Ę̂£…O¤âôê¡IÕÈšáÏ…ð€£ÓoN÷êýÇßò–·Ú4³ÌqûúùÿáÏþ_Ö&T«˜eVÍADxÌ¡â•l™ŸÔ–bŸQL¾r-yMŒDXNpºrs%œ­ªõúëÛßþvK¤yЉS1ªÉ¸Üƒ58e…¬ÊA{6{-7—e§K°Ðc{Ÿ Îã‘>ù¾Ä®öò¡Â ~øCÍ+òÜkÛÎ º V IDATbÍ2I·¦‹}ï2IgòAʮϼ`å0jµÂôp°|}¿‹V®¬ú¶oû¶0OH‡¤ªù‘±ÝÔéÓ(3B¬¯ª‘¯¡Ìdf*•…`ÃYàºRå)\„Ìý¿¿ù›¿Å¹‡R˜S ÐFDC+•(©Fª 5ð¼ΰKö”­pfn <‹Ûêªê¡‡Š*ÔwîØ*šÂ"åÚn×e‹›>Í;Ô6™“П à 2õUp¸ô:F`zLHäpc5„~'ág85ž¿a1‘\éðæ89ÍWe¡°á) ­€j–Âë“>ñËÍÃN õ²÷²ÈOš~6¹±‹tÌØzGó\Òí4WYq0.Œ5(ÅB]lýüÕÓæ®êK¾èB99€@#àƒ‘ü&òA $‚cpWŒM¹!®Î*cÏ.xéRg†Ë‚98¯†–ºzz/Ãë‘øÐFfµÇ LŠ0½iÍ‹/æL2vu#Ÿà{…ŸÊ`'Ž1“èwŒh« £aÈë(f¡«2:ùjè6îºÃ¢Ü uµu>çàU¤îÂ7¬¥È£ªª"¥;àÂ")if {•ám]N‚«¿nÝv 2õR€œjuæ>Ÿ`ïd\®,jª‹æ¢7K©¾XŒ'„¹…‡yaÂ(Ë»6åžVĪºUçŠ-À™"¸¦à`¾ ÛfÝo.Š ¢Ïíö?PÜQH˜#-ïlàAcnGÖ–•r§´´$ÂŽubäÚpÂCF¨å7ô®0 ðÄøQb%§À¶é{$aŠ˾Êu·aôjDm}àÀÍ4ÀXî£„Û ú…jIÏÔózÑØr}BF3h }`ƒ4W‘â¶«VV5Ú“wýqMLúðM¥†ïÿÀû—|•|Õïus'wÎyqô «N.k#;/5SP­©ò1ôù_~ò'½JBE"Zkèv|»¿õ·ÿvMRSÇ„J°è3Šh뫃'¿Î§Òˆ=»§¼t@pU#ŸçrÖ¶—pŠ˜aÚ¸{vÕΊ53Šö "4kæay™K`î”VÀZщW…tߨÎd´s-ö^§Ì¨äS ƒÆ)¶¯†ÜØØîf{¢+ð{éFzù¶Ur[)VzárÁ=" OzHOáSƒÏM6ÕÎÝ+qYFãXzk¦ü5Tyʉßâ/*–C£Fp`¶CϦõ×WƒÞÛ“&´¼è.Ó”íˆÕ ùÂ}–ó\‘‘Úõ8°Ý@…Åýp04×°Zµî…^œŒ<†_ûô°ù Þ Êa]öu°¯ëK™›PUc5ãÆf%툱ž®›­š];Û/L Å` id‡ºÕ62*¶†„CŸž{çÊÙºSIM“´ëÿ}Æg|F4ÞÜ©!ŠÅp—óè>¶q/ÓGV‹½Ë™˜°GT{«Ã%ª`çµaMjYÙ©·:a#¸ˆ©ucC@añ£^~-À>r‰¼a¸âœøfúŒ6ŒN•2[}°&­‚ÙÓgÅ^e0yœPº¬€ÜìÄ^¨Ûr|†ÃL Mµ¤´$ßCª6i4…ôŠËr"ÐÍaõì/ù’pÇÉXÐ !çHùIÚ*%÷°®)[¨Ó^=œÇ¼íQ3ä ŒðJ¶s˜:¤ý6"¶å †x u&L´{¦0÷„:Û†¡Azý[©ÚUUŸú©Ÿº²{A«jàñ?ûgÿìÈŸ*Bk Pél[EŽ iÓXvÏAŸ§ÒCºŠ'kTŠ*ï´/³—E$^ôŠI§²Z˜‘ž™k›‹ÚZ©9r?¦‡¢OH/%–OÊ&¡ÃÎ!DGš†_Uõ¡‡vgœB ãÍÀ¡ˆ¡Ø?ãó¿ê«"m%ÿû°ëÒ?ÛENÒÔá×ÄÔ!Œ<[GcSèàî7úwRU„À_ÿð'ò­TvA³wÅ]Ç|Yçz:_µ¬Á0Wc„hÁˆ‰”»iz¹»ÇĬ¿^Œ-G¦RÑÅŽÁŒ“†i\<Ò’+m>õΈXâü¤“Ãæx„‰~ïcc¸‹½×'蟷Äá™?ÙUn±è:ø81NJ n‡ Zä§Z 9O,ñÍ´RswÜnR»Ü§]-F²d=å)O©§þ'O­§=íiõQõQõQOzl-4JÖ‰+m%îÄIm‰i6rÌóúÑñ‹%pYœÙÓš=ÑÌñ#Ǫ f„’3 €/©6]°ÄÝÝÌ{pÚ«Y¼k§z…Í‹ž4Ç8a’²Ñaè²2Ww sãÅ/þšdB_ŸoÉ´~ÃÞ`•(#±µÍ½…3»é†àÚ莎|ÕáRÓOçÊU mˆ }Úºãg:-¶ßoÕ#%/Á@—V£å^Xoäl™ÓnÁî8´úY–M‘Ç©›¥5ºš¥ÑQâ§ÃK…¼ÔL^Ù¿®ß»­"OXq1h×·¦€:Qž\jˆWœZß³’° J̉à–ú¯>ú?ûh¡üè„“{t#ÊÞ¨W*=ðÆsãºÄ²bš9,Ó¶`µ˜4_Øœ„Ô±Úµ¢Õs´oظx"Ëqä]’‘ŒPò¦ðá`dq 7ô@c ,Œ0¼ÀZÚ©Ûµ"‹Baˆ§Dá'Ýs…ƺ°ýžIƱÑm%Tf,õYÖnXdèr@¾ šòt2êƒEÕ• š£]™+’çB¹8‹JR™ÇL˪0,Á¸r²qaðí‚—ü;¸Â]¨Wh¬µhqks¾_<ÔQH%ŇÑHOõcUÚLÃÜ詉GEhšêiÈÁ¾hû  \=ô“ë}ú¸?üqõ;ïÿáYºÉfÒ_Ô%ºc^žÚÊe‹ eäÁ8šªP"Ø;>Œð$¥¨\×Ú€F¼§'äDì€/'&&9ÕÓ͚ݫ+MqF[Í@„r1ÓþŽkÔÂkâZÜ•ŽõÉKã„ù·~e)aŽnìîHÛÊm²Ï”°–6ì¬y5ÕÝd œy§ô¾§M«*c !m%;eQ®§âk^󑞉+tâ—ªD€O›  Ç23íàqP<¹}¹Ñ§Ii§Ž £P ЉØä©¨-¬qãè^rʉ;© ÓVBóUEÿοÿÓ¢+ƒÂµ²Äy¨m={Wo^zLµÜŒUÉÿöoÿÖÈÏü·¿ú«M„™N.€^Uõ Ÿð } ´©Û µº†iüê$hú·U "²}ÙÔ9é:ûœÄÐC‹ÍEùXJ`/|/*•Jxƒ¬oú¦o²ç_?ßf!ñðáŸê­…‹(ò:¹$c2 ,Ï*š©R•ëŠ2·–«D+Š-HŠ—ZFîíæ‰µû¹Ù –VE„àþ­q9Äõ¶$¿Õ .SúS÷ H5†¨ºñ"šìnøN {òùŽDÍ<ÕÆ~HBMºž,H ¯8òÔ.HžÕíÿ_Ø·Ål›Vå­ëž/)XE-ž«ŒPSL c©‰¸ë‘´•(¸©­n **4â¦Â¶&6ŽŠÄ-hªm‰Z‚t0Ñhä jõ„F{d@FË·zð½Ïs¯kóüŽ ÈÌ?ß÷¾ÏsoÖºÖµyîsŸëíÄÁXD³~‚*Ò 74Å\ZRš™]J¨¹2‰{Ó¨HÆ~4$}¶‰)F…yM ®~Iþ›cµÖƒø~õ”Œíµó5_ó5Ò1€6F¹šæ¥ãÂ2Ûq«ÿýÏÿ|ÆÌŒ 9XšC-½·ÿMí礠)¤pf÷´È¯ó<,Ó˜ð MÖÑîû;VÅÚ”X5DˉfÓKvs´õ¿ÿû¿O ô–ÑÜs0RWýà[~ÈYÞ·å˾üåõÆ7¾q”ÑlþùÔOýÔáÅ2ÒÛ™ßüÍßÌ›FÚ¶BÕ+^ñŠúçÿìŸ3ÝçH´“8ÿøÿ˜™òmk¦ºª¾ä‹¿„ÔhÔË^úR›à± ÇgÒ¨•‘ÈÕMg:s¨ñjw Ú¦ xpe–á}«ÝNU=öØcE–ÚêÜ>ßÇþêcÔf‰­î¶âŸ¢q°ª†v®¿OüÄO¬ê¤P ÁŽò¬y¸É•FõÒÚðƒó% ‚ƒO>èÒg©PÍé^?ì¶È¢‡™è0$˜ôë^÷íç—˜—Æñ¿ô)U¬%—äaÐñú׿žá#â{>ð;ßü¦7׿üÖ%õÁÚ™ðFè`“3YrUÿ“¯þjŠVÕË¿ìËÊ«‘b·ñîz÷ÏýÜhyot/lêß^KZ(JUÚÖPÜ…b¼ M°<^촧;¢Ç’ü¾ïÿ¾ú¼Ï{±Øý$°h'þ2nÚoú¦oªoxõ7XWñÊW¾²^ùµ_[w=fÕCIÕxü«¿û»¿+DÛ2ûôc¡þ£/þâ³Ü~Ù/»½à{â}ÍžûÁ?~þ &Ú¡E)ß„Ýk¨•óÛ@€jÛ$ùü˜K.·Ãä¯ÿæoꯟy¦>öÌÇ@…ûâCN(8+Õ[u?dÁãRýßúgçï{æ™ÕïýÞïö­$ŽR$𠯾­Löº¦«1°Š =óÄíH:¦íìÉï#ï!ëÜ¢º¥T!ÙÏ@:ºû$Iè1ólù®ý]õßù]&zÍ·}[}ë·~kýùŸÿy˜&ß™Xé8þglƒýó¾ê+¿êüw_þò/§®¦Í”wc­Ÿù™Ÿ¹9葬]uÇ‹½bPQS©zó벘Fñ`“Ì<¤Pmº×7¿ùÍõë¿þëõIŸôIõ’—¼¤ú¾ÏçãáÊ<€á_è=?Ï«^õªzê©§êë¾îëXÎSÓ÷Wd&ËAó6IY“K虨ÖUO<ñ2š“/½æK®§Sßž°zPêˆH|óÈëÖDM§ßóþäÞ‹ÍÔ”¦(ÆîZ@ýÍÿûx ¿÷aG æ;%é›ÏNzΟüÉŸÔç|ÎçÔý¯?jHÛ\@+ÇíS 3• ”ø6±œ{CÕ <›ÃNl?¬ú±9’Ê14Ȥ—§Ìì#¹[îM眑¹®‰Ýq¯]CÛ³ýöïøŽzò­o­×¼îµr—¢îïUÇ=…]À2hPñ?:ƈºÔõßøõÙŸý9EÑ«GPW‹­×ˆÅ1 nT¯Ýeݱà`r„@rš'j•ó1¥[‰]J¦n“½<ñEOì[\­œ!>ÐͨѮ'‰YÕ×ý×?Ta4!U'Œ55®°èÁ-G67z1­•^4 9¢j !ÈTîY€ÏæÕ†šÂÂq}­± ¬÷= ?¾ÇÇ?þñ‘ʆѦ2!ßâÍ/•C{ªêþÁðÁÒmø'»ÔôÈÿz Â’zCȾ8¥œ2²Ö_ì|Ôs–¬£ÔX‘“­ë§-~àÜ)¶’è>£n[`c޳å- KwÈÍ¥²ÖoC¦#œEúüÄs²½ ç}ôðG>ü>\þð‡EaV¥æó”q,†„ê’µÝguœ¿ì½hzgCÚ6``¿®¶|„¡Xi ‡Ir¦Ñ<6kÛà·ÃÅï6JM|0v,a§Œx"ðù™¾Ò§YBÛ¦ÒUå › nžšmæI žªS™ôÞþáâ›D+©V…ë ³ŸÀ_” %ÃìJ9©lúdÄ*‚ýF™•}\3µ Òöñ,98|~¼@Ž$LW1lyHúÐŽFVs1Áµ]yBr ^ýªWUÍu53žOçæ¦Vø00f[ßI[*.":ä÷ÌIíÄþ§Ÿz¿ æ|pÃát6K´žA<I)%2Øøã¶>Më?¢A×”‡(ìÕªu0)‹Ãguöí¯{>ìãC‘‡¢”ƒ‹+F¿ýío»œÜžÊ!:Ú56Ót¿ÀãÔ!)ÝA£™ÂtH«s,¼û ™=66$p¼)s¸É%A¾X ¦t PóR‡éÈm=4˜]HýdÜ6ùÂh‰žÅH³¹n9–Þ#ÇùÇ~ìÇÎö»«ƒNšÇp]9>×}’m¾ý¤¬€"-/0¯žªÎìÅD´\'-º[Êö¾Éfe4Æ=ó}«>D¾­îŒ€^òÃ_¿ñ›¿qÞ/=éÛ)=[¶n‡¬ ERUKxQ‘Omáh=σÿÌO’T¸#g[Û}|ÃûRã‰â\åùïð…ë @u™F7±ºõê$زHDéÁ¦§b{TÇk:ô…{ÈI©ér ² WúØ3Ï8ž7cƒ»uOUøE…Bß±¥âêú´¼@ë99(‚öZ4ΓlßÍ™µsbëÒÆ“<­È´â¾-ÆuºýQ79XŒ´µiHyÔ­Úá¾8¿ó¤à‚!CÕT´ûÁó»mêd9Ö*7pc–¸Å”Õ8š¥Ê±Q5r6uÏh qA f gðŒNr%qjm"0-6¥„ H˜#ñ!¿¿U†-ο˜Ú9˜SÛ„KÝv7õcL„%ÛôaÄ š iƬƤœ‹| ZËikÎRœCgvQ¯9¯Òl‡£JÇð6Ð8KæžOƒL)P–ÛÛ gR@Æ‚LB¥r½½‡ûryd©ïè9I)gHVUp‘w»«¹–À§¢áÊô(ë©fsYu±w¾-í¥CEåØM–Á‚XtdÿÊV+¬™&8T?DùP¢»‡ZÚ¢¶Ç­“vrŽ(‚4Ð>Ücþlâ ¥ºS¦Àª&€:^·MW×dÌjÜ(£x›fKGÖW„``‘¹°hçqwqÒ\™Djîùw¢xâ –<™Åýøý‡ îýýaÛxg£ÙúÉñ»~íH£Œ™EÛÅdìíÂį:pOOƒ ’¼¡ª˜Î=È*FßJdS-`pñ°¥#»ÐÆãÔpbŸÝÞ’G“Y¡°ÅX ׉N2ªB´ºŒ§ïr blµ‡0£f‚Î&+7%"ŠI*np¹(AFÙû¹|ÑOÈ;Üf=`½¬;kV`yžÍ”“nø!N`Â6v¸Šák‡–|¯{q+"FKñ¢·Ö’ÓrV:¥V×>ðÙ‹Í‚‡é·çISDÇo} Á69oxè²k-O+ìŒà™‰w@œ™§Kôü…_ Œº+Ϩ/¸}t¿/ÎSr1N%W݃ƒT EÍ=‡nwMÇfuʶ{à¶°Ö;MÅLK—’Â!ÜØîñŸóœçŽTazòâJ¡XªÐ^‘@=ô¼B6cÑñ_ô¹/Ú@ú¿Œ.³!ÀiéÅÀý¶ùëaðÊ,Lâ¹!PEo½e›CÏß{á ?‹ÔUd^ æÊìÑé•öäaT—É2mVú?ò£?2Ö2Š7aóĹÄê«|zyú¢‡µâ¾ë>èvð=¬“öÑ—E¢òsÝ×ÈöiÄÈ:àÐa°¨»}ª ´uå«fEB¢2ÜÚO¹Ýl°0ñ ®ÕíÏýß¿ø‹k.Ñi!æçí•.D‹‹xÂ;×ÅNå4zøO?ýtYWçA.n"4ãµ'Ë~œ[jNHK‹ªaî¹Q]ù—iÏ¡ò›¸ ]@`Ÿ{tèÎÍÒÒ¬vщoùf‘Ž÷¬¬QTÝáæ É˜öè:m !ÔITœóé¸2I«’š¶ÍBAx/,uK×q«1/ª¾û»¿ç"cçX=‹Öû{ÉV¾ GŽb¨;¨Ãڴ짤‡´#-æ÷!çševÕ¯üʯ¸>¼FjeÍHZy®˜Vý gœã‹/j—DµàT}ov=Njgn?ì{¿÷{ ?r¦y³‡ÿíáÝÏÉ¡lú}@ýäOþ¶˜JœƒBÕ¨ijçï\|uÕûþÛûÔœ—Ú0µC:7ꤢU/Ø5Z³>àŠ!è†XÓ£ >~ÓdìÎ>Ô¨è}3­êïù¿Ÿä0lÍg=Ú~Äj¸›ê^øÂ¿wÚ'F[nưÕ&÷7‰”´ûð©õ,Õ({ysÉ|‚HÏ-$“XØ$ê Ð+NGSj°ÓpÙ IDAT¿”°M`^dnè00'WnŠx`ˆ§ õoôG7MŠìå; zv ]ÛÝh`Ú“{<‰â‡Žý$q{„Íʳ§ôe™Ôø­ßÚY<Çï^K„˜*W˜Wš½ Ê“ÞdcJà°æUTHA£ƒê~Ü–ÿ7Þÿ Ý,åÍ!ëý'‰Û‚¥%Ó£äžü/Egúd˜7o²Ó9Úž§Ÿþ „!µ9ß$ofòjöN!”š‡e‰Þô»`î"ÜÐHYÓç°‰iZdÒLžàÄvgV†Á$åío?öØcï©I'@0›D÷só0óà(Ë'Ù‹ ǃ‹J¹šzÉN²/Xs/öQÇâ¬ëvØfüo,©°Oî»*ÕdI`{‹Rb.)Äh’y‰©HYãTƒ ðFCòWõ?߆m°Îjªº8€jXÑFôÄ Y5²jI‹ˆÑÀtk=6çbBè‰E1˜^UõÌ3ϸXŽú>ªË>$xrËM}$Ä»‹œ[XA”ìQºœ7êío½÷½¿\ê¹<3E–³;fpÐ4dò}¶¤W“ö~… '@À{¶ W€¹ÊSyžíš‡€XKCê%°A‡¶è¤g”S7æ¡ÿiŸú©µ=y!4Ô³ŸýlŸìNx€Ú¦yxV´Ãw_sÉPá®–°£)s›ØœÈF¦è çâ\Ý‘Q*$Ýùz·¸Àíôí®§ï}Z< «Þ.?©'5Gu&š˜l¿ïw¿ûÝÜ·­¡TKntDw¸(Ud’ŒË, {{®ÅÉVpN½i˜öp§G™ªlµð[Þò–ú7}?“ƒkìœö©ˆø,±Û¬ú°UU=õÔSõÓO=%R£ßË+hV¿ç?½§ÞûÞ_2¨ƒ8+:iLRt]‡TŠðƒO&žžô5+·òVlraíînùR‡†åÔym5ÿ"×U­õX=v·‚³ «0îeÃcHÔžÿüç×ó?õS÷»[k8Nïµô‚|“¬ÉWo;Dww=þøãg~Ô~£÷Ö"Zd*x@`a(Ç妱-ʦ·,%Ý-žÍ»š-É{Ós^óš×l<ýžzër¦wÚ²K½b½íÙ·½õmõä“oc®¶ØhQìðpâ]ïzW½û]?'4ásÉ`Š1ê¦Ëê×þë!¦Çô¡zç;Þa`ðYÆK,ÆñG~ö]?[úg*r­0ü¸ý¾ßü¡ò{Ï{ì5ÝX‡è‡¿Þÿþ÷×G?úQÆ›$¸õÁßù*Šó«a¡æŽÍí7F Ç0ØK>{qZb7ɺ_¬·o¼ã?ëYϪ~ÖgÚâjæ‘M õ Ÿð¬zþóžWŸòüçõD“+ ïÿãÙÏyN½øÅ/Þ„øár<¬Çœ§âdž„èÁïË]W¢+¶ä«”‚”¥–™VõŸþée›ã¥ßï‡õêoxµ½SH¨øŽ¤\lûqìªï{ã·¾{ÜÞ}fy܆gPiîv}}ç;ÞQ¯}íkÙ•gÎíD|ð)Ïû”úÙŸý™z×ϽKòkøSUÝ×—d’ó¾÷½ÏMKN#®'ßöÖ‡êÌËឪðâÏ{qŸ8š‚”T*ã&Ä6’T¾ÒŒÓHÂéŽÛfU½áõß-­5+6Þþä“„µh`ӾчƒÏŒ  þé+^!J{:é—~I€lp†À1m‘~ß5+Ã/üÂ/¤V¾o´Æ0!‘›¨õH<µ”¿ µ!ó‚ÆöxíÍ:Lê¦ý7àÏkÕfÆCñ®%:oïàGþê£ìn2â3»«>ùyW\_B– °¿w1¦v¼—?üÐ’D²»êñÇ_4ÞNØ·ïx² y†ò¹ôö˜ÄÏ=B¿›$š²vÌ2߆®‰‡½3Zë%] @k,®ŽwV¼^c!Q\-AB…ú–oùu?;¸nò¿ü™Ÿù™ñ9!Ý’~æ»ò]³"¯åã;<ñÄñÜ]ø­G˜B¬þÁÉd;áœlÅ€;b^jц”á¢íB¸EýðÿÐYܘ>ù䓃\ å‹€s° üùŸÿùò Ÿ‡¿~ñ‘qÁræá×}¼Üý½š…=ôtW=ýôÿ ¯½ªEJ*dðÏ=L‰Ë40–P-j€ lmчHçžâõÜ¿ó\ÓB^ ÏûäO&P QK"6׸µk"W|Ñ‹>w¯³™§iß³O—–«˜R²½6ê(f8hk±(K¾“˜ʬô°hÝNÞL|?Ÿët>‘¨>ÜÀŒ² óIò¹0Ç?ú÷?ñÛ¨D&±?}~e!Æ—IðHÙ5G˜Ø-ˆ¿ù›¿A‡ßÁ1j'v ´EQxÉ‹_ÒzÛò ©!c 5o)¹±KnÁ£ëÇZF¢ÖMÈ·úàªyqŒIº˜TÕäf0þÕ8À×銢·;ûÈ]¿÷jq( 8–RÛ0­nÈôýçï^ãynÎf B¬VMàª^ß­ÞæPU ½/­&_vóy4›6UAa©‡ô¬Ö2‰mÚ‹j‰tï]‡½?ßZ})Ãߣãx‡µ¼U‰H{€Ã©üÏ€c Í>¦C#^º# ’nE“%1ÞEë‚GïC}ó½õØ UUwÇÎ[Cj*;Û'Gê)cÀr™÷Ìl¡Øo‘PÊ·úxù#9ŒòM ³áò»äA™ßÛï­ñßu„¨øCEõß™doFŸ%FÔ2gÇ©u½É"†YÁüäêÈÓÕª5?<4漌+VirHkbSpøÏ/®Ð‹ñ¡)YÂx[¬9@ýI zðPÛùtµM-ž¹™öYŸ"’SŒŽt`˜×á½H‡ï [-Ó9n._ÎNÝñv­Œ3ZaBMûj<„XhX{ …ÍIµ”(­pDhèwë3¤ ¯qÈš´,›¹oŒo8«·®ï7˜Á5ìð–*îÖ-ÙlH˲N`‹h¯ïÛL´©q\ß70æÊ«Ç)Š=]”ßµðØ Hœj´zè2oìÈ<¦M´„çðÑEY†§5ÝÆ>jOãÛ*`†•Só´+TÚÝ·ËâVA®’!Xms5»„&¬!—j—Í›”Zz:kvójètÝÂm$ôhtKw÷¤&|nO`uZ‡0Ç­¾Äge|šVË–‘o¹C̹»{aèaâé}(rUÚ\¥)wßpß3OeCT,Á½Ar7¸Îª /b4˜;:ù»}ØBðA&U¦—–lºõgC©r­HßEå=ªuhܸ™*Ý*Ÿ“*¿6m‹ ʱï°CTÿ)P*g°è°„ª˜3” 2ºÃlQ¶èΟÝ0 Zgšî9Àp‘·~'»†ÜP ±]©k«X£›âPib öÅL¢K¬ ÞçMO»S%­tÆÌ­Ý严üEÌ/±¶‡ð5½Qåp‹íA=*0ù¢Û˜™ d2éGZÕýÞš±M\qÖÎ5Öæ×nh&VT-#ØÆÚ›£w«6+â.šì¦«ž’½h®48Túÿú¬Ø4Gn×+¨`¥öuV{° ãVó“!UàùÔxUÜ03çwU™IïÖÂ9)Ƽ`Âqô¥•lþ”=ó€]\üGï*'2×ö͇a{0¿É«j1Ηc‹¥¬ÂU&çXå ü^çØ–H´BI%œ ¹¡ºÅ·Ó뢌CÚ?cV[+Y6›lû!6õ>—‰-l¶kâ›]±Aâ¨/r`-æ, âé-îuþ…0~¨bK(Ÿþ´hÄêân"´õ4ìa!“<¾¿îÚ¸ìLgÃÀK•ÁÐx—Š=îÊ 5 )òÀ bÐVìî½@v[zà3àt¾Ù¸žQGµÊ»*`ë'âd ÊL¡…2An¦ ‚¢0RWzñÜ‘ªò¼ä‡ÿ¾k½‰àUŒ·½à9ë°g_ÆHœ>ol¾Ý¦B ¬¿×E„„yAíCûœ ©;Ä:Ôœþ .h-ªÝºÌ}Ëx ¼•M›*E+iaåÂ*ÑŒº×Ÿãƒú[1£Yc“xgÝüI™f z•”Îe'µW¢(¾ÌG¶³R`:zAΩïþ9Ó­$ûf·õÜÇÔ`Ÿh’4Å.\¥o{~®R]÷“IG*3–ë- ‰mÓ{˜  ½Uåa“ú«ö{?Ͼ° +ã4+ìððçîPmC‹+ZÀÞ„Âöè Þåu‹ÑæÅ½@<Â8œ”Æi§ÌÃZÊlïSû`‰mêÞÌ+bY®Rpà™…Äâ*–Ö‘8Œ@­—Ä5:wª<ËD޾hý‰îqòô2þ.l‚) ¸ü•A9ø™f5yÞ«íX v MEì ¾Ÿž€kÖ¥k; K[_P0>9"ô3.?˦ÕR Ó>@Þkí „ÕaÝB;ÜbÅI‹5˜b—SÍ1ÚP'–ßê¸/zıšËÔ$µk§goXøU± ánª`ô íå}E Vjć‡ºî¾ Tdâ7èSsÒ0™HK®k¾!‘p‹Kùyp^—ª4&e„SÅ–ìv§ ©Zž§!Р a\ ‡|ÄÃAzV7Ë'…ð0äö×ÒY/DJü¦0-â%*Ɔ*ÙœåŒG’v·çc_\ÈKÑLÊÁ­«ŽQ/…À^å þrÂ%5“OîÛÊØv•Çm²/h¾¸+\x>e‚¬½ëjlº¼òLßÕdHœ07”52u ª3¬*âa™3L­'G+Å®Gmqóä²¼e<œRŽJµÔaBi "×ïŸ$þ´MC&-¯o‡òÔ·­Ü s× ¥FÖ®Œ°õ56ÝdZYK0×Öƒ 4¦¦°Ñ­¾éËì®—ƒÒêÒíXðõ[‰ûÈVG\¹Ë”>óȰ—(üù çòdD\‘‹Y3 ÌLªîf+ÙÕµÔåY~[\…›¾`7ä÷8µWH•:ÐHÏ%¶lå'o‹ÆóÛžvSy(P{T„K—¨òÍäà2S‡ÍÿpÛ)3êJR31_Û˜ãÀÖ¬¶8¦¡å’°¹–%^ŠrÆz´ì]®¿²ôw^×´9Ó Æ_·u}N M¡œk2ßA“Y¯µÕTù´2'bÇTtîf¦E%’ôyÕcD0xHR4•ç dV᳂.­(†9JðÌsd(ôÌ?CcªB9´^Œ_] D­©\A›Xû3Ï*¼€ºŞÇù Ó*ÞÌf•AE€ ·rk*F´tjœH¥òÏ’Nˆ'Õ –Æà×<\טjÉD{ô”c„|v!tÞñàÁ¢·ŠBjéѦ’=\2ŒÀ>Jdd>ØÐ9Wu¦TEqŽQë¡YXD!*øë ¹Y ÄVSyÞ0VÙ4P3}'K‰kQ“ EL t8À/êÓȸ;Ôî©î« ’ÊÖ_†T1ÊR ¡«gˆ^XV”l ¦óÖz†›Îí0QI(Qu×Z "–§¼¾Ùœ*µiê«X›n Y(mm‹˺]LÿX8§u«ëÀM-ïý:uR]â ‡Ðvéðï(ç—´­p£XVWˆ>8Ç ?@w€Ú]*4,„Z ¬4hå5*Gìb¸¶'¢Ë‡U&ï¢(*¸…Ťo‚óïÙÒv%ÂÀö“ÈÑà -UWì‚2×Ug'Ô÷¹‹ú² Ÿ¤+±56Òr•œBíØ£º´ÐÐm2E”´N'A {¢ä©ŠƒPI7æÌÏ^…ˆ ´»ƒ—{7êÁ ÁNÝrUº‡#Kß C;Œ ‰ÓÆwÍ0š„ïš<î®nW²)RÝãüï“;"úP6Å-ÁnNƒË@r.\Ëÿèbiney‚ð–yˆÁ°¢2+-áƒ/$ýŽmáI8Ru°} #|6ØucŠL¾‘¶¸ugí[o"Ñ'•©á¶P¡P …ñ<ÈÓô—ôÀCôOòMÁK€M’w5zûvæ³a†’4®¹š<«ë_F~`¹û"ÔAÖþômUœA›ð‹×g±;ÓAŒá°€‘úý y ê¥EŽ»”ÔçÕàÛòÏFäµÇ5ÚÐYÚî%‡ßLóV;§ Ix5­Ø+VéðM\gÊ«ÉåBµ tØ0Bu vöSá@U‘„zS5ŸÞ›¥;y“OU%ÈP©µl R§ ¢/i'Â¥aànÅÀ;ƒ˜â6«‹ŒJÄåaMÑ—72̓”",vodJ À Ò¬ˆS;pÆeP— $ÊL± «©ã0*¯ñrK°EÉ!Ã[ð^ÅàÏçÝæØ= ì'çÚÉ÷3smW¢¹²îR‰^Ää^-c:¨²`¾<zLEõ•KÉî0&&H¼†C­Á UªXIáB)€T˜'‹é{Rm’„H©C2‰U%²±¸Aî *³òÃí¡¼ÜÞnÌ¥…Ø=ü„10U*+*”ý ˜In•LXÇ:ïfÙ]Yµþ=¤5æJ6o«¼Ü Tl°"F¦ìhØå¡¤‰oŸ §*ð;1 B,6uÿ솮ÂûÍÊn·îL”†ètÑ$.Ù) —Ûïý.Ü%ƒW´Â Š[Í ò*‹Ñù Jt’)ñ:áœ$.¨ (`õCÃ@`1$ÝgÄ!1s)–ÛC%¢pø|ÞrñÆ÷ÜpXI¶B#Ž tÃtz¿mÜ,éôþĺN9ÖIónk§¥ïš9¨õ¼í“ÈÕ“HH`¢)#ˆƒ9½»‚óPÙŠ †=L«¦ÖKÿð\%^“x%äP1!;ƒ£J`fçȦ#²5¹Ú˜_çX™3¦ü¢[[èè“ÝæCψú“Z}2­€±–î,„gÞ"³O³FÓåöâ<÷€ªËã°é¢<ÑJItA=!5zMµ8‹þËÜ„£Y­…ö°ä hÕòPƈ㖄Ãh}r˜Q¿¨éŽK8æ¶JŪ7J§Í6„UG ê"ƒn©*JÈ&‰¸Ÿ%}T]Hu“l´5&WïÅ\Oó\8Ýút·b‡êÇðê´ïÀ+º‡ìc1=ÕmÍ.pÛ1´àôÇÔz*Ìø¬T@HÒæÙ]P•†»4OÔìÀÄ;#:‹ „!Ý]!éi•$™|Õ®mj` ô}:_Àm¢ïl¡%˜áµ{µˆïF>-ÒW'ž'1yƒÐº(Ý1cOO5ÛÄæ®à܈ ;À}æ[Ï>9›rÀëv7oÿÐÀxH³¿Wºƒa»AçJ´•éÑs‘ÏQ‰NÅ“oï.@$ê¸QÊϹ„½Ö›ÜP* 0Y7¯°ÍdÌŒ ’¹(.:¬‘HGÌ’*Ì1âóIÐZªÅÓP°xÔ)WDyŽTFÊ>áê%¯è²]ÒªÜ~zÎSð@Z*=PŠÔÈÍ#üÑÐ 9¬šGÒ0¬Er/4:¹HÏ[CT'S>ƒ-“†uËmàµÓ¼³ùï-d*Á>äSþÃ~¦%XeO‹ôyÓãô(aŠGʯõk„Æ¥ûœU4™ÏaØ„u†YÛHZ<¢¦ëi\Õ3%ëBOÛåðçÅa §&¬Zº€•Ź&5:þ@÷)¡íh0È®¦uPØÃ‘‰ß(q¢kºàsت6RøQl‹1ì¼”ŒÊdœª×é,3 nqav Ù¸ ô:žÍ_Üà6gñœ7;Ú‡5n¨;øwÙ©UELv‹ë7—|ž¹éš З'*×ðúÆÅíéö?mj“›ŸÚÎîŒUP¨Òaº ×l<ÿ5K4¥`âoã3öÙZog'pâzÌe;\TÀÎ6q Zë%‘8ãT+F¾ïøÊM)}ãÂŽþ‘œ? "(_Á-Wa_â?‚ê3"È|#•—qW­ÎÊ ++¾˜± z³ ±¬“À1¹«a€šÂ›dÈ8eygc±‚åQnC¸Pµ€Š” =ñ½7Ö¹V ¤Mðiƒ¼&¯«RÌóð”î`ØØ¶vȤÕbOÂÍëSr©dÚ‘,Õkت;‹¡K';Ã’ˆÀŒ 7‰à}r¶@¸ó3*» µÐu†¼‚q¨ „³—ìû' P2!]Ê«,µ´ÚxãINŽÉ‚UœØOÝñ¦@8ꢑ uÿÂ;‡ªu€%Ù‹«‹+CƒYñ—Á!!V$$®á°m6ƒŒ©a×|ÇW+å ÌB¹c;]‹x¡2qfš©_ºXwTì)ºB3‹I¸ÓøÝ<ÅÕàQé mI ÿªÌ½Tþ"åïi¤pΙ5¯Õö¨K-{}Õí"ÐQ&3½zZk2 å*‹Nv6šÈP œÄl£Tàë 'îðÜÍꆠ•ì¹2¥È èØ"p¹’éÄÈŒ9í¸Òw(V±¹C˜ôšLL’ùôò¶Ö }¬Ð¦–\(ž÷¡†Ò×4†]XÓ„! vµ— zYá#¹'âÈàxÎ&Û_‰ø¢Ê\åuÂßϱš—±]T&pYŸŽÔ#3ºÜ¬E­ýŸyGF•]ærák9Z5Ÿ „U Þ¦Û+HÎ’#,ZËãácFe5|UI´`eJ{Ms(k,´4á¦êÞb±—9¹BÐá.$¸àÞNëó~ÓXNUi ’$…ùŸæÚ)Éjú4Ť:¬ˆÖ0}éÀöeWJF_J5ÛOuó¶s_Bœ"Ÿ—íl¡Žß´üPPÒ­:³#M‡oÏYÊH ,ЍâXÃwSåT±iöÚ{Ÿ¼*¿.«øÔi)ªѺgNP‚ÔÏüCo<À¬ej»éÒÜ®,³ЖRÔü‘ éµJ´ºª—±ÿÏþÄ+ÆàãÜÉíAÐBàF8€yÁ1fÃf‹ê×{P"ø™,ÞdS‰Ô¶”GOâ”ÿ Ê‹hÄ—ž9d]H Á;:‘^2Í«ò¸huTåÕJ˜JÎõeC•ņÊÀœn68&Üt) ©GÒ†NW–` Ͳ8 £¶õÔ¤OéGÖÙðÞc-—èÁh÷`ñe¸ÇTšY1±þ ÇðŠ`!q¶EñÄhßšî7ÝB@ÕáÈÄa±T2yQ™ýÓ¤Ëh¾hä*YÃ"t©<ÄTpŽÄÉòô§ýc‰ ‹ÀwȃÌÙ'æc´]½*gÐVéРܪéIDATÌí:Œ#4§ëºâ,-µâAø I¹Þ$g™Ð Åî2âºVÔü®:óÑ”–‚¤Ô–õÕ3DcO=Sæ ã@.¬8]„2Ô…S¥!Kˆ¼Ñ]sÚ60 µÆ…¨UVÏŒ$2J‚¢¹´€Ç.x+  ¯P•ÖdgLЧ÷ÁŠ„é¿2[<äãø¼wFÿzã¸WÈ8Eß¼Þd‚<§:`]&tŸ²}hŽ( ;|ó_ b£}¡-¯#ø –”ô>ªS‘Àç$¯3Õ"·y;4ЪÅmE5Ó`Ï¡ wÖ·"¶ÃpüO¿_¸Äô@VÎÆ§\é‘ÛYØ…ë$ú9䃻æ*l%Ó7]¨óù5¤*¿¤ÓH\@_±îgÒSÁbÂÔ7Yã—h™dB•Që)un/¶Ó[zx¶`ß©-Tt â3 /ÕW±ÔpOÂué»ÜêHqxzrŽheÏWÌ'}èM¡D!™ !–ðƒ`¶#æYØA3õ­ÃIâXDFÏíMMáÆ¢Ä ó0¤iâ †–î|ZŽŠ iB|; ‡ez-€ªºæ4yÑšÒîÊB[J.Ò Ú¶"ͱTú«vý!WÄwü®ÖÕ͉x“8h0û–îÁ«2·Žò—{5.ðd–÷1?Ë Lù‹ÜØÌÖ… 6 èG«Ä£Ž-š`­¤GW†ï݉¶©Hm•|¶óõ±gèùƒÖt…I^pÓݺ…9ñ/Ñ”—ܨçĹáÞ’sÊ8nÄV ØIÍQýa ˜¡W.¿.šCÓæòHJ•÷xš?[µ Ì/ªL³„x¯/¥&¦®'çÓ¥6À˜€G£ÀµÁ%Õh².5HJõù>ž®é?ˆ0•¥Ù¨`B­Ê Ã0Ù¯Ði@lðU“ŸñºK‡b°ì€dü÷ôe?y—ÕÎuCp.f…ˆ_¤l[ÅЊ«ø³/¥¾LŠ µjªŠAQt”t2I ˜xd0Œ”VS6ÉÙ{[g]H/(ƒÀeçüÙ´¹nfÊñ 5<ýXyvLܵ;ý¨X–7yœÅ‘‚Ì›ó:^]Æ}åmYØðÉOo ~Va†A UéG6ШˆI\žøâ˜\¤pð ‚û´Nj[œœéáwì&NèZ™ž€çàj­šÈøŸ¬ÛCA¢d‘ýjtì¶<ßâY]®¿Õ¤©²'¨™ ø¡H·³NŇ&çôºiuD’°›Ñ*J†a^-i{XÄ4>^Ô=óïghÓ~u018ÂDú€½îæ²`ƒ?-ù»Ûf¾¿V>`Px%y`•z*†ÔIŠD˜—äzÿqiB$†%ت”¯<ß]#9MÿmQ·¶IÄZ/qmij#×EE`|7‡Ã`TBÍ4­NnÏh£œ°íü®Ø"rfð+F•¼ý:Tœ“f:I8ˆ©¸Îy»5ë° Ä®mw*EÐLŸ?7´<‹ æ•I JíðÛ*¼±*,jvñn Qt0€(ÎvžD|º¸zK©ÇÆÔÖúEü“ç#±Ldm˜ß~Ø« #óš§À=0ïIhÖõŠÖ ðžpªIÉ.ý3£@ÉáHÍ RˆàÒ÷šœÑÐFˆÛŠž1·*NÅ›øãü÷r©\<4‚:Ç?ø™Nó‚²þèñû~Çm‚t)´·•§ öMàŸ˜Ú »Æj×h‰Oa^… AöQrwrq ZW5 $„æÖe&Ÿ±„Vb†¹GwÝ«[ó¡EÀ‚lÓI(ºŸáÉҟƘ-mÓ ˆóÖ*ÞWr,äPÏFùÂgXÛœ* Á½*˜µ¨…Z,¡…[¥]¤Ì†¬güA¡ª:¤QGíAN]·‡šéF¨ð0¯I"#/ñ~L°Ô# ®¼Be)/Ø19=/°q,4 hòŒ ÎñÏÀx<&²Ê 3¦|õøgwÆ5«ôDôC˜÷É¿S_X‘pq‹ê—C×…¡ªZnykbªˆv RÈŽº©–gÞLW²^UŠÛŒ I¶—»a—4D¨6û.žØîCsáo¡*LJGUpüàƒ‰N“\`Ô:,8Ý#DORŒAP;±µ ëÊ|7äØNTàjj¢¡˜n(Ÿ’r%Ä|b¼§Sw;.°Â!oT¬×sHR~tßZòMDÖÁتÌΌ։„¹juN&DzΖ&b¹³ѰöUrmÄwg¢‹‘úù¯‡·xwÁ|àbŸ!;쿃âôw#H¸9HüÂqØèrHY¦ªÏÍIs…£ÝWQŽ1ÐNn‘©Õ2u!¡®1oìc”(T“°8¢£ e5/ujçﯸpÁCPÌ Lìü#†¶U ‘=fNaU‚Û&Æk‹rHˆfB1!Áo<“ØÞl‹v•ŠK}cÎb1Š Íï¨ÈÂp¼´ÜÄað-éÏwŸbÍZ®¿¬ªtà)–\ns7‡Æ{7¥JUèææÅ8;ÇNÜ>1GNúŒlPð‰ ßEÀXC’ÛË‘µ“]¡J VòªiVßô¹Ö”»­û¦Ñ´õ4(—lYüEVÕÅ’g¨C Y¹ž+‚Ø{iȹ‘¿Ãϼ »«¤6™²êÇM/ýâA]dÓ†‰8óÝš•!}ÅìoÒÏj!Ҷd!‹3ή’GnZW/îT‚¶šˆò3¥¯.’üB4‚Å( àÎ# «.ž‘·[™O•`ß#Lën)=¢Ë©RÉÌ /Ý/ËZ#®Ô¹›´H±Y1Ò1dÕ±ÓŽ’½ýñgîÊdãPbúy3M‹ó4ýåú«­Õ 1¨bUÍœ9ÚK&ÏÚ‚­w0‰ÖÍmÞC¹.ÅccÈŸ¢?…òsÆZÖ†,~©ªœ¯§ØbÎ:6‚5N:¹g¹œiN]¥4©Uà€&@<7òñ§í‹»õùÕÌvP|ŠÚ1m-»)»¡©‡¥ð8mÚµ’h#—.;'éa/@f@ðg¡ Eâ$æó, ëJF IONWfRÐ’Åí-c´^`Â9!–[—Z{(‰Zfð¢Ü_MQŽOx§$Ի꒨Pî[‰+î,K^rEUDdn1ÕÒ[Û”¼€Kœ*öËjÁ›§S¨ÙQYìäu=¦CÌcŠá?Uœ¬'4‘d$rË!ˆ"çÊVt!ÁÌ1Ëû.ôò‹®|}X†`Z¯® ‹‚m·²¬è„¶¨¥¾ÜŽCIÅQ)È.ø0ÐǪâµ`t „–îzx³Wí«Cг_G!tUÈ“æ3jÁ÷[>÷Ôô–ø‚â"‘Pc2.ŒÜáH2A.Aî™>vû‚Wñ‰^jζó;fšÝ–íÕ55åL))Õ¤ZÙê_Û¸;{”jøyêØsìž:IÛpb_ÓŒ@@~»ù,åK<×4«b&þÝv\¯qüûKˆÈµÂ×Nß ¶£I<Ç]BO]ˆÕÙ¨x—Âsµ]±XyŠô4ôHZ`›`ÛA¡R½1j9œá Ë•HTó÷«d+7ũڅ VSs(€ðVaŒJÝÆFsó5ï™6§qa(H÷{ˆ`¶F •__|ÚNbøQ (ãbÝr‡„|JÅÌ0Í_.´È½JDÜâa84‰¦ {,Žâö%!9ƒËJ>1TÕøª–ïp½§H±›N’&ŸÑÄ9‹jãÕQàœ6"¸Ý"V`¦yzXB™âÀ¡<ÍÝÜÊ>q$"»*DlRäŠ0'#öªÍYûþ¨#ZI4ñí0LDèa žž•óy Ì¡«=øZ \] lš´.ˆ¼.¨ïoq'š„iT2^]ôI¡Wx«Âe‚cT¢I÷vzž?dy娮ï ›¸Èò›Vy_.‰Êï !ÝTý-UBë¢Þî1“%ø¹Õ*fuŒ¿"-`œch3sY- ù|óRr…* ¾slP HZbM®7=dÂO¼Uâ¨Hé+m-¿Ë½=*¡G!8µµç#Ïü^e3â‚;Jì4ma/¨L4|Љ­CUŽ]–K¶˜K‰PU¦Ìi°ëºÀMmPC]ôÏ¡Ê.&­#TË© ‹²¹ó;"7£è(ä¥!ê´]¡¶ÈÈòüš+·ÛLÂȾ/,£„ߣ–òŸžÂcÂ{ù'ÿP ÏŸ{Þ‚g 8Ûð‡9>Á¡dvHC HXK±î ³õz¤iÉÚ„ƒúæÎ=T—î&Á!Ç;’‘'ëàᇩ Ö’ Wak¡²ÕP§›ò ‹/§æWÞ1Tn`%róælž„ãfƒS®€;p#'ܯîx+kd¸\´¹Q¡{Øæ p‘æf,i©•è1éí‘ãÎ:ár†¦!‚è4“oˇ_ ‘ IcŠ`-1`hQÝ9 vH`½ÛÙì—Ö~&¥ˆñeƒÊ`¨8ÕÝœ6¦.V6Å£axçÁ´*ÛQµßPA8¢mþÃé0$9’J½á-Ùć›™&eÉÕEè4Øk³IlKÎ.Ìw1&t™{LIBóôŸÈàásÉ^U¢J*« K[®ÂS³ Ñ1ÞÝ$J‡»"M½­¥³oÞ.Ä\ QzÊÒ¯L$˜ãíû&±Ó”¸[G‹=«˜$1BoÊm² i’Zg@jÒàB]Ø}´æ™wñey!—Εâþ€vŒ"¿³ Àm–É42¶@?‹õ3*нÝ%1ëS´¹JŒ|2ÉM’r ô¢ „ÓvH2FD¹v—vÉîñMéhÖß]ðÕkÏŒTm")õ¢¬@ˆFÔõ°‡„)¥‘O¢3w—t!¬Tf‹:£s®ïvÁ9¹5¼7¹¢(Ö80tD*ÔEÞ.\ñaÏˬÊx¸×êå(?î*°»`VÃ.ÄÁä¹kÖʸ§!Šá –aÀú¢ž¶u§ÍÖ ¾Ÿl¶éf=œxhWÎc]öÆÓ=Ÿ"Y0s g*X[‡µ •üIƒ‘¤…ËrLlCDzòv³üÛía°†Ú‘—'P‚ù$$›!O;K^„[ªÓßeÄmy&í¶CÖ:¬ºlÁ|èPBßqG„[Éz‰¼ó&ÅôŠ$U|d† ç˪¯DKŠ„¢J²¬ñ¥„kDá“”J“)?4Åû®ë⹯æ%Q¨<Ý@âùÍÿ}Peæ|á" ábtß>Œh¶K± ©LX¥Ø®ïFZ¾`T/ðäJµ¿@ä=ä]ìÛ9À˜D¸ÒëÃEÕGp9¥cnWP"NaVÌÚ9X—“p *ÍD9¨?Í}з¸–ùKëÍ®a $?b‚wfQ|NLšs7/ðIZW·inWóEð/‚2›,d*E`Î:[¥9À@ÇÍÙAÆi”Á‹6K>`Þ¤ÙÒ︶>?]¼£ÓÜß9ùVÈc*°X]ã0‹Þ0Ô"¸ƒ“Ƙ¾‚Ä&éºÊš°F_Pœì’^ü®ŽŸwc¢Ä´´mº:dC:×¶eš ¸üÎ<Ó¨mõQyÂñèe­2Ø99†[^ÀXˆÛIvY+€˜÷€XÂn[÷é;7h%•ˆÃmŠQ4ê:L7Ù‰%ÇÕ+èê”ãýwÀ\m€ÑåSÓéÎÓÒE4"͇¦ú¥f¢kèçõ9eF"Ïjs¥K®B ä-–` ù›:‰ëáOL ©p5^ BÑ3ç !„ÂCg9?¾´À͇C0­â[¡Â­]|+ŠSe°Ù§Vd]q”†ª¡\¹a-Ê «ðàß{þ^R>¸†!Ê5\¨NÜhrfŽÌ.ãŒUU 9§Spª##b¨dï8Sœ5@O7^â€a¾e2Èæž‰WðæZäümÄq=ˆýû¨ýk·í@Õ´Aˆ¼ ”³p>…5|SçÒ›k\$aìÉÉÑ«”4h{À§Æöþàü;j¹»ÌV gLeSàÑùìVUè4e%wÊ+ ‘Ô8ƒ¾wÆØ…w1@ŒyÅ4¯êÿ#”]ò—IEND®B`‚icedtea-web-1.5.3/tests/reproducers/simple/simpletest1/resources/PaxHeaders.24993/favicon.ico0000644000000000000000000000013212574544466027056 xustar0030 mtime=1441974582.565016785 30 atime=1441974656.606869093 30 ctime=1441974670.132024783 icedtea-web-1.5.3/tests/reproducers/simple/simpletest1/resources/favicon.ico0000664000076400007640000000257612574544466030151 0ustar00jvanekjvanek00000000000000h(   & % % & ' % & '&&'!'"(""*((()(=()>()> E? E E?@? VFGGHG W!H#H T%I #S "Z)J+K )f&|'| -s-~'Ÿ&¤ 7{/•-¦0 1§ #Ö,¼9—6¢&×>'×1¸.Â=”0½;Ÿ)Ø8©*Ø*Ø<¥-Ù/Ô>¥6¿.Ù8º0Ó.Ú@£7¿7À9º2ÔA¥1Ù1Ú;»D¡2Ú<»A¯Cª4Ú;Æ7Õ?¼6ÛA»@Á;Ñ8ÛB½I¨AÁ9Ü;×D»K«E¾<Ü>×=ÜH½P¤GÃJÅL¿EÙOÀX¦KÐJÓPÆRÀRÁMÓRÆLÛRÊKàVÀMÞUÇWÁWÂXÀVÇSÒNâWÇYÄWÌQã\ÃRãX×VÞUäUäVäXÞ]Ï_É\ÔaÅ`ÉaÊYäYådÅ\ádË\å\æ^ágÅ]æcÜ`æ`çjÈeÚcácãjÍbæmÈdèeçfçhâqÉiãpÎhèhéjãièiétÊkélélêmêwÐoêpêpëpëzÒtæ{Ñsìtëtìwìwí{í~îí‚ê‚ïíHNV]_Pq‚pˆ”£¨°LTYZB-EvG3U’¡§±µWYgI%F%'…¦±¹¼`heA > [¥¶¼ÄkoR" =  @+»ÄËswO D JÅÌÑ{€\()K'*f.0žËÓÖ|b^luŒX6n¤Žy™ÉÙÝc&)z–‹ma“·›24¯Þád 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.5.3/tests/reproducers/simple/encodingTestsĚŠČŘŽÃÃÃÉĚÉŘŤÃÚŮÃÓÃŠĎŽ0000644000000000000000000000032112574544466037455 xustar00120 path=icedtea-web-1.5.3/tests/reproducers/simple/encodingTestsĚŠČŘŽÃÃÃÉĚÉŘŤÃÚŮÃÓÃŠĎŽŹŇ/srcs/ 30 mtime=1441974582.564016773 29 atime=1441974670.15002499 30 ctime=1441974670.132024783 icedtea-web-1.5.3/tests/reproducers/simple/encodingTestsĚŠČŘŽÃÃÃÉĚÉŘŤÃÚŮÃÓÃŠĎŽ0000775000076400007640000000000012574544466043251 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/encodingTestsĚŠČŘŽÃÃÃÉĚÉŘŤÃÚŮÃÓÃŠĎŽ0000644000000000000000000000034312574544466037461 xustar00137 path=icedtea-web-1.5.3/tests/reproducers/simple/encodingTestsĚŠČŘŽÃÃÃÉĚÉŘŤÃÚŮÃÓÃŠĎŽŹŇ/srcs/EncodingTest.java 30 mtime=1441974582.564016773 30 atime=1441974656.606869093 30 ctime=1441974670.132024783 icedtea-web-1.5.3/tests/reproducers/simple/encodingTestsĚŠČŘŽÃÃÃÉĚÉŘŤÃÚŮÃÓÃŠĎŽ0000664000076400007640000000552612574544466043263 0ustar00jvanekjvanek00000000000000 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.5.3/tests/reproducers/simple/encodingTestsĚŠČŘŽÃÃÃÉĚÉŘŤÃÚŮÃÓÃŠĎŽ0000644000000000000000000000032612574544466037462 xustar00125 path=icedtea-web-1.5.3/tests/reproducers/simple/encodingTestsĚŠČŘŽÃÃÃÉĚÉŘŤÃÚŮÃÓÃŠĎŽŹŇ/resources/ 30 mtime=1441974582.563016762 29 atime=1441974670.15002499 30 ctime=1441974670.132024783 icedtea-web-1.5.3/tests/reproducers/simple/encodingTestsĚŠČŘŽÃÃÃÉĚÉŘŤÃÚŮÃÓÃŠĎŽ0000775000076400007640000000000012574544466043251 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/encodingTestsĚŠČŘŽÃÃÃÉĚÉŘŤÃÚŮÃÓÃŠĎŽ0000644000000000000000000000035612574544466037465 xustar00148 path=icedtea-web-1.5.3/tests/reproducers/simple/encodingTestsĚŠČŘŽÃÃÃÉĚÉŘŤÃÚŮÃÓÃŠĎŽŹŇ/resources/encodingTest5-UTF8.jnlp 30 mtime=1441974582.563016762 30 atime=1441974656.605869081 30 ctime=1441974670.132024783 icedtea-web-1.5.3/tests/reproducers/simple/encodingTestsĚŠČŘŽÃÃÃÉĚÉŘŤÃÚŮÃÓÃŠĎŽ0000664000076400007640000000511212574544466043252 0ustar00jvanekjvanek00000000000000 encodingTest IcedTea ěšÄřžýáíé=!@#$%^*()_+ú)ů§.-?:_\"!'(/ěéřťÃúíóášÄźžÄň;+ĚŠČŘŽÃÃÃÉĚÉŘŤÃÚŮÃÓÃŠĎŽŹŇ1 icedtea-web-1.5.3/tests/reproducers/simple/encodingTestsĚŠČŘŽÃÃÃÉĚÉŘŤÃÚŮÃÓÃŠĎŽ0000644000000000000000000000036212574544466037462 xustar00152 path=icedtea-web-1.5.3/tests/reproducers/simple/encodingTestsĚŠČŘŽÃÃÃÉĚÉŘŤÃÚŮÃÓÃŠĎŽŹŇ/resources/encodingTest5-ISO88592.jnlp 30 mtime=1441974582.563016762 30 atime=1441974656.605869081 30 ctime=1441974670.132024783 icedtea-web-1.5.3/tests/reproducers/simple/encodingTestsĚŠČŘŽÃÃÃÉĚÉŘŤÃÚŮÃÓÃŠĎŽ0000664000076400007640000000472512574544466043263 0ustar00jvanekjvanek00000000000000 encodingTest IcedTea ì¹èø¾ýáíé=!@#$%^*()_+ú)ù§.-?:_\"!'(/ìéø»Ýúíóá¹ï¼¾èò;+Ì©ÈØ®ÝÁÍÉÌÉØ«ÝÚÙÍÓÁ©Ï®¬Ò1 icedtea-web-1.5.3/tests/reproducers/simple/encodingTestsĚŠČŘŽÃÃÃÉĚÉŘŤÃÚŮÃÓÃŠĎŽ0000644000000000000000000000035612574544466037465 xustar00148 path=icedtea-web-1.5.3/tests/reproducers/simple/encodingTestsĚŠČŘŽÃÃÃÉĚÉŘŤÃÚŮÃÓÃŠĎŽŹŇ/resources/encodingTest4-UTF8.html 30 mtime=1441974582.563016762 30 atime=1441974656.605869081 30 ctime=1441974670.132024783 icedtea-web-1.5.3/tests/reproducers/simple/encodingTestsĚŠČŘŽÃÃÃÉĚÉŘŤÃÚŮÃÓÃŠĎŽ0000664000076400007640000000405712574544466043261 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/simple/encodingTestsĚŠČŘŽÃÃÃÉĚÉŘŤÃÚŮÃÓÃŠĎŽ0000644000000000000000000000036212574544466037462 xustar00152 path=icedtea-web-1.5.3/tests/reproducers/simple/encodingTestsĚŠČŘŽÃÃÃÉĚÉŘŤÃÚŮÃÓÃŠĎŽŹŇ/resources/encodingTest4-ISO88592.html 30 mtime=1441974582.563016762 30 atime=1441974656.605869081 30 ctime=1441974670.132024783 icedtea-web-1.5.3/tests/reproducers/simple/encodingTestsĚŠČŘŽÃÃÃÉĚÉŘŤÃÚŮÃÓÃŠĎŽ0000664000076400007640000000375112574544466043261 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/simple/encodingTestsĚŠČŘŽÃÃÃÉĚÉŘŤÃÚŮÃÓÃŠĎŽ0000644000000000000000000000035512574544466037464 xustar00148 path=icedtea-web-1.5.3/tests/reproducers/simple/encodingTestsĚŠČŘŽÃÃÃÉĚÉŘŤÃÚŮÃÓÃŠĎŽŹŇ/resources/encodingTest3-UTF8.jnlp 29 mtime=1441974582.56201675 30 atime=1441974656.605869081 30 ctime=1441974670.132024783 icedtea-web-1.5.3/tests/reproducers/simple/encodingTestsĚŠČŘŽÃÃÃÉĚÉŘŤÃÚŮÃÓÃŠĎŽ0000664000076400007640000000464612574544466043265 0ustar00jvanekjvanek00000000000000 encodingTest3 IcedTea ěšÄřžýáíé=!@#$%^*()_+ú)ů§.-?:_"!'(/ěéřťÃúíóášÄźžÄň;+ĚŠČŘŽÃÃÃÉĚÉŘŤÃÚŮÃÓÃŠĎŽŹŇ ěšÄřžýáíé=!@#$%^*()_+ú)ů§.-?:_"!'(/ěéřťÃúíóášÄźžÄň;+ĚŠČŘŽÃÃÃÉĚÉŘŤÃÚŮÃÓÃŠĎŽŹŇ1 icedtea-web-1.5.3/tests/reproducers/simple/encodingTestsĚŠČŘŽÃÃÃÉĚÉŘŤÃÚŮÃÓÃŠĎŽ0000644000000000000000000000036012574544466037460 xustar00152 path=icedtea-web-1.5.3/tests/reproducers/simple/encodingTestsĚŠČŘŽÃÃÃÉĚÉŘŤÃÚŮÃÓÃŠĎŽŹŇ/resources/encodingTest3-ISO88592.jnlp 29 mtime=1441974582.56201675 29 atime=1441974656.60486907 30 ctime=1441974670.132024783 icedtea-web-1.5.3/tests/reproducers/simple/encodingTestsĚŠČŘŽÃÃÃÉĚÉŘŤÃÚŮÃÓÃŠĎŽ0000664000076400007640000000446112574544466043260 0ustar00jvanekjvanek00000000000000 encodingTest3 IcedTea ì¹èø¾ýáíé=!@#$%^*()_+ú)ù§.-?:_"!'(/ìéø»Ýúíóá¹ï¼¾èò;+Ì©ÈØ®ÝÁÍÉÌÉØ«ÝÚÙÍÓÁ©Ï®¬Ò ì¹èø¾ýáíé=!@#$%^*()_+ú)ù§.-?:_"!'(/ìéø»Ýúíóá¹ï¼¾èò;+Ì©ÈØ®ÝÁÍÉÌÉØ«ÝÚÙÍÓÁ©Ï®¬Ò1 icedtea-web-1.5.3/tests/reproducers/simple/encodingTestsĚŠČŘŽÃÃÃÉĚÉŘŤÃÚŮÃÓÃŠĎŽ0000644000000000000000000000043412574544466037462 xustar00196 path=icedtea-web-1.5.3/tests/reproducers/simple/encodingTestsĚŠČŘŽÃÃÃÉĚÉŘŤÃÚŮÃÓÃŠĎŽŹŇ/resources/encodingTest2ĚŠČŘŽÃÃÃÉĚÉŘŤÃÚŮÃÓÃŠĎŽŹŇ-UTF8.jnlp 29 mtime=1441974582.56201675 29 atime=1441974656.60486907 30 ctime=1441974670.132024783 icedtea-web-1.5.3/tests/reproducers/simple/encodingTestsĚŠČŘŽÃÃÃÉĚÉŘŤÃÚŮÃÓÃŠĎŽ0000664000076400007640000000472312574544466043261 0ustar00jvanekjvanek00000000000000 encodingTest2ĚŠČŘŽÃÃÃÉĚÉŘŤÃÚŮÃÓÃŠĎŽŹŇ IcedTea ěšÄřžýáíé=!@#$%^*()_+ú)ů§.-?:_"!'(/ěéřťÃúíóášÄźžÄň;+ĚŠČŘŽÃÃÃÉĚÉŘŤÃÚŮÃÓÃŠĎŽŹŇ ěšÄřžýáíé=!@#$%^*()_+ú)ů§.-?:_"!'(/ěéřťÃúíóášÄźžÄň;+ĚŠČŘŽÃÃÃÉĚÉŘŤÃÚŮÃÓÃŠĎŽŹŇ1 icedtea-web-1.5.3/tests/reproducers/simple/encodingTestsĚŠČŘŽÃÃÃÉĚÉŘŤÃÚŮÃÓÃŠĎŽ0000644000000000000000000000044112574544466037460 xustar00200 path=icedtea-web-1.5.3/tests/reproducers/simple/encodingTestsĚŠČŘŽÃÃÃÉĚÉŘŤÃÚŮÃÓÃŠĎŽŹŇ/resources/encodingTest2ĚŠČŘŽÃÃÃÉĚÉŘŤÃÚŮÃÓÃŠĎŽŹŇ-ISO88592.jnlp 30 mtime=1441974582.561016739 29 atime=1441974656.60486907 30 ctime=1441974670.132024783 icedtea-web-1.5.3/tests/reproducers/simple/encodingTestsĚŠČŘŽÃÃÃÉĚÉŘŤÃÚŮÃÓÃŠĎŽ0000664000076400007640000000450612574544466043260 0ustar00jvanekjvanek00000000000000 encodingTest2Ì©ÈØ®ÝÁÍÉÌÉØ«ÝÚÙÍÓÁ©Ï®¬Ò IcedTea ì¹èø¾ýáíé=!@#$%^*()_+ú)ù§.-?:_"!'(/ìéø»Ýúíóá¹ï¼¾èò;+Ì©ÈØ®ÝÁÍÉÌÉØ«ÝÚÙÍÓÁ©Ï®¬Ò ì¹èø¾ýáíé=!@#$%^*()_+ú)ù§.-?:_"!'(/ìéø»Ýúíóá¹ï¼¾èò;+Ì©ÈØ®ÝÁÍÉÌÉØ«ÝÚÙÍÓÁ©Ï®¬Ò1 icedtea-web-1.5.3/tests/reproducers/simple/encodingTestsĚŠČŘŽÃÃÃÉĚÉŘŤÃÚŮÃÓÃŠĎŽ0000644000000000000000000000035512574544466037464 xustar00148 path=icedtea-web-1.5.3/tests/reproducers/simple/encodingTestsĚŠČŘŽÃÃÃÉĚÉŘŤÃÚŮÃÓÃŠĎŽŹŇ/resources/encodingTest1-UTF8.jnlp 30 mtime=1441974582.561016739 29 atime=1441974656.60486907 30 ctime=1441974670.132024783 icedtea-web-1.5.3/tests/reproducers/simple/encodingTestsĚŠČŘŽÃÃÃÉĚÉŘŤÃÚŮÃÓÃŠĎŽ0000664000076400007640000000456312574544466043263 0ustar00jvanekjvanek00000000000000 encodingTest1 IcedTea ěšÄřžýáíé=!@#$%^*()_+ú)ů§.-?:_"!'(/ěéřťÃúíóášÄźžÄň;+ĚŠČŘŽÃÃÃÉĚÉŘŤÃÚŮÃÓÃŠĎŽŹŇ ěšÄřžýáíé=!@#$%^*()_+ú)ů§.-?:_"!'(/ěéřťÃúíóášÄźžÄň;+ĚŠČŘŽÃÃÃÉĚÉŘŤÃÚŮÃÓÃŠĎŽŹŇ1 icedtea-web-1.5.3/tests/reproducers/simple/encodingTestsĚŠČŘŽÃÃÃÉĚÉŘŤÃÚŮÃÓÃŠĎŽ0000644000000000000000000000036212574544466037462 xustar00152 path=icedtea-web-1.5.3/tests/reproducers/simple/encodingTestsĚŠČŘŽÃÃÃÉĚÉŘŤÃÚŮÃÓÃŠĎŽŹŇ/resources/encodingTest1-ISO88592.jnlp 30 mtime=1441974582.561016739 30 atime=1441974656.603869058 30 ctime=1441974670.132024783 icedtea-web-1.5.3/tests/reproducers/simple/encodingTestsĚŠČŘŽÃÃÃÉĚÉŘŤÃÚŮÃÓÃŠĎŽ0000664000076400007640000000442612574544466043261 0ustar00jvanekjvanek00000000000000 encodingTest1 IcedTea ì¹èø¾ýáíé=!@#$%^*()_+ú)ù§.-?:_"!'(/ìéø»Ýúíóá¹ï¼¾èò;+Ì©ÈØ®ÝÁÍÉÌÉØ«ÝÚÙÍÓÁ©Ï®¬Ò ì¹èø¾ýáíé=!@#$%^*()_+ú)ù§.-?:_"!'(/ìéø»Ýúíóá¹ï¼¾èò;+Ì©ÈØ®ÝÁÍÉÌÉØ«ÝÚÙÍÓÁ©Ï®¬Ò1 icedtea-web-1.5.3/tests/reproducers/simple/PaxHeaders.24993/deadlocktest0000644000000000000000000000013112574544466023041 xustar0030 mtime=1441974582.560016727 29 atime=1441974670.15002499 30 ctime=1441974670.132024783 icedtea-web-1.5.3/tests/reproducers/simple/deadlocktest/0000775000076400007640000000000012574544466024200 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/deadlocktest/PaxHeaders.24993/testcases0000644000000000000000000000013112574544466025037 xustar0030 mtime=1441974582.560016727 29 atime=1441974670.15002499 30 ctime=1441974670.132024783 icedtea-web-1.5.3/tests/reproducers/simple/deadlocktest/testcases/0000775000076400007640000000000012574544466026176 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/deadlocktest/testcases/PaxHeaders.24993/DeadLockTestTest.0000644000000000000000000000013212574544466030264 xustar0030 mtime=1441974582.560016727 30 atime=1441974656.603869058 30 ctime=1441974670.132024783 icedtea-web-1.5.3/tests/reproducers/simple/deadlocktest/testcases/DeadLockTestTest.java0000664000076400007640000002603112574544466032211 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/deadlocktest/PaxHeaders.24993/srcs0000644000000000000000000000013112574544466024013 xustar0030 mtime=1441974582.560016727 29 atime=1441974670.15002499 30 ctime=1441974670.131024771 icedtea-web-1.5.3/tests/reproducers/simple/deadlocktest/srcs/0000775000076400007640000000000012574544466025152 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/deadlocktest/srcs/PaxHeaders.24993/DeadlockTest.java0000644000000000000000000000013212574544466027302 xustar0030 mtime=1441974582.560016727 30 atime=1441974656.603869058 30 ctime=1441974670.131024771 icedtea-web-1.5.3/tests/reproducers/simple/deadlocktest/srcs/DeadlockTest.java0000664000076400007640000000453312574544466030370 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/deadlocktest/PaxHeaders.24993/resources0000644000000000000000000000013112574544466025053 xustar0030 mtime=1441974582.560016727 29 atime=1441974670.15002499 30 ctime=1441974670.131024771 icedtea-web-1.5.3/tests/reproducers/simple/deadlocktest/resources/0000775000076400007640000000000012574544466026212 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/deadlocktest/resources/PaxHeaders.24993/deadlocktest_1.jn0000644000000000000000000000013212574544466030350 xustar0030 mtime=1441974582.560016727 30 atime=1441974656.603869058 30 ctime=1441974670.131024771 icedtea-web-1.5.3/tests/reproducers/simple/deadlocktest/resources/deadlocktest_1.jnlp0000664000076400007640000000426612574544466031775 0ustar00jvanekjvanek00000000000000 simpletest1 IcedTea simpletest1 icedtea-web-1.5.3/tests/reproducers/simple/deadlocktest/resources/PaxHeaders.24993/deadlocktest.jnlp0000644000000000000000000000013212574544466030464 xustar0030 mtime=1441974582.559016716 30 atime=1441974656.602869047 30 ctime=1441974670.131024771 icedtea-web-1.5.3/tests/reproducers/simple/deadlocktest/resources/deadlocktest.jnlp0000664000076400007640000000413712574544466031552 0ustar00jvanekjvanek00000000000000 simpletest1 IcedTea simpletest1 icedtea-web-1.5.3/tests/reproducers/simple/PaxHeaders.24993/VersionedJar__V10000644000000000000000000000013112574544466023473 xustar0030 mtime=1441974582.559016716 29 atime=1441974670.15002499 30 ctime=1441974670.131024771 icedtea-web-1.5.3/tests/reproducers/simple/VersionedJar__V1/0000775000076400007640000000000012574544466024632 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/VersionedJar__V1/PaxHeaders.24993/testcases0000644000000000000000000000013112574544466025471 xustar0030 mtime=1441974582.559016716 29 atime=1441974670.15002499 30 ctime=1441974670.131024771 icedtea-web-1.5.3/tests/reproducers/simple/VersionedJar__V1/testcases/0000775000076400007640000000000012574544466026630 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/VersionedJar__V1/testcases/PaxHeaders.24993/VersionedJarT0000644000000000000000000000013212574544466030211 xustar0030 mtime=1441974582.559016716 30 atime=1441974656.602869047 30 ctime=1441974670.131024771 icedtea-web-1.5.3/tests/reproducers/simple/VersionedJar__V1/testcases/VersionedJarTest.java0000664000076400007640000000540012574544466032725 0ustar00jvanekjvanek00000000000000/* Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the 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 VersionedJarTest { private static final ServerAccess server = new ServerAccess(); private static final String VERSIONED = "Versioned jar was accessed."; private static final String FAILURE = "net.sourceforge.jnlp.LaunchException"; @Test public void testDisabledVersionParameter() throws Exception { ProcessResult pr = server.executeJavawsHeadless("/VersionedJarDisabled.jnlp"); Assert.assertFalse("Stdout should NOT contain '" + VERSIONED + "', but did.", pr.stdout.contains(VERSIONED)); Assert.assertTrue("Stderr should contain '" +FAILURE + "', but did not.", pr.stderr.contains(FAILURE)); } @Test public void testEnabledVersionParameter() throws Exception { ProcessResult pr = server.executeJavawsHeadless("/VersionedJarEnabled.jnlp"); Assert.assertTrue("Stdout should contain '" + VERSIONED + "', but did not.", pr.stdout.contains(VERSIONED)); Assert.assertFalse("Stderr should NOT contain '" +FAILURE + "', but did.", pr.stderr.contains(FAILURE)); } } icedtea-web-1.5.3/tests/reproducers/simple/VersionedJar__V1/PaxHeaders.24993/srcs0000644000000000000000000000013112574544466024445 xustar0030 mtime=1441974582.559016716 29 atime=1441974670.15002499 30 ctime=1441974670.131024771 icedtea-web-1.5.3/tests/reproducers/simple/VersionedJar__V1/srcs/0000775000076400007640000000000012574544466025604 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/VersionedJar__V1/srcs/PaxHeaders.24993/VersionedJar.java0000644000000000000000000000013212574544466027761 xustar0030 mtime=1441974582.559016716 30 atime=1441974656.602869047 30 ctime=1441974670.131024771 icedtea-web-1.5.3/tests/reproducers/simple/VersionedJar__V1/srcs/VersionedJar.java0000664000076400007640000000351512574544466031046 0ustar00jvanekjvanek00000000000000/* Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the 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.5.3/tests/reproducers/simple/VersionedJar__V1/PaxHeaders.24993/resources0000644000000000000000000000013112574544466025505 xustar0030 mtime=1441974582.558016704 29 atime=1441974670.15002499 30 ctime=1441974670.131024771 icedtea-web-1.5.3/tests/reproducers/simple/VersionedJar__V1/resources/0000775000076400007640000000000012574544466026644 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/VersionedJar__V1/resources/PaxHeaders.24993/VersionedJarE0000644000000000000000000000013212574544466030206 xustar0030 mtime=1441974582.558016704 30 atime=1441974656.602869047 30 ctime=1441974670.131024771 icedtea-web-1.5.3/tests/reproducers/simple/VersionedJar__V1/resources/VersionedJarEnabled.jnlp0000664000076400007640000000404612574544466033403 0ustar00jvanekjvanek00000000000000 Test replacing security manager IcedTea icedtea-web-1.5.3/tests/reproducers/simple/VersionedJar__V1/resources/PaxHeaders.24993/VersionedJarD0000644000000000000000000000013212574544466030205 xustar0030 mtime=1441974582.558016704 30 atime=1441974656.601869035 30 ctime=1441974670.131024771 icedtea-web-1.5.3/tests/reproducers/simple/VersionedJar__V1/resources/VersionedJarDisabled.jnlp0000664000076400007640000000403312574544466033554 0ustar00jvanekjvanek00000000000000 Test versioned jars IcedTea icedtea-web-1.5.3/tests/reproducers/simple/PaxHeaders.24993/UnsignedJnlpTemplate0000644000000000000000000000013112574544466024467 xustar0030 mtime=1441974582.558016704 29 atime=1441974670.15002499 30 ctime=1441974670.131024771 icedtea-web-1.5.3/tests/reproducers/simple/UnsignedJnlpTemplate/0000775000076400007640000000000012574544466025626 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/UnsignedJnlpTemplate/PaxHeaders.24993/testcases0000644000000000000000000000013112574544466026465 xustar0030 mtime=1441974582.558016704 29 atime=1441974670.15002499 30 ctime=1441974670.131024771 icedtea-web-1.5.3/tests/reproducers/simple/UnsignedJnlpTemplate/testcases/0000775000076400007640000000000012574544466027624 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/UnsignedJnlpTemplate/testcases/PaxHeaders.24993/UnsignedJ0000644000000000000000000000031312574544466030355 xustar00113 path=icedtea-web-1.5.3/tests/reproducers/simple/UnsignedJnlpTemplate/testcases/UnsignedJnlpTemplateTest.java 30 mtime=1441974582.558016704 30 atime=1441974656.601869035 30 ctime=1441974670.131024771 icedtea-web-1.5.3/tests/reproducers/simple/UnsignedJnlpTemplate/testcases/UnsignedJnlpTemplateTest.j0000664000076400007640000000572712574544466034746 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/UnsignedJnlpTemplate/PaxHeaders.24993/srcs0000644000000000000000000000013112574544466025441 xustar0030 mtime=1441974582.557016693 29 atime=1441974670.15002499 30 ctime=1441974670.131024771 icedtea-web-1.5.3/tests/reproducers/simple/UnsignedJnlpTemplate/srcs/0000775000076400007640000000000012574544466026600 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/UnsignedJnlpTemplate/srcs/PaxHeaders.24993/UnsignedJnlpTe0000644000000000000000000000013212574544466030333 xustar0030 mtime=1441974582.557016693 30 atime=1441974656.601869035 30 ctime=1441974670.131024771 icedtea-web-1.5.3/tests/reproducers/simple/UnsignedJnlpTemplate/srcs/UnsignedJnlpTemplate.java0000664000076400007640000000342012574544466033536 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/UnsignedJnlpTemplate/srcs/PaxHeaders.24993/JNLP-INF0000644000000000000000000000013112574544466026616 xustar0030 mtime=1441974582.557016693 29 atime=1441974670.15002499 30 ctime=1441974670.131024771 icedtea-web-1.5.3/tests/reproducers/simple/UnsignedJnlpTemplate/srcs/JNLP-INF/0000775000076400007640000000000012574544466027755 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/UnsignedJnlpTemplate/srcs/JNLP-INF/PaxHeaders.24993/APPLI0000644000000000000000000000031312574544466027465 xustar00113 path=icedtea-web-1.5.3/tests/reproducers/simple/UnsignedJnlpTemplate/srcs/JNLP-INF/APPLICATION_TEMPLATE.jnlp 30 mtime=1441974582.557016693 30 atime=1441974656.601869035 30 ctime=1441974670.131024771 icedtea-web-1.5.3/tests/reproducers/simple/UnsignedJnlpTemplate/srcs/JNLP-INF/APPLICATION_TEMPLATE.j0000664000076400007640000000443412574544466033173 0ustar00jvanekjvanek00000000000000 UnsignedJnlpTemplate IcedTea UnsignedJnlpTemplate icedtea-web-1.5.3/tests/reproducers/simple/UnsignedJnlpTemplate/PaxHeaders.24993/resources0000644000000000000000000000013112574544466026501 xustar0030 mtime=1441974582.557016693 29 atime=1441974670.15002499 30 ctime=1441974670.131024771 icedtea-web-1.5.3/tests/reproducers/simple/UnsignedJnlpTemplate/resources/0000775000076400007640000000000012574544466027640 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/UnsignedJnlpTemplate/resources/PaxHeaders.24993/UnsignedJ0000644000000000000000000000013212574544466030370 xustar0030 mtime=1441974582.557016693 30 atime=1441974656.600869024 30 ctime=1441974670.131024771 icedtea-web-1.5.3/tests/reproducers/simple/UnsignedJnlpTemplate/resources/UnsignedJnlpTemplate3.jnlp0000664000076400007640000000455612574544466034716 0ustar00jvanekjvanek00000000000000 DIFFERENTJnlpTemplateNAME IcedTea UnsignedJnlpTemplate icedtea-web-1.5.3/tests/reproducers/simple/UnsignedJnlpTemplate/resources/PaxHeaders.24993/UnsignedJ0000644000000000000000000000013212574544466030370 xustar0030 mtime=1441974582.556016681 30 atime=1441974656.600869024 30 ctime=1441974670.131024771 icedtea-web-1.5.3/tests/reproducers/simple/UnsignedJnlpTemplate/resources/UnsignedJnlpTemplate2.jnlp0000664000076400007640000000434612574544466034712 0ustar00jvanekjvanek00000000000000 UnsignedJnlpTemplate IcedTea icedtea-web-1.5.3/tests/reproducers/simple/UnsignedJnlpTemplate/resources/PaxHeaders.24993/UnsignedJ0000644000000000000000000000013212574544466030370 xustar0030 mtime=1441974582.556016681 30 atime=1441974656.600869024 30 ctime=1441974670.131024771 icedtea-web-1.5.3/tests/reproducers/simple/UnsignedJnlpTemplate/resources/UnsignedJnlpTemplate1.jnlp0000664000076400007640000000421312574544466034702 0ustar00jvanekjvanek00000000000000 UnsignedJnlpTemplate IcedTea UnsignedJnlpTemplate icedtea-web-1.5.3/tests/reproducers/simple/PaxHeaders.24993/UnsignedJnlpApplication0000644000000000000000000000013112574544466025157 xustar0030 mtime=1441974582.556016681 29 atime=1441974670.15002499 30 ctime=1441974670.131024771 icedtea-web-1.5.3/tests/reproducers/simple/UnsignedJnlpApplication/0000775000076400007640000000000012574544466026316 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/UnsignedJnlpApplication/PaxHeaders.24993/testcases0000644000000000000000000000013112574544466027155 xustar0030 mtime=1441974582.556016681 29 atime=1441974670.15002499 30 ctime=1441974670.131024771 icedtea-web-1.5.3/tests/reproducers/simple/UnsignedJnlpApplication/testcases/0000775000076400007640000000000012574544466030314 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/UnsignedJnlpApplication/testcases/PaxHeaders.24993/Unsign0000644000000000000000000000032112574544466030421 xustar00119 path=icedtea-web-1.5.3/tests/reproducers/simple/UnsignedJnlpApplication/testcases/UnsignedJnlpApplicationTest.java 30 mtime=1441974582.556016681 30 atime=1441974656.599869012 30 ctime=1441974670.131024771 icedtea-web-1.5.3/tests/reproducers/simple/UnsignedJnlpApplication/testcases/UnsignedJnlpApplication0000664000076400007640000000573212574544466035032 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/UnsignedJnlpApplication/PaxHeaders.24993/srcs0000644000000000000000000000013012574544466026130 xustar0029 mtime=1441974582.55501667 29 atime=1441974670.15002499 30 ctime=1441974670.131024771 icedtea-web-1.5.3/tests/reproducers/simple/UnsignedJnlpApplication/srcs/0000775000076400007640000000000012574544466027270 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/UnsignedJnlpApplication/srcs/PaxHeaders.24993/UnsignedJnl0000644000000000000000000000013112574544466030351 xustar0029 mtime=1441974582.55501667 30 atime=1441974656.599869012 30 ctime=1441974670.131024771 icedtea-web-1.5.3/tests/reproducers/simple/UnsignedJnlpApplication/srcs/UnsignedJnlpApplication.java0000664000076400007640000000342612574544466034724 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/UnsignedJnlpApplication/srcs/PaxHeaders.24993/JNLP-INF0000644000000000000000000000013012574544466027305 xustar0029 mtime=1441974582.55501667 29 atime=1441974670.15002499 30 ctime=1441974670.131024771 icedtea-web-1.5.3/tests/reproducers/simple/UnsignedJnlpApplication/srcs/JNLP-INF/0000775000076400007640000000000012574544466030445 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/UnsignedJnlpApplication/srcs/JNLP-INF/PaxHeaders.24993/AP0000644000000000000000000000013112574544466027606 xustar0029 mtime=1441974582.55501667 30 atime=1441974656.599869012 30 ctime=1441974670.131024771 icedtea-web-1.5.3/tests/reproducers/simple/UnsignedJnlpApplication/srcs/JNLP-INF/APPLICATION.jnlp0000664000076400007640000000445312574544466033103 0ustar00jvanekjvanek00000000000000 UnsignedJnlpApplication IcedTea UnsignedJnlpApplication icedtea-web-1.5.3/tests/reproducers/simple/UnsignedJnlpApplication/PaxHeaders.24993/resources0000644000000000000000000000013012574544466027170 xustar0029 mtime=1441974582.55501667 29 atime=1441974670.15002499 30 ctime=1441974670.131024771 icedtea-web-1.5.3/tests/reproducers/simple/UnsignedJnlpApplication/resources/0000775000076400007640000000000012574544466030330 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/UnsignedJnlpApplication/resources/PaxHeaders.24993/Unsign0000644000000000000000000000031512574544466030440 xustar00116 path=icedtea-web-1.5.3/tests/reproducers/simple/UnsignedJnlpApplication/resources/UnsignedJnlpApplication3.jnlp 29 mtime=1441974582.55501667 30 atime=1441974656.599869012 30 ctime=1441974670.131024771 icedtea-web-1.5.3/tests/reproducers/simple/UnsignedJnlpApplication/resources/UnsignedJnlpApplication0000664000076400007640000000457512574544466035052 0ustar00jvanekjvanek00000000000000 DIFFERENTJnlpApplicationNAME IcedTea UnsignedJnlpApplication icedtea-web-1.5.3/tests/reproducers/simple/UnsignedJnlpApplication/resources/PaxHeaders.24993/Unsign0000644000000000000000000000031612574544466030441 xustar00116 path=icedtea-web-1.5.3/tests/reproducers/simple/UnsignedJnlpApplication/resources/UnsignedJnlpApplication2.jnlp 30 mtime=1441974582.554016658 30 atime=1441974656.598869001 30 ctime=1441974670.131024771 icedtea-web-1.5.3/tests/reproducers/simple/UnsignedJnlpApplication/resources/UnsignedJnlpApplication0000664000076400007640000000436212574544466035044 0ustar00jvanekjvanek00000000000000 UnsignedJnlpApplication IcedTea icedtea-web-1.5.3/tests/reproducers/simple/UnsignedJnlpApplication/resources/PaxHeaders.24993/Unsign0000644000000000000000000000031612574544466030441 xustar00116 path=icedtea-web-1.5.3/tests/reproducers/simple/UnsignedJnlpApplication/resources/UnsignedJnlpApplication1.jnlp 30 mtime=1441974582.554016658 30 atime=1441974656.598869001 30 ctime=1441974670.131024771 icedtea-web-1.5.3/tests/reproducers/simple/UnsignedJnlpApplication/resources/UnsignedJnlpApplication0000664000076400007640000000423212574544466035040 0ustar00jvanekjvanek00000000000000 UnsignedJnlpApplication IcedTea UnsignedJnlpApplication icedtea-web-1.5.3/tests/reproducers/simple/PaxHeaders.24993/UnicodeLineBreak0000644000000000000000000000013112574544466023536 xustar0030 mtime=1441974582.554016658 29 atime=1441974670.15002499 30 ctime=1441974670.131024771 icedtea-web-1.5.3/tests/reproducers/simple/UnicodeLineBreak/0000775000076400007640000000000012574544466024675 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/UnicodeLineBreak/PaxHeaders.24993/testcases0000644000000000000000000000013112574544466025534 xustar0030 mtime=1441974582.554016658 29 atime=1441974670.15002499 30 ctime=1441974670.131024771 icedtea-web-1.5.3/tests/reproducers/simple/UnicodeLineBreak/testcases/0000775000076400007640000000000012574544466026673 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/UnicodeLineBreak/testcases/PaxHeaders.24993/UnicodeLineBr0000644000000000000000000000013212574544466030217 xustar0030 mtime=1441974582.554016658 30 atime=1441974656.598869001 30 ctime=1441974670.131024771 icedtea-web-1.5.3/tests/reproducers/simple/UnicodeLineBreak/testcases/UnicodeLineBreakTests.java0000664000076400007640000001017612574544466033731 0ustar00jvanekjvanek00000000000000/* 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 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.security.appletextendedsecurity.AppletSecurityLevel; 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 final File trustFile = new File(System.getProperty("user.home") + "/.config/icedtea-web/.appletTrustSettings"); private static File backup; @BeforeClass public static void backupAppTrust() throws IOException{ backup = File.createTempFile("unicodeNewLIne", "itwReproducers"); backup.deleteOnExit(); FirefoxProfilesOperator.copyFile(trustFile, backup); FileUtils.saveFile(DeploymentConfiguration.KEY_SECURITY_LEVEL+"="+AppletSecurityLevel.ASK_UNSIGNED.name(), trustFile); } @AfterClass public static void restoreAppTrust() throws IOException{ FirefoxProfilesOperator.copyFile(backup, trustFile); } //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 { trustFile.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(trustFile); 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.5.3/tests/reproducers/simple/UnicodeLineBreak/PaxHeaders.24993/srcs0000644000000000000000000000013112574544466024510 xustar0030 mtime=1441974582.553016647 29 atime=1441974670.15002499 30 ctime=1441974670.131024771 icedtea-web-1.5.3/tests/reproducers/simple/UnicodeLineBreak/srcs/0000775000076400007640000000000012574544466025647 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/UnicodeLineBreak/srcs/PaxHeaders.24993/UnicodeLineBreak.j0000644000000000000000000000013212574544466030104 xustar0030 mtime=1441974582.553016647 30 atime=1441974656.598869001 30 ctime=1441974670.131024771 icedtea-web-1.5.3/tests/reproducers/simple/UnicodeLineBreak/srcs/UnicodeLineBreak.java0000664000076400007640000000343412574544466031661 0ustar00jvanekjvanek00000000000000 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.5.3/tests/reproducers/simple/UnicodeLineBreak/PaxHeaders.24993/resources0000644000000000000000000000013112574544466025550 xustar0030 mtime=1441974582.553016647 29 atime=1441974670.15002499 30 ctime=1441974670.131024771 icedtea-web-1.5.3/tests/reproducers/simple/UnicodeLineBreak/resources/0000775000076400007640000000000012574544466026707 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/UnicodeLineBreak/resources/PaxHeaders.24993/UnicodeLineBr0000644000000000000000000000013212574544466030233 xustar0030 mtime=1441974582.553016647 30 atime=1441974656.597868989 30 ctime=1441974670.131024771 icedtea-web-1.5.3/tests/reproducers/simple/UnicodeLineBreak/resources/UnicodeLineBreak.html0000664000076400007640000000403412574544466032741 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/simple/PaxHeaders.24993/StripHttpPathParams0000644000000000000000000000013112574544466024315 xustar0030 mtime=1441974582.553016647 29 atime=1441974670.15002499 30 ctime=1441974670.131024771 icedtea-web-1.5.3/tests/reproducers/simple/StripHttpPathParams/0000775000076400007640000000000012574544466025454 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/StripHttpPathParams/PaxHeaders.24993/testcases0000644000000000000000000000013112574544466026313 xustar0030 mtime=1441974582.553016647 29 atime=1441974670.15002499 30 ctime=1441974670.131024771 icedtea-web-1.5.3/tests/reproducers/simple/StripHttpPathParams/testcases/0000775000076400007640000000000012574544466027452 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/StripHttpPathParams/testcases/PaxHeaders.24993/StripHttpP0000644000000000000000000000031012574544466030373 xustar00111 path=icedtea-web-1.5.3/tests/reproducers/simple/StripHttpPathParams/testcases/StripHttpPathParamsTest.java 30 mtime=1441974582.553016647 30 atime=1441974656.597868989 29 ctime=1441974670.13002476 icedtea-web-1.5.3/tests/reproducers/simple/StripHttpPathParams/testcases/StripHttpPathParamsTest.jav0000664000076400007640000000553512574544466034746 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/StripHttpPathParams/PaxHeaders.24993/srcs0000644000000000000000000000013012574544466025266 xustar0030 mtime=1441974582.552016635 29 atime=1441974670.15002499 29 ctime=1441974670.13002476 icedtea-web-1.5.3/tests/reproducers/simple/StripHttpPathParams/srcs/0000775000076400007640000000000012574544466026426 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/StripHttpPathParams/srcs/PaxHeaders.24993/StripHttpPathPa0000644000000000000000000000013112574544466030326 xustar0030 mtime=1441974582.552016635 30 atime=1441974656.597868989 29 ctime=1441974670.13002476 icedtea-web-1.5.3/tests/reproducers/simple/StripHttpPathParams/srcs/StripHttpPathParams.java0000664000076400007640000000365412574544466033223 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/StripHttpPathParams/PaxHeaders.24993/resources0000644000000000000000000000013012574544466026326 xustar0030 mtime=1441974582.552016635 29 atime=1441974670.15002499 29 ctime=1441974670.13002476 icedtea-web-1.5.3/tests/reproducers/simple/StripHttpPathParams/resources/0000775000076400007640000000000012574544466027466 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/StripHttpPathParams/resources/PaxHeaders.24993/StripHttpP0000644000000000000000000000013112574544466030410 xustar0030 mtime=1441974582.552016635 30 atime=1441974656.596868978 29 ctime=1441974670.13002476 icedtea-web-1.5.3/tests/reproducers/simple/StripHttpPathParams/resources/StripHttpPathParams.jnlp0000664000076400007640000000424212574544466034277 0ustar00jvanekjvanek00000000000000 StripHttpPathParams IcedTea Remove HTTP Path Parameters from JAR URLs icedtea-web-1.5.3/tests/reproducers/simple/StripHttpPathParams/resources/PaxHeaders.24993/StripHttpP0000644000000000000000000000013112574544466030410 xustar0030 mtime=1441974582.552016635 30 atime=1441974656.596868978 29 ctime=1441974670.13002476 icedtea-web-1.5.3/tests/reproducers/simple/StripHttpPathParams/resources/StripHttpPathParams.html0000664000076400007640000000352612574544466034304 0ustar00jvanekjvanek00000000000000 icedtea-web-1.5.3/tests/reproducers/simple/PaxHeaders.24993/Spaces can be everywhere0000644000000000000000000000013012574544466025047 xustar0030 mtime=1441974582.551016624 29 atime=1441974670.15002499 29 ctime=1441974670.13002476 icedtea-web-1.5.3/tests/reproducers/simple/Spaces can be everywhere/0000775000076400007640000000000012574544466026207 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/Spaces can be everywhere/PaxHeaders.24993/testcases0000644000000000000000000000013012574544466027045 xustar0030 mtime=1441974582.551016624 29 atime=1441974670.15002499 29 ctime=1441974670.13002476 icedtea-web-1.5.3/tests/reproducers/simple/Spaces can be everywhere/testcases/0000775000076400007640000000000012574544466030205 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/Spaces can be everywhere/testcases/PaxHeaders.24993/Space0000644000000000000000000000032012574544466030101 xustar00119 path=icedtea-web-1.5.3/tests/reproducers/simple/Spaces can be everywhere/testcases/SpacesCanBeEverywhereTests.java 30 mtime=1441974582.552016635 30 atime=1441974656.596868978 29 ctime=1441974670.13002476 icedtea-web-1.5.3/tests/reproducers/simple/Spaces can be everywhere/testcases/SpacesCanBeEverywhereT0000664000076400007640000002754712574544466034450 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/Spaces can be everywhere/PaxHeaders.24993/srcs0000644000000000000000000000013012574544466026021 xustar0030 mtime=1441974582.551016624 29 atime=1441974670.15002499 29 ctime=1441974670.13002476 icedtea-web-1.5.3/tests/reproducers/simple/Spaces can be everywhere/srcs/0000775000076400007640000000000012574544466027161 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/Spaces can be everywhere/srcs/PaxHeaders.24993/SpacesCanB0000644000000000000000000000013112574544466027764 xustar0030 mtime=1441974582.551016624 30 atime=1441974656.596868978 29 ctime=1441974670.13002476 icedtea-web-1.5.3/tests/reproducers/simple/Spaces can be everywhere/srcs/SpacesCanBeEverywhere.java0000664000076400007640000000465412574544466034212 0ustar00jvanekjvanek00000000000000 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.5.3/tests/reproducers/simple/Spaces can be everywhere/PaxHeaders.24993/resources0000644000000000000000000000013012574544466027061 xustar0030 mtime=1441974582.551016624 29 atime=1441974670.15002499 29 ctime=1441974670.13002476 icedtea-web-1.5.3/tests/reproducers/simple/Spaces can be everywhere/resources/0000775000076400007640000000000012574544466030221 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/Spaces can be everywhere/resources/PaxHeaders.24993/space0000644000000000000000000000031112574544466030155 xustar00112 path=icedtea-web-1.5.3/tests/reproducers/simple/Spaces can be everywhere/resources/spaces applet Tests.html 30 mtime=1441974582.551016624 30 atime=1441974656.595868966 29 ctime=1441974670.13002476 icedtea-web-1.5.3/tests/reproducers/simple/Spaces can be everywhere/resources/spaces applet Tests.ht0000664000076400007640000000344712574544466034375 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/simple/Spaces can be everywhere/resources/PaxHeaders.24993/Space0000644000000000000000000000031412574544466030120 xustar00115 path=icedtea-web-1.5.3/tests/reproducers/simple/Spaces can be everywhere/resources/SpacesCanBeEverywhere1.jnlp 30 mtime=1441974582.550016612 30 atime=1441974656.595868966 29 ctime=1441974670.13002476 icedtea-web-1.5.3/tests/reproducers/simple/Spaces can be everywhere/resources/SpacesCanBeEverywhere10000664000076400007640000000417612574544466034412 0ustar00jvanekjvanek00000000000000 simpletest1 IcedTea simpletest1 icedtea-web-1.5.3/tests/reproducers/simple/Spaces can be everywhere/resources/PaxHeaders.24993/Space0000644000000000000000000000031712574544466030123 xustar00118 path=icedtea-web-1.5.3/tests/reproducers/simple/Spaces can be everywhere/resources/Spaces can be everywhere2.jnlp 30 mtime=1441974582.550016612 30 atime=1441974656.595868966 29 ctime=1441974670.13002476 icedtea-web-1.5.3/tests/reproducers/simple/Spaces can be everywhere/resources/Spaces can be everywhe0000664000076400007640000000423512574544466034276 0ustar00jvanekjvanek00000000000000 Spaces can be everywhere2 IcedTea Spaces can be everywhere2 icedtea-web-1.5.3/tests/reproducers/simple/Spaces can be everywhere/resources/PaxHeaders.24993/Space0000644000000000000000000000031712574544466030123 xustar00118 path=icedtea-web-1.5.3/tests/reproducers/simple/Spaces can be everywhere/resources/Spaces can be everywhere1.jnlp 30 mtime=1441974582.550016612 30 atime=1441974656.595868966 29 ctime=1441974670.13002476 icedtea-web-1.5.3/tests/reproducers/simple/Spaces can be everywhere/resources/Spaces can be everywhe0000664000076400007640000000420612574544466034274 0ustar00jvanekjvanek00000000000000 Spaces can be everywhere1 IcedTea Spaces can be everywhere1 icedtea-web-1.5.3/tests/reproducers/simple/Spaces can be everywhere/resources/PaxHeaders.24993/NotOn0000644000000000000000000000033412574544466030124 xustar00131 path=icedtea-web-1.5.3/tests/reproducers/simple/Spaces can be everywhere/resources/NotOnly spaces can kill ěšÄřž too.jnlp 30 mtime=1441974582.550016612 30 atime=1441974656.594868955 29 ctime=1441974670.13002476 icedtea-web-1.5.3/tests/reproducers/simple/Spaces can be everywhere/resources/NotOnly spaces can kil0000664000076400007640000000452412574544466034274 0ustar00jvanekjvanek00000000000000 Spaces can be everywhere test with few more chars for encoding IcedTea AppletTest icedtea-web-1.5.3/tests/reproducers/simple/PaxHeaders.24993/SingleInstanceServiceTest0000644000000000000000000000012612574544466025466 xustar0028 mtime=1441974582.5490166 29 atime=1441974670.15002499 29 ctime=1441974670.13002476 icedtea-web-1.5.3/tests/reproducers/simple/SingleInstanceServiceTest/0000775000076400007640000000000012574544466026621 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/SingleInstanceServiceTest/PaxHeaders.24993/testcases0000644000000000000000000000012612574544466027464 xustar0028 mtime=1441974582.5490166 29 atime=1441974670.15002499 29 ctime=1441974670.13002476 icedtea-web-1.5.3/tests/reproducers/simple/SingleInstanceServiceTest/testcases/0000775000076400007640000000000012574544466030617 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/SingleInstanceServiceTest/testcases/PaxHeaders.24993/Sing0000644000000000000000000000030712574544466030365 xustar00112 path=icedtea-web-1.5.3/tests/reproducers/simple/SingleInstanceServiceTest/testcases/SingleInstanceTest.java 28 mtime=1441974582.5490166 30 atime=1441974656.594868955 29 ctime=1441974670.13002476 icedtea-web-1.5.3/tests/reproducers/simple/SingleInstanceServiceTest/testcases/SingleInstanceTest.ja0000664000076400007640000003040612574544466034704 0ustar00jvanekjvanek00000000000000/* 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 { 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 { 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.5.3/tests/reproducers/simple/SingleInstanceServiceTest/PaxHeaders.24993/srcs0000644000000000000000000000012612574544466026440 xustar0028 mtime=1441974582.5490166 29 atime=1441974670.15002499 29 ctime=1441974670.13002476 icedtea-web-1.5.3/tests/reproducers/simple/SingleInstanceServiceTest/srcs/0000775000076400007640000000000012574544466027573 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/SingleInstanceServiceTest/srcs/PaxHeaders.24993/SingleIns0000644000000000000000000000012712574544466030334 xustar0028 mtime=1441974582.5490166 30 atime=1441974656.594868955 29 ctime=1441974670.13002476 icedtea-web-1.5.3/tests/reproducers/simple/SingleInstanceServiceTest/srcs/SingleInstanceChecker.java0000664000076400007640000001213112574544466034627 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/SingleInstanceServiceTest/PaxHeaders.24993/resources0000644000000000000000000000013112574544466027474 xustar0030 mtime=1441974582.548016589 30 atime=1441974670.151025002 29 ctime=1441974670.13002476 icedtea-web-1.5.3/tests/reproducers/simple/SingleInstanceServiceTest/resources/0000775000076400007640000000000012574544466030633 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/SingleInstanceServiceTest/resources/PaxHeaders.24993/Sing0000644000000000000000000000032212574544466030376 xustar00121 path=icedtea-web-1.5.3/tests/reproducers/simple/SingleInstanceServiceTest/resources/SingleInstanceTest_jnlpHref.html 30 mtime=1441974582.548016589 30 atime=1441974656.594868955 29 ctime=1441974670.13002476 icedtea-web-1.5.3/tests/reproducers/simple/SingleInstanceServiceTest/resources/SingleInstanceTest_jn0000664000076400007640000000362712574544466035023 0ustar00jvanekjvanek00000000000000 icedtea-web-1.5.3/tests/reproducers/simple/SingleInstanceServiceTest/resources/PaxHeaders.24993/Sing0000644000000000000000000000032212574544466030376 xustar00121 path=icedtea-web-1.5.3/tests/reproducers/simple/SingleInstanceServiceTest/resources/SingleInstanceTest_clasical.html 30 mtime=1441974582.548016589 30 atime=1441974656.593868943 29 ctime=1441974670.13002476 icedtea-web-1.5.3/tests/reproducers/simple/SingleInstanceServiceTest/resources/SingleInstanceTest_cl0000664000076400007640000000370712574544466035011 0ustar00jvanekjvanek00000000000000 icedtea-web-1.5.3/tests/reproducers/simple/SingleInstanceServiceTest/resources/PaxHeaders.24993/Sing0000644000000000000000000000031312574544466030376 xustar00114 path=icedtea-web-1.5.3/tests/reproducers/simple/SingleInstanceServiceTest/resources/SingleInstanceTestWS.jnlp 30 mtime=1441974582.548016589 30 atime=1441974656.593868943 29 ctime=1441974670.13002476 icedtea-web-1.5.3/tests/reproducers/simple/SingleInstanceServiceTest/resources/SingleInstanceTestWS.0000664000076400007640000000437612574544466034666 0ustar00jvanekjvanek00000000000000 SingleInstanceAppletWS IcedTea SingleInstanceAppletWS v7 v8 icedtea-web-1.5.3/tests/reproducers/simple/SingleInstanceServiceTest/resources/PaxHeaders.24993/Sing0000644000000000000000000000031112574544466030374 xustar00112 path=icedtea-web-1.5.3/tests/reproducers/simple/SingleInstanceServiceTest/resources/SingleInstanceTest.jnlp 30 mtime=1441974582.548016589 30 atime=1441974656.593868943 29 ctime=1441974670.13002476 icedtea-web-1.5.3/tests/reproducers/simple/SingleInstanceServiceTest/resources/SingleInstanceTest.jn0000664000076400007640000000454112574544466034736 0ustar00jvanekjvanek00000000000000 SingleInstanceApplet IcedTea SingleInstanceApplet icedtea-web-1.5.3/tests/reproducers/simple/PaxHeaders.24993/SimpleApplet0000644000000000000000000000013112574544466022772 xustar0030 mtime=1441974582.547016577 30 atime=1441974670.151025002 29 ctime=1441974670.13002476 icedtea-web-1.5.3/tests/reproducers/simple/SimpleApplet/0000775000076400007640000000000012574544466024131 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/SimpleApplet/PaxHeaders.24993/srcs0000644000000000000000000000013112574544466023744 xustar0030 mtime=1441974582.547016577 30 atime=1441974670.151025002 29 ctime=1441974670.13002476 icedtea-web-1.5.3/tests/reproducers/simple/SimpleApplet/srcs/0000775000076400007640000000000012574544466025103 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/SimpleApplet/srcs/PaxHeaders.24993/SimpleApplet.java0000644000000000000000000000013112574544466027263 xustar0030 mtime=1441974582.547016577 30 atime=1441974656.593868943 29 ctime=1441974670.13002476 icedtea-web-1.5.3/tests/reproducers/simple/SimpleApplet/srcs/SimpleApplet.java0000664000076400007640000000346512574544466030355 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/PaxHeaders.24993/SetContextClassLoader0000644000000000000000000000013112574544466024610 xustar0030 mtime=1441974582.547016577 30 atime=1441974670.151025002 29 ctime=1441974670.13002476 icedtea-web-1.5.3/tests/reproducers/simple/SetContextClassLoader/0000775000076400007640000000000012574544466025747 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/SetContextClassLoader/PaxHeaders.24993/testcases0000644000000000000000000000013112574544466026606 xustar0030 mtime=1441974582.547016577 30 atime=1441974670.151025002 29 ctime=1441974670.13002476 icedtea-web-1.5.3/tests/reproducers/simple/SetContextClassLoader/testcases/0000775000076400007640000000000012574544466027745 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/SetContextClassLoader/testcases/PaxHeaders.24993/SetConte0000644000000000000000000000031412574544466030335 xustar00115 path=icedtea-web-1.5.3/tests/reproducers/simple/SetContextClassLoader/testcases/SetContextClassLoaderTest.java 30 mtime=1441974582.547016577 30 atime=1441974656.592868932 29 ctime=1441974670.13002476 icedtea-web-1.5.3/tests/reproducers/simple/SetContextClassLoader/testcases/SetContextClassLoaderTest0000664000076400007640000000506712574544466034755 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/SetContextClassLoader/PaxHeaders.24993/srcs0000644000000000000000000000013112574544466025562 xustar0030 mtime=1441974582.547016577 30 atime=1441974670.151025002 29 ctime=1441974670.13002476 icedtea-web-1.5.3/tests/reproducers/simple/SetContextClassLoader/srcs/0000775000076400007640000000000012574544466026721 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/SetContextClassLoader/srcs/PaxHeaders.24993/SetContextCla0000644000000000000000000000013112574544466030302 xustar0030 mtime=1441974582.547016577 30 atime=1441974656.592868932 29 ctime=1441974670.13002476 icedtea-web-1.5.3/tests/reproducers/simple/SetContextClassLoader/srcs/SetContextClassLoader.java0000664000076400007640000000344512574544466034007 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/SetContextClassLoader/PaxHeaders.24993/resources0000644000000000000000000000013112574544466026622 xustar0030 mtime=1441974582.546016566 30 atime=1441974670.151025002 29 ctime=1441974670.13002476 icedtea-web-1.5.3/tests/reproducers/simple/SetContextClassLoader/resources/0000775000076400007640000000000012574544466027761 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/SetContextClassLoader/resources/PaxHeaders.24993/SetConte0000644000000000000000000000031012574544466030345 xustar00111 path=icedtea-web-1.5.3/tests/reproducers/simple/SetContextClassLoader/resources/SetContextClassLoader.jnlp 30 mtime=1441974582.546016566 30 atime=1441974656.592868932 29 ctime=1441974670.13002476 icedtea-web-1.5.3/tests/reproducers/simple/SetContextClassLoader/resources/SetContextClassLoader.jnl0000664000076400007640000000400612574544466034703 0ustar00jvanekjvanek00000000000000 set context classloader IcedTea icedtea-web-1.5.3/tests/reproducers/simple/PaxHeaders.24993/ResizeApplet0000644000000000000000000000013112574544466023002 xustar0030 mtime=1441974582.546016566 30 atime=1441974670.151025002 29 ctime=1441974670.13002476 icedtea-web-1.5.3/tests/reproducers/simple/ResizeApplet/0000775000076400007640000000000012574544466024141 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/ResizeApplet/PaxHeaders.24993/testcases0000644000000000000000000000013112574544466025000 xustar0030 mtime=1441974582.546016566 30 atime=1441974670.151025002 29 ctime=1441974670.13002476 icedtea-web-1.5.3/tests/reproducers/simple/ResizeApplet/testcases/0000775000076400007640000000000012574544466026137 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/ResizeApplet/testcases/PaxHeaders.24993/ResizeAppletTests0000644000000000000000000000013112574544466030432 xustar0030 mtime=1441974582.546016566 30 atime=1441974656.592868932 29 ctime=1441974670.13002476 icedtea-web-1.5.3/tests/reproducers/simple/ResizeApplet/testcases/ResizeAppletTests.java0000664000076400007640000000531112574544466032434 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/ResizeApplet/PaxHeaders.24993/srcs0000644000000000000000000000013112574544466023754 xustar0030 mtime=1441974582.546016566 30 atime=1441974670.151025002 29 ctime=1441974670.13002476 icedtea-web-1.5.3/tests/reproducers/simple/ResizeApplet/srcs/0000775000076400007640000000000012574544466025113 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/ResizeApplet/srcs/PaxHeaders.24993/ResizeApplet.java0000644000000000000000000000013012574544466027302 xustar0030 mtime=1441974582.546016566 29 atime=1441974656.59186892 29 ctime=1441974670.13002476 icedtea-web-1.5.3/tests/reproducers/simple/ResizeApplet/srcs/ResizeApplet.java0000664000076400007640000000475012574544466030373 0ustar00jvanekjvanek00000000000000 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.5.3/tests/reproducers/simple/ResizeApplet/PaxHeaders.24993/resources0000644000000000000000000000013112574544466025014 xustar0030 mtime=1441974582.545016555 30 atime=1441974670.151025002 29 ctime=1441974670.13002476 icedtea-web-1.5.3/tests/reproducers/simple/ResizeApplet/resources/0000775000076400007640000000000012574544466026153 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/ResizeApplet/resources/PaxHeaders.24993/ResizeApplet.html0000644000000000000000000000013012574544466030365 xustar0030 mtime=1441974582.545016555 29 atime=1441974656.59186892 29 ctime=1441974670.13002476 icedtea-web-1.5.3/tests/reproducers/simple/ResizeApplet/resources/ResizeApplet.html0000664000076400007640000000425012574544466031451 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/simple/PaxHeaders.24993/ReplaceSecurityManager0000644000000000000000000000013112574544466024771 xustar0030 mtime=1441974582.545016555 30 atime=1441974670.151025002 29 ctime=1441974670.13002476 icedtea-web-1.5.3/tests/reproducers/simple/ReplaceSecurityManager/0000775000076400007640000000000012574544466026130 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/ReplaceSecurityManager/PaxHeaders.24993/testcases0000644000000000000000000000013212574544466026770 xustar0030 mtime=1441974582.545016555 30 atime=1441974670.151025002 30 ctime=1441974670.129024748 icedtea-web-1.5.3/tests/reproducers/simple/ReplaceSecurityManager/testcases/0000775000076400007640000000000012574544466030126 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/ReplaceSecurityManager/testcases/PaxHeaders.24993/Replace0000644000000000000000000000031612574544466030347 xustar00117 path=icedtea-web-1.5.3/tests/reproducers/simple/ReplaceSecurityManager/testcases/ReplaceSecurityManagerTest.java 30 mtime=1441974582.545016555 29 atime=1441974656.59186892 30 ctime=1441974670.129024748 icedtea-web-1.5.3/tests/reproducers/simple/ReplaceSecurityManager/testcases/ReplaceSecurityManagerTe0000664000076400007640000000510312574544466034737 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/ReplaceSecurityManager/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466025744 xustar0030 mtime=1441974582.544016543 30 atime=1441974670.151025002 30 ctime=1441974670.129024748 icedtea-web-1.5.3/tests/reproducers/simple/ReplaceSecurityManager/srcs/0000775000076400007640000000000012574544466027102 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/ReplaceSecurityManager/srcs/PaxHeaders.24993/ReplaceSecur0000644000000000000000000000013112574544466030320 xustar0030 mtime=1441974582.544016543 29 atime=1441974656.59186892 30 ctime=1441974670.129024748 icedtea-web-1.5.3/tests/reproducers/simple/ReplaceSecurityManager/srcs/ReplaceSecurityManager.java0000664000076400007640000000343312574544466034346 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/ReplaceSecurityManager/PaxHeaders.24993/resources0000644000000000000000000000013212574544466027004 xustar0030 mtime=1441974582.544016543 30 atime=1441974670.151025002 30 ctime=1441974670.129024748 icedtea-web-1.5.3/tests/reproducers/simple/ReplaceSecurityManager/resources/0000775000076400007640000000000012574544466030142 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/ReplaceSecurityManager/resources/PaxHeaders.24993/Replace0000644000000000000000000000031312574544466030360 xustar00113 path=icedtea-web-1.5.3/tests/reproducers/simple/ReplaceSecurityManager/resources/ReplaceSecurityManager.jnlp 30 mtime=1441974582.544016543 30 atime=1441974656.590868909 30 ctime=1441974670.129024748 icedtea-web-1.5.3/tests/reproducers/simple/ReplaceSecurityManager/resources/ReplaceSecurityManager.j0000664000076400007640000000376712574544466034730 0ustar00jvanekjvanek00000000000000 Test replacing security manager IcedTea icedtea-web-1.5.3/tests/reproducers/simple/PaxHeaders.24993/RedirectStreams0000644000000000000000000000013212574544466023474 xustar0030 mtime=1441974582.544016543 30 atime=1441974670.151025002 30 ctime=1441974670.129024748 icedtea-web-1.5.3/tests/reproducers/simple/RedirectStreams/0000775000076400007640000000000012574544466024632 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/RedirectStreams/PaxHeaders.24993/testcases0000644000000000000000000000013212574544466025472 xustar0030 mtime=1441974582.544016543 30 atime=1441974670.151025002 30 ctime=1441974670.129024748 icedtea-web-1.5.3/tests/reproducers/simple/RedirectStreams/testcases/0000775000076400007640000000000012574544466026630 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/RedirectStreams/testcases/PaxHeaders.24993/RedirectStream0000644000000000000000000000013212574544466030407 xustar0030 mtime=1441974582.544016543 30 atime=1441974656.590868909 30 ctime=1441974670.129024748 icedtea-web-1.5.3/tests/reproducers/simple/RedirectStreams/testcases/RedirectStreamsTest.java0000664000076400007640000000501412574544466033433 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/RedirectStreams/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466024446 xustar0030 mtime=1441974582.543016532 30 atime=1441974670.151025002 30 ctime=1441974670.129024748 icedtea-web-1.5.3/tests/reproducers/simple/RedirectStreams/srcs/0000775000076400007640000000000012574544466025604 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/RedirectStreams/srcs/PaxHeaders.24993/RedirectStreams.jav0000644000000000000000000000013212574544466030325 xustar0030 mtime=1441974582.543016532 30 atime=1441974656.590868909 30 ctime=1441974670.129024748 icedtea-web-1.5.3/tests/reproducers/simple/RedirectStreams/srcs/RedirectStreams.java0000664000076400007640000000345112574544466031552 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/RedirectStreams/PaxHeaders.24993/resources0000644000000000000000000000013212574544466025506 xustar0030 mtime=1441974582.543016532 30 atime=1441974670.151025002 30 ctime=1441974670.129024748 icedtea-web-1.5.3/tests/reproducers/simple/RedirectStreams/resources/0000775000076400007640000000000012574544466026644 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/RedirectStreams/resources/PaxHeaders.24993/RedirectStream0000644000000000000000000000013212574544466030423 xustar0030 mtime=1441974582.543016532 30 atime=1441974656.590868909 30 ctime=1441974670.129024748 icedtea-web-1.5.3/tests/reproducers/simple/RedirectStreams/resources/RedirectStreams.jnlp0000664000076400007640000000375112574544466032637 0ustar00jvanekjvanek00000000000000 redirect stdin/stdout streams IcedTea icedtea-web-1.5.3/tests/reproducers/simple/PaxHeaders.24993/ReadProperties0000644000000000000000000000013212574544466023324 xustar0030 mtime=1441974582.543016532 30 atime=1441974670.151025002 30 ctime=1441974670.129024748 icedtea-web-1.5.3/tests/reproducers/simple/ReadProperties/0000775000076400007640000000000012574544466024462 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/ReadProperties/PaxHeaders.24993/testcases0000644000000000000000000000013212574544466025322 xustar0030 mtime=1441974582.543016532 30 atime=1441974670.151025002 30 ctime=1441974670.129024748 icedtea-web-1.5.3/tests/reproducers/simple/ReadProperties/testcases/0000775000076400007640000000000012574544466026460 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/ReadProperties/testcases/PaxHeaders.24993/ReadPropertiesT0000644000000000000000000000013212574544466030376 xustar0030 mtime=1441974582.543016532 30 atime=1441974656.589868897 30 ctime=1441974670.129024748 icedtea-web-1.5.3/tests/reproducers/simple/ReadProperties/testcases/ReadPropertiesTest.java0000664000076400007640000000634012574544466033116 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/ReadProperties/PaxHeaders.24993/srcs0000644000000000000000000000013112574544466024275 xustar0029 mtime=1441974582.54201652 30 atime=1441974670.151025002 30 ctime=1441974670.129024748 icedtea-web-1.5.3/tests/reproducers/simple/ReadProperties/srcs/0000775000076400007640000000000012574544466025434 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/ReadProperties/srcs/PaxHeaders.24993/ReadProperties.java0000644000000000000000000000013112574544466030145 xustar0029 mtime=1441974582.54201652 30 atime=1441974656.589868897 30 ctime=1441974670.129024748 icedtea-web-1.5.3/tests/reproducers/simple/ReadProperties/srcs/ReadProperties.java0000664000076400007640000000351312574544466031231 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/ReadProperties/PaxHeaders.24993/resources0000644000000000000000000000013112574544466025335 xustar0029 mtime=1441974582.54201652 30 atime=1441974670.151025002 30 ctime=1441974670.129024748 icedtea-web-1.5.3/tests/reproducers/simple/ReadProperties/resources/0000775000076400007640000000000012574544466026474 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/ReadProperties/resources/PaxHeaders.24993/ReadProperties20000644000000000000000000000013112574544466030347 xustar0029 mtime=1441974582.54201652 30 atime=1441974656.589868897 30 ctime=1441974670.129024748 icedtea-web-1.5.3/tests/reproducers/simple/ReadProperties/resources/ReadProperties2.jnlp0000664000076400007640000000405312574544466032375 0ustar00jvanekjvanek00000000000000 read properties using System.getenv() IcedTea user.home icedtea-web-1.5.3/tests/reproducers/simple/ReadProperties/resources/PaxHeaders.24993/ReadProperties10000644000000000000000000000013112574544466030346 xustar0029 mtime=1441974582.54201652 30 atime=1441974656.589868897 30 ctime=1441974670.129024748 icedtea-web-1.5.3/tests/reproducers/simple/ReadProperties/resources/ReadProperties1.jnlp0000664000076400007640000000405512574544466032376 0ustar00jvanekjvanek00000000000000 read properties using System.getenv() IcedTea user.name icedtea-web-1.5.3/tests/reproducers/simple/PaxHeaders.24993/ReadEnvironment0000644000000000000000000000013212574544466023474 xustar0030 mtime=1441974582.541016508 30 atime=1441974670.151025002 30 ctime=1441974670.129024748 icedtea-web-1.5.3/tests/reproducers/simple/ReadEnvironment/0000775000076400007640000000000012574544466024632 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/ReadEnvironment/PaxHeaders.24993/testcases0000644000000000000000000000013212574544466025472 xustar0030 mtime=1441974582.541016508 30 atime=1441974670.151025002 30 ctime=1441974670.129024748 icedtea-web-1.5.3/tests/reproducers/simple/ReadEnvironment/testcases/0000775000076400007640000000000012574544466026630 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/ReadEnvironment/testcases/PaxHeaders.24993/ReadEnvironmen0000644000000000000000000000013212574544466030406 xustar0030 mtime=1441974582.541016508 30 atime=1441974656.589868897 30 ctime=1441974670.129024748 icedtea-web-1.5.3/tests/reproducers/simple/ReadEnvironment/testcases/ReadEnvironmentTest.java0000664000076400007640000000502712574544466033437 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/ReadEnvironment/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466024446 xustar0030 mtime=1441974582.541016508 30 atime=1441974670.151025002 30 ctime=1441974670.129024748 icedtea-web-1.5.3/tests/reproducers/simple/ReadEnvironment/srcs/0000775000076400007640000000000012574544466025604 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/ReadEnvironment/srcs/PaxHeaders.24993/ReadEnvironment.jav0000644000000000000000000000013212574544466030325 xustar0030 mtime=1441974582.541016508 30 atime=1441974656.588868886 30 ctime=1441974670.129024748 icedtea-web-1.5.3/tests/reproducers/simple/ReadEnvironment/srcs/ReadEnvironment.java0000664000076400007640000000334612574544466031555 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/ReadEnvironment/PaxHeaders.24993/resources0000644000000000000000000000013212574544466025506 xustar0030 mtime=1441974582.541016508 30 atime=1441974670.151025002 30 ctime=1441974670.129024748 icedtea-web-1.5.3/tests/reproducers/simple/ReadEnvironment/resources/0000775000076400007640000000000012574544466026644 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/ReadEnvironment/resources/PaxHeaders.24993/ReadEnvironmen0000644000000000000000000000013212574544466030422 xustar0030 mtime=1441974582.541016508 30 atime=1441974656.588868886 30 ctime=1441974670.129024748 icedtea-web-1.5.3/tests/reproducers/simple/ReadEnvironment/resources/ReadEnvironment.jnlp0000664000076400007640000000376212574544466032641 0ustar00jvanekjvanek00000000000000 ReadEnvironment using System.getenv() IcedTea icedtea-web-1.5.3/tests/reproducers/simple/PaxHeaders.24993/ParametrizedJarUrl0000644000000000000000000000013212574544466024143 xustar0030 mtime=1441974582.540016497 30 atime=1441974670.151025002 30 ctime=1441974670.129024748 icedtea-web-1.5.3/tests/reproducers/simple/ParametrizedJarUrl/0000775000076400007640000000000012574544466025301 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/ParametrizedJarUrl/PaxHeaders.24993/testcases0000644000000000000000000000013212574544466026141 xustar0030 mtime=1441974582.540016497 30 atime=1441974670.151025002 30 ctime=1441974670.129024748 icedtea-web-1.5.3/tests/reproducers/simple/ParametrizedJarUrl/testcases/0000775000076400007640000000000012574544466027277 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/ParametrizedJarUrl/testcases/PaxHeaders.24993/Parametrize0000644000000000000000000000013212574544466030424 xustar0030 mtime=1441974582.540016497 30 atime=1441974656.588868886 30 ctime=1441974670.129024748 icedtea-web-1.5.3/tests/reproducers/simple/ParametrizedJarUrl/testcases/ParametrizedJarUrlTests.java0000664000076400007640000002340112574544466034734 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/ParametrizedJarUrl/PaxHeaders.24993/resources0000644000000000000000000000013212574544466026155 xustar0030 mtime=1441974582.540016497 30 atime=1441974670.151025002 30 ctime=1441974670.129024748 icedtea-web-1.5.3/tests/reproducers/simple/ParametrizedJarUrl/resources/0000775000076400007640000000000012574544466027313 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/ParametrizedJarUrl/resources/PaxHeaders.24993/Parametrize0000644000000000000000000000031212574544466030440 xustar00112 path=icedtea-web-1.5.3/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarUrlSigned2.jnlp 30 mtime=1441974582.540016497 30 atime=1441974656.588868886 30 ctime=1441974670.129024748 icedtea-web-1.5.3/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarUrlSigned2.jn0000664000076400007640000000425212574544466034632 0ustar00jvanekjvanek00000000000000 ParametrizedJarUrlSigned2 IcedTea ParametrizedJarUrlSigned2 icedtea-web-1.5.3/tests/reproducers/simple/ParametrizedJarUrl/resources/PaxHeaders.24993/Parametrize0000644000000000000000000000031212574544466030440 xustar00112 path=icedtea-web-1.5.3/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarUrlSigned1.jnlp 30 mtime=1441974582.539016486 30 atime=1441974656.587868874 30 ctime=1441974670.129024748 icedtea-web-1.5.3/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarUrlSigned1.jn0000664000076400007640000000423612574544466034633 0ustar00jvanekjvanek00000000000000 ParametrizedJarUrlSigned1 IcedTea ParametrizedJarUrlSigned1 icedtea-web-1.5.3/tests/reproducers/simple/ParametrizedJarUrl/resources/PaxHeaders.24993/Parametrize0000644000000000000000000000031112574544466030437 xustar00111 path=icedtea-web-1.5.3/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarUrlSigned.html 30 mtime=1441974582.539016486 30 atime=1441974656.587868874 30 ctime=1441974670.129024748 icedtea-web-1.5.3/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarUrlSigned.htm0000664000076400007640000000356512574544466034737 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/simple/ParametrizedJarUrl/resources/PaxHeaders.24993/Parametrize0000644000000000000000000000013212574544466030440 xustar0030 mtime=1441974582.539016486 30 atime=1441974656.587868874 30 ctime=1441974670.129024748 icedtea-web-1.5.3/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarUrl2.jnlp0000664000076400007640000000420012574544466034025 0ustar00jvanekjvanek00000000000000 ParametrizedJarUrl2 IcedTea ParametrizedJarUrl2 icedtea-web-1.5.3/tests/reproducers/simple/ParametrizedJarUrl/resources/PaxHeaders.24993/Parametrize0000644000000000000000000000013212574544466030440 xustar0030 mtime=1441974582.539016486 30 atime=1441974656.587868874 30 ctime=1441974670.129024748 icedtea-web-1.5.3/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarUrl1.jnlp0000664000076400007640000000420012574544466034024 0ustar00jvanekjvanek00000000000000 ParametrizedJarUrl1 IcedTea ParametrizedJarUrl1 icedtea-web-1.5.3/tests/reproducers/simple/ParametrizedJarUrl/resources/PaxHeaders.24993/Parametrize0000644000000000000000000000013212574544466030440 xustar0030 mtime=1441974582.538016474 30 atime=1441974656.587868874 30 ctime=1441974670.129024748 icedtea-web-1.5.3/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarUrl.html0000664000076400007640000000355112574544466033754 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/simple/ParametrizedJarUrl/resources/PaxHeaders.24993/Parametrize0000644000000000000000000000032012574544466030437 xustar00118 path=icedtea-web-1.5.3/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarAppletUrlSigned2.jnlp 30 mtime=1441974582.538016474 30 atime=1441974656.586868862 30 ctime=1441974670.129024748 icedtea-web-1.5.3/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarAppletUrlSign0000664000076400007640000000452612574544466035003 0ustar00jvanekjvanek00000000000000 AppletTest IcedTea AppletTest icedtea-web-1.5.3/tests/reproducers/simple/ParametrizedJarUrl/resources/PaxHeaders.24993/Parametrize0000644000000000000000000000031712574544466030445 xustar00117 path=icedtea-web-1.5.3/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarAppletUrlSigned.jnlp 30 mtime=1441974582.538016474 30 atime=1441974656.586868862 30 ctime=1441974670.129024748 icedtea-web-1.5.3/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarAppletUrlSign0000664000076400007640000000461412574544466035001 0ustar00jvanekjvanek00000000000000 ParametrizedJarAppletUrlSigned IcedTea ParametrizedJarAppletUrlSigned icedtea-web-1.5.3/tests/reproducers/simple/ParametrizedJarUrl/resources/PaxHeaders.24993/Parametrize0000644000000000000000000000031212574544466030440 xustar00112 path=icedtea-web-1.5.3/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarAppletUrl2.jnlp 30 mtime=1441974582.538016474 30 atime=1441974656.586868862 30 ctime=1441974670.129024748 icedtea-web-1.5.3/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarAppletUrl2.jn0000664000076400007640000000450412574544466034646 0ustar00jvanekjvanek00000000000000 AppletTest IcedTea AppletTest icedtea-web-1.5.3/tests/reproducers/simple/ParametrizedJarUrl/resources/PaxHeaders.24993/Parametrize0000644000000000000000000000031112574544466030437 xustar00111 path=icedtea-web-1.5.3/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarAppletUrl.jnlp 30 mtime=1441974582.537016463 30 atime=1441974656.586868862 30 ctime=1441974670.129024748 icedtea-web-1.5.3/tests/reproducers/simple/ParametrizedJarUrl/resources/ParametrizedJarAppletUrl.jnl0000664000076400007640000000455612574544466034747 0ustar00jvanekjvanek00000000000000 ParametrizedJarAppletUrl IcedTea ParametrizedJarAppletUrl icedtea-web-1.5.3/tests/reproducers/simple/PaxHeaders.24993/ManifestedJar20000644000000000000000000000013212574544466023172 xustar0030 mtime=1441974582.537016463 30 atime=1441974670.151025002 30 ctime=1441974670.129024748 icedtea-web-1.5.3/tests/reproducers/simple/ManifestedJar2/0000775000076400007640000000000012574544466024330 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/ManifestedJar2/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466024144 xustar0030 mtime=1441974582.537016463 30 atime=1441974670.151025002 30 ctime=1441974670.129024748 icedtea-web-1.5.3/tests/reproducers/simple/ManifestedJar2/srcs/0000775000076400007640000000000012574544466025302 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/ManifestedJar2/srcs/PaxHeaders.24993/ManifestedJar2.java0000644000000000000000000000013212574544466027662 xustar0030 mtime=1441974582.537016463 30 atime=1441974656.585868851 30 ctime=1441974670.129024748 icedtea-web-1.5.3/tests/reproducers/simple/ManifestedJar2/srcs/ManifestedJar2.java0000664000076400007640000000350412574544466030745 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/ManifestedJar2/srcs/PaxHeaders.24993/META-INF0000644000000000000000000000013212574544466025304 xustar0030 mtime=1441974582.537016463 30 atime=1441974670.151025002 30 ctime=1441974670.129024748 icedtea-web-1.5.3/tests/reproducers/simple/ManifestedJar2/srcs/META-INF/0000775000076400007640000000000012574544466026442 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/ManifestedJar2/srcs/META-INF/PaxHeaders.24993/MANIFEST.MF0000644000000000000000000000013212574544466027013 xustar0030 mtime=1441974582.537016463 30 atime=1441974656.585868851 30 ctime=1441974670.129024748 icedtea-web-1.5.3/tests/reproducers/simple/ManifestedJar2/srcs/META-INF/MANIFEST.MF0000664000076400007640000000006212574544466030072 0ustar00jvanekjvanek00000000000000Manifest-Version: 1.0 Main-Class: ManifestedJar2 icedtea-web-1.5.3/tests/reproducers/simple/PaxHeaders.24993/ManifestedJar10000644000000000000000000000013212574544466023171 xustar0030 mtime=1441974582.536016451 30 atime=1441974670.151025002 30 ctime=1441974670.128024737 icedtea-web-1.5.3/tests/reproducers/simple/ManifestedJar1/0000775000076400007640000000000012574544466024327 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/ManifestedJar1/PaxHeaders.24993/testcases0000644000000000000000000000013212574544466025167 xustar0030 mtime=1441974582.536016451 30 atime=1441974670.151025002 30 ctime=1441974670.128024737 icedtea-web-1.5.3/tests/reproducers/simple/ManifestedJar1/testcases/0000775000076400007640000000000012574544466026325 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/ManifestedJar1/testcases/PaxHeaders.24993/ManifestedJar1T0000644000000000000000000000013212574544466030110 xustar0030 mtime=1441974582.536016451 30 atime=1441974656.585868851 30 ctime=1441974670.128024737 icedtea-web-1.5.3/tests/reproducers/simple/ManifestedJar1/testcases/ManifestedJar1Test.java0000664000076400007640000002162712574544466032635 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/ManifestedJar1/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466024143 xustar0030 mtime=1441974582.536016451 30 atime=1441974670.151025002 30 ctime=1441974670.128024737 icedtea-web-1.5.3/tests/reproducers/simple/ManifestedJar1/srcs/0000775000076400007640000000000012574544466025301 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/ManifestedJar1/srcs/PaxHeaders.24993/ManifestedJar1.java0000644000000000000000000000013212574544466027660 xustar0030 mtime=1441974582.536016451 30 atime=1441974656.585868851 30 ctime=1441974670.128024737 icedtea-web-1.5.3/tests/reproducers/simple/ManifestedJar1/srcs/ManifestedJar1.java0000664000076400007640000000350412574544466030743 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/ManifestedJar1/srcs/PaxHeaders.24993/META-INF0000644000000000000000000000013212574544466025303 xustar0030 mtime=1441974582.535016439 30 atime=1441974670.151025002 30 ctime=1441974670.128024737 icedtea-web-1.5.3/tests/reproducers/simple/ManifestedJar1/srcs/META-INF/0000775000076400007640000000000012574544466026441 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/ManifestedJar1/srcs/META-INF/PaxHeaders.24993/MANIFEST.MF0000644000000000000000000000013112574544466027011 xustar0030 mtime=1441974582.535016439 29 atime=1441974656.58486884 30 ctime=1441974670.128024737 icedtea-web-1.5.3/tests/reproducers/simple/ManifestedJar1/srcs/META-INF/MANIFEST.MF0000664000076400007640000000006212574544466030071 0ustar00jvanekjvanek00000000000000Manifest-Version: 1.0 Main-Class: ManifestedJar1 icedtea-web-1.5.3/tests/reproducers/simple/ManifestedJar1/PaxHeaders.24993/resources0000644000000000000000000000013212574544466025203 xustar0030 mtime=1441974582.535016439 30 atime=1441974670.151025002 30 ctime=1441974670.128024737 icedtea-web-1.5.3/tests/reproducers/simple/ManifestedJar1/resources/0000775000076400007640000000000012574544466026341 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/ManifestedJar1/resources/PaxHeaders.24993/ManifestedJar-10000644000000000000000000000032312574544466030057 xustar00122 path=icedtea-web-1.5.3/tests/reproducers/simple/ManifestedJar1/resources/ManifestedJar-1nothing2nothingNoAppDesc.jnlp 30 mtime=1441974582.535016439 29 atime=1441974656.58486884 30 ctime=1441974670.128024737 icedtea-web-1.5.3/tests/reproducers/simple/ManifestedJar1/resources/ManifestedJar-1nothing2nothingNo0000664000076400007640000000432412574544466034476 0ustar00jvanekjvanek00000000000000 ManifestedJar-1nothing2nothingNoAppDesc IcedTea testing jar with manin class in manifest. Hello from manifestedjar1 should be printed icedtea-web-1.5.3/tests/reproducers/simple/ManifestedJar1/resources/PaxHeaders.24993/ManifestedJar-10000644000000000000000000000032112574544466030055 xustar00120 path=icedtea-web-1.5.3/tests/reproducers/simple/ManifestedJar1/resources/ManifestedJar-1nothing2nothingAppDesc.jnlp 30 mtime=1441974582.535016439 29 atime=1441974656.58486884 30 ctime=1441974670.128024737 icedtea-web-1.5.3/tests/reproducers/simple/ManifestedJar1/resources/ManifestedJar-1nothing2nothingAp0000664000076400007640000000435212574544466034463 0ustar00jvanekjvanek00000000000000 ManifestedJar-1nothing2nothingAppDesc IcedTea testing jar with manin class in manifest. Hello from manifestedjar2 should be printed icedtea-web-1.5.3/tests/reproducers/simple/ManifestedJar1/resources/PaxHeaders.24993/ManifestedJar-10000644000000000000000000000031112574544466030054 xustar00112 path=icedtea-web-1.5.3/tests/reproducers/simple/ManifestedJar1/resources/ManifestedJar-1noAppDescAtAll.jnlp 30 mtime=1441974582.535016439 29 atime=1441974656.58486884 30 ctime=1441974670.128024737 icedtea-web-1.5.3/tests/reproducers/simple/ManifestedJar1/resources/ManifestedJar-1noAppDescAtAll.jn0000664000076400007640000000417612574544466034267 0ustar00jvanekjvanek00000000000000 ManifestedJar-1noAppDescAtAll IcedTea testing jar with manin class in manifest, exception during launching, no application specified icedtea-web-1.5.3/tests/reproducers/simple/ManifestedJar1/resources/PaxHeaders.24993/ManifestedJar-10000644000000000000000000000013212574544466030055 xustar0030 mtime=1441974582.534016428 30 atime=1441974656.583868828 30 ctime=1441974670.128024737 icedtea-web-1.5.3/tests/reproducers/simple/ManifestedJar1/resources/ManifestedJar-1noAppDesc.jnlp0000664000076400007640000000421312574544466033675 0ustar00jvanekjvanek00000000000000 ManifestedJar-1noAppDesc IcedTea testing jar with manin class in manifest, hello from manifestedjar1 shold be printed icedtea-web-1.5.3/tests/reproducers/simple/ManifestedJar1/resources/PaxHeaders.24993/ManifestedJar-10000644000000000000000000000031112574544466030054 xustar00111 path=icedtea-web-1.5.3/tests/reproducers/simple/ManifestedJar1/resources/ManifestedJar-1mainNoAppDesc.jnlp 30 mtime=1441974582.534016428 30 atime=1441974656.583868828 30 ctime=1441974670.128024737 icedtea-web-1.5.3/tests/reproducers/simple/ManifestedJar1/resources/ManifestedJar-1mainNoAppDesc.jnl0000664000076400007640000000424512574544466034327 0ustar00jvanekjvanek00000000000000 ManifestedJar-1mainNoAppDesc.jnlp IcedTea testing jar with manin class in manifest, hello from manifestedjar should be printed icedtea-web-1.5.3/tests/reproducers/simple/ManifestedJar1/resources/PaxHeaders.24993/ManifestedJar-10000644000000000000000000000031312574544466030056 xustar00113 path=icedtea-web-1.5.3/tests/reproducers/simple/ManifestedJar1/resources/ManifestedJar-1mainHaveAppDesc.jnlp 30 mtime=1441974582.534016428 30 atime=1441974656.583868828 30 ctime=1441974670.128024737 icedtea-web-1.5.3/tests/reproducers/simple/ManifestedJar1/resources/ManifestedJar-1mainHaveAppDesc.j0000664000076400007640000000440212574544466034277 0ustar00jvanekjvanek00000000000000 "ManifestedJar-1mainHaveAppDesc.jnlp IcedTea testing jar with manin class in manifest, hello from manifestedjar2 should be printed icedtea-web-1.5.3/tests/reproducers/simple/ManifestedJar1/resources/PaxHeaders.24993/ManifestedJar-10000644000000000000000000000032112574544466030055 xustar00119 path=icedtea-web-1.5.3/tests/reproducers/simple/ManifestedJar1/resources/ManifestedJar-1main2nothingNoAppDesc.jnlp 30 mtime=1441974582.533016417 30 atime=1441974656.583868828 30 ctime=1441974670.128024737 icedtea-web-1.5.3/tests/reproducers/simple/ManifestedJar1/resources/ManifestedJar-1main2nothingNoApp0000664000076400007640000000433112574544466034413 0ustar00jvanekjvanek00000000000000 ManifestedJar-1main2nothingNoAppDesc IcedTea testing jar with manin class in manifest, hello from manifestedjar2 should be printed icedtea-web-1.5.3/tests/reproducers/simple/ManifestedJar1/resources/PaxHeaders.24993/ManifestedJar-10000644000000000000000000000031612574544466030061 xustar00116 path=icedtea-web-1.5.3/tests/reproducers/simple/ManifestedJar1/resources/ManifestedJar-1main2mainNoAppDesc.jnlp 30 mtime=1441974582.533016417 30 atime=1441974656.582868816 30 ctime=1441974670.128024737 icedtea-web-1.5.3/tests/reproducers/simple/ManifestedJar1/resources/ManifestedJar-1main2mainNoAppDes0000664000076400007640000000434012574544466034325 0ustar00jvanekjvanek00000000000000 ManifestedJar-1main2mainNoAppDesc.jnlp IcedTea testing jar with manin class in manifest, hello from manifestedjar1 should go out icedtea-web-1.5.3/tests/reproducers/simple/ManifestedJar1/resources/PaxHeaders.24993/ManifestedJar-10000644000000000000000000000031412574544466030057 xustar00114 path=icedtea-web-1.5.3/tests/reproducers/simple/ManifestedJar1/resources/ManifestedJar-1main2mainAppDesc.jnlp 30 mtime=1441974582.533016417 30 atime=1441974656.582868816 30 ctime=1441974670.128024737 icedtea-web-1.5.3/tests/reproducers/simple/ManifestedJar1/resources/ManifestedJar-1main2mainAppDesc.0000664000076400007640000000435312574544466034255 0ustar00jvanekjvanek00000000000000 Test Thread.getAllStackTraces IcedTea testing jar with manin class in manifest. Invalid xml exception should go out icedtea-web-1.5.3/tests/reproducers/simple/PaxHeaders.24993/LocalisedInformationElement0000644000000000000000000000013212574544466026013 xustar0030 mtime=1441974582.532016405 30 atime=1441974670.151025002 30 ctime=1441974670.128024737 icedtea-web-1.5.3/tests/reproducers/simple/LocalisedInformationElement/0000775000076400007640000000000012574544466027151 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/LocalisedInformationElement/PaxHeaders.24993/testcases0000644000000000000000000000013212574544466030011 xustar0030 mtime=1441974582.533016417 30 atime=1441974670.151025002 30 ctime=1441974670.128024737 icedtea-web-1.5.3/tests/reproducers/simple/LocalisedInformationElement/testcases/0000775000076400007640000000000012574544466031147 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/LocalisedInformationElement/testcases/PaxHeaders.24993/Lo0000644000000000000000000000033112574544466030364 xustar00127 path=icedtea-web-1.5.3/tests/reproducers/simple/LocalisedInformationElement/testcases/LocalisedInformationElementTest.java 30 mtime=1441974582.533016417 30 atime=1441974656.582868816 30 ctime=1441974670.128024737 icedtea-web-1.5.3/tests/reproducers/simple/LocalisedInformationElement/testcases/LocalisedInformatio0000664000076400007640000004207612574544466035032 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/LocalisedInformationElement/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466026765 xustar0030 mtime=1441974582.532016405 30 atime=1441974670.151025002 30 ctime=1441974670.128024737 icedtea-web-1.5.3/tests/reproducers/simple/LocalisedInformationElement/srcs/0000775000076400007640000000000012574544466030123 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/LocalisedInformationElement/srcs/PaxHeaders.24993/Localis0000644000000000000000000000032012574544466030352 xustar00118 path=icedtea-web-1.5.3/tests/reproducers/simple/LocalisedInformationElement/srcs/LocalisedInformationElement.java 30 mtime=1441974582.532016405 30 atime=1441974656.582868816 30 ctime=1441974670.128024737 icedtea-web-1.5.3/tests/reproducers/simple/LocalisedInformationElement/srcs/LocalisedInformationElem0000664000076400007640000000424412574544466034762 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/LocalisedInformationElement/PaxHeaders.24993/resources0000644000000000000000000000013212574544466030025 xustar0030 mtime=1441974582.532016405 30 atime=1441974670.151025002 30 ctime=1441974670.128024737 icedtea-web-1.5.3/tests/reproducers/simple/LocalisedInformationElement/resources/0000775000076400007640000000000012574544466031163 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/LocalisedInformationElement/resources/PaxHeaders.24993/Lo0000644000000000000000000000033312574544466030402 xustar00129 path=icedtea-web-1.5.3/tests/reproducers/simple/LocalisedInformationElement/resources/LocalisedInformationElement_noLoc.jnlp 30 mtime=1441974582.532016405 30 atime=1441974656.581868805 30 ctime=1441974670.128024737 icedtea-web-1.5.3/tests/reproducers/simple/LocalisedInformationElement/resources/LocalisedInformatio0000664000076400007640000000427312574544466035043 0ustar00jvanekjvanek00000000000000 localisedJnlp_noLoc.jnlp1 IcedTea LocalisedInformationElement_noLoc.jnlp icedtea-web-1.5.3/tests/reproducers/simple/LocalisedInformationElement/resources/PaxHeaders.24993/Lo0000644000000000000000000000032612574544466030404 xustar00124 path=icedtea-web-1.5.3/tests/reproducers/simple/LocalisedInformationElement/resources/LocalisedInformationElement4.jnlp 30 mtime=1441974582.531016393 30 atime=1441974656.581868805 30 ctime=1441974670.128024737 icedtea-web-1.5.3/tests/reproducers/simple/LocalisedInformationElement/resources/LocalisedInformatio0000664000076400007640000000533612574544466035044 0ustar00jvanekjvanek00000000000000 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.5.3/tests/reproducers/simple/LocalisedInformationElement/resources/PaxHeaders.24993/Lo0000644000000000000000000000032612574544466030404 xustar00124 path=icedtea-web-1.5.3/tests/reproducers/simple/LocalisedInformationElement/resources/LocalisedInformationElement3.jnlp 30 mtime=1441974582.531016393 30 atime=1441974656.581868805 30 ctime=1441974670.128024737 icedtea-web-1.5.3/tests/reproducers/simple/LocalisedInformationElement/resources/LocalisedInformatio0000664000076400007640000000524212574544466035040 0ustar00jvanekjvanek00000000000000 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.5.3/tests/reproducers/simple/LocalisedInformationElement/resources/PaxHeaders.24993/Lo0000644000000000000000000000032612574544466030404 xustar00124 path=icedtea-web-1.5.3/tests/reproducers/simple/LocalisedInformationElement/resources/LocalisedInformationElement2.jnlp 30 mtime=1441974582.531016393 30 atime=1441974656.581868805 30 ctime=1441974670.128024737 icedtea-web-1.5.3/tests/reproducers/simple/LocalisedInformationElement/resources/LocalisedInformatio0000664000076400007640000000547312574544466035046 0ustar00jvanekjvanek00000000000000 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.5.3/tests/reproducers/simple/LocalisedInformationElement/resources/PaxHeaders.24993/Lo0000644000000000000000000000032612574544466030404 xustar00124 path=icedtea-web-1.5.3/tests/reproducers/simple/LocalisedInformationElement/resources/LocalisedInformationElement1.jnlp 30 mtime=1441974582.531016393 30 atime=1441974656.581868805 30 ctime=1441974670.128024737 icedtea-web-1.5.3/tests/reproducers/simple/LocalisedInformationElement/resources/LocalisedInformatio0000664000076400007640000000555512574544466035047 0ustar00jvanekjvanek00000000000000 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.5.3/tests/reproducers/simple/PaxHeaders.24993/LocalesTest0000644000000000000000000000013212574544466022616 xustar0030 mtime=1441974582.530016382 30 atime=1441974670.151025002 30 ctime=1441974670.128024737 icedtea-web-1.5.3/tests/reproducers/simple/LocalesTest/0000775000076400007640000000000012574544466023754 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/LocalesTest/PaxHeaders.24993/testcases0000644000000000000000000000013212574544466024614 xustar0030 mtime=1441974582.530016382 30 atime=1441974670.151025002 30 ctime=1441974670.128024737 icedtea-web-1.5.3/tests/reproducers/simple/LocalesTest/testcases/0000775000076400007640000000000012574544466025752 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/LocalesTest/testcases/PaxHeaders.24993/LocalesTestTest.ja0000644000000000000000000000013212574544466030267 xustar0030 mtime=1441974582.530016382 30 atime=1441974656.580868793 30 ctime=1441974670.128024737 icedtea-web-1.5.3/tests/reproducers/simple/LocalesTest/testcases/LocalesTestTest.java0000664000076400007640000003601712574544466031706 0ustar00jvanekjvanek00000000000000/* LocalisedInformationElementTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.PropertyResourceBundle; import java.util.ResourceBundle; import java.util.Set; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import org.junit.Assert; import org.junit.Test; public class LocalesTestTest { private static ServerAccess server = new ServerAccess(); String[] keys = { "BOUsage", "BOUsage2", "BOArg", "BOParam", "BOProperty", "BOLicense", "BOVerbose", "BOAbout", "BONosecurity", "BONoupdate", "BOHeadless", "BOStrict", "BOViewer", "BXnofork", "BXclearcache", "BOHelp"}; /** * this will prepare new set of variables with wanted locale, which can be * then passed to subprocess * * @param locale - locale to be set to LANG variable, eg cs_CZ.UTF-8 */ public static String[] getChangeLocalesForSubproces(String locale) { ServerAccess.logOutputReprint("Setting locales"); Map p = System.getenv(); Set> r = p.entrySet(); List> rr = new ArrayList>(r); Collections.sort(rr, new Comparator>() { @Override public int compare(Entry o1, Entry o2) { return o1.getKey().compareTo(o2.getKey()); } }); String[] l = new String[rr.size()]; int i = 0; for (Iterator> it = rr.iterator(); it.hasNext(); i++) { Entry entry = it.next(); String v = entry.getValue(); String s = entry.getKey() + "=" + v; //System.out.println(s); if (entry.getKey().equals("LANG")) { ServerAccess.logOutputReprint("was " + v); v = locale; ServerAccess.logOutputReprint("set " + v); } s = entry.getKey() + "=" + v; l[i] = s; } return l; } private ResourceBundle getPropertiesDe() throws IOException { return getProperties("_de"); } public ResourceBundle getPropertiesCz() throws IOException { return getProperties("_cs"); } public ResourceBundle getPropertiesPl() throws IOException { return getProperties("_pl"); } public ResourceBundle getPropertiesEn() throws IOException { return getProperties(""); } public ResourceBundle getProperties(String s) throws IOException { return new PropertyResourceBundle(this.getClass().getClassLoader().getResourceAsStream("net/sourceforge/jnlp/resources/Messages" + s + ".properties")); } //just launching javaws -about to see if messages are corectly localised List javaws = Arrays.asList(new String[]{server.getJavawsLocation(), "-help", ServerAccess.HEADLES_OPTION}); @Test public void testLocalesEnUsUtf() throws Exception { String[] l = getChangeLocalesForSubproces("en_US.UTF-8"); ProcessResult pr = ServerAccess.executeProcess(javaws, null, null, l); assertEnglish(pr.stdout); assertNotCz(pr.stdout); assertNotDe(pr.stdout); assertNotPl(pr.stdout); } @Test public void testLocalesCsCz() throws Exception { String[] l = getChangeLocalesForSubproces("cs_CZ"); ProcessResult pr = ServerAccess.executeProcess(javaws, null, null, l); assertNotEnglish(pr.stdout); assertNotCz(pr.stdout); assertNotDe(pr.stdout); assertNotPl(pr.stdout); iteratePropertiesForAproxCzCs(pr.stdout); } @Test public void testLocalesCsCzUtf() throws Exception { String[] l = getChangeLocalesForSubproces("cs_CZ.UTF-8"); ProcessResult pr = ServerAccess.executeProcess(javaws, null, null, l); assertNotEnglish(pr.stdout); assertNotDe(pr.stdout); assertCz(pr.stdout); assertNotPl(pr.stdout); iteratePropertiesForAproxCzCs(pr.stdout); } @Test public void testLocalesPlPL() throws Exception { String[] l = getChangeLocalesForSubproces("pl_PL"); ProcessResult pr = ServerAccess.executeProcess(javaws, null, null, l); assertNotEnglish(pr.stdout); assertNotCz(pr.stdout); assertNotDe(pr.stdout); iteratePropertiesForAproxPl(pr.stdout); } @Test public void testLocalesPlPLUtf() throws Exception { String[] l = getChangeLocalesForSubproces("pl_PL.UTF-8"); ProcessResult pr = ServerAccess.executeProcess(javaws, null, null, l); assertNotEnglish(pr.stdout); assertNotDe(pr.stdout); assertNotCz(pr.stdout); assertPl(pr.stdout); iteratePropertiesForAproxPl(pr.stdout); } @Test public void testLocalesDeDe() throws Exception { String[] l = getChangeLocalesForSubproces("de_DE"); ProcessResult pr = ServerAccess.executeProcess(javaws, null, null, l); assertNotEnglish(pr.stdout); assertNotCz(pr.stdout); assertNotPl(pr.stdout); iteratePropertiesForAproxDe(pr.stdout); } @Test public void testLocalesDeDeUtf() throws Exception { String[] l = getChangeLocalesForSubproces("de_DE.UTF-8"); ProcessResult pr = ServerAccess.executeProcess(javaws, null, null, l); assertNotEnglish(pr.stdout); assertNotCz(pr.stdout); assertDe(pr.stdout); assertNotPl(pr.stdout); iteratePropertiesForAproxDe(pr.stdout); } @Test public void testLocalesDe_unknowButValidDeLocale() throws Exception { String[] l = getChangeLocalesForSubproces("de_LU"); ProcessResult pr = ServerAccess.executeProcess(javaws, null, null, l); assertNotEnglish(pr.stdout); assertNotCz(pr.stdout); assertNotPl(pr.stdout); iteratePropertiesForAproxDe(pr.stdout); } @Test public void testLocalesDeUtf_unknowButValidDeLocale() throws Exception { String[] l = getChangeLocalesForSubproces("de_LU.UTF-8"); ProcessResult pr = ServerAccess.executeProcess(javaws, null, null, l); assertNotEnglish(pr.stdout); assertNotCz(pr.stdout); assertDe(pr.stdout); assertNotPl(pr.stdout); iteratePropertiesForAproxDe(pr.stdout); } @Test public void testLocalesDe_globalDe() throws Exception { String[] l = getChangeLocalesForSubproces("deutsch"); ProcessResult pr = ServerAccess.executeProcess(javaws, null, null, l); assertNotEnglish(pr.stdout); assertNotCz(pr.stdout); assertNotPl(pr.stdout); iteratePropertiesForAproxDe(pr.stdout); } @Test public void testLocalesInvalid() throws Exception { String[] l = getChangeLocalesForSubproces("ax_BU"); ProcessResult pr = ServerAccess.executeProcess(javaws, null, null, l); assertEnglish(pr.stdout); assertNotCz(pr.stdout); assertNotDe(pr.stdout); assertNotPl(pr.stdout); } private void assertEnglish(String s) throws IOException { ResourceBundle props = getPropertiesEn(); iteratePropertiesFor(props, s, true, "english"); } private void assertNotEnglish(String s) throws IOException { ResourceBundle props = getPropertiesEn(); iteratePropertiesFor(props, s, false, "english"); } private void assertCz(String s) throws IOException { ResourceBundle props = getPropertiesCz(); iteratePropertiesFor(props, s, true, "czech"); } private void assertPl(String s) throws IOException { ResourceBundle props = getPropertiesPl(); iteratePropertiesFor(props, s, true, "polish"); } private void assertDe(String s) throws IOException { ResourceBundle props = getPropertiesDe(); iteratePropertiesFor(props, s, true, "de"); } private void assertNotCz(String s) throws IOException { ResourceBundle props = getPropertiesCz(); iteratePropertiesFor(props, s, false, "czech"); } private void assertNotPl(String s) throws IOException { ResourceBundle props = getPropertiesPl(); iteratePropertiesFor(props, s, false, "polish"); } private void assertNotDe(String s) throws IOException { ResourceBundle props = getPropertiesDe(); iteratePropertiesFor(props, s, false, "de"); } /** * This method is iterating all keys defined in this class, geting their value in given * properties, and then checking if given output have/have not (depends on value of assertTrue) * this string contained. * * @param props * @param outputToExamine * @param assertTrue * @param languageId */ private void iteratePropertiesFor(ResourceBundle props, String outputToExamine, boolean assertTrue, String languageId) { int keysFound = 0; for (int i = 0; i < keys.length; i++) { String string = keys[i]; String value = props.getString(string); if (value == null) { continue; } keysFound++; if (assertTrue) { Assert.assertTrue("Output must contains " + languageId + " text, failed on " + string, outputToExamine.contains(value)); } else { Assert.assertFalse("Output must NOT contains " + languageId + " text, failed on " + string, outputToExamine.contains(value)); } } Assert.assertTrue("At least one key must be found, was not", keysFound > 0); } /** * This method is iterating all keys defined in this class, geting their value in given * properties, transforming this to asci-ionly regex and then checking if * given output match/matchnot (depends on value of assertTrue) this string, * * @param outputToBeChecked * @param props bundle with strings * @param reg regexter with rules how to handle national characters * @throws IOException */ private void iteratePropertiesForAprox(String outputToBeChecked, ResourceBundle props, Regexer reg) throws IOException { int keysFound = 0; for (int i = 0; i < keys.length; i++) { String string = keys[i]; String value = props.getString(string); if (value == null) { continue; } value = reg.regexIt(value); keysFound++; { Assert.assertTrue("Output must match "+reg.getId() +" text, failed on " + string, outputToBeChecked.matches(value)); } } Assert.assertTrue("At least one key must be found, was not", keysFound > 0); } private void iteratePropertiesForAproxCzCs(String stdout) throws IOException { iteratePropertiesForAprox(stdout, getPropertiesCz(), Regexer.cz); } private void iteratePropertiesForAproxDe(String stdout) throws IOException { iteratePropertiesForAprox(stdout, getPropertiesDe(), Regexer.de); } private void iteratePropertiesForAproxPl(String stdout) throws IOException { iteratePropertiesForAprox(stdout, getPropertiesPl(), Regexer.pl); } private static final class Regexer { private static final String[] czEvil = { "á", "Ä", "Ä", "Ä›", "é", "í", "ň", "ó", "Å™", "Å¡", "Å¥", "ú", "ů", "ý", "ž", "[", "]", "(", ")"}; private static final String[] deEvil = { "ä", "ö", "ß", "ü", "[", "]", "(", ")"}; private static final String[] plEvil = { "ó", "Ä…", "Ä™", "ó", "Å‚", "ć", "Å›", "ź", "ż", "Å„", "[", "]", "(", ")"}; private static final Regexer cz = new Regexer(czEvil,"cz"); private static final Regexer de = new Regexer(deEvil,"de"); private static final Regexer pl = new Regexer(plEvil,"pl"); private final String[] map; private final String id; public Regexer(String[] map, String id) { this.map = map; this.id = id; } public String getId() { return id; } /** * This method transforms given string to asci-only regex, replacing * groups of national characters (defined by array variable) by .+ * * @param value * @return */ public String regexIt(String value) { for (int i = 0; i < map.length; i++) { String string = map[i]; value = value.replace(string, "."); value = value.replace(string.toUpperCase(), "."); } value = value.replaceAll("\\.+", ".+"); value = "(?s).*" + value + ".*"; return value; } } } icedtea-web-1.5.3/tests/reproducers/simple/PaxHeaders.24993/JavawsAWTRobotUsageSample0000644000000000000000000000013112574544466025337 xustar0029 mtime=1441974582.52901637 30 atime=1441974670.151025002 30 ctime=1441974670.128024737 icedtea-web-1.5.3/tests/reproducers/simple/JavawsAWTRobotUsageSample/0000775000076400007640000000000012574544466026476 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/JavawsAWTRobotUsageSample/PaxHeaders.24993/testcases0000644000000000000000000000013212574544466027336 xustar0030 mtime=1441974582.530016382 30 atime=1441974670.151025002 30 ctime=1441974670.128024737 icedtea-web-1.5.3/tests/reproducers/simple/JavawsAWTRobotUsageSample/testcases/0000775000076400007640000000000012574544466030474 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/JavawsAWTRobotUsageSample/testcases/PaxHeaders.24993/Java0000644000000000000000000000032512574544466030223 xustar00123 path=icedtea-web-1.5.3/tests/reproducers/simple/JavawsAWTRobotUsageSample/testcases/JavawsAWTRobotUsageSampleTest.java 30 mtime=1441974582.530016382 30 atime=1441974656.580868793 30 ctime=1441974670.128024737 icedtea-web-1.5.3/tests/reproducers/simple/JavawsAWTRobotUsageSample/testcases/JavawsAWTRobotUsageSa0000664000076400007640000002301212574544466034503 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/JavawsAWTRobotUsageSample/testcases/PaxHeaders.24993/Appl0000644000000000000000000000032412574544466030235 xustar00123 path=icedtea-web-1.5.3/tests/reproducers/simple/JavawsAWTRobotUsageSample/testcases/AppletAWTRobotUsageSampleTest.java 29 mtime=1441974582.52901637 30 atime=1441974656.580868793 30 ctime=1441974670.128024737 icedtea-web-1.5.3/tests/reproducers/simple/JavawsAWTRobotUsageSample/testcases/AppletAWTRobotUsageSa0000664000076400007640000002325512574544466034506 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/JavawsAWTRobotUsageSample/PaxHeaders.24993/srcs0000644000000000000000000000013112574544466026311 xustar0029 mtime=1441974582.52901637 30 atime=1441974670.151025002 30 ctime=1441974670.128024737 icedtea-web-1.5.3/tests/reproducers/simple/JavawsAWTRobotUsageSample/srcs/0000775000076400007640000000000012574544466027450 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/JavawsAWTRobotUsageSample/srcs/PaxHeaders.24993/JavawsAWT0000644000000000000000000000031312574544466030122 xustar00114 path=icedtea-web-1.5.3/tests/reproducers/simple/JavawsAWTRobotUsageSample/srcs/JavawsAWTRobotUsageSample.java 29 mtime=1441974582.52901637 30 atime=1441974656.580868793 30 ctime=1441974670.128024737 icedtea-web-1.5.3/tests/reproducers/simple/JavawsAWTRobotUsageSample/srcs/JavawsAWTRobotUsageSample.0000664000076400007640000001355412574544466034425 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/JavawsAWTRobotUsageSample/PaxHeaders.24993/resources0000644000000000000000000000013112574544466027351 xustar0029 mtime=1441974582.52901637 30 atime=1441974670.151025002 30 ctime=1441974670.128024737 icedtea-web-1.5.3/tests/reproducers/simple/JavawsAWTRobotUsageSample/resources/0000775000076400007640000000000012574544466030510 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/JavawsAWTRobotUsageSample/resources/PaxHeaders.24993/java0000644000000000000000000000032312574544466030275 xustar00122 path=icedtea-web-1.5.3/tests/reproducers/simple/JavawsAWTRobotUsageSample/resources/javaws-awtrobot-usage-sample.jnlp 29 mtime=1441974582.52901637 30 atime=1441974656.579868782 30 ctime=1441974670.128024737 icedtea-web-1.5.3/tests/reproducers/simple/JavawsAWTRobotUsageSample/resources/javaws-awtrobot-usage0000664000076400007640000000455112574544466034674 0ustar00jvanekjvanek00000000000000 AWTRobot usage sample IcedTea AWTRobot usage sample icedtea-web-1.5.3/tests/reproducers/simple/JavawsAWTRobotUsageSample/resources/PaxHeaders.24993/Appl0000644000000000000000000000032112574544466030246 xustar00119 path=icedtea-web-1.5.3/tests/reproducers/simple/JavawsAWTRobotUsageSample/resources/AppletAWTRobotUsageSample.html 30 mtime=1441974582.528016359 30 atime=1441974656.579868782 30 ctime=1441974670.128024737 icedtea-web-1.5.3/tests/reproducers/simple/JavawsAWTRobotUsageSample/resources/AppletAWTRobotUsageSa0000664000076400007640000000464012574544466034517 0ustar00jvanekjvanek00000000000000 AWTRobot usage sample page with an applet










icedtea-web-1.5.3/tests/reproducers/simple/PaxHeaders.24993/JavawsAWTRobotFindsButton0000644000000000000000000000013212574544466025371 xustar0030 mtime=1441974582.528016359 30 atime=1441974670.151025002 30 ctime=1441974670.128024737 icedtea-web-1.5.3/tests/reproducers/simple/JavawsAWTRobotFindsButton/0000775000076400007640000000000012574544466026527 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/JavawsAWTRobotFindsButton/PaxHeaders.24993/testcases0000644000000000000000000000013212574544466027367 xustar0030 mtime=1441974582.528016359 30 atime=1441974670.151025002 30 ctime=1441974670.128024737 icedtea-web-1.5.3/tests/reproducers/simple/JavawsAWTRobotFindsButton/testcases/0000775000076400007640000000000012574544466030525 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/JavawsAWTRobotFindsButton/testcases/PaxHeaders.24993/butt0000644000000000000000000000013212574544466030345 xustar0030 mtime=1441974582.528016359 30 atime=1441974656.579868782 30 ctime=1441974670.128024737 icedtea-web-1.5.3/tests/reproducers/simple/JavawsAWTRobotFindsButton/testcases/buttonA.png0000664000076400007640000000070412574544466032650 0ustar00jvanekjvanek00000000000000‰PNG  IHDRj9QY)™ pHYs  šœtIMEÝ5/Ÿ ~cIDATxÚíœ1‚0€áÒ8ßÌÄìâ?a“ä~‹³¿Å7þ‰‹3“³óM7¼äåÝ£"áhNðûbŒmJ¥_úZ ÕüvûÎ`*(@ú–IÐOE±AÇHtÂ6·lÔ<¥«êHïÛ‚8^/ñà}T”ûéüùµgê`æEúÐèCúÐèCúÐèCúÐ=Âì5Ú¥€lÄúIWÕ¶ŒKÎu>‰–qBŠJ“êxÓàu½R’úMjI}õwùÑ®]¶Í@™}Ò1¥…ý¤ =Éq%?ÿ ^Û˜¿G®Öà4½Â˜°æ±Ï~µ¨ŸýLB¶jRuxýVi¯™àÂÅÁ‚Ç>;r¹QÌ]šÙ¤”´NˆÜtñ›ëf¡¢Ø”msØîؤñÙ¤ÑUµJã¦{^ô¡}€>ô¡}€>ô¡}€>ô¡o=Dž6ßOg¼LÔw¼^ܯÞ`€_ëÑ1•–óOLè[&?ÖM¯A­IEND®B`‚icedtea-web-1.5.3/tests/reproducers/simple/JavawsAWTRobotFindsButton/testcases/PaxHeaders.24993/Java0000644000000000000000000000032512574544466030254 xustar00123 path=icedtea-web-1.5.3/tests/reproducers/simple/JavawsAWTRobotFindsButton/testcases/JavawsAWTRobotFindsButtonTest.java 30 mtime=1441974582.528016359 30 atime=1441974656.579868782 30 ctime=1441974670.128024737 icedtea-web-1.5.3/tests/reproducers/simple/JavawsAWTRobotFindsButton/testcases/JavawsAWTRobotFindsBu0000664000076400007640000001171212574544466034542 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/JavawsAWTRobotFindsButton/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466026343 xustar0030 mtime=1441974582.527016347 30 atime=1441974670.151025002 30 ctime=1441974670.127024726 icedtea-web-1.5.3/tests/reproducers/simple/JavawsAWTRobotFindsButton/srcs/0000775000076400007640000000000012574544466027501 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/JavawsAWTRobotFindsButton/srcs/PaxHeaders.24993/JavawsAWT0000644000000000000000000000031412574544466030154 xustar00114 path=icedtea-web-1.5.3/tests/reproducers/simple/JavawsAWTRobotFindsButton/srcs/JavawsAWTRobotFindsButton.java 30 mtime=1441974582.527016347 30 atime=1441974656.578868771 30 ctime=1441974670.127024726 icedtea-web-1.5.3/tests/reproducers/simple/JavawsAWTRobotFindsButton/srcs/JavawsAWTRobotFindsButton.0000664000076400007640000001131212574544466034475 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/JavawsAWTRobotFindsButton/PaxHeaders.24993/resources0000644000000000000000000000013212574544466027403 xustar0030 mtime=1441974582.527016347 30 atime=1441974670.151025002 30 ctime=1441974670.127024726 icedtea-web-1.5.3/tests/reproducers/simple/JavawsAWTRobotFindsButton/resources/0000775000076400007640000000000012574544466030541 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/JavawsAWTRobotFindsButton/resources/PaxHeaders.24993/java0000644000000000000000000000032412574544466030327 xustar00122 path=icedtea-web-1.5.3/tests/reproducers/simple/JavawsAWTRobotFindsButton/resources/javaws-awtrobot-finds-button.jnlp 30 mtime=1441974582.527016347 30 atime=1441974656.578868771 30 ctime=1441974670.127024726 icedtea-web-1.5.3/tests/reproducers/simple/JavawsAWTRobotFindsButton/resources/javaws-awtrobot-finds0000664000076400007640000000455112574544466034724 0ustar00jvanekjvanek00000000000000 AWTRobot usage sample IcedTea AWTRobot usage sample icedtea-web-1.5.3/tests/reproducers/simple/PaxHeaders.24993/JavascriptURLProtocol0000644000000000000000000000013212574544466024607 xustar0030 mtime=1441974582.527016347 30 atime=1441974670.151025002 30 ctime=1441974670.127024726 icedtea-web-1.5.3/tests/reproducers/simple/JavascriptURLProtocol/0000775000076400007640000000000012574544466025745 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/JavascriptURLProtocol/PaxHeaders.24993/testcases0000644000000000000000000000013212574544466026605 xustar0030 mtime=1441974582.527016347 30 atime=1441974670.151025002 30 ctime=1441974670.127024726 icedtea-web-1.5.3/tests/reproducers/simple/JavascriptURLProtocol/testcases/0000775000076400007640000000000012574544466027743 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/JavascriptURLProtocol/testcases/PaxHeaders.24993/Javascri0000644000000000000000000000031212574544466030347 xustar00112 path=icedtea-web-1.5.3/tests/reproducers/simple/JavascriptURLProtocol/testcases/JavascriptProtocolTest.java 30 mtime=1441974582.527016347 30 atime=1441974656.578868771 30 ctime=1441974670.127024726 icedtea-web-1.5.3/tests/reproducers/simple/JavascriptURLProtocol/testcases/JavascriptProtocolTest.ja0000664000076400007640000000637512574544466034762 0ustar00jvanekjvanek00000000000000/* Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the 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.5.3/tests/reproducers/simple/JavascriptURLProtocol/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466025561 xustar0030 mtime=1441974582.526016336 30 atime=1441974670.151025002 30 ctime=1441974670.127024726 icedtea-web-1.5.3/tests/reproducers/simple/JavascriptURLProtocol/srcs/0000775000076400007640000000000012574544466026717 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/JavascriptURLProtocol/srcs/PaxHeaders.24993/JavascriptPro0000644000000000000000000000013212574544466030350 xustar0030 mtime=1441974582.526016336 30 atime=1441974656.578868771 30 ctime=1441974670.127024726 icedtea-web-1.5.3/tests/reproducers/simple/JavascriptURLProtocol/srcs/JavascriptProtocol.java0000664000076400007640000000115112574544466033410 0ustar00jvanekjvanek00000000000000import 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.5.3/tests/reproducers/simple/JavascriptURLProtocol/PaxHeaders.24993/resources0000644000000000000000000000013212574544466026621 xustar0030 mtime=1441974582.526016336 30 atime=1441974670.151025002 30 ctime=1441974670.127024726 icedtea-web-1.5.3/tests/reproducers/simple/JavascriptURLProtocol/resources/0000775000076400007640000000000012574544466027757 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/JavascriptURLProtocol/resources/PaxHeaders.24993/Javascri0000644000000000000000000000013212574544466030363 xustar0030 mtime=1441974582.526016336 30 atime=1441974656.577868759 30 ctime=1441974670.127024726 icedtea-web-1.5.3/tests/reproducers/simple/JavascriptURLProtocol/resources/JavascriptProtocol.js0000664000076400007640000000023712574544466034147 0ustar00jvanekjvanek00000000000000var applet = document.getElementById('applet') function runSomeJS() { applet.print("Javascript URL string was evaluated.") applet.state = "HasRun"; } icedtea-web-1.5.3/tests/reproducers/simple/JavascriptURLProtocol/resources/PaxHeaders.24993/Javascri0000644000000000000000000000013212574544466030363 xustar0030 mtime=1441974582.526016336 30 atime=1441974656.577868759 30 ctime=1441974670.127024726 icedtea-web-1.5.3/tests/reproducers/simple/JavascriptURLProtocol/resources/JavascriptProtocol.html0000664000076400007640000000354712574544466034506 0ustar00jvanekjvanek00000000000000 icedtea-web-1.5.3/tests/reproducers/simple/PaxHeaders.24993/JavascriptSet0000644000000000000000000000013212574544466023156 xustar0030 mtime=1441974582.525016324 30 atime=1441974670.151025002 30 ctime=1441974670.127024726 icedtea-web-1.5.3/tests/reproducers/simple/JavascriptSet/0000775000076400007640000000000012574544466024314 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/JavascriptSet/PaxHeaders.24993/testcases0000644000000000000000000000013212574544466025154 xustar0030 mtime=1441974582.525016324 30 atime=1441974670.151025002 30 ctime=1441974670.127024726 icedtea-web-1.5.3/tests/reproducers/simple/JavascriptSet/testcases/0000775000076400007640000000000012574544466026312 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/JavascriptSet/testcases/PaxHeaders.24993/JavascriptSetTes0000644000000000000000000000013212574544466030412 xustar0030 mtime=1441974582.525016324 30 atime=1441974656.577868759 30 ctime=1441974670.127024726 icedtea-web-1.5.3/tests/reproducers/simple/JavascriptSet/testcases/JavascriptSetTest.java0000664000076400007640000001773212574544466032611 0ustar00jvanekjvanek00000000000000/* JToJSSetTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.CountingClosingListener; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import org.junit.Assert; import org.junit.Test; public class JavascriptSetTest extends BrowserTest { public final boolean doNotRunInOpera = true; private final String initStr = "JToJSSet applet initialized."; private final String afterStr = "afterTests"; private class CountingClosingListenerImpl extends CountingClosingListener { @Override protected boolean isAlowedToFinish(String s) { return (s.contains(initStr) && s.contains(afterStr)); } } private void evaluateStdoutContents(String[] expectedStdoutsOR, ProcessResult pr) { // Assert that the applet was initialized. Assert.assertTrue("JToJSSetTest stdout should contain " + initStr + " but it didnt.", pr.stdout.contains(initStr)); // Assert that the values set from JavaScript are ok boolean atLeastOne = false; for(String s : expectedStdoutsOR){ if(pr.stdout.contains(s)) atLeastOne = true; } Assert.assertTrue("JToJSSet: the output should include at least one of expected Stdouts, but it didnt.", atLeastOne); } private void javaToJSSetTest(String urlEnd, String[] expectedValsOR) throws Exception { if( doNotRunInOpera){ Browsers b = server.getCurrentBrowser().getID(); if(b == Browsers.opera){ return; } } String strURL = "/JavascriptSet.html?" + urlEnd; ProcessResult pr = server.executeBrowser(strURL, new CountingClosingListenerImpl(), new CountingClosingListenerImpl()); evaluateStdoutContents(expectedValsOR, pr); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSSet_int_Test() throws Exception { javaToJSSetTest("jjsSetInt", new String[] {"1"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSSet_Integer_Test() throws Exception { javaToJSSetTest("jjsSetInteger", new String[] {"2"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSSet_double_Test() throws Exception { javaToJSSetTest("jjsSetdouble", new String[] {"2.5"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSSet_Double_Test() throws Exception { javaToJSSetTest("jjsSetDouble", new String[] {"2.5"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSSet_float_Test() throws Exception { javaToJSSetTest("jjsSetfloat", new String[]{"2.5"}); //2.3->2.2999... } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSSet_Float_Test() throws Exception { javaToJSSetTest("jjsSetFloat", new String[] {"2.5"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSSet_long_Test() throws Exception { javaToJSSetTest("jjsSetlong", new String[] {"4294967296"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSSet_Long_Test() throws Exception { javaToJSSetTest("jjsSetLong", new String[] {"4294967297"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSSet_short_Test() throws Exception { javaToJSSetTest("jjsSetshort", new String[] {"3"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSSet_Short_Test() throws Exception { javaToJSSetTest("jjsSetShort", new String[] {"4"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSSet_byte_Test() throws Exception { javaToJSSetTest("jjsSetbyte", new String[] {"5"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSSet_Byte_Test() throws Exception { javaToJSSetTest("jjsSetByte", new String[] {"6"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSSet_char_Test() throws Exception { javaToJSSetTest("jjsSetchar", new String[] {"97"}); //i.e. 'a' } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSSet_Character_Test() throws Exception { javaToJSSetTest("jjsSetCharacter", new String[] {"97"}); //i.e. 'a' } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSSet_boolean_Test() throws Exception { javaToJSSetTest("jjsSetboolean", new String[] {"true"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSSet_Boolean_Test() throws Exception { javaToJSSetTest("jjsSetBoolean", new String[] {"true"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSSet_String_Test() throws Exception { javaToJSSetTest("jjsSetString", new String[] {"ð Žã€’£$ǣ€ð–"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSSet_object_Test() throws Exception { javaToJSSetTest("jjsSetObject", new String[] {"DummyObject2"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSSet_1DArrayElement_Test() throws Exception { javaToJSSetTest("jjsSet1DArray", new String[] {"100"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSSet_2DArrayElement_Test() throws Exception { javaToJSSetTest("jjsSet2DArray", new String[] {"200"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJToJSSet_JSObject_Test() throws Exception { javaToJSSetTest("jjsSetJSObject", new String[] {"[object Window]","[object DOMWindow]", "[object Object]"}); } } icedtea-web-1.5.3/tests/reproducers/simple/JavascriptSet/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466024130 xustar0030 mtime=1441974582.525016324 30 atime=1441974670.151025002 30 ctime=1441974670.127024726 icedtea-web-1.5.3/tests/reproducers/simple/JavascriptSet/srcs/0000775000076400007640000000000012574544466025266 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/JavascriptSet/srcs/PaxHeaders.24993/JavascriptSet.java0000644000000000000000000000013212574544466027632 xustar0030 mtime=1441974582.525016324 30 atime=1441974656.577868759 30 ctime=1441974670.127024726 icedtea-web-1.5.3/tests/reproducers/simple/JavascriptSet/srcs/JavascriptSet.java0000664000076400007640000000552012574544466030715 0ustar00jvanekjvanek00000000000000import java.applet.Applet; import netscape.javascript.JSObject; public class JavascriptSet extends Applet { private JSObject window; public void init() { window = JSObject.getWindow(this); String initStr = "JToJSSet applet initialized."; System.out.println(initStr); } // methods for testing setting of JavaScript variables public void jjsSetInt() { window.setMember("setvar", (int) 1); } public void jjsSetInteger() { window.setMember("setvar", new Integer(2)); } public void jjsSetdouble() { window.setMember("setvar", (double) 2.5); } public void jjsSetDouble() { window.setMember("setvar", new Double(2.5)); } public void jjsSetfloat() { window.setMember("setvar", (float) 2.5); } public void jjsSetFloat() { window.setMember("setvar", new Float(2.5)); } public void jjsSetshort() { window.setMember("setvar", (short) 3); } public void jjsSetShort() { window.setMember("setvar", new Short((short) 4)); } public void jjsSetlong() { window.setMember("setvar", (long) 4294967296L); } public void jjsSetLong() { window.setMember("setvar", new Long(4294967297L)); } public void jjsSetbyte() { window.setMember("setvar", (byte) 5); } public void jjsSetByte() { window.setMember("setvar", new Byte((byte) 6)); } public void jjsSetchar() { window.setMember("setvar", (char) 'a'); } public void jjsSetCharacter() { window.setMember("setvar", new Character('a')); } public void jjsSetboolean() { window.setMember("setvar", (boolean) true); } public void jjsSetBoolean() { window.setMember("setvar", new Boolean(true)); } public void jjsSetString() { window.setMember("setvar", "ð Žã€’£$ǣ€ð–"); } public void jjsSetObject() { DummyObject dummyObject = new DummyObject("DummyObject2"); window.setMember("setvar", dummyObject); } public void jjsSet1DArray() { ((JSObject) window.getMember("setvar")).setSlot(1, 100); } public void jjsSet2DArray() { ((JSObject) ((JSObject) window.getMember("setvar")).getSlot(1)).setSlot(1, 200); } public void jjsSetJSObject(){ window.setMember("setvar", window); } // auxiliary class and method for writing output: public void printStrAndFinish(String str){ System.out.println(str); System.out.println("afterTests"); } public class DummyObject { private String str; public DummyObject(String s) { this.str = s; } public void setStr(String s) { this.str = s; } public String toString() { return str; } } } icedtea-web-1.5.3/tests/reproducers/simple/JavascriptSet/PaxHeaders.24993/resources0000644000000000000000000000013212574544466025170 xustar0030 mtime=1441974582.525016324 30 atime=1441974670.151025002 30 ctime=1441974670.127024726 icedtea-web-1.5.3/tests/reproducers/simple/JavascriptSet/resources/0000775000076400007640000000000012574544466026326 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/JavascriptSet/resources/PaxHeaders.24993/javascript-set.j0000644000000000000000000000013212574544466030357 xustar0030 mtime=1441974582.525016324 30 atime=1441974656.576868747 30 ctime=1441974670.127024726 icedtea-web-1.5.3/tests/reproducers/simple/JavascriptSet/resources/javascript-set.jnlp0000664000076400007640000000141712574544466032155 0ustar00jvanekjvanek00000000000000 Java to JavaScript LiveConnect - Set IcedTea LiveConnect - tests for setting JS values from Java. icedtea-web-1.5.3/tests/reproducers/simple/JavascriptSet/resources/PaxHeaders.24993/Javascript_Set.j0000644000000000000000000000013212574544466030341 xustar0030 mtime=1441974582.524016313 30 atime=1441974656.576868747 30 ctime=1441974670.127024726 icedtea-web-1.5.3/tests/reproducers/simple/JavascriptSet/resources/Javascript_Set.js0000664000076400007640000000141012574544466031601 0ustar00jvanekjvanek00000000000000function doJToJSSetTests(){ var applet = document.getElementById('jtojsSetApplet'); var urlArgs = document.URL.split("?"); var func = urlArgs[1]; //pre-initialization of arrays if(func === "jjsSet1DArray"){ setvar = new Array(); }else if(func === "jjsSet2DArray" ){ setvar = new Array(); setvar[1] = new Array(); } //calling the applet function eval('applet.'+func+'()'); //preparing jsvar value string for output if(func === "jjsSet1DArray"){ str = ""+setvar[1]; }else if(func === "jjsSet2DArray" ){ str = ""+setvar[1][1]; }else if(func === "jjsSetObject" ){ str = setvar.toString(); }else{ var str = ""+setvar; } applet.printStrAndFinish(str); } icedtea-web-1.5.3/tests/reproducers/simple/JavascriptSet/resources/PaxHeaders.24993/JavascriptSet.ht0000644000000000000000000000013212574544466030364 xustar0030 mtime=1441974582.524016313 30 atime=1441974656.576868747 30 ctime=1441974670.127024726 icedtea-web-1.5.3/tests/reproducers/simple/JavascriptSet/resources/JavascriptSet.html0000664000076400007640000000120012574544466031767 0ustar00jvanekjvanek00000000000000 Java JavaScript LiveConnect - Set values from applet

The JToJSSet html page

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

The JToJSGet html page

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

The JToJSFuncReturn html page

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

The JToJSFuncParam html page

icedtea-web-1.5.3/tests/reproducers/simple/PaxHeaders.24993/JSToJTypeConv0000644000000000000000000000013212574544466023015 xustar0030 mtime=1441974582.519016255 30 atime=1441974670.151025002 30 ctime=1441974670.126024714 icedtea-web-1.5.3/tests/reproducers/simple/JSToJTypeConv/0000775000076400007640000000000012574544466024153 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/JSToJTypeConv/PaxHeaders.24993/testcases0000644000000000000000000000013212574544466025013 xustar0030 mtime=1441974582.519016255 30 atime=1441974670.151025002 30 ctime=1441974670.126024714 icedtea-web-1.5.3/tests/reproducers/simple/JSToJTypeConv/testcases/0000775000076400007640000000000012574544466026151 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/JSToJTypeConv/testcases/PaxHeaders.24993/JSToJTypeConvTes0000644000000000000000000000013212574544466030110 xustar0030 mtime=1441974582.519016255 30 atime=1441974656.572868701 30 ctime=1441974670.126024714 icedtea-web-1.5.3/tests/reproducers/simple/JSToJTypeConv/testcases/JSToJTypeConvTest.java0000664000076400007640000004171412574544466032304 0ustar00jvanekjvanek00000000000000/* JSToJTypeConvTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.CountingClosingListener; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import org.junit.Assert; import org.junit.Test; public class JSToJTypeConvTest extends BrowserTest { //the JS<->J tests tend to make Opera unusable public final boolean doNotRunInOpera = true; private final String initStr = "JSToJTypeConv applet initialized."; private final String afterStr = "afterTests"; private class CountingClosingListenerImpl extends CountingClosingListener { @Override protected boolean isAlowedToFinish(String s) { return (s.contains(initStr) && s.contains(afterStr)); } } private void evaluateStdoutContents(String[] expectedStdouts, ProcessResult pr) { // Assert that the applet was initialized. Assert.assertTrue("JSToJTypeConv: the stdout should contain " + initStr + ", but it didnt.", pr.stdout.contains(initStr)); // Assert that the values set by JavaScript are ok for(String str : expectedStdouts){ String xmlStr = "new value"; if(str.contains("nonXML char")) { str = str.substring(12); }else{ xmlStr = str; } Assert.assertTrue("JSToJTypeConv: the output should include "+xmlStr+", but it didnt.", pr.stdout.contains(str)); } } private void jsToJavaTypeConvTest(String fieldStr, String valueStr, String[] expectedValueAndOutputs) throws Exception { if( doNotRunInOpera){ if(server.getCurrentBrowser().getID() == Browsers.opera){ return; } } String strURL = "/JSToJTypeConv.html?" + fieldStr + ";" + valueStr; ProcessResult pr = server.executeBrowser(strURL, new CountingClosingListenerImpl(), new CountingClosingListenerImpl()); String[] expectedStdouts = expectedValueAndOutputs; evaluateStdoutContents(expectedStdouts, pr); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_NumToJavaStringInteger_Test() throws Exception { jsToJavaTypeConvTest("_String", "1", new String[] {"1"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_NumToJavaStringDouble_Test() throws Exception { jsToJavaTypeConvTest("_String", "1.1", new String[] {"1.1"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_NumToJavaObjectInteger_Test() throws Exception { jsToJavaTypeConvTest("_Object", "1.0", new String[] {"1","superclass is java.lang.Number"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_NumToJavaObjectDouble_Test() throws Exception { jsToJavaTypeConvTest("_Object", "1.1", new String[] {"1.1","superclass is java.lang.Number"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_NumToboolean0_Test() throws Exception { jsToJavaTypeConvTest("_boolean", "0", new String[] {"false"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_NumToboolean1dot1_Test() throws Exception { jsToJavaTypeConvTest("_boolean", "1.1", new String[] {"true"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_BoolToJavaBoolTrue_Test() throws Exception { jsToJavaTypeConvTest("_Boolean", "true", new String[] {"true"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_BoolToJavaBoolFalse_Test() throws Exception { jsToJavaTypeConvTest("_Boolean", "false", new String[] {"false"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_BoolToJavaObject_Test() throws Exception { jsToJavaTypeConvTest("_Object", "true", new String[] {"true", "class is java.lang.Boolean"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_BoolToJavaString_Test() throws Exception { jsToJavaTypeConvTest("_String", "true", new String[] {"true"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_BoolTobyteTrue_Test() throws Exception { jsToJavaTypeConvTest("_byte", "true", new String[] {"1"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_BoolTocharTrue_Test() throws Exception { jsToJavaTypeConvTest("_char", "true", new String[] { "nonXML char "+((char)1) }); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_BoolToshortTrue_Test() throws Exception { jsToJavaTypeConvTest("_short", "true", new String[] {"1"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_BoolTointTrue_Test() throws Exception { jsToJavaTypeConvTest("_int", "true", new String[] {"1"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_BoolTolongTrue_Test() throws Exception { jsToJavaTypeConvTest("_long", "true", new String[] {"1"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_BoolTofloatTrue_Test() throws Exception { jsToJavaTypeConvTest("_float", "true", new String[] {"1"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_BoolTodoubleTrue_Test() throws Exception { jsToJavaTypeConvTest("_double", "true", new String[] {"1"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_BoolTobyteFalse_Test() throws Exception { jsToJavaTypeConvTest("_byte", "false", new String[] {"0"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_BoolTocharFalse_Test() throws Exception { jsToJavaTypeConvTest("_char", "false", new String[] { "nonXML char "+((char)0) }); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_BoolToshortFalse_Test() throws Exception { jsToJavaTypeConvTest("_short", "false", new String[] {"0"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_BoolTointFalse_Test() throws Exception { jsToJavaTypeConvTest("_int", "false", new String[] {"0"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_BoolTolongFalse_Test() throws Exception { jsToJavaTypeConvTest("_long", "false", new String[] {"0"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_BoolTofloatFalse_Test() throws Exception { jsToJavaTypeConvTest("_float", "false", new String[] {"0"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_BoolTodoubleFalse_Test() throws Exception { jsToJavaTypeConvTest("_double", "false", new String[] {"0"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_StringToObject_Test() throws Exception { jsToJavaTypeConvTest("_Object", "\"ð Žã€’£$ǣ€ð–\"", new String[] {"ð Žã€’£$ǣ€ð–"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_StringTobyte_Test() throws Exception { jsToJavaTypeConvTest("_byte", "\'1\'", new String[] {"1"}); //JS string 'str' or "str" both ok } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_StringToshort_Test() throws Exception { jsToJavaTypeConvTest("_short", "\"1\"", new String[] {"1"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_StringToint_Test() throws Exception { jsToJavaTypeConvTest("_int", "\"1\"", new String[] {"1"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_StringTolong_Test() throws Exception { jsToJavaTypeConvTest("_long", "\"1\"", new String[] {"1"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_StringTofloat_Test() throws Exception { jsToJavaTypeConvTest("_float", "\"1.1\"", new String[] {"1.1"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_StringTodouble_Test() throws Exception { jsToJavaTypeConvTest("_double", "\"1.1\"", new String[] {"1.1"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_StringTochar_Test() throws Exception { jsToJavaTypeConvTest("_char", "\"1\"", new String[] { "nonXML char "+((char)1) }); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_StringTobooleanEmptyFalse_Test() throws Exception { jsToJavaTypeConvTest("_boolean", "\"\"", new String[] {"false"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_StringTobooleanNonemptyTrue_Test() throws Exception { jsToJavaTypeConvTest("_boolean", "\"a nonempty string\"", new String[] {"true"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_ArrayTobyteArr_Test() throws Exception { jsToJavaTypeConvTest("_byteArray", "[1,null,2]", new String[] {"[1,0,2]"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_ArrayTocharArr_Test() throws Exception { jsToJavaTypeConvTest("_charArray", "[97,null,98]", new String[] {"nonXML char [a,"+((char)0) +",b]"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_ArrayToshortArr_Test() throws Exception { jsToJavaTypeConvTest("_shortArray", "[1,null,2]", new String[] {"[1,0,2]"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_ArrayTointArr_Test() throws Exception { jsToJavaTypeConvTest("_intArray", "[1,null,2]", new String[] {"[1,0,2]"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_ArrayTolongArr_Test() throws Exception { jsToJavaTypeConvTest("_longArray", "[1,null,2]", new String[] {"[1,0,2]"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_ArrayTofloatArr_Test() throws Exception { jsToJavaTypeConvTest("_floatArray", "[1,null,2]", new String[] {"[1.0,0.0,2.0]"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_ArrayTodoubleArr_Test() throws Exception { jsToJavaTypeConvTest("_doubleArray", "[1,null,2]", new String[] {"[1.0,0.0,2.0]"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_ArrayToStringArr_Test() throws Exception { jsToJavaTypeConvTest("_StringArray", "[1,null,2]", new String[] {"[1,null,2]"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_ArrayTocharArrArr_Test() throws Exception { jsToJavaTypeConvTest("_charArray2D", "[[\"97\",null,\"98\"],[],[\"99\",\"100\",null,\"101\"]]", new String[] {"nonXML char [[a,"+((char)0)+",b],[],[c,d,"+((char)0)+",e]]"}); //Error on Java side: array element type mismatch } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_ArrayToStringArrArr_Test() throws Exception { jsToJavaTypeConvTest("_StringArray2D", "[[\"00\",null,\"02\"],[],[\"20\",\"21\",null,\"23\"]]", new String[] {"[[00,null,02],[],[20,21,null,23]]"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_ArrayToString_Test() throws Exception { jsToJavaTypeConvTest("_String", "[[\"00\",null,\"02\"],[],[\"20\",\"21\",null,\"23\"]]", new String[] {"00,,02,,20,21,,23"}); //Error on Java side: array element type mismatch } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_JSObjectToJSObject_Test() throws Exception { jsToJavaTypeConvTest("_JSObject", "window", new String[] {"[object Window]"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_JSObjectToString_Test() throws Exception { jsToJavaTypeConvTest("_String", "window", new String[] {"[object Window]"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_JavaObjectToJavaObject_Test() throws Exception { jsToJavaTypeConvTest("_Object", "new applet.Packages.java.lang.Float(1.1)", new String[] {"1.1","class is java.lang.Float"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_JavaObjectToString_Test() throws Exception { jsToJavaTypeConvTest("_String", "applet.getNewDummyObject(\"dummy1\")", new String[] {"dummy1"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_nullToJavaObjectString_Test() throws Exception { jsToJavaTypeConvTest("_String", "null", new String[] {"null"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_StringTobooleanFalseStr_Test() throws Exception { jsToJavaTypeConvTest("_boolean", "\"false\"", new String[] {"true"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_StringTobooleanTrueStr_Test() throws Exception { jsToJavaTypeConvTest("_boolean", "\"true\"", new String[] {"true"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_StringToBooleanFalseStr_Test() throws Exception { jsToJavaTypeConvTest("_Boolean", "\"false\"", new String[] {"true"}); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJTypeConv_StringToBooleanTrueStr_Test() throws Exception { jsToJavaTypeConvTest("_Boolean", "\"true\"", new String[] {"true"}); } } icedtea-web-1.5.3/tests/reproducers/simple/JSToJTypeConv/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466023767 xustar0030 mtime=1441974582.519016255 30 atime=1441974670.151025002 30 ctime=1441974670.126024714 icedtea-web-1.5.3/tests/reproducers/simple/JSToJTypeConv/srcs/0000775000076400007640000000000012574544466025125 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/JSToJTypeConv/srcs/PaxHeaders.24993/JSToJTypeConv.java0000644000000000000000000000013212574544466027330 xustar0030 mtime=1441974582.519016255 30 atime=1441974656.572868701 30 ctime=1441974670.126024714 icedtea-web-1.5.3/tests/reproducers/simple/JSToJTypeConv/srcs/JSToJTypeConv.java0000664000076400007640000000712712574544466030420 0ustar00jvanekjvanek00000000000000import 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.5.3/tests/reproducers/simple/JSToJTypeConv/PaxHeaders.24993/resources0000644000000000000000000000013212574544466025027 xustar0030 mtime=1441974582.519016255 30 atime=1441974670.151025002 30 ctime=1441974670.126024714 icedtea-web-1.5.3/tests/reproducers/simple/JSToJTypeConv/resources/0000775000076400007640000000000012574544466026165 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/JSToJTypeConv/resources/PaxHeaders.24993/jstoj-typeconv.j0000644000000000000000000000013212574544466030255 xustar0030 mtime=1441974582.519016255 30 atime=1441974656.572868701 30 ctime=1441974670.126024714 icedtea-web-1.5.3/tests/reproducers/simple/JSToJTypeConv/resources/jstoj-typeconv.jnlp0000664000076400007640000000145312574544466032053 0ustar00jvanekjvanek00000000000000 JavaScript to Java LiveConnect - TypeConv IcedTea LiveConnect - tests for data type conversion from JS to Java variables. icedtea-web-1.5.3/tests/reproducers/simple/JSToJTypeConv/resources/PaxHeaders.24993/JSToJava_TypeCon0000644000000000000000000000013212574544466030111 xustar0030 mtime=1441974582.518016244 30 atime=1441974656.572868701 30 ctime=1441974670.126024714 icedtea-web-1.5.3/tests/reproducers/simple/JSToJTypeConv/resources/JSToJava_TypeConv.js0000664000076400007640000000054212574544466031774 0ustar00jvanekjvanek00000000000000function doTypeConvTests(){ var urlArgs = document.URL.split("?"); var testParams = urlArgs[1].split(";"); var applet = document.getElementById('jstojTypeConvApplet'); var field = testParams[0]; var value = decodeURIComponent(testParams[1]); eval('applet.' + field + '=' + value); applet.printNewValueAndFinish(field); } icedtea-web-1.5.3/tests/reproducers/simple/JSToJTypeConv/resources/PaxHeaders.24993/JSToJTypeConv.ht0000644000000000000000000000013212574544466030062 xustar0030 mtime=1441974582.518016244 30 atime=1441974656.572868701 30 ctime=1441974670.126024714 icedtea-web-1.5.3/tests/reproducers/simple/JSToJTypeConv/resources/JSToJTypeConv.html0000664000076400007640000000117312574544466031476 0ustar00jvanekjvanek00000000000000 JavaScript to Java LiveConnect - Types Conversion

The JSToJTypeConv html page

icedtea-web-1.5.3/tests/reproducers/simple/PaxHeaders.24993/JSToJSet0000644000000000000000000000013212574544466022001 xustar0030 mtime=1441974582.518016244 30 atime=1441974670.151025002 30 ctime=1441974670.126024714 icedtea-web-1.5.3/tests/reproducers/simple/JSToJSet/0000775000076400007640000000000012574544466023137 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/JSToJSet/PaxHeaders.24993/testcases0000644000000000000000000000013212574544466023777 xustar0030 mtime=1441974582.518016244 30 atime=1441974670.151025002 30 ctime=1441974670.126024714 icedtea-web-1.5.3/tests/reproducers/simple/JSToJSet/testcases/0000775000076400007640000000000012574544466025135 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/JSToJSet/testcases/PaxHeaders.24993/JSToJSetTest.java0000644000000000000000000000013112574544466027163 xustar0030 mtime=1441974582.518016244 29 atime=1441974656.57186869 30 ctime=1441974670.126024714 icedtea-web-1.5.3/tests/reproducers/simple/JSToJSet/testcases/JSToJSetTest.java0000664000076400007640000002241312574544466030247 0ustar00jvanekjvanek00000000000000/* JSToJSetTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.CountingClosingListener; import net.sourceforge.jnlp.annotations.Bug; import net.sourceforge.jnlp.annotations.KnownToFail; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import org.junit.Assert; import org.junit.Test; @Bug( id = { "PR1298" }) public class JSToJSetTest extends BrowserTest { //the JS<->J tests tend to make Opera unusable public final boolean doNotRunInOpera = true; private final String 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 @KnownToFail @Bug( id = {"PR1298"}) public void AppletJSToJSet_intArrayElement_Test() throws Exception { jsToJavaSetSpecialTest("_intArray[0]", "1", TestType.ARRAY_ELEMENT); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJSet_regularString_Test() throws Exception { jsToJavaSetNormalTest("_String", "teststring"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJSet_specialCharsString_Test() throws Exception { jsToJavaSetSpecialTest("_specialString", "ð Žã€’£$ǣ€ð–", TestType.NORMAL_VALUE); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJSet_null_Test() throws Exception { jsToJavaSetNormalTest("_Object", "null"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJSet_Integer_Test() throws Exception { jsToJavaSetNormalTest("_Integer", "1"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJSet_Double_Test() throws Exception { jsToJavaSetNormalTest("_Double", "1.0"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJSet_Float_Test() throws Exception { jsToJavaSetNormalTest("_Float", "1.1"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJSet_Long_Test() throws Exception { jsToJavaSetNormalTest("_Long", "10000"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJSet_Boolean_Test() throws Exception { jsToJavaSetNormalTest("_Boolean", "true"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJSet_Character_Test() throws Exception { jsToJavaSetSpecialTest("_Character", "A", TestType.NORMAL_VALUE); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJSet_Byte_Test() throws Exception { jsToJavaSetNormalTest("_Byte", "100"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay @KnownToFail @Bug( id = {"PR1298"}) public void AppletJSToJSet_DoubleArrayElement_Test() throws Exception { jsToJavaSetSpecialTest("_DoubleArray[0]", "1.1", TestType.ARRAY_ELEMENT); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJSet_DoubleFullArray_Test() throws Exception { jsToJavaSetSpecialTest("_DoubleArray2", "0.1", TestType.WHOLE_ARRAY); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJSet_JSObject_Test() throws Exception { jsToJavaSetSpecialTest("_JSObject", "100, red", TestType.NORMAL_VALUE); } } icedtea-web-1.5.3/tests/reproducers/simple/JSToJSet/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466022753 xustar0030 mtime=1441974582.517016232 30 atime=1441974670.151025002 30 ctime=1441974670.126024714 icedtea-web-1.5.3/tests/reproducers/simple/JSToJSet/srcs/0000775000076400007640000000000012574544466024111 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/JSToJSet/srcs/PaxHeaders.24993/JSToJSet.java0000644000000000000000000000013112574544466025277 xustar0030 mtime=1441974582.517016232 29 atime=1441974656.57186869 30 ctime=1441974670.126024714 icedtea-web-1.5.3/tests/reproducers/simple/JSToJSet/srcs/JSToJSet.java0000664000076400007640000000331612574544466026364 0ustar00jvanekjvanek00000000000000import java.applet.Applet; import java.lang.reflect.Array; import java.lang.reflect.Field; import netscape.javascript.JSObject; public class JSToJSet extends Applet { public int _int; public double _double; public float _float; public long _long; public boolean _boolean; public char _char; public byte _byte; public String _String; public String _specialString; public Object _Object = new String("non-null object"); public int[] _intArray = new int[1]; public Integer _Integer; public Double _Double; public Float _Float; public Long _Long; public Boolean _Boolean; public Character _Character = 'B'; public Byte _Byte; public Double[] _DoubleArray = new Double[10]; public Double[] _DoubleArray2; public char[] _charArray = new char[1]; public Character[] _CharacterArray = new Character[1]; public JSObject _JSObject; public void init() { String initStr = "JSToJSet applet initialized."; System.out.println(initStr); } public void printNewValueAndFinish(String fieldname) throws Exception { Field field = getClass().getDeclaredField(fieldname); Object value = field.get(this); if( fieldname.equals("_JSObject") ){ Integer mph = (Integer)_JSObject.getMember("mph"); String color = (String)_JSObject.getMember("color"); System.out.println("New value is: "+mph+", "+color); }else if (value != null && value.getClass().isArray()) { System.out.println("New array value is: " + Array.get(value, 0)); } else { System.out.println("New value is: " + value); } System.out.println("afterTests"); } } icedtea-web-1.5.3/tests/reproducers/simple/JSToJSet/PaxHeaders.24993/resources0000644000000000000000000000013212574544466024013 xustar0030 mtime=1441974582.517016232 30 atime=1441974670.151025002 30 ctime=1441974670.126024714 icedtea-web-1.5.3/tests/reproducers/simple/JSToJSet/resources/0000775000076400007640000000000012574544466025151 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/JSToJSet/resources/PaxHeaders.24993/jstoj-set.jnlp0000644000000000000000000000013112574544466026676 xustar0030 mtime=1441974582.517016232 29 atime=1441974656.57186869 30 ctime=1441974670.126024714 icedtea-web-1.5.3/tests/reproducers/simple/JSToJSet/resources/jstoj-set.jnlp0000664000076400007640000000137612574544466027767 0ustar00jvanekjvanek00000000000000 JavaScript to Java LiveConnect - Set RedHat LiveConnect - tests for setting members on Java side. icedtea-web-1.5.3/tests/reproducers/simple/JSToJSet/resources/PaxHeaders.24993/JSToJava_Set.js0000644000000000000000000000013112574544466026661 xustar0030 mtime=1441974582.517016232 29 atime=1441974656.57186869 30 ctime=1441974670.126024714 icedtea-web-1.5.3/tests/reproducers/simple/JSToJSet/resources/JSToJava_Set.js0000664000076400007640000000232312574544466027743 0ustar00jvanekjvanek00000000000000//dummy javascript class whose instance is passed as JSObject parameter: function JSCar(mph,color){ this.mph = mph; this.color = color; } function doSetTests( ){ var urlArgs = document.URL.split("?"); var testParams = urlArgs[1].split(";"); var applet = document.getElementById('jstojSetApplet'); var field = testParams[0]; var value = testParams[1]; if( value === "JavaScript"){ if( field === "_char"){ value = 97; } if( field === "_Character"){ value = new (applet.Packages).java.lang.Character(65); } if( field === "_specialString"){ value = "ð Žã€’£$ǣ€ð–"; } if( field === "_JSObject"){ value = new JSCar(100,"red"); } }else if(value.indexOf('[') != -1){ var elem = value.substring(1); value = new Array(); eval('value[0] = elem'); } eval('applet.' + field + '= value'); //modifiing _intArray[0] into _intArray // _DoubleArray[0] into _DoubleArray var nameEnd = field.indexOf('['); if( nameEnd != -1){ field = field.substring(0,nameEnd); } applet.printNewValueAndFinish(field); } icedtea-web-1.5.3/tests/reproducers/simple/JSToJSet/resources/PaxHeaders.24993/JSToJSet.html0000644000000000000000000000013212574544466026363 xustar0030 mtime=1441974582.516016221 30 atime=1441974656.570868678 30 ctime=1441974670.126024714 icedtea-web-1.5.3/tests/reproducers/simple/JSToJSet/resources/JSToJSet.html0000664000076400007640000000120212574544466027437 0ustar00jvanekjvanek00000000000000 JavaScript to Java LiveConnect - Set values from applet

The JSToJSet html page

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

The JSToJGet html page

icedtea-web-1.5.3/tests/reproducers/simple/PaxHeaders.24993/JSToJFuncReturn0000644000000000000000000000013212574544466023341 xustar0030 mtime=1441974582.514016198 30 atime=1441974670.151025002 30 ctime=1441974670.126024714 icedtea-web-1.5.3/tests/reproducers/simple/JSToJFuncReturn/0000775000076400007640000000000012574544466024477 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/JSToJFuncReturn/PaxHeaders.24993/testcases0000644000000000000000000000013212574544466025337 xustar0030 mtime=1441974582.514016198 30 atime=1441974670.151025002 30 ctime=1441974670.126024714 icedtea-web-1.5.3/tests/reproducers/simple/JSToJFuncReturn/testcases/0000775000076400007640000000000012574544466026475 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/JSToJFuncReturn/testcases/PaxHeaders.24993/JSToJFuncRetur0000644000000000000000000000013212574544466030126 xustar0030 mtime=1441974582.514016198 30 atime=1441974656.569868667 30 ctime=1441974670.126024714 icedtea-web-1.5.3/tests/reproducers/simple/JSToJFuncReturn/testcases/JSToJFuncReturnTest.java0000664000076400007640000002030412574544466033144 0ustar00jvanekjvanek00000000000000/* JSToJFuncReturnTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.CountingClosingListener; import net.sourceforge.jnlp.annotations.KnownToFail; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import org.junit.Assert; import org.junit.Test; public class JSToJFuncReturnTest extends BrowserTest { private final String initStr = "JSToJFuncReturn applet initialized."; private final String afterStr = "afterTests"; private class CountingClosingListenerImpl extends CountingClosingListener { @Override protected boolean isAlowedToFinish(String s) { return (s.contains(initStr) && s.contains(afterStr)); } } private void evaluateStdoutContents(String expectedStdout, ProcessResult pr) { // Assert that the applet was initialized. Assert.assertTrue("JSToJFuncReturnTest stdout should contain "+ initStr + " but it didnt.", pr.stdout.contains(initStr)); // Assert that the tests have passed. Assert.assertTrue("JSToJFuncReturnTest stdout should contain "+ expectedStdout + " but it didnt.", pr.stdout.contains(expectedStdout)); } private void jsToJavaFuncReturnNormalTest(String methodStr, String expectedStdout) throws Exception { String strURL = "/JSToJFuncReturn.html?" + methodStr; ProcessResult pr = server.executeBrowser(strURL, new CountingClosingListenerImpl(), new CountingClosingListenerImpl()); evaluateStdoutContents(expectedStdout, pr); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncReturn_int_Test() throws Exception { jsToJavaFuncReturnNormalTest("_int", "number 1"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncReturn_double_Test() throws Exception { jsToJavaFuncReturnNormalTest("_double", "number 1.1"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncReturn_float_Test() throws Exception { jsToJavaFuncReturnNormalTest("_float", "number 1.1"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncReturn_long_Test() throws Exception { jsToJavaFuncReturnNormalTest("_long", "number 10000"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncReturn_boolean_Test() throws Exception { jsToJavaFuncReturnNormalTest("_boolean", "boolean true"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncReturn_char_Test() throws Exception { jsToJavaFuncReturnNormalTest("_char", "number 97"); //'a' } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncReturn_byte_Test() throws Exception { jsToJavaFuncReturnNormalTest("_byte", "number 10"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncReturn_charArrayElement_Test() throws Exception { jsToJavaFuncReturnNormalTest("_charArrayElement", "number 97"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncReturn_void_Test() throws Exception { jsToJavaFuncReturnNormalTest("_void", "undefined undefined"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncReturn_regularString_Test() throws Exception { jsToJavaFuncReturnNormalTest("_regularString", "string test"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncReturn_specialCharsString_Test() throws Exception { jsToJavaFuncReturnNormalTest("_specialString", "string ð Žã€’£$ǣ€ð–"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncReturn_null_Test() throws Exception { jsToJavaFuncReturnNormalTest("_null", "object null"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay @KnownToFail public void AppletJSToJFuncReturn_Integer_Test() throws Exception { jsToJavaFuncReturnNormalTest("_Integer", "object 1"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay @KnownToFail public void AppletJSToJFuncReturn_Double_Test() throws Exception { jsToJavaFuncReturnNormalTest("_Double", "object 1.1"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay @KnownToFail public void AppletJSToJFuncReturn_Float_Test() throws Exception { jsToJavaFuncReturnNormalTest("_Float", "object 1.1"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay @KnownToFail public void AppletJSToJFuncReturn_Long_Test() throws Exception { jsToJavaFuncReturnNormalTest("_Long", "object 10000"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay @KnownToFail public void AppletJSToJFuncReturn_Boolean_Test() throws Exception { jsToJavaFuncReturnNormalTest("_Boolean", "object true"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay @KnownToFail public void AppletJSToJFuncReturn_Character_Test() throws Exception { jsToJavaFuncReturnNormalTest("_Character", "object A"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay @KnownToFail public void AppletJSToJFuncReturn_Byte_Test() throws Exception { jsToJavaFuncReturnNormalTest("_Byte", "object 10"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay @KnownToFail public void AppletJSToJFuncReturn_CharArrayElement_Test() throws Exception { jsToJavaFuncReturnNormalTest("_CharacterArrayElement", "object A"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncReturn_CharFullArray_Test() throws Exception { jsToJavaFuncReturnNormalTest("_CharacterArray", "object [Ljava.lang.Character;@"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncReturn_JSObject_Test() throws Exception { jsToJavaFuncReturnNormalTest("_JSObject", "object value1"); } } icedtea-web-1.5.3/tests/reproducers/simple/JSToJFuncReturn/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466024313 xustar0030 mtime=1441974582.514016198 30 atime=1441974670.151025002 30 ctime=1441974670.126024714 icedtea-web-1.5.3/tests/reproducers/simple/JSToJFuncReturn/srcs/0000775000076400007640000000000012574544466025451 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/JSToJFuncReturn/srcs/PaxHeaders.24993/JSToJFuncReturn.jav0000644000000000000000000000013212574544466030037 xustar0030 mtime=1441974582.514016198 30 atime=1441974656.569868667 30 ctime=1441974670.126024714 icedtea-web-1.5.3/tests/reproducers/simple/JSToJFuncReturn/srcs/JSToJFuncReturn.java0000664000076400007640000000516612574544466031271 0ustar00jvanekjvanek00000000000000import 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.5.3/tests/reproducers/simple/JSToJFuncReturn/PaxHeaders.24993/resources0000644000000000000000000000013212574544466025353 xustar0030 mtime=1441974582.513016186 30 atime=1441974670.151025002 30 ctime=1441974670.126024714 icedtea-web-1.5.3/tests/reproducers/simple/JSToJFuncReturn/resources/0000775000076400007640000000000012574544466026511 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/JSToJFuncReturn/resources/PaxHeaders.24993/jstoj-funcretu0000644000000000000000000000013212574544466030335 xustar0030 mtime=1441974582.513016186 30 atime=1441974656.569868667 30 ctime=1441974670.126024714 icedtea-web-1.5.3/tests/reproducers/simple/JSToJFuncReturn/resources/jstoj-funcreturn.jnlp0000664000076400007640000000150012574544466032714 0ustar00jvanekjvanek00000000000000 JavaScript to Java LiveConnect - FuncReturn RedHat LiveConnect - tests to process various return types from Java side function calls. icedtea-web-1.5.3/tests/reproducers/simple/JSToJFuncReturn/resources/PaxHeaders.24993/JSToJava_FuncR0000644000000000000000000000013212574544466030071 xustar0030 mtime=1441974582.513016186 30 atime=1441974656.568868655 30 ctime=1441974670.126024714 icedtea-web-1.5.3/tests/reproducers/simple/JSToJFuncReturn/resources/JSToJava_FuncReturn.js0000664000076400007640000000072412574544466032646 0ustar00jvanekjvanek00000000000000function doFuncReturnTests(){ var urlArgs = document.URL.split("?"); var applet = document.getElementById('jstojFuncReturnApplet'); var method = urlArgs[1]; eval('var value = applet.' + method + '()'); var checked_string = typeof(value)+' '; if( method === '_JSObject'){ checked_string = checked_string +value.key1; }else{ checked_string = checked_string +value; } applet.printStringAndFinish(checked_string); } icedtea-web-1.5.3/tests/reproducers/simple/JSToJFuncReturn/resources/PaxHeaders.24993/JSToJFuncRetur0000644000000000000000000000013212574544466030142 xustar0030 mtime=1441974582.513016186 30 atime=1441974656.568868655 30 ctime=1441974670.126024714 icedtea-web-1.5.3/tests/reproducers/simple/JSToJFuncReturn/resources/JSToJFuncReturn.html0000664000076400007640000000127312574544466032347 0ustar00jvanekjvanek00000000000000 JavaScript to Java LiveConnect - Function return values from applet

The JSToJFuncReturn html page

icedtea-web-1.5.3/tests/reproducers/simple/PaxHeaders.24993/JSToJFuncResol0000644000000000000000000000013212574544466023146 xustar0030 mtime=1441974582.512016175 30 atime=1441974670.152025013 30 ctime=1441974670.126024714 icedtea-web-1.5.3/tests/reproducers/simple/JSToJFuncResol/0000775000076400007640000000000012574544466024304 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/JSToJFuncResol/PaxHeaders.24993/testcases0000644000000000000000000000013212574544466025144 xustar0030 mtime=1441974582.512016175 30 atime=1441974670.152025013 30 ctime=1441974670.126024714 icedtea-web-1.5.3/tests/reproducers/simple/JSToJFuncResol/testcases/0000775000076400007640000000000012574544466026302 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/JSToJFuncResol/testcases/PaxHeaders.24993/JSToJFuncResolT0000644000000000000000000000013212574544466030042 xustar0030 mtime=1441974582.512016175 30 atime=1441974656.568868655 30 ctime=1441974670.126024714 icedtea-web-1.5.3/tests/reproducers/simple/JSToJFuncResol/testcases/JSToJFuncResolTest.java0000664000076400007640000001743312574544466032567 0ustar00jvanekjvanek00000000000000/* JSToJFuncResolTest.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import net.sourceforge.jnlp.closinglisteners.CountingClosingListener; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.annotations.KnownToFail; import org.junit.Assert; import org.junit.Test; public class JSToJFuncResolTest extends BrowserTest { private final String initStr = "JSToJFuncResol applet initialized."; private final String afterStr = "afterTests"; private class CountingClosingListenerImpl extends CountingClosingListener { @Override protected boolean isAlowedToFinish(String s) { return (s.contains(initStr) && s.contains(afterStr)); } } private void evaluateStdoutContents(String expectedStdout, ProcessResult pr) { // Assert that the applet was initialized. Assert.assertTrue("JSToJFuncResol: the stdout should contain " + initStr + ", but it didnt.", pr.stdout.contains(initStr)); // Assert that the values set by JavaScript are ok Assert.assertTrue("JSToJFuncResol: the output should include: "+expectedStdout+", but it didnt.", pr.stdout.contains(expectedStdout)); } private void jsToJavaFuncResolTest( String methodStr, String valueStr, String expectedStdout) throws Exception { String strURL = "/JSToJFuncResol.html?" + methodStr + ";" + valueStr; ProcessResult pr = server.executeBrowser(strURL, new CountingClosingListenerImpl(), new CountingClosingListenerImpl()); evaluateStdoutContents(expectedStdout, pr); } /****** Primitive (numeric) value resolutions ******/ @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncResol_numeric_Test() throws Exception { jsToJavaFuncResolTest("numeric", "1", "numeric(int) with 1"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncResol_numericToDifferentNumeric_Test() throws Exception { jsToJavaFuncResolTest("numericToDifferentNumeric", "1.1", "numericToDifferentNumeric(double) with 1.1"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay @KnownToFail public void AppletJSToJFuncResol_numericToDouble_Test() throws Exception { jsToJavaFuncResolTest("numericToDouble", "1.1", "numericToDouble(double) with 1.1"); } /****** Null resolutions ******/ @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncResol_nullToInteger_Test() throws Exception { jsToJavaFuncResolTest("nullToInteger", "null", "nullToInteger(Integer) with null"); } /****** Java inherited class resolutions ******/ @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncResol_inheritedClass_Test() throws Exception { jsToJavaFuncResolTest("inheritedClass", "applet.getNewOverloadTestHelper2()", "inheritedClass(OverloadTestHelper2) with JSToJFuncResol$OverloadTestHelper2@"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncResol_inheritedClassToParent1_Test() throws Exception { jsToJavaFuncResolTest("inheritedClassToParent1", "applet.getNewOverloadTestHelper3()", "inheritedClassToParent1(OverloadTestHelper2) with JSToJFuncResol$OverloadTestHelper3@"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncResol_inheritedClassToParent2_Test() throws Exception { jsToJavaFuncResolTest("inheritedClassToParent2", "applet.getNewOverloadTestHelper2()", "inheritedClassToParent2(OverloadTestHelper1) with JSToJFuncResol$OverloadTestHelper2@"); } /****** Java object resolutions ******/ @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncResol_javaObjectToString_Test() throws Exception { jsToJavaFuncResolTest("javaObjectToString", "applet.getNewOverloadTestHelper1()", "javaObjectToString(String) with JSToJFuncResol$OverloadTestHelper1@"); } /****** String resolutions ******/ @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncResol_javascriptStringToNumeric_Test() throws Exception { jsToJavaFuncResolTest("javascriptStringToNumeric", "\"1.1\"", "javascriptStringToNumeric(double) with 1.1"); } /****** Javascript object resolutions ******/ @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncResol_javascriptObject_Test() throws Exception { jsToJavaFuncResolTest("javascriptObject", "window", "javascriptObject(JSObject) with [object Window]"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncResol_javascriptObjectToArray_Test() throws Exception { jsToJavaFuncResolTest("javascriptObjectToArray", "[10]", "javascriptObjectToArray(int[]) with [I@"); } /****** The unsupported resolutions: *****/ @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncResol_nullToPrimitive_Test() throws Exception { jsToJavaFuncResolTest("nullToPrimitive", "null", "Error on Java side: No suitable method named nullToPrimitive with matching args found"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncResol_javascriptObjectToUnrelatedType_Test() throws Exception { jsToJavaFuncResolTest("javascriptObjectToUnrelatedType", "window", "Error on Java side: No suitable method named javascriptObjectToUnrelatedType with matching args found"); } @Test @TestInBrowsers(testIn = { Browsers.all }) @NeedsDisplay public void AppletJSToJFuncResol_unsupported_Test() throws Exception { jsToJavaFuncResolTest("unsupported", "25", "Error on Java side: No suitable method named unsupported with matching args found"); } } icedtea-web-1.5.3/tests/reproducers/simple/JSToJFuncResol/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466024120 xustar0030 mtime=1441974582.512016175 30 atime=1441974670.152025013 30 ctime=1441974670.126024714 icedtea-web-1.5.3/tests/reproducers/simple/JSToJFuncResol/srcs/0000775000076400007640000000000012574544466025256 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/JSToJFuncResol/srcs/PaxHeaders.24993/JSToJFuncResol.java0000644000000000000000000000013212574544466027612 xustar0030 mtime=1441974582.512016175 30 atime=1441974656.568868655 30 ctime=1441974670.126024714 icedtea-web-1.5.3/tests/reproducers/simple/JSToJFuncResol/srcs/JSToJFuncResol.java0000664000076400007640000001675712574544466030713 0ustar00jvanekjvanek00000000000000import 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.5.3/tests/reproducers/simple/JSToJFuncResol/PaxHeaders.24993/resources0000644000000000000000000000013212574544466025160 xustar0030 mtime=1441974582.512016175 30 atime=1441974670.152025013 30 ctime=1441974670.125024702 icedtea-web-1.5.3/tests/reproducers/simple/JSToJFuncResol/resources/0000775000076400007640000000000012574544466026316 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/JSToJFuncResol/resources/PaxHeaders.24993/jstoj-funcresol0000644000000000000000000000013212574544466030307 xustar0030 mtime=1441974582.512016175 30 atime=1441974656.567868644 30 ctime=1441974670.125024702 icedtea-web-1.5.3/tests/reproducers/simple/JSToJFuncResol/resources/jstoj-funcresol.jnlp0000664000076400007640000000150412574544466032332 0ustar00jvanekjvanek00000000000000 JavaScript to Java LiveConnect - FuncResol IcedTea LiveConnect - tests for overloaded function resolution when calling Java functions from JS. icedtea-web-1.5.3/tests/reproducers/simple/JSToJFuncResol/resources/PaxHeaders.24993/JSToJava_FuncRe0000644000000000000000000000013212574544466030043 xustar0030 mtime=1441974582.511016163 30 atime=1441974656.567868644 30 ctime=1441974670.125024702 icedtea-web-1.5.3/tests/reproducers/simple/JSToJFuncResol/resources/JSToJava_FuncResol.js0000664000076400007640000000053112574544466032254 0ustar00jvanekjvanek00000000000000function doFuncResolTests(){ var urlArgs = document.URL.split("?"); var testParams = urlArgs[1].split(";"); var applet = document.getElementById('jstojFuncResolApplet'); var func = testParams[0]; var value = decodeURIComponent(testParams[1]); eval('applet.' + func + '(' + value + ')'); applet.writeAfterTests(); } icedtea-web-1.5.3/tests/reproducers/simple/JSToJFuncResol/resources/PaxHeaders.24993/JSToJFuncResol.0000644000000000000000000000013212574544466030010 xustar0030 mtime=1441974582.511016163 30 atime=1441974656.567868644 30 ctime=1441974670.125024702 icedtea-web-1.5.3/tests/reproducers/simple/JSToJFuncResol/resources/JSToJFuncResol.html0000664000076400007640000000121412574544466031754 0ustar00jvanekjvanek00000000000000 JavaScript to Java LiveConnect - FuncResol values from applet

The JSToJFuncResol html page

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

The JSToJFuncParam html page

icedtea-web-1.5.3/tests/reproducers/simple/PaxHeaders.24993/JSObjectWithoutToString0000644000000000000000000000013112574544466025114 xustar0029 mtime=1441974582.50901614 30 atime=1441974670.152025013 30 ctime=1441974670.125024702 icedtea-web-1.5.3/tests/reproducers/simple/JSObjectWithoutToString/0000775000076400007640000000000012574544466026253 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/JSObjectWithoutToString/PaxHeaders.24993/testcases0000644000000000000000000000013112574544466027112 xustar0029 mtime=1441974582.50901614 30 atime=1441974670.152025013 30 ctime=1441974670.125024702 icedtea-web-1.5.3/tests/reproducers/simple/JSObjectWithoutToString/testcases/0000775000076400007640000000000012574544466030251 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/JSObjectWithoutToString/testcases/PaxHeaders.24993/JSObje0000644000000000000000000000032012574544466030226 xustar00119 path=icedtea-web-1.5.3/tests/reproducers/simple/JSObjectWithoutToString/testcases/JSObjectWithoutToStringTest.java 29 mtime=1441974582.50901614 30 atime=1441974656.566868632 30 ctime=1441974670.125024702 icedtea-web-1.5.3/tests/reproducers/simple/JSObjectWithoutToString/testcases/JSObjectWithoutToString0000664000076400007640000000544712574544466034727 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/JSObjectWithoutToString/PaxHeaders.24993/srcs0000644000000000000000000000013112574544466026066 xustar0029 mtime=1441974582.50901614 30 atime=1441974670.152025013 30 ctime=1441974670.125024702 icedtea-web-1.5.3/tests/reproducers/simple/JSObjectWithoutToString/srcs/0000775000076400007640000000000012574544466027225 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/JSObjectWithoutToString/srcs/PaxHeaders.24993/JSObjectWit0000644000000000000000000000013112574544466030215 xustar0029 mtime=1441974582.50901614 30 atime=1441974656.565868621 30 ctime=1441974670.125024702 icedtea-web-1.5.3/tests/reproducers/simple/JSObjectWithoutToString/srcs/JSObjectWithoutToString.java0000664000076400007640000000042312574544466034610 0ustar00jvanekjvanek00000000000000import 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.5.3/tests/reproducers/simple/JSObjectWithoutToString/PaxHeaders.24993/resources0000644000000000000000000000013112574544466027126 xustar0029 mtime=1441974582.50901614 30 atime=1441974670.152025013 30 ctime=1441974670.125024702 icedtea-web-1.5.3/tests/reproducers/simple/JSObjectWithoutToString/resources/0000775000076400007640000000000012574544466030265 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/JSObjectWithoutToString/resources/PaxHeaders.24993/JSObje0000644000000000000000000000031212574544466030243 xustar00113 path=icedtea-web-1.5.3/tests/reproducers/simple/JSObjectWithoutToString/resources/JSObjectWithoutToString.js 29 mtime=1441974582.50901614 30 atime=1441974656.565868621 30 ctime=1441974670.125024702 icedtea-web-1.5.3/tests/reproducers/simple/JSObjectWithoutToString/resources/JSObjectWithoutToString0000664000076400007640000000025412574544466034732 0ustar00jvanekjvanek00000000000000function doToStringTest(){ var applet = document.getElementById('jswithouttostring'); var null_obj = Object.create(null); applet.callJSToString(null_obj); } icedtea-web-1.5.3/tests/reproducers/simple/JSObjectWithoutToString/resources/PaxHeaders.24993/JSObje0000644000000000000000000000031512574544466030246 xustar00115 path=icedtea-web-1.5.3/tests/reproducers/simple/JSObjectWithoutToString/resources/JSObjectWithoutToString.html 30 mtime=1441974582.508016129 30 atime=1441974656.565868621 30 ctime=1441974670.125024702 icedtea-web-1.5.3/tests/reproducers/simple/JSObjectWithoutToString/resources/JSObjectWithoutToString0000664000076400007640000000126112574544466034731 0ustar00jvanekjvanek00000000000000 JavaScript to Java LiveConnect - Function return values from applet

The JSObjectWithoutToString html page

icedtea-web-1.5.3/tests/reproducers/simple/PaxHeaders.24993/JSObjectFromEval0000644000000000000000000000013212574544466023473 xustar0030 mtime=1441974582.508016129 30 atime=1441974670.152025013 30 ctime=1441974670.125024702 icedtea-web-1.5.3/tests/reproducers/simple/JSObjectFromEval/0000775000076400007640000000000012574544466024631 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/JSObjectFromEval/PaxHeaders.24993/testcases0000644000000000000000000000013212574544466025471 xustar0030 mtime=1441974582.508016129 30 atime=1441974670.152025013 30 ctime=1441974670.125024702 icedtea-web-1.5.3/tests/reproducers/simple/JSObjectFromEval/testcases/0000775000076400007640000000000012574544466026627 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/JSObjectFromEval/testcases/PaxHeaders.24993/JSObjectFromE0000644000000000000000000000013212574544466030065 xustar0030 mtime=1441974582.508016129 30 atime=1441974656.565868621 30 ctime=1441974670.125024702 icedtea-web-1.5.3/tests/reproducers/simple/JSObjectFromEval/testcases/JSObjectFromEvalTest.java0000664000076400007640000000703412574544466033435 0ustar00jvanekjvanek00000000000000/* Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the 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.5.3/tests/reproducers/simple/JSObjectFromEval/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466024445 xustar0030 mtime=1441974582.508016129 30 atime=1441974670.152025013 30 ctime=1441974670.125024702 icedtea-web-1.5.3/tests/reproducers/simple/JSObjectFromEval/srcs/0000775000076400007640000000000012574544466025603 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/JSObjectFromEval/srcs/PaxHeaders.24993/JSObjectFromEval.j0000644000000000000000000000013212574544466027774 xustar0030 mtime=1441974582.508016129 30 atime=1441974656.564868609 30 ctime=1441974670.125024702 icedtea-web-1.5.3/tests/reproducers/simple/JSObjectFromEval/srcs/JSObjectFromEval.java0000664000076400007640000000411212574544466031543 0ustar00jvanekjvanek00000000000000/* Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the 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.5.3/tests/reproducers/simple/JSObjectFromEval/PaxHeaders.24993/resources0000644000000000000000000000013212574544466025505 xustar0030 mtime=1441974582.507016117 30 atime=1441974670.152025013 30 ctime=1441974670.125024702 icedtea-web-1.5.3/tests/reproducers/simple/JSObjectFromEval/resources/0000775000076400007640000000000012574544466026643 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/JSObjectFromEval/resources/PaxHeaders.24993/JSObjectFromE0000644000000000000000000000013212574544466030101 xustar0030 mtime=1441974582.507016117 30 atime=1441974656.564868609 30 ctime=1441974670.125024702 icedtea-web-1.5.3/tests/reproducers/simple/JSObjectFromEval/resources/JSObjectFromEval.js0000664000076400007640000000111312574544466032274 0ustar00jvanekjvanek00000000000000function testJSObjectFromEval() { var applet = document.getElementById("applet"); var obj; applet.output("*** Test JSObject from JS ***"); applet.output("JS create"); obj = new Object(); applet.output("Java set"); applet.setJSMember(obj, "test", 0); applet.output("obj.test = " + obj.test); applet.output("*** Test JSObject from Java ***"); applet.output("Java create"); obj = applet.newJSObject(); applet.output("Java set"); applet.setJSMember(obj, "test", 0); applet.output("obj.test = " + obj.test); applet.output("*** APPLET FINISHED ***"); //We're done here }icedtea-web-1.5.3/tests/reproducers/simple/JSObjectFromEval/resources/PaxHeaders.24993/JSObjectFromE0000644000000000000000000000013212574544466030101 xustar0030 mtime=1441974582.507016117 30 atime=1441974656.564868609 30 ctime=1441974670.125024702 icedtea-web-1.5.3/tests/reproducers/simple/JSObjectFromEval/resources/JSObjectFromEval.html0000664000076400007640000000366412574544466032641 0ustar00jvanekjvanek00000000000000 icedtea-web-1.5.3/tests/reproducers/simple/PaxHeaders.24993/InformationTitleVendorParser0000644000000000000000000000013212574544466026216 xustar0030 mtime=1441974582.507016117 30 atime=1441974670.152025013 30 ctime=1441974670.125024702 icedtea-web-1.5.3/tests/reproducers/simple/InformationTitleVendorParser/0000775000076400007640000000000012574544466027354 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/InformationTitleVendorParser/PaxHeaders.24993/testcases0000644000000000000000000000013212574544466030214 xustar0030 mtime=1441974582.507016117 30 atime=1441974670.152025013 30 ctime=1441974670.125024702 icedtea-web-1.5.3/tests/reproducers/simple/InformationTitleVendorParser/testcases/0000775000076400007640000000000012574544466031352 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/InformationTitleVendorParser/testcases/PaxHeaders.24993/I0000644000000000000000000000033312574544466030407 xustar00129 path=icedtea-web-1.5.3/tests/reproducers/simple/InformationTitleVendorParser/testcases/InformationTitleVendorParserTest.java 30 mtime=1441974582.507016117 30 atime=1441974656.564868609 30 ctime=1441974670.125024702 icedtea-web-1.5.3/tests/reproducers/simple/InformationTitleVendorParser/testcases/InformationTitleVe0000664000076400007640000000641012574544466035060 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/InformationTitleVendorParser/PaxHeaders.24993/resources0000644000000000000000000000013212574544466030230 xustar0030 mtime=1441974582.506016106 30 atime=1441974670.152025013 30 ctime=1441974670.125024702 icedtea-web-1.5.3/tests/reproducers/simple/InformationTitleVendorParser/resources/0000775000076400007640000000000012574544466031366 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/InformationTitleVendorParser/resources/PaxHeaders.24993/V0000644000000000000000000000013212574544466030435 xustar0030 mtime=1441974582.506016106 30 atime=1441974656.563868598 30 ctime=1441974670.125024702 icedtea-web-1.5.3/tests/reproducers/simple/InformationTitleVendorParser/resources/VendorParser.jnlp0000664000076400007640000000411612574544466034667 0ustar00jvanekjvanek00000000000000 VendorParser Vendor tag missing icedtea-web-1.5.3/tests/reproducers/simple/InformationTitleVendorParser/resources/PaxHeaders.24993/T0000644000000000000000000000031412574544466030435 xustar00114 path=icedtea-web-1.5.3/tests/reproducers/simple/InformationTitleVendorParser/resources/TitleVendorParser.jnlp 30 mtime=1441974582.506016106 30 atime=1441974656.563868598 30 ctime=1441974670.125024702 icedtea-web-1.5.3/tests/reproducers/simple/InformationTitleVendorParser/resources/TitleVendorParser.0000664000076400007640000000407212574544466035006 0ustar00jvanekjvanek00000000000000 Title/Vendor tags missing icedtea-web-1.5.3/tests/reproducers/simple/InformationTitleVendorParser/resources/PaxHeaders.24993/T0000644000000000000000000000013212574544466030433 xustar0030 mtime=1441974582.506016106 30 atime=1441974656.563868598 30 ctime=1441974670.125024702 icedtea-web-1.5.3/tests/reproducers/simple/InformationTitleVendorParser/resources/TitleParser.jnlp0000664000076400007640000000411112574544466034506 0ustar00jvanekjvanek00000000000000 IcedTea Title tag missing icedtea-web-1.5.3/tests/reproducers/simple/InformationTitleVendorParser/resources/PaxHeaders.24993/I0000644000000000000000000000031412574544466030422 xustar00114 path=icedtea-web-1.5.3/tests/reproducers/simple/InformationTitleVendorParser/resources/InformationParser.jnlp 30 mtime=1441974582.505016094 30 atime=1441974656.563868598 30 ctime=1441974670.125024702 icedtea-web-1.5.3/tests/reproducers/simple/InformationTitleVendorParser/resources/InformationParser.0000664000076400007640000000363312574544466035036 0ustar00jvanekjvanek00000000000000 icedtea-web-1.5.3/tests/reproducers/simple/PaxHeaders.24993/GeneratedId0000644000000000000000000000013212574544466022547 xustar0030 mtime=1441974582.505016094 30 atime=1441974670.152025013 30 ctime=1441974670.125024702 icedtea-web-1.5.3/tests/reproducers/simple/GeneratedId/0000775000076400007640000000000012574544466023705 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/GeneratedId/PaxHeaders.24993/testcases0000644000000000000000000000013212574544466024545 xustar0030 mtime=1441974582.505016094 30 atime=1441974670.152025013 30 ctime=1441974670.125024702 icedtea-web-1.5.3/tests/reproducers/simple/GeneratedId/testcases/0000775000076400007640000000000012574544466025703 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/GeneratedId/testcases/PaxHeaders.24993/GeneratedIdTest.ja0000644000000000000000000000013212574544466030151 xustar0030 mtime=1441974582.505016094 30 atime=1441974656.562868586 30 ctime=1441974670.125024702 icedtea-web-1.5.3/tests/reproducers/simple/GeneratedId/testcases/GeneratedIdTest.java0000664000076400007640000001666112574544466031573 0ustar00jvanekjvanek00000000000000/* Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the 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.5.3/tests/reproducers/simple/GeneratedId/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466023521 xustar0030 mtime=1441974582.505016094 30 atime=1441974670.152025013 30 ctime=1441974670.125024702 icedtea-web-1.5.3/tests/reproducers/simple/GeneratedId/srcs/0000775000076400007640000000000012574544466024657 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/GeneratedId/srcs/PaxHeaders.24993/GeneratedId.java0000644000000000000000000000013212574544466026614 xustar0030 mtime=1441974582.505016094 30 atime=1441974656.562868586 30 ctime=1441974670.125024702 icedtea-web-1.5.3/tests/reproducers/simple/GeneratedId/srcs/GeneratedId.java0000664000076400007640000000342412574544466027700 0ustar00jvanekjvanek00000000000000/* Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the 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.5.3/tests/reproducers/simple/PaxHeaders.24993/FakeCodebase0000644000000000000000000000013212574544466022670 xustar0030 mtime=1441974582.504016082 30 atime=1441974670.152025013 30 ctime=1441974670.125024702 icedtea-web-1.5.3/tests/reproducers/simple/FakeCodebase/0000775000076400007640000000000012574544466024026 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/FakeCodebase/PaxHeaders.24993/testcases0000644000000000000000000000013212574544466024666 xustar0030 mtime=1441974582.504016082 30 atime=1441974670.152025013 30 ctime=1441974670.124024691 icedtea-web-1.5.3/tests/reproducers/simple/FakeCodebase/testcases/0000775000076400007640000000000012574544466026024 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/FakeCodebase/testcases/PaxHeaders.24993/FakeCodebaseTests0000644000000000000000000000013212574544466030205 xustar0030 mtime=1441974582.504016082 30 atime=1441974656.562868586 30 ctime=1441974670.124024691 icedtea-web-1.5.3/tests/reproducers/simple/FakeCodebase/testcases/FakeCodebaseTests.java0000664000076400007640000001560312574544466032213 0ustar00jvanekjvanek00000000000000/* 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 static org.junit.Assert.assertTrue; import net.sourceforge.jnlp.ProcessResult; 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.security.appletextendedsecurity.AppletSecurityLevel; import net.sourceforge.jnlp.util.FileUtils; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; public class FakeCodebaseTests extends BrowserTest { private static String originalProperties; private static final File depPropsFile = new File(System.getProperty("user.home") + "/.config/icedtea-web/deployment.properties"); private static final File trustFile = new File(System.getProperty("user.home") + "/.config/icedtea-web/.appletTrustSettings"); 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 { originalProperties = FileUtils.loadFileAsString(depPropsFile); FileUtils.saveFile(DeploymentConfiguration.KEY_SECURITY_LEVEL+"="+AppletSecurityLevel.ASK_UNSIGNED.name()+"n"+ DeploymentConfiguration.KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK+"="+false , depPropsFile); } @BeforeClass public static void backupAppTrust() throws IOException { backup = File.createTempFile("fakeCodebase", "itwReproducers"); backup.deleteOnExit(); FirefoxProfilesOperator.copyFile(trustFile, backup); } @AfterClass public static void restoreAppTrust() throws IOException { FirefoxProfilesOperator.copyFile(backup, trustFile); } @AfterClass public static void resetSecurity() throws IOException { FileUtils.saveFile(originalProperties, depPropsFile); } //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 { try { String ob1 = FileUtils.loadFileAsString(new File(server.getDir(), ORIG_BASE)); assertTrue(ob1.contains("id=\"FakeCodebase0\"")); //check orig.html is correct one trustFile.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(trustFile).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(trustFile).trim(); String[] ss1 = s1.split("\n"); Assert.assertEquals(2, ss1.length); } finally { } } } icedtea-web-1.5.3/tests/reproducers/simple/FakeCodebase/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466023642 xustar0030 mtime=1441974582.504016082 30 atime=1441974670.152025013 30 ctime=1441974670.124024691 icedtea-web-1.5.3/tests/reproducers/simple/FakeCodebase/srcs/0000775000076400007640000000000012574544466025000 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/FakeCodebase/srcs/PaxHeaders.24993/FakeCodebase.java0000644000000000000000000000013212574544466027056 xustar0030 mtime=1441974582.504016082 30 atime=1441974656.561868575 30 ctime=1441974670.124024691 icedtea-web-1.5.3/tests/reproducers/simple/FakeCodebase/srcs/FakeCodebase.java0000664000076400007640000000366612574544466030152 0ustar00jvanekjvanek00000000000000 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.5.3/tests/reproducers/simple/FakeCodebase/PaxHeaders.24993/resources0000644000000000000000000000013212574544466024702 xustar0030 mtime=1441974582.503016071 30 atime=1441974670.152025013 30 ctime=1441974670.124024691 icedtea-web-1.5.3/tests/reproducers/simple/FakeCodebase/resources/0000775000076400007640000000000012574544466026040 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/FakeCodebase/resources/PaxHeaders.24993/OriginalCodebase.0000644000000000000000000000013212574544466030152 xustar0030 mtime=1441974582.503016071 30 atime=1441974656.561868575 30 ctime=1441974670.124024691 icedtea-web-1.5.3/tests/reproducers/simple/FakeCodebase/resources/OriginalCodebase.jnlp0000664000076400007640000000055612574544466032125 0ustar00jvanekjvanek00000000000000 OriginalCodebase FakeCodebase IcedTea icedtea-web-1.5.3/tests/reproducers/simple/FakeCodebase/resources/PaxHeaders.24993/OriginalCodebase.0000644000000000000000000000013212574544466030152 xustar0030 mtime=1441974582.503016071 30 atime=1441974656.561868575 30 ctime=1441974670.124024691 icedtea-web-1.5.3/tests/reproducers/simple/FakeCodebase/resources/OriginalCodebase.html0000664000076400007640000000345312574544466032125 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/simple/FakeCodebase/resources/PaxHeaders.24993/FakeCodebase.jnlp0000644000000000000000000000013212574544466030140 xustar0030 mtime=1441974582.503016071 30 atime=1441974656.561868575 30 ctime=1441974670.124024691 icedtea-web-1.5.3/tests/reproducers/simple/FakeCodebase/resources/FakeCodebase.jnlp.in0000664000076400007640000000057512574544466031635 0ustar00jvanekjvanek00000000000000 OriginalCodebase FakeCodebase IcedTea icedtea-web-1.5.3/tests/reproducers/simple/FakeCodebase/resources/PaxHeaders.24993/FakeCodebase.html0000644000000000000000000000013212574544466030141 xustar0030 mtime=1441974582.503016071 30 atime=1441974656.561868575 30 ctime=1441974670.124024691 icedtea-web-1.5.3/tests/reproducers/simple/FakeCodebase/resources/FakeCodebase.html.in0000664000076400007640000000347312574544466031636 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/simple/PaxHeaders.24993/EmbeddedJnlpInApplet0000644000000000000000000000013112574544466024345 xustar0029 mtime=1441974582.50201606 30 atime=1441974670.152025013 30 ctime=1441974670.124024691 icedtea-web-1.5.3/tests/reproducers/simple/EmbeddedJnlpInApplet/0000775000076400007640000000000012574544466025504 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/EmbeddedJnlpInApplet/PaxHeaders.24993/testcases0000644000000000000000000000013112574544466026343 xustar0029 mtime=1441974582.50201606 30 atime=1441974670.152025013 30 ctime=1441974670.124024691 icedtea-web-1.5.3/tests/reproducers/simple/EmbeddedJnlpInApplet/testcases/0000775000076400007640000000000012574544466027502 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/EmbeddedJnlpInApplet/testcases/PaxHeaders.24993/EmbeddedJ0000644000000000000000000000031212574544466030147 xustar00113 path=icedtea-web-1.5.3/tests/reproducers/simple/EmbeddedJnlpInApplet/testcases/EmbeddedJnlpInAppletTest.java 29 mtime=1441974582.50201606 30 atime=1441974656.560868563 30 ctime=1441974670.124024691 icedtea-web-1.5.3/tests/reproducers/simple/EmbeddedJnlpInApplet/testcases/EmbeddedJnlpInAppletTest.j0000664000076400007640000000620512574544466034472 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/EmbeddedJnlpInApplet/PaxHeaders.24993/srcs0000644000000000000000000000013112574544466025317 xustar0029 mtime=1441974582.50201606 30 atime=1441974670.152025013 30 ctime=1441974670.124024691 icedtea-web-1.5.3/tests/reproducers/simple/EmbeddedJnlpInApplet/srcs/0000775000076400007640000000000012574544466026456 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/EmbeddedJnlpInApplet/srcs/PaxHeaders.24993/EmbeddedJnlp.j0000644000000000000000000000013112574544466030064 xustar0029 mtime=1441974582.50201606 30 atime=1441974656.560868563 30 ctime=1441974670.124024691 icedtea-web-1.5.3/tests/reproducers/simple/EmbeddedJnlpInApplet/srcs/EmbeddedJnlp.java0000664000076400007640000000346512574544466031646 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/EmbeddedJnlpInApplet/PaxHeaders.24993/resources0000644000000000000000000000013112574544466026357 xustar0029 mtime=1441974582.50201606 30 atime=1441974670.152025013 30 ctime=1441974670.124024691 icedtea-web-1.5.3/tests/reproducers/simple/EmbeddedJnlpInApplet/resources/0000775000076400007640000000000012574544466027516 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/EmbeddedJnlpInApplet/resources/PaxHeaders.24993/JnlpInApp0000644000000000000000000000013112574544466030212 xustar0029 mtime=1441974582.50201606 30 atime=1441974656.560868563 30 ctime=1441974670.124024691 icedtea-web-1.5.3/tests/reproducers/simple/EmbeddedJnlpInApplet/resources/JnlpInApplet.html0000664000076400007640000000346212574544466032751 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/simple/EmbeddedJnlpInApplet/resources/PaxHeaders.24993/EmbeddedJ0000644000000000000000000000032612574544466030170 xustar00124 path=icedtea-web-1.5.3/tests/reproducers/simple/EmbeddedJnlpInApplet/resources/EmbeddedJnlpInAppletWithDotCodebase.html 30 mtime=1441974582.501016048 30 atime=1441974656.560868563 30 ctime=1441974670.124024691 icedtea-web-1.5.3/tests/reproducers/simple/EmbeddedJnlpInApplet/resources/EmbeddedJnlpInAppletWithDo0000664000076400007640000001240512574544466034534 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/simple/EmbeddedJnlpInApplet/resources/PaxHeaders.24993/EmbeddedJ0000644000000000000000000000032112574544466030163 xustar00119 path=icedtea-web-1.5.3/tests/reproducers/simple/EmbeddedJnlpInApplet/resources/EmbeddedJnlpInAppletNoCodebase.html 30 mtime=1441974582.501016048 30 atime=1441974656.559868552 30 ctime=1441974670.124024691 icedtea-web-1.5.3/tests/reproducers/simple/EmbeddedJnlpInApplet/resources/EmbeddedJnlpInAppletNoCode0000664000076400007640000001244512574544466034511 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/simple/EmbeddedJnlpInApplet/resources/PaxHeaders.24993/EmbeddedJ0000644000000000000000000000013212574544466030163 xustar0030 mtime=1441974582.501016048 30 atime=1441974656.559868552 30 ctime=1441974670.124024691 icedtea-web-1.5.3/tests/reproducers/simple/EmbeddedJnlpInApplet/resources/EmbeddedJnlp.jnlp0000664000076400007640000000436012574544466032723 0ustar00jvanekjvanek00000000000000 SignedAppletTest IcedTea SignedAppletTest icedtea-web-1.5.3/tests/reproducers/simple/PaxHeaders.24993/DocumentBaseEncoding0000644000000000000000000000013212574544466024414 xustar0030 mtime=1441974582.500016037 30 atime=1441974670.152025013 30 ctime=1441974670.124024691 icedtea-web-1.5.3/tests/reproducers/simple/DocumentBaseEncoding/0000775000076400007640000000000012574544466025552 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/DocumentBaseEncoding/PaxHeaders.24993/testcases0000644000000000000000000000013212574544466026412 xustar0030 mtime=1441974582.500016037 30 atime=1441974670.152025013 30 ctime=1441974670.124024691 icedtea-web-1.5.3/tests/reproducers/simple/DocumentBaseEncoding/testcases/0000775000076400007640000000000012574544466027550 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/DocumentBaseEncoding/testcases/PaxHeaders.24993/DocumentB0000644000000000000000000000031412574544466030274 xustar00114 path=icedtea-web-1.5.3/tests/reproducers/simple/DocumentBaseEncoding/testcases/DocumentBaseEncodingTests.java 30 mtime=1441974582.500016037 30 atime=1441974656.559868552 30 ctime=1441974670.124024691 icedtea-web-1.5.3/tests/reproducers/simple/DocumentBaseEncoding/testcases/DocumentBaseEncodingTests.0000664000076400007640000000724412574544466034623 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/DocumentBaseEncoding/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466025366 xustar0030 mtime=1441974582.500016037 30 atime=1441974670.152025013 30 ctime=1441974670.124024691 icedtea-web-1.5.3/tests/reproducers/simple/DocumentBaseEncoding/srcs/0000775000076400007640000000000012574544466026524 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/DocumentBaseEncoding/srcs/PaxHeaders.24993/DocumentBaseEn0000644000000000000000000000013212574544466030222 xustar0030 mtime=1441974582.500016037 30 atime=1441974656.559868552 30 ctime=1441974670.124024691 icedtea-web-1.5.3/tests/reproducers/simple/DocumentBaseEncoding/srcs/DocumentBaseEncoding.java0000664000076400007640000000361112574544466033410 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/DocumentBaseEncoding/PaxHeaders.24993/resources0000644000000000000000000000013212574544466026426 xustar0030 mtime=1441974582.500016037 30 atime=1441974670.152025013 30 ctime=1441974670.124024691 icedtea-web-1.5.3/tests/reproducers/simple/DocumentBaseEncoding/resources/0000775000076400007640000000000012574544466027564 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/DocumentBaseEncoding/resources/PaxHeaders.24993/Document 0000644000000000000000000000031012574544466030242 xustar00111 path=icedtea-web-1.5.3/tests/reproducers/simple/DocumentBaseEncoding/resources/Document Base Encoding.html 30 mtime=1441974582.500016037 29 atime=1441974656.55886854 30 ctime=1441974670.124024691 icedtea-web-1.5.3/tests/reproducers/simple/DocumentBaseEncoding/resources/Document Base Encoding.htm0000664000076400007640000000337312574544466034424 0ustar00jvanekjvanek00000000000000 icedtea-web-1.5.3/tests/reproducers/simple/PaxHeaders.24993/CustomPolicies0000644000000000000000000000013212574544466023336 xustar0030 mtime=1441974582.499016025 30 atime=1441974670.152025013 30 ctime=1441974670.124024691 icedtea-web-1.5.3/tests/reproducers/simple/CustomPolicies/0000775000076400007640000000000012574544466024474 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/CustomPolicies/PaxHeaders.24993/testcases0000644000000000000000000000013212574544466025334 xustar0030 mtime=1441974582.499016025 30 atime=1441974670.152025013 30 ctime=1441974670.124024691 icedtea-web-1.5.3/tests/reproducers/simple/CustomPolicies/testcases/0000775000076400007640000000000012574544466026472 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/CustomPolicies/testcases/PaxHeaders.24993/CustomPoliciesT0000644000000000000000000000013112574544466030421 xustar0030 mtime=1441974582.499016025 29 atime=1441974656.55886854 30 ctime=1441974670.124024691 icedtea-web-1.5.3/tests/reproducers/simple/CustomPolicies/testcases/CustomPoliciesTest.java0000664000076400007640000002071212574544466033141 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/CustomPolicies/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466024310 xustar0030 mtime=1441974582.499016025 30 atime=1441974670.152025013 30 ctime=1441974670.124024691 icedtea-web-1.5.3/tests/reproducers/simple/CustomPolicies/srcs/0000775000076400007640000000000012574544466025446 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/CustomPolicies/srcs/PaxHeaders.24993/CustomPolicies.java0000644000000000000000000000013112574544466030171 xustar0030 mtime=1441974582.499016025 29 atime=1441974656.55886854 30 ctime=1441974670.124024691 icedtea-web-1.5.3/tests/reproducers/simple/CustomPolicies/srcs/CustomPolicies.java0000664000076400007640000000105412574544466031253 0ustar00jvanekjvanek00000000000000import 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.5.3/tests/reproducers/simple/CustomPolicies/PaxHeaders.24993/resources0000644000000000000000000000013212574544466025350 xustar0030 mtime=1441974582.499016025 30 atime=1441974670.152025013 30 ctime=1441974670.124024691 icedtea-web-1.5.3/tests/reproducers/simple/CustomPolicies/resources/0000775000076400007640000000000012574544466026506 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/CustomPolicies/resources/PaxHeaders.24993/CustomPoliciesJ0000644000000000000000000000013112574544466030423 xustar0030 mtime=1441974582.499016025 29 atime=1441974656.55886854 30 ctime=1441974670.124024691 icedtea-web-1.5.3/tests/reproducers/simple/CustomPolicies/resources/CustomPoliciesJnlpHref.html0000664000076400007640000000343312574544466033772 0ustar00jvanekjvanek00000000000000 icedtea-web-1.5.3/tests/reproducers/simple/CustomPolicies/resources/PaxHeaders.24993/CustomPoliciesA0000644000000000000000000000013212574544466030413 xustar0030 mtime=1441974582.498016013 30 atime=1441974656.557868529 30 ctime=1441974670.124024691 icedtea-web-1.5.3/tests/reproducers/simple/CustomPolicies/resources/CustomPoliciesApplication.jnlp0000664000076400007640000000431412574544466034523 0ustar00jvanekjvanek00000000000000 CustomPoliciesApplication IcedTea Test that unsigned applets can perform privileged actions when granted by custom policies icedtea-web-1.5.3/tests/reproducers/simple/CustomPolicies/resources/PaxHeaders.24993/CustomPoliciesA0000644000000000000000000000013212574544466030413 xustar0030 mtime=1441974582.498016013 30 atime=1441974656.557868529 30 ctime=1441974670.124024691 icedtea-web-1.5.3/tests/reproducers/simple/CustomPolicies/resources/CustomPoliciesApplet.jnlp0000664000076400007640000000427012574544466033506 0ustar00jvanekjvanek00000000000000 CustomPoliciesApplet IcedTea Test that unsigned applets can perform privileged actions when granted by custom policies icedtea-web-1.5.3/tests/reproducers/simple/CustomPolicies/resources/PaxHeaders.24993/CustomPolicies.0000644000000000000000000000013212574544466030370 xustar0030 mtime=1441974582.498016013 30 atime=1441974656.557868529 30 ctime=1441974670.124024691 icedtea-web-1.5.3/tests/reproducers/simple/CustomPolicies/resources/CustomPolicies.html0000664000076400007640000000350412574544466032340 0ustar00jvanekjvanek00000000000000 icedtea-web-1.5.3/tests/reproducers/simple/PaxHeaders.24993/CreateClassLoader0000644000000000000000000000013212574544466023714 xustar0030 mtime=1441974582.497016002 30 atime=1441974670.152025013 30 ctime=1441974670.124024691 icedtea-web-1.5.3/tests/reproducers/simple/CreateClassLoader/0000775000076400007640000000000012574544466025052 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/CreateClassLoader/PaxHeaders.24993/testcases0000644000000000000000000000013212574544466025712 xustar0030 mtime=1441974582.497016002 30 atime=1441974670.152025013 30 ctime=1441974670.124024691 icedtea-web-1.5.3/tests/reproducers/simple/CreateClassLoader/testcases/0000775000076400007640000000000012574544466027050 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/CreateClassLoader/testcases/PaxHeaders.24993/CreateClassL0000644000000000000000000000013212574544466030217 xustar0030 mtime=1441974582.497016002 30 atime=1441974656.557868529 30 ctime=1441974670.124024691 icedtea-web-1.5.3/tests/reproducers/simple/CreateClassLoader/testcases/CreateClassLoaderTest.java0000664000076400007640000000505212574544466034075 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/CreateClassLoader/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466024666 xustar0030 mtime=1441974582.497016002 30 atime=1441974670.152025013 30 ctime=1441974670.124024691 icedtea-web-1.5.3/tests/reproducers/simple/CreateClassLoader/srcs/0000775000076400007640000000000012574544466026024 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/CreateClassLoader/srcs/PaxHeaders.24993/CreateClassLoader0000644000000000000000000000013212574544466030206 xustar0030 mtime=1441974582.497016002 30 atime=1441974656.556868517 30 ctime=1441974670.124024691 icedtea-web-1.5.3/tests/reproducers/simple/CreateClassLoader/srcs/CreateClassLoader.java0000664000076400007640000000351612574544466032214 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/CreateClassLoader/PaxHeaders.24993/resources0000644000000000000000000000013212574544466025726 xustar0030 mtime=1441974582.497016002 30 atime=1441974670.152025013 30 ctime=1441974670.124024691 icedtea-web-1.5.3/tests/reproducers/simple/CreateClassLoader/resources/0000775000076400007640000000000012574544466027064 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/CreateClassLoader/resources/PaxHeaders.24993/CreateClassL0000644000000000000000000000013212574544466030233 xustar0030 mtime=1441974582.497016002 30 atime=1441974656.556868517 30 ctime=1441974670.124024691 icedtea-web-1.5.3/tests/reproducers/simple/CreateClassLoader/resources/CreateClassLoader.jnlp0000664000076400007640000000377212574544466033302 0ustar00jvanekjvanek00000000000000 set context classloader IcedTea icedtea-web-1.5.3/tests/reproducers/simple/PaxHeaders.24993/CountingApplet20000644000000000000000000000013212574544466023412 xustar0030 mtime=1441974582.496015991 30 atime=1441974670.152025013 30 ctime=1441974670.123024679 icedtea-web-1.5.3/tests/reproducers/simple/CountingApplet2/0000775000076400007640000000000012574544466024550 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/CountingApplet2/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466024364 xustar0030 mtime=1441974582.496015991 30 atime=1441974670.152025013 30 ctime=1441974670.123024679 icedtea-web-1.5.3/tests/reproducers/simple/CountingApplet2/srcs/0000775000076400007640000000000012574544466025522 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/CountingApplet2/srcs/PaxHeaders.24993/CountingApplet2.jav0000644000000000000000000000013212574544466030161 xustar0030 mtime=1441974582.496015991 30 atime=1441974656.556868517 30 ctime=1441974670.123024679 icedtea-web-1.5.3/tests/reproducers/simple/CountingApplet2/srcs/CountingApplet2.java0000664000076400007640000000664312574544466031414 0ustar00jvanekjvanek00000000000000 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.5.3/tests/reproducers/simple/PaxHeaders.24993/CountingApplet10000644000000000000000000000013212574544466023411 xustar0030 mtime=1441974582.496015991 30 atime=1441974670.152025013 30 ctime=1441974670.123024679 icedtea-web-1.5.3/tests/reproducers/simple/CountingApplet1/0000775000076400007640000000000012574544466024547 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/CountingApplet1/PaxHeaders.24993/testcases0000644000000000000000000000013212574544466025407 xustar0030 mtime=1441974582.496015991 30 atime=1441974670.152025013 30 ctime=1441974670.123024679 icedtea-web-1.5.3/tests/reproducers/simple/CountingApplet1/testcases/0000775000076400007640000000000012574544466026545 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/CountingApplet1/testcases/PaxHeaders.24993/ParallelApplet0000644000000000000000000000013212574544466030311 xustar0030 mtime=1441974582.496015991 30 atime=1441974656.556868517 30 ctime=1441974670.123024679 icedtea-web-1.5.3/tests/reproducers/simple/CountingApplet1/testcases/ParallelAppletsTest.java0000664000076400007640000002064312574544466033342 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/CountingApplet1/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466024363 xustar0030 mtime=1441974582.495015979 30 atime=1441974670.152025013 30 ctime=1441974670.123024679 icedtea-web-1.5.3/tests/reproducers/simple/CountingApplet1/srcs/0000775000076400007640000000000012574544466025521 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/CountingApplet1/srcs/PaxHeaders.24993/CountingApplet1.jav0000644000000000000000000000013212574544466030157 xustar0030 mtime=1441974582.495015979 30 atime=1441974656.555868506 30 ctime=1441974670.123024679 icedtea-web-1.5.3/tests/reproducers/simple/CountingApplet1/srcs/CountingApplet1.java0000664000076400007640000000664312574544466031412 0ustar00jvanekjvanek00000000000000 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.5.3/tests/reproducers/simple/CountingApplet1/PaxHeaders.24993/resources0000644000000000000000000000013212574544466025423 xustar0030 mtime=1441974582.495015979 30 atime=1441974670.152025013 30 ctime=1441974670.123024679 icedtea-web-1.5.3/tests/reproducers/simple/CountingApplet1/resources/0000775000076400007640000000000012574544466026561 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/CountingApplet1/resources/PaxHeaders.24993/ParallelApplet0000644000000000000000000000031212574544466030325 xustar00112 path=icedtea-web-1.5.3/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1s_x_2ss.html 30 mtime=1441974582.495015979 30 atime=1441974656.555868506 30 ctime=1441974670.123024679 icedtea-web-1.5.3/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1s_x_2ss.ht0000664000076400007640000000363212574544466034570 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/simple/CountingApplet1/resources/PaxHeaders.24993/ParallelApplet0000644000000000000000000000031112574544466030324 xustar00111 path=icedtea-web-1.5.3/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1s_x_2s.html 30 mtime=1441974582.495015979 30 atime=1441974656.555868506 30 ctime=1441974670.123024679 icedtea-web-1.5.3/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1s_x_2s.htm0000664000076400007640000000406612574544466034564 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/simple/CountingApplet1/resources/PaxHeaders.24993/ParallelApplet0000644000000000000000000000013212574544466030325 xustar0030 mtime=1441974582.495015979 30 atime=1441974656.555868506 30 ctime=1441974670.123024679 icedtea-web-1.5.3/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1s_x_2.html0000664000076400007640000000421012574544466034544 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/simple/CountingApplet1/resources/PaxHeaders.24993/ParallelApplet0000644000000000000000000000013212574544466030325 xustar0030 mtime=1441974582.494015968 30 atime=1441974656.555868506 30 ctime=1441974670.123024679 icedtea-web-1.5.3/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1k_x_2.html0000664000076400007640000000367012574544466034545 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/simple/CountingApplet1/resources/PaxHeaders.24993/ParallelApplet0000644000000000000000000000031112574544466030324 xustar00111 path=icedtea-web-1.5.3/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1e_x_2s.html 30 mtime=1441974582.494015968 30 atime=1441974656.554868494 30 ctime=1441974670.123024679 icedtea-web-1.5.3/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1e_x_2s.htm0000664000076400007640000000362112574544466034542 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/simple/CountingApplet1/resources/PaxHeaders.24993/ParallelApplet0000644000000000000000000000031112574544466030324 xustar00111 path=icedtea-web-1.5.3/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_2sk.html 30 mtime=1441974582.494015968 30 atime=1441974656.554868494 30 ctime=1441974670.123024679 icedtea-web-1.5.3/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_2sk.htm0000664000076400007640000000370512574544466034553 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/simple/CountingApplet1/resources/PaxHeaders.24993/ParallelApplet0000644000000000000000000000013212574544466030325 xustar0030 mtime=1441974582.493015956 30 atime=1441974656.554868494 30 ctime=1441974670.123024679 icedtea-web-1.5.3/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_2e.html0000664000076400007640000000361512574544466034536 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/simple/CountingApplet1/resources/PaxHeaders.24993/ParallelApplet0000644000000000000000000000031112574544466030324 xustar00111 path=icedtea-web-1.5.3/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_2EE.html 30 mtime=1441974582.493015956 30 atime=1441974656.554868494 30 ctime=1441974670.123024679 icedtea-web-1.5.3/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_2EE.htm0000664000076400007640000000361412574544466034426 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/simple/CountingApplet1/resources/PaxHeaders.24993/ParallelApplet0000644000000000000000000000013212574544466030325 xustar0030 mtime=1441974582.493015956 30 atime=1441974656.554868494 30 ctime=1441974670.123024679 icedtea-web-1.5.3/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_2.html0000664000076400007640000000363312574544466034371 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/simple/CountingApplet1/resources/PaxHeaders.24993/ParallelApplet0000644000000000000000000000013212574544466030325 xustar0030 mtime=1441974582.493015956 30 atime=1441974656.553868483 30 ctime=1441974670.123024679 icedtea-web-1.5.3/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1_x_1.html0000664000076400007640000000362512574544466034371 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/simple/CountingApplet1/resources/PaxHeaders.24993/ParallelApplet0000644000000000000000000000031212574544466030325 xustar00112 path=icedtea-web-1.5.3/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1EE_x_2s.html 30 mtime=1441974582.492015944 30 atime=1441974656.553868483 30 ctime=1441974670.123024679 icedtea-web-1.5.3/tests/reproducers/simple/CountingApplet1/resources/ParallelAppletsTest_1EE_x_2s.ht0000664000076400007640000000362612574544466034437 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/simple/PaxHeaders.24993/CodeBaseManifestEntryUnsignedNotMatching0000644000000000000000000000013212574544466030403 xustar0030 mtime=1441974582.492015944 30 atime=1441974670.152025013 30 ctime=1441974670.123024679 icedtea-web-1.5.3/tests/reproducers/simple/CodeBaseManifestEntryUnsignedNotMatching/0000775000076400007640000000000012574544466031541 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/CodeBaseManifestEntryUnsignedNotMatching/PaxHeaders.249930000644000000000000000000000013212574544466030403 xustar0030 mtime=1441974582.492015944 30 atime=1441974670.152025013 30 ctime=1441974670.123024679 icedtea-web-1.5.3/tests/reproducers/simple/CodeBaseManifestEntryUnsignedNotMatching/srcs/0000775000076400007640000000000012574544466032513 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/CodeBaseManifestEntryUnsignedNotMatching/srcs/PaxHeaders.0000644000000000000000000000013212574544466030742 xustar0030 mtime=1441974582.492015944 30 atime=1441974670.152025013 30 ctime=1441974670.123024679 icedtea-web-1.5.3/tests/reproducers/simple/CodeBaseManifestEntryUnsignedNotMatching/srcs/META-INF/0000775000076400007640000000000012574544466033653 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/CodeBaseManifestEntryUnsignedNotMatching/srcs/META-INF/Pa0000644000000000000000000000032112574544466030340 xustar00119 path=icedtea-web-1.5.3/tests/reproducers/simple/CodeBaseManifestEntryUnsignedNotMatching/srcs/META-INF/MANIFEST.MF 30 mtime=1441974582.492015944 30 atime=1441974656.553868483 30 ctime=1441974670.123024679 icedtea-web-1.5.3/tests/reproducers/simple/CodeBaseManifestEntryUnsignedNotMatching/srcs/META-INF/MA0000664000076400007640000000010312574544466034065 0ustar00jvanekjvanek00000000000000Manifest-Version: 1.0 Codebase: somthingWhatShould mustNeverMatch icedtea-web-1.5.3/tests/reproducers/simple/CodeBaseManifestEntryUnsignedNotMatching/srcs/PaxHeaders.0000644000000000000000000000035212574544466030746 xustar00144 path=icedtea-web-1.5.3/tests/reproducers/simple/CodeBaseManifestEntryUnsignedNotMatching/srcs/CodeBaseManifestEntryUnsignedNotMatching.java 30 mtime=1441974582.492015944 30 atime=1441974656.553868483 30 ctime=1441974670.123024679 icedtea-web-1.5.3/tests/reproducers/simple/CodeBaseManifestEntryUnsignedNotMatching/srcs/CodeBaseMan0000664000076400007640000000454612574544466034550 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/CodeBaseManifestEntryUnsignedNotMatching/PaxHeaders.249930000644000000000000000000000013212574544466030403 xustar0030 mtime=1441974582.589017061 30 atime=1441974670.152025013 30 ctime=1441974670.123024679 icedtea-web-1.5.3/tests/reproducers/simple/CodeBaseManifestEntryUnsignedNotMatching/resources/0000775000076400007640000000000012574544466033553 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/CodeBaseManifestEntryUnsignedNotMatching/resources/PaxHea0000644000000000000000000000036512574544466031056 xustar00155 path=icedtea-web-1.5.3/tests/reproducers/simple/CodeBaseManifestEntryUnsignedNotMatching/resources/CodeBaseManifestEntryUnsignedNotMatchingApplet.jnlp 30 mtime=1441974582.589017061 30 atime=1441974656.552868471 30 ctime=1441974670.123024679 icedtea-web-1.5.3/tests/reproducers/simple/CodeBaseManifestEntryUnsignedNotMatching/resources/CodeBa0000664000076400007640000000455012574544466034617 0ustar00jvanekjvanek00000000000000 Classpath Manifest Applet Test IcedTea ClasspathManifest icedtea-web-1.5.3/tests/reproducers/simple/CodeBaseManifestEntryUnsignedNotMatching/resources/PaxHea0000644000000000000000000000035712574544466031057 xustar00149 path=icedtea-web-1.5.3/tests/reproducers/simple/CodeBaseManifestEntryUnsignedNotMatching/resources/CodeBaseManifestEntryUnsignedNotMatching.jnlp 30 mtime=1441974582.589017061 30 atime=1441974656.552868471 30 ctime=1441974670.123024679 icedtea-web-1.5.3/tests/reproducers/simple/CodeBaseManifestEntryUnsignedNotMatching/resources/CodeBa0000664000076400007640000000434712574544466034623 0ustar00jvanekjvanek00000000000000 ClasspathManifest IcedTea ClasspathManifest icedtea-web-1.5.3/tests/reproducers/simple/CodeBaseManifestEntryUnsignedNotMatching/resources/PaxHea0000644000000000000000000000036312574544466031054 xustar00153 path=icedtea-web-1.5.3/tests/reproducers/simple/CodeBaseManifestEntryUnsignedNotMatching/resources/CodeBaseManifestEntryUnsignedNotMatchingJnlp.html 30 mtime=1441974582.491015933 30 atime=1441974656.552868471 30 ctime=1441974670.123024679 icedtea-web-1.5.3/tests/reproducers/simple/CodeBaseManifestEntryUnsignedNotMatching/resources/CodeBa0000664000076400007640000000355212574544466034620 0ustar00jvanekjvanek00000000000000 icedtea-web-1.5.3/tests/reproducers/simple/CodeBaseManifestEntryUnsignedNotMatching/resources/PaxHea0000644000000000000000000000035712574544466031057 xustar00149 path=icedtea-web-1.5.3/tests/reproducers/simple/CodeBaseManifestEntryUnsignedNotMatching/resources/CodeBaseManifestEntryUnsignedNotMatching.html 30 mtime=1441974582.589017061 30 atime=1441974656.552868471 30 ctime=1441974670.123024679 icedtea-web-1.5.3/tests/reproducers/simple/CodeBaseManifestEntryUnsignedNotMatching/resources/CodeBa0000664000076400007640000000360112574544466034613 0ustar00jvanekjvanek00000000000000 icedtea-web-1.5.3/tests/reproducers/simple/PaxHeaders.24993/CodeBaseManifestEntryUnsignedMatching0000644000000000000000000000013112574544466027721 xustar0029 mtime=1441974582.58801705 30 atime=1441974670.152025013 30 ctime=1441974670.123024679 icedtea-web-1.5.3/tests/reproducers/simple/CodeBaseManifestEntryUnsignedMatching/0000775000076400007640000000000012574544466031060 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/CodeBaseManifestEntryUnsignedMatching/PaxHeaders.24993/sr0000644000000000000000000000013112574544466030345 xustar0029 mtime=1441974582.58801705 30 atime=1441974670.152025013 30 ctime=1441974670.123024679 icedtea-web-1.5.3/tests/reproducers/simple/CodeBaseManifestEntryUnsignedMatching/srcs/0000775000076400007640000000000012574544466032032 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/CodeBaseManifestEntryUnsignedMatching/srcs/PaxHeaders.2490000644000000000000000000000013112574544466030517 xustar0029 mtime=1441974582.58801705 30 atime=1441974670.152025013 30 ctime=1441974670.123024679 icedtea-web-1.5.3/tests/reproducers/simple/CodeBaseManifestEntryUnsignedMatching/srcs/META-INF/0000775000076400007640000000000012574544466033172 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/CodeBaseManifestEntryUnsignedMatching/srcs/META-INF/PaxHe0000644000000000000000000000031412574544466030326 xustar00116 path=icedtea-web-1.5.3/tests/reproducers/simple/CodeBaseManifestEntryUnsignedMatching/srcs/META-INF/MANIFEST.MF 29 mtime=1441974582.58801705 29 atime=1441974656.55186846 30 ctime=1441974670.123024679 icedtea-web-1.5.3/tests/reproducers/simple/CodeBaseManifestEntryUnsignedMatching/srcs/META-INF/MANIF0000664000076400007640000000010412574544466033742 0ustar00jvanekjvanek00000000000000Manifest-Version: 1.0 Codebase: http://localhost https://localhost icedtea-web-1.5.3/tests/reproducers/simple/CodeBaseManifestEntryUnsignedMatching/srcs/PaxHeaders.2490000644000000000000000000000034212574544466030523 xustar00138 path=icedtea-web-1.5.3/tests/reproducers/simple/CodeBaseManifestEntryUnsignedMatching/srcs/CodeBaseManifestEntryUnsignedMatching.java 29 mtime=1441974582.58801705 29 atime=1441974656.55186846 30 ctime=1441974670.123024679 icedtea-web-1.5.3/tests/reproducers/simple/CodeBaseManifestEntryUnsignedMatching/srcs/CodeBaseManife0000664000076400007640000000454312574544466034550 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/CodeBaseManifestEntryUnsignedMatching/PaxHeaders.24993/re0000644000000000000000000000013112574544466030327 xustar0029 mtime=1441974582.58801705 30 atime=1441974670.152025013 30 ctime=1441974670.123024679 icedtea-web-1.5.3/tests/reproducers/simple/CodeBaseManifestEntryUnsignedMatching/resources/0000775000076400007640000000000012574544466033072 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/CodeBaseManifestEntryUnsignedMatching/resources/PaxHeader0000644000000000000000000000035312574544466031065 xustar00147 path=icedtea-web-1.5.3/tests/reproducers/simple/CodeBaseManifestEntryUnsignedMatching/resources/CodeBaseManifestEntryUnsignedMatchingJnlp.html 29 mtime=1441974582.58801705 29 atime=1441974656.55186846 30 ctime=1441974670.123024679 icedtea-web-1.5.3/tests/reproducers/simple/CodeBaseManifestEntryUnsignedMatching/resources/CodeBaseM0000664000076400007640000000354412574544466034605 0ustar00jvanekjvanek00000000000000 icedtea-web-1.5.3/tests/reproducers/simple/CodeBaseManifestEntryUnsignedMatching/resources/PaxHeader0000644000000000000000000000035612574544466031070 xustar00149 path=icedtea-web-1.5.3/tests/reproducers/simple/CodeBaseManifestEntryUnsignedMatching/resources/CodeBaseManifestEntryUnsignedMatchingApplet.jnlp 30 mtime=1441974582.587017038 29 atime=1441974656.55186846 30 ctime=1441974670.123024679 icedtea-web-1.5.3/tests/reproducers/simple/CodeBaseManifestEntryUnsignedMatching/resources/CodeBaseM0000664000076400007640000000453412574544466034605 0ustar00jvanekjvanek00000000000000 Classpath Manifest Applet Test IcedTea ClasspathManifest icedtea-web-1.5.3/tests/reproducers/simple/CodeBaseManifestEntryUnsignedMatching/resources/PaxHeader0000644000000000000000000000035012574544466031062 xustar00143 path=icedtea-web-1.5.3/tests/reproducers/simple/CodeBaseManifestEntryUnsignedMatching/resources/CodeBaseManifestEntryUnsignedMatching.jnlp 30 mtime=1441974582.587017038 29 atime=1441974656.55186846 30 ctime=1441974670.123024679 icedtea-web-1.5.3/tests/reproducers/simple/CodeBaseManifestEntryUnsignedMatching/resources/CodeBaseM0000664000076400007640000000433612574544466034605 0ustar00jvanekjvanek00000000000000 ClasspathManifest IcedTea ClasspathManifest icedtea-web-1.5.3/tests/reproducers/simple/CodeBaseManifestEntryUnsignedMatching/resources/PaxHeader0000644000000000000000000000035112574544466031063 xustar00143 path=icedtea-web-1.5.3/tests/reproducers/simple/CodeBaseManifestEntryUnsignedMatching/resources/CodeBaseManifestEntryUnsignedMatching.html 30 mtime=1441974582.587017038 30 atime=1441974656.550868448 30 ctime=1441974670.123024679 icedtea-web-1.5.3/tests/reproducers/simple/CodeBaseManifestEntryUnsignedMatching/resources/CodeBaseM0000664000076400007640000000357312574544466034607 0ustar00jvanekjvanek00000000000000 icedtea-web-1.5.3/tests/reproducers/simple/PaxHeaders.24993/ClipboardContent0000644000000000000000000000013212574544466023626 xustar0030 mtime=1441974582.586017026 30 atime=1441974670.152025013 30 ctime=1441974670.123024679 icedtea-web-1.5.3/tests/reproducers/simple/ClipboardContent/0000775000076400007640000000000012574544466024764 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/ClipboardContent/PaxHeaders.24993/testcases0000644000000000000000000000013212574544466025624 xustar0030 mtime=1441974582.586017026 30 atime=1441974670.152025013 30 ctime=1441974670.123024679 icedtea-web-1.5.3/tests/reproducers/simple/ClipboardContent/testcases/0000775000076400007640000000000012574544466026762 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/ClipboardContent/testcases/PaxHeaders.24993/ClipboardCont0000644000000000000000000000013212574544466030347 xustar0030 mtime=1441974582.586017026 30 atime=1441974656.550868448 30 ctime=1441974670.123024679 icedtea-web-1.5.3/tests/reproducers/simple/ClipboardContent/testcases/ClipboardContentTests.java0000664000076400007640000001517612574544466034114 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/ClipboardContent/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466024600 xustar0030 mtime=1441974582.586017026 30 atime=1441974670.152025013 30 ctime=1441974670.123024679 icedtea-web-1.5.3/tests/reproducers/simple/ClipboardContent/srcs/0000775000076400007640000000000012574544466025736 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/ClipboardContent/srcs/PaxHeaders.24993/ClipboardContent.j0000644000000000000000000000013212574544466030262 xustar0030 mtime=1441974582.586017026 30 atime=1441974656.550868448 30 ctime=1441974670.122024668 icedtea-web-1.5.3/tests/reproducers/simple/ClipboardContent/srcs/ClipboardContent.java0000664000076400007640000001616512574544466032044 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/ClipboardContent/PaxHeaders.24993/resources0000644000000000000000000000013212574544466025640 xustar0030 mtime=1441974582.586017026 30 atime=1441974670.152025013 30 ctime=1441974670.122024668 icedtea-web-1.5.3/tests/reproducers/simple/ClipboardContent/resources/0000775000076400007640000000000012574544466026776 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/ClipboardContent/resources/PaxHeaders.24993/ClipboardCont0000644000000000000000000000013212574544466030363 xustar0030 mtime=1441974582.586017026 30 atime=1441974656.549868437 30 ctime=1441974670.122024668 icedtea-web-1.5.3/tests/reproducers/simple/ClipboardContent/resources/ClipboardContentPaste2.jnlp0000664000076400007640000000441512574544466034200 0ustar00jvanekjvanek00000000000000 ClipboardContentPaste2 IcedTea ClipboardContentPaste2 paste2 icedtea-web-1.5.3/tests/reproducers/simple/ClipboardContent/resources/PaxHeaders.24993/ClipboardCont0000644000000000000000000000013212574544466030363 xustar0030 mtime=1441974582.585017015 30 atime=1441974656.549868437 30 ctime=1441974670.122024668 icedtea-web-1.5.3/tests/reproducers/simple/ClipboardContent/resources/ClipboardContentPaste1.jnlp0000664000076400007640000000441512574544466034177 0ustar00jvanekjvanek00000000000000 ClipboardContentPaste1 IcedTea ClipboardContentPaste1 paste1 icedtea-web-1.5.3/tests/reproducers/simple/ClipboardContent/resources/PaxHeaders.24993/ClipboardCont0000644000000000000000000000013212574544466030363 xustar0030 mtime=1441974582.585017015 30 atime=1441974656.549868437 30 ctime=1441974670.122024668 icedtea-web-1.5.3/tests/reproducers/simple/ClipboardContent/resources/ClipboardContentCopy2.jnlp0000664000076400007640000000445112574544466034036 0ustar00jvanekjvanek00000000000000 ClipboardContentCopy2 IcedTea ClipboardContentCopy2 copy2 10 icedtea-web-1.5.3/tests/reproducers/simple/ClipboardContent/resources/PaxHeaders.24993/ClipboardCont0000644000000000000000000000013212574544466030363 xustar0030 mtime=1441974582.585017015 30 atime=1441974656.549868437 30 ctime=1441974670.122024668 icedtea-web-1.5.3/tests/reproducers/simple/ClipboardContent/resources/ClipboardContentCopy1.jnlp0000664000076400007640000000445112574544466034035 0ustar00jvanekjvanek00000000000000 ClipboardContentCopy1 IcedTea ClipboardContentCopy1 copy1 10 icedtea-web-1.5.3/tests/reproducers/simple/PaxHeaders.24993/CheckServices0000644000000000000000000000013212574544466023115 xustar0030 mtime=1441974582.584017003 30 atime=1441974670.152025013 30 ctime=1441974670.122024668 icedtea-web-1.5.3/tests/reproducers/simple/CheckServices/0000775000076400007640000000000012574544466024253 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/CheckServices/PaxHeaders.24993/testcases0000644000000000000000000000013212574544466025113 xustar0030 mtime=1441974582.584017003 30 atime=1441974670.152025013 30 ctime=1441974670.122024668 icedtea-web-1.5.3/tests/reproducers/simple/CheckServices/testcases/0000775000076400007640000000000012574544466026251 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/CheckServices/testcases/PaxHeaders.24993/CheckServicesTes0000644000000000000000000000013212574544466030310 xustar0030 mtime=1441974582.584017003 30 atime=1441974656.549868437 30 ctime=1441974670.122024668 icedtea-web-1.5.3/tests/reproducers/simple/CheckServices/testcases/CheckServicesTests.java0000664000076400007640000001022312574544466032656 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/CheckServices/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466024067 xustar0030 mtime=1441974582.584017003 30 atime=1441974670.152025013 30 ctime=1441974670.122024668 icedtea-web-1.5.3/tests/reproducers/simple/CheckServices/srcs/0000775000076400007640000000000012574544466025225 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/CheckServices/srcs/PaxHeaders.24993/CheckServices.java0000644000000000000000000000013212574544466027530 xustar0030 mtime=1441974582.584017003 30 atime=1441974656.548868425 30 ctime=1441974670.122024668 icedtea-web-1.5.3/tests/reproducers/simple/CheckServices/srcs/CheckServices.java0000664000076400007640000000753412574544466030622 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/CheckServices/PaxHeaders.24993/resources0000644000000000000000000000013212574544466025127 xustar0030 mtime=1441974582.584017003 30 atime=1441974670.152025013 30 ctime=1441974670.122024668 icedtea-web-1.5.3/tests/reproducers/simple/CheckServices/resources/0000775000076400007640000000000012574544466026265 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/CheckServices/resources/PaxHeaders.24993/CheckServices.jn0000644000000000000000000000013212574544466030256 xustar0030 mtime=1441974582.584017003 30 atime=1441974656.548868425 30 ctime=1441974670.122024668 icedtea-web-1.5.3/tests/reproducers/simple/CheckServices/resources/CheckServices.jnlp0000664000076400007640000000432012574544466031672 0ustar00jvanekjvanek00000000000000 CheckServices IcedTea CheckServices icedtea-web-1.5.3/tests/reproducers/simple/CheckServices/resources/PaxHeaders.24993/CheckPluginServi0000644000000000000000000000013212574544466030334 xustar0030 mtime=1441974582.584017003 30 atime=1441974656.548868425 30 ctime=1441974670.122024668 icedtea-web-1.5.3/tests/reproducers/simple/CheckServices/resources/CheckPluginServices.html0000664000076400007640000000343512574544466033060 0ustar00jvanekjvanek00000000000000 icedtea-web-1.5.3/tests/reproducers/simple/PaxHeaders.24993/AppletTest0000644000000000000000000000013212574544466022461 xustar0030 mtime=1441974582.583016992 30 atime=1441974670.152025013 30 ctime=1441974670.122024668 icedtea-web-1.5.3/tests/reproducers/simple/AppletTest/0000775000076400007640000000000012574544466023617 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/AppletTest/PaxHeaders.24993/testcases0000644000000000000000000000013212574544466024457 xustar0030 mtime=1441974582.583016992 30 atime=1441974670.152025013 30 ctime=1441974670.122024668 icedtea-web-1.5.3/tests/reproducers/simple/AppletTest/testcases/0000775000076400007640000000000012574544466025615 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/AppletTest/testcases/PaxHeaders.24993/AppletTestTests.jav0000644000000000000000000000013212574544466030346 xustar0030 mtime=1441974582.583016992 30 atime=1441974656.548868425 30 ctime=1441974670.122024668 icedtea-web-1.5.3/tests/reproducers/simple/AppletTest/testcases/AppletTestTests.java0000664000076400007640000001775012574544466031602 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/AppletTest/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466023433 xustar0030 mtime=1441974582.583016992 30 atime=1441974670.152025013 30 ctime=1441974670.122024668 icedtea-web-1.5.3/tests/reproducers/simple/AppletTest/srcs/0000775000076400007640000000000012574544466024571 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/AppletTest/srcs/PaxHeaders.24993/AppletTest.java0000644000000000000000000000013212574544466026440 xustar0030 mtime=1441974582.583016992 30 atime=1441974656.547868414 30 ctime=1441974670.122024668 icedtea-web-1.5.3/tests/reproducers/simple/AppletTest/srcs/AppletTest.java0000664000076400007640000000521312574544466027522 0ustar00jvanekjvanek00000000000000 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.5.3/tests/reproducers/simple/AppletTest/srcs/PaxHeaders.24993/AppletErrorTest.java0000644000000000000000000000013212574544466027452 xustar0030 mtime=1441974582.582016981 30 atime=1441974656.547868414 30 ctime=1441974670.122024668 icedtea-web-1.5.3/tests/reproducers/simple/AppletTest/srcs/AppletErrorTest.java0000664000076400007640000002150712574544466030540 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/AppletTest/PaxHeaders.24993/resources0000644000000000000000000000013212574544466024473 xustar0030 mtime=1441974582.582016981 30 atime=1441974670.152025013 30 ctime=1441974670.122024668 icedtea-web-1.5.3/tests/reproducers/simple/AppletTest/resources/0000775000076400007640000000000012574544466025631 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/AppletTest/resources/PaxHeaders.24993/errorAppletAutoTest0000644000000000000000000000013212574544466030463 xustar0030 mtime=1441974582.582016981 30 atime=1441974656.547868414 30 ctime=1441974670.122024668 icedtea-web-1.5.3/tests/reproducers/simple/AppletTest/resources/errorAppletAutoTests.html0000664000076400007640000000351712574544466032700 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/simple/AppletTest/resources/PaxHeaders.24993/appletZeroWH.html0000644000000000000000000000013212574544466030022 xustar0030 mtime=1441974582.582016981 30 atime=1441974656.547868414 30 ctime=1441974670.122024668 icedtea-web-1.5.3/tests/reproducers/simple/AppletTest/resources/appletZeroWH.html0000664000076400007640000000353112574544466031105 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/simple/AppletTest/resources/PaxHeaders.24993/appletZeroW.html0000644000000000000000000000013212574544466027712 xustar0030 mtime=1441974582.582016981 30 atime=1441974656.546868402 30 ctime=1441974670.122024668 icedtea-web-1.5.3/tests/reproducers/simple/AppletTest/resources/appletZeroW.html0000664000076400007640000000353312574544466030777 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/simple/AppletTest/resources/PaxHeaders.24993/appletZeroH.html0000644000000000000000000000013212574544466027673 xustar0030 mtime=1441974582.581016969 30 atime=1441974656.546868402 30 ctime=1441974670.122024668 icedtea-web-1.5.3/tests/reproducers/simple/AppletTest/resources/appletZeroH.html0000664000076400007640000000353312574544466030760 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/simple/AppletTest/resources/PaxHeaders.24993/appletViewTest.html0000644000000000000000000000013212574544466030416 xustar0030 mtime=1441974582.581016969 30 atime=1441974656.546868402 30 ctime=1441974670.122024668 icedtea-web-1.5.3/tests/reproducers/simple/AppletTest/resources/appletViewTest.html0000664000076400007640000000402312574544466031476 0ustar00jvanekjvanek00000000000000 ok applet

ok applet

ok applet

bad applet

bad applet

icedtea-web-1.5.3/tests/reproducers/simple/AppletTest/resources/PaxHeaders.24993/appletAutoTests2.ht0000644000000000000000000000013212574544466030330 xustar0030 mtime=1441974582.581016969 30 atime=1441974656.546868402 30 ctime=1441974670.122024668 icedtea-web-1.5.3/tests/reproducers/simple/AppletTest/resources/appletAutoTests2.html0000664000076400007640000000353512574544466031750 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/simple/AppletTest/resources/PaxHeaders.24993/appletAutoTests.htm0000644000000000000000000000013212574544466030423 xustar0030 mtime=1441974582.580016957 30 atime=1441974656.545868391 30 ctime=1441974670.122024668 icedtea-web-1.5.3/tests/reproducers/simple/AppletTest/resources/appletAutoTests.html0000664000076400007640000000354312574544466031665 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/simple/AppletTest/resources/PaxHeaders.24993/AppletTest.jnlp0000644000000000000000000000013212574544466027522 xustar0030 mtime=1441974582.580016957 30 atime=1441974656.545868391 30 ctime=1441974670.122024668 icedtea-web-1.5.3/tests/reproducers/simple/AppletTest/resources/AppletTest.jnlp0000664000076400007640000000447012574544466030610 0ustar00jvanekjvanek00000000000000 AppletTest IcedTea AppletTest icedtea-web-1.5.3/tests/reproducers/simple/PaxHeaders.24993/AppletTakesLastParam0000644000000000000000000000013212574544466024416 xustar0030 mtime=1441974582.580016957 30 atime=1441974670.152025013 30 ctime=1441974670.122024668 icedtea-web-1.5.3/tests/reproducers/simple/AppletTakesLastParam/0000775000076400007640000000000012574544466025554 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/AppletTakesLastParam/PaxHeaders.24993/testcases0000644000000000000000000000013212574544466026414 xustar0030 mtime=1441974582.580016957 30 atime=1441974670.152025013 30 ctime=1441974670.122024668 icedtea-web-1.5.3/tests/reproducers/simple/AppletTakesLastParam/testcases/0000775000076400007640000000000012574544466027552 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/AppletTakesLastParam/testcases/PaxHeaders.24993/AppletTak0000644000000000000000000000031412574544466030303 xustar00114 path=icedtea-web-1.5.3/tests/reproducers/simple/AppletTakesLastParam/testcases/AppletTakesLastParamTests.java 30 mtime=1441974582.580016957 30 atime=1441974656.545868391 30 ctime=1441974670.122024668 icedtea-web-1.5.3/tests/reproducers/simple/AppletTakesLastParam/testcases/AppletTakesLastParamTests.0000664000076400007640000000551012574544466034621 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/AppletTakesLastParam/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466025370 xustar0030 mtime=1441974582.579016946 30 atime=1441974670.152025013 30 ctime=1441974670.122024668 icedtea-web-1.5.3/tests/reproducers/simple/AppletTakesLastParam/srcs/0000775000076400007640000000000012574544466026526 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/AppletTakesLastParam/srcs/PaxHeaders.24993/AppletTakesLas0000644000000000000000000000013212574544466030245 xustar0030 mtime=1441974582.579016946 30 atime=1441974656.545868391 30 ctime=1441974670.122024668 icedtea-web-1.5.3/tests/reproducers/simple/AppletTakesLastParam/srcs/AppletTakesLastParam.java0000664000076400007640000000364612574544466033424 0ustar00jvanekjvanek00000000000000 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.5.3/tests/reproducers/simple/AppletTakesLastParam/PaxHeaders.24993/resources0000644000000000000000000000013212574544466026430 xustar0030 mtime=1441974582.579016946 30 atime=1441974670.152025013 30 ctime=1441974670.122024668 icedtea-web-1.5.3/tests/reproducers/simple/AppletTakesLastParam/resources/0000775000076400007640000000000012574544466027566 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/AppletTakesLastParam/resources/PaxHeaders.24993/appletTak0000644000000000000000000000013212574544466030355 xustar0030 mtime=1441974582.579016946 30 atime=1441974656.545868391 30 ctime=1441974670.122024668 icedtea-web-1.5.3/tests/reproducers/simple/AppletTakesLastParam/resources/appletTakesLastParam.jnlp0000664000076400007640000000456612574544466034550 0ustar00jvanekjvanek00000000000000 AppletTakesLastParam IcedTea AppletTakesLastParam icedtea-web-1.5.3/tests/reproducers/simple/AppletTakesLastParam/resources/PaxHeaders.24993/appletTak0000644000000000000000000000013212574544466030355 xustar0030 mtime=1441974582.579016946 30 atime=1441974656.544868379 30 ctime=1441974670.122024668 icedtea-web-1.5.3/tests/reproducers/simple/AppletTakesLastParam/resources/appletTakesLastParam.html0000664000076400007640000000351412574544466034541 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/simple/PaxHeaders.24993/AppletTagWithMissingCodeAttribute0000644000000000000000000000013212574544466027122 xustar0030 mtime=1441974582.578016934 30 atime=1441974670.152025013 30 ctime=1441974670.122024668 icedtea-web-1.5.3/tests/reproducers/simple/AppletTagWithMissingCodeAttribute/0000775000076400007640000000000012574544466030260 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/AppletTagWithMissingCodeAttribute/PaxHeaders.24993/testca0000644000000000000000000000013212574544466030405 xustar0030 mtime=1441974582.578016934 30 atime=1441974670.152025013 30 ctime=1441974670.122024668 icedtea-web-1.5.3/tests/reproducers/simple/AppletTagWithMissingCodeAttribute/testcases/0000775000076400007640000000000012574544466032256 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/AppletTagWithMissingCodeAttribute/testcases/PaxHeaders.240000644000000000000000000000034112574544466030655 xustar00135 path=icedtea-web-1.5.3/tests/reproducers/simple/AppletTagWithMissingCodeAttribute/testcases/AppletTagWithMissingCodeAttribute.java 30 mtime=1441974582.579016946 30 atime=1441974656.544868379 30 ctime=1441974670.122024668 icedtea-web-1.5.3/tests/reproducers/simple/AppletTagWithMissingCodeAttribute/testcases/AppletTagWith0000664000076400007640000000504112574544466034716 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/AppletTagWithMissingCodeAttribute/PaxHeaders.24993/resour0000644000000000000000000000013212574544466030441 xustar0030 mtime=1441974582.578016934 30 atime=1441974670.152025013 30 ctime=1441974670.122024668 icedtea-web-1.5.3/tests/reproducers/simple/AppletTagWithMissingCodeAttribute/resources/0000775000076400007640000000000012574544466032272 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/AppletTagWithMissingCodeAttribute/resources/PaxHeaders.240000644000000000000000000000034112574544466030671 xustar00135 path=icedtea-web-1.5.3/tests/reproducers/simple/AppletTagWithMissingCodeAttribute/resources/AppletTagWithMissingCodeAttribute.html 30 mtime=1441974582.578016934 30 atime=1441974656.544868379 30 ctime=1441974670.122024668 icedtea-web-1.5.3/tests/reproducers/simple/AppletTagWithMissingCodeAttribute/resources/AppletTagWith0000664000076400007640000000344412574544466034737 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/simple/AppletTagWithMissingCodeAttribute/resources/PaxHeaders.240000644000000000000000000000032712574544466030675 xustar00125 path=icedtea-web-1.5.3/tests/reproducers/simple/AppletTagWithMissingCodeAttribute/resources/AppletJnlpWithMainClass.jnlp 30 mtime=1441974582.578016934 30 atime=1441974656.544868379 30 ctime=1441974670.122024668 icedtea-web-1.5.3/tests/reproducers/simple/AppletTagWithMissingCodeAttribute/resources/AppletJnlpWit0000664000076400007640000000435612574544466034762 0ustar00jvanekjvanek00000000000000 AppletJnlpWithMainClass IcedTea AppletJnlpWithMainClass icedtea-web-1.5.3/tests/reproducers/simple/PaxHeaders.24993/AppletSharedClassLoader0000644000000000000000000000013212574544466025065 xustar0030 mtime=1441974582.577016923 30 atime=1441974670.152025013 30 ctime=1441974670.121024656 icedtea-web-1.5.3/tests/reproducers/simple/AppletSharedClassLoader/0000775000076400007640000000000012574544466026223 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/AppletSharedClassLoader/PaxHeaders.24993/testcases0000644000000000000000000000013212574544466027063 xustar0030 mtime=1441974582.577016923 30 atime=1441974670.152025013 30 ctime=1441974670.121024656 icedtea-web-1.5.3/tests/reproducers/simple/AppletSharedClassLoader/testcases/0000775000076400007640000000000012574544466030221 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/AppletSharedClassLoader/testcases/PaxHeaders.24993/Shared0000644000000000000000000000033512574544466030276 xustar00131 path=icedtea-web-1.5.3/tests/reproducers/simple/AppletSharedClassLoader/testcases/SharedClassLoaderApplet_dotCodeBaseTest.java 30 mtime=1441974582.577016923 30 atime=1441974656.543868368 30 ctime=1441974670.121024656 icedtea-web-1.5.3/tests/reproducers/simple/AppletSharedClassLoader/testcases/SharedClassLoaderApplet0000664000076400007640000003206512574544466034643 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/AppletSharedClassLoader/testcases/PaxHeaders.24993/Shared0000644000000000000000000000035412574544466030277 xustar00146 path=icedtea-web-1.5.3/tests/reproducers/simple/AppletSharedClassLoader/testcases/SharedClassLoaderApplet_WrittenPartialStubCodeBaseTest.java 30 mtime=1441974582.577016923 30 atime=1441974656.543868368 30 ctime=1441974670.121024656 icedtea-web-1.5.3/tests/reproducers/simple/AppletSharedClassLoader/testcases/SharedClassLoaderApplet0000664000076400007640000002514412574544466034643 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/AppletSharedClassLoader/testcases/PaxHeaders.24993/Shared0000644000000000000000000000035112574544466030274 xustar00143 path=icedtea-web-1.5.3/tests/reproducers/simple/AppletSharedClassLoader/testcases/SharedClassLoaderApplet_WrittenCompleteCodeBaseTest.java 30 mtime=1441974582.577016923 30 atime=1441974656.543868368 30 ctime=1441974670.121024656 icedtea-web-1.5.3/tests/reproducers/simple/AppletSharedClassLoader/testcases/SharedClassLoaderApplet0000664000076400007640000002230012574544466034632 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/AppletSharedClassLoader/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466026037 xustar0030 mtime=1441974582.576016911 30 atime=1441974670.152025013 30 ctime=1441974670.121024656 icedtea-web-1.5.3/tests/reproducers/simple/AppletSharedClassLoader/srcs/0000775000076400007640000000000012574544466027175 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/AppletSharedClassLoader/srcs/PaxHeaders.24993/SharedSecre0000644000000000000000000000013212574544466030227 xustar0030 mtime=1441974582.576016911 30 atime=1441974656.542868356 30 ctime=1441974670.121024656 icedtea-web-1.5.3/tests/reproducers/simple/AppletSharedClassLoader/srcs/SharedSecret.java0000664000076400007640000000537312574544466032424 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/AppletSharedClassLoader/srcs/PaxHeaders.24993/SharedClass0000644000000000000000000000031112574544466030232 xustar00111 path=icedtea-web-1.5.3/tests/reproducers/simple/AppletSharedClassLoader/srcs/SharedClassLoaderApplet2.java 30 mtime=1441974582.576016911 30 atime=1441974656.542868356 30 ctime=1441974670.121024656 icedtea-web-1.5.3/tests/reproducers/simple/AppletSharedClassLoader/srcs/SharedClassLoaderApplet2.jav0000664000076400007640000000351712574544466034460 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/AppletSharedClassLoader/srcs/PaxHeaders.24993/SharedClass0000644000000000000000000000031112574544466030232 xustar00111 path=icedtea-web-1.5.3/tests/reproducers/simple/AppletSharedClassLoader/srcs/SharedClassLoaderApplet1.java 30 mtime=1441974582.576016911 30 atime=1441974656.542868356 30 ctime=1441974670.121024656 icedtea-web-1.5.3/tests/reproducers/simple/AppletSharedClassLoader/srcs/SharedClassLoaderApplet1.jav0000664000076400007640000000351712574544466034457 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/AppletSharedClassLoader/PaxHeaders.24993/resources0000644000000000000000000000013012574544466027075 xustar0028 mtime=1441974582.5750169 30 atime=1441974670.152025013 30 ctime=1441974670.121024656 icedtea-web-1.5.3/tests/reproducers/simple/AppletSharedClassLoader/resources/0000775000076400007640000000000012574544466030235 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/AppletSharedClassLoader/resources/PaxHeaders.24993/Launch0000644000000000000000000000033412574544466030315 xustar00130 path=icedtea-web-1.5.3/tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoaderApplet2-writer2.html 30 mtime=1441974582.576016911 30 atime=1441974656.542868356 30 ctime=1441974670.121024656 icedtea-web-1.5.3/tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoader0000664000076400007640000000352112574544466034637 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/simple/AppletSharedClassLoader/resources/PaxHeaders.24993/Launch0000644000000000000000000000033212574544466030313 xustar00130 path=icedtea-web-1.5.3/tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoaderApplet2-writer1.html 28 mtime=1441974582.5750169 30 atime=1441974656.542868356 30 ctime=1441974670.121024656 icedtea-web-1.5.3/tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoader0000664000076400007640000000352112574544466034637 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/simple/AppletSharedClassLoader/resources/PaxHeaders.24993/Launch0000644000000000000000000000033212574544466030313 xustar00130 path=icedtea-web-1.5.3/tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoaderApplet2-reader2.html 28 mtime=1441974582.5750169 30 atime=1441974656.541868345 30 ctime=1441974670.121024656 icedtea-web-1.5.3/tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoader0000664000076400007640000000352112574544466034637 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/simple/AppletSharedClassLoader/resources/PaxHeaders.24993/Launch0000644000000000000000000000033212574544466030313 xustar00130 path=icedtea-web-1.5.3/tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoaderApplet2-reader1.html 28 mtime=1441974582.5750169 30 atime=1441974656.541868345 30 ctime=1441974670.121024656 icedtea-web-1.5.3/tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoader0000664000076400007640000000352112574544466034637 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/simple/AppletSharedClassLoader/resources/PaxHeaders.24993/Launch0000644000000000000000000000034412574544466030316 xustar00138 path=icedtea-web-1.5.3/tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoaderApplet2-reader1-writer2.html 30 mtime=1441974582.574016888 30 atime=1441974656.541868345 30 ctime=1441974670.121024656 icedtea-web-1.5.3/tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoader0000664000076400007640000000400012574544466034630 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/simple/AppletSharedClassLoader/resources/PaxHeaders.24993/Launch0000644000000000000000000000034412574544466030316 xustar00138 path=icedtea-web-1.5.3/tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoaderApplet2-reader1-writer1.html 30 mtime=1441974582.574016888 30 atime=1441974656.541868345 30 ctime=1441974670.121024656 icedtea-web-1.5.3/tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoader0000664000076400007640000000400012574544466034630 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/simple/AppletSharedClassLoader/resources/PaxHeaders.24993/Launch0000644000000000000000000000033312574544466030314 xustar00129 path=icedtea-web-1.5.3/tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoaderApplet-writer2.html 30 mtime=1441974582.574016888 30 atime=1441974656.540868333 30 ctime=1441974670.121024656 icedtea-web-1.5.3/tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoader0000664000076400007640000000352012574544466034636 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/simple/AppletSharedClassLoader/resources/PaxHeaders.24993/Launch0000644000000000000000000000033312574544466030314 xustar00129 path=icedtea-web-1.5.3/tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoaderApplet-writer1.html 30 mtime=1441974582.574016888 30 atime=1441974656.540868333 30 ctime=1441974670.121024656 icedtea-web-1.5.3/tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoader0000664000076400007640000000352012574544466034636 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/simple/AppletSharedClassLoader/resources/PaxHeaders.24993/Launch0000644000000000000000000000033312574544466030314 xustar00129 path=icedtea-web-1.5.3/tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoaderApplet-reader2.html 30 mtime=1441974582.573016877 30 atime=1441974656.540868333 30 ctime=1441974670.121024656 icedtea-web-1.5.3/tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoader0000664000076400007640000000352012574544466034636 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/simple/AppletSharedClassLoader/resources/PaxHeaders.24993/Launch0000644000000000000000000000033312574544466030314 xustar00129 path=icedtea-web-1.5.3/tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoaderApplet-reader1.html 30 mtime=1441974582.573016877 30 atime=1441974656.540868333 30 ctime=1441974670.121024656 icedtea-web-1.5.3/tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoader0000664000076400007640000000352012574544466034636 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/simple/AppletSharedClassLoader/resources/PaxHeaders.24993/Launch0000644000000000000000000000034312574544466030315 xustar00137 path=icedtea-web-1.5.3/tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoaderApplet-reader1-writer2.html 30 mtime=1441974582.573016877 30 atime=1441974656.540868333 30 ctime=1441974670.121024656 icedtea-web-1.5.3/tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoader0000664000076400007640000000377712574544466034654 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/simple/AppletSharedClassLoader/resources/PaxHeaders.24993/Launch0000644000000000000000000000034312574544466030315 xustar00137 path=icedtea-web-1.5.3/tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoaderApplet-reader1-writer1.html 30 mtime=1441974582.573016877 30 atime=1441974656.539868322 30 ctime=1441974670.121024656 icedtea-web-1.5.3/tests/reproducers/simple/AppletSharedClassLoader/resources/LaunchSharedClassLoader0000664000076400007640000000377712574544466034654 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/simple/PaxHeaders.24993/AppletReadsInvalidJar0000644000000000000000000000013212574544466024544 xustar0030 mtime=1441974582.572016865 30 atime=1441974670.152025013 30 ctime=1441974670.121024656 icedtea-web-1.5.3/tests/reproducers/simple/AppletReadsInvalidJar/0000775000076400007640000000000012574544466025702 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/AppletReadsInvalidJar/PaxHeaders.24993/testcases0000644000000000000000000000013212574544466026542 xustar0030 mtime=1441974582.572016865 30 atime=1441974670.152025013 30 ctime=1441974670.121024656 icedtea-web-1.5.3/tests/reproducers/simple/AppletReadsInvalidJar/testcases/0000775000076400007640000000000012574544466027700 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/AppletReadsInvalidJar/testcases/PaxHeaders.24993/AppletRe0000644000000000000000000000031612574544466030262 xustar00116 path=icedtea-web-1.5.3/tests/reproducers/simple/AppletReadsInvalidJar/testcases/AppletReadsInvalidJarTests.java 30 mtime=1441974582.572016865 30 atime=1441974656.539868322 30 ctime=1441974670.121024656 icedtea-web-1.5.3/tests/reproducers/simple/AppletReadsInvalidJar/testcases/AppletReadsInvalidJarTest0000664000076400007640000000602512574544466034636 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/AppletReadsInvalidJar/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466025516 xustar0030 mtime=1441974582.572016865 30 atime=1441974670.152025013 30 ctime=1441974670.121024656 icedtea-web-1.5.3/tests/reproducers/simple/AppletReadsInvalidJar/srcs/0000775000076400007640000000000012574544466026654 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/AppletReadsInvalidJar/srcs/PaxHeaders.24993/Valid.java0000644000000000000000000000013212574544466027475 xustar0030 mtime=1441974582.572016865 30 atime=1441974656.539868322 30 ctime=1441974670.121024656 icedtea-web-1.5.3/tests/reproducers/simple/AppletReadsInvalidJar/srcs/Valid.java0000664000076400007640000000406412574544466030562 0ustar00jvanekjvanek00000000000000import 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.5.3/tests/reproducers/simple/AppletReadsInvalidJar/PaxHeaders.24993/resources0000644000000000000000000000013212574544466026556 xustar0030 mtime=1441974582.572016865 30 atime=1441974670.152025013 30 ctime=1441974670.121024656 icedtea-web-1.5.3/tests/reproducers/simple/AppletReadsInvalidJar/resources/0000775000076400007640000000000012574544466027714 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/AppletReadsInvalidJar/resources/PaxHeaders.24993/NOT_A_VA0000644000000000000000000000013212574544466030044 xustar0030 mtime=1441974582.572016865 30 atime=1441974656.539868322 30 ctime=1441974670.121024656 icedtea-web-1.5.3/tests/reproducers/simple/AppletReadsInvalidJar/resources/NOT_A_VALID_JAR.jar0000664000076400007640000000000012574544466032713 0ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/AppletReadsInvalidJar/resources/PaxHeaders.24993/AppletRe0000644000000000000000000000031012574544466030270 xustar00111 path=icedtea-web-1.5.3/tests/reproducers/simple/AppletReadsInvalidJar/resources/AppletReadsInvalidJar.jnlp 30 mtime=1441974582.571016854 29 atime=1441974656.53886831 30 ctime=1441974670.121024656 icedtea-web-1.5.3/tests/reproducers/simple/AppletReadsInvalidJar/resources/AppletReadsInvalidJar.jnl0000664000076400007640000000446112574544466034576 0ustar00jvanekjvanek00000000000000 AppletReadsInvalidJar IcedTea AppletTest icedtea-web-1.5.3/tests/reproducers/simple/AppletReadsInvalidJar/resources/PaxHeaders.24993/AppletRe0000644000000000000000000000031012574544466030270 xustar00111 path=icedtea-web-1.5.3/tests/reproducers/simple/AppletReadsInvalidJar/resources/AppletReadsInvalidJar.html 30 mtime=1441974582.571016854 29 atime=1441974656.53886831 30 ctime=1441974670.121024656 icedtea-web-1.5.3/tests/reproducers/simple/AppletReadsInvalidJar/resources/AppletReadsInvalidJar.htm0000664000076400007640000000340612574544466034601 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/simple/PaxHeaders.24993/AppletJsAppletDeadlock0000644000000000000000000000013212574544466024713 xustar0030 mtime=1441974582.571016854 30 atime=1441974670.152025013 30 ctime=1441974670.121024656 icedtea-web-1.5.3/tests/reproducers/simple/AppletJsAppletDeadlock/0000775000076400007640000000000012574544466026051 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/AppletJsAppletDeadlock/PaxHeaders.24993/testcases0000644000000000000000000000013212574544466026711 xustar0030 mtime=1441974582.571016854 30 atime=1441974670.152025013 30 ctime=1441974670.121024656 icedtea-web-1.5.3/tests/reproducers/simple/AppletJsAppletDeadlock/testcases/0000775000076400007640000000000012574544466030047 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/AppletJsAppletDeadlock/testcases/PaxHeaders.24993/AppletJ0000644000000000000000000000031612574544466030254 xustar00117 path=icedtea-web-1.5.3/tests/reproducers/simple/AppletJsAppletDeadlock/testcases/AppletJsAppletDeadlockTest.java 30 mtime=1441974582.571016854 29 atime=1441974656.53886831 30 ctime=1441974670.121024656 icedtea-web-1.5.3/tests/reproducers/simple/AppletJsAppletDeadlock/testcases/AppletJsAppletDeadlockTe0000664000076400007640000001105712574544466034606 0ustar00jvanekjvanek00000000000000/* Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the 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.5.3/tests/reproducers/simple/AppletJsAppletDeadlock/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466025665 xustar0030 mtime=1441974582.570016842 30 atime=1441974670.152025013 30 ctime=1441974670.121024656 icedtea-web-1.5.3/tests/reproducers/simple/AppletJsAppletDeadlock/srcs/0000775000076400007640000000000012574544466027023 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/AppletJsAppletDeadlock/srcs/PaxHeaders.24993/AppletJsAppl0000644000000000000000000000013212574544466030224 xustar0030 mtime=1441974582.570016842 30 atime=1441974656.537868298 30 ctime=1441974670.121024656 icedtea-web-1.5.3/tests/reproducers/simple/AppletJsAppletDeadlock/srcs/AppletJsAppletDeadlock.java0000664000076400007640000000605412574544466034212 0ustar00jvanekjvanek00000000000000/* Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the 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.5.3/tests/reproducers/simple/AppletJsAppletDeadlock/PaxHeaders.24993/resources0000644000000000000000000000013212574544466026725 xustar0030 mtime=1441974582.570016842 30 atime=1441974670.153025025 30 ctime=1441974670.121024656 icedtea-web-1.5.3/tests/reproducers/simple/AppletJsAppletDeadlock/resources/0000775000076400007640000000000012574544466030063 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/AppletJsAppletDeadlock/resources/PaxHeaders.24993/AppletJ0000644000000000000000000000031312574544466030265 xustar00113 path=icedtea-web-1.5.3/tests/reproducers/simple/AppletJsAppletDeadlock/resources/AppletJsAppletDeadlock.html 30 mtime=1441974582.570016842 30 atime=1441974656.537868298 30 ctime=1441974670.121024656 icedtea-web-1.5.3/tests/reproducers/simple/AppletJsAppletDeadlock/resources/AppletJsAppletDeadlock.h0000664000076400007640000000421612574544466034556 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/simple/PaxHeaders.24993/AppletBaseURLTest0000644000000000000000000000013212574544466023637 xustar0030 mtime=1441974582.570016842 30 atime=1441974670.153025025 30 ctime=1441974670.121024656 icedtea-web-1.5.3/tests/reproducers/simple/AppletBaseURLTest/0000775000076400007640000000000012574544466024775 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/AppletBaseURLTest/PaxHeaders.24993/testcases0000644000000000000000000000013212574544466025635 xustar0030 mtime=1441974582.570016842 30 atime=1441974670.153025025 30 ctime=1441974670.121024656 icedtea-web-1.5.3/tests/reproducers/simple/AppletBaseURLTest/testcases/0000775000076400007640000000000012574544466026773 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/AppletBaseURLTest/testcases/PaxHeaders.24993/AppletBaseUR0000644000000000000000000000013212574544466030124 xustar0030 mtime=1441974582.570016842 30 atime=1441974656.537868298 30 ctime=1441974670.121024656 icedtea-web-1.5.3/tests/reproducers/simple/AppletBaseURLTest/testcases/AppletBaseURLTest.java0000664000076400007640000000734412574544466033111 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/AppletBaseURLTest/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466024611 xustar0030 mtime=1441974582.569016831 30 atime=1441974670.153025025 30 ctime=1441974670.121024656 icedtea-web-1.5.3/tests/reproducers/simple/AppletBaseURLTest/srcs/0000775000076400007640000000000012574544466025747 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/AppletBaseURLTest/srcs/PaxHeaders.24993/AppletBaseURL.jav0000644000000000000000000000013212574544466027773 xustar0030 mtime=1441974582.569016831 30 atime=1441974656.537868298 30 ctime=1441974670.121024656 icedtea-web-1.5.3/tests/reproducers/simple/AppletBaseURLTest/srcs/AppletBaseURL.java0000664000076400007640000000404712574544466031222 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/AppletBaseURLTest/PaxHeaders.24993/resources0000644000000000000000000000013212574544466025651 xustar0030 mtime=1441974582.569016831 30 atime=1441974670.153025025 30 ctime=1441974670.120024645 icedtea-web-1.5.3/tests/reproducers/simple/AppletBaseURLTest/resources/0000775000076400007640000000000012574544466027007 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/AppletBaseURLTest/resources/PaxHeaders.24993/AppletJNLPHr0000644000000000000000000000031112574544466030053 xustar00111 path=icedtea-web-1.5.3/tests/reproducers/simple/AppletBaseURLTest/resources/AppletJNLPHrefBaseURLTest.html 30 mtime=1441974582.569016831 30 atime=1441974656.537868298 30 ctime=1441974670.120024645 icedtea-web-1.5.3/tests/reproducers/simple/AppletBaseURLTest/resources/AppletJNLPHrefBaseURLTest.htm0000664000076400007640000000344712574544466034265 0ustar00jvanekjvanek00000000000000 icedtea-web-1.5.3/tests/reproducers/simple/AppletBaseURLTest/resources/PaxHeaders.24993/AppletBaseUR0000644000000000000000000000013212574544466030140 xustar0030 mtime=1441974582.569016831 30 atime=1441974656.536868287 30 ctime=1441974670.120024645 icedtea-web-1.5.3/tests/reproducers/simple/AppletBaseURLTest/resources/AppletBaseURLTest.jnlp0000664000076400007640000000435112574544466033142 0ustar00jvanekjvanek00000000000000 AppletBaseURL IcedTea AppletBaseURL icedtea-web-1.5.3/tests/reproducers/simple/AppletBaseURLTest/resources/PaxHeaders.24993/AppletBaseUR0000644000000000000000000000013212574544466030140 xustar0030 mtime=1441974582.568016819 30 atime=1441974656.536868287 30 ctime=1441974670.120024645 icedtea-web-1.5.3/tests/reproducers/simple/AppletBaseURLTest/resources/AppletBaseURLTest.html0000664000076400007640000000350612574544466033144 0ustar00jvanekjvanek00000000000000 icedtea-web-1.5.3/tests/reproducers/simple/PaxHeaders.24993/AllStackTraces0000644000000000000000000000013212574544466023234 xustar0030 mtime=1441974582.568016819 30 atime=1441974670.153025025 30 ctime=1441974670.120024645 icedtea-web-1.5.3/tests/reproducers/simple/AllStackTraces/0000775000076400007640000000000012574544466024372 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/AllStackTraces/PaxHeaders.24993/testcases0000644000000000000000000000013212574544466025232 xustar0030 mtime=1441974582.568016819 30 atime=1441974670.153025025 30 ctime=1441974670.120024645 icedtea-web-1.5.3/tests/reproducers/simple/AllStackTraces/testcases/0000775000076400007640000000000012574544466026370 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/AllStackTraces/testcases/PaxHeaders.24993/AllStackTracesT0000644000000000000000000000013212574544466030216 xustar0030 mtime=1441974582.568016819 30 atime=1441974656.536868287 30 ctime=1441974670.120024645 icedtea-web-1.5.3/tests/reproducers/simple/AllStackTraces/testcases/AllStackTracesTest.java0000664000076400007640000000503512574544466032736 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/AllStackTraces/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466024206 xustar0030 mtime=1441974582.568016819 30 atime=1441974670.153025025 30 ctime=1441974670.120024645 icedtea-web-1.5.3/tests/reproducers/simple/AllStackTraces/srcs/0000775000076400007640000000000012574544466025344 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/AllStackTraces/srcs/PaxHeaders.24993/AllStackTraces.java0000644000000000000000000000013212574544466027766 xustar0030 mtime=1441974582.568016819 30 atime=1441974656.536868287 30 ctime=1441974670.120024645 icedtea-web-1.5.3/tests/reproducers/simple/AllStackTraces/srcs/AllStackTraces.java0000664000076400007640000000334712574544466031056 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/AllStackTraces/PaxHeaders.24993/resources0000644000000000000000000000013212574544466025246 xustar0030 mtime=1441974582.567016808 30 atime=1441974670.153025025 30 ctime=1441974670.120024645 icedtea-web-1.5.3/tests/reproducers/simple/AllStackTraces/resources/0000775000076400007640000000000012574544466026404 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/AllStackTraces/resources/PaxHeaders.24993/AllStackTraces.0000644000000000000000000000013212574544466030164 xustar0030 mtime=1441974582.567016808 30 atime=1441974656.535868275 30 ctime=1441974670.120024645 icedtea-web-1.5.3/tests/reproducers/simple/AllStackTraces/resources/AllStackTraces.jnlp0000664000076400007640000000060612574544466032133 0ustar00jvanekjvanek00000000000000 Test Thread.getAllStackTraces IcedTea icedtea-web-1.5.3/tests/reproducers/simple/PaxHeaders.24993/AddShutdownHook0000644000000000000000000000013212574544466023441 xustar0030 mtime=1441974582.567016808 30 atime=1441974670.153025025 30 ctime=1441974670.120024645 icedtea-web-1.5.3/tests/reproducers/simple/AddShutdownHook/0000775000076400007640000000000012574544466024577 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/AddShutdownHook/PaxHeaders.24993/testcases0000644000000000000000000000013212574544466025437 xustar0030 mtime=1441974582.567016808 30 atime=1441974670.153025025 30 ctime=1441974670.120024645 icedtea-web-1.5.3/tests/reproducers/simple/AddShutdownHook/testcases/0000775000076400007640000000000012574544466026575 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/AddShutdownHook/testcases/PaxHeaders.24993/HangFirefoxTes0000644000000000000000000000013212574544466030313 xustar0030 mtime=1441974582.567016808 30 atime=1441974656.535868275 30 ctime=1441974670.120024645 icedtea-web-1.5.3/tests/reproducers/simple/AddShutdownHook/testcases/HangFirefoxTests.java0000664000076400007640000001325112574544466032665 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/AddShutdownHook/testcases/PaxHeaders.24993/AddShutdownHoo0000644000000000000000000000013212574544466030331 xustar0030 mtime=1441974582.567016808 30 atime=1441974656.535868275 30 ctime=1441974670.120024645 icedtea-web-1.5.3/tests/reproducers/simple/AddShutdownHook/testcases/AddShutdownHookTest.java0000664000076400007640000001013312574544466033343 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/AddShutdownHook/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466024413 xustar0030 mtime=1441974582.566016796 30 atime=1441974670.153025025 30 ctime=1441974670.120024645 icedtea-web-1.5.3/tests/reproducers/simple/AddShutdownHook/srcs/0000775000076400007640000000000012574544466025551 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/AddShutdownHook/srcs/PaxHeaders.24993/AddShutdownHook.jav0000644000000000000000000000013212574544466030237 xustar0030 mtime=1441974582.566016796 30 atime=1441974656.535868275 30 ctime=1441974670.120024645 icedtea-web-1.5.3/tests/reproducers/simple/AddShutdownHook/srcs/AddShutdownHook.java0000664000076400007640000000405412574544466031464 0ustar00jvanekjvanek00000000000000 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.5.3/tests/reproducers/simple/AddShutdownHook/PaxHeaders.24993/resources0000644000000000000000000000013212574544466025453 xustar0030 mtime=1441974582.566016796 30 atime=1441974670.153025025 30 ctime=1441974670.120024645 icedtea-web-1.5.3/tests/reproducers/simple/AddShutdownHook/resources/0000775000076400007640000000000012574544466026611 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/AddShutdownHook/resources/PaxHeaders.24993/AddShutdownHoo0000644000000000000000000000013212574544466030345 xustar0030 mtime=1441974582.566016796 30 atime=1441974656.534868264 30 ctime=1441974670.120024645 icedtea-web-1.5.3/tests/reproducers/simple/AddShutdownHook/resources/AddShutdownHook_wrong.html0000664000076400007640000000343612574544466033766 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/simple/AddShutdownHook/resources/PaxHeaders.24993/AddShutdownHoo0000644000000000000000000000013212574544466030345 xustar0030 mtime=1441974582.566016796 30 atime=1441974656.534868264 30 ctime=1441974670.120024645 icedtea-web-1.5.3/tests/reproducers/simple/AddShutdownHook/resources/AddShutdownHook.jnlp0000664000076400007640000000060612574544466032545 0ustar00jvanekjvanek00000000000000 test adding shutdown hooks IcedTea icedtea-web-1.5.3/tests/reproducers/simple/AddShutdownHook/resources/PaxHeaders.24993/AddShutdownHoo0000644000000000000000000000013212574544466030345 xustar0030 mtime=1441974582.565016785 30 atime=1441974656.534868264 30 ctime=1441974670.120024645 icedtea-web-1.5.3/tests/reproducers/simple/AddShutdownHook/resources/AddShutdownHook.html0000664000076400007640000000343312574544466032547 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/simple/PaxHeaders.24993/AccessClassInPackage0000644000000000000000000000013212574544466024326 xustar0030 mtime=1441974582.565016785 30 atime=1441974670.153025025 30 ctime=1441974670.120024645 icedtea-web-1.5.3/tests/reproducers/simple/AccessClassInPackage/0000775000076400007640000000000012574544466025464 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/AccessClassInPackage/PaxHeaders.24993/testcases0000644000000000000000000000013212574544466026324 xustar0030 mtime=1441974582.565016785 30 atime=1441974670.153025025 30 ctime=1441974670.120024645 icedtea-web-1.5.3/tests/reproducers/simple/AccessClassInPackage/testcases/0000775000076400007640000000000012574544466027462 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/AccessClassInPackage/testcases/PaxHeaders.24993/AccessCla0000644000000000000000000000031312574544466030146 xustar00113 path=icedtea-web-1.5.3/tests/reproducers/simple/AccessClassInPackage/testcases/AccessClassInPackageTest.java 30 mtime=1441974582.565016785 30 atime=1441974656.534868264 30 ctime=1441974670.120024645 icedtea-web-1.5.3/tests/reproducers/simple/AccessClassInPackage/testcases/AccessClassInPackageTest.j0000664000076400007640000001477212574544466034442 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/AccessClassInPackage/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466025300 xustar0030 mtime=1441974582.565016785 30 atime=1441974670.153025025 30 ctime=1441974670.120024645 icedtea-web-1.5.3/tests/reproducers/simple/AccessClassInPackage/srcs/0000775000076400007640000000000012574544466026436 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/AccessClassInPackage/srcs/PaxHeaders.24993/AccessClassInP0000644000000000000000000000013212574544466030076 xustar0030 mtime=1441974582.565016785 30 atime=1441974656.533868252 30 ctime=1441974670.120024645 icedtea-web-1.5.3/tests/reproducers/simple/AccessClassInPackage/srcs/AccessClassInPackage.java0000664000076400007640000000350112574544466033232 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/AccessClassInPackage/PaxHeaders.24993/resources0000644000000000000000000000013212574544466026340 xustar0030 mtime=1441974582.564016773 30 atime=1441974670.153025025 30 ctime=1441974670.120024645 icedtea-web-1.5.3/tests/reproducers/simple/AccessClassInPackage/resources/0000775000076400007640000000000012574544466027476 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/AccessClassInPackage/resources/PaxHeaders.24993/AccessCla0000644000000000000000000000031512574544466030164 xustar00115 path=icedtea-web-1.5.3/tests/reproducers/simple/AccessClassInPackage/resources/AccessClassInPackageSUNSEC.jnlp 30 mtime=1441974582.564016773 30 atime=1441974656.533868252 30 ctime=1441974670.120024645 icedtea-web-1.5.3/tests/reproducers/simple/AccessClassInPackage/resources/AccessClassInPackageSUNSEC0000664000076400007640000000436012574544466034277 0ustar00jvanekjvanek00000000000000 Test accessClassInPackage IcedTea testing access to sun.security.* package sun.security.internal.spec.TlsKeyMaterialSpec icedtea-web-1.5.3/tests/reproducers/simple/AccessClassInPackage/resources/PaxHeaders.24993/AccessCla0000644000000000000000000000031312574544466030162 xustar00113 path=icedtea-web-1.5.3/tests/reproducers/simple/AccessClassInPackage/resources/AccessClassInPackageSELF.jnlp 30 mtime=1441974582.564016773 30 atime=1441974656.533868252 30 ctime=1441974670.120024645 icedtea-web-1.5.3/tests/reproducers/simple/AccessClassInPackage/resources/AccessClassInPackageSELF.j0000664000076400007640000000433212574544466034257 0ustar00jvanekjvanek00000000000000 Test accessClassInPackage IcedTea testing aaccess to package's internal class AccessClassInPackage icedtea-web-1.5.3/tests/reproducers/simple/AccessClassInPackage/resources/PaxHeaders.24993/AccessCla0000644000000000000000000000031412574544466030163 xustar00114 path=icedtea-web-1.5.3/tests/reproducers/simple/AccessClassInPackage/resources/AccessClassInPackageNETSF.jnlp 30 mtime=1441974582.564016773 30 atime=1441974656.533868252 30 ctime=1441974670.120024645 icedtea-web-1.5.3/tests/reproducers/simple/AccessClassInPackage/resources/AccessClassInPackageNETSF.0000664000076400007640000000434212574544466034234 0ustar00jvanekjvanek00000000000000 Test accessClassInPackage IcedTea testing access to net.sourceforge.* package net.sourceforge.jnlp.Parser icedtea-web-1.5.3/tests/reproducers/simple/AccessClassInPackage/resources/PaxHeaders.24993/AccessCla0000644000000000000000000000032012574544466030160 xustar00118 path=icedtea-web-1.5.3/tests/reproducers/simple/AccessClassInPackage/resources/AccessClassInPackageJAVAXJNLP.jnlp 30 mtime=1441974582.563016762 30 atime=1441974656.532868241 30 ctime=1441974670.120024645 icedtea-web-1.5.3/tests/reproducers/simple/AccessClassInPackage/resources/AccessClassInPackageJAVAXJ0000664000076400007640000000434412574544466034264 0ustar00jvanekjvanek00000000000000 Test accessClassInPackage IcedTea testing access to some javax.jnlp.* package javax.jnlp.ServiceManager icedtea-web-1.5.3/tests/reproducers/simple/PaxHeaders.24993/AbsolutePathsAndQueryStrings0000644000000000000000000000013212574544466026175 xustar0030 mtime=1441974582.563016762 30 atime=1441974670.153025025 30 ctime=1441974670.120024645 icedtea-web-1.5.3/tests/reproducers/simple/AbsolutePathsAndQueryStrings/0000775000076400007640000000000012574544466027333 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/AbsolutePathsAndQueryStrings/PaxHeaders.24993/testcases0000644000000000000000000000013212574544466030173 xustar0030 mtime=1441974582.563016762 30 atime=1441974670.153025025 30 ctime=1441974670.120024645 icedtea-web-1.5.3/tests/reproducers/simple/AbsolutePathsAndQueryStrings/testcases/0000775000076400007640000000000012574544466031331 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/AbsolutePathsAndQueryStrings/testcases/PaxHeaders.24993/A0000644000000000000000000000032712574544466030361 xustar00125 path=icedtea-web-1.5.3/tests/reproducers/simple/AbsolutePathsAndQueryStrings/testcases/AbsolutePathsAndQueryStrings.java 30 mtime=1441974582.563016762 30 atime=1441974656.532868241 30 ctime=1441974670.120024645 icedtea-web-1.5.3/tests/reproducers/simple/AbsolutePathsAndQueryStrings/testcases/AbsolutePathsAndQu0000664000076400007640000001214012574544466034761 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/simple/AbsolutePathsAndQueryStrings/PaxHeaders.24993/resources0000644000000000000000000000013212574544466030207 xustar0030 mtime=1441974582.563016762 30 atime=1441974670.153025025 30 ctime=1441974670.120024645 icedtea-web-1.5.3/tests/reproducers/simple/AbsolutePathsAndQueryStrings/resources/0000775000076400007640000000000012574544466031345 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/AbsolutePathsAndQueryStrings/resources/PaxHeaders.24993/A0000644000000000000000000000032712574544466030375 xustar00125 path=icedtea-web-1.5.3/tests/reproducers/simple/AbsolutePathsAndQueryStrings/resources/AbsolutePathsAndQueryStrings.jnlp 30 mtime=1441974582.563016762 30 atime=1441974656.532868241 30 ctime=1441974670.120024645 icedtea-web-1.5.3/tests/reproducers/simple/AbsolutePathsAndQueryStrings/resources/AbsolutePathsAndQu0000664000076400007640000000434412574544466035004 0ustar00jvanekjvanek00000000000000 AbsolutePathsAndQueryStrings IcedTea Use relative codebase URLs to append to host names, and correctly parse query strings icedtea-web-1.5.3/tests/reproducers/simple/AbsolutePathsAndQueryStrings/resources/PaxHeaders.24993/A0000644000000000000000000000032612574544466030374 xustar00125 path=icedtea-web-1.5.3/tests/reproducers/simple/AbsolutePathsAndQueryStrings/resources/AbsolutePathsAndQueryStrings.html 29 mtime=1441974582.56201675 30 atime=1441974656.532868241 30 ctime=1441974670.120024645 icedtea-web-1.5.3/tests/reproducers/simple/AbsolutePathsAndQueryStrings/resources/AbsolutePathsAndQu0000664000076400007640000000356212574544466035005 0ustar00jvanekjvanek00000000000000 icedtea-web-1.5.3/tests/reproducers/simple/PaxHeaders.24993/AWTCommonResourcesOnly0000644000000000000000000000013112574544466024734 xustar0029 mtime=1441974582.56201675 30 atime=1441974670.153025025 30 ctime=1441974670.120024645 icedtea-web-1.5.3/tests/reproducers/simple/AWTCommonResourcesOnly/0000775000076400007640000000000012574544466026073 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/AWTCommonResourcesOnly/PaxHeaders.24993/resources0000644000000000000000000000013112574544466026746 xustar0029 mtime=1441974582.56201675 30 atime=1441974670.153025025 30 ctime=1441974670.120024645 icedtea-web-1.5.3/tests/reproducers/simple/AWTCommonResourcesOnly/resources/0000775000076400007640000000000012574544466030105 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/simple/AWTCommonResourcesOnly/resources/PaxHeaders.24993/marker.0000644000000000000000000000013112574544466030305 xustar0029 mtime=1441974582.56201675 30 atime=1441974656.531868229 30 ctime=1441974670.120024645 icedtea-web-1.5.3/tests/reproducers/simple/AWTCommonResourcesOnly/resources/marker.png0000664000076400007640000000026412574544466032076 0ustar00jvanekjvanek00000000000000‰PNG  IHDR D¤ŠÆPLTE$$$ÿmmm¶¶¶ÿÿÿÿÿÿÿjΰjTIDAT8Ëå“1À B]þÿâ.©Z¤³sóŃ#bŠæ~šñgÀ •²™54=à 6lQÙ3šF¡e¸¾BÍq ¼BùCkÓsã5Ü”i +RµãIEND®B`‚icedtea-web-1.5.3/tests/reproducers/PaxHeaders.24993/signed20000644000000000000000000000013212574544466020436 xustar0030 mtime=1441974582.560016727 30 atime=1441974670.153025025 30 ctime=1441974670.119024633 icedtea-web-1.5.3/tests/reproducers/signed2/0000775000076400007640000000000012574544466021574 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed2/PaxHeaders.24993/MultipleSignaturesTestSamePackage0000644000000000000000000000013112574544466027217 xustar0029 mtime=1441974582.56201675 30 atime=1441974670.153025025 30 ctime=1441974670.119024633 icedtea-web-1.5.3/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/0000775000076400007640000000000012574544466030356 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/PaxHeaders.24993/testc0000644000000000000000000000013112574544466030341 xustar0029 mtime=1441974582.56201675 30 atime=1441974670.153025025 30 ctime=1441974670.119024633 icedtea-web-1.5.3/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/testcases/0000775000076400007640000000000012574544466032354 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/testcases/PaxHeaders.20000644000000000000000000000034612574544466030674 xustar00141 path=icedtea-web-1.5.3/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/testcases/MultipleSignaturesTestTestsSamePackage.java 29 mtime=1441974582.56201675 30 atime=1441974656.531868229 30 ctime=1441974670.119024633 icedtea-web-1.5.3/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/testcases/MultipleSign0000664000076400007640000001306712574544466034722 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466030172 xustar0030 mtime=1441974582.561016739 30 atime=1441974670.153025025 30 ctime=1441974670.119024633 icedtea-web-1.5.3/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/srcs/0000775000076400007640000000000012574544466031330 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/srcs/PaxHeaders.24993/0000644000000000000000000000033512574544466030256 xustar00131 path=icedtea-web-1.5.3/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/srcs/MultipleSignaturesTestSamePackage.java 30 mtime=1441974582.561016739 30 atime=1441974656.531868229 30 ctime=1441974670.119024633 icedtea-web-1.5.3/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/srcs/MultipleSignature0000664000076400007640000000612112574544466034730 0ustar00jvanekjvanek00000000000000import 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.5.3/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/PaxHeaders.24993/resou0000644000000000000000000000013212574544466030355 xustar0030 mtime=1441974582.561016739 30 atime=1441974670.153025025 30 ctime=1441974670.119024633 icedtea-web-1.5.3/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/0000775000076400007640000000000012574544466032370 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/PaxHeaders.20000644000000000000000000000034312574544466030705 xustar00137 path=icedtea-web-1.5.3/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/MultipleSignaturesTest_SamePackage.html 30 mtime=1441974582.561016739 30 atime=1441974656.531868229 30 ctime=1441974670.119024633 icedtea-web-1.5.3/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/MultipleSign0000664000076400007640000000351712574544466034735 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/PaxHeaders.20000644000000000000000000000034412574544466030706 xustar00138 path=icedtea-web-1.5.3/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/MultipleSignaturesTest2_SamePackage.jnlp 30 mtime=1441974582.561016739 30 atime=1441974656.530868218 30 ctime=1441974670.119024633 icedtea-web-1.5.3/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/MultipleSign0000664000076400007640000000461412574544466034734 0ustar00jvanekjvanek00000000000000 MultipleSignaturesTest2_SamePackage IcedTea MultipleSignaturesTest2_SamePackage icedtea-web-1.5.3/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/PaxHeaders.20000644000000000000000000000035712574544466030712 xustar00149 path=icedtea-web-1.5.3/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/MultipleSignaturesTest1_SamePackage_requesting.jnlp 30 mtime=1441974582.560016727 30 atime=1441974656.530868218 30 ctime=1441974670.119024633 icedtea-web-1.5.3/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/MultipleSign0000664000076400007640000000446512574544466034740 0ustar00jvanekjvanek00000000000000 MultipleSignaturesTest1_SamePackage IcedTea MultipleSignaturesTest1_SamePackage icedtea-web-1.5.3/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/PaxHeaders.20000644000000000000000000000034412574544466030706 xustar00138 path=icedtea-web-1.5.3/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/MultipleSignaturesTest1_SamePackage.jnlp 30 mtime=1441974582.560016727 30 atime=1441974656.530868218 30 ctime=1441974670.119024633 icedtea-web-1.5.3/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/MultipleSign0000664000076400007640000000437012574544466034733 0ustar00jvanekjvanek00000000000000 MultipleSignaturesTest1_SamePackage IcedTea MultipleSignaturesTest1_SamePackage icedtea-web-1.5.3/tests/reproducers/signed2/PaxHeaders.24993/MultipleSignaturesTest0000644000000000000000000000013212574544466025136 xustar0030 mtime=1441974582.560016727 30 atime=1441974670.153025025 30 ctime=1441974670.119024633 icedtea-web-1.5.3/tests/reproducers/signed2/MultipleSignaturesTest/0000775000076400007640000000000012574544466026274 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed2/MultipleSignaturesTest/PaxHeaders.24993/testcases0000644000000000000000000000013212574544466027134 xustar0030 mtime=1441974582.560016727 30 atime=1441974670.153025025 30 ctime=1441974670.119024633 icedtea-web-1.5.3/tests/reproducers/signed2/MultipleSignaturesTest/testcases/0000775000076400007640000000000012574544466030272 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed2/MultipleSignaturesTest/testcases/PaxHeaders.24993/Multip0000644000000000000000000000032112574544466030406 xustar00119 path=icedtea-web-1.5.3/tests/reproducers/signed2/MultipleSignaturesTest/testcases/MultipleSignaturesTestTests.java 30 mtime=1441974582.560016727 30 atime=1441974656.530868218 30 ctime=1441974670.119024633 icedtea-web-1.5.3/tests/reproducers/signed2/MultipleSignaturesTest/testcases/MultipleSignaturesTestT0000664000076400007640000001162712574544466035050 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/signed2/MultipleSignaturesTest/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466026110 xustar0030 mtime=1441974582.559016716 30 atime=1441974670.153025025 30 ctime=1441974670.119024633 icedtea-web-1.5.3/tests/reproducers/signed2/MultipleSignaturesTest/srcs/0000775000076400007640000000000012574544466027246 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed2/MultipleSignaturesTest/srcs/PaxHeaders.24993/somecrazyte0000644000000000000000000000013212574544466030455 xustar0030 mtime=1441974582.559016716 30 atime=1441974670.153025025 30 ctime=1441974670.119024633 icedtea-web-1.5.3/tests/reproducers/signed2/MultipleSignaturesTest/srcs/somecrazytestpackage/0000775000076400007640000000000012574544466033476 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed2/MultipleSignaturesTest/srcs/somecrazytestpackage/PaxHead0000644000000000000000000000033412574544466031141 xustar00130 path=icedtea-web-1.5.3/tests/reproducers/signed2/MultipleSignaturesTest/srcs/somecrazytestpackage/MultipleSignaturesTest.java 30 mtime=1441974582.559016716 30 atime=1441974656.529868206 30 ctime=1441974670.119024633 icedtea-web-1.5.3/tests/reproducers/signed2/MultipleSignaturesTest/srcs/somecrazytestpackage/Multipl0000664000076400007640000000657712574544466035066 0ustar00jvanekjvanek00000000000000package 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.5.3/tests/reproducers/signed2/MultipleSignaturesTest/PaxHeaders.24993/resources0000644000000000000000000000013212574544466027150 xustar0030 mtime=1441974582.559016716 30 atime=1441974670.153025025 30 ctime=1441974670.119024633 icedtea-web-1.5.3/tests/reproducers/signed2/MultipleSignaturesTest/resources/0000775000076400007640000000000012574544466030306 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed2/MultipleSignaturesTest/resources/PaxHeaders.24993/Multip0000644000000000000000000000033312574544466030425 xustar00129 path=icedtea-web-1.5.3/tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTestUsesPermissions.html 30 mtime=1441974582.559016716 30 atime=1441974656.529868206 30 ctime=1441974670.119024633 icedtea-web-1.5.3/tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTestU0000664000076400007640000000361212574544466035060 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/signed2/MultipleSignaturesTest/resources/PaxHeaders.24993/Multip0000644000000000000000000000031512574544466030425 xustar00115 path=icedtea-web-1.5.3/tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest2.jnlp 30 mtime=1441974582.559016716 30 atime=1441974656.529868206 30 ctime=1441974670.119024633 icedtea-web-1.5.3/tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest20000664000076400007640000000462412574544466035021 0ustar00jvanekjvanek00000000000000 MultipleSignaturesTest2 IcedTea MultipleSignaturesTest2 icedtea-web-1.5.3/tests/reproducers/signed2/MultipleSignaturesTest/resources/PaxHeaders.24993/Multip0000644000000000000000000000033012574544466030422 xustar00126 path=icedtea-web-1.5.3/tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest1_requesting.jnlp 30 mtime=1441974582.558016704 30 atime=1441974656.529868206 30 ctime=1441974670.119024633 icedtea-web-1.5.3/tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest10000664000076400007640000000447412574544466035023 0ustar00jvanekjvanek00000000000000 MultipleSignaturesTest1 IcedTea MultipleSignaturesTest1 SimpletestSigned1 icedtea-web-1.5.3/tests/reproducers/signed2/MultipleSignaturesTest/resources/PaxHeaders.24993/Multip0000644000000000000000000000031512574544466030425 xustar00115 path=icedtea-web-1.5.3/tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest1.jnlp 30 mtime=1441974582.558016704 30 atime=1441974656.529868206 30 ctime=1441974670.119024633 icedtea-web-1.5.3/tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest10000664000076400007640000000437712574544466035025 0ustar00jvanekjvanek00000000000000 MultipleSignaturesTest1 IcedTea MultipleSignaturesTest1 SimpletestSigned1 icedtea-web-1.5.3/tests/reproducers/signed2/MultipleSignaturesTest/resources/PaxHeaders.24993/Multip0000644000000000000000000000031412574544466030424 xustar00114 path=icedtea-web-1.5.3/tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest.html 30 mtime=1441974582.558016704 30 atime=1441974656.528868195 30 ctime=1441974670.119024633 icedtea-web-1.5.3/tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest.0000664000076400007640000000360412574544466035012 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/signed2/PaxHeaders.24993/AppletTestSigned20000644000000000000000000000013212574544466023737 xustar0030 mtime=1441974582.557016693 30 atime=1441974670.153025025 30 ctime=1441974670.119024633 icedtea-web-1.5.3/tests/reproducers/signed2/AppletTestSigned2/0000775000076400007640000000000012574544466025075 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed2/AppletTestSigned2/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466024711 xustar0030 mtime=1441974582.557016693 30 atime=1441974670.153025025 30 ctime=1441974670.119024633 icedtea-web-1.5.3/tests/reproducers/signed2/AppletTestSigned2/srcs/0000775000076400007640000000000012574544466026047 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed2/AppletTestSigned2/srcs/PaxHeaders.24993/AppletTestSigned0000644000000000000000000000013212574544466030130 xustar0030 mtime=1441974582.557016693 30 atime=1441974656.528868195 30 ctime=1441974670.119024633 icedtea-web-1.5.3/tests/reproducers/signed2/AppletTestSigned2/srcs/AppletTestSigned2.java0000664000076400007640000000417312574544466032220 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/PaxHeaders.24993/signed0000644000000000000000000000013112574544466020353 xustar0029 mtime=1441974582.55501667 30 atime=1441974670.153025025 30 ctime=1441974670.119024633 icedtea-web-1.5.3/tests/reproducers/signed/0000775000076400007640000000000012574544466021512 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/PaxHeaders.24993/Spaces can be everywhere signed0000644000000000000000000000013212574544466026263 xustar0030 mtime=1441974582.557016693 30 atime=1441974670.153025025 30 ctime=1441974670.119024633 icedtea-web-1.5.3/tests/reproducers/signed/Spaces can be everywhere signed/0000775000076400007640000000000012574544466027421 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/Spaces can be everywhere signed/PaxHeaders.24993/testcase0000644000000000000000000000013212574544466030076 xustar0030 mtime=1441974582.557016693 30 atime=1441974670.153025025 30 ctime=1441974670.119024633 icedtea-web-1.5.3/tests/reproducers/signed/Spaces can be everywhere signed/testcases/0000775000076400007640000000000012574544466031417 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/Spaces can be everywhere signed/testcases/PaxHeaders.24990000644000000000000000000000033612574544466030204 xustar00132 path=icedtea-web-1.5.3/tests/reproducers/signed/Spaces can be everywhere signed/testcases/SpacesCanBeEverywhereTestsSigned.java 30 mtime=1441974582.557016693 30 atime=1441974656.528868195 30 ctime=1441974670.119024633 icedtea-web-1.5.3/tests/reproducers/signed/Spaces can be everywhere signed/testcases/SpacesCanBeEver0000664000076400007640000003075412574544466034304 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/signed/Spaces can be everywhere signed/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466027235 xustar0030 mtime=1441974582.556016681 30 atime=1441974670.153025025 30 ctime=1441974670.119024633 icedtea-web-1.5.3/tests/reproducers/signed/Spaces can be everywhere signed/srcs/0000775000076400007640000000000012574544466030373 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/Spaces can be everywhere signed/srcs/PaxHeaders.24993/Spa0000644000000000000000000000032412574544466027763 xustar00122 path=icedtea-web-1.5.3/tests/reproducers/signed/Spaces can be everywhere signed/srcs/SpacesCanBeEverywhereSigned.java 30 mtime=1441974582.557016693 30 atime=1441974656.528868195 30 ctime=1441974670.119024633 icedtea-web-1.5.3/tests/reproducers/signed/Spaces can be everywhere signed/srcs/SpacesCanBeEverywher0000664000076400007640000000467712574544466034344 0ustar00jvanekjvanek00000000000000 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.5.3/tests/reproducers/signed/Spaces can be everywhere signed/PaxHeaders.24993/resource0000644000000000000000000000013212574544466030112 xustar0030 mtime=1441974582.556016681 30 atime=1441974670.153025025 30 ctime=1441974670.119024633 icedtea-web-1.5.3/tests/reproducers/signed/Spaces can be everywhere signed/resources/0000775000076400007640000000000012574544466031433 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/Spaces can be everywhere signed/resources/PaxHeaders.24990000644000000000000000000000033012574544466030212 xustar00126 path=icedtea-web-1.5.3/tests/reproducers/signed/Spaces can be everywhere signed/resources/spaces applet Tests signed.html 30 mtime=1441974582.556016681 30 atime=1441974656.527868183 30 ctime=1441974670.119024633 icedtea-web-1.5.3/tests/reproducers/signed/Spaces can be everywhere signed/resources/spaces applet T0000664000076400007640000000346312574544466034274 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/signed/Spaces can be everywhere signed/resources/PaxHeaders.24990000644000000000000000000000033212574544466030214 xustar00128 path=icedtea-web-1.5.3/tests/reproducers/signed/Spaces can be everywhere signed/resources/SpacesCanBeEverywhere1signed.jnlp 30 mtime=1441974582.556016681 30 atime=1441974656.527868183 30 ctime=1441974670.119024633 icedtea-web-1.5.3/tests/reproducers/signed/Spaces can be everywhere signed/resources/SpacesCanBeEver0000664000076400007640000000424512574544466034314 0ustar00jvanekjvanek00000000000000 Spaces can be everywhere signed IcedTea simpletest1 icedtea-web-1.5.3/tests/reproducers/signed/Spaces can be everywhere signed/resources/PaxHeaders.24990000644000000000000000000000033612574544466030220 xustar00132 path=icedtea-web-1.5.3/tests/reproducers/signed/Spaces can be everywhere signed/resources/Spaces can be everywhere2 signed.jnlp 30 mtime=1441974582.556016681 30 atime=1441974656.527868183 30 ctime=1441974670.119024633 icedtea-web-1.5.3/tests/reproducers/signed/Spaces can be everywhere signed/resources/Spaces can be e0000664000076400007640000000427012574544466034075 0ustar00jvanekjvanek00000000000000 Spaces can be everywhere2 IcedTea Spaces can be everywhere2 signed icedtea-web-1.5.3/tests/reproducers/signed/Spaces can be everywhere signed/resources/PaxHeaders.24990000644000000000000000000000033512574544466030217 xustar00132 path=icedtea-web-1.5.3/tests/reproducers/signed/Spaces can be everywhere signed/resources/Spaces can be everywhere1 signed.jnlp 29 mtime=1441974582.55501667 30 atime=1441974656.527868183 30 ctime=1441974670.119024633 icedtea-web-1.5.3/tests/reproducers/signed/Spaces can be everywhere signed/resources/Spaces can be e0000664000076400007640000000424712574544466034101 0ustar00jvanekjvanek00000000000000 Spaces can be everywhere1 signed IcedTea Spaces can be everywhere1 signed icedtea-web-1.5.3/tests/reproducers/signed/Spaces can be everywhere signed/resources/PaxHeaders.24990000644000000000000000000000035212574544466030216 xustar00145 path=icedtea-web-1.5.3/tests/reproducers/signed/Spaces can be everywhere signed/resources/NotOnly spaces can kill ěšÄřž too signed.jnlp 29 mtime=1441974582.55501667 30 atime=1441974656.526868172 30 ctime=1441974670.119024633 icedtea-web-1.5.3/tests/reproducers/signed/Spaces can be everywhere signed/resources/NotOnly spaces 0000664000076400007640000000456512574544466034271 0ustar00jvanekjvanek00000000000000 Spaces can be everywhere test with few more chars for encoding signed IcedTea AppletTest icedtea-web-1.5.3/tests/reproducers/signed/PaxHeaders.24993/SimpletestSigned10000644000000000000000000000013112574544466023717 xustar0029 mtime=1441974582.55501667 30 atime=1441974670.153025025 30 ctime=1441974670.119024633 icedtea-web-1.5.3/tests/reproducers/signed/SimpletestSigned1/0000775000076400007640000000000012574544466025056 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/SimpletestSigned1/PaxHeaders.24993/srcs0000644000000000000000000000013112574544466024671 xustar0029 mtime=1441974582.55501667 30 atime=1441974670.153025025 30 ctime=1441974670.119024633 icedtea-web-1.5.3/tests/reproducers/signed/SimpletestSigned1/srcs/0000775000076400007640000000000012574544466026030 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/SimpletestSigned1/srcs/PaxHeaders.24993/SimpletestSigned10000644000000000000000000000013112574544466030235 xustar0029 mtime=1441974582.55501667 30 atime=1441974656.526868172 30 ctime=1441974670.119024633 icedtea-web-1.5.3/tests/reproducers/signed/SimpletestSigned1/srcs/SimpletestSigned1.java0000664000076400007640000000337612574544466032250 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/signed/SimpletestSigned1/PaxHeaders.24993/resources0000644000000000000000000000013212574544466025732 xustar0030 mtime=1441974582.554016658 30 atime=1441974670.153025025 30 ctime=1441974670.119024633 icedtea-web-1.5.3/tests/reproducers/signed/SimpletestSigned1/resources/0000775000076400007640000000000012574544466027070 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/SimpletestSigned1/resources/PaxHeaders.24993/SimpletestSi0000644000000000000000000000013212574544466030357 xustar0030 mtime=1441974582.554016658 30 atime=1441974656.526868172 30 ctime=1441974670.119024633 icedtea-web-1.5.3/tests/reproducers/signed/SimpletestSigned1/resources/SimpletestSigned1.jnlp0000664000076400007640000000415612574544466033327 0ustar00jvanekjvanek00000000000000 simpletest1 IcedTea simpletest1 icedtea-web-1.5.3/tests/reproducers/signed/PaxHeaders.24993/SignedJnlpTemplate0000644000000000000000000000013212574544466024105 xustar0030 mtime=1441974582.554016658 30 atime=1441974670.153025025 30 ctime=1441974670.118024622 icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpTemplate/0000775000076400007640000000000012574544466025243 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpTemplate/PaxHeaders.24993/testcases0000644000000000000000000000013212574544466026103 xustar0030 mtime=1441974582.554016658 30 atime=1441974670.153025025 30 ctime=1441974670.118024622 icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpTemplate/testcases/0000775000076400007640000000000012574544466027241 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpTemplate/testcases/PaxHeaders.24993/SignedJnlpT0000644000000000000000000000013112574544466030263 xustar0030 mtime=1441974582.554016658 29 atime=1441974656.52586816 30 ctime=1441974670.118024622 icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpTemplate/testcases/SignedJnlpTemplateTest.java0000664000076400007640000000665112574544466034505 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/signed/SignedJnlpTemplate/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466025057 xustar0030 mtime=1441974582.554016658 30 atime=1441974670.153025025 30 ctime=1441974670.118024622 icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpTemplate/srcs/0000775000076400007640000000000012574544466026215 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpTemplate/srcs/PaxHeaders.24993/SignedJnlpTempla0000644000000000000000000000013112574544466030256 xustar0030 mtime=1441974582.554016658 29 atime=1441974656.52586816 30 ctime=1441974670.118024622 icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpTemplate/srcs/SignedJnlpTemplate.java0000664000076400007640000000341212574544466032611 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/signed/SignedJnlpTemplate/srcs/PaxHeaders.24993/JNLP-INF0000644000000000000000000000013212574544466026234 xustar0030 mtime=1441974582.553016647 30 atime=1441974670.153025025 30 ctime=1441974670.118024622 icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpTemplate/srcs/JNLP-INF/0000775000076400007640000000000012574544466027372 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpTemplate/srcs/JNLP-INF/PaxHeaders.24993/APPLICA0000644000000000000000000000031012574544466027303 xustar00111 path=icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpTemplate/srcs/JNLP-INF/APPLICATION_TEMPLATE.jnlp 30 mtime=1441974582.553016647 29 atime=1441974656.52586816 30 ctime=1441974670.118024622 icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpTemplate/srcs/JNLP-INF/APPLICATION_TEMPLATE.jnl0000664000076400007640000000432612574544466033142 0ustar00jvanekjvanek00000000000000 * IcedTea * icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpTemplate/PaxHeaders.24993/resources0000644000000000000000000000013212574544466026117 xustar0030 mtime=1441974582.553016647 30 atime=1441974670.153025025 30 ctime=1441974670.118024622 icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpTemplate/resources/0000775000076400007640000000000012574544466027255 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpTemplate/resources/PaxHeaders.24993/SignedJnlpT0000644000000000000000000000013112574544466030277 xustar0030 mtime=1441974582.553016647 29 atime=1441974656.52586816 30 ctime=1441974670.118024622 icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpTemplate/resources/SignedJnlpTemplate3.jnlp0000664000076400007640000000504712574544466033764 0ustar00jvanekjvanek00000000000000 SignedJnlpTemplate IcedTea SignedJnlpTemplate IcedTea-Web IcedTea icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpTemplate/resources/PaxHeaders.24993/SignedJnlpT0000644000000000000000000000013212574544466030300 xustar0030 mtime=1441974582.553016647 30 atime=1441974656.524868149 30 ctime=1441974670.118024622 icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpTemplate/resources/SignedJnlpTemplate2.jnlp0000664000076400007640000000467312574544466033767 0ustar00jvanekjvanek00000000000000 SignedJnlpTemplate IcedTea SignedJnlpTemplate icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpTemplate/resources/PaxHeaders.24993/SignedJnlpT0000644000000000000000000000013212574544466030300 xustar0030 mtime=1441974582.552016635 30 atime=1441974656.524868149 30 ctime=1441974670.118024622 icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpTemplate/resources/SignedJnlpTemplate1.jnlp0000664000076400007640000000464612574544466033766 0ustar00jvanekjvanek00000000000000 SignedJnlpTemplate IcedTea SignedJnlpTemplate icedtea-web-1.5.3/tests/reproducers/signed/PaxHeaders.24993/SignedJnlpResource0000644000000000000000000000013212574544466024121 xustar0030 mtime=1441974582.552016635 30 atime=1441974670.153025025 30 ctime=1441974670.118024622 icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpResource/0000775000076400007640000000000012574544466025257 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpResource/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466025073 xustar0030 mtime=1441974582.552016635 30 atime=1441974670.153025025 30 ctime=1441974670.118024622 icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpResource/srcs/0000775000076400007640000000000012574544466026231 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpResource/srcs/PaxHeaders.24993/SignedJnlpResour0000644000000000000000000000013212574544466030330 xustar0030 mtime=1441974582.552016635 30 atime=1441974656.524868149 30 ctime=1441974670.118024622 icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpResource/srcs/SignedJnlpResource.java0000664000076400007640000000340512574544466032643 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/signed/SignedJnlpResource/srcs/PaxHeaders.24993/JNLP-INF0000644000000000000000000000013212574544466026250 xustar0030 mtime=1441974582.552016635 30 atime=1441974670.153025025 30 ctime=1441974670.118024622 icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpResource/srcs/JNLP-INF/0000775000076400007640000000000012574544466027406 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpResource/srcs/JNLP-INF/PaxHeaders.24993/APPLICA0000644000000000000000000000031112574544466027320 xustar00111 path=icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpResource/srcs/JNLP-INF/APPLICATION_TEMPLATE.jnlp 30 mtime=1441974582.552016635 30 atime=1441974656.524868149 30 ctime=1441974670.118024622 icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpResource/srcs/JNLP-INF/APPLICATION_TEMPLATE.jnl0000664000076400007640000000405412574544466033154 0ustar00jvanekjvanek00000000000000 MATCHES SIGNED JNLP * MATCHES SIGNED JNLP icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpResource/PaxHeaders.24993/resources0000644000000000000000000000013212574544466026133 xustar0030 mtime=1441974582.551016624 30 atime=1441974670.153025025 30 ctime=1441974670.118024622 icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpResource/resources/0000775000076400007640000000000012574544466027271 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpResource/resources/PaxHeaders.24993/UnmatchingS0000644000000000000000000000031612574544466030357 xustar00116 path=icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpResource/resources/UnmatchingSignedJnlpExtension.jnlp 30 mtime=1441974582.551016624 30 atime=1441974656.523868137 30 ctime=1441974670.118024622 icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpResource/resources/UnmatchingSignedJnlpExtensio0000664000076400007640000000473112574544466035013 0ustar00jvanekjvanek00000000000000 UnmatchingSignedJnlpExtension IcedTea UnmatchingSignedJnlpExtension icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpResource/resources/PaxHeaders.24993/MatchingSig0000644000000000000000000000031412574544466030332 xustar00114 path=icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpResource/resources/MatchingSignedJnlpExtension.jnlp 30 mtime=1441974582.551016624 30 atime=1441974656.523868137 30 ctime=1441974670.118024622 icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpResource/resources/MatchingSignedJnlpExtension.0000664000076400007640000000461612574544466034706 0ustar00jvanekjvanek00000000000000 MATCHES SIGNED JNLP IcedTea MATCHES SIGNED JNLP icedtea-web-1.5.3/tests/reproducers/signed/PaxHeaders.24993/SignedJnlpCaseTestTwo0000644000000000000000000000013212574544466024537 xustar0030 mtime=1441974582.551016624 30 atime=1441974670.153025025 30 ctime=1441974670.118024622 icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpCaseTestTwo/0000775000076400007640000000000012574544466025675 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpCaseTestTwo/PaxHeaders.24993/testcases0000644000000000000000000000013212574544466026535 xustar0030 mtime=1441974582.551016624 30 atime=1441974670.153025025 30 ctime=1441974670.118024622 icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpCaseTestTwo/testcases/0000775000076400007640000000000012574544466027673 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpCaseTestTwo/testcases/PaxHeaders.24993/SignedJn0000644000000000000000000000031112574544466030235 xustar00111 path=icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpCaseTestTwo/testcases/SignedJnlpCaseTwoTest.java 30 mtime=1441974582.551016624 30 atime=1441974656.523868137 30 ctime=1441974670.118024622 icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpCaseTestTwo/testcases/SignedJnlpCaseTwoTest.jav0000664000076400007640000000557212574544466034571 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/signed/SignedJnlpCaseTestTwo/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466025511 xustar0030 mtime=1441974582.550016612 30 atime=1441974670.153025025 30 ctime=1441974670.118024622 icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpCaseTestTwo/srcs/0000775000076400007640000000000012574544466026647 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpCaseTestTwo/srcs/PaxHeaders.24993/SignedJnlpCas0000644000000000000000000000013212574544466030175 xustar0030 mtime=1441974582.550016612 30 atime=1441974656.523868137 30 ctime=1441974670.118024622 icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpCaseTestTwo/srcs/SignedJnlpCase.java0000664000076400007640000000340212574544466032342 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/signed/SignedJnlpCaseTestTwo/srcs/PaxHeaders.24993/JNLP-INF0000644000000000000000000000013212574544466026666 xustar0030 mtime=1441974582.550016612 30 atime=1441974670.153025025 30 ctime=1441974670.118024622 icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpCaseTestTwo/srcs/JNLP-INF/0000775000076400007640000000000012574544466030024 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpCaseTestTwo/srcs/JNLP-INF/PaxHeaders.24993/aPpL0000644000000000000000000000031412574544466027524 xustar00114 path=icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpCaseTestTwo/srcs/JNLP-INF/aPpLiCaTiOn_tEmPlAte.jnlp 30 mtime=1441974582.550016612 30 atime=1441974656.522868126 30 ctime=1441974670.118024622 icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpCaseTestTwo/srcs/JNLP-INF/aPpLiCaTiOn_tEmPlAte.0000664000076400007640000000430712574544466033627 0ustar00jvanekjvanek00000000000000 SignedJnlpCaseTest IcedTea SignedJnlpCaseTest icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpCaseTestTwo/PaxHeaders.24993/resources0000644000000000000000000000013212574544466026551 xustar0030 mtime=1441974582.550016612 30 atime=1441974670.153025025 30 ctime=1441974670.118024622 icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpCaseTestTwo/resources/0000775000076400007640000000000012574544466027707 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpCaseTestTwo/resources/PaxHeaders.24993/SignedJn0000644000000000000000000000031212574544466030252 xustar00112 path=icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpCaseTestTwo/resources/SignedJnlpCaseTestTwo2.jnlp 30 mtime=1441974582.550016612 30 atime=1441974656.522868126 30 ctime=1441974670.118024622 icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpCaseTestTwo/resources/SignedJnlpCaseTestTwo2.jn0000664000076400007640000000443012574544466034506 0ustar00jvanekjvanek00000000000000 SignedJnlpCaseTest 2 IcedTea SignedJnlpCaseTest 2 icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpCaseTestTwo/resources/PaxHeaders.24993/SignedJn0000644000000000000000000000031012574544466030250 xustar00112 path=icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpCaseTestTwo/resources/SignedJnlpCaseTestTwo1.jnlp 28 mtime=1441974582.5490166 30 atime=1441974656.522868126 30 ctime=1441974670.118024622 icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpCaseTestTwo/resources/SignedJnlpCaseTestTwo1.jn0000664000076400007640000000442412574544466034510 0ustar00jvanekjvanek00000000000000 SignedJnlpCaseTest IcedTea SignedJnlpCaseTest icedtea-web-1.5.3/tests/reproducers/signed/PaxHeaders.24993/SignedJnlpCaseTestOne0000644000000000000000000000013012574544466024505 xustar0028 mtime=1441974582.5490166 30 atime=1441974670.153025025 30 ctime=1441974670.118024622 icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpCaseTestOne/0000775000076400007640000000000012574544466025645 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpCaseTestOne/PaxHeaders.24993/testcases0000644000000000000000000000013012574544466026503 xustar0028 mtime=1441974582.5490166 30 atime=1441974670.153025025 30 ctime=1441974670.118024622 icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpCaseTestOne/testcases/0000775000076400007640000000000012574544466027643 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpCaseTestOne/testcases/PaxHeaders.24993/SignedJn0000644000000000000000000000030712574544466030212 xustar00111 path=icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpCaseTestOne/testcases/SignedJnlpCaseOneTest.java 28 mtime=1441974582.5490166 30 atime=1441974656.522868126 30 ctime=1441974670.118024622 icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpCaseTestOne/testcases/SignedJnlpCaseOneTest.jav0000664000076400007640000000557312574544466034512 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/signed/SignedJnlpCaseTestOne/PaxHeaders.24993/srcs0000644000000000000000000000013012574544466025457 xustar0028 mtime=1441974582.5490166 30 atime=1441974670.153025025 30 ctime=1441974670.118024622 icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpCaseTestOne/srcs/0000775000076400007640000000000012574544466026617 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpCaseTestOne/srcs/PaxHeaders.24993/SignedJnlpCas0000644000000000000000000000013012574544466030143 xustar0028 mtime=1441974582.5490166 30 atime=1441974656.521868114 30 ctime=1441974670.118024622 icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpCaseTestOne/srcs/SignedJnlpCase.java0000664000076400007640000000340212574544466032312 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/signed/SignedJnlpCaseTestOne/srcs/PaxHeaders.24993/JNLP-INF0000644000000000000000000000013212574544466026636 xustar0030 mtime=1441974582.548016589 30 atime=1441974670.153025025 30 ctime=1441974670.118024622 icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpCaseTestOne/srcs/JNLP-INF/0000775000076400007640000000000012574544466027774 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpCaseTestOne/srcs/JNLP-INF/PaxHeaders.24993/aPpL0000644000000000000000000000013212574544466027472 xustar0030 mtime=1441974582.548016589 30 atime=1441974656.521868114 30 ctime=1441974670.118024622 icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpCaseTestOne/srcs/JNLP-INF/aPpLiCaTioN.jnlp0000664000076400007640000000442412574544466032730 0ustar00jvanekjvanek00000000000000 SignedJnlpCaseTest IcedTea SignedJnlpCaseTest icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpCaseTestOne/PaxHeaders.24993/resources0000644000000000000000000000013212574544466026521 xustar0030 mtime=1441974582.548016589 30 atime=1441974670.153025025 30 ctime=1441974670.118024622 icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpCaseTestOne/resources/0000775000076400007640000000000012574544466027657 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpCaseTestOne/resources/PaxHeaders.24993/SignedJn0000644000000000000000000000031212574544466030222 xustar00112 path=icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpCaseTestOne/resources/SignedJnlpCaseTestOne2.jnlp 30 mtime=1441974582.548016589 30 atime=1441974656.521868114 30 ctime=1441974670.118024622 icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpCaseTestOne/resources/SignedJnlpCaseTestOne2.jn0000664000076400007640000000443012574544466034426 0ustar00jvanekjvanek00000000000000 SignedJnlpCaseTest 2 IcedTea SignedJnlpCaseTest 2 icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpCaseTestOne/resources/PaxHeaders.24993/SignedJn0000644000000000000000000000031212574544466030222 xustar00112 path=icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpCaseTestOne/resources/SignedJnlpCaseTestOne1.jnlp 30 mtime=1441974582.548016589 30 atime=1441974656.521868114 30 ctime=1441974670.118024622 icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpCaseTestOne/resources/SignedJnlpCaseTestOne1.jn0000664000076400007640000000442412574544466034430 0ustar00jvanekjvanek00000000000000 SignedJnlpCaseTest IcedTea SignedJnlpCaseTest icedtea-web-1.5.3/tests/reproducers/signed/PaxHeaders.24993/SignedJnlpApplication0000644000000000000000000000013212574544466024575 xustar0030 mtime=1441974582.547016577 30 atime=1441974670.153025025 30 ctime=1441974670.118024622 icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpApplication/0000775000076400007640000000000012574544466025733 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpApplication/PaxHeaders.24993/testcases0000644000000000000000000000013212574544466026573 xustar0030 mtime=1441974582.547016577 30 atime=1441974670.153025025 30 ctime=1441974670.118024622 icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpApplication/testcases/0000775000076400007640000000000012574544466027731 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpApplication/testcases/PaxHeaders.24993/SignedJn0000644000000000000000000000031512574544466030277 xustar00115 path=icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpApplication/testcases/SignedJnlpApplicationTest.java 30 mtime=1441974582.547016577 30 atime=1441974656.520868103 30 ctime=1441974670.118024622 icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpApplication/testcases/SignedJnlpApplicationTest0000664000076400007640000000673012574544466034743 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/signed/SignedJnlpApplication/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466025547 xustar0030 mtime=1441974582.547016577 30 atime=1441974670.153025025 30 ctime=1441974670.118024622 icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpApplication/srcs/0000775000076400007640000000000012574544466026705 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpApplication/srcs/PaxHeaders.24993/SignedJnlpApp0000644000000000000000000000013212574544466030245 xustar0030 mtime=1441974582.547016577 30 atime=1441974656.520868103 30 ctime=1441974670.118024622 icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpApplication/srcs/SignedJnlpApplication.java0000664000076400007640000000342012574544466033770 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/signed/SignedJnlpApplication/srcs/PaxHeaders.24993/JNLP-INF0000644000000000000000000000013212574544466026724 xustar0030 mtime=1441974582.547016577 30 atime=1441974670.153025025 30 ctime=1441974670.118024622 icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpApplication/srcs/JNLP-INF/0000775000076400007640000000000012574544466030062 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpApplication/srcs/JNLP-INF/PaxHeaders.24993/APPL0000644000000000000000000000013112574544466027457 xustar0030 mtime=1441974582.547016577 30 atime=1441974656.520868103 29 ctime=1441974670.11702461 icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpApplication/srcs/JNLP-INF/APPLICATION.jnlp0000664000076400007640000000444112574544466032515 0ustar00jvanekjvanek00000000000000 SignedJnlpApplication IcedTea SignedJnlpApplication icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpApplication/PaxHeaders.24993/resources0000644000000000000000000000013112574544466026606 xustar0030 mtime=1441974582.546016566 30 atime=1441974670.153025025 29 ctime=1441974670.11702461 icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpApplication/resources/0000775000076400007640000000000012574544466027745 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpApplication/resources/PaxHeaders.24993/SignedJn0000644000000000000000000000031112574544466030307 xustar00112 path=icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpApplication/resources/SignedJnlpApplication3.jnlp 30 mtime=1441974582.546016566 30 atime=1441974656.519868091 29 ctime=1441974670.11702461 icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpApplication/resources/SignedJnlpApplication3.jn0000664000076400007640000000457712574544466034617 0ustar00jvanekjvanek00000000000000 SignedJnlpApplication IcedTea SignedJnlpApplication icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpApplication/resources/PaxHeaders.24993/SignedJn0000644000000000000000000000031112574544466030307 xustar00112 path=icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpApplication/resources/SignedJnlpApplication2.jnlp 30 mtime=1441974582.546016566 30 atime=1441974656.519868091 29 ctime=1441974670.11702461 icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpApplication/resources/SignedJnlpApplication2.jn0000664000076400007640000000501212574544466034577 0ustar00jvanekjvanek00000000000000 SignedJnlpApplication IcedTea SignedJnlpApplication icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpApplication/resources/PaxHeaders.24993/SignedJn0000644000000000000000000000031112574544466030307 xustar00112 path=icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpApplication/resources/SignedJnlpApplication1.jnlp 30 mtime=1441974582.546016566 30 atime=1441974656.519868091 29 ctime=1441974670.11702461 icedtea-web-1.5.3/tests/reproducers/signed/SignedJnlpApplication/resources/SignedJnlpApplication1.jn0000664000076400007640000000444112574544466034603 0ustar00jvanekjvanek00000000000000 SignedJnlpApplication IcedTea SignedJnlpApplication icedtea-web-1.5.3/tests/reproducers/signed/PaxHeaders.24993/SignedJarResource0000644000000000000000000000013112574544466023731 xustar0030 mtime=1441974582.545016555 30 atime=1441974670.153025025 29 ctime=1441974670.11702461 icedtea-web-1.5.3/tests/reproducers/signed/SignedJarResource/0000775000076400007640000000000012574544466025070 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/SignedJarResource/PaxHeaders.24993/srcs0000644000000000000000000000013112574544466024703 xustar0030 mtime=1441974582.545016555 30 atime=1441974670.153025025 29 ctime=1441974670.11702461 icedtea-web-1.5.3/tests/reproducers/signed/SignedJarResource/srcs/0000775000076400007640000000000012574544466026042 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/SignedJarResource/srcs/PaxHeaders.24993/SignedJarResource0000644000000000000000000000013112574544466030261 xustar0030 mtime=1441974582.545016555 30 atime=1441974656.519868091 29 ctime=1441974670.11702461 icedtea-web-1.5.3/tests/reproducers/signed/SignedJarResource/srcs/SignedJarResource.java0000664000076400007640000000340012574544466032260 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/signed/SignedJarResource/PaxHeaders.24993/resources0000644000000000000000000000013112574544466025743 xustar0030 mtime=1441974582.545016555 30 atime=1441974670.153025025 29 ctime=1441974670.11702461 icedtea-web-1.5.3/tests/reproducers/signed/SignedJarResource/resources/0000775000076400007640000000000012574544466027102 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/SignedJarResource/resources/PaxHeaders.24993/SignedJarRes0000644000000000000000000000013012574544466030262 xustar0030 mtime=1441974582.545016555 29 atime=1441974656.51886808 29 ctime=1441974670.11702461 icedtea-web-1.5.3/tests/reproducers/signed/SignedJarResource/resources/SignedJarResource.jnlp0000664000076400007640000000456112574544466033353 0ustar00jvanekjvanek00000000000000 SignedJarResource IcedTea SignedJarResource icedtea-web-1.5.3/tests/reproducers/signed/SignedJarResource/resources/PaxHeaders.24993/SignedJarExt0000644000000000000000000000013012574544466030271 xustar0030 mtime=1441974582.545016555 29 atime=1441974656.51886808 29 ctime=1441974670.11702461 icedtea-web-1.5.3/tests/reproducers/signed/SignedJarResource/resources/SignedJarExtension.jnlp0000664000076400007640000000464512574544466033543 0ustar00jvanekjvanek00000000000000 SignedJarExtension IcedTea SignedJarExtension icedtea-web-1.5.3/tests/reproducers/signed/PaxHeaders.24993/SavingCookies0000644000000000000000000000013112574544466023117 xustar0030 mtime=1441974582.544016543 30 atime=1441974670.153025025 29 ctime=1441974670.11702461 icedtea-web-1.5.3/tests/reproducers/signed/SavingCookies/0000775000076400007640000000000012574544466024256 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/SavingCookies/PaxHeaders.24993/testcases0000644000000000000000000000013112574544466025115 xustar0030 mtime=1441974582.544016543 30 atime=1441974670.153025025 29 ctime=1441974670.11702461 icedtea-web-1.5.3/tests/reproducers/signed/SavingCookies/testcases/0000775000076400007640000000000012574544466026254 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/SavingCookies/testcases/PaxHeaders.24993/SavingCookiesTes0000644000000000000000000000013012574544466030334 xustar0030 mtime=1441974582.545016555 29 atime=1441974656.51886808 29 ctime=1441974670.11702461 icedtea-web-1.5.3/tests/reproducers/signed/SavingCookies/testcases/SavingCookiesTests.java0000664000076400007640000001713212574544466032712 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/signed/SavingCookies/PaxHeaders.24993/srcs0000644000000000000000000000013112574544466024071 xustar0030 mtime=1441974582.544016543 30 atime=1441974670.153025025 29 ctime=1441974670.11702461 icedtea-web-1.5.3/tests/reproducers/signed/SavingCookies/srcs/0000775000076400007640000000000012574544466025230 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/SavingCookies/srcs/PaxHeaders.24993/SavingCookies.java0000644000000000000000000000013012574544466027554 xustar0030 mtime=1441974582.544016543 29 atime=1441974656.51886808 29 ctime=1441974670.11702461 icedtea-web-1.5.3/tests/reproducers/signed/SavingCookies/srcs/SavingCookies.java0000664000076400007640000001102612574544466030637 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/signed/SavingCookies/srcs/PaxHeaders.24993/CheckingCookies.java0000644000000000000000000000013112574544466030041 xustar0030 mtime=1441974582.544016543 30 atime=1441974656.517868068 29 ctime=1441974670.11702461 icedtea-web-1.5.3/tests/reproducers/signed/SavingCookies/srcs/CheckingCookies.java0000664000076400007640000001010612574544466031121 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/signed/SavingCookies/PaxHeaders.24993/resources0000644000000000000000000000013112574544466025131 xustar0030 mtime=1441974582.543016532 30 atime=1441974670.153025025 29 ctime=1441974670.11702461 icedtea-web-1.5.3/tests/reproducers/signed/SavingCookies/resources/0000775000076400007640000000000012574544466026270 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/SavingCookies/resources/PaxHeaders.24993/SaveSessionCooki0000644000000000000000000000031012574544466030357 xustar00111 path=icedtea-web-1.5.3/tests/reproducers/signed/SavingCookies/resources/SaveSessionCookieAndGotoCheck.html 30 mtime=1441974582.543016532 30 atime=1441974656.517868068 29 ctime=1441974670.11702461 icedtea-web-1.5.3/tests/reproducers/signed/SavingCookies/resources/SaveSessionCookieAndGotoCheck.htm0000664000076400007640000000365612574544466034622 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/signed/SavingCookies/resources/PaxHeaders.24993/SaveSessionCooki0000644000000000000000000000013112574544466030360 xustar0030 mtime=1441974582.543016532 30 atime=1441974656.517868068 29 ctime=1441974670.11702461 icedtea-web-1.5.3/tests/reproducers/signed/SavingCookies/resources/SaveSessionCookie.html0000664000076400007640000000356412574544466032562 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/signed/SavingCookies/resources/PaxHeaders.24993/SavePersistentCo0000644000000000000000000000031312574544466030374 xustar00114 path=icedtea-web-1.5.3/tests/reproducers/signed/SavingCookies/resources/SavePersistentCookieAndGotoCheck.html 30 mtime=1441974582.543016532 30 atime=1441974656.517868068 29 ctime=1441974670.11702461 icedtea-web-1.5.3/tests/reproducers/signed/SavingCookies/resources/SavePersistentCookieAndGotoCheck.0000664000076400007640000000367412574544466034626 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/signed/SavingCookies/resources/PaxHeaders.24993/SavePersistentCo0000644000000000000000000000013112574544466030372 xustar0030 mtime=1441974582.543016532 30 atime=1441974656.516868057 29 ctime=1441974670.11702461 icedtea-web-1.5.3/tests/reproducers/signed/SavingCookies/resources/SavePersistentCookie.html0000664000076400007640000000357012574544466033274 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/signed/SavingCookies/resources/PaxHeaders.24993/ClearPersistentC0000644000000000000000000000013012574544466030342 xustar0029 mtime=1441974582.54201652 30 atime=1441974656.516868057 29 ctime=1441974670.11702461 icedtea-web-1.5.3/tests/reproducers/signed/SavingCookies/resources/ClearPersistentCookie.html0000664000076400007640000000363312574544466033424 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/signed/SavingCookies/resources/PaxHeaders.24993/CheckCookieAndGo0000644000000000000000000000013012574544466030210 xustar0029 mtime=1441974582.54201652 30 atime=1441974656.516868057 29 ctime=1441974670.11702461 icedtea-web-1.5.3/tests/reproducers/signed/SavingCookies/resources/CheckCookieAndGotoClear.html0000664000076400007640000000365112574544466033555 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/signed/SavingCookies/resources/PaxHeaders.24993/CheckCookie.html0000644000000000000000000000013012574544466030242 xustar0029 mtime=1441974582.54201652 30 atime=1441974656.516868057 29 ctime=1441974670.11702461 icedtea-web-1.5.3/tests/reproducers/signed/SavingCookies/resources/CheckCookie.html0000664000076400007640000000343712574544466031334 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/signed/PaxHeaders.24993/RunInSandbox0000644000000000000000000000013012574544466022724 xustar0029 mtime=1441974582.54201652 30 atime=1441974670.153025025 29 ctime=1441974670.11702461 icedtea-web-1.5.3/tests/reproducers/signed/RunInSandbox/0000775000076400007640000000000012574544466024064 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/RunInSandbox/PaxHeaders.24993/testcases0000644000000000000000000000013012574544466024722 xustar0029 mtime=1441974582.54201652 30 atime=1441974670.153025025 29 ctime=1441974670.11702461 icedtea-web-1.5.3/tests/reproducers/signed/RunInSandbox/testcases/0000775000076400007640000000000012574544466026062 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/RunInSandbox/testcases/PaxHeaders.24993/RunInSandboxTest.0000644000000000000000000000013012574544466030212 xustar0029 mtime=1441974582.54201652 30 atime=1441974656.516868057 29 ctime=1441974670.11702461 icedtea-web-1.5.3/tests/reproducers/signed/RunInSandbox/testcases/RunInSandboxTest.java0000664000076400007640000000765112574544466032150 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/signed/RunInSandbox/PaxHeaders.24993/srcs0000644000000000000000000000013112574544466023677 xustar0030 mtime=1441974582.541016508 30 atime=1441974670.153025025 29 ctime=1441974670.11702461 icedtea-web-1.5.3/tests/reproducers/signed/RunInSandbox/srcs/0000775000076400007640000000000012574544466025036 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/RunInSandbox/srcs/PaxHeaders.24993/RunInSandbox.java0000644000000000000000000000013112574544466027171 xustar0030 mtime=1441974582.541016508 30 atime=1441974656.515868045 29 ctime=1441974670.11702461 icedtea-web-1.5.3/tests/reproducers/signed/RunInSandbox/srcs/RunInSandbox.java0000664000076400007640000000103012574544466030245 0ustar00jvanekjvanek00000000000000import 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.5.3/tests/reproducers/signed/RunInSandbox/PaxHeaders.24993/resources0000644000000000000000000000013112574544466024737 xustar0030 mtime=1441974582.541016508 30 atime=1441974670.153025025 29 ctime=1441974670.11702461 icedtea-web-1.5.3/tests/reproducers/signed/RunInSandbox/resources/0000775000076400007640000000000012574544466026076 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/RunInSandbox/resources/PaxHeaders.24993/RunInSandboxJnlpH0000644000000000000000000000013112574544466030245 xustar0030 mtime=1441974582.541016508 30 atime=1441974656.515868045 29 ctime=1441974670.11702461 icedtea-web-1.5.3/tests/reproducers/signed/RunInSandbox/resources/RunInSandboxJnlpHref.html0000664000076400007640000000342712574544466032775 0ustar00jvanekjvanek00000000000000 icedtea-web-1.5.3/tests/reproducers/signed/RunInSandbox/resources/PaxHeaders.24993/RunInSandboxAppli0000644000000000000000000000013112574544466030277 xustar0030 mtime=1441974582.541016508 30 atime=1441974656.515868045 29 ctime=1441974670.11702461 icedtea-web-1.5.3/tests/reproducers/signed/RunInSandbox/resources/RunInSandboxApplication.jnlp0000664000076400007640000000431712574544466033526 0ustar00jvanekjvanek00000000000000 UsesSignedJar IcedTea Test "Run in Sandbox" functionality for signed applets icedtea-web-1.5.3/tests/reproducers/signed/RunInSandbox/resources/PaxHeaders.24993/RunInSandboxApple0000644000000000000000000000013112574544466030273 xustar0030 mtime=1441974582.540016497 30 atime=1441974656.515868045 29 ctime=1441974670.11702461 icedtea-web-1.5.3/tests/reproducers/signed/RunInSandbox/resources/RunInSandboxApplet.jnlp0000664000076400007640000000432412574544466032506 0ustar00jvanekjvanek00000000000000 UsesSignedJar IcedTea Test "Run in Sandbox" functionality for signed applets icedtea-web-1.5.3/tests/reproducers/signed/RunInSandbox/resources/PaxHeaders.24993/RunInSandbox.html0000644000000000000000000000013112574544466030254 xustar0030 mtime=1441974582.540016497 30 atime=1441974656.514868034 29 ctime=1441974670.11702461 icedtea-web-1.5.3/tests/reproducers/signed/RunInSandbox/resources/RunInSandbox.html0000664000076400007640000000350012574544466031334 0ustar00jvanekjvanek00000000000000 icedtea-web-1.5.3/tests/reproducers/signed/PaxHeaders.24993/ReadPropertiesSigned0000644000000000000000000000013112574544466024435 xustar0030 mtime=1441974582.540016497 30 atime=1441974670.153025025 29 ctime=1441974670.11702461 icedtea-web-1.5.3/tests/reproducers/signed/ReadPropertiesSigned/0000775000076400007640000000000012574544466025574 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/ReadPropertiesSigned/PaxHeaders.24993/testcases0000644000000000000000000000013112574544466026433 xustar0030 mtime=1441974582.540016497 30 atime=1441974670.153025025 29 ctime=1441974670.11702461 icedtea-web-1.5.3/tests/reproducers/signed/ReadPropertiesSigned/testcases/0000775000076400007640000000000012574544466027572 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/ReadPropertiesSigned/testcases/PaxHeaders.24993/ReadPrope0000644000000000000000000000031212574544466030315 xustar00113 path=icedtea-web-1.5.3/tests/reproducers/signed/ReadPropertiesSigned/testcases/ReadPropertiesSignedTest.java 30 mtime=1441974582.540016497 30 atime=1441974656.514868034 29 ctime=1441974670.11702461 icedtea-web-1.5.3/tests/reproducers/signed/ReadPropertiesSigned/testcases/ReadPropertiesSignedTest.j0000664000076400007640000001023012574544466034663 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/signed/ReadPropertiesSigned/PaxHeaders.24993/srcs0000644000000000000000000000013112574544466025407 xustar0030 mtime=1441974582.539016486 30 atime=1441974670.153025025 29 ctime=1441974670.11702461 icedtea-web-1.5.3/tests/reproducers/signed/ReadPropertiesSigned/srcs/0000775000076400007640000000000012574544466026546 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/ReadPropertiesSigned/srcs/PaxHeaders.24993/ReadProperties0000644000000000000000000000013112574544466030337 xustar0030 mtime=1441974582.539016486 30 atime=1441974656.514868034 29 ctime=1441974670.11702461 icedtea-web-1.5.3/tests/reproducers/signed/ReadPropertiesSigned/srcs/ReadPropertiesSigned.java0000664000076400007640000000354112574544466033476 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/signed/ReadPropertiesSigned/PaxHeaders.24993/resources0000644000000000000000000000013112574544466026447 xustar0030 mtime=1441974582.539016486 30 atime=1441974670.153025025 29 ctime=1441974670.11702461 icedtea-web-1.5.3/tests/reproducers/signed/ReadPropertiesSigned/resources/0000775000076400007640000000000012574544466027606 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/ReadPropertiesSigned/resources/PaxHeaders.24993/ReadPrope0000644000000000000000000000013112574544466030330 xustar0030 mtime=1441974582.539016486 30 atime=1441974656.514868034 29 ctime=1441974670.11702461 icedtea-web-1.5.3/tests/reproducers/signed/ReadPropertiesSigned/resources/ReadPropertiesSigned2.jnlp0000664000076400007640000000101312574544466034632 0ustar00jvanekjvanek00000000000000 read properties using System.getenv() IcedTea user.name icedtea-web-1.5.3/tests/reproducers/signed/ReadPropertiesSigned/resources/PaxHeaders.24993/ReadPrope0000644000000000000000000000013112574544466030330 xustar0030 mtime=1441974582.539016486 30 atime=1441974656.513868022 29 ctime=1441974670.11702461 icedtea-web-1.5.3/tests/reproducers/signed/ReadPropertiesSigned/resources/ReadPropertiesSigned1.jnlp0000664000076400007640000000072312574544466034640 0ustar00jvanekjvanek00000000000000 read properties using System.getenv() IcedTea user.name icedtea-web-1.5.3/tests/reproducers/signed/ReadPropertiesSigned/PaxHeaders.24993/README0000644000000000000000000000013212574544466025373 xustar0030 mtime=1441974582.538016474 30 atime=1441974656.513868022 30 ctime=1441974670.116024599 icedtea-web-1.5.3/tests/reproducers/signed/ReadPropertiesSigned/README0000664000076400007640000000016412574544466026455 0ustar00jvanekjvanek00000000000000This test is relied on by custom/MultipleSignaturesPerJar. Any changes to this reproducer may require updates there.icedtea-web-1.5.3/tests/reproducers/signed/PaxHeaders.24993/ReadPropertiesBySignedHack0000644000000000000000000000013212574544466025520 xustar0030 mtime=1441974582.538016474 30 atime=1441974670.153025025 30 ctime=1441974670.116024599 icedtea-web-1.5.3/tests/reproducers/signed/ReadPropertiesBySignedHack/0000775000076400007640000000000012574544466026656 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/ReadPropertiesBySignedHack/PaxHeaders.24993/testcases0000644000000000000000000000013212574544466027516 xustar0030 mtime=1441974582.538016474 30 atime=1441974670.153025025 30 ctime=1441974670.116024599 icedtea-web-1.5.3/tests/reproducers/signed/ReadPropertiesBySignedHack/testcases/0000775000076400007640000000000012574544466030654 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/ReadPropertiesBySignedHack/testcases/PaxHeaders.24993/Rea0000644000000000000000000000032712574544466030233 xustar00125 path=icedtea-web-1.5.3/tests/reproducers/signed/ReadPropertiesBySignedHack/testcases/ReadPropertiesBySignedHackTest.java 30 mtime=1441974582.538016474 30 atime=1441974656.513868022 30 ctime=1441974670.116024599 icedtea-web-1.5.3/tests/reproducers/signed/ReadPropertiesBySignedHack/testcases/ReadPropertiesBySign0000664000076400007640000000545212574544466034651 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/signed/ReadPropertiesBySignedHack/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466026472 xustar0030 mtime=1441974582.538016474 30 atime=1441974670.153025025 30 ctime=1441974670.116024599 icedtea-web-1.5.3/tests/reproducers/signed/ReadPropertiesBySignedHack/srcs/0000775000076400007640000000000012574544466027630 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/ReadPropertiesBySignedHack/srcs/PaxHeaders.24993/ReadProp0000644000000000000000000000031612574544466030212 xustar00116 path=icedtea-web-1.5.3/tests/reproducers/signed/ReadPropertiesBySignedHack/srcs/ReadPropertiesBySignedHack.java 30 mtime=1441974582.538016474 30 atime=1441974656.513868022 30 ctime=1441974670.116024599 icedtea-web-1.5.3/tests/reproducers/signed/ReadPropertiesBySignedHack/srcs/ReadPropertiesBySignedHac0000664000076400007640000000514712574544466034553 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/signed/ReadPropertiesBySignedHack/PaxHeaders.24993/resources0000644000000000000000000000013212574544466027532 xustar0030 mtime=1441974582.537016463 30 atime=1441974670.153025025 30 ctime=1441974670.116024599 icedtea-web-1.5.3/tests/reproducers/signed/ReadPropertiesBySignedHack/resources/0000775000076400007640000000000012574544466030670 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/ReadPropertiesBySignedHack/resources/PaxHeaders.24993/Rea0000644000000000000000000000032312574544466030243 xustar00121 path=icedtea-web-1.5.3/tests/reproducers/signed/ReadPropertiesBySignedHack/resources/ReadPropertiesBySignedHack.jnlp 30 mtime=1441974582.537016463 30 atime=1441974656.512868011 30 ctime=1441974670.116024599 icedtea-web-1.5.3/tests/reproducers/signed/ReadPropertiesBySignedHack/resources/ReadPropertiesBySign0000664000076400007640000000114512574544466034660 0ustar00jvanekjvanek00000000000000 read properties using System.getenv() IcedTea user.name icedtea-web-1.5.3/tests/reproducers/signed/PaxHeaders.24993/MultiJar-SignedJnlpTemplate0000644000000000000000000000013212574544466025632 xustar0030 mtime=1441974582.537016463 30 atime=1441974670.153025025 30 ctime=1441974670.116024599 icedtea-web-1.5.3/tests/reproducers/signed/MultiJar-SignedJnlpTemplate/0000775000076400007640000000000012574544466026770 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/MultiJar-SignedJnlpTemplate/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466026604 xustar0030 mtime=1441974582.537016463 30 atime=1441974670.153025025 30 ctime=1441974670.116024599 icedtea-web-1.5.3/tests/reproducers/signed/MultiJar-SignedJnlpTemplate/srcs/0000775000076400007640000000000012574544466027742 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/MultiJar-SignedJnlpTemplate/srcs/PaxHeaders.24993/SignedJ0000644000000000000000000000013212574544466030127 xustar0030 mtime=1441974582.537016463 30 atime=1441974656.512868011 30 ctime=1441974670.116024599 icedtea-web-1.5.3/tests/reproducers/signed/MultiJar-SignedJnlpTemplate/srcs/SignedJnlpTemplate.java0000664000076400007640000000471612574544466034346 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/signed/MultiJar-SignedJnlpTemplate/srcs/PaxHeaders.24993/JNLP-IN0000644000000000000000000000013212574544466027653 xustar0030 mtime=1441974582.537016463 30 atime=1441974670.153025025 30 ctime=1441974670.116024599 icedtea-web-1.5.3/tests/reproducers/signed/MultiJar-SignedJnlpTemplate/srcs/JNLP-INF/0000775000076400007640000000000012574544466031117 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/MultiJar-SignedJnlpTemplate/srcs/JNLP-INF/PaxHeaders.24990000644000000000000000000000032212574544466027677 xustar00120 path=icedtea-web-1.5.3/tests/reproducers/signed/MultiJar-SignedJnlpTemplate/srcs/JNLP-INF/APPLICATION_TEMPLATE.jnlp 30 mtime=1441974582.537016463 30 atime=1441974656.512868011 30 ctime=1441974670.116024599 icedtea-web-1.5.3/tests/reproducers/signed/MultiJar-SignedJnlpTemplate/srcs/JNLP-INF/APPLICATION_TEM0000664000076400007640000000440412574544466033314 0ustar00jvanekjvanek00000000000000 Matching Signed Jnlp Template IcedTea Matching Signed Jnlp Template icedtea-web-1.5.3/tests/reproducers/signed/MultiJar-SignedJnlpTemplate/PaxHeaders.24993/resources0000644000000000000000000000013212574544466027644 xustar0030 mtime=1441974582.536016451 30 atime=1441974670.153025025 30 ctime=1441974670.116024599 icedtea-web-1.5.3/tests/reproducers/signed/MultiJar-SignedJnlpTemplate/resources/0000775000076400007640000000000012574544466031002 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/MultiJar-SignedJnlpTemplate/resources/PaxHeaders.24993/Ma0000644000000000000000000000034112574544466030203 xustar00135 path=icedtea-web-1.5.3/tests/reproducers/signed/MultiJar-SignedJnlpTemplate/resources/MainJarWithUnmatchingSignedJnlpTemplate.jnlp 30 mtime=1441974582.536016451 30 atime=1441974656.512868011 30 ctime=1441974670.116024599 icedtea-web-1.5.3/tests/reproducers/signed/MultiJar-SignedJnlpTemplate/resources/MainJarWithUnmatchi0000664000076400007640000000560412574544466034600 0ustar00jvanekjvanek00000000000000 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.5.3/tests/reproducers/signed/MultiJar-SignedJnlpTemplate/resources/PaxHeaders.24993/Ma0000644000000000000000000000033712574544466030210 xustar00133 path=icedtea-web-1.5.3/tests/reproducers/signed/MultiJar-SignedJnlpTemplate/resources/MainJarWithMatchingSignedJnlpTemplate.jnlp 30 mtime=1441974582.536016451 30 atime=1441974656.511867999 30 ctime=1441974670.116024599 icedtea-web-1.5.3/tests/reproducers/signed/MultiJar-SignedJnlpTemplate/resources/MainJarWithMatching0000664000076400007640000000543612574544466034565 0ustar00jvanekjvanek00000000000000 Matching Signed Jnlp Template IcedTea Matching Signed Jnlp Template icedtea-web-1.5.3/tests/reproducers/signed/PaxHeaders.24993/MultiJar-SignedJnlpApplication0000644000000000000000000000013212574544466026322 xustar0030 mtime=1441974582.536016451 30 atime=1441974670.154025036 30 ctime=1441974670.116024599 icedtea-web-1.5.3/tests/reproducers/signed/MultiJar-SignedJnlpApplication/0000775000076400007640000000000012574544466027460 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/MultiJar-SignedJnlpApplication/PaxHeaders.24993/testcases0000644000000000000000000000013212574544466030320 xustar0030 mtime=1441974582.536016451 30 atime=1441974670.154025036 30 ctime=1441974670.116024599 icedtea-web-1.5.3/tests/reproducers/signed/MultiJar-SignedJnlpApplication/testcases/0000775000076400007640000000000012574544466031456 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/MultiJar-SignedJnlpApplication/testcases/PaxHeaders.249930000644000000000000000000000032312574544466030322 xustar00121 path=icedtea-web-1.5.3/tests/reproducers/signed/MultiJar-SignedJnlpApplication/testcases/MultiJarSignedJnlpTest.java 30 mtime=1441974582.536016451 30 atime=1441974656.511867999 30 ctime=1441974670.116024599 icedtea-web-1.5.3/tests/reproducers/signed/MultiJar-SignedJnlpApplication/testcases/MultiJarSignedJn0000664000076400007640000001162612574544466034560 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/signed/MultiJar-SignedJnlpApplication/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466027274 xustar0030 mtime=1441974582.535016439 30 atime=1441974670.154025036 30 ctime=1441974670.116024599 icedtea-web-1.5.3/tests/reproducers/signed/MultiJar-SignedJnlpApplication/srcs/0000775000076400007640000000000012574544466030432 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/MultiJar-SignedJnlpApplication/srcs/PaxHeaders.24993/Sign0000644000000000000000000000031512574544466030177 xustar00115 path=icedtea-web-1.5.3/tests/reproducers/signed/MultiJar-SignedJnlpApplication/srcs/SignedJnlpApplication.java 30 mtime=1441974582.535016439 30 atime=1441974656.511867999 30 ctime=1441974670.116024599 icedtea-web-1.5.3/tests/reproducers/signed/MultiJar-SignedJnlpApplication/srcs/SignedJnlpApplication0000664000076400007640000000467712574544466034614 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/signed/MultiJar-SignedJnlpApplication/srcs/PaxHeaders.24993/JNLP0000644000000000000000000000013212574544466030037 xustar0030 mtime=1441974582.535016439 30 atime=1441974670.154025036 30 ctime=1441974670.116024599 icedtea-web-1.5.3/tests/reproducers/signed/MultiJar-SignedJnlpApplication/srcs/JNLP-INF/0000775000076400007640000000000012574544466031607 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/MultiJar-SignedJnlpApplication/srcs/JNLP-INF/PaxHeaders.20000644000000000000000000000031412574544466030122 xustar00114 path=icedtea-web-1.5.3/tests/reproducers/signed/MultiJar-SignedJnlpApplication/srcs/JNLP-INF/APPLICATION.jnlp 30 mtime=1441974582.535016439 30 atime=1441974656.511867999 30 ctime=1441974670.116024599 icedtea-web-1.5.3/tests/reproducers/signed/MultiJar-SignedJnlpApplication/srcs/JNLP-INF/APPLICATION.0000664000076400007640000000464312574544466033362 0ustar00jvanekjvanek00000000000000 Matching Signed JNLP IcedTea Matching Signed JNLP icedtea-web-1.5.3/tests/reproducers/signed/MultiJar-SignedJnlpApplication/PaxHeaders.24993/resources0000644000000000000000000000013212574544466030334 xustar0030 mtime=1441974582.535016439 30 atime=1441974670.154025036 30 ctime=1441974670.116024599 icedtea-web-1.5.3/tests/reproducers/signed/MultiJar-SignedJnlpApplication/resources/0000775000076400007640000000000012574544466031472 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/MultiJar-SignedJnlpApplication/resources/PaxHeaders.249930000644000000000000000000000034712574544466030344 xustar00141 path=icedtea-web-1.5.3/tests/reproducers/signed/MultiJar-SignedJnlpApplication/resources/MainJarWithUnmatchingSignedJnlpApplication.jnlp 30 mtime=1441974582.535016439 30 atime=1441974656.510867988 30 ctime=1441974670.116024599 icedtea-web-1.5.3/tests/reproducers/signed/MultiJar-SignedJnlpApplication/resources/MainJarWithUnmat0000664000076400007640000000561212574544466034603 0ustar00jvanekjvanek00000000000000 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.5.3/tests/reproducers/signed/MultiJar-SignedJnlpApplication/resources/PaxHeaders.249930000644000000000000000000000034512574544466030342 xustar00139 path=icedtea-web-1.5.3/tests/reproducers/signed/MultiJar-SignedJnlpApplication/resources/MainJarWithMatchingSignedJnlpApplication.jnlp 30 mtime=1441974582.534016428 30 atime=1441974656.510867988 30 ctime=1441974670.116024599 icedtea-web-1.5.3/tests/reproducers/signed/MultiJar-SignedJnlpApplication/resources/MainJarWithMatch0000664000076400007640000000544412574544466034556 0ustar00jvanekjvanek00000000000000 Matching Signed JNLP IcedTea Matching Signed JNLP icedtea-web-1.5.3/tests/reproducers/signed/PaxHeaders.24993/MultiJar-NoSignedJnlp0000644000000000000000000000013212574544466024433 xustar0030 mtime=1441974582.534016428 30 atime=1441974670.154025036 30 ctime=1441974670.116024599 icedtea-web-1.5.3/tests/reproducers/signed/MultiJar-NoSignedJnlp/0000775000076400007640000000000012574544466025571 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/MultiJar-NoSignedJnlp/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466025405 xustar0030 mtime=1441974582.534016428 30 atime=1441974670.154025036 30 ctime=1441974670.116024599 icedtea-web-1.5.3/tests/reproducers/signed/MultiJar-NoSignedJnlp/srcs/0000775000076400007640000000000012574544466026543 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/MultiJar-NoSignedJnlp/srcs/PaxHeaders.24993/SimpleApplica0000644000000000000000000000013212574544466030130 xustar0030 mtime=1441974582.534016428 30 atime=1441974656.510867988 30 ctime=1441974670.116024599 icedtea-web-1.5.3/tests/reproducers/signed/MultiJar-NoSignedJnlp/srcs/SimpleApplication.java0000664000076400007640000000465512574544466033035 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/signed/MultiJar-NoSignedJnlp/PaxHeaders.24993/resources0000644000000000000000000000013212574544466026445 xustar0030 mtime=1441974582.534016428 30 atime=1441974670.154025036 30 ctime=1441974670.116024599 icedtea-web-1.5.3/tests/reproducers/signed/MultiJar-NoSignedJnlp/resources/0000775000076400007640000000000012574544466027603 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/MultiJar-NoSignedJnlp/resources/PaxHeaders.24993/MainJarW0000644000000000000000000000031412574544466030117 xustar00114 path=icedtea-web-1.5.3/tests/reproducers/signed/MultiJar-NoSignedJnlp/resources/MainJarWithoutSignedJnlp.jnlp 30 mtime=1441974582.534016428 30 atime=1441974656.510867988 30 ctime=1441974670.116024599 icedtea-web-1.5.3/tests/reproducers/signed/MultiJar-NoSignedJnlp/resources/MainJarWithoutSignedJnlp.0000664000076400007640000000540512574544466034473 0ustar00jvanekjvanek00000000000000 Main Jar does have a signed jnlp IcedTea Main Jar does have a signed jnlp icedtea-web-1.5.3/tests/reproducers/signed/PaxHeaders.24993/MissingJar0000644000000000000000000000013212574544466022422 xustar0030 mtime=1441974582.533016417 30 atime=1441974670.154025036 30 ctime=1441974670.116024599 icedtea-web-1.5.3/tests/reproducers/signed/MissingJar/0000775000076400007640000000000012574544466023560 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/MissingJar/PaxHeaders.24993/testcases0000644000000000000000000000013212574544466024420 xustar0030 mtime=1441974582.533016417 30 atime=1441974670.154025036 30 ctime=1441974670.116024599 icedtea-web-1.5.3/tests/reproducers/signed/MissingJar/testcases/0000775000076400007640000000000012574544466025556 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/MissingJar/testcases/PaxHeaders.24993/MissingJarTest.java0000644000000000000000000000013212574544466030246 xustar0030 mtime=1441974582.533016417 30 atime=1441974656.509867976 30 ctime=1441974670.116024599 icedtea-web-1.5.3/tests/reproducers/signed/MissingJar/testcases/MissingJarTest.java0000664000076400007640000000633712574544466031340 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/signed/MissingJar/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466023374 xustar0030 mtime=1441974582.533016417 30 atime=1441974670.154025036 30 ctime=1441974670.116024599 icedtea-web-1.5.3/tests/reproducers/signed/MissingJar/srcs/0000775000076400007640000000000012574544466024532 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/MissingJar/srcs/PaxHeaders.24993/MissingJar.java0000644000000000000000000000013212574544466026362 xustar0030 mtime=1441974582.533016417 30 atime=1441974656.509867976 30 ctime=1441974670.116024599 icedtea-web-1.5.3/tests/reproducers/signed/MissingJar/srcs/MissingJar.java0000664000076400007640000000341112574544466027442 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/signed/MissingJar/PaxHeaders.24993/resources0000644000000000000000000000013212574544466024434 xustar0030 mtime=1441974582.533016417 30 atime=1441974670.154025036 30 ctime=1441974670.116024599 icedtea-web-1.5.3/tests/reproducers/signed/MissingJar/resources/0000775000076400007640000000000012574544466025572 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/MissingJar/resources/PaxHeaders.24993/MissingJar4.jnlp0000644000000000000000000000013212574544466027530 xustar0030 mtime=1441974582.533016417 30 atime=1441974656.509867976 30 ctime=1441974670.116024599 icedtea-web-1.5.3/tests/reproducers/signed/MissingJar/resources/MissingJar4.jnlp0000664000076400007640000000114312574544466030610 0ustar00jvanekjvanek00000000000000 test MissingJar IcedTea icedtea-web-1.5.3/tests/reproducers/signed/MissingJar/resources/PaxHeaders.24993/MissingJar3.jnlp0000644000000000000000000000013212574544466027527 xustar0030 mtime=1441974582.532016405 30 atime=1441974656.509867976 30 ctime=1441974670.116024599 icedtea-web-1.5.3/tests/reproducers/signed/MissingJar/resources/MissingJar3.jnlp0000664000076400007640000000110412574544466030604 0ustar00jvanekjvanek00000000000000 test MissingJar IcedTea icedtea-web-1.5.3/tests/reproducers/signed/MissingJar/resources/PaxHeaders.24993/MissingJar2.jnlp0000644000000000000000000000013212574544466027526 xustar0030 mtime=1441974582.532016405 30 atime=1441974656.508867965 30 ctime=1441974670.116024599 icedtea-web-1.5.3/tests/reproducers/signed/MissingJar/resources/MissingJar2.jnlp0000664000076400007640000000110412574544466030603 0ustar00jvanekjvanek00000000000000 test MissingJar IcedTea icedtea-web-1.5.3/tests/reproducers/signed/MissingJar/resources/PaxHeaders.24993/MissingJar.jnlp0000644000000000000000000000013212574544466027444 xustar0030 mtime=1441974582.532016405 30 atime=1441974656.508867965 30 ctime=1441974670.116024599 icedtea-web-1.5.3/tests/reproducers/signed/MissingJar/resources/MissingJar.jnlp0000664000076400007640000000114212574544466030523 0ustar00jvanekjvanek00000000000000 test MissingJar IcedTea icedtea-web-1.5.3/tests/reproducers/signed/PaxHeaders.24993/InternalClassloaderWithDownloadedResourc0000644000000000000000000000013212574544466030505 xustar0030 mtime=1441974582.532016405 30 atime=1441974670.154025036 30 ctime=1441974670.116024599 icedtea-web-1.5.3/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/0000775000076400007640000000000012574544466032010 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/PaxHeaders.24990000644000000000000000000000013212574544466030567 xustar0030 mtime=1441974582.532016405 30 atime=1441974670.154025036 30 ctime=1441974670.115024587 icedtea-web-1.5.3/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/testcases/0000775000076400007640000000000012574544466034006 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/testcases/PaxHe0000644000000000000000000000036512574544466031150 xustar00155 path=icedtea-web-1.5.3/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/testcases/InternalClassloaderWithDownloadedResourceTest.java 30 mtime=1441974582.532016405 30 atime=1441974656.508867965 30 ctime=1441974670.115024587 icedtea-web-1.5.3/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/testcases/Inter0000664000076400007640000001407512574544466035021 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/PaxHeaders.24990000644000000000000000000000013212574544466030567 xustar0030 mtime=1441974582.531016393 30 atime=1441974670.154025036 30 ctime=1441974670.115024587 icedtea-web-1.5.3/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/srcs/0000775000076400007640000000000012574544466032762 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/srcs/PaxHeaders0000644000000000000000000000035412574544466031141 xustar00146 path=icedtea-web-1.5.3/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/srcs/InternalClassloaderWithDownloadedResource.java 30 mtime=1441974582.531016393 30 atime=1441974656.508867965 30 ctime=1441974670.115024587 icedtea-web-1.5.3/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/srcs/InternalCl0000664000076400007640000001435212574544466034745 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/PaxHeaders.24990000644000000000000000000000013212574544466030567 xustar0030 mtime=1441974582.531016393 30 atime=1441974670.154025036 30 ctime=1441974670.115024587 icedtea-web-1.5.3/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/resources/0000775000076400007640000000000012574544466034022 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/resources/PaxHe0000644000000000000000000000036512574544466031164 xustar00155 path=icedtea-web-1.5.3/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/resources/InternalClassloaderWithDownloadedResource-new.jnlp 30 mtime=1441974582.531016393 30 atime=1441974656.507867953 30 ctime=1441974670.115024587 icedtea-web-1.5.3/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/resources/Inter0000664000076400007640000000460012574544466035026 0ustar00jvanekjvanek00000000000000 InternalClassloaderWithDownloadedResource-new IcedTea InternalClassloaderWithDownloadedResource-new new icedtea-web-1.5.3/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/resources/PaxHe0000644000000000000000000000036512574544466031164 xustar00155 path=icedtea-web-1.5.3/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/resources/InternalClassloaderWithDownloadedResource-new.html 30 mtime=1441974582.531016393 30 atime=1441974656.507867953 30 ctime=1441974670.115024587 icedtea-web-1.5.3/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/resources/Inter0000664000076400007640000000367312574544466035037 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/resources/PaxHe0000644000000000000000000000036612574544466031165 xustar00156 path=icedtea-web-1.5.3/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/resources/InternalClassloaderWithDownloadedResource-hack.jnlp 30 mtime=1441974582.530016382 30 atime=1441974656.507867953 30 ctime=1441974670.115024587 icedtea-web-1.5.3/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/resources/Inter0000664000076400007640000000460412574544466035032 0ustar00jvanekjvanek00000000000000 InternalClassloaderWithDownloadedResource-hack IcedTea InternalClassloaderWithDownloadedResource-hack hack icedtea-web-1.5.3/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/resources/PaxHe0000644000000000000000000000036612574544466031165 xustar00156 path=icedtea-web-1.5.3/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/resources/InternalClassloaderWithDownloadedResource-hack.html 30 mtime=1441974582.530016382 30 atime=1441974656.507867953 30 ctime=1441974670.115024587 icedtea-web-1.5.3/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/resources/Inter0000664000076400007640000000367412574544466035040 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/resources/PaxHe0000644000000000000000000000037412574544466031164 xustar00162 path=icedtea-web-1.5.3/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/resources/InternalClassloaderWithDownloadedResource-applet-new.jnlp 30 mtime=1441974582.530016382 30 atime=1441974656.506867942 30 ctime=1441974670.115024587 icedtea-web-1.5.3/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/resources/Inter0000664000076400007640000000502212574544466035025 0ustar00jvanekjvanek00000000000000 InternalClassloaderWithDownloadedResource-applet-new IcedTea InternalClassloaderWithDownloadedResource-applet-new icedtea-web-1.5.3/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/resources/PaxHe0000644000000000000000000000037412574544466031164 xustar00163 path=icedtea-web-1.5.3/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/resources/InternalClassloaderWithDownloadedResource-applet-hack.jnlp 29 mtime=1441974582.52901637 30 atime=1441974656.506867942 30 ctime=1441974670.115024587 icedtea-web-1.5.3/tests/reproducers/signed/InternalClassloaderWithDownloadedResource/resources/Inter0000664000076400007640000000502612574544466035031 0ustar00jvanekjvanek00000000000000 InternalClassloaderWithDownloadedResource-applet-hack IcedTea InternalClassloaderWithDownloadedResource-applet-hack icedtea-web-1.5.3/tests/reproducers/signed/PaxHeaders.24993/GifarBase0000644000000000000000000000013112574544466022176 xustar0029 mtime=1441974582.52901637 30 atime=1441974670.154025036 30 ctime=1441974670.115024587 icedtea-web-1.5.3/tests/reproducers/signed/GifarBase/0000775000076400007640000000000012574544466023335 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/GifarBase/PaxHeaders.24993/testcases0000644000000000000000000000013112574544466024174 xustar0029 mtime=1441974582.52901637 30 atime=1441974670.154025036 30 ctime=1441974670.115024587 icedtea-web-1.5.3/tests/reproducers/signed/GifarBase/testcases/0000775000076400007640000000000012574544466025333 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/GifarBase/testcases/PaxHeaders.24993/GifarTestcases.java0000644000000000000000000000013112574544466030023 xustar0029 mtime=1441974582.52901637 30 atime=1441974656.506867942 30 ctime=1441974670.115024587 icedtea-web-1.5.3/tests/reproducers/signed/GifarBase/testcases/GifarTestcases.java0000664000076400007640000002100512574544466031103 0ustar00jvanekjvanek00000000000000/* 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.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, "-Xtrustall", "-Xignoreheaders"}); List trust = Arrays.asList(new String[]{ServerAccess.HEADLES_OPTION, "-Xtrustall"}); 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.5.3/tests/reproducers/signed/GifarBase/PaxHeaders.24993/srcs0000644000000000000000000000013112574544466023150 xustar0029 mtime=1441974582.52901637 30 atime=1441974670.154025036 30 ctime=1441974670.115024587 icedtea-web-1.5.3/tests/reproducers/signed/GifarBase/srcs/0000775000076400007640000000000012574544466024307 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/GifarBase/srcs/PaxHeaders.24993/GifarMain.java0000644000000000000000000000013012574544466025724 xustar0029 mtime=1441974582.52901637 29 atime=1441974656.50586793 30 ctime=1441974670.115024587 icedtea-web-1.5.3/tests/reproducers/signed/GifarBase/srcs/GifarMain.java0000664000076400007640000001547712574544466027025 0ustar00jvanekjvanek00000000000000 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.5.3/tests/reproducers/signed/GifarBase/PaxHeaders.24993/resources0000644000000000000000000000013212574544466024211 xustar0030 mtime=1441974582.528016359 30 atime=1441974670.154025036 30 ctime=1441974670.115024587 icedtea-web-1.5.3/tests/reproducers/signed/GifarBase/resources/0000775000076400007640000000000012574544466025347 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/GifarBase/resources/PaxHeaders.24993/happyNonAnimated.gif0000644000000000000000000000013112574544466030213 xustar0030 mtime=1441974582.528016359 29 atime=1441974656.50586793 30 ctime=1441974670.115024587 icedtea-web-1.5.3/tests/reproducers/signed/GifarBase/resources/happyNonAnimated.gif0000664000076400007640000001542712574544466031306 0ustar00jvanekjvanek00000000000000GIF89addçÿR1»P6¶N9´L=±O>¬KB«IE©_?¦KG¤GJ£DM¡WHŸMMFP?UšFSšeK—TQ•]O•?X—GV–GX’@[“SV’A]Ú;#9`‘bU‹A`Œ9ctR‹O^‹ÌC(AcˆHaˆ9fŠpX„W`„9i†Ag…ÂJ.«P9ÛD%~W€n\Bi‚Lf„Sd„9lƒ_a´P2¡U@9oFmz]f|jcyÀQ/Ys8r|Ol{5uyZj|š]AÙM(Asx«Z8‚`xNpxsh]_lr6xvŠcUtgsMtsˆco3|sˆe_‹fOjo[ßR%eonEym@zrZtbkP3ozjo˜bh}lW/‚l¦d:¡cTÕX-žd\cvX¬«MÑ£Jéž=¡³JʨK»¬P×§Dê¥A·µKæªDÙ¯Fì­?̸M×µKì²Cê·Fè¾IïÃFS.½!þCreated with GIMP!ù ÿ,ddþ³T¸¤`A#ðX¨£!‡aHla¢âˆ‹!BtàÀQ BZ¨0a ¨lÀ²0$@@›7  0 §O@  ¨Q£Y4˜áB B”ƒbÅ5vôøQ$É’(U®d SÌ™5qÐI ­ÏŸA‰=šTéÒƒ Ÿ‰ ‘U«'°ŽÈ¸‘ƒ®"G~ +¶åK³gÓâÔ¹Ó-\Cåέk·ŠÁ%yŸFÕÑ÷ïÕ‹ƒµrüØ5äW“Œ´,{íM›kÙò| óйÂpèùsÓ§P¥FœxU0á­­]ƒ-›åãÈ4!x€`“²åË™çþ†^—xq¼ E+_Þ°s³ö:ÝAʱ ÊBF`Eš ä¤Û[ôžQã1qL…Æ_S1gQV…q}°ÝWY´%@BväÁdÜô]qi\‚å™× Sê­gš ‚¥Vóax’†-¹Ó vbÇ àv9¬p(ú&×x,&eÞy 98ZiUYejÏ­ÝHõ‰µ!L¤È)iH@Óm\¡ÊìöðÛP†¡`‹w#ij…å(]†<²Á m¹E"°€]Üñfœr@@›J…xF)%AQ”šÄ©¨¡êz~eÙ…þñY¨#u,m`fW¬@‚¼®pG-ª¤Ad[r°B$WàÛ§hä¹g_,ÆS8AĵØŶCt;D 5ÐPÃDîjØGÌ·Xl < D£wÜaG$ôFÒG-µÀ‰€nr.°ø³Î&5­Gl1C 3<ƒ[tqÄLX¡m;„KnE[ÚX˜%„\Bº¬kŸJÜqŠ]ø=aw8ð¾E•ª4Çû»CÞˆHt 1pÞå¢G±D€þ”À~j²‚Lˆ]€@eÞ²AóÅá d˜Gx»î X`Båœ7+ mè:2‘€v!Ž]¬ ;@ 6È:€pŠî3šÒVY4£ÅïXÜ …!DÈUŠ,øG1$Ø@8J£M’(™…BØÅ.2¡„ ˆX¢%ÜÐÇö© w>Èf6g„È(àÂ+°Åß PˆlO{i…vÞÀ/&b*Ù˜ÙÀ™ÊþTwHÄ–hú!T*oø€ ^H¨œà,P¡ MðApÀ…Šr!…DHÂ9ÑÙBu.²6pÁ BP¨/™LL×cÀc>'5µÍmD ¦YÍÚ]SbðBÆà³Ÿá§Ô šDí`‡ ø PHÂ^d„Kuº K&IPbŸ °ÀzÆT©LJG¢˜"zèSè6@éYUø‚g¢P-,@´ Dp©’ƒNDºFï©k@R+ áÄ [>«ƒÉòó…øƒP ›‚ d8C¨Då"¶VË fHBzèŠÎ©µç4©Q|0ð&¨"7˜êä(I\Àžo”þÌdK‡šþí8ÖªÉ>Ë.K(U¤ =H9Á —:p# | ª¨E%R[’HBÍ`Âõ`‹—"VZè5!{fMVO|:qÄYqkðýlàÃÄ@ø’D ƒ„]4c7ÀÏcbËU@¢à/ |à½Î·Ðú‚Z„ãF¥ÝÚ0&_çÆG¨D3*„ } ÍG)>pÇV¶D¬[>Èͼ=óéOw…‚¬×J@HˆàV¸ÖrÃËJ˜€ \Hâ¯"9ñ‘Pb¸»7aÄ%ÜØ*¢ Æ®{ðØP/ hf¨þ¨5Üâ7ÈPÀ‚2AgI4¡ ;P.F\‰Zà‚ "h n€ +|€ªõ4&–µü-0¶Š*@Ü`ã0óŒ ˆ ƒ| …NkAbPœ†á'ÈDCÁjUH©ymʰ‹`à ÁÉGÖuw¨{–¸ÄæðèÜqA ‚àoL“AÕ3|ƒ´ñ?-¨aÍnNH¦Ð„L¸ì§xDİBᦘ˜c&lp®/M %@n À åçh±$<¡üà}[$ƒ²7æ3¸A }°¨nQ@Œ›ÔÙ6Bœ êo¿ÌÕXø– ÐÝ \,Âõ••þ]Š]p,衽KXBaÁû~Ð=äÁM”ÛÝ †6paá@—ƒ"†-Pa =Ö6¼ npã+X¨ŸD†WL,¢$…º¬À mLc¥¸Êíý’ÚLâ厘ñÌq0‡? œàqȃæàó ]ohCN{\%3PéMú"¤Nµ´'#¢%m_w‘ޝk‡¾ÀzèbÚl"Ø„ï̹ÐGÜ<|{Ïn÷¡ýZ  "…)P¡ß®…Ì*¸.n¾ªá€JŠiœ|éà†_ Q±¬<&›Ø$†íï@âÙ‰ÀyKé-<‚ ŠºéþA‰GdBõ¬Ÿ‚¢{Š`ÈÌÏ¡hÄ·ÒY®Á0—/E9´Q ysãÁçF:ÒqCPÞ10‘|/·m°;W¤Em0Žàv‰À(wj 3„}ÛÇ}Þ~^P Ñ%{0£ égKËqWƒâ16À å0 †V˜°éð0Ø*€ €Â¦â$H±Äm  (‚ðt@‚ sЀðH Ý7n^ h~ø¢ ¥à"8‚‚b5eÀ Ó€ /ð1°¥p1yŔɷ à ¨ƒƒÄy×6xˆ‡•€„”°„”  9…žd ¸3þç· j0KuK]˜=`‹Àn¬qgÈç€ %Ðk‰ÆŸÐ†Â6o ‡'ôEC€ðÿóI¨„K• u0aU@ˆ•pˆæg~ÿ¥ŒÈTSZ¡U(`Üpr†Pa‚Ÿð‰n¨ Žp°4HYdwE~ø¡àu0*` •€ˆºX ©`KUW3Â8„Q!Ãø ‹Ð5jĉc±ŒË¸ ¬‡Ðƒ$OPz8tLø±ˆ_P_Pz° ²—‹¶6 d`Ç…%w…ŽôÅ/Pcx(Òò؆¬€ t—ƒÒ¸ü¸}LØ}ªà„;µ'w³©¶ dþ QŽI‚°Âk:bIò8p ¨°}ð?v'týX’p’‚@fE_à†˜º¸ ¼ÐR òà.zf#%•F¯±#*± =ù‰?”•0G‰”$É„©X {ДkÐ3YPn0 ¸˜‹ÿ¥ ƒP\Zyaæ-ñ…W£u‰‘Œ `–=醬ð „0kùÒF”ÖÈ}p¹”•0 z yuyVuà"æ’ÍÀ ¼èfdfЮÙÜ_Õ'ðTõe(c‰ °˜g™|¬”„°’¹‡«Æjƹ”}P ¡0—tð™ša€iŽà_ 9G£` ` šÈþdƒÐºðº ©ðš¯¹-EP= RÀ;t»É›½Ù ¿é ¨@„à{Ÿs0 £ sŸ„ðЀx07tÃtÀ’ÍPÓÀ OX%Æ•ƒ` ¼À ÔpÜð ßÀ Ê ÊÀ à™ ‹Ðe€ž. ”&' ï ½™| p —  šà š£ê (}­£s—æ¼0 ª‹ÍР ¡ 1J .Èç¥ç TZ¥ ¢ái=ð”ô±À¢»É˜Ù†.çr2J£—Pjª¦2•G?º3hp‚ —|9GÓ  ˆ` !œP¡/ƒ€Šï@þ„J¨öÀìàêàæže`]Z_ ¦ðÙ˜mxv.ÇŒ ‡Ð©‡ S ê¦7†yà£0G¨:GÜàuðU"ú û¨´:¨…Jö«¹:îð ©P=¢0©_¦/š|“€©šª©žú© :J9§st  Ô™ªÚÀ ¦Pw°ª çð§µj«·ŠäZ®¹Ê¨©Pé¢0©-*¦óx©Êº¬œÚ©Ï ­¤3  Dšªâ  ¼Ð ‚H%`` ߀†á*®…Z®äº»öàº`.¢³Ð®îj¬–Ьóʬžz¯y| Cšª)6 Ê ´èc`0þ ²Z«·z«¹Z®û°ñ  Ð:9 K¬ï ¯Ìȱeª©2ú±ÏšG‰@Üà¯ÿÊ Ã@ \KÀ Ê à ¨ˆšµºª« [³üp³9h]Á³=›±•´—š©ôÚ¬G»A‰0 K‹ªâð¯ßàˆ^`Ð Èð­´Êê`€û î0¸ƒ;[»üðµæ` PrB¶e[¬;¦Bk ôZ¯ÎÚ¦xàžÀ Ó€])6·Úð ‚Àh5û ì@«ô È0 ¦` Ã0»º  ʸñàóÀ«ñ`ó ×n¹ïº±dª¶›Š¹™»¹û¹¡+ºÈðfÅЂÃþ « ¨ôÀß0 œ0à¾À ±; ¶k»°«~-x¹0¼+¹gÛ m¸ ÉŠ¼Ek¯ Ê¹ü:·üû¯Ñû”œñˆPµ¬ËæÐ Q`ª²ÀCp*f¾äydîW!´Ð¾û¾? ¯óK¿˜j¹›Ú¬Îꮀ ŸÛ¿åpÿ{VIÁ­ ºJ¨ê  œ•Ç(]é-5gXÑ%@ ì¾>;¹ñZ¹üÁ[¨€ ÚпâpÂÈà q Âc€Ðàƒ:¨‰ê½4Ì4 ‘z–Ž=ìÃL¶ïK©<¿|¹GœÄKÌ¿åàÄP|^c@ Ì ô ½Û»¸`ðf[™N¯–þ>,ÆÃK¬f|¬l¿˜‹ÄJlÂpüœPÂ#lÇ ;È€ÀìÕÇç˜WÀȹ0Æ<[Æ?k¼ÈмF\ž€ ÔPsûÆpÌtg æÀ1±Ì€Ù¶˜¼8V ›,Æž,  ¼˜«pÆ£l¿Zš Ö¬\é` Éà pZ—¤ î@Ë·jÀÐЪJŠžŒ!àË¿\ÁÁ<Ìg»Áõ«¶E« Iü­oœ®ë ‰` h®PÇw\¨ö0æÐÍ«W*ÄUÐÅ•™u*Ýb?ò…æ|Î Äf[̢ܱŒp5š È QêºÉ@ £ªÏæ0µ ÐÐ@ (þÒˆ°ÒœÐÒ-Ý ­ÐÒƒYöÃ1ñÐíÉ‘[È¢<´D;£ôÉ È€ Ì€ ž0p:‰à ³,³kÌ Ì€T=ÕT}ÕXMÕÐÐ 3]ÓUS 8-Æ·0Ö·@¶„ÊŸÐ jÆ>¼5Š pí šPÒ—¯‰€ÍÚLø°«ñÐ×}}€­‚=Ø„-Øò€ÐÀ f05S `mδР¶p ×à ¶PÖ;ÌŬ֬À ò+¯ˆŒ¦iJ×øê:‰ î`„J®»º»÷¸°Ûüд]Û´­ò ƒãbŽýØÆ` ·p € Âp ˜Í³g °ð ذ ÛàÙhþlÑÉ̦¡:}ž€Úªm®ÿl5ë°²MÛþ0ÞäíýèÐ ‹ÝÛ&ðÛÀM Â@ ¸€ ×` ƒL¬« Ø ß€ ÑýÙÇ\ÄFœ¹øŠ|à èÚö@³ÿüݲ=Ûåáþ ém,Ôî ÖÆßÔ  Õp ÉmÖÄ ÛP Ú@ Éð k ÚE¬¼ k஀†Ë°û°»^ÛãÝ^Þè­Þ¶DÑáÀ0ÜÅ- ¾p }Á“ªßÏ@ Õ° ¿ h{È-ζG˨ð 3n®€ýÚž¸:¾ã9ž‰½ØËá AþÛÀ°á¾p Gž ?,Ѳà Û Û€ RN¹T¾¶þF ªH3Û°ü }­€Þ¶èúò°º…æBn ¹Ð ÈqNÆ_j ¿Ðé°´ìŒÌVš° €Þ°øPãñ@Õò ñPØ…².ë¾Õ¹}á ’îÞæl ç,ÈJ ² ÅLÑzN¿m  ºÌ§î°©~ò° ®à Û°Ö~íØŽíÐ°í®€ÙIW¡ëºžá Ùœ,ÑðkÈ{N´lkÊë0ã5«í`ωPïž0íÓžÒú¾ÒuP¥˜WBâ¾ëÑ ÀPäšþ¥²€ÖzÞÎ|Þ©—ð íp þ°ƒ¾G š ÉÏSò«çcÚùþäÒÐ ÄÐ ¾þÐÆÀÉ:-ì¶0ì« ÄìœÆ~ Û óààñ° ÔüÊè5*VaàÜÝ îÑ Ç° Âà ÇÐòécl ¾p ×€ –]óë<ݤ,ñ¦ÞóíÛ  Õ¬ÂDß'~ò ÝôhÎáÚ` Ë@ Roîè| ¾0Ï` êP € ¶¦ÆàËzð ãðÚ^ í¨Àø,Ç饧¦mŸôÒ Ö° ¸P Ëp +ÜÁÝÉ<ÜÏ Ïû§ã0óŸÖ^ßâ¯7.ïGíDB?ôqM±YÄ•«©—€ òpŸ¸òþ ~`iµŸ^¸Ï^•ß Ñp Ï  &« 'n ÕP àð íÏ<Ϩo ðÛõ,ά°óظ°±M“ GifarView IcedTea Gifar issue Gifar.jar icedtea-web-1.5.3/tests/reproducers/signed/GifarBase/resources/PaxHeaders.24993/gifar_applet.jnlp0000644000000000000000000000013112574544466027607 xustar0030 mtime=1441974582.528016359 29 atime=1441974656.50586793 30 ctime=1441974670.115024587 icedtea-web-1.5.3/tests/reproducers/signed/GifarBase/resources/gifar_applet.jnlp0000664000076400007640000000447012574544466030676 0ustar00jvanekjvanek00000000000000 GifarView IcedTea Gifar issue icedtea-web-1.5.3/tests/reproducers/signed/GifarBase/resources/PaxHeaders.24993/gifarView_ok.html0000644000000000000000000000013112574544466027567 xustar0030 mtime=1441974582.527016347 29 atime=1441974656.50586793 30 ctime=1441974670.115024587 icedtea-web-1.5.3/tests/reproducers/signed/GifarBase/resources/gifarView_ok.html0000664000076400007640000000376212574544466030661 0ustar00jvanekjvanek00000000000000

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

icedtea-web-1.5.3/tests/reproducers/signed/GifarBase/resources/PaxHeaders.24993/gifarView_hacked.htm0000644000000000000000000000013212574544466030222 xustar0030 mtime=1441974582.527016347 30 atime=1441974656.504867919 30 ctime=1441974670.115024587 icedtea-web-1.5.3/tests/reproducers/signed/GifarBase/resources/gifarView_hacked.html0000664000076400007640000000375612574544466031472 0ustar00jvanekjvanek00000000000000

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

icedtea-web-1.5.3/tests/reproducers/signed/PaxHeaders.24993/ExtensionJnlp0000644000000000000000000000013212574544466023154 xustar0030 mtime=1441974582.527016347 30 atime=1441974670.154025036 30 ctime=1441974670.115024587 icedtea-web-1.5.3/tests/reproducers/signed/ExtensionJnlp/0000775000076400007640000000000012574544466024312 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/ExtensionJnlp/PaxHeaders.24993/testcases0000644000000000000000000000013212574544466025152 xustar0030 mtime=1441974582.527016347 30 atime=1441974670.154025036 30 ctime=1441974670.115024587 icedtea-web-1.5.3/tests/reproducers/signed/ExtensionJnlp/testcases/0000775000076400007640000000000012574544466026310 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/ExtensionJnlp/testcases/PaxHeaders.24993/ExtensionJnlpTes0000644000000000000000000000013212574544466030426 xustar0030 mtime=1441974582.527016347 30 atime=1441974656.504867919 30 ctime=1441974670.115024587 icedtea-web-1.5.3/tests/reproducers/signed/ExtensionJnlp/testcases/ExtensionJnlpTest.java0000664000076400007640000000757012574544466032624 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/signed/ExtensionJnlp/PaxHeaders.24993/resources0000644000000000000000000000013212574544466025166 xustar0030 mtime=1441974582.526016336 30 atime=1441974670.154025036 30 ctime=1441974670.115024587 icedtea-web-1.5.3/tests/reproducers/signed/ExtensionJnlp/resources/0000775000076400007640000000000012574544466026324 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/ExtensionJnlp/resources/PaxHeaders.24993/UsesSignedJnlpJa0000644000000000000000000000032212574544466030337 xustar00120 path=icedtea-web-1.5.3/tests/reproducers/signed/ExtensionJnlp/resources/UsesSignedJnlpJarAndSignedJarExtension.jnlp 30 mtime=1441974582.526016336 30 atime=1441974656.504867919 30 ctime=1441974670.115024587 icedtea-web-1.5.3/tests/reproducers/signed/ExtensionJnlp/resources/UsesSignedJnlpJarAndSignedJarExte0000664000076400007640000000505512574544466034646 0ustar00jvanekjvanek00000000000000 UsesSignedJnlpJarAndSignedJarExtension IcedTea UsesSignedJnlpJarAndSignedJarExtension icedtea-web-1.5.3/tests/reproducers/signed/ExtensionJnlp/resources/PaxHeaders.24993/UsesSignedJnlpEx0000644000000000000000000000013212574544466030360 xustar0030 mtime=1441974582.526016336 30 atime=1441974656.504867919 30 ctime=1441974670.115024587 icedtea-web-1.5.3/tests/reproducers/signed/ExtensionJnlp/resources/UsesSignedJnlpExtension.jnlp0000664000076400007640000000471112574544466034006 0ustar00jvanekjvanek00000000000000 UsesSignedJnlpExtension IcedTea UsesSignedJnlpExtension icedtea-web-1.5.3/tests/reproducers/signed/ExtensionJnlp/resources/PaxHeaders.24993/UsesSignedJnlp.j0000644000000000000000000000013212574544466030313 xustar0030 mtime=1441974582.526016336 30 atime=1441974656.503867907 30 ctime=1441974670.115024587 icedtea-web-1.5.3/tests/reproducers/signed/ExtensionJnlp/resources/UsesSignedJnlp.jnlp0000664000076400007640000000465012574544466032113 0ustar00jvanekjvanek00000000000000 UsesSignedJnlp IcedTea UsesSignedJnlp icedtea-web-1.5.3/tests/reproducers/signed/ExtensionJnlp/resources/PaxHeaders.24993/UsesSignedJarExt0000644000000000000000000000013212574544466030355 xustar0030 mtime=1441974582.525016324 30 atime=1441974656.503867907 30 ctime=1441974670.115024587 icedtea-web-1.5.3/tests/reproducers/signed/ExtensionJnlp/resources/UsesSignedJarExtension.jnlp0000664000076400007640000000464212574544466033622 0ustar00jvanekjvanek00000000000000 UseSignedJarExtension IcedTea UseSignedJarExtension icedtea-web-1.5.3/tests/reproducers/signed/ExtensionJnlp/resources/PaxHeaders.24993/UsesSignedJar.jn0000644000000000000000000000013212574544466030302 xustar0030 mtime=1441974582.525016324 30 atime=1441974656.503867907 30 ctime=1441974670.115024587 icedtea-web-1.5.3/tests/reproducers/signed/ExtensionJnlp/resources/UsesSignedJar.jnlp0000664000076400007640000000466612574544466031733 0ustar00jvanekjvanek00000000000000 UsesSignedJar IcedTea UsesSignedJar icedtea-web-1.5.3/tests/reproducers/signed/PaxHeaders.24993/EmptySignedJar0000644000000000000000000000013212574544466023241 xustar0030 mtime=1441974582.525016324 30 atime=1441974670.154025036 30 ctime=1441974670.115024587 icedtea-web-1.5.3/tests/reproducers/signed/EmptySignedJar/0000775000076400007640000000000012574544466024377 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/EmptySignedJar/PaxHeaders.24993/testcases0000644000000000000000000000013212574544466025237 xustar0030 mtime=1441974582.525016324 30 atime=1441974670.154025036 30 ctime=1441974670.115024587 icedtea-web-1.5.3/tests/reproducers/signed/EmptySignedJar/testcases/0000775000076400007640000000000012574544466026375 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/EmptySignedJar/testcases/PaxHeaders.24993/EmptySignedJarT0000644000000000000000000000013212574544466030250 xustar0030 mtime=1441974582.525016324 30 atime=1441974656.503867907 30 ctime=1441974670.115024587 icedtea-web-1.5.3/tests/reproducers/signed/EmptySignedJar/testcases/EmptySignedJarTest.java0000664000076400007640000000612712574544466032773 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/signed/EmptySignedJar/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466024213 xustar0030 mtime=1441974582.524016313 30 atime=1441974670.154025036 30 ctime=1441974670.115024587 icedtea-web-1.5.3/tests/reproducers/signed/EmptySignedJar/srcs/0000775000076400007640000000000012574544466025351 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/EmptySignedJar/srcs/PaxHeaders.24993/META-INF0000644000000000000000000000013212574544466025353 xustar0030 mtime=1441974582.524016313 30 atime=1441974670.154025036 30 ctime=1441974670.115024587 icedtea-web-1.5.3/tests/reproducers/signed/EmptySignedJar/srcs/META-INF/0000775000076400007640000000000012574544466026511 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/EmptySignedJar/srcs/META-INF/PaxHeaders.24993/empty_file0000644000000000000000000000013212574544466027510 xustar0030 mtime=1441974582.524016313 30 atime=1441974656.502867896 30 ctime=1441974670.115024587 icedtea-web-1.5.3/tests/reproducers/signed/EmptySignedJar/srcs/META-INF/empty_file0000664000076400007640000000002712574544466030570 0ustar00jvanekjvanek00000000000000This is an empty file. icedtea-web-1.5.3/tests/reproducers/signed/EmptySignedJar/PaxHeaders.24993/resources0000644000000000000000000000013212574544466025253 xustar0030 mtime=1441974582.524016313 30 atime=1441974670.154025036 30 ctime=1441974670.115024587 icedtea-web-1.5.3/tests/reproducers/signed/EmptySignedJar/resources/0000775000076400007640000000000012574544466026411 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/EmptySignedJar/resources/PaxHeaders.24993/EmptySignedJarI0000644000000000000000000000031212574544466030251 xustar00112 path=icedtea-web-1.5.3/tests/reproducers/signed/EmptySignedJar/resources/EmptySignedJarInLaunchingJnlp.jnlp 30 mtime=1441974582.524016313 30 atime=1441974656.502867896 30 ctime=1441974670.115024587 icedtea-web-1.5.3/tests/reproducers/signed/EmptySignedJar/resources/EmptySignedJarInLaunchingJnlp.jn0000664000076400007640000000500512574544466034573 0ustar00jvanekjvanek00000000000000 EmptySignedJar IcedTea EmptySignedJar icedtea-web-1.5.3/tests/reproducers/signed/EmptySignedJar/resources/PaxHeaders.24993/EmptySignedJarI0000644000000000000000000000031212574544466030251 xustar00112 path=icedtea-web-1.5.3/tests/reproducers/signed/EmptySignedJar/resources/EmptySignedJarInExtensionJnlp.jnlp 30 mtime=1441974582.524016313 30 atime=1441974656.502867896 30 ctime=1441974670.115024587 icedtea-web-1.5.3/tests/reproducers/signed/EmptySignedJar/resources/EmptySignedJarInExtensionJnlp.jn0000664000076400007640000000502112574544466034635 0ustar00jvanekjvanek00000000000000 EmptySignedJar IcedTea EmptySignedJar icedtea-web-1.5.3/tests/reproducers/signed/EmptySignedJar/resources/PaxHeaders.24993/EmptySignedJarE0000644000000000000000000000013212574544466030245 xustar0030 mtime=1441974582.524016313 30 atime=1441974656.502867896 30 ctime=1441974670.115024587 icedtea-web-1.5.3/tests/reproducers/signed/EmptySignedJar/resources/EmptySignedJarExtension.jnlp0000664000076400007640000000451412574544466034064 0ustar00jvanekjvanek00000000000000 EmptySignedJarExtension IcedTea EmptySignedJarExtension icedtea-web-1.5.3/tests/reproducers/signed/PaxHeaders.24993/DownloadService0000644000000000000000000000013212574544466023444 xustar0030 mtime=1441974582.523016301 30 atime=1441974670.154025036 30 ctime=1441974670.115024587 icedtea-web-1.5.3/tests/reproducers/signed/DownloadService/0000775000076400007640000000000012574544466024602 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/DownloadService/PaxHeaders.24993/testcases0000644000000000000000000000013212574544466025442 xustar0030 mtime=1441974582.523016301 30 atime=1441974670.154025036 30 ctime=1441974670.115024587 icedtea-web-1.5.3/tests/reproducers/signed/DownloadService/testcases/0000775000076400007640000000000012574544466026600 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/DownloadService/testcases/PaxHeaders.24993/DownloadServic0000644000000000000000000000013212574544466030365 xustar0030 mtime=1441974582.523016301 30 atime=1441974656.501867884 30 ctime=1441974670.114024576 icedtea-web-1.5.3/tests/reproducers/signed/DownloadService/testcases/DownloadServiceTest.java0000664000076400007640000004353012574544466033400 0ustar00jvanekjvanek00000000000000/* 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 ServerAccess server = new ServerAccess(); private final String exitString = "Exiting DownloadService.."; private static List checkCache = new ArrayList(); private static List manageJnlpResources = new ArrayList(); private static List manageExternalResources = new ArrayList(); @BeforeClass public static void initalizeClass() throws MalformedURLException { //Check Cache checkCache.add(server.getJavawsLocation()); checkCache.add("-arg"); checkCache.add(server.getUrl().toString() + "/"); checkCache.add("-arg"); checkCache.add("checkCache"); checkCache.add("-Xtrustall"); checkCache.add(ServerAccess.HEADLES_OPTION); checkCache.add(server.getUrl() + "/DownloadService.jnlp"); //Manage Jnlp Resouces manageJnlpResources.add(server.getJavawsLocation()); manageJnlpResources.add("-arg"); manageJnlpResources.add(server.getUrl().toString() + "/"); manageJnlpResources.add("-arg"); manageJnlpResources.add("manageJnlpJars"); manageJnlpResources.add("-Xtrustall"); manageJnlpResources.add(ServerAccess.HEADLES_OPTION); manageJnlpResources.add(server.getUrl() + "/DownloadService.jnlp"); //Manage External Resources manageExternalResources.add(server.getJavawsLocation()); manageExternalResources.add("-arg"); manageExternalResources.add(server.getUrl().toString() + "/"); manageExternalResources.add("-arg"); manageExternalResources.add("manageExternalJars"); manageExternalResources.add("-Xtrustall"); manageExternalResources.add(ServerAccess.HEADLES_OPTION); manageExternalResources.add(server.getUrl() + "/DownloadService.jnlp"); } /** * Executes reproducer to checks if DownloadServices's cache checks are working correctly. * @return stdout of reproducer. */ private String runCacheCheckTests() throws Exception { //Check cache test ProcessResult processResult = ServerAccess.executeProcess(checkCache); String stdoutCheckCache = processResult.stdout; Assert.assertTrue("CheckCache - DownloadServiceRunner instance did not close as expected, this test may fail.", stdoutCheckCache.contains(exitString)); return stdoutCheckCache; } /** * Executes reproducer to checks if DownloadServices's management of external jars are working correctly. * @return stdout of reproducer. */ private String runExternalTests() throws Exception { ProcessResult processResult = ServerAccess.executeProcess(manageExternalResources); String stdoutExternalResources = processResult.stdout; Assert.assertTrue("ManageExternalResources - DownloadServiceRunner instance did not close as expected, this test may fail.", stdoutExternalResources.contains(exitString)); return stdoutExternalResources; } /** * Executes reproducer to checks if DownloadServices's management of jnlp jars are working correctly. * @return stdout of reproducer. */ private String runJnlpResourceTests() throws Exception { ProcessResult processResult = ServerAccess.executeProcess(manageJnlpResources); String stdoutJnlpResources = processResult.stdout; Assert.assertTrue("ManageJnlpResources - DownloadServiceRunner instance did not close as expected, this test may fail.", stdoutJnlpResources.contains(exitString)); return stdoutJnlpResources; } @Test public void checkIfRequiredResourcesExist() { //Jnlp files Assert.assertTrue("DownloadService.jnlp is a required resource that's missing.", new File(server.getDir().getAbsolutePath() + "/DownloadService.jnlp").isFile()); Assert.assertTrue("DownloadServiceExtension.jnlp is a required resource that's missing.", new File(server.getDir().getAbsolutePath() + "/DownloadServiceExtension.jnlp").isFile()); //Jar files Assert.assertTrue("DownloadService.jar is a required resource that's missing.", new File(server.getDir().getAbsolutePath() + "/DownloadService.jar").isFile()); Assert.assertTrue("SignedJnlpResource.jar is a required resource that's missing.", new File(server.getDir().getAbsolutePath() + "/SignedJnlpResource.jar").isFile()); Assert.assertTrue("SignedJarResource.jar is a required resource that's missing.", new File(server.getDir().getAbsolutePath() + "/SignedJarResource.jar").isFile()); Assert.assertTrue("MultiJar-NoSignedJnlp.jar is a required resource that's missing.", new File(server.getDir().getAbsolutePath() + "/MultiJar-NoSignedJnlp.jar").isFile()); } @Test public void testcheckCaches() throws Exception { String stdoutCheckCache = runCacheCheckTests(); //Stdout validations String s = "CHECKCACHE-isPartCached: LaunchPartOne: true"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutCheckCache.contains(s)); s = "CHECKCACHE-isPartCached: LaunchPartTwo: true"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutCheckCache.contains(s)); s = "CHECKCACHE-isPartCached: NonExistingPart: false"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutCheckCache.contains(s)); } @Test public void testcheckCachesUsingArray() throws Exception { String stdoutCheckCache = runCacheCheckTests(); //Stdout validations String s = "CHECKCACHEUSINGMUTIPLEPARTS-isPartCached(Array): ValidLaunchParts: true"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutCheckCache.contains(s)); s = "CHECKCACHEUSINGMUTIPLEPARTS-isPartCached(Array): HalfValidLaunchParts: false"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutCheckCache.contains(s)); s = "CHECKCACHEUSINGMUTIPLEPARTS-isPartCached(Array): InvalidParts: false"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutCheckCache.contains(s)); } @Test public void testExtensioncheckCaches() throws Exception { String stdoutCheckCache = runCacheCheckTests(); //Stdout validations String s = "CHECKEXTENSIONCACHE-isExtensionPartCached: ExtensionPartOne: true"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutCheckCache.contains(s)); s = "CHECKEXTENSIONCACHE-isExtensionPartCached: NonExistingPart: false"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutCheckCache.contains(s)); s = "CHECKEXTENSIONCACHE-isExtensionPartCached: NonExistingUrl: false"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutCheckCache.contains(s)); } @Test public void testExtensioncheckCachesUsingArray() throws Exception { String stdoutCheckCache = runCacheCheckTests(); //Stdout validations String s = "CHECKEXTENSIONCACHEUSINGMUTIPLEPARTS-isExtensionPartCached(Array): ValidExtensionParts: true"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutCheckCache.contains(s)); s = "CHECKEXTENSIONCACHEUSINGMUTIPLEPARTS-isExtensionPartCached(Array): HalfValidExtensionParts: false"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutCheckCache.contains(s)); s = "CHECKEXTENSIONCACHEUSINGMUTIPLEPARTS-isExtensionPartCached(Array): InvalidParts: false"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutCheckCache.contains(s)); } @Test public void testExternalResourceChecks() throws Exception { runCacheCheckTests(); String stdoutExternalResources = runExternalTests(); //Stdout validations //This is automatically cached from the test engine because the .jar exists String s = "CHECKEXTERNALCACHE-isResourceCached: UrlToExternalResource: true"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutExternalResources.contains(s)); s = "CHECKEXTERNALCACHE-isResourceCached: NonExistingUrl: false"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutExternalResources.contains(s)); } @Test public void testRemovePart() throws Exception { runCacheCheckTests(); String stdoutJnlpResources = runJnlpResourceTests(); String s = "REMOVEPART-removePart: LaunchPartOne-BEFORE: true"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); s = "REMOVEPART-removePart: LaunchPartOne-AFTER: false"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); s = "REMOVEPART-removePart: LaunchPartTwo-BEFORE: true"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); s = "REMOVEPART-removePart: LaunchPartTwo-AFTER: false"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); } @Test public void testRemoveExtensionPart() throws Exception { runCacheCheckTests(); String stdoutJnlpResources = runJnlpResourceTests(); //Stdout validations String s = "REMOVEEXTENSIONPART-removeExtensionPart: ExtensionPartOne-BEFORE: true"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); s = "REMOVEEXTENSIONPART-removeExtensionPart: ExtensionPartOne-AFTER: false"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); } @Test public void testRemoveExtensionPartUsingArray() throws Exception { runCacheCheckTests(); String stdoutJnlpResources = runJnlpResourceTests(); //Stdout validations String s = "REMOVEEXTENSIONUSINGVALIDPARTINARRAY-removeExtensionPart(Array): ValidExtensionParts-BEFORE: true"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); s = "REMOVEEXTENSIONUSINGVALIDPARTINARRAY-removeExtensionPart(Array): ValidExtensionParts-AFTER: false"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); s = "REMOVEEXTENSIONUSINGHALFVALIDPARTINARRAY-removeExtensionPart(Array): HalfValidExtensionParts-BEFORE: true"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); s = "REMOVEEXTENSIONUSINGHALFVALIDPARTINARRAY-removeExtensionPart(Array): HalfValidExtensionParts-AFTER: false"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); } @Test public void testRemoveExternalResource() throws Exception { runCacheCheckTests(); String stdoutExternalResources = runExternalTests(); //Stdout validations String s = "REMOVEEXTERNALPART-removeResource: UrlToExternalResource-BEFORE: true"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutExternalResources.contains(s)); s = "REMOVEEXTERNALPART-removeResource: UrlToExternalResource-AFTER: false"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutExternalResources.contains(s)); } @Test public void testLoadPart() throws Exception { runCacheCheckTests(); String stdoutJnlpResources = runJnlpResourceTests(); //Stdout validations //Part 'one' String s = "LOADPART-loadPart: LaunchPartOne-BEFORE: false"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); s = "LOADPART-loadPart: LaunchPartOne-AFTER: true"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); //Part 'two' s = "LOADPART-loadPart: LaunchPartTwo-BEFORE: false"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); s = "LOADPART-loadPart: LaunchPartTwo-AFTER: true"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); } @Test public void testLoadExtensionPart() throws Exception { runCacheCheckTests(); String stdoutJnlpResources = runJnlpResourceTests(); //Stdout validations String s = "LOADEXTENSIONPART-loadExtensionPart: ExtensionPartOne-BEFORE: false"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); s = "LOADEXTENSIONPART-loadExtensionPart: ExtensionPartOne-AFTER: true"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); } @Test public void testLoadExtensionPartUsingArray() throws Exception { runCacheCheckTests(); String stdoutJnlpResources = runJnlpResourceTests(); //Stdout validations String s = "LOADEXTENSIONUSINGVALIDPARTINARRAY-loadExtensionPart(Array): ValidExtensionParts-BEFORE: false"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); s = "LOADEXTENSIONUSINGVALIDPARTINARRAY-loadExtensionPart(Array): ValidExtensionParts-AFTER: true"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); s = "LOADEXTENSIONUSINGHALFVALIDPARTINARRAY-loadExtensionPart(Array): HalfValidExtensionParts-BEFORE: false"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); s = "LOADEXTENSIONUSINGHALFVALIDPARTINARRAY-loadExtensionPart(Array): HalfValidExtensionParts-AFTER: true"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); } @Test public void testLoadExternalResource() throws Exception { runCacheCheckTests(); String stdoutExternalResources = runExternalTests(); //Stdout validations String s = "LOADEXTERNALRESOURCE-loadResource: UrlToExternalResource-BEFORE: false"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutExternalResources.contains(s)); s = "LOADEXTERNALRESOURCE-loadResource: UrlToExternalResource-AFTER: true"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutExternalResources.contains(s)); } @Test public void testRepeatedlyLoadingAndUnloadingJnlpResources() throws Exception { runCacheCheckTests(); String stdoutJnlpResources = runJnlpResourceTests(); //Stdout validations String s = "MULTIPLEMETHODCALLS - removePart: LaunchPartOne: false"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); s = "MULTIPLEMETHODCALLS - loadPart: LaunchPartOne: true"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutJnlpResources.contains(s)); } @Test public void testRepeatedlyLoadingAndUnloadingExternalResources() throws Exception { runCacheCheckTests(); String stdoutExternalResources = runExternalTests(); //Stdout validations String s = "MULTIPLEMETHODCALLS - removeResource: UrlToExternalResource: false"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutExternalResources.contains(s)); s = "MULTIPLEMETHODCALLS - loadResource: UrlToExternalResource: true"; Assert.assertTrue("stdout should contain \"" + s + "\" but did not.", stdoutExternalResources.contains(s)); } } icedtea-web-1.5.3/tests/reproducers/signed/DownloadService/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466024416 xustar0030 mtime=1441974582.523016301 30 atime=1441974670.154025036 30 ctime=1441974670.114024576 icedtea-web-1.5.3/tests/reproducers/signed/DownloadService/srcs/0000775000076400007640000000000012574544466025554 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/DownloadService/srcs/PaxHeaders.24993/DownloadServiceRunn0000644000000000000000000000013212574544466030351 xustar0030 mtime=1441974582.523016301 30 atime=1441974656.501867884 30 ctime=1441974670.114024576 icedtea-web-1.5.3/tests/reproducers/signed/DownloadService/srcs/DownloadServiceRunner.java0000664000076400007640000004123412574544466032705 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/signed/DownloadService/PaxHeaders.24993/resources0000644000000000000000000000013112574544466025455 xustar0029 mtime=1441974582.52201629 30 atime=1441974670.154025036 30 ctime=1441974670.114024576 icedtea-web-1.5.3/tests/reproducers/signed/DownloadService/resources/0000775000076400007640000000000012574544466026614 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/DownloadService/resources/PaxHeaders.24993/DownloadServic0000644000000000000000000000013112574544466030400 xustar0029 mtime=1441974582.52201629 30 atime=1441974656.501867884 30 ctime=1441974670.114024576 icedtea-web-1.5.3/tests/reproducers/signed/DownloadService/resources/DownloadServiceExtension.jnlp0000664000076400007640000000457712574544466034503 0ustar00jvanekjvanek00000000000000 DownloadServiceExtension IcedTea DownloadServiceExtension icedtea-web-1.5.3/tests/reproducers/signed/DownloadService/resources/PaxHeaders.24993/DownloadServic0000644000000000000000000000013112574544466030400 xustar0029 mtime=1441974582.52201629 30 atime=1441974656.501867884 30 ctime=1441974670.114024576 icedtea-web-1.5.3/tests/reproducers/signed/DownloadService/resources/DownloadService.jnlp0000664000076400007640000000503712574544466032576 0ustar00jvanekjvanek00000000000000 DownloadService IcedTea DownloadService icedtea-web-1.5.3/tests/reproducers/signed/PaxHeaders.24993/DeploymentPropertiesAreExposed0000644000000000000000000000013112574544466026530 xustar0029 mtime=1441974582.52201629 30 atime=1441974670.154025036 30 ctime=1441974670.114024576 icedtea-web-1.5.3/tests/reproducers/signed/DeploymentPropertiesAreExposed/0000775000076400007640000000000012574544466027667 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/DeploymentPropertiesAreExposed/PaxHeaders.24993/testcases0000644000000000000000000000013112574544466030526 xustar0029 mtime=1441974582.52201629 30 atime=1441974670.154025036 30 ctime=1441974670.114024576 icedtea-web-1.5.3/tests/reproducers/signed/DeploymentPropertiesAreExposed/testcases/0000775000076400007640000000000012574544466031665 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/DeploymentPropertiesAreExposed/testcases/PaxHeaders.249930000644000000000000000000000033612574544466030535 xustar00133 path=icedtea-web-1.5.3/tests/reproducers/signed/DeploymentPropertiesAreExposed/testcases/DeploymentPropertiesAreExposedTest.java 29 mtime=1441974582.52201629 30 atime=1441974656.500867873 30 ctime=1441974670.114024576 icedtea-web-1.5.3/tests/reproducers/signed/DeploymentPropertiesAreExposed/testcases/DeploymentProper0000664000076400007640000000552412574544466035126 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/signed/DeploymentPropertiesAreExposed/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466027503 xustar0030 mtime=1441974582.521016278 30 atime=1441974670.154025036 30 ctime=1441974670.114024576 icedtea-web-1.5.3/tests/reproducers/signed/DeploymentPropertiesAreExposed/srcs/0000775000076400007640000000000012574544466030641 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/DeploymentPropertiesAreExposed/srcs/PaxHeaders.24993/Test0000644000000000000000000000013212574544466030422 xustar0030 mtime=1441974582.521016278 30 atime=1441974656.500867873 30 ctime=1441974670.114024576 icedtea-web-1.5.3/tests/reproducers/signed/DeploymentPropertiesAreExposed/srcs/Test.java0000664000076400007640000000336412574544466032431 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/signed/DeploymentPropertiesAreExposed/PaxHeaders.24993/resources0000644000000000000000000000013212574544466030543 xustar0030 mtime=1441974582.521016278 30 atime=1441974670.154025036 30 ctime=1441974670.114024576 icedtea-web-1.5.3/tests/reproducers/signed/DeploymentPropertiesAreExposed/resources/0000775000076400007640000000000012574544466031701 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/DeploymentPropertiesAreExposed/resources/PaxHeaders.249930000644000000000000000000000033312574544466030546 xustar00129 path=icedtea-web-1.5.3/tests/reproducers/signed/DeploymentPropertiesAreExposed/resources/DeploymentPropertiesAreExposed.jnlp 30 mtime=1441974582.521016278 30 atime=1441974656.500867873 30 ctime=1441974670.114024576 icedtea-web-1.5.3/tests/reproducers/signed/DeploymentPropertiesAreExposed/resources/DeploymentProper0000664000076400007640000000406512574544466035141 0ustar00jvanekjvanek00000000000000 Verify that deployment configuration properties are exposed IcedTea icedtea-web-1.5.3/tests/reproducers/signed/PaxHeaders.24993/CustomPolicy0000644000000000000000000000013212574544466023006 xustar0030 mtime=1441974582.520016267 30 atime=1441974670.154025036 30 ctime=1441974670.114024576 icedtea-web-1.5.3/tests/reproducers/signed/CustomPolicy/0000775000076400007640000000000012574544466024144 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/CustomPolicy/PaxHeaders.24993/testcases0000644000000000000000000000013212574544466025004 xustar0030 mtime=1441974582.520016267 30 atime=1441974670.154025036 30 ctime=1441974670.114024576 icedtea-web-1.5.3/tests/reproducers/signed/CustomPolicy/testcases/0000775000076400007640000000000012574544466026142 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/CustomPolicy/testcases/PaxHeaders.24993/CustomPolicyTests0000644000000000000000000000013212574544466030461 xustar0030 mtime=1441974582.520016267 30 atime=1441974656.500867873 30 ctime=1441974670.114024576 icedtea-web-1.5.3/tests/reproducers/signed/CustomPolicy/testcases/CustomPolicyTests.java0000664000076400007640000000522112574544466032462 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/signed/CustomPolicy/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466023760 xustar0030 mtime=1441974582.520016267 30 atime=1441974670.154025036 30 ctime=1441974670.114024576 icedtea-web-1.5.3/tests/reproducers/signed/CustomPolicy/srcs/0000775000076400007640000000000012574544466025116 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/CustomPolicy/srcs/PaxHeaders.24993/CustomPolicy.java0000644000000000000000000000013212574544466027332 xustar0030 mtime=1441974582.520016267 30 atime=1441974656.499867861 30 ctime=1441974670.114024576 icedtea-web-1.5.3/tests/reproducers/signed/CustomPolicy/srcs/CustomPolicy.java0000664000076400007640000000702312574544466030415 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/signed/CustomPolicy/PaxHeaders.24993/resources0000644000000000000000000000013212574544466025020 xustar0030 mtime=1441974582.520016267 30 atime=1441974670.154025036 30 ctime=1441974670.114024576 icedtea-web-1.5.3/tests/reproducers/signed/CustomPolicy/resources/0000775000076400007640000000000012574544466026156 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/CustomPolicy/resources/PaxHeaders.24993/CustomPolicy.jnlp0000644000000000000000000000013212574544466030414 xustar0030 mtime=1441974582.520016267 30 atime=1441974656.499867861 30 ctime=1441974670.114024576 icedtea-web-1.5.3/tests/reproducers/signed/CustomPolicy/resources/CustomPolicy.jnlp0000664000076400007640000000401512574544466031475 0ustar00jvanekjvanek00000000000000 CustomPolicy IcedTea icedtea-web-1.5.3/tests/reproducers/signed/PaxHeaders.24993/CountingAppletSigned0000644000000000000000000000013212574544466024442 xustar0030 mtime=1441974582.519016255 30 atime=1441974670.154025036 30 ctime=1441974670.114024576 icedtea-web-1.5.3/tests/reproducers/signed/CountingAppletSigned/0000775000076400007640000000000012574544466025600 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/CountingAppletSigned/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466025414 xustar0030 mtime=1441974582.519016255 30 atime=1441974670.154025036 30 ctime=1441974670.114024576 icedtea-web-1.5.3/tests/reproducers/signed/CountingAppletSigned/srcs/0000775000076400007640000000000012574544466026552 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/CountingAppletSigned/srcs/PaxHeaders.24993/CountingApplet0000644000000000000000000000013212574544466030350 xustar0030 mtime=1441974582.519016255 30 atime=1441974656.499867861 30 ctime=1441974670.114024576 icedtea-web-1.5.3/tests/reproducers/signed/CountingAppletSigned/srcs/CountingAppletSigned.java0000664000076400007640000000667712574544466033523 0ustar00jvanekjvanek00000000000000 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.5.3/tests/reproducers/signed/PaxHeaders.24993/CodeBaseManifestEntrySignedNotMatching0000644000000000000000000000013212574544466030020 xustar0030 mtime=1441974582.519016255 30 atime=1441974670.154025036 30 ctime=1441974670.114024576 icedtea-web-1.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedNotMatching/0000775000076400007640000000000012574544466031156 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedNotMatching/PaxHeaders.24993/s0000644000000000000000000000013212574544466030262 xustar0030 mtime=1441974582.519016255 30 atime=1441974670.154025036 30 ctime=1441974670.114024576 icedtea-web-1.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedNotMatching/srcs/0000775000076400007640000000000012574544466032130 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedNotMatching/srcs/PaxHeaders.240000644000000000000000000000013212574544466030525 xustar0030 mtime=1441974582.519016255 30 atime=1441974670.154025036 30 ctime=1441974670.114024576 icedtea-web-1.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedNotMatching/srcs/META-INF/0000775000076400007640000000000012574544466033270 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedNotMatching/srcs/META-INF/PaxH0000644000000000000000000000031712574544466030262 xustar00117 path=icedtea-web-1.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedNotMatching/srcs/META-INF/MANIFEST.MF 30 mtime=1441974582.519016255 30 atime=1441974656.499867861 30 ctime=1441974670.114024576 icedtea-web-1.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedNotMatching/srcs/META-INF/MANI0000664000076400007640000000010312574544466033731 0ustar00jvanekjvanek00000000000000Manifest-Version: 1.0 Codebase: somthingWhatShould mustNeverMatch icedtea-web-1.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedNotMatching/srcs/PaxHeaders.240000644000000000000000000000034612574544466030534 xustar00140 path=icedtea-web-1.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedNotMatching/srcs/CodeBaseManifestEntrySignedNotMatching.java 30 mtime=1441974582.519016255 30 atime=1441974656.498867849 30 ctime=1441974670.114024576 icedtea-web-1.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedNotMatching/srcs/CodeBaseManif0000664000076400007640000000454412574544466034502 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedNotMatching/PaxHeaders.24993/r0000644000000000000000000000013212574544466030261 xustar0030 mtime=1441974582.518016244 30 atime=1441974670.154025036 30 ctime=1441974670.114024576 icedtea-web-1.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedNotMatching/resources/0000775000076400007640000000000012574544466033170 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedNotMatching/resources/PaxHeade0000644000000000000000000000035712574544466031005 xustar00149 path=icedtea-web-1.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedNotMatching/resources/CodeBaseManifestEntrySignedNotMatchingJnlp.html 30 mtime=1441974582.518016244 30 atime=1441974656.498867849 30 ctime=1441974670.114024576 icedtea-web-1.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedNotMatching/resources/CodeBase0000664000076400007640000000354512574544466034567 0ustar00jvanekjvanek00000000000000 icedtea-web-1.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedNotMatching/resources/PaxHeade0000644000000000000000000000036112574544466031000 xustar00151 path=icedtea-web-1.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedNotMatching/resources/CodeBaseManifestEntrySignedNotMatchingApplet.jnlp 30 mtime=1441974582.518016244 30 atime=1441974656.498867849 30 ctime=1441974670.114024576 icedtea-web-1.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedNotMatching/resources/CodeBase0000664000076400007640000000463312574544466034566 0ustar00jvanekjvanek00000000000000 Classpath Manifest Applet Test IcedTea ClasspathManifest icedtea-web-1.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedNotMatching/resources/PaxHeade0000644000000000000000000000035312574544466031001 xustar00145 path=icedtea-web-1.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedNotMatching/resources/CodeBaseManifestEntrySignedNotMatching.jnlp 30 mtime=1441974582.518016244 30 atime=1441974656.498867849 30 ctime=1441974670.114024576 icedtea-web-1.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedNotMatching/resources/CodeBase0000664000076400007640000000443412574544466034565 0ustar00jvanekjvanek00000000000000 ClasspathManifest IcedTea ClasspathManifest icedtea-web-1.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedNotMatching/resources/PaxHeade0000644000000000000000000000035312574544466031001 xustar00145 path=icedtea-web-1.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedNotMatching/resources/CodeBaseManifestEntrySignedNotMatching.html 30 mtime=1441974582.518016244 30 atime=1441974656.497867838 30 ctime=1441974670.114024576 icedtea-web-1.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedNotMatching/resources/CodeBase0000664000076400007640000000357412574544466034571 0ustar00jvanekjvanek00000000000000 icedtea-web-1.5.3/tests/reproducers/signed/PaxHeaders.24993/CodeBaseManifestEntrySignedMatching0000644000000000000000000000013212574544466027337 xustar0030 mtime=1441974582.516016221 30 atime=1441974670.154025036 30 ctime=1441974670.114024576 icedtea-web-1.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/0000775000076400007640000000000012574544466030475 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/PaxHeaders.24993/test0000644000000000000000000000013212574544466030316 xustar0030 mtime=1441974582.517016232 30 atime=1441974670.154025036 30 ctime=1441974670.114024576 icedtea-web-1.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/testcases/0000775000076400007640000000000012574544466032473 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/testcases/PaxHeaders.0000644000000000000000000000035212574544466030726 xustar00144 path=icedtea-web-1.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/testcases/CodeBaseManifestEntryUnsignedNotMatching.java 30 mtime=1441974582.517016232 30 atime=1441974656.497867838 30 ctime=1441974670.114024576 icedtea-web-1.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/testcases/CodeBaseMan0000664000076400007640000001577212574544466034533 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/testcases/PaxHeaders.0000644000000000000000000000034712574544466030732 xustar00141 path=icedtea-web-1.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/testcases/CodeBaseManifestEntryUnsignedMatching.java 30 mtime=1441974582.517016232 30 atime=1441974656.497867838 30 ctime=1441974670.114024576 icedtea-web-1.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/testcases/CodeBaseMan0000664000076400007640000001541412574544466034524 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/testcases/PaxHeaders.0000644000000000000000000000035012574544466030724 xustar00142 path=icedtea-web-1.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/testcases/CodeBaseManifestEntrySignedNotMatching.java 30 mtime=1441974582.516016221 30 atime=1441974656.497867838 30 ctime=1441974670.114024576 icedtea-web-1.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/testcases/CodeBaseMan0000664000076400007640000001622712574544466034527 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/testcases/PaxHeaders.0000644000000000000000000000034512574544466030730 xustar00139 path=icedtea-web-1.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/testcases/CodeBaseManifestEntrySignedMatching.java 30 mtime=1441974582.516016221 30 atime=1441974656.496867827 30 ctime=1441974670.114024576 icedtea-web-1.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/testcases/CodeBaseMan0000664000076400007640000002045512574544466034525 0ustar00jvanekjvanek00000000000000/* 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 java.util.PropertyResourceBundle; 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 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"}; public static String getMessage(int i) { try { String s = "";//_cs, _de, _pl PropertyResourceBundle props = new PropertyResourceBundle(CodeBaseManifestEntrySignedMatching.class.getClassLoader().getResourceAsStream("net/sourceforge/jnlp/resources/Messages" + s + ".properties")); return props.getString(keys[i]); } 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.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466030311 xustar0030 mtime=1441974582.516016221 30 atime=1441974670.154025036 30 ctime=1441974670.114024576 icedtea-web-1.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/srcs/0000775000076400007640000000000012574544466031447 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/srcs/PaxHeaders.249930000644000000000000000000000013212574544466030311 xustar0030 mtime=1441974582.516016221 30 atime=1441974670.154025036 30 ctime=1441974670.114024576 icedtea-web-1.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/srcs/META-INF/0000775000076400007640000000000012574544466032607 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/srcs/META-INF/PaxHead0000644000000000000000000000031412574544466030250 xustar00114 path=icedtea-web-1.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/srcs/META-INF/MANIFEST.MF 30 mtime=1441974582.516016221 30 atime=1441974656.496867827 30 ctime=1441974670.113024564 icedtea-web-1.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/srcs/META-INF/MANIFES0000664000076400007640000000010412574544466033607 0ustar00jvanekjvanek00000000000000Manifest-Version: 1.0 Codebase: http://localhost https://localhost icedtea-web-1.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/srcs/PaxHeaders.249930000644000000000000000000000034012574544466030312 xustar00134 path=icedtea-web-1.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/srcs/CodeBaseManifestEntrySignedMatching.java 30 mtime=1441974582.515016209 30 atime=1441974656.496867827 30 ctime=1441974670.113024564 icedtea-web-1.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/srcs/CodeBaseManifest0000664000076400007640000000454112574544466034532 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/PaxHeaders.24993/reso0000644000000000000000000000013212574544466030307 xustar0030 mtime=1441974582.515016209 30 atime=1441974670.154025036 30 ctime=1441974670.113024564 icedtea-web-1.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/resources/0000775000076400007640000000000012574544466032507 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/resources/PaxHeaders.0000644000000000000000000000035112574544466030741 xustar00143 path=icedtea-web-1.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/resources/CodeBaseManifestEntrySignedMatchingJnlp.html 30 mtime=1441974582.515016209 30 atime=1441974656.496867827 30 ctime=1441974670.113024564 icedtea-web-1.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/resources/CodeBaseMan0000664000076400007640000000353712574544466034543 0ustar00jvanekjvanek00000000000000 icedtea-web-1.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/resources/PaxHeaders.0000644000000000000000000000035312574544466030743 xustar00145 path=icedtea-web-1.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/resources/CodeBaseManifestEntrySignedMatchingApplet.jnlp 30 mtime=1441974582.515016209 30 atime=1441974656.495867815 30 ctime=1441974670.113024564 icedtea-web-1.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/resources/CodeBaseMan0000664000076400007640000000461712574544466034543 0ustar00jvanekjvanek00000000000000 Classpath Manifest Applet Test IcedTea ClasspathManifest icedtea-web-1.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/resources/PaxHeaders.0000644000000000000000000000034512574544466030744 xustar00139 path=icedtea-web-1.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/resources/CodeBaseManifestEntrySignedMatching.jnlp 30 mtime=1441974582.515016209 30 atime=1441974656.495867815 30 ctime=1441974670.113024564 icedtea-web-1.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/resources/CodeBaseMan0000664000076400007640000000442312574544466034536 0ustar00jvanekjvanek00000000000000 ClasspathManifest IcedTea ClasspathManifest icedtea-web-1.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/resources/PaxHeaders.0000644000000000000000000000034512574544466030744 xustar00139 path=icedtea-web-1.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/resources/CodeBaseManifestEntrySignedMatching.html 30 mtime=1441974582.514016198 30 atime=1441974656.495867815 30 ctime=1441974670.113024564 icedtea-web-1.5.3/tests/reproducers/signed/CodeBaseManifestEntrySignedMatching/resources/CodeBaseMan0000664000076400007640000000356612574544466034545 0ustar00jvanekjvanek00000000000000 icedtea-web-1.5.3/tests/reproducers/signed/PaxHeaders.24993/ClipboardContentSigned0000644000000000000000000000013212574544466024740 xustar0030 mtime=1441974582.514016198 30 atime=1441974670.154025036 30 ctime=1441974670.113024564 icedtea-web-1.5.3/tests/reproducers/signed/ClipboardContentSigned/0000775000076400007640000000000012574544466026076 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/ClipboardContentSigned/PaxHeaders.24993/testcases0000644000000000000000000000013212574544466026736 xustar0030 mtime=1441974582.514016198 30 atime=1441974670.154025036 30 ctime=1441974670.113024564 icedtea-web-1.5.3/tests/reproducers/signed/ClipboardContentSigned/testcases/0000775000076400007640000000000012574544466030074 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/ClipboardContentSigned/testcases/PaxHeaders.24993/Clipboa0000644000000000000000000000032012574544466030306 xustar00118 path=icedtea-web-1.5.3/tests/reproducers/signed/ClipboardContentSigned/testcases/ClipboardContentSignedTests.java 30 mtime=1441974582.514016198 30 atime=1441974656.495867815 30 ctime=1441974670.113024564 icedtea-web-1.5.3/tests/reproducers/signed/ClipboardContentSigned/testcases/ClipboardContentSignedTe0000664000076400007640000001323112574544466034674 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/signed/ClipboardContentSigned/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466025712 xustar0030 mtime=1441974582.514016198 30 atime=1441974670.154025036 30 ctime=1441974670.113024564 icedtea-web-1.5.3/tests/reproducers/signed/ClipboardContentSigned/srcs/0000775000076400007640000000000012574544466027050 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/ClipboardContentSigned/srcs/PaxHeaders.24993/ClipboardCon0000644000000000000000000000013212574544466030251 xustar0030 mtime=1441974582.514016198 30 atime=1441974656.494867803 30 ctime=1441974670.113024564 icedtea-web-1.5.3/tests/reproducers/signed/ClipboardContentSigned/srcs/ClipboardContentSigned.java0000664000076400007640000001621512574544466034304 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/signed/ClipboardContentSigned/PaxHeaders.24993/resources0000644000000000000000000000013212574544466026752 xustar0030 mtime=1441974582.513016186 30 atime=1441974670.154025036 30 ctime=1441974670.113024564 icedtea-web-1.5.3/tests/reproducers/signed/ClipboardContentSigned/resources/0000775000076400007640000000000012574544466030110 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/ClipboardContentSigned/resources/PaxHeaders.24993/Clipboa0000644000000000000000000000032112574544466030323 xustar00119 path=icedtea-web-1.5.3/tests/reproducers/signed/ClipboardContentSigned/resources/ClipboardContentSignedPaste2.jnlp 30 mtime=1441974582.513016186 30 atime=1441974656.494867803 30 ctime=1441974670.113024564 icedtea-web-1.5.3/tests/reproducers/signed/ClipboardContentSigned/resources/ClipboardContentSignedPa0000664000076400007640000000445312574544466034706 0ustar00jvanekjvanek00000000000000 ClipboardContentSignedPaste2 IcedTea ClipboardContentSignedPaste2 paste2 icedtea-web-1.5.3/tests/reproducers/signed/ClipboardContentSigned/resources/PaxHeaders.24993/Clipboa0000644000000000000000000000032112574544466030323 xustar00119 path=icedtea-web-1.5.3/tests/reproducers/signed/ClipboardContentSigned/resources/ClipboardContentSignedPaste1.jnlp 30 mtime=1441974582.513016186 30 atime=1441974656.494867803 30 ctime=1441974670.113024564 icedtea-web-1.5.3/tests/reproducers/signed/ClipboardContentSigned/resources/ClipboardContentSignedPa0000664000076400007640000000445312574544466034706 0ustar00jvanekjvanek00000000000000 ClipboardContentSignedPaste1 IcedTea ClipboardContentSignedPaste1 paste1 icedtea-web-1.5.3/tests/reproducers/signed/ClipboardContentSigned/resources/PaxHeaders.24993/Clipboa0000644000000000000000000000032012574544466030322 xustar00118 path=icedtea-web-1.5.3/tests/reproducers/signed/ClipboardContentSigned/resources/ClipboardContentSignedCopy2.jnlp 30 mtime=1441974582.513016186 30 atime=1441974656.494867803 30 ctime=1441974670.113024564 icedtea-web-1.5.3/tests/reproducers/signed/ClipboardContentSigned/resources/ClipboardContentSignedCo0000664000076400007640000000450712574544466034707 0ustar00jvanekjvanek00000000000000 ClipboardContentSignedCopy2 IcedTea ClipboardContentSignedCopy2 copy2 10 icedtea-web-1.5.3/tests/reproducers/signed/ClipboardContentSigned/resources/PaxHeaders.24993/Clipboa0000644000000000000000000000032012574544466030322 xustar00118 path=icedtea-web-1.5.3/tests/reproducers/signed/ClipboardContentSigned/resources/ClipboardContentSignedCopy1.jnlp 30 mtime=1441974582.512016175 30 atime=1441974656.494867803 30 ctime=1441974670.113024564 icedtea-web-1.5.3/tests/reproducers/signed/ClipboardContentSigned/resources/ClipboardContentSignedCo0000664000076400007640000000450712574544466034707 0ustar00jvanekjvanek00000000000000 ClipboardContentSignedCopy1 IcedTea ClipboardContentSignedCopy1 copy1 10 icedtea-web-1.5.3/tests/reproducers/signed/PaxHeaders.24993/ClasspathManifestTest0000644000000000000000000000013212574544466024625 xustar0030 mtime=1441974582.512016175 30 atime=1441974670.154025036 30 ctime=1441974670.113024564 icedtea-web-1.5.3/tests/reproducers/signed/ClasspathManifestTest/0000775000076400007640000000000012574544466025763 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/ClasspathManifestTest/PaxHeaders.24993/testcases0000644000000000000000000000013212574544466026623 xustar0030 mtime=1441974582.512016175 30 atime=1441974670.154025036 30 ctime=1441974670.113024564 icedtea-web-1.5.3/tests/reproducers/signed/ClasspathManifestTest/testcases/0000775000076400007640000000000012574544466027761 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/ClasspathManifestTest/testcases/PaxHeaders.24993/Classpat0000644000000000000000000000031112574544466030374 xustar00111 path=icedtea-web-1.5.3/tests/reproducers/signed/ClasspathManifestTest/testcases/ClasspathManifestTest.java 30 mtime=1441974582.512016175 30 atime=1441974656.493867792 30 ctime=1441974670.113024564 icedtea-web-1.5.3/tests/reproducers/signed/ClasspathManifestTest/testcases/ClasspathManifestTest.jav0000664000076400007640000001272512574544466034743 0ustar00jvanekjvanek00000000000000/* 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.util.ArrayList; import java.util.List; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.annotations.KnownToFail; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.TestInBrowsers; import net.sourceforge.jnlp.browsertesting.BrowserTest; import net.sourceforge.jnlp.browsertesting.Browsers; import org.junit.Assert; import org.junit.Test; public class ClasspathManifestTest extends BrowserTest { private static String s1 = "Searching for CheckForClasspath."; private static String s2 = "CheckForClasspath found on classpath."; private static String ss = "xception"; 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)); } @NeedsDisplay @Test public void ApplicationJNLPRemoteTest() throws Exception { ProcessResult pr = server.executeJavawsHeadless(null, "/ClasspathManifestApplicationTest.jnlp"); checkAppFails(pr, "ApplicationJNLPRemoteTest"); } @NeedsDisplay @KnownToFail @Test public void ApplicationJNLPLocalTest() throws Exception { List commands=new ArrayList(3); commands.add(server.getJavawsLocation()); commands.add(ServerAccess.HEADLES_OPTION); commands.add("ClasspathManifestApplicationTest.jnlp"); ProcessResult pr = ServerAccess.executeProcess(commands, server.getDir()); checkAppFails(pr, "ApplicationJNLPLocalTest"); } @NeedsDisplay @Test public void AppletJNLPRemoteTest() throws Exception { ProcessResult pr = server.executeJavawsHeadless(null, "/ClasspathManifestAppletTest.jnlp"); checkAppFails(pr, "AppletJNLPRemoteTest"); } @NeedsDisplay @KnownToFail @Test public void AppletJNLPRLocalTest() throws Exception { List commands=new ArrayList(3); commands.add(server.getJavawsLocation()); commands.add(ServerAccess.HEADLES_OPTION); commands.add("ClasspathManifestAppletTest.jnlp"); ProcessResult pr = ServerAccess.executeProcess(commands, server.getDir()); checkAppFails(pr, "AppletJNLPRLocalTest"); } @NeedsDisplay @TestInBrowsers(testIn = {Browsers.one}) @Test public void BrowserJNLPHrefRemoteTest() throws Exception { ProcessResult pr = server.executeBrowser("/ClasspathManifestJNLPHrefTest.html"); checkAppFails(pr, "BrowserJNLPHrefRemoteTest"); } @NeedsDisplay @TestInBrowsers(testIn = {Browsers.one}) @KnownToFail @Test public void BrowserJNLPHrefLocalTest() throws Exception { List commands=new ArrayList(2); commands.add(server.getBrowserLocation()); commands.add("ClasspathManifestJNLPHrefTest.html"); ProcessResult pr = ServerAccess.executeProcess(commands, server.getDir()); checkAppFails(pr, "BrowserJNLPHrefLocalTest"); } @NeedsDisplay @TestInBrowsers(testIn = {Browsers.one}) @Test public void BrowserAppletRemoteTest() throws Exception { ProcessResult pr = server.executeBrowser("/ClasspathManifestAppletTest.html"); 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.5.3/tests/reproducers/signed/ClasspathManifestTest/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466025577 xustar0030 mtime=1441974582.512016175 30 atime=1441974670.154025036 30 ctime=1441974670.113024564 icedtea-web-1.5.3/tests/reproducers/signed/ClasspathManifestTest/srcs/0000775000076400007640000000000012574544466026735 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/ClasspathManifestTest/srcs/PaxHeaders.24993/META-INF0000644000000000000000000000013212574544466026737 xustar0030 mtime=1441974582.512016175 30 atime=1441974670.154025036 30 ctime=1441974670.113024564 icedtea-web-1.5.3/tests/reproducers/signed/ClasspathManifestTest/srcs/META-INF/0000775000076400007640000000000012574544466030075 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/ClasspathManifestTest/srcs/META-INF/PaxHeaders.24993/MANI0000644000000000000000000000013212574544466027463 xustar0030 mtime=1441974582.512016175 30 atime=1441974656.493867792 30 ctime=1441974670.113024564 icedtea-web-1.5.3/tests/reproducers/signed/ClasspathManifestTest/srcs/META-INF/MANIFEST.MF0000664000076400007640000000010612574544466031524 0ustar00jvanekjvanek00000000000000Manifest-Version: 1.0 Class-Path: Classpath/Manifest/Test/Helper.jar icedtea-web-1.5.3/tests/reproducers/signed/ClasspathManifestTest/srcs/PaxHeaders.24993/ClasspathMani0000644000000000000000000000013212574544466030326 xustar0030 mtime=1441974582.511016163 30 atime=1441974656.493867792 30 ctime=1441974670.113024564 icedtea-web-1.5.3/tests/reproducers/signed/ClasspathManifestTest/srcs/ClasspathManifest.java0000664000076400007640000000544212574544466033216 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/signed/ClasspathManifestTest/PaxHeaders.24993/resources0000644000000000000000000000013212574544466026637 xustar0030 mtime=1441974582.511016163 30 atime=1441974670.154025036 30 ctime=1441974670.113024564 icedtea-web-1.5.3/tests/reproducers/signed/ClasspathManifestTest/resources/0000775000076400007640000000000012574544466027775 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/ClasspathManifestTest/resources/PaxHeaders.24993/Classpat0000644000000000000000000000032012574544466030410 xustar00119 path=icedtea-web-1.5.3/tests/reproducers/signed/ClasspathManifestTest/resources/ClasspathManifestJNLPHrefTest.html 30 mtime=1441974582.511016163 29 atime=1441974656.49286778 30 ctime=1441974670.113024564 icedtea-web-1.5.3/tests/reproducers/signed/ClasspathManifestTest/resources/ClasspathManifestJNLPHref0000664000076400007640000000346112574544466034626 0ustar00jvanekjvanek00000000000000 icedtea-web-1.5.3/tests/reproducers/signed/ClasspathManifestTest/resources/PaxHeaders.24993/Classpat0000644000000000000000000000032312574544466030413 xustar00122 path=icedtea-web-1.5.3/tests/reproducers/signed/ClasspathManifestTest/resources/ClasspathManifestApplicationTest.jnlp 30 mtime=1441974582.511016163 29 atime=1441974656.49286778 30 ctime=1441974670.113024564 icedtea-web-1.5.3/tests/reproducers/signed/ClasspathManifestTest/resources/ClasspathManifestApplicat0000664000076400007640000000436012574544466035012 0ustar00jvanekjvanek00000000000000 ClasspathManifest IcedTea ClasspathManifest icedtea-web-1.5.3/tests/reproducers/signed/ClasspathManifestTest/resources/PaxHeaders.24993/Classpat0000644000000000000000000000031612574544466030415 xustar00117 path=icedtea-web-1.5.3/tests/reproducers/signed/ClasspathManifestTest/resources/ClasspathManifestAppletTest.jnlp 30 mtime=1441974582.510016151 29 atime=1441974656.49286778 30 ctime=1441974670.113024564 icedtea-web-1.5.3/tests/reproducers/signed/ClasspathManifestTest/resources/ClasspathManifestAppletTe0000664000076400007640000000451712574544466034777 0ustar00jvanekjvanek00000000000000 Classpath Manifest Applet Test IcedTea ClasspathManifest icedtea-web-1.5.3/tests/reproducers/signed/ClasspathManifestTest/resources/PaxHeaders.24993/Classpat0000644000000000000000000000031612574544466030415 xustar00117 path=icedtea-web-1.5.3/tests/reproducers/signed/ClasspathManifestTest/resources/ClasspathManifestAppletTest.html 30 mtime=1441974582.510016151 29 atime=1441974656.49286778 30 ctime=1441974670.113024564 icedtea-web-1.5.3/tests/reproducers/signed/ClasspathManifestTest/resources/ClasspathManifestAppletTe0000664000076400007640000000351212574544466034771 0ustar00jvanekjvanek00000000000000 icedtea-web-1.5.3/tests/reproducers/signed/PaxHeaders.24993/Classpath.Manifest.Test.Helper0000644000000000000000000000013212574544466026177 xustar0030 mtime=1441974582.510016151 30 atime=1441974670.154025036 30 ctime=1441974670.113024564 icedtea-web-1.5.3/tests/reproducers/signed/Classpath.Manifest.Test.Helper/0000775000076400007640000000000012574544466027335 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/Classpath.Manifest.Test.Helper/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466027151 xustar0030 mtime=1441974582.510016151 30 atime=1441974670.154025036 30 ctime=1441974670.113024564 icedtea-web-1.5.3/tests/reproducers/signed/Classpath.Manifest.Test.Helper/srcs/0000775000076400007640000000000012574544466030307 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/Classpath.Manifest.Test.Helper/srcs/PaxHeaders.24993/Chec0000644000000000000000000000031012574544466030011 xustar00111 path=icedtea-web-1.5.3/tests/reproducers/signed/Classpath.Manifest.Test.Helper/srcs/CheckForClasspath.java 30 mtime=1441974582.510016151 29 atime=1441974656.49286778 30 ctime=1441974670.113024564 icedtea-web-1.5.3/tests/reproducers/signed/Classpath.Manifest.Test.Helper/srcs/CheckForClasspath.jav0000664000076400007640000000341712574544466034345 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/signed/PaxHeaders.24993/CacheReproducer0000644000000000000000000000013112574544466023411 xustar0029 mtime=1441974582.50901614 30 atime=1441974670.154025036 30 ctime=1441974670.113024564 icedtea-web-1.5.3/tests/reproducers/signed/CacheReproducer/0000775000076400007640000000000012574544466024550 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/CacheReproducer/PaxHeaders.24993/testcases0000644000000000000000000000013112574544466025407 xustar0029 mtime=1441974582.50901614 30 atime=1441974670.154025036 30 ctime=1441974670.113024564 icedtea-web-1.5.3/tests/reproducers/signed/CacheReproducer/testcases/0000775000076400007640000000000012574544466026546 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/CacheReproducer/testcases/PaxHeaders.24993/CacheReproduce0000644000000000000000000000013112574544466030263 xustar0029 mtime=1441974582.50901614 30 atime=1441974656.491867769 30 ctime=1441974670.113024564 icedtea-web-1.5.3/tests/reproducers/signed/CacheReproducer/testcases/CacheReproducerTest.java0000664000076400007640000004142312574544466033313 0ustar00jvanekjvanek00000000000000/* 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.PropertyResourceBundle; 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.Defaults; 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 clear = Arrays.asList(new String[]{server.getJavawsLocation(), "-Xclearcache", ServerAccess.HEADLES_OPTION}); 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"; private static final File icedteaCache = new File(Defaults.USER_CACHE_HOME, "cache"); private static final File icedteaCacheFile = new File(icedteaCache, "recently_used"); private static final File netxLock = new File(System.getProperty("java.io.tmpdir"), System.getProperty("user.name") + File.separator + "netx" + File.separator + "locks" + File.separator + "netx_running"); 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() > 0); } /** * 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.assertFalse("icedtea cache " + icedteaCache.getAbsolutePath() + " should not exist after clearing", icedteaCache.exists()); } 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 = ServerAccess.executeProcess(clear); return pr1; } } icedtea-web-1.5.3/tests/reproducers/signed/CacheReproducer/PaxHeaders.24993/srcs0000644000000000000000000000013112574544466024363 xustar0029 mtime=1441974582.50901614 30 atime=1441974670.154025036 30 ctime=1441974670.113024564 icedtea-web-1.5.3/tests/reproducers/signed/CacheReproducer/srcs/0000775000076400007640000000000012574544466025522 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/CacheReproducer/srcs/PaxHeaders.24993/CacheReproducer.jav0000644000000000000000000000013112574544466030200 xustar0029 mtime=1441974582.50901614 30 atime=1441974656.491867769 30 ctime=1441974670.113024564 icedtea-web-1.5.3/tests/reproducers/signed/CacheReproducer/srcs/CacheReproducer.java0000664000076400007640000000362412574544466031430 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/signed/CacheReproducer/PaxHeaders.24993/resources0000644000000000000000000000013112574544466025423 xustar0029 mtime=1441974582.50901614 30 atime=1441974670.154025036 30 ctime=1441974670.113024564 icedtea-web-1.5.3/tests/reproducers/signed/CacheReproducer/resources/0000775000076400007640000000000012574544466026562 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/CacheReproducer/resources/PaxHeaders.24993/CacheReproduce0000644000000000000000000000013112574544466030277 xustar0029 mtime=1441974582.50901614 30 atime=1441974656.491867769 30 ctime=1441974670.113024564 icedtea-web-1.5.3/tests/reproducers/signed/CacheReproducer/resources/CacheReproducer2_1.jnlp0000664000076400007640000000113012574544466033002 0ustar00jvanekjvanek00000000000000 Just prints out "Good simple javaws exapmle" using reflection call from CacheReproducer.jar SimpletestSigned1.jar IcedTea icedtea-web-1.5.3/tests/reproducers/signed/CacheReproducer/resources/PaxHeaders.24993/CacheReproduce0000644000000000000000000000013212574544466030300 xustar0030 mtime=1441974582.508016129 30 atime=1441974656.490867758 30 ctime=1441974670.113024564 icedtea-web-1.5.3/tests/reproducers/signed/CacheReproducer/resources/CacheReproducer2.jnlp0000664000076400007640000000112712574544466032570 0ustar00jvanekjvanek00000000000000 Just prints out "Good simple javaws exapmle" using reflection call from CacheReproducer.jar SimpletestSigned1.jar IcedTea icedtea-web-1.5.3/tests/reproducers/signed/CacheReproducer/resources/PaxHeaders.24993/CacheReproduce0000644000000000000000000000013212574544466030300 xustar0030 mtime=1441974582.508016129 30 atime=1441974656.490867758 30 ctime=1441974670.112024553 icedtea-web-1.5.3/tests/reproducers/signed/CacheReproducer/resources/CacheReproducer1_1.jnlp0000664000076400007640000000113012574544466033001 0ustar00jvanekjvanek00000000000000 Just prints out "Good simple javaws exapmle" using reflection call from CacheReproducer.jar SimpletestSigned1.jar IcedTea icedtea-web-1.5.3/tests/reproducers/signed/CacheReproducer/resources/PaxHeaders.24993/CacheReproduce0000644000000000000000000000013212574544466030300 xustar0030 mtime=1441974582.508016129 30 atime=1441974656.490867758 30 ctime=1441974670.112024553 icedtea-web-1.5.3/tests/reproducers/signed/CacheReproducer/resources/CacheReproducer1.jnlp0000664000076400007640000000113112574544466032562 0ustar00jvanekjvanek00000000000000 Just prints out "Good simple javaws exapmle" using reflection call from CacheReproducer.jar SimpletestSigned1.jar IcedTea icedtea-web-1.5.3/tests/reproducers/signed/PaxHeaders.24993/AppletTestSigned0000644000000000000000000000013212574544466023573 xustar0030 mtime=1441974582.507016117 30 atime=1441974670.154025036 30 ctime=1441974670.112024553 icedtea-web-1.5.3/tests/reproducers/signed/AppletTestSigned/0000775000076400007640000000000012574544466024731 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/AppletTestSigned/PaxHeaders.24993/testcases0000644000000000000000000000013212574544466025571 xustar0030 mtime=1441974582.507016117 30 atime=1441974670.154025036 30 ctime=1441974670.112024553 icedtea-web-1.5.3/tests/reproducers/signed/AppletTestSigned/testcases/0000775000076400007640000000000012574544466026727 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/AppletTestSigned/testcases/PaxHeaders.24993/AppletTestSig0000644000000000000000000000013212574544466030321 xustar0030 mtime=1441974582.508016129 30 atime=1441974656.490867758 30 ctime=1441974670.112024553 icedtea-web-1.5.3/tests/reproducers/signed/AppletTestSigned/testcases/AppletTestSignedTests.java0000664000076400007640000001336312574544466034042 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/signed/AppletTestSigned/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466024545 xustar0030 mtime=1441974582.507016117 30 atime=1441974670.154025036 30 ctime=1441974670.112024553 icedtea-web-1.5.3/tests/reproducers/signed/AppletTestSigned/srcs/0000775000076400007640000000000012574544466025703 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/AppletTestSigned/srcs/PaxHeaders.24993/AppletTestSigned.j0000644000000000000000000000013212574544466030214 xustar0030 mtime=1441974582.507016117 30 atime=1441974656.489867746 30 ctime=1441974670.112024553 icedtea-web-1.5.3/tests/reproducers/signed/AppletTestSigned/srcs/AppletTestSigned.java0000664000076400007640000000541112574544466031766 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/signed/AppletTestSigned/PaxHeaders.24993/resources0000644000000000000000000000013212574544466025605 xustar0030 mtime=1441974582.507016117 30 atime=1441974670.154025036 30 ctime=1441974670.112024553 icedtea-web-1.5.3/tests/reproducers/signed/AppletTestSigned/resources/0000775000076400007640000000000012574544466026743 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/AppletTestSigned/resources/PaxHeaders.24993/AppletTestSig0000644000000000000000000000013212574544466030335 xustar0030 mtime=1441974582.507016117 30 atime=1441974656.489867746 30 ctime=1441974670.112024553 icedtea-web-1.5.3/tests/reproducers/signed/AppletTestSigned/resources/AppletTestSigned2.html0000664000076400007640000000357012574544466033137 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/signed/AppletTestSigned/resources/PaxHeaders.24993/AppletTestSig0000644000000000000000000000013212574544466030335 xustar0030 mtime=1441974582.506016106 30 atime=1441974656.489867746 30 ctime=1441974670.112024553 icedtea-web-1.5.3/tests/reproducers/signed/AppletTestSigned/resources/AppletTestSigned.jnlp0000664000076400007640000000452712574544466033057 0ustar00jvanekjvanek00000000000000 SignedAppletTest IcedTea SignedAppletTest icedtea-web-1.5.3/tests/reproducers/signed/AppletTestSigned/resources/PaxHeaders.24993/AppletTestSig0000644000000000000000000000013212574544466030335 xustar0030 mtime=1441974582.506016106 30 atime=1441974656.489867746 30 ctime=1441974670.112024553 icedtea-web-1.5.3/tests/reproducers/signed/AppletTestSigned/resources/AppletTestSigned.html0000664000076400007640000000356212574544466033056 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/signed/PaxHeaders.24993/AppContextHasJNLPClassLoader0000644000000000000000000000013212574544466025676 xustar0030 mtime=1441974582.506016106 30 atime=1441974670.154025036 30 ctime=1441974670.112024553 icedtea-web-1.5.3/tests/reproducers/signed/AppContextHasJNLPClassLoader/0000775000076400007640000000000012574544466027034 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/AppContextHasJNLPClassLoader/PaxHeaders.24993/testcases0000644000000000000000000000013212574544466027674 xustar0030 mtime=1441974582.506016106 30 atime=1441974670.154025036 30 ctime=1441974670.112024553 icedtea-web-1.5.3/tests/reproducers/signed/AppContextHasJNLPClassLoader/testcases/0000775000076400007640000000000012574544466031032 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/AppContextHasJNLPClassLoader/testcases/PaxHeaders.24993/A0000644000000000000000000000033312574544466030057 xustar00129 path=icedtea-web-1.5.3/tests/reproducers/signed/AppContextHasJNLPClassLoader/testcases/AppContextHasJNLPClassLoaderTest.java 30 mtime=1441974582.506016106 30 atime=1441974656.488867734 30 ctime=1441974670.112024553 icedtea-web-1.5.3/tests/reproducers/signed/AppContextHasJNLPClassLoader/testcases/AppContextHasJNLPC0000664000076400007640000001056612574544466034275 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/signed/AppContextHasJNLPClassLoader/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466026650 xustar0030 mtime=1441974582.505016094 30 atime=1441974670.154025036 30 ctime=1441974670.112024553 icedtea-web-1.5.3/tests/reproducers/signed/AppContextHasJNLPClassLoader/srcs/0000775000076400007640000000000012574544466030006 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/AppContextHasJNLPClassLoader/srcs/PaxHeaders.24993/AppCon0000644000000000000000000000032212574544466030031 xustar00120 path=icedtea-web-1.5.3/tests/reproducers/signed/AppContextHasJNLPClassLoader/srcs/AppContextHasJNLPClassLoader.java 30 mtime=1441974582.505016094 30 atime=1441974656.488867734 30 ctime=1441974670.112024553 icedtea-web-1.5.3/tests/reproducers/signed/AppContextHasJNLPClassLoader/srcs/AppContextHasJNLPClassL0000664000076400007640000000626712574544466034253 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/signed/AppContextHasJNLPClassLoader/PaxHeaders.24993/resources0000644000000000000000000000013212574544466027710 xustar0030 mtime=1441974582.505016094 30 atime=1441974670.154025036 30 ctime=1441974670.112024553 icedtea-web-1.5.3/tests/reproducers/signed/AppContextHasJNLPClassLoader/resources/0000775000076400007640000000000012574544466031046 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/AppContextHasJNLPClassLoader/resources/PaxHeaders.24993/A0000644000000000000000000000034412574544466030075 xustar00138 path=icedtea-web-1.5.3/tests/reproducers/signed/AppContextHasJNLPClassLoader/resources/AppContextHasJNLPClassLoaderForJNLPApplet.jnlp 30 mtime=1441974582.505016094 30 atime=1441974656.488867734 30 ctime=1441974670.112024553 icedtea-web-1.5.3/tests/reproducers/signed/AppContextHasJNLPClassLoader/resources/AppContextHasJNLPC0000664000076400007640000000463112574544466034305 0ustar00jvanekjvanek00000000000000 Test AppContext Classloader IcedTea Test that AppContext's context classloader is a JNLPClassLoader icedtea-web-1.5.3/tests/reproducers/signed/AppContextHasJNLPClassLoader/resources/PaxHeaders.24993/A0000644000000000000000000000032712574544466030076 xustar00125 path=icedtea-web-1.5.3/tests/reproducers/signed/AppContextHasJNLPClassLoader/resources/AppContextHasJNLPClassLoader.jnlp 30 mtime=1441974582.505016094 30 atime=1441974656.487867723 30 ctime=1441974670.112024553 icedtea-web-1.5.3/tests/reproducers/signed/AppContextHasJNLPClassLoader/resources/AppContextHasJNLPC0000664000076400007640000000446312574544466034310 0ustar00jvanekjvanek00000000000000 Test AppContext Classloader IcedTea Test that AppContext's context classloader is a JNLPClassLoader icedtea-web-1.5.3/tests/reproducers/signed/AppContextHasJNLPClassLoader/resources/PaxHeaders.24993/A0000644000000000000000000000032712574544466030076 xustar00125 path=icedtea-web-1.5.3/tests/reproducers/signed/AppContextHasJNLPClassLoader/resources/AppContextHasJNLPClassLoader.html 30 mtime=1441974582.505016094 30 atime=1441974656.487867723 30 ctime=1441974670.112024553 icedtea-web-1.5.3/tests/reproducers/signed/AppContextHasJNLPClassLoader/resources/AppContextHasJNLPC0000664000076400007640000000347312574544466034310 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/signed/PaxHeaders.24993/AccessClassInPackageSigned0000644000000000000000000000013212574544466025440 xustar0030 mtime=1441974582.504016082 30 atime=1441974670.154025036 30 ctime=1441974670.112024553 icedtea-web-1.5.3/tests/reproducers/signed/AccessClassInPackageSigned/0000775000076400007640000000000012574544466026576 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/AccessClassInPackageSigned/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466026412 xustar0030 mtime=1441974582.504016082 30 atime=1441974670.154025036 30 ctime=1441974670.112024553 icedtea-web-1.5.3/tests/reproducers/signed/AccessClassInPackageSigned/srcs/0000775000076400007640000000000012574544466027550 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/AccessClassInPackageSigned/srcs/PaxHeaders.24993/AccessCl0000644000000000000000000000031612574544466030076 xustar00116 path=icedtea-web-1.5.3/tests/reproducers/signed/AccessClassInPackageSigned/srcs/AccessClassInPackageSigned.java 30 mtime=1441974582.504016082 30 atime=1441974656.487867723 30 ctime=1441974670.112024553 icedtea-web-1.5.3/tests/reproducers/signed/AccessClassInPackageSigned/srcs/AccessClassInPackageSigne0000664000076400007640000000350712574544466034420 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/signed/AccessClassInPackageSigned/PaxHeaders.24993/resources0000644000000000000000000000013212574544466027452 xustar0030 mtime=1441974582.504016082 30 atime=1441974670.154025036 30 ctime=1441974670.112024553 icedtea-web-1.5.3/tests/reproducers/signed/AccessClassInPackageSigned/resources/0000775000076400007640000000000012574544466030610 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/signed/AccessClassInPackageSigned/resources/PaxHeaders.24993/Acc0000644000000000000000000000033112574544466030141 xustar00127 path=icedtea-web-1.5.3/tests/reproducers/signed/AccessClassInPackageSigned/resources/AccessClassInPackageSignedSUNSEC.jnlp 30 mtime=1441974582.504016082 30 atime=1441974656.486867711 30 ctime=1441974670.112024553 icedtea-web-1.5.3/tests/reproducers/signed/AccessClassInPackageSigned/resources/AccessClassInPackage0000664000076400007640000000452312574544466034471 0ustar00jvanekjvanek00000000000000 Test accessClassInPackage by signed app IcedTea testing access to sun.security.* package by signed app sun.security.internal.spec.TlsKeyMaterialSpec icedtea-web-1.5.3/tests/reproducers/signed/AccessClassInPackageSigned/resources/PaxHeaders.24993/Acc0000644000000000000000000000032712574544466030146 xustar00125 path=icedtea-web-1.5.3/tests/reproducers/signed/AccessClassInPackageSigned/resources/AccessClassInPackageSignedSELF.jnlp 30 mtime=1441974582.504016082 30 atime=1441974656.486867711 30 ctime=1441974670.112024553 icedtea-web-1.5.3/tests/reproducers/signed/AccessClassInPackageSigned/resources/AccessClassInPackage0000664000076400007640000000450312574544466034467 0ustar00jvanekjvanek00000000000000 Test accessClassInPackage by signed app IcedTea testing aaccess to package's internal class by signed app AccessClassInPackageSigned icedtea-web-1.5.3/tests/reproducers/signed/AccessClassInPackageSigned/resources/PaxHeaders.24993/Acc0000644000000000000000000000033012574544466030140 xustar00126 path=icedtea-web-1.5.3/tests/reproducers/signed/AccessClassInPackageSigned/resources/AccessClassInPackageSignedNETSF.jnlp 30 mtime=1441974582.503016071 30 atime=1441974656.486867711 30 ctime=1441974670.112024553 icedtea-web-1.5.3/tests/reproducers/signed/AccessClassInPackageSigned/resources/AccessClassInPackage0000664000076400007640000000450712574544466034473 0ustar00jvanekjvanek00000000000000 Test accessClassInPackage by signed app IcedTea testing access to net.sourceforge.* package by signed app net.sourceforge.jnlp.Parser icedtea-web-1.5.3/tests/reproducers/signed/AccessClassInPackageSigned/resources/PaxHeaders.24993/Acc0000644000000000000000000000033412574544466030144 xustar00130 path=icedtea-web-1.5.3/tests/reproducers/signed/AccessClassInPackageSigned/resources/AccessClassInPackageSignedJAVAXJNLP.jnlp 30 mtime=1441974582.503016071 30 atime=1441974656.486867711 30 ctime=1441974670.112024553 icedtea-web-1.5.3/tests/reproducers/signed/AccessClassInPackageSigned/resources/AccessClassInPackage0000664000076400007640000000447212574544466034474 0ustar00jvanekjvanek00000000000000 Test accessClassInPackage signed IcedTea testing access to some javax.jnlp.* package by signed app javax.jnlp.ServiceManager icedtea-web-1.5.3/tests/reproducers/PaxHeaders.24993/custom0000644000000000000000000000013212574544466020415 xustar0030 mtime=1441974582.599017176 30 atime=1441974670.154025036 30 ctime=1441974670.112024553 icedtea-web-1.5.3/tests/reproducers/custom/0000775000076400007640000000000012574544466021553 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/custom/PaxHeaders.24993/GifarCreator0000644000000000000000000000013212574544466022765 xustar0030 mtime=1441974582.599017176 30 atime=1441974670.154025036 30 ctime=1441974670.112024553 icedtea-web-1.5.3/tests/reproducers/custom/GifarCreator/0000775000076400007640000000000012574544466024123 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/custom/GifarCreator/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466023737 xustar0030 mtime=1441974582.599017176 30 atime=1441974670.154025036 30 ctime=1441974670.112024553 icedtea-web-1.5.3/tests/reproducers/custom/GifarCreator/srcs/0000775000076400007640000000000012574544466025075 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/custom/GifarCreator/srcs/PaxHeaders.24993/Makefile0000644000000000000000000000013212574544466025454 xustar0030 mtime=1441974582.599017176 30 atime=1441974656.475867585 30 ctime=1441974670.112024553 icedtea-web-1.5.3/tests/reproducers/custom/GifarCreator/srcs/Makefile0000664000076400007640000000062712574544466026542 0ustar00jvanekjvanek00000000000000DEPLOY_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.5.3/tests/reproducers/custom/PaxHeaders.24993/ExtensionJnlpsInApplet0000644000000000000000000000013212574544466025035 xustar0030 mtime=1441974582.599017176 30 atime=1441974670.154025036 30 ctime=1441974670.112024553 icedtea-web-1.5.3/tests/reproducers/custom/ExtensionJnlpsInApplet/0000775000076400007640000000000012574544466026173 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/custom/ExtensionJnlpsInApplet/PaxHeaders.24993/testcases0000644000000000000000000000013212574544466027033 xustar0030 mtime=1441974582.599017176 30 atime=1441974670.154025036 30 ctime=1441974670.112024553 icedtea-web-1.5.3/tests/reproducers/custom/ExtensionJnlpsInApplet/testcases/0000775000076400007640000000000012574544466030171 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/custom/ExtensionJnlpsInApplet/testcases/PaxHeaders.24993/Extensi0000644000000000000000000000031712574544466030457 xustar00117 path=icedtea-web-1.5.3/tests/reproducers/custom/ExtensionJnlpsInApplet/testcases/ExtensionJnlpsInAppletTest.java 30 mtime=1441974582.599017176 30 atime=1441974656.474867573 30 ctime=1441974670.112024553 icedtea-web-1.5.3/tests/reproducers/custom/ExtensionJnlpsInApplet/testcases/ExtensionJnlpsInAppletTe0000664000076400007640000000641112574544466035027 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/custom/ExtensionJnlpsInApplet/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466026007 xustar0030 mtime=1441974582.599017176 30 atime=1441974670.154025036 30 ctime=1441974670.112024553 icedtea-web-1.5.3/tests/reproducers/custom/ExtensionJnlpsInApplet/srcs/0000775000076400007640000000000012574544466027145 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/custom/ExtensionJnlpsInApplet/srcs/PaxHeaders.24993/Makefile0000644000000000000000000000013212574544466027524 xustar0030 mtime=1441974582.599017176 30 atime=1441974656.474867573 30 ctime=1441974670.112024553 icedtea-web-1.5.3/tests/reproducers/custom/ExtensionJnlpsInApplet/srcs/Makefile0000664000076400007640000000171112574544466030605 0ustar00jvanekjvanek00000000000000TESTNAME=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=$(BOOT_DIR)/bin/javac JAR=$(BOOT_DIR)/bin/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.5.3/tests/reproducers/custom/ExtensionJnlpsInApplet/srcs/PaxHeaders.24993/ExtensionJnl0000644000000000000000000000013212574544466030427 xustar0030 mtime=1441974582.598017164 30 atime=1441974656.474867573 30 ctime=1441974670.112024553 icedtea-web-1.5.3/tests/reproducers/custom/ExtensionJnlpsInApplet/srcs/ExtensionJnlpTestApplet.java0000664000076400007640000000425412574544466034623 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/custom/ExtensionJnlpsInApplet/srcs/PaxHeaders.24993/ExtensionJnl0000644000000000000000000000013212574544466030427 xustar0030 mtime=1441974582.598017164 30 atime=1441974656.474867573 30 ctime=1441974670.112024553 icedtea-web-1.5.3/tests/reproducers/custom/ExtensionJnlpsInApplet/srcs/ExtensionJnlpHelper.java0000664000076400007640000000333012574544466033747 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/custom/ExtensionJnlpsInApplet/PaxHeaders.24993/resources0000644000000000000000000000013212574544466027047 xustar0030 mtime=1441974582.598017164 30 atime=1441974670.154025036 30 ctime=1441974670.111024541 icedtea-web-1.5.3/tests/reproducers/custom/ExtensionJnlpsInApplet/resources/0000775000076400007640000000000012574544466030205 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/custom/ExtensionJnlpsInApplet/resources/PaxHeaders.24993/Extensi0000644000000000000000000000031412574544466030470 xustar00114 path=icedtea-web-1.5.3/tests/reproducers/custom/ExtensionJnlpsInApplet/resources/ExtensionJnlpTestApplet.jnlp 30 mtime=1441974582.598017164 30 atime=1441974656.474867573 30 ctime=1441974670.111024541 icedtea-web-1.5.3/tests/reproducers/custom/ExtensionJnlpsInApplet/resources/ExtensionJnlpTestApplet.0000664000076400007640000000441712574544466035022 0ustar00jvanekjvanek00000000000000 ExtensionJnlpTestApplet IcedTea PR974 Test icedtea-web-1.5.3/tests/reproducers/custom/ExtensionJnlpsInApplet/resources/PaxHeaders.24993/Extensi0000644000000000000000000000013212574544466030466 xustar0030 mtime=1441974582.598017164 30 atime=1441974656.473867562 30 ctime=1441974670.111024541 icedtea-web-1.5.3/tests/reproducers/custom/ExtensionJnlpsInApplet/resources/ExtensionJnlpTest.html0000664000076400007640000000344212574544466034536 0ustar00jvanekjvanek00000000000000 icedtea-web-1.5.3/tests/reproducers/custom/ExtensionJnlpsInApplet/resources/PaxHeaders.24993/Extensi0000644000000000000000000000013212574544466030466 xustar0030 mtime=1441974582.598017164 30 atime=1441974656.473867562 30 ctime=1441974670.111024541 icedtea-web-1.5.3/tests/reproducers/custom/ExtensionJnlpsInApplet/resources/ExtensionJnlpHelper.jnlp0000664000076400007640000000414412574544466035035 0ustar00jvanekjvanek00000000000000 ExtensionJnlpHelper IcedTea PR974 Test icedtea-web-1.5.3/tests/reproducers/custom/PaxHeaders.24993/AppletFolderInArchiveTag0000644000000000000000000000013212574544466025223 xustar0030 mtime=1441974582.598017164 30 atime=1441974670.154025036 30 ctime=1441974670.111024541 icedtea-web-1.5.3/tests/reproducers/custom/AppletFolderInArchiveTag/0000775000076400007640000000000012574544466026361 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/custom/AppletFolderInArchiveTag/PaxHeaders.24993/testcases0000644000000000000000000000013212574544466027221 xustar0030 mtime=1441974582.598017164 30 atime=1441974670.154025036 30 ctime=1441974670.111024541 icedtea-web-1.5.3/tests/reproducers/custom/AppletFolderInArchiveTag/testcases/0000775000076400007640000000000012574544466030357 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/custom/AppletFolderInArchiveTag/testcases/PaxHeaders.24993/Apple0000644000000000000000000000032412574544466030265 xustar00122 path=icedtea-web-1.5.3/tests/reproducers/custom/AppletFolderInArchiveTag/testcases/AppletFolderInArchiveTagTests.java 30 mtime=1441974582.598017164 30 atime=1441974656.473867562 30 ctime=1441974670.111024541 icedtea-web-1.5.3/tests/reproducers/custom/AppletFolderInArchiveTag/testcases/AppletFolderInArchiveT0000664000076400007640000000471312574544466034605 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/custom/AppletFolderInArchiveTag/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466026175 xustar0030 mtime=1441974582.597017153 30 atime=1441974670.155025048 30 ctime=1441974670.111024541 icedtea-web-1.5.3/tests/reproducers/custom/AppletFolderInArchiveTag/srcs/0000775000076400007640000000000012574544466027333 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/custom/AppletFolderInArchiveTag/srcs/PaxHeaders.24993/Makefile0000644000000000000000000000013212574544466027712 xustar0030 mtime=1441974582.597017153 30 atime=1441974656.473867562 30 ctime=1441974670.111024541 icedtea-web-1.5.3/tests/reproducers/custom/AppletFolderInArchiveTag/srcs/Makefile0000664000076400007640000000127212574544466030775 0ustar00jvanekjvanek00000000000000TESTNAME=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.5.3/tests/reproducers/custom/AppletFolderInArchiveTag/srcs/PaxHeaders.24993/AppletFold0000644000000000000000000000031212574544466030227 xustar00112 path=icedtea-web-1.5.3/tests/reproducers/custom/AppletFolderInArchiveTag/srcs/AppletFolderInArchiveTag.java 30 mtime=1441974582.597017153 30 atime=1441974656.473867562 30 ctime=1441974670.111024541 icedtea-web-1.5.3/tests/reproducers/custom/AppletFolderInArchiveTag/srcs/AppletFolderInArchiveTag.ja0000664000076400007640000000414412574544466034460 0ustar00jvanekjvanek00000000000000import 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.5.3/tests/reproducers/custom/AppletFolderInArchiveTag/PaxHeaders.24993/resources0000644000000000000000000000013212574544466027235 xustar0030 mtime=1441974582.597017153 30 atime=1441974670.155025048 30 ctime=1441974670.111024541 icedtea-web-1.5.3/tests/reproducers/custom/AppletFolderInArchiveTag/resources/0000775000076400007640000000000012574544466030373 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/custom/AppletFolderInArchiveTag/resources/PaxHeaders.24993/Apple0000644000000000000000000000031612574544466030302 xustar00117 path=icedtea-web-1.5.3/tests/reproducers/custom/AppletFolderInArchiveTag/resources/AppletFolderInArchiveTag.html 30 mtime=1441974582.597017153 29 atime=1441974656.47286755 30 ctime=1441974670.111024541 icedtea-web-1.5.3/tests/reproducers/custom/AppletFolderInArchiveTag/resources/AppletFolderInArchiveT0000664000076400007640000000340412574544466034615 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/custom/PaxHeaders.24993/AppletExtendsFromOutsideJar0000644000000000000000000000013212574544466026013 xustar0030 mtime=1441974582.597017153 30 atime=1441974670.155025048 30 ctime=1441974670.111024541 icedtea-web-1.5.3/tests/reproducers/custom/AppletExtendsFromOutsideJar/0000775000076400007640000000000012574544466027151 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/custom/AppletExtendsFromOutsideJar/PaxHeaders.24993/testcases0000644000000000000000000000013212574544466030011 xustar0030 mtime=1441974582.597017153 30 atime=1441974670.155025048 30 ctime=1441974670.111024541 icedtea-web-1.5.3/tests/reproducers/custom/AppletExtendsFromOutsideJar/testcases/0000775000076400007640000000000012574544466031147 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/custom/AppletExtendsFromOutsideJar/testcases/PaxHeaders.24993/Ap0000644000000000000000000000033112574544466030352 xustar00128 path=icedtea-web-1.5.3/tests/reproducers/custom/AppletExtendsFromOutsideJar/testcases/AppletExtendsFromOutsideJarTests.java 30 mtime=1441974582.597017153 29 atime=1441974656.47286755 30 ctime=1441974670.111024541 icedtea-web-1.5.3/tests/reproducers/custom/AppletExtendsFromOutsideJar/testcases/AppletExtendsFromOu0000664000076400007640000000542012574544466035003 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/custom/AppletExtendsFromOutsideJar/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466026765 xustar0030 mtime=1441974582.596017142 30 atime=1441974670.155025048 30 ctime=1441974670.111024541 icedtea-web-1.5.3/tests/reproducers/custom/AppletExtendsFromOutsideJar/srcs/0000775000076400007640000000000012574544466030123 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/custom/AppletExtendsFromOutsideJar/srcs/PaxHeaders.24993/Referen0000644000000000000000000000013112574544466030352 xustar0030 mtime=1441974582.596017142 29 atime=1441974656.47286755 30 ctime=1441974670.111024541 icedtea-web-1.5.3/tests/reproducers/custom/AppletExtendsFromOutsideJar/srcs/Referenced.java0000664000076400007640000000316512574544466033035 0ustar00jvanekjvanek00000000000000/* Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the 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.5.3/tests/reproducers/custom/AppletExtendsFromOutsideJar/srcs/PaxHeaders.24993/Makefil0000644000000000000000000000013112574544466030334 xustar0030 mtime=1441974582.596017142 29 atime=1441974656.47286755 30 ctime=1441974670.111024541 icedtea-web-1.5.3/tests/reproducers/custom/AppletExtendsFromOutsideJar/srcs/Makefile0000664000076400007640000000147512574544466031572 0ustar00jvanekjvanek00000000000000TESTNAME=AppletExtendsFromOutsideJar SRC_FILES=AppletReferenceInSameJar.java AppletReferenceOutOfJar.java Referenced.java JAR_FILES=AppletReferenceInSameJar.class Referenced.class OUTER_FILE=AppletReferenceOutOfJar.class JAVAC_CLASSPATH=$(TEST_EXTENSIONS_DIR):$(NETX_DIR)/lib/classes.jar JAVAC=$(BOOT_DIR)/bin/javac JAR=$(BOOT_DIR)/bin/jar TMPDIR:=$(shell mktemp -d) prepare-reproducer: echo PREPARING REPRODUCER $(TESTNAME) in $(TMPDIR) $(JAVAC) -d $(TMPDIR) -classpath $(JAVAC_CLASSPATH) $(SRC_FILES) cd $(TMPDIR); \ $(JAR) cvf $(TESTNAME).jar $(JAR_FILES); \ mv $(OUTER_FILE) $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR); \ mv $(TESTNAME).jar $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR); echo PREPARED REPRODUCER $(TESTNAME), removing $(TMPDIR) rm -rf $(TMPDIR) clean-reproducer: echo NOTHING TO CLEAN FOR $(TESTNAME) icedtea-web-1.5.3/tests/reproducers/custom/AppletExtendsFromOutsideJar/srcs/PaxHeaders.24993/AppletR0000644000000000000000000000031412574544466030336 xustar00114 path=icedtea-web-1.5.3/tests/reproducers/custom/AppletExtendsFromOutsideJar/srcs/AppletReferenceOutOfJar.java 30 mtime=1441974582.596017142 30 atime=1441974656.471867539 30 ctime=1441974670.111024541 icedtea-web-1.5.3/tests/reproducers/custom/AppletExtendsFromOutsideJar/srcs/AppletReferenceOutOfJar.0000664000076400007640000000357712574544466034616 0ustar00jvanekjvanek00000000000000/* Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the 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.5.3/tests/reproducers/custom/AppletExtendsFromOutsideJar/srcs/PaxHeaders.24993/AppletR0000644000000000000000000000031512574544466030337 xustar00115 path=icedtea-web-1.5.3/tests/reproducers/custom/AppletExtendsFromOutsideJar/srcs/AppletReferenceInSameJar.java 30 mtime=1441974582.596017142 30 atime=1441974656.471867539 30 ctime=1441974670.111024541 icedtea-web-1.5.3/tests/reproducers/custom/AppletExtendsFromOutsideJar/srcs/AppletReferenceInSameJar0000664000076400007640000000334112574544466034645 0ustar00jvanekjvanek00000000000000/* Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the 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.5.3/tests/reproducers/custom/AppletExtendsFromOutsideJar/PaxHeaders.24993/resources0000644000000000000000000000013212574544466030025 xustar0030 mtime=1441974582.596017142 30 atime=1441974670.155025048 30 ctime=1441974670.111024541 icedtea-web-1.5.3/tests/reproducers/custom/AppletExtendsFromOutsideJar/resources/0000775000076400007640000000000012574544466031163 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/custom/AppletExtendsFromOutsideJar/resources/PaxHeaders.24993/Ap0000644000000000000000000000032512574544466030371 xustar00123 path=icedtea-web-1.5.3/tests/reproducers/custom/AppletExtendsFromOutsideJar/resources/AppletExtendsFromOutsideJar.html 30 mtime=1441974582.596017142 30 atime=1441974656.471867539 30 ctime=1441974670.111024541 icedtea-web-1.5.3/tests/reproducers/custom/AppletExtendsFromOutsideJar/resources/AppletExtendsFromOu0000664000076400007640000000363112574544466035021 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/custom/AppletExtendsFromOutsideJar/PaxHeaders.24993/README0000644000000000000000000000013212574544466026750 xustar0030 mtime=1441974582.596017142 30 atime=1441974656.471867539 30 ctime=1441974670.111024541 icedtea-web-1.5.3/tests/reproducers/custom/AppletExtendsFromOutsideJar/README0000664000076400007640000000035012574544466030027 0ustar00jvanekjvanek00000000000000This 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.5.3/tests/reproducers/custom/PaxHeaders.24993/AdditionalJarsInMetaInfIndexList0000644000000000000000000000013112574544466026663 xustar0029 mtime=1441974582.59501713 30 atime=1441974670.155025048 30 ctime=1441974670.111024541 icedtea-web-1.5.3/tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/0000775000076400007640000000000012574544466030022 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/PaxHeaders.24993/testcas0000644000000000000000000000013112574544466030331 xustar0029 mtime=1441974582.59501713 30 atime=1441974670.155025048 30 ctime=1441974670.111024541 icedtea-web-1.5.3/tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/testcases/0000775000076400007640000000000012574544466032020 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/testcases/PaxHeaders.2490000644000000000000000000000034312574544466030512 xustar00138 path=icedtea-web-1.5.3/tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/testcases/AdditionalJarsInMetaInfIndexListTests.java 29 mtime=1441974582.59501713 30 atime=1441974656.470867527 30 ctime=1441974670.111024541 icedtea-web-1.5.3/tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/testcases/AdditionalJars0000664000076400007640000000602612574544466034637 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/PaxHeaders.24993/srcs0000644000000000000000000000013112574544466027635 xustar0029 mtime=1441974582.59501713 30 atime=1441974670.155025048 30 ctime=1441974670.111024541 icedtea-web-1.5.3/tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/srcs/0000775000076400007640000000000012574544466030774 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/srcs/PaxHeaders.24993/Ma0000644000000000000000000000013112574544466030172 xustar0029 mtime=1441974582.59501713 30 atime=1441974656.470867527 30 ctime=1441974670.111024541 icedtea-web-1.5.3/tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/srcs/Makefile0000664000076400007640000000434412574544466032441 0ustar00jvanekjvanek00000000000000TESTNAME=AdditionalJarsInMetaInfIndexList ARCHIVE_TEST_FOLDER=archive_tag_folder_test JAVAC_CLASSPATH=$(TEST_EXTENSIONS_DIR):$(NETX_DIR)/lib/classes.jar KEYTOOL=$(BOOT_DIR)/bin/keytool JARSIGNER=$(BOOT_DIR)/bin/jarsigner JAVAC=$(BOOT_DIR)/bin/javac JAR=$(BOOT_DIR)/bin/jar # File used because the 'jar' command does not accept an empty file DUMMY_FILE=jar_dummy_content # Index jar causes main class jar to load INDEX_JAR_UNSIGNED=AdditionalJarsInMetaInfIndexListUnsigned.jar INDEX_JAR_SIGNED=AdditionalJarsInMetaInfIndexListSigned.jar MAINCLASS=LoadedViaMetaInfIndexList MAINCLASS_JAR_UNSIGNED=LoadedViaMetaInfIndexListUnsigned.jar MAINCLASS_JAR_SIGNED=LoadedViaMetaInfIndexListSigned.jar TMPDIR:=$(shell mktemp -d) prepare-reproducer: echo PREPARING REPRODUCER $(TESTNAME) in $(TMPDIR) $(JAVAC) -d $(TMPDIR) -classpath $(JAVAC_CLASSPATH) $(MAINCLASS).java # Create the jars which have INDEX.LIST cd $(TMPDIR) ; \ echo "This file exists because jar command does not take 0 args" > $(DUMMY_FILE) ; \ $(JAR) cvf $(INDEX_JAR_UNSIGNED) $(DUMMY_FILE) ; \ $(JAR) cvf $(INDEX_JAR_SIGNED) $(DUMMY_FILE) ; # Create the jar which has the main-class # and update INDEX_JAR_*'s index cd $(TMPDIR) ; \ $(JAR) cvf $(MAINCLASS_JAR_UNSIGNED) $(MAINCLASS).class ; \ $(JAR) cvf $(MAINCLASS_JAR_SIGNED) $(MAINCLASS).class ; \ $(JAR) i $(INDEX_JAR_UNSIGNED) $(MAINCLASS_JAR_UNSIGNED) ; \ $(JAR) i $(INDEX_JAR_SIGNED) $(MAINCLASS_JAR_SIGNED) ; # Sign some of the jars for the signed jar test cd $(TMPDIR) ; \ for jar_to_sign in $(MAINCLASS_JAR_SIGNED) $(INDEX_JAR_SIGNED); do \ $(BOOT_DIR)/bin/jarsigner -keystore $(TOP_BUILD_DIR)/$(PRIVATE_KEYSTORE_NAME) -storepass $(PRIVATE_KEYSTORE_PASS) \ -keypass $(PRIVATE_KEYSTORE_PASS) "$$jar_to_sign" $(TEST_CERT_ALIAS)_signed ; \ done # Move jars into deployment directory cd $(TMPDIR); \ mv $(INDEX_JAR_UNSIGNED) $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR) ; \ mv $(INDEX_JAR_SIGNED) $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR) ; \ mv $(MAINCLASS_JAR_UNSIGNED) $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR) ; \ mv $(MAINCLASS_JAR_SIGNED) $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR) ; echo PREPARED REPRODUCER $(TESTNAME), removing $(TMPDIR) rm -rf $(TMPDIR) clean-reproducer: echo NOTHING TO CLEAN FOR $(TESTNAME) icedtea-web-1.5.3/tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/srcs/PaxHeaders.24993/Lo0000644000000000000000000000032212574544466030211 xustar00121 path=icedtea-web-1.5.3/tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/srcs/LoadedViaMetaInfIndexList.java 29 mtime=1441974582.59501713 30 atime=1441974656.470867527 30 ctime=1441974670.111024541 icedtea-web-1.5.3/tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/srcs/LoadedViaMetaInfInd0000664000076400007640000000336012574544466034450 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/PaxHeaders.24993/resourc0000644000000000000000000000013112574544466030345 xustar0029 mtime=1441974582.59501713 30 atime=1441974670.155025048 30 ctime=1441974670.111024541 icedtea-web-1.5.3/tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/resources/0000775000076400007640000000000012574544466032034 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/resources/PaxHeaders.2490000644000000000000000000000034612574544466030531 xustar00141 path=icedtea-web-1.5.3/tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/resources/AdditionalJarsInMetaInfIndexListUnsigned.jnlp 29 mtime=1441974582.59501713 30 atime=1441974656.470867527 30 ctime=1441974670.111024541 icedtea-web-1.5.3/tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/resources/AdditionalJars0000664000076400007640000000440612574544466034653 0ustar00jvanekjvanek00000000000000 AdditionalJarsInMetaInfIndexListUnsigned IcedTea AdditionalJarsInMetaInfIndexListUnsigned icedtea-web-1.5.3/tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/resources/PaxHeaders.2490000644000000000000000000000034412574544466030527 xustar00139 path=icedtea-web-1.5.3/tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/resources/AdditionalJarsInMetaInfIndexListSigned.jnlp 29 mtime=1441974582.59501713 30 atime=1441974656.470867527 30 ctime=1441974670.111024541 icedtea-web-1.5.3/tests/reproducers/custom/AdditionalJarsInMetaInfIndexList/resources/AdditionalJars0000664000076400007640000000447012574544466034654 0ustar00jvanekjvanek00000000000000 AdditionalJarsInMetaInfIndexListSigned IcedTea AdditionalJarsInMetaInfIndexListSigned icedtea-web-1.5.3/tests/reproducers/custom/PaxHeaders.24993/remote0000644000000000000000000000013112574544466021707 xustar0029 mtime=1441974582.50201606 30 atime=1441974670.155025048 30 ctime=1441974670.111024541 icedtea-web-1.5.3/tests/reproducers/custom/remote/0000775000076400007640000000000012574544466023046 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/custom/remote/PaxHeaders.24993/testcases0000644000000000000000000000013212574544466023706 xustar0030 mtime=1441974582.503016071 30 atime=1441974670.155025048 30 ctime=1441974670.111024541 icedtea-web-1.5.3/tests/reproducers/custom/remote/testcases/0000775000076400007640000000000012574544466025044 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/custom/remote/testcases/PaxHeaders.24993/RemoteApplicationTests.0000644000000000000000000000013012574544466030424 xustar0030 mtime=1441974582.503016071 28 atime=1441974656.4858677 30 ctime=1441974670.111024541 icedtea-web-1.5.3/tests/reproducers/custom/remote/testcases/RemoteApplicationTests.java0000664000076400007640000001370412574544466032356 0ustar00jvanekjvanek00000000000000/* RemoteApplicationTests.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.util.Arrays; import java.util.Collections; import java.util.List; import net.sourceforge.jnlp.ProcessResult; import net.sourceforge.jnlp.ServerAccess; import net.sourceforge.jnlp.annotations.KnownToFail; import net.sourceforge.jnlp.annotations.NeedsDisplay; import net.sourceforge.jnlp.annotations.Remote; import org.junit.Test; @Remote public class RemoteApplicationTests { private static ServerAccess server = new ServerAccess(); private final List l = Collections.unmodifiableList(Arrays.asList(new String[]{"-Xtrustall"})); private final List ll = Collections.unmodifiableList(Arrays.asList(new String[]{"-Xtrustall", "-Xnofork"})); @Test @NeedsDisplay public void topCoderRemoteTest() throws Exception { RemoteApplicationSettings.RemoteApplicationTestcaseSettings settings = new RemoteApplicationSettings.TopCoder(); ProcessResult pr = server.executeJavawsUponUrl(ll, settings.getUrl()); settings.evaluate(pr); } @Test @NeedsDisplay public void sunSwingRemoteTest() throws Exception { RemoteApplicationSettings.RemoteApplicationTestcaseSettings settings = new RemoteApplicationSettings.SunSwingDemo(); ProcessResult pr = server.executeJavawsUponUrl(l, settings.getUrl()); settings.evaluate(pr); } @Test @NeedsDisplay public void fourierTransformRemoteTest() throws Exception { RemoteApplicationSettings.RemoteApplicationTestcaseSettings settings = new RemoteApplicationSettings.FourierTransform(); ProcessResult pr = server.executeJavawsUponUrl(null, settings.getUrl()); settings.evaluate(pr); } @Test @NeedsDisplay public void arboresRemoteTest() throws Exception { RemoteApplicationSettings.RemoteApplicationTestcaseSettings settings = new RemoteApplicationSettings.Arbores(); ProcessResult pr = server.executeJavawsUponUrl(l, settings.getUrl()); settings.evaluate(pr); } @Test @NeedsDisplay public void phetsimsRemoteTest() throws Exception { RemoteApplicationSettings.RemoteApplicationTestcaseSettings settings = new RemoteApplicationSettings.PhetSims(); ProcessResult pr = server.executeJavawsUponUrl(l, settings.getUrl()); settings.evaluate(pr); } @Test @NeedsDisplay public void arboresDepositRemoteTest() throws Exception { RemoteApplicationSettings.RemoteApplicationTestcaseSettings settings = new RemoteApplicationSettings.ArboresDeposit(); ProcessResult pr = server.executeJavawsUponUrl(l, settings.getUrl()); settings.evaluate(pr); } /* This application need all permissions, but contains unsigned jar. Have exception but works at least somehow */ @Test @NeedsDisplay public void orawebCernChRemoteTest() throws Exception { RemoteApplicationSettings.RemoteApplicationTestcaseSettings settings = new RemoteApplicationSettings.OrawebCernCh(); ProcessResult pr = server.executeJavawsUponUrl(ll, settings.getUrl()); settings.evaluate(pr); } @Test @NeedsDisplay public void AviationWeatherRemoteTest() throws Exception { RemoteApplicationSettings.RemoteApplicationTestcaseSettings settings = new RemoteApplicationSettings.AviationWeather(); ProcessResult pr = server.executeJavawsUponUrl(ll, settings.getUrl()); settings.evaluate(pr); } @Test @NeedsDisplay public void fuseSysRemoteTest() throws Exception { RemoteApplicationSettings.RemoteApplicationTestcaseSettings settings = new RemoteApplicationSettings.FuseSwing(); ProcessResult pr = server.executeJavawsUponUrl(l, settings.getUrl()); settings.evaluate(pr); } @Test @NeedsDisplay public void gantProjectRemoteTest() throws Exception { RemoteApplicationSettings.RemoteApplicationTestcaseSettings settings = new RemoteApplicationSettings.GnattProject(); ProcessResult pr = server.executeJavawsUponUrl(l, settings.getUrl()); settings.evaluate(pr); } @Test @NeedsDisplay public void geogebraRemoteTest() throws Exception { RemoteApplicationSettings.RemoteApplicationTestcaseSettings settings = new RemoteApplicationSettings.GeoGebra(); ProcessResult pr = server.executeJavawsUponUrl(ll, settings.getUrl()); settings.evaluate(pr); } } icedtea-web-1.5.3/tests/reproducers/custom/remote/testcases/PaxHeaders.24993/RemoteApplicationSettin0000644000000000000000000000012712574544466030520 xustar0029 mtime=1441974582.50201606 28 atime=1441974656.4858677 30 ctime=1441974670.111024541 icedtea-web-1.5.3/tests/reproducers/custom/remote/testcases/RemoteApplicationSettings.java0000664000076400007640000002121612574544466033051 0ustar00jvanekjvanek00000000000000/* RemoteApplicationTests.java Copyright (C) 2011 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ import java.net.MalformedURLException; import java.net.URL; import net.sourceforge.jnlp.JNLPFile; import net.sourceforge.jnlp.ProcessResult; import org.junit.Assert; import org.junit.Test; ; public class RemoteApplicationSettings { public static final String mustEmpty = "must be empty, was not"; public static final String stdout = "Stdout"; public static final String stderr = "Stderr"; public static final String stdoutEmpty = stdout + " " + mustEmpty; public static final String stderrEmpty = stderr + " " + mustEmpty; public static URL createCatchedUrl(String r) { try { return new URL(r); } catch (MalformedURLException mex) { throw new RuntimeException(mex); } } public interface RemoteApplicationTestcaseSettings { public URL getUrl(); public void evaluate(ProcessResult pr); } public static abstract class StringBasedURL implements RemoteApplicationTestcaseSettings { URL u; public String clean(String s){ return s.replaceAll("\\s*" + JNLPFile.TITLE_NOT_FOUND + "\\s*", "").trim(); } @Override public URL getUrl() { return u; } public StringBasedURL(String r) { this.u = createCatchedUrl(r); } } public static class FourierTransform extends StringBasedURL { public FourierTransform() { super("http://www.cs.brown.edu/exploratories/freeSoftware/repository/edu/brown/cs/exploratories/applets/fft1DApp/1d_fast_fourier_transform_java_jnlp.jnlp"); } @Override public void evaluate(ProcessResult pr) { Assert.assertTrue(stdoutEmpty, 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")); } } 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) { Assert.assertTrue(pr.stdout.length() == 0); Assert.assertTrue(pr.stderr.length() == 0); } } 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 static class Arbores extends NearlyNoOutputs { 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 NearlyNoOutputs { 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.5.3/tests/reproducers/custom/remote/PaxHeaders.24993/srcs0000644000000000000000000000013112574544466022661 xustar0029 mtime=1441974582.50201606 30 atime=1441974670.155025048 30 ctime=1441974670.111024541 icedtea-web-1.5.3/tests/reproducers/custom/remote/srcs/0000775000076400007640000000000012574544466024020 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/custom/remote/srcs/PaxHeaders.24993/Makefile0000644000000000000000000000012712574544466024403 xustar0029 mtime=1441974582.50201606 28 atime=1441974656.4858677 30 ctime=1441974670.111024541 icedtea-web-1.5.3/tests/reproducers/custom/remote/srcs/Makefile0000664000076400007640000000022512574544466025457 0ustar00jvanekjvanek00000000000000prepare-reproducer: echo "Nothing to do to prepare remote reproducers now" clean-reproducer: echo "Nothing to do to clean remote reproducers now" icedtea-web-1.5.3/tests/reproducers/custom/PaxHeaders.24993/UnsignedContentInMETAINF0000644000000000000000000000013112574544466025016 xustar0029 mtime=1441974582.50201606 30 atime=1441974670.155025048 30 ctime=1441974670.111024541 icedtea-web-1.5.3/tests/reproducers/custom/UnsignedContentInMETAINF/0000775000076400007640000000000012574544466026155 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/custom/UnsignedContentInMETAINF/PaxHeaders.24993/testcases0000644000000000000000000000013112574544466027014 xustar0029 mtime=1441974582.50201606 30 atime=1441974670.155025048 30 ctime=1441974670.111024541 icedtea-web-1.5.3/tests/reproducers/custom/UnsignedContentInMETAINF/testcases/0000775000076400007640000000000012574544466030153 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/custom/UnsignedContentInMETAINF/testcases/PaxHeaders.24993/Unsig0000644000000000000000000000031312574544466030103 xustar00117 path=icedtea-web-1.5.3/tests/reproducers/custom/UnsignedContentInMETAINF/testcases/UnsignedContentInMETAINF.java 29 mtime=1441974582.50201606 28 atime=1441974656.4858677 29 ctime=1441974670.11002453 icedtea-web-1.5.3/tests/reproducers/custom/UnsignedContentInMETAINF/testcases/UnsignedContentInMETAI0000664000076400007640000000571312574544466034262 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/custom/UnsignedContentInMETAINF/PaxHeaders.24993/srcs0000644000000000000000000000013112574544466025770 xustar0030 mtime=1441974582.501016048 30 atime=1441974670.155025048 29 ctime=1441974670.11002453 icedtea-web-1.5.3/tests/reproducers/custom/UnsignedContentInMETAINF/srcs/0000775000076400007640000000000012574544466027127 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/custom/UnsignedContentInMETAINF/srcs/PaxHeaders.24993/Makefile0000644000000000000000000000013112574544466027505 xustar0030 mtime=1441974582.501016048 30 atime=1441974656.484867688 29 ctime=1441974670.11002453 icedtea-web-1.5.3/tests/reproducers/custom/UnsignedContentInMETAINF/srcs/Makefile0000664000076400007640000000136412574544466030573 0ustar00jvanekjvanek00000000000000TESTNAME=UnsignedContentInMETAINF JAVAC_CLASSPATH=$(TEST_EXTENSIONS_DIR):$(NETX_DIR)/lib/classes.jar DEPLOY_DIR=$(REPRODUCERS_TESTS_SERVER_DEPLOYDIR) JAVAC=$(BOOT_DIR)/bin/javac JAR=$(BOOT_DIR)/bin/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.5.3/tests/reproducers/custom/UnsignedContentInMETAINF/srcs/PaxHeaders.24993/META-INF0000644000000000000000000000013112574544466027130 xustar0030 mtime=1441974582.501016048 30 atime=1441974670.155025048 29 ctime=1441974670.11002453 icedtea-web-1.5.3/tests/reproducers/custom/UnsignedContentInMETAINF/srcs/META-INF/0000775000076400007640000000000012574544466030267 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/custom/UnsignedContentInMETAINF/srcs/META-INF/PaxHeaders.24993/u0000644000000000000000000000031512574544466027400 xustar00116 path=icedtea-web-1.5.3/tests/reproducers/custom/UnsignedContentInMETAINF/srcs/META-INF/unsigned_file_in_metainf 30 mtime=1441974582.501016048 30 atime=1441974656.484867688 29 ctime=1441974670.11002453 icedtea-web-1.5.3/tests/reproducers/custom/UnsignedContentInMETAINF/srcs/META-INF/unsigned_file_in_m0000664000076400007640000000012112574544466034021 0ustar00jvanekjvanek00000000000000This is an unsigned file to be placed in the META-INF/ folder of the copied jar. icedtea-web-1.5.3/tests/reproducers/custom/UnsignedContentInMETAINF/PaxHeaders.24993/resources0000644000000000000000000000013112574544466027030 xustar0030 mtime=1441974582.501016048 30 atime=1441974670.155025048 29 ctime=1441974670.11002453 icedtea-web-1.5.3/tests/reproducers/custom/UnsignedContentInMETAINF/resources/0000775000076400007640000000000012574544466030167 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/custom/UnsignedContentInMETAINF/resources/PaxHeaders.24993/Unsig0000644000000000000000000000031612574544466030122 xustar00117 path=icedtea-web-1.5.3/tests/reproducers/custom/UnsignedContentInMETAINF/resources/UnsignedContentInMETAINF.jnlp 30 mtime=1441974582.501016048 30 atime=1441974656.484867688 29 ctime=1441974670.11002453 icedtea-web-1.5.3/tests/reproducers/custom/UnsignedContentInMETAINF/resources/UnsignedContentInMETAI0000664000076400007640000000436312574544466034276 0ustar00jvanekjvanek00000000000000 read properties using System.getenv() with unsigned content in META-INF IcedTea user.name icedtea-web-1.5.3/tests/reproducers/custom/PaxHeaders.24993/TrustedOnlyAttribute0000644000000000000000000000013112574544466024574 xustar0030 mtime=1441974582.500016037 30 atime=1441974670.155025048 29 ctime=1441974670.11002453 icedtea-web-1.5.3/tests/reproducers/custom/TrustedOnlyAttribute/0000775000076400007640000000000012574544466025733 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/custom/TrustedOnlyAttribute/PaxHeaders.24993/testcases0000644000000000000000000000013112574544466026572 xustar0030 mtime=1441974582.500016037 30 atime=1441974670.155025048 29 ctime=1441974670.11002453 icedtea-web-1.5.3/tests/reproducers/custom/TrustedOnlyAttribute/testcases/0000775000076400007640000000000012574544466027731 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/custom/TrustedOnlyAttribute/testcases/PaxHeaders.24993/TrustedOn0000644000000000000000000000031212574544466030522 xustar00113 path=icedtea-web-1.5.3/tests/reproducers/custom/TrustedOnlyAttribute/testcases/TrustedOnlyAttributeTest.java 30 mtime=1441974582.500016037 30 atime=1441974656.484867688 29 ctime=1441974670.11002453 icedtea-web-1.5.3/tests/reproducers/custom/TrustedOnlyAttribute/testcases/TrustedOnlyAttributeTest.j0000664000076400007640000001163712574544466035134 0ustar00jvanekjvanek00000000000000/* 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 org.junit.Test; import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertFalse; 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; @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.5.3/tests/reproducers/custom/TrustedOnlyAttribute/PaxHeaders.24993/srcs0000644000000000000000000000013112574544466025546 xustar0030 mtime=1441974582.500016037 30 atime=1441974670.155025048 29 ctime=1441974670.11002453 icedtea-web-1.5.3/tests/reproducers/custom/TrustedOnlyAttribute/srcs/0000775000076400007640000000000012574544466026705 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/custom/TrustedOnlyAttribute/srcs/PaxHeaders.24993/TrustedOnlyAtt0000644000000000000000000000013112574544466030513 xustar0030 mtime=1441974582.500016037 30 atime=1441974656.483867677 29 ctime=1441974670.11002453 icedtea-web-1.5.3/tests/reproducers/custom/TrustedOnlyAttribute/srcs/TrustedOnlyAttribute.java0000664000076400007640000000371312574544466033734 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/custom/TrustedOnlyAttribute/srcs/PaxHeaders.24993/Makefile0000644000000000000000000000013112574544466027263 xustar0030 mtime=1441974582.500016037 30 atime=1441974656.483867677 29 ctime=1441974670.11002453 icedtea-web-1.5.3/tests/reproducers/custom/TrustedOnlyAttribute/srcs/Makefile0000664000076400007640000000171012574544466030344 0ustar00jvanekjvanek00000000000000TESTNAME=TrustedOnlyAttribute JARSIGNER=$(BOOT_DIR)/bin/jarsigner JAVAC=$(BOOT_DIR)/bin/javac JAR=$(BOOT_DIR)/bin/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 ; \ $(BOOT_DIR)/bin/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.5.3/tests/reproducers/custom/TrustedOnlyAttribute/srcs/PaxHeaders.24993/MANIFEST.MF0000644000000000000000000000013112574544466027255 xustar0030 mtime=1441974582.499016025 30 atime=1441974656.483867677 29 ctime=1441974670.11002453 icedtea-web-1.5.3/tests/reproducers/custom/TrustedOnlyAttribute/srcs/MANIFEST.MF0000664000076400007640000000002312574544466030332 0ustar00jvanekjvanek00000000000000Trusted-only: true icedtea-web-1.5.3/tests/reproducers/custom/TrustedOnlyAttribute/PaxHeaders.24993/resources0000644000000000000000000000013112574544466026606 xustar0030 mtime=1441974582.499016025 30 atime=1441974670.155025048 29 ctime=1441974670.11002453 icedtea-web-1.5.3/tests/reproducers/custom/TrustedOnlyAttribute/resources/0000775000076400007640000000000012574544466027745 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/custom/TrustedOnlyAttribute/resources/PaxHeaders.24993/TrustedOn0000644000000000000000000000031712574544466030543 xustar00118 path=icedtea-web-1.5.3/tests/reproducers/custom/TrustedOnlyAttribute/resources/TrustedOnlyAttribute-unsigned.html 30 mtime=1441974582.499016025 30 atime=1441974656.483867677 29 ctime=1441974670.11002453 icedtea-web-1.5.3/tests/reproducers/custom/TrustedOnlyAttribute/resources/TrustedOnlyAttribute-unsig0000664000076400007640000000353112574544466035175 0ustar00jvanekjvanek00000000000000 icedtea-web-1.5.3/tests/reproducers/custom/TrustedOnlyAttribute/resources/PaxHeaders.24993/TrustedOn0000644000000000000000000000033012574544466030536 xustar00127 path=icedtea-web-1.5.3/tests/reproducers/custom/TrustedOnlyAttribute/resources/TrustedOnlyAttribute-unsigned-security.jnlp 30 mtime=1441974582.499016025 30 atime=1441974656.483867677 29 ctime=1441974670.11002453 icedtea-web-1.5.3/tests/reproducers/custom/TrustedOnlyAttribute/resources/TrustedOnlyAttribute-unsig0000664000076400007640000000444212574544466035177 0ustar00jvanekjvanek00000000000000 TrustedOnlyAttribute IcedTea Trusted-only Manifest Attribute Test icedtea-web-1.5.3/tests/reproducers/custom/TrustedOnlyAttribute/resources/PaxHeaders.24993/TrustedOn0000644000000000000000000000033212574544466030540 xustar00129 path=icedtea-web-1.5.3/tests/reproducers/custom/TrustedOnlyAttribute/resources/TrustedOnlyAttribute-unsigned-nosecurity.jnlp 30 mtime=1441974582.499016025 30 atime=1441974656.482867665 29 ctime=1441974670.11002453 icedtea-web-1.5.3/tests/reproducers/custom/TrustedOnlyAttribute/resources/TrustedOnlyAttribute-unsig0000664000076400007640000000435012574544466035175 0ustar00jvanekjvanek00000000000000 TrustedOnlyAttribute IcedTea Trusted-only Manifest Attribute Test icedtea-web-1.5.3/tests/reproducers/custom/TrustedOnlyAttribute/resources/PaxHeaders.24993/TrustedOn0000644000000000000000000000031512574544466030541 xustar00116 path=icedtea-web-1.5.3/tests/reproducers/custom/TrustedOnlyAttribute/resources/TrustedOnlyAttribute-signed.html 30 mtime=1441974582.498016013 30 atime=1441974656.482867665 29 ctime=1441974670.11002453 icedtea-web-1.5.3/tests/reproducers/custom/TrustedOnlyAttribute/resources/TrustedOnlyAttribute-signe0000664000076400007640000000352712574544466035162 0ustar00jvanekjvanek00000000000000 icedtea-web-1.5.3/tests/reproducers/custom/TrustedOnlyAttribute/resources/PaxHeaders.24993/TrustedOn0000644000000000000000000000032612574544466030543 xustar00125 path=icedtea-web-1.5.3/tests/reproducers/custom/TrustedOnlyAttribute/resources/TrustedOnlyAttribute-signed-security.jnlp 30 mtime=1441974582.498016013 30 atime=1441974656.482867665 29 ctime=1441974670.11002453 icedtea-web-1.5.3/tests/reproducers/custom/TrustedOnlyAttribute/resources/TrustedOnlyAttribute-signe0000664000076400007640000000443612574544466035162 0ustar00jvanekjvanek00000000000000 TrustedOnlyAttribute IcedTea Trusted-only Manifest Attribute Test icedtea-web-1.5.3/tests/reproducers/custom/TrustedOnlyAttribute/resources/PaxHeaders.24993/TrustedOn0000644000000000000000000000033012574544466030536 xustar00127 path=icedtea-web-1.5.3/tests/reproducers/custom/TrustedOnlyAttribute/resources/TrustedOnlyAttribute-signed-nosecurity.jnlp 30 mtime=1441974582.498016013 30 atime=1441974656.482867665 29 ctime=1441974670.11002453 icedtea-web-1.5.3/tests/reproducers/custom/TrustedOnlyAttribute/resources/TrustedOnlyAttribute-signe0000664000076400007640000000434612574544466035162 0ustar00jvanekjvanek00000000000000 TrustedOnlyAttribute IcedTea Trusted-only Manifest Attribute Test icedtea-web-1.5.3/tests/reproducers/custom/PaxHeaders.24993/SignedAppletExternalMainClass0000644000000000000000000000013112574544466026271 xustar0030 mtime=1441974582.497016002 30 atime=1441974670.155025048 29 ctime=1441974670.11002453 icedtea-web-1.5.3/tests/reproducers/custom/SignedAppletExternalMainClass/0000775000076400007640000000000012574544466027430 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/custom/SignedAppletExternalMainClass/PaxHeaders.24993/testcases0000644000000000000000000000013112574544466030267 xustar0030 mtime=1441974582.497016002 30 atime=1441974670.155025048 29 ctime=1441974670.11002453 icedtea-web-1.5.3/tests/reproducers/custom/SignedAppletExternalMainClass/testcases/0000775000076400007640000000000012574544466031426 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/custom/SignedAppletExternalMainClass/testcases/PaxHeaders.24993/0000644000000000000000000000033412574544466030353 xustar00131 path=icedtea-web-1.5.3/tests/reproducers/custom/SignedAppletExternalMainClass/testcases/SignedAppletExternalMainClassTest.java 30 mtime=1441974582.497016002 30 atime=1441974656.481867654 29 ctime=1441974670.11002453 icedtea-web-1.5.3/tests/reproducers/custom/SignedAppletExternalMainClass/testcases/SignedAppletExter0000664000076400007640000000630112574544466034740 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/custom/SignedAppletExternalMainClass/PaxHeaders.24993/srcs0000644000000000000000000000013112574544466027243 xustar0030 mtime=1441974582.497016002 30 atime=1441974670.155025048 29 ctime=1441974670.11002453 icedtea-web-1.5.3/tests/reproducers/custom/SignedAppletExternalMainClass/srcs/0000775000076400007640000000000012574544466030402 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/custom/SignedAppletExternalMainClass/srcs/PaxHeaders.24993/Signe0000644000000000000000000000033112574544466030312 xustar00128 path=icedtea-web-1.5.3/tests/reproducers/custom/SignedAppletExternalMainClass/srcs/SignedAppletExternalMainClassHelper.java 30 mtime=1441974582.497016002 30 atime=1441974656.481867654 29 ctime=1441974670.11002453 icedtea-web-1.5.3/tests/reproducers/custom/SignedAppletExternalMainClass/srcs/SignedAppletExternalMa0000664000076400007640000000343512574544466034672 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/custom/SignedAppletExternalMainClass/srcs/PaxHeaders.24993/Signe0000644000000000000000000000032312574544466030313 xustar00122 path=icedtea-web-1.5.3/tests/reproducers/custom/SignedAppletExternalMainClass/srcs/SignedAppletExternalMainClass.java 30 mtime=1441974582.497016002 30 atime=1441974656.481867654 29 ctime=1441974670.11002453 icedtea-web-1.5.3/tests/reproducers/custom/SignedAppletExternalMainClass/srcs/SignedAppletExternalMa0000664000076400007640000000371212574544466034670 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/custom/SignedAppletExternalMainClass/srcs/PaxHeaders.24993/Makef0000644000000000000000000000013112574544466030266 xustar0030 mtime=1441974582.496015991 30 atime=1441974656.481867654 29 ctime=1441974670.11002453 icedtea-web-1.5.3/tests/reproducers/custom/SignedAppletExternalMainClass/srcs/Makefile0000664000076400007640000000156212574544466032046 0ustar00jvanekjvanek00000000000000TESTNAME=SignedAppletExternalMainClass JARSIGNER=$(BOOT_DIR)/bin/jarsigner JAVAC=$(BOOT_DIR)/bin/javac JAR=$(BOOT_DIR)/bin/jar TMPDIR:=$(shell mktemp -d) prepare-reproducer: echo PREPARING REPRODUCER $(TESTNAME) in $(TMPDIR) $(JAVAC) -d $(TMPDIR) $(TESTNAME).java $(TESTNAME)Helper.java cd $(TMPDIR) ; \ $(JAR) cvf $(TESTNAME)Helper.jar $(TESTNAME)Helper.class ; \ $(BOOT_DIR)/bin/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.5.3/tests/reproducers/custom/SignedAppletExternalMainClass/PaxHeaders.24993/resources0000644000000000000000000000013112574544466030303 xustar0030 mtime=1441974582.496015991 30 atime=1441974670.155025048 29 ctime=1441974670.11002453 icedtea-web-1.5.3/tests/reproducers/custom/SignedAppletExternalMainClass/resources/0000775000076400007640000000000012574544466031442 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/custom/SignedAppletExternalMainClass/resources/PaxHeaders.24993/0000644000000000000000000000033012574544466030363 xustar00127 path=icedtea-web-1.5.3/tests/reproducers/custom/SignedAppletExternalMainClass/resources/SignedAppletExternalMainClass.html 30 mtime=1441974582.496015991 30 atime=1441974656.481867654 29 ctime=1441974670.11002453 icedtea-web-1.5.3/tests/reproducers/custom/SignedAppletExternalMainClass/resources/SignedAppletExter0000664000076400007640000000355112574544466034760 0ustar00jvanekjvanek00000000000000 icedtea-web-1.5.3/tests/reproducers/custom/PaxHeaders.24993/SignedAppletCodebaseLoading0000644000000000000000000000013112574544466025717 xustar0030 mtime=1441974582.496015991 30 atime=1441974670.155025048 29 ctime=1441974670.11002453 icedtea-web-1.5.3/tests/reproducers/custom/SignedAppletCodebaseLoading/0000775000076400007640000000000012574544466027056 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/custom/SignedAppletCodebaseLoading/PaxHeaders.24993/testcases0000644000000000000000000000013112574544466027715 xustar0030 mtime=1441974582.496015991 30 atime=1441974670.155025048 29 ctime=1441974670.11002453 icedtea-web-1.5.3/tests/reproducers/custom/SignedAppletCodebaseLoading/testcases/0000775000076400007640000000000012574544466031054 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/custom/SignedAppletCodebaseLoading/testcases/PaxHeaders.24993/Si0000644000000000000000000000033112574544466030272 xustar00128 path=icedtea-web-1.5.3/tests/reproducers/custom/SignedAppletCodebaseLoading/testcases/SignedAppletCodebaseLoadingTests.java 30 mtime=1441974582.496015991 30 atime=1441974656.480867642 29 ctime=1441974670.11002453 icedtea-web-1.5.3/tests/reproducers/custom/SignedAppletCodebaseLoading/testcases/SignedAppletCodebas0000664000076400007640000000640612574544466034645 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/custom/SignedAppletCodebaseLoading/PaxHeaders.24993/srcs0000644000000000000000000000013112574544466026671 xustar0030 mtime=1441974582.495015979 30 atime=1441974670.155025048 29 ctime=1441974670.11002453 icedtea-web-1.5.3/tests/reproducers/custom/SignedAppletCodebaseLoading/srcs/0000775000076400007640000000000012574544466030030 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/custom/SignedAppletCodebaseLoading/srcs/PaxHeaders.24993/SignedA0000644000000000000000000000032512574544466030210 xustar00124 path=icedtea-web-1.5.3/tests/reproducers/custom/SignedAppletCodebaseLoading/srcs/SignedAppletCodebaseLoadingHelper.java 30 mtime=1441974582.495015979 30 atime=1441974656.480867642 29 ctime=1441974670.11002453 icedtea-web-1.5.3/tests/reproducers/custom/SignedAppletCodebaseLoading/srcs/SignedAppletCodebaseLoad0000664000076400007640000000353312574544466034564 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/custom/SignedAppletCodebaseLoading/srcs/PaxHeaders.24993/SignedA0000644000000000000000000000031712574544466030211 xustar00118 path=icedtea-web-1.5.3/tests/reproducers/custom/SignedAppletCodebaseLoading/srcs/SignedAppletCodebaseLoading.java 30 mtime=1441974582.495015979 30 atime=1441974656.480867642 29 ctime=1441974670.11002453 icedtea-web-1.5.3/tests/reproducers/custom/SignedAppletCodebaseLoading/srcs/SignedAppletCodebaseLoad0000664000076400007640000000370512574544466034565 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/custom/SignedAppletCodebaseLoading/srcs/PaxHeaders.24993/Makefil0000644000000000000000000000013112574544466030241 xustar0030 mtime=1441974582.495015979 30 atime=1441974656.480867642 29 ctime=1441974670.11002453 icedtea-web-1.5.3/tests/reproducers/custom/SignedAppletCodebaseLoading/srcs/Makefile0000664000076400007640000000220712574544466031471 0ustar00jvanekjvanek00000000000000TESTNAME=SignedAppletCodebaseLoading SRC_FILES=SignedAppletCodebaseLoading.java SignedAppletCodebaseLoadingHelper.java JAVAC_CLASSPATH=$(TEST_EXTENSIONS_DIR):$(NETX_DIR)/lib/classes.jar JAVAC=$(BOOT_DIR)/bin/javac JAR=$(BOOT_DIR)/bin/jar JARSIGNER=$(BOOT_DIR)/bin/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.5.3/tests/reproducers/custom/SignedAppletCodebaseLoading/PaxHeaders.24993/resources0000644000000000000000000000013112574544466027731 xustar0030 mtime=1441974582.495015979 30 atime=1441974670.155025048 29 ctime=1441974670.11002453 icedtea-web-1.5.3/tests/reproducers/custom/SignedAppletCodebaseLoading/resources/0000775000076400007640000000000012574544466031070 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/custom/SignedAppletCodebaseLoading/resources/PaxHeaders.24993/Si0000644000000000000000000000032412574544466030310 xustar00123 path=icedtea-web-1.5.3/tests/reproducers/custom/SignedAppletCodebaseLoading/resources/SignedAppletCodebaseLoading.html 30 mtime=1441974582.495015979 30 atime=1441974656.479867631 29 ctime=1441974670.11002453 icedtea-web-1.5.3/tests/reproducers/custom/SignedAppletCodebaseLoading/resources/SignedAppletCodebas0000664000076400007640000000407512574544466034661 0ustar00jvanekjvanek00000000000000 icedtea-web-1.5.3/tests/reproducers/custom/PaxHeaders.24993/MultipleSignaturesPerJar0000644000000000000000000000013112574544466025360 xustar0030 mtime=1441974582.494015968 30 atime=1441974670.155025048 29 ctime=1441974670.11002453 icedtea-web-1.5.3/tests/reproducers/custom/MultipleSignaturesPerJar/0000775000076400007640000000000012574544466026517 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/custom/MultipleSignaturesPerJar/PaxHeaders.24993/testcases0000644000000000000000000000013112574544466027356 xustar0030 mtime=1441974582.494015968 30 atime=1441974670.155025048 29 ctime=1441974670.11002453 icedtea-web-1.5.3/tests/reproducers/custom/MultipleSignaturesPerJar/testcases/0000775000076400007640000000000012574544466030515 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/custom/MultipleSignaturesPerJar/testcases/PaxHeaders.24993/Multi0000644000000000000000000000032412574544466030454 xustar00122 path=icedtea-web-1.5.3/tests/reproducers/custom/MultipleSignaturesPerJar/testcases/MultipleSignaturesPerJarTests.java 30 mtime=1441974582.494015968 30 atime=1441974656.479867631 30 ctime=1441974670.109024518 icedtea-web-1.5.3/tests/reproducers/custom/MultipleSignaturesPerJar/testcases/MultipleSignaturesPerJ0000664000076400007640000001344512574544466035070 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/custom/MultipleSignaturesPerJar/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466026333 xustar0030 mtime=1441974582.494015968 30 atime=1441974670.155025048 30 ctime=1441974670.109024518 icedtea-web-1.5.3/tests/reproducers/custom/MultipleSignaturesPerJar/srcs/0000775000076400007640000000000012574544466027471 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/custom/MultipleSignaturesPerJar/srcs/PaxHeaders.24993/somecrazyt0000644000000000000000000000013212574544466030533 xustar0030 mtime=1441974582.494015968 30 atime=1441974670.155025048 30 ctime=1441974670.109024518 icedtea-web-1.5.3/tests/reproducers/custom/MultipleSignaturesPerJar/srcs/somecrazytestpackage/0000775000076400007640000000000012574544466033721 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/custom/MultipleSignaturesPerJar/srcs/somecrazytestpackage/PaxHea0000644000000000000000000000034312574544466031220 xustar00137 path=icedtea-web-1.5.3/tests/reproducers/custom/MultipleSignaturesPerJar/srcs/somecrazytestpackage/MultipleSignaturesPerJarMain.java 30 mtime=1441974582.494015968 30 atime=1441974656.479867631 30 ctime=1441974670.109024518 icedtea-web-1.5.3/tests/reproducers/custom/MultipleSignaturesPerJar/srcs/somecrazytestpackage/Multip0000664000076400007640000000607312574544466035124 0ustar00jvanekjvanek00000000000000 /* 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.5.3/tests/reproducers/custom/MultipleSignaturesPerJar/srcs/PaxHeaders.24993/Makefile0000644000000000000000000000013212574544466030050 xustar0030 mtime=1441974582.493015956 30 atime=1441974656.479867631 30 ctime=1441974670.109024518 icedtea-web-1.5.3/tests/reproducers/custom/MultipleSignaturesPerJar/srcs/Makefile0000664000076400007640000000442212574544466031133 0ustar00jvanekjvanek00000000000000TESTNAME=MultipleSignaturesPerJar JAVAC_CLASSPATH=$(TEST_EXTENSIONS_DIR):$(NETX_DIR)/lib/classes.jar KEYTOOL=$(BOOT_DIR)/bin/keytool JARSIGNER=$(BOOT_DIR)/bin/jarsigner JARSIGNER_CMD=$(JARSIGNER) -keystore $(TOP_BUILD_DIR)/$(PRIVATE_KEYSTORE_NAME) -storepass $(PRIVATE_KEYSTORE_PASS) -keypass $(PRIVATE_KEYSTORE_PASS) JAVAC=$(BOOT_DIR)/bin/javac JAR=$(BOOT_DIR)/bin/jar # Index jar causes main class jar to load TMPDIR:=$(shell mktemp -d) prepare-reproducer: echo PREPARING REPRODUCER $(TESTNAME) in $(TMPDIR) $(JAVAC) -d $(TMPDIR) -classpath $(JAVAC_CLASSPATH) somecrazytestpackage/MultipleSignaturesPerJarMain.java # Extract ReadPropertiesSigned.class for our usage cd $(TMPDIR) ; \ $(JAR) xf $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR)/ReadPropertiesSigned.jar ReadPropertiesSigned.class ; # Create jars *testname*_A_and_B.jar, *testname*_A_only.jar, *testname*_B_only.jar # These are signed by signatures A and B, A only, B only, respectively. # *testname*_A_and_B.jar as well as *testname*_B_only.jar contain ReadPropertiesSigned.class, which exercises the signing. # *testname*_A_only.jar contains MultipleSignaturesTest.class, the (reused) main class for this reproducer. cd $(TMPDIR) ; \ $(JAR) cvf $(TESTNAME)_B_only.jar ReadPropertiesSigned.class ; \ cp $(TESTNAME)_B_only.jar $(TESTNAME)_A_and_B.jar ; \ $(JAR) cvf $(TESTNAME)_A_only.jar somecrazytestpackage ; # Sign with signature 'A', the signature used in the 'signed' reproducer group cd $(TMPDIR) ; \ for jar_to_sign in $(TESTNAME)_A_only.jar $(TESTNAME)_A_and_B.jar; do \ $(JARSIGNER_CMD) -sigfile Alpha "$$jar_to_sign" $(TEST_CERT_ALIAS)_signed ; \ done # Sign with signature 'B', the signature used in the 'signed2' reproducer group cd $(TMPDIR) ; \ for jar_to_sign in $(TESTNAME)_B_only.jar $(TESTNAME)_A_and_B.jar; do \ $(JARSIGNER_CMD) -sigfile Beta "$$jar_to_sign" $(TEST_CERT_ALIAS)_signed2 ; \ done # Move jars into deployment directory cd $(TMPDIR); \ mv $(TESTNAME)_B_only.jar $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR) ; \ mv $(TESTNAME)_A_only.jar $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR) ; \ mv $(TESTNAME)_A_and_B.jar $(REPRODUCERS_TESTS_SERVER_DEPLOYDIR) ; echo PREPARED REPRODUCER $(TESTNAME), removing $(TMPDIR) rm -rf $(TMPDIR) clean-reproducer: echo NOTHING TO CLEAN FOR $(TESTNAME)icedtea-web-1.5.3/tests/reproducers/custom/MultipleSignaturesPerJar/PaxHeaders.24993/resources0000644000000000000000000000013212574544466027373 xustar0030 mtime=1441974582.493015956 30 atime=1441974670.155025048 30 ctime=1441974670.109024518 icedtea-web-1.5.3/tests/reproducers/custom/MultipleSignaturesPerJar/resources/0000775000076400007640000000000012574544466030531 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/custom/MultipleSignaturesPerJar/resources/PaxHeaders.24993/Multi0000644000000000000000000000033212574544466030467 xustar00128 path=icedtea-web-1.5.3/tests/reproducers/custom/MultipleSignaturesPerJar/resources/MultipleSignaturesPerJarMismatching.jnlp 30 mtime=1441974582.493015956 30 atime=1441974656.478867619 30 ctime=1441974670.109024518 icedtea-web-1.5.3/tests/reproducers/custom/MultipleSignaturesPerJar/resources/MultipleSignaturesPerJ0000664000076400007640000000450612574544466035102 0ustar00jvanekjvanek00000000000000 MultipleSignaturesPerJarMismatching IcedTea MultipleSignaturesPerJarMismatching icedtea-web-1.5.3/tests/reproducers/custom/MultipleSignaturesPerJar/resources/PaxHeaders.24993/Multi0000644000000000000000000000033212574544466030467 xustar00128 path=icedtea-web-1.5.3/tests/reproducers/custom/MultipleSignaturesPerJar/resources/MultipleSignaturesPerJarMismatching.html 30 mtime=1441974582.493015956 30 atime=1441974656.478867619 30 ctime=1441974670.109024518 icedtea-web-1.5.3/tests/reproducers/custom/MultipleSignaturesPerJar/resources/MultipleSignaturesPerJ0000664000076400007640000000356712574544466035110 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/custom/MultipleSignaturesPerJar/resources/PaxHeaders.24993/Multi0000644000000000000000000000032712574544466030473 xustar00125 path=icedtea-web-1.5.3/tests/reproducers/custom/MultipleSignaturesPerJar/resources/MultipleSignaturesPerJarMatching.jnlp 30 mtime=1441974582.493015956 30 atime=1441974656.478867619 30 ctime=1441974670.109024518 icedtea-web-1.5.3/tests/reproducers/custom/MultipleSignaturesPerJar/resources/MultipleSignaturesPerJ0000664000076400007640000000447612574544466035110 0ustar00jvanekjvanek00000000000000 MultipleSignaturesPerJarMatching IcedTea MultipleSignaturesPerJarMatching icedtea-web-1.5.3/tests/reproducers/custom/MultipleSignaturesPerJar/resources/PaxHeaders.24993/Multi0000644000000000000000000000032712574544466030473 xustar00125 path=icedtea-web-1.5.3/tests/reproducers/custom/MultipleSignaturesPerJar/resources/MultipleSignaturesPerJarMatching.html 30 mtime=1441974582.492015944 30 atime=1441974656.478867619 30 ctime=1441974670.109024518 icedtea-web-1.5.3/tests/reproducers/custom/MultipleSignaturesPerJar/resources/MultipleSignaturesPerJ0000664000076400007640000000357112574544466035103 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/custom/PaxHeaders.24993/MixedSigningApplet0000644000000000000000000000013212574544466024150 xustar0030 mtime=1441974582.492015944 30 atime=1441974670.155025048 30 ctime=1441974670.109024518 icedtea-web-1.5.3/tests/reproducers/custom/MixedSigningApplet/0000775000076400007640000000000012574544466025306 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/custom/MixedSigningApplet/PaxHeaders.24993/testcases0000644000000000000000000000013212574544466026146 xustar0030 mtime=1441974582.492015944 30 atime=1441974670.155025048 30 ctime=1441974670.109024518 icedtea-web-1.5.3/tests/reproducers/custom/MixedSigningApplet/testcases/0000775000076400007640000000000012574544466027304 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/custom/MixedSigningApplet/testcases/PaxHeaders.24993/MixedSignin0000644000000000000000000000031612574544466030370 xustar00116 path=icedtea-web-1.5.3/tests/reproducers/custom/MixedSigningApplet/testcases/MixedSigningAppletSignedTests.java 30 mtime=1441974582.492015944 30 atime=1441974656.477867608 30 ctime=1441974670.109024518 icedtea-web-1.5.3/tests/reproducers/custom/MixedSigningApplet/testcases/MixedSigningAppletSignedTest0000664000076400007640000007411712574544466034766 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/custom/MixedSigningApplet/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466025122 xustar0030 mtime=1441974582.491015933 30 atime=1441974670.155025048 30 ctime=1441974670.109024518 icedtea-web-1.5.3/tests/reproducers/custom/MixedSigningApplet/srcs/0000775000076400007640000000000012574544466026260 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/custom/MixedSigningApplet/srcs/PaxHeaders.24993/MixedSigningAppl0000644000000000000000000000013212574544466030324 xustar0030 mtime=1441974582.491015933 30 atime=1441974656.477867608 30 ctime=1441974670.109024518 icedtea-web-1.5.3/tests/reproducers/custom/MixedSigningApplet/srcs/MixedSigningAppletSigned.java0000664000076400007640000002745312574544466034023 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/custom/MixedSigningApplet/srcs/PaxHeaders.24993/MixedSigningAppl0000644000000000000000000000013212574544466030324 xustar0030 mtime=1441974582.491015933 30 atime=1441974656.477867608 30 ctime=1441974670.109024518 icedtea-web-1.5.3/tests/reproducers/custom/MixedSigningApplet/srcs/MixedSigningAppletHelper.java0000664000076400007640000001155412574544466034024 0ustar00jvanekjvanek00000000000000/* 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.5.3/tests/reproducers/custom/MixedSigningApplet/srcs/PaxHeaders.24993/Makefile0000644000000000000000000000013212574544466026637 xustar0030 mtime=1441974582.491015933 30 atime=1441974656.476867596 30 ctime=1441974670.109024518 icedtea-web-1.5.3/tests/reproducers/custom/MixedSigningApplet/srcs/Makefile0000664000076400007640000000217212574544466027722 0ustar00jvanekjvanek00000000000000TESTNAME=MixedSigningApplet SRC_FILES=MixedSigningAppletSigned.java MixedSigningAppletHelper.java ENTRYPOINT_CLASSES=MixedSigningApplet JAVAC_CLASSPATH=$(TEST_EXTENSIONS_DIR):$(NETX_DIR)/lib/classes.jar JAVAC=$(BOOT_DIR)/bin/javac JAR=$(BOOT_DIR)/bin/jar JARSIGNER=$(BOOT_DIR)/bin/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.5.3/tests/reproducers/custom/MixedSigningApplet/PaxHeaders.24993/resources0000644000000000000000000000013212574544466026162 xustar0030 mtime=1441974582.490015921 30 atime=1441974670.155025048 30 ctime=1441974670.109024518 icedtea-web-1.5.3/tests/reproducers/custom/MixedSigningApplet/resources/0000775000076400007640000000000012574544466027320 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/custom/MixedSigningApplet/resources/PaxHeaders.24993/MixedSignin0000644000000000000000000000013212574544466030400 xustar0030 mtime=1441974582.490015921 30 atime=1441974656.476867596 30 ctime=1441974670.109024518 icedtea-web-1.5.3/tests/reproducers/custom/MixedSigningApplet/resources/MixedSigningApplet.jnlp0000664000076400007640000000451012574544466033740 0ustar00jvanekjvanek00000000000000 MixedSigningApplet IcedTea Test per-JAR security assignment and permissions PARAM_ARG_TARGET SECURITY_TAG_TARGET icedtea-web-1.5.3/tests/reproducers/custom/MixedSigningApplet/resources/PaxHeaders.24993/MixedSignin0000644000000000000000000000013212574544466030400 xustar0030 mtime=1441974582.490015921 30 atime=1441974656.476867596 30 ctime=1441974670.109024518 icedtea-web-1.5.3/tests/reproducers/custom/MixedSigningApplet/resources/MixedSigningApplet.html0000664000076400007640000000411612574544466033743 0ustar00jvanekjvanek00000000000000 icedtea-web-1.5.3/tests/reproducers/custom/PaxHeaders.24993/JNLPClassLoaderDeadlock0000644000000000000000000000013212574544466024724 xustar0030 mtime=1441974582.599017176 30 atime=1441974670.155025048 30 ctime=1441974670.109024518 icedtea-web-1.5.3/tests/reproducers/custom/JNLPClassLoaderDeadlock/0000775000076400007640000000000012574544466026062 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/custom/JNLPClassLoaderDeadlock/PaxHeaders.24993/srcs0000644000000000000000000000013212574544466025676 xustar0030 mtime=1441974582.600017188 30 atime=1441974670.155025048 30 ctime=1441974670.109024518 icedtea-web-1.5.3/tests/reproducers/custom/JNLPClassLoaderDeadlock/srcs/0000775000076400007640000000000012574544466027034 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/custom/JNLPClassLoaderDeadlock/srcs/PaxHeaders.24993/Makefile0000644000000000000000000000013212574544466027413 xustar0030 mtime=1441974582.600017188 30 atime=1441974656.476867596 30 ctime=1441974670.109024518 icedtea-web-1.5.3/tests/reproducers/custom/JNLPClassLoaderDeadlock/srcs/Makefile0000664000076400007640000000152212574544466030474 0ustar00jvanekjvanek00000000000000TESTNAME=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=$(BOOT_DIR)/bin/javac JAR=$(BOOT_DIR)/bin/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.5.3/tests/reproducers/custom/JNLPClassLoaderDeadlock/srcs/PaxHeaders.24993/JNLPClassLo0000644000000000000000000000031212574544466027722 xustar00112 path=icedtea-web-1.5.3/tests/reproducers/custom/JNLPClassLoaderDeadlock/srcs/JNLPClassLoaderDeadlock_2.java 30 mtime=1441974582.600017188 30 atime=1441974656.475867585 30 ctime=1441974670.109024518 icedtea-web-1.5.3/tests/reproducers/custom/JNLPClassLoaderDeadlock/srcs/JNLPClassLoaderDeadlock_2.ja0000664000076400007640000000464512574544466034111 0ustar00jvanekjvanek00000000000000import 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.5.3/tests/reproducers/custom/JNLPClassLoaderDeadlock/srcs/PaxHeaders.24993/JNLPClassLo0000644000000000000000000000031212574544466027722 xustar00112 path=icedtea-web-1.5.3/tests/reproducers/custom/JNLPClassLoaderDeadlock/srcs/JNLPClassLoaderDeadlock_1.java 30 mtime=1441974582.599017176 30 atime=1441974656.475867585 30 ctime=1441974670.109024518 icedtea-web-1.5.3/tests/reproducers/custom/JNLPClassLoaderDeadlock/srcs/JNLPClassLoaderDeadlock_1.ja0000664000076400007640000000144312574544466034101 0ustar00jvanekjvanek00000000000000import 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.5.3/tests/reproducers/custom/JNLPClassLoaderDeadlock/PaxHeaders.24993/resources0000644000000000000000000000013212574544466026736 xustar0030 mtime=1441974582.599017176 30 atime=1441974670.155025048 30 ctime=1441974670.109024518 icedtea-web-1.5.3/tests/reproducers/custom/JNLPClassLoaderDeadlock/resources/0000775000076400007640000000000012574544466030074 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/custom/JNLPClassLoaderDeadlock/resources/PaxHeaders.24993/JNLPCl0000644000000000000000000000031512574544466027763 xustar00115 path=icedtea-web-1.5.3/tests/reproducers/custom/JNLPClassLoaderDeadlock/resources/JNLPClassLoaderDeadlock.html 30 mtime=1441974582.599017176 30 atime=1441974656.475867585 30 ctime=1441974670.109024518 icedtea-web-1.5.3/tests/reproducers/custom/JNLPClassLoaderDeadlock/resources/JNLPClassLoaderDeadlock0000664000076400007640000000036712574544466034334 0ustar00jvanekjvanek00000000000000

icedtea-web-1.5.3/tests/reproducers/custom/JNLPClassLoaderDeadlock/PaxHeaders.24993/testcases0000644000000000000000000000013212574544466026722 xustar0030 mtime=1441974582.490015921 30 atime=1441974670.155025048 30 ctime=1441974670.109024518 icedtea-web-1.5.3/tests/reproducers/custom/JNLPClassLoaderDeadlock/testcases/0000775000076400007640000000000012574544466030060 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/tests/reproducers/custom/JNLPClassLoaderDeadlock/testcases/PaxHeaders.24993/JNLPCl0000644000000000000000000000032112574544466027744 xustar00119 path=icedtea-web-1.5.3/tests/reproducers/custom/JNLPClassLoaderDeadlock/testcases/JNLPClassLoaderDeadlockTest.java 30 mtime=1441974582.490015921 30 atime=1441974656.476867596 30 ctime=1441974670.109024518 icedtea-web-1.5.3/tests/reproducers/custom/JNLPClassLoaderDeadlock/testcases/JNLPClassLoaderDeadlock0000664000076400007640000000642412574544466034320 0ustar00jvanekjvanek00000000000000/* 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.5.3/PaxHeaders.24993/launcher0000644000000000000000000000013212574544466015205 xustar0030 mtime=1441974582.521016278 30 atime=1441974670.155025048 30 ctime=1441974670.105024472 icedtea-web-1.5.3/launcher/0000775000076400007640000000000012574544466016343 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/launcher/PaxHeaders.24993/launchers.in0000644000000000000000000000013212574544466017576 xustar0030 mtime=1441974582.521016278 30 atime=1441974656.355866203 30 ctime=1441974670.105024472 icedtea-web-1.5.3/launcher/launchers.in0000664000076400007640000000451712574544466020666 0ustar00jvanekjvanek00000000000000#!/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 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 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.5.3/PaxHeaders.24993/itweb-settings.desktop.in0000644000000000000000000000013212574544466020431 xustar0030 mtime=1441974582.519016255 30 atime=1441974656.354866192 30 ctime=1441974670.102024438 icedtea-web-1.5.3/itweb-settings.desktop.in0000664000076400007640000000105212574544466021510 0ustar00jvanekjvanek00000000000000[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 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.5.3/PaxHeaders.24993/policyeditor.desktop.in0000644000000000000000000000013212574544466020167 xustar0030 mtime=1441974582.534016428 30 atime=1441974656.431867078 30 ctime=1441974670.100024414 icedtea-web-1.5.3/policyeditor.desktop.in0000664000076400007640000000040412574544466021246 0ustar00jvanekjvanek00000000000000[Desktop Entry] Name=IcedTea-Web Policy Editor 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.5.3/PaxHeaders.24993/javaws.desktop.in0000644000000000000000000000013212574544466016754 xustar0030 mtime=1441974582.520016267 30 atime=1441974656.355866203 30 ctime=1441974670.099024403 icedtea-web-1.5.3/javaws.desktop.in0000664000076400007640000000034412574544466020036 0ustar00jvanekjvanek00000000000000[Desktop Entry] Name=IcedTea 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.5.3/PaxHeaders.24993/javaws.png0000644000000000000000000000013212574544466015462 xustar0030 mtime=1441974582.520016267 30 atime=1441974656.355866203 30 ctime=1441974670.098024392 icedtea-web-1.5.3/javaws.png0000664000076400007640000001115112574544466016542 0ustar00jvanekjvanek00000000000000‰PNG  IHDRSdúÍ sBIT|dˆ IDATxœå]Qh"ɺþœYBÉ‚t„–¡` t8´Ì‹²O=ä¥eá¢,FîÃÅåÂÅaá9pÙ‡‹áÀ¢,,‘…!²ƒa`P†4†mæ!èË /ƒ2NC Ø‚M ¤„¾­­ÆVÛŒgî£ÕÝÕŸýõ×__U{Þ¿eÇo/_˜1)‚xîº.ãpï®+0 /ß½3Ë…}$’‰»®ÊD,=™ÅBÀ ŸoݼãêŒÅR“yq½b2Ùÿg²™;¬Íd,5™éíÿËûûxýöíÒZçÒ’y±²bÖ+Õ¡Ïó¹ÜÒ6÷¥%3•Þ˜ów‰D|±•q‰¥$ó·—/̦:l•]Ôëu|üx´tÖ¹tdž]_›åÂþÄrÅraµ™KG¦¢(®ÊUÕêÒùÎ¥#ó@)».›N§çX“é±Tdþòâ…©75×奌££åñKCæáǦRžì+oâÙ³gKAèRØø‹™ÍÜ®É2ÆJ¥f\£Ûa)ÈÌífaÆÈ¸rÊå2V®}wnwNæŠÏgæs;·&²‹ôÎÝ[ç“yPR>›HPUëëwë;ïœÌ²ZšÙ¹r¹™ë6¸S2/VVÌf½>³ó‹Å;õwJf"ŸIï‚19&Íî„SâÎÈüxrbêšûÝ- ÃÀÑÉÉXç‘™ÛÍÎÔ*ûQØÝω'àNÈ<üøÑÔfè+o¢Z¾›'î„ÌB>77«ìâúzeáM}ád66ÌV»5÷ë”˳ ¹Übád6úgç…B!ÀúÆB­sádæò‹™®eŒ!•N.äZ],”ÌkŸÏTUw™ôY \./Ôw.”Ì|> ‹¼"Ë-N¸°02¯}>S9p?%1+(Š‚•YçÂÈŒÇc éxœP,r…yq½2—¡£[¨u!×Y™U{>Ízs!Ó !sAÍlâÉùKjæNæÙõµ©5›ó¾ÌD4«uœ]ÌÕ:çNfvgúì7!Ç‚8„@À}F]òùÜg=žyjÚ/VV̈vå/ ÇÁ¿J!Ñ0BAÚ Lo€´,«&Ä*ǃ† k£z‹ µT:ÀÚÚ·sÑÆÏ•Ì¿ýãf}B:Œ#b‚ IŠC”PêV ˜f VPÑ,ffôØÐ}§1†*k¡ÃuÿÆS¯þx52¿™ÇIËWÖë“óŠ !†¸œ„˜Ñ߆‰ÈÊš%¿EfºÄQB@ Eˆ1ì3 š JuM‡Ï·nžŸŸÎœÐ¹ùÌB¡0±ySŽB G!Ü ÒÆ*qø°ÖyQB Ôµ?-•æ3›™•  ê—ŒAœX0½¢lrî“à AŠ ÿÁ02}¾uÓ0Æw2(‚ hëí¡ï AͨhÊCþrº„& ?PÃ0pøîpæaÒ\|¦Önmâ@\¶ëÐê!X¥«€VMC³\A»¦†æŠÈ.Ž$@‘cͱ^&“Ï ×ÌãÓO3ós!³¸?^È€3ZЪE´š5xW /.µX« €MEd €ŸPF0ŽNf0Të÷‘ˆ>Oy@¥2;]çÌȼî“r<YŠ •á9Ùúü€µ`06‘P†Ö`“c‘€ÎJ}>¥›ÂæÀ”R I²ÔrŒ1H‘ðL¤ˆ3#³Z©ÙV)l àxçÁܹ  *Øo¢Û[;’H˜M2‡UŒ¡È4è}V)K²e™Ü`}‚bØ~¯k:ÂO‚xû™üLÈ\l˜…B/W¸Ùç“n"ÛML•µ&ô=oºÄõ¿—qðÃÆ Lˆ-eIBX ÃK¼Cg•eièÏí¤ñúõí—`6™ŽŽÌ`Bë[ %KòÈò<Ï#—ÍÛí3û†6²ÉsX…—ñv÷2^Æa•QøAÁƒBc@þ‘¡ˆx" ²j5뛨€x|x«Š|>wëE®ŸEæá‡fêÙq%¥Rx¼z7*Gñ4Þ“®¨0eḛ̂­´?{iÙžE×!€@1ZÈ;¤ß"RÌ:!vK¸‰D< ÿ„©Ô³[ùÐ[“ùòõk3z64—¤áæs„™í4É¡:òLCÁÐPeô¾@´ÛO“Å:c¨29£‰ò€‡´Î•eÐMì’AÄ‘õDÁÑjc? âððÃT„Ng®¯Lµ^E!ŸúŽã8$“îÄRTàñ<™F»Ý†¢”më®Â@µc¡#ðÃz1m0´À`ôº¥¢Y’‚À%¥T&« «%5ëÃ~‚( Náù󌹵õ«’ëi‹õ@ÀL=KAQ _,loo#›.WØljPµZŠªÀЧŸ×!$ñhÄËR?B¡ÐÄcó…žýøãÀg‚(à÷_÷ø|ëfX  88PqÿþÕXR]YæÑɉùý+ ]$Id²º>pGñøôsÓ‚@Á˜A I1T« šÍ&&åD)σRŠÁ&¥€—€] ^@Ó¼®O)úr"€¸lÝÇùù©§¢ÖÌX<‚'‘0J…síÁèɸ±–éó­›Ý¤áÒÉ4¾ë˜üÿþö‹©–{ÙtJ)ÆÀHc躎FCc—`Ì»kZµZ†aàò²mr¼^ð<ÕÕUˆb«^Ë?30ಠx½‚èŽLMÓ°ÞÐAÕ*5œ_Û¤66Ì (À0 Tj¸ºîHèHË|{xhæ2BÉf•eœžö&¡¢±(úÉŒ>ÞšHÀ ™8Žƒ¦i0Z mÖ†(Š;Á5cm»êZcÖ81B8B~¿bØ¿ßê§hê–ßBâ‘püé“çÍ«7xñú¥~FæyÆünëñ¡Cd^¯¬˜ñxº¦C’$ì‹8þôÉszz:P.,„šÇ¤pÈ !¬µÕjA×u\^Â1®³s^€ÔïˆÕ2nócBà§~»’ÇÜÇÿðŸ¥T2Ó;)ˆJÈüõ×:@æŠÏg†Ã–Ã%ÁÞÞŽ?9§õ›-mÀÏøýιÄÛ‚bõÆÐ…1f÷ø½ØÜ&?ŠP¡v®3¾¬¢¨‡ƒ¨×«xûöùý÷[6?vœùñèÈ”$ `€¢¢Öp||<ÒÙöë‡Q°,jŽ „€ã9p<BHç5›s‹Á^Ý›tQWççžlÖZ´•Ëíà]ßxþ›ÀÆ_̰DwoŒÝÝ]}ú=r 6k ë bräöw² ¢íNŒ–Àä%/[{Ѳè\nëëók$ø]]|Å·n†cRJÇÙ¾BlŸÏC­Þpu¥=÷P©TqïÛûW!d‘±¿_p•uV+=%°,É_tï"î–Ëkή¯íe8„„âÕes½qvÜŦu…BÞ>‰Û±ø²C’"¶Þ©¤Ž×"™±'Oìè¢X,áôôÔs¾½ºòHQ+Y¯VÇ*lW|>[ ,óïÅ…MJÁû­TÞÔF¶ÐŸÏüñYoJfûùs[ïi‡F»Ù];~‹Çc#×ô‰ýƒáàLndÀó<(íÍ´Zºc¹D2ÑsqÑ(¾ßrˆ3O=»K‰ÁC$!#°¾a®\ûÌ“>K-÷©5dytFýKDLŽÚïëõ^ˆôîÝ¡ùúõ[ó—ß~3»jI’ð÷Ÿ~=z¸¶æ!N{íþ·žZ½‰®ìGQH±'سˆ¦ë(vf#··Ý±»˜jû²þàÝZf,£}ÙFSkÚû^@4E:qŒÅî'ggf<³ä$!} YŠ€ Ö8|¿\F&›A³Z‡$KøùïÃ"ƒI˜z/¸¯_šûyçh ¢€L:ƒµµÙìy1Kœœ™‰d|`‰ Çó:³Õ®<#ø×›ݪþ·ÚXïèìÌÌe3`†K\ /‰äÀ8uØØ0Sɤ£° ‹íçÏÄXÓ`®».+NÎNÌåÕZ—FÛ^Õ!…$|Žoÿ?;f|0(ÄÞIEND®B`‚icedtea-web-1.5.3/PaxHeaders.24993/plugin0000644000000000000000000000013212574544466014702 xustar0030 mtime=1441974582.528016359 30 atime=1441974670.155025048 30 ctime=1441974670.096024369 icedtea-web-1.5.3/plugin/0000775000076400007640000000000012574544466016040 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/plugin/PaxHeaders.24993/tests0000644000000000000000000000013212574544466016044 xustar0030 mtime=1441974582.528016359 30 atime=1441974670.155025048 30 ctime=1441974670.096024369 icedtea-web-1.5.3/plugin/tests/0000775000076400007640000000000012574544466017202 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/plugin/tests/PaxHeaders.24993/LiveConnect0000644000000000000000000000013212574544466020255 xustar0030 mtime=1441974582.534016428 30 atime=1441974670.155025048 30 ctime=1441974670.096024369 icedtea-web-1.5.3/plugin/tests/LiveConnect/0000775000076400007640000000000012574544466021413 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/plugin/tests/LiveConnect/PaxHeaders.24993/jsj_type_conversion_tests.js0000644000000000000000000000013212574544466026206 xustar0030 mtime=1441974582.534016428 30 atime=1441974656.431867078 30 ctime=1441974670.096024369 icedtea-web-1.5.3/plugin/tests/LiveConnect/jsj_type_conversion_tests.js0000664000076400007640000006173412574544466027302 0ustar00jvanekjvanek00000000000000/************************************************************ * 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.5.3/plugin/tests/LiveConnect/PaxHeaders.24993/jsj_type_casting_tests.js0000644000000000000000000000013212574544466025451 xustar0030 mtime=1441974582.534016428 30 atime=1441974656.431867078 30 ctime=1441974670.096024369 icedtea-web-1.5.3/plugin/tests/LiveConnect/jsj_type_casting_tests.js0000664000076400007640000006173412574544466026545 0ustar00jvanekjvanek00000000000000/************************************************************ * 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.5.3/plugin/tests/LiveConnect/PaxHeaders.24993/jsj_set_tests.js0000644000000000000000000000013212574544466023553 xustar0030 mtime=1441974582.533016417 30 atime=1441974656.430867067 30 ctime=1441974670.096024369 icedtea-web-1.5.3/plugin/tests/LiveConnect/jsj_set_tests.js0000664000076400007640000002130112574544466024631 0ustar00jvanekjvanek00000000000000/****************************************** * 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.5.3/plugin/tests/LiveConnect/PaxHeaders.24993/jsj_get_tests.js0000644000000000000000000000013212574544466023537 xustar0030 mtime=1441974582.533016417 30 atime=1441974656.430867067 30 ctime=1441974670.096024369 icedtea-web-1.5.3/plugin/tests/LiveConnect/jsj_get_tests.js0000664000076400007640000001743712574544466024634 0ustar00jvanekjvanek00000000000000/******************************************** * 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.5.3/plugin/tests/LiveConnect/PaxHeaders.24993/jsj_func_rettype_tests.js0000644000000000000000000000013212574544466025467 xustar0030 mtime=1441974582.533016417 30 atime=1441974656.430867067 30 ctime=1441974670.096024369 icedtea-web-1.5.3/plugin/tests/LiveConnect/jsj_func_rettype_tests.js0000664000076400007640000002121112574544466026545 0ustar00jvanekjvanek00000000000000/*********************************************************************** * 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.5.3/plugin/tests/LiveConnect/PaxHeaders.24993/jsj_func_parameters_tests.js0000644000000000000000000000013212574544466026136 xustar0030 mtime=1441974582.532016405 30 atime=1441974656.429867055 30 ctime=1441974670.096024369 icedtea-web-1.5.3/plugin/tests/LiveConnect/jsj_func_parameters_tests.js0000664000076400007640000001524612574544466027227 0ustar00jvanekjvanek00000000000000 /******************************************************************** * 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.5.3/plugin/tests/LiveConnect/PaxHeaders.24993/jsj_func_overload_tests.js0000644000000000000000000000013212574544466025606 xustar0030 mtime=1441974582.532016405 30 atime=1441974656.429867055 30 ctime=1441974670.096024369 icedtea-web-1.5.3/plugin/tests/LiveConnect/jsj_func_overload_tests.js0000664000076400007640000001442512574544466026675 0ustar00jvanekjvanek00000000000000 /************************************************************** * 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.5.3/plugin/tests/LiveConnect/PaxHeaders.24993/jjs_set_tests.js0000644000000000000000000000013212574544466023553 xustar0030 mtime=1441974582.532016405 30 atime=1441974656.429867055 30 ctime=1441974670.096024369 icedtea-web-1.5.3/plugin/tests/LiveConnect/jjs_set_tests.js0000664000076400007640000002176012574544466024642 0ustar00jvanekjvanek00000000000000/***************************************** * 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.5.3/plugin/tests/LiveConnect/PaxHeaders.24993/jjs_get_tests.js0000644000000000000000000000013212574544466023537 xustar0030 mtime=1441974582.531016393 30 atime=1441974656.429867055 30 ctime=1441974670.096024369 icedtea-web-1.5.3/plugin/tests/LiveConnect/jjs_get_tests.js0000664000076400007640000000654412574544466024631 0ustar00jvanekjvanek00000000000000/***************************************** * 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.5.3/plugin/tests/LiveConnect/PaxHeaders.24993/jjs_func_rettype_tests.js0000644000000000000000000000013212574544466025467 xustar0030 mtime=1441974582.531016393 30 atime=1441974656.429867055 30 ctime=1441974670.096024369 icedtea-web-1.5.3/plugin/tests/LiveConnect/jjs_func_rettype_tests.js0000664000076400007640000000336112574544466026553 0ustar00jvanekjvanek00000000000000/****************************************************** * 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.5.3/plugin/tests/LiveConnect/PaxHeaders.24993/jjs_func_parameters_tests.js0000644000000000000000000000013212574544466026136 xustar0030 mtime=1441974582.531016393 30 atime=1441974656.428867044 30 ctime=1441974670.096024369 icedtea-web-1.5.3/plugin/tests/LiveConnect/jjs_func_parameters_tests.js0000664000076400007640000000715412574544466027226 0ustar00jvanekjvanek00000000000000/****************************************************** * 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.5.3/plugin/tests/LiveConnect/PaxHeaders.24993/jjs_eval_test.js0000644000000000000000000000013212574544466023524 xustar0030 mtime=1441974582.531016393 30 atime=1441974656.428867044 30 ctime=1441974670.096024369 icedtea-web-1.5.3/plugin/tests/LiveConnect/jjs_eval_test.js0000664000076400007640000000337212574544466024612 0ustar00jvanekjvanek00000000000000/****************************************************** * 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.5.3/plugin/tests/LiveConnect/PaxHeaders.24993/index.html0000644000000000000000000000013212574544466022327 xustar0030 mtime=1441974582.530016382 30 atime=1441974656.428867044 30 ctime=1441974670.096024369 icedtea-web-1.5.3/plugin/tests/LiveConnect/index.html0000664000076400007640000000723212574544466023414 0ustar00jvanekjvanek00000000000000
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.5.3/plugin/tests/LiveConnect/PaxHeaders.24993/common.js0000644000000000000000000000013212574544466022160 xustar0030 mtime=1441974582.530016382 30 atime=1441974656.428867044 30 ctime=1441974670.096024369 icedtea-web-1.5.3/plugin/tests/LiveConnect/common.js0000664000076400007640000001672712574544466023256 0ustar00jvanekjvanek00000000000000/* * 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.5.3/plugin/tests/LiveConnect/PaxHeaders.24993/build0000644000000000000000000000013212574544466021354 xustar0030 mtime=1441974582.530016382 30 atime=1441974656.428867044 30 ctime=1441974670.096024369 icedtea-web-1.5.3/plugin/tests/LiveConnect/build0000664000076400007640000000060612574544466022437 0ustar00jvanekjvanek00000000000000#!/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.5.3/plugin/tests/LiveConnect/PaxHeaders.24993/PluginTest.java0000644000000000000000000000013212574544466023273 xustar0030 mtime=1441974582.530016382 30 atime=1441974656.427867032 30 ctime=1441974670.096024369 icedtea-web-1.5.3/plugin/tests/LiveConnect/PluginTest.java0000664000076400007640000005176212574544466024367 0ustar00jvanekjvanek00000000000000import 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.5.3/plugin/tests/LiveConnect/PaxHeaders.24993/OverloadTestHelper3.java0000644000000000000000000000013112574544466025032 xustar0029 mtime=1441974582.52901637 30 atime=1441974656.427867032 30 ctime=1441974670.096024369 icedtea-web-1.5.3/plugin/tests/LiveConnect/OverloadTestHelper3.java0000664000076400007640000000010112574544466026104 0ustar00jvanekjvanek00000000000000public class OverloadTestHelper3 extends OverloadTestHelper2 {} icedtea-web-1.5.3/plugin/tests/LiveConnect/PaxHeaders.24993/OverloadTestHelper2.java0000644000000000000000000000013112574544466025031 xustar0029 mtime=1441974582.52901637 30 atime=1441974656.427867032 30 ctime=1441974670.096024369 icedtea-web-1.5.3/plugin/tests/LiveConnect/OverloadTestHelper2.java0000664000076400007640000000010012574544466026102 0ustar00jvanekjvanek00000000000000public class OverloadTestHelper2 extends OverloadTestHelper1 {} icedtea-web-1.5.3/plugin/tests/LiveConnect/PaxHeaders.24993/OverloadTestHelper1.java0000644000000000000000000000013112574544466025030 xustar0029 mtime=1441974582.52901637 30 atime=1441974656.427867032 30 ctime=1441974670.096024369 icedtea-web-1.5.3/plugin/tests/LiveConnect/OverloadTestHelper1.java0000664000076400007640000000004412574544466026110 0ustar00jvanekjvanek00000000000000public class OverloadTestHelper1 {} icedtea-web-1.5.3/plugin/tests/LiveConnect/PaxHeaders.24993/DummyObject.java0000644000000000000000000000013212574544466023417 xustar0030 mtime=1441974582.528016359 30 atime=1441974656.426867021 30 ctime=1441974670.096024369 icedtea-web-1.5.3/plugin/tests/LiveConnect/DummyObject.java0000664000076400007640000000040512574544466024477 0ustar00jvanekjvanek00000000000000public 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.5.3/plugin/PaxHeaders.24993/icedteanp0000644000000000000000000000013212574544466016636 xustar0030 mtime=1441974582.512016175 30 atime=1441974670.155025048 30 ctime=1441974670.095024357 icedtea-web-1.5.3/plugin/icedteanp/0000775000076400007640000000000012574544466017774 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/plugin/icedteanp/PaxHeaders.24993/java0000644000000000000000000000013212574544466017557 xustar0030 mtime=1441974582.515016209 30 atime=1441974670.155025048 30 ctime=1441974670.095024357 icedtea-web-1.5.3/plugin/icedteanp/java/0000775000076400007640000000000012574544466020715 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/plugin/icedteanp/java/PaxHeaders.24993/sun0000644000000000000000000000013212574544466020364 xustar0030 mtime=1441974582.515016209 30 atime=1441974670.155025048 30 ctime=1441974670.095024357 icedtea-web-1.5.3/plugin/icedteanp/java/sun/0000775000076400007640000000000012574544466021522 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/plugin/icedteanp/java/sun/PaxHeaders.24993/applet0000644000000000000000000000013212574544466021651 xustar0030 mtime=1441974582.528016359 30 atime=1441974670.155025048 30 ctime=1441974670.095024357 icedtea-web-1.5.3/plugin/icedteanp/java/sun/applet/0000775000076400007640000000000012574544466023007 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/plugin/icedteanp/java/sun/applet/PaxHeaders.24993/VoidPluginCallRequest.java0000644000000000000000000000013212574544466027016 xustar0030 mtime=1441974582.528016359 30 atime=1441974656.426867021 30 ctime=1441974670.095024357 icedtea-web-1.5.3/plugin/icedteanp/java/sun/applet/VoidPluginCallRequest.java0000664000076400007640000000410312574544466030075 0ustar00jvanekjvanek00000000000000/* 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.5.3/plugin/icedteanp/java/sun/applet/PaxHeaders.24993/TestEnv.java0000644000000000000000000000013212574544466024161 xustar0030 mtime=1441974582.528016359 30 atime=1441974656.426867021 30 ctime=1441974670.095024357 icedtea-web-1.5.3/plugin/icedteanp/java/sun/applet/TestEnv.java0000664000076400007640000001221712574544466025245 0ustar00jvanekjvanek00000000000000/* 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.5.3/plugin/icedteanp/java/sun/applet/PaxHeaders.24993/RequestQueue.java0000644000000000000000000000013212574544466025226 xustar0030 mtime=1441974582.527016347 30 atime=1441974656.426867021 30 ctime=1441974670.095024357 icedtea-web-1.5.3/plugin/icedteanp/java/sun/applet/RequestQueue.java0000664000076400007640000000473612574544466026321 0ustar00jvanekjvanek00000000000000/* 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.5.3/plugin/icedteanp/java/sun/applet/PaxHeaders.24993/PluginStreamHandler.java0000644000000000000000000000013212574544466026501 xustar0030 mtime=1441974582.527016347 30 atime=1441974656.426867021 30 ctime=1441974670.095024357 icedtea-web-1.5.3/plugin/icedteanp/java/sun/applet/PluginStreamHandler.java0000664000076400007640000003277712574544466027602 0ustar00jvanekjvanek00000000000000/* 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 javax.swing.SwingUtilities; 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 { private BufferedReader pluginInputReader; private BufferedWriter pluginOutputWriter; private RequestQueue queue = new RequestQueue(); private 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") { 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 pos = 0; int oldPos = 0; 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; if (type.equals("instance")) { PluginAppletViewer.handleMessage(identifier, freference, frest); } else if (type.equals("context")) { PluginDebug.debug("Sending to PASC: ", identifier, "/", reference, " and ", rest); AppletSecurityContextManager.handleMessage(identifier, reference, src, privileges, rest); } } catch (Exception e) { throw new PluginException(this, identifier, reference, e); } } private void handlePluginMessage(String message) { if (message.equals("plugin showconsole")) { if (JavaConsole.isEnabled()){ JavaConsole.getConsole().showConsoleLater(); } else { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, Translator.R("DPJavaConsoleDisabledHint")); } } else if (message.equals("plugin hideconsole")) { if (JavaConsole.isEnabled()){ JavaConsole.getConsole().hideConsoleLater(); } else { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, Translator.R("DPJavaConsoleDisabledHint")); } } else { // else this is something that was specifically requested finishCallRequest(message); } } 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); } } return; } } icedtea-web-1.5.3/plugin/icedteanp/java/sun/applet/PaxHeaders.24993/PluginProxySelector.java0000644000000000000000000000013212574544466026572 xustar0030 mtime=1441974582.527016347 30 atime=1441974656.426867021 30 ctime=1441974670.095024357 icedtea-web-1.5.3/plugin/icedteanp/java/sun/applet/PluginProxySelector.java0000664000076400007640000001512212574544466027654 0ustar00jvanekjvanek00000000000000/* 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 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 */ 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.5.3/plugin/icedteanp/java/sun/applet/PaxHeaders.24993/PluginProxyInfoRequest.java0000644000000000000000000000013212574544466027256 xustar0030 mtime=1441974582.526016336 30 atime=1441974656.425867009 30 ctime=1441974670.095024357 icedtea-web-1.5.3/plugin/icedteanp/java/sun/applet/PluginProxyInfoRequest.java0000664000076400007640000000612112574544466030337 0ustar00jvanekjvanek00000000000000/* 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.5.3/plugin/icedteanp/java/sun/applet/PaxHeaders.24993/PluginParameterParser.java0000644000000000000000000000013212574544466027045 xustar0030 mtime=1441974582.526016336 30 atime=1441974656.425867009 30 ctime=1441974670.095024357 icedtea-web-1.5.3/plugin/icedteanp/java/sun/applet/PluginParameterParser.java0000664000076400007640000000562312574544466030134 0ustar00jvanekjvanek00000000000000package 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.5.3/plugin/icedteanp/java/sun/applet/PaxHeaders.24993/PluginObjectStore.java0000644000000000000000000000013212574544466026173 xustar0030 mtime=1441974582.525016324 30 atime=1441974656.425867009 30 ctime=1441974670.095024357 icedtea-web-1.5.3/plugin/icedteanp/java/sun/applet/PluginObjectStore.java0000664000076400007640000001125012574544466027253 0ustar00jvanekjvanek00000000000000/* 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.5.3/plugin/icedteanp/java/sun/applet/PaxHeaders.24993/PluginMessageHandlerWorker.java0000644000000000000000000000013212574544466030024 xustar0030 mtime=1441974582.525016324 30 atime=1441974656.425867009 30 ctime=1441974670.095024357 icedtea-web-1.5.3/plugin/icedteanp/java/sun/applet/PluginMessageHandlerWorker.java0000664000076400007640000001163412574544466031112 0ustar00jvanekjvanek00000000000000/* 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.5.3/plugin/icedteanp/java/sun/applet/PaxHeaders.24993/PluginMessageConsumer.java0000644000000000000000000000013212574544466027050 xustar0030 mtime=1441974582.524016313 30 atime=1441974656.425867009 30 ctime=1441974670.095024357 icedtea-web-1.5.3/plugin/icedteanp/java/sun/applet/PluginMessageConsumer.java0000664000076400007640000002173312574544466030137 0ustar00jvanekjvanek00000000000000/* 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.5.3/plugin/icedteanp/java/sun/applet/PaxHeaders.24993/PluginMain.java0000644000000000000000000000013212574544466024634 xustar0030 mtime=1441974582.524016313 30 atime=1441974656.425867009 30 ctime=1441974670.095024357 icedtea-web-1.5.3/plugin/icedteanp/java/sun/applet/PluginMain.java0000664000076400007640000002613712574544466025726 0ustar00jvanekjvanek00000000000000/* 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.Hashtable; import java.util.Map; import java.util.Properties; 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.LogConfig; 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); @SuppressWarnings("unchecked") Hashtable handlers = (Hashtable)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. */ 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]); PluginAppletSecurityContext sc = new PluginAppletSecurityContext(0); sc.prePopulateLCClasses(); PluginAppletSecurityContext.setStreamhandler(streamHandler); AppletSecurityContextManager.addContext(0, sc); 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); } } 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); } } icedtea-web-1.5.3/plugin/icedteanp/java/sun/applet/PaxHeaders.24993/PluginException.java0000644000000000000000000000013212574544466025706 xustar0030 mtime=1441974582.523016301 30 atime=1441974656.424866998 30 ctime=1441974670.095024357 icedtea-web-1.5.3/plugin/icedteanp/java/sun/applet/PluginException.java0000664000076400007640000000435412574544466026775 0ustar00jvanekjvanek00000000000000/* 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.5.3/plugin/icedteanp/java/sun/applet/PaxHeaders.24993/PluginDebug.java0000644000000000000000000000013212574544466024776 xustar0030 mtime=1441974582.523016301 30 atime=1441974656.424866998 30 ctime=1441974670.095024357 icedtea-web-1.5.3/plugin/icedteanp/java/sun/applet/PluginDebug.java0000664000076400007640000000453112574544466026062 0ustar00jvanekjvanek00000000000000/* 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.5.3/plugin/icedteanp/java/sun/applet/PaxHeaders.24993/PluginCookieManager.java0000644000000000000000000000013212574544466026454 xustar0030 mtime=1441974582.523016301 30 atime=1441974656.424866998 30 ctime=1441974670.095024357 icedtea-web-1.5.3/plugin/icedteanp/java/sun/applet/PluginCookieManager.java0000664000076400007640000001027512574544466027542 0ustar00jvanekjvanek00000000000000/* 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.5.3/plugin/icedteanp/java/sun/applet/PaxHeaders.24993/PluginCookieInfoRequest.java0000644000000000000000000000013112574544466027345 xustar0029 mtime=1441974582.52201629 30 atime=1441974656.424866998 30 ctime=1441974670.095024357 icedtea-web-1.5.3/plugin/icedteanp/java/sun/applet/PluginCookieInfoRequest.java0000664000076400007640000000555012574544466030434 0ustar00jvanekjvanek00000000000000/* 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.5.3/plugin/icedteanp/java/sun/applet/PaxHeaders.24993/PluginClassLoader.java0000644000000000000000000000013112574544466026143 xustar0029 mtime=1441974582.52201629 30 atime=1441974656.424866998 30 ctime=1441974670.095024357 icedtea-web-1.5.3/plugin/icedteanp/java/sun/applet/PluginClassLoader.java0000664000076400007640000000373212574544466027232 0ustar00jvanekjvanek00000000000000/* 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.5.3/plugin/icedteanp/java/sun/applet/PaxHeaders.24993/PluginCallRequestFactory.java0000644000000000000000000000013112574544466027523 xustar0029 mtime=1441974582.52201629 30 atime=1441974656.424866998 30 ctime=1441974670.095024357 icedtea-web-1.5.3/plugin/icedteanp/java/sun/applet/PluginCallRequestFactory.java0000664000076400007640000000506712574544466030615 0ustar00jvanekjvanek00000000000000/* 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.5.3/plugin/icedteanp/java/sun/applet/PaxHeaders.24993/PluginCallRequest.java0000644000000000000000000000013212574544466026174 xustar0030 mtime=1441974582.521016278 30 atime=1441974656.423866986 30 ctime=1441974670.095024357 icedtea-web-1.5.3/plugin/icedteanp/java/sun/applet/PluginCallRequest.java0000664000076400007640000000542612574544466027264 0ustar00jvanekjvanek00000000000000/* 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.5.3/plugin/icedteanp/java/sun/applet/PaxHeaders.24993/PluginAppletViewer.java0000644000000000000000000000013212574544466026357 xustar0030 mtime=1441974582.521016278 30 atime=1441974656.423866986 30 ctime=1441974670.095024357 icedtea-web-1.5.3/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java0000664000076400007640000017020712574544466027447 0ustar00jvanekjvanek00000000000000/* 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 static net.sourceforge.jnlp.runtime.Translator.R; import java.applet.Applet; import java.applet.AppletContext; import java.applet.AudioClip; import java.awt.BorderLayout; import java.awt.Component; import java.awt.Dimension; import java.awt.Frame; import java.awt.Graphics; import java.awt.Image; import java.awt.Insets; import java.awt.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.Hashtable; import java.util.Iterator; import java.util.Map; import java.util.Vector; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.TimeUnit; import java.util.concurrent.locks.Condition; import java.util.concurrent.locks.ReentrantLock; import javax.swing.SwingUtilities; import net.sourceforge.jnlp.LaunchException; import net.sourceforge.jnlp.NetxPanel; import net.sourceforge.jnlp.PluginParameters; import net.sourceforge.jnlp.runtime.JNLPClassLoader; import net.sourceforge.jnlp.security.appletextendedsecurity.AppletSecurityLevel; import net.sourceforge.jnlp.security.appletextendedsecurity.AppletStartupSecuritySettings; import net.sourceforge.jnlp.splashscreen.SplashController; import net.sourceforge.jnlp.splashscreen.SplashPanel; import net.sourceforge.jnlp.splashscreen.SplashUtils; import sun.awt.AppContext; import sun.awt.SunToolkit; import sun.awt.X11.XEmbeddedFrame; import com.sun.jndi.toolkit.url.UrlUtil; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.util.logging.OutputController; /* */ // 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 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 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(); applets.put(identifier, appletFrame); appletAdded.signalAll(); 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(); panelLive.signalAll(); 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); PluginAppletPanelFactory factory = new PluginAppletPanelFactory(); AppletMessageHandler amh = new AppletMessageHandler("appletviewer"); URL url = new URL(documentBase); URLConnection conn = url.openConnection(); /* The original URL may have been redirected - this * sets it to whatever URL/codebase we ended up getting */ url = conn.getURL(); PluginParameters params = new PluginParameterParser().parse(width, height, paramString); // Let user know we are starting up streamhandler.write("instance " + identifier + " status " + amh.getMessage("status.start")); factory.createPanel(streamhandler, identifier, handle, url, params); long maxTimeToSleep = APPLET_TIMEOUT; appletsLock.lock(); try { 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; } } /** * Handle an incoming message from the plugin. */ 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; } } } // Else set to given status statusLock.lock(); status.put(identifier, newStatus); initComplete.signalAll(); 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 */ 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; } } 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(); } private static Vector appletPanels = new Vector(); /** * Get an applet by name. */ @Override public Applet getApplet(String name) { name = name.toLowerCase(); SocketPermission panelSp = new SocketPermission(panel.getCodeBase().getHost(), "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(p.getCodeBase().getHost(), "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(panel.getCodeBase().getHost(), "connect"); synchronized(appletPanels) { for (Enumeration e = appletPanels.elements(); e.hasMoreElements();) { AppletPanel p = e.nextElement(); if (p.getDocumentBase().equals(panel.getDocumentBase())) { SocketPermission sp = new SocketPermission(p.getCodeBase().getHost(), "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. */ static Hashtable systemParam = new Hashtable(); 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: Classlaoder 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? */ public static int countApplets() { return appletPanels.size(); } private static void checkConnect(URL url) { SecurityManager security = System.getSecurityManager(); if (security != null) { try { java.security.Permission perm = url.openConnection().getPermission(); 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.5.3/plugin/icedteanp/java/sun/applet/PaxHeaders.24993/PluginAppletSecurityContext.java0000644000000000000000000000013212574544466030272 xustar0030 mtime=1441974582.518016244 30 atime=1441974656.423866986 30 ctime=1441974670.095024357 icedtea-web-1.5.3/plugin/icedteanp/java/sun/applet/PluginAppletSecurityContext.java0000664000076400007640000015625612574544466031372 0ustar00jvanekjvanek00000000000000/* 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.Hashtable; 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) { if (name.equals("void")) { return Void.TYPE; } else if (name.equals("boolean")) { return Boolean.TYPE; } else if (name.equals("byte")) { return Byte.TYPE; } else if (name.equals("char")) { return Character.TYPE; } else if (name.equals("short")) { return Short.TYPE; } else if (name.equals("int")) { return Integer.TYPE; } else if (name.equals("long")) { return Long.TYPE; } else if (name.equals("float")) { return Float.TYPE; } else if (name.equals("double")) { return Double.TYPE; } else { return null; } } public Class[] getClassArray() { return typeList.subList(0, typeList.size()).toArray(new Class[] {}); } } public class PluginAppletSecurityContext { private static Hashtable classLoaders = new Hashtable(); private static Hashtable instanceClassLoaders = new Hashtable(); 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 new Character((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() { Hashtable map = new Hashtable(); 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); boolean result = false; Class clz = (Class) store.getObject(classID); Class sup = (Class) store.getObject(superclassID); 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); boolean result = false; Object o = store.getObject(objectID); Class c = (Class) store.getObject(classID); 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; byte[] b = null; StringBuffer buf = null; o = (String) store.getObject(stringID); 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(" " + 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; byte[] b = null; StringBuffer buf = null; o = (String) store.getObject(stringID); // FIXME: LiveConnect uses UCS-2. 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(" " + 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; byte[] b = null; StringBuffer buf = null; o = store.getObject(objectID).toString(); 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(" " + 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]; String ret = null; int i = 0; int j = 2; int c; while (i < length) { c = Integer.parseInt(args[j++], 16); byteArray[i++] = (byte) c; } 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 return; } 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; Constructor cs = null; try { if (methodName.equals("") || methodName.equals("")) { 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); } /** * Returns 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) { if (privilege.equals("UniversalBrowserRead")) { BrowserReadPermission bp = new BrowserReadPermission(); grantedPermissions.add(bp); } else if (privilege.equals("UniversalJavaPermission")) { AllPermission ap = new AllPermission(); grantedPermissions.add(ap); } } 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.5.3/plugin/icedteanp/java/sun/applet/PaxHeaders.24993/PluginAppletPanelFactory.java0000644000000000000000000000013212574544466027505 xustar0030 mtime=1441974582.517016232 30 atime=1441974656.423866986 30 ctime=1441974670.095024357 icedtea-web-1.5.3/plugin/icedteanp/java/sun/applet/PluginAppletPanelFactory.java0000664000076400007640000002323312574544466030571 0ustar00jvanekjvanek00000000000000/* Copyright (C) 2012 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ /* * Copyright 1995-2004 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Sun designates this * particular file as subject to the "Classpath" exception as provided * by Sun in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, * CA 95054 USA or visit www.sun.com if you need additional information or * have any questions. */ package sun.applet; import java.applet.Applet; import java.lang.reflect.InvocationTargetException; import java.net.URL; import java.security.AccessController; import java.security.PrivilegedAction; import javax.swing.SwingUtilities; import net.sourceforge.jnlp.NetxPanel; import net.sourceforge.jnlp.PluginParameters; 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 NetxPanel panel = AccessController.doPrivileged(new PrivilegedAction() { public NetxPanel run() { NetxPanel panel = new NetxPanel(doc, params); 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.5.3/plugin/icedteanp/java/sun/applet/PaxHeaders.24993/MethodOverloadResolver.java0000644000000000000000000000013212574544466027227 xustar0030 mtime=1441974582.516016221 30 atime=1441974656.423866986 30 ctime=1441974670.095024357 icedtea-web-1.5.3/plugin/icedteanp/java/sun/applet/MethodOverloadResolver.java0000664000076400007640000004463012574544466030317 0ustar00jvanekjvanek00000000000000/* 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 Object castedObject; public WeightedCast(int cost, Object castedObject) { this.cost = cost; this.castedObject = castedObject; } public Object getCastedObject() { return castedObject; } public int getCost() { return cost; } } 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; java.lang.reflect.AccessibleObject cheapestMethod = null; Object[] cheapestArgs = null; boolean ambiguous = false; methodLoop: for (java.lang.reflect.AccessibleObject candidate : candidates) { int methodCost = 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(); Object castedObj = paramTypeClass.isPrimitive() ? weightedCast.getCastedObject() : paramTypeClass.cast(weightedCast.getCastedObject()); castedArgs[i] = castedObj; if (PluginDebug.DEBUG) { /* avoid toString if not needed */ Class castedObjClass = castedObj == null ? null : castedObj.getClass(); boolean castedObjIsPrim = castedObj == null ? false : castedObj.getClass().isPrimitive(); PluginDebug.debug("Param " + i + " of method " + candidate + " has cost " + weightedCast.getCost() + " original param type " + suppliedParamClass + " casted to " + castedObjClass + " isPrimitive=" + castedObjIsPrim + " value " + castedObj); } } if (methodCost <= lowestCost) { if (methodCost < lowestCost || argumentsAreSubclassesOf(castedArgs, cheapestArgs)) { lowestCost = methodCost; cheapestArgs = castedArgs; cheapestMethod = candidate; 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)); } // Any java value to String if (paramTypeClass.equals(String.class)) { return new WeightedCast(CLASS_STRING_COST, suppliedParam.toString()); } return null; } 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.5.3/plugin/icedteanp/java/sun/applet/PaxHeaders.24993/GetWindowPluginCallRequest.java0000644000000000000000000000013212574544466030024 xustar0030 mtime=1441974582.516016221 30 atime=1441974656.422866975 30 ctime=1441974670.095024357 icedtea-web-1.5.3/plugin/icedteanp/java/sun/applet/GetWindowPluginCallRequest.java0000664000076400007640000000461212574544466031110 0ustar00jvanekjvanek00000000000000/* 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.5.3/plugin/icedteanp/java/sun/applet/PaxHeaders.24993/GetMemberPluginCallRequest.java0000644000000000000000000000013212574544466027764 xustar0030 mtime=1441974582.515016209 30 atime=1441974656.422866975 30 ctime=1441974670.095024357 icedtea-web-1.5.3/plugin/icedteanp/java/sun/applet/GetMemberPluginCallRequest.java0000664000076400007640000000476112574544466031055 0ustar00jvanekjvanek00000000000000/* 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.5.3/plugin/icedteanp/java/sun/applet/PaxHeaders.24993/AppletSecurityContextManager.jav0000644000000000000000000000013212574544466030245 xustar0030 mtime=1441974582.515016209 30 atime=1441974656.422866975 30 ctime=1441974670.095024357 icedtea-web-1.5.3/plugin/icedteanp/java/sun/applet/AppletSecurityContextManager.java0000664000076400007640000000571512574544466031477 0ustar00jvanekjvanek00000000000000/* 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.5.3/plugin/icedteanp/java/PaxHeaders.24993/netscape0000644000000000000000000000013212574544466021361 xustar0030 mtime=1441974582.514016198 30 atime=1441974670.155025048 30 ctime=1441974670.095024357 icedtea-web-1.5.3/plugin/icedteanp/java/netscape/0000775000076400007640000000000012574544466022517 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/plugin/icedteanp/java/netscape/PaxHeaders.24993/security0000644000000000000000000000013212574544466023230 xustar0030 mtime=1441974582.514016198 30 atime=1441974670.155025048 30 ctime=1441974670.095024357 icedtea-web-1.5.3/plugin/icedteanp/java/netscape/security/0000775000076400007640000000000012574544466024366 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/plugin/icedteanp/java/netscape/security/PaxHeaders.24993/PrivilegeManager.java0000644000000000000000000000013212574544466027371 xustar0030 mtime=1441974582.514016198 30 atime=1441974656.422866975 30 ctime=1441974670.095024357 icedtea-web-1.5.3/plugin/icedteanp/java/netscape/security/PrivilegeManager.java0000664000076400007640000000531112574544466030452 0ustar00jvanekjvanek00000000000000/* 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 */ 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 */ public static void disablePrivilege(String privilege) { PluginDebug.debug("netscape.security.disablePrivilege stub called"); } } icedtea-web-1.5.3/plugin/icedteanp/java/netscape/security/PaxHeaders.24993/ForbiddenTargetException.0000644000000000000000000000013212574544466030230 xustar0030 mtime=1441974582.514016198 30 atime=1441974656.422866975 30 ctime=1441974670.095024357 icedtea-web-1.5.3/plugin/icedteanp/java/netscape/security/ForbiddenTargetException.java0000664000076400007640000000372212574544466032157 0ustar00jvanekjvanek00000000000000/* 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.5.3/plugin/icedteanp/java/netscape/PaxHeaders.24993/javascript0000644000000000000000000000013212574544466023527 xustar0030 mtime=1441974582.514016198 30 atime=1441974670.155025048 30 ctime=1441974670.095024357 icedtea-web-1.5.3/plugin/icedteanp/java/netscape/javascript/0000775000076400007640000000000012574544466024665 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/plugin/icedteanp/java/netscape/javascript/PaxHeaders.24993/JSUtil.java0000644000000000000000000000013212574544466025621 xustar0030 mtime=1441974582.514016198 30 atime=1441974656.421866963 30 ctime=1441974670.095024357 icedtea-web-1.5.3/plugin/icedteanp/java/netscape/javascript/JSUtil.java0000664000076400007640000000520312574544466026702 0ustar00jvanekjvanek00000000000000/* -*- 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.5.3/plugin/icedteanp/java/netscape/javascript/PaxHeaders.24993/JSRunnable.java0000644000000000000000000000013212574544466026452 xustar0030 mtime=1441974582.514016198 30 atime=1441974656.421866963 30 ctime=1441974670.095024357 icedtea-web-1.5.3/plugin/icedteanp/java/netscape/javascript/JSRunnable.java0000664000076400007640000000517512574544466027543 0ustar00jvanekjvanek00000000000000/* -*- 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.5.3/plugin/icedteanp/java/netscape/javascript/PaxHeaders.24993/JSProxy.java0000644000000000000000000000013212574544466026025 xustar0030 mtime=1441974582.513016186 30 atime=1441974656.421866963 30 ctime=1441974670.095024357 icedtea-web-1.5.3/plugin/icedteanp/java/netscape/javascript/JSProxy.java0000664000076400007640000000463312574544466027114 0ustar00jvanekjvanek00000000000000/* -*- 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.5.3/plugin/icedteanp/java/netscape/javascript/PaxHeaders.24993/JSObjectUnboxPermission0000644000000000000000000000013212574544466030257 xustar0030 mtime=1441974582.513016186 30 atime=1441974656.421866963 30 ctime=1441974670.094024345 icedtea-web-1.5.3/plugin/icedteanp/java/netscape/javascript/JSObjectUnboxPermission.java0000664000076400007640000000366212574544466032267 0ustar00jvanekjvanek00000000000000/* 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.5.3/plugin/icedteanp/java/netscape/javascript/PaxHeaders.24993/JSObjectCreatePermissio0000644000000000000000000000013212574544466030211 xustar0030 mtime=1441974582.513016186 30 atime=1441974656.421866963 30 ctime=1441974670.094024345 icedtea-web-1.5.3/plugin/icedteanp/java/netscape/javascript/JSObjectCreatePermission.java0000664000076400007640000000356712574544466032403 0ustar00jvanekjvanek00000000000000/* 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.5.3/plugin/icedteanp/java/netscape/javascript/PaxHeaders.24993/JSObject.java0000644000000000000000000000013212574544466026112 xustar0030 mtime=1441974582.512016175 30 atime=1441974656.421866963 30 ctime=1441974670.094024345 icedtea-web-1.5.3/plugin/icedteanp/java/netscape/javascript/JSObject.java0000664000076400007640000002235412574544466027201 0ustar00jvanekjvanek00000000000000/* -*- 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 */ public JSObject(int jsobj_addr) { this((long) jsobj_addr); } /** * it is illegal to construct a JSObject manually */ 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. */ 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. */ // 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. */ 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. */ // 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. */ 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. */ 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". */ public Object eval(String s) { PluginDebug.debug("JSObject.eval ", s); return PluginAppletViewer.eval(internal, s); } /** * Converts a JSObject to a String. */ 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 */ public static JSObject getWindow(Applet applet) { PluginDebug.debug("JSObject.getWindow"); // FIXME: handle long case as well. long internal = 0; internal = ((PluginAppletViewer) applet.getAppletContext()).getWindow(); PluginDebug.debug("GOT IT: ", internal); return new JSObject(internal); } /** * Finalization decrements the reference count on the corresponding * JavaScript object. */ 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.5.3/plugin/icedteanp/java/netscape/javascript/PaxHeaders.24993/JSException.java0000644000000000000000000000013212574544466026642 xustar0030 mtime=1441974582.512016175 30 atime=1441974656.420866952 30 ctime=1441974670.094024345 icedtea-web-1.5.3/plugin/icedteanp/java/netscape/javascript/JSException.java0000664000076400007640000001140712574544466027726 0ustar00jvanekjvanek00000000000000/* -*- 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. */ 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 * * @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. */ public int getWrappedExceptionType() { return wrappedExceptionType; } /** * Instance method getWrappedException. */ public Object getWrappedException() { return wrappedException; } } icedtea-web-1.5.3/plugin/icedteanp/PaxHeaders.24993/IcedTeaScriptablePluginObject.h0000644000000000000000000000013212574544466024701 xustar0030 mtime=1441974582.511016163 30 atime=1441974656.420866952 30 ctime=1441974670.094024345 icedtea-web-1.5.3/plugin/icedteanp/IcedTeaScriptablePluginObject.h0000664000076400007640000001673112574544466025772 0ustar00jvanekjvanek00000000000000/* 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.5.3/plugin/icedteanp/PaxHeaders.24993/IcedTeaScriptablePluginObject.cc0000644000000000000000000000013212574544466025037 xustar0030 mtime=1441974582.511016163 30 atime=1441974656.420866952 30 ctime=1441974670.094024345 icedtea-web-1.5.3/plugin/icedteanp/IcedTeaScriptablePluginObject.cc0000664000076400007640000007026212574544466026127 0ustar00jvanekjvanek00000000000000/* 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.5.3/plugin/icedteanp/PaxHeaders.24993/IcedTeaPluginUtils.h0000644000000000000000000000013212574544466022562 xustar0030 mtime=1441974582.510016151 30 atime=1441974656.420866952 30 ctime=1441974670.094024345 icedtea-web-1.5.3/plugin/icedteanp/IcedTeaPluginUtils.h0000664000076400007640000004576512574544466023664 0ustar00jvanekjvanek00000000000000/* 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 "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(); \ } \ 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) { \ 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) { \ 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); static bool file_exists(std::string filename); //file-loggers helpers static std::string generateLogFileName(); static void initFileLog(); static void printDebugStatus(); static std::string getTmpPath(); static std::string getRuntimePath(); }; /* * 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.5.3/plugin/icedteanp/PaxHeaders.24993/IcedTeaPluginUtils.cc0000644000000000000000000000013012574544466022716 xustar0029 mtime=1441974582.50901614 29 atime=1441974656.41986694 30 ctime=1441974670.094024345 icedtea-web-1.5.3/plugin/icedteanp/IcedTeaPluginUtils.cc0000664000076400007640000011151312574544466024003 0ustar00jvanekjvanek00000000000000/* 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* >(); 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& 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_id.at(0) == '[') // array { obj = IcedTeaScriptableJavaObject::get_scriptable_java_object(instance, jclass_id, jobject_id, true); } else { 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, 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); } 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(); } 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.5.3/plugin/icedteanp/PaxHeaders.24993/IcedTeaPluginRequestProcessor.h0000644000000000000000000000013112574544466025011 xustar0030 mtime=1441974582.508016129 29 atime=1441974656.41986694 30 ctime=1441974670.094024345 icedtea-web-1.5.3/plugin/icedteanp/IcedTeaPluginRequestProcessor.h0000664000076400007640000001115412574544466026075 0ustar00jvanekjvanek00000000000000/* 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.5.3/plugin/icedteanp/PaxHeaders.24993/IcedTeaPluginRequestProcessor.cc0000644000000000000000000000013112574544466025147 xustar0030 mtime=1441974582.508016129 29 atime=1441974656.41986694 30 ctime=1441974670.094024345 icedtea-web-1.5.3/plugin/icedteanp/IcedTeaPluginRequestProcessor.cc0000664000076400007640000007620312574544466026241 0ustar00jvanekjvanek00000000000000/* 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.5.3/plugin/icedteanp/PaxHeaders.24993/IcedTeaParseProperties.h0000644000000000000000000000013112574544466023431 xustar0030 mtime=1441974582.507016117 29 atime=1441974656.41986694 30 ctime=1441974670.094024345 icedtea-web-1.5.3/plugin/icedteanp/IcedTeaParseProperties.h0000664000076400007640000000460012574544466024513 0ustar00jvanekjvanek00000000000000/* 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(); void mkdir_checked(std::string); 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.5.3/plugin/icedteanp/PaxHeaders.24993/IcedTeaParseProperties.cc0000644000000000000000000000013112574544466023567 xustar0030 mtime=1441974582.507016117 29 atime=1441974656.41986694 30 ctime=1441974670.094024345 icedtea-web-1.5.3/plugin/icedteanp/IcedTeaParseProperties.cc0000664000076400007640000002402012574544466024647 0ustar00jvanekjvanek00000000000000/* 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; mkdir_checked(itw_dir); mkdir_checked(log_dir); return log_dir; } return value; } void mkdir_checked(string dir){ if (!IcedTeaPluginUtilities::file_exists(dir)) { const int PERMISSIONS_MASK = S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH; // 0755 int stat = g_mkdir(dir.c_str(), PERMISSIONS_MASK); if (stat != 0) { PLUGIN_DEBUG("WARNING: Creation of directory %s failed: %s\n", dir.c_str(), strerror(errno)); } } } 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.5.3/plugin/icedteanp/PaxHeaders.24993/IcedTeaNPPlugin.h0000644000000000000000000000013112574544466021776 xustar0030 mtime=1441974582.506016106 29 atime=1441974656.41986694 30 ctime=1441974670.094024345 icedtea-web-1.5.3/plugin/icedteanp/IcedTeaNPPlugin.h0000664000076400007640000001331112574544466023057 0ustar00jvanekjvanek00000000000000/* 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 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.5.3/plugin/icedteanp/PaxHeaders.24993/IcedTeaNPPlugin.cc0000644000000000000000000000013212574544466022135 xustar0030 mtime=1441974582.506016106 30 atime=1441974656.418866929 30 ctime=1441974670.094024345 icedtea-web-1.5.3/plugin/icedteanp/IcedTeaNPPlugin.cc0000664000076400007640000021711212574544466023222 0ustar00jvanekjvanek00000000000000/* 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_JAVA7 #define JPI_VERSION "1.7.0_" JDK_UPDATE_VERSION #define PLUGIN_APPLET_MIME_DESC7 \ "application/x-java-applet;version=1.7:class,jar:IcedTea;" #define PLUGIN_BEAN_MIME_DESC7 \ "application/x-java-bean;version=1.7:class,jar:IcedTea;" #else #define JPI_VERSION "1.6.0_" JDK_UPDATE_VERSION #define PLUGIN_APPLET_MIME_DESC7 #define PLUGIN_BEAN_MIME_DESC7 #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;" \ PLUGIN_APPLET_MIME_DESC7 \ "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;" \ PLUGIN_BEAN_MIME_DESC7 \ "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"; // 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; 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; 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; 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; 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) { // As in get_cookie_info, we use the first active instance gpointer instance=getFirstInTableInstance(instance_to_id_map); browser_functions.getvalueforurl((NPP) instance, NPNURLVProxy, siteAddr, proxy, len); } 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()); //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.5.3/plugin/icedteanp/PaxHeaders.24993/IcedTeaJavaRequestProcessor.h0000644000000000000000000000013212574544466024435 xustar0030 mtime=1441974582.504016082 30 atime=1441974656.418866929 30 ctime=1441974670.094024345 icedtea-web-1.5.3/plugin/icedteanp/IcedTeaJavaRequestProcessor.h0000664000076400007640000002141212574544466025516 0ustar00jvanekjvanek00000000000000/* 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.5.3/plugin/icedteanp/PaxHeaders.24993/IcedTeaJavaRequestProcessor.cc0000644000000000000000000000013212574544466024573 xustar0030 mtime=1441974582.503016071 30 atime=1441974656.418866929 30 ctime=1441974670.094024345 icedtea-web-1.5.3/plugin/icedteanp/IcedTeaJavaRequestProcessor.cc0000664000076400007640000012507112574544466025662 0ustar00jvanekjvanek00000000000000/* 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.5.3/plugin/PaxHeaders.24993/docs0000644000000000000000000000013112574544466015631 xustar0029 mtime=1441974582.50201606 30 atime=1441974670.156025059 30 ctime=1441974670.094024345 icedtea-web-1.5.3/plugin/docs/0000775000076400007640000000000012574544466016770 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/plugin/docs/PaxHeaders.24993/npplugin_liveconnect_design.html0000644000000000000000000000013212574544466024353 xustar0030 mtime=1441974582.503016071 30 atime=1441974656.418866929 30 ctime=1441974670.094024345 icedtea-web-1.5.3/plugin/docs/npplugin_liveconnect_design.html0000664000076400007640000001353712574544466025445 0ustar00jvanekjvanek00000000000000 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.5.3/plugin/docs/PaxHeaders.24993/js-java-wf.png0000644000000000000000000000013112574544466020361 xustar0029 mtime=1441974582.50201606 30 atime=1441974656.417866917 30 ctime=1441974670.094024345 icedtea-web-1.5.3/plugin/docs/js-java-wf.png0000664000076400007640000007765612574544466021470 0ustar00jvanekjvanek00000000000000‰PNG  IHDRáîV)ÎsBITÛáOà IDATxœìÝy`SUÞðñš6´Iš´6Àta{hK*„²= HE´€P:úÔe^eSÇÑ—GPZ”E,ˆ¨8 ã((•i¡µekn¤%Ý—ûþqÇ2Þ´;µ§yT'Ãn7ÑŽš ·%ïÉí«ç°ÄÎëÁÜsˆæâHûåV hQ79ÿ£ºÿ^ážG uÐóÀm1DÃ%èHè$Ir&¬kOó¨2v`t(NîÉ€Öç¶C´[5ÎpÏŽ´gFÎN­Û¤f1¯÷± C¡ç€Ûbˆ†kÑ‘ÐÜtälO1ªàH€ŽŠžn‹!.AGB‡â¸Ã·³U°££¢ç€Ûbˆ†KБС8èðí/FìÀè¨èùà¶¢át$t(ö:|»ŒQ;0:*z>¸-†h¸ ŠÍß^cTÁŒŽŠžn‹!.AGB‡bÝáÛqŒ*ØÑQÑóÀm1DÃ%èHèPtøö£ v`tTô|p[ Ñp :<Â>ËlʶjŸ ¹í?hÍÇa ÜC4Zg¹ð$7íÃíò^_'ÃnÀcH7ÓÖ €Ž‹!­£Ýͦ4H­VwîܹÉ%dgg¹°I65¿­¦u6ˆ[i71*GKYYY¦­[ñ®Ým²²²lî6ŽØk§¬%`Ï„ ¾ûî;Ë”åË—ûûûk4šôôô¶jUÓ$''/^¼¸­[ÏÔî&c²²² …F£Q«ÕC† 9s挜~èС“'O6§äÞ½{:“óÃ?T(ï¿ÿ~jiT;­OüÒÒÒn»í6??¿¾}û~þùçMh€ólnÇ碖V­ZÕ»woµZ}ë­·:t¨±µ;_‘ o71ªgwcyvU)eYl£Jnþæü8Òœ.îü8rüøqyƒ¸0 -++›9s¦N§3 ‹/¾é5ç·‰µfÜœ|V—˜˜(¿2dH›_s´<Ѽ뮻Ì'š.qèСÒÒÒ!C†˜SL&ÓŸþô§'N˜L¦¨¨(Öe©%ŽBˆÙ³g§¦¦»°L@´ÛÉ•Je2™JJJî¾ûîyóæµ~>ÿüó;î¸ã‹/¾håzkkk§M›¶xñâ²²²þóŸz½¾•à¼wß}÷ÝwßýꫯÊÊÊ6oÞ¬T¶_zÚQ[ôˆÕa™L¦“'OªÕj“Éd2™\Ufƒb/¹í`Î0`€¼A\Xæ¢E‹jkk¯^½šžžþÕW_­_¿Þ……èhT*Õ±cÇêëëóòòŠŠŠÚº9Bür¢i2™¦NêÚÍwÞygÆŒ–)ùùù^^^½{÷va-ÖZâX „P©TcÇŽMMMum±h ÖøîÆc¦å•JåÃ?œ‘‘a/ƒåõwË›O:øÇ?þÑœøÛßþ¶ÁÕ%yñ¿þõ¯ƒ¡[·nÿþ÷¿åtI’vïÞýüóÏùå—õõõ朿ÿýïµZí°aà ì%ÚSVV–˜˜h0ôzýœ9s*++…ìׯ_UU•<ôÑG]¹r¥   ..N¡PôéÓçî»ïv°xIII|||`` ^¯üñÇl9ý½÷Þ ÕétÛ¶m³¹Al6iÿþý–ãê„ ’““…¯½öÚ믿.4pàÀßüæ7BˆÓ§O÷ïß_£ÑŒ3F> ÙÛÈÖÙ\ÍüüüÐÐÐÓ§O !~úé§_ýêWyyyöw†£yÔ–;bÁ’uÇvºø‰'ä=yõêÕŽË´¹øš5kzôèáçç}êÔ)!„½Ìf“œÜmì 6û¨u“dòâ±±±MGl²®èË/¿ìß¿¿9CLLŒ|Îf“¶lÙòÜsÏùúú-X°`Ë–-ÚÙ­[·ÛÄÉËÞVày|àÀ;vÜwß}rŠÍbݺu={öT«Õ!!!+W®”sÚL´9vÙ<ÿs0r*ŠñãÇŸ={VØ?…²Y»»wïŽ5¿8pàí·ßnåä{}m_lžBùøøÜqÇñññaaaO?ýtc7{3²ØØØ]»v5¶ê6Ç~snSbZÞ±êêêM›65ᶈùóç?òÈ#ׯ_7'îÙ³ÇúêRuuu}}ýµk×’’’–,Y"'=z´®®nÊ”)ÞÞÞ?üðƒœXUUÕ½{w£ÑñÜsÏ9H´éñÇ¿|ùrffæ•+WÊËË_xá¹¢“'OZFFݺu3 ¿ûÝïŽ;f9Ëmsñùóç×ÕÕ]¼x1??̘1Ž·ImmíþýûÏ;—››;`À{ĺIwß}wmmíÑ£G…F£ñÛo¿6mšÑhý¡‡ºqãFUUÕÇ,'ÆÇÇO˜0áúõëåååÓ§O_¸p¡$IÑÑÑûÛßjkkãããÒ X›‹ÿãÿ8þ|]]Ý’%K,IRuuu—.]æÎ{ôèÑúúzÇMÊÌÌôòòJHH(++»qãÆ¹sçÌéæ®"¿Büõ¯­­­}ôÑG-?²Ìi³I–‹Ïš5ëw¿ûƒÅm®¦ÍÌ6×= @/_ÖëõUUU6s^»vM¡PÔÔÔÈE?~<88ØA;­k·ÙN›Ùæj:à>Ý@ޝ{÷î}òÉ'GuàÀyô¶(Š‹‹•J¥|tíÚµï¿ÿ^’$›‰’­±K’¤»îºkÙ²eµµµsæÌ1#¬+2;µµµ/¼ðÂ=÷Ü#ýß±È|ˆ±W»=òy§|Xo°¤X_ dcåC‰<ð~öÙg …b×®]½zõºé·àÂcÙ¡C‡BCCoZµÔFC´ãŽ]WW—››ÑàD¢õ™¿úúú×^{­Ávn¦„„„Õ«WÛ¬®Éš_‚µyóæ½ùæ›ÎälÃ#¾ƒN%„Ðét:nøðáééé–589´OJJJähJ’$óHhoq!„Éd’$éôéÓ:NNÿóŸÿþøã &Ø;¶Ù<ƒ·Ýt•Ú\£bT›׿wß ?9ˆQtÙéÓ§ä×Ö;˜Í&INï6Î6›ä’qÄA]–ë>kÖ¬×_]’¤Õ«WÏœ9Ó^ÎììlsúÙ³gýýý´³AíÎX7ÝJÖܧÛhÀñáµ¶¶ö¶Ûn9r¤>>gÏžõóó;{ö¬å)”=.<˜¥§§k4š›V-¹eŒúÄOìÛ·oÕªUÏ<óŒüÚœ'°9£`3qõêÕÝ»w÷õõ8pà?þ('þøã}ûö X°`ùäĺ"›Ó!öÎÝmÖî@XX˜¹=’$ýæ7¿ñóóB¨ÕjµZ-Ÿ£ZO±8Ö ;Y¯û¿þõ¯~ýú™3 4èóÏ?··•dï½÷ÞøñãoZµä®1ª½3gbÔììlsø”‘‘á8FµÙ+ $Gøo½õÖo~óùSË2åQÂf¢ÍŠÎŸ?oŽºu:¿¿¿Á`p¼²¥¥¥=öØwÞioñœœ¥Ré`û4ˆQ-Ï9íµÓ^â‘#Gz÷î-IÒ¤I“6nÜ(I’|Jyy¹e¶[Þ¼•l6©Q[iïÞ½BˆÝ»wß´ñö8£Z±$§$¯¼òÊâÅ‹¯_¿®Óé Ÿ{î¹?ÿùÏ6mö" {ÑMW©Í5*FµÙqm~÷öäÅÚë:6lˆˆˆð÷÷×jµ ޝ–;˜Í&INï6Î6›ä’qDÎܹsgI’ôÙgŸ :T’¤Q£FíØ±Ã^ΫW¯ÚœGµ×ÎMu~À²·•pŸn ›žÕ=ûì³6lGo{ÚçŸ>~üxƒÁпÿ¯¾úJ.Áf¢õØeó¨a³"s“ª««-Ztï½÷JöÏWlÖn|†àÌ-¯Žƒu¯¬¬Ôëõééé:NÞ—l欯¯×ëõ§OŸ–—úàƒ~ûÛß:hgƒmâü€es+9æ>Ý@NžÕ™çQ huuu+V¬hp¿†e¢Í±ËæùŸÍŠ,›ôã?ÞrË-’ýS(M²),,ìäÉ“¶€Í§PæÕ™[U]x,0Û´i“;O|9îxLà›ßÚœbq¬NË;®ÚAŒZYYéëë{ðàAùmUU•ŸŸß¡C‡$IZºt©yŸ’/gÔÕÕÍ;·±1ê{ï½gy]ß¾}ׯ_ŸùËO±êêê}ôÑyóæI¿œ[6H´ÙNI’yä‘ùóçËøÜ¹sŸ}ö™œ^\\¬P(233Íkô÷¿ÿ½´´´ººúé§Ÿ¾ûî»,>mÚ´™3gÞ¸q£ººúÓO?u°A£6h’ìÙgŸŒŒ¼ï¾ûÌ)kÖ¬éß¿NNŽ$I'Nœ8zô¨$IÑÑÑæ 4 ö6²½Šl®æ3Ï<óðÃK’4gΜ?üáŽÛi¹³Ýü¿g¼½½zè!Ë£5ø›¦€€€ššš7n!ŠŠŠ…ÑÑÑ'Nœøæ›o–/_¾gÏžãÇ4H1a„/¾øâêÕ«³gÏNHHB ŸÜÜ\£Ñh4KJJòóómVä‘Ôjõý÷ßÿôÓO›L¦ššš;w !üüüâââ,X ô™™™ÿüç?u:]LLLJJJ]]]JJŠƒ2m.^]]]WW×µkךššU«VÉ9«««ßxã7nÔÔÔlÞ¼ù׿þµ½&5VJJJ}}ý»ï¾;zôhsb```uuuVV–¹vë&™—WsܸqæÄàà`oooóß:Ù\Í·ÞzëÌ™3’$íܹS^©Tª &ÌŸ?ÿž{îñõõµ—S¡PLŸ>ý¥—^ª¨¨(**zã7|ðAílÀf;lä[ @G`s (((عsgyy¹B¡$I¥R !l&Ú»üýýïºë®5kÖÔ××oذÁAEæfH’´k×®°°0!Dpp°Ï‘#G„~ø¡œÁfíŽ7.--­±D¯×GGG'''Ëc¬å¡Ä-q,0Û·oŸƒ1ßÍyyyÝwß}ñññòÛ‚‚‚ÚÚÚ˜˜½^¯×ëÇŒSRRâïï¿cÇŽÍ›7÷ìÙsÀ€_ýµÂf¢bãÆ‘‘‘:nðàÁ555Bˆ¢¢"oooN'„¸å–[T$„P©TF£±¬¬lîܹÏ<óŒ½f۫ݽ^_WWçàIŠBˆââbooo­V+·ÓÉYžšZ¯»bÚ´iü±âã?6?ÆfNYii©gü«B*•êoûÛ=÷Ü£Ñh>ìããóÚk¯Mš4iøðá–Û0%%å½÷Þ3 AAArúáÇ5åó#ËÊÊlVñÅ_Ü{ï½æ·“'O–x¦R©.\¸ Óé222þò—¿˜ÛchÝN!ÄÛo¿íåå¡Ñhþû¿ÿ[žKBü¿ÿ÷ÿbbbBCCwîÜéååõí·ßöìÙS§Óíß¿ß|fnsñuëÖ ! ƒüÄ5{Äšƒ Ò IrâŒ3Ξ=ûÀ˜KxüñÇãããGŒ¡V«xàêêj!Äúõë7oÞìïïùòåeË–9ü2mTd½šHMM}óÍ7…ÿûß?úè#ù¾_{ít–ƒx½¾¾þÕW_íß¿¿ƒ8Þ:—$éöÛoŽŽ–$iÈ!’$åççúé§eeeõõõo¼ñFß¾}ÄâºãQr§ %-Q«Õ–?‡¯_¿>sæL½^¯ÓéÌÞ1™L=öX—.]ÔjuxxøªU«$I:qâ„ü§žzÊñ3“l.þüóÏk4šîÝ»¿úê«ræÚÚÚÉ“'úúú<ø§Ÿ~rÐ$ëoäСC ÖÈd2ÉÙ’’’4Í!C®^½j¹ÈÓO?"_F²n’åâòc-_³f¿¿¿Z­–¯r䈓÷<;æäï6=Xaa¡Z­–;v{dîlŽbT›G,'$’$Í›7/>>^’¤„„yæ×Þ±Íæ¼GƨA‡ìIOOoç%vðθ3·Ú=]uþ×4ãÇÿî»ïÚªv×zûí·-Zädf÷Q%[ó6gl&ÊϽÿé§Ÿªªª,zjóNëŠlN‡Ø¼ÒÞ$‡ÖÏõµ¾áÐæ‹µ5kÖüôÓOõõõË—/7_p±·î’$=ôÐCÆ 3?ÚÔANI’æÎ»råÊ›®Žä¡1êádz²²êêêþçþÇúÖè& F}á…¦OŸÞÖ­hº›Ç¨íŽû¬ˆû´¤Mt¨Àžäädó­-ªƒw6À¹Ãîéòó?4J»ˆQ;ξdu›’Í)kyZ¾¥«þä“O‚ƒƒÕjõðáÃNª|¸°°066V~;{öìÔÔÔâââ–nÐrä½LÞÝ\dÊEYÛ¨’?./~Ó]ÒIæñD£ÑÄÆÆfdd¸¤ØÆ¶¡Á¨h↠ræÌ™Öo‰ÛH›Ã•1ªGÞ[¥R©L&SiiéèÑ£çÏŸßàÓÚÚZÖådiëÖ­›1c†e ÇŽ›ššê–­Ìd2}ºN§ zòÉ'å8SΓ’’Ò½{wÿÇ{¬¦¦FQ^^ž˜˜PUUÕ ´1cÆTUUÉ3-/^\¾|ù¬Y³ÌÍ;vìúõëwïÞ=bÄËu>|ø®]»Z~›¡µ93¯îÁJJJâããõzýã?.'–••%&& ½^?gΜÊÊJ!ĉ'¢¢¢W¯^í¸L›‹¯Y³¦G~~~ÑÑÑŽo—°Îùå—_öïßßœ!&&æ‹/¾p\¦R©|ä‘GÌó¨6›tòäIyþð‡?ÈÓ¿–Áò®›‹¯[·®gÏžjµ:$$dåÊ•rÎöë×Ï<Â|ôÑG–Mzøá‡ÍM’ëzï½÷BCCu:ݶmÛ„§OŸîß¿¿F£3fLQQQc¿#›M²™h³"›M©ãþ5<<üرcF£122ò©§žB%%%mß¾½¼¼<##côèÑæÌµµµ[¶léÛ·¯ü¶ºº:+++;;{Æ óæÍóöö¾råJzzú÷ßÿòË/›óìß¿ÿìÙ³?ÿüóÉ“'_yå!DRR’ÑhÌÉɹ|ùrAAÁ‹/¾Ø ´/¿üRžÖ0™LÝ»wŸ9sæ§Ÿ~*Ÿá]»víÀ£FºtéRDD„åºDFF¶Â}È$©   iŸš¹vî]víÚµ&|äþæÏŸ_WWwñâÅüüü1cÆÈ‰?þøåË—333¯\¹R^^þ /!æÍ›WPPpýúuÇeÚ\<((hß¾}&“iìØ±‰‰‰·Î9räÈ‹/æää!rssÏ;'ʬ­­ýðÃïºë.MJLLlò]¿~ýñÇÿøãËÊÊŽ?#ç–¥É ªT*Ëæ 6lÛ¶m’$­\¹rêÔ©çÏŸ÷òòj° ééé¦ù[¬¸['qÒÏ?ÿüüóÏ÷èÑã•W^qæÓ’’’GyD¯×ûûûÏœ9SþZW¯^:cÆ I’ÊÊÊæÏŸË-·èõúyóæUVVJ’ôÖ[oÉÓøƒþùçŸ%IêÕ«—B­V«Õê .Ø\J’$F3iÒ¤?þ¸ºººAÛ|Ôú§™™™–Ì#¾p IDAT{¨¼s™÷YYY™R©ÌÈÈßþðÃ}úô1BˆÒÒRI’8Ð`7·,Öæâ–™OŸ>Ð`ñ»¤uÎY³f½þúë’$­^½zæÌ™öršÇ//¯\¿~Ý^“JJJÌk´ÿ~¹ý–-1¯”½ÅU*Õ–-[ÊÊʬ7²åêXqÇOOO·L7`’$5ØÈ½zõ’óÙl’ÍD›Ùl’cn5€€FñðyT•JeüűcÇ,?Z¿~}DD„¿¿ÿˆ#ÊÊÊ„Z­vÇŽ›7o :tèÁƒ-KØ¿ÿm·Ýf.6 @QPP P(‚ƒƒåôž={š§­”J¥9½GW¯^ÍÏϯ©©‰ŠŠÒëõz½~ôèÑò™¨¹4›~øá-[¶!¶lÙ2sæLNWWWWQQa™çÆz½ÞÛ ÿWyyù{ï½7räÈAƒlݺuáÂ…Î|šPYYyáÂ…¢¢¢'žxBüßÙragFÝzn¿Á¼ºÍ¥„—.]š0aÂk¯½º`ÁËIu¹9yçúÕ¯~Õ ±¶¶6&&FމƌSRRR\\ìíí­Õj…·Ür‹ã2­Blܸ122R§Ó >>ÎÚ`v]f9[noFÝznß’½¥,…††FEE…‡‡çää:ù‘{R«Õ÷ßÿÓO?m2™jjjvîÜ)„ðóó³Ü‰233ÿùÏêtº˜˜˜”””ººº””eÚ\\ ºvíZSS³jÕ*9ç[o½uæÌI’vîÜùë_ÿZN´™S¡R©&L˜0þü{î¹Ç×××AN³)S¦äççïÝ»×ÞEGG§¤¤Ô×ׯ[·N^$88ØÇÇçÈ‘#Bˆ?üÐÁìܹ³¼¼\¡PH’$2yÐËÊÊjìס×룣£“““å,ÿæÖùïÈf“l&Ú¬t,.Œw/ÐåUÛä`U’¤¥K—ªÕêž={þío“Ó/]º4dÈ­V+?Šó»ï¾»é<ª$I………S§Nõ÷÷ |â‰'ä_ýÉy’““CCCµZíüùóå©6“Éôøã F±jÕ*ë*’’’üýýu:Ý… äùñ›{÷î•ß:t(&&Æœ¿²²244´°°Ð›¬å¹['qììÙ³‹- 8pà›o¾YPPà̧6çQ-¿e›3ê6çö-g½l.%«¯¯ÿöÛo}ôÑ€€€qãÆmݺÕüSUµ>ß©Z­öóó¿üøVN¼~ýúÌ™3õz½N§ûÝï~''šL¦Ç{¬K—.jµ:<<|ÕªU’$8q¢oß¾O=õ”ƒyT{‹?ÿüó¦{÷úªœ9%%¥G;wîÛ·ï÷ßo^Ü:§LÞI·lÙâ gƒn°téÒÉ“'ÛkÒñãÇ#""ž|òIsE«W¯îÖ­[llì³Ï>kN´^üêÕ«C‡•‡²;ï¼ó‡~°Ü O?ýt```HHȧŸ~êü<ª$I?þøãwÜáçç7jÔ¨üüüF}G6›d¯6+bоpj…äºç¡É¿Úr¦@çs¶SYYY·Ýv›ü<Þæ;zôèäÉ“/^¼Ø©Óæ½'NœøÌ3ÏÄÆÆ !’““srrä绿öØIêêê¾üòË 6ìÚµkÅŠsçνé§>ø B¡HIIñõõ=zôè-·ÜÒ ?<òÈ#~~~¯½öšN§ËËËËÈȸí¶ÛºuëvêÔ©>}ú$$$ìØ±Ãd2]¹r¥k×®6—úío+„èÝ»···÷ìÙ³ãããCBB,›çà£Öç>ßi;’••Õ¿WýglÇAgsò$y[·Ú`stÐ{}Û—5kÖÄÇÇ›T!Ä?ÿùO9@B$&&¶—µòòò?~ü¶mÛ.\¸0xð`g>MNNöòò 3 o½õ–u™k×®U*•áááZ­väÈ‘gΜéҥ˒%KbbbúöíÛ¯_?9[``àÿüÏÿDDDèõú‹/Z/%gÛ¼yóÙ³g/^l…:øpCÌ£¶WÍ£………EEE}ùå—ŽXÚ^ÐI:2¾Ó&`µièln‚i´4úܳ9ˆQѪè$ß)Z ÍMpІ–FƒÛ¢s6÷úÜ1*À](Ûºhä›èdÜÃÀ…ˆQÑ,æx•`µCá:€œ 51*\ƒ`µÃâ«`à Ú2FµœŠÇ bé°œüêÙñàó¨h)® V iÚ®SZÀ#µeŒÊ°ÒN94òý¢A°J—¸©Æ^‘a“ÏÃ<*\Ìå'Íœ…»!®S´(g¶÷OEŒ × MFŒŠf!ÍGŒŠF#%ú@ …‚s¤&#FÐhŒ¹œÁ)  :µuøbT´K<äðHĨwAŒ pĨwAŒ pĨàJüóVs£€Á)  ˆQî‚ísõ€G"F¸ bT€» F¸ ¥ËKT(./Ð0 ®Ä¼]s¸r•G«3…BÁ¹ ±˜G¸ bTxÅ/Úº! õpè<’럙´ŽL€‡!FEûCh xªÖˆQyd\‚Ððx̣­56.ußÞ…{‹Ÿüm•ŸË1 ##F…[sÕ‰»;$ä'?wšàa8¸7Gk܅˽¾0“ÏÑér6a²xN2Ä<*Úóш["Ãÿ£¢“~ÑÖ Z—cÀ&ÎÄ<*<‡(À30 p­£2Çpó¨wAŒ ®Ä󛃴NÑM@Œ pĨàîxòØÄ\=à‘ˆQî¢5bT.qœÁ<*À]£Ü1*¸Ï;lbTÐ"8E41*À]£€»ãéè`sõ€G"F¸ bT ÝËÊÊêܹ³ ÌÎÎ jluYYYÆüvâĉûöíB$''/^¼Ø…Í€k•Û0w–••¥P(4¿xàz÷î]XXØœ2>\XX+„˜={vjjjqq±‹Ú OÆ<*¡R©L¿øðÛ_àºuëf̘a.|ìØ±©©©Í/ð«V­2 Ý»wÿþûïå”·ß~»GjµzÈ!ÙÙÙæœk×®íÞ½»ŸŸ_·nÝÞxã ë¢,ïæ-//OLL HHH¨ªª²ÌYTTtï½÷j4šÈÈȯ¾úÊœ¾{÷î#F˜ß>|×®]®[W¥°ÃÞGmÝ^`‡éæ FøàùuUUÕîÝ»gΜ麕€ÇR´Â³7ŠÖ¨í‚<©îLp>'ÜÓĉŸyæ™ØØØää䜜œW^y¥­[Ô°ƒÀÃp€–FƒÛ¢s61*Z§à€ì ð0œ ¥ÑÇĽ¾ E<š@ÙÖ dù¬8NÓœGŒ -˯¬€k1®‰\Ïò´É£¬ÜTkĨœèÈÌc Á*ÀM1 ­ÄA°*ˆW„Ĩps–gð€‡‘$ɲ‡ÓÛÿ=m¥APÊ<*ƒKÏÍÁ<*Ügíð$Ö‡+z8<›B¡ “‹Z¡)€óˆQÀõlÞáCh ®Å\=à‘ø=*´,émÝ—••Õ¹sg—•Ô´2'Nœ¸oß>ùurròâÅ‹]Ò$7§°ÃÞGmÝ^€[k•£€ŽF²ÐÖmA£õîÝ»°°° >|¸°°066V~;{öìÔÔÔââb—¶Ç<*ÿ«¶¶¶ÉË®[·nÆŒæ·*•jìØ±©©©®hW; 9¡­ÛhˆQîníڵݻw÷óóëÖ­Ûo¼ay nVV–F£1çLIIéÞ½»¿¿ÿc=VSScsq!Diii|||@@€N§{øá‡å׬Yßà_›e–——'&&$$$TUU !vïÞ=bÄË–>|×®]-¸ið8Ĩ·VTT”””´}ûöòòòŒŒŒÑ£GÛËY]]½ÿþ³gÏþüóÏ'Ož|å•Wì-žPYYyáÂ…¢¢¢'žxB^6+++;;{Æ 7-S‘””d4srr._¾\PPðâ‹/ÆK—.EDDX.yêÔ)—o€›ãΑæ F¸5oo “ɤ×ëo¿ýv{9%Izå•W|}} ßþô§-[¶Ø\¼¬¬ì£>Z±b…¿¿¿R©Œ‰‰‘—}þùç½½½U*ÕMˬ¨¨xÿý÷W¬X¡ÕjÕjõÒ¥K·mÛVRRâåååëëk¹¸V«5-²]ðPĨ·¦ÕjwìØ±yóæ¡C‡44ôìÙ³–‹gdd8˜øÐLÜN x$bT€[»råÊ_|QYY©T*µZm}}}HHˆF£ùä“Oª««W¯^mΩP(–,YRQQQTTôâ‹/>ôÐC6W«ÕÓ¦MûãÿxãÆÚÚZ³öÊT«Õqqq ,())BäååíÙ³G1~üøo¿ýÖrñ}ûö7®%6 žª5bT.q𬮮nÙ²e]ºtÑh4)))›6mòòòzóÍ7çÍ›.ÿšTæãã3dȈˆˆ^½zýú׿^´h‘ÍÅ…ÉÉÉ^^^aaaƒá­·ÞrP»Í2…k×®U*•áááZ­väÈ‘gΜB$$$|ðÁæe«ªªvïÞ=sæÌ–Ø,x*$Z“B¡Î]¶p>'à1ØA<ÀĉŸyæ™ØØX!DrrrNNŽùQÀŒ® p!bT´*ÎcØAÐNÑu.ÄïQÀ•äKrhbT€» F¸ e[7¸Ë»Ôøù(Ü–BÁ£UDŒ 1Ç«€VÐ÷úò‹a<€âmÝ€'cÚ+B´fV-‡4J.GŒ íSXh9NŸr'$R€8F71*hν-‡8…ÐÐ ˆQ€#„¦p[tNÀ#£€†8õ´•ÖøTŽsg´FŒ €3ˆQî‚\‰?ŽnbT€» F¸ bT´KÜN x$bTmâĉûöí“_'''/^¼¸mÛ€Çh•K\ÐÞeee)Š;ï¼ÓœRUUuË-·h4š6l•Ù7ß|ëïïpÿý÷Ÿ;wÎAfy]4F£Ñjµ£FrœßÚáÇ cccå·³gÏNMM-..nú €_0 pŠOaaáO?ý$¿ýôÓO CÛ6I¶wïÞ)S¦üþ÷¿/..ÎËË>|ø°aÃ.]ºä`•Je2™L&Saaa¿~ýfϞݨ×­[7cÆ ËÒÆŽ›ššÚ´ö¸)…ö>jëöhbTðdYYY;w^µj•Á`èÞ½û÷ß/§———'&&$$$TUU !Ö­[÷ÐC !êêê´ZíóÏ?/„¸xñb@@@}}½B¡ˆß¸q£\† ,C;›®]»¶{÷î~~~ݺu{ã7l¦¼ýöÛ=zôP«ÕC† ÉÎÎ6˜ŸŸ?aÂF™œœ,OØÚ¬eáÂ…Ë—/Ÿ6mšR©ôõõ}òÉ'§M›¶lÙ2{ënI¥RÍš5KžG•ó›·›yŠØºÍ»wï1b„e9ÇßµkW³¾* „ FW]]]TTtõêÕG}táÂ…rbRR’ÑhÌÉɹ|ùrAAÁ‹/¾(„6lXZZšâøñãƒA~––6tèÐN: !fÍš•ššZWW—››{ôèÑI“&™k±.°¨¨())iûöíååå£G¶NB„‡‡;vÌh4FFF>õÔSæçÍ›TPPpàÀ>øÀ^-¥¥¥GŽ™>}ºå*ÇÅÅ}ýõ×öÖÝReeå¦M›îºë.{[ϺÍF£ñÒ¥K–Ù"##O:Õ˜¯ÅÙ›ébv ®"9¡­Ûü½±YœÙÛ›©ujA»à|¯kµþ ¸–ØA233…¥¥¥’$ýøã’$•——{{{çååÉy:Ô§OùµÁ`ÈÎÎ~ýõ×_z饰°°ªªªÄÄÄW_}533S¥RI’4|øðÏ?ÿ|ùòåIII™™™jµÚ^¥¥¥;wÞ´iÓ7ätëKGíÚµ«üÚd2uêÔÉ\à—_~©V«mÖ’““£T*•žž®×ëm®»y›èt:NçååÕµkןþYN—×Q~-¯šu›ÏŸ?ïååe]£F£qæñHnxîÃùС0 N¥RiµZ!„¯¯ouuµ"??¿¦¦&**J¯×ëõúÑ£G—””È™‡š–––––6|øð9r$--mذaæÒfÏž½qãÆ7ZÞèk³@­V»cÇŽÍ›7‡„„ :ôàÁƒÖ)Bˆõë×GDDøûû1¢¬¬L.°   S§N¿úÕ¯ä·aaaöj ¬««kð¼¢üüü   ›ënÞ&F£Ñh4šL¦‡~Ørþ¶ë6ëtººººŠŠ Ël7nÜÐëõýjÚº½·FŒ NPP··wnn®§•””äççË 6ìÛo¿=räÈ Aƒ† öÉ'Ÿœ?~àÀæe§M›¶{÷n•Je™h¯ÀñãÇÿûßÿ.,,œ2eʬY³¬SŒFcbbâ»ï¾[RRòÍ7ߘ£ƒÁP__õêUù­ü$›µøûûGGGoÛ¶Ír·nÝ:jÔ(g6EçÎyä‘ï¾ûNáããS[[[__/„(((0çiÐf½^zöìYËr222n¿ývç6?p„:µZ·`Áyú4//oÏž=òGÆ ûðÃ{÷î­R©bcc×®];hÐ ó²櫯¾úÇ?þqÓ¯\¹òÅ_TVV*•J­V[__oR]]]WWX]]½bÅ Ë'Nœ¸hÑ¢ŠŠŠ¢¢¢—_~ÙA³_}õÕ%K–lß¾½¶¶¶¢¢båʕ۷o_ºt©3›¢ºº:555<<\¢Ñh>ùä“êêêÕ«WˬÛ,„?~ü·ß~kYξ}ûÆ×ÈïØÐ1*wõ€»Y»v­R© ×jµ#GŽ`ÀI’äþ”_[Þè+4hЭ·ÞzÓëêê–-[Ö¥KF“’’²iÓ&ë”.]º,Y²$&&¦oß¾ýúõ³,pݺu×®]3 wß}·üÌ^{Í9räŽ;V®\¼wïÞ´´4ùö`{ªªªäÿG :qâĦM›„^^^o¾ùæ¼yóÂÃÃcbbäœÖmB$$$˜ã$—¶{÷î™3g6úkVhMòCéuÎç<;ˆ=»wï~ê©§ÒÓÓÛº!ÿkâĉÏ<óŒÌ'''çää¼òÊ+mÝ(Àc1< 1*ZÇÀvK§OŸîÔ©Ó­·Þš››;uêÔÑ£Gÿå/iëFh @‡ÂïQ¸xÒ¤IæŽ;îèß¿ÿ³Ï>ÛÖ-ÀYü#ts0ŠVÅuPÀvx…‚Ó ¸Ã#ÜVccQ:§3”mÝt,–§õœ²h€{}Ðf¿h놸@VV–B¡Ðüâ;wîì ƒâ›o¾‰õ÷÷¸ÿþûÏ;×fë€&‘œÐÖmlO˜G@Û3‡©-w6/IRaa¡Á`pa™µµµòŸcÉT*•Édrß:ÃÞ½{§Nš’’rß}÷ÕÔÔ$''6ìÈ‘#òh]»v­k×®.l0àþZcÕ3.Œ ´ÄÌjvvöŸþô§^½z­_¿^N)..ž>}ºN§ zòÉ'kkkÿò—¿Ì™3ǼȸqãÞyç!DyyybbbPPP@@@BBBUU•<5ºfÍš°°°øøøf¶máÂ…Ë—/—ÿÚ××÷É'Ÿœ6mÚ²eËäOûôé3yòäO>ù¤¦¦¦™íó¨à^œ?-ã ܽÍÑüþS^^¾}ûö 6œ:ujúôé[·n‰‰‘?š7ož¯¯ï•+WÊÊÊ&NœøòË/?øàƒƒ JNNöññ)**JKKÛ²e‹"))©¬¬,''§S§N3gÎ|ñÅçÌ™S]]•••]__ßœ–––9rd÷îÝ–‰qqqsçΕ__ºtiëÖ­¯½öZbbâÌ™3çÌ™sûí·7§F pææéfjZÐ.8ßëZ­î£ÍŽà– Τòë¹sçÞ{ï½Û·o¯ªª²Ìf2™¼¼¼rsså·»v튌Œ”$iÀ€;wî”$)99y„ ’$•——{{{çååÉ9:Ô§OŸÌÌL!DqqqƒÚåtÝ/>úè#9Q¥RÙË““£T*”“žž®×ë$ž;wîÙgŸíîFÊï IDATÑ£ÇÀ¿þúkg¶ZAÓ:'cÜ…d'Lå<ÐNÑuaã RWu›ôôt¥RÕ·o_Ë  Epp°ü¶gÏž×®]B<øàƒ[·n½÷Þ{·nÝ:{öl!D~~~MMMTT”¹m*•J¡R©¬+U©TF£ÑA«d(--­««+.. 4'æçç5X0444***<<üرc………În â¹¾àî8ËG;E×E£˜§P\UàÒÒÒ:uê4vìØèèèU«V™C;ƒÁP__Ÿ——'¿½pá‚ü\¢éÓ§öÙgçÏŸ?xðàäÉ“…AAAÞÞÞ¹¹¹F£Ñh4–””äç绪…BÿèèèmÛ¶Y&nݺuÔ¨QòkI’öíÛ7wîÜÍ›7'$$äååMŸ>Ý…mÜ 1*hüÎpyhj)""âå—_¾páÂK/½”––Ö«W¯wß}W¡V«'Mš´hÑ¢ŠŠŠÂÂÂ^xaÆŒBˆž={Þzë­sçÎ3fŒ¿¿¿œ3..nÁ‚%%%Bˆ¼¼¼={ö¸¶‘¯¾úê’%K¶oß^[[[QQ±råÊíÛ·/]ºTþô¿þë¿úôésêÔ©]»vMŸ>]žÈ<1*Z•åÏZ¡://¯ñãÇoÛ¶íÂ… ƒ–ßyçòòònݺEFFÞyçK–,‘ÓãââöìÙg^|íÚµJ¥2<<\«ÕŽ9òÌ™3®mÞÈ‘#wìØ±råÊ€€€ààà½{÷¦¥¥É<#„ؼyóÙ³g/^âÚz·Õ?áç(0“¯©;ÓœÏ pOœÀU8€Û¢s¶„Ö˜Gå›8ƒ{}î‚à.øTx+ ´_Ì£€»ãL ·Òš¦î€˜G-‚³7´!ºšÉæbúUë F!l…¦Ä¥­@‡FhêVZã÷¨ü’ €3²²² …æ<ð€œØ¹sg„ß|óMll¬¿¿@@Àý÷ßîÜ9Ç),˜ù¡©;`€³$I*,,4 .,³¶¶V©üßÀD¥R™L&ù­3ìÝ»wêÔ©)))÷Ýw_MMMrrò°aÃŽ9&„¸víZ×®]HPêVx®/hE#µu{Ñ^Ñ»Ú\vvöŸþô§^½z­_¿^N)..ž>}ºN§ zòÉ'kkkÿò—¿Ì™3ǼȸqãÞyç!DyyybbbPPP@@@BBBUU•<5ºfÍš°°°øøøf¶máÂ…Ë—/Ÿ6mšR©ôõõ}òÉ'§M›¶lÙ2ùÓ>}úLž<ù“O>©©©1/"Yhfíp-bTv•——¿÷Þ{#GŽ4hPAAÁÖ­[.\(4oÞbTpü†IùwÞy§9¥ªªê–[nÑh4mØ*³F=ŠÃòyZ­vÔ¨Q7}tG‡.,,Œ•ßΞ=;55µ¸¸¸é+M’žž®T*£¢¢úöíëããcùQAAB¡–ßöìÙóÚµkBˆ|pëÖ­Bˆ­[·>øàƒBˆüüüššš¨¨(9ª=ztII‰B¥RXWªR©Œ¿§ag ¬««k0Hæçç5X0444***<<<''ÇÁÂݣ܅OaaáO?ý$¿ýôÓO]ûLŽ&Û»wï”)S~ÿûßçåå >|ذa—.]r°ˆü<“ÉTXXد_¿Ù³g7ªÆuëÖ͘1ò´±cǦ¦¦6­ýí‘§^‹k1eÚ 8––Ö©S§±cÇFGG¯ZµÊÚ †úúú¼¼<ùí… äçMŸ>ý³Ï>;þüÁƒ'Ož,„ òööÎÍÍ•£Ê’’’üü|6Òßß?::Zž›5Ûºuë¨Q£ä×’$íÛ·oîܹ!!!›7oNHHÈËËkpo0Ü1*¸—vwäüЋU«V †îÝ»ÿý÷rºõã1„ëÖ­{衇„uuuZ­öùçŸB\¼x1  ¾¾^¡PÄÇÇoܸQ.aÆ –¡Í×®]Û½{w??¿nݺ½ñÆ6SÞ~ûí=z¨Õê!C†dgg› ÌÏÏŸ0a‚F£‰ŒŒLNN–'lmÖbïQöÖÝ’J¥š5k–<Úà¿ÌSÄÖmÞ½{÷ˆ#,Ë>|ø®]»šõUµÖ¡)a*Ðæ"""^~ùå .¼ôÒKiii½zõz÷Ýw…jµzÒ¤I‹-ª¨¨(,,|á…ä‹k={ö¼õÖ[çÎ;fÌ9g\\Ü‚ äéÓ¼¼<—ßgûꫯ.Y²dûöíµµµ+W®Ü¾}ûÒ¥KåOÿë¿þ+!!¡OŸ>§NÚµk×ôéÓÜ] ·Ò1ª»N\«ººº¨¨èêÕ«>ú¨ùA61lذ´´4!ÄñãÇ ƒü:--mèС:uBÌš5+55µ®®.77÷èÑ£“&M2×b]`QQQRRÒöíÛËËË322Fm"„?vì˜ÑhŒŒŒ|ê©§ÌΛ7/((¨  àÀ|ð½Z?ŠÃæº[ª¬¬Ü´iÓ]wÝeoëY·Ùh4^ºt)""Â2[dd¤?äÃ:4uÛ‹2@‡ååå5~üømÛ¶]¸paðàÁrâ;ï¼S^^Þ­[·ÈÈÈ;ï¼sÉ’%rz\\Üž={âââÌ‹¯]»V©T†‡‡kµÚ‘#Gž9sƵÍ9räŽ;V®\¼wïÞ´´4ùg„›7o>{öìâÅ‹CBB\[/Z„3ìWq¾×Ñ?ѵÓ$33SQZZ*IÒ?þ IRyy¹··w^^žœçСC}úô‘_ †ììì×_ý¥—^ «ªªJLL|õÕW333U*•$IÇÿüóÏ—/_ž”””™™©V«íXZZÚ¹sçM›6ݸqCN·N±tôèÑ®]»Ê¯M&S§NÌ~ùå—jµÚf-999J¥²AQéééz½Þ溛·‰N§Óét^^^]»výùçŸåtyå×òªY·ùüùó^^^Ö5j4§¿–VÕä®Ëi €ö®»Ý÷úšK¥RiµZ!„¯¯¯üö!„:thZZZZZÚðáÃxäÈ‘´´´aÆ™K›={öÆ7nÜhy£¯ÍµZíŽ;6oÞ2tèЃZ§!Ö¯_áïÿÿÛ»ó¸¨êýñ㟘‘%ÀZ®€™–Ræ.i×î5ûî×$®e÷f^M±2MŒ6õÚ"àM3Ó¾š×¾å÷¡|³ëö5— Ò4ÅBLTPÖa‘æ÷Çù:¿¹³93 Ìax=ÿ‚s>çsÞç3g{ŸÏY:>üÆR…EEEݺu“þ•®µ›‹õWq˜.»¾M¤Ç®ªªª¦NjØkÄ4fÿ¦¦¦ššÃb•••öþ4òd¥×Ô…QäÂ…ù1: Û×:ÖOt@ít1Û7XUU¥R©ªªªL˯ZµjÖ¬Y={ö¬­­}ï½÷,Xàëë[WW§¯§²²R£ÑDGGÛX¡N§«¯¯ï½÷"##M‡”••)•ÊC‡577gffJµénö£HÿJý¨–æ2`À€uëÖyî¹çÍ.»Q›ètº“'OëtºK—.yzz655étº#GŽèË›.EÏž=üñGñŸ~ú騱cÍ.¾ËÙ²B¶íÙ ´)gí*!¡à|V^1dÈ/¾øâÎ;ïôöö:thjjêÀ ¿g V«¿ýöÛÿüÏÿ¼e…»wï®­­U*•¦¹¹ÙtH}}}SSSPPP}}ýš5k +Œ‹‹“^õQRRòæ›oZ Ûú«8¬«¯¯—>(„èÑ£‡Z­–¾nÿÁHLcBŒ;öàÁƒ†õ:tè±Ç³ówé´ÃÕQÚrT@«°ôzŒ~ýúét:éËŸÒ߆7úJx÷Ýw߲¦¦¦äääÐÐPµZžž¾iÓ&Ó!¡¡¡III111QQQ}ûö5¬pýúõׯ_ yä‘G¤wöZ Ûú«8̪««“¾|òäÉM›6 !<==×®];{öìÞ½{ÇÄÄH%McB$$$è_ã$Õ–‘‘1eÊ»YråÅyp*WïPÝ“‚–E[’ž>²e­³½$à6Ø@\(##cÞ¼yçÎsu ÿ_\\ÜÂ… ¥d>--íâÅ‹)))®Êxþ´wä¨Ð·AŽ í©)€ŽÇ·DŽ îŒ<´/mñ^_.qà®8Êœ‹~Th¯ô¹•ÎRòо£@»gK² Ð.£€û Yí9*¸!nñíT[¼3 [£ ]â¹À-‘£Ü_NNN§NZ^Onnnpp°cuÆÅÅ:tHú;--mñâÅ-÷Ó9*—¸­!++kèС~~~;wîÛ·ï×_ÝÚs¼óÎ;‹‹‹˜ðĉÅÅÅC‡•þ9sæ–-[JKKî€~T@»ÔØØøøãÇÇÇkµÚ²²²õë×¶öžvýúõñññú½½½ÇŒ³eËgÄ€[!GÈ…áݳ999jµZ?ðý÷ß ;zô¨T ??¿°°0!!A¥Ryzz8pÈ!fkÐKOO ëܹóœ9s„©©©aaa¾¾¾]»v]½zµ¢¢¢búôéþþþS§N•*üðÃ{õê5}útÓû{M묮®NLL  LHH¨««Bddd >ÜpÂaÆíÙ³Çù@;GŽ »úúú’’’k׮͚5ëå—_–öèÑ£W¯^ñññ_}õÕõë×m©äðáÃçÏŸ¿pá©S§RRRJJJæÎ»cÇŽêêêìììØØX!DBBBmmí¥K—JJJ^xáiœœœÜÜÜ7Þ²N!ÄܹsµZíÅ‹¯\¹RTT´|ùr­V{ùò刈Ãi###OŸ>í”öÀ£äN§ÓÍŸ?ßÓÓóÉ'ŸøÀzáâââ•+WþöÛoB­VûÑG=øàƒVjP(III555%%%Ë—/ŸsæÌàÁƒ}}}ï¼óÎ’’’7Z©ÁËËkРAwÜqÇ=÷ܳhÑ¢¦¦¦äääÐÐPµZžž¾iÓ&!DZZš§§g¯^½BBB>úè#ë1˜Ö)„HMMU*•½{÷Öh4#FŒ8{ö¬"!!áóÏ?×OXWW—‘‘1eÊÇ 7¦ D[’^˜aËZg{IÀm°¸·¸¸¸… :T‘––vñâEé=ÀnL¡à4€›ãØÝ8x M±V°À°–è8v·žG­‚S1€ÈQrAŽ ´c999:urb…¹¹¹ÁÁÁöÎ.''G­Vëÿ‹‹;tè"--mñâÅN nè¸rrr …ú¦§žzêÎ;ï,..nI'Nœ(..–Þ 3sæÌ-[¶”––:)^þô€7£tu\ÉÛÛ»ªªÊ‰®_¿>>>^_ù˜1c¶lÙò /8qÚ†áÙ¿•'K­$ fGñ*Àº¶èGåЪÞÿý°°°£GJCÖ­[îçç7hРÜÜ\}ÉÔÔÔ°°0__ß®]»®^½Ú´*ûy«««ƒƒƒêêê K–””üþ÷¿W«Õ‘‘‘ß~û­~xFFÆðáÃõÿ6lÏž=Î[V®¡¸ÉÕÜ÷úí[}}}IIɵk×fÍšõòË/K{÷î••¥Õj###çÍ›' ,))™;wîŽ;ª««³³³ccc­×á›|BÊ©rrrz÷î]QQ¡ÑhNŸ>=lØ0£‡?³²²ÆwíÚ5!DeeehhhZZÚ„ ¤WI“ûûûK…7lØpß}÷Ý{ï½µµµ555þþþ—.]êÖ­›âĉ“'OÞ³g4öÆþþþyyyÝ»wBdddLœ8±ªªêÒ¥KwÝuWcc£>€ìììTVV¶Y›´kön €|°c‡Kp’ —ãä¶5ð<*оy{{k4!„O}}½4pÆ )))Rjªßj4š;w®Zµê…^ˆŽŽ~ï½÷n»í6ooo­V«¯-''Gú£°°°¡¡¡OŸ>Ò¿:ÎÛÛ[_¬¨¨H¡PH ªâöÛo—þð÷÷ojjª©©ñññ‘†TVV´Ê’ƒãœHìhœy¯¯•{«¸ç h3Z­611ñã?.//?pà€a3vìØ½{÷O˜0aÆŒV* V©TW¯^ÕjµZ­¶¼¼¼°°P?6$$D§ÓåççKÿ^ºtIú#  gÏžçϟחÌÎÎŽŽŽvæâ޲åfTrõ/è xp7õõõMMMAAAõõõkÖ¬Ñ/((ؽ{wmm­R©Ôh4ÍÍÍV*ñóó›4iÒK/½T^^.„ÈÏÏß·oŸáØßÿþ÷‹-ª©©)..NNNÖ;vìÁƒõÿ:tè±ÇsæâRY@+q~ŽÊ¥YÀµBCC“’’bbb¢¢¢úöí«ÞÔÔ”œœªV«ÓÓÓ7mÚd½žÔÔT¥RÙ»woF3bĈ³gÏŽMOO/)) ÿüséﺺºŒŒŒ)S¦8oḇrÈ «"à–œù 9O ã–XI:‚¸¸¸… :4--íâÅ‹)))®Ž¨Ý`¬(ìù>*ë-€Ž‰}`k GE›b%¬`A{Äz  #cØx 䨹àû¨hßôKqãàÈQÑ.ñ}]À-‘£¢=!5ÜÏ£º­¸¸¸C‡I§¥¥-^¼Øµñ´„â&Wd„sÀ-uô5''§S§N†ÿªÕj{kP(jµÚÏÏ/&&æôéÓÎŽÑÌ c6ëĉÅÅÅC‡•þ9sæ–-[JKK[;6§³=5UXfï$”§¼ÊtL=Gu oo着ªŠŠŠØØØgŸ}Öhlcc£çecmëׯ7Œp̘1[¶lqb$mC§ÓµðeH–&·”Pžòr(Ða‘£Z³nݺððp??¿AƒåææJSSSÃÂÂ|}}»víºzõj}aOOÏI“&egg‹›]~øa¯^½¦OŸ^ZZúÿñþþþÁÁÁ/¾ø¢”gJeÒÓÓÃÂÂ:wîÜpY† ¶gÏžÖo³V¡»É–2F(OùöX Ã"Gµ¦wïÞYYYZ­622rÞ¼yBˆ’’’¹sçîØ±£ºº:;;;66V_¸±±qëÖ­QQQÒ¿õõõ999¹¹¹7nœ={¶J¥*((8wîÜÑ£Gß|óM}™Ã‡Ÿ?þÂ… §NJIIBÌ;W«Õ^¼xñÊ•+EEEË—/7ªí›o¾‘zn«ªªÂ¦L™òÕW_ÕÖÖ !®_¿þÝwß5êòåˆËÙ÷!·6Îì÷FŽ*êêênêß¿¿á¨ØØØÛn»M¥R½ð ÇBxyy©Tªìì쪪ª€€€èèh} ÁÁÁ‡^¿~½4­N§{íµ×T*Uccã×_ýÎ;ïøúú†„„,[¶LÏ­N§KIIñññ YºtéÖ­[kjj>ûì³5kÖh4??¿%K–l߾ݰ6ooo£øÃÃÃï»ï¾]»v !¶mÛöØc !<==}|| ‹i4­VÛ è$«€["GÞÞÞÚ›²²² Gmذ!""¢sçÎÇ¿qã†B£ÑìܹsóæÍ=zôÞ–ËÌÌ|â‰'òòò<<þïºC\\ÜÂ… ‡*„HKK»xñ¢ôÞ`×b%¬`A{déó¿–°Þp'»[9ªË87G5kV×®]W®\é”ÚZ+ `Ú#rTÇîÖÀ½¾í^II‰¯¯ï©S§æÏŸïêXŽÎK£\/@îèGE›b%¬`;Q(œyŽòı»5Ð ‹v£*nru à­ºOco Ú5ù樤¦Ü[kìߤ:Ùsè ØÝnIv9*©)·§Źû:}m<ëÚ/¥«ø?¶œ¨Y*célŒòò,@¡Óéô}žNI)IP€{pe?ªÂ@ ë1;\n¹årbo* *p®ìG5<—²åÍs/{'¡|k—§s0ä”ÞTTÈ+$À1ry•O{è˜ZØ›J‚ Ü,øÙïBIDATŒ\žGÕk¥W‰€lé{SíE‚ €¹8—\úQMѳ  ãhɾŽý$p'²ëG5Å逎À±gSÙCèÈØÂåX [ƒ|ûQ Ã²~Ë·ø7FŽ rd)Må‰àÞÈQ@^¬¼:ޏ=rT³i*·ø¢}á’ À1ä¨ GFi* *í×éZ¢¼×:ë·ørÌî~T€\Ð raz¯Q¯)7ú€!»>(  ½ dÊôTnônäÈ(A%M9*ÈŽÙ·ø’¦€Ž€äÅÊgfHSÑŽð” À1ä¨ #·ü*i*òÇuº– G¹¸e‚j4–4¸rTT£2¤©ÀÍ£€ëÙ• •$MÐaq;%à–”®§Ô€!T}yiZ¾bÜý¨àJ'¨FSqé¸úQѦ,…Ó „Ž©… ª~ZzS€Û ²À‰5: §$¨F5Л ù`m8†\À‰ ªQ=$¸‡ã–pþ½¾ü`ÓT}mÜô Ú;úQÀ5Z#”ê$Aí—3ûQ9+[´êÞ’]1€ŽƒÛF·D?*@.Ú"Gå U€-èGÈ9*dÎvp3<%p 9*8×éZ‚ 䨹 G@»Ä픀["GÈE[ä¨\âØ‚~T€\£Bèl7ǯŽ!Ggâ:]K£ä‚ ä¨h—¸pK䨹h‹•K\[Ð rTÈíàføð5À1ä¨àL\§k rT€\£B¸ÔìÅùà–ÈQr¡àú@&èGÈ9*@.ÈQrAŽ rT€\£ä‚ 䨹 GÈ9*@.ÈQrAŽ rT€\£ä‚ 䨹 GÈ9*@.ÈQrAŽ rT€\£ä‚ 䨹 GÈ9*@.ÈQrAŽ rT€\£ä‚ 䨹 GÈ9*@.ÈQrAŽ rT€\£ä‚ 䨹 GÈ9*@.ÈQrAŽ rT€\£ä‚ 䨹 GÈ9*@.ÈQrAŽ rT€\£ä‚ 䨹 GÈ9*@.ÈQrAŽ rT€\£ä‚ 䨹 GÈ9*@.ÈQrAŽ rT€\£ä‚îO«Õ®ZµjäÈ‘]ºtñòòòññéի׈#æÏŸÿõ×_߸qÃÕÂØŠ+ …B¡0. \±b…K¢j§80~üø®]»ªT*³­Ú^XùõÛû6Þ®WlY¯0áïïß·oßyóæåææº::€­ÈQáæ<5þüýû÷644ÔÖÖ^¹råÀ«V­zâ‰'6nÜèêÖ²{÷îQ£FíÚµëúõë®§U°ÃŠŠŠŠŸ~úiÍš5ÑÑÑ;vìpu8­ËÒÕ=´h=ä¨pg¿þúë¸qã®_¿òöÛoŸ:uª¤¤äúõë?þøcZZZ\\œJ¥ruŒ@+JNNnnnÿî»ï´Zmeeeee¥«ƒr&¶q˜zõÕW+oúí·ßRSSƒ‚‚ª««§M›vþüyWG¸5¥«ZÑŠ+ª««¿ÿþûÛo¿]?<44ôþûïöÙg ÊËË] ì£Óé\B;sòäI!D||ü Aƒ\K«`‡)///µZ-ý­V« 0pàÀÚÚÚÕ«W§¦¦º6<À-Ñ w¶wï^!ÄÓO?mxòj¨[·nQQQmІª««…~~~®¤µ´å6þÉ'ŸTUU9¥*´±þýû?öØcBˆ}ûö¹:À­‘£Â !‚ƒƒíðܹsÏ=÷\TT”Ïï~÷»ÄÄÄ_~ùÅláúúúwß}÷¾ûîóöööó󋉉IKKknn6û¤Š•÷‹X²Åö gñé§Ÿ>üðÃ~~~¾¾¾ýúõ[»vmSS“¥¥þå—_^|ñÅèèhµZ­R©BCCGõÖ[o¶¤}¬°Ôt–Ê[j½+W®¬Y³&...,,ÌÛÛ[­VGEE=ÿüó999fë©««{ë­·¢££¥ù>ôÐCü±N§»å»šš››ÓÓÓ Ô¹sg…Bñúë¯;€a…|ðA¿~ý:uê¤ÑhÆŽûã?Ješššþþ÷¿K£üýýÇ—••eC£þÛ,¤¿_}õU÷ÈHu:Ý–-[}ôÑ   OOÏ   Ñ£Gþùçf;«oÙVØÛ8vqxwÀŸþô§.]ºL›6mïÞ½VÖR'²±éÊÊÊ:uê¤P(Þyç³õ466véÒE¡Püå/±·r»Ø¾Ã±kîUUU)))?üpPPR©ôõõ½óÎ;Ç¿fÍÛï]ïÛ·¯âêÕ«ú!·\«ÞFÒÒÒèçççííÝ·oßÕ«W744X Ì}»Ù€ Å«¯¾jXRïòåËžžž …âÿø‡Ù***üüü Errò-[Ò–½AëCE›FmYå¬4ø-Z€-t€ûêÒ¥‹bðàÁvMõÖ[o)•fnƒW©T›6m2*\QQñðÛž0a²eËL·2iÈo¼a:ß7ÞxÃÒViWHÒ¨åË—OŸ>Ýt’É“'ÛµÔBˆ¥K—:Œö6•ÖëÙ³§ÙÈ}||¾úê+£Âeee>ø iá§žzÊú|—.]:~üx³-cWú —-[6aÂÓI¾ÿþûÚÚÚÑ£Gòõõýþûïml^³ñè—îÆR·’©Ç¼ººÚÞ°ÂÞÆ±¾DF¿¾cÛ¸cô· !zôèñòË/ÿüóÏN©Ùì¢éìiº?þñBˆ¾}ûš­÷îÝÒ„Çw r[‚·w‡cûܯ^½z×]w™-,„8zô¨--©Óé–,Y"ÕoTØÒZíØ6bv£B 2¤ªªÊ4*öí–¶ÔDBN7fÌ!Ä#}zfffqqñ?ü0yòd!D¯^½LW\í I*æáá±`Á‚3gΔ””9rdàÀÒ¨ÿþïÿ6šÅÚµk¥QQQQ›6mÊÍÍ-++ËÉÉÙ¶mÛĉ £µ7+ìm:+­»|ùòýû÷_¾|Y«ÕæååíØ±£ÿþBFsùòeÃÂ'N”êyæ™g~üñÇ’’’¬¬¬?ýéOR£Y™¯”%&&fff–––ž;w.33ÓôöìÙS¥R½ñÆ.\(,,ܸq£bÀ€/½ô’——Wrr²~T§N„´±y _dø ™ÊÊJN§O'¦L™òÃ?H/ œ5k–½-`…½c‰Ù_ßmÜaUUU›7o=z´§§§þdôX»vmQQQKjnùŠýÏþSªäÌ™3¦õK­áXå¶o×Ç®¹KÁ{xx,^¼øäÉ“¥¥¥EEE'OžLKK9rä±cÇliIN÷ÄO!îºë.£Â–ÖjǶiß5mÚ4iŸ–™™9uêTiÔŒ3Œ&qlßn)àÊÊJ}·^å¿ÓétÛ·o—Fýú믦#ÍqôèѦ£LY£µ¡ºÖ?ŒÚ¸ÊYop-DŽ wö믿úûûëÏ&CCCãââ–.]úÍ7ߘ^×étR&ðæ›oª¯¯:t¨¢_¿~ú'Nœjž3gŽQùÙ³gëçk8ÜÞƒ«½!é .î¾ÿþû†Ã‹‹‹5â©§ž2~ùòe///aùJCCƒÃÁXâ@Ó鬶ž©ššéAÄ%K–è9rDªäÅ_4*?wî\ëóB¼öÚk¶ÌÚJFnذÁpøÊ•+¥áF—öõ7¶eggÛƒÙûþûï¥á FågÍš%2J>k+¬4Ž%f—ÅÞmÜ)òóóß}÷]éÞQ‰J¥?~üŽ;êêꨰå+vmmm@@€bñâÅF嫪ª¤’—-[æXå¶oûÇÞ¹ s ž•`L[òìÙ³Òž sK+kuK¶Ó}ZBB‚4*++K?°%ûvK›¡•^ĺººÛn»Íì/«¿ÙUºù–¬„ÑÇP]ëFm_å¬48€b»‚›;sæŒÙûˆ:wîü—¿ü¥¸¸Ø°ðÒ¥K…MMM¦U1ѲÕÞô³¸ë®»š››ÊK]ˆ·ß~»áÀÅ‹ !<==/^¼h:‹c‰M§³óT^wsÑzè!ý?ÿùÏBµZmz©[z"ËÊ|ƒƒƒíÍ@L0¬022ÒhøÙ³go9ê³Ï>³=³-6gÎ!„OYY™Qù’’édîùçŸ7­Ç°ÂRãXbé×·kw®Ÿ~úiÁ‚=zôÐÏ4((hΜ9F7 ÞRËWlÝÍD(<<ÜhÃß²e‹TNNŽÃ•ß2xÛw8öÎ]º‚¶`ÁÛƒ1lÉ’’’­[·vëÖM¡T*úé'£Âf×j‡·ëû´¹sçê:¼o·²ZO™^|ñE!DXX˜Ñ“’’„555f'4b%Œ68†êZÿ0jû*GŽ ´Þ™7wÏ=÷9räèÑ£ ,ˆ‰‰‘Î-„k×®íß¿¿á+:¾ýö[!ĨQ£ª«««LôéÓG*¦¿ô{øða!ÄÈ‘# {r$#FŒhyüö†¤kúæ†Þ½{ !®_¿n:‹aÆYz3j˃1åô¦;xðàôéÓ#""ÔjµþÅo¾ù¦Âð•R?êÈ‘# Ÿ-”h4ëó•Î]Z€!ÓÙÝqÇÒ#GŽ´4ÊèçsÀwß}'ÍBêy3$E%ý@F¬·€4ŽíìÚÆ+::úí·ßÎËËÛ»wïôéÓÕjuiiéºuë~øáÈÈÈ={ö´|¶7tOé¥K—¤ßWOÊQzè!ÓGìœø»Ø¾Ã±wî÷ß¿býúõÛ·o·òæ!C†/ »í¶Û&Ož\PP R©ÒÓÓ£££M#7]«ÞF¬ïÓ š–ìÛÛ Ÿyæ!D^^žáË›››7oÞ,„ˆ×o;¶0† ¡DåÀ*ÀéÈQÑ!<ôÐCo¿ýö±cÇ*++333“““¥7väååIϽH²³³…ëÖ­Ó˜*+**’þøí·ß„–¾l¡?òµ„½!éIýF|}}…555†/\¸ n•[)SÎmº¿þõ¯Ã‡ß¼yó¯¿þzãÆ £±†ŸÇ”æi¶ë)Ñg‰- ÀP×®]†èÏ¥g½ÌŽ2úùpéÒ%a¹‘ï¾ûn!D^^žé(+-`…cc/·qKLÏ\mÿÌŒ‡‡Gllì¦M›®_¿ž’’"ÝSúË/¿?~¼%K$ìlº!C†„‡‡ !>ûì3ýÀ¢¢¢o¾ùFÜÌ`®ü–lßáØ;÷•+WzyyiµÚI“&…„„Œ?þwÞ±ýמžžwÜqÇìÙ³õ1»V;¼Xß§Iû‰Ã»SÇ6C!Ľ÷Þ+=$üÉ'Ÿèþë_ÿº|ù²ÂlãXa6 Cˆª…«§ GEÇ¢T*û÷”tîÜ9©«êĉÇŽ“ÆÚxZV[[+ý!ÅšöÈI, ·‹½!é¾ÖÅºŠŠ !„ôäX+cʉM·yóféO111[·n=wî\qq±ôâŠW^yEaøõ élØÒ÷B­ÏW:ána†¬üFVF鬾OÒ¶4¾ÙOzXj+n‡Y߯-1{òjûL+**6lØ—””$u¼¨T*ý_coÓ) )ÿâ‹/ô?Û¶mkllT*•“&MjIå·dûÇÞ¹5êØ±cøÃ¼¼¼ÊËËwíÚµpáÂx OŸ>_ýµÙúõ/ «ªªjhhÈÍÍ]¿~ý½÷Þk¶°ÙµÚámÄöIÞ:°êI]©_~ù¥´Û7óÕ{î¹gÀ€vUe6 CˆÊU€Ó™ÿÔàöÔjõêÕ«¥·ždff>ôÐCBooïÆÆÆ¤¤$[¾'UR^^n©¿Åö~Icc£é@{Cr€F£)++³å3ƒN ƉM—––&„ˆŒŒ8}úôøøø~µÕ¦›:uê›o¾YZZºgÏé» Ò¾cÆŒ1 Ƶ+­½sïׯߗ_~Y]]}üøñ£GîÝ»÷СCÙÙÙO<ñÄöíÛŸzê)£ò^^^-LoÞFlŸ¤ öí¦ž~úéyóæUWWoß¾}öìÙ_~ù¥°¿Õ×C…ó£ö®rœŽ~Tt\úû‹ª««¥?¤çµ¤{_m!=À)ÝGdêܹs¦¥;6ÍÞüVPP`:ÐÞð»ßýNqòäÉ[–tb04%?ýô“büøñ¦GýüóÏFC¤›!-=kwþüyÛçëXr 5‚¥F–†KeZεcº[bö… VÊ9rä¹çžëÖ­ÛO<ñÅ_ÔÖÖöìÙóå—_>{öì‰'^xá…&¨Â¡¦»ûî»ûõë'n¦¦.\:MoôuíïâØÜ}}}GŒ‘””´ÿþ3gÎH¯ªÒ¿´Æ¹ÞF¬ïÓ Ÿùoƒ}»©Î;Kù•Ô}ºmÛ¶šš¥Riº†8¦ Ž¡¢ £m¹Ê0BŽŠŽKÿhP÷îÝ¥?F-„ÈÈȰñÖ Áƒ !öíÛ§¿oJO«Õîß¿ßtéDÓ—¸ètºýë_¦åí É>ú¨âàÁƒÒ#XV81šÎ’ºº:!„éÇÙ‹‹‹ _ "yä‘G¤ùšv¥VUU™–wzr 5þþýûMDz²2©ñ¥†j9×6Žé6ÞB¿üòËk¯½v×]w=òÈ#ëÖ­+))ñóó›6mÚÞ½{/]º”’’â¬'è„£M'%»víª¬¬Üºu«B£ÑHŸmyåÎÒò¹÷éÓgÚ´iÂÑëJ·äð6b}Ÿf8IkìÛ¥g¡…Õ[µ¥Û}¿ûœ)S7nœéðŽiƒc¨pÑaÔì*gKƒp 9*ÜÙ3Ï é_:‘m¹Ön{·ñ–8p`ddäo¼‘››«P(FŒñÉ'Ÿ\»víÓO?õðpòñÔ±¦‹÷ôô¬©©Ù¹s§Ô›:aÂý7ù$''§¬¬,??ÿÈ‘#«V­zä‘GºvíjX~Ê”)RùéÓ§ÿøã%%%™™™Ò@ýS ËïÞ½[8hРcÇŽ•––þüóÏûÛß<<<ôwŽ-…½!I…mÿvœN§[³f4üž{îùôÓOûí·²²² .lÛ¶íÉ'Ÿ4¬ÊÞ`¬°·é,-šôq?!D||ü™3gJKK;&uI·1Õ3aÂi`BB©S§JKKOž<)n†……Ù>_‡°^¡c£,±4ÉŒ3ôŸ••eØøBˆgžy¦å³–8Ð8v-‹°w˜T[dddrrr^^žSê4¬¹…+¶žtg„þ¶Òo¾ùÆ´Lkÿ.K;»æ®P(}ôÑuëÖeee–––fffÎ;×ìk׊j½°cÛˆô6iý$YYYÒu1!ÄŒ3Œ&qâ¾]"ÝD-„HHH¸råJ}}}CCCCCƒQ±””qSHHH}}½-Íec­} ÕµþaÔöUÎÆàrT¸³Î; Ë Åœ9s¦JOO·ò™¸^½z®¨¨xøá‡M‹ýñ\¶l™ÙƒåôéÓMËÏœ9sùòåfËÛ’4ЮSFi”¥7s.]ºÔá`¬p éÌ.ZEE…é7…³fÍ2»¼¥¥¥Ò3{F&Nœøúë¯ !<==m™¯ÃX¯Ð±Q–XšäÆcÆŒ1û >þøãÕÕÕ-ŸµÄƱ¾,+V¬0èØ6î˜çž{îØ±cN©ÊˆÙEs¸é6mÚ¤/Ü­[·¦¦&Ó2Nÿ]ìÚáØ5w+¿ïÈ‘#«ªªl Æ®ÈuŽn#Ë–-ûÃþ`:ÉàÁƒB•8kß®'Ý×jĨLAAþFk®àÜ2ŒÖ>†êZù0j©Œ0·ÊÙÒàÀ½¾pg………»wï^°`ÁðáÃ{ôèáíí­R©n»í¶Λ7/++ë£>2MÌrss_}õÕ˜˜˜   OOOµZõôÓOoذáôéÓ†…5ÍÞyçèèh•Jåããóàƒ~øá‡;vì°tï߯ßÿý~ýúùøøøøøÄÄÄ|úé§7nT(–Ä®óÊ+¯œ:ujΜ9‘‘‘ÞÞÞJ¥²K—.£Fz÷ÝwŸþùÖƦ³TÏÿþïÿþío»ãŽ;”J¥F£2dÈæÍ›?þøc³å9²råÊ»ï¾[šï€RSS·mÛ&½YÇzÚÓòäÀ××Wz!mlll`` ‡‡G```llìÖ­[wíÚezk¨ÃœÕ8úǽŒÞ²ãØ6î˜?ü0&&Æ)U²´h7Ý„ ô߉7»5¹v¥µkîÇŽ[ºté£>Ú³gO/////¯îÝ»ÇÅÅmݺõÛo¿µô©–slñððرcÇ|ðÀøøøxyyÝwß}ï½÷Þ¾}û̆êô}û—_~¹téÒûï¿_­V[:¦tíÚuܸqÒßN¼ÑW¯µ¡¢•£v­r¶48(t-þÔ³V¬Xñꫯ g|ÐmãÉ'ŸÜ¹sgtt´þ.È„V« B¤¦¦&&&º:grãEëP¤üä7Þ>ñ*sO?ýô¶mÛxà~øÁÕ±XÄ1èÈèG!„¨®®–Þ ùàƒº:Ó¿IúŒ„;qãEƒ<•••}õÕW¢u:QÀ)ÈQt,•••f_í¸hÑ"éËO?ýt›…[øòË/…*•Êý® ¸ñ¢AžÒÒÒjkk}}}õYTp:㯓€{ËÌÌœ={vbbblllxxxCCÃéÓ§ßÿý¯¿þZ1|øp鵨ƒªª*­V»sçÎwß}W1a„€€Wån¼h§ÆÆÆ¦¦¦}ûö%'' !ž}öYWæ‘£èp.\¸°páBÓáýû÷ÿüóÏyï…|h4ýßáááï½÷ž ƒq.7^4È“J¥Òÿݽ{wéQO'îõбôë×oÕªUqqqááá:uR*•¡¡¡>úhzzú±cǺvíêêño|||¢¢¢,XðÃ?ôèÑÃÕá8“/dK£ÑÄÅÅ8p ((ÈÕ±€E¼× ô£ä‚ 䨹 GÈ9*@.ÈQrAŽ rT€\£ä‚ 䨹 GÈ9*@.þ¦N?n»Ý™ÀIEND®B`‚icedtea-web-1.5.3/plugin/docs/PaxHeaders.24993/java-js-wf.png0000644000000000000000000000013212574544466020362 xustar0030 mtime=1441974582.501016048 30 atime=1441974656.417866917 30 ctime=1441974670.094024345 icedtea-web-1.5.3/plugin/docs/java-js-wf.png0000664000076400007640000007760212574544466021457 0ustar00jvanekjvanek00000000000000‰PNG  IHDRÆPsBITÛáOà IDATxœìÝ{\Wþ?þ ȵ ¨ÝjÕÚªЭ°T[µ°^悬[¾»ên½W­µjÛÝ­¶µ+àzi ÖÖÞ/PÛz][ïTËES¨ (0&$Ìïùu6K&a€Üy=ÿà‘œLÎ9sæÉ¼çLEQŒÇ㹺 \qÏÝt•èz"ú„ônò9B`x7‰ïæYÇEÜw•<âøÆ³bÂ’}ÙÓGÃ+¹Ãçá)-ƒÞÀ^!„hé ì-p‰F/·îp„fóùâÒU>÷E†^çV½òJŽdl57ánŸ#7é°r·h…î-à¹z[ôrY_¾sºÒ=ž²Á<¢“–pÙK`wŽŽ„¢³ûw ¢Å‹Ù7Z*àL½êø™¢(ŽëÛÇY]ê¦Ó¸¤Á 0ÈÞ Ÿ#àÑö‚î-à¹zIôr<ÜŽm™cýJê¹Å‹ggg744رN-ˆîèU ·Ž½â„®Ê¼Zî5»ö,*ÓºH$ŠŽŽ.))éI‹ÝÓáÔÚ€!„ÇãÅÇÇ—––ÒOé¡{çw‚ƒƒ¥Ré|@¹zõê˜1cD"ÑôéÓëëë !ƒ *//g*©¬¬T*•„¬¬¬!C†…ÂAƒíÚµ‹~µ¹¹9--M©TÊd²gžyæîÝ»ÖâÈVJIQT^^ÞÆ=ÚÞÞδôç?ÿY,GEE©Õjk…Ö°®Àرcxà½^OÇúG}Ä}ÜÖƒ>¨ÓéÌwÖa׬Yc4oß¾]\\üÝwßíÛ·ÏE]v8>Ÿ¿páB;2kS7W®\>|xPPÐ_ÿúW¦ð÷¿ÿ}‡/<úí¯½öšR©0`À·ß~K—»0’'Ož|çΕJE©¬¬¬ªªŠ‰‰aíù¤¹¹ùÒ¥K‘‘‘ô«úÓŸnÞ¼yýúõ[·nµ´´lÞ¼ÙZCÙJ)/\¸`2™fÏžíëëûÃ?Ð…z½>44T£Ñ„‡‡¿ð 6 Y±®À…  ÍwÊÜWÀƒX;„ÍÉÉyá… ÅÊ•+srrèr:·‰ŽŽ6Ïm Ðáp™õxQ«Õ&''Éd²?ýéOô’.OÝ ÃÁƒ»qbuéÒ¥O?ý´Z­¾sçSxìØ1Ë/<ƒÁÐÞÞ^SS“žž¾nÝ:ºÐ…‘ìççsâÄ Bȉ'&Ožh­ó–u²î¬µNz°#p-—Æ€”JåÿøÇ‹/š_`mwd9¶¬[A¡PäççëtºØØXf.¥­­mÛ¶mï½÷^VV–íÏëÛY£:555%%¥Ãº³òˆh™8qâéÓ§?þøã'žx‚.aݳ±žje-´LΉ•s¬ ÑÌÏ[;¯ÁÚº yyyÑÑÑÌÓ±cÇŽ5ŠÙ-Ó—2r}zèÐ¡Ö iׯ_ÌÓææf>Ÿ_RRB?ýá‡î»ï>Ö%¹üì•ãÂÕiOÌ×Ë`0ôë×oÉ’%.\hoo§ kjjx<^[[ýôÒ¥K¤‡ôµ×^3‹-úãÿh­NŠ¢’““g̘qçΖ––ÄÄÄÕ«WS•˜˜8þü¦¦&½^ÿÉ'ŸX{o׎ãòôêH¥R©TS\\l­?æO¯_¿. )ŠÒjµ„FCQÔéÓ§éBko'„èt:Š¢®^½*•Jér×Fò®]»æÏŸOQÔ3Ï<óꫯv©Î;v¬]»öÎ;R©´®®î…^xñÅ­µN÷¿ªªÊr°rÚçÈmãìÙ³Ó§O÷óó £KÖ·Slck#hW¯^•Ëåô{ýüüJKKKKKéÖÍ×],›wÞòí–×h4æ±jcÝÝ'Zl„@ 8~üøòåËyäfu,÷l |>ŸÞR555gΜ¡(е¢¨÷ßÿ×_5™LëÖ­›8q"]øÐC½üòËF£ñ™gžaͲ!f FãæÍ›}ôQÊJZkÝ:ÿommµ%>>>©©©ÍÍÍMMM×®]£(j„ Ì—BZZõÛFüâ‹/x<^nn®ù.ËšmYŽ’Á`ËåeeeEݼyS&“éõzkãI;{ölppp§MS]‰"D …há-¶cŸÁztÄz5nܸ¿ÿýïF£199¹C%ªe}»å 0ã©×ëW¬X1iÒ$ó ;ýÊ£¬Ä$ëÛy<ÞŽ;L&ÓK/½4nÜ8óeÚÚÚ6lØðØcÙè|dd$½îO?ý4ݵ.qüèÙ^ÍÂ1¤¹oÍ.í Xbí’ F¯í]EQƒaÍš5?þ8Sîççg¾dYY™¯¯/ý¸¤¤„>68~üøôéÓ?ûì³Ñ£GôÑG=öX^^EQ_}õU||¼R©3fÌwß}GQÔ¯¿þÊ„H¥R‰D¢T*Y⾦¶RÊ &¼ñÆE½ýöÛÿ÷ÿG·d¹¬…††fm,—ä¾®Õ¥”’b;„-++3ßx¥¥¥‰ÄFnÓ¡NÖãENçããS]]Ýiz¸v—·Ñ(—Ýh‡íÝ(ë.ϵ‘\RR2hÐ Š¢†zùòå.ÕɺwpÄŽÀ¡Ü60hË–-?~¼ŽYŽ­µ­°ÿþððp‰D"‹E"SÝîõë×Í -»dííÝ^w÷‰Ûa`4GŽ9uêTzY÷lZ­V äää4773og-4Ç$ç¬ç Xb~___¥RIŸì°v^Ãvëüúë¯>>>¬#С¤CÂßá$sÌòl…mÖ>tÌ(QµhÑ¢üãE½õÖ[ ,°±$­¸¸˜ŽÕNÙ+¥D´t(éÍÑÒ¥”’õèˆu³Ú8mסÚ.^táYT¦uŸ|ðÎ;Ö:O7D¯û©S§l¤”Ü?z6úi9 CšûÖä¾7`mˆµK¶õ<¥¤(ê§Ÿ~êÛ·¯e9>åÔ¡«MMMýúõ[±bÅ—_~ùÜsÏ 8°¡¡y‹ÉdÚ¹s'½dss³ŸŸ$Ö:ÐÕ5µzá«Z­>þüßþö7ÿåË—_ºtéöíÛ„¶¶¶ÆÆFBH}}½\.§f-$„øøø˜L&æ©R©ôó󫪪Òh4F«ÕÖÖÖÒ/yñ?x1_µñãÇóÍ7uuuÓ¦M£¯j lkk3ô---ôå¾¾¾b±˜Ò·o_¿eW«ÕF£122R&“Éd²éÓ§kµZµZÍãñî¹çÇ®˜=tˆ>Ÿo2™èmnn¦ ûöíÛÖÖFïãºq_"—GrDDŸÏÿþûï[[[Gm­Ÿ¬uŽ7îòåË'NœØ¶mÛ±cÇ.]º4a„Þð9rB`0Äbñ²eËè/ ë0v(dÝ &55uÏž=æäÉ“ÌÞÖk!ËÛiAAAmmmMMMÄbÝ=t¯ëããóÄO$''ÓOY÷l‰äã?~÷Ýw‡ òàƒ~ÿý÷„ÖBBÈ"""¤RéĉÛÚÚ!õõõ¾¾¾R©”Ò·o_ BF£inn^²dɪU«¬uÛZëÖÈd2“Éd~µ¤5~~~dž644°~)ðx¼>}úÐÍ·» æÛÝr”!sçÎýä“O!Ÿ|ò sá7ë’´ÆÆF'ßÝ ÑÒ¢…#Ö£#ÖÍÚa m×ɬƒ@‡ŠF£9qâİaúÔyÖ˜´F …Bús„I·^UUÕÒÒ’——g­ótCôºÛ¾‘,÷ž~²—æ¾5¹ï ¬}v,»ähEåææ†„„X[@&“7.##Ãd2effN›6"‰ú÷ï_PPðØcÑ7Ù’ËåjµúóÏ?oiiáñxE BH```RRÒÊ•+ép½~ýú—_~i·®wðÎ;h6lؾ}û®ÿvA¦ÉdzöÙgSRR¨ßr÷…´»wïüøãLÉÓO?½téRú,˵k×¾øâ º¼¡¡Çã]¿~½«9±kuÚ“«W¯Êd2ËòŸ~ú‰.ooo—ÉdW¯^¥Ë:ôûßÿžR­VKQÔéÓ§ï½÷^ó÷v˜¥´<Í`c–R¥R¹Õ,e‡ÑëõgÏž¥(jýúõ.ö0™LK–,éêd”;DrjjêäÉ““““m k£F¢¯Z™4iRxx¸%{rnÉ¡Ü30ôzý?ÿùÏÆÆFƒÁðüóÏ?üðÃÌò–‘µ«–[¾ŽýçŸÖëõÌ…If)mœñµñöKRf&u¸(‹c¬:?Z8†3ïÄz•f~ª•µðÎ;|>ÿرcííí/^´<ÇÏœzgmˆõòÈ#µµµtaJJ }´™ššºpáBŠ¢nß¾=yòd±X8~üø~ø^R§Ó-[¶¬_¿~B¡0,,ìÍ7ßìášZ¥üúë¯üqæé¬Y³è_] ‚7nH¥Ò’’’­[·Ò¯²Òåÿûß}ôQ‘HtîÜ9BÈ¿þõ/Ÿððp‘HôØcÑeBärùßþö·ÈÈÈàààÏ?ÿÜZ¯<ÅÛo¿]TTDQÔçŸ~ÿý÷Ó…ƒáõ×_ojjjkk{÷Ýwér—˜˜øÒK/µ¶¶Ö×׿þúëøÃèå333ésqqqÖb=Í  Ÿ|òÉçŸ^§Óµµµ™gPPÁ` o@ê:DˆŸŸß«¯¾:sæÌ˜˜ó“£™™™ï¼óŽR©T(tù¹sçD"‘ùO½™É«Ü!’cccO:5}útú©µÎ³Ö9bÄBÈý÷ßOß›ÇFë^à áããsòäÉ!C†H¥ÒS§Neff2/qÜYn…~ýú½ð ‘‘‘aaa]=MéÒÛ322öîÝ«T*;œ®æ«îŒuÏÆzª•µÐ`0˜L¦þýû·µµ½ùæ›t‰ä¡‡Ú½{w{{ûþýûm4Ätƒ2;OüðCzÖÖm‹‹‹+((èꀰžæÎÚW’å(BÁŒ3–.]úè£ØX’–ŸŸoãKÊ - Z¬a=:bݬR©422’9 ³Q'ëÛm‚¥úúúž={–yj?¬1Ù=³gÏ®­­=~ü¸µu7n\fff{{{VV–.qÿèѺ}ÊÒÜ·&÷½A?;=GOÐwûmBÈ… žxâ‰ÊÊJ—´>cÆŒ^xaâĉ.iݾöìÙsãÆíÛ·sY˜{ Zˆ»,æeœ“*•j̘1N8àô2†¥×Ä­ùŠð]Ýè²üüüîü£OVUU5kÖ,­V;nÜ8æÿv 0 K˜sû÷qU7èkï½ÃÿøGWwÁQ-vçÅÑân“¬º–R²^bk‡ën›mÛ¶mÛ¶M$Ñ—G÷³fÍš5k–+D${»x7œƒî-àn“àκvá«›pŸùb÷é‰#¸Ï…¯à^pá+8—]ø .᡾‚KàÂWð\½óÂW«w|° )%tRJè&ÜñÀyè"zÿ?¥ô²µB,+€WÂ,¥àX€ ì-;D p„PÏâ´{½òx<§µÅwhKÎ\p9lk`ÕK»;è0KÙ#ÎùŸ~8NO‡ýÁþœ3ŒA´pƒ!²/Dtîø Ý„”º )%tRJè&¤”^Å™7[rlJ‰ÛF@/ÝôN¸Y°»Ã Àm!]€nÂo) ›R@7!¥€nBJ Ý„”À«ðx<§µåؔҙkàBØÝ@ï„YJgÀyàÑ·¨ƒnCJéîðñ·…”º )%tRJè&¤”œàG­–RxŠ¢œÖ–cSJg® € aw½f)œç€;D 8¢º )¥»ÃÇÜRJè&¤”ÐMH) ›xø©tf)ÿ‡J¥ò÷÷ïöÛòóóéÇk×®µS¿¸âñxNk˱)¥}×Ä<ßS©T<oüøñÌ«z½¾oß¾"‘ÈŽ-vɹsçêêꢣ£é§‹/ÎÎÎnhhpUÀ™œ¹ãppà]Ïþýû/^ÌTkY=ɹ{÷î~ýú 2äÌ™3;wîìׯ_HHÈ?ü`Þ¥ÌÌÌÐÐP‰D²lÙ²¶¶6Ûµ…„„$''Bòòò¦L™b^OLLLnn.ÇqÀÇ<ŽëSÊ””…B¡V«OŸ>}èÐ!º0==]£Ñ”——ß¼yS­VoÙ²…rôèQ@ Óét:]hh(!dÑ¢EÙÙÙ&“©ªªêÂ… 3gÎdªe­Á`0ÔÔÔܺukÉ’%‰‰‰·nÝZºtéêÕ«™7 †S§N•––þòË/………;vì°Q›J¥*++Û¿¿F£©¬¬ 7_µˆˆˆ+W®ti4(º7ÎvgŸ;¾vu†i´¹¹Y"‘ܼyóž{î!„|ûí·O>ù¤Z­–J¥7nÜ  Ï;7þüëׯ«Tª‘#GÞ½{—Â<ž2eʪU« «««ÿò—¿Œ3F§Óµ¶¶ZÖ››¦Õj%IQQÑÈ‘#u:]```QQQTTT}}=]mXXXUUÕÀ !ß|óÍòåË/^¼h­¶††¹\N¹qãÆï~÷;ú XFIIÉøñ㛚š¸!—ÍÁ}Ip7ІN H€;D 8¢ÎË8sƒòÓŒ5jµºOŸ>tªF !„ÔÖÖ¶µµ >œ.¤(J X«añâÅ(,,ÌÉÉa ­Õ $ !ÄÏÏ/00000~L_XKãóùt>IÇÚâããOžtèÐûï¿Íš5kKMMen/DÑëõyyy ,èâx€GÂïO w²çíyz~k™¼¼¼+V÷¼K.‘°jÕªèèhBHFFFyy9}ÃX.p{7Ñí{MôB®O)¯^½Ú§OŸ#FTUUÍ™3gÚ´i[·níy—<RJ7”€;×_øÚÐÐ0sæL‘H4zôè1cÆlذÁÕ=À?àÄõ³”ÞÊ|²Ë¾#Ó{ÆÐ%°!¸sñÿ¥ì%˜ôéx×_øÚ«ð~ãꎸ’J¥ò÷÷ïöÛòóóéÇk×®µS¿ Ë\“RòzŽ#àœçÎ<ßS©T<oüøñÌ«z½¾ìP² IDAToß¾"‘ÈE½#çΫ««£ï©KY¼xqvvvCCƒ«úà†œ™h`–ÒÅÜ6·¤ùùùÕÕÕýüóÏôÓÏ>ûL©Tº¤'F£‘’••5oÞ<¦P ÄÆÆfgg»¤KæÜöS àP®I)¹ÜNÓÓuu(:൵µ3f̉Dô4cKKKZZšB¡Ëå©©©z½ž2}út½^/‰D"QEEÇKNN>pà]Ïþýû/^ÌTkY=ɹ{÷î~ýú 2äÌ™3;wîìׯ_HHÈ?ü`Þ¥ÌÌÌÐÐP‰D²lÙ²¶¶6Ûµ…„„$''Bòòò¦L™b^OLLLnn®#À>pÞ¸C´€ó!ê Û0KéÎÉ$))) …B­VŸ>}úСCtazzºF£)//¿yó¦Z­Þ²e !äèÑ£@§ÓétºÐÐPBÈ¢E‹²³³M&SUUÕ… fΜÉTËZƒÁ`¨©©¹uëÖ’%KoݺµtéÒÕ«W3o4 §N*--ýå—_ wìØa£6•JUVV¶ÿ~FSYYn¾jW®\qøüGa=ÓccÅ7†ÍÍ͉äæÍ›÷Üs!äÛo¿}òÉ'ÕjµT*½qã]xîܹùóç_¿~]¥R9òîÝ»„æñ”)SV­ZUXXX]]ý—¿üe̘1:®µµÕ²†ÜÜܰ°0­V+‘HŠŠŠFŽ©Óé‹ŠŠ¢¢¢êëëéjꪪHùæ›o–/_~ñâEkµ544ÈårBÈ7~÷»ßÑWÀ2JJJÆßÔÔÄq4ì8¼½'˜ Ï>»SðbàÑ·¨ó2ÎÜ ø'"ÎàÚϧZ­îÓ§ªBBBB!µµµmmmǧ )ŠÖjX¼xñ srr˜Bk5‰DBñóó ¤ÓÖÒø|>OB|ûömµÑù$!D*•šL¦ÖÖÖ€€¦ª¦¦&™LÖýÑ€À…¯ŽÒßU:ˆR©loo¿}û6ý´²²’¢P(|}}«ªª4F£ÑjµµµµÄÊäêܹsóòòÁرc™Bk5pa4«««éÇýû÷çR›L& .--5/,))5jÇvÀ¾Rz?¡P˜°fÍšÖÖÖúúúíÛ·Ó…III+W®Ôjµ„êêêcÇŽBär9ýcHóD"Ñwß}÷þûïw¨–µ.x<ÞºuëèþlÙ²eþüùk‹?yò¤yI~~~\\÷Ñ;BJÙ+deeÕÔÔ(•ʇ~xîܹ|>Ÿ²gÏ>Ÿ&‹§NZTTD zî¹çÂÃÃe2YEESÄ FŒÑ¡ZÖ¸ðóó›4iRxxøÐ¡Cï¿ÿþ5kÖp¬-55•¹½!D¯×çåå-X° ‹ãàÍœy¥$nÏã.œ6†yyy+V¬(..îÞÛ].!!aÕªUÑÑÑ„ŒŒŒòòrú†±ö‚`Á­/€;D 8¢º )¥»pè^½zµOŸ>#FŒ¨ªªš3gδiÓ¶nÝÚí®z73w¸ðµWhhh˜9s¦H$=zô˜1c6lØàê€7À,¥»À:ˆù=lí;¼Øø¿”Ћ0é%ò@»À…¯Ðñ~ãêŽxž²²2…BÑ¥·$$$äççÓ322Ö®]ë€~€kàÂWwÑÕ1ûbFÁÌJ¥9räÝ»wm,sîܹÿ÷ÿþß?ü@?Õëõaaa—/_ rJÀ±0K @æ-93]Z>++kÞ¼yÌS@›mï~9¯‹\Ý_èœy‚”ÒSQÀMWÇÓ¡[ÍmeeeÍŸ?Ÿb2™ÄbñÆ !r¹¼½½]¥RùûûïÞ½;$$dÒ¤Iþþþô»¦OŸ®×ëE"‘H$ª¨¨hiiIKKS(r¹<55U¯×Bòòò¦L™bÞVLLLnn®³×)%ôj½<“dDEEB.]º¤T*éÇ“'OîÓ§!Ä`0¨Tª²²²ýû÷3ï:zô¨@ Ðét:.444==]£Ñ”——ß¼yS­VoÙ²E£ÑTVV†‡‡›·qåÊ箟ýÙñtô˜µî-à|ˆ:è6¤”Ðá ¿ƒaÆéõúòòòüüügŸ}ö—_~1 QQQôEmܸÑ××W °ÖÐÚÚúÞ{ïíܹS, …Âõë×ðÁZ­ÖÇÇ' À|I±X¬Ñh¾Jàø'"Ћ ‡´aòäÉ+W®¼páÂùóç -ZD¿*är¹·×ÖÖ¶µµ >œ~JQ”@ J¥&“©µµÕ<«ljj’ÉdŽ[p&¤”àåFruòäÉóçÏO˜0!**êÓO?ýõ×_ÇŽkã-æWÈ( __ߪª*¡Ph¾Lpppiié˜1c˜’’’’Q£FÙ½ÿà¸ð!$**êÃ?¼÷Þ{Attôž={&L˜àççgã-r¹Ü`0ÔÔÔB„BaRRÒÊ•+µZ-!¤ººúرc„øøø“'Oš¿+???..Α«΃”!äÁ¤(*::šyÌüÒš   çž{.<<\&“UTTìÙ³‡Ï燅…‰Åâ©S§BRSS:ļE¯×çåå-X°À¡ëàZ6þ£ þÓ xž]. ćï9Œ¡›À†°»„„„U«VÑÉjFFFyyùŽ;\Ý©ÿa~LßéE„@§ºš%"HÀgŸ#4îuÐmH)ÝÆÐM`CôB¬ €µ-‹N!H çpp·¨ƒnÃíyX0y&¾_Àù°ççCÔA·!¥èüÊë!·°)%'8}` w|è <_—¶µCÃÉû¨T*'úÍSO=EúûûÛX€râĉèèh‰D"—ËŸ|òÉk×®¹lÀ&ÌRØâÝi$EQuuuJ¥ÒŽuF>ÿ¿_.@§ÓÙXÞrãÇÏ™3'33ó‰'žhkkËÈÈˆŠŠ:þ|HH!¤¦¦¦ÿþvì0ôf)XtuÓ㔕•mÚ´ièСûöí£K¥R©B¡X¾|¹Ñhܺuë3Ï<ü%..nïÞ½„–––´´4…B!—ËSSSõz==ñ¸{÷îäääömõêÕÛ¶m›;w.ŸÏX¾|ùܹs_~ùeúÕûî»oÖ¬YŸ~úi[[[€žCJ ð_^ŸI¶´´¼óÎ;S§N0a‚Z­>|øðêÕ«é—RRR|}}oݺU\\|æÌ™íÛ·'%%}ú駃R___PP0{ölBHzzºF£)//¿yó¦Z­Þ²e !Ä`0¨Tª²²²ýû÷÷¤‡çÏŸOLL4/LJJúþûïéÇ•••3fÌxõÕWƒƒƒW®\yåÊ•ž4à•œy¤”ÐÛuãw•*%%%$$äÈ‘#éééÕÕÕo¿ývdd$ýRssóçŸþÚk¯*•Ê_|1;;;,,lèСß|ó !ä£>š2eJPPPkkë{ï½·sçN±X, ׯ_ÿÁB(ŠÚ¸q£¯¯¯@ 0oT¯×Ë~óñÇ[öªÃ >>>AAAæËôëׯ®®Ž~,“ÉÒÒÒþóŸÿœ:uJ(>þøããÆ;vì˜#F :…ßRôÅÅÅ|>øðáÆ óóó3I­Vóx¼ÒO‡ RSSCùÃþpøðáÇüðáË/&„ÔÖÖ¶µµ >œ^’¢(:‡r¹Ü²Q@ ÑhlôªÃ&“©¡¡Á<«¬­­U(Þ<|øð°°°‹/2 '€wÀ?çCÔA·Ùs–’Ç›€.9}útAAAŸ>}bccÇ÷æ›o2™˜R©loo¯®®¦ŸÞ¸qƒ¾Nbbâ_|ñ믿þøã³fÍ"„( __ߪª*F£Ñh´Zmmm­;)‘HÆGÏ|2>üÈ#Ð)ŠÊÏÏ_²dÉ AƒÞ}÷ÝÔÔÔêêêÊ€ÓàÂW€^$<<|ûöí7nÜx饗 †úïÿ›" gΜ¹fÍšÖÖÖºººÍ›7Ï›72dÈ#F,Y²dúô鉄^2))iåÊ•Z­–R]]m÷‹N_yå•uëÖ9rÄh4¶¶¶îÚµëÈ‘#ëׯ§_ýÝï~—ššzß}÷]¹r%77711±Ã¥¶àLöI)mü··žü8pŸøøø>øàÆ'N¤ ÷îÝÛÒÒ2`À€ˆˆˆñãǯ[·Ž.OJJ:vìXRRóö={öðùü°°0±Xüüüêêê~þùgúégŸ}¦T*]Û%ÚñãÇgÏžýç?ÿ¹¡¡¡ºº:&&&**ª²²ÒÆ[N§Óétuuu<ðÀâÅ‹»ÔbVVÖ¼yóÌk‹ÍÎÎî^ÿ<Å«û³”nM¥Rùûû¿ùæ›J¥244ôÌ™3tyKKKZZšB¡Ëå©©©z½ž’••5þ|BˆÉd‹Å7n$„TTTÈåòööv—œœ|àÀº†ýû÷›gb¬îÙ³'44400pÀ€¯¿þ:kÉ¿þõ¯Áƒ …ÂI“&•••1ÖÖÖΘ1C$EDDdddÐÓ¡¬­¬^½zÛ¶msçÎåóùË—/Ÿ;wîË/¿lmÝÍ ‚E‹ѳ”ôò̸1°–}ÎËË›2eŠy=111¹¹¹=ÚTöƒ£yð H)ݾTÀ`0Ô××ß¾}ûÙgŸ]½z5]˜žž®ÑhÊËËoÞ¼©V«·lÙB‰ŠŠ*(( „\ºtI©TÒ &OžÜ§OBÈ¢E‹²³³M&SUUÕ… fΜɴbYa}}}zzú‘#GZZZJJJ¦M›fYB »xñ¢F£‰ˆˆX±bSaJJŠB¡P«Õ§OŸ>tèµVÏŸ?Ÿ˜˜h¾ÊIIIßÿ½µu7w÷î݃>ôÐCÖFϲϦ²²2<<Ü|±ˆˆˆ+W®te³!„Û¬7@ïÁýsOPï„NÙ=H®_¿Nill¤(ê§Ÿ~’ËåEµ´´øúúVWWÓËœ={ö¾ûî£+•ʲ²²üã/½ôRHHˆ^¯OKK{å•W®_¿.(ŠŠ‰‰ùꫯ¶mÛ–žž~ýúu¡Ph­ÂÆÆFÿƒ655Ñå–%æ.\¸Ð¿ú±N§ëÓ§SáÑ£G…B!k+ååå|>¿CUÅÅÅ2™ŒuÝ™1‘J¥R©ÔÇǧÿþ¿üò ]N¯#ý˜^5Ë>ÿúë¯>>>–-ŠD¢N7€§ÃØf)Ü@ ‹Å„€€ƒÁ@©­­mkk>|¸L&“ÉdÓ¦MÓjµô“'O.(((((ˆ‰‰;vìùóç ¢¢¢˜Ú/^|àÀ˜_õÊZ¡X,þøãß}÷ÝAƒMž<ùÇ´,!„ìÛ·/<<\"‘L™2¥¹¹™®P­V÷éÓçž{†„„Xk%((Èd2u¸5Nmm­B¡`]wfL4F£Ñét .4ŸíÀ²ÏR©Ôd2µ¶¶š/ÖÔÔ$“ɺºi)% k÷ׯ=µÀM( __ߪª*:­ÒjµµµµôKQQQ'Ož<þü„ ¢¢¢>ýôÓ_ýuìØ±Ì{çΛ——'Ì ­Uÿí·ßÖÕÕÍž={Ñ¢E–%&--íßÿþ·V«=qâõÛ̆R©loo¿}û6ý”¾×k+‰dܸq|ðù >|ø‘Gá2þþþO?ýôþóBˆŸŸŸÑhloo'„¨Õjf™}–ÉdÁÁÁ¥¥¥æõ”””Œ5ŠÛðÀ9*¥Ä7x1œt— …III+W®¤''«««;F¿õá‡Þ{ï½ ::zÏž=&LðóócÞ+‰¾ûî»÷ß¿Ó oݺõõ×_ß½{—Ïç‹Åâööv˃Á`2™‚‚‚ ÃÎ;Í+LHHX³fMkkk}}ýöíÛmtû•W^Y·nÝ‘#GŒFckkë®]»Ž9²~ýz.Ca0²³³ÃÂÂ!ƒ ‰DŸ~ú©Á`xë­·è,ûL‰?yò¤y=ùùùqqq]Ü€YJ€ÿÕÕkÇ]Ý_è½öìÙÃçóÃÂÂÄbñÔ©S‹ŠŠèò|¢(ú?.Òͯz¥M˜0aĈVh2™^~ùå~ýú‰D¢ÌÌ̃Z–ôë×oݺu‘‘‘Æ {àÌ+ÌÊʪ©©Q*•?ü0}7WkÝž:uêǼk×.¹\>pàÀãÇÐ×ÊZ£×ëéÿK©P(._¾|ðàABˆÏo¼‘’’I/iÙgBHjj*sÇ º¶¼¼¼ ty3¸%gžÝæ9蘘ÇãQEÿuDýn»;`Ðßâ\âû’^ //oÅŠÅÅÅ®îÈ%$$¬ZµŠÎ½322ÊËËwìØáêN8öQ½„3LRº;Œ!€GÀG8\c\½zµOŸ>#FŒ¨ªªš3gδiÓ¶nÝêêNyìR€;óÉ(ûîy¼~åÝœ¹Á…¯à 3gΉD£G3f̆ \Ý#/‡ßóƒK`–ÒÝa <>ªÀÀ ôv)ÀíÒ2°ê%œ¹á;§`…ù`…À»` ™!8RJ/‡“à8ŽJ)q"¼ ®AÁ¾,áK¸ã˜+2…Üì³”Þ ç&z-gnzǦ”bè%°»÷o%p&ÌR¸äÐ=ˆp ¤”î»°ÇŠàr}\ÝðTH) ›R8UBBB~~>!$##cíÚµ®îN8*¥Ä¼/ƒ*°R©T</55•y*‰Ì_‰DB¡022òÊ•+¶—g•››;qâD±X,•J§L™òõ×_Û¿¿ÖʼuÎ;WWWMY¼xqvvvCCƒ£ûæ8˜¥€ñññùä“Onß¾mù’@ ÐétÓ¦M[ºti§Ëwðå—_>ûì³›6mÒh4õõõëׯ§'÷8bma4¹WÕ)îµeeeÍ›7éalllvv¶{Bœ;Ç”Àpiôf|>?99y×®]ÖðññIJJ*))á¸]¯×‹D"‘HTQQaÙ:=‘¸{÷îäädBHCCCbb¢T*U(Ë—/7ô2™™™¡¡¡‰dÙ²emmm¬-v¨­CëÛ¶m[´h³.±±±ûöí#„äååM™2…)‰‰ÉÍÍíÒ€3xVX{©{­Ø†”ÒÝá8 ·Á·?x¢+VìÝ»·©©‰õU£Ñ˜““3lØ0ŽËÓ´ZmaaáŒ3X_MOO×h4ååå7oÞT«Õ[¶l!„=z”ž™Ôét¡¡¡¬­ •JUVV¶ÿ~BHJJН¯ï­[·Š‹‹Ïœ9³}ûvz™S§N•––þòË/………tËÚ¢ymZ_°`ÁgŸ}v÷î]BHMMÍéÓ§çÌ™£Ñh*++ÃÃÙ‰ˆˆpÂE¹Žƒ”z*$$dÆŒÊõz½L&S(§NÊÊÊêtyswîÜáóù‰„~LÏ%BZ[[ß{ï½;wŠÅb¡P¸~ýú>øÀ²ÖÖ)ŠÚ¸q£¯¯¯@ hnnþüóÏ_{íµÀÀ@¥Rùâ‹/Ò× RµcÇŽ€€¥R¹iÓ¦œœk-š×Ö¡õÁƒ=ú‹/¾ „>|8..N*•jµZŸ€€f1±X¬Ñh8²=©ß6¾ãª€ÞãùçŸï0©(¬åK¬Ë›“ËåF£±±±‘Î*oÞ¼©R©ÆŒC©­­mkk>|8½$EQ–µÖ\.§«Õj7pà@úé!Cjjj!|>Ÿ)>þäÉ“Ì2ùùùqqq;솕RâŸøô6ÑÑÑæ÷àéùò ûöíÛ¼y³L&ëÛ·ï[o½ÅÌjîÙ³‡Ï燅…‰Åâ©S§B‚‚‚ž{î¹ððp™LÆÜñÕ¶½{÷¶´´ 0 ""büøñëÖ­#„øùùMš4)<<|èС÷ßÿš5k¬µh޵õ… -X°€Y,55õСCôc½^Ÿ——gþªÇá!÷ss<¶‘[À†Û!À ¯zâÜ—„Þ»p죸P©T#GޤïÔÚs.\˜5kVEEEŸ>ÿÏKHHXµjUtttFFFyy9óŸQºÊ6(vXî_*n8r‡owðtøÒÇÁ>Š û¦”Ï>û쀶mÛf—Ú:p‡ ŠßRº»Þù1èÍðí½Suuµè 0ÀÕê‘úúúÀÀÀ¿þõ¯\–ç™qtßìçÀ8Á càÈNXƒ}”;cÍ$mowØ ø¿”nŠÉ3Ý6½GJ `žuÍ€5Ø›¹·Í-‘Rx wË-•Râ‡gàeÏÀvàM°Os&ŽsÂî¶Q0K `8å¶GH)Ü”Ûf’ ü_Jw‡ŸDxìÏ;D P¿quG:‡YJ×óˆÒf) ›Rp‚k,!¥€nrTJé¡×w˜¥°œG€Þ )%tRJw‡©ï€ý9p‡hðn ùùù„ŒŒŒµk׺º;=…”ºI¥Rñx¼ÔÔTæ©H$2I$ …ÂÈÈÈ+W®Ø^žUnnîĉÅb±T*2eÊ×_m»3þþþ6Zw(óÖm8wî\]]]tt4!dñâÅÙÙÙ Žî›C!¥€îóññùä“Onß¾mù’@ ÐétÓ¦M[ºti§Ëwðå—_>ûì³›6mÒh4õõõëׯ§'÷8bma4¹WÕ)îµeeeÍ›7éalllvv¶{â|H)8Á5H¬ø|~rrò®]»¬-àãã“””TRRÂqyƆ ^ýõ¸¸8>Ÿÿè£îرƒ~©¥¥%--M¡PÈåòÔÔT½^O™>}º^¯‰D"‘¨¢¢Â²uz"q÷îÝ!!!ÉÉÉ„†††ÄÄD©TªP(–/_n4ée233CCC%ɲeËÚÚÚX[ìP[‡Ö·mÛ¶hÑ"f]bcc÷íÛGÉËË›2e S“››Û¥w7H) GV¬X±wïÞ¦¦&ÖWFcNNΰaÃ8.OÓjµ………3fÌ`}5==]£Ñ”——ß¼yS­VoÙ²…rôèQCi IDATzfR§Ó…††²¶n0T*UYYÙþýû !)))¾¾¾·nÝ*..>sæÌöíÛéeN:UZZúË/¿Òy,k‹æµuh}Á‚Ÿ}öÙÝ»w !555§OŸž3gŽF£©¬¬ gV$"" å:”£RJç šÀ­„„„̘1###£C¹^¯—Éd …âÔ©SYYY.oîÎ;|>_"‘ÐOƒƒƒé¹DBHkkë{ï½·sçN±X, ׯ_ÿÁXÖÀÚ:EQ7nôõõÍÍÍŸþùk¯½¨T*_|ñEúTŠ¢vìØ T*7mÚ”““c­EóÚ:´>xðàÑ£GñÅ„ÇÇÅÅI¥R­VëããÀ,&‹5 §QvW|WwÀðx<\ ½ÙóÏ?ßaRQ XË—X—7'—ËFccc#UÞ¼yS¥R3†R[[ÛÖÖ6|øpzIŠ¢,3:k­ ¹\N?V«Õ<oàÀôÓ!C†ÔÔÔBø|>S8xðàÛ·o[kѼ6K .ÌÉÉyê©§rrrV¯^M‘J¥&“©µµ•É*›ššd2™µ<.|€ž9rä<ÀýN3./•JxàÖ[¼* __ߪª*F£Ñh´Zmmm-éú•’J¥²½½½ººš~zãÆþýûBŒF#SXQQÑ¿k-š³lý©§ž:vìØÅ‹¯]»F'Ï2™,88¸´´”Y¦¤¤dÔ¨Q]ê¶»AJéîp 1€wÀþ¸C´€‡ZµjÕÛo¿mÇå·nݺbÅŠo¾ùÆd2µ··_ºt‰. …III+W®Ôjµ„êêêcÇŽBär¹Á` g¹ …3gÎ\³fMkkk]]ÝæÍ›é{±òx¼uëÖµ¶¶Ö××oÙ²eþüùÖZ4gÙº\.ä‘Gž~úé9sæ0ó¨ñññ'Ožd–ÉÏÏ‹‹ãØa÷„”ì ::Úü<=_>!!aß¾}›7o–Éd}ûö}ë­·˜YÍ={öðùü°°0±X}þ;™—°jÕªèè茌Œòòræ?£tƒ;lP¤”î#é&°!À6Dt AÜ!ZÀq‘0—j{GÜÚ7¥|öÙg °mÛ6»ÔfÉRJ\ø ]Æû]j«®®ý¯Ø¥fW©¯¯ ,,,üë_ÿêê¾8ι;œ§tØ`":… î-à8=ŸÔ²‘C"nÏf)ñ)ì_¢àÝp#b°)%°ëR&Ù LkoÁòÝ[Þ%Rº;· è6ìÏ;D ¸&{2Ké)ù˜§/ï*H) \rË®¦:X޾˻ RJàÊ.ó–àMRpâ)g‰œ¹%ÐR@÷á̻˹6«ïã zq®Àëa–ÀðÉÀùlÜ-ÖiG&Žš¥p­„„„üü|úqFFÆÚµk]Û¯„”ÒÝábï€ý9p‡hé•JåïïÏ<=wî\]]]tt4ýtñâÅÙÙÙ .ê€×BJ ^(++kÞ¼yÌS@›íÂ.x%¤”àèiÆÌÌÌÐÐP‰D²lÙ²¶¶6BHCCCbb¢T*U(Ë—/7ôò{öì 0`À믿>}út½^/‰D"QEEE^^Þ”)SÌ뉉ÉÍÍuþzx7¤”œà$'0 §N*--ýå—_ wìØAIIIñõõ½uëVqqñ™3g¶oßN©¯¯OOO?räHKKKIIÉ´iÓŽ=*t:N§“H$•••áááæ•GDD\¹rÅ5+à½R€» (jÇŽJ¥rÓ¦M999ÍÍÍŸþùk¯½¨T*_|ñEúâU???__ß’’N'“ÉFe^V«õññ 0/‹ÅÆ©ëÐ 8*¥ÄÍô «ø|þÀéǃ¾}û¶Z­æñxLá!Cjjj!b±øã?~÷Ýw 4yòäüѼ©Tj2™Z[[Í ›ššd2™SÖ Á,%€à<€]ÆêêjúqEEEÿþý•Je{{;SxãÆþýûÓããã¿ýöÛºººÙ³g/Z´ÈüW*2™,88¸´´Ô¼ò’’’“™ÞÊ™G&H)\ƒg…µ—\Ý_gàñxëÖ­kmm­¯¯ß²eËüùó…BáÌ™3׬YÓÚÚZWW·yófú>®·nÝúúë¯ïÞ½ËçóÅbq{{»\.7 ô&!$>>þäÉ“æ•çççÇÅŹ`­¼RJw‡©ï€ý9~~~“&M :tèý÷ß¿fÍBÈÞ½{[ZZ 1~üøuëÖBL&ÓË/¿Ü¯_?‘H”™™yðàÁ   çž{.<<\&“UTT¤¦¦:tˆ©Y¯×çåå-X°Àeëà¥xø†à‚ÇÇ쌞xäòýÂ}I¦R©FŽy÷î]{U˜°jÕªèèhBHFFFyy9} ÙÞ Qv‡£dNR€Ý9âàž¹>Ö¿¶ìžR‚%¤”`w|WwÀ3` üÒÜ&^\£çóE62Iã+ÌR‚Ý9j–W 8—9IÌ[€sàŽ¯v€C7p‚^õßD 'œ¹£Ào)<s —ƒE\/¬pJì³”î{ï€ý9ØõWw³”«Kó–Ž€”Àã!·WAJ À nb ßVàdø-%t“£RJœ!ðz˜¥°œG÷áÌ#¤”ÐM¸=»ÃÔ€wÀþÜî v„YJè&ÌRô¸bì³”œ`ÿ ` )%t“£.|åñx˜ÕïÓÕû`OÞ ³”àýT*Çýæ©§ž¢ ýýým,@9qâDtt´D"‘ËåO>ùäµk×\¶œ9󦾸=@—q™{ÄýÙº„¢¨ºº:¥RiÇ:F#ŸÿßC@ Óél,o¹ÀñãÇçÌ™“™™ùÄO´µµeddDEE?>$$„RSSÓ¿;vÀa–ÒÝá¨À;`nMYYÙ¦M›†ºoß>º¤¡¡!11Q*•*ŠåË—Æ­[·>óÌ3Ì[âââöîÝKiiiIKKS(r¹<55U¯×Ó»wï INNîaßV¯^½mÛ¶¹sçòùü€€€åË—Ï;÷å—_¦_½ï¾ûfÍšõé§Ÿ¶µµõ°!—Ã> º )%¸@KKË;ï¼3uêÔ &¨Õêǯ^½š~)%%Å××÷Ö­[ÅÅÅgΜپ}{RRÒ§Ÿ~j0!õõõ³gÏ&„¤§§k4šòòò›7oªÕê-[¶B ƒJ¥*++Û¿OzØØØxþüùÄÄD󤤤ï¿ÿž~\YY9cÆŒW_}588xåÊ•W®\éIs )%8[JJJHHÈ‘#GÒÓÓ«ÿ¿öî<.ªzüøgØF`@ pÇ%\²´\Ò6Ô2¢›k¨¡eä5»7«ëF‹¹¥f·k™mZ†fqí‘Þo’v1-3(nšh‚²‹ ›óûãüš;w6g>Ì #¾žÁY>ç=Ÿsæ3ç}>ç|NAÁ[o½5tèPeÖÅ‹wíÚµnÝ:??¿°°°eË–%%%õêÕ«G_}õ•âŸÿüçˆ#BBBjkk?þøãõë×øûû?÷ÜsŸ~ú©B§Ó½øâ‹ÞÞÞjµÚp£uuuAعs§iTF ”••yzz†„„.Ó®]»’’åï   9sæ>|ø»ï¾ó÷÷¿ÿþû ”ššêŒ·Å³”€MÄ(;;ÛËË«OŸ>½{÷öññ1œU\\¬R©:uê¤üÛ½{÷ÂÂB!ÄC=´cÇŽûï¿Ç޳fÍB544ôéÓGYR§Ó)9¤Z­6ݨZ­ÖjµV¢2Z ²²²©©©¬¬Ì0«,** 5Z±K—.}úôéÕ«WFF†>á€k½”ÀÕ:ôí·ßzxxŒ7nРA6lÐgbaaa—/_.((PþÍÍÍU†À™2eÊîÝ»ÿý÷£G>ðÀBˆÐÐPooïüü|­V«Õj+**ŠŠŠd``à Aƒ”žO½;vŒ=Zù[§Óyòäõ×_ßR9G¤ÑžÃM Üm¤ÑKéîønã*RTTäééÙŠóI 9hϸ3Ú(H#¥ðÿåää´iÓfÆ aaa]»v=räˆ2½¬¬lÊ”)mÛ¶ ?~cc£bìØ±uuuF£Ñ¤¦¦¶iÓæÌ™3ýû÷W&ÆÆÆ¾üòË3gÎÔ>nܸ>ø e>œ†”ÀÕ××—––^¸páÑG]´h‘2ñ±Çóöö>þ|vvö‘#GV¯^-„Ø»w¯Z­®®®®®®îÚµ«âúë¯ÏÌÌT&nß¾}úôé_|ñ…rglaaá¡C‡&NœØ‚ Î@J à¿t:ݳÏ>ëéé9qâÄãÇ !.^¼¸k×®uëÖùùù………-[¶,))É–¢ºuëvÓM7íÞ½[±cÇŽ{î¹§mÛ¶Î.GJ à¿Ôju@@€Â××·¾¾^Q\\¬R©:uê¤,н{÷ÂÂBK›1cƶmÛ„Û¶m›>}ºsB@KrVJiåå~®"aaa—/_.((PþÍÍÍmß¾½°í;>yòäÔÔÔŒŒŒ_ýuüøñÎ -^JÖøûûÇÄÄ,^¼¸¶¶¶¤¤ä¥—^ŠB×××[ï± =zôÃ?ÛÒ±ÀY¸ñÕÝQ“.fï=H¸6q—$ОÃ7¾Â}ÐFµ2®Ü¡ôR2È'á¼g)¹Èa/+) C¼¸!Nge—±wZ1®&bx Y ³G}²¡ÿƒÜ®çʳPRJ÷Â#|W5ýî#·À5‚”p<+¹¥ ½l¸² |÷¸3Ú(H#¥œÈ4·¤½@kBJ ¸™d«Á®0ÄKD’H)’œ•R2v´zôR€p ¸Wž™R$‘Rà tepg´QFJ DJ DJ DJ 䬔R§Ó9©d€› —- ''§M›6Ò«GGG\yfBJ c†ù^NNŽJ¥mÚ4K»÷Þ{8`8åàÁƒ÷Üsíµ8×Ñ€ûpå™ )åµâÝwß-,, »ýöÛ'Mšäåå%„xûí·½¼¼zõê0räȬ¬,!DHHȼyó"""‚‚‚òòòô% 2¤oß¾FÅš-Á>>>LjˆèÑ£G¿~ý/^lciñññúá…„uuu)))Ó§O·³>8€³†çQ©øÇ>®|@?%%åé§ŸÎÎΖ.¡eEGG/\¸ð®»îB$&&þöÛoÊ€±ÁH C£‡+â ){»8„à<´Q­Œ+w()¥»pv&süøq¾}ûæççOœ81**jåÊ•r¡¶n¤”C£‡+â )RJ¸Ú¨VÆ•;”_[9ÕÊÊÊbbb4ÍM7Ý4`À€çŸ¾¥CàZ§³ÀÒ¬–ŽÌ —Ò]8¶sÌôª'»ÃFôRB®ˆƒ¶ãhëqÔµ2®Ü¡¼—²UaÌI®ä¬”’‹®D&  Eð,å•åää´iÓFzõèèèƒ*'&&.Y²Ä!Q© Ø»¼{WiÝË[š XÇu4à>\yfÒÜ”ÒÒY»½góÒ ó½œœ•J5xð`ýܺººë®»N£Ñ8|»6:vìXII‰òº !ĬY³’’’ÊÊÊš_²£Ö·´º¥u­-ÀŠÖÖKéããSRRòË/¿(ÿ~ñÅaaa-Icc£âÝwßÕOT«ÕãÆKJJrì¶lÉ-­Œ)Çò¶:€æ …í8Zàzu昔ÒÒé»-§òf?^£ÑDFF&&&*ÝŒ555sæÌ ޝ««BŒ;¶®®N£Ñh4š¼¼<•J·eË¥œÍ›7Ïš5K_¬i J'çÆÛµk×½{÷#Gެ_¿¾]»váááiii†!½óÎ;]»v œ;wnCCƒõÒÂÃÃãââ„)))#FŒ0,çî»ïÞ³gÝUlò"®ä¦½”=öXhhhqqñ¡C‡¶oß®L|òÉ'µZío¿ývîܹâââåË— !öîÝ«V«««««««»ví*„˜9sfRRRSSS~~~zzzLLŒ¾X³%Ô×מ?~öìÙS¦L©¬¬<þüã?¾hÑ"ýŠõõõß}÷ÝÉ“'OŸ>™™¹fÍ+¥åääœ9sfóæÍZ­öìÙ³†-22òçŸvv’[pæ¾®Då„—ø]¼x100ðܹs;vBìÛ·ïÁ,..nÛ¶mnn®2ñرcÓ¦M;uêTNNÎ7ÞxéÒ%!„þï#F,\¸033³  à©§ž0`@uuumm­i {öìéÕ«WEEE```VVÖ7ÞX]]íçç—••uçw–––*ÅöêÕ+??¿S§NBˆ¯¾újþüù–J+++ BäææöìÙS¹Vïĉƒ®ªªrAMB;°;¾—²¸¸ØÃÃCIÕ„áááBˆ¢¢¢†††>}ú(u:Z­¶T¬Y³¶lÙ’™™¹mÛ6ýDK%¨ÕêÀÀ@!„ŸŸŸŸŸŸò·rc­ÂËËKÉ'…ݺu»pá‚•Ò”|RѶmÛ¦¦¦ÚÚZ___}QUUUAAAòµnÃo| »|ùò… ”Ïž=+„ õööÎÏÏ×jµZ­¶¢¢¢¨¨HX¨sÒ¤I)))jµúÖ[oÕO´T‚- ”¿óòòÚ·ooKiAAA]ºt9yò¤áÄ'Nôïß߯í€;sÇ”Òßß?::zñâŵµµ¥¥¥«W¯V&N:õ™gž©¨¨B¤¦¦ !‚ƒƒ•‡! KÐh4_ýõ'Ÿ|bT¬Ùl¡R©”x–/_>mÚ4K»÷Þ{8`8åàÁƒ÷ÜsíµàªÀ{h€ûp噉;¦”Bˆwß}·°°0,,ìöÛoŸ4i’———âí·ßöòòêÕ«W@@ÀÈ‘#³²²„!!!óæÍ‹ˆˆ ÊËËÓ—0dȾ}ûk¶[øøø ><""¢Gýúõ[¼x±¥ÅÇÇë‡BÔÕÕ¥¤¤LŸ>ÝÎúwäŽÃóIIIyúé§³³³%ÂsÑÑÑ .¼ë®»„‰‰‰¿ýö›2`¬F…qìÈQ©šÛœ¢Õã í8Zàzu­Œ+w¨›¦”Ç÷ððèÛ·o~~þĉ£¢¢V®\Ùœ8Ý™Œ›`G@¿Ä¸"ØŽ£®ÇQ×ÊRþ÷ÞßÉ“'¯_¿¾M›6Íó*@&ã&ØÃ/1®ˆƒ¶ãhëqÔµ2®Ü¡îõÓ§H•7CÜ[¤”Œ”W£–L)mÉ$--c©÷j_®"®N)éÐ*q¸Wž™¸:¥4ül¶¤—öÖÅÕ¾<Ü×>[´ä¯út‹Ów@«ÇEFØŽ£®ÇQin1<¹%܇•Çbi‰Y>IDATj#n‘Rê‘[ÀUĽRJ=ºƒàn8&S-àjEJ DJ ÀàÀ}¸òÌ„” ‰”W +¶ãhëqÔA)%@)%@’cÞKIG9Z=•JÅ«)#ôR$5·—’~¸f9æÆW8 ·W)®¯÷áÊ3n|HbÄÀ& Ϙ¢— ‰” ‰{ù’è¥HrVJÉË0 Õ£—€ëhÀ}¸òÌ„” ‰”ÒÝÑõ­í9lÇÑ×㨃4RJ€$RJ€$RJÀ&Ü ˜rVJ©ÓéœT2ÀMÐK DJ À­À}¸òÌ„”ÒÝqž Àm©ÈXrè¥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"¥œH«Õ¾öÚk£Fjß¾½¯¯oxxøÈ‘#Ÿ}öÙ]»v]¼x±¥„±•+WªT*•Je4]™¸råʉê*õÍ7ßÄÄÄtèÐÁÛÛÛl­^-Øûr¬Ô›cÛÆÆÆÆäää3fôîÝÛßßßËË+$$¤_¿~3fÌØºukee¥ƒ>Шþàïï_]]mi±„„ý’îsP¹[<®.^-Ðj8p`êÔ©………ú) çÎ;wîÜ7ß|óÚk¯mذáÉ'ŸlÁçùòË/ï¿ÿþË—/·t p;Žm8êÔ)ÉååååååYYYIIIóçÏ_¾|ysb^¹rå /¼ „ÐétW\¸¦¦fçÎqqq¦³t:]RRRs"Á5ήCpz)§8uêÔøñã ÃÂÂ^yå•ÌÌÌÒÒÒÂÂÂü1111::ÚÛÛ»¥cœhÕªU—/_îÖ­Û¡C‡´ZmUUUUUUK…–çØ¶qÛ¶m£G>uêTÛ¶mŸ}öÙÔÔÔüüüŠŠŠ³gÏîÝ»÷™gž¹îºëªªªV¬Xá¼Od$00PññÇ›{àÀ¼¼pYHàlôRN±oß>!ÄC=dxÎd¨cÇŽ½{÷viL€ ÕÔÔ!üýý[:\Á–-[¬<øçplçÎÛÐÐеk×ÿû¿ÿ3Ì' ùûû¯^½:%%E6^»õìÙsذaMMMÛ¶m3šuéÒ¥ääd!ÄŒ3\¸)%à%%%BˆÐÐP{WÌÎÎ~â‰'z÷îíëëëëë{à 7Ì™3ç×_5»p}}ý«¯¾zÓM7©Õjÿ¡C‡&&&^¾|Ùì3VF_°4&½!nâ£>6l˜¿¿¿ŸŸßÀßx㦦&KŸú×_?~ÿþý5··w»víF½víÚ¢¢¢æÔ–ªÎÒò–jïܹsë×¯ŽŽîÚµ«Z­Öh4½{÷ž7o^NNŽÙrêêêÖ®]Û¿e»·ÝvÛû￯Óé®8,ÐåË—ßyçáǪTª—^zI.Ãß|óͶiÓ& àÞ{ïýñÇ•eššš^ýueVÛ¶mÇŸ‘‘aC¥þÏ&”¿_xá•e¢ò8Ù˜1cBBB<==CBBÆŽ»}ûv³]ÁW¬+ì­{ÙX~yyy›6mT*•¥¾²ÆÆÆöíÛ«Tª¿þõ¯®Œ_ñÈ#´oßþá‡Þ·oŸ ž}•n|óÍ7éééBˆµk×^ñ>Ò¨¨(³ÓmlOT*•òôš0ƒÇJ›ùðà s÷¾îÞ½»¢¢"<<|Ĉ–B•hoû]¾|ùrbbâ!CüýýÕjõÍ7ßüü£¡¡Á±Ûõ]¶eE{Üí׳ººzÍš5Æ ñòòòóó»þúëcbbÖ¯_oøÈ€½‡"à::N \2¿ãŽ;ìZkíÚµ^^fnG÷ööþð6l˜éÂ&LX¶l™é\™²bÅ Óíê4jfHʬåË—›—bÚ´iv}j!ÄÒ¥K¥ƒ±ÂÞª³R{]ºt1¹¯¯ï_|a´pyyù AƒLž|xÈ!ʬýë_F›xã7”Y½{÷þðÃÏœ9S^^ž““³cÇŽI“&Fko0VØ[uVj/**jùòåû÷ï?{ö¬V«ÍËËKNN¾å–[„gÏž5\xÒ¤IJ9³gÏþñÇKKK322yä¥Ò¬lW9 Ÿ3gNzzzYYYvvvzzºDú»téâíí½bÅŠÓ§OmÞ¼Ù××W1xðàgžyÆÇÇgÕªUúYmÚ´B 2ÄÆê5‰ç…^¨2 Óéô—¦OŸþÃ?(•«L|ôÑGí­+ì­Kš¿÷ÿùÏ*…å 倌ˆˆpRüÖUWWoݺuìØ±žžžúÓÓ[o½õ7Þ(..nNÉfëM¢m4KiUÆŒ#·º]íIUU•¾k¨ê–iøyxàñGö¨(..6Ì3M+G®½uÔwY)Mi~øa¥aLOO×ߣ;sæÌæÔ¡®ßeë+Jü4¸Û¯§‡‡Ç’%K~úé§²²²âââŸ~ú)11qÔ¨Qiiiú%m<×#¥œBP~Ö®]»èèè¥K—îÝ»×´F§Ó?^ù±_½zµÑ¬úúú»îºK1pà@ýÄcÇŽ)%Ï;×hùÇ{L¿]Ãéöþ(Ú’Îàê†  §—””!&Ožl8ýìÙ³>>>Âò%ð††é`,‘¨:ÕÚ3U[[«< öÜsÏé'>|X)dþüùF˾/Áìv…/¾ø¢-›¶€Q|ðáô—_~Y™îááat]»×‰'lÁl}ÿý÷Êôøøx£å}ôQe–Ñù¥\ Xa¥r,iþÞ¿téRPPbÉ’%FËWWW+Oœ.[¶ÌIñÛ¨  àÕW_½ùæ›õuîí퓜œ,×h¶Þìm-¹îºë„O>ù¤D`퉕Î(=ÃÏûÙgŸ !ÂÃÃ/_¾¬Ì}óÍ7… 0]X.$Ç~—õ¥™6ŒñññʬŒŒ ýÄælïwÙÊŠa¸á¯gHHˆ0—´›eË¡¸G$à,Ç7{kM``à_ÿú×’’Ã…—.]*„ˆˆˆhjj2-êÀʺúÒæÍ›'„ðóóÓjµF ———+W©›ù£hoHúMôìÙS¥§tÐuïÞÝpâ’%K„žžž¿ýö›é&šŒ%U§³3©ÐýñÑn»í6ý”?ÿùÏBFcz9¹²²R?ŒÙ톆†Ú{No€a‘‘‘FÓ³²²®8ëã?¶=³56wî\!„¯¯oyy¹Ñò¥¥¥ÊIؼyóLË‘¨+,UŽ%Íßûº?ÎË»uëfôíп¥0''§9å;ÐþóŸ tîÜYßj…„„Ì;×ð<[Xª7»ÚFK”>ÕçŸÞtVccc•‰úúzý퉽)å¥K—”ÌYß5tèP!Ä«¯¾j¶r¤Û[G}—•éÖFÃ^:`‰ï²•%ÂpÃ_OåÒê‚ ,VÁ•¶´8†çœ¥_¿~‡>räÈ‚ †ªœ. !*++ßxã[n¹ÅpŒ¯¿þZ1zôèšššj}úôQÓ_^ýî»ï„£F2¼Þ¯ 9rdóã·7$½¨¨(Ó¡zõê%„0|¹¹~wß}·¥±›Œ)‡WÝâââ"""4~¤„Õ«W ! ‡aPz)Geøèš" Àúv£¢¢”sŽæ`Èts=zôPþ5j”¥YF»O¡C‡”M(]v†BBB”¨”dÄz X!Q9N*_¹077W©=%¥¼í¶ÛÌ>LåìøÍêß¿ÿ+¯¼’——·oß¾¸¸8FSVV¶iÓ¦aÆEFFîÙ³§™åÛÕ6ZgvT’ýû÷˜X»v­~¶'–¨ÕêÉ“'‹?éÉÉÉ9zô¨§§§rw¥)éû]¶Þ0ºÍùû.›]Q" 7üõ0`€âÝwßýôÓO­Œ„¸3RJÀ¹n»í¶W^y%--­ªª*==}ÕªUÊyyy†ç'NœBlÚ´ÉôL(  ]»vÊbÅÅÅÊ¿ÿþ»ÂÒPûú_¬æ°7$=ÓW± !üüü„µµµ†OŸ>-þø5uR0¦[uO=õÔˆ#¶nÝzêÔ©‹/Í5|½ž²ÝÈÈH³åXk‚þD°9êСƒÑýi½éËô³ŒvŸ„ÜÜ\a¹’ûöí+„ÈËË3e¥¬«'•çwvëÖMüï@ ÅÅÅ{÷îÞ*ÑüøMOg«m~_ˆ‡‡GTTÔ‡~XXX¸fÍå9À_ýõèÑ£6–`m£%J> Õj%6íÀöÄ eŸ&''_ºtiëÖ­BˆQ£F™m›’c¿ËÖF¥kfÀrßeK+J„ᆿž/¿ü²V«:ujXXXLL̺uëìghq¤”€‹xyyÝrË- ÙÙÙÊÅãcÇŽ¥¥¥)sm<»½té’ò‡r^hÚߥ°4Ý.ö†¤g8ȇu•••Bˆ€€çcÊU·uëVex¡¡C‡nÛ¶-;;»¤¤D¹ËîùçŸB¾7EI ,½§Ñúv•„¼™²²¬ÌÒYoжT¾áˆùz–jÀ éÊqRù*•JÉ”>ûì3}GÄŽ;½¼¼¦NêŒøÍžÑÚþ+++?øàƒèèè„„%foooýø%Žb½m´äúë¯Bœ}víÚÕüx0?p?çÑh4ÿøÇ?”10ÒÓÓo»í6!„Z­nllLHHXµj•…TTTXêp°½#BÑØØh:ÑÞ$”——›M!œŒ«.11QyðàA£;²LO¤üýý+++Mûš$¶+€;°¥òíÊy¬pvåH”?cƌիW—••íÙ³Gy‚’iŒ7Îô=-¸söìÙóñÇïÞ½[¿­AƒÅÅÅÅÆÆ6ÿ•’–˜m-:tè?üðý÷ß×××Û{#¥ 7ñÇE„Õ«W/^¼øÌ™3~~~Ê»dZ0¤+²ý»é&K„áž¿žüüóÏkjjŽ=zäÈ‘}ûö»téR—.]-Z”••uìØ±¿üå/ÎË'¦m£%Jz¦Õj“““íÝŠ 7…Ò-yæÌ!ă>h¥Ìe!Yg½a4|èÝM–Ã=ýüüFŽ™°ÿþãÇ+CdéÇãÜ)%ÐôO¤têÔIùCy!uJJŠ7ÌÜqÇBˆÔÔTåÞQCZ­vÿþý¦«(ܘŽ{¡Óéþýï›.ooHÆŒ#„8pà€òˆ F¢ê,©««B˜¾Ìº¤¤$55Õhâí·ß®l×´£²ººÚty‡à”Êß¿¿é~,//W*_©¨æsvåÈ•¯d»wﮪªÚ¶m›" @y‡¡CÊ—ó믿¾øâ‹={ö¼ýöÛ7mÚTZZêïïÿðÃïÛ·/77wÍš5yÀ̦m£%£FRÃ^¼x±½OTJ´'Ê£¤ÂÎû¥ûô飼GTX¸pМœÁzÃhøÝt“€%¸Z~=ûôé£\’0ºà(w(ÎFJ 8ÅìÙ³- ZØÔÔôÜsÏ !<==G­L|â‰'”‡(fÏžmiÀ7몳fÍBÔÔÔ,^¼Øh±… š½˜ª¼<%%¥¼¼Üpú›o¾iöbª½!IøóŸÿìããÓÔÔ4sæL³1ëï)r`0Ug‰rµû«¯¾2ìùÑétO=õ”’RNªªª”ñå =ÿüó–nˆu`îà‘GBÔÔÔ(¯Á0¤¯üÙ³g;d[ή¹òccc===kkkwîÜ©ôUN˜0AÿÞWƯ7dÈÈÈÈ+Vœ9sF¥R9rË–-.\øè£¢¢¢<<|ž`oÛh‰J¥zë­·¼¼¼Îž={ß}÷]¸pÁö$Ú}÷lAAíB|ùå—ÙÙÙÙÙÙJšáÀœÁzèy¬p›€%ÂpÃ_OKw©(WX”W°êIŠ€s9éå$À5N¡œœ½ñÆG-((Ðjµ999IIIú„ž~úiÃU^ýueúÍ7ß¼eË–œœœòòò‚‚‚Ç¿öÚk·ß~{‡ —Ÿ>}º²|\\Ü?þXZZšžž®LÔŸa¸ü—_~©L>|xZZZYYÙ/¿üò·¿ýÍÃÃC«¡Ñ§°7$eaÛ_Þ¥ÓéÖ¯_¯LïׯßG}ôûï¿———Ÿ>}zÇŽ'N4,ÊÞ`¬°·ê,}´„„ezllìñãÇËÊÊÒÒÒ”'åž^£r&L˜ LŒÏÌÌ,++ûé§Ÿ” ªk×®¶oW:ëÊͲÄÒ*3gÎÔW~FF†aå !fÏžÝüM+$*Ç®Ï"]¾Ò9¯¿‡pï޽ΎߖO¹jÕª¼¼<‡”iX²Q½ ûÛF+>úè#%é |úé§¿þúësçÎUTT¦§§oÚ´iøðáJ™«V­2\ÑÞöD¹Yùòž;w®¾¾¾¡¡¡¡¡áŠŸ×öÊq`{+1K™® º«ÿnfdd臚9s¦Ñ* Ø:ë+Jü4¸Û¯§J¥3f̦M›222ŠŠŠÊÊÊÒÓÓŸ|òI³_[EÀõH)§ –©Tª¹sç666­õÎ;ïèy7n¸pee¥Ù×…?øàƒË–-3û#gºü¬Y³–/_nvy{CR&Ú•R*³,L¸téRé`¬¨:³­²²²ÿþ¦å<úè£f?oYY™ò(‘I“&½ôÒKBOOO[¶+€õåfYbi•‹/Ž7Îì¼ï¾ûjjjš¿i…DåXÿ,+W®tHù~ø¡~áŽ;š}ºcã·î‰'žHKKsHQFÌÖ›\ÛhÅ¿ÿýoëï¥Ðh4 /^4ZÑÞöÄl7£éç•N)í ÉÊæ$f)Ó—-[ö§?ýÉtÓwÜqGuuµiiŽ Øº+®hï®t·_OKË!FeZóW<×ãÆWÀ)ŠŠŠ¾üòË Œ1¢sçÎjµÚÛÛûºë®2dÈÓO?‘‘ñÖ[o™æQñññgΜyá…†âéé©Ñhz÷îýÐC}ðÁ?ÿü³áÂß|óͺuëú÷ïïíííëë;hР7&''[ºWmóæÍ6l8p ¯¯¯¯¯ïСC?úè£Í›7›}]¸DHržþùÌÌ̹sçFFFªÕj//¯öíÛ=úÕW_7ož3‚‘¨:Kå|ûí·ûÛßzôèáååpçwnݺõý÷ß7»|ppðáÇ_~ùå¾}û*ÛùdêÔ©7Üpƒ¯¯¯J¥ò÷÷ŒŒœ2eÊ{ï½wîܹU«V™¾‚ÂÞöäóÏ?_ºté€4•6³9\ÐÞZçáᑜœüæ›oÞzë­¾¾¾>>>7ÝtÓßÿþ÷ÔÔT³/@jñ€åÂp·_Ï´´´¥K—Ž3¦K—.>>>>>>:uŠŽŽÞ¶mÛ×_mZó.8{©tÍ~Ïw³råÊ^xA8âE‚p‰'îܹ³ÿþú›šà&´Zmpp°âí·ßž3gNK‡sÕ Þp5â×C/%´°ššeØÀAƒµt,0¦KFy1lD½Àµƒ”\¤ªªÊìè‹/VÆš衇\®àóÏ?Bx{{“ðÛ…z€k‡ñ ¯N’žžþØcÍ™3'**ª[·n ?ÿüó† víÚ%„1b„2(ÜAuuµV«Ý¹s端¾*„˜0aBPPPKu ÞàDJ ®súôé… šN¿å–[¶oßÎ@ î# @ÿw·nÝþþ÷¿·`0Wê ®AÜø .2pàÀ×^{-::º[·nmÚ´ñòòj׮ݘ1cÞyç´´´:´t€ø¾¾¾½{÷^°`Á?üйsç–çªA½Àµ†_’è¥H"¥H"¥H"¥H"¥H"¥H"¥H"¥H"¥H"¥H"¥H"¥H"¥Húσz^e×>IEND®B`‚icedtea-web-1.5.3/plugin/docs/PaxHeaders.24993/OverallArchitecture.png0000644000000000000000000000013212574544466022364 xustar0030 mtime=1441974582.501016048 30 atime=1441974656.416866906 30 ctime=1441974670.094024345 icedtea-web-1.5.3/plugin/docs/OverallArchitecture.png0000664000076400007640000027403012574544466023453 0ustar00jvanekjvanek00000000000000‰PNG  IHDRG<£ä?TsBITÛáOà IDATxœìÝ{@TÕÞðñЍà… E3ÍP3ÃK‚fÇã­TÔN’©:O¦iWíd^’Ô²ójyy*ñšhGSSei¦ž|žRÔQ¼›^Qfæýc½í3ÍÀ°ç†Áïç¯Íš5{]fï=‹ß^³¶ŸÕj€0•uŸáççWÖUˆê® ° €2GT|€ŸŸŸštHT| Q]eC›l=è. !ª ¾„¨.ø¢ºàKˆê€/!ª ¾„¨.ø¢ºàKˆê€/!ª ¾„¨.ø¢ºàKˆê€/!ª ¾„¨.ø¢ºàKˆê€/!ª ¾„¨.ø¢ºàKˆê€/!ª ¾„¨.ø¢ºàKˆê€/!ª \àW<#«qáÂÇBÔ­ô*©v[·nÝÂÂBÇô .Y=“É~ß}÷¥§§× Ùì 2F‘1:<|øð"_ýùçŸ?wãû§8ãÆó÷÷ß½{wYW¾ÍÏjµ–uß ¾¨8e¼…ñ•Kè.”©©©jcÑ¢E"’’’¤R.\hX5.\¸)|XDš6mjd¹_}õU§NFŽ™‘‘¡'Ù¨E?~ü´iÓ²²²zõêUÖuÑÆ¬Àà©®]»nÚ´éØ±c.½+::zÚ´i"²bŠϳÌßß¿iÓ¦‡tEäí·ß‘§Ÿ~Úàr½häÈ‘ò{C÷Õ¥%777--­Y³faaaÁÁÁÍš5;vl^^žmž'NŒ5ªI“&!!!U«VíØ±ãÒ¥Kíöc6›gÍšÕ¼yóàààºu릥¥]½zÕú•X®Ùl^¸paÿþýcccƒ‚‚BCC›5k6~üø"Wh9r¤Åb™7ož«ÕhÓ¦ˆäææz%[‘Š\XÖ1Ñb±¼÷Þ{ª“ëÕ«7f̘¼¼<Ç•s³³³õ,U¬^:wîÜ”)SbbbcbbfÍšåFýmååå­_¿¾I“&­Zµr{':?ÙÄÄD???Ûù×ʉ'L&STT”ZIÙ¥ãD‰MHHøæ›o8àv+p›#ª JÅúõë[´h1kÖ¬k×®õèÑ£wïÞþþþéééóçÏ×òlÞ¼ù®»îš={¶ÉdêÛ·oÇŽ÷îÝ›’’2vìXÛ]=ùä“iiiÇïÑ£G›6mæÎ;pà@OꦧÜ_ýõ‰'žX»vmíÚµûõë׳gÏ›7oN›6­uëÖŽÑÕ.]ºÄÅÅ}ôÑGvÏL+‘ OWªTÉ+Ù<ñÌ3Ï<÷Üs999ÉÉÉíÚµËÈÈøË_þâ˜-<<|èСC‡MII)qŸiii3gÎlÛ¶mbbâ±cÇÒÒÒÔ*·nËÊʲX,Ý»w÷d':?Ù!C†ˆHff¦ÝÛ333­VëÀôïÍÎC=$"«V­ò¤!¸­YèÃ)à]Œ¯\Bw¡R‡åùóç‹|5''G=×kÖ¬Yf³YKß¾}û§Ÿ~ª¶Oœ8n2™æÎ«e8yòd\\œˆlܸQ¥¬[·ND¢¢¢Ž=ªR>¬­‘êF u–{ùòå¹sçæççky,Ë3Ï<#"ƒ r,%==]DV®\Y\éEÖgÒ¤I"’˜˜èj¶›é<ƒ]â–-[D¤FÙÙÙ*åèÑ£QQQN:ùüùóN^U/ÅÇÇ_¼xQ¥¼ñÆ"’P\=õxôÑGEäã?ÖÿÇæëüd/\¸~ãÆ ÛÞsÏ="²cÇ—öfgíÚµ"ÒµkWý ¬6ãÆ€^ £¼‹ñ•Kè.”C΃‰Ï>û¬ˆ¤¦¦:ÙCZZšˆ >Ü.]­Û·o_õç#<""Ó§O·Í3eÊ·£º:Ë-Ò¡C‡D¤N:Ž¥œ?>((¨[·nÅ•n›b±XΜ9óöÛoŠÈòåË]ÍVb3g°KTo'Ožl›G-æëITW‹à[­ÖãÇ‹H```aaaqU-‘мÿý÷úßRbÿ(ŽŸ¬ÕjíÙ³§ˆ|öÙgZÊÁƒEäŽ;îpco¶Ž9""5kÖÔÑà?´“.@¼mÆ "2tèP'yÖ¯_/"ƒ¶KoÛ¶­ˆìܹSý¹k×.yðÁmó$%%½ôÒKîÕMg¹Êž={¶lÙrìØ±k×®Y­Ö‚‚)rÉÔš5köë×/333'''&&¦¸Ò###mÿ œ6mšš‚êF6oÙ±c‡ˆ$''Û&víÚÕÃݪ.UêÖ­+"·nݺ|ùrµjÕÜÛáÉ“'E¤V­ZVLô}²C† ùüóÏ333ûôé£R–,Y"E<ú¥víÚ*CAAAPPçÍÁ톨.ð>51³qãÆNò¨UGíµm*èÙ³gE¤N:¶¯ª¡{t–{õêÕÁƒ¯Y³Æ1Ï­[·Š|ïSO=µdÉ’yóæMž<¹¸ÒSRR‚‚‚L&S•*Uâãã{õêUd[tfó–3gΈH½zõlíúÜ áááÚ¶¿¿¿Úpuéa[ׯ_àú?Ù^½z………­]»öêÕ«¡¡¡òû2»jÉ]W÷f+88Xm\»v¨.Ü@T”¥j®"ùùù•I¹/½ôÒš5kbccßyçŽ;FDDøùù={VͲ,R§Nš4iòÑG©5d‹4{ölmQ`'tfsö;nŸrõêU5V­¥&“IKÔÿÉV®\¹OŸ>üñÚµkSRR~øá‡ììì{ï½·I“&nìÍ– O«"t¶°ETx_ttô¡C‡>\¿~}'y<8a„øøx'»ª]»vnnîéÓ§m§Žž:uÊ“ºé)wÙ²e"²xñâ:h‰§OŸv¾ó‘#G¾ð YYYnWÏëüýýÍf³ÅbÑR~ûí7»<ª“Ož<é­N.%õë×?xðà™3g4h 'ÿµk×Ô†ši«¸ôÉ2äã?ÎÌÌLIIqœ¨ëêÞ4jrtdd$uáSÉY\Ô½{wY¸pa‰yV­Zå|WíÚµ‘­[·Ú&nÞ¼Ùú•XîÅ‹E¤aƶ‰«W¯vþ®¡C‡Í;×íê¹JMö¼|ùrqªW¯."yyyZŠÝÚÁ"Ò¾}{Ù¸q£mâ—_~éÅzzÅÝwß-"ê‘eŽ´Õ34‡‘ÚµkÛO]úd“’’¢¢¢¾øâ‹K—.-]ºÔd2©'˹·7Íþýûµæn ª ¼oôèÑaaa‹/ž9s¦í,ѽ{÷._¾\ËS¥J•7ß|SÍvÔdee­\¹Rýùä“OŠHzzºZWDŽ9’žžîIÝô”Û´iSY°`–aË–-o¿ý¶óרQã‘G12Ú¢E Y»vmqZ·n-"Z 9??ÿÕW_µË3|øp™1c†0ÍÉÉ™1cFiTØ;w‘ï¾û®ÈW[µjµtéRÛãíý÷߇Ǿ¹ôÉ 0   àÅ_h·Ü°{ljjB—.]œgŠãç» ©S 9qÊx ã+—Ð](?RSSÕÆ¢E‹ä÷‡z©»™¹ëׯ0`À•+W6lئMÿììì}ûöM˜0aâĉ*ÏÆû÷ŸÛºuëJ•*åååíÝ»÷Ê•+ãÆ›:uªÊ6lذ „……%%%Y­ÖM›6µlÙrÇŽâô¼P'Îùóç¨ÕSîŠ+ú÷ï/"mÛ¶½óÎ;;öí·ß>|Þ¼y¶å:–òÕW_uêÔImÛ¦;©ÎjiÉ’%ƒèÙ³§z:™Ý±fÍšÞ½{‹HË–-4h°sçÎÞ½{øá‡v¥Œ1bþüù!!!III›6mêØ±ãºuëä¬jE‚¡C‡j¯jEÙ W›æèäÉ“ÑÑÑ7.rº®ÚTTT»víªT©òïÿûÀ¡¡¡ßÿ½íj:?YÍÎ;Õ\fY°`ÖîíMIHHسgÏþýû/ØùÏxÀ @uò”u-*ÆW.¡»P~8 78f>vìØsÏ=×´iÓJ•*5mÚ4--íøñã¶yNœ81f̘»îº+444  nݺݻwŸ>}z^^ž–§°°pÆŒñññ•*UªS§ÎèÑ£µy»%VõüùóE¾ª§Üµk×Þÿý!!!¡¡¡ sçÎÕ~ãï¼5Ó.Ýy}\ÍfkÞ¼yqqqþþþÅõɼyó7nP¯^½×^{­°°Ð±³ÙCÕÇjµž={vÛ¶m7nÜhӦ͖-[ÂÂÂ\Êf÷AxòX ÷ù£G[·n=zôhݺuí^*,,2dȲeË‚‚‚###?þÝwß–v=/]ºÔ¨Q£øøxõlb|åº @i[µjÕG}´oß¾3gÎÆÅÅ 0`ôèÑÁÁÁe]5ÿŸ6 ª èÅ0·'ÏŸQë =!Ecj¨JñóóëÖ­Û_|á¤tÇ”ãÇ''':tèå—_~ë­·\Êæ¤ c˜Ífõ$íqÆP9rdFF†ã«ãÆ{ûí·;tè°|ùò:uê¨ÄÓ§OO˜0Á€éºãÇŸ6mZVVV¯^½J», Âc|åº Õ\Æ0·'¢º¶¥$%%mÙ²åÈ‘#5*®ô"ë³zõê¾}ûÆÅÅúè£7Þx# À…ïPž®T©’W²yâ™gžÉÈÈ INN ÌÈÈØ³gc¶ððð¡C‡ŠHAAAff¦ó}¦¥¥mÚ´©K—.111[·nMKK‹ˆˆPowOVV–ÅbéÞ½{‘¯nÛ¶MD|ðA·÷﹇zh÷îÝ«V­zå•Wʰn_VúpÊàö¤ŽüóçÏùjNNŽz®×¬Y³Ìf³–¾}ûöO?ýTmŸ8q"<<Üd2Í;WËpòäɸ¸8Ù¸q£JY·nˆDEE=zT¥>|X[mÀê,÷òåËsçÎÍÏÏ×òX,–gžyFD äXJzzºˆ¬\¹²¸Ò‹¬Ï¤I“D$11ÑÕl%6Óy»Ä-[¶ˆH5²³³UÊÑ£G£¢¢œtòùó缪^Š¿xñ¢Jyã7D$!!¡¸zêñ裊ÈÇ\䫵jÕ‘èß¡óV¸šÍjµ®]»VDºvíª¿ŠÄøÊ%tÐÆ¬Àpߌ3®\¹’ššúÜsÏ™LÿùNéСàAƒ´<¿ýöÛ°aÃFŒ¡e¨[·îäÉ“EdΜ9*åÃ?‘±cÇÆÄĨ”Æ¿ð žÔMO¹aaa#FŒ¨R¥Š–ÇÏÏïù矑ýë_Ž»:thPPP‘ðrdµZÏž=;}útë5j”'Ù<§ž$ö /4iÒD¥ÄÄÄxÒÉÊk¯½¡¶Ÿxâ Ù·oŸÙlv{‡ÿû¿ÿ+"Z%í\ºtIDÂÃÃÝÞ¿çš5k&"ûöí+Ã:¸±À}6l翵_¿~½ˆ <Ø.½mÛ¶"²sçNõç®]»ÄágõIII/½ô’{uÓY®²gÏž-[¶;vìÚµkV«µ  @DŠ\Z·fÍšýúõËÌÌÌÉÉÑÐŽÔCÞ4Ó¦MSSPÝÈæ-jE‹äädÛÄ®]»z¸[Õ¥JݺuEäÖ­[—/_®V­š{;|ØÉ\ÝèèèƒN˜0!>>ÞÉ®j×®››{úôi»i¤žÔMO¹Ë–-‘Å‹wèÐAK<}ú´ó9ò…^ÈÊÊr»z^çïïo6›-‹–òÛo¿ÙåQ|òäIour)©_¿þÁƒÏœ9Ó AÇW¿úê«-[¶ôêÕËøº)gΜ‘ÈÈH–_P&xZÀ}Ý»w—bµË³jÕ*ç»j×®ˆlݺÕ6qóæÍÖ­Är/^¼(" 6´M\½zµów©g¦©‡CÍ ½|ùrqªW¯."yyyZŠÝÚÁ"Ò¾}{Ù¸q£mâ—_~éÅzzÅÝwß-",òÕÔÔT“É´hÑ¢_~ùÅØzýÇþýûå÷z€ñˆêÜ7zôè°°°Å‹Ïœ9Óv–èÞ½{—/_®å©R¥Ê›o¾©fÅj ²²²V®\©þ|òÉ'E$===77W¥9r$==Ý“ºé)WýŠÁ‚Z†-[¶¼ýöÛÎw^£FGyÄÈxh‹-DdíÚµÅehݺµˆhæüüüW_}Õ.ÏðáÃEdÆŒZÀ4''gÆŒ¥QaOtîÜYD¾ûî»"_mܸñ¨Q£.]ºÔ»wo5gV9wîÜ_ÿúWcj¨êÖ¥KcŠ;<- ЋÇSà¶’ššª6-Z$¿?ÔK¥ØÍÌ]¿~ý€®\¹Ò°aÃ6mÚøûûgggïÛ·o„ 'NTy6nÜØ¿ÿüüüØØØÖ­[WªT)//oïÞ½W®\7nÜÔ©SU¶aÆ-X° ,,,))ÉjµnÚ´©eË–;vì·ž–¦³Ü+Vôïß_DÚ¶m{çw;vìÛo¿>|ø¼y󤘧¥©”¯¾úªS§NjÛñii%>+ÌÕGŠ-Y²dðàÁ={ö ‡bÍš5½{÷‘–-[6hÐ`çν{÷þðÃíJ1bÄüùóCBB’’’6mÚÔ±cÇuëÖÉ;Y; 233EdèСګZÑ¥ô´´“'OFGG7nܸ¸éº7oÞ8pàêÕ«ƒƒƒ###óòòvîÜyóæM7žùæj6IHHسgÏþýû¯ï DŒ¯\Bwm<@TЋa4n+Nž]æxäææÎœ9sÆ ¹¹¹f³966¶Giii¶‹¢æåå½ûî»_|ñENNNAAATTT‹-’’’ T¯^=•Çl6¿÷Þ{óæÍ;räH5 ôÜsÏ©µÜ‹êê,÷óÏ?Ÿ2eÊ¿ÿýo“É?räȾ}ûÚE÷Š,%>>>;;[ ‰êŠÈüùó§OŸ~äȳÙ\dŸÌŸ?Ú´iÇŽ«U«Ö°aÃ&L˜`WŠÅbyï½÷222Ž=9hР¿ýío111UªTÉÏÏ·«^qœw‹çQ]éÕ«×Úµk÷îÝ{Ï=÷W‡¥K—Ο?Ïž=—/_®V­Z«V­ 0räH· Õé矾óÎ;;tè°}ûöÒ. ¨ð_¹„îDu—1ŒP!mß¾=11±M›6»ví*ëºü‡ªÕˆ#Œ\¼X§±cǦ§§¯^½ZMŽà ÆW.¡»€6`]]n#?þøãõë×µ? &Mš$"jŠòãxøá‡/^|êÔ©²®Ë\ºtiîܹíÚµ#¤   1WЋÉ*€”””¬¬¬„„„èèè‚‚‚o¾ùæÌ™3í۷ߺu«¶tr9qøðá-Z<öØcóçÏ/ëºüÇ‹/¾øÎ;ï|÷Ýw e] "`|åº °à2†Ñ*€U«V}ôÑGûöí;sæL```\\Ü€F\ÖUp;b|åº Õ\Æ0À»_¹„ >‰¨.ø¢ºàKˆê€/!ª ¾„¨.ø¢ºàKˆê€/!ª ¾„¨.ø¢ºàKˆê€/!ª ¾„¨.ø¢ºàKˆê€/!ª ¾„¨.ø¢ºàKˆê€/!ª ¾„¨.ø¢ºàKˆê€/!ª ¾„¨.ø¢ºàKˆê€/!ª ¾„¨.ø¢ºàKˆê€/!ª ¾„¨.ø¢ºàKˆê€/!ª ¾„¨.ø¢ºàKˆê€/!ª ¾„¨.ø¢ºàKˆê€/!ª ¾„¨.ø¢ºàKˆê€/!ª ¾„¨.ø¢ºàKˆê€/!ª ¾„¨.ø¢ºàKˆê€/!ª ¾„¨.ò;-] IDATø¢ºàKˆê€/!ª ¾„¨.ø¢ºàKˆê€/!ª ¾„¨.ø¢ºàKˆê€/!ª ¾„¨.ø¢ºàKˆê€/!ª ¾„¨.`??????¶Ùf›m¶Ùf›íн ÕŒÀÿ9 ÂcÀ`?«ÕZÖu|ƒúGŽSÆ“÷”îv#¹„îÚx  ¬kÜ|€ŠÑ€‘X| Q]À}ºöÆmÛ¶‰Èƒ>Xbõ† ¶hÑ¢ÐÐЮ]»úûûoÞ¼ùùçŸß¶mÛÊ•+‹iii›6mêÒ¥KLLÌÖ­[ÓÒÒ"""Të\ʦ³"²~ýú^¾|¹aÆ=zô0™Lû÷ïOOO U.Óv»hÑ")f1ÜRUbcŸy晌ŒŒäääÀÀÀŒŒŒ={ö8îGÏq¢¿Pq¥“Û£CYèÃ)”6u–?^gþóçÏwb^¸p!000<<üƶé÷ÜsˆìرCýyâĉððp“É4wî\-ÏÉ“'ãââDdãÆZb­ZµDäÀΫ´víZ‰ŠŠ:räˆJÉËË‹ŽŽ‘Å‹;66>>þâÅ‹*å7Þ‘„„W³éoENNNXX˜ˆÌš5Ël6kéÛ·oÿôÓOíÚâêÇá„Î]éiì–-[D¤FÙÙÙ*åèÑ£QQQN.ÑNŽ…Z]éd.a|åº hãÆ€^ž £‚zx1ªkµZ{öì)"Ÿ}ö™–rðàA¹ãŽ;´”´´4>|¸Ý{W¬X!"}ûöÕRÔ|ÕS§N9¯R¿~ýDdúô鶉óçÏ‘Î;Û&ªšÛÆR?."……….eÓߊgŸ}VDRSS·Â¶h/Fu‹ä˜ÍycSRRDdòäɶoœ6mš‡QÝ?ý ܶÜí0Fr Ý´ñ+0*¦!C†|þùç™™™}úôQ)K–,‘ÁƒkyÖ¯_o—¢´mÛVDvîÜ©¥Xõý²x×®]â°PCRR’ˆ|ÿý÷ŽùUAJݺuEäÖ­[—/_®V­šþlú[±añYcÁ`:spÞØ;vˆHrr²í[ºvíêaÝJü ôw2€¨.`ñ ^Ô«W¯°°°µk×^½z544TDÔâªC† ÑòäææJñ«åjs}úôq©±#FŒ˜?~HHHRRR@@À¦M›:vì¸nÝ:ùã%Zçq¢³Pq¥“èÇøÊ%tÐÆDu½<F3ô° z:ÒÎ Ù47>räHppðÙ³g«V­êø–¼¼¼wß}÷‹/¾ÈÉÉ)((ˆŠŠjÑ¢ERRÒ AƒêÕ«g·ó¥K—Ο?Ïž=—/_®V­Z«V­ 0räH-ÅbÉÈÈøðÃ8`µZãââüñgŸ}V-h`×XoEu]jEnnîÌ™37lØ››k6›ccc{ôè‘––Ö AÛl‹eöìÙ‹/>xðàÕ«W‹ë^=œ|d¶ÑdµX,ï½÷^FFÆÑ£G### ô·¿ý-&&¦J•*ùùùz ‡ÃIO‹+ ܆Üí0Fr ݈ê.#ª åÓöíÛÛ´i³k×®²® pû"ªkº hãÖÕŒÀJsà-?þøãõë×µ? &Mš$"ýû÷/»J`´`(æêz19ʃ”””¬¬¬„„„èèè‚‚‚o¾ùæÌ™3í۷ߺu«ãº½Ê9ÆW.¡»€6(âq4¼Ž!8x‹zÚÛ¾}ûvîÜ÷ì³ÏŽ=š.P¶í‰¹º€^¬« PÖÕ5ݘ« ŠÁ7¨Øí‰§¥€/!ª ÁÏÏOͨ퉨.øÖÕŒÀJs bc´`$æê€/!ª •æ@ÅÆhÀHDuÀ—°®.`Vš£#1W| Q]À¬4*6F;F"ª ”k¶ÿ ±Í6Û·Ï6N°®.`÷Vš#¾܆ԉ_zËSÚîŸm¶Ùf»¸m7°®nyV*¶ÙfÛ° 2€ÛQ] ¼Ó¾Ëm¿ÔÙf›íŠº­ñ¥¤Tw b ”Pñpñ|”ó ryˆ8³Í6Ûîm{ Q]Àî½üC܆ 8ñµ"ÊO,›m¶Ù.?ÛnG —s\üÙfÛç¶\¹[ø./™üx:yrâñ¨ØÜí0Fr Ý@ájø.ÏÏ_mÌÕŒ@,€Nœø|.0 —\Àwyñü5ykG œóóóã÷zœãBQñð™>Š“€sÌÕŒÀººtâÄà£ø©†K.໼xþÕàvÁÐ@‰¸PT<|¦€âäàQ]À¬« @'N|>Š †K.à»XW¸ŒÕÙ”ˆ EÅÃg ø(N^Î1W0ëêЉ€â§`.¹€ïb]]à2†þJÄ…¢âá3|'/çˆêF`]]:qâðQ\¸À0\rßźºÀe¬Î D\(*>SÀGqòp޹º€XW€Nœø|?5ÃpÉ|—Ï_æêp»°Z­ŒþË«Õ:gΜûî»/<<Üd2DFF¾ÿþûe]/@„ EEÄg ø(N^ÎÕŒàÞ÷1¿¸nCœøÅñ+žÛûLOO/“Þž2eÊ3Ï}ºÚ;v¬ˆL›6ÍdòôæôÎ;=­–[222D$33³GeRÏ•U׉H·nÝÂÂÂÔ¶:à]>}¡@‘ÊçgêäÎÛUMOO;v¬ñ-2eÊ+¯¼RµjÕ!C†4lØÐßß¿°°ÐçîÕÜuêhÙ²å?ü %Š»Ç€“Vܺu«uëÖ?þøãŠ+yäÛ—víÚÕ¾}ûš5kîß¿¿Fn”[zÊçÉ[nY­Ö>ø`Ñ¢E¸|ù²ÉdŠˆˆ˜0aÂýוuÕ€ÒâÇÐÉ“ïT¾”ãZ¤ZqëÖ­€OoNׯ_ÿäÉ“¥Ú!f³Ùßßß6Åjµúûû[­Ö7n•^ѥʀ®ÓË4n_(Ü{cŸ.¦"urzzºÚp¼W7fÌ÷öù裮\¹Òø–6lØðøñãëÖ­óÝ{uÆwÖß¼yóƒ>¨¶=Œê:oÅ®]»î¿ÿþÚµk8p J•**Ñl6'$$üðÃË–-ëß¿¿…–*''¯·ÎëŠteòäÉŽ÷WZ·nÝ­[7ƒkâ¶²ê:™8qâo¼a›â㫇~xýúõï¿ÿþßþö7ÇW³²²úôéÓ¬Y³Ÿ~úIêAAA§OŸŽˆˆP¬Vk£FŽ?.ƶ×óó÷?{°ÐG<Æ¿÷6d±Xþû¿ÿ»]»vU«Võóóó÷÷¯Y³æìٳ˺^:oݺu›”‹ Éùá$"&“éúõ믾újttt@@@ttô›o¾i±XwâÈq‡Ë–-ëÒ¥KµjÕ*UªÔ Aƒ'Ÿ|òرcŽÙf̘!"S§NµZ­Í›7Wÿ—ÚîÓùàÌvo/^|þùçcbbCCCÛ·o¿|ùò"ÛûÙgŸ%''W¯^=00°~ýúÆ ûùçŸÝn…ú»Îl6Ï™3'!!!444$$äî»ïž:uê7Ü+×Iel†»îÌ™3gÏžµÛÛ7ªW¯."ÿû¿ÿ«so°åÞh‡1’K*dwyqP¯^½ÒîŸÂÂB»‹Å¢þ»öîõÍ`tQ”?ýéOZâ­[·<9ÈKlÅèÑ£EdÔ¨QZÊ;ï¼#"}úôq¯Ä2ä­«Áôß©N›6MKq{Ÿj6´çusUtt´ˆ¬[·Îø¢½¥¬ºÎjµ~óÍ7vƒOüïöÉ'ŸˆHbbb‘¯4HD&OžlµÁ~ðÁZ†­[·jéF¶×óóWÛCE¥Çøa´K%ꌸD]ÐÝ~»ÛÞzë-©ZµêÓO?=uêÔéÓ§O™2eÆ Æ×ÄmeÕu%–[VßÐ>42(sò?vïr~8©W{ì±æÍ›Oœ81---44TDÞ}÷]ÛlÓ§OŸ6mšÊ<݆ÝÞÔ¿õë×á…Þzë­?ÿùÏ"¡Eý4[¶l‘‡~øÿø‡ˆ$''ÿýïŸ4iÒ_ÿúWÛB‹+×¶hõ+Qõî[o½•––¦¦}úé§v…¾ôÒK"Ò¨Q£1cÆLž<9%%Åßß¿J•*»vír¯zèì:«Õú—¿üEDš4iòÊ+¯¼þúë-Z´‘îÝ»›Íf7Ê-’ÝÁ ³ëz÷î-"3gδÛÛ²eËD¤]»v.í â¢ç’ Ù]%^Õ¹Wçv+ôÐßuÞ½W'"•+WîÔ©“ŸŸ_vv¶J,2ª«§±:[qõêÕ;î¸Ãßß÷îÝV«õøñãaaaÕªU;uê”{­¨HœŸ‰.áþŠÛŒ¿¿R$/ ¥íêÕ«aaa~~~yyyv/]»vM½”››ký½Qqqq÷ß¿–gذaMš4ñ¡öj´K\Ù.€¯(n|SNJä.k¹RV]Wb¹eõå‹ß”e¥T/5Æ_ÇJƒóÃI½zÿý÷kcúÿùŸÿ‘-ZØå,qBЦM›D¤M›6—/_ÖgÏž-"mÛ¶µË¬~ºU«V­jÕª-\¸ÐIýK,wõêÕ"Ò­[7-eÅŠŽMøê«¯D¤eË–W®\Ñ?úè#iÕª•{­ÐIÏ\*ÕŠ-Z\½zU¥$$$ˆÈâÅ‹Ý+בÝÁ ³ëÖ¬Y#"÷ÜsÝÞÔO§çÏŸïÒÞ*ƒ/ãºd÷º«œw²ž«:÷êÜk…eu¯N•¸jÕ*yê©§T¢ã÷‹ÎÆêoÅæÍ›EäÞ{ï-,,T7ù>üðC7êo #OÞÏDî¯¸Ý =ôw¿…²£.M3f̰KWöN:Ù6J­ù£>ÍëׯW­ZU{Hƒoý¯ªå÷Û(o<ùN-?ßÇ.á.«ÛÊê.k‰å–Õ7–‡å:'>§œ4ÁÈkQéq~8©Wmg÷_¼xQD*Uªd—³ÄФúgoëÖ­¶‰‹åÎ;ï‘üÑ6ýÆjoƒ r^ÿË=sæÌ¦M›þïÿþOKùí·ßD$ À6›º‹c76›Í/¿ü²íàÞ¥Vè¤'ªÛ§Oùä“Ol—.]*"Ý»ww£Ð"Ù :»îÖ­[µk×¶kþ©S§TôD‹’ëÜ[Åãö…½7VŒë’a*d'빪s¯Î½VèT&÷êT‰wÞygHHÈ… kâRcõ¯Þ0|øpéÕ«—ˆ$''»QyÃ8i‘×Ïk=g"÷WÜk…üÊíßBmذ¡Èk‚Z){Þ¼y¶úöÛoEd„ V«533SD¾þúkçiðüüÕöP~¿ÝòÆ“ÏÈÁt‰ßÇÜeu»zèï:¯ÿŠMO¹*ñúõ믿þzƒ 5j”žžî¸C/ö‰ÕfàþÎ;ï4mÚ400°fÍš?þ¸ÝïÝô'V]׳gOQ¿­sô믿Êÿ•ÊÌÌLLL ÷÷÷¯]»vJJÊO?ýä^Ÿèl%Äjµ6hÐ@D<¨eX´hQxx¸úaŽ¢¿OôêÅ)ÕKñ×±Ò ç*畨npp°ˆ,[¶ì³¢hvÑY1ýåΙ3GDªT©2~üø%K–¨âw^dØÔóVè¡çj$"¶·m¬¿GuÝ(´HvÝ¢³ëõ/½úuÇŽvWBW÷V‘|¡¨×%ø×]弓 »ªs¯Î“&xý^mŒ?^D.\hW—«?ªûÁˆHTT”ˆŒ?ÞÊFg‹¼X÷Wn·û+E*î`(·¿…Ú³güq ×·o_Y½zµc£Ô­ýnݺ‰ÈÞ½{´·<Ó•òûí”7ž|§–·ïcî²VÈ»¬ú£ºÎ€ÒèU®ÝøFÅg;wè9NôtÝwß}'"ƒV¾÷Þ{]»v}õÕWÕŸcÆŒ‘Ï>ûLý©þKq>tÓß'úõ2a䵨ôè¹Êyåÿÿ˜˜Çq³ÛÓ_n\\œˆ¬]»VK¹~ýºãÎ6l¨§z®¶B=Wu¿Ä꿎zõê¹Q¨Åb9|øp~~¾–RXX("þþþÚ"B:»NQ·{ì1«ÕúÔSO‰È?þñÛ .í­"qûBáÞ+ÆuÉ0²“ »ªs¯Îí&XKá^mäåå¶lÙÒ®&.5VgP///¯jÕª¹¹¹7PaòÉI‹¼~^v&rÅ“&ð[¨âÄÇÇ‹ˆº,äççW¯^ýæÍ›E6ªmÛ¶"_\{K[‰´þ=89TTê*¦DDDˆÈÍ›7Íf³ó/';»ví‘ÈÈÈcÇŽÙ¦·jÕêðáÃßÿ}óæÍµD5õtOÔªU«V­Z"rõêÕ‹/jëયaÙ¹s§ˆÜwß}¶ï5™Lo½õ–Û­ð¢Ý»w‹H‡lï¿ÿ~ùá‡J£D[΀Òë53Nsï½÷ŠÈ´=ljž®S_ê‡R¾ÿþû§OŸÞ³gÏ„ T‰wÝu—zµ}ûöÛ¶mKNN?~üC=¤Ž.;úûÄ‹‡ziÐFm(i±XL&“c†:ääälذaäÈ‘¶éǯS§Ž¶b²×© ]ºtÑRÔìÜwß}¹¹¹Û·oWá]Åb±ôíÛ÷æÍ›+V¬Pë«”F+Jì:iӦ͉'¾ùæ›Fi‰jJ¬Ý•Y§¾}ûfee-Z´èñÇW)'Ož‘úõëkõÑÙuJÿþýGµfÍšëׯ/_¾¼råÊC† ±ÍàÒÞ*.Ÿ©R§Nœœœ¶mÛÚ^6 0sæLùôÓOÕºÿ"¢Ý¶«^nnî¹sçœW¯¬ZuâĉsçÎÙ^ÕÏ;'¿OzõD½zõ ðÉ'Ÿ¨•¬4¥ÑاŸ~:??Þ¼yÑÑÑsæÌINN~òÉ'wíÚ¥ýQ®TÈ“700Ðl6/[¶¬ÈAˆÆ;ªZµª‡å~ðÁO?ýt•*UÆײeKuÏ@Íè´¥6%ö¼{­ðœóY½â†džÓÙu"÷Àlß¾ýË/¿ìÖ­ÛÎ;³³³[µj¥~XéêÞ\òØc½òÊ+K—.}ýõ×׬YsãÆÔÔÔâº=öØ®]»ì~¾Êã3p»0þ”q¯Dõ.î²Þ†wY®úÚ IDATõÏÕu~”FŸ¨÷Ú®†aµZ¯]»&óÄKm»—ú¤Ä&8W⇈"cç¯÷–Ê•+KñÖûæ›oüüüêÕ«g;•ûçŸŽŠŠŠŠŠ²;žK¬˜¦ÄSU-I¦Múå—_Ú·o""¶GææÍ›E¤Y³fÚÂ&V«5##CD:vìèv+trÞuV«õóÏ?‘»ï¾[;[¯_¿®ÎµþóŸn”8oÞ<iݺµ6íbÒ¤I"b»hµÎ®Ó¨»/o¾ù¦ˆ :ÔîUW÷÷pÑsI…ì.o]ÕÕü})î=ö˜8ûì³EN#Õß ôtÙl~ÿý÷[·nR¹rå{ï½wΜ9Ú¼7\ºtiôèÑ 6 På#GŽØfp©ëkÖVópoƒÛ ÷ÞèÓ×%ãU¤Næ^ÜÞ÷ê»W=qÁ®3]j¬óV¨i¹¯¼òŠÝ»ÔoAxàO¾¡J‰“CËëçµóÞ¥3‘û+>t¥"ýJ}Lêu¯½öšÝ«N$ǘy~þj{(wßî@¹åɉgä`Ú[ßÇÜeõ­»¬:ËÕs”FŸ¨"V­Ze›¸råJINN.±†¶tvúRÏÈÈ0™LsæÌÑòÌ;WD¦Nªåüõ×_ÏŸ?o»·Ë—/Ë×sp©OŒ@yàÞhÇÈ1RP‘ºKŠç˜{un·B'ãïÕ9v¯ÙlVÏ¡µëLýuÒŠuëÖ‰HãÆ×g³X,jŠßìÙ³ÝkK™ðÖÕ€û+r{ß_©H¿…ºxñbPPúååÁƒí^ur ÿï›ç篶‡ 2& `ü0Ú“ÿޏËz»ÝeÕY®ž 4úDѾ}û‚‚•RXX¨žx¦B®ÎkhKg×}ýõ×"Ò¥K??¿¼¼<«ÕzéÒ¥€€5j׿zgee‰È£>j[„zÔžíÜ=—úÄÃañ—(C\ô\Bwð.)žc6î¯¸Ý ø-”‡¿…RO]kÓ¦ãKN$ÿ}+ÚÑîguzÐ8yÜdy(1==]mŒ;VD¦M›¦=s̘1vû¼uë–íc^‹L‘GydÕªU5jÔHJJò÷÷?uêÔþýûÏž=«exýõ×ß|óÍêÕ«2¤N:ÙÙÙ+V¬¸qãÆ¼yó† VdsK±SXX¨-§Ud†çŸþÝwßmܸñã?þ믿~úé§'N\´hÑÎ;“““;wîüòË/«œ£Gž9sfƒ X½zõÝ»wöÙg‘‘‘_}õU“&MÜk…N%vˆ :tñâÅñññýû÷·X,«V­Ú¿ÿO<ñÑG¹W¨žru^ïUDjjê÷ßß§OŸ   Ï?ÿ|×®]wß}÷÷߯AvRC;zºî—_~©Y³f@@@Ë–-wïÞ­;wî¼}ûv³Ùœ““£žà|ëÖ­öíÛïÙ³§K—.:u ÉÉÉY²dÉåË—W®\©ÚwµOtêÎûª”.5Æ_Çøƒ/\—\â^wÑÉ€âäP¤ÿ\Ê$¨ ø"uòÿ^—Š(’c6î²ºÝ Êä.«žrõÞí1™Lÿ½;‹ªúÿ~öÍYÜX4Å ý…Š™Š%–Yn™ù)-sKM-SqOK壢¦†i–("* "»"²ßßçÑýÍw–;Ã0 3ózþÅÜåÜ÷9gÞ8÷Ìšššµk×zyy GGÇ’’É#å¾Ol:'''BÈ7ß|ÃnÙ´i!D(Š\^^þÅ_tíÚµU«VÆÆÆNNN“&Mýª4–‚m¢à[]+40€®Sz PîDŒKM‚F0(É‹¼Ð]ÍÏ_¶¬ÕPTsî”â.+è7,#Õ4P tWóó—-A™‡@Sa.„Ä… @c0äè.毑ª €ŽÇãÑYcY0Pèô)€ŽBò7¬ÕÐåßá,€B‎ÂG 4C.€îRaþbVÀPàO …þAŸè($/pì.€&๺  $>è( \ƒ!@wṺÐdx:È…Bÿ Ot’¸a­.€&๺  $>è(|Ô@c0äè.ÐQH^1+V¬àñx«W¯nf9õõõX­]+W®äñx+V¬Ðv :³ºš Üïcü¦0@H|ÐQ˜}Ðr¯^½ºiÓ¦¬ZµJr/ýº¾¾^óÉ•žžþÞ{ﹸ¸{{ûI“&ýóÏ?ÚJ¶lÙ"÷ß™5kÖôéÓgÓ¦MW®\ÑLT-Š ó—gh€Ò4ÿ!|¬À©5ñ1ª€\(0.5‰rÍ…FÐQH^VMM··wnnnrrr×®]% mUWWgb¢ÐƒF !mÚ´Qmœ’þøã‰'666zyy=~üøØ±cuuu‡ž9s¦º¯®S§Nýßÿþ'÷}›””Ô·o_77·ÔÔT@ ™Øô;8`V@QÍùŠßÇÐ`,¹”(0á¨hdƒÂ‘¼†–×ßÿý²eËBCCÃÃÃ¥ÐÔY]ͨ¨¨èÒ¥ËóçÏ/_¾Ÿ_TT$¶«¦¦ÆÞÞžÇ㥤¤°Ož<9|øp[[[@àêê’-zÖáÇ‹ŠŠfÍšÅNéBúõë·dÉ''§‡²wïÞíëëkaaannîããóÝwßÕÔÔHÖ‚ÇãWWWõÕWnnn|>ßÍÍmíÚµboS¤Ô™3gFeooojjêââüøñcÉØx<^^^û3÷Ãå>ûì3BÈöíÛ[æ£3tÖê( O` @â€AÁ ×$h.0@ÑÑÑ£G0`ÇãhY«ÛÐаmÛ6BHccãçŸN¤ §o½õVTTÔ¶mÛ-Z$ºýäÉ“ýû÷‹‹£[–.]ºuëÖöíÛOŸ>ÝÎÎ...îܹs¶¶¶ýõW÷îÝé1ãÇ¿páBTTÔ¤I“DK«ªª23332úÿë,ƒ‚‚Ž9âéé9uêTccãÓ§O§¤¤Œ=úÂ… ¢‡±55kVRRÒ´iÓÊËËÃÃÃ_½zõÃ?|òÉ'M=L‘ZBV®\¹aÃww÷©S§ÚÙÙݽ{÷äÉ“æææW®\ñõõeÛ²e Û¶›7of·s,Å0`@\\Üï¿ÿ>jÔ(YÇ€¤ÿÿ÷СɣßW­SkâcT¹4tâ?ÿùhÉFFFëÖ­ûüóÏÙYcåtîÜ™"ùˆ^PP úr@=¦Ü/c<: À!ñ@GaàЃrKKK !ŽŽŽš¹Üܹs¿ûGnܸ‘>Ó–®¥ e¡_§öÆoH-¡  €þ`nnþòåËêêjî‰]ZšØ’^ú²¤¤Dê)¢«kY’ï îìEaa!!ÄÁÁAfš¡uëÖDv5õ• 󳺆SÆ  ýƒ>ÐQH^Š®xmæšPÅyxx 80&&æ?þ5jT\\\ZZZÏž=éƒn)>ŸßÐÐpâÄ >Ÿ/Y‚··7ý¡}ûö©©©VVVWäèh±¯JS-kAcPÓûv+} ²áÆïo„Ä…Ù1¨!W TWW×ÔÔÈ}”ªÇÄÄ9rdÔ¨Q’ u !mÛ¶ÍÊÊêׯý>4Yzõê•šššœœìáá!º½±±qçÎï¾û®½½=!ÄÉÉ)77·¨¨ÈÝÝ=Fê^ÕR°mÛ¶ÍÎÎ.**â>L9ìC* jJW…ù‹çê •<-X ( EAŸè($/E?û¯ÉéO›6ÍÒÒòìÙ³¯_¿>yò¤¹¹ùÌ™3E ÏÀýý÷ßÅNÌÉÉ©««c_¾ýöÛ„'NˆvüøñO>ùdÁ‚ô¥¯¯/!䯢ÇÄÆÆ‰§Ùª–‚µ 1ÄÄĈÓØØ8yòä±cǾzõJt;û§Hcc£"1¨õñÅh>ešEí -†BUù.–¶*/V…´ÛàÀMÛ#D“éhØÚ‚æ4hÐ BÈåË—9Ž¡Ã#ý ¿\ì”%Ç1!!!„o¿ý–2gα½7nÜàñxÎÎι¹¹ìÆŒŒ '''''§ÊÊJº¥¾¾¾[·n<ïÌ™3ìa©©©ŽŽŽfff©©©tËùóç !=zô¨ªª¢[^¿~MøðÛo¿)RSÉŠ¦`-®\¹BéÚµkyy9{Øž={!ƒ–l:sssBÈíÛ·%wIŠŽŽ&„ 4H‘ƒÅ¾ñCÁS݇}TR¨JêûT¯@Ÿè($/Õ¯_¿ëׯߺukĈÜGNž}ÚÉÉ)<<\²Ø1cÆœ:ujôèÑ#FŒ066~öìÙƒèš\I·nÝ"ÿ®V%ð0@(¨9¿Sµõû¨.æ—JbÖÅŠUå¦Òå(w"†”&A#Žä5¨¼þã?FŽéçç'öŒQ·6ÙVâ¾ý)٘ݺu{ðà··÷ƒ¤žröìÙ;v$$$¼|ùÒÞÞ~àÀK—.0`€ØaEEE«W¯¾páB^^ž¥¥å Aƒ¾úê+±yÌÆÆÆ°°°ýû÷§¦¦òxpà€Ô6ôóó‹½|ù²Ü){}ÒüüeKÀ¬.€¢0« ¢ 6¿ ¶â-œÖsŽ€æÊ Fƒúúú:äå奥¥‰}íè´´´´®]»:;;gee‰N4ë=ÎêâÛÒ4AôÑ'ŠSÕמ€A‎Rî¯P‚A ¹&&&K–,aæûï¿×v, J›7offñâÅ5¥KTš¿X«  (ÍßUá •ÅÿRS~©5mñ=¦õ'0èÄåtD$/«¦¦ÆÛÛ;777%%…}-è´äää>}ú¸ºº¦¦¦ m‡£c°V@£”[|gP7`€B‎ÂG 4ÆÐ†\@°wïÞ†††ö»Î@wÕ××Ó® 7À)]æ/fu ¦Œ@. ú}  £¼¢Þ|óÍå˗߸qcÍš5ÚŽškÕªU·oßþì³Ï êKÒÔO`PžÀ¢tñ *Ñò#0L:š›:¶¶ ¹O`08†öa=P ýƒ>ÐQH^àfX_3 -Ê-¬ÀB „Ä…e¤ƒ!@w©01« `(ð§?È…Bÿ Ot’¸aV@”û}Œ°‰: €Æ`ÈÐ]*Ì_ÐQH^à†µºš€çꀂø £ðQÁ  »ð\]h2üéra Ð?èS…än˜ÕÐfF3÷`gϞݧOU•–˜˜hbbòâÅ ž C‡U¢Ø’’’E‹uìØÑÔÔT(vïÞ}Ó¦MJ”³`Á‚7nÈ=lûöíîîî –™Ð»wï¦îèçç§àåšjöìÙlãÛÚÚ½|ùRéÒTøná–••5þ|www{{û·ß~;%%E,YÍûÞ{ï%''+}é&½TKc‰ Z˜}Ð ¹ºK…ù‹'0‰Wn¦UªÄÄDooï!C†äççÓ-³gÏ®©©9qâ}ÙªU«¦–YRRâëëÛ¡C‡ˆˆ²²²ëׯ7444©ºº:>Ÿomm­ÈÁqqqÿùÏ,911q„ ²vM:Un ·oß–UBóÅÇÇ¿÷Þ{6l¨¯¯¿råJpp°ƒƒÃÖ­[•+-11100PµJuîܹ3fŒ;öàÁƒ;wÎËË[½zõ€bcc»wïÎ#«Ý,--›sõ&½tæ‹•–ŸŸß®]»›7oöë×OÛ±¨ ýÃݧ˜h ¤æ©Ò2ò …PûŸU (Fó)Óü+*RBYYÇ‹ˆˆ /_¼x±hÑ"777“6mÚ|õÕWt{~~~hhhÛ¶mù|~Ïž=¯^½Ê–ðøñãI“&™››·k×îÀo½õÖœ9sD/ѶmÛåË—‹ná(mûöí½{÷677þþþÉÉÉ Ã¬]»ÖÌ̬²²RV-¤†ýúõk“={öL›6ÍÂÂâÝwߥ[.]ºÄ0LMM ŸÏß¹sçŒ3¬¬¬¬­­—-[Æ0Lcc£Ø„`qq±¬Àh9¦¦¦?ýôÓôéÓ-,,7oÞLwÑË;w޻֥¥¥„C‡q´Ã0;vüâ‹/Ø*×ÕÕyyy­X±‚û,Ú¿{öìaOôõõ6l÷YÜMzáÂÚPß}÷½½ýÿþ÷?î¢ÒÓÓé;ÄÙÙ9""bܸqóçÏçn“¤¤$33³ÿþ÷¿¢½üúõë¶mÛÊmùºº:@É}©Õ{HÃ1 £¶1¡åÿvnùR³fÍêÝ»·ªJ;þ<=dýA5dÈ%Š6mÚ€T¤˜Y³f±áÙØØ©éZÊÙ¶m››››è±˜gÏž]QQ¡¥èt®ä¦ [[ÔÑ\ŠþßꄼÐKªMm±gO`0t ÃøúúBJKKýüü’““<˜™™yìØ±Î;B þóŸÿ466^ºtéÁƒC† ™4iRII !äÙ³g´±±¹yóæ… ~üñÇ?ÿüSôCñyyyùùù}ûöe·p”F©©©ÙºukZZZLLL«V­æÌ™C),,lhhxôè‘Ô*È ;99¹¾¾þ»ï¾›6mÚƒ6lØ@·ÐðRRRêêê¶nÝ:a„»wï®ZµjË–-gΜ!„$%%ñx¼ãÇççç888È ŒrïÞ½ÚÚÚ;w¾óÎ;÷îÝ[°`ÁgŸ}võêUBÈÝ»wÙËqÔ:!!Â6‘¬ ùøøÜ»w­õîÝ»_¼x±råJî³hÿ²=Â0Laa¡³³3÷Y²š”Ö¨OŸ>%%%ãÇ?vìX\\\@@GQ¹¹¹þþþñññçÏŸß±cGLLŒÜ6Y¸p¡··÷š5kD;ÚÌÌÌÏÏ/11QnË?x𠦦FîUdUSô õ-§» êÃzñññtdS ÑO!P#FŒ4hû2**J‰boß¾-:<ªV|||hhh~~þÓ§O÷íÛwöìÙÏ?ÿ\M×RŽä¢xúÙ‚üüüÜÜÜíÛ·;vlõêÕ’'ÖÕÕi*FCdP…P¤OÕôo'ÈÕÌäE^´LJg.ò@-š“2ÚJ7E®»qãÆV­ZÕ××3 3cÆŒ>}úTWW‹3uêÔÙ³g³/ø|>]‚:uêÔ‘#G²»~ùåBHLL »…Γfee)Rš˜“'OZXX0 óàÁBˆ§§ghhèÙ³gØÃd…½k×.+ºÅÙÙ™þN¹qã»·S§Nt¹nLL !¤¤¤DF›ýÿÀ†Ù»w¯‘‘Qbb"}ÙØØØ¾}{º¨6,,¬M›6rk½aáP(Z#©Z½zu‡èÏeee{÷î•ÞÆMLLhãTTT|öÙgÆÆÆ×¯_ç>KV“†……µoßþï¿ÿvvv~ýúµÜDß!‡"„ܾ}›£MRSS !û÷ï—,y„ ݺu£?s´üÁƒmmmévŽ–—UM¹oJª$f¨¸N| Al¾¬ÃÎ¥úÜëôOž<Éžåãã3qâDE¢ÍÌÌ|ûí·…B¡ƒƒÃ† &NœBwÑ»POž’ïÓ§OóùüššŽ69|ø0!äÁƒbW¯¯¯wrrbgÖ8ZþÓO?>|8wËsTSò •Áþ¹¬¿rå !„Nq–””x{{6ìÏ?ÿÌÉɹzõ*HÍÏÏwss NNN~ôèѧŸ~jaaAŸ¸’——×¶mÛ   ”””;wîôêÕËÚÚú‡~`Ëúô)!äĉìŽÒ†ùî»ï®]»–““?bĈž={2 M¹ÿ>[ˆÔÆyûí·E'dwìØÑºukúhY§Ð(,,d¦²²rÛ¶mà?þ-­û{ï½wïÞ½;wîôìÙÓÂÂb×®]ôÄððp;;;6:‰ùÛo¿q—¹uëVWWר¨¨'OžËÅÅeÖ¬Y=ÊÌÌ,//W¤RÜM:sæL{{ûo¾ùFñ¢è<õÍ7ßÐY'Ž6Ù·o!äÑ£GbWÿùçŸ !ÿý·Ü–4h]v-÷Ý+µšboYÔ4&´ü¿Â[~„ŒŽ| c>£ÔR}±uú„öNF¯^½îÝ»§`ÝEmšwì‡æÍ›÷æ›o²{oÞ¼Iyöìw™cÆŒ¡«kEI.Šçøläg/FŽ9yòdö%]DL? DKPêFîKKÆ©I:‘›’t4lmÁ¬.€þA^è%µ¦!fušL/gu !?ÿü3Ã0.\ „äææŠC·Ó…TbΟ?OÉÌ̤/_¼xѦM±ÿíííé̦ÜÒŽ=jllL':†yøð¡©©éöíÛ%|ÿý÷­¬¬è|¬°kkkMMMé,­è–3gÎ0 S__ߪU«yóæ±{ׯ_ß®];úHŸ5kÖ(-gáÂ…ìÁëÖ­sww¯­­¥—;uêw­é^ip·@cc£……ž}û¦M›öÖ[o)í_±uµrÏânÒ¨¨¨7n´jÕêàÁƒr‹úí·ß!ÙÙÙtWEE…‹‹Ëܹs¹Û$))‰"6i•‘‘áèèÈ.ÔåhùÆÆF++«cÇŽq_EV5‰7€,º8««’Âuâÿø‚è:}ŽÃÙKõ¹×éOž<ùÑ£G)))K—.%„°^iRÝÏ;gll\UUE_öíÛ—Þ2¡ÂÂÂZ·n-·èóR|}}7nÜøðáCz®ä¢xŽÏˆ}ö"77W´FÌ¿÷½nß¾­DËŠPêFŽKKÆ©aªÊM ç¸N )-‡rÍÅ}º@»8rPéôD^hfuZ–æä¤¶~­Ê½î¹sç!ôA/^¼°¶¶žÍ0Lyy¹ÝÈ‘#oß¾ýôéÓøøøuëÖ%%%1 SXX(¦Nš‘‘ñÏ?ÿ >ÜÄÄdË–-lù™™™„¨¨(v Gi4˜}ûöeggŸ:uê7Þ ÿ9Ï™3gýúõñññOŸ>½sçÎòåËŒŒ~úé'Z ¬°éwj‰>ü‘n¡3Œ)))„—èè謬¬­[· ú!b†a<==ƒ‚‚rssé÷ÅË Œa˜»wïBÜÝÝéç|·nÝjffFçDà¨5]1JŸÉÈq!jÀ€þþþ@t+ÇYt—ä£ ¸ÏânÒœœ†aNœ8!._¾Ì]TQQ‘@ ˜1cFFFFllì!CLLLvìØÁÝ& ÃÚØØ[ÀH|ö‚Þ1=æÔ©S¦¦¦¯^½R¢ÇeE(u#Ç¥%ãÔ0­ÏêªcÂÄ`V@ÿ(7«‹¼háÔqÃF²ä9€¢ôrVwÕªUÖÖÖôell¬¿¿¿™™™@ èիןþI·'&&¾ùæ›B¡ÐÄÄÄÝÝ}öìÙôé Ã?~ÜÅÅ…~Ký_Wô+wŽ?NÉË˽¨¬Ò.\( ­¬¬ÃÃÃŒŒ^¾|¹eË???###;;»±cÇ^ºtI´@©aGDDØÛÛ‹&ºåСCNNNÑÑÑ]ºt155íÛ·¯èÚ´_ýÕÙÙ™Çãѵ~²cæàÁƒvvvþù§§§§©©iÿþýÙF @V­×­[ÇvÇ…¨ùóçB–.]*Z/޳V­ZeeeÅö¯‚g)ؤ›7o¶²²º{÷.wQ'Ožtuu ˆŒŒý~3Ž÷UmmíÚµk=<<ø|¾ÍðáÃ9"ZŽ–?qâ„……û©vŽ«Èz˽d1Ø?—[~ÅuâS¢ëô9£/¥.Õ—»N_t½ê²eËìííi^È­;»¾þÅ‹ÎÎÎôɶ̿·LØ»/ôA(eŠ>|8_[ÏñÙÉÏ^ÐG³¿\ DûH‰—¡Ô—–ŒSôž›˜ÕÕu4º@»p·@/aV eÑü¯F¦:ˆùôÓOEš©EþþþZùªt­X·n§§§º¯²lÙ²Aƒ©û*Œn>A%Z~„:ñ)Ñuú‡±—\ª/w>]YO]¾|™rãÆ Eê>kÖ¬ÌÌÌëׯ2ÄØØøûï¿§…òx¼Ý»w3 “——7aÂòïWÆq”¹y󿤥¥effîÛ·O(Ò¦“ú©©Ÿ-üìÅË—/fÏž‘‘‘àîîNgZ•èq©Ê ›ãÒ’qjXËÏM©t4lmÁ¬.€þA^è%µ¦!fuš ³ºú„ý6-m©««ËÉÉÙ°aƒ‰‰ û…ïú'66öäÉ“ô) _ý5ûÐ5yõêU||¼³³óÆÕw–.Îꪤð–?°èħD×ésÆ–/¹TŸ{¾­­­hxÕÕÕB¡ý‚AŽºÿúë¯íÛ·¤3­l‹1 ³iÓ&ú䇣G‘/6”Uæ×_íååejj*|}}###Ù ‰.Šçøläg/†‰‹‹óõõåóùNNN!!!………쮦ö¸Ôe…Íqi©qj’ªrSÃ9Þò‡”E¹æâ> ] ]9¨tz"¯´N3ÿÖñØÀÇãz3D³ç6‡¶®ÛÂ1 ccc³k×®™3gj+†‹/Nž<¹GkÖ¬7nœ¶ÂP·S§N}öÙg999fffýû÷_µjÕàÁƒÕw¹eË–íÛ·/ `çÎfff껥‹ù¥’˜u±â-ÐÀÛµkwâÄ mÂåòåË£Fzñâ…¶cùT•›J—£Ü‰RšDŒ.Ð.ŽTn—ܽ Jço“ Ǭ.€¢0« ¢ 6¿ ¶â*Q__ŸŸŸôèѯ¾ú*66¶oß¾ÚŽˆËæÍ›wïÞýøñcm ÑznbVWÔÑ\èíÂݽ¤™Y]#¥‹Å‰.’WÇ£¹ †‰¯ß._¾Ü©S§ÈÈȨ¨¨>¥KINNîÕ«—¶£¡Ü_;  ¹ºK…ù‹µºŠÒü OÞÀQYLð/5å—ZÓO`ÐcZƒN\N×aM€þQÇ‚>ä5€Öiæß:¬ÕÐåßá,€B‎ÂG @ìØ±ÃÕÕµ9%¬_¿¾[·nªŠ§©š¿TÚ­H…!@w©01« `(0e ra Ð?èS1³gÏæýËÖÖ6((èåË—tWBBBïÞ½›Sø‚ nܸ¡øñ/_¾tvvæñxùùù͹.¥`üÛ·owwwg_8pöìÙbÇ<{öÌÊÊjõêÕ¤é•U1ÀäÅÍÃm†Y]MÀsu@AH|ÐQ8û:*>>þ½÷ÞËÏÏÏÍÍݾ}û±cÇèÜ%!$11±™³ºÖÖÖ666ŠÿÕW_Ñ9 ÄÄÄæ\—R0þ¸¸¸ÿüç?ìKŸ»wtéÒÖ­[ñÅ¤é• Ðé!wVÄî¬BJJJ-ZÔ±cGSSS¡Pؽ{÷M›65?Eˆ¶˜d`Ü222>úè£.]º˜››[ZZ<øÀJÓÔÔWˆZ©01« `(0e ra Ð?èSQååå>0`@›6mÚ·o?gΜ޽{ß¹s‡R]]ššJgdy<^vv6{¢ÏºuëèÏ>œ|ØÝÝ]tV·¶¶ÖÔÔt×®]ï¾û.Qýì³ÏäîŸRPPðÁ´k×ÎÔÔ´W¯^þù'!„a++«ãÇ?~œ¾1JJJzöì™––VWWÇpíÚµ_ýuçÎfff¢•’U,!däÈ‘K–,¡?ïÛ·ÇãEDDЗóçÏ?~<÷éô*áááJt«¾Ò×äű;+%%%¾¾¾wïÞˆˆÈÌ̼yóæG}dnnÞüx¸Ñ¬m1±À¸;w®G¹¹¹aaaééé7nÜ3fÌŠ+D“¦jRj-Dg0 ˜æ¤Œ¶Ò i >º˜_*‰Y+`T•›J—£Ü‰RšDlh]påÊBH||<}ÙØØèêê:kÖ,†anÞ¼IÉËËc&<<ÜÎÎŽ=ëõë×&&&¿ýöÃ0999sçνÿ~RR’••Uxx8Ã0qqq„¢¢"†aèÚ·^½z={öÉ“'tF8---³±±±ÿþß~û-Ã0“'Ofwݾ}›Ò©S§£G>yòäûï¿'„œ>}š{—hüùùùnnnÁÁÁÉÉÉ=úôÓO-,,Š‹‹322x<ÞñãÇóóó ØïÞ½K¯^WW×­[·ÀÀ@úR´R²ŠefÚ´iÁÁÁ´^žžžmÛ¶Ý´iÃ0¥¥¥­Zµºzõ*÷éô*;v}:gÎGGG@0lØ0vô“Õ/Rà¨~tt4!$&&†¾ŸO'›bbb!ìÌ Ã0UUUÆÆÆ?ÿü3}¹eËKKK:;,V)ŽbçÍ›7mÚ4†aNŸ>íááñÉ'Ÿ¬X±‚a˜õë×÷éÓGîé»víâñx±±±âfÔ1x¶ä¼ÆÉ;+ .äóùIII’ÍÅq/¤¤¤ÄÛÛ{ذaþùgNNÎÕ«W:ÄÝt¢·Orrr²³³Ù“XppðÀÙ¢Ö­[סC‡×¯_3 3bÄooﺺ:©½üøñã¶mÛ%''§§§;¶C‡µµµý"5Žê3 3zôè!C†Ð7U«V­~þùg©…h fuZÍÿjTaª€Ê©)¿Z~Ú¶ü “Žæ¦Ž†­-˜Õm¾€€' …B¡‘‘‘ÏÅ‹é®qãÆÑŸûöí+ºB-,,¬uëÖ ÃEGG³»NŸ>ÍçóéälHHÈĉéö¹sç:”=ìŸþa'›†),,´³³£³É ÃüöÛo¢{çÏŸïïï/vïÞ½ér6Ž]lü………FFFfffB„+W®0 óã?º¹¹‰5‹··÷òåˆÉË˳´´Ü¾};»‹­w±+V¬3f Ã0~~~ááá«W¯ž7o^mm­³³ó/¿ü"÷ôÑÉ#ƒbhy;+’wVâèÉ8ªÏ0ÌÝ»wŒŒÖ¯_oiiÉ#Yˆ¶¨5 ÙÂMúh6öïI(ôúTT||üÌ™3W¯^mllloooeeÅîJLL7n!¤®®.%%eñâÅ¢gõêÕ‹’””ÔØØØ·o_v×Ý»w»uëfjjJK˜0a[ÚèÑ£ÙÃ\\\éËeË–=þ|èС¢±±§$&&úûû³Û_¾|yÿþ}úX^î]4þ;wî0 sçÎcccÑòéÃCúôé#Ö,ì¦-]º´sçÎü±hT´RÜÅÚÙÙUTTÄÄÄdffíÚµ+55õäÉ“|>Ú´irOOLL3f ÿK/“÷Ö­[ ööö„ׯ_wïÞýüùó$ÿ÷«ÆD$11±uëÖmÛ¶-..>sæÌ¥K—Ø]VVV|>¿{÷îäÿ>Ö6))iРA^^^ôeff&!¤sçÎôeQQÑÊ•+£¢¢hòöîÝ;77·¸¸˜&)M4???ö*ÖÖÖlšËÚÅÆ_TTtêÔ)SSÓS§N±‡ÕÕÕÑGå&&&º¹¹Ñ ¼½½ÓÒÒâãã¯]»vñâÅI“&üïÿã(§¨¨èøñãgÏžb-,«éØàEŸ9+Úb’ùûû¿~ýúîÝ»½{÷^²dÉСC'MšD¡ –EÇ"QOŸ>½|ùòõë×E›ˆý™£_ÄànFBH÷îÝßyç•+W®Y³fÁ‚²j¡ß0«   Êý>Ö³ßß $>è(½œ}=SXX˜››ûæ›o²3;¬ººº{÷î}ùå—„ìììššš®]»Ò]/_¾<{ölhh(!¤¾¾žn±µµ¥?DDDŒ9’-aÕªU„ÚÚZv²•º}û6;—zíÚµÈÈȘ˜Ñ™Ž¡C‡ÒY݆††””:‰LýôÓOöööãÆãØ%?]ågccÓºukÉF¸sçΔ)SÄ6öìÙóǼvíÚ‰'bccÙ‰WÑJqkkk[QQ±iÓ¦…  kkëçÏŸoß¾}Ñ¢E´4ŽÓéU$¿M8èî‹;+Rï¬ðx¼~ýúõë×oùòåÁÁÁû÷ï///ç(çÚµk +‡£éˆ´Û'¢-&˜‡‡‡ƒƒC\\\IIÉùóçïÝ»G·¿~ýš"ëûÜè-¢=zˆn155õöö&œý"w3B’““/\¸ÀçóÙn•Z‹H…ùkÔü"@'ˆ~`@* ú}ÊŠ'„ôïß_r×½{÷jkkéš5+++Ç~lùÝwß-))¡Ó"¾¾¾`ÅŠ?Ž‹‹›8qb~~>ÝEK`®««Y`'êêê>ú装 úûû¿!ÂËË‹~H955õõë×.\¸|ùò“'O¶mÛöÍ7ßìÝ»×ÌÌŒc—hüþþþvvv³gÏNHHÈËË»}ûöúõëïܹC#©®®ÎÈÈxúôiqq1žÏ³gÏBBB>øàƒ~ýú‰5 ­w±vvv™™™ýõ×G}D±¶¶Ž‹‹ËÈȦpœN¯Òò'b4Oÿ’WôÎJ‡D§téä>}K½³B߇ìvWDD=K´zgEtòWê•;"ìíí !ôöIUU{®Ø©»D¯ÎÞÃèüÑ©ç;wîôìÙ“£•†±²²²°°à(§¡¡" ÅÑt4BÑDYV`~~~ׯ__¸pá²eËØûatÆö¯¿þ;˜ÆÃçó !•••tcccã¶mÛ¦NjnnÎÝ/bp7ã£GF½`Á‚/¾øâ믿f/'·yõšñ 4Ÿ2Í¿"Ò@}Ô”_-?m[~„†IGsSGÃÖu4—AuÁªU«¬¬¬%wEDDØÛÛ³/7mÚdccÓ¾}ûñãÇ=z”òèÑ#ºëäÉ“®®®`À€‘‘‘FFF‰‰‰b%DDDˆ~[Ñ«W¯Œ/\¸À0Ìúõëmllž?.@ppp‡†9tè““Sttt—.]LMMûöíË>Æ—c—Xü‰‰‰o¾ù¦P(411qwwŸ={vYYÝõ믿:;;óx}¿nÝ:öËÐ<==ƒ‚‚rss飴çÌ™³~ýúøøø§OŸÞ¹sgùòåFFFô)±å¼xñÂÚÚzòäÉwïÞÍÎÎŽŠŠ¢ßØÆÑt¢ж9m1ÉÀ¨ï¾ûŽÇ㹺º¾zõJ´¹¦M›fii–‘‘‘••=oÞ¼¥K—2 óòåK‡Ù³ggdd$$$¸»»Ó/‘ãèÉ8ªÿôéS77·ùóç3 SQQáàà°jÕ*ŽZh…ZÓ-¼%æ9@Ë„Y]¥‹³º*) @ˤªÜÔpŽcHiåš‹û,tAs¬[·ÎÓÓSµe~ú駢ߥà.Ð]9¨tz¶Ø¼ÆFâÎÊ–-[üüülllŒŒŒìììÆŽ{éÒ%Eʉõ÷÷733½zõúóÏ?¹›Nòö‰Ø©·|èšÈÈH±æª­­Ý¸qc·nÝ©©iÇŽƒ‚‚RRRèÞ¸¸8___>ŸïääRXX(·_¤ µú%%%]»v>}:ûrÛ¶m …ùùù²j¡šù·ŽÇ¾nÍyô‰¶{¤»[hùt1¿T³.VÀ¨*7•.G¹1¤4‰:]Ð$qqqOŸ>õõõ­®®þõ×_7lØpþüù#F¨ðƒîß¿ÿæÍ››´ tG*·Kî^}²~ýúǧ¥¥©°ÌE‹=xð ::ºI»ôUPPPAAAUYU”Îß&ŽoK0†ðÇ=4 ýƒ>U¡gÏž}þùç999fffýû÷ŽŽ¦¼Ð:Íü[‡µºš \>ã×0€B‎Â$€Æ`ÈÐ]*Ì_Ìê üéra Ð?èS…än˜ÕÐh †\Ý¥ÂüŬ.€¡khhˆŒŒìÙ³'»åã?.++ËÊÊzúôiqqñš5k!µµµ111ééé?NNNÞ¸q#ݘ‘‘‘™™yàÀ©'–––~üñÇ‘‘‘UUUiii#FŒà(¿´´´  `îܹŸþ9!$::š]Mìêê*µ(Q]ºtILL,++óôô\¼x±dM¥VAêY¡¡¡ÕÕÕÙÙÙ¥¥¥ .-dË–-{÷î½zõjëÖ­¥žâààP\\|ãÆ_~ù…»UÅÂkYáÕÖÖæççVTTäççðÁìYŠ÷E3ÛDn¥BBBø|~~~~jjjllì† dÕT*ÉH¦OŸ~æÌ™ÚÚZBHiiéõë×äö¾Ü7Ohh¨µµuqqqLLÌ‘#G¬.”1È…Bÿ Ot’ä`@1šO™æ_‘£„GB¬­­ù|¾Ý“'Oèöªª*>ŸÿìÙ3úòÖ­[;w¦çååÑ—.]òòò¢Ÿ?ÎqbEE…™™Ù¡C‡^¾|)·üŠŠ †aîÞ½kkkK#lÀ’Eɒкuk©õ«‚Ô³*++Ù#ÙÓÁ7ß|Ó·o_¶ÊRÏ522bk- eÕZ2<±z zdyy9Ã0÷ïßçñx¯^½¢?ÛÙÙуì‹f¶‰ÜJ‰uñâEOOO¹5ëw±H†éÕ«×Ù³g†Ù³gϸqã8ŽdI­;{É8…B¡ÜÚ1jZþoç–!€aÒÑÜÔѰµEÍ….Ð.ä5€^Rk²…c­.€áeee¥¥¥¾¾¾t±-!¤¨¨¨®®ÎÛÛÛÆÆÆÆÆfĈååå„“víÚÑcÜÜÜ h ¶¶¶'ZZZž:uêÈ‘#ÎÎμyó¦¬ò¥¥%!¤U«Vt%¦É¢ÄØ¿¿‡‡‡••ÕСC_½z%Y‚Ô*HžU\\ÌãñØ#Yõõõ?üðÃÒ¥KÙ*K=×ÈȨmÛ¶ôîVëÉZ)@`eeE155577777§?³P°/šÙ&r+%v–»»{aa¡¬šJ%µúï¼óÎñãÇ !Ççw8Ždq¿y$ãT°Ët>¬ra Ð?èS…ä9Ô4m  š“2ÚJ7ŽëŠ®ULMMµ²²*++c¦²²’ÏçWVVŠLDuþþûïtÑ¥èšJ©'²jkk¿ÿþ{OOOYå³E=zôˆ®oÍÈÈ\³)Z”èÆ/^˜˜˜üý÷ß ´¹UzÇZÝ›7o:99]»vMÖéZÝüü|z»V—»qdµ€ÔKH=Rìgû¢™m"·R´5D׋½mDc–l Y}š••eee•••% éše¹½/µî²Öê^ºtI(Ê­£›‹ T³.VÀ¨*7•.G¹1¤4‰:] ]9¨Ü.¹{@”Îß&޵ººM%÷o½¼¼úôé³ÿ~BˆP(œ>}ú’%KèÊÄgÏž]½z•^håÊ•¯_¿.--]³fÍ»ï¾+VˆÔóóó/\¸P]]mbbbiiÙØØ(«|I¶¶¶ô²ô¥dQ¢×ÖÖ644ØÙÙÕÖÖnß¾]j’Uz–P(œ:uêÒ¥K_¾|Y__/º®³_¿~'Nœ˜>}z||¼¬s'L˜°bÅ zúYŽVå¦H¥¤R°/šÙ&r+% 'MšD[£¤¤ä믿ž1c†âµU}ww÷®]»5Š®Y–ÛPÜo¡P8qâD6ÎuëÖ)R;%úG€T(ôú@G!y€fu4A¹ßÇŠÏØ6nwÞ¼y?ýôíÚ½{·‰‰I—.],--‡ öàÁBˆ©©©ŸŸŸ‡‡G‡ºuë¶bÅ ÉB$OlhhX·n“““……Exxø¡C‡d•/ÉÎÎnÁ‚666999R‹b999­\¹²ÿþ^^^>>>R ”¬‚¬³öìÙcllìâââèè¸k×.ÑB† rðàÁÉ“'I=wïÞ½………ŽŽŽþþþS§N511‘Õ8r;E‘JÉ¢`_4³MäV*""¢ªªªM›6žžž¾¾¾+W®T$xúfæ¨þôéÓ¯^½:}útŠûÍC /--utt8p {ÇB²v™™™ŠT¡9ðQ;ÐQ˜}Ð ¹ºK…ùËÃ@  :ϢɔQ䊒³?¢Ç«*挌Œ7Þx£ººº™åh‘Vªpéҥŋ§¦¦jò¢Šk™ÝzïÞ½¡C‡–””h;ùÔ4&¨u¨QIáš @ªÊM ç8†”&Q®¹¸ÏBhG*žÈk­ÓÌ¿u&ê(@i~ ]S¯ˆ_áÚuïÞ=##£®]»æåå}ýõ×S¦LÑvD:æÒ¥KÝ»w×vÚ„ä…¿@4C.€îRaþbV@?áÜÚòüùó¹sç‚iÓ¦}ùå—ÚŽH—Ì;÷ÚµkÇŽÓv z ú€\(ôú@G!y€žÀ (]yEÏÂ-\õÑÅ'0¨DËÀ0éhnêhØÚ¢ŽæBhò@/á   üòYð'>È…Bÿ Ot’¸aV@”û}¬îã B"€ŽÂì€Æ`ÈÐ]*Ì_£æZÇ0Œ¾þFÏÈÈ033Óvê5a„¿ÿþ[U¥B‹Òôx¬UÁ@¡Ч: É Ü0«   Êý>æñxr¿ô¬9¿é, ­¬¬|||Ξ=«\9JÐØÌcFFdz°° …ýû÷OIIQ÷åšZ¯øøø’’’Áƒ«)$wïÞ=___mGÑ4Š$>@ „ÙÁ  »T˜¿˜Õ0PõõõãÇŸ1cFYYÙ‹/öîÝkkk«±KkæB”@ ¨¬¬¬¨¨1bÄ| ÖH”(pïÞ½3f̵—a˜âââæ¥Ï ¹¸xñâ˜1c4ŒNÀ”1È…Bÿ Ot’¸aV@”û}¬Ö°Ïž=+** åóùÆÆÆýúõ4hèRÓŒŒ ög33³ððpWWW++«?ü°®®NêFzüóçÏ­­­-ZT__OÞ¹s§‹‹KPPШQ£jjj,,,,,,rrrvïÞíêêjnnÞ¦M›mÛ¶IF»cÇGGGWWרØXº%,,ÌÍÍM(úùùeffÒåOŸ>=--M,Žh¥V­ªªjÞ¼y¶¶¶¡¡¡555¢z{{‹ÖkýúõsæÌac=zôþýûŪvéÒ¥¡C‡JV933sõêÕ:t`O«¬Î¢¤/Ú› 6)[;'''ww÷ØØØíÛ·;99¹¸¸ÄÅÅÉjYÑJJêu+**‚‚‚lmm­­­gÍš%ë*;wžŸŸŸŸŸšš»aÃzpFFFff梣£éÚÊÊJ¡PøñÇGFFVUU¥¥¥1BòÒ¥¥¥sçÎýüóÏéÆ.]º$&&–••yzz.^¼˜RZZÊQN}}ý±cǼ¼¼Ä"áˆVjÕ>þøã²²²¬¬¬§OŸ¯Y³F´À{÷î±õruu9sfTTTuu5!¤°°ðÆS¦Lª¬¬,77×ÃÃÝRUUuøðáaÆõëׯ¸¸øøñã´ÊܵS¤³”hRöàÂÂÂüüüàààÀÀÀŠŠŠüüü>ø€=Q²M¤F++*©× ­®®ÎÎÎ.--]¸p¡¬–ÏÍÍ7nܦM›Ú·o¿dɱ'lTVVÞ¿¿ÿþmeh0e ra Ð?èS…ä9PŒæS¦ùWä.áÉ“'óçÏïÔ©Ç}®\¹B7FEEM›6Q5 -ÿ·sËÀ0éhnêhØÚ¢ŽæBhò@/©5 Ù±VÀp¹¹¹………edd¸ºº¾÷Þ{›˜˜´k׎=±  @ÖÆââbÇnwww§kÔG÷ZZZž:uêÈ‘#ÎÎμyó¦ØÀÒÒ’ÒªU«ÚÚZºqÿþýVVVC‡}õêG9 ¬¬¬¬¬,&&æ7Þ‹DV´R«VTTTWWçíímccccc3bĈòòrŽªBfÍšuìØ1BȱcÇfΜ)¶×ÚÚº¡¡áõë×ôejjª‰‰‰···———©©i“ZI”Ôà-þ¥x“² heeE155577777§?Óg Hm©ÑJJêuÅ:…£åYíÛ·÷ööîÒ¥KVVVII ݨ‹_P7|XäÂ@¡Ч: É Ü0«   -𹺢œœœ–/_~ÿþ}SSÓúúúÆÆFBˆØ—tÕ××?{öŒþœ““ÓºukYÙíÙÙÙt»(±Ö;vìåË—KJJDD+KYYÙ¼yóöíÛW^^~íÚ5¶•šZG´R«æààÀçóóòòè4qyyyQQG½!Ó¦M»zõjbbâÇÇ'¶×ÆÆ¦}ûöéééôå7®_¿ndd4zôè¾}ûîØ±ƒ ”¬]S;«ò_RÛAV“Ê%«M$ûBjTR¯ëèèÈ0 {0ÇU†ùûᅢƒƒ9úìÙ³ÀÀ@zÖ¥K—tñ«Ò4–øª…ÙÁ  »ð\]h®’’’õë×?yò„RVV¶k×®¾}û:;;[XXœ9s¦¶¶ö§Ÿ~=žÇã­\¹òõë×¥¥¥kÖ¬y÷Ýwem …“&MZ±bÅëׯKJJ¾þúë3fˆ]ÝÖÖ–>­•’ŸŸáÂ…êêjKKK:MÉ­¶¶¶¡¡ÁÎή¶¶vûöít£åpD+«jÓ§O_²d ](úìÙ³«W¯Êª»åÍ7ßœ={ö”)SdcÇŽý믿ؗ6lÈÎÎþöÛo¯_¿Þ¡C‡}ûöI­]S;K‰&U°%ÛDj_HJêu…BáÔ©S—.]úòåËúúú›7oÊjùN:…††vîÜ9%%åâÅ‹l#§§§[YYµmÛVñºL€\(ôú@G!y€fu4A¹ßÇj½+îÝ»7pà@ssóŽ;–––8pÀØØøÇ éÒ¥‹ØwL™ššúùùyxxtèС[·n+V¬µ‘QUUÕ¦MOOO__ß•+WŠ]ÝÎÎnÁ‚666YYYëÖ­srr²°°?tèÜàœœV®\Ù¿///º±¡¡¡©åpD+«j»wï611éÒ¥‹¥¥å°aÃh †\Ý¥Âüåa PgÑdÊ4ÿŠªŠ9##ã7Þ¨®®–»Q?¨¶j “'OÎÉÉ12’~#m„ Ë—/ ] ]9¨tzê_^gfföë×Oôñt¬ŒŒŒž={ÊzМ!àh5¨=ž.Pfþ­ÃZ]MPÓsu±¦O'ìܹ3((HÖ”.!äüùóú=¥«Ç÷÷÷×vÊÀÊ ÐQø³@ctbÈÍÈÈàñxB¡°ÿþ)))JÕ±cG5M>ªUFF†™™™º¯"·qd…¡ô‰Í?X–Q£FmذAtËš5kÆOßK¾¾¾ìöšš{{{úeà:ÏÕ€ÿO'~£¦ÒÒRssóäää¥K—j;ƒ³|ùr>Ÿ¯í(ZL€\(ôÞ÷iFF†fþ±×ÌVbPºX5~ˤ$¯@ ¨¬¬¬¨¨1bÄ| ¶·¾¾^+QiÁV\®Y³f;vLtËÑ£GgÍšE155-))¹ÿ>Ýåè訅[Ìêh‚ž««Ö¹ÝÎ;K~tBêFý ªªÙÛÛWUU%$$ØÛÛ7¿4¦Çï•Ã}ÐQz0û*Á®Îc%%%É:R+“¤]»víÑ£‡:J­‘ W)ê=ÚV¡¡¡ìKî™b±wNEE…³³óÅ‹éËÇÛÚÚ¦¦¦ª/à–@·†\ccãéÓ§§¥¥‘»oçÎ...AAAÏŸ? ´¶¶vppX´hî\»víûï¿ÏžN­&Ú饥¥'N´°°ðôôüã?èÆªªªyóæ988ØÚÚ†††ÖÔÔBvïÞíêêjnnÞ¦M›mÛ¶‰æææ& ýüü233ÙðvìØáèèèêê+YÉ É:kÔ¨Q555t$¼zõªhÅׯ_?gζÌÑ£Gïß¿_ô*´ÌððpWWW++«?ü°®®Ž"Ùbb#d$¢a°ßþB$†,EN”Ú_’•e¯"Ù&R»‰™™y÷î]úòöíÛùùùo½õ!„Çã}útAAçZYYíØ±ã£>zõê!dþüùŸ|ò‰···ªcÔ½ëëë;æååE_ÖÖÖfdddff8p $$„Ïççç秦¦ÆÆÆÒOßOŸ>ýÌ™3µµµ„ÒÒÒëׯˆjmm]\\säȺñã?.++ËÊÊzúôiqqñš5kJKK?þøãÈÈȪªª´´´#FˆÖ¥K—ÄÄIJ²2OOÏÅ‹³á•––Ì;÷óÏ?—¬Žä…dÍŽ‡®®®¢Ÿ9sfTT]øRXXxãÆ)S¦ˆ]¨¶¶6&&&==ýñãÇÉÉÉ7n$„Hm1±³Ä" CV7)r"ÇÕ%–Ú&R[eaañÖ[o=z”¾üùçŸZµjE_Ι3çèÑ£ yyy “&M’U€b´¬MÆÆ¬í–ÐOº˜_*‰Y+`T•›J—£Ü‰RšD¬ò.xôè‘@ Û˜žžngg—žžÎ0LRR’½½ý“'O:tè@ …B¡0;;›a˜W¯^}ðÁööö666!!!ÕÕÕ´´üÑÁÁÁÅÅåŸþ¡–””L˜0A(zxx„…… …Bº=,,ÌÅÅ¥U«V­[·Þºu«dx‹-úðÃßÿýÏ>ûL4à={ö¸¸¸XZZΟ?¿¶¶–c#[”d´¢5ºrå {prr² ýy×®]tåà€?~Ì YGÉòe5¯(YmøÓOÿ½;l¢ÎÿÇÿN›4GÚR)”¢´å¨äp«Ë¡PZ`¹ ºÂ.•U Þ Âîêr¶@…EPq¥XÀEÀ¢Ü ¥¥HÚÒƒ¡íüþ˜ßÎg¾Éd’¦É$3ïçã “9^¯÷ÌûÉ;ï¾gmXXX§Nþûßÿ®\¹2,,¬C‡'Nœ)k18Vø–‰›]3iii‹-bÿÉíÓf9³WÃ0cÇŽMKKÛºuk×®]Ù8-a™ ý§C¤lEN‡=Dê coÙ|W2×®]#„8ðüùóÜÂ;wî0 SSSãíí]TTÄ®ŸǾîÝ»÷þýû†ÉÈÈ9r$¿¨-·Òh4µµµ>>>ÅÅÅìÂS§NuéÒ¥ªªÊßßÛ¶mÕÕÕâ¡æææ¶k׎ ¯ªªŠa˜sçΛ­)x k[ñÃæ'ÎzüñÇwïÞÍ0ÌêÕ«Ç/Xz\š999]»v,1Ë£˜EbíBmé†"çËreÁ –žYTÙÙÙ;vlnnnlll×®Ýwß}Çßù!C¾þúë÷Þ{oîܹfm…§q¸þ¶hç« Ð2­¬rÎ%¤s÷„yÄœ.##cñâÅNÜ!å3‹çsEã ƒ†By<áœÆÆÆ¾ñÆÓ§O¯««›:uêßþö·N:Y천àH=›ãòššš>ùä“ñãÇ'%%íܹ³¹¹™].8 Np!Ÿe´‚âÌF)Ú?6P|D›5ÖÊðöíÛ%%%³fÍJNN®ªª*))™={6¢`¾‚{s¬ðçKKKÛ¼ysuuµcå¼víÚ>ú(---##ÃÏÏÏrÿ‚ ¶h¨¦cg¤5<¡ò¶’ŸŸŸÑh4ÇïÞ½;·088˜R^^®R©Ú·oÏ.ŽŽ¾}û6ûzâĉ»ví"„ìÚµkâĉü}ZnE)++»ÿ~·nÝ‚‚‚‚‚‚+++u:ÝÞ½{·oß9hР“'Oš…—••«×ë‡ÊŽõfÃÓét„6mÚ°ã…ùds+³ÄYܲ;wîüãÿh¹¾Z­æÒìÔ©Sii©H‰ñb3ká‰ohÏÑÅwh­ôøž|òI“ÉtìØ±ï¿ÿ^­V6ŒÿîŒ3¶nݺuëVùN¿àdNïfP*髌Í#Ú¬ÑNŒÙ)?D{šúúúŽ; gí°5¿ þ¶©Ñhú÷ïîÜ9'Åho`“‹ÚÏÿtöüè$Óº)Ó°ÝÅÅåô}òG籆innËd2555…„„˜L¦U«Vٳ嬭̎”·öîïÿû©S§Ž?^p€¹J¥JOO¯««3 K–,™0ÔÒ!C¸æŠ$(ò,TÁ°ò•••9’]!##ƒ¢Á2ZkO&mÑc­=)Uðˆf{ãð /ˆ?’\Ç)5Ú‰ÿuœÍˆ»{÷nzzúôéÓ_yåöþÄì‚ õññ)**b{B+++ËÊÊwÆ0Lqq1ûÏÂÂBî­#F|ûí·ãÆãßÌBjjjöíÛ·{÷ˆˆˆˆ}ûöíÝ»·®®ŽÒØØÈííæÍ›íÚµ³¶P½¶¶¶¢¢bàÀï¼ó޵…üÔ,£åg$X·oßV©T.\¨¯¯Ÿ:uªø_|[îßreËCØ_†f¯-󵃅/˜8‡áþóŸ   þ âåÌúÃþ°páBöõ‚ ÆŽkV,‚ ¶ètØ,[‡¹¢ñDÓ*?ýôSdddSS“å[˜OîDªaëk(·Ôs{IÿÑèĪ.hÖ¬Y!!!£GÞ³gOCCÿ-³¹Š+*üY±,çÒŸ]ËæÓEÍ&·Ÿ ÌæÃ4ýõ××_½S§N}úôaïGY—/_ÖjµÖŠÈæ[Öfã—¤——ØÁƒ­=¡Up^Ý–>1ÖÚ”a"“¬qa5 @ü‘¬ÀP0¯®•Ÿƒ‰çD|2­›2 Û]äÒ«KÑðdggþùç;wfï oÞ¼Ù¶mÛS§N1 3wî\½^XXXÈ0LMMÍŸþô§°°0­V»fÍk]lìßBi4š¸¸¸ 6°Ëûí·„„Nзoßÿþ÷¿üÀž|òI¶7™óúë¯9’=DFFF‡t:ÝìÙ³Dr›[FËÏèûï¿ì‘yíµ×4Mttôûï¿/Þ(¸þʇ8p Ùþí/C³×–ùZ‹ÁÂLœÍðËê±Ç㯠^Î………Ÿ~úiçÎkkk¹õ;uêôÅ_XÂ2AûO‡Í²u˜,ê5¸ÈsÏ=·xñbÁ·Ð«+w.­†èÕh1åõê&$$„‡‡¿úê«.\0{«  @­Vó—ð?T¶lÙÂþÅ„N§ãw‰8p 11Q¯×8ök¹„»¿·vÃd¹s{îDoܸAxÏåÐëõì_‡qjkkwìØ‘˜˜²k×.n¹àX]ûc0+¨Ë—/›Ý¤ ® ­µ±ºÖ΂垃‚‚®]»f¹ÐZùˆ1##ã™gža&>>~ïÞ½ Xà×/ñPEroá€%gÕM‰ë8š”q¬¸Ä·Â)°yÓå±–,YòÙgŸ¹; yðä*R®ž¨×ž¯¢¢¢M›6¿ûÝï***Wðä‹ìáÒjÈíóêHÁ¥óê:ì‡~8v옗—×ÓO?Ý·oß5kÖTTT°o™M˜Å'2ÿ”å\Z–KjþG0¤MnÅgm¢+†aŽ=:kÖ¬ÈÈÈíÛ·§¦¦'''s^¹r¥GÇ 2³·Bss3÷x v’/Ç&bÜ3ÿÐ"sÀÙ3˜Y&L8tèЙ3g~ýõב#G¶(6 b&y‹7Þx#))ÉÝQ€{ É•»¶mÛÖÖÖæææ¶mÛVp….]ºÔ××KHÉõ½ºT‹]¾|yaaáÒ¥K;Ö¹sç-[¶B4MRRÒ‚ ª««ù±µö¨PËŒŠ?rTcÏ!%Ö¦ùÐC¥¦¦véÒåüùóÙÙÙÉÉÉfO=zôèðáÃŽAð¬f+Œ5Š]Á`0,_¾ÜZ´-}2©µ'Z>)U¤|øÌ°ùHVàsÑo°îe-M鋤„š®<8§2…Ê âЫ Ç>%ûÖÛÛ{Ĉ»wï.,,0`»0##ÃÛÛ»cÇŽaaaëׯçV¶ö¨PËŒŠ?rTÃÏ!%V¦¹}ûö«W¯.^¼822Òr“†††œœ³G޶4Á°òmÚ´éöíÛaaaLJJR«Õ‚Ñ:ðdRÁ' >)ÕZùðY þHVpÏy/` )Áq%§0Ê;¡hräˉõW…†ÀNl?‹”U¦õG”>fyÉÈÈ(((X±b…dGÌÉÉIKK»|ù²‹öŸ——×½{wgÝ³æææŽ;öæÍ›^^ø P€‹ê—K«m‹vnme4,žÉYuSâ:Ž&¥E+.ñ­p ÜK¤:\=Q¯ÜNš¯ujWìÌ8VŸñ1ìjsæÌ‘à(.\ðòòzøá‡‹ŠŠÞ~ûíñãÇKpP§X·nÝ´iÓÐ¥+1Ï©øž È:$ƒ&@¾œXñ]Àµîܹ3fÌ­Vûè£öêÕëõ×_wwD¶ †€€€³gÏ.X°Àݱ€3áõÀ&4ʃs S¨¼ 30Ø 30Ÿg`p Ï€N2­›2 Û]\Q\8î…z  HÒÌÀ€±º´ðÌG±€GAC¡<8§2…Ê â0¯.€0¯.Ø d CÃ$ƒ&@¾0¯.8ǨQ£Ž=ꬽåååùûû;koÔR^1fdd,^¼ØÝQ!˜ 쀆BypNd •Ä¡W@ Ž}»ú/nNŸ>]QQ1xð`ׂf.\èׯŸ»£ð3fÌØ±cÇ;w܈<àOí@¦Ðû 4¹òåÄú‹^]zmÚ´iÒ¤I"+0 S^^.Y<²sûöm‘w³³³‡.ø–ò V¼(üüüž~úé;vHXƒ.c° …òàœÈ*/ˆC¯.€û;;;99ÙÏÏrõêU½^ÿÀˆ¬µÃ‰‹e‚ÖR–¬ÌEŠ‚sôèQ®›Ü]Æ` åÁ9)T^‡^])8öyìê`SSS?ùäËåÞÞÞ#FŒØ½{waaယšš–-[®Õj333·mÛæííýá‡>ÿüó111ÜÁX¾¾¾ ±±±;w~ä‘G-ZdO$áááéééñññ]»víÙ³§ý)lܸQ­VÇÄÄètºaÆ]ºtÉ2ZkY;hFF†··wÇŽÃÂÂÖ¯_oí@„íÛ·_½zuñâÅ‘‘‘ü¨²³³{0Í Väp"Åb™ µ”Å9±ÌEŠ‚ÕÐГ“óÇ?þ‘’ŸŸjÿá(„‘ Sè} š\ùrbýU¡!°ÛÏ"e•iýmîaÔ¨Q¯¾úêàÁƒ>„,äååuïÞ½¾¾^šÃ >|Ñ¢EC‡•æpž/##£  `ÅŠîÄÉ\Ô&¸´©qÊÎ¥o ÀΪ›×q4)-âXq‰o…Sà^"uÐáê‰z àvÒ|­S»bï`Ʊú,ÁÇð¿ÿýoW‚BO<ñÄÀÝ…™3gŽ»CÜ€L¡@2hräˉõcuìÕšŠç®]|س$« ” ¶~Q›8€‡s{ÝtÅ0R0ãŠâÂ)p/ŒÁP$W ÷Üzuì¥ÈÀarœÁ)ÈþÔ@2hrä óê@‹áÖlBC¡<8§2…Ê âЫ Ì« vBÅ™Bà 4¹ò…yu Å0;Ø„†BypNd •Äa¬.€0¯.Ø d j 4¹ò…yu Åpë6¡¡P{Î)Æx V6Ȩ׊‡^])`^]°*>È.É É/'Ö_ôêÐ]Æ` å?§8×à Tµ$*•ÊE™:\Œ””¼4\w~= =™* ž– Çæ¹g­*mPñ@¦ðTp=W=™²hÈ×]9¢É•=…LO¦žÀ‰õ½º´@—1Ø„†By<üœÒÓ•€LÌE){rå¥ê,Ó“,=™*f`æÕ;¡â€L¡á‚Ö ç/éÉ”¥ì|ÝØæÞR¥¤ï’4 M™z'Ö_ŒÕ þXlBC¡<ž|N=60§C¦ŠçŠÄ=¹òÊÎ5=ÉÒ“©2 W@ ˜W섊2åá½àùè¹~èÉ”¥Ô|Ý›—›\¥žP3”¤IhÊÔs`^]h1t€Mh(”ÇcÏ)=] È”NOßc+/‡ª3NO²ôdª˜W@ ˜W섊2…† ZOÙs°òÑ“)Kyùº½ÛË]åéöÄ¥AIš„¦L= æÕ€ÃßG€Mh(”Ç3Ï©†ä"ôdJþ7¶”ë°`xܘdœ{º=³òšñüˆždéÉTî0V@ Ž ¾£çî8¨ø SøSp å ê´FÙ™*85–ÛtK“KOOW°Šÿh㧦ød=‡‹½º´À]Ø„†By<óœ¢ÓÀ&¹\* þ‰B©yYC[¾ €^])`^]°*>È.p mW%ùÒs?ã®LÝR¶ôüC'œPÉ`^]h1YÌÎî…†BypN=:M E<¶òÒ3W²Çž¡*YeÀX])`^]°*>Ȇnch»rü·ê|4äÈrW¦´Uºt%ƒyu Åpë6¡¡PœSÏNh­¼ôô)Ó#mù*zu¤€yuÀN¨ø Sh¸À1´]9”äKÏý Uóꂲᢒ æÕ€£mj0p åÁ9õè4ñØÊ‹yu•Šªd•cu¤€yuÀN¨ø Sô Íç¢íÊÁ¼º ƒyuA1Ð¥+'Ö_ŒÕ =+Àah(”‡=¡Ü×uþÐ3OxÍç ñ¸ô5ÿ¿ž^{øk› ²cSýïbö²rÑko?]‘¯Ûc äµ³`¬.€0¯.Ø d ð©è•ìô>;±½on94( ÖC8±¨©hgœBú®–ÖÝC®ã¢úåÒj딣aðLΪ›×q4)-‚â¹ çZ¥'S:Ñv~)ù1F¸+cu¤à؇ÚS ¡â€LÑöÕœ…¶+‡’NrdÑ“)(FËzuh/` ×A§ (=?ÆÐ#mù*zu¤€yuÀN¨ø Sh¸À1´]9”äKÏý =™‚âá2–#/wqÅsW@aÐP¸:M@†¡äb¦í3‘ªd•cu¤€yuÀN¨ø S°Ž¡íÊÁ¼º CO¦ xèÒ•#ôêÐ_<À&4®ƒNPz~Œ¡!G>ÚòUôêHóê€Pñ@¦Ðpch»r(É—žûz2ÅÃe,G˜W€´M @Cà:è4eÀ¼ºJEU²Ê€±ºRÀ¼º`'T|) XÇÐvå`^]…¡'SPȬch»r0¯®ÂГ)(ºt彺´À° €ë Ó”žchÈ‘¶|½ºRÀ¼º`'T|)4\àÚ®Jò¥ç~†žLAñpËæÕ mSƒ€ÐP¸:M@0¯®RQ•¬2`¬.€0¯.Ø d ÖÀ1´]9˜WWaèÉ]ºr„^]Zà‹Ø„†ÀuÐiÊ@Ï14äÈG[¾ €^])`^]°*>È.p mW%ùÒs?CO¦ x¸ŒåóêЂ¶©ÁÀh(\&  ˜WW©¨JV0V@ ˜W섊2…kàڮ̫«0ôd Ї.]9B¯.-ðÅlBCà:è4e çÇrä£-_@¯.€0¯.Ø d 8†¶+‡’|鹟¡'SP<\Ær„yuhAÛÔ`à4®ƒNPÌ««TT%« èÕ‚cô|X_yòòòüýý-_S"???44Ôuû犔;…ìôó"žµµÃåååiµZ'†!1Ú¾ú‚³ÐvåP’,=÷3ôd ŠGIë¤0èÕ …Œ¾xäåå©T*­V«ÑhâããÏŸ?ï¦Eý˜Z­–=ìIa±o9rdðàÁz½>88øÙgŸýõ×_Ͷ}ðÁ+**œº’Èw¹²&L˜àÆ`ZOF €ì Ó”žchûL¤*Ye@¯.€û0 çÃ8¨ø??¿šššªªªÄÄÄÙ³g›½ÛØØè–¨\Í3󪩩©©©9{ö¬F£©ùBÈáÇÇ÷ç?ÿùÎ;ÅÅÅC† yüñÇûí7wÇëìåÊúì³ÏÜŽ{ÐöÕœ…¶+‡’d鹟¡'SP>>%%%—/_>qâÄòåËÙuRSSëëë üyó!sçÎ5·nÝ*//_²d‰Á`˜;wîž={jkk¯\¹’˜˜h¹ÄÎ Íމ‰9sæŒÑhŒ‹‹KKK³3M~^–e“ ,//?~üøöíÛÅ÷fOØ䆗FEEÙÌËRUUÕO?ý”œœÌ_˜’’òý÷ß[ÛIJpRRRöíÛg2™!ƒáرcãÆ\Óï¿ÿþ¦M›:Ô®];ÁRå3™Lƒ¡´´tæÌ™ .‰¹¥e%~èYGÛW_pÚ®J’¥ç~†žLAñ(i”†û´¦Ê¸«º¡š¸µõKšÄ¯]»F 8pàùóç¹…wîÜa¦¦¦ÆÛÛ»¨¨ˆ]?;;;..Îr9Ã0µµµ>>>ÅÅÅì?O:Õ¥K—ªª*ÿmÛ¶UWW³Ë-—ع¡5¹¹¹íÚµcÃöóóãòâ^›%Ëæ%xPËd5åžÙ…v†m‰=yq‡`¨Õj³u._¾d¶•eÊ\á0 Ó»wïýû÷3 “‘‘1räH‘5­EÅîßìÅ;ï¼Ó·o_‘R5Û !¤ªªŠa˜sçÎ[ˆ‹D°0¹Ë500ðóÏ?ç‚<4÷®µ3ë·7JŽàö°åE‘ťȤ¬¡*YP0\ÉŠ„eGþ IDATs*#\ÄX]…£í§oůxöÃé *>ÇÏÏÏh4ÆãÇwïÞ[L)//W©TíÛ·g—GGGß¾}Ûr9!¤¬¬ìþýûݺu JLL¬¬¬Ôét{÷îݾ}{ddä AƒNžÊ?¢`"Î1ÍÚ_0sbñ¶†c¢âQ)€4PñAIÖ­[—ššºtéRwR çrÁ¹h»r(I–žûz2Å£¤uR/Bˆ¯¯oEEÅÅ‹ÙE_~ùeXX˜Äqx{{ñÅ¥¥¥–oùùùÕÔÔTUU%&&Ξ=›¿°¦¦fÔ¨QsæÌ‘6XÛrssïÞ½[TTtîÜ9n¡`"®€Ï„eèÒ¥‹\¦_x饗***(™3A1ÐP¸:M@èù1†¶ÏDª’U/BˆJ¥š6mÚÖ­[ÙE}ôÑŒ3¸5îܹ“œœ:þüÆÆFBHÏž=µZ-;ZV¥RÙsºaÆN:i4š„„„üü|ËÔjõ´iÓV¯^mmÞÞÞ)))W®\ù¢÷ò?~üõë×Éÿ;îÕl´¯¿¿ÿš5k¢¢¢Nœ8Ayê©§ØnÞ¼Ém˾X·n]xxxttô‰'V­ZÞ±cÇü‘Ýammíœ9sBCCƒƒƒSSS,£ýøãŸ}öÙ±cÇ~üñÇö$â ´µ>αÓAχ%pPñ@¦pó Ž¡íÊ¡$YzîgèÉ’ÖIa¼ØÿMŸ>}ÇŽMMMEEE¹¹¹cÆŒáÖxþùç}||JJJ._¾|âĉåË—BΞ=Ë•}î¹çìsæÌ£Ñ—––&¸NZZÚæÍ›«««ßmllܹsg×®]ù ›ššöìÙÓ«W/ñ£›L&ƒÁPZZ:sæÌ… B<Èö5›ëÍd2ݾ}»¤¤dÖ¬YÉÉÉUUU%%%³gÏf7$„Ì;×h4ܺu«¼¼|É’%f‡kjjúä“OÆŸ””´sçÎææf›‰¸m7I _<À&4®ƒ¯f  ôô3Ðö™HU²Êðÿ÷ê>øàƒ±±±ß|óÍ¿þõ¯””___vù½{÷öïßÿü# ,,ìwÞÙ±c·ñÎ;¿ÿþû¬¬,›‡ILLlÛ¶­Ï¼yóNž<)¸NÇŽGŽ™‘‘a¶¼¡¡!(((44ôøñã›6mâ/lÓ¦ÍÚµkmÀ0Ì‚ ¼½½Çá›+ÿõ¯eW.**â^³ÖÕÕ}üñÇ«V­Òétæµ×^Û½{·Ù¾ýöÛÆÆÆ!C†$&&Þ»wïðáÃ"‰%0¯.Ø ßEòóóCCC­½kí¯Žøýã:ŽÅFœžÙ_,µrofûtl[ Ê\¶¯¾à,´]9”$KÏý =™‚âQÒ:)Œ÷jÆŒ[·nݺu+ú…òòr•JÕ¾}{öŸÑÑÑ·oßf__¼x1--íóÏ?×ét6“••«×ë‡zïÞ=k«½òÊ+«W¯6™Lü…~~~F£Ñh4?~¼{÷îü…ƒ¡_¿~}ô‘øÑýüüØ Û´ic¶sÁ•õz=!Ä××7 €}ÍδPVVvÿþýnݺ%&&VVVšíaûöíÏ<óŒZ­öõõ=zôöíÛEŒì¾xdgg0@§Ó:ôÀÖÖ4ëFäRÊš0a‚+žŒj'OŽMcÒuú3`íçÆC+’ì A§ (=?ÆÐö™HU²Ê æ^%%%ýùÏŽŽŽîÓ§O^^»0,,¬¹¹¹¸¸˜íØ-,,l×®!¤ººzüøñ+W®|ä‘GlÃh4Ι3çСCƒ úùçŸlmÍîÝ»÷ìÙ“?XœN§[µjU|||ZZš¯¯occcss³——Wyy¹ø†7@¡¡¡>>>EEEFp…ššš}ûöy{{ÿûßÿ&„ÔÖÖB6lØàØá@1kÙ  +UPñ9ÿþ÷¿SSS?úè£'Ÿ|’a˜Ã‡ÿý÷#GŽ´ssvª%—Fè0OŽÅ=J—½Óc¥{ëÖ-wÇ 8†¶+‡’|鹟¡'SP<\ÆrôcuµZíwß}÷é§ŸòßÖh4cÆŒY´hQ]]]EEÅÛo¿=iÒ$BÈsÏ=—˜˜8yòd{Ža2™šššBBBL&ÓªU«ÄW~õÕWׯ_o]»víÓ§OVVVdd¤V«Ý·oŸÉdZ»v­øVÁÁÁìü¹öˆ¥ÑhRRR^~ùevˆnqqñ¡C‡ø+ìÝ»7((èêÕ«¿üòË/¿ürõêU6ª–Àéä5°âõ×__¹råðáý½½Õjõ“O>¹bÅ ö-Ë'—š=Õroüáœâ>5 £GÖjµqqqß}÷x7nŒŠŠ ˆˆˆX¹r¥«ckQxUUUÓ¦M  œ2e »ÐælYâÒ Ò2M³gÕ²ÃÛ¢2·Y‚‰ƒýäÕPÈ :M@èÁJÛg"UÉ*ƒÿýû÷øá‡ÍÖØ¼ysmmmDDD\\\¿~ýÒÓÓ !ŸþyVV÷ǃâÇOOOïÚµkÏž=ÅWðÀ<ðÀ¬Y³>þøã”óê€PñY•••gÏžµ62×òÉ¥"ÏAµgsþ»©©©åååÇç¦Qd0æÎ»gÏžÚÚÚ+W®$&&º:¶…—ššZ___XXh0æÍ›Ç.´ç¶,‘Gé i–¦å³jY‚áµ?)Á£›Z0qm_}ÁYh»r(I–žûz2Å£¤uR@Τ¼Œ[s,T7P i´‚‚µZÍý322R¯×·mÛ–a˜ÚÚZŸââbö­S§NuéÒåÚµk~~~Üú×®]#„þÏçŸέ ¾yMM··wQQûnvv¶F£±dUU•¿¿ÿ¶mÛª««Ù%.­Eá™­i)77·]»vl<ìþ-_ 2ä믿~ï½÷æÎ{íÚ5öX‚Aò·âr¬ªªbæÜ¹sÁÁÁÖâ‹‹kQ™·´ˆ¨âö› Çp{Øò¢ÈâRdRÖP•,(®dEÂ9•®þß¼ºòåù“9›ççN‡ŠÏ nll¬ªªbazëÖ­¼¼¼^½zÞ“KÙ5†ñóó³ÜûRîŸÜ3Ä7·|N¬H:nïÞ½ÿüç?çÍ›×£G>ø ""Âu±µ(<³59YYY+V¬(--%v\fì£tÏž=»sçNn¡ýåoù¬ZÁÇð¶¨Ì[ZD %4\àÚ®Jò¥ç~†žLAñpË‘—íUd‚¶¿Þh)µ“={ö}ºKckQxfk²ØØnÙ²¥²²òÈ‘#6ïÝ“’’rrrüüüúôéc3H{ÒäÃËÅß®]»•¹ÍLZDF €ì Ó”?ZPÙhûL¤*Ye@¯®¨(f­4¤? ⋊žKà âsÞ}÷Ý´´´o¾ù¦©©©¹¹ùçŸf— >¹Ôþç Š?øT£ÑŒ=š{Nì²e˸·øÏ4c•””8p ¾¾^­Vëtºææf—Æ&žel&))iÁ‚ÕÕÕ'Ož$-|€-±þ(]Á íISð1¼ö'eíèüC &ÒðÌ{0ð|´]9”$KÏý =™‚âQÒ:) zuA™h»;°‡¼¾xŒ5*++ëí·ß jÛ¶íÚµkwìØÁ¾eùäÒ=UüÁ§™™™ƒ!,,lРA“'Oæ–ߺu«oß¾ü5›šš–-[®Õj333·mÛæêØ¬…g!$##ÃÛÛ»cÇŽaaaëׯ'-|€-KðQº‚AÚ™¦àcxíOJðèf‡¶LÈ.p mW%ùÒs?CO¦ x¸ŒåÈËÝ€Dèy`18 €ë Ó”aJ.fÚ>©JV0V@ îWdd ÖÀ1´]9˜WWaèÉ]ºr„^]Zà‹Ø„†ÀuÐiÊ@Ï14äÈG[¾ €^])`^]°*>È.p mW%ùÒs?CO¦ x¸ŒåóêЂ¶©ÁÀh(\&  ˜WW©¨JV0V@ ˜W섊2…kàڮ̫«0ôd Ї.]9B¯.-ðÅlBCà:è4e çÇrä£-_@¯.€0¯.Ø d 8†¶+‡’|鹟¡'SP<\Ær„yuhAÛÔ`à4®ƒNPÌ««TT%« « Ì« vBř€5p mWæÕUz2ÅC—®¡W€øâ6¡¡ptš€2Ðóc 9òÑ–¯ W@ ˜W섊2…† CÛ•CI¾ôÜÏГ)(.c9¼º o%%%*•êÔ©SîDØ{ï½÷È#8wŸ6lhß¾½à[kÖ¬‰ŠŠrîáœN$~"“ä‹¶©ÁÀh(\&  ˜WW©¨JVЫ Ç> ”úa9uêÔ>}ú8kogΜQ«ÕwïÞUY1tèPv[QQ1þü|Ð××W£ÑôèÑãïÿ»ûy饗~øá›«­Zµ*::ÚÎ}æææþîw¿ké[|ÉÉÉ vÎ/¼ðBtt´Z­nÛ¶í³Ï>{þüy;ƒœ1cÆÙ³g>t‹JÒ3)µâ€âÑöÕœ…¶+‡’d鹟¡'SP+**úõëwîܹ͛7çççŸz‹J’Bøâ6¡¡ptš€2Ðóc mŸ‰T%« èÕ‚cŠü°¬¬¬üõ×_¹^]£Ñ˜––íããóÀ¼ùæ›ìòÒÒÒÙ³g·oßÞ××·wïÞ‡æöŸŸ?vìXF¹uëV¶‹Ðßß?â.^¼8`ÀîŸ"{[½zuŸ>}4¿¿ÿ AƒÎ;GÉÈÈ(--ýꫯžxâ‰:tïÞýÅ_œ;w.·•`Øõõõ>>>™™™ÉÉÉ:nÆŒì’o¾ù†b2™|}}ׯ_?yòd¶«÷•W^!„0 £×ëwíÚµk×.öŒWTTX ŒÝÏŋ۵k7qâDNþþûï³oÕ××_¾|™ë0µ–õ;w ¸^]kz衇ÒÓÓ¹”»uë¶xñbñ­~ùå—äääùóçöÙgC‡íСC||ü¾}ûôzý»ï¾+?{ÿÏ?ÿÜæe`y ÌJÒ¾ëÑ)²â hûê ÎBÛ•CI²ôÜÏГ)(%­“ W$•››Ë0 Û«k0Ξ=»uëÖüüü;wvéÒ…RZZúØc577çää\ºtiÈ!cÆŒaû:‹‹‹ tòäÉ|øá‡‡æü,***))áDÙ!¤¡¡áŸÿüç•+WŽ?Þ¦M›éÓ§Bnß¾ÝÔÔtíÚ5Á¬…}öìÙÆÆÆ¿ýío&L¸téÒòåËÙ%lxçÏŸ¿ÿþ?ÿùÏQ£F;wîÍ7ß|ÿý÷÷íÛGùùçŸU*Õ®]»JJJJKKCCC­F¹pá‚ÉdZ·nÝĉ/\¸ðÒK/½òÊ+‡"„œ;wŽ;œHÖ¹¹¹„®ˆ¬¨gÏž.\à²Þ¸qãÝ»w¹~^k[Í›7¯[·nK–,á—˜¿¿BB™3gÄã'„\ºt©¡¡Áf ÖN¿$í¹)„/` ×A§ (=?ÆÐö™HU² Á€}ZSeÜUÝ<°š¯X±¢M›6 ÃLš4©OŸ>õõõfë$%%M:•ûgSS“ÏW_}žõä“Oro}òÉ'„ãÇsKØ~Ò‚‚{öfæ³Ï>Ójµ Ã\ºt)66–—ššºÿþ¦¦&n5ka¯_¿^¥R8q‚¿$22’}™™Iùᇸwzè¡¿þõ¯ Ã?~œRQQa¥Ìþ/0†a6mÚäååuæÌöŸÍÍÍ:tX¼x1Ã06lˆˆˆ°™õòåË5 ?#Á½õÖ[;wf_ÆÐÐÐM›6‰‡wùòeBHVV–å:£Fzä‘GÄãgfëÖ­ÁÁÁ6S°v l–¤sy`ý²É)1Ë1q8«n:¼Ç6D“Ò"Š,.E&%‚ªd䎪ŠªdåŽ;YêÖõ ´Ì©S§z÷îííí]VV¶k×®ýû÷ûùùñW(++Û»w¯¯¯ïÞ½{¹…÷ïß(//ß»woNN·\¯×{yyõêÕ‹[rúôéÐÐPîyY"{#„”””¬X±âàÁƒ¥¥¥÷ïßoll|衇!ݺu»råÊéÓ§9’=f̘qãÆ±ÓX ›ræÌ™ò'uåO ˾ËFY`` ¯¯/ûV§NÚ¶m˽e-0BHnnîO<Ñ»woöŸ*•*$$„Ý÷2ñ¬úé§Þ½{{yy‰¨gÏž7nܸwïžF£y÷Ýw###gΜ)ÞéÓ§ !–ÓÚ655:ujĈâñB~þùgö-‘ÄOYI‚†ŽQÐh(\ãà@Ø+™†Ï rä£-_@¯.€kùayúôéqãÆB~ùå—æææ˜­ðË/¿0 óË/¿x{{ó—GEE9r¤¹¹™ÿ¤µü166V£ÑpKÌž&²7£ÑØ¿ÿž={~ðÁ:uòóó›={v‡ØT*Uÿþýû÷ïÿꫯΚ5+++«²²200ÐZØ„3gÎ >ÜlɨQ£¸×äÞª®®¾xñâk¯½FÉÍÍíÓ§÷–x`gΜùýïÏ­\UUuåÊ6å3gÎŒ9R{ö,{úDR°v ,K,á‹Ø„†ÀuP³@è¹’iûLT©Tô$« xZ€›d?aŠ2°¡Ïöê0 00pîܹçÏŸ¿yóæþýûÙ)q2uêÔÜÜÜ¢¢¢Ÿ~úé½÷Þûå—_Ø ýüü^}õÕëׯŸ8qbüøñüG¥ þ`^‘½éõú¦¦¦?þøæÍ›_|ñŸqãL&SŸ>}f̘±|ùòŸ~ú©¨¨èìÙ³ .ܶmÛ{ï½Çµ6û0þ@Qv Û“{ùò庺º|ûí·7nÜX¹rå;ï¼³iÓ&BH}}}^^Þ­[·ÊËËE#„\ºt©®®î«¯¾:räÈo¿ý¶råÊ¥K—nÙ²ÅÇLJ=["Yó•&r BˆJ¥êÑ£GVVÖþýûÿñpy‰lÕ«W¯äääW^yeÛ¶m………W¯^ýðÃ{채„„ŒŒ ñø !ׯ_¯ªªbKL$k§À²$eJy(AÛ#eÀYh»r(I–žûz2Å£¤uRçÏÙ  P­©2îªnžVÍß|óÍÀÀÀææföŸ'Nœ8p ¿¿¿ŸŸ_ïÞ½>Ì.gÿH_£Ñ¨Õêèèè©S§Fö­]»vuìØÑÏÏoàÀ_ý5!äСCÜþwíÚE)**âÔÚÞšššæÍ›§Ñhôz}rrrff¦——Wuuõû￟äåå2bĈœœþÃÞ¼ysÛ¶mù«ñ—lÛ¶-<<üàÁƒ111¾¾¾}ûö=xð ·æ§Ÿ~©R©DcfëÖ­!!!‡Ž‹‹óõõç Í,kY/[¶Œ;"b½ð „ ðóßÊd2½ûî»±±±>>>AAAO<ñÄöíÛ¹3.?Ã0»wïÖjµÜcÜD.kWŽYIºš§Õ/ÉP›8€‡s{Ýt,·‡-/Š,.E&e UÉ‚‚áJV$œSáê WØKú?¾hýiûƒ5þüK—.Ȭch»r(ùgrdÑ“)(ºt彺´À° €ë Ó”žchÈ‘¶|½ºRÀ¼º`'T|)4\àÚ®Jò¥ç~†žLAñpËæÕ mSƒ€ÐP¸:M@0¯®RQ•¬2`¬.€0¯.Ø d ÖÀ1´]9˜WWaèÉ]ºr„^]Zà‹Ø„†ÀuÐiÊ@Ï14äÈG[¾ €^])`^]°*>È.p mW%ùÒs?CO¦ x¸ŒåóêЂ¶©ÁÀh(\&  ˜WW©¨JV0V@ ˜W섊2…kàڮ̫«0ôd Ї.]9B¯.-ðÅlBCà:è4e çÇrä£-_@¯.€0¯.Ø d 8†¶+‡’|鹟¡'SP<\Ær„yuhAÛÔ`à4®ƒNPÌ««TT%« « Ì« vBř€5p mWæÕUz2ÅC—®¡W€øâ6¡¡ptš€2Ðóc 9òÑ–¯ W@ ˜W섊2…† CÛ•CI¾ôÜÏГ)(.c9¼º´ mj0p ×A§ (æÕU*ª’UŒÕæÕ;¡â€LaÀ8†¶+óê* =™‚â¡KWŽÐ« @ |ñ›ÐP¸:M@èù1††ùhËWЫ Ì« vBÅ™BÃŽ¡íÊ¡$_zîgèÉ—±a^]ZÐ658 €ë Ó”óê*UÉ*zu¤à؇=–.???44Ô±móòòüýýGiMØòb-Ó¼¼<­V+}<­„Š2EÛW_pÚ®J’¥ç~†žLAñ(i½ºÔÉËËS©TZ­6  oß¾?ÿü³»#2çêžP{öÏ_çÁ¬¨¨p]>þùçŸ÷ññ)))¹|ùò‰'–/_ή xšÄϬe¨Ö²&„×ò܉°L?%%eß¾}&“‰-ŠcÇŽ7ÎjVþåååÇß¾}»Hú‹ž»dPÚ¾ú‚³ÐvåP’,=÷3ôd ŠGIë¤4 ا5UÆ]ÕMð¸×®]#„úøø„„„ܸqƒ]^[[ëããS\\ÌþóÔ©S]ºtaW.**bæäätíÚ•]xçΑ «ªªüýý·mÛV]]msÿUUU Ü;w.88˜ÐÏÏ ØrWÖäææ¶k×Îl¡åæfûÜœ¿÷º¦¦ÆÛÛ›+ K–+‹;elÖ’ýòË/'L˜`¶ÿìì츸8æçÔò4±‡,yÁ\¬•ŒàqÏ={ã—sïÞ½÷ïßÏ0LFFÆÈ‘#EÖ䈜PË85`ú–Q9€ÚQjðpn¯›Žàö°åŽÅåªo¤.†L‘/…™ºšÇ­s*#\ÄX])ð+žý\:¯®Ñh4 ýúõcÛBÊÊÊî߿߭[·      ÄÄÄÊÊJBˆZ­nß¾=»N§NJKKÙ=‹l¨ÓéöîÝ»}ûöÈÈÈAƒ>>555f+Þ Ðo¾ù†¤Éƒ)¸!Çd2}ðÁqqqÖöÏ«Ñh†ÉËËãÉ튿ðîÝ»jµúèÑ£ÍÍ͹¹¹ìÄ#áïßÚæüuœ2VW}²²²!&%%åå—_fG2:tˆ¢R©ÒÓÓëêê Ã’%K&Ožl¶Á KJJ8P__¯V«u:]ss³µý[ 6™LÜ(TË]ñW6™LMMM!!!&“iÕªU–{³Üœ¿k››ÅÀeš””´`Á‚êêêÆÆFËa¿"+È26Ád¯^½ª×ëxàF3f̘E‹ÕÕÕUTT¼ýöÛ“&Mbw%ršK^0TÁ¬Ù=X;®¬•sttôÃ?€+`€gr[ÏSË!Sä -‚^]ÚÍ™3gíÚµlרÆÕjuLLŒN§6lØ¥K—!¾¾¾ ±±±;w~ä‘G-Zd¹Ë ›šš–-[®Õj333·mÛfmÿ–BBB^zé¥ØØØ   ›7o žžßµkמ={ZîÍrsþþëëë77‹[ž‘‘áííݱcǰ°°õë×[ÎÚ ‚qZÆ&˜lvvöðáÃÙM6oÞ\[[ׯ_¿ôôtv¹øi,yËP­e-r\qÜ×{‘Ó”’’rèС””›kZ+4þ»™™™ƒ!,,lРA\×¶`úùùù¡¡¡öd¡$¸©›ÐPÈ‚ 7mvbû§¤¬2­?bë÷——×½{÷úúz‡÷­7|øðE‹ :´E[]»v­W¯^â3»Ô… †ZQQá®\ÍEm‚ôMMKy~„t’iÝ”iØîâÞâ’ÝÉr8`z2uÊæÒÙ•rÃÉ•fséÉ.`Ç•'Æêxº'žxbàÀ-ÝêÂ… QQQ®ˆÇN999=zôpc`  6¡¡µ» ‚c?Lá‡,`½úê«-Ýdݺuo½õÖÆ]=fΜyäÈ‘;wº+ùBÅ™Â0)a{µæ»Š»¾çàû€ëP[¿¨MÀù½n:€ÛÖÌÀÐ"øSni6—ά”{N®4›KOv{8®<1V@ òê 7BÅ™Bà %Ì« @ L— 6¡¡ôêHÁ±/H ÃÐ<ì%//ÏßßßÝQ¸Ö¨Q£Ž=êôLóóóCCC­½kípyyyZ­–}‘‘±xñb'†ö£¼â€|¡;@JèÕ Ñ™3g¬Ñhôz}Ïž=÷ïß/Ù¡%ë«ÍËËS©TZ­V£ÑÄÇÇŸ?ÞÕ‡ki^§OŸ®¨¨XQQÑš}Θ1cÇŽwîÜielÄ¢d$>/–P]Æ` Y@¯.€û‚ä¢1/øÃ&Mšd4ïÞ½»iÓ¦àà`§ÅÚ¡¥9ËÏϯ¦¦¦ªª*11qöìÙ.ÄnÚ´iÒ¤IN9:›)ë³Ï>sÊŸ~úé;v´~W‚;·v^ÈÿÇÞÇ5u¬ÿŸaK‹€(‚ÔÊâ¾¢Upik­KÕû­®XëR«¶µ¶êõvñz+Å~o+Öº/ÕÚÚÚZ­Öª×ªÕ UŒ   ¢‚¬@äüþ˜_Ï+%ÉIH 'ù¼ÿJÎ2ç™™Ì!y˜L,Ý5<¿ä,“Ý@ à²ºv§¨¨¨¬¬lþüùb±ØÑÑqÀ€C† ќϨùM|º}ÇŽÁÁÁ2™lÑ¢Eõõõ:7Òã>|8eÊOOO__ß·Þz«¡¡¼yóæ   Ù³g9²®®ŽÎ*ÍÏÏß¶m[pp°»»{@@À† ´£Ý´i“ŸŸ_ppð¥K—è–­[·vìØQ"‘ <8//nä(ÇÑÑqêÔ©ÙÙÙM"áˆVgÕjjj.\èëëëíí=þüºº:Í»té¢Y¯¸¸¸ØØX6†_|qÏž=MªvêÔ©áÇsÔÔ„Êjöš¾°5¬¨¨7nœT* ?sæŒæ®aÆÍN,•H$K–,9tèPMMMvvöˆ#´/]QQQRR2wîÜ•+WÒ¡¡¡©©©J¥2<<|Ù²e„ŠŠ Žr8Ñ$ŽhuVmÉ’%J¥òîÝ»NJJ kÊ0ÌúõëKKKU*ÕâÅ‹Ÿ{î9þÜ0´zÏòÆü€í§ÊöSS‹œÎ?ÁÜʱ퉹º|ÐxÆk¹9/;vܺuknnnIIIppðœ9s8vrrjß¾={bII‰¾ …B$±ÛCBBè\`K÷zxx>|xÿþýÑÑÑÉÉÉMpqqñð𠄸¹¹©T*ºqÏž=aaa2™løðá?æ(ÇÅÅE©T*•ÊÄÄÄîÝ»7‰D_´:«VVVV__ߥK/////¯#FTVVrT2sæÌB80cÆŒ&{===Ÿcæ&ûûûÓo_Ñw;;w¶jÈ&2r6!D¡PÄÇǯ_¿Þj±šÍøÊÚ#SØGŽY¿~ýáÇ«««=¿ÞÈú²ÉúuëÖ;Öjá‚.Èê^s?D¹¸¸Ü¸q#::ÚÝݽS§N_~ù¥££ãçŸ>oÞ¼ÐÐÐjïììù$..®¼¼\$•––jY^^þÒK/-Y²„Ï€y®éÙ³g ÐØØhò[Yó¶H•©leeåõë×éBj¦ý蟙[ªs °wï^†aÆwáÂ… &üþûï ÃtéÒåÇdF©T:88lܸ1$$Ä××÷•W^1íB­dج/«  @*•>~üغŶ'æêØ|ù±UÙ¼yóìÙ³ôÞi?>tèP>C2ÒÂ… ãããéã÷ßÒ¤IÚÇܸqƒNŒ-,,\³fÍĉy Ñ ûņááF<ðõõ ÿüóÏé*...O?ýôW_}¥95¬¶¶–þ„lmmmmm­Õb515ýç?ÿùøñãM›6Y/L‹1~v›6m>üðÃï¿ÿÞZ¡šÉ`MU*Õ’%K¶nÝjï9éV™LÖ½{w‘HÔ®]»¸¸8ëlƒ«¦üùçŸjµ:///33óÖ­[Æ/4×:¿JÌ¡C‡Fíîîn­PA'Áß_øÁ~¼ñÈÈ+êŒVçvàMEE…»»{zzúòåË­KKyøðáøñã¥RiÏž={÷îýÞ{ïY;"ÃÑ/šÿ}¼ý€f2dHYYÙàÁƒéÓ¨¨¨²²2Í$‚››[·nÝ?~ìæææææf¥0-À`Mׯ_þüyOOO©T`¥0-#::úöíÛGŽ‰ŠŠ"„ôë×/55õâÅ‹:W_eF¸7 ƒ5ÍÏϧ¿Í0hÐ ú­vjV· Á¶T*‰Dqqqnnn>>>kÖ¬±vÈf1þ?1‡Âò ­Œ!Ü7ä¯ß"Ë¢·;_v[q€VÎêcÓ´¬¶°X·¹×Y&l?5µÈéMtéÒåáÇ۷oÿÇ?þA‰ŽŽÎÉÉù¿ÿû¿Ù³gBè²]O=õ”B¡ˆ Ú¾};oóYÓÆÆF…BA¼wïÞðáÃM˜rn~À–ª2we !/^ (..ž9sæÙ³gyØR5-//÷÷÷ÿÏþóçŸþ÷¿ÿ­«« ™9s¦R©Ü¹s'=¦C‡999ô¿Mr¹<22Ò„ µ’akL} !EEEááᥥ¥&ÏÕmVÀ„Ë—/{yyÙÀFãÏ5Ûž˜« `Æ ÁyEƒ1€€`²÷Û°Üs“i~S"‘tëÖ­cÇŽŸ}ö™õ"5wMþâëëk½0-Ãà”ó?þø£OŸ>R©´wïÞ4]%PƬš2wîÜ÷ß¿®®®²²ríÚµÖ ÖŒ©/!äÇ5joË/ܺuëÖ­[ ¶±ÑøsM€¹ºÆâÿŸöF^Q;Äž"¸‰ÒBã«E‡­E Ç u²ÔØäyŒã–Ò,˜«Û,VŸôÇ›V2é7èY>KàYkèÜ ìܹ³´´”.A°råÊO>ùäÎ;:u¢Ô××/[¶ì»ï¾khh˜0a¾}ûL¸Jë¶ëK:tè’%K¦L™bòUš0=X¡PhþGD¸?×xl{"« `,sî›<¤i¨&—à¸îK/½´bÅ ËþTW^^Þ€ÊËËuîÍÍÍíÞ½»ö7rss{÷îýèÑ#BÈöíÛïÝ»÷ñÇ[0*¡°lðÐú á‡9W׬¦9÷.™ « `Ó¬žÕÅ <@V·YZCzˆ­'=Äô,Ÿ%ð ËÏéü\À­V`°5ÍúÚ£\.///on177×ÕÕUó©H$’þeòäÉ:uÒ—F4Òœ9s¾ù曇šSH“PÙ8%ÉÀ¯_¿nfáͺº‘šÛ#ê hÀšKPÕÕÕµiÓF*•rŸÕ܆…&ðýh07 A@V€¦}@2ryM ß¹sç´iÓš6—Gùá‡,Rà‹/¾øÍ7ߘ_T“b=zTUU5bĈ 4ÙkþZ6æh~¥/XÎÎÎååå7oÞ¤O=êçç×B×L„ IDAT¬« …t0ŸÕ°G§N>|8û´¬¬l̘1R©4<<|ûöít¾dMMÍÂ… }}}½½½çÏŸ_WW7räȺº::4??_»XÍ©”Ú§kYQQ1nÜ8zÅ3gÎhî6lØÉ“'9‚ß¶m[pp°»»{@@À† ŒÕÑÑqêÔ©ÙÙÙl¨›7o ¢¿ÜúðáÃ)S¦xzzúúú¾õÖ[ ô˜;vËd²E‹Õ××뫚f]ºtѼz\\\ll,ÿ‹/¾¸gÏŽ1¹‚ü÷!dÓ¦M~~~ÁÁÁ—.]¢[¶nÝÚ±cG‰D2xð༼<}•‰D³gÏÞ»w/=àË/¿œ3gŽfÉÆÔZûêDWWrWÓ®“2FZÀÎá& ÈêðÁ´H-4çE©T„……±[æÍ›çëë«P(’’’¾ýö[ºqÉ’%J¥òîÝ»}Z"‘ÔÔÔˆÅbvã•+W:w“ãâ➘““CñüË?þÈÀ}ú£G éÞ“'OJ$¶Ø¬¬,©Tª¯FUUU®®®ûöí«®®¦[ †ªgTTÔõë×Ù>d¡IHáááôvã©S§"""t^®IMŠa˜!C†|ÿý÷ Ãlܸqâĉ=bB­Õô¢UUU Ãdddx{{79 %%¥mÛ¶:+Å0lذ_~ù%..nÉ’%999ìÕìVí«ëìJîjšÌVÿŒ|«`«:«MÓ°zØÂbÝæ\g™°ýÔÔ"§ó=Ëg Ñ,³ººÚËËK_ð‡þì³Ï–.]Ú£GO?ý4 À`¨Mâd7z{{ë ©´´”âääÄnìØ±cII GÕ4 lbæÌ™˜õóóS«Õ4G)(( „øúúŠÅâÂÂB¥R©T*+++ËÊÊŒÏ^é<ÝëççÇ0LQQ}zÿþ}Ís³³³{ôèÁQøèÑ£ýõ×òòò˜˜˜ØØX3CeCR«Õš!µmÛ–ÒÐÐÀnÌÏÏoÛ¶-wÕ(í«Ož<ùܹs©©©·oß3fL“½MzIJlѾЦT*.\¸{÷îÊÊÊóçϳŸð›TŠ=~Ò¤I§NrqqéׯŸÁ°©µÎ®ä®& ß­°ì‚€¬.ZÕºº„Ñ£G_¸p>–H$/½ôÒªU«ž!« `æÏŸÏþ*!dçÎ¥¥¥~~~QQQ“&Mrrr"„lÛ¶ÍÉÉ)44ÔÃÃãÙgŸÍÌÌôññY¼xqXX˜——W~~>÷%´O×Ü»cÇŽŠŠ ??¿èèèéÓ§³ÛëêêN:5cÆ Bȃú÷ïß¤ØÆÆÆuëÖùûûK¥Ò;vìÛ·ÏüP©]»vÕÔÔ„‡‡GFF®^½šâììa®.€±ÌùçRËýcŠû»Òø‡@˱Ûñe·hå¬>6M Àêa æê6 &ýñs:ÿг|–À3t.?§óOp·rl{:Y;»ÀO.7J€ …ØÌ=·UèY°Èê4ÿoš{E¤„@ÜÀ Ü(€2b¶ = 6/c°7XWÀ6q¬m———çëëk‘«äææºººZ¤(c®%•Jù¹€aY[(¬« 6ƒ&k7›X»‹Ldíf€Ö sušÇ´?«ü¬««‰^KçÞN:•——[<Û››Û½{÷ÚÚZ«ÐðÁ ÂôÁkÃ"D¢V÷Û6­-j…=˲‡¹µÚÆoQöгÀ suø`ÚYM›ó‚ÿè¶„††k‡ö“Ý@ ðLf?øì§¦”ýÔ×~jjŸÐ¿Ðj!« `;Œü4Å.›@lÚ´ÉÏÏ/88øÒ¥Kô€>úè•W^a5jÔ®]»!>œ2eЧ§§¯¯ï[o½Õ$ѹeË–ž={–––ÖÔÔ,\¸Ð×××ÛÛ{þüùuuuMغukÇŽ%ÉàÁƒóòò8"©¨¨7nœT* ?sæŒÎêTUUÍž=ÛÛÛÛÓÓsæÌ™:ãÔWþ¶mÛ‚ƒƒÝÝÝ6lØ@9rd]]T*•J¥çÎsuuݼysPPÐìÙ³5—›Ð\B;ÍBòóó öo2ƒp£žÙáëÍNªl'ÕÔÔ «Ür+B´DÉM.ÑJ´Ân%-Öþ-Z8ÓÊzÖ6 « À‡–žukò-R¥RUTT”””Ì;wåÊ•tãÔ©Súé'•JE©¨¨¸xñbLL !dÞ¼yb±¸¸¸8++ëÒ¥Kü1[Îÿûß;wž;w®mÛ¶K–,Q*•wïÞ}ðàB¡X»vm“‹†††¦¦¦*•ÊðððeË–qD2þ|OOO…B‘˜˜¸ÿ~U˜?~mmíýû÷+**–.]ª/Níò+**–,YrèСšššììì#FBNŸ>íââòèÑ£G«TªÜÜܼ¼¼/¿üR_jФæw Ø5¼ãB:Ìa/{¨£6{¨µ=ÔQ›½ÕÚêku´A-—ƒ°1æ k 7×ÍÉÉqqq¡!UUU Ãdddx{{³ÇôéÓçØ±c Ãlß¾}̘1 ÉÛOMô¬M³«úÚUe…Ží&ÌÕàƒæÀ3s^\\\<<<!nnntr.õòË/Ú˜ “Ý@ L{·À²í?¶];n¶]wÛ®7{«»m××¶kgÃÕ¦L™òóÏ?ß»w/99y„ „???µZ]TTD¸ÿ~Û¶m !NNN'Ož|óÍ7/\¸@ñõõ‹Å………J¥R©TVVV–••i–¬T*.\¸{÷îÊÊÊóçÏs|üóóócFóŠáˆS§Ñ£Gÿúë¯ååå111±±±„ó™³³sCCƒZ­&„( }p`]H€A¸Qoìü•fÃÕ·áªÆ«oÃUÓÉÞê«Éžë.,Èêð¡¥×Õµ¸®]»¾úê«#GŽ”Éd„‰D2~üøU«V=yò¤¼¼|Íš5Ó¦M£0àû￟:uª\.—H$S§N}ûí·éÝ¢¢¢sçÎi–¬R©}||T*UBBG ‰dܸqì×­[§ó˜I“&-_¾¼ººº¡¡!99™#Î&Š‹‹Oœ8Q[[ëäääááAÓµÞÞÞ*•ŠNïm"00P*•Ò‡¿øâ }p`&»€@! æ³Õ—­ÖËx¶Ú¶Z/ãÙ[ ØU}íª²Â…¬.è6uêÔsçÎM:•ݲk×®ššš€€€ðððÈÈÈÕ«W³»† ¶wïÞ &ܸqcÛ¶mNNN¡¡¡Ï>ûlff¦f±þþþ«W¯8p`DDD¯^½¸cرcGEE…ŸŸ_ttôôéÓu³}ûvGGÇ   ??¿-[¶pÇ©©±±qݺuþþþR©tÇŽûöí#„øøø,^¼8,,ÌËË+??_óxGGÇÏ?ÿ|Þ¼y¡¡¡ä@³óçÏûúúrW€7H€A¸Q?/ 6Ú6Y©æ²ÉF°ÉJq°«úÚUemŒoÚŒDït|ó¯ÈÌö£…ÆWë¶­?Bû$б)а­Å–š‹#‰`ÔÉ–zPô¬­²·žµ«úÚUem{Ïq²v$À{øÈfÂøÁ¾Æð’³1š]‰Îµ%ö6fíª¾vUYƒ¬.L»9âf `‡0ð@ ðQ€OÈêØ d[À Ü(Y]>˜ö s^ì>n\|r°vÀ‘H„Ÿ¸n¸Qæêðëꀑ0ð@ ðU>!« `/mƒp£duø€uuÀHø P¸qð ëêØ ,— áF ˜« À¬« FÂÀÂW ø„¬.€½@¶ Â@ÕàÖÕ#aà€@áÆÀ'¬« `/°\&„€ `®.°®.  _5಺öÙ07 A@V€XWŒ„…Wëך×ÖhͱYœ]U–ØS}í§¦ÄÎ*K쬾vUÙÖ¦¹ï¦°®.€½Àr™`n‚€¹º|Àºº`$ |(|Õ@(ÐG­iÿSGVÀ^à“<„€ « À¬« FÂÀ €OXWÀ^`¹L07 AÀ\]>`]]0>¾jÀ'duì²-`n‚€¬.°®.  7.>a]]{å2À Ü(suø€uuÀHø PøªŸÕ°ȶ€A¸QV`àÃ0&|FÂW ì>”iïvZȦM›‚ƒƒÍ)!..®[·n–ŠÀâÕ°H€A¸Q€€Ìš5KôooïÙ³gWWWÓ])))}ûö5§ðÅ‹'%%ÆèÑ£57~ÿý÷40…BaNüÈÍÍ}ýõ×CCCÝÝÝ=<<†úå—_ªÕjkÇ\Õàƒi0çÀaà€@! ü“ËåsæÌ)...((HHH8pàÀ‡~Hw¥¦¦š™Õõôôôòò22ŒŒŒ vKuuõ²eË‚ƒƒCBBüüüÌ ƒ?ÿüsÏž= ¶nÝzëÖ­¤¤¤Q£F­Zµª¾¾ÞÚ¡duìRÆ`n •••·oß4hP@@@‡bccûöí›––F©­­ÍÊÊ¢YÝÔÔT‘Htÿþ}öÄ^½z­[·Ž>¾}ûö„ $I‡vïÞ=vìØE‹ÑÄbñÿþ÷?BÈãÇ¿úê«ØØXooo™Lö¯ý«IóæÍ+***//§?øàƒÎ;‡††FFFÒ-%%% ,hß¾½³³sŸ>}~ûí7ºa˜ 6tíÚÕÙÙY*•0àöíÛÛ7nÜØ¯_?‰Dâêê­™JÖWînܸ1uêÔ×^{íçŸ1bDPPPÏž=W¯^™™éââB),,œ3gŽ¿¿¿««ësÏ=wëÖ-z"G³è ž»#hƒïܹsÊ”)íÛ·ÿî»ïªªª/^ìçç'“É>úè#ƒu¡…ìØ±cÊ”)Íz-²º|Àºº`$ |(¤ƒ€g))) ðr†)-- $„ddd444Ð])))>>>;v¤‡ÕÖÖffföéÓ‡RPPåëë+—Ë?¾iÓ¦ÄÄDzVzz:[BzzºZ­NHH˜4iRZZÚªU«âââØä& ãå—_öôôLOO§Wß¾}ûæÍ›SRRhV·¤¤ä™gžQ«Õ§NÊÌÌ6lØøñãi 8!!!!!!>>>''G.—¿òÊ+tn¯¾íuuuŸ}öYvvvbb¢››[ll, ƒ£.Ü,[¶,$$ä“O>iÒ¼mÚ´!„äååEFF2 sæÌ™ŒŒ WW×Ñ£GÓ9¼Í¢3xŽŽ`|ëÖ­sçÎMOOŠŠZ´hÑ”)S $—Ë_ýõ>ø ¨¨ˆ».´õë×Ož<Ùb¯3€ÖŒãð?dÌ¿"†9@Ëi¡ñÕ¢ÃÖ"…ãÆÐ:Yjlò<ÆqKi3› ­ 6&>>ÞÉÉ©¶¶–a˜ªªªwß}×ÑÑñâÅ‹ Ãlݺ5 €¶páÂ矞=+99™RTTÄ0LLLÌ /¼ÀîÚ·o!äêÕ« ÃlÙ²%00nß´i“££cVV}ZRRBùã?Ø0Ú´iÃ0̰aÃ>ýôSµZ=xðàwß}—N­ýí·ß†™4iÒ¬Y³Ø 566ŠÅâŸþ™a˜Q£FMŸ>]»vú¶kúᇤR)}ÌQŽîÝ»Gùâ‹/ô]â…^˜0aû4%%…-–£YtÏÑ ÃlÙ²ÅÉÉéÖ­[ôéÑ£G !ǧO³³³ !éééu¡…ˆD¢K—.q·@+Ô¬¿ÑìÁNæå„À(tæÓÌ ,Í=l>”iïvLvåÊ•ÆÆF:¥ôÉ“'=zô8~üxtt4ùûO¥¥¤¤ >œ=+55µmÛ¶íÚµS(?ýôÓ©S§Ø]2™L,÷èуü}YÞk×® 2$""‚>ÍËË#„tîÜ™ £ÿþ„~ýú¥§§ïÞ½»  àÃ?ììì|øðaöZõõõîî'.\¸0''gâĉ111¡¡¡ôÛ‹‹‹ãããOŸ>]RRR__ßÐÐðôÓOB¸ëÂÀÕ«W !QQQ:[øÁƒ¿þúëÅ‹Ù-žžžìcŽfѼ¾Ž`Ÿ:4,,Œ>½wï^ûöíÇŽKŸæçç‹D¢îÆLMMŠŠzæ™gtVÀö`{¡ù¯]p£¡Ëå3fÌHKK»~ýúŸþ™––6jÔ(º‹ÍÉÖ××_¿~ýš?=‹>½víšZ­¦ Y*##£[·nÎÎδö¬ÔÔÔ²‡¥¤¤±¿&—Ëi!}ûöMJJZµjUBB‚D"‘Ëåiii äý]NNM@Ï›7ïÎ;¯¼òÊéÓ§ÃÃÃ÷îÝK‹ÕÞ®T* pçÎO?ý4111--mðàÁýúõ3XŽžùä//¯:Œ;ö›o¾!„äääÐ]?üðCpp°‹‹Ë Aƒ:äààššÚ¤„]»vùøø°¥=~üØÑÑñĉlíÚµÓŽ!==’œœLŸ¦¦¦>ÿüó‰ÄÉÉ)$$dÖ¬YJ¥’a˜5kÖDDD8;;»¸¸DFF:tˆ¯s{ccãÒ¥K%‰L&›2eÊŽ;ª««¹ëÂÃ0*•*>>¾[·n...ÎÎÎ:uš={öõë×éÞË—/GFFŠÅbÿyóæ•––l}•âèˆ&¥%%%BÊÊÊèS¥R)‰Î;Ç]—&ý ,ÍúÍ,bð=)ã˜ó Öúýün @˱Ûñe·hå¬>6M Àêa ‹™Í…Öà÷ÕW_egg[; °¥ºØ‰fýfvjÙ €"´\0X>n\ ,—/_~ðàAdddmmíwß}÷ñÇ?~ÜÚA™È–êÆCVÀ^ e áFv¢¨¨håÊ•ùùù®®®<}úôСC­”‰l©.`<¬À`,¬Àš„8¾,³+`,56M.+0ð+0Ø$¬À\ðI Â@Õàƒ°fø€aà€@áÆÀ'k<‰D4k  n‚€¹º|0mòæ¼Ø! |(|Õ€OÈêØ d[À Ü(Y]>`]]0>n\|ººöËe€A¸Q€½‰÷öööõõµv æÊËËÓY‹ÜÜ\©TÚ¢—6x îrss]]][ .sµÚÀš°xœ´¿„R}{†¬.Lû€Ä0 ¦½Ø |(¤ƒÌôÇŒ9ÒËËK*•FFFîß¿ßÚÙ…G½ÿþû)))ååå-t Þz¶S§N-W ¡03É[ S°duìRÆ`nVqáÂ… &Ì›7¯¬¬¬ªªjÆ gΜ±vPv¡¬¬ÌÑѱS§NM¶744X¤|îž58ƒµ¥çØ€ !« ÀÓ> aÎ €ÂÀB:À+V¬X¿~ý”)Sœ¢££÷íÛGyøðá”)S<==}}}ßzë­††:ÅoÓ¦M~~~ÁÁÁ—.]b Ù¶m[pp°»»{@@À† 4'²ùAºqó­à. IDATæÍþþþ!!!—.]JHHð÷÷ º|ù2[TMMÍÂ… }}}½½½çÏŸ_WW§]¾füÆkd™Ú[¶nÝÚ±cG‰D2xð༼þøcBˆJ¥ª¨¨())™;wîÊ•+é‘K–,9tèPMMMvvöˆ#ô]N¥R•––¿úê«S¦L©ªª*..^°`[!dÉ’%J¥òîÝ» „TVV2 sóæM‘HôøñcúØÇLJ\SS#‹‹ŠŠèÓ+W®tîÜY»|M‹5²L¤¤´mÛ–¶Œƒƒ[ÚéÓ§iíL‹\³•!>Ô×øF6 K_Ïj^FnÂ^Ž×ž£}ô•϶¶Î—œ¾K°š¹Î½úº[_´l‡ê«/ÇKBót}u×Wl³^šÒ÷bÓ‰­i“ÒtÞtže|‡lLÍ!fjÖßhö`ÌÕ°šot€>>>•••M¶+ ‘HÔ¾}{ú4$$¤´´”ââââááAqssS©Tt¯‡‡ÇáÇ÷ïßœœ¬ïr...2™ŒâìììîîîîîN³_N/++«¯¯ïÒ¥‹—————׈#*++ –Ï]¬‘eê¼Êž={ÂÂÂd2ÙðáÃ?~L[ÆÁÁ¡]»vôÒì·¿M‹¼I-¼½½9ߘ4س„aß¾}?~ìõ#÷RõÒž£}š«ÝÚD×KNß%ÌŒAç^}Ý­/ZîÒ¸›N›vÝ9ª`ükƒ»­Ø›‘5Õ'ÇY&t¨¾Z³C¬Y]>˜ö _°Cø PH˜ÌÃÃ#22òðáÃM¶ûùù©Õꢢ"úôþýûmÛ¶å(gôèÑ¿þúkyyyLLLll¬³³sCCƒZ­&„( ããñõõ‹Å………J¥R©TVVV–••i—߬:_f“-J¥ráÂ…»wﮬ¬<þ<½ÏЖ)))¡…X<òæ6¾Núz–B#LMM•H$Ê¿¹—¥¯^~~~ ÃhOèkÍëj·¶Nú.af :÷êënÑj¾‘渖¾¦3æ}¸Áf4†æ… ¾ØŒï“Ï2Ø¡©5X²ºö)c07 «øä“OV®\yèÐ!•JÅ0ÌåË—çÌ™#‘HÆ¿jÕª'Ož”——¯Y³fÚ´iúJ(..>qâDmm­“““‡‡‡Z­ ”J¥?ýô“J¥úâ‹/ŒF"‘L:õí·ß¦sñŠŠŠÎ;§]~³*hd™Ú[T*Ucc£J¥JHH`K{饗hËTTT°‹Z0òf5>=kB9Ú8ê%‘HÆÇ¿nÝ:v»vûh–©³µuÒw 3cйW_wëŒÖÛÛ›.nËq-ަÓ<£îÜÍhŒ&qr¿ØŒï“Ï2¦Cͯ5X²º|0íæ¼Ø! |(¤ƒÌ1lذ#GŽlß¾ÝÏÏO&“½ñÆ#GŽ$„ìÚµ«¦¦& <<<22rõêÕúJhll\·n¿¿¿T*ݱcǾ}û?ÿüóyóæ…††8°YñlÛ¶ÍÉÉ)44ÔÃÃãÙgŸÍÌÌÔ.¿¹u4¦Lí-þþþ«W¯8p`DDD¯^½ØÒvîÜYZZêçç5iÒ$'''‹Gn|ãsÐ׳æã®×Ž;***üüü¢££§OŸÎn×nͳôµ¶Nú.af :÷êìnÑúøø,^¼8,,ÌËË+??_giM×ät}u箂1š\ˆûÅÖ¬~1ù,ƒj~­ÁâDøè`$úAÅ´!cιæ°ÖuìÝŽ/»­8@+gõ±iZV[XÌl.´6تS§N-[¶,++ËÚÐÝ`“šõ7š=suø€uuÀHø PøªðéÆtª`aaáš5k&Nœh툠¡»tBVÀ^ e áF‚ððáÃñãÇK¥Òž={öîÝû½÷Þ³vDЂÐÝ:acaÐ$Äñe‘˜…Xq{`©±ir9XXÀ&™¶ƒSË­>É€A¸Q²º|Ö _°" |(ܸø„uuì–˃p£ÌÕàƒi“ï0çÀaà€@á«|BVÀ^ ÛáF Èêðëꀑ0ð@ pã಺¶«ã…”1„…ÍÃ;CÛ€¬.°®.I(Ihé`>!« `ËðÉ 4ážáFaÃй¶Y]>`]]0Rëø­96°"Üøä`í€'"‘+'7Ü(suø€uuÀHø P­ÿ«¶Y]{l „€ « À¬« FÂÀ €OXWÀ^`¹L07 AÀ\]>`]]0>¾jÀ'duì…E²-˜ÄÐú™3Ø‘–duø€uuÀHø P¸qð Y]{aÁ”1Ò7­“ù³éñ¿%A@V€ÖZW_”à¥2 Ȥ€@! À'duì²-`n6 ÿïhµLx†¬.¬»®.>ž´(Ë~HÆd7(ܸø„¬.€½@Ê ÂÂæ¡sZ“ç !« Àk­« ‚ƒ…t0ŸÕ°ȶ€A¸Q²º|°îºº ø P¸qðÉÁÚOD"~¸áF ˜« À¬« FÂÀÂW ø„¬.€½@¶ Â@ÕàÖÕ#aà€@áÆÀ'¬« `/°\&„€ `®.°®.  _5àæêØ †ap¨ââb‘HtåÊkb”M›6›YH\\\·nÝ,4 n‚€¬.Lû€„¯@Ø! |›1kÖ¬~ýúYª´ÔÔT''§?ÿüS¤ÇðáÃM R$-]º”Ý¢R©\]]·nݪyåíí={öìêêjƒ»RRRúöíkV… Y¼xqRR’™…Ÿà²ºö)c>ÉåòÈÈHK•–ššÚ¥K—aÆÿeĈC† aŸ=zÔ´ :¤V«é–ŒŒŒººº°Ì™3§¸¸¸   !!áÀ~ø¡Á]©©©ægu===½¼¼Ì,L€€ « ÀÓ> aÎ €ÂÀ· •••·oßf³ºJ¥rÙ²e!!!b±¸]»v|ðÝ^RR²`Á‚öíÛ;;;÷éÓç·ß~cKÈËË›0a‚D" Ü»w/Í“ºººüåæÍ›ƒ bŸzzzr”¶qãÆ~ýúI$WW×èè茌 6È÷Þ{¯¢¢âÂ… ôH¹\îââÒ³gOöz•:ÄÆÆöíÛ7--{WmmmVVÍꦦ¦ŠD¢û÷ﳑôêÕkݺuôñíÛ·i;tè°{÷î±cÇ.Z´ˆîª­­‹Åÿûßÿ!?vttüꫯbcc½½½e2Ù¿þõ¯è40ÒÁ|BVÀ^ eÌ›””†ahV·¢¢bðàÁééé{÷îÍËË;pà@çÎ !%%%Ï<óŒZ­>uêTffæ°aÃÆ_^^N)**ŠŽŽöòòJNN>qâÄçŸþÛo¿iÎ~-,,,..îß¿?»…£4BH]]ÝgŸ}–˜˜èææËù /Œ9òàÁƒôH¹\Þ«W/±XÌÀ^—a˜ÒÒÒÀÀ@î] tWJJŠOÇŽéaµµµ™™™}úô!„DEEùúúÊåòãÇoÚ´)11‘-0==-$==]­V'$$Lš4)--mÕªUqqq–ï3ø n‚€¬.°®. ß6Èår777úc_K—.uww?yòäð႞}öÙÙ³gÓíC‡ݵkWÏž=;wîüÙgŸÕÕÕ]¾|™òæ›ovïÞ}ß¾}Ý»wïի׊+*++5Wé½zõ*!Ds…ŽÒ!+V¬6lXPPPÿþý.\˜››Kƒôññyúé§§Núã?644¿/!—ËœœzôèA©®®^¹reaaáÂ… ¹w¥¦¦´oßž’’’Bs¸MøÒ-o½õVŸ>}vïÞݵk×Þ½{¿ýöÛUUUlV755500ÐÏÏ>vtt}ËÊÊììì|øðavc}}½»»»B¡8|øð©S§Øí2™ÌÁÁ¡wïÞì¹\îëëb°4BHqqq||üéÓ§KJJêëëž~úi$í;a„ùóçŸ={6:::++ëwÞakÑØØØ¦MBÈ“'Ozôèqüøñèèhî]š?•–’’¢ù3n©©©mÛ¶m×®B¡øé§ŸšÔQ,Ó41ùûʼ׮]2dHDD}š——׬¾€æÂ@Õàƒið ÀaàÛ¹\CIKKS«Õƒ jr@ZZÃ0iiiŽŽŽšÛƒƒƒÏŸ?¯V«5çá^¾|9,,L"‘°[®^½ª¹üGiJ¥rÀ€½zõúôÓO;vìèââ²`Á‚:Ð é¬a™L6jÔ¨ƒº¹¹566jþTÚŒ3>üðCGGÇ6mÚÈd2Í êÛ•šš:fÌBH}}ýõë×—-[¦y¨{íÚ5µZ­Y…ŒŒŒnݺ9;;³…¼ôÒKìã_|‘=2%%%((H_˃! À'duì²-ü(---(( iÙÆÆFBHMMæ1 ÃxyyµmÛ¶Ééõõõ„?ÿüÓËË‹¢T*wîÜùÜsÏisõêUö‡Å¸K;tèPqqñ;whÂ4'''))é“O>Ñ ’2uêÔ×_=44ÔÃÃ#<<œ­ÅóÏ?OWÖ® Î]õõõ7nÜxï½÷!÷ï߯««ëÚµ+ÝU]]}ìØ±ùóçBèjÕÕÕÞÞÞôÁ®]»^xáÍBèoÊ©Tª›7ojþ<ÚÕ«W5£‹Ã@°®.°®®iŠ‹‹E"Ñ•+Wx»â¦M›‚ƒƒÍ,$..Ž.¦ ` | —ËÉ_‹Þ4ÈÓÓsÉ’%ׯ_ÏÏÏ?vìØO?ýD‰ŠŠòññ™5kVJJJaaáÕ«WãââÒÒÒè‰...+V¬¸sçÎ¥K—&NœX^^®ùSiwïÞ­¨¨ÐœÌËQšL&kllüúë¯óóó9£R©úõë§$!dܸquuu7nìׯŸƒƒ[‹ê« Î]7nÜP©T4Z™L&‰’““ !EEEÓ§O///§suiW­ZuçÎË—/7®¸¸˜]—BŸÞ¸q£¾¾^3›’’‚¬në„uuø„¬.XÒ¬Y³,øa;55ÕÉÉéÏ?ÿ项\c³‚dKðööž={vuu5Ý¥¹¤É/^œ””ÔÜ0¦NªP(̼´e%$$°«vRM‚€”1?är¹§§ghh(!ÄËËëÔ©Sååå  [³f +“ÉΜ9£V«‡ 2yòäììì§žzŠâïïÿÕW_%''wëÖíÝwß]¾|yCCƒæ­‰&U5—/à(m̘1K—.}ã7zôèñÝwß½ñÆt‰^¹\Þ®];ú›f„©T:vìØÒÒRÍŸJ“Édìj¶M*¨oWjjj›6m:vìH+²~ýúU«V-X°`Ú´i„š«õóóûú믓’’ºuëööÛo/]ºT­VGEEiBÿÇvíÚ5ZBHMMMVV²º- 7 °7æOìÀ¬ŽfÑœ»c‘Y5vK„ÿ¨ÉœÕ⬵Òÿ׈ˆ>|ø¶mÛ,RÚþóŸ~øáÊ•+J¥’n™5kV]]Ý÷ßOŸº¹¹yzzšä Aƒ>þøã†††³gϾúê«o¼ñÆgŸ}FéÙ³ç¤I“è×~[ZDDÄСC×®]ÛØØ˜œœöòò7nÜæÍ›=<<!sæÌQ*•ôË4¦©¬¬¤K!<²¼¼ü£>:vìØƒÄbq§NfÍšµbÅ BHBBBBB½{÷LÃ|³fÍÊÌÌLIIa·444Èd²÷ßÿŸÿü§¥®òË/¿üãÿ¨®®vuu5¿ñl@sÿ@³Çc®.XLeeåíÛ·Ùy^J¥rÙ²e!!!b±¸]»vlª´¤¤dÁ‚íÛ·wvvîÓ§Ïo¿ýÆ–——7a‰D¸wï^úè®®®¹yóæ AƒØ§žžž¥Ñ¯K$WW×èè茌 6HZH‡bccûöíK¿§\[[›••E'Ä¥¦¦ŠD¢û÷ï³¥õêÕkݺuìÓÛ·oÓP;tè°{÷î±cÇÒ5.kkkÅbñÿþ÷?BÈãÇ¿úê«ØØXooo™LÆ. IÃ9rd@@@```LLLxxxyy9[>G½îÞ½#•JýüüâããÇOש4³¾2†Ù°aC×®]¥Ré€nݺ%“Éûì³ìììÄÄD77·ØØX6H¶X†aJKK !ìלSRR|||è—ˆ !µµµ™™™ìšQQQ¾¾¾r¹üøñã›6mJLL¤'¦§§³…¤§§«Õê„„„I“&¥¥¥­Zµ*..ŽfiC‡%„<~ü8!!!;;ûÍ7ß4X¯¢¢¢¨¨(OOÏäää3gÎ¥_ã¢MdÂkCg„:7r_Z;N‹°ì@kÑak‘Âñþ 5Ü›ÜRšÅÌæBkƒÝ:{ö,!D.—Ó§jµ:88xæÌ™Ì_ï™ †Ù±c‡{Ö“'Oœœœ~ùå†aòóó}}}çÎ{óæÍk×®õêÕK&“íØ±ƒa˜Ë—/BÊÊʆ¡¿®Ñ§OŸcÇŽÝ»wf„³³³iK—.‹Å×®]kžZ­ÎÍÍÕœQÁÛ©S§ï¿ÿ>??ÿþýûÅÅÅ;v|õÕWÓÓÓsrrÞ|óM©TªP(h!ëׯ?þ|~~¾\.1bDïÞ½ÙBúôésòäÉ;wîLš4ÉËËëÅ_Ü¿ÿÝ»wW®\)‰hÝÙVÒüTÂ0ÌܹsÃÂÂØ§:¯Â]ñÂÂÂvíÚÍž=ûúõëiii}úôñôôܸqc“Æç¨]“¦0ïµÐ5÷4{<þ¨Ëœ÷ÁÖzÍóucbbÌ0Lii©ƒƒÃñãÇ›@·»ººJ4BΞ=[VVæààpúôiöà_~ùÅÁÁáÑ£Gì–ýë_¾¾¾Æ”Æ0LQQÑo¼áåå%‘H\\\ºvíJƒ‰Dô`‡^½z|8{ØüÁ¾á‹‰‰™0aBNNÎõë×—/_N¡éÑæ¶ÒÏ?ÿìèèXSSÃ3w[íܹÓÁÁ!222>>ž®lÀ0ÌçŸÞ±cÇ&ýËÑtÑÑÑ쑚5b&77—¦VMxmè‹PçFŽKkÇi)úŒ¬.€Í³bV×´qKiduLcþÄógu0 “™™F Ÿ?þ±cÇé.íÚÓL˜Ñ²eË''§[·nÑíG%„°oÅéŠöééél+]f̘¡³UÙ«pWœcîŽfãsÔ®…ff´&gutZÈåò˜˜BHZZÚÿkïÞÛªò…ï´i¤·”¦E´9B«êáöm‘qGà•ÑG¹ÁA}Ž0ÅQ^F¼”‚(GÇèt8ÎŒð ryŠÈEQRhÚ¦¦¥ö’¦ÍûÇ~Ù“ÉÞIv’6Ín¾Ÿ¿’½×mg­&«+ë×ÞÞ~÷Ýw»œðÕW_9ޝ¾ú*22ÒùxZZÚ¾}ûÚÛÛ¥=yA8tèРAƒÄ©=ÑÑ£G·_ðšÕj9räwÜñꫯöë×Ï`0Ì›7鍊n ùÐC=ÿüó‘‘‘½{÷Ž‹‹“.<~üø}÷Ý'Bkkë7ß|óä“O:WMÚÊàË/¿loow.É×_=xðàèèh1‘ûï¿_Jðg?û™tÚ±cÇRSSÅ]Ž9²`Áqç—_~yÇŽ7nÌÌÌôµ•¾úê«ôôôž={z.³‡4A˜3g΄ vîÜYXXø›ßüfóæÍ<òȱcÇ\¢Ì{nºŸÿüçÎ "ÂСCDGGßzë­ðõ½á®„Š=d-/grðãhÞ0Pè~¾øâ‹¶¶¶Þ½{ ‚ÐÔÔ4dÈ¿ýíoâgïcÇŽI;;vìž{î‘®:~üxJJÊ 7ÜP]]½cÇŽ]»vI/ÅÅÅEEE 2Dø×a¿üòˬ¬¬ŒŒ ñiii© âg~An½õÖÓ§O9rdß¾};wîœØ´iÓOúS)1ö—ÍfûöÛo÷“:zô¨8O*CšyÔétS§N}çwÚÛÛ#""¼¶R}}½ÔJùùùãÆóZfiŠú÷ï¿`Á‚ Œ?~ïÞ½<òÈW_}5}úté¯Mç\Ó¨¨(AÄ™ßööö×^{-''§W¯^~¼7Ü•Pñ ‡¬åå MÚêø aà²\ØÑ!«:D:näÈ‘#GŽ|æ™g{ì±Í›7×ÕÕÅÇÇËWT¸,GðoE‹¼<£Fr~zË-·H­qäÈ‘éÓ§‹ó­"q±­¸Ó®‡\·Ä3fLbbâ/ùËcÇŽ]¾|ùèÑ£«V­ÃŒ1Â`0<óÌ3çÎ;xðàôéÓkjjœC¥?Þb±8 ðZ\\\[[Ûûï¿_^^þ—¿üeÚ´i6›mذab!?ÊHNž÷ÜsñññíííâÓƒŽ3¦GƒA `*?~üøøñãF£^¯ïß¿ÿ/ùK«Õ*¾´uëÖÔÔTƒÁ0f̘¿ÿýï‚ ìÙ³GJëÖ­Âõ­ô%îRkkk[´h‘ÑhŒ‹‹›1cFAAADDĵkמ{¸8©Î6mÚÔ»woééK/½”pÓM7ýâ¿øãÿ(ÂÙ³g¥W·oßž––f0î¾ûˆãÇ»$²iÓ&ç` bXØ?þXl+“Éäœ{ss³ÑhüÍo~㵕>üðÛnºÉ`0dffþõ¯Aj[Ïev—æòåË322¢££ È# ¥Œn¼ñFN'¾éD‡1bDTTTrròœ9s®^½*½äë{C±„îŠí!kÅrv ý=í¢j¨¾@ ¼‡ú‚2¤ø$À梵žÄÏÌß}÷ü¥ãÇ ‚pá‡ÃqõêUN—ŸŸïp8._¾,.¿Ý¶m›Ãᨪª2 >ø`IIÉÁƒÇŽ«×ëׯ_/¥PVV渤·´´TJÿöÛoá…ÄdzgÏ^µjÕ‘#G.]ºôÕW_=óÌ3¯¿þºøjzzú¬Y³.^¼(áp.˜¨®®.11ñ§?ýéÑ£G/]ºtäÈ‘•+WŠ×Ä ¾ýöÛeeeEEE·ß~» ÅÅÅb"R¬iñûˆÃáp 0àå—_vn%i^ÑC=$ÅCs—‹çŠ_½zÕ`0äää”””üãÿøÉO~¢×ë_yå—:z¨¼)€îÇ×?ÐÒùüQÔbVŠV®\™žžÞ%YïÞ½[„~ø¡Kr‡$Ü:Z¸ÕЖ.ì¡Ì곺€:daG€«:Ç+¯¼2zôè„„„ˆˆˆÄÄĉ'îÚµK:ÙeE…âr_W´¸”çóÏ?®‡nv8V«U§ÓIËh\Öèˆ 4wî\ñ±»\¼VÜÝÚ—:º«]ç­ÌB‡ß³º:`ê³ËÀsdƒÎÎpèСK—.1¢¹¹ùÃ?|ñÅÿö·¿M˜0!ø%yùå—óóóÏ;ü¬á¬c;ZèwÛÐ/!Î4×C5Wà®`sÑÚ@‡XµjÕÿþïÿž>}º«  ›ðõ´t>ÑÒÀ7K–,)//ïѣǨQ£vïÞÝ%%9qâ„´s. ßçxÅ@.Wutu¡@`­. V _rºê _Ì€ ÐPGë¢j¨¾@êÂúøw!CŠOX« t‰¢¢¢ÿþïÿ–Vu<÷Üs]µª@·ä÷Z]fuµ˜Õ (Ü:Z¸ÕЖ.ì¡Ì곺t?ìÀ„4mÍèBt|ÅÀL]]$:Nœ5w(4µº@0ø·øŽ5/@¢ãÐ(~jL¬Õ \8&\xÆ@!WZZš””ÔÕ¥øÌêÁàß$~ „!:> ætpII‰N§‹¹îöèÑÃÝ«¢}ûöeggÇÅÅ™L¦©S§~ÿý÷îR6£Fúæ›oA0`@MMMpª ³º„ ¦Œx¥•Â`04\·}ûv5¯îÝ»wÚ´iO<ñDmmmEEÅØ±c³²².^¼¨xm}}ý„ æÍ›ŒÊøŽY] üû‚ÄO 0DÇ Q¡?¼dÉ’U«Våääèõúž={.^¼8''gåÊ•Š'GFFæææž>}Zø×UÀ=zô(((HKK‹‹‹[°`Akk« óçÏOJJ2™LsçÎmii f½@xbV€pÁ”1¯ºë@Q__ôèÑ3f8ÌÍÍýì³ÏÏ·Ûí|ðAFF†Ëq›ÍvàÀ3gΜ;wîĉ«W¯aáÂ…V«õüùó—.]ª®®^±bE'Õ@¬. ì« @%:> òtpKKKÂuEEE^_­­­ŒŒLLLt>-99Y¾a®xmRRÒ6nÜèòªÃáX½zuÏž=ÍfóóÏ?ÿÁ455½ÿþûk×®5Ë–-Û¶m[GWÀ•¾« ‚Dœ/î–«ðt­ ƒÁjµª511±­­­¶¶Öyb·ªª*))ɧ”õz}ß¾}ÅÇýúõ»råJUUUkkë­·Þ*t8ƒÁ×êøŠµº@0°¯.•èø4*Äj7|øp—U´[·n?~¼OéØíöŠŠ ñqyyyJJJRRRTTÔåË—­V«Õj­«««ªªê°r¸Á¬.á‚)c^uãbÍš5yyy………v»½©©iݺu………Ë–-ó)N———×ÔÔd±XV¬X1sæL£Ñ˜››ûÔSOÕÕÕ ‚PQQ±gϞΩÀ?1« ûêP‰ŽßUJKKå?ÄöOIII=:$© “Jî\…«„Ö$‹’’’˜˜˜3òðæÑî›Á¡?ì« @%:¾¢ýû÷O™2eΜ9UUUõõõ¯½öÚ§Ÿ~ÚՅꃡáºíÛ·«yuïÞ½Ó¦M{â‰'jkk+**ÆŽ›••uñâÅ —áNÓÁݳº€Ÿøê@s´;eüÌ3ϬY³fÆŒÑÑÑ™™™[¶l¡¶¶vÆŒñññIII‹/¶ÛíâÎõë×›Íæ´´´ƒŠ)Ü{ï½---â*×òòò·Þz«_¿~F£qôèÑ¥¥¥‚ÒžòDòóóÓÒÒzõêÕ§OŸ×^{͹„.é ‚ ¿\„ÆÆÆùóç'%%™L¦¹sç¶´´Þ8K–,YµjUNNŽ^¯ïÙ³çâÅ‹srrV®\érZ}}ý¬Y³L&S||üÃ?,‚¼<(((HKK‹‹‹[°`Akk«»Ëå¹8{óÍ7‡zõêUéˆØÔo¼ñFrrrÿþý<¸víÚäääÔÔÔC‡‰ç(6šÊ—¿CA°X,“&MЉ‰IOO—ÿ{`ãÆ3gΡ­­-66ö¹çž¡¼¼Üd2µ··+fäüæQlŲ…,ía…Y]Àgîæsuîy=¡“·at:¯Üµk׎92mÚ4ùKsæÌ‰ŠŠª¬¬ºdÉñÌÝ»wK ]ÓÒÒxüøq«Õšžžþä“OÊS–'b±X.\XXXØØØxúôé &8Ÿï’¾bAX¸p¡Õj=þü¥K—ª««W¬X`ãÔ××=ztÆŒÎsss?ûì3—3çÎÛÜÜ\VVf±X-Z$‚×Fpnœ9sæÜ¹s'NœX½zµ»Ëå¹H^yå•7îÙ³'%%Å%ñ«W¯VVV>öØc3f̨¯¯¯¬¬œ7ožÔnЦ²Áß!sçί®®>pà€|+¬¬¬ââbA¾üòK³Ù,>...ÎÌÌŒˆˆp—‘‡vözI·ÓÁöv6uºº³ú¯«[èæ:¶£uj·íă?°\¸pA¯×Ë744DFF^¾|Y|ºsçÎôôô³gÏ ‚P__ïp8¾þúk“É$¾zöìYƒÁ O䨱c))).'(&R__ߣG-[¶\»vMžŽ×ËGcccTTTEE…øô‹/¾¸å–[\!þº?ÿùÏòd_u8çÏŸ—7ΩS§<´•×Fç+]»k×®ŒŒ ÅËs“úÝï~7|øðÚÚZy» ‚PWWçp8¾ýö[N÷ã?Š=4ššW|‡ÈF—R™ÍæÒÒÒW_}õ…^HMMmii™?þš5k¼¾»ä-àî’Îx r糊Ol.Z€äëhé|}GNaÀáp¸[Fçp?ó+^âá„NŠ?@s‚?P„¾ÄÄͶ¶ºººøøxçãÕÕÕ:®oß¾âÓþýû‹?í7 ±±±‚ ôìÙÓf³)¦¹yóæÕ«W_¹rEpÓæòDbcc‹ŠŠ~ÿûß/Z´hÈ!¯¾úê¨Q£Ü•Y± UUU­­­·Þz«øÔáp ù…V«UzZRRâáU©qjkk¥ƒUUUIIIΧ¹´•ÊFèõzéÚ~ýú‰—È/WÌE»Ý¾nݺ7ÞxÃd2É7 qqq‚ DGG÷êÕ«W¯^âcq§5&¸ipÅwˆü <µÌÌÌââââââ§žzêØ±cG-..ž={¶»Œ$Š- æ Ù=tÕ§€ðÄ €Ïœÿ7¢Ñá+66vĈEEE.ÇÍfs{{{EE…ø´¬¬Ìå§ýΜÿËeµZçÏŸÿöÛo×ÕÕíÛ·O}›Lœ8ñ“O>©©©™6mš8ǧ˜¾;IIIQQQ—/_¶Z­V«µ®®®ªªJeÖîÄÅÅ >|Û¶mηnÝ:~üxç#f³ÙápHm%øØv»]º¶¼¼<%%Eñry."½^¿sçÎ_ÿú×û÷ï÷µ‚îMMƒ+¾C\ YVV&¿0++kÿþýG9rdVVÖŽ;.\¸0lØ059*¶€¶ht 7Ìê~òé;_Ø^Ct|E/½ôÒ’%K m6›Ãá8tèÐ#н1« ƒ_BdÍKdddnnîéÓ§…ë«>ßxãÔÔÔY³fÕÖÖΘ1#>>>))iñâÅÒŒ[}}ý¬Y³L&S||üÃ?,Bccãüùó“’’L&Óܹs[ZZAÈÏÏOKKëÕ«WŸ>}^{í5Å#*/töÖ[oõë×Ïh4Ž=º´´TM]꥘©Åb™4iRLLLzzz~~¾¸TÖeoiý¬šbß{ï½---âª[1Ôçz)Z²dɪU«rrrôz}Ïž=/^œ““ãÒ]žÑúõëÍfsZZÚÁƒ¥ÓË좠  ---..nÁ‚­­­jÞ7nƒµµµÅÆÆ>÷Üs‚ ”——›L¦ööv5wÜ%•wÓåà›o¾9tèЫW¯ª©fGÑtÇÐ ¸…t©9§9;­óÚ\*ß `V”»Ñ݆Ýnÿàƒ222ħ6›­¤¤¤´´ôwÞ™3gNTTTeeå©S§<øâ‹/ŠçÌ;·¹¹¹¬¬Ìb±,Z´H„… Z­ÖóçÏ_ºt©ººzÅŠ‹eáÂ…………§OŸž0a‚üˆÊ ] ¡·Âïº'uä]¦³{SàÉ’ÂÙ³gAˆ3fÌ7ß|#¬­­u8 ‘‘‘—/_Ïß¹sgzzºü¸ÃáhllŒŠŠª¨¨Ÿ~ñÅ·ÜrK}}}=¶lÙríÚ5ñ¸üˆÊ Ý9vìXJJŠXlƒÁ ÕKzìRY±^Š™Ê+k4å)‹UÛ¥$jê%e!:þ¼^¯w9çÔ©S .W9R„úúz‡Ãñõ×_›L&ñ¸b™åM$µÀ®]»222Ô¼‡Ùl.--}õÕW_xá…ÔÔÔ–––ùóç¯Y³FåwÎÅ©š.~÷»ß >ÜÃÍõœ¬Î­sÿf‡’ÀÛM½sçÎõîÝÛ×¼^ÕUB¶`7#¤£#ÊʵöÌ]›( …j:÷ÐPè¿^…`‘B™×æ µxåëhé|Öêþèì%µª.Àb «ÕjµZ8pûí·KM&“ ÕÕÕ:®oß¾âñþýû_½zU~\„ªªªÖÖÖ[o½5!!!!!a„ uuu±±±EEEï½÷Þ7Þ˜™™yøðaù•º{óæÍƒ Š‹‹»çž{~üñGõ•류©¼²’ò¯Ø^OKLLlkk«­­uÉ=))ÉsMcccAèÙ³§ÍfóPf— õz½Ôýúõ»r加âý Bfffqqqqqñرc‡ vôèÑââ⬬,•wÜ9_ÙíöuëÖ=ýôÓn®É* ‘•PûqÁC"Áä5žt‚óþ^¯ Z A—Œ´ÐϧÆô*ôkÝ!ï‡P«¦}6DF3t¬®À@çaVð‡¯:L¿vìllp˜ÍæöööŠŠ ñiYYYJJŠxÜápHÇAHJJŠŠŠº|ù²8G\WWWUU%Âĉ?ù䓚ššiӦ͞=[~Dý…«Õ:þü·ß~»®®nß¾}~|QÌÔ¥Reeeâƒèèh»ÝÞÞÞ.BuuµOõ•ßhõR7|øðmÛ¶9ܺuëøñã¨yG¹+³3»Ý.µ@yy¹x»%îÞ‚ deeíß¿ÿèÑ£#GŽÌÊÊÚ±cÇ… † &¯²šbøD¯×ïܹó׿þõþýûUVÓož¿08‘ÊS®)ZŒ(èA7«NW Úà ¡Ï0ჿtcÌê¡Hó;F£qòäÉK—.mjjª©©Y¾|ùƒ>(ÏÉÉyú駯]»f·Û>l4sssŸzê)q]dEEÅž={*++?þøãææf½^ÛÞÞ.?¢òBçRÙl¶¶¶¶ÄÄD›Í¶víZÿê%ÏÔh4Nš4Iª¬ŽìÆoŒ‰‰Ù±c‡Íf{ýõ×=¤ /¶Éd²ÙlÒ‚VÏõrgÍš5yyy………v»½©©iݺu………Ë–-s>Ç%#õµv9G§Óååå555Y,–+Vˆ1МSP|?‚••µ}ûö †ìììüüü‘#GFGG«¼ãòÒú´¤näȑ۶mËÍÍ=räˆÊôâ_žC¼xîHw\| ÷'àpÏž=ÎïyE—@‚î"éycè.6£KÄH—ŒœßÀòƒîêè¡òˆ‚j6º ö(QlLwÅ¡ªªê¾ûîCJnذÁ%A¯7Ñ×êÈ#Xz¨‘,¹ÄŠt—¬šjzn¨Î£¾ûkt € î#ݳº€o<|>X)‹Ð_ó²iÓ¦ÆÆÆ>}ú¤§§1"//O<¾aÆÈÈÈÔÔT³Ùüæ›o ‚ŸŸ¯×ë;nܸï¾û®­­måÊ•ÉÉÉ111[¶l‘Qy¡s‘’““óòòF•‘‘qÇwøW/y¦‚ X,³Ùœ™™)MhFFFþá˜3gÎÀGå!y±üñAƒ%$$”——{®—;ãÆ+**Z·nÉdêÛ·ïÞ½{‹‹‹SSSÏqÉȧZ;‹ŽŽ=zô Aƒn¾ùæÁƒ/]ºÔåwîºËápdggK³²²APyÇåE½téÒðáÃÕ´hìØ±ï¾ûî”)SNž<©&ýÀò]:ô;~×rîOäÐù%yE—“#éycè.6£KÄH¥RŒ1(¯£×hŠ.ýˆ3)ç®ØînÁœ9s’’’ª««?ÿüó?ýéORö|ÕTGèü–.å‘ÇŠtW°l¨ÎЩ3}L#†‚àük„„œ‡º7—.„Þx²tóNâµ A¶bÅŠíÛ·wu)þÉsGóµvj·íă?°8GÀ”ÂýÉcå9ܹRŒ£è.’žÊðŒRš¥ˆ‘.%‘ž*ÆT¬£çb¸Dô#`£4¦¹k@¯· ¡¡!""BÊt÷îÝ.ƒ¤×|ªŽbKÅù× òò¸ÄŠt—là 8Í}xೊOl.Z€ä÷wFÖê~rîK^ù·øÎ§,€ðñÛßþ6''§«K¡–¯™Žï™b¸?5<ÇQtIÏsCÅ4å#ÝqcP^G¯Ñ# ú°Q=Å[P]]qà 7ˆO]~1 &Ÿª„–ÎcEz¾xCi?5†¤=:0 kкª$•§´´ÔCXæP+6˜ÕÂü éöC–»%Å8ŠÎ'{ˆ¤ç.Œ¡»ØŒòˆ‘îJå!Æ œúhŠ*6*{tæÓôœXqºS„‹/ª¿Ö3õ,݆©çLIDATÕÈï–ÅX‘þE_켆ê@Ý~ ¶\¦·•ï2ZRR¢Óéb®{à„Ý×^þªhß¾}ÙÙÙqqq&“iêÔ©ßÿ½», PSS`9t fuàõû_Xó²Äßÿvu)Ð=Ññá.6 bEç“ÝEÒóÆÐ]lFyÄHw¥òcÐ…OÑUlT ö¨¦1Ýezÿý÷‹u±X,âÁB}Kw5ò/‚¥3ÅX‘þE_켆 L@×’6ˆohhؾ}»šW÷îÝ;mÚ´'žx¢¶¶¶¢¢bìØ±YYY¡ùOGrÌê.ºý”±»Ø€Šq]NVŒ¤ç!Œ¡‡ØŒ.#=D,tcÐ…¯ÑÕltìÑkcº³qãÆ«W¯šÍæ1cÆäääèõz¯—¨¤2‚¥‡ùÁÒùrw±"ý‹¾Øy ÕQºý@ŠÞzë­~ýúÆÑ£G—–– ׺®_¿Þl6§¥¥ °¹hm„9yüRç?â¶<6›í‘G™ú襗^êÙ³§Ùlþíoë’ESSÓûï¿¿víÚØØX£Ñ¸lÙ²mÛ¶EGGGEE>}º¡¡!!!aÈ!žË)ÏW1Yµ+**òújmmmdddbb¢óiÉÉÉj6Ï•—P´bÅŠ­[·îÙ³ÇC\5…Y] üû‚¤¡Ÿ@:OÛ‰;ñ1Bzµ¥¥¥wïÞ!‹ÀWݸj!.lç‚5Ôñgµµµ“'Oމ‰:tèwÞùì³Ïvu‰BT7n(¦ƒ„>ƒÁ`½îøñãÎ/mÞ¼yРAqqq÷ÜsÏ?þ(+BÏž=m6› ÕÕÕ:®oß¾â ýû÷wÉ¢ªªªµµõÖ[oçO'L˜PWWTôÞ{ïÝxã™™™Ò¬±‡rºä«˜¬‡ÚM›6Í뫉‰‰mmmµµµ.åW3!+/¡ v»}ݺuO?ý´Édòš€À…ÜN^ºèèèšššo¿ývðàÁ‚ üßÿýŸÙl¾téRðKb·Û;vËÂn\5„q¾˜it†ììì’’’.ÉZ[,»°¡Tb †¬Vëüùó÷ìÙ“™™ùå—_fgg»;Ól6;ŽŠŠ qb·¬¬Ì儤¤¤¨¨¨Ë—/Fçã'Nœ8qbkkëúõëgÏž}úôié%5ÿÑw—l ââ↾mÛ¶ÿú¯ÿ’nݺuüøñþ%¨×ëwîÜ9iÒ¤n¸aìØ±TLn±Vÿßuùš—ªªªûî»OŒ°aÃqEªâ&ý.üëtºY³f½ûî»b:ï¼óÎ#<"%+OA\•ùÆo$''÷ïßÿàÁƒk×®MNNNMM=tès‘ ÒÒÒâââ,XÐÚÚê9µÔÔÔY³f¹«b¼yjVM¸¾æÔkí:°jŠ×þÏÿüϯ~õ+鄟ÿüç›6m”âB¨Q__?kÖ,“ÉÿðÃûއË£FÈ3í–º¼ã€ø©í²Ùlmmm‰‰‰6›míÚµÎ4“&MZºtiSSSMM<°˜ÑhÌÍÍ}ꩧĵ´{ö쩬¬üøã›››õz}lll{{»ó%&“Éf³yŽ-¦˜¬Ÿµu²fÍš¼¼¼ÂÂB»ÝÞÔÔ´nݺÂÂÂeË–ùàÈ‘#·mÛ–››{äÈ‘À‹À3fu¸5gΜ¤¤¤êêêÏ?ÿüOú“xpáÂ…V«õüùó—.]ª®®^±b… »wï6 iii‚ Ìž=ûüc[[ÛåË—;6yòd)YÅÄÏ1•••=ö˜ ²²rÞ¼yK–,‘.´Ùl8sæÌ¹sçNœ8±zõj©•”””––¾óÎ;ŠU³X, .,,,lll<}úô„ Ü•-𪩩]VÍ]IrsswìØ!þ<Êb±‹?¼8pàñãÇ­Vkzzú“O>©ò½1wîÜæææ²²2‹Å²hÑ"¿ÓñP`yËË3…¯˜2à€0”œœœ——7jÔ¨ŒŒŒ;î¸ÃóÉ‹Ål6gffΜ9S~B~~¾^¯8p`llì¸qã¾ûî»¶¶¶•+W&''ÇÄÄlÙ²ÅùüÄÄÄÇ|РA âjEòdý«¬³qãÆ­[·Îd2õíÛwïÞ½ÅÅÅ©©©¤9vìØwß}wÊ”)Îûíè~„fÂSð»Là9’BCCCDDDEE…øt÷îÝF£±±±1**J:øÅ_ˆRcªJÇŽû÷¿ÿ}ÕªU .”"Ì*¦pöìYAêêêÇ·ß~«Óé~üñGñqbb¢”¬ —/_ŸîÚµ+##ÃCjµµµjW__ߣG-[¶\»vM:è.µ@ª&•ÜCí:¶jJr×]w}ôÑG‡cÆ ÷ÝwŸËUÇŽKIIq¸‰ë¬¡¡!22R*°×t¼&èµå½fÚµ:vpý¿Î¡_¹DÄÛ2È;w®wïÞ]] x¡¹ª¹w­›‹Ö ùúZ:Ÿ=(«®®Žˆˆ¸á†ħâ?l¥MúчÃ`0¸Ká‘Gy÷ÝwOœ8ñÁHÝ¥`0âââAˆŽŽîÕ«W¯^½ÄÇâ&"½^/Å%èׯߕ+W<¤æy‡~1^ÁïÿûE‹ 2äÕW_5j”úÚùT55µëÀªy(ÉþçnݺuÒ¤I[·n•6ŽØ¼yóêÕ«¯\¹"¨ÞEÑ%F„ßéx-°×Lá«ðÜ.³¤¤äöÛoonnZ ç(÷½q8Ò&z*7-))8p 85|ûí·oÚ´iÈ!lÀ€žƒbK™¶··ßvÛm7n¼ë®»üËË.µSl FÓÂs Ðv`‚A‹ûêšÍæöövq’N„‹/ N›ô‹±Sëêꪪª7üçääìÚµË`0 6L:è.5ìv{EE…ø¸¼¼<%%%Ô&NœøÉ'ŸÔÔÔL›6möìÙîʦŪ¹»vÆŒýë_/\¸pøðá)S¦×ãB¼ýöÛuuuûöíSù~“bDHGüKÇs]Z^žiwÕµ!EÜäĉF£±á:õ—‹{˜Ô××O˜0aÞ¼yWNy¦ ÷ßÿüù󃓩ç¸k»ÝÞ%¥ µ2t öÕ&fu(3÷ß¿Àb±¼øâ‹‚ûMú7ø‰‰ùôÓO?üðC—dýÞæ_§Óååå‰åY±bÅÌ™3U¦&s>¢¯@15ÍUÍCIú÷ïÛm·=öØc÷Þ{¯¸vØk\wéçää<ýôÓ×®]³Ûí‡V_B1M5-/ÏÔs.P¤Ñ)cñ=#(X[[;cÆŒøøø¤¤¤Å‹Kd.±]"ï)F5´X,“&MƒC~úé§.Çîs—µœb”??ÊàáBÁc¸ÂÈÈÈÜÜ\ç@Ûò¶•‹«ƒ7Ñ2¥“Åëׯ7›ÍiiitI6""búôéçÎSYßüü|—,\Ê£˜‚ç­Ø.1'ï£ú[&º)?"ÏB}ÜË®¢Ñ Ü0« ƒ_º|ÍËÆ¯^½j6›ÇŒ“““£×ë7›ô»ÛàäÈ‘·Ýv›K²~oó=zôèAƒÝ|ó̓^ºt©ÊÔ.]º4|øpç#îâÈSÓ\Õ<—$77wÏž=¹¹¹âS¯q!Ü¥¿aÆÈÈÈÔÔT³Ùüæ›oú_B1M5-ï’iiiiRR’ç¼´¨Ë;~hRŒ(8gΜ¨¨¨ÊÊÊS§NpàÀ{ï½ç’»ø ##çWŒ–éÌf³Y,–+W®<úè£Îa-Emmm………wÞyg€õõPq¯7Ú] 8ÇœT¼*o™¼Šq8³P÷Rs˜*ßöïÂXð»Là9v`™wîÜ™‘‘Ñ!Iߊ+¶oßÞÕ¥è]µÎH¿ûÝŽŽ:u¨éă?*Ft  ·sçÎôôt‡R,DçÈ{Š¡ùäI¹D*ó»OÊZ~¾b”?_Ëà5$£3çp…‚ ÄÇÇÇÇÇ3æ›o¾‘WÄ!‹u)f¤-Óñ¯!A¨¯¯w8_ýµÉdr¾SñññQQQ‰‰‰.\𵾊åQLÁóöÐÂõ˜“Š÷Qý-“@~D1 •q/ýRB0;­ °¹hmB¯ ¥ó‰–ƒG|=¿ÃûlW—@@œÿµ«-òˆ‚bDGé`YYYJJŠøØ%¢óŽŠ¡ù\bñ•••¹ä.Ýç.kŠQþü+ƒ» …ÀÂFGGÛívqoñêêjç ºDËôIllìÚµk_{íµºº:Ÿê«Xw÷p£ÕP¼êo™¼ò#êß*!E»@XaVÿ¾ uùöšÙÙÙ%%% ‹%??_5 @‡ëòŽš# Nžkuü>*aº¿w`ð'ö_ù÷šÏÜ@¢ãÐ(f ‚‰Y]³-¼b Ðfu`ðï k^€0DÇ Q \ÁD´4¡ØxÅ@  ¬Õ‚}u¨DÇ QüÔ ˜˜Õ \0ÛÀ+ M`VöÕ €F1pûê.Ø.€W šÀZ] ØW€Jt|ÅO ‚‰Y]³-¼b Ðfu``_]*Ññh@0±¯.á‚í2xÅ@  ¬Õ‚}u¨DÇ QüÔ ˜˜Õ \0ÛÀ+ M`VöÕ €F1pûê.Ø.€W šÀZ] ØW€Jt|ÅO ‚‰Y]³-¼b Ðfu``_]*Ññh@0±¯.á‚í2xÅ@  ¬Õ‚}u¨DÇ QüÔ ˜˜Õ \0ÛÀ+ M`VöÕ €F1pûê.Ø.€W šÀZ] ØW€Jt|ÅO ‚‰Y]³-¼b Ðfu``_]*Ññh@0±¯.á‚í2xÅ@  ¬Õ‚}u¨DÇ QüÔ ˜˜Õ \0ÛÀ+ M`VöÕ €F1pûê.Ø.€W šÀZ] ØW€Jt|ÅO ´‚Y{ºfu̶ðŠ@˜Õ‚}u¨DÇ Q \¡{@w¬.ᢧŒù/Ð]ñ¿%M`V†®ÝW—É@C˜I QL³º„‹™maÊèÞèãšÀ¬. ]µ¯._ÌÍa±bঈ®.NÇ–,â§ÁĬ.á‚Ù^1Ph³º@0tÕ¾º4‡Ž@£¸‚‰}ul— À+ M`­. ì« @%:>â§ÁĬ.á‚Ù^1Ph³º@0°¯.•èø4Š ˜ØW€pÁv™¼b ÐÖêÁÀ¾ºT¢ãÐ(~jLÌê.˜mà€&0« C ûêJ—;/á1yÜ]‹:oV%tjÊcó8”û¡ó.ȱ¯.ºøv„!‡ÃAßx¦ã«# R X\üâüû´Ãg$ŸÐ\@ú<ÀZ]ÐöÕ‚% {ãÓ@0±V´„Y] t:st{€n†O;ÁĬ.h ûêÁÀNs {ãÓ@0±V´„Y] Øito|Ú&fu@KØWvšÝŸv‚‰µº %ÌêÁÀNs {ãÓ@01« Z¾º@0°ÓèÞø´L¬Õ-aVvšÝŸv‚‰Y]Ðqç+fu`û›´€Åy1 yÌcó˜Ç<æq7x,°µ.@ç“>q1« Z¢ã?ê€J,B@Òéøúþ?Öê€0¥ $ÌꀖðÐÖꀖü?Hü‘"H-# IEND®B`‚icedtea-web-1.5.3/plugin/docs/PaxHeaders.24993/MessageBusArchitecture.png0000644000000000000000000000013212574544466023016 xustar0030 mtime=1441974582.499016025 30 atime=1441974656.415866894 30 ctime=1441974670.094024345 icedtea-web-1.5.3/plugin/docs/MessageBusArchitecture.png0000664000076400007640000011737312574544466024113 0ustar00jvanekjvanek00000000000000‰PNG  IHDRÛ2ò EÁsBITÛáOà IDATxœìÝy`EÞøÿ2!!3ÉdBH„$\ÙEP.AYDt ä |¢¸Ëå#«XX9”[\`ÑeW<Ã"F<`I¸%„p%Ë\ä˜ýû£ç7›9È1™îIÞ¯¿zª««ª»kº>ÓS=£‘$IPH ¥\M£Ñh4¥[àÿ‘€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(‰ˆšŽ´´´ÀÀÀ²lÙ2£ÑØðrš³†Ÿ§œJQjjªF£ÑÿfìØ±r¢···½µ²o¾ùfðàÁ~~~F£ñüã/¿üR›ê:w“Ó¿òÊ+ÇŽ«G9³fÍj×®N§:thzzzCšáîêq"̽¢Þ%p_Däи¼¼¼Šóá‡Öfí×_ýøã?ÿüóyyy÷Ýwß Aƒ®^½ê‚Öfeeyxxtîܹ6™+++-_vêÔéĉùùù=zô˜:ujã4š "rPyóæ½þúëcÆŒÑjµ­Zµzá…ÆŒ³téRË<ò-ÕÍ›7‡††úùùÍš5«¢¢Âòî»õZyÃ’’’¸¸¸ÀÀ@£Ñ8}úôòòrs™iiiÑÑÑåååz½þÉ'ŸBäåå7Î`0¾ð •••rÉo¿ývHHHll¬e“æÎìéé9cÆŒÿüç?ÖûµeË–§žzJQUUåëë»hÑ"!Ä•+WŒFcuuµbÆ ;vÔétýû÷OKKB¼þúë“&M2—ðàƒn۶ͲÌÂÂÂØØX£Ñh0&Nœ(':hvpppXXØ‘#GV¯^rôèQósAü÷mìÔÔT½^oN\·n]PPPhhè‘#G„Õ oëFZïéðáÃå#¯×ë¯\¹bY‚½Ý©Q)÷EDêRXXøóÏ?7Î21&&櫯¾ª‘Ód2}ûí·çÏŸ¿xñbrrò²eËj³6>>>??ÿÒ¥K×®]ËÎÎNHH0oÒ¹sçäädù¶ýûï¿/„˜6mš§§gffæÙ³g9òÆoÈ%§¦¦¦¥¥½ûî»6wá‡~èÞ½»uú Aƒ>,„øÏþ$/>|xàÀ-Z´BDDD?~}zYYÙåË—sssŸ{î99Ñ^³oÞ¼™™™9uêÔqãÆfffΘ1cÞ¼yæ#æ8ƒ=&“)77÷ÆS¦L±™Ùº‘Ö{ºÿ~ó&¡¡¡–›ÛÛÇ•p'Àl^T/\¸ „0üæŸÿü§œèååeoí¥K—´ZmrΞ=ëïïo]òõë×å—ûöíëÚµk’k¬•$©¤¤ÄÓÓ3##CNÿñÇ»téR£X¹I’Š‹‹=<<Ì…$&&FEEÉ%çååÙ;ׯ_oÓ¦Í×_msmPPPZZÚªU«/^R^^·|ùòÙŽ;Ö¦MyyРA|ð$IkÖ¬yâ‰',³Õhám›]PP IÒéÓ§5Í­[·ä倀ós¡ÆÁ¹pá‚N§3oXXX(IRJJŠÑht|íí©å&–/ìNJë„P­Ë?@óâå啟Ÿ_ûµUUUyyyæÄ¬¬,ë_ÞÐjµíÚµ“—;vìxãÆÛ®ÍÊʪ¨¨èÖ­›œ.I’———½¶eggk4s!aaa7oÞ”Ûl4mnRZZúØcýùÏ2dˆ9QžÝ!„(..8pàáÇ>>>>>>ò²yÞÎm3Øãåååëë+„hÕª•Édr|ì©MvÇA¥Ü ³V@]üüüúôéóÁX&îÞ½û¨‘³²²2##C^¾råJ›6mn»600ÐÓÓóúõëùùùùùùYYYöZT]]m.äòåË5ª¨A’¤§Ÿ~ºOŸ>/½ô’eºùÑU!Ä Aƒ<øóÏ?÷íÛwРA{÷îMOOÿýï/„ÈÏÏ‹‹{çw ¾ùæsœ:vìØ¤¤¤ãÇÿòË/#GެÑBI’Ì-¬_³k¯eË–•••ò”÷ìììZneÝH›{ªÑhìmÞH»@=ˆÈ@u–/_¾páÂ={öTVV–––®Y³fÏž=/¿ürlfáÂ…¥¥¥¹¹¹ òC“Ž×êtº˜˜˜9sæ!222’’’ì5C§Ó=zþüù¥¥¥999¯¾úªü¸§= ,¸uëÖºuëä4hЇ~عsg//¯Áƒoܸ±oß¾-[¶B˜L¦ªªª€€“É´zõjó&F£ñxúé§Ÿxâ‰wôu:ݘ1c^z饢¢¢ÊÊÊ~ø¡Í®½öíÛëõú½{÷šL¦·Þz«–[Y7ÒæžFy"»õæ´;ÔƒˆTgèСÿú׿֬Yc4Ûµk÷õ×_>|8$$¤F¶–-[öïß?22²S§N=zô˜?~mÖnܸQ«ÕFDDøúú:ôÌ™3Z²uëÖ’’’¶mÛFEEÝ}÷Ý .tyùòåß|óÁ`ÐëõmÛ¶µ™§wïÞ’$ <ؼéïïåÊËÍiw¨‡Æñô5@-ɳ\vQMMMíÙ³§ü#$u]ëvŽ;öè£^¹rEþI4œ‹»+Ǹ´Ôîí·ßŽ%ÐTqu¨Wnn®Orrr§E )aÖ 8ÓàF讀ªpP9 $"rhD©©©ÞÞÞJ·BÒÒÒ¬ÿvT‘ššjþSÏFâ‚*Sp߸"rP EÂw—UÚ¹s眜TT{ßÿýðáÃýýýõzýÝwß½sçÎFªH…û@UˆÈÍÑÁƒ}ôÑiÓ¦eee¾ùæ›0¯u|÷š{Ûœ‹ˆÝæÍ›CCCýüüfÍšUQQ!„())‰‹‹ 4Ó§O///B >¼¼¼\¯×ëõúW^yEþßûªª*__ßE‹ !®\¹b4«««í•`(ß_·n]PPPhhè‘#G7uÆ ;vÔétýû÷OKKB,Y²ä™gž1g1bÄÖ­[mæ´´qãÆÐÐPŸ¶mÛ¾ùæ›â¿oÆçææŽ5J¯×GEE™ã`›{ä¸möÎf–æÎ»|ùòqãÆµlÙ²E‹ܾ}»ãƒS{5vÿ¶û^›ÝЄ‘@ã2™Lß~ûíùóç/^¼˜œœ¼lÙ2!D|||~~þ¥K—®]»– „Ø¿¿——Wqqqqqñ„ >,„øÏþ$/>|xàÀòåØ,Áf¢ÉdÊÍͽqãÆ”)SæÍ›ç¸µÇÏÏÏŠŠzñÅ…111{÷î5™LBˆÜÜÜÇ?þøã6sšåææÆÇÇïÙ³§¤¤äܹsÆ «QËôéÓ Cvvö·ß~kž+b³ñŽÛæ`ïlVaVTTôÓO?É;âtŽwß^Ãn»ûš2 à 6/ª.\B\¿~]~¹oß¾®]»–””xzzfddȉ?þøc—.]äÌ^^^æmƒ‚‚ÒÒÒV­Zµxñâòòò¸¸¸åË—K’d³›‰r %IJII1Ö-´¬ÔìØ±cmÚ´‘—{÷îýÉ'ŸH’´iÓ¦‘#G:È)+,,ôööÞ¾}{QQ‘uEÅÅÅæc’˜˜¨Óéì›Ì5ÚÛ;›UX–žž®Õjí•/—\c“Ú¯µÞ}Çû.Ù9¡š×pÄ€ªhú Í…V«m×®¼Ü±cÇ7ndeeUTTtëÖMN”$ÉËËËzÃ>|øðáÃsæÌ9vìØÏ?ÿ|øðáI“& !l–`¯X///___!D«V­ä[ÝlÛ¶mÙ²e7nÜ3~üøÝ»w5j÷îÝ“'OvSæëëû¯ýëoûÛsÏ=½jÕª~ýú™×fggk4ó1 ³·Gµi›Í½³Y…¥€€€ªªª‚‚ƒÁPc•¿¿¿¢ººúÖ­[ò²"??¿6kíí~ëÖ­7¬–]@“¥Ü‡hRl^TkÜ#ÿ÷¿ÿU\\ìééY\\\#sjjªåíê¿ýíoS¦LéСCYYÙªU«þüç?ûøø”——K’d³›‰–·ÀmÞÙµÌð믿jµÚC‡UWW;vÌœùÒ¥K~~~—.]ÒétrÖ`2™V­Z%Ù¿O¼oß>Ng٬ÑÞÞÙ¬¢F}ûöݶm›½êrÜ̼ûŽ÷]²sî1 *Ì#€Æ¥Ñh.\XZZš›››ðÔSOétº˜˜˜9sæ!222’’’„F£Ñd2ݼySÞpРA~øaçν¼¼¼qãÆ¾}û¶lÙRa³{ÅÖžÉdªªª 0™L«W¯6§‡……uïÞ}êԩÇ÷óósS–™™ùÅ_”••iµZ___ùQT3N7jÔ¨ùóç—––æää,]ºÔÞÕ¦m6Ù¬¢†+VÌ›7oÏž=&“I’¤£Gšoÿ7ƒÝ·×°†Ÿ;nˆêF£Ñh4šÚçoÙ²eÿþý###;uêÔ£Gùóç !6nܨÕj#""|}}‡zæÌ!D@@À³Ï>éïïåʕ޽{K’4xð`!„¼|øm‹­ Ç»o¯aõ;w¤®@i¤ÿžüpÌ2R±¼„ÊénwQ=uêÔ!CøÿšæÆ^wµ×½4*žì€úsÓ(ÜÒ¾}û¢££•n”ÇMq@ADä€ë0à5U–gV£q§ï§L™òÍ7ß¼÷Þ{J7J²wiâ’åîÜèZw9wÇðÖLp]…úq9j¸¹î‘®Æ%ÒÝÊ É/Göº4+÷ÅeÊíð[+ÐPò¯É*Ý  žèÀ€â¸GõGƒ&ÃñýrŠˆêƒXMq9 "r¨bq4ytrÀŘG(‰ˆP9 $"r@IDäàL<¨+"r@ID䀒ˆÈ%‘J""”DD(‰ˆP9 $"r@ID䀒ˆÈ%‘J""”DD(‰ˆP9 $"r@ID䀒ˆÈ%‘J""”DD(‰ˆP9 $"r@ID䀒ˆÈ%‘J""”DD(‰ˆP9 $"r@ID䀒´J7¸š$IJ7Àÿ{䀒¸GÎÁMG@ý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(‰ˆP9 ™Òh4FéVà¿pRÐ<‘p' Õ€¦‡ˆ€›!(‡I’¤tð_$I⤠""àNªáDt'*ADÀÍEÁ‰øÊEm˜GŽæ‰ˆ€;a¨†Ѩ97C'â+µa9š'"rî„¡NDw DäÜ Qœˆ¯\Ô†yähžˆÈ¸†j8Ý €J‘p3DQp"¾rQæ‘£y""àNªáDt'*ADÀÍEÁ‰øÊEm˜GŽæ‰ˆ€;a¨†Ѩ97C'â+µa9š'"rî„¡NDw DäÜ Qœˆ¯\Ô†yähž´J7Í ×YÁAhXH­ÑhˆÈá,¼¨97CP'¢/©SΟµdÍü8¸×»›ˆ p¯7 œ¨áÃ$IÍ|Œq- DäÜ Qœˆ¯\ÔFþÈ픓™m¶ÜñÆ Ovp'îx…jѨ97C'â6ªÚð{ähžˆÈ¸†j8Ý €J‘p3DQp"¾rQ~Í9wÂP '¢;P "rn†( NÄW.jÃ{öì1¯Òëõ­Zµ ýàƒì%^¾|ÙÓÓóŽ;î¨Sã½¼¼nܸáïï_§­Ô( NÄW.¨“´´4­V[VVÖð¢ä«ý=÷ÜcNILLÔh4ãÇoxá !IÒêÕ«###u:]@@ÀÃ?ÜÀÏœ9Ó³gO§´­ #"GS–œœáããS¿Í+**.]º´jÕªââââââ©S§Îš5K^>tèPíÛvàÀ“É$„¨ªª:}úô]wÝ%¯êÙ³gqqqIIÉÌ™3gÍše/ñÔ©S\Χ#G]ø€[à+ÔÉÉ“'£££… ~nnn‹-JKKåÌÿú׿úõëg3§"99yÀ€ׯ_Bìܹ3""ÂËËKhlŽ2§N|xéÒ¥æ8X’$ËˆÜæ¶·nÝZ¼xqNNÎùóç:ôÅ_˜Û0jÔ¨O>ùD~-ß™KNNþýï/„ÈÌÌ\¶lÙc=f/ÑòyrròwÞYcùOúÓõë×/_¾|èС„„9sJJŠ9çÉ“'¿ÿþûçŸ>77·OŸ>[¶liô£¨á8êʑۼà·nÝ:((H¾í-IÒ_þò—¥K—ÚÌ)~zöìyöìÙ²²²„„„E‹?^hlŽ21113gÎ,**ÊÈÈ¿AµN±YÍ1Â^-­[·~ë­·öîÝ[PP`Þq›9í,6GR›%¤¤¤ú¨F¢ù‚/IÒ!CÞÿ}I’Þÿýûî»ÏAÎððð¼üòËkÖ¬Y±bÅÌ™3;(Ùe ömÛ***ÌZ§XWgoŒ°WKzzúôéÓÛ¶m«Õj'NœXZZj/§Í‘ÅæHj¯„>}ú¼ùæ›·=ìuåŽcÖå)..NKKëÕ«×—_~yÏ=÷´oßÞríÊÊÊÌ3Ûªªª&OžüÕW_Ý{ï½F£QNÌËË9r¤¼,OI—g°ØÜV±uëÖ·ß~ûÒ¥KríóæÍ3·¡uëÖÞÞÞÇONN~ôÑGå —.]ÊÏÏ÷õõµl³ubeeå¹sçä{ ×®]«¨¨ “W¥¤¤Lš4©F³‹‹‹{ôèQ]]}æÌùyUUÕ™3gÌûrêÔ©|Ð9GpgÌ#G˜L¦ .È÷È­/ørž=zœ;w®ªªêµ×^Ûºu«½œæÑ!;;û£>úþûïúé§ÄÄDù¹½Qf÷îݯ¿þú‚ bbbV®\éééib]Í1ÂA-;vܼy³âðáÃ#GŽ:t¨§§§uN{#‹Í‘Ôf]ò8õøã7ÆÉr;ÌZA“•’’b4;tè••eý{#YYY'NÌÿMQQѺuë²²²üüüä ¿þúkRR’ù«=Ë)+6·Ý»wïÚµkwíÚ•——wñâÅV­ZuïÞ=%%¥]»v­[·BŒ=ú“O>9qâ„\NJJJûöí-#o{‰.\–çØ>}º[·nr‘’’mžWTTôí·ßöìÙ355Õ`0ÈU§¦¦úùù™ªÅr6 ÐÌIL\A­={ÖÛÛ»sçÎ6/øržîÝ»Ÿ={v×®]aaa °—3%%åŽ;î ŒŽŽþàƒ&OžÜ¶m[óLK›£ŒâÁ½¸¸¸k×®5&‘››QZZš––Æ/·‚putòäÉ=zh4›|9O÷îÝO:µxñâ%K–;Cƒ°S¢¢¢åçæ[?6G™O>ùäêÕ«Bˆ¼¼¼[·nEDDX§Ø¬Îæa¯–¿þõ¯Ç—$éÖ­[+W®ÌÈÈxüñÇmæ´7²ØIm–`y« Däh²Ì×»|pÆŒ Ðét“&MòððBüá˜9sæ!Ct:ÝwÞùý÷ß !FõÀDEE 4讻ŠÒjµæÒÌ®ÍmŸ~ú霜£ÑøÔSOuïÞ]Îl¹ÕÀ äiâò*ë_ƒ²™hùXç}÷ÝÒ½{÷Ç{,44Tîyä‘x ""bÀ€=zôˆŠŠòòò:yò¤ÍˆüÔ©S;wvÊOwMWP{æÇ:m^ðe=zô8sæLtt´üŒ¾½œæJ«ÕŽ1B̪ÍQfÿþý¿ÿýï}||Æ÷Ö[oEEEY§Ø¬Îæa¯–ÌÌÌ'žxB§ÓµokíE0 IDATßþСC‡n׮͜öF›#©½ÿ©GõÐp‡®$~ôºÆ³hÑ¢üüüµk×*ÝÛèP:dSÕHgöþûïŸ0a‚ùWeÝ‘ÊÇgqÇ·6Ovnï‡~ þì³Ï6lØpôèQ¥[¤w¼þB è3¨½'NÈÿ¸ì^#Ü9àöŽ=úÐC™L¦nݺíÙ³Gþû¡æ‰¸uBWq_мÙwïÞàÊ‚1Â-0k.EÀÔÌ5^°ž L7Cmh4ŒƒnÉò-o}kš9wìÜ#àj®y–ίÈp1ëlx³£ à·V4e†¨ Æ5¼ÙáÖ¸GÀÕ\3k¥ñêB“A÷p:ÅcbÅÔ÷Èá6yä‘C‡Ù[›––è‚f¤¦¦Ê?¹j½ÐÀUCjIMM•+wÓ¦M ,pj»‘$IÄ[¸-¸&†7>Ü9ÜÃO?ý”““3xð`{:w“ãÊ&©\cú“'O–ÿœÙ¹Å:C2j‰pÜé$W±Wµëwp "r¸‡-[¶<ùä“J·¢¹óòòzðÁwíÚ¥tCìbHF]ÑašÞøhˆÈáöíÛ7dÈyY¾û»yóæÐÐP??¿Y³fUTTÔ˜CRc­¼aIII\\\`` Ñhœ>}zyy¹e………±±±F£Ñ`0Lœ8QNܰaCÇŽu:]ÿþýÓÒÒ´Ðf67·Y‘lýúõwÞyçÍ›7-å=zûí·ƒƒƒÃÂÂŽ9²zõêàààó=XïÚðáÃËËËõz½^¯¿r劜mݺuAAA¡¡¡GŽ‘SòòòÆg0_xá…ÊÊJ9=77wÔ¨Qz½>**êÀæÆÜwß}‰‰‰ŽO–"’QôwÇM9Ü@~~þÕ«W###Í)&“éÛo¿=þüÅ‹“““—-[f™ßÞÚøøøüüüK—.]»v-;;;!!Ár«éÓ§—••]¾|977÷¹çž“#""Ž?žŸŸõâ‹/Úk¡½mnn³"!ÄÊ•+·lÙ’””Ô¦MëòoÞ¼™™™9uêÔqãÆfffΘ1cÞ¼yövmÿþý^^^ÅÅÅÅÅÅ¡¡¡r!¹¹¹7nܘ2eŠyÃiÓ¦yzzfffž={öÈ‘#o¼ñ†¹‘ƒ!;;ûÛo¿Ý¹s§¹%QQQ'Ož´{ªwÃÄ7¥þXÜñ³OĉóÍOg5¤L÷zúHa®šñHÒoWϺn•žžîááa~yáÂ!Äõë×å—ûöíëÚµë… ¼¼¼ì­•$©¤¤ÄÓÓ3##CNÿñÇ»téb.³¸¸ØÃÃü•µcÇŽµiÓF.ß\‘ãmnn]‘\Îk¯½Ö§OŸ¼¼<ëªåò $I:}ú´F£¹uë–¼`o×Ìͳ,¤°°P’¤””£ÑhݘÄÄĨ¨(›é:N^>{ö¬^¯·w”n‹ËT…ÙT)~füñÇ~ýúÉËòåW§Óét:½^ÿý÷Ÿ?¾N¥;vlРA>>>¾¾¾wÞyçÇl/g+¿S4¤Ì²²²ÜÜ\ç6é¶ïõÀ=r¸ƒÁPUUUZZjNÑjµíÚµ“—;vìxãÆ Ëü6×feeUTTtëÖÍßßßßßذaæM²³³5y+³mÛ¶EFFúùù 2äÖ­[öZh¯=Ö›Û¬¨²²rÍš5/½ô’Ñh´Y¾———ŸŸŸ¢eË–>>>>>>ò²<ñÆñ®Yâëë+„hÕª•Éd²nLXX˜™ŸŸÿ믿nÙ²ÅÞHáDæŒ ,AýO©9Ü€¿¿‡Ο?oN©¬¬ÌÈÈ—¯\¹Rcš‡Íµžžž×¯_ÏÏÏÏÏÏ/((ÈÊÊ2o$I’y+Y~~~\\Ü;ï¼SPPðÍ7ß8¹mÖhss›iµÚÄÄÄÙ³gYòòòš4iÒ/¿ü"þ{6ˆùGf…7n õññiÛ¶í›o¾™‘‘‘••5}útOOO¾}û4ÈÞ¶2ëçšj”)l=Ñd~f)$$$66¶Ædë2­Ÿ_ªQ‚¼¡jŸ>R"r¸‡‡zÈ2ZÕh4 .,--ÍÍÍMHHxê©§,3Û\«ÓébbbæÌ™#ß?ÎÈÈHJJ2o¢ÓéÆŒóÒK/UVVþðÃB“ÉTUU`2™V¯^í y6k´¹¹ÍŠ„}ûöýàƒbbb~ú駺›»f4åÙçŽ7=zôüùóKKKsrr^}õUù¦ŽN§5j”9}éÒ¥æM:4bĈº¶P-æ‘Ã鬟}2+++Û¾}û=÷ÜcoÛÜÜÜøøø={ö”””œ;wnذaíÛ· yòÉ'?þøcÇ—t™õsMÖe ;O4™L¦ÔÔÔ´´´wß}×q™ÂΣYÖ%ðôQm)8cÍP½{]9y^^^›6mêСƒ¯¯ïŒ3ÊËËkLï®±VÞ°¸¸øÿý¿ÿ¤×ë###×­[gYE~~þ„  ƒ¿¿ll¬œøòË/ëtº°°°•+WÊs©mÎ#·W£õæÖYNÑKLL¼ãŽ;NžsðŸp¸¸¸?4 ¸5‰yähÖÏ>™y{{?ýôÓßÿ½¢eË–•••ÕÕÕBˆììlsž‡zèË/¿ÌÉÉyüñÇ'Mšd¹yppðܹsOŸ>mo[a繦eÚ|¢Éë2?še‰§j‰ˆÐ|1¡Æ³Of&“i×®]BˆöíÛëõú½{÷šL¦·ÞzKΙ™ùÅ_”••iµZ__ßêêꜜœ×_]¾'ŸŸ¿~ýú>}úØÜVfý\“u™öžh²ÇºLÇfYâé£Z""‡ûéÒ¥KYYYýÖ€á8ÉôéÓßÿ}óKó?(ž8qbûöíBµk×N›6-""¢_¿~rΪªª¥K—ëõúÍ›7oß¾ÝËËëÔ©Sôññéܹsnnî»ï¾ks[YË–-û÷ïÙ©S§=zÌŸ?ߺL!ĦM›<<ù䓯¨¢²²²1Š­“üü|yï~üñÇsçÎ)ÝœÛxæ™gâããÃÂÂþýï?Þéå»,Œ!"àfTÌ¡i ;©z>³Õðþûï !bcc…ï½÷^µûöíëÒ¥‹OlllYY™âóÏ?ŽŽnÙ²e«V­zöì¹gÏañ9°S§Nò²ó-Y²$((hÉ’%BˆÄÄÄnݺy{{{{{÷ïßÿøñãBI’þú׿†‡‡{zz¶k×n×®]6KKII6l˜Ñhœ6mZqq±œ¡¬¬lÒ¤I>>>û÷ïw°›ƒaÇŽBˆ;v †kí•osgm&ÚÜ;ˆ‡‡oÞ¼Ù Û«Q¶hÑ¢µk×nß¾]a¾‘oy_ßrÙf{ÔBÀ…}àŽ ½½½ýüü Z·níéé™››+¯’»ôwÜ×¶m[!ļyó$I BŒ7...îÞ{ïMHH$iöìÙrþgžyföìÙæÍ[·n÷üC’¤mÛ¶=úè£ñññ<ð€"22R’¤7ÞxC¡Óéžyæ™1cƼþúëÖ¥ååå¶jÕjòäɃ BL˜0AnäܹsÍl׮ͷ¡œ8}út­V{õêÕÖ­[Ϙ1CN¼té’$IÊ·¹³6mî¹…ÁÁÁ3fÌ£ÂAæþùç{÷î-„˜?¾å*¹Í–Ë6Û£\¸‚9w§ªˆ\=-™ªzˆ™|vòäÉ’$ÅÅÅ !6oÞ,¯’¼wï^I’öîÝ+„èСƒ$IƒÁÃÃcçΧOŸ®ªªª¬¬´Ì/Lj旻ví2×U^^¾}ûö¹sçÆÇÇËk³³³;vì(„رc‡œ§¢¢Âº´mÛ¶ !zõê5{öìY³f !´ZmII‰$IíÛ·B|òÉ'æFÚ‹È:Ô¢E‹¡C‡ !¾ûî»Z–osgm&ÚÜ;I’:tè „øè£$Iúç?ÿ)¯rP£øo¾¾¾‰‰‰ÖÇÄrÙÞQÕõx41ê¼°Â}Ñ£àDt'uRçy1b„âÎ;ï|øá‡ïºë.!Ä!CäUrƒÏŸ?/I’<ñZ«ÕJ’´uëVù¦¬¢M›6'Ož´Ì_#"—7—3¦F¸™žž®Õj…gÏž­Ñ0ËÒäI/5\¾|Y’$´‘_ºtéþûïBtéÒ¥öåÛÜY›‰6÷Î^ ÔhnXEEźuë„5vÄ)„èСÃ!CÚ´ióý÷ß !ŒF£œ³mÛ¶™™™ñññ‘‘‘«W¯¶®.((èÚµk«V­*,,4'Μ9sÁ‚3gÎLJJ*..¾ë®»,XP£´E‹Í;wçοþúkûöí“““KKKÿóŸÿÈMZ¹re\\ÜçŸ~ÛŠ;vlpppß¾}k¤?öØcöÊ·¹³6mîâ©§žZ±bÅÔ©SG-GíŽk”%$$øøøÈϪÞ}÷Ýrb=’““çÍ›—ŸŸoY…½3â€ëºn#߃'«Ó…‹ Ó5üªê¤Ôh‰‹†Þæ§®'¥®›4¶ !6mÚdN‘§•÷éÓGú­Á6l÷ööž0a‚<ÑyôèÑmÛ¶mÑ¢E@@À´iÓÊÊÊämßyçÀÀ@ónÊ æI,’$íÝ»7888 @žE-¯­®®^¾|y§N<<<Ú¶m+?j]Ú‰'ä_&ñòòºë®»Ö®]+g+))™8q¢··wXXØÚµkmdë–X'Ú+ßæÎÚL´¹w’$•––>ýôÓÞÞÞ;w~ë­·„j´ì`ƒaôèÑæF~ùå—wÜq‡¿¿ÿŠ+,«°wFÔ@#qBcRÏÍ04 uíQô@§kJ‡Ôz_šÒÞ©D=)g¡y*))ñöönÑ¢…bÏž=cÇŽíÔ©Si'®ç²ÞȬn†qNDwR!NJó”’’2cÆŒ?þñ&“ióæÍBˆgŸ}VéF¹9V8=ª PÏP5´€,((ÈÓÓsÅŠUUU‘‘‘¯½öšùç䲫³V¸¦.õMFéªNJ¶5 ÌZjƒ_?Dãjb?”ʲ;¥§§k4š{î¹Çœ’˜˜¨ÑhÆï²6Ø$7L¯×ûøøøùùÍš5˽bù1&¥[!¿¬àv\Æ‘p3. æ’““ÃÃÃåŸïBTWWÏŸ??<<\þs%''wïÞ½¸¸¸¤¤äàÁƒ›7o>zô¨²Mr_*ùlKêù̸ 9V8—+»Srrò€®_¿.„عsgDD„——W¯^½„ÕÕÕ‹/ ÑétãÇ/++Bœ:ujðàÁz½Þ`0̘1ÃfÊ•+W†  Óébcc+**äêL&S||¼Ñh ߺukçÎíÕ"GäòV½{÷ÖétòÿÒ½øâ‹‹/–Ó¿úê«~ýúÉË–mpÙÑs@=_9·;ñ¥ ì‘û|zzzVA \Æ‘p3. æ’““{õêÕ³gϳgÏ–••%$$,Z´èüùórD¾hÑ¢¤¤¤cǎݼy3;;{ýúõBˆ˜˜˜™3geddÌš5ËfÊ­[·/^œ““sþüùC‡}ñÅruúÓŸ®_¿~ùòåC‡%$$ôìÙÓ^-戼¬¬lÙ²e;v¼÷Þ{åô;ï¼ÓÜxó²e\sè܈»_ª8‹z>³¹ÀìÙ³gÏžíçç'¿lH€NpïÖˆÈѸšÕ….àÊî$GäÑÑÑgΜY·nÝðáÃ+++Fc»ví233׬Y³k×®àà`½^ÿä“OÊÿ!wýúõòòòªª*N×»wo›)ݺu»÷Þ{[´hÑ¡C‡{î¹çÖ­[r¶;vlÛ¶ÍÏϯ}ûöýû÷ïÙ³§½Z’““W®\éïï¯×ë׬YóÏþSþËhË(<%%%::Z^¶lƒËŽžêùê̹݉/U Ø:Y½zõêÕ«£=·U77Ì#Û\̧¥¥É÷È¿ûk×þå/‘ct!ÄÊÊʺwïîïïïïïÿâ‹/úûû !vïÞý÷¿ÿ½C‡³gÏ–#'ë”­[·öîÝ[ÞpÏž=ݺuB|õÕW÷Þ{¯ù/‹‹‹{ôèa³¹aÉÉÉùùù·nÝzøá‡ÿô§? !®]»VQQ&—`‘[¶Á‡Î½8±;ñ¥Š³¨ç3›¥ÄÄÄnݺy{{{{{÷ïßÿøñãrº±-Y²$((hÉ’%BI’þú׿†‡‡{zz¶k×n×®]rÎO?ý4$$$ à½÷Þ3kycÛùuêÔI£Ñ¤¤¤ÈÿUi4§M›V\\,¯µY~m­K®±lÙ`{Á¥œòÏŸ Nõ¾Ð}÷ÝwíÚµ“$éÔ©SBˆÿùŸÿ‘$iöìÙsæÌ‘$iåÊ•“'O¶·íÕ«W;uêôé§ŸZ§|ôÑGÑÑѧOŸ®ªªÊÉÉÑëõòß8¯\¹2&&FÎ\XXh0Nœ8a³–ï¾ûÎ`0TWWË/ÿþ÷¿GGGK’´oß¾¾}ûʉYYYÙÙÙÖ­ªÇ¡¨¡ác‡šGŸ†´-<<üÀ/¿üòš5kV¬X1sæÌcÇŽJ’”‘‘¡×ë¯_¿.çܲeËĉ%I2 Û¶m«¨¨0bb)&&f×®]’$]»vÍ`0äåå™Ó,X`¯–ððpƒÁ ÿûúùóçå iiiòò¤I“Ö¬YS›6Ô•šOwlÛ¶íÑGà„‘‘‘rº¼ƒ­[·Ž‹‹“ÿÙþ7ÞBètºgžyf̘1¯¿þºœ§S§N#GŽBTUUYn.ÿÇ»ù3ó3Ï<تU«É“'4H1aÂyëòkl;{öì%[/›œ——g¯"¸RSx“hVê4º×;X¿~ýC=$IREEEbbbQQ‘$IC‡ݾ}»$Iû÷ï¿ãŽ;Μ9#IR~~þW_}%IÒÇ|åÊI’’““ƒƒƒÏ;g²téÒ‡z¨¢¢"33ó¡‡êÞ½»\ÝÞ½{Û¶m{õêÕ˜˜²²2›µ¬_¿~È!òV.\èÓ§ÏÂ… å&uëÖ­ªªÊd2ÅÄÄ´mÛVÎS£ õ854±ˆ¼FKêݶ¢¢"F“ýþûï7®C‡™™™Û¶m{à$IÚ±c‡V«5üF¯×ÇÇÇK’´oß¾Áƒ·iÓæùçŸ7™L6S¶lÙr×]wÉzxx?~\’¤íÛ·1Â\ûÃ?üüÃf-rÃ.\¸ IRYYÙÔ©SG%IÒÕ«W}}}Ííz÷î””$/[¶¡‡¢†zRUõ³òòòíÛ·Ï;×ü·5ò‡^yYþ¤$ëØ±£bÇŽòKóD£Ï>û¬¨¨H^6p²Œ•-_nÛ¶MÑ«W¯Ù³gËß–hµÚ’’›å;.Êæ²¹Á6+j¤cT×ãÑĨó ÷U×Uï7þü‰­[·>qℼüÚk¯ûøø„††.^¼X’¤gŸ}6((¨U«VQQQ|ðÍ”+W®Ü}÷Ýz½~èС/½ôÒøñãåÒ*++'L˜àíí`ŽÔ­k‰‹‹Ójµ:N§ÓuêÔé/ùKee¥$IåååÇŠŠ9räŸÿüç?üár Ömh ¦ô¦¶Þ—zï_ªØÓd"ò1cƈÿ–žž.ýÖZó7’$ÉÏuœ={Öœ"çIMM•ÆÍ–/åù$5\¾|ÙfùŽ‹2O·ŒÈÍ ¶Y‘“;sÙá £qñÞ†s5¡Ý±W^yå¹çžSºv¹ã!µÇzGê½w|©bO“é0^^^Bˆýû÷çääX¸æ8Xúí¶<ƒE’$›±½ˆ\ž~ñâÅwÞyGk.öêÕ«öʯ±­üRÜOŸ>ýË/¿8h€ƒŠ ¹°k­?NdîÍ€S4ÕõÃ?„……öÙg6lPùÓ5zþ#݉m0?õ«ÕjGŒ!'¦¤¤È‰øÃfΜ9dÈâââÀÀÀéÓ§ßÿýû÷ï—Ÿ¢ }ë­·¢¢¢Ö­[W#åé§ŸÞ»w¯Ñh¼ûî»÷»ß™üä‘Gyà""""""ÆŽ{òäI///›µ$''ûí·z½^ûÊ+¯!î»ï¾îÝ»‡‡‡÷èÑÃüpV9ëø4AAA×®][µjUaa¡ãœ3gÎ\°`ÁÌ™3“’’Š‹‹ëôó—mÛ¶ÍÌÌŒ lݺõÎ;ýõ×öíÛ'''—––Ê¿¶d]þ‚ ,·ŒŒ\½zu=’““çÍ›—ŸŸï ÆÇ{lîܹ6+‚på•ÊQ?8Q.\îr¡[½zµÑhÔét}úôùæ›o”nŽ# ?¤ª:)ÂI³VÔô¾TQçYØ»woppp@@€<ñZØ¿G^]]½|ùòN:ÉÒþãÿp¿ÆËwÞy'00PNôÐC&“©[·n{öìQm8^?nzR€†à9€¦Œ›mN×ðCªæ“¢æ¶¹))Püg'7ãš?4F3AwR!—ýo9 ÌZAãâqº PÏîÀ1æ‘€mê‰çÐÐTˆ“‚fˆˆ‹ +œ‹Õ¨ç«35´€š¹ì*áêyäiiiæË„pÆᢹa¦œˆî¤BÌ#G3ôù÷ß?|øp½^÷ÝwïܹÓ)¥§¦¦z{{[¦tîÜÙü÷³uÒH-¬%ëq–z'–Ш¸°Â¹èNM€üwJ·But'½^¯×ëu:F£ÑÿÆAþÆXsYÓBqðàÁG}tÚ´iYYY………o¾ùæn»eeeeã7ïÿÔ¯…š$ѹÔÔTËàiìØ±QQ—k(ÞŠ‹‹‹‹‹“““u:]ño”m’âÔó™ p™Bˆ¹sç._¾|ܸq-[¶lÑ¢ÅÀ·oß.„ÈËË7nœÁ` |á…*++åAâí·ß ‰B”””ÄÅÅÆéÓ§———;®Ï<Ì,Y²ä™gž1§1bëÖ­ö ´×B\·n]PPPhhè‘#GÌõÖH”Ù¬±°°066Öh4 †‰'>¼¼¼\}¯\¹b¹G67·W]VVÖÈ‘#õz}TTÔ¦M›ôz½å¸ko+ÇÙ²„7†††úøø´mÛöÍ7߬e'hT\Xá\*éN^^^æàéÃ?´\åÊ»nJ=_©¤;Õ`=®Ù˹aÆŽ;êtºþýû§¥¥É‰6‡W›9ܖ˘EEE?ýôÓã?n½nÚ´ižžž™™™gÏž=räÈo¼!„0™L©©©iiiï¾û®">>>??ÿÒ¥K×®]ËÎÎNHH¨eÅ111{÷î5™LBˆÜÜÜÇËm°.ÐA 4277÷ÆS¦L™7ožœÓf¢½]˜>}zYYÙåË—sssŸ{î¹ýû÷›àÐÐPËØ;6«›6mZ```vvöwß}÷þûï[ïŽÍ­jysssããã÷ìÙSRRrîܹaÆÕò\îE%Áœ¥w+lFTæ<ÁÁÁaaaGŽY½zupppHHÈÑ£GnKÙ»£AÔU*ìN6Ç5›"""Ž?žŸŸõâ‹/ʉ6‡W›9UK=ŸÙ×IOO×jµ’•ââbëׯË/£¢¢.\¸ „ÈËË“KJJ<==322ä—?þøc—.], ¹pá‚———½”Þ½{òÉ'’$mÚ´iäÈ‘ö ´×BÇ,,,”$)%%Åh4ÊõZ'Ú«±F±6wÄñ°Y]qqq‹-Ì™÷ï߯Óé,K¶¹Uíraa¡··÷öíÛ‹ŠŠl.EÈÝLéV é¨kjŒhóʦÑh^xá“ÉTVVöÇ?þñ©§žºuëVVVVß¾}Ìy^yå•ÊÊÊ„„„:¼öÚkòòàÁƒTñå—_æää˜L¦É“'=Z’¤_~ùÅßß¿¼¼\’¤œœŸÜÜ\›9CSzS[ï‹R{wáÂN'Ù×jä´Ž;Ö¦MóKëáÕ^N¨Ç!mJ} îÎe½Qj4šüüü+.]ºdŸ={Öß߿ƅ ==]aøŸŸ_PPe!Ž#òåË—O˜0A’¤ûï¿ÇŽö ´×ÂÚ4Ò|³™h¯ÆÅÚÜÇGÀfuÖ­µŽÈ­·ªÓAþâ‹/† æçç7`À€£GZ7Øõ¸°Â¹Ô0´ËžÍïÊþóŸ–w+ìETrž‚‚I’NŸ>­Ñhnݺ%/XWá8êrrIu5¥7µõŽ(‘Û×jä4÷wÞy'""Â×××××W¯×›óX¯örº@Sê0h†\Ö[øúúÞ}÷Ýÿú׿jÜ; ª®®ÎÈÈ_^¾|¹M›65òzzz^¿~=?????¿   ++ËÖxÛÆ÷é§Ÿ¦§§ÿðÃ>ú¨½íµ°–tÌfrÈk.VØÿZ³NG@ní7ä—W¯^­w íe~衇ä›d?þø¤I“jS~c³ìÐ@é¤;yyyåÿFžSçååe4…ÙÙÙ¦]»vrΰ°°›7oš·òóóB´lÙÒÇÇÇÇÇG^vüζmÛ"##ýüü† rëÖ-9qüøñ»wïBìÞ½{üøñrªzæ$¨¤;Yªý¸–ŸŸ÷Î;ï|óÍ7–ûRcxu€c. cZ!V¬X1oÞ¼={ö˜L&I’Ž=:yòdN7zôèùóç—––æää¼úê«O>ùdu:]LLÌœ9s „IIIÖu”Y°L ëÞ½ûÔ©S‡.Rö ´ÙB9ÿmé˜Íu:ݘ1c^z饢¢¢ÊÊÊ~øÁh4šL&ó°Z×#`ÎüÈ#È­ÍÍÍu05°~Udff~ñÅeeeZ­Ö××·ººº–p/* æìiøKöb)ë;D]õ£¶îTûqÍd2UUU˜L¦Õ«W[®ª1¼:È©Nêù̸L !Ä}÷Ý÷ÑGmÚ´)((ÈÏÏïùçŸ>|¸bëÖ­%%%mÛ¶ŠŠºûî».\h½ýƵZ­ü]ØÐ¡CÏœ9S#Cyyy+ ×®]³\“””ã¸@{-¬e#³Yã¦M›<<øàƒÛ¶m³,ª°°066Öh4 †‰'ÚlLee¥"77wÔ¨Qz½>**êÀrÎÛî—̓#„ؼyshh¨ŸŸß¬Y³***ìUºdÉ’gžyƼՈ#¶nÝZ›z]I=7ÃÐ4Кõ|uFwà˜Ë»³VL&Snnî7þ?öî=<ªê\üørÈLn (&`4„›â,&ˆ•ƒ…z+ A°@ˆœb+ÒDë± ŠO ‚BÅÃAñÁZjRµ1(Å " I Éà„ !™\æ÷ÇþuÎtn™$3;kïýýü5ÙÙ³öÚ{­ÙóΚwÖš9sæÂ… =Û³³³÷íÛçp8rrræÏŸ/„ÈËË+..B|õÕW6›My\\\œ››Û­[7ÿý=å—”””––¾úê«óæÍs8'Nœ8}útuuõ’%K|*3{ö츸¸ÊÊÊÇïÞ½{ëÖ­û÷ï7›ÍN§ó7ÞðÙ9àžÎÔ©Sßy熆!ÄÙ³g?û쳉'zUPPÐÐÐPVVf·Û~øá€•yöÙg•=“““«««wíÚµyófeÏ6Ï+XUwíÚuôèÑãÇïß¿ùòåÁšŸŸ¿mÛ6—Ë%„°ÛíÅÅÅ&L縀¦µ+˜‹ôªjøÿ¢×¾* ØLˆœŽ5JÇžhXÀ…;&„8þ¼Ûí>pà@jjªÿíxïÞ½½{÷VÛl¶ÒÒÒçŸ~éÒ¥………Ï=÷\°ý•òÏ;çv»ëëëãââ***”}ñÅW^y¥÷NgLLLyy¹òç|““㿊uˆ†8¼¼¼7ß|Óív¿ð 'N qÜ•ñßh±XÚ<¯Uõµ}ûö<¨òøÚk¯}÷ÝwÝn÷ºuëÆÎõT™Òͺ°Ðz"È¿;©ÿ.ll «¨Öƒ&p›ÍæÄÄD!D=”QXÅÆ—/_~æÌáõ}_nnnqqqqqñ£>ºwïÞ/¿ü²¸¸XI ¸¿R~jjª¢ªªª©©iРAžs6›ÍÞ5©®®6™L—^z©ògÿþýÏž=âeðˆÁNgÚ´i[¶l¹÷Þ{·lÙâýU€ÿqCTÆc8笪±±±ž¢úõëwæÌ™Wà¾ûîÛºuëwÞ¹uëÖ|0Ìãšæ&lBäøt'z— hP·øøøæææÖÖV!Duuuè½Gaaá+¯¼R[[ûÉ'Ÿx^3yyy;wîüòË/‡ž——·mÛ¶“'O^ýõÁö÷–––W^^îp8GmmmUU•÷6›­µµµ¢¢Bù³¬¬¬wïÞí­a0÷Þ{ïŽ;öíÛ÷Ýwß?Þç¸n·ÛsÜ•ñÙ³¬¬,œó VÕææfOQ§NRÊv&OžüÞ{ﳪé³jÕªÙ³gggg1"ôÞééé‹/1bÄÀ‡ æÙ~íµ×ºÝîQ£Fyçåå…ØßGQQQlllvvvbbâ­·ÞzèÐ!Ÿ^~ùåúúú>}úäääÜxã‹/no C˜6mÚ¡C‡¦Nêÿ¯uëÖÅÄÄdddØl¶5kÖ„¨Ìúõëív»ÍfËÍÍUfžió¼‚U5>>~äÈ‘ ¸üòˇ ²hÑ¢ÐW ??ÇŽùùùá_O5qcEdÑt@ž¯ÎèNBS-Œ1Ir[ìB{÷î½ûî»O:Õ­›V×K’™Išå²¡&w-D Ý @hª…1]¿BP—{饗¦OŸN8%¼Û!²èQ: Ïuê@fªÝ% =<`·Û322 ôá‡öêÕ«««£%üǧ×|{±‘ƒrPÊA9¨ŽÚù$­œ)å ž:"G‡i¢sPÊA9h{«ã3ÕÐAôá òÔSlTÃqað1r¨@ž¯§¡$þ"‚èNBS-ŒáfPÔÀ‡ïÏKJJºwïî³±´´4--­Í²<Ï sè€Îç˜t' ™L&ÚFÓ-`î#++«¦¦&üBÛ»?tŒ+"‹î¤n·[’rº€ÐT c˜ý€ÆHÌAèN¢Q`@ÝÆŽÛØØhµZ­Vë©S§”­«W¯¶Ùl™™™»wïÿšÊRTT”™™™Ð§OŸ+V,Ô{å±OBˆúúú´´´ÔÔÔ‚‚‚ÆÆÆèž(ºˆ<ƒaк“ÈóÕÝ @hª…1Ý>üðC³Ùìt:Ngff¦ÂårÙíö3gÎÌœ9sáÂ…Þ{Ûíöyóæ½õÖ[õõõGŽ3fL8ÇXà¼yólj'NŸ>]]]½dÉ’ˆŸ]’$˜ƒ>Ð$$Ïg6@5ªt»Ý ,ˆ‰‰™8qâÁƒ½ÿwäȧә’’rÕUW…s ÿ/^¼øÚk¯­\¹211Ñb±<þøão¾ùfDÎ²áÆŠÈ¢;é€<_Ñ„¦Z "7›Í‰‰‰Bˆ=z¸\.ï%&&¾ýöÛ›7oîÛ·onnîž={Â9†UUUMMMƒ JIIIII3fLmmm΀HÌAèN’ç3 šØöþãÆ7n\SSÓêÕ«g̘qäÈ‘5---..®¼¼Üb±tàéÐ,z”È3¹ u 3ÕîÝRSS].×Ù³gÃÙ»²²òý÷ßohhˆMLLlmmíØQ-K~~þ£>ª WTTìØ±£cE02 At' ‘îêÖ³gÏ_üâ HIIñ̵LKK˲eËÒÓÓ­Vëúõë7mÚÔáÅÆÆfgg'&&Þzë­‡êpQ7VDÝIäÉI ;Mµ0Æ$Émz%Ï×ÓГ‰»"†î 4ÕÂnFUñA|˜kdF¦"ˆî$!Òa@±]]èƒaˆ,Þ§u@žÝ @hª…1Dä4Fžx:@w’" *¾:ä‘Ð2 At' ‘G"kÑÅ`"‹÷iç†@wyä˜<ñt€î$!D9@U|u>È# 1d ‚èN"DÖ ¢‹Á0DïÓ: Ï î 4òÈ 0yâ9èÝIB4 ˆ«´´4---õ‰yrtßt’ja 9‰H0×±À7²e–””˜L&«Õj±XFŒñÍ7ßtøÐYYY555í:¨ÕjMLL¼í¶Û¾ûî»W$ùloò|fTCDŽèâÆŠÈÒYw2›ÍN§óüùócÆŒ™3gŽšu:555Æ {ðÁÕ9®‡<_é¬;ˆ8ÕÂ"rñ`níÚµýúõ³X,#GŽ,--U6>ýôÓ?ÿùÏ=ûüä'?yùå—îé1vìØÆÆFeøùÔ©SBˆsçÎMž<9999--í‘GinnX˜˜˜üüü#GŽxoôq/))±Z­Ê㪪ªñãÇ[­ÖœœœuëÖ)Û=;+V¯^m³Ù233wïÞâÄÍfóŒ3”1ò`‡Beff&$$ôéÓ'ä…Ô$I>À›<ŸÙÕ‘#º¸±"²¢Ñ²³³÷íÛçp8rrræÏŸ¯lÌÏÏß¶m›ËåBØíöâââ &ÜÓãÃ?ô ?gff !fÏžWYYyøðáÝ»w?ûì³+ÐÜܼeË–†SÛÙ³g§¥¥UWWöÙgo¼ñ†ÿ.—Ën·Ÿ9sfæÌ™ . QTCCæM›nºé¦ûØíöyóæ½õÖ[õõõ>Ÿ:Lž¯Î¸;>¾¹¹¹µµUQ]]í]æ™3g”?¿ÿþûvžî¿èÞ½û<ðùçŸ;œbܸq}ôQMMÍ„ :s89IòÙÞäų̀†ˆÑÅ’s¹\---={öt¹\+W®ôþWÿþýùùù;vìÈÏÏosO!DÏž=ñ‹_ 0 %%E™kåå—_®¯¯ïÓ§ONNÎ7Þ¸xñâð«³jÕªÙ³gggg1³}Æ gÏžµÙl7ß|ó¤I“bcÛ½ô²gB˜´´´¯¿þzÓ¦M!×ÒÒ²lÙ²ôôt«Õº~ýúöK~á÷%ÙoÒÖ²Pí"Ïg6@5&FUÊ]•n†ŠH§:xðàèÑ£Ã\UGZÛ·oŸ?þáÇ»º"Z¬/•””dgg[,·Û=tèЗ_~ùª«®*)):thCCC”*íòìƒrâB“É4|øðµk×0@åjðÆy¨Ö# 1ùqûöíW]uUDꣲƒ:tHQ^^þÔSOMœ8±«k¤mÁúR—,Þ$ƒ._@JîC""Gtqc…œÖ¬YÓÉ$ì®rîܹ»îºËjµ^}õÕ×\sÍO<ÑÕ5j7yrÚ¼;µkñ&hý¦ðojï SÞÕð_»*àW÷ &œ¤¼WZ±bEè‹ hyäXDâ¹ÒÒÒÐ+ãHkÔ¨Q%%%N§Ón·u ³ÞB÷¥v-Þ$ÚZ¿)ôâM^aJZå*àW÷ ¦Í¤|V3fLW'lò|fTÓîŸíB: òÜB„}Ê:JBˆ¡C‡†³x“øçúM§OŸîÑ£G=üñŸýìgÞ;x/Þza&ñϦN:•ðûßÿþ‘GùÝï~pgO4üðÃ?^x-quçwz–¸ ¸g°w:iiiÊä˜yV^ã0 "rD7V>äÉIèØÝ)ØjJ\¿©Ã+L[»Êg‰«{ÎRÞ«G͘1£]ç hyä˜<ñt })ØjJ\¿©Ã+L[»Êg‰«{+6ôR>«G)ñzDð‡‘#º¸±ð!ÏWg»;[MItný¦¯0bí*ï%®BïéþR>«G){:£Zà Aˆ.~Ù @Z&Sߣ½~Ó±cÇ®¹æš€¹à"…_vB'ä  y¾:‹øÝIÍõ›<¨L’ zÈ#€Àä‰ç ‘íKª­ßôÒK/,]º4Jåw-^ã0 ²V]d­ âèTˆú’œhÈCµÞÈ A4†÷iDÝIB4 ˆ1r€ªä‘ÐrLAô% ñ‡‘µ‚èb0 €yn„}B#“'ž‹6>Ъ€Ë+!D9HJ¯¹^Ï :ŒÕ²VhŒ$ÁôAÝIñ·h/ÍÿþôJž|ëÈÒëyu•`9WвVh ©Pˆ ­÷%­×? ^ã0 ²V] †ð!Ï AaŸçbr³¢ùÈ 0bDÝIB4 ˆˆÑÅ€yFse¨™19ÖØ IDATFŽ)"ˆ¾$!^ã0 ÆÈ]ò †„<7Â>¡‘GÉÏAèN¢Q`@Däˆ.n¬|ÈóÕ™ u 3òÈ 0rLAô% ñ‡1FŽè’g0 €$ä¹!öÞxTqU%D£À€È#ùÊèævMÆs4pUM#k€Æ3ŠH+J Ø—ägÌ×8 ŽˆÑÅè‡àä‘Ð òÈ 0I‚9¸ÝnBÆh3NwÒDDŽèâÆ tžÎ^Gòd<ËP2Sí.AÖ 1T*!c´§/iˆ¡^。1rD—<ƒa€Féïå#ÏöMµ0†ˆ€ÆÈÏAèN¢Q`@ÌGP_EWÐ4òÈh 9¦ˆ ú’„xÀÈZAt1lÀ‡<7Â>¡‘GÉÏAèN¢Q`@ä‘TÅWgÑÀU4nPڤ΂_vИ.½@IÕ‚&“NÞ¥ºª¤§sÂDÖ @UòDZÞùÐ…ˆÈhŒ<ñt€î$!D9@U&“I’Ái"?’ " 1òÄsÐú’„xÀÈZ¨Jž‘iÂ>’ " 1òÄsк“„hY+UÉ““@ä@Dä4Fžx:@_’¯qY+UÉ32MØ@Dä4Fžx:@w’"k *yrˆüH‚ˆ€ÆÈÏAèKâ5"k *yF¦ ûH‚ˆ€ÆÈÏAèN¢Q`@d­T%ON‘I‘Ðyâ9è}IB¼Æa@d­T%ÏÈ4aI‘Ðyâ9èÝIB4 ˆ¬€ªäÉI ò "r#O< /Iˆ×8 ˆ¬€ªä™&ì "r#O< ;IˆF‘µP•<9 D~$AD@cä‰ç ô% ñ‡‘µP•<#Óz û乪:ÀÄk`L&o‚¤ÀÍ *edšwð €ÆcŠ¢/Iˆ×8 ˆ’ " 1òÄsк“„hY+ФäääÊÊÊv=¥±±±OŸ>‡#JU&yrˆüH‚ˆR;yò¤Éd²Z­=zôÈÌÌ|óÍ7…eeeqqq—\rI»Š2›ÍgΜIII çXYYYï¾ûngkßNn·;99¹¢¢Â¿>žsY’|6€7y>³ª!"‡Ôöïß?tèP§ÓY__ÿÐCÍ;WqðàÁ¡C‡FãXƒVŽõÀÌ™3'â‡íäÉ“±±±—^z©§>þçî­¥¥Eåáv»%œ&ì "rHmÿþý×]wÂd2Ý|óÍõõõBˆo¾ùF‰ÈçÏŸ¿téReÏ¿ýío#FŒP»\®y󿥦¦^qÅ/¿ürVV–â…^˜5k–âù矟þøã›nºÉó#Ѻºº!C†«OÀ„[·nýÏÿüÏË.»ìW¿úUSS“bÿþýJ¾J°sWÎb„ Ê>;vìÈÍÍMNNö<%--í£>ºé¦›úöí빌áWÀgKÀò…>Õˆy†QqÊÛOW×BòÈHƒˆò:pà@ß¾}½7;v,===99ùÛo¿4hò†Z]]퉀«««=Ad]]Ý®]»†ZRR’œœÜ«W¯’’’¤¤$Ï<-žT–ôîÝ»W¯^&“iÞ¼yN§óóÏ?BTUUM›6ÍñOuuu«W¯>{ö¬çµµµŸ|òÉСCƒÕ'` BˆÛo¿}çÎ_~ùå{ï½÷׿þÕår}÷ÝwÊS‚{II‰ÅbQrÖ…‡CÑB´¶¶nß¾}̘1UUU>óÉ„Yÿ-Ë÷¯FÄ‹CM’|6€7y>³ª!"‡¼öï߯ `{óü¬³[·nuuu­­­MMM?ü°ÍfSFp¯¼òÊ;wž>}º®®®  Àét8Ð;‰Ü3}ñâÅÒÒRO ¸'ŽýñüÁ!®¾úê¿þõ¯‡BÔÖÖîØ±CqÅWìܹ³¢¢ÂápÌœ9Óét4(X}–ðî»ï~ÿý÷BˆsçÎ]¸p!;;»®®Îd2)óÁÎýÀžÊ !®»îºO?ý´¼¼üâÅ‹¿úÕ¯²²²F5tèÐ;v(?Wýæ›o***¬€ÿ–€åûW#‚ˆÅ Bž†&ì "rÈK™ŽÐg£çg·ÜrKFFÆàÁƒï¹çžÌÌLO<}ÇwÜvÛmÙÙÙ7ß|ó!CrrrÌfó7ß|ã‘r€q‘Ø !æ#‡1FP•<#—„}ú&Ï·1Ð(²VPáš„h9@UòŒ\ÊPDí‹N"5¸"!òÈa@Œ‘T%ÏÈ%aŸ¾Éóm 4Š+V¬¨¨¨¨ªª*((ˆ‹‹‹‰‰>|x^^^°ç*Ö¯_Ÿ™™™””4wîܦ¦&ÿ2…çÏŸŸ>}zjjjrrò´iÓ<õy饗222¦OŸî“¬â_f}}}aaaZZZjjjAAAcc£O Êo¹å–>ø ‚×ÐI>À›<ŸÙÕ‘C·Ç÷ß?`Àÿ544lڴ馛n ö\»Ý>oÞ¼·Þz«¾¾þÈ‘#cÆŒéÛ·oFFÆ”)SÞyç³g϶yt—˵k×®£G?~|ÿþýË—/÷/SQPPÐÐÐPVVf·Û~øaÏsKJJJKK_}õÕÐe !æÍ›çp8Nœ8qúôéêêê%K–,!''ç›o¾ ÷Úi£_Ú%OÛöé‘=:IÕ.䢬«zÚÉ“'cbb<;vL‘œœœœœÓ»wïãÇ+ÛÍf³g‹Åâv»ÏŸ?ß½{÷M›6ÕÕÕyøÐC]qÅ&“iÔ¨QÇø\ϱÊËË•?·oß>pà@ÿ2NgLLŒg7ïçž;wÎó§rˆ€eÖ××ÇÅÅUTT(¿øâ‹+¯¼Ò§ÅáÇ­Vk§.hGE©pÓ.©ÚNžšÀCªÒ^Þï ÇïÕ«W—Ô'4i+ï·]`Œº•œœÜÒÒrñâEϳÙìp8‡Óéœ6mÚüùóƒ=711ñí·ßÞ¼ysß¾}sss÷ìÙ#„èׯßÚµkKJJΜ9“™™: =66öÒK/U÷ë×ïÌ™3þeVWW›L&ÏnÞõ ˜¤î_fUUUSSÓ AƒRRRRRRÆŒS[[°„ººº”””ÖåÖÕµ@GÈÓv’ Õ#JÚõmÌàÁƒ¯¾úê%œ‰°"òýˆð©m'+Á‰ÅäD9)))—]vÙÑ£GýÿÕ½{÷xàóÏ?BÄÇÇ777·¶¶ !ª««=ûŒ7î£>ª©©™0aÂŒ3¼ŸžžžþÛßþöÛo¿ ö\!DsssEE…òøÔ©S½{÷ö/Óf³¹ÝnÏnmò/3---..®¼¼\ù¤Q[[[UUð¹GŽ¹êª«Â<`’|6€7õ?³íÝ»÷‡~(//?pà€šÇ<ˆÈ¡gãÆÛ¹s§ÿv—Ëõúë¯ggg !úöíkµZ·mÛær¹^|ñEe‡ÊÊÊ÷ß¿¡¡!66611±µµµ¦¦æ™gž9yò¤Âáp¬Y³æ†nø\…ÉdZ¼xñÅ‹ívû’%Kî¿ÿ~ÿ2-ˤI“,XPWW×ÜܬŒÄ‡à_¦ÅbÉÏÏôÑG•¡ñŠŠŠ;v|î§Ÿ~ú“Ÿü¤ÝWPbòä"£½äi;Âq} ?²íµ×~ö³ŸÝ}÷ݯ½öš²Eý]½zµÍfËÌÌܽ{·â™gžñ ¹ýöÛ7nÜ8vìØÆÆFejÝS§N)ÿòy¢Ï4þ% !ªªªÆoµZsrrÖ­[ç3UÀ† î¿ÿ~!DKKKbbâ“O>)„8uêTjjª2*´víÚ~ýúY,–‘#G–––;Om=ëX­üÏýܹs“'ONNNNKK{ä‘Güg óŸá Øüþ•BØíö;ï¼S©ÏÇìß”þס3ÔüpHD=+((xã7<zniii_ýõ¦M›„111«V­š={vvvöˆ#”=[ZZ–-[–žžnµZׯ_¿iÓ&³Ù|ðàÁÜÜÜ„„„¬¬,»Ýþꫯ|®">>~äÈ‘ ¸üòˇ ²hÑ"ÿ2…ëÖ­‹‰‰ÉÈȰÙlkÖ¬ }:þe !ŠŠŠbcc³³³o½õÖC‡ù?±±±qûöíS§NíÜåtH’Ïð¦òg¶–––7Þxcâĉ“&MÚ²e‹à !\.—Ýn?sæÌÌ™3.\(„˜:uê;ï¼ÓÐÐ „8{öìgŸ}6qâÄ?üÐ3µnfffÀ'ú¸ÃìÙ³ÓÒÒª««?ûì3ïw.E^^^qq±⫯¾²ÙlÊãâââÜÜÜnݺ !²³³÷íÛçp8rrr<9™þò¯mgjå_ÚìÙ³ãââ*++>¼{÷îgŸ}Ö{ÿ€3›Ÿ à5,((HNN®®®Þµk×æÍ›ý¯mÀë  *æ¬Ã º¶§ýô§?ݹsgW]EEE .쪣s«´èœrŠT»„YÎ|ЫW¯¦¦¦ÆÆÆ”””?þØýÏÓŸ?Þív8p 55UÙ9//ïÍ7ßt»Ý/¼ðÂĉÝ~?å øDŸiüwp:ݺuóüLÿÃ?ôÿÍ¢Íf+--}þùç—.]š‘‘ÑØØXXXøÜsÏùì¶wïÞÞ½{‡S·ßäí­•Oi>Ó|ðÁ999ÞûûÏpb~ÿ‹ï_~ˆ_vz®Cg¨y‹`Œ:÷—¿üEY³ÓÈ •©øp“¸"ï`H›7o¾çž{bccãããï¼óNÏÈ«ÙlNLLBôèÑÃår)§M›¶eË!Ä–-[‚}ñð‰¡w¨®®îÖ­Û%—\¢ì‘‘áÿ¬ÜÜÜââââââ[n¹åúë¯ÿòË/‹‹‹óòò”ÿnܸqÀ€III£G¾páB˜5é|­¼ùLWпŸÉ‚ýg81?ÍýË÷¯CÀë  Dä4Iž\d´—}úôé³mÛ¶·ß~Û{’.÷Þ{ïŽ;öíÛ÷Ýwß?^D(ñÉf³µ¶¶ž9sFùóûï¿÷ß'//oçÎ_~ù¥²DݶmÛNž «¼ýöÛ)))Gýú믿þúë£G*¿×¶jjêm·ÝöÀLœ8Ñl6+[\.W8+Ç…`±Xî¸ãŽE‹)¿Ý÷I¿VäååýéOÊÊÊ2›Í£F***>|x||¼Âårµ´´ôìÙÓår­\¹2ÄÚUÛ6kåSšÅb¹ë®»”ýkjjžzê©)S¦xïp†ƒ0ç'PÊ¿óÎ;=å/[¶Ìg‡ð¯ƒ„ˆÈh’Êßkˬ´´4--My¼|ùòÔÔTÏŸ!öìBò´Ḿ…ómÌk¯½6sæÌK.¹D#¿ä’KfÍšå™q% iÓ¦:tÈ“²Ò³gÏ_üâ HIIñ̵Ò6l8{ö¬Íf»ùæ›'Mšë³Ãµ×^ëv»•}úäääÜxã‹/öÞ?à áÌOà±~ýz»Ýn³Ùrss•Ég¼…¤æz&In‹Ð1¥7ÓÓ K ¤¤dèСÊ .—kÒ¤I ï¼óN=º¶2ÞœNgjjêÑ£G³²²Ô¯•™L¼ êY”n>{÷î½ûî»O:¥Lr Û·oŸ?þáÇ£T~ÇÈY«¨Róý‹1ršÔU¹È.—kâĉï¾ûn—„ã!TUUÅÄÄÈŽ“GuDéÛ˜—^ziúôéÇ<¨ ———?õÔS'NŒlù#g­TC9ÈÈårM˜0Áår½óÎ;ʲþk[ܨ,x±~ýúÌÌ̤¤¤¹sç655y—bE ÿ7®ñQZZzÕUW)Û§L™p)“N®¢K’|6€&Øíö„„„ýû÷/X° â…Ÿ;wî®»î²Z­W_}õ5×\óÄODü g­t‰ˆ€&©Ÿ‹ìv»'L˜ÐÜÜì ÇEµ-‚-x±k×®£G?~|ÿþýþóQ[ÃÅ€k|deeíß¿_ÙþÆo\ʤÍÃ…^ $RÈ#‡:"þmL¯^½êëë÷îÝÛ«W¯«5jTII‰Óé´ÛíEEEž›L×’³VªQõ ½Ïoø¡§œ>:À±cǺuë–ð_ÿõ_ž×¶±à…ga‹íÛ·8Ч|ÞŠ999!ÖøðÞb)“¯Q¢3:è™A7t!5»ï/y@ÔÿÁh\\Üÿ÷Oœ8±W¯^Ê<Äžµ-”Ün·Ùl¸QëYØ¢_¿~ž)~=Â\#üIÖ”¥Lî½÷Þ-[¶ø/åÝùÕ@:LžûÊPDí‹NR³ ‘µá;vì¦M›òóówîÜ)„¸¶E°/š››= [œ:uÊጀ®¸æ·¨þK™„s¬Ðk”è‰+@çyϬêó{•.­—–‘Ð$ï¯Õ4a„—^zé®»îúâ‹/®mlÁ “É´xñbe¡%K–øÏ¤PÀ7Â\ãÃ)“6Õæ%ÑUmçp\ßä™Õ§óÚݪ geeÕÔÔ¨p `ç¥óU³ ‘@ûLŸ>ýÙgŸ7nÜ7ß|pm‹€ãããGŽ9`À€Ë/¿|È!‹- ópþ+n„¿Æ‡ÏR&mjsý‘ä³|è)˜¢Nº:Œ¬«û8¤¥~ñb£Äç7—ªùòË/ûöíÛÒÒÒç~ðÁ>??mµTÕû†?åµùâ‹/Úl¶~ýú}þùç+V¬°Ùl—]vÙîÝ»•}.\¸0gΜ^½z¥¤¤Ìž=»¡¡AÙ¾víÚŒŒŒ=zôîÝûücÀ-kÖ¬ÉÌÌLHHøÑ~tüøqå‰gÏž7nœÅb0`@QQ‘òê`GQ\~ùåB‹Åb±XÊÊÊÜn·Ýn¿÷Þ{“’’zõêõ«_ýª©©Éÿ¼”ÇþuXºtéƒ>èÙùöÛoß°aC°Úz¬_¿~Ê”)n·»¹¹Ùjµþîw¿s»Ýeee)))Gõ.Øoͽÿ»nݺŒŒŒÄÄćzÈår;ÿëé^ŸÐGNŒ‘€nµw)Ãý«¼ƒIDAT®Â@¬TºjÙ¯³gÏVVVΚ5kòäÉçÏŸ¯¬¬œ3gŽç÷Ðç3µÛíóæÍ{ë­·êëë92fÌÿ-Bˆììì}ûö9Žœœœùóç+œf4àQ<üç<õŸ5Ø ú×!??Û¶mÊOºív{qqñ„ ‚ÕÖ#//¯¸¸XñÕW_Ùl6åqqqqnnn»ÖK 8¬ÿ鼞ç~õßþÅ‘HW$ýSŒ¼¦¦¦G×]w]MMMøÏÚ¹sçW\a±XzöìYXXxñâÅèÕP¼Ê£«âe&ÐÚÚZ·Ûýí·ßšL¦ .({öìé2É©Ûí>þ|÷îÝ7mÚTWW§üË‹·½{÷öîÝÛdšÑ`Gñ®§÷=$༨!ö÷©ƒÛí¾öÚkß}÷]·Û½nݺñãLJØÓ›Íf+--}þùç—.]š‘‘ÑØØXXXøÜsÏy®Í1rá7lÀÓ x=ƒÝK½··yq§æ-‚1rˆº+¯¼RY¬G5[ÊÄ€«¸É¬“@×~Sa6›“’’„ñññ Êce ^Ï|¦))))))cÆŒQ~´˜˜øöÛooÞ¼¹oß¾¹¹¹{öìñß"„ظq〒’’F}áÂdšÑ`G ¦]ó¢ú×Aqß}÷mݺU±uëÖûî»/ÄžÞrss‹‹‹‹‹‹o¹å–믿þË/¿,..ÎËËkÇå4lÀÓ x=ÃÑ™Ic»9Mâ‡_Ú%OÛŽw¹Ð!"C¬a°ùL…ãÆûè£jjj&L˜0cÆ ÿ-‡£°°ð•W^©­­ýä“O”Êœf4ÄQ<ÊûÏ€ó¢¬À:!&OžüÞ{ï|x^^Þ¶mÛNžÙb<8zôhuVíimÝ4ÔìBŒ‘Ð$yr‘£¡¹¹Y’B¢Až¶“}V¬Xá°QRRbµZ={®_¿>333))iîܹMMMŸ.„8þüôéÓSSS“““§M›¦øÒK/eddLŸ>Ý'!$`™õõõ………iii©©©>…<®GÀSP6®^½Úf³effîÞ½[1vìØÆÆF«ÕjµZO:%a"M‡IòÙ†rîܹ»îºËjµ^}õÕ×\sÍO<ÙògΜ¹fÍmLÂÒÿ ÉtIå¡/e­ŠÏ?ÿ|øðá‡C™! ÏâN§óî»ï^¾|ùï~÷»€O/((p»Ýeee {÷îUž[RRRZZÚÚÚê}ˆ€e !æÍ›wáÂ…'NtëÖmêÔ©K–,ùùÏî]HøÕö9»Ý~æÌ™¥K—.\¸ðÓO?ýðÇêt:•JJJ:s1å¶$×7i³V”iF£WþÆ£Wx'©?lgµr‰‹‹;räˆÓéLII ñu°Ûí^¾|y=l6ÛüÇlÙ²%àÓ/\¸ðç?ÿyåÊ•III±±±#FŒPžûä“OÆÅÅ™Íæ6˼xñâk¯½¶råÊÄÄD‹Åòøã¿ùæ›>…„_mŸÃ-X° &&fâĉìÌu“Ÿ„á"" I*ç"‡¿V…ÿâŸî³†…Âl6§¦¦†Yf°%E¼ éØf³911QÑ£GeíÈ"ê6ZA9HÇg­ŠøøøææfeŠÜêêjÏnþ‹_|ºÍfs»Ýž=C Xf›KŠ<®÷¿‚‚?IèhÐñ©¡þFÂ3Ýgž „‰ˆ€&©<úå¿VEß¾}­Vë¶mÛ\.׋/¾èÙÓñ‹€O·X,“&MZ°`A]]]sssèÑë€e¶¹¤HÀãzÿ7Ø)ø ¶*GÇÈ3rI8®oá|N••%á4‚Pš_è‘@Ûüתˆ‰‰YµjÕìÙ³³³³•,pEÀÅ/.u±nݺ˜˜˜ŒŒ ›Í¶fÍšGX¦hkI‘`Çõv þ‚­Ê¡’|6`p,Ž@“¤Em¢í ¬¬¬'NX,!Ä¡C‡\.×СCÿð‡?,Y²¤G[·nýÑ~佨MQQÑ3Ï h9M’gNk´—Euìmj~¡Ç쇠OÞS¶µkÏðŸ¨u&o‚zÆ<›è$5»P¬ Ç€ˆã½V»äi;ꀀ"ÒIh_t’š]ˆ¬˹sç&Ožœœœœ––öÈ#477+Ù«W¯¶Ùl™™™»wïöì\___XX˜–––ššZPPÐØØè]ÔÚµkûõëg±XFŽYZZêÙ~þüùéÓ§§¦¦&''O›6-àÿ’•j¬_¿>333))iîܹMMMBˆ±cÇ666Z­V«ÕzêÔ©¢¢¢ÌÌÌ„„„>}ú¬X±Â»>>{*ýÏ+ôIi‰+d@D@“ÔÏEž={v\\\eeåáÇwïÞýì³ÏŠà‹‰Ì›7Ïápœ8qâôéÓÕÕÕK–,ñ.*;;{ß¾}‡#''Ç{Í¿‚‚‚†††²²2»ÝþðÃܰä€ë’x/}b±XB¬læ")¡O*|ä‘£Mé$òÌêRµ ¹mq:111åååÊŸ|ðANNαcÇ„çÏŸw»ÝHMMUþ[__WQQ¡üùÅ_\yå•‹Ý»woïÞ½"à–€%+Õðì¶}ûöºÝîcÇŽ™Ífeãùóç»wï¾iÓ¦ºº:ÿjxï©üé^។†ð&¨oÄ9è$5»yä4Iå\äêêj“ÉäYû£ÿþÊti©ªªjjj4hò§Ûí6›ÍÞ¥mܸqùòåÊê!žSð9DÀ-ÁJns]e9’?þñ?üðUW]õüóÏ{OûàÏÿ¼Ú<©ð‘GŽ6‘G¨Ù…ÈZ€¶Ùl¶ÖÖVÏÚeee½{÷¶sZZZ\\\yy¹Ãáp8µµµUUUžÿ:ŽÂÂÂW^y¥¶¶ö“O>ñÜñm6›Ûíö"à–`%û¯K"üR2B¬lÎײ¡OJ»Èj "ršäý•¢ ,Ë]wݵhÑ¢‹/ÖÔÔ<õÔSS¦L ±s~~þ£>Z[[+„¨¨¨Ø±c‡ç¿.—«¥¥¥gÏž.—kåÊ•ÞÏš4iÒ‚ êêêš››÷ìÙpKÀ’ý×%ÿºôIè•MÂY$%ôIµ‹ÊmḴ"ÒIÈ#G'©Ù…ˆÈ ,/¿ür}}}Ÿ>}rrrn¼ñÆÅ‹‡Ø¹¨¨(666;;;11ñÖ[o=tèç_ééé‹/1bÄÀ‡ æý¬uëÖÅÄÄdddØl¶5kÖܰdÿuIÄ¿.}râĉ+›„¹HJˆ“Ò.I>08G Iòä"w9Í-èCÛ¡Mt cäã"«€ ˜k€&1x¦]ò´Ḵ"ÒIhG'©Ù…ÈZ”ÉÄ› ž‘£“ˆÈ  ¼×jm‡6ÑI`4䑌‹Ä2`Œ`P Äêí‹NR³ 1F0.Â52`Œ€&1ú¥]´ÚD'Ñ0Fm+))éÞ½ûK/½”žžÞ¿ÿÝ»w¯\¹2===##ãïÿ»²O}}}aaaZZZjjjAAAcc£²½¨¨(333!!¡OŸ>+V¬¸eíÚµýúõ³X,#GŽ,--UžXUU5~üx«Õš““³nÝ:«Õâ(èòÈÈ€ˆ€&¹Ýn•ÇÏ\.×Ù³g+++gÍš5yòäóçÏWVVΙ3gáÂ…ÊóæÍs8'Nœ8}útuuõ’%K„v»}Þ¼yo½õV}}ý‘#GÆŒã¿E‘½oß>‡Ã‘““3þ|¥ÀÙ³g§¥¥UWWöÙgo¼ñFˆ£h‹úm Ḵ"ÒIL&MŒÎP³ ‘µm+))ÉÎή­­MJJ:tèÐСCNgBB¡C‡òòòìvûÅ‹“““ËÊÊ.¹ä!Ä?þñûï¿ÿرcuuuéééëÖ­›0a‚2Èí¿ÅÛ¾}ûÆæÌ™ .$%%>}Z)ð£>úÙÏ~V]]ð(ª_`>r}#õÄ/;  ê~™Í椤$!D|||BBBBB‚òXÉ©ªªjjj4hPJJJJJʘ1cjkk…‰‰‰o¿ýöæÍ›ûöí›››»gÏÿ-Bˆ70 ))iôèÑ.\BTWWwëÖM‰¼…!Ž¢-òŒ\«I+"Džoc Qjv!"rˆ€´´´¸¸¸òòr‡Ãáp8jkk«ªª”7î£>ª©©™0aÂŒ3ü·8ŽÂÂÂW^y¥¶¶ö“O>QÞl6[kkë™3g”B¾ÿþûÐGAÇHòÙ€Á‘Ð$ÙF¿,K~~þ£>ª ZWTTìØ±CQYYùþûï744ÄÆÆ&&&¶¶¶úoq¹\---={öt¹\+W®ôxÇw,Z´èâÅ‹v»ýÙgŸ qm‘§íÇ¥ÁñÄ]]£È§í¸)IKžN¨ƒ¬¨‡7?Þh!ó‘cäPï†Ùd¤™j—333))iîܹMMMBˆ¢¢¢ÌÌÌ„„„>}ú¬X±BqþüùéÓ§§¦¦&''O›6Mü3;套^ÊÈÈ9r¤O¦Š™õõõ………iii©©©Þ%LŸ>ÝçD~ûÛߦ§§ÇÅÅÍ™3端¾ŠÚ‹bqCq»Ý’ NÓë¤%O'ÔADüŸ¾}ûfddL™2åwÞ9{öl›û»\®]»v=zôøñãû÷ï_¾|¹ÝnŸ7oÞ[o½U__äÈ‘1cÆ! ÊÊÊìvûÃ?ìynIIIii髯¾ºL!ļyólj'NŸ>]]]½dÉ’%xÛ³gÏàÁƒ;sM¢-t,nŠ>5O"ì 7 Mt¹“'O>ôÐCW\q…Éd5jÔñãÇ;f6›•ÿ;vÌb±x !ÊËË•?·oß>pàÀóçÏwïÞ}Ó¦MuuuÊv§ÓãÙÍû¹çÎS{—ï_f}}}\\\EE…²ñ‹/¾¸òÊ+½K¦¼¼¼wïÞÿû¿ÿÛé«!:@×Üþ¤ïÞ4Wáôt.ˆ: Œ†1rà_ôë×oíÚµ%%%gΜÉÌÌ|ðÁCì{饗zžxæÌ™ÄÄÄ·ß~{óæÍ}ûöÍÍÍݳgOuuµÉdòìæa6›&©û—YUUÕÔÔ4hР””””””1cÆÔÖÖ†(AqñâÅ{î¹ç7¿ùÍèÑ£Ûqþ]D¹Û=êŸ)dÃ÷$d@D–žžþÛßþöÛo¿onnnmmBTWW{ïÓÜÜ\QQ¡<>uêTïÞ½…ãÆûè£jjj&L˜0cÆ ›Íæv»=»µÉ¿Ì´´´¸¸¸òòr‡Ãáp8jkk«ªªBâv»xàn¸aÁ‚í:ë®E”lò44Ḵäé$€:ˆÈÿSSSóÌ3Ï(Ó:Ž5kÖÜpà }ûöµZ­Û¶ms¹\/¾ø¢÷þ&“iñâÅ/^´ÛíK–,¹ÿþû+++ßÿý†††ØØØÄÄÄÖÖV‹Å2iÒ¤ ÔÕÕ577ïÙ³'tüË´X,ùùù>ú¨24^QQ±cÇŽÐ…<öØc.\X½zu§.Gáj¢³9ðÌfóÁƒsss²²²ìvû«¯¾³jÕªÙ³gggg1Â{ÿøøø‘#G0àòË/2dÈ¢E‹ZZZ–-[–žžnµZׯ_¿iÓ&!ĺuëbbb222l6Ûš5kB×Á¿L!DQQQlllvvvbbâ­·ÞzèСЅ<÷ÜsŸ|òIrr²ÕjíÓ§Oç®J× .×1y~SK“–<P‡‰ûTcÒÑ2àè:@gèéêIu.&ïƒ2’ª“*ˆíê ŒEž0‹QXiÉÓIuµ0."?2 "¨JžaÂqiÉÓIu‘Œ‹°€ È#¨Jž‘iÂqiÉÓIu0F0."?2 "¨JžaÂqiÉÓIu‘Œ‹°€ È#¨Jž‘iÂqiÉÓIu0F0."?2 " 1$˜j<-H8.-y:  "r€qöyä4†qM­“§ Ç¥%O'ÔÁ9À¸ˆüÈ€ˆ€Æ`ªuò´ Ḵäé$€:ˆÈÆEØ@ä‘ÐÆ5µNž$—–<Pcäã"ò "rC‚©ÖÉÓ‚„ãÒ’§“ê "aG@c×Ô:yZp\Zòt@Œ‘Œ‹È€ ˆÈh ¦Z'O ŽKKžN¨ƒˆ`\„}d@9a\SëäiAÂqiÉÓIu0F0."?2 " 1$˜j<-H8.-y:  "r€qöyä4†qM­“§ Ç¥%O'ÔAD’ò½·²D—€ ÈZ 1ÆI0Õk°(O êõ ë€<PcäP7Y ó%#Åd2q1t9"rc¨øÉívëïC¬<-¨¿k«òt@DäPwX "x)E€ È# 1FK0Õ_È(O êïÚê†<P9h Addö¿h ðŽÜ´#H¹ª\R]Ž1rÐ bLjã’91f‚©žGyZPOWUgäé$€:ˆÈ@£°€ È#yä$Á9À¸ÇÈ€1rø¦ÖÑ‚hFÃ9À¸È# ÆÈÅ@,I0F0.Âq2`Œ€Æ0®©u´ ÚD'Ñ0F0.òÈÈ€1r€A1 @Œ‘Œ‹p€ # 1Œkj-ˆ6ÑI`4Œ‘Œ‹¹$´±‘ÐË;r`9¥ ±À6rzÉq`9pŒ]ó:'È'—„66rzyGl`# ”!XÂF@/9l`#ޱk^çùä’ÐÆFI6rH²‘@’"Ž™¬;Í òÉ%¡Í_úþñ¤–6Þ‘@’W+¤È I‘@’"€$EIŠ’9$)rHRä¤È!iffæyžô‡1Š’9$Íû¾éo€^6rHRä¤È I‘@’"€$EIŠ’9$)rHRä¤È I‘@’"€$EIŠ’9$)rHRäôé5›tõ$IEND®B`‚icedtea-web-1.5.3/PaxHeaders.24993/netx0000644000000000000000000000013012574544466014360 xustar0030 mtime=1441974582.523016301 30 atime=1441974670.156025059 28 ctime=1441974670.0900243 icedtea-web-1.5.3/netx/0000775000076400007640000000000012574544466015520 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/netx/PaxHeaders.24993/javax0000644000000000000000000000013012574544466015471 xustar0030 mtime=1441974582.523016301 30 atime=1441974670.156025059 28 ctime=1441974670.0900243 icedtea-web-1.5.3/netx/javax/0000775000076400007640000000000012574544466016631 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/netx/javax/PaxHeaders.24993/jnlp0000644000000000000000000000013012574544466016434 xustar0030 mtime=1441974582.528016359 30 atime=1441974670.156025059 28 ctime=1441974670.0900243 icedtea-web-1.5.3/netx/javax/jnlp/0000775000076400007640000000000012574544466017574 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/netx/javax/jnlp/PaxHeaders.24993/UnavailableServiceException.java0000644000000000000000000000012712574544466025005 xustar0030 mtime=1441974582.528016359 29 atime=1441974656.35986625 28 ctime=1441974670.0900243 icedtea-web-1.5.3/netx/javax/jnlp/UnavailableServiceException.java0000664000076400007640000000037212574544466026064 0ustar00jvanekjvanek00000000000000package javax.jnlp; public class UnavailableServiceException extends Exception { public UnavailableServiceException() { super(); } public UnavailableServiceException(java.lang.String message) { super(message); } } icedtea-web-1.5.3/netx/javax/jnlp/PaxHeaders.24993/SingleInstanceService.java0000644000000000000000000000012712574544466023611 xustar0030 mtime=1441974582.527016347 29 atime=1441974656.35986625 28 ctime=1441974670.0900243 icedtea-web-1.5.3/netx/javax/jnlp/SingleInstanceService.java0000664000076400007640000000343312574544466024671 0ustar00jvanekjvanek00000000000000// 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.5.3/netx/javax/jnlp/PaxHeaders.24993/SingleInstanceListener.java0000644000000000000000000000012712574544466023776 xustar0030 mtime=1441974582.527016347 29 atime=1441974656.35986625 28 ctime=1441974670.0900243 icedtea-web-1.5.3/netx/javax/jnlp/SingleInstanceListener.java0000664000076400007640000000243112574544466025053 0ustar00jvanekjvanek00000000000000// 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.5.3/netx/javax/jnlp/PaxHeaders.24993/ServiceManagerStub.java0000644000000000000000000000013112574544466023106 xustar0030 mtime=1441974582.527016347 29 atime=1441974656.35986625 30 ctime=1441974670.089024288 icedtea-web-1.5.3/netx/javax/jnlp/ServiceManagerStub.java0000664000076400007640000000031712574544466024171 0ustar00jvanekjvanek00000000000000package javax.jnlp; public interface ServiceManagerStub { public java.lang.Object lookup(java.lang.String name) throws UnavailableServiceException; public java.lang.String[] getServiceNames(); } icedtea-web-1.5.3/netx/javax/jnlp/PaxHeaders.24993/ServiceManager.java0000644000000000000000000000013112574544466022250 xustar0030 mtime=1441974582.526016336 29 atime=1441974656.35986625 30 ctime=1441974670.089024288 icedtea-web-1.5.3/netx/javax/jnlp/ServiceManager.java0000664000076400007640000000253712574544466023341 0ustar00jvanekjvanek00000000000000package 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.5.3/netx/javax/jnlp/PaxHeaders.24993/PrintService.java0000644000000000000000000000013112574544466021772 xustar0030 mtime=1441974582.526016336 29 atime=1441974656.35986625 30 ctime=1441974670.089024288 icedtea-web-1.5.3/netx/javax/jnlp/PrintService.java0000664000076400007640000000050612574544466023055 0ustar00jvanekjvanek00000000000000package 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.5.3/netx/javax/jnlp/PaxHeaders.24993/PersistenceService.java0000644000000000000000000000013212574544466023163 xustar0030 mtime=1441974582.526016336 30 atime=1441974656.358866238 30 ctime=1441974670.089024288 icedtea-web-1.5.3/netx/javax/jnlp/PersistenceService.java0000664000076400007640000000154712574544466024253 0ustar00jvanekjvanek00000000000000package 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.5.3/netx/javax/jnlp/PaxHeaders.24993/JNLPRandomAccessFile.java0000644000000000000000000000013212574544466023204 xustar0030 mtime=1441974582.526016336 30 atime=1441974656.358866238 30 ctime=1441974670.089024288 icedtea-web-1.5.3/netx/javax/jnlp/JNLPRandomAccessFile.java0000664000076400007640000000464212574544466024273 0ustar00jvanekjvanek00000000000000package 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.5.3/netx/javax/jnlp/PaxHeaders.24993/IntegrationService.java0000644000000000000000000000013212574544466023162 xustar0030 mtime=1441974582.525016324 30 atime=1441974656.358866238 30 ctime=1441974670.089024288 icedtea-web-1.5.3/netx/javax/jnlp/IntegrationService.java0000664000076400007640000000107112574544466024242 0ustar00jvanekjvanek00000000000000package 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.5.3/netx/javax/jnlp/PaxHeaders.24993/FileSaveService.java0000644000000000000000000000013212574544466022375 xustar0030 mtime=1441974582.525016324 30 atime=1441974656.358866238 30 ctime=1441974670.089024288 icedtea-web-1.5.3/netx/javax/jnlp/FileSaveService.java0000664000076400007640000000060312574544466023455 0ustar00jvanekjvanek00000000000000package 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.5.3/netx/javax/jnlp/PaxHeaders.24993/FileOpenService.java0000644000000000000000000000013212574544466022400 xustar0030 mtime=1441974582.525016324 30 atime=1441974656.358866238 30 ctime=1441974670.089024288 icedtea-web-1.5.3/netx/javax/jnlp/FileOpenService.java0000664000076400007640000000047612574544466023470 0ustar00jvanekjvanek00000000000000package 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.5.3/netx/javax/jnlp/PaxHeaders.24993/FileContents.java0000644000000000000000000000013212574544466021753 xustar0030 mtime=1441974582.525016324 30 atime=1441974656.358866238 30 ctime=1441974670.089024288 icedtea-web-1.5.3/netx/javax/jnlp/FileContents.java0000664000076400007640000000130412574544466023032 0ustar00jvanekjvanek00000000000000package 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.5.3/netx/javax/jnlp/PaxHeaders.24993/ExtensionInstallerService.java0000644000000000000000000000013212574544466024531 xustar0030 mtime=1441974582.524016313 30 atime=1441974656.357866226 30 ctime=1441974670.089024288 icedtea-web-1.5.3/netx/javax/jnlp/ExtensionInstallerService.java0000664000076400007640000000140512574544466025612 0ustar00jvanekjvanek00000000000000package 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.5.3/netx/javax/jnlp/PaxHeaders.24993/ExtendedService.java0000644000000000000000000000013212574544466022437 xustar0030 mtime=1441974582.524016313 30 atime=1441974656.357866226 30 ctime=1441974670.089024288 icedtea-web-1.5.3/netx/javax/jnlp/ExtendedService.java0000664000076400007640000000345112574544466023523 0ustar00jvanekjvanek00000000000000// 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.5.3/netx/javax/jnlp/PaxHeaders.24993/DownloadServiceListener.java0000644000000000000000000000013212574544466024154 xustar0030 mtime=1441974582.524016313 30 atime=1441974656.357866226 30 ctime=1441974670.089024288 icedtea-web-1.5.3/netx/javax/jnlp/DownloadServiceListener.java0000664000076400007640000000076112574544466025241 0ustar00jvanekjvanek00000000000000package 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.5.3/netx/javax/jnlp/PaxHeaders.24993/DownloadService2.java0000644000000000000000000000013212574544466022530 xustar0030 mtime=1441974582.523016301 30 atime=1441974656.357866226 30 ctime=1441974670.089024288 icedtea-web-1.5.3/netx/javax/jnlp/DownloadService2.java0000664000076400007640000000267212574544466023620 0ustar00jvanekjvanek00000000000000package 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.5.3/netx/javax/jnlp/PaxHeaders.24993/DownloadService.java0000644000000000000000000000013212574544466022446 xustar0030 mtime=1441974582.523016301 30 atime=1441974656.357866226 30 ctime=1441974670.089024288 icedtea-web-1.5.3/netx/javax/jnlp/DownloadService.java0000664000076400007640000000335112574544466023531 0ustar00jvanekjvanek00000000000000package 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.5.3/netx/javax/jnlp/PaxHeaders.24993/ClipboardService.java0000644000000000000000000000013212574544466022576 xustar0030 mtime=1441974582.523016301 30 atime=1441974656.357866226 30 ctime=1441974670.089024288 icedtea-web-1.5.3/netx/javax/jnlp/ClipboardService.java0000664000076400007640000000030512574544466023655 0ustar00jvanekjvanek00000000000000package javax.jnlp; public interface ClipboardService { public java.awt.datatransfer.Transferable getContents(); public void setContents(java.awt.datatransfer.Transferable contents); } icedtea-web-1.5.3/netx/javax/jnlp/PaxHeaders.24993/BasicService.java0000644000000000000000000000013212574544466021720 xustar0030 mtime=1441974582.523016301 30 atime=1441974656.356866215 30 ctime=1441974670.089024288 icedtea-web-1.5.3/netx/javax/jnlp/BasicService.java0000664000076400007640000000034212574544466023000 0ustar00jvanekjvanek00000000000000package 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.5.3/netx/PaxHeaders.24993/javaws_splash.png0000644000000000000000000000013112574544466020011 xustar0029 mtime=1441974582.52201629 30 atime=1441974656.356866215 30 ctime=1441974670.089024288 icedtea-web-1.5.3/netx/javaws_splash.png0000664000076400007640000002755612574544466021112 0ustar00jvanekjvanek00000000000000‰PNG  IHDR{àÝ}«Š/5IDATxÚíÝwœ%Uèq ’s â"AÀ%¨* ,(HTAqñ}`×øÄ}ï­.A‚dDrT2J–$’FÉC˜ÌÀ&09‡óæ66=}ëÖ­[7¿ŸOý!Nß®¾Ý·ï¯Ï©sꀶõO€Ø@ì ö{ˆ=Ä€Ø@ì ö{ˆ=Äb@ì ö{ˆ=Äb@ì ö{ˆ=Äb± ö{ˆ=Äb±€Ø{ˆ=Äb±€Ø{ˆ=Äb±€Ø@ìˆ=Äb±€Ø@ìˆ=Äb±€Ø@ì öÄb±€Ø@ì ö{b±€Ø@ì ö{b±€Ø@ì ö{ˆ=±€Ø@ì ö{ˆ=±ç){ˆ=Äb±€Ø{ˆ=Äb±€Ø@ìˆ=Äb±€Ø@ìˆ=Äb±€Ø@ì ö¨ÌÛ—ü:¼¼Ü Ɉ=Ú4ôâÿ7 öhqsúõ#;ü}¡gtÄm`Æ“OõybÄm`èÞûˆ={´›´©[±b€Ös!†Ø±@†žØ±@‡žØ±@‡^\¼ˆ=Ú0ôâ·eÄmz¦pAìÐÆ¡'ö@ìÐÆ¡'ö@ìÐÆ¡'ö@ìÐÆ¡'ö@ìÐDMFŸðÂBOìØ IL{ð¡0pó- =±G»j÷Ÿm±ÐFæôëFvxá‘'öhWñ2‡7ü¿ÅÍ­S¶b¡'öhµš²{´{èuÊÏ´Øhƒ7¬z¯ì²«'œ¶{݈=„Þ?ŽñgíI§åÅû;wýLw®Øh1 Þ|3‰¼×?¿W]C/ó† ó  å Ý{ŸŽ =±ÐBŠÉëù&çz=:A÷•ê1ø:‰Øè€Ð‹×ÛM»÷¾^[ìÑi¯Ÿ8•+öh¸¢¦lËMW‰=:)ô^ÛcÏŽ{Ä@“)rcä,×%‰=:éuãOìÐEnŒœ6m+öhwi—=Äs±@ݹ1r¥« Åz¶0Cì4X-¶Qɳ„Ø£d¹ü¡Ófˆ=€&~Sªå´­Ø£d]©>⨯uìs$öZ8òŠØVìÑnNš$ö(^­ïxQmèu¿u”Ø£äÙsrêÝèèçLì4xÔ¡Ò#.䈑7óÙ>UŸg×­£Äíx¼¯žØhÑÈ«Åý<+ùÜÐj¡×©ûê‰=€Œ¼Zݸ]ìÑNÜWOì´HÜuý×]?L¾ñ¦š|bfSíH^­ÿ@{"¯ÐcøÁ‡ÔtdBìÑŽ‘'ôÄ@S¼Õjß<±G§¿¶,Ê{™Ô{¯ÖS¶=U²íŠØ£•^ceˆ=€º44ÔmO•l»"öh¥×˜Eb iB¯È=ó*Ué¹Bµê1Zn Wì4ô¨™. {´ãQ¦pÅ@ÃÞ„šm¥`¥çÜÉ÷¥u^c¦pÅ@ÃÞ„9e[DìM¾ö:?0T¤ÓFËÅ@†^³^5±7t¿ýýÐДH =±P÷7¢zn¡R¯ØsÝi±U‘Eb !¡Wï-Tò¨t=±G#_Seˆ=€¦xSª×]/ŠPé{bÞ4r4Ï¢ ±P—7¥f¾&/MÞ¯êñ‡“kõÄ@Ãß”Záš<±G+ýá$ôÄ@Ó„^3\“wÉ%—„| ÿ¯p±G+GžEb &¡×,×äÅÈë:Äxeˆ=€š¼A5Ó‹®=±G§FžEbèpEŽæ5Óuy=#OìѪ—¶¨)óß{ïã&ö€N”wï¸VØ+¯·ÐûÑ~$öhº?’ªYµžõñâk±t ¼{Ç5û^yEê‰=š)ð*ý¹qÔ×|óÄÐiŠ˜~jÖ ‘K…žØ£Ù/^ö_‡ñsÄ×d-ÎmÀ†‡…“&ùFŠ=À›W{Üõ"-ôÄõúC¨Vq—çu<õî?ø¦Š=@èµÇ†¬µ =±'ðšé¤¬¯c‹2Ä ô:&ôÄíy•¾Ž-Ê{€ÐkûiÛ"VáŠ=¯…FLÓö¦’Õón‹&öon-yYî¡'öZ_-GñêõZɺz^è‰=@èµÄ›E¿~ý¡‡š+ðŠ½¼±#€ö‹»zG^%_‹ûߊ=@è5}èåÁ«eèåÝ|züYgûAl£È«õ4m¯c÷¿{€ÐkÊiÛ¢¯¡åÝ|zÞ°a~ë Þ¹%þÌ¿þù½Zz¯ˆ×±ûߊ= ä…jÔ E^-"¯‹ëõšS+®¦mÇױب³<£PõÞ¢¡èÈ+bk±'îòÞ²¬S_Çb Fê=rQôtm-GóÄ^s¨õm3^Þ×±ûߊ= ƒT2Pï…­xbOàµÂëØýoÅÐA*¹˜»ž¡WÍh^½£Nì5V;m—R×±ûߊ= ƒ4ãÎú•D^³D]‘±çbùl:}¯ÚÐ3}+ö€Ñl;ë— ½f»"bÏÅòõºVÅ«6ôLߊ= ƒ4Cèe¹ãE«E^ÞØ3ª×¸ÀkµÈ‹ònÚmúVì"ËE­C/m$oçw÷Þ{oÛÇ´Q½ªÇµwít_Ø<Û¬øƒBì$í¢#i¡×ª#yÕÆ^'2ŠW»?ÖüA!ö€×È¿ü;!ôÄ^ó^;D^–?Ö,Ê{©£µþË¿SB/ÏÈ‹¨wµúÙ²(C즷QS·yi—k©š!ðÚ5òòþlY”!ö€Ôˆ‹ÓÓBï‹_übÛ?Çí|-U£¯Ã®§<£z¯í±§_zbèäØktèÅãÉ'Ÿìè7äVÕkäŠÙVÜð¸hyFõbˆ#ö€ß$ë¹ÝD;î¡Wär³ê5rä®S£®7y6PŽGüþ!öj¦“®ÓëÒ£z¯¹äÝj¥÷{­ö˯ÃB¯ÒØk†Q½F…¨Ë.Ïô­Ð{ ‹½v½J¦Ú=ª×¨ëï:iAEòŒêÙSOì4,ö„^cFõ1zg䮕ŽêÙSOì4,öÚ5ôòŒÕzT¯Q£v¯XyFõì©'ö{ízyWHÖjT¯ž‘'ìj¯S7ç{-{í¦š¨*ò ¹#x®¹«<£z­¼9·Ø å#¯ˆ7äFnj,òê«ÒQ=‹2Ä ޼jGõòN‹»ÖS騞Eb€õ\©Zɨž­Q:W¥£zeˆ=€¶×,÷l-j“Ûz≼æQé÷Þ¢ ±Жš9êª ½zF«¸kýг(Cì´­Oízõ•yÍÉ2Ä-}åB¯žÓµ"¯¹¹S†Ø EŒ˜3­z¦kéÎ2Äh†Ñ¾Þ.šx”Ré¨^%‹}{¯[¬ÔkºV䵞J6„žØ Á×[lÕ#ôD^g„žmVÄä²Ûn»½wÿÒrÇW\á Côeq©õ´­Àkmî}+ö >?˜Þ ¾ohà+:ôj=’'òÚC¥×éÕ{ ñ1"ÔºßßJcÏ÷Ñg$êØÛ§#ŸÏN =×é‰=±G[ÆÞë_Ü»sœýâK©¿']qe!Ÿç­S~ê-5 =‹,Þz;ï¼s¸÷Þ{ý ™¾{ ;é‹-ò|Œ-;ZË/¾(öÄ5=‘÷Ïëò:)òòþ ™¾{ ñÉ{FôĞأCOä½?ò:eʶڟ!¿{Ä^ÃÄ7ø¬±‡Ø{tr艼e#O虾{b±'öhé7éN_t‘yzy¶XzbOì!öÄÞ¤›^ÏU¶zQ¥[¬ø{b±'öð&ÝÔJæuÒBŒjþ`° Cì‰=Ğأ ߤ]—÷.£yÕÿÁàwØ{ˆ=±G“½IÍ{דO>)ôº±ÍŠØ{ˆ=±G“ªdTOèýÓ¿øE¡—ãgÈï±'öhÙØ«•zÅ+먞Ð{—©Ûü?C~žÄžØ+÷¦?{v¸õÖ[ÃqǾð…/„­·Þ:¬ºêªaÍ5× [mµUøÔ§>¾ño„Ë/¿<ôïß?,^¼¸æÏËÈ‘#Ãé§Ÿ9ä°Ë.»„ 6Ø 9§~ô£ásŸû\8úè£Ãu×]¦M›V×ï×k¯½N9å”°ÿþû‡}ìcÉ9m±Åaï½÷'žxbrNóçÏ{t¼¬#2Þ˜K‡^'.ÄèÎíÐ{>|x8þøãÃk¬‘zK¶žÇ&›lþë¿þ+ Ÿ¢ýéOJ¦0–[n¹Lç²òÊ+'«Õ PÓïÓK/½”^–óŠñ¿¯]Ñ'öjcÁøñaÒ•W…QÇ+ Ýoÿ0dÇ€ 6 }WY- Ül‹ðênŸ ÃüJýï'†)¿û}X8eJcÏ÷­·ÂÔ?ü1Œ?ûœ0ê¸ãÃk»& Þz›0`£M’sî·êêaছ…!;ì^ÿÜçèo&þæò0§_ÿ°dÑ¢¶‘ñƼìï£y•ý±àçI쉽–,Y.»ì²°Új«•½u[¹°Ùk¯½Â3Ïy¼ÂctÁ‚0íÁ‡Â¨c¿ú­±V!çú¾ciàŽ8âȰàÍ7›ú÷ÚØÿ9UèÑË-Ïô­bOìýüyó¶Ûn[hTÕßQGUh€Š½|L˜^ùÄ¿¦žg¼VoÂù„Ù/½œüû8Õ;Ô¨0ó™gÃØÿþY´Õ¿¤~ü«ŸÞ=,zçºÅ^¿ÕÖcþó{aòµ×…Oü%9×Ås愹¯¾¦Ýÿ@xû¢‹Ã'ÿGrÝaêc-¿bòo[éÍÚ›²Q½²ï 6OFìåG¹â ÛJ§š©ËÝvÛ­ü›âÒ7×õÖ[¯&çÓõo?ó™Ï了ïW¿úUMF?Å^…?·cÆ$Ó­%£i͵Ãäëo(ÿ@K–$QA” ¾]w 'O®iìÅÏ?æû? ÆËôX‹gÍ cöóÔóŽÓºÓeÞ¬½) ½4Vß"ör†GÜ&å+_ùJ¦Ç(·£¨Ø‹ÓÉŸüä'+zÌJϧëßœtÒI=_}úô +¬°BEÏwÖó{ÙÅ©ÕÁÿò±ÒÓ˜mæV¸<.è¿Îz%3.úUn+T*öú®´J˜ùÔÓù¢wäÈ0lÿ/•^¼±Ö:aî!Mñû,mT/®@¦÷ßkq¡'ô{¹c/®PÍòñqK‘¸…Éý÷ß^}õÕd 4îu÷À„sÏ=7vØa™Ï³\ìýà?ÈôõÄèúñ^xá…0a„dÅî°aÃÂ}÷Ý—œk<ç,çóøãgz®æÎ6ÝtÓª#´Ôj]±—] ƒ´²Y}._Œüù‰$¼J=v\©[‹Ø›tÕÕU=îâ¥?›¯í±gÉóŽ[Ì4ó¨ÞÀÍ· ‹¦Níø7­R›&ÇE\Îuzˆ½œ±÷Æo„UVY¥ìÇðƒ ýúõ+ûx>úhòo«‰½x=_–‘³øyÆŸúo~øáä±Ê=wqcÒ,A_pÁ™GéÖYgpöÙg‡çŸ> ÑÇqßÁ{î¹'xàïíÇWÉ_ùbï]SïþCêyÅ}êª1öÿýwêÔðü¥¯›"c/îX„8­6¥¿ŸÍú†W( ½KrÏšˆ=—ˆ=±WÒᇞéz±8š—U ¾R—%ööÛo¿L_oÜ\9‹_üâ™FÍnºé¦Ôlj XÖ_ýLçWû.\¸0õßÅçtùå—¯h”Pì…°pâÄd¥i©sŠ#Dq1C5âñ€õ7,½B÷Ðà ½™O?SØóóæTò¼GvxS¾a›jK=S¸•Oáú™{bïâFÇYB/îKW©Ýwß½×Ç-{q$.ËײÃ;d>—¸iq¹…]–æÌ3ÏÌô|ÅÛ£MÍ8uÖYg‰½ ;õ´Ôsšxùo‹ù<§Ÿ‘ºÊ5®-"öâµ…EÞýböß_LÞŽÓ½Í{þ¦gLâ%'i—{tú®ÐCìU{ñ>·Yâå–[n©øœ¯¹æš\±wÄGdúZãu‚•øÞ÷¾—itoàÀ%ÿM×þƒåÎ-Þ7«¸õÚk¯ùûÛé±ïj1p“MKÇÌJ«v˳¹¯¼’úµÇè,"öFŸøÝbŸ¤Å‹Cÿõ6hÊ©­ž‹3:ýM¹k3õ´£ÓWàVz¯ì²k@쉽n‘±úê«—ý˜xOÜ T|Îo½õVű7mÚ´ä>¶åÎ)Žœ•›"í).ÀÈ{?ÿùÏ{ýÿ ”é9ŽÓ²£*ñ‰q(ö²™rÓÍé õÐB?_¼m©Ï5h‹T½2·Vâ¾€%#õô3v^Ýg¸x>$Ó³B¯¸ÐK®×=ëlå#öÄ^—o¼1Ó¨Þ—¿üåÜç½ýöÛ—¼?lo±×5Xîœ9äŠÏ%Æa¹¸M»ÃÇi§–éÜâv1yÿº{å½ö™=ÒÏçêk ý|i׿Åcú£5åò¶¯Ûsñü»²LÝÚS/äºs̼aÔØ{]â],²<æyç—û¼»î0‘5ö8à€LçtÕUWå:ŸO}êS™F÷Þèe¥e<ߢ§p»Ä‘Ó5×\ÓÖ+eÄEñZ¹´ó™3pP¡ŸsÒ5צ~¾x÷f4òècJï¸×þæÝÉÓ·Y¦n-Ȱ§b¯ØÛd“M2=fÜ@8¯3Î8£¢ØÛpà 3Sß¾}sÏ 'œ)¨|ðÁ÷ý÷8*˜ez¹·Íªk:Gì•6ýáGRÏ%n\ô´jÚb‡d*r¿ý[.öâÔt#c¯ÓßËMÝZ!ô{…ÄÞ¸qã2ßž+îW­î÷-µ0ãÍ7ßÌô5Ä=óò\Cþù™¾æ¸Étw¯¼òJæ½õÆŒ“ëܾûÝ2ÆþÏ©©çR‹«EÓ§§æºë'·Zk¥Ø‹ \¥ÓßÓ¶W1}›?ô\ÿ‰ØëE\Éš%öâfËEèáK‹½¸ç\–¯aã7Î}×_}¦çñ˜cŽyß»ãŽ;2=_q“çÅ9G–²†h'ÇÞÐ}ÿ-õ\ju«­´»i$× ZØçŠ[°Ìé? L¾öºðÆI''·g‹#q?¼yè·ÆZ¹®aêmSh„^»„žÍ“{%tííV..â‹zɲ‡]÷¯³š£Üãï¸ãŽïûo§žzj¦çk«­¶Êýõßzë­b¯Œ<©×Ïýìçµù¼)[½Äã;î¬úsÄ=ûÆþüÊ~…ÄÞÒh¤~²,ÆzùCÏý”{%tÝw¶\\ì½÷Þuû¿ÿýïgžZ®uìm°Áïûo'tRÍŸ¯®‘M±—ò¦¹êêéçråU5ù¼iÛ¯$›8_zYîÇŽ÷‚}ÂwÂË+|°æ‘'öšs4Oè-»ÿbÖÃý”{)¾õ­oeŠ—¯|¥~7N?þøã›â]Ó±Ý{ì±™ž¯ƒ:(÷ç}â‰'Ä^Šxû³zÅP¥GÞ}ëâ½`nºYÝÏWì ½fÓ}ÿÅJ÷SFì¥èšR(÷xqaE½d9§zÅ^<â-Öºdݦ¦šçëùçŸ{)ŒÛ´±÷â«Tœú-7š£lô·OH¶™Ó¯òd½çoÚ ±'ôšIÞé[«o{eÄéÆ,GÛê%Ë9Õ3öâ@º”Û¥ëãâˆi^/¾ø¢ØK1wð¦½Qß<®â½´E}?¸rwÚéUMO‰=¡×ìâ0qƒo¡‡Ø«Qìí¾ûî™/nR/YΩž±7xðà÷þÛ§?ýéš?_b¯uc/Þ­"«xßÞëoXz+—µ× 3Ÿy¶êçKì ½f–w4Ï‚ Ä^±·Ï>ûÔ|¤ªRYÏ©ÖÇZk-ûF˜ud¯š‘P±—.Ë4î”[nmú×ò˜ü°ô×°üŠaÚ½÷òyÄžÐkÇг ±WAìvØa™|ík_«Ûר}k‚FÆ^÷½.ñ^¼µ¾fOì¥[9Óó[ÍÍË}ôQ±WÆÀͶHßåg6õëxøA×ífbOè =Ä^‡Ç^¼÷k–¿Ã;Ôík<ûì³3Óž{îY÷çÿ´ÓNËtnÕÜAãü£Ø+cè¿í—þ†ð“SšúuÜõJOá~„Øzm§š·d öªŒ½‡z(Ó¿_}õÕëö5>øàƒ™ÎiÓMë÷»îº+Ó¹­°Â aÑ¢E¹>Ç 7Ü öʈۑ¤ËðƒiÚ×p¹kßú?ÿWì ½¶’÷®d ö нñãÇg¾uؤI“ª:÷Ûo¿}™_€qd±§±cÇf:§å–[.Ì]úÆY­îSÙ]Ç#<Òë¿}íµ×2?_£GÎu>?ûÙÏÄ^Ó},õ\o½MÓ¾†ç/ý¹H;÷ñ¿½þÛ6Ú(Ó9 2¤êçtË-·|ß9Å[¤Íž=»×GëVYe•Lçvß}ù¶Î8òÈ#Å^‹¦OO¿ëÄÒÿoqÔœþÒ—\òëB?_å{B¯!?ëLÝš¾Eì{Yo¹åÑ}D¯Ô¹öá;ðÀ3ÓÍ7ßœû¹,·8¥Ô_Ö•üãç:¯í¶ÛNìeðÚžŸM=ŸOü¥&Ÿ7îó×wÅ•rß=cþ¨Qu½=íy{B¯Vª]ˆaú±WpìÝtÓM5Ýê¤ûˆ^©sí9ÂwÝu×e:§j6/î>¢×›R#|gžyf¦ïÁ.»ìRñ9ZY÷ìôØ›òû[RÏgÌ÷P“Ï;á¼ó{ý|Sïº;ÓÇ/ž93ý.Xèù¦­\{B¯hE晾Eì{3—¾ùÄåcà 7 ‹/®øœ?üá§Æ^œ?þûþûôéÓ3M—ÆÇΣoß¾ïûÅÜÛy}îsŸëõc_}õÕÌ×>¼¢óºôÒK3;=ö–,XnºYÉó´ÅGjòy‡ì°Ó²Ñ´êêIÄe#«äytëÂÎuþÈ‘©ß3±'ôŠTÄBŒ÷n¸îúaò7ù¡Cì{Ñ7¿ùÍL#Jqõn% TvTï€èõcã];²œÓÓO?]ñóxê©§–Â=÷ÜÒÊüãÏô}¨ä—þ’%KÂŽ;î(ö*÷ÓK¸ïþº<qD%†íÿ¥ôë K\3Z©‰¿½BìÕ1ôâ¨W^yeÇ>GE,ÄèZM¿àÍ7ýÐ!öŠŽ½LYÂ*^KW‰®•¥i±¯éëÍc=–ék©ôœâ Þ´ÑÆhÅWLV*—C0ËóùO™2%ÓyÝyç™Wúнw-œ<9 Øh“’ç4dÇBÈ1]Êȯ}½×ûØÎ0°¢Ç)5üÞŠÜs~YýÉ.ýº‡l÷q±W§ÐÛzë­C¿~ý:òù)rêÖb Ä^ c/*wŸÜøßãÔdÖ_hC‡M¢)íñÖYg0oÞ¼’ï’‘%ªâýd³:ñÄË~G‘¾±mœú.·b¸ësl³Í6aáÂ…©§•W^yåLß7±÷~Óî½/õ¼&^þÛB>ÏÛ¿º¤÷Qˆ¯ZñcÍ}å•$KFØêk†ùcÆTu¾“¯»¾ì«ØK×u¿Ww©ãè£N~'t¢¢bXŒØ«SìÅÅiqÖõØk­µVÙ=÷ÆÖ_ý²£zñŽiâ¾vqƒârç´êª«†×_=õ±â4i\!›v­^´üòˇ¿ÿýïýµ_î{£6Þ$n_óöÛo‡9sæ$×óÅ ¤ãEüœY¿gboYo|÷•<¯¾+­f<þçª?^‹Ô÷ƒ+÷es_}5×cÆ;e¤=Ÿ#Ž<*÷ùÎ[úZè·æÚb¯Æ£yñu}ã7vìsTdèYŒAGÇÞn»íÖë/™,1ÐóȧŸ~z¦€‰+Uã=lãôï˜1c’U«ñ¯à¸²÷'?ùIXmµÕÊŽžÅýýfÍšUöœ~úÓŸf:§LGuTxà’HŒç76¾ÿþûÃYgvÝuײÏaüïqä/Óê¼ya‹-¶ÈýýHûžf ÈJ~&Ú=öâ∴)Ëþk¯füù‰\=óégJNOºúšÜçry‚#Ëçëúÿn»í¶LÏA\©û‰O|¢¦çÔõñq4râĉ™¿?q¤.ކý½ÌûuvjìE Ư|â_KŸãÒ°óÿ™lÈœ)æ‡#Ž8²ôµEÇ«ês.·À$Yüñc3]¬¾dékwÒ5׆þëmð¾°ÁFb/£¬Ó¶~G ¡‡Ø+xD¯áXn„/N1Æé‰¬‘'Fã¨`%f̘ÖXcªb·œ8]üòË/Wü¼f™ZÏó}ª×Çu÷ê'?Uè/ñîG=,œ2%¼¶ûgÒG³V[#™"}ç¶ÛÃì¾ý’H\2o^2õ9íþ„ .LB®ïÊ«–|ŒÑ'~·°…#¿~tÙç®ï*«%çôέ·…yC‡&×5-YúGЂ·Þ ³þú\r¯à!Ûï°LÜÆO»]ZÚñÆI'ÍzB±×®±Åkòºö¹+:döÜsÏd±Rqºx¥•VªÉ(V\xrÇwäþøãŽ;®sªf”Nì½+NéÆÑ°Z| ñº½q§žVèùÆÐý/ü<ã¦ÓILнBFó„^(üõ$ô{ ޽(®.[{íµ ‰ˆ®Çˆ¡WÉ“'—½°ÒóŠ×úÝsÏ=U?Öw¾óBž§žb¯z3Ÿy6¼²Ë®…ÿk{ìYñ+•ˆ£pqÁGµçùú^_HF,ß9{Uæ =#zˆ½¶½èwÞ ùÈGª ‰®ýÒ—¾”kD¯§¸ÿ݇>ô¡ªã&~lÜî$®ˆ-Ê·¿ýíªž§¸ð墋.{… ó-Nvá›ÇU¹­²ZKÓ{<.ç®ùé.œ81ŒýïŸ% J*:×åW ¯îöÉðÎw.ó˜b¯ºÑ<¡gD±Wû“ÎøË¨ÚÅ ib Å;NtmRéusq¤êŒ3Î(ôy‰‹6â/à®Q°<çµÓN;%{-®HîÚ3¯’kãâVõ½'åçxÚ´äš·x½]¼ÿlõø¡'Ø­u’¬qÇðƒãN?#L{èOaÑÒ?vÒ¨sæ$ÛÅÄð‹w%ˆ×ãÅÁɹ®·A¼íöáõÏïFódQÆ‚±c}ƒ ÅzFô{ á+â¨v_¶$ Çѧ¬Ÿ3Þ -Ï¢‡¬úô铌ö Ñr;Ý_}õÕËܷ葃¸!to1Úóˆ{~ï{ß[f‡¸Q´ÐƒúŽâÙCψb¥¦N®ºêªðõ¯=¹/î5N¬»îºaÛm·M"ç / C† ©Û9M˜0!\|ñÅáðÃO¶ŽÙtÓM“(£eñûî»o²‡`ܰˆ©ä¬âÈá)§œöÛo¿$2㢗xn{ì±G8æ˜c’çiªã¡i"Ïzï2¢‡Ø ­ÏhžÐCìÐÄò^“g4Oè!öhÓÀ³cYB±€ÐkSEŽê =Ä ‹¼Í6Û,‰¼gŸ}Ö*ô{´SèÉzˆ=j$†VWtÅp«èx•‘·óÎ;‡{ï½×7Aè!ö¨Wðu?JÅŸÈz öZLŒ¯aEßÒt­Ð±ÐDJòÕóÞßBOè!öhòàCèØhby§uMÕ ={P…¡C‡†aÆ…áLJ#F$ÇÈ‘#èQ£ÂèÑ£“ã7ÞcÆŒIn3·Þz+Œ;Ö“GnYGú„žÐ±b•6Ò'ò„ˆ=¨±zC÷ÞNJر'ö Ý"¯ë˜ñäSžXĈ=±íz¯ì²k˜vï}žXĈ=±íz¦n{ öÄ´i虺EìØ{Ð`súõ#;¼ðȳò±bOìAƒÕb$Oè!öXÆé§ŸžgœqFrüâ¿gžyf8묳’ãì³ÏçœsNøå/™çž{n8ï¼óÂù矟\pA¸ð ÃE]”û®ºêªä¸úê«Ã5×\®½öÚÜuÛm·…Ûo¿=9î¸ãŽpçw†»îº+9î¾ûîð‡?ü!üñ ÷ÜsO²Ø}÷Ý—÷ßxàjö<÷éÓ'üõ¯MŽçž{.üío Ï?ÿ|[ÄÞÔ©S“cÚ´iaúôéaÆŒ^XÐÀÐsb¦Š½+¯¼²×ØË|Œ½'Ÿ|29žzê©ðôÓO‡gžy&9ž}öÙ’±^x!üýï/¾øbr¼ôÒKáå—_nºØ{ûí·ÃĉäI“ÂäÉ““cÊ”)½Æ^öŒòQ/õÍyˆ= —¶·R—_~yÉØ‹ÒbïÆo¬èsõ¶Wì56ö¢FÆžà£Vê5šgµ-bºÇ^Üz%«ßüæ7ËÄ^OµŒ½j”‹½,[¯TºÏ^¹köâ1dÈšÄ^-¥ÅÞâÅ‹ ùqäCðQ/õº6Oè!ö¨©ZÄ^)i±wÓM7eú\=÷Ù«ÆÃ?,öZ,öâW¹7NÁGµê5š'ô{4<öâ¦Êå\vÙe™c¯+øJÅÞÍ7ß\6ôÄ^gÇ^”å Tð‘W½Fó„bº_ž;hÄÐë{å{EH‹½VÔ ±Wn*×J]ò¨çhž…ˆ="-öJ_ÏØË*-öJ_ÏÛ¥¥‘ 4Ä^>Y¦ròÑŒ‘×ÝõÃäoò¤#öhØ»ôÒKë{·Þz«Ø+(öZ}5n—¬£{‚4õœ²~ð!aÁÒ×"ˆ=*-ö.¾øâ÷þݯýëeb¯Ri±÷»ßýî½wË-·,{EktìÙg¯r•Žî >x¦lAì5¥´Ø»ä’Kz½¼Òbï÷¿ÿ}¯±W+õ¾ƒF÷Ðs»´|*Ý|­žÓµ`€Øk騋G½b/†^½b¯+øêqoܨÑ÷Æ?~|]b¯–òŒî >'ô@ìñàË{Õª$öê¡ÜÖ+EHÛz¥ZYhtÅÞ„ ªþ|³gÏ.{õgtOð ¼Z7ß2‰¼™Ïöñ±×ü²Ä^Q²Ä^½•Ûg¯RYöÙ+BÖÕ¸]±÷öÛo'G%fΜfÍš•„^©Ø«—¼£{¶fiOõ¾ÏHˆ½¶Ž½"•‹½F«õ¦Ê•:th6lX>|x1bDrŒ92Œ5ªâ­WºboâĉaÒ¤IaòäÉÉ1eÊ”0uêÔä˜6mZ˜>}z˜1cFr”нFÉ;º'úžÐ±×ñê{Q3Ç^wEÄ^µŠŒ½îòÆ^£U3ºgjWèYi bhÕŽîåk-¼.Ïhˆ= ŠÝ3Ê'ðŒæØšTQ£{‚¯ù4ÃuyFó@ì VôèžiÝÆk–Ñ<¡bhñ ¹VoöFúêËhˆ=€ºŸø«½fÍy öÁgº·@Fò@ì4uð ¿|\—b ·¸h£èUºâ¯zÍ2Šg{@iÔH_§]ë×,!'ò@ì‚OøU¨™¦\+=n¾eòýŸùl/{€ð€­vÄ@¢®ék†ëýÚ!ìLÓ‚ØhÙè+*Û-êDˆ=€¶>Ç ¡ÿºë'ñ§¾­x± úŒàb@ô‰<@ì¢ÏQӣߚk‡×?¿W²švÊïo s öƒb@ô½Ä€èy€Ø('nÖ§ãæ½‚Í- öá×¹·êêaä1ß3ž|Ê ˆ=€Öfš÷ŸÇíw.¼(,œ4Ɉ=€öÒi£}¦g±¿6 ?w°Ä@›„ŸQ;@ìT)ŽŽÅQ²8ZGÍ„ öÚX­FM¿b±€Ø{ˆ=Äb±€Ø@ìˆ=Äb±€Ø@ì öÄb±€Ø@ì öÄb±€Ø@ì ö{b±€Ø@ì ö{b±€Ø@ì ö{ˆ=±€Ø@ì ö{ˆ=Ä€Ø@ì ö{ˆ=Ä€Ø@ì ö{ˆ=Äb@ì ö{ˆ=Äb± ö{ˆ=Äb± ö{ˆ=Äb±€Ø{ˆ=Äb±€Ø{ˆ=Äb±€Ø@ìˆ=Äb±€Ø@ì öÄb±€Ø@ì öÄb±€Ø@ì ö{b±€Ø@ì ö{b±€Ø@ì ö{ôîÿ[gÎ}ã  IEND®B`‚icedtea-web-1.5.3/netx/PaxHeaders.24993/javaws.10000644000000000000000000000013112574544466016013 xustar0029 mtime=1441974582.52201629 30 atime=1441974656.356866215 30 ctime=1441974670.089024288 icedtea-web-1.5.3/netx/javaws.10000664000076400007640000001132212574544466017074 0ustar00jvanekjvanek00000000000000.TH javaws 1 "23 Aug 2014" .SH NAME javaws - a Java Web Start client .SH SYNOPSIS .B javaws [-run-options] jnlp-file .br .B javaws [-control-option] .SH DESCRIPTION .B javaws 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 .B javaws is from the IcedTea project and is based on the NetX project. .PP A JNLP file is an XML file that describes how to securely run a remote Java application or a Java applet. .SH OPTIONS When specifying options, the name of the JNLP file must be the last argument to .B javaws - all the options must precede it. .PP The JNLP-file can either be a URL or a local path. .PP .B Control Options .PP By default .B javaws will launch the JNLP file specified on the command line. The control options can be used to change this behaviour. .TP 12 \-about Shows about dialog. .TP \-viewer Shows the trusted certificate viewer. This allows a user to list, examine, remove or export trusted certificates. Note that this only reflects the certificates trusted by .B javaws and not any other certificates or programs. .PP .B Run Options .PP In the default mode, the following run-options can be used: .TP 12 \-version Prints out version and exit .TP \-arg arg Adds an application argument before launching. .TP \-param name=value Adds an applet parameter before launching. .TP \-property name=value Sets a system property before launching. .TP \-update seconds Check for applet/application updates if "seconds" seconds have elapsed since the last check. .TP \-license Display the GPL license and exit. .TP \-verbose Enable verbose output. Very useful in debugging. .TP \-nosecurity Disables the secure runtime environment. .TP \-noupdate Disables checking for updates. .TP \-headless Disables the download window and other extra UI elements. .TP \-strict Enables strict checking of JNLP file format. Any deviations from the JNLP DTD will cause .B javaws to abort. .TP \-xml Enables stricter XML validity checking for JNLP files. .TP \-allowredirect Enables following 301, 302, 303, 307 and 308 HTTP redirects for .B javaws applications. .TP \-Xoffline IcedTea-Web will not attempt to connect to the network to check for or download newer versions of the requested applet or application. Locally cached application files will be used instead, if available. The application itself may still establish its own network connections. .TP \-Xnofork Do not create another JVM, even if the JNLP file asks for running in a separate JVM. This is useful for debugging. .TP \-Xclearcache Clean the JNLP application cache. .TP \-Xignoreheaders Skip jar header verification. .TP \-Jjava-option This passes along java-option to the Java binary (JVM) which .B javaws will be executed within. For example, to make .B javaws run with a max heap size of 80m, use -J-Xmx80m. .TP \-help Print the .B javaws help message and exit. .SH FILES $XDG_CONFIG_DIR/icedtea-web/deployment.properties specifies the settings used by .B javaws $XDG_CONFIG_DIR/icedtea-web/log (may be set to different location by you) contains file log files (if enabled). itw-cplugin-date_time.log for native part of plugin, itw-javantx-date_time.log for everything else. $XDG_CONFIG_DIR/icedtea-web/security/java.policy contains the user's security policy, which may grant extra permissions to applets. $XDG_CONFIG_DIR/icedtea-web/security/trusted.*certs contains various stored certificates. $XDG_CACHE_DIR/icedtea-web/cache contains cached runtime entries (may be modified by the user). $XDG_CACHE_DIR/icedtea-web/pcache contains saved application data. $XDG_CACHE_DIR/icedtea-web/tmp contains temporary runtime files. $XDG_RUNTIME_DIR/icedteaplugin-user-*/ contains in and out pipe for native<->java communication and (if enabled) debugging pipe Where $XDG_CONFIG_DIR, $XDG_CACHE_DIR and $XDG_RUNTIME_DIR are defined as $HOME/.config, $HOME/.cache and either /tmp or /var/tmp by default. This is in accordance with the FreeDesktop Base Directory Specification: http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html .SH BUGS There aren't any known bugs. If you come across one, please file it at http://icedtea.classpath.org/bugzilla/ .br Please run .B javaws in debug (via -verbose switch, .B itweb-settings configuration, or ICEDTEAPLUGIN_DEBUG environment variable set to true) mode and include that output (best is from java console) with URL to JNLP or HTML file (not the JNLP/HTML file or application itself) when filing out the bug report. .SH AUTHOR Originally written by Jon. A. Maxwell. .br Currently maintained by the IcedTea contributors. See javaws -about for more info .SH SEE ALSO .BR java (1), .BR itweb-settings (1) .br http://icedtea.classpath.org/wiki/IcedTea-Web icedtea-web-1.5.3/netx/PaxHeaders.24993/itweb-settings.10000644000000000000000000000013112574544466017470 xustar0029 mtime=1441974582.52201629 30 atime=1441974656.356866215 30 ctime=1441974670.089024288 icedtea-web-1.5.3/netx/itweb-settings.10000664000076400007640000000344112574544466020554 0ustar00jvanekjvanek00000000000000.TH itweb-settings 1 "07 Mar 2014" .SH NAME itweb-settings - view and modify settings for .B javaws and the browser plugin .SH SYNOPSIS .B itweb-settings .br .B itweb-settings command arguments .SH DESCRIPTION .B itweb-settings is a command line and a GUI program to modify and edit settings used by the icedtea-web implementation of .B javaws and the browser plugin. If executed without any arguments, it starts up a GUI. Otherwise, it tries to do what is specified in the argument. The command-line allows quickly searching, making a copy of and modifying specific settings without having to hunt through a UI. .SH COMMANDS .TP help Prints out information about supported command, descriptions and basic usage. .TP 12 list Shows a list of all settings. .TP get Shows the value of the named setting. .TP info Shows additional information about the named setting. Includes a description, the current value, the possible values, and the source of the setting. .TP set Sets the setting to the new value, after checking that it is an appropriate value. .TP reset all Resets all settings to their original values. .TP reset Resets the named setting to its original value. .TP check Checks that the current value of the setting is a valid value. .SH EXAMPLES .TP itweb-settings Show the GUI editor .TP itweb-settings reset deployment.proxy.type Resets the value of 'deployment.proxy.type' setting. .SH FILES $XDG_CONFIG_HOME/icedtea-web/deployment.properties specifies the settings used .SH BUGS There arent any known bugs. If you come across one, please file it at http://icedtea.classpath.org/bugzilla/ .SH AUTHOR Written and maintained by the IcedTea contributors. .SH SEE ALSO .BR javaws (1), .BR java (1) .br http://icedtea.classpath.org/wiki/IcedTea-Web icedtea-web-1.5.3/netx/PaxHeaders.24993/sun0000644000000000000000000000013212574544466015167 xustar0030 mtime=1441974582.498016013 30 atime=1441974670.156025059 30 ctime=1441974670.089024288 icedtea-web-1.5.3/netx/sun/0000775000076400007640000000000012574544466016325 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/netx/sun/PaxHeaders.24993/applet0000644000000000000000000000013212574544466016454 xustar0030 mtime=1441974582.498016013 30 atime=1441974670.156025059 30 ctime=1441974670.089024288 icedtea-web-1.5.3/netx/sun/applet/0000775000076400007640000000000012574544466017612 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/netx/sun/applet/PaxHeaders.24993/package-info.java0000644000000000000000000000013212574544466021720 xustar0030 mtime=1441974582.498016013 30 atime=1441974656.415866894 30 ctime=1441974670.089024288 icedtea-web-1.5.3/netx/sun/applet/package-info.java0000664000076400007640000000336012574544466023003 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/sun/applet/PaxHeaders.24993/AppletViewerPanelAccess.java0000644000000000000000000000013212574544466024105 xustar0030 mtime=1441974582.498016013 30 atime=1441974656.415866894 30 ctime=1441974670.089024288 icedtea-web-1.5.3/netx/sun/applet/AppletViewerPanelAccess.java0000664000076400007640000001275212574544466025175 0ustar00jvanekjvanek00000000000000/* 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.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.net.URL; import java.util.Hashtable; public abstract class AppletViewerPanelAccess extends AppletViewerPanel { public AppletViewerPanelAccess(URL documentURL, Hashtable atts) { super(documentURL, atts); } protected URL getDocumentURL() { try { Field field = AppletViewerPanel.class.getDeclaredField("documentURL"); field.setAccessible(true); return (URL) field.get(this); } catch (IllegalAccessException ex1) { throw new RuntimeException(ex1); } catch (IllegalArgumentException ex2) { throw new RuntimeException(ex2); } catch (NoSuchFieldException ex3) { throw new RuntimeException(ex3); } catch (SecurityException ex4) { throw new RuntimeException(ex4); } } protected void setApplet(Applet iapplet) { try { Field field = AppletPanel.class.getDeclaredField("applet"); field.setAccessible(true); field.set(this, iapplet); } catch (IllegalAccessException ex1) { throw new RuntimeException(ex1); } catch (IllegalArgumentException ex2) { throw new RuntimeException(ex2); } catch (NoSuchFieldException ex3) { throw new RuntimeException(ex3); } catch (SecurityException ex4) { throw new RuntimeException(ex4); } } @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(); } /** * 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 ex1) { throw new RuntimeException(ex1); } catch (IllegalArgumentException ex2) { throw new RuntimeException(ex2); } catch (NoSuchMethodException ex3) { throw new RuntimeException(ex3); } catch (SecurityException ex4) { throw new RuntimeException(ex4); } catch (InvocationTargetException ex5) { throw new RuntimeException(ex5); } } protected URL getBaseURL() { try { Field field = AppletViewerPanel.class .getDeclaredField("baseURL"); field.setAccessible( true); return (URL) field.get( this); } catch (IllegalAccessException ex1) { throw new RuntimeException(ex1); } catch (IllegalArgumentException ex2) { throw new RuntimeException(ex2); } catch (NoSuchFieldException ex3) { throw new RuntimeException(ex3); } catch (SecurityException ex4) { throw new RuntimeException(ex4); } } @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(); } icedtea-web-1.5.3/netx/PaxHeaders.24993/policyeditor.10000644000000000000000000000013212574544466017227 xustar0030 mtime=1441974582.498016013 30 atime=1441974656.414866883 30 ctime=1441974670.089024288 icedtea-web-1.5.3/netx/policyeditor.10000664000076400007640000000450412574544466020313 0ustar00jvanekjvanek00000000000000.TH policyeditor 1 "10 Mar 2014" .SH NAME policyeditor - view and modify security policy settings for .B javaws and the browser plugin .SH SYNOPSIS .B policyeditor .br .B policyeditor [-file] policy_file .B [-codebase] url .SH DESCRIPTION .B policyeditor is a GUI application with small command line support to view and edit applet security policy settings used by the icedtea-web implementation of .B 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. 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 a policy file. .SH OPTIONS .TP -help Prints a short help text and exits. .TP -file policy_file 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. .TP -codebase url 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. .SH EXAMPLES .TP policyeditor Show the GUI editor .TP policyeditor -file $HOME/.config/icedtea-web/security/java.policy Opens the default user-level policy file location .SH FILES $HOME/.config/icedtea-web/security/java.policy the default user-level policy file location .SH BUGS There aren't any known bugs. If you come across one, please file it at http://icedtea.classpath.org/bugzilla/ .SH AUTHOR Written and maintained by the IcedTea contributors. .SH SEE ALSO .BR policytool (1), .BR javaws (1), .BR java (1) .br http://icedtea.classpath.org/wiki/IcedTea-Web icedtea-web-1.5.3/netx/PaxHeaders.24993/net0000644000000000000000000000013112574544466015147 xustar0029 mtime=1441974582.48901591 30 atime=1441974670.156025059 30 ctime=1441974670.089024288 icedtea-web-1.5.3/netx/net/0000775000076400007640000000000012574544466016306 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/netx/net/PaxHeaders.24993/sourceforge0000644000000000000000000000013212574544466017473 xustar0030 mtime=1441974582.497016002 30 atime=1441974670.156025059 30 ctime=1441974670.089024288 icedtea-web-1.5.3/netx/net/sourceforge/0000775000076400007640000000000012574544466020631 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/netx/net/sourceforge/PaxHeaders.24993/nanoxml0000644000000000000000000000013212574544466021147 xustar0030 mtime=1441974582.497016002 30 atime=1441974670.156025059 30 ctime=1441974670.089024288 icedtea-web-1.5.3/netx/net/sourceforge/nanoxml/0000775000076400007640000000000012574544466022305 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/netx/net/sourceforge/nanoxml/PaxHeaders.24993/XMLParseException.java0000644000000000000000000000013212574544466025401 xustar0030 mtime=1441974582.497016002 30 atime=1441974656.414866883 30 ctime=1441974670.089024288 icedtea-web-1.5.3/netx/net/sourceforge/nanoxml/XMLParseException.java0000664000076400007640000000755312574544466026474 0ustar00jvanekjvanek00000000000000/* 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 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. * * @see net.sourceforge.nanoxml.XMLParseException#NO_LINE */ public int getLineNr() { return this.lineNr; } } icedtea-web-1.5.3/netx/net/sourceforge/nanoxml/PaxHeaders.24993/XMLElement.java0000644000000000000000000000013212574544466024041 xustar0030 mtime=1441974582.497016002 30 atime=1441974656.414866883 30 ctime=1441974670.089024288 icedtea-web-1.5.3/netx/net/sourceforge/nanoxml/XMLElement.java0000664000076400007640000012204412574544466025125 0ustar00jvanekjvanek00000000000000/* 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.*; import java.util.*; import net.sourceforge.jnlp.runtime.JNLPRuntime; 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 Hashtable 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 Hashtable 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; /** * 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 Hashtable(), 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 Hashtable(), 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(Hashtable entities, boolean skipLeadingWhitespace, boolean fillBasicConversionTable, boolean ignoreCase) { this.ignoreWhitespace = skipLeadingWhitespace; this.ignoreCase = ignoreCase; this.name = null; this.contents = ""; this.attributes = new Hashtable(); this.children = new Vector(); this.entities = entities; this.lineNr = 0; Enumeration e = this.entities.keys(); while (e.hasMoreElements()) { String key = e.nextElement(); 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()); } /** * Returns the number of child elements of the element. * *
Postconditions:
*
  • {@code result >= 0}
  • *
*/ public int countChildren() { return this.children.size(); } /** * Enumerates the attribute names. * *
Postconditions:
*
  • {@code result != null}
  • *
*/ public Enumeration enumerateAttributeNames() { return this.attributes.keys(); } /** * Enumerates the child elements. * *
Postconditions:
*
  • {@code result != null}
  • *
*/ public Enumeration enumerateChildren() { return this.children.elements(); } /** * Returns the PCDATA content of the object. If there is no such content, * {@code null} is returned. */ public String getContent() { return this.contents; } /** * Returns 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; } /** * Returns 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.scanWhitespace(); 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. *

*/ 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.
  • *
*/ 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); } } /** * This method scans an identifier from the current reader. * * @return the next character following the whitespace. */ protected char scanWhitespace() throws IOException { for (;;) { char ch = this.readChar(); switch (ch) { case ' ': case '\t': case '\n': case '\r': break; default: return ch; } } } /** * This method scans an identifier from the current reader.
* The scanned whitespace is appended to {@code result}. * * @return the next character following the whitespace. * *
Preconditions:
*
  • {@code result != null}
  • *
*/ protected char scanWhitespace(StringBuffer result) throws IOException { for (;;) { char ch = this.readChar(); switch (ch) { case ' ': case '\t': case '\n': result.append(ch); break; case '\r': break; default: return 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
  • *
*/ 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}
  • *
*/ 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.
  • *
*/ 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.
  • *
*/ 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}
  • *
*/ 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}
  • *
*/ 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. */ 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}
  • *
*/ protected void scanElement(XMLElement elt) throws IOException { StringBuffer buf = new StringBuffer(); this.scanIdentifier(buf); String name = buf.toString(); elt.setName(name); 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(name)) { throw this.expectedInput(name); } 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}
  • *
*/ 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}
  • *
*/ 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}
  • *
*/ 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. */ 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}
  • *
*/ 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}
  • *
*/ 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}
  • *
*/ 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. * *
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 InputStream} containing the xml. * @param pout The {@link 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; } out.close(); 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 } } } icedtea-web-1.5.3/netx/net/sourceforge/PaxHeaders.24993/jnlp0000644000000000000000000000013212574544466020436 xustar0030 mtime=1441974582.614017349 30 atime=1441974670.156025059 30 ctime=1441974670.089024288 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/0000775000076400007640000000000012574544466021574 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/tools0000644000000000000000000000013112574544466021575 xustar0029 mtime=1441974582.61501736 30 atime=1441974670.156025059 30 ctime=1441974670.089024288 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/tools/0000775000076400007640000000000012574544466022734 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/netx/net/sourceforge/jnlp/tools/PaxHeaders.24993/KeyStoreUtil.java0000644000000000000000000000013012574544466025117 xustar0029 mtime=1441974582.61501736 29 atime=1441974656.40686679 30 ctime=1441974670.089024288 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/tools/KeyStoreUtil.java0000664000076400007640000000465612574544466026215 0ustar00jvanekjvanek00000000000000/* * 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 */ public static boolean isWindowsKeyStore(String storetype) { return storetype.equalsIgnoreCase("Windows-MY") || storetype.equalsIgnoreCase("Windows-ROOT"); } /** * Returns standard-looking names for storetype */ 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.5.3/netx/net/sourceforge/jnlp/tools/PaxHeaders.24993/JarCertVerifier.java0000644000000000000000000000013012574544466025542 xustar0029 mtime=1441974582.61501736 29 atime=1441974656.40686679 30 ctime=1441974670.089024288 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/tools/JarCertVerifier.java0000664000076400007640000005542512574544466026640 0ustar00jvanekjvanek00000000000000/* * 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 List verifiedJars = new ArrayList(); /** All of the jar files that were not verified */ private List unverifiedJars = new ArrayList(); /** The certificates used for jar verification linked to their respective information */ private 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 Map jarSignableEntries = new HashMap(); /** The application verifier to use by this instance */ private 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; } public boolean getAlreadyTrustPublisher() { boolean allPublishersTrusted = appVerifier.hasAlreadyTrustedPublisher( certs, jarSignableEntries); OutputController.getLogger().log("App already has trusted publisher: " + allPublishersTrusted); return allPublishersTrusted; } public boolean getRootInCacerts() { boolean allRootCAsTrusted = appVerifier.hasRootInCacerts(certs, jarSignableEntries); OutputController.getLogger().log("App has trusted root CA: " + allRootCAsTrusted); return allRootCAsTrusted; } public CertPath getCertPath(CertPath cPath) { // Parameter ignored. return currentlyUsed; } public boolean hasSigningIssues(CertPath certPath) { return certs.get(certPath).hasSigningIssues(); } 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. * * @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 { JarFile jarFile = null; try { 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; } finally { // close the resource if (jarFile != null) { jarFile.close(); } } } /** * Checks through all the jar entries for signers, storing all the common ones in the certs hash map. * * @param jarName * The absolute path to the jar file. * @param jarHasManifest * Whether or not the associated jar has a manifest. * @param entries * The list of entries in the associated jar. * @return If there is at least one signable entry that is not signed by a common signer, return UNSIGNED. Otherwise every signable entry is signed by at least one common signer. If the signer has no issues, return SIGNED_OK. If there are any signing issues, return SIGNED_NOT_OK. * @throws Exception * Will be thrown if there are issues with entries. */ VerifyResult verifyJarEntryCerts(String jarName, boolean jarHasManifest, Vector entries) throws Exception { // Contains number of entries the cert with this CertPath has signed. Map jarSignCount = new HashMap(); int numSignableEntriesInJar = 0; // Record current time just before checking the jar begins. long now = System.currentTimeMillis(); if (jarHasManifest) { for (JarEntry je : entries) { String name = je.getName(); CodeSigner[] signers = je.getCodeSigners(); boolean isSigned = (signers != null); boolean shouldHaveSignature = !je.isDirectory() && !isMetaInfFile(name); if (shouldHaveSignature) { numSignableEntriesInJar++; } if (shouldHaveSignature && isSigned) { for (int i = 0; i < signers.length; i++) { CertPath certPath = signers[i].getSignerCertPath(); if (!jarSignCount.containsKey(certPath)) jarSignCount.put(certPath, 1); else jarSignCount.put(certPath, jarSignCount.get(certPath) + 1); } } } // while e has more elements } else { // if manifest is null // Else increment total entries by 1 so that unsigned jars with // no manifests can't sneak in numSignableEntriesInJar++; } jarSignableEntries.put(jarName, numSignableEntriesInJar); // Find all signers that have signed every signable entry in this jar. boolean allEntriesSignedBySingleCert = false; for (CertPath certPath : jarSignCount.keySet()) { if (jarSignCount.get(certPath) == numSignableEntriesInJar) { allEntriesSignedBySingleCert = true; boolean wasPreviouslyVerified = certs.containsKey(certPath); if (!wasPreviouslyVerified) certs.put(certPath, new CertInformation()); CertInformation certInfo = certs.get(certPath); if (wasPreviouslyVerified) certInfo.resetForReverification(); certInfo.setNumJarEntriesSigned(jarName, numSignableEntriesInJar); Certificate cert = certPath.getCertificates().get(0); if (cert instanceof X509Certificate) { checkCertUsage(certPath, (X509Certificate) cert, null); long notBefore = ((X509Certificate) cert).getNotBefore().getTime(); long notAfter = ((X509Certificate) cert).getNotAfter().getTime(); if (now < notBefore) { certInfo.setNotYetValidCert(); } if (notAfter < now) { certInfo.setHasExpiredCert(); } else if (notAfter < now + SIX_MONTHS) { certInfo.setHasExpiringCert(); } } } } // 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; } 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; } } 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.size() == 0; } 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. * * @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.5.3/netx/net/sourceforge/jnlp/tools/PaxHeaders.24993/CertInformation.java0000644000000000000000000000013212574544466025621 xustar0030 mtime=1441974582.614017349 30 atime=1441974656.405866779 30 ctime=1441974670.089024288 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/tools/CertInformation.java0000664000076400007640000002255312574544466026711 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/splashscreen0000644000000000000000000000013212574544466023130 xustar0030 mtime=1441974582.612017326 30 atime=1441974670.156025059 30 ctime=1441974670.089024288 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/splashscreen/0000775000076400007640000000000012574544466024266 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/netx/net/sourceforge/jnlp/splashscreen/PaxHeaders.24993/parts0000644000000000000000000000013212574544466024261 xustar0030 mtime=1441974582.614017349 30 atime=1441974670.156025059 30 ctime=1441974670.089024288 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/splashscreen/parts/0000775000076400007640000000000012574544466025417 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/netx/net/sourceforge/jnlp/splashscreen/parts/PaxHeaders.24993/extensions0000644000000000000000000000013212574544466026460 xustar0030 mtime=1441974582.614017349 30 atime=1441974670.156025059 30 ctime=1441974670.089024288 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/splashscreen/parts/extensions/0000775000076400007640000000000012574544466027616 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/netx/net/sourceforge/jnlp/splashscreen/parts/extensions/PaxHeaders.24993/SplashExt0000644000000000000000000000013212574544466030373 xustar0030 mtime=1441974582.614017349 30 atime=1441974656.405866779 30 ctime=1441974670.089024288 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/splashscreen/parts/extensions/SplashExtension.java0000664000076400007640000000417512574544466033617 0ustar00jvanekjvanek00000000000000/* Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; 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.5.3/netx/net/sourceforge/jnlp/splashscreen/parts/extensions/PaxHeaders.24993/NoExtensi0000644000000000000000000000013212574544466030374 xustar0030 mtime=1441974582.614017349 30 atime=1441974656.405866779 30 ctime=1441974670.089024288 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/splashscreen/parts/extensions/NoExtension.java0000664000076400007640000000460412574544466032736 0ustar00jvanekjvanek00000000000000/* Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; 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.5.3/netx/net/sourceforge/jnlp/splashscreen/parts/extensions/PaxHeaders.24993/Extension0000644000000000000000000000013212574544466030434 xustar0030 mtime=1441974582.614017349 30 atime=1441974656.405866779 30 ctime=1441974670.089024288 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/splashscreen/parts/extensions/ExtensionManager.java0000664000076400007640000000460412574544466033734 0ustar00jvanekjvanek00000000000000/* Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; 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.5.3/netx/net/sourceforge/jnlp/splashscreen/parts/extensions/PaxHeaders.24993/Christmas0000644000000000000000000000013212574544466030415 xustar0030 mtime=1441974582.614017349 30 atime=1441974656.404866767 30 ctime=1441974670.089024288 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/splashscreen/parts/extensions/ChristmasExtension.java0000664000076400007640000002176212574544466034323 0ustar00jvanekjvanek00000000000000/* Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; 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.5.3/netx/net/sourceforge/jnlp/splashscreen/parts/PaxHeaders.24993/JEditorPaneBasedExce0000644000000000000000000000013212574544466030171 xustar0030 mtime=1441974582.613017337 30 atime=1441974656.404866767 30 ctime=1441974670.088024277 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/splashscreen/parts/JEditorPaneBasedExceptionDialog.java0000664000076400007640000004577212574544466034403 0ustar00jvanekjvanek00000000000000/* 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.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); }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 "" + Translator.R(InfoItem.SPLASH + "urlLooks") + ""; } private static String addChain() { if (LaunchException.getLaunchExceptionChain().isEmpty()) { return ""; } return Translator.R(InfoItem.SPLASH + "chainWas") + "
\n" + "
" + getChainAsString(true) + "
"; } private static String addPlainChain() { if (LaunchException.getLaunchExceptionChain().isEmpty()) { return ""; } return "\n Chain: \n" + getChainAsString(false); } private static String getChainAsString(boolean formatTime) { return getChainAsString(LaunchException.getLaunchExceptionChain(), formatTime); } private static String getChainAsString(List launchExceptionChain, boolean formatTime) { String s = ""; if (launchExceptionChain != null) { for (int i = 0; i < launchExceptionChain.size(); i++) { LaunchException.LaunchExceptionWithStamp launchException = launchExceptionChain.get(i); s = s + (i+1) + ") at " + formatTime(launchException.getStamp(), formatTime) + "\n" + getExceptionStackTraceAsString(launchException.getEx()); } } return s; } private static String formatTime(Date dateTime, boolean formatTime) { if (dateTime == null) { return "unknown time"; } if (formatTime) { return DateFormat.getInstance().format(dateTime); } else { return dateTime.toString(); } } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/splashscreen/parts/PaxHeaders.24993/InformationElement.j0000644000000000000000000000013212574544466030310 xustar0030 mtime=1441974582.613017337 30 atime=1441974656.404866767 30 ctime=1441974670.088024277 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/splashscreen/parts/InformationElement.java0000664000076400007640000002053612574544466032067 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/splashscreen/parts/PaxHeaders.24993/InfoItem.java0000644000000000000000000000013212574544466026713 xustar0030 mtime=1441974582.613017337 30 atime=1441974656.404866767 30 ctime=1441974670.088024277 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/splashscreen/parts/InfoItem.java0000664000076400007640000001106212574544466027774 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/splashscreen/parts/PaxHeaders.24993/DescriptionInfoItem.0000644000000000000000000000013212574544466030255 xustar0030 mtime=1441974582.613017337 30 atime=1441974656.404866767 30 ctime=1441974670.088024277 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/splashscreen/parts/DescriptionInfoItem.java0000664000076400007640000001053312574544466032202 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/splashscreen/parts/PaxHeaders.24993/BasicComponentSplash0000644000000000000000000000013212574544466030340 xustar0030 mtime=1441974582.612017326 30 atime=1441974656.403866756 30 ctime=1441974670.088024277 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/splashscreen/parts/BasicComponentSplashScreen.java0000664000076400007640000001046012574544466033502 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/splashscreen/parts/PaxHeaders.24993/BasicComponentErrorS0000644000000000000000000000013212574544466030322 xustar0030 mtime=1441974582.612017326 30 atime=1441974656.403866756 30 ctime=1441974670.088024277 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/splashscreen/parts/BasicComponentErrorSplashScreen.java0000664000076400007640000000575212574544466034524 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/splashscreen/PaxHeaders.24993/impls0000644000000000000000000000013212574544466024254 xustar0030 mtime=1441974582.610017303 30 atime=1441974670.156025059 30 ctime=1441974670.088024277 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/splashscreen/impls/0000775000076400007640000000000012574544466025412 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/netx/net/sourceforge/jnlp/splashscreen/impls/PaxHeaders.24993/defaultsplashscreen20000644000000000000000000000013212574544466030375 xustar0030 mtime=1441974582.612017326 30 atime=1441974670.156025059 30 ctime=1441974670.088024277 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/0000775000076400007640000000000012574544466031756 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/PaxHeaders.240000644000000000000000000000032212574544466030354 xustar00120 path=icedtea-web-1.5.3/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/TextWithWaterLevel.java 30 mtime=1441974582.612017326 30 atime=1441974656.403866756 30 ctime=1441974670.088024277 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/TextWithWater0000664000076400007640000001332112574544466034464 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/PaxHeaders.240000644000000000000000000000032312574544466030355 xustar00121 path=icedtea-web-1.5.3/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/TextOutlineRenderer.java 30 mtime=1441974582.612017326 30 atime=1441974656.403866756 30 ctime=1441974670.088024277 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/TextOutlineRe0000664000076400007640000001042412574544466034455 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/PaxHeaders.240000644000000000000000000000031312574544466030354 xustar00113 path=icedtea-web-1.5.3/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/SplinesDefs.java 30 mtime=1441974582.612017326 30 atime=1441974656.402866744 30 ctime=1441974670.088024277 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/SplinesDefs.j0000664000076400007640000001475712574544466034366 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/PaxHeaders.240000644000000000000000000000031612574544466030357 xustar00116 path=icedtea-web-1.5.3/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/NatCubicClosed.java 30 mtime=1441974582.612017326 30 atime=1441974656.402866744 30 ctime=1441974670.088024277 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/NatCubicClose0000664000076400007640000001040112574544466034353 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/PaxHeaders.240000644000000000000000000000013212574544466030353 xustar0030 mtime=1441974582.611017314 30 atime=1441974656.402866744 30 ctime=1441974670.088024277 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/NatCubic.java0000664000076400007640000001140312574544466034310 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/PaxHeaders.240000644000000000000000000000031212574544466030353 xustar00112 path=icedtea-web-1.5.3/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/MovingText.java 30 mtime=1441974582.611017314 30 atime=1441974656.402866744 30 ctime=1441974670.088024277 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/MovingText.ja0000664000076400007640000000525312574544466034403 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/PaxHeaders.240000644000000000000000000000031412574544466030355 xustar00114 path=icedtea-web-1.5.3/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/ErrorPainter.java 30 mtime=1441974582.611017314 30 atime=1441974656.402866744 30 ctime=1441974670.088024277 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/ErrorPainter.0000664000076400007640000002424612574544466034403 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/PaxHeaders.240000644000000000000000000000013212574544466030353 xustar0030 mtime=1441974582.611017314 30 atime=1441974656.402866744 30 ctime=1441974670.088024277 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/Cubic.java0000664000076400007640000000450712574544466033654 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/PaxHeaders.240000644000000000000000000000031412574544466030355 xustar00114 path=icedtea-web-1.5.3/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/ControlCurve.java 30 mtime=1441974582.611017314 30 atime=1441974656.401866733 30 ctime=1441974670.088024277 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/ControlCurve.0000664000076400007640000001304312574544466034405 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/PaxHeaders.240000644000000000000000000000031312574544466030354 xustar00113 path=icedtea-web-1.5.3/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/BasePainter.java 30 mtime=1441974582.610017303 30 atime=1441974656.401866733 30 ctime=1441974670.088024277 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/splashscreen/impls/defaultsplashscreen2012/BasePainter.j0000664000076400007640000005500612574544466034334 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/splashscreen/impls/PaxHeaders.24993/DefaultSplashScreens0000644000000000000000000000013212574544466030336 xustar0030 mtime=1441974582.610017303 30 atime=1441974656.401866733 30 ctime=1441974670.088024277 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/splashscreen/impls/DefaultSplashScreens2012Commons.java0000664000076400007640000001051712574544466034204 0ustar00jvanekjvanek00000000000000/* 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; 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(); } } }); // 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.5.3/netx/net/sourceforge/jnlp/splashscreen/impls/PaxHeaders.24993/DefaultSplashScreen20000644000000000000000000000013212574544466030235 xustar0030 mtime=1441974582.610017303 30 atime=1441974656.401866733 30 ctime=1441974670.088024277 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/splashscreen/impls/DefaultSplashScreen2012.java0000664000076400007640000000674312574544466032473 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/splashscreen/impls/PaxHeaders.24993/DefaultErrorSplashSc0000644000000000000000000000013212574544466030313 xustar0030 mtime=1441974582.610017303 30 atime=1441974656.400866721 30 ctime=1441974670.088024277 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/splashscreen/impls/DefaultErrorSplashScreen2012.java0000664000076400007640000000770412574544466033503 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/splashscreen/PaxHeaders.24993/SplashUtils.java0000644000000000000000000000013212574544466026323 xustar0030 mtime=1441974582.609017291 30 atime=1441974656.400866721 30 ctime=1441974670.088024277 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/splashscreen/SplashUtils.java0000664000076400007640000001770612574544466027417 0ustar00jvanekjvanek00000000000000/* 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 */ 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.5.3/netx/net/sourceforge/jnlp/splashscreen/PaxHeaders.24993/SplashPanel.java0000644000000000000000000000013212574544466026262 xustar0030 mtime=1441974582.609017291 30 atime=1441974656.400866721 30 ctime=1441974670.088024277 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/splashscreen/SplashPanel.java0000664000076400007640000000742512574544466027353 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/splashscreen/PaxHeaders.24993/SplashErrorPanel.java0000644000000000000000000000013212574544466027274 xustar0030 mtime=1441974582.609017291 30 atime=1441974656.400866721 30 ctime=1441974670.088024277 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/splashscreen/SplashErrorPanel.java0000664000076400007640000000375012574544466030362 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/splashscreen/PaxHeaders.24993/SplashController.java0000644000000000000000000000013212574544466027346 xustar0030 mtime=1441974582.609017291 30 atime=1441974656.400866721 30 ctime=1441974670.088024277 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/splashscreen/SplashController.java0000664000076400007640000000360112574544466030427 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/services0000644000000000000000000000013212574544466022261 xustar0030 mtime=1441974582.609017291 30 atime=1441974670.156025059 30 ctime=1441974670.088024277 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/services/0000775000076400007640000000000012574544466023417 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/netx/net/sourceforge/jnlp/services/PaxHeaders.24993/package-info.java0000644000000000000000000000013112574544466025524 xustar0030 mtime=1441974582.609017291 29 atime=1441974656.39986671 30 ctime=1441974670.088024277 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/services/package-info.java0000664000076400007640000000340512574544466026610 0ustar00jvanekjvanek00000000000000/* 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 netx.sourceforge.jnlp.services; icedtea-web-1.5.3/netx/net/sourceforge/jnlp/services/PaxHeaders.24993/XSingleInstanceService.java0000644000000000000000000000013012574544466027556 xustar0029 mtime=1441974582.60801728 29 atime=1441974656.39986671 30 ctime=1441974670.088024277 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/services/XSingleInstanceService.java0000664000076400007640000002160512574544466030645 0ustar00jvanekjvanek00000000000000// 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.5.3/netx/net/sourceforge/jnlp/services/PaxHeaders.24993/XServiceManagerStub.java0000644000000000000000000000013012574544466027060 xustar0029 mtime=1441974582.60801728 29 atime=1441974656.39986671 30 ctime=1441974670.088024277 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/services/XServiceManagerStub.java0000664000076400007640000001001012574544466030133 0ustar00jvanekjvanek00000000000000// 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.5.3/netx/net/sourceforge/jnlp/services/PaxHeaders.24993/XPrintService.java0000644000000000000000000000013012574544466025744 xustar0029 mtime=1441974582.60801728 29 atime=1441974656.39986671 30 ctime=1441974670.088024277 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/services/XPrintService.java0000664000076400007640000001035112574544466027027 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/services/PaxHeaders.24993/XPersistenceService.java0000644000000000000000000000013012574544466027134 xustar0029 mtime=1441974582.60801728 29 atime=1441974656.39986671 30 ctime=1441974670.088024277 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/services/XPersistenceService.java0000664000076400007640000001466212574544466030230 0ustar00jvanekjvanek00000000000000// 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.DeploymentConfiguration; 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 = JNLPRuntime.getConfiguration() .getProperty(DeploymentConfiguration.KEY_USER_PERSISTENCE_CACHE_DIR); 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.5.3/netx/net/sourceforge/jnlp/services/PaxHeaders.24993/XJNLPRandomAccessFile.java0000644000000000000000000000013112574544466027156 xustar0030 mtime=1441974582.607017268 29 atime=1441974656.39986671 30 ctime=1441974670.088024277 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/services/XJNLPRandomAccessFile.java0000664000076400007640000001246112574544466030244 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/services/PaxHeaders.24993/XFileSaveService.java0000644000000000000000000000013212574544466026350 xustar0030 mtime=1441974582.607017268 30 atime=1441974656.398866698 30 ctime=1441974670.088024277 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/services/XFileSaveService.java0000664000076400007640000001157312574544466027440 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/services/PaxHeaders.24993/XFileOpenService.java0000644000000000000000000000013212574544466026353 xustar0030 mtime=1441974582.607017268 30 atime=1441974656.398866698 30 ctime=1441974670.088024277 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/services/XFileOpenService.java0000664000076400007640000000752412574544466027444 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/services/PaxHeaders.24993/XFileContents.java0000644000000000000000000000013212574544466025726 xustar0030 mtime=1441974582.607017268 30 atime=1441974656.398866698 30 ctime=1441974670.088024277 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/services/XFileContents.java0000664000076400007640000000572112574544466027014 0ustar00jvanekjvanek00000000000000// 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.5.3/netx/net/sourceforge/jnlp/services/PaxHeaders.24993/XExtensionInstallerService.jav0000644000000000000000000000013212574544466030343 xustar0030 mtime=1441974582.607017268 30 atime=1441974656.398866698 30 ctime=1441974670.088024277 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/services/XExtensionInstallerService.java0000664000076400007640000000442612574544466031573 0ustar00jvanekjvanek00000000000000// 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.5.3/netx/net/sourceforge/jnlp/services/PaxHeaders.24993/XExtendedService.java0000644000000000000000000000013212574544466026412 xustar0030 mtime=1441974582.606017257 30 atime=1441974656.398866698 30 ctime=1441974670.087024265 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/services/XExtendedService.java0000664000076400007640000000365212574544466027501 0ustar00jvanekjvanek00000000000000// 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.5.3/netx/net/sourceforge/jnlp/services/PaxHeaders.24993/XDownloadService.java0000644000000000000000000000013212574544466026421 xustar0030 mtime=1441974582.606017257 30 atime=1441974656.398866698 30 ctime=1441974670.087024265 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/services/XDownloadService.java0000664000076400007640000001735112574544466027511 0ustar00jvanekjvanek00000000000000// 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.5.3/netx/net/sourceforge/jnlp/services/PaxHeaders.24993/XClipboardService.java0000644000000000000000000000013212574544466026551 xustar0030 mtime=1441974582.606017257 30 atime=1441974656.397866687 30 ctime=1441974670.087024265 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/services/XClipboardService.java0000664000076400007640000000550712574544466027641 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/services/PaxHeaders.24993/XBasicService.java0000644000000000000000000000013212574544466025673 xustar0030 mtime=1441974582.606017257 30 atime=1441974656.397866687 30 ctime=1441974670.087024265 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/services/XBasicService.java0000664000076400007640000002272412574544466026763 0ustar00jvanekjvanek00000000000000// 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.MalformedURLException; import java.net.URL; 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. */ 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 */ public boolean isOffline() { URL url = findFirstURLFromJNLPFile(); try { url.openConnection().getInputStream().close(); return false; } catch (IOException exception) { return true; } } /** * 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 */ public boolean isWebBrowserSupported() { initialize(); return command != null; } /** * Show a document. * * @return whether the document was opened */ 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.5.3/netx/net/sourceforge/jnlp/services/PaxHeaders.24993/SingleInstanceLock.java0000644000000000000000000000013212574544466026720 xustar0030 mtime=1441974582.606017257 30 atime=1441974656.397866687 30 ctime=1441974670.087024265 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/services/SingleInstanceLock.java0000664000076400007640000001347512574544466030013 0ustar00jvanekjvanek00000000000000// 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.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.JNLPRuntime; 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 = new File(JNLPRuntime.getConfiguration() .getProperty(DeploymentConfiguration.KEY_USER_LOCKS_DIR)); 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.5.3/netx/net/sourceforge/jnlp/services/PaxHeaders.24993/ServiceUtil.java0000644000000000000000000000013212574544466025437 xustar0030 mtime=1441974582.605017245 30 atime=1441974656.397866687 30 ctime=1441974670.087024265 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/services/ServiceUtil.java0000664000076400007640000003002112574544466026514 0ustar00jvanekjvanek00000000000000// 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 { /** * Returns the BasicService reference, or null if the service is * unavailable. */ public static BasicService getBasicService() { return (BasicService) getService("javax.jnlp.BasicService"); } /** * Returns the ClipboardService reference, or null if the service is * unavailable. */ public static ClipboardService getClipboardService() { return (ClipboardService) getService("javax.jnlp.ClipboardService"); } /** * Returns the DownloadService reference, or null if the service is * unavailable. */ public static DownloadService getDownloadService() { return (DownloadService) getService("javax.jnlp.DownloadService"); } /** * Returns the ExtensionInstallerService reference, or null if the service is * unavailable. */ public static ExtensionInstallerService getExtensionInstallerService() { return (ExtensionInstallerService) getService("javax.jnlp.ExtensionInstallerService"); } /** * Returns the FileOpenService reference, or null if the service is * unavailable. */ public static FileOpenService getFileOpenService() { return (FileOpenService) getService("javax.jnlp.FileOpenService"); } /** * Returns the FileSaveService reference, or null if the service is * unavailable. */ public static FileSaveService getFileSaveService() { return (FileSaveService) getService("javax.jnlp.FileSaveService"); } /** * Returns the PersistenceService reference, or null if the service is * unavailable. */ public static PersistenceService getPersistenceService() { return (PersistenceService) getService("javax.jnlp.PersistenceService"); } /** * Returns the PrintService reference, or null if the service is * unavailable. */ public static PrintService getPrintService() { return (PrintService) getService("javax.jnlp.PrintService"); } /** * Returns 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 (int i = 0; i < args.length; i++) { OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, " arg: " + args[i]); } } } 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.showAccessWarningDialog(tmpType, tmpApp.getJNLPFile(), tmpExtras); return Boolean.valueOf(b); } }); return b.booleanValue(); } 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 (int i = 0; i < stack.length; i++) { Class c = null; try { c = Class.forName(stack[i].getClassName()); } catch (Exception e1) { OutputController.getLogger().log(e1); try { c = Class.forName(stack[i].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.5.3/netx/net/sourceforge/jnlp/services/PaxHeaders.24993/InstanceExistsException.java0000644000000000000000000000013212574544466030024 xustar0030 mtime=1441974582.605017245 30 atime=1441974656.397866687 30 ctime=1441974670.087024265 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/services/InstanceExistsException.java0000664000076400007640000000232312574544466031105 0ustar00jvanekjvanek00000000000000// 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.5.3/netx/net/sourceforge/jnlp/services/PaxHeaders.24993/ExtendedSingleInstanceService.0000644000000000000000000000013212574544466030247 xustar0030 mtime=1441974582.605017245 30 atime=1441974656.397866687 30 ctime=1441974670.087024265 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/services/ExtendedSingleInstanceService.java0000664000076400007640000000325012574544466032172 0ustar00jvanekjvanek00000000000000// 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.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/security0000644000000000000000000000013212574544466022305 xustar0030 mtime=1441974582.604017234 30 atime=1441974670.156025059 30 ctime=1441974670.087024265 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/0000775000076400007640000000000012574544466023443 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/PaxHeaders.24993/viewer0000644000000000000000000000013212574544466023606 xustar0030 mtime=1441974582.605017245 30 atime=1441974670.156025059 30 ctime=1441974670.087024265 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/viewer/0000775000076400007640000000000012574544466024744 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/viewer/PaxHeaders.24993/CertificateViewer.java0000644000000000000000000000013212574544466030132 xustar0030 mtime=1441974582.605017245 30 atime=1441974656.396866675 30 ctime=1441974670.087024265 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/viewer/CertificateViewer.java0000664000076400007640000000721312574544466031216 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/security/viewer/PaxHeaders.24993/CertificatePane.java0000644000000000000000000000013212574544466027554 xustar0030 mtime=1441974582.604017234 30 atime=1441974656.396866675 30 ctime=1441974670.087024265 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/viewer/CertificatePane.java0000664000076400007640000005060412574544466030642 0ustar00jvanekjvanek00000000000000/* 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.FileOutputStream; import java.io.OutputStream; 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 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(); } else { 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 = new File(KeyStores .getKeyStoreLocation(currentKeyStoreLevel, currentKeyStoreType)); if (!keyStoreFile.isFile()) { FileUtils.createRestrictedFile(keyStoreFile, true); } OutputStream os = new FileOutputStream(keyStoreFile); try { ks.store(os, KeyStores.getPassword()); } finally { os.close(); } 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 = new File(KeyStores .getKeyStoreLocation(currentKeyStoreLevel, currentKeyStoreType)); if (!keyStoreFile.isFile()) { FileUtils.createRestrictedFile(keyStoreFile, true); } FileOutputStream fos = new FileOutputStream(keyStoreFile); keyStore.store(fos, KeyStores.getPassword()); fos.close(); } } 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.5.3/netx/net/sourceforge/jnlp/security/PaxHeaders.24993/policyeditor0000644000000000000000000000013212574544466025013 xustar0030 mtime=1441974582.604017234 30 atime=1441974670.156025059 30 ctime=1441974670.087024265 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/policyeditor/0000775000076400007640000000000012574544466026151 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/policyeditor/PaxHeaders.24993/PolicyEntry.java0000644000000000000000000000013212574544466030214 xustar0030 mtime=1441974582.604017234 30 atime=1441974656.396866675 30 ctime=1441974670.087024265 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/policyeditor/PolicyEntry.java0000664000076400007640000001026012574544466031274 0ustar00jvanekjvanek00000000000000/*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.HashSet; import java.util.Set; /** * 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); } @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.5.3/netx/net/sourceforge/jnlp/security/policyeditor/PaxHeaders.24993/PolicyEditorPermi0000644000000000000000000000013212574544466030416 xustar0030 mtime=1441974582.604017234 30 atime=1441974656.396866675 30 ctime=1441974670.087024265 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditorPermissions.java0000664000076400007640000003006112574544466033656 0ustar00jvanekjvanek00000000000000/*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(String title, PolicyEditorPermissions... permissions) { this.title = title; this.permissions = permissions; } public static boolean anyContains(PolicyEditorPermissions permission) { for (final Group g : Group.values()) { if (g.contains(permission)) { return true; } } return false; } public static boolean anyContains(JCheckBox view, Map checkboxMap) { for (Map.Entry pairs : checkboxMap.entrySet()){ if (pairs.getValue() == view) { for (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 (PolicyEditorPermissions pp: getPermissions()){ 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(PolicyEditorPermissions permission) { for (PolicyEditorPermissions policyEditorPermissions : permissions) { if (policyEditorPermissions == permission) { return true; } } return false; } 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.5.3/netx/net/sourceforge/jnlp/security/policyeditor/PaxHeaders.24993/PolicyEditor.java0000644000000000000000000000013212574544466030341 xustar0030 mtime=1441974582.603017222 30 atime=1441974656.395866664 30 ctime=1441974670.087024265 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditor.java0000664000076400007640000016644712574544466031444 0ustar00jvanekjvanek00000000000000/*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.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyEvent; 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.URL; import java.nio.channels.FileLock; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Arrays; import java.util.Calendar; import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Set; import java.util.TreeMap; import java.util.regex.Matcher; import java.util.regex.Pattern; import javax.swing.AbstractAction; import javax.swing.AbstractButton; import javax.swing.Action; import javax.swing.DefaultListModel; import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JComponent; 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.SwingUtilities; 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.security.policyeditor.PolicyEditorPermissions.Group; import net.sourceforge.jnlp.util.FileUtils; import net.sourceforge.jnlp.util.FileUtils.OpenFileResult; import net.sourceforge.jnlp.util.MD5SumWatcher; import net.sourceforge.jnlp.util.logging.OutputController; /** * 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 = "-help"; /** * 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 = "-file"; /** * Command line switch to specify a new codebase entry to be made. * Can only be used once, presently. */ public static final String CODEBASE_FLAG = "-codebase"; private static final String HELP_MESSAGE = "Usage:\t" + R("PEUsage") + "\n\n" + " " + HELP_FLAG + "\t\t\t" + R("PEHelpFlag") + "\n" + " " + FILE_FLAG + "\t\t\t" + R("PEFileFlag") + "\n" + " " + CODEBASE_FLAG + "\t\t" + R("PECodebaseFlag") + "\n"; private static final String AUTOGENERATED_NOTICE = "/* DO NOT MODIFY! AUTO-GENERATED */"; private File file; private boolean changesMade = false; private boolean closed = false; private final Map> codebasePermissionsMap = new HashMap>(); private final Map> customPermissionsMap = new HashMap>(); 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; private final WeakReference weakThis = new WeakReference(this); private MD5SumWatcher fileWatcher; private final ActionListener okButtonAction, addCodebaseButtonAction, removeCodebaseButtonAction, openButtonAction, saveAsButtonAction, viewCustomButtonAction; private ActionListener closeButtonAction; private static class JCheckBoxWithGroup extends JCheckBox { private final PolicyEditorPermissions.Group group; private JCheckBoxWithGroup(Group g) { super(g.getTitle()); group = g; } public Group getGroup() { return group; } private void setState(Map map) { List backup = new LinkedList(); for (final ActionListener l : this.getActionListeners()) { backup.add(l); this.removeActionListener(l); } 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 (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); } if (filepath != null) { file = new File(filepath); openAndParsePolicyFile(); } else { resetCodebases(); } fileChooser = new JFileChooser(file); fileChooser.setFileHidingEnabled(false); okButtonAction = new ActionListener() { @Override public void actionPerformed(final ActionEvent event) { if (file == null) { final int choice = fileChooser.showOpenDialog(weakThis.get()); if (choice == JFileChooser.APPROVE_OPTION) { file = fileChooser.getSelectedFile(); } } // May still be null if user cancelled the file chooser if (file != null) { savePolicyFile(); } } }; okButton.setText(R("ButApply")); okButton.addActionListener(okButtonAction); addCodebaseButtonAction = new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { interactivelyAddCodebase(); } }; addCodebaseButton.setText(R("PEAddCodebase")); addCodebaseButton.addActionListener(addCodebaseButtonAction); removeCodebaseButtonAction = new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { removeCodebase((String) list.getSelectedValue()); } }; removeCodebaseButton.setText(R("PERemoveCodebase")); removeCodebaseButton.addActionListener(removeCodebaseButtonAction); openButtonAction = new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { if (changesMade) { final int save = JOptionPane.showConfirmDialog(weakThis.get(), R("PESaveChanges")); if (save == JOptionPane.YES_OPTION) { if (file == null) { final int choice = fileChooser.showSaveDialog(weakThis.get()); if (choice == JFileChooser.APPROVE_OPTION) { file = fileChooser.getSelectedFile(); } else if (choice == JFileChooser.CANCEL_OPTION) { return; } } savePolicyFile(); } else if (save == JOptionPane.CANCEL_OPTION) { return; } } final int choice = fileChooser.showOpenDialog(weakThis.get()); if (choice == JFileChooser.APPROVE_OPTION) { file = fileChooser.getSelectedFile(); openAndParsePolicyFile(); } } }; saveAsButtonAction = new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { final int choice = fileChooser.showSaveDialog(weakThis.get()); if (choice == JFileChooser.APPROVE_OPTION) { file = fileChooser.getSelectedFile(); savePolicyFile(); } } }; viewCustomButtonAction = new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { String codebase = getSelectedCodebase(); if (codebase == null){ return; } if (cpViewer == null) { cpViewer = new CustomPolicyViewer(weakThis.get(), codebase, customPermissionsMap.get(codebase)); cpViewer.setVisible(true); } else { cpViewer.toFront(); cpViewer.repaint(); } } }); } }; setAccelerators(); setupLayout(); } private String getSelectedCodebase() { String codebase = (String) list.getSelectedValue(); if (codebase == null || codebase.isEmpty()) { return null; } if (codebase.equals(R("PEGlobalSettings"))) { return ""; } return codebase; } private static void preparePolicyEditorWindow(final PolicyEditorWindow w, PolicyEditor e) { w.setModalityType(ModalityType.MODELESS); //at least some default w.setPolicyEditor(e); w.setTitle(R("PETitle")); w.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); w.setJMenuBar(createMenuBar(w.asWindow(), 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(); window.dispose(); } }); editor.closeButtonAction = new ActionListener() { @Override public void actionPerformed(final ActionEvent event) { ((PolicyEditorWindow) window).quit(); } }; editor.closeButton.setText(R("ButClose")); editor.closeButton.addActionListener(editor.closeButtonAction); final Action saveAct = new AbstractAction() { @Override public void actionPerformed(final ActionEvent e) { editor.savePolicyFile(); } }; editor.setAccelerator(R("PEOkButtonMnemonic"), ActionEvent.ALT_MASK, saveAct, "OkButtonAccelerator"); final Action quitAct = new AbstractAction() { @Override public void actionPerformed(final ActionEvent e) { ((PolicyEditorWindow) window).quit(); } }; editor.setAccelerator(R("PECancelButtonMnemonic"), ActionEvent.ALT_MASK, quitAct, "CancelButtonAccelerator"); final Action escAct = new AbstractAction() { @Override public void actionPerformed(final ActionEvent e) { ((PolicyEditorWindow) window).quit(); } }; editor.setAccelerator(KeyEvent.VK_ESCAPE, ActionEvent.ALT_MASK, escAct, "ExitOnEscape"); } 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(PolicyEditor e) { editor = e; } @Override public final void setDefaultCloseOperation(int operation) { super.setDefaultCloseOperation(operation); } @Override public final void setJMenuBar(JMenuBar menu) { super.setJMenuBar(menu); } @Override public final Window asWindow() { return this; } @Override public void setModalityType(ModalityType type) { //no op for frame } @Override public void quit() { if (editor.changesMade) { final int save = JOptionPane.showConfirmDialog(this, R("PESaveChanges")); if (save == JOptionPane.YES_OPTION) { if (editor.file == null) { final int choice = editor.fileChooser.showSaveDialog(this); if (choice == JFileChooser.APPROVE_OPTION) { editor.file = editor.fileChooser.getSelectedFile(); } else if (choice == JFileChooser.CANCEL_OPTION) { return; } } editor.savePolicyFile(); } else if (save == JOptionPane.CANCEL_OPTION) { return; } } editor.weakThis.clear(); editor.setClosed(); 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(String title) { super.setTitle(title); } @Override public final PolicyEditor getPolicyEditor() { return editor; } @Override public final void setPolicyEditor(PolicyEditor e) { editor = e; } @Override public final void setDefaultCloseOperation(int operation) { super.setDefaultCloseOperation(operation); } @Override public final void setJMenuBar(JMenuBar menu) { super.setJMenuBar(menu); } @Override public final Window asWindow() { return this; } @Override public void setModalityType(ModalityType type) { super.setModalityType(type); } @Override public void quit() { if (editor.changesMade) { final int save = JOptionPane.showConfirmDialog(this, R("PESaveChanges")); if (save == JOptionPane.YES_OPTION) { if (editor.file == null) { final int choice = editor.fileChooser.showSaveDialog(this); if (choice == JFileChooser.APPROVE_OPTION) { editor.file = editor.fileChooser.getSelectedFile(); } else if (choice == JFileChooser.CANCEL_OPTION) { return; } } editor.savePolicyFile(); } else if (save == JOptionPane.CANCEL_OPTION) { return; } } editor.weakThis.clear(); editor.setClosed(); dispose(); } } 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; } /** * Set keyboard accelerators for each major function in the editor */ private void setAccelerators() { setAddCodebaseAccelerator(); setRemoveCodebaseAccelerator(); } /** * Set a key accelerator * @param trigger the accelerator key * @param modifiers Alt, Ctrl, or other modifiers to be held with the trigger * @param action to be performed * @param identifier an identifier for the action */ private void setAccelerator(final String trigger, final int modifiers, final Action action, final String identifier) { final int trig; try { trig = Integer.parseInt(trigger); } catch (final NumberFormatException nfe) { OutputController.getLogger().log("Unable to set accelerator action \"" + identifier + "\" for trigger \"" + trigger + "\""); OutputController.getLogger().log(nfe); return; } setAccelerator(trig, modifiers, action, identifier); } /** * Set a key accelerator * @param trigger the accelerator key * @param modifiers Alt, Ctrl, or other modifiers to be held with the trigger * @param action to be performed * @param identifier an identifier for the action */ private void setAccelerator(final int trigger, final int modifiers, final Action action, final String identifier) { final KeyStroke key = KeyStroke.getKeyStroke(trigger, modifiers); this.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(key, identifier); this.getActionMap().put(identifier, action); } /** * Add an accelerator for adding new codebases */ private void setAddCodebaseAccelerator() { final Action act = new AbstractAction() { @Override public void actionPerformed(final ActionEvent e) { interactivelyAddCodebase(); } }; setAccelerator(R("PEAddCodebaseMnemonic"), ActionEvent.ALT_MASK, act, "AddCodebaseAccelerator"); } /** * Add an accelerator for removing the selected codebase */ private void setRemoveCodebaseAccelerator() { final Action act = new AbstractAction() { @Override public void actionPerformed(final ActionEvent e) { removeCodebase((String) list.getSelectedValue()); } }; setAccelerator(R("PERemoveCodebaseMnemonic"), ActionEvent.ALT_MASK, act, "RemoveCodebaseAccelerator"); } /** * 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) { try { new URL(codebase); } catch (MalformedURLException mfue) { OutputController.getLogger().log("Could not add codebase " + codebase); OutputController.getLogger().log(mfue); return; } final boolean existingCodebase = initializeMapForCodebase(codebase); final String model; if (codebase.isEmpty()) { model = R("PEGlobalSettings"); } else { model = codebase; } if (!existingCodebase) { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { listModel.addElement(model); } }); changesMade = true; } SwingUtilities.invokeLater(new Runnable() { @Override public void run() { list.setSelectedValue(model, true); updateCheckboxes(codebase); } }); } /** * Add a collection of codebases to the editor. * @param codebases the collection of codebases to be added */ public void addNewCodebases(final Collection codebases) { for (final String codebase : codebases) { addNewCodebase(codebase); } } /** * Add an array of codebases to the editor. * @param codebases the array of codebases to be added */ public void addNewCodebases(final String[] codebases) { addNewCodebases(Arrays.asList(codebases)); } /** * 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 interactivelyAddCodebase() { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { String codebase = ""; boolean stopAsking = false; while (!stopAsking) { codebase = JOptionPane.showInputDialog(weakThis.get(), R("PECodebasePrompt"), "http://"); if (codebase == null) { return; } try { final URL u = new URL(codebase); if (u.getProtocol() != null && u.getHost() != null) { stopAsking = true; } } catch (final MalformedURLException mfue) { } } 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; } codebasePermissionsMap.remove(codebase); final int fIndex = previousIndex; SwingUtilities.invokeLater(new Runnable() { @Override public void run() { listModel.removeElement(codebase); list.setSelectedIndex(fIndex); } }); changesMade = true; } /** * @return the set of Codebase entries in the policy file */ public Set getCodebases() { return new HashSet(codebasePermissionsMap.keySet()); } /** * @param codebase the codebase to query * @return a map of permissions to whether these permissions are set for the given codebase */ public Map getPermissions(final String codebase) { final Map permissions = codebasePermissionsMap.get(codebase); if (permissions != null) { return new HashMap(permissions); } else { final Map blank = new HashMap(); for (final PolicyEditorPermissions perm : PolicyEditorPermissions.values()) { blank.put(perm, false); } return blank; } } /** * @param codebase the codebase to query * @return a collection of CustomPermissions granted to the given codebase */ public Collection getCustomPermissions(final String codebase) { final Collection permissions = customPermissionsMap.get(codebase); if (permissions != null) { return new HashSet(permissions); } else { return Collections.emptySet(); } } /** * 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 { if (SwingUtilities.isEventDispatchThread()){ updateCheckboxesImpl(codebase); } else { updateCheckboxesInvokeAndWait(codebase); } } catch (InterruptedException ex) { OutputController.getLogger().log(ex); } catch (InvocationTargetException ex) { OutputController.getLogger().log(ex); } } private void updateCheckboxesInvokeAndWait(final String codebase) throws InterruptedException, InvocationTargetException { SwingUtilities.invokeAndWait(new Runnable() { @Override public void run() { updateCheckboxesImpl(codebase); } }); } private void updateCheckboxesImpl(String codebase) { for (final PolicyEditorPermissions perm : PolicyEditorPermissions.values()) { final JCheckBox box = checkboxMap.get(perm); for (final ActionListener l : box.getActionListeners()) { box.removeActionListener(l); } initializeMapForCodebase(codebase); final Map map = codebasePermissionsMap.get(codebase); final boolean state; if (map != null) { final Boolean s = map.get(perm); if (s != null) { state = s; } else { state = false; } } else { state = false; } for (JCheckBoxWithGroup jg : groupBoxList) { jg.setState(map); } box.setSelected(state); box.addActionListener(new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { changesMade = true; map.put(perm, box.isSelected()); for (JCheckBoxWithGroup jg : groupBoxList) { jg.setState(map); } } }); } } /** * Set a mnemonic key for a menu item or button * @param component the component for which to set a mnemonic * @param mnemonic the mnemonic to set */ private static void setComponentMnemonic(final AbstractButton component, final String mnemonic) { final int trig; try { trig = Integer.parseInt(mnemonic); } catch (final NumberFormatException nfe) { OutputController.getLogger().log(nfe); return; } component.setMnemonic(trig); } private static JMenuBar createMenuBar(final Window window, final PolicyEditor editor) { final JMenuBar menuBar = new JMenuBar(); final JMenu fileMenu = new JMenu(R("PEFileMenu")); setComponentMnemonic(fileMenu, R("PEFileMenuMnemonic")); final JMenuItem openItem = new JMenuItem(R("PEOpenMenuItem")); setComponentMnemonic(openItem, R("PEOpenMenuItemMnemonic")); openItem.setAccelerator(KeyStroke.getKeyStroke(openItem.getMnemonic(), ActionEvent.CTRL_MASK)); openItem.addActionListener(editor.openButtonAction); fileMenu.add(openItem); final JMenuItem saveItem = new JMenuItem(R("PESaveMenuItem")); setComponentMnemonic(saveItem, R("PESaveMenuItemMnemonic")); saveItem.setAccelerator(KeyStroke.getKeyStroke(saveItem.getMnemonic(), ActionEvent.CTRL_MASK)); saveItem.addActionListener(editor.okButtonAction); fileMenu.add(saveItem); final JMenuItem saveAsItem = new JMenuItem(R("PESaveAsMenuItem")); setComponentMnemonic(saveAsItem, R("PESaveAsMenuItemMnemonic")); saveAsItem.setAccelerator(KeyStroke.getKeyStroke(saveAsItem.getMnemonic(), ActionEvent.CTRL_MASK)); saveAsItem.addActionListener(editor.saveAsButtonAction); fileMenu.add(saveAsItem); final JMenuItem exitItem = new JMenuItem(R("PEExitMenuItem")); setComponentMnemonic(exitItem, R("PEExitMenuItemMnemonic")); exitItem.setAccelerator(KeyStroke.getKeyStroke(exitItem.getMnemonic(), ActionEvent.CTRL_MASK)); exitItem.addActionListener(editor.closeButtonAction); exitItem.addActionListener(new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { window.dispose(); } }); fileMenu.add(exitItem); menuBar.add(fileMenu); final JMenu viewMenu = new JMenu(R("PEViewMenu")); setComponentMnemonic(viewMenu, R("PEViewMenuMnemonic")); final JMenuItem customPermissionsItem = new JMenuItem(R("PECustomPermissionsItem")); setComponentMnemonic(customPermissionsItem, R("PECustomPermissionsItemMnemonic")); customPermissionsItem.setAccelerator(KeyStroke.getKeyStroke(customPermissionsItem.getMnemonic(), ActionEvent.ALT_MASK)); customPermissionsItem.addActionListener(editor.viewCustomButtonAction); viewMenu.add(customPermissionsItem); menuBar.add(viewMenu); 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 (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(MouseEvent e) { if (e.getButton() == MouseEvent.BUTTON3) { groupPanel.setVisible(!groupPanel.isVisible()); PolicyEditor.this.validate(); Container c = PolicyEditor.this.getParent(); //find the window and repack it while (!(c instanceof Window)) { if (c == null) { return; } c = c.getParent(); } Window w = (Window) c; w.pack(); } } }); groupCh.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { String codebase = getSelectedCodebase(); if (codebase == null) { return; } List backup = new LinkedList(); for (final ActionListener l : groupCh.getActionListeners()) { backup.add(l); groupCh.removeActionListener(l); } final Map map = codebasePermissionsMap.get(codebase); for (PolicyEditorPermissions p : groupCh.getGroup().getPermissions()) { map.put(p, groupCh.isSelected()); } changesMade = true; updateCheckboxes(codebase); for (ActionListener al : backup) { groupCh.addActionListener(al); } } }); add(groupCh, checkboxConstraints); //place panel with mebers below the title checkboxConstraints.gridy++; checkboxConstraints.gridx = 2; //spread group's panel over two columns checkboxConstraints.gridwidth = 2; checkboxConstraints.fill = checkboxConstraints.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 (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(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); scrollPane.setVerticalScrollBarPolicy(JScrollPane.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; setComponentMnemonic(addCodebaseButton, R("PEAddCodebaseMnemonic")); add(addCodebaseButton, addCodebaseButtonConstraints); final GridBagConstraints removeCodebaseButtonConstraints = new GridBagConstraints(); removeCodebaseButtonConstraints.fill = GridBagConstraints.HORIZONTAL; removeCodebaseButtonConstraints.gridx = addCodebaseButtonConstraints.gridx + 1; removeCodebaseButtonConstraints.gridy = addCodebaseButtonConstraints.gridy; setComponentMnemonic(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; setComponentMnemonic(okButton, R("PEOkButtonMnemonic")); add(okButton, okButtonConstraints); final GridBagConstraints cancelButtonConstraints = new GridBagConstraints(); cancelButtonConstraints.fill = GridBagConstraints.HORIZONTAL; cancelButtonConstraints.gridx = okButtonConstraints.gridx + 1; cancelButtonConstraints.gridy = okButtonConstraints.gridy; setComponentMnemonic(closeButton, R("PECancelButtonMnemonic")); add(closeButton, cancelButtonConstraints); setMinimumSize(getPreferredSize()); } /** * 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 */ void updateCustomPermissions(final String codebase, final Collection permissions) { changesMade = true; customPermissionsMap.get(codebase).clear(); customPermissionsMap.get(codebase).addAll(permissions); } private void resetCodebases() { listModel.clear(); codebasePermissionsMap.clear(); customPermissionsMap.clear(); initializeMapForCodebase(""); listModel.addElement(R("PEGlobalSettings")); list.setSelectedValue(R("PEGlobalSettings"), true); updateCheckboxes(""); } /** * 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. */ private void openAndParsePolicyFile() { new Thread() { @Override public void run() { resetCodebases(); if (!file.exists()) { try { file.createNewFile(); } catch (final IOException e) { OutputController.getLogger().log(e); // If this fails we'll end up handling it a few lines down anyway. } } OpenFileResult ofr = FileUtils.testFilePermissions(file); if (ofr == OpenFileResult.FAILURE || ofr == OpenFileResult.NOT_FILE) { FileUtils.showCouldNotOpenFilepathDialog(weakThis.get(), file.getPath()); return; } if (ofr == OpenFileResult.CANT_WRITE) { FileUtils.showReadOnlyDialog(weakThis.get()); } final String contents; try { fileWatcher = new MD5SumWatcher(file); fileWatcher.update(); // 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. contents = FileUtils.loadFileAsString(file); } catch (final IOException e) { OutputController.getLogger().log(e); OutputController.getLogger().log(OutputController.Level.ERROR_ALL, R("RCantOpenFile", file.getPath())); FileUtils.showCouldNotOpenDialog(weakThis.get(), R("PECouldNotOpen")); return; } codebasePermissionsMap.clear(); customPermissionsMap.clear(); // Split on newlines, both \r\n and \n style, for platform-independence final String[] lines = contents.split("\\r?\\n+"); String codebase = ""; final FileLock fileLock; try { fileLock = FileUtils.getFileLock(file.getAbsolutePath(), false, true); } catch (final FileNotFoundException e) { OutputController.getLogger().log(e); FileUtils.showCouldNotOpenDialog(weakThis.get(), R("PECouldNotOpen")); return; } 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); initializeMapForCodebase(codebase); listModel.addElement(codebase); openBlock = true; } // 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) { codebasePermissionsMap.get(codebase).put(perm, true); updateCheckboxes(codebase); } else { final CustomPermission cPerm = CustomPermission.fromString(line.trim()); if (cPerm != null) { customPermissionsMap.get(codebase).add(cPerm); } } } list.setSelectedValue(R("PEGlobalSettings"), true); updateCheckboxes(""); try { fileLock.release(); } catch (final IOException e) { OutputController.getLogger().log(e); } } }.run(); // #run() to make IO synchronous right now. #start() can be used to make it async instead. // http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2014-March/026886.html // TODO: use SwingWorker and give some visual indication that IO is occurring } /** * Ensure that the model contains a specified mapping. No action is taken * if there already is a map with this key * @param codebase for which a permissions mapping is required * @return true iff there was already an entry for this codebase */ private boolean initializeMapForCodebase(final String codebase) { if (codebasePermissionsMap.containsKey(codebase) || customPermissionsMap.containsKey(codebase)) { return true; } if (codebasePermissionsMap.get(codebase) == null) { final Map map = new HashMap(); for (final PolicyEditorPermissions perm : PolicyEditorPermissions.values()) { map.put(perm, false); } codebasePermissionsMap.put(codebase, map); } if (customPermissionsMap.get(codebase) == null) { final Set set = new HashSet(); customPermissionsMap.put(codebase, set); } return false; } /** * Save the policy model into the file pointed to by the filePath field. */ private void savePolicyFile() { if (!changesMade) { return; } new Thread() { @Override public void run() { try { final int response = updateMd5WithDialog(); switch (response) { case JOptionPane.YES_OPTION: openAndParsePolicyFile(); return; case JOptionPane.NO_OPTION: break; case JOptionPane.CANCEL_OPTION: return; default: break; } } catch (final FileNotFoundException e) { // File on disk has been somehow removed since we first checked. Attempt to save to it // anyway then. If we can't, then the failure simply occurs later in this method OutputController.getLogger().log(e); } catch (final IOException e) { OutputController.getLogger().log(e); showCouldNotSaveDialog(); return; } final StringBuilder sb = new StringBuilder(); sb.append(AUTOGENERATED_NOTICE); sb.append("\n/* Generated by PolicyEditor at ").append(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss") .format(Calendar.getInstance().getTime())).append(" */").append(System.getProperty("line.separator")); final Set enabledPermissions = new HashSet(); FileLock fileLock = null; try { fileLock = FileUtils.getFileLock(file.getAbsolutePath(), false, true); for (final String codebase : codebasePermissionsMap.keySet()) { enabledPermissions.clear(); 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); } } } try { FileUtils.saveFile(sb.toString(), file); if (fileWatcher == null) { fileWatcher = new MD5SumWatcher(file); } fileWatcher.update(); changesMade = false; showChangesSavedDialog(); } catch (final IOException e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, R("RCantWriteFile", file.getPath())); showCouldNotSaveDialog(); } } }.run(); // #run() to make IO synchronous right now. #start() can be used to make it async instead. // http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2014-March/026886.html // TODO: use SwingWorker and give some visual indication that IO is occurring } /** * Show a dialog informing the user that their changes have been saved. */ private void showChangesSavedDialog() { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { JOptionPane.showMessageDialog(weakThis.get(), R("PEChangesSaved")); } }); } /** * Show a dialog informing the user that their changes could not be saved. */ private void showCouldNotSaveDialog() { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { JOptionPane.showMessageDialog(weakThis.get(), R("PECouldNotSave"), R("Error"), JOptionPane.ERROR_MESSAGE); } }); } /** * Detect if the file's MD5 has changed. If so, track its new sum, and prompt the user on how to proceed * @return the user's choice (Yes/No/Cancel - see JOptionPane constants). "No" if the file hasn't changed. * @throws FileNotFoundException if the watched file does not exist * @throws IOException if the file cannot be read */ public int updateMd5WithDialog() throws FileNotFoundException, IOException { if (fileWatcher == null) { if (file != null) { fileWatcher = new MD5SumWatcher(file); } return JOptionPane.NO_OPTION; } final boolean changed = fileWatcher.update(); if (changed) { return JOptionPane.showConfirmDialog(weakThis.get(), R("PEFileModifiedDetail", file.getCanonicalPath()), R("PEFileModified"), JOptionPane.YES_NO_CANCEL_OPTION); } return JOptionPane.NO_OPTION; } /** * 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 Map argsMap = argsToMap(args); if (argsMap.containsKey(HELP_FLAG)) { System.out.println(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() { String filepath = argsMap.get(FILE_FLAG); if (filepath == null && args.length == 1) { // maybe the user just forgot the -file flag, so try to open anyway filepath = args[0]; } final PolicyEditorWindow frame = getPolicyEditorFrame(filepath); frame.asWindow().setVisible(true); final String codebaseStr = argsMap.get(CODEBASE_FLAG); if (codebaseStr != null) { final String[] urls = codebaseStr.split(" "); frame.getPolicyEditor().addNewCodebases(urls); } } }); } /** * 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); } /** * Create a Map out of argv * @param args command line flags and parameters given to the program * @return a Map representation of the command line arguments */ static Map argsToMap(final String[] args) { final List argsList = Arrays. asList(args); final Map map = new HashMap(); if (argsList.contains(HELP_FLAG)) { map.put(HELP_FLAG, null); } if (argsList.contains(FILE_FLAG)) { map.put(FILE_FLAG, argsList.get(argsList.indexOf(FILE_FLAG) + 1)); } if (argsList.contains(CODEBASE_FLAG)) { final int flagIndex = argsList.indexOf(CODEBASE_FLAG); final StringBuilder sb = new StringBuilder(); for (int i = flagIndex + 1; i < argsList.size(); ++i) { final String str = argsList.get(i); if (str.equals(HELP_FLAG) || str.equals(CODEBASE_FLAG) || str.equals(FILE_FLAG)) { break; } sb.append(str); sb.append(" "); } map.put(CODEBASE_FLAG, sb.toString().trim()); } return map; } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/policyeditor/PaxHeaders.24993/PermissionType.ja0000644000000000000000000000013212574544466030376 xustar0030 mtime=1441974582.603017222 30 atime=1441974656.395866664 30 ctime=1441974670.087024265 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/policyeditor/PermissionType.java0000664000076400007640000000532612574544466032014 0ustar00jvanekjvanek00000000000000/*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.5.3/netx/net/sourceforge/jnlp/security/policyeditor/PaxHeaders.24993/PermissionTarget.0000644000000000000000000000013212574544466030370 xustar0030 mtime=1441974582.603017222 30 atime=1441974656.395866664 30 ctime=1441974670.087024265 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/policyeditor/PermissionTarget.java0000664000076400007640000000554512574544466032324 0ustar00jvanekjvanek00000000000000/*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.5.3/netx/net/sourceforge/jnlp/security/policyeditor/PaxHeaders.24993/PermissionActions0000644000000000000000000000013212574544466030464 xustar0030 mtime=1441974582.602017211 30 atime=1441974656.395866664 30 ctime=1441974670.087024265 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/policyeditor/PermissionActions.java0000664000076400007640000000650312574544466032471 0ustar00jvanekjvanek00000000000000/*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.5.3/netx/net/sourceforge/jnlp/security/policyeditor/PaxHeaders.24993/CustomPolicyViewe0000644000000000000000000000013212574544466030445 xustar0030 mtime=1441974582.602017211 30 atime=1441974656.395866664 30 ctime=1441974670.087024265 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/policyeditor/CustomPolicyViewer.java0000664000076400007640000002141012574544466032626 0ustar00jvanekjvanek00000000000000/*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.lang.ref.WeakReference; import java.util.Collection; 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.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 WeakReference weakThis = new WeakReference(this); /** * @param parent the parent PolicyEditor which created this CustomPolicyViewer * @param codebase the codebase for which these custom permissions are enabled * @param permissions a collection of CustomPermissions which were found in the policy file */ public CustomPolicyViewer(final PolicyEditor parent, final String codebase, final Collection permissions) { super(); setLayout(new GridBagLayout()); setTitle(R("PECPTitle")); customPermissions.addAll(permissions); 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") + "]"; final String string = JOptionPane.showInputDialog(weakThis.get(), R("PECPPrompt"), prefill); if (string == null || string.isEmpty()) { return; } 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); if (perm != null) { customPermissions.add(perm); listModel.addElement(perm); parent.updateCustomPermissions(codebase, customPermissions); } } }; addButton.setText(R("PECPAddButton")); addButton.addActionListener(addButtonAction); removeButtonAction = new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { if (list.getSelectedValue() == null) { return; } customPermissions.remove(list.getSelectedValue()); listModel.removeElement(list.getSelectedValue()); parent.updateCustomPermissions(codebase, customPermissions); } }; removeButton.setText(R("PECPRemoveButton")); removeButton.addActionListener(removeButtonAction); closeButtonAction = new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { weakThis.clear(); parent.customPolicyViewerClosing(); dispose(); } }; 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(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); list.setSelectedIndex(0); setupLayout(); setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); addWindowListener(new WindowAdapter() { @Override public void windowClosing(final WindowEvent e) { weakThis.clear(); parent.customPolicyViewerClosing(); dispose(); } }); } 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()); } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/policyeditor/PaxHeaders.24993/CustomPermission.0000644000000000000000000000013212574544466030414 xustar0030 mtime=1441974582.602017211 30 atime=1441974656.394866652 30 ctime=1441974670.087024265 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/policyeditor/CustomPermission.java0000664000076400007640000001206612574544466032344 0ustar00jvanekjvanek00000000000000/*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; /** * @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; } /** * 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 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.5.3/netx/net/sourceforge/jnlp/security/PaxHeaders.24993/dialogs0000644000000000000000000000013212574544466023727 xustar0030 mtime=1441974582.601017199 30 atime=1441974670.156025059 30 ctime=1441974670.087024265 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/dialogs/0000775000076400007640000000000012574544466025065 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/dialogs/PaxHeaders.24993/apptrustwarningpanel0000644000000000000000000000013212574544466030217 xustar0030 mtime=1441974582.602017211 30 atime=1441974670.156025059 30 ctime=1441974670.087024265 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/0000775000076400007640000000000012574544466031355 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/PaxHeaders.24993/U0000644000000000000000000000033212574544466030425 xustar00128 path=icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/UnsignedAppletTrustWarningPanel.java 30 mtime=1441974582.602017211 30 atime=1441974656.394866652 30 ctime=1441974670.087024265 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/UnsignedAppletTrus0000664000076400007640000000767412574544466035116 0ustar00jvanekjvanek00000000000000/* 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.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.appletextendedsecurity.ExecuteAppletAction; import net.sourceforge.jnlp.security.appletextendedsecurity.UnsignedAppletTrustConfirmation; public class UnsignedAppletTrustWarningPanel extends AppTrustWarningPanel { public UnsignedAppletTrustWarningPanel(final JNLPFile file, final ActionChoiceListener listener) { super(file, listener); addComponents(); } @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()); ExecuteAppletAction rememberedAction = UnsignedAppletTrustConfirmation.getStoredAction(file); if (rememberedAction == ExecuteAppletAction.YES) { text += "
" + R("SUnsignedAllowedBefore"); } else if (rememberedAction == ExecuteAppletAction.NO) { text += "
" + R("SUnsignedRejectedBefore"); } return htmlWrap(text); } @Override protected String getQuestionPanelText() { return htmlWrap(R(getQuestionPanelTextKey())); } public static void main(String[] args) throws Exception { UnsignedAppletTrustWarningPanel w = new UnsignedAppletTrustWarningPanel(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.5.3/netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/PaxHeaders.24993/U0000644000000000000000000000033312574544466030426 xustar00129 path=icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/UnsignedAppletTrustWarningDialog.java 30 mtime=1441974582.601017199 30 atime=1441974656.394866652 30 ctime=1441974670.087024265 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/UnsignedAppletTrus0000664000076400007640000000520412574544466035101 0ustar00jvanekjvanek00000000000000/* 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.security.dialogs.apptrustwarningpanel.AppTrustWarningPanel.ActionChoiceListener; import net.sourceforge.jnlp.security.dialogs.apptrustwarningpanel.AppTrustWarningPanel.AppSigningWarningAction; import net.sourceforge.jnlp.security.SecurityDialog; import net.sourceforge.jnlp.security.dialogs.SecurityDialogPanel; /** * A panel that confirms that the user is OK with unsigned code running. * */ public class UnsignedAppletTrustWarningDialog extends SecurityDialogPanel { public UnsignedAppletTrustWarningDialog(SecurityDialog x, JNLPFile file) { super(x); add(new UnsignedAppletTrustWarningPanel(file, new ActionChoiceListener() { @Override public void actionChosen(AppSigningWarningAction action) { parent.setValue(action); parent.dispose(); } }) ); } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/PaxHeaders.24993/P0000644000000000000000000000033612574544466030424 xustar00132 path=icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/PartiallySignedAppTrustWarningPanel.java 30 mtime=1441974582.601017199 30 atime=1441974656.394866652 30 ctime=1441974670.087024265 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/PartiallySignedApp0000664000076400007640000001436212574544466035042 0ustar00jvanekjvanek00000000000000/* 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 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.ExecuteAppletAction; 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 = 200; 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(); } @Override protected String getAppletTitle() { String title; try { if (file instanceof PluginBridge) { title = file.getTitle(); } else { title = file.getInformation().getTitle(); } } catch (Exception e) { title = ""; } return R("SAppletTitle", title); } 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.getCodeBase().getHost(); } else { from = file.getInformation().getHomepage().toString(); } } 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(); ExecuteAppletAction rememberedAction = UnsignedAppletTrustConfirmation.getStoredAction(file); if (rememberedAction == ExecuteAppletAction.YES) { text += "
" + R("SUnsignedAllowedBefore"); } else if (rememberedAction == ExecuteAppletAction.NO) { text += "
" + R("SUnsignedRejectedBefore"); } return htmlWrap(text); } @Override protected String getQuestionPanelText() { return htmlWrap(R(getQuestionPanelTextKey())); } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/PaxHeaders.24993/A0000644000000000000000000000031712574544466030404 xustar00117 path=icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/AppTrustWarningPanel.java 30 mtime=1441974582.601017199 30 atime=1441974656.393866641 30 ctime=1441974670.087024265 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/AppTrustWarningPan0000664000076400007640000003057612574544466035062 0ustar00jvanekjvanek00000000000000/* 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.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.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.JLabel; import javax.swing.JPanel; import javax.swing.JRadioButton; import javax.swing.SwingConstants; import net.sourceforge.jnlp.JNLPFile; import net.sourceforge.jnlp.security.appletextendedsecurity.ExecuteAppletAction; import net.sourceforge.jnlp.security.appletextendedsecurity.ExtendedAppletSecurityHelp; import net.sourceforge.jnlp.util.ScreenFinder; /* * 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() { return R("SAppletTitle", file.getTitle()); } private void setupInfoPanel() { String titleText = getAppletTitle(); JLabel titleLabel = new JLabel(titleText); titleLabel.setFont(new Font(titleLabel.getFont().getName(), Font.BOLD, 18)); String infoLabelText = getInfoPanelText(); JLabel infoLabel = new JLabel(infoLabelText); int panelHeight = titleLabel.getHeight() + INFO_PANEL_HEIGHT + INFO_PANEL_HINT_HEIGHT; JPanel infoPanel = new JPanel(new BorderLayout()); 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.5.3/netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/PaxHeaders.24993/A0000644000000000000000000000032012574544466030376 xustar00118 path=icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/AppTrustWarningDialog.java 30 mtime=1441974582.601017199 30 atime=1441974656.393866641 30 ctime=1441974670.087024265 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/dialogs/apptrustwarningpanel/AppTrustWarningDia0000664000076400007640000000656712574544466035044 0ustar00jvanekjvanek00000000000000/* 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 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(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; } private ActionChoiceListener getActionChoiceListener() { return new ActionChoiceListener() { @Override public void actionChosen(final AppSigningWarningAction action) { parent.setValue(action); parent.dispose(); } }; } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/dialogs/PaxHeaders.24993/TemporaryPermissionsBu0000644000000000000000000000013212574544466030434 xustar0030 mtime=1441974582.601017199 30 atime=1441974656.393866641 30 ctime=1441974670.087024265 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/dialogs/TemporaryPermissionsButton.java0000664000076400007640000002244012574544466033344 0ustar00jvanekjvanek00000000000000/* 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.JButton; import javax.swing.JMenuItem; import javax.swing.JPopupMenu; 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.policyeditor.PolicyEditor; import net.sourceforge.jnlp.security.policyeditor.PolicyEditor.PolicyEditorWindow; 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(final 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 JMenuItem noFileAccess = new JMenuItem(R("STempPermNoFile")); noFileAccess.addActionListener(new TemporaryPermissionsListener(TemporaryPermissions.noFileAccess())); policyMenu.add(noFileAccess); final JMenuItem noNetworkAccess = new JMenuItem(R("STempPermNoNetwork")); noNetworkAccess.addActionListener(new TemporaryPermissionsListener(TemporaryPermissions.noNetworkAccess())); policyMenu.add(noNetworkAccess); final JMenuItem noFileOrNetwork = new JMenuItem(R("STempNoFileOrNetwork")); noFileOrNetwork.addActionListener(new TemporaryPermissionsListener(TemporaryPermissions.noFileOrNetworkAccess())); policyMenu.add(noFileOrNetwork); policyMenu.addSeparator(); final JMenuItem allFileAccessOnly = new JMenuItem(R("STempAllFileAndPropertyAccess")); allFileAccessOnly.addActionListener(new TemporaryPermissionsListener(TemporaryPermissions.allFileAccessAndProperties())); policyMenu.add(allFileAccessOnly); final JMenuItem readLocalFilesAndProperties = new JMenuItem(R("STempReadLocalFilesAndProperties")); readLocalFilesAndProperties.addActionListener(new TemporaryPermissionsListener(TemporaryPermissions.readLocalFilesAndProperties())); policyMenu.add(readLocalFilesAndProperties); final JMenuItem reflectionOnly = new JMenuItem(R("STempReflectionOnly")); reflectionOnly.addActionListener(new TemporaryPermissionsListener(TemporaryPermissions.reflectionOnly())); policyMenu.add(reflectionOnly); policyMenu.addSeparator(); final JMenuItem allMedia = new JMenuItem(R("STempAllMedia")); allMedia.addActionListener(new TemporaryPermissionsListener(TemporaryPermissions.allMedia())); policyMenu.add(allMedia); final JMenuItem soundOnly = new JMenuItem(R("STempSoundOnly")); soundOnly.addActionListener(new TemporaryPermissionsListener(TemporaryPermissions.audioOnly())); policyMenu.add(soundOnly); final JMenuItem clipboardOnly = new JMenuItem(R("STempClipboardOnly")); clipboardOnly.addActionListener(new TemporaryPermissionsListener(TemporaryPermissions.clipboardOnly())); policyMenu.add(clipboardOnly); final JMenuItem printOnly = new JMenuItem(R("STempPrintOnly")); printOnly.addActionListener(new TemporaryPermissionsListener(TemporaryPermissions.printOnly())); policyMenu.add(printOnly); 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) { temporaryPermissions.clear(); temporaryPermissions.addAll(permissions); menu.setVisible(false); if (linkedButton != null) { linkedButton.doClick(); } } } private class PolicyEditorLaunchListener implements ActionListener { @Override public void actionPerformed(final ActionEvent e) { final String rawFilepath = JNLPRuntime.getConfiguration().getProperty(DeploymentConfiguration.KEY_USER_SECURITY_POLICY); 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.getCodeBase().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.5.3/netx/net/sourceforge/jnlp/security/dialogs/PaxHeaders.24993/TemporaryPermissions.j0000644000000000000000000000013212574544466030375 xustar0030 mtime=1441974582.600017188 30 atime=1441974656.393866641 30 ctime=1441974670.087024265 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/dialogs/TemporaryPermissions.java0000664000076400007640000002440312574544466032151 0ustar00jvanekjvanek00000000000000/* 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.awt.AWTPermission; import java.io.FilePermission; import java.lang.reflect.ReflectPermission; import java.net.SocketPermission; import java.security.Permission; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.HashSet; import java.util.PropertyPermission; import javax.sound.sampled.AudioPermission; import static net.sourceforge.jnlp.security.policyeditor.PolicyEditorPermissions.*; public class TemporaryPermissions { // We can't use the PolicyEditorPermissions versions of these, because they rely on System Property expansion, which is perfomed // by the policy parser, but not by the Permissions constructors. private static final String USER_HOME = System.getProperty("user.home"); private static final String TMPDIR = System.getProperty("java.io.tmpdir"); public static final FilePermission READ_LOCAL_FILES_PERMISSION = new FilePermission(USER_HOME, READ_LOCAL_FILES.getActions().rawString()); public static final FilePermission WRITE_LOCAL_FILES_PERMISSION = new FilePermission(USER_HOME, WRITE_LOCAL_FILES.getActions().rawString()); public static final FilePermission DELETE_LOCAL_FILES_PERMISSION = new FilePermission(USER_HOME, DELETE_LOCAL_FILES.getActions().rawString()); public static final FilePermission READ_TMP_FILES_PERMISSION = new FilePermission(TMPDIR, READ_TMP_FILES.getActions().rawString()); public static final FilePermission WRITE_TMP_FILES_PERMISSION = new FilePermission(TMPDIR, WRITE_TMP_FILES.getActions().rawString()); public static final FilePermission DELETE_TMP_FILES_PERMISSION = new FilePermission(TMPDIR, DELETE_TMP_FILES.getActions().rawString()); public static final FilePermission READ_SYSTEM_FILES_PERMISSION = new FilePermission(READ_SYSTEM_FILES.getTarget().target, READ_SYSTEM_FILES.getActions() .rawString()); public static final FilePermission WRITE_SYSTEM_FILES_PERMISSION = new FilePermission(WRITE_SYSTEM_FILES.getTarget().target, WRITE_SYSTEM_FILES .getActions().rawString()); public static final PropertyPermission READ_PROPERTIES_PERMISSION = new PropertyPermission(READ_PROPERTIES.getTarget().target, READ_PROPERTIES.getActions() .rawString()); public static final PropertyPermission WRITE_PROPERTIES_PERMISSION = new PropertyPermission(WRITE_PROPERTIES.getTarget().target, WRITE_PROPERTIES .getActions().rawString()); public static final FilePermission EXEC_PERMISSION = new FilePermission(EXEC_COMMANDS.getTarget().target, EXEC_COMMANDS.getActions().rawString()); public static final RuntimePermission GETENV_PERMISSION = new RuntimePermission(GET_ENV.getTarget().target); public static final SocketPermission NETWORK_PERMISSION = new SocketPermission(NETWORK.getTarget().target, NETWORK.getActions().rawString()); public static final ReflectPermission REFLECTION_PERMISSION = new ReflectPermission(JAVA_REFLECTION.getTarget().target); public static final RuntimePermission CLASSLOADER_PERMISSION = new RuntimePermission(GET_CLASSLOADER.getTarget().target); public static final RuntimePermission ACCESS_CLASS_IN_PACKAGE_PERMISSION = new RuntimePermission(ACCESS_CLASS_IN_PACKAGE.getTarget().target); public static final RuntimePermission ACCESS_DECLARED_MEMBERS_PERMISSION = new RuntimePermission(ACCESS_DECLARED_MEMBERS.getTarget().target); public static final RuntimePermission ACCESS_THREADS_PERMISSION = new RuntimePermission(ACCESS_THREADS.getTarget().target); public static final RuntimePermission ACCESS_THREADGROUPS_PERMISSION = new RuntimePermission(ACCESS_THREAD_GROUPS.getTarget().target); public static final AWTPermission AWT_PERMISSION = new AWTPermission(ALL_AWT.getTarget().target); public static final AudioPermission PLAY_AUDIO_PERMISSION = new AudioPermission(PLAY_AUDIO.getTarget().target); public static final AudioPermission RECORD_AUDIO_PERMISSION = new AudioPermission(RECORD_AUDIO.getTarget().target); public static final AWTPermission CLIPBOARD_PERMISSION = new AWTPermission(CLIPBOARD.getTarget().target); public static final RuntimePermission PRINT_PERMISSION = new RuntimePermission(PRINT.getTarget().target); public static final Collection ALL_PERMISSIONS, FILE_PERMISSIONS, PROPERTY_PERMISSIONS, NETWORK_PERMISSIONS, EXEC_PERMISSIONS, REFLECTION_PERMISSIONS, MEDIA_PERMISSIONS; static { final Collection all = new HashSet(), file = new HashSet(), property = new HashSet(), network = new HashSet(), exec = new HashSet(), reflection = new HashSet(), media = new HashSet(); file.add(READ_LOCAL_FILES_PERMISSION); file.add(WRITE_LOCAL_FILES_PERMISSION); file.add(DELETE_LOCAL_FILES_PERMISSION); file.add(READ_TMP_FILES_PERMISSION); file.add(WRITE_TMP_FILES_PERMISSION); file.add(DELETE_TMP_FILES_PERMISSION); file.add(READ_SYSTEM_FILES_PERMISSION); file.add(WRITE_SYSTEM_FILES_PERMISSION); FILE_PERMISSIONS = Collections.unmodifiableCollection(file); property.add(READ_PROPERTIES_PERMISSION); property.add(WRITE_PROPERTIES_PERMISSION); PROPERTY_PERMISSIONS = Collections.unmodifiableCollection(property); exec.add(EXEC_PERMISSION); exec.add(GETENV_PERMISSION); EXEC_PERMISSIONS = Collections.unmodifiableCollection(exec); network.add(NETWORK_PERMISSION); NETWORK_PERMISSIONS = Collections.unmodifiableCollection(network); reflection.add(REFLECTION_PERMISSION); reflection.add(CLASSLOADER_PERMISSION); reflection.add(ACCESS_CLASS_IN_PACKAGE_PERMISSION); reflection.add(ACCESS_DECLARED_MEMBERS_PERMISSION); reflection.add(ACCESS_THREADS_PERMISSION); reflection.add(ACCESS_THREADGROUPS_PERMISSION); REFLECTION_PERMISSIONS = Collections.unmodifiableCollection(reflection); media.add(AWT_PERMISSION); media.add(PLAY_AUDIO_PERMISSION); media.add(RECORD_AUDIO_PERMISSION); media.add(CLIPBOARD_PERMISSION); media.add(PRINT_PERMISSION); MEDIA_PERMISSIONS = Collections.unmodifiableCollection(media); all.addAll(file); all.addAll(property); all.addAll(exec); all.addAll(network); all.addAll(reflection); all.addAll(media); ALL_PERMISSIONS = Collections.unmodifiableCollection(all); } private static final Collection allMinus(final Collection permissions) { return subtract(ALL_PERMISSIONS, permissions); } private static Collection sum(final Permission... permissions) { final Collection result = new HashSet(Arrays.asList(permissions)); return Collections.unmodifiableCollection(result); } private static Collection sum(final Collection a, final Collection b) { final Collection result = new HashSet(); result.addAll(a); result.addAll(b); return Collections.unmodifiableCollection(result); } private static final Collection subtract(final Collection from, final Collection remove) { final Collection result = new HashSet(from); result.removeAll(remove); return Collections.unmodifiableCollection(result); } public static Collection noFileAccess() { return allMinus(FILE_PERMISSIONS); } public static Collection noNetworkAccess() { return allMinus(Arrays.asList(new Permission[] { NETWORK_PERMISSION })); } public static Collection noFileOrNetworkAccess() { return subtract(allMinus(FILE_PERMISSIONS), NETWORK_PERMISSIONS); } public static Collection allFileAccessAndProperties() { return sum(FILE_PERMISSIONS, PROPERTY_PERMISSIONS); } public static Collection readLocalFilesAndProperties() { return sum(READ_LOCAL_FILES_PERMISSION, READ_PROPERTIES_PERMISSION); } public static Collection reflectionOnly() { return REFLECTION_PERMISSIONS; } public static Collection allMedia() { return MEDIA_PERMISSIONS; } public static Collection audioOnly() { return sum(PLAY_AUDIO_PERMISSION, RECORD_AUDIO_PERMISSION); } public static Collection clipboardOnly() { return sum(CLIPBOARD_PERMISSION); } public static Collection printOnly() { return sum(PRINT_PERMISSION); } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/dialogs/PaxHeaders.24993/SingleCertInfoPane.jav0000644000000000000000000000013212574544466030165 xustar0030 mtime=1441974582.600017188 30 atime=1441974656.393866641 30 ctime=1441974670.087024265 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/dialogs/SingleCertInfoPane.java0000664000076400007640000000632112574544466031411 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/security/dialogs/PaxHeaders.24993/SecurityDialogPanel.ja0000644000000000000000000000013212574544466030227 xustar0030 mtime=1441974582.600017188 30 atime=1441974656.392866629 30 ctime=1441974670.087024265 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/dialogs/SecurityDialogPanel.java0000664000076400007640000001000212574544466031630 0ustar00jvanekjvanek00000000000000/* 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. */ protected 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.5.3/netx/net/sourceforge/jnlp/security/dialogs/PaxHeaders.24993/PasswordAuthentication0000644000000000000000000000013212574544466030431 xustar0030 mtime=1441974582.600017188 30 atime=1441974656.392866629 30 ctime=1441974670.087024265 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/dialogs/PasswordAuthenticationPane.java0000664000076400007640000001375312574544466033247 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/security/dialogs/PaxHeaders.24993/MoreInfoPane.java0000644000000000000000000000013212574544466027171 xustar0030 mtime=1441974582.599017176 30 atime=1441974656.392866629 30 ctime=1441974670.087024265 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/dialogs/MoreInfoPane.java0000664000076400007640000001203112574544466030247 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/security/dialogs/PaxHeaders.24993/MissingPermissionsAttr0000644000000000000000000000013212574544466030427 xustar0030 mtime=1441974582.599017176 30 atime=1441974656.392866629 30 ctime=1441974670.087024265 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/dialogs/MissingPermissionsAttributePanel.java0000664000076400007640000001360312574544466034444 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/security/dialogs/PaxHeaders.24993/MissingALACAttributePa0000644000000000000000000000013212574544466030126 xustar0030 mtime=1441974582.599017176 30 atime=1441974656.392866629 30 ctime=1441974670.087024265 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/dialogs/MissingALACAttributePanel.java0000664000076400007640000001446112574544466032634 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/security/dialogs/PaxHeaders.24993/MatchingALACAttributeP0000644000000000000000000000013212574544466030106 xustar0030 mtime=1441974582.599017176 30 atime=1441974656.391866618 30 ctime=1441974670.086024253 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/dialogs/MatchingALACAttributePanel.java0000664000076400007640000001504712574544466032756 0ustar00jvanekjvanek00000000000000/* 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 MatchingALACAttributePanel extends SecurityDialogPanel { public MatchingALACAttributePanel(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/question.png"); ImageIcon icon; Image img = ImageIO.read(imgUrl); icon = new ImageIcon(img); String topLabelText = Translator.R("ALACAMatchingMainTitle", title, codebase, remoteUrls); String bottomLabelText = Translator.R("ALACAMatchingInfo"); 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")); int buttonWidth = yes.getMinimumSize().width; int buttonHeight = yes.getMinimumSize().height; Dimension d = new Dimension(buttonWidth, buttonHeight); yes.setPreferredSize(d); no.setPreferredSize(d); 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")); MatchingALACAttributePanel w = new MatchingALACAttributePanel(null, "HelloWorld", "http://nbblah.url", UrlUtils.setOfUrlsToHtmlList(s)); 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.5.3/netx/net/sourceforge/jnlp/security/dialogs/PaxHeaders.24993/CertsInfoPane.java0000644000000000000000000000013212574544466027347 xustar0030 mtime=1441974582.599017176 30 atime=1441974656.391866618 30 ctime=1441974670.086024253 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/dialogs/CertsInfoPane.java0000664000076400007640000003261612574544466030440 0ustar00jvanekjvanek00000000000000/* 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; import sun.misc.HexDumpEncoder; 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.5.3/netx/net/sourceforge/jnlp/security/dialogs/PaxHeaders.24993/CertWarningPane.java0000644000000000000000000000013212574544466027676 xustar0030 mtime=1441974582.598017164 30 atime=1441974656.391866618 30 ctime=1441974670.086024253 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/dialogs/CertWarningPane.java0000664000076400007640000003437312574544466030771 0ustar00jvanekjvanek00000000000000/* 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.io.FileOutputStream; import java.io.OutputStream; 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.JPopupMenu; 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.security.policyeditor.PolicyEditor.PolicyEditorWindow; 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 SecurityDelegate securityDelegate; private JPopupMenu policyMenu; 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; private PolicyEditorWindow policyEditor = null; 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 = new File(KeyStores.getKeyStoreLocation(Level.USER, Type.CERTS)); if (!keyStoreFile.isFile()) { FileUtils.createRestrictedFile(keyStoreFile, true); } OutputStream os = new FileOutputStream(keyStoreFile); try { ks.store(os, KeyStores.getPassword()); } finally { os.close(); } 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.5.3/netx/net/sourceforge/jnlp/security/dialogs/PaxHeaders.24993/AppletWarningPane.java0000644000000000000000000000013212574544466030226 xustar0030 mtime=1441974582.598017164 30 atime=1441974656.391866618 30 ctime=1441974670.086024253 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/dialogs/AppletWarningPane.java0000664000076400007640000001102612574544466031307 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/security/dialogs/PaxHeaders.24993/AccessWarningPane.java0000644000000000000000000000013212574544466030202 xustar0030 mtime=1441974582.598017164 30 atime=1441974656.390866606 30 ctime=1441974670.086024253 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/dialogs/AccessWarningPane.java0000664000076400007640000002052512574544466031267 0ustar00jvanekjvanek00000000000000/* 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.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; 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.security.CertVerifier; import net.sourceforge.jnlp.security.SecurityDialog; import net.sourceforge.jnlp.security.SecurityDialogs.AccessType; import net.sourceforge.jnlp.util.FileUtils; /** * 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 { JCheckBox alwaysAllow; Object[] extras; 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)); alwaysAllow = new JCheckBox(R("AlwaysAllowAction")); alwaysAllow.setEnabled(false); JPanel infoPanel = new JPanel(new GridLayout(4, 1)); infoPanel.add(nameLabel); infoPanel.add(publisherLabel); infoPanel.add(fromLabel); infoPanel.add(alwaysAllow); infoPanel.setBorder(BorderFactory.createEmptyBorder(25, 25, 25, 25)); //run and cancel buttons JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); JButton run = new JButton(R("ButAllow")); JButton cancel = new JButton(R("ButCancel")); run.addActionListener(createSetValueListener(parent, 0)); run.addActionListener(new CheckBoxListener()); cancel.addActionListener(createSetValueListener(parent, 1)); initialFocusComponent = cancel; buttonPanel.add(run); 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); } private class CheckBoxListener implements ActionListener { @Override public void actionPerformed(ActionEvent e) { if (alwaysAllow != null && alwaysAllow.isSelected()) { // TODO: somehow tell the ApplicationInstance // to stop asking for permission } } } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/PaxHeaders.24993/appletextendedsecurity0000644000000000000000000000013212574544466027103 xustar0030 mtime=1441974582.597017153 30 atime=1441974670.156025059 30 ctime=1441974670.086024253 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/appletextendedsecurity/0000775000076400007640000000000012574544466030241 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/appletextendedsecurity/PaxHeaders.24993/impl0000644000000000000000000000013212574544466030044 xustar0030 mtime=1441974582.598017164 30 atime=1441974670.156025059 30 ctime=1441974670.086024253 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/appletextendedsecurity/impl/0000775000076400007640000000000012574544466031202 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/appletextendedsecurity/impl/PaxHeaders.24993/Un0000644000000000000000000000033112574544466030427 xustar00127 path=icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/appletextendedsecurity/impl/UnsignedAppletActionStorageImpl.java 30 mtime=1441974582.598017164 30 atime=1441974656.390866606 30 ctime=1441974670.086024253 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/appletextendedsecurity/impl/UnsignedAppletActio0000664000076400007640000003011112574544466035023 0ustar00jvanekjvanek00000000000000/* 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) { List results = getMatchingItems(documentBase, codeBase, archives); if (results == null || results.isEmpty()) { return null; } // Chose the first result, unless we find a 'stronger' result // Actions such as 'always accept' or 'always reject' are 'stronger' than // the hints 'was accepted' or 'was rejected'. for (UnsignedAppletActionEntry candidate : results) { if (candidate.getUnsignedAppletAction() == ExecuteAppletAction.ALWAYS || candidate.getUnsignedAppletAction() == 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) { return getMatchingItem(documentBase, null, null); } @Override public UnsignedAppletActionEntry getMatchingItemByCodeBase(String codeBase) { return getMatchingItem(null, codeBase, null); } @Override public UnsignedAppletActionEntry getMatchingItemByBases(String documentBase, String codeBase) { return getMatchingItem(documentBase, codeBase, null); } 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.5.3/netx/net/sourceforge/jnlp/security/appletextendedsecurity/impl/PaxHeaders.24993/Un0000644000000000000000000000034112574544466030430 xustar00135 path=icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/appletextendedsecurity/impl/UnsignedAppletActionStorageExtendedImpl.java 30 mtime=1441974582.597017153 30 atime=1441974656.390866606 30 ctime=1441974670.086024253 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/appletextendedsecurity/impl/UnsignedAppletActio0000664000076400007640000001472312574544466035036 0ustar00jvanekjvanek00000000000000/* 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.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); if (unsignedAppletActionEntry.getUnsignedAppletAction() == unsignedAppletAction) { items.remove(i); i--; } } writeContents(); } catch (IOException e) { throw new StorageIoException(e); } } }); } private void swap(final int i, final int ii) { doLocked(new Runnable() { public void run() { try { readContents(); UnsignedAppletActionEntry backup = items.get(i); items.set(i, items.get(ii)); items.set(ii, backup); writeContents(); } catch (IOException e) { throw new StorageIoException(e); } } }); } public int moveUp(int selectedRow) { if (selectedRow <= 0) { return selectedRow; } swap(selectedRow, selectedRow - 1); return selectedRow-1; } public int moveDown(int selectedRow) { if (selectedRow >= items.size() - 1) { return selectedRow; } swap(selectedRow, selectedRow + 1); return selectedRow+1; } public void remove(final int item) { doLocked(new Runnable() { public void run() { try { readContents(); items.remove(item); writeContents(); } catch (IOException ex) { throw new StorageIoException(ex); } } }); } public void modify(final UnsignedAppletActionEntry source, final int columnIndex, final Object aValue) { Runnable r = new Runnable() { public void run() { try { if (!items.contains(source)) { throw new StorageIoException("Item to be modified not found in storage"); } if (columnIndex == 0) { source.setUnsignedAppletAction((ExecuteAppletAction) aValue); } if (columnIndex == 1) { source.setTimeStamp((Date) aValue); } if (columnIndex == 2) { source.setDocumentBase(UrlRegEx.exact((String) aValue)); } if (columnIndex == 3) { source.setCodeBase(UrlRegEx.exact((String) aValue)); } if (columnIndex == 4) { source.setArchives(UnsignedAppletActionEntry.createArchivesList((String) aValue)); } writeContents(); } catch (IOException ex) { throw new StorageIoException(ex); } } }; doLocked(r); } @Override public synchronized void writeContentsLocked() throws IOException { super.writeContentsLocked(); } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/appletextendedsecurity/PaxHeaders.24993/UrlRegE0000644000000000000000000000013212574544466030410 xustar0030 mtime=1441974582.597017153 30 atime=1441974656.390866606 30 ctime=1441974670.086024253 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/appletextendedsecurity/UrlRegEx.java0000664000076400007640000001016512574544466032604 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/security/appletextendedsecurity/PaxHeaders.24993/Unsigne0000644000000000000000000000032412574544466030516 xustar00122 path=icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletTrustConfirmation.java 30 mtime=1441974582.597017153 30 atime=1441974656.390866606 30 ctime=1441974670.086024253 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletTrustConfi0000664000076400007640000003310012574544466035124 0ustar00jvanekjvanek00000000000000/* 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.net.MalformedURLException; 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.JNLPRuntime; import net.sourceforge.jnlp.runtime.JNLPClassLoader.SecurityDelegate; 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 * @return the remembered decision */ public static ExecuteAppletAction getStoredAction(JNLPFile file) { UnsignedAppletActionStorage userActionStorage = securitySettings.getUnsignedAppletActionCustomStorage(); UnsignedAppletActionStorage globalActionStorage = securitySettings.getUnsignedAppletActionGlobalStorage(); UnsignedAppletActionEntry globalEntry = getMatchingItem(globalActionStorage, file); UnsignedAppletActionEntry userEntry = getMatchingItem(userActionStorage, file); ExecuteAppletAction globalAction = globalEntry == null ? null : globalEntry.getUnsignedAppletAction(); ExecuteAppletAction userAction = userEntry == null ? null : userEntry.getUnsignedAppletAction(); if (userAction == ExecuteAppletAction.ALWAYS || userAction == ExecuteAppletAction.NEVER) { return userAction; } else if (globalAction == ExecuteAppletAction.ALWAYS || globalAction == ExecuteAppletAction.NEVER) { return globalAction; } else { return userAction; } } private static UnsignedAppletActionEntry getMatchingItem(UnsignedAppletActionStorage actionStorage, JNLPFile file) { return actionStorage.getMatchingItem( UrlUtils.normalizeUrlAndStripParams(file.getSourceLocation(), true /* encode local files */).toString(), UrlUtils.normalizeUrlAndStripParams(file.getCodeBase(), true /* encode local files */).toString(), toRelativePaths(getJars(file), file.getCodeBase().toString())); } /* Extract the archives as relative paths */ static List toRelativePaths(List paths, String rootPath) { List fileNames = new ArrayList(); for (String path : paths) { if (path.startsWith(rootPath)) { fileNames.add(path.substring(rootPath.length())); } else { fileNames.add(path); } } return fileNames; } public static void updateAppletAction(JNLPFile file, ExecuteAppletAction behaviour, boolean rememberForCodeBase) { UnsignedAppletActionStorage userActionStorage = securitySettings.getUnsignedAppletActionCustomStorage(); userActionStorage.lock(); // We should ensure this operation is atomic try { UnsignedAppletActionEntry oldEntry = getMatchingItem(userActionStorage, file); /* Update, if entry exists */ if (oldEntry != null) { oldEntry.setUnsignedAppletAction(behaviour); oldEntry.setTimeStamp(new Date()); userActionStorage.update(oldEntry); return; } URL codebase = UrlUtils.normalizeUrlAndStripParams(file.getCodeBase(), true /* encode local files */); URL documentbase = UrlUtils.normalizeUrlAndStripParams(file.getSourceLocation(), true /* encode local files */); /* Else, create a new entry */ UrlRegEx codebaseRegex = UrlRegEx.quote(codebase.toExternalForm()); UrlRegEx documentbaseRegex = UrlRegEx.quoteAndStar(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.getCodeBase().toString()); // Match only this applet } UnsignedAppletActionEntry entry = new UnsignedAppletActionEntry( 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()) { 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()) { 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); 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()); } 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 (!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); 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()); } 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")); } } 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 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(); } } private 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 + "/"; } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/appletextendedsecurity/PaxHeaders.24993/Unsigne0000644000000000000000000000032012574544466030512 xustar00118 path=icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletActionStorage.java 30 mtime=1441974582.596017142 30 atime=1441974656.389866595 30 ctime=1441974670.086024253 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletActionStor0000664000076400007640000001323012574544466035113 0ustar00jvanekjvanek00000000000000/* 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 * @return a matching unsigned applet action entry */ public UnsignedAppletActionEntry getMatchingItem(String documentBase, String codeBase, List archives); /** * Shortcut {@code getMatchingItem(documentBase, null, null, null)} * * @param documentBase * @return a matching unsigned applet action entry */ public UnsignedAppletActionEntry getMatchingItemByDocumentBase(String documentBase); /** * Shortcut {@code getMatchingItem(null, codeBase, null, null)} * * @param codeBase * @return a matching unsigned applet action entry */ public UnsignedAppletActionEntry getMatchingItemByCodeBase(String codeBase); /** * Shortcut {@code getMatchingItem(documentBase, codeBase, null, null)} * * @param documentBase * @param codeBase * @return a matching unsigned applet action entry */ public UnsignedAppletActionEntry getMatchingItemByBases(String documentBase, String codeBase); /** * 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.5.3/netx/net/sourceforge/jnlp/security/appletextendedsecurity/PaxHeaders.24993/Unsigne0000644000000000000000000000031612574544466030517 xustar00116 path=icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletActionEntry.java 30 mtime=1441974582.596017142 30 atime=1441974656.389866595 30 ctime=1441974670.086024253 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/appletextendedsecurity/UnsignedAppletActionEntr0000664000076400007640000001356512574544466035107 0ustar00jvanekjvanek00000000000000/* Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.appletextendedsecurity; import java.io.IOException; import java.io.Writer; import java.util.ArrayList; import java.util.Date; import java.util.List; public class UnsignedAppletActionEntry { private ExecuteAppletAction unsignedAppletAction; private Date timeStamp; private UrlRegEx documentBase; private UrlRegEx codeBase; private List archives; public static UnsignedAppletActionEntry createFromString(String s) { String[] split = s.split("\\s+"); UnsignedAppletActionEntry nw = new UnsignedAppletActionEntry( ExecuteAppletAction.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(ExecuteAppletAction unsignedAppletAction, Date timeStamp, UrlRegEx documentBase, UrlRegEx codeBase, List archives) { this.unsignedAppletAction = unsignedAppletAction; this.timeStamp = timeStamp; this.documentBase = documentBase; this.codeBase = codeBase; this.archives = archives; } @Override public String toString() { return this.serializeToReadableAndParseableString(); } public void write(Writer bw) throws IOException { bw.write(this.serializeToReadableAndParseableString()); } private String serializeToReadableAndParseableString() throws InvalidLineException { String s = unsignedAppletAction.toChar() + " " + ((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 UrlRegEx getDocumentBase() { return documentBase; } public void setTimeStamp(Date timeStamp) { this.timeStamp = timeStamp; } public void setDocumentBase(UrlRegEx documentBase) { this.documentBase = documentBase; } public ExecuteAppletAction getUnsignedAppletAction() { return unsignedAppletAction; } public void setUnsignedAppletAction(ExecuteAppletAction unsignedAppletAction) { this.unsignedAppletAction = unsignedAppletAction; } public UrlRegEx getCodeBase() { return codeBase; } public void setCodeBase(UrlRegEx codeBase) { this.codeBase = codeBase; } public List getArchives() { return archives; } public void setArchives(List archives) { this.archives = archives; } public static String createArchivesString(List listOfArchives) { if (listOfArchives == null) { return ""; } StringBuilder sb = new StringBuilder(); for (int i = 0; i < listOfArchives.size(); i++) { String string = listOfArchives.get(i); if (string.trim().isEmpty()) { continue; } sb.append(string); if (i != listOfArchives.size() - 1) { sb.append(","); } } return sb.toString(); } public static List createArchivesList(String commedArchives) { if (commedArchives == null) { return null; } if (commedArchives.trim().isEmpty()) { return null; } String[] items = commedArchives.trim().split(","); List r = new ArrayList(items.length); for (int i = 0; i < items.length; i++) { String string = items[i]; if (string.trim().isEmpty()) { continue; } r.add(string); } return r; } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/appletextendedsecurity/PaxHeaders.24993/Invalid0000644000000000000000000000031112574544466030470 xustar00111 path=icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/appletextendedsecurity/InvalidLineException.java 30 mtime=1441974582.596017142 30 atime=1441974656.389866595 30 ctime=1441974670.086024253 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/appletextendedsecurity/InvalidLineException.jav0000664000076400007640000000347612574544466035032 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/security/appletextendedsecurity/PaxHeaders.24993/Extende0000644000000000000000000000031712574544466030504 xustar00117 path=icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/appletextendedsecurity/ExtendedAppletSecurityHelp.java 30 mtime=1441974582.596017142 30 atime=1441974656.389866595 30 ctime=1441974670.086024253 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/appletextendedsecurity/ExtendedAppletSecurityHe0000664000076400007640000001756312574544466035113 0ustar00jvanekjvanek00000000000000/* 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.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(Translator.R("APPEXTSEChelp")); mainHtmlPane.addHyperlinkListener(ExtendedAppletSecurityHelp.this); mainHtmlPane.setCaretPosition(1); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); } @Override public void hyperlinkUpdate(HyperlinkEvent event) { if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { try { if (event.getURL() == null) { String s = event.getDescription().replace("#", ""); mainHtmlPane.scrollToReference(s); } else { mainHtmlPane.setPage(event.getURL()); } } catch (IOException ioe) { 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(Translator.R("APPEXTSEChelp")); mainHtmlPane.setCaretPosition(1); } private void goToDialogueSection(java.awt.event.ActionEvent evt) { mainHtmlPane.setText(Translator.R("APPEXTSEChelp")); mainHtmlPane.scrollToReference("dialogue"); } public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { ExtendedAppletSecurityHelp dialog = new ExtendedAppletSecurityHelp(null, false); dialog.setVisible(true); } }); } private JButton homeAndDialogueButton; private JButton homeButton; private JButton closeButton; private JEditorPane mainHtmlPane; private JPanel mainButtonsPanel; private JPanel navigationPanel; private JPanel closePanel; private JPanel mainPanel; private JScrollPane scrollPane; private JSeparator niceSeparator; } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/appletextendedsecurity/PaxHeaders.24993/Execute0000644000000000000000000000013212574544466030505 xustar0030 mtime=1441974582.596017142 30 atime=1441974656.389866595 30 ctime=1441974670.086024253 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/appletextendedsecurity/ExecuteAppletAction.java0000664000076400007640000000676412574544466035027 0ustar00jvanekjvanek00000000000000/* 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; 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"; } 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"); } throw new RuntimeException("Unknown UnsignedAppletAction"); } public static ExecuteAppletAction fromString(String s) { if (s.startsWith("A")) { return ExecuteAppletAction.ALWAYS; } else if (s.startsWith("N")) { return ExecuteAppletAction.NEVER; } else if (s.startsWith("y")) { return ExecuteAppletAction.YES; } else if (s.startsWith("s")) { return ExecuteAppletAction.SANDBOX; } else if (s.startsWith("n")) { return ExecuteAppletAction.NO; } else { throw new RuntimeException("Unknown ExecuteUnsignedApplet for " + s); } } @Override public String toString() { return toChar() + " - " + toExplanation(); } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/appletextendedsecurity/PaxHeaders.24993/AppletS0000644000000000000000000000032112574544466030453 xustar00120 path=icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/appletextendedsecurity/AppletStartupSecuritySettings.java 29 mtime=1441974582.59501713 30 atime=1441974656.389866595 30 ctime=1441974670.086024253 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/appletextendedsecurity/AppletStartupSecuritySet0000664000076400007640000000770212574544466035206 0ustar00jvanekjvanek00000000000000/* Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.security.appletextendedsecurity; import javax.naming.ConfigurationException; import net.sourceforge.jnlp.security.appletextendedsecurity.AppletSecurityLevel; import net.sourceforge.jnlp.security.appletextendedsecurity.UnsignedAppletActionStorage; import net.sourceforge.jnlp.security.appletextendedsecurity.impl.UnsignedAppletActionStorageImpl; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.util.lockingfile.StorageIoException; public class AppletStartupSecuritySettings { private static final AppletStartupSecuritySettings instance = new AppletStartupSecuritySettings(); private UnsignedAppletActionStorageImpl globalInstance; private UnsignedAppletActionStorageImpl customInstance; public static AppletStartupSecuritySettings getInstance() { return instance; } public static AppletSecurityLevel getHardcodedDefaultSecurityLevel() { return AppletSecurityLevel.getDefault(); } /** * * @return storage with global items from /etc/ */ public UnsignedAppletActionStorage getUnsignedAppletActionGlobalStorage() { if (globalInstance == null) { globalInstance = new UnsignedAppletActionStorageImpl(DeploymentConfiguration.getAppletTrustGlobalSettingsPath()); } return globalInstance; } /** * * @return storage with custom items from /home/ */ public UnsignedAppletActionStorage getUnsignedAppletActionCustomStorage() { if (customInstance == null) { customInstance = new UnsignedAppletActionStorageImpl(DeploymentConfiguration.getAppletTrustUserSettingsPath()); } return customInstance; } /** * * @return user-set security level or default one if user-set do not exists */ public AppletSecurityLevel getSecurityLevel() { DeploymentConfiguration conf = JNLPRuntime.getConfiguration(); if (conf == null) { throw new StorageIoException("JNLPRuntime configuration is null. Try to reinstall IcedTea-Web"); } String s = conf.getProperty(DeploymentConfiguration.KEY_SECURITY_LEVEL); if (s == null) { return getHardcodedDefaultSecurityLevel(); } return AppletSecurityLevel.fromString(s); } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/appletextendedsecurity/PaxHeaders.24993/AppletS0000644000000000000000000000013112574544466030452 xustar0029 mtime=1441974582.59501713 30 atime=1441974656.388866583 30 ctime=1441974670.086024253 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/appletextendedsecurity/AppletSecurityLevel.java0000664000076400007640000000630412574544466035054 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/security/PaxHeaders.24993/VariableX509TrustManagerJDK7.j0000644000000000000000000000013112574544466027624 xustar0029 mtime=1441974582.59501713 30 atime=1441974656.388866583 30 ctime=1441974670.086024253 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/VariableX509TrustManagerJDK7.java0000664000076400007640000001201212574544466031372 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/security/PaxHeaders.24993/VariableX509TrustManagerJDK6.j0000644000000000000000000000013112574544466027623 xustar0029 mtime=1441974582.59501713 30 atime=1441974656.388866583 30 ctime=1441974670.086024253 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/VariableX509TrustManagerJDK6.java0000664000076400007640000000617312574544466031404 0ustar00jvanekjvanek00000000000000/* VariableX509TrustManagerJDK6.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are 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.CertificateException; import java.security.cert.X509Certificate; import com.sun.net.ssl.internal.ssl.X509ExtendedTrustManager; public class VariableX509TrustManagerJDK6 extends X509ExtendedTrustManager { private VariableX509TrustManager vX509TM = VariableX509TrustManager.getInstance(); @Override public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException { checkClientTrusted(chain, authType, null, null); } @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, String hostname, String algorithm) throws CertificateException { vX509TM.checkTrustClient(chain, authType, hostname); // We don't need algorithm, we will always use this for TLS only } @Override public void checkServerTrusted(X509Certificate[] chain, String authType, String hostname, String algorithm) throws CertificateException { // We don't need to pass algorithm, we will always use this for TLS only vX509TM.checkTrustServer(chain, authType, hostname, null /* socket */, null /* engine */); } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/PaxHeaders.24993/VariableX509TrustManager.java0000644000000000000000000000013112574544466027674 xustar0029 mtime=1441974582.59501713 30 atime=1441974656.388866583 30 ctime=1441974670.086024253 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/VariableX509TrustManager.java0000664000076400007640000004067112574544466030766 0ustar00jvanekjvanek00000000000000/* 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 (int i = 0; i < trustManagers.length; i++) { if (trustManagers[i] instanceof X509TrustManager) { certTrustManagers[j] = (X509TrustManager) trustManagers[i]; } } } } 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 (int i = 0; i < trustManagers.length; i++) { if (trustManagers[i] instanceof X509TrustManager) { caTrustManagers[j] = (X509TrustManager) trustManagers[i]; } } } } 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 (int i = 0; i < trustManagers.length; i++) { if (trustManagers[i] instanceof X509TrustManager) { clientTrustManagers[j] = (X509TrustManager) trustManagers[i]; } } } } catch (Exception e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); } } /** * Check if client is trusted (no support for custom here, only system/user) */ public void checkTrustClient(X509Certificate[] chain, String authType, String hostName) throws CertificateException { boolean trusted = false; ValidatorException savedException = null; for (int i = 0; i < clientTrustManagers.length; i++) { try { clientTrustManagers[i].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) */ 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 (int i = 0; i < caTrustManagers.length; i++) { try { if (socket == null && engine == null) { caTrustManagers[i].checkServerTrusted(chain, authType); } else { try { Class x509ETMClass = Class.forName("javax.net.ssl.X509ExtendedTrustManager"); if (engine == null) { Method mcheckServerTrusted = x509ETMClass.getDeclaredMethod("checkServerTrusted", X509Certificate[].class, String.class, Socket.class); mcheckServerTrusted.invoke(caTrustManagers[i], chain, authType, socket); } else { Method mcheckServerTrusted = x509ETMClass.getDeclaredMethod("checkServerTrusted", X509Certificate[].class, String.class, SSLEngine.class); mcheckServerTrusted.invoke(caTrustManagers[i], chain, authType, engine); } } catch (NoSuchMethodException nsme) { throw new ValidatorException(nsme.getMessage()); } catch (InvocationTargetException ite) { throw new ValidatorException(ite.getMessage()); } catch (IllegalAccessException iae) { throw new ValidatorException(iae.getMessage()); } catch (ClassNotFoundException cnfe) { throw new ValidatorException(cnfe.getMessage()); } } trusted = true; break; } catch (ValidatorException caex) { savedException = caex; } } if (trusted) { return; } // then try certificate TrustManagers for (int i = 0; i < certTrustManagers.length; i++) { try { certTrustManagers[i].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 (int i = 0; i < certTrustManagers.length; i++) { try { certTrustManagers[i].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 (int i = 0; i < caTrustManagers.length; i++) { issuers.addAll(Arrays.asList(caTrustManagers[i].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) { if (temporarilyUntrusted.contains(c)) { return true; } return false; } /** * 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.5.3/netx/net/sourceforge/jnlp/security/PaxHeaders.24993/SecurityUtil.java0000644000000000000000000000013212574544466025672 xustar0030 mtime=1441974582.594017119 30 atime=1441974656.387866572 30 ctime=1441974670.086024253 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/SecurityUtil.java0000664000076400007640000002201312574544466026751 0ustar00jvanekjvanek00000000000000/* 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.security.KeyStore; import net.sourceforge.jnlp.security.KeyStores.Level; import net.sourceforge.jnlp.security.KeyStores.Type; import net.sourceforge.jnlp.util.logging.OutputController; public class SecurityUtil { private static final char[] password = "changeit".toCharArray(); public static String getTrustedCertsFilename() throws Exception { return KeyStores.getKeyStoreLocation(Level.USER, Type.CERTS); } public static char[] getTrustedCertsPassword() { return password; } /** * 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. */ 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. */ 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"); ks.load(null, password); FileOutputStream fos = new FileOutputStream(certFile); ks.store(fos, password); fos.close(); return true; } else { return false; } } else { return true; } } /** * Returns the keystore associated with the user's trusted.certs file, * or null otherwise. */ public static KeyStore getUserKeyStore() throws Exception { KeyStore ks = null; FileInputStream fis = null; if (checkTrustedCertsFile()) { try { File file = new File(getTrustedCertsFilename()); if (file.exists()) { fis = new FileInputStream(file); ks = KeyStore.getInstance("JKS"); ks.load(fis, password); } } catch (Exception e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); throw e; } finally { if (fis != null) fis.close(); } } return ks; } /** * Returns the keystore associated with the JDK cacerts file, * or null otherwise. */ 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; } /** * Returns the keystore associated with the system certs file, * or null otherwise. */ 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; } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/PaxHeaders.24993/SecurityDialogs.java0000644000000000000000000000013212574544466026337 xustar0030 mtime=1441974582.594017119 30 atime=1441974656.387866572 30 ctime=1441974670.086024253 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/SecurityDialogs.java0000664000076400007640000004231612574544466027426 0ustar00jvanekjvanek00000000000000/* 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.ExecuteAppletAction; 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 showAccessWarningDialog(AccessType accessType, JNLPFile file) { return showAccessWarningDialog(accessType, file, null); } /** * 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. * @param extras an optional array of Strings (typically) that gets * passed to the dialog labels. * @return true if permission was granted by the user, false otherwise. */ public static boolean showAccessWarningDialog(final AccessType accessType, final JNLPFile file, final Object[] extras) { if (!shouldPromptUser()) { return false; } final SecurityDialogMessage message = new SecurityDialogMessage(); message.dialogType = DialogType.ACCESS_WARNING; message.accessType = accessType; message.file = file; message.extras = extras; Object selectedValue = getUserResponse(message); return getIntegerResponseAsBoolean(selectedValue); } /** * Shows a warning dialog for when a plugin applet is unsigned. * This is used with 'high-security' setting. * * @return true if permission was granted by the user, false otherwise. */ public static AppSigningWarningAction showUnsignedWarningDialog(JNLPFile file) { if (!shouldPromptUser()) { 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 * * @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()) { 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. * * @return true if permission was granted by the user, false otherwise. */ public static AppSigningWarningAction showPartiallySignedWarningDialog(JNLPFile file, CertVerifier certVerifier, SecurityDelegate securityDelegate) { if (!shouldPromptUser()) { 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) { 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()) { 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(String title, URL codeBase, Set remoteUrls) { if (!shouldPromptUser()) { return false; } SecurityDialogMessage message = new SecurityDialogMessage(); message.dialogType = DialogType.MATCHING_ALACA; message.extras = new Object[]{title, codeBase.toString(), UrlUtils.setOfUrlsToHtmlList(remoteUrls)}; Object selectedValue = getUserResponse(message); return getIntegerResponseAsBoolean(selectedValue); } /** * 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).intValue(); } else { // Otherwise default to "cancel" return 2; } } public static boolean showMissingPermissionsAttributeDialogue(String title, URL codeBase) { if (!shouldPromptUser()) { return false; } SecurityDialogMessage message = new SecurityDialogMessage(); message.dialogType = DialogType.UNSIGNED_EAS_NO_PERMISSIONS_WARNING; message.extras = new Object[]{title, codeBase.toExternalForm()}; 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.intValue() == 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. */ private static boolean shouldPromptUser() { return AccessController.doPrivileged(new PrivilegedAction() { @Override public Boolean run() { return Boolean.valueOf(JNLPRuntime.getConfiguration() .getProperty(DeploymentConfiguration.KEY_SECURITY_PROMPT_USER)); } }); } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/PaxHeaders.24993/SecurityDialogMessageHandler.j0000644000000000000000000000013212574544466030267 xustar0030 mtime=1441974582.593017107 30 atime=1441974656.387866572 30 ctime=1441974670.086024253 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/SecurityDialogMessageHandler.java0000664000076400007640000001235312574544466032044 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/security/PaxHeaders.24993/SecurityDialogMessage.java0000644000000000000000000000013212574544466027461 xustar0030 mtime=1441974582.593017107 30 atime=1441974656.387866572 30 ctime=1441974670.086024253 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/SecurityDialogMessage.java0000664000076400007640000000545512574544466030553 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/security/PaxHeaders.24993/SecurityDialog.java0000644000000000000000000000013212574544466026154 xustar0030 mtime=1441974582.593017107 30 atime=1441974656.387866572 30 ctime=1441974670.086024253 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/SecurityDialog.java0000664000076400007640000003427312574544466027246 0ustar00jvanekjvanek00000000000000/* 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.MatchingALACAttributePanel; 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 = new MatchingALACAttributePanel(this, (String) 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. */ public void addActionListener(ActionListener listener) { listeners.add(listener); } public boolean requiresSignedJNLPWarning() { return requiresSignedJNLPWarning; } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/PaxHeaders.24993/PluginAppVerifier.java0000644000000000000000000000013212574544466026620 xustar0030 mtime=1441974582.593017107 30 atime=1441974656.387866572 30 ctime=1441974670.086024253 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/PluginAppVerifier.java0000664000076400007640000002125112574544466027702 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/security/PaxHeaders.24993/KeyStores.java0000644000000000000000000000013112574544466025154 xustar0030 mtime=1441974582.592017095 29 atime=1441974656.38686656 30 ctime=1441974670.086024253 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/KeyStores.java0000664000076400007640000003344112574544466026243 0ustar00jvanekjvanek00000000000000/* 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.FileOutputStream; 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.DeploymentConfiguration; 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 DeploymentConfiguration config = null; private static final String KEYSTORE_TYPE = "JKS"; /** the default password used to protect the KeyStores */ private static final String DEFAULT_PASSWORD = "changeit"; public static char[] getPassword() { return DEFAULT_PASSWORD.toCharArray(); } /** Set the configuration object to use for getting KeyStore paths */ public static void setConfiguration(DeploymentConfiguration newConfig) { SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(new AllPermission()); } config = newConfig; } /** * 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 = false; 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 * @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); KeyStore ks = null; try { ks = createKeyStoreFromFile(new File(location), create, DEFAULT_PASSWORD); //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); KeyStore ks = null; /* System-level JSSE certificates */ 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); KeyStore ks = null; /* System-level JSSE CA certificates */ 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 = null; 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 String getKeyStoreLocation(Level level, Type type) { String configKey = null; switch (level) { case SYSTEM: switch (type) { case JSSE_CA_CERTS: configKey = DeploymentConfiguration.KEY_SYSTEM_TRUSTED_JSSE_CA_CERTS; break; case CA_CERTS: configKey = DeploymentConfiguration.KEY_SYSTEM_TRUSTED_CA_CERTS; break; case JSSE_CERTS: configKey = DeploymentConfiguration.KEY_SYSTEM_TRUSTED_JSSE_CERTS; break; case CERTS: configKey = DeploymentConfiguration.KEY_SYSTEM_TRUSTED_CERTS; break; case CLIENT_CERTS: configKey = DeploymentConfiguration.KEY_SYSTEM_TRUSTED_CLIENT_CERTS; break; } break; case USER: switch (type) { case JSSE_CA_CERTS: configKey = DeploymentConfiguration.KEY_USER_TRUSTED_JSSE_CA_CERTS; break; case CA_CERTS: configKey = DeploymentConfiguration.KEY_USER_TRUSTED_CA_CERTS; break; case JSSE_CERTS: configKey = DeploymentConfiguration.KEY_USER_TRUSTED_JSSE_CERTS; break; case CERTS: configKey = DeploymentConfiguration.KEY_USER_TRUSTED_CERTS; break; case CLIENT_CERTS: configKey = DeploymentConfiguration.KEY_USER_TRUSTED_CLIENT_CERTS; break; } break; } if (configKey == null) { throw new RuntimeException("Unspported"); } return config.getProperty(configKey); } /** * 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 * @param password the password to unlock the KeyStore file. * @return a KeyStore containing data from the file */ private static final KeyStore createKeyStoreFromFile(File file, boolean createIfNotFound, String password) 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); ks.load(null, password.toCharArray()); FileOutputStream fos = new FileOutputStream(file); ks.store(fos, password.toCharArray()); fos.close(); } // TODO catch exception when password is incorrect and prompt user if (file.exists()) { fis = new FileInputStream(file); ks = KeyStore.getInstance(KEYSTORE_TYPE); ks.load(fis, password.toCharArray()); } else { ks = KeyStore.getInstance(KEYSTORE_TYPE); ks.load(null, password.toCharArray()); } } finally { if (fis != null) { fis.close(); } } return ks; } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/PaxHeaders.24993/JNLPAuthenticator.java0000644000000000000000000000013112574544466026522 xustar0030 mtime=1441974582.592017095 29 atime=1441974656.38686656 30 ctime=1441974670.086024253 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/JNLPAuthenticator.java0000664000076400007640000000512012574544466027602 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/security/PaxHeaders.24993/JNLPAppVerifier.java0000644000000000000000000000013112574544466026124 xustar0030 mtime=1441974582.592017095 29 atime=1441974656.38686656 30 ctime=1441974670.086024253 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/JNLPAppVerifier.java0000664000076400007640000001360112574544466027207 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/security/PaxHeaders.24993/HttpsCertVerifier.java0000644000000000000000000000013112574544466026640 xustar0030 mtime=1441974582.592017095 29 atime=1441974656.38686656 30 ctime=1441974670.086024253 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/HttpsCertVerifier.java0000664000076400007640000001771312574544466027733 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/security/PaxHeaders.24993/CertificateUtils.java0000644000000000000000000000013112574544466026467 xustar0030 mtime=1441974582.591017084 29 atime=1441974656.38686656 30 ctime=1441974670.086024253 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/CertificateUtils.java0000664000076400007640000001735312574544466027562 0ustar00jvanekjvanek00000000000000/* 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. */ 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. */ public static final void addToKeyStore(X509Certificate cert, KeyStore ks) throws KeyStoreException { OutputController.getLogger().log("Importing " + cert.getSubjectX500Principal().getName()); String alias = null; // does this certificate already exist? 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 { String alias = null; // does this certificate already exist? 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); ks.setKeyEntry(alias, key, KeyStores.getPassword(), 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 (int i = 0; i < keyStores.length; i++) { try { // Check against all certs Enumeration aliases = keyStores[i].aliases(); while (aliases.hasMoreElements()) { // Verify against this entry String alias = aliases.nextElement(); if (c.equals(keyStores[i].getCertificate(alias))) { OutputController.getLogger().log(Translator.R("LCertFoundIn", c.getSubjectX500Principal().getName(), KeyStores.getPathToKeystore(keyStores[i].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 */ 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 = ks.getKey(alias, KeyStores.getPassword()); 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.5.3/netx/net/sourceforge/jnlp/security/PaxHeaders.24993/CertVerifier.java0000644000000000000000000000013112574544466025615 xustar0030 mtime=1441974582.591017084 29 atime=1441974656.38686656 30 ctime=1441974670.086024253 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/CertVerifier.java0000664000076400007640000000563612574544466026711 0ustar00jvanekjvanek00000000000000/* 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 */ public boolean hasSigningIssues(CertPath certPath); /** * Get the details regarding issue with this certificate */ public List getDetails(CertPath certPath); /** * Return a valid certificate path to this certificate being verified * @return The CertPath */ public CertPath getCertPath(CertPath certPath); /** * Returns the application's publisher's certificate. */ public abstract Certificate getPublisher(CertPath certPath); /** * Returns 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. */ public abstract Certificate getRoot(CertPath certPath); } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/PaxHeaders.24993/AppVerifier.java0000644000000000000000000000013212574544466025441 xustar0030 mtime=1441974582.591017084 30 atime=1441974656.385866549 30 ctime=1441974670.086024253 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/security/AppVerifier.java0000664000076400007640000000732212574544466026526 0ustar00jvanekjvanek00000000000000/* 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. */ public boolean isFullySigned(Map certs, Map signedJars); /** * Prompt the user with requests for trusting the certificates used by this app * @throws LaunchException */ public void checkTrustWithUser(SecurityDelegate securityDelegate, JarCertVerifier jcv, JNLPFile file) throws LaunchException; } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/runtime0000644000000000000000000000013212574544466022121 xustar0030 mtime=1441974582.591017084 30 atime=1441974670.156025059 30 ctime=1441974670.086024253 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/runtime/0000775000076400007640000000000012574544466023257 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/netx/net/sourceforge/jnlp/runtime/PaxHeaders.24993/package-info.java0000644000000000000000000000013212574544466025365 xustar0030 mtime=1441974582.591017084 30 atime=1441974656.385866549 30 ctime=1441974670.085024242 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/runtime/package-info.java0000664000076400007640000000336512574544466026455 0ustar00jvanekjvanek00000000000000/* 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 netx.sourceforge.jnlp.runtime; icedtea-web-1.5.3/netx/net/sourceforge/jnlp/runtime/PaxHeaders.24993/pac-funcs.js0000644000000000000000000000013212574544466024413 xustar0030 mtime=1441974582.590017073 30 atime=1441974656.385866549 30 ctime=1441974670.085024242 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/runtime/pac-funcs.js0000664000076400007640000006223512574544466025504 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/runtime/PaxHeaders.24993/Translator.java0000644000000000000000000000013212574544466025172 xustar0030 mtime=1441974582.590017073 30 atime=1441974656.385866549 30 ctime=1441974670.085024242 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/runtime/Translator.java0000664000076400007640000000257112574544466026260 0ustar00jvanekjvanek00000000000000// 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; /** * Utility class to provide simple methods to help localize messages */ public class Translator { /** * @return the localized string for the message */ public static String R(String message, Object... params) { return JNLPRuntime.getMessage(message, params); } /** * 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 JNLPRuntime.getMessage(message); } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/runtime/PaxHeaders.24993/RhinoBasedPacEvaluator.java0000644000000000000000000000013212574544466027366 xustar0030 mtime=1441974582.590017073 30 atime=1441974656.385866549 30 ctime=1441974670.085024242 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/runtime/RhinoBasedPacEvaluator.java0000664000076400007640000002430112574544466030447 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/runtime/PaxHeaders.24993/PacEvaluatorFactory.java0000644000000000000000000000013212574544466026757 xustar0030 mtime=1441974582.589017061 30 atime=1441974656.384866537 30 ctime=1441974670.085024242 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/runtime/PacEvaluatorFactory.java0000664000076400007640000001056612574544466030050 0ustar00jvanekjvanek00000000000000/* 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(); } InputStream in = cl.getResourceAsStream("net/sourceforge/jnlp/build.properties"); Properties properties = null; try { 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 application is using JavaScript."); OutputController.getLogger().log(e); } finally { try { in.close(); } catch (Exception e) { OutputController.getLogger().log(OutputController.Level.WARNING_ALL, "PAC provider is broken or don't exists. This is ok unless your application 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.5.3/netx/net/sourceforge/jnlp/runtime/PaxHeaders.24993/PacEvaluator.java0000644000000000000000000000013212574544466025427 xustar0030 mtime=1441974582.589017061 30 atime=1441974656.384866537 30 ctime=1441974670.085024242 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/runtime/PacEvaluator.java0000664000076400007640000000427212574544466026515 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/runtime/PaxHeaders.24993/ManifestAttributesChecker.java0000644000000000000000000000013212574544466030143 xustar0030 mtime=1441974582.589017061 30 atime=1441974656.384866537 30 ctime=1441974670.085024242 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/runtime/ManifestAttributesChecker.java0000664000076400007640000004515612574544466031237 0ustar00jvanekjvanek00000000000000/* 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.HashSet; 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; 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; } void checkAll() throws LaunchException { if (isCheckEnabled()) { checkTrustedOnlyAttribute(); checkCodebaseAttribute(); checkPermissionsAttribute(); checkApplicationLibraryAllowableCodebaseAttribute(); } else { OutputController.getLogger().log("Checking for attributes in manifest is disabled."); } } public static boolean isCheckEnabled() { String value = JNLPRuntime.getConfiguration().getProperty(DeploymentConfiguration.KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK); return Boolean.parseBoolean(value); } /** * 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 = Translator.R("STOAsignedMsgFully"); } else if (isFullySigned && isSandboxed) { signedMsg = Translator.R("STOAsignedMsgAndSandbox"); } else { signedMsg = Translator.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(Translator.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, Translator.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, Translator.R("CBCheckNoEntry")); return; } if (securityType.equals(SecurityDesc.SANDBOX_PERMISSIONS)) { if (codebaseAtt.matches(codebase)) { OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, Translator.R("CBCheckUnsignedPass")); } else { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, Translator.R("CBCheckUnsignedFail")); } } else { if (codebaseAtt.matches(codebase)) { OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, Translator.R("CBCheckOkSignedOk")); } else { if (file instanceof PluginBridge) { throw new LaunchException(Translator.R("CBCheckSignedAppletDontMatchException", file.getManifestsAttributes().getCodebase().toString(), codebase)); } else { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, Translator.R("CBCheckSignedFail")); } } } } /** * http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/security/manifest.html#permissions */ private void checkPermissionsAttribute() throws LaunchException { final ManifestBoolean sandboxForced = file.getManifestsAttributes().isSandboxForced(); final AppletSecurityLevel itwSecurityLevel = AppletStartupSecuritySettings.getInstance().getSecurityLevel(); if (itwSecurityLevel == AppletSecurityLevel.ALLOW_UNSIGNED || securityDelegate.getRunInSandbox()) { OutputController.getLogger().log(OutputController.Level.WARNING_ALL, "Although 'permissions' attribute of this application is '" + file.getManifestsAttributes().permissionsToString() + "' Your Extended applets security is at 'low', or you have specifically chosen to run the applet Sandboxed. Continuing"); return; } if (sandboxForced == ManifestBoolean.UNDEFINED) { 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.getCodeBase()); 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) { // http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/security/manifest.html#permissions // FIXME: attempting to follow the spec, but it is too late now to actually set the applet // to run in sandbox. If we do this the applet will not be run at all, rather than run sandboxed! try { securityDelegate.setRunInSandbox(); } catch (final LaunchException e) { OutputController.getLogger().log(e); throw new LaunchException("The applet is signed but its manifest specifies Sandbox permissions. This is not yet supported. Try running the applet again, but choose the Sandbox run option.", e); } } } } 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 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(), documentBase, 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"); 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."); } } } boolean a = SecurityDialogs.showMatchingALACAttributePanel(file.getTitle(), documentBase, usedUrls); if (!a) { 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."); } } //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.5.3/netx/net/sourceforge/jnlp/runtime/PaxHeaders.24993/ManageJnlpResources.java0000644000000000000000000000013112574544466026747 xustar0029 mtime=1441974582.58801705 30 atime=1441974656.384866537 30 ctime=1441974670.085024242 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/runtime/ManageJnlpResources.java0000664000076400007640000001405712574544466030040 0ustar00jvanekjvanek00000000000000/* ManageJnlpResources.java Copyright (C) 2012, Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.runtime; import java.net.URL; import java.util.ArrayList; import java.util.List; import net.sourceforge.jnlp.JARDesc; import net.sourceforge.jnlp.ResourcesDesc; import net.sourceforge.jnlp.Version; import net.sourceforge.jnlp.runtime.JNLPClassLoader.DownloadAction; public class ManageJnlpResources { /** * Returns jars from the JNLP file with the part name provided. * @param rootClassLoader Root JNLPClassLoader of the application. * @param ref Path of the launch or extension JNLP File containing the * resource. If null, main JNLP's file location will be used instead. * @param part The name of the part. * @return jars found. */ public static JARDesc[] findJars(final JNLPClassLoader rootClassLoader, final URL ref, final String part, final Version version) { JNLPClassLoader foundLoader = LocateJnlpClassLoader.getLoaderByJnlpFile(rootClassLoader, ref); if (foundLoader != null) { List foundJars = new ArrayList(); ResourcesDesc resources = foundLoader.getJNLPFile().getResources(); for (JARDesc eachJar : resources.getJARs(part)) { if (version == null || version.equals(eachJar.getVersion())) foundJars.add(eachJar); } return foundJars.toArray(new JARDesc[foundJars.size()]); } return new JARDesc[] {}; } /** * Removes jars from cache. * @param classLoader JNLPClassLoader of the application that is associated to the resource. * @param ref Path of the launch or extension JNLP File containing the * resource. If null, main JNLP's file location will be used instead. * @param jars Jars marked for removal. */ public static void removeCachedJars(final JNLPClassLoader classLoader, final URL ref, final JARDesc[] jars) { JNLPClassLoader foundLoader = LocateJnlpClassLoader.getLoaderByJnlpFile(classLoader, ref); if (foundLoader != null) foundLoader.removeJars(jars); } /** * Downloads jars identified by part name. * @param classLoader JNLPClassLoader of the application that is associated to the resource. * @param ref Path of the launch or extension JNLP File containing the * resource. If null, main JNLP's file location will be used instead. * @param part The name of the path. */ public static void downloadJars(final JNLPClassLoader classLoader, final URL ref, final String part, final Version version) { JNLPClassLoader foundLoader = LocateJnlpClassLoader.getLoaderByJnlpFile(classLoader, ref); if (foundLoader != null) foundLoader.initializeNewJarDownload(ref, part, version); } /** * Downloads and initializes resources which are not mentioned in the jnlp file. * Used by DownloadService. * @param rootClassLoader Root JNLPClassLoader of the application. * @param ref Path to the resource. * @param version The version of resource. If null, no version is specified. */ public static void loadExternalResouceToCache(final JNLPClassLoader rootClassLoader, final URL ref, final String version) { rootClassLoader.manageExternalJars(ref, version, DownloadAction.DOWNLOAD_TO_CACHE); } /** * Removes resource which are not mentioned in the jnlp file. * Used by DownloadService. * @param rootClassLoader Root JNLPClassLoader of the application. * @param ref Path to the resource. * @param version The version of resource. If null, no version is specified. */ public static void removeExternalCachedResource(final JNLPClassLoader rootClassLoader, final URL ref, final String version) { rootClassLoader.manageExternalJars(ref, version, DownloadAction.REMOVE_FROM_CACHE); } /** * Returns {@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.5.3/netx/net/sourceforge/jnlp/runtime/PaxHeaders.24993/LocateJnlpClassLoader.java0000644000000000000000000000013112574544466027210 xustar0029 mtime=1441974582.58801705 30 atime=1441974656.384866537 30 ctime=1441974670.085024242 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/runtime/LocateJnlpClassLoader.java0000664000076400007640000001051712574544466030276 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/runtime/PaxHeaders.24993/JNLPSecurityManager.java0000644000000000000000000000013112574544466026626 xustar0029 mtime=1441974582.58801705 30 atime=1441974656.383866526 30 ctime=1441974670.085024242 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java0000664000076400007640000004161412574544466027716 0ustar00jvanekjvanek00000000000000// 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.5.3/netx/net/sourceforge/jnlp/runtime/PaxHeaders.24993/JNLPRuntime.java0000644000000000000000000000013212574544466025150 xustar0030 mtime=1441974582.587017038 30 atime=1441974656.383866526 30 ctime=1441974670.085024242 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java0000664000076400007640000007760512574544466026250 0ustar00jvanekjvanek00000000000000// 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.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.MessageFormat; import java.util.List; import java.util.ResourceBundle; import javax.jnlp.ServiceManager; import javax.naming.ConfigurationException; import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.KeyManagerFactory; import javax.net.ssl.SSLContext; import javax.net.ssl.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.security.JNLPAuthenticator; import net.sourceforge.jnlp.security.KeyStores; import net.sourceforge.jnlp.security.SecurityDialogMessageHandler; import net.sourceforge.jnlp.services.XServiceManagerStub; import net.sourceforge.jnlp.util.FileUtils; import net.sourceforge.jnlp.util.logging.JavaConsole; import net.sourceforge.jnlp.util.logging.OutputController; import net.sourceforge.jnlp.util.logging.LogConfig; 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 { static { loadResources(); } /** * 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 localized resource strings */ private static ResourceBundle resources; /** 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; /** 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 */ 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, getMessage("RConfigurationError")+": "+getConfiguration().getLoadingException().getMessage()); } KeyStores.setConfiguration(getConfiguration()); 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"); kmf.init(ks, KeyStores.getPassword()); 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 = null; 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 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; } try { if (location.getProtocol().equals("file")) { return; } //Checks the offline/online status of the system. InetAddress.getByName(location.getHost()); } catch (UnknownHostException ue) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, "The host of " + location.toExternalForm() + " file should be located seems down, or you are simply offline."); JNLPRuntime.setOnlineDetected(false); return; } setOnlineDetected(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, Translator.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, Translator.R("RFailingToDefault")); if (!JNLPRuntime.isHeadless()){ JOptionPane.showMessageDialog(null, getMessage("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; } /** * Returns true if a webstart application has been initialized, and false * for a plugin applet. */ public static boolean isWebstartApplication() { return isWebstartApplication; } /** * Returns whether the JNLP client will use any AWT/Swing * components. */ public static boolean isHeadless() { return headless; } /** * Returns 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}). * * @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. * @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. */ 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. * * @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. * * @throws IllegalStateException if caller is not the exit class */ public static void setDebug(boolean enabled) { checkExitClass(); debug = enabled; } /** * Sets the default update policy. * * @throws IllegalStateException if caller is not the exit class */ public static void setDefaultUpdatePolicy(UpdatePolicy policy) { checkExitClass(); updatePolicy = policy; } /** * Returns the default update policy. */ public static UpdatePolicy getDefaultUpdatePolicy() { return updatePolicy; } /** * Sets the default launch handler. */ public static void setDefaultLaunchHandler(LaunchHandler handler) { checkExitClass(); JNLPRuntime.handler = handler; } /** * Returns the default launch handler. */ public static LaunchHandler getDefaultLaunchHandler() { return handler; } /** * Sets the default download indicator. * * @throws IllegalStateException if caller is not the exit class */ public static void setDefaultDownloadIndicator(DownloadIndicator indicator) { checkExitClass(); JNLPRuntime.indicator = indicator; } /** * Returns the default download indicator. */ public static DownloadIndicator getDefaultDownloadIndicator() { return indicator; } /** * Returns the localized resource string identified by the * specified key. If the message is empty, a null is * returned. */ public static String getMessage(String key) { try { String result = resources.getString(key); if (result.length() == 0) return null; else return result; } catch (Exception ex) { if (!key.equals("RNoResource")) return getMessage("RNoResource", new Object[] { key }); else return "Missing resource: " + key; } } /** * Returns the localized resource string using the specified arguments. * * @param args the formatting arguments to the resource string */ public static String getMessage(String key, Object... args) { return MessageFormat.format(getMessage(key), args); } /** * Returns {@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) { } } /** * Load the resources. */ private static void loadResources() { try { resources = ResourceBundle.getBundle("net.sourceforge.jnlp.resources.Messages"); } catch (Exception ex) { throw new IllegalStateException("Missing resource bundle in netx.jar:net/sourceforge/jnlp/resource/Messages.properties"); } } /** * @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 = new File(JNLPRuntime.getConfiguration() .getProperty(DeploymentConfiguration.KEY_USER_NETX_RUNNING_FILE)); if (!netxRunningFile.exists()) { FileUtils.createParentDir(netxRunningFile); FileUtils.createRestrictedFile(netxRunningFile, true); FileOutputStream fos = new FileOutputStream(netxRunningFile); try { fos.write(message.getBytes()); } finally { fos.close(); } } 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") { 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 " + JNLPRuntime.getConfiguration() .getProperty(DeploymentConfiguration.KEY_USER_NETX_RUNNING_FILE)); } catch (IOException e) { OutputController.getLogger().log(e); } } static void setTrustAll(boolean b) { trustAll=b; } public static boolean isTrustAll() { return trustAll; } 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) { OutputController.getLogger().close(); 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.5.3/netx/net/sourceforge/jnlp/runtime/PaxHeaders.24993/JNLPProxySelector.java0000644000000000000000000000013212574544466026347 xustar0030 mtime=1441974582.586017026 30 atime=1441974656.383866526 30 ctime=1441974670.085024242 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/runtime/JNLPProxySelector.java0000664000076400007640000003576112574544466027444 0ustar00jvanekjvanek00000000000000// 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} */ @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 */ if (scheme.equals("http") || scheme.equals("https") || scheme.equals("ftp")) { URL url = uri.toURL(); if (bypassLocal && isLocalHost(url.getHost())) { return true; } if (bypassList.contains(url.getHost())) { return true; } } else if (scheme.equals("socket")) { String host = uri.getHost(); if (bypassLocal && isLocalHost(host)) { return true; } if (bypassList.contains(host)) { return true; } } } catch (MalformedURLException e) { return false; } return false; } /** * Returns true if the host is the hostname or the IP address of the * localhost */ 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 * @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 * * @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.size() == 0) { 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. * * @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.5.3/netx/net/sourceforge/jnlp/runtime/PaxHeaders.24993/JNLPPolicy.java0000644000000000000000000000013212574544466024764 xustar0030 mtime=1441974582.585017015 30 atime=1441974656.383866526 30 ctime=1441974670.085024242 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/runtime/JNLPPolicy.java0000664000076400007640000001671112574544466026053 0ustar00jvanekjvanek00000000000000// 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.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 = getPolicyFromConfig(DeploymentConfiguration.KEY_USER_SECURITY_POLICY); 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) { Policy policy = null; String policyLocation = null; DeploymentConfiguration config = JNLPRuntime.getConfiguration(); policyLocation = config.getProperty(key); if (policyLocation != null) { try { URI policyUri = new URI(policyLocation); policy = getInstance("JavaPolicy", new URIParameter(policyUri)); } catch (IllegalArgumentException e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); } catch (NoSuchAlgorithmException e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); } catch (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.5.3/netx/net/sourceforge/jnlp/runtime/PaxHeaders.24993/JNLPClassLoader.java0000644000000000000000000000013212574544466025721 xustar0030 mtime=1441974582.585017015 30 atime=1441974656.383866526 30 ctime=1441974670.085024242 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java0000664000076400007640000030631212574544466027007 0ustar00jvanekjvanek00000000000000// // 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.FileOutputStream; import java.io.FileReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; 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.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 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 boolean strict = true; /** loads the resources */ private 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 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 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 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 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 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 Map jarLocationSecurityMap = Collections.synchronizedMap(new HashMap()); /*Set to prevent once tried-to-get resources to be tried again*/ private 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; /** * Create a new JNLPClassLoader from the specified file. * * @param file the JNLP file */ 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 */ 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()); 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(); //loading mainfests before resources are initialised may cause waiting for resources file.getManifestsAttributes().setLoader(this); // initialize permissions initializePermissions(); setSecurity(); ManifestAttributesChecker mac = new ManifestAttributesChecker(security, file, signing, securityDelegate); mac.checkAll(); installShutdownHooks(); } /** * 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.getHost()); } /** * 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 */ 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 */ public static JNLPClassLoader getInstance(JNLPFile file, UpdatePolicy policy, String mainName, boolean enableCodeBase) throws LaunchException { JNLPClassLoader baseLoader = null; JNLPClassLoader loader = null; String uniqueKey = file.getUniqueKey(); synchronized ( getUniqueKeyLock(uniqueKey) ) { 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 version the file's version * @param policy the update policy to use when downloading resources * @param mainName Overrides the main class name of the application */ 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 initializePermissions() { 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 { OutputController.getLogger().log("Permission added: " + p.toString()); } if (p != null) resourcePermissions.add(p); } } /** * 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; //Check if main jar is found within extensions foundMainJar = foundMainJar || hasMainInExtensions(); return; } /* if (jars == null || jars.length == 0) { throw new LaunchException(null, null, R("LSFatal"), R("LCInit"), R("LFatalVerification"), "No jars!"); } */ 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.size() == 0) 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.size() != 0) 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.size() == 0)); // 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 (!jcv.allJarsSigned()) { 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; } } 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. } 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(); } final SecurityDesc jarSecurity = securityDelegate.getCodebaseSecurityDesc(jarDesc, codebase.getHost()); if (jarSecurity.getSecurityType().equals(SecurityDesc.SANDBOX_PERMISSIONS)) { containsUnsignedJar = true; } else { containsSignedJar = true; } jarLocationSecurityMap.put(jarDesc.getLocation(), jarSecurity); } if (containsSignedJar && containsUnsignedJar) { checkPartialSigningWithUser(); } activateJars(initialJars); } /*** * 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 */ public String checkForAttributeInJars(List jars, Attributes.Name name) { if (jars.isEmpty()) { return null; } String result = null; // Check main jar JARDesc mainJarDesc = ResourcesDesc.getMainJAR(jars); 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 * @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; } /** * Returns 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); // Initialize streams InputStream inStream = null; InputStreamReader inputReader = null; FileReader fr = null; InputStreamReader jnlpReader = null; 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"); inStream = jarFile.getInputStream(je); inputReader = new InputStreamReader(inStream); OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "Creating File InputStream from lauching JNLP file"); JNLPFile jnlp = this.getJNLPFile(); URL url = jnlp.getFileLocation(); File jn = null; // If the file is on the local file system, use original path, otherwise find cached file if (url.getProtocol().toLowerCase().equals("file")) jn = new File(url.getPath()); else jn = CacheUtil.getCacheFile(url, null); fr = new FileReader(jn); jnlpReader = fr; // Initialize JNLPMatcher class 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(inputReader, jnlpReader, false); } 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(inputReader, jnlpReader, true); } // 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 */ } finally { //Close all streams StreamUtils.closeSilently(inStream); StreamUtils.closeSilently(inputReader); StreamUtils.closeSilently(fr); StreamUtils.closeSilently(jnlpReader); } 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. */ public void setApplication(ApplicationInstance app) { if (this.app != null) { OutputController.getLogger().log(new IllegalStateException("Application can only be set once")); return; } this.app = app; } /** * Returns the JNLP app for this classloader */ public ApplicationInstance getApplication() { return app; } /** * Returns the JNLP file the classloader was created from. */ public JNLPFile getJNLPFile() { return file; } /** * Returns the permissions for the CodeSource. */ 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(cs.getLocation().getHost(), "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). */ 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") 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. 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.getHost()); 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()); } jarFile.close(); } 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()); 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); jarFile.close(); } 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. */ 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. */ protected Class findLoadedClassAll(String name) { for (JNLPClassLoader loader : loaders) { Class result = null; 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 */ 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() { 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() { public Void run() throws Exception { jcv.add(jars, tracker); checkTrustWithUser(); final SecurityDesc security = securityDelegate.getJarPermissions(file.getCodeBase().getHost()); 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>() { public Class run() throws ClassNotFoundException { return JNLPClassLoader.super.findClass(fName); } }, getAccessControlContextForClassLoading()); } else { return loader.findClass(name); } } catch (ClassNotFoundException ex) { } catch (ClassFormatError cfe) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, cfe); } catch (PrivilegedActionException pae) { } 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 resources = findResourcesBySearching(name); try { // if not found, load all lazy resources; repeat search while (!resources.hasMoreElements() && addNextResource() != null) { resources = findResourcesBySearching(name); } } catch (LaunchException le) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, le); } return resources; } /** * Find the resources in this, the parent, or the extension * class loaders. */ private Enumeration findResourcesBySearching(String name) throws IOException { List resources = 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>() { public Enumeration run() throws IOException { return JNLPClassLoader.super.findResources(fName); } }, getAccessControlContextForClassLoading()); } catch (PrivilegedActionException pae) { } } else { e = loader.findResources(name); } final Enumeration fURLEnum = e; try { resources.addAll(AccessController.doPrivileged( new PrivilegedExceptionAction>() { 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 (resources.isEmpty() && codeBaseLoader != null) { e = codeBaseLoader.findResources(name); while (e.hasMoreElements()) resources.add(e.nextElement()); } return Collections.enumeration(resources); } /** * 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.size() == 0) { 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 /** * @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; } /** * @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.getCodeBase().toString())) approved = true; else if (SecurityDesc.ALL_PERMISSIONS.equals(security.getSecurityType())) approved = true; if (approved) { if (foundLoader == null) foundLoader = this; if (action == DownloadAction.DOWNLOAD_TO_CACHE) { JARDesc jarToCache = new JARDesc(ref, resourceVersion, null, false, true, false, true); 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(u.getHost(), "connect, accept")); } } // Permissions for codebase urls (if there is a loader) if (codeBaseLoader != null) { for (URL u : codeBaseLoader.getURLs()) { permissions.add(new SocketPermission(u.getHost(), "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 String codebaseHost); public SecurityDesc getClassLoaderSecurity(final String codebaseHost) throws LaunchException; public SecurityDesc getJarPermissions(final String 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; } public boolean isPluginApplet() { return classLoader.file instanceof PluginBridge; } public SecurityDesc getCodebaseSecurityDesc(final JARDesc jarDesc, final String 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(); } } } public SecurityDesc getClassLoaderSecurity(final String 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); } } } public SecurityDesc getJarPermissions(final String 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); } } public void setRunInSandbox() throws LaunchException { if (promptedForSandbox || classLoader.security != null || classLoader.jarLocationSecurityMap.size() != 0) { 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 this.promptedForSandbox = true; this.runInSandbox = true; } public void promptUserOnPartialSigning() throws LaunchException { if (promptedForPartialSigning || JNLPRuntime.isTrustAll()) { return; } promptedForPartialSigning = true; UnsignedAppletTrustConfirmation.checkPartiallySignedWithUserIfRequired(this, classLoader.file, classLoader.jcv); } public boolean getRunInSandbox() { return this.runInSandbox; } public boolean userPromptedForPartialSigning() { return this.promptedForPartialSigning; } public boolean userPromptedForSandbox() { return this.promptedForSandbox; } public void addPermission(final Permission perm) { classLoader.addPermission(perm); } public void addPermissions(final PermissionCollection perms) { Enumeration e = perms.elements(); while (e.hasMoreElements()) { addPermission(e.nextElement()); } } 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.5.3/netx/net/sourceforge/jnlp/runtime/PaxHeaders.24993/FakePacEvaluator.java0000644000000000000000000000013212574544466026216 xustar0030 mtime=1441974582.581016969 30 atime=1441974656.382866514 30 ctime=1441974670.085024242 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/runtime/FakePacEvaluator.java0000664000076400007640000000412512574544466027301 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/runtime/PaxHeaders.24993/CachedJarFileCallback.java0000644000000000000000000000013212574544466027062 xustar0030 mtime=1441974582.581016969 30 atime=1441974656.382866514 30 ctime=1441974670.085024242 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/runtime/CachedJarFileCallback.java0000664000076400007640000001474212574544466030153 0ustar00jvanekjvanek00000000000000/* 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.security.AccessController; import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; 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; /* get the stream before asserting privileges */ final InputStream in = url.openConnection().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(); } return result; } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/runtime/PaxHeaders.24993/Boot.java0000644000000000000000000000013212574544466023744 xustar0030 mtime=1441974582.581016969 30 atime=1441974656.382866514 30 ctime=1441974670.085024242 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/runtime/Boot.java0000664000076400007640000003306112574544466025030 0ustar00jvanekjvanek00000000000000// 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.io.File; import java.net.URL; import java.security.AccessController; import java.security.PrivilegedAction; import java.util.ArrayList; 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.Launcher; 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.logging.OutputController; import sun.awt.AppContext; import sun.awt.SunToolkit; /** * 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 final String itwInfoMessage = "" + nameAndVersion + "\n\n* " + R("BAboutITW") + "\n* " + R("BFileInfoAuthors") + "\n* " + R("BFileInfoNews") + "\n* " + R("BFileInfoCopying"); private static final String helpMessage = "\n" + "Usage: " + R("BOUsage") + "\n" + " " + R("BOUsage2") + "\n" + "\n" + "control-options:" + "\n" + " -about " + R("BOAbout") + "\n" + " -viewer " + R("BOViewer") + "\n" + "\n" + "run-options:" + "\n" + " -version " + R("BOVersion") + "\n" + " -arg arg " + R("BOArg") + "\n" + " -param name=value " + R("BOParam") + "\n" + " -property name=value " + R("BOProperty") + "\n" + " -update seconds " + R("BOUpdate") + "\n" + " -license " + R("BOLicense") + "\n" + " -verbose " + R("BOVerbose") + "\n" + " -nosecurity " + R("BONosecurity") + "\n" + " -noupdate " + R("BONoupdate") + "\n" + " -headless " + R("BOHeadless") + "\n" + " -strict " + R("BOStrict") + "\n" + " -xml " + R("BOXml") + "\n" + " -allowredirect " + R("BOredirect") + "\n" + " -Xnofork " + R("BXnofork") + "\n" + " -Xclearcache " + R("BXclearcache") + "\n" + " -Xignoreheaders " + R("BXignoreheaders") + "\n" + " -help " + R("BOHelp") + "\n"; private static final String doubleArgs = "-basedir -jnlp -arg -param -property -update"; private static String args[]; // avoid the hot potato /** * Launch the JNLP file specified by the command-line arguments. */ public static void main(String[] argsIn) { args = argsIn; if (AppContext.getAppContext() == null) { SunToolkit.createNewAppContext(); } if (null != getOption("-headless")) { JNLPRuntime.setHeadless(true); } String[] properties = getOptions("-property"); if (properties != null) { for (String prop : properties) { try { PropertyDesc propDesc = PropertyDesc.fromString(prop, "Unlocalised error for parsing the property. It must be in fomrat key=value. It is: " + prop); JNLPRuntime.getConfiguration().setProperty(propDesc.getKey(), propDesc.getValue()); } catch (LaunchException ex) { OutputController.getLogger().log(ex); } } } DeploymentConfiguration.move14AndOlderFilesTo15StructureCatched(); if (null != getOption("-viewer")) { try { CertificateViewer.main(null); JNLPRuntime.exit(0); } catch (Exception e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); } } if (null != getOption("-version")) { OutputController.getLogger().printOutLn(nameAndVersion); JNLPRuntime.exit(0); } if (null != getOption("-license")) { OutputController.getLogger().printOutLn(miniLicense); JNLPRuntime.exit(0); } if (null != getOption("-help")) { OutputController.getLogger().printOutLn(helpMessage); JNLPRuntime.exit(0); } if (null != getOption("-about")) { OutputController.getLogger().printOutLn(itwInfoMessage); if (null != getOption("-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(); return; } } if (null != getOption("-verbose")) JNLPRuntime.setDebug(true); if (null != getOption("-update")) { int value = Integer.parseInt(getOption("-update")); JNLPRuntime.setDefaultUpdatePolicy(new UpdatePolicy(value * 1000l)); } if (null != getOption("-noupdate")) JNLPRuntime.setDefaultUpdatePolicy(UpdatePolicy.NEVER); if (null != getOption("-Xnofork")) { JNLPRuntime.setForksAllowed(false); } if (null != getOption("-Xtrustall")) { JNLPRuntime.setTrustAll(true); } if (null != getOption("-Xtrustnone")) { JNLPRuntime.setTrustNone(true); } if (null != getOption("-Xignoreheaders")) { JNLPRuntime.setIgnoreHeaders(true); } if (null != getOption("-allowredirect")) { JNLPRuntime.setAllowRedirect(true); } JNLPRuntime.setInitialArgments(Arrays.asList(argsIn)); AccessController.doPrivileged(new Boot()); } /** * The privileged part (jdk1.3 compatibility). */ public Void run() { JNLPRuntime.setSecurityEnabled(null == getOption("-nosecurity")); 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 (null != getOption("-Xclearcache")) { CacheUtil.clearCache(); return null; } Map extra = new HashMap(); extra.put("arguments", getOptions("-arg")); extra.put("parameters", getOptions("-param")); extra.put("properties", getOptions("-property")); ParserSettings settings = ParserSettings.setGlobalParserSettingsFromArgs(args); try { Launcher launcher = new Launcher(false); launcher.setParserSettings(settings); launcher.setInformationToMerge(extra); launcher.launch(getFileLocation()); } catch (LaunchException ex) { // default handler prints this } catch (Exception ex) { OutputController.getLogger().log(ex); fatalError(R("RUnexpected", ex.toString(), ex.getStackTrace()[0])); } return null; } private 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. */ private static URL getFileLocation() { String location = getJNLPFile(); if (location == null) { OutputController.getLogger().printOutLn(helpMessage); 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 url = new URL(ServiceUtil.getBasicService().getCodeBase(), 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 getJNLPFile() { if (args.length == 0) { OutputController.getLogger().printOutLn(helpMessage); JNLPRuntime.exit(0); } else if (args.length == 1) { return args[args.length - 1]; } else { String lastArg = args[args.length - 1]; String secondLastArg = args[args.length - 2]; if (doubleArgs.indexOf(secondLastArg) == -1) { return lastArg; } else { OutputController.getLogger().printOutLn(helpMessage); JNLPRuntime.exit(0); } } return null; } /** * Return value of the first occurence of the specified * option, or null if the option is not present. If the * option is a flag (0-parameter) and is present then the * option name is returned. */ private static String getOption(String option) { String result[] = getOptions(option); if (result.length == 0) return null; else return result[0]; } /** * Return all the values of the specified option, or an empty * array if the option is not present. If the option is a * flag (0-parameter) and is present then the option name is * returned once for each occurrence. */ private static String[] getOptions(String option) { List result = new ArrayList(); for (int i = 0; i < args.length; i++) { if (option.equals(args[i])) { if (-1 == doubleArgs.indexOf(option)) result.add(option); else if (i + 1 < args.length) result.add(args[i + 1]); } if (args[i].startsWith("-") && -1 != doubleArgs.indexOf(args[i])) i++; } return result.toArray(new String[result.size()]); } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/runtime/PaxHeaders.24993/ApplicationInstance.java0000644000000000000000000000013212574544466026771 xustar0030 mtime=1441974582.580016957 30 atime=1441974656.382866514 30 ctime=1441974670.085024242 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/runtime/ApplicationInstance.java0000664000076400007640000002703012574544466030054 0ustar00jvanekjvanek00000000000000// 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.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 JNLPFile file; /** the thread group */ private ThreadGroup group; /** the classloader */ private 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 AppContext appContext; /** whether the application has stopped running */ private boolean stopped = false; /** weak list of windows opened by the application */ private WeakList weakWindows = new WeakList(); /** list of application listeners */ private 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. */ 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 */ public void addApplicationListener(ApplicationListener listener) { listeners.add(ApplicationListener.class, listener); } /** * Remove an Application Listener */ 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(); //Fixme: -Should check whether a desktop entry already exists for // for this jnlp file, and do nothing if it exists. // -If no href is specified in the jnlp tag, it should // default to using the one passed in as an argument. addMenuAndDesktopEntries(); } /** * Creates menu and desktop entries if required by the jnlp file */ private void addMenuAndDesktopEntries() { XDesktopEntry entry = new XDesktopEntry(file); ShortcutDesc sd = file.getInformation().getShortcut(); File possibleDesktopFile = entry.getLinuxDesktopIconFile(); if (possibleDesktopFile.exists()) { OutputController.getLogger().log("ApplicationInstance.addMenuAndDesktopEntries(): file - " + possibleDesktopFile.getAbsolutePath() + " already exists. Not proceeding with desktop additions"); return; } if (shouldCreateShortcut(sd)) { entry.createDesktopShortcut(); } if (sd != null && sd.getMenu() != null) { /* * Sun's WebStart implementation doesnt seem to do anything under GNOME */ OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "ApplicationInstance.addMenuAndDesktopEntries():" + " Adding menu entries NOT IMPLEMENTED"); } } /** * 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 boolean shouldCreateShortcut(ShortcutDesc sd) { if (JNLPRuntime.isTrustAll()) { return (sd != null && sd.onDesktop()); } String currentSetting = JNLPRuntime.getConfiguration() .getProperty(DeploymentConfiguration.KEY_CREATE_DESKTOP_SHORTCUT); boolean createShortcut = false; /* * check configuration and possibly prompt user to find out if a * shortcut should be created or not */ if (currentSetting.equals(ShortcutDesc.CREATE_NEVER)) { createShortcut = false; } else if (currentSetting.equals(ShortcutDesc.CREATE_ALWAYS)) { createShortcut = true; } else if (currentSetting.equals(ShortcutDesc.CREATE_ASK_USER)) { if (SecurityDialogs.showAccessWarningDialog(AccessType.CREATE_DESTKOP_SHORTCUT, file)) { createShortcut = true; } } else if (currentSetting.equals(ShortcutDesc.CREATE_ASK_USER_IF_HINTED)) { if (sd != null && sd.onDesktop()) { if (SecurityDialogs.showAccessWarningDialog(AccessType.CREATE_DESTKOP_SHORTCUT, file)) { createShortcut = true; } } } else if (currentSetting.equals(ShortcutDesc.CREATE_ALWAYS_IF_HINTED)) { if (sd != null && sd.onDesktop()) { createShortcut = true; } } return createShortcut; } /** * 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). */ 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() { public Object run() { for (PropertyDesc propDesc : props) { System.setProperty(propDesc.getKey(), propDesc.getValue()); } return null; } }; AccessController.doPrivileged(installProps, acc); } /** * Returns the JNLP file for this task. */ public JNLPFile getJNLPFile() { return file; } /** * Returns the application title. */ public String getTitle() { return file.getTitle(); } /** * Returns whether the application is running. */ 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. * * @throws IllegalStateException if the app is not running */ public ThreadGroup getThreadGroup() throws IllegalStateException { if (stopped) throw new IllegalStateException(); return group; } /** * Returns the classloader. * * @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. */ protected void addWindow(Window window) { weakWindows.add(window); weakWindows.trimToSize(); } /** * Returns whether or not this jar is signed. */ public boolean isSigned() { return isSigned; } public AppContext getAppContext() { return appContext; } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/runtime/PaxHeaders.24993/AppletInstance.java0000644000000000000000000000013212574544466025753 xustar0030 mtime=1441974582.579016946 30 atime=1441974656.382866514 30 ctime=1441974670.085024242 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/runtime/AppletInstance.java0000664000076400007640000000747312574544466027047 0ustar00jvanekjvanek00000000000000// 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 */ private AppletEnvironment environment; /** * Create a New Task based on the Specified URL */ 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. */ public void setApplet(Applet applet) { if (this.applet != null) { OutputController.getLogger().log(new IllegalStateException("Applet can only be set once.")); return; } this.applet = 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. */ public void setResizable(boolean resizable) { Container c = environment.getAppletFrame(); if (c instanceof Frame) ((Frame) c).setResizable(resizable); } /** * Returns whether the applet is resizable. */ public boolean isResizable() { Container c = environment.getAppletFrame(); if (c instanceof Frame) return ((Frame) c).isResizable(); return false; } /** * Returns the application title. */ public String getTitle() { return getJNLPFile().getApplet().getName(); } /** * Returns the applet environment. */ public AppletEnvironment getAppletEnvironment() { return environment; } /** * Returns the applet. */ public Applet getApplet() { return applet; } /** * Stop the application and destroy its resources. */ 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.5.3/netx/net/sourceforge/jnlp/runtime/PaxHeaders.24993/AppletEnvironment.java0000644000000000000000000000013212574544466026513 xustar0030 mtime=1441974582.579016946 30 atime=1441974656.382866514 30 ctime=1441974670.085024242 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/runtime/AppletEnvironment.java0000664000076400007640000002455212574544466027604 0ustar00jvanekjvanek00000000000000// 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 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. */ 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. */ 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(); } } /** * Returns 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 * */ 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 ie) { } catch (InvocationTargetException ite) { } } 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. */ 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 })); } /** * Returns 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. */ @Override public Image getImage(URL location) { checkDestroyed(); //return Toolkit.getDefaultToolkit().createImage(location); Image image = (new ImageIcon(location)).getImage(); return image; } /** * Not implemented yet. */ @Override public void showDocument(java.net.URL uRL) { checkDestroyed(); } /** * Not implemented yet. */ @Override public void showDocument(java.net.URL uRL, java.lang.String str) { checkDestroyed(); } /** * Not implemented yet. */ @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.5.3/netx/net/sourceforge/jnlp/runtime/PaxHeaders.24993/AppletAudioClip.java0000644000000000000000000000013212574544466026060 xustar0030 mtime=1441974582.579016946 30 atime=1441974656.381866503 30 ctime=1441974670.085024242 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/runtime/AppletAudioClip.java0000664000076400007640000000562312574544466027147 0ustar00jvanekjvanek00000000000000// 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.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/resources0000644000000000000000000000013212574544466022450 xustar0030 mtime=1441974582.578016934 30 atime=1441974670.156025059 30 ctime=1441974670.085024242 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/resources/0000775000076400007640000000000012574544466023606 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/netx/net/sourceforge/jnlp/resources/PaxHeaders.24993/warning.png0000644000000000000000000000013212574544466024700 xustar0030 mtime=1441974582.578016934 30 atime=1441974656.381866503 30 ctime=1441974670.085024242 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/resources/warning.png0000664000076400007640000000250212574544466025760 0ustar00jvanekjvanek00000000000000‰PNG  IHDR77¨ÛÒFsRGB®ÎébKGDÿÍ3Y(Z pHYs  šœtIMEØ  ;ü•Ï.tEXtCommentCreated with GIMPWIDAThÞíZÏ‹Eþ^Ϭ»¢ ;ÙÓK„……%Cn= ô"‚Goþžÿ _~õ¬¸ÿñ»kx÷Í’A{žãË$Ë@LjñG•ÇãGQžœµïrÅOŽB‹ µðí+½Êãíž;át{^§r$¡Å"ÀVÕ¿ï¯ÙT}ɨ€0§-Èd`ܰ_Íš˜Oíó:aê·ÀÃÝ*8ßï[ñæü_àÊšf²`HÎ÷Kpƒ-ë^µöa>‹×™©,÷ý5;SÀ G‹WÊ‘ìbÊmO“¥oì{ÑÎÅ»¥­ Ã’Üúº‡Á–§˜ëËÑwTûÎÅ?? ‘&@¢®4’HS€µ+Mf€þ^¿Çl!Q’ª}Þ¹ä˜D@Qıº¢òŠò+.îý½¬pïïzå÷£¸œ'Ÿ+ÉçKÔ}’9sνe&Ç'×BDq5 iLÚ þ®’åeÀ¬óíFœcö¾s¦Æ™^ ‘ÄFŠË:Z|¸M g,å«¶j$‰%‚ÿ¼’ÿÇh€ý™äGp•\{äï¨l¹ÏCr{BFRŽàñÕÞx<êœ9þmwÊÆp7`ˆá_Qà ³û`…(K8æ{hömQ¿=kqéI& 5K[Ñp+Åk¯› %Yê`JÆJõø÷AHÏG]0—%‘_6BÄÿ .4¤ã$Üx“ñÅ'¯hÉÄ`…ɹ«ÈÄ@3³×ôWž€Oz¡¹-±VAFìèIÁ£3Z,ØLB ’%ݘæìŸ‡¹Àí ­%©t#êyÊõÝ·p7×'-~°Ò[ÑèªaR:$Ãù-Áµ‡©×ɲ²O¿Nq6Í~>ß|Ë÷€ ÷&ŽíQ {ž(Çû½°±kÁ"ßU¿5ùÇ1Œq ZÌñ‰ŒqáLdK•€ß/­õÞ£Ö[kS+¼[è,Õ$¤T“TØ-'fÆÝ{Àé˜ñö-Âáuj=Ö™YÍfèfb•† ¸Bަ®]Ç®,ÙôLU7¾¦[Ó§›² Dé¹b€Z¹œ„¨E­ãæ¸}+âUb­MC /↌ʎX¢VÉQ ¹>³à Ír ½sô¤“-®a‹Î!áÜNÓbÎP–Ü^šÿJZÙÊV¶²•ubÿª#!ÔŸ“'µIEND®B`‚icedtea-web-1.5.3/netx/net/sourceforge/jnlp/resources/PaxHeaders.24993/warning-small.png0000644000000000000000000000013212574544466026006 xustar0030 mtime=1441974582.578016934 30 atime=1441974656.381866503 30 ctime=1441974670.085024242 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/resources/warning-small.png0000664000076400007640000000214312574544466027067 0ustar00jvanekjvanek00000000000000‰PNG  IHDR;0®¢sRGB®ÎébKGDÿÍ3Y(Z pHYs  šœtIMEØ "ÈWª+tEXtCommentCreated with GIMPW¾IDATHÇí–]h\EÇs?ö+ÉÞ›äîn’MHhM71±M£Õ’@[¤µFª( ¥Ô¦Ñˆ$­ÁÛŠÄ*RE(‚±ˆD­JLQZA´RИB± "Ô ‰m6»{ïøp³ÉÝÍ&æË¾èÃÌœ™3ÿó5ð_#uº%@p{µÊÊAÍ¡÷ªû®_ÝrˆÞ±(5lñ·NOÜ}#5Ù4uöLå³ëŒÜŠ)>~-1,§›¥œn–ã×ÃÀ=ÿv¨Á“±Gb1m'rΊ*ýÁËÛúc5‰UÙ˜þ³é[M!ïDÆ–·uó§ûŸçŠmã¿’Bû'àP_oéîÆGN)JЧ ,KË­…DZ¾²öõWœ>YñrQH©Éf)Õ(.V0ŠkÐÜ\QP©9zØ<Ô­8zéóº°! AJZ0à V¹Šiª¹S@kK°÷Ãó5ËÚRÀ¾Çö·îتu«™´T R)H§ç8…Q$±ÊŒ ™ŒË¶ÛªŽãÛ·+Ð T®¸æý7ͳz&iœä Ì&ñö ˘Ԃ<™t×ÍÎ`R¿é"…´2ýƒ×C†žJž0zNˆ~›Ú (Öf!™g¿¨à{b¯úð0™ÿtæŸ7}{ƒ¸ï‹s·ËMѳ"׈LFòû¤$SXX'í:zÝj:ð×sÀÍå>‘¯Î)§«-g¶Í<;¶›?;3'sû*6ºÈ l;/Ï ãÒ"»þ®jþøtD^Ò…€K†EoÛ6ñ´*„é»Ç­îþWz^tð©’öm¸Õ.%8Çeé  µxDZWÆäå¿1‘_\Ú®Vn=º*J¼Å<çÑ/ã’[Iøub‰÷N,èZ¥âÞ§»²|c#ï(oTFD{¨ð°W&áfA{ <Ù!‰Åà2wœ¨eGÀÇè—ß1HàÕãâ¡x”¶œÛIðÖãM¢Nph¿B<"VôâûuQÞµW¬l¨ã÷‰.Ÿ.ÌEÖŠ% È7eæ<ýªÛ½çøö×?ÈEAÏQ6(òÖ{ö¸pQ~$½ö†Vù Z+9À ÿÓ¤¿Ô3GCy¶•IEND®B`‚icedtea-web-1.5.3/netx/net/sourceforge/jnlp/resources/PaxHeaders.24993/showDownloadDetails.png0000644000000000000000000000013212574544466027211 xustar0030 mtime=1441974582.578016934 30 atime=1441974656.381866503 30 ctime=1441974670.085024242 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/resources/showDownloadDetails.png0000664000076400007640000000153412574544466030275 0ustar00jvanekjvanek00000000000000‰PNG  IHDR‰ bKGDÿÔATò pHYs  šœtIMEÝ 8sÚ¸ƒiTXtCommentCreated with GIMPd.eÀIDAT8Ë•”MhSY†Ÿsï¤Ú Ózm’K% þPÈF¢âΛa6Ã4ƒdt–M‚Ën Ö2³w'(LAº©¸+….¦k- HÛ±¢2ÌMšIÇVªÝä†×…M‰mc2/Îâ^žó~ç{χ$ö[AP2™T&“Q¿ …‚ÇùÁ²¬AÛ¶¿éèè8ÛÝÝÝ[("’,I–‘Änc|×uƒ‰‰ úúú(•J‹Å=ûÔÔÔàIÛ¶¿Ãpn_w€fffÔ®FFFH’Õ X*‹mÁ¶¯¦bÛvVÍ€‹ mÁ\×Uö)àääädK àfµZ¥V«! +çïd’ÿòyþ¼wßÇ©¬®®ÒJA\‹D"þòò2årçúu~¾pÏâq"€0 ÿYYYi ô}Ÿ Ül6û N;;;ûpß’-Ëh»ËõÆ>'Nè#G´™Ë©|åŠþݾÃ\.—ÓÿÑttT÷ÇÆôË£GZZ_×Ñmà™L&³ûgAÐ:MºœL$lŒu]·)tÇá©SzÚÓ£uÏӻ˗µ64¤uÀê/ ø[[[>PÙ ­çð¹{W?NOë§¹9M¿~­³ .ýíœù’¨V«ÌÏÏ{ÑhôËF§ iìV ð]×ý¨‚ú7‹éUO›µ‡ß¾¥ëüy6ž<Á=~œj,F˜NóÛ³gŒÝ¾Í¬ç™!à…¤;Æ€¬¤‡;“êÖ-}õü9gz{ù<ŸG–…wìßE"†P.3ŒÇãlE"&ü*©Ô,ìæêU}=>NååKŽnlŠF‰'lXYO»º><ÇveGK”¡Ûuysàkk¤<Í7X¼x‘ïïM`Ǥ;{€§O+uî‡R)%ÄI_ºÄ›Ç99<Ìð>Ó<ÙÜSú{0@º+®dIEND®B`‚icedtea-web-1.5.3/netx/net/sourceforge/jnlp/resources/PaxHeaders.24993/question.png0000644000000000000000000000013212574544466025102 xustar0030 mtime=1441974582.577016923 30 atime=1441974656.381866503 30 ctime=1441974670.085024242 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/resources/question.png0000664000076400007640000000474012574544466026170 0ustar00jvanekjvanek00000000000000‰PNG  IHDR77¨ÛÒFsRGB®ÎébKGDÿÿÿ ½§“ pHYs  šœtIMEÛ:‡k,tEXtCommentCreated with GIMPW ;IDAThÞíZmlåÿ=wöÝù5±×…&éÚ”z}hc+¤ ‚ŠHtKY5Á¦¡û0iDlh*]'„´ÝŠÄЍÒmlR"¤n“&Qi !CíÒ¤/i»Ì-mÒ&nlçâ·³ïÙßïÛ9'v´N{¤³ïþ÷ÜsÏïÿþžþßnÍF–æ5«øë¾bOÊS>‹ßïûóÔR¼•]‚wx×>öýgíÁæG–…:ºyÎýÅlr&‘¼ùù€Ü-+9¨3زyçÏÊ/oc­v'kåù\:‘HDÇ/ßíß?üÎÏÈÜr’ó‡:ƒË7uí ¬ßú¨àô,V^ ca8ÞÆ»š‚³i Ã;œ7/}:P/ Ö œwÕƒÏîmíøö“¬•·©:B@aa!œËãk\±aãä¹þñtìú?o pþPg0ÔõÂKÁw±X©F 'Øo»««cê\ÿT²5·±¯îÜãmÙÎÙÜÞy-œ¬U°ßö¥®Ž©óý7R±ëgj©¢ì’£e&aåíþöûB6ÿŠÌ䙇j]`&çhôñßj›oEfòlm²ÿ À µÈ.Øæ{ükM#Õ¬&õªûü_•®[×€ÝY¨2ºþ¼œç4΄ “ˆE>þ͎碗‡–·Ö:H®"0³ì#eΠ¬1L,È‹²u¶˜F–ãíþ5÷…lÞ…Ù [SçAjŸ­röùmpÑà´\qÃÖGMKŒ”8ÊÑ+œÓãklÙ°qê\ÿx5™ŒY>{7ìxy_[çSßÒì¢\`ÖѸ «íhñY`çD9œÈà½S³¸4))9§ò-SÎ(NfïŽç¢—‡þd¦š`ÍH,ÔõÂKÁMJ®h’6¿x܇m뜸-¬ X†ÀÁ3hñYñPÈÅðÕ ²² ÖS€µ(™ŒÉ8ÈÖ\° ðòMXéçÊ« !XµŒÃJ¿&Më–™8h\¡l)Îîç±¥GÖ9ðàv­»”£Ká 6ŽÀÉ3Ú½æ ÆcY„#ÙÒ㣴 zZòåR¥0Á.ªl)Ó~°¥^G~èlŽâùw¦päô,ÆRøÛð,.­MV­¿“gðÁùdu1Ì„Š²µÎ<Óіɳý“±Žœž-˜.NJxl£S£98‡OŠ5ÏE-41™øèúüäpaqk:1Wc¬E,µ,"Ãu,kmo^¿õG0rx÷z/ª ël¾»©­ãÉÝu|s1™¥ÀtBÖŽ¤Dçðᙎ´ú jyþzGÏ% Ðbw{­vO›ÐˆO €jÙ¬?tïCž–»¶X¬Î†zeTøáýèl·èo}V½Jê½(!6ßòV÷òµ]-_{z•Q-ÁÙÐj±»=„!Œé¯ÏæiåÔÀÅüt›¡fÞ@?p<†SWÒåÇGAÝiñ;Õª„X­‚Ãî]þ…ËoÚçØœl2™]!À·z À¤ÅoFñÑ…dé爑q”–È] @‰B*tÈKéúP*#FÃR"¥2•¬we²—Îv6Ý!h׉ŒŒŸ½Aß…d~‚Ê$©™±©îP¥")ÒñHTpùfŠ%—›éÿ{ãí«ïüÁjŠÆ@ZP…‘ ”¢cµ1TöžˆáìxFG~æ4Wƒ.ÔÆÓ$§{FÏlZŒŽÞýÇTlââo™'9)ñ™•wO°±ò6u,BôÞ*Z®{ê&AòýÕk…ÃOon€+˜ò«G£H¦ó÷‰6ÑÂd©L;Qh²‚XVJzJ œ”L"9±ïÏǯ9 WnCœ›<Ó7`— `™ë¨&Žü€T™8UÐB œ$êД€*àà rrñYY[w ªhä¼ÝPåY€*Ò,a׺ùH‰xäãßu÷įŽô÷$åÒ¯;îQ‚¹àòê_PlóšôhÑ=#O 7õ•¦êuÑ8¢à¥†òHJÆ#¯w÷į÷–rm%sƒÄdXÌNÏ ZΠànncXÞFe#¢^+ÿToè²ÎN(ðÄÝN¬mæ´ãìµ ˆf§ziÌ¡Q’7õ\[JÄ#Ÿ¾ÞÝ¿Vص4¨h¸ob¥€¯½s;Ç)é˜NJ´B(Г¿÷uc^ðö'¢æ´)`4^e©L%)Šš—ª"V) ¾QXEpÀ>ìB6Ð*¸½z½Ò«ŠUª‚_W¹O‹uÕ 2¢õ)ŒI ¥ã‘ôv÷ÄÇ+›œ pصJüíÛ­| ¥sc/ÕO’òåbÇ €žU1¥Ÿ”ŠGßÝ3c˜)p÷M\v@ÓÊÎíVÁåU½¡aÙC/IZˆ[ïþ\ÇŒ"Ý.šcŸV ÷7ÿ5zmèÐfƇß4»HkºØbaqfFl® ï ¶1 oÓ;ª„*œ -ã`Šizq˜½qáè+c}¿Ü‡*¶™«ª¤¤XXœ™y¾P?ií_79bP?b TTÔIõ^™ ›š‰ ½ý'N:ˆ*÷Ï«.¥XXâ Ϲ‚¼3踬e*-—Ke€êÏe%œä Ï©tõ<½r²wÿäù#¯a,¨–baQLŠƒç òŽ`ax[¥xW|P”ʉé±Ñ©±£¯üûØ\U4»Ë³à_Š…E1%r¼+(؃m¤h!‰”)ñè<塨¥ŒËZånØ¢÷ç¤XXœM‹ƒç ÚœÁ6FHªÜèÑžXÝÕrÀL ï ¶±–|5af_„ÔXMÀéò:€ÅªFæ©mk ¬fàŠ :5³ÃU`5§œ¼ð—ã¼ûö5îàÆõ¥VÆU”*-›ŽG†Þýî‹×GªcK NiÉÈØûï[þ`ñ–7Q~²éxää¡=âá^Ôáû¯z}û•Jæ²Ç‰”^aoliÖT”Rš_¶ $1=6zåÔÁý“£G^Ã-öa¤XXLæ2Ç8δð*çd€œ4;“Œ]¾8îÛW*@ײÕýKYDz{þöžâÝËW3 טKÇ'Òñ«'¿>\O`KÙx‹àiÀÒ|¡û¿ÝþkŠ· \WcIEND®B`‚icedtea-web-1.5.3/netx/net/sourceforge/jnlp/resources/PaxHeaders.24993/netx-icon.png0000644000000000000000000000013212574544466025137 xustar0030 mtime=1441974582.577016923 30 atime=1441974656.380866491 30 ctime=1441974670.085024242 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/resources/netx-icon.png0000664000076400007640000000105312574544466026217 0ustar00jvanekjvanek00000000000000‰PNG  IHDRóÿabKGDùC» pHYs  d_‘tIMEÓ 1N³v¸IDATxœ¥“±ŠQ†¿Œ…a†% 2E&Â@ì´ˆ© "I•°i¶ÒÂ'°Êä|戰YI%¤Š.Ìf5LÖ V[‹ cÜÝfÿêÞïÞûÏ?çž+arÝÈÝnw ó¦—ñLbfý$IžÄq\‚àPSÕ—ÍfócÇwRþSDöwMÄ̆"b@/eC3+ˆÈYÆ‹Å×ù|þh7AAU{›ÍæVŽõDän’$E3û“²I'Õ à8ÎÙo¸®û@D>¥óåE‡·—¨¼¿bÈÝBªaE?|ß?H ò:ít:} «Ã¡ª²§ÛÏV*AEoãÜឈ¼˜N§ÏEd_Dêÿ$F·ÓùãÕjuäû~ÏÌ~‹È3ài¶Ùó¼›Àñz½þÔ¶®ën€!@©TrÃ0DUf†ˆ|^T«Õ‡ãñø]¹\>Èú¡Ðjµ¾™YÑÌŠŽãüHÿ`˜d)Úíö=3ËÖΨêà¿ò"Ò³ÙìM½^h YšY_U»·°« °ô<ï>ç½0Lù¶ÀWÔÌl/6³|—Uõ5€\÷9ÿÊa£užnnIEND®B`‚icedtea-web-1.5.3/netx/net/sourceforge/jnlp/resources/PaxHeaders.24993/jamIcon.jpg0000644000000000000000000000013212574544466024607 xustar0030 mtime=1441974582.577016923 30 atime=1441974656.380866491 30 ctime=1441974670.085024242 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/resources/jamIcon.jpg0000664000076400007640000002452412574544466025677 0ustar00jvanekjvanek00000000000000ÿØÿàJFIFhhÿÛC  !"$"$ÿÀ ©¯ÿÄ ÿĵ}!1AQa"q2‘¡#B±ÁRÑð$3br‚ %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyzƒ„…†‡ˆ‰Š’“”•–—˜™š¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂÃÄÅÆÇÈÉÊÒÓÔÕÖרÙÚáâãäåæçèéêñòóôõö÷øùúÿÚ?û.ŠÊ›YÒ Öít)uHµK¨^X- €M"'Âg;VñŽ»§ø_÷zæ¤e6ÖÈ£Þò»¾ÄŽ0:ÈîêƒÝÇ#­XðíÞ§{¡ÙÞk:QÒ5 ¡qbnV³IÝ7§õ­EQEQE7µ:Š(¦e·}ÚŠYb‚3$’,j nihð úš±EyÀ›ˆüAá¹üo¨J“kzÅÌ‹xŽ 6œÌi§ôR0ÈzÈòÉÿ-)ßn¤—â÷ÃÝêf]Ô×÷z\][DHOPòΣûñFF ^™EQEçÿþ(x'áÍ”Óx[Š;¡øôëyKÙsÓd9é÷ÛŽ5󯋿l›÷imü'àø-Cwª\or0:ÁÜ=ëHý°þ Û5-Ã×ê¿|¤rC#~f+éü9ñWL’;H×EÖ`›JšåM˜ÿYy#Çñlë4QEUyeŠÌ’:ƪæwÚ0xýMX¢¼×Ä~¿·ÕG‰~jñxX’ãí´ŠM޲I ÊG#3pˆdÁïÒ²n³ñcÂLö]øCÇ¿ ‰6ÙgÑï“ï†Øq,!uÏÜ’9ÙÚ¶|ñÎóY—Â^&<9âø$)ö Ÿß×Ù»…óãlÛÇ ŒŸG¢™¹ÇÔœg5óÇÅÚ¿Á^Ô®4}Oºñ5ôD5­Ü)fr9Ù0/¸@†¸û?ÛABo~Oª6Éf·Ö|ÖCô0/ó©þ%~Ö:m÷†ŸMøy£ë°ø‚÷Cqw öRý ¦÷ó$öÆ=ëämvÿU¼Õ¯eÖn¯/5_ý&[¹<ùãã÷’I^“ðzËJÖ4“mÀ­_ÇÚšNê+¬]Cmê‘”<¸Æ;Hÿt>$øEâ›'S»?.ô8ìI/6Ÿ®<’lþ2‘Ï$žgÉÿ<ý+#âŒ_ t¸4Ïüñþ‰¨" “Eýú^@ÄŸÞ òqÝäç¨ô¯_ø1ûXÃq¦ñ.ÝÅË:ĺݪ'’z|ó 8Nÿ:uÏú±Šú¯HÔ,um:-KL½·¿²¸|7³,°¸é”uê=êýQUå–(#2H먙ßhÁàõ5bŠ+ɾ#Ú¯…þ+øOÇÖÏ4vú¥Òxw]Ž$2,±Ììr7hö\l]ã÷¸®ÓÇ~ðÿ´ 4éæöÉÝe$t1º}×WLažÕÌü/×µÔñˆ¼⋆ºÔôŠkK÷Óf/äHÇeØRGEØdæ½.¾:ýª¾$j.ñ•× jú~ŸáûtݯjRñ™#;ÝÁ81„È|ºä,4OαøMÑo–]qã{=l‹U»òöì—Tž@ÿdŒ(2G Ÿ$¨sž¹Cá{Áã}CÁëñCáæeq¼¾5Ù>Ç G,‘‹]Ï“$‘Žq/ S5o…?~hþø›ö]­k:]IˆÉ62$ÛMëƒgýö}+'áW‡â·Æ)N²b°Ó.'¹Ö5É!S VöÊwM·þyŒ‘ý´¯FñŸ<;¤xCJñ& g\[©Á:<­ºX©Ú—s@Ù u>|ß2c&L‘¸8øWŒüYâ_\Awâ}r÷XžöE%Ù»J¿ã-[Á7¿Ù‹á¯Üi[Ù<Ò\j2KöË,âcÉòðÿ>ÏÐW´|Vð†ƒãÝs²ø[ÁÞ?°¸º–ËMÕ5¹ü2ði÷1‘‹¼'ü´äzÜc5á%lj¿gŸŽ àŸ\ÛÃáÝmÕg»d fãgîn#wØc°ŽOÿw_mŒmùih¢«Ë,PFd‘Ö5P73¾ÑƒÀ'êjÅWþÑgü*Ù|¬yŸÛ:>ß÷¿´íkÑ+Î|Im2þÐ^ º¶ERt a.ß»D²X탸üë ø•¬Üøwá·‰µû!ºÓ4‹»Ë`ë¹<È¡wLûe|oàíü)û0O®hÅ­xËÆž ¶Ó­@ˆNmçŽMð©Êdï$~•矴 µ¿ƒ®‘®|ciþ“â E¦’M¯,{ÖAÂya7y2A®ÿö]ø!Ä:÷‹t†ƒÂ± ZÚh.|™¯çˆÎ:Ãï>xü¿œ÷Çñoû)ü*‡R‘Õ|@tÙ³?´ßìÃèBùŸù¾`øñðk_ø]¯êWZlZ¼Þqê²È›^!Csaá¸-f»ƒM²ó˜ÜÍæf+]ÿf ÃÈøÌc2c5Èø‹T:ެ÷P@,-£•ŬR;¥”;ä‘R=ÿ¼ýÙÕuÔ5eûBÞ\ý ±¬¯É÷¯rø÷v׿ ôK øŠçÄþ+³ûSdš†‹{™KÀï±ËpÄ~óÌÿT}‰÷Ø»âvâŸÙx*òéLj´cŽH±çYÇ X\qüѸïž>ˆ¢Š¯,±A’GXÕ@ÜÎûFŸ©«Q^OãiÅŸü3à›HRk?Í¿®IÊ™UþÑüfPdØ‚>sÐú”¯hÒHÈŠ‹–,>êךü,‚oø›Uø«{ŠßS‚;DWc¦™—ó›8ÿ_!ó?똋޽UÓ­5&÷KÔ Yì¯`{{˜O!ãu(éùWà ¯´ÏƒÿµüEÖ.àð u;+x ,צ´Çd{ù·“Ô~óË>µç:G†|Gñ3Ɖg>›w¨ø“Ä$v÷7[dãíI"GÊ@‘x9ÿžy¯Ò­2ÊÛOÒìôûHâ‚ÚÖ†(£û±Æ‰´ôÀÀ«õGRÓìµ=6ëM¿¶ŽæÒê ¸‰ùI#è}ˆÍy¯û0ü½³¸† Ía,‘öÚÆø=×ÌwLýP×#áߨëÀÖv©ý»â-{Sœœ[í¡+èkÈ?ïá¨þ$~ȾÔô¸¤ð%äú&£ã²öif†àï“ó¯Ô~Uòf³¡j>µ×ôgÂÈ—Ú}å½ÍòHÿèO‰?wû¹<¹ ž_þB¯Cý•<%gñTÖ|s¶ÒÖìE{¨\£È—2YBßñ÷ïo&GüóïÅ^ï~ ü|²Ô¼ ¬]ø—E³íõ(ˆ24EŽÙ¡ö¤oÑdßœqƒï÷~‹©Ùkz-†¯§8–ÊþÞ+«gÆ7Æé½åƒZ4UyeŠÌ’:ƪæwÚ0xýMX¢¹Ïˆ ‹ÂÞ Ôõùa7FÖ,Ál ÌÎvC÷y{šÎøcáÝGCÐgº×ŒøX¹þÑÖ&ˆž{c÷(NIŽ rxŒzšæ¼nOüw'à Y§‹FÓb†ûÅ2Û>ÇœIŸ"Äç¢Hw#9Ž=ŸÅǨ[ÛÅI $q"â8ãbªÿwf¾ ý´ôí0þÑú©Ð­®´›W½ÔÖ)$hBÏp<Í‘ý÷¸ú ?dkãö›Ô_EÒõ;6ßÃòÜéër’O±þΞká2 ŸöÓ¸¯¬þ øï¾Ò"Õü]¬G¥YÍ(†7h¤v‘ñÐ"+7JäôŸÚàÞ¢â;oÛï-´yöW0ÿèÈÅw>ñ>â½6MKÃ:½®§gïlòC÷¯ðgþµ¿Eñí¶mô¯‹ÑCn×"Ë[Ò­n|Cijʦâ8g‘Qùé D1‡ìúW—ü%®»ªê¿<h±\x¶Ajo®fe¾žŒfpvuOÞußþ¬ Šú’×öLøzþÒô«Ëýd_Ù,‚çP³•!’ì¹þ5tqµ0<¼tõ=kÜü-¤ÚèÒ¼=hò=®™e œ-!Ë2GÁ»>ËZôUyeŠÌ’:ƪæwÚ0xýMX¢¼²ÊØxÇãN«¨jeŸIð[Ãg¦[4›â{ù!Y¦¹uÇßHåŽ4$ðL¾µ½ñCÄWš… P]ø—V¸K-ÖcòÉ9ûÎûA;!]ó?²FjÇÃ_ Zx3Ã+£[ÝM¨\´¯s}¨]g¾ºsûÉä>§\&Á“Šëkœñ׊ôxjïÄ>%¿ŠÆÂßïHFçgþEç{ž1OËóÿã‡Å[_‰Ÿ,4x‚M. ¬?°ì­-,Z8e‰%BYÝB›:uÏüó¯£n´2ëR´ÔntÛ;‹Û=ÿf¸’ÝZX7ýÿ-ú¦{ã®+‚ñoÁ…þ&¼Ôõ G–i¨Û¼S]Û§•"±ÿ–È1°KÎ|ÌgëÍi|øe¢ü,ðíj¥í­Ýóß;êFî²6"qû±Åw´Q_žßµïŠVç㟉`ÑžÜAý™|ñ‘ ˜#G#¯òÑ$Â{yuôgìaðþ ü,‡Äv’C­x€›‰Œ±Æ;pø‚>;:m¬±^ûEUy%ŠÌ’:ƪæwÚ0xýMX¢¼ÃÁGMøããï Ï$(u$²ñ ‚ùå‰à[I›è¯nŸ÷ðTz©þÖý§t{)àV·ðß…çÔ­Îì´ÝÏä~‘Å ÿ¶•êtWÍÿðPV˜|Ò|¬ùG_‹~:ÿǽÆß×ñ¿á…eý™ô‹ŸhêÖqii=…¤QÍw,¦6;÷ɿΠÛ.‘“Ò½÷ádž,|à#Âö ‚ßMµ[}ë—æ8ûò`wwÞçÝëâgÃtñÔö’Kã_xx[Dñù¦-¢ç;6çßükÈ|ð‡ö€Ñ5KJëâìóÉdû¬mo.®¯­u»2¼€Æ²2y¯£´oíìÛqª-²ßùIö¥¶/åy¸ùöoçfzwǽyßí…$ð IãkÞÓ$»H]!Ü=ÜŽŽDÞHÎ[÷xçgµxoƒ¡ø7w4e¿í#ñ;O¼HÌmæjÓi°®ÎÙ–ˆ1Ûy¯§>ø~/xb;¼O®øšÝåiá¿ÕïVîfGÇËæ¨ù“¸ú×æïŽ¬üG¥|OÕ×ĺK6¹ ×w¶“¡ž6%üÏŸf<ÈÜŸû÷_ Ÿ³çÄø‘ðÒ×Ä2[[Z^Çq%¥åµ®L0H„m Oð˜Ìn?߯H¢Š*¼q‘•€ÆGÚ¸¯ã‘V(¯-øÓk&¨øoâ5¢*üǬÈ´©ÆË‚øåÖ?ÝËßýY5WÇ3[ø?ãLJ|c©Lm´mcFŸB¼»‘Ö8-fI’{f‘Ïüǫ̂+×(¯ ý¹l>ÙðêùñÔ¬î?9ûR³¼9¯¯‰¾ ü³•ZûZÓíîw'û=%‘ñÿmmó¯¡è¢ŠÌÕt­;Q6ï¨i¶·æÒeº¶ûD '“2gd‰¿îÈ3Ãõ®+Pø+ð³QñE߈/ü§\ê7ŽòÜ4¡Þ)ÏÎæÞ^òNKìÏ=kCá›áÿ†çðäZ½Æ¥§Å4úZOÃcløÛlI“iÞwžNþ•æÿ u×Eø£ñ“^ÓlneMfþ;{£žÊÚ(à†ÝÏñ˜¶ï¹úU/ØN¼³ø-}sC¡­Í=¨ìè‘EÙôxäOø}EUyeŠÌ’:ƪæwÚ0xýMX¢¨j–6¶™u¦êñÝY]Âö×?)$n6:b2+Èdµ>ÒâøwñL›ÅÕ. žŸ­Hal’:ù÷Ã!W(‘Ü9>YýÙ®£öyšþo„z\:–£.£qes{cöÉ[sÌ–÷sÀŽà­z-s~9ð¾‰ã_ _xk^¶k:ùBJFGu`F*àÛ }+⯅ھ¿à_~øSâ­e¡ø¾F‰Ì{<ј#Ø?眞lrÛJû渟Œ>/»ð/ÃÍWÅ–º$šØÓB<–©?”Æ=á]÷l¸2ý:Ò£øeñ+Ã~<ðÞ›¨iú–˜/îíâm2+ôškf#;xüpt®êŠ+’ø§âý?À~Õü]©¨hì-÷GïõÒÿË8óê_>õñ€í¼_ñSÃ^ø9àû»»_ éà\x‡XÄG%Ë·œþo'>Y%C2DvÌqxgBÒü5 XøD³K-6Å<¨!RO¯×ulÑE^Yb‚3$ޱª¹öŒ?SV(¢Šòÿ‡7ÚÃéÞñ—Œ<3§ëP4ÒÝBÚ¬j<ÉæyÉfÇ?ë=ãÖ½ GÔtíZÂ=CJ¿µÔ-%»¹µ™eŽO£'¯WÉŸ¶—…&ð¿Š|;ñ¯GT2YßYÅoåðÏù°IŸø–~±×Õv·ÜÛEqͱ¬ˆ}Uùb¾7øû(øŽçÇ·zÇ€µXé3\¥Í´2Íön?…1ƒfþ¥_¿ðïí{ÿÉ,·ÚŽ-ü›{ˆ>ØU°‚méÌþÿ™øÓ4Ÿ†Þ9ýž§â4WƒÆP²¼> Ólm] 9“ÎI¸óÉëØä}Y¤ê6š¶gªéÓ,ö·¶éqj㤑ºïCùs_'|zÔuŽ¿ì¾øFö;];Di¥¾½l´fty0‡þY“å¡ãçyé_L|3ðf‘à/iþÑ#+ojƒt¬>yåÇÏ3û¹ük©¢Š(ªòË™$uT Ìï´`ð úš±Eòÿíã‰zï‰ü_àF±XøwL†çWhíd’òõfŒ %ðD‰Ú7ýÛâ@9¯Ÿÿg_…çÆ^(}WYÓí ð†^mZãPim (œ:Dz輨kþ 뺗Ä}ÄgÂvs\iöS’Úk‹ ’þöõ#tÚŸ'ÈwÀ’¾ið‹uŸø¾ÓÅž0Å}k,’ dÝ ¤ƒçGAÈËôÅ}â­ãýÖ‡âøLEÝÎ-vn;d…# ž‘¤‚Mü¨ìq_lœuìkÌ~-Ý|f°¸‚÷á……õ[(á =†¦®“™7œº?˜‰³f'±ëž:ÿÿÂ; ñœš3jÍ“*iqIºz'ïÉúñô§xËĺG„¼5â-vðYé¶ §”ž@È ¸îÌçhÉÇðž«}®üdý£ü-/‹t‰4ëM^k_±Z²lÛ¥ï–Tÿ–›ã2~óú`Wè]QEUyeŠÌ’:ƪæwÚ0xýMX¢ŠòÚ§À—ž?øA¦i6ŸkÖ4ùâ¿ÓíĈ»ÝxÿW#àqÎÊøÿö}ø»«|-×ü¹„òè;µþŸ1îwûžg™þ³÷uè:ä¾øÁ«jŸð¦~ê'ÅRƒS»×5 ˜ã6’ÙÝÀy9ÿž_ÝñÆu–­ð¯Cñ4ÚïÅïjßüYgxáì,bi´è¦Î2<ä„?ôæ<­Wñ§ŒÏíñ_ÀÓt¹´*'1OlÒ"…_õ“¼eé„| Ÿã~—«üøýoâÏXÚØéÑ™l-·–Ób%ͳGž>Ÿ#ÞGŽGLü)øçà?ˆF; Ùlõ³/§]ÂcpGÞØÜÆëœôsÐWªŸ¡Ï 5Ê|Cñß„þéQj~-Õ×M·™™!ÞWÆv" $Ÿóï_#ê>?³øéñ£J¶×¦¸‡Áö7{¬<;ß¶j3m;S ½7¼œ>÷#Œó ä×Oã}abý¿¼7 ‚lVÖÅ”¦Ô %¬¤ìÇû××ÈCl!‚¶ÖÁÇÍSQEQUå–(#2H먙ßhÁàõ5bŠ)§g°óŸÆÿ~Ío¬ ŸŦkšÝ•Ôw.™b³ÍpÉÀŠiQ|·\uŽGíí^Msã/‰_‘| ðÇÃQxWÂV­åÍŒžD1E é<©±vrÇËHÏÿ[^ãðöeð‚dûv®Ÿð”ê&3oíSìÑŒž›¶ÎïÓŒW;û;xGHð¯Æ¯Šna‡Ç-u)±¶ÂCo.ší½&¶Œvᓟ/õ¯søàßøëÓxwÄÚr^YLÛÔr7ø“Ï¿½|½âÏØÂçí '…Nw|Ӝ׿i·vz•„Ö0][\G¾)àHއû®:ÕÚ(¢«Ë,PFd‘Ö5P73¾ÑƒÀ'êjÅQÕµ #NŸQÔî ³±µ‰¥¸¸™Â$h9$žÕò6±ûE|KñÐ>øa ¹#ìò¬k­›¸Ùÿq ‡!þ>ÕÑi¾*xÞÍ[â¯ÅV+[‰Í£ÛJeGcóù·ü³’»?~ÌŸ |-{öÉtýCÄ’ ýÒkG,qàtòÑÛ½žÆÖÒÂÒ;++Xm-¡M‘Ûâ"ú^? ·^]ñÒÿá•§‡,l¾&é ­ çx4èL’êâI±ÊBѧÉ!íÊ~•ÎøSá6·¤hºuÿ€þ$xÛÃ)$i2èÚâGml­ó˜<“Ë œpýñZ~$¸øçáÍ*köñ'ÂÙ­-“|÷z••ÕŠêïç”ߊò-#öøƒy«Ë`/¾Lcm¥å¼¹±…‡³ÎÛsí^¯£Ú|jñ§†à»›Ç^ðí½Ü~d2èd—ÌÑžË3ϳ¡ûè*ͯÁO«GªøÇľ'ñÌѶók®ß l•ÿÙ¶DÿÀ#Ú½JÒÚÞÂÎKKxmí AQEDD„U[¯8øðoáçã˜êþ±Kˉ<Éu+8ÖÞ󯘋—ÿæ¼cXøñáÚK«|ñæ¦É½$mâD‡Ì8ÃdOp:ÒÁñûâÏÃýB;O‹ß d[B/lah|v<Ë!Á>Zïô¯cðƯ†~5[x4oØÃ¨Í³e…ó}šä»Œ„Dõþæñž3ÍzU^Yb‚3$ޱª¹öŒ?SV+åŸÚÏÄÿŒü]£üð<²K{rEÆ®!™£USþ­f#Ÿ-Pù’IÌUï? ¼ áÏønßDðý„0¬qF·&(Ò{·y“:æIïï[ÚµôZv‘y©\+4vP<òþ ‹¼â¼á·…£àÙM<ÂÐ2\G8Œ_FóÏÓÕ»Ú;D¹Öæ¥áoHð$çɲñ]Ì3}žyó³Ë(#ýßÌd÷ÿË>}§øî¶þ8ø…à†Ï:è:ɺÕuO±Ë´ÝC¸MêGÈäœÿÀ+³ñOÂOë~¿Ñ ðw†ìLö³Ao•®éϧk:Uާi!Ü`½¶I¢?T~+¾4þÍÞñ «ë~¶‹Âúýºy¶ðYD°Û\¼cä]€§’äày‰‚9'5Î|øá­x[Y—À?¼ýò‚ÏRÔ•üÆÈÙ;ãqqÄ|œWÕ A†È†Yb‚3$ޱª¹öŒ?SU|A«X躡®j2yvZ}³ÝNØéh\ŸÈWο°þ¬Zx›â¯ˆÚK½k[º©uqËMŸìoؘóïÚ¾œ¨ÝA]®!¿Š¼{Røkd¡¾øÛÅÞ¼Õµ°¾y¬ˆÿFvÇ8éX¾"ºøÑð“GŸÄš¿ˆ­¾%øvÕ3}oýš–Öé‘ûèÊo;ùþbkš/ƒþ9j¶é?Øü+ñ&ÂÛěʶ[­˜—Í“trÓ1ŽEyÆ¿h|MøÏ¡ÚjÖ)a­h6rÆñH‚)¯í^UßÓÌ“üâºQñ‹áî»û'Ïá-ARÛ^I]2+gf{˜Àò§ÉÈýÜrûc°í}àüñO‹ó§ÙEá÷ѵ+‹¨ü¿°ÎöÃgœòcaë÷ºyrWª|kÒ<¶¿ð•øÇÅׇ–ÎÑãŽ]?\’È΃/±QyÇLdÿ/txüKâ/‡¿ þ,»¶·][G©Ë+Ï&4‰hbõŸßóäûøýæ{×¹Íð­ßÇð—Ä_Žz‰¤‡P²Ð.lÈ{©!GmÌþk•MÇÏ×çöÿ< à­sSø¥ñkÅv–¶”uÍPØ-Ìi,Q@’¼’Oóf2ä:í' N½Ç-¬A}ì#àÍ>áõu{ýe±Ö9YYçŸËÏ,ÆN;|é^ûyâ/_~Ò_4=nH4- D†¸­ s§rR8ÞGùÐà«äuæ¬jŸ4ýÇÞ-еm,ZèžÓ »Õ5Ã1³ÎÇų￙ÇÏÚ§øYñ¯Â?5Òl¡Õô]I [Zë%¼·pŸùiÞþ`ã×ð¯Q¯2ø÷ðÃNø¥à‰ô™Öu[qæéW¯Z ðž3å¾0àuè1æ_±—Ä=VâßRøWâÑu¹áòÂÛíl7­´{ààË9ý‡«¯¤¥–(#2H먙ßhÁàõ5åµþ®4oÙçÄÓ „RÝ$©–æ@ó ‘üÌ®§à‡Ÿ|+ Ö9-´ØMÀ_ùîã|ŸùÞ»jŒà2©b ×5ã^<øuñZø±7‹|'ñü#eý•  `{¶šdiÏ☓‡ùÈ9#Íd_ü7øáâë ´|OÒ,tK”òï-ôM7t·hGï¤dËß“Ó?C^—â†þñ†´ïë^³¾Ó´ÈV->Þmª¨ºaÓ…AÁíTôOƒŸ 4}3û>Çáï‡$·ê~×`—ÞÏ$ÛÜþ5±<m}i¨[ø/ÃpÞÙû%ÂiP¬mû›fS±Óµp_µм7á…ò7ˆô=ÄêäGo¥jœ2’'ñ‡D'÷‰÷ ƒÚ¹ÙûÂ_ >$øRÇÄ7^š{½æKvÑõ-bêþÛObÊC;ãdˆ#?:vÜÍz6ð_á¾™ðñ¼ <8·š·Mu,73<Žf+·ÎWÎô*íù6u#½ixká_€ü3ªÜjú6‚˪ÜDѾ£sy=ÍҮݸI¦w’1ƒŒ¡«’ñÏÁÇ—àΙð·ÀºˆÒt‘Ô¦º•̳Ûnf›Ý#¾Ó‘NV¾øïZø›à–¶·ðÒ|>ðä a¦¥å¼qF‘î6ò‡ËçŒ`ŸœšæïÅŽ= ñÕJwÂ}#¾j^Ö\“ù×G_$Y"é?ðQ#´)jP;Ê£ž[NÞÇñx‡ç_WË,PFd‘Ö5P73¾ÑƒÀ'êkæOø(ò‡~Ðc‰Úâ÷Wkˆöv[È…?<~F¾¡ÀíÀ’=iÕËø÷Á¾ñÖ…ýâ½ ^ÏrÊ‘È]_ûÈèw§qÁÌéžø‡áK—OøâÛ[ÐãUŽßGñ©óœ^Æ|Æëÿ-OëZÿðxîËþB?æ0¹BÖâ¹?M·)o]½s?¼W¤x‡Šõ¶™l,6˜Å˜í½Äh«ÿqù×”i¿µ_ÃY0ÚÅŠ=;ÜŽ)Â=-7Ølˆ.z‚´gPæd)8 Ãs«l_Â…n–= i Ýgo&ì€ÝŒ™3eûcU{¨pä/©@î Á²öX Ÿ¾TUUfö¡$œ™<4އ~ny¸%–Ĉÿÿ¡K…Û]UëqêGO¿¼Ïâ1:g,n‘<ÒÇK&O‡–‹ñP!‰bº:my†E‚„O ù*ÝnŘDÅ¢“Ï]ÜÀ•É8a(ÊEW¦·á àˆe ·ã‰]Çæå:7á!iÑ–SIâ)†É(«Nò»‡Ú;•ÖÝUçÿþ¹œ| ¼pñxìY‘G}¹žgþÒ·î«§Òž¦\<Ê'Â!æ³g…pëz¯ÚûCò<˜ˆoª§"ÀCŒ­ð 7´§ç9µßJe‰Œ±OMªïÿ”ÓdÏ2{–x4Fçãù´Îç£óƒž =Kñ¨|G~×] ‰ÏCÔÂtš'hOîžœÎGß©eP_?ª%ëK”6<Sùhѽ°ašÇcÏ2i+a¬º1í®úX?‡× …q†%’gU{ôzîzn×<§f¡Pô[Õ¬OŸÚñb’‡ —«Ü#ü8l)žv@M}§°e>ÚÌ´gùñⵚ¨;Ýás¢-מ~?ëmõ(?é[|¯gy}Qõù×狱Mä*vôy .bÂѶ@ïQûuD‰Þ¬?êëêŸ\ÎÕËEþYš ´·þÖ›ð%btU{ÌýS¡Ë‰Ýõßm ^U=±róX;£Æ›¸;ÚV´§.ƒtõoÅÌW ²õyŒ1Û B£ù®ù'©q7|/â °ã+ðôwïÝf™Ð‡’°3;#«ëjV#áá©›Uh„¹Þ¶ÒѤK·_õL&Ó‘M$`^*ºÌÂÎ;_Yjî'.ÙNÌk4ø^:ODW'œïÉëÇÏC0»)¾çÃÐ6ÌŽ¶wøÍxŠK;û}”äX8@{üe¡äX8Î!`Ï4> =ÿbÚqÌ;;MÊŠ…B¡P( …B¡P( …B¡P( …B¡P( …B¡P¨Iý=z›Q­v˲IEND®B`‚icedtea-web-1.5.3/netx/net/sourceforge/jnlp/resources/PaxHeaders.24993/install.png0000644000000000000000000000013212574544466024701 xustar0030 mtime=1441974582.576016911 30 atime=1441974656.380866491 30 ctime=1441974670.085024242 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/resources/install.png0000664000076400007640000000442412574544466025766 0ustar00jvanekjvanek00000000000000‰PNG  IHDRw4q{xˆ pHYs  d_‘ÆIDATxÚíëqÛ:…מ”õ§¤úÖ¤¨8uÐîC÷GÈÞÅ›¤(ŸoF3‰,âEà`±x€xÊü]ÑKâï×Áé1™¿_ñÊ ‰ˆ<Ý ?¶3>]߼ĩ𪠠W!²áÇ7Š­nŒoy í*¶µï:ã4xmð•Á¿/a] þ'} hYâÎs଄óqïDô÷„é~ûNZ5wZÒµµêˆóLn-ä#pFQ÷B{¼÷úìè›»xí_ëž9Ó„ª%¸•Àc é¼®ÒXc\dpÙïò{,êð3mЩœEÔMABÜÁYGö>Ñnï­jFØcÑwè¥ë?5…62¬#;ÆÒ‘Äœ“¨»žøåÑjù·Œ=›°–ãeÑ.ê(L$Æ¡•Z±g„Ñ¿âUQ¶Œe¯˜t„é GsV¸¼Ü陃4ÄqÎ åÓÜSï!ðg·tMe™AÜÁYp‰º;ïîÑ}çèó*<ÇÄ1ꌢôÜ)ôZÌÇñrÆ0 é¾1-Åé ˧û…n½TÒT UcYAÜÁYÅÝfFùœè{ÁŠÅÍDbfž‹\"çösbâ°LÇå„2’:–xD`™ŽÑGáäÊç ?2/ôm X*9bé !þX…uYTmýnL‹M”ï;ý't$/A^R„KÔ®‰°Œðì•Î³Ä ì?J]ë§TGâvþg©S*j3¿éóRlÇhGÖß%¬k¡Fý·„1¿ì{Z4à¥?n7¯B»¤Â2¸.aüÚø-Ê×Ï[¿\ùtûÙFYðºÑroEWZÖ.‘ÆPýåÃYöœ°¥ÜK‡Ÿ]€-ÛHÎÕÖ%Ãü>¶ŽMðQ•Ö2gD¹(/^¨ëœ•ÎÅQ“–œë(·,Ó–ÏáâžÑâÞ+ÀÒ„…ÚXÔÃ2Ò4¶c­u¹yè`\á$¦D_÷‰ù½$€¹¤DÜ¥1q^´Ð^ÓFŠ»4!ŠwIùT‹ãmG÷ÅÝÐv# ³£¸»Ä}¢ñ«ÀcS»ÎÝ0õÏZÇ>Ð#ÔWMe˯ “/¤Û3éàæ çÌè#•n[¡'¥åÓÄÖ¶ZÇ%É‘#}¸ÛáMKlô‰Ÿàñ¨Ù¡j¨Îpp‰:h…ú\jŒØ w¥§üሜkÉ3é³T¶#ÖÄéjÚèS¡¸ß O…ž³6߉è×2y±Nî”LN®“Áz™ìØšKðR_6(?'ä{ôÁA %ò¹3ZìRV~-íè’x& ÷ÊŒ.QœáwÜ3”#u&NIþÖ߬á¬aÇáÆm,u¦É¤-U>wg¹×|F¹‘t߫֒m±æ}ž ?Zˆ£gA”ŽR£€‹ïd/èžÅ½Dø|§8«ÎçG¬DiõÃÏe…KPÀ(¸•â^-¥âlï@Ü{Þ–=q?‰¸—º+¤²Žê­ß#Å}Ôán°ª€¸'ß-µœ·÷½Ö§Ò±·¸Ì7üì@Ü“B7Úš,÷½–&Þ›¸Ê»F5à±xî|>^øAÿ– ¾ïœ=}Åïwö¯Ô~¶ -ÏâüŒÏßý¤qk³ï?w˜¦žrÆ=®`¤q®ÏæÖ¥Ç#ý—ÌsÒ³=÷£†q~›6Ñ3 7rëümÇxZò{”[f"L¤‚ãàܰëE¹… ¥;²gAŒGÔí‰ÉÃzD â²ôù õµ3 µg:Ó‹S o¤ðŽŠc‹µÜGM¨Ž˜ãÀHЊt¦ŠDSÚN¿þÍê ¾eŒÛ©SB‹ÜÎíÈŽŒ§ölˆ­¬ËÞƒøUÜG;36/1£{—i÷q]ã¬^Gm )¤Ã¿J4ÉVúL_w‘K!Í¢§©(¾ç^þúw®ÄVÔNÞ‹¥ª:_øë t\¨oRŽ¡®q÷~l/'î+륫–üŒ~{ÂWÑhÃEmÛÒ×[¨(rõÌÁééëafÜ%"C.õÎY£sCx=n„Rëa¤Õ¬I>`«×r÷‰8sÂ?'¬¢Öå‘pÏ€‘–{ÉÈŸ«{½–ûœic¦À±@XsQˆc\Fs4J0$Ÿ)]UÈCì¨ÓÇo©ÿ¼—_ÙqoñíO™tÆù׃Å=¾$>‹CUº¹t§Ëî°•¸çvwOò9í¹çZò(]¢a™ïRw¤Þ7™N¬‹¹S G |ÎÂnõ7‡×VÙDEtˆ{í96ªâ·3a·*ïJ\W’¨ qÏÜGˆ;w³RésºAÜ¥ïKtŒË£ÙCÜU¥%lvˆ£d”°õ’HWQ¶Š¯æ4ljúGHƒ­÷”aW*îŠ>_CתC%£Ö’,'îžø£¼7÷g¡Wó•å¨Þ¹ÿAÿ&YGnx¥mwæ&G_àñƈ5·aéJc'¤ÌRŽ´ D\¢«DUB»¯ÝÅ®¢6ø:À5ñÊäë=вÛò›—Îv«–ÿ_©~cUªMò¦¢ø÷¹uô½º3 #à5žIA§îŽu‚kUš8MéJõj™£v;ša›„}¤kh¦ò{e¹ŽÕÒ>;ƒÁ÷C‘¼‹Ô$ Ykh]Qw}BðjÁ“v¨†.+Äcñ§îDÕBûmÏQú~Õ"z®qëÆ›aؽ97ÿzÞvtR#;L°‚’öj‚ªƒß¨D;Õ•qªhT›‹£&/¦àïZø^%žSL¾ãðrùÑ™ò.EOû¹d¸ÂènåzæAëí¨j'3¹ÙýšÊîØ°4€%>,ç&ø‘¦ @Ú­µe~Öå]zp>&Æ_XS~ë08µñGÔqL,»¥1M]HB(&Ð,-4Y4tßÝvÙM—…îBû º)1…zÑÐR‚)¸]¸1^Tv\l„-'–âÈÒH£¹YÌ×›Ñ(©ÚÒUž3ÒÌ{çÞsÏy÷/Çÿ4h˜—¹e/¥Qx%‰TNƒHôº6Úõ.ûmÔ¶š¨n,Ò<{þ—Î"9¢‚½IòLnÛM Wcó×wég'îòü¢¼‘¹ë“ŒE1ÀîC‚sO Ô«-¬-WqT{Ÿ†;õ=—¯NAM(‡_>=Â'× ìvñÅ7;0»ì'îÙëô°zgþºÒ‡#eúöSP5ÌNÞbÞâ×.Žav2‰ g²8ûzÆgƒ(W ÊW§¸Ë øÍEš›)Eé!‡ÎµJÐlõPÙm‡êÍ.åL€¢)˜¿l¼˜êÙó÷xî≠E©¶!* 8‘WÑlÛ8nÛ}«²4‰lü¼\_Æ¥ò¨1KÔR"Iെ…cÓöƒó¿.y0SLµ1·ÌzZuÔ*qAdÀT•0]Ô±ðV×/CˆHPÐí §UsË~­Ux¢”qØariåP†ÌÀˆ.ðùǧðêÉ$tÍAüî§G°mî÷u¤Tã¥4ª1ç tСùWwUÑê|úõ¾º³'Q"À$ˆºœÀD¾>òÅ$b3N2€`o;9»E#O²ŽM!ájRQÙc9À)ˆx`%©»Q{…õ&rÄ ÁTHÜ’îêÖKèv®UB~Œ!8d/¹îDŽ¢ÙU8‘A¸ŠW¡ Vy\}°@§&\Aúq¸ë jir ,銘OMT, Þ27W¶C»–OYdÏ&¢XPŠto}¸²ýüî´y¿L‡»õXªåF‘IJm4I}ÏCÚÙ­£r¿L/l‹,­Ã2­¾¦“c„/o¤póŠî¿ûÖ>û(Ûú,ÓÂÚÒú'™ù܇g¡êês3þ'/Ø5-üöíï8غDùŠ?ðü{o p²0P탂8Ü­cmiG{—‡;s…ï¬òÌ…ièiÝÇ*ÊQïÖÊ66#5ýWçêÉ3¿ðÄkãÈ9¤ò)¨ ½NÇÕ'¨ýy²ÌË!gè$|¨ à.½IEND®B`‚icedtea-web-1.5.3/netx/net/sourceforge/jnlp/resources/PaxHeaders.24993/hideDownloadDetails.png0000644000000000000000000000013112574544466027141 xustar0030 mtime=1441974582.576016911 29 atime=1441974656.37986648 30 ctime=1441974670.085024242 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/resources/hideDownloadDetails.png0000664000076400007640000000153612574544466030230 0ustar00jvanekjvanek00000000000000‰PNG  IHDR‰ bKGDÿÔATò pHYs  šœtIMEÝ $gÛäÌëIDAT8Ë…“OHT{Ç?÷ÏÜj§©¹3óÔ´mBIW úì¡gÂ]´SAˆY´DláFZ´[DZ1„+[%Á{-TˆBFZA+/ãØ&sgN #f3Ó~üι¿s?œó;燈Pi¶išK¦iNÞj±ÿT5M›I$‹ÅÄëõÞNNƒA­*8eYÖ½‘‘ÉårÅx<.ÀMÀR1g}>ß«ššš¿¸<ðišvgxxXööö¤¤­­-éîî`hñz½OÇÆÆ¤··W€¿(© ða¿äóy9ª ‰Åb,Ž‹ˆÈèè¨x<žk€`ò«B~¿Óüõ( 133C:þ3•JµÙlÖÜr€ÉdR\וßizzZoÇÊ–¬ !]×¥R)) UsssÒÜÜü8Q¸ºº PgFzrr²ì}–´´´$­­­/_E ëºìîî\ÞÎÏÏW®¬¬H{{ûàd¥¦`¦iz€kCCC—:;;©$Û¶Ñu=ÕîÐnôõõ777Û˜ŽŽ°ÌÙÙYvvv‡ÃX–…aÁH$r?™Lâ÷û‹¹\N×uÒÒ4íÀ^[[c{{Ût3ŸÏãº.…Bb±ˆ®ëX–•Íd2×î¢ÑhC[[›]WWg655 ‡ÃÔÖÖ055…ã8ƒÀfÅ’UÙx<ž Ð \®'‰7]]]ËõõõËÀòÄÄÄG¹`Û6¨çâþrŠU3Õ|Î_ÕÙqà °ÇÇa}}ÇqXXX §§ HÀ; xx€Ë€WA>ÿ £àkÀyൈ<+U¤©v÷÷«mðÝÚ?úçݡ鈲WáVngž<gpðç1Ò@^åÿ„€¬òÿ;äŸVßΨlž‹°x8|ðlöÕ |VvῨý[)Sœ£ƒþé¥q|µwâ6IEND®B`‚icedtea-web-1.5.3/netx/net/sourceforge/jnlp/resources/PaxHeaders.24993/about.html0000644000000000000000000000013112574544466024524 xustar0030 mtime=1441974582.576016911 29 atime=1441974656.37986648 30 ctime=1441974670.085024242 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/resources/about.html0000664000076400007640000000536712574544466025621 0ustar00jvanekjvanek00000000000000
IcedTea-Web Logo

IcedTea-Web 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.

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.
IcedTea-Web also includes a plugin to enable Java applets within web browsers.

Features of NetX:

  • Modular: Easily add JNLP capabilities to an application.
  • Saves Memory: Launch programs in a shared JVM.
  • Fast startup: Runs applications from a cache for fast starting.
  • Security: Run any application in a sandbox or log its activities.
  • Auto-Update: Applications can auto-update without special code.
  • Network Deployment: Deploy to the internet, not with installers.
  • Open Source: GNU Lesser General Public License.
Visit the IcedTea project wiki or specifically the IcedTea-Web home pages for more information.
Help with common issues with IcedTea-Web can be found here.

Contributing:


A QuickStart guide for the IcedTea project is available on the wiki. Code style guidelines and Eclipse setup instructions for IcedTea-Web are available as well. Patches should be accompanied by unit tests and reproducers before being sent to the mailing list. icedtea-web-1.5.3/netx/net/sourceforge/jnlp/resources/PaxHeaders.24993/Messages_pl.properties0000644000000000000000000000012712574544466027111 xustar0028 mtime=1441974582.5750169 29 atime=1441974656.37986648 30 ctime=1441974670.085024242 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/resources/Messages_pl.properties0000664000076400007640000015421212574544466030173 0ustar00jvanekjvanek00000000000000# 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 CertWarnHTTPSAcceptTip=Zaakceptuj ten certyfikat i zaufaj po\u0142\u0105czenie przez HTTPS CertWarnHTTPSRejectTip=Nie akceptuj ten certyfikat i nie buduj po\u0142\u0105czenie HTTPS 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 BOHelp=Wy\u015bwietl ten komunikat i zako\u0144cz # Cache CAutoGen=Wygenerowano automatycznie - nie edytowa\u0107 CNotCacheable=Zas\u00f3b \u201e{0}\u201d jest nie do przechowania w pami\u0119ci podr\u0119cznej. CDownloading=Pobieranie CComplete=Uko\u0144czono CChooseCache=Wybierz katalog pami\u0119ci podr\u0119cznej... CChooseCacheInfo=NetX wymaga lokalizacj\u0119 do sk\u0142adowania plik\u00f3w pami\u0119ci podr\u0119cznej. CChooseCacheDir=Katalog pami\u0119ci podr\u0119cznej CCannotClearCache=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 \u201e{1}\u201d.
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 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. SPLASHurl=http://icedtea.classpath.org/wiki/IcedTea-Web#Filing_bugs SPLASHurlLooks=http://icedtea.classpath.org/wiki/IcedTea-Web SPLASHmainL3=Brak dodatkowych informacji, spr\u00f3buj uruchomi\u0107 przegl\u0105dark\u0119 z wiersza polece\u0144 i przeanalizowa\u0107 dane wyj\u015bciowe. SPLASHcloseAndCopyShorter=Zamknij i kopiuj do schowka SPLASHmainL4=Wyst\u0105pi\u0142 nast\u0119puj\u0105cy wyj\u0105tek. Aby uzyska\u0107 wi\u0119cej informacji, spr\u00f3buj uruchomi\u0107 przegl\u0105dark\u0119 z wiersza polece\u0144 i przeanalizowa\u0107 dane wyj\u015bciowe. SPLASHexWas=Wyj\u0105tek: SPLASHcfl=Brak dost\u0119pu za pomoc\u0105 odno\u015bnika do SPLASHvendorsInfo=Informacje od dostawcy twojej aplikacji SPLASHanotherInfo=Inna dost\u0119pna informacja SPLASHdefaultHomepage=Brak witryny, sprawd\u017a raczej \u017ar\u00f3d\u0142o SPLASHerrorInInformation=Wyst\u0105pi\u0142 b\u0142\u0105d w trakcie \u0142adowania elementu \u201einformation\u201d, sprawd\u017a raczej \u017ar\u00f3d\u0142o SPLASHmissingInformation=Brak elementu \u201einformation\u201d, sprawd\u017a raczej \u017ar\u00f3d\u0142o SPLASHchainWas=To jest lista wyj\u0105tk\u00f3w kt\u00f3re wyst\u0105pi\u0142y w trakcie startowania applet-u. Prosz\u0119 zauwa\u017cy\u0107, \u017ce wyj\u0105tki te mog\u0105 pochodzi\u0107 z r\u00f3\u017cnych applet-\u00f3w. Aby uzyska\u0107 po\u017cyteczny raport o b\u0142\u0119dzie w programie, upewnij si\u0119 aby wykonywano wy\u0142\u0105cznie jeden applet. APPEXTSECappletSecurityLevelExtraHighId=Wy\u0142\u0105cz uruchamianie wszystkich applet-\u00f3w Java APPEXTSECappletSecurityLevelVeryHighId=Bardzo wysokie bezpiecze\u0144stwo APPEXTSECappletSecurityLevelHighId=Wysokie bezpiecze\u0144stwo APPEXTSECappletSecurityLevelLowId=Niskie bezpiecze\u0144stwo APPEXTSECappletSecurityLevelExtraHighExplanation=\u017baden applet nie b\u0119dzie uruchamiany APPEXTSECappletSecurityLevelVeryHighExplanation=Wy\u0142\u0105cznie podpisane applet-y b\u0119d\u0105 uruchamianie APPEXTSECappletSecurityLevelHighExplanation=U\u017cytkownik b\u0119dzie pytany dla ka\u017cdego applet-u APPEXTSECappletSecurityLevelLowExplanation=Wszystkie applet-y b\u0119d\u0105 uruchamianie, nawet niepodpisane APPEXTSECunsignedAppletActionAlways=Zawsze ufaj tym (zaznaczonym) applet-om APPEXTSECunsignedAppletActionNever=Nigdy nie ufaj tym (zaznaczonym) applet-om APPEXTSECunsignedAppletActionYes=Wizytowano i zezwolono temu applet-owi APPEXTSECunsignedAppletActionNo=Wizytowano i odm\u00f3wiono zezwolenia temu applet-owi APPEXTSECControlPanelExtendedAppletSecurityTitle=Rozszerzone bezpiecze\u0144stwo applet-\u00f3w APPEXTSECguiTableModelTableColumnAction=Akcja APPEXTSECguiTableModelTableColumnDateOfAction=Data akcji APPEXTSECguiTableModelTableColumnDocumentBase=Baza dokumentu APPEXTSECguiTableModelTableColumnCodeBase=Baza kodu APPEXTSECguiTableModelTableColumnArchives=Archiwa APPEXTSECguiPanelAppletInfoHederPart1={0} {1} APPEXTSECguiPanelAppletInfoHederPart2={0} od {1} APPEXTSECguiPanelConfirmDeletionOf=Czy na pewno chcesz usun\u0105\u0107 nast\u0119puj\u0105ce pozycje: {0}? APPEXTSECguiPanelHelpButton=Pomoc APPEXTSECguiPanelSecurityLevel=Poziom bezpiecze\u0144stwa APPEXTSECguiPanelGlobalBehaviourCaption=Ustawienia systemowe post\u0119powania przy obs\u0142udze applet-\u00f3w APPEXTSECguiPanelDeleteMenuSelected=Zaznaczone APPEXTSECguiPanelDeleteMenuAllA=Wszystkie dozwolone (A) APPEXTSECguiPanelDeleteMenuAllN=Wszystkie zabronione (N) APPEXTSECguiPanelDeleteMenuAlly=Wszystkie zatwierdzone (y) APPEXTSECguiPanelDeleteMenuAlln=Wszystkie odrzucone (n) APPEXTSECguiPanelDeleteMenuAllAll=Bezwzgl\u0119dnie wszystkie APPEXTSECguiPanelDeleteButton=Usu\u0144 APPEXTSECguiPanelDeleteButtonToolTip=Naciskaj\u0105c klawisz DEL, podczas przegl\u0105dania tabeli, mo\u017cesz usun\u0105\u0107 zaznaczone wpisy APPEXTSECguiPanelTestUrlButton=Testuj URL APPEXTSECguiPanelAddRowButton=Dodaj now\u0105 linijk\u0119 APPEXTSECguiPanelValidateTableButton=Sprawd\u017a tabel\u0119 APPEXTSECguiPanelAskeforeActionBox=Pytaj przed akcj\u0105 APPEXTSECguiPanelShowRegExesBox=W pe\u0142ni pokazuj wyra\u017cenia regularne APPEXTSECguiPanelInverSelection=Odwr\u00f3\u0107 zaznaczenia APPEXTSECguiPanelMoveRowUp=Przesu\u0144 linijk\u0119 w g\u00f3r\u0119 APPEXTSECguiPanelMoveRowDown=Przesu\u0144 linijk\u0119 w d\u00f3\u0142 APPEXTSECguiPanelCustomDefs=Definicje u\u017cytkownika APPEXTSECguiPanelGlobalDefs=Definicje systemowe APPEXTSECguiPanelDocTest=Wpisz URL bazy dokumentowej APPEXTSECguiPanelCodeTest=Wpisz URL bazy kodu APPEXTSECguiPanelNoMatch=Nie znaleziono hase\u0142 APPEXTSECguiPanelMatchingNote=Tylko pierwsze znalezione has\u0142o b\u0119dzie uwzgl\u0119dniane w rezultacie. APPEXTSECguiPanelMatched=Znaleziono APPEXTSECguiPanelMatchingError=B\u0142\u0105d podczas wyszukiwania: {0} APPEXTSECguiPanelCanNotValidate=Nie mo\u017cna potwierdzi\u0107, poniewa\u017c nie mo\u017cna utworzy\u0107 pliku tymczasowego \u201e{0}\u201d. APPEXTSECguiPanelEmptyDoc=Wszystkie bazy dokumentowe musz\u0105 by\u0107 wype\u0142nione APPEXTSECguiPanelEmptyCode=Wszystkie bazy kodu musz\u0105 by\u0107 wype\u0142nione APPEXTSECguiPanelTableValid=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.5.3/netx/net/sourceforge/jnlp/resources/PaxHeaders.24993/Messages_de.properties0000644000000000000000000000013112574544466027061 xustar0030 mtime=1441974582.574016888 29 atime=1441974656.37986648 30 ctime=1441974670.084024231 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/resources/Messages_de.properties0000664000076400007640000015371112574544466030153 0ustar00jvanekjvanek00000000000000# German UI messages for netx # L=Launcher, B=Boot, P=Parser, C=cache S=security # # General NullParameter=Nullparameter ButAllow=Zulassen ButBrowse=Durchsuchen... ButCancel=\ Abbrechen ButClose=Schlie\u00dfen ButCopy=In die Zwischenablage kopieren ButMoreInformation=Weitere\u00a0Informationen... ButOk=OK ButProceed=Fortfahren ButRun=Ausf\u00fchren ButSandbox=Sandkasten ButApply=Anwenden ButDone=Fertig ButShowDetails=Details zeigen ButHideDetails=Details verbergen ButYes=Ja ButNo=Nein 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=Zertifikat annehmen und HTTPS Verbindung vertrauen CertWarnHTTPSRejectTip=Dem Zertifikat nicht vertrauen und HTTPS Verbindung nicht herstellen AFileOnTheMachine=eine Datei auf dem Rechner AlwaysAllowAction=Diese Aktion immer zulassen 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 # 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 # LS - Severity LSMinor=Gering LSFatal=Fatal # LC - Category LCSystem=Systemfehler LCExternalLaunch=Externer Startfehler LCFileFormat=Dateiformatfehler LCReadError=Lesefehler LCClient=Anwendungsfehler LCLaunching=Startfehler LCNotSupported=Nicht unterst\u00fctztes Feature LCInit=Initialisierungsfehler LAllThreadGroup=Alle JNLP Anwendungen LNullUpdatePolicy=Aktualisierungsrichtlinie darf nicht null sein. LThreadInterrupted=Ausf\u00fchrungsstrang unterbrochen, w\u00e4hrend auf den Start der Datei gewartet wird. LThreadInterruptedInfo=Dies kann zum Einfrieren oder sonstigen Sch\u00e4den w\u00e4hrend der Ausf\u00fchrung f\u00fchren. Bitte die Anwendung oder den Web-Browser neustarten. LCouldNotLaunch=Konnte JNLP-Datei nicht starten. LCouldNotLaunchInfo=Die Anwendung war nicht initialisiert. Um detailierte Informationen zu erhalten k\u00f6nnen javaws oder der Web-Browser von der Befehlszeile aus gestartet werden und die Textausgabe in einem Fehlerbericht gesendet werden. LCantRead=Konnte die JNLP-Datei nicht lesen oder die Syntax analysieren. LCantReadInfo=Die Datei kann m\u00f6glicherweise manuell heruntergeladen und als Fehlerbericht an das IcedTea-Web Team gesendet werden. LNullLocation=Konnte den Ort der .jnlp Datei nicht bestimmen. LNullLocationInfo=Es wurde versucht eine JNLP-Datei in einer anderen JVM zu starten, aber die Datei konnte am Ort nicht ermittelt werden. Um in einer externen JVM zu starten, muss die Laufzeitumgebung in der Lage sein die .jnlp Datei entweder auf dem lokalen Dateisystem oder einem Server zu ermitteln. LNetxJarMissing=Konnte den Ort von netx.jar nicht bestimmen. LNetxJarMissingInfo=Ein wurde versucht eine JNLP-Datei in einer anderen JVM zu starten, aber das netx.jar konnte am Ort nicht ermittelt werden. Um in einer externen JVM zu starten, muss die Laufzeitumgebung in der Lage sein das netx.jar zu ermitteln. LNotToSpec=JNLP-Datei nicht strikt nach Spezifikation. LNotToSpecInfo=Die JNLP-Datei enth\u00e4lt Daten, die nach JNLP Spezifikation verboten sind. Die Laufzeitumgebung kann versuchen die ung\u00fcltigen Information zu ignorieren und die Datei zu starten fortfahren. LNotApplication=Keine Anwendungsdatei. LNotApplicationInfo=Es wurde versucht eine Nichtanwendungsdatei als eine Anwendung zu laden. LNotApplet=Keine Applet-Datei. LNotAppletInfo=Es wurde versucht eine Nichtappletdatei als ein Applet zu laden. LNoInstallers=Installer werden nicht unterst\u00fctzt. LNoInstallersInfo=JNLP Installerdateien werden noch nicht unterst\u00fctzt. LInitApplet=Konnte Applet nicht initialisieren. LInitAppletInfo=Um weitere Information zu erhalten, bitte den Knopf \u201eWeitere Informationen\u201c klicken. LInitApplication=Konnte Anwendung nicht initialisieren. LInitApplicationInfo=Die Anwendung war nicht initialisiert. Um weitere Informationen zu erhalten kann javaws von der Befehlszeile aus ausgef\u00fchrt werden. LNotLaunchable=Keine startbare JNLP-Datei. LNotLaunchableInfo=Datei muss ein JNLP Anwendungs-, Applet- oder Installertyp sein. LCantDetermineMainClass=Unbekannte Hauptklasse. LCantDetermineMainClassInfo=Konnte die Hauptklasse f\u00fcr diese Anwendung nicht bestimmen. LUnsignedJarWithSecurity=Kann keine Berechtigungen nicht signierten Jars gew\u00e4hren. LUnsignedJarWithSecurityInfo=Anwendung hat Sicherheitsberechtigungen angefordert, aber Jars sind nicht signiert. LSignedJNLPAppDifferentCerts=Die JNLP Anwendung ist nicht vollst\u00e4ndig durch ein einzelnes Zertifikat signiert. LSignedJNLPAppDifferentCertsInfo=Der JNLP Anwendung wurden ihre Komponenten individuell signiert, jedoch muss es einen gemeinsamen Unterzeichner zu allen Eintr\u00e4gen geben. LUnsignedApplet=Das Applet war nicht signiert. LUnsignedAppletPolicyDenied=Das Applet war nicht signiert, deshalb wurde es an der Ausf\u00fchrung durch die Sicherheitsrichtlinie gehindert. LUnsignedAppletUserDenied=Das Applet war nicht signiert und nicht vertrauensw\u00fcrdig. 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 sind 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). BAboutITW=Das IcedTea-Web Projekt bietet ein Browser Plug-in, mit dem in Java geschriebene Applets ausgef\u00fchrt werden k\u00f6nnen, als freie Software an. Urspr\u00fcnglich, basierend auf dem NetX Projekt ist es eine Implementierung der \u201eJSR56: Java Network Launching Protocol and API\u201c (JNLP) Spezifikation. Siehe auch: http://icedtea.classpath.org/wiki/IcedTea-Web.\nMit \u201eman javaws\u201c oder \u201ejavaws -help\u201c k\u00f6nnen weitere Informationen eingeholt werden. 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. # Boot options, message should be shorter than this ----------------> BOUsage=javaws [-Ausf\u00fchrungsoptionen] BOUsage2=javaws [-Steuerungsoptionen] BOJnlp=Ort der zu startenden JNLP-Datei (URL oder Datei). BOArg=F\u00fcgt einen Anwendungsparameter vor dem Start hinzu. BOParam=F\u00fcgt einen Appletparameter vor dem Start hinzu. BOProperty=Setzt eine Systemeigenschaft vor dem Start. BOUpdate=Pr\u00fcfe auf Aktualisierungen. BOLicense=Die GPL Lizenz zeigen und beenden. BOVerbose=Ausf\u00fchrliche Ausgabe aktivieren. BOAbout=Zeigt eine Beispielanwendung. 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. BOHelp=Diese Meldung ausgeben und beenden. # Cache CAutoGen=Automatisch generiert - Nicht editieren! CNotCacheable={0} ist keine zwischenspeicherbare Ressource CDownloading=Herunterladen CComplete=Vollst\u00e4ndig CChooseCache=Ein Zwischenspeicherverzeichnis w\u00e4hlen... CChooseCacheInfo=Netx ben\u00f6tigt einen Ort zur Ablage von Zwischenspeicherdateien. CChooseCacheDir=Zwischenspeicherverzeichnis CCannotClearCache=Kann den Zwischenspeicher zur Zeit nicht s\u00e4ubern, 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. # 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. SUnsignedRejectedBefore=Dieses Applet wurde bereits abgelehnt. 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. SAppletTitle=Applettitel: {0} 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 STempPermNoFile=Kein Dateizugriff STempPermNoNetwork=Kein Netzwerkzugriff STempPermNoExec=Keine Ausf\u00fchrung von Befehlen STempNoFileOrNetwork=Kein Datei- oder Netzwerkzugriff STempNoExecOrNetwork=Kein Netzwerkzugriff oder Ausf\u00fchrung von Befehlen STempNoFileOrExec=Kein Dateizugriff oder Ausf\u00fchrung von Befehlen STempNoFileOrNetworkOrExec=Kein Dateizugriff, Netzwerkzugriff oder Ausf\u00fchrung von Befehlen STempAllMedia=Alle Medien STempSoundOnly=Klang abspielen STempClipboardOnly=Zugriff auf die Zwischenablage STempPrintOnly=Dokumentdruck STempAllFileAndPropertyAccess=Voller Zugriff auf Dateien und Eigenschaften STempReadLocalFilesAndProperties=Lokale Dateien und Eigenschaften ausschlie\u00dflich lesen STempReflectionOnly=Ausschlie\u00dflich Java-Introspektion # 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-Argumente f\u00fcr das Plugin setzen. CPJVMitwExec=Eine JVM f\u00fcr IcedTea-Web einstellen, welche am besten mit OpenJDK funktioniert CPJVMitwExecValidation=JVM f\u00fcr IcedTea-Web pr\u00fcfen CPJVMPluginSelectExec=Nach JVM f\u00fcr IcedTea-Web durchsuchen CPJVMnone=Kein Pr\u00fcfergebnis f\u00fcr CPJVMvalidated=Pr\u00fcfergebnis f\u00fcr CPJVMvalueNotSet=Kein Wert angegeben. Die fest eincodierte JVM wird verwendet. CPJVMnotLaunched=Fehler: Der Prozess wurde nicht gestartet. F\u00fcr weitere Informationen, bitte die Konsolenausgabe beachten. CPJVMnoSuccess=Der Prozess wurde mit einem Fehler beendet. Bitte die Ausgabe f\u00fcr weitere Details beachten. Die Java-Laufzeitumgebung ist nicht korrekt eingestellt. CPJVMopenJdkFound=Exzellent, OpenJDK wurde erkannt CPJVMoracleFound=Gro\u00dfartig, Oracle Java wurde erkannt CPJVMibmFound=Gut, IBM Java wurde erkannt CPJVMgijFound=Warnung, gij wurde erkannt CPJVMstrangeProcess=Der Pfad hatte einen ausf\u00fchrbaren Prozess, aber dies wurde nicht erkannt. Bitte die Java-Version anhand der Konsolenausgabe \u00fcberpr\u00fcfen. CPJVMnotDir=Fehler: Der gew\u00e4hlte Pfad ist kein Verzeichnis. CPJVMisDir=Der gew\u00e4hlte Pfad 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 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 Verbergewert konfiguriert werden. # PolicyEditor PEUsage=policyeditor [-file Richtliniendatei] PEHelpFlag=Diese Meldung ausgeben und beenden PEFileFlag=Einen Richtliniendateipfad zum \u00f6ffnen angeben PECodebaseFlag=Eine oder mehrere Codebasis-URLs zum hinzuf\u00fcgen oder fokussieren im Editor angeben PETitle=Richtlinieneditor 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=Allow applets to access normally hidden data from other Java classes (oft bei Introspektion verwendet) 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 PEOpenMenuItem=\u00d6ffnen... PESaveMenuItem=Speichern PESaveAsMenuItem=Speichern unter... PEExitMenuItem=Beenden 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? PEGAccesUnowenedCode=Fremden Code ausf\u00fchren PEGMediaAccess=Medienzugriff PEGrightClick=Rechtsklick zum auf-/zuklappen PEGReadFileSystem=Zum System lesen PEGWriteFileSystem=Zum System schreiben # 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 key mnemonics. See java.awt.event.KeyEvent.VK_* # N PEAddCodebaseMnemonic=78 # E PERemoveCodebaseMnemonic=69 # O PEOkButtonMnemonic=79 # A PECancelButtonMnemonic=65 # D PEFileMenuMnemonic=68 # S PEViewMenuMnemonic=83 # O PEOpenMenuItemMnemonic=79 # S PESaveMenuItemMnemonic=83 # U PESaveAsMenuItemMnemonic=85 # X PEExitMenuItemMnemonic=88 # B PECustomPermissionsItemMnemonic=66 # 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=<< 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 # missing permissions dialogue MissingPermissionsMainTitle=Aplikace {0} z {1} postr\u00e1d\u00e1 atribut \u201epermissions\u201c. 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:
\ \ Atributy Manifestu souboru JAR
\ a
\ \ Zabr\u00e1n\u011bn\u00ed zneu\u017e\u00edv\u00e1n\u00ed aplikac\u00ed # 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:
\ \ Atributy Manifestu souboru JAR
\ a
\ \ Zabr\u00e1n\u011bn\u00ed zneu\u017e\u00edv\u00e1n\u00ed aplikac\u00ed # 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:
\ \ Atributy Manifestu souboru JAR
\ a
\ \ Zabr\u00e1n\u011bn\u00ed zneu\u017e\u00edv\u00e1n\u00ed aplikac\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\u201c (lze definovat pouze jeden). PNativeHasMain=V r\u00e1mci elementu \u201enativelib\u201c nelze deklarovat atribut \u201emain\u201c. PNoInfoElement=Nen\u00ed definov\u00e1n element \u201einformation\u201c. PMissingTitle=N\u00e1zev PMissingVendor=Dodavatel PMissingElement=Pro va\u0161e n\u00e1rodn\u00ed prost\u0159ed\u00ed nebyla zad\u00e1na sekce {0}, ani neexistuje v\u00fdchoz\u00ed hodnota v souboru JNLP. PTwoDescriptions=Duplicitn\u00ed elementy \u201edescription" 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". 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). BAboutITW=Projekt IcedTea-Web 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. Domovskou str\u00e1nku IcedTea-Web m\u016f\u017eete nav\u0161t\u00edvit na adrese: http://icedtea.classpath.org/wiki/IcedTea-Web. V\u00edce informac\u00ed z\u00edsk\u00e1te pou\u017eit\u00edm p\u0159\u00edkaz\u016f \u201eman javaws\u201c nebo \u201ejavaws -help\u201c. BFileInfoAuthors=Jm\u00e9na a e-mailov\u00e9 adresy p\u0159isp\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. # Boot options, message should be shorter than this ----------------> BOUsage=javaws [-volby-spu\u0161t\u011bn\u00ed] BOUsage2=javaws [-volby-ovl\u00e1d\u00e1n\u00ed] BOJnlp= Um\u00edst\u011bn\u00ed souboru JNLP ke spu\u0161t\u011bn\u00ed (URL nebo soubor) BOArg= P\u0159id\u00e1 p\u0159ed spu\u0161t\u011bn\u00edm parametr aplikace. BOParam= P\u0159id\u00e1 p\u0159ed spu\u0161t\u011bn\u00edm parametr 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= Povolit n\u00e1sledovat p\u0159esm\u011brov\u00e1n\u00ed s k\u00f3dy 301, 302, 303, 307 a 308 BXnofork= Zak\u00e1\u017ee vytv\u00e1\u0159en\u00ed jin\u00fdch prost\u0159ed\u00ed JVM. BXclearcache= Vy\u010dist\u00ed vyrovn\u00e1vac\u00ed pam\u011b\u0165 aplikace JNLP. BXignoreheaders= Vynech\u00e1 ov\u011b\u0159ov\u00e1n\u00ed hlavi\u010dky souboru JAR. BOHelp= Vyp\u00ed\u0161e zadanou zpr\u00e1vu do konzole a ukon\u010d\u00ed aplikaci. # Cache CAutoGen=vygenerov\u00e1no automaticky \u2013 nem\u011bnit CNotCacheable={0} nen\u00ed zdroj, kter\u00fd lze zapsat do vyrovn\u00e1vac\u00ed pam\u011bti. CDownloading=Prob\u00edh\u00e1 stahov\u00e1n\u00ed. CComplete=Dokon\u010deno CChooseCache=Zvolit adres\u00e1\u0159 pro vyrovn\u00e1vac\u00ed pam\u011b\u0165... CChooseCacheInfo=NetX pot\u0159ebuje um\u00edst\u011bn\u00ed pro uchov\u00e1v\u00e1n\u00ed soubor\u016f vyrovn\u00e1vac\u00ed pam\u011bti. CChooseCacheDir=Adres\u00e1\u0159 vyrovn\u00e1vac\u00ed pam\u011bti CCannotClearCache=Moment\u00e1ln\u011b nelze vy\u010distit vyrovn\u00e1vac\u00ed pam\u011b\u0165. 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\u010disti pomoc\u00ed p\u0159\u00edkazu javaws -Xclearcache nebo v programu itw-settings kliknut\u00edm na polo\u017eky Cache -> View files -> Clean all. 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. P\u0159\u00edpadn\u011b m\u016f\u017eete pou\u017e\u00edt program itw-settings, mo\u017enosti Cache -> View files -> Clean all. # Security SFileReadAccess=Aplikace vy\u017eaduje p\u0159\u00edstup ke \u010dten\u00ed souboru {0}. Chcete tuto akci povolit? SFileWriteAccess=Aplikace vy\u017eaduje p\u0159\u00edstup k zapisov\u00e1n\u00ed do souboru {0}. Chcete tuto akci povolit? SDesktopShortcut=Aplikace vy\u017eaduje opr\u00e1vn\u011bn\u00ed k vytvo\u0159en\u00ed spou\u0161t\u011bc\u00edho souboru na plo\u0161e. Chcete tuto akci povolit? SSigUnverified=Digit\u00e1ln\u00ed podpis aplikace nelze ov\u011b\u0159it. Chcete aplikaci spustit? 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. SUnsignedRejectedBefore=Tento aplet jste ji\u017e d\u0159\u00edve odm\u00edtli. 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 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. SAppletTitle=N\u00e1zev apletu: {0} 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 podeps\u00e1n. STOAsignedMsgAndSandbox= Aplet je kompletn\u011b podeps\u00e1n a b\u011b\u017e\u00ed v izolovan\u00e9m prostoru (sandbox). STOAsignedMsgPartiall= Aplet nen\u00ed kompletn\u011b podeps\u00e1n. STempPermNoFile=Bez p\u0159\u00edstupu k soubor\u016fm STempPermNoNetwork=Bez p\u0159\u00edstupu k s\u00edti STempPermNoExec=Bez mo\u017enosti spou\u0161t\u011bt p\u0159\u00edkazy STempNoFileOrNetwork=Bez p\u0159\u00edstupu k soubor\u016fm a s\u00edti STempNoExecOrNetwork=Bez mo\u017enosti spou\u0161t\u011bt p\u0159\u00edkazy a bez p\u0159\u00edstupu k s\u00edti STempNoFileOrExec=Bez p\u0159\u00edstupu k soubor\u016fm a bez mo\u017enosti spou\u0161t\u011bt p\u0159\u00edkazy STempNoFileOrNetworkOrExec=Bez p\u0159\u00edstupu k soubor\u016fm a s\u00edti a bez mo\u017enosti spou\u0161t\u011bt p\u0159\u00edkazy STempAllMedia=V\u0161echna m\u00e9dia STempSoundOnly=P\u0159ehr\u00e1v\u00e1n\u00ed audia STempClipboardOnly=P\u0159\u00edstup do schr\u00e1nky STempPrintOnly=Tisknut\u00ed dokument\u016f STempAllFileAndPropertyAccess=P\u0159\u00edstup ke v\u0161em soubor\u016fm a vlastnostem. STempReadLocalFilesAndProperties=P\u0159\u00edstup k lok\u00e1ln\u00edm soubor\u016fm a vlastnostem v re\u017eimu pro \u010dten\u00ed STempReflectionOnly=Pouze rozhran\u00ed Java Reflection # Security - used for the More Information dialog SBadKeyUsage=Zdroj obsahuje polo\u017eky, u nich\u017e roz\u0161\u00ed\u0159en\u00ed pou\u017eit\u00ed kl\u00ed\u010de KeyUsage certifik\u00e1tu podepisovatele nedovoluje podeps\u00e1n\u00ed k\u00f3du. SBadExtendedKeyUsage=Zdroj obsahuje polo\u017eky, u nich\u017e roz\u0161\u00ed\u0159en\u00ed pou\u017eit\u00ed kl\u00ed\u010de ExtendedKeyUsage certifik\u00e1tu podepisovatele nedovoluje podeps\u00e1n\u00ed k\u00f3du. SBadNetscapeCertType=Zdroj obsahuje polo\u017eky, u nich\u017e roz\u0161\u00ed\u0159en\u00ed pou\u017eit\u00ed kl\u00ed\u010de NetscapeCertType certifik\u00e1tu podepisovatele nedovoluje podeps\u00e1n\u00ed k\u00f3du. SHasExpiredCert=Platnost digit\u00e1ln\u00edho podpisu vypr\u0161ela. SHasExpiringCert=Zdroje obsahuj\u00ed polo\u017eky, u nich\u017e vypr\u0161\u00ed platnost certifik\u00e1tu jejich podepisovatele do \u0161esti m\u011bs\u00edc\u016f. SNotYetValidCert=Zdroje obsahuj\u00ed polo\u017eky, u nich\u017e je\u0161t\u011b nen\u00ed platn\u00fd certifik\u00e1t podepisovatele. SUntrustedCertificate=Digit\u00e1ln\u00ed podpis byl vytvo\u0159en pomoc\u00ed ned\u016fv\u011bryhodn\u00e9ho certifik\u00e1tu. STrustedCertificate=Digit\u00e1ln\u00ed podpis byl vytvo\u0159en pomoc\u00ed d\u016fv\u011bryhodn\u00e9ho certifik\u00e1tu. SCNMisMatch=O\u010dek\u00e1van\u00fd n\u00e1zev hostitele pro tento certifik\u00e1t je: {0}.
Adresa, ke kter\u00e9 se navazuje p\u0159ipojen\u00ed: {1}. SRunWithoutRestrictions=Tato aplikace bude spu\u0161t\u011bna bez obvykl\u00fdch bezpe\u010dnostn\u00edch omezen\u00ed aplikovan\u00fdch platformou Java. SCertificateDetails=Podrobnosti certifik\u00e1tu # Security - certificate information SIssuer=Vydavatel SSerial=S\u00e9riov\u00e9 \u010d\u00edslo SMD5Fingerprint=Otisk MD5 SSHA1Fingerprint=Otisk SHA1 SSignature=Podpis SSignatureAlgorithm=Algoritmus podpisu SSubject=Subjekt SValidity=Platnost # Certificate Viewer CVCertificateViewer=Certifik\u00e1ty CVCertificateType=Typ certifik\u00e1tu CVDetails=Podrobnosti CVExport=Exportovat CVExportPasswordMessage=Zadejte heslo pro ochranu souboru s kl\u00ed\u010di: CVImport=Importovat CVImportPasswordMessage=Zadejte heslo pro p\u0159\u00edstup k souboru: CVIssuedBy=Vydavatel: CVIssuedTo=P\u0159\u00edjemce: CVPasswordTitle=Vy\u017eadov\u00e1no ov\u011b\u0159en\u00ed CVRemove=Odstranit CVRemoveConfirmMessage=Skute\u010dn\u011b chcete odstranit vybran\u00fd certifik\u00e1t? CVRemoveConfirmTitle=Potvrzen\u00ed odstran\u011bn\u00ed certifik\u00e1tu CVUser=U\u017eivatel CVSystem=Syst\u00e9m # KeyStores: see KeyStores.java KS=\u00dalo\u017ei\u0161t\u011b kl\u00ed\u010d\u016f KSCerts=D\u016fv\u011bryhodn\u00e9 certifik\u00e1ty KSJsseCerts=D\u016fv\u011bryhodn\u00e9 certifik\u00e1ty JSSE KSCaCerts=D\u016fv\u011bryhodn\u00e9 certifik\u00e1ty Root CA KSJsseCaCerts=D\u016fv\u011bryhodn\u00e9 certifik\u00e1ty JSSE Root CA KSClientCerts=Certifik\u00e1ty pro ov\u011b\u0159en\u00ed klienta # Deployment Configuration messages DCIncorrectValue=Vlastnost {0} m\u00e1 nespr\u00e1vnou hodnotu {1}. Mo\u017en\u00e9 hodnoty {2}. DCInternal=Vnit\u0159n\u00ed chyba: {0} DCSourceInternal= DCUnknownSettingWithName=Vlastnost {0} je nezn\u00e1m\u00e1. 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.
Budete muset upravit nebo odstranit vlastnost {0} ve va\u0161em konfigura\u010dn\u00edm souboru {1}.
M\u011bli byste ve sv\u00e9m syst\u00e9mu nal\u00e9zt prost\u0159ed\u00ed OpenJDK, nebo byste m\u011bli dob\u0159e v\u011bd\u011bt, co d\u011bl\u00e1te. CPJVMconfirmInvalidJdkTitle=Potvrzen\u00ed neplatn\u00e9ho prost\u0159ed\u00ed JDK CPJVMconfirmReset=Obnovit v\u00fdchoz\u00ed nastaven\u00ed? CPPolicyDetail=Zobrazit nebo upravit v\u00e1\u0161 u\u017eivatelsk\u00fd soubor 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 Policy Editor. 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 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 nastavit deployment.properties.
Dokud nebudou implementov\u00e1ny v\u0161echny funkce, n\u011bkter\u00e9 z nich nebudou \u00fa\u010dinn\u00e9.
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 PEUsage=policyeditor [-file soubor_se_ z\u00e1sadami] PEHelpFlag=Vyp\u00ed\u0161e zadanou zpr\u00e1vu do konzole a ukon\u010d\u00ed aplikaci. PEFileFlag=Specifikuje cestu k souboru se z\u00e1sadami, kter\u00fd se m\u00e1 b\u00fdt otev\u0159en. PECodebaseFlag=Specifikuje adresy URL z\u00e1kladny k\u00f3du (codebase), kter\u00e9 se p\u0159idaj\u00ed anebo zv\u00fdrazn\u00ed v editoru. PETitle=Policy Editor PEReadProps=\u010cten\u00ed syst\u00e9mov\u00fdch vlastnost\u00ed 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=Zapisov\u00e1n\u00ed syst\u00e9mov\u00fdch vlastnost\u00ed PEWritePropsDetail=Povol\u00ed aplet\u016fm zapisovat/p\u0159episovat syst\u00e9mov\u00e9 vlastnosti. PEReadFiles=\u010cten\u00ed lok\u00e1ln\u00edch soubor\u016f PEReadFilesDetail=Povol\u00ed aplet\u016fm \u010d\u00edst ze soubor\u016f ve va\u0161em domovsk\u00e9m adres\u00e1\u0159i. PEWriteFiles=Zapisov\u00e1n\u00ed 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 lok\u00e1ln\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 aplikac\u00edm p\u0159istupovat ke v\u0161em um\u00edst\u011bn\u00edm ve va\u0161em po\u010d\u00edta\u010di v re\u017eimu pro \u010dten\u00ed. PEWriteSystemFiles=Zapisov\u00e1n\u00ed do v\u0161ech syst\u00e9mov\u00fdch soubor\u016f PEWriteSystemFilesDetail=Povol\u00ed aplikac\u00edm p\u0159istupovat ke v\u0161em um\u00edst\u011bn\u00edm ve va\u0161em po\u010d\u00edta\u010di v re\u017eimu pro z\u00e1pis. 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=Zapisov\u00e1n\u00ed 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 ve va\u0161em adres\u00e1\u0159i s do\u010dasn\u00fdmi soubory. PEAWTPermission=P\u0159\u00edstup k syst\u00e9mu oken PEAWTPermissionDetail=Povol\u00ed aplet\u016fm p\u0159\u00edstup k syst\u00e9mu oken AWT. 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, nikoliv v\u0161ak audio soubory p\u0159ehr\u00e1vat. PEReflection=Java Reflection PEReflectionDetail=Povol\u00ed aplet\u016fm p\u0159istupovat k rozhran\u00ed 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 b\u00fdv\u00e1 pou\u017e\u00edv\u00e1no s rozhran\u00edm 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 z bal\u00ed\u010dk\u016f ostatn\u00edch aplet\u016f (\u010dasto b\u00fdv\u00e1 pou\u017e\u00edv\u00e1no s rozhran\u00edm Reflection). PEDeclaredMembers=P\u0159\u00edstup k soukrom\u00fdm dat\u016fm t\u0159\u00edd PEDeclaredMembersDetail=Povol\u00ed aplet\u016fm p\u0159\u00edstup k obvykle skryt\u00fdm dat\u016fm ostatn\u00edch t\u0159\u00edd prost\u0159ed\u00ed Java (\u010dasto b\u00fdv\u00e1 pou\u017e\u00edv\u00e1no s rozhran\u00edm Reflection). PEExec=Spou\u0161t\u011bn\u00ed p\u0159\u00edkaz\u016f PEExecDetail=Povol\u00ed aplet\u016fm spou\u0161t\u011bt syst\u00e9mov\u00e9 p\u0159\u00edkazy. PEGetEnv=P\u0159\u00edstup k prom\u011bnn\u00fdm prost\u0159ed\u00ed PEGetEnvDetail=Povol\u00ed aplet\u016fm \u010d\u00edst prom\u011bnn\u00e9 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 PEOpenMenuItem=Otev\u0159\u00edt... PESaveMenuItem=Ulo\u017eit PESaveAsMenuItem=Ulo\u017eit jako... PEExitMenuItem=Ukon\u010dit 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? 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 # 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_* # N PEAddCodebaseMnemonic=78 # R PERemoveCodebaseMnemonic=82 # A PEOkButtonMnemonic=65 # C PECancelButtonMnemonic=67 # F PEFileMenuMnemonic=70 # I PEViewMenuMnemonic=73 # O PEOpenMenuItemMnemonic=79 # S PESaveMenuItemMnemonic=83 # A PESaveAsMenuItemMnemonic=65 # X PEExitMenuItemMnemonic=88 # U PECustomPermissionsItemMnemonic=85 #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=<< View files -> Clean all. CVCPColLastModified=Posledn\u00ed zm\u011bna CVCPColSize=Velikost (v bajtech) CVCPColDomain=Dom\u00e9na CVCPColType=Typ CVCPColPath=Cesta CVCPColName=Jm\u00e9no # Control Panel - Misc. CPJRESupport=Aplikace IcedTea-Web v sou\u010dasnosti nepodporuje pou\u017eit\u00ed v\u00edce prost\u0159ed\u00ed JRE. CPInvalidPort=Zad\u00e1no neplatn\u00e9 \u010d\u00edslo portu\n[Platn\u00e1 \u010d\u00edsla port\u016f: 1 \u2013 65535] CPInvalidPortTitle=Chyba na vstupu # command line control panel CLNoInfo=Nejsou dostupn\u00e9 \u017e\u00e1dn\u00e9 informace (je pou\u017eit\u00e1 volba platn\u00e1?). CLValue=Hodnota: {0} CLValueSource=Zdroj: {0} CLDescription=Popis: {0} CLUnknownCommand=Nezn\u00e1m\u00fd p\u0159\u00edkaz {0} CLUnknownProperty=Nezn\u00e1m\u00fd n\u00e1zev vlastnosti {0} CLWarningUnknownProperty=VAROV\u00c1N\u00cd: Nezn\u00e1m\u00fd n\u00e1zev vlastnosti {0}. Prob\u00edh\u00e1 vytv\u00e1\u0159en\u00ed nov\u00e9 vlastnosti. CLNoIssuesFound=Nebyly zaznamen\u00e1ny \u017e\u00e1dn\u00e9 pot\u00ed\u017ee. CLIncorrectValue=Vlastnost {0} m\u00e1 nespr\u00e1vnou hodnotu {1}. Mo\u017en\u00e9 hodnoty {2}. CLListDescription=Zobraz\u00ed seznam v\u0161ech n\u00e1zv\u016f vlastnost\u00ed a hodnot, kter\u00e9 jsou vyu\u017e\u00edv\u00e1ny aplikac\u00ed IcedTea-Web. CLGetDescription=Zobraz\u00ed hodnoty pro n\u00e1zev vlastnosti. CLSetDescription=P\u0159i\u0159ad\u00ed hodnotu k n\u00e1zvu vlastnosti (pokud je to mo\u017en\u00e9). Kontrola platnosti hodnoty - pokud spr\u00e1vce vlastnost uzamkl, tato funkce nebude m\u00edt \u017e\u00e1dn\u00fd efekt. CLResetDescription=Resetuje hodnotu n\u00e1zvu vlastnosti na v\u00fdchoz\u00ed hodnotu.\nVolba \u201eall\u201c resetuje v\u0161echny vlastnosti rozpoznan\u00e9 aplikac\u00ed IcedTea-Web na jejich v\u00fdchoz\u00ed hodnoty. CLInfoDescription=Zobraz\u00ed dal\u0161\u00ed informace o dan\u00e9 vlastnosti. CLCheckDescription=Zobraz\u00ed v\u0161echny vlastnosti, kter\u00e9 byly definov\u00e1ny, av\u0161ak nebyly rozpozn\u00e1ny aplikac\u00ed IcedTea-Web. CLHelpDescription=N\u00e1stroj itweb-setting umo\u017e\u0148uje u\u017eivateli upravovat, prohl\u00ed\u017eet a kontrolovat nastaven\u00ed.\nChcete-li pou\u017e\u00edt grafick\u00e9 rozhran\u00ed, nezad\u00e1vejte \u017e\u00e1dn\u00e9 parametry. Chcete-li pou\u017e\u00edt p\u0159\u00edkazovou \u0159\u00e1dku, zadejte pat\u0159i\u010dn\u00fd p\u0159\u00edkaz a parametry. Pot\u0159ebujete-li pomoc s konkr\u00e9tn\u00edm p\u0159\u00edkazem, zkuste zadat p\u0159\u00edkaz {0} s parametrem help. # splash screen related SPLASHerror= Podrobnosti z\u00edsk\u00e1te kliknut\u00edm zde. Do\u0161lo k 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. SPLASHurl= http://icedtea.classpath.org/wiki/IcedTea-Web#Filing_bugs SPLASHurlLooks= http://icedtea.classpath.org/wiki/IcedTea-Web SPLASHmainL3= Nejsou dostupn\u00e9 \u017e\u00e1dn\u00e9 dal\u0161\u00ed informace. Zkuste spustit prohl\u00ed\u017ee\u010d z p\u0159\u00edkazov\u00e9 \u0159\u00e1dky a analyzovat v\u00fdstup. SPLASHcloseAndCopyShorter= Zav\u0159\u00edt a kop\u00edrovat do schr\u00e1nky SPLASHmainL4= Do\u0161lo k n\u00e1sleduj\u00edc\u00ed v\u00fdjimce. Chcete-li v\u00edce informac\u00ed, zkuste spustit prohl\u00ed\u017ee\u010d z p\u0159\u00edkazov\u00e9 \u0159\u00e1dky a analyzovat v\u00fdstup. 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 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. 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. APPEXTSECControlPanelExtendedAppletSecurityTitle=Roz\u0161\u00ed\u0159en\u00e9 zabezpe\u010den\u00ed aplet\u016f APPEXTSECguiTableModelTableColumnAction=Akce 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=Uk\u00e1zat \u00fapln\u00e9 regul\u00e1rn\u00ed v\u00fdrazy APPEXTSECguiPanelInverSelection=P\u0159evr\u00e1tit v\u00fdb\u011br APPEXTSECguiPanelMoveRowUp=Posunout \u0159\u00e1dek nahoru APPEXTSECguiPanelMoveRowDown=Posunout \u0159\u00e1dek dol\u016f APPEXTSECguiPanelCustomDefs=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=Dialogueicedtea-web-1.5.3/netx/net/sourceforge/jnlp/resources/PaxHeaders.24993/Messages.properties0000644000000000000000000000013212574544466026412 xustar0030 mtime=1441974582.572016865 30 atime=1441974656.378866468 30 ctime=1441974670.084024231 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/resources/Messages.properties0000664000076400007640000016302312574544466027500 0ustar00jvanekjvanek00000000000000# Default (English) UI messages for netx # L=Launcher, B=Boot, P=Parser, C=cache S=security # # General NullParameter=Null parameter ButAllow=Allow ButBrowse=Browse... ButCancel=\ Cancel\ ButClose=Close 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 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 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 # 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 # 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 filesystem or on a server. LNetxJarMissing=Could not determine location of netx.jar. LNetxJarMissingInfo=An attempt was made to lauch 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 spec. 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=Canceled 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' 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=Can not 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). BAboutITW=The IcedTea-Web project 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. Visit the IcedTea-Web homepage: http://icedtea.classpath.org/wiki/IcedTea-Web . Use "man javaws" or "javaws -help" for more information. 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. # Boot options, message should be shorter than this ----------------> BOUsage=javaws [-run-options] BOUsage2=javaws [-control-options] BOJnlp = Location of JNLP file to launch (url or file). 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. BOHelp = Print this message and exit. # 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=Can not clear the cache at this time. Try later. If the problem persists, try closing your browser(s) & JNLP applications. At the end you can try to kill all java applications. \\\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 # 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 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. SUnsignedRejectedBefore=You have rejected this applet previously. 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. SAppletTitle=Applet title: {0} 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 STempPermNoFile=No file access STempPermNoNetwork=No network access STempPermNoExec=No command execution STempNoFileOrNetwork=No file or network access STempNoExecOrNetwork=No command execution or network access STempNoFileOrExec=No file access or command execution STempNoFileOrNetworkOrExec=No file access, network access, or command execution STempAllMedia=All media STempSoundOnly=Play audio STempClipboardOnly=Access clipboard STempPrintOnly=Print documents STempAllFileAndPropertyAccess=All file and properties access STempReadLocalFilesAndProperties=Read-only local files and properties STempReflectionOnly=Java Reflection only # 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 # 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} can not 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 plublishers. CPSecurityDescription=Use this to configure security settings. CPDebuggingDescription=Enable options here to help with debugging CPDesktopIntegrationDescription=Set whether or not to allow creation of desktop shortcut. CPJVMPluginArguments=Set JVM arguments for plugin. 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.
You will have to modify or remove {0} property in your configuration file {1}.
You should try to search for OpenJDK in your system or be sure you know what you are doing. CPJVMconfirmInvalidJdkTitle=Confirm invalid JDK CPJVMconfirmReset=Reset to default? 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 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 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 PEUsage=policyeditor [-file policyfile] PEHelpFlag=Print this message and exit PEFileFlag=Specify a policyfile path to open PECodebaseFlag=Specify (a) codebase URL(s) to add and/or focus in the editor PETitle=Policy Editor 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 PEOpenMenuItem=Open... PESaveMenuItem=Save PESaveAsMenuItem=Save As... PEExitMenuItem=Exit 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? PEGAccesUnowenedCode = Execute unowned code PEGMediaAccess = Media access PEGrightClick = right click to fold/unfold PEGReadFileSystem = Read to system PEGWriteFileSystem = Write to system # 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_* # N PEAddCodebaseMnemonic=78 # R PERemoveCodebaseMnemonic=82 # A PEOkButtonMnemonic=65 # C PECancelButtonMnemonic=67 # F PEFileMenuMnemonic=70 # I PEViewMenuMnemonic=73 # O PEOpenMenuItemMnemonic=79 # S PESaveMenuItemMnemonic=83 # A PESaveAsMenuItemMnemonic=65 # X PEExitMenuItemMnemonic=88 # U PECustomPermissionsItemMnemonic=85 #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=<< View files -> Purge CVCPColLastModified=Last Modified CVCPColSize=Size (Bytes) CVCPColDomain=Domain CVCPColType=Type CVCPColPath=Path CVCPColName=Name # 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 avaiable (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 CLHelpDescription=The itweb-settings tool allows a user to modify, view and check configuration.\nTo use the GUI, do not pass any arguments. To use the CLI mode, pass in the approrpiate command and parameters. For help with a particular command, try: {0} command help # splash screen related SPLASHerror = Click here for details. 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 = Can not copy exception SPLASHnoExRecorded = No exception recorded SPLASHmainL1 = For even more information you can visit {0} and follow the steps described there on how to obtain necessary information to file bug SPLASHurl = http://icedtea.classpath.org/wiki/IcedTea-Web#Filing_bugs SPLASHurlLooks = http://icedtea.classpath.org/wiki/IcedTea-Web SPLASHmainL3 = No further information available, try to launch the browser from the command line and examine the output. SPLASHcloseAndCopyShorter = Close and copy to clipboard SPLASHmainL4 = The folloing exception has occured. For more information, try to launch the browser from the command line and examine the output. 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. 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 APPEXTSECControlPanelExtendedAppletSecurityTitle=Extended applet security APPEXTSECguiTableModelTableColumnAction=Action APPEXTSECguiTableModelTableColumnDateOfAction=Date of action APPEXTSECguiTableModelTableColumnDocumentBase=Document-base APPEXTSECguiTableModelTableColumnCodeBase=Code-base APPEXTSECguiTableModelTableColumnArchives=Archives APPEXTSECguiPanelAppletInfoHederPart1={0} {1} APPEXTSECguiPanelAppletInfoHederPart2={0} from {1} APPEXTSECguiPanelConfirmDeletionOf=Are you sure you want to delete following {0} items APPEXTSECguiPanelHelpButton=Help APPEXTSECguiPanelSecurityLevel=Security Level APPEXTSECguiPanelGlobalBehaviourCaption=Settings of global behavior for applets APPEXTSECguiPanelDeleteMenuSelected=selected APPEXTSECguiPanelDeleteMenuAllA=all allowed (A) APPEXTSECguiPanelDeleteMenuAllN=all forbidden (N) APPEXTSECguiPanelDeleteMenuAlly=all approved (y) APPEXTSECguiPanelDeleteMenuAlln=all rejected (n) APPEXTSECguiPanelDeleteMenuAllAll=absolute all APPEXTSECguiPanelDeleteButton=Delete APPEXTSECguiPanelDeleteButtonToolTip=You can press delete key during browsing the table. It will act as delete selected APPEXTSECguiPanelTestUrlButton=Test url APPEXTSECguiPanelAddRowButton=Add new row APPEXTSECguiPanelValidateTableButton=Validate table APPEXTSECguiPanelAskeforeActionBox=Ask me before action APPEXTSECguiPanelShowRegExesBox=Show full regular expressions APPEXTSECguiPanelInverSelection=Invert selection APPEXTSECguiPanelMoveRowUp=Move row up APPEXTSECguiPanelMoveRowDown=Move row down APPEXTSECguiPanelCustomDefs=User definitions APPEXTSECguiPanelGlobalDefs=System definitions APPEXTSECguiPanelDocTest=Type document base URL APPEXTSECguiPanelCodeTest=Type code base URL APPEXTSECguiPanelNoMatch=Nothing matched APPEXTSECguiPanelMatchingNote=Please note, that only first matched result will be considered as result. APPEXTSECguiPanelMatched=Matched APPEXTSECguiPanelMatchingError=Error during matching: {0} APPEXTSECguiPanelCanNotValidate=Can not validate, can not create tmp file - {0} APPEXTSECguiPanelEmptyDoc=All document-bases must be full APPEXTSECguiPanelEmptyCode=All code-bases must be full APPEXTSECguiPanelTableValid=Table looks valid APPEXTSECguiPanelTableInvalid=Invalid with following error: {0} APPEXTSECguiPanelShowOnlyPermanent=Show only permanent records APPEXTSECguiPanelShowOnlyTemporal=Show only previously temporarily decided records APPEXTSECguiPanelShowAll=Show all records APPEXTSECguiPanelShowOnlyPermanentA=Show only allowed permanent records APPEXTSECguiPanelShowOnlyPermanentN=Show only forbidden permanent records APPEXTSECguiPanelShowOnlyTemporalY=Show previously allowed applets records APPEXTSECguiPanelShowOnlyTemporalN=Show previously denied applets records APPEXTSEChelpHomeDialogue=Dialogue APPEXTSEChelp= \

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

\

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

\

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

\

Security Level

\

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

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

    \ \ \

    Table with recorded actions

    \

    \

    Custom x Global table

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

    "Syntax"

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

    Controls of tables

    \

    \

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

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

    \

    \

    Dialogue

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

    Controls

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

    \

    \

    Regular expressions

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

    \

    Conclusion

    \

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

    \ \ icedtea-web-1.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/package-info.java0000644000000000000000000000013212574544466023702 xustar0030 mtime=1441974582.570016842 30 atime=1441974656.378866468 30 ctime=1441974670.084024231 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/package-info.java0000664000076400007640000000460412574544466024767 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/event0000644000000000000000000000013212574544466021557 xustar0030 mtime=1441974582.569016831 30 atime=1441974670.156025059 30 ctime=1441974670.084024231 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/event/0000775000076400007640000000000012574544466022715 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/netx/net/sourceforge/jnlp/event/PaxHeaders.24993/DownloadListener.java0000644000000000000000000000013212574544466025754 xustar0030 mtime=1441974582.570016842 30 atime=1441974656.378866468 30 ctime=1441974670.084024231 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/event/DownloadListener.java0000664000076400007640000000330512574544466027036 0ustar00jvanekjvanek00000000000000// 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. */ public void updateStarted(DownloadEvent downloadEvent); /** * Called when a download starts. */ public void downloadStarted(DownloadEvent downloadEvent); /** * Called when a download completed or there was an error. */ public void downloadCompleted(DownloadEvent downloadEvent); } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/event/PaxHeaders.24993/DownloadEvent.java0000644000000000000000000000013212574544466025250 xustar0030 mtime=1441974582.569016831 30 atime=1441974656.377866457 30 ctime=1441974670.084024231 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/event/DownloadEvent.java0000664000076400007640000000362312574544466026335 0ustar00jvanekjvanek00000000000000// 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 */ transient private ResourceTracker tracker; /** the resource */ 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; } /** * Returns the tracker that owns the resource. */ public ResourceTracker getTracker() { return tracker; } /** * Returns the location of the resource being downloaded. */ public URL getResourceLocation() { return resource.getLocation(); } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/event/PaxHeaders.24993/ApplicationListener.java0000644000000000000000000000013212574544466026450 xustar0030 mtime=1441974582.569016831 30 atime=1441974656.377866457 30 ctime=1441974670.084024231 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/event/ApplicationListener.java0000664000076400007640000000236412574544466027536 0ustar00jvanekjvanek00000000000000// 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. */ public void applicationDestroyed(ApplicationEvent applicationEvent); } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/event/PaxHeaders.24993/ApplicationEvent.java0000644000000000000000000000013212574544466025744 xustar0030 mtime=1441974582.569016831 30 atime=1441974656.377866457 30 ctime=1441974670.084024231 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/event/ApplicationEvent.java0000664000076400007640000000315012574544466027024 0ustar00jvanekjvanek00000000000000// 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 */ 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; } /** * Returns the application instance. */ public ApplicationInstance getApplication() { return application; } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/controlpanel0000644000000000000000000000013212574544466023136 xustar0030 mtime=1441974582.568016819 30 atime=1441974670.156025059 30 ctime=1441974670.084024231 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/controlpanel/0000775000076400007640000000000012574544466024274 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/netx/net/sourceforge/jnlp/controlpanel/PaxHeaders.24993/UnsignedAppletsTrustingLis0000644000000000000000000000013212574544466030453 xustar0030 mtime=1441974582.568016819 30 atime=1441974656.377866457 30 ctime=1441974670.084024231 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletsTrustingListPanel.java0000664000076400007640000013170212574544466033624 0ustar00jvanekjvanek00000000000000/* 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.runtime.Translator; 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.logging.OutputController; import net.sourceforge.jnlp.util.ScreenFinder; 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 String appletItemsToCaption(List ii, String caption) { StringBuilder sb = new StringBuilder(); for (UnsignedAppletActionEntry i : ii) { sb.append(appletItemToCaption(i, caption)).append("\n"); } return sb.toString(); } public static String appletItemToCaption(UnsignedAppletActionEntry i, String caption) { return Translator.R("APPEXTSECguiPanelAppletInfoHederPart1", caption, i.getDocumentBase().getFilteredRegEx()) + "\n (" + Translator.R("APPEXTSECguiPanelAppletInfoHederPart2", i.getUnsignedAppletAction(), DateFormat.getInstance().format(i.getTimeStamp())) + "\n " + Translator.R("APPEXTSECguiTableModelTableColumnDocumentBase") + ": " + i.getDocumentBase().getFilteredRegEx() + "\n " + Translator.R("APPEXTSECguiTableModelTableColumnCodeBase") + ": " + i.getCodeBase().getFilteredRegEx() + "\n " + Translator.R("APPEXTSECguiTableModelTableColumnArchives") + ": " + UnsignedAppletActionEntry.createArchivesString(i.getArchives()); } public void removeSelectedFromTable(JTable table) { removeSelectedFromTable(table, askBeforeActionCheckBox.isSelected(), currentModel, this); } public static void removeSelectedFromTable(JTable table, boolean ask, UnsignedAppletActionTableModel data, Component forDialog) { int[] originalIndexes = table.getSelectedRows(); List newIndexes = new ArrayList(originalIndexes.length); for (int i = 0; i < originalIndexes.length; i++) { //we need to remap values first int modelRow = table.convertRowIndexToModel(originalIndexes[i]); newIndexes.add(modelRow); } //now to sort so we can incrementaly dec safely Collections.sort(newIndexes); if (ask) { String s = Translator.R("APPEXTSECguiPanelConfirmDeletionOf", newIndexes.size()) + ": \n"; UnsignedAppletActionEntry[] items = data.back.toArray(); for (int i = 0; i < newIndexes.size(); i++) { Integer integer = newIndexes.get(i); s += appletItemToCaption(items[integer], " ") + "\n"; } int a = JOptionPane.showConfirmDialog(forDialog, s); if (a != JOptionPane.OK_OPTION) { return; } } int sub = 0; for (int i = 0; i < newIndexes.size(); i++) { Integer integer = newIndexes.get(i); data.removeRow(integer.intValue() + sub); sub--; } } public void removeAllItemsFromTable(JTable table, UnsignedAppletActionTableModel model) { table.clearSelection(); if (askBeforeActionCheckBox.isSelected()) { UnsignedAppletActionEntry[] items = model.back.toArray(); String s = Translator.R("APPEXTSECguiPanelConfirmDeletionOf", items.length) + ": \n"; for (int i = 0; i < items.length; i++) { s += appletItemToCaption(items[i], " ") + "\n"; } int a = JOptionPane.showConfirmDialog(this, s); if (a != JOptionPane.OK_OPTION) { return; } } model.clear(); } 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, DeploymentConfiguration.getAppletTrustUserSettingsPath().getAbsolutePath()); mainTabPanel.setToolTipTextAt(1, DeploymentConfiguration.getAppletTrustGlobalSettingsPath().getAbsolutePath()); mainTabPanel.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { switch (mainTabPanel.getSelectedIndex()) { case 0: currentModel = customModel; currentTable = userTable; break; case 1: currentModel = globalModel; currentTable = globalTable; break; } setButtons((!currentModel.back.isReadOnly())); } }); } private void mainPolicyComboBoxActionPerformed(java.awt.event.ActionEvent evt) { try { conf.setProperty(DeploymentConfiguration.KEY_SECURITY_LEVEL, ((AppletSecurityLevel) mainPolicyComboBox.getSelectedItem()).toChars()); conf.save(); } catch (Exception ex) { 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 (int i = 0; i < items.length; i++) { UnsignedAppletActionEntry unsignedAppletActionEntry = items[i]; if (unsignedAppletActionEntry.getDocumentBase() != null && !unsignedAppletActionEntry.getDocumentBase().getRegEx().trim().isEmpty()) { Pattern p = Pattern.compile(unsignedAppletActionEntry.getDocumentBase().getRegEx()); p.matcher("someInput").find(); } else { throw new RuntimeException(Translator.R("APPEXTSECguiPanelEmptyDoc")); } if (unsignedAppletActionEntry.getCodeBase() != null && !unsignedAppletActionEntry.getCodeBase().getRegEx().trim().isEmpty()) { Pattern p = Pattern.compile(unsignedAppletActionEntry.getCodeBase().getRegEx()); p.matcher("someInput").find(); } else { throw new RuntimeException(Translator.R("APPEXTSECguiPanelEmptyCode")); } UnsignedAppletActionEntry.createArchivesString(UnsignedAppletActionEntry.createArchivesList(UnsignedAppletActionEntry.createArchivesString(unsignedAppletActionEntry.getArchives()))); } JOptionPane.showMessageDialog(this, Translator.R("APPEXTSECguiPanelTableValid")); } catch (Exception ex) { 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 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) { return new DefaultCellEditor(new JComboBox(new ExecuteAppletAction[] { ExecuteAppletAction.ALWAYS, ExecuteAppletAction.NEVER, ExecuteAppletAction.YES, ExecuteAppletAction.NO})); } if (columnx == 2) { column = convertColumnIndexToModel(column); row = convertRowIndexToModel(row); return new DefaultCellEditor(new MyTextField((UrlRegEx) (model.getValueAt(row, column)))); } if (columnx == 3) { column = convertColumnIndexToModel(column); row = convertRowIndexToModel(row); return new DefaultCellEditor(new MyTextField((UrlRegEx) (model.getValueAt(row, column)))); } return super.getCellEditor(row, column); } @Override public TableCellRenderer getCellRenderer(int row, int column) { int columnx = convertColumnIndexToModel(column); if (columnx == 1) { column = convertColumnIndexToModel(column); row = convertRowIndexToModel(row); return new UrlRegexCellRenderer.MyDateCellRenderer((Date) (model.getValueAt(row, column))); } if (columnx == 2) { if (!filterRegexesCheckBox.isSelected()) { column = convertColumnIndexToModel(column); row = convertRowIndexToModel(row); return new UrlRegexCellRenderer((UrlRegEx) (model.getValueAt(row, column))); } } if (columnx == 3) { if (!filterRegexesCheckBox.isSelected()) { column = convertColumnIndexToModel(column); row = convertRowIndexToModel(row); return new UrlRegexCellRenderer((UrlRegEx) (model.getValueAt(row, column))); } } return super.getCellRenderer(row, column); } }; jt.setRowHeight(jt.getRowHeight() + jt.getRowHeight() / 2); jt.setModel(model); return jt; } private void reloadTable() { List l = currentTable.getRowSorter().getSortKeys(); currentTable.setModel(new DefaultTableModel()); currentTable.setModel(currentModel); { currentTable.getRowSorter().setSortKeys(l); } } private void removeByBehaviour(ExecuteAppletAction unsignedAppletAction) { UnsignedAppletActionEntry[] items = currentModel.back.toArray(); if (askBeforeActionCheckBox.isSelected()) { List toBeDeleted = new ArrayList(); for (int i = 0; i < items.length; i++) { UnsignedAppletActionEntry unsignedAppletActionEntry = items[i]; if (unsignedAppletActionEntry.getUnsignedAppletAction() == unsignedAppletAction) { toBeDeleted.add(unsignedAppletActionEntry); } } String s = Translator.R("APPEXTSECguiPanelConfirmDeletionOf", toBeDeleted.size()) + ": \n"; for (int i = 0; i < toBeDeleted.size(); i++) { s += appletItemToCaption(toBeDeleted.get(i), " ") + "\n"; } int a = JOptionPane.showConfirmDialog(this, s); if (a != JOptionPane.OK_OPTION) { return; } } currentModel.removeByBehaviour(unsignedAppletAction); } public static final class MyTextField extends JTextField { private final UrlRegEx keeper; private MyTextField(UrlRegEx urlRegEx) { if (urlRegEx == null) { keeper = 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) { ExecuteAppletAction o = (ExecuteAppletAction) entry.getModel().getValueAt(entry.getIdentifier(), 0); return (o.equals(ExecuteAppletAction.ALWAYS) || o.equals(ExecuteAppletAction.NEVER)); } } private static final class ShowPermanentA extends MyCommonSorter { @Override public boolean include(Entry entry) { ExecuteAppletAction o = (ExecuteAppletAction) entry.getModel().getValueAt(entry.getIdentifier(), 0); return (o.equals(ExecuteAppletAction.ALWAYS)); } } private static final class ShowPermanentN extends MyCommonSorter { @Override public boolean include(Entry entry) { ExecuteAppletAction o = (ExecuteAppletAction) entry.getModel().getValueAt(entry.getIdentifier(), 0); return (o.equals(ExecuteAppletAction.NEVER)); } } private static final class ShowTemporarilyDecisions extends MyCommonSorter { @Override public boolean include(Entry entry) { ExecuteAppletAction o = (ExecuteAppletAction) entry.getModel().getValueAt(entry.getIdentifier(), 0); return (o.equals(ExecuteAppletAction.YES) || o.equals(ExecuteAppletAction.NO)); } } private static final class ShowHasChosenYes extends MyCommonSorter { @Override public boolean include(Entry entry) { ExecuteAppletAction o = (ExecuteAppletAction) entry.getModel().getValueAt(entry.getIdentifier(), 0); return (o.equals(ExecuteAppletAction.YES)); } } private static final class ShowHasChosenNo extends MyCommonSorter { @Override public boolean include(Entry entry) { ExecuteAppletAction o = (ExecuteAppletAction) entry.getModel().getValueAt(entry.getIdentifier(), 0); return (o.equals(ExecuteAppletAction.NO)); } } public static final ShowAll showAll = new ShowAll(); public static final ShowPermanents showPermanents = new ShowPermanents(); public static final ShowPermanentA showPermanentA = new ShowPermanentA(); public static final ShowPermanentN showPermanentN = new ShowPermanentN(); public static final ShowTemporarilyDecisions showTemporarilyDecisions = new ShowTemporarilyDecisions(); public static final ShowHasChosenYes showHasChosenYes = new ShowHasChosenYes(); public static final ShowHasChosenNo showHasChosenNo = new ShowHasChosenNo(); public ByPermanencyFilter(UnsignedAppletActionTableModel model) { super(model); setRowFilter(showPermanents); } } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/controlpanel/PaxHeaders.24993/UnsignedAppletActionTableM0000644000000000000000000000013212574544466030303 xustar0030 mtime=1441974582.568016819 30 atime=1441974656.377866457 30 ctime=1441974670.084024231 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletActionTableModel.java0000664000076400007640000001472512574544466033161 0ustar00jvanekjvanek00000000000000/* 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.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("APPEXTSECguiTableModelTableColumnAction"), Translator.R("APPEXTSECguiTableModelTableColumnDateOfAction"), Translator.R("APPEXTSECguiTableModelTableColumnDocumentBase"), Translator.R("APPEXTSECguiTableModelTableColumnCodeBase"), Translator.R("APPEXTSECguiTableModelTableColumnArchives")}; public UnsignedAppletActionTableModel(UnsignedAppletActionStorageExtendedImpl back) { this.back = back; } @Override public int getRowCount() { return back.toArray().length; } @Override public int getColumnCount() { return columns.length; } @Override public String getColumnName(int columnIndex) { return columns[columnIndex]; } @Override public Class getColumnClass(int columnIndex) { if (columnIndex == 0) { return ExecuteAppletAction.class; } if (columnIndex == 1) { return Date.class; } if (columnIndex == 2) { return UrlRegEx.class; } if (columnIndex == 3) { return UrlRegEx.class; } if (columnIndex == 4) { return String.class; } if (columnIndex == 5) { return String.class; } return Object.class; } @Override public boolean isCellEditable(int rowIndex, int columnIndex) { if (back.isReadOnly()) { return false; } if (columnIndex == 1) { return false; } if (columnIndex == 0) { return true; } if (getValueAt(rowIndex, columnIndex - 1) == null || getValueAt(rowIndex, columnIndex - 1).toString().trim().isEmpty()) { return false; } return true; } @Override public Object getValueAt(int rowIndex, int columnIndex) { UnsignedAppletActionEntry source = back.toArray()[rowIndex]; if (columnIndex == 0) { return source.getUnsignedAppletAction(); } if (columnIndex == 1) { return source.getTimeStamp(); } if (columnIndex == 2) { return source.getDocumentBase(); } if (columnIndex == 3) { return source.getCodeBase(); } if (columnIndex == 4) { return UnsignedAppletActionEntry.createArchivesString(source.getArchives()); } return null; } @Override public void setValueAt(final Object aValue, final int rowIndex, final int columnIndex) { final UnsignedAppletActionEntry source = back.toArray()[rowIndex]; back.modify(source, columnIndex, aValue); } public void addRow() { int i = getRowCount()-1; String s = "http://localhost:80/"; back.add(new UnsignedAppletActionEntry( ExecuteAppletAction.NEVER, 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.5.3/netx/net/sourceforge/jnlp/controlpanel/PaxHeaders.24993/TemporaryInternetFilesPane0000644000000000000000000000013212574544466030420 xustar0030 mtime=1441974582.567016808 30 atime=1441974656.377866457 30 ctime=1441974670.084024231 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/controlpanel/TemporaryInternetFilesPanel.java0000664000076400007640000002330412574544466032577 0ustar00jvanekjvanek00000000000000/* 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 java.awt.BorderLayout; 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.io.File; import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JComboBox; import javax.swing.JComponent; import javax.swing.JFileChooser; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JSlider; 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.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 implements ChangeListener { private DeploymentConfiguration config; private int minSize = -1; private int maxSize = 1000; /** List of properties used by this panel */ public static String[] properties = { "deployment.javapi.cache.enabled", // false == enabled "deployment.user.cachedir", "deployment.cache.max.size", // Specified in MB "deployment.cache.jarcompression", // Allows values 0-9 }; private JComponent defaultFocusComponent = null; JSpinner spCacheSize; JSlider slCacheSize; public TemporaryInternetFilesPanel(DeploymentConfiguration config) { super(Translator.R("CPHeadTempInternetFiles")); this.config = config; setLayout(new BorderLayout()); addComponents(); } /** * Add components to panel. */ private void addComponents() { JPanel topPanel = new JPanel(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); c.fill = GridBagConstraints.BOTH; JLabel description = new JLabel("" + Translator.R("CPTempInternetFilesDescription") + "
    "); JCheckBox enableCaching = new JCheckBox(Translator.R("TIFPEnableCache"), !Boolean.parseBoolean(this.config.getProperty(properties[0]))); enableCaching.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { config.setProperty(properties[0], String.valueOf(!(e.getStateChange() == ItemEvent.SELECTED))); } }); // This displays the option for changing location of cache // User can NOT edit the text field must do it through dialog. JPanel locationPanel = new NamedBorderPanel(Translator.R("TIFPLocation"), new GridBagLayout()); JLabel locationDescription = new JLabel(Translator.R("TIFPLocationLabel") + ":"); final JTextField location = new JTextField(this.config.getProperty(properties[1])); location.setEditable(false); // Can not c&p into the location field. JButton bLocation = new JButton(Translator.R("TIFPChange") + "..."); 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); config.setProperty(properties[1], result); } } } }); c.weightx = 1; c.gridwidth = GridBagConstraints.REMAINDER; c.gridx = 0; c.gridy = 0; locationPanel.add(locationDescription, c); c.gridwidth = 1; c.gridy = 1; locationPanel.add(location, c); c.gridx = 1; c.weightx = 0; locationPanel.add(bLocation, c); // This section deals with how to use the disk space. JPanel diskSpacePanel = new NamedBorderPanel(Translator.R("TIFPDiskSpace"), new GridBagLayout()); JLabel lCompression = new JLabel(Translator.R("TIFPCompressionLevel")); // Sets compression level for jar files. 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"), }; JComboBox cbCompression = new JComboBox(compressionOptions); cbCompression.setSelectedIndex(Integer.parseInt(this.config.getProperty(properties[3]))); cbCompression.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { config.setProperty(properties[3], ((ComboItem) e.getItem()).getValue()); } }); JLabel lCacheSize = new JLabel(Translator.R("TIFPCacheSize") + ":"); slCacheSize = new JSlider(minSize, maxSize, Integer.parseInt(this.config.getProperty(properties[2]))); slCacheSize.setMinorTickSpacing(50); slCacheSize.setPaintTicks(true); SpinnerNumberModel snmCacheSize = new SpinnerNumberModel(Integer.parseInt(this.config.getProperty(properties[2])), minSize, maxSize, 1); spCacheSize = new JSpinner(snmCacheSize); slCacheSize.addChangeListener(this); spCacheSize.addChangeListener(this); c.gridy = 0; c.gridx = 0; c.weightx = 1; diskSpacePanel.add(lCompression, c); c.gridx = 1; c.weightx = 0; diskSpacePanel.add(cbCompression, c); c.gridy = 1; c.gridx = 0; c.gridwidth = GridBagConstraints.REMAINDER; c.weightx = 1; diskSpacePanel.add(lCacheSize, c); c.gridwidth = 1; c.gridy = 2; diskSpacePanel.add(slCacheSize, c); c.gridx = 1; diskSpacePanel.add(spCacheSize, c); JPanel buttonDeleteRestore = new JPanel(new FlowLayout(FlowLayout.TRAILING)); JButton bViewFiles = new JButton(Translator.R("TIFPViewFiles")); bViewFiles.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { CacheViewer.showCacheDialog(config); } }); buttonDeleteRestore.add(bViewFiles); c.weighty = 0; c.gridx = 0; c.gridy = 0; topPanel.add(enableCaching, c); c.gridy = 1; topPanel.add(locationPanel, c); c.gridy = 2; topPanel.add(diskSpacePanel, c); c.weighty = 1; c.gridy = 3; topPanel.add(buttonDeleteRestore, c); add(description, BorderLayout.NORTH); add(topPanel, BorderLayout.CENTER); } /** * Give focus to the default button. */ public void focusOnDefaultButton() { if (defaultFocusComponent != null) { defaultFocusComponent.requestFocusInWindow(); } } @Override public void stateChanged(ChangeEvent e) { Object o = e.getSource(); if (o instanceof JSlider) spCacheSize.setValue(((JSlider) o).getValue()); else if (o instanceof JSpinner) slCacheSize.setValue((Integer) ((JSpinner) o).getValue()); config.setProperty(properties[2], spCacheSize.getValue().toString()); } }icedtea-web-1.5.3/netx/net/sourceforge/jnlp/controlpanel/PaxHeaders.24993/SecuritySettingsPanel.java0000644000000000000000000000013212574544466030366 xustar0030 mtime=1441974582.566016796 30 atime=1441974656.376866445 30 ctime=1441974670.084024231 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/controlpanel/SecuritySettingsPanel.java0000664000076400007640000001340712574544466031454 0ustar00jvanekjvanek00000000000000/* 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 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.5.3/netx/net/sourceforge/jnlp/controlpanel/PaxHeaders.24993/PolicyPanel.java0000644000000000000000000000013212574544466026275 xustar0030 mtime=1441974582.566016796 30 atime=1441974656.376866445 30 ctime=1441974670.084024231 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/controlpanel/PolicyPanel.java0000664000076400007640000003141012574544466027355 0ustar00jvanekjvanek00000000000000/* 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.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; public PolicyPanel(final JFrame frame, final DeploymentConfiguration config) { super(R("CPHeadPolicy"), new GridBagLayout()); addComponents(frame, config); } private void addComponents(final JFrame frame, final DeploymentConfiguration config) { JLabel aboutLabel = new JLabel("" + R("CPPolicyDetail") + ""); final String fileUrlString = config.getProperty(DeploymentConfiguration.KEY_USER_SECURITY_POLICY); 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.5.3/netx/net/sourceforge/jnlp/controlpanel/PaxHeaders.24993/NetworkSettingsPanel.java0000644000000000000000000000013212574544466030210 xustar0030 mtime=1441974582.565016785 30 atime=1441974656.376866445 30 ctime=1441974670.084024231 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/controlpanel/NetworkSettingsPanel.java0000664000076400007640000003007512574544466031276 0ustar00jvanekjvanek00000000000000/* 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 DeploymentConfiguration config; private JPanel description; private ArrayList proxyPanels = new ArrayList(); // The stuff with editable fields /** List of properties used by this panel */ public static String[] properties = { "deployment.proxy.type", "deployment.proxy.http.host", "deployment.proxy.http.port", "deployment.proxy.bypass.local", "deployment.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])); if (config.getProperty(properties[0]).equals("0")) { for (JPanel panel : proxyPanels) enablePanel(panel, false); } else if (config.getProperty(properties[0]).equals("1")) { enablePanel(proxyPanels.get(1), false); enablePanel(proxyPanels.get(0), true); } else if (config.getProperty(properties[0]).equals("2")) { enablePanel(proxyPanels.get(0), false); enablePanel(proxyPanels.get(1), true); } else if (config.getProperty(properties[0]).equals("3")) { for (JPanel panel : proxyPanels) enablePanel(panel, false); } } /** * 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(){ 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); } } return; } }; } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/controlpanel/PaxHeaders.24993/NamedBorderPanel.java0000644000000000000000000000013212574544466027220 xustar0030 mtime=1441974582.565016785 30 atime=1441974656.376866445 30 ctime=1441974670.084024231 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/controlpanel/NamedBorderPanel.java0000664000076400007640000000350412574544466030303 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/controlpanel/PaxHeaders.24993/JVMPanel.java0000644000000000000000000000013212574544466025472 xustar0030 mtime=1441974582.565016785 30 atime=1441974656.376866445 30 ctime=1441974670.084024231 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/controlpanel/JVMPanel.java0000664000076400007640000003445512574544466026566 0ustar00jvanekjvanek00000000000000/* 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 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.5.3/netx/net/sourceforge/jnlp/controlpanel/PaxHeaders.24993/JREPanel.java0000644000000000000000000000013212574544466025456 xustar0030 mtime=1441974582.564016773 30 atime=1441974656.376866445 30 ctime=1441974670.084024231 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/controlpanel/JREPanel.java0000664000076400007640000000275212574544466026545 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/controlpanel/PaxHeaders.24993/DocumentAdapter.java0000644000000000000000000000013212574544466027135 xustar0030 mtime=1441974582.564016773 30 atime=1441974656.375866434 30 ctime=1441974670.084024231 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/controlpanel/DocumentAdapter.java0000664000076400007640000000567712574544466030235 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/controlpanel/PaxHeaders.24993/DesktopShortcutPanel.java0000644000000000000000000000013212574544466030203 xustar0030 mtime=1441974582.564016773 30 atime=1441974656.375866434 30 ctime=1441974670.084024231 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/controlpanel/DesktopShortcutPanel.java0000664000076400007640000000715512574544466031274 0ustar00jvanekjvanek00000000000000/* DesktopShortcutPanel.java -- Display option for adding desktop shortcut. 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.ItemEvent; import java.awt.event.ItemListener; import javax.swing.Box; import javax.swing.JComboBox; import javax.swing.JLabel; import net.sourceforge.jnlp.config.DeploymentConfiguration; 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. * * @author Andrew Su (asu@redhat.com, andrew.su@utoronto.ca) * */ public class DesktopShortcutPanel extends NamedBorderPanel implements ItemListener { private DeploymentConfiguration config; /** * 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(); } /** * Add components to panel. */ private void addComponents() { GridBagConstraints c = new GridBagConstraints(); JLabel description = new JLabel("" + Translator.R("CPDesktopIntegrationDescription") + "
    "); JComboBox shortcutComboOptions = new JComboBox(); ComboItem[] items = { new ComboItem(Translator.R("DSPNeverCreate"), "NEVER"), new ComboItem(Translator.R("DSPAlwaysAllow"), "ALWAYS"), new ComboItem(Translator.R("DSPAskUser"), "ASK_USER"), new ComboItem(Translator.R("DSPAskIfHinted"), "ASK_IF_HINTED"), new ComboItem(Translator.R("DSPAlwaysIfHinted"), "ALWAYS_IF_HINTED") }; shortcutComboOptions.setActionCommand("deployment.javaws.shortcut"); // The configuration property this combobox affects. for (int j = 0; j < items.length; j++) { shortcutComboOptions.addItem(items[j]); if (config.getProperty("deployment.javaws.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); // 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); } public void itemStateChanged(ItemEvent e) { ComboItem c = (ComboItem) e.getItem(); config.setProperty(((JComboBox) e.getSource()).getActionCommand(), c.getValue()); } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/controlpanel/PaxHeaders.24993/DebuggingPanel.java0000644000000000000000000000013212574544466026731 xustar0030 mtime=1441974582.563016762 30 atime=1441974656.375866434 30 ctime=1441974670.084024231 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/controlpanel/DebuggingPanel.java0000664000076400007640000002000612574544466030010 0ustar00jvanekjvanek00000000000000/* 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.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.Defaults; import net.sourceforge.jnlp.config.DeploymentConfiguration; 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_LOGGING_TOSTREAMS, DeploymentConfiguration.KEY_ENABLE_LOGGING_TOSYSTEMLOG }; private 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(); } /** * 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(config.getProperty(DeploymentConfiguration.KEY_USER_LOG_DIR)); 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() { config.setProperty(DeploymentConfiguration.KEY_USER_LOG_DIR, logsDestination.getText()); } }); final JButton logsDestinationReset = new JButton(Translator.R("CPFilesLogsDestDirResert")); logsDestinationReset.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { logsDestination.setText(Defaults.getDefaults().get(DeploymentConfiguration.KEY_USER_LOG_DIR).getDefaultValue()); } }); JCheckBox[] debuggingOptions = { new JCheckBox(Translator.R("DPEnableLogging")), new JCheckBox(Translator.R("DPEnableHeaders")), new JCheckBox(Translator.R("DPEnableFile")), new JCheckBox(Translator.R("DPEnableStds")), new JCheckBox(Translator.R("DPEnableSyslog")) }; String[] hints = { (Translator.R("DPEnableLoggingHint")), (Translator.R("DPEnableHeadersHint")), (Translator.R("DPEnableFileHint", LogConfig.getLogConfig().getIcedteaLogDir())), (Translator.R("DPEnableStdsHint")), (Translator.R("DPEnableSyslogHint")) }; 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++; } 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++; add(logsDestinationTitle, c); c.gridx++; add(logsDestination, c); c.gridx++; add(logsDestinationReset, c); c.gridx-=3; } } 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); } @Override @SuppressWarnings("unchecked") 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) { JComboBox jcb = (JComboBox) o; ComboItem c = (ComboItem) e.getItem(); config.setProperty(jcb.getActionCommand(), c.getValue()); } } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/controlpanel/PaxHeaders.24993/ControlPanel.java0000644000000000000000000000013212574544466026456 xustar0030 mtime=1441974582.563016762 30 atime=1441974656.375866434 30 ctime=1441974670.084024231 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java0000664000076400007640000004013212574544466027537 0ustar00jvanekjvanek00000000000000/* 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.controlpanel.JVMPanel.JvmValidationResult; import net.sourceforge.jnlp.runtime.Translator; import net.sourceforge.jnlp.security.KeyStores; 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, DeploymentConfiguration.USER_DEPLOYMENT_PROPERTIES_FILE)+"", 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(DeploymentConfiguration.getAppletTrustGlobalSettingsPath(), DeploymentConfiguration.getAppletTrustUserSettingsPath(), 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) { JList list = (JList) e.getSource(); SettingsPanel panel = (SettingsPanel) 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 } KeyStores.setConfiguration(config); SwingUtilities.invokeLater(new Runnable() { @Override public void run() { final ControlPanel editor = new ControlPanel(config); editor.setVisible(true); } }); } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/controlpanel/PaxHeaders.24993/CommandLine.java0000644000000000000000000000013112574544466026243 xustar0029 mtime=1441974582.56201675 30 atime=1441974656.375866434 30 ctime=1441974670.084024231 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/controlpanel/CommandLine.java0000664000076400007640000003750312574544466027335 0ustar00jvanekjvanek00000000000000/* 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.Arrays; 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.config.Setting; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.util.logging.OutputController; /** * Encapsulates a command line interface to the deployment configuration. *

    * The central method is {@link #handle(String[])}, 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(List)} * 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 static final List allCommands = Arrays.asList(new String[] { "list", "get", "set", "reset", "info", "check" }); DeploymentConfiguration config = null; /** * Creates a new instance */ public CommandLine() { 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 * * @param args optional * @return the result of handling the help command. SUCCESS if no errors occurred. */ public int handleHelpCommand(List args) { OutputController.getLogger().printOutLn(R("Usage")); OutputController.getLogger().printOutLn(" " + PROGRAM_NAME + " " + allCommands.toString().replace(',', '|').replaceAll(" ", "") + " [help]"); OutputController.getLogger().printOutLn(R("CLHelpDescription", PROGRAM_NAME)); 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 * * @param args the arguments to the list command * @return result of handling the command. SUCCESS if no errors occurred. */ public int handleListCommand(List args) { if (args.contains("help")) { printListHelp(); return SUCCESS; } boolean verbose = false; if (args.contains("--details")) { verbose = true; args.remove("--details"); } if (args.size() != 0) { printListHelp(); return ERROR; } Map> all = config.getRaw(); for (String key : all.keySet()) { Setting value = all.get(key); OutputController.getLogger().printOutLn(key + ": " + value.getValue()); if (verbose) { 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. * * @param args the arguments to the get command * @return an integer representing success (SUCCESS) or error handling the * get command. */ public int handleGetCommand(List args) { if (args.contains("help")) { printGetHelp(); return SUCCESS; } if (args.size() != 1) { printGetHelp(); return ERROR; } Map> all = config.getRaw(); String key = args.get(0); String value = null; if (all.containsKey(key)) { value = all.get(key).getValue(); OutputController.getLogger().printOutLn(value); return SUCCESS; } else { OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, R("CLUnknownProperty", key)); return ERROR; } } /** * 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 * * @param args the arguments to the set command * @return an integer indicating success (SUCCESS) or error in handling * the command */ public int handleSetCommand(List args) { if (args.contains("help")) { printSetHelp(); return SUCCESS; } if (args.size() != 2) { printSetHelp(); return ERROR; } String key = args.get(0); String value = args.get(1); if (config.getRaw().containsKey(key)) { 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; } } 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; } /** * 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 * * @param args the arguments to the reset command * @return an integer indicating success (SUCCESS) or error in handling * the command */ public int handleResetCommand(List args) { if (args.contains("help")) { printResetHelp(); return SUCCESS; } if (args.size() != 1) { printResetHelp(); return ERROR; } String key = args.get(0); boolean resetAll = false; if (key.equals("all")) { resetAll = true; } Map> all = config.getRaw(); if (!resetAll && !all.containsKey(key)) { OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, R("CLUnknownProperty", key)); return ERROR; } if (resetAll) { for (String aKey: all.keySet()) { Setting setting = all.get(aKey); setting.setValue(setting.getDefaultValue()); } } 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 * * @param args the arguments to the info command * @return an integer indicating success (SUCCESS) or error in handling * the command */ public int handleInfoCommand(List args) { if (args.contains("help")) { printInfoHelp(); return SUCCESS; } if (args.size() != 1) { printInfoHelp(); return ERROR; } Map> all = config.getRaw(); String key = args.get(0); Setting value = all.get(key); if (value == null) { OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, R("CLNoInfo")); return ERROR; } 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 * * @param args the arguments to the check command. * @return an integer indicating success (SUCCESS) or error in handling * the command */ public int handleCheckCommand(List args) { if (args.contains("help")) { printCheckHelp(); return SUCCESS; } if (args.size() != 0) { 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. * * @param commandAndArgs A string array representing the command and * arguments to take action on * @return an integer representing an error code or SUCCESS if no problems * occurred. */ public int handle(String[] commandAndArgs) { if (commandAndArgs == null) { throw new NullPointerException("command is null"); } if (commandAndArgs.length == 0) { handleHelpCommand(new ArrayList()); return ERROR; } String command = commandAndArgs[0]; String[] argsArray = new String[commandAndArgs.length - 1]; System.arraycopy(commandAndArgs, 1, argsArray, 0, commandAndArgs.length - 1); List arguments = new ArrayList(Arrays.asList(argsArray)); int val; if (command.equals("help")) { val = handleHelpCommand(arguments); } else if (command.equals("list")) { val = handleListCommand(arguments); } else if (command.equals("set")) { val = handleSetCommand(arguments); } else if (command.equals("reset")) { val = handleResetCommand(arguments); } else if (command.equals("get")) { val = handleGetCommand(arguments); } else if (command.equals("info")) { val = handleInfoCommand(arguments); } else if (command.equals("check")) { val = handleCheckCommand(arguments); } else if (allCommands.contains(command)) { OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, "INTERNAL ERROR: " + command + " should have been implemented"); val = ERROR; } else { OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, R("CLUnknownCommand", command)); handleHelpCommand(new ArrayList()); val = ERROR; } return val; } /** * The starting point of the program * @param args the command line arguments to this program */ public static void main(String[] args) throws Exception { DeploymentConfiguration.move14AndOlderFilesTo15StructureCatched(); if (args.length == 0) { ControlPanel.main(new String[] {}); } else { CommandLine cli = new CommandLine(); int result = cli.handle(args); // 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); } } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/controlpanel/PaxHeaders.24993/ComboItem.java0000644000000000000000000000013112574544466025733 xustar0029 mtime=1441974582.56201675 30 atime=1441974656.374866422 30 ctime=1441974670.084024231 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/controlpanel/ComboItem.java0000664000076400007640000000320712574544466027017 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/controlpanel/PaxHeaders.24993/CacheViewer.java0000644000000000000000000000013112574544466026242 xustar0029 mtime=1441974582.56201675 30 atime=1441974656.374866422 30 ctime=1441974670.084024231 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/controlpanel/CacheViewer.java0000664000076400007640000001261712574544466027333 0ustar00jvanekjvanek00000000000000/* 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.Dimension; 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 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.5.3/netx/net/sourceforge/jnlp/controlpanel/PaxHeaders.24993/CachePane.java0000644000000000000000000000013212574544466025665 xustar0030 mtime=1441974582.561016739 30 atime=1441974656.374866422 30 ctime=1441974670.084024231 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/controlpanel/CachePane.java0000664000076400007640000004655612574544466026766 0ustar00jvanekjvanek00000000000000/* 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.CacheLRUWrapper; import net.sourceforge.jnlp.cache.CacheUtil; import net.sourceforge.jnlp.cache.DirectoryNode; import net.sourceforge.jnlp.config.DeploymentConfiguration; 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 { JDialog parent; DeploymentConfiguration config; private 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 The DeploymentConfiguration file. */ public CachePane(JDialog parent, DeploymentConfiguration config) { super(new BorderLayout()); this.parent = parent; this.config = config; location = config.getProperty(DeploymentConfiguration.KEY_USER_CACHE_DIR); 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(config.getProperty(DeploymentConfiguration.KEY_USER_NETX_RUNNING_FILE)); 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(location + File.separator + CacheLRUWrapper.CACHE_INDEX_FILE_NAME); 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.5.3/netx/net/sourceforge/jnlp/controlpanel/PaxHeaders.24993/AdvancedProxySettingsPane.0000644000000000000000000000013212574544466030310 xustar0030 mtime=1441974582.561016739 30 atime=1441974656.374866422 30 ctime=1441974670.084024231 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/controlpanel/AdvancedProxySettingsPane.java0000664000076400007640000002530412574544466032237 0ustar00jvanekjvanek00000000000000/* 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 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.5.3/netx/net/sourceforge/jnlp/controlpanel/PaxHeaders.24993/AdvancedProxySettingsDialo0000644000000000000000000000013212574544466030377 xustar0030 mtime=1441974582.560016727 30 atime=1441974656.374866422 30 ctime=1441974670.084024231 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/controlpanel/AdvancedProxySettingsDialog.java0000664000076400007640000001000712574544466032545 0ustar00jvanekjvanek00000000000000/* 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 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.5.3/netx/net/sourceforge/jnlp/controlpanel/PaxHeaders.24993/AboutPanel.java0000644000000000000000000000013212574544466026110 xustar0030 mtime=1441974582.560016727 30 atime=1441974656.374866422 30 ctime=1441974670.084024231 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/controlpanel/AboutPanel.java0000664000076400007640000000514012574544466027171 0ustar00jvanekjvanek00000000000000/* 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; /** * 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(); } }); 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.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/config0000644000000000000000000000013212574544466021703 xustar0030 mtime=1441974582.559016716 30 atime=1441974670.156025059 30 ctime=1441974670.083024219 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/config/0000775000076400007640000000000012574544466023041 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/netx/net/sourceforge/jnlp/config/PaxHeaders.24993/ValueValidator.java0000644000000000000000000000013212574544466025545 xustar0030 mtime=1441974582.559016716 30 atime=1441974656.373866411 30 ctime=1441974670.083024219 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/config/ValueValidator.java0000664000076400007640000000475012574544466026634 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/config/PaxHeaders.24993/Setting.java0000644000000000000000000000013212574544466024240 xustar0030 mtime=1441974582.559016716 30 atime=1441974656.373866411 30 ctime=1441974670.083024219 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/config/Setting.java0000664000076400007640000001307112574544466025323 0ustar00jvanekjvanek00000000000000/* 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; } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/config/PaxHeaders.24993/SecurityValueValidator.java0000644000000000000000000000013212574544466027275 xustar0030 mtime=1441974582.559016716 30 atime=1441974656.373866411 30 ctime=1441974670.083024219 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/config/SecurityValueValidator.java0000664000076400007640000000557512574544466030372 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/config/PaxHeaders.24993/DirectoryValidator.java0000644000000000000000000000013212574544466026435 xustar0030 mtime=1441974582.559016716 30 atime=1441974656.373866411 30 ctime=1441974670.083024219 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/config/DirectoryValidator.java0000664000076400007640000003167712574544466027534 0ustar00jvanekjvanek00000000000000/* * 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 */ 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). */ 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). */ 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 */ 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 *

    */ 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.5.3/netx/net/sourceforge/jnlp/config/PaxHeaders.24993/DeploymentConfiguration.java0000644000000000000000000000013212574544466027473 xustar0030 mtime=1441974582.558016704 30 atime=1441974656.373866411 30 ctime=1441974670.083024219 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java0000664000076400007640000011321312574544466030555 0ustar00jvanekjvanek00000000000000// 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.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.cache.CacheLRUWrapper; 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_SUBDIR_DIR = "icedtea-web"; public static final String DEPLOYMENT_CACHE_DIR = ".cache" + File.separator + DEPLOYMENT_SUBDIR_DIR; public static final String DEPLOYMENT_CONFIG_DIR = ".config" + File.separator + DEPLOYMENT_SUBDIR_DIR; 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 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_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"; /* * 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_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"; 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; /** The user's subdirResult deployment.config file */ private File userPropertiesFile = null; /*default user file*/ public static final File USER_DEPLOYMENT_PROPERTIES_FILE = new File(Defaults.USER_CONFIG_HOME + File.separator + DEPLOYMENT_PROPERTIES); /** the current deployment properties */ private Map> currentConfiguration; /** the deployment properties that cannot be changed */ private Map> unchangeableConfiguration; public DeploymentConfiguration() { 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); } public static File getAppletTrustUserSettingsPath() { return new File(Defaults.USER_CONFIG_HOME + File.separator + APPLET_TRUST_SETTINGS); } public static File getAppletTrustGlobalSettingsPath() { return new File(File.separator + "etc" + File.separator + ".java" + File.separator + "deployment" + File.separator + APPLET_TRUST_SETTINGS); } /** * Initialize this deployment configuration by reading configuration files. * Generally, it will try to continue and ignore errors it finds (such as file not found). * * @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 { // make sure no state leaks if security check fails later on File userFile = new File(USER_DEPLOYMENT_PROPERTIES_FILE.getAbsolutePath()); SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkRead(userFile.toString()); } File systemConfigFile = findSystemConfigFile(); load(systemConfigFile, userFile, fixIssues); } void load(File systemConfigFile, File userFile, boolean fixIssues) throws ConfigurationException { Map> initialProperties = Defaults.getDefaults(); Map> systemProperties = null; /* * 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); } 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); if (userProperties != null) { mergeMaps(initialProperties, userProperties); } if (fixIssues) { checkAndFixConfiguration(initialProperties); } currentConfiguration = initialProperties; } /** * Copies the current configuration into the target */ public void copyTo(Properties target) { Set names = getAllPropertyNames(); for (String name : names) { String value = getProperty(name); // for Properties, missing and null are identical if (value != null) { target.setProperty(name, value); } } } /** * Get the value for the given key * * @param key the property key * @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() { File etcFile = new File(File.separator + "etc" + File.separator + ".java" + File.separator + "deployment" + File.separator + DEPLOYMENT_CONFIG_FILE); if (etcFile.isFile()) { return etcFile; } String jrePath = null; try { Map> tmpProperties = parsePropertiesFile(USER_DEPLOYMENT_PROPERTIES_FILE); Setting jreSetting = tmpProperties.get(KEY_JRE_DIR); if (jreSetting != null) { jrePath = jreSetting.getValue(); } } catch (Exception ex) { OutputController.getLogger().log(ex); } File jreFile; if (jrePath != null) { jreFile = new File(jrePath + File.separator + "lib" + File.separator + DEPLOYMENT_CONFIG_FILE); } else { jreFile = new File(System.getProperty("java.home") + File.separator + "lib" + File.separator + DEPLOYMENT_CONFIG_FILE); } 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); OutputStream out = new BufferedOutputStream(new FileOutputStream(userPropertiesFile)); try { toSave.store(out, DEPLOYMENT_COMMENT); } finally { out.close(); } } /** * 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(); Reader reader = new BufferedReader(new FileReader(propertiesFile)); try { properties.load(reader); } finally { reader.close(); } 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; File configDir = new File(Defaults.USER_CONFIG_HOME); File cacheDir = new File(Defaults.USER_CACHE_HOME); File legacyUserDir = new File(LEGACY_USER_HOME); if (legacyUserDir.exists()) { OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, "Legacy configuration and cache found. Those will be now transported to new locations"); OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, Defaults.USER_CONFIG_HOME + " and " + Defaults.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, " " + Defaults.USER_CONFIG_HOME); errors += resultToStd(configDir.mkdirs()); OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, " " + Defaults.USER_CACHE_HOME); errors += resultToStd(cacheDir.mkdirs()); String legacySecurity = LEGACY_USER_HOME + File.separator + "security"; String currentSecurity = Defaults.USER_SECURITY; errors += moveLegacyToCurrent(legacySecurity, currentSecurity); String legacyCache = LEGACY_USER_HOME + File.separator + "cache"; String currentCache = Defaults.getDefaults().get(DeploymentConfiguration.KEY_USER_CACHE_DIR).getDefaultValue(); errors += moveLegacyToCurrent(legacyCache, currentCache); OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, "Adapting " + CacheLRUWrapper.CACHE_INDEX_FILE_NAME + " to new destination"); //replace all legacyCache by currentCache in new recently_used try { File f = new File(currentCache, CacheLRUWrapper.CACHE_INDEX_FILE_NAME); 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 = Defaults.getDefaults().get(DeploymentConfiguration.KEY_USER_PERSISTENCE_CACHE_DIR).getDefaultValue(); errors += moveLegacyToCurrent(legacyPcahceDir, currentPcacheDir); String legacyLogDir = LEGACY_USER_HOME + File.separator + "log"; String currentLogDir = Defaults.getDefaults().get(DeploymentConfiguration.KEY_USER_LOG_DIR).getDefaultValue(); errors += moveLegacyToCurrent(legacyLogDir, currentLogDir); String legacyProperties = LEGACY_USER_HOME + File.separator + DEPLOYMENT_PROPERTIES; String currentProperties = Defaults.USER_CONFIG_HOME + File.separator + DEPLOYMENT_PROPERTIES; errors += moveLegacyToCurrent(legacyProperties, currentProperties); String legacyPropertiesOld = LEGACY_USER_HOME + File.separator + DEPLOYMENT_PROPERTIES + ".old"; String currentPropertiesOld = Defaults.USER_CONFIG_HOME + File.separator + DEPLOYMENT_PROPERTIES + ".old"; errors += moveLegacyToCurrent(legacyPropertiesOld, currentPropertiesOld); String legacyAppletTrust = LEGACY_USER_HOME + File.separator + APPLET_TRUST_SETTINGS; String currentAppletTrust = getAppletTrustUserSettingsPath().getAbsolutePath(); errors += moveLegacyToCurrent(legacyAppletTrust, currentAppletTrust); String legacyTmp = LEGACY_USER_HOME + File.separator + "tmp"; String currentTmp = Defaults.getDefaults().get(DeploymentConfiguration.KEY_USER_TMP_DIR).getDefaultValue(); 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 " + Defaults.USER_CONFIG_HOME + " and " + Defaults.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: " + Defaults.USER_CONFIG_HOME + " file exists: " + configDir.exists()); } catch (Exception ex) { OutputController.getLogger().log(ex); } try { OutputController.getLogger().log("cache: " + Defaults.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; } } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/config/PaxHeaders.24993/Defaults.java0000644000000000000000000000013212574544466024372 xustar0030 mtime=1441974582.557016693 30 atime=1441974656.372866399 30 ctime=1441974670.083024219 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/config/Defaults.java0000664000076400007640000004661112574544466025463 0ustar00jvanekjvanek00000000000000/* 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 static net.sourceforge.jnlp.runtime.Translator.R; import java.io.File; import java.util.HashMap; import java.util.Map; import net.sourceforge.jnlp.security.appletextendedsecurity.AppletSecurityLevel; import net.sourceforge.jnlp.ShortcutDesc; import net.sourceforge.jnlp.runtime.JNLPProxySelector; /** * This class stores the default configuration */ public class Defaults { final static String SYSTEM_HOME = System.getProperty("java.home"); final static String SYSTEM_SECURITY = SYSTEM_HOME + File.separator + "lib" + File.separator + "security"; final static String USER_CONFIG_HOME; public final static String USER_CACHE_HOME; final static String USER_SECURITY; final static String LOCKS_DIR = System.getProperty("java.io.tmpdir") + File.separator + System.getProperty("user.name") + File.separator + "netx" + File.separator + "locks"; final static File userFile; static { String configHome = System.getProperty("user.home") + File.separator + DeploymentConfiguration.DEPLOYMENT_CONFIG_DIR; String cacheHome = System.getProperty("user.home") + File.separator + DeploymentConfiguration.DEPLOYMENT_CACHE_DIR; String XDG_CONFIG_HOME = System.getenv("XDG_CONFIG_HOME"); String XDG_CACHE_HOME = System.getenv("XDG_CACHE_HOME"); if (XDG_CONFIG_HOME != null) { configHome = XDG_CONFIG_HOME + File.separator + DeploymentConfiguration.DEPLOYMENT_SUBDIR_DIR; } if (XDG_CACHE_HOME != null) { cacheHome = XDG_CACHE_HOME + File.separator + DeploymentConfiguration.DEPLOYMENT_SUBDIR_DIR; } USER_CONFIG_HOME = configHome; USER_CACHE_HOME = cacheHome; USER_SECURITY = USER_CONFIG_HOME + File.separator + "security"; userFile = new File(USER_CONFIG_HOME + File.separator + DeploymentConfiguration.DEPLOYMENT_PROPERTIES); } /** * Get the default settings for deployment */ public static Map> getDefaults() { SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkRead(userFile.toString()); } /* * 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(), USER_CACHE_HOME + File.separator + "cache" }, { DeploymentConfiguration.KEY_USER_PERSISTENCE_CACHE_DIR, BasicValueValidators.getFilePathValidator(), USER_CACHE_HOME + File.separator + "pcache" }, { DeploymentConfiguration.KEY_SYSTEM_CACHE_DIR, BasicValueValidators.getFilePathValidator(), null }, { DeploymentConfiguration.KEY_USER_LOG_DIR, BasicValueValidators.getFilePathValidator(), USER_CONFIG_HOME + File.separator + "log" }, { DeploymentConfiguration.KEY_USER_TMP_DIR, BasicValueValidators.getFilePathValidator(), USER_CACHE_HOME + File.separator + "tmp" }, { DeploymentConfiguration.KEY_USER_LOCKS_DIR, BasicValueValidators.getFilePathValidator(), LOCKS_DIR }, { DeploymentConfiguration.KEY_USER_NETX_RUNNING_FILE, BasicValueValidators.getFilePathValidator(), LOCKS_DIR + File.separator + "netx_running" }, /* certificates and policy files */ { DeploymentConfiguration.KEY_USER_SECURITY_POLICY, BasicValueValidators.getUrlValidator(), "file://" + USER_SECURITY + File.separator + "java.policy" }, { DeploymentConfiguration.KEY_USER_TRUSTED_CA_CERTS, BasicValueValidators.getFilePathValidator(), USER_SECURITY + File.separator + "trusted.cacerts" }, { DeploymentConfiguration.KEY_USER_TRUSTED_JSSE_CA_CERTS, BasicValueValidators.getFilePathValidator(), USER_SECURITY + File.separator + "trusted.jssecacerts" }, { DeploymentConfiguration.KEY_USER_TRUSTED_CERTS, BasicValueValidators.getFilePathValidator(), USER_SECURITY + File.separator + "trusted.certs" }, { DeploymentConfiguration.KEY_USER_TRUSTED_JSSE_CERTS, BasicValueValidators.getFilePathValidator(), USER_SECURITY + File.separator + "trusted.jssecerts" }, { DeploymentConfiguration.KEY_USER_TRUSTED_CLIENT_CERTS, BasicValueValidators.getFilePathValidator(), USER_SECURITY + File.separator + "trusted.clientcerts" }, { DeploymentConfiguration.KEY_SYSTEM_SECURITY_POLICY, BasicValueValidators.getUrlValidator(), null }, { DeploymentConfiguration.KEY_SYSTEM_TRUSTED_CA_CERTS, BasicValueValidators.getFilePathValidator(), SYSTEM_SECURITY + File.separator + "cacerts" }, { DeploymentConfiguration.KEY_SYSTEM_TRUSTED_JSSE_CA_CERTS, BasicValueValidators.getFilePathValidator(), SYSTEM_SECURITY + File.separator + "jssecacerts" }, { DeploymentConfiguration.KEY_SYSTEM_TRUSTED_CERTS, BasicValueValidators.getFilePathValidator(), SYSTEM_SECURITY + File.separator + "trusted.certs" }, { DeploymentConfiguration.KEY_SYSTEM_TRUSTED_JSSE_CERTS, BasicValueValidators.getFilePathValidator(), SYSTEM_SECURITY + File.separator + "trusted.jssecerts" }, { DeploymentConfiguration.KEY_SYSTEM_TRUSTED_CLIENT_CERTS, BasicValueValidators.getFilePathValidator(), SYSTEM_SECURITY + File.separator + "trusted.clientcerts" }, /* 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_SECURITY_INSTALL_AUTHENTICATOR, 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_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.getBooleanValidator(), String.valueOf(true) } }; HashMap> result = new HashMap>(); for (int i = 0; i < defaults.length; i++) { String name = (String) defaults[i][0]; ValueValidator checker = (ValueValidator) defaults[i][1]; String actualValue = (String) defaults[i][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.5.3/netx/net/sourceforge/jnlp/config/PaxHeaders.24993/ConfiguratonValidator.java0000644000000000000000000000013212574544466027127 xustar0030 mtime=1441974582.557016693 30 atime=1441974656.372866399 30 ctime=1441974670.083024219 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/config/ConfiguratonValidator.java0000664000076400007640000001037012574544466030211 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/config/PaxHeaders.24993/BasicValueValidators.java0000644000000000000000000000013212574544466026672 xustar0030 mtime=1441974582.556016681 30 atime=1441974656.372866399 30 ctime=1441974670.083024219 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/config/BasicValueValidators.java0000664000076400007640000002115612574544466027760 0ustar00jvanekjvanek00000000000000/* 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 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 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 */ 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 */ public static ValueValidator getStringValidator(String[] validValues) { return new StringValueValidator(validValues); } /** * @return a {@link ValueValidator} that checks if an object represents a * valid url */ public static ValueValidator getUrlValidator() { return new UrlValidator(); } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/cache0000644000000000000000000000013212574544466021501 xustar0030 mtime=1441974582.556016681 30 atime=1441974670.156025059 30 ctime=1441974670.083024219 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/cache/0000775000076400007640000000000012574544466022637 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/netx/net/sourceforge/jnlp/cache/PaxHeaders.24993/package-info.java0000644000000000000000000000013212574544466024745 xustar0030 mtime=1441974582.556016681 30 atime=1441974656.372866399 30 ctime=1441974670.083024219 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/cache/package-info.java0000664000076400007640000000327212574544466026032 0ustar00jvanekjvanek00000000000000/* 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 netx.sourceforge.jnlp.cache; icedtea-web-1.5.3/netx/net/sourceforge/jnlp/cache/PaxHeaders.24993/UpdatePolicy.java0000644000000000000000000000013212574544466025023 xustar0030 mtime=1441974582.556016681 30 atime=1441974656.372866399 30 ctime=1441974670.083024219 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/cache/UpdatePolicy.java0000664000076400007640000000507712574544466026115 0ustar00jvanekjvanek00000000000000// 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; } /** * Returns whether the resource should be checked for being * up-to-date. */ public boolean shouldUpdate(CacheEntry entry) { long updated = entry.getLastUpdated(); long current = System.currentTimeMillis(); if (current - updated >= timeDiff) return true; else return false; } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/cache/PaxHeaders.24993/ResourceUrlCreator.java0000644000000000000000000000013112574544466026212 xustar0029 mtime=1441974582.55501667 30 atime=1441974656.371866388 30 ctime=1441974670.083024219 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/cache/ResourceUrlCreator.java0000664000076400007640000001570712574544466027306 0ustar00jvanekjvanek00000000000000/* 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.URI; import java.net.URISyntaxException; import java.net.URL; import java.net.URLDecoder; import java.net.URLEncoder; import java.util.LinkedList; import java.util.List; import java.io.UnsupportedEncodingException; 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 = null; 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.requestVersion != 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" + resource.requestVersion); } 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 */ 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.requestVersion != null && resource.requestVersion.isVersionId()) { if (!query.isEmpty()) { query += "&"; } else { query = "?" + query; } query += "version-id=" + resource.requestVersion; } 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.5.3/netx/net/sourceforge/jnlp/cache/PaxHeaders.24993/ResourceTracker.java0000644000000000000000000000013112574544466025523 xustar0029 mtime=1441974582.55501667 30 atime=1441974656.371866388 30 ctime=1441974670.083024219 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/cache/ResourceTracker.java0000664000076400007640000013543012574544466026613 0ustar00jvanekjvanek00000000000000// 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.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.HttpURLConnection; import java.net.InetAddress; import java.net.MalformedURLException; import java.net.URL; import java.net.URLConnection; import java.net.UnknownHostException; import java.security.AccessController; import java.security.PrivilegedAction; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.jar.JarOutputStream; import java.util.jar.Pack200; import java.util.jar.Pack200.Unpacker; import java.util.zip.GZIPInputStream; 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.runtime.JNLPRuntime; import net.sourceforge.jnlp.util.HttpUtils; import net.sourceforge.jnlp.util.logging.OutputController; import net.sourceforge.jnlp.util.UrlUtils; import net.sourceforge.jnlp.util.WeakList; /** * 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 /** notified on initialization or download of a resource */ private static final Object lock = new Object(); // used to lock static structures // shortcuts private static final int UNINITIALIZED = Resource.UNINITIALIZED; private static final int CONNECT = Resource.CONNECT; private static final int CONNECTING = Resource.CONNECTING; private static final int CONNECTED = Resource.CONNECTED; private static final int DOWNLOAD = Resource.DOWNLOAD; private static final int DOWNLOADING = Resource.DOWNLOADING; private static final int DOWNLOADED = Resource.DOWNLOADED; private static final int ERROR = Resource.ERROR; private static final int STARTED = Resource.STARTED; /** max threads */ private static final int maxThreads = 5; /** methods used to try individual URLs when choosing best*/ private static final String[] requestMethods = {"HEAD", "GET"}; /** running threads */ private static int threads = 0; /** weak list of resource trackers with resources to prefetch */ private static WeakList prefetchTrackers = new WeakList(); /** resources requested to be downloaded */ private static ArrayList queue = new ArrayList(); private static ConcurrentHashMap downloadOptions = new ConcurrentHashMap(); /** resource trackers threads are working for (used for load balancing across multi-tracker downloads) */ private static ArrayList active = new ArrayList(); // /** the resources known about by this resource tracker */ private List resources = new ArrayList(); /** download listeners for this tracker */ private List listeners = new ArrayList(); /** whether to download parts before requested */ private 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; if (prefetch) { synchronized (prefetchTrackers) { prefetchTrackers.add(this); prefetchTrackers.trimToSize(); } } } /** * 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 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); boolean downloaded = false; synchronized (resources) { if (resources.contains(resource)) return; resource.addTracker(this); resources.add(resource); } if (options == null) { options = new DownloadOptions(false, false); } downloadOptions.put(resource, 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. downloaded = checkCache(resource, updatePolicy); synchronized (lock) { if (!downloaded) if (prefetch && threads == 0) // existing threads do pre-fetch when queue empty startThread(); } } /** * 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. * * @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.location, resource.downloadVersion)) { // 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(0, DOWNLOADED | CONNECTED | STARTED); } fireDownloadEvent(resource); return true; } if (updatePolicy != UpdatePolicy.ALWAYS && updatePolicy != UpdatePolicy.FORCE) { // save loading entry props file CacheEntry entry = new CacheEntry(resource.location, resource.downloadVersion); if (entry.isCached() && !updatePolicy.shouldUpdate(entry)) { OutputController.getLogger().log("not updating: " + resource.location); synchronized (resource) { resource.localFile = CacheUtil.getCacheFile(resource.location, resource.downloadVersion); resource.size = resource.localFile.length(); resource.transferred = resource.localFile.length(); resource.changeStatus(0, DOWNLOADED | CONNECTED | STARTED); } fireDownloadEvent(resource); return true; } } if (updatePolicy == UpdatePolicy.FORCE) { // ALWAYS update // When we are "always" updating, we update for each instance. Reset resource status. resource.changeStatus(Integer.MAX_VALUE, 0); } // 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. */ protected void fireDownloadEvent(Resource resource) { DownloadListener l[] = null; synchronized (listeners) { l = listeners.toArray(new DownloadListener[0]); } int status; synchronized (resource) { status = resource.status; } DownloadEvent event = new DownloadEvent(this, resource); for (DownloadListener dl : l) { if (0 != ((ERROR | DOWNLOADED) & status)) dl.downloadCompleted(event); else if (0 != (DOWNLOADING & status)) dl.downloadStarted(event); else if (0 != (CONNECTING & status)) 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 | ERROR)) waitForResource(location, 0); if (resource.isSet(ERROR)) return null; if (resource.localFile != null) return resource.localFile; 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 IllegalResourceDescriptorException if the resource is not being tracked */ public boolean waitForResources(URL urls[], long timeout) throws InterruptedException { Resource resources[] = new Resource[urls.length]; synchronized (resources) { // keep the lock so getResource doesn't have to aquire it each time for (int i = 0; i < urls.length; i++) { resources[i] = getResource(urls[i]); } } if (resources.length > 0) return wait(resources, 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).transferred; } /** * Returns whether a resource is available for use (ie, can be * accessed with the getCacheFile method). * * @throws IllegalResourceDescriptorException if the resource is not being tracked */ public boolean checkResource(URL location) { return getResource(location).isSet(DOWNLOADED | ERROR); // isSet atomic } /** * 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. * * @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 = false; synchronized (resource) { if (resource.isSet(ERROR)) return true; enqueue = !resource.isSet(STARTED); if (!resource.isSet(CONNECTED | CONNECTING)) resource.changeStatus(0, CONNECT | STARTED); if (!resource.isSet(DOWNLOADED | DOWNLOADING)) resource.changeStatus(0, DOWNLOAD | STARTED); if (!resource.isSet(DOWNLOAD | CONNECT)) enqueue = false; } if (enqueue) queueResource(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).size; // atomic } /** * Start a new download thread if there are not too many threads * already running. *

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

    */ protected void startThread() { if (threads < maxThreads) { threads++; Thread thread = new Thread(new Downloader(), "DownloaderThread" + threads); thread.start(); } } /** * A thread is ending, called by the thread itself. *

    * Calls to this method should be synchronized. *

    */ private void endThread() { threads--; if (threads < 0) { // this should never happen but try to recover threads = 0; if (queue.size() > 0) // if any on queue make sure a thread is running startThread(); // look into whether this could create a loop throw new RuntimeException("tracker threads < 0"); } if (threads == 0) { synchronized (prefetchTrackers) { queue.trimToSize(); // these only accessed by threads so no sync needed active.clear(); // no threads so no trackers actively downloading active.trimToSize(); prefetchTrackers.trimToSize(); } } } /** * Add a resource to the queue and start a thread to download or * initialize it. */ private void queueResource(Resource resource) { synchronized (lock) { if (!resource.isSet(CONNECT | DOWNLOAD)) throw new IllegalResourceDescriptorException("Invalid resource state (resource: " + resource + ")"); queue.add(resource); startThread(); } } /** * Process the resource by either downloading it or initializing * it. */ private void processResource(Resource resource) { boolean doConnect = false; boolean doDownload = false; synchronized (resource) { if (resource.isSet(CONNECTING)) doConnect = true; } if (doConnect) initializeResource(resource); synchronized (resource) { // return to queue if we just initalized but it still needs // to download (not cached locally / out of date) if (resource.isSet(DOWNLOAD)) // would be DOWNLOADING if connected before this method queueResource(resource); if (resource.isSet(DOWNLOADING)) doDownload = true; } if (doDownload) downloadResource(resource); } /** * Downloads a resource to a file, uncompressing it if required * * @param resource the resource to download */ private void downloadResource(Resource resource) { resource.fireDownloadEvent(); // fire DOWNLOADING CacheEntry origEntry = new CacheEntry(resource.location, resource.downloadVersion); // This is where the jar file will be. origEntry.lock(); try { // create out second in case in does not exist URL realLocation = resource.getDownloadLocation(); URLConnection con = realLocation.openConnection(); con.addRequestProperty("Accept-Encoding", "pack200-gzip, gzip"); con.connect(); /* * We dont really know what we are downloading. If we ask for * foo.jar, the server might send us foo.jar.pack.gz or foo.jar.gz * instead. So we save the file with the appropriate extension */ URL downloadLocation = resource.location; String contentEncoding = con.getContentEncoding(); OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "Downloading" + resource.location + " using " + realLocation + " (encoding : " + contentEncoding + ")"); boolean packgz = "pack200-gzip".equals(contentEncoding) || realLocation.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) { downloadLocation = new URL(downloadLocation.toString() + ".pack.gz"); } else if (gzip) { downloadLocation = new URL(downloadLocation.toString() + ".gz"); } File downloadLocationFile = CacheUtil.getCacheFile(downloadLocation, resource.downloadVersion); CacheEntry downloadEntry = new CacheEntry(downloadLocation, resource.downloadVersion); File finalFile = CacheUtil.getCacheFile(resource.location, resource.downloadVersion); // This is where extracted version will be, or downloaded file if not compressed. if (!downloadEntry.isCurrent(con)) { // Make sure we don't re-download the file. however it will wait as if it was downloading. // (This is fine because file is not ready yet anyways) byte buf[] = new byte[1024]; int rlen; InputStream in = new BufferedInputStream(con.getInputStream()); OutputStream out = CacheUtil.getOutputStream(downloadLocation, resource.downloadVersion); while (-1 != (rlen = in.read(buf))) { resource.transferred += rlen; out.write(buf, 0, rlen); } in.close(); out.close(); // explicitly close the URLConnection. if (con instanceof HttpURLConnection) ((HttpURLConnection) con).disconnect(); /* * If the file was compressed, uncompress it. */ if (packgz) { downloadEntry.initialize(con); GZIPInputStream gzInputStream = new GZIPInputStream(new FileInputStream(CacheUtil .getCacheFile(downloadLocation, resource.downloadVersion))); InputStream inputStream = new BufferedInputStream(gzInputStream); JarOutputStream outputStream = new JarOutputStream(new FileOutputStream(CacheUtil .getCacheFile(resource.location, resource.downloadVersion))); Unpacker unpacker = Pack200.newUnpacker(); unpacker.unpack(inputStream, outputStream); outputStream.close(); inputStream.close(); gzInputStream.close(); } else if (gzip) { downloadEntry.initialize(con); GZIPInputStream gzInputStream = new GZIPInputStream(new FileInputStream(CacheUtil .getCacheFile(downloadLocation, resource.downloadVersion))); InputStream inputStream = new BufferedInputStream(gzInputStream); BufferedOutputStream outputStream = new BufferedOutputStream(new FileOutputStream(CacheUtil .getCacheFile(resource.location, resource.downloadVersion))); while (-1 != (rlen = inputStream.read(buf))) { outputStream.write(buf, 0, rlen); } outputStream.close(); inputStream.close(); gzInputStream.close(); } } else { resource.transferred = downloadLocationFile.length(); } if (!downloadLocationFile.getPath().equals(finalFile.getPath())) { downloadEntry.markForDelete(); downloadEntry.store(); } resource.changeStatus(DOWNLOADING, 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(0, ERROR); synchronized (lock) { lock.notifyAll(); // wake up wait's to check for completion } resource.fireDownloadEvent(); // fire ERROR } finally { origEntry.unlock(); } } /** * Open a URL connection and get the content length and other * fields. */ private void initializeResource(Resource resource) { //verify connection if(!JNLPRuntime.isOfflineForced()){ JNLPRuntime.detectOnline(resource.getLocation()/*or doenloadLocation*/); } resource.fireDownloadEvent(); // fire CONNECTING CacheEntry entry = new CacheEntry(resource.location, resource.requestVersion); entry.lock(); try { File localFile = CacheUtil.getCacheFile(resource.location, resource.downloadVersion); long size = 0; boolean current = true; //this can be null, as it is always filled in online mode, and never read in offline mode URLConnection connection = null; if (localFile != null) { size = localFile.length(); } else if (!JNLPRuntime.isOnline()) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, "You are trying to get resource " + resource.getLocation().toExternalForm() + " but you are in offline mode, and it is not in cache. Attempting to continue, but you may expect failure"); } if (JNLPRuntime.isOnline()) { // connect URL finalLocation = findBestUrl(resource); if (finalLocation == null) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, "Attempted to download " + resource.location + ", but failed to connect!"); throw new NullPointerException("finalLocation == null"); // Caught below } resource.setDownloadLocation(finalLocation); connection = finalLocation.openConnection(); // this won't change so should be okay unsynchronized connection.addRequestProperty("Accept-Encoding", "pack200-gzip, gzip"); size = connection.getContentLength(); current = CacheUtil.isCurrent(resource.location, resource.requestVersion, connection) && 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.location, resource.downloadVersion); CacheEntry newEntry = new CacheEntry(resource.location, resource.requestVersion); newEntry.lock(); entry.unlock(); entry = newEntry; } } } synchronized (resource) { resource.localFile = localFile; // resource.connection = connection; resource.size = size; resource.changeStatus(CONNECT | CONNECTING, CONNECTED); // check if up-to-date; if so set as downloaded if (current) resource.changeStatus(DOWNLOAD | DOWNLOADING, DOWNLOADED); } // update cache entry if (!current && JNLPRuntime.isOnline()) entry.initialize(connection); 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. if (connection instanceof HttpURLConnection) ((HttpURLConnection) connection).disconnect(); } catch (Exception ex) { OutputController.getLogger().log(ex); resource.changeStatus(0, ERROR); synchronized (lock) { lock.notifyAll(); // wake up wait's to check for completion } resource.fireDownloadEvent(); // fire ERROR } finally { entry.unlock(); } } /** * testing wrapper * * @param url * @param requestProperties * @param requestMethod * @return * @throws IOException */ static int getUrlResponseCode(URL url, Map requestProperties, String requestMethod) throws IOException { return getUrlResponseCodeWithRedirectonResult(url, requestProperties, requestMethod).result; } private static class CodeWithRedirect { int result = HttpURLConnection.HTTP_OK; URL URL; public boolean shouldRedirect() { return (result == 301 || result == 302 || result == 303/*?*/ || result == 307 || result == 308); } public boolean isInvalid() { return (result < 200 || result >= 300); } } /** * 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 CodeWithRedirect getUrlResponseCodeWithRedirectonResult(URL url, Map requestProperties, String requestMethod) throws IOException { CodeWithRedirect result = new CodeWithRedirect(); URLConnection connection = url.openConnection(); for (Map.Entry property : requestProperties.entrySet()) { connection.addRequestProperty(property.getKey(), property.getValue()); } if (connection instanceof HttpURLConnection) { HttpURLConnection httpConnection = (HttpURLConnection) connection; httpConnection.setRequestMethod(requestMethod); int responseCode = httpConnection.getResponseCode(); /* Fully consuming current request helps with connection re-use * See http://docs.oracle.com/javase/1.5.0/docs/guide/net/http-keepalive.html */ HttpUtils.consumeAndCloseConnectionSilently(httpConnection); 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); } return result; } /** * 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 */ URL findBestUrl(Resource resource) { DownloadOptions options = downloadOptions.get(resource); if (options == null) { options = new DownloadOptions(false, false); } List urls = new ResourceUrlCreator(resource, options).getUrls(); OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "All possible urls for " + resource.toString() + " : " + urls); for (String requestMethod : requestMethods) { 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"); CodeWithRedirect 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); return url; /* 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; } /** * Pick the next resource to download or initialize. If there * are no more resources requested then one is taken from a * resource tracker with prefetch enabled. *

    * The resource state is advanced before it is returned * (CONNECT->CONNECTING). *

    *

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

    * * @return the resource to initialize or download, or {@code null} */ private static Resource selectNextResource() { Resource result; // pick from queue result = selectByFlag(queue, CONNECT, ERROR); // connect but not error if (result == null) result = selectByFlag(queue, DOWNLOAD, ERROR | CONNECT | CONNECTING); // remove from queue if found if (result != null) queue.remove(result); // prefetch if nothing found so far and this is the last thread if (result == null && threads == 1) result = getPrefetch(); if (result == null) return null; synchronized (result) { if (result.isSet(CONNECT)) { result.changeStatus(CONNECT, CONNECTING); } else if (result.isSet(DOWNLOAD)) { // only download if *not* connecting, when done connecting // select next will pick up the download part. This makes // all requested connects happen before any downloads, so // the size is known as early as possible. result.changeStatus(DOWNLOAD, DOWNLOADING); } } return result; } /** * Returns the next resource to be prefetched before * requested. *

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

    */ private static Resource getPrefetch() { Resource result = null; Resource alternate = null; // first find one to initialize synchronized (prefetchTrackers) { for (int i = 0; i < prefetchTrackers.size() && result == null; i++) { ResourceTracker tracker = prefetchTrackers.get(i); if (tracker == null) continue; synchronized (tracker.resources) { result = selectByFlag(tracker.resources, UNINITIALIZED, ERROR); if (result == null && alternate == null) alternate = selectByFlag(tracker.resources, CONNECTED, ERROR | DOWNLOADED | DOWNLOADING | DOWNLOAD); } } } // if none to initialize, switch to download if (result == null) result = alternate; if (result == null) return null; synchronized (result) { ResourceTracker tracker = result.getTracker(); if (tracker == null) return null; // GC of tracker happened between above code and here // prevents startResource from putting it on queue since // we're going to return it. result.changeStatus(0, STARTED); tracker.startResource(result); } return result; } /** * 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. *

    */ private static Resource selectByFlag(List source, int flag, int notflag) { Resource result = null; int score = Integer.MAX_VALUE; for (Resource resource : source) { boolean selectable = false; synchronized (resource) { if (resource.isSet(flag) && !resource.isSet(notflag)) selectable = true; } if (selectable) { int activeCount = 0; for (ResourceTracker rt : active) { if (rt == resource.getTracker()) activeCount++; } // try to spread out the downloads so that a slow host // won't monopolize the downloads if (activeCount < score) { result = resource; score = activeCount; } } } return result; } /** * 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 (CacheUtil.urlEquals(resource.location, 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 | 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); } } } private static class RedirectionException extends RuntimeException { public RedirectionException(String string) { super(string); } public RedirectionException(Throwable cause) { super(cause); } } // inner classes /** * This class downloads and initializes the queued resources. */ private class Downloader implements Runnable { Resource resource = null; public void run() { while (true) { synchronized (lock) { // remove from active list, used for load balancing if (resource != null) active.remove(resource.getTracker()); resource = selectNextResource(); if (resource == null) { endThread(); break; } // add to active list, used for load balancing active.add(resource.getTracker()); } try { // Resource processing involves writing to files // (cache entry trackers, the files themselves, etc.) // and it therefore needs to be privileged final Resource fResource = resource; AccessController.doPrivileged(new PrivilegedAction() { public Void run() { processResource(fResource); return null; } }); } catch (Exception ex) { OutputController.getLogger().log(ex); } } // should have a finally in case some exception is thrown by // selectNextResource(); } }; } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/cache/PaxHeaders.24993/Resource.java0000644000000000000000000000013212574544466024210 xustar0030 mtime=1441974582.554016658 30 atime=1441974656.371866388 30 ctime=1441974670.083024219 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/cache/Resource.java0000664000076400007640000002237612574544466025303 0ustar00jvanekjvanek00000000000000// 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 net.sourceforge.jnlp.util.logging.OutputController; import java.io.*; import java.net.*; import java.util.*; import net.sourceforge.jnlp.*; import net.sourceforge.jnlp.runtime.*; import net.sourceforge.jnlp.util.*; /** *

    * 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. /** status bits */ public static final int UNINITIALIZED = 0; public static final int CONNECT = 1; public static final int CONNECTING = 2; public static final int CONNECTED = 4; public static final int DOWNLOAD = 8; public static final int DOWNLOADING = 16; public static final int DOWNLOADED = 32; public static final int ERROR = 64; public static final int STARTED = 128; // enqueued or being worked on /** list of weak references of resources currently in use */ private static WeakList resources = new WeakList(); /** weak list of trackers monitoring this resource */ private WeakList trackers = new WeakList(); /** the remote location of the resource */ URL location; /** the location to use when downloading */ private URL downloadLocation; /** the local file downloaded to */ File localFile; /** the requested version */ Version requestVersion; /** the version downloaded from server */ Version downloadVersion; /** amount in bytes transferred */ long transferred = 0; /** total size of the resource, or -1 if unknown */ long size = -1; /** the status of the resource */ int status = UNINITIALIZED; /** Update policy for this resource */ UpdatePolicy updatePolicy; /** * 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. */ public static Resource getResource(URL location, Version requestVersion, UpdatePolicy updatePolicy) { 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. */ 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 location */ public void setDownloadLocation(URL location) { downloadLocation = location; } /** * 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; } } /** * Returns true if any of the specified flags are set. */ public boolean isSet(int flag) { if (flag == UNINITIALIZED) return status == UNINITIALIZED; else return (status & flag) != 0; } /** * Returns the update policy for this resource * * @return The update policy */ public UpdatePolicy getUpdatePolicy() { return this.updatePolicy; } /** * Returns a human-readable status string. */ private String getStatusString(int flag) { StringBuffer result = new StringBuffer(); if (flag == 0) result.append("<> "); if ((flag & CONNECT) != 0) result.append("CONNECT "); if ((flag & CONNECTING) != 0) result.append("CONNECTING "); if ((flag & CONNECTED) != 0) result.append("CONNECTED "); if ((flag & DOWNLOAD) != 0) result.append("DOWNLOAD "); if ((flag & DOWNLOADING) != 0) result.append("DOWNLOADING "); if ((flag & DOWNLOADED) != 0) result.append("DOWNLOADED "); if ((flag & ERROR) != 0) result.append("ERROR "); if ((flag & STARTED) != 0) result.append("STARTED "); return result.deleteCharAt(result.length() - 1).toString(); } /** * 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. */ public void changeStatus(int clear, int add) { int orig = 0; synchronized (this) { orig = status; this.status &= ~clear; this.status |= add; } if (status != orig) { OutputController.getLogger().log("Status: " + getStatusString(status)); if ((status & ~orig) != 0) { OutputController.getLogger().log(" +(" + getStatusString(status & ~orig) + ")"); } if ((~status & orig) != 0) { OutputController.getLogger().log(" -(" + getStatusString(~status & orig) + ")"); } OutputController.getLogger().log(" @ " + location.getPath()); } } /** * Removes the tracker to the list of trackers monitoring this * resource. */ public void removeTracker(ResourceTracker tracker) { synchronized (trackers) { trackers.remove(tracker); trackers.trimToSize(); } } /** * Adds the tracker to the list of trackers monitoring this * 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 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 CacheUtil.urlEquals(location, ((Resource) other).location); } return false; } public String toString() { return "location=" + location.toString() + " state=" + getStatusString(status); } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/cache/PaxHeaders.24993/NativeLibraryStorage.java0000644000000000000000000000013212574544466026521 xustar0030 mtime=1441974582.553016647 30 atime=1441974656.371866388 30 ctime=1441974670.083024219 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/cache/NativeLibraryStorage.java0000664000076400007640000001221112574544466027577 0ustar00jvanekjvanek00000000000000package 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.runtime.JNLPRuntime; 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 ResourceTracker tracker; private 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 */ 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. * Returns 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. */ public void addSearchJar(URL jarLocation) { OutputController.getLogger().log("Activate native: " + jarLocation); File localFile = tracker.getCacheFile(jarLocation); if (localFile == null) return; 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)); } jarFile.close(); } 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.5.3/netx/net/sourceforge/jnlp/cache/PaxHeaders.24993/LruCacheException.java0000644000000000000000000000013212574544466025766 xustar0030 mtime=1441974582.553016647 30 atime=1441974656.371866388 30 ctime=1441974670.083024219 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/cache/LruCacheException.java0000664000076400007640000000367512574544466027062 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/cache/PaxHeaders.24993/IllegalResourceDescriptorExceptio0000644000000000000000000000013212574544466030322 xustar0030 mtime=1441974582.553016647 30 atime=1441974656.370866376 30 ctime=1441974670.083024219 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/cache/IllegalResourceDescriptorException.java0000664000076400007640000000401612574544466032502 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/cache/PaxHeaders.24993/DownloadIndicator.java0000644000000000000000000000013212574544466026025 xustar0030 mtime=1441974582.552016635 30 atime=1441974656.370866376 30 ctime=1441974670.083024219 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/cache/DownloadIndicator.java0000664000076400007640000000640512574544466027113 0ustar00jvanekjvanek00000000000000// 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 */ 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.5.3/netx/net/sourceforge/jnlp/cache/PaxHeaders.24993/DirectoryNode.java0000644000000000000000000000013212574544466025173 xustar0030 mtime=1441974582.552016635 30 atime=1441974656.370866376 30 ctime=1441974670.083024219 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/cache/DirectoryNode.java0000664000076400007640000001216612574544466026262 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/cache/PaxHeaders.24993/DefaultDownloadIndicator.java0000644000000000000000000000013212574544466027332 xustar0030 mtime=1441974582.552016635 30 atime=1441974656.370866376 30 ctime=1441974670.083024219 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/cache/DefaultDownloadIndicator.java0000664000076400007640000004060212574544466030415 0ustar00jvanekjvanek00000000000000// 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 JFrame frame; private static final Object frameMutex = 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. */ public int getUpdateRate() { return 150; //ms } /** * Return the initial delay before obtaining a listener. */ 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) */ public DownloadServiceListener getListener(ApplicationInstance app, String downloadName, URL resources[]) { DownloadPanel result = new DownloadPanel(downloadName); synchronized (frameMutex) { if (frame == null) { frame=createDownloadIndicatorFrame(true); } if (resources != null) { for (URL url : resources) { result.addProgressPanel(url, null); } } frame.getContentPane().add(result, vertical); frame.pack(); placeFrameToLowerRight(); result.addComponentListener(new ComponentAdapter() { @Override public void componentResized(ComponentEvent e) { placeFrameToLowerRight(); } }); frame.setVisible(true); return result; } } public static JFrame createDownloadIndicatorFrame(boolean undecorated) throws HeadlessException { JFrame f = new JFrame(downloading + "..."); f.setUndecorated(undecorated); f.setIconImages(ImageResources.INSTANCE.getApplicationImages()); f.getContentPane().setLayout(new GridBagLayout()); return f; } /** * This places indicator to lower right corner of active monitor. */ private static void placeFrameToLowerRight() throws HeadlessException { Rectangle bounds = ScreenFinder.getCurrentScreenSizeWithoutBounds(); frame.setLocation(bounds.width+bounds.x - frame.getWidth(), bounds.height+bounds.y - frame.getHeight()); } /** * Remove a download service listener that was obtained by * calling the getDownloadListener method from the shared * download info window. */ public void disposeListener(final DownloadServiceListener listener) { if (!(listener instanceof DownloadPanel)) return; ActionListener hider = new ActionListener() { public void actionPerformed(ActionEvent evt) { synchronized(frameMutex) { frame.getContentPane().remove((DownloadPanel) listener); frame.pack(); if (frame.getContentPane().getComponentCount() == 0) { frame.setVisible(false); frame.dispose(); frame = 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 { JFrame oldFrame = frame; frame = createDownloadIndicatorFrame(undecorated); frame.getContentPane().add(self, vertical); synchronized (frameMutex) { frame.pack(); placeFrameToLowerRight(); } frame.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 (frameMutex) { frame.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() { 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 frame to new length of header text while (c != null) { c.invalidate(); c.validate(); if (c instanceof Window){ ((Window) c).pack(); } c=c.getParent(); } if (mainProgressPanel != null) { mainProgressPanel.setProgress(percent, 100); mainProgressPanel.repaint(); } } /** * Called when a download failed. */ public void downloadFailed(URL url, String version) { update(url, version, -1, -1, -1); } /** * Called when a download has progressed. */ 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. */ public void upgradingArchive(URL url, String version, int patchPercent, int overallPercent) { update(url, version, patchPercent, 100, overallPercent); } /** * Called when a download is being validated. */ 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 { private JPanel bar = new JPanel(); private long total; private long readSoFar; private Dimension size = new Dimension(80, 15); ProgressPanel() { bar.setMinimumSize(size); bar.setPreferredSize(size); bar.setOpaque(false); setLayout(new GridBagLayout()); GridBagConstraints gbc = new GridBagConstraints(); styleGridBagConstraints(gbc); add(bar, gbc); } ProgressPanel(URL url, String version) { 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; } 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.5.3/netx/net/sourceforge/jnlp/cache/PaxHeaders.24993/CacheUtil.java0000644000000000000000000000013212574544466024262 xustar0030 mtime=1441974582.551016624 30 atime=1441974656.370866376 30 ctime=1441974670.083024219 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/cache/CacheUtil.java0000664000076400007640000006333612574544466025356 0ustar00jvanekjvanek00000000000000// 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.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.FilePermission; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.MalformedURLException; import java.net.URL; import java.net.URLConnection; import java.nio.channels.FileChannel; import java.nio.channels.FileLock; import java.nio.channels.OverlappingFileLockException; import java.security.Permission; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map.Entry; import java.util.Set; import javax.jnlp.DownloadServiceListener; import net.sourceforge.jnlp.Version; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.ApplicationInstance; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.util.FileUtils; import net.sourceforge.jnlp.util.logging.OutputController; import net.sourceforge.jnlp.util.PropertiesFile; import net.sourceforge.jnlp.util.UrlUtils; /** * 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 { private static final String setCacheDir = JNLPRuntime.getConfiguration().getProperty(DeploymentConfiguration.KEY_USER_CACHE_DIR); private static final String cacheDir = new File(setCacheDir != null ? setCacheDir : System.getProperty("java.io.tmpdir")).getPath(); // Do this with file to standardize it. private static final CacheLRUWrapper lruHandler = CacheLRUWrapper.getInstance(); private static final HashMap propertiesLockPool = new HashMap(); /** * Compares a URL using string compare 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). */ 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) { //keep silent here and return false } return false; } private static boolean notNullUrlEquals(URL u1, URL u2) { if (!compare(u1.getProtocol(), u2.getProtocol(), true) || !compare(u1.getHost(), u2.getHost(), true) || //u1.getDefaultPort() != u2.getDefaultPort() || // only in 1.4 !compare(u1.getPath(), u2.getPath(), false) || !compare(u1.getQuery(), u2.getQuery(), false) || !compare(u1.getRef(), u2.getRef(), false)) { return false; } else { return true; } } /** * 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} * @return either the location in the cache or the original location */ public static URL getCachedResource(URL location, Version version, UpdatePolicy policy) { ResourceTracker rt = new ResourceTracker(); rt.addResource(location, version, null, policy); try { File f = rt.getCacheFile(location); // TODO: Should be toURI().toURL() return f.toURL(); } catch (MalformedURLException ex) { return location; } } /** * Compare strings that can be {@code null}. */ private static boolean compare(String s1, String s2, boolean ignore) { if (s1 == s2) return true; if (s1 == null || s2 == null) return false; if (ignore) return s1.equalsIgnoreCase(s2); else return s1.equals(s2); } /** * Returns the Permission object necessary to access the * resource, or {@code null} if no permission is needed. */ public static Permission getReadPermission(URL location, Version version) { if (CacheUtil.isCacheable(location, version)) { File file = CacheUtil.getCacheFile(location, version); return new FilePermission(file.getPath(), "read"); } else { try { // this is what URLClassLoader does return location.openConnection().getPermission(); } catch (java.io.IOException ioe) { // should try to figure out the permission OutputController.getLogger().log(ioe); } } return null; } /** * 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()} */ public static boolean clearCache() { if (!okToClearCache()) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, R("CCannotClearCache")); return false; } File cacheDir = new File(CacheUtil.cacheDir); 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 = new File(JNLPRuntime.getConfiguration().getProperty(DeploymentConfiguration.KEY_USER_NETX_RUNNING_FILE)); 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 connection a connection to the {@link URL}, or {@code null} * @return whether the cache contains the version * @throws IllegalArgumentException if the source is not cacheable */ public static boolean isCurrent(URL source, Version version, URLConnection connection) { if (!isCacheable(source, version)) throw new IllegalArgumentException(R("CNotCacheable", source)); try { if (connection == null) connection = source.openConnection(); connection.connect(); CacheEntry entry = new CacheEntry(source, version); // could pool this boolean result = entry.isCurrent(connection); 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. */ 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; synchronized (lruHandler) { 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(); 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) { 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 = cacheDir.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. */ public static String getCacheParentDirectory(String filePath) { String path = filePath; String tempPath = ""; while(path.startsWith(cacheDir) && !path.equals(cacheDir)){ tempPath = new File(path).getParent(); if (tempPath.equals(cacheDir)) break; path = tempPath; } return path; } /** * This will create a new entry for the cache item. It is however not * initialized but any future calls to getCacheFile with the source and * version given to here, will cause it to return this item. * * @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) { synchronized (lruHandler) { lruHandler.lock(); lruHandler.load(); File cacheFile = null; for (long i = 0; i < Long.MAX_VALUE; i++) { String path = cacheDir + 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(); 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 */ 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. */ 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(); } StringBuffer path = new StringBuffer(); 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)); return new File(FileUtils.sanitizePath(path.toString())); } /** * Waits until the resources are downloaded, while showing a * progress indicator. * * @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() { if (okToClearCache()) { // First we want to figure out which stuff we need to delete. HashSet keep = new HashSet(); HashSet remove = new HashSet(); lruHandler.load(); long maxSize = -1; // Default try { maxSize = Long.parseLong(JNLPRuntime.getConfiguration().getProperty("deployment.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(cacheDir.length()); rStr = cacheDir + 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(); /* * FIXME: if cacheDir is for example $USER_HOME and they have a folder called http * and/or https. These would get removed. */ remove.add(cacheDir + File.separator + "http"); remove.add(cacheDir + File.separator + "https"); 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) { } } } /** * Lock the property file and add it to our pool of locks. * * @param properties Property file to lock. */ public static void lockFile(PropertiesFile properties) { String storeFilePath = properties.getStoreFile().getPath(); try { propertiesLockPool.put(storeFilePath, FileUtils.getFileLock(storeFilePath, false, true)); } catch (OverlappingFileLockException e) { } catch (FileNotFoundException e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); } } /** * Unlock the property file and remove it from our pool. Nothing happens if * it wasn't locked. * * @param properties Property file to unlock. */ public static void unlockFile(PropertiesFile properties) { File storeFile = properties.getStoreFile(); FileLock fl = propertiesLockPool.get(storeFile.getPath()); try { if (fl == null) return; fl.release(); fl.channel().close(); propertiesLockPool.remove(storeFile.getPath()); } catch (IOException e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); } } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/cache/PaxHeaders.24993/CacheLRUWrapper.java0000644000000000000000000000013212574544466025350 xustar0030 mtime=1441974582.550016612 30 atime=1441974656.370866376 30 ctime=1441974670.083024219 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/cache/CacheLRUWrapper.java0000664000076400007640000002435712574544466026444 0ustar00jvanekjvanek00000000000000/* 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 java.util.Set; import static net.sourceforge.jnlp.runtime.Translator.R; import java.io.File; import java.io.IOException; import java.nio.channels.FileLock; import java.nio.channels.OverlappingFileLockException; 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 net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.util.FileUtils; import net.sourceforge.jnlp.util.logging.OutputController; import net.sourceforge.jnlp.util.PropertiesFile; /** * This class helps maintain the ordering of most recently use items across * multiple jvm instances. * * @author Andrew Su (asu@redhat.com, andrew.su@utoronto.ca) * */ public enum CacheLRUWrapper { INSTANCE; private int lockCount = 0; /* lock for the file RecentlyUsed */ private FileLock fl = null; /* location of cache directory */ private final String setCachePath = JNLPRuntime.getConfiguration().getProperty(DeploymentConfiguration.KEY_USER_CACHE_DIR); String cacheDir = new File(setCachePath != null ? setCachePath : System.getProperty("java.io.tmpdir")).getPath(); /* * 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. */ PropertiesFile cacheOrder = new PropertiesFile( new File(cacheDir + File.separator + CACHE_INDEX_FILE_NAME)); public static final String CACHE_INDEX_FILE_NAME = "recently_used"; private CacheLRUWrapper() { File f = cacheOrder.getStoreFile(); if (!f.exists()) { try { FileUtils.createParentDir(f); FileUtils.createRestrictedFile(f, 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 INSTANCE; } /** * Update map for keeping track of recently used items. */ public synchronized void load() { boolean loaded = cacheOrder.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 cacheOrder and remove invalid/corrupt entries * * @return true, if cache was corrupted and affected entry removed */ private boolean checkData () { boolean modified = false; Set> q = cacheOrder.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.indexOf(cacheDir) < 0) { it.remove(); modified = true; } } else { it.remove(); modified = true; } } return modified; } /** * Write file to disk. */ public synchronized void store() { cacheOrder.store(); } /** * 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) { if (cacheOrder.containsKey(key)) return false; cacheOrder.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) { if (!cacheOrder.containsKey(key)) return false; cacheOrder.remove(key); return true; } private String getIdForCacheFolder(String folder) { int len = cacheDir.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) { if (!cacheOrder.containsKey(oldKey)) return false; String value = cacheOrder.getProperty(oldKey); String folder = getIdForCacheFolder(value); cacheOrder.remove(oldKey); cacheOrder.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(cacheOrder.entrySet()); // 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() { try { fl = FileUtils.getFileLock(cacheOrder.getStoreFile().getPath(), false, true); } catch (OverlappingFileLockException e) { // if overlap we just increase the count. } catch (Exception e) { // We didn't get a lock.. OutputController.getLogger().log(e); } if (fl != null) lockCount++; } /** * Unlock the file. */ public synchronized void unlock() { if (fl != null) { lockCount--; try { if (lockCount == 0) { fl.release(); fl.channel().close(); fl = null; } } catch (IOException e) { OutputController.getLogger().log(e); } } } /** * Return the value of given key. * * @param key * @return value of given key, null otherwise. */ public synchronized String getValue(String key) { return cacheOrder.getProperty(key); } /** * Test if we the key provided is in use. * * @param key key to be tested. * @return true if the key is in use. */ public synchronized boolean contains(String key) { return cacheOrder.contains(key); } /** * 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() { cacheOrder.clear(); } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/cache/PaxHeaders.24993/CacheEntry.java0000644000000000000000000000013212574544466024446 xustar0030 mtime=1441974582.550016612 30 atime=1441974656.369866365 30 ctime=1441974670.083024219 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/cache/CacheEntry.java0000664000076400007640000001267312574544466025540 0ustar00jvanekjvanek00000000000000// 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 net.sourceforge.jnlp.util.logging.OutputController; import static net.sourceforge.jnlp.runtime.Translator.R; import java.io.*; import java.net.*; import net.sourceforge.jnlp.*; import net.sourceforge.jnlp.runtime.*; import net.sourceforge.jnlp.util.*; /** * Describes an entry in the cache. * * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.10 $ */ public class CacheEntry { /** the remote resource location */ private URL location; /** the requested version */ private Version version; /** info about the cached file */ private 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; File infoFile = CacheUtil.getCacheFile(location, version); infoFile = new File(infoFile.getPath() + ".info"); // replace with something that can't be clobbered properties = new PropertiesFile(infoFile, R("CAutoGen")); } /** * Initialize the cache entry data from a connection to the * remote resource (does not store data). */ void initialize(URLConnection connection) { long modified = connection.getLastModified(); long length = connection.getContentLength(); // an int properties.setProperty("content-length", Long.toString(length)); properties.setProperty("last-modified", Long.toString(modified)); } /** * Returns the remote location this entry caches. */ public URL getLocation() { return location; } /** * Returns the time in the local system clock that the file was * most recently checked for an update. */ public long getLastUpdated() { try { return Long.parseLong(properties.getProperty("last-updated")); } catch (Exception ex) { return 0; } } /** * Sets the time in the local system clock that the file was * most recently checked for an update. */ public void setLastUpdated(long updatedTime) { properties.setProperty("last-updated", Long.toString(updatedTime)); } /** * 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 connection a connection to the remote URL * @return whether the cache contains the version */ public boolean isCurrent(URLConnection connection) { boolean cached = isCached(); if (!cached) return false; try { long remoteModified = connection.getLastModified(); long cachedModified = Long.parseLong(properties.getProperty("last-modified")); if (remoteModified > 0 && remoteModified <= cachedModified) return true; else return false; } catch (Exception ex) { OutputController.getLogger().log(ex);; return cached; // 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. * * @return true if the resource is in the cache */ public boolean isCached() { File localFile = CacheUtil.getCacheFile(location, version); if (!localFile.exists()) return false; try { long cachedLength = localFile.length(); long remoteLength = Long.parseLong(properties.getProperty("content-length", "-1")); if (remoteLength >= 0 && cachedLength != remoteLength) return false; else return true; } catch (Exception ex) { OutputController.getLogger().log(ex); return false; // should throw? } } /** * Save the current information for the cache entry. */ protected void store() { properties.store(); } /** * 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() { CacheUtil.lockFile(properties); } /** * Unlock cache item. */ protected void unlock() { CacheUtil.unlockFile(properties); } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/cache/PaxHeaders.24993/CacheDirectory.java0000644000000000000000000000013012574544466025307 xustar0028 mtime=1441974582.5490166 30 atime=1441974656.369866365 30 ctime=1441974670.083024219 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/cache/CacheDirectory.java0000664000076400007640000001031612574544466026373 0ustar00jvanekjvanek00000000000000/* 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 */ public static void cleanParent(DirectoryNode fileNode) { DirectoryNode parent = fileNode.getParent(); if (parent.getParent() == null) return; // Don't delete the root. if (parent.getChildren().size() == 0) { FileUtils.deleteWithErrMesg(parent.getFile()); parent.getParent().removeChild(parent); cleanParent(parent); } } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/browser0000644000000000000000000000013012574544466022117 xustar0028 mtime=1441974582.5490166 30 atime=1441974670.156025059 30 ctime=1441974670.083024219 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/browser/0000775000076400007640000000000012574544466023257 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/netx/net/sourceforge/jnlp/browser/PaxHeaders.24993/FirefoxPreferencesParser.java0000644000000000000000000000013012574544466030000 xustar0028 mtime=1441974582.5490166 30 atime=1441974656.369866365 30 ctime=1441974670.083024219 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/browser/FirefoxPreferencesParser.java0000664000076400007640000001362012574544466031065 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/browser/PaxHeaders.24993/FirefoxPreferencesFinder.java0000644000000000000000000000013012574544466027753 xustar0028 mtime=1441974582.5490166 30 atime=1441974656.369866365 30 ctime=1441974670.083024219 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/browser/FirefoxPreferencesFinder.java0000664000076400007640000001201312574544466031033 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/browser/PaxHeaders.24993/BrowserAwareProxySelector.java0000644000000000000000000000013212574544466030207 xustar0030 mtime=1441974582.548016589 30 atime=1441974656.369866365 30 ctime=1441974670.083024219 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/browser/BrowserAwareProxySelector.java0000664000076400007640000002361612574544466031300 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/about0000644000000000000000000000013212574544466021550 xustar0030 mtime=1441974582.548016589 30 atime=1441974670.156025059 30 ctime=1441974670.083024219 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/about/0000775000076400007640000000000012574544466022706 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/netx/net/sourceforge/jnlp/about/PaxHeaders.24993/HTMLPanel.java0000644000000000000000000000013212574544466024214 xustar0030 mtime=1441974582.548016589 30 atime=1441974656.368866353 30 ctime=1441974670.083024219 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/about/HTMLPanel.java0000664000076400007640000000636712574544466025311 0ustar00jvanekjvanek00000000000000/* 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.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 { private String id; public HTMLPanel(URL url, String identifier) { super(new BorderLayout()); id = identifier; JEditorPane pane = new JEditorPane(); 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); } public String getIdentifier() { return id; } 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.5.3/netx/net/sourceforge/jnlp/about/PaxHeaders.24993/AboutDialog.java0000644000000000000000000000013212574544466024662 xustar0030 mtime=1441974582.547016577 30 atime=1441974656.368866353 30 ctime=1441974670.083024219 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/about/AboutDialog.java0000664000076400007640000001553612574544466025755 0ustar00jvanekjvanek00000000000000/* 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.net.URL; import javax.swing.JButton; import javax.swing.JDialog; import javax.swing.JPanel; import javax.swing.SwingUtilities; import javax.swing.UIManager; import javax.swing.border.EmptyBorder; import net.sourceforge.jnlp.util.ScreenFinder; public class AboutDialog extends JPanel implements Runnable, ActionListener { private static final String about_url = "/net/sourceforge/jnlp/resources/about.html"; 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 JDialog frame; private JPanel contentPane; private HTMLPanel aboutPanel, authorsPanel, newsPanel, changelogPanel, copyingPanel; private JButton aboutButton, authorsButton, newsButton, changelogButton, copyingButton; public AboutDialog(boolean modal) { super(new GridBagLayout()); frame = new JDialog((Frame)null, R("AboutDialogueTabAbout") + " IcedTea-Web", modal); frame.setContentPane(this); frame.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); URL res_about = getClass().getResource(about_url); URL res_authors = getClass().getResource(authors_url); URL res_news = getClass().getResource(news_url); URL res_changelog = getClass().getResource(changelog_url); URL res_copying = getClass().getResource(copying_url); aboutPanel = new HTMLPanel(res_about, R("AboutDialogueTabAbout")); authorsPanel = new HTMLPanel(res_authors, R("AboutDialogueTabAuthors")); newsPanel = new HTMLPanel(res_news, R("AboutDialogueTabNews")); changelogPanel = new HTMLPanel(res_changelog, R("AboutDialogueTabChangelog")); copyingPanel = new HTMLPanel(res_copying, R("AboutDialogueTabGPLv2")); aboutButton = new JButton(aboutPanel.getIdentifier()); aboutButton.setActionCommand(aboutPanel.getIdentifier()); aboutButton.addActionListener(this); authorsButton = new JButton(authorsPanel.getIdentifier()); authorsButton.setActionCommand(authorsPanel.getIdentifier()); authorsButton.addActionListener(this); newsButton = new JButton(newsPanel.getIdentifier()); newsButton.setActionCommand(newsPanel.getIdentifier()); newsButton.addActionListener(this); changelogButton = new JButton(changelogPanel.getIdentifier()); changelogButton.setActionCommand(changelogPanel.getIdentifier()); changelogButton.addActionListener(this); copyingButton = new JButton(copyingPanel.getIdentifier()); copyingButton.setActionCommand(copyingPanel.getIdentifier()); copyingButton.addActionListener(this); contentPane = aboutPanel; } @Override public void actionPerformed(ActionEvent e) { String action = e.getActionCommand(); if (action.equals(((HTMLPanel) contentPane).getIdentifier())) return; if (action.equals(aboutPanel.getIdentifier())) { contentPane = aboutPanel; } else if (action.equals(authorsPanel.getIdentifier())) { contentPane = authorsPanel; } else if (action.equals(newsPanel.getIdentifier())) { contentPane = newsPanel; } else if (action.equals(changelogPanel.getIdentifier())) { contentPane = changelogPanel; } else if (action.equals(copyingPanel.getIdentifier())) { contentPane = copyingPanel; } layoutWindow(); } private void layoutWindow() { this.removeAll(); GridBagConstraints gbc = new GridBagConstraints(); gbc.fill = GridBagConstraints.BOTH; gbc.gridy = 0; gbc.gridx = 0; gbc.gridwidth = 5; 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); 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() { display(false); } public static void display(boolean modal) { SwingUtilities.invokeLater(new AboutDialog(modal)); } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/XmlParser.java0000644000000000000000000000013212574544466023273 xustar0030 mtime=1441974582.547016577 30 atime=1441974656.368866353 30 ctime=1441974670.082024207 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/XmlParser.java0000664000076400007640000001525312574544466024362 0ustar00jvanekjvanek00000000000000/* 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 */ 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() { 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.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/Version.java0000644000000000000000000000013212574544466023003 xustar0030 mtime=1441974582.547016577 30 atime=1441974656.368866353 30 ctime=1441974670.082024207 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/Version.java0000664000076400007640000002373412574544466024075 0ustar00jvanekjvanek00000000000000// 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.*; /** *

    * 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 { // 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 String seperators = ".-_"; /** magic key for whether a version part was created due to normalization */ private static String emptyString = new String(""); // not intern'ed /** contains all the versions matched */ private String versionString; /** * Create a Version object based on a version string (ie, * "1.2.3+ 4.56*"). */ public Version(String versions) { versionString = versions; } /** * Returns true if the version represents a version-id (a * single version number such as 1.2) and false otherwise. */ public boolean isVersionId() { if (-1 != versionString.indexOf(" ")) return false; return true; } /** * Returns 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)); } /** * Returns 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 (int i = 0; i < versionStrings.size(); i++) { if (!this.matchesSingle(versionStrings.get(i))) return false; } return true; } /** * Returns 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)); } /** * Returns 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 (int i = 0; i < versionStrings.size(); i++) { if (this.matchesSingle(versionStrings.get(i))) 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 (int i = 0; i < versionStrings.size(); i++) { if (matches(version, versionStrings.get(i))) 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; if (version.endsWith("+") && greater(subparts, parts)) return true; return false; } /** * Returns 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; } /** * Returns 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 = Integer.valueOf(0); Integer number2 = Integer.valueOf(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; } public String toString() { return versionString; } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/UpdateDesc.java0000644000000000000000000000013212574544466023377 xustar0030 mtime=1441974582.546016566 30 atime=1441974656.368866353 30 ctime=1441974670.082024207 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/UpdateDesc.java0000664000076400007640000000650512574544466024466 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/StreamEater.java0000644000000000000000000000013212574544466023572 xustar0030 mtime=1441974582.546016566 30 atime=1441974656.368866353 30 ctime=1441974670.082024207 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/StreamEater.java0000664000076400007640000000373612574544466024664 0ustar00jvanekjvanek00000000000000// 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.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/ShortcutDesc.java0000644000000000000000000000013212574544466023770 xustar0030 mtime=1441974582.546016566 30 atime=1441974656.367866341 30 ctime=1441974670.082024207 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/ShortcutDesc.java0000664000076400007640000000532012574544466025051 0ustar00jvanekjvanek00000000000000// 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 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 */ private boolean onDesktop = false; /** the application needs to be launched online */ private boolean requiresOnline = true; /** the menu descriptor */ 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; } /** * Returns whether the shortcut requires being online */ public boolean isOnline() { return requiresOnline; } /** * Return whether the shortcut should be placed on the desktop */ public boolean onDesktop() { return onDesktop; } /** * 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 addMenu(MenuDesc menu) { this.menu = menu; } /** * Returns the menu this shortcut should be added to */ public MenuDesc getMenu() { return menu; } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/SecurityDesc.java0000644000000000000000000000013212574544466023764 xustar0030 mtime=1441974582.545016555 30 atime=1441974656.367866341 30 ctime=1441974670.082024207 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/SecurityDesc.java0000664000076400007640000005653412574544466025062 0ustar00jvanekjvanek00000000000000// 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.lang.reflect.InvocationTargetException; import java.net.SocketPermission; import java.net.URI; import java.net.URISyntaxException; 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.Collection; import java.util.Collections; import java.util.HashSet; import java.util.PropertyPermission; import java.util.Set; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.JNLPRuntime; 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 */ private String 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 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; } catch (final ClassNotFoundException 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; } catch (final NoSuchMethodException 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, String 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, String 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; } /** * Returns the permissions type, one of: ALL_PERMISSIONS, * SANDBOX_PERMISSIONS, J2EE_PERMISSIONS. */ public Object getSecurityType() { return type; } /** * Returns 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 (int i = 0; i < j2eePermissions.length; i++) permissions.add(j2eePermissions[i]); return permissions; } /** * @return the permission level requested in the JNLP */ public RequestedPermissionLevel getRequestedPermissionLevel() { return requestedPermissionLevel; } /** * Returns a PermissionCollection containing the sandbox permissions */ public PermissionCollection getSandBoxPermissions() { final Permissions permissions = new Permissions(); for (int i = 0; i < sandboxPermissions.length; i++) permissions.add(sandboxPermissions[i]); 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 (int i = 0; i < jnlpRIAPermissions.length; i++) { permissions.add(jnlpRIAPermissions[i]); } } } if (downloadHost != null && downloadHost.length() > 0) permissions.add(new SocketPermission(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 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); } catch (final InvocationTargetException 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 InstantiationException 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 IllegalAccessException 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); } } try { final URI codebase = file.getCodeBase().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 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); } catch (final InvocationTargetException 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 InstantiationException 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 IllegalAccessException 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); } 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 { 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 { 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) { 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; } private static void requireNonNull(final Object arg) { if (arg == null) { throw new NullPointerException(); } } /** * Returns 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.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/ResourcesDesc.java0000644000000000000000000000013212574544466024127 xustar0030 mtime=1441974582.545016555 30 atime=1441974656.367866341 30 ctime=1441974670.082024207 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/ResourcesDesc.java0000664000076400007640000001522312574544466025213 0ustar00jvanekjvanek00000000000000// 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 Locale locales[]; /** the OS for these resources */ private String os[]; /** the arch for these resources */ private String arch[]; /** the JNLPFile this information is for */ private JNLPFile jnlpFile; /** list of jars, packages, properties, and extensions */ private 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; } /** * Returns the JVMs. */ public JREDesc[] getJREs() { List resources = getResources(JREDesc.class); return resources.toArray(new JREDesc[resources.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; } } /** * Returns 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()); } /** * Returns all of the JARs. */ public JARDesc[] getJARs() { List resources = getResources(JARDesc.class); return resources.toArray(new JARDesc[resources.size()]); } /** * Returns the JARs with the specified part name. * * @param partName the part name, null and "" equivalent */ public JARDesc[] getJARs(String partName) { List resources = getResources(JARDesc.class); for (int i = resources.size(); i-- > 0;) { JARDesc jar = resources.get(i); if (!("" + jar.getPart()).equals("" + partName)) resources.remove(i); } return resources.toArray(new JARDesc[resources.size()]); } /** * Returns the Extensions. */ public ExtensionDesc[] getExtensions() { List resources = getResources(ExtensionDesc.class); return resources.toArray(new ExtensionDesc[resources.size()]); } /** * Returns the Packages. */ public PackageDesc[] getPackages() { List resources = getResources(PackageDesc.class); return resources.toArray(new PackageDesc[resources.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 resources = getResources(PackageDesc.class); for (int i = resources.size(); i-- > 0;) { PackageDesc pk = resources.get(i); if (!pk.matches(className)) resources.remove(i); } return resources.toArray(new PackageDesc[resources.size()]); } /** * Returns the Properties as a list. */ public PropertyDesc[] getProperties() { List resources = getResources(PropertyDesc.class); return resources.toArray(new PropertyDesc[resources.size()]); } /** * Returns the properties as a map. */ public Map getPropertiesMap() { Map properties = new HashMap(); List resources = getResources(PropertyDesc.class); for (PropertyDesc prop : resources) { properties.put(prop.getKey(), prop.getValue()); } return properties; } /** * Returns the os required by these resources, or null if no * locale was specified in the JNLP file. */ public String[] getOS() { return os; } /** * Returns the architecture required by these resources, or null * if no locale was specified in the JNLP file. */ public String[] getArch() { return arch; } /** * Returns the locale required by these resources, or null if no * locale was specified in the JNLP file. */ public Locale[] getLocales() { return locales; } /** * Returns the JNLPFile the resources are for. */ public JNLPFile getJNLPFile() { return jnlpFile; } /** * Returns 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. */ 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.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/RequiredElementException.java0000644000000000000000000000013212574544466026327 xustar0030 mtime=1441974582.544016543 30 atime=1441974656.367866341 30 ctime=1441974670.082024207 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/RequiredElementException.java0000664000076400007640000000265512574544466027420 0ustar00jvanekjvanek00000000000000// 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.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/RelatedContentDesc.java0000644000000000000000000000013212574544466025070 xustar0030 mtime=1441974582.544016543 30 atime=1441974656.367866341 30 ctime=1441974670.082024207 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/RelatedContentDesc.java0000664000076400007640000000450712574544466026157 0ustar00jvanekjvanek00000000000000// 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; } /** * Returns the title of this content.. */ public String getTitle() { return title; } /** * Set the description of this related content */ public void setDescription(String description) { this.description = description; } /** * Returns the description of the related content */ public String getDescription() { return description; } /** * Returns the location of the related content. Not null */ public URL getLocation() { return location; } /** * Set the icon for this related content */ public void setIconDesc(IconDesc icon) { this.icon = icon; } /** * Returns the icon descriptor for the realted content */ public IconDesc getIcon() { return icon; } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/PropertyDesc.java0000644000000000000000000000013112574544466024000 xustar0030 mtime=1441974582.544016543 29 atime=1441974656.36686633 30 ctime=1441974670.082024207 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/PropertyDesc.java0000664000076400007640000000445512574544466025072 0ustar00jvanekjvanek00000000000000// 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 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 * @param errorMEssage - the message for error. We do not wont to bother PropertyDesc with localization overhead * @return new PropertyDesc based on parsed key=value, though composed from key and value */ public static PropertyDesc fromString(String prop, String errorMEssage) throws LaunchException { // allows empty property, not sure about validity of that. int equals = prop.indexOf("="); if (equals == -1) { throw new LaunchException(errorMEssage); } 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; } /** * Returns the property's key */ public String getKey() { return key; } /** * Returns the property's value */ public String getValue() { return value; } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/PluginParameters.java0000644000000000000000000000013112574544466024637 xustar0030 mtime=1441974582.543016532 29 atime=1441974656.36686633 30 ctime=1441974670.082024207 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/PluginParameters.java0000664000076400007640000001776712574544466025743 0ustar00jvanekjvanek00000000000000/* PluginAppletAttributes -- Provides parsing for applet attributes Copyright (C) 2012 Red Hat This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp; import java.net.URL; import java.util.Collections; import java.util.Hashtable; import java.util.Map; import static net.sourceforge.jnlp.runtime.Translator.R; /** * Represents plugin applet parameters, backed by a Hashtable. */ public class PluginParameters { private final Hashtable parameters; public PluginParameters(Map params) { this.parameters = createParameterTable(params); if (this.parameters.get("code") == null && this.parameters.get("object") == null //If code/object parameters are missing, we can still determine the main-class name from the jnlp file passed using jnlp_href && this.parameters.get("jnlp_href") == null) { throw new PluginParameterException(R("BNoCodeOrObjectApplet")); } } // Note, lower-case key expected public String get(String key) { return this.parameters.get(key); } public void put(String key, String value) { parameters.put(key.toLowerCase(), value); } public Map getUnmodifiableMap() { return Collections.unmodifiableMap(parameters); } /** * Used for compatibility with Hashtable-expecting classes. * * @return the underlying hashtable. */ Hashtable getUnderlyingHashtable() { return parameters; } public String getDefaulted(String key, String defaultStr) { String value = get(key); return (value != null) ? value : defaultStr; } public String getAppletTitle() { String name = get("name"); if (name == null) { return "Applet"; } else { return name + " applet"; } } public boolean useCodebaseLookup() { return Boolean.valueOf(getDefaulted("codebase_lookup", "true")); } public String getArchive() { return getDefaulted("archive", ""); } public String getJavaArchive() { return getDefaulted("java_archive", ""); } public String getJavaArguments() { return getDefaulted("java_arguments", ""); } public String getCacheArchive() { return getDefaulted("cache_archive", ""); } public String getCacheArchiveEx() { return getDefaulted("cache_archive_ex", ""); } public String getCacheOption() { return getDefaulted("cache_option", ""); } public String getCacheVersion() { return getDefaulted("cache_version", ""); } public String getCode() { return getDefaulted("code", ""); } public String getJNLPHref() { return get("jnlp_href"); } public String getJNLPEmbedded() { return get("jnlp_embedded"); } public String getJarFiles() { return getDefaulted("archive", ""); } public int getWidth() { String widthStr = getDefaulted("width", "0"); return Integer.valueOf(widthStr); } public int getHeight() { String heightStr = getDefaulted("height", "0"); return Integer.valueOf(heightStr); } public 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 Hashtable createParameterTable( Map rawParams) { Hashtable params = new Hashtable(); for (Map.Entry entry : rawParams.entrySet()) { String key = entry.getKey().toLowerCase(); String value = entry.getValue(); params.put(key, value); } String codeTag = params.get("code"); String classID = params.get("classid"); // If there is a classid and no code tag present, transform it to code tag if (codeTag == null && classID != null && !classID.startsWith("clsid:")) { codeTag = classID; params.put("code", codeTag); } // remove java: from code tag if (codeTag != null && codeTag.startsWith("java:")) { codeTag = codeTag.substring("java:".length()); params.put("code", codeTag); } // java_* aliases override older names: // http://java.sun.com/j2se/1.4.2/docs/guide/plugin/developer_guide/using_tags.html#in-nav ensureJavaPrefixTakesPrecedence(params, "code"); ensureJavaPrefixTakesPrecedence(params, "codebase"); ensureJavaPrefixTakesPrecedence(params, "archive"); ensureJavaPrefixTakesPrecedence(params, "object"); ensureJavaPrefixTakesPrecedence(params, "type"); return params; } public String toString() { return parameters.toString(); } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/PluginParameterException.java0000644000000000000000000000013112574544466026333 xustar0030 mtime=1441974582.543016532 29 atime=1441974656.36686633 30 ctime=1441974670.082024207 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/PluginParameterException.java0000664000076400007640000000346312574544466027423 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/PluginBridge.java0000644000000000000000000000013112574544466023730 xustar0030 mtime=1441974582.543016532 29 atime=1441974656.36686633 30 ctime=1441974670.082024207 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/PluginBridge.java0000664000076400007640000003714412574544466025023 0ustar00jvanekjvanek00000000000000/* * 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.runtime.JNLPRuntime; 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 class PluginBridge extends JNLPFile { private PluginParameters params; private Set jars = new HashSet(); private List extensionJars = new ArrayList(); //Folders can be added to the code-base through the archive tag private List codeBaseFolders = new ArrayList(); private String[] cacheJars = new String[0]; private String[] cacheExJars = new String[0]; private boolean usePack; private boolean useVersion; private boolean useJNLPHref; /** * Creates a new PluginBridge using a default JNLPCreator. */ public PluginBridge(URL codebase, URL documentBase, String jar, String main, int width, int height, 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, 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. ParserSettings defaultSettings = new ParserSettings(); URL jnlp = new URL(codeBase, params.getJNLPHref()); if (fileLocation == null){ fileLocation = jnlp; } JNLPFile jnlpFile = null; if (params.getJNLPEmbedded() != null) { InputStream jnlpInputStream = new ByteArrayInputStream(decodeBase64String(params.getJNLPEmbedded())); jnlpFile = new JNLPFile(jnlpInputStream, codeBase, defaultSettings); } else { jnlpFile = jnlpCreator.create(jnlp, null, defaultSettings, JNLPRuntime.getDefaultUpdatePolicy(), codeBase); } if (jnlpFile.isApplet()) main = jnlpFile.getApplet().getMainClass(); Map jnlpParams = jnlpFile.getApplet().getParameters(); info = jnlpFile.info; // Change the parameter name to lowercase to follow conventions. for (Map.Entry entry : jnlpParams.entrySet()) { this.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); } // 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[] jars = cacheArchive.split(","); cacheJars = new String[jars.length]; for (int i = 0; i < jars.length; i++) { cacheJars[i] = jars[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.getHost()); else security = null; this.uniqueKey = params.getUniqueKey(codebase); usePack = false; useVersion = false; 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 ("-Djnlp.packEnabled".equals(parts[0])) { usePack = true; } else if ("-Djnlp.versionEnabled".equals(parts[0])) { useVersion = true; } } } } } public List getArchiveJars() { return new ArrayList(jars); } public boolean codeBaseLookup() { return params.useCodebaseLookup(); } public boolean useJNLPHref() { return useJNLPHref; } @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 } */ @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(); } 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()]); } public void addResource(Object resource) { // todo: honor the current locale, os, arch values sharedResources.addResource(resource); } }; } /** * Returns the list of folders to be added to the codebase */ public List getCodeBaseFolders() { return new ArrayList(codeBaseFolders); } /** * Returns 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) { return new ResourcesDesc[] { getResources(locale, os, arch) }; } public boolean isApplet() { return true; } public boolean isApplication() { return false; } public boolean isComponent() { return false; } 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); } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/ParserSettings.java0000644000000000000000000000013012574544466024331 xustar0029 mtime=1441974582.54201652 29 atime=1441974656.36686633 30 ctime=1441974670.082024207 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/ParserSettings.java0000664000076400007640000000752412574544466025424 0ustar00jvanekjvanek00000000000000/* 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 java.util.Arrays; import java.util.List; /** * 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 */ 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. */ public static void setGlobalParserSettings(ParserSettings parserSettings) { globalParserSettings = parserSettings; } /** * 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 setGlobalParserSettingsFromArgs(String[] cmdArgs) { List argList = Arrays.asList(cmdArgs); boolean strict = argList.contains("-strict"); boolean malformedXmlAllowed = !argList.contains("-xml"); globalParserSettings = new ParserSettings(strict, true, malformedXmlAllowed); return globalParserSettings; } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/Parser.java0000644000000000000000000000013212574544466022612 xustar0030 mtime=1441974582.541016508 30 atime=1441974656.365866319 30 ctime=1441974670.082024207 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/Parser.java0000664000076400007640000013354312574544466023704 0ustar00jvanekjvanek00000000000000// 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 net.sourceforge.jnlp.SecurityDesc.RequestedPermissionLevel; import net.sourceforge.jnlp.UpdateDesc.Check; import net.sourceforge.jnlp.UpdateDesc.Policy; import net.sourceforge.jnlp.runtime.JNLPRuntime; 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 $ */ class Parser { private static String CODEBASE = "codebase"; // 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 JNLPFile file; // do not use (uninitialized) /** the root node */ private Node root; /** the specification version */ private Version spec; /** the base URL that all hrefs are relative to */ private URL base; /** the codebase URL */ private URL codebase; /** the file URL */ private URL fileLocation; /** whether to throw errors on non-fatal errors. */ private 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 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 */ public 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 */ public 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. */ public Version getFileVersion() { return getVersion(root, "version", null); } /** * Returns the file location. */ public URL getFileLocation() { return fileLocation; } /** * Returns the codebase. */ public URL getCodeBase() { return codebase; } /** * Returns the specification version. */ public Version getSpecVersion() { return spec; } public 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"); if (checkValue.equals("always")) { check = Check.ALWAYS; } else if (checkValue.equals("timeout")) { check = Check.TIMEOUT; } else if (checkValue.equals("background")) { check = Check.BACKGROUND; } else { check = Check.TIMEOUT; } String policyString = getAttribute(node, "policy", "always"); Policy policy; if (policyString.equals("always")) { policy = Policy.ALWAYS; } else if (policyString.equals("prompt-update")) { policy = Policy.PROMPT_UPDATE; } else if (policyString.equals("prompt-run")) { policy = Policy.PROMPT_RUN; } else { policy = Policy.ALWAYS; } 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 // /** * Returns 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 */ public 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")); } // create objects from the resources sections for (int i = 0; i < resources.length; i++) { result.add(getResourcesDesc(resources[i], j2se)); } return result; } /** * Returns 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 */ public 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; } /** * Returns the JRE element at the specified node. * * @param node the j2se/java node * @throws ParseException if the JNLP file is invalid */ public 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(version, 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 */ public 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); } /** * Returns the Extension element at the specified node. * * @param node the extension node * @throws ParseException if the JNLP file is invalid */ public 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 (int i = 0; i < dload.length; i++) { boolean lazy = "lazy".equals(getAttribute(dload[i], "download", "eager")); ext.addPart(getRequiredAttribute(dload[i], "ext-part", null), getAttribute(dload[i], "part", null), lazy); } return ext; } /** * Returns the Property element at the specified node. * * @param node the property node * @throws ParseException if the JNLP file is invalid */ public PropertyDesc getProperty(Node node) throws ParseException { String name = getRequiredAttribute(node, "name", null); String value = getRequiredAttribute(node, "value", ""); return new PropertyDesc(name, value); } /** * Returns the Package element at the specified node. * * @param node the package node * @throws ParseException if the JNLP file is invalid */ public 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); } /** * Returns all of the information elements under the specified * node. * * @param parent the parent node (jnlp) * @throws ParseException if the JNLP file is invalid */ public 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; } /** * Returns the information element at the specified node. * * @param node the information node * @throws ParseException if the JNLP file is invalid */ public InformationDesc getInformationDesc(Node node) throws ParseException { List descriptionsUsed = new ArrayList(); // locale Locale locales[] = getLocales(node); // create information InformationDesc info = new InformationDesc(locales); // 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); } /** * Returns the icon element at the specified node. * * @param node the icon node * @throws ParseException if the JNLP file is invalid */ public 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 // /** * Returns 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 */ public 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.getHost()); } else { return new SecurityDesc(file, requestedPermissionLevel, type, null); } } /** * Returns whether the JNLP file requests a trusted execution * environment. */ protected 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 // /** * Returns the launch descriptor element, either AppletDesc, * ApplicationDesc, or InstallerDesc. * * @param parent the parent node * @throws ParseException if the JNLP file is invalid */ public 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; } /** * Returns the applet descriptor. * * @throws ParseException if the JNLP file is invalid */ public AppletDesc getApplet(Node node) throws ParseException { String name = getRequiredAttribute(node, "name", R("PUnknownApplet")); String main = getRequiredAttribute(node, "main-class", null); 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 (int i = 0; i < params.length; i++) { paramMap.put(getRequiredAttribute(params[i], "name", null), getRequiredAttribute(params[i], "value", "")); } return new AppletDesc(name, main, docbase, width, height, paramMap); } /** * Returns the application descriptor. * * @throws ParseException if the JNLP file is invalid */ public ApplicationDesc getApplication(Node node) throws ParseException { String main = getAttribute(node, "main-class", null); 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 (int i = 0; i < args.length; i++) { //argsList.add( args[i].getNodeValue() ); //This approach was not finding the argument text argsList.add(getSpanText(args[i])); } String argStrings[] = argsList.toArray(new String[argsList.size()]); return new ApplicationDesc(main, argStrings); } /** * Returns the component descriptor. */ public 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; } /** * Returns the installer descriptor. */ public InstallerDesc getInstaller(Node node) { String main = getAttribute(node, "main-class", null); return new InstallerDesc(main); } /** * Returns the association descriptor. */ public 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); } /** * Returns the shortcut descriptor. */ public 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 ("desktop".equals(name)) { if (showOnDesktop && strict) { throw new ParseException(R("PTwoDesktops")); } showOnDesktop = true; } else if ("menu".equals(name)) { if (menu != null && strict) { throw new ParseException(R("PTwoMenus")); } menu = getMenu(child); } child = child.getNextSibling(); } ShortcutDesc shortcut = new ShortcutDesc(shortcutIsOnline, showOnDesktop); if (menu != null) { shortcut.addMenu(menu); } return shortcut; } /** * Returns the menu descriptor. */ public MenuDesc getMenu(Node node) { String subMenu = getAttribute(node, "submenu", null); return new MenuDesc(subMenu); } /** * Returns the related-content descriptor. */ public 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 ("title".equals(name)) { if (title != null && strict) { throw new ParseException(R("PTwoTitles")); } title = getSpanText(child, false); } else if ("description".equals(name)) { if (description != null && strict) { throw new ParseException(R("PTwoDescriptions")); } description = getSpanText(child, false); } else if ("icon".equals(name)) { if (icon != null && strict) { throw new ParseException(R("PTwoIcons")); } icon = getIcon(child); } child = child.getNextSibling(); } RelatedContentDesc relatedContent = new RelatedContentDesc(location); relatedContent.setDescription(description); relatedContent.setIconDesc(icon); relatedContent.setTitle(title); return relatedContent; } // other methods /** * Returns 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. */ public 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()]); } /** * Returns the Locale object(s) from a node's locale attribute. * * @param node the node with a locale attribute */ public Locale[] getLocales(Node node) { List locales = new ArrayList(); String localeParts[] = splitString(getAttribute(node, "locale", "")); for (int i = 0; i < localeParts.length; i++) { Locale l = getLocale(localeParts[i]); 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 */ 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 * "text". * * @param node the node with text under it * @throws ParseException if the JNLP file is invalid */ public String getSpanText(Node node) throws ParseException { return getSpanText(node, true); } /** * Returns the implied text under a node, for example "text" in * "text". 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 */ public 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. */ public 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. */ public 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; } /** * Returns 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 */ public 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); } /** * Returns 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 */ public URL getURL(Node node, String name, URL base) throws ParseException { String href = null; 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); } 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", node.getNodeName(), href, base)); } } return result; } } catch (MalformedURLException ex) { if (base == null) throw new ParseException(R("PBadNonrelativeUrl", node.getNodeName(), href)); else throw new ParseException(R("PBadRelativeUrl", node.getNodeName(), href, base)); } } /** * Returns 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 */ public 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 = false; 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", }; } /** * Returns 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 */ public 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; } /** * Retuns 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 */ public 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; } /** * Return the root node from the XML document in the specified * input stream. * * @throws ParseException if the JNLP file is invalid */ public static Node getRootNode(InputStream input, ParserSettings settings) throws ParseException { String className = null; if (settings.isMalformedXmlAllowed()) { className = "net.sourceforge.jnlp.MalformedXMLParser"; } else { className = "net.sourceforge.jnlp.XMLParser"; } try { Class klass = null; try { klass = Class.forName(className); } catch (ClassNotFoundException e) { klass = Class.forName("net.sourceforge.jnlp.XMLParser"); } Object instance = klass.newInstance(); Method m = klass.getMethod("getRootNode", InputStream.class); return (Node) m.invoke(instance, 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); } } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/ParseException.java0000644000000000000000000000013212574544466024307 xustar0030 mtime=1441974582.540016497 30 atime=1441974656.365866319 30 ctime=1441974670.082024207 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/ParseException.java0000664000076400007640000000302712574544466025372 0ustar00jvanekjvanek00000000000000// 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.*; /** * 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. */ public ParseException(String message) { super(message); } /** * Create a parse exception with the specified message and * cause. */ public ParseException(String message, Throwable cause) { super(message, cause); } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/PackageDesc.java0000644000000000000000000000013212574544466023510 xustar0030 mtime=1441974582.540016497 30 atime=1441974656.365866319 30 ctime=1441974670.082024207 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/PackageDesc.java0000664000076400007640000000514612574544466024577 0ustar00jvanekjvanek00000000000000// 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 String name; /** the part required by the package */ private String part; /** whether the package includes subpackages */ private 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; } /** * Returns 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; } /** * Returns the package name. */ public String getName() { return name; } /** * Returns the part name. */ public String getPart() { return part; } /** * Returns whether subpackages should be matched by this * package. */ public boolean isRecursive() { return recursive; } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/NullJnlpFileException.java0000644000000000000000000000013212574544466025573 xustar0030 mtime=1441974582.540016497 30 atime=1441974656.365866319 30 ctime=1441974670.082024207 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/NullJnlpFileException.java0000664000076400007640000000350012574544466026652 0ustar00jvanekjvanek00000000000000package 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.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/Node.java0000644000000000000000000000013212574544466022243 xustar0030 mtime=1441974582.539016486 30 atime=1441974656.365866319 30 ctime=1441974670.082024207 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/Node.java0000664000076400007640000001263512574544466023333 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/NetxPanel.java0000644000000000000000000000013212574544466023254 xustar0030 mtime=1441974582.539016486 30 atime=1441974656.365866319 30 ctime=1441974670.082024207 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/NetxPanel.java0000664000076400007640000001762312574544466024346 0ustar00jvanekjvanek00000000000000/* * 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) { super(documentURL, params.getUnderlyingHashtable()); 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); } } } @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 { bridge = new PluginBridge(getBaseURL(), getDocumentBase(), getJarFiles(), getCode(), getWidth(), getHeight(), parameters); doInit = 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(); } } 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(); } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/MissingVendorException.java0000644000000000000000000000013212574544466026024 xustar0030 mtime=1441974582.538016474 30 atime=1441974656.365866319 30 ctime=1441974670.082024207 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/MissingVendorException.java0000664000076400007640000000304312574544466027105 0ustar00jvanekjvanek00000000000000// 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.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/MissingTitleException.java0000644000000000000000000000013212574544466025650 xustar0030 mtime=1441974582.538016474 30 atime=1441974656.364866307 30 ctime=1441974670.082024207 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/MissingTitleException.java0000664000076400007640000000303712574544466026734 0ustar00jvanekjvanek00000000000000// 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.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/MissingInformationException.java0000644000000000000000000000013212574544466027054 xustar0030 mtime=1441974582.538016474 30 atime=1441974656.364866307 30 ctime=1441974670.082024207 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/MissingInformationException.java0000664000076400007640000000300612574544466030134 0ustar00jvanekjvanek00000000000000// 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.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/MenuDesc.java0000644000000000000000000000013212574544466023061 xustar0030 mtime=1441974582.538016474 30 atime=1441974656.364866307 30 ctime=1441974670.082024207 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/MenuDesc.java0000664000076400007640000000221512574544466024142 0ustar00jvanekjvanek00000000000000// 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 String subMenu; /** * Create a new menu descriptor */ public MenuDesc(String subMenu) { this.subMenu = subMenu; } /** * Returns the submenu for this menu entry. */ public String getSubMenu() { return subMenu; } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/MalformedXMLParser.java0000644000000000000000000000013212574544466025022 xustar0030 mtime=1441974582.537016463 30 atime=1441974656.364866307 30 ctime=1441974670.082024207 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/MalformedXMLParser.java0000664000076400007640000001065212574544466026107 0ustar00jvanekjvanek00000000000000/* 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.runtime.JNLPRuntime; 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 InputStream} to create a XML tree. * Returns a {@link Node} representing the root of the tree. * * @param input the {@link InputStream} to read data from * @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 * @return an {@link InputStream} which can be used to read a well-formed * version of the input XML * @throws ParseException */ private 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 e) { throw new ParseException(R("PBadXML"), e); } catch (IOException e) { throw new ParseException(R("PBadXML"), e); } } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/Launcher.java0000644000000000000000000000013212574544466023117 xustar0030 mtime=1441974582.537016463 30 atime=1441974656.363866296 30 ctime=1441974670.082024207 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/Launcher.java0000664000076400007640000010621412574544466024204 0ustar00jvanekjvanek00000000000000// 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.InetAddress; import java.net.URL; import java.net.UnknownHostException; 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. */ public void setUpdatePolicy(UpdatePolicy policy) { if (policy == null) { throw new IllegalArgumentException(R("LNullUpdatePolicy")); } this.updatePolicy = policy; } /** * Returns 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. */ public void setCreateAppContext(boolean context) { this.context = context; } /** * Returns whether applications are launched in their own * AppContext. */ public boolean isCreateAppContext() { return this.context; } /** * Set the parser settings to use when the Launcher initiates parsing of * a JNLP file. * @param settings */ 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(); //First checks whether offline-allowed tag is specified inside the jnlp //file. if (!file.getInformation().isOfflineAllowed()) { //offline status should be already known from jnlp downloading if (!JNLPRuntime.isOnlineDetected()) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, "File cannot be launched because offline-allowed tag not specified and system currently offline."); return null; } } 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; } String[] properties = extra.get("properties"); if (properties != null) { addProperties(file, properties); } String[] arguments = extra.get("arguments"); if (arguments != null && file.isApplication()) { addArguments(file, arguments); } String[] 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, String[] props) throws LaunchException { ResourcesDesc resources = file.getResources(); for (String prop : props) { try{ resources.addResource(PropertyDesc.fromString(prop, R("BBadProp", prop))); }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, String[] params) throws LaunchException { AppletDesc applet = file.getApplet(); for (int i = 0; i < params.length; i++) { // allows empty param, not sure about validity of that. int equals = params[i].indexOf("="); if (equals == -1) { throw launchError(new LaunchException(R("BBadParam", params[i]))); } String name = params[i].substring(0, equals); String value = params[i].substring(equals + 1, params[i].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, String[] args) { ApplicationDesc app = file.getApplication(); for (int i = 0; i < args.length; i++) { app.addArgument(args[i]); } } /** * 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. */ 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 */ 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. */ 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. */ 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 enableCodeBase whether to add the code base URL to the classloader */ //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. */ 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. */ 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. * * 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. */ 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.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/LaunchHandler.java0000644000000000000000000000013212574544466024066 xustar0030 mtime=1441974582.536016451 30 atime=1441974656.363866296 30 ctime=1441974670.082024207 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/LaunchHandler.java0000664000076400007640000000610512574544466025151 0ustar00jvanekjvanek00000000000000// 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. */ 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. * * @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. * * @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.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/LaunchException.java0000644000000000000000000000013212574544466024447 xustar0030 mtime=1441974582.535016439 30 atime=1441974656.363866296 30 ctime=1441974670.082024207 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/LaunchException.java0000664000076400007640000001056612574544466025540 0ustar00jvanekjvanek00000000000000// 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 JNLPFile file; /** the category of the exception */ private String category; /** summary */ private String summary; /** description of the action that was taking place */ private String description; /** severity of the warning/error */ private String severity; /** * Creates a LaunchException without detail message. */ 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. */ public LaunchException(Throwable cause) { super(cause); saveLaunchException(this); } /** * Creates a LaunchException with a cause and detail message */ public LaunchException(String message, Throwable cause) { super(message, cause); saveLaunchException(this); } /** * Constructs a LaunchException with the specified detail * message. * * @param message the detail message */ public LaunchException(String message) { super(message); saveLaunchException(this); } /** * Returns the JNLPFile being launched. */ public JNLPFile getFile() { return file; } /** * Returns the category string, a short description of the * exception suitable for displaying in a window title. */ public String getCategory() { return category; } /** * Returns 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; } /** * Returns 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.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/LaunchDesc.java0000644000000000000000000000013212574544466023367 xustar0030 mtime=1441974582.535016439 30 atime=1441974656.363866296 30 ctime=1441974670.082024207 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/LaunchDesc.java0000664000076400007640000000342112574544466024450 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/JREDesc.java0000644000000000000000000000013212574544466022575 xustar0030 mtime=1441974582.535016439 30 atime=1441974656.363866296 30 ctime=1441974670.082024207 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/JREDesc.java0000664000076400007640000001074112574544466023661 0ustar00jvanekjvanek00000000000000// 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.net.*; import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * 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 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 initialHeapSize inital heap size * @param maximumHeapSize maximum head size * @param resources list of ResourceDesc objects */ public JREDesc(Version 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; } /** * Returns the JRE version. Use isPlatformVersion to * determine if this version corresponds to a platform or * product version. */ public Version getVersion() { return version; } /** * Returns 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; } /** * Returns the JRE version string. */ public URL getLocation() { return location; } /** * Returns the maximum heap size in bytes. */ public String getMaximumHeapSize() { return maximumHeapSize; } /** * Returns the initial heap size in bytes. */ public String getInitialHeapSize() { return initialHeapSize; } /** * Returns the resources defined for this JRE. */ public List getResourcesDesc() { return resources; } /** * Returns the additional arguments to pass to the Java VM * Can be null */ public String getVMArgs() { return vmArgs; } /** * Check for valid heap size string * @return trimed 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.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/JNLPSplashScreen.java0000644000000000000000000000013212574544466024434 xustar0030 mtime=1441974582.534016428 30 atime=1441974656.363866296 30 ctime=1441974670.082024207 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/JNLPSplashScreen.java0000664000076400007640000001411512574544466025517 0ustar00jvanekjvanek00000000000000/* JNLPSplashScreen.java Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp; import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Image; import java.awt.Insets; import java.awt.Rectangle; import java.io.IOException; import java.net.URL; import javax.imageio.ImageIO; import javax.swing.JDialog; import net.sourceforge.jnlp.cache.ResourceTracker; import net.sourceforge.jnlp.runtime.JNLPRuntime; import net.sourceforge.jnlp.splashscreen.SplashPanel; import net.sourceforge.jnlp.splashscreen.SplashUtils; import net.sourceforge.jnlp.splashscreen.parts.InformationElement; import net.sourceforge.jnlp.util.ImageResources; import net.sourceforge.jnlp.util.logging.OutputController; import net.sourceforge.jnlp.util.ScreenFinder; public class JNLPSplashScreen extends JDialog { ResourceTracker resourceTracker; URL splashImageUrl; Image splashImage; private final JNLPFile file; public static final int DEF_WIDTH=635; public static final int DEF_HEIGHT=480; private SplashPanel componetSplash; private boolean splashImageLoaded=false; public JNLPSplashScreen(ResourceTracker resourceTracker, 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()); SplashPanel splash = SplashUtils.getSplashScreen(DEF_WIDTH, DEF_HEIGHT); if (splash != null) { splash.startAnimation(); splash.setInformationElement(InformationElement.createFromJNLP(file)); this.add(splash.getSplashComponent()); this.componetSplash = splash; } } correctSize(); } finally { splashImageLoaded = true; } } 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(); } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/JNLPMatcherException.java0000644000000000000000000000013212574544466025304 xustar0030 mtime=1441974582.534016428 30 atime=1441974656.362866284 30 ctime=1441974670.082024207 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/JNLPMatcherException.java0000664000076400007640000000370712574544466026374 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/JNLPMatcher.java0000644000000000000000000000013212574544466023425 xustar0030 mtime=1441974582.534016428 30 atime=1441974656.362866284 30 ctime=1441974670.082024207 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/JNLPMatcher.java0000664000076400007640000002470712574544466024520 0ustar00jvanekjvanek00000000000000/* 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 * @throws JNLPMatcherException * if IOException, XMLParseException is thrown during parsing; * Or launchJNLP/appTemplate is null */ public JNLPMatcher(Reader appTemplate, Reader launchJNLP, boolean isTemplate) 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."); //Declare variables for signed JNLP file ByteArrayOutputStream poutTemplate= null; //Declare variables for launching JNLP file ByteArrayOutputStream poutJNLPFile = null; try { XMLElement appTemplateXML = new XMLElement(); XMLElement launchJNLPXML = new XMLElement(); // Remove the comments and CDATA from the JNLP file poutTemplate = new ByteArrayOutputStream(); appTemplateXML.sanitizeInput(appTemplate, poutTemplate); poutJNLPFile = new ByteArrayOutputStream(); launchJNLPXML.sanitizeInput(launchJNLP, poutJNLPFile); // Parse both files appTemplateXML.parseFromReader(new StringReader(poutTemplate.toString())); launchJNLPXML.parseFromReader(new StringReader(poutJNLPFile.toString())); // Initialize parent nodes this.appTemplateNode = new Node(appTemplateXML); this.launchJNLPNode = new Node(launchJNLPXML); this.isTemplate = isTemplate; } catch (Exception e) { throw new JNLPMatcherException( "Failed to create an instance of JNLPVerify with specified InputStreamReader", e); } finally { // Close all stream closeOutputStream(poutTemplate); closeOutputStream(poutJNLPFile); } } /** * 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.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/JNLPFile.java0000644000000000000000000000013212574544466022721 xustar0030 mtime=1441974582.533016417 30 atime=1441974656.362866284 30 ctime=1441974670.082024207 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/JNLPFile.java0000664000076400007640000010724512574544466024013 0ustar00jvanekjvanek00000000000000// 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.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) */ 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. * * @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. Called from constructor. */ private 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.getMessage()); } } /** * Returns 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; } /** * Returns 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; } /** * Returns the JNLP file's best localized vendor. This method returns the same * value as InformationDesc.getVendor(). */ public String getVendor() { return getInformation().getVendor(); } /** * Returns the JNLP file's network location as specified in the * JNLP file. */ public URL getSourceLocation() { return sourceLocation; } /** * Returns 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; } /** * Returns the location of the parent file if it exists, null otherwise */ public String getUniqueKey() { return uniqueKey; } /** * Returns the ParserSettings that was used to parse this file */ public ParserSettings getParserSettings() { return parserSettings; } /** * Returns the JNLP file's version. */ public Version getFileVersion() { return fileVersion; } /** * Returns the specification version required by the file. */ public Version getSpecVersion() { return specVersion; } /** * Returns the codebase URL for the JNLP file. */ public URL getCodeBase() { return codeBase; } /** * Returns the information section of the JNLP file as viewed * through the default locale. */ public InformationDesc getInformation() { return getInformation(defaultLocale); } /** * Returns the information section of the JNLP file as viewed * through the specified locale. */ public InformationDesc getInformation(final Locale locale) { return new InformationDesc(new Locale[] { locale }) { @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; } }; } /** * Returns the update section of the JNLP file. */ public UpdateDesc getUpdate() { return update; } /** * Returns the security section of the JNLP file. */ public SecurityDesc getSecurity() { return security; } public RequestedPermissionLevel getRequestedPermissionLevel() { return this.security.getRequestedPermissionLevel(); } /** * Returns 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); } /** * Returns 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); } }; } /** * Returns 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); } /** * Returns 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]); } /** * Returns an object of one of the following types: AppletDesc, * ApplicationDesc and InstallerDesc */ public LaunchDesc getLaunchInfo() { return launchType; } /** * Returns 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; } /** * Returns 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; } /** * Returns 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; } /** * Returns 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; } /** * Returns whether the lauch descriptor describes an Applet. */ public boolean isApplet() { return launchType instanceof AppletDesc; } /** * Returns whether the lauch descriptor describes an Application. */ public boolean isApplication() { return launchType instanceof ApplicationDesc; } /** * Returns whether the lauch descriptor describes a Component. */ public boolean isComponent() { return component != null; } /** * Returns 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(). */ 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; } /** * Returns 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 (int i = 0; i < available.length; i++) if (available[i] != null && available[i].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() { if (getNewVMArgs().size() == 0) { return false; } else { return true; } } /** * @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 (int jreIndex = 0; jreIndex < jres.length; jreIndex++) { String initialHeapSize = jres[jreIndex].getInitialHeapSize(); if (initialHeapSize != null) { newVMArgs.add("-Xms" + initialHeapSize); } String maxHeapSize = jres[jreIndex].getMaximumHeapSize(); if (maxHeapSize != null) { newVMArgs.add("-Xmx" + maxHeapSize); } String vmArgsFromJre = jres[jreIndex].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"; 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 */ 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/manifest.html#app_name */ public String getApplicationName(){ return getAttribute(APP_NAME); } /** * http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/manifest.html#caller_allowable */ public ClasspathMatcher.ClasspathMatchers getCallerAllowableCodebase() { return getCodeBaseMatchersAttribute(CALLER_ALLOWABLE, false); } /** * http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/manifest.html#app_library */ public ClasspathMatcher.ClasspathMatchers getApplicationLibraryAllowableCodebase() { return getCodeBaseMatchersAttribute(APP_LIBRARY_ALLOWABLE, true); } /** * http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/manifest.html#codebase */ public ClasspathMatcher.ClasspathMatchers getCodebase() { return getCodeBaseMatchersAttribute(CODEBASE, false); } /** * http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/manifest.html#trusted_only */ public ManifestBoolean isTrustedOnly() { return processBooleanAttribute(TRUSTED_ONLY); } /** * http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/manifest.html#trusted_library */ public ManifestBoolean isTrustedLibrary() { return processBooleanAttribute(TRUSTED_LIBRARY); } /** * http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/manifest.html#permissions */ 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 */ 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. */ public String getAttribute(String name) { return getAttribute(new Attributes.Name(name)); } /** * get standard attribute */ 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(); if (s.equals("true")) { return ManifestBoolean.TRUE; } else if (s.equals("false")) { return ManifestBoolean.FALSE; } else { throw new IllegalArgumentException("Unknown value of " + id + " attribute " + s + ". Expected true or false"); } } } } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/JNLPCreator.java0000644000000000000000000000013212574544466023441 xustar0030 mtime=1441974582.532016405 30 atime=1441974656.362866284 30 ctime=1441974670.082024207 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/JNLPCreator.java0000664000076400007640000000270212574544466024523 0ustar00jvanekjvanek00000000000000/* * 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.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/JARDesc.java0000644000000000000000000000013212574544466022571 xustar0030 mtime=1441974582.532016405 30 atime=1441974656.362866284 30 ctime=1441974670.081024196 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/JARDesc.java0000664000076400007640000000750512574544466023661 0ustar00jvanekjvanek00000000000000// 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; } /** * Returns the URL of the JAR file. */ public URL getLocation() { return location; } /** * Returns the required version of the JAR file. */ public Version getVersion() { return version; } /** * Returns the part name, or null if not specified in the JNLP * file. */ public String getPart() { return part; } /** * Returns 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. /** * Returns true if the JAR file should be downloaded before * starting the application. */ public boolean isEager() { return !lazy; } /** * Returns true if the JAR file should be downloaded on demand. */ public boolean isLazy() { return lazy; } /** * Returns 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.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/InstallerDesc.java0000644000000000000000000000013212574544466024112 xustar0030 mtime=1441974582.532016405 30 atime=1441974656.362866284 30 ctime=1441974670.081024196 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/InstallerDesc.java0000664000076400007640000000267612574544466025206 0ustar00jvanekjvanek00000000000000// 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.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/InformationDesc.java0000644000000000000000000000013212574544466024442 xustar0030 mtime=1441974582.531016393 30 atime=1441974656.361866272 30 ctime=1441974670.081024196 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/InformationDesc.java0000664000076400007640000001741012574544466025526 0ustar00jvanekjvanek00000000000000// 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 */ private Locale locales[]; /** the data as list of key,value pairs */ private List info; /** * Create an information element object. * * @param locales the locales the information is for */ public InformationDesc(Locale locales[]) { this.locales = locales; } /** * Returns the application's title. */ public String getTitle() { return (String) getItem("title"); } /** * Returns the application's vendor. */ public String getVendor() { return (String) getItem("vendor"); } /** * Returns the application's homepage. */ public URL getHomepage() { return (URL) getItem("homepage"); } /** * Returns 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; } /** * Returns 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; } /** * Returns the application's description of the specified type. * * @param kind one of Information.SHORT, Information.ONE_LINE, * Information.TOOLTIP, Information.DEFAULT */ public String getDescriptionStrict(Object kind) { return (String) getItem("description-" + kind); } /** * Returns the icons specified by the JNLP file. * * @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 (int i = 0; i < icons.length; i++) { if (icons[i].getWidth() >= width && icons[i].getHeight() >= height) { if (best == null) best = icons[i]; if (icons[i].getWidth() <= best.getWidth() && // Use <= so last specified of icons[i].getHeight() <= best.getHeight()) // equivalent icons is chosen. best = icons[i]; } } // 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(); } /** * Returns the locales for the information. */ public Locale[] getLocales() { return locales; } /** * Returns whether offline execution allowed. */ public boolean isOfflineAllowed() { return null != getItem("offline-allowed"); } /** * Returns 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"); } /** * Returns the associations specified in the JNLP file */ public AssociationDesc[] getAssociations() { List associations = getItems("association"); return associations.toArray(new AssociationDesc[associations.size()]); } /** * Returns the shortcut specified by this JNLP file */ public ShortcutDesc getShortcut() { return (ShortcutDesc) getItem("shortcut"); } /** * Returns the related-contents specified by this JNLP file */ public RelatedContentDesc[] getRelatedContents() { List relatedContents = getItems("related-content"); return relatedContents.toArray(new RelatedContentDesc[relatedContents.size()]); } /** * Returns the last item matching the specified key. */ protected Object getItem(Object key) { List items = getItems(key); if (items.size() == 0) return null; else return items.get(items.size() - 1); } /** * Returns 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. */ protected void addItem(String key, Object value) { if (info == null) info = new ArrayList(); info.add(key); info.add(value); } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/IconDesc.java0000644000000000000000000000013212574544466023045 xustar0030 mtime=1441974582.531016393 30 atime=1441974656.361866272 30 ctime=1441974670.081024196 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/IconDesc.java0000664000076400007640000000636712574544466024142 0ustar00jvanekjvanek00000000000000// 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 URL location; /** the type of icon*/ private Object kind; /** the width, or -1 if unknown*/ private int width; /** the height, or -1 if unknown*/ private int height; /** the depth, or -1 if unknown*/ private int depth; /** the size, or -1 if unknown*/ private 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; } /** * Returns the location of the icon. */ public URL getLocation() { return location; } /** * Returns the icon type. */ public Object getKind() { return kind; } /** * Returns the icon width or -1 if not specified in the * JNLPFile. */ public int getWidth() { return width; } /** * Returns the icon height or -1 if not specified in the * JNLPFile. */ public int getHeight() { return height; } /** * Returns the icon size or -1 if not specified in the JNLPFile. */ public int getSize() { return size; } /** * Returns the icon depth or -1 if not specified in the * JNLPFile. */ public int getDepth() { return depth; } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/GuiLaunchHandler.java0000644000000000000000000000013212574544466024533 xustar0030 mtime=1441974582.530016382 30 atime=1441974656.361866272 30 ctime=1441974670.081024196 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/GuiLaunchHandler.java0000664000076400007640000001364712574544466025627 0ustar00jvanekjvanek00000000000000/* 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) { 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 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.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/ExtensionDesc.java0000644000000000000000000000013212574544466024131 xustar0030 mtime=1441974582.530016382 30 atime=1441974656.361866272 30 ctime=1441974670.081024196 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/ExtensionDesc.java0000664000076400007640000001044412574544466025215 0ustar00jvanekjvanek00000000000000// 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.runtime.JNLPRuntime; 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 String name; /** the required extension version */ private Version version; /** the location of the extension JNLP file */ private URL location; /** the JNLPFile the extension refers to */ private JNLPFile file; /** map from ext-part to local part */ private Map extToPart = new HashMap(); /** eager ext parts */ private 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); } /** * Returns the parts in the extension JNLP file mapped to the * part of the main file. */ public String[] getExtensionParts(String thisPart) { return null; } /** * Returns the name of the extension. */ public String getName() { return name; } /** * Returns the required version of the extension JNLP file. */ public Version getVersion() { return version; } /** * Returns 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)); } } /** * Returns a JNLPFile for the extension, or null if the JNLP * file has not been resolved. */ public JNLPFile getJNLPFile() { return file; } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/DownloadOptions.java0000644000000000000000000000013212574544466024501 xustar0030 mtime=1441974582.530016382 30 atime=1441974656.361866272 30 ctime=1441974670.081024196 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/DownloadOptions.java0000664000076400007640000000436212574544466025567 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/DefaultLaunchHandler.java0000644000000000000000000000013112574544466025372 xustar0029 mtime=1441974582.52901637 30 atime=1441974656.361866272 30 ctime=1441974670.081024196 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/DefaultLaunchHandler.java0000664000076400007640000000575012574544466026463 0ustar00jvanekjvanek00000000000000// 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.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/ComponentDesc.java0000644000000000000000000000013112574544466024116 xustar0029 mtime=1441974582.52901637 30 atime=1441974656.360866261 30 ctime=1441974670.081024196 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/ComponentDesc.java0000664000076400007640000000225312574544466025202 0ustar00jvanekjvanek00000000000000// 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.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/AssociationDesc.java0000644000000000000000000000013112574544466024430 xustar0029 mtime=1441974582.52901637 30 atime=1441974656.360866261 30 ctime=1441974670.081024196 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/AssociationDesc.java0000664000076400007640000000334712574544466025521 0ustar00jvanekjvanek00000000000000// 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 String[] extensions; /** the mime type for the association */ private 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.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/ApplicationDesc.java0000644000000000000000000000013112574544466024417 xustar0029 mtime=1441974582.52901637 30 atime=1441974656.360866261 30 ctime=1441974670.081024196 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/ApplicationDesc.java0000664000076400007640000000374212574544466025507 0ustar00jvanekjvanek00000000000000// 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 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; } /** * Returns the main class name */ @Override public String getMainClass() { return mainClass; } /** * Returns the arguments */ public String[] getArguments() { return arguments.clone(); } /** * Add an argument to the end of the arguments. */ public void addArgument(String arg) { List l = new ArrayList(Arrays.asList(arguments)); l.add(arg); arguments = l.toArray(arguments); } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/AppletDesc.java0000644000000000000000000000013212574544466023402 xustar0030 mtime=1441974582.528016359 30 atime=1441974656.360866261 30 ctime=1441974670.081024196 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/AppletDesc.java0000664000076400007640000000623712574544466024473 0ustar00jvanekjvanek00000000000000// 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 String name; /** the main class name and package */ private String mainClass; /** the document base */ private URL documentBase; /** the width */ private int width; /** the height */ private int height; /** the parameters */ private 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); } /** * Returns the applet name */ public String getName() { return name; } /** * Returns the main class name in the dot-separated form (eg: foo.bar.Baz) */ @Override public String getMainClass() { return mainClass; } /** * Returns the document base */ public URL getDocumentBase() { return documentBase; } /** * Returns the width */ public int getWidth() { return width; } /** * Returns the height */ public int getHeight() { return height; } /** * Returns 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. */ public void addParameter(String name, String value) { parameters.put(name, value); } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/AbstractLaunchHandler.java0000644000000000000000000000013212574544466025552 xustar0030 mtime=1441974582.528016359 30 atime=1441974656.360866261 30 ctime=1441974670.081024196 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/AbstractLaunchHandler.java0000664000076400007640000000570112574544466026636 0ustar00jvanekjvanek00000000000000/* 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 */ 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.5.3/netx/net/sourceforge/jnlp/PaxHeaders.24993/util0000644000000000000000000000013212574544466021413 xustar0030 mtime=1441974582.619017406 30 atime=1441974670.156025059 30 ctime=1441974670.081024196 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/0000775000076400007640000000000012574544466022551 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/PaxHeaders.24993/lockingfile0000644000000000000000000000013212574544466023701 xustar0030 mtime=1441974582.619017406 30 atime=1441974670.156025059 30 ctime=1441974670.081024196 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/lockingfile/0000775000076400007640000000000012574544466025037 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/lockingfile/PaxHeaders.24993/StorageIoException.jav0000644000000000000000000000013212574544466030233 xustar0030 mtime=1441974582.619017406 30 atime=1441974656.409866825 30 ctime=1441974670.081024196 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/lockingfile/StorageIoException.java0000664000076400007640000000410012574544466031450 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/util/lockingfile/PaxHeaders.24993/LockingReaderWriter.ja0000644000000000000000000000013212574544466030200 xustar0030 mtime=1441974582.619017406 30 atime=1441974656.409866825 30 ctime=1441974670.081024196 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/lockingfile/LockingReaderWriter.java0000664000076400007640000001317512574544466031617 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/util/lockingfile/PaxHeaders.24993/LockedFile.java0000644000000000000000000000013212574544466026622 xustar0030 mtime=1441974582.619017406 30 atime=1441974656.409866825 30 ctime=1441974670.081024196 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/lockingfile/LockedFile.java0000664000076400007640000001266012574544466027710 0ustar00jvanekjvanek00000000000000/* Copyright (C) 2013 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. IcedTea is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with IcedTea; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ package net.sourceforge.jnlp.util.lockingfile; import java.io.File; import java.io.IOException; import java.io.RandomAccessFile; import java.nio.channels.FileChannel; import java.nio.channels.FileLock; import java.util.Map; import java.util.WeakHashMap; import java.util.concurrent.locks.ReentrantLock; import net.sourceforge.jnlp.runtime.JNLPRuntime; /* * Process & thread locked access to a file. Creates file if it does not already exist. */ public class LockedFile { // The file for access private RandomAccessFile randomAccessFile; private FileChannel fileChannel; private File file; // A file lock will protect against locks for multiple // processes, while a thread lock is still needed within a single JVM. private FileLock processLock = null; private ReentrantLock threadLock = new ReentrantLock(); private boolean readOnly; private LockedFile(File file) { this.file = file; try { //just try to create this.file.createNewFile(); } catch (Exception ex) { //intentionaly silent } if (!this.file.isFile() && file.getParentFile() != null && !file.getParentFile().canWrite()) { readOnly = true; } else { this.readOnly = !file.canWrite(); if (!readOnly && file.getParentFile() != null && !file.getParentFile().canWrite()) { readOnly = true; } } } public boolean isReadOnly() { return readOnly; } // Provide shared access to LockedFile's via weak map static private final Map instanceCache = new WeakHashMap(); /** * Get a LockedFile for a given File. Ensures that we share the same * instance for all threads * * @param file the file to lock * @return a LockedFile instance */ synchronized public static LockedFile getInstance(File file) { if (!instanceCache.containsKey(file)) { instanceCache.put(file, new LockedFile(file)); } return instanceCache.get(file); } /** * Get the file being locked. * * @return the file */ public File getFile() { return file; } /** * Lock access to the file. Lock is reentrant. */ public void lock() throws IOException { if (JNLPRuntime.isWindows()) { return; } // Create if does not already exist, cannot lock non-existing file if (!isReadOnly()) { this.file.createNewFile(); } this.threadLock.lock(); if (this.processLock != null) { return; } if (this.file.exists()) { this.randomAccessFile = new RandomAccessFile(this.file, isReadOnly() ? "r" : "rws"); this.fileChannel = randomAccessFile.getChannel(); if (!isReadOnly()){ this.processLock = this.fileChannel.lock(); } } } /** * Unlock access to the file. Lock is reentrant. */ public void unlock() throws IOException { if (JNLPRuntime.isWindows()) { return; } boolean releaseProcessLock = (this.threadLock.getHoldCount() == 1); try { if (releaseProcessLock) { if (this.processLock != null){ this.processLock.release(); } this.processLock = null; //necessary for read only file if (this.randomAccessFile != null){ this.randomAccessFile.close(); } //necessary for not existing parent direcotry if (this.fileChannel != null){ this.fileChannel.close(); } } } finally { this.threadLock.unlock(); } } }icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/PaxHeaders.24993/XDesktopEntry.java0000644000000000000000000000013212574544466025116 xustar0030 mtime=1441974582.619017406 30 atime=1441974656.409866825 30 ctime=1441974670.081024196 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/XDesktopEntry.java0000664000076400007640000003010512574544466026176 0ustar00jvanekjvanek00000000000000// 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.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Set; import net.sourceforge.jnlp.IconDesc; import net.sourceforge.jnlp.JNLPFile; import net.sourceforge.jnlp.StreamEater; import net.sourceforge.jnlp.cache.CacheUtil; import net.sourceforge.jnlp.cache.UpdatePolicy; import net.sourceforge.jnlp.config.DeploymentConfiguration; import net.sourceforge.jnlp.runtime.JNLPRuntime; /** * 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 * */ public class XDesktopEntry { public static final String JAVA_ICON_NAME = "java"; private JNLPFile file = null; private int iconSize = -1; private String iconLocation = null; private int[] VALID_ICON_SIZES = new int[] { 16, 22, 32, 48, 64, 128 }; /** * 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. */ public Reader getContentsAsReader() { String cacheDir = JNLPRuntime.getConfiguration() .getProperty(DeploymentConfiguration.KEY_USER_CACHE_DIR); File cacheFile = CacheUtil.getCacheFile(file.getSourceLocation(), null); 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"; fileContents += "Type=Application\n"; if (iconLocation != null) { fileContents += "Icon=" + iconLocation + "\n"; } else { fileContents += "Icon=" + JAVA_ICON_NAME + "\n"; } if (file.getInformation().getVendor() != null) { fileContents += "Vendor=" + sanitize(file.getInformation().getVendor()) + "\n"; } //Shortcut executes the jnlp as it was with system preferred java. It should work fine offline fileContents += "Exec=" + "javaws" + " \"" + file.getSourceLocation() + "\"\n"; return new StringReader(fileContents); } /** * 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 */ return input.split("\n")[0]; } /** * Get the size of the icon (in pixels) for the desktop shortcut */ public int getIconSize() { return iconSize; } public File getShortcutTmpFile() { String userTmp = JNLPRuntime.getConfiguration().getProperty(DeploymentConfiguration.KEY_USER_TMP_DIR); File shortcutFile = new File(userTmp + File.separator + FileUtils.sanitizeFileName(file.getTitle()) + ".desktop"); return shortcutFile; } /** * Set the icon size to use for the desktop shortcut * * @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 */ public void createDesktopShortcut() { try { cacheIcon(); installDesktopLauncher(); } catch (Exception e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); } } /** * Install this XDesktopEntry into the user's desktop as a launcher */ private void installDesktopLauncher() { File shortcutFile = getShortcutTmpFile(); try { if (!shortcutFile.getParentFile().isDirectory() && !shortcutFile.getParentFile().mkdirs()) { throw new IOException(shortcutFile.getParentFile().toString()); } FileUtils.createRestrictedFile(shortcutFile, true); /* * 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(); char[] buffer = new char[1024]; int ret = 0; while (-1 != (ret = reader.read(buffer))) { writer.write(buffer, 0, ret); } reader.close(); writer.close(); /* * 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); } } /** * Cache the icon for the desktop entry */ private void cacheIcon() { URL iconLocation = file.getInformation().getIconLocation(IconDesc.SHORTCUT, iconSize, iconSize); if (iconLocation == null) { iconLocation = file.getInformation().getIconLocation(IconDesc.DEFAULT, iconSize, iconSize); } if (iconLocation != null) { String location = CacheUtil.getCachedResource(iconLocation, null, UpdatePolicy.SESSION) .toString(); if (!location.startsWith("file:")) { throw new RuntimeException("Unable to cache icon"); } this.iconLocation = location.substring("file:".length()); OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "Cached desktop shortcut icon: " + this.iconLocation); } } public String getDesktopIconName() { return sanitize(file.getTitle()); } public File getLinuxDesktopIconFile() { return new File(findFreedesktopOrgDesktopPathCatch() + "/" + getDesktopIconName() + ".desktop"); } private static String findFreedesktopOrgDesktopPathCatch() { try { return findFreedesktopOrgDesktopPath(); } catch (Exception ex) { 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 { BufferedReader r = new BufferedReader(new FileReader(userDirs)); try { return getFreedesktopOrgDesktopPathFrom(r); } finally { r.close(); } } static final String XDG_DESKTOP_DIR = "XDG_DESKTOP_DIR"; static String getFreedesktopOrgDesktopPathFrom(BufferedReader r) throws IOException { while (true) { String s = r.readLine(); if (s == null) { throw new IOException("End of user-dirs found, but no " + XDG_DESKTOP_DIR + " key found"); } s = s.trim(); if (s.startsWith(XDG_DESKTOP_DIR)) { if (!s.contains("=")) { throw new IOException(XDG_DESKTOP_DIR + " has no value"); } String[] keyAndValue = s.split("="); keyAndValue[1] = keyAndValue[1].trim(); String filteredQuotes = filterQuotes(keyAndValue[1]); return evaluateLinuxVariables(filteredQuotes); } } } private static final String MIC = "MAGIC_QUOTIN_ITW_CONSTANT_FOR_DUMMIES"; private static String filterQuotes(String string) { //get rid of " but not of String s = string.replaceAll("\\\\\"", MIC); s = s.replaceAll("\"", ""); s = s.replaceAll(MIC, "\\\""); return s; } private static String evaluateLinuxVariables(String orig) { return evaluateLinuxVariables(orig, System.getenv()); } private static String evaluateLinuxVariables(String orig, Map variables) { Set> env = variables.entrySet(); List> envVariables = new ArrayList>(env); Collections.sort(envVariables, new Comparator>() { @Override public int compare(Entry o1, Entry o2) { return o2.getKey().length() - o1.getKey().length(); } }); while (true) { String before = orig; for (Entry entry : envVariables) { orig = orig.replaceAll("\\$" + entry.getKey(), entry.getValue()); } if (before.equals(orig)) { return orig; } } } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/PaxHeaders.24993/WeakList.java0000644000000000000000000000013212574544466024056 xustar0030 mtime=1441974582.619017406 30 atime=1441974656.408866814 30 ctime=1441974670.081024196 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/WeakList.java0000664000076400007640000000704612574544466025146 0ustar00jvanekjvanek00000000000000// 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 $ */ public class WeakList extends AbstractList { /* list of weak references */ private 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; } /** * Returns the object at the specified index, or null if the * object has been collected. */ public E get(int index) { return deref(refs.get(index)); } /** * Returns the size of the list, including already collected * objects. */ 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. */ 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. */ 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. */ public E remove(int index) { return deref(refs.remove(index)); } /** * Returns 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.5.3/netx/net/sourceforge/jnlp/util/PaxHeaders.24993/UrlUtils.java0000644000000000000000000000013212574544466024116 xustar0030 mtime=1441974582.618017395 30 atime=1441974656.408866814 30 ctime=1441974670.081024196 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/UrlUtils.java0000664000076400007640000002340312574544466025201 0ustar00jvanekjvanek00000000000000/* 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) { try { String[] urlParts = url.toString().split("\\?"); URL strippedUrl = new URL(urlParts[0]); return normalizeUrl(strippedUrl, encodeFileUrls); } catch (IOException e) { OutputController.getLogger().log(e); } catch (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 e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); } catch (UnsupportedEncodingException e) { OutputController.getLogger().log(OutputController.Level.ERROR_ALL, e); } catch (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 * @return */ public static URL removeFileName(final URL 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 * @return */ 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 * @return * @throws MalformedURLException */ 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 * @param u2 * @return */ 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(); } } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/PaxHeaders.24993/TimedHashMap.java0000644000000000000000000000013212574544466024637 xustar0030 mtime=1441974582.618017395 30 atime=1441974656.408866814 30 ctime=1441974670.081024196 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/TimedHashMap.java0000664000076400007640000000701712574544466025725 0ustar00jvanekjvanek00000000000000/* 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 net.sourceforge.jnlp.util.logging.OutputController; import java.util.HashMap; import net.sourceforge.jnlp.runtime.JNLPRuntime; /** * 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 time t=10 seconds * * @param K The key type * @param V The Object type */ public class TimedHashMap { HashMap actualMap = new HashMap(); HashMap timeStamps = new HashMap(); Long expiry = 10000000000L; /** * Store the item in the map and associate a timestamp with it * * @param key The key * @param value The value to store */ public V put(K key, V value) { timeStamps.put(key, System.nanoTime()); return actualMap.put(key, value); } /** * 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 */ public V get(K key) { Long now = System.nanoTime(); if (actualMap.containsKey(key)) { Long age = now - timeStamps.get(key); // Item exists. If it has not expired, renew its access time and return it if (age <= expiry) { OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "Returning proxy " + actualMap.get(key) + " from cache for " + key); timeStamps.put(key, System.nanoTime()); return actualMap.get(key); } else { OutputController.getLogger().log(OutputController.Level.ERROR_DEBUG, "Proxy cache for " + key + " has expired (age=" + (age * 1e-9) + " seconds)"); } } return null; } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/PaxHeaders.24993/StreamUtils.java0000644000000000000000000000013212574544466024607 xustar0030 mtime=1441974582.618017395 30 atime=1441974656.408866814 30 ctime=1441974670.081024196 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/StreamUtils.java0000664000076400007640000000671112574544466025675 0ustar00jvanekjvanek00000000000000/* 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. */ 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, boolean includeEndOfLines) throws IOException { InputStreamReader is = new InputStreamReader(stream); StringBuilder sb = new StringBuilder(); BufferedReader br = new BufferedReader(is); while (true) { String read = br.readLine(); if (read == null) { break; } sb.append(read); if (includeEndOfLines){ sb.append('\n'); } } return sb.toString(); } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/PaxHeaders.24993/ScreenFinder.java0000644000000000000000000000013212574544466024702 xustar0030 mtime=1441974582.618017395 30 atime=1441974656.408866814 30 ctime=1441974670.081024196 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/ScreenFinder.java0000664000076400007640000001070412574544466025765 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/util/PaxHeaders.24993/Reflect.java0000644000000000000000000000013212574544466023717 xustar0030 mtime=1441974582.617017383 30 atime=1441974656.408866814 30 ctime=1441974670.081024196 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/Reflect.java0000664000076400007640000001102512574544466024777 0ustar00jvanekjvanek00000000000000// Copyright (C) 2003 Jon A. Maxwell (JAM) // // 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; import java.lang.reflect.Method; import net.sourceforge.jnlp.util.logging.OutputController; /** * Provides simply, convenient methods to invoke methods by * name. This class is used to consolidate reflection needed to * access methods specific to Sun's JVM or to remain backward * compatible while supporting method in newer JVMs. *

    * Most methods of this class invoke the first method on the * specified object that matches the name and number of * parameters. The type of the parameters are not considered, so * do not attempt to use this class to invoke overloaded * methods. *

    *

    * Instances of this class are not synchronized. *

    * * @author Jon A. Maxwell (JAM) - initial author * @version $Revision: 1.1 $ */ public class Reflect { // todo: check non-null parameter types, try to send to proper // method if overloaded ones exist on the target object // todo: optimize slightly using hashtable of Methods private boolean accessible; private static Object zero[] = new Object[0]; /** * Create a new Reflect instance. */ public Reflect() { // } /** * Create a new Reflect instance. * * @param accessible whether to bypass access permissions */ public Reflect(boolean accessible) { this.accessible = accessible; } /** * Invoke a zero-parameter static method by name. */ public Object invokeStatic(String className, String method) { return invokeStatic(className, method, zero); } /** * Invoke the static method using the specified parameters. */ public Object invokeStatic(String className, String method, Object args[]) { try { Class c = Class.forName(className, true, Reflect.class.getClassLoader()); Method m = getMethod(c, method, args); if (m.isAccessible() != accessible) { m.setAccessible(accessible); } return m.invoke(null, args); } catch (Exception ex) { // eat return null; } } /** * Invoke a zero-parameter method by name on the specified * object. */ public Object invoke(Object object, String method) { return invoke(object, method, zero); } /** * Invoke a method by name with the specified parameters. * * @return the result of the method, or null on exception. */ public Object invoke(Object object, String method, Object args[]) { try { Method m = getMethod(object.getClass(), method, args); if (m.isAccessible() != accessible) { m.setAccessible(accessible); } return m.invoke(object, args); } catch (Exception ex) { // eat OutputController.getLogger().log(OutputController.Level.ERROR_ALL, ex); return null; } } /** * Return the Method matching the specified name and number of * arguments. */ public Method getMethod(Class type, String method, Object args[]) { try { for (Class c = type; c != null; c = c.getSuperclass()) { Method methods[] = c.getMethods(); for (int i = 0; i < methods.length; i++) { if (methods[i].getName().equals(method)) { Class parameters[] = methods[i].getParameterTypes(); if (parameters.length == args.length) { return methods[i]; } } } } } catch (Exception ex) { // eat OutputController.getLogger().log(OutputController.Level.ERROR_ALL, ex); } return null; } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/PaxHeaders.24993/PropertiesFile.java0000644000000000000000000000013212574544466025267 xustar0030 mtime=1441974582.617017383 30 atime=1441974656.407866802 30 ctime=1441974670.081024196 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/PropertiesFile.java0000664000076400007640000001223012574544466026346 0ustar00jvanekjvanek00000000000000// 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 net.sourceforge.jnlp.util.logging.OutputController; import java.io.*; import java.util.*; /** * 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 */ File file; /** 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.file = 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.file = file; this.header = header; } /** * Returns the value of the specified key, or null if the key * does not exist. */ public String getProperty(String key) { if (lastStore == 0) load(); return super.getProperty(key); } /** * Returns the value of the specified key, or the default value * if the key does not exist. */ 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 */ public Object setProperty(String key, String value) { if (lastStore == 0) load(); return super.setProperty(key, value); } /** * Returns the file backing this properties object. */ public File getStoreFile() { return file; } /** * 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() { 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() { 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); } } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/PaxHeaders.24993/MD5SumWatcher.java0000644000000000000000000000013212574544466024723 xustar0030 mtime=1441974582.617017383 30 atime=1441974656.407866802 30 ctime=1441974670.081024196 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/MD5SumWatcher.java0000664000076400007640000000737412574544466026017 0ustar00jvanekjvanek00000000000000/*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 net.sourceforge.jnlp.runtime.Translator.R; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.security.NoSuchAlgorithmException; import java.util.Arrays; import javax.swing.JFrame; import javax.swing.JOptionPane; 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.5.3/netx/net/sourceforge/jnlp/util/PaxHeaders.24993/JarFile.java0000644000000000000000000000013212574544466023647 xustar0030 mtime=1441974582.617017383 30 atime=1441974656.407866802 30 ctime=1441974670.081024196 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/JarFile.java0000664000076400007640000001355112574544466024735 0ustar00jvanekjvanek00000000000000/* Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; 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; //in jdk6 java.util.jar.JarFile is not Closeable - fixing //overwritening class can add duplicate occurence of interface so this should be perfectly safe public class JarFile extends java.util.jar.JarFile implements Closeable{ public JarFile(String name) throws IOException { super(name); 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); } /** * According to specification - * http://www.pkware.com/documents/casestudies/APPNOTE.TXT or just google * around zip header all entries in zip-compressed must start with well * known "PK" which is defined as hexa x50 x4b x03 x04, which in decimal are * 80 75 3 4. * * Note - this is not file-header, it is item-header. * * Actually most of compressing formats have some n-bytes header se 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 palce where to fix it. * */ private static final byte[] ZIP_LOCAL_FILE_HEADER_SIGNATURE = new byte[]{80, 75, 3, 4}; /** * This method is checking first four bytes of jar-file against * ZIP_LOCAL_FILE_HEADER_SIGNATURE * * Although zip specification allows to skip all corrupted entries, it is * not safe for jars. If first four bytes of file are not zip * ZIP_LOCAL_FILE_HEADER_SIGNATURE then exception is thrown * * As noted, ZIP_LOCAL_FILE_HEADER_SIGNATURE is not ile-header, but is item-header. * Possible attack is using the fact that entries without header are considered * corrupted and so can be ignoered. However, for other they can have some meaning. * * So for our purposes we must insists on first record to be valid. * * @param file * @throws IOException * @throws InvalidJarHeaderException */ public static void verifyZipHeader(File file) throws IOException { if (!JNLPRuntime.isIgnoreHeaders()) { InputStream s = new FileInputStream(file); try { byte[] buffer = new byte[ZIP_LOCAL_FILE_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_LOCAL_FILE_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_LOCAL_FILE_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.5.3/netx/net/sourceforge/jnlp/util/PaxHeaders.24993/InvalidJarHeaderException.java0000644000000000000000000000013212574544466027346 xustar0030 mtime=1441974582.617017383 30 atime=1441974656.407866802 30 ctime=1441974670.081024196 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/InvalidJarHeaderException.java0000664000076400007640000000364312574544466030435 0ustar00jvanekjvanek00000000000000/* Copyright (C) 2012 Red Hat, Inc. This file is part of IcedTea. IcedTea is free software; 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.5.3/netx/net/sourceforge/jnlp/util/PaxHeaders.24993/ImageResources.java0000644000000000000000000000013212574544466025250 xustar0030 mtime=1441974582.616017372 30 atime=1441974656.407866802 30 ctime=1441974670.081024196 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/ImageResources.java0000664000076400007640000000663512574544466026343 0ustar00jvanekjvanek00000000000000/* 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; } } /** * Returns 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.5.3/netx/net/sourceforge/jnlp/util/PaxHeaders.24993/HttpUtils.java0000644000000000000000000000013112574544466024272 xustar0030 mtime=1441974582.616017372 29 atime=1441974656.40686679 30 ctime=1441974670.081024196 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/HttpUtils.java0000664000076400007640000000544512574544466025364 0ustar00jvanekjvanek00000000000000/* 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 */ 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 * * @throws IOException */ public static void consumeAndCloseConnection(HttpURLConnection c) throws IOException { InputStream in = null; try { in = c.getInputStream(); byte[] throwAwayBuffer = new byte[256]; while (in.read(throwAwayBuffer) > 0) { /* ignore contents */ } } finally { if (in != null) { in.close(); } } } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/PaxHeaders.24993/FileUtils.java0000644000000000000000000000013112574544466024232 xustar0030 mtime=1441974582.616017372 29 atime=1441974656.40686679 30 ctime=1441974670.081024196 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/FileUtils.java0000664000076400007640000005561112574544466025324 0ustar00jvanekjvanek00000000000000// 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.awt.Window; 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.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 */ private 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) { 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], SANITIZED_CHAR); 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) { for (int i = 0; i < INVALID_CHARS.length; i++) if (-1 != filename.indexOf(INVALID_CHARS[i])) filename = filename.replace(INVALID_CHARS[i], SANITIZED_CHAR); 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. * * @throws IOException */ 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. * * @throws IOException */ 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 * @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 * @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 = null; 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 (int i = 0; i < children.length; i++) { recursiveDelete(children[i], 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; } /** * helping dummy method to save String as file * * @param content * @param f * @throws IOException */ public static void saveFile(String content, File f) throws IOException { saveFile(content, f, "utf-8"); } public static void saveFile(String content, File f, String encoding) throws IOException { Writer output = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(f), encoding)); output.write(content); output.flush(); output.close(); } /** * 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 { BufferedReader br = new BufferedReader(new InputStreamReader(is, encoding)); StringBuilder sb = new StringBuilder(); while (true) { String s = br.readLine(); if (s == null) { break; } sb.append(s).append("\n"); } return sb.toString(); } finally { is.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.5.3/netx/net/sourceforge/jnlp/util/PaxHeaders.24993/ClasspathMatcher.java0000644000000000000000000000013112574544466025560 xustar0030 mtime=1441974582.616017372 29 atime=1441974656.40686679 30 ctime=1441974670.081024196 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/ClasspathMatcher.java0000664000076400007640000003047712574544466026655 0ustar00jvanekjvanek00000000000000// 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 * @return */ 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 = "(" + quote(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) { if (indexOfProtocolMark < indexofFirstDot) { return true; } else { return false; } } //more nasty part - path specified String degradedProtocol = source.replace(PROTOCOL_DELIMITER, "%%%"); int indexofFirstPath = degradedProtocol.indexOf(PATH_DELIMITER); if (indexofFirstPath >= 0) { if (indexOfProtocolMark < indexofFirstPath) { return true; } else { return false; } } //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 quote(s); } private static String quote(String s) { /* * coment for lazybones: * Pattern.quote - all characters in citation are threated as are without any special meaning * Citation is based on \Q and \E marks wwith escapped inner \Q and \E * ^ is start of th e line * $ is end of the line */ 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.5.3/netx/net/sourceforge/jnlp/util/PaxHeaders.24993/BasicExceptionDialog.java0000644000000000000000000000013012574544466026351 xustar0029 mtime=1441974582.61501736 29 atime=1441974656.40686679 30 ctime=1441974670.081024196 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/BasicExceptionDialog.java0000664000076400007640000001736112574544466027444 0ustar00jvanekjvanek00000000000000/* 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 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 { /** * 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(); } 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; } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/PaxHeaders.24993/ui0000644000000000000000000000013212574544466022030 xustar0030 mtime=1441974582.496015991 30 atime=1441974670.156025059 30 ctime=1441974670.081024196 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/ui/0000775000076400007640000000000012574544466023166 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/ui/PaxHeaders.24993/package-info.java0000644000000000000000000000013212574544466025274 xustar0030 mtime=1441974582.496015991 30 atime=1441974656.414866883 30 ctime=1441974670.081024196 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/ui/package-info.java0000664000076400007640000000362412574544466026362 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/util/ui/PaxHeaders.24993/NonEditableTableModel.java0000644000000000000000000000013212574544466027065 xustar0030 mtime=1441974582.496015991 30 atime=1441974656.413866871 30 ctime=1441974670.081024196 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/ui/NonEditableTableModel.java0000664000076400007640000001203612574544466030150 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/util/PaxHeaders.24993/replacements0000644000000000000000000000013212574544466024075 xustar0030 mtime=1441974582.495015979 30 atime=1441974670.156025059 30 ctime=1441974670.081024196 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/replacements/0000775000076400007640000000000012574544466025233 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/replacements/PaxHeaders.24993/CharacterEncoder.java0000644000000000000000000000013212574544466030211 xustar0030 mtime=1441974582.495015979 30 atime=1441974656.413866871 30 ctime=1441974670.080024184 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/replacements/CharacterEncoder.java0000664000076400007640000002773012574544466031303 0ustar00jvanekjvanek00000000000000/* * 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.5.3/netx/net/sourceforge/jnlp/util/replacements/PaxHeaders.24993/CharacterDecoder.java0000644000000000000000000000013212574544466030177 xustar0030 mtime=1441974582.495015979 30 atime=1441974656.413866871 30 ctime=1441974670.080024184 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/replacements/CharacterDecoder.java0000664000076400007640000002061512574544466031264 0ustar00jvanekjvanek00000000000000/* * 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.5.3/netx/net/sourceforge/jnlp/util/replacements/PaxHeaders.24993/BASE64Encoder.java0000644000000000000000000000013212574544466027201 xustar0030 mtime=1441974582.494015968 30 atime=1441974656.413866871 30 ctime=1441974670.080024184 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/replacements/BASE64Encoder.java0000664000076400007640000001034612574544466030266 0ustar00jvanekjvanek00000000000000/* * 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.5.3/netx/net/sourceforge/jnlp/util/replacements/PaxHeaders.24993/BASE64Decoder.java0000644000000000000000000000013212574544466027167 xustar0030 mtime=1441974582.494015968 30 atime=1441974656.413866871 30 ctime=1441974670.080024184 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/replacements/BASE64Decoder.java0000664000076400007640000001323712574544466030256 0ustar00jvanekjvanek00000000000000/* * 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.5.3/netx/net/sourceforge/jnlp/util/PaxHeaders.24993/logging0000644000000000000000000000013212574544466023041 xustar0030 mtime=1441974582.620017418 30 atime=1441974670.156025059 30 ctime=1441974670.080024184 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/logging/0000775000076400007640000000000012574544466024177 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/logging/PaxHeaders.24993/FileLog.java0000644000000000000000000000013212574544466025302 xustar0030 mtime=1441974582.621017429 30 atime=1441974656.410866837 30 ctime=1441974670.080024184 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/logging/FileLog.java0000664000076400007640000001054412574544466026367 0ustar00jvanekjvanek00000000000000/* 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.io.File; import java.io.IOException; import java.text.SimpleDateFormat; import java.util.Date; 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.headers.Header; /** * This class writes log information to file. */ public final class FileLog implements SingleStreamLogger { private static SimpleDateFormat fileLogNameFormatter = new SimpleDateFormat("yyyy-MM-dd_HH:mm:ss.S"); /**"Tue Nov 19 09:43:50 CET 2013"*/ private static SimpleDateFormat pluginSharedFormatter = new SimpleDateFormat("EEE MMM dd HH:mm:ss ZZZ yyyy"); private final Logger impl; private final FileHandler fh; private static final String defaultloggerName = "IcedTea-Web file-logger"; public FileLog() { this(false); } public FileLog(boolean append) { this(defaultloggerName, LogConfig.getLogConfig().getIcedteaLogDir() + "itw-javantx-" + getStamp() + ".log", append); } public FileLog(String fileName, boolean append) { this(fileName, fileName, append); } public FileLog(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(new Header(OutputController.Level.WARNING_ALL, Thread.currentThread().getStackTrace(), Thread.currentThread(), false).toString()); } 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); } public void close() { fh.close(); } private static String getStamp() { return fileLogNameFormatter.format(new Date()); } public static SimpleDateFormat getFileLogNameFormatter() { return fileLogNameFormatter; } public static SimpleDateFormat getPluginSharedFormatter() { return pluginSharedFormatter; } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/logging/PaxHeaders.24993/ConsoleOutputPaneModel.jav0000644000000000000000000000013212574544466030230 xustar0030 mtime=1441974582.620017418 30 atime=1441974656.410866837 30 ctime=1441974670.080024184 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/logging/ConsoleOutputPaneModel.java0000664000076400007640000004347212574544466031464 0ustar00jvanekjvanek00000000000000package 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("", ">"); line = line.replaceAll("\n", "
    \n"); line = line.replaceAll(" ", "  ");//small trick, html is reducting row of spaces to single space. This handles it and stimm allow line wrap line = line.replaceAll("\t", "    "); } sb.append(line); if (mark) { //sb.append("]]>"); sb.append("
    "); } //always wrap, looks better, works smoother sb.append("\n"); added++; } if (mark) { sb.append("
    "); } statisticsShown = added; return sb.toString(); } 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.5.3/netx/net/sourceforge/jnlp/util/logging/PaxHeaders.24993/ConsoleOutputPane.java0000644000000000000000000000013212574544466027410 xustar0030 mtime=1441974582.620017418 30 atime=1441974656.409866825 30 ctime=1441974670.080024184 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/logging/ConsoleOutputPane.java0000664000076400007640000012141012574544466030470 0ustar00jvanekjvanek00000000000000package 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()); if (!LogConfig.getLogConfig().isEnableHeaders()) { showHeaders.setSelected(false); } 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) { 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()); } @SuppressWarnings("unchecked") private 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")); 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 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.5.3/netx/net/sourceforge/jnlp/util/logging/PaxHeaders.24993/headers0000644000000000000000000000013212574544466024454 xustar0030 mtime=1441974582.494015968 30 atime=1441974670.157025071 30 ctime=1441974670.080024184 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/logging/headers/0000775000076400007640000000000012574544466025612 5ustar00jvanekjvanek00000000000000icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/logging/headers/PaxHeaders.24993/PluginMessage.java0000644000000000000000000000013112574544466030136 xustar0030 mtime=1441974582.494015968 29 atime=1441974656.41286686 30 ctime=1441974670.080024184 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/logging/headers/PluginMessage.java0000664000076400007640000000713012574544466031221 0ustar00jvanekjvanek00000000000000/* 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.FileLog; 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.5.3/netx/net/sourceforge/jnlp/util/logging/headers/PaxHeaders.24993/PluginHeader.java0000644000000000000000000000013112574544466027742 xustar0030 mtime=1441974582.493015956 29 atime=1441974656.41286686 30 ctime=1441974670.080024184 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/logging/headers/PluginHeader.java0000664000076400007640000000576312574544466031037 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/util/logging/headers/PaxHeaders.24993/ObservableMessages0000644000000000000000000000013112574544466030227 xustar0030 mtime=1441974582.493015956 29 atime=1441974656.41286686 30 ctime=1441974670.080024184 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/logging/headers/ObservableMessagesProvider.java0000664000076400007640000000357112574544466033752 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/util/logging/headers/PaxHeaders.24993/MessageWithHeader.0000644000000000000000000000013112574544466030062 xustar0030 mtime=1441974582.493015956 29 atime=1441974656.41286686 30 ctime=1441974670.080024184 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/logging/headers/MessageWithHeader.java0000664000076400007640000000342512574544466032012 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/util/logging/headers/PaxHeaders.24993/JavaMessage.java0000644000000000000000000000013112574544466027561 xustar0030 mtime=1441974582.493015956 29 atime=1441974656.41286686 30 ctime=1441974670.080024184 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/logging/headers/JavaMessage.java0000664000076400007640000000411112574544466030640 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/util/logging/headers/PaxHeaders.24993/Header.java0000644000000000000000000000013212574544466026564 xustar0030 mtime=1441974582.492015944 30 atime=1441974656.411866848 30 ctime=1441974670.080024184 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/logging/headers/Header.java0000664000076400007640000001441012574544466027645 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/util/logging/PaxHeaders.24993/WinSystemLog.java0000644000000000000000000000013212574544466026365 xustar0030 mtime=1441974582.492015944 30 atime=1441974656.411866848 30 ctime=1441974670.080024184 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/logging/WinSystemLog.java0000664000076400007640000000355712574544466027460 0ustar00jvanekjvanek00000000000000/*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 } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/logging/PaxHeaders.24993/UnixSystemLog.java0000644000000000000000000000013212574544466026553 xustar0030 mtime=1441974582.492015944 30 atime=1441974656.411866848 30 ctime=1441974670.080024184 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/logging/UnixSystemLog.java0000664000076400007640000000513012574544466027633 0ustar00jvanekjvanek00000000000000/*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 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 http://icedtea.classpath.org/wiki/IcedTea-Web#Filing_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); } } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/logging/PaxHeaders.24993/TeeOutputStream.java0000644000000000000000000000013212574544466027073 xustar0030 mtime=1441974582.491015933 30 atime=1441974656.411866848 30 ctime=1441974670.080024184 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/logging/TeeOutputStream.java0000664000076400007640000001072712574544466030163 0ustar00jvanekjvanek00000000000000/* 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.5.3/netx/net/sourceforge/jnlp/util/logging/PaxHeaders.24993/SingleStreamLogger.java0000644000000000000000000000013212574544466027516 xustar0030 mtime=1441974582.491015933 30 atime=1441974656.411866848 30 ctime=1441974670.080024184 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/logging/SingleStreamLogger.java0000664000076400007640000000336712574544466030610 0ustar00jvanekjvanek00000000000000/*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 { public void log(String s); } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/logging/PaxHeaders.24993/PrintStreamLogger.java0000644000000000000000000000013212574544466027371 xustar0030 mtime=1441974582.491015933 30 atime=1441974656.411866848 30 ctime=1441974670.080024184 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/logging/PrintStreamLogger.java0000664000076400007640000000417212574544466030456 0ustar00jvanekjvanek00000000000000/*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; } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/logging/PaxHeaders.24993/OutputController.java0000644000000000000000000000013212574544466027325 xustar0030 mtime=1441974582.490015921 30 atime=1441974656.410866837 30 ctime=1441974670.080024184 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/logging/OutputController.java0000664000076400007640000003050712574544466030413 0ustar00jvanekjvanek00000000000000/*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 List messageQue = new LinkedList(); private 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() { 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){ 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 = s.getMessage(); if (LogConfig.getLogConfig().isEnableHeaders()) { if (message.contains("\n")) { message = s.getHeader().toString() + "\n" + message; } else { message = s.getHeader().toString() + " " + message; } } 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 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 FileLog INSTANCE = new FileLog(); } private FileLog getFileLog() { return FileLogHolder.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(FileLog fileLog) { FileLogHolder.INSTANCE = fileLog; } void setOutLog(PrintStreamLogger outLog) { this.outLog = outLog; } void setSysLog(SingleStreamLogger sysLog) { SystemLogHolder.INSTANCE = sysLog; } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/logging/PaxHeaders.24993/LogConfig.java0000644000000000000000000000013212574544466025630 xustar0030 mtime=1441974582.490015921 30 atime=1441974656.410866837 30 ctime=1441974670.080024184 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/logging/LogConfig.java0000664000076400007640000001221712574544466026714 0ustar00jvanekjvanek00000000000000/* 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.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 logToStreams; private boolean logToSysLog; 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)); // Get log directory, create it if it doesn't exist. If unable to create and doesn't exist, don't log. icedteaLogDir = config.getProperty(DeploymentConfiguration.KEY_USER_LOG_DIR); if (icedteaLogDir != null) { File f = new File(icedteaLogDir); if (f.isDirectory() || f.mkdirs()) { icedteaLogDir += File.separator; } 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(); } } icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/logging/PaxHeaders.24993/JavaConsole.java0000644000000000000000000000013112574544466026164 xustar0029 mtime=1441974582.48901591 30 atime=1441974656.410866837 30 ctime=1441974670.080024184 icedtea-web-1.5.3/netx/net/sourceforge/jnlp/util/logging/JavaConsole.java0000664000076400007640000005102612574544466027252 0ustar00jvanekjvanek00000000000000/* 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.5.3/PaxHeaders.24993/missing0000644000000000000000000000013212574544511015044 xustar0030 mtime=1441974601.535235154 30 atime=1441974654.784848119 30 ctime=1441974670.076024138 icedtea-web-1.5.3/missing0000755000076400007640000001533012574544511016130 0ustar00jvanekjvanek00000000000000#! /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.5.3/PaxHeaders.24993/install-sh0000644000000000000000000000013212574544511015451 xustar0030 mtime=1441974601.533235131 30 atime=1441974601.533235131 30 ctime=1441974670.075024127 icedtea-web-1.5.3/install-sh0000755000076400007640000003452312574544511016542 0ustar00jvanekjvanek00000000000000#!/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.5.3/PaxHeaders.24993/config.sub0000644000000000000000000000013212574544511015430 xustar0030 mtime=1441974601.532235119 30 atime=1441974654.894849385 30 ctime=1441974670.073024104 icedtea-web-1.5.3/config.sub0000755000076400007640000010624612574544511016523 0ustar00jvanekjvanek00000000000000#! /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.5.3/PaxHeaders.24993/config.guess0000644000000000000000000000013212574544511015765 xustar0030 mtime=1441974601.530235097 30 atime=1441974654.879849213 30 ctime=1441974670.072024092 icedtea-web-1.5.3/config.guess0000755000076400007640000012367212574544511017062 0ustar00jvanekjvanek00000000000000#! /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.5.3/PaxHeaders.24993/compile0000644000000000000000000000013212574544511015023 xustar0030 mtime=1441974601.528235074 30 atime=1441974601.528235074 30 ctime=1441974670.070024069 icedtea-web-1.5.3/compile0000755000076400007640000001624512574544511016115 0ustar00jvanekjvanek00000000000000#! /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.5.3/PaxHeaders.24993/README0000644000000000000000000000013112574544466014340 xustar0030 mtime=1441974582.516016221 29 atime=1441974656.35386618 30 ctime=1441974670.069024058 icedtea-web-1.5.3/README0000664000076400007640000001317412574544466015430 0ustar00jvanekjvanek00000000000000IcedTea-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/ 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 dormant, we will be hosting and modifying the sources in the IcedTea-Web repository, particularly in the netx/net/sourceforge/jnlp directory. 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. 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 $ gmake $ gmake install incantation. The build requirements are as follows: * A bootstrap JDK. At present, only IcedTea6 is supported. * A C compiler (for the launchers). * libX11 * zlib-devel Additionally, the plugin requires: * A C++ compiler * firefox-devel * xulrunner-devel 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) * junit4 (enables unit tests) See ./configure --help if you need to override the defaults. The following locations are checked for a JDK: * /usr/lib/jvm/java-openjdk * /usr/lib/jvm/icedtea6 * /usr/lib/jvm/java-6-openjdk * /usr/lib/jvm/openjdk * /usr/lib/jvm/java-icedtea * /usr/lib/jvm/java-gcj * /usr/lib/jvm/gcj-jdk * /usr/lib/jvm/cacao in the order given above. At present, some of these options fail due to sun.* classes required by IcedTea-Web. Upstream OpenJDK will only be able to compile IcedTea-Web if the patch applet_hole.patch from IcedTea has been applied. 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: * --disable-docs: Don't build the Javadoc documentation. * --with-gcj: Compile ecj to native code with gcj prior to building. * --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. * --with-javac: Specify the location of a 'javac' binary. By default, the path is checked for javac. * --with-jar: Specify the location of a 'jar' binary. By default, the path is checked for gjar and jar. * --with-ecj-jar: Specify the location of an ecj JAR file. By default, the following paths are checked: - /usr/share/java/eclipse-ecj.jar - /usr/share/java/ecj.jar - /usr/share/eclipse-ecj-3.{2,3,4,5}/lib/ecj.jar 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-junit: Specify the location of the junit 4 jar Rhino 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. By default, the following paths are checked for rhino: - /usr/share/java/js.jar - /usr/share/rhino-1.6/lib/js.jar - /usr/share/java/rhino.jar 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. JUnit 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. Testing ======= A set of automated tests is supplied for IcedTea-Web. They can be run by using 'make check'. Currently, this only tests a few parts of IcedTea-Web. 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. For debugging, the environment variable ICEDTEAPLUGIN_DEBUG should be set to 'true'. This will produce output on the console from the C++ side, and output from the Java side in $HOME/.icedteaplugin/java.stdout and $HOME/.icedteaplugin/java.stderr. It also starts the debug server on port 8787. icedtea-web-1.5.3/PaxHeaders.24993/NEWS0000644000000000000000000000013112574544466014157 xustar0030 mtime=1441974582.516016221 29 atime=1441974656.35386618 30 ctime=1441974670.067024035 icedtea-web-1.5.3/NEWS0000664000076400007640000002765312574544466015256 0ustar00jvanekjvanek00000000000000Key: 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.5.3 (2015-09-11): * permissions sandbox and signed app and unsigned app with permissions all-permissions now run in sandbox instead of not at all. * fixed DownloadService * 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 * MissingALACAdialog made available also for unsigned applications (but ignoring actual manifest value) and fixed New in release 1.5.2 (2014-11-26): * NetX - RH1095311, PR574 - References class sun.misc.Ref removed in OpenJDK 9 - fixed, and so buildable on JDK9 - RH1154177 - decoded file needed from cache - fixed NPE in https dialog - empty codebase behaves as "." New in release 1.5.1 (2014-08-13): * Massively improved offline abilities. * Improved to be able to run with any JDK * JDK 8 support added (URLPermission granted if applicable) * Added DE and PL localizations * Added KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK deployment property to control scan of Manifest file * 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() * Plugin - PR1743 - Intermittant deadlock in PluginRequestProcessor - RH1121549: coverity defects * PolicyEditor - codebases without permissions assigned save to file anyway (and re-appear on next open) - PR1776: NullPointer on save-and-exit - Custom permissions are properly formatted New in release 1.5 (2014-04-02): * 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 * 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 * 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.5.3/PaxHeaders.24993/INSTALL0000644000000000000000000000013212574544466014512 xustar0030 mtime=1441974582.512016175 30 atime=1441974656.352866169 30 ctime=1441974670.065024012 icedtea-web-1.5.3/INSTALL0000664000076400007640000003633212574544466015602 0ustar00jvanekjvanek00000000000000Installation 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.5.3/PaxHeaders.24993/ChangeLog0000644000000000000000000000012712574544466015237 xustar0030 mtime=1441974582.511016163 30 atime=1441974656.351866157 27 ctime=1441974670.064024 icedtea-web-1.5.3/ChangeLog0000664000076400007640000220776712574544466016341 0ustar00jvanekjvanek000000000000002015-09-11 Jiri Vanek Pre-release tuning * Makefile.am: (netx-html-gen.stamp) set number of changests to 20 (since 1.5.2) * NEWS: date of 1.5.3 set * configure.ac: (AC_INIT) set to use 1.5.3 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-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 cornercase 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 identificator 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, backuping 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 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. * netx/net/sourceforge/jnlp/security/dialogs/MatchingALACAttributePanel.java removed not working checkbox for rembering the action. 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. 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 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-04-17 Jiri Vanek Added tagsoup and rhino to javadoc classpath to prevent docline errors * Maefile.am: (stamps/netx-docs.stamp) (stamps/plugin-docs.stamp) added classpath parameter with rhino and tagsoup 2015-04-17 Jiri Vanek fixed doclint errors * netx/net/sourceforge/jnlp/JNLPFile.java: * netx/net/sourceforge/jnlp/util/FileUtils.java: * netx/net/sourceforge/nanoxml/XMLElement.java: * netx/net/sourceforge/nanoxml/XMLParseException.java: 2015-03-03 Jie Kang Fix DeadLockTest reproducers * tests/reproducers/simple/deadlocktest/testcases/DeadLockTestTest.java: (testSimpletest1lunchFork), (testSimpletest1lunchNoFork) removed division by two in final assert 2014-11-27 Jiri Vanek Post 1.5.2 changes * NEWS: added 1.5.3 section * configure.ac: (AC_INIT) bumped to 1.5.3pre 2014-11-25 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-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-20 Jiri Vanek Pre-release tuning * Makefile.am: (netx-html-gen.stamp) set number of changests to 22 (since 1.5.1) * NEWS: date of 1.5.2 set to 2014-11-26, added few lines. * configure.ac: (AC_INIT) set to use 1.5.2 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-14 Jiri Vanek Making loading of PAC provider more lenient * netx/net/sourceforge/jnlp/runtime/PacEvaluatorFactory.java: (getPacEvaluator) changed general Exception (instead IOException only) is catch. 2014-11-10 Jiri Vanek Added CZ and DE translation for CertWarningDialog messages * netx/net/sourceforge/jnlp/resources/Messages_cs.properties * netx/net/sourceforge/jnlp/resources/Messages_de.properties (CertWarnHTTPSAcceptTip, CertWarnHTTPSRejectTip): added 2014-11-05 Lukasz Dracz Added PL translation for CertWarningDialog messages * netx/net/sourceforge/jnlp/resources/Messages_pl.properties (CertWarnHTTPSAcceptTip, CertWarnHTTPSRejectTip): added 2014-11-05 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: If any of file, securityDelegate, or linkedButton are null, simply disable this component and do not add component listeners dependent upon these fields. Also, do not add multiple groups of permissions, and do not add the permissions to the securityDelegate until the linkedButton is actually clicked (rather than when the menu item is clicked) 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-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-09-02 Jie Kang Fixed CacheUtils clearCache method to also clear the Least Recently Used entries. * netx/net/sourceforge/jnlp/cache/CacheUtil.java: 2014-10-31 Jiri Vanek * tests/netx/unit/net/sourceforge/jnlp/util/logging/JavaConsoleTest.java fixing typo Levgl->Level 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-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-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-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-21 Andrew Azores * netx/javaws.1: Fixed typos, made formatting more consistent, and added missing documentation for -Xoffline switch. 2014-08-15 Jiri Vanek Post 1.5 changes * NEWS: added 1.5.1 section * configure.ac: (AC_INIT) bumped to 1.5.2pre 2014-05-14 Omair Majid * tests/test-extensions/net/sourceforge/jnlp/tools/CodeSignerCreator.java (KeyPair): New class. (createCert): Use KeyPair. 2014-08-07 Jiri Vanek Pre-release tuning * Makefile.am: (netx-html-gen.stamp) set number of changests to 36 (since 1.5) * NEWS: date of 1.5.1 set to 2014-08-13 * configure.ac: (AC_INIT) set to use 1.5 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 is now using JNLPRuntime isOnline* set of methods * 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/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/util/XDesktopEntry.java: now writes real url into desktop icon 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 (requireNonNull): new method, simply throws NPE if its argument is null * 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 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, and added debug warning messages * plugin/icedteanp/IcedTeaScriptablePluginObject.cc (setProperty): do not erroneously redeclare java_result * tests/cpp-unit-tests/IcedTeaPluginUtilsTest.cc (file_exists): added assertion that directories satisfy file_exist 2014-07-30 Jie Kang *NEWS: mentioned fixes to Java Console and itweb-settings UI. PR1856, 1857, 1859 2014-07-30 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-30 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-30 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-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. 2014-07-01 Jiri Vanek * NEWS: mentioned PL localization 2014-06-26 Jacob Wisor * netx/net/sourceforge/jnlp/util/logging/ConsoleOutputPane.java: (sortBy) Remove slipped in Java 7 language construct and API call 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 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/PolicyEditor.java (savePolicyFile): release fileLock with try/finally 2014-06-19 Jiri Vanek * NEWS: mentioned All JDKs ability, DE localization and KEY_ENABLE_MANIFEST_ATTRIBUTES_CHECK 2014-06-19 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-06-19 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 * tests/reproducers/simple/JavawsAWTRobotFindsButton/testcases/JavawsAWTRobotFindsButtonTest.java (static init) used system classlaoder to laod image 2014-06-19 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/AppletViewerPanelAccess.java: addedd accidentally skipped createAppletThread method * 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-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: Added new DE localized messages 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 Fixed NullPointerException when closing PolicyEditor with changes made and no file yet set (editor opened without arguments), and selecting yes to save changes before exit. * netx/net/sourceforge/jnlp/security/policyeditor/PolicyEditor.java (quit): if file is null, display file chooser prompt before attempting to save 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. * 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-07 Andrew Azores * netx/net/sourceforge/jnlp/security/SecurityDialogs.java: (showPartiallySignedWarningDialog) add missing shouldPromptUser check 2014-04-07 Jiri Vanek Post 1.5 changes * NEWS: added 1.5.1 section * configure.ac: (AC_INIT) bumped to 1.5.1pre 2014-04-02 Jiri Vanek * Makefile.am: bumped number of changeset in for about dialog. Fixed placement. 2014-04-02 Jiri Vanek * Changelog: minor fixes 2014-04-02 Jiri Vanek Pre-release tuning * Makefile.am: (netx-html-gen.stamp) set number of changests to 223 (since 1.4) * NEWS: date of 1.5 set to 201-04-02 * configure.ac: (AC_INIT) set to use 1.5 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 collapsable 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.5.3/PaxHeaders.24993/COPYING0000644000000000000000000000013212574544466014514 xustar0030 mtime=1441974582.490015921 30 atime=1441974656.351866157 30 ctime=1441974670.062023977 icedtea-web-1.5.3/COPYING0000664000076400007640000004312212574544466015577 0ustar00jvanekjvanek00000000000000 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.5.3/PaxHeaders.24993/AUTHORS0000644000000000000000000000013212574544466014531 xustar0030 mtime=1441974582.490015921 30 atime=1441974656.350866146 30 ctime=1441974670.060023954 icedtea-web-1.5.3/AUTHORS0000664000076400007640000000236612574544466015621 0ustar00jvanekjvanek00000000000000The 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 Danesh Dadachanji Adam Domurad Thomas Fitzsimmons MichaÅ‚ Górny < mgorny@gentoo.org > Mark Greenwood Peter Hatina Andrew John Hughes 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 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.5.3/PaxHeaders.24993/netx.manifest.in0000644000000000000000000000013212574544466016574 xustar0030 mtime=1441974582.521016278 30 atime=1441974666.989988615 30 ctime=1441974670.059023943 icedtea-web-1.5.3/netx.manifest.in0000664000076400007640000000054212574544466017656 0ustar00jvanekjvanek00000000000000Implementation-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.5.3/PaxHeaders.24993/jrunscript.in0000644000000000000000000000013112574544466016213 xustar0030 mtime=1441974582.520016267 30 atime=1441974667.002988764 29 ctime=1441974670.05702392 icedtea-web-1.5.3/jrunscript.in0000664000076400007640000000025212574544466017274 0ustar00jvanekjvanek00000000000000#!/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.5.3/PaxHeaders.24993/javac.in0000644000000000000000000000013212574544466015075 xustar0030 mtime=1441974582.520016267 30 atime=1441974666.995988684 30 ctime=1441974670.055023896 icedtea-web-1.5.3/javac.in0000664000076400007640000000317112574544466016160 0ustar00jvanekjvanek00000000000000#!/usr/bin/perl -w use strict; use constant NO_DUP_ARGS => qw(-source -target -d -encoding); use constant STRIP_ARGS => qw(-Werror -implicit:none); my $ECJ_WARNINGS="-warn:-unused,-serial"; my $JAVAC_WARNINGS="-Xlint:all,-serial"; my @bcoption; push @bcoption, '-bootclasspath', glob '@abs_top_builddir@/bootstrap/jdk1.6.0/jre/lib/rt.jar' unless grep {$_ eq '-bootclasspath'} @ARGV; my @ecj_parms = ($ECJ_WARNINGS, @bcoption); # Work around ecj's inability to handle duplicate command-line # options and unknown javac options. sub gen_ecj_opts { my @new_args = @{$_[0]}; for my $opt (NO_DUP_ARGS) { my @indices = reverse grep {$new_args[$_] eq $opt} 0..$#new_args; if (@indices > 1) { shift @indices; # keep last instance only splice @new_args, $_, 2 for @indices; } } for my $opt (STRIP_ARGS) { my @indices = reverse grep {$new_args[$_] eq $opt} 0..$#new_args; splice @new_args, $_, 1 for @indices; } return @new_args; } if ( -e "@abs_top_builddir@/native-ecj" ) { my @ecj_args = gen_ecj_opts( \@ARGV ); exec '@abs_top_builddir@/native-ecj', @ecj_parms, @ecj_args ; } elsif ( -e "@JAVAC@" ) { if ("@USING_ECJ@" eq "yes") { my @ecj_args = gen_ecj_opts( \@ARGV ); exec '@JAVAC@', @ecj_parms, @ecj_args ; } else { exec '@JAVAC@', $JAVAC_WARNINGS, @ARGV ; } } else { my @ecj_args = gen_ecj_opts( \@ARGV ); my @CLASSPATH = ('@ECJ_JAR@'); push @CLASSPATH, split /:/, $ENV{"CLASSPATH"} if exists $ENV{"CLASSPATH"}; $ENV{"CLASSPATH"} = join ':', @CLASSPATH; exec '@JAVA@', 'org.eclipse.jdt.internal.compiler.batch.Main', @ecj_parms, @ecj_args; } icedtea-web-1.5.3/PaxHeaders.24993/build.properties.in0000644000000000000000000000013212574544466017303 xustar0030 mtime=1441974582.518016244 30 atime=1441974667.010988856 30 ctime=1441974670.054023885 icedtea-web-1.5.3/build.properties.in0000664000076400007640000000007012574544466020361 0ustar00jvanekjvanek00000000000000# build-time settings rhino.available=@RHINO_AVAILABLE@ icedtea-web-1.5.3/PaxHeaders.24993/Makefile.in0000644000000000000000000000013212574544511015515 xustar0030 mtime=1441974601.610236018 30 atime=1441974666.982988534 30 ctime=1441974670.052023862 icedtea-web-1.5.3/Makefile.in0000664000076400007640000030522212574544511016602 0ustar00jvanekjvanek00000000000000# 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@ # Source directories 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@ @HAVE_TAGSOUP_FALSE@am__append_1 = net.sourceforge.jnlp.MalformedXMLParser.java 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 javac 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)/javac.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@ EMMA_AVAILABLE = @EMMA_AVAILABLE@ EMMA_JAR = @EMMA_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@ 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@ 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@ 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@ @WITH_RHINO_FALSE@RHINO_RUNTIME = @WITH_RHINO_TRUE@RHINO_RUNTIME = :$(RHINO_JAR) NETX_EXCLUDE_SRCS = $(am__append_1) # Conditional defintions @HAVE_TAGSOUP_TRUE@NETX_CLASSPATH_ARG = -classpath $(TAGSOUP_JAR) @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 @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: $(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: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(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 $@ javac: $(top_builddir)/config.status $(srcdir)/javac.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 export TOP_BUILD_DIR = $(abs_top_builddir) export NETX_DIR = $(abs_top_builddir)/netx.build export NETX_SRCDIR = $(abs_top_srcdir)/netx export NETX_RESOURCE_DIR=$(NETX_SRCDIR)/net/sourceforge/jnlp/resources 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 SOFTKILLER=softkiller 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 EMMA_JAVA_ARGS=-Xmx2G export EMMA_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 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=$(BOOT_DIR)/bin/java $(EMMA_JAVA_ARGS) -cp $(JACOCO_OPERATOR_DIR):$(JACOCO_CLASSPATH):. org.jacoco.operator.Main # linking variables export PLUGIN_LINK_NAME=libjavaplugin.so export MOZILLA_LOCAL_PLUGINDIR=${HOME}/.mozilla/plugins 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 export BOOT_DIR = $(abs_top_builddir)/bootstrap/jdk1.6.0 export RUNTIME = $(BOOT_DIR)/jre/lib/rt.jar:$(BOOT_DIR)/jre/lib/jsse.jar$(RHINO_RUNTIME):$(BOOT_DIR)/jre/lib/resources.jar # Flags export IT_CFLAGS=$(CFLAGS) $(ARCHFLAG) export IT_JAVAC_SETTINGS=-g -encoding utf-8 $(JAVACFLAGS) $(MEMORY_LIMIT) $(PREFER_SOURCE) export IT_LANGUAGE_SOURCE_VERSION=6 export IT_CLASS_TARGET_VERSION=6 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 LAUNCHER_BOOTCLASSPATH="-Xbootclasspath/a:$(datadir)/$(PACKAGE_NAME)/netx.jar$(RHINO_RUNTIME):$(TAGSOUP_JAR)" export PLUGIN_BOOTCLASSPATH='"-Xbootclasspath/a:$(datadir)/$(PACKAGE_NAME)/netx.jar:$(datadir)/$(PACKAGE_NAME)/plugin.jar$(RHINO_RUNTIME):$(TAGSOUP_JAR)"' export PLUGIN_COVERAGE_BOOTCLASSPATH='"-Xbootclasspath/a:$(datadir)/$(PACKAGE_NAME)/netx.jar:$(datadir)/$(PACKAGE_NAME)/plugin.jar$(RHINO_RUNTIME):$(JACOCO_CLASSPATH):$(TAGSOUP_JAR)"' # 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 \ itweb-settings.desktop.in launcher $(top_srcdir)/tests html-gen.sh netx-dist-tests-whitelist NEW_LINE_IFS # 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=$(BOOT_DIR)/bin/javac # 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-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-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 install-exec-local: ${mkinstalldirs} $(DESTDIR)$(bindir) $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/ $(DESTDIR)$(libdir) @ENABLE_PLUGIN_TRUE@ ${INSTALL_PROGRAM} $(PLUGIN_DIR)/$(BUILT_PLUGIN_LIBRARY) $(DESTDIR)$(libdir) @ENABLE_PLUGIN_TRUE@ ${INSTALL_DATA} $(abs_top_builddir)/liveconnect/lib/classes.jar $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/plugin.jar ${INSTALL_DATA} $(NETX_DIR)/lib/classes.jar $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/netx.jar ${INSTALL_DATA} $(NETX_SRCDIR)/javaws_splash.png $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/javaws_splash.png ${INSTALL_PROGRAM} launcher.build/$(javaws) $(DESTDIR)$(bindir) ${INSTALL_PROGRAM} launcher.build/$(itweb_settings) $(DESTDIR)$(bindir) ${INSTALL_PROGRAM} launcher.build/$(policyeditor) $(DESTDIR)$(bindir) install-data-local: ${mkinstalldirs} -d $(DESTDIR)$(mandir)/man1 ${INSTALL_DATA} $(NETX_SRCDIR)/javaws.1 $(DESTDIR)$(mandir)/man1 ${INSTALL_DATA} $(NETX_SRCDIR)/itweb-settings.1 $(DESTDIR)$(mandir)/man1 ${INSTALL_DATA} $(NETX_SRCDIR)/policyeditor.1 $(DESTDIR)$(mandir)/man1 @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) 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 -f $(DESTDIR)$(mandir)/man1/javaws.1 rm -f $(DESTDIR)$(mandir)/man1/itweb-settings.1 rm -f $(DESTDIR)$(mandir)/man1/policyeditor.1 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@ -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@ -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 && \ $(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) \ -d $(abs_top_builddir)/liveconnect \ -bootclasspath $(NETX_DIR):$(RUNTIME) \ $(NETX_CLASSPATH_ARG) \ -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 ; \ $(BOOT_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' $@ @HAVE_JAVA7_FALSE@ sed -i '/VariableX509TrustManagerJDK7/ d' $@ stamps/netx-html-gen.stamp: (cd $$NETX_SRCDIR/..; \ mkdir -p html-gen; \ cp AUTHORS NEWS COPYING ChangeLog html-gen/; \ export HTML_GEN_DEBUG=true; \ bash html-gen.sh 20; \ 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/bootstrap-directory.stamp stamps/netx-html-gen.stamp mkdir -p $(NETX_DIR) $(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) \ -d $(NETX_DIR) \ -sourcepath $(NETX_SRCDIR) \ -bootclasspath $(RUNTIME) \ $(NETX_CLASSPATH_ARG) \ @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 (cd $(NETX_DIR) ; \ mkdir -p lib ; \ $(BOOT_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: stamps/bootstrap-directory.stamp @ENABLE_DOCS_TRUE@ $(BOOT_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@ -classpath $(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: stamps/bootstrap-directory.stamp @ENABLE_DOCS_TRUE@@ENABLE_PLUGIN_TRUE@ $(BOOT_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@ -classpath $(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 # 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: stamps/bootstrap-directory.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) && \ $(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) \ -d $(JUNIT_RUNNER_DIR) \ -classpath $(JUNIT_JAR):$(TEST_EXTENSIONS_DIR) \ @junit-runner-source-files.txt && \ $(BOOT_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)/ ; \ find . -maxdepth 1 -mindepth 1 | sed "s/.\/*//" > $(abs_top_builddir)/$@ junit-jnlp-dist-simple.txt: cd $(REPRODUCERS_TESTS_SRCDIR)/simple/ ; \ find . -maxdepth 1 -mindepth 1 | sed "s/.\/*//" > $(abs_top_builddir)/$@ stamps/junit-jnlp-dist-signed.stamp: types=($(SIGNED_REPRODUCERS)) ; \ for which in "$${types[@]}" ; do \ pushd $(REPRODUCERS_TESTS_SRCDIR)/$$which/ ; \ find . -maxdepth 1 -mindepth 1 | sed "s/.\/*//" > $(abs_top_builddir)/junit-jnlp-dist-$$which.txt ; \ 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/.\/*//"` ; \ $(BOOT_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 \ $(BOOT_DIR)/bin/jar cfm "$(REPRODUCERS_TESTS_SERVER_DEPLOYDIR)/$$dir.jar" $(META_MANIFEST) * ; \ else \ $(BOOT_DIR)/bin/jar cf "$(REPRODUCERS_TESTS_SERVER_DEPLOYDIR)/$$dir.jar" * ; \ 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 ; \ $(BOOT_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 \ $(BOOT_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 \ $(BOOT_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 \ $(BOOT_DIR)/bin/keytool -export -alias $(TEST_CERT_ALIAS)_$$which -file $(EXPORTED_TEST_CERT_PREFIX)_$$which.$(EXPORTED_TEST_CERT_SUFFIX) -storepass $(PRIVATE_KEYSTORE_PASS) -keystore $(PRIVATE_KEYSTORE_NAME) ; \ done ; mkdir -p stamps && \ touch $@ 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 | $(BOOT_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 \ $(BOOT_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); $(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) \ -d $(TEST_EXTENSIONS_DIR) \ -classpath $(JUNIT_JAR):$(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: find $(TEST_EXTENSIONS_TESTS_SRCDIR) -name '*.java' | sort > $@ 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); $(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) \ -d $(TEST_EXTENSIONS_TESTS_DIR) \ -classpath $(JUNIT_JAR):$(NETX_DIR)/lib/classes.jar:$(TEST_EXTENSIONS_DIR) \ @test-extensions-tests-source-files.txt && \ 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 \ $(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) \ -d $(TEST_EXTENSIONS_TESTS_DIR) \ -classpath $(JUNIT_JAR):$(NETX_DIR)/lib/classes.jar:$(TEST_EXTENSIONS_DIR) \ "$(REPRODUCERS_TESTS_SRCDIR)/$$which/$$dir/testcases/"*.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): $(REPRODUCERS_CLASS_WHITELIST) whiteListed=`cat $(REPRODUCERS_CLASS_WHITELIST)`; \ 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' ` ; \ INLCUDE="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"; \ INLCUDE="YES" ; \ fi; \ done; \ if [ "$$INLCUDE" = "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) $(TESTS_DIR)/$(SOFTKILLER): cd $(TESTS_SRCDIR)/$(SOFTKILLER); \ $(MAKE) ; \ mv $(SOFTKILLER) $(TESTS_DIR)/ 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 $(TESTS_DIR)/softkiller \ stamps/test-extensions-compile.stamp stamps/compile-reproducers-testcases.stamp $(JUNIT_RUNNER_JAR) stamps/copy-reproducers-resources.stamp\ $(TESTS_DIR)/$(REPORT_STYLES_DIRNAME) $(REPRODUCERS_CLASS_NAMES) stamps/process-custom-reproducers.stamp cd $(TEST_EXTENSIONS_DIR) ; \ class_names=`cat $(REPRODUCERS_CLASS_NAMES)` ; \ CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):.:$(TEST_EXTENSIONS_TESTS_DIR):$(TEST_EXTENSIONS_SRCDIR) ; \ $(BOOT_DIR)/bin/java $(REPRODUCERS_DPARAMETERS) \ -Xbootclasspath/a:$(RUNTIME):$$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) && \ $(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) \ -d $(NETX_UNIT_TEST_DIR) \ -classpath $(JUNIT_JAR):$(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=$(NETX_DIR)/lib/classes.jar:$(abs_top_builddir)/liveconnect/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):$(TEST_EXTENSIONS_DIR):.:$(TEST_EXTENSIONS_SRCDIR):$(TAGSOUP_JAR) ; \ $(BOOT_DIR)/bin/java -Xbootclasspath/a:$(RUNTIME):$$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 $@ #warning, during this target tests.build/netx/unit/tests-output.xml is backup and rewriten (but not coresponding html file) #xml results run from emma sandbox, however, can be wrong, co the new tests-output.xml is then renamed and orginal one restored #you can add -ix "-*Test*" -ix "-*test*" to ignore all test cases from statistics stamps/run-unit-test-code-coverage.stamp: stamps/netx-unit-tests-compile.stamp $(JUNIT_RUNNER_JAR) \ $(TESTS_DIR)/$(REPORT_STYLES_DIRNAME) $(UNIT_CLASS_NAMES) @WITH_EMMA_TRUE@ cd $(NETX_UNIT_TEST_DIR) ; \ @WITH_EMMA_TRUE@ for file in $(EMMA_MODIFIED_FILES) ; do \ @WITH_EMMA_TRUE@ mv $(NETX_UNIT_TEST_DIR)/$$file $(NETX_UNIT_TEST_DIR)/"$$file""$(EMMA_BACKUP_SUFFIX)" ; \ @WITH_EMMA_TRUE@ done ;\ @WITH_EMMA_TRUE@ class_names=`cat $(UNIT_CLASS_NAMES)` ; \ @WITH_EMMA_TRUE@ CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(abs_top_builddir)/liveconnect/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):$(TEST_EXTENSIONS_DIR):.:$(TEST_EXTENSIONS_SRCDIR) ; \ @WITH_EMMA_TRUE@ $(BOOT_DIR)/bin/java $(EMMA_JAVA_ARGS) -Xbootclasspath/a:$(RUNTIME):$$CLASSPATH -cp $(EMMA_JAR) -Demma.report.html.out.encoding=UTF-8 emmarun \ @WITH_EMMA_TRUE@ -Dreport.html.out.encoding=UTF-8 \ @WITH_EMMA_TRUE@ -raw \ @WITH_EMMA_TRUE@ -sp $(NETX_SRCDIR) \ @WITH_EMMA_TRUE@ -sp $(NETX_UNIT_TEST_SRCDIR) \ @WITH_EMMA_TRUE@ -sp $(JUNIT_RUNNER_SRCDIR) \ @WITH_EMMA_TRUE@ -r html \ @WITH_EMMA_TRUE@ -r xml \ @WITH_EMMA_TRUE@ -cp $(NETX_DIR)/lib/classes.jar \ @WITH_EMMA_TRUE@ -cp $(JUNIT_JAR) \ @WITH_EMMA_TRUE@ -cp $(JUNIT_RUNNER_JAR) \ @WITH_EMMA_TRUE@ -cp $(BOOT_DIR)/jre/lib/rt.jar \ @WITH_EMMA_TRUE@ -cp $(BOOT_DIR)/jre/lib/jsse.jar \ @WITH_EMMA_TRUE@ -cp $(BOOT_DIR)/jre/lib/resources.jar \ @WITH_EMMA_TRUE@ -cp $(RHINO_RUNTIME) \ @WITH_EMMA_TRUE@ -cp $(TEST_EXTENSIONS_DIR) \ @WITH_EMMA_TRUE@ -cp $(TEST_EXTENSIONS_SRCDIR) \ @WITH_EMMA_TRUE@if HAVE_TAGSOUP @WITH_EMMA_TRUE@ -cp $(TAGSOUP_JAR) \ @WITH_EMMA_TRUE@endif @WITH_EMMA_TRUE@ -cp . \ @WITH_EMMA_TRUE@ -ix "-org.junit.*" \ @WITH_EMMA_TRUE@ -ix "-junit.*" \ @WITH_EMMA_TRUE@ CommandLine $$class_names ; \ @WITH_EMMA_TRUE@ for file in $(EMMA_MODIFIED_FILES) ; do \ @WITH_EMMA_TRUE@ mv $(NETX_UNIT_TEST_DIR)/$$file $(NETX_UNIT_TEST_DIR)/"$$file""$(EMMA_SUFFIX)" ; \ @WITH_EMMA_TRUE@ mv $(NETX_UNIT_TEST_DIR)/"$$file""$(EMMA_BACKUP_SUFFIX)" $(NETX_UNIT_TEST_DIR)/$$file ; \ @WITH_EMMA_TRUE@ done ; @WITH_EMMA_FALSE@ echo "Sorry, coverage report cant be run without emma installed. Try install emma or specify with-emma value" ; @WITH_EMMA_FALSE@ exit 5 touch $@ stamps/compile-jacoco-operator.stamp: jacoco-operator-source-files.txt @WITH_JACOCO_TRUE@ mkdir -p $(JACOCO_OPERATOR_DIR) && \ @WITH_JACOCO_TRUE@ $(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) \ @WITH_JACOCO_TRUE@ -d $(JACOCO_OPERATOR_DIR) \ @WITH_JACOCO_TRUE@ -classpath $(JACOCO_CLASSPATH) \ @WITH_JACOCO_TRUE@ @jacoco-operator-source-files.txt ; @WITH_JACOCO_FALSE@ echo "Sorry, jacoco coverage report generator cant be compiled without jacoco installed. Try installing jacoco or specify with-jacoco value" ; @WITH_JACOCO_FALSE@ exit 5 touch $@ #warning, during this target tests.build/netx/unit/tests-output.xml is backup and rewriten (but not coresponding html file) #xml results run with jacoco agent however, can be wrong, co the new tests-output.xml is then renamed and orginal one restored stamps/run-unit-test-code-coverage-jacoco.stamp: stamps/netx-unit-tests-compile.stamp $(JUNIT_RUNNER_JAR) \ $(TESTS_DIR)/$(REPORT_STYLES_DIRNAME) $(UNIT_CLASS_NAMES) stamps/compile-jacoco-operator.stamp @WITH_JACOCO_TRUE@ filename=" " ; \ @WITH_JACOCO_TRUE@ cd $(NETX_UNIT_TEST_SRCDIR) ; \ @WITH_JACOCO_TRUE@ for file in `find . -type f \! -iname "*.java"`; do\ @WITH_JACOCO_TRUE@ filename=`echo $$file `; \ @WITH_JACOCO_TRUE@ cp --parents $$filename $(NETX_UNIT_TEST_DIR) ; \ @WITH_JACOCO_TRUE@ done ; \ @WITH_JACOCO_TRUE@ cd $(NETX_UNIT_TEST_DIR) ; \ @WITH_JACOCO_TRUE@ for file in $(EMMA_MODIFIED_FILES) ; do \ @WITH_JACOCO_TRUE@ mv $(NETX_UNIT_TEST_DIR)/$$file $(NETX_UNIT_TEST_DIR)/"$$file""$(EMMA_BACKUP_SUFFIX)" ; \ @WITH_JACOCO_TRUE@ done ;\ @WITH_JACOCO_TRUE@ class_names=`cat $(UNIT_CLASS_NAMES)` ; \ @WITH_JACOCO_TRUE@ CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(abs_top_builddir)/liveconnect/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):$(TEST_EXTENSIONS_DIR):$(JACOCO_CLASSPATH):.:$(TEST_EXTENSIONS_SRCDIR):$(TAGSOUP_JAR) ; \ @WITH_JACOCO_TRUE@ $(BOOT_DIR)/bin/java $(JACOCO_AGENT_SWITCH) -Xbootclasspath/a:$(RUNTIME):$$CLASSPATH CommandLine $$class_names ; \ @WITH_JACOCO_TRUE@ for file in $(EMMA_MODIFIED_FILES) ; do \ @WITH_JACOCO_TRUE@ mv $(NETX_UNIT_TEST_DIR)/$$file $(NETX_UNIT_TEST_DIR)/"$$file""$(EMMA_SUFFIX)" ; \ @WITH_JACOCO_TRUE@ mv $(NETX_UNIT_TEST_DIR)/"$$file""$(EMMA_BACKUP_SUFFIX)" $(NETX_UNIT_TEST_DIR)/$$file ; \ @WITH_JACOCO_TRUE@ done ; \ @WITH_JACOCO_TRUE@ $(JACOCO_OPERATOR_EXEC) \ @WITH_JACOCO_TRUE@ report --die-soon --html-output coverage --xml-output coverage.xml --input-file jacoco.exec \ @WITH_JACOCO_TRUE@ --input-srcs $(NETX_SRCDIR) $(PLUGIN_SRCDIR)/java $(NETX_UNIT_TEST_SRCDIR) $(JUNIT_RUNNER_SRCDIR) $(TEST_EXTENSIONS_SRCDIR) \ @WITH_JACOCO_TRUE@ --input-builds $(NETX_DIR)/lib/classes.jar $(abs_top_builddir)/liveconnect/lib/classes.jar $(NETX_UNIT_TEST_DIR) $(JUNIT_RUNNER_JAR) $(TEST_EXTENSIONS_DIR) \ @WITH_JACOCO_TRUE@ --title "IcedTea-Web unit-tests codecoverage" ; @WITH_JACOCO_FALSE@ echo "Sorry, coverage report cant be run without jacoco installed. Try installing jacoco or specify with-jacoco value" ; @WITH_JACOCO_FALSE@ exit 5 touch $@ #warning, during this target tests.build/netx/jnlp_testsengine/tests-output.xml is backup and rewriten (but not coresponding html file) #xml results run from emma sandbox, however, can be wrong, co the new tests-output.xml is then renamed and orginal one restored stamps/run-reproducers-test-code-coverage.stamp: stamps/run-netx-dist-tests.stamp $(REPRODUCERS_CLASS_NAMES) @WITH_EMMA_TRUE@ cd $(TESTS_DIR) ; \ @WITH_EMMA_TRUE@ for file in $(EMMA_MODIFIED_FILES) ; do \ @WITH_EMMA_TRUE@ mv $(TEST_EXTENSIONS_DIR)/$$file $(TEST_EXTENSIONS_DIR)/"$$file""$(EMMA_BACKUP_SUFFIX)" ; \ @WITH_EMMA_TRUE@ done ;\ @WITH_EMMA_TRUE@ echo "backuping javaws and netx.jar in $(DESTDIR)" ; \ @WITH_EMMA_TRUE@ netx_backup=$(DESTDIR)$(datadir)/$(PACKAGE_NAME)/netx_backup.jar ; \ @WITH_EMMA_TRUE@ javaws_backup=$(DESTDIR)$(bindir)/javaws_backup ; \ @WITH_EMMA_TRUE@ mv $(DESTDIR)$(bindir)/javaws $$javaws_backup ; \ @WITH_EMMA_TRUE@ mv $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/netx.jar $$netx_backup ; \ @WITH_EMMA_TRUE@ nw_bootclasspath="$(LAUNCHER_BOOTCLASSPATH):$(EMMA_JAR):$$netx_backup" ; \ @WITH_EMMA_TRUE@ instructed_dir=$(TESTS_DIR)/instr ; \ @WITH_EMMA_TRUE@ echo "instrumenting netx.jar from $$netx_backup through $$instructed_dir" ; \ @WITH_EMMA_TRUE@ $(BOOT_DIR)/bin/java -cp $(EMMA_JAR) emma instr -d $$instructed_dir -ip $$netx_backup ; \ @WITH_EMMA_TRUE@ pushd $$instructed_dir ; \ @WITH_EMMA_TRUE@ $(BOOT_DIR)/bin/jar -cf $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/netx.jar * ; \ @WITH_EMMA_TRUE@ popd ; \ @WITH_EMMA_TRUE@ rm -rf $$instructed_dir ; \ @WITH_EMMA_TRUE@ echo "patching $(javaws)" ; \ @WITH_EMMA_TRUE@ cat $$javaws_backup | sed "s,$(LAUNCHER_BOOTCLASSPATH),$$nw_bootclasspath," > $(DESTDIR)$(bindir)/$(javaws) ; \ @WITH_EMMA_TRUE@ chmod 777 $(DESTDIR)$(bindir)/$(javaws) ; \ @WITH_EMMA_TRUE@ testcases_srcs=( ) ; \ @WITH_EMMA_TRUE@ k=0 ; \ @WITH_EMMA_TRUE@ types=($(ALL_REPRODUCERS)); \ @WITH_EMMA_TRUE@ for which in "$${types[@]}" ; do \ @WITH_EMMA_TRUE@ . $(abs_top_srcdir)/NEW_LINE_IFS ; \ @WITH_EMMA_TRUE@ simpleReproducers=(`cat $(abs_top_builddir)/junit-jnlp-dist-$$which.txt `); \ @WITH_EMMA_TRUE@ IFS="$$IFS_BACKUP" ; \ @WITH_EMMA_TRUE@ for dir in "$${simpleReproducers[@]}" ; do \ @WITH_EMMA_TRUE@ testcases_srcs[k]="-sp" ; \ @WITH_EMMA_TRUE@ k=$$((k+1)) ; \ @WITH_EMMA_TRUE@ testcases_srcs[k]="$(REPRODUCERS_TESTS_SRCDIR)/$$which/$$dir/testcases/" ; \ @WITH_EMMA_TRUE@ k=$$((k+1)) ; \ @WITH_EMMA_TRUE@ done ; \ @WITH_EMMA_TRUE@ done ; \ @WITH_EMMA_TRUE@ cd $(TEST_EXTENSIONS_DIR) ; \ @WITH_EMMA_TRUE@ class_names=`cat $(REPRODUCERS_CLASS_NAMES)` ; \ @WITH_EMMA_TRUE@ CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(abs_top_builddir)/liveconnect/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):$(TEST_EXTENSIONS_DIR):.:$(TEST_EXTENSIONS_SRCDIR) ; \ @WITH_EMMA_TRUE@ $(BOOT_DIR)/bin/java \ @WITH_EMMA_TRUE@ $(EMMA_JAVA_ARGS) \ @WITH_EMMA_TRUE@ $(REPRODUCERS_DPARAMETERS) \ @WITH_EMMA_TRUE@ -Xbootclasspath/a:$(RUNTIME):$$CLASSPATH -cp $(EMMA_JAR) emmarun \ @WITH_EMMA_TRUE@ -raw \ @WITH_EMMA_TRUE@ -cp $(NETX_DIR)/lib/classes.jar \ @WITH_EMMA_TRUE@ -cp $(JUNIT_JAR) \ @WITH_EMMA_TRUE@ -cp $(JUNIT_RUNNER_JAR) \ @WITH_EMMA_TRUE@ -cp $(BOOT_DIR)/jre/lib/rt.jar \ @WITH_EMMA_TRUE@ -cp $(BOOT_DIR)/jre/lib/jsse.jar \ @WITH_EMMA_TRUE@ -cp $(BOOT_DIR)/jre/lib/resources.jar \ @WITH_EMMA_TRUE@ -cp $(RHINO_RUNTIME) \ @WITH_EMMA_TRUE@ -cp . \ @WITH_EMMA_TRUE@ -cp $(TEST_EXTENSIONS_SRCDIR) \ @WITH_EMMA_TRUE@ -cp $(TEST_EXTENSIONS_TESTS_DIR) \ @WITH_EMMA_TRUE@ -ix "-org.junit.*" \ @WITH_EMMA_TRUE@ -ix "-junit.*" \ @WITH_EMMA_TRUE@ CommandLine $$class_names ; \ @WITH_EMMA_TRUE@ mv $(TEST_EXTENSIONS_DIR)/coverage.ec $(TEST_EXTENSIONS_DIR)/coverageX.ec ; \ @WITH_EMMA_TRUE@ mv $(TEST_EXTENSIONS_DIR)/coverage.es $(TEST_EXTENSIONS_DIR)/coverageX.es ; \ @WITH_EMMA_TRUE@ $(BOOT_DIR)/bin/java $(EMMA_JAVA_ARGS) -cp $(EMMA_JAR) emma merge \ @WITH_EMMA_TRUE@ -in $(TESTS_DIR)/coverage.em \ @WITH_EMMA_TRUE@ -in $(TEST_EXTENSIONS_DIR)/coverageX.ec \ @WITH_EMMA_TRUE@ -in $(TEST_EXTENSIONS_DIR)/coverageX.es ; \ @WITH_EMMA_TRUE@ $(BOOT_DIR)/bin/java $(EMMA_JAVA_ARGS) -cp $(EMMA_JAR) -Demma.report.html.out.encoding=UTF-8 emma report \ @WITH_EMMA_TRUE@ -Dreport.html.out.encoding=UTF-8 \ @WITH_EMMA_TRUE@ -in $(TEST_EXTENSIONS_DIR)/coverage.es \ @WITH_EMMA_TRUE@ -sp $(NETX_SRCDIR) \ @WITH_EMMA_TRUE@ -sp $(NETX_UNIT_TEST_SRCDIR) \ @WITH_EMMA_TRUE@ -sp $(JUNIT_RUNNER_SRCDIR) \ @WITH_EMMA_TRUE@ -sp $(TEST_EXTENSIONS_SRCDIR) \ @WITH_EMMA_TRUE@ -sp $(TEST_EXTENSIONS_TESTS_SRCDIR) \ @WITH_EMMA_TRUE@ -r html \ @WITH_EMMA_TRUE@ -r xml \ @WITH_EMMA_TRUE@ "$${testcases_srcs[@]}" ; \ @WITH_EMMA_TRUE@ echo "restoring javaws and netx.jar in $(DESTDIR)" ; \ @WITH_EMMA_TRUE@ rm -f $(DESTDIR)$(bindir)/$(javaws) $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/netx.jar ; \ @WITH_EMMA_TRUE@ rm -f $(DESTDIR)$(bindir)/$(javaws); \ @WITH_EMMA_TRUE@ mv $$javaws_backup $(DESTDIR)$(bindir)/$(javaws); \ @WITH_EMMA_TRUE@ mv $$netx_backup $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/netx.jar ; \ @WITH_EMMA_TRUE@ for file in $(EMMA_MODIFIED_FILES) ; do \ @WITH_EMMA_TRUE@ mv $(TEST_EXTENSIONS_DIR)/$$file $(TEST_EXTENSIONS_DIR)/"$$file""$(EMMA_SUFFIX)" ; \ @WITH_EMMA_TRUE@ mv $(TEST_EXTENSIONS_DIR)/"$$file""$(EMMA_BACKUP_SUFFIX)" $(TEST_EXTENSIONS_DIR)/$$file ; \ @WITH_EMMA_TRUE@ done ;\ @WITH_EMMA_TRUE@ rm $(TEST_EXTENSIONS_DIR)/coverage.txt ; @WITH_EMMA_FALSE@ echo "Sorry, coverage report cant be run without emma installed. Try install emma or specify with-emma value" ; @WITH_EMMA_FALSE@ exit 5 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\"" \ -DPLUGIN_VERSION="\"$(PLUGIN_VERSION)\"" \ -DPACKAGE_URL="\"$(PACKAGE_URL)\"" \ -DMOZILLA_VERSION_COLLAPSED="$(MOZILLA_VERSION_COLLAPSED)" \ -DICEDTEA_WEB_JRE="\"$(SYSTEM_JRE_DIR)\"" \ -DPLUGIN_BOOTCLASSPATH=$(PLUGIN_COVERAGE_BOOTCLASSPATH) \ -DCOVERAGE_AGENT=$(JACOCO_AGENT_PLUGIN_SWITCH) \ $(GLIB_CFLAGS) \ $(MOZILLA_CFLAGS) \ -fvisibility=hidden \ -fPIC -o $@ -c $< $(COVERABLE_PLUGIN_DIR)/$(BUILT_PLUGIN_LIBRARY): $(addprefix $(COVERABLE_PLUGIN_DIR)/,$(PLUGIN_OBJECTS)) cd $(COVERABLE_PLUGIN_DIR) && \ $(CXX) $(CXXFLAGS) \ $(PLUGIN_OBJECTS) \ $(GLIB_LIBS) \ $(MOZILLA_LIBS) \ -shared -o $@ stamps/build-fake-plugin.stamp: $(COVERABLE_PLUGIN_DIR) $(addprefix $(PLUGIN_SRCDIR)/,$(PLUGIN_SRC)) $(addprefix $(COVERABLE_PLUGIN_DIR)/,$(PLUGIN_OBJECTS)) stamps/liveconnect-dist.stamp $(COVERABLE_PLUGIN_DIR)/$(BUILT_PLUGIN_LIBRARY) touch $@ #warning, during this target tests.build/netx/jnlp_testsengine/tests-output.xml is backup and rewriten (but not coresponding html file) #xml results run with jacoco agent, however, can be wrong, co the new tests-output.xml is then renamed and orginal one restored stamps/run-reproducers-test-code-coverage-jacoco.stamp: stamps/run-netx-dist-tests.stamp $(REPRODUCERS_CLASS_NAMES) \ stamps/compile-jacoco-operator.stamp stamps/build-fake-plugin.stamp @WITH_JACOCO_TRUE@ cd $(TESTS_DIR) ; \ @WITH_JACOCO_TRUE@ for file in $(EMMA_MODIFIED_FILES) ; do \ @WITH_JACOCO_TRUE@ mv $(TEST_EXTENSIONS_DIR)/$$file $(TEST_EXTENSIONS_DIR)/"$$file""$(EMMA_BACKUP_SUFFIX)" ; \ @WITH_JACOCO_TRUE@ done ;\ @WITH_JACOCO_TRUE@ echo "backuping javaws in $(DESTDIR)$(bindir)" ; \ @WITH_JACOCO_TRUE@ javaws_backup=$(DESTDIR)$(bindir)/javaws_backup ; \ @WITH_JACOCO_TRUE@ mv $(DESTDIR)$(bindir)/javaws $$javaws_backup ; \ @WITH_JACOCO_TRUE@ echo "patching $(javaws)" ; \ @WITH_JACOCO_TRUE@ nw_bootclasspath="$(LAUNCHER_BOOTCLASSPATH):$(JACOCO_CLASSPATH)" ; \ @WITH_JACOCO_TRUE@ cat $$javaws_backup | sed "s|COMMAND.k.=\"..JAVA.\"|COMMAND[k]=\"\\$$\\{JAVA\\}\" ; k=1 ; COMMAND[k]=$(JACOCO_AGENT_JAVAWS_SWITCH)|" | sed "s,$(LAUNCHER_BOOTCLASSPATH),$$nw_bootclasspath," > $(DESTDIR)$(bindir)/$(javaws) ; \ @WITH_JACOCO_TRUE@ chmod 777 $(DESTDIR)$(bindir)/$(javaws) ; \ @WITH_JACOCO_TRUE@ echo "backuping plugin in $(DESTDIR)/$(libdir)$(BUILT_PLUGIN_LIBRARY)" ; \ @WITH_JACOCO_TRUE@ plugin_backup=$(DESTDIR)$(libdir)/$(BUILT_PLUGIN_LIBRARY)_backup ; \ @WITH_JACOCO_TRUE@ mv $(DESTDIR)$(libdir)/$(BUILT_PLUGIN_LIBRARY) $$plugin_backup ; \ @WITH_JACOCO_TRUE@ echo "fakeing plugin" ; \ @WITH_JACOCO_TRUE@ cp $(COVERABLE_PLUGIN_DIR)/$(BUILT_PLUGIN_LIBRARY) $(DESTDIR)$(libdir)/$(BUILT_PLUGIN_LIBRARY) ; \ @WITH_JACOCO_TRUE@ testcases_srcs=( ) ; \ @WITH_JACOCO_TRUE@ k=0 ; \ @WITH_JACOCO_TRUE@ types=($(ALL_REPRODUCERS)); \ @WITH_JACOCO_TRUE@ for which in "$${types[@]}" ; do \ @WITH_JACOCO_TRUE@ . $(abs_top_srcdir)/NEW_LINE_IFS ; \ @WITH_JACOCO_TRUE@ simpleReproducers=(`cat $(abs_top_builddir)/junit-jnlp-dist-$$which.txt `); \ @WITH_JACOCO_TRUE@ IFS="$$IFS_BACKUP" ; \ @WITH_JACOCO_TRUE@ for dir in "$${simpleReproducers[@]}" ; do \ @WITH_JACOCO_TRUE@ testcases_srcs[k]="$(REPRODUCERS_TESTS_SRCDIR)/$$which/$$dir/testcases/" ; \ @WITH_JACOCO_TRUE@ k=$$((k+1)) ; \ @WITH_JACOCO_TRUE@ done ; \ @WITH_JACOCO_TRUE@ done ; \ @WITH_JACOCO_TRUE@ cd $(TEST_EXTENSIONS_DIR) ; \ @WITH_JACOCO_TRUE@ class_names=`cat $(REPRODUCERS_CLASS_NAMES)` ; \ @WITH_JACOCO_TRUE@ CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):.:$(TEST_EXTENSIONS_DIR):$(JACOCO_CLASSPATH):$(TEST_EXTENSIONS_TESTS_DIR):$(TEST_EXTENSIONS_SRCDIR) ; \ @WITH_JACOCO_TRUE@ $(BOOT_DIR)/bin/java $(JACOCO_AGENT_SWITCH) $(REPRODUCERS_DPARAMETERS) \ @WITH_JACOCO_TRUE@ -Xbootclasspath/a:$(RUNTIME):$$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 $(EMMA_MODIFIED_FILES) ; do \ @WITH_JACOCO_TRUE@ mv $(TEST_EXTENSIONS_DIR)/$$file $(TEST_EXTENSIONS_DIR)/"$$file""$(EMMA_SUFFIX)" ; \ @WITH_JACOCO_TRUE@ mv $(TEST_EXTENSIONS_DIR)/"$$file""$(EMMA_BACKUP_SUFFIX)" $(TEST_EXTENSIONS_DIR)/$$file ; \ @WITH_JACOCO_TRUE@ done ; @WITH_JACOCO_FALSE@ echo "Sorry, coverage report cant be run without jacoco installed. Try installing jacoco or specify with-jacoco value" ; @WITH_JACOCO_FALSE@ exit 5 touch $@ run-test-code-coverage-jacoco: stamps/run-unit-test-code-coverage-jacoco.stamp stamps/run-reproducers-test-code-coverage-jacoco.stamp @WITH_JACOCO_TRUE@ cd $(TESTS_DIR) ; \ @WITH_JACOCO_TRUE@ k=0 ; \ @WITH_JACOCO_TRUE@ types=($(ALL_REPRODUCERS)); \ @WITH_JACOCO_TRUE@ for which in "$${types[@]}" ; do \ @WITH_JACOCO_TRUE@ . $(abs_top_srcdir)/NEW_LINE_IFS ; \ @WITH_JACOCO_TRUE@ simpleReproducers=(`cat $(abs_top_builddir)/junit-jnlp-dist-$$which.txt `); \ @WITH_JACOCO_TRUE@ IFS="$$IFS_BACKUP" ; \ @WITH_JACOCO_TRUE@ for dir in "$${simpleReproducers[@]}" ; do \ @WITH_JACOCO_TRUE@ testcases_srcs[k]="$(REPRODUCERS_TESTS_SRCDIR)/$$which/$$dir/testcases/" ; \ @WITH_JACOCO_TRUE@ k=$$((k+1)) ; \ @WITH_JACOCO_TRUE@ done ; \ @WITH_JACOCO_TRUE@ done ; \ @WITH_JACOCO_TRUE@ class_names=`cat $(REPRODUCERS_CLASS_NAMES)` ; \ @WITH_JACOCO_TRUE@ $(JACOCO_OPERATOR_EXEC) \ @WITH_JACOCO_TRUE@ merge --die-soon --input-files $(TEST_EXTENSIONS_DIR)/jacoco-merged-reproducers.exec $(NETX_UNIT_TEST_DIR)/jacoco.exec --output-file jacoco-merged.exec; \ @WITH_JACOCO_TRUE@ $(JACOCO_OPERATOR_EXEC) \ @WITH_JACOCO_TRUE@ report --html-output coverage --xml-output coverage.xml --input-file jacoco-merged.exec \ @WITH_JACOCO_TRUE@ --input-srcs $(NETX_SRCDIR) $(PLUGIN_SRCDIR)/java $(JUNIT_RUNNER_SRCDIR) $(TEST_EXTENSIONS_SRCDIR) $(TEST_EXTENSIONS_TESTS_SRCDIR) "$${testcases_srcs[@]}" \ @WITH_JACOCO_TRUE@ --input-builds $(NETX_DIR)/lib/classes.jar $(abs_top_builddir)/liveconnect/lib/classes.jar $(JUNIT_RUNNER_JAR) $(TEST_EXTENSIONS_DIR) $(TEST_EXTENSIONS_TESTS_DIR) \ @WITH_JACOCO_TRUE@ --input-srcs $(NETX_UNIT_TEST_SRCDIR) \ @WITH_JACOCO_TRUE@ --input-builds $(NETX_UNIT_TEST_DIR) \ @WITH_JACOCO_TRUE@ --title "IcedTea-Web complete codecoverage" ; @WITH_JACOCO_FALSE@ echo "Sorry, coverage report cant be run without jacoco installed. Try installing jacoco or specify with-jacoco value" ; @WITH_JACOCO_FALSE@ exit 5 run-test-code-coverage: stamps/run-unit-test-code-coverage.stamps stamps/run-reproducers-test-code-coverage.stamps @WITH_EMMA_TRUE@ cd $(TESTS_DIR) ; \ @WITH_EMMA_TRUE@ k=0 ; \ @WITH_EMMA_TRUE@ types=($(ALL_REPRODUCERS)); \ @WITH_EMMA_TRUE@ for which in "$${types[@]}" ; do \ @WITH_EMMA_TRUE@ . $(abs_top_srcdir)/NEW_LINE_IFS ; \ @WITH_EMMA_TRUE@ simpleReproducers=(`cat $(abs_top_builddir)/junit-jnlp-dist-$$which.txt `); \ @WITH_EMMA_TRUE@ IFS="$$IFS_BACKUP" ; \ @WITH_EMMA_TRUE@ for dir in "$${simpleReproducers[@]}" ; do \ @WITH_EMMA_TRUE@ testcases_srcs[k]="-sp" ; \ @WITH_EMMA_TRUE@ k=$$((k+1)) ; \ @WITH_EMMA_TRUE@ testcases_srcs[k]="$(REPRODUCERS_TESTS_SRCDIR)/$$which/$$dir/testcases/" ; \ @WITH_EMMA_TRUE@ k=$$((k+1)) ; \ @WITH_EMMA_TRUE@ done ; \ @WITH_EMMA_TRUE@ done ; \ @WITH_EMMA_TRUE@ $(BOOT_DIR)/bin/java $(EMMA_JAVA_ARGS) -cp $(EMMA_JAR) emma merge \ @WITH_EMMA_TRUE@ -in $(NETX_UNIT_TEST_DIR)/coverage.es \ @WITH_EMMA_TRUE@ -in $(TEST_EXTENSIONS_DIR)/coverage.es ; \ @WITH_EMMA_TRUE@ $(BOOT_DIR)/bin/java $(EMMA_JAVA_ARGS) -cp $(EMMA_JAR) -Demma.report.html.out.encoding=UTF-8 emma report \ @WITH_EMMA_TRUE@ -Dreport.html.out.encoding=UTF-8 \ @WITH_EMMA_TRUE@ -in $(TESTS_DIR)/coverage.es \ @WITH_EMMA_TRUE@ -in $(TESTS_DIR)/coverage.em \ @WITH_EMMA_TRUE@ -sp $(NETX_SRCDIR) \ @WITH_EMMA_TRUE@ -sp $(NETX_UNIT_TEST_SRCDIR) \ @WITH_EMMA_TRUE@ -sp $(JUNIT_RUNNER_SRCDIR) \ @WITH_EMMA_TRUE@ -sp $(TEST_EXTENSIONS_SRCDIR) \ @WITH_EMMA_TRUE@ -sp $(TEST_EXTENSIONS_TESTS_SRCDIR) \ @WITH_EMMA_TRUE@ "$${testcases_srcs[@]}" \ @WITH_EMMA_TRUE@ -r html \ @WITH_EMMA_TRUE@ -r xml ; @WITH_EMMA_FALSE@ echo "Sorry, coverage report cant be run without emma installed. Try install emma or specify with-emma value" ; @WITH_EMMA_FALSE@ exit 5 run-test-server-on-44321: stamps/netx.stamp stamps/junit-jnlp-dist-dirs stamps/netx-dist-tests-import-cert-to-public \ stamps/test-extensions-compile.stamp stamps/compile-reproducers-testcases.stamp $(JUNIT_RUNNER_JAR) stamps/copy-reproducers-resources.stamp cd $(TEST_EXTENSIONS_DIR) ; \ CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):.:$(TEST_EXTENSIONS_TESTS_DIR) ; \ $(BOOT_DIR)/bin/java $(REPRODUCERS_DPARAMETERS) \ -Xbootclasspath/a:$(RUNTIME):$$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=$(NETX_DIR)/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):.:$(TEST_EXTENSIONS_TESTS_DIR) ; \ $(BOOT_DIR)/bin/java $(REPRODUCERS_DPARAMETERS) \ -Xbootclasspath/a:$(RUNTIME):$$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 clean-test-code-coverage 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-$(SOFTKILLER): rm -f $(TESTS_DIR)/softkiller clean-netx-dist-tests: clean_tests_reports netx-dist-tests-remove-cert-from-public clean-custom-reproducers clean-$(SOFTKILLER) rm -f test-extensions-source-files.txt rm -f test-extensions-tests-source-files.txt rm -f $(TEST_EXTENSIONS_COMPATIBILITY_SYMLINK) 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: if [ -e stamps/run-unit-test-code-coverage.stamp ]; then \ rm -rf $(NETX_UNIT_TEST_DIR)/coverage ; \ rm -f $(NETX_UNIT_TEST_DIR)/coverage.xml ; \ rm -f $(NETX_UNIT_TEST_DIR)/coverageX.es ; \ rm -f $(NETX_UNIT_TEST_DIR)/coverageX.ec ; \ rm -f $(NETX_UNIT_TEST_DIR)/coverage.es ; \ rm -f $(NETX_UNIT_TEST_DIR)/tests-output_withEmma.xml ; \ rm -f stamps/run-unit-test-code-coverage.stamp ; \ fi clean-reproducers-test-code-coverage: if [ -e stamps/run-reproducers-test-code-coverage.stamp ]; then \ rm -rf $(TEST_EXTENSIONS_DIR)/coverage ; \ rm -f $(TEST_EXTENSIONS_DIR)/coverage.xml ; \ rm -f $(TEST_EXTENSIONS_DIR)/coverage.es ; \ rm -f $(TEST_EXTENSIONS_DIR)/tests-output_withEmma.xml ; \ rm -f stamps/run-reproducers-test-code-coverage.stamp ; \ fi clean-test-code-coverage: clean-unit-test-code-coverage clean-reproducers-test-code-coverage if [ -e $(TESTS_DIR)/coverage.xml ]; then \ rm -rf $(TESTS_DIR)/coverage ; \ rm -f $(TESTS_DIR)/coverage.xml ; \ rm -f $(TESTS_DIR)/coverage.es ; \ rm -f $(TESTS_DIR)/coverage.em ; \ fi clean-unit-test-code-coverage-jacoco: if [ -e stamps/run-unit-test-code-coverage-jacoco.stamp ]; then \ rm -rf $(NETX_UNIT_TEST_DIR)/coverage ; \ rm -f $(NETX_UNIT_TEST_DIR)/coverage.xml ; \ rm -f $(NETX_UNIT_TEST_DIR)/jacoco.exec ; \ rm -f $(NETX_UNIT_TEST_DIR)/tests-output_withEmma.xml ; \ rm -f stamps/run-unit-test-code-coverage-jacoco.stamp ; \ fi clean-reproducers-test-code-coverage-jacoco: if [ -e stamps/run-reproducers-test-code-coverage-jacoco.stamp ]; then \ rm -rf $(TEST_EXTENSIONS_DIR)/coverage-javaws ; \ rm -f $(TEST_EXTENSIONS_DIR)/coverage-javaws.xml ; \ rm -f $(TEST_EXTENSIONS_DIR)/jacoco_javaws.exec ; \ rm -rf $(TEST_EXTENSIONS_DIR)/coverage-plugin ; \ rm -f $(TEST_EXTENSIONS_DIR)/coverage-plugin.xml ; \ rm -f $(TEST_EXTENSIONS_DIR)/jacoco_plugin.exec ; \ rm -rf $(TEST_EXTENSIONS_DIR)/coverage ; \ rm -f $(TEST_EXTENSIONS_DIR)/coverage.xml ; \ rm -f $(TEST_EXTENSIONS_DIR)/jacoco-merged-reproducers.exec ; \ rm -f $(TEST_EXTENSIONS_DIR)/tests-output_withEmma.xml ; \ rm -f stamps/run-reproducers-test-code-coverage-jacoco.stamp ; \ fi clean-test-code-coverage-jacoco: clean-unit-test-code-coverage-jacoco clean-reproducers-test-code-coverage-jacoco clean-test-code-coverage-tools-jacoco if [ -e $(TESTS_DIR)/coverage.xml ]; then \ rm -rf $(TESTS_DIR)/coverage ; \ rm -f $(TESTS_DIR)/jacoco-merged.exec; \ fi clean-test-code-coverage-tools-jacoco: rm -rf $(JACOCO_OPERATOR_DIR) rm -rf $(COVERABLE_PLUGIN_DIR) rm -f stamps/compile-jacoco-operator.stamp; rm -f jacoco-operator-source-files.txt rm -f stamps/build-fake-plugin.stamp # plugin tests @ENABLE_PLUGIN_TRUE@stamps/plugin-tests.stamp: $(PLUGIN_TEST_SRCS) stamps/plugin.stamp @ENABLE_PLUGIN_TRUE@ mkdir -p plugin/tests/LiveConnect @ENABLE_PLUGIN_TRUE@ $(BOOT_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@ $(BOOT_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 # Bootstrap Directory Targets # =========================== stamps/native-ecj.stamp: mkdir -p stamps ; \ if test "x$(GCJ)" != "xno"; then \ $(GCJ) $(IT_CFLAGS) -Wl,-Bsymbolic -findirect-dispatch -o native-ecj \ --main=org.eclipse.jdt.internal.compiler.batch.Main ${ECJ_JAR} ; \ fi ; \ touch stamps/native-ecj.stamp clean-native-ecj: rm -f native-ecj rm -rf stamps/native-ecj.stamp # bootstrap stamps/bootstrap-directory.stamp: stamps/native-ecj.stamp mkdir -p $(BOOT_DIR)/bin stamps/ ln -sf $(JAVA) $(BOOT_DIR)/bin/java ln -sf $(JAR) $(BOOT_DIR)/bin/jar ln -sf $(abs_top_builddir)/javac $(BOOT_DIR)/bin/javac ln -sf $(JAVADOC) $(BOOT_DIR)/bin/javadoc if [ -e "$(KEYTOOL)" ] ; then \ ln -sf $(KEYTOOL) $(BOOT_DIR)/bin/keytool ;\ else \ echo "#! /bin/sh" > $(BOOT_DIR)/bin/keytool ;\ echo "echo \"keytool not exist on your system, signed part of reproducers test will fail\"" >> $(BOOT_DIR)/bin/keytool ;\ chmod 777 $(BOOT_DIR)/bin/keytool ;\ fi if [ -e "$(JARSIGNER)" ] ; then \ ln -sf $(JARSIGNER) $(BOOT_DIR)/bin/jarsigner ;\ else \ echo "#! /bin/sh" > $(BOOT_DIR)/bin/jarsigner ;\ echo "echo \"jarsigner not exist on your system, signed part of reproducers test will fail\"" >> $(BOOT_DIR)/bin/jarsigner ;\ chmod 777 $(BOOT_DIR)/bin/jarsigner ;\ fi mkdir -p $(BOOT_DIR)/jre/lib && \ ln -s $(SYSTEM_JRE_DIR)/lib/rt.jar $(BOOT_DIR)/jre/lib && \ if [ -e $(SYSTEM_JRE_DIR)/lib/jsse.jar ] ; then \ ln -s $(SYSTEM_JRE_DIR)/lib/jsse.jar $(BOOT_DIR)/jre/lib ; \ else \ ln -s rt.jar $(BOOT_DIR)/jre/lib/jsse.jar ; \ fi if [ -e $(SYSTEM_JRE_DIR)/lib/resources.jar ] ; then \ ln -s $(SYSTEM_JRE_DIR)/lib/resources.jar $(BOOT_DIR)/jre/lib ; \ else \ ln -s rt.jar $(BOOT_DIR)/jre/lib/resources.jar ; \ fi ln -sf $(SYSTEM_JRE_DIR)/lib/$(JRE_ARCH_DIR) \ $(BOOT_DIR)/jre/lib/ && \ if ! test -d $(BOOT_DIR)/jre/lib/$(INSTALL_ARCH_DIR); \ then \ ln -sf ./$(JRE_ARCH_DIR) \ $(BOOT_DIR)/jre/lib/$(INSTALL_ARCH_DIR); \ fi; mkdir -p $(BOOT_DIR)/include && \ for i in $(SYSTEM_JDK_DIR)/include/*; do \ test -r $$i | continue; \ i=`basename $$i`; \ rm -f $(BOOT_DIR)/include/$$i; \ ln -s $(SYSTEM_JDK_DIR)/include/$$i $(BOOT_DIR)/include/$$i; \ done mkdir -p stamps touch stamps/bootstrap-directory.stamp clean-bootstrap-directory: rm -rf $(BOOT_DIR) if [ -e ${abs_top_builddir}/bootstrap ] ; then \ rmdir ${abs_top_builddir}/bootstrap ; \ fi rm -f stamps/bootstrap-directory.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: stamps/run-unit-test-code-coverage.stamp run-reproducers-test-code-coverage: stamps/run-reproducers-test-code-coverage.stamp run-unit-test-code-coverage-jacoco: stamps/run-unit-test-code-coverage-jacoco.stamp run-reproducers-test-code-coverage-jacoco: stamps/run-reproducers-test-code-coverage-jacoco.stamp # 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.5.3/PaxHeaders.24993/aclocal.m40000644000000000000000000000013212574544510015307 xustar0030 mtime=1441974600.027217795 30 atime=1441974601.586235741 30 ctime=1441974670.050023839 icedtea-web-1.5.3/aclocal.m40000664000076400007640000014146012574544510016376 0ustar00jvanekjvanek00000000000000# 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])]) # 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.5.3/PaxHeaders.24993/configure.ac0000644000000000000000000000013212574544466015747 xustar0030 mtime=1441974582.519016255 30 atime=1441974656.354866192 30 ctime=1441974670.049023827 icedtea-web-1.5.3/configure.ac0000664000076400007640000001146312574544466017035 0ustar00jvanekjvanek00000000000000AC_INIT([icedtea-web],[1.5.3],[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]) # 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_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_FIND_JAVADOC IT_FIND_KEYTOOL IT_FIND_JARSIGNER AC_CONFIG_FILES([javac], [chmod +x javac]) 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 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_CLASS(SUN_MISC_HEXDUMPENCODER, [sun.misc.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([emma], EMMA, [/usr/share/java/emma.jar]) IT_FIND_OPTIONAL_JAR([jacoco], JACOCO, [/usr/share/java/jacoco/org.jacoco.core.jar]) IT_FIND_OPTIONAL_JAR([asm], ASM, [/usr/share/java/objectweb-asm4/asm-all.jar /usr/share/java/objectweb-asm4/asm-all-4.0.jar /usr/share/java/objectweb-asm/asm-all.jar]) IT_CHECK_FOR_TAGSOUP AC_CONFIG_FILES([jrunscript], [chmod u+x jrunscript]) AC_CONFIG_FILES([build.properties]) AC_OUTPUT icedtea-web-1.5.3/PaxHeaders.24993/acinclude.m40000644000000000000000000000013112574544466015651 xustar0030 mtime=1441974582.517016232 29 atime=1441974656.35386618 30 ctime=1441974670.047023805 icedtea-web-1.5.3/acinclude.m40000664000076400007640000006137412574544466016746 0ustar00jvanekjvanek00000000000000AC_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 /usr/lib/jvm/java-openjdk /usr/lib/jvm/icedtea6 \ /usr/lib/jvm/java-6-openjdk /usr/lib/jvm/openjdk \ /usr/lib/jvm/java-icedtea /usr/lib/jvm/java-gcj /usr/lib/jvm/gcj-jdk \ /usr/lib/jvm/cacao ; do if test -d $dir; then SYSTEM_JDK_DIR=$dir break fi done fi AC_MSG_RESULT(${SYSTEM_JDK_DIR}) if ! test -d "${SYSTEM_JDK_DIR}"; then AC_MSG_ERROR("A JDK home directory could not be found.") 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 if test -d "${SYSTEM_JDK_DIR}/jre" ; then SYSTEM_JRE_DIR="${SYSTEM_JDK_DIR}/jre" fi fi AC_MSG_RESULT(${SYSTEM_JRE_DIR}) if ! test -d "${SYSTEM_JRE_DIR}"; then AC_MSG_ERROR("A JRE home directory could not be found.") 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}) 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 ]) 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 1.5 java 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_PATH_PROG(JAVA, "gij") fi if test -z "${JAVA}"; then AC_MSG_ERROR("A 1.5-compatible Java VM is required.") fi AC_MSG_RESULT(${JAVA}) AC_SUBST(JAVA) JAVA_VERSION=`$JAVA -version 2>&1 | sed -n '1s/@<:@^"@:>@*"\(.*\)"$/\1/p'` HAVE_JAVA7=`echo $JAVA_VERSION | awk '{if ($(0) >= 1.7) print "yes"}'` if ! test -z "$HAVE_JAVA7" ; then VERSION_DEFS='-DHAVE_JAVA7' fi AM_CONDITIONAL([HAVE_JAVA7], test x"${HAVE_JAVA7}" = "xyes" ) AC_SUBST(VERSION_DEFS) ]) 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_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.5.3/PaxHeaders.24993/configure0000644000000000000000000000013112574544510015352 xustar0029 mtime=1441974600.83122705 30 atime=1441974667.031989098 30 ctime=1441974670.045023782 icedtea-web-1.5.3/configure0000775000076400007640000121236312574544510016447 0ustar00jvanekjvanek00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for icedtea-web 1.5.3. # # 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.5.3' PACKAGE_STRING='icedtea-web 1.5.3' 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 EMMA_AVAILABLE EMMA_JAR WITH_EMMA_FALSE WITH_EMMA_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 VERSION_DEFS HAVE_JAVA7_FALSE HAVE_JAVA7_TRUE JAVA SYSTEM_JRE_DIR 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 JARSIGNER KEYTOOL JAVADOC_SUPPORTS_J_OPTIONS_FALSE JAVADOC_SUPPORTS_J_OPTIONS_TRUE JAVADOC_KNOWS_J_OPTIONS JAVADOC 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_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 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_dependency_tracking enable_docs with_gcj with_jdk_home with_javac with_ecj with_jar with_ecj_jar with_javadoc with_keytool with_jarsigner with_pkgversion enable_plugin with_jre_home with_java with_firefox with_chrome with_chromium with_opera with_midori with_epiphany with_browser_tests with_rhino with_junit with_emma 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.5.3 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.5.3:";; 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") --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --disable-docs Disable generation of documentation --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-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-pkgversion=PKG Use PKG in the version string in addition to "IcedTea" --with-jre-home jre home directory (default is the JRE under the JDK) --with-java specify location of the 1.5 java vm --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-emma specify location of the emma 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.5.3 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.5.3, 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.5.3' 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" # 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; } # 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 /usr/lib/jvm/java-openjdk /usr/lib/jvm/icedtea6 \ /usr/lib/jvm/java-6-openjdk /usr/lib/jvm/openjdk \ /usr/lib/jvm/java-icedtea /usr/lib/jvm/java-gcj /usr/lib/jvm/gcj-jdk \ /usr/lib/jvm/cacao ; do if test -d $dir; then SYSTEM_JDK_DIR=$dir break fi done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${SYSTEM_JDK_DIR}" >&5 $as_echo "${SYSTEM_JDK_DIR}" >&6; } if ! test -d "${SYSTEM_JDK_DIR}"; then as_fn_error $? "\"A JDK home directory could not be found.\"" "$LINENO" 5 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 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 6136 "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; } ac_config_files="$ac_config_files javac" 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 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 if test -d "${SYSTEM_JDK_DIR}/jre" ; then SYSTEM_JRE_DIR="${SYSTEM_JDK_DIR}/jre" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${SYSTEM_JRE_DIR}" >&5 $as_echo "${SYSTEM_JRE_DIR}" >&6; } if ! test -d "${SYSTEM_JRE_DIR}"; then as_fn_error $? "\"A JRE home directory could not be found.\"" "$LINENO" 5 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 # Extract the first word of ""gij"", so it can be a program name with args. set dummy "gij"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_JAVA+:} false; then : $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.5-compatible Java VM is required.\"" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${JAVA}" >&5 $as_echo "${JAVA}" >&6; } JAVA_VERSION=`$JAVA -version 2>&1 | sed -n '1s/[^"]*"\(.*\)"$/\1/p'` HAVE_JAVA7=`echo $JAVA_VERSION | awk '{if ($(0) >= 1.7) print "yes"}'` if ! test -z "$HAVE_JAVA7" ; then VERSION_DEFS='-DHAVE_JAVA7' fi if test x"${HAVE_JAVA7}" = "xyes" ; then HAVE_JAVA7_TRUE= HAVE_JAVA7_FALSE='#' else HAVE_JAVA7_TRUE='#' HAVE_JAVA7_FALSE= 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 7358 "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 7408 "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 7458 "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 7508 "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 7558 "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 7608 "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 7658 "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 7708 "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 sun.misc.HexDumpEncoder is available" >&5 $as_echo_n "checking if sun.misc.HexDumpEncoder is available... " >&6; } if ${it_cv_SUN_MISC_HEXDUMPENCODER+:} false; then : $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 7758 "configure" */ package sun.applet; import sun.misc.HexDumpEncoder; public class Test { public static void main(String[] args) throws Exception { System.out.println(Class.forName("sun.misc.HexDumpEncoder")); } } EOF if $JAVAC -cp . $JAVACFLAGS -nowarn $CLASS >&5 2>&1; then if $JAVA -classpath . $BYTECODE >&5 2>&1; then it_cv_SUN_MISC_HEXDUMPENCODER=yes; else it_cv_SUN_MISC_HEXDUMPENCODER=no; fi else it_cv_SUN_MISC_HEXDUMPENCODER=no; fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $it_cv_SUN_MISC_HEXDUMPENCODER" >&5 $as_echo "$it_cv_SUN_MISC_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_SUN_MISC_HEXDUMPENCODER}" = "xno"; then as_fn_error $? "sun.misc.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 7808 "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 7858 "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 7908 "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 7958 "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 8008 "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 8058 "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 8108 "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 8158 "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 emma jar" >&5 $as_echo_n "checking for emma jar... " >&6; } # Check whether --with-emma was given. if test "${with_emma+set}" = set; then : withval=$with_emma; case "${withval}" in yes) EMMA_JAR=yes ;; no) EMMA_JAR=no ;; *) if test -f "${withval}"; then EMMA_JAR="${withval}" elif test -z "${withval}"; then EMMA_JAR=yes else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } as_fn_error $? "\"The emma jar ${withval} was not found.\"" "$LINENO" 5 fi ;; esac else EMMA_JAR=yes fi it_extra_paths_emma="/usr/share/java/emma.jar" if test "x${EMMA_JAR}" = "xyes"; then for path in ${it_extra_paths_emma}; do if test -f ${path}; then EMMA_JAR=${path} break fi done fi if test x"${EMMA_JAR}" = "xyes"; then if test -f "/usr/share/java/emma.jar"; then EMMA_JAR=/usr/share/java/emma.jar fi fi if test x"${EMMA_JAR}" = "xyes"; then EMMA_JAR=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${EMMA_JAR}" >&5 $as_echo "${EMMA_JAR}" >&6; } if test x"${EMMA_JAR}" != "xno"; then WITH_EMMA_TRUE= WITH_EMMA_FALSE='#' else WITH_EMMA_TRUE='#' WITH_EMMA_FALSE= fi # Clear EMMA_JAR if it doesn't contain a valid filename if test x"${EMMA_JAR}" = "xno"; then EMMA_JAR= fi if test -n "${EMMA_JAR}" ; then EMMA_AVAILABLE=true else EMMA_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 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 "${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 "${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 "${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 "${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_EMMA_TRUE}" && test -z "${WITH_EMMA_FALSE}"; then as_fn_error $? "conditional \"WITH_EMMA\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_JACOCO_TRUE}" && test -z "${WITH_JACOCO_FALSE}"; then as_fn_error $? "conditional \"WITH_JACOCO\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_ASM_TRUE}" && test -z "${WITH_ASM_FALSE}"; then as_fn_error $? "conditional \"WITH_ASM\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi 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.5.3, 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.5.3 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" ;; "javac") CONFIG_FILES="$CONFIG_FILES javac" ;; "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 } ;; "javac":F) chmod +x javac ;; "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.5.3/PaxHeaders.24993/Makefile.am0000644000000000000000000000013112574544466015514 xustar0030 mtime=1441974582.514016198 29 atime=1441974656.35386618 30 ctime=1441974670.043023758 icedtea-web-1.5.3/Makefile.am0000664000076400007640000021422312574544466016602 0ustar00jvanekjvanek00000000000000# Source directories export TOP_BUILD_DIR = $(abs_top_builddir) export NETX_DIR = $(abs_top_builddir)/netx.build export NETX_SRCDIR = $(abs_top_srcdir)/netx export NETX_RESOURCE_DIR=$(NETX_SRCDIR)/net/sourceforge/jnlp/resources 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 SOFTKILLER=softkiller 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 EMMA_JAVA_ARGS=-Xmx2G export EMMA_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 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=$(BOOT_DIR)/bin/java $(EMMA_JAVA_ARGS) -cp $(JACOCO_OPERATOR_DIR):$(JACOCO_CLASSPATH):. org.jacoco.operator.Main # linking variables export PLUGIN_LINK_NAME=libjavaplugin.so export MOZILLA_LOCAL_PLUGINDIR=${HOME}/.mozilla/plugins 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 export BOOT_DIR = $(abs_top_builddir)/bootstrap/jdk1.6.0 if WITH_RHINO RHINO_RUNTIME=:$(RHINO_JAR) else RHINO_RUNTIME= endif export RUNTIME = $(BOOT_DIR)/jre/lib/rt.jar:$(BOOT_DIR)/jre/lib/jsse.jar$(RHINO_RUNTIME):$(BOOT_DIR)/jre/lib/resources.jar # Flags export IT_CFLAGS=$(CFLAGS) $(ARCHFLAG) export IT_JAVAC_SETTINGS=-g -encoding utf-8 $(JAVACFLAGS) $(MEMORY_LIMIT) $(PREFER_SOURCE) export IT_LANGUAGE_SOURCE_VERSION=6 export IT_CLASS_TARGET_VERSION=6 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 LAUNCHER_BOOTCLASSPATH="-Xbootclasspath/a:$(datadir)/$(PACKAGE_NAME)/netx.jar$(RHINO_RUNTIME):$(TAGSOUP_JAR)" export PLUGIN_BOOTCLASSPATH='"-Xbootclasspath/a:$(datadir)/$(PACKAGE_NAME)/netx.jar:$(datadir)/$(PACKAGE_NAME)/plugin.jar$(RHINO_RUNTIME):$(TAGSOUP_JAR)"' export PLUGIN_COVERAGE_BOOTCLASSPATH='"-Xbootclasspath/a:$(datadir)/$(PACKAGE_NAME)/netx.jar:$(datadir)/$(PACKAGE_NAME)/plugin.jar$(RHINO_RUNTIME):$(JACOCO_CLASSPATH):$(TAGSOUP_JAR)"' # 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 NETX_EXCLUDE_SRCS= # Conditional defintions if HAVE_TAGSOUP NETX_CLASSPATH_ARG=-classpath $(TAGSOUP_JAR) else NETX_EXCLUDE_SRCS+=net.sourceforge.jnlp.MalformedXMLParser.java endif 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 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 \ itweb-settings.desktop.in launcher $(top_srcdir)/tests html-gen.sh netx-dist-tests-whitelist NEW_LINE_IFS # 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=$(BOOT_DIR)/bin/javac #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-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-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 install-exec-local: ${mkinstalldirs} $(DESTDIR)$(bindir) $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/ $(DESTDIR)$(libdir) 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_PROGRAM} launcher.build/$(javaws) $(DESTDIR)$(bindir) ${INSTALL_PROGRAM} launcher.build/$(itweb_settings) $(DESTDIR)$(bindir) ${INSTALL_PROGRAM} launcher.build/$(policyeditor) $(DESTDIR)$(bindir) install-data-local: ${mkinstalldirs} -d $(DESTDIR)$(mandir)/man1 ${INSTALL_DATA} $(NETX_SRCDIR)/javaws.1 $(DESTDIR)$(mandir)/man1 ${INSTALL_DATA} $(NETX_SRCDIR)/itweb-settings.1 $(DESTDIR)$(mandir)/man1 ${INSTALL_DATA} $(NETX_SRCDIR)/policyeditor.1 $(DESTDIR)$(mandir)/man1 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 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 -f $(DESTDIR)$(mandir)/man1/javaws.1 rm -f $(DESTDIR)$(mandir)/man1/itweb-settings.1 rm -f $(DESTDIR)$(mandir)/man1/policyeditor.1 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\"" \ -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\"" \ -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 && \ $(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) \ -d $(abs_top_builddir)/liveconnect \ -bootclasspath $(NETX_DIR):$(RUNTIME) \ $(NETX_CLASSPATH_ARG) \ -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 ; \ $(BOOT_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 !HAVE_JAVA7 sed -i '/VariableX509TrustManagerJDK7/ d' $@ endif stamps/netx-html-gen.stamp: (cd $$NETX_SRCDIR/..; \ mkdir -p html-gen; \ cp AUTHORS NEWS COPYING ChangeLog html-gen/; \ export HTML_GEN_DEBUG=true; \ bash html-gen.sh 20; \ 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/bootstrap-directory.stamp stamps/netx-html-gen.stamp mkdir -p $(NETX_DIR) $(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) \ -d $(NETX_DIR) \ -sourcepath $(NETX_SRCDIR) \ -bootclasspath $(RUNTIME) \ $(NETX_CLASSPATH_ARG) \ @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 (cd $(NETX_DIR) ; \ mkdir -p lib ; \ $(BOOT_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: stamps/bootstrap-directory.stamp if ENABLE_DOCS $(BOOT_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
    ' \ -classpath $(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: stamps/bootstrap-directory.stamp if ENABLE_DOCS if ENABLE_PLUGIN $(BOOT_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
    ' \ -classpath $(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 # 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: stamps/bootstrap-directory.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) && \ $(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) \ -d $(JUNIT_RUNNER_DIR) \ -classpath $(JUNIT_JAR):$(TEST_EXTENSIONS_DIR) \ @junit-runner-source-files.txt && \ $(BOOT_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)/ ; \ find . -maxdepth 1 -mindepth 1 | sed "s/.\/*//" > $(abs_top_builddir)/$@ junit-jnlp-dist-simple.txt: cd $(REPRODUCERS_TESTS_SRCDIR)/simple/ ; \ find . -maxdepth 1 -mindepth 1 | sed "s/.\/*//" > $(abs_top_builddir)/$@ stamps/junit-jnlp-dist-signed.stamp: types=($(SIGNED_REPRODUCERS)) ; \ for which in "$${types[@]}" ; do \ pushd $(REPRODUCERS_TESTS_SRCDIR)/$$which/ ; \ find . -maxdepth 1 -mindepth 1 | sed "s/.\/*//" > $(abs_top_builddir)/junit-jnlp-dist-$$which.txt ; \ 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/.\/*//"` ; \ $(BOOT_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 \ $(BOOT_DIR)/bin/jar cfm "$(REPRODUCERS_TESTS_SERVER_DEPLOYDIR)/$$dir.jar" $(META_MANIFEST) * ; \ else \ $(BOOT_DIR)/bin/jar cf "$(REPRODUCERS_TESTS_SERVER_DEPLOYDIR)/$$dir.jar" * ; \ 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 ; \ $(BOOT_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 \ $(BOOT_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 \ $(BOOT_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 \ $(BOOT_DIR)/bin/keytool -export -alias $(TEST_CERT_ALIAS)_$$which -file $(EXPORTED_TEST_CERT_PREFIX)_$$which.$(EXPORTED_TEST_CERT_SUFFIX) -storepass $(PRIVATE_KEYSTORE_PASS) -keystore $(PRIVATE_KEYSTORE_NAME) ; \ done ; mkdir -p stamps && \ touch $@ 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 | $(BOOT_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 \ $(BOOT_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); $(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) \ -d $(TEST_EXTENSIONS_DIR) \ -classpath $(JUNIT_JAR):$(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: find $(TEST_EXTENSIONS_TESTS_SRCDIR) -name '*.java' | sort > $@ 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); $(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) \ -d $(TEST_EXTENSIONS_TESTS_DIR) \ -classpath $(JUNIT_JAR):$(NETX_DIR)/lib/classes.jar:$(TEST_EXTENSIONS_DIR) \ @test-extensions-tests-source-files.txt && \ 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 \ $(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) \ -d $(TEST_EXTENSIONS_TESTS_DIR) \ -classpath $(JUNIT_JAR):$(NETX_DIR)/lib/classes.jar:$(TEST_EXTENSIONS_DIR) \ "$(REPRODUCERS_TESTS_SRCDIR)/$$which/$$dir/testcases/"*.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): $(REPRODUCERS_CLASS_WHITELIST) whiteListed=`cat $(REPRODUCERS_CLASS_WHITELIST)`; \ 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' ` ; \ INLCUDE="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"; \ INLCUDE="YES" ; \ fi; \ done; \ if [ "$$INLCUDE" = "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) $(TESTS_DIR)/$(SOFTKILLER): cd $(TESTS_SRCDIR)/$(SOFTKILLER); \ $(MAKE) ; \ mv $(SOFTKILLER) $(TESTS_DIR)/ 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 $(TESTS_DIR)/softkiller \ stamps/test-extensions-compile.stamp stamps/compile-reproducers-testcases.stamp $(JUNIT_RUNNER_JAR) stamps/copy-reproducers-resources.stamp\ $(TESTS_DIR)/$(REPORT_STYLES_DIRNAME) $(REPRODUCERS_CLASS_NAMES) stamps/process-custom-reproducers.stamp cd $(TEST_EXTENSIONS_DIR) ; \ class_names=`cat $(REPRODUCERS_CLASS_NAMES)` ; \ CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):.:$(TEST_EXTENSIONS_TESTS_DIR):$(TEST_EXTENSIONS_SRCDIR) ; \ $(BOOT_DIR)/bin/java $(REPRODUCERS_DPARAMETERS) \ -Xbootclasspath/a:$(RUNTIME):$$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) && \ $(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) \ -d $(NETX_UNIT_TEST_DIR) \ -classpath $(JUNIT_JAR):$(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=$(NETX_DIR)/lib/classes.jar:$(abs_top_builddir)/liveconnect/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):$(TEST_EXTENSIONS_DIR):.:$(TEST_EXTENSIONS_SRCDIR):$(TAGSOUP_JAR) ; \ $(BOOT_DIR)/bin/java -Xbootclasspath/a:$(RUNTIME):$$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 $@ #warning, during this target tests.build/netx/unit/tests-output.xml is backup and rewriten (but not coresponding html file) #xml results run from emma sandbox, however, can be wrong, co the new tests-output.xml is then renamed and orginal one restored #you can add -ix "-*Test*" -ix "-*test*" to ignore all test cases from statistics stamps/run-unit-test-code-coverage.stamp: stamps/netx-unit-tests-compile.stamp $(JUNIT_RUNNER_JAR) \ $(TESTS_DIR)/$(REPORT_STYLES_DIRNAME) $(UNIT_CLASS_NAMES) if WITH_EMMA cd $(NETX_UNIT_TEST_DIR) ; \ for file in $(EMMA_MODIFIED_FILES) ; do \ mv $(NETX_UNIT_TEST_DIR)/$$file $(NETX_UNIT_TEST_DIR)/"$$file""$(EMMA_BACKUP_SUFFIX)" ; \ done ;\ class_names=`cat $(UNIT_CLASS_NAMES)` ; \ CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(abs_top_builddir)/liveconnect/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):$(TEST_EXTENSIONS_DIR):.:$(TEST_EXTENSIONS_SRCDIR) ; \ $(BOOT_DIR)/bin/java $(EMMA_JAVA_ARGS) -Xbootclasspath/a:$(RUNTIME):$$CLASSPATH -cp $(EMMA_JAR) -Demma.report.html.out.encoding=UTF-8 emmarun \ -Dreport.html.out.encoding=UTF-8 \ -raw \ -sp $(NETX_SRCDIR) \ -sp $(NETX_UNIT_TEST_SRCDIR) \ -sp $(JUNIT_RUNNER_SRCDIR) \ -r html \ -r xml \ -cp $(NETX_DIR)/lib/classes.jar \ -cp $(JUNIT_JAR) \ -cp $(JUNIT_RUNNER_JAR) \ -cp $(BOOT_DIR)/jre/lib/rt.jar \ -cp $(BOOT_DIR)/jre/lib/jsse.jar \ -cp $(BOOT_DIR)/jre/lib/resources.jar \ -cp $(RHINO_RUNTIME) \ -cp $(TEST_EXTENSIONS_DIR) \ -cp $(TEST_EXTENSIONS_SRCDIR) \ if HAVE_TAGSOUP -cp $(TAGSOUP_JAR) \ endif -cp . \ -ix "-org.junit.*" \ -ix "-junit.*" \ CommandLine $$class_names ; \ for file in $(EMMA_MODIFIED_FILES) ; do \ mv $(NETX_UNIT_TEST_DIR)/$$file $(NETX_UNIT_TEST_DIR)/"$$file""$(EMMA_SUFFIX)" ; \ mv $(NETX_UNIT_TEST_DIR)/"$$file""$(EMMA_BACKUP_SUFFIX)" $(NETX_UNIT_TEST_DIR)/$$file ; \ done ; else echo "Sorry, coverage report cant be run without emma installed. Try install emma or specify with-emma value" ; exit 5 endif touch $@ stamps/compile-jacoco-operator.stamp: jacoco-operator-source-files.txt if WITH_JACOCO mkdir -p $(JACOCO_OPERATOR_DIR) && \ $(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) \ -d $(JACOCO_OPERATOR_DIR) \ -classpath $(JACOCO_CLASSPATH) \ @jacoco-operator-source-files.txt ; else echo "Sorry, jacoco coverage report generator cant be compiled without jacoco installed. Try installing jacoco or specify with-jacoco value" ; exit 5 endif touch $@ #warning, during this target tests.build/netx/unit/tests-output.xml is backup and rewriten (but not coresponding html file) #xml results run with jacoco agent however, can be wrong, co the new tests-output.xml is then renamed and orginal one restored stamps/run-unit-test-code-coverage-jacoco.stamp: stamps/netx-unit-tests-compile.stamp $(JUNIT_RUNNER_JAR) \ $(TESTS_DIR)/$(REPORT_STYLES_DIRNAME) $(UNIT_CLASS_NAMES) stamps/compile-jacoco-operator.stamp if WITH_JACOCO filename=" " ; \ cd $(NETX_UNIT_TEST_SRCDIR) ; \ for file in `find . -type f \! -iname "*.java"`; do\ filename=`echo $$file `; \ cp --parents $$filename $(NETX_UNIT_TEST_DIR) ; \ done ; \ cd $(NETX_UNIT_TEST_DIR) ; \ for file in $(EMMA_MODIFIED_FILES) ; do \ mv $(NETX_UNIT_TEST_DIR)/$$file $(NETX_UNIT_TEST_DIR)/"$$file""$(EMMA_BACKUP_SUFFIX)" ; \ done ;\ class_names=`cat $(UNIT_CLASS_NAMES)` ; \ CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(abs_top_builddir)/liveconnect/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):$(TEST_EXTENSIONS_DIR):$(JACOCO_CLASSPATH):.:$(TEST_EXTENSIONS_SRCDIR):$(TAGSOUP_JAR) ; \ $(BOOT_DIR)/bin/java $(JACOCO_AGENT_SWITCH) -Xbootclasspath/a:$(RUNTIME):$$CLASSPATH CommandLine $$class_names ; \ for file in $(EMMA_MODIFIED_FILES) ; do \ mv $(NETX_UNIT_TEST_DIR)/$$file $(NETX_UNIT_TEST_DIR)/"$$file""$(EMMA_SUFFIX)" ; \ mv $(NETX_UNIT_TEST_DIR)/"$$file""$(EMMA_BACKUP_SUFFIX)" $(NETX_UNIT_TEST_DIR)/$$file ; \ done ; \ $(JACOCO_OPERATOR_EXEC) \ report --die-soon --html-output coverage --xml-output coverage.xml --input-file jacoco.exec \ --input-srcs $(NETX_SRCDIR) $(PLUGIN_SRCDIR)/java $(NETX_UNIT_TEST_SRCDIR) $(JUNIT_RUNNER_SRCDIR) $(TEST_EXTENSIONS_SRCDIR) \ --input-builds $(NETX_DIR)/lib/classes.jar $(abs_top_builddir)/liveconnect/lib/classes.jar $(NETX_UNIT_TEST_DIR) $(JUNIT_RUNNER_JAR) $(TEST_EXTENSIONS_DIR) \ --title "IcedTea-Web unit-tests codecoverage" ; else echo "Sorry, coverage report cant be run without jacoco installed. Try installing jacoco or specify with-jacoco value" ; exit 5 endif touch $@ #warning, during this target tests.build/netx/jnlp_testsengine/tests-output.xml is backup and rewriten (but not coresponding html file) #xml results run from emma sandbox, however, can be wrong, co the new tests-output.xml is then renamed and orginal one restored stamps/run-reproducers-test-code-coverage.stamp: stamps/run-netx-dist-tests.stamp $(REPRODUCERS_CLASS_NAMES) if WITH_EMMA cd $(TESTS_DIR) ; \ for file in $(EMMA_MODIFIED_FILES) ; do \ mv $(TEST_EXTENSIONS_DIR)/$$file $(TEST_EXTENSIONS_DIR)/"$$file""$(EMMA_BACKUP_SUFFIX)" ; \ done ;\ echo "backuping javaws and netx.jar in $(DESTDIR)" ; \ netx_backup=$(DESTDIR)$(datadir)/$(PACKAGE_NAME)/netx_backup.jar ; \ javaws_backup=$(DESTDIR)$(bindir)/javaws_backup ; \ mv $(DESTDIR)$(bindir)/javaws $$javaws_backup ; \ mv $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/netx.jar $$netx_backup ; \ nw_bootclasspath="$(LAUNCHER_BOOTCLASSPATH):$(EMMA_JAR):$$netx_backup" ; \ instructed_dir=$(TESTS_DIR)/instr ; \ echo "instrumenting netx.jar from $$netx_backup through $$instructed_dir" ; \ $(BOOT_DIR)/bin/java -cp $(EMMA_JAR) emma instr -d $$instructed_dir -ip $$netx_backup ; \ pushd $$instructed_dir ; \ $(BOOT_DIR)/bin/jar -cf $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/netx.jar * ; \ popd ; \ rm -rf $$instructed_dir ; \ echo "patching $(javaws)" ; \ cat $$javaws_backup | sed "s,$(LAUNCHER_BOOTCLASSPATH),$$nw_bootclasspath," > $(DESTDIR)$(bindir)/$(javaws) ; \ chmod 777 $(DESTDIR)$(bindir)/$(javaws) ; \ 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]="-sp" ; \ k=$$((k+1)) ; \ testcases_srcs[k]="$(REPRODUCERS_TESTS_SRCDIR)/$$which/$$dir/testcases/" ; \ k=$$((k+1)) ; \ done ; \ done ; \ cd $(TEST_EXTENSIONS_DIR) ; \ class_names=`cat $(REPRODUCERS_CLASS_NAMES)` ; \ CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(abs_top_builddir)/liveconnect/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):$(TEST_EXTENSIONS_DIR):.:$(TEST_EXTENSIONS_SRCDIR) ; \ $(BOOT_DIR)/bin/java \ $(EMMA_JAVA_ARGS) \ $(REPRODUCERS_DPARAMETERS) \ -Xbootclasspath/a:$(RUNTIME):$$CLASSPATH -cp $(EMMA_JAR) emmarun \ -raw \ -cp $(NETX_DIR)/lib/classes.jar \ -cp $(JUNIT_JAR) \ -cp $(JUNIT_RUNNER_JAR) \ -cp $(BOOT_DIR)/jre/lib/rt.jar \ -cp $(BOOT_DIR)/jre/lib/jsse.jar \ -cp $(BOOT_DIR)/jre/lib/resources.jar \ -cp $(RHINO_RUNTIME) \ -cp . \ -cp $(TEST_EXTENSIONS_SRCDIR) \ -cp $(TEST_EXTENSIONS_TESTS_DIR) \ -ix "-org.junit.*" \ -ix "-junit.*" \ CommandLine $$class_names ; \ mv $(TEST_EXTENSIONS_DIR)/coverage.ec $(TEST_EXTENSIONS_DIR)/coverageX.ec ; \ mv $(TEST_EXTENSIONS_DIR)/coverage.es $(TEST_EXTENSIONS_DIR)/coverageX.es ; \ $(BOOT_DIR)/bin/java $(EMMA_JAVA_ARGS) -cp $(EMMA_JAR) emma merge \ -in $(TESTS_DIR)/coverage.em \ -in $(TEST_EXTENSIONS_DIR)/coverageX.ec \ -in $(TEST_EXTENSIONS_DIR)/coverageX.es ; \ $(BOOT_DIR)/bin/java $(EMMA_JAVA_ARGS) -cp $(EMMA_JAR) -Demma.report.html.out.encoding=UTF-8 emma report \ -Dreport.html.out.encoding=UTF-8 \ -in $(TEST_EXTENSIONS_DIR)/coverage.es \ -sp $(NETX_SRCDIR) \ -sp $(NETX_UNIT_TEST_SRCDIR) \ -sp $(JUNIT_RUNNER_SRCDIR) \ -sp $(TEST_EXTENSIONS_SRCDIR) \ -sp $(TEST_EXTENSIONS_TESTS_SRCDIR) \ -r html \ -r xml \ "$${testcases_srcs[@]}" ; \ echo "restoring javaws and netx.jar in $(DESTDIR)" ; \ rm -f $(DESTDIR)$(bindir)/$(javaws) $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/netx.jar ; \ rm -f $(DESTDIR)$(bindir)/$(javaws); \ mv $$javaws_backup $(DESTDIR)$(bindir)/$(javaws); \ mv $$netx_backup $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/netx.jar ; \ for file in $(EMMA_MODIFIED_FILES) ; do \ mv $(TEST_EXTENSIONS_DIR)/$$file $(TEST_EXTENSIONS_DIR)/"$$file""$(EMMA_SUFFIX)" ; \ mv $(TEST_EXTENSIONS_DIR)/"$$file""$(EMMA_BACKUP_SUFFIX)" $(TEST_EXTENSIONS_DIR)/$$file ; \ done ;\ rm $(TEST_EXTENSIONS_DIR)/coverage.txt ; else echo "Sorry, coverage report cant be run without emma installed. Try install emma or specify with-emma 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\"" \ -DPLUGIN_VERSION="\"$(PLUGIN_VERSION)\"" \ -DPACKAGE_URL="\"$(PACKAGE_URL)\"" \ -DMOZILLA_VERSION_COLLAPSED="$(MOZILLA_VERSION_COLLAPSED)" \ -DICEDTEA_WEB_JRE="\"$(SYSTEM_JRE_DIR)\"" \ -DPLUGIN_BOOTCLASSPATH=$(PLUGIN_COVERAGE_BOOTCLASSPATH) \ -DCOVERAGE_AGENT=$(JACOCO_AGENT_PLUGIN_SWITCH) \ $(GLIB_CFLAGS) \ $(MOZILLA_CFLAGS) \ -fvisibility=hidden \ -fPIC -o $@ -c $< $(COVERABLE_PLUGIN_DIR)/$(BUILT_PLUGIN_LIBRARY): $(addprefix $(COVERABLE_PLUGIN_DIR)/,$(PLUGIN_OBJECTS)) cd $(COVERABLE_PLUGIN_DIR) && \ $(CXX) $(CXXFLAGS) \ $(PLUGIN_OBJECTS) \ $(GLIB_LIBS) \ $(MOZILLA_LIBS) \ -shared -o $@ stamps/build-fake-plugin.stamp: $(COVERABLE_PLUGIN_DIR) $(addprefix $(PLUGIN_SRCDIR)/,$(PLUGIN_SRC)) $(addprefix $(COVERABLE_PLUGIN_DIR)/,$(PLUGIN_OBJECTS)) stamps/liveconnect-dist.stamp $(COVERABLE_PLUGIN_DIR)/$(BUILT_PLUGIN_LIBRARY) touch $@ #warning, during this target tests.build/netx/jnlp_testsengine/tests-output.xml is backup and rewriten (but not coresponding html file) #xml results run with jacoco agent, however, can be wrong, co the new tests-output.xml is then renamed and orginal one restored stamps/run-reproducers-test-code-coverage-jacoco.stamp: stamps/run-netx-dist-tests.stamp $(REPRODUCERS_CLASS_NAMES) \ stamps/compile-jacoco-operator.stamp stamps/build-fake-plugin.stamp if WITH_JACOCO cd $(TESTS_DIR) ; \ for file in $(EMMA_MODIFIED_FILES) ; do \ mv $(TEST_EXTENSIONS_DIR)/$$file $(TEST_EXTENSIONS_DIR)/"$$file""$(EMMA_BACKUP_SUFFIX)" ; \ done ;\ echo "backuping javaws in $(DESTDIR)$(bindir)" ; \ javaws_backup=$(DESTDIR)$(bindir)/javaws_backup ; \ mv $(DESTDIR)$(bindir)/javaws $$javaws_backup ; \ echo "patching $(javaws)" ; \ nw_bootclasspath="$(LAUNCHER_BOOTCLASSPATH):$(JACOCO_CLASSPATH)" ; \ cat $$javaws_backup | sed "s|COMMAND.k.=\"..JAVA.\"|COMMAND[k]=\"\\$$\\{JAVA\\}\" ; k=1 ; COMMAND[k]=$(JACOCO_AGENT_JAVAWS_SWITCH)|" | sed "s,$(LAUNCHER_BOOTCLASSPATH),$$nw_bootclasspath," > $(DESTDIR)$(bindir)/$(javaws) ; \ chmod 777 $(DESTDIR)$(bindir)/$(javaws) ; \ echo "backuping plugin in $(DESTDIR)/$(libdir)$(BUILT_PLUGIN_LIBRARY)" ; \ plugin_backup=$(DESTDIR)$(libdir)/$(BUILT_PLUGIN_LIBRARY)_backup ; \ mv $(DESTDIR)$(libdir)/$(BUILT_PLUGIN_LIBRARY) $$plugin_backup ; \ echo "fakeing plugin" ; \ cp $(COVERABLE_PLUGIN_DIR)/$(BUILT_PLUGIN_LIBRARY) $(DESTDIR)$(libdir)/$(BUILT_PLUGIN_LIBRARY) ; \ testcases_srcs=( ) ; \ k=0 ; \ types=($(ALL_REPRODUCERS)); \ for which in "$${types[@]}" ; do \ . $(abs_top_srcdir)/NEW_LINE_IFS ; \ simpleReproducers=(`cat $(abs_top_builddir)/junit-jnlp-dist-$$which.txt `); \ IFS="$$IFS_BACKUP" ; \ for dir in "$${simpleReproducers[@]}" ; do \ testcases_srcs[k]="$(REPRODUCERS_TESTS_SRCDIR)/$$which/$$dir/testcases/" ; \ k=$$((k+1)) ; \ done ; \ done ; \ cd $(TEST_EXTENSIONS_DIR) ; \ class_names=`cat $(REPRODUCERS_CLASS_NAMES)` ; \ CLASSPATH=$(NETX_DIR)/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):.:$(TEST_EXTENSIONS_DIR):$(JACOCO_CLASSPATH):$(TEST_EXTENSIONS_TESTS_DIR):$(TEST_EXTENSIONS_SRCDIR) ; \ $(BOOT_DIR)/bin/java $(JACOCO_AGENT_SWITCH) $(REPRODUCERS_DPARAMETERS) \ -Xbootclasspath/a:$(RUNTIME):$$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 $(EMMA_MODIFIED_FILES) ; do \ mv $(TEST_EXTENSIONS_DIR)/$$file $(TEST_EXTENSIONS_DIR)/"$$file""$(EMMA_SUFFIX)" ; \ mv $(TEST_EXTENSIONS_DIR)/"$$file""$(EMMA_BACKUP_SUFFIX)" $(TEST_EXTENSIONS_DIR)/$$file ; \ done ; else echo "Sorry, coverage report cant be run without jacoco installed. Try installing jacoco or specify with-jacoco value" ; exit 5 endif touch $@ run-test-code-coverage-jacoco: stamps/run-unit-test-code-coverage-jacoco.stamp stamps/run-reproducers-test-code-coverage-jacoco.stamp if WITH_JACOCO cd $(TESTS_DIR) ; \ k=0 ; \ types=($(ALL_REPRODUCERS)); \ for which in "$${types[@]}" ; do \ . $(abs_top_srcdir)/NEW_LINE_IFS ; \ simpleReproducers=(`cat $(abs_top_builddir)/junit-jnlp-dist-$$which.txt `); \ IFS="$$IFS_BACKUP" ; \ for dir in "$${simpleReproducers[@]}" ; do \ testcases_srcs[k]="$(REPRODUCERS_TESTS_SRCDIR)/$$which/$$dir/testcases/" ; \ k=$$((k+1)) ; \ done ; \ done ; \ class_names=`cat $(REPRODUCERS_CLASS_NAMES)` ; \ $(JACOCO_OPERATOR_EXEC) \ merge --die-soon --input-files $(TEST_EXTENSIONS_DIR)/jacoco-merged-reproducers.exec $(NETX_UNIT_TEST_DIR)/jacoco.exec --output-file jacoco-merged.exec; \ $(JACOCO_OPERATOR_EXEC) \ report --html-output coverage --xml-output coverage.xml --input-file jacoco-merged.exec \ --input-srcs $(NETX_SRCDIR) $(PLUGIN_SRCDIR)/java $(JUNIT_RUNNER_SRCDIR) $(TEST_EXTENSIONS_SRCDIR) $(TEST_EXTENSIONS_TESTS_SRCDIR) "$${testcases_srcs[@]}" \ --input-builds $(NETX_DIR)/lib/classes.jar $(abs_top_builddir)/liveconnect/lib/classes.jar $(JUNIT_RUNNER_JAR) $(TEST_EXTENSIONS_DIR) $(TEST_EXTENSIONS_TESTS_DIR) \ --input-srcs $(NETX_UNIT_TEST_SRCDIR) \ --input-builds $(NETX_UNIT_TEST_DIR) \ --title "IcedTea-Web complete codecoverage" ; else echo "Sorry, coverage report cant be run without jacoco installed. Try installing jacoco or specify with-jacoco value" ; exit 5 endif run-test-code-coverage: stamps/run-unit-test-code-coverage.stamps stamps/run-reproducers-test-code-coverage.stamps if WITH_EMMA cd $(TESTS_DIR) ; \ k=0 ; \ 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]="-sp" ; \ k=$$((k+1)) ; \ testcases_srcs[k]="$(REPRODUCERS_TESTS_SRCDIR)/$$which/$$dir/testcases/" ; \ k=$$((k+1)) ; \ done ; \ done ; \ $(BOOT_DIR)/bin/java $(EMMA_JAVA_ARGS) -cp $(EMMA_JAR) emma merge \ -in $(NETX_UNIT_TEST_DIR)/coverage.es \ -in $(TEST_EXTENSIONS_DIR)/coverage.es ; \ $(BOOT_DIR)/bin/java $(EMMA_JAVA_ARGS) -cp $(EMMA_JAR) -Demma.report.html.out.encoding=UTF-8 emma report \ -Dreport.html.out.encoding=UTF-8 \ -in $(TESTS_DIR)/coverage.es \ -in $(TESTS_DIR)/coverage.em \ -sp $(NETX_SRCDIR) \ -sp $(NETX_UNIT_TEST_SRCDIR) \ -sp $(JUNIT_RUNNER_SRCDIR) \ -sp $(TEST_EXTENSIONS_SRCDIR) \ -sp $(TEST_EXTENSIONS_TESTS_SRCDIR) \ "$${testcases_srcs[@]}" \ -r html \ -r xml ; else echo "Sorry, coverage report cant be run without emma installed. Try install emma or specify with-emma 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=$(NETX_DIR)/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):.:$(TEST_EXTENSIONS_TESTS_DIR) ; \ $(BOOT_DIR)/bin/java $(REPRODUCERS_DPARAMETERS) \ -Xbootclasspath/a:$(RUNTIME):$$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=$(NETX_DIR)/lib/classes.jar:$(JUNIT_JAR):$(JUNIT_RUNNER_JAR):.:$(TEST_EXTENSIONS_TESTS_DIR) ; \ $(BOOT_DIR)/bin/java $(REPRODUCERS_DPARAMETERS) \ -Xbootclasspath/a:$(RUNTIME):$$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 clean-test-code-coverage 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-$(SOFTKILLER): rm -f $(TESTS_DIR)/softkiller clean-netx-dist-tests: clean_tests_reports netx-dist-tests-remove-cert-from-public clean-custom-reproducers clean-$(SOFTKILLER) rm -f test-extensions-source-files.txt rm -f test-extensions-tests-source-files.txt rm -f $(TEST_EXTENSIONS_COMPATIBILITY_SYMLINK) 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: if [ -e stamps/run-unit-test-code-coverage.stamp ]; then \ rm -rf $(NETX_UNIT_TEST_DIR)/coverage ; \ rm -f $(NETX_UNIT_TEST_DIR)/coverage.xml ; \ rm -f $(NETX_UNIT_TEST_DIR)/coverageX.es ; \ rm -f $(NETX_UNIT_TEST_DIR)/coverageX.ec ; \ rm -f $(NETX_UNIT_TEST_DIR)/coverage.es ; \ rm -f $(NETX_UNIT_TEST_DIR)/tests-output_withEmma.xml ; \ rm -f stamps/run-unit-test-code-coverage.stamp ; \ fi clean-reproducers-test-code-coverage: if [ -e stamps/run-reproducers-test-code-coverage.stamp ]; then \ rm -rf $(TEST_EXTENSIONS_DIR)/coverage ; \ rm -f $(TEST_EXTENSIONS_DIR)/coverage.xml ; \ rm -f $(TEST_EXTENSIONS_DIR)/coverage.es ; \ rm -f $(TEST_EXTENSIONS_DIR)/tests-output_withEmma.xml ; \ rm -f stamps/run-reproducers-test-code-coverage.stamp ; \ fi clean-test-code-coverage: clean-unit-test-code-coverage clean-reproducers-test-code-coverage if [ -e $(TESTS_DIR)/coverage.xml ]; then \ rm -rf $(TESTS_DIR)/coverage ; \ rm -f $(TESTS_DIR)/coverage.xml ; \ rm -f $(TESTS_DIR)/coverage.es ; \ rm -f $(TESTS_DIR)/coverage.em ; \ fi clean-unit-test-code-coverage-jacoco: if [ -e stamps/run-unit-test-code-coverage-jacoco.stamp ]; then \ rm -rf $(NETX_UNIT_TEST_DIR)/coverage ; \ rm -f $(NETX_UNIT_TEST_DIR)/coverage.xml ; \ rm -f $(NETX_UNIT_TEST_DIR)/jacoco.exec ; \ rm -f $(NETX_UNIT_TEST_DIR)/tests-output_withEmma.xml ; \ rm -f stamps/run-unit-test-code-coverage-jacoco.stamp ; \ fi clean-reproducers-test-code-coverage-jacoco: if [ -e stamps/run-reproducers-test-code-coverage-jacoco.stamp ]; then \ rm -rf $(TEST_EXTENSIONS_DIR)/coverage-javaws ; \ rm -f $(TEST_EXTENSIONS_DIR)/coverage-javaws.xml ; \ rm -f $(TEST_EXTENSIONS_DIR)/jacoco_javaws.exec ; \ rm -rf $(TEST_EXTENSIONS_DIR)/coverage-plugin ; \ rm -f $(TEST_EXTENSIONS_DIR)/coverage-plugin.xml ; \ rm -f $(TEST_EXTENSIONS_DIR)/jacoco_plugin.exec ; \ rm -rf $(TEST_EXTENSIONS_DIR)/coverage ; \ rm -f $(TEST_EXTENSIONS_DIR)/coverage.xml ; \ rm -f $(TEST_EXTENSIONS_DIR)/jacoco-merged-reproducers.exec ; \ rm -f $(TEST_EXTENSIONS_DIR)/tests-output_withEmma.xml ; \ rm -f stamps/run-reproducers-test-code-coverage-jacoco.stamp ; \ fi clean-test-code-coverage-jacoco: clean-unit-test-code-coverage-jacoco clean-reproducers-test-code-coverage-jacoco clean-test-code-coverage-tools-jacoco if [ -e $(TESTS_DIR)/coverage.xml ]; then \ rm -rf $(TESTS_DIR)/coverage ; \ rm -f $(TESTS_DIR)/jacoco-merged.exec; \ fi clean-test-code-coverage-tools-jacoco: rm -rf $(JACOCO_OPERATOR_DIR) rm -rf $(COVERABLE_PLUGIN_DIR) rm -f stamps/compile-jacoco-operator.stamp; rm -f jacoco-operator-source-files.txt rm -f stamps/build-fake-plugin.stamp # plugin tests if ENABLE_PLUGIN stamps/plugin-tests.stamp: $(PLUGIN_TEST_SRCS) stamps/plugin.stamp mkdir -p plugin/tests/LiveConnect $(BOOT_DIR)/bin/javac $(IT_JAVACFLAGS) \ -d plugin/tests/LiveConnect \ -classpath liveconnect/lib/classes.jar \ $(PLUGIN_TEST_SRCS) ; $(BOOT_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 # Bootstrap Directory Targets # =========================== stamps/native-ecj.stamp: mkdir -p stamps ; \ if test "x$(GCJ)" != "xno"; then \ $(GCJ) $(IT_CFLAGS) -Wl,-Bsymbolic -findirect-dispatch -o native-ecj \ --main=org.eclipse.jdt.internal.compiler.batch.Main ${ECJ_JAR} ; \ fi ; \ touch stamps/native-ecj.stamp clean-native-ecj: rm -f native-ecj rm -rf stamps/native-ecj.stamp # bootstrap stamps/bootstrap-directory.stamp: stamps/native-ecj.stamp mkdir -p $(BOOT_DIR)/bin stamps/ ln -sf $(JAVA) $(BOOT_DIR)/bin/java ln -sf $(JAR) $(BOOT_DIR)/bin/jar ln -sf $(abs_top_builddir)/javac $(BOOT_DIR)/bin/javac ln -sf $(JAVADOC) $(BOOT_DIR)/bin/javadoc if [ -e "$(KEYTOOL)" ] ; then \ ln -sf $(KEYTOOL) $(BOOT_DIR)/bin/keytool ;\ else \ echo "#! /bin/sh" > $(BOOT_DIR)/bin/keytool ;\ echo "echo \"keytool not exist on your system, signed part of reproducers test will fail\"" >> $(BOOT_DIR)/bin/keytool ;\ chmod 777 $(BOOT_DIR)/bin/keytool ;\ fi if [ -e "$(JARSIGNER)" ] ; then \ ln -sf $(JARSIGNER) $(BOOT_DIR)/bin/jarsigner ;\ else \ echo "#! /bin/sh" > $(BOOT_DIR)/bin/jarsigner ;\ echo "echo \"jarsigner not exist on your system, signed part of reproducers test will fail\"" >> $(BOOT_DIR)/bin/jarsigner ;\ chmod 777 $(BOOT_DIR)/bin/jarsigner ;\ fi mkdir -p $(BOOT_DIR)/jre/lib && \ ln -s $(SYSTEM_JRE_DIR)/lib/rt.jar $(BOOT_DIR)/jre/lib && \ if [ -e $(SYSTEM_JRE_DIR)/lib/jsse.jar ] ; then \ ln -s $(SYSTEM_JRE_DIR)/lib/jsse.jar $(BOOT_DIR)/jre/lib ; \ else \ ln -s rt.jar $(BOOT_DIR)/jre/lib/jsse.jar ; \ fi if [ -e $(SYSTEM_JRE_DIR)/lib/resources.jar ] ; then \ ln -s $(SYSTEM_JRE_DIR)/lib/resources.jar $(BOOT_DIR)/jre/lib ; \ else \ ln -s rt.jar $(BOOT_DIR)/jre/lib/resources.jar ; \ fi ln -sf $(SYSTEM_JRE_DIR)/lib/$(JRE_ARCH_DIR) \ $(BOOT_DIR)/jre/lib/ && \ if ! test -d $(BOOT_DIR)/jre/lib/$(INSTALL_ARCH_DIR); \ then \ ln -sf ./$(JRE_ARCH_DIR) \ $(BOOT_DIR)/jre/lib/$(INSTALL_ARCH_DIR); \ fi; mkdir -p $(BOOT_DIR)/include && \ for i in $(SYSTEM_JDK_DIR)/include/*; do \ test -r $$i | continue; \ i=`basename $$i`; \ rm -f $(BOOT_DIR)/include/$$i; \ ln -s $(SYSTEM_JDK_DIR)/include/$$i $(BOOT_DIR)/include/$$i; \ done mkdir -p stamps touch stamps/bootstrap-directory.stamp clean-bootstrap-directory: rm -rf $(BOOT_DIR) if [ -e ${abs_top_builddir}/bootstrap ] ; then \ rmdir ${abs_top_builddir}/bootstrap ; \ fi rm -f stamps/bootstrap-directory.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: stamps/run-unit-test-code-coverage.stamp run-reproducers-test-code-coverage: stamps/run-reproducers-test-code-coverage.stamp run-unit-test-code-coverage-jacoco: stamps/run-unit-test-code-coverage-jacoco.stamp run-reproducers-test-code-coverage-jacoco: stamps/run-reproducers-test-code-coverage-jacoco.stamp
  • Total tests run Passed Failed Errors
    " + (passed+failed+errored) + " " + passed + " " + failed + " " + errored + "