aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog27
-rw-r--r--tests/reproducers/signed/AppletTestSigned/resources/AppletTestSigned.html2
-rw-r--r--tests/reproducers/signed/AppletTestSigned/resources/AppletTestSigned2.html46
-rw-r--r--tests/reproducers/signed/AppletTestSigned/srcs/AppletTestSigned.java1
-rw-r--r--tests/reproducers/signed/AppletTestSigned/testcases/AppletTestSignedTests.java15
-rw-r--r--tests/test-extensions/net/sourceforge/jnlp/ClosingListener.java55
-rw-r--r--tests/test-extensions/net/sourceforge/jnlp/ProcessAssasin.java5
-rw-r--r--tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java32
-rw-r--r--tests/test-extensions/net/sourceforge/jnlp/closinglisteners/AutoAllClosingListener.java57
-rw-r--r--tests/test-extensions/net/sourceforge/jnlp/closinglisteners/AutoErrorClosingListener.java46
-rw-r--r--tests/test-extensions/net/sourceforge/jnlp/closinglisteners/AutoOkClosingListener.java48
-rw-r--r--tests/test-extensions/net/sourceforge/jnlp/closinglisteners/StringBasedClosingListener.java67
-rw-r--r--tests/test-extensions/net/sourceforge/jnlp/closinglisteners/StringMatchClosingListener.java53
13 files changed, 449 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index d8ea7fc..151fa9b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,31 @@
2012-09-24 Jiri Vanek <[email protected]>
+
+ * tests/reproducers/signed/AppletTestSigned/resources/AppletTestSigned.html:
+ removed unnecessary XslowX
+ * tests/reproducers/signed/AppletTestSigned/resources/AppletTestSigned2.html:
+ aded missing XslowX
+ * tests/reproducers/signed/AppletTestSigned/srcs/AppletTestSigned.java:
+ added standard closing sentence
+ * tests/reproducers/signed/AppletTestSigned/testcases/AppletTestSignedTests.java:
+ used auto*clsoing 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 <[email protected]>
Jana Fabrikova <[email protected]>
Reproducers are now correctly compiled against liveconect(plugin.jar)
diff --git a/tests/reproducers/signed/AppletTestSigned/resources/AppletTestSigned.html b/tests/reproducers/signed/AppletTestSigned/resources/AppletTestSigned.html
index 6c6ac48..0cf865d 100644
--- a/tests/reproducers/signed/AppletTestSigned/resources/AppletTestSigned.html
+++ b/tests/reproducers/signed/AppletTestSigned/resources/AppletTestSigned.html
@@ -37,7 +37,7 @@ exception statement from your version.
-->
<html><head></head><body bgcolor="red">
<p>
- <applet code="AppletTestSigned.class" archive="XslowXAppletTestSigned.jar" codebase="." width="100" height="100">
+ <applet code="AppletTestSigned.class" archive="AppletTestSigned.jar" codebase="." width="100" height="100">
<param name="key1" value="value1">
<param name="key2" value="#value2">
</applet>
diff --git a/tests/reproducers/signed/AppletTestSigned/resources/AppletTestSigned2.html b/tests/reproducers/signed/AppletTestSigned/resources/AppletTestSigned2.html
new file mode 100644
index 0000000..6c6ac48
--- /dev/null
+++ b/tests/reproducers/signed/AppletTestSigned/resources/AppletTestSigned2.html
@@ -0,0 +1,46 @@
+<!--
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+IcedTea is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version.
+
+ -->
+<html><head></head><body bgcolor="red">
+<p>
+ <applet code="AppletTestSigned.class" archive="XslowXAppletTestSigned.jar" codebase="." width="100" height="100">
+ <param name="key1" value="value1">
+ <param name="key2" value="#value2">
+ </applet>
+</p>
+</body>
+</html>
diff --git a/tests/reproducers/signed/AppletTestSigned/srcs/AppletTestSigned.java b/tests/reproducers/signed/AppletTestSigned/srcs/AppletTestSigned.java
index 1d475a5..be7282d 100644
--- a/tests/reproducers/signed/AppletTestSigned/srcs/AppletTestSigned.java
+++ b/tests/reproducers/signed/AppletTestSigned/srcs/AppletTestSigned.java
@@ -48,6 +48,7 @@ public class AppletTestSigned extends Applet {
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) {
}
diff --git a/tests/reproducers/signed/AppletTestSigned/testcases/AppletTestSignedTests.java b/tests/reproducers/signed/AppletTestSigned/testcases/AppletTestSignedTests.java
index 8c9e2e7..6622514 100644
--- a/tests/reproducers/signed/AppletTestSigned/testcases/AppletTestSignedTests.java
+++ b/tests/reproducers/signed/AppletTestSigned/testcases/AppletTestSignedTests.java
@@ -84,15 +84,24 @@ public class AppletTestSignedTests extends BrowserTest {
@Test
@TestInBrowsers(testIn = {Browsers.all})
- public void AppletTestSignedFirefoxTest() throws Exception {
+ public void AppletTestSignedFirefoxTestXslowX() throws Exception {
ServerAccess.PROCESS_TIMEOUT = 30 * 1000;
try {
- ProcessResult pr = server.executeBrowser("/AppletTestSigned.html");
+ ProcessResult pr = server.executeBrowser("/AppletTestSigned2.html");
evaluateSignedApplet(pr, false);
- Assert.assertTrue(pr.wasTerminated);
+ //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_BOTH);
+ evaluateSignedApplet(pr, false);
+ //Assert.assertTrue(pr.wasTerminated);
+ //Assert.assertEquals((Integer) 0, pr.returnValue); due to destroy is null
+ }
}
diff --git a/tests/test-extensions/net/sourceforge/jnlp/ClosingListener.java b/tests/test-extensions/net/sourceforge/jnlp/ClosingListener.java
new file mode 100644
index 0000000..b9997ec
--- /dev/null
+++ b/tests/test-extensions/net/sourceforge/jnlp/ClosingListener.java
@@ -0,0 +1,55 @@
+/* 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);
+ }
+}
diff --git a/tests/test-extensions/net/sourceforge/jnlp/ProcessAssasin.java b/tests/test-extensions/net/sourceforge/jnlp/ProcessAssasin.java
index b435eeb..e5dda22 100644
--- a/tests/test-extensions/net/sourceforge/jnlp/ProcessAssasin.java
+++ b/tests/test-extensions/net/sourceforge/jnlp/ProcessAssasin.java
@@ -98,6 +98,11 @@ class ProcessAssasin extends Thread {
return skipInstedOfDesroy;
}
+ void setTimeout(long timeout) {
+ this.timeout = timeout;
+ }
+
+
@Override
public void run() {
long startTime = System.nanoTime() / ServerAccess.NANO_TIME_DELIMITER;
diff --git a/tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java b/tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java
index 62b502b..148378e 100644
--- a/tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java
+++ b/tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java
@@ -1,5 +1,5 @@
/* ServerAccess.java
-Copyright (C) 2011 Red Hat, Inc.
+Copyright (C) 2011, 2012 Red Hat, Inc.
This file is part of IcedTea.
@@ -58,6 +58,8 @@ import java.util.List;
import net.sourceforge.jnlp.browsertesting.Browser;
import net.sourceforge.jnlp.browsertesting.BrowserFactory;
import net.sourceforge.jnlp.browsertesting.Browsers;
+import net.sourceforge.jnlp.closinglisteners.AutoErrorClosingListener;
+import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener;
import org.junit.Assert;
/**
@@ -77,6 +79,11 @@ import org.junit.Assert;
*/
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
@@ -545,6 +552,20 @@ public class ServerAccess {
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);
}
@@ -797,6 +818,8 @@ public class ServerAccess {
log(connectionMesaage, true, true);
}
ProcessAssasin pa = new ProcessAssasin(t, PROCESS_TIMEOUT);
+ setUpClosingListener(stdoutl, pa, t);
+ setUpClosingListener(stderrl, pa, t);
pa.start();
t.start();
while (t.getP() == null && t.deadlyException == null) {
@@ -834,6 +857,13 @@ public class ServerAccess {
return pr;
}
+ private static void setUpClosingListener(ContentReaderListener listener, ProcessAssasin pa, ThreadedProcess t) {
+ if (listener != null && (listener instanceof ClosingListener)) {
+ ((ClosingListener) listener).setAssasin(pa);
+ ((ClosingListener) listener).setProcess(t);
+ }
+ }
+
/**
* this is temprary solution until refactoring is fully done
* Use net.sourceforge.jnlp.ProcessResult instead
diff --git a/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/AutoAllClosingListener.java b/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/AutoAllClosingListener.java
new file mode 100644
index 0000000..933fce6
--- /dev/null
+++ b/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/AutoAllClosingListener.java
@@ -0,0 +1,57 @@
+/* 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();
+ }
+ }
+
+}
diff --git a/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/AutoErrorClosingListener.java b/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/AutoErrorClosingListener.java
new file mode 100644
index 0000000..aa42e1d
--- /dev/null
+++ b/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/AutoErrorClosingListener.java
@@ -0,0 +1,46 @@
+/* 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);
+ }
+}
diff --git a/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/AutoOkClosingListener.java b/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/AutoOkClosingListener.java
new file mode 100644
index 0000000..c4cfa00
--- /dev/null
+++ b/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/AutoOkClosingListener.java
@@ -0,0 +1,48 @@
+/* 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);
+ }
+
+}
diff --git a/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/StringBasedClosingListener.java b/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/StringBasedClosingListener.java
new file mode 100644
index 0000000..ab6b28e
--- /dev/null
+++ b/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/StringBasedClosingListener.java
@@ -0,0 +1,67 @@
+/* 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;
+ }
+
+
+}
diff --git a/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/StringMatchClosingListener.java b/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/StringMatchClosingListener.java
new file mode 100644
index 0000000..3d9d52c
--- /dev/null
+++ b/tests/test-extensions/net/sourceforge/jnlp/closinglisteners/StringMatchClosingListener.java
@@ -0,0 +1,53 @@
+/* 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.
+ */
+
+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();
+ }
+ }
+}