changeset 1175:b395e5d3050b

Fixing xdg tests * netx/net/sourceforge/jnlp/config/PathsAndFiles.java: some elements made public - DEPLOYMENT_SUBDIR_DIR and XDG*VAR * tests/reproducers/simple/simpletest1/testcases/XDGspecificationTests.java: fixed issues with permissions attribute dialogue (faked deployment.properties everywhere), fixed issues with same key in set copmmand everywhere, added test for duplicated key in set, fixed issue with remianing icons and generated jnlps
author Jiri Vanek <jvanek@redhat.com>
date Fri, 13 Mar 2015 16:21:54 +0100
parents ca12027fa85b
children 1ce1486f84d6
files ChangeLog netx/net/sourceforge/jnlp/config/PathsAndFiles.java tests/reproducers/simple/simpletest1/testcases/XDGspecificationTests.java
diffstat 3 files changed, 177 insertions(+), 88 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Mar 13 16:01:56 2015 +0100
+++ b/ChangeLog	Fri Mar 13 16:21:54 2015 +0100
@@ -1,3 +1,14 @@
+2015-03-13  Jiri Vanek  <jvanek@redhat.com>
+
+	Fixing xdg tests
+	* netx/net/sourceforge/jnlp/config/PathsAndFiles.java: some elements made
+	public - DEPLOYMENT_SUBDIR_DIR and XDG*VAR
+	* tests/reproducers/simple/simpletest1/testcases/XDGspecificationTests.java:
+	fixed issues with permissions attribute dialogue (faked deployment.properties
+	everywhere), fixed issues with same key in set copmmand everywhere, added 
+	test for duplicated key in set, fixed issue with remianing icons and generated
+	jnlps
+
 2015-03-13  Jiri Vanek  <jvanek@redhat.com>
 
 	Docs now include possible options for each property
