/hg/icedtea-web: Fixed XDGspecificationTests to survive with she...

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

/hg/icedtea-web: Fixed XDGspecificationTests to survive with she...

jvanek
changeset 54f9b40dd843 in /hg/icedtea-web
details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=54f9b40dd843
author: Jiri Vanek <[hidden email]>
date: Thu Nov 09 17:17:27 2017 +0100

        Fixed XDGspecificationTests to survive with shell scripts of .sh suffix

        * tests/reproducers/simple/simpletest1/testcases/XDGspecificationTests.java: now using system getItwebSettingsFile call
        * tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java: added getItwebSettingsFile  and getIPolicyEditorFile methods to guess those binaries from javaws, as those can be now .sh or none suffix


diffstat:

 ChangeLog                                                                 |   7 ++
 tests/reproducers/simple/simpletest1/testcases/XDGspecificationTests.java |  30 +++++-----
 tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java              |  28 +++++++++
 3 files changed, 50 insertions(+), 15 deletions(-)

diffs (190 lines):

diff -r c234bad6f599 -r 54f9b40dd843 ChangeLog
--- a/ChangeLog Wed Nov 08 11:37:01 2017 +0000
+++ b/ChangeLog Thu Nov 09 17:17:27 2017 +0100
@@ -1,3 +1,10 @@
+2017-11-09  Jiri Vanek <[hidden email]>
+
+ Fixed XDGspecificationTests to survive with shell scripts of .sh suffix
+ * tests/reproducers/simple/simpletest1/testcases/XDGspecificationTests.java: now using system getItwebSettingsFile call
+ * tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java: added getItwebSettingsFile  and getIPolicyEditorFile methods
+ to guess those binaries from javaws, as those can be now .sh or none suffix
+
 2017-11-02  Jiri Vanek <[hidden email]>
 
  Deprecated shell launchers, added skeleton for future rust launcher
diff -r c234bad6f599 -r 54f9b40dd843 tests/reproducers/simple/simpletest1/testcases/XDGspecificationTests.java
--- a/tests/reproducers/simple/simpletest1/testcases/XDGspecificationTests.java Wed Nov 08 11:37:01 2017 +0000
+++ b/tests/reproducers/simple/simpletest1/testcases/XDGspecificationTests.java Thu Nov 09 17:17:27 2017 +0100
@@ -327,7 +327,7 @@
             ProcessWrapper pw1 = new ProcessWrapper();
             pw1.setArgs(Arrays.asList(
                     new String[]{
-                        new File(server.getJavawsFile().getParentFile(), "itweb-settings").getAbsolutePath()
+                       server.getItwebSettingsFile().getAbsolutePath()
                     }));
             pw1.setVars(setXdgVAlues(tmp, tmp));
             ProcessResult pr1 = pw1.execute();
@@ -335,7 +335,7 @@
             ProcessWrapper pw2 = new ProcessWrapper();
             pw2.setArgs(Arrays.asList(
                     new String[]{
-                        new File(server.getJavawsFile().getParentFile(), "itweb-settings").getAbsolutePath(),
+                       server.getItwebSettingsFile().getAbsolutePath(),
                         //one impl of new parser was unable to handle duplicates
                         "set", "oldBaf", "differentOldBaf"
                     }));
@@ -796,7 +796,7 @@
             ProcessWrapper pw = new ProcessWrapper();
             pw.setArgs(Arrays.asList(
                     new String[]{
-                        new File(server.getJavawsFile().getParentFile(), "itweb-settings").getAbsolutePath()
+                       server.getItwebSettingsFile().getAbsolutePath()
                     }));
             pw.setVars(removeXdgVAlues());
             ProcessResult pr = pw.execute();
@@ -819,7 +819,7 @@
             ProcessWrapper pw = new ProcessWrapper();
             pw.setArgs(Arrays.asList(
                     new String[]{
-                        new File(server.getJavawsFile().getParentFile(), "itweb-settings").getAbsolutePath()
+                       server.getItwebSettingsFile().getAbsolutePath()
                     }));
             pw.setVars(setXdgVAlues(f));
             ProcessResult pr = pw.execute();
@@ -846,7 +846,7 @@
             ProcessWrapper pw1 = new ProcessWrapper();
             pw1.setArgs(Arrays.asList(
                     new String[]{
-                        new File(server.getJavawsFile().getParentFile(), "itweb-settings").getAbsolutePath()
+                       server.getItwebSettingsFile().getAbsolutePath()
                     }));
             pw1.setVars(removeXdgVAlues());
             ProcessResult pr1 = pw1.execute();
@@ -857,7 +857,7 @@
             ProcessWrapper pw2 = new ProcessWrapper();
             pw2.setArgs(Arrays.asList(
                     new String[]{
-                        new File(server.getJavawsFile().getParentFile(), "itweb-settings").getAbsolutePath()
+                       server.getItwebSettingsFile().getAbsolutePath()
                     }));
             pw2.setVars(removeXdgVAlues());
             ProcessResult pr2 = pw2.execute();
