/hg/icedtea-web: 2 new changesets

jkang at icedtea.classpath.org jkang at icedtea.classpath.org
Mon Apr 13 14:40:16 UTC 2015


changeset a5e268a5b6dd in /hg/icedtea-web
details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=a5e268a5b6dd
author: Jie Kang <jkang at redhat.com>
date: Mon Apr 13 10:32:57 2015 -0400

	Add reproducers for jnlp_href attribute

	2015-04-13  Jie Kang  <jkang at redhat.com>
	    Add reproducers for jnlp_href attribute
	    * tests/reproducers/simple/JnlpHrefAttribute/resources/JnlpHrefAttribute.html:
	    * tests/reproducers/simple/JnlpHrefAttribute/resources/JnlpHrefAttribute.jnlp:
	    * tests/reproducers/simple/JnlpHrefAttribute/srcs/JnlpHrefAttribute.java:
	    * tests/reproducers/simple/JnlpHrefAttribute/testcases/JnlpHrefAttributeTest.java:
	    Added test for firefox/opera that succeeds with attribute and test for
	    midori/epiphany that fails with attribute


changeset 0488d15d3f0e in /hg/icedtea-web
details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=0488d15d3f0e
author: Jie Kang <jkang at redhat.com>
date: Mon Apr 13 10:38:15 2015 -0400

	Kill processes in Integration Tests more cleanly; revised

	2015-04-13  Jie Kang  <jkang at redhat.com>
	    Kill processes in Integration Tests more cleanly; revised
	    * Makefile.am:
	    remove all instances of softkiller (softkiller no longer works)
	    * tests/test-extensions/net/sourceforge/jnlp/ProcessAssasin.java:
	    use SIGTERM instead of SIGINT, don't destroy process after sending signal
	    * tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java:
	    reduce timeout from 20 seconds to 10
	    * tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/Firefox.java:
	    remove usage of softkiller to close tabs
	    * tests/softkiller/Makefile:
	    * tests/softkiller/softkiller.c:
	    remove softkiller


diffstat:

 ChangeLog                                                                       |   23 +
 Makefile.am                                                                     |   14 +-
 tests/reproducers/simple/JnlpHrefAttribute/resources/JnlpHrefAttribute.html     |   15 +
 tests/reproducers/simple/JnlpHrefAttribute/resources/JnlpHrefAttribute.jnlp     |   51 +
 tests/reproducers/simple/JnlpHrefAttribute/srcs/JnlpHrefAttribute.java          |   49 +
 tests/reproducers/simple/JnlpHrefAttribute/testcases/JnlpHrefAttributeTest.java |   69 +
 tests/softkiller/Makefile                                                       |    9 -
 tests/softkiller/softkiller.c                                                   |  443 ----------
 tests/test-extensions/net/sourceforge/jnlp/ProcessAssasin.java                  |   34 +-
 tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java                    |    2 +-
 tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/Firefox.java |    5 -
 11 files changed, 215 insertions(+), 499 deletions(-)

diffs (truncated from 820 to 500 lines):

diff -r ebcd2aaa59c7 -r 0488d15d3f0e ChangeLog
--- a/ChangeLog	Mon Apr 13 14:59:38 2015 +0200
+++ b/ChangeLog	Mon Apr 13 10:38:15 2015 -0400
@@ -1,3 +1,26 @@
+2015-04-13  Jie Kang  <jkang at redhat.com>
+	Kill processes in Integration Tests more cleanly; revised
+    * Makefile.am:
+    remove all instances of softkiller (softkiller no longer works)
+	* tests/test-extensions/net/sourceforge/jnlp/ProcessAssasin.java:
+	use SIGTERM instead of SIGINT, don't destroy process after sending signal
+	* tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java:
+	reduce timeout from 20 seconds to 10
+	* tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/Firefox.java:
+	remove usage of softkiller to close tabs
+    * tests/softkiller/Makefile:
+    * tests/softkiller/softkiller.c:
+    remove softkiller
+
+2015-04-13  Jie Kang  <jkang at redhat.com>
+	Add reproducers for jnlp_href attribute
+	* tests/reproducers/simple/JnlpHrefAttribute/resources/JnlpHrefAttribute.html:
+	* tests/reproducers/simple/JnlpHrefAttribute/resources/JnlpHrefAttribute.jnlp:	
+	* tests/reproducers/simple/JnlpHrefAttribute/srcs/JnlpHrefAttribute.java:
+	* tests/reproducers/simple/JnlpHrefAttribute/testcases/JnlpHrefAttributeTest.java:
+	Added test for firefox/opera that succeeds with attribute and test for
+	midori/epiphany that fails with attribute
+
 2015-04-13  Jiri Vanek  <jvanek at redhat.com>
 
 	set single place for keystore operations