--- a/netx/net/sourceforge/jnlp/config/PathsAndFiles.java	Fri Mar 13 16:01:56 2015 +0100
+++ b/netx/net/sourceforge/jnlp/config/PathsAndFiles.java	Fri Mar 13 16:21:54 2015 +0100
@@ -49,7 +49,7 @@
 
 public class PathsAndFiles {
 
-    private static final String DEPLOYMENT_SUBDIR_DIR = "icedtea-web";
+    public static final String DEPLOYMENT_SUBDIR_DIR = "icedtea-web";
 
     private static final String CONFIG_HOME;
     private static final String CACHE_HOME;
@@ -58,9 +58,9 @@
     public static final String USER_CONFIG_HOME;
     public static final String USER_CACHE_HOME;
     public static final String USER_SECURITY;
-    private static final String XDG_CONFIG_HOME_VAR = "XDG_CONFIG_HOME";
-    private static final String XDG_CACHE_HOME_VAR = "XDG_CACHE_HOME";
-    private static final String XDG_RUNTIME_DIR_VAR = "XDG_RUNTIME_DIR";
+    public static final String XDG_CONFIG_HOME_VAR = "XDG_CONFIG_HOME";
+    public static final String XDG_CACHE_HOME_VAR = "XDG_CACHE_HOME";
+    public static final String XDG_RUNTIME_DIR_VAR = "XDG_RUNTIME_DIR";
     private static final String XDG_DATA_HOME = "XDG_DATA_HOME";
     private static final String TMP_PROP = "java.io.tmpdir";
     private static final String HOME_PROP = "user.home";
--- a/tests/reproducers/simple/simpletest1/testcases/XDGspecificationTests.java	Fri Mar 13 16:01:56 2015 +0100
+++ b/tests/reproducers/simple/simpletest1/testcases/XDGspecificationTests.java	Fri Mar 13 16:21:54 2015 +0100
@@ -1,38 +1,38 @@
 /* 
-Copyright (C) 2011 Red Hat, Inc.
+ Copyright (C) 2011 Red Hat, Inc.
 
-This file is part of IcedTea.
+ This file is part of IcedTea.
 
-IcedTea is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License as published by
-the Free Software Foundation, version 2.
+ IcedTea is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2.
 
-IcedTea is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
+ IcedTea is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with IcedTea; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
+ You should have received a copy of the GNU General Public License
+ along with IcedTea; see the file COPYING.  If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301 USA.
 
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library.  Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
+ Linking this library statically or dynamically with other modules is
+ making a combined work based on this library.  Thus, the terms and
+ conditions of the GNU General Public License cover the whole
+ combination.
 
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module.  An independent module is a module which is not derived from
-or based on this library.  If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so.  If you do not wish to do so, delete this
-exception statement from your version.
+ As a special exception, the copyright holders of this library give you
+ permission to link this library with independent modules to produce an
+ executable, regardless of the license terms of these independent
+ modules, and to copy and distribute the resulting executable under
+ terms of your choice, provided that you also meet, for each linked
+ independent module, the terms and conditions of the license of that
+ module.  An independent module is a module which is not derived from
+ or based on this library.  If you modify this library, you may extend
+ this exception to your version of the library, 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;
@@ -56,6 +56,7 @@
 import net.sourceforge.jnlp.browsertesting.Browsers;
 import net.sourceforge.jnlp.browsertesting.browsers.firefox.FirefoxProfilesOperator;
 import net.sourceforge.jnlp.closinglisteners.RulesFolowingClosingListener;
+import net.sourceforge.jnlp.config.PathsAndFiles;
 import org.junit.Assert;
 import org.junit.After;
 import org.junit.AfterClass;
@@ -66,8 +67,6 @@
 @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 {
@@ -92,8 +91,8 @@
         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);
+        String XDG_CONFIG_HOME_value = System.getenv(PathsAndFiles.XDG_CONFIG_HOME_VAR);
+        String XDG_CACHE_HOME_value = System.getenv(PathsAndFiles.XDG_CACHE_HOME_VAR);
         if (XDG_CONFIG_HOME_value != null) {
             configHome = XDG_CONFIG_HOME_value;
         }
@@ -104,6 +103,23 @@
         realCache = new File(cacheHome + File.separator + "icedtea-web");
     }
 
+    // When current root is backuped,
+    // also new files, which legacy impl is not aware about
+    // cold be copied. Remove them in fake root
+    // if they are not, then firstrun cleanup fails, and so second prints unexpected warnings
+    public static void removeUnsupportedLegacyFiles() {
+        File gjp = new File(oldRoot, "generated_jnlps");
+        File icons = new File(oldRoot, "icons");
+        if (gjp.exists()) {
+            deleteRecursively(gjp);
+        }
+        if (icons.exists()) {
+            deleteRecursively(icons);
+        }
+        Assert.assertFalse(gjp.exists());
+        Assert.assertFalse(icons.exists());
+    }
+
     @BeforeClass
     public static void backup() throws IOException {
         File base = tmpDir();
@@ -151,8 +167,8 @@
         cache.mkdirs();
         List<Backup> l = new ArrayList<Backup>();
         mv(oldRoot, base, l);
-        mv(realCache, config, l);
-        mv(realConfig, cache, l);
+        mv(realCache, cache, l);
+        mv(realConfig, config, l);
         return l;
     }
 
@@ -205,7 +221,7 @@
             Entry<String, String> 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)) {
+            if (entry.getKey().equals(PathsAndFiles.XDG_CACHE_HOME_VAR) || entry.getKey().equals(PathsAndFiles.XDG_CONFIG_HOME_VAR)) {
                 ServerAccess.logOutputReprint("ignoring " + s);
                 c++;
             } else {
@@ -242,12 +258,12 @@
             Entry<String, String> entry = it.next();
             String v = entry.getValue();
             String s = entry.getKey() + "=" + v;
-            if (entry.getKey().equals(XDG_CACHE_HOME)) {
+            if (entry.getKey().equals(PathsAndFiles.XDG_CACHE_HOME_VAR)) {
                 ServerAccess.logOutputReprint(entry.getKey() + " was " + v);
                 v = cacheF.getAbsolutePath();
                 ServerAccess.logOutputReprint("set " + v);
                 cache = true;
-            } else if (entry.getKey().equals(XDG_CONFIG_HOME)) {
+            } else if (entry.getKey().equals(PathsAndFiles.XDG_CONFIG_HOME_VAR)) {
                 ServerAccess.logOutputReprint(entry.getKey() + " was " + v);
                 v = configF.getAbsolutePath();
                 ServerAccess.logOutputReprint("set " + v);
@@ -260,23 +276,23 @@
             ServerAccess.logOutputReprint("was no cache");
             String v = cacheF.getAbsolutePath();
             ServerAccess.logOutputReprint("set " + v);
-            String s = XDG_CACHE_HOME + "=" + v;
+            String s = PathsAndFiles.XDG_CACHE_HOME_VAR + "=" + v;
             l.add(s);
         }
         if (!config) {
             ServerAccess.logOutputReprint("was no config");
             String v = configF.getAbsolutePath();
             ServerAccess.logOutputReprint("set " + v);
-            String s = XDG_CONFIG_HOME + "=" + v;
+            String s = PathsAndFiles.XDG_CONFIG_HOME_VAR + "=" + v;
             l.add(s);
         }
 
-
         return l.toArray(new String[l.size()]);
     }
 
     private static void createFakeOldHomeCache() throws Exception {
         File tmp = tmpDir();
+        fakeExtendedSecurity(new File(tmp, PathsAndFiles.DEPLOYMENT_SUBDIR_DIR));
         try {
             ProcessWrapper pw = new ProcessWrapper(
                     server.getJavawsLocation(),
@@ -287,7 +303,7 @@
                     setXdgVAlues(tmp, tmp));
             ProcessResult pr = pw.execute();
             Assert.assertTrue(simpletests2Run.toPassingString(), simpletests2Run.evaluate(pr.stderr));
-            File currentConfigCache = new File(tmp, "icedtea-web");
+            File currentConfigCache = new File(tmp, PathsAndFiles.DEPLOYMENT_SUBDIR_DIR);
             File oldIcedTea = new File(new File(System.getProperty("user.home")) + File.separator + ".icedtea");
             boolean a = currentConfigCache.renameTo(oldIcedTea);
             Assert.assertTrue("creation of old cache by renaming " + currentConfigCache + " to " + oldIcedTea + " failed", a);
@@ -312,19 +328,19 @@
             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"
+                        //one impl of new parser was unable to handle duplicates
+                        "set", "oldBaf", "differentOldBaf"
                     }));
             pw2.setVars(setXdgVAlues(tmp, tmp));
             ProcessResult pr2 = pw2.execute();
             Assert.assertTrue(notMoving.toPassingString(), notMoving.evaluate(pr1.stdout));
             Assert.assertTrue(notMoving.toPassingString(), notMoving.evaluate(pr2.stdout));
             Assert.assertTrue(unknownProperty.toPassingString(), unknownProperty.evaluate(pr2.stdout));
-            File currentConfigCache = new File(tmp, "icedtea-web");
+            File currentConfigCache = new File(tmp, PathsAndFiles.DEPLOYMENT_SUBDIR_DIR);
             File oldIcedTea = new File(new File(System.getProperty("user.home")) + File.separator + ".icedtea");
             boolean a = currentConfigCache.renameTo(oldIcedTea);
             Assert.assertTrue("creation of old config by renaming " + currentConfigCache + " to " + oldIcedTea + " failed", a);
@@ -445,32 +461,32 @@
     }
 
     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";
+        String configHome = System.getProperty("user.home") + File.separator + ".config" + File.separator + PathsAndFiles.DEPLOYMENT_SUBDIR_DIR;
+        String cacheHome = System.getProperty("user.home") + File.separator + ".cache" + File.separator + PathsAndFiles.DEPLOYMENT_SUBDIR_DIR;
         assertMainFiles(
                 listToString(getContentOfDirectory(new File(configHome))) + "\n"
                 + listToString(getContentOfDirectory(new File(cacheHome))), s1, s2, a1);
     }
 
     private static void assertConfigFilesInHome(boolean certs, boolean trust, boolean props) {
-        String configHome = System.getProperty("user.home") + File.separator + ".config" + File.separator + "icedtea-web";
-        String cacheHome = System.getProperty("user.home") + File.separator + ".cache" + File.separator + "icedtea-web";
+        String configHome = System.getProperty("user.home") + File.separator + ".config" + File.separator + PathsAndFiles.DEPLOYMENT_SUBDIR_DIR;
+        String cacheHome = System.getProperty("user.home") + File.separator + ".cache" + File.separator + PathsAndFiles.DEPLOYMENT_SUBDIR_DIR;
         assertConfigFiles(
                 listToString(getContentOfDirectory(new File(configHome))) + "\n"
                 + listToString(getContentOfDirectory(new File(cacheHome))), certs, trust, props);
     }
 
     private static void assertNotMainFilesInHome(boolean s1, boolean s2, boolean a1) {
-        String configHome = System.getProperty("user.home") + File.separator + ".config" + File.separator + "icedtea-web";
-        String cacheHome = System.getProperty("user.home") + File.separator + ".cache" + File.separator + "icedtea-web";
+        String configHome = System.getProperty("user.home") + File.separator + ".config" + File.separator + PathsAndFiles.DEPLOYMENT_SUBDIR_DIR;
+        String cacheHome = System.getProperty("user.home") + File.separator + ".cache" + File.separator + PathsAndFiles.DEPLOYMENT_SUBDIR_DIR;
         assertNotMainFiles(
                 listToString(getContentOfDirectory(new File(configHome))) + "\n"
                 + listToString(getContentOfDirectory(new File(cacheHome))), s1, s2, a1);
     }
 
     private static void assertNotConfigFilesInHome(boolean certs, boolean trust, boolean props) {
-        String configHome = System.getProperty("user.home") + File.separator + ".config" + File.separator + "icedtea-web";
-        String cacheHome = System.getProperty("user.home") + File.separator + ".cache" + File.separator + "icedtea-web";
+        String configHome = System.getProperty("user.home") + File.separator + ".config" + File.separator + PathsAndFiles.DEPLOYMENT_SUBDIR_DIR;
+        String cacheHome = System.getProperty("user.home") + File.separator + ".cache" + File.separator + PathsAndFiles.DEPLOYMENT_SUBDIR_DIR;
         assertNotConfigFiles(
                 listToString(getContentOfDirectory(new File(configHome))) + "\n"
                 + listToString(getContentOfDirectory(new File(cacheHome))), certs, trust, props);
@@ -508,12 +524,19 @@
     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);
+        //we need fake security and manifests
+        File ff = new File(PathsAndFiles.USER_CONFIG_HOME);
+        try {
+            fakeExtendedSecurity(ff);
+            ProcessWrapper pw = new ProcessWrapper(server.getJavawsLocation(), null, server.getUrl("simpletest1.jnlp"), (ContentReaderListener) null, null, removeXdgVAlues());
+            ProcessResult pr = pw.execute();
+            Assert.assertTrue(simpletests1Run.toPassingString(), simpletests1Run.evaluate(pr.stdout));
+            Assert.assertTrue(notMoving.toPassingString(), notMoving.evaluate(pr.stdout));
+            assertMainFilesInHome(true, false, false);
+            assertOldNotMainFilesInHome(true, true, true);
+        } finally {
+            deleteRecursively(ff);
+        }
     }
 
     @Test
@@ -522,6 +545,9 @@
         try {
             assertNotMainFiles(listToString(getContentOfDirectory(f)), true, true, true);
             assertOldNotMainFilesInHome(true, true, true);
+            //we need fake security and manifests
+            File ff = new File(f, "customConfig/" + PathsAndFiles.DEPLOYMENT_SUBDIR_DIR);
+            fakeExtendedSecurity(ff);
             ProcessWrapper pw = new ProcessWrapper(server.getJavawsLocation(), null, server.getUrl("simpletest1.jnlp"), (ContentReaderListener) null, null, setXdgVAlues(f));
             ProcessResult pr = pw.execute();
             Assert.assertTrue(simpletests1Run.toPassingString(), simpletests1Run.evaluate(pr.stdout));
@@ -540,6 +566,9 @@
             assertNotMainFiles(listToString(getContentOfDirectory(f)), true, true, true);
             assertOldNotMainFilesInHome(true, true, true);
             f.delete();
+            //we need fake security and manifests
+            File ff = new File(f, "customConfig/" + PathsAndFiles.DEPLOYMENT_SUBDIR_DIR);
+            fakeExtendedSecurity(ff);
             ProcessWrapper pw = new ProcessWrapper(server.getJavawsLocation(), null, server.getUrl("simpletest1.jnlp"), (ContentReaderListener) null, null, setXdgVAlues(f));
             ProcessResult pr = pw.execute();
             Assert.assertTrue(simpletests1Run.toPassingString(), simpletests1Run.evaluate(pr.stdout));
@@ -640,38 +669,46 @@
      */
     @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);