@@ -882,7 +882,7 @@
             ProcessWrapper pw1 = new ProcessWrapper();
             pw1.setArgs(Arrays.asList(
                     new String[]{
-                        new File(server.getJavawsFile().getParentFile(), "itweb-settings").getAbsolutePath()
+                       server.getItwebSettingsFile().getAbsolutePath()
                     }));
             pw1.setVars(setXdgVAlues(f));
             ProcessResult pr = pw1.execute();
@@ -892,7 +892,7 @@
             ProcessWrapper pw2 = new ProcessWrapper();
             pw2.setArgs(Arrays.asList(
                     new String[]{
-                        new File(server.getJavawsFile().getParentFile(), "itweb-settings").getAbsolutePath()
+                       server.getItwebSettingsFile().getAbsolutePath()
                     }));
             pw2.setVars(removeXdgVAlues());
             ProcessResult pr2 = pw2.execute();
@@ -918,7 +918,7 @@
             ProcessWrapper pw = new ProcessWrapper();
             pw.setArgs(Arrays.asList(
                     new String[]{
-                        new File(server.getJavawsFile().getParentFile(), "itweb-settings").getAbsolutePath(),
+                       server.getItwebSettingsFile().getAbsolutePath(),
                         //one impl of new parser was unable to handle duplicates
                         "set", "blah", "differentBlah"
                     }));
@@ -944,7 +944,7 @@
             ProcessWrapper pw = new ProcessWrapper();
             pw.setArgs(Arrays.asList(
                     new String[]{
-                        new File(server.getJavawsFile().getParentFile(), "itweb-settings").getAbsolutePath(),
+                       server.getItwebSettingsFile().getAbsolutePath(),
                         //one impl of new parser was unable to handle duplicates
                         "set", "blah", "differentBlah"
                     }));
@@ -974,7 +974,7 @@
             ProcessWrapper pw1 = new ProcessWrapper();
             pw1.setArgs(Arrays.asList(
                     new String[]{
-                        new File(server.getJavawsFile().getParentFile(), "itweb-settings").getAbsolutePath(),
+                       server.getItwebSettingsFile().getAbsolutePath(),
                         //one impl of new parser was unable to handle duplicates
                         "set", "blah", "differentBlah"
                     }));
@@ -988,7 +988,7 @@
             ProcessWrapper pw2 = new ProcessWrapper();
             pw2.setArgs(Arrays.asList(
                     new String[]{
-                        new File(server.getJavawsFile().getParentFile(), "itweb-settings").getAbsolutePath(),
+                       server.getItwebSettingsFile().getAbsolutePath(),
                         //one impl of new parser was unable to handle duplicates
                         "set", "baf", "differentBaf"
                     }));
@@ -1016,7 +1016,7 @@
             ProcessWrapper pw1 = new ProcessWrapper();
             pw1.setArgs(Arrays.asList(
                     new String[]{
-                        new File(server.getJavawsFile().getParentFile(), "itweb-settings").getAbsolutePath(),
+                       server.getItwebSettingsFile().getAbsolutePath(),
                         //one impl of new parser was unable to handle duplicates
                         "set", "blah", "differentBlah"
                     }));
@@ -1029,7 +1029,7 @@
             ProcessWrapper pw2 = new ProcessWrapper();
             pw2.setArgs(Arrays.asList(
                     new String[]{
-                        new File(server.getJavawsFile().getParentFile(), "itweb-settings").getAbsolutePath(),
+                       server.getItwebSettingsFile().getAbsolutePath(),
                         //one impl of new parser was unable to handle duplicates
                         "set", "baf", "differentBaf"
                     }));
@@ -1197,7 +1197,7 @@
             ProcessWrapper pw = new ProcessWrapper();
             pw.setArgs(Arrays.asList(
                     new String[]{
-                        new File(server.getJavawsFile().getParentFile(), "itweb-settings").getAbsolutePath(),
+                       server.getItwebSettingsFile().getAbsolutePath(),
                         //one impl of new parser was unable to handle duplicates
                         "set", "blah", "blah"
                     }));
diff -r c234bad6f599 -r 54f9b40dd843 tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java
--- a/tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java Wed Nov 08 11:37:01 2017 +0000
+++ b/tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java Thu Nov 09 17:17:27 2017 +0100
@@ -325,6 +325,34 @@
     public File getJavawsFile() {
         return new File(System.getProperty(JAVAWS_BUILD_BIN));
     }
+    
+    /**
+     *
+     * @return - file pointing to itweb-settings deducted from passed inside
+     * javaws binary location (JAVAWS_BUILD_BIN)
+     */
+    public File getItwebSettingsFile() {
+        String itwebSettings = "itweb-settings";
+        return getFileInJavawsDir(itwebSettings);
+    }
+    
+        /**
+     *
+     * @return - file pointing to itweb-settings deducted from passed inside
+     * javaws binary location (JAVAWS_BUILD_BIN)
+     */
+    public File getIPolicyEditorFile() {
+        String policyeditor = "policyeditor";
+        return getFileInJavawsDir(policyeditor);
+    }
+
+    private File getFileInJavawsDir(String file) {
+        String javawsNameRoot = "javaws";
+        File dir = getJavawsFile().getParentFile();
+        String name = getJavawsFile().getName();
+        String nwName = name.replace(javawsNameRoot, file);
+        return new File(dir, nwName);
+    }
 
     /**
      *