diff -r ebcd2aaa59c7 -r 0488d15d3f0e Makefile.am
--- a/Makefile.am	Mon Apr 13 14:59:38 2015 +0200
+++ b/Makefile.am	Mon Apr 13 10:38:15 2015 -0400
@@ -52,7 +52,6 @@
 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
@@ -980,14 +979,9 @@
 	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/netx.stamp stamps/junit-jnlp-dist-dirs stamps/netx-dist-tests-import-cert-to-public \
  stamps/test-extensions-compile.stamp stamps/compile-reproducers-testcases.stamp $(JUNIT_RUNNER_JAR) stamps/copy-reproducers-resources.stamp\
  $(TESTS_DIR)/$(REPORT_STYLES_DIRNAME) $(REPRODUCERS_CLASS_NAMES) stamps/process-custom-reproducers.stamp
 	cd $(TEST_EXTENSIONS_DIR) ; \
@@ -1404,10 +1398,7 @@
 	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)
+clean-netx-dist-tests: clean_tests_reports netx-dist-tests-remove-cert-from-public clean-custom-reproducers
 	rm -f test-extensions-source-files.txt
 	rm -f test-extensions-tests-source-files.txt
 	rm -f $(TEST_EXTENSIONS_COMPATIBILITY_SYMLINK)
@@ -1474,7 +1465,6 @@
 	rm -f jacoco-operator-source-files.txt
 	rm -f stamps/build-fake-plugin.stamp
 
-
 # plugin tests
 
 if ENABLE_PLUGIN