-
+        File ff = new File(PathsAndFiles.USER_CONFIG_HOME);
+        try {
+            assertNotMainFilesInHome(true, true, true);
+            assertOldNotMainFilesInHome(true, true, true);
+            createFakeOldHomeCache();
+            removeUnsupportedLegacyFiles();
+            ProcessWrapper pw1 = new ProcessWrapper(server.getJavawsLocation(), null, server.getUrl("simpletest1.jnlp"), (ContentReaderListener) null, null, removeXdgVAlues());
+            ProcessResult pr1 = pw1.execute();
+            Assert.assertTrue(simpletests1Run.toPassingString(), simpletests1Run.evaluate(pr1.stdout));
+            Assert.assertTrue(moving.toPassingString(), moving.evaluate(pr1.stdout));
+            assertMainFilesInHome(true, true, false);
+            assertOldNotMainFilesInHome(true, true, true);
+            fakeExtendedSecurity(ff);
+            ProcessWrapper pw2 = new ProcessWrapper(server.getJavawsLocation(), null, server.getUrl("simpletest1.jnlp"), (ContentReaderListener) null, null, removeXdgVAlues());
+            ProcessResult pr2 = pw2.execute();
+            Assert.assertTrue(simpletests1Run.toPassingString(), simpletests1Run.evaluate(pr2.stdout));
+            Assert.assertTrue(notMoving.toPassingString(), notMoving.evaluate(pr2.stdout));
+            assertMainFilesInHome(true, true, false);
+            assertOldNotMainFilesInHome(true, true, true);
+        } finally {
+            deleteRecursively(ff);
+        }
     }
 
     @Test
     public void runJavawsWithXdg_oldIcedTeaConfigExisted() throws Exception {
         File f = tmpDir();
+        File ff = new File(PathsAndFiles.USER_CONFIG_HOME);
         try {
             assertNotMainFiles(listToString(getContentOfDirectory(f)), true, true, true);
             assertOldNotMainFilesInHome(true, true, true);
             createFakeOldHomeCache();
+            removeUnsupportedLegacyFiles();
             ProcessWrapper pw = new ProcessWrapper(server.getJavawsLocation(), null, server.getUrl("simpletest1.jnlp"), (ContentReaderListener) null, null, setXdgVAlues(f));
             ProcessResult pr = pw.execute();
             Assert.assertTrue(simpletests1Run.toPassingString(), simpletests1Run.evaluate(pr.stdout));
             Assert.assertTrue(moving.toPassingString(), moving.evaluate(pr.stdout));
             assertMainFiles(listToString(getContentOfDirectory(f)), true, true, false);
             assertOldNotMainFilesInHome(true, true, true);
+            fakeExtendedSecurity(ff);
             ProcessWrapper pw2 = new ProcessWrapper(server.getJavawsLocation(), null, server.getUrl("simpletest1.jnlp"), (ContentReaderListener) null, null, removeXdgVAlues());
             ProcessResult pr2 = pw2.execute();
             Assert.assertTrue(simpletests1Run.toPassingString(), simpletests1Run.evaluate(pr2.stdout));
@@ -680,23 +717,27 @@
             assertOldNotMainFilesInHome(true, true, true);
         } finally {
             deleteRecursively(f);
+            deleteRecursively(ff);
         }
     }
 
     @Test
     public void runJavawsWithXdgAndNoParent_oldIcedTeaConfigExisted() throws Exception {
         File f = tmpDir();
+        File ff = new File(PathsAndFiles.USER_CONFIG_HOME);
         try {
             assertNotMainFiles(listToString(getContentOfDirectory(f)), true, true, true);
             assertOldNotMainFilesInHome(true, true, true);
             createFakeOldHomeCache();
             f.delete();
+            removeUnsupportedLegacyFiles();
             ProcessWrapper pw = new ProcessWrapper(server.getJavawsLocation(), null, server.getUrl("simpletest1.jnlp"), (ContentReaderListener) null, null, setXdgVAlues(f));
             ProcessResult pr = pw.execute();
             Assert.assertTrue(simpletests1Run.toPassingString(), simpletests1Run.evaluate(pr.stdout));
             Assert.assertTrue(moving.toPassingString(), moving.evaluate(pr.stdout));
             assertMainFiles(listToString(getContentOfDirectory(f)), true, true, false);
             assertOldNotMainFilesInHome(true, true, true);
+            fakeExtendedSecurity(ff);
             ProcessWrapper pw2 = new ProcessWrapper(server.getJavawsLocation(), null, server.getUrl("simpletest1.jnlp"), (ContentReaderListener) null, null, removeXdgVAlues());
             ProcessResult pr2 = pw2.execute();
             Assert.assertTrue(simpletests1Run.toPassingString(), simpletests1Run.evaluate(pr2.stdout));
@@ -705,6 +746,7 @@
             assertOldNotMainFilesInHome(true, true, true);
         } finally {
             deleteRecursively(f);
+            deleteRecursively(ff);
         }
     }
 
@@ -844,7 +886,8 @@
             pw.setArgs(Arrays.asList(
                     new String[]{
                         new File(server.getJavawsFile().getParentFile(), "itweb-settings").getAbsolutePath(),
-                        "set", "blah", "blah"
+                        //one impl of new parser was unable to handle duplicates
+                        "set", "blah", "differentBlah"
                     }));
             pw.setVars(removeXdgVAlues());
             ProcessResult pr = pw.execute();
@@ -869,7 +912,8 @@
             pw.setArgs(Arrays.asList(
                     new String[]{
                         new File(server.getJavawsFile().getParentFile(), "itweb-settings").getAbsolutePath(),
-                        "set", "blah", "blah"
+                        //one impl of new parser was unable to handle duplicates
+                        "set", "blah", "differentBlah"
                     }));
             pw.setVars(setXdgVAlues(f));
             ProcessResult pr = pw.execute();
@@ -898,7 +942,8 @@
             pw1.setArgs(Arrays.asList(
                     new String[]{
                         new File(server.getJavawsFile().getParentFile(), "itweb-settings").getAbsolutePath(),
-                        "set", "blah", "blah"
+                        //one impl of new parser was unable to handle duplicates
+                        "set", "blah", "differentBlah"
                     }));
             pw1.setVars(removeXdgVAlues());
             ProcessResult pr1 = pw1.execute();