diff -r ebcd2aaa59c7 -r 0488d15d3f0e tests/reproducers/simple/JnlpHrefAttribute/resources/JnlpHrefAttribute.html
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/reproducers/simple/JnlpHrefAttribute/resources/JnlpHrefAttribute.html	Mon Apr 13 10:38:15 2015 -0400
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head lang="en">
+    <meta charset="UTF-8">
+    <title></title>
+</head>
+<body>
+<applet id='applet' code='JnlpHrefAttribute'
+        jnlp_href="JnlpHrefAttribute.jnlp"
+        width=640 height=480 MAYSCRIPT
+        scriptable=true>
+</applet>
+
+</body>
+</html>
\ No newline at end of file
diff -r ebcd2aaa59c7 -r 0488d15d3f0e tests/reproducers/simple/JnlpHrefAttribute/resources/JnlpHrefAttribute.jnlp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/reproducers/simple/JnlpHrefAttribute/resources/JnlpHrefAttribute.jnlp	Mon Apr 13 10:38:15 2015 -0400
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="utf-8"?>
+<jnlp spec="1.0" href="JnlpHrefAttribute.jnlp">
+  <information>
+    <title>simple application</title>
+    <vendor>IcedTea</vendor>
+    <homepage href="http://icedtea.classpath.org/wiki/IcedTea-Web#Testing_IcedTea-Web"/>
+  </information>
+  <resources>
+    <j2se version="1.6+"/>
+    <jar href="JnlpHrefAttribute.jar"/>
+  </resources>
+  <applet-desc main-class="JnlpHrefAttribute">
+  </applet-desc>
+</jnlp>
+
+<!--
+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.
+-->
diff -r ebcd2aaa59c7 -r 0488d15d3f0e tests/reproducers/simple/JnlpHrefAttribute/srcs/JnlpHrefAttribute.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/reproducers/simple/JnlpHrefAttribute/srcs/JnlpHrefAttribute.java	Mon Apr 13 10:38:15 2015 -0400
@@ -0,0 +1,49 @@
+/*
+Copyright (C) 2014 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation, version 2.
+
+IcedTea is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version.
+ */
+import java.lang.System;
+import java.applet.Applet;
+
+public class JnlpHrefAttribute extends Applet {
+
+    private static final String initStr = "*** APPLET FINISHED ***";
+
+    @Override
+    public void init() {
+        System.out.println(initStr);
+    }
+
+}
\ No newline at end of file
diff -r ebcd2aaa59c7 -r 0488d15d3f0e tests/reproducers/simple/JnlpHrefAttribute/testcases/JnlpHrefAttributeTest.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/reproducers/simple/JnlpHrefAttribute/testcases/JnlpHrefAttributeTest.java	Mon Apr 13 10:38:15 2015 -0400
@@ -0,0 +1,69 @@
+/*
+Copyright (C) 2014 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation, version 2.
+
+IcedTea is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version.
+ */
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import net.sourceforge.jnlp.ProcessResult;
+import net.sourceforge.jnlp.annotations.NeedsDisplay;
+import net.sourceforge.jnlp.annotations.TestInBrowsers;
+import net.sourceforge.jnlp.browsertesting.BrowserTest;
+import net.sourceforge.jnlp.browsertesting.Browsers;
+import net.sourceforge.jnlp.closinglisteners.AutoErrorClosingListener;
+import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener;
+
+public class JnlpHrefAttributeTest extends BrowserTest {
+    @Test
+    @TestInBrowsers(testIn = { Browsers.firefox, Browsers.opera})
+    @NeedsDisplay
+    public void testJnlpHrefAttributeWorks() throws Exception {
+        String url = "./JnlpHrefAttribute.html";
+        ProcessResult pr = server.executeBrowser(url, new AutoOkClosingListener(), new AutoOkClosingListener());
+        Assert.assertTrue("The stdout should contain " + AutoOkClosingListener.MAGICAL_OK_CLOSING_STRING + ", but it didnt.", pr.stdout.contains(AutoOkClosingListener.MAGICAL_OK_CLOSING_STRING));
+    }
+
+    @Test
+    @TestInBrowsers(testIn = { Browsers.midori, Browsers.epiphany})
+    @NeedsDisplay
+    public void testJnlpHrefAttributeDoesNotWork() throws Exception {
+        String url = "./JnlpHrefAttribute.html";
+        ProcessResult pr = server.executeBrowser(url, new AutoErrorClosingListener(), new AutoErrorClosingListener());
+        Assert.assertFalse("The stdout should not contain " + AutoOkClosingListener.MAGICAL_OK_CLOSING_STRING + ", but it did.", pr.stdout.contains(AutoOkClosingListener.MAGICAL_OK_CLOSING_STRING));
+    }
+
+
+}
diff -r ebcd2aaa59c7 -r 0488d15d3f0e tests/softkiller/Makefile
--- a/tests/softkiller/Makefile	Mon Apr 13 14:59:38 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-# we need c99 because of snprintf function!
-# (this function does not exist in C89/ANSI C)
-
-softkiller:	softkiller.c
-	$(CC) -Wall -pedantic -std=c99 -o $@ $< -lX11
-
-clean:
-	rm softkiller
-
diff -r ebcd2aaa59c7 -r 0488d15d3f0e tests/softkiller/softkiller.c
--- a/tests/softkiller/softkiller.c	Mon Apr 13 14:59:38 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,443 +0,0 @@
-/* X Window app killer
- *
- * Author: Pavel Tisnovsky <ptisnovs at redhat.com>
- *
- * 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 <stdio.h>
-#include <stdlib.h>
-#include <glob.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <X11/Xlib.h>
-#include <X11/Xatom.h>
-
-/*
- * 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);
-    }


More information about the distro-pkg-dev mailing list