@@ -911,7 +956,8 @@
             pw2.setArgs(Arrays.asList(
                     new String[]{
                         new File(server.getJavawsFile().getParentFile(), "itweb-settings").getAbsolutePath(),
-                        "set", "baf", "baf"
+                        //one impl of new parser was unable to handle duplicates
+                        "set", "baf", "differentBaf"
                     }));
             pw2.setVars(removeXdgVAlues());
             ProcessResult pr2 = pw2.execute();
@@ -938,7 +984,8 @@
             pw1.setArgs(Arrays.asList(
                     new String[]{
                         new File(server.getJavawsFile().getParentFile(), "itweb-settings").getAbsolutePath(),
-                        "set", "blah", "blah"
+                        //one impl of new parser was unable to handle duplicates
+                        "set", "blah", "differentBlah"
                     }));
             pw1.setVars(setXdgVAlues(f));
             ProcessResult pr = pw1.execute();
@@ -950,7 +997,8 @@
             pw2.setArgs(Arrays.asList(
                     new String[]{
                         new File(server.getJavawsFile().getParentFile(), "itweb-settings").getAbsolutePath(),
-                        "set", "baf", "baf"
+                        //one impl of new parser was unable to handle duplicates
+                        "set", "baf", "differentBaf"
                     }));
             pw2.setVars(removeXdgVAlues());
             ProcessResult pr2 = pw2.execute();
@@ -970,7 +1018,7 @@
             Assert.assertTrue("creation of directories for " + file + " failed", a);
         }
         File f = new File(file, "deployment.properties");
-        ServerAccess.saveFile("deployment.security.level = ALLOW_UNSIGNED", f);
+        ServerAccess.saveFile("deployment.security.level = ALLOW_UNSIGNED\ndeployment.manifest.attributes.check=false", f);
     }
 
     /*
@@ -981,7 +1029,8 @@
     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"));
+        //intentionally hardoced default
+        fakeExtendedSecurity(new File(System.getProperty("user.home") + File.separator + ".config" + File.separator + PathsAndFiles.DEPLOYMENT_SUBDIR_DIR));
         ProcessWrapper pw = new ProcessWrapper();
         pw.setArgs(Arrays.asList(
                 new String[]{
@@ -1004,7 +1053,7 @@
         try {
             assertNotMainFiles(listToString(getContentOfDirectory(f)), true, true, true);
             assertOldNotMainFilesInHome(true, true, true);
-            fakeExtendedSecurity(new File(f.getAbsolutePath() + File.separator + "customConfig" + File.separator + "icedtea-web"));
+            fakeExtendedSecurity(new File(f.getAbsolutePath() + File.separator + "customConfig" + File.separator + PathsAndFiles.DEPLOYMENT_SUBDIR_DIR));
             ProcessWrapper pw = new ProcessWrapper();
             pw.setArgs(Arrays.asList(
                     new String[]{
@@ -1100,4 +1149,33 @@
             deleteRecursively(f);
         }
     }
+
+    @Test
+    //this test is unrelated to XDG, bus it testing issue in new option parser.
+    //when this test was under fixing, it was found, that parser is unable to handle two same params in set
+    //this is reproducing it. 
+    @Bug(id = "http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2015-March/031049.html")
+    public void runItwCmdInCleanSystemWithNoXdgAndWithTwoSameValuesInCMD() throws Exception {
+        long t = ServerAccess.PROCESS_TIMEOUT;
+        ServerAccess.PROCESS_TIMEOUT = 5000;
+        try {
+            assertNotConfigFilesInHome(true, true, true);
+            assertOldNotConfigFilesInHome(true, true, true);
+            ProcessWrapper pw = new ProcessWrapper();
+            pw.setArgs(Arrays.asList(
+                    new String[]{
+                        new File(server.getJavawsFile().getParentFile(), "itweb-settings").getAbsolutePath(),
+                        //one impl of new parser was unable to handle duplicates
+                        "set", "blah", "blah"
+                    }));
+            pw.setVars(removeXdgVAlues());
+            ProcessResult pr = pw.execute();
+            Assert.assertTrue(notMoving.toPassingString(), notMoving.evaluate(pr.stdout));
+            Assert.assertTrue(unknownProperty.toPassingString(), unknownProperty.evaluate(pr.stdout));
+            assertConfigFilesInHome(false, false, true);
+            assertOldNotConfigFilesInHome(true, true, true);
+        } finally {
+            ServerAccess.PROCESS_TIMEOUT = t;
+        }
+    }
